@swisspost/design-system-components 1.4.0 → 1.5.1

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 (162) hide show
  1. package/dist/cjs/check-one-of-4c2e8b2e.js +10 -0
  2. package/dist/cjs/check-one-of-4c2e8b2e.js.map +1 -0
  3. package/dist/cjs/{check-type-f24cf91d.js → check-type-508a21a5.js} +1 -7
  4. package/dist/cjs/check-type-508a21a5.js.map +1 -0
  5. package/dist/cjs/fade-8c6d4fa7.js +12 -0
  6. package/dist/cjs/fade-8c6d4fa7.js.map +1 -0
  7. package/dist/cjs/{index-50d7d035.js → index-12cc37c9.js} +107 -5
  8. package/dist/cjs/index-12cc37c9.js.map +1 -0
  9. package/dist/cjs/index-f8f6f146.js +28 -0
  10. package/dist/cjs/index-f8f6f146.js.map +1 -0
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/package-112e1698.js +7 -0
  13. package/dist/cjs/package-112e1698.js.map +1 -0
  14. package/dist/cjs/post-alert.cjs.entry.js +105 -0
  15. package/dist/cjs/post-alert.cjs.entry.js.map +1 -0
  16. package/dist/cjs/post-collapsible.cjs.entry.js +6 -5
  17. package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
  18. package/dist/cjs/post-components.cjs.js +2 -2
  19. package/dist/cjs/post-icon.cjs.entry.js +12 -21
  20. package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
  21. package/dist/cjs/post-tab-header.cjs.entry.js +4 -4
  22. package/dist/cjs/post-tab-header.cjs.entry.js.map +1 -1
  23. package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
  24. package/dist/cjs/post-tabs.cjs.entry.js +31 -17
  25. package/dist/cjs/post-tabs.cjs.entry.js.map +1 -1
  26. package/dist/cjs/post-tooltip.cjs.entry.js +5097 -0
  27. package/dist/cjs/post-tooltip.cjs.entry.js.map +1 -0
  28. package/dist/collection/collection-manifest.json +3 -1
  29. package/dist/collection/components/post-alert/alert-types.js +2 -0
  30. package/dist/collection/components/post-alert/alert-types.js.map +1 -0
  31. package/dist/collection/components/post-alert/post-alert.css +35 -0
  32. package/dist/collection/components/post-alert/post-alert.js +255 -0
  33. package/dist/collection/components/post-alert/post-alert.js.map +1 -0
  34. package/dist/collection/components/post-collapsible/post-collapsible.css +2 -227
  35. package/dist/collection/components/post-icon/post-icon.css +1 -102
  36. package/dist/collection/components/post-tab-header/post-tab-header.css +3 -337
  37. package/dist/collection/components/post-tab-header/post-tab-header.js +1 -1
  38. package/dist/collection/components/post-tab-header/post-tab-header.js.map +1 -1
  39. package/dist/collection/components/post-tab-panel/post-tab-panel.css +1 -3
  40. package/dist/collection/components/post-tabs/post-tabs.css +1 -148
  41. package/dist/collection/components/post-tabs/post-tabs.js +26 -7
  42. package/dist/collection/components/post-tabs/post-tabs.js.map +1 -1
  43. package/dist/collection/components/post-tooltip/post-tooltip.css +1 -0
  44. package/dist/collection/components/post-tooltip/post-tooltip.js +338 -0
  45. package/dist/collection/components/post-tooltip/post-tooltip.js.map +1 -0
  46. package/dist/collection/components/post-tooltip/types.js +2 -0
  47. package/dist/collection/components/post-tooltip/types.js.map +1 -0
  48. package/dist/collection/utils/property-checkers/check-one-of.js.map +1 -1
  49. package/dist/collection/utils/property-checkers/check-pattern.js +5 -0
  50. package/dist/collection/utils/property-checkers/check-pattern.js.map +1 -0
  51. package/dist/collection/utils/property-checkers/index.js +3 -0
  52. package/dist/collection/utils/property-checkers/index.js.map +1 -1
  53. package/dist/components/check-one-of.js +8 -0
  54. package/dist/components/check-one-of.js.map +1 -0
  55. package/dist/components/check-type.js +1 -6
  56. package/dist/components/check-type.js.map +1 -1
  57. package/dist/components/fade.js +9 -0
  58. package/dist/components/fade.js.map +1 -0
  59. package/dist/components/package.js +1 -1
  60. package/dist/components/post-alert.d.ts +11 -0
  61. package/dist/components/post-alert.js +135 -0
  62. package/dist/components/post-alert.js.map +1 -0
  63. package/dist/components/post-collapsible.js +3 -2
  64. package/dist/components/post-collapsible.js.map +1 -1
  65. package/dist/components/post-icon.js +1 -135
  66. package/dist/components/post-icon.js.map +1 -1
  67. package/dist/components/post-icon2.js +146 -0
  68. package/dist/components/post-icon2.js.map +1 -0
  69. package/dist/components/post-tab-header.js +2 -2
  70. package/dist/components/post-tab-header.js.map +1 -1
  71. package/dist/components/post-tabs.js +27 -13
  72. package/dist/components/post-tabs.js.map +1 -1
  73. package/dist/components/post-tooltip.d.ts +11 -0
  74. package/dist/components/post-tooltip.js +5118 -0
  75. package/dist/components/post-tooltip.js.map +1 -0
  76. package/dist/docs.json +313 -3
  77. package/dist/esm/check-one-of-ded5e15e.js +8 -0
  78. package/dist/esm/check-one-of-ded5e15e.js.map +1 -0
  79. package/dist/esm/{check-type-67411ed3.js → check-type-18ebb4e7.js} +2 -7
  80. package/dist/esm/check-type-18ebb4e7.js.map +1 -0
  81. package/dist/esm/fade-671f1489.js +9 -0
  82. package/dist/esm/fade-671f1489.js.map +1 -0
  83. package/dist/esm/{index-cc0e53f0.js → index-5611074b.js} +107 -5
  84. package/dist/esm/index-5611074b.js.map +1 -0
  85. package/dist/esm/index-7f723686.js +24 -0
  86. package/dist/esm/index-7f723686.js.map +1 -0
  87. package/dist/esm/loader.js +3 -3
  88. package/dist/esm/package-331628f1.js +5 -0
  89. package/dist/esm/package-331628f1.js.map +1 -0
  90. package/dist/esm/post-alert.entry.js +101 -0
  91. package/dist/esm/post-alert.entry.js.map +1 -0
  92. package/dist/esm/post-collapsible.entry.js +5 -4
  93. package/dist/esm/post-collapsible.entry.js.map +1 -1
  94. package/dist/esm/post-components.js +3 -3
  95. package/dist/esm/post-icon.entry.js +7 -16
  96. package/dist/esm/post-icon.entry.js.map +1 -1
  97. package/dist/esm/post-tab-header.entry.js +4 -4
  98. package/dist/esm/post-tab-header.entry.js.map +1 -1
  99. package/dist/esm/post-tab-panel.entry.js +2 -2
  100. package/dist/esm/post-tabs.entry.js +29 -15
  101. package/dist/esm/post-tabs.entry.js.map +1 -1
  102. package/dist/esm/post-tooltip.entry.js +5093 -0
  103. package/dist/esm/post-tooltip.entry.js.map +1 -0
  104. package/dist/post-components/p-0d37fe44.entry.js +2 -0
  105. package/dist/post-components/p-0d37fe44.entry.js.map +1 -0
  106. package/dist/post-components/p-123bb6fb.entry.js +2 -0
  107. package/dist/post-components/p-123bb6fb.entry.js.map +1 -0
  108. package/dist/post-components/p-15fc087f.js +2 -0
  109. package/dist/post-components/p-15fc087f.js.map +1 -0
  110. package/dist/post-components/p-65a9d1c2.entry.js +2 -0
  111. package/dist/post-components/p-7240ae7b.entry.js +2 -0
  112. package/dist/post-components/p-7240ae7b.entry.js.map +1 -0
  113. package/dist/post-components/p-75a7b352.js +2 -0
  114. package/dist/post-components/p-75a7b352.js.map +1 -0
  115. package/dist/post-components/p-8c386036.entry.js +9 -0
  116. package/dist/post-components/p-8c386036.entry.js.map +1 -0
  117. package/dist/post-components/p-97a064da.entry.js +2 -0
  118. package/dist/post-components/{p-6dad6a8a.entry.js.map → p-97a064da.entry.js.map} +1 -1
  119. package/dist/post-components/p-bcc705f1.js +2 -0
  120. package/dist/post-components/p-bcc705f1.js.map +1 -0
  121. package/dist/post-components/p-ccae1c68.entry.js +2 -0
  122. package/dist/post-components/p-ccae1c68.entry.js.map +1 -0
  123. package/dist/post-components/p-d94db268.js +3 -0
  124. package/dist/post-components/p-d94db268.js.map +1 -0
  125. package/dist/post-components/p-e5306504.js +2 -0
  126. package/dist/post-components/p-e5306504.js.map +1 -0
  127. package/dist/post-components/p-eb3ff4dc.js +2 -0
  128. package/dist/post-components/post-components.esm.js +1 -1
  129. package/dist/post-components/post-components.esm.js.map +1 -1
  130. package/dist/types/components/post-alert/alert-types.d.ts +2 -0
  131. package/dist/types/components/post-alert/post-alert.d.ts +49 -0
  132. package/dist/types/components/post-tabs/post-tabs.d.ts +1 -0
  133. package/dist/types/components/post-tooltip/post-tooltip.d.ts +66 -0
  134. package/dist/types/components/post-tooltip/types.d.ts +2 -0
  135. package/dist/types/components.d.ts +115 -0
  136. package/dist/types/utils/property-checkers/check-one-of.d.ts +1 -1
  137. package/dist/types/utils/property-checkers/check-pattern.d.ts +1 -0
  138. package/dist/types/utils/property-checkers/index.d.ts +3 -1
  139. package/package.json +12 -8
  140. package/dist/cjs/check-type-f24cf91d.js.map +0 -1
  141. package/dist/cjs/index-50d7d035.js.map +0 -1
  142. package/dist/cjs/package-e8a6597e.js +0 -7
  143. package/dist/cjs/package-e8a6597e.js.map +0 -1
  144. package/dist/esm/check-type-67411ed3.js.map +0 -1
  145. package/dist/esm/index-cc0e53f0.js.map +0 -1
  146. package/dist/esm/package-b514d0f6.js +0 -5
  147. package/dist/esm/package-b514d0f6.js.map +0 -1
  148. package/dist/post-components/p-1388585d.entry.js +0 -2
  149. package/dist/post-components/p-1388585d.entry.js.map +0 -1
  150. package/dist/post-components/p-58916755.js +0 -2
  151. package/dist/post-components/p-5b3445dc.entry.js +0 -2
  152. package/dist/post-components/p-5b3445dc.entry.js.map +0 -1
  153. package/dist/post-components/p-6341b9b4.js +0 -3
  154. package/dist/post-components/p-6341b9b4.js.map +0 -1
  155. package/dist/post-components/p-6dad6a8a.entry.js +0 -2
  156. package/dist/post-components/p-b95ec099.entry.js +0 -2
  157. package/dist/post-components/p-cc92afb7.entry.js +0 -2
  158. package/dist/post-components/p-cc92afb7.entry.js.map +0 -1
  159. package/dist/post-components/p-f549b3fc.js +0 -2
  160. package/dist/post-components/p-f549b3fc.js.map +0 -1
  161. /package/dist/post-components/{p-b95ec099.entry.js.map → p-65a9d1c2.entry.js.map} +0 -0
  162. /package/dist/post-components/{p-58916755.js.map → p-eb3ff4dc.js.map} +0 -0
