@lynx-js/web-elements 0.3.0 → 0.5.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.
@@ -7,6 +7,9 @@ x-list {
7
7
  contain: layout;
8
8
  scrollbar-width: none;
9
9
  --list-item-sticky-offset: 0;
10
+ --list-item-span-count: 0;
11
+ --list-main-axis-gap: 0;
12
+ --list-cross-axis-gap: 0;
10
13
  }
11
14
 
12
15
  x-list > *:not(list-item) {
@@ -28,6 +31,8 @@ x-list::part(content) {
28
31
  overflow: inherit;
29
32
  position: relative;
30
33
  content-visibility: auto;
34
+ row-gap: inherit;
35
+ column-gap: inherit;
31
36
  }
32
37
 
33
38
  x-list::part(content), x-list::part(slot) {
@@ -60,74 +65,68 @@ x-list > list-item, x-list > lynx-wrapper > list-item {
60
65
  display: flex;
61
66
  }
62
67
 
63
- x-list[list-type="single"] {
64
- display: flex;
65
- flex-direction: column;
66
- align-items: stretch;
68
+ x-list {
67
69
  overflow-y: scroll !important;
68
70
  overflow-x: clip !important;
69
71
  }
70
72
 
71
- x-list[list-type="single"][scroll-orientation="horizontal"] {
72
- flex-direction: row;
73
+ x-list[scroll-orientation="horizontal"] {
73
74
  overflow-x: scroll !important;
74
75
  overflow-y: clip !important;
75
76
  }
76
77
 
77
- x-list[list-type="single"][enable-scroll="false"] {
78
+ x-list[enable-scroll="false"] {
78
79
  overflow-y: hidden !important;
79
80
  }
80
81
 
81
- x-list[list-type="single"][scroll-orientation="horizontal"][enable-scroll="false"] {
82
+ x-list[scroll-orientation="horizontal"][enable-scroll="false"] {
82
83
  overflow-x: hidden !important;
83
84
  }
84
85
 
85
- list-item[sticky-top], list-item[sticky-bottom] {
86
+ x-list[sticky="true"] list-item[sticky-top],
87
+ x-list[sticky="true"] list-item[sticky-bottom] {
86
88
  position: sticky;
87
89
  z-index: 1;
88
90
  }
89
91
 
90
- x-list[list-type="single"] > list-item[sticky-top],
91
- x-list[list-type="single"] > lynx-wrapper > list-item[sticky-top] {
92
+ x-list[sticky="true"] > list-item[sticky-top],
93
+ x-list[sticky="true"] > lynx-wrapper > list-item[sticky-top] {
92
94
  top: var(--list-item-sticky-offset);
93
95
  }
94
96
 
95
- x-list[list-type="single"] > list-item[sticky-bottom],
96
- x-list[list-type="single"] > lynx-wrapper > list-item[sticky-bottom] {
97
+ x-list[sticky="true"] > list-item[sticky-bottom],
98
+ x-list[sticky="true"] > lynx-wrapper > list-item[sticky-bottom] {
97
99
  bottom: var(--list-item-sticky-offset);
98
100
  }
99
101
 
100
- x-list[list-type="single"][scroll-orientation="horizontal"]
101
- > list-item[sticky-top],
102
- x-list[list-type="single"][scroll-orientation="horizontal"]
102
+ x-list[sticky="true"][scroll-orientation="horizontal"] > list-item[sticky-top],
103
+ x-list[sticky="true"][scroll-orientation="horizontal"]
103
104
  > lynx-wrapper
104
105
  > list-item[sticky-top] {
105
106
  top: unset;
106
107
  left: var(--list-item-sticky-offset);
107
108
  }
108
109
 
109
- x-list[list-type="single"][scroll-orientation="horizontal"]
110
+ x-list[sticky="true"][scroll-orientation="horizontal"]
110
111
  > list-item[sticky-bottom],
111
- x-list[list-type="single"][scroll-orientation="horizontal"]
112
+ x-list[sticky="true"][scroll-orientation="horizontal"]
112
113
  > lynx-wrapper
113
114
  > list-item[sticky-bottom] {
114
115
  bottom: unset;
115
116
  right: var(--list-item-sticky-offset);
116
117
  }
117
118
 
118
- x-list[list-type="single"][item-snap],
119
- x-list[list-type="single"][paging-enabled] {
119
+ x-list[item-snap], x-list[paging-enabled] {
120
120
  scroll-snap-type: y mandatory;
121
121
  scroll-snap-stop: always;
122
122
  }
123
123
 
124
- x-list[list-type="single"][item-snap][scroll-orientation="horizontal"],
125
- x-list[list-type="single"][paging-enabled][scroll-orientation="horizontal"] {
124
+ x-list[item-snap][scroll-orientation="horizontal"],
125
+ x-list[paging-enabled][scroll-orientation="horizontal"] {
126
126
  scroll-snap-type: x mandatory;
127
127
  }
128
128
 
129
- x-list[list-type="single"][item-snap] > list-item,
130
- x-list[list-type="single"][item-snap] > lynx-wrapper > list-item {
129
+ x-list[item-snap] > list-item, x-list[item-snap] > lynx-wrapper > list-item {
131
130
  scroll-snap-align: start;
132
131
  }
133
132
 
@@ -145,3 +144,50 @@ x-list::part(lower-threshold-observer) {
145
144
  x-list[vertical-orientation="false"]::part(lower-threshold-observer) {
146
145
  flex-direction: row-reverse;
147
146
  }
147
+
148
+ /* list-type single */
149
+ x-list[list-type="single"] {
150
+ display: flex;
151
+ flex-direction: column;
152
+ align-items: stretch;
153
+ row-gap: var(--list-main-axis-gap);
154
+ column-gap: var(--list-cross-axis-gap);
155
+ }
156
+
157
+ x-list[list-type="single"][scroll-orientation="horizontal"] {
158
+ flex-direction: row;
159
+ row-gap: var(--list-cross-axis-gap);
160
+ column-gap: var(--list-main-axis-gap);
161
+ }
162
+
163
+ /* list-type flow */
164
+ x-list[list-type="flow"]::part(content) {
165
+ display: grid;
166
+ grid-template-columns: repeat(var(--list-item-span-count), 1fr);
167
+ grid-auto-rows: min-content;
168
+ justify-items: stretch;
169
+ align-items: start;
170
+ grid-row-gap: var(--list-main-axis-gap);
171
+ grid-column-gap: var(--list-cross-axis-gap);
172
+ }
173
+
174
+ x-list[list-type="flow"][scroll-orientation="horizontal"]::part(content) {
175
+ grid-template-rows: repeat(var(--list-item-span-count), 1fr);
176
+ grid-auto-flow: column;
177
+ grid-auto-columns: min-content;
178
+ justify-items: start;
179
+ align-items: stretch;
180
+ grid-row-gap: var(--list-cross-axis-gap);
181
+ grid-column-gap: var(--list-main-axis-gap);
182
+ }
183
+
184
+ x-list[list-type="flow"] list-item[full-span]:not([full-span="false"]) {
185
+ grid-column-start: 1;
186
+ grid-column-end: calc(var(--list-item-span-count) + 1);
187
+ }
188
+
189
+ x-list[list-type="flow"][scroll-orientation="horizontal"]
190
+ list-item[full-span]:not([full-span="false"]) {
191
+ grid-row-start: 1;
192
+ grid-row-end: calc(var(--list-item-span-count) + 1);
193
+ }
package/dist/lazy.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function loadElement(tag: string): void;
package/dist/lazy.js DELETED
@@ -1,106 +0,0 @@
1
- // Copyright 2024 The Lynx Authors. All rights reserved.
2
- // Licensed under the Apache License Version 2.0 that can be found in the
3
- // LICENSE file in the root directory of this source tree.
4
- const loadingElementPromises = new Set();
5
- export function loadElement(tag) {
6
- if (loadingElementPromises.has(tag)) {
7
- return;
8
- }
9
- if (customElements.get(tag)) {
10
- return;
11
- }
12
- switch (tag) {
13
- case 'lynx-wrapper':
14
- import('./LynxWrapper/index.js');
15
- loadingElementPromises.add(tag);
16
- return;
17
- case 'scroll-view':
18
- import('./ScrollView/index.js');
19
- loadingElementPromises.add(tag);
20
- return;
21
- case 'x-audio-tt':
22
- import('./XAudioTT/index.js');
23
- loadingElementPromises.add(tag);
24
- return;
25
- case 'x-canvas':
26
- import('./XCanvas/index.js');
27
- loadingElementPromises.add(tag);
28
- return;
29
- case 'x-foldview-ng':
30
- case 'x-foldview-header-ng':
31
- case 'x-foldview-toolbar-ng':
32
- case 'x-foldview-slot-ng':
33
- case 'x-foldview-slot-drag-ng':
34
- import('./XFoldViewNg/index.js');
35
- loadingElementPromises.add('x-foldview-ng');
36
- loadingElementPromises.add('x-foldview-header-ng');
37
- loadingElementPromises.add('x-foldview-toolbar-ng');
38
- loadingElementPromises.add('x-foldview-slot-ng');
39
- loadingElementPromises.add('x-foldview-slot-drag-ng');
40
- return;
41
- case 'x-image':
42
- case 'filter-image':
43
- import('./XImage/index.js');
44
- loadingElementPromises.add('x-image');
45
- loadingElementPromises.add('filter-image');
46
- return;
47
- case 'x-input':
48
- import('./XInput/index.js');
49
- loadingElementPromises.add(tag);
50
- return;
51
- case 'x-list':
52
- import('./XList/index.js');
53
- loadingElementPromises.add('x-list');
54
- loadingElementPromises.add('list-item');
55
- return;
56
- case 'x-overlay-ng':
57
- import('./XOverlayNg/index.js');
58
- loadingElementPromises.add(tag);
59
- return;
60
- case 'x-refresh-view':
61
- case 'x-refresh-header':
62
- case 'x-refresh-footer':
63
- import('./XRefreshView/index.js');
64
- loadingElementPromises.add('x-refresh-view');
65
- loadingElementPromises.add('x-refresh-header');
66
- loadingElementPromises.add('x-refresh-footer');
67
- return;
68
- case 'x-svg':
69
- import('./XSvg/index.js');
70
- loadingElementPromises.add(tag);
71
- return;
72
- case 'x-swiper':
73
- case 'x-swiper-item':
74
- import('./XSwiper/index.js');
75
- loadingElementPromises.add('x-swiper');
76
- loadingElementPromises.add('x-swiper-item');
77
- return;
78
- case 'x-text':
79
- case 'inline-text':
80
- case 'inline-image':
81
- case 'inline-truncation':
82
- case 'raw-text':
83
- import('./XText/index.js');
84
- loadingElementPromises.add('x-text');
85
- loadingElementPromises.add('inline-text');
86
- loadingElementPromises.add('inline-image');
87
- loadingElementPromises.add('inline-truncation');
88
- loadingElementPromises.add('raw-text');
89
- return;
90
- case 'x-textarea':
91
- import('./XTextarea/index.js');
92
- loadingElementPromises.add(tag);
93
- return;
94
- case 'x-view':
95
- import('./XView/index.js');
96
- loadingElementPromises.add(tag);
97
- return;
98
- case 'x-viewpager-ng':
99
- case 'x-viewpager-item-ng':
100
- import('./XViewpagerNg/index.js');
101
- loadingElementPromises.add('x-viewpager-ng');
102
- loadingElementPromises.add('x-viewpager-item-ng');
103
- return;
104
- }
105
- }
106
- //# sourceMappingURL=lazy.js.map