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/image/index.js
CHANGED
|
@@ -1,2 +1,163 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import e from "../base.js";
|
|
2
|
+
import { kebabToCamel as t, parseAttrValue as n } from "../utils/index.js";
|
|
3
|
+
import r from "./index.less_inline.js";
|
|
4
|
+
import { $$ as i, $one as a, addClass as o, formatClass as s, off as c, on as l, removeClass as u, shouldEventNext as d } from "utilane/browser";
|
|
5
|
+
//#region src/components/image/index.ts
|
|
6
|
+
var f = class extends e {
|
|
7
|
+
static baseName = "image";
|
|
8
|
+
alt;
|
|
9
|
+
_src = "";
|
|
10
|
+
_loading = "eager";
|
|
11
|
+
fit;
|
|
12
|
+
width;
|
|
13
|
+
height;
|
|
14
|
+
fallback;
|
|
15
|
+
customFallback = !1;
|
|
16
|
+
isError = !1;
|
|
17
|
+
previewDisabled = !1;
|
|
18
|
+
_previewEl;
|
|
19
|
+
_previewImageList;
|
|
20
|
+
_previewIndex = 0;
|
|
21
|
+
_placeholder;
|
|
22
|
+
_imageInner;
|
|
23
|
+
get src() {
|
|
24
|
+
return this._src;
|
|
25
|
+
}
|
|
26
|
+
set src(e) {
|
|
27
|
+
this._src = e, this._loadActualImage();
|
|
28
|
+
}
|
|
29
|
+
get loading() {
|
|
30
|
+
return this._loading;
|
|
31
|
+
}
|
|
32
|
+
set loading(e) {
|
|
33
|
+
this._loading = e;
|
|
34
|
+
}
|
|
35
|
+
get placeholder() {
|
|
36
|
+
return this._placeholder;
|
|
37
|
+
}
|
|
38
|
+
set placeholder(e) {
|
|
39
|
+
this._placeholder = e;
|
|
40
|
+
}
|
|
41
|
+
get previewImageList() {
|
|
42
|
+
return this._previewImageList;
|
|
43
|
+
}
|
|
44
|
+
set previewImageList(e) {
|
|
45
|
+
this.setPreviewImageList(e);
|
|
46
|
+
}
|
|
47
|
+
get previewIndex() {
|
|
48
|
+
return this._previewIndex;
|
|
49
|
+
}
|
|
50
|
+
set previewIndex(e) {
|
|
51
|
+
this.setPreviewIndex(e);
|
|
52
|
+
}
|
|
53
|
+
setPreviewImageList(e) {
|
|
54
|
+
this._previewImageList = e;
|
|
55
|
+
}
|
|
56
|
+
setPreviewIndex(e) {
|
|
57
|
+
this._previewIndex = e;
|
|
58
|
+
}
|
|
59
|
+
connectedCallback() {
|
|
60
|
+
this.loadStyleText(r), super.connectedCallback();
|
|
61
|
+
}
|
|
62
|
+
static get observedAttributes() {
|
|
63
|
+
return [
|
|
64
|
+
"src",
|
|
65
|
+
"loading",
|
|
66
|
+
"fit",
|
|
67
|
+
"width",
|
|
68
|
+
"height",
|
|
69
|
+
"placeholder",
|
|
70
|
+
"preview-disabled",
|
|
71
|
+
"preview-image-list",
|
|
72
|
+
"preview-index",
|
|
73
|
+
"fallback",
|
|
74
|
+
"custom-fallback"
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
attributeChangedCallback(e, r, i) {
|
|
78
|
+
e = t(e);
|
|
79
|
+
let a = n(i, this[e], e);
|
|
80
|
+
switch (a !== this[e] && (e === "previewImageList" ? this.setPreviewImageList(a ? a.split(",") : void 0) : this[e] = a), e) {
|
|
81
|
+
case "width":
|
|
82
|
+
case "height": this.rendered && this._updateSize();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
render() {
|
|
86
|
+
let e = this.alt || this.getAttribute("alt"), t = this.placeholder || this.src;
|
|
87
|
+
return i("img", {
|
|
88
|
+
class: s(["l-image-inner", this.previewDisabled ? void 0 : "l-image-inner--preview"]),
|
|
89
|
+
alt: e,
|
|
90
|
+
loading: this.loading,
|
|
91
|
+
src: t,
|
|
92
|
+
part: "inner",
|
|
93
|
+
"l-action": "inner"
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
_updateSize() {
|
|
97
|
+
this.width ? this.style.setProperty("width", this.width) : this.style.removeProperty("width"), this.height ? this.style.setProperty("height", this.height) : this.style.removeProperty("height");
|
|
98
|
+
}
|
|
99
|
+
afterInit() {
|
|
100
|
+
this.fit && this.fit !== "fill" && this.style.setProperty("--l-image-fit", this.fit), this._updateSize(), this._imageInner = a(".l-image-inner", this.root), l(this._imageInner, "click", this._onTap), l(this._imageInner, "error", this._onError), l(this._imageInner, "load", this._onLoad), this._loadActualImage();
|
|
101
|
+
}
|
|
102
|
+
beforeDestroy() {
|
|
103
|
+
this._imageInner && (c(this._imageInner, "click", this._onTap), c(this._imageInner, "error", this._onError), c(this._imageInner, "load", this._onLoad));
|
|
104
|
+
}
|
|
105
|
+
setIsError(e = !1) {
|
|
106
|
+
if (this.isError !== e) {
|
|
107
|
+
if (this.isError = e, e) {
|
|
108
|
+
if (!this.customFallback) {
|
|
109
|
+
this.fallback && this._imageInner && (this._imageInner.src = this.fallback);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this._imageInner && o(this._imageInner, "l-image-hide");
|
|
113
|
+
let e = a(".l-image-fallback", this.root);
|
|
114
|
+
this.fallback || (e = i("div", {
|
|
115
|
+
class: "l-image-fallback",
|
|
116
|
+
part: "fallback",
|
|
117
|
+
innerHTML: "<slot name='fallback'></slot>"
|
|
118
|
+
}), this.root.appendChild(e));
|
|
119
|
+
} else {
|
|
120
|
+
this._imageInner && u(this._imageInner, "l-image-hide");
|
|
121
|
+
let e = a(".l-image-fallback", this.root);
|
|
122
|
+
e && e.remove();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
openPreview() {
|
|
127
|
+
if (!this._previewEl) {
|
|
128
|
+
let e = i("l-image-preview");
|
|
129
|
+
e.setImages(this.previewImageList || [this.src]), e.setCurrentIndex(this.previewIndex || 0), e.setAttribute("open", "on"), this._previewEl = e, document.body.appendChild(e), l(this._previewEl, "closed", this._onPreviewClosed);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
closePreview() {
|
|
133
|
+
this._previewEl &&= (c(this._previewEl, "closed", this._onPreviewClosed), this._previewEl.remove(), void 0);
|
|
134
|
+
}
|
|
135
|
+
_onError = () => {
|
|
136
|
+
this.setIsError(!0);
|
|
137
|
+
};
|
|
138
|
+
_onLoad = () => {
|
|
139
|
+
this.setIsError(!1);
|
|
140
|
+
};
|
|
141
|
+
_onPreviewClosed = () => {
|
|
142
|
+
this.closePreview();
|
|
143
|
+
};
|
|
144
|
+
_onTap = (e) => {
|
|
145
|
+
let [t, n] = d(e, "l-action", this.root);
|
|
146
|
+
t && n === "inner" && !this.previewDisabled && !this.isError && this.openPreview();
|
|
147
|
+
};
|
|
148
|
+
_clearTmpImg(e) {
|
|
149
|
+
e &&= (e.onload = null, e.onerror = null, void 0);
|
|
150
|
+
}
|
|
151
|
+
_loadActualImage() {
|
|
152
|
+
if (this.placeholder && this.rendered) {
|
|
153
|
+
let e = new Image();
|
|
154
|
+
e.src = this.src, e.onload = () => {
|
|
155
|
+
this._imageInner && (this._imageInner.src = this.src), this._clearTmpImg(e);
|
|
156
|
+
}, e.onerror = () => {
|
|
157
|
+
this.setIsError(!0), this._clearTmpImg(e);
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
//#endregion
|
|
163
|
+
export { f as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/components/image/index.less?inline
|
|
2
|
+
var e = ":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}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./utils";
|
|
2
|
+
export type { Signal, SignalStop } from "./utils/signal_types";
|
|
2
3
|
export { set as addClickOutside, remove as removeClickOutside } from "./utils/clickoutside";
|
|
3
4
|
export { default as BaseComponent } from "./base";
|
|
4
5
|
export { default as Message } from "./message";
|
|
@@ -40,6 +41,11 @@ export { default as SelectIcon } from "./icon/select";
|
|
|
40
41
|
export { default as CalendarIcon } from "./icon/calendar";
|
|
41
42
|
export { default as RefreshIcon } from "./icon/refresh";
|
|
42
43
|
export { default as CopyIcon } from "./icon/copy";
|
|
44
|
+
export { default as PlusIcon } from "./icon/plus";
|
|
45
|
+
export { default as MinusIcon } from "./icon/minus";
|
|
46
|
+
export { default as EyeOutlineIcon } from "./icon/eye_outline";
|
|
47
|
+
export { default as DeleteIcon } from "./icon/delete";
|
|
48
|
+
export { default as PictureIcon } from "./icon/picture";
|
|
43
49
|
export { default as Form } from "./form";
|
|
44
50
|
export { default as FormItem } from "./form/form_item";
|
|
45
51
|
export { default as RadioGroup } from "./check/radio_group";
|
|
@@ -81,3 +87,8 @@ export type { Column } from "./table/types";
|
|
|
81
87
|
export { default as Space } from "./space";
|
|
82
88
|
export { default as Card } from "./card";
|
|
83
89
|
export { default as Calendar } from "./calendar";
|
|
90
|
+
export { default as Upload } from "./upload";
|
|
91
|
+
export { defaultUploadResponseParser } from "./upload";
|
|
92
|
+
export type { UploadFile, UploadResponseContext, UploadResponseParser, UploadRequestOptions, UploadRequestResult, UploadRequestHandler, } from "./upload";
|
|
93
|
+
export { default as Notification } from "./notification";
|
|
94
|
+
export type { NotificationOptions, NotificationType, NotificationPlacement } from "./notification";
|
package/lib/index.js
CHANGED
|
@@ -11,12 +11,12 @@ import y from "./dialog/index.js";
|
|
|
11
11
|
import b from "./dialog/dialog_container.js";
|
|
12
12
|
import x from "./button/index.js";
|
|
13
13
|
import S from "./icon/close.js";
|
|
14
|
-
import
|
|
14
|
+
import C from "./form/form_item.js";
|
|
15
15
|
import w from "./input/index.js";
|
|
16
16
|
import T from "./dialog/dialog_box.js";
|
|
17
17
|
import E from "./loading/index.js";
|
|
18
18
|
import D from "./tabs/index.js";
|
|
19
|
-
import
|
|
19
|
+
import O from "./modal/index.js";
|
|
20
20
|
import k from "./modal/modal_box.js";
|
|
21
21
|
import A from "./icon/arrow_down.js";
|
|
22
22
|
import j from "./icon/arrow_left.js";
|
|
@@ -43,41 +43,48 @@ import Z from "./icon/select.js";
|
|
|
43
43
|
import Q from "./icon/calendar.js";
|
|
44
44
|
import $ from "./icon/refresh.js";
|
|
45
45
|
import ee from "./icon/copy.js";
|
|
46
|
-
import
|
|
47
|
-
import ne from "./
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import ae from "./
|
|
51
|
-
import oe from "./
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
import
|
|
60
|
-
import {
|
|
61
|
-
import
|
|
62
|
-
import
|
|
63
|
-
import
|
|
64
|
-
import
|
|
65
|
-
import Te from "./
|
|
66
|
-
import
|
|
67
|
-
import
|
|
68
|
-
import
|
|
69
|
-
import
|
|
70
|
-
import
|
|
71
|
-
import
|
|
72
|
-
import
|
|
73
|
-
import
|
|
74
|
-
import
|
|
75
|
-
import
|
|
76
|
-
import
|
|
77
|
-
import
|
|
78
|
-
import
|
|
79
|
-
import
|
|
80
|
-
import
|
|
81
|
-
import
|
|
82
|
-
import
|
|
83
|
-
|
|
46
|
+
import te from "./icon/plus.js";
|
|
47
|
+
import ne from "./icon/minus.js";
|
|
48
|
+
import re from "./icon/eye_outline.js";
|
|
49
|
+
import ie from "./icon/delete.js";
|
|
50
|
+
import ae from "./icon/picture.js";
|
|
51
|
+
import oe from "./form/index.js";
|
|
52
|
+
import se from "./check/radio_group.js";
|
|
53
|
+
import ce from "./check/radio.js";
|
|
54
|
+
import le from "./check/checkbox.js";
|
|
55
|
+
import ue from "./check/checkbox_group.js";
|
|
56
|
+
import de from "./input_number/index.js";
|
|
57
|
+
import fe from "./select_ori/index.js";
|
|
58
|
+
import pe from "./switch/index.js";
|
|
59
|
+
import me from "./md_input/index.js";
|
|
60
|
+
import { Popover as he, autoUpdate as ge, createPopoverObserver as _e, getOverflowAncestors as ve, popconfirmProps as ye, updatePosition as be } from "./utils/popover.js";
|
|
61
|
+
import xe from "./select/index.js";
|
|
62
|
+
import Se from "./date_picker/index.js";
|
|
63
|
+
import Ce from "./date_picker_ori/index.js";
|
|
64
|
+
import we from "./color_picker/index.js";
|
|
65
|
+
import Te from "./list/index.js";
|
|
66
|
+
import Ee from "./polygon/index.js";
|
|
67
|
+
import De from "./tabbar/index.js";
|
|
68
|
+
import Oe from "./tabbar/item.js";
|
|
69
|
+
import ke from "./theme/index.js";
|
|
70
|
+
import Ae from "./theme/theme_color.js";
|
|
71
|
+
import je from "./menu/index.js";
|
|
72
|
+
import Me from "./carousel/index.js";
|
|
73
|
+
import Ne from "./carousel/item.js";
|
|
74
|
+
import Pe from "./qrcode/index.js";
|
|
75
|
+
import Fe from "./description_panel/index.js";
|
|
76
|
+
import Ie from "./pagination/index.js";
|
|
77
|
+
import Le from "./mask/index.js";
|
|
78
|
+
import Re from "./page_header/index.js";
|
|
79
|
+
import ze from "./tag/index.js";
|
|
80
|
+
import Be from "./collapse/index.js";
|
|
81
|
+
import Ve from "./collapse/item.js";
|
|
82
|
+
import He from "./image/index.js";
|
|
83
|
+
import Ue from "./image/image_preview.js";
|
|
84
|
+
import We from "./table/index.js";
|
|
85
|
+
import Ge from "./space/index.js";
|
|
86
|
+
import Ke from "./card/index.js";
|
|
87
|
+
import qe from "./calendar/index.js";
|
|
88
|
+
import Je, { defaultUploadResponseParser as Ye } from "./upload/index.js";
|
|
89
|
+
import Xe from "./notification/index.js";
|
|
90
|
+
export { A as ArrowDownIcon, j as ArrowLeftIcon, M as ArrowRightIcon, N as ArrowUpIcon, e as BaseComponent, p as BaseIcon, x as Button, qe as Calendar, Q as CalendarIcon, Ke as Card, F as CaretBottomIcon, P as CaretTopIcon, Me as Carousel, Ne as CarouselItem, le as Checkbox, ue as CheckboxGroup, m as CloseFilledIcon, S as CloseIcon, Be as Collapse, Ve as CollapseItem, we as ColorPicker, ee as CopyIcon, q as DArrowLeftIcon, J as DArrowRightIcon, Se as DatePicker, Ce as DatePickerOri, ie as DeleteIcon, Fe as DescriptionPanel, y as Dialog, T as DialogBox, b as DialogContainer, re as EyeOutlineIcon, I as FontIcon, oe as Form, C as FormItem, He as Image, Ue as ImagePreview, _ as InfoIcon, w as Input, de as InputNumber, Te as List, E as Loading, L as LoadingIcon, Le as Mask, me as MdInput, je as Menu, v as Message, ne as MinusIcon, O as Modal, k as ModalBox, B as MoonIcon, K as MoreIcon, Xe as Notification, Re as PageHeader, Ie as Pagination, ae as PictureIcon, te as PlusIcon, Ee as Polygon, he as Popover, Pe as Qrcode, ce as Radio, se as RadioGroup, V as ReductionIcon, $ as RefreshIcon, H as RefreshLeftIcon, U as RefreshRightIcon, R as SearchIcon, xe as Select, Z as SelectIcon, fe as SelectOri, W as SortIcon, Ge as Space, h as SuccessIcon, z as SunIcon, pe as Switch, De as Tabbar, Oe as TabbarItem, We as Table, D as Tabs, ze as Tag, ke as Theme, Ae as ThemeColor, G as ThemeDefaultIcon, Je as Upload, g as WarnIcon, Y as ZoomInIcon, X as ZoomOutIcon, f as addClickOutside, ge as autoUpdate, _e as createPopoverObserver, Ye as defaultUploadResponseParser, ve as getOverflowAncestors, t as initAttr, n as kebabToCamel, r as parseAttrValue, ye as popconfirmProps, i as regist, d as removeClickOutside, a as setAttrs, o as stopSignal, s as tagAttr, c as tagAttrs, l as unitNumberStr, be as updatePosition, u as useId };
|
package/lib/input/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { parseAttrValue as e, unitNumberStr as t } from "../utils/index.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { $ as a, $$ as o, $one as s, addClass as c, formatStyle as l, off as u, on as d, removeClass as f } from "
|
|
2
|
+
import n from "../form/form_inner.js";
|
|
3
|
+
import r from "./index.less_inline.js";
|
|
4
|
+
import i from "./input_inner.less_inline.js";
|
|
5
|
+
import { $ as a, $$ as o, $one as s, addClass as c, formatStyle as l, off as u, on as d, removeClass as f } from "utilane/browser";
|
|
6
6
|
//#region src/components/input/index.ts
|
|
7
7
|
var p = class extends n {
|
|
8
8
|
static baseName = "input";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region src/components/input/index.less?inline
|
|
2
2
|
var e = ":host{--l-input-border-color:var(--l-border-color,#dedede);width:var(--l-input-width,170px);height:var(--l-form-control-height,32px);border:1px solid var(--l-input-border-color,#dedede);border-radius:var(--l-border-radius,3px);vertical-align:middle;box-sizing:border-box;background-color:#0000;align-items:center;padding:0 7px;transition:border-color .3s,box-shadow .3s;display:inline-flex}:host(:focus){--l-input-border-color:var(--l-primary-color,#722ed1);box-shadow:0 0 0 3px var(--l-primary-color-light5)}:host(.is-block){width:100%}:host(.is-disabled){background-color:var(--l-disabled-color,#f5f7fa)}:host(.is-error){--l-input-border-color:var(--l-error-color)}:host(.is-error:focus){box-shadow:0 0 0 3px var(--l-error-color-light5)}.l-input__prefix,.l-input__suffix{color:#a8abb2;flex-shrink:0;font-size:14px;display:inline-flex}.l-input__prefix{margin-right:5px}.l-input__suffix{margin-left:5px}.l-clearable{cursor:pointer}.l-clearable:hover{color:#999}";
|
|
3
3
|
//#endregion
|
|
4
|
-
export { e as
|
|
4
|
+
export { e as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region src/components/input/input_inner.less?inline
|
|
2
2
|
var e = ".l-input__inner{box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:inherit;font-size:inherit;background-color:#0000;border:none;outline:none;flex-grow:1}.l-input__inner:disabled{background-color:#0000}";
|
|
3
3
|
//#endregion
|
|
4
|
-
export { e as
|
|
4
|
+
export { e as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseAttrValue as e, unitNumberStr as t } from "../utils/index.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { $$ as i, $one as a, addClass as o, off as s, on as c, removeClass as l } from "
|
|
2
|
+
import n from "../form/form_inner.js";
|
|
3
|
+
import r from "./style.js";
|
|
4
|
+
import { $$ as i, $one as a, addClass as o, off as s, on as c, removeClass as l } from "utilane/browser";
|
|
5
5
|
//#region src/components/input_number/index.ts
|
|
6
6
|
var u = class extends n {
|
|
7
7
|
static baseName = "input-number";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/components/input_number/index.less?inline
|
|
2
|
-
var e = ":host{--l-input-number-border-color:var(--l-border-color,#d9d9d9);--l-input-number-btn-color:#606266;--l-input-number-btn-hover-color:var(--l-primary-color,#722ed1);--l-input-number-btn-disabled-color:#c0c4cc;--l-input-number-bg:#fff;--l-input-number-btn-bg:#f5f7fa;--l-input-number-btn-hover-bg:var(--l-primary-color-light5,#f3e8ff);--l-input-number-width:170px;width:var(--l-input-number-width);height:var(--l-form-control-height,32px);border:1px solid var(--l-input-number-border-color);border-radius:var(--l-border-radius,3px);box-sizing:border-box;vertical-align:middle;background-color:var(--l-input-number-bg);align-items:center;transition:border-color .3s,box-shadow .3s;display:inline-flex;overflow:hidden}:host(:focus-within){--l-input-number-border-color:var(--l-primary-color,#722ed1);box-shadow:0 0 0 3px var(--l-primary-color-light5)}:host(.is-block){width:100%}:host(.is-disabled){background-color:var(--l-disabled-color,#f5f7fa);cursor:not-allowed}:host(.is-disabled) .l-input-number__btn{color:var(--l-input-number-btn-disabled-color);cursor:not-allowed}:host(.is-disabled) .l-input-number__btn:hover{background-color:var(--l-input-number-btn-bg)}:host(.is-error){--l-input-number-border-color:var(--l-error-color)}:host(.is-error:focus-within){box-shadow:0 0 0 3px var(--l-error-color-light5)}:host(.l-input-number--small){--l-form-control-height:24px;font-size:12px}:host(.l-input-number--large){--l-form-control-height:40px;--l-border-radius:6px;font-size:16px}.l-input-number__btn{background:var(--l-input-number-btn-bg);width:32px;height:100%;color:var(--l-input-number-btn-color);cursor:pointer;-webkit-user-select:none;user-select:none;font-size:inherit;border:none;outline:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;transition:background-color .25s,color .25s;display:inline-flex}.l-input-number__btn:hover:not(:disabled){background:var(--l-input-number-btn-hover-bg);color:var(--l-input-number-btn-hover-color)}.l-input-number__btn:active:not(:disabled){background:var(--l-primary-color-light4,#e2d3fa);color:var(--l-primary-color-dark1,#531dab)}.l-input-number__btn:disabled{color:var(--l-input-number-btn-disabled-color);cursor:not-allowed}:host(.l-input-number--no-controls) .l-input-number__inner{text-align:left}.l-input-number__inner{text-align:center;width:100%;height:100%;font-size:inherit;color:var(--l-input-number-btn-color);box-sizing:border-box;-moz-appearance:textfield;background:0 0;border:none;outline:none;flex:1;padding:0 8px}.l-input-number__inner::-webkit-outer-spin-button,.l-input-number__inner::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.l-input-number__inner::placeholder{color:#c0c4cc}html.dark :host{--l-input-number-bg:#ffffff0f;--l-input-number-btn-bg:#ffffff14;--l-input-number-btn-color:#ffffffa6;--l-input-number-btn-hover-bg:var(--l-primary-color-light5);--l-input-number-btn-disabled-color:#ffffff40}html.dark :host(.is-disabled){background-color:#ffffff14}html.dark .l-input-number__inner::placeholder{color:#ffffff4d}"
|
|
3
|
-
t.replaceSync(e);
|
|
2
|
+
var e = ":host{--l-input-number-border-color:var(--l-border-color,#d9d9d9);--l-input-number-btn-color:#606266;--l-input-number-btn-hover-color:var(--l-primary-color,#722ed1);--l-input-number-btn-disabled-color:#c0c4cc;--l-input-number-bg:#fff;--l-input-number-btn-bg:#f5f7fa;--l-input-number-btn-hover-bg:var(--l-primary-color-light5,#f3e8ff);--l-input-number-width:170px;width:var(--l-input-number-width);height:var(--l-form-control-height,32px);border:1px solid var(--l-input-number-border-color);border-radius:var(--l-border-radius,3px);box-sizing:border-box;vertical-align:middle;background-color:var(--l-input-number-bg);align-items:center;transition:border-color .3s,box-shadow .3s;display:inline-flex;overflow:hidden}:host(:focus-within){--l-input-number-border-color:var(--l-primary-color,#722ed1);box-shadow:0 0 0 3px var(--l-primary-color-light5)}:host(.is-block){width:100%}:host(.is-disabled){background-color:var(--l-disabled-color,#f5f7fa);cursor:not-allowed}:host(.is-disabled) .l-input-number__btn{color:var(--l-input-number-btn-disabled-color);cursor:not-allowed}:host(.is-disabled) .l-input-number__btn:hover{background-color:var(--l-input-number-btn-bg)}:host(.is-error){--l-input-number-border-color:var(--l-error-color)}:host(.is-error:focus-within){box-shadow:0 0 0 3px var(--l-error-color-light5)}:host(.l-input-number--small){--l-form-control-height:24px;font-size:12px}:host(.l-input-number--large){--l-form-control-height:40px;--l-border-radius:6px;font-size:16px}.l-input-number__btn{background:var(--l-input-number-btn-bg);width:32px;height:100%;color:var(--l-input-number-btn-color);cursor:pointer;-webkit-user-select:none;user-select:none;font-size:inherit;border:none;outline:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;transition:background-color .25s,color .25s;display:inline-flex}.l-input-number__btn:hover:not(:disabled){background:var(--l-input-number-btn-hover-bg);color:var(--l-input-number-btn-hover-color)}.l-input-number__btn:active:not(:disabled){background:var(--l-primary-color-light4,#e2d3fa);color:var(--l-primary-color-dark1,#531dab)}.l-input-number__btn:disabled{color:var(--l-input-number-btn-disabled-color);cursor:not-allowed}:host(.l-input-number--no-controls) .l-input-number__inner{text-align:left}.l-input-number__inner{text-align:center;width:100%;height:100%;font-size:inherit;color:var(--l-input-number-btn-color);box-sizing:border-box;-moz-appearance:textfield;background:0 0;border:none;outline:none;flex:1;padding:0 8px}.l-input-number__inner::-webkit-outer-spin-button,.l-input-number__inner::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.l-input-number__inner::placeholder{color:#c0c4cc}html.dark :host{--l-input-number-bg:#ffffff0f;--l-input-number-btn-bg:#ffffff14;--l-input-number-btn-color:#ffffffa6;--l-input-number-btn-hover-bg:var(--l-primary-color-light5);--l-input-number-btn-disabled-color:#ffffff40}html.dark :host(.is-disabled){background-color:#ffffff14}html.dark .l-input-number__inner::placeholder{color:#ffffff4d}";
|
|
4
3
|
//#endregion
|
|
5
|
-
export {
|
|
4
|
+
export { e as default };
|
package/lib/list/index.js
CHANGED
|
@@ -1,2 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import e from "../base.js";
|
|
2
|
+
import { parseAttrValue as t } from "../utils/index.js";
|
|
3
|
+
import n from "../styles/animation/index.js";
|
|
4
|
+
import r from "./index.less_inline.js";
|
|
5
|
+
import { $one as i } from "utilane/browser";
|
|
6
|
+
//#region src/components/list/index.ts
|
|
7
|
+
var a = class extends e {
|
|
8
|
+
static baseName = "list";
|
|
9
|
+
finish = !1;
|
|
10
|
+
infinite = !0;
|
|
11
|
+
observer;
|
|
12
|
+
$more;
|
|
13
|
+
_page = 0;
|
|
14
|
+
static get observedAttributes() {
|
|
15
|
+
return ["finish", "infinite"];
|
|
16
|
+
}
|
|
17
|
+
attributeChangedCallback(e, n, r) {
|
|
18
|
+
if (e === "finish") {
|
|
19
|
+
let n = t(r, !1, e);
|
|
20
|
+
this.finish !== n && (this.finish = n, this._finishChange());
|
|
21
|
+
} else if (e === "infinite") {
|
|
22
|
+
let n = t(r, !0, e);
|
|
23
|
+
this.infinite !== n && (this.infinite = n);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
connectedCallback() {
|
|
27
|
+
this.loadStyleText([r]), this.root.adoptedStyleSheets = [n], super.connectedCallback(), this.infinite && (this.observer = new IntersectionObserver((e) => {
|
|
28
|
+
e[0].isIntersecting && !this.finish && (this._page++, this.setAttribute("loading", ""), this.emit("load", { detail: { page: this._page } }));
|
|
29
|
+
}), this.$more = i(".l-list-loadmore", this.root), !this.finish && this.$more && this.observer.observe(this.$more));
|
|
30
|
+
}
|
|
31
|
+
disconnectedCallback() {
|
|
32
|
+
super.disconnectedCallback(), this.observer &&= (this.$more &&= (this.observer.unobserve(this.$more), void 0), this.observer.disconnect(), void 0);
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
let e = ["<slot></slot>"];
|
|
36
|
+
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("");
|
|
37
|
+
}
|
|
38
|
+
_loadingText() {
|
|
39
|
+
return this.finish ? "已经到底啦!" : "加载中……";
|
|
40
|
+
}
|
|
41
|
+
_finishChange() {
|
|
42
|
+
if (this.$more) {
|
|
43
|
+
this.observer && (this.finish ? this.observer.unobserve(this.$more) : this.observer.observe(this.$more));
|
|
44
|
+
let e = i(".l-list-loadmore-text", this.$more);
|
|
45
|
+
e && (e.textContent = this._loadingText());
|
|
46
|
+
let t = i(".l-list-icon", this.$more);
|
|
47
|
+
this.finish ? t && t.remove() : t ?? (t = document.createElement("l-loading-icon"), t.className = "l-list-icon l-rotate-anim", this.$more.prepend(t));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { a as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/components/list/index.less?inline
|
|
2
|
+
var e = ":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)}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
package/lib/loading/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as e, $$ as t, $one as n, addClass as r, hasClass as i, iterate as a } from "
|
|
1
|
+
import { $ as e, $$ as t, $one as n, addClass as r, hasClass as i, iterate as a } from "utilane/browser";
|
|
2
2
|
//#region src/components/loading/index.ts
|
|
3
3
|
function o(e, a) {
|
|
4
4
|
if (i(e, "l-loading")) return;
|
package/lib/mask/index.d.ts
CHANGED
package/lib/mask/index.js
CHANGED
|
@@ -1,2 +1,109 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import e from "../base.js";
|
|
2
|
+
import { kebabToCamel as t, parseAttrValue as n } from "../utils/index.js";
|
|
3
|
+
import r from "./index.less_inline.js";
|
|
4
|
+
import { $$ as i, $one as a, addClass as o, hasClass as s, off as c, on as l, removeClass as u, shouldEventNext as d, transition as f } from "utilane/browser";
|
|
5
|
+
//#region src/components/mask/index.ts
|
|
6
|
+
var p = class extends e {
|
|
7
|
+
static baseName = "mask";
|
|
8
|
+
#e = !1;
|
|
9
|
+
zIndex = 100;
|
|
10
|
+
maskClosable = !0;
|
|
11
|
+
lockScroll = !0;
|
|
12
|
+
#t = "";
|
|
13
|
+
get open() {
|
|
14
|
+
return this.#e;
|
|
15
|
+
}
|
|
16
|
+
set open(e) {
|
|
17
|
+
this.#e = e, this.rendered && this.#n();
|
|
18
|
+
}
|
|
19
|
+
static customAttributes = [];
|
|
20
|
+
static get observedAttributes() {
|
|
21
|
+
return [
|
|
22
|
+
"open",
|
|
23
|
+
"z-index",
|
|
24
|
+
"mask-closable",
|
|
25
|
+
"lock-scroll",
|
|
26
|
+
...this.customAttributes
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
connectedCallback() {
|
|
30
|
+
this.loadStyleText(r), super.connectedCallback();
|
|
31
|
+
}
|
|
32
|
+
attributeChangedCallback(e, r, i) {
|
|
33
|
+
e = t(e);
|
|
34
|
+
let a = n(i, this[e], e);
|
|
35
|
+
a !== this[e] && (this[e] = a, e === "zIndex") && (a === 100 ? this.style.removeProperty("--l-mask-zindex") : this.style.setProperty("--l-mask-zindex", a));
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
let e = document.createDocumentFragment(), t = i("div", {
|
|
39
|
+
class: "l-mask",
|
|
40
|
+
part: "mask"
|
|
41
|
+
});
|
|
42
|
+
e.appendChild(t);
|
|
43
|
+
let n = i("div", {
|
|
44
|
+
class: "l-panel",
|
|
45
|
+
part: "panel"
|
|
46
|
+
}), r = this.contentRender();
|
|
47
|
+
return typeof r == "string" ? n.innerHTML = r : n.appendChild(r), e.appendChild(n), e;
|
|
48
|
+
}
|
|
49
|
+
contentRender() {
|
|
50
|
+
return "<slot></slot>";
|
|
51
|
+
}
|
|
52
|
+
#n() {
|
|
53
|
+
if (this.open) {
|
|
54
|
+
this.lockScroll && (this.#t = getComputedStyle(document.body).overflow, document.body.style.overflow = "hidden"), o(this, "open");
|
|
55
|
+
let e = a(".l-mask", this.root);
|
|
56
|
+
e && f(e, [[
|
|
57
|
+
"opacity",
|
|
58
|
+
"0",
|
|
59
|
+
"0.3s"
|
|
60
|
+
]], "enter");
|
|
61
|
+
let t = a(".l-panel", this.root);
|
|
62
|
+
t && f(t, [[
|
|
63
|
+
"opacity",
|
|
64
|
+
"0",
|
|
65
|
+
"0.3s"
|
|
66
|
+
]], "enter"), this.afterOpened();
|
|
67
|
+
} else if (s(this, "open")) {
|
|
68
|
+
this.emit("close");
|
|
69
|
+
let e = a(".l-panel", this.root);
|
|
70
|
+
e && f(e, [[
|
|
71
|
+
"opacity",
|
|
72
|
+
"0",
|
|
73
|
+
"0.3s"
|
|
74
|
+
]], "leave");
|
|
75
|
+
let t = a(".l-mask", this.root);
|
|
76
|
+
t && f(t, [[
|
|
77
|
+
"opacity",
|
|
78
|
+
"0",
|
|
79
|
+
"0.3s"
|
|
80
|
+
]], "leave", () => {
|
|
81
|
+
u(this, "open"), this.emit("closed");
|
|
82
|
+
}), this.lockScroll && (document.body.style.overflow = this.#t), this.afterClosed();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
afterInit() {
|
|
86
|
+
this.#n();
|
|
87
|
+
let e = a(".l-panel", this.root);
|
|
88
|
+
e && l(e, "click", this.#r);
|
|
89
|
+
}
|
|
90
|
+
beforeDestroy() {
|
|
91
|
+
let e = a(".l-panel", this.root);
|
|
92
|
+
e && c(e, "click", this.#r);
|
|
93
|
+
}
|
|
94
|
+
#r = (e) => {
|
|
95
|
+
let [t, n] = d(e, "data-action", e.currentTarget);
|
|
96
|
+
if (!t) {
|
|
97
|
+
this.maskClosable && (this.open = !1);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
this.onAction(n) || this.emit("action", { detail: n });
|
|
101
|
+
};
|
|
102
|
+
afterOpened() {}
|
|
103
|
+
afterClosed() {}
|
|
104
|
+
onAction(e) {
|
|
105
|
+
return !1;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
//#endregion
|
|
109
|
+
export { p as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/components/mask/index.less?inline
|
|
2
|
+
var e = ":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}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
package/lib/md_input/index.js
CHANGED
|
@@ -1,2 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { initAttr as e } from "../utils/index.js";
|
|
2
|
+
import t from "../form/form_inner.js";
|
|
3
|
+
import n from "./index.less_inline.js";
|
|
4
|
+
import { $$ as r, $one as i, addClass as a, off as o, on as s, removeClass as c } from "utilane/browser";
|
|
5
|
+
import { isBlank as l, random as u } from "utilane";
|
|
6
|
+
//#region src/components/md_input/index.ts
|
|
7
|
+
var d = class extends t {
|
|
8
|
+
static baseName = "md-input";
|
|
9
|
+
outline = !1;
|
|
10
|
+
htmlType = "text";
|
|
11
|
+
inputmode;
|
|
12
|
+
label;
|
|
13
|
+
static get observedAttributes() {
|
|
14
|
+
return ["disabled"];
|
|
15
|
+
}
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
e(this), this.loadStyleText(n), super.connectedCallback(), this.#e();
|
|
18
|
+
}
|
|
19
|
+
disconnectedCallback() {
|
|
20
|
+
super.disconnectedCallback(), this.#t();
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
l(this.value) || a(this, "l-has-value"), this.outline && a(this, "l-md-input-outline");
|
|
24
|
+
let e = document.createDocumentFragment(), t = `l-md-input-${u(8)}`, n = r("input", {
|
|
25
|
+
class: "l-md-input__inner",
|
|
26
|
+
type: this.htmlType,
|
|
27
|
+
name: this.getName(),
|
|
28
|
+
inputmode: this.inputmode,
|
|
29
|
+
id: t
|
|
30
|
+
});
|
|
31
|
+
if (e.appendChild(n), this.label) {
|
|
32
|
+
let n = r("label", {
|
|
33
|
+
class: "l-md-input__label",
|
|
34
|
+
for: t
|
|
35
|
+
});
|
|
36
|
+
n.textContent = this.label, e.appendChild(n);
|
|
37
|
+
}
|
|
38
|
+
return e;
|
|
39
|
+
}
|
|
40
|
+
setValue(e) {
|
|
41
|
+
super.setValue(e);
|
|
42
|
+
let t = i("input", this.root);
|
|
43
|
+
t && (t.value = e);
|
|
44
|
+
}
|
|
45
|
+
#e() {
|
|
46
|
+
let e = i("input", this.root);
|
|
47
|
+
e && s(e, "input", this.#n);
|
|
48
|
+
}
|
|
49
|
+
#t() {
|
|
50
|
+
let e = i("input", this.root);
|
|
51
|
+
e && o(e, "input", this.#n);
|
|
52
|
+
}
|
|
53
|
+
#n = (e) => {
|
|
54
|
+
let t = e.target.value;
|
|
55
|
+
this.setValue(t), l(t) ? c(this, "l-has-value") : a(this, "l-has-value");
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
export { d as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/components/md_input/index.less?inline
|
|
2
|
+
var e = ":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}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|