package/dist/docs.json CHANGED
@@ -1,11 +1,163 @@
1
1
  {
2
- "timestamp": "2023-08-31T09:34:16",
2
+ "timestamp": "2023-10-24T09:49:50",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "3.4.2",
6
6
  "typescriptVersion": "5.0.4"
7
7
  },
8
8
  "components": [
9
+ {
10
+ "filePath": "./src/components/post-alert/post-alert.tsx",
11
+ "encapsulation": "shadow",
12
+ "tag": "post-alert",
13
+ "readme": "# post-alert\n\n\n",
14
+ "docs": "",
15
+ "docsTags": [],
16
+ "usage": {},
17
+ "props": [
18
+ {
19
+ "name": "dismissLabel",
20
+ "type": "string",
21
+ "mutable": false,
22
+ "attr": "dismiss-label",
23
+ "reflectToAttr": false,
24
+ "docs": "The label to use for the close button of a dismissible alert.",
25
+ "docsTags": [],
26
+ "values": [
27
+ {
28
+ "type": "string"
29
+ }
30
+ ],
31
+ "optional": false,
32
+ "required": false
33
+ },
34
+ {
35
+ "name": "dismissible",
36
+ "type": "boolean",
37
+ "mutable": false,
38
+ "attr": "dismissible",
39
+ "reflectToAttr": false,
40
+ "docs": "If `true`, a close button (×) is displayed and the alert can be dismissed by the user.",
41
+ "docsTags": [],
42
+ "default": "false",
43
+ "values": [
44
+ {
45
+ "type": "boolean"
46
+ }
47
+ ],
48
+ "optional": false,
49
+ "required": false
50
+ },
51
+ {
52
+ "name": "fixed",
53
+ "type": "boolean",
54
+ "mutable": false,
55
+ "attr": "fixed",
56
+ "reflectToAttr": false,
57
+ "docs": "If `true`, the alert is positioned at the bottom of the window, from edge to edge.",
58
+ "docsTags": [],
59
+ "default": "false",
60
+ "values": [
61
+ {
62
+ "type": "boolean"
63
+ }
64
+ ],
65
+ "optional": false,
66
+ "required": false
67
+ },
68
+ {
69
+ "name": "icon",
70
+ "type": "string",
71
+ "mutable": false,
72
+ "attr": "icon",
73
+ "reflectToAttr": false,
74
+ "docs": "The icon to display in the alert. By default, the icon depends on the alert type.\n\nIf `none`, no icon is displayed.",
75
+ "docsTags": [],
76
+ "values": [
77
+ {
78
+ "type": "string"
79
+ }
80
+ ],
81
+ "optional": false,
82
+ "required": false
83
+ },
84
+ {
85
+ "name": "type",
86
+ "type": "\"danger\" | \"gray\" | \"info\" | \"primary\" | \"success\" | \"warning\"",
87
+ "mutable": false,
88
+ "attr": "type",
89
+ "reflectToAttr": false,
90
+ "docs": "The type of the alert.",
91
+ "docsTags": [],
92
+ "default": "'primary'",
93
+ "values": [
94
+ {
95
+ "value": "danger",
96
+ "type": "string"
97
+ },
98
+ {
99
+ "value": "gray",
100
+ "type": "string"
101
+ },
102
+ {
103
+ "value": "info",
104
+ "type": "string"
105
+ },
106
+ {
107
+ "value": "primary",
108
+ "type": "string"
109
+ },
110
+ {
111
+ "value": "success",
112
+ "type": "string"
113
+ },
114
+ {
115
+ "value": "warning",
116
+ "type": "string"
117
+ }
118
+ ],
119
+ "optional": false,
120
+ "required": false
121
+ }
122
+ ],
123
+ "methods": [
124
+ {
125
+ "name": "dismiss",
126
+ "returns": {
127
+ "type": "Promise<void>",
128
+ "docs": ""
129
+ },
130
+ "signature": "dismiss() => Promise<void>",
131
+ "parameters": [],
132
+ "docs": "Triggers alert dismissal programmatically (same as clicking on the close button (×)).",
133
+ "docsTags": []
134
+ }
135
+ ],
136
+ "events": [
137
+ {
138
+ "event": "dismissed",
139
+ "detail": "void",
140
+ "bubbles": true,
141
+ "cancelable": true,
142
+ "composed": true,
143
+ "docs": "An event emitted when the alert element is dismissed, after the transition.\nIt has no payload and only relevant for dismissible alerts.",
144
+ "docsTags": []
145
+ }
146
+ ],
147
+ "listeners": [],
148
+ "styles": [],
149
+ "slots": [],
150
+ "parts": [],
151
+ "dependents": [],
152
+ "dependencies": [
153
+ "post-icon"
154
+ ],
155
+ "dependencyGraph": {
156
+ "post-alert": [
157
+ "post-icon"
158
+ ]
159
+ }
160
+ },
9
161
  {
10
162
  "filePath": "./src/components/post-collapsible/post-collapsible.tsx",
11
163
  "encapsulation": "shadow",
@@ -232,9 +384,15 @@
232
384
  "styles": [],
233
385
  "slots": [],
234
386
  "parts": [],
235
- "dependents": [],
387
+ "dependents": [
388
+ "post-alert"
389
+ ],
236
390
  "dependencies": [],
237
- "dependencyGraph": {}
391
+ "dependencyGraph": {
392
+ "post-alert": [
393
+ "post-icon"
394
+ ]
395
+ }
238
396
  },
239
397
  {
240
398
  "filePath": "./src/components/post-tab-header/post-tab-header.tsx",
@@ -365,6 +523,158 @@
365
523
  "dependents": [],
366
524
  "dependencies": [],
367
525
  "dependencyGraph": {}
526
+ },
527
+ {
528
+ "filePath": "./src/components/post-tooltip/post-tooltip.tsx",
529
+ "encapsulation": "shadow",
530
+ "tag": "post-tooltip",
531
+ "readme": "# post-tooltip\n\n\n",
532
+ "docs": "",
533
+ "docsTags": [],
534
+ "usage": {},
535
+ "props": [
536
+ {
537
+ "name": "backgroundColor",
538
+ "type": "\"primary\" | \"yellow\"",
539
+ "mutable": false,
540
+ "attr": "background-color",
541
+ "reflectToAttr": false,
542
+ "docs": "Defines the background color of the tooltip.\nChoose the one that provides the best contrast in your scenario.",
543
+ "docsTags": [],
544
+ "default": "'primary'",
545
+ "values": [
546
+ {
547
+ "value": "primary",
548
+ "type": "string"
549
+ },
550
+ {
551
+ "value": "yellow",
552
+ "type": "string"
553
+ }
554
+ ],
555
+ "optional": true,
556
+ "required": false
557
+ },
558
+ {
559
+ "name": "placement",
560
+ "type": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
561
+ "mutable": false,
562
+ "attr": "placement",
563
+ "reflectToAttr": false,
564
+ "docs": "Defines the placement of the tooltip according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.\nTooltips are automatically flipped to the opposite side if there is not enough available space and are shifted\ntowards the viewport if they would overlap edge boundaries.",
565
+ "docsTags": [],
566
+ "default": "'top'",
567
+ "values": [
568
+ {
569
+ "value": "bottom",
570
+ "type": "string"
571
+ },
572
+ {
573
+ "value": "bottom-end",
574
+ "type": "string"
575
+ },
576
+ {
577
+ "value": "bottom-start",
578
+ "type": "string"
579
+ },
580
+ {
581
+ "value": "left",
582
+ "type": "string"
583
+ },
584
+ {
585
+ "value": "left-end",
586
+ "type": "string"
587
+ },
588
+ {
589
+ "value": "left-start",
590
+ "type": "string"
591
+ },
592
+ {
593
+ "value": "right",
594
+ "type": "string"
595
+ },
596
+ {
597
+ "value": "right-end",
598
+ "type": "string"
599
+ },
600
+ {
601
+ "value": "right-start",
602
+ "type": "string"
603
+ },
604
+ {
605
+ "value": "top",
606
+ "type": "string"
607
+ },
608
+ {
609
+ "value": "top-end",
610
+ "type": "string"
611
+ },
612
+ {
613
+ "value": "top-start",
614
+ "type": "string"
615
+ }
616
+ ],
617
+ "optional": true,
618
+ "required": false
619
+ }
620
+ ],
621
+ "methods": [
622
+ {
623
+ "name": "hide",
624
+ "returns": {
625
+ "type": "Promise<void>",
626
+ "docs": ""
627
+ },
628
+ "signature": "hide() => Promise<void>",
629
+ "parameters": [],
630
+ "docs": "Programmatically hide this tooltip",
631
+ "docsTags": []
632
+ },
633
+ {
634
+ "name": "show",
635
+ "returns": {
636
+ "type": "Promise<void>",
637
+ "docs": ""
638
+ },
639
+ "signature": "show(target: HTMLElement) => Promise<void>",
640
+ "parameters": [],
641
+ "docs": "Programmatically display the tooltip",
642
+ "docsTags": [
643
+ {
644
+ "name": "param",
645
+ "text": "target An element with [data-tooltip-target=\"id\"] where the tooltip should be shown"
646
+ }
647
+ ]
648
+ },
649
+ {
650
+ "name": "toggle",
651
+ "returns": {
652
+ "type": "Promise<void>",
653
+ "docs": ""
654
+ },
655
+ "signature": "toggle(target: HTMLElement, force?: boolean) => Promise<void>",
656
+ "parameters": [],
657
+ "docs": "Toggle tooltip display",
658
+ "docsTags": [
659
+ {
660
+ "name": "param",
661
+ "text": "target An element with [data-tooltip-target=\"id\"] where the tooltip should be shown"
662
+ },
663
+ {
664
+ "name": "param",
665
+ "text": "force Pass true to always show or false to always hide"
666
+ }
667
+ ]
668
+ }
669
+ ],
670
+ "events": [],
671
+ "listeners": [],
672
+ "styles": [],
673
+ "slots": [],
674
+ "parts": [],
675
+ "dependents": [],
676
+ "dependencies": [],
677
+ "dependencyGraph": {}
368
678
  }
369
679
  ]
