@paperless/core 0.1.0-alpha.0 → 0.1.0-alpha.13
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/CHANGELOG.md +125 -0
- package/README.md +17 -0
- package/dist/assets/icons/arrow.svg +1 -1
- package/dist/assets/icons/attachment.svg +1 -1
- package/dist/assets/icons/bread.svg +1 -1
- package/dist/assets/icons/calendar.svg +1 -1
- package/dist/assets/icons/car.svg +1 -1
- package/dist/assets/icons/checkmark.svg +1 -1
- package/dist/assets/icons/chevron.svg +1 -1
- package/dist/assets/icons/clock.svg +1 -1
- package/dist/assets/icons/cogs.svg +1 -1
- package/dist/assets/icons/comment.svg +1 -1
- package/dist/assets/icons/document.svg +1 -1
- package/dist/assets/icons/download.svg +1 -1
- package/dist/assets/icons/envelope.svg +1 -1
- package/dist/assets/icons/explanation.svg +1 -1
- package/dist/assets/icons/eye.svg +1 -1
- package/dist/assets/icons/filter.svg +1 -1
- package/dist/assets/icons/grid.svg +1 -1
- package/dist/assets/icons/headset.svg +1 -1
- package/dist/assets/icons/list.svg +1 -1
- package/dist/assets/icons/location.svg +1 -1
- package/dist/assets/icons/megaphone.svg +1 -1
- package/dist/assets/icons/minus.svg +1 -1
- package/dist/assets/icons/negative.svg +1 -1
- package/dist/assets/icons/pagination.svg +1 -1
- package/dist/assets/icons/payment.svg +1 -1
- package/dist/assets/icons/pencil.svg +1 -1
- package/dist/assets/icons/person.svg +1 -1
- package/dist/assets/icons/plus.svg +1 -1
- package/dist/assets/icons/question.svg +1 -1
- package/dist/assets/icons/receipt.svg +1 -1
- package/dist/assets/icons/report.svg +1 -1
- package/dist/assets/icons/search.svg +1 -1
- package/dist/assets/icons/settings.svg +1 -1
- package/dist/assets/icons/sick.svg +1 -1
- package/dist/assets/icons/tachometer.svg +1 -1
- package/dist/assets/icons/tool.svg +1 -1
- package/dist/assets/icons/trash.svg +1 -1
- package/dist/assets/icons/turn.svg +1 -1
- package/dist/assets/icons/upload.svg +1 -1
- package/dist/assets/icons/warning.svg +1 -1
- package/dist/assets/images/avatar/company-default.svg +12 -0
- package/dist/assets/images/avatar/user-default.svg +12 -0
- package/dist/assets/images/helper/helper-hover.svg +15 -0
- package/dist/assets/images/helper/helper.svg +15 -0
- package/dist/build/p-06a38756.entry.js +1 -0
- package/dist/build/p-19afe191.entry.js +1 -0
- package/dist/build/p-229f113b.js +2 -0
- package/dist/{paperless/p-98d636b6.entry.js → build/p-23980fbb.entry.js} +1 -1
- package/dist/build/p-31f80006.entry.js +1 -0
- package/dist/build/p-332028c6.entry.js +1 -0
- package/dist/build/p-5f0ec763.entry.js +1 -0
- package/dist/build/p-6c6c1137.entry.js +1 -0
- package/dist/build/p-80bf9d06.entry.js +1 -0
- package/dist/build/p-e80637b9.entry.js +1 -0
- package/dist/build/p-ec52095f.entry.js +1 -0
- package/dist/build/paperless.css +4 -3
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/{index-6758a39e.js → index-6b6e08cc.js} +487 -9
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/p-avatar.cjs.entry.js +32 -0
- package/dist/cjs/{p-icon.cjs.entry.js → p-button_3.cjs.entry.js} +149 -46
- package/dist/cjs/p-counter.cjs.entry.js +19 -0
- package/dist/cjs/p-divider.cjs.entry.js +19 -0
- package/dist/cjs/p-helper.cjs.entry.js +19 -0
- package/dist/cjs/p-illustration.cjs.entry.js +11 -14
- package/dist/cjs/p-info-panel.cjs.entry.js +31 -0
- package/dist/cjs/p-pagination-item.cjs.entry.js +23 -0
- package/dist/cjs/p-pagination.cjs.entry.js +163 -0
- package/dist/cjs/p-tooltip.cjs.entry.js +62 -20
- package/dist/cjs/paperless.cjs.js +2 -2
- package/dist/collection/assets/icons/arrow.svg +1 -1
- package/dist/collection/assets/icons/attachment.svg +1 -1
- package/dist/collection/assets/icons/bread.svg +1 -1
- package/dist/collection/assets/icons/calendar.svg +1 -1
- package/dist/collection/assets/icons/car.svg +1 -1
- package/dist/collection/assets/icons/checkmark.svg +1 -1
- package/dist/collection/assets/icons/chevron.svg +1 -1
- package/dist/collection/assets/icons/clock.svg +1 -1
- package/dist/collection/assets/icons/cogs.svg +1 -1
- package/dist/collection/assets/icons/comment.svg +1 -1
- package/dist/collection/assets/icons/document.svg +1 -1
- package/dist/collection/assets/icons/download.svg +1 -1
- package/dist/collection/assets/icons/envelope.svg +1 -1
- package/dist/collection/assets/icons/explanation.svg +1 -1
- package/dist/collection/assets/icons/eye.svg +1 -1
- package/dist/collection/assets/icons/filter.svg +1 -1
- package/dist/collection/assets/icons/grid.svg +1 -1
- package/dist/collection/assets/icons/headset.svg +1 -1
- package/dist/collection/assets/icons/list.svg +1 -1
- package/dist/collection/assets/icons/location.svg +1 -1
- package/dist/collection/assets/icons/megaphone.svg +1 -1
- package/dist/collection/assets/icons/minus.svg +1 -1
- package/dist/collection/assets/icons/negative.svg +1 -1
- package/dist/collection/assets/icons/pagination.svg +1 -1
- package/dist/collection/assets/icons/payment.svg +1 -1
- package/dist/collection/assets/icons/pencil.svg +1 -1
- package/dist/collection/assets/icons/person.svg +1 -1
- package/dist/collection/assets/icons/plus.svg +1 -1
- package/dist/collection/assets/icons/question.svg +1 -1
- package/dist/collection/assets/icons/receipt.svg +1 -1
- package/dist/collection/assets/icons/report.svg +1 -1
- package/dist/collection/assets/icons/search.svg +1 -1
- package/dist/collection/assets/icons/settings.svg +1 -1
- package/dist/collection/assets/icons/sick.svg +1 -1
- package/dist/collection/assets/icons/tachometer.svg +1 -1
- package/dist/collection/assets/icons/tool.svg +1 -1
- package/dist/collection/assets/icons/trash.svg +1 -1
- package/dist/collection/assets/icons/turn.svg +1 -1
- package/dist/collection/assets/icons/upload.svg +1 -1
- package/dist/collection/assets/icons/warning.svg +1 -1
- package/dist/collection/assets/images/avatar/company-default.svg +12 -0
- package/dist/collection/assets/images/avatar/user-default.svg +12 -0
- package/dist/collection/assets/images/helper/helper-hover.svg +15 -0
- package/dist/collection/assets/images/helper/helper.svg +15 -0
- package/dist/collection/collection-manifest.json +12 -4
- package/dist/collection/components/atoms/avatar/avatar.component.css +31 -0
- package/dist/collection/components/atoms/avatar/avatar.component.js +105 -0
- package/dist/collection/components/atoms/button/button.component.css +71 -0
- package/dist/collection/components/atoms/button/button.component.js +276 -0
- package/dist/collection/components/atoms/counter/counter.component.css +5 -0
- package/dist/collection/components/atoms/counter/counter.component.js +15 -0
- package/dist/collection/components/atoms/divider/divider.component.css +3 -0
- package/dist/collection/components/atoms/divider/divider.component.js +14 -0
- package/dist/collection/components/atoms/helper/helper.component.css +7 -0
- package/dist/collection/components/atoms/helper/helper.component.js +18 -0
- package/dist/collection/components/{icon → atoms/icon}/icon.component.js +10 -11
- package/dist/collection/components/{illustration → atoms/illustration}/illustration.component.js +4 -11
- package/dist/collection/components/atoms/info-panel/info-panel.component.css +28 -0
- package/dist/collection/components/atoms/info-panel/info-panel.component.js +106 -0
- package/dist/collection/components/atoms/loader/loader.component.css +26 -0
- package/dist/collection/components/atoms/loader/loader.component.js +153 -0
- package/dist/collection/components/atoms/pagination-item/pagination-item.component.css +16 -0
- package/dist/collection/components/atoms/pagination-item/pagination-item.component.js +41 -0
- package/dist/collection/components/atoms/tooltip/tooltip.component.css +37 -0
- package/dist/collection/components/{tooltip → atoms/tooltip}/tooltip.component.js +122 -32
- package/dist/collection/components/molecules/pagination/pagination.component.css +3 -0
- package/dist/collection/components/molecules/pagination/pagination.component.js +219 -0
- package/dist/collection/tailwind/border-radius.js +1 -0
- package/dist/collection/tailwind/grid.js +24 -4
- package/dist/collection/tailwind/rotate.js +8 -0
- package/dist/collection/tailwind/scale.js +3 -0
- package/dist/collection/tailwind.config.js +6 -7
- package/dist/{esm/p-icon.entry.js → components/icon.component.js} +67 -52
- package/dist/components/index.d.ts +9 -1
- package/dist/components/index.js +8 -0
- package/dist/components/loader.component.js +74 -0
- package/dist/components/p-avatar.d.ts +11 -0
- package/dist/components/p-avatar.js +52 -0
- package/dist/components/p-button.js +67 -8
- package/dist/components/p-counter.d.ts +11 -0
- package/dist/components/p-counter.js +33 -0
- package/dist/components/p-divider.d.ts +11 -0
- package/dist/components/p-divider.js +33 -0
- package/dist/components/p-helper.d.ts +11 -0
- package/dist/components/p-helper.js +39 -0
- package/dist/components/p-icon.js +1 -815
- package/dist/components/p-illustration.js +3 -7
- package/dist/components/p-info-panel.d.ts +11 -0
- package/dist/components/p-info-panel.js +56 -0
- package/dist/components/p-loader.d.ts +11 -0
- package/dist/components/p-loader.js +6 -0
- package/dist/components/p-pagination-item.d.ts +11 -0
- package/dist/components/p-pagination-item.js +6 -0
- package/dist/components/p-pagination.d.ts +11 -0
- package/dist/components/p-pagination.js +192 -0
- package/dist/components/p-tooltip.js +1 -1886
- package/dist/components/pagination-item.component.js +36 -0
- package/dist/components/tooltip.component.js +1932 -0
- package/dist/esm/{index-e4d80e41.js → index-5c917d13.js} +487 -10
- package/dist/esm/loader.js +2 -2
- package/dist/esm/p-avatar.entry.js +28 -0
- package/dist/esm/p-button_3.entry.js +899 -0
- package/dist/esm/p-counter.entry.js +15 -0
- package/dist/esm/p-divider.entry.js +15 -0
- package/dist/esm/p-helper.entry.js +15 -0
- package/dist/esm/p-illustration.entry.js +11 -14
- package/dist/esm/p-info-panel.entry.js +27 -0
- package/dist/esm/p-pagination-item.entry.js +19 -0
- package/dist/esm/p-pagination.entry.js +159 -0
- package/dist/esm/p-tooltip.entry.js +62 -20
- package/dist/esm/paperless.js +2 -2
- package/dist/index.html +1 -1
- package/dist/paperless/p-06a38756.entry.js +1 -0
- package/dist/paperless/p-19afe191.entry.js +1 -0
- package/dist/paperless/p-229f113b.js +2 -0
- package/dist/{build/p-98d636b6.entry.js → paperless/p-23980fbb.entry.js} +1 -1
- package/dist/paperless/p-31f80006.entry.js +1 -0
- package/dist/paperless/p-332028c6.entry.js +1 -0
- package/dist/paperless/p-5f0ec763.entry.js +1 -0
- package/dist/paperless/p-6c6c1137.entry.js +1 -0
- package/dist/paperless/p-80bf9d06.entry.js +1 -0
- package/dist/paperless/p-e80637b9.entry.js +1 -0
- package/dist/paperless/p-ec52095f.entry.js +1 -0
- package/dist/paperless/paperless.css +3843 -201
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +245 -49
- package/dist/tailwind.config.js +6 -7
- package/dist/types/components/atoms/avatar/avatar.component.d.ts +21 -0
- package/dist/types/components/atoms/button/button.component.d.ts +51 -0
- package/dist/types/components/atoms/counter/counter.component.d.ts +3 -0
- package/dist/types/components/atoms/divider/divider.component.d.ts +3 -0
- package/dist/types/components/atoms/helper/helper.component.d.ts +3 -0
- package/dist/types/components/{icon → atoms/icon}/icon.component.d.ts +3 -2
- package/dist/types/components/{illustration → atoms/illustration}/illustration.component.d.ts +2 -2
- package/dist/types/components/atoms/info-panel/info-panel.component.d.ts +24 -0
- package/dist/types/components/atoms/loader/loader.component.d.ts +30 -0
- package/dist/types/components/atoms/pagination-item/pagination-item.component.d.ts +7 -0
- package/dist/types/components/atoms/tooltip/tooltip.component.d.ts +40 -0
- package/dist/types/components/molecules/pagination/pagination.component.d.ts +31 -0
- package/dist/types/components.d.ts +358 -20
- package/package.json +3 -2
- package/dist/build/p-3318b73b.entry.js +0 -1
- package/dist/build/p-6f9229a6.js +0 -2
- package/dist/build/p-711630fb.entry.js +0 -1
- package/dist/build/p-c3d80205.entry.js +0 -1
- package/dist/cjs/p-button.cjs.entry.js +0 -23
- package/dist/collection/components/button/button.component.css +0 -6
- package/dist/collection/components/button/button.component.js +0 -42
- package/dist/collection/components/tooltip/tooltip.component.css +0 -34
- package/dist/esm/p-button.entry.js +0 -19
- package/dist/paperless/p-3318b73b.entry.js +0 -1
- package/dist/paperless/p-6f9229a6.js +0 -2
- package/dist/paperless/p-711630fb.entry.js +0 -1
- package/dist/paperless/p-c3d80205.entry.js +0 -1
- package/dist/types/components/button/button.component.d.ts +0 -7
- package/dist/types/components/tooltip/tooltip.component.d.ts +0 -28
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Component, Element, h, Host, Prop } from '@stencil/core';
|
|
2
|
+
export class InfoPanel {
|
|
3
|
+
constructor() {
|
|
4
|
+
/**
|
|
5
|
+
* The variant of the info panel
|
|
6
|
+
*/
|
|
7
|
+
this.variant = 'info';
|
|
8
|
+
/**
|
|
9
|
+
* Wether the panel can be closed
|
|
10
|
+
*/
|
|
11
|
+
this.closeable = false;
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (h(Host, { class: `p-info-panel variant-${this.variant} ${this.closeable && 'has-close'}` },
|
|
15
|
+
h("div", { class: "header" },
|
|
16
|
+
h("slot", { name: "header" })),
|
|
17
|
+
h("div", { class: "content" },
|
|
18
|
+
h("slot", { name: "content" })),
|
|
19
|
+
this.closeable && (h("div", { class: "close", onClick: () => this._close() },
|
|
20
|
+
h("p-icon", { variant: "negative" })))));
|
|
21
|
+
}
|
|
22
|
+
_close() {
|
|
23
|
+
this._el.remove();
|
|
24
|
+
}
|
|
25
|
+
static get is() { return "p-info-panel"; }
|
|
26
|
+
static get encapsulation() { return "shadow"; }
|
|
27
|
+
static get originalStyleUrls() { return {
|
|
28
|
+
"$": ["info-panel.component.scss"]
|
|
29
|
+
}; }
|
|
30
|
+
static get styleUrls() { return {
|
|
31
|
+
"$": ["info-panel.component.css"]
|
|
32
|
+
}; }
|
|
33
|
+
static get properties() { return {
|
|
34
|
+
"variant": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"mutable": false,
|
|
37
|
+
"complexType": {
|
|
38
|
+
"original": "'info' | 'negative' | 'positive' | 'unbiased'",
|
|
39
|
+
"resolved": "\"info\" | \"negative\" | \"positive\" | \"unbiased\"",
|
|
40
|
+
"references": {}
|
|
41
|
+
},
|
|
42
|
+
"required": false,
|
|
43
|
+
"optional": false,
|
|
44
|
+
"docs": {
|
|
45
|
+
"tags": [],
|
|
46
|
+
"text": "The variant of the info panel"
|
|
47
|
+
},
|
|
48
|
+
"attribute": "variant",
|
|
49
|
+
"reflect": false,
|
|
50
|
+
"defaultValue": "'info'"
|
|
51
|
+
},
|
|
52
|
+
"header": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"mutable": false,
|
|
55
|
+
"complexType": {
|
|
56
|
+
"original": "string",
|
|
57
|
+
"resolved": "string",
|
|
58
|
+
"references": {}
|
|
59
|
+
},
|
|
60
|
+
"required": false,
|
|
61
|
+
"optional": false,
|
|
62
|
+
"docs": {
|
|
63
|
+
"tags": [],
|
|
64
|
+
"text": "The header of the info panel"
|
|
65
|
+
},
|
|
66
|
+
"attribute": "header",
|
|
67
|
+
"reflect": false
|
|
68
|
+
},
|
|
69
|
+
"content": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"mutable": false,
|
|
72
|
+
"complexType": {
|
|
73
|
+
"original": "string",
|
|
74
|
+
"resolved": "string",
|
|
75
|
+
"references": {}
|
|
76
|
+
},
|
|
77
|
+
"required": false,
|
|
78
|
+
"optional": false,
|
|
79
|
+
"docs": {
|
|
80
|
+
"tags": [],
|
|
81
|
+
"text": "The content of the info panel"
|
|
82
|
+
},
|
|
83
|
+
"attribute": "content",
|
|
84
|
+
"reflect": false
|
|
85
|
+
},
|
|
86
|
+
"closeable": {
|
|
87
|
+
"type": "boolean",
|
|
88
|
+
"mutable": false,
|
|
89
|
+
"complexType": {
|
|
90
|
+
"original": "boolean",
|
|
91
|
+
"resolved": "boolean",
|
|
92
|
+
"references": {}
|
|
93
|
+
},
|
|
94
|
+
"required": false,
|
|
95
|
+
"optional": false,
|
|
96
|
+
"docs": {
|
|
97
|
+
"tags": [],
|
|
98
|
+
"text": "Wether the panel can be closed"
|
|
99
|
+
},
|
|
100
|
+
"attribute": "closeable",
|
|
101
|
+
"reflect": false,
|
|
102
|
+
"defaultValue": "false"
|
|
103
|
+
}
|
|
104
|
+
}; }
|
|
105
|
+
static get elementRef() { return "_el"; }
|
|
106
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
:host .loader {
|
|
2
|
+
@apply w-[1em] h-[1em] inline-block rounded-round;
|
|
3
|
+
@apply animate-spin duration-500;
|
|
4
|
+
@apply border-solid border-2 border-indigo-light border-t-indigo !important;
|
|
5
|
+
}
|
|
6
|
+
:host .loader.color-storm {
|
|
7
|
+
@apply border-storm-light/40 border-t-storm !important;
|
|
8
|
+
}
|
|
9
|
+
:host .loader.color-white {
|
|
10
|
+
@apply border-indigo-light/40 border-t-white !important;
|
|
11
|
+
}
|
|
12
|
+
:host .loading-screen {
|
|
13
|
+
@apply fixed top-0 left-0 w-screen h-screen;
|
|
14
|
+
@apply flex items-center justify-center;
|
|
15
|
+
@apply bg-mystic;
|
|
16
|
+
z-index: 9999;
|
|
17
|
+
}
|
|
18
|
+
:host .loading-screen .content {
|
|
19
|
+
@apply max-w-xs;
|
|
20
|
+
}
|
|
21
|
+
:host .loading-screen .content .loader-wrapper {
|
|
22
|
+
@apply w-full flex justify-center;
|
|
23
|
+
}
|
|
24
|
+
:host .loading-screen .content .loader-wrapper .loader {
|
|
25
|
+
@apply text-4xl;
|
|
26
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { Component, h, Host, Prop } from '@stencil/core';
|
|
2
|
+
export class Loader {
|
|
3
|
+
constructor() {
|
|
4
|
+
/**
|
|
5
|
+
* Wether to show or hide the loader
|
|
6
|
+
*/
|
|
7
|
+
this.show = true;
|
|
8
|
+
/**
|
|
9
|
+
* Variant of loader
|
|
10
|
+
*/
|
|
11
|
+
this.variant = 'inline';
|
|
12
|
+
/**
|
|
13
|
+
* Color of the loader
|
|
14
|
+
*/
|
|
15
|
+
this.color = 'indigo';
|
|
16
|
+
this._show = this.show;
|
|
17
|
+
this._loader = (h("div", { class: `loader color-${this.color}` }));
|
|
18
|
+
}
|
|
19
|
+
componentWillRender() {
|
|
20
|
+
this._checkShow();
|
|
21
|
+
}
|
|
22
|
+
componentShouldUpdate() {
|
|
23
|
+
this._checkShow();
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
if (!this._show) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (this.variant === 'full-screen') {
|
|
30
|
+
return (h(Host, { class: "p-loader" },
|
|
31
|
+
h("div", { class: "loading-screen" },
|
|
32
|
+
h("div", { class: "content" },
|
|
33
|
+
h("slot", null),
|
|
34
|
+
h("div", { class: "loader-wrapper" }, this._loader)))));
|
|
35
|
+
}
|
|
36
|
+
return h(Host, { class: `p-loader flex ${this.variant === 'full-width' && 'w-100 d-block flex justify-center text-4xl'}` }, this._loader);
|
|
37
|
+
}
|
|
38
|
+
_checkShow() {
|
|
39
|
+
var _a;
|
|
40
|
+
if (this._showSubscriber) {
|
|
41
|
+
this._showSubscriber.unsubscribe();
|
|
42
|
+
this._showSubscriber = null;
|
|
43
|
+
}
|
|
44
|
+
if (typeof this.show !== 'boolean') {
|
|
45
|
+
this._showSubscriber = (_a = this.show) === null || _a === void 0 ? void 0 : _a.subscribe(show => (this._show = show));
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this._show = this.show;
|
|
49
|
+
}
|
|
50
|
+
static get is() { return "p-loader"; }
|
|
51
|
+
static get encapsulation() { return "shadow"; }
|
|
52
|
+
static get originalStyleUrls() { return {
|
|
53
|
+
"$": ["loader.component.scss"]
|
|
54
|
+
}; }
|
|
55
|
+
static get styleUrls() { return {
|
|
56
|
+
"$": ["loader.component.css"]
|
|
57
|
+
}; }
|
|
58
|
+
static get properties() { return {
|
|
59
|
+
"show": {
|
|
60
|
+
"type": "boolean",
|
|
61
|
+
"mutable": false,
|
|
62
|
+
"complexType": {
|
|
63
|
+
"original": "boolean | Observable<boolean>",
|
|
64
|
+
"resolved": "Observable<boolean> | boolean",
|
|
65
|
+
"references": {
|
|
66
|
+
"Observable": {
|
|
67
|
+
"location": "import",
|
|
68
|
+
"path": "rxjs"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"required": false,
|
|
73
|
+
"optional": false,
|
|
74
|
+
"docs": {
|
|
75
|
+
"tags": [],
|
|
76
|
+
"text": "Wether to show or hide the loader"
|
|
77
|
+
},
|
|
78
|
+
"attribute": "show",
|
|
79
|
+
"reflect": false,
|
|
80
|
+
"defaultValue": "true"
|
|
81
|
+
},
|
|
82
|
+
"variant": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"mutable": false,
|
|
85
|
+
"complexType": {
|
|
86
|
+
"original": "'inline' | 'full-width' | 'full-screen' | 'modal'",
|
|
87
|
+
"resolved": "\"full-screen\" | \"full-width\" | \"inline\" | \"modal\"",
|
|
88
|
+
"references": {}
|
|
89
|
+
},
|
|
90
|
+
"required": false,
|
|
91
|
+
"optional": false,
|
|
92
|
+
"docs": {
|
|
93
|
+
"tags": [],
|
|
94
|
+
"text": "Variant of loader"
|
|
95
|
+
},
|
|
96
|
+
"attribute": "variant",
|
|
97
|
+
"reflect": false,
|
|
98
|
+
"defaultValue": "'inline'"
|
|
99
|
+
},
|
|
100
|
+
"color": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"mutable": false,
|
|
103
|
+
"complexType": {
|
|
104
|
+
"original": "'indigo' | 'white' | 'storm'",
|
|
105
|
+
"resolved": "\"indigo\" | \"storm\" | \"white\"",
|
|
106
|
+
"references": {}
|
|
107
|
+
},
|
|
108
|
+
"required": false,
|
|
109
|
+
"optional": false,
|
|
110
|
+
"docs": {
|
|
111
|
+
"tags": [],
|
|
112
|
+
"text": "Color of the loader"
|
|
113
|
+
},
|
|
114
|
+
"attribute": "color",
|
|
115
|
+
"reflect": false,
|
|
116
|
+
"defaultValue": "'indigo'"
|
|
117
|
+
},
|
|
118
|
+
"modalTitle": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"mutable": false,
|
|
121
|
+
"complexType": {
|
|
122
|
+
"original": "string",
|
|
123
|
+
"resolved": "string",
|
|
124
|
+
"references": {}
|
|
125
|
+
},
|
|
126
|
+
"required": false,
|
|
127
|
+
"optional": false,
|
|
128
|
+
"docs": {
|
|
129
|
+
"tags": [],
|
|
130
|
+
"text": "!NOT IMPLEMENTED! Modal title for modal variant"
|
|
131
|
+
},
|
|
132
|
+
"attribute": "modal-title",
|
|
133
|
+
"reflect": false
|
|
134
|
+
},
|
|
135
|
+
"modalDescription": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"mutable": false,
|
|
138
|
+
"complexType": {
|
|
139
|
+
"original": "string",
|
|
140
|
+
"resolved": "string",
|
|
141
|
+
"references": {}
|
|
142
|
+
},
|
|
143
|
+
"required": false,
|
|
144
|
+
"optional": false,
|
|
145
|
+
"docs": {
|
|
146
|
+
"tags": [],
|
|
147
|
+
"text": "!NOT IMPLEMENTED! Modal description for modal variant"
|
|
148
|
+
},
|
|
149
|
+
"attribute": "modal-description",
|
|
150
|
+
"reflect": false
|
|
151
|
+
}
|
|
152
|
+
}; }
|
|
153
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
@apply h-8 w-8;
|
|
3
|
+
@apply flex justify-center items-center;
|
|
4
|
+
@apply font-semibold text-storm-medium text-sm;
|
|
5
|
+
@apply rounded;
|
|
6
|
+
@apply cursor-pointer;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host(:hover),
|
|
10
|
+
:host(:focus) {
|
|
11
|
+
@apply text-storm;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host(.active) {
|
|
15
|
+
@apply text-indigo bg-indigo-light;
|
|
16
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Component, h, Host, Prop } from '@stencil/core';
|
|
2
|
+
export class PaginationItem {
|
|
3
|
+
constructor() {
|
|
4
|
+
/**
|
|
5
|
+
* Wether the pagination item is active
|
|
6
|
+
*/
|
|
7
|
+
this.active = false;
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return (h(Host, { class: `p-pagination-item ${this.active && 'active'}` },
|
|
11
|
+
h("slot", null)));
|
|
12
|
+
}
|
|
13
|
+
static get is() { return "p-pagination-item"; }
|
|
14
|
+
static get encapsulation() { return "shadow"; }
|
|
15
|
+
static get originalStyleUrls() { return {
|
|
16
|
+
"$": ["pagination-item.component.scss"]
|
|
17
|
+
}; }
|
|
18
|
+
static get styleUrls() { return {
|
|
19
|
+
"$": ["pagination-item.component.css"]
|
|
20
|
+
}; }
|
|
21
|
+
static get properties() { return {
|
|
22
|
+
"active": {
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"mutable": false,
|
|
25
|
+
"complexType": {
|
|
26
|
+
"original": "boolean",
|
|
27
|
+
"resolved": "boolean",
|
|
28
|
+
"references": {}
|
|
29
|
+
},
|
|
30
|
+
"required": false,
|
|
31
|
+
"optional": false,
|
|
32
|
+
"docs": {
|
|
33
|
+
"tags": [],
|
|
34
|
+
"text": "Wether the pagination item is active"
|
|
35
|
+
},
|
|
36
|
+
"attribute": "active",
|
|
37
|
+
"reflect": false,
|
|
38
|
+
"defaultValue": "false"
|
|
39
|
+
}
|
|
40
|
+
}; }
|
|
41
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
@apply cursor-pointer inline-block;
|
|
3
|
+
}
|
|
4
|
+
:host .popover {
|
|
5
|
+
@apply bg-white hidden text-xs font-medium py-2 px-3 rounded drop-shadow-4;
|
|
6
|
+
max-width: 14.5rem;
|
|
7
|
+
}
|
|
8
|
+
:host .popover.variant-hover {
|
|
9
|
+
@apply bg-storm text-white py-1;
|
|
10
|
+
}
|
|
11
|
+
:host .popover[data-show] {
|
|
12
|
+
@apply block;
|
|
13
|
+
}
|
|
14
|
+
:host .popover .arrow,
|
|
15
|
+
:host .popover .arrow::before {
|
|
16
|
+
background: inherit;
|
|
17
|
+
@apply absolute w-2 h-2;
|
|
18
|
+
}
|
|
19
|
+
:host .popover .arrow {
|
|
20
|
+
visibility: hidden;
|
|
21
|
+
}
|
|
22
|
+
:host .popover .arrow::before {
|
|
23
|
+
@apply visible transform rotate-45;
|
|
24
|
+
content: "";
|
|
25
|
+
}
|
|
26
|
+
:host .popover[data-popper-placement^=top] > .arrow {
|
|
27
|
+
@apply -bottom-1;
|
|
28
|
+
}
|
|
29
|
+
:host .popover[data-popper-placement^=bottom] > .arrow {
|
|
30
|
+
@apply -top-1;
|
|
31
|
+
}
|
|
32
|
+
:host .popover[data-popper-placement^=left] > .arrow {
|
|
33
|
+
@apply -right-1;
|
|
34
|
+
}
|
|
35
|
+
:host .popover[data-popper-placement^=right] > .arrow {
|
|
36
|
+
@apply -left-1;
|
|
37
|
+
}
|
|
@@ -3,60 +3,102 @@ import { Component, Element, h, Host, Listen, Prop } from '@stencil/core';
|
|
|
3
3
|
export class Tooltip {
|
|
4
4
|
constructor() {
|
|
5
5
|
/**
|
|
6
|
-
* The
|
|
6
|
+
* The variant of the popover
|
|
7
7
|
*/
|
|
8
|
-
this.
|
|
8
|
+
this.variant = 'hover';
|
|
9
9
|
/**
|
|
10
|
-
* The content of the
|
|
10
|
+
* The content of the popover
|
|
11
|
+
*/
|
|
12
|
+
this.popover = null;
|
|
13
|
+
/**
|
|
14
|
+
* The content of the popover
|
|
11
15
|
*/
|
|
12
16
|
this.placement = 'top';
|
|
13
17
|
/**
|
|
14
|
-
* Wether to
|
|
18
|
+
* Wether to show the popover
|
|
19
|
+
*/
|
|
20
|
+
this.show = false;
|
|
21
|
+
/**
|
|
22
|
+
* Wether to someone can manually close the popover
|
|
15
23
|
*/
|
|
16
|
-
this.
|
|
24
|
+
this.canManuallyClose = true;
|
|
17
25
|
this._loaded = false;
|
|
18
26
|
}
|
|
19
27
|
componentShouldUpdate() {
|
|
20
28
|
this._setOptions();
|
|
21
|
-
if (this.
|
|
29
|
+
if (this._loaded && this.show) {
|
|
22
30
|
this._show();
|
|
23
31
|
}
|
|
24
32
|
}
|
|
25
33
|
render() {
|
|
26
|
-
return (h(Host,
|
|
27
|
-
h("slot",
|
|
28
|
-
h("div", { class:
|
|
29
|
-
this.
|
|
34
|
+
return (h(Host, { class: "p-popover" },
|
|
35
|
+
h("slot", { name: "content" }),
|
|
36
|
+
h("div", { class: `popover variant-${this.variant}`, role: "popover", ref: el => this._load(el) },
|
|
37
|
+
this.popover ? this.popover : h("slot", { name: "popover" }),
|
|
30
38
|
h("div", { class: "arrow", "data-popper-arrow": true }))));
|
|
31
39
|
}
|
|
40
|
+
clickHandler() {
|
|
41
|
+
if (this.variant === 'hover') {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (this._popover.hasAttribute('data-show')) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (!this._popover.hasAttribute('data-show')) {
|
|
48
|
+
this._show();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
documentClickHandler() {
|
|
52
|
+
if (this.variant === 'hover' || !this.canManuallyClose) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (!this._popover.hasAttribute('data-show')) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (this._popover.hasAttribute('data-show')) {
|
|
59
|
+
this._hide();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
mouseEnterHandler() {
|
|
63
|
+
if (this.variant === 'click') {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
this._show();
|
|
67
|
+
}
|
|
68
|
+
mouseLeaveHandler() {
|
|
69
|
+
if (this.show || this.variant === 'click') {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this._hide();
|
|
73
|
+
}
|
|
32
74
|
_show() {
|
|
33
75
|
if (!this._loaded) {
|
|
34
76
|
return;
|
|
35
77
|
}
|
|
36
|
-
// Make the
|
|
37
|
-
this.
|
|
78
|
+
// Make the popover visible
|
|
79
|
+
this._popover.setAttribute('data-show', '');
|
|
38
80
|
// Enable the event listeners
|
|
39
81
|
this._popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }] })));
|
|
40
82
|
// Update its position
|
|
41
83
|
this._popper.update();
|
|
42
84
|
}
|
|
43
85
|
_hide() {
|
|
44
|
-
if (!this._loaded
|
|
86
|
+
if (!this._loaded) {
|
|
45
87
|
return;
|
|
46
88
|
}
|
|
47
|
-
// Hide the
|
|
48
|
-
this.
|
|
89
|
+
// Hide the popover
|
|
90
|
+
this._popover.removeAttribute('data-show');
|
|
49
91
|
// Disable the event listeners
|
|
50
92
|
this._popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }] })));
|
|
51
93
|
}
|
|
52
|
-
_load(
|
|
53
|
-
this.
|
|
54
|
-
if (
|
|
55
|
-
this._popper = createPopper(this._el,
|
|
94
|
+
_load(popover) {
|
|
95
|
+
this._popover = popover;
|
|
96
|
+
if (popover) {
|
|
97
|
+
this._popper = createPopper(this._el, popover);
|
|
56
98
|
this._setOptions();
|
|
57
99
|
this._loaded = true;
|
|
58
|
-
if (this.
|
|
59
|
-
this._show();
|
|
100
|
+
if (this.show) {
|
|
101
|
+
setTimeout(() => this._show(), 100);
|
|
60
102
|
}
|
|
61
103
|
}
|
|
62
104
|
}
|
|
@@ -85,7 +127,25 @@ export class Tooltip {
|
|
|
85
127
|
"$": ["tooltip.component.css"]
|
|
86
128
|
}; }
|
|
87
129
|
static get properties() { return {
|
|
88
|
-
"
|
|
130
|
+
"variant": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"mutable": false,
|
|
133
|
+
"complexType": {
|
|
134
|
+
"original": "'hover' | 'click'",
|
|
135
|
+
"resolved": "\"click\" | \"hover\"",
|
|
136
|
+
"references": {}
|
|
137
|
+
},
|
|
138
|
+
"required": false,
|
|
139
|
+
"optional": false,
|
|
140
|
+
"docs": {
|
|
141
|
+
"tags": [],
|
|
142
|
+
"text": "The variant of the popover"
|
|
143
|
+
},
|
|
144
|
+
"attribute": "variant",
|
|
145
|
+
"reflect": false,
|
|
146
|
+
"defaultValue": "'hover'"
|
|
147
|
+
},
|
|
148
|
+
"popover": {
|
|
89
149
|
"type": "any",
|
|
90
150
|
"mutable": false,
|
|
91
151
|
"complexType": {
|
|
@@ -97,9 +157,9 @@ export class Tooltip {
|
|
|
97
157
|
"optional": false,
|
|
98
158
|
"docs": {
|
|
99
159
|
"tags": [],
|
|
100
|
-
"text": "The content of the
|
|
160
|
+
"text": "The content of the popover"
|
|
101
161
|
},
|
|
102
|
-
"attribute": "
|
|
162
|
+
"attribute": "popover",
|
|
103
163
|
"reflect": false,
|
|
104
164
|
"defaultValue": "null"
|
|
105
165
|
},
|
|
@@ -120,13 +180,13 @@ export class Tooltip {
|
|
|
120
180
|
"optional": false,
|
|
121
181
|
"docs": {
|
|
122
182
|
"tags": [],
|
|
123
|
-
"text": "The content of the
|
|
183
|
+
"text": "The content of the popover"
|
|
124
184
|
},
|
|
125
185
|
"attribute": "placement",
|
|
126
186
|
"reflect": false,
|
|
127
187
|
"defaultValue": "'top'"
|
|
128
188
|
},
|
|
129
|
-
"
|
|
189
|
+
"show": {
|
|
130
190
|
"type": "boolean",
|
|
131
191
|
"mutable": false,
|
|
132
192
|
"complexType": {
|
|
@@ -138,35 +198,65 @@ export class Tooltip {
|
|
|
138
198
|
"optional": false,
|
|
139
199
|
"docs": {
|
|
140
200
|
"tags": [],
|
|
141
|
-
"text": "Wether to
|
|
201
|
+
"text": "Wether to show the popover"
|
|
142
202
|
},
|
|
143
|
-
"attribute": "
|
|
203
|
+
"attribute": "show",
|
|
144
204
|
"reflect": false,
|
|
145
205
|
"defaultValue": "false"
|
|
206
|
+
},
|
|
207
|
+
"canManuallyClose": {
|
|
208
|
+
"type": "boolean",
|
|
209
|
+
"mutable": false,
|
|
210
|
+
"complexType": {
|
|
211
|
+
"original": "boolean",
|
|
212
|
+
"resolved": "boolean",
|
|
213
|
+
"references": {}
|
|
214
|
+
},
|
|
215
|
+
"required": false,
|
|
216
|
+
"optional": false,
|
|
217
|
+
"docs": {
|
|
218
|
+
"tags": [],
|
|
219
|
+
"text": "Wether to someone can manually close the popover"
|
|
220
|
+
},
|
|
221
|
+
"attribute": "can-manually-close",
|
|
222
|
+
"reflect": false,
|
|
223
|
+
"defaultValue": "true"
|
|
146
224
|
}
|
|
147
225
|
}; }
|
|
148
226
|
static get elementRef() { return "_el"; }
|
|
149
227
|
static get listeners() { return [{
|
|
228
|
+
"name": "click",
|
|
229
|
+
"method": "clickHandler",
|
|
230
|
+
"target": undefined,
|
|
231
|
+
"capture": true,
|
|
232
|
+
"passive": false
|
|
233
|
+
}, {
|
|
234
|
+
"name": "click",
|
|
235
|
+
"method": "documentClickHandler",
|
|
236
|
+
"target": "document",
|
|
237
|
+
"capture": true,
|
|
238
|
+
"passive": false
|
|
239
|
+
}, {
|
|
150
240
|
"name": "mouseenter",
|
|
151
|
-
"method": "
|
|
241
|
+
"method": "mouseEnterHandler",
|
|
152
242
|
"target": undefined,
|
|
153
243
|
"capture": false,
|
|
154
244
|
"passive": true
|
|
155
245
|
}, {
|
|
156
246
|
"name": "focus",
|
|
157
|
-
"method": "
|
|
247
|
+
"method": "mouseEnterHandler",
|
|
158
248
|
"target": undefined,
|
|
159
249
|
"capture": false,
|
|
160
250
|
"passive": false
|
|
161
251
|
}, {
|
|
162
252
|
"name": "mouseleave",
|
|
163
|
-
"method": "
|
|
253
|
+
"method": "mouseLeaveHandler",
|
|
164
254
|
"target": undefined,
|
|
165
255
|
"capture": false,
|
|
166
256
|
"passive": true
|
|
167
257
|
}, {
|
|
168
258
|
"name": "blur",
|
|
169
|
-
"method": "
|
|
259
|
+
"method": "mouseLeaveHandler",
|
|
170
260
|
"target": undefined,
|
|
171
261
|
"capture": false,
|
|
172
262
|
"passive": false
|