@lynx-js/web-elements 0.2.4 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/ScrollView/FadeEdgeLengthAttribute.d.ts +2 -2
  3. package/dist/ScrollView/ScrollAttributes.d.ts +2 -2
  4. package/dist/ScrollView/ScrollIntoView.d.ts +2 -2
  5. package/dist/ScrollView/ScrollIntoView.js +6 -0
  6. package/dist/ScrollView/ScrollView.js +1 -1
  7. package/dist/ScrollView/ScrollViewEvents.d.ts +1 -1
  8. package/dist/ScrollView/ScrollViewEvents.js +64 -43
  9. package/dist/XAudioTT/XAudioAttribute.d.ts +1 -1
  10. package/dist/XAudioTT/XAudioEvents.d.ts +1 -1
  11. package/dist/XCanvas/CanvasAttributes.d.ts +2 -2
  12. package/dist/XFoldViewNg/XFoldviewHeaderNgFeatures.d.ts +1 -1
  13. package/dist/XFoldViewNg/XFoldviewNgEvents.d.ts +2 -2
  14. package/dist/XFoldViewNg/XFoldviewSlotNgTouchEventsHandler.d.ts +1 -1
  15. package/dist/XImage/DropShadow.d.ts +1 -1
  16. package/dist/XImage/ImageEvents.d.ts +2 -2
  17. package/dist/XImage/ImageEvents.js +15 -14
  18. package/dist/XInput/InputBaseAttributes.d.ts +1 -1
  19. package/dist/XInput/Placeholder.d.ts +1 -1
  20. package/dist/XInput/XInputAttribute.d.ts +1 -1
  21. package/dist/XInput/XInputEvents.d.ts +1 -1
  22. package/dist/XInput/XInputEvents.js +5 -4
  23. package/dist/XList/XList.js +1 -1
  24. package/dist/XList/XListAttributes.d.ts +1 -1
  25. package/dist/XList/XListEvents.d.ts +1 -1
  26. package/dist/XList/XListEvents.js +209 -188
  27. package/dist/XOverlayNg/XOverlayAttributes.d.ts +2 -2
  28. package/dist/XOverlayNg/XOverlayAttributes.js +7 -2
  29. package/dist/XRefreshView/XRefreshSubElementIntersectionObserver.d.ts +3 -3
  30. package/dist/XRefreshView/XRefreshViewEventsEmitter.d.ts +2 -2
  31. package/dist/XRefreshView/XRefreshViewEventsEmitter.js +45 -93
  32. package/dist/XSvg/XSvg.d.ts +1 -1
  33. package/dist/XSvg/XSvg.js +0 -2
  34. package/dist/XSwiper/XSwiperAutoScroll.d.ts +2 -2
  35. package/dist/XSwiper/XSwiperCircular.d.ts +2 -2
  36. package/dist/XSwiper/XSwiperCircular.js +1 -2
  37. package/dist/XSwiper/XSwiperEvents.d.ts +2 -2
  38. package/dist/XSwiper/XSwiperEvents.js +18 -20
  39. package/dist/XSwiper/XSwiperIndicator.d.ts +2 -2
  40. package/dist/XSwiper/XSwiperIndicator.js +0 -1
  41. package/dist/XText/InlineImage.d.ts +1 -1
  42. package/dist/XText/XTextTruncation.d.ts +1 -1
  43. package/dist/XText/XTextTruncation.js +5 -5
  44. package/dist/XTextarea/Placeholder.d.ts +1 -1
  45. package/dist/XTextarea/Placeholder.js +1 -0
  46. package/dist/XTextarea/TextareaBaseAttributes.d.ts +1 -1
  47. package/dist/XTextarea/XTextareaAttributes.d.ts +1 -1
  48. package/dist/XTextarea/XTextareaEvents.d.ts +1 -1
  49. package/dist/XTextarea/XTextareaEvents.js +5 -4
  50. package/dist/XView/BlurRadius.d.ts +2 -2
  51. package/dist/XViewpagerNg/XViewpagerNgEvents.d.ts +2 -2
  52. package/dist/XViewpagerNg/XViewpagerNgEvents.js +40 -32
  53. package/dist/common/Exposure.d.ts +4 -0
  54. package/dist/common/Exposure.js +14 -5
  55. package/dist/common/bindToIntersectionObserver.d.ts +1 -1
  56. package/package.json +7 -6
  57. package/src/common-css/linear.css +1 -11
  58. package/dist/lazy.d.ts +0 -1
  59. package/dist/lazy.js +0 -106
