@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,99 @@
|
|
|
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 { bindToAttribute, genDomGetter, registerAttributeHandler, } from '@lynx-js/web-elements-reactive';
|
|
8
|
+
/**
|
|
9
|
+
* shared by x-input and x-input-ng
|
|
10
|
+
*/
|
|
11
|
+
let InputBaseAttributes = (() => {
|
|
12
|
+
let _instanceExtraInitializers = [];
|
|
13
|
+
let _private_handlerConfirmType_decorators;
|
|
14
|
+
let _private_handlerConfirmType_initializers = [];
|
|
15
|
+
let _private_handlerConfirmType_extraInitializers = [];
|
|
16
|
+
let _private_handlerMaxlength_decorators;
|
|
17
|
+
let _private_handlerMaxlength_initializers = [];
|
|
18
|
+
let _private_handlerMaxlength_extraInitializers = [];
|
|
19
|
+
let _private_handleReadonly_decorators;
|
|
20
|
+
let _private_handleReadonly_initializers = [];
|
|
21
|
+
let _private_handleReadonly_extraInitializers = [];
|
|
22
|
+
let _private_handleType_decorators;
|
|
23
|
+
let _private_handleType_descriptor;
|
|
24
|
+
let _private_handleSpellCheck_decorators;
|
|
25
|
+
let _private_handleSpellCheck_initializers = [];
|
|
26
|
+
let _private_handleSpellCheck_extraInitializers = [];
|
|
27
|
+
return class InputBaseAttributes {
|
|
28
|
+
static {
|
|
29
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
30
|
+
_private_handlerConfirmType_decorators = [registerAttributeHandler('confirm-type', true)];
|
|
31
|
+
_private_handlerMaxlength_decorators = [registerAttributeHandler('maxlength', true)];
|
|
32
|
+
_private_handleReadonly_decorators = [registerAttributeHandler('readonly', true)];
|
|
33
|
+
_private_handleType_decorators = [registerAttributeHandler('type', true)];
|
|
34
|
+
_private_handleSpellCheck_decorators = [registerAttributeHandler('ios-spell-check', true), registerAttributeHandler('spell-check', true)];
|
|
35
|
+
__esDecorate(this, _private_handleType_descriptor = { value: __setFunctionName(function (value) {
|
|
36
|
+
const attributeValue = value;
|
|
37
|
+
// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode
|
|
38
|
+
let inputMode = 'text';
|
|
39
|
+
let inputType = 'text';
|
|
40
|
+
if (attributeValue === 'digit') {
|
|
41
|
+
inputMode = 'numeric';
|
|
42
|
+
inputType = 'number';
|
|
43
|
+
}
|
|
44
|
+
else if (attributeValue === 'number') {
|
|
45
|
+
inputMode = 'decimal';
|
|
46
|
+
inputType = 'number';
|
|
47
|
+
}
|
|
48
|
+
else if (attributeValue === 'email') {
|
|
49
|
+
inputMode = 'email';
|
|
50
|
+
}
|
|
51
|
+
else if (attributeValue === 'tel') {
|
|
52
|
+
inputMode = 'tel';
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
inputType = attributeValue;
|
|
56
|
+
}
|
|
57
|
+
this.#setInputmode(inputMode);
|
|
58
|
+
this.#setType(inputType);
|
|
59
|
+
}, "#handleType") }, _private_handleType_decorators, { kind: "method", name: "#handleType", static: false, private: true, access: { has: obj => #handleType in obj, get: obj => obj.#handleType }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
60
|
+
__esDecorate(null, null, _private_handlerConfirmType_decorators, { kind: "field", name: "#handlerConfirmType", static: false, private: true, access: { has: obj => #handlerConfirmType in obj, get: obj => obj.#handlerConfirmType, set: (obj, value) => { obj.#handlerConfirmType = value; } }, metadata: _metadata }, _private_handlerConfirmType_initializers, _private_handlerConfirmType_extraInitializers);
|
|
61
|
+
__esDecorate(null, null, _private_handlerMaxlength_decorators, { kind: "field", name: "#handlerMaxlength", static: false, private: true, access: { has: obj => #handlerMaxlength in obj, get: obj => obj.#handlerMaxlength, set: (obj, value) => { obj.#handlerMaxlength = value; } }, metadata: _metadata }, _private_handlerMaxlength_initializers, _private_handlerMaxlength_extraInitializers);
|
|
62
|
+
__esDecorate(null, null, _private_handleReadonly_decorators, { kind: "field", name: "#handleReadonly", static: false, private: true, access: { has: obj => #handleReadonly in obj, get: obj => obj.#handleReadonly, set: (obj, value) => { obj.#handleReadonly = value; } }, metadata: _metadata }, _private_handleReadonly_initializers, _private_handleReadonly_extraInitializers);
|
|
63
|
+
__esDecorate(null, null, _private_handleSpellCheck_decorators, { kind: "field", name: "#handleSpellCheck", static: false, private: true, access: { has: obj => #handleSpellCheck in obj, get: obj => obj.#handleSpellCheck, set: (obj, value) => { obj.#handleSpellCheck = value; } }, metadata: _metadata }, _private_handleSpellCheck_initializers, _private_handleSpellCheck_extraInitializers);
|
|
64
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
65
|
+
}
|
|
66
|
+
static observedAttributes = [
|
|
67
|
+
'confirm-type',
|
|
68
|
+
'maxlength',
|
|
69
|
+
'readonly',
|
|
70
|
+
'type',
|
|
71
|
+
'ios-spell-check',
|
|
72
|
+
'spell-check',
|
|
73
|
+
];
|
|
74
|
+
#dom = __runInitializers(this, _instanceExtraInitializers);
|
|
75
|
+
#inputType = 'text';
|
|
76
|
+
#getInputElement = genDomGetter(() => this.#dom.shadowRoot, '#input');
|
|
77
|
+
#handlerConfirmType = __runInitializers(this, _private_handlerConfirmType_initializers, bindToAttribute(this.#getInputElement, 'enterkeyhint', (val) => {
|
|
78
|
+
if (val === null)
|
|
79
|
+
return 'send';
|
|
80
|
+
return val;
|
|
81
|
+
}));
|
|
82
|
+
#handlerMaxlength = (__runInitializers(this, _private_handlerConfirmType_extraInitializers), __runInitializers(this, _private_handlerMaxlength_initializers, bindToAttribute(this.#getInputElement, 'maxlength', (val) => {
|
|
83
|
+
if (val === null)
|
|
84
|
+
return '140';
|
|
85
|
+
return val;
|
|
86
|
+
})));
|
|
87
|
+
#handleReadonly = (__runInitializers(this, _private_handlerMaxlength_extraInitializers), __runInitializers(this, _private_handleReadonly_initializers, bindToAttribute(this.#getInputElement, 'readonly', (value) => (value !== null ? '' : null))));
|
|
88
|
+
#setType = (__runInitializers(this, _private_handleReadonly_extraInitializers), bindToAttribute(this.#getInputElement, 'type'));
|
|
89
|
+
#setInputmode = bindToAttribute(this.#getInputElement, 'inputmode');
|
|
90
|
+
get #handleType() { return _private_handleType_descriptor.value; }
|
|
91
|
+
#handleSpellCheck = __runInitializers(this, _private_handleSpellCheck_initializers, bindToAttribute(this.#getInputElement, 'spellcheck', (value) => (value === null ? 'false' : 'true')));
|
|
92
|
+
constructor(dom) {
|
|
93
|
+
__runInitializers(this, _private_handleSpellCheck_extraInitializers);
|
|
94
|
+
this.#dom = dom;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
})();
|
|
98
|
+
export { InputBaseAttributes };
|
|
99
|
+
//# sourceMappingURL=InputBaseAttributes.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
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 { bindToAttribute, bindToStyle, genDomGetter, registerAttributeHandler, } from '@lynx-js/web-elements-reactive';
|
|
8
|
+
let Placeholder = (() => {
|
|
9
|
+
let _private_handlerPlaceholder_decorators;
|
|
10
|
+
let _private_handlerPlaceholder_initializers = [];
|
|
11
|
+
let _private_handlerPlaceholder_extraInitializers = [];
|
|
12
|
+
let _private_handlerPlaceholderColor_decorators;
|
|
13
|
+
let _private_handlerPlaceholderColor_initializers = [];
|
|
14
|
+
let _private_handlerPlaceholderColor_extraInitializers = [];
|
|
15
|
+
let _private_handlerPlaceholderFontFamily_decorators;
|
|
16
|
+
let _private_handlerPlaceholderFontFamily_initializers = [];
|
|
17
|
+
let _private_handlerPlaceholderFontFamily_extraInitializers = [];
|
|
18
|
+
let _private_handlerPlaceholderFontSize_decorators;
|
|
19
|
+
let _private_handlerPlaceholderFontSize_initializers = [];
|
|
20
|
+
let _private_handlerPlaceholderFontSize_extraInitializers = [];
|
|
21
|
+
let _private_handlerPlaceholderFontWeight_decorators;
|
|
22
|
+
let _private_handlerPlaceholderFontWeight_initializers = [];
|
|
23
|
+
let _private_handlerPlaceholderFontWeight_extraInitializers = [];
|
|
24
|
+
return class Placeholder {
|
|
25
|
+
static {
|
|
26
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
27
|
+
_private_handlerPlaceholder_decorators = [registerAttributeHandler('placeholder', true)];
|
|
28
|
+
_private_handlerPlaceholderColor_decorators = [registerAttributeHandler('placeholder-color', true)];
|
|
29
|
+
_private_handlerPlaceholderFontFamily_decorators = [registerAttributeHandler('placeholder-font-family', true)];
|
|
30
|
+
_private_handlerPlaceholderFontSize_decorators = [registerAttributeHandler('placeholder-font-size', true)];
|
|
31
|
+
_private_handlerPlaceholderFontWeight_decorators = [registerAttributeHandler('placeholder-font-weight', true)];
|
|
32
|
+
__esDecorate(null, null, _private_handlerPlaceholder_decorators, { kind: "field", name: "#handlerPlaceholder", static: false, private: true, access: { has: obj => #handlerPlaceholder in obj, get: obj => obj.#handlerPlaceholder, set: (obj, value) => { obj.#handlerPlaceholder = value; } }, metadata: _metadata }, _private_handlerPlaceholder_initializers, _private_handlerPlaceholder_extraInitializers);
|
|
33
|
+
__esDecorate(null, null, _private_handlerPlaceholderColor_decorators, { kind: "field", name: "#handlerPlaceholderColor", static: false, private: true, access: { has: obj => #handlerPlaceholderColor in obj, get: obj => obj.#handlerPlaceholderColor, set: (obj, value) => { obj.#handlerPlaceholderColor = value; } }, metadata: _metadata }, _private_handlerPlaceholderColor_initializers, _private_handlerPlaceholderColor_extraInitializers);
|
|
34
|
+
__esDecorate(null, null, _private_handlerPlaceholderFontFamily_decorators, { kind: "field", name: "#handlerPlaceholderFontFamily", static: false, private: true, access: { has: obj => #handlerPlaceholderFontFamily in obj, get: obj => obj.#handlerPlaceholderFontFamily, set: (obj, value) => { obj.#handlerPlaceholderFontFamily = value; } }, metadata: _metadata }, _private_handlerPlaceholderFontFamily_initializers, _private_handlerPlaceholderFontFamily_extraInitializers);
|
|
35
|
+
__esDecorate(null, null, _private_handlerPlaceholderFontSize_decorators, { kind: "field", name: "#handlerPlaceholderFontSize", static: false, private: true, access: { has: obj => #handlerPlaceholderFontSize in obj, get: obj => obj.#handlerPlaceholderFontSize, set: (obj, value) => { obj.#handlerPlaceholderFontSize = value; } }, metadata: _metadata }, _private_handlerPlaceholderFontSize_initializers, _private_handlerPlaceholderFontSize_extraInitializers);
|
|
36
|
+
__esDecorate(null, null, _private_handlerPlaceholderFontWeight_decorators, { kind: "field", name: "#handlerPlaceholderFontWeight", static: false, private: true, access: { has: obj => #handlerPlaceholderFontWeight in obj, get: obj => obj.#handlerPlaceholderFontWeight, set: (obj, value) => { obj.#handlerPlaceholderFontWeight = value; } }, metadata: _metadata }, _private_handlerPlaceholderFontWeight_initializers, _private_handlerPlaceholderFontWeight_extraInitializers);
|
|
37
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
38
|
+
}
|
|
39
|
+
static observedAttributes = [
|
|
40
|
+
'placeholder',
|
|
41
|
+
'placeholder-color',
|
|
42
|
+
'placeholder-font-family',
|
|
43
|
+
'placeholder-font-size',
|
|
44
|
+
'placeholder-font-weight',
|
|
45
|
+
];
|
|
46
|
+
#dom;
|
|
47
|
+
#getInputElement = genDomGetter(() => this.#dom.shadowRoot, '#input');
|
|
48
|
+
#handlerPlaceholder = __runInitializers(this, _private_handlerPlaceholder_initializers, bindToAttribute(this.#getInputElement, 'placeholder'));
|
|
49
|
+
#handlerPlaceholderColor = (__runInitializers(this, _private_handlerPlaceholder_extraInitializers), __runInitializers(this, _private_handlerPlaceholderColor_initializers, bindToStyle(this.#getInputElement, '--placeholder-color', undefined, true)));
|
|
50
|
+
#handlerPlaceholderFontFamily = (__runInitializers(this, _private_handlerPlaceholderColor_extraInitializers), __runInitializers(this, _private_handlerPlaceholderFontFamily_initializers, bindToStyle(this.#getInputElement, '--placeholder-font-family', undefined, true)));
|
|
51
|
+
#handlerPlaceholderFontSize = (__runInitializers(this, _private_handlerPlaceholderFontFamily_extraInitializers), __runInitializers(this, _private_handlerPlaceholderFontSize_initializers, bindToStyle(this.#getInputElement, '--placeholder-font-size', undefined, true)));
|
|
52
|
+
#handlerPlaceholderFontWeight = (__runInitializers(this, _private_handlerPlaceholderFontSize_extraInitializers), __runInitializers(this, _private_handlerPlaceholderFontWeight_initializers, bindToStyle(this.#getInputElement, '--placeholder-font-weight', undefined, true)));
|
|
53
|
+
constructor(dom) {
|
|
54
|
+
__runInitializers(this, _private_handlerPlaceholderFontWeight_extraInitializers);
|
|
55
|
+
this.#dom = dom;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
})();
|
|
59
|
+
export { Placeholder };
|
|
60
|
+
//# sourceMappingURL=Placeholder.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare class XInput extends HTMLElement {
|
|
2
|
+
#private;
|
|
3
|
+
addText(params: {
|
|
4
|
+
text: string;
|
|
5
|
+
}): void;
|
|
6
|
+
controlKeyBoard(params: {
|
|
7
|
+
action: number;
|
|
8
|
+
}): void;
|
|
9
|
+
setValue(params: {
|
|
10
|
+
value: string;
|
|
11
|
+
index: number;
|
|
12
|
+
}): void;
|
|
13
|
+
sendDelEvent(params: {
|
|
14
|
+
action: number;
|
|
15
|
+
length: number;
|
|
16
|
+
}): void;
|
|
17
|
+
setInputFilter(params: {
|
|
18
|
+
pattern: string;
|
|
19
|
+
}): void;
|
|
20
|
+
select(): void;
|
|
21
|
+
setSelectionRange(params: {
|
|
22
|
+
selectionStart: number;
|
|
23
|
+
selectionEnd: number;
|
|
24
|
+
}): void;
|
|
25
|
+
focus(options?: FocusOptions): void;
|
|
26
|
+
blur(): void;
|
|
27
|
+
connectedCallback(): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
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, genDomGetter, html } from '@lynx-js/web-elements-reactive';
|
|
8
|
+
import { InputBaseAttributes } from './InputBaseAttributes.js';
|
|
9
|
+
import { Placeholder } from './Placeholder.js';
|
|
10
|
+
import { XInputAttribute } from './XInputAttribute.js';
|
|
11
|
+
import { XInputEvents } from './XInputEvents.js';
|
|
12
|
+
import { LynxExposure } from '../common/Exposure.js';
|
|
13
|
+
let XInput = (() => {
|
|
14
|
+
let _classDecorators = [Component('x-input', [
|
|
15
|
+
LynxExposure,
|
|
16
|
+
Placeholder,
|
|
17
|
+
XInputAttribute,
|
|
18
|
+
InputBaseAttributes,
|
|
19
|
+
XInputEvents,
|
|
20
|
+
], html ` <style>
|
|
21
|
+
#input:focus {
|
|
22
|
+
outline: none;
|
|
23
|
+
}
|
|
24
|
+
#form {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
</style>
|
|
28
|
+
<form id="form" part="form" method="dialog">
|
|
29
|
+
<input
|
|
30
|
+
id="input"
|
|
31
|
+
part="input"
|
|
32
|
+
step="any"
|
|
33
|
+
type="text"
|
|
34
|
+
inputmode="text"
|
|
35
|
+
spell-check="true"
|
|
36
|
+
/>
|
|
37
|
+
</form>`)];
|
|
38
|
+
let _classDescriptor;
|
|
39
|
+
let _classExtraInitializers = [];
|
|
40
|
+
let _classThis;
|
|
41
|
+
let _classSuper = HTMLElement;
|
|
42
|
+
var XInput = class extends _classSuper {
|
|
43
|
+
static { _classThis = this; }
|
|
44
|
+
static {
|
|
45
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
46
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
47
|
+
XInput = _classThis = _classDescriptor.value;
|
|
48
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
49
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
50
|
+
}
|
|
51
|
+
#getInput = genDomGetter(() => this.shadowRoot, '#input');
|
|
52
|
+
addText(params) {
|
|
53
|
+
const { text } = params;
|
|
54
|
+
const input = this.#getInput();
|
|
55
|
+
const selectionStart = input.selectionStart;
|
|
56
|
+
if (selectionStart === null) {
|
|
57
|
+
input.value = text;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const currentValue = input.value;
|
|
61
|
+
input.value = currentValue.slice(0, selectionStart)
|
|
62
|
+
+ text
|
|
63
|
+
+ currentValue.slice(selectionStart);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
controlKeyBoard(params) {
|
|
67
|
+
const { action } = params;
|
|
68
|
+
if (action === 0 || action === 1) {
|
|
69
|
+
this.focus();
|
|
70
|
+
}
|
|
71
|
+
else if (action === 2 || action === 3) {
|
|
72
|
+
this.blur();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
setValue(params) {
|
|
76
|
+
const input = this.#getInput();
|
|
77
|
+
input.value = params.value;
|
|
78
|
+
let cursorIndex;
|
|
79
|
+
if ((cursorIndex = params.index)) {
|
|
80
|
+
input.setSelectionRange(cursorIndex, cursorIndex);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
sendDelEvent(params) {
|
|
84
|
+
let { action, length } = params;
|
|
85
|
+
const input = this.#getInput();
|
|
86
|
+
if (action === 1) {
|
|
87
|
+
length = 1;
|
|
88
|
+
}
|
|
89
|
+
const selectionStart = input.selectionStart;
|
|
90
|
+
if (selectionStart === null) {
|
|
91
|
+
const currentValue = input.value;
|
|
92
|
+
input.value = input.value.substring(0, currentValue.length - length);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const currentValue = input.value;
|
|
96
|
+
input.value = currentValue.slice(0, selectionStart - length)
|
|
97
|
+
+ currentValue.slice(selectionStart);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
setInputFilter(params) {
|
|
101
|
+
this.#getInput().setAttribute('pattern', params.pattern);
|
|
102
|
+
}
|
|
103
|
+
select() {
|
|
104
|
+
const input = this.#getInput();
|
|
105
|
+
input.setSelectionRange(0, input.value.length);
|
|
106
|
+
}
|
|
107
|
+
setSelectionRange(params) {
|
|
108
|
+
this.#getInput().setSelectionRange(params.selectionStart, params.selectionEnd);
|
|
109
|
+
}
|
|
110
|
+
focus(options) {
|
|
111
|
+
this.#getInput().focus(options);
|
|
112
|
+
}
|
|
113
|
+
blur() {
|
|
114
|
+
this.#getInput().blur();
|
|
115
|
+
}
|
|
116
|
+
connectedCallback() {
|
|
117
|
+
const input = this.#getInput();
|
|
118
|
+
if (this.getAttribute('confirm-type') === null) {
|
|
119
|
+
input.setAttribute('confirm-type', 'send');
|
|
120
|
+
}
|
|
121
|
+
if (this.getAttribute('maxlength') === null) {
|
|
122
|
+
input.setAttribute('maxlength', '140');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
return XInput = _classThis;
|
|
127
|
+
})();
|
|
128
|
+
export { XInput };
|
|
129
|
+
//# sourceMappingURL=XInput.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
|
|
2
|
+
/**
|
|
3
|
+
* shared by x-input and x-input-ng
|
|
4
|
+
*/
|
|
5
|
+
export declare class XInputAttribute implements InstanceType<AttributeReactiveClass<typeof HTMLElement>> {
|
|
6
|
+
#private;
|
|
7
|
+
static observedAttributes: string[];
|
|
8
|
+
constructor(dom: HTMLElement);
|
|
9
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 { bindToAttribute, genDomGetter, registerAttributeHandler, } from '@lynx-js/web-elements-reactive';
|
|
8
|
+
/**
|
|
9
|
+
* shared by x-input and x-input-ng
|
|
10
|
+
*/
|
|
11
|
+
let XInputAttribute = (() => {
|
|
12
|
+
let _instanceExtraInitializers = [];
|
|
13
|
+
let _private_handleValue_decorators;
|
|
14
|
+
let _private_handleValue_descriptor;
|
|
15
|
+
let _private_handleDisabled_decorators;
|
|
16
|
+
let _private_handleDisabled_initializers = [];
|
|
17
|
+
let _private_handleDisabled_extraInitializers = [];
|
|
18
|
+
return class XInputAttribute {
|
|
19
|
+
static {
|
|
20
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
21
|
+
_private_handleValue_decorators = [registerAttributeHandler('value', false)];
|
|
22
|
+
_private_handleDisabled_decorators = [registerAttributeHandler('disabled', true)];
|
|
23
|
+
__esDecorate(this, _private_handleValue_descriptor = { value: __setFunctionName(function (newValue) {
|
|
24
|
+
if (newValue) {
|
|
25
|
+
const maxlength = parseFloat(this.#dom.getAttribute('maxlength') ?? '');
|
|
26
|
+
if (!isNaN(maxlength))
|
|
27
|
+
newValue = newValue.substring(0, maxlength);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
newValue = '';
|
|
31
|
+
}
|
|
32
|
+
const input = this.#getInputElement();
|
|
33
|
+
if (input.value !== newValue) {
|
|
34
|
+
input.value = newValue;
|
|
35
|
+
}
|
|
36
|
+
}, "#handleValue") }, _private_handleValue_decorators, { kind: "method", name: "#handleValue", static: false, private: true, access: { has: obj => #handleValue in obj, get: obj => obj.#handleValue }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
37
|
+
__esDecorate(null, null, _private_handleDisabled_decorators, { kind: "field", name: "#handleDisabled", static: false, private: true, access: { has: obj => #handleDisabled in obj, get: obj => obj.#handleDisabled, set: (obj, value) => { obj.#handleDisabled = value; } }, metadata: _metadata }, _private_handleDisabled_initializers, _private_handleDisabled_extraInitializers);
|
|
38
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
39
|
+
}
|
|
40
|
+
static observedAttributes = ['value', 'disabled'];
|
|
41
|
+
#dom = __runInitializers(this, _instanceExtraInitializers);
|
|
42
|
+
#getInputElement = genDomGetter(() => this.#dom.shadowRoot, '#input');
|
|
43
|
+
get #handleValue() { return _private_handleValue_descriptor.value; }
|
|
44
|
+
#handleDisabled = __runInitializers(this, _private_handleDisabled_initializers, bindToAttribute(this.#getInputElement, 'disabled', (value) => (value !== null ? '' : null)));
|
|
45
|
+
constructor(dom) {
|
|
46
|
+
__runInitializers(this, _private_handleDisabled_extraInitializers);
|
|
47
|
+
this.#dom = dom;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
})();
|
|
51
|
+
export { XInputAttribute };
|
|
52
|
+
//# sourceMappingURL=XInputAttribute.js.map
|
|
@@ -0,0 +1,111 @@
|
|
|
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 { renameEvent } from '../common/renameEvent.js';
|
|
10
|
+
let XInputEvents = (() => {
|
|
11
|
+
let _instanceExtraInitializers = [];
|
|
12
|
+
let _private_handleEnableConfirmEvent_decorators;
|
|
13
|
+
let _private_handleEnableConfirmEvent_descriptor;
|
|
14
|
+
let _private_handleSendComposingInput_decorators;
|
|
15
|
+
let _private_handleSendComposingInput_descriptor;
|
|
16
|
+
return class XInputEvents {
|
|
17
|
+
static {
|
|
18
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
19
|
+
_private_handleEnableConfirmEvent_decorators = [registerAttributeHandler('x-enable-input-event', true)];
|
|
20
|
+
_private_handleSendComposingInput_decorators = [registerAttributeHandler('send-composing-input', true)];
|
|
21
|
+
__esDecorate(this, _private_handleEnableConfirmEvent_descriptor = { value: __setFunctionName(function (newValue) {
|
|
22
|
+
const input = this.#getInputElement();
|
|
23
|
+
if (newValue !== null) {
|
|
24
|
+
input.addEventListener('input', this.#teleportInput, { passive: true });
|
|
25
|
+
input.addEventListener('compositionend', this.#teleportCompositionendInput, { passive: true });
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
input.addEventListener('input', this.#teleportInput, { passive: true });
|
|
29
|
+
input.removeEventListener('compositionend', this.#teleportCompositionendInput);
|
|
30
|
+
}
|
|
31
|
+
}, "#handleEnableConfirmEvent") }, _private_handleEnableConfirmEvent_decorators, { kind: "method", name: "#handleEnableConfirmEvent", static: false, private: true, access: { has: obj => #handleEnableConfirmEvent in obj, get: obj => obj.#handleEnableConfirmEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
32
|
+
__esDecorate(this, _private_handleSendComposingInput_descriptor = { value: __setFunctionName(function (newVal) {
|
|
33
|
+
this.#sendComposingInput = newVal !== null;
|
|
34
|
+
}, "#handleSendComposingInput") }, _private_handleSendComposingInput_decorators, { kind: "method", name: "#handleSendComposingInput", static: false, private: true, access: { has: obj => #handleSendComposingInput in obj, get: obj => obj.#handleSendComposingInput }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
35
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
36
|
+
}
|
|
37
|
+
static observedAttributes = ['x-enable-input-event', 'send-composing-input'];
|
|
38
|
+
#dom = __runInitializers(this, _instanceExtraInitializers);
|
|
39
|
+
#sendComposingInput = false;
|
|
40
|
+
#getInputElement = genDomGetter(() => this.#dom.shadowRoot, '#input');
|
|
41
|
+
#getFormElement = genDomGetter(() => this.#dom.shadowRoot, '#form');
|
|
42
|
+
get #handleEnableConfirmEvent() { return _private_handleEnableConfirmEvent_descriptor.value; }
|
|
43
|
+
get #handleSendComposingInput() { return _private_handleSendComposingInput_descriptor.value; }
|
|
44
|
+
#teleportEvent = (event) => {
|
|
45
|
+
const eventType = renameEvent[event.type] ?? event.type;
|
|
46
|
+
this.#dom.dispatchEvent(new CustomEvent(eventType, {
|
|
47
|
+
...commonComponentEventSetting,
|
|
48
|
+
detail: {
|
|
49
|
+
value: this.#getInputElement().value,
|
|
50
|
+
},
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
#teleportInput = (event) => {
|
|
54
|
+
const input = this.#getInputElement();
|
|
55
|
+
const value = input.value;
|
|
56
|
+
const isComposing = event.isComposing;
|
|
57
|
+
if (isComposing && !this.#sendComposingInput)
|
|
58
|
+
return;
|
|
59
|
+
this.#dom.dispatchEvent(new CustomEvent('input', {
|
|
60
|
+
...commonComponentEventSetting,
|
|
61
|
+
detail: {
|
|
62
|
+
value,
|
|
63
|
+
textLength: value.length,
|
|
64
|
+
cursor: input.selectionStart,
|
|
65
|
+
isComposing,
|
|
66
|
+
},
|
|
67
|
+
}));
|
|
68
|
+
};
|
|
69
|
+
#teleportCompositionendInput = () => {
|
|
70
|
+
const input = this.#getInputElement();
|
|
71
|
+
const value = input.value;
|
|
72
|
+
// if #sendComposingInput set true, #teleportInput will send detail
|
|
73
|
+
if (!this.#sendComposingInput) {
|
|
74
|
+
this.#dom.dispatchEvent(new CustomEvent('input', {
|
|
75
|
+
...commonComponentEventSetting,
|
|
76
|
+
detail: {
|
|
77
|
+
value,
|
|
78
|
+
textLength: value.length,
|
|
79
|
+
cursor: input.selectionStart,
|
|
80
|
+
},
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
#blockHtmlEvent = (event) => {
|
|
85
|
+
if (event.target === this.#getInputElement()
|
|
86
|
+
&& typeof event.detail === 'number') {
|
|
87
|
+
event.stopImmediatePropagation();
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
constructor(dom) {
|
|
91
|
+
this.#dom = dom;
|
|
92
|
+
const inputElement = this.#getInputElement();
|
|
93
|
+
const formElement = this.#getFormElement();
|
|
94
|
+
inputElement.addEventListener('blur', this.#teleportEvent, {
|
|
95
|
+
passive: true,
|
|
96
|
+
});
|
|
97
|
+
inputElement.addEventListener('focus', this.#teleportEvent, {
|
|
98
|
+
passive: true,
|
|
99
|
+
});
|
|
100
|
+
formElement.addEventListener('submit', this.#teleportEvent, {
|
|
101
|
+
passive: true,
|
|
102
|
+
});
|
|
103
|
+
// use form to stop propagation
|
|
104
|
+
formElement.addEventListener('input', this.#blockHtmlEvent, {
|
|
105
|
+
passive: true,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
})();
|
|
110
|
+
export { XInputEvents };
|
|
111
|
+
//# sourceMappingURL=XInputEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { XInput } from './XInput.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { LynxExposure } from '../common/Exposure.js';
|
|
9
|
+
let ListItem = (() => {
|
|
10
|
+
let _classDecorators = [Component('list-item', [LynxExposure])];
|
|
11
|
+
let _classDescriptor;
|
|
12
|
+
let _classExtraInitializers = [];
|
|
13
|
+
let _classThis;
|
|
14
|
+
let _classSuper = HTMLElement;
|
|
15
|
+
var ListItem = class extends _classSuper {
|
|
16
|
+
static { _classThis = this; }
|
|
17
|
+
static {
|
|
18
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
19
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
20
|
+
ListItem = _classThis = _classDescriptor.value;
|
|
21
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
22
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return ListItem = _classThis;
|
|
26
|
+
})();
|
|
27
|
+
export { ListItem };
|
|
28
|
+
//# sourceMappingURL=ListItem.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare class XList extends HTMLElement {
|
|
2
|
+
#private;
|
|
3
|
+
static readonly notToFilterFalseAttributes: Set<string>;
|
|
4
|
+
get scrollTop(): number;
|
|
5
|
+
set scrollTop(val: number);
|
|
6
|
+
get scrollLeft(): number;
|
|
7
|
+
set scrollLeft(val: number);
|
|
8
|
+
get __scrollTop(): number;
|
|
9
|
+
get __scrollLeft(): number;
|
|
10
|
+
scrollToPosition(params: {
|
|
11
|
+
index: number;
|
|
12
|
+
smooth?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* @description The offset of the content
|
|
15
|
+
* @defaultValue 0
|
|
16
|
+
*/
|
|
17
|
+
offset?: `${number}px` | `${number}rpx` | `${number}ppx` | number;
|
|
18
|
+
}): void;
|
|
19
|
+
autoScroll(params: {
|
|
20
|
+
/**
|
|
21
|
+
* @description The scrolling interval per second, supports positive and negative
|
|
22
|
+
* @defaultValue null
|
|
23
|
+
*/
|
|
24
|
+
rate: `${number}px` | `${number}rpx` | `${number}ppx` | number;
|
|
25
|
+
/**
|
|
26
|
+
* @description start/pause autoScroll
|
|
27
|
+
* @defaultValue true
|
|
28
|
+
*/
|
|
29
|
+
start: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @description Whether to stop automatically when sliding to the bottom
|
|
32
|
+
* @defaultValue true
|
|
33
|
+
*/
|
|
34
|
+
autoStop: boolean;
|
|
35
|
+
}): void;
|
|
36
|
+
getScrollContainerInfo(): {
|
|
37
|
+
scrollTop: number;
|
|
38
|
+
scrollLeft: number;
|
|
39
|
+
scrollHeight: number;
|
|
40
|
+
scrollWidth: number;
|
|
41
|
+
};
|
|
42
|
+
getVisibleCells: () => {
|
|
43
|
+
id: string | null;
|
|
44
|
+
itemKey: string | null;
|
|
45
|
+
bottom: number;
|
|
46
|
+
top: number;
|
|
47
|
+
left: number;
|
|
48
|
+
right: number;
|
|
49
|
+
index: number;
|
|
50
|
+
}[];
|
|
51
|
+
connectedCallback(): void;
|
|
52
|
+
}
|