litos-ui 0.23.1 → 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/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.js +22 -24
- package/lib/calendar/index.less_inline.js +1 -2
- package/lib/calendar/langs.js +1 -2
- 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.js +1 -2
- 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 -3
- 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 +91 -91
- package/lib/input/index.d.ts +14 -0
- package/lib/input/index.js +126 -31
- 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 +1 -0
- package/lib/input/style.js +5 -7
- 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 +2 -7
- package/lib/pagination/index.less_inline.js +1 -2
- 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 +19 -2
- package/lib/select/index.js +128 -74
- 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.js +1 -2
- 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 -6
- package/lib/utils/index.js +26 -6
- 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 +42 -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/locale.d.ts +0 -6
- package/lib/utils/locale.js +0 -34
- package/lib/utils/signal_types.d.ts +0 -5
package/lib/base.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Signal } from "./utils/signal_types";
|
|
2
1
|
export default class BaseComponent<T = Record<string, any>> extends HTMLElement {
|
|
3
2
|
static baseName: string;
|
|
4
3
|
/** 组件是否渲染完成, 是否已经调用 connectedCallback */
|
|
@@ -67,6 +66,8 @@ export default class BaseComponent<T = Record<string, any>> extends HTMLElement
|
|
|
67
66
|
*/
|
|
68
67
|
removeEvents(): void;
|
|
69
68
|
beforeDestroy(): void;
|
|
69
|
+
/** Keep a private child control's change event inside its shadow tree. */
|
|
70
|
+
protected keepChangeLocal(target: HTMLElement): void;
|
|
70
71
|
/**
|
|
71
72
|
* 触发自定义事件
|
|
72
73
|
* @param name 事件名称
|
|
@@ -74,5 +75,5 @@ export default class BaseComponent<T = Record<string, any>> extends HTMLElement
|
|
|
74
75
|
* @returns 是否成功触发事件
|
|
75
76
|
*/
|
|
76
77
|
emit(name: string, eventOption?: Partial<CustomEventInit>): boolean;
|
|
77
|
-
emitInject(name: string, callback: (context:
|
|
78
|
+
emitInject<Context>(name: string, callback: (context: Context) => void): void;
|
|
78
79
|
}
|
package/lib/base.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAttr as e } from "utilane/browser";
|
|
2
|
-
|
|
3
|
-
var t = class extends HTMLElement {
|
|
2
|
+
// src/components/base.ts
|
|
3
|
+
var t = /* @__PURE__ */ new WeakSet(), n = class extends HTMLElement {
|
|
4
4
|
static baseName = "base-component";
|
|
5
5
|
rendered;
|
|
6
6
|
_state;
|
|
@@ -94,12 +94,16 @@ var t = class extends HTMLElement {
|
|
|
94
94
|
afterInit() {}
|
|
95
95
|
removeEvents() {}
|
|
96
96
|
beforeDestroy() {}
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
keepChangeLocal(e) {
|
|
98
|
+
t.add(e);
|
|
99
|
+
}
|
|
100
|
+
emit(e, n) {
|
|
101
|
+
let r = {
|
|
99
102
|
bubbles: !0,
|
|
100
103
|
composed: !0,
|
|
101
|
-
...
|
|
102
|
-
}
|
|
104
|
+
...n
|
|
105
|
+
};
|
|
106
|
+
return e === "change" && t.has(this) && (r.composed = !1), this.dispatchEvent(new CustomEvent(e, r));
|
|
103
107
|
}
|
|
104
108
|
emitInject(e, t) {
|
|
105
109
|
this.emit(e, {
|
|
@@ -112,5 +116,4 @@ var t = class extends HTMLElement {
|
|
|
112
116
|
});
|
|
113
117
|
}
|
|
114
118
|
};
|
|
115
|
-
|
|
116
|
-
export { t as default };
|
|
119
|
+
export { n as default };
|
package/lib/button/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import BaseComponent from "../base";
|
|
2
|
+
import type { ButtonColor } from "../utils";
|
|
2
3
|
type ButtonState = {
|
|
3
4
|
loading: boolean;
|
|
4
5
|
htmlType: "submit" | "reset" | "button";
|
|
5
6
|
text: boolean;
|
|
6
7
|
ghost: boolean;
|
|
7
|
-
color?:
|
|
8
|
+
color?: ButtonColor;
|
|
8
9
|
height?: string;
|
|
9
10
|
disabled: boolean;
|
|
10
11
|
type: "normal" | "primary" | "normal-v2";
|
|
@@ -15,17 +16,27 @@ type ButtonState = {
|
|
|
15
16
|
};
|
|
16
17
|
export default class Button extends BaseComponent<ButtonState> {
|
|
17
18
|
static baseName: string;
|
|
19
|
+
static formAssociated: boolean;
|
|
18
20
|
$btn?: HTMLButtonElement;
|
|
21
|
+
private readonly internals?;
|
|
22
|
+
private readonly pendingActions;
|
|
23
|
+
private formDisabled;
|
|
19
24
|
constructor();
|
|
25
|
+
get form(): HTMLFormElement | null;
|
|
20
26
|
get disabled(): boolean;
|
|
21
27
|
set disabled(value: boolean);
|
|
28
|
+
/** 自定义颜色对象;不再读取 HTML color attribute。 */
|
|
29
|
+
get color(): ButtonColor | undefined;
|
|
30
|
+
set color(value: ButtonColor | undefined);
|
|
31
|
+
/** 替换颜色变量,传入 undefined 或空对象恢复默认配色。 */
|
|
32
|
+
setColor(value?: ButtonColor): void;
|
|
22
33
|
setLoading(loading: boolean): void;
|
|
23
34
|
setDisabled(value: boolean): void;
|
|
24
35
|
static get observedAttributes(): string[];
|
|
25
36
|
protected attributeChanged(name: string, _oldValue: string, newValue: string): void;
|
|
26
37
|
protected updateDOM(changedProps: Set<string>): void;
|
|
27
38
|
connectedCallback(): void;
|
|
28
|
-
|
|
39
|
+
beforeDestroy(): void;
|
|
29
40
|
isFormButton(): boolean;
|
|
30
41
|
getHtmlType(): "submit" | "reset" | "button";
|
|
31
42
|
render_v2(): {
|
|
@@ -34,10 +45,15 @@ export default class Button extends BaseComponent<ButtonState> {
|
|
|
34
45
|
};
|
|
35
46
|
afterInit(): void;
|
|
36
47
|
render(): HTMLButtonElement;
|
|
37
|
-
|
|
38
|
-
|
|
48
|
+
click(): void;
|
|
49
|
+
focus(options?: FocusOptions): void;
|
|
50
|
+
blur(): void;
|
|
51
|
+
formDisabledCallback(disabled: boolean): void;
|
|
52
|
+
private syncDisabled;
|
|
53
|
+
private syncAccessibleAttribute;
|
|
54
|
+
private updateLoading;
|
|
55
|
+
private handleFormClick;
|
|
39
56
|
private _updateHeight;
|
|
40
57
|
private _resetBtnClass;
|
|
41
|
-
private _handleClick;
|
|
42
58
|
}
|
|
43
59
|
export {};
|
package/lib/button/index.js
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
import e from "../
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { parseAttrValue as e, unitNumberStr as t } from "../utils/index.js";
|
|
2
|
+
import n from "../base.js";
|
|
3
|
+
import r from "./style.js";
|
|
4
|
+
import { requestSubmitFromButton as i } from "../form/owner.js";
|
|
5
|
+
import { formatClass as a, formatStyle as o } from "utilane/browser";
|
|
6
|
+
// src/components/button/index.ts
|
|
7
|
+
var s = [
|
|
8
|
+
"aria-label",
|
|
9
|
+
"aria-labelledby",
|
|
10
|
+
"aria-describedby"
|
|
11
|
+
], c = class extends n {
|
|
9
12
|
static baseName = "button";
|
|
13
|
+
static formAssociated = !0;
|
|
10
14
|
$btn;
|
|
15
|
+
internals;
|
|
16
|
+
pendingActions = /* @__PURE__ */ new Set();
|
|
17
|
+
formDisabled = !1;
|
|
11
18
|
constructor() {
|
|
12
|
-
super(), this.version = 2, this._state = {
|
|
19
|
+
super(), this.internals = this.attachInternals?.(), this.version = 2, this._state = {
|
|
13
20
|
loading: !1,
|
|
14
21
|
htmlType: "button",
|
|
15
22
|
text: !1,
|
|
@@ -22,22 +29,37 @@ var m = class extends e {
|
|
|
22
29
|
boxShadow: "box-shadow-none"
|
|
23
30
|
};
|
|
24
31
|
}
|
|
32
|
+
get form() {
|
|
33
|
+
return this.internals?.form ?? null;
|
|
34
|
+
}
|
|
25
35
|
get disabled() {
|
|
26
36
|
return this._state.disabled;
|
|
27
37
|
}
|
|
28
38
|
set disabled(e) {
|
|
29
39
|
this.setDisabled(e);
|
|
30
40
|
}
|
|
41
|
+
get color() {
|
|
42
|
+
return this._state.color;
|
|
43
|
+
}
|
|
44
|
+
set color(e) {
|
|
45
|
+
this.setColor(e);
|
|
46
|
+
}
|
|
47
|
+
setColor(e) {
|
|
48
|
+
let t = this._state.color;
|
|
49
|
+
if (this._state.color = e, !this.$btn) return;
|
|
50
|
+
for (let e of Object.keys(t || {})) this.$btn.style.removeProperty(e);
|
|
51
|
+
let n = o(e || {});
|
|
52
|
+
n && (this.$btn.style.cssText += n);
|
|
53
|
+
}
|
|
31
54
|
setLoading(e) {
|
|
32
|
-
this
|
|
55
|
+
this._state.loading = e, this.syncDisabled(), this.updateLoading();
|
|
33
56
|
}
|
|
34
57
|
setDisabled(e) {
|
|
35
|
-
this._state.disabled = e, this
|
|
58
|
+
this._state.disabled = e, this.hasAttribute("disabled") !== e && this.toggleAttribute("disabled", e), this.syncDisabled();
|
|
36
59
|
}
|
|
37
60
|
static get observedAttributes() {
|
|
38
61
|
return [
|
|
39
62
|
"loading",
|
|
40
|
-
"color",
|
|
41
63
|
"text",
|
|
42
64
|
"ghost",
|
|
43
65
|
"disabled",
|
|
@@ -47,43 +69,57 @@ var m = class extends e {
|
|
|
47
69
|
"shape",
|
|
48
70
|
"loading-text",
|
|
49
71
|
"size",
|
|
50
|
-
"box-shadow"
|
|
72
|
+
"box-shadow",
|
|
73
|
+
...s
|
|
51
74
|
];
|
|
52
75
|
}
|
|
53
|
-
attributeChanged(
|
|
54
|
-
switch (
|
|
55
|
-
case "color":
|
|
76
|
+
attributeChanged(n, r, i) {
|
|
77
|
+
switch (n) {
|
|
56
78
|
case "shape":
|
|
57
79
|
case "type":
|
|
58
80
|
case "size":
|
|
59
|
-
this._state[
|
|
81
|
+
this._state[n] = i;
|
|
60
82
|
break;
|
|
61
83
|
case "height":
|
|
62
|
-
this._state[
|
|
84
|
+
this._state[n] = t(i);
|
|
63
85
|
break;
|
|
64
86
|
case "text":
|
|
65
87
|
case "ghost":
|
|
88
|
+
this._state[n] = e(i, !1, n);
|
|
89
|
+
break;
|
|
66
90
|
case "disabled":
|
|
91
|
+
this.setDisabled(e(i, !1, n));
|
|
92
|
+
break;
|
|
67
93
|
case "loading":
|
|
68
|
-
this._state[
|
|
94
|
+
this._state[n] = e(i, !1, n), this.syncDisabled();
|
|
69
95
|
break;
|
|
70
96
|
case "html-type":
|
|
97
|
+
this._state.htmlType = i === "submit" || i === "reset" ? i : "button", this.$btn && (this.$btn.type = this._state.htmlType);
|
|
98
|
+
break;
|
|
71
99
|
case "loading-text":
|
|
72
|
-
this._state
|
|
100
|
+
this._state.loadingText = i ?? "加载中……";
|
|
73
101
|
break;
|
|
74
102
|
case "box-shadow":
|
|
75
|
-
let
|
|
76
|
-
this._state.boxShadow = `box-shadow${
|
|
103
|
+
let r = e(i, !1, "box-shadow");
|
|
104
|
+
this._state.boxShadow = `box-shadow${r ? "" : "-none"}`;
|
|
105
|
+
break;
|
|
106
|
+
default: this.syncAccessibleAttribute(n);
|
|
77
107
|
}
|
|
78
108
|
}
|
|
79
109
|
updateDOM(e) {
|
|
80
|
-
this.$btn && (
|
|
110
|
+
this.$btn && (this.$btn.className = this._resetBtnClass()), (e.has("loading") || e.has("loading-text")) && this.updateLoading(), e.has("height") && this._updateHeight();
|
|
81
111
|
}
|
|
82
112
|
connectedCallback() {
|
|
83
|
-
|
|
113
|
+
if (Object.hasOwn(this, "disabled")) {
|
|
114
|
+
let e = this.disabled;
|
|
115
|
+
Reflect.deleteProperty(this, "disabled"), this.disabled = e;
|
|
116
|
+
}
|
|
117
|
+
super.connectedCallback();
|
|
84
118
|
}
|
|
85
|
-
|
|
86
|
-
|
|
119
|
+
beforeDestroy() {
|
|
120
|
+
this.removeEventListener("click", this.handleFormClick);
|
|
121
|
+
for (let e of this.pendingActions) window.clearTimeout(e);
|
|
122
|
+
this.pendingActions.clear(), this.$btn = void 0;
|
|
87
123
|
}
|
|
88
124
|
isFormButton() {
|
|
89
125
|
let e = this.getHtmlType();
|
|
@@ -94,43 +130,68 @@ var m = class extends e {
|
|
|
94
130
|
}
|
|
95
131
|
render_v2() {
|
|
96
132
|
return this._changedProperties.clear(), {
|
|
97
|
-
styleSheets: [
|
|
133
|
+
styleSheets: [r],
|
|
98
134
|
template: this.render()
|
|
99
135
|
};
|
|
100
136
|
}
|
|
101
137
|
afterInit() {
|
|
102
|
-
this
|
|
138
|
+
this.classList.add(`l-btn-${this._state.size || "default"}`), this.$btn = this.root.querySelector("button") ?? void 0;
|
|
139
|
+
for (let e of s) this.syncAccessibleAttribute(e);
|
|
140
|
+
this.updateLoading(), this._updateHeight(), this.addEventListener("click", this.handleFormClick);
|
|
103
141
|
}
|
|
104
142
|
render() {
|
|
105
|
-
let e =
|
|
106
|
-
e.className = this._resetBtnClass(),
|
|
107
|
-
let
|
|
108
|
-
return
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
143
|
+
let e = this.ownerDocument.createElement("button");
|
|
144
|
+
e.className = this._resetBtnClass(), e.disabled = this.disabled || this._state.loading || this.formDisabled, e.type = this.getHtmlType(), e.setAttribute("part", "default");
|
|
145
|
+
let t = o(this._state.color || {});
|
|
146
|
+
return t && (e.style.cssText = t), e;
|
|
147
|
+
}
|
|
148
|
+
click() {
|
|
149
|
+
this.$btn ? this.$btn.click() : super.click();
|
|
150
|
+
}
|
|
151
|
+
focus(e) {
|
|
152
|
+
this.$btn?.focus(e);
|
|
153
|
+
}
|
|
154
|
+
blur() {
|
|
155
|
+
this.$btn?.blur();
|
|
156
|
+
}
|
|
157
|
+
formDisabledCallback(e) {
|
|
158
|
+
this.formDisabled = e, this.syncDisabled();
|
|
159
|
+
}
|
|
160
|
+
syncDisabled() {
|
|
161
|
+
this.$btn && (this.$btn.disabled = this.disabled || this._state.loading || this.formDisabled);
|
|
162
|
+
}
|
|
163
|
+
syncAccessibleAttribute(e) {
|
|
164
|
+
let t = this.$btn;
|
|
165
|
+
if (!t) return;
|
|
166
|
+
let n = this.getAttribute(e);
|
|
167
|
+
n === null ? t.removeAttribute(e) : t.setAttribute(e, n);
|
|
168
|
+
}
|
|
169
|
+
updateLoading() {
|
|
170
|
+
let e = this.$btn;
|
|
171
|
+
if (!e) return;
|
|
172
|
+
let { loading: t, loadingText: n } = this._state;
|
|
173
|
+
e.classList.toggle("l-btn-loading", t);
|
|
174
|
+
let r = this.ownerDocument.createElement(t && n ? "span" : "slot");
|
|
175
|
+
if (t) {
|
|
176
|
+
let t = this.ownerDocument.createElement("l-loading-icon");
|
|
177
|
+
t.className = "l-btn-spinner", t.setAttribute("aria-hidden", "true"), n && (r.textContent = n), e.replaceChildren(t, r);
|
|
178
|
+
} else e.replaceChildren(r);
|
|
179
|
+
}
|
|
180
|
+
handleFormClick = (e) => {
|
|
181
|
+
let t = this.$btn, n = this.getHtmlType();
|
|
182
|
+
if (!t || t.disabled || n === "button" || e.defaultPrevented) return;
|
|
183
|
+
let r = window.setTimeout(() => {
|
|
184
|
+
if (this.pendingActions.delete(r), e.defaultPrevented || this.$btn !== t || t.disabled || n !== this.getHtmlType()) return;
|
|
185
|
+
let a = this.form;
|
|
186
|
+
a && (n === "submit" ? i(a, this) : HTMLFormElement.prototype.reset.call(a));
|
|
187
|
+
}, 0);
|
|
188
|
+
this.pendingActions.add(r);
|
|
189
|
+
};
|
|
129
190
|
_updateHeight() {
|
|
130
191
|
this._state.height ? this.style.setProperty("--l-btn-height", this._state.height) : this.style.removeProperty("--l-btn-height");
|
|
131
192
|
}
|
|
132
193
|
_resetBtnClass() {
|
|
133
|
-
return
|
|
194
|
+
return a([
|
|
134
195
|
"l-btn",
|
|
135
196
|
`l-btn-${this._state.type}`,
|
|
136
197
|
`l-btn-${this._state.shape}`,
|
|
@@ -140,13 +201,5 @@ var m = class extends e {
|
|
|
140
201
|
this._state.loading ? "l-btn-loading" : ""
|
|
141
202
|
]);
|
|
142
203
|
}
|
|
143
|
-
_handleClick = () => {
|
|
144
|
-
(this._state.htmlType === "reset" || this._state.htmlType === "submit") && this.emit("form-action", {
|
|
145
|
-
bubbles: !0,
|
|
146
|
-
composed: !0,
|
|
147
|
-
detail: this._state.htmlType
|
|
148
|
-
});
|
|
149
|
-
};
|
|
150
204
|
};
|
|
151
|
-
|
|
152
|
-
export { m as default };
|
|
205
|
+
export { c as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
var e = ":host{--l-btn-padding:0 15px;--l-btn-text-color
|
|
3
|
-
//#endregion
|
|
1
|
+
// src/components/button/index.less?inline
|
|
2
|
+
var e = ":host{--l-btn-padding:0 15px;--l-btn-text-color:var(--l-primary-contrast-color,#fff);--l-btn-hover-text-color:var(--l-btn-text-color);--l-btn-active-text-color:var(--l-btn-text-color);--l-btn-border-color:var(--l-primary-color,#722ed1);--l-btn-background:var(--l-btn-border-color);--l-btn-hover-border-color:var(--l-primary-color-light1,#9254de);--l-btn-hover-background:var(--l-btn-hover-border-color);--l-btn-active-border-color:var(--l-primary-color-dark1,#531dab);--l-btn-active-background:var(--l-btn-active-border-color);--l-btn-disabled-color:#c9c9c9;--l-btn-disabled-background:#fbfbfb;--l-btn-disabled-border-color:#e6e6e6;--l-btn-height:var(--l-form-control-height,32px);width:auto;height:var(--l-btn-height);text-indent:0;box-sizing:border-box;display:inline-flex}:host([block]){width:100%}:host(.l-btn-small){--l-btn-height:24px;--l-btn-padding:0 7px}:host(.l-btn-large){--l-border-radius:6px;--l-btn-height:40px;--l-btn-padding:0 15px;font-size:16px}.l-btn{cursor:pointer;box-sizing:border-box;vertical-align:middle;width:100%;padding:var(--l-btn-padding);border-radius:var(--l-border-radius,3px);height:100%;color:var(--l-btn-text-color);background:var(--l-btn-background);border:1px solid var(--l-btn-border-color);justify-content:center;align-items:center;gap:var(--l-btn-gap,5px);line-height:1;font-size:inherit;transition:border-color .3s,background-color .3s,color .3s;display:inline-flex;position:relative}.l-btn:hover{border-color:var(--l-btn-hover-border-color,var(--l-btn-hover-background));color:var(--l-btn-hover-text-color);background:var(--l-btn-hover-background)}.l-btn-box-shadow:hover{box-shadow:0 4px 12px var(--l-primary-color-light4)}.l-btn:focus-visible{outline:2px solid var(--l-primary-color,#722ed1);outline-offset:2px}.l-btn:active{border-color:var(--l-btn-active-border-color,var(--l-btn-active-background));color:var(--l-btn-active-text-color);background:var(--l-btn-active-background)}.l-btn-normal,.l-btn-normal-v2{--l-btn-text-color:auto;--l-btn-background:transparent;--l-btn-border-color:#d9d9d9;--l-btn-hover-text-color:var(--l-primary-color-light1,#9254de);--l-btn-active-text-color:var(--l-primary-color-dark1,#531dab);--l-btn-hover-background:transparent;--l-btn-active-background:transparent;--l-btn-hover-border-color:var(--l-btn-hover-text-color);--l-btn-active-border-color:var(--l-btn-active-text-color)}.l-btn-normal-v2{--l-btn-hover-background:var(--l-primary-color-light5);--l-btn-active-background:var(--l-primary-color-light4)}.l-btn-primary{--l-btn-background:var(--l-primary-color,#722ed1);--l-btn-hover-background:var(--l-primary-color-light1,#9254de);--l-btn-active-background:var(--l-primary-color-dark1,#531dab);--l-btn-disabled-border-color:var(--l-primary-color-light2,#b37feb);--l-btn-disabled-background:var(--l-primary-color-light2,#b37feb);--l-btn-disabled-color:var(--l-primary-contrast-color,#fff)}.l-btn:disabled{border-color:var(--l-btn-disabled-border-color);background:var(--l-btn-disabled-background);color:var(--l-btn-disabled-color);cursor:not-allowed;opacity:1}.l-btn.l-btn-loading{cursor:default}.l-btn-text{--l-btn-background:transparent;--l-btn-border-color:transparent;--l-btn-hover-border-color:transparent;--l-btn-active-border-color:transparent;--l-btn-disabled-background:transparent;--l-btn-disabled-border-color:transparent;--l-btn-hover-background:transparent;--l-btn-active-background:transparent;--l-btn-padding:5px}.l-btn-primary.l-btn-text{--l-btn-text-color:var(--l-primary-color,#722ed1);--l-btn-hover-text-color:var(--l-primary-color-light1,#9254de);--l-btn-active-text-color:var(--l-primary-color-dark1,#531dab)}.l-btn-ghost{--l-btn-text-color:var(--l-btn-border-color);--l-btn-background:transparent;--l-btn-hover-background:transparent;--l-btn-active-background:transparent;--l-btn-hover-text-color:var(--l-btn-hover-border-color);--l-btn-active-text-color:var(--l-btn-active-border-color)}.l-btn-round{border-radius:calc(var(--l-form-control-height,32px) / 2)}.l-btn-circle{width:var(--l-form-control-height,32px);border-radius:50%;padding:0}html.dark .l-btn:disabled{--l-btn-disabled-background:#ffffff14;--l-btn-disabled-color:#ffffff4d;--l-btn-disabled-border-color:#ffffff4d}.l-btn>.l-btn-spinner{animation:1.5s linear infinite l-btn-spin}@keyframes l-btn-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.l-btn>.l-btn-spinner{animation:none}}";
|
|
4
3
|
export { e as default };
|
package/lib/button/style.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import e from "./index.less_inline.js";
|
|
2
|
-
|
|
2
|
+
// src/components/button/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/calendar/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import e from "../
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import r from "
|
|
5
|
-
import {
|
|
6
|
-
import { $one as a, hasClass as o, off as s, on as c, shouldEventNext as l } from "utilane/browser";
|
|
1
|
+
import { parseAttrValue as e } from "../utils/index.js";
|
|
2
|
+
import t from "./index.less_inline.js";
|
|
3
|
+
import { langs as n } from "./langs.js";
|
|
4
|
+
import r from "../base.js";
|
|
5
|
+
import { $one as i, getLocale as a, hasClass as o, off as s, on as c, shouldEventNext as l } from "utilane/browser";
|
|
7
6
|
import { endOf as u, format as d, startOf as f, timestamp as p } from "utilane";
|
|
8
|
-
|
|
9
|
-
var m = class extends
|
|
7
|
+
// src/components/calendar/index.ts
|
|
8
|
+
var m = class extends r {
|
|
10
9
|
static baseName = "calendar";
|
|
11
10
|
_langData;
|
|
12
11
|
$container;
|
|
@@ -23,10 +22,10 @@ var m = class extends e {
|
|
|
23
22
|
year: t.getFullYear(),
|
|
24
23
|
type: "select",
|
|
25
24
|
month: t.getMonth()
|
|
26
|
-
}, this._langData =
|
|
25
|
+
}, this._langData = n[e], this._selectDates = /* @__PURE__ */ new Set(), this._range = [0, 0];
|
|
27
26
|
}
|
|
28
27
|
_resolveLocale(e) {
|
|
29
|
-
return
|
|
28
|
+
return a(e).split("-")[0] === "en" ? "en-US" : "zh-CN";
|
|
30
29
|
}
|
|
31
30
|
get value() {
|
|
32
31
|
return this._value;
|
|
@@ -41,7 +40,7 @@ var m = class extends e {
|
|
|
41
40
|
this._state.type === "range" ? (this._range = this._value ? this._value.split(",").map((e) => /^\d+$/.test(e) ? e.length === 10 ? Number(e) * 1e3 : Number(e) : p(e, "ms")) : [0, 0], this._selectDates.clear()) : (this._selectDates = new Set(this._value.split("&")), this._range = [0, 0]), this.batchUpdate();
|
|
42
41
|
}
|
|
43
42
|
afterInit() {
|
|
44
|
-
this.$container =
|
|
43
|
+
this.$container = i(".calendar-table", this.root), c(this.root, "click", this.handleCellClick), c(this.$container, "mouseover", this.handleCellHover);
|
|
45
44
|
}
|
|
46
45
|
beforeDestroy() {
|
|
47
46
|
s(this.root, "click", this.handleCellClick), this.$container &&= (s(this.$container, "mouseover", this.handleCellHover), void 0);
|
|
@@ -74,27 +73,27 @@ var m = class extends e {
|
|
|
74
73
|
isActiveMonth: !o(e, "excluded")
|
|
75
74
|
} });
|
|
76
75
|
}
|
|
77
|
-
attributeChanged(
|
|
78
|
-
switch (
|
|
76
|
+
attributeChanged(t, r, i) {
|
|
77
|
+
switch (t) {
|
|
79
78
|
case "locale":
|
|
80
|
-
this._state.locale = this._resolveLocale(
|
|
79
|
+
this._state.locale = this._resolveLocale(i), this._langData = n[this._state.locale];
|
|
81
80
|
break;
|
|
82
81
|
case "min-date":
|
|
83
|
-
this._state.minDate = f(
|
|
82
|
+
this._state.minDate = f(i).getTime();
|
|
84
83
|
break;
|
|
85
84
|
case "max-date":
|
|
86
|
-
this._state.maxDate = u(
|
|
85
|
+
this._state.maxDate = u(i).getTime();
|
|
87
86
|
break;
|
|
88
87
|
case "year":
|
|
89
|
-
this._state.year =
|
|
88
|
+
this._state.year = e(i, this._state.year);
|
|
90
89
|
break;
|
|
91
90
|
case "month":
|
|
92
|
-
this._state.month =
|
|
91
|
+
this._state.month = e(i, this._state.month + 1) - 1;
|
|
93
92
|
break;
|
|
94
93
|
case "type":
|
|
95
|
-
this._state.type =
|
|
94
|
+
this._state.type = i, this._updateValue();
|
|
96
95
|
break;
|
|
97
|
-
case "value": this.setValue(
|
|
96
|
+
case "value": this.setValue(i);
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
99
|
updateDOM(e) {
|
|
@@ -120,13 +119,13 @@ var m = class extends e {
|
|
|
120
119
|
}
|
|
121
120
|
rerenderHeader() {
|
|
122
121
|
if (this.$container) {
|
|
123
|
-
let e =
|
|
122
|
+
let e = i("thead", this.$container);
|
|
124
123
|
e.innerHTML = this._renderHeader();
|
|
125
124
|
}
|
|
126
125
|
}
|
|
127
126
|
rerenderBody() {
|
|
128
127
|
if (this.$container) {
|
|
129
|
-
let e =
|
|
128
|
+
let e = i("tbody", this.$container);
|
|
130
129
|
e.innerHTML = this._renderBody();
|
|
131
130
|
}
|
|
132
131
|
}
|
|
@@ -136,9 +135,8 @@ var m = class extends e {
|
|
|
136
135
|
render_v2() {
|
|
137
136
|
return {
|
|
138
137
|
template: `<table class="calendar-table" l-day="__stop__">${this.rerender()}</table>`,
|
|
139
|
-
style: [
|
|
138
|
+
style: [t]
|
|
140
139
|
};
|
|
141
140
|
}
|
|
142
141
|
};
|
|
143
|
-
//#endregion
|
|
144
142
|
export { m as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/calendar/index.less?inline
|
|
2
2
|
var e = ":host{box-sizing:border-box;width:100%;height:100%;display:block}.calendar-table{border-collapse:collapse;table-layout:fixed;width:100%;height:100%}.calendar-table thead{height:var(--l-calendar-header-height,32px)}.calendar-table th{cursor:default;font-weight:400}.calendar-table .excluded{color:var(--l-calendar-off-text-color,#a8abb2)}.day{text-align:center;cursor:pointer;font-size:14px;transition:background-color .2s}:where(.day:hover){background-color:#0000000a}.day.disabled{color:var(--l-calendar-off-text-color,#a8abb2);cursor:not-allowed}.day.active:not(.disabled){background-color:var(--l-primary-color,#007bff);color:#fff;font-weight:700}.day.today{color:var(--l-primary-color,#007bff)}.day.range{background-color:var(--l-primary-color-light4,#cce6ff)}.day.range-start,.day.range-end{background-color:var(--l-primary-color,#007bff);color:#fff}";
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as default };
|
package/lib/calendar/langs.js
CHANGED
package/lib/card/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import e from "../
|
|
2
|
-
import
|
|
1
|
+
import { kebabToCamel as e, parseAttrValue as t } from "../utils/index.js";
|
|
2
|
+
import n from "../base.js";
|
|
3
3
|
import r from "./index.less_inline.js";
|
|
4
4
|
import { $$ as i } from "utilane/browser";
|
|
5
|
-
|
|
6
|
-
var a = class extends
|
|
5
|
+
// src/components/card/index.ts
|
|
6
|
+
var a = class extends n {
|
|
7
7
|
static baseName = "card";
|
|
8
8
|
constructor() {
|
|
9
9
|
super(), this.version = 2, this._state = {
|
|
@@ -21,14 +21,14 @@ var a = class extends e {
|
|
|
21
21
|
"show-footer"
|
|
22
22
|
];
|
|
23
23
|
}
|
|
24
|
-
attributeChanged(
|
|
25
|
-
switch (
|
|
24
|
+
attributeChanged(n, r, i) {
|
|
25
|
+
switch (n) {
|
|
26
26
|
case "header-text":
|
|
27
27
|
case "footer-text":
|
|
28
|
-
this._state[
|
|
28
|
+
this._state[e(n)] = i;
|
|
29
29
|
break;
|
|
30
30
|
case "show-header":
|
|
31
|
-
case "show-footer": this._state[
|
|
31
|
+
case "show-footer": this._state[e(n)] = t(i, !1, n);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
render_v2() {
|
|
@@ -60,5 +60,4 @@ var a = class extends e {
|
|
|
60
60
|
return e;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
//#endregion
|
|
64
63
|
export { a as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/card/index.less?inline
|
|
2
2
|
var e = ":host{border:1px solid var(--l-card-border-color,var(--l-border-color,#e8e8e8));background-color:var(--l-card-bg,#fff);color:var(--l-card-text-color,#333);border-radius:4px;display:block;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a}.l-card__header{border-bottom:1px solid var(--l-card-border-color,var(--l-border-color,#e8e8e8));box-sizing:border-box;justify-content:space-between;align-items:center;padding:15px;display:flex}.l-card__footer{border-top:1px solid var(--l-card-border-color,var(--l-border-color,#e8e8e8));box-sizing:border-box;padding:15px}.l-card__body{padding:15px}.l-header-extra:empty{display:none}";
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as default };
|
package/lib/carousel/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import e from "../base.js";
|
|
2
|
-
import
|
|
3
|
-
import n from "
|
|
2
|
+
import t from "./index.less_inline.js";
|
|
3
|
+
import { parseAttrValue as n } from "../utils/index.js";
|
|
4
4
|
import r from "./timer.js";
|
|
5
5
|
import { $ as i, $$ as a, $one as o, debounce as s, getAttr as c, iterate as l, off as u, on as d, shouldEventNext as f } from "utilane/browser";
|
|
6
|
-
|
|
6
|
+
// src/components/carousel/index.ts
|
|
7
7
|
var p = class extends e {
|
|
8
8
|
static baseName = "carousel";
|
|
9
9
|
arrows = "hover";
|
|
@@ -27,10 +27,10 @@ var p = class extends e {
|
|
|
27
27
|
"autoplay"
|
|
28
28
|
];
|
|
29
29
|
}
|
|
30
|
-
attributeChangedCallback(e,
|
|
30
|
+
attributeChangedCallback(e, t, r) {
|
|
31
31
|
switch (e) {
|
|
32
32
|
case "arrows":
|
|
33
|
-
let e =
|
|
33
|
+
let e = n(r, "hover");
|
|
34
34
|
if (e !== this.arrows) {
|
|
35
35
|
this.arrows = e;
|
|
36
36
|
let t = document.createDocumentFragment();
|
|
@@ -38,19 +38,19 @@ var p = class extends e {
|
|
|
38
38
|
}
|
|
39
39
|
break;
|
|
40
40
|
case "loop":
|
|
41
|
-
this.loop =
|
|
41
|
+
this.loop = n(r, !1, "loop");
|
|
42
42
|
break;
|
|
43
43
|
case "current-index":
|
|
44
|
-
let
|
|
45
|
-
|
|
44
|
+
let t = n(r, 0);
|
|
45
|
+
t !== this.currentIndex && this.#h(this.loop ? t + 1 : t);
|
|
46
46
|
break;
|
|
47
47
|
case "autoplay":
|
|
48
|
-
let i =
|
|
48
|
+
let i = n(r, !1, "autoplay");
|
|
49
49
|
i !== this.autoplay && (this.autoplay = i, this.#t && (i ? this.#t.start() : this.#t.stop()));
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
connectedCallback() {
|
|
53
|
-
this.loadStyleText(
|
|
53
|
+
this.loadStyleText(t), this.style.setProperty("--carousel-width", `${Math.floor(this.clientWidth)}px`);
|
|
54
54
|
let e = c(this, "height");
|
|
55
55
|
e && this.style.setProperty("height", `${e}px`), this.#d(), super.connectedCallback();
|
|
56
56
|
}
|
|
@@ -253,5 +253,4 @@ var p = class extends e {
|
|
|
253
253
|
this.#r && (this.#r = !1, this.#y(), this.#C());
|
|
254
254
|
};
|
|
255
255
|
};
|
|
256
|
-
//#endregion
|
|
257
256
|
export { p as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/carousel/index.less?inline
|
|
2
2
|
var e = ":host{box-sizing:border-box;width:100%;height:180px;margin:0 auto;display:block;position:relative;overflow:hidden}.container{box-sizing:border-box;min-width:900%;height:100%;display:flex;position:relative}.nav-button{cursor:pointer;z-index:20;color:#fff;background-color:#292d3d4d;border:none;border-radius:50%;outline:none;justify-content:center;align-items:center;width:30px;height:30px;margin:0;padding:0;font-size:16px;transition:background-color .3s;display:flex;position:absolute;top:50%;transform:translateY(-50%)}.nav-button:hover{background-color:#292d3d66}.nav-button:active{background-color:#292d3d80}.nav-prev{left:20px}.nav-next{right:20px}.pagination{z-index:2;justify-content:center;align-items:center;gap:8px;width:100%;display:flex;position:absolute;bottom:10px;left:0}.bullet{cursor:pointer;background-color:#0000004d;border-radius:50%;width:8px;height:8px;transition:background-color .3s;display:inline-block}.bullet.active{background-color:var(--l-primary-color,#722ed1)}";
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as default };
|