package/CHANGELOG.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # @lynx-js/web-elements
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - refactor: remove web-elements/lazy and loadNewTag ([#123](https://github.com/lynx-family/lynx-stack/pull/123))
8
+
9
+ - remove @lynx-js/web-elements/lazy
10
+ - remove loadElement
11
+ - remove loadNewTag callback
12
+
13
+ **This is a breaking change**
14
+
15
+ Now we removed the default lazy loading preinstalled in web-core
16
+
17
+ Please add the following statement in your web project
18
+
19
+ ```
20
+ import "@lynx-js/web-elements/all";
21
+ ```
22
+
23
+ ### Patch Changes
24
+
25
+ - feat: never require the x-enable-xx-event attributes ([#157](https://github.com/lynx-family/lynx-stack/pull/157))
26
+
27
+ After this commit, we do not need user to add `x-enable-xx-event` to enable corresponding events
28
+
29
+ - feat: add support for `<lynx-view/>` with shadowroot ([#198](https://github.com/lynx-family/lynx-stack/pull/198))
30
+
31
+ add a minor logic in `<x-overlay-ng>` to be compatiable with the <lynx-view> with a shadowroot
32
+
33
+ - Updated dependencies [[`4c2ee65`](https://github.com/lynx-family/lynx-stack/commit/4c2ee65368eb4b39722ed36305101fe89a782b1a)]:
34
+ - @lynx-js/web-elements-reactive@0.2.0
35
+
36
+ ## 0.3.0
37
+
38
+ ### Minor Changes
39
+
40
+ - feat: support `justify-content`, `align-self` in linear container ([#37](https://github.com/lynx-family/lynx-stack/pull/37))
41
+
42
+ Now these two properties could work in a linear container.
43
+
44
+ We don't transforms the `justify-content` and `align-self` to css vars any more.
45
+
46
+ The previous version of `@lynx-js/web-core` won't work with current `@lynx-js/web-core` after this change.
47
+
48
+ ### Patch Changes
49
+
50
+ - Support NPM provenance. ([#30](https://github.com/lynx-family/lynx-stack/pull/30))
51
+
52
+ - Updated dependencies [[`c617453`](https://github.com/lynx-family/lynx-stack/commit/c617453aea967aba702967deb2916b5c883f03bb)]:
53
+ - @lynx-js/web-elements-reactive@0.1.1
54
+
3
55
  ## 0.2.4
4
56
 
5
57
  ### Patch Changes
@@ -1,5 +1,5 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
- import { ScrollView } from './ScrollView.js';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
+ import type { ScrollView } from './ScrollView.js';
3
3
  export declare class FadeEdgeLengthAttribute implements InstanceType<AttributeReactiveClass<typeof ScrollView>> {
4
4
  #private;
5
5
  static observedAttributes: string[];
@@ -1,5 +1,5 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
- import { ScrollView } from './ScrollView.js';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
+ import type { ScrollView } from './ScrollView.js';
3
3
  export declare class ScrollAttributes implements InstanceType<AttributeReactiveClass<typeof ScrollView>> {
4
4
  #private;
5
5
  static observedAttributes: string[];
@@ -1,5 +1,5 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
- import { ScrollView } from './ScrollView.js';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
+ import type { ScrollView } from './ScrollView.js';
3
3
  export declare class ScrollIntoView implements InstanceType<AttributeReactiveClass<typeof ScrollView>> {
4
4
  #private;
5
5
  static eventName: "__scrollIntoView";
@@ -1,3 +1,9 @@
1
+ /*
2
+ // Copyright 2024 The Lynx Authors. All rights reserved.
3
+ // Licensed under the Apache License Version 2.0 that can be found in the
4
+ // LICENSE file in the root directory of this source tree.
5
+ */
6
+ import {} from '@lynx-js/web-elements-reactive';
1
7
  export class ScrollIntoView {
2
8
  static eventName = '__scrollIntoView';
3
9
  static observedAttributes = [];
@@ -9,7 +9,7 @@ import { FadeEdgeLengthAttribute } from './FadeEdgeLengthAttribute.js';
9
9
  import { ScrollAttributes } from './ScrollAttributes.js';
10
10
  import { ScrollViewEvents } from './ScrollViewEvents.js';
11
11
  import { ScrollIntoView } from './ScrollIntoView.js';
12
- import { Component, html } from '@lynx-js/web-elements-reactive';
12
+ import { Component, genDomGetter, html } from '@lynx-js/web-elements-reactive';
13
13
  import { scrollContainerDom } from '../common/constants.js';
14
14
  let ScrollView = (() => {
15
15
  let _classDecorators = [Component('scroll-view', [
@@ -1,5 +1,5 @@
1
1
  import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
- import { ScrollView } from './ScrollView.js';
2
+ import type { ScrollView } from './ScrollView.js';
3
3
  export declare class ScrollViewEvents implements InstanceType<AttributeReactiveClass<typeof ScrollView>> {
4
4
  #private;
5
5
  constructor(dom: ScrollView);
@@ -1,4 +1,4 @@
1
- import { __esDecorate, __runInitializers, __setFunctionName } from "tslib";
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,59 +8,49 @@ import { bindToStyle, genDomGetter, registerAttributeHandler, } from '@lynx-js/w
8
8
  import { commonComponentEventSetting } from '../common/commonEventInitConfiguration.js';
9
9
  import { bindToIntersectionObserver } from '../common/bindToIntersectionObserver.js';
10
10
  import { useScrollEnd } from '../common/constants.js';
11
+ import { registerEventEnableStatusChangeHandler } from '@lynx-js/web-elements-reactive';
11
12
  let ScrollViewEvents = (() => {
12
- let _instanceExtraInitializers = [];
13
- let _private_updateUpperIntersectionObserver_decorators;
14
- let _private_updateUpperIntersectionObserver_initializers = [];
15
- let _private_updateUpperIntersectionObserver_extraInitializers = [];
16
- let _private_updateLowerIntersectionObserver_decorators;
17
- let _private_updateLowerIntersectionObserver_initializers = [];
18
- let _private_updateLowerIntersectionObserver_extraInitializers = [];
13
+ let _private_handleScrollUpperThresholdEventEnabled_decorators;
14
+ let _private_handleScrollUpperThresholdEventEnabled_initializers = [];
15
+ let _private_handleScrollUpperThresholdEventEnabled_extraInitializers = [];
16
+ let _private_handleScrollLowerThresholdEventEnabled_decorators;
17
+ let _private_handleScrollLowerThresholdEventEnabled_initializers = [];
18
+ let _private_handleScrollLowerThresholdEventEnabled_extraInitializers = [];
19
19
  let _private_updateUpperThreshold_decorators;
20
20
  let _private_updateUpperThreshold_initializers = [];
21
21
  let _private_updateUpperThreshold_extraInitializers = [];
22
22
  let _private_updateLowerThreshold_decorators;
23
23
  let _private_updateLowerThreshold_initializers = [];
24
24
  let _private_updateLowerThreshold_extraInitializers = [];
25
- let _private_handleScrollEventsSwitches_decorators;
26
- let _private_handleScrollEventsSwitches_descriptor;
25
+ let _private_handleScrollEventEnabled_decorators;
26
+ let _private_handleScrollEventEnabled_initializers = [];
27
+ let _private_handleScrollEventEnabled_extraInitializers = [];
28
+ let _private_handleScrollEndEventEnabled_decorators;
29
+ let _private_handleScrollEndEventEnabled_initializers = [];
30
+ let _private_handleScrollEndEventEnabled_extraInitializers = [];
27
31
  return class ScrollViewEvents {
28
32
  static {
29
33
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
30
- _private_updateUpperIntersectionObserver_decorators = [registerAttributeHandler('x-enable-scrolltoupper-event', true)];
31
- _private_updateLowerIntersectionObserver_decorators = [registerAttributeHandler('x-enable-scrolltolower-event', true)];
34
+ _private_handleScrollUpperThresholdEventEnabled_decorators = [registerEventEnableStatusChangeHandler('scrolltoupper')];
35
+ _private_handleScrollLowerThresholdEventEnabled_decorators = [registerEventEnableStatusChangeHandler('scrolltolower')];
32
36
  _private_updateUpperThreshold_decorators = [registerAttributeHandler('upper-threshold', true)];
33
37
  _private_updateLowerThreshold_decorators = [registerAttributeHandler('lower-threshold', true)];
34
- _private_handleScrollEventsSwitches_decorators = [registerAttributeHandler('x-enable-scroll-event', true), registerAttributeHandler('x-enable-scrollend-event', true)];
35
- __esDecorate(this, _private_handleScrollEventsSwitches_descriptor = { value: __setFunctionName(function () {
36
- const scroll = this.#dom.getAttribute('x-enable-scroll-event');
37
- this.#enableScrollEnd =
38
- this.#dom.getAttribute('x-enable-scrollend-event') !== null;
39
- if (scroll !== null || this.#enableScrollEnd) {
40
- this.#getScrollContainer().addEventListener('scroll', this.#handleScroll);
41
- this.#getScrollContainer().addEventListener('scrollend', this.#handleScrollEnd);
42
- this.#dom.addEventListener('scroll', this.#handleScroll);
43
- this.#dom.addEventListener('scrollend', this.#handleScrollEnd);
44
- this.#prevX = 0;
45
- this.#prevY = 0;
46
- }
47
- else {
48
- this.#dom.removeEventListener('scroll', this.#handleScroll);
49
- this.#dom.removeEventListener('scrollend', this.#handleScrollEnd);
50
- }
51
- }, "#handleScrollEventsSwitches") }, _private_handleScrollEventsSwitches_decorators, { kind: "method", name: "#handleScrollEventsSwitches", static: false, private: true, access: { has: obj => #handleScrollEventsSwitches in obj, get: obj => obj.#handleScrollEventsSwitches }, metadata: _metadata }, null, _instanceExtraInitializers);
52
- __esDecorate(null, null, _private_updateUpperIntersectionObserver_decorators, { kind: "field", name: "#updateUpperIntersectionObserver", static: false, private: true, access: { has: obj => #updateUpperIntersectionObserver in obj, get: obj => obj.#updateUpperIntersectionObserver, set: (obj, value) => { obj.#updateUpperIntersectionObserver = value; } }, metadata: _metadata }, _private_updateUpperIntersectionObserver_initializers, _private_updateUpperIntersectionObserver_extraInitializers);
53
- __esDecorate(null, null, _private_updateLowerIntersectionObserver_decorators, { kind: "field", name: "#updateLowerIntersectionObserver", static: false, private: true, access: { has: obj => #updateLowerIntersectionObserver in obj, get: obj => obj.#updateLowerIntersectionObserver, set: (obj, value) => { obj.#updateLowerIntersectionObserver = value; } }, metadata: _metadata }, _private_updateLowerIntersectionObserver_initializers, _private_updateLowerIntersectionObserver_extraInitializers);
38
+ _private_handleScrollEventEnabled_decorators = [registerEventEnableStatusChangeHandler('lynxscroll')];
39
+ _private_handleScrollEndEventEnabled_decorators = [registerEventEnableStatusChangeHandler('lynxscrollend')];
40
+ __esDecorate(null, null, _private_handleScrollUpperThresholdEventEnabled_decorators, { kind: "field", name: "#handleScrollUpperThresholdEventEnabled", static: false, private: true, access: { has: obj => #handleScrollUpperThresholdEventEnabled in obj, get: obj => obj.#handleScrollUpperThresholdEventEnabled, set: (obj, value) => { obj.#handleScrollUpperThresholdEventEnabled = value; } }, metadata: _metadata }, _private_handleScrollUpperThresholdEventEnabled_initializers, _private_handleScrollUpperThresholdEventEnabled_extraInitializers);
41
+ __esDecorate(null, null, _private_handleScrollLowerThresholdEventEnabled_decorators, { kind: "field", name: "#handleScrollLowerThresholdEventEnabled", static: false, private: true, access: { has: obj => #handleScrollLowerThresholdEventEnabled in obj, get: obj => obj.#handleScrollLowerThresholdEventEnabled, set: (obj, value) => { obj.#handleScrollLowerThresholdEventEnabled = value; } }, metadata: _metadata }, _private_handleScrollLowerThresholdEventEnabled_initializers, _private_handleScrollLowerThresholdEventEnabled_extraInitializers);
54
42
  __esDecorate(null, null, _private_updateUpperThreshold_decorators, { kind: "field", name: "#updateUpperThreshold", static: false, private: true, access: { has: obj => #updateUpperThreshold in obj, get: obj => obj.#updateUpperThreshold, set: (obj, value) => { obj.#updateUpperThreshold = value; } }, metadata: _metadata }, _private_updateUpperThreshold_initializers, _private_updateUpperThreshold_extraInitializers);
55
43
  __esDecorate(null, null, _private_updateLowerThreshold_decorators, { kind: "field", name: "#updateLowerThreshold", static: false, private: true, access: { has: obj => #updateLowerThreshold in obj, get: obj => obj.#updateLowerThreshold, set: (obj, value) => { obj.#updateLowerThreshold = value; } }, metadata: _metadata }, _private_updateLowerThreshold_initializers, _private_updateLowerThreshold_extraInitializers);
44
+ __esDecorate(null, null, _private_handleScrollEventEnabled_decorators, { kind: "field", name: "#handleScrollEventEnabled", static: false, private: true, access: { has: obj => #handleScrollEventEnabled in obj, get: obj => obj.#handleScrollEventEnabled, set: (obj, value) => { obj.#handleScrollEventEnabled = value; } }, metadata: _metadata }, _private_handleScrollEventEnabled_initializers, _private_handleScrollEventEnabled_extraInitializers);
45
+ __esDecorate(null, null, _private_handleScrollEndEventEnabled_decorators, { kind: "field", name: "#handleScrollEndEventEnabled", static: false, private: true, access: { has: obj => #handleScrollEndEventEnabled in obj, get: obj => obj.#handleScrollEndEventEnabled, set: (obj, value) => { obj.#handleScrollEndEventEnabled = value; } }, metadata: _metadata }, _private_handleScrollEndEventEnabled_initializers, _private_handleScrollEndEventEnabled_extraInitializers);
56
46
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
57
47
  }
58
- #dom = __runInitializers(this, _instanceExtraInitializers);
59
- #enableScrollEnd = false;
48
+ #dom;
60
49
  #debounceScrollForMockingScrollEnd;
61
50
  #prevX = 0;
62
51
  #prevY = 0;
63
52
  constructor(dom) {
53
+ __runInitializers(this, _private_handleScrollEndEventEnabled_extraInitializers);
64
54
  this.#dom = dom;
65
55
  }
66
56
  #getScrollContainer = () => this.#dom;
@@ -85,16 +75,24 @@ let ScrollViewEvents = (() => {
85
75
  }
86
76
  };
87
77
  static observedAttributes = [
88
- 'x-enable-scrolltoupper-event',
89
- 'x-enable-scrolltolower-event',
90
- 'x-enable-scroll-event',
91
- 'x-enable-scrollend-event',
92
78
  'upper-threshold',
93
79
  'lower-threshold',
94
80
  ];
95
- #updateUpperIntersectionObserver = __runInitializers(this, _private_updateUpperIntersectionObserver_initializers, bindToIntersectionObserver(this.#getScrollContainer, this.#getUpperThresholdObserverDom, this.#handleObserver));
96
- #updateLowerIntersectionObserver = (__runInitializers(this, _private_updateUpperIntersectionObserver_extraInitializers), __runInitializers(this, _private_updateLowerIntersectionObserver_initializers, bindToIntersectionObserver(this.#getScrollContainer, this.#getLowerThresholdObserverDom, this.#handleObserver)));
97
- #updateUpperThreshold = (__runInitializers(this, _private_updateLowerIntersectionObserver_extraInitializers), __runInitializers(this, _private_updateUpperThreshold_initializers, bindToStyle(this.#getUpperThresholdObserverDom, 'flex-basis', (v) => `${parseInt(v)}px`)));
81
+ #handleScrollUpperThresholdEventEnabled = __runInitializers(this, _private_handleScrollUpperThresholdEventEnabled_initializers, (enabled) => {
82
+ enabled
83
+ ? this.#dom.setAttribute('x-enable-scrolltoupper-event', '')
84
+ : this.#dom.removeAttribute('x-enable-scrolltoupper-event'); // css needs this;
85
+ this.#updateUpperIntersectionObserver(enabled);
86
+ });
87
+ #updateUpperIntersectionObserver = (__runInitializers(this, _private_handleScrollUpperThresholdEventEnabled_extraInitializers), bindToIntersectionObserver(this.#getScrollContainer, this.#getUpperThresholdObserverDom, this.#handleObserver));
88
+ #handleScrollLowerThresholdEventEnabled = __runInitializers(this, _private_handleScrollLowerThresholdEventEnabled_initializers, (enabled) => {
89
+ enabled
90
+ ? this.#dom.setAttribute('x-enable-scrolltolower-event', '')
91
+ : this.#dom.removeAttribute('x-enable-scrolltolower-event'); // css needs this;
92
+ this.#updateLowerIntersectionObserver(enabled);
93
+ });
94
+ #updateLowerIntersectionObserver = (__runInitializers(this, _private_handleScrollLowerThresholdEventEnabled_extraInitializers), bindToIntersectionObserver(this.#getScrollContainer, this.#getLowerThresholdObserverDom, this.#handleObserver));
95
+ #updateUpperThreshold = __runInitializers(this, _private_updateUpperThreshold_initializers, bindToStyle(this.#getUpperThresholdObserverDom, 'flex-basis', (v) => `${parseInt(v)}px`));
98
96
  #updateLowerThreshold = (__runInitializers(this, _private_updateUpperThreshold_extraInitializers), __runInitializers(this, _private_updateLowerThreshold_initializers, bindToStyle(this.#getLowerThresholdObserverDom, 'flex-basis', (v) => `${parseInt(v)}px`)));
99
97
  #getScrollDetail() {
100
98
  let { scrollTop, scrollLeft, scrollHeight, scrollWidth } = this
@@ -119,7 +117,7 @@ let ScrollViewEvents = (() => {
119
117
  return detail;
120
118
  }
121
119
  #handleScroll = (__runInitializers(this, _private_updateLowerThreshold_extraInitializers), () => {
122
- if (this.#enableScrollEnd && !useScrollEnd) {
120
+ if (this.#scrollEndEventEnabled && !useScrollEnd) {
123
121
  // debounce
124
122
  clearTimeout(this.#debounceScrollForMockingScrollEnd);
125
123
  this.#debounceScrollForMockingScrollEnd = setTimeout(() => {
@@ -137,7 +135,30 @@ let ScrollViewEvents = (() => {
137
135
  detail: this.#getScrollDetail(),
138
136
  }));
139
137
  };
140
- get #handleScrollEventsSwitches() { return _private_handleScrollEventsSwitches_descriptor.value; }
138
+ #scrollEventEnabled = false;
139
+ #handleScrollEventEnabled = __runInitializers(this, _private_handleScrollEventEnabled_initializers, (enabled) => {
140
+ this.#scrollEventEnabled = enabled;
141
+ this.#handleScrollEventsSwitches();
142
+ });
143
+ #scrollEndEventEnabled = (__runInitializers(this, _private_handleScrollEventEnabled_extraInitializers), false);
144
+ #handleScrollEndEventEnabled = __runInitializers(this, _private_handleScrollEndEventEnabled_initializers, (enabled) => {
145
+ this.#scrollEndEventEnabled = enabled;
146
+ this.#handleScrollEventsSwitches();
147
+ });
148
+ #handleScrollEventsSwitches() {
149
+ if (this.#scrollEventEnabled || this.#scrollEndEventEnabled) {
150
+ this.#getScrollContainer().addEventListener('scroll', this.#handleScroll);
151
+ this.#getScrollContainer().addEventListener('scrollend', this.#handleScrollEnd);
152
+ this.#dom.addEventListener('scroll', this.#handleScroll);
153
+ this.#dom.addEventListener('scrollend', this.#handleScrollEnd);
154
+ this.#prevX = 0;
155
+ this.#prevY = 0;
156
+ }
157
+ else {
158
+ this.#dom.removeEventListener('scroll', this.#handleScroll);
159
+ this.#dom.removeEventListener('scrollend', this.#handleScrollEnd);
160
+ }
161
+ }
141
162
  connectedCallback() { }
142
163
  dispose() { }
143
164
  };
@@ -1,4 +1,4 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
2
  import type { XAudioTT } from './XAudioTT.js';
3
3
  export declare class XAudioAttribute implements InstanceType<AttributeReactiveClass<typeof HTMLElement>> {
4
4
  #private;
@@ -1,4 +1,4 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
2
  import type { XAudioTT } from './XAudioTT.js';
3
3
  export declare class XAudioEvents implements InstanceType<AttributeReactiveClass<typeof HTMLElement>> {
4
4
  #private;
@@ -1,5 +1,5 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
- import { XCanvas } from './XCanvas.js';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
+ import type { XCanvas } from './XCanvas.js';
3
3
  export declare class CanvasAttributes implements InstanceType<AttributeReactiveClass<typeof XCanvas>> {
4
4
  #private;
5
5
  static observedAttributes: string[];
@@ -1,5 +1,5 @@
1
1
  import type { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
- import { XFoldviewHeaderNg } from './XFoldviewHeaderNg.js';
2
+ import type { XFoldviewHeaderNg } from './XFoldviewHeaderNg.js';
3
3
  export declare class XFoldviewHeaderNgFeatures implements InstanceType<AttributeReactiveClass<typeof XFoldviewHeaderNg>> {
4
4
  #private;
5
5
  static observedAttributes: never[];
@@ -1,5 +1,5 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
- import { XFoldviewNg } from './XFoldviewNg.js';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
+ import type { XFoldviewNg } from './XFoldviewNg.js';
3
3
  export declare class XFoldviewNgEvents implements InstanceType<AttributeReactiveClass<typeof XFoldviewNg>> {
4
4
  #private;
5
5
  constructor(dom: XFoldviewNg);
@@ -1,5 +1,5 @@
1
1
  import type { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
- import { XFoldviewSlotNg } from './XFoldviewSlotNg.js';
2
+ import type { XFoldviewSlotNg } from './XFoldviewSlotNg.js';
3
3
  export declare class XFoldviewSlotNgTouchEventsHandler implements InstanceType<AttributeReactiveClass<typeof XFoldviewSlotNg>> {
4
4
  #private;
5
5
  static observedAttributes: never[];
@@ -1,4 +1,4 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
2
  export declare class DropShadow implements InstanceType<AttributeReactiveClass<typeof HTMLElement>> {
3
3
  #private;
4
4
  static observedAttributes: string[];
@@ -1,6 +1,6 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
2
  export declare class ImageEvents implements InstanceType<AttributeReactiveClass<typeof HTMLElement>> {
3
3
  #private;
4
- static observedAttributes: string[];
4
+ static observedAttributes: never[];
5
5
  constructor(dom: HTMLElement);
6
6
  }
@@ -4,8 +4,9 @@ import { __esDecorate, __runInitializers, __setFunctionName } from "tslib";
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 { genDomGetter, registerAttributeHandler, } from '@lynx-js/web-elements-reactive';
7
+ import { genDomGetter, } from '@lynx-js/web-elements-reactive';
8
8
  import { commonComponentEventSetting } from '../common/commonEventInitConfiguration.js';
9
+ import { registerEventEnableStatusChangeHandler } from '@lynx-js/web-elements-reactive';
9
10
  let ImageEvents = (() => {
10
11
  let _instanceExtraInitializers = [];
11
12
  let _private_enableLoadEvent_decorators;
@@ -15,31 +16,31 @@ let ImageEvents = (() => {
15
16
  return class ImageEvents {
16
17
  static {
17
18
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
18
- _private_enableLoadEvent_decorators = [registerAttributeHandler('x-enable-load-event', true)];
19
- _private_enableErrorEvent_decorators = [registerAttributeHandler('x-enable-error-event', true)];
20
- __esDecorate(this, _private_enableLoadEvent_descriptor = { value: __setFunctionName(function (value) {
21
- if (value === null) {
22
- this.#getImg().removeEventListener('load', this.#teleportLoadEvent);
23
- }
24
- else {
19
+ _private_enableLoadEvent_decorators = [registerEventEnableStatusChangeHandler('load')];
20
+ _private_enableErrorEvent_decorators = [registerEventEnableStatusChangeHandler('error')];
21
+ __esDecorate(this, _private_enableLoadEvent_descriptor = { value: __setFunctionName(function (status) {
22
+ if (status) {
25
23
  this.#getImg().addEventListener('load', this.#teleportLoadEvent, {
26
24
  passive: true,
27
25
  });
28
26
  }
29
- }, "#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);
30
- __esDecorate(this, _private_enableErrorEvent_descriptor = { value: __setFunctionName(function (value) {
31
- if (value === null) {
32
- this.#getImg().removeEventListener('error', this.#teleportErrorEvent);
33
- }
34
27
  else {
28
+ this.#getImg().removeEventListener('load', this.#teleportLoadEvent);
29
+ }
30
+ }, "#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);
31
+ __esDecorate(this, _private_enableErrorEvent_descriptor = { value: __setFunctionName(function (status) {
32
+ if (status) {
35
33
  this.#getImg().addEventListener('error', this.#teleportErrorEvent, {
36
34
  passive: true,
37
35
  });
38
36
  }
37
+ else {
38
+ this.#getImg().removeEventListener('error', this.#teleportErrorEvent);
39
+ }
39
40
  }, "#enableErrorEvent") }, _private_enableErrorEvent_decorators, { kind: "method", name: "#enableErrorEvent", static: false, private: true, access: { has: obj => #enableErrorEvent in obj, get: obj => obj.#enableErrorEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
40
41
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
41
42
  }
42
- static observedAttributes = ['x-enable-load-event', 'x-enable-error-event'];
43
+ static observedAttributes = [];
43
44
  #dom = __runInitializers(this, _instanceExtraInitializers);
44
45
  #getImg = genDomGetter(() => this.#dom.shadowRoot, '#img');
45
46
  get #enableLoadEvent() { return _private_enableLoadEvent_descriptor.value; }
@@ -1,4 +1,4 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
2
  /**
3
3
  * shared by x-input and x-input-ng
4
4
  */
@@ -1,4 +1,4 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
2
  export declare class Placeholder implements InstanceType<AttributeReactiveClass<typeof HTMLElement>> {
3
3
  #private;
4
4
  static observedAttributes: string[];
@@ -1,4 +1,4 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
2
  /**
3
3
  * shared by x-input and x-input-ng
4
4
  */
@@ -1,4 +1,4 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
2
  export declare class XInputEvents implements InstanceType<AttributeReactiveClass<typeof HTMLElement>> {
3
3
  #private;
4
4
  static observedAttributes: string[];
@@ -7,6 +7,7 @@ import { __esDecorate, __runInitializers, __setFunctionName } from "tslib";
7
7
  import { genDomGetter, registerAttributeHandler, } from '@lynx-js/web-elements-reactive';
8
8
  import { commonComponentEventSetting } from '../common/commonEventInitConfiguration.js';
9
9
  import { renameEvent } from '../common/renameEvent.js';
10
+ import { registerEventEnableStatusChangeHandler } from '@lynx-js/web-elements-reactive';
10
11
  let XInputEvents = (() => {
11
12
  let _instanceExtraInitializers = [];
12
13
  let _private_handleEnableConfirmEvent_decorators;
@@ -16,11 +17,11 @@ let XInputEvents = (() => {
16
17
  return class XInputEvents {
17
18
  static {
18
19
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
19
- _private_handleEnableConfirmEvent_decorators = [registerAttributeHandler('x-enable-input-event', true)];
20
+ _private_handleEnableConfirmEvent_decorators = [registerEventEnableStatusChangeHandler('input')];
20
21
  _private_handleSendComposingInput_decorators = [registerAttributeHandler('send-composing-input', true)];
21
- __esDecorate(this, _private_handleEnableConfirmEvent_descriptor = { value: __setFunctionName(function (newValue) {
22
+ __esDecorate(this, _private_handleEnableConfirmEvent_descriptor = { value: __setFunctionName(function (status) {
22
23
  const input = this.#getInputElement();
23
- if (newValue !== null) {
24
+ if (status) {
24
25
  input.addEventListener('input', this.#teleportInput, { passive: true });
25
26
  input.addEventListener('compositionend', this.#teleportCompositionendInput, { passive: true });
26
27
  }
@@ -34,7 +35,7 @@ let XInputEvents = (() => {
34
35
  }, "#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
36
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
36
37
  }
37
- static observedAttributes = ['x-enable-input-event', 'send-composing-input'];
38
+ static observedAttributes = ['send-composing-input'];
38
39
  #dom = __runInitializers(this, _instanceExtraInitializers);
39
40
  #sendComposingInput = false;
40
41
  #getInputElement = genDomGetter(() => this.#dom.shadowRoot, '#input');
@@ -4,7 +4,7 @@ import { __esDecorate, __runInitializers } from "tslib";
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, genDomGetter, html, } from '@lynx-js/web-elements-reactive';
7
+ import { boostedQueueMicrotask, Component, genDomGetter, html, } from '@lynx-js/web-elements-reactive';
8
8
  import { XListAttributes } from './XListAttributes.js';
9
9
  import { XListEvents } from './XListEvents.js';
10
10
  import { LynxExposure } from '../common/Exposure.js';
@@ -1,4 +1,4 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
2
  import type { XList } from './XList.js';
3
3
  export declare class XListAttributes implements InstanceType<AttributeReactiveClass<typeof HTMLElement>> {
4
4
  #private;
@@ -1,4 +1,4 @@
1
- import { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
1
+ import { type AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
2
2
  import type { XList } from './XList.js';
3
3
  export declare class XListEvents implements InstanceType<AttributeReactiveClass<typeof HTMLElement>> {
4
4
  #private;