370
680
  }
@@ -0,0 +1,8 @@
1
+ function checkOneOf(value, possibleValues, error) {
2
+ if (!possibleValues.includes(value))
3
+ throw new Error(error);
4
+ }
5
+
6
+ export { checkOneOf as c };
7
+
8
+ //# sourceMappingURL=check-one-of-ded5e15e.js.map
@@ -0,0 +1 @@
1
+ {"file":"check-one-of-ded5e15e.js","mappings":"SAAgB,UAAU,CAAI,KAAQ,EAAE,cAA4B,EAAE,KAAa;EACjF,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC;IAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;AAC9D;;;;","names":[],"sources":["./src/utils/property-checkers/check-one-of.ts"],"sourcesContent":["export function checkOneOf<T>(value: T, possibleValues: readonly T[], error: string) {\n if (!possibleValues.includes(value)) throw new Error(error);\n}\n"],"version":3}
@@ -1,8 +1,3 @@
1
- function checkOneOf(value, possibleValues, error) {
2
- if (!possibleValues.includes(value))
3
- throw new Error(error);
4
- }
5
-
6
1
  function checkType(value, type, error) {
7
2
  const typeIsArray = type === 'array';
8
3
  const valueIsArray = Array.isArray(value);
@@ -16,6 +11,6 @@ function checkType(value, type, error) {
16
11
  }
17
12
  }
