@everymatrix/loyalty-level 0.1.9 → 0.1.11

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.
@@ -1,137 +0,0 @@
1
- import { a as at, p as _, s as st, b as nt, u as B, i as O, c as v, d as lt, e as ot, f as x, g as f, h as it, j as rt, k as z, l as pt, m as ct, n as dt, o as y, q as e, r as m, t as E, v as G, w as gt, x as _t, y as q, z as M, A as T, B as vt, $ as ft, C as yt, D as mt, E as ut } from "./LoyaltyLevel-CBpYwmx7.js";
2
- const ht = {
3
- en: {
4
- prev: "Previous",
5
- next: "Next"
6
- },
7
- tr: {
8
- prev: "Önceki",
9
- next: "Sonraki"
10
- }
11
- }, D = 10, xt = 7, bt = 4;
12
- var wt = x('<span class="loyalty-pagination__ellipsis svelte-lms3sp" aria-hidden="true">...</span>'), It = x('<button type="button"> </button>'), Pt = x('<div class="loyalty-pagination__pages svelte-lms3sp"><button class="loyalty-pagination__btn loyalty-pagination__btn--prev svelte-lms3sp" type="button"> </button> <!> <button class="loyalty-pagination__btn loyalty-pagination__btn--next svelte-lms3sp" type="button"> </button></div>'), kt = x('<div class="loyalty-pagination svelte-lms3sp"><!></div>');
13
- const Et = {
14
- hash: "svelte-lms3sp",
15
- code: `
16
- @layer loyalty-pagination-component {.loyalty-pagination.svelte-lms3sp {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;box-sizing:border-box;width:100%;}
17
-
18
- @media (min-width: 768px) {.loyalty-pagination.svelte-lms3sp {width:auto;margin-left:auto;justify-content:flex-end;padding-right:10px;}.loyalty-pagination__pages.svelte-lms3sp {justify-content:flex-end;}
19
- }.loyalty-pagination__pages.svelte-lms3sp {display:flex;flex-wrap:wrap;align-items:center;gap:8px;justify-content:flex-start;}.loyalty-pagination__ellipsis.svelte-lms3sp {display:inline-flex;align-items:center;justify-content:center;color:var(--text-default, #ffffff);font-size:13px;width:24px;}.loyalty-pagination__btn.svelte-lms3sp {min-width:30px;height:30px;padding:4px 8px;border:none;border-radius:4px;background:var(--bg-overlay-neutral-level-1, rgba(251, 251, 251, 0.05));color:var(--text-subtle, #dfe3e8);font-size:13px;font-weight:400;cursor:pointer;}.loyalty-pagination__btn--active.svelte-lms3sp {background:var(--accent, #ffcc00);color:var(--text-on-color, #261d00);}.loyalty-pagination__btn.svelte-lms3sp:disabled {cursor:default;color:var(--text-muted, rgba(251, 251, 251, 0.15));}.loyalty-pagination__btn--prev.svelte-lms3sp,
20
- .loyalty-pagination__btn--next.svelte-lms3sp {width:95px;}
21
-
22
- @media (max-width: 767px) {.loyalty-pagination__btn--prev.svelte-lms3sp,
23
- .loyalty-pagination__btn--next.svelte-lms3sp {width:90px;}
24
- }.loyalty-pagination__btn--prev.svelte-lms3sp:not(:disabled),
25
- .loyalty-pagination__btn--next.svelte-lms3sp:not(:disabled) {color:var(--text-default, #ffffff);}
26
- }`
27
- };
28
- function Mt(A, o) {
29
- it(o, !0), at(A, Et);
30
- const L = () => vt(ft, "$_", V), [V, F] = ot(), b = _(o, "offset", 7, 0), n = _(o, "limit", 7, D), w = _(o, "total", 7, 0), c = _(o, "onPageChange", 7, (t) => {
31
- }), u = _(o, "locale", 7, "en");
32
- st({ withLocale: u(), translations: {} }), Object.entries(ht).forEach(([t, a]) => {
33
- nt(t, a);
34
- }), B(() => {
35
- rt(u() ?? "en");
36
- });
37
- const h = E(() => Math.max(1, Math.ceil(w() / Math.max(1, n())))), i = E(() => n() > 0 ? Math.floor(b() / n()) : 0);
38
- let I = dt(!1);
39
- B(() => {
40
- const t = window.matchMedia("(max-width: 767px)"), a = (s) => {
41
- z(I, s.matches, !0);
42
- };
43
- return z(I, t.matches, !0), t.addEventListener("change", a), () => t.removeEventListener("change", a);
44
- });
45
- const R = (t, a, s) => t <= (s ? bt : xt) ? Array.from({ length: t }, (C, g) => g) : a <= 1 || a >= t - 2 ? [0, 1, "ellipsis", t - 2, t - 1] : [0, "ellipsis", a, "ellipsis", t - 1], U = E(() => R(e(h), e(i), e(I))), H = (t) => c()(t * n()), J = () => c()(Math.max(0, e(i) - 1) * n()), K = () => c()(Math.min(e(h) - 1, e(i) + 1) * n());
46
- var Q = {
47
- get offset() {
48
- return b();
49
- },
50
- set offset(t = 0) {
51
- b(t), f();
52
- },
53
- get limit() {
54
- return n();
55
- },
56
- set limit(t = D) {
57
- n(t), f();
58
- },
59
- get total() {
60
- return w();
61
- },
62
- set total(t = 0) {
63
- w(t), f();
64
- },
65
- get onPageChange() {
66
- return c();
67
- },
68
- set onPageChange(t = (a) => {
69
- }) {
70
- c(t), f();
71
- },
72
- get locale() {
73
- return u();
74
- },
75
- set locale(t = "en") {
76
- u(t), f();
77
- }
78
- }, P = kt(), W = y(P);
79
- {
80
- var X = (t) => {
81
- var a = Pt(), s = y(a), N = y(s, !0);
82
- m(s);
83
- var k = G(s, 2);
84
- gt(k, 17, () => e(U), _t, (g, r) => {
85
- var j = yt(), Z = mt(j);
86
- {
87
- var $ = (p) => {
88
- var l = wt();
89
- v(p, l);
90
- }, tt = (p) => {
91
- var l = It();
92
- let S;
93
- var et = y(l, !0);
94
- m(l), q(() => {
95
- S = ut(l, 1, "loyalty-pagination__btn svelte-lms3sp", null, S, {
96
- "loyalty-pagination__btn--active": e(r) === e(i)
97
- }), M(et, e(r) + 1);
98
- }), T("click", l, () => H(e(r))), v(p, l);
99
- };
100
- O(Z, (p) => {
101
- e(r) === "ellipsis" ? p($) : p(tt, -1);
102
- });
103
- }
104
- v(g, j);
105
- });
106
- var d = G(k, 2), C = y(d, !0);
107
- m(d), m(a), q(
108
- (g, r) => {
109
- s.disabled = e(i) <= 0, M(N, g), d.disabled = e(i) >= e(h) - 1, M(C, r);
110
- },
111
- [() => L()("prev"), () => L()("next")]
112
- ), T("click", s, J), T("click", d, K), v(t, a);
113
- };
114
- O(W, (t) => {
115
- e(h) > 1 && t(X);
116
- });
117
- }
118
- m(P), v(A, P);
119
- var Y = lt(Q);
120
- return F(), Y;
121
- }
122
- pt(["click"]);
123
- customElements.define("loyalty-pagination", ct(
124
- Mt,
125
- {
126
- offset: {},
127
- limit: {},
128
- total: {},
129
- onPageChange: {},
130
- locale: {}
131
- },
132
- [],
133
- []
134
- ));
135
- export {
136
- Mt as default
137
- };
@@ -1 +0,0 @@
1
- "use strict";if(typeof window!="undefined"){let n=function(e){return function(...s){try{return e.apply(this,s)}catch(t){if(t instanceof DOMException&&t.message.includes("has already been used with this registry")||t.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw t}}};customElements.define=n(customElements.define),Promise.resolve().then(()=>require("../components/LoyaltyLevel-BDtMurlm.cjs")).then(e=>e.LoyaltyLevel_ce).then(({default:e})=>{!customElements.get("loyalty-level")&&customElements.define("loyalty-level",e.element)})}
@@ -1,16 +0,0 @@
1
- if (typeof window != "undefined") {
2
- let n = function(e) {
3
- return function(...s) {
4
- try {
5
- return e.apply(this, s);
6
- } catch (t) {
7
- if (t instanceof DOMException && t.message.includes("has already been used with this registry") || t.message.includes("Cannot define multiple custom elements with the same tag name"))
8
- return !1;
9
- throw t;
10
- }
11
- };
12
- };
13
- customElements.define = n(customElements.define), import("../components/LoyaltyLevel-24B2NAnK.js").then((e) => e.L).then(({ default: e }) => {
14
- !customElements.get("loyalty-level") && customElements.define("loyalty-level", e.element);
15
- });
16
- }