@lynx-js/web-elements 0.2.4
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/CHANGELOG.md +323 -0
- package/LICENSE.txt +202 -0
- package/Notice.txt +1 -0
- package/README.md +47 -0
- package/dist/LynxWrapper/LynxWrapper.d.ts +2 -0
- package/dist/LynxWrapper/LynxWrapper.js +27 -0
- package/dist/LynxWrapper/index.d.ts +1 -0
- package/dist/LynxWrapper/index.js +2 -0
- package/dist/ScrollView/FadeEdgeLengthAttribute.d.ts +10 -0
- package/dist/ScrollView/FadeEdgeLengthAttribute.js +43 -0
- package/dist/ScrollView/ScrollAttributes.d.ts +8 -0
- package/dist/ScrollView/ScrollAttributes.js +83 -0
- package/dist/ScrollView/ScrollIntoView.d.ts +9 -0
- package/dist/ScrollView/ScrollIntoView.js +71 -0
- package/dist/ScrollView/ScrollView.d.ts +31 -0
- package/dist/ScrollView/ScrollView.js +185 -0
- package/dist/ScrollView/ScrollViewEvents.d.ts +9 -0
- package/dist/ScrollView/ScrollViewEvents.js +146 -0
- package/dist/ScrollView/index.d.ts +1 -0
- package/dist/ScrollView/index.js +2 -0
- package/dist/XAudioTT/XAudioAttribute.d.ts +7 -0
- package/dist/XAudioTT/XAudioAttribute.js +93 -0
- package/dist/XAudioTT/XAudioEvents.d.ts +8 -0
- package/dist/XAudioTT/XAudioEvents.js +116 -0
- package/dist/XAudioTT/XAudioTT.d.ts +46 -0
- package/dist/XAudioTT/XAudioTT.js +183 -0
- package/dist/XAudioTT/index.d.ts +1 -0
- package/dist/XAudioTT/index.js +2 -0
- package/dist/XAudioTT/utils.d.ts +19 -0
- package/dist/XAudioTT/utils.js +66 -0
- package/dist/XCanvas/CanvasAttributes.d.ts +12 -0
- package/dist/XCanvas/CanvasAttributes.js +78 -0
- package/dist/XCanvas/XCanvas.d.ts +5 -0
- package/dist/XCanvas/XCanvas.js +32 -0
- package/dist/XCanvas/index.d.ts +1 -0
- package/dist/XCanvas/index.js +2 -0
- package/dist/XFoldViewNg/XFoldviewHeaderNg.d.ts +2 -0
- package/dist/XFoldViewNg/XFoldviewHeaderNg.js +32 -0
- package/dist/XFoldViewNg/XFoldviewHeaderNgFeatures.d.ts +9 -0
- package/dist/XFoldViewNg/XFoldviewHeaderNgFeatures.js +32 -0
- package/dist/XFoldViewNg/XFoldviewNg.d.ts +11 -0
- package/dist/XFoldViewNg/XFoldviewNg.js +52 -0
- package/dist/XFoldViewNg/XFoldviewNgEvents.d.ts +7 -0
- package/dist/XFoldViewNg/XFoldviewNgEvents.js +55 -0
- package/dist/XFoldViewNg/XFoldviewSlotDragNg.d.ts +2 -0
- package/dist/XFoldViewNg/XFoldviewSlotDragNg.js +30 -0
- package/dist/XFoldViewNg/XFoldviewSlotNg.d.ts +2 -0
- package/dist/XFoldViewNg/XFoldviewSlotNg.js +32 -0
- package/dist/XFoldViewNg/XFoldviewSlotNgTouchEventsHandler.d.ts +7 -0
- package/dist/XFoldViewNg/XFoldviewSlotNgTouchEventsHandler.js +105 -0
- package/dist/XFoldViewNg/XFoldviewToolbarNg.d.ts +2 -0
- package/dist/XFoldViewNg/XFoldviewToolbarNg.js +30 -0
- package/dist/XFoldViewNg/index.d.ts +5 -0
- package/dist/XFoldViewNg/index.js +6 -0
- package/dist/XImage/DropShadow.d.ts +6 -0
- package/dist/XImage/DropShadow.js +30 -0
- package/dist/XImage/FilterImage.d.ts +2 -0
- package/dist/XImage/FilterImage.js +31 -0
- package/dist/XImage/ImageEvents.d.ts +6 -0
- package/dist/XImage/ImageEvents.js +68 -0
- package/dist/XImage/ImageSrc.d.ts +7 -0
- package/dist/XImage/ImageSrc.js +61 -0
- package/dist/XImage/XImage.d.ts +2 -0
- package/dist/XImage/XImage.js +30 -0
- package/dist/XImage/index.d.ts +2 -0
- package/dist/XImage/index.js +3 -0
- package/dist/XInput/InputBaseAttributes.d.ts +9 -0
- package/dist/XInput/InputBaseAttributes.js +99 -0
- package/dist/XInput/Placeholder.d.ts +6 -0
- package/dist/XInput/Placeholder.js +60 -0
- package/dist/XInput/XInput.d.ts +28 -0
- package/dist/XInput/XInput.js +129 -0
- package/dist/XInput/XInputAttribute.d.ts +9 -0
- package/dist/XInput/XInputAttribute.js +52 -0
- package/dist/XInput/XInputEvents.d.ts +6 -0
- package/dist/XInput/XInputEvents.js +111 -0
- package/dist/XInput/index.d.ts +1 -0
- package/dist/XInput/index.js +2 -0
- package/dist/XList/ListItem.d.ts +2 -0
- package/dist/XList/ListItem.js +28 -0
- package/dist/XList/XList.d.ts +52 -0
- package/dist/XList/XList.js +257 -0
- package/dist/XList/XListAttributes.d.ts +8 -0
- package/dist/XList/XListAttributes.js +50 -0
- package/dist/XList/XListEvents.d.ts +7 -0
- package/dist/XList/XListEvents.js +356 -0
- package/dist/XList/index.d.ts +2 -0
- package/dist/XList/index.js +3 -0
- package/dist/XOverlayNg/XOverlayAttributes.d.ts +8 -0
- package/dist/XOverlayNg/XOverlayAttributes.js +80 -0
- package/dist/XOverlayNg/XOverlayNg.d.ts +2 -0
- package/dist/XOverlayNg/XOverlayNg.js +45 -0
- package/dist/XOverlayNg/index.d.ts +1 -0
- package/dist/XOverlayNg/index.js +2 -0
- package/dist/XRefreshView/XRefreshFooter.d.ts +3 -0
- package/dist/XRefreshView/XRefreshFooter.js +35 -0
- package/dist/XRefreshView/XRefreshHeader.d.ts +3 -0
- package/dist/XRefreshView/XRefreshHeader.js +35 -0
- package/dist/XRefreshView/XRefreshSubElementIntersectionObserver.d.ts +16 -0
- package/dist/XRefreshView/XRefreshSubElementIntersectionObserver.js +52 -0
- package/dist/XRefreshView/XRefreshView.d.ts +13 -0
- package/dist/XRefreshView/XRefreshView.js +125 -0
- package/dist/XRefreshView/XRefreshViewEventsEmitter.d.ts +8 -0
- package/dist/XRefreshView/XRefreshViewEventsEmitter.js +246 -0
- package/dist/XRefreshView/index.d.ts +3 -0
- package/dist/XRefreshView/index.js +4 -0
- package/dist/XSvg/XSvg.d.ts +8 -0
- package/dist/XSvg/XSvg.js +80 -0
- package/dist/XSvg/index.d.ts +1 -0
- package/dist/XSvg/index.js +2 -0
- package/dist/XSwiper/SwiperItem.d.ts +2 -0
- package/dist/XSwiper/SwiperItem.js +28 -0
- package/dist/XSwiper/XSwiper.d.ts +14 -0
- package/dist/XSwiper/XSwiper.js +231 -0
- package/dist/XSwiper/XSwiperAutoScroll.d.ts +8 -0
- package/dist/XSwiper/XSwiperAutoScroll.js +63 -0
- package/dist/XSwiper/XSwiperCircular.d.ts +8 -0
- package/dist/XSwiper/XSwiperCircular.js +191 -0
- package/dist/XSwiper/XSwiperEvents.d.ts +8 -0
- package/dist/XSwiper/XSwiperEvents.js +144 -0
- package/dist/XSwiper/XSwiperIndicator.d.ts +9 -0
- package/dist/XSwiper/XSwiperIndicator.js +118 -0
- package/dist/XSwiper/index.d.ts +2 -0
- package/dist/XSwiper/index.js +3 -0
- package/dist/XText/InlineImage.d.ts +11 -0
- package/dist/XText/InlineImage.js +56 -0
- package/dist/XText/InlineText.d.ts +5 -0
- package/dist/XText/InlineText.js +30 -0
- package/dist/XText/InlineTruncation.d.ts +5 -0
- package/dist/XText/InlineTruncation.js +42 -0
- package/dist/XText/RawText.d.ts +7 -0
- package/dist/XText/RawText.js +54 -0
- package/dist/XText/XText.d.ts +5 -0
- package/dist/XText/XText.js +49 -0
- package/dist/XText/XTextTruncation.d.ts +11 -0
- package/dist/XText/XTextTruncation.js +604 -0
- package/dist/XText/index.d.ts +5 -0
- package/dist/XText/index.js +6 -0
- package/dist/XTextarea/Placeholder.d.ts +7 -0
- package/dist/XTextarea/Placeholder.js +59 -0
- package/dist/XTextarea/TextareaBaseAttributes.d.ts +6 -0
- package/dist/XTextarea/TextareaBaseAttributes.js +70 -0
- package/dist/XTextarea/XTextarea.d.ts +21 -0
- package/dist/XTextarea/XTextarea.js +101 -0
- package/dist/XTextarea/XTextareaAttributes.d.ts +6 -0
- package/dist/XTextarea/XTextareaAttributes.js +81 -0
- package/dist/XTextarea/XTextareaEvents.d.ts +6 -0
- package/dist/XTextarea/XTextareaEvents.js +111 -0
- package/dist/XTextarea/index.d.ts +1 -0
- package/dist/XTextarea/index.js +2 -0
- package/dist/XView/BlurRadius.d.ts +7 -0
- package/dist/XView/BlurRadius.js +38 -0
- package/dist/XView/XBlurView.d.ts +2 -0
- package/dist/XView/XBlurView.js +29 -0
- package/dist/XView/XView.d.ts +4 -0
- package/dist/XView/XView.js +45 -0
- package/dist/XView/index.d.ts +2 -0
- package/dist/XView/index.js +3 -0
- package/dist/XViewpagerNg/XViewpagerItemNg.d.ts +2 -0
- package/dist/XViewpagerNg/XViewpagerItemNg.js +30 -0
- package/dist/XViewpagerNg/XViewpagerNg.d.ts +10 -0
- package/dist/XViewpagerNg/XViewpagerNg.js +98 -0
- package/dist/XViewpagerNg/XViewpagerNgEvents.d.ts +9 -0
- package/dist/XViewpagerNg/XViewpagerNgEvents.js +118 -0
- package/dist/XViewpagerNg/index.d.ts +2 -0
- package/dist/XViewpagerNg/index.js +3 -0
- package/dist/all.d.ts +16 -0
- package/dist/all.js +17 -0
- package/dist/common/Exposure.d.ts +28 -0
- package/dist/common/Exposure.js +193 -0
- package/dist/common/bindToIntersectionObserver.d.ts +1 -0
- package/dist/common/bindToIntersectionObserver.js +23 -0
- package/dist/common/commonEventInitConfiguration.d.ts +5 -0
- package/dist/common/commonEventInitConfiguration.js +9 -0
- package/dist/common/constants.d.ts +4 -0
- package/dist/common/constants.js +14 -0
- package/dist/common/convertLengthToPx.d.ts +1 -0
- package/dist/common/convertLengthToPx.js +25 -0
- package/dist/common/renameEvent.d.ts +1 -0
- package/dist/common/renameEvent.js +6 -0
- package/dist/common/throttle.d.ts +4 -0
- package/dist/common/throttle.js +40 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +8 -0
- package/dist/lazy.d.ts +1 -0
- package/dist/lazy.js +106 -0
- package/index.css +19 -0
- package/package.json +110 -0
- package/src/LynxWrapper/lynx-wrapper.css +12 -0
- package/src/ScrollView/scroll-view.css +121 -0
- package/src/XAudioTT/x-audio-tt.css +3 -0
- package/src/XCanvas/x-canvas.css +16 -0
- package/src/XFoldViewNg/x-foldview-ng.css +80 -0
- package/src/XImage/x-image.css +82 -0
- package/src/XInput/x-input.css +48 -0
- package/src/XList/x-list.css +147 -0
- package/src/XOverlayNg/x-overlay-ng.css +56 -0
- package/src/XRefreshView/x-refresh-view.css +61 -0
- package/src/XSvg/x-svg.css +10 -0
- package/src/XSwiper/x-swiper.css +319 -0
- package/src/XText/x-text.css +272 -0
- package/src/XTextarea/x-textarea.css +49 -0
- package/src/XViewpagerNg/x-viewpager-ng.css +68 -0
- package/src/common-css/linear.css +386 -0
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers, __setFunctionName } from "tslib";
|
|
2
|
+
/*
|
|
3
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
4
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { genDomGetter, registerAttributeHandler, } from '@lynx-js/web-elements-reactive';
|
|
8
|
+
import { commonComponentEventSetting } from '../common/commonEventInitConfiguration.js';
|
|
9
|
+
import { throttle } from '../common/throttle.js';
|
|
10
|
+
import { bindToIntersectionObserver } from '../common/bindToIntersectionObserver.js';
|
|
11
|
+
import { useScrollEnd } from '../common/constants.js';
|
|
12
|
+
let XListEvents = (() => {
|
|
13
|
+
let _instanceExtraInitializers = [];
|
|
14
|
+
let _private_updateUpperIntersectionObserver_decorators;
|
|
15
|
+
let _private_updateUpperIntersectionObserver_descriptor;
|
|
16
|
+
let _private_updateLowerIntersectionObserver_decorators;
|
|
17
|
+
let _private_updateLowerIntersectionObserver_descriptor;
|
|
18
|
+
let _private_handleScrollEvents_decorators;
|
|
19
|
+
let _private_handleScrollEvents_descriptor;
|
|
20
|
+
let _private_updateUpperEdgeIntersectionObserver_decorators;
|
|
21
|
+
let _private_updateUpperEdgeIntersectionObserver_initializers = [];
|
|
22
|
+
let _private_updateUpperEdgeIntersectionObserver_extraInitializers = [];
|
|
23
|
+
let _private_updateLowerEdgeIntersectionObserver_decorators;
|
|
24
|
+
let _private_updateLowerEdgeIntersectionObserver_initializers = [];
|
|
25
|
+
let _private_updateLowerEdgeIntersectionObserver_extraInitializers = [];
|
|
26
|
+
return class XListEvents {
|
|
27
|
+
static {
|
|
28
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
29
|
+
_private_updateUpperIntersectionObserver_decorators = [registerAttributeHandler('upper-threshold-item-count', true), registerAttributeHandler('x-enable-scrolltoupper-event', true)];
|
|
30
|
+
_private_updateLowerIntersectionObserver_decorators = [registerAttributeHandler('lower-threshold-item-count', true), registerAttributeHandler('x-enable-scrolltolower-event', true)];
|
|
31
|
+
_private_handleScrollEvents_decorators = [registerAttributeHandler('x-enable-scroll-event', true), registerAttributeHandler('scroll-event-throttle', true), registerAttributeHandler('x-enable-scrollend-event', true), registerAttributeHandler('x-enable-snap-event', true)];
|
|
32
|
+
_private_updateUpperEdgeIntersectionObserver_decorators = [registerAttributeHandler('x-enable-scrolltoupperedge-event', true)];
|
|
33
|
+
_private_updateLowerEdgeIntersectionObserver_decorators = [registerAttributeHandler('x-enable-scrolltoloweredge-event', true)];
|
|
34
|
+
__esDecorate(this, _private_updateUpperIntersectionObserver_descriptor = { value: __setFunctionName(function (newValue, oldValue, name) {
|
|
35
|
+
const enableScrollToUpper = this.#dom.getAttribute('x-enable-scrolltoupper-event');
|
|
36
|
+
if (enableScrollToUpper === null) {
|
|
37
|
+
// if x-enable-scrolltoupper-event null, no need to handle upper-threshold-item-count
|
|
38
|
+
if (this.#upperObserver) {
|
|
39
|
+
this.#upperObserver.disconnect();
|
|
40
|
+
this.#upperObserver = undefined;
|
|
41
|
+
}
|
|
42
|
+
if (this.#childrenObserver) {
|
|
43
|
+
this.#childrenObserver.disconnect();
|
|
44
|
+
this.#childrenObserver = undefined;
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (!this.#upperObserver) {
|
|
49
|
+
this.#upperObserver = new IntersectionObserver(this.#handleUpperObserver, {
|
|
50
|
+
root: this.#getListContainer(),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (!this.#childrenObserver) {
|
|
54
|
+
this.#childrenObserver = new MutationObserver(this.#handleChildrenObserver);
|
|
55
|
+
}
|
|
56
|
+
if (name === 'x-enable-scrolltoupper-event') {
|
|
57
|
+
const upperThresholdItemCount = this.#dom.getAttribute('upper-threshold-item-count');
|
|
58
|
+
const itemCount = upperThresholdItemCount !== null
|
|
59
|
+
? parseFloat(upperThresholdItemCount)
|
|
60
|
+
: 0;
|
|
61
|
+
const observerDom = itemCount === 0
|
|
62
|
+
? this.#getUpperThresholdObserverDom()
|
|
63
|
+
: this.#dom.children[itemCount - 1];
|
|
64
|
+
observerDom && this.#upperObserver.observe(observerDom);
|
|
65
|
+
this.#childrenObserver.observe(this.#dom, {
|
|
66
|
+
childList: true,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (name === 'upper-threshold-item-count') {
|
|
70
|
+
const oldItemCount = oldValue !== null
|
|
71
|
+
? parseFloat(oldValue)
|
|
72
|
+
: 0;
|
|
73
|
+
const oldObserverDom = oldItemCount === 0
|
|
74
|
+
? this.#getUpperThresholdObserverDom()
|
|
75
|
+
: this.#dom.children[oldItemCount - 1];
|
|
76
|
+
oldObserverDom && this.#upperObserver.unobserve(oldObserverDom);
|
|
77
|
+
const itemCount = newValue !== null
|
|
78
|
+
? parseFloat(newValue)
|
|
79
|
+
: 0;
|
|
80
|
+
const observerDom = itemCount === 0
|
|
81
|
+
? this.#getUpperThresholdObserverDom()
|
|
82
|
+
: this.#dom.children[itemCount - 1];
|
|
83
|
+
observerDom && this.#upperObserver.observe(observerDom);
|
|
84
|
+
}
|
|
85
|
+
}, "#updateUpperIntersectionObserver") }, _private_updateUpperIntersectionObserver_decorators, { kind: "method", name: "#updateUpperIntersectionObserver", static: false, private: true, access: { has: obj => #updateUpperIntersectionObserver in obj, get: obj => obj.#updateUpperIntersectionObserver }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
86
|
+
__esDecorate(this, _private_updateLowerIntersectionObserver_descriptor = { value: __setFunctionName(function (newValue, oldValue, name) {
|
|
87
|
+
const enableScrollToLower = this.#dom.getAttribute('x-enable-scrolltolower-event');
|
|
88
|
+
if (enableScrollToLower === null) {
|
|
89
|
+
if (this.#lowerObserver) {
|
|
90
|
+
this.#lowerObserver.disconnect();
|
|
91
|
+
this.#lowerObserver = undefined;
|
|
92
|
+
}
|
|
93
|
+
if (this.#childrenObserver) {
|
|
94
|
+
this.#childrenObserver.disconnect();
|
|
95
|
+
this.#childrenObserver = undefined;
|
|
96
|
+
}
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (!this.#lowerObserver) {
|
|
100
|
+
this.#lowerObserver = new IntersectionObserver(this.#handleLowerObserver, {
|
|
101
|
+
root: this.#getListContainer(),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
if (!this.#childrenObserver) {
|
|
105
|
+
this.#childrenObserver = new MutationObserver(this.#handleChildrenObserver);
|
|
106
|
+
}
|
|
107
|
+
if (name === 'x-enable-scrolltolower-event') {
|
|
108
|
+
const lowerThresholdItemCount = this.#dom.getAttribute('lower-threshold-item-count');
|
|
109
|
+
const itemCount = lowerThresholdItemCount !== null
|
|
110
|
+
? parseFloat(lowerThresholdItemCount)
|
|
111
|
+
: 0;
|
|
112
|
+
const observerDom = itemCount === 0
|
|
113
|
+
? this.#getLowerThresholdObserverDom()
|
|
114
|
+
: this.#dom.children[this.#dom.children.length
|
|
115
|
+
- itemCount];
|
|
116
|
+
observerDom && this.#lowerObserver.observe(observerDom);
|
|
117
|
+
this.#childrenObserver.observe(this.#dom, {
|
|
118
|
+
childList: true,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (name === 'lower-threshold-item-count') {
|
|
122
|
+
const oldItemCount = oldValue !== null
|
|
123
|
+
? parseFloat(oldValue)
|
|
124
|
+
: 0;
|
|
125
|
+
const oldObserverDom = oldItemCount === 0
|
|
126
|
+
? this.#getLowerThresholdObserverDom()
|
|
127
|
+
: this.#dom.children[this.#dom.children.length - oldItemCount];
|
|
128
|
+
oldObserverDom && this.#lowerObserver.unobserve(oldObserverDom);
|
|
129
|
+
const itemCount = newValue !== null
|
|
130
|
+
? parseFloat(newValue)
|
|
131
|
+
: 0;
|
|
132
|
+
const observerDom = itemCount === 0
|
|
133
|
+
? this.#getLowerThresholdObserverDom()
|
|
134
|
+
: this.#dom.children[this.#dom.children.length
|
|
135
|
+
- itemCount];
|
|
136
|
+
observerDom && this.#lowerObserver.observe(observerDom);
|
|
137
|
+
}
|
|
138
|
+
}, "#updateLowerIntersectionObserver") }, _private_updateLowerIntersectionObserver_decorators, { kind: "method", name: "#updateLowerIntersectionObserver", static: false, private: true, access: { has: obj => #updateLowerIntersectionObserver in obj, get: obj => obj.#updateLowerIntersectionObserver }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
139
|
+
__esDecorate(this, _private_handleScrollEvents_descriptor = { value: __setFunctionName(function () {
|
|
140
|
+
const scroll = this.#dom.getAttribute('x-enable-scroll-event') !== null;
|
|
141
|
+
const scrollEventThrottle = this.#dom.getAttribute('scroll-event-throttle');
|
|
142
|
+
const scrollend = this.#dom.getAttribute('x-enable-scrollend-event');
|
|
143
|
+
const snap = this.#dom.getAttribute('x-enable-snap-event');
|
|
144
|
+
this.#enableScrollEnd = scrollend !== null || snap !== null;
|
|
145
|
+
const listContainer = this.#getListContainer();
|
|
146
|
+
// cancel the previous listener first
|
|
147
|
+
this.#throttledScroll
|
|
148
|
+
&& listContainer.removeEventListener('scroll', this.#throttledScroll);
|
|
149
|
+
if (scroll !== null || this.#enableScrollEnd) {
|
|
150
|
+
const wait = scrollEventThrottle !== null
|
|
151
|
+
? parseFloat(scrollEventThrottle)
|
|
152
|
+
: 0;
|
|
153
|
+
const throttledScroll = throttle(this.#handleScroll, wait, {
|
|
154
|
+
leading: true,
|
|
155
|
+
trailing: false,
|
|
156
|
+
});
|
|
157
|
+
this.#throttledScroll = throttledScroll;
|
|
158
|
+
listContainer.addEventListener('scroll', this.#throttledScroll);
|
|
159
|
+
this.#prevX = 0;
|
|
160
|
+
this.#prevY = 0;
|
|
161
|
+
}
|
|
162
|
+
if (useScrollEnd && this.#enableScrollEnd) {
|
|
163
|
+
listContainer.addEventListener('scrollend', this.#handleScrollEnd);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
listContainer.removeEventListener('scrollend', this.#handleScrollEnd);
|
|
167
|
+
}
|
|
168
|
+
}, "#handleScrollEvents") }, _private_handleScrollEvents_decorators, { kind: "method", name: "#handleScrollEvents", static: false, private: true, access: { has: obj => #handleScrollEvents in obj, get: obj => obj.#handleScrollEvents }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
169
|
+
__esDecorate(null, null, _private_updateUpperEdgeIntersectionObserver_decorators, { kind: "field", name: "#updateUpperEdgeIntersectionObserver", static: false, private: true, access: { has: obj => #updateUpperEdgeIntersectionObserver in obj, get: obj => obj.#updateUpperEdgeIntersectionObserver, set: (obj, value) => { obj.#updateUpperEdgeIntersectionObserver = value; } }, metadata: _metadata }, _private_updateUpperEdgeIntersectionObserver_initializers, _private_updateUpperEdgeIntersectionObserver_extraInitializers);
|
|
170
|
+
__esDecorate(null, null, _private_updateLowerEdgeIntersectionObserver_decorators, { kind: "field", name: "#updateLowerEdgeIntersectionObserver", static: false, private: true, access: { has: obj => #updateLowerEdgeIntersectionObserver in obj, get: obj => obj.#updateLowerEdgeIntersectionObserver, set: (obj, value) => { obj.#updateLowerEdgeIntersectionObserver = value; } }, metadata: _metadata }, _private_updateLowerEdgeIntersectionObserver_initializers, _private_updateLowerEdgeIntersectionObserver_extraInitializers);
|
|
171
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
172
|
+
}
|
|
173
|
+
static observedAttributes = [
|
|
174
|
+
'x-enable-scroll-event',
|
|
175
|
+
'x-enable-scrollend-event',
|
|
176
|
+
'upper-threshold-item-count',
|
|
177
|
+
'lower-threshold-item-count',
|
|
178
|
+
'x-enable-scrolltoupper-event',
|
|
179
|
+
'x-enable-scrolltolower-event',
|
|
180
|
+
'x-enable-scrolltoupperedge-event',
|
|
181
|
+
'x-enable-scrolltoloweredge-event',
|
|
182
|
+
'x-enable-snap-event',
|
|
183
|
+
'scroll-event-throttle',
|
|
184
|
+
];
|
|
185
|
+
#dom = __runInitializers(this, _instanceExtraInitializers);
|
|
186
|
+
#getListContainer = genDomGetter(() => this.#dom.shadowRoot, '#content');
|
|
187
|
+
// The reason for using two observers is:
|
|
188
|
+
// Using upper-threshold-item-count and lower-threshold-item-count configurations, it is possible that upper and lower observers monitor the same list-item.
|
|
189
|
+
// Using the same observer, invoking callback event, it is impossible to confirm whether its source is upper or lower
|
|
190
|
+
#upperObserver;
|
|
191
|
+
#lowerObserver;
|
|
192
|
+
// When list-item counts changes, Observer needs to be regenerated. Applicable to: Load More scenario
|
|
193
|
+
#childrenObserver;
|
|
194
|
+
#prevX = 0;
|
|
195
|
+
#prevY = 0;
|
|
196
|
+
#enableScrollEnd = false;
|
|
197
|
+
#debounceScrollForMockingScrollEnd;
|
|
198
|
+
#getUpperThresholdObserverDom = genDomGetter(() => this.#dom.shadowRoot, '#upper-threshold-observer');
|
|
199
|
+
#getLowerThresholdObserverDom = genDomGetter(() => this.#dom.shadowRoot, '#lower-threshold-observer');
|
|
200
|
+
#getScrollDetail() {
|
|
201
|
+
const { scrollTop, scrollLeft, scrollHeight, scrollWidth } = this
|
|
202
|
+
.#getListContainer();
|
|
203
|
+
const detail = {
|
|
204
|
+
scrollTop,
|
|
205
|
+
scrollLeft,
|
|
206
|
+
scrollHeight,
|
|
207
|
+
scrollWidth,
|
|
208
|
+
deltaX: scrollLeft - this.#prevX,
|
|
209
|
+
deltaY: scrollTop - this.#prevY,
|
|
210
|
+
};
|
|
211
|
+
this.#prevX = scrollLeft;
|
|
212
|
+
this.#prevY = scrollTop;
|
|
213
|
+
return detail;
|
|
214
|
+
}
|
|
215
|
+
#handleUpperObserver = (entries) => {
|
|
216
|
+
const { isIntersecting, target } = entries[0];
|
|
217
|
+
const scrolltoupper = this.#dom.getAttribute('x-enable-scrolltoupper-event');
|
|
218
|
+
if (isIntersecting) {
|
|
219
|
+
scrolltoupper !== null && this.#dom.dispatchEvent(new CustomEvent('scrolltoupper', {
|
|
220
|
+
...commonComponentEventSetting,
|
|
221
|
+
detail: this.#getScrollDetail(),
|
|
222
|
+
}));
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
get #updateUpperIntersectionObserver() { return _private_updateUpperIntersectionObserver_descriptor.value; }
|
|
226
|
+
#handleLowerObserver = (entries) => {
|
|
227
|
+
const { isIntersecting } = entries[0];
|
|
228
|
+
const scrolltolower = this.#dom.getAttribute('x-enable-scrolltolower-event');
|
|
229
|
+
if (isIntersecting) {
|
|
230
|
+
scrolltolower !== null && this.#dom.dispatchEvent(new CustomEvent('scrolltolower', {
|
|
231
|
+
...commonComponentEventSetting,
|
|
232
|
+
detail: this.#getScrollDetail(),
|
|
233
|
+
}));
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
get #updateLowerIntersectionObserver() { return _private_updateLowerIntersectionObserver_descriptor.value; }
|
|
237
|
+
#handleChildrenObserver = (mutationList) => {
|
|
238
|
+
const mutation = mutationList?.[0];
|
|
239
|
+
// reset upper and lower observers
|
|
240
|
+
if (mutation?.type === 'childList') {
|
|
241
|
+
if (this.#dom.getAttribute('x-enable-scrolltolower-event') !== null) {
|
|
242
|
+
// The reason why unobserve cannot be used is that the structure of list-item has changed,
|
|
243
|
+
// and the list-item before the change cannot be obtained.
|
|
244
|
+
// so disconnect and reconnect is required.
|
|
245
|
+
if (this.#lowerObserver) {
|
|
246
|
+
this.#lowerObserver.disconnect();
|
|
247
|
+
this.#lowerObserver = undefined;
|
|
248
|
+
}
|
|
249
|
+
this.#lowerObserver = new IntersectionObserver(this.#handleLowerObserver, {
|
|
250
|
+
root: this.#getListContainer(),
|
|
251
|
+
});
|
|
252
|
+
const lowerThresholdItemCount = this.#dom.getAttribute('lower-threshold-item-count');
|
|
253
|
+
const itemCount = lowerThresholdItemCount !== null
|
|
254
|
+
? parseFloat(lowerThresholdItemCount)
|
|
255
|
+
: 0;
|
|
256
|
+
const observerDom = itemCount === 0
|
|
257
|
+
? this.#getLowerThresholdObserverDom()
|
|
258
|
+
: this.#dom.children[this.#dom.children.length
|
|
259
|
+
- itemCount];
|
|
260
|
+
observerDom && this.#lowerObserver.observe(observerDom);
|
|
261
|
+
}
|
|
262
|
+
if (this.#dom.getAttribute('x-enable-scrolltoupper-event') !== null) {
|
|
263
|
+
// The reason why unobserve cannot be used is that the structure of list-item has changed,
|
|
264
|
+
// and the list-item before the change cannot be obtained.
|
|
265
|
+
// so disconnect and reconnect is required.
|
|
266
|
+
if (this.#upperObserver) {
|
|
267
|
+
this.#upperObserver.disconnect();
|
|
268
|
+
this.#upperObserver = undefined;
|
|
269
|
+
}
|
|
270
|
+
this.#upperObserver = new IntersectionObserver(this.#handleUpperObserver, {
|
|
271
|
+
root: this.#getListContainer(),
|
|
272
|
+
});
|
|
273
|
+
const upperThresholdItemCount = this.#dom.getAttribute('upper-threshold-item-count');
|
|
274
|
+
const itemCount = upperThresholdItemCount !== null
|
|
275
|
+
? parseFloat(upperThresholdItemCount)
|
|
276
|
+
: 0;
|
|
277
|
+
const observerDom = itemCount === 0
|
|
278
|
+
? this.#getUpperThresholdObserverDom()
|
|
279
|
+
: this.#dom.children[itemCount - 1];
|
|
280
|
+
observerDom && this.#upperObserver.observe(observerDom);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
#throttledScroll = null;
|
|
285
|
+
#handleScroll = () => {
|
|
286
|
+
if (this.#enableScrollEnd && !useScrollEnd) {
|
|
287
|
+
// debounce
|
|
288
|
+
clearTimeout(this.#debounceScrollForMockingScrollEnd);
|
|
289
|
+
this.#debounceScrollForMockingScrollEnd = setTimeout(() => {
|
|
290
|
+
this.#handleScrollEnd();
|
|
291
|
+
}, 100);
|
|
292
|
+
}
|
|
293
|
+
this.#dom.dispatchEvent(new CustomEvent('lynxscroll', {
|
|
294
|
+
...commonComponentEventSetting,
|
|
295
|
+
detail: {
|
|
296
|
+
type: 'scroll',
|
|
297
|
+
},
|
|
298
|
+
}));
|
|
299
|
+
};
|
|
300
|
+
get #handleScrollEvents() { return _private_handleScrollEvents_descriptor.value; }
|
|
301
|
+
#handleObserver = (entries) => {
|
|
302
|
+
const { isIntersecting, target } = entries[0];
|
|
303
|
+
const id = target.id;
|
|
304
|
+
if (isIntersecting) {
|
|
305
|
+
if (id === 'upper-threshold-observer') {
|
|
306
|
+
this.#dom.dispatchEvent(new CustomEvent('scrolltoupperedge', {
|
|
307
|
+
...commonComponentEventSetting,
|
|
308
|
+
detail: this.#getScrollDetail(),
|
|
309
|
+
}));
|
|
310
|
+
}
|
|
311
|
+
else if (id === 'lower-threshold-observer') {
|
|
312
|
+
this.#dom.dispatchEvent(new CustomEvent('scrolltoloweredge', {
|
|
313
|
+
...commonComponentEventSetting,
|
|
314
|
+
detail: this.#getScrollDetail(),
|
|
315
|
+
}));
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
#updateUpperEdgeIntersectionObserver = __runInitializers(this, _private_updateUpperEdgeIntersectionObserver_initializers, bindToIntersectionObserver(this.#getListContainer, this.#getUpperThresholdObserverDom, this.#handleObserver));
|
|
320
|
+
#updateLowerEdgeIntersectionObserver = (__runInitializers(this, _private_updateUpperEdgeIntersectionObserver_extraInitializers), __runInitializers(this, _private_updateLowerEdgeIntersectionObserver_initializers, bindToIntersectionObserver(this.#getListContainer, this.#getLowerThresholdObserverDom, this.#handleObserver)));
|
|
321
|
+
#handleScrollEnd = (__runInitializers(this, _private_updateLowerEdgeIntersectionObserver_extraInitializers), () => {
|
|
322
|
+
const scrollend = this.#dom.getAttribute('x-enable-scrollend-event');
|
|
323
|
+
const itemSnap = this.#dom.getAttribute('item-snap');
|
|
324
|
+
const snap = this.#dom.getAttribute('x-enable-snap-event');
|
|
325
|
+
if (scrollend !== null) {
|
|
326
|
+
this.#dom.dispatchEvent(new CustomEvent('lynxscrollend', {
|
|
327
|
+
...commonComponentEventSetting,
|
|
328
|
+
}));
|
|
329
|
+
}
|
|
330
|
+
if (itemSnap !== null && snap !== null) {
|
|
331
|
+
const children = Array.from(this.#dom.children).filter(node => {
|
|
332
|
+
return node.tagName === 'LIST-ITEM';
|
|
333
|
+
});
|
|
334
|
+
const scrollTop = this.#getListContainer().scrollTop;
|
|
335
|
+
const scrollLeft = this.#getListContainer().scrollLeft;
|
|
336
|
+
const snapItem = children.find((ele) => {
|
|
337
|
+
return scrollTop >= ele.offsetTop
|
|
338
|
+
&& scrollTop < ele.offsetTop + ele.offsetHeight;
|
|
339
|
+
});
|
|
340
|
+
this.#dom.dispatchEvent(new CustomEvent('snap', {
|
|
341
|
+
...commonComponentEventSetting,
|
|
342
|
+
detail: {
|
|
343
|
+
position: snapItem && children.indexOf(snapItem),
|
|
344
|
+
scrollTop,
|
|
345
|
+
scrollLeft,
|
|
346
|
+
},
|
|
347
|
+
}));
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
constructor(dom) {
|
|
351
|
+
this.#dom = dom;
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
})();
|
|
355
|
+
export { XListEvents };
|
|
356
|
+
//# sourceMappingURL=XListEvents.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { XOverlayNg } from './XOverlayNg.js';
|
|
2
|
+
import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
|
|
3
|
+
export declare class XOverlayAttributes implements InstanceType<AttributeReactiveClass<typeof XOverlayNg>> {
|
|
4
|
+
#private;
|
|
5
|
+
static observedAttributes: string[];
|
|
6
|
+
constructor(dom: XOverlayNg);
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers, __setFunctionName } from "tslib";
|
|
2
|
+
/*
|
|
3
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
4
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { commonComponentEventSetting } from '../common/commonEventInitConfiguration.js';
|
|
8
|
+
import { registerAttributeHandler, genDomGetter, } from '@lynx-js/web-elements-reactive';
|
|
9
|
+
let XOverlayAttributes = (() => {
|
|
10
|
+
let _instanceExtraInitializers = [];
|
|
11
|
+
let _private_handleEventsPassThrough_decorators;
|
|
12
|
+
let _private_handleEventsPassThrough_descriptor;
|
|
13
|
+
let _private_handleVisible_decorators;
|
|
14
|
+
let _private_handleVisible_descriptor;
|
|
15
|
+
return class XOverlayAttributes {
|
|
16
|
+
static {
|
|
17
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
18
|
+
_private_handleEventsPassThrough_decorators = [registerAttributeHandler('events-pass-through', true)];
|
|
19
|
+
_private_handleVisible_decorators = [registerAttributeHandler('visible', false)];
|
|
20
|
+
__esDecorate(this, _private_handleEventsPassThrough_descriptor = { value: __setFunctionName(function (newVal) {
|
|
21
|
+
if (newVal !== null) {
|
|
22
|
+
this.#getDialogDom().addEventListener('click', this.#portalEventToMainDocument, { passive: false });
|
|
23
|
+
this.#dom.addEventListener('click', this.#portalEventToMainDocument, {
|
|
24
|
+
passive: false,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.#getDialogDom().removeEventListener('click', this.#portalEventToMainDocument);
|
|
29
|
+
this.#dom.removeEventListener('click', this.#portalEventToMainDocument);
|
|
30
|
+
}
|
|
31
|
+
}, "#handleEventsPassThrough") }, _private_handleEventsPassThrough_decorators, { kind: "method", name: "#handleEventsPassThrough", static: false, private: true, access: { has: obj => #handleEventsPassThrough in obj, get: obj => obj.#handleEventsPassThrough }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
32
|
+
__esDecorate(this, _private_handleVisible_descriptor = { value: __setFunctionName(function (newVal) {
|
|
33
|
+
this.#visible = newVal !== null;
|
|
34
|
+
if (this.#useModernDialog) {
|
|
35
|
+
if (this.#visible) {
|
|
36
|
+
this.#getDialogDom().showModal();
|
|
37
|
+
this.#dom.dispatchEvent(new CustomEvent('showoverlay', commonComponentEventSetting));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this.#getDialogDom().close();
|
|
41
|
+
this.#dom.dispatchEvent(new CustomEvent('dismissoverlay', commonComponentEventSetting));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}, "#handleVisible") }, _private_handleVisible_decorators, { kind: "method", name: "#handleVisible", static: false, private: true, access: { has: obj => #handleVisible in obj, get: obj => obj.#handleVisible }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
45
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
46
|
+
}
|
|
47
|
+
static observedAttributes = ['visible', 'events-pass-through'];
|
|
48
|
+
#dom = __runInitializers(this, _instanceExtraInitializers);
|
|
49
|
+
#useModernDialog = !!window.HTMLDialogElement;
|
|
50
|
+
#visible = false;
|
|
51
|
+
constructor(dom) {
|
|
52
|
+
this.#dom = dom;
|
|
53
|
+
}
|
|
54
|
+
#getDialogDom = genDomGetter(() => this.#dom.shadowRoot, '#dialog');
|
|
55
|
+
get #handleEventsPassThrough() { return _private_handleEventsPassThrough_descriptor.value; }
|
|
56
|
+
get #handleVisible() { return _private_handleVisible_descriptor.value; }
|
|
57
|
+
#portalEventToMainDocument = (e) => {
|
|
58
|
+
e.stopPropagation();
|
|
59
|
+
const diaglogDom = this.#getDialogDom();
|
|
60
|
+
if (e.target === this.#dom || e.target === diaglogDom) {
|
|
61
|
+
diaglogDom.close();
|
|
62
|
+
const { clientX, clientY } = e;
|
|
63
|
+
const targetElemnt = document.elementFromPoint(clientX, clientY);
|
|
64
|
+
targetElemnt?.dispatchEvent(new MouseEvent('click', e));
|
|
65
|
+
requestAnimationFrame(() => {
|
|
66
|
+
if (this.#visible && diaglogDom.isConnected) {
|
|
67
|
+
diaglogDom.showModal();
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
connectedCallback() {
|
|
73
|
+
if (!this.#useModernDialog) {
|
|
74
|
+
this.#getDialogDom().style.display = 'none';
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
})();
|
|
79
|
+
export { XOverlayAttributes };
|
|
80
|
+
//# sourceMappingURL=XOverlayAttributes.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
/*
|
|
3
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
4
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { LynxExposure } from '../common/Exposure.js';
|
|
8
|
+
import { XOverlayAttributes } from './XOverlayAttributes.js';
|
|
9
|
+
import { Component, html } from '@lynx-js/web-elements-reactive';
|
|
10
|
+
let XOverlayNg = (() => {
|
|
11
|
+
let _classDecorators = [Component('x-overlay-ng', [LynxExposure, XOverlayAttributes], html `
|
|
12
|
+
<style>
|
|
13
|
+
#dialog[open] {
|
|
14
|
+
top: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
right: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
position: fixed;
|
|
19
|
+
}
|
|
20
|
+
#dialog::backdrop {
|
|
21
|
+
background-color: transparent;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
24
|
+
<dialog id="dialog" part="dialog">
|
|
25
|
+
<slot></slot>
|
|
26
|
+
</dialog>
|
|
27
|
+
`)];
|
|
28
|
+
let _classDescriptor;
|
|
29
|
+
let _classExtraInitializers = [];
|
|
30
|
+
let _classThis;
|
|
31
|
+
let _classSuper = HTMLElement;
|
|
32
|
+
var XOverlayNg = class extends _classSuper {
|
|
33
|
+
static { _classThis = this; }
|
|
34
|
+
static {
|
|
35
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
36
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
37
|
+
XOverlayNg = _classThis = _classDescriptor.value;
|
|
38
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
39
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return XOverlayNg = _classThis;
|
|
43
|
+
})();
|
|
44
|
+
export { XOverlayNg };
|
|
45
|
+
//# sourceMappingURL=XOverlayNg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { XOverlayNg } from './XOverlayNg.js';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
/*
|
|
3
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
4
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { Component } from '@lynx-js/web-elements-reactive';
|
|
8
|
+
import { XRefreshSubElementIntersectionObserver } from './XRefreshSubElementIntersectionObserver.js';
|
|
9
|
+
import { LynxExposure } from '../common/Exposure.js';
|
|
10
|
+
let XRefreshFooter = (() => {
|
|
11
|
+
let _classDecorators = [Component('x-refresh-footer', [
|
|
12
|
+
LynxExposure,
|
|
13
|
+
XRefreshSubElementIntersectionObserver,
|
|
14
|
+
])];
|
|
15
|
+
let _classDescriptor;
|
|
16
|
+
let _classExtraInitializers = [];
|
|
17
|
+
let _classThis;
|
|
18
|
+
let _classSuper = HTMLElement;
|
|
19
|
+
var XRefreshFooter = class extends _classSuper {
|
|
20
|
+
static { _classThis = this; }
|
|
21
|
+
static {
|
|
22
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
23
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
24
|
+
XRefreshFooter = _classThis = _classDescriptor.value;
|
|
25
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
26
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
this.setAttribute('slot', 'footer');
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
return XRefreshFooter = _classThis;
|
|
33
|
+
})();
|
|
34
|
+
export { XRefreshFooter };
|
|
35
|
+
//# sourceMappingURL=XRefreshFooter.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
/*
|
|
3
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
4
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { Component } from '@lynx-js/web-elements-reactive';
|
|
8
|
+
import { XRefreshSubElementIntersectionObserver } from './XRefreshSubElementIntersectionObserver.js';
|
|
9
|
+
import { LynxExposure } from '../common/Exposure.js';
|
|
10
|
+
let XRefreshHeader = (() => {
|
|
11
|
+
let _classDecorators = [Component('x-refresh-header', [
|
|
12
|
+
LynxExposure,
|
|
13
|
+
XRefreshSubElementIntersectionObserver,
|
|
14
|
+
])];
|
|
15
|
+
let _classDescriptor;
|
|
16
|
+
let _classExtraInitializers = [];
|
|
17
|
+
let _classThis;
|
|
18
|
+
let _classSuper = HTMLElement;
|
|
19
|
+
var XRefreshHeader = class extends _classSuper {
|
|
20
|
+
static { _classThis = this; }
|
|
21
|
+
static {
|
|
22
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
23
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
24
|
+
XRefreshHeader = _classThis = _classDescriptor.value;
|
|
25
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
26
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
this.setAttribute('slot', 'header');
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
return XRefreshHeader = _classThis;
|
|
33
|
+
})();
|
|
34
|
+
export { XRefreshHeader };
|
|
35
|
+
//# sourceMappingURL=XRefreshHeader.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
|
|
2
|
+
import { XRefreshFooter } from './XRefreshFooter.js';
|
|
3
|
+
import { XRefreshHeader } from './XRefreshHeader.js';
|
|
4
|
+
export declare class XRefreshIntersectionObserverEvent extends Event {
|
|
5
|
+
startShowing: boolean;
|
|
6
|
+
fullyShowing: boolean;
|
|
7
|
+
static EventName: string;
|
|
8
|
+
constructor(startShowing: boolean, fullyShowing: boolean);
|
|
9
|
+
}
|
|
10
|
+
export declare class XRefreshSubElementIntersectionObserver implements InstanceType<AttributeReactiveClass<typeof XRefreshHeader | typeof XRefreshFooter>> {
|
|
11
|
+
#private;
|
|
12
|
+
static observedAttributes: never[];
|
|
13
|
+
constructor(dom: XRefreshHeader);
|
|
14
|
+
connectedCallback?(): void;
|
|
15
|
+
dispose(): void;
|
|
16
|
+
}
|