litos-ui 0.21.0 → 0.23.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 +121 -15
- package/README.zh-CN.md +155 -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 +8 -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.d.ts +1 -0
- package/lib/dialog/dialog_container.js +71 -60
- package/lib/dialog/dialog_container_style.js +8 -2
- package/lib/dialog/index.d.ts +1 -0
- package/lib/dialog/index.js +11 -6
- 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-box.d.ts +2 -0
- package/lib/entries/notification-box.js +2 -0
- package/lib/entries/notification.d.ts +2 -0
- package/lib/entries/notification.js +2 -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 +8 -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 +12 -0
- package/lib/index.js +48 -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 +8 -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 +171 -0
- package/lib/notification/index.js +326 -0
- package/lib/notification/index.less_inline.js +4 -0
- package/lib/notification/notification_box.d.ts +40 -0
- package/lib/notification/notification_box.js +57 -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 +8 -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 +8 -2
- package/lib/{mask-Ox6CoyFB.js → styles/mask/index.css_inline.js} +2 -3
- package/lib/styles/mask/index.js +8 -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 +8 -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/dark.css +21 -1
- 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 +7 -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
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { kebabToCamel as e, parseAttrValue as t, stopSignal as n, unitNumberStr as r } from "./utils/index.js";
|
|
2
|
-
import i from "./utils/context_provide.js";
|
|
3
|
-
import { n as a, t as o } from "./esm-DAha108i.js";
|
|
4
|
-
import { $$ as s, $one as c, addClass as l, removeClass as u } from "ph-utils/browser";
|
|
5
|
-
//#region src/components/form/form_item.less?inline
|
|
6
|
-
var d = ":host{display:var(--l-form-item-display,flex);font-size:14px}.l-form-item__label{text-align:var(--l-form-label-align,right);width:var(--l-form-label-width,auto);height:var(--l-form-label-height,var(--l-form-control-height,32px));line-height:var(--l-form-label-height,var(--l-form-control-height,32px));color:#606266;box-sizing:border-box;padding:0 10px 0 0;display:inline-block}.l-form-item__label:empty{display:var(--l-form-label-empty-display,inline-block)}:host(.is-required) .l-form-item__label:before{content:\"*\";color:var(--l-warn-color,#f56c6c);vertical-align:middle;margin-right:4px}.l-form-item__content{flex:1;align-items:center;display:flex;position:relative}.l-form-item__error{color:var(--nt-error-color,#ed3f13);padding-top:3px;font-size:12px;line-height:1;position:absolute;top:100%;left:0}:host(.l-form-item--left){--l-form-label-align:left}:host(.l-form-item--top){--l-form-item-display:grid;--l-form-label-align:left;--l-form-label-empty-display:none;grid-template-columns:1fr}", f = class extends i {
|
|
7
|
-
static baseName = "form-item";
|
|
8
|
-
formErrors;
|
|
9
|
-
_errorSignalStop;
|
|
10
|
-
constructor() {
|
|
11
|
-
super(), this.version = 2, this.contextEventName = "form-item-context-request", this._state = {
|
|
12
|
-
labelPosition: "right",
|
|
13
|
-
required: !1
|
|
14
|
-
}, this.context = a({ innerBlock: !1 });
|
|
15
|
-
}
|
|
16
|
-
static get observedAttributes() {
|
|
17
|
-
return [
|
|
18
|
-
"error",
|
|
19
|
-
"label",
|
|
20
|
-
"required",
|
|
21
|
-
"inner-block",
|
|
22
|
-
"prop",
|
|
23
|
-
"label-position",
|
|
24
|
-
"verify",
|
|
25
|
-
"pattern",
|
|
26
|
-
"validity",
|
|
27
|
-
"label-width",
|
|
28
|
-
"label-height"
|
|
29
|
-
];
|
|
30
|
-
}
|
|
31
|
-
attributeChanged(n, i, a) {
|
|
32
|
-
switch (n) {
|
|
33
|
-
case "error":
|
|
34
|
-
case "label":
|
|
35
|
-
case "verify":
|
|
36
|
-
case "pattern":
|
|
37
|
-
case "validity":
|
|
38
|
-
this._state[n] = a;
|
|
39
|
-
break;
|
|
40
|
-
case "label-position":
|
|
41
|
-
this._state.labelPosition = a;
|
|
42
|
-
break;
|
|
43
|
-
case "inner-block":
|
|
44
|
-
let i = t(a, !1, n);
|
|
45
|
-
this.context({ innerBlock: i });
|
|
46
|
-
break;
|
|
47
|
-
case "required":
|
|
48
|
-
let o = t(a, !1, n);
|
|
49
|
-
this._state.required = o;
|
|
50
|
-
break;
|
|
51
|
-
case "prop":
|
|
52
|
-
this._state.prop = a, this.context({
|
|
53
|
-
...this.context(),
|
|
54
|
-
prop: a
|
|
55
|
-
});
|
|
56
|
-
break;
|
|
57
|
-
case "label-width":
|
|
58
|
-
case "label-height": this._state[e(n)] = r(a);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
updateDOM(e) {
|
|
62
|
-
e.has("required") && this._updateRequired(), e.has("label") && this._updateLabel(), e.has("error") && this._updateError(), e.has("label-width") && (this._state.labelWidth ? this.style.setProperty("--l-form-label-width", this._state.labelWidth) : this.style.removeProperty("--l-form-label-width")), e.has("label-height") && (this._state.labelHeight ? this.style.setProperty("--l-form-label-height", this._state.labelHeight) : this.style.removeProperty("--l-form-label-height"));
|
|
63
|
-
}
|
|
64
|
-
connectedCallback() {
|
|
65
|
-
super.connectedCallback(), this._updateRequired(), this._parseSchema(), this.emitInject("form-context-request", ((e, t) => {
|
|
66
|
-
this.formErrors = t;
|
|
67
|
-
})), this._errorSignalStop = o(() => {
|
|
68
|
-
let e = this.context().prop, t = this.formErrors ? this.formErrors() : null;
|
|
69
|
-
e && t && (this._state.error = t[e], this._updateError());
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
beforeDestroy() {
|
|
73
|
-
this._errorSignalStop = n(this._errorSignalStop);
|
|
74
|
-
}
|
|
75
|
-
setRules(e) {
|
|
76
|
-
let t = this._state.prop;
|
|
77
|
-
if (t) {
|
|
78
|
-
let n = {
|
|
79
|
-
...e,
|
|
80
|
-
key: t
|
|
81
|
-
};
|
|
82
|
-
this._updateRules(n);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
render_v2() {
|
|
86
|
-
return {
|
|
87
|
-
template: this.render(),
|
|
88
|
-
style: [d]
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
render() {
|
|
92
|
-
this.classList.add(`l-form-item--${this._state.labelPosition}`);
|
|
93
|
-
let e = document.createDocumentFragment();
|
|
94
|
-
this._state.label != null && e.appendChild(s("label", {
|
|
95
|
-
class: "l-form-item__label",
|
|
96
|
-
textContent: this._state.label
|
|
97
|
-
}));
|
|
98
|
-
let t = s("div", { class: "l-form-item__content" }), n = s("slot");
|
|
99
|
-
return t.appendChild(n), this._state.error && t.appendChild(s("div", {
|
|
100
|
-
class: "l-form-item__error",
|
|
101
|
-
textContent: this._state.error
|
|
102
|
-
})), e.appendChild(t), e;
|
|
103
|
-
}
|
|
104
|
-
_updateRequired() {
|
|
105
|
-
this._state.required ? l(this, "is-required") : u(this, "is-required");
|
|
106
|
-
}
|
|
107
|
-
_parseSchema() {
|
|
108
|
-
let e = this.context().prop;
|
|
109
|
-
if (e) {
|
|
110
|
-
let t = [], n = this._state.verify;
|
|
111
|
-
n && (t = n.split("|"));
|
|
112
|
-
let r = this._state.pattern;
|
|
113
|
-
r && t.push(new RegExp(r));
|
|
114
|
-
let i = {
|
|
115
|
-
key: e,
|
|
116
|
-
required: this._state.required,
|
|
117
|
-
message: this._state.validity,
|
|
118
|
-
rules: t
|
|
119
|
-
};
|
|
120
|
-
this._updateRules(i);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
_updateError() {
|
|
124
|
-
if (this._state.error ? l(this, "is-error") : u(this, "is-error"), !this.rendered) return;
|
|
125
|
-
let e = c(".l-form-item__error", this.root);
|
|
126
|
-
if (e) this._state.error ? e.textContent = this._state.error : e.remove();
|
|
127
|
-
else if (this._state.error) {
|
|
128
|
-
e = document.createElement("div"), e.className = "l-form-item__error", e.textContent = this._state.error;
|
|
129
|
-
let t = c(".l-form-item__content", this.root);
|
|
130
|
-
t && t.appendChild(e);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
_updateLabel() {
|
|
134
|
-
if (!this.rendered) return;
|
|
135
|
-
let e = c(".l-form-item__label", this.root);
|
|
136
|
-
e == null ? this._state.label != null && (e = document.createElement("div"), e.className = "l-form-item__label", e.textContent = this._state.label, this.root.prepend(e)) : this._state.label == null ? e.remove() : e.textContent = this._state.label;
|
|
137
|
-
}
|
|
138
|
-
_updateRules(e) {
|
|
139
|
-
this.emit("form-rule-change", {
|
|
140
|
-
bubbles: !0,
|
|
141
|
-
composed: !0,
|
|
142
|
-
detail: e
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
//#endregion
|
|
147
|
-
export { f as t };
|
package/lib/image-CVQai6NX.js
DELETED
|
@@ -1,162 +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, formatClass as o, off as s, on as c, removeClass as l, shouldEventNext as u } from "ph-utils/browser";
|
|
4
|
-
//#region src/components/image/index.less?inline
|
|
5
|
-
var d = ":host{vertical-align:middle;box-sizing:border-box;width:auto;height:auto;display:inline-flex}.l-image-inner{vertical-align:middle;object-fit:var(--l-image-fit,fill);width:100%;height:100%}.l-image-inner--preview{cursor:pointer}.l-image-hide{display:none}.l-image-fallback{background-color:#0000001a;justify-content:center;align-items:center;width:100%;height:100%;display:inline-flex}", f = class extends e {
|
|
6
|
-
static baseName = "image";
|
|
7
|
-
alt;
|
|
8
|
-
_src = "";
|
|
9
|
-
_loading = "eager";
|
|
10
|
-
fit;
|
|
11
|
-
width;
|
|
12
|
-
height;
|
|
13
|
-
fallback;
|
|
14
|
-
customFallback = !1;
|
|
15
|
-
isError = !1;
|
|
16
|
-
previewDisabled = !1;
|
|
17
|
-
_previewEl;
|
|
18
|
-
_previewImageList;
|
|
19
|
-
_previewIndex = 0;
|
|
20
|
-
_placeholder;
|
|
21
|
-
_imageInner;
|
|
22
|
-
get src() {
|
|
23
|
-
return this._src;
|
|
24
|
-
}
|
|
25
|
-
set src(e) {
|
|
26
|
-
this._src = e, this._loadActualImage();
|
|
27
|
-
}
|
|
28
|
-
get loading() {
|
|
29
|
-
return this._loading;
|
|
30
|
-
}
|
|
31
|
-
set loading(e) {
|
|
32
|
-
this._loading = e;
|
|
33
|
-
}
|
|
34
|
-
get placeholder() {
|
|
35
|
-
return this._placeholder;
|
|
36
|
-
}
|
|
37
|
-
set placeholder(e) {
|
|
38
|
-
this._placeholder = e;
|
|
39
|
-
}
|
|
40
|
-
get previewImageList() {
|
|
41
|
-
return this._previewImageList;
|
|
42
|
-
}
|
|
43
|
-
set previewImageList(e) {
|
|
44
|
-
this.setPreviewImageList(e);
|
|
45
|
-
}
|
|
46
|
-
get previewIndex() {
|
|
47
|
-
return this._previewIndex;
|
|
48
|
-
}
|
|
49
|
-
set previewIndex(e) {
|
|
50
|
-
this.setPreviewIndex(e);
|
|
51
|
-
}
|
|
52
|
-
setPreviewImageList(e) {
|
|
53
|
-
this._previewImageList = e;
|
|
54
|
-
}
|
|
55
|
-
setPreviewIndex(e) {
|
|
56
|
-
this._previewIndex = e;
|
|
57
|
-
}
|
|
58
|
-
connectedCallback() {
|
|
59
|
-
this.loadStyleText(d), super.connectedCallback();
|
|
60
|
-
}
|
|
61
|
-
static get observedAttributes() {
|
|
62
|
-
return [
|
|
63
|
-
"src",
|
|
64
|
-
"loading",
|
|
65
|
-
"fit",
|
|
66
|
-
"width",
|
|
67
|
-
"height",
|
|
68
|
-
"placeholder",
|
|
69
|
-
"preview-disabled",
|
|
70
|
-
"preview-image-list",
|
|
71
|
-
"preview-index",
|
|
72
|
-
"fallback",
|
|
73
|
-
"custom-fallback"
|
|
74
|
-
];
|
|
75
|
-
}
|
|
76
|
-
attributeChangedCallback(e, r, i) {
|
|
77
|
-
e = t(e);
|
|
78
|
-
let a = n(i, this[e], e);
|
|
79
|
-
switch (a !== this[e] && (e === "previewImageList" ? this.setPreviewImageList(a ? a.split(",") : void 0) : this[e] = a), e) {
|
|
80
|
-
case "width":
|
|
81
|
-
case "height": this.rendered && this._updateSize();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
render() {
|
|
85
|
-
let e = this.alt || this.getAttribute("alt"), t = this.placeholder || this.src;
|
|
86
|
-
return r("img", {
|
|
87
|
-
class: o(["l-image-inner", this.previewDisabled ? void 0 : "l-image-inner--preview"]),
|
|
88
|
-
alt: e,
|
|
89
|
-
loading: this.loading,
|
|
90
|
-
src: t,
|
|
91
|
-
part: "inner",
|
|
92
|
-
"l-action": "inner"
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
_updateSize() {
|
|
96
|
-
this.width ? this.style.setProperty("width", this.width) : this.style.removeProperty("width"), this.height ? this.style.setProperty("height", this.height) : this.style.removeProperty("height");
|
|
97
|
-
}
|
|
98
|
-
afterInit() {
|
|
99
|
-
this.fit && this.fit !== "fill" && this.style.setProperty("--l-image-fit", this.fit), this._updateSize(), this._imageInner = i(".l-image-inner", this.root), c(this._imageInner, "click", this._onTap), c(this._imageInner, "error", this._onError), c(this._imageInner, "load", this._onLoad), this._loadActualImage();
|
|
100
|
-
}
|
|
101
|
-
beforeDestroy() {
|
|
102
|
-
this._imageInner && (s(this._imageInner, "click", this._onTap), s(this._imageInner, "error", this._onError), s(this._imageInner, "load", this._onLoad));
|
|
103
|
-
}
|
|
104
|
-
setIsError(e = !1) {
|
|
105
|
-
if (this.isError !== e) {
|
|
106
|
-
if (this.isError = e, e) {
|
|
107
|
-
if (!this.customFallback) {
|
|
108
|
-
this.fallback && this._imageInner && (this._imageInner.src = this.fallback);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
this._imageInner && a(this._imageInner, "l-image-hide");
|
|
112
|
-
let e = i(".l-image-fallback", this.root);
|
|
113
|
-
this.fallback || (e = r("div", {
|
|
114
|
-
class: "l-image-fallback",
|
|
115
|
-
part: "fallback",
|
|
116
|
-
innerHTML: "<slot name='fallback'></slot>"
|
|
117
|
-
}), this.root.appendChild(e));
|
|
118
|
-
} else {
|
|
119
|
-
this._imageInner && l(this._imageInner, "l-image-hide");
|
|
120
|
-
let e = i(".l-image-fallback", this.root);
|
|
121
|
-
e && e.remove();
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
openPreview() {
|
|
126
|
-
if (!this._previewEl) {
|
|
127
|
-
let e = r("l-image-preview");
|
|
128
|
-
e.setImages(this.previewImageList || [this.src]), e.setCurrentIndex(this.previewIndex || 0), e.setAttribute("open", "on"), this._previewEl = e, document.body.appendChild(e), c(this._previewEl, "closed", this._onPreviewClosed);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
closePreview() {
|
|
132
|
-
this._previewEl &&= (s(this._previewEl, "closed", this._onPreviewClosed), this._previewEl.remove(), void 0);
|
|
133
|
-
}
|
|
134
|
-
_onError = () => {
|
|
135
|
-
this.setIsError(!0);
|
|
136
|
-
};
|
|
137
|
-
_onLoad = () => {
|
|
138
|
-
this.setIsError(!1);
|
|
139
|
-
};
|
|
140
|
-
_onPreviewClosed = () => {
|
|
141
|
-
this.closePreview();
|
|
142
|
-
};
|
|
143
|
-
_onTap = (e) => {
|
|
144
|
-
let [t, n] = u(e, "l-action", this.root);
|
|
145
|
-
t && n === "inner" && !this.previewDisabled && !this.isError && this.openPreview();
|
|
146
|
-
};
|
|
147
|
-
_clearTmpImg(e) {
|
|
148
|
-
e &&= (e.onload = null, e.onerror = null, void 0);
|
|
149
|
-
}
|
|
150
|
-
_loadActualImage() {
|
|
151
|
-
if (this.placeholder && this.rendered) {
|
|
152
|
-
let e = new Image();
|
|
153
|
-
e.src = this.src, e.onload = () => {
|
|
154
|
-
this._imageInner && (this._imageInner.src = this.src), this._clearTmpImg(e);
|
|
155
|
-
}, e.onerror = () => {
|
|
156
|
-
this.setIsError(!0), this._clearTmpImg(e);
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
//#endregion
|
|
162
|
-
export { f as t };
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./mask-Bx-yNIJv.js";
|
|
2
|
-
import { $$ as t, $one as n, off as r, on as i } from "ph-utils/browser";
|
|
3
|
-
//#region src/components/image/image_preview.less?inline
|
|
4
|
-
var a = ".l-image-preview--container{justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:relative}.l-image-preview__btn,.l-image-preview-operations{background-color:#606666;justify-content:center;align-items:center;display:flex}.l-image-preview__btn{z-index:1;opacity:.8;cursor:pointer;color:#fff;background-color:#606666;border:none;border-radius:50%;outline:none;justify-content:center;align-items:center;width:40px;height:40px;font-size:20px;transition:color .3s ease-in-out;display:flex;position:absolute}.l-image-preview__btn:hover{color:var(--l-primary-color,#4998f6)}.l-image-preview__close{top:30px;right:30px}.l-image-preview__prev,.l-image-preview__next{top:50%;transform:translateY(-50%)}.l-image-preview__prev{left:30px}.l-image-preview__next{right:30px}.l-image-preview-footer{z-index:1;flex-direction:column;align-items:center;display:flex;position:absolute;bottom:30px;left:50%;transform:translate(-50%)}.l-image-preview-progress{color:#fff;margin-bottom:10px}.l-image-preview-operations{cursor:default;border-radius:20px;padding:0 25px}.l-image-preview-operations .l-image-preview__btn{width:40px;position:static}.l-image-preview-img{vertical-align:middle;transform-origin:50%;user-select:none;z-index:0;max-width:calc(100vw - 40px);max-height:calc(100vh - 200px);transition:transform .25s}", o = class extends e {
|
|
5
|
-
static baseName = "image-preview";
|
|
6
|
-
urlList = [];
|
|
7
|
-
currentIndex = 0;
|
|
8
|
-
_scale = 1;
|
|
9
|
-
_rotate = 0;
|
|
10
|
-
setImages(e) {
|
|
11
|
-
this.urlList = e;
|
|
12
|
-
}
|
|
13
|
-
setCurrentIndex(e) {
|
|
14
|
-
this.currentIndex = e;
|
|
15
|
-
}
|
|
16
|
-
static customAttributes = ["current-index"];
|
|
17
|
-
connectedCallback() {
|
|
18
|
-
this.loadStyleText(a), super.connectedCallback();
|
|
19
|
-
}
|
|
20
|
-
contentRender() {
|
|
21
|
-
let e = [this._generateBtnString("close", "close")];
|
|
22
|
-
this.urlList.length > 1 && (e.push(this._generateBtnString("prev", "arrow-left")), e.push(this._generateBtnString("next", "arrow-right"))), e.push("<div class=\"l-image-preview-footer\">"), e.push(`<div class="l-image-preview-progress">${this._getProgress()}</div>`), e.push("<div data-action=\"operations\" class=\"l-image-preview-operations\">"), e.push(this._generateBtnString("zoom-in", "zoom-in")), e.push(this._generateBtnString("zoom-out", "zoom-out")), e.push(this._generateBtnString("reduction", "reduction")), e.push(this._generateBtnString("refresh-left", "refresh-left")), e.push(this._generateBtnString("refresh-right", "refresh-right")), e.push("</div></div>");
|
|
23
|
-
let n = this.urlList[this.currentIndex], r = this._getTransformStyleValue();
|
|
24
|
-
return e.push(`<img src="${n}" data-action="previewer" class="l-image-preview-img" style="transform: ${r};" />`), t("div", {
|
|
25
|
-
class: "l-image-preview--container",
|
|
26
|
-
innerHTML: e.join("")
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
_generateBtnString(e, t) {
|
|
30
|
-
return `<button aria-label="${e}" data-action="${e}" class="l-image-preview__btn l-image-preview__${e}"><l-${t}-icon></l-${t}-icon></button>`;
|
|
31
|
-
}
|
|
32
|
-
_getProgress() {
|
|
33
|
-
return `${this.currentIndex + 1} / ${this.urlList.length}`;
|
|
34
|
-
}
|
|
35
|
-
_getTransformStyleValue() {
|
|
36
|
-
return `scale3d(${this._scale}, ${this._scale}, 1) rotate3d(0, 0, 1, ${this._rotate}deg)`;
|
|
37
|
-
}
|
|
38
|
-
_updateImgAttr() {
|
|
39
|
-
let e = n(".l-image-preview-img", this.root);
|
|
40
|
-
e && (e.src = this.urlList[this.currentIndex], e.style.transform = this._getTransformStyleValue());
|
|
41
|
-
}
|
|
42
|
-
_updateProgress() {
|
|
43
|
-
let e = n(".l-image-preview-progress", this.root);
|
|
44
|
-
e && (e.innerHTML = this._getProgress());
|
|
45
|
-
}
|
|
46
|
-
_resetTransform() {
|
|
47
|
-
this._scale = 1, this._rotate = 0, this._updateImgAttr();
|
|
48
|
-
}
|
|
49
|
-
onAction(e) {
|
|
50
|
-
switch (e) {
|
|
51
|
-
case "close":
|
|
52
|
-
this.open = !1;
|
|
53
|
-
break;
|
|
54
|
-
case "prev":
|
|
55
|
-
this.currentIndex === 0 ? this.currentIndex = this.urlList.length - 1 : this.currentIndex--, this._resetTransform(), this._updateProgress();
|
|
56
|
-
break;
|
|
57
|
-
case "next":
|
|
58
|
-
this.currentIndex === this.urlList.length - 1 ? this.currentIndex = 0 : this.currentIndex++, this._resetTransform(), this._updateProgress();
|
|
59
|
-
break;
|
|
60
|
-
case "zoom-in":
|
|
61
|
-
this._transformScale("in");
|
|
62
|
-
break;
|
|
63
|
-
case "zoom-out":
|
|
64
|
-
this._transformScale("out");
|
|
65
|
-
break;
|
|
66
|
-
case "reduction":
|
|
67
|
-
this._resetTransform();
|
|
68
|
-
break;
|
|
69
|
-
case "refresh-left":
|
|
70
|
-
this._rotate -= 90, this._updateImgAttr();
|
|
71
|
-
break;
|
|
72
|
-
case "refresh-right": this._rotate += 90, this._updateImgAttr();
|
|
73
|
-
}
|
|
74
|
-
return !0;
|
|
75
|
-
}
|
|
76
|
-
_handleWhell = (e) => {
|
|
77
|
-
e.deltaY > 0 ? this._transformScale("out") : this._transformScale("in");
|
|
78
|
-
};
|
|
79
|
-
afterOpened() {
|
|
80
|
-
i(document, "wheel", this._handleWhell, { passive: !0 });
|
|
81
|
-
}
|
|
82
|
-
_transformScale(e) {
|
|
83
|
-
e === "in" ? this._scale < 3 && (this._scale += .25) : this._scale > .25 && (this._scale -= .25), this._updateImgAttr();
|
|
84
|
-
}
|
|
85
|
-
afterClosed() {
|
|
86
|
-
r(document, "wheel", this._handleWhell);
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
//#endregion
|
|
90
|
-
export { o as t };
|
package/lib/item-CQ2Sknbz.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import e from "./base.js";
|
|
2
|
-
import { $$ as t } from "ph-utils/browser";
|
|
3
|
-
//#region src/components/carousel/item.less?inline
|
|
4
|
-
var n = ":host{width:var(--carousel-width,100%);box-sizing:border-box;height:100%;display:block}:host(.active){display:block}", r = class extends e {
|
|
5
|
-
static baseName = "carousel-item";
|
|
6
|
-
connectedCallback() {
|
|
7
|
-
this.loadStyleText(n), super.connectedCallback();
|
|
8
|
-
}
|
|
9
|
-
render() {
|
|
10
|
-
return t("slot");
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
export { r as t };
|
package/lib/item-DI6mQXtB.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import e from "./base.js";
|
|
2
|
-
import { kebabToCamel as t, parseAttrValue as n, stopSignal as r } from "./utils/index.js";
|
|
3
|
-
import { t as i } from "./esm-DAha108i.js";
|
|
4
|
-
import { $$ as a, $one as o, off as s, on as c, queryHideNodeSize as l } from "ph-utils/browser";
|
|
5
|
-
//#region src/components/collapse/item.less?inline
|
|
6
|
-
var u = ":host{box-sizing:border-box;border-bottom:1px solid var(--l-collapse-border-color);color:#333;font-size:14px;display:block}.l-collapse-item__header{cursor:pointer;justify-content:flex-start;align-items:center;gap:5px;padding:10px 0;display:flex}.l-collapse-item__header.arrow-right{flex-direction:row-reverse;justify-content:flex-end}.l-collapse-item__header.space-between{justify-content:space-between}.l-collapse-arrow-icon{transition:transform .3s;transform:rotate(0)}.l-collapse-content{box-sizing:border-box;transition:height .3s;overflow-y:hidden}.l-collapse-content-box{padding-bottom:15px}:host(.l-collapse-expand) .l-collapse-arrow-icon{transform:rotate(90deg)}:host(.background){border-left:1px solid var(--l-collapse-border-color);border-right:1px solid var(--l-collapse-border-color);background-color:#00000005}:host(.background:first-child),:host(.background.space){border-top:1px solid var(--l-collapse-border-color)}:host(.background) .l-collapse-item__header{padding:10px 15px}:host(.background) .l-collapse-content{border-top:1px solid var(--l-collapse-border-color);background:#fff}:host(.background) .l-collapse-content-box{padding:15px}:host(:first-child){border-top-left-radius:var(--l-collapse-border-radius,0px);border-top-right-radius:var(--l-collapse-border-radius,0px)}:host(:last-child){border-bottom-left-radius:var(--l-collapse-border-radius,0px);border-bottom-right-radius:var(--l-collapse-border-radius,0px)}:host(.space){border-radius:var(--l-collapse-border-radius,0px)}", d = class extends e {
|
|
7
|
-
static baseName = "collapse-item";
|
|
8
|
-
$header;
|
|
9
|
-
context;
|
|
10
|
-
_ctxStop;
|
|
11
|
-
_expandStop;
|
|
12
|
-
expands;
|
|
13
|
-
constructor() {
|
|
14
|
-
super(), this.version = 2, this._state = {
|
|
15
|
-
prop: "",
|
|
16
|
-
headerText: "",
|
|
17
|
-
expand: !1
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
updateDOM(e) {
|
|
21
|
-
e.has("expand") && (this._setStyleAndClass(), this._handleExpand());
|
|
22
|
-
}
|
|
23
|
-
_setStyleAndClass() {
|
|
24
|
-
this._state.expand ? this.classList.add("l-collapse-expand") : this.classList.remove("l-collapse-expand");
|
|
25
|
-
}
|
|
26
|
-
static get observedAttributes() {
|
|
27
|
-
return [
|
|
28
|
-
"prop",
|
|
29
|
-
"header-text",
|
|
30
|
-
"expand"
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
attributeChanged(e, r, i) {
|
|
34
|
-
switch (e) {
|
|
35
|
-
case "prop":
|
|
36
|
-
case "header-text":
|
|
37
|
-
this._state[t(e)] = i;
|
|
38
|
-
break;
|
|
39
|
-
case "expand":
|
|
40
|
-
let r = n(i, !1, "expand");
|
|
41
|
-
r !== this._state.expand && (this._state.expand = r);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
render_v2() {
|
|
45
|
-
this._state.expand && this._emitChange();
|
|
46
|
-
let e = document.createDocumentFragment(), t = a("div", {
|
|
47
|
-
class: "l-collapse-item__header",
|
|
48
|
-
part: "header"
|
|
49
|
-
}), n = a("l-arrow-right-icon", { class: "l-collapse-arrow-icon" });
|
|
50
|
-
if (t.appendChild(n), this._state.headerText) {
|
|
51
|
-
let e = a("span", {
|
|
52
|
-
part: "header-text",
|
|
53
|
-
textContent: `${this._state.headerText}`
|
|
54
|
-
});
|
|
55
|
-
t.appendChild(e);
|
|
56
|
-
} else t.appendChild(a("slot", { name: "header-text" }));
|
|
57
|
-
return e.appendChild(t), this._state.expand && e.appendChild(this._createContentElement(!1)), {
|
|
58
|
-
template: e,
|
|
59
|
-
style: u
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
afterInit() {
|
|
63
|
-
this._setStyleAndClass(), this.$header = o(".l-collapse-item__header", this.root), this.emitInject("collapse-context-request", this.contextInject), this._ctxStop = i(this._updateLayout), this._expandStop = i(this._handleExpandsChange), this.$header && c(this.$header, "click", this._handleHeaderTap);
|
|
64
|
-
}
|
|
65
|
-
beforeDestroy() {
|
|
66
|
-
this._ctxStop = r(this._ctxStop), this._expandStop = r(this._expandStop), this.$header && s(this.$header, "click", this._handleHeaderTap), this.$header = void 0;
|
|
67
|
-
}
|
|
68
|
-
_handleExpandsChange = () => {
|
|
69
|
-
this.expands && this.expands().includes(this._state.prop) !== this._state.expand && this._handleHeaderTap();
|
|
70
|
-
};
|
|
71
|
-
_handleHeaderTap = () => {
|
|
72
|
-
this._state.expand = !this._state.expand, this._setStyleAndClass(), this._handleExpand();
|
|
73
|
-
};
|
|
74
|
-
_updateLayout = () => {
|
|
75
|
-
if (!this.context) return;
|
|
76
|
-
let e = this.context();
|
|
77
|
-
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");
|
|
78
|
-
};
|
|
79
|
-
contextInject = (e, t) => {
|
|
80
|
-
this.context = e, this.expands = t;
|
|
81
|
-
};
|
|
82
|
-
_handleExpand() {
|
|
83
|
-
if (!this.rendered) return;
|
|
84
|
-
let e = o(".l-collapse-content", this.root), t = 0;
|
|
85
|
-
if (this._state.expand) {
|
|
86
|
-
this.classList.add("l-collapse-expand"), e || (e = this._createContentElement(!0), this.root.appendChild(e));
|
|
87
|
-
let n = l(e, null);
|
|
88
|
-
e.style.height = `${n.height}px`, e.style.display = "block", t = n.height;
|
|
89
|
-
} else this.classList.remove("l-collapse-expand"), e && (t = e.getBoundingClientRect().height);
|
|
90
|
-
if (e) {
|
|
91
|
-
let n = [{ height: "0px" }, { height: `${t}px` }];
|
|
92
|
-
this._state.expand || n.reverse();
|
|
93
|
-
let r = e.animate(n, { duration: 150 });
|
|
94
|
-
r.onfinish = () => {
|
|
95
|
-
this._state.expand || (e.style.display = "none"), r.onfinish = null, r = null;
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
this._emitChange();
|
|
99
|
-
}
|
|
100
|
-
_emitChange = () => {
|
|
101
|
-
this.emit("expand-change", { detail: {
|
|
102
|
-
prop: this._state.prop,
|
|
103
|
-
expand: this._state.expand
|
|
104
|
-
} });
|
|
105
|
-
};
|
|
106
|
-
_createContentElement(e = !0) {
|
|
107
|
-
return a("div", {
|
|
108
|
-
class: "l-collapse-content",
|
|
109
|
-
style: e ? "display: none;" : ""
|
|
110
|
-
}, [a("div", {
|
|
111
|
-
class: "l-collapse-content-box",
|
|
112
|
-
innerHTML: "<slot></slot>"
|
|
113
|
-
})]);
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
//#endregion
|
|
117
|
-
export { d as t };
|
package/lib/item-D_ZOPXuE.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import e from "./base.js";
|
|
2
|
-
import { parseAttrValue as t } from "./utils/index.js";
|
|
3
|
-
import { $$ as n, $one as r, addClass as i, removeClass as a } from "ph-utils/browser";
|
|
4
|
-
//#region src/components/tabbar/item.less?inline
|
|
5
|
-
var o = ":host{color:#666;cursor:pointer;flex-direction:column;flex-grow:var(--l-tabbar-item-grow,0);box-sizing:border-box;justify-content:center;align-items:center;line-height:1;transition:all .3s ease-in-out;display:inline-flex}:host(:hover){color:var(--l-tabbar-hover-color)}:host(.active){color:var(--l-tabbar-active-color)}.icon-wrapper{justify-content:center;align-items:center;margin-bottom:3px;font-size:18px;display:flex}.icon-wrapper.only{margin-bottom:0;font-size:24px}:host(.l-item--card){background:#f5f7fa;border:1px solid #f0f0f0;padding:0 15px}:host(.l-item--card:first-child){border-top-left-radius:var(--l-tabbar-card-border-radius)}:host(.l-item--card:last-child){border-top-right-radius:var(--l-tabbar-card-border-radius)}:host(.l-item--card.active){background:#fff}:host(.l-item--gap){border-top-left-radius:var(--l-tabbar-card-border-radius);border-top-right-radius:var(--l-tabbar-card-border-radius)}", s = class extends e {
|
|
6
|
-
static baseName = "tabbar-item";
|
|
7
|
-
name;
|
|
8
|
-
icon;
|
|
9
|
-
onlyIcon;
|
|
10
|
-
static get observedAttributes() {
|
|
11
|
-
return [
|
|
12
|
-
"name",
|
|
13
|
-
"label",
|
|
14
|
-
"icon",
|
|
15
|
-
"only-icon"
|
|
16
|
-
];
|
|
17
|
-
}
|
|
18
|
-
connectedCallback() {
|
|
19
|
-
this.loadStyleText(o);
|
|
20
|
-
let e = this.parentElement;
|
|
21
|
-
e.gap && i(this, "l-item--gap"), e.type === "card" && i(this, "l-item--card"), super.connectedCallback();
|
|
22
|
-
}
|
|
23
|
-
attributeChangedCallback(e, n, r) {
|
|
24
|
-
if (e === "icon" || e === "only-icon") {
|
|
25
|
-
let n = t(r, !1, "icon");
|
|
26
|
-
this[e] = n, this.#e();
|
|
27
|
-
} else this[e] = r;
|
|
28
|
-
}
|
|
29
|
-
#e() {
|
|
30
|
-
if (!this.rendered) return;
|
|
31
|
-
let e = r(".icon-wrapper", this.root);
|
|
32
|
-
this.icon ? e ? this.onlyIcon ? i(e, "only") : a(e, "only") : (e = n("div", {
|
|
33
|
-
class: ["icon-wrapper", this.onlyIcon ? "only" : ""],
|
|
34
|
-
innerHTML: "<slot name='icon'></slot>"
|
|
35
|
-
}), this.root.prepend(e)) : e && e.remove();
|
|
36
|
-
let t = r("slot:not([name])", this.root);
|
|
37
|
-
if (this.onlyIcon) t && t.remove();
|
|
38
|
-
else if (!t) {
|
|
39
|
-
let e = n("slot");
|
|
40
|
-
this.root.appendChild(e);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
render() {
|
|
44
|
-
let e = document.createDocumentFragment();
|
|
45
|
-
if (this.icon) {
|
|
46
|
-
let t = n("div", {
|
|
47
|
-
class: ["icon-wrapper", this.onlyIcon ? "only" : ""],
|
|
48
|
-
innerHTML: "<slot name='icon'></slot>"
|
|
49
|
-
});
|
|
50
|
-
e.appendChild(t);
|
|
51
|
-
}
|
|
52
|
-
if (!this.onlyIcon) {
|
|
53
|
-
let t = n("slot");
|
|
54
|
-
e.appendChild(t);
|
|
55
|
-
}
|
|
56
|
-
return e;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
//#endregion
|
|
60
|
-
export { s as t };
|
package/lib/list-MG8PRzos.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import e from "./base.js";
|
|
2
|
-
import { parseAttrValue as t } from "./utils/index.js";
|
|
3
|
-
import { t as n } from "./animation-Bo4jbSGK.js";
|
|
4
|
-
import { $one as r } from "ph-utils/browser";
|
|
5
|
-
//#region src/components/list/index.less?inline
|
|
6
|
-
var i = ":host{-webkit-overflow-scrolling:touch;height:100%;display:block;position:relative;overflow:auto}.l-list-loadmore{color:#999;justify-content:center;align-items:center;padding:10px;display:flex}.l-list-icon{margin-right:10px;font-size:24px;transform:rotate(80deg)}", a = class extends e {
|
|
7
|
-
static baseName = "list";
|
|
8
|
-
finish = !1;
|
|
9
|
-
infinite = !0;
|
|
10
|
-
observer;
|
|
11
|
-
$more;
|
|
12
|
-
_page = 0;
|
|
13
|
-
static get observedAttributes() {
|
|
14
|
-
return ["finish", "infinite"];
|
|
15
|
-
}
|
|
16
|
-
attributeChangedCallback(e, n, r) {
|
|
17
|
-
if (e === "finish") {
|
|
18
|
-
let n = t(r, !1, e);
|
|
19
|
-
this.finish !== n && (this.finish = n, this._finishChange());
|
|
20
|
-
} else if (e === "infinite") {
|
|
21
|
-
let n = t(r, !0, e);
|
|
22
|
-
this.infinite !== n && (this.infinite = n);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
connectedCallback() {
|
|
26
|
-
this.loadStyleText([i]), this.root.adoptedStyleSheets = [n], super.connectedCallback(), this.infinite && (this.observer = new IntersectionObserver((e) => {
|
|
27
|
-
e[0].isIntersecting && !this.finish && (this._page++, this.setAttribute("loading", ""), this.emit("load", { detail: { page: this._page } }));
|
|
28
|
-
}), this.$more = r(".l-list-loadmore", this.root), !this.finish && this.$more && this.observer.observe(this.$more));
|
|
29
|
-
}
|
|
30
|
-
disconnectedCallback() {
|
|
31
|
-
super.disconnectedCallback(), this.observer &&= (this.$more &&= (this.observer.unobserve(this.$more), void 0), this.observer.disconnect(), void 0);
|
|
32
|
-
}
|
|
33
|
-
render() {
|
|
34
|
-
let e = ["<slot></slot>"];
|
|
35
|
-
return this.infinite && (e.push("<div class=\"l-list-loadmore\">"), this.finish || e.push("<l-loading-icon class=\"l-list-icon l-rotate-anim\"></l-loading-icon>"), e.push(`<span class="l-list-loadmore-text">${this._loadingText()}</span></div>`)), e.join("");
|
|
36
|
-
}
|
|
37
|
-
_loadingText() {
|
|
38
|
-
return this.finish ? "已经到底啦!" : "加载中……";
|
|
39
|
-
}
|
|
40
|
-
_finishChange() {
|
|
41
|
-
if (this.$more) {
|
|
42
|
-
this.observer && (this.finish ? this.observer.unobserve(this.$more) : this.observer.observe(this.$more));
|
|
43
|
-
let e = r(".l-list-loadmore-text", this.$more);
|
|
44
|
-
e && (e.textContent = this._loadingText());
|
|
45
|
-
let t = r(".l-list-icon", this.$more);
|
|
46
|
-
this.finish ? t && t.remove() : t ?? (t = document.createElement("l-loading-icon"), t.className = "l-list-icon l-rotate-anim", this.$more.prepend(t));
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
//#endregion
|
|
51
|
-
export { a as t };
|