18
13
 
19
- export { checkOneOf as a, checkType as c };
14
+ export { checkType as c };
20
15
 
21
- //# sourceMappingURL=check-type-67411ed3.js.map
16
+ //# sourceMappingURL=check-type-18ebb4e7.js.map
@@ -0,0 +1 @@
1
+ {"file":"check-type-18ebb4e7.js","mappings":"SAQgB,SAAS,CAAC,KAAc,EAAE,IAAkB,EAAE,KAAa;EACzE,MAAM,WAAW,GAAG,IAAI,KAAK,OAAO,CAAC;EACrC,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;EAE1C,IAAI,WAAW,IAAI,YAAY,EAAE;IAC/B,IAAI,YAAY,KAAK,WAAW;MAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;GAC1D;OAAM;IACL,IAAI,OAAO,KAAK,KAAK,IAAI;MAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;GACnD;AACH;;;;","names":[],"sources":["./src/utils/property-checkers/check-type.ts"],"sourcesContent":["export type PropertyType =\n | 'boolean'\n | 'number'\n | 'string'\n | 'array'\n | 'object'\n | 'function';\n\nexport function checkType(value: unknown, type: PropertyType, error: string) {\n const typeIsArray = type === 'array';\n const valueIsArray = Array.isArray(value);\n\n if (typeIsArray || valueIsArray) {\n if (valueIsArray !== typeIsArray) throw new Error(error);\n } else {\n if (typeof value !== type) throw new Error(error);\n }\n}\n"],"version":3}
@@ -0,0 +1,9 @@
1
+ const fadeDuration = 200;
2
+ const fadedOutKeyFrame = { opacity: '0' };
3
+ const fadedInKeyFrame = { opacity: '1' };
4
+ const fadeIn = (el) => el.animate([fadedOutKeyFrame, fadedInKeyFrame], { duration: fadeDuration });
5
+ const fadeOut = (el) => el.animate([fadedInKeyFrame, fadedOutKeyFrame], { duration: fadeDuration });
6
+
7
+ export { fadeIn as a, fadeOut as f };
8
+
9
+ //# sourceMappingURL=fade-671f1489.js.map
@@ -0,0 +1 @@
1
+ {"file":"fade-671f1489.js","mappings":"AAAA,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,MAAM,gBAAgB,GAAG,EAAC,OAAO,EAAE,GAAG,EAAC,CAAC;AACxC,MAAM,eAAe,GAAG,EAAC,OAAO,EAAE,GAAG,EAAC,CAAC;MAE1B,MAAM,GAAG,CAAC,EAAW,KAAgB,EAAE,CAAC,OAAO,CAC1D,CAAE,gBAAgB,EAAE,eAAe,CAAE,EACrC,EAAE,QAAQ,EAAE,YAAY,EAAE,EAC1B;MAEW,OAAO,GAAG,CAAC,EAAW,KAAgB,EAAE,CAAC,OAAO,CAC3D,CAAE,eAAe,EAAE,gBAAgB,CAAE,EACrC,EAAE,QAAQ,EAAE,YAAY,EAAE;;;;","names":[],"sources":["./src/animations/fade.ts"],"sourcesContent":["const fadeDuration = 200;\nconst fadedOutKeyFrame = {opacity: '0'};\nconst fadedInKeyFrame = {opacity: '1'};\n\nexport const fadeIn = (el: Element): Animation => el.animate(\n [ fadedOutKeyFrame, fadedInKeyFrame ],\n { duration: fadeDuration }\n);\n\nexport const fadeOut = (el: Element): Animation => el.animate(\n [ fadedInKeyFrame, fadedOutKeyFrame ],\n { duration: fadeDuration }\n);\n"],"version":3}
@@ -77,6 +77,7 @@ function queryNonceMetaTagContent(doc) {
77
77
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
78
78
  const h = (nodeName, vnodeData, ...children) => {
79
79
  let child = null;
80
+ let key = null;
80
81
  let simple = false;
81
82
  let lastSimple = false;
82
83
  const vNodeChildren = [];
@@ -104,6 +105,10 @@ const h = (nodeName, vnodeData, ...children) => {
104
105
  };
105
106
  walk(children);
106
107
  if (vnodeData) {
108
+ // normalize class / classname attributes
109
+ if (vnodeData.key) {
110
+ key = vnodeData.key;
111
+ }
107
112
  {
108
113
  const classData = vnodeData.className || vnodeData.class;
109
114
  if (classData) {
@@ -125,6 +130,9 @@ const h = (nodeName, vnodeData, ...children) => {
125
130
  if (vNodeChildren.length > 0) {
126
131
  vnode.$children$ = vNodeChildren;
127
132
  }
133
+ {
134
+ vnode.$key$ = key;
135
+ }
128
136
  return vnode;
129
137
  };
130
138
  /**
@@ -146,6 +154,9 @@ const newVNode = (tag, text) => {
146
154
  {
147
155
  vnode.$attrs$ = null;
148
156
  }
157
+ {
158
+ vnode.$key$ = null;
159
+ }
149
160
  return vnode;
150
161
  };
151
162
  const Host = {};
@@ -404,6 +415,14 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
404
415
  }
405
416
  }
406
417
  }
418
+ else if (memberName === 'key')
419
+ ;
420
+ else if (memberName === 'ref') {
421
+ // minifier will clean this up
422
+ if (newValue) {
423
+ newValue(elm);
424
+ }
425
+ }
407
426
  else if ((!isProp ) &&
408
427
  memberName[0] === 'o' &&
409
428
  memberName[1] === 'n') {
@@ -520,7 +539,11 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
520
539
  let i = 0;
521
540
  let elm;
522
541
  let childNode;
523
- {
542
+ if (newVNode.$text$ !== null) {
543
+ // create text node
544
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
545
+ }
546
+ else {
524
547
  if (!isSvgMode) {
525
548
  isSvgMode = newVNode.$tag$ === 'svg';
526
549
  }
@@ -610,6 +633,7 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
610
633
  const vnode = vnodes[index];
611
634
  if (vnode) {
612
635
  const elm = vnode.$elm$;
636
+ nullifyVNodeRefs(vnode);
613
637
  if (elm) {
614
638
  // remove the vnode's element from the dom
615
639
  elm.remove();
@@ -688,6 +712,8 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
688
712
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
689
713
  let oldStartIdx = 0;
690
714
  let newStartIdx = 0;
715
+ let idxInOld = 0;
716
+ let i = 0;
691
717
  let oldEndIdx = oldCh.length - 1;
692
718
  let oldStartVnode = oldCh[0];
693
719
  let oldEndVnode = oldCh[oldEndIdx];
@@ -695,6 +721,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
695
721
  let newStartVnode = newCh[0];
696
722
  let newEndVnode = newCh[newEndIdx];
697
723
  let node;
724
+ let elmToMove;
698
725
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
699
726
  if (oldStartVnode == null) {
700
727
  // VNode might have been moved left
@@ -761,7 +788,41 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
761
788
  newStartVnode = newCh[++newStartIdx];
762
789
  }
763
790
  else {
791
+ // Here we do some checks to match up old and new nodes based on the
792
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
793
+ // in the JSX for a DOM element in the implementation of a Stencil
794
+ // component.
795
+ //
796
+ // First we check to see if there are any nodes in the array of old
797
+ // children which have the same key as the first node in the new
798
+ // children.
799
+ idxInOld = -1;
764
800
  {
801
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
802
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
803
+ idxInOld = i;
804
+ break;
805
+ }
806
+ }
807
+ }
808
+ if (idxInOld >= 0) {
809
+ // We found a node in the old children which matches up with the first
810
+ // node in the new children! So let's deal with that
811
+ elmToMove = oldCh[idxInOld];
812
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
813
+ // the tag doesn't match so we'll need a new DOM element
814
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
815
+ }
816
+ else {
817
+ patch(elmToMove, newStartVnode);
818
+ // invalidate the matching old node so that we won't try to update it
819
+ // again later on
820
+ oldCh[idxInOld] = undefined;
821
+ node = elmToMove.$elm$;
822
+ }
823
+ newStartVnode = newCh[++newStartIdx];
824
+ }
825
+ else {
765
826
  // We either didn't find an element in the old children that matches
766
827
  // the key of the first new child OR the build is not using `key`
767
828
  // attributes at all. In either case we need to create a new element
@@ -810,7 +871,10 @@ const isSameVnode = (leftVNode, rightVNode) => {
810
871
  // compare if two vnode to see if they're "technically" the same
811
872
  // need to have the same element tag, and same key to be the same
812
873
  if (leftVNode.$tag$ === rightVNode.$tag$) {
813
- return true;
874
+ // this will be set if components in the build have `key` attrs set on them
875
+ {
876
+ return leftVNode.$key$ === rightVNode.$key$;
877
+ }
814
878
  }
815
879
  return false;
816
880
  };
@@ -827,7 +891,8 @@ const patch = (oldVNode, newVNode) => {
827
891
  const oldChildren = oldVNode.$children$;
828
892
  const newChildren = newVNode.$children$;
829
893
  const tag = newVNode.$tag$;
830
- {
894
+ const text = newVNode.$text$;
895
+ if (text === null) {
831
896
  {
832
897
  // test if we're rendering an svg element, or still rendering nodes inside of one
833
898
  // only add this to the when the compiler sees we're using an svg somewhere
@@ -849,6 +914,11 @@ const patch = (oldVNode, newVNode) => {
849
914
  updateChildren(elm, oldChildren, newVNode, newChildren);
850
915
  }
851
916
  else if (newChildren !== null) {
917
+ // no old child vnodes, but there are new child vnodes to add
918
+ if (oldVNode.$text$ !== null) {
919
+ // the old vnode was text, so be sure to clear it out
920
+ elm.textContent = '';
921
+ }
852
922
  // add the new vnode children
853
923
  addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
854
924
  }
@@ -860,6 +930,24 @@ const patch = (oldVNode, newVNode) => {
860
930
  isSvgMode = false;
861
931
  }
862
932
  }
933
+ else if (oldVNode.$text$ !== text) {
934
+ // update the text content for the text only vnode
935
+ // and also only if the text is different than before
936
+ elm.data = text;
937
+ }
938
+ };
939
+ /**
940
+ * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by
941
+ * calling them with `null`. This signals that the DOM element corresponding to
942
+ * the VDom node has been removed from the DOM.
943
+ *
944
+ * @param vNode a virtual DOM node
945
+ */
946
+ const nullifyVNodeRefs = (vNode) => {
947
+ {
948
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
949
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
950
+ }
863
951
  };
864
952
  /**
865
953
  * The main entry point for Stencil's virtual DOM-based rendering engine
@@ -1310,6 +1398,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1310
1398
  hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1311
1399
  }
1312
1400
  endNewInstance();
1401
+ fireConnectedCallback(hostRef.$lazyInstance$);
1313
1402
  }
1314
1403
  if (Cstr.style) {
1315
1404
  // this component has styles but we haven't registered them yet
@@ -1338,6 +1427,11 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1338
1427
  schedule();
1339
1428
  }
1340
1429
  };
1430
+ const fireConnectedCallback = (instance) => {
1431
+ {
1432
+ safeCall(instance, 'connectedCallback');
1433
+ }
1434
+ };
1341
1435
  const connectedCallback = (elm) => {
1342
1436
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1343
1437
  const hostRef = getHostRef(elm);
@@ -1376,12 +1470,20 @@ const connectedCallback = (elm) => {
1376
1470
  initializeComponent(elm, hostRef, cmpMeta);
1377
1471
  }
1378
1472
  }
1473
+ else {
1474
+ // fire off connectedCallback() on component instance
1475
+ fireConnectedCallback(hostRef.$lazyInstance$);
1476
+ }
1379
1477
  endConnected();
1380
1478
  }
1381
1479
  };
1382
1480
  const disconnectedCallback = (elm) => {
1383
1481
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1384
- getHostRef(elm);
1482
+ const hostRef = getHostRef(elm);
1483
+ const instance = hostRef.$lazyInstance$ ;
1484
+ {
1485
+ safeCall(instance, 'disconnectedCallback');
1486
+ }
1385
1487
  }
1386
1488
  };
1387
1489
  const bootstrapLazy = (lazyBundles, options = {}) => {
@@ -1600,4 +1702,4 @@ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1600
1702
 
1601
1703
  export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
1602
1704
 
1603
- //# sourceMappingURL=index-cc0e53f0.js.map
1705
+ //# sourceMappingURL=index-5611074b.js.map