@lynx-js/web-elements 0.5.4 → 0.6.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.
- package/CHANGELOG.md +54 -0
- package/dist/ScrollView/ScrollView.js +3 -3
- package/dist/XAudioTT/XAudioTT.js +2 -2
- package/dist/XCanvas/XCanvas.js +2 -2
- package/dist/XFoldViewNg/XFoldviewHeaderNg.d.ts +2 -0
- package/dist/XFoldViewNg/XFoldviewHeaderNg.js +9 -4
- package/dist/XFoldViewNg/XFoldviewNg.d.ts +13 -2
- package/dist/XFoldViewNg/XFoldviewNg.js +43 -5
- package/dist/XFoldViewNg/XFoldviewNgEvents.d.ts +1 -1
- package/dist/XFoldViewNg/XFoldviewNgEvents.js +17 -5
- package/dist/XFoldViewNg/XFoldviewSlotDragNg.js +2 -2
- package/dist/XFoldViewNg/XFoldviewSlotNg.d.ts +1 -0
- package/dist/XFoldViewNg/XFoldviewSlotNg.js +8 -2
- package/dist/XFoldViewNg/XFoldviewSlotNgTouchEventsHandler.js +51 -37
- package/dist/XFoldViewNg/XFoldviewToolbarNg.d.ts +2 -0
- package/dist/XFoldViewNg/XFoldviewToolbarNg.js +9 -2
- package/dist/XImage/FilterImage.js +2 -2
- package/dist/XImage/XImage.js +2 -2
- package/dist/XInput/XInput.js +2 -2
- package/dist/XList/ListItem.js +2 -2
- package/dist/XList/XList.js +4 -3
- package/dist/XList/XListAttributes.js +1 -0
- package/dist/XList/XListWaterfall.d.ts +8 -0
- package/dist/XList/XListWaterfall.js +144 -0
- package/dist/XOverlayNg/XOverlayNg.d.ts +2 -0
- package/dist/XOverlayNg/XOverlayNg.js +5 -2
- package/dist/XRefreshView/XRefreshFooter.js +2 -2
- package/dist/XRefreshView/XRefreshHeader.js +2 -2
- package/dist/XRefreshView/XRefreshView.js +2 -2
- package/dist/XSvg/XSvg.js +2 -2
- package/dist/XSwiper/SwiperItem.js +2 -2
- package/dist/XSwiper/XSwiper.js +2 -2
- package/dist/XText/XText.d.ts +2 -0
- package/dist/XText/XText.js +3 -3
- package/dist/XTextarea/XTextarea.js +2 -2
- package/dist/XView/XBlurView.js +2 -2
- package/dist/XView/XView.d.ts +2 -0
- package/dist/XView/XView.js +5 -3
- package/dist/XViewpagerNg/XViewpagerItemNg.js +2 -2
- package/dist/XViewpagerNg/XViewpagerNg.js +2 -2
- package/dist/common/CommonEventsAndMethods.d.ts +31 -2
- package/dist/common/CommonEventsAndMethods.js +198 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/ScrollView/scroll-view.css +0 -1
- package/src/XFoldViewNg/x-foldview-ng.css +0 -3
- package/src/XList/x-list.css +67 -5
- package/src/XText/x-text.css +13 -45
- package/dist/XFoldViewNg/XFoldviewHeaderNgFeatures.d.ts +0 -9
- package/dist/XFoldViewNg/XFoldviewHeaderNgFeatures.js +0 -32
- package/dist/common/Exposure.d.ts +0 -32
- package/dist/common/Exposure.js +0 -202
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
import { __esDecorate, __runInitializers } from "tslib";
|
|
5
|
+
import { convertLengthToPx } from './convertLengthToPx.js';
|
|
5
6
|
import { commonComponentEventSetting } from './commonEventInitConfiguration.js';
|
|
7
|
+
import { scrollContainerDom } from './constants.js';
|
|
6
8
|
import { registerEventEnableStatusChangeHandler } from '@lynx-js/web-elements-reactive';
|
|
9
|
+
export const layoutChangeTarget = Symbol('layoutChangeTarget');
|
|
7
10
|
let CommonEventsAndMethods = (() => {
|
|
8
11
|
let ___handleScrollUpperThresholdEventEnabled_decorators;
|
|
9
12
|
let ___handleScrollUpperThresholdEventEnabled_initializers = [];
|
|
@@ -15,16 +18,198 @@ let CommonEventsAndMethods = (() => {
|
|
|
15
18
|
__esDecorate(null, null, ___handleScrollUpperThresholdEventEnabled_decorators, { kind: "field", name: "__handleScrollUpperThresholdEventEnabled", static: false, private: false, access: { has: obj => "__handleScrollUpperThresholdEventEnabled" in obj, get: obj => obj.__handleScrollUpperThresholdEventEnabled, set: (obj, value) => { obj.__handleScrollUpperThresholdEventEnabled = value; } }, metadata: _metadata }, ___handleScrollUpperThresholdEventEnabled_initializers, ___handleScrollUpperThresholdEventEnabled_extraInitializers);
|
|
16
19
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
17
20
|
}
|
|
18
|
-
static observedAttributes = [
|
|
21
|
+
static observedAttributes = [
|
|
22
|
+
'exposure-id',
|
|
23
|
+
'exposure-area',
|
|
24
|
+
'exposure-screen-margin-top',
|
|
25
|
+
'exposure-screen-margin-right',
|
|
26
|
+
'exposure-screen-margin-bottom',
|
|
27
|
+
'exposure-screen-margin-left',
|
|
28
|
+
'exposure-ui-margin-top',
|
|
29
|
+
'exposure-ui-margin-right',
|
|
30
|
+
'exposure-ui-margin-bottom',
|
|
31
|
+
'exposure-ui-margin-left',
|
|
32
|
+
];
|
|
33
|
+
#uiAppearEnabled = false;
|
|
34
|
+
#uiDisappearEnabled = false;
|
|
19
35
|
#dom;
|
|
20
|
-
|
|
21
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Stores a promise. We will handler the exposure attribute change after all related life-cycle events has been fired by browser.
|
|
38
|
+
*/
|
|
39
|
+
#afterAttributeChanged;
|
|
40
|
+
/**
|
|
41
|
+
* If this dom is already exposured
|
|
42
|
+
*/
|
|
43
|
+
#exposureTriggerd = false;
|
|
44
|
+
/**
|
|
45
|
+
* keeps the observer of current dom
|
|
46
|
+
*/
|
|
47
|
+
#exposureObserver;
|
|
48
|
+
get #exposureEnabled() {
|
|
49
|
+
return (this.#uiAppearEnabled
|
|
50
|
+
|| this.#uiDisappearEnabled
|
|
51
|
+
|| this.#dom.getAttribute('exposure-id') !== null);
|
|
52
|
+
}
|
|
22
53
|
constructor(currentElement) {
|
|
23
54
|
__runInitializers(this, ___handleScrollUpperThresholdEventEnabled_extraInitializers);
|
|
24
55
|
this.#dom = currentElement;
|
|
25
56
|
}
|
|
57
|
+
onExposureParamsChanged = () => {
|
|
58
|
+
if (!this.#afterAttributeChanged) {
|
|
59
|
+
this.#afterAttributeChanged = Promise.resolve().then(() => {
|
|
60
|
+
this.#updateExposure();
|
|
61
|
+
this.#afterAttributeChanged = undefined;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
onExposureIdChanged(_, oldValue) {
|
|
66
|
+
if (oldValue) {
|
|
67
|
+
if (this.#exposureEnabled) {
|
|
68
|
+
this.#sendOneExposureEvent({ isIntersecting: false }, oldValue);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
this.onExposureParamsChanged();
|
|
72
|
+
}
|
|
73
|
+
attributeChangedHandler = new Proxy(this, {
|
|
74
|
+
get(target, attribute) {
|
|
75
|
+
if (CommonEventsAndMethods.observedAttributes.includes(attribute)) {
|
|
76
|
+
if (attribute === 'exposure-id') {
|
|
77
|
+
return { handler: target.onExposureIdChanged, noDomMeasure: true };
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
return {
|
|
81
|
+
handler: target.onExposureParamsChanged,
|
|
82
|
+
noDomMeasure: true,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return;
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
eventStatusChangedHandler = {
|
|
90
|
+
'uiappear': (status) => {
|
|
91
|
+
this.#uiAppearEnabled = status;
|
|
92
|
+
this.onExposureParamsChanged();
|
|
93
|
+
},
|
|
94
|
+
'uidisappear': (status) => {
|
|
95
|
+
this.#uiDisappearEnabled = status;
|
|
96
|
+
this.onExposureParamsChanged();
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
#updateExposure() {
|
|
100
|
+
const newParams = {
|
|
101
|
+
exposureID: this.#dom.getAttribute('exposure-id'),
|
|
102
|
+
exposureArea: this.#dom.getAttribute('exposure-area'),
|
|
103
|
+
exposureScene: this.#dom.getAttribute('exposure-scene'),
|
|
104
|
+
exposureScreenMarginTop: this.#dom.getAttribute('exposure-screen-margin-top'),
|
|
105
|
+
exposureScreenMarginRight: this.#dom.getAttribute('exposure-screen-margin-right'),
|
|
106
|
+
exposureScreenMarginBottom: this.#dom.getAttribute('exposure-screen-margin-bottom'),
|
|
107
|
+
exposureScreenMarginLeft: this.#dom.getAttribute('exposure-screen-margin-left'),
|
|
108
|
+
exposureUIMarginTop: this.#dom.getAttribute('exposure-ui-margin-top'),
|
|
109
|
+
exposureUIMarginRight: this.#dom.getAttribute('exposure-ui-margin-right'),
|
|
110
|
+
exposureUIMarginBottom: this.#dom.getAttribute('exposure-ui-margin-bottom'),
|
|
111
|
+
exposureUIMarginLeft: this.#dom.getAttribute('exposure-ui-margin-left'),
|
|
112
|
+
};
|
|
113
|
+
if (this.#exposureEnabled) {
|
|
114
|
+
if (IntersectionObserver) {
|
|
115
|
+
const uiMargin = {
|
|
116
|
+
top: convertLengthToPx(this.#dom, newParams.exposureUIMarginTop),
|
|
117
|
+
right: convertLengthToPx(this.#dom, newParams.exposureUIMarginRight, true),
|
|
118
|
+
bottom: convertLengthToPx(this.#dom, newParams.exposureUIMarginBottom),
|
|
119
|
+
left: convertLengthToPx(this.#dom, newParams.exposureUIMarginLeft, true),
|
|
120
|
+
};
|
|
121
|
+
const screenMargin = {
|
|
122
|
+
top: convertLengthToPx(this.#dom, newParams.exposureScreenMarginTop),
|
|
123
|
+
right: convertLengthToPx(this.#dom, newParams.exposureScreenMarginRight, true),
|
|
124
|
+
bottom: convertLengthToPx(this.#dom, newParams.exposureScreenMarginBottom),
|
|
125
|
+
left: convertLengthToPx(this.#dom, newParams.exposureScreenMarginLeft, true),
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* TODO: @haoyang.wang support the switch `enableExposureUIMargin`
|
|
129
|
+
*/
|
|
130
|
+
const calcedRootMargin = {
|
|
131
|
+
top: (uiMargin.bottom ? -1 : 1)
|
|
132
|
+
* (screenMargin.top - uiMargin.bottom),
|
|
133
|
+
right: (uiMargin.left ? -1 : 1)
|
|
134
|
+
* (screenMargin.right - uiMargin.left),
|
|
135
|
+
bottom: (uiMargin.top ? -1 : 1)
|
|
136
|
+
* (screenMargin.bottom - uiMargin.top),
|
|
137
|
+
left: (uiMargin.right ? -1 : 1)
|
|
138
|
+
* (screenMargin.left - uiMargin.right),
|
|
139
|
+
};
|
|
140
|
+
const exposureArea = this.#dom.getAttribute('exposure-area');
|
|
141
|
+
const rootMargin = `${calcedRootMargin.top}px ${calcedRootMargin.right}px ${calcedRootMargin.bottom}px ${calcedRootMargin.left}px`;
|
|
142
|
+
const threshold = exposureArea ? parseFloat(exposureArea) / 100 : 0;
|
|
143
|
+
if (this.#exposureObserver) {
|
|
144
|
+
this.#exposureObserver.disconnect();
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Get the closest scrollable ancestor
|
|
148
|
+
*/
|
|
149
|
+
let root = this.#dom.parentElement;
|
|
150
|
+
while (root) {
|
|
151
|
+
// @ts-expect-error
|
|
152
|
+
if (root[scrollContainerDom]) {
|
|
153
|
+
// @ts-expect-error
|
|
154
|
+
root = root[scrollContainerDom];
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
root = root.parentElement;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
this.#exposureTriggerd = false;
|
|
162
|
+
this.#exposureObserver = new IntersectionObserver(([entry]) => {
|
|
163
|
+
if (entry) {
|
|
164
|
+
if (entry.isIntersecting) {
|
|
165
|
+
this.#exposureTriggerd = true;
|
|
166
|
+
}
|
|
167
|
+
this.#sendOneExposureEvent(entry);
|
|
168
|
+
}
|
|
169
|
+
}, {
|
|
170
|
+
rootMargin,
|
|
171
|
+
threshold,
|
|
172
|
+
root,
|
|
173
|
+
});
|
|
174
|
+
this.#exposureObserver.observe(this.#dom);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
this.#disableExposure();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
#sendOneExposureEvent(entry, overrideExposureId) {
|
|
182
|
+
if (!this.#exposureTriggerd) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const exposureID = overrideExposureId
|
|
186
|
+
?? this.#dom.getAttribute('exposure-id') ?? '';
|
|
187
|
+
const exposureScene = this.#dom.getAttribute('exposure-scene')
|
|
188
|
+
?? '';
|
|
189
|
+
const detail = {
|
|
190
|
+
'exposure-id': exposureID,
|
|
191
|
+
'exposure-scene': exposureScene,
|
|
192
|
+
exposureID,
|
|
193
|
+
exposureScene,
|
|
194
|
+
};
|
|
195
|
+
const appearEvent = new CustomEvent(entry.isIntersecting ? 'uiappear' : 'uidisappear', {
|
|
196
|
+
...commonComponentEventSetting,
|
|
197
|
+
detail,
|
|
198
|
+
});
|
|
199
|
+
const exposureEvent = new CustomEvent(entry.isIntersecting ? 'exposure' : 'disexposure', {
|
|
200
|
+
bubbles: true,
|
|
201
|
+
composed: false,
|
|
202
|
+
cancelable: false,
|
|
203
|
+
detail,
|
|
204
|
+
});
|
|
205
|
+
Object.assign(appearEvent, detail);
|
|
206
|
+
this.#dom.dispatchEvent(appearEvent);
|
|
207
|
+
this.#dom.dispatchEvent(exposureEvent);
|
|
208
|
+
}
|
|
209
|
+
#resizeObserving = false;
|
|
210
|
+
#resizeObserver;
|
|
26
211
|
__handleScrollUpperThresholdEventEnabled = __runInitializers(this, ___handleScrollUpperThresholdEventEnabled_initializers, (enabled) => {
|
|
27
|
-
if (enabled) {
|
|
212
|
+
if (enabled && this.#dom[layoutChangeTarget]) {
|
|
28
213
|
if (!this.#resizeObserver) {
|
|
29
214
|
this.#resizeObserver = new ResizeObserver(([entry]) => {
|
|
30
215
|
if (entry) {
|
|
@@ -45,9 +230,9 @@ let CommonEventsAndMethods = (() => {
|
|
|
45
230
|
}));
|
|
46
231
|
}
|
|
47
232
|
});
|
|
48
|
-
if (!this.#
|
|
49
|
-
this.#resizeObserver.observe(this.#dom);
|
|
50
|
-
this.#
|
|
233
|
+
if (!this.#resizeObserving) {
|
|
234
|
+
this.#resizeObserver.observe(this.#dom[layoutChangeTarget]);
|
|
235
|
+
this.#resizeObserving = true;
|
|
51
236
|
}
|
|
52
237
|
}
|
|
53
238
|
}
|
|
@@ -55,6 +240,12 @@ let CommonEventsAndMethods = (() => {
|
|
|
55
240
|
this.#resizeObserver?.disconnect();
|
|
56
241
|
}
|
|
57
242
|
});
|
|
243
|
+
#disableExposure() {
|
|
244
|
+
if (this.#exposureObserver) {
|
|
245
|
+
this.#exposureObserver.disconnect();
|
|
246
|
+
this.#exposureObserver = undefined;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
58
249
|
};
|
|
59
250
|
})();
|
|
60
251
|
export { CommonEventsAndMethods };
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
export * from '@lynx-js/web-elements-reactive';
|
|
5
|
-
export * from './common/
|
|
5
|
+
export * from './common/CommonEventsAndMethods.js';
|
|
6
6
|
export * from './common/commonEventInitConfiguration.js';
|
|
7
7
|
export * from './common/constants.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
package/src/XList/x-list.css
CHANGED
|
@@ -8,15 +8,15 @@ x-list {
|
|
|
8
8
|
scrollbar-width: none;
|
|
9
9
|
--list-item-sticky-offset: 0;
|
|
10
10
|
--list-item-span-count: 0;
|
|
11
|
-
--list-main-axis-gap:
|
|
12
|
-
--list-cross-axis-gap:
|
|
11
|
+
--list-main-axis-gap: 0px;
|
|
12
|
+
--list-cross-axis-gap: 0px;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
x-list > *:not(list-item) {
|
|
16
16
|
display: none;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
x-list::part(content) {
|
|
19
|
+
x-list::part(content), x-list[list-type="waterfall"]::part(waterfall-content) {
|
|
20
20
|
display: flex;
|
|
21
21
|
flex: 0 0 auto;
|
|
22
22
|
flex-wrap: nowrap;
|
|
@@ -146,7 +146,7 @@ x-list[vertical-orientation="false"]::part(lower-threshold-observer) {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
/* list-type single */
|
|
149
|
-
x-list
|
|
149
|
+
x-list {
|
|
150
150
|
display: flex;
|
|
151
151
|
flex-direction: column;
|
|
152
152
|
align-items: stretch;
|
|
@@ -154,7 +154,7 @@ x-list[list-type="single"] {
|
|
|
154
154
|
column-gap: var(--list-cross-axis-gap);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
x-list[
|
|
157
|
+
x-list[scroll-orientation="horizontal"] {
|
|
158
158
|
flex-direction: row;
|
|
159
159
|
row-gap: var(--list-cross-axis-gap);
|
|
160
160
|
column-gap: var(--list-main-axis-gap);
|
|
@@ -205,3 +205,65 @@ x-list[list-type="flow"][scroll-orientation="horizontal"][x-enable-scrolltolower
|
|
|
205
205
|
x-list[list-type="flow"][scroll-orientation="horizontal"][x-enable-scrolltoloweredge-event]::part(lower-threshold-observer) {
|
|
206
206
|
grid-row: 1 / calc(var(--list-item-span-count) + 1);
|
|
207
207
|
}
|
|
208
|
+
|
|
209
|
+
/* list-type waterfall */
|
|
210
|
+
x-list[list-type="waterfall"] {
|
|
211
|
+
display: flex;
|
|
212
|
+
flex-direction: column;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
x-list[list-type="waterfall"][scroll-orientation="horizontal"] {
|
|
216
|
+
flex-direction: row;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
x-list[list-type="waterfall"]::part(slot) {
|
|
220
|
+
visibility: hidden;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
x-list[list-type="waterfall"] list-item {
|
|
224
|
+
position: absolute;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
x-list[list-type="waterfall"] list-item {
|
|
228
|
+
width: calc(
|
|
229
|
+
(
|
|
230
|
+
100% - var(--list-cross-axis-gap) * (var(--list-item-span-count) - 1)
|
|
231
|
+
) /
|
|
232
|
+
var(--list-item-span-count)
|
|
233
|
+
);
|
|
234
|
+
height: fit-content;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
x-list[list-type="waterfall"][scroll-orientation="horizontal"] list-item {
|
|
238
|
+
width: fit-content;
|
|
239
|
+
height: calc(
|
|
240
|
+
(
|
|
241
|
+
100% - var(--list-cross-axis-gap) * (var(--list-item-span-count) - 1)
|
|
242
|
+
) /
|
|
243
|
+
var(--list-item-span-count)
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
x-list[list-type="waterfall"] list-item[full-span]:not([full-span="false"]) {
|
|
248
|
+
width: 100%;
|
|
249
|
+
height: fit-content;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
x-list[list-type="waterfall"][scroll-orientation="horizontal"]
|
|
253
|
+
list-item[full-span]:not([full-span="false"]) {
|
|
254
|
+
width: fit-content;
|
|
255
|
+
height: 100%;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
x-list[list-type="waterfall"]::part(upper-threshold-observer),
|
|
259
|
+
x-list[list-type="waterfall"]::part(lower-threshold-observer) {
|
|
260
|
+
position: absolute;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
x-list[list-type="waterfall"]::part(lower-threshold-observer) {
|
|
264
|
+
bottom: -999px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
x-list[list-type="waterfall"][scroll-orientation="horizontal"]::part(lower-threshold-observer) {
|
|
268
|
+
right: -999px;
|
|
269
|
+
}
|
package/src/XText/x-text.css
CHANGED
|
@@ -7,8 +7,13 @@
|
|
|
7
7
|
x-text {
|
|
8
8
|
display: flex;
|
|
9
9
|
overflow-wrap: break-word;
|
|
10
|
-
--lynx-color: none;
|
|
11
10
|
align-items: stretch;
|
|
11
|
+
color: var(--lynx-color);
|
|
12
|
+
background-image: var(--lynx-text-bg-color);
|
|
13
|
+
}
|
|
14
|
+
x-text:not(x-text > x-text):not(x-text > lynx-wrapper > x-text) {
|
|
15
|
+
--lynx-color: canvastext;
|
|
16
|
+
--lynx-text-bg-color: initial;
|
|
12
17
|
}
|
|
13
18
|
x-text:not(:defined) {
|
|
14
19
|
display: none;
|
|
@@ -20,53 +25,16 @@ x-text > * {
|
|
|
20
25
|
|
|
21
26
|
x-text::part(inner-box) {
|
|
22
27
|
text-overflow: inherit;
|
|
23
|
-
--lynx-color: inherit;
|
|
24
|
-
--lynx-color-gradient: inherit;
|
|
28
|
+
--lynx-text-bg-color: inherit;
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
x-text > x-text::part(inner-box),
|
|
28
32
|
x-text > lynx-wrapper > x-text::part(inner-box) {
|
|
29
|
-
display:
|
|
30
|
-
}
|
|
31
|
-
x-text, inline-text {
|
|
32
|
-
--lynx-color-toggle: var(--lynx-color-normal);
|
|
33
|
-
--lynx-color-gradient: var(--lynx-color-toggle,);
|
|
34
|
-
--lynx-color-normal: var(--lynx-color-toggle,);
|
|
33
|
+
display: contents !important;
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
detail: https://issues.chromium.org/issues/40172841
|
|
40
|
-
chrome 99, firefox 46, safari 7
|
|
41
|
-
https://developer.mozilla.org/en-US/docs/Web/CSS/text-emphasis
|
|
42
|
-
|
|
43
|
-
References:
|
|
44
|
-
https://developer.chrome.com/blog/new-in-chrome-99
|
|
45
|
-
https://chromestatus.com/feature/5679635154075648
|
|
46
|
-
https://developer.mozilla.org/en-US/docs/Web/CSS/text-emphasis
|
|
47
|
-
*/
|
|
48
|
-
/* autoprefixer: ignore next */
|
|
49
|
-
@supports (text-emphasis: none) {
|
|
50
|
-
x-text::part(inner-box), inline-text {
|
|
51
|
-
background: var(--lynx-color-gradient, var(--lynx-color)) var(
|
|
52
|
-
--lynx-color-normal,
|
|
53
|
-
initial
|
|
54
|
-
);
|
|
55
|
-
-webkit-text-fill-color: var(--lynx-color-gradient, transparent) var(
|
|
56
|
-
--lynx-color-normal,
|
|
57
|
-
initial
|
|
58
|
-
);
|
|
59
|
-
background-clip: var(--lynx-color-gradient, text) var(
|
|
60
|
-
--lynx-color-normal,
|
|
61
|
-
initial
|
|
62
|
-
);
|
|
63
|
-
/* exist issue: https://github.com/facebook/react/issues/14200 */
|
|
64
|
-
/* import flag is essential on chromium */
|
|
65
|
-
-webkit-background-clip: var(--lynx-color-gradient, text) var(
|
|
66
|
-
--lynx-color-normal,
|
|
67
|
-
initial
|
|
68
|
-
);
|
|
69
|
-
}
|
|
35
|
+
x-text::part(inner-box), inline-text, x-text::part(slot) {
|
|
36
|
+
background-clip: inherit;
|
|
37
|
+
-webkit-background-clip: inherit;
|
|
70
38
|
}
|
|
71
39
|
inline-text, inline-image, inline-truncation {
|
|
72
40
|
display: none;
|
|
@@ -74,14 +42,12 @@ inline-text, inline-image, inline-truncation {
|
|
|
74
42
|
|
|
75
43
|
/* nested components */
|
|
76
44
|
x-text > x-text:defined,
|
|
77
|
-
x-text > x-text:defined::part(inner-box),
|
|
78
45
|
x-text > inline-text:defined,
|
|
79
46
|
x-text > x-text:defined,
|
|
80
47
|
inline-text > inline-text:defined,
|
|
81
48
|
inline-truncation > inline-text:defined,
|
|
82
49
|
inline-truncation > x-text:defined,
|
|
83
50
|
x-text > lynx-wrapper > x-text:defined,
|
|
84
|
-
x-text > lynx-wrapper > x-text:defined::part(inner-box),
|
|
85
51
|
x-text > lynx-wrapper > inline-text:defined,
|
|
86
52
|
x-text > lynx-wrapper > x-text:defined,
|
|
87
53
|
inline-text > lynx-wrapper > inline-text:defined,
|
|
@@ -89,6 +55,8 @@ x-text > lynx-wrapper > x:defined,
|
|
|
89
55
|
inline-truncation > lynx-wrapper > inline-text:defined,
|
|
90
56
|
inline-truncation > lynx-wrapper > x-text:defined {
|
|
91
57
|
display: inline;
|
|
58
|
+
background-clip: inherit;
|
|
59
|
+
-webkit-background-clip: inherit;
|
|
92
60
|
}
|
|
93
61
|
|
|
94
62
|
x-text > inline-image:defined,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AttributeReactiveClass } from '@lynx-js/web-elements-reactive';
|
|
2
|
-
import type { XFoldviewHeaderNg } from './XFoldviewHeaderNg.js';
|
|
3
|
-
export declare class XFoldviewHeaderNgFeatures implements InstanceType<AttributeReactiveClass<typeof XFoldviewHeaderNg>> {
|
|
4
|
-
#private;
|
|
5
|
-
static observedAttributes: never[];
|
|
6
|
-
constructor(dom: XFoldviewHeaderNg);
|
|
7
|
-
connectedCallback(): void;
|
|
8
|
-
dispose(): void;
|
|
9
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export class XFoldviewHeaderNgFeatures {
|
|
2
|
-
#dom;
|
|
3
|
-
#resizeObserver;
|
|
4
|
-
static observedAttributes = [];
|
|
5
|
-
constructor(dom) {
|
|
6
|
-
this.#dom = dom;
|
|
7
|
-
}
|
|
8
|
-
connectedCallback() {
|
|
9
|
-
this.#resizeObserver = new ResizeObserver(([resize]) => {
|
|
10
|
-
const parentElement = this.#dom.parentElement;
|
|
11
|
-
if (parentElement?.tagName === 'X-FOLDVIEW-NG') {
|
|
12
|
-
const slot = parentElement.querySelector('x-foldview-slot-ng');
|
|
13
|
-
if (slot) {
|
|
14
|
-
const offsetTop = slot.offsetTop;
|
|
15
|
-
const headerHeight = resize.contentRect.height;
|
|
16
|
-
if (offsetTop < headerHeight) {
|
|
17
|
-
slot.style.top = headerHeight - offsetTop + 'px';
|
|
18
|
-
parentElement.__scrollableLength = headerHeight - offsetTop;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
this.#resizeObserver.observe(this.#dom);
|
|
24
|
-
}
|
|
25
|
-
dispose() {
|
|
26
|
-
if (this.#resizeObserver) {
|
|
27
|
-
this.#resizeObserver.disconnect();
|
|
28
|
-
this.#resizeObserver = undefined;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=XFoldviewHeaderNgFeatures.js.map
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export interface ExposureParameters {
|
|
2
|
-
exposureID: string | null;
|
|
3
|
-
exposureArea: string | null;
|
|
4
|
-
exposureScene: string | null;
|
|
5
|
-
exposureScreenMarginTop: string | null;
|
|
6
|
-
exposureScreenMarginRight: string | null;
|
|
7
|
-
exposureScreenMarginBottom: string | null;
|
|
8
|
-
exposureScreenMarginLeft: string | null;
|
|
9
|
-
exposureUIMarginTop: string | null;
|
|
10
|
-
exposureUIMarginRight: string | null;
|
|
11
|
-
exposureUIMarginBottom: string | null;
|
|
12
|
-
exposureUIMarginLeft: string | null;
|
|
13
|
-
}
|
|
14
|
-
export interface ExposureEvent {
|
|
15
|
-
'exposure-id': string;
|
|
16
|
-
'exposure-scene': string;
|
|
17
|
-
exposureID: string;
|
|
18
|
-
exposureScene: string;
|
|
19
|
-
}
|
|
20
|
-
export declare class LynxExposure {
|
|
21
|
-
#private;
|
|
22
|
-
static readonly observedAttributes: string[];
|
|
23
|
-
constructor(currentElement: HTMLElement);
|
|
24
|
-
onExposureParamsChanged: () => void;
|
|
25
|
-
onExposureIdChanged(_: string | null, oldValue: string | null): void;
|
|
26
|
-
attributeChangedHandler: this;
|
|
27
|
-
eventStatusChangedHandler: {
|
|
28
|
-
uiappear: (status: boolean) => void;
|
|
29
|
-
uidisappear: (status: boolean) => void;
|
|
30
|
-
};
|
|
31
|
-
disableExposure(): void;
|
|
32
|
-
}
|