@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.
Files changed (157) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/README.md +14 -10
  3. package/dist/assets/icons/arrow.svg +2 -2
  4. package/dist/assets/icons/attachment.svg +2 -2
  5. package/dist/assets/icons/bread.svg +2 -2
  6. package/dist/assets/icons/calendar.svg +2 -2
  7. package/dist/assets/icons/car.svg +2 -2
  8. package/dist/assets/icons/checkmark.svg +2 -2
  9. package/dist/assets/icons/chevron.svg +2 -2
  10. package/dist/assets/icons/clock.svg +2 -2
  11. package/dist/assets/icons/cogs.svg +2 -2
  12. package/dist/assets/icons/comment.svg +2 -2
  13. package/dist/assets/icons/document.svg +2 -2
  14. package/dist/assets/icons/download.svg +2 -2
  15. package/dist/assets/icons/envelope.svg +2 -2
  16. package/dist/assets/icons/explanation.svg +2 -2
  17. package/dist/assets/icons/eye.svg +2 -2
  18. package/dist/assets/icons/filter.svg +2 -2
  19. package/dist/assets/icons/grid.svg +2 -2
  20. package/dist/assets/icons/headset.svg +2 -2
  21. package/dist/assets/icons/list.svg +2 -2
  22. package/dist/assets/icons/location.svg +2 -2
  23. package/dist/assets/icons/megaphone.svg +2 -2
  24. package/dist/assets/icons/minus.svg +2 -2
  25. package/dist/assets/icons/negative.svg +2 -2
  26. package/dist/assets/icons/pagination.svg +2 -2
  27. package/dist/assets/icons/payment.svg +2 -2
  28. package/dist/assets/icons/pencil.svg +2 -2
  29. package/dist/assets/icons/person.svg +2 -2
  30. package/dist/assets/icons/plus.svg +2 -2
  31. package/dist/assets/icons/question.svg +2 -2
  32. package/dist/assets/icons/receipt.svg +2 -2
  33. package/dist/assets/icons/report.svg +2 -2
  34. package/dist/assets/icons/search.svg +2 -2
  35. package/dist/assets/icons/settings.svg +2 -2
  36. package/dist/assets/icons/sick.svg +2 -2
  37. package/dist/assets/icons/tachometer.svg +2 -2
  38. package/dist/assets/icons/tool.svg +2 -2
  39. package/dist/assets/icons/trash.svg +2 -2
  40. package/dist/assets/icons/turn.svg +2 -2
  41. package/dist/assets/icons/upload.svg +2 -2
  42. package/dist/assets/icons/warning.svg +2 -2
  43. package/dist/build/p-1d13a9d2.entry.js +1 -0
  44. package/dist/build/p-208c1f28.entry.js +1 -0
  45. package/dist/build/p-98d07776.js +2 -0
  46. package/dist/build/p-bbd1d3df.entry.js +1 -0
  47. package/dist/build/p-cd525dcc.entry.js +1 -0
  48. package/dist/build/p-feec8ec1.entry.js +1 -0
  49. package/dist/build/paperless.css +21 -10
  50. package/dist/build/paperless.esm.js +1 -1
  51. package/dist/cjs/{index-e3e940d8.js → index-5b30cb95.js} +158 -7
  52. package/dist/cjs/loader.cjs.js +2 -2
  53. package/dist/cjs/p-button.cjs.entry.js +4 -4
  54. package/dist/cjs/p-icon.cjs.entry.js +802 -0
  55. package/dist/cjs/p-illustration.cjs.entry.js +1426 -0
  56. package/dist/cjs/p-loader.cjs.entry.js +57 -0
  57. package/dist/cjs/p-tooltip.cjs.entry.js +1873 -0
  58. package/dist/cjs/paperless.cjs.js +2 -2
  59. package/dist/collection/assets/icons/arrow.svg +2 -2
  60. package/dist/collection/assets/icons/attachment.svg +2 -2
  61. package/dist/collection/assets/icons/bread.svg +2 -2
  62. package/dist/collection/assets/icons/calendar.svg +2 -2
  63. package/dist/collection/assets/icons/car.svg +2 -2
  64. package/dist/collection/assets/icons/checkmark.svg +2 -2
  65. package/dist/collection/assets/icons/chevron.svg +2 -2
  66. package/dist/collection/assets/icons/clock.svg +2 -2
  67. package/dist/collection/assets/icons/cogs.svg +2 -2
  68. package/dist/collection/assets/icons/comment.svg +2 -2
  69. package/dist/collection/assets/icons/document.svg +2 -2
  70. package/dist/collection/assets/icons/download.svg +2 -2
  71. package/dist/collection/assets/icons/envelope.svg +2 -2
  72. package/dist/collection/assets/icons/explanation.svg +2 -2
  73. package/dist/collection/assets/icons/eye.svg +2 -2
  74. package/dist/collection/assets/icons/filter.svg +2 -2
  75. package/dist/collection/assets/icons/grid.svg +2 -2
  76. package/dist/collection/assets/icons/headset.svg +2 -2
  77. package/dist/collection/assets/icons/list.svg +2 -2
  78. package/dist/collection/assets/icons/location.svg +2 -2
  79. package/dist/collection/assets/icons/megaphone.svg +2 -2
  80. package/dist/collection/assets/icons/minus.svg +2 -2
  81. package/dist/collection/assets/icons/negative.svg +2 -2
  82. package/dist/collection/assets/icons/pagination.svg +2 -2
  83. package/dist/collection/assets/icons/payment.svg +2 -2
  84. package/dist/collection/assets/icons/pencil.svg +2 -2
  85. package/dist/collection/assets/icons/person.svg +2 -2
  86. package/dist/collection/assets/icons/plus.svg +2 -2
  87. package/dist/collection/assets/icons/question.svg +2 -2
  88. package/dist/collection/assets/icons/receipt.svg +2 -2
  89. package/dist/collection/assets/icons/report.svg +2 -2
  90. package/dist/collection/assets/icons/search.svg +2 -2
  91. package/dist/collection/assets/icons/settings.svg +2 -2
  92. package/dist/collection/assets/icons/sick.svg +2 -2
  93. package/dist/collection/assets/icons/tachometer.svg +2 -2
  94. package/dist/collection/assets/icons/tool.svg +2 -2
  95. package/dist/collection/assets/icons/trash.svg +2 -2
  96. package/dist/collection/assets/icons/turn.svg +2 -2
  97. package/dist/collection/assets/icons/upload.svg +2 -2
  98. package/dist/collection/assets/icons/warning.svg +2 -2
  99. package/dist/collection/collection-manifest.json +5 -1
  100. package/dist/collection/components/{button → atoms/button}/button.component.css +0 -0
  101. package/dist/collection/components/{button → atoms/button}/button.component.js +6 -5
  102. package/dist/collection/components/atoms/icon/icon.component.js +112 -0
  103. package/dist/collection/components/atoms/illustration/illustration.component.js +39 -0
  104. package/dist/collection/components/atoms/loader/loader.component.css +26 -0
  105. package/dist/collection/components/atoms/loader/loader.component.js +153 -0
  106. package/dist/collection/components/atoms/tooltip/tooltip.component.css +34 -0
  107. package/dist/collection/components/atoms/tooltip/tooltip.component.js +174 -0
  108. package/dist/collection/tailwind/border-radius.js +1 -0
  109. package/dist/collection/tailwind/grid.js +6 -0
  110. package/dist/collection/tailwind/rotate.js +8 -0
  111. package/dist/collection/tailwind/scale.js +3 -0
  112. package/dist/collection/tailwind.config.js +9 -0
  113. package/dist/collection/utils/icons.js +82 -0
  114. package/dist/collection/utils/illustrations.js +18 -0
  115. package/dist/components/index.d.ts +4 -0
  116. package/dist/components/index.js +4 -0
  117. package/dist/components/p-button.js +4 -4
  118. package/dist/components/p-icon.d.ts +11 -0
  119. package/dist/components/p-icon.js +820 -0
  120. package/dist/components/p-illustration.d.ts +11 -0
  121. package/dist/components/p-illustration.js +1441 -0
  122. package/dist/components/p-loader.d.ts +11 -0
  123. package/dist/components/p-loader.js +77 -0
  124. package/dist/components/p-tooltip.d.ts +11 -0
  125. package/dist/components/p-tooltip.js +1891 -0
  126. package/dist/esm/{index-100a5ae6.js → index-111a6307.js} +157 -8
  127. package/dist/esm/loader.js +2 -2
  128. package/dist/esm/p-button.entry.js +4 -4
  129. package/dist/esm/p-icon.entry.js +798 -0
  130. package/dist/esm/p-illustration.entry.js +1422 -0
  131. package/dist/esm/p-loader.entry.js +53 -0
  132. package/dist/esm/p-tooltip.entry.js +1869 -0
  133. package/dist/esm/paperless.js +2 -2
  134. package/dist/index.html +1 -1
  135. package/dist/paperless/p-1d13a9d2.entry.js +1 -0
  136. package/dist/paperless/p-208c1f28.entry.js +1 -0
  137. package/dist/paperless/p-98d07776.js +2 -0
  138. package/dist/paperless/p-bbd1d3df.entry.js +1 -0
  139. package/dist/paperless/p-cd525dcc.entry.js +1 -0
  140. package/dist/paperless/p-feec8ec1.entry.js +1 -0
  141. package/dist/paperless/paperless.css +26928 -13
  142. package/dist/paperless/paperless.esm.js +1 -1
  143. package/dist/sw.js +136 -23
  144. package/dist/tailwind.config.js +9 -0
  145. package/dist/types/components/{button → atoms/button}/button.component.d.ts +1 -1
  146. package/dist/types/components/atoms/icon/icon.component.d.ts +23 -0
  147. package/dist/types/components/atoms/illustration/illustration.component.d.ts +9 -0
  148. package/dist/types/components/atoms/loader/loader.component.d.ts +30 -0
  149. package/dist/types/components/atoms/tooltip/tooltip.component.d.ts +28 -0
  150. package/dist/types/components.d.ts +162 -2
  151. package/dist/types/utils/icons.d.ts +43 -0
  152. package/dist/types/utils/illustrations.d.ts +11 -0
  153. package/package.json +8 -3
  154. package/dist/build/p-54459ae1.js +0 -2
  155. package/dist/build/p-c66e9743.entry.js +0 -1
  156. package/dist/paperless/p-54459ae1.js +0 -2
  157. 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 name
5
+ * The variant of the button
6
6
  */
7
7
  this.variant = 'primary';
8
8
  }
9
9
  render() {
10
- return (h("button", { class: `variant-${this.variant}` },
11
- h("slot", null)));
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 name"
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,6 +1,7 @@
1
1
  module.exports = {
2
2
  large: '0.375rem',
3
3
  DEFAULT: '0.25rem',
4
+ medium: '0.25rem',
4
5
  small: '0.125rem',
5
6
  none: 0,
6
7
  round: '100%',
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ 13: 'repeat(13, minmax(0, 1fr))',
3
+ 14: 'repeat(14, minmax(0, 1fr))',
4
+ 15: 'repeat(15, minmax(0, 1fr))',
5
+ 16: 'repeat(16, minmax(0, 1fr))',
6
+ };
@@ -0,0 +1,8 @@
1
+ const rotateNumbers = {};
2
+
3
+ for (let i = 1; i < 360; i++) {
4
+ rotateNumbers[`${i}`] = `${i}deg`;
5
+ rotateNumbers[`-${i}`] = `-${i}deg`;
6
+ }
7
+
8
+ module.exports = rotateNumbers;
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ flip: '-1',
3
+ };
@@ -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')],