@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.
Files changed (228) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/README.md +17 -0
  3. package/dist/assets/icons/arrow.svg +1 -1
  4. package/dist/assets/icons/attachment.svg +1 -1
  5. package/dist/assets/icons/bread.svg +1 -1
  6. package/dist/assets/icons/calendar.svg +1 -1
  7. package/dist/assets/icons/car.svg +1 -1
  8. package/dist/assets/icons/checkmark.svg +1 -1
  9. package/dist/assets/icons/chevron.svg +1 -1
  10. package/dist/assets/icons/clock.svg +1 -1
  11. package/dist/assets/icons/cogs.svg +1 -1
  12. package/dist/assets/icons/comment.svg +1 -1
  13. package/dist/assets/icons/document.svg +1 -1
  14. package/dist/assets/icons/download.svg +1 -1
  15. package/dist/assets/icons/envelope.svg +1 -1
  16. package/dist/assets/icons/explanation.svg +1 -1
  17. package/dist/assets/icons/eye.svg +1 -1
  18. package/dist/assets/icons/filter.svg +1 -1
  19. package/dist/assets/icons/grid.svg +1 -1
  20. package/dist/assets/icons/headset.svg +1 -1
  21. package/dist/assets/icons/list.svg +1 -1
  22. package/dist/assets/icons/location.svg +1 -1
  23. package/dist/assets/icons/megaphone.svg +1 -1
  24. package/dist/assets/icons/minus.svg +1 -1
  25. package/dist/assets/icons/negative.svg +1 -1
  26. package/dist/assets/icons/pagination.svg +1 -1
  27. package/dist/assets/icons/payment.svg +1 -1
  28. package/dist/assets/icons/pencil.svg +1 -1
  29. package/dist/assets/icons/person.svg +1 -1
  30. package/dist/assets/icons/plus.svg +1 -1
  31. package/dist/assets/icons/question.svg +1 -1
  32. package/dist/assets/icons/receipt.svg +1 -1
  33. package/dist/assets/icons/report.svg +1 -1
  34. package/dist/assets/icons/search.svg +1 -1
  35. package/dist/assets/icons/settings.svg +1 -1
  36. package/dist/assets/icons/sick.svg +1 -1
  37. package/dist/assets/icons/tachometer.svg +1 -1
  38. package/dist/assets/icons/tool.svg +1 -1
  39. package/dist/assets/icons/trash.svg +1 -1
  40. package/dist/assets/icons/turn.svg +1 -1
  41. package/dist/assets/icons/upload.svg +1 -1
  42. package/dist/assets/icons/warning.svg +1 -1
  43. package/dist/assets/images/avatar/company-default.svg +12 -0
  44. package/dist/assets/images/avatar/user-default.svg +12 -0
  45. package/dist/assets/images/helper/helper-hover.svg +15 -0
  46. package/dist/assets/images/helper/helper.svg +15 -0
  47. package/dist/build/p-06a38756.entry.js +1 -0
  48. package/dist/build/p-19afe191.entry.js +1 -0
  49. package/dist/build/p-229f113b.js +2 -0
  50. package/dist/{paperless/p-98d636b6.entry.js → build/p-23980fbb.entry.js} +1 -1
  51. package/dist/build/p-31f80006.entry.js +1 -0
  52. package/dist/build/p-332028c6.entry.js +1 -0
  53. package/dist/build/p-5f0ec763.entry.js +1 -0
  54. package/dist/build/p-6c6c1137.entry.js +1 -0
  55. package/dist/build/p-80bf9d06.entry.js +1 -0
  56. package/dist/build/p-e80637b9.entry.js +1 -0
  57. package/dist/build/p-ec52095f.entry.js +1 -0
  58. package/dist/build/paperless.css +4 -3
  59. package/dist/build/paperless.esm.js +1 -1
  60. package/dist/cjs/{index-6758a39e.js → index-6b6e08cc.js} +487 -9
  61. package/dist/cjs/loader.cjs.js +2 -2
  62. package/dist/cjs/p-avatar.cjs.entry.js +32 -0
  63. package/dist/cjs/{p-icon.cjs.entry.js → p-button_3.cjs.entry.js} +149 -46
  64. package/dist/cjs/p-counter.cjs.entry.js +19 -0
  65. package/dist/cjs/p-divider.cjs.entry.js +19 -0
  66. package/dist/cjs/p-helper.cjs.entry.js +19 -0
  67. package/dist/cjs/p-illustration.cjs.entry.js +11 -14
  68. package/dist/cjs/p-info-panel.cjs.entry.js +31 -0
  69. package/dist/cjs/p-pagination-item.cjs.entry.js +23 -0
  70. package/dist/cjs/p-pagination.cjs.entry.js +163 -0
  71. package/dist/cjs/p-tooltip.cjs.entry.js +62 -20
  72. package/dist/cjs/paperless.cjs.js +2 -2
  73. package/dist/collection/assets/icons/arrow.svg +1 -1
  74. package/dist/collection/assets/icons/attachment.svg +1 -1
  75. package/dist/collection/assets/icons/bread.svg +1 -1
  76. package/dist/collection/assets/icons/calendar.svg +1 -1
  77. package/dist/collection/assets/icons/car.svg +1 -1
  78. package/dist/collection/assets/icons/checkmark.svg +1 -1
  79. package/dist/collection/assets/icons/chevron.svg +1 -1
  80. package/dist/collection/assets/icons/clock.svg +1 -1
  81. package/dist/collection/assets/icons/cogs.svg +1 -1
  82. package/dist/collection/assets/icons/comment.svg +1 -1
  83. package/dist/collection/assets/icons/document.svg +1 -1
  84. package/dist/collection/assets/icons/download.svg +1 -1
  85. package/dist/collection/assets/icons/envelope.svg +1 -1
  86. package/dist/collection/assets/icons/explanation.svg +1 -1
  87. package/dist/collection/assets/icons/eye.svg +1 -1
  88. package/dist/collection/assets/icons/filter.svg +1 -1
  89. package/dist/collection/assets/icons/grid.svg +1 -1
  90. package/dist/collection/assets/icons/headset.svg +1 -1
  91. package/dist/collection/assets/icons/list.svg +1 -1
  92. package/dist/collection/assets/icons/location.svg +1 -1
  93. package/dist/collection/assets/icons/megaphone.svg +1 -1
  94. package/dist/collection/assets/icons/minus.svg +1 -1
  95. package/dist/collection/assets/icons/negative.svg +1 -1
  96. package/dist/collection/assets/icons/pagination.svg +1 -1
  97. package/dist/collection/assets/icons/payment.svg +1 -1
  98. package/dist/collection/assets/icons/pencil.svg +1 -1
  99. package/dist/collection/assets/icons/person.svg +1 -1
  100. package/dist/collection/assets/icons/plus.svg +1 -1
  101. package/dist/collection/assets/icons/question.svg +1 -1
  102. package/dist/collection/assets/icons/receipt.svg +1 -1
  103. package/dist/collection/assets/icons/report.svg +1 -1
  104. package/dist/collection/assets/icons/search.svg +1 -1
  105. package/dist/collection/assets/icons/settings.svg +1 -1
  106. package/dist/collection/assets/icons/sick.svg +1 -1
  107. package/dist/collection/assets/icons/tachometer.svg +1 -1
  108. package/dist/collection/assets/icons/tool.svg +1 -1
  109. package/dist/collection/assets/icons/trash.svg +1 -1
  110. package/dist/collection/assets/icons/turn.svg +1 -1
  111. package/dist/collection/assets/icons/upload.svg +1 -1
  112. package/dist/collection/assets/icons/warning.svg +1 -1
  113. package/dist/collection/assets/images/avatar/company-default.svg +12 -0
  114. package/dist/collection/assets/images/avatar/user-default.svg +12 -0
  115. package/dist/collection/assets/images/helper/helper-hover.svg +15 -0
  116. package/dist/collection/assets/images/helper/helper.svg +15 -0
  117. package/dist/collection/collection-manifest.json +12 -4
  118. package/dist/collection/components/atoms/avatar/avatar.component.css +31 -0
  119. package/dist/collection/components/atoms/avatar/avatar.component.js +105 -0
  120. package/dist/collection/components/atoms/button/button.component.css +71 -0
  121. package/dist/collection/components/atoms/button/button.component.js +276 -0
  122. package/dist/collection/components/atoms/counter/counter.component.css +5 -0
  123. package/dist/collection/components/atoms/counter/counter.component.js +15 -0
  124. package/dist/collection/components/atoms/divider/divider.component.css +3 -0
  125. package/dist/collection/components/atoms/divider/divider.component.js +14 -0
  126. package/dist/collection/components/atoms/helper/helper.component.css +7 -0
  127. package/dist/collection/components/atoms/helper/helper.component.js +18 -0
  128. package/dist/collection/components/{icon → atoms/icon}/icon.component.js +10 -11
  129. package/dist/collection/components/{illustration → atoms/illustration}/illustration.component.js +4 -11
  130. package/dist/collection/components/atoms/info-panel/info-panel.component.css +28 -0
  131. package/dist/collection/components/atoms/info-panel/info-panel.component.js +106 -0
  132. package/dist/collection/components/atoms/loader/loader.component.css +26 -0
  133. package/dist/collection/components/atoms/loader/loader.component.js +153 -0
  134. package/dist/collection/components/atoms/pagination-item/pagination-item.component.css +16 -0
  135. package/dist/collection/components/atoms/pagination-item/pagination-item.component.js +41 -0
  136. package/dist/collection/components/atoms/tooltip/tooltip.component.css +37 -0
  137. package/dist/collection/components/{tooltip → atoms/tooltip}/tooltip.component.js +122 -32
  138. package/dist/collection/components/molecules/pagination/pagination.component.css +3 -0
  139. package/dist/collection/components/molecules/pagination/pagination.component.js +219 -0
  140. package/dist/collection/tailwind/border-radius.js +1 -0
  141. package/dist/collection/tailwind/grid.js +24 -4
  142. package/dist/collection/tailwind/rotate.js +8 -0
  143. package/dist/collection/tailwind/scale.js +3 -0
  144. package/dist/collection/tailwind.config.js +6 -7
  145. package/dist/{esm/p-icon.entry.js → components/icon.component.js} +67 -52
  146. package/dist/components/index.d.ts +9 -1
  147. package/dist/components/index.js +8 -0
  148. package/dist/components/loader.component.js +74 -0
  149. package/dist/components/p-avatar.d.ts +11 -0
  150. package/dist/components/p-avatar.js +52 -0
  151. package/dist/components/p-button.js +67 -8
  152. package/dist/components/p-counter.d.ts +11 -0
  153. package/dist/components/p-counter.js +33 -0
  154. package/dist/components/p-divider.d.ts +11 -0
  155. package/dist/components/p-divider.js +33 -0
  156. package/dist/components/p-helper.d.ts +11 -0
  157. package/dist/components/p-helper.js +39 -0
  158. package/dist/components/p-icon.js +1 -815
  159. package/dist/components/p-illustration.js +3 -7
  160. package/dist/components/p-info-panel.d.ts +11 -0
  161. package/dist/components/p-info-panel.js +56 -0
  162. package/dist/components/p-loader.d.ts +11 -0
  163. package/dist/components/p-loader.js +6 -0
  164. package/dist/components/p-pagination-item.d.ts +11 -0
  165. package/dist/components/p-pagination-item.js +6 -0
  166. package/dist/components/p-pagination.d.ts +11 -0
  167. package/dist/components/p-pagination.js +192 -0
  168. package/dist/components/p-tooltip.js +1 -1886
  169. package/dist/components/pagination-item.component.js +36 -0
  170. package/dist/components/tooltip.component.js +1932 -0
  171. package/dist/esm/{index-e4d80e41.js → index-5c917d13.js} +487 -10
  172. package/dist/esm/loader.js +2 -2
  173. package/dist/esm/p-avatar.entry.js +28 -0
  174. package/dist/esm/p-button_3.entry.js +899 -0
  175. package/dist/esm/p-counter.entry.js +15 -0
  176. package/dist/esm/p-divider.entry.js +15 -0
  177. package/dist/esm/p-helper.entry.js +15 -0
  178. package/dist/esm/p-illustration.entry.js +11 -14
  179. package/dist/esm/p-info-panel.entry.js +27 -0
  180. package/dist/esm/p-pagination-item.entry.js +19 -0
  181. package/dist/esm/p-pagination.entry.js +159 -0
  182. package/dist/esm/p-tooltip.entry.js +62 -20
  183. package/dist/esm/paperless.js +2 -2
  184. package/dist/index.html +1 -1
  185. package/dist/paperless/p-06a38756.entry.js +1 -0
  186. package/dist/paperless/p-19afe191.entry.js +1 -0
  187. package/dist/paperless/p-229f113b.js +2 -0
  188. package/dist/{build/p-98d636b6.entry.js → paperless/p-23980fbb.entry.js} +1 -1
  189. package/dist/paperless/p-31f80006.entry.js +1 -0
  190. package/dist/paperless/p-332028c6.entry.js +1 -0
  191. package/dist/paperless/p-5f0ec763.entry.js +1 -0
  192. package/dist/paperless/p-6c6c1137.entry.js +1 -0
  193. package/dist/paperless/p-80bf9d06.entry.js +1 -0
  194. package/dist/paperless/p-e80637b9.entry.js +1 -0
  195. package/dist/paperless/p-ec52095f.entry.js +1 -0
  196. package/dist/paperless/paperless.css +3843 -201
  197. package/dist/paperless/paperless.esm.js +1 -1
  198. package/dist/sw.js +245 -49
  199. package/dist/tailwind.config.js +6 -7
  200. package/dist/types/components/atoms/avatar/avatar.component.d.ts +21 -0
  201. package/dist/types/components/atoms/button/button.component.d.ts +51 -0
  202. package/dist/types/components/atoms/counter/counter.component.d.ts +3 -0
  203. package/dist/types/components/atoms/divider/divider.component.d.ts +3 -0
  204. package/dist/types/components/atoms/helper/helper.component.d.ts +3 -0
  205. package/dist/types/components/{icon → atoms/icon}/icon.component.d.ts +3 -2
  206. package/dist/types/components/{illustration → atoms/illustration}/illustration.component.d.ts +2 -2
  207. package/dist/types/components/atoms/info-panel/info-panel.component.d.ts +24 -0
  208. package/dist/types/components/atoms/loader/loader.component.d.ts +30 -0
  209. package/dist/types/components/atoms/pagination-item/pagination-item.component.d.ts +7 -0
  210. package/dist/types/components/atoms/tooltip/tooltip.component.d.ts +40 -0
  211. package/dist/types/components/molecules/pagination/pagination.component.d.ts +31 -0
  212. package/dist/types/components.d.ts +358 -20
  213. package/package.json +3 -2
  214. package/dist/build/p-3318b73b.entry.js +0 -1
  215. package/dist/build/p-6f9229a6.js +0 -2
  216. package/dist/build/p-711630fb.entry.js +0 -1
  217. package/dist/build/p-c3d80205.entry.js +0 -1
  218. package/dist/cjs/p-button.cjs.entry.js +0 -23
  219. package/dist/collection/components/button/button.component.css +0 -6
  220. package/dist/collection/components/button/button.component.js +0 -42
  221. package/dist/collection/components/tooltip/tooltip.component.css +0 -34
  222. package/dist/esm/p-button.entry.js +0 -19
  223. package/dist/paperless/p-3318b73b.entry.js +0 -1
  224. package/dist/paperless/p-6f9229a6.js +0 -2
  225. package/dist/paperless/p-711630fb.entry.js +0 -1
  226. package/dist/paperless/p-c3d80205.entry.js +0 -1
  227. package/dist/types/components/button/button.component.d.ts +0 -7
  228. 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 content of the tooltip
