litos-ui 0.17.5 → 0.18.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 (161) hide show
  1. package/README.md +49 -49
  2. package/lib/animation-CTt9qgA7.js +4 -0
  3. package/lib/base-Dm0WS1pK.js +62 -0
  4. package/lib/base.js +111 -147
  5. package/lib/button/index.d.ts +8 -3
  6. package/lib/button/index.js +2 -137
  7. package/lib/button-CC5PmAb1.js +146 -0
  8. package/lib/calendar/index.d.ts +10 -5
  9. package/lib/calendar/index.js +2 -123
  10. package/lib/calendar-DeP6yZB0.js +149 -0
  11. package/lib/carousel/index.js +2 -280
  12. package/lib/carousel/item.js +2 -15
  13. package/lib/carousel-D4Fe3LEx.js +272 -0
  14. package/lib/check/checkbox.js +2 -18
  15. package/lib/check/checkbox_group.js +6 -6
  16. package/lib/check/radio.js +2 -15
  17. package/lib/check/radio_group.js +9 -9
  18. package/lib/check-B0XraJvb.js +73 -0
  19. package/lib/check-CvGaONEx.js +117 -0
  20. package/lib/checkbox-DbWsmAaL.js +16 -0
  21. package/lib/collapse/index.d.ts +18 -11
  22. package/lib/collapse/index.js +2 -88
  23. package/lib/collapse/item.d.ts +28 -9
  24. package/lib/collapse/item.js +2 -115
  25. package/lib/collapse/types.d.ts +7 -0
  26. package/lib/collapse-CeKRZ-43.js +104 -0
  27. package/lib/color_picker/index.js +2 -42
  28. package/lib/color_picker-D0brKFm-.js +41 -0
  29. package/lib/date_picker/index.d.ts +23 -0
  30. package/lib/date_picker/index.js +3 -0
  31. package/lib/date_picker-DQGoiN8v.js +103 -0
  32. package/lib/date_picker_ori/index.js +2 -129
  33. package/lib/date_picker_ori-aRuSSi9D.js +122 -0
  34. package/lib/description_panel/index.js +2 -66
  35. package/lib/description_panel-Df_8rVbX.js +57 -0
  36. package/lib/dialog/dialog_container.js +2 -131
  37. package/lib/dialog/index.js +67 -85
  38. package/lib/dialog_container-DcN87wj0.js +126 -0
  39. package/lib/esm-sVEoAVPu.js +244 -0
  40. package/lib/form/form_item.d.ts +1 -0
  41. package/lib/form/form_item.js +2 -136
  42. package/lib/form/index.js +2 -147
  43. package/lib/form-DdU0yK0k.js +154 -0
  44. package/lib/form_inner-DR9tyB_r.js +117 -0
  45. package/lib/form_item-Bv-YafZK.js +137 -0
  46. package/lib/icon/arrow_down.js +12 -12
  47. package/lib/icon/arrow_left.js +9 -9
  48. package/lib/icon/arrow_right.js +9 -9
  49. package/lib/icon/arrow_up.js +12 -12
  50. package/lib/icon/base.d.ts +16 -2
  51. package/lib/icon/base.js +2 -38
  52. package/lib/icon/calendar.d.ts +5 -0
  53. package/lib/icon/calendar.js +10 -0
  54. package/lib/icon/caret_bottom.js +9 -9
  55. package/lib/icon/caret_top.js +9 -9
  56. package/lib/icon/close.js +9 -9
  57. package/lib/icon/close_filled.js +12 -12
  58. package/lib/icon/d_arrow_left.js +12 -12
  59. package/lib/icon/d_arrow_right.js +12 -12
  60. package/lib/icon/font_icon.d.ts +2 -3
  61. package/lib/icon/font_icon.js +35 -39
  62. package/lib/icon/info.js +12 -12
  63. package/lib/icon/loading.js +9 -9
  64. package/lib/icon/moon.js +12 -12
  65. package/lib/icon/more.js +12 -12
  66. package/lib/icon/reduction.js +12 -12
  67. package/lib/icon/refresh.d.ts +5 -0
  68. package/lib/icon/refresh.js +10 -0
  69. package/lib/icon/refresh_left.js +12 -12
  70. package/lib/icon/refresh_right.js +9 -9
  71. package/lib/icon/search.js +9 -9
  72. package/lib/icon/select.js +12 -12
  73. package/lib/icon/sort.js +9 -9
  74. package/lib/icon/success.js +12 -12
  75. package/lib/icon/sun.js +12 -12
  76. package/lib/icon/theme_default.js +12 -12
  77. package/lib/icon/warn.js +12 -12
  78. package/lib/icon/zoom_in.js +12 -12
  79. package/lib/icon/zoom_out.js +12 -12
  80. package/lib/image/image_preview.js +2 -104
  81. package/lib/image/index.js +2 -176
  82. package/lib/image-CeQVfS-v.js +162 -0
  83. package/lib/image_preview-PzZzwo6m.js +92 -0
  84. package/lib/index.d.ts +10 -4
  85. package/lib/index.js +80 -169
  86. package/lib/input/index.d.ts +6 -2
  87. package/lib/input/index.js +188 -203
  88. package/lib/input-DjKxcxry.js +4 -0
  89. package/lib/input_inner-BKJg9n9A.js +4 -0
  90. package/lib/item-Cuw_ZPyn.js +14 -0
  91. package/lib/item-DV842Aux.js +57 -0
  92. package/lib/item-ZXLWFzSm.js +119 -0
  93. package/lib/list/index.js +2 -58
  94. package/lib/list-CU7vHS6s.js +51 -0
  95. package/lib/loading/index.d.ts +3 -2
  96. package/lib/loading/index.js +109 -127
  97. package/lib/mask/index.js +2 -105
  98. package/lib/mask-BlV5QfTj.js +112 -0
  99. package/lib/md_input/index.js +2 -60
  100. package/lib/md_input-DSQx5TMW.js +58 -0
  101. package/lib/menu/index.js +2 -105
  102. package/lib/menu/menu_item.js +2 -21
  103. package/lib/menu/sub_menu.js +2 -83
  104. package/lib/menu-DAtplYAH.js +91 -0
  105. package/lib/menu_item-BW1Tu11Q.js +20 -0
  106. package/lib/message/index.js +67 -60
  107. package/lib/modal/index.js +2 -196
  108. package/lib/modal/modal_box.js +87 -86
  109. package/lib/modal-DWyWrN-D.js +192 -0
  110. package/lib/page_header/index.js +2 -109
  111. package/lib/page_header-DdeRDN4U.js +101 -0
  112. package/lib/pagination/index.js +2 -248
  113. package/lib/pagination-BoPzSPjT.js +210 -0
  114. package/lib/polygon/index.js +2 -27
  115. package/lib/polygon-C4Ow2lxi.js +20 -0
  116. package/lib/qrcode/index.d.ts +13 -4
  117. package/lib/qrcode/index.js +2 -57
  118. package/lib/qrcode-BFxsD_OP.js +64 -0
  119. package/lib/radio-2mNSYujz.js +13 -0
  120. package/lib/select/index.js +3 -401
  121. package/lib/select-CAgggYh7.js +326 -0
  122. package/lib/select_ori/index.js +47 -50
  123. package/lib/space/index.js +2 -35
  124. package/lib/space-CpTmBfHP.js +38 -0
  125. package/lib/sub_menu-D1s8ABNu.js +75 -0
  126. package/lib/switch/index.js +2 -50
  127. package/lib/switch-BaVBi5Ip.js +48 -0
  128. package/lib/tabbar/index.js +2 -109
  129. package/lib/tabbar/item.js +2 -58
  130. package/lib/tabbar-4_d2Fj1n.js +91 -0
  131. package/lib/table/index.js +2 -269
  132. package/lib/table-Hifj8jAX.js +234 -0
  133. package/lib/tabs/index.js +38 -42
  134. package/lib/tag/index.js +2 -72
  135. package/lib/tag-DPENZf_V.js +76 -0
  136. package/lib/theme/index.js +2 -89
  137. package/lib/theme/theme_color.js +22 -26
  138. package/lib/theme-BRTI2-Yk.js +83 -0
  139. package/lib/utils/clickoutside.js +18 -18
  140. package/lib/utils/context_provide.js +21 -21
  141. package/lib/utils/event.js +13 -18
  142. package/lib/utils/index.js +55 -58
  143. package/lib/utils/popover.d.ts +4 -1
  144. package/lib/utils/popover.js +276 -352
  145. package/lib/utils/transition.js +33 -31
  146. package/package.json +10 -11
  147. package/styles/container.css +4 -0
  148. package/styles/datepicker.css +55 -0
  149. package/styles/popover.css +14 -1
  150. package/lib/animation-DttknHkX.js +0 -4
  151. package/lib/calendar/langs.js +0 -8
  152. package/lib/carousel/timer.js +0 -19
  153. package/lib/check/check.js +0 -118
  154. package/lib/check/index.js +0 -68
  155. package/lib/check-CksURvTv.js +0 -4
  156. package/lib/form/form_inner.js +0 -125
  157. package/lib/form/types.js +0 -1
  158. package/lib/index-CrMiSe0x.js +0 -249
  159. package/lib/index-DY6m9Wbe.js +0 -4
  160. package/lib/litos-ui.css +0 -1
  161. package/lib/table/types.js +0 -1
