@jumpgroup/jump-design-system 0.2.2 → 0.2.4
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/dist/cjs/{index-79e97f36.js → index-41aaa52a.js} +181 -11
- package/dist/cjs/index-41aaa52a.js.map +1 -0
- package/dist/cjs/jump-badge.cjs.entry.js +6 -6
- package/dist/cjs/jump-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/jump-button.cjs.entry.js +10 -6
- package/dist/cjs/jump-button.cjs.entry.js.map +1 -1
- package/dist/cjs/jump-card.cjs.entry.js +4 -4
- package/dist/cjs/jump-card.cjs.entry.js.map +1 -1
- package/dist/cjs/jump-design-system.cjs.js +3 -3
- package/dist/cjs/jump-design-system.cjs.js.map +1 -1
- package/dist/cjs/jump-icon.cjs.entry.js +5 -5
- package/dist/cjs/jump-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/jump-pagination.cjs.entry.js +32 -10
- package/dist/cjs/jump-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/jump-tab.cjs.entry.js +29 -0
- package/dist/cjs/jump-tab.cjs.entry.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +5 -4
- package/dist/collection/components/jump-badge/jump-badge.css +1 -1
- package/dist/collection/components/jump-badge/jump-badge.js +4 -4
- package/dist/collection/components/jump-badge/jump-badge.js.map +1 -1
- package/dist/collection/components/jump-badge/test/jump-badge.spec.js +2 -2
- package/dist/collection/components/jump-badge/test/jump-badge.spec.js.map +1 -1
- package/dist/collection/components/jump-button/jump-button-anchor.stories.js +87 -0
- package/dist/collection/components/jump-button/jump-button-anchor.stories.js.map +1 -0
- package/dist/collection/components/jump-button/jump-button-dimension.stories.js +74 -0
- package/dist/collection/components/jump-button/jump-button-dimension.stories.js.map +1 -0
- package/dist/collection/components/jump-button/jump-button-filled.stories.js +14 -482
- package/dist/collection/components/jump-button/jump-button-filled.stories.js.map +1 -1
- package/dist/collection/components/jump-button/jump-button-only-icon.stories.js +109 -0
- package/dist/collection/components/jump-button/jump-button-only-icon.stories.js.map +1 -0
- package/dist/collection/components/jump-button/jump-button-outline.stories.js +20 -285
- package/dist/collection/components/jump-button/jump-button-outline.stories.js.map +1 -1
- package/dist/collection/components/jump-button/jump-button-text.stories.js +83 -0
- package/dist/collection/components/jump-button/jump-button-text.stories.js.map +1 -0
- package/dist/collection/components/jump-button/jump-button.css +103 -50
- package/dist/collection/components/jump-button/jump-button.js +41 -19
- package/dist/collection/components/jump-button/jump-button.js.map +1 -1
- package/dist/collection/components/jump-button/test/jump-button.spec.js +2 -2
- package/dist/collection/components/jump-button/test/jump-button.spec.js.map +1 -1
- package/dist/collection/components/jump-card/jump-card-border-radius.stories.js +2 -14
- package/dist/collection/components/jump-card/jump-card-border-radius.stories.js.map +1 -1
- package/dist/collection/components/jump-card/jump-card-top-border-content-radius.stories.js +1 -2
- package/dist/collection/components/jump-card/jump-card-top-border-content-radius.stories.js.map +1 -1
- package/dist/collection/components/jump-card/jump-card.css +50 -1
- package/dist/collection/components/jump-card/jump-card.js +13 -13
- package/dist/collection/components/jump-card/jump-card.js.map +1 -1
- package/dist/collection/components/{app-icon → jump-icon}/jump-icon.js +2 -2
- package/dist/collection/components/jump-icon/jump-icon.js.map +1 -0
- package/dist/collection/components/{app-icon → jump-icon}/jump-icon.stories.js +1 -1
- package/dist/collection/components/jump-icon/jump-icon.stories.js.map +1 -0
- package/dist/collection/components/jump-icon/test/jump-icon.e2e.js.map +1 -0
- package/dist/collection/components/{app-icon → jump-icon}/test/jump-icon.spec.js +2 -2
- package/dist/collection/components/jump-icon/test/jump-icon.spec.js.map +1 -0
- package/dist/collection/components/jump-pagination/jump-pagination-pages.stories.js +41 -24
- package/dist/collection/components/jump-pagination/jump-pagination-pages.stories.js.map +1 -1
- package/dist/collection/components/jump-pagination/jump-pagination-products.stories.js +19 -40
- package/dist/collection/components/jump-pagination/jump-pagination-products.stories.js.map +1 -1
- package/dist/collection/components/jump-pagination/jump-pagination.css +13 -0
- package/dist/collection/components/jump-pagination/jump-pagination.js +64 -31
- package/dist/collection/components/jump-pagination/jump-pagination.js.map +1 -1
- package/dist/collection/components/jump-tab/jump-tab-inline.stories.js +28 -0
- package/dist/collection/components/jump-tab/jump-tab-inline.stories.js.map +1 -0
- package/dist/collection/components/jump-tab/jump-tab.css +3 -0
- package/dist/collection/components/jump-tab/jump-tab.js +71 -0
- package/dist/collection/components/jump-tab/jump-tab.js.map +1 -0
- package/dist/collection/components/jump-tab/test/jump-tab.e2e.js +10 -0
- package/dist/collection/components/jump-tab/test/jump-tab.e2e.js.map +1 -0
- package/dist/collection/components/jump-tab/test/jump-tab.spec.js +18 -0
- package/dist/collection/components/jump-tab/test/jump-tab.spec.js.map +1 -0
- package/dist/collection/utils/utils.js +29 -3
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/jump-badge.js +7 -7
- package/dist/components/jump-badge.js.map +1 -1
- package/dist/components/jump-button.js +26 -20
- package/dist/components/jump-button.js.map +1 -1
- package/dist/components/jump-card.js +14 -14
- package/dist/components/jump-card.js.map +1 -1
- package/dist/components/jump-icon.js +2 -2
- package/dist/components/jump-icon2.js +4 -4
- package/dist/components/jump-icon2.js.map +1 -1
- package/dist/components/jump-pagination.js +38 -13
- package/dist/components/jump-pagination.js.map +1 -1
- package/dist/components/jump-tab.d.ts +11 -0
- package/dist/components/jump-tab.js +46 -0
- package/dist/components/jump-tab.js.map +1 -0
- package/dist/esm/{index-7feee8ea.js → index-192aeaf1.js} +181 -12
- package/dist/esm/index-192aeaf1.js.map +1 -0
- package/dist/esm/jump-badge.entry.js +6 -6
- package/dist/esm/jump-badge.entry.js.map +1 -1
- package/dist/esm/jump-button.entry.js +10 -6
- package/dist/esm/jump-button.entry.js.map +1 -1
- package/dist/esm/jump-card.entry.js +4 -4
- package/dist/esm/jump-card.entry.js.map +1 -1
- package/dist/esm/jump-design-system.js +4 -4
- package/dist/esm/jump-design-system.js.map +1 -1
- package/dist/esm/jump-icon.entry.js +5 -5
- package/dist/esm/jump-icon.entry.js.map +1 -1
- package/dist/esm/jump-pagination.entry.js +32 -10
- package/dist/esm/jump-pagination.entry.js.map +1 -1
- package/dist/esm/jump-tab.entry.js +25 -0
- package/dist/esm/jump-tab.entry.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/jump-design-system/jump-design-system.esm.js +1 -1
- package/dist/jump-design-system/jump-design-system.esm.js.map +1 -1
- package/dist/jump-design-system/p-20ceb40c.js +3 -0
- package/dist/jump-design-system/p-20ceb40c.js.map +1 -0
- package/dist/jump-design-system/{p-bc02e346.entry.js → p-511d4425.entry.js} +3 -3
- package/dist/jump-design-system/p-511d4425.entry.js.map +1 -0
- package/dist/jump-design-system/p-61729377.entry.js +2 -0
- package/dist/jump-design-system/p-61729377.entry.js.map +1 -0
- package/dist/jump-design-system/p-700b96b4.entry.js +2 -0
- package/dist/jump-design-system/p-700b96b4.entry.js.map +1 -0
- package/dist/jump-design-system/p-87256ed6.entry.js +2 -0
- package/dist/jump-design-system/p-87256ed6.entry.js.map +1 -0
- package/dist/jump-design-system/{p-99238e3f.entry.js → p-8f5caf32.entry.js} +2 -2
- package/dist/jump-design-system/p-8f5caf32.entry.js.map +1 -0
- package/dist/jump-design-system/p-9e47f451.entry.js +2 -0
- package/dist/jump-design-system/p-9e47f451.entry.js.map +1 -0
- package/dist/jump-design-system-elements.json +20 -7
- package/dist/types/components/jump-badge/jump-badge.d.ts +1 -1
- package/dist/types/components/jump-button/jump-button-anchor.stories.d.ts +44 -0
- package/dist/types/components/jump-button/jump-button-dimension.stories.d.ts +43 -0
- package/dist/types/components/jump-button/jump-button-filled.stories.d.ts +1 -120
- package/dist/types/components/jump-button/jump-button-only-icon.stories.d.ts +53 -0
- package/dist/types/components/jump-button/jump-button-outline.stories.d.ts +4 -112
- package/dist/types/components/jump-button/jump-button-text.stories.d.ts +40 -0
- package/dist/types/components/jump-button/jump-button.d.ts +7 -2
- package/dist/types/components/{app-icon → jump-icon}/jump-icon.d.ts +1 -1
- package/dist/types/components/jump-pagination/jump-pagination-pages.stories.d.ts +2 -1
- package/dist/types/components/jump-pagination/jump-pagination-products.stories.d.ts +2 -2
- package/dist/types/components/jump-pagination/jump-pagination.d.ts +10 -8
- package/dist/types/components/jump-tab/jump-tab-inline.stories.d.ts +18 -0
- package/dist/types/components/jump-tab/jump-tab.d.ts +6 -0
- package/dist/types/components.d.ts +47 -14
- package/dist/types/utils/utils.d.ts +2 -1
- package/package.json +3 -2
- package/dist/cjs/index-79e97f36.js.map +0 -1
- package/dist/collection/components/app-icon/jump-icon.js.map +0 -1
- package/dist/collection/components/app-icon/jump-icon.stories.js.map +0 -1
- package/dist/collection/components/app-icon/test/jump-icon.e2e.js.map +0 -1
- package/dist/collection/components/app-icon/test/jump-icon.spec.js.map +0 -1
- package/dist/collection/utils/utils.spec.js +0 -16
- package/dist/collection/utils/utils.spec.js.map +0 -1
- package/dist/esm/index-7feee8ea.js.map +0 -1
- package/dist/jump-design-system/p-7cfed9c6.entry.js +0 -2
- package/dist/jump-design-system/p-7cfed9c6.entry.js.map +0 -1
- package/dist/jump-design-system/p-99238e3f.entry.js.map +0 -1
- package/dist/jump-design-system/p-9fd6e0a0.entry.js +0 -2
- package/dist/jump-design-system/p-9fd6e0a0.entry.js.map +0 -1
- package/dist/jump-design-system/p-bc02e346.entry.js.map +0 -1
- package/dist/jump-design-system/p-c560071a.js +0 -3
- package/dist/jump-design-system/p-c560071a.js.map +0 -1
- package/dist/jump-design-system/p-ddb6c98c.entry.js +0 -2
- package/dist/jump-design-system/p-ddb6c98c.entry.js.map +0 -1
- /package/dist/collection/components/{app-icon → jump-icon}/jump-icon.css +0 -0
- /package/dist/collection/components/{app-icon → jump-icon}/test/jump-icon.e2e.js +0 -0
- /package/dist/types/components/{app-icon → jump-icon}/jump-icon.stories.d.ts +0 -0
|
@@ -1,42 +1,67 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$2 } from './jump-icon2.js';
|
|
3
3
|
|
|
4
|
-
const jumpPaginationCss = ":host{display:block}.JumpPagination{--pagination-label-color:var(--neutral-grey-secondary);--pagination-arrows-color:var(--neutral-grey-secondary);font-family:var(--ff-primary)}.JumpPagination__Wrapper{display:flex;justify-content:space-between}.JumpPagination__Wrapper .elementsPerPage{display:flex;gap:1rem;align-items:center}.JumpPagination__Wrapper .elementsPerPage label{color:var(--pagination-label-color);font-size:14px;font-weight:normal}.JumpPagination__Wrapper .indicators{font-size:16px;font-weight:normal;display:flex;justify-content:space-between;gap:20px;color:var(--pagination-label-color)}.JumpPagination__Wrapper .indicators .arrow{color:var(--pagination-arrows-color);display:flex;align-items:center;gap:10px}.JumpPagination__Wrapper .indicators .elements{color:var(--pagination-label-color);display:flex;align-items:center;gap:5px}";
|
|
4
|
+
const jumpPaginationCss = ":host{display:block}.JumpPagination{--pagination-label-color:var(--neutral-grey-secondary);--pagination-arrows-color:var(--neutral-grey-secondary);--pagination-arrows-disabled:#CBCBCB;font-family:var(--ff-primary)}.JumpPagination__Wrapper{display:flex;justify-content:space-between}.JumpPagination__Wrapper .elementsPerPage{display:flex;gap:1rem;align-items:center}.JumpPagination__Wrapper .elementsPerPage label{color:var(--pagination-label-color);font-size:14px;font-weight:normal}.JumpPagination__Wrapper .indicators{font-size:16px;font-weight:normal;display:flex;justify-content:space-between;gap:20px;color:var(--pagination-label-color)}.JumpPagination__Wrapper .indicators .arrow{color:var(--pagination-arrows-color);display:flex;align-items:center;gap:10px}.JumpPagination__Wrapper .indicators .arrow button{background-color:transparent;border:none;cursor:pointer;padding:0px;display:flex;align-items:center}.JumpPagination__Wrapper .indicators .arrow button:disabled{cursor:not-allowed;color:var(--pagination-arrows-disabled)}.JumpPagination__Wrapper .indicators .elements{color:var(--pagination-label-color);display:flex;align-items:center;gap:5px}";
|
|
5
5
|
const JumpPaginationStyle0 = jumpPaginationCss;
|
|
6
6
|
|
|
7
7
|
const JumpPagination$1 = /*@__PURE__*/ proxyCustomElement(class JumpPagination extends HTMLElement {
|
|
8
8
|
constructor() {
|
|
9
9
|
super();
|
|
10
10
|
this.__registerHost();
|
|
11
|
+
this.jumpChangePage = createEvent(this, "jump-change-page", 7);
|
|
12
|
+
this.firstPage = 1;
|
|
13
|
+
this.currentPage = undefined;
|
|
11
14
|
this.totalElements = undefined;
|
|
12
15
|
this.pagLabel = 'di';
|
|
13
|
-
this.
|
|
14
|
-
this.lastPage =
|
|
16
|
+
this.initialPage = 1;
|
|
17
|
+
this.lastPage = 10;
|
|
15
18
|
this.labelElementsPerPage = 'Elementi per pagina';
|
|
16
19
|
this.elementsRanges = [10, 20, 60, 100];
|
|
17
|
-
this.firstPage = undefined;
|
|
18
20
|
this.completeVersion = false;
|
|
19
|
-
this.
|
|
21
|
+
this.showFirstAndLast = false;
|
|
22
|
+
}
|
|
23
|
+
watchCurrentPage(newValue, oldValue) {
|
|
24
|
+
let details = {
|
|
25
|
+
currentPage: newValue,
|
|
26
|
+
previousPage: oldValue,
|
|
27
|
+
firstPage: this.firstPage,
|
|
28
|
+
lastPage: this.lastPage,
|
|
29
|
+
direction: newValue > oldValue ? 'next' : 'prev'
|
|
30
|
+
};
|
|
31
|
+
this.jumpChangePage.emit(details);
|
|
32
|
+
}
|
|
33
|
+
/* ---------------------- @LIFECYCLE ------------------------- */
|
|
34
|
+
componentWillLoad() {
|
|
35
|
+
this.currentPage = this.initialPage;
|
|
20
36
|
}
|
|
21
37
|
render() {
|
|
22
38
|
var _a;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
h("
|
|
39
|
+
console.log('completeVersion', this.completeVersion);
|
|
40
|
+
return (h(Host, { key: '32e300881b3a78d25edf6480e9a8a6594f907c76', class: "JumpPagination" }, h("div", { key: '0c4e133e409740331083588fbb046d79c2878ea9', class: "JumpPagination__Wrapper" }, this.completeVersion &&
|
|
41
|
+
h("div", { key: '13daa8e819ec294b50823becc7e8d904eff66f32', class: "elementsPerPage" }, h("label", { key: '162555e0ebfc295d96d5ba358ec879eba1730746', htmlFor: "elements" }, (_a = this.labelElementsPerPage) !== null && _a !== void 0 ? _a : 'Elements per page'), h("select", { key: 'c4e99d784347a67c5616b3ed0ca25934dbdae55f', name: "elements", id: "elements" }, this.elementsRanges.map((range) => (h("option", { value: range }, range))))), h("div", { key: '5eb516226cf5bcb23e575109371c4f55ca235e04', class: "indicators" }, h("div", { key: '58a8655b582e8cdcd9f8c553343d9e407dd66971', class: "elements" }, this.completeVersion ?
|
|
42
|
+
h("span", null, h("span", null, this.firstPage), " - ", h("span", null, this.currentPage), " ", this.pagLabel, " ", h("span", null, this.totalElements))
|
|
26
43
|
:
|
|
27
|
-
h("span", null, h("span", null, this.currentPage), "
|
|
44
|
+
h("span", null, h("span", null, this.currentPage), " ", this.pagLabel, " ", h("span", null, this.lastPage))), h("div", { key: '92b5476c223e477532726304c282ed34e1acccc7', class: "arrow" }, this.showFirstAndLast &&
|
|
45
|
+
h("button", { key: '740c67ee4f73c5a55a022b2281913d8652deeed2', onClick: () => { this.currentPage = this.firstPage; }, disabled: (this.currentPage === this.firstPage) ? true : false }, " ", h("jump-icon", { key: '5a880ea7c01afcc8ae9a4e84934e386e0edab58c', slot: "prefix", name: "chevrons-left" }), " "), h("button", { key: '08fe7f7faa6c7645151ec3ea2b4bf4247f082a2d', onClick: () => { this.currentPage--; }, disabled: (this.currentPage === this.firstPage) ? true : false }, " ", h("jump-icon", { key: '04a972584533f1272b10c7e9068ce332aef77299', slot: "prefix", name: "chevron-left" }), " "), h("button", { key: '0ea012c03b06b587296c9190eece67351579b6e3', onClick: () => { this.currentPage++; }, disabled: (this.currentPage === this.lastPage) ? true : false }, " ", h("jump-icon", { key: '155d6a407989f9cc5d38832df8fb98a3505c3113', slot: "prefix", name: "chevron-right" }), " "), this.showFirstAndLast &&
|
|
46
|
+
h("button", { key: 'be46c67831f6d732d47e9340aca1a43a650af958', onClick: () => { this.currentPage = this.lastPage; }, disabled: (this.currentPage === this.lastPage) ? true : false }, " ", h("jump-icon", { key: 'b04a3d8a8726f945d5639761dde68a300e40f80a', slot: "prefix", name: "chevrons-right" }), " "))))));
|
|
28
47
|
}
|
|
48
|
+
static get watchers() { return {
|
|
49
|
+
"currentPage": ["watchCurrentPage"]
|
|
50
|
+
}; }
|
|
29
51
|
static get style() { return JumpPaginationStyle0; }
|
|
30
52
|
}, [0, "jump-pagination", {
|
|
31
53
|
"totalElements": [514, "total-elements"],
|
|
32
54
|
"pagLabel": [513, "pag-label"],
|
|
33
|
-
"
|
|
55
|
+
"initialPage": [514, "initial-page"],
|
|
34
56
|
"lastPage": [514, "last-page"],
|
|
35
57
|
"labelElementsPerPage": [513, "label-elements-per-page"],
|
|
36
58
|
"elementsRanges": [16],
|
|
37
|
-
"firstPage": [514, "first-page"],
|
|
38
59
|
"completeVersion": [516, "complete-version"],
|
|
39
|
-
"
|
|
60
|
+
"showFirstAndLast": [516, "show-first-and-last"],
|
|
61
|
+
"firstPage": [32],
|
|
62
|
+
"currentPage": [32]
|
|
63
|
+
}, undefined, {
|
|
64
|
+
"currentPage": ["watchCurrentPage"]
|
|
40
65
|
}]);
|
|
41
66
|
function defineCustomElement$1() {
|
|
42
67
|
if (typeof customElements === "undefined") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"jump-pagination.js","mappings":";;;AAAA,MAAM,iBAAiB,GAAG,
|
|
1
|
+
{"file":"jump-pagination.js","mappings":"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","names":["JumpPagination"],"sources":["src/components/jump-pagination/jump-pagination.scss?tag=jump-pagination","src/components/jump-pagination/jump-pagination.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.JumpPagination {\n --pagination-label-color: var(--neutral-grey-secondary);\n --pagination-arrows-color: var(--neutral-grey-secondary);\n --pagination-arrows-disabled: #CBCBCB;\n \n font-family: var(--ff-primary);\n\n &__Wrapper {\n display: flex;\n justify-content: space-between;\n\n .elementsPerPage {\n display: flex;\n gap: 1rem;\n align-items: center;\n\n label {\n color: var(--pagination-label-color);\n font-size: 14px;\n font-weight: normal;\n }\n } \n \n .indicators {\n font-size: 16px;\n font-weight: normal;\n display: flex;\n justify-content: space-between;\n gap: 20px;\n \n color: var(--pagination-label-color);\n\n .arrow {\n color: var(--pagination-arrows-color);\n display: flex;\n align-items: center;\n gap: 10px;\n\n button {\n background-color: transparent;\n border: none;\n cursor: pointer;\n padding: 0px;\n display: flex;\n align-items: center;\n }\n\n button:disabled {\n cursor: not-allowed;\n color: var(--pagination-arrows-disabled); \n \n }\n }\n\n .elements {\n color: var(--pagination-label-color);\n display: flex;\n align-items: center;\n gap: 5px;\n }\n }\n \n }\n \n}","import { Component, Host, State, Event, EventEmitter, Prop, h, Watch } from '@stencil/core';\n\n@Component({\n tag: 'jump-pagination',\n styleUrl: 'jump-pagination.scss',\n shadow: false,\n})\nexport class JumpPagination {\n \n /* ---------------------- @STATE ------------------------- */\n /**\n * Indicates the first page/product of the list\n */\n @State() firstPage: number = 1;\n\n @State() currentPage: number;\n\n @Watch('currentPage')\n watchCurrentPage(newValue: number, oldValue: number) {\n let details = {\n currentPage: newValue,\n previousPage: oldValue,\n firstPage: this.firstPage,\n lastPage: this.lastPage,\n direction: newValue > oldValue ? 'next' : 'prev'\n };\n\n this.jumpChangePage.emit(details);\n }\n\n /* ---------------------- @PROPERTIES ------------------------- */\n\n @Prop({reflect:true}) totalElements: number;\n\n @Prop({reflect:true}) pagLabel: string = 'di'; // Identifica la label testuale di pagination. \n\n @Prop({reflect:true}) initialPage: number = 1;\n\n @Prop({reflect:true}) lastPage: number = 10; \n\n /**\n * Label for the elements per page select\n */\n @Prop({reflect:true}) labelElementsPerPage: string = 'Elementi per pagina';\n\n /**\n * Values for the elements per page select\n */\n @Prop({reflect:true}) elementsRanges: Array<number> = [10, 20, 60, 100];\n\n\n /**\n * If true, the component will show the complete version of the pagination, with elements informations\n */\n @Prop({reflect:true}) completeVersion: boolean = false;\n\n @Prop({reflect:true}) showFirstAndLast: boolean = false;\n\n /* ---------------------- @EVENTS ------------------------- */\n @Event({ eventName: 'jump-change-page' }) jumpChangePage: EventEmitter;\n\n /* ---------------------- @LIFECYCLE ------------------------- */\n componentWillLoad() {\n this.currentPage = this.initialPage;\n }\n\n render() {\n console.log('completeVersion', this.completeVersion);\n return (\n <Host class=\"JumpPagination\">\n <div class=\"JumpPagination__Wrapper\">\n { this.completeVersion && \n <div class=\"elementsPerPage\">\n <label htmlFor=\"elements\">{this.labelElementsPerPage ?? 'Elements per page'}</label>\n <select name=\"elements\" id=\"elements\">\n {this.elementsRanges.map((range) => (\n <option value={range}>{range}</option>\n ))}\n </select>\n </div> \n }\n <div class=\"indicators\"> \n <div class=\"elements\">\n {this.completeVersion ?\n <span>\n <span>{this.firstPage}</span> - <span>{this.currentPage}</span> {this.pagLabel} <span>{this.totalElements}</span>\n </span>\n \n :\n <span>\n <span>{this.currentPage}</span> {this.pagLabel} <span>{this.lastPage}</span>\n </span>\n }\n </div>\n <div class=\"arrow\">\n {this.showFirstAndLast &&\n <button \n onClick={() => {this.currentPage = this.firstPage} }\n disabled={(this.currentPage === this.firstPage) ? true : false}\n > <jump-icon slot=\"prefix\" name=\"chevrons-left\"></jump-icon> </button>\n }\n <button \n onClick={() => {this.currentPage--}} \n disabled={(this.currentPage === this.firstPage) ? true : false}\n > <jump-icon slot=\"prefix\" name=\"chevron-left\"></jump-icon> </button>\n <button \n onClick={() => {this.currentPage++}}\n disabled={(this.currentPage === this.lastPage) ? true : false}\n > <jump-icon slot=\"prefix\" name=\"chevron-right\"></jump-icon> </button>\n {this.showFirstAndLast &&\n <button \n onClick={() => {this.currentPage = this.lastPage}}\n disabled={(this.currentPage === this.lastPage) ? true : false}\n > <jump-icon slot=\"prefix\" name=\"chevrons-right\"></jump-icon> </button> \n }\n </div> \n </div>\n </div>\n </Host>\n );\n }\n\n}\n"],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface JumpTab extends Components.JumpTab, HTMLElement {}
|
|
4
|
+
export const JumpTab: {
|
|
5
|
+
prototype: JumpTab;
|
|
6
|
+
new (): JumpTab;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const jumpTabCss = ":host{display:block}";
|
|
4
|
+
const JumpTabStyle0 = jumpTabCss;
|
|
5
|
+
|
|
6
|
+
const JumpTab$1 = /*@__PURE__*/ proxyCustomElement(class JumpTab extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.activeTab = undefined;
|
|
12
|
+
this.tabNames = undefined;
|
|
13
|
+
}
|
|
14
|
+
componentWillLoad() {
|
|
15
|
+
console.log('Component is about to be rendered');
|
|
16
|
+
console.log('active', this.activeTab);
|
|
17
|
+
console.log('tabNames', this.tabNames);
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return (h(Host, { key: '08d20c1e157286fd4034790df04c2f7113e57e43', class: "JumpTab" }, (this.tabNames && this.activeTab) && this.tabNames.map((tabName) => (h("div", { class: `JumpTab__Tab ${this.activeTab === tabName ? 'active' : ''}` }, tabName)))));
|
|
21
|
+
}
|
|
22
|
+
static get style() { return JumpTabStyle0; }
|
|
23
|
+
}, [1, "jump-tab", {
|
|
24
|
+
"activeTab": [1, "active-tab"],
|
|
25
|
+
"tabNames": [16]
|
|
26
|
+
}]);
|
|
27
|
+
function defineCustomElement$1() {
|
|
28
|
+
if (typeof customElements === "undefined") {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const components = ["jump-tab"];
|
|
32
|
+
components.forEach(tagName => { switch (tagName) {
|
|
33
|
+
case "jump-tab":
|
|
34
|
+
if (!customElements.get(tagName)) {
|
|
35
|
+
customElements.define(tagName, JumpTab$1);
|
|
36
|
+
}
|
|
37
|
+
break;
|
|
38
|
+
} });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const JumpTab = JumpTab$1;
|
|
42
|
+
const defineCustomElement = defineCustomElement$1;
|
|
43
|
+
|
|
44
|
+
export { JumpTab, defineCustomElement };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=jump-tab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"jump-tab.js","mappings":";;AAAA,MAAM,UAAU,GAAG,sBAAsB,CAAC;AAC1C,sBAAe,UAAU;;MCMZA,SAAO;;;;;yBAGU,SAAS;wBACH,SAAS;;IAE3C,iBAAiB;QACf,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KACvC;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,KAAK,EAAC,SAAS,IAClB,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,MAC9D,WAAK,KAAK,EAAE,gBAAgB,IAAI,CAAC,SAAS,KAAK,OAAO,GAAG,QAAQ,GAAG,EAAE,EAAE,IACrE,OAAO,CACJ,CACP,CAAC,CACG,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;","names":["JumpTab"],"sources":["src/components/jump-tab/jump-tab.scss?tag=jump-tab&encapsulation=shadow","src/components/jump-tab/jump-tab.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'jump-tab',\n styleUrl: 'jump-tab.scss',\n shadow: true,\n})\nexport class JumpTab {\n\n /* ---------------------- @PROPERTIES ------------------------- */\n @Prop() activeTab: string = undefined;\n @Prop() tabNames: Array<string> = undefined;\n\n componentWillLoad() {\n console.log('Component is about to be rendered');\n console.log('active',this.activeTab);\n console.log('tabNames',this.tabNames);\n }\n\n render() {\n return (\n <Host class=\"JumpTab\">\n {(this.tabNames && this.activeTab) && this.tabNames.map((tabName) => (\n <div class={`JumpTab__Tab ${this.activeTab === tabName ? 'active' : ''}`}>\n {tabName}\n </div>\n ))}\n </Host>\n );\n }\n\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const NAMESPACE = 'jump-design-system';
|
|
2
|
-
const BUILD = /* jump-design-system */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad:
|
|
2
|
+
const BUILD = /* jump-design-system */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Virtual DOM patching algorithm based on Snabbdom by
|
|
@@ -9,6 +9,7 @@ const BUILD = /* jump-design-system */ { allRenderFn: true, appendChildSlotFix:
|
|
|
9
9
|
*
|
|
10
10
|
* Modified for Stencil's renderer and slot projection
|
|
11
11
|
*/
|
|
12
|
+
let scopeId;
|
|
12
13
|
let contentRef;
|
|
13
14
|
let hostTagName;
|
|
14
15
|
let useNativeShadowDom = false;
|
|
@@ -46,6 +47,7 @@ const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
|
|
|
46
47
|
* Don't add values to these!!
|
|
47
48
|
*/
|
|
48
49
|
const EMPTY_OBJ = {};
|
|
50
|
+
const isDef = (v) => v != null;
|
|
49
51
|
/**
|
|
50
52
|
* Check whether a value is a 'complex type', defined here as an object or a
|
|
51
53
|
* function.
|
|
@@ -225,6 +227,20 @@ const parsePropertyValue = (propValue, propType) => {
|
|
|
225
227
|
// so no need to change to a different type
|
|
226
228
|
return propValue;
|
|
227
229
|
};
|
|
230
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
231
|
+
const createEvent = (ref, name, flags) => {
|
|
232
|
+
const elm = getElement(ref);
|
|
233
|
+
return {
|
|
234
|
+
emit: (detail) => {
|
|
235
|
+
return emitEvent(elm, name, {
|
|
236
|
+
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
237
|
+
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
238
|
+
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
|
239
|
+
detail,
|
|
240
|
+
});
|
|
241
|
+
},
|
|
242
|
+
};
|
|
243
|
+
};
|
|
228
244
|
/**
|
|
229
245
|
* Helper function to create & dispatch a custom Event on a provided target
|
|
230
246
|
* @param elm the target of the Event
|
|
@@ -298,8 +314,20 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
298
314
|
const attachStyles = (hostRef) => {
|
|
299
315
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
300
316
|
const elm = hostRef.$hostElement$;
|
|
317
|
+
const flags = cmpMeta.$flags$;
|
|
301
318
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
302
|
-
addStyle(elm.getRootNode(), cmpMeta);
|
|
319
|
+
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
320
|
+
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
321
|
+
// only required when we're NOT using native shadow dom (slot)
|
|
322
|
+
// or this browser doesn't support native shadow dom
|
|
323
|
+
// and this host element was NOT created with SSR
|
|
324
|
+
// let's pick out the inner content for slot projection
|
|
325
|
+
// create a node to represent where the original
|
|
326
|
+
// content was first placed, which is useful later on
|
|
327
|
+
// DOM WRITE!!
|
|
328
|
+
elm['s-sc'] = scopeId;
|
|
329
|
+
elm.classList.add(scopeId + '-h');
|
|
330
|
+
}
|
|
303
331
|
endAttachStyles();
|
|
304
332
|
};
|
|
305
333
|
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
@@ -329,7 +357,7 @@ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
|
329
357
|
const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
330
358
|
if (oldValue !== newValue) {
|
|
331
359
|
let isProp = isMemberInElement(elm, memberName);
|
|
332
|
-
memberName.toLowerCase();
|
|
360
|
+
let ln = memberName.toLowerCase();
|
|
333
361
|
if (memberName === 'class') {
|
|
334
362
|
const classList = elm.classList;
|
|
335
363
|
const oldClasses = parseClassList(oldValue);
|
|
@@ -339,6 +367,53 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
339
367
|
}
|
|
340
368
|
else if (memberName === 'key')
|
|
341
369
|
;
|
|
370
|
+
else if ((!isProp ) &&
|
|
371
|
+
memberName[0] === 'o' &&
|
|
372
|
+
memberName[1] === 'n') {
|
|
373
|
+
// Event Handlers
|
|
374
|
+
// so if the member name starts with "on" and the 3rd characters is
|
|
375
|
+
// a capital letter, and it's not already a member on the element,
|
|
376
|
+
// then we're assuming it's an event listener
|
|
377
|
+
if (memberName[2] === '-') {
|
|
378
|
+
// on- prefixed events
|
|
379
|
+
// allows to be explicit about the dom event to listen without any magic
|
|
380
|
+
// under the hood:
|
|
381
|
+
// <my-cmp on-click> // listens for "click"
|
|
382
|
+
// <my-cmp on-Click> // listens for "Click"
|
|
383
|
+
// <my-cmp on-ionChange> // listens for "ionChange"
|
|
384
|
+
// <my-cmp on-EVENTS> // listens for "EVENTS"
|
|
385
|
+
memberName = memberName.slice(3);
|
|
386
|
+
}
|
|
387
|
+
else if (isMemberInElement(win, ln)) {
|
|
388
|
+
// standard event
|
|
389
|
+
// the JSX attribute could have been "onMouseOver" and the
|
|
390
|
+
// member name "onmouseover" is on the window's prototype
|
|
391
|
+
// so let's add the listener "mouseover", which is all lowercased
|
|
392
|
+
memberName = ln.slice(2);
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
// custom event
|
|
396
|
+
// the JSX attribute could have been "onMyCustomEvent"
|
|
397
|
+
// so let's trim off the "on" prefix and lowercase the first character
|
|
398
|
+
// and add the listener "myCustomEvent"
|
|
399
|
+
// except for the first character, we keep the event name case
|
|
400
|
+
memberName = ln[2] + memberName.slice(3);
|
|
401
|
+
}
|
|
402
|
+
if (oldValue || newValue) {
|
|
403
|
+
// Need to account for "capture" events.
|
|
404
|
+
// If the event name ends with "Capture", we'll update the name to remove
|
|
405
|
+
// the "Capture" suffix and make sure the event listener is setup to handle the capture event.
|
|
406
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
407
|
+
// Make sure we only replace the last instance of "Capture"
|
|
408
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
|
|
409
|
+
if (oldValue) {
|
|
410
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
411
|
+
}
|
|
412
|
+
if (newValue) {
|
|
413
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
342
417
|
else {
|
|
343
418
|
// Set property if it exists and it's not a SVG
|
|
344
419
|
const isComplex = isComplexType(newValue);
|
|
@@ -387,6 +462,8 @@ const parseClassListRegex = /\s/;
|
|
|
387
462
|
* @returns list of classes, e.g. ["foo", "bar", "baz"]
|
|
388
463
|
*/
|
|
389
464
|
const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
|
|
465
|
+
const CAPTURE_EVENT_SUFFIX = 'Capture';
|
|
466
|
+
const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
|
|
390
467
|
const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
391
468
|
// if the element passed in is a shadow root, which is a document fragment
|
|
392
469
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
@@ -398,17 +475,35 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
398
475
|
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
399
476
|
{
|
|
400
477
|
// remove attributes no longer present on the vnode by setting them to undefined
|
|
401
|
-
for (memberName
|
|
478
|
+
for (memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
402
479
|
if (!(memberName in newVnodeAttrs)) {
|
|
403
480
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
|
|
404
481
|
}
|
|
405
482
|
}
|
|
406
483
|
}
|
|
407
484
|
// add new & update changed attributes
|
|
408
|
-
for (memberName
|
|
485
|
+
for (memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
409
486
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
410
487
|
}
|
|
411
488
|
};
|
|
489
|
+
/**
|
|
490
|
+
* Sort a list of attribute names to ensure that all the attribute names which
|
|
491
|
+
* are _not_ `"ref"` come before `"ref"`. Preserve the order of the non-ref
|
|
492
|
+
* attributes.
|
|
493
|
+
*
|
|
494
|
+
* **Note**: if the supplied attributes do not include `'ref'` then the same
|
|
495
|
+
* (by reference) array will be returned without modification.
|
|
496
|
+
*
|
|
497
|
+
* @param attrNames attribute names to sort
|
|
498
|
+
* @returns a list of attribute names, sorted if they include `"ref"`
|
|
499
|
+
*/
|
|
500
|
+
function sortedAttrNames(attrNames) {
|
|
501
|
+
return attrNames.includes('ref')
|
|
502
|
+
? // we need to sort these to ensure that `'ref'` is the last attr
|
|
503
|
+
[...attrNames.filter((attr) => attr !== 'ref'), 'ref']
|
|
504
|
+
: // no need to sort, return the original array
|
|
505
|
+
attrNames;
|
|
506
|
+
}
|
|
412
507
|
/**
|
|
413
508
|
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
414
509
|
*
|
|
@@ -431,6 +526,10 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
431
526
|
// remember for later we need to check to relocate nodes
|
|
432
527
|
checkSlotRelocate = true;
|
|
433
528
|
if (newVNode.$tag$ === 'slot') {
|
|
529
|
+
if (scopeId) {
|
|
530
|
+
// scoped css needs to add its scoped id to the parent element
|
|
531
|
+
parentElm.classList.add(scopeId + '-s');
|
|
532
|
+
}
|
|
434
533
|
newVNode.$flags$ |= newVNode.$children$
|
|
435
534
|
? // slot element has fallback content
|
|
436
535
|
2 /* VNODE_FLAGS.isSlotFallback */
|
|
@@ -456,10 +555,15 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
456
555
|
{
|
|
457
556
|
updateElement(null, newVNode, isSvgMode);
|
|
458
557
|
}
|
|
558
|
+
if (isDef(scopeId) && elm['s-si'] !== scopeId) {
|
|
559
|
+
// if there is a scopeId and this is the initial render
|
|
560
|
+
// then let's add the scopeId as a css class
|
|
561
|
+
elm.classList.add((elm['s-si'] = scopeId));
|
|
562
|
+
}
|
|
459
563
|
if (newVNode.$children$) {
|
|
460
564
|
for (i = 0; i < newVNode.$children$.length; ++i) {
|
|
461
565
|
// create the node
|
|
462
|
-
childNode = createElm(oldParentVNode, newVNode, i);
|
|
566
|
+
childNode = createElm(oldParentVNode, newVNode, i, elm);
|
|
463
567
|
// return node could have been null
|
|
464
568
|
if (childNode) {
|
|
465
569
|
// append our new node
|
|
@@ -543,9 +647,12 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
543
647
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
544
648
|
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
545
649
|
let childNode;
|
|
650
|
+
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
651
|
+
containerElm = containerElm.shadowRoot;
|
|
652
|
+
}
|
|
546
653
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
547
654
|
if (vnodes[startIdx]) {
|
|
548
|
-
childNode = createElm(null, parentVNode, startIdx);
|
|
655
|
+
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
|
549
656
|
if (childNode) {
|
|
550
657
|
vnodes[startIdx].$elm$ = childNode;
|
|
551
658
|
containerElm.insertBefore(childNode, referenceNode(before) );
|
|
@@ -796,7 +903,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
|
|
|
796
903
|
elmToMove = oldCh[idxInOld];
|
|
797
904
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
798
905
|
// the tag doesn't match so we'll need a new DOM element
|
|
799
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
906
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
|
|
800
907
|
}
|
|
801
908
|
else {
|
|
802
909
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
@@ -812,7 +919,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
|
|
|
812
919
|
// the key of the first new child OR the build is not using `key`
|
|
813
920
|
// attributes at all. In either case we need to create a new element
|
|
814
921
|
// for the new node.
|
|
815
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
922
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
|
|
816
923
|
newStartVnode = newCh[++newStartIdx];
|
|
817
924
|
}
|
|
818
925
|
if (node) {
|
|
@@ -1165,7 +1272,10 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1165
1272
|
rootVnode.$tag$ = null;
|
|
1166
1273
|
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
1167
1274
|
hostRef.$vnode$ = rootVnode;
|
|
1168
|
-
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm);
|
|
1275
|
+
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
1276
|
+
{
|
|
1277
|
+
scopeId = hostElm['s-sc'];
|
|
1278
|
+
}
|
|
1169
1279
|
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
1170
1280
|
{
|
|
1171
1281
|
contentRef = hostElm['s-cr'];
|
|
@@ -1215,6 +1325,11 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1215
1325
|
let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
|
|
1216
1326
|
if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
|
|
1217
1327
|
refNode = refNode.nextSibling;
|
|
1328
|
+
// If the refNode is the same node to be relocated or another element's slot reference, keep searching to find the
|
|
1329
|
+
// correct relocation target
|
|
1330
|
+
while (refNode === nodeToRelocate || (refNode === null || refNode === void 0 ? void 0 : refNode['s-sr'])) {
|
|
1331
|
+
refNode = refNode === null || refNode === void 0 ? void 0 : refNode.nextSibling;
|
|
1332
|
+
}
|
|
1218
1333
|
if (!refNode || !refNode['s-nr']) {
|
|
1219
1334
|
insertBeforeNode = refNode;
|
|
1220
1335
|
break;
|
|
@@ -1320,6 +1435,16 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1320
1435
|
// 2. If all functions added to the queue are asynchronous they'll all be
|
|
1321
1436
|
// called in order after `dispatchHooks` exits.
|
|
1322
1437
|
let maybePromise;
|
|
1438
|
+
if (isInitialLoad) {
|
|
1439
|
+
{
|
|
1440
|
+
// If `componentWillLoad` returns a `Promise` then we want to wait on
|
|
1441
|
+
// whatever's going on in that `Promise` before we launch into
|
|
1442
|
+
// rendering the component, doing other lifecycle stuff, etc. So
|
|
1443
|
+
// in that case we assign the returned promise to the variable we
|
|
1444
|
+
// declared above to hold a possible 'queueing' Promise
|
|
1445
|
+
maybePromise = safeCall(instance, 'componentWillLoad');
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1323
1448
|
endSchedule();
|
|
1324
1449
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
1325
1450
|
};
|
|
@@ -1515,6 +1640,7 @@ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propNam
|
|
|
1515
1640
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1516
1641
|
// check our new property value against our internal value
|
|
1517
1642
|
const hostRef = getHostRef(ref);
|
|
1643
|
+
const elm = hostRef.$hostElement$ ;
|
|
1518
1644
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1519
1645
|
const flags = hostRef.$flags$;
|
|
1520
1646
|
const instance = hostRef.$lazyInstance$ ;
|
|
@@ -1527,6 +1653,22 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1527
1653
|
// set our new value!
|
|
1528
1654
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1529
1655
|
if (instance) {
|
|
1656
|
+
// get an array of method names of watch functions to call
|
|
1657
|
+
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1658
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1659
|
+
if (watchMethods) {
|
|
1660
|
+
// this instance is watching for when this property changed
|
|
1661
|
+
watchMethods.map((watchMethodName) => {
|
|
1662
|
+
try {
|
|
1663
|
+
// fire off each of the watch methods that are watching this property
|
|
1664
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
1665
|
+
}
|
|
1666
|
+
catch (e) {
|
|
1667
|
+
consoleError(e, elm);
|
|
1668
|
+
}
|
|
1669
|
+
});
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1530
1672
|
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1531
1673
|
// looks like this value actually changed, so we've got work to do!
|
|
1532
1674
|
// but only if we've already rendered, otherwise just chill out
|
|
@@ -1551,6 +1693,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1551
1693
|
var _a;
|
|
1552
1694
|
const prototype = Cstr.prototype;
|
|
1553
1695
|
if (cmpMeta.$members$) {
|
|
1696
|
+
if (Cstr.watchers) {
|
|
1697
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1698
|
+
}
|
|
1554
1699
|
// It's better to have a const than two Object.entries()
|
|
1555
1700
|
const members = Object.entries(cmpMeta.$members$);
|
|
1556
1701
|
members.map(([memberName, [memberFlags]]) => {
|
|
@@ -1700,6 +1845,12 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1700
1845
|
endLoad();
|
|
1701
1846
|
}
|
|
1702
1847
|
if (!Cstr.isProxied) {
|
|
1848
|
+
// we've never proxied this Constructor before
|
|
1849
|
+
// let's add the getters/setters to its prototype before
|
|
1850
|
+
// the first time we create an instance of the implementation
|
|
1851
|
+
{
|
|
1852
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1853
|
+
}
|
|
1703
1854
|
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
1704
1855
|
Cstr.isProxied = true;
|
|
1705
1856
|
}
|
|
@@ -1723,6 +1874,9 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1723
1874
|
{
|
|
1724
1875
|
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1725
1876
|
}
|
|
1877
|
+
{
|
|
1878
|
+
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1879
|
+
}
|
|
1726
1880
|
endNewInstance();
|
|
1727
1881
|
}
|
|
1728
1882
|
else {
|
|
@@ -1859,6 +2013,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1859
2013
|
let hasSlotRelocation = false;
|
|
1860
2014
|
lazyBundles.map((lazyBundle) => {
|
|
1861
2015
|
lazyBundle[1].map((compactMeta) => {
|
|
2016
|
+
var _a;
|
|
1862
2017
|
const cmpMeta = {
|
|
1863
2018
|
$flags$: compactMeta[0],
|
|
1864
2019
|
$tagName$: compactMeta[1],
|
|
@@ -1876,6 +2031,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1876
2031
|
{
|
|
1877
2032
|
cmpMeta.$attrsToReflect$ = [];
|
|
1878
2033
|
}
|
|
2034
|
+
{
|
|
2035
|
+
cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
|
|
2036
|
+
}
|
|
1879
2037
|
const tagName = cmpMeta.$tagName$;
|
|
1880
2038
|
const HostElement = class extends HTMLElement {
|
|
1881
2039
|
// StencilLazyHost
|
|
@@ -1884,6 +2042,17 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1884
2042
|
super(self);
|
|
1885
2043
|
self = this;
|
|
1886
2044
|
registerHost(self, cmpMeta);
|
|
2045
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
2046
|
+
// this component is using shadow dom
|
|
2047
|
+
// and this browser supports shadow dom
|
|
2048
|
+
// add the read-only property "shadowRoot" to the host element
|
|
2049
|
+
// adding the shadow root build conditionals to minimize runtime
|
|
2050
|
+
{
|
|
2051
|
+
{
|
|
2052
|
+
self.attachShadow({ mode: 'open' });
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
1887
2056
|
}
|
|
1888
2057
|
connectedCallback() {
|
|
1889
2058
|
if (appLoadFallback) {
|
|
@@ -2100,6 +2269,6 @@ const flush = () => {
|
|
|
2100
2269
|
const nextTick = (cb) => promiseResolve().then(cb);
|
|
2101
2270
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
2102
2271
|
|
|
2103
|
-
export { Host as H, bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
2272
|
+
export { Host as H, bootstrapLazy as b, createEvent as c, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
2104
2273
|
|
|
2105
|
-
//# sourceMappingURL=index-
|
|
2274
|
+
//# sourceMappingURL=index-192aeaf1.js.map
|