@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,118 @@
|
|
|
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 { genDomGetter, registerAttributeHandler, bindToStyle, boostedQueueMicrotask, } from '@lynx-js/web-elements-reactive';
|
|
8
|
+
let XSwiperIndicator = (() => {
|
|
9
|
+
let _private_handleIndicatorColor_decorators;
|
|
10
|
+
let _private_handleIndicatorColor_initializers = [];
|
|
11
|
+
let _private_handleIndicatorColor_extraInitializers = [];
|
|
12
|
+
let _private_handleIndicatorActiveColor_decorators;
|
|
13
|
+
let _private_handleIndicatorActiveColor_initializers = [];
|
|
14
|
+
let _private_handleIndicatorActiveColor_extraInitializers = [];
|
|
15
|
+
let _private_handlePageMargin_decorators;
|
|
16
|
+
let _private_handlePageMargin_initializers = [];
|
|
17
|
+
let _private_handlePageMargin_extraInitializers = [];
|
|
18
|
+
let _private_handlePreviousMargin_decorators;
|
|
19
|
+
let _private_handlePreviousMargin_initializers = [];
|
|
20
|
+
let _private_handlePreviousMargin_extraInitializers = [];
|
|
21
|
+
let _private_handleNextMargin_decorators;
|
|
22
|
+
let _private_handleNextMargin_initializers = [];
|
|
23
|
+
let _private_handleNextMargin_extraInitializers = [];
|
|
24
|
+
return class XSwiperIndicator {
|
|
25
|
+
static {
|
|
26
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
27
|
+
_private_handleIndicatorColor_decorators = [registerAttributeHandler('indicator-color', true)];
|
|
28
|
+
_private_handleIndicatorActiveColor_decorators = [registerAttributeHandler('indicator-active-color', true)];
|
|
29
|
+
_private_handlePageMargin_decorators = [registerAttributeHandler('page-margin', true)];
|
|
30
|
+
_private_handlePreviousMargin_decorators = [registerAttributeHandler('previous-margin', true)];
|
|
31
|
+
_private_handleNextMargin_decorators = [registerAttributeHandler('next-margin', true)];
|
|
32
|
+
__esDecorate(null, null, _private_handleIndicatorColor_decorators, { kind: "field", name: "#handleIndicatorColor", static: false, private: true, access: { has: obj => #handleIndicatorColor in obj, get: obj => obj.#handleIndicatorColor, set: (obj, value) => { obj.#handleIndicatorColor = value; } }, metadata: _metadata }, _private_handleIndicatorColor_initializers, _private_handleIndicatorColor_extraInitializers);
|
|
33
|
+
__esDecorate(null, null, _private_handleIndicatorActiveColor_decorators, { kind: "field", name: "#handleIndicatorActiveColor", static: false, private: true, access: { has: obj => #handleIndicatorActiveColor in obj, get: obj => obj.#handleIndicatorActiveColor, set: (obj, value) => { obj.#handleIndicatorActiveColor = value; } }, metadata: _metadata }, _private_handleIndicatorActiveColor_initializers, _private_handleIndicatorActiveColor_extraInitializers);
|
|
34
|
+
__esDecorate(null, null, _private_handlePageMargin_decorators, { kind: "field", name: "#handlePageMargin", static: false, private: true, access: { has: obj => #handlePageMargin in obj, get: obj => obj.#handlePageMargin, set: (obj, value) => { obj.#handlePageMargin = value; } }, metadata: _metadata }, _private_handlePageMargin_initializers, _private_handlePageMargin_extraInitializers);
|
|
35
|
+
__esDecorate(null, null, _private_handlePreviousMargin_decorators, { kind: "field", name: "#handlePreviousMargin", static: false, private: true, access: { has: obj => #handlePreviousMargin in obj, get: obj => obj.#handlePreviousMargin, set: (obj, value) => { obj.#handlePreviousMargin = value; } }, metadata: _metadata }, _private_handlePreviousMargin_initializers, _private_handlePreviousMargin_extraInitializers);
|
|
36
|
+
__esDecorate(null, null, _private_handleNextMargin_decorators, { kind: "field", name: "#handleNextMargin", static: false, private: true, access: { has: obj => #handleNextMargin in obj, get: obj => obj.#handleNextMargin, set: (obj, value) => { obj.#handleNextMargin = value; } }, metadata: _metadata }, _private_handleNextMargin_initializers, _private_handleNextMargin_extraInitializers);
|
|
37
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
38
|
+
}
|
|
39
|
+
static observedAttributes = [
|
|
40
|
+
'indicator-color',
|
|
41
|
+
'indicator-active-color',
|
|
42
|
+
'page-margin',
|
|
43
|
+
'previous-margin',
|
|
44
|
+
'next-margin',
|
|
45
|
+
];
|
|
46
|
+
#dom;
|
|
47
|
+
#numOfChildElement = 0;
|
|
48
|
+
#getIndicatorContainer = genDomGetter(() => this.#dom.shadowRoot, '#indicator-container');
|
|
49
|
+
#getIndicatorDynamicStyleContainer = genDomGetter(() => this.#dom.shadowRoot, '#indicator-style');
|
|
50
|
+
#childrenElementMutationObserver;
|
|
51
|
+
constructor(dom) {
|
|
52
|
+
__runInitializers(this, _private_handleNextMargin_extraInitializers);
|
|
53
|
+
this.#dom = dom;
|
|
54
|
+
}
|
|
55
|
+
#handleIndicatorColor = __runInitializers(this, _private_handleIndicatorColor_initializers, bindToStyle(this.#getIndicatorContainer, '--indicator-color', undefined, true));
|
|
56
|
+
#handleIndicatorActiveColor = (__runInitializers(this, _private_handleIndicatorColor_extraInitializers), __runInitializers(this, _private_handleIndicatorActiveColor_initializers, bindToStyle(this.#getIndicatorContainer, '--indicator-active-color', undefined, true)));
|
|
57
|
+
#handlePageMargin = (__runInitializers(this, _private_handleIndicatorActiveColor_extraInitializers), __runInitializers(this, _private_handlePageMargin_initializers, bindToStyle(this.#getIndicatorContainer, '--page-margin', undefined, true)));
|
|
58
|
+
#handlePreviousMargin = (__runInitializers(this, _private_handlePageMargin_extraInitializers), __runInitializers(this, _private_handlePreviousMargin_initializers, bindToStyle(this.#getIndicatorContainer, '--previous-margin', undefined, true)));
|
|
59
|
+
#handleNextMargin = (__runInitializers(this, _private_handlePreviousMargin_extraInitializers), __runInitializers(this, _private_handleNextMargin_initializers, bindToStyle(this.#getIndicatorContainer, '--next-margin', undefined, true)));
|
|
60
|
+
#updateIndicatorDoms() {
|
|
61
|
+
const currentNumber = this.#dom.childElementCount;
|
|
62
|
+
if (currentNumber !== this.#numOfChildElement) {
|
|
63
|
+
let nextInnerHtml = '';
|
|
64
|
+
for (let ii = 0; ii < currentNumber; ii++) {
|
|
65
|
+
nextInnerHtml +=
|
|
66
|
+
`<div style="animation-timeline:--x-swiper-item-${ii};" part="indicator-item"></div>`;
|
|
67
|
+
}
|
|
68
|
+
this.#getIndicatorContainer().innerHTML = nextInnerHtml;
|
|
69
|
+
if (currentNumber > 5) {
|
|
70
|
+
for (let ii = 0; ii < currentNumber; ii++) {
|
|
71
|
+
this.#dom.children.item(ii)?.style.setProperty('view-timeline-name', `--x-swiper-item-${ii}`);
|
|
72
|
+
}
|
|
73
|
+
this.#getIndicatorDynamicStyleContainer().innerHTML =
|
|
74
|
+
`:host { timeline-scope: ${Array.from({ length: currentNumber }, (_, ii) => `--x-swiper-item-${ii}`).join(',')} !important; }`;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
this.#numOfChildElement = currentNumber;
|
|
78
|
+
}
|
|
79
|
+
connectedCallback() {
|
|
80
|
+
this.#updateIndicatorDoms();
|
|
81
|
+
this.#childrenElementMutationObserver = new MutationObserver(this.#updateIndicatorDoms.bind(this));
|
|
82
|
+
this.#childrenElementMutationObserver.observe(this.#dom, {
|
|
83
|
+
attributes: false,
|
|
84
|
+
characterData: false,
|
|
85
|
+
childList: true,
|
|
86
|
+
subtree: false,
|
|
87
|
+
});
|
|
88
|
+
if (!CSS.supports('timeline-scope', '--a, --b')) {
|
|
89
|
+
this.#dom.setAttribute('x-enable-change-event-for-indicator', '');
|
|
90
|
+
this.#dom.addEventListener('change', (({ detail }) => {
|
|
91
|
+
const currentPage = detail.current;
|
|
92
|
+
const numberOfChildren = this.#dom.childElementCount;
|
|
93
|
+
const indicatorContainer = this.#getIndicatorContainer();
|
|
94
|
+
for (let ii = 0; ii < numberOfChildren; ii++) {
|
|
95
|
+
const indicator = indicatorContainer.children[ii];
|
|
96
|
+
if (indicator) {
|
|
97
|
+
if (ii === currentPage) {
|
|
98
|
+
indicator.style.setProperty('background-color', 'var(--indicator-active-color)', 'important');
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
indicator.style.removeProperty('background-color');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}).bind(this));
|
|
106
|
+
boostedQueueMicrotask(() => {
|
|
107
|
+
this.#getIndicatorContainer().children[this.#dom.current]?.style.setProperty('background-color', 'var(--indicator-active-color)', 'important');
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
dispose() {
|
|
112
|
+
this.#childrenElementMutationObserver?.disconnect();
|
|
113
|
+
this.#childrenElementMutationObserver = undefined;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
})();
|
|
117
|
+
export { XSwiperIndicator };
|
|
118
|
+
//# sourceMappingURL=XSwiperIndicator.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
|
|
2
|
+
export declare class InlineImageAttributes implements InstanceType<AttributeReactiveClass<typeof InlineImage>> {
|
|
3
|
+
#private;
|
|
4
|
+
static observedAttributes: string[];
|
|
5
|
+
constructor(dom: InlineImage);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated you can use `x-image` instead in `x-text`.
|
|
9
|
+
*/
|
|
10
|
+
export declare class InlineImage extends HTMLElement {
|
|
11
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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 { Component, genDomGetter, html, registerAttributeHandler, } from '@lynx-js/web-elements-reactive';
|
|
8
|
+
let InlineImageAttributes = (() => {
|
|
9
|
+
let _instanceExtraInitializers = [];
|
|
10
|
+
let _private_handleSrc_decorators;
|
|
11
|
+
let _private_handleSrc_descriptor;
|
|
12
|
+
return class InlineImageAttributes {
|
|
13
|
+
static {
|
|
14
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
15
|
+
_private_handleSrc_decorators = [registerAttributeHandler('src', true)];
|
|
16
|
+
__esDecorate(this, _private_handleSrc_descriptor = { value: __setFunctionName(function (newVal) {
|
|
17
|
+
if (newVal)
|
|
18
|
+
this.#getImage().setAttribute('src', newVal);
|
|
19
|
+
else
|
|
20
|
+
this.#getImage().removeAttribute('src');
|
|
21
|
+
}, "#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);
|
|
22
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
23
|
+
}
|
|
24
|
+
static observedAttributes = ['src'];
|
|
25
|
+
#dom = __runInitializers(this, _instanceExtraInitializers);
|
|
26
|
+
constructor(dom) {
|
|
27
|
+
this.#dom = dom;
|
|
28
|
+
}
|
|
29
|
+
#getImage = genDomGetter(() => this.#dom.shadowRoot, '#img');
|
|
30
|
+
get #handleSrc() { return _private_handleSrc_descriptor.value; }
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
export { InlineImageAttributes };
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated you can use `x-image` instead in `x-text`.
|
|
36
|
+
*/
|
|
37
|
+
let InlineImage = (() => {
|
|
38
|
+
let _classDecorators = [Component('inline-image', [InlineImageAttributes], html ` <img id="img" part="img" /> `)];
|
|
39
|
+
let _classDescriptor;
|
|
40
|
+
let _classExtraInitializers = [];
|
|
41
|
+
let _classThis;
|
|
42
|
+
let _classSuper = HTMLElement;
|
|
43
|
+
var InlineImage = class extends _classSuper {
|
|
44
|
+
static { _classThis = this; }
|
|
45
|
+
static {
|
|
46
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
47
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
48
|
+
InlineImage = _classThis = _classDescriptor.value;
|
|
49
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
50
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return InlineImage = _classThis;
|
|
54
|
+
})();
|
|
55
|
+
export { InlineImage };
|
|
56
|
+
//# sourceMappingURL=InlineImage.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
/**
|
|
9
|
+
* @deprecated you can use x-text instead in x-text.
|
|
10
|
+
*/
|
|
11
|
+
let InlineText = (() => {
|
|
12
|
+
let _classDecorators = [Component('inline-text', [])];
|
|
13
|
+
let _classDescriptor;
|
|
14
|
+
let _classExtraInitializers = [];
|
|
15
|
+
let _classThis;
|
|
16
|
+
let _classSuper = HTMLElement;
|
|
17
|
+
var InlineText = class extends _classSuper {
|
|
18
|
+
static { _classThis = this; }
|
|
19
|
+
static {
|
|
20
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
21
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
22
|
+
InlineText = _classThis = _classDescriptor.value;
|
|
23
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
24
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return InlineText = _classThis;
|
|
28
|
+
})();
|
|
29
|
+
export { InlineText };
|
|
30
|
+
//# sourceMappingURL=InlineText.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
let InlineTruncation = (() => {
|
|
9
|
+
let _classDecorators = [Component('inline-truncation', [])];
|
|
10
|
+
let _classDescriptor;
|
|
11
|
+
let _classExtraInitializers = [];
|
|
12
|
+
let _classThis;
|
|
13
|
+
let _classSuper = HTMLElement;
|
|
14
|
+
var InlineTruncation = class extends _classSuper {
|
|
15
|
+
static { _classThis = this; }
|
|
16
|
+
static {
|
|
17
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
18
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
19
|
+
InlineTruncation = _classThis = _classDescriptor.value;
|
|
20
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
21
|
+
}
|
|
22
|
+
static XEnableCustomTruncation = 'x-text-custom-overflow';
|
|
23
|
+
connectedCallback() {
|
|
24
|
+
if (!CSS.supports('selector(:has(inline-truncation))')) {
|
|
25
|
+
if (this.parentElement?.tagName === 'X-TEXT'
|
|
26
|
+
&& !this.matches('inline-truncation ~ inline-truncation')) {
|
|
27
|
+
this.parentElement.setAttribute(InlineTruncation.XEnableCustomTruncation, '');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
this.setAttribute('slot', 'inline-truncation');
|
|
31
|
+
}
|
|
32
|
+
disconnectedCallback() {
|
|
33
|
+
this.parentElement?.removeAttribute(InlineTruncation.XEnableCustomTruncation);
|
|
34
|
+
}
|
|
35
|
+
static {
|
|
36
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return InlineTruncation = _classThis;
|
|
40
|
+
})();
|
|
41
|
+
export { InlineTruncation };
|
|
42
|
+
//# sourceMappingURL=InlineTruncation.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
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 { Component, registerAttributeHandler, } from '@lynx-js/web-elements-reactive';
|
|
8
|
+
let RawTextAttributes = (() => {
|
|
9
|
+
let _instanceExtraInitializers = [];
|
|
10
|
+
let _private_handleText_decorators;
|
|
11
|
+
let _private_handleText_descriptor;
|
|
12
|
+
return class RawTextAttributes {
|
|
13
|
+
static {
|
|
14
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
15
|
+
_private_handleText_decorators = [registerAttributeHandler('text', true)];
|
|
16
|
+
__esDecorate(this, _private_handleText_descriptor = { value: __setFunctionName(function (newVal) {
|
|
17
|
+
if (newVal) {
|
|
18
|
+
this.#dom.innerHTML = newVal;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
this.#dom.innerHTML = '';
|
|
22
|
+
}
|
|
23
|
+
}, "#handleText") }, _private_handleText_decorators, { kind: "method", name: "#handleText", static: false, private: true, access: { has: obj => #handleText in obj, get: obj => obj.#handleText }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
24
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
25
|
+
}
|
|
26
|
+
static observedAttributes = ['text'];
|
|
27
|
+
#dom = __runInitializers(this, _instanceExtraInitializers);
|
|
28
|
+
constructor(currentElement) {
|
|
29
|
+
this.#dom = currentElement;
|
|
30
|
+
}
|
|
31
|
+
get #handleText() { return _private_handleText_descriptor.value; }
|
|
32
|
+
};
|
|
33
|
+
})();
|
|
34
|
+
export { RawTextAttributes };
|
|
35
|
+
let RawText = (() => {
|
|
36
|
+
let _classDecorators = [Component('raw-text', [RawTextAttributes])];
|
|
37
|
+
let _classDescriptor;
|
|
38
|
+
let _classExtraInitializers = [];
|
|
39
|
+
let _classThis;
|
|
40
|
+
let _classSuper = HTMLElement;
|
|
41
|
+
var RawText = class extends _classSuper {
|
|
42
|
+
static { _classThis = this; }
|
|
43
|
+
static {
|
|
44
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
45
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
46
|
+
RawText = _classThis = _classDescriptor.value;
|
|
47
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
48
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
return RawText = _classThis;
|
|
52
|
+
})();
|
|
53
|
+
export { RawText };
|
|
54
|
+
//# sourceMappingURL=RawText.js.map
|
|
@@ -0,0 +1,49 @@
|
|
|
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, html } from '@lynx-js/web-elements-reactive';
|
|
8
|
+
import { LynxExposure } from '../common/Exposure.js';
|
|
9
|
+
import { XTextTruncation } from './XTextTruncation.js';
|
|
10
|
+
import { ScrollIntoView } from '../ScrollView/ScrollIntoView.js';
|
|
11
|
+
let XText = (() => {
|
|
12
|
+
let _classDecorators = [Component('x-text', [LynxExposure, XTextTruncation], html `<div id="inner-box" part="inner-box"><slot></slot><slot name="inline-truncation"></slot></div>`)];
|
|
13
|
+
let _classDescriptor;
|
|
14
|
+
let _classExtraInitializers = [];
|
|
15
|
+
let _classThis;
|
|
16
|
+
let _classSuper = HTMLElement;
|
|
17
|
+
var XText = class extends _classSuper {
|
|
18
|
+
static { _classThis = this; }
|
|
19
|
+
static {
|
|
20
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
21
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
22
|
+
XText = _classThis = _classDescriptor.value;
|
|
23
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
24
|
+
}
|
|
25
|
+
static notToFilterFalseAttributes = new Set(['tail-color-convert']);
|
|
26
|
+
superScrollIntoView(arg) {
|
|
27
|
+
super.scrollIntoView(arg);
|
|
28
|
+
}
|
|
29
|
+
scrollIntoView(arg) {
|
|
30
|
+
const lynxArg = arg;
|
|
31
|
+
if (typeof arg === 'object' && lynxArg.scrollIntoViewOptions) {
|
|
32
|
+
this.dispatchEvent(new CustomEvent(ScrollIntoView.eventName, {
|
|
33
|
+
bubbles: true,
|
|
34
|
+
composed: true,
|
|
35
|
+
detail: lynxArg.scrollIntoViewOptions,
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
super.scrollIntoView(arg);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
static {
|
|
43
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return XText = _classThis;
|
|
47
|
+
})();
|
|
48
|
+
export { XText };
|
|
49
|
+
//# sourceMappingURL=XText.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
|
|
2
|
+
import { XText } from './XText.js';
|
|
3
|
+
export declare class XTextTruncation implements InstanceType<AttributeReactiveClass<typeof XText>> {
|
|
4
|
+
#private;
|
|
5
|
+
static exceedMathLengthAttribute: "x-text-clipped";
|
|
6
|
+
static showInlineTruncation: "x-show-inline-truncation";
|
|
7
|
+
static observedAttributes: string[];
|
|
8
|
+
constructor(dom: XText);
|
|
9
|
+
dispose(): void;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
}
|