@total_onion/onion-library 2.0.222 → 2.0.224
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/components/webc-loadmore-trigger/loadmore-trigger.css +1 -19
- package/components/webc-loadmore-trigger/loadmore-trigger.js +6 -2
- package/components/webc-post-filter-module/dev-content/dev-content.js +6 -6
- package/components/webc-post-filter-module/dev-content/dev-contentlocal.js +6 -6
- package/components/webc-post-filter-module/post-filter-module.html +3 -1
- package/components/webc-post-filter-module/post-filter-module.js +42 -6
- package/package.json +1 -1
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
--padding-block-multiplier-mobile-top: 1;
|
|
3
|
-
--padding-inline-multiplier-mobile-right: 1;
|
|
4
|
-
--padding-block-multiplier-mobile-bottom: 1;
|
|
5
|
-
--padding-inline-multiplier-mobile-left: 1;
|
|
6
|
-
|
|
7
|
-
display: grid;
|
|
8
|
-
background-color: hotpink;
|
|
9
|
-
.post-grid-display-module-v4__grid-container {
|
|
10
|
-
place-self: stretch;
|
|
11
|
-
display: grid;
|
|
12
|
-
padding: 10px;
|
|
13
|
-
gap: 10px;
|
|
14
|
-
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
|
|
15
|
-
}
|
|
16
|
-
.post-grid-display-module-v4__post-image {
|
|
17
|
-
width: 100%;
|
|
18
|
-
height: auto;
|
|
19
|
-
}
|
|
1
|
+
loadmore-trigger {
|
|
20
2
|
}
|
|
@@ -9,9 +9,13 @@ export default function loadmoreTriggerJs(options = {}) {
|
|
|
9
9
|
super();
|
|
10
10
|
this.enableLogs = this.dataset.enablelogs;
|
|
11
11
|
this.toggleButton = document.createElement('button');
|
|
12
|
-
this.toggleButton.className =
|
|
12
|
+
this.toggleButton.className =
|
|
13
|
+
'loadmore-trigger__button';
|
|
13
14
|
this.appendChild(this.toggleButton);
|
|
14
|
-
this.toggleButton.innerText = this.dataset.
|
|
15
|
+
this.toggleButton.innerText = this.dataset.buttontext;
|
|
16
|
+
this.toggleButton.addEventListener('click', () => {
|
|
17
|
+
this.dispatchEvent(new CustomEvent('loadmore'));
|
|
18
|
+
});
|
|
15
19
|
}
|
|
16
20
|
connectedCallback() {
|
|
17
21
|
console.log('Display module added to page.');
|
|
@@ -120,7 +120,7 @@ export const devContentPets = [
|
|
|
120
120
|
categories: [13, 10, 4, 1]
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
|
-
name: '
|
|
123
|
+
name: 'Is it dinner time? Vanille',
|
|
124
124
|
link: 'https://totalonion.com',
|
|
125
125
|
images: {
|
|
126
126
|
post_image_src: vanillePuppyFace
|
|
@@ -189,7 +189,7 @@ export const devContentPets = [
|
|
|
189
189
|
post_image_src: skySecurity
|
|
190
190
|
},
|
|
191
191
|
|
|
192
|
-
categories: [
|
|
192
|
+
categories: [13, 10, 4, 3]
|
|
193
193
|
},
|
|
194
194
|
{
|
|
195
195
|
name: 'Kai Selfie',
|
|
@@ -216,7 +216,7 @@ export const devContentPets = [
|
|
|
216
216
|
post_image_src: skyLuxury
|
|
217
217
|
},
|
|
218
218
|
|
|
219
|
-
categories: [
|
|
219
|
+
categories: [13, 10, 5, 1]
|
|
220
220
|
},
|
|
221
221
|
{
|
|
222
222
|
name: 'Pete rules her lawn',
|
|
@@ -237,13 +237,13 @@ export const devContentPets = [
|
|
|
237
237
|
categories: [13, 10, 5, 1]
|
|
238
238
|
},
|
|
239
239
|
{
|
|
240
|
-
name: 'Vanille
|
|
240
|
+
name: 'Vanille hard day',
|
|
241
241
|
link: 'https://totalonion.com',
|
|
242
242
|
images: {
|
|
243
243
|
post_image_src: vanilleNap
|
|
244
244
|
},
|
|
245
245
|
|
|
246
|
-
categories: [14, 10, 5
|
|
246
|
+
categories: [14, 10, 5]
|
|
247
247
|
},
|
|
248
248
|
{
|
|
249
249
|
name: 'Fat Gigio Basket Life',
|
|
@@ -291,7 +291,7 @@ export const devContentPets = [
|
|
|
291
291
|
categories: [13, 9, 5, 1]
|
|
292
292
|
},
|
|
293
293
|
{
|
|
294
|
-
name: 'Vanille
|
|
294
|
+
name: 'Vanille likes woofers',
|
|
295
295
|
link: 'https://totalonion.com',
|
|
296
296
|
images: {
|
|
297
297
|
post_image_src: vanilleBass
|
|
@@ -133,7 +133,7 @@ export const devContentPets = [
|
|
|
133
133
|
categories: [13, 10, 4, 1]
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
|
-
name: '
|
|
136
|
+
name: 'Is it dinner time? Vanille',
|
|
137
137
|
link: 'https://totalonion.com',
|
|
138
138
|
images: {
|
|
139
139
|
post_image_src: vanillePuppyFace
|
|
@@ -202,7 +202,7 @@ export const devContentPets = [
|
|
|
202
202
|
post_image_src: skySecurity
|
|
203
203
|
},
|
|
204
204
|
|
|
205
|
-
categories: [
|
|
205
|
+
categories: [13, 10, 4, 3]
|
|
206
206
|
},
|
|
207
207
|
{
|
|
208
208
|
name: 'Kai Selfie',
|
|
@@ -229,7 +229,7 @@ export const devContentPets = [
|
|
|
229
229
|
post_image_src: skyLuxury
|
|
230
230
|
},
|
|
231
231
|
|
|
232
|
-
categories: [
|
|
232
|
+
categories: [13, 10, 5, 1]
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
235
|
name: 'Pete rules her lawn',
|
|
@@ -250,13 +250,13 @@ export const devContentPets = [
|
|
|
250
250
|
categories: [13, 10, 5, 1]
|
|
251
251
|
},
|
|
252
252
|
{
|
|
253
|
-
name: 'Vanille
|
|
253
|
+
name: 'Vanille hard day',
|
|
254
254
|
link: 'https://totalonion.com',
|
|
255
255
|
images: {
|
|
256
256
|
post_image_src: vanilleNap
|
|
257
257
|
},
|
|
258
258
|
|
|
259
|
-
categories: [14, 10, 5
|
|
259
|
+
categories: [14, 10, 5]
|
|
260
260
|
},
|
|
261
261
|
{
|
|
262
262
|
name: 'Fat Gigio Basket Life',
|
|
@@ -304,7 +304,7 @@ export const devContentPets = [
|
|
|
304
304
|
categories: [13, 9, 5, 1]
|
|
305
305
|
},
|
|
306
306
|
{
|
|
307
|
-
name: 'Vanille
|
|
307
|
+
name: 'Vanille likes woofers',
|
|
308
308
|
link: 'https://totalonion.com',
|
|
309
309
|
images: {
|
|
310
310
|
post_image_src: vanilleBass
|
|
@@ -31,6 +31,10 @@ export default function postfiltermoduleJs(options = {}) {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
this.loadMoreTriggers = document.querySelectorAll(
|
|
35
|
+
`.${this.loadmoretriggerclass}`
|
|
36
|
+
);
|
|
37
|
+
|
|
34
38
|
const postFilterContainer =
|
|
35
39
|
document.createElement('div');
|
|
36
40
|
postFilterContainer.className =
|
|
@@ -54,7 +58,8 @@ export default function postfiltermoduleJs(options = {}) {
|
|
|
54
58
|
const clearFilters = document.createElement('button');
|
|
55
59
|
clearFilters.className =
|
|
56
60
|
'post-filter-module__clear-filters-button';
|
|
57
|
-
clearFilters.innerText =
|
|
61
|
+
clearFilters.innerText =
|
|
62
|
+
this.dataset.clearfilterstext || 'Clear Filters';
|
|
58
63
|
this.postFilterContainer.appendChild(clearFilters);
|
|
59
64
|
this.clearFiltersButton = this.querySelector(
|
|
60
65
|
'.post-filter-module__clear-filters-button'
|
|
@@ -76,10 +81,6 @@ export default function postfiltermoduleJs(options = {}) {
|
|
|
76
81
|
) {
|
|
77
82
|
const devdatalocation =
|
|
78
83
|
this.dataset.devdatalocation;
|
|
79
|
-
console.log(
|
|
80
|
-
'🚀 ~ connectedCallback ~ devdatalocation:',
|
|
81
|
-
devdatalocation
|
|
82
|
-
);
|
|
83
84
|
data = await import(
|
|
84
85
|
`./dev-content/dev-content${devdatalocation}.js`
|
|
85
86
|
);
|
|
@@ -164,7 +165,6 @@ export default function postfiltermoduleJs(options = {}) {
|
|
|
164
165
|
this.categorybuttons = this.querySelectorAll(
|
|
165
166
|
'.post-filter-module__filter-category-button'
|
|
166
167
|
);
|
|
167
|
-
|
|
168
168
|
this.categorybuttons.forEach((button) => {
|
|
169
169
|
button.addEventListener('click', () => {
|
|
170
170
|
if (
|
|
@@ -203,6 +203,42 @@ export default function postfiltermoduleJs(options = {}) {
|
|
|
203
203
|
this.filterState.setFilteredPosts.bind(this)({
|
|
204
204
|
filteredposts: this.filterState.allposts
|
|
205
205
|
});
|
|
206
|
+
const groupingButtons = this.querySelectorAll(
|
|
207
|
+
'.post-filter-module__grouping-category-button'
|
|
208
|
+
);
|
|
209
|
+
const categoryContainers = this.querySelectorAll(
|
|
210
|
+
'.post-filter-module__filter-category-container'
|
|
211
|
+
);
|
|
212
|
+
groupingButtons.forEach((button) => {
|
|
213
|
+
button.addEventListener('click', () => {
|
|
214
|
+
const container =
|
|
215
|
+
button.parentElement.querySelector(
|
|
216
|
+
'.post-filter-module__filter-category-container'
|
|
217
|
+
);
|
|
218
|
+
if (button.classList.contains('active')) {
|
|
219
|
+
button.classList.remove('active');
|
|
220
|
+
container.classList.remove('active');
|
|
221
|
+
container.style.height = '0px';
|
|
222
|
+
} else {
|
|
223
|
+
groupingButtons.forEach((btn) => {
|
|
224
|
+
btn.classList.remove('active');
|
|
225
|
+
});
|
|
226
|
+
categoryContainers.forEach(
|
|
227
|
+
(categoryContainer) => {
|
|
228
|
+
categoryContainer.style.height =
|
|
229
|
+
'0px';
|
|
230
|
+
categoryContainer.classList.remove(
|
|
231
|
+
'active'
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
container.style.height =
|
|
236
|
+
container.scrollHeight + 'px';
|
|
237
|
+
button.classList.add('active');
|
|
238
|
+
container.classList.add('active');
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
});
|
|
206
242
|
this.classList.add('loaded');
|
|
207
243
|
}
|
|
208
244
|
|