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/mask-Bx-yNIJv.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import e from "./base.js";
|
|
2
|
-
import { kebabToCamel as t, parseAttrValue as n } from "./utils/index.js";
|
|
3
|
-
import { $$ as r, $one as i, addClass as a, hasClass as o, off as s, on as c, removeClass as l, shouldEventNext as u, transition as d } from "ph-utils/browser";
|
|
4
|
-
//#region src/components/mask/index.less?inline
|
|
5
|
-
var f = ":host{display:none;position:relative}:host(.open){display:block}.l-mask,.l-panel{opacity:1;position:fixed;inset:0}.l-mask{z-index:var(--l-mask-zindex,100);background-color:#00000080}.l-panel{z-index:calc(var(--l-mask-zindex,100) + 1);color:#fff}", p = class extends e {
|
|
6
|
-
static baseName = "mask";
|
|
7
|
-
#e = !1;
|
|
8
|
-
zIndex = 100;
|
|
9
|
-
maskClosable = !0;
|
|
10
|
-
lockScroll = !0;
|
|
11
|
-
#t = "";
|
|
12
|
-
get open() {
|
|
13
|
-
return this.#e;
|
|
14
|
-
}
|
|
15
|
-
set open(e) {
|
|
16
|
-
this.#e = e, this.rendered && this.#n();
|
|
17
|
-
}
|
|
18
|
-
static customAttributes = [];
|
|
19
|
-
static get observedAttributes() {
|
|
20
|
-
return [
|
|
21
|
-
"open",
|
|
22
|
-
"z-index",
|
|
23
|
-
"mask-closable",
|
|
24
|
-
"lock-scroll",
|
|
25
|
-
...this.customAttributes
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
connectedCallback() {
|
|
29
|
-
this.loadStyleText(f), super.connectedCallback();
|
|
30
|
-
}
|
|
31
|
-
attributeChangedCallback(e, r, i) {
|
|
32
|
-
e = t(e);
|
|
33
|
-
let a = n(i, this[e], e);
|
|
34
|
-
a !== this[e] && (this[e] = a, e === "zIndex") && (a === 100 ? this.style.removeProperty("--l-mask-zindex") : this.style.setProperty("--l-mask-zindex", a));
|
|
35
|
-
}
|
|
36
|
-
render() {
|
|
37
|
-
let e = document.createDocumentFragment(), t = r("div", {
|
|
38
|
-
class: "l-mask",
|
|
39
|
-
part: "mask"
|
|
40
|
-
});
|
|
41
|
-
e.appendChild(t);
|
|
42
|
-
let n = r("div", {
|
|
43
|
-
class: "l-panel",
|
|
44
|
-
part: "panel"
|
|
45
|
-
}), i = this.contentRender();
|
|
46
|
-
return typeof i == "string" ? n.innerHTML = i : n.appendChild(i), e.appendChild(n), e;
|
|
47
|
-
}
|
|
48
|
-
contentRender() {
|
|
49
|
-
return "<slot></slot>";
|
|
50
|
-
}
|
|
51
|
-
#n() {
|
|
52
|
-
if (this.open) {
|
|
53
|
-
this.lockScroll && (this.#t = getComputedStyle(document.body).overflow, document.body.style.overflow = "hidden"), a(this, "open");
|
|
54
|
-
let e = i(".l-mask", this.root);
|
|
55
|
-
e && d(e, [[
|
|
56
|
-
"opacity",
|
|
57
|
-
"0",
|
|
58
|
-
"0.3s"
|
|
59
|
-
]], "enter");
|
|
60
|
-
let t = i(".l-panel", this.root);
|
|
61
|
-
t && d(t, [[
|
|
62
|
-
"opacity",
|
|
63
|
-
"0",
|
|
64
|
-
"0.3s"
|
|
65
|
-
]], "enter"), this.afterOpened();
|
|
66
|
-
} else if (o(this, "open")) {
|
|
67
|
-
this.emit("close");
|
|
68
|
-
let e = i(".l-panel", this.root);
|
|
69
|
-
e && d(e, [[
|
|
70
|
-
"opacity",
|
|
71
|
-
"0",
|
|
72
|
-
"0.3s"
|
|
73
|
-
]], "leave");
|
|
74
|
-
let t = i(".l-mask", this.root);
|
|
75
|
-
t && d(t, [[
|
|
76
|
-
"opacity",
|
|
77
|
-
"0",
|
|
78
|
-
"0.3s"
|
|
79
|
-
]], "leave", () => {
|
|
80
|
-
l(this, "open"), this.emit("closed");
|
|
81
|
-
}), this.lockScroll && (document.body.style.overflow = this.#t), this.afterClosed();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
afterInit() {
|
|
85
|
-
this.#n();
|
|
86
|
-
let e = i(".l-panel", this.root);
|
|
87
|
-
e && c(e, "click", this.#r);
|
|
88
|
-
}
|
|
89
|
-
beforeDestroy() {
|
|
90
|
-
let e = i(".l-panel", this.root);
|
|
91
|
-
e && s(e, "click", this.#r);
|
|
92
|
-
}
|
|
93
|
-
#r = (e) => {
|
|
94
|
-
let [t, n] = u(e, "data-action", e.currentTarget);
|
|
95
|
-
if (!t) {
|
|
96
|
-
this.maskClosable && (this.open = !1);
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
this.onAction(n) || this.emit("action", { detail: n });
|
|
100
|
-
};
|
|
101
|
-
afterOpened() {}
|
|
102
|
-
afterClosed() {}
|
|
103
|
-
onAction(e) {
|
|
104
|
-
return !1;
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
//#endregion
|
|
108
|
-
export { p as t };
|
package/lib/md_input-BX3bujz8.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { initAttr as e } from "./utils/index.js";
|
|
2
|
-
import { t } from "./form_inner-Cnwb6f_Q.js";
|
|
3
|
-
import { $$ as n, $one as r, addClass as i, off as a, on as o, removeClass as s } from "ph-utils/browser";
|
|
4
|
-
import { isBlank as c, random as l } from "ph-utils";
|
|
5
|
-
//#region src/components/md_input/index.less?inline
|
|
6
|
-
var u = ":host{--l-input-width:180px;width:var(--l-input-width,180px);height:var(--l-form-control-height,32px);display:inline-block;position:relative}.l-md-input__inner{box-sizing:border-box;background:0 0;border:0 solid silver;border-bottom-width:1px;outline:none;width:100%;height:100%;transition:border-color .3s}.l-md-input__inner:focus{border-color:var(--l-primary-color,#722ed1)}:host(.l-has-value) .l-md-input__label,.l-md-input__inner:focus+.l-md-input__label{font-size:12px;transform:translateY(-150%)}.l-md-input__inner:focus+.l-md-input__label{color:var(--nt-primary-color,#722ed1)}.l-md-input__label{color:#8c8c8c;cursor:text;align-items:center;font-size:13px;line-height:1;transition:color .3s,transform .3s;display:flex;position:absolute;top:50%;bottom:0;left:0;transform:translateY(-50%)}:host(.l-md-input-outline){--l-input-label-background:#fff}:host(.l-md-input-outline) .l-md-input__inner{border-width:1px;border-radius:4px;padding:0 10px}:host(.l-md-input-outline) .l-md-input__label{left:10px}:host(.l-md-input-outline) .l-md-input__inner:focus{border-width:2px}:host(.l-md-input-outline) .l-md-input__inner:focus+.l-md-input__label,:host(.l-md-input-outline.l-has-value) .l-md-input__label{background-color:#fff;padding-left:4px;padding-right:4px}", d = class extends t {
|
|
7
|
-
static baseName = "md-input";
|
|
8
|
-
outline = !1;
|
|
9
|
-
htmlType = "text";
|
|
10
|
-
inputmode;
|
|
11
|
-
label;
|
|
12
|
-
static get observedAttributes() {
|
|
13
|
-
return ["disabled"];
|
|
14
|
-
}
|
|
15
|
-
connectedCallback() {
|
|
16
|
-
e(this), this.loadStyleText(u), super.connectedCallback(), this.#e();
|
|
17
|
-
}
|
|
18
|
-
disconnectedCallback() {
|
|
19
|
-
super.disconnectedCallback(), this.#t();
|
|
20
|
-
}
|
|
21
|
-
render() {
|
|
22
|
-
c(this.value) || i(this, "l-has-value"), this.outline && i(this, "l-md-input-outline");
|
|
23
|
-
let e = document.createDocumentFragment(), t = `l-md-input-${l(8)}`, r = n("input", {
|
|
24
|
-
class: "l-md-input__inner",
|
|
25
|
-
type: this.htmlType,
|
|
26
|
-
name: this.getName(),
|
|
27
|
-
inputmode: this.inputmode,
|
|
28
|
-
id: t
|
|
29
|
-
});
|
|
30
|
-
if (e.appendChild(r), this.label) {
|
|
31
|
-
let r = n("label", {
|
|
32
|
-
class: "l-md-input__label",
|
|
33
|
-
for: t
|
|
34
|
-
});
|
|
35
|
-
r.textContent = this.label, e.appendChild(r);
|
|
36
|
-
}
|
|
37
|
-
return e;
|
|
38
|
-
}
|
|
39
|
-
setValue(e) {
|
|
40
|
-
super.setValue(e);
|
|
41
|
-
let t = r("input", this.root);
|
|
42
|
-
t && (t.value = e);
|
|
43
|
-
}
|
|
44
|
-
#e() {
|
|
45
|
-
let e = r("input", this.root);
|
|
46
|
-
e && o(e, "input", this.#n);
|
|
47
|
-
}
|
|
48
|
-
#t() {
|
|
49
|
-
let e = r("input", this.root);
|
|
50
|
-
e && a(e, "input", this.#n);
|
|
51
|
-
}
|
|
52
|
-
#n = (e) => {
|
|
53
|
-
let t = e.target.value;
|
|
54
|
-
this.setValue(t), c(t) ? s(this, "l-has-value") : i(this, "l-has-value");
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
//#endregion
|
|
58
|
-
export { d as t };
|
package/lib/menu-DKscK5mw.js
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import e from "./base.js";
|
|
2
|
-
import { kebabToCamel as t, parseAttrValue as n, unitNumberStr as r } from "./utils/index.js";
|
|
3
|
-
import { $ as i, $$ as a, $one as o, iterate as s, off as c, on as l } from "ph-utils/browser";
|
|
4
|
-
//#region src/components/menu/index.less?inline
|
|
5
|
-
var u = ":host{--l-menu-width:240px;--l-menu-height:auto;--l-menu-level:0;--l-menu-item-height:40px;--l-menu-item-padding-x:10px;--l-menu-item-indent:15px;--l-menu-item-radius:0;--l-menu-item-hover-background:var(--l-primary-color-light5,#f9f0ff);--l-menu-item-active-color:var(--l-primary-color,#722ed1);--l-menu-item-active-background:var(--l-primary-color-light5,#f9f0ff);--l-menu-border-color:transparent;--l-menu-border-width:0px;--l-menu-arrow-color:var(--l-info-color,#8c8c8c);--l-menu-collapsed-width:40px;--l-menu-icon-size:1.8rem;--l-menu-collapsed-icon-size:1.8rem;width:var(--l-menu-width);height:var(--l-menu-height);box-sizing:border-box;transition:width .3s;display:block}.l-menu{min-width:0;color:inherit;box-sizing:border-box;border-right:var(--l-menu-border-width) solid var(--l-menu-border-color);font-size:14px;transition:height .3s,width .3s;display:block;position:relative;overflow:hidden}.l-menu .l-menu{--l-menu-border-color:transparent}.l-menu-item,.l-submenu-title{padding:0 var(--l-menu-item-padding-x) 0 calc(var(--l-menu-item-padding-x) + var(--l-menu-level) * var(--l-menu-item-indent));height:var(--l-menu-item-height);cursor:pointer;box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;border-radius:var(--l-menu-item-radius);border-right:2px solid #0000;align-items:center;gap:6px;transition:color .3s,background-color .3s,border-color .3s,transform .2s;display:flex;position:relative;overflow:hidden}.l-menu-item:hover,.l-submenu-title:hover{background-color:var(--l-menu-item-hover-background)}.l-menu-item.active{background-color:var(--l-menu-item-active-background);color:var(--l-menu-item-active-color);box-shadow:inset 3px 0 var(--l-primary-color-light1,#39f);font-weight:500}.l-menu-icon-wrap{font-size:var(--l-menu-icon-size);flex:none;align-items:center;line-height:1;display:inline-flex}.l-menu-submenu{width:100%;display:block;overflow:hidden}.l-submenu-arrow-icon{color:var(--l-menu-arrow-color);transition:transform .3s;position:absolute;top:50%;right:10px;transform:translateY(-50%)rotate(90deg)}.l-menu-submenu.collapsed .l-submenu-arrow-icon{transform:translateY(-50%)rotate(0)}.l-menu--collapsed{display:none}.l-menu--hide{visibility:hidden;pointer-events:none;position:absolute}.l-menu-submenu.active .l-submenu-title{color:var(--l-menu-item-active-color)}:host(.menu--collapsed){width:var(--l-menu-collapsed-width)}:host(.menu--collapsed) .l-submenu-arrow-icon,:host(.menu--collapsed) .l-menu-item--label{display:none}:host(.menu--collapsed) .l-menu-icon-wrap{font-size:var(--l-menu-collapsed-icon-size,var(--l-menu-icon-size,1.8rem))}@media (prefers-reduced-motion:reduce){.l-menu,.l-menu-item,.l-submenu-title,.l-submenu-arrow-icon{transition:none}}", d = 350, f = class extends e {
|
|
6
|
-
static baseName = "menu";
|
|
7
|
-
_items;
|
|
8
|
-
_menuEl;
|
|
9
|
-
_activeKeys;
|
|
10
|
-
#e;
|
|
11
|
-
#t;
|
|
12
|
-
#n;
|
|
13
|
-
constructor() {
|
|
14
|
-
super(), this._items = [], this._activeKeys = /* @__PURE__ */ new Set(), this.#n = /* @__PURE__ */ new Map(), this.#e = /* @__PURE__ */ new Map(), this.#t = /* @__PURE__ */ new Map(), this.version = 2, this._state = { selectedIndex: "" };
|
|
15
|
-
}
|
|
16
|
-
static get observedAttributes() {
|
|
17
|
-
return [
|
|
18
|
-
"selected-index",
|
|
19
|
-
"accordion",
|
|
20
|
-
"collapsed",
|
|
21
|
-
"collapsed-width",
|
|
22
|
-
"icon-size",
|
|
23
|
-
"collapsed-icon-size"
|
|
24
|
-
];
|
|
25
|
-
}
|
|
26
|
-
attributeChanged(e, r, i) {
|
|
27
|
-
switch (e) {
|
|
28
|
-
case "selected-index":
|
|
29
|
-
this._state.selectedIndex = i || "";
|
|
30
|
-
break;
|
|
31
|
-
case "accordion":
|
|
32
|
-
this._state.accordion = n(i, !1, "accordion");
|
|
33
|
-
break;
|
|
34
|
-
case "collapsed":
|
|
35
|
-
this._state.collapsed = n(i, !1, "collapsed");
|
|
36
|
-
break;
|
|
37
|
-
case "collapsed-width":
|
|
38
|
-
case "icon-size":
|
|
39
|
-
case "collapsed-icon-size":
|
|
40
|
-
let r = t(e);
|
|
41
|
-
this._state[r] = i;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
updateDOM(e) {
|
|
45
|
-
if (e.has("collapsed") && (this._state.collapsed ? (this.classList.add("menu--collapsed"), this.#s()) : this.classList.remove("menu--collapsed")), e.has("selected-index") && this.updateSelectedKeys(this._state.selectedIndex), e.has("collapsed-width")) {
|
|
46
|
-
let e = r(this._state.collapsedWidth);
|
|
47
|
-
this.setStyleProperty("collapsed-width", e);
|
|
48
|
-
}
|
|
49
|
-
if (e.has("icon-size")) {
|
|
50
|
-
let e = r(this._state.iconSize);
|
|
51
|
-
this.setStyleProperty("icon-size", e);
|
|
52
|
-
}
|
|
53
|
-
if (e.has("collapsed-icon-size")) {
|
|
54
|
-
let e = r(this._state.collapsedIconSize);
|
|
55
|
-
this.setStyleProperty("collapsed-icon-size", e);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
setStyleProperty(e, t) {
|
|
59
|
-
let n = `--l-menu-${e}`;
|
|
60
|
-
t ? this.style.setProperty(n, t) : this.style.removeProperty(n);
|
|
61
|
-
}
|
|
62
|
-
afterInit() {
|
|
63
|
-
this.classList.add("l-menu", "l-menu--vertical"), l(this.root, "click", this._handleClick), l(this.root, "transitionend", this._onTransitionEnd), this._menuEl = o(".l-menu", this.root);
|
|
64
|
-
}
|
|
65
|
-
beforeDestroy() {
|
|
66
|
-
c(this.root, "click", this._handleClick), c(this.root, "transitionend", this._onTransitionEnd), this.#n.forEach((e) => clearTimeout(e)), this.#n.clear(), this.#e.forEach((e) => cancelAnimationFrame(e)), this.#e.clear(), this.#t.clear(), this._menuEl = void 0;
|
|
67
|
-
}
|
|
68
|
-
render_v2() {
|
|
69
|
-
return {
|
|
70
|
-
style: u,
|
|
71
|
-
template: a("div", { class: "l-menu" })
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
_handleClick = (e) => {
|
|
75
|
-
let { type: t, key: n, keyPaths: r, target: i } = this.#r(e.target);
|
|
76
|
-
if (i) {
|
|
77
|
-
if (t === 2 && !this._state.collapsed) {
|
|
78
|
-
let e = i.hasAttribute("expanded");
|
|
79
|
-
this._toggleSubMenu(i, !e), !e && this._state.accordion && this.#o(i);
|
|
80
|
-
} else t === 1 && (this.#i(r), this.updateSelectedKeys(n), this.emit("select", { detail: {
|
|
81
|
-
key: n,
|
|
82
|
-
keyPaths: r
|
|
83
|
-
} }));
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
#r(e, t) {
|
|
87
|
-
let n = 0, r = "", i, a = [];
|
|
88
|
-
do {
|
|
89
|
-
if (!e) break;
|
|
90
|
-
let o = e.getAttribute("index");
|
|
91
|
-
if (o && (r ||= o, a.unshift(o), t && t(e, o)), n === 0) {
|
|
92
|
-
let t = e.getAttribute("menu-role");
|
|
93
|
-
t && (n = Number(t), i = e);
|
|
94
|
-
}
|
|
95
|
-
e = e.parentElement;
|
|
96
|
-
} while (n >= 0);
|
|
97
|
-
return {
|
|
98
|
-
type: n,
|
|
99
|
-
key: r,
|
|
100
|
-
keyPaths: a,
|
|
101
|
-
target: i
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
expandSubmenus(e, t = !1) {
|
|
105
|
-
let n = i(".l-menu-submenu[index]", this.root), r = new Set(e);
|
|
106
|
-
s(n, (e) => {
|
|
107
|
-
let n = e.getAttribute("index") || "";
|
|
108
|
-
r.has(n) ? this._toggleSubMenu(e, !0) : t && this._toggleSubMenu(e, !1);
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
updateSelectedKeys(e) {
|
|
112
|
-
this._state.selectedIndex = e;
|
|
113
|
-
let t = e ? o(`.l-menu-item[index="${e}"]`, this.root) : null;
|
|
114
|
-
if (t) {
|
|
115
|
-
let e = this.#r(t, (e) => {
|
|
116
|
-
e.classList.add("active"), e.getAttribute("menu-role") === "2" && this._toggleSubMenu(e, !0);
|
|
117
|
-
});
|
|
118
|
-
this.#i(e.keyPaths);
|
|
119
|
-
} else this.#i([]);
|
|
120
|
-
}
|
|
121
|
-
#i(e) {
|
|
122
|
-
let t = i(".l-menu [index].active", this.root), n = new Set(e);
|
|
123
|
-
s(t, (e) => {
|
|
124
|
-
let t = e.getAttribute("index") || "";
|
|
125
|
-
n.has(t) || this.#r(e, (e, t) => {
|
|
126
|
-
n.has(t) || e.classList.remove("active");
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
_toggleSubMenu(e, t) {
|
|
131
|
-
let n = e.getAttribute("index") || "", r = o(".l-menu", e);
|
|
132
|
-
if (r && t !== e.hasAttribute("expanded")) {
|
|
133
|
-
if (this.#a(n), this.#t.set(n, { expand: t }), t) {
|
|
134
|
-
e.setAttribute("expanded", ""), e.classList.remove("collapsed"), r.classList.add("l-menu--hide"), r.classList.remove("l-menu--collapsed"), r.style.removeProperty("height");
|
|
135
|
-
let t = requestAnimationFrame(() => {
|
|
136
|
-
this.#e.delete(n);
|
|
137
|
-
let t = r.getBoundingClientRect();
|
|
138
|
-
r.style.height = "0", r.classList.remove("l-menu--hide"), requestAnimationFrame(() => {
|
|
139
|
-
e.hasAttribute("expanded") && (r.style.height = `${t.height}px`);
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
this.#e.set(n, t);
|
|
143
|
-
} else {
|
|
144
|
-
e.removeAttribute("expanded");
|
|
145
|
-
let t = r.getBoundingClientRect();
|
|
146
|
-
r.style.height = `${t.height}px`, e.classList.add("collapsed");
|
|
147
|
-
let i = requestAnimationFrame(() => {
|
|
148
|
-
this.#e.delete(n), e.hasAttribute("expanded") || (r.style.height = "0");
|
|
149
|
-
});
|
|
150
|
-
this.#e.set(n, i);
|
|
151
|
-
}
|
|
152
|
-
this.#n.set(n, window.setTimeout(() => {
|
|
153
|
-
this.#n.delete(n), this._onTransitionEnd({
|
|
154
|
-
target: r,
|
|
155
|
-
propertyName: "height"
|
|
156
|
-
});
|
|
157
|
-
}, d));
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
#a(e) {
|
|
161
|
-
let t = this.#n.get(e);
|
|
162
|
-
t && (clearTimeout(t), this.#n.delete(e));
|
|
163
|
-
let n = this.#e.get(e);
|
|
164
|
-
n && (cancelAnimationFrame(n), this.#e.delete(e));
|
|
165
|
-
}
|
|
166
|
-
#o(e) {
|
|
167
|
-
let t = e.parentElement;
|
|
168
|
-
if (!t) return;
|
|
169
|
-
let n = i(".l-menu-submenu[expanded]", t);
|
|
170
|
-
s(n, (t) => {
|
|
171
|
-
t !== e && this._toggleSubMenu(t, !1);
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
#s() {
|
|
175
|
-
let e = i(".l-menu-submenu[expanded]", this.root);
|
|
176
|
-
s(e, (e) => {
|
|
177
|
-
this._toggleSubMenu(e, !1);
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
_onTransitionEnd = (e) => {
|
|
181
|
-
if (e.propertyName !== "height") return;
|
|
182
|
-
let t = e.target;
|
|
183
|
-
if (!t.classList.contains("l-menu")) return;
|
|
184
|
-
let n = t.closest(".l-menu-submenu");
|
|
185
|
-
if (!n) return;
|
|
186
|
-
let r = n.getAttribute("index") || "", i = this.#n.get(r);
|
|
187
|
-
i && (clearTimeout(i), this.#n.delete(r));
|
|
188
|
-
let a = this.#t.get(r);
|
|
189
|
-
if (a && a.expand !== n.hasAttribute("expanded")) {
|
|
190
|
-
this.#t.delete(r);
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
this.#t.delete(r), t.style.removeProperty("height"), n.hasAttribute("expanded") || t.classList.add("l-menu--collapsed");
|
|
194
|
-
};
|
|
195
|
-
set items(e) {
|
|
196
|
-
this._items = e, this._menuEl && this._menuEl.replaceChildren(this._renderItems());
|
|
197
|
-
}
|
|
198
|
-
get items() {
|
|
199
|
-
return this._items;
|
|
200
|
-
}
|
|
201
|
-
_renderItems() {
|
|
202
|
-
this._activeKeys = this._state.selectedIndex ? new Set(this.#c(this._items, this._state.selectedIndex)) : /* @__PURE__ */ new Set();
|
|
203
|
-
let e = document.createDocumentFragment();
|
|
204
|
-
for (let t = 0, n = this._items.length; t < n; t++) e.appendChild(this._renderItem(this._items[t], 0));
|
|
205
|
-
return e;
|
|
206
|
-
}
|
|
207
|
-
_renderItem(e, t = 0) {
|
|
208
|
-
return e.children && e.children.length > 0 ? this._renderSubMenu(e, t) : this._renderMenuItem(e);
|
|
209
|
-
}
|
|
210
|
-
_renderMenuItem(e) {
|
|
211
|
-
let t = e.label, n = a("div", {
|
|
212
|
-
class: ["l-menu-item", this._activeKeys.has(e.key) ? "active" : ""],
|
|
213
|
-
index: e.key,
|
|
214
|
-
"menu-role": "1",
|
|
215
|
-
title: typeof t == "string" ? t : void 0
|
|
216
|
-
});
|
|
217
|
-
if (e.icon) {
|
|
218
|
-
let t = e.icon(e);
|
|
219
|
-
t.setAttribute("slot", "icon");
|
|
220
|
-
let r = a("span", { class: "l-menu-icon-wrap" });
|
|
221
|
-
r.appendChild(t), n.appendChild(r);
|
|
222
|
-
}
|
|
223
|
-
return n.appendChild(this._renderTitle(e)), n;
|
|
224
|
-
}
|
|
225
|
-
_renderSubMenu(e, t) {
|
|
226
|
-
let n = this._activeKeys.has(e.key), r = a("div", {
|
|
227
|
-
index: e.key,
|
|
228
|
-
class: [
|
|
229
|
-
"l-menu-submenu",
|
|
230
|
-
n ? "active" : void 0,
|
|
231
|
-
n ? void 0 : "collapsed"
|
|
232
|
-
],
|
|
233
|
-
"menu-role": "2"
|
|
234
|
-
});
|
|
235
|
-
n && r.setAttribute("expanded", ""), r.setAttribute("data-level", String(t));
|
|
236
|
-
let i = e.label, o = a("div", {
|
|
237
|
-
class: "l-submenu-title",
|
|
238
|
-
title: typeof i == "string" ? i : void 0
|
|
239
|
-
});
|
|
240
|
-
if (e.icon) {
|
|
241
|
-
let t = e.icon(e), n = a("span", { class: "l-menu-icon-wrap" });
|
|
242
|
-
n.appendChild(t), o.appendChild(n);
|
|
243
|
-
}
|
|
244
|
-
o.appendChild(this._renderTitle(e));
|
|
245
|
-
let s = a("l-arrow-right-icon", { class: "l-submenu-arrow-icon" });
|
|
246
|
-
if (o.appendChild(s), r.appendChild(o), e.children) {
|
|
247
|
-
let i = a("div", { class: ["l-menu", n ? void 0 : "l-menu--collapsed"] });
|
|
248
|
-
i.style.setProperty("--l-menu-level", String(t + 1));
|
|
249
|
-
for (let n = 0, r = e.children.length; n < r; n++) i.appendChild(this._renderItem(e.children[n], t + 1));
|
|
250
|
-
r.appendChild(i);
|
|
251
|
-
}
|
|
252
|
-
return r;
|
|
253
|
-
}
|
|
254
|
-
_renderTitle(e) {
|
|
255
|
-
let t;
|
|
256
|
-
return t = typeof e.label == "string" ? a("span", { textContent: e.label }) : e.label(e), t.classList.add("l-menu-item--label"), t;
|
|
257
|
-
}
|
|
258
|
-
#c(e, t) {
|
|
259
|
-
let n = (e, r) => {
|
|
260
|
-
for (let i of e) {
|
|
261
|
-
let e = [...r, i.key];
|
|
262
|
-
if (t === i.key) return e;
|
|
263
|
-
if (i.children) {
|
|
264
|
-
let t = n(i.children, e);
|
|
265
|
-
if (t.length > 0) return t;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return [];
|
|
269
|
-
};
|
|
270
|
-
return n(e, []);
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
//#endregion
|
|
274
|
-
export { f as t };
|
package/lib/modal-Cwi3qlEf.js
DELETED
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import e from "./base.js";
|
|
2
|
-
import { kebabToCamel as t, parseAttrValue as n, unitNumberStr as r } from "./utils/index.js";
|
|
3
|
-
import { t as i } from "./mask-Ox6CoyFB.js";
|
|
4
|
-
import { $$ as a, $one as o, off as s, on as c, shouldEventNext as l, transition as u } from "ph-utils/browser";
|
|
5
|
-
//#region src/components/modal/index.less?inline
|
|
6
|
-
var d = ":host{display:none}:host(.open){display:block}.l-modal-mask{z-index:var(--l-modal-zindex,100)}.l-modal-wrapper{width:100%;height:100%;z-index:calc(var(--l-modal-zindex,100) + 1);position:fixed;top:0;left:0}.l-modal{--l-modal-translate:translate3d(0, 80px, 0);border-radius:var(--l-modal-border-radius,5px);width:var(--l-modal-width,27%);opacity:1;transform:var(--l-modal-translate) scale3d(1, 1, 1);background-color:#fff;margin:auto;transition:opacity .3s,transform .3s;position:relative;box-shadow:0 0 8px #0000001a}.l-modal-header{padding:var(--l-modal-header-padding,10px);border-bottom:1px solid var(--l-modal-line-color,#0000000f);align-items:center;gap:5px;font-size:16px;font-weight:600;display:flex}.l-modal-footer{padding:var(--l-modal-footer-padding,10px);border-top:1px solid var(--l-modal-line-color,#0000000f);justify-content:flex-end;gap:10px;display:flex}.l-modal-container{padding:var(--l-modal-container-padding,15px 10px);font-size:14px}.l-btn-modal-close{--l-form-control-height:auto;position:absolute}.l-modal-close1{top:8px;right:5px}.l-modal-close1::part(default){border:none;width:auto;height:auto;padding:5px;font-size:16px}.l-modal-close2{top:-10px;right:-10px}.l-modal-close2::part(default){background-color:#fff;width:20px;height:20px;padding:0}.mask-transition-enter-from,.mask-transition-leave-to{opacity:0}.modal-transition-enter-from,.modal-transition-leave-to{transform:translate(0,0)scale3d(0,0,0)}.l-modal--mobile{border-radius:10px}.l-modal--mobile .l-modal-header{text-align:center;border-bottom-color:#0000;justify-content:center;padding:20px 10px 5px;display:flex}.l-modal--mobile .l-modal-container{--l-modal-container-padding:5px 15px 20px;text-align:center}.l-modal--mobile .l-modal-footer{text-align:center;justify-content:stretch;align-items:stretch;gap:0;height:50px;padding:0;display:flex}.l-modal--mobile .l-modal-footer-btn{flex-grow:1;height:100%}.l-modal--mobile .l-modal-footer-btn+.l-modal-footer-btn{border-left:1px solid var(--l-modal-line-color,#0000000f)}.l-modal--middle{--l-modal-translate:translate3d(0, -50%, 0);top:50%}.l-modal--bottom{--l-modal-translate:translate3d(0, -100%, 0);border-bottom-right-radius:0;border-bottom-left-radius:0;width:100%;top:100%}@media screen and (width<=768px){:host{--l-modal-width:80%}}", f = class extends e {
|
|
7
|
-
static baseName = "modal";
|
|
8
|
-
_bodyOverflow = "";
|
|
9
|
-
constructor() {
|
|
10
|
-
super(), this.version = 2, this._state = {
|
|
11
|
-
destroyOnClose: !1,
|
|
12
|
-
maskClosable: !0,
|
|
13
|
-
mask: !0,
|
|
14
|
-
cancel: !0,
|
|
15
|
-
cancelText: "取消",
|
|
16
|
-
okText: "确定",
|
|
17
|
-
confirmLoading: !1,
|
|
18
|
-
close: 1,
|
|
19
|
-
verticalAlign: "top",
|
|
20
|
-
mobile: !1,
|
|
21
|
-
show: !1,
|
|
22
|
-
header: !0,
|
|
23
|
-
footer: !0
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
static get observedAttributes() {
|
|
27
|
-
return [
|
|
28
|
-
"show",
|
|
29
|
-
"width",
|
|
30
|
-
"confirm-loading",
|
|
31
|
-
"destroy-on-close",
|
|
32
|
-
"mask-closable",
|
|
33
|
-
"mask",
|
|
34
|
-
"cancel",
|
|
35
|
-
"cancel-text",
|
|
36
|
-
"ok-text",
|
|
37
|
-
"close",
|
|
38
|
-
"vertical-align",
|
|
39
|
-
"mobile",
|
|
40
|
-
"z-index",
|
|
41
|
-
"header",
|
|
42
|
-
"footer",
|
|
43
|
-
"header-title"
|
|
44
|
-
];
|
|
45
|
-
}
|
|
46
|
-
attributeChanged(e, i, a) {
|
|
47
|
-
switch (e) {
|
|
48
|
-
case "show":
|
|
49
|
-
case "confirm-loading":
|
|
50
|
-
case "destroy-on-close":
|
|
51
|
-
case "mask-closable":
|
|
52
|
-
case "mask":
|
|
53
|
-
case "cancel":
|
|
54
|
-
case "mobile":
|
|
55
|
-
case "header":
|
|
56
|
-
case "footer":
|
|
57
|
-
this._state[t(e)] = n(a, !1, e);
|
|
58
|
-
break;
|
|
59
|
-
case "cancel-text":
|
|
60
|
-
this._state.cancelText = n(a, "取消");
|
|
61
|
-
break;
|
|
62
|
-
case "ok-text":
|
|
63
|
-
this._state.okText = n(a, "确定");
|
|
64
|
-
break;
|
|
65
|
-
case "close":
|
|
66
|
-
this._state.close = n(a, 1);
|
|
67
|
-
break;
|
|
68
|
-
case "width":
|
|
69
|
-
this._state[e] = r(a);
|
|
70
|
-
break;
|
|
71
|
-
case "vertical-align":
|
|
72
|
-
this._state.verticalAlign = n(a, "top");
|
|
73
|
-
break;
|
|
74
|
-
case "z-index":
|
|
75
|
-
this._state.zIndex = a;
|
|
76
|
-
break;
|
|
77
|
-
case "header-title": this._state.headerTitle = a;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
updateDOM(e) {
|
|
81
|
-
if (e.has("show") && (this._state.show ? this.#e() : this.#t()), e.has("width") && this._setWidth(), e.has("confirm-loading")) {
|
|
82
|
-
let e = o("l-button[modal-action=\"ok\"]", this.root);
|
|
83
|
-
e && e.setAttribute("loading", this._state.confirmLoading.toString());
|
|
84
|
-
}
|
|
85
|
-
e.has("z-index") && this._setZIndex();
|
|
86
|
-
}
|
|
87
|
-
afterInit() {
|
|
88
|
-
this._setWidth(), this._setZIndex(), this._state.show && this.#e();
|
|
89
|
-
}
|
|
90
|
-
render_v2() {
|
|
91
|
-
return {
|
|
92
|
-
style: [d],
|
|
93
|
-
styleSheets: [i]
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
_setZIndex() {
|
|
97
|
-
this._state.zIndex ? this.style.setProperty("--l-modal-zindex", this._state.zIndex) : this.style.removeProperty("--l-modal-zindex");
|
|
98
|
-
}
|
|
99
|
-
_setWidth() {
|
|
100
|
-
this._state.width ? this.style.setProperty("--l-modal-width", this._state.width) : this.style.removeProperty("--l-modal-width");
|
|
101
|
-
}
|
|
102
|
-
#e() {
|
|
103
|
-
this._bodyOverflow = getComputedStyle(document.body).overflow, this.classList.add("open"), document.body.style.overflow = "hidden";
|
|
104
|
-
let e = o(".l-modal-wrapper", this.root);
|
|
105
|
-
if (e) {
|
|
106
|
-
let e = o(".l-mask", this.root);
|
|
107
|
-
e && u(e, "mask-transition");
|
|
108
|
-
let t = o(".l-modal", this.root);
|
|
109
|
-
u(t, "modal-transition");
|
|
110
|
-
} else {
|
|
111
|
-
let t = document.createDocumentFragment(), n = null;
|
|
112
|
-
this._state.mask && (n = a("div", {
|
|
113
|
-
class: "l-mask l-modal-mask",
|
|
114
|
-
part: "mask"
|
|
115
|
-
}), t.appendChild(n)), e = a("div", {
|
|
116
|
-
class: "l-modal-wrapper",
|
|
117
|
-
part: "wrapper"
|
|
118
|
-
});
|
|
119
|
-
let r = a("div", {
|
|
120
|
-
class: [
|
|
121
|
-
"l-modal",
|
|
122
|
-
`l-modal--${this._state.mobile ? "mobile" : "pc"}`,
|
|
123
|
-
`l-modal--${this._state.verticalAlign}`
|
|
124
|
-
],
|
|
125
|
-
part: "default"
|
|
126
|
-
});
|
|
127
|
-
if (r.setAttribute("modal-action", "modal"), this._state.close !== 0) {
|
|
128
|
-
let e = a("l-button", {
|
|
129
|
-
shape: "circle",
|
|
130
|
-
type: "normal",
|
|
131
|
-
class: `l-btn-modal-close l-modal-close${this._state.close}`,
|
|
132
|
-
"modal-action": "close",
|
|
133
|
-
part: "close-btn"
|
|
134
|
-
}), t = a("l-close-icon");
|
|
135
|
-
e.appendChild(t), r.appendChild(e);
|
|
136
|
-
}
|
|
137
|
-
if (this._state.header) {
|
|
138
|
-
let e = a("header", {
|
|
139
|
-
class: "l-modal-header",
|
|
140
|
-
part: "header"
|
|
141
|
-
}), t = a("slot", { name: "header" });
|
|
142
|
-
t.textContent = this._state.headerTitle || "", e.appendChild(t), r.appendChild(e);
|
|
143
|
-
}
|
|
144
|
-
let i = a("div", {
|
|
145
|
-
class: "l-modal-container",
|
|
146
|
-
part: "container"
|
|
147
|
-
}), o = a("slot");
|
|
148
|
-
if (i.appendChild(o), r.appendChild(i), this._state.footer) {
|
|
149
|
-
let e = a("footer", {
|
|
150
|
-
class: "l-modal-footer",
|
|
151
|
-
part: "footer"
|
|
152
|
-
}), t = a("slot", { name: "footer" });
|
|
153
|
-
if (this._state.cancel) {
|
|
154
|
-
let e = a("l-button", {
|
|
155
|
-
class: "l-modal-footer-btn",
|
|
156
|
-
text: this._state.mobile
|
|
157
|
-
});
|
|
158
|
-
e.textContent = this._state.cancelText, e.setAttribute("modal-action", "cancel"), t.appendChild(e);
|
|
159
|
-
}
|
|
160
|
-
let n = a("l-button", {
|
|
161
|
-
type: "primary",
|
|
162
|
-
class: "l-modal-footer-btn",
|
|
163
|
-
loading: this._state.confirmLoading,
|
|
164
|
-
text: this._state.mobile
|
|
165
|
-
});
|
|
166
|
-
n.textContent = this._state.okText, n.setAttribute("modal-action", "ok"), t.appendChild(n), e.appendChild(t), r.appendChild(e);
|
|
167
|
-
}
|
|
168
|
-
e.appendChild(r), e.setAttribute("role", "dialog"), e.setAttribute("modal-action", "mask"), c(e, "click", this.#r), t.appendChild(e), this.appendToRoot(t), u(r, "modal-transition"), n && u(n, "mask-transition");
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
#t() {
|
|
172
|
-
document.body.style.setProperty("overflow", this._bodyOverflow);
|
|
173
|
-
let e = o(".l-modal", this.root);
|
|
174
|
-
u(e, "modal-transition", "leave", () => {
|
|
175
|
-
this._state.destroyOnClose && this.#n(), this.classList.remove("open"), this.emit("close");
|
|
176
|
-
});
|
|
177
|
-
let t = o(".l-mask", this.root);
|
|
178
|
-
t && u(t, "mask-transition", "leave");
|
|
179
|
-
}
|
|
180
|
-
disconnectedCallback() {
|
|
181
|
-
this.#n(), super.disconnectedCallback();
|
|
182
|
-
}
|
|
183
|
-
#n() {
|
|
184
|
-
let e = o(".l-modal-wrapper", this.root);
|
|
185
|
-
e && (s(e, "click", this.#r), this.root.removeChild(e));
|
|
186
|
-
let t = o(".l-mask", this.root);
|
|
187
|
-
t && this.root.removeChild(t);
|
|
188
|
-
}
|
|
189
|
-
#r = (e) => {
|
|
190
|
-
let [t, n] = l(e, "modal-action", this.root);
|
|
191
|
-
if (t) {
|
|
192
|
-
let e = "";
|
|
193
|
-
this._state.maskClosable && n === "mask" || n === "cancel" || n === "close" ? e = "cancel" : n === "ok" && (e = "ok"), e && this.dispatchEvent(new CustomEvent(e, { detail: { action: n } }));
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
};
|
|
197
|
-
//#endregion
|
|
198
|
-
export { f as t };
|