@@ -1,204 +1,189 @@
1
- import { $one as c, on as h, formatStyle as f, off as p, addClass as o, removeClass as u, $ as d, $$ as n } from "ph-utils/dom";
2
- import { unitNumberStr as b, parseAttrValue as m } from "../utils/index.js";
3
- import g from "../form/form_inner.js";
4
- import { i as _ } from "../index-DY6m9Wbe.js";
5
- class I extends g {
6
- static baseName = "input";
7
- /** 自定义输入解析器 */
8
- parser;
9
- $inner;
10
- constructor() {
11
- super(), this._state = {
12
- type: "text",
13
- placeholder: "",
14
- autosize: !1,
15
- allowInput: void 0,
16
- block: !1,
17
- clearable: !1
18
- };
19
- }
20
- set value(t) {
21
- this.setValue(t), this.$inner && (this.$inner.value = t);
22
- }
23
- get value() {
24
- return this.getValue();
25
- }
26
- static get observedAttributes() {
27
- return [
28
- "disabled",
29
- "value",
30
- "name",
31
- "inner-block",
32
- "error",
33
- "clearable",
34
- "maxlength",
35
- "minlength",
36
- "inputmode",
37
- "type",
38
- "placeholder",
39
- "width",
40
- "block"
41
- ];
42
- }
43
- connectedCallback() {
44
- this.loadStyleText([_]), super.connectedCallback(), this.$inner = c(".l-input__inner", this.root), h(this.$inner, "input", this._input), h(this.$inner, "change", this.#s), this.style.cssText = f(this._getStyleObj()) + this.getAttr("style", ""), this._updateError(this._state.error != null);
45
- }
46
- disconnectedCallback() {
47
- super.disconnectedCallback(), p(this.$inner, "input", this._input);
48
- }
49
- attributeChange(t, s, e) {
50
- switch (t) {
51
- case "error":
52
- case "maxlength":
53
- case "minlength":
54
- case "inputmode":
55
- case "placeholder":
56
- case "type":
57
- this._state[t] = e;
58
- break;
59
- case "clearable":
60
- case "block":
61
- const a = m(e, !1, t);
62
- this._state[t] = a;
63
- break;
64
- case "width":
65
- this._state.width = b(e);
66
- break;
67
- }
68
- }
69
- updateDOM(t) {
70
- t.has("clearable") && (this._state.clearable ? o(this, "l-input--clearable") : u(this, "l-input--clearable")), t.has("error") && this._updateError(this._state.error != null), t.has("maxlength") && this._updateAttr("maxlength", this._state.maxlength), t.has("minlength") && this._updateAttr("minlength", this._state.minlength), t.has("inputmode") && this._updateAttr("inputmode", this._state.inputmode), t.has("block") && this.innerBlockChange(this._state.block);
71
- }
72
- _updateAttr(t, s) {
73
- this.$inner && (s ? this.$inner.setAttribute(t, s) : this.$inner.removeAttribute(t));
74
- }
75
- render() {
76
- const t = document.createDocumentFragment();
77
- if (d('[slot="prefix"]', this).length > 0) {
78
- const i = n("slot", {
79
- name: "prefix"
80
- }), l = n("span", {
81
- class: "l-input__prefix",
82
- part: "prefix"
83
- });
84
- l.appendChild(i), t.appendChild(l);
85
- }
86
- const e = n("input", {
87
- class: "l-input__inner",
88
- value: this.value,
89
- name: this.getName(),
90
- placeholder: this._state.placeholder,
91
- part: "default",
92
- type: this._state.type,
93
- inputmode: this._state.inputmode,
94
- maxlength: this._state.maxlength,
95
- minlength: this._state.minlength,
96
- disabled: this.isDisabled() ? !0 : void 0
97
- });
98
- if (t.appendChild(e), d('[slot="suffix"]', this).length > 0) {
99
- const i = n("slot", {
100
- name: "suffix"
101
- }), l = n("span", {
102
- class: "l-input__suffix",
103
- part: "suffix"
104
- });
105
- l.appendChild(i), t.appendChild(l);
106
- }
107
- return t;
108
- }
109
- /**
110
- * 设置自定义的输入解析器
111
- * @param cb
112
- */
113
- setParser(t) {
114
- this.parser = t;
115
- }
116
- _calcCurosorPosition(t, s) {
117
- const e = t.selectionStart || 0, a = t.selectionEnd || 0, i = t.value;
118
- let l = e, r = a;
119
- s.length < i.length ? (l = Math.max(0, e - (i.length - s.length)), r = l) : s.length > i.length ? (l = Math.min(s.length, e + (s.length - i.length)), r = l) : (l = Math.min(s.length, e), r = l), t.value = s, t.setSelectionRange(l, r);
120
- }
121
- _input = (t) => {
122
- const s = t.target;
123
- let e = s.value, a = e;
124
- if (this._state.allowInput != null) {
125
- let i = this._state.allowInput.indexOf("."), l = i === -1 ? i : parseInt(this._state.allowInput.substring(i + 1));
126
- a = this._numberInputParse(e, {
127
- integer: this._state.allowInput.includes("integer"),
128
- negative: this._state.allowInput.startsWith("-"),
129
- precision: l
130
- }), a = String(a);
131
- }
132
- this.parser != null && (a = this.parser(a)), this._calcCurosorPosition(s, a), this.setValue(a), this.#t();
133
- };
134
- #t() {
135
- if (this._state.clearable) {
136
- let t = c(".l-clearable", this.root);
137
- if (this.value.length > 0) {
138
- if (t == null) {
139
- t = n("span", {
140
- class: "l-input__suffix l-clearable"
141
- });
142
- const s = n("l-close-filled-icon");
143
- t.appendChild(s), this.root.appendChild(t), h(t, "click", this.#e);
144
- }
145
- } else
146
- t && (p(t, "click", this.#e), t.remove());
147
- }
148
- }
149
- #e = () => {
150
- this.value = "", this.dispatchEvent(
151
- new CustomEvent("input", {
152
- bubbles: !0,
153
- detail: { value: this.value }
154
- })
155
- ), this.#t();
156
- };
157
- disabledChange() {
158
- this.isDisabled() ? this.classList.add("is-disabled") : this.classList.remove("is-disabled"), this.$inner && (this.$inner.disabled = this.isDisabled());
159
- }
160
- _numberInputParse(t, s) {
161
- let e = t.trim();
162
- if (e === "") return "";
163
- let a = e.startsWith("-");
164
- if (a && (s.negative || (e = e.slice(1), a = !1)), s.integer)
165
- e = e.replace(/[^\d]/g, "");
166
- else {
167
- const i = e.split(".");
168
- if (i.length > 2)
169
- e = i[0] + "." + i.slice(1).join("").substring(0, s.precision);
170
- else if (i.length === 2) {
171
- const l = i[0].replace(/[^\d]/g, ""), r = i[1].replace(/[^\d]/g, "").substring(0, s.precision);
172
- e = `${l}.${r}`;
173
- } else
174
- e = e.replace(/[^\d]/g, "");
175
- }
176
- return e.length > 1 && (e = e.replace(/^0+(\d)/, "$1")), a ? "-" + e : e;
177
- }
178
- innerBlockChange(t) {
179
- t ? o(this, "is-block") : u(this, "is-block");
180
- }
181
- _getStyleObj() {
182
- const t = {};
183
- return this._state.width && (t["--l-input-width"] = this._state.width), t;
184
- }
185
- _updateError(t = !1) {
186
- t ? o(this, "is-error") : u(this, "is-error");
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,57 @@
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
+ e === "icon" || e === "only-icon" ? (this[e] = t(r, !1, "icon"), this.#e()) : this[e] = r;
25
+ }
26
+ #e() {
27
+ if (!this.rendered) return;
28
+ let e = r(".icon-wrapper", this.root);
29
+ this.icon ? e ? this.onlyIcon ? i(e, "only") : a(e, "only") : (e = n("div", {
30
+ class: ["icon-wrapper", this.onlyIcon ? "only" : ""],
31
+ innerHTML: "<slot name='icon'></slot>"
32
+ }), this.root.prepend(e)) : e && e.remove();
33
+ let t = r("slot:not([name])", this.root);
34
+ if (this.onlyIcon) t && t.remove();
35
+ else if (!t) {
36
+ let e = n("slot");
37
+ this.root.appendChild(e);
38
+ }
39
+ }
40
+ render() {
41
+ let e = document.createDocumentFragment();
42
+ if (this.icon) {
43
+ let t = n("div", {
44
+ class: ["icon-wrapper", this.onlyIcon ? "only" : ""],
45
+ innerHTML: "<slot name='icon'></slot>"
46
+ });
47
+ e.appendChild(t);
48
+ }
49
+ if (!this.onlyIcon) {
50
+ let t = n("slot");
51
+ e.appendChild(t);
52
+ }
53
+ return e;
54
+ }
55
+ };
56
+ //#endregion
57
+ 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 };