@everymatrix/bonus-pagination-limits 1.0.69

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.
Files changed (44) hide show
  1. package/dist/bonus-pagination-limits/bonus-pagination-limits.esm.js +1 -0
  2. package/dist/bonus-pagination-limits/index.esm.js +0 -0
  3. package/dist/bonus-pagination-limits/p-46dba813.entry.js +1 -0
  4. package/dist/bonus-pagination-limits/p-6d7f3710.js +2 -0
  5. package/dist/bonus-pagination-limits/p-e1255160.js +1 -0
  6. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  7. package/dist/cjs/bonus-pagination-limits.cjs.entry.js +81 -0
  8. package/dist/cjs/bonus-pagination-limits.cjs.js +25 -0
  9. package/dist/cjs/index-e51ca584.js +1163 -0
  10. package/dist/cjs/index.cjs.js +2 -0
  11. package/dist/cjs/loader.cjs.js +15 -0
  12. package/dist/collection/collection-manifest.json +12 -0
  13. package/dist/collection/components/bonus-pagination-limits/bonus-pagination-limits.css +42 -0
  14. package/dist/collection/components/bonus-pagination-limits/bonus-pagination-limits.js +159 -0
  15. package/dist/collection/components/bonus-pagination-limits/index.js +1 -0
  16. package/dist/collection/index.js +1 -0
  17. package/dist/collection/utils/locale.utils.js +38 -0
  18. package/dist/collection/utils/utils.js +3 -0
  19. package/dist/esm/app-globals-0f993ce5.js +3 -0
  20. package/dist/esm/bonus-pagination-limits.entry.js +77 -0
  21. package/dist/esm/bonus-pagination-limits.js +20 -0
  22. package/dist/esm/index-e8c7dbc4.js +1136 -0
  23. package/dist/esm/index.js +1 -0
  24. package/dist/esm/loader.js +11 -0
  25. package/dist/index.cjs.js +1 -0
  26. package/dist/index.js +1 -0
  27. package/dist/stencil.config.dev.js +17 -0
  28. package/dist/stencil.config.js +17 -0
  29. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/bonus-pagination-limits/.stencil/packages/stencil/bonus-pagination-limits/stencil.config.d.ts +2 -0
  30. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/bonus-pagination-limits/.stencil/packages/stencil/bonus-pagination-limits/stencil.config.dev.d.ts +2 -0
  31. package/dist/types/components/bonus-pagination-limits/bonus-pagination-limits.d.ts +25 -0
  32. package/dist/types/components/bonus-pagination-limits/index.d.ts +1 -0
  33. package/dist/types/components.d.ts +85 -0
  34. package/dist/types/index.d.ts +1 -0
  35. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  36. package/dist/types/utils/locale.utils.d.ts +14 -0
  37. package/dist/types/utils/utils.d.ts +1 -0
  38. package/loader/cdn.js +1 -0
  39. package/loader/index.cjs.js +1 -0
  40. package/loader/index.d.ts +24 -0
  41. package/loader/index.es2017.js +1 -0
  42. package/loader/index.js +2 -0
  43. package/loader/package.json +11 -0
  44. package/package.json +26 -0
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-e51ca584.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
7
+
8
+ const defineCustomElements = async (win, options) => {
9
+ if (typeof window === 'undefined') return undefined;
10
+ await appGlobals.globalScripts();
11
+ return index.bootstrapLazy([["bonus-pagination-limits.cjs",[[0,"bonus-pagination-limits",{"language":[513],"translationUrl":[513,"translation-url"],"pageLimitOptions":[513,"page-limit-options"],"limit":[1538],"pageLimits":[32]}]]]], options);
12
+ };
13
+
14
+ exports.setNonce = index.setNonce;
15
+ exports.defineCustomElements = defineCustomElements;
@@ -0,0 +1,12 @@
1
+ {
2
+ "entries": [
3
+ "components/bonus-pagination-limits/bonus-pagination-limits.js"
4
+ ],
5
+ "compiler": {
6
+ "name": "@stencil/core",
7
+ "version": "4.20.0",
8
+ "typescriptVersion": "5.5.3"
9
+ },
10
+ "collections": [],
11
+ "bundles": []
12
+ }
@@ -0,0 +1,42 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .NoOfItemsToDisplayMessage {
6
+ display: inline-block;
7
+ margin: 0.1rem;
8
+ overflow: hidden;
9
+ white-space: nowrap;
10
+ text-overflow: ellipsis;
11
+ color: var(--emfe-w-color-primary, #191a19);
12
+ line-height: 1.8;
13
+ }
14
+
15
+ .PaginationWrapper {
16
+ display: flex;
17
+ flex-direction: row;
18
+ }
19
+
20
+ ul.PaginationArea {
21
+ margin-block: 5px;
22
+ display: flex;
23
+ flex-direction: row;
24
+ padding: 0px;
25
+ }
26
+ ul.PaginationArea li.Item.Active:hover {
27
+ color: var(--emfe-w-color-primary, #eaefea);
28
+ background-color: var(--emfe-w-color-secondary, #191a19);
29
+ }
30
+ ul.PaginationArea li.Item.Active, ul.PaginationArea li.Item:hover {
31
+ background-color: var(--emfe-w-color-primary, rgba(169, 171, 169, 0.7));
32
+ font-weight: bold;
33
+ border-radius: 0.3rem;
34
+ }
35
+ ul.PaginationArea li.Item {
36
+ padding-inline-start: 0px;
37
+ list-style: none;
38
+ padding: 5px 6px;
39
+ margin: 2px;
40
+ cursor: pointer;
41
+ display: inline-block;
42
+ }
@@ -0,0 +1,159 @@
1
+ import { h } from "@stencil/core";
2
+ import { translate, TRANSLATIONS } from "../../utils/locale.utils";
3
+ export class BonusPaginationLimits {
4
+ constructor() {
5
+ this.language = 'en';
6
+ this.translationUrl = '';
7
+ this.pageLimitOptions = undefined;
8
+ this.limit = 10;
9
+ this.pageLimits = [10, 25, 50];
10
+ }
11
+ onPageLimitClicked(pageLimit) {
12
+ this.limit = pageLimit;
13
+ this.pageLimitChanged.emit({ limit: this.limit });
14
+ }
15
+ componentWillLoad() {
16
+ if (!this.pageLimitOptions) {
17
+ return;
18
+ }
19
+ try {
20
+ this.pageLimits = this.pageLimitOptions.split(',').map((item) => {
21
+ return parseInt(item);
22
+ });
23
+ // if there is an array of custom limits provided (string to array - e.g. [5, 10, 15])
24
+ // and the value for the custom set limit (e.g. 8) isn't part of the provided array,
25
+ // then ignore the set the custom set limit and make the limit equal to the first value of the array
26
+ // (as part of the example so far, this would be 5)
27
+ if (!this.pageLimits.includes(this.limit)) {
28
+ this.limit = this.pageLimits[0];
29
+ }
30
+ }
31
+ catch (e) {
32
+ console.error('Error when parse PageLimitOptions', e);
33
+ }
34
+ }
35
+ renderStylingWrapper() {
36
+ return h("general-styling-wrapper", { targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl });
37
+ }
38
+ render() {
39
+ return h("div", { key: '57f5e61ee287f72d0427a2e4f646e37c6b9358b9', class: 'PaginationWrapper' }, h("span", { key: '5f82b19fcf269086659b3faa475d9967b2af57fa', class: 'NoOfItemsToDisplayMessage' }, translate('pageLimitLabel', this.language)), h("ul", { key: '559c2d5378a352691583567579a8e681d092ddd3', class: 'PaginationArea' }, this.pageLimits.map((pageLimit) => {
40
+ return (h("li", { class: `${this.limit == pageLimit ? 'Active' : ''} PageSize Item`, onClick: () => {
41
+ this.onPageLimitClicked(pageLimit);
42
+ } }, pageLimit));
43
+ })), h("general-styling-wrapper", { key: 'a8b9632e7421318e330f33b9c1cc9eb7121e35e9', targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl }), this.renderStylingWrapper());
44
+ }
45
+ static get is() { return "bonus-pagination-limits"; }
46
+ static get originalStyleUrls() {
47
+ return {
48
+ "$": ["bonus-pagination-limits.scss"]
49
+ };
50
+ }
51
+ static get styleUrls() {
52
+ return {
53
+ "$": ["bonus-pagination-limits.css"]
54
+ };
55
+ }
56
+ static get properties() {
57
+ return {
58
+ "language": {
59
+ "type": "string",
60
+ "mutable": false,
61
+ "complexType": {
62
+ "original": "string",
63
+ "resolved": "string",
64
+ "references": {}
65
+ },
66
+ "required": false,
67
+ "optional": false,
68
+ "docs": {
69
+ "tags": [],
70
+ "text": "Language of the widget"
71
+ },
72
+ "attribute": "language",
73
+ "reflect": true,
74
+ "defaultValue": "'en'"
75
+ },
76
+ "translationUrl": {
77
+ "type": "string",
78
+ "mutable": false,
79
+ "complexType": {
80
+ "original": "string",
81
+ "resolved": "string",
82
+ "references": {}
83
+ },
84
+ "required": false,
85
+ "optional": false,
86
+ "docs": {
87
+ "tags": [],
88
+ "text": "Translation via url"
89
+ },
90
+ "attribute": "translation-url",
91
+ "reflect": true,
92
+ "defaultValue": "''"
93
+ },
94
+ "pageLimitOptions": {
95
+ "type": "string",
96
+ "mutable": false,
97
+ "complexType": {
98
+ "original": "string",
99
+ "resolved": "string",
100
+ "references": {}
101
+ },
102
+ "required": false,
103
+ "optional": false,
104
+ "docs": {
105
+ "tags": [],
106
+ "text": "Limits list string split with coma,default: `10,25,50`;"
107
+ },
108
+ "attribute": "page-limit-options",
109
+ "reflect": true
110
+ },
111
+ "limit": {
112
+ "type": "number",
113
+ "mutable": true,
114
+ "complexType": {
115
+ "original": "number",
116
+ "resolved": "number",
117
+ "references": {}
118
+ },
119
+ "required": false,
120
+ "optional": false,
121
+ "docs": {
122
+ "tags": [],
123
+ "text": "Default limit for per page, default: 10"
124
+ },
125
+ "attribute": "limit",
126
+ "reflect": true,
127
+ "defaultValue": "10"
128
+ }
129
+ };
130
+ }
131
+ static get states() {
132
+ return {
133
+ "pageLimits": {}
134
+ };
135
+ }
136
+ static get events() {
137
+ return [{
138
+ "method": "pageLimitChanged",
139
+ "name": "pageLimitChanged",
140
+ "bubbles": true,
141
+ "cancelable": true,
142
+ "composed": true,
143
+ "docs": {
144
+ "tags": [],
145
+ "text": ""
146
+ },
147
+ "complexType": {
148
+ "original": "Object",
149
+ "resolved": "Object",
150
+ "references": {
151
+ "Object": {
152
+ "location": "global",
153
+ "id": "global::Object"
154
+ }
155
+ }
156
+ }
157
+ }];
158
+ }
159
+ }
@@ -0,0 +1 @@
1
+ export { BonusPaginationLimits } from './bonus-pagination-limits';
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,38 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const SUPPORTED_LANGUAGES = ['pt-br', 'en', 'es-mx', 'hu', 'hr'];
3
+ export const TRANSLATIONS = {
4
+ en: {
5
+ "pageLimitLabel": 'Show',
6
+ },
7
+ hu: {
8
+ "pageLimitLabel": 'Show',
9
+ },
10
+ hr: {
11
+ "pageLimitLabel": 'Show',
12
+ },
13
+ "pt-br": {
14
+ "pageLimitLabel": 'Show',
15
+ },
16
+ "es-mx": {
17
+ "pageLimitLabel": 'Show',
18
+ }
19
+ };
20
+ export const translate = (key, customLang) => {
21
+ const lang = customLang;
22
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
23
+ };
24
+ export const getTranslations = (url) => {
25
+ // fetch url, get the data, replace the TRANSLATIONS content
26
+ return new Promise((resolve) => {
27
+ fetch(url)
28
+ .then((res) => res.json())
29
+ .then((data) => {
30
+ Object.keys(data).forEach((item) => {
31
+ for (let key in data[item]) {
32
+ TRANSLATIONS[item][key] = data[item][key];
33
+ }
34
+ });
35
+ resolve(true);
36
+ });
37
+ });
38
+ };
@@ -0,0 +1,3 @@
1
+ export function format(first, middle, last) {
2
+ return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
3
+ }
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };
@@ -0,0 +1,77 @@
1
+ import { r as registerInstance, c as createEvent, h } from './index-e8c7dbc4.js';
2
+
3
+ const DEFAULT_LANGUAGE = 'en';
4
+ const SUPPORTED_LANGUAGES = ['pt-br', 'en', 'es-mx', 'hu', 'hr'];
5
+ const TRANSLATIONS = {
6
+ en: {
7
+ "pageLimitLabel": 'Show',
8
+ },
9
+ hu: {
10
+ "pageLimitLabel": 'Show',
11
+ },
12
+ hr: {
13
+ "pageLimitLabel": 'Show',
14
+ },
15
+ "pt-br": {
16
+ "pageLimitLabel": 'Show',
17
+ },
18
+ "es-mx": {
19
+ "pageLimitLabel": 'Show',
20
+ }
21
+ };
22
+ const translate = (key, customLang) => {
23
+ const lang = customLang;
24
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
25
+ };
26
+
27
+ const bonusPaginationLimitsCss = ":host{display:block}.NoOfItemsToDisplayMessage{display:inline-block;margin:0.1rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--emfe-w-color-primary, #191a19);line-height:1.8}.PaginationWrapper{display:flex;flex-direction:row}ul.PaginationArea{margin-block:5px;display:flex;flex-direction:row;padding:0px}ul.PaginationArea li.Item.Active:hover{color:var(--emfe-w-color-primary, #eaefea);background-color:var(--emfe-w-color-secondary, #191a19)}ul.PaginationArea li.Item.Active,ul.PaginationArea li.Item:hover{background-color:var(--emfe-w-color-primary, rgba(169, 171, 169, 0.7));font-weight:bold;border-radius:0.3rem}ul.PaginationArea li.Item{padding-inline-start:0px;list-style:none;padding:5px 6px;margin:2px;cursor:pointer;display:inline-block}";
28
+ const BonusPaginationLimitsStyle0 = bonusPaginationLimitsCss;
29
+
30
+ const BonusPaginationLimits = class {
31
+ constructor(hostRef) {
32
+ registerInstance(this, hostRef);
33
+ this.pageLimitChanged = createEvent(this, "pageLimitChanged", 7);
34
+ this.language = 'en';
35
+ this.translationUrl = '';
36
+ this.pageLimitOptions = undefined;
37
+ this.limit = 10;
38
+ this.pageLimits = [10, 25, 50];
39
+ }
40
+ onPageLimitClicked(pageLimit) {
41
+ this.limit = pageLimit;
42
+ this.pageLimitChanged.emit({ limit: this.limit });
43
+ }
44
+ componentWillLoad() {
45
+ if (!this.pageLimitOptions) {
46
+ return;
47
+ }
48
+ try {
49
+ this.pageLimits = this.pageLimitOptions.split(',').map((item) => {
50
+ return parseInt(item);
51
+ });
52
+ // if there is an array of custom limits provided (string to array - e.g. [5, 10, 15])
53
+ // and the value for the custom set limit (e.g. 8) isn't part of the provided array,
54
+ // then ignore the set the custom set limit and make the limit equal to the first value of the array
55
+ // (as part of the example so far, this would be 5)
56
+ if (!this.pageLimits.includes(this.limit)) {
57
+ this.limit = this.pageLimits[0];
58
+ }
59
+ }
60
+ catch (e) {
61
+ console.error('Error when parse PageLimitOptions', e);
62
+ }
63
+ }
64
+ renderStylingWrapper() {
65
+ return h("general-styling-wrapper", { targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl });
66
+ }
67
+ render() {
68
+ return h("div", { key: '57f5e61ee287f72d0427a2e4f646e37c6b9358b9', class: 'PaginationWrapper' }, h("span", { key: '5f82b19fcf269086659b3faa475d9967b2af57fa', class: 'NoOfItemsToDisplayMessage' }, translate('pageLimitLabel', this.language)), h("ul", { key: '559c2d5378a352691583567579a8e681d092ddd3', class: 'PaginationArea' }, this.pageLimits.map((pageLimit) => {
69
+ return (h("li", { class: `${this.limit == pageLimit ? 'Active' : ''} PageSize Item`, onClick: () => {
70
+ this.onPageLimitClicked(pageLimit);
71
+ } }, pageLimit));
72
+ })), h("general-styling-wrapper", { key: 'a8b9632e7421318e330f33b9c1cc9eb7121e35e9', targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl }), this.renderStylingWrapper());
73
+ }
74
+ };
75
+ BonusPaginationLimits.style = BonusPaginationLimitsStyle0;
76
+
77
+ export { BonusPaginationLimits as bonus_pagination_limits };
@@ -0,0 +1,20 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-e8c7dbc4.js';
2
+ export { s as setNonce } from './index-e8c7dbc4.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
7
+ */
8
+ var patchBrowser = () => {
9
+ const importMeta = import.meta.url;
10
+ const opts = {};
11
+ if (importMeta !== "") {
12
+ opts.resourcesUrl = new URL(".", importMeta).href;
13
+ }
14
+ return promiseResolve(opts);
15
+ };
16
+
17
+ patchBrowser().then(async (options) => {
18
+ await globalScripts();
19
+ return bootstrapLazy([["bonus-pagination-limits",[[0,"bonus-pagination-limits",{"language":[513],"translationUrl":[513,"translation-url"],"pageLimitOptions":[513,"page-limit-options"],"limit":[1538],"pageLimits":[32]}]]]], options);
20
+ });