litos-ui 0.21.0 → 0.22.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/README.md +119 -15
- package/README.zh-CN.md +153 -0
- package/lib/base.d.ts +1 -0
- package/lib/base.js +1 -1
- package/lib/button/index.js +4 -4
- package/lib/{style-gKR_qwzm.js → button/index.less_inline.js} +2 -3
- package/lib/button/style.js +6 -2
- package/lib/calendar/index.js +140 -2
- package/lib/calendar/index.less_inline.js +4 -0
- package/lib/calendar/langs.js +12 -0
- package/lib/card/index.js +64 -2
- package/lib/card/index.less_inline.js +4 -0
- package/lib/carousel/index.js +257 -2
- package/lib/carousel/index.less_inline.js +4 -0
- package/lib/carousel/item.js +15 -2
- package/lib/carousel/item.less_inline.js +4 -0
- package/lib/carousel/timer.js +19 -0
- package/lib/check/check.d.ts +1 -0
- package/lib/check/check.js +117 -0
- package/lib/check/check.less_inline.js +4 -0
- package/lib/check/checkbox.js +18 -2
- package/lib/{checkbox-DhGHJXwI.js → check/checkbox.less_inline.js} +2 -14
- package/lib/check/checkbox_group.js +1 -1
- package/lib/check/index.d.ts +1 -0
- package/lib/{check-DFlwStH9.js → check/index.js} +10 -9
- package/lib/check/index.less_inline.js +4 -0
- package/lib/check/radio.js +15 -2
- package/lib/{radio-C9NPQWGI.js → check/radio.less_inline.js} +2 -11
- package/lib/check/radio_group.js +1 -1
- package/lib/collapse/index.js +103 -2
- package/lib/collapse/index.less_inline.js +4 -0
- package/lib/collapse/item.d.ts +1 -0
- package/lib/collapse/item.js +118 -2
- package/lib/collapse/item.less_inline.js +4 -0
- package/lib/collapse/types.d.ts +1 -0
- package/lib/color_picker/index.js +42 -2
- package/lib/color_picker/index.less_inline.js +4 -0
- package/lib/date_picker/index.js +100 -3
- package/lib/date_picker/index.less_inline.js +4 -0
- package/lib/date_picker_ori/index.js +121 -2
- package/lib/date_picker_ori/index.less_inline.js +4 -0
- package/lib/description_panel/index.js +54 -2
- package/lib/description_panel/index.less_inline.js +4 -0
- package/lib/dialog/dialog_box.js +10 -10
- package/lib/{dialog_container_style-C1s0aBf7.js → dialog/dialog_container.css_inline.js} +2 -3
- package/lib/dialog/dialog_container.js +2 -2
- package/lib/dialog/dialog_container_style.js +6 -2
- package/lib/dialog/index.js +1 -1
- package/lib/entries/base.d.ts +2 -0
- package/lib/entries/base.js +2 -0
- package/lib/entries/button.d.ts +2 -0
- package/lib/entries/button.js +6 -0
- package/lib/entries/calendar.d.ts +2 -0
- package/lib/entries/calendar.js +6 -0
- package/lib/entries/card.d.ts +2 -0
- package/lib/entries/card.js +6 -0
- package/lib/entries/carousel-item.d.ts +2 -0
- package/lib/entries/carousel-item.js +6 -0
- package/lib/entries/carousel.d.ts +5 -0
- package/lib/entries/carousel.js +6 -0
- package/lib/entries/checkbox-group.d.ts +3 -0
- package/lib/entries/checkbox-group.js +6 -0
- package/lib/entries/checkbox.d.ts +2 -0
- package/lib/entries/checkbox.js +6 -0
- package/lib/entries/collapse-item.d.ts +3 -0
- package/lib/entries/collapse-item.js +6 -0
- package/lib/entries/collapse.d.ts +3 -0
- package/lib/entries/collapse.js +6 -0
- package/lib/entries/color-picker.d.ts +3 -0
- package/lib/entries/color-picker.js +6 -0
- package/lib/entries/date-picker-ori.d.ts +2 -0
- package/lib/entries/date-picker-ori.js +6 -0
- package/lib/entries/date-picker.d.ts +9 -0
- package/lib/entries/date-picker.js +6 -0
- package/lib/entries/description-panel.d.ts +4 -0
- package/lib/entries/description-panel.js +6 -0
- package/lib/entries/dialog-box.d.ts +6 -0
- package/lib/entries/dialog-box.js +2 -0
- package/lib/entries/dialog-container.d.ts +4 -0
- package/lib/entries/dialog-container.js +6 -0
- package/lib/entries/dialog.d.ts +3 -0
- package/lib/entries/dialog.js +2 -0
- package/lib/entries/form-item.d.ts +2 -0
- package/lib/entries/form-item.js +6 -0
- package/lib/entries/form.d.ts +3 -0
- package/lib/entries/form.js +6 -0
- package/lib/entries/icon-arrow-down.d.ts +2 -0
- package/lib/entries/icon-arrow-down.js +6 -0
- package/lib/entries/icon-arrow-left.d.ts +2 -0
- package/lib/entries/icon-arrow-left.js +6 -0
- package/lib/entries/icon-arrow-right.d.ts +2 -0
- package/lib/entries/icon-arrow-right.js +6 -0
- package/lib/entries/icon-arrow-up.d.ts +2 -0
- package/lib/entries/icon-arrow-up.js +6 -0
- package/lib/entries/icon-base.d.ts +2 -0
- package/lib/entries/icon-base.js +6 -0
- package/lib/entries/icon-calendar.d.ts +2 -0
- package/lib/entries/icon-calendar.js +6 -0
- package/lib/entries/icon-caret-bottom.d.ts +2 -0
- package/lib/entries/icon-caret-bottom.js +6 -0
- package/lib/entries/icon-caret-top.d.ts +2 -0
- package/lib/entries/icon-caret-top.js +6 -0
- package/lib/entries/icon-close-filled.d.ts +2 -0
- package/lib/entries/icon-close-filled.js +6 -0
- package/lib/entries/icon-close.d.ts +2 -0
- package/lib/entries/icon-close.js +6 -0
- package/lib/entries/icon-copy.d.ts +2 -0
- package/lib/entries/icon-copy.js +6 -0
- package/lib/entries/icon-d-arrow-left.d.ts +2 -0
- package/lib/entries/icon-d-arrow-left.js +6 -0
- package/lib/entries/icon-d-arrow-right.d.ts +2 -0
- package/lib/entries/icon-d-arrow-right.js +6 -0
- package/lib/entries/icon-delete.d.ts +2 -0
- package/lib/entries/icon-delete.js +6 -0
- package/lib/entries/icon-eye-outline.d.ts +2 -0
- package/lib/entries/icon-eye-outline.js +6 -0
- package/lib/entries/icon-font-icon.d.ts +2 -0
- package/lib/entries/icon-font-icon.js +6 -0
- package/lib/entries/icon-info.d.ts +2 -0
- package/lib/entries/icon-info.js +6 -0
- package/lib/entries/icon-loading.d.ts +2 -0
- package/lib/entries/icon-loading.js +6 -0
- package/lib/entries/icon-minus.d.ts +2 -0
- package/lib/entries/icon-minus.js +6 -0
- package/lib/entries/icon-moon.d.ts +2 -0
- package/lib/entries/icon-moon.js +6 -0
- package/lib/entries/icon-more.d.ts +2 -0
- package/lib/entries/icon-more.js +6 -0
- package/lib/entries/icon-picture.d.ts +2 -0
- package/lib/entries/icon-picture.js +6 -0
- package/lib/entries/icon-plus.d.ts +2 -0
- package/lib/entries/icon-plus.js +6 -0
- package/lib/entries/icon-reduction.d.ts +2 -0
- package/lib/entries/icon-reduction.js +6 -0
- package/lib/entries/icon-refresh-left.d.ts +2 -0
- package/lib/entries/icon-refresh-left.js +6 -0
- package/lib/entries/icon-refresh-right.d.ts +2 -0
- package/lib/entries/icon-refresh-right.js +6 -0
- package/lib/entries/icon-refresh.d.ts +2 -0
- package/lib/entries/icon-refresh.js +6 -0
- package/lib/entries/icon-search.d.ts +2 -0
- package/lib/entries/icon-search.js +6 -0
- package/lib/entries/icon-select.d.ts +2 -0
- package/lib/entries/icon-select.js +6 -0
- package/lib/entries/icon-sort.d.ts +2 -0
- package/lib/entries/icon-sort.js +6 -0
- package/lib/entries/icon-success.d.ts +2 -0
- package/lib/entries/icon-success.js +6 -0
- package/lib/entries/icon-sun.d.ts +2 -0
- package/lib/entries/icon-sun.js +6 -0
- package/lib/entries/icon-theme-default.d.ts +2 -0
- package/lib/entries/icon-theme-default.js +6 -0
- package/lib/entries/icon-warn.d.ts +2 -0
- package/lib/entries/icon-warn.js +6 -0
- package/lib/entries/icon-zoom-in.d.ts +2 -0
- package/lib/entries/icon-zoom-in.js +6 -0
- package/lib/entries/icon-zoom-out.d.ts +2 -0
- package/lib/entries/icon-zoom-out.js +6 -0
- package/lib/entries/image-preview.d.ts +10 -0
- package/lib/entries/image-preview.js +6 -0
- package/lib/entries/image.d.ts +2 -0
- package/lib/entries/image.js +6 -0
- package/lib/entries/input-number.d.ts +2 -0
- package/lib/entries/input-number.js +6 -0
- package/lib/entries/input.d.ts +2 -0
- package/lib/entries/input.js +6 -0
- package/lib/entries/list.d.ts +3 -0
- package/lib/entries/list.js +6 -0
- package/lib/entries/loading.d.ts +2 -0
- package/lib/entries/loading.js +2 -0
- package/lib/entries/mask.d.ts +2 -0
- package/lib/entries/mask.js +6 -0
- package/lib/entries/md-input.d.ts +2 -0
- package/lib/entries/md-input.js +6 -0
- package/lib/entries/menu.d.ts +3 -0
- package/lib/entries/menu.js +6 -0
- package/lib/entries/message.d.ts +6 -0
- package/lib/entries/message.js +2 -0
- package/lib/entries/modal-box.d.ts +6 -0
- package/lib/entries/modal-box.js +2 -0
- package/lib/entries/modal.d.ts +4 -0
- package/lib/entries/modal.js +6 -0
- package/lib/entries/notification.d.ts +7 -0
- package/lib/entries/notification.js +6 -0
- package/lib/entries/page-header.d.ts +4 -0
- package/lib/entries/page-header.js +6 -0
- package/lib/entries/pagination.d.ts +9 -0
- package/lib/entries/pagination.js +6 -0
- package/lib/entries/polygon.d.ts +2 -0
- package/lib/entries/polygon.js +6 -0
- package/lib/entries/popconfirm.d.ts +3 -0
- package/lib/entries/popconfirm.js +2 -0
- package/lib/entries/popover.d.ts +1 -0
- package/lib/entries/popover.js +2 -0
- package/lib/entries/qrcode.d.ts +2 -0
- package/lib/entries/qrcode.js +6 -0
- package/lib/entries/radio-group.d.ts +3 -0
- package/lib/entries/radio-group.js +6 -0
- package/lib/entries/radio.d.ts +2 -0
- package/lib/entries/radio.js +6 -0
- package/lib/entries/select-ori.d.ts +2 -0
- package/lib/entries/select-ori.js +6 -0
- package/lib/entries/select.d.ts +4 -0
- package/lib/entries/select.js +6 -0
- package/lib/entries/space.d.ts +2 -0
- package/lib/entries/space.js +6 -0
- package/lib/entries/switch.d.ts +2 -0
- package/lib/entries/switch.js +6 -0
- package/lib/entries/tabbar-item.d.ts +2 -0
- package/lib/entries/tabbar-item.js +6 -0
- package/lib/entries/tabbar.d.ts +3 -0
- package/lib/entries/tabbar.js +6 -0
- package/lib/entries/table.d.ts +3 -0
- package/lib/entries/table.js +6 -0
- package/lib/entries/tabs.d.ts +3 -0
- package/lib/entries/tabs.js +2 -0
- package/lib/entries/tag.d.ts +2 -0
- package/lib/entries/tag.js +6 -0
- package/lib/entries/theme-color.d.ts +3 -0
- package/lib/entries/theme-color.js +6 -0
- package/lib/entries/theme.d.ts +9 -0
- package/lib/entries/theme.js +6 -0
- package/lib/entries/transition.d.ts +1 -0
- package/lib/entries/transition.js +2 -0
- package/lib/entries/upload.d.ts +3 -0
- package/lib/entries/upload.js +6 -0
- package/lib/entries/utils.d.ts +1 -0
- package/lib/entries/utils.js +2 -0
- package/lib/form/form_inner.d.ts +1 -0
- package/lib/{form_inner-Cnwb6f_Q.js → form/form_inner.js} +9 -9
- package/lib/form/form_item.d.ts +2 -1
- package/lib/form/form_item.js +148 -2
- package/lib/form/form_item.less_inline.js +4 -0
- package/lib/form/index.d.ts +3 -2
- package/lib/form/index.js +191 -2
- package/lib/form/index.less_inline.js +4 -0
- package/lib/icon/base.js +1 -1
- package/lib/icon/delete.d.ts +5 -0
- package/lib/icon/delete.js +10 -0
- package/lib/icon/eye_outline.d.ts +6 -0
- package/lib/icon/eye_outline.js +13 -0
- package/lib/icon/icon_style.js +6 -2
- package/lib/{icon_style-J7iiDS_a.js → icon/index.less_inline.js} +2 -3
- package/lib/icon/minus.d.ts +5 -0
- package/lib/icon/minus.js +10 -0
- package/lib/icon/picture.d.ts +5 -0
- package/lib/icon/picture.js +10 -0
- package/lib/icon/plus.d.ts +5 -0
- package/lib/icon/plus.js +10 -0
- package/lib/image/image_preview.js +91 -2
- package/lib/image/image_preview.less_inline.js +4 -0
- package/lib/image/index.js +163 -2
- package/lib/image/index.less_inline.js +4 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +47 -40
- package/lib/input/index.js +4 -4
- package/lib/{input-DUBlLEXS.js → input/index.less_inline.js} +1 -1
- package/lib/{input_inner-x4GfLGjj.js → input/input_inner.less_inline.js} +1 -1
- package/lib/input_number/index.js +3 -3
- package/lib/{style-C5wUmE2b.js → input_number/index.less_inline.js} +2 -3
- package/lib/input_number/style.js +6 -2
- package/lib/list/index.js +52 -2
- package/lib/list/index.less_inline.js +4 -0
- package/lib/loading/index.js +1 -1
- package/lib/mask/index.d.ts +1 -1
- package/lib/mask/index.js +109 -2
- package/lib/mask/index.less_inline.js +4 -0
- package/lib/md_input/index.js +59 -2
- package/lib/md_input/index.less_inline.js +4 -0
- package/lib/menu/index.js +275 -2
- package/lib/menu/index.less_inline.js +4 -0
- package/lib/message/index.js +1 -1
- package/lib/modal/index.js +199 -2
- package/lib/modal/index.less_inline.js +4 -0
- package/lib/modal/modal_box.js +21 -22
- package/lib/notification/index.d.ts +212 -0
- package/lib/notification/index.js +380 -0
- package/lib/notification/index.less_inline.js +4 -0
- package/lib/notification/placement.d.ts +49 -0
- package/lib/notification/placement.js +48 -0
- package/lib/notification/style.d.ts +2 -0
- package/lib/notification/style.js +6 -0
- package/lib/page_header/index.js +100 -2
- package/lib/page_header/index.less_inline.js +4 -0
- package/lib/pagination/index.js +214 -2
- package/lib/pagination/index.less_inline.js +4 -0
- package/lib/polygon/index.js +21 -2
- package/lib/{polygon-DhhovlrG.js → polygon/index.less_inline.js} +2 -18
- package/lib/qrcode/index.js +65 -2
- package/lib/qrcode/index.less_inline.js +4 -0
- package/lib/select/index.js +355 -3
- package/lib/select/index.less_inline.js +4 -0
- package/lib/select_ori/index.js +58 -2
- package/lib/select_ori/index.less_inline.js +4 -0
- package/lib/space/index.js +40 -2
- package/lib/space/index.less_inline.js +4 -0
- package/lib/{animation-Bo4jbSGK.js → styles/animation/index.css_inline.js} +2 -3
- package/lib/styles/animation/index.js +6 -2
- package/lib/{mask-Ox6CoyFB.js → styles/mask/index.css_inline.js} +2 -3
- package/lib/styles/mask/index.js +6 -2
- package/lib/switch/index.js +51 -2
- package/lib/switch/index.less_inline.js +4 -0
- package/lib/tabbar/index.js +97 -2
- package/lib/tabbar/index.less_inline.js +4 -0
- package/lib/tabbar/item.js +61 -2
- package/lib/tabbar/item.less_inline.js +4 -0
- package/lib/table/index.js +234 -2
- package/lib/table/index.less_inline.js +4 -0
- package/lib/tabs/index.js +1 -1
- package/lib/tag/index.js +75 -2
- package/lib/tag/index.less_inline.js +4 -0
- package/lib/theme/index.js +86 -2
- package/lib/theme/index.less_inline.js +4 -0
- package/lib/theme/theme_color.js +1 -1
- package/lib/upload/index.d.ts +170 -0
- package/lib/upload/index.js +848 -0
- package/lib/upload/index.less_inline.js +4 -0
- package/lib/upload/style.d.ts +2 -0
- package/lib/upload/style.js +6 -0
- package/lib/utils/context_provide.d.ts +1 -0
- package/lib/utils/context_provide.js +1 -1
- package/lib/utils/event.d.ts +30 -0
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/index.js +1 -1
- package/lib/utils/popover.js +1 -1
- package/lib/utils/signal_types.d.ts +5 -0
- package/lib/utils/transition.d.ts +28 -0
- package/lib/utils/transition.js +1 -1
- package/package.json +39 -18
- package/styles/animation.css +2 -2
- package/styles/container.css +8 -8
- package/styles/datepicker.css +9 -9
- package/styles/dialog.css +7 -7
- package/styles/loading.css +17 -17
- package/styles/message.css +9 -9
- package/styles/modal_box.css +3 -3
- package/styles/notification.css +17 -0
- package/styles/popover.css +11 -14
- package/styles/reset.css +13 -15
- package/styles/scrollbar.css +5 -5
- package/styles/select.css +6 -6
- package/styles/tabs.css +3 -3
- package/styles/theme-coral.css +35 -0
- package/styles/theme-jade.css +35 -0
- package/styles/theme-tangerine.css +35 -0
- package/styles/transition.css +1 -1
- package/styles/vars.css +41 -7
- package/lib/calendar-CvlUsN6w.js +0 -146
- package/lib/card-3DM-lJQV.js +0 -63
- package/lib/carousel-DvkZ1YXq.js +0 -276
- package/lib/check-doQ2ZpQj.js +0 -117
- package/lib/collapse-B6-Rn05A.js +0 -102
- package/lib/color_picker-0a-IGZY9.js +0 -41
- package/lib/date_picker-BDN2PAz5.js +0 -99
- package/lib/date_picker_ori-BXFs1eET.js +0 -120
- package/lib/description_panel--AKXBzLL.js +0 -53
- package/lib/esm-DAha108i.js +0 -270
- package/lib/form-DJxvBiLy.js +0 -190
- package/lib/form_item-BqPMRABd.js +0 -147
- package/lib/image-CVQai6NX.js +0 -162
- package/lib/image_preview-DfQAKSJH.js +0 -90
- package/lib/item-CQ2Sknbz.js +0 -14
- package/lib/item-DI6mQXtB.js +0 -117
- package/lib/item-D_ZOPXuE.js +0 -60
- package/lib/list-MG8PRzos.js +0 -51
- package/lib/mask-Bx-yNIJv.js +0 -108
- package/lib/md_input-BX3bujz8.js +0 -58
- package/lib/menu-DKscK5mw.js +0 -274
- package/lib/modal-Cwi3qlEf.js +0 -198
- package/lib/page_header-ujV3pncE.js +0 -99
- package/lib/pagination-aRbGd3Rf.js +0 -213
- package/lib/qrcode-Dip8uLSA.js +0 -64
- package/lib/select-BZMDj5VE.js +0 -354
- package/lib/select_ori-C7sUZxen.js +0 -57
- package/lib/space-CKuTk0YB.js +0 -39
- package/lib/switch-wh2-ivty.js +0 -50
- package/lib/tabbar-CBXK-_AV.js +0 -96
- package/lib/table-BQxMD2Ae.js +0 -233
- package/lib/tag-Di1z9PoZ.js +0 -74
- package/lib/theme-CLbBS-in.js +0 -85
- package/styles/dark.css +0 -13
package/lib/collapse/index.js
CHANGED
|
@@ -1,2 +1,103 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import e from "../base.js";
|
|
2
|
+
import { kebabToCamel as t, parseAttrValue as n, unitNumberStr as r } from "../utils/index.js";
|
|
3
|
+
import i from "./index.less_inline.js";
|
|
4
|
+
import { $$ as a, off as o, on as s } from "utilane/browser";
|
|
5
|
+
import { signal as c } from "alien-signals";
|
|
6
|
+
//#region src/components/collapse/index.ts
|
|
7
|
+
var l = class extends e {
|
|
8
|
+
static baseName = "collapse";
|
|
9
|
+
context;
|
|
10
|
+
expands;
|
|
11
|
+
constructor() {
|
|
12
|
+
super(), this.version = 2, this.context = c({
|
|
13
|
+
arrowPlacement: "left",
|
|
14
|
+
headerJustify: "flex-start",
|
|
15
|
+
background: !1
|
|
16
|
+
}), this.expands = c([]), this._state = {
|
|
17
|
+
grid: !1,
|
|
18
|
+
accordion: !1
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
static get observedAttributes() {
|
|
22
|
+
return [
|
|
23
|
+
"arrow-placement",
|
|
24
|
+
"header-justify",
|
|
25
|
+
"background",
|
|
26
|
+
"gap",
|
|
27
|
+
"border-radius",
|
|
28
|
+
"grid",
|
|
29
|
+
"accordion",
|
|
30
|
+
"prop"
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
attributeChanged(e, i, a) {
|
|
34
|
+
switch (e) {
|
|
35
|
+
case "arrow-placement":
|
|
36
|
+
case "header-justify":
|
|
37
|
+
let i = { ...this.context() };
|
|
38
|
+
i[t(e)] = a, this.context(i);
|
|
39
|
+
break;
|
|
40
|
+
case "gap":
|
|
41
|
+
this.context({
|
|
42
|
+
...this.context(),
|
|
43
|
+
gap: r(a)
|
|
44
|
+
});
|
|
45
|
+
break;
|
|
46
|
+
case "border-radius":
|
|
47
|
+
this._state.borderRadius = r(a);
|
|
48
|
+
break;
|
|
49
|
+
case "background":
|
|
50
|
+
this.context({
|
|
51
|
+
...this.context(),
|
|
52
|
+
background: n(a, !1, e)
|
|
53
|
+
});
|
|
54
|
+
break;
|
|
55
|
+
case "accordion":
|
|
56
|
+
case "grid":
|
|
57
|
+
this._state[e] = n(a, !1, e);
|
|
58
|
+
break;
|
|
59
|
+
case "prop": if (a !== this._state.prop) {
|
|
60
|
+
this._state.prop = a;
|
|
61
|
+
let e = [], t = a.split("&");
|
|
62
|
+
for (let n = 0, r = t.length; n < r; n++) e.push(t[n]);
|
|
63
|
+
this.expands(e);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
updateDOM(e) {
|
|
68
|
+
(e.has("gap") || e.has("borderRadius") || e.has("grid")) && this._setStyleAndClass();
|
|
69
|
+
}
|
|
70
|
+
render_v2() {
|
|
71
|
+
return {
|
|
72
|
+
template: a("slot"),
|
|
73
|
+
style: i
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
_setStyleAndClass() {
|
|
77
|
+
this.context().gap ? this.style.setProperty("--l-collapse-gap", this.context().gap) : this.style.removeProperty("--l-collapse-gap"), this._state.borderRadius ? this.style.setProperty("--l-collapse-border-radius", this._state.borderRadius) : this.style.removeProperty("--l-collapse-border-radius"), this._state.grid ? this.classList.add("l-collapse-grid") : this.classList.remove("l-collapse-grid");
|
|
78
|
+
}
|
|
79
|
+
afterInit() {
|
|
80
|
+
this._setStyleAndClass(), s(this, "collapse-context-request", this._provide), s(this, "expand-change", this._onChange);
|
|
81
|
+
}
|
|
82
|
+
_provide(e) {
|
|
83
|
+
let { context: t, callback: n } = e.detail;
|
|
84
|
+
t === "collapse-context-request" && n(this.context, this.expands);
|
|
85
|
+
}
|
|
86
|
+
beforeDestroy() {
|
|
87
|
+
o(this, "collapse-context-request", this._provide), o(this, "expand-change", this._onChange);
|
|
88
|
+
}
|
|
89
|
+
_onChange = (e) => {
|
|
90
|
+
let t = e.detail, n = this.expands();
|
|
91
|
+
if (t.expand) this._state.accordion ? n = [t.prop] : n.includes(t.prop) || n.push(t.prop);
|
|
92
|
+
else {
|
|
93
|
+
let e = n.indexOf(t.prop);
|
|
94
|
+
e !== -1 && n.splice(e, 1);
|
|
95
|
+
}
|
|
96
|
+
this.expands([...n]), this._state.prop = n.join("&"), this.emit("change", { detail: {
|
|
97
|
+
expands: n,
|
|
98
|
+
value: this._state.prop
|
|
99
|
+
} });
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
export { l as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/components/collapse/index.less?inline
|
|
2
|
+
var e = ":host{--l-collapse-border-color:var(--l-border-color,#dedede);--l-collapse-border-radius:0px;gap:var(--l-collapse-gap,0px);box-sizing:border-box;grid-template-columns:1fr;display:grid}:host(.l-collapse-grid){grid-template-columns:repeat(auto-fill,minmax(200px,1fr));align-items:start}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
package/lib/collapse/item.d.ts
CHANGED
package/lib/collapse/item.js
CHANGED
|
@@ -1,2 +1,118 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import e from "../base.js";
|
|
2
|
+
import { kebabToCamel as t, parseAttrValue as n, stopSignal as r } from "../utils/index.js";
|
|
3
|
+
import i from "./item.less_inline.js";
|
|
4
|
+
import { $$ as a, $one as o, off as s, on as c, queryHideNodeSize as l } from "utilane/browser";
|
|
5
|
+
import { effect as u } from "alien-signals";
|
|
6
|
+
//#region src/components/collapse/item.ts
|
|
7
|
+
var d = class extends e {
|
|
8
|
+
static baseName = "collapse-item";
|
|
9
|
+
$header;
|
|
10
|
+
context;
|
|
11
|
+
_ctxStop;
|
|
12
|
+
_expandStop;
|
|
13
|
+
expands;
|
|
14
|
+
constructor() {
|
|
15
|
+
super(), this.version = 2, this._state = {
|
|
16
|
+
prop: "",
|
|
17
|
+
headerText: "",
|
|
18
|
+
expand: !1
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
updateDOM(e) {
|
|
22
|
+
e.has("expand") && (this._setStyleAndClass(), this._handleExpand());
|
|
23
|
+
}
|
|
24
|
+
_setStyleAndClass() {
|
|
25
|
+
this._state.expand ? this.classList.add("l-collapse-expand") : this.classList.remove("l-collapse-expand");
|
|
26
|
+
}
|
|
27
|
+
static get observedAttributes() {
|
|
28
|
+
return [
|
|
29
|
+
"prop",
|
|
30
|
+
"header-text",
|
|
31
|
+
"expand"
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
attributeChanged(e, r, i) {
|
|
35
|
+
switch (e) {
|
|
36
|
+
case "prop":
|
|
37
|
+
case "header-text":
|
|
38
|
+
this._state[t(e)] = i;
|
|
39
|
+
break;
|
|
40
|
+
case "expand":
|
|
41
|
+
let r = n(i, !1, "expand");
|
|
42
|
+
r !== this._state.expand && (this._state.expand = r);
|
|
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: i
|
|
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 = u(this._updateLayout), this._expandStop = u(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
|
+
return a("div", {
|
|
109
|
+
class: "l-collapse-content",
|
|
110
|
+
style: e ? "display: none;" : ""
|
|
111
|
+
}, [a("div", {
|
|
112
|
+
class: "l-collapse-content-box",
|
|
113
|
+
innerHTML: "<slot></slot>"
|
|
114
|
+
})]);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
//#endregion
|
|
118
|
+
export { d as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/components/collapse/item.less?inline
|
|
2
|
+
var e = ":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)}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
package/lib/collapse/types.d.ts
CHANGED
|
@@ -1,2 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { initAttr as e, setAttrs as t } from "../utils/index.js";
|
|
2
|
+
import n from "../form/form_inner.js";
|
|
3
|
+
import r from "../input/index.less_inline.js";
|
|
4
|
+
import i from "./index.less_inline.js";
|
|
5
|
+
import { $one as a, off as o, on as s } from "utilane/browser";
|
|
6
|
+
//#region src/components/color_picker/index.ts
|
|
7
|
+
var c = class extends n {
|
|
8
|
+
static baseName = "color-picker";
|
|
9
|
+
$picker;
|
|
10
|
+
_value = "#000000";
|
|
11
|
+
constructor() {
|
|
12
|
+
super(), e(this);
|
|
13
|
+
}
|
|
14
|
+
setValue(e) {
|
|
15
|
+
super.setValue(e), this.$picker && (this.$picker.value = e);
|
|
16
|
+
}
|
|
17
|
+
connectedCallback() {
|
|
18
|
+
this.loadStyleText([r, i]), super.connectedCallback(), this.$picker = a("input", this.root), s(this.$picker, "change", this._handleChange);
|
|
19
|
+
}
|
|
20
|
+
disconnectedCallback() {
|
|
21
|
+
super.disconnectedCallback(), this.$picker &&= (o(this.$picker, "change", this._handleChange), void 0);
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
let e = document.createElement("input");
|
|
25
|
+
return t(e, [
|
|
26
|
+
["value", this.value],
|
|
27
|
+
["disabled", this.isDisabled()],
|
|
28
|
+
["name", this.getName()],
|
|
29
|
+
["type", "color"],
|
|
30
|
+
["class", "l-input l-color-picker"]
|
|
31
|
+
]), e;
|
|
32
|
+
}
|
|
33
|
+
disabledChange() {
|
|
34
|
+
this.$picker && (this.$picker.disabled = this.isDisabled());
|
|
35
|
+
}
|
|
36
|
+
_handleChange = (e) => {
|
|
37
|
+
let t = e.target.value;
|
|
38
|
+
super.setValue(t), this.emit("change", { detail: t });
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { c as default };
|
package/lib/date_picker/index.js
CHANGED
|
@@ -1,3 +1,100 @@
|
|
|
1
|
-
import "../utils/
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { unitNumberStr as e } from "../utils/index.js";
|
|
2
|
+
import t from "../form/form_inner.js";
|
|
3
|
+
import n from "../input/input_inner.less_inline.js";
|
|
4
|
+
import { Popover as r } from "../utils/popover.js";
|
|
5
|
+
import i from "./index.less_inline.js";
|
|
6
|
+
import { $$ as a, on as o } from "utilane/browser";
|
|
7
|
+
//#region src/components/date_picker/index.ts
|
|
8
|
+
var s = class extends t {
|
|
9
|
+
static baseName = "date-picker";
|
|
10
|
+
_popover;
|
|
11
|
+
constructor() {
|
|
12
|
+
super(), this.version = 2, this._state = {}, this._popover = new r({
|
|
13
|
+
trigger: "manual",
|
|
14
|
+
reference: this,
|
|
15
|
+
placement: "bottom-start",
|
|
16
|
+
arrow: !1,
|
|
17
|
+
offset: 5,
|
|
18
|
+
theme: "date-picker",
|
|
19
|
+
contentRender: this._popoverContentRender,
|
|
20
|
+
onOutsideTap: this._onOuterTap
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
afterInit() {
|
|
24
|
+
this._updateWidth(), o(this, "click", this._handleTap);
|
|
25
|
+
}
|
|
26
|
+
beforeDestroy() {
|
|
27
|
+
this._popover.destroy(), o(this, "off", this._handleTap), this._popover = void 0;
|
|
28
|
+
}
|
|
29
|
+
static get observedAttributes() {
|
|
30
|
+
return ["width"];
|
|
31
|
+
}
|
|
32
|
+
attributeChange(t, n, r) {
|
|
33
|
+
t === "width" && (this._state.width = e(r));
|
|
34
|
+
}
|
|
35
|
+
updateDOM(e) {
|
|
36
|
+
e.has("width") && this._updateWidth();
|
|
37
|
+
}
|
|
38
|
+
render_v2() {
|
|
39
|
+
let e = document.createDocumentFragment(), t = a("input", {
|
|
40
|
+
class: "l-input__inner",
|
|
41
|
+
placeholder: "请选择日期"
|
|
42
|
+
});
|
|
43
|
+
e.appendChild(t);
|
|
44
|
+
let r = a("l-calendar-icon", { class: "icon" });
|
|
45
|
+
return e.appendChild(r), {
|
|
46
|
+
style: [i, n],
|
|
47
|
+
template: e
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
_popoverContentRender() {
|
|
51
|
+
let e = a("div", { class: "l-date-picker-panel" }), t = a("div", { class: "l-date-picker--header" }), n = a("button", {
|
|
52
|
+
type: "button",
|
|
53
|
+
"aria-label": "上一年",
|
|
54
|
+
class: "l-date-picker-header-btn",
|
|
55
|
+
innerHTML: "<l-d-arrow-left-icon></l-d-arrow-left-icon>"
|
|
56
|
+
});
|
|
57
|
+
t.appendChild(n);
|
|
58
|
+
let r = a("button", {
|
|
59
|
+
type: "button",
|
|
60
|
+
"aria-label": "上一月",
|
|
61
|
+
class: "l-date-picker-header-btn",
|
|
62
|
+
innerHTML: "<l-arrow-left-icon></l-arrow-left-icon>"
|
|
63
|
+
});
|
|
64
|
+
t.appendChild(r);
|
|
65
|
+
let i = a("button", {
|
|
66
|
+
class: "l-date-picker-header-btn l-date-picker-year-month",
|
|
67
|
+
textContent: "2026-04"
|
|
68
|
+
});
|
|
69
|
+
t.appendChild(i);
|
|
70
|
+
let o = a("button", {
|
|
71
|
+
type: "button",
|
|
72
|
+
"aria-label": "下一年",
|
|
73
|
+
class: "l-date-picker-header-btn",
|
|
74
|
+
innerHTML: "<l-arrow-right-icon></l-arrow-right-icon>"
|
|
75
|
+
});
|
|
76
|
+
t.appendChild(o);
|
|
77
|
+
let s = a("button", {
|
|
78
|
+
type: "button",
|
|
79
|
+
"aria-label": "下一月",
|
|
80
|
+
class: "l-date-picker-header-btn",
|
|
81
|
+
innerHTML: "<l-d-arrow-right-icon></l-d-arrow-right-icon>"
|
|
82
|
+
});
|
|
83
|
+
t.appendChild(s), e.appendChild(t);
|
|
84
|
+
let c = a("l-calendar", { class: "l-date-picker--calendar" }), l = a("div", { class: "l-date-picker--body" });
|
|
85
|
+
l.appendChild(c), e.appendChild(l);
|
|
86
|
+
let u = a("div", { class: "l-date-picker--footer" }), d = a("l-button", { textContent: "此刻" });
|
|
87
|
+
return u.appendChild(d), e.appendChild(u), e;
|
|
88
|
+
}
|
|
89
|
+
_updateWidth() {
|
|
90
|
+
this._state.width ? this.style.setProperty("--l-date-picker-width", this._state.width) : this.style.removeProperty("--l-date-picker-width");
|
|
91
|
+
}
|
|
92
|
+
_handleTap = () => {
|
|
93
|
+
this._popover.isShow() || this._popover.show(this);
|
|
94
|
+
};
|
|
95
|
+
_onOuterTap = (e, t, n) => {
|
|
96
|
+
t || n || this._popover.hide();
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
//#endregion
|
|
100
|
+
export { s as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/components/date_picker/index.less?inline
|
|
2
|
+
var e = ":host{height:var(--l-form-control-height,32px);border:1px solid var(--l-border-color,#dedede);border-radius:var(--l-border-radius,3px);width:var(--l-date-picker-width,140px);align-items:center;gap:8px;padding:0 8px;transition:border-color .3s;display:inline-flex}:host(:hover){border-color:var(--l-primary-color-light2,#66b3ff)}.icon{color:#00000059;flex-shrink:0;min-width:0}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
@@ -1,2 +1,121 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { kebabToCamel as e, parseAttrValue as t, unitNumberStr as n } from "../utils/index.js";
|
|
2
|
+
import r from "../form/form_inner.js";
|
|
3
|
+
import i from "./index.less_inline.js";
|
|
4
|
+
import { $ as a, $$ as o, iterate as s, off as c, on as l } from "utilane/browser";
|
|
5
|
+
import { parse as u } from "utilane";
|
|
6
|
+
//#region src/components/date_picker_ori/index.ts
|
|
7
|
+
var d = class extends r {
|
|
8
|
+
static baseName = "date-picker-ori";
|
|
9
|
+
#e;
|
|
10
|
+
#t;
|
|
11
|
+
#n;
|
|
12
|
+
#r;
|
|
13
|
+
_state;
|
|
14
|
+
constructor() {
|
|
15
|
+
super(), this._state = {
|
|
16
|
+
range: !1,
|
|
17
|
+
delay: 300,
|
|
18
|
+
type: "date",
|
|
19
|
+
allowEmpty: !0
|
|
20
|
+
}, this.#t = [], this.#r = !1;
|
|
21
|
+
}
|
|
22
|
+
setValue(e) {
|
|
23
|
+
super.setValue(e), this.#t = e.split(","), this.rendered && s(this.#e, (e, t) => {
|
|
24
|
+
e.value = this.#t[t];
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
static get observedAttributes() {
|
|
28
|
+
return [
|
|
29
|
+
...r.observedAttributes,
|
|
30
|
+
"range",
|
|
31
|
+
"delay",
|
|
32
|
+
"type",
|
|
33
|
+
"width",
|
|
34
|
+
"min",
|
|
35
|
+
"max",
|
|
36
|
+
"allow-empty"
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
connectedCallback() {
|
|
40
|
+
this.loadStyleText(i), this._updateWidth(), super.connectedCallback();
|
|
41
|
+
}
|
|
42
|
+
afterInit() {
|
|
43
|
+
this.#e = a(".l-date-inner", this.root), l(this.#e, "change", this.#a), this._state.range && (l(this.#e, "focus", this.#c), l(this.#e, "blur", this.#l));
|
|
44
|
+
}
|
|
45
|
+
beforeDestroy() {
|
|
46
|
+
c(this.#e, "change", this.#a), this._state.range && (c(this.#e, "focus", this.#c), c(this.#e, "blur", this.#l)), this.#o();
|
|
47
|
+
}
|
|
48
|
+
attributeChange(r, i, a) {
|
|
49
|
+
switch (r) {
|
|
50
|
+
case "type":
|
|
51
|
+
case "min":
|
|
52
|
+
case "max":
|
|
53
|
+
this._state[r] = a;
|
|
54
|
+
break;
|
|
55
|
+
case "range":
|
|
56
|
+
case "allow-empty":
|
|
57
|
+
this._state[e(r)] = t(a, !1, r);
|
|
58
|
+
break;
|
|
59
|
+
case "delay":
|
|
60
|
+
this._state.delay = t(a, 300);
|
|
61
|
+
break;
|
|
62
|
+
case "width": this._state.width = n(a);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
updateDOM(e) {
|
|
66
|
+
e.has("width") && this._updateWidth();
|
|
67
|
+
}
|
|
68
|
+
_updateWidth() {
|
|
69
|
+
this._state.width ? this.style.setProperty("--l-date-picker-width", this._state.width) : this.style.removeProperty("--l-date-picker-width");
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
let e = document.createDocumentFragment();
|
|
73
|
+
if (e.appendChild(this.#i(0)), this._state.range) {
|
|
74
|
+
let t = o("span", {
|
|
75
|
+
class: "l-date-range-divider",
|
|
76
|
+
textContent: "-"
|
|
77
|
+
});
|
|
78
|
+
e.appendChild(t), e.appendChild(this.#i(1));
|
|
79
|
+
}
|
|
80
|
+
return e;
|
|
81
|
+
}
|
|
82
|
+
#i(e = 0) {
|
|
83
|
+
return o("input", {
|
|
84
|
+
type: this._state.type,
|
|
85
|
+
class: `l-date-inner l-date-inner${e}`,
|
|
86
|
+
name: this.getName(),
|
|
87
|
+
value: this.#t[e],
|
|
88
|
+
"l-datepicker": `${e}`,
|
|
89
|
+
disabled: this.isDisabled() ? !0 : void 0,
|
|
90
|
+
min: this._state.min,
|
|
91
|
+
max: this._state.max
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
#a = (e) => {
|
|
95
|
+
let t = e.target, n = Number(t.getAttribute("l-datepicker")), r = t.value;
|
|
96
|
+
!r && !this._state.allowEmpty && (r = this._resetValue || "", r = r.split(",")[n], t.value = r), this.#t[n] = r, this.#t.join(",") !== this._value && (this.setValue(this.#t.join(",")), this.#r = !0), n === 0 && this.#e.length > 1 ? this.#e[1].min = r : n === 1 && (this.#e[0].max = r), this._state.range ? this.#s() : this.#u();
|
|
97
|
+
};
|
|
98
|
+
#o() {
|
|
99
|
+
this.#n !== -1 && (clearTimeout(this.#n), this.#n = -1);
|
|
100
|
+
}
|
|
101
|
+
#s() {
|
|
102
|
+
this.#r && (this.#o(), this.#n = setTimeout(() => {
|
|
103
|
+
this.#u(), this.#r = !1;
|
|
104
|
+
}, this._state.delay));
|
|
105
|
+
}
|
|
106
|
+
#c = () => {
|
|
107
|
+
this.#o();
|
|
108
|
+
};
|
|
109
|
+
#l = () => {
|
|
110
|
+
this.#s();
|
|
111
|
+
};
|
|
112
|
+
#u() {
|
|
113
|
+
this.dispatchEvent(new CustomEvent("change", { detail: {
|
|
114
|
+
value: this.getValue(),
|
|
115
|
+
dateStr: this.#t,
|
|
116
|
+
dates: this.#t.map((e) => u(e))
|
|
117
|
+
} }));
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
export { d as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/components/date_picker_ori/index.less?inline
|
|
2
|
+
var e = ":host{width:var(--l-date-picker-width,auto);align-items:center;display:inline-flex}.l-date-inner{height:var(--l-form-control-height,32px);border:1px solid var(--l-border-color,#dedede);cursor:text;border-radius:3px;outline:none;flex-grow:1;padding:0 5px;transition:border-color .3s}.l-date-inner:hover{border-color:var(--l-primary-color-light1,#9254de)}.l-date-inner:focus{border-color:var(--l-primary-color,#722ed1)}.l-date-range-divider{margin:0 10px}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
@@ -1,2 +1,54 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import e from "../base.js";
|
|
2
|
+
import { kebabToCamel as t, parseAttrValue as n } from "../utils/index.js";
|
|
3
|
+
import r from "./index.less_inline.js";
|
|
4
|
+
import { $one as i, addClass as a, hasClass as o, on as s, removeClass as c, shouldEventNext as l } from "utilane/browser";
|
|
5
|
+
//#region src/components/description_panel/index.ts
|
|
6
|
+
var u = class extends e {
|
|
7
|
+
static baseName = "description-panel";
|
|
8
|
+
collapseHeight = 100;
|
|
9
|
+
static get observedAttributes() {
|
|
10
|
+
return ["collapse-height"];
|
|
11
|
+
}
|
|
12
|
+
attributeChangedCallback(e, r, i) {
|
|
13
|
+
e = t(e);
|
|
14
|
+
let a = n(i, this[e]);
|
|
15
|
+
a !== this[e] && (this[e] = a, e === "collapseHeight") && (this.collapseHeight === 100 ? this.style.removeProperty("--l-desc-panel-min-height") : this.style.setProperty("--l-desc-panel-min-height", `${this.collapseHeight}px`));
|
|
16
|
+
}
|
|
17
|
+
connectedCallback() {
|
|
18
|
+
this.loadStyleText(r), super.connectedCallback();
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return [
|
|
22
|
+
"<div class=\"content\"><slot></slot></div>",
|
|
23
|
+
"<div class=\"l-desc-panel-operator\">",
|
|
24
|
+
"<l-button type=\"primary\" data-action=\"collapse\" class=\"l-desc-panel-btnmore\" text>",
|
|
25
|
+
"<span>查看更多</span>",
|
|
26
|
+
"<l-arrow-down-icon class=\"l-desc-panel-arrow\"></l-arrow-down-icon>",
|
|
27
|
+
"</l-button></div>"
|
|
28
|
+
].join("");
|
|
29
|
+
}
|
|
30
|
+
afterInit() {
|
|
31
|
+
this.classList.add("collapse");
|
|
32
|
+
let e = i(".content", this.root), t = i(".l-desc-panel-operator", this.root);
|
|
33
|
+
if (e) {
|
|
34
|
+
let n = e.getBoundingClientRect().height;
|
|
35
|
+
n <= this.collapseHeight && (t &&= (t.remove(), null));
|
|
36
|
+
let r = 0;
|
|
37
|
+
if (t) {
|
|
38
|
+
let e = t.getBoundingClientRect().height, n = getComputedStyle(t).getPropertyValue("padding-top");
|
|
39
|
+
r = e - parseInt(n);
|
|
40
|
+
}
|
|
41
|
+
this.style.setProperty("--l-desc-panel-max-height", `${n + r}px`);
|
|
42
|
+
}
|
|
43
|
+
t && s(t, "click", this.#e);
|
|
44
|
+
}
|
|
45
|
+
#e = (e) => {
|
|
46
|
+
let [t, n, r] = l(e, "data-action", e.currentTarget);
|
|
47
|
+
if (t) {
|
|
48
|
+
let e = i("span", r);
|
|
49
|
+
o(this, "collapse") ? (c(this, "collapse"), e && (e.textContent = "收起")) : (a(this, "collapse"), e && (e.textContent = "查看更多"));
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
export { u as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/components/description_panel/index.less?inline
|
|
2
|
+
var e = ":host{--l-desc-panel-min-height:100px;--l-desc-panel-font-size:14px;--l-desc-panel-textindent:calc(var(--l-desc-panel-font-size) * 2);max-height:var(--l-desc-panel-max-height,max-content);color:#1f2937;font-size:var(--l-desc-panel-font-size);text-indent:var(--l-desc-panel-textindent);box-sizing:border-box;transition:all .15s linear;display:block;position:relative}.content{box-sizing:border-box;border:1px solid #0000}.l-desc-panel-operator{z-index:2;box-sizing:border-box;background:0 0;justify-content:center;width:100%;padding-top:0;padding-bottom:0;display:flex}.l-desc-panel-btnmore{font-size:var(--nt-desc-panel-font-size)}.l-desc-panel-btnmore:before{content:attr(data-text)}.l-desc-panel-arrow{transition:transform .3s ease-in-out;transform:rotate(180deg)}:host(.collapse){max-height:var(--l-desc-panel-min-height);overflow-y:hidden}:host(.collapse) .l-desc-panel-operator{background:linear-gradient(-180deg,#fff0 0%,#fff 80%);padding-top:65px;position:absolute;bottom:0;left:0}:host(.collapse) .l-desc-panel-arrow{transform:rotateX(0)}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
package/lib/dialog/dialog_box.js
CHANGED
|
@@ -4,9 +4,9 @@ import n from "./index.js";
|
|
|
4
4
|
import r from "./dialog_container.js";
|
|
5
5
|
import i from "../button/index.js";
|
|
6
6
|
import a from "../icon/close.js";
|
|
7
|
-
import
|
|
7
|
+
import o from "../form/form_item.js";
|
|
8
8
|
import s from "../input/index.js";
|
|
9
|
-
import { $$ as c, $one as l } from "
|
|
9
|
+
import { $$ as c, $one as l } from "utilane/browser";
|
|
10
10
|
//#region src/components/dialog/dialog_box.ts
|
|
11
11
|
function u(e, t, r, i = "alert") {
|
|
12
12
|
return new Promise((a) => {
|
|
@@ -41,9 +41,9 @@ function u(e, t, r, i = "alert") {
|
|
|
41
41
|
}
|
|
42
42
|
function d(t, n, o) {
|
|
43
43
|
e([
|
|
44
|
+
a,
|
|
44
45
|
i,
|
|
45
|
-
r
|
|
46
|
-
a
|
|
46
|
+
r
|
|
47
47
|
]);
|
|
48
48
|
let s = {
|
|
49
49
|
showCancel: !1,
|
|
@@ -56,10 +56,10 @@ function d(t, n, o) {
|
|
|
56
56
|
}
|
|
57
57
|
function f(n, o, s) {
|
|
58
58
|
e([
|
|
59
|
-
i,
|
|
60
|
-
r,
|
|
61
59
|
a,
|
|
62
|
-
t
|
|
60
|
+
t,
|
|
61
|
+
i,
|
|
62
|
+
r
|
|
63
63
|
]);
|
|
64
64
|
let l = {
|
|
65
65
|
showCancel: !0,
|
|
@@ -72,12 +72,12 @@ function f(n, o, s) {
|
|
|
72
72
|
}
|
|
73
73
|
function p(n, c, l) {
|
|
74
74
|
e([
|
|
75
|
-
i,
|
|
76
|
-
r,
|
|
77
75
|
a,
|
|
78
76
|
t,
|
|
79
77
|
o,
|
|
80
|
-
s
|
|
78
|
+
s,
|
|
79
|
+
i,
|
|
80
|
+
r
|
|
81
81
|
]);
|
|
82
82
|
let d = {
|
|
83
83
|
showCancel: !0,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/components/dialog/dialog_container.css?inline
|
|
2
|
-
var e = ":host{display:block;position:relative}:host(.l-container-close-outside){padding-top:10px;padding-right:10px}.l-dialog-main{padding:var(--l-dialog-main-padding,0);background-color:#fff;border-radius:5px;box-shadow:0 0 8px #0000001a}.l-dialog-header{padding:var(--l-dialog-header-padding,10px);border-bottom:1px solid var(--l-dialog-line-color,#0000000f);align-items:center;gap:5px;font-size:16px;font-weight:600;display:flex}.l-dialog-footer{padding:var(--l-dialog-footer-padding,10px);border-top:1px solid var(--l-dialog-line-color,#0000000f);justify-content:flex-end;gap:10px;display:flex}.l-dialog-container{padding:var(--l-dialog-container-padding,15px 10px);font-size:14px}.l-btn-dialog-close{--l-form-control-height:auto;position:absolute}.l-dialog-close1{right:var(--l-dialog-close-right,5px);top:var(--l-dialog-close-top,6px)}.l-dialog-close1::part(default){border:none;width:auto;height:auto;padding:5px;font-size:16px}.l-dialog-close2{right:var(--l-dialog-close-right,0);top:var(--l-dialog-close-top,0)}.l-dialog-close2::part(default){background-color:#fff;width:20px;height:20px;padding:0}.l-dialog-main--mobile{border-radius:10px}.l-dialog-main--mobile .l-dialog-header{text-align:center;border-bottom-color:#0000;justify-content:center;padding:20px 10px 5px;display:flex}.l-dialog-main--mobile .l-dialog-container{text-align:center;padding:5px 15px 20px}.l-dialog-main--mobile .l-dialog-footer{text-align:center;justify-content:stretch;align-items:stretch;gap:0;height:50px;padding:0;display:flex}.l-dialog-main--mobile .l-dialog-footer l-button{flex-grow:1;height:100%}.l-dialog-main--mobile .l-dialog-footer l-button+l-button{border-left:1px solid var(--l-dialog-line-color,#0000000f)}"
|
|
3
|
-
t.replaceSync(e);
|
|
2
|
+
var e = ":host{display:block;position:relative}:host(.l-container-close-outside){padding-top:10px;padding-right:10px}.l-dialog-main{padding:var(--l-dialog-main-padding,0);background-color:#fff;border-radius:5px;box-shadow:0 0 8px #0000001a}.l-dialog-header{padding:var(--l-dialog-header-padding,10px);border-bottom:1px solid var(--l-dialog-line-color,#0000000f);align-items:center;gap:5px;font-size:16px;font-weight:600;display:flex}.l-dialog-footer{padding:var(--l-dialog-footer-padding,10px);border-top:1px solid var(--l-dialog-line-color,#0000000f);justify-content:flex-end;gap:10px;display:flex}.l-dialog-container{padding:var(--l-dialog-container-padding,15px 10px);font-size:14px}.l-btn-dialog-close{--l-form-control-height:auto;position:absolute}.l-dialog-close1{right:var(--l-dialog-close-right,5px);top:var(--l-dialog-close-top,6px)}.l-dialog-close1::part(default){border:none;width:auto;height:auto;padding:5px;font-size:16px}.l-dialog-close2{right:var(--l-dialog-close-right,0);top:var(--l-dialog-close-top,0)}.l-dialog-close2::part(default){background-color:#fff;width:20px;height:20px;padding:0}.l-dialog-main--mobile{border-radius:10px}.l-dialog-main--mobile .l-dialog-header{text-align:center;border-bottom-color:#0000;justify-content:center;padding:20px 10px 5px;display:flex}.l-dialog-main--mobile .l-dialog-container{text-align:center;padding:5px 15px 20px}.l-dialog-main--mobile .l-dialog-footer{text-align:center;justify-content:stretch;align-items:stretch;gap:0;height:50px;padding:0;display:flex}.l-dialog-main--mobile .l-dialog-footer l-button{flex-grow:1;height:100%}.l-dialog-main--mobile .l-dialog-footer l-button+l-button{border-left:1px solid var(--l-dialog-line-color,#0000000f)}";
|
|
4
3
|
//#endregion
|
|
5
|
-
export {
|
|
4
|
+
export { e as default };
|