litos-ui 0.23.0 → 0.24.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 +2 -2
- package/README.zh-CN.md +2 -2
- package/lib/base.d.ts +3 -2
- package/lib/base.js +11 -8
- package/lib/button/index.d.ts +21 -5
- package/lib/button/index.js +115 -62
- package/lib/button/index.less_inline.js +2 -3
- package/lib/button/style.js +1 -2
- package/lib/calendar/index.d.ts +1 -0
- package/lib/calendar/index.js +19 -17
- package/lib/calendar/index.less_inline.js +1 -2
- package/lib/calendar/langs.js +21 -11
- package/lib/card/index.js +8 -9
- package/lib/card/index.less_inline.js +1 -2
- package/lib/carousel/index.js +10 -11
- package/lib/carousel/index.less_inline.js +1 -2
- package/lib/carousel/item.js +1 -2
- package/lib/carousel/item.less_inline.js +1 -2
- package/lib/carousel/timer.js +1 -2
- package/lib/check/check.d.ts +40 -8
- package/lib/check/check.js +200 -65
- package/lib/check/check.less_inline.js +2 -3
- package/lib/check/checkbox.js +2 -3
- package/lib/check/checkbox.less_inline.js +2 -3
- package/lib/check/checkbox_group.js +1 -2
- package/lib/check/index.d.ts +28 -8
- package/lib/check/index.js +151 -46
- package/lib/check/index.less_inline.js +1 -2
- package/lib/check/radio.js +2 -3
- package/lib/check/radio.less_inline.js +1 -2
- package/lib/check/radio_group.js +2 -3
- package/lib/collapse/index.d.ts +12 -4
- package/lib/collapse/index.js +80 -46
- package/lib/collapse/index.less_inline.js +2 -3
- package/lib/collapse/item.d.ts +35 -9
- package/lib/collapse/item.js +219 -57
- package/lib/collapse/item.less_inline.js +2 -3
- package/lib/collapse/types.d.ts +17 -3
- package/lib/color_picker/index.d.ts +4 -2
- package/lib/color_picker/index.js +26 -17
- package/lib/color_picker/index.less_inline.js +1 -2
- package/lib/date_picker/index.d.ts +5 -1
- package/lib/date_picker/index.js +39 -23
- package/lib/date_picker/index.less_inline.js +1 -2
- package/lib/date_picker_ori/index.d.ts +7 -2
- package/lib/date_picker_ori/index.js +123 -47
- package/lib/date_picker_ori/index.less_inline.js +1 -2
- package/lib/description_panel/index.js +2 -10
- package/lib/description_panel/index.less_inline.js +1 -2
- package/lib/dialog/dialog_box.js +28 -29
- package/lib/dialog/dialog_container.css_inline.js +1 -2
- package/lib/dialog/dialog_container.js +13 -14
- package/lib/dialog/dialog_container_style.js +1 -2
- package/lib/dialog/index.d.ts +2 -0
- package/lib/dialog/index.js +11 -9
- package/lib/dropdown/index.d.ts +39 -0
- package/lib/dropdown/index.js +98 -0
- package/lib/entries/base.js +1 -2
- package/lib/entries/button.js +5 -6
- package/lib/entries/calendar.js +5 -6
- package/lib/entries/card.js +5 -6
- package/lib/entries/carousel-item.js +5 -6
- package/lib/entries/carousel.js +5 -6
- package/lib/entries/checkbox-group.js +5 -6
- package/lib/entries/checkbox.js +5 -6
- package/lib/entries/collapse-item.d.ts +0 -1
- package/lib/entries/collapse-item.js +6 -6
- package/lib/entries/collapse.d.ts +0 -1
- package/lib/entries/collapse.js +11 -6
- package/lib/entries/color-picker.js +5 -6
- package/lib/entries/date-picker-ori.js +5 -6
- package/lib/entries/date-picker.js +5 -6
- package/lib/entries/description-panel.js +5 -6
- package/lib/entries/dialog-box.js +1 -2
- package/lib/entries/dialog-container.js +5 -6
- package/lib/entries/dialog.js +1 -2
- package/lib/entries/dropdown.d.ts +2 -0
- package/lib/entries/dropdown.js +1 -0
- package/lib/entries/form-item.js +5 -6
- package/lib/entries/form.js +5 -6
- package/lib/entries/icon-arrow-down.js +5 -6
- package/lib/entries/icon-arrow-left.js +5 -6
- package/lib/entries/icon-arrow-right.js +5 -6
- package/lib/entries/icon-arrow-up.js +5 -6
- package/lib/entries/icon-base.js +5 -6
- package/lib/entries/icon-calendar.js +5 -6
- package/lib/entries/icon-caret-bottom.js +5 -6
- package/lib/entries/icon-caret-top.js +5 -6
- package/lib/entries/icon-close-filled.js +5 -6
- package/lib/entries/icon-close.js +5 -6
- package/lib/entries/icon-copy.js +5 -6
- package/lib/entries/icon-d-arrow-left.js +5 -6
- package/lib/entries/icon-d-arrow-right.js +5 -6
- package/lib/entries/icon-delete.js +5 -6
- package/lib/entries/icon-eye-outline.js +5 -6
- package/lib/entries/icon-font-icon.js +5 -6
- package/lib/entries/icon-info.js +5 -6
- package/lib/entries/icon-loading.js +5 -6
- package/lib/entries/icon-minus.js +5 -6
- package/lib/entries/icon-moon.js +5 -6
- package/lib/entries/icon-more.js +5 -6
- package/lib/entries/icon-picture.js +5 -6
- package/lib/entries/icon-plus.js +5 -6
- package/lib/entries/icon-reduction.js +5 -6
- package/lib/entries/icon-refresh-left.js +5 -6
- package/lib/entries/icon-refresh-right.js +5 -6
- package/lib/entries/icon-refresh.js +5 -6
- package/lib/entries/icon-search.js +5 -6
- package/lib/entries/icon-select.js +5 -6
- package/lib/entries/icon-sort.js +5 -6
- package/lib/entries/icon-success.js +5 -6
- package/lib/entries/icon-sun.js +5 -6
- package/lib/entries/icon-theme-default.js +5 -6
- package/lib/entries/icon-warn.js +5 -6
- package/lib/entries/icon-zoom-in.js +5 -6
- package/lib/entries/icon-zoom-out.js +5 -6
- package/lib/entries/image-preview.js +5 -6
- package/lib/entries/image.js +5 -6
- package/lib/entries/input-number.js +5 -6
- package/lib/entries/input.js +5 -6
- package/lib/entries/list.js +5 -6
- package/lib/entries/loading.js +1 -2
- package/lib/entries/mask.js +5 -6
- package/lib/entries/md-input.js +5 -6
- package/lib/entries/menu.js +5 -6
- package/lib/entries/message.js +1 -2
- package/lib/entries/modal-box.js +1 -2
- package/lib/entries/modal.js +5 -6
- package/lib/entries/notification-box.js +1 -2
- package/lib/entries/notification.js +1 -2
- package/lib/entries/page-header.js +5 -6
- package/lib/entries/pagination.js +5 -6
- package/lib/entries/polygon.js +5 -6
- package/lib/entries/popconfirm.js +1 -2
- package/lib/entries/popover.js +1 -2
- package/lib/entries/qrcode.js +5 -6
- package/lib/entries/radio-group.js +5 -6
- package/lib/entries/radio.js +5 -6
- package/lib/entries/select-ori.js +5 -6
- package/lib/entries/select.js +5 -6
- package/lib/entries/space.js +5 -6
- package/lib/entries/switch.js +5 -6
- package/lib/entries/tabbar-item.js +5 -6
- package/lib/entries/tabbar.js +5 -6
- package/lib/entries/table.js +5 -6
- package/lib/entries/tabs.js +1 -2
- package/lib/entries/tag.js +5 -6
- package/lib/entries/theme-color.js +5 -6
- package/lib/entries/theme.js +5 -6
- package/lib/entries/transition.js +1 -2
- package/lib/entries/upload.js +5 -6
- package/lib/entries/utils.js +1 -2
- package/lib/form/accessibility.d.ts +15 -0
- package/lib/form/accessibility.js +56 -0
- package/lib/form/autocomplete.d.ts +21 -0
- package/lib/form/autocomplete.js +59 -0
- package/lib/form/context.d.ts +157 -0
- package/lib/form/context.js +88 -0
- package/lib/form/form_inner.d.ts +99 -24
- package/lib/form/form_inner.js +424 -72
- package/lib/form/form_item.d.ts +35 -11
- package/lib/form/form_item.js +210 -78
- package/lib/form/form_item.less_inline.js +2 -3
- package/lib/form/form_item_style.d.ts +3 -0
- package/lib/form/form_item_style.js +7 -0
- package/lib/form/index.d.ts +69 -15
- package/lib/form/index.js +501 -101
- package/lib/form/index.less_inline.js +1 -2
- package/lib/form/owner.d.ts +78 -0
- package/lib/form/owner.js +138 -0
- package/lib/form/style.d.ts +3 -0
- package/lib/form/style.js +7 -0
- package/lib/icon/arrow_down.js +1 -2
- package/lib/icon/arrow_left.js +1 -2
- package/lib/icon/arrow_right.js +1 -2
- package/lib/icon/arrow_up.js +1 -2
- package/lib/icon/base.js +1 -2
- package/lib/icon/calendar.js +1 -2
- package/lib/icon/caret_bottom.js +1 -2
- package/lib/icon/caret_top.js +1 -2
- package/lib/icon/close.js +1 -2
- package/lib/icon/close_filled.js +1 -2
- package/lib/icon/copy.js +1 -2
- package/lib/icon/d_arrow_left.js +1 -2
- package/lib/icon/d_arrow_right.js +1 -2
- package/lib/icon/delete.js +1 -2
- package/lib/icon/eye_outline.js +1 -2
- package/lib/icon/font_icon.js +1 -2
- package/lib/icon/icon_style.js +1 -2
- package/lib/icon/index.less_inline.js +1 -2
- package/lib/icon/info.js +1 -2
- package/lib/icon/loading.js +1 -2
- package/lib/icon/minus.js +1 -2
- package/lib/icon/moon.js +1 -2
- package/lib/icon/more.js +1 -2
- package/lib/icon/picture.js +1 -2
- package/lib/icon/plus.js +1 -2
- package/lib/icon/reduction.js +1 -2
- package/lib/icon/refresh.js +1 -2
- package/lib/icon/refresh_left.js +1 -2
- package/lib/icon/refresh_right.js +1 -2
- package/lib/icon/search.js +1 -2
- package/lib/icon/select.js +1 -2
- package/lib/icon/sort.js +1 -2
- package/lib/icon/success.js +1 -2
- package/lib/icon/sun.js +1 -2
- package/lib/icon/theme_default.js +1 -2
- package/lib/icon/warn.js +1 -2
- package/lib/icon/zoom_in.js +1 -2
- package/lib/icon/zoom_out.js +1 -2
- package/lib/image/image_preview.js +1 -2
- package/lib/image/image_preview.less_inline.js +1 -2
- package/lib/image/index.js +1 -2
- package/lib/image/index.less_inline.js +1 -2
- package/lib/index.d.ts +2 -1
- package/lib/index.js +88 -87
- package/lib/input/index.d.ts +18 -1
- package/lib/input/index.js +151 -48
- package/lib/input/index.less_inline.js +2 -3
- package/lib/input/input_inner.less_inline.js +1 -2
- package/lib/input/style.d.ts +3 -0
- package/lib/input/style.js +7 -0
- package/lib/input_number/index.d.ts +7 -0
- package/lib/input_number/index.js +70 -48
- package/lib/input_number/index.less_inline.js +1 -2
- package/lib/input_number/style.js +1 -2
- package/lib/list/index.js +4 -5
- package/lib/list/index.less_inline.js +1 -2
- package/lib/loading/index.js +1 -2
- package/lib/mask/index.js +2 -7
- package/lib/mask/index.less_inline.js +1 -2
- package/lib/md_input/index.d.ts +11 -2
- package/lib/md_input/index.js +63 -27
- package/lib/md_input/index.less_inline.js +2 -3
- package/lib/menu/index.js +2 -7
- package/lib/menu/index.less_inline.js +1 -2
- package/lib/message/index.js +1 -2
- package/lib/modal/index.js +15 -16
- package/lib/modal/index.less_inline.js +1 -2
- package/lib/modal/modal_box.js +24 -25
- package/lib/notification/index.js +15 -29
- package/lib/notification/index.less_inline.js +1 -2
- package/lib/notification/notification_box.js +2 -3
- package/lib/notification/placement.js +1 -2
- package/lib/notification/style.js +1 -2
- package/lib/page_header/index.js +1 -2
- package/lib/page_header/index.less_inline.js +1 -2
- package/lib/pagination/index.js +26 -25
- package/lib/pagination/index.less_inline.js +2 -3
- package/lib/polygon/index.js +1 -2
- package/lib/polygon/index.less_inline.js +1 -2
- package/lib/qrcode/index.js +1 -2
- package/lib/qrcode/index.less_inline.js +1 -2
- package/lib/select/index.d.ts +21 -2
- package/lib/select/index.js +138 -77
- package/lib/select/index.less_inline.js +1 -2
- package/lib/select_ori/index.d.ts +9 -1
- package/lib/select_ori/index.js +36 -24
- package/lib/select_ori/index.less_inline.js +1 -2
- package/lib/space/index.js +1 -2
- package/lib/space/index.less_inline.js +1 -2
- package/lib/styles/animation/index.css_inline.js +1 -2
- package/lib/styles/animation/index.js +1 -2
- package/lib/styles/mask/index.css_inline.js +1 -2
- package/lib/styles/mask/index.js +1 -2
- package/lib/switch/index.d.ts +6 -0
- package/lib/switch/index.js +31 -16
- package/lib/switch/index.less_inline.js +1 -2
- package/lib/tabbar/index.js +1 -2
- package/lib/tabbar/index.less_inline.js +1 -2
- package/lib/tabbar/item.js +1 -2
- package/lib/tabbar/item.less_inline.js +1 -2
- package/lib/table/index.d.ts +2 -0
- package/lib/table/index.js +12 -4
- package/lib/table/index.less_inline.js +1 -2
- package/lib/tabs/index.js +1 -2
- package/lib/tag/index.d.ts +11 -3
- package/lib/tag/index.js +25 -24
- package/lib/tag/index.less_inline.js +2 -3
- package/lib/theme/appearance.d.ts +5 -0
- package/lib/theme/appearance.js +34 -0
- package/lib/theme/index.js +83 -39
- package/lib/theme/index.less_inline.js +1 -2
- package/lib/theme/theme_color.js +1 -2
- package/lib/upload/index.js +28 -41
- package/lib/upload/index.less_inline.js +2 -3
- package/lib/upload/style.js +1 -2
- package/lib/utils/clickoutside.js +1 -2
- package/lib/utils/event.js +1 -2
- package/lib/utils/index.d.ts +27 -5
- package/lib/utils/index.js +43 -22
- package/lib/utils/popover.js +7 -16
- package/lib/utils/transition.js +1 -2
- package/package.json +16 -13
- package/styles/dark.css +10 -2
- package/styles/dropdown.css +46 -0
- package/styles/reset.css +0 -1
- package/styles/select.css +5 -0
- package/styles/themes/apple.css +47 -0
- package/styles/{theme-coral.css → themes/coral.css} +5 -3
- package/styles/themes/deep-sea-blue.css +12 -0
- package/styles/themes/gamboge.css +15 -0
- package/styles/{theme-jade.css → themes/jade.css} +5 -3
- package/styles/themes/lotus-seed.css +12 -0
- package/styles/{theme-tangerine.css → themes/tangerine.css} +5 -3
- package/styles/themes.css +8 -0
- package/styles/vars.css +8 -2
- package/types/preact.d.ts +43 -0
- package/lib/form/types.d.ts +0 -7
- package/lib/utils/context_provide.d.ts +0 -10
- package/lib/utils/context_provide.js +0 -22
- package/lib/utils/signal_types.d.ts +0 -5
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/list/index.less?inline
|
|
2
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
3
|
export { e as default };
|
package/lib/loading/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as e, $$ as t, $one as n, addClass as r, hasClass as i, iterate as a } from "utilane/browser";
|
|
2
|
-
|
|
2
|
+
// src/components/loading/index.ts
|
|
3
3
|
function o(e, a) {
|
|
4
4
|
if (i(e, "l-loading")) return;
|
|
5
5
|
let o;
|
|
@@ -112,5 +112,4 @@ var u = {
|
|
|
112
112
|
},
|
|
113
113
|
LoadingInstance: c
|
|
114
114
|
};
|
|
115
|
-
//#endregion
|
|
116
115
|
export { c as LoadingInstance, u as default };
|
package/lib/mask/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import e from "../base.js";
|
|
|
2
2
|
import { kebabToCamel as t, parseAttrValue as n } from "../utils/index.js";
|
|
3
3
|
import r from "./index.less_inline.js";
|
|
4
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
|
-
|
|
5
|
+
// src/components/mask/index.ts
|
|
6
6
|
var p = class extends e {
|
|
7
7
|
static baseName = "mask";
|
|
8
8
|
#e = !1;
|
|
@@ -93,11 +93,7 @@ var p = class extends e {
|
|
|
93
93
|
}
|
|
94
94
|
#r = (e) => {
|
|
95
95
|
let [t, n] = d(e, "data-action", e.currentTarget);
|
|
96
|
-
|
|
97
|
-
this.maskClosable && (this.open = !1);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
this.onAction(n) || this.emit("action", { detail: n });
|
|
96
|
+
t ? this.onAction(n) || this.emit("action", { detail: n }) : this.maskClosable && (this.open = !1);
|
|
101
97
|
};
|
|
102
98
|
afterOpened() {}
|
|
103
99
|
afterClosed() {}
|
|
@@ -105,5 +101,4 @@ var p = class extends e {
|
|
|
105
101
|
return !1;
|
|
106
102
|
}
|
|
107
103
|
};
|
|
108
|
-
//#endregion
|
|
109
104
|
export { p as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/mask/index.less?inline
|
|
2
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
3
|
export { e as default };
|
package/lib/md_input/index.d.ts
CHANGED
|
@@ -2,14 +2,23 @@ import FormInner from "../form/form_inner";
|
|
|
2
2
|
export default class MdInput extends FormInner {
|
|
3
3
|
#private;
|
|
4
4
|
static baseName: string;
|
|
5
|
+
protected _ignoreInitAttrs: string[];
|
|
5
6
|
/** 是否显示四周边框 */
|
|
6
7
|
outline: boolean;
|
|
7
|
-
htmlType: "text" | "number" | "password" | "tel";
|
|
8
|
+
get htmlType(): "text" | "number" | "password" | "tel";
|
|
9
|
+
set htmlType(value: "text" | "number" | "password" | "tel");
|
|
8
10
|
inputmode?: "text" | "numeric" | "decimal" | "tel";
|
|
9
11
|
label?: string;
|
|
12
|
+
protected get formStateRestorationEnabled(): boolean;
|
|
13
|
+
protected get acceptsAutocompleteText(): boolean;
|
|
10
14
|
static get observedAttributes(): string[];
|
|
15
|
+
protected attributeChange(name: string, _oldValue: string, _newValue: string): void;
|
|
16
|
+
private syncEditorValue;
|
|
11
17
|
connectedCallback(): void;
|
|
12
|
-
disconnectedCallback(): void;
|
|
13
18
|
render(): DocumentFragment;
|
|
14
19
|
setValue(value: any): void;
|
|
20
|
+
protected disabledChange(): void;
|
|
21
|
+
protected innerBlockChange(innerBlock: boolean): void;
|
|
22
|
+
afterInit(): void;
|
|
23
|
+
beforeDestroy(): void;
|
|
15
24
|
}
|
package/lib/md_input/index.js
CHANGED
|
@@ -1,30 +1,59 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "../
|
|
1
|
+
import e from "../form/form_inner.js";
|
|
2
|
+
import { initAttr as t } from "../utils/index.js";
|
|
3
3
|
import n from "./index.less_inline.js";
|
|
4
|
-
import { $$ as r, $one as i, addClass as a, off as o, on as s
|
|
5
|
-
import { isBlank as
|
|
6
|
-
|
|
7
|
-
var
|
|
4
|
+
import { $$ as r, $one as i, addClass as a, off as o, on as s } from "utilane/browser";
|
|
5
|
+
import { isBlank as c, random as l } from "utilane";
|
|
6
|
+
// src/components/md_input/index.ts
|
|
7
|
+
var u = class extends e {
|
|
8
8
|
static baseName = "md-input";
|
|
9
|
+
_ignoreInitAttrs = [
|
|
10
|
+
"value",
|
|
11
|
+
"autocomplete",
|
|
12
|
+
"htmlType"
|
|
13
|
+
];
|
|
9
14
|
outline = !1;
|
|
10
|
-
htmlType
|
|
15
|
+
get htmlType() {
|
|
16
|
+
let e = (this.getAttribute("html-type") || "text").toLowerCase();
|
|
17
|
+
return e === "number" || e === "password" || e === "tel" ? e : "text";
|
|
18
|
+
}
|
|
19
|
+
set htmlType(e) {
|
|
20
|
+
this.setAttribute("html-type", e);
|
|
21
|
+
}
|
|
11
22
|
inputmode;
|
|
12
23
|
label;
|
|
24
|
+
get formStateRestorationEnabled() {
|
|
25
|
+
return this.htmlType !== "password";
|
|
26
|
+
}
|
|
27
|
+
get acceptsAutocompleteText() {
|
|
28
|
+
return !0;
|
|
29
|
+
}
|
|
13
30
|
static get observedAttributes() {
|
|
14
|
-
return [
|
|
31
|
+
return [.../* @__PURE__ */ new Set([
|
|
32
|
+
...e.observedAttributes,
|
|
33
|
+
"disabled",
|
|
34
|
+
"html-type",
|
|
35
|
+
"autocomplete"
|
|
36
|
+
])];
|
|
15
37
|
}
|
|
16
|
-
|
|
17
|
-
|
|
38
|
+
attributeChange(e, t, n) {
|
|
39
|
+
let r = i("input", this.root);
|
|
40
|
+
e === "html-type" && r && (r.type = this.htmlType, this.syncEditorValue(r));
|
|
18
41
|
}
|
|
19
|
-
|
|
20
|
-
|
|
42
|
+
syncEditorValue(e) {
|
|
43
|
+
if (e.value === this.value) return;
|
|
44
|
+
let t = this.dirtyValue;
|
|
45
|
+
this.setValue(e.value), this.dirtyValue = t;
|
|
46
|
+
}
|
|
47
|
+
connectedCallback() {
|
|
48
|
+
t(this), this.loadStyleText(n), super.connectedCallback();
|
|
21
49
|
}
|
|
22
50
|
render() {
|
|
23
|
-
|
|
24
|
-
let e = document.createDocumentFragment(), t = `l-md-input-${
|
|
51
|
+
c(this.value) || a(this, "l-has-value"), this.outline && a(this, "l-md-input-outline");
|
|
52
|
+
let e = document.createDocumentFragment(), t = `l-md-input-${l(8)}`, n = r("input", {
|
|
25
53
|
class: "l-md-input__inner",
|
|
26
54
|
type: this.htmlType,
|
|
27
|
-
|
|
55
|
+
value: this.value ?? "",
|
|
56
|
+
disabled: this.isDisabled(),
|
|
28
57
|
inputmode: this.inputmode,
|
|
29
58
|
id: t
|
|
30
59
|
});
|
|
@@ -38,22 +67,29 @@ var d = class extends t {
|
|
|
38
67
|
return e;
|
|
39
68
|
}
|
|
40
69
|
setValue(e) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
70
|
+
let t = String(e ?? ""), n = i("input", this.root), r = this.htmlType, a = n ?? (r === "number" ? this.ownerDocument.createElement("input") : null);
|
|
71
|
+
a && !n && (a.type = r), a && a.value !== t && (a.value = t);
|
|
72
|
+
let o = a?.value ?? t;
|
|
73
|
+
this.classList.toggle("l-has-value", !c(o)), super.setValue(o);
|
|
74
|
+
}
|
|
75
|
+
disabledChange() {
|
|
76
|
+
let e = i("input", this.root);
|
|
77
|
+
e && (e.disabled = this.isDisabled());
|
|
78
|
+
}
|
|
79
|
+
innerBlockChange(e) {
|
|
80
|
+
this.classList.toggle("is-block", e);
|
|
44
81
|
}
|
|
45
|
-
|
|
82
|
+
afterInit() {
|
|
46
83
|
let e = i("input", this.root);
|
|
47
|
-
e && s(e, "input", this.#
|
|
84
|
+
e && (this.syncEditorValue(e), this.syncAutocomplete(), s(e, "input", this.#e));
|
|
48
85
|
}
|
|
49
|
-
|
|
86
|
+
beforeDestroy() {
|
|
50
87
|
let e = i("input", this.root);
|
|
51
|
-
e && o(e, "input", this.#
|
|
88
|
+
e && o(e, "input", this.#e);
|
|
52
89
|
}
|
|
53
|
-
#
|
|
54
|
-
let t = e.target
|
|
55
|
-
this.setValue(t),
|
|
90
|
+
#e = (e) => {
|
|
91
|
+
let t = e.target;
|
|
92
|
+
this.setValue(t.value), this.validateInput();
|
|
56
93
|
};
|
|
57
94
|
};
|
|
58
|
-
|
|
59
|
-
export { d as default };
|
|
95
|
+
export { u as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
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
|
|
1
|
+
// 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}:host(.is-block){flex:1;width:100%}.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}";
|
|
4
3
|
export { e as default };
|
package/lib/menu/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import e from "../base.js";
|
|
|
2
2
|
import { kebabToCamel as t, parseAttrValue as n, unitNumberStr as r } from "../utils/index.js";
|
|
3
3
|
import i from "./index.less_inline.js";
|
|
4
4
|
import { $ as a, $$ as o, $one as s, iterate as c, off as l, on as u } from "utilane/browser";
|
|
5
|
-
|
|
5
|
+
// src/components/menu/index.ts
|
|
6
6
|
var d = 350, f = class extends e {
|
|
7
7
|
static baseName = "menu";
|
|
8
8
|
_items;
|
|
@@ -187,11 +187,7 @@ var d = 350, f = class extends e {
|
|
|
187
187
|
let r = n.getAttribute("index") || "", i = this.#n.get(r);
|
|
188
188
|
i && (clearTimeout(i), this.#n.delete(r));
|
|
189
189
|
let a = this.#t.get(r);
|
|
190
|
-
|
|
191
|
-
this.#t.delete(r);
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
this.#t.delete(r), t.style.removeProperty("height"), n.hasAttribute("expanded") || t.classList.add("l-menu--collapsed");
|
|
190
|
+
a && a.expand !== n.hasAttribute("expanded") ? this.#t.delete(r) : (this.#t.delete(r), t.style.removeProperty("height"), n.hasAttribute("expanded") || t.classList.add("l-menu--collapsed"));
|
|
195
191
|
};
|
|
196
192
|
set items(e) {
|
|
197
193
|
this._items = e, this._menuEl && this._menuEl.replaceChildren(this._renderItems());
|
|
@@ -271,5 +267,4 @@ var d = 350, f = class extends e {
|
|
|
271
267
|
return n(e, []);
|
|
272
268
|
}
|
|
273
269
|
};
|
|
274
|
-
//#endregion
|
|
275
270
|
export { f as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/menu/index.less?inline
|
|
2
2
|
var e = ":host{--l-menu-width:240px;--l-menu-height:auto;--l-menu-level:0;--l-menu-item-height:40px;--l-menu-item-padding-x:10px;--l-menu-item-indent:15px;--l-menu-item-radius:0;--l-menu-item-hover-background:var(--l-primary-color-light5,#f9f0ff);--l-menu-item-active-color:var(--l-primary-color,#722ed1);--l-menu-item-active-background:var(--l-primary-color-light5,#f9f0ff);--l-menu-border-color:transparent;--l-menu-border-width:0px;--l-menu-arrow-color:var(--l-text-color,#8c8c8c);--l-menu-collapsed-width:40px;--l-menu-icon-size:1.8rem;--l-menu-collapsed-icon-size:1.8rem;width:var(--l-menu-width);height:var(--l-menu-height);box-sizing:border-box;transition:width .3s;display:block}.l-menu{min-width:0;color:inherit;box-sizing:border-box;border-right:var(--l-menu-border-width) solid var(--l-menu-border-color);font-size:14px;transition:height .3s,width .3s;display:block;position:relative;overflow:hidden}.l-menu .l-menu{--l-menu-border-color:transparent}.l-menu-item,.l-submenu-title{padding:0 var(--l-menu-item-padding-x) 0 calc(var(--l-menu-item-padding-x) + var(--l-menu-level) * var(--l-menu-item-indent));height:var(--l-menu-item-height);cursor:pointer;box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;border-radius:var(--l-menu-item-radius);border-right:2px solid #0000;align-items:center;gap:6px;transition:color .3s,background-color .3s,border-color .3s,transform .2s;display:flex;position:relative;overflow:hidden}.l-menu-item:hover,.l-submenu-title:hover{background-color:var(--l-menu-item-hover-background)}.l-menu-item.active{background-color:var(--l-menu-item-active-background);color:var(--l-menu-item-active-color);box-shadow:inset 3px 0 var(--l-primary-color-light1,#39f);font-weight:500}.l-menu-icon-wrap{font-size:var(--l-menu-icon-size);flex:none;align-items:center;line-height:1;display:inline-flex}.l-menu-submenu{width:100%;display:block;overflow:hidden}.l-submenu-arrow-icon{color:var(--l-menu-arrow-color);transition:transform .3s;position:absolute;top:50%;right:10px;transform:translateY(-50%)rotate(90deg)}.l-menu-submenu.collapsed .l-submenu-arrow-icon{transform:translateY(-50%)rotate(0)}.l-menu--collapsed{display:none}.l-menu--hide{visibility:hidden;pointer-events:none;position:absolute}.l-menu-submenu.active .l-submenu-title{color:var(--l-menu-item-active-color)}:host(.menu--collapsed){width:var(--l-menu-collapsed-width)}:host(.menu--collapsed) .l-submenu-arrow-icon,:host(.menu--collapsed) .l-menu-item--label{display:none}:host(.menu--collapsed) .l-menu-icon-wrap{font-size:var(--l-menu-collapsed-icon-size,var(--l-menu-icon-size,1.8rem))}@media (prefers-reduced-motion:reduce){.l-menu,.l-menu-item,.l-submenu-title,.l-submenu-arrow-icon{transition:none}}";
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as default };
|
package/lib/message/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import r from "../icon/success.js";
|
|
|
4
4
|
import i from "../icon/warn.js";
|
|
5
5
|
import a from "../icon/info.js";
|
|
6
6
|
import { transition as o } from "utilane/browser";
|
|
7
|
-
|
|
7
|
+
// src/components/message/index.ts
|
|
8
8
|
var s = [], c = [[
|
|
9
9
|
"opacity",
|
|
10
10
|
"0",
|
|
@@ -69,5 +69,4 @@ var m = {
|
|
|
69
69
|
show: (e) => p(e),
|
|
70
70
|
close: u
|
|
71
71
|
};
|
|
72
|
-
//#endregion
|
|
73
72
|
export { m as default };
|
package/lib/modal/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import e from "../base.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import a from "../
|
|
2
|
+
import t from "./index.less_inline.js";
|
|
3
|
+
import n from "../styles/mask/index.js";
|
|
4
|
+
import { kebabToCamel as r, parseAttrValue as i, unitNumberStr as a } from "../utils/index.js";
|
|
5
5
|
import { $$ as o, $one as s, off as c, on as l, shouldEventNext as u, transition as d } from "utilane/browser";
|
|
6
|
-
|
|
6
|
+
// src/components/modal/index.ts
|
|
7
7
|
var f = class extends e {
|
|
8
8
|
static baseName = "modal";
|
|
9
9
|
_bodyOverflow = "";
|
|
@@ -44,7 +44,7 @@ var f = class extends e {
|
|
|
44
44
|
"header-title"
|
|
45
45
|
];
|
|
46
46
|
}
|
|
47
|
-
attributeChanged(e,
|
|
47
|
+
attributeChanged(e, t, n) {
|
|
48
48
|
switch (e) {
|
|
49
49
|
case "show":
|
|
50
50
|
case "confirm-loading":
|
|
@@ -55,27 +55,27 @@ var f = class extends e {
|
|
|
55
55
|
case "mobile":
|
|
56
56
|
case "header":
|
|
57
57
|
case "footer":
|
|
58
|
-
this._state[
|
|
58
|
+
this._state[r(e)] = i(n, !1, e);
|
|
59
59
|
break;
|
|
60
60
|
case "cancel-text":
|
|
61
|
-
this._state.cancelText = n
|
|
61
|
+
this._state.cancelText = i(n, "取消");
|
|
62
62
|
break;
|
|
63
63
|
case "ok-text":
|
|
64
|
-
this._state.okText = n
|
|
64
|
+
this._state.okText = i(n, "确定");
|
|
65
65
|
break;
|
|
66
66
|
case "close":
|
|
67
|
-
this._state.close = n
|
|
67
|
+
this._state.close = i(n, 1);
|
|
68
68
|
break;
|
|
69
69
|
case "width":
|
|
70
|
-
this._state[e] =
|
|
70
|
+
this._state[e] = a(n);
|
|
71
71
|
break;
|
|
72
72
|
case "vertical-align":
|
|
73
|
-
this._state.verticalAlign = n
|
|
73
|
+
this._state.verticalAlign = i(n, "top");
|
|
74
74
|
break;
|
|
75
75
|
case "z-index":
|
|
76
|
-
this._state.zIndex =
|
|
76
|
+
this._state.zIndex = n;
|
|
77
77
|
break;
|
|
78
|
-
case "header-title": this._state.headerTitle =
|
|
78
|
+
case "header-title": this._state.headerTitle = n;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
updateDOM(e) {
|
|
@@ -90,8 +90,8 @@ var f = class extends e {
|
|
|
90
90
|
}
|
|
91
91
|
render_v2() {
|
|
92
92
|
return {
|
|
93
|
-
style: [
|
|
94
|
-
styleSheets: [
|
|
93
|
+
style: [t],
|
|
94
|
+
styleSheets: [n]
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
_setZIndex() {
|
|
@@ -195,5 +195,4 @@ var f = class extends e {
|
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
197
|
};
|
|
198
|
-
//#endregion
|
|
199
198
|
export { f as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/modal/index.less?inline
|
|
2
2
|
var e = ":host{display:none}:host(.open){display:block}.l-modal-mask{z-index:var(--l-modal-zindex,100)}.l-modal-wrapper{width:100%;height:100%;z-index:calc(var(--l-modal-zindex,100) + 1);position:fixed;top:0;left:0}.l-modal{--l-modal-translate:translate3d(0, 80px, 0);border-radius:var(--l-modal-border-radius,5px);width:var(--l-modal-width,27%);opacity:1;transform:var(--l-modal-translate) scale3d(1, 1, 1);background-color:#fff;margin:auto;transition:opacity .3s,transform .3s;position:relative;box-shadow:0 0 8px #0000001a}.l-modal-header{padding:var(--l-modal-header-padding,10px);border-bottom:1px solid var(--l-modal-line-color,#0000000f);align-items:center;gap:5px;font-size:16px;font-weight:600;display:flex}.l-modal-footer{padding:var(--l-modal-footer-padding,10px);border-top:1px solid var(--l-modal-line-color,#0000000f);justify-content:flex-end;gap:10px;display:flex}.l-modal-container{padding:var(--l-modal-container-padding,15px 10px);font-size:14px}.l-btn-modal-close{--l-form-control-height:auto;position:absolute}.l-modal-close1{top:8px;right:5px}.l-modal-close1::part(default){border:none;width:auto;height:auto;padding:5px;font-size:16px}.l-modal-close2{top:-10px;right:-10px}.l-modal-close2::part(default){background-color:#fff;width:20px;height:20px;padding:0}.mask-transition-enter-from,.mask-transition-leave-to{opacity:0}.modal-transition-enter-from,.modal-transition-leave-to{transform:translate(0,0)scale3d(0,0,0)}.l-modal--mobile{border-radius:10px}.l-modal--mobile .l-modal-header{text-align:center;border-bottom-color:#0000;justify-content:center;padding:20px 10px 5px;display:flex}.l-modal--mobile .l-modal-container{--l-modal-container-padding:5px 15px 20px;text-align:center}.l-modal--mobile .l-modal-footer{text-align:center;justify-content:stretch;align-items:stretch;gap:0;height:50px;padding:0;display:flex}.l-modal--mobile .l-modal-footer-btn{flex-grow:1;height:100%}.l-modal--mobile .l-modal-footer-btn+.l-modal-footer-btn{border-left:1px solid var(--l-modal-line-color,#0000000f)}.l-modal--middle{--l-modal-translate:translate3d(0, -50%, 0);top:50%}.l-modal--bottom{--l-modal-translate:translate3d(0, -100%, 0);border-bottom-right-radius:0;border-bottom-left-radius:0;width:100%;top:100%}@media screen and (width<=768px){:host{--l-modal-width:80%}}";
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as default };
|
package/lib/modal/modal_box.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "../
|
|
3
|
-
import n from "../
|
|
4
|
-
import r from "../icon/
|
|
5
|
-
import i from "../
|
|
6
|
-
import a from "../
|
|
7
|
-
import o from "
|
|
1
|
+
import e from "./index.js";
|
|
2
|
+
import t from "../button/index.js";
|
|
3
|
+
import n from "../icon/close.js";
|
|
4
|
+
import r from "../icon/info.js";
|
|
5
|
+
import { regist as i } from "../utils/index.js";
|
|
6
|
+
import a from "../form/form_item.js";
|
|
7
|
+
import o from "../input/index.js";
|
|
8
8
|
import { $$ as s, $one as c, on as l } from "utilane/browser";
|
|
9
|
-
|
|
9
|
+
// src/components/modal/modal_box.ts
|
|
10
10
|
function u(e, t, n, r = "alert") {
|
|
11
11
|
return new Promise((i) => {
|
|
12
12
|
let a = [];
|
|
@@ -33,27 +33,27 @@ function u(e, t, n, r = "alert") {
|
|
|
33
33
|
}, { once: !0 }), document.body.appendChild(o);
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
function d(
|
|
37
|
-
|
|
38
|
-
r,
|
|
36
|
+
function d(r, a, o) {
|
|
37
|
+
i([
|
|
39
38
|
n,
|
|
40
|
-
|
|
39
|
+
t,
|
|
40
|
+
e
|
|
41
41
|
]);
|
|
42
42
|
let s = {
|
|
43
43
|
showCancel: !1,
|
|
44
44
|
close: 0,
|
|
45
45
|
maskClosable: !1,
|
|
46
46
|
icon: void 0,
|
|
47
|
-
...
|
|
47
|
+
...o
|
|
48
48
|
};
|
|
49
|
-
return u(
|
|
49
|
+
return u(a || "提示", r, s, "alert").then((e) => e === !0);
|
|
50
50
|
}
|
|
51
|
-
function f(
|
|
52
|
-
|
|
51
|
+
function f(a, o, c) {
|
|
52
|
+
i([
|
|
53
|
+
n,
|
|
53
54
|
r,
|
|
54
55
|
t,
|
|
55
|
-
|
|
56
|
-
o
|
|
56
|
+
e
|
|
57
57
|
]);
|
|
58
58
|
let l = {
|
|
59
59
|
showCancel: !0,
|
|
@@ -62,16 +62,16 @@ function f(i, a, c) {
|
|
|
62
62
|
icon: () => s("l-info-icon", { style: "color:#1890ff;" }),
|
|
63
63
|
...c
|
|
64
64
|
};
|
|
65
|
-
return u(
|
|
65
|
+
return u(o || "提示", a, l, "confirm");
|
|
66
66
|
}
|
|
67
67
|
function p(s, c, l) {
|
|
68
|
-
|
|
68
|
+
i([
|
|
69
|
+
n,
|
|
69
70
|
r,
|
|
70
|
-
t,
|
|
71
|
-
i,
|
|
72
71
|
a,
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
o,
|
|
73
|
+
t,
|
|
74
|
+
e
|
|
75
75
|
]);
|
|
76
76
|
let d = {
|
|
77
77
|
showCancel: !0,
|
|
@@ -87,5 +87,4 @@ var m = {
|
|
|
87
87
|
confirm: f,
|
|
88
88
|
prompt: p
|
|
89
89
|
};
|
|
90
|
-
//#endregion
|
|
91
90
|
export { m as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import e from "../base.js";
|
|
2
2
|
import { kebabToCamel as t, parseAttrValue as n, unitNumberStr as r } from "../utils/index.js";
|
|
3
|
-
import
|
|
4
|
-
import d from "./
|
|
3
|
+
import i from "./style.js";
|
|
4
|
+
import { DEFAULT_ZINDEX as a, getGroupSize as o, getOldestNotification as s, layoutGroup as c, normalizePlacement as l, registerNotification as u, unregisterNotification as d } from "./placement.js";
|
|
5
5
|
import { $$ as f, $one as p, off as m, on as h } from "utilane/browser";
|
|
6
|
-
|
|
6
|
+
// src/components/notification/index.ts
|
|
7
7
|
var g = {
|
|
8
8
|
info: "info",
|
|
9
9
|
success: "success",
|
|
@@ -40,7 +40,7 @@ var g = {
|
|
|
40
40
|
showIcon: !0,
|
|
41
41
|
width: "",
|
|
42
42
|
offset: 16,
|
|
43
|
-
zIndex:
|
|
43
|
+
zIndex: a,
|
|
44
44
|
maxCount: 0,
|
|
45
45
|
action: "",
|
|
46
46
|
customClass: ""
|
|
@@ -98,7 +98,7 @@ var g = {
|
|
|
98
98
|
this._state.customClass = a || "";
|
|
99
99
|
break;
|
|
100
100
|
case "placement":
|
|
101
|
-
this._state.placement =
|
|
101
|
+
this._state.placement = l(a);
|
|
102
102
|
break;
|
|
103
103
|
case "width":
|
|
104
104
|
this._state.width = r(a) || "";
|
|
@@ -118,11 +118,11 @@ var g = {
|
|
|
118
118
|
(e.has("type") || e.has("show-icon")) && this._syncIcon(), (e.has("title") || e.has("message")) && this._syncSections(), e.has("action") && this._syncActions(), e.has("closable") && this._syncClose(), e.has("width") && this._syncWidth(), e.has("custom-class") && this._syncCustomClass(), (e.has("offset") || e.has("z-index")) && this._syncOffset(), e.has("placement") && this._updatePlacement(), e.has("duration") && this._visible && this._startTimer(), e.has("open") && this._toggleOpen();
|
|
119
119
|
}
|
|
120
120
|
disconnectedCallback() {
|
|
121
|
-
super.disconnectedCallback(),
|
|
121
|
+
super.disconnectedCallback(), d(this), this._cancelPendingAnimation(), this._unobserveSize(), this._clearTimer(), this._visible = !1;
|
|
122
122
|
}
|
|
123
123
|
render_v2() {
|
|
124
124
|
return this._changedProperties.clear(), {
|
|
125
|
-
styleSheets: [
|
|
125
|
+
styleSheets: [i],
|
|
126
126
|
template: this.render()
|
|
127
127
|
};
|
|
128
128
|
}
|
|
@@ -142,20 +142,7 @@ var g = {
|
|
|
142
142
|
part: "icon"
|
|
143
143
|
}));
|
|
144
144
|
let t = f("div", { class: "l-notification-content" });
|
|
145
|
-
return t.innerHTML =
|
|
146
|
-
"<div class=\"l-notification-title\" part=\"title\">",
|
|
147
|
-
"<span class=\"l-notification-title-text\"></span>",
|
|
148
|
-
"<slot name=\"title\"></slot>",
|
|
149
|
-
"</div>",
|
|
150
|
-
"<div class=\"l-notification-message\" part=\"message\">",
|
|
151
|
-
"<span class=\"l-notification-message-text\"></span>",
|
|
152
|
-
"<slot></slot>",
|
|
153
|
-
"</div>",
|
|
154
|
-
"<div class=\"l-notification-actions\" part=\"actions\">",
|
|
155
|
-
"<button type=\"button\" class=\"l-notification-action\" part=\"action\"></button>",
|
|
156
|
-
"<slot name=\"action\"></slot>",
|
|
157
|
-
"</div>"
|
|
158
|
-
].join(""), e.appendChild(t), e.appendChild(f("button", {
|
|
145
|
+
return t.innerHTML = "<div class=\"l-notification-title\" part=\"title\"><span class=\"l-notification-title-text\"></span><slot name=\"title\"></slot></div><div class=\"l-notification-message\" part=\"message\"><span class=\"l-notification-message-text\"></span><slot></slot></div><div class=\"l-notification-actions\" part=\"actions\"><button type=\"button\" class=\"l-notification-action\" part=\"action\"></button><slot name=\"action\"></slot></div>", e.appendChild(t), e.appendChild(f("button", {
|
|
159
146
|
class: "l-notification-close",
|
|
160
147
|
part: "close",
|
|
161
148
|
type: "button",
|
|
@@ -216,7 +203,7 @@ var g = {
|
|
|
216
203
|
this._state.width ? this.style.setProperty("--l-notification-width", this._state.width) : this.style.removeProperty("--l-notification-width");
|
|
217
204
|
}
|
|
218
205
|
_syncOffset() {
|
|
219
|
-
this.style.setProperty("--l-notification-offset", `${this._state.offset}px`), this.style.setProperty("--l-notification-zindex", `${this._state.zIndex}`), this._visible &&
|
|
206
|
+
this.style.setProperty("--l-notification-offset", `${this._state.offset}px`), this.style.setProperty("--l-notification-zindex", `${this._state.zIndex}`), this._visible && c(this._state.placement);
|
|
220
207
|
}
|
|
221
208
|
_syncCustomClass() {
|
|
222
209
|
for (let e of this._appliedClasses) this.classList.remove(e);
|
|
@@ -227,16 +214,16 @@ var g = {
|
|
|
227
214
|
return e ? e.assignedNodes().some((e) => e.nodeType !== 3 || (e.textContent || "").trim() !== "") : !1;
|
|
228
215
|
}
|
|
229
216
|
_updatePlacement() {
|
|
230
|
-
this._visible &&
|
|
217
|
+
this._visible && u(this, this._state.placement);
|
|
231
218
|
}
|
|
232
219
|
_toggleOpen() {
|
|
233
220
|
this.rendered && (this._state.open ? this._show() : this._hide());
|
|
234
221
|
}
|
|
235
222
|
_show() {
|
|
236
|
-
this._visible || (this._visible = !0, this.removeAttribute("hidden"),
|
|
223
|
+
this._visible || (this._visible = !0, this.removeAttribute("hidden"), u(this, this._state.placement), this._observeSize(), this._enter(), this._startTimer(), this._enforceMaxCount());
|
|
237
224
|
}
|
|
238
225
|
_hide() {
|
|
239
|
-
this._visible && (this._visible = !1, this._clearTimer(), this._unobserveSize(),
|
|
226
|
+
this._visible && (this._visible = !1, this._clearTimer(), this._unobserveSize(), d(this), this.emit("close", { detail: { id: this.id } }), this._leave(() => {
|
|
240
227
|
this.removeOnClose ? this.remove() : this.setAttribute("hidden", "");
|
|
241
228
|
}));
|
|
242
229
|
}
|
|
@@ -244,8 +231,8 @@ var g = {
|
|
|
244
231
|
let e = this._state.maxCount;
|
|
245
232
|
if (e <= 0) return;
|
|
246
233
|
let t = this._state.placement;
|
|
247
|
-
for (;
|
|
248
|
-
let e =
|
|
234
|
+
for (; o(t) > e;) {
|
|
235
|
+
let e = s(t);
|
|
249
236
|
if (!e || e === this) break;
|
|
250
237
|
e.close();
|
|
251
238
|
}
|
|
@@ -282,7 +269,7 @@ var g = {
|
|
|
282
269
|
}
|
|
283
270
|
_observeSize() {
|
|
284
271
|
this._resizeObserver || typeof ResizeObserver > "u" || (this._resizeObserver = new ResizeObserver(() => {
|
|
285
|
-
this._visible &&
|
|
272
|
+
this._visible && c(this._state.placement);
|
|
286
273
|
}), this._resizeObserver.observe(this));
|
|
287
274
|
}
|
|
288
275
|
_unobserveSize() {
|
|
@@ -322,5 +309,4 @@ var g = {
|
|
|
322
309
|
this._syncSections(), this._syncActions();
|
|
323
310
|
};
|
|
324
311
|
};
|
|
325
|
-
//#endregion
|
|
326
312
|
export { _ as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/notification/index.less?inline
|
|
2
2
|
var e = ":host{--l-notification-width:330px;--l-notification-gap:16px;--l-notification-offset:16px;--l-notification-zindex:2000;--l-notification-padding:16px;--l-notification-radius:8px;--l-notification-background:#fff;--l-notification-shadow:0 6px 16px 0 #00000014, 0 3px 6px -4px #0000001f, 0 9px 28px 8px #0000000d;--l-notification-title-color:#000000e0;--l-notification-message-color:#000000a6;--l-notification-icon-size:22px;--l-notification-anim-duration:.3s;--l-notification-enter-offset:-20px;--l-notification-color:var(--l-primary-color,#007bff);--l-notification-action-hover-background:#0000000a;--l-notification-close-hover-background:#0000000f;z-index:var(--l-notification-zindex,2000);width:var(--l-notification-width);box-sizing:border-box;max-width:calc(100vw - 32px);color:var(--l-notification-title-color);transition:top var(--l-notification-anim-duration) ease, bottom var(--l-notification-anim-duration) ease;font-size:14px;line-height:1.5715;position:fixed}:host([placement=topLeft]),:host([placement=bottomLeft]){left:var(--l-notification-offset,16px);right:auto}:host([placement=topRight]),:host([placement=bottomRight]){right:var(--l-notification-offset,16px);left:auto}:host([placement=bottomLeft]),:host([placement=bottomRight]){--l-notification-enter-offset:20px}:host([hidden]){display:none}:host([type=info]){--l-notification-color:var(--l-primary-color,#007bff)}:host([type=success]){--l-notification-color:var(--l-success-color,#52c41a)}:host([type=error]){--l-notification-color:var(--l-error-color,#f5222d)}:host([type=warning]){--l-notification-color:var(--l-warning-color,#faad14)}:host(.l-notification-enter),:host(.l-notification-leave){opacity:0;transform:translateY(var(--l-notification-enter-offset)) scale(.95)}:host(.l-notification-enter-active),:host(.l-notification-leave-active){transition:top var(--l-notification-anim-duration) ease, bottom var(--l-notification-anim-duration) ease, opacity var(--l-notification-anim-duration) ease, transform var(--l-notification-anim-duration) ease}.l-notification{padding:var(--l-notification-padding);background:var(--l-notification-background);border-radius:var(--l-notification-radius);box-shadow:var(--l-notification-shadow);border-left:4px solid var(--l-notification-color);box-sizing:border-box;align-items:flex-start;gap:10px;display:flex;position:relative}.l-notification-icon{height:calc(var(--l-notification-icon-size) * 1.4);font-size:var(--l-notification-icon-size);color:var(--l-notification-color);flex:none;justify-content:center;align-items:center;display:inline-flex}.l-notification-content{flex:1;min-width:0}.l-notification-title{color:var(--l-notification-title-color);word-break:break-word;margin-bottom:4px;font-size:16px;font-weight:500}.l-notification-message{color:var(--l-notification-message-color);word-break:break-word}.l-notification-message-text{display:block}.l-notification-actions{align-items:center;gap:8px;margin-top:12px;display:flex}.l-notification-action{border:1px solid var(--l-notification-color);border-radius:var(--l-border-radius,3px);height:28px;color:var(--l-notification-color);cursor:pointer;background:0 0;justify-content:center;align-items:center;padding:0 12px;font-size:14px;line-height:1;transition:opacity .3s,background-color .3s;display:inline-flex}.l-notification-action:hover{opacity:.8;background:var(--l-notification-action-hover-background)}.l-notification-close{width:22px;height:22px;color:var(--l-notification-message-color);cursor:pointer;background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;margin-left:auto;padding:0;font-size:14px;transition:color .3s,background-color .3s;display:inline-flex}.l-notification-close:hover{color:var(--l-notification-title-color);background:var(--l-notification-close-hover-background)}.l-notification-title[hidden],.l-notification-message[hidden],.l-notification-actions[hidden],.l-notification-icon[hidden],.l-notification-close[hidden],.l-notification-title-text[hidden],.l-notification-message-text[hidden]{display:none}";
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useId as e } from "../utils/index.js";
|
|
2
2
|
import { normalizePlacement as t } from "./placement.js";
|
|
3
3
|
import { on as n } from "utilane/browser";
|
|
4
|
-
|
|
4
|
+
// src/components/notification/notification_box.ts
|
|
5
5
|
var r = "l-notification", i = 4500, a = {};
|
|
6
6
|
function o(e) {
|
|
7
7
|
a = {
|
|
@@ -27,7 +27,7 @@ function l(e) {
|
|
|
27
27
|
let n = e ? [t(e)] : void 0, i = document.querySelectorAll(r);
|
|
28
28
|
for (let e of Array.from(i)) {
|
|
29
29
|
let t = e;
|
|
30
|
-
typeof t.close == "function" && (n
|
|
30
|
+
typeof t.close == "function" && (!n || n.includes(t.placement)) && t.close();
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
function u(e) {
|
|
@@ -53,5 +53,4 @@ var m = {
|
|
|
53
53
|
closeAll: l,
|
|
54
54
|
config: o
|
|
55
55
|
};
|
|
56
|
-
//#endregion
|
|
57
56
|
export { m as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/notification/placement.ts
|
|
2
2
|
var e = [
|
|
3
3
|
"topLeft",
|
|
4
4
|
"topRight",
|
|
@@ -44,5 +44,4 @@ function m(e) {
|
|
|
44
44
|
let n = o(e), r = n ? "top" : "bottom", i = n ? "bottom" : "top", s = 0;
|
|
45
45
|
for (let e of n ? t : [...t].reverse()) e.style.setProperty(r, `${e.notificationOffset + s}px`), e.style.removeProperty(i), s += e.offsetHeight + e.notificationGap;
|
|
46
46
|
}
|
|
47
|
-
//#endregion
|
|
48
47
|
export { i as DEFAULT_GAP, n as DEFAULT_OFFSET, t as DEFAULT_PLACEMENT, r as DEFAULT_ZINDEX, e as PLACEMENTS, l as findPlacement, u as getGroupSize, d as getOldestNotification, s as isLeftPlacement, o as isTopPlacement, m as layoutGroup, c as normalizePlacement, f as registerNotification, p as unregisterNotification };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import e from "./index.less_inline.js";
|
|
2
|
-
|
|
2
|
+
// src/components/notification/style.ts
|
|
3
3
|
var t = /* @__PURE__ */ (() => {
|
|
4
4
|
let t = new CSSStyleSheet();
|
|
5
5
|
return t.replaceSync(e), t;
|
|
6
6
|
})();
|
|
7
|
-
//#endregion
|
|
8
7
|
export { t as default };
|
package/lib/page_header/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { kebabToCamel as t, parseAttrValue as n } from "../utils/index.js";
|
|
|
3
3
|
import r from "./index.less_inline.js";
|
|
4
4
|
import { $$ as i, off as a, on as o, shouldEventNext as s } from "utilane/browser";
|
|
5
5
|
import { isBlank as c } from "utilane";
|
|
6
|
-
|
|
6
|
+
// src/components/page_header/index.ts
|
|
7
7
|
var l = class extends e {
|
|
8
8
|
static baseName = "page-header";
|
|
9
9
|
showLeft = !0;
|
|
@@ -96,5 +96,4 @@ var l = class extends e {
|
|
|
96
96
|
a(this.root, "click", this.#e);
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
//#endregion
|
|
100
99
|
export { l as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/page_header/index.less?inline
|
|
2
2
|
var e = ":host{box-sizing:border-box;height:var(--l-page-header-height,auto);align-items:center;display:flex;position:relative}.l-page-header-left,.l-page-header-right{z-index:1;flex:none;align-items:center;display:flex}.l-page-header-back{height:auto}.l-page-header-back::part(default){--l-btn-padding:5px 0}.l-page-header-content{align-items:center;line-height:1;display:flex}.l-page-header-title{font-size:16px;font-weight:600}.l-page-header-sub-title{color:#999;margin-left:10px;font-size:14px;font-weight:500}:host(.l-page-header-align-left) .l-page-header-left{margin-right:15px}:host(.l-page-header-align-left) .l-page-header-content{flex:1 0 auto}:host(.l-page-header-align-left) .l-page-header-right{margin-left:15px}:host(.l-page-header-align-center){justify-content:space-between}:host(.l-page-header-align-center) .l-page-header-content{justify-content:center;position:absolute;inset:0}:host(.l-page-header-align-center) .l-page-header-back::part(default){--l-btn-padding:8px 0;--l-btn-gap:0}:host(.l-page-header-border){border-bottom:1px solid var(--l-border-color,#dedede)}";
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as default };
|