@depict-ai/utilishared 2.4.5 → 2.4.6
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/ES10/index.cjs +28 -32
- package/ES10/index.d.ts +6 -1
- package/ES10/index.js +28 -32
- package/latest/index.cjs +24 -24
- package/latest/index.d.ts +6 -1
- package/latest/index.js +24 -24
- package/package.json +1 -1
- package/server/ES10/index.cjs +28 -32
- package/server/ES10/index.d.ts +6 -1
- package/server/ES10/index.js +28 -32
- package/server/latest/index.cjs +24 -24
- package/server/latest/index.d.ts +6 -1
- package/server/latest/index.js +24 -24
package/server/latest/index.cjs
CHANGED
|
@@ -204,7 +204,7 @@ $parcel$export(module.exports, "version", () => $815f67c61b4c0a42$export$83d89fb
|
|
|
204
204
|
$parcel$export(module.exports, "add_to_version_info", () => $e4a18bf12ad092d9$export$2cefb7e61fcbae00);
|
|
205
205
|
$parcel$export(module.exports, "sync_el_content_with_accessor", () => $35303d72263038db$export$c3f56a35e076f139);
|
|
206
206
|
$parcel$export(module.exports, "use_href_accessor", () => $da35c7e27be2a442$export$e35115e6d0715f77);
|
|
207
|
-
const $815f67c61b4c0a42$export$83d89fbfd8236492 = "2.4.
|
|
207
|
+
const $815f67c61b4c0a42$export$83d89fbfd8236492 = "2.4.6";
|
|
208
208
|
const $7b5e577a60b81e60$export$55fe61489d2c7417 = /*@__PURE__*/(() => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && (globalThis?.document?.currentScript?.dataset?.debug === "true" || globalThis?.localStorage?.getItem?.("debug") === "true"))();
|
|
209
209
|
const $e6c6e7929ea385ae$var$browser_prefix_styling = "color: #fff;";
|
|
210
210
|
let $e6c6e7929ea385ae$var$browser_prefix = "[Depict]";
|
|
@@ -2350,12 +2350,12 @@ var $1683d0164abd7c1d$var$_tmpl$ = ["<div", ' class="depict-slider depict"></div
|
|
|
2350
2350
|
class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
2351
2351
|
// this is just here because it's often needed together with the slider
|
|
2352
2352
|
container = $jVDDb$solidjsweb.ssr($1683d0164abd7c1d$var$_tmpl$, $jVDDb$solidjsweb.ssrHydrationKey());
|
|
2353
|
-
|
|
2353
|
+
elements_ = {
|
|
2354
2354
|
sliding_el_: $jVDDb$solidjsweb.ssr($1683d0164abd7c1d$var$_tmpl$2, $jVDDb$solidjsweb.ssrHydrationKey()),
|
|
2355
2355
|
left_: $jVDDb$solidjsweb.ssr($1683d0164abd7c1d$var$_tmpl$3, $jVDDb$solidjsweb.ssrHydrationKey()),
|
|
2356
2356
|
right_: $jVDDb$solidjsweb.ssr($1683d0164abd7c1d$var$_tmpl$4, $jVDDb$solidjsweb.ssrHydrationKey())
|
|
2357
2357
|
};
|
|
2358
|
-
insert_here = this
|
|
2358
|
+
insert_here = this.elements_.sliding_el_;
|
|
2359
2359
|
intersecting_items_object = {};
|
|
2360
2360
|
#mutation_plugins = [];
|
|
2361
2361
|
stepstoslide = 2;
|
|
@@ -2376,7 +2376,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
2376
2376
|
} = this;
|
|
2377
2377
|
const {
|
|
2378
2378
|
sliding_el_: sliding_el_
|
|
2379
|
-
} = this
|
|
2379
|
+
} = this.elements_;
|
|
2380
2380
|
for (const record of records) {
|
|
2381
2381
|
for (const node of record.addedNodes) if (node instanceof Element && node.parentElement === sliding_el_) observer.observe(node);
|
|
2382
2382
|
for (const node of record.removedNodes) if (node instanceof Element && node.parentElement === sliding_el_) observer.unobserve(node);
|
|
@@ -2399,7 +2399,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
2399
2399
|
for (let i = 0; i < mutation_plugins.length; i++) $268cbd9e4ade92db$export$b3bbfd758f11cfa9(mutation_plugins[i]).call(this, entries, intersecting_items);
|
|
2400
2400
|
}
|
|
2401
2401
|
observer = new IntersectionObserver(this.#observer_callback.bind(this), {
|
|
2402
|
-
root: this
|
|
2402
|
+
root: this.elements_.sliding_el_,
|
|
2403
2403
|
threshold: $0da0cad4f39e8f32$export$f8ea2e7b15b5d129(100)
|
|
2404
2404
|
});
|
|
2405
2405
|
observe = this.observer.observe.bind(this.observer);
|
|
@@ -2419,7 +2419,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
2419
2419
|
}
|
|
2420
2420
|
#hide_buttons_if_needed() {
|
|
2421
2421
|
// it should be correct that this routine is using sliding_el because for the buttons the position of the first and last element to the main container is relevant
|
|
2422
|
-
const cont = this
|
|
2422
|
+
const cont = this.elements_.sliding_el_,
|
|
2423
2423
|
lastel = this.index_of_last_element,
|
|
2424
2424
|
cont_rect = cont.getBoundingClientRect(),
|
|
2425
2425
|
is = this.intersecting_items_object;
|
|
@@ -2433,12 +2433,12 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
2433
2433
|
// slider is empty
|
|
2434
2434
|
dist_to_left = 0;
|
|
2435
2435
|
}
|
|
2436
|
-
if (dist_to_left >= -this.dist_to_hide_left) this.#visibility(this
|
|
2437
|
-
const rightmost_edge_of_last_card = Math.floor((this.element_by_index(lastel) || this
|
|
2436
|
+
if (dist_to_left >= -this.dist_to_hide_left) this.#visibility(this.elements_.left_, 0);else this.#visibility(this.elements_.left_, 1);
|
|
2437
|
+
const rightmost_edge_of_last_card = Math.floor((this.element_by_index(lastel) || this.elements_.sliding_el_).getBoundingClientRect().right);
|
|
2438
2438
|
const rightmost_edge_of_container = cont_rect.right,
|
|
2439
2439
|
dist_to_right = rightmost_edge_of_last_card - rightmost_edge_of_container;
|
|
2440
2440
|
// dlog("dist to right", dist_to_right, "dist to left", dist_to_left);
|
|
2441
|
-
if (dist_to_right <= this.dist_to_hide_right) this.#visibility(this
|
|
2441
|
+
if (dist_to_right <= this.dist_to_hide_right) this.#visibility(this.elements_.right_, 0);else this.#visibility(this.elements_.right_, 1);
|
|
2442
2442
|
}
|
|
2443
2443
|
first_intersecting_index(min_ratio = 0.5) {
|
|
2444
2444
|
return parseInt(Object.keys(this.intersecting_items_object).find(i => this.intersecting_items_object[i].intersectionRatio > min_ratio) || "");
|
|
@@ -2449,7 +2449,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
2449
2449
|
get index_of_last_element() {
|
|
2450
2450
|
return this.#index_cache.last_el_ ??= (this.first_intersecting?.target?.parentElement?.children?.length ??
|
|
2451
2451
|
// this is for plantagen which has a double whammy slider
|
|
2452
|
-
this
|
|
2452
|
+
this.elements_?.sliding_el_?.children?.length) - 1;
|
|
2453
2453
|
}
|
|
2454
2454
|
get currently_selected() {
|
|
2455
2455
|
// this tries to be what distance_to assumes is the current card when converting a relative offset into an absolute one, available for plugins
|
|
@@ -2459,7 +2459,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
2459
2459
|
visible_sizes: visible_sizes
|
|
2460
2460
|
} = this;
|
|
2461
2461
|
let left_offset = 0;
|
|
2462
|
-
const rectangle_of_container = this
|
|
2462
|
+
const rectangle_of_container = this.elements_.sliding_el_.getBoundingClientRect();
|
|
2463
2463
|
const middle_of_container = rectangle_of_container.width / 2;
|
|
2464
2464
|
for (const [element, info] of visible_sizes) {
|
|
2465
2465
|
left_offset += info.total_visible;
|
|
@@ -2521,13 +2521,13 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
2521
2521
|
}
|
|
2522
2522
|
}
|
|
2523
2523
|
} else {
|
|
2524
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("target is bs, can't find", target, "by either data-index attribute or as child of", this
|
|
2524
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("target is bs, can't find", target, "by either data-index attribute or as child of", this.elements_.sliding_el_);
|
|
2525
2525
|
return 0;
|
|
2526
2526
|
}
|
|
2527
2527
|
}
|
|
2528
2528
|
const rectangle_of_target = target_element.getBoundingClientRect();
|
|
2529
2529
|
const distance_of_li = rectangle_of_target.left + target % 1 * rectangle_of_target.width;
|
|
2530
|
-
const rectangle_of_container = this
|
|
2530
|
+
const rectangle_of_container = this.elements_.sliding_el_.getBoundingClientRect();
|
|
2531
2531
|
const distance_of_container = rectangle_of_container.left;
|
|
2532
2532
|
dist = distance_of_li - distance_of_container;
|
|
2533
2533
|
if (this.center_target) try {
|
|
@@ -2556,7 +2556,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
2556
2556
|
const visible_sizes = new Map();
|
|
2557
2557
|
const visible_cards = Object.keys(this.intersecting_items_object).map(key => +key);
|
|
2558
2558
|
const to_calculate = [visible_cards[0] - 1, ...visible_cards, visible_cards[visible_cards.length - 1] + 1].map(index => this.element_by_index(+index)).filter(e => e);
|
|
2559
|
-
const root_el = this
|
|
2559
|
+
const root_el = this.elements_.sliding_el_;
|
|
2560
2560
|
const root = root_el.getBoundingClientRect();
|
|
2561
2561
|
const root_computed_style = getComputedStyle(root_el);
|
|
2562
2562
|
const root_left = root.left - parseInt(root_computed_style.marginLeft);
|
|
@@ -2624,7 +2624,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
2624
2624
|
if (from_cache) return from_cache;
|
|
2625
2625
|
const {
|
|
2626
2626
|
sliding_el_: sliding_el_
|
|
2627
|
-
} = this
|
|
2627
|
+
} = this.elements_;
|
|
2628
2628
|
let maybe_el = [...(sliding_el_?.children || [])]?.[index];
|
|
2629
2629
|
if (!maybe_el)
|
|
2630
2630
|
// this is for plantagen which has a double whammy slider
|
|
@@ -2642,7 +2642,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
2642
2642
|
const {
|
|
2643
2643
|
right_: right_,
|
|
2644
2644
|
left_: left_
|
|
2645
|
-
} = this
|
|
2645
|
+
} = this.elements_;
|
|
2646
2646
|
left_.addEventListener("click", goleft);
|
|
2647
2647
|
right_.addEventListener("click", goright);
|
|
2648
2648
|
[left_, right_].forEach(button => {
|
|
@@ -2650,7 +2650,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
2650
2650
|
});
|
|
2651
2651
|
}
|
|
2652
2652
|
#create_element_structure(autoinvalidate = true) {
|
|
2653
|
-
const es = this
|
|
2653
|
+
const es = this.elements_;
|
|
2654
2654
|
this.#setup_buttons();
|
|
2655
2655
|
this.container.append(es.left_, es.right_);
|
|
2656
2656
|
this.container.append(es.sliding_el_);
|
|
@@ -2684,12 +2684,12 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
2684
2684
|
#scroll_to(offset, is_absolute = false, fallback_scroll_distance = 500, harsh = false) {
|
|
2685
2685
|
const left = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.#distance_to).call(this, offset, is_absolute);
|
|
2686
2686
|
const distance_after_fallback_applied = Math.round(left ?? fallback_scroll_distance);
|
|
2687
|
-
if (getComputedStyle(this
|
|
2687
|
+
if (getComputedStyle(this.elements_.sliding_el_).scrollSnapType !== "none" && Math.abs(distance_after_fallback_applied) < 10) {
|
|
2688
2688
|
$e6c6e7929ea385ae$export$de56f1198d121036("Not scrolling because snapping is enabled and distance not over threshold", distance_after_fallback_applied);
|
|
2689
2689
|
return;
|
|
2690
2690
|
}
|
|
2691
2691
|
$e6c6e7929ea385ae$export$de56f1198d121036("Trying to scroll by", left, "px", "before fallback,", distance_after_fallback_applied, "after");
|
|
2692
|
-
this
|
|
2692
|
+
this.elements_.sliding_el_.scrollBy({
|
|
2693
2693
|
left: distance_after_fallback_applied,
|
|
2694
2694
|
top: 0,
|
|
2695
2695
|
behavior: harsh ? "auto" : "smooth"
|
|
@@ -2720,14 +2720,14 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
2720
2720
|
mutation_plugins && (this.#mutation_plugins = mutation_plugins);
|
|
2721
2721
|
correct_bs_targets == false && (this.correct_bs_targets = correct_bs_targets);
|
|
2722
2722
|
if (button_elems) {
|
|
2723
|
-
this
|
|
2724
|
-
this
|
|
2723
|
+
this.elements_.right_ = button_elems.right;
|
|
2724
|
+
this.elements_.left_ = button_elems.left;
|
|
2725
2725
|
}
|
|
2726
|
-
if (button_contents?.right) this
|
|
2727
|
-
if (button_contents?.left) this
|
|
2726
|
+
if (button_contents?.right) this.elements_.right_.append(...button_contents.right);
|
|
2727
|
+
if (button_contents?.left) this.elements_.left_.append(...button_contents.left);
|
|
2728
2728
|
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.#create_element_structure).call(this, autoinvalidate_cache);
|
|
2729
2729
|
// @ts-ignore
|
|
2730
|
-
this
|
|
2730
|
+
this.elements_.sliding_el_.slider = this; // dunno if this is dumb? So far nordicagolf/kondomvaruhuset depend on it
|
|
2731
2731
|
// plugin functionality i.e. for dots
|
|
2732
2732
|
const constructor_args = arguments;
|
|
2733
2733
|
constructor_plugins?.forEach?.(mplugin => {
|
package/server/latest/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX, Accessor } from "solid-js";
|
|
2
|
-
export const version = "2.4.
|
|
2
|
+
export const version = "2.4.6";
|
|
3
3
|
export const is_debug: boolean;
|
|
4
4
|
/**
|
|
5
5
|
* Sets the prefix of dlog, dwarn, and derror messages in the browser console. Defaults to `[Depict]`.
|
|
@@ -639,6 +639,11 @@ export interface Slider_Options {
|
|
|
639
639
|
export class Amazing_Slider {
|
|
640
640
|
#private;
|
|
641
641
|
container: HTMLDivElement;
|
|
642
|
+
elements_: {
|
|
643
|
+
sliding_el_: HTMLDivElement;
|
|
644
|
+
left_: HTMLElement;
|
|
645
|
+
right_: HTMLElement;
|
|
646
|
+
};
|
|
642
647
|
insert_here: HTMLDivElement;
|
|
643
648
|
intersecting_items_object: {
|
|
644
649
|
[key: string]: IntersectionObserverEntry;
|
package/server/latest/index.js
CHANGED
|
@@ -5,7 +5,7 @@ register_es_version("utilishared", "latest");
|
|
|
5
5
|
function $parcel$interopDefault(a) {
|
|
6
6
|
return a && a.__esModule ? a.default : a;
|
|
7
7
|
}
|
|
8
|
-
const $0766c85d387a9765$export$83d89fbfd8236492 = "2.4.
|
|
8
|
+
const $0766c85d387a9765$export$83d89fbfd8236492 = "2.4.6";
|
|
9
9
|
const $571bce04eb920cd8$export$55fe61489d2c7417 = /*@__PURE__*/(() => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && (globalThis?.document?.currentScript?.dataset?.debug === "true" || globalThis?.localStorage?.getItem?.("debug") === "true"))();
|
|
10
10
|
const $649f456f663da9fc$var$browser_prefix_styling = "color: #fff;";
|
|
11
11
|
let $649f456f663da9fc$var$browser_prefix = "[Depict]";
|
|
@@ -2151,12 +2151,12 @@ var $ef9394fafebd5eab$var$_tmpl$ = ["<div", ' class="depict-slider depict"></div
|
|
|
2151
2151
|
class $ef9394fafebd5eab$export$692b27c28639e5b9 {
|
|
2152
2152
|
// this is just here because it's often needed together with the slider
|
|
2153
2153
|
container = $f3g9l$ssr($ef9394fafebd5eab$var$_tmpl$, $f3g9l$ssrHydrationKey());
|
|
2154
|
-
|
|
2154
|
+
elements_ = {
|
|
2155
2155
|
sliding_el_: $f3g9l$ssr($ef9394fafebd5eab$var$_tmpl$2, $f3g9l$ssrHydrationKey()),
|
|
2156
2156
|
left_: $f3g9l$ssr($ef9394fafebd5eab$var$_tmpl$3, $f3g9l$ssrHydrationKey()),
|
|
2157
2157
|
right_: $f3g9l$ssr($ef9394fafebd5eab$var$_tmpl$4, $f3g9l$ssrHydrationKey())
|
|
2158
2158
|
};
|
|
2159
|
-
insert_here = this
|
|
2159
|
+
insert_here = this.elements_.sliding_el_;
|
|
2160
2160
|
intersecting_items_object = {};
|
|
2161
2161
|
#mutation_plugins = [];
|
|
2162
2162
|
stepstoslide = 2;
|
|
@@ -2177,7 +2177,7 @@ class $ef9394fafebd5eab$export$692b27c28639e5b9 {
|
|
|
2177
2177
|
} = this;
|
|
2178
2178
|
const {
|
|
2179
2179
|
sliding_el_: sliding_el_
|
|
2180
|
-
} = this
|
|
2180
|
+
} = this.elements_;
|
|
2181
2181
|
for (const record of records) {
|
|
2182
2182
|
for (const node of record.addedNodes) if (node instanceof Element && node.parentElement === sliding_el_) observer.observe(node);
|
|
2183
2183
|
for (const node of record.removedNodes) if (node instanceof Element && node.parentElement === sliding_el_) observer.unobserve(node);
|
|
@@ -2200,7 +2200,7 @@ class $ef9394fafebd5eab$export$692b27c28639e5b9 {
|
|
|
2200
2200
|
for (let i = 0; i < mutation_plugins.length; i++) $b04e44fad5ea42c7$export$b3bbfd758f11cfa9(mutation_plugins[i]).call(this, entries, intersecting_items);
|
|
2201
2201
|
}
|
|
2202
2202
|
observer = new IntersectionObserver(this.#observer_callback.bind(this), {
|
|
2203
|
-
root: this
|
|
2203
|
+
root: this.elements_.sliding_el_,
|
|
2204
2204
|
threshold: $9ab9ecb74920f343$export$f8ea2e7b15b5d129(100)
|
|
2205
2205
|
});
|
|
2206
2206
|
observe = this.observer.observe.bind(this.observer);
|
|
@@ -2220,7 +2220,7 @@ class $ef9394fafebd5eab$export$692b27c28639e5b9 {
|
|
|
2220
2220
|
}
|
|
2221
2221
|
#hide_buttons_if_needed() {
|
|
2222
2222
|
// it should be correct that this routine is using sliding_el because for the buttons the position of the first and last element to the main container is relevant
|
|
2223
|
-
const cont = this
|
|
2223
|
+
const cont = this.elements_.sliding_el_,
|
|
2224
2224
|
lastel = this.index_of_last_element,
|
|
2225
2225
|
cont_rect = cont.getBoundingClientRect(),
|
|
2226
2226
|
is = this.intersecting_items_object;
|
|
@@ -2234,12 +2234,12 @@ class $ef9394fafebd5eab$export$692b27c28639e5b9 {
|
|
|
2234
2234
|
// slider is empty
|
|
2235
2235
|
dist_to_left = 0;
|
|
2236
2236
|
}
|
|
2237
|
-
if (dist_to_left >= -this.dist_to_hide_left) this.#visibility(this
|
|
2238
|
-
const rightmost_edge_of_last_card = Math.floor((this.element_by_index(lastel) || this
|
|
2237
|
+
if (dist_to_left >= -this.dist_to_hide_left) this.#visibility(this.elements_.left_, 0);else this.#visibility(this.elements_.left_, 1);
|
|
2238
|
+
const rightmost_edge_of_last_card = Math.floor((this.element_by_index(lastel) || this.elements_.sliding_el_).getBoundingClientRect().right);
|
|
2239
2239
|
const rightmost_edge_of_container = cont_rect.right,
|
|
2240
2240
|
dist_to_right = rightmost_edge_of_last_card - rightmost_edge_of_container;
|
|
2241
2241
|
// dlog("dist to right", dist_to_right, "dist to left", dist_to_left);
|
|
2242
|
-
if (dist_to_right <= this.dist_to_hide_right) this.#visibility(this
|
|
2242
|
+
if (dist_to_right <= this.dist_to_hide_right) this.#visibility(this.elements_.right_, 0);else this.#visibility(this.elements_.right_, 1);
|
|
2243
2243
|
}
|
|
2244
2244
|
first_intersecting_index(min_ratio = 0.5) {
|
|
2245
2245
|
return parseInt(Object.keys(this.intersecting_items_object).find(i => this.intersecting_items_object[i].intersectionRatio > min_ratio) || "");
|
|
@@ -2250,7 +2250,7 @@ class $ef9394fafebd5eab$export$692b27c28639e5b9 {
|
|
|
2250
2250
|
get index_of_last_element() {
|
|
2251
2251
|
return this.#index_cache.last_el_ ??= (this.first_intersecting?.target?.parentElement?.children?.length ??
|
|
2252
2252
|
// this is for plantagen which has a double whammy slider
|
|
2253
|
-
this
|
|
2253
|
+
this.elements_?.sliding_el_?.children?.length) - 1;
|
|
2254
2254
|
}
|
|
2255
2255
|
get currently_selected() {
|
|
2256
2256
|
// this tries to be what distance_to assumes is the current card when converting a relative offset into an absolute one, available for plugins
|
|
@@ -2260,7 +2260,7 @@ class $ef9394fafebd5eab$export$692b27c28639e5b9 {
|
|
|
2260
2260
|
visible_sizes: visible_sizes
|
|
2261
2261
|
} = this;
|
|
2262
2262
|
let left_offset = 0;
|
|
2263
|
-
const rectangle_of_container = this
|
|
2263
|
+
const rectangle_of_container = this.elements_.sliding_el_.getBoundingClientRect();
|
|
2264
2264
|
const middle_of_container = rectangle_of_container.width / 2;
|
|
2265
2265
|
for (const [element, info] of visible_sizes) {
|
|
2266
2266
|
left_offset += info.total_visible;
|
|
@@ -2322,13 +2322,13 @@ class $ef9394fafebd5eab$export$692b27c28639e5b9 {
|
|
|
2322
2322
|
}
|
|
2323
2323
|
}
|
|
2324
2324
|
} else {
|
|
2325
|
-
$649f456f663da9fc$export$de56f1198d121036("target is bs, can't find", target, "by either data-index attribute or as child of", this
|
|
2325
|
+
$649f456f663da9fc$export$de56f1198d121036("target is bs, can't find", target, "by either data-index attribute or as child of", this.elements_.sliding_el_);
|
|
2326
2326
|
return 0;
|
|
2327
2327
|
}
|
|
2328
2328
|
}
|
|
2329
2329
|
const rectangle_of_target = target_element.getBoundingClientRect();
|
|
2330
2330
|
const distance_of_li = rectangle_of_target.left + target % 1 * rectangle_of_target.width;
|
|
2331
|
-
const rectangle_of_container = this
|
|
2331
|
+
const rectangle_of_container = this.elements_.sliding_el_.getBoundingClientRect();
|
|
2332
2332
|
const distance_of_container = rectangle_of_container.left;
|
|
2333
2333
|
dist = distance_of_li - distance_of_container;
|
|
2334
2334
|
if (this.center_target) try {
|
|
@@ -2357,7 +2357,7 @@ class $ef9394fafebd5eab$export$692b27c28639e5b9 {
|
|
|
2357
2357
|
const visible_sizes = new Map();
|
|
2358
2358
|
const visible_cards = Object.keys(this.intersecting_items_object).map(key => +key);
|
|
2359
2359
|
const to_calculate = [visible_cards[0] - 1, ...visible_cards, visible_cards[visible_cards.length - 1] + 1].map(index => this.element_by_index(+index)).filter(e => e);
|
|
2360
|
-
const root_el = this
|
|
2360
|
+
const root_el = this.elements_.sliding_el_;
|
|
2361
2361
|
const root = root_el.getBoundingClientRect();
|
|
2362
2362
|
const root_computed_style = getComputedStyle(root_el);
|
|
2363
2363
|
const root_left = root.left - parseInt(root_computed_style.marginLeft);
|
|
@@ -2425,7 +2425,7 @@ class $ef9394fafebd5eab$export$692b27c28639e5b9 {
|
|
|
2425
2425
|
if (from_cache) return from_cache;
|
|
2426
2426
|
const {
|
|
2427
2427
|
sliding_el_: sliding_el_
|
|
2428
|
-
} = this
|
|
2428
|
+
} = this.elements_;
|
|
2429
2429
|
let maybe_el = [...(sliding_el_?.children || [])]?.[index];
|
|
2430
2430
|
if (!maybe_el)
|
|
2431
2431
|
// this is for plantagen which has a double whammy slider
|
|
@@ -2443,7 +2443,7 @@ class $ef9394fafebd5eab$export$692b27c28639e5b9 {
|
|
|
2443
2443
|
const {
|
|
2444
2444
|
right_: right_,
|
|
2445
2445
|
left_: left_
|
|
2446
|
-
} = this
|
|
2446
|
+
} = this.elements_;
|
|
2447
2447
|
left_.addEventListener("click", goleft);
|
|
2448
2448
|
right_.addEventListener("click", goright);
|
|
2449
2449
|
[left_, right_].forEach(button => {
|
|
@@ -2451,7 +2451,7 @@ class $ef9394fafebd5eab$export$692b27c28639e5b9 {
|
|
|
2451
2451
|
});
|
|
2452
2452
|
}
|
|
2453
2453
|
#create_element_structure(autoinvalidate = true) {
|
|
2454
|
-
const es = this
|
|
2454
|
+
const es = this.elements_;
|
|
2455
2455
|
this.#setup_buttons();
|
|
2456
2456
|
this.container.append(es.left_, es.right_);
|
|
2457
2457
|
this.container.append(es.sliding_el_);
|
|
@@ -2485,12 +2485,12 @@ class $ef9394fafebd5eab$export$692b27c28639e5b9 {
|
|
|
2485
2485
|
#scroll_to(offset, is_absolute = false, fallback_scroll_distance = 500, harsh = false) {
|
|
2486
2486
|
const left = $b04e44fad5ea42c7$export$b3bbfd758f11cfa9(this.#distance_to).call(this, offset, is_absolute);
|
|
2487
2487
|
const distance_after_fallback_applied = Math.round(left ?? fallback_scroll_distance);
|
|
2488
|
-
if (getComputedStyle(this
|
|
2488
|
+
if (getComputedStyle(this.elements_.sliding_el_).scrollSnapType !== "none" && Math.abs(distance_after_fallback_applied) < 10) {
|
|
2489
2489
|
$649f456f663da9fc$export$de56f1198d121036("Not scrolling because snapping is enabled and distance not over threshold", distance_after_fallback_applied);
|
|
2490
2490
|
return;
|
|
2491
2491
|
}
|
|
2492
2492
|
$649f456f663da9fc$export$de56f1198d121036("Trying to scroll by", left, "px", "before fallback,", distance_after_fallback_applied, "after");
|
|
2493
|
-
this
|
|
2493
|
+
this.elements_.sliding_el_.scrollBy({
|
|
2494
2494
|
left: distance_after_fallback_applied,
|
|
2495
2495
|
top: 0,
|
|
2496
2496
|
behavior: harsh ? "auto" : "smooth"
|
|
@@ -2521,14 +2521,14 @@ class $ef9394fafebd5eab$export$692b27c28639e5b9 {
|
|
|
2521
2521
|
mutation_plugins && (this.#mutation_plugins = mutation_plugins);
|
|
2522
2522
|
correct_bs_targets == false && (this.correct_bs_targets = correct_bs_targets);
|
|
2523
2523
|
if (button_elems) {
|
|
2524
|
-
this
|
|
2525
|
-
this
|
|
2524
|
+
this.elements_.right_ = button_elems.right;
|
|
2525
|
+
this.elements_.left_ = button_elems.left;
|
|
2526
2526
|
}
|
|
2527
|
-
if (button_contents?.right) this
|
|
2528
|
-
if (button_contents?.left) this
|
|
2527
|
+
if (button_contents?.right) this.elements_.right_.append(...button_contents.right);
|
|
2528
|
+
if (button_contents?.left) this.elements_.left_.append(...button_contents.left);
|
|
2529
2529
|
$b04e44fad5ea42c7$export$b3bbfd758f11cfa9(this.#create_element_structure).call(this, autoinvalidate_cache);
|
|
2530
2530
|
// @ts-ignore
|
|
2531
|
-
this
|
|
2531
|
+
this.elements_.sliding_el_.slider = this; // dunno if this is dumb? So far nordicagolf/kondomvaruhuset depend on it
|
|
2532
2532
|
// plugin functionality i.e. for dots
|
|
2533
2533
|
const constructor_args = arguments;
|
|
2534
2534
|
constructor_plugins?.forEach?.(mplugin => {
|