@lukso/web-components 1.84.0 → 1.85.1

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.
@@ -136,7 +136,7 @@ exports.LuksoButton = class LuksoButton extends shared_tailwindElement_index.Tai
136
136
  {
137
137
  isIcon: true,
138
138
  size: ["medium"],
139
- class: "px-2"
139
+ class: "px-3"
140
140
  },
141
141
  {
142
142
  isIcon: true,
@@ -132,7 +132,7 @@ let LuksoButton = class extends TailwindStyledElement(style) {
132
132
  {
133
133
  isIcon: true,
134
134
  size: ["medium"],
135
- class: "px-2"
135
+ class: "px-3"
136
136
  },
137
137
  {
138
138
  isIcon: true,
@@ -34,6 +34,7 @@ exports.LuksoPagination = class LuksoPagination extends shared_tailwindElement_i
34
34
  this.size = "small";
35
35
  this.currentPage = 1;
36
36
  this.totalPages = 0;
37
+ this.isMobile = false;
37
38
  this.styles = index.ce({
38
39
  slots: {
39
40
  wrapper: "flex gap-2",
@@ -69,19 +70,27 @@ exports.LuksoPagination = class LuksoPagination extends shared_tailwindElement_i
69
70
  const prev = current === 1 ? null : current - 1;
70
71
  const next = current === max ? null : current + 1;
71
72
  const items = [1];
72
- if (current === 1 && max === 1)
73
+ if (current === 1 && max === 1) {
73
74
  return { current, prev, next, items };
74
- if (current > 4)
75
+ }
76
+ if (this.isMobile) {
77
+ return { current, prev, next, items: [current] };
78
+ }
79
+ if (current > 4) {
75
80
  items.push("...");
81
+ }
76
82
  const r = 2;
77
83
  const r1 = current - r;
78
84
  const r2 = current + r;
79
- for (let i = Math.max(r1, 2); i <= Math.min(max, r2); i++)
85
+ for (let i = Math.max(r1, 2); i <= Math.min(max, r2); i++) {
80
86
  items.push(i);
81
- if (r2 + 1 < max)
87
+ }
88
+ if (r2 + 1 < max) {
82
89
  items.push("...");
83
- if (r2 < max)
90
+ }
91
+ if (r2 < max) {
84
92
  items.push(max);
93
+ }
85
94
  return { current, prev, next, items };
86
95
  }
87
96
  async pageChangeEvent() {
@@ -194,6 +203,9 @@ __decorateClass([
194
203
  __decorateClass([
195
204
  queryAssignedElements.n({ type: Number, attribute: "total-pages" })
196
205
  ], exports.LuksoPagination.prototype, "totalPages", 2);
206
+ __decorateClass([
207
+ queryAssignedElements.n({ type: Boolean, attribute: "is-mobile" })
208
+ ], exports.LuksoPagination.prototype, "isMobile", 2);
197
209
  __decorateClass([
198
210
  state.t()
199
211
  ], exports.LuksoPagination.prototype, "pagination", 2);
@@ -8,6 +8,7 @@ export declare class LuksoPagination extends LuksoPagination_base {
8
8
  size: InputSize;
9
9
  currentPage: number;
10
10
  totalPages: number;
11
+ isMobile: boolean;
11
12
  private pagination;
12
13
  private styles;
13
14
  willUpdate(changedProperties: PropertyValues<this>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAA;AAOpE,OAAO,yBAAyB,CAAA;AAChC,OAAO,2BAA2B,CAAA;AAElC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAA;;AAS7C,qBACa,eAAgB,SAAQ,oBAA4B;IAE/D,OAAO,EAAE,aAAa,CAAY;IAGlC,IAAI,EAAE,SAAS,CAAU;IAGzB,WAAW,SAAI;IAGf,UAAU,SAAI;IAGd,OAAO,CAAC,UAAU,CAAY;IAE9B,OAAO,CAAC,MAAM,CAmBZ;IAEF,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC;IAYlD,OAAO,CAAC,QAAQ;YAsBF,eAAe;YAaf,cAAc;YAKd,cAAc;YAKd,gBAAgB;IAK9B,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,QAAQ;IAIhB,gBAAgB;IAgBhB,gBAAgB;IAgBhB,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;IA4B7D,MAAM;CAaP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,eAAe,CAAA;KACpC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAA;AAOpE,OAAO,yBAAyB,CAAA;AAChC,OAAO,2BAA2B,CAAA;AAElC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAA;;AAS7C,qBACa,eAAgB,SAAQ,oBAA4B;IAE/D,OAAO,EAAE,aAAa,CAAY;IAGlC,IAAI,EAAE,SAAS,CAAU;IAGzB,WAAW,SAAI;IAGf,UAAU,SAAI;IAGd,QAAQ,UAAQ;IAGhB,OAAO,CAAC,UAAU,CAAY;IAE9B,OAAO,CAAC,MAAM,CAmBZ;IAEF,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC;IAYlD,OAAO,CAAC,QAAQ;YAuCF,eAAe;YAaf,cAAc;YAKd,cAAc;YAKd,gBAAgB;IAK9B,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,QAAQ;IAIhB,gBAAgB;IAgBhB,gBAAgB;IAgBhB,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;IA4B7D,MAAM;CAaP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,eAAe,CAAA;KACpC;CACF"}
@@ -30,6 +30,7 @@ let LuksoPagination = class extends TailwindStyledElement(style) {
30
30
  this.size = "small";
31
31
  this.currentPage = 1;
32
32
  this.totalPages = 0;
33
+ this.isMobile = false;
33
34
  this.styles = ce({
34
35
  slots: {
35
36
  wrapper: "flex gap-2",
@@ -65,19 +66,27 @@ let LuksoPagination = class extends TailwindStyledElement(style) {
65
66
  const prev = current === 1 ? null : current - 1;
66
67
  const next = current === max ? null : current + 1;
67
68
  const items = [1];
68
- if (current === 1 && max === 1)
69
+ if (current === 1 && max === 1) {
69
70
  return { current, prev, next, items };
70
- if (current > 4)
71
+ }
72
+ if (this.isMobile) {
73
+ return { current, prev, next, items: [current] };
74
+ }
75
+ if (current > 4) {
71
76
  items.push("...");
77
+ }
72
78
  const r = 2;
73
79
  const r1 = current - r;
74
80
  const r2 = current + r;
75
- for (let i = Math.max(r1, 2); i <= Math.min(max, r2); i++)
81
+ for (let i = Math.max(r1, 2); i <= Math.min(max, r2); i++) {
76
82
  items.push(i);
77
- if (r2 + 1 < max)
83
+ }
84
+ if (r2 + 1 < max) {
78
85
  items.push("...");
79
- if (r2 < max)
86
+ }
87
+ if (r2 < max) {
80
88
  items.push(max);
89
+ }
81
90
  return { current, prev, next, items };
82
91
  }
83
92
  async pageChangeEvent() {
@@ -190,6 +199,9 @@ __decorateClass([
190
199
  __decorateClass([
191
200
  n({ type: Number, attribute: "total-pages" })
192
201
  ], LuksoPagination.prototype, "totalPages", 2);
202
+ __decorateClass([
203
+ n({ type: Boolean, attribute: "is-mobile" })
204
+ ], LuksoPagination.prototype, "isMobile", 2);
193
205
  __decorateClass([
194
206
  t()
195
207
  ], LuksoPagination.prototype, "pagination", 2);
@@ -22,4 +22,6 @@ export declare const NavButtonVariant: any;
22
22
  export declare const NavTextVariant: any;
23
23
  /** Example of link variant. */
24
24
  export declare const LinkVariant: any;
25
+ /** Example mobile pagination. */
26
+ export declare const Mobile: any;
25
27
  //# sourceMappingURL=lukso-pagination.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lukso-pagination.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-pagination/lukso-pagination.stories.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,SAAS,CAAA;AAEhB,mEAAmE;AACnE,QAAA,MAAM,IAAI,EAAE,IAuEX,CAAA;AAED,eAAe,IAAI,CAAA;AAWnB,qCAAqC;AACrC,eAAO,MAAM,OAAO,KAAoB,CAAA;AAQxC,4CAA4C;AAC5C,eAAO,MAAM,UAAU,KAAoB,CAAA;AAK3C,yCAAyC;AACzC,eAAO,MAAM,OAAO,KAAoB,CAAA;AAKxC,8BAA8B;AAC9B,eAAO,MAAM,UAAU,KAAoB,CAAA;AAK3C,kCAAkC;AAClC,eAAO,MAAM,cAAc,KAAoB,CAAA;AAK/C,kCAAkC;AAClC,eAAO,MAAM,cAAc,KAAoB,CAAA;AAK/C,+BAA+B;AAC/B,eAAO,MAAM,WAAW,KAAoB,CAAA;AAK5C,qCAAqC;AACrC,eAAO,MAAM,gBAAgB,KAAoB,CAAA;AAKjD,mCAAmC;AACnC,eAAO,MAAM,cAAc,KAAoB,CAAA;AAK/C,+BAA+B;AAC/B,eAAO,MAAM,WAAW,KAAoB,CAAA"}
1
+ {"version":3,"file":"lukso-pagination.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-pagination/lukso-pagination.stories.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,SAAS,CAAA;AAEhB,mEAAmE;AACnE,QAAA,MAAM,IAAI,EAAE,IA0FX,CAAA;AAED,eAAe,IAAI,CAAA;AAmBnB,qCAAqC;AACrC,eAAO,MAAM,OAAO,KAAoB,CAAA;AAQxC,4CAA4C;AAC5C,eAAO,MAAM,UAAU,KAAoB,CAAA;AAK3C,yCAAyC;AACzC,eAAO,MAAM,OAAO,KAAoB,CAAA;AAKxC,8BAA8B;AAC9B,eAAO,MAAM,UAAU,KAAoB,CAAA;AAK3C,kCAAkC;AAClC,eAAO,MAAM,cAAc,KAAoB,CAAA;AAK/C,kCAAkC;AAClC,eAAO,MAAM,cAAc,KAAoB,CAAA;AAK/C,+BAA+B;AAC/B,eAAO,MAAM,WAAW,KAAoB,CAAA;AAK5C,qCAAqC;AACrC,eAAO,MAAM,gBAAgB,KAAoB,CAAA;AAKjD,mCAAmC;AACnC,eAAO,MAAM,cAAc,KAAoB,CAAA;AAK/C,+BAA+B;AAC/B,eAAO,MAAM,WAAW,KAAoB,CAAA;AAK5C,iCAAiC;AACjC,eAAO,MAAM,MAAM,KAAoB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukso/web-components",
3
- "version": "1.84.0",
3
+ "version": "1.85.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",