@lynx-js/web-elements-canary 0.9.0 → 0.9.1-canary-20251223-71b9083d
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 +21 -7
- package/dist/ScrollView/FadeEdgeLengthAttribute.d.ts +2 -0
- package/dist/ScrollView/FadeEdgeLengthAttribute.js +15 -16
- package/dist/ScrollView/ScrollAttributes.d.ts +2 -0
- package/dist/ScrollView/ScrollAttributes.js +52 -54
- package/dist/ScrollView/ScrollViewEvents.d.ts +6 -0
- package/dist/ScrollView/ScrollViewEvents.js +41 -41
- package/dist/XAudioTT/XAudioAttribute.d.ts +3 -0
- package/dist/XAudioTT/XAudioAttribute.js +57 -60
- package/dist/XFoldViewNg/XFoldviewNgEvents.d.ts +2 -0
- package/dist/XFoldViewNg/XFoldviewNgEvents.js +23 -25
- package/dist/XFoldViewNg/XFoldviewSlotNgTouchEventsHandler.js +0 -1
- package/dist/XImage/DropShadow.d.ts +1 -0
- package/dist/XImage/DropShadow.js +7 -7
- package/dist/XImage/ImageEvents.d.ts +2 -0
- package/dist/XImage/ImageEvents.js +27 -29
- package/dist/XImage/ImageSrc.d.ts +5 -0
- package/dist/XImage/ImageSrc.js +35 -36
- package/dist/XInput/InputBaseAttributes.d.ts +5 -0
- package/dist/XInput/InputBaseAttributes.js +56 -58
- package/dist/XInput/Placeholder.d.ts +5 -0
- package/dist/XInput/Placeholder.js +31 -31
- package/dist/XInput/XInputAttribute.d.ts +3 -0
- package/dist/XInput/XInputAttribute.js +31 -32
- package/dist/XInput/XInputEvents.d.ts +3 -0
- package/dist/XInput/XInputEvents.js +34 -37
- package/dist/XList/ListItemAttributes.d.ts +1 -0
- package/dist/XList/ListItemAttributes.js +8 -9
- package/dist/XList/XListAttributes.d.ts +2 -0
- package/dist/XList/XListAttributes.js +13 -13
- package/dist/XList/XListEvents.d.ts +7 -0
- package/dist/XList/XListEvents.js +76 -78
- package/dist/XList/XListWaterfall.d.ts +2 -0
- package/dist/XList/XListWaterfall.js +66 -68
- package/dist/XOverlayNg/XOverlayAttributes.d.ts +2 -0
- package/dist/XOverlayNg/XOverlayAttributes.js +32 -34
- package/dist/XRefreshView/XRefreshViewEventsEmitter.d.ts +2 -0
- package/dist/XRefreshView/XRefreshViewEventsEmitter.js +34 -37
- package/dist/XSvg/XSvg.d.ts +3 -0
- package/dist/XSvg/XSvg.js +42 -45
- package/dist/XSwiper/XSwiperAutoScroll.d.ts +2 -0
- package/dist/XSwiper/XSwiperAutoScroll.js +23 -25
- package/dist/XSwiper/XSwiperCircular.d.ts +2 -0
- package/dist/XSwiper/XSwiperCircular.js +23 -25
- package/dist/XSwiper/XSwiperEvents.d.ts +2 -0
- package/dist/XSwiper/XSwiperEvents.js +19 -20
- package/dist/XSwiper/XSwiperIndicator.d.ts +5 -0
- package/dist/XSwiper/XSwiperIndicator.js +31 -31
- package/dist/XText/InlineImage.d.ts +1 -0
- package/dist/XText/InlineImage.js +10 -11
- package/dist/XText/RawText.d.ts +1 -0
- package/dist/XText/RawText.js +11 -12
- package/dist/XText/XTextTruncation.d.ts +2 -0
- package/dist/XText/XTextTruncation.js +29 -31
- package/dist/XTextarea/Placeholder.d.ts +5 -0
- package/dist/XTextarea/Placeholder.js +31 -31
- package/dist/XTextarea/TextareaBaseAttributes.d.ts +5 -0
- package/dist/XTextarea/TextareaBaseAttributes.js +31 -31
- package/dist/XTextarea/XTextareaAttributes.d.ts +5 -0
- package/dist/XTextarea/XTextareaAttributes.js +43 -45
- package/dist/XTextarea/XTextareaEvents.d.ts +3 -0
- package/dist/XTextarea/XTextareaEvents.js +34 -37
- package/dist/XView/BlurRadius.d.ts +1 -0
- package/dist/XView/BlurRadius.js +14 -15
- package/dist/XViewpagerNg/XViewpagerNgEvents.d.ts +2 -0
- package/dist/XViewpagerNg/XViewpagerNgEvents.js +15 -17
- package/dist/common/CommonEventsAndMethods.d.ts +1 -0
- package/dist/common/CommonEventsAndMethods.js +5 -1
- package/elements.css +18 -0
- package/index.css +1 -14
- package/package.json +21 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __esDecorate, __runInitializers
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
2
|
/*
|
|
3
3
|
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
4
4
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
@@ -9,74 +9,15 @@ const WATERFALL_SLOT = 'waterfall-slot';
|
|
|
9
9
|
const WATERFALL_STYLE = 'waterfall-style';
|
|
10
10
|
let XListWaterfall = (() => {
|
|
11
11
|
let _instanceExtraInitializers = [];
|
|
12
|
-
let
|
|
13
|
-
let
|
|
14
|
-
let _private_handlerListType_decorators;
|
|
15
|
-
let _private_handlerListType_descriptor;
|
|
12
|
+
let __handleXEnableHeaderOffsetEvent_decorators;
|
|
13
|
+
let __handlerListType_decorators;
|
|
16
14
|
return class XListWaterfall {
|
|
17
15
|
static {
|
|
18
16
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__esDecorate(this,
|
|
22
|
-
|
|
23
|
-
? this.#dom.setAttribute('x-enable-scrolltolower-event', '')
|
|
24
|
-
: this.#dom.removeAttribute('x-enable-scrolltolower-event'); // css needs this;
|
|
25
|
-
if (enableScrollToLower) {
|
|
26
|
-
const lower = this.#getLowerThresholdObserver();
|
|
27
|
-
const scrollOrientation = this.#dom.getAttribute('scroll-orientation')
|
|
28
|
-
|| 'vertical';
|
|
29
|
-
const listContent = this.#getListContainer();
|
|
30
|
-
// under waterfall, and when the list-item does not have a specified height, obtaining the correct scrollable value takes some time.
|
|
31
|
-
setTimeout(() => {
|
|
32
|
-
if (scrollOrientation === 'vertical') {
|
|
33
|
-
lower.style.setProperty('top',
|
|
34
|
-
// Firefox cannot trigger the bottom IntersectionObserver
|
|
35
|
-
`${String(listContent.scrollHeight - 1)}px`, 'important');
|
|
36
|
-
// Firefox needs this
|
|
37
|
-
lower.style.setProperty('bottom', 'unset', 'important');
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
lower.style.setProperty('left',
|
|
41
|
-
// Firefox cannot trigger the bottom IntersectionObserver
|
|
42
|
-
`${String(listContent.scrollWidth - 1)}px`, 'important');
|
|
43
|
-
// Firefox needs this
|
|
44
|
-
lower.style.setProperty('right', 'unset', 'important');
|
|
45
|
-
}
|
|
46
|
-
}, 100);
|
|
47
|
-
}
|
|
48
|
-
}, "#handleXEnableHeaderOffsetEvent") }, _private_handleXEnableHeaderOffsetEvent_decorators, { kind: "method", name: "#handleXEnableHeaderOffsetEvent", static: false, private: true, access: { has: obj => #handleXEnableHeaderOffsetEvent in obj, get: obj => obj.#handleXEnableHeaderOffsetEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
49
|
-
__esDecorate(this, _private_handlerListType_descriptor = { value: __setFunctionName(function (newVal) {
|
|
50
|
-
if (newVal === 'waterfall') {
|
|
51
|
-
this.#createWaterfallContainer();
|
|
52
|
-
if (!this.#resizeObserver) {
|
|
53
|
-
this.#resizeObserverInit();
|
|
54
|
-
}
|
|
55
|
-
if (!this.#childrenObserver) {
|
|
56
|
-
this.#childrenObserver = new MutationObserver((mutationList) => {
|
|
57
|
-
const mutation = mutationList?.[0];
|
|
58
|
-
if (mutation?.type === 'childList') {
|
|
59
|
-
this.#resizeObserverInit();
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
this.#childrenObserver.observe(this.#dom, {
|
|
63
|
-
childList: true,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
this.#resizeObserver?.disconnect();
|
|
69
|
-
this.#resizeObserver = undefined;
|
|
70
|
-
this.#childrenObserver?.disconnect();
|
|
71
|
-
this.#childrenObserver = undefined;
|
|
72
|
-
for (let i = 0; i < this.#dom.children.length; i++) {
|
|
73
|
-
const listItem = this.#dom.children[i];
|
|
74
|
-
listItem.removeAttribute('slot');
|
|
75
|
-
}
|
|
76
|
-
this.#dom.shadowRoot?.querySelector(`slot[name=${WATERFALL_SLOT}]`)
|
|
77
|
-
?.remove();
|
|
78
|
-
}
|
|
79
|
-
}, "#handlerListType") }, _private_handlerListType_decorators, { kind: "method", name: "#handlerListType", static: false, private: true, access: { has: obj => #handlerListType in obj, get: obj => obj.#handlerListType }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
17
|
+
__handleXEnableHeaderOffsetEvent_decorators = [registerEventEnableStatusChangeHandler('scrolltolower')];
|
|
18
|
+
__handlerListType_decorators = [registerAttributeHandler('list-type', true)];
|
|
19
|
+
__esDecorate(this, null, __handleXEnableHeaderOffsetEvent_decorators, { kind: "method", name: "_handleXEnableHeaderOffsetEvent", static: false, private: false, access: { has: obj => "_handleXEnableHeaderOffsetEvent" in obj, get: obj => obj._handleXEnableHeaderOffsetEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
20
|
+
__esDecorate(this, null, __handlerListType_decorators, { kind: "method", name: "_handlerListType", static: false, private: false, access: { has: obj => "_handlerListType" in obj, get: obj => obj._handlerListType }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
80
21
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
81
22
|
}
|
|
82
23
|
static observedAttributes = ['list-type'];
|
|
@@ -85,7 +26,34 @@ let XListWaterfall = (() => {
|
|
|
85
26
|
#getLowerThresholdObserver = genDomGetter(() => this.#dom.shadowRoot, 'div[part="lower-threshold-observer"]');
|
|
86
27
|
#resizeObserver;
|
|
87
28
|
#childrenObserver;
|
|
88
|
-
|
|
29
|
+
_handleXEnableHeaderOffsetEvent(enableScrollToLower) {
|
|
30
|
+
enableScrollToLower
|
|
31
|
+
? this.#dom.setAttribute('x-enable-scrolltolower-event', '')
|
|
32
|
+
: this.#dom.removeAttribute('x-enable-scrolltolower-event'); // css needs this;
|
|
33
|
+
if (enableScrollToLower) {
|
|
34
|
+
const lower = this.#getLowerThresholdObserver();
|
|
35
|
+
const scrollOrientation = this.#dom.getAttribute('scroll-orientation')
|
|
36
|
+
|| 'vertical';
|
|
37
|
+
const listContent = this.#getListContainer();
|
|
38
|
+
// under waterfall, and when the list-item does not have a specified height, obtaining the correct scrollable value takes some time.
|
|
39
|
+
setTimeout(() => {
|
|
40
|
+
if (scrollOrientation === 'vertical') {
|
|
41
|
+
lower.style.setProperty('top',
|
|
42
|
+
// Firefox cannot trigger the bottom IntersectionObserver
|
|
43
|
+
`${String(listContent.scrollHeight - 1)}px`, 'important');
|
|
44
|
+
// Firefox needs this
|
|
45
|
+
lower.style.setProperty('bottom', 'unset', 'important');
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
lower.style.setProperty('left',
|
|
49
|
+
// Firefox cannot trigger the bottom IntersectionObserver
|
|
50
|
+
`${String(listContent.scrollWidth - 1)}px`, 'important');
|
|
51
|
+
// Firefox needs this
|
|
52
|
+
lower.style.setProperty('right', 'unset', 'important');
|
|
53
|
+
}
|
|
54
|
+
}, 100);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
89
57
|
#createWaterfallContainer = () => {
|
|
90
58
|
const waterfallSlot = document.createElement('slot');
|
|
91
59
|
waterfallSlot.setAttribute('name', `${WATERFALL_SLOT}`);
|
|
@@ -171,7 +139,37 @@ let XListWaterfall = (() => {
|
|
|
171
139
|
this.#resizeObserver?.observe(element);
|
|
172
140
|
});
|
|
173
141
|
};
|
|
174
|
-
|
|
142
|
+
_handlerListType(newVal) {
|
|
143
|
+
if (newVal === 'waterfall') {
|
|
144
|
+
this.#createWaterfallContainer();
|
|
145
|
+
if (!this.#resizeObserver) {
|
|
146
|
+
this.#resizeObserverInit();
|
|
147
|
+
}
|
|
148
|
+
if (!this.#childrenObserver) {
|
|
149
|
+
this.#childrenObserver = new MutationObserver((mutationList) => {
|
|
150
|
+
const mutation = mutationList?.[0];
|
|
151
|
+
if (mutation?.type === 'childList') {
|
|
152
|
+
this.#resizeObserverInit();
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
this.#childrenObserver.observe(this.#dom, {
|
|
156
|
+
childList: true,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
this.#resizeObserver?.disconnect();
|
|
162
|
+
this.#resizeObserver = undefined;
|
|
163
|
+
this.#childrenObserver?.disconnect();
|
|
164
|
+
this.#childrenObserver = undefined;
|
|
165
|
+
for (let i = 0; i < this.#dom.children.length; i++) {
|
|
166
|
+
const listItem = this.#dom.children[i];
|
|
167
|
+
listItem.removeAttribute('slot');
|
|
168
|
+
}
|
|
169
|
+
this.#dom.shadowRoot?.querySelector(`slot[name=${WATERFALL_SLOT}]`)
|
|
170
|
+
?.remove();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
175
173
|
};
|
|
176
174
|
})();
|
|
177
175
|
export { XListWaterfall };
|
|
@@ -4,5 +4,7 @@ export declare class XOverlayAttributes implements InstanceType<AttributeReactiv
|
|
|
4
4
|
#private;
|
|
5
5
|
static observedAttributes: string[];
|
|
6
6
|
constructor(dom: XOverlayNg);
|
|
7
|
+
_handleEventsPassThrough(newVal: string | null): void;
|
|
8
|
+
_handleVisible(newVal: string | null): void;
|
|
7
9
|
connectedCallback(): void;
|
|
8
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __esDecorate, __runInitializers
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
2
|
/*
|
|
3
3
|
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
4
4
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
@@ -8,40 +8,15 @@ import { commonComponentEventSetting } from '../common/commonEventInitConfigurat
|
|
|
8
8
|
import { registerAttributeHandler, genDomGetter, } from '@lynx-js/web-elements-reactive';
|
|
9
9
|
let XOverlayAttributes = (() => {
|
|
10
10
|
let _instanceExtraInitializers = [];
|
|
11
|
-
let
|
|
12
|
-
let
|
|
13
|
-
let _private_handleVisible_decorators;
|
|
14
|
-
let _private_handleVisible_descriptor;
|
|
11
|
+
let __handleEventsPassThrough_decorators;
|
|
12
|
+
let __handleVisible_decorators;
|
|
15
13
|
return class XOverlayAttributes {
|
|
16
14
|
static {
|
|
17
15
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
__esDecorate(this,
|
|
21
|
-
|
|
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);
|
|
16
|
+
__handleEventsPassThrough_decorators = [registerAttributeHandler('events-pass-through', true)];
|
|
17
|
+
__handleVisible_decorators = [registerAttributeHandler('visible', false)];
|
|
18
|
+
__esDecorate(this, null, __handleEventsPassThrough_decorators, { kind: "method", name: "_handleEventsPassThrough", static: false, private: false, access: { has: obj => "_handleEventsPassThrough" in obj, get: obj => obj._handleEventsPassThrough }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
19
|
+
__esDecorate(this, null, __handleVisible_decorators, { kind: "method", name: "_handleVisible", static: false, private: false, access: { has: obj => "_handleVisible" in obj, get: obj => obj._handleVisible }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
45
20
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
46
21
|
}
|
|
47
22
|
static observedAttributes = ['visible', 'events-pass-through'];
|
|
@@ -52,8 +27,31 @@ let XOverlayAttributes = (() => {
|
|
|
52
27
|
this.#dom = dom;
|
|
53
28
|
}
|
|
54
29
|
#getDialogDom = genDomGetter(() => this.#dom.shadowRoot, '#dialog');
|
|
55
|
-
|
|
56
|
-
|
|
30
|
+
_handleEventsPassThrough(newVal) {
|
|
31
|
+
if (newVal !== null) {
|
|
32
|
+
this.#getDialogDom().addEventListener('click', this.#portalEventToMainDocument, { passive: false });
|
|
33
|
+
this.#dom.addEventListener('click', this.#portalEventToMainDocument, {
|
|
34
|
+
passive: false,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.#getDialogDom().removeEventListener('click', this.#portalEventToMainDocument);
|
|
39
|
+
this.#dom.removeEventListener('click', this.#portalEventToMainDocument);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
_handleVisible(newVal) {
|
|
43
|
+
this.#visible = newVal !== null;
|
|
44
|
+
if (this.#useModernDialog) {
|
|
45
|
+
if (this.#visible) {
|
|
46
|
+
this.#getDialogDom().showModal();
|
|
47
|
+
this.#dom.dispatchEvent(new CustomEvent('showoverlay', commonComponentEventSetting));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this.#getDialogDom().close();
|
|
51
|
+
this.#dom.dispatchEvent(new CustomEvent('dismissoverlay', commonComponentEventSetting));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
57
55
|
#portalEventToMainDocument = (e) => {
|
|
58
56
|
e.stopPropagation();
|
|
59
57
|
const diaglogDom = this.#getDialogDom();
|
|
@@ -4,5 +4,7 @@ export declare class XRefreshViewEventsEmitter implements InstanceType<Attribute
|
|
|
4
4
|
#private;
|
|
5
5
|
static observedAttributes: never[];
|
|
6
6
|
constructor(dom: XRefreshView);
|
|
7
|
+
_handleComplexEventEnableAttributes(status: boolean, eventName: string): void;
|
|
8
|
+
_handleXEnableHeaderOffsetEvent(status: boolean, eventName: string): void;
|
|
7
9
|
dispose(): void;
|
|
8
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __esDecorate, __runInitializers
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
2
|
/*
|
|
3
3
|
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
4
4
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
@@ -10,42 +10,15 @@ import { commonComponentEventSetting } from '../common/commonEventInitConfigurat
|
|
|
10
10
|
import { registerEventEnableStatusChangeHandler } from '@lynx-js/web-elements-reactive';
|
|
11
11
|
let XRefreshViewEventsEmitter = (() => {
|
|
12
12
|
let _instanceExtraInitializers = [];
|
|
13
|
-
let
|
|
14
|
-
let
|
|
15
|
-
let _private_handleXEnableHeaderOffsetEvent_decorators;
|
|
16
|
-
let _private_handleXEnableHeaderOffsetEvent_descriptor;
|
|
13
|
+
let __handleComplexEventEnableAttributes_decorators;
|
|
14
|
+
let __handleXEnableHeaderOffsetEvent_decorators;
|
|
17
15
|
return class XRefreshViewEventsEmitter {
|
|
18
16
|
static {
|
|
19
17
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
__esDecorate(this,
|
|
23
|
-
|
|
24
|
-
.#eventSwitches[eventName] = status;
|
|
25
|
-
const { headeroffset, headershow, footeroffset } = this.#eventSwitches;
|
|
26
|
-
if (headeroffset
|
|
27
|
-
|| headershow
|
|
28
|
-
|| footeroffset) {
|
|
29
|
-
this.#enableComplexRefreshViewEvents();
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
this.#disableComplexRefreshViewEvents();
|
|
33
|
-
}
|
|
34
|
-
}, "#handleComplexEventEnableAttributes") }, _private_handleComplexEventEnableAttributes_decorators, { kind: "method", name: "#handleComplexEventEnableAttributes", static: false, private: true, access: { has: obj => #handleComplexEventEnableAttributes in obj, get: obj => obj.#handleComplexEventEnableAttributes }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
35
|
-
__esDecorate(this, _private_handleXEnableHeaderOffsetEvent_descriptor = { value: __setFunctionName(function (status, eventName) {
|
|
36
|
-
this
|
|
37
|
-
.#eventSwitches[eventName] = status;
|
|
38
|
-
const { startrefresh, headerreleased, startloadmore, footerreleased } = this.#eventSwitches;
|
|
39
|
-
if (headerreleased
|
|
40
|
-
|| footerreleased
|
|
41
|
-
|| startloadmore
|
|
42
|
-
|| startrefresh) {
|
|
43
|
-
this.#enableSimpleRefreshViewEvents();
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
this.#disableSimpleRefreshViewEvents();
|
|
47
|
-
}
|
|
48
|
-
}, "#handleXEnableHeaderOffsetEvent") }, _private_handleXEnableHeaderOffsetEvent_decorators, { kind: "method", name: "#handleXEnableHeaderOffsetEvent", static: false, private: true, access: { has: obj => #handleXEnableHeaderOffsetEvent in obj, get: obj => obj.#handleXEnableHeaderOffsetEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
18
|
+
__handleComplexEventEnableAttributes_decorators = [registerEventEnableStatusChangeHandler('headeroffset'), registerEventEnableStatusChangeHandler('headershow'), registerEventEnableStatusChangeHandler('footeroffset')];
|
|
19
|
+
__handleXEnableHeaderOffsetEvent_decorators = [registerEventEnableStatusChangeHandler('startrefresh'), registerEventEnableStatusChangeHandler('headerreleased'), registerEventEnableStatusChangeHandler('startloadmore'), registerEventEnableStatusChangeHandler('footerreleased')];
|
|
20
|
+
__esDecorate(this, null, __handleComplexEventEnableAttributes_decorators, { kind: "method", name: "_handleComplexEventEnableAttributes", static: false, private: false, access: { has: obj => "_handleComplexEventEnableAttributes" in obj, get: obj => obj._handleComplexEventEnableAttributes }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
21
|
+
__esDecorate(this, null, __handleXEnableHeaderOffsetEvent_decorators, { kind: "method", name: "_handleXEnableHeaderOffsetEvent", static: false, private: false, access: { has: obj => "_handleXEnableHeaderOffsetEvent" in obj, get: obj => obj._handleXEnableHeaderOffsetEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
49
22
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
50
23
|
}
|
|
51
24
|
#dom = __runInitializers(this, _instanceExtraInitializers);
|
|
@@ -66,8 +39,33 @@ let XRefreshViewEventsEmitter = (() => {
|
|
|
66
39
|
startloadmore: false,
|
|
67
40
|
};
|
|
68
41
|
// complex events switches
|
|
69
|
-
|
|
70
|
-
|
|
42
|
+
_handleComplexEventEnableAttributes(status, eventName) {
|
|
43
|
+
this
|
|
44
|
+
.#eventSwitches[eventName] = status;
|
|
45
|
+
const { headeroffset, headershow, footeroffset } = this.#eventSwitches;
|
|
46
|
+
if (headeroffset
|
|
47
|
+
|| headershow
|
|
48
|
+
|| footeroffset) {
|
|
49
|
+
this.#enableComplexRefreshViewEvents();
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
this.#disableComplexRefreshViewEvents();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
_handleXEnableHeaderOffsetEvent(status, eventName) {
|
|
56
|
+
this
|
|
57
|
+
.#eventSwitches[eventName] = status;
|
|
58
|
+
const { startrefresh, headerreleased, startloadmore, footerreleased } = this.#eventSwitches;
|
|
59
|
+
if (headerreleased
|
|
60
|
+
|| footerreleased
|
|
61
|
+
|| startloadmore
|
|
62
|
+
|| startrefresh) {
|
|
63
|
+
this.#enableSimpleRefreshViewEvents();
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
this.#disableSimpleRefreshViewEvents();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
71
69
|
/**
|
|
72
70
|
* handle header/footer showing events
|
|
73
71
|
*/
|
|
@@ -166,7 +164,6 @@ let XRefreshViewEventsEmitter = (() => {
|
|
|
166
164
|
if (footer) {
|
|
167
165
|
const contentDom = this.#dom.shadowRoot.querySelector('#container');
|
|
168
166
|
const scrollTop = contentDom.scrollTop;
|
|
169
|
-
const scrollHeight = contentDom.scrollHeight;
|
|
170
167
|
const height = parseFloat(getComputedStyle(footer).height);
|
|
171
168
|
this.#dom.dispatchEvent(new CustomEvent('footeroffset', {
|
|
172
169
|
...commonComponentEventSetting,
|
package/dist/XSvg/XSvg.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
|
|
|
2
2
|
export declare class XSvgFeatures implements InstanceType<AttributeReactiveClass<typeof XSvg>> {
|
|
3
3
|
#private;
|
|
4
4
|
static observedAttributes: string[];
|
|
5
|
+
_handleSrc(newVal: string | null): void;
|
|
6
|
+
_handleContent(content: string | null): void;
|
|
7
|
+
_enableLoadEvent(status: boolean): void;
|
|
5
8
|
constructor(dom: HTMLElement);
|
|
6
9
|
}
|
|
7
10
|
export declare class XSvg extends HTMLElement {
|
package/dist/XSvg/XSvg.js
CHANGED
|
@@ -1,67 +1,64 @@
|
|
|
1
|
-
import { __esDecorate, __runInitializers
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
2
|
/*
|
|
3
3
|
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
4
4
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import { Component,
|
|
7
|
+
import { Component, genDomGetter, registerAttributeHandler, registerEventEnableStatusChangeHandler, } from '@lynx-js/web-elements-reactive';
|
|
8
8
|
import { CommonEventsAndMethods } from '../common/CommonEventsAndMethods.js';
|
|
9
9
|
import { commonComponentEventSetting } from '../common/commonEventInitConfiguration.js';
|
|
10
10
|
import { templateXSvg } from '@lynx-js/web-elements-template';
|
|
11
11
|
let XSvgFeatures = (() => {
|
|
12
12
|
let _instanceExtraInitializers = [];
|
|
13
|
-
let
|
|
14
|
-
let
|
|
15
|
-
let
|
|
16
|
-
let _private_handleContent_descriptor;
|
|
17
|
-
let _private_enableLoadEvent_decorators;
|
|
18
|
-
let _private_enableLoadEvent_descriptor;
|
|
13
|
+
let __handleSrc_decorators;
|
|
14
|
+
let __handleContent_decorators;
|
|
15
|
+
let __enableLoadEvent_decorators;
|
|
19
16
|
return class XSvgFeatures {
|
|
20
17
|
static {
|
|
21
18
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
__esDecorate(this,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
this.#getImg().src = newVal;
|
|
31
|
-
}
|
|
32
|
-
}, "#handleSrc") }, _private_handleSrc_decorators, { kind: "method", name: "#handleSrc", static: false, private: true, access: { has: obj => #handleSrc in obj, get: obj => obj.#handleSrc }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
33
|
-
__esDecorate(this, _private_handleContent_descriptor = { value: __setFunctionName(function (content) {
|
|
34
|
-
this.#url && URL.revokeObjectURL(this.#url);
|
|
35
|
-
if (!content) {
|
|
36
|
-
this.#url = '';
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const blob = new Blob([content], {
|
|
40
|
-
type: 'image/svg+xml;charset=UTF-8',
|
|
41
|
-
});
|
|
42
|
-
const src = URL.createObjectURL(blob);
|
|
43
|
-
this.#url = src;
|
|
44
|
-
this.#getImg().src = src;
|
|
45
|
-
}, "#handleContent") }, _private_handleContent_decorators, { kind: "method", name: "#handleContent", static: false, private: true, access: { has: obj => #handleContent in obj, get: obj => obj.#handleContent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
46
|
-
__esDecorate(this, _private_enableLoadEvent_descriptor = { value: __setFunctionName(function (status) {
|
|
47
|
-
if (status) {
|
|
48
|
-
this.#getImg().addEventListener('load', this.#teleportLoadEvent, {
|
|
49
|
-
passive: true,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
this.#getImg().removeEventListener('load', this.#teleportLoadEvent);
|
|
54
|
-
}
|
|
55
|
-
}, "#enableLoadEvent") }, _private_enableLoadEvent_decorators, { kind: "method", name: "#enableLoadEvent", static: false, private: true, access: { has: obj => #enableLoadEvent in obj, get: obj => obj.#enableLoadEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
19
|
+
__handleSrc_decorators = [registerAttributeHandler('src', true)];
|
|
20
|
+
__handleContent_decorators = [registerAttributeHandler('content', true)];
|
|
21
|
+
__enableLoadEvent_decorators = [registerEventEnableStatusChangeHandler('load')];
|
|
22
|
+
__esDecorate(this, null, __handleSrc_decorators, { kind: "method", name: "_handleSrc", static: false, private: false, access: { has: obj => "_handleSrc" in obj, get: obj => obj._handleSrc }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
23
|
+
__esDecorate(this, null, __handleContent_decorators, { kind: "method", name: "_handleContent", static: false, private: false, access: { has: obj => "_handleContent" in obj, get: obj => obj._handleContent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
24
|
+
__esDecorate(this, null, __enableLoadEvent_decorators, { kind: "method", name: "_enableLoadEvent", static: false, private: false, access: { has: obj => "_enableLoadEvent" in obj, get: obj => obj._enableLoadEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
56
25
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
57
26
|
}
|
|
58
27
|
static observedAttributes = ['src', 'content'];
|
|
59
28
|
#dom = __runInitializers(this, _instanceExtraInitializers);
|
|
60
29
|
#url = null;
|
|
61
30
|
#getImg = genDomGetter(() => this.#dom.shadowRoot, '#img');
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
31
|
+
_handleSrc(newVal) {
|
|
32
|
+
if (!newVal) {
|
|
33
|
+
this.#getImg().src = '';
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.#getImg().src = newVal;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
_handleContent(content) {
|
|
40
|
+
this.#url && URL.revokeObjectURL(this.#url);
|
|
41
|
+
if (!content) {
|
|
42
|
+
this.#url = '';
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const blob = new Blob([content], {
|
|
46
|
+
type: 'image/svg+xml;charset=UTF-8',
|
|
47
|
+
});
|
|
48
|
+
const src = URL.createObjectURL(blob);
|
|
49
|
+
this.#url = src;
|
|
50
|
+
this.#getImg().src = src;
|
|
51
|
+
}
|
|
52
|
+
_enableLoadEvent(status) {
|
|
53
|
+
if (status) {
|
|
54
|
+
this.#getImg().addEventListener('load', this.#teleportLoadEvent, {
|
|
55
|
+
passive: true,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this.#getImg().removeEventListener('load', this.#teleportLoadEvent);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
65
62
|
#teleportLoadEvent = () => {
|
|
66
63
|
this.#dom.dispatchEvent(new CustomEvent('load', {
|
|
67
64
|
...commonComponentEventSetting,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __esDecorate, __runInitializers
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
2
|
/*
|
|
3
3
|
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
4
4
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
@@ -7,31 +7,15 @@ import { __esDecorate, __runInitializers, __setFunctionName } from "tslib";
|
|
|
7
7
|
import { registerAttributeHandler, } from '@lynx-js/web-elements-reactive';
|
|
8
8
|
let XSwiperAutoScroll = (() => {
|
|
9
9
|
let _instanceExtraInitializers = [];
|
|
10
|
-
let
|
|
11
|
-
let
|
|
12
|
-
let _private_handleAutoplay_decorators;
|
|
13
|
-
let _private_handleAutoplay_descriptor;
|
|
10
|
+
let __handleCurrentChange_decorators;
|
|
11
|
+
let __handleAutoplay_decorators;
|
|
14
12
|
return class XSwiperAutoScroll {
|
|
15
13
|
static {
|
|
16
14
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
__esDecorate(this,
|
|
20
|
-
|
|
21
|
-
if (!Number.isNaN(newval)) {
|
|
22
|
-
this.#dom.currentIndex = newval;
|
|
23
|
-
}
|
|
24
|
-
}, "#handleCurrentChange") }, _private_handleCurrentChange_decorators, { kind: "method", name: "#handleCurrentChange", static: false, private: true, access: { has: obj => #handleCurrentChange in obj, get: obj => obj.#handleCurrentChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
25
|
-
__esDecorate(this, _private_handleAutoplay_descriptor = { value: __setFunctionName(function () {
|
|
26
|
-
const enableAutoPlay = this.#dom.getAttribute('autoplay') !== null;
|
|
27
|
-
if (enableAutoPlay) {
|
|
28
|
-
const interval = this.#dom.getAttribute('interval');
|
|
29
|
-
let intervalValue = interval ? parseFloat(interval) : 5000;
|
|
30
|
-
if (Number.isNaN(intervalValue))
|
|
31
|
-
intervalValue = 5000;
|
|
32
|
-
this.#startAutoplay(intervalValue);
|
|
33
|
-
}
|
|
34
|
-
}, "#handleAutoplay") }, _private_handleAutoplay_decorators, { kind: "method", name: "#handleAutoplay", static: false, private: true, access: { has: obj => #handleAutoplay in obj, get: obj => obj.#handleAutoplay }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
15
|
+
__handleCurrentChange_decorators = [registerAttributeHandler('current', false)];
|
|
16
|
+
__handleAutoplay_decorators = [registerAttributeHandler('interval', false), registerAttributeHandler('autoplay', false)];
|
|
17
|
+
__esDecorate(this, null, __handleCurrentChange_decorators, { kind: "method", name: "_handleCurrentChange", static: false, private: false, access: { has: obj => "_handleCurrentChange" in obj, get: obj => obj._handleCurrentChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
18
|
+
__esDecorate(this, null, __handleAutoplay_decorators, { kind: "method", name: "_handleAutoplay", static: false, private: false, access: { has: obj => "_handleAutoplay" in obj, get: obj => obj._handleAutoplay }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
35
19
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
36
20
|
}
|
|
37
21
|
static observedAttributes = ['current', 'interval', 'autoplay'];
|
|
@@ -52,7 +36,12 @@ let XSwiperAutoScroll = (() => {
|
|
|
52
36
|
this.#dom.currentIndex += 1;
|
|
53
37
|
}
|
|
54
38
|
}
|
|
55
|
-
|
|
39
|
+
_handleCurrentChange(newVal) {
|
|
40
|
+
const newval = Number(newVal);
|
|
41
|
+
if (!Number.isNaN(newval)) {
|
|
42
|
+
this.#dom.currentIndex = newval;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
56
45
|
#autoPlayTimer;
|
|
57
46
|
#autoPlayTick = (() => {
|
|
58
47
|
this.#scrollToNext();
|
|
@@ -66,7 +55,16 @@ let XSwiperAutoScroll = (() => {
|
|
|
66
55
|
clearInterval(this.#autoPlayTimer);
|
|
67
56
|
}
|
|
68
57
|
}
|
|
69
|
-
|
|
58
|
+
_handleAutoplay() {
|
|
59
|
+
const enableAutoPlay = this.#dom.getAttribute('autoplay') !== null;
|
|
60
|
+
if (enableAutoPlay) {
|
|
61
|
+
const interval = this.#dom.getAttribute('interval');
|
|
62
|
+
let intervalValue = interval ? parseFloat(interval) : 5000;
|
|
63
|
+
if (Number.isNaN(intervalValue))
|
|
64
|
+
intervalValue = 5000;
|
|
65
|
+
this.#startAutoplay(intervalValue);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
70
68
|
dispose() {
|
|
71
69
|
this.#stopAutoplay();
|
|
72
70
|
}
|
|
@@ -4,5 +4,7 @@ export declare class XSwiperCircular implements InstanceType<AttributeReactiveCl
|
|
|
4
4
|
#private;
|
|
5
5
|
static observedAttributes: string[];
|
|
6
6
|
constructor(dom: XSwiper);
|
|
7
|
+
_handleCircular(newVal: string | null): void;
|
|
8
|
+
_handleVerticalChange(newVal: string | null): void;
|
|
7
9
|
dispose(): void;
|
|
8
10
|
}
|