@paperless/core 0.0.3-alpha.4 → 0.1.0-alpha.2
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 +75 -0
- package/README.md +14 -10
- package/dist/assets/icons/arrow.svg +2 -2
- package/dist/assets/icons/attachment.svg +2 -2
- package/dist/assets/icons/bread.svg +2 -2
- package/dist/assets/icons/calendar.svg +2 -2
- package/dist/assets/icons/car.svg +2 -2
- package/dist/assets/icons/checkmark.svg +2 -2
- package/dist/assets/icons/chevron.svg +2 -2
- package/dist/assets/icons/clock.svg +2 -2
- package/dist/assets/icons/cogs.svg +2 -2
- package/dist/assets/icons/comment.svg +2 -2
- package/dist/assets/icons/document.svg +2 -2
- package/dist/assets/icons/download.svg +2 -2
- package/dist/assets/icons/envelope.svg +2 -2
- package/dist/assets/icons/explanation.svg +2 -2
- package/dist/assets/icons/eye.svg +2 -2
- package/dist/assets/icons/filter.svg +2 -2
- package/dist/assets/icons/grid.svg +2 -2
- package/dist/assets/icons/headset.svg +2 -2
- package/dist/assets/icons/list.svg +2 -2
- package/dist/assets/icons/location.svg +2 -2
- package/dist/assets/icons/megaphone.svg +2 -2
- package/dist/assets/icons/minus.svg +2 -2
- package/dist/assets/icons/negative.svg +2 -2
- package/dist/assets/icons/pagination.svg +2 -2
- package/dist/assets/icons/payment.svg +2 -2
- package/dist/assets/icons/pencil.svg +2 -2
- package/dist/assets/icons/person.svg +2 -2
- package/dist/assets/icons/plus.svg +2 -2
- package/dist/assets/icons/question.svg +2 -2
- package/dist/assets/icons/receipt.svg +2 -2
- package/dist/assets/icons/report.svg +2 -2
- package/dist/assets/icons/search.svg +2 -2
- package/dist/assets/icons/settings.svg +2 -2
- package/dist/assets/icons/sick.svg +2 -2
- package/dist/assets/icons/tachometer.svg +2 -2
- package/dist/assets/icons/tool.svg +2 -2
- package/dist/assets/icons/trash.svg +2 -2
- package/dist/assets/icons/turn.svg +2 -2
- package/dist/assets/icons/upload.svg +2 -2
- package/dist/assets/icons/warning.svg +2 -2
- package/dist/build/p-1d13a9d2.entry.js +1 -0
- package/dist/build/p-208c1f28.entry.js +1 -0
- package/dist/build/p-98d07776.js +2 -0
- package/dist/build/p-bbd1d3df.entry.js +1 -0
- package/dist/build/p-cd525dcc.entry.js +1 -0
- package/dist/build/p-feec8ec1.entry.js +1 -0
- package/dist/build/paperless.css +21 -10
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/{index-e3e940d8.js → index-5b30cb95.js} +158 -7
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/p-button.cjs.entry.js +4 -4
- package/dist/cjs/p-icon.cjs.entry.js +802 -0
- package/dist/cjs/p-illustration.cjs.entry.js +1426 -0
- package/dist/cjs/p-loader.cjs.entry.js +57 -0
- package/dist/cjs/p-tooltip.cjs.entry.js +1873 -0
- package/dist/cjs/paperless.cjs.js +2 -2
- package/dist/collection/assets/icons/arrow.svg +2 -2
- package/dist/collection/assets/icons/attachment.svg +2 -2
- package/dist/collection/assets/icons/bread.svg +2 -2
- package/dist/collection/assets/icons/calendar.svg +2 -2
- package/dist/collection/assets/icons/car.svg +2 -2
- package/dist/collection/assets/icons/checkmark.svg +2 -2
- package/dist/collection/assets/icons/chevron.svg +2 -2
- package/dist/collection/assets/icons/clock.svg +2 -2
- package/dist/collection/assets/icons/cogs.svg +2 -2
- package/dist/collection/assets/icons/comment.svg +2 -2
- package/dist/collection/assets/icons/document.svg +2 -2
- package/dist/collection/assets/icons/download.svg +2 -2
- package/dist/collection/assets/icons/envelope.svg +2 -2
- package/dist/collection/assets/icons/explanation.svg +2 -2
- package/dist/collection/assets/icons/eye.svg +2 -2
- package/dist/collection/assets/icons/filter.svg +2 -2
- package/dist/collection/assets/icons/grid.svg +2 -2
- package/dist/collection/assets/icons/headset.svg +2 -2
- package/dist/collection/assets/icons/list.svg +2 -2
- package/dist/collection/assets/icons/location.svg +2 -2
- package/dist/collection/assets/icons/megaphone.svg +2 -2
- package/dist/collection/assets/icons/minus.svg +2 -2
- package/dist/collection/assets/icons/negative.svg +2 -2
- package/dist/collection/assets/icons/pagination.svg +2 -2
- package/dist/collection/assets/icons/payment.svg +2 -2
- package/dist/collection/assets/icons/pencil.svg +2 -2
- package/dist/collection/assets/icons/person.svg +2 -2
- package/dist/collection/assets/icons/plus.svg +2 -2
- package/dist/collection/assets/icons/question.svg +2 -2
- package/dist/collection/assets/icons/receipt.svg +2 -2
- package/dist/collection/assets/icons/report.svg +2 -2
- package/dist/collection/assets/icons/search.svg +2 -2
- package/dist/collection/assets/icons/settings.svg +2 -2
- package/dist/collection/assets/icons/sick.svg +2 -2
- package/dist/collection/assets/icons/tachometer.svg +2 -2
- package/dist/collection/assets/icons/tool.svg +2 -2
- package/dist/collection/assets/icons/trash.svg +2 -2
- package/dist/collection/assets/icons/turn.svg +2 -2
- package/dist/collection/assets/icons/upload.svg +2 -2
- package/dist/collection/assets/icons/warning.svg +2 -2
- package/dist/collection/collection-manifest.json +5 -1
- package/dist/collection/components/{button → atoms/button}/button.component.css +0 -0
- package/dist/collection/components/{button → atoms/button}/button.component.js +6 -5
- package/dist/collection/components/atoms/icon/icon.component.js +112 -0
- package/dist/collection/components/atoms/illustration/illustration.component.js +39 -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/tooltip/tooltip.component.css +34 -0
- package/dist/collection/components/atoms/tooltip/tooltip.component.js +174 -0
- package/dist/collection/tailwind/border-radius.js +1 -0
- package/dist/collection/tailwind/grid.js +6 -0
- package/dist/collection/tailwind/rotate.js +8 -0
- package/dist/collection/tailwind/scale.js +3 -0
- package/dist/collection/tailwind.config.js +9 -0
- package/dist/collection/utils/icons.js +82 -0
- package/dist/collection/utils/illustrations.js +18 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +4 -0
- package/dist/components/p-button.js +4 -4
- package/dist/components/p-icon.d.ts +11 -0
- package/dist/components/p-icon.js +820 -0
- package/dist/components/p-illustration.d.ts +11 -0
- package/dist/components/p-illustration.js +1441 -0
- package/dist/components/p-loader.d.ts +11 -0
- package/dist/components/p-loader.js +77 -0
- package/dist/components/p-tooltip.d.ts +11 -0
- package/dist/components/p-tooltip.js +1891 -0
- package/dist/esm/{index-100a5ae6.js → index-111a6307.js} +157 -8
- package/dist/esm/loader.js +2 -2
- package/dist/esm/p-button.entry.js +4 -4
- package/dist/esm/p-icon.entry.js +798 -0
- package/dist/esm/p-illustration.entry.js +1422 -0
- package/dist/esm/p-loader.entry.js +53 -0
- package/dist/esm/p-tooltip.entry.js +1869 -0
- package/dist/esm/paperless.js +2 -2
- package/dist/index.html +1 -1
- package/dist/paperless/p-1d13a9d2.entry.js +1 -0
- package/dist/paperless/p-208c1f28.entry.js +1 -0
- package/dist/paperless/p-98d07776.js +2 -0
- package/dist/paperless/p-bbd1d3df.entry.js +1 -0
- package/dist/paperless/p-cd525dcc.entry.js +1 -0
- package/dist/paperless/p-feec8ec1.entry.js +1 -0
- package/dist/paperless/paperless.css +26928 -13
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +136 -23
- package/dist/tailwind.config.js +9 -0
- package/dist/types/components/{button → atoms/button}/button.component.d.ts +1 -1
- package/dist/types/components/atoms/icon/icon.component.d.ts +23 -0
- package/dist/types/components/atoms/illustration/illustration.component.d.ts +9 -0
- package/dist/types/components/atoms/loader/loader.component.d.ts +30 -0
- package/dist/types/components/atoms/tooltip/tooltip.component.d.ts +28 -0
- package/dist/types/components.d.ts +162 -2
- package/dist/types/utils/icons.d.ts +43 -0
- package/dist/types/utils/illustrations.d.ts +11 -0
- package/package.json +8 -3
- package/dist/build/p-54459ae1.js +0 -2
- package/dist/build/p-c66e9743.entry.js +0 -1
- package/dist/paperless/p-54459ae1.js +0 -2
- package/dist/paperless/p-c66e9743.entry.js +0 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Component, h, Prop } from '@stencil/core';
|
|
1
|
+
import { Component, h, Host, Prop } from '@stencil/core';
|
|
2
2
|
export class Button {
|
|
3
3
|
constructor() {
|
|
4
4
|
/**
|
|
5
|
-
* The
|
|
5
|
+
* The variant of the button
|
|
6
6
|
*/
|
|
7
7
|
this.variant = 'primary';
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(
|
|
11
|
-
h("
|
|
10
|
+
return (h(Host, null,
|
|
11
|
+
h("button", { class: `variant-${this.variant}` },
|
|
12
|
+
h("slot", null))));
|
|
12
13
|
}
|
|
13
14
|
static get is() { return "p-button"; }
|
|
14
15
|
static get encapsulation() { return "shadow"; }
|
|
@@ -31,7 +32,7 @@ export class Button {
|
|
|
31
32
|
"optional": false,
|
|
32
33
|
"docs": {
|
|
33
34
|
"tags": [],
|
|
34
|
-
"text": "The
|
|
35
|
+
"text": "The variant of the button"
|
|
35
36
|
},
|
|
36
37
|
"attribute": "variant",
|
|
37
38
|
"reflect": false,
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Component, h, Host, Prop } from '@stencil/core';
|
|
2
|
+
import icons from '../../../utils/icons';
|
|
3
|
+
export class Icon {
|
|
4
|
+
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* The icon the be displayed
|
|
7
|
+
*/
|
|
8
|
+
this.variant = null;
|
|
9
|
+
/**
|
|
10
|
+
* The size of the icon, using tailwind sizes
|
|
11
|
+
*/
|
|
12
|
+
this.size = 'auto';
|
|
13
|
+
/**
|
|
14
|
+
* Wether to rotate the icon x degrees
|
|
15
|
+
*/
|
|
16
|
+
this.rotate = null;
|
|
17
|
+
/**
|
|
18
|
+
* Wether to flip the icon horizontally or vertically
|
|
19
|
+
*/
|
|
20
|
+
this.flip = null;
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
const icon = icons[this.variant];
|
|
24
|
+
return h(Host, { class: this._getClass(), innerHTML: icon });
|
|
25
|
+
}
|
|
26
|
+
_getClass() {
|
|
27
|
+
return `p-icon inline-block text-${this.size} ${this.rotate || this.flip ? 'transform' : ''} ${this.rotate ? `${this.rotate < 0 ? '-' : ''}rotate-${this.rotate < 0 ? this.rotate * -1 : this.rotate}` : ''} ${this.flip ? `scale-${this.flip === 'horizontal' ? 'x' : 'y'}-flip` : ''}`;
|
|
28
|
+
}
|
|
29
|
+
static get is() { return "p-icon"; }
|
|
30
|
+
static get properties() { return {
|
|
31
|
+
"variant": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"mutable": false,
|
|
34
|
+
"complexType": {
|
|
35
|
+
"original": "IconVariant",
|
|
36
|
+
"resolved": "\"arrow\" | \"attachment\" | \"bread\" | \"calendar\" | \"car\" | \"checkmark\" | \"chevron\" | \"clock\" | \"cogs\" | \"comment\" | \"document\" | \"download\" | \"envelope\" | \"explanation\" | \"eye\" | \"filter\" | \"grid\" | \"headset\" | \"list\" | \"location\" | \"megaphone\" | \"minus\" | \"negative\" | \"pagination\" | \"payment\" | \"pencil\" | \"person\" | \"plus\" | \"question\" | \"receipt\" | \"report\" | \"search\" | \"settings\" | \"sick\" | \"tachometer\" | \"tool\" | \"trash\" | \"turn\" | \"upload\" | \"warning\"",
|
|
37
|
+
"references": {
|
|
38
|
+
"IconVariant": {
|
|
39
|
+
"location": "local"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"required": false,
|
|
44
|
+
"optional": false,
|
|
45
|
+
"docs": {
|
|
46
|
+
"tags": [],
|
|
47
|
+
"text": "The icon the be displayed"
|
|
48
|
+
},
|
|
49
|
+
"attribute": "variant",
|
|
50
|
+
"reflect": false,
|
|
51
|
+
"defaultValue": "null"
|
|
52
|
+
},
|
|
53
|
+
"size": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"mutable": false,
|
|
56
|
+
"complexType": {
|
|
57
|
+
"original": "string",
|
|
58
|
+
"resolved": "string",
|
|
59
|
+
"references": {}
|
|
60
|
+
},
|
|
61
|
+
"required": false,
|
|
62
|
+
"optional": false,
|
|
63
|
+
"docs": {
|
|
64
|
+
"tags": [],
|
|
65
|
+
"text": "The size of the icon, using tailwind sizes"
|
|
66
|
+
},
|
|
67
|
+
"attribute": "size",
|
|
68
|
+
"reflect": false,
|
|
69
|
+
"defaultValue": "'auto'"
|
|
70
|
+
},
|
|
71
|
+
"rotate": {
|
|
72
|
+
"type": "number",
|
|
73
|
+
"mutable": false,
|
|
74
|
+
"complexType": {
|
|
75
|
+
"original": "number",
|
|
76
|
+
"resolved": "number",
|
|
77
|
+
"references": {}
|
|
78
|
+
},
|
|
79
|
+
"required": false,
|
|
80
|
+
"optional": false,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [],
|
|
83
|
+
"text": "Wether to rotate the icon x degrees"
|
|
84
|
+
},
|
|
85
|
+
"attribute": "rotate",
|
|
86
|
+
"reflect": false,
|
|
87
|
+
"defaultValue": "null"
|
|
88
|
+
},
|
|
89
|
+
"flip": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"mutable": false,
|
|
92
|
+
"complexType": {
|
|
93
|
+
"original": "IconFlipOptions",
|
|
94
|
+
"resolved": "\"horizontal\" | \"vertical\"",
|
|
95
|
+
"references": {
|
|
96
|
+
"IconFlipOptions": {
|
|
97
|
+
"location": "local"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"required": false,
|
|
102
|
+
"optional": false,
|
|
103
|
+
"docs": {
|
|
104
|
+
"tags": [],
|
|
105
|
+
"text": "Wether to flip the icon horizontally or vertically"
|
|
106
|
+
},
|
|
107
|
+
"attribute": "flip",
|
|
108
|
+
"reflect": false,
|
|
109
|
+
"defaultValue": "null"
|
|
110
|
+
}
|
|
111
|
+
}; }
|
|
112
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Component, h, Host, Prop } from '@stencil/core';
|
|
2
|
+
import illustrations from '../../../utils/illustrations';
|
|
3
|
+
export class Illustration {
|
|
4
|
+
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* The icon the be displayed
|
|
7
|
+
*/
|
|
8
|
+
this.variant = null;
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
const illustration = illustrations[this.variant];
|
|
12
|
+
return h(Host, { class: "p-illustration block", innerHTML: illustration });
|
|
13
|
+
}
|
|
14
|
+
static get is() { return "p-illustration"; }
|
|
15
|
+
static get properties() { return {
|
|
16
|
+
"variant": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"mutable": false,
|
|
19
|
+
"complexType": {
|
|
20
|
+
"original": "IllustrationVariant",
|
|
21
|
+
"resolved": "\"departments\" | \"empty-state\" | \"expenses\" | \"functions\" | \"questions\" | \"sick-leave\" | \"time-off\" | \"upgrade-to-hr\"",
|
|
22
|
+
"references": {
|
|
23
|
+
"IllustrationVariant": {
|
|
24
|
+
"location": "local"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"required": false,
|
|
29
|
+
"optional": false,
|
|
30
|
+
"docs": {
|
|
31
|
+
"tags": [],
|
|
32
|
+
"text": "The icon the be displayed"
|
|
33
|
+
},
|
|
34
|
+
"attribute": "variant",
|
|
35
|
+
"reflect": false,
|
|
36
|
+
"defaultValue": "null"
|
|
37
|
+
}
|
|
38
|
+
}; }
|
|
39
|
+
}
|
|
@@ -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 ${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,34 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
@apply cursor-pointer;
|
|
3
|
+
}
|
|
4
|
+
:host .tooltip {
|
|
5
|
+
@apply bg-storm hidden text-xs font-medium text-white py-1 px-3 rounded drop-shadow-1;
|
|
6
|
+
max-width: 14.5rem;
|
|
7
|
+
}
|
|
8
|
+
:host .tooltip[data-show] {
|
|
9
|
+
@apply block;
|
|
10
|
+
}
|
|
11
|
+
:host .tooltip .arrow,
|
|
12
|
+
:host .tooltip .arrow::before {
|
|
13
|
+
background: inherit;
|
|
14
|
+
@apply absolute w-2 h-2;
|
|
15
|
+
}
|
|
16
|
+
:host .tooltip .arrow {
|
|
17
|
+
visibility: hidden;
|
|
18
|
+
}
|
|
19
|
+
:host .tooltip .arrow::before {
|
|
20
|
+
@apply visible transform rotate-45;
|
|
21
|
+
content: "";
|
|
22
|
+
}
|
|
23
|
+
:host .tooltip[data-popper-placement^=top] > .arrow {
|
|
24
|
+
@apply -bottom-1;
|
|
25
|
+
}
|
|
26
|
+
:host .tooltip[data-popper-placement^=bottom] > .arrow {
|
|
27
|
+
@apply -top-1;
|
|
28
|
+
}
|
|
29
|
+
:host .tooltip[data-popper-placement^=left] > .arrow {
|
|
30
|
+
@apply -right-1;
|
|
31
|
+
}
|
|
32
|
+
:host .tooltip[data-popper-placement^=right] > .arrow {
|
|
33
|
+
@apply -left-1;
|
|
34
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { createPopper } from '@popperjs/core';
|
|
2
|
+
import { Component, Element, h, Host, Listen, Prop } from '@stencil/core';
|
|
3
|
+
export class Tooltip {
|
|
4
|
+
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* The content of the tooltip
|
|
7
|
+
*/
|
|
8
|
+
this.content = null;
|
|
9
|
+
/**
|
|
10
|
+
* The content of the tooltip
|
|
11
|
+
*/
|
|
12
|
+
this.placement = 'top';
|
|
13
|
+
/**
|
|
14
|
+
* Wether to force show the tooltip
|
|
15
|
+
*/
|
|
16
|
+
this.forceShow = false;
|
|
17
|
+
this._loaded = false;
|
|
18
|
+
}
|
|
19
|
+
componentShouldUpdate() {
|
|
20
|
+
this._setOptions();
|
|
21
|
+
if (this.forceShow) {
|
|
22
|
+
this._show();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
return (h(Host, { class: "p-tooltip" },
|
|
27
|
+
h("slot", null),
|
|
28
|
+
h("div", { class: "tooltip", role: "tooltip", ref: el => this._load(el) },
|
|
29
|
+
this.content,
|
|
30
|
+
h("div", { class: "arrow", "data-popper-arrow": true }))));
|
|
31
|
+
}
|
|
32
|
+
_show() {
|
|
33
|
+
if (!this._loaded) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// Make the tooltip visible
|
|
37
|
+
this._tooltip.setAttribute('data-show', '');
|
|
38
|
+
// Enable the event listeners
|
|
39
|
+
this._popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }] })));
|
|
40
|
+
// Update its position
|
|
41
|
+
this._popper.update();
|
|
42
|
+
}
|
|
43
|
+
_hide() {
|
|
44
|
+
if (!this._loaded && !this.forceShow) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
// Hide the tooltip
|
|
48
|
+
this._tooltip.removeAttribute('data-show');
|
|
49
|
+
// Disable the event listeners
|
|
50
|
+
this._popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }] })));
|
|
51
|
+
}
|
|
52
|
+
_load(tooltip) {
|
|
53
|
+
this._tooltip = tooltip;
|
|
54
|
+
if (tooltip) {
|
|
55
|
+
this._popper = createPopper(this._el, tooltip);
|
|
56
|
+
this._setOptions();
|
|
57
|
+
this._loaded = true;
|
|
58
|
+
if (this.forceShow) {
|
|
59
|
+
this._show();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
_setOptions() {
|
|
64
|
+
if (!this._popper) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this._popper.setOptions({
|
|
68
|
+
placement: this.placement,
|
|
69
|
+
modifiers: [
|
|
70
|
+
{
|
|
71
|
+
name: 'offset',
|
|
72
|
+
options: {
|
|
73
|
+
offset: [0, 8],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
static get is() { return "p-tooltip"; }
|
|
80
|
+
static get encapsulation() { return "shadow"; }
|
|
81
|
+
static get originalStyleUrls() { return {
|
|
82
|
+
"$": ["tooltip.component.scss"]
|
|
83
|
+
}; }
|
|
84
|
+
static get styleUrls() { return {
|
|
85
|
+
"$": ["tooltip.component.css"]
|
|
86
|
+
}; }
|
|
87
|
+
static get properties() { return {
|
|
88
|
+
"content": {
|
|
89
|
+
"type": "any",
|
|
90
|
+
"mutable": false,
|
|
91
|
+
"complexType": {
|
|
92
|
+
"original": "any",
|
|
93
|
+
"resolved": "any",
|
|
94
|
+
"references": {}
|
|
95
|
+
},
|
|
96
|
+
"required": false,
|
|
97
|
+
"optional": false,
|
|
98
|
+
"docs": {
|
|
99
|
+
"tags": [],
|
|
100
|
+
"text": "The content of the tooltip"
|
|
101
|
+
},
|
|
102
|
+
"attribute": "content",
|
|
103
|
+
"reflect": false,
|
|
104
|
+
"defaultValue": "null"
|
|
105
|
+
},
|
|
106
|
+
"placement": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"mutable": false,
|
|
109
|
+
"complexType": {
|
|
110
|
+
"original": "Placement",
|
|
111
|
+
"resolved": "\"auto\" | \"auto-end\" | \"auto-start\" | \"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
|
|
112
|
+
"references": {
|
|
113
|
+
"Placement": {
|
|
114
|
+
"location": "import",
|
|
115
|
+
"path": "@popperjs/core"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"required": false,
|
|
120
|
+
"optional": false,
|
|
121
|
+
"docs": {
|
|
122
|
+
"tags": [],
|
|
123
|
+
"text": "The content of the tooltip"
|
|
124
|
+
},
|
|
125
|
+
"attribute": "placement",
|
|
126
|
+
"reflect": false,
|
|
127
|
+
"defaultValue": "'top'"
|
|
128
|
+
},
|
|
129
|
+
"forceShow": {
|
|
130
|
+
"type": "boolean",
|
|
131
|
+
"mutable": false,
|
|
132
|
+
"complexType": {
|
|
133
|
+
"original": "boolean",
|
|
134
|
+
"resolved": "boolean",
|
|
135
|
+
"references": {}
|
|
136
|
+
},
|
|
137
|
+
"required": false,
|
|
138
|
+
"optional": false,
|
|
139
|
+
"docs": {
|
|
140
|
+
"tags": [],
|
|
141
|
+
"text": "Wether to force show the tooltip"
|
|
142
|
+
},
|
|
143
|
+
"attribute": "force-show",
|
|
144
|
+
"reflect": false,
|
|
145
|
+
"defaultValue": "false"
|
|
146
|
+
}
|
|
147
|
+
}; }
|
|
148
|
+
static get elementRef() { return "_el"; }
|
|
149
|
+
static get listeners() { return [{
|
|
150
|
+
"name": "mouseenter",
|
|
151
|
+
"method": "_show",
|
|
152
|
+
"target": undefined,
|
|
153
|
+
"capture": false,
|
|
154
|
+
"passive": true
|
|
155
|
+
}, {
|
|
156
|
+
"name": "focus",
|
|
157
|
+
"method": "_show",
|
|
158
|
+
"target": undefined,
|
|
159
|
+
"capture": false,
|
|
160
|
+
"passive": false
|
|
161
|
+
}, {
|
|
162
|
+
"name": "mouseleave",
|
|
163
|
+
"method": "_hide",
|
|
164
|
+
"target": undefined,
|
|
165
|
+
"capture": false,
|
|
166
|
+
"passive": true
|
|
167
|
+
}, {
|
|
168
|
+
"name": "blur",
|
|
169
|
+
"method": "_hide",
|
|
170
|
+
"target": undefined,
|
|
171
|
+
"capture": false,
|
|
172
|
+
"passive": false
|
|
173
|
+
}]; }
|
|
174
|
+
}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
const colors = require('./tailwind/colors');
|
|
2
2
|
const shadows = require('./tailwind/shadows');
|
|
3
3
|
const borderRadius = require('./tailwind/border-radius');
|
|
4
|
+
const grid = require('./tailwind/grid');
|
|
5
|
+
const scale = require('./tailwind/scale');
|
|
6
|
+
const rotate = require('./tailwind/rotate');
|
|
4
7
|
|
|
5
8
|
module.exports = {
|
|
9
|
+
important: true,
|
|
6
10
|
theme: {
|
|
7
11
|
colors,
|
|
8
12
|
boxShadow: shadows,
|
|
9
13
|
dropShadow: shadows,
|
|
10
14
|
borderRadius,
|
|
15
|
+
extend: {
|
|
16
|
+
grid,
|
|
17
|
+
scale,
|
|
18
|
+
rotate,
|
|
19
|
+
},
|
|
11
20
|
},
|
|
12
21
|
variants: {},
|
|
13
22
|
plugins: [require('@tailwindcss/aspect-ratio')],
|