6
+ * The variant of the popover
7
7
  */
8
- this.content = null;
8
+ this.variant = 'hover';
9
9
  /**
10
- * The content of the tooltip
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 force show the tooltip
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.forceShow = false;
24
+ this.canManuallyClose = true;
17
25
  this._loaded = false;
18
26
  }
19
27
  componentShouldUpdate() {
20
28
  this._setOptions();
21
- if (this.forceShow) {
29
+ if (this._loaded && this.show) {
22
30
  this._show();
23
31
  }
24
32
  }
25
33
  render() {
26
- return (h(Host, null,
27
- h("slot", null),
28
- h("div", { class: "tooltip", role: "tooltip", ref: el => this._load(el) },
29
- this.content,
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 tooltip visible
37
- this._tooltip.setAttribute('data-show', '');
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 && !this.forceShow) {
86
+ if (!this._loaded) {
45
87
  return;
46
88
  }
47
- // Hide the tooltip
48
- this._tooltip.removeAttribute('data-show');
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(tooltip) {
53
- this._tooltip = tooltip;
54
- if (tooltip) {
55
- this._popper = createPopper(this._el, tooltip);
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.forceShow) {
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
- "content": {
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 tooltip"
160
+ "text": "The content of the popover"
101
161
  },
102
- "attribute": "content",
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 tooltip"
183
+ "text": "The content of the popover"
124
184
  },
125
185
  "attribute": "placement",
126
186
  "reflect": false,
127
187
  "defaultValue": "'top'"
128
188
  },
129
- "forceShow": {
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 force show the tooltip"
201
+ "text": "Wether to show the popover"
142
202
  },
143
- "attribute": "force-show",
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": "_show",
241
+ "method": "mouseEnterHandler",
152
242
  "target": undefined,
153
243
  "capture": false,
154
244
  "passive": true
155
245
  }, {
156
246
  "name": "focus",
157
- "method": "_show",
247
+ "method": "mouseEnterHandler",
158
248
  "target": undefined,
159
249
  "capture": false,
160
250
  "passive": false
161
251
  }, {
162
252
  "name": "mouseleave",
163
- "method": "_hide",
253
+ "method": "mouseLeaveHandler",
164
254
  "target": undefined,
165
255
  "capture": false,
166
256
  "passive": true
167
257
  }, {
168
258
  "name": "blur",
169
- "method": "_hide",
259
+ "method": "mouseLeaveHandler",
170
260
  "target": undefined,
171
261
  "capture": false,
172
262
  "passive": false
@@ -0,0 +1,3 @@
1
+ p-pagination {
2
+ @apply flex;
3
+ }