@justifi/webcomponents 4.19.3 → 4.20.0

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 (194) hide show
  1. package/dist/cjs/{Analytics-a0a86d82.js → Analytics-03981aad.js} +1 -1
  2. package/dist/cjs/business-details-core.cjs.entry.js +1 -1
  3. package/dist/cjs/check-pkg-version-89d6d146.js +24 -0
  4. package/dist/cjs/custom-popper.cjs.entry.js +1894 -0
  5. package/dist/cjs/form-control-date_3.cjs.entry.js +4 -4
  6. package/dist/cjs/form-control-error-text_4.cjs.entry.js +9 -9
  7. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +2 -2
  8. package/dist/cjs/justifi-billing-form_2.cjs.entry.js +1 -1
  9. package/dist/cjs/justifi-business-details.cjs.entry.js +4 -2
  10. package/dist/cjs/justifi-business-form.cjs.entry.js +6 -4
  11. package/dist/cjs/justifi-card-form.cjs.entry.js +2 -2
  12. package/dist/cjs/justifi-checkout-core.cjs.entry.js +1 -1
  13. package/dist/cjs/justifi-checkout.cjs.entry.js +6 -4
  14. package/dist/cjs/justifi-details.cjs.entry.js +1 -1
  15. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +4 -2
  16. package/dist/cjs/justifi-payment-details.cjs.entry.js +4 -2
  17. package/dist/cjs/justifi-payment-form.cjs.entry.js +8 -6
  18. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
  19. package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +1 -1
  20. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +5 -3
  21. package/dist/cjs/justifi-payments-list.cjs.entry.js +4 -2
  22. package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -2
  23. package/dist/cjs/justifi-payouts-list.cjs.entry.js +4 -2
  24. package/dist/cjs/justifi-refund-form.cjs.entry.js +2 -2
  25. package/dist/cjs/justifi-season-interruption-insurance-core.cjs.entry.js +1 -1
  26. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +5 -3
  27. package/dist/cjs/loader.cjs.js +1 -1
  28. package/dist/cjs/{package-99f4d813.js → package-7fdd14b9.js} +3 -1
  29. package/dist/cjs/payment-details-core.cjs.entry.js +1 -1
  30. package/dist/cjs/payments-list-core.cjs.entry.js +18 -13
  31. package/dist/cjs/payments-list-filters_2.cjs.entry.js +17266 -0
  32. package/dist/cjs/payout-details-core.cjs.entry.js +2 -2
  33. package/dist/cjs/payouts-list-core.cjs.entry.js +3 -3
  34. package/dist/cjs/styled-host-9e0b67b3.js +14 -0
  35. package/dist/cjs/utils-f8a6962c.js +25 -0
  36. package/dist/cjs/webcomponents.cjs.js +1 -1
  37. package/dist/collection/collection-manifest.json +4 -1
  38. package/dist/collection/components/business-details/business-details.js +2 -0
  39. package/dist/collection/components/business-forms/business-form/business-form.js +3 -1
  40. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +3 -1
  41. package/dist/collection/components/checkout/checkout.js +4 -2
  42. package/dist/collection/components/form/form-control-date.js +26 -28
  43. package/dist/collection/components/form/form-control-select.js +45 -45
  44. package/dist/collection/components/form/form-control-text.js +34 -34
  45. package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +2 -0
  46. package/dist/collection/components/insurance/season-interruption/season-interruption-insurance.js +3 -1
  47. package/dist/collection/components/payment-details/payment-details.js +2 -0
  48. package/dist/collection/components/payment-form/payment-form.js +5 -3
  49. package/dist/collection/components/payments-list/payments-list-core.js +14 -9
  50. package/dist/collection/components/payments-list/payments-list-filters.js +84 -0
  51. package/dist/collection/components/payments-list/payments-list.js +2 -0
  52. package/dist/collection/components/payout-details/payout-details-core.js +1 -1
  53. package/dist/collection/components/payout-details/payout-details.js +2 -0
  54. package/dist/collection/components/payouts-list/payouts-list-core.js +2 -2
  55. package/dist/collection/components/payouts-list/payouts-list.js +2 -0
  56. package/dist/collection/components/refund-form/refund-form.js +1 -1
  57. package/dist/collection/ui-components/custom-popper/custom-popper.js +239 -0
  58. package/dist/collection/ui-components/filters/table-filters-menu.js +89 -0
  59. package/dist/collection/ui-components/filters/utils.js +20 -0
  60. package/dist/collection/utils/check-pkg-version.js +19 -0
  61. package/dist/docs.json +523 -19
  62. package/dist/esm/{Analytics-e460ab05.js → Analytics-3103f8e9.js} +1 -1
  63. package/dist/esm/business-details-core.entry.js +1 -1
  64. package/dist/esm/check-pkg-version-44e6ad15.js +22 -0
  65. package/dist/esm/custom-popper.entry.js +1890 -0
  66. package/dist/esm/form-control-date_3.entry.js +4 -4
  67. package/dist/esm/form-control-error-text_4.entry.js +9 -9
  68. package/dist/esm/justifi-bank-account-form.entry.js +2 -2
  69. package/dist/esm/justifi-billing-form_2.entry.js +1 -1
  70. package/dist/esm/justifi-business-details.entry.js +4 -2
  71. package/dist/esm/justifi-business-form.entry.js +6 -4
  72. package/dist/esm/justifi-card-form.entry.js +2 -2
  73. package/dist/esm/justifi-checkout-core.entry.js +1 -1
  74. package/dist/esm/justifi-checkout.entry.js +6 -4
  75. package/dist/esm/justifi-details.entry.js +1 -1
  76. package/dist/esm/justifi-gross-payment-chart.entry.js +4 -2
  77. package/dist/esm/justifi-payment-details.entry.js +4 -2
  78. package/dist/esm/justifi-payment-form.entry.js +8 -6
  79. package/dist/esm/justifi-payment-method-form.entry.js +1 -1
  80. package/dist/esm/justifi-payment-provisioning-core.entry.js +1 -1
  81. package/dist/esm/justifi-payment-provisioning.entry.js +5 -3
  82. package/dist/esm/justifi-payments-list.entry.js +4 -2
  83. package/dist/esm/justifi-payout-details.entry.js +4 -2
  84. package/dist/esm/justifi-payouts-list.entry.js +4 -2
  85. package/dist/esm/justifi-refund-form.entry.js +2 -2
  86. package/dist/esm/justifi-season-interruption-insurance-core.entry.js +1 -1
  87. package/dist/esm/justifi-season-interruption-insurance.entry.js +5 -3
  88. package/dist/esm/loader.js +1 -1
  89. package/dist/esm/{package-0935c5e5.js → package-0e3cc41e.js} +3 -1
  90. package/dist/esm/payment-details-core.entry.js +1 -1
  91. package/dist/esm/payments-list-core.entry.js +15 -10
  92. package/dist/esm/payments-list-filters_2.entry.js +17261 -0
  93. package/dist/esm/payout-details-core.entry.js +2 -2
  94. package/dist/esm/payouts-list-core.entry.js +3 -3
  95. package/dist/esm/styled-host-3171ae1f.js +12 -0
  96. package/dist/esm/utils-3a4d8f3a.js +22 -0
  97. package/dist/esm/webcomponents.js +1 -1
  98. package/dist/module/check-pkg-version.js +22 -0
  99. package/dist/module/custom-popper.d.ts +11 -0
  100. package/dist/module/custom-popper.js +6 -0
  101. package/dist/module/custom-popper2.js +1912 -0
  102. package/dist/module/form-control-date2.js +7 -7
  103. package/dist/module/form-control-select2.js +9 -9
  104. package/dist/module/form-control-text2.js +7 -7
  105. package/dist/module/justifi-business-details.js +2 -0
  106. package/dist/module/justifi-business-form.js +3 -1
  107. package/dist/module/justifi-checkout.js +4 -2
  108. package/dist/module/justifi-gross-payment-chart.js +2 -0
  109. package/dist/module/justifi-payment-details.js +2 -0
  110. package/dist/module/justifi-payment-form.js +5 -3
  111. package/dist/module/justifi-payment-provisioning.js +3 -1
  112. package/dist/module/justifi-payments-list.js +42 -10
  113. package/dist/module/justifi-payout-details.js +2 -0
  114. package/dist/module/justifi-payouts-list.js +2 -0
  115. package/dist/module/justifi-refund-form.js +1 -1
  116. package/dist/module/justifi-season-interruption-insurance.js +3 -1
  117. package/dist/module/package.js +3 -1
  118. package/dist/module/payments-list-core2.js +51 -17
  119. package/dist/module/payments-list-filters.d.ts +11 -0
  120. package/dist/module/payments-list-filters.js +6 -0
  121. package/dist/module/payments-list-filters2.js +17294 -0
  122. package/dist/module/payout-details-core2.js +1 -1
  123. package/dist/module/payouts-list-core2.js +2 -2
  124. package/dist/module/styled-host.js +1 -1
  125. package/dist/module/table-filters-menu.d.ts +11 -0
  126. package/dist/module/table-filters-menu.js +6 -0
  127. package/dist/module/table-filters-menu2.js +80 -0
  128. package/dist/types/api/Payment.d.ts +8 -0
  129. package/dist/types/components/form/form-control-date.d.ts +4 -4
  130. package/dist/types/components/form/form-control-select.d.ts +6 -6
  131. package/dist/types/components/form/form-control-text.d.ts +4 -4
  132. package/dist/types/components/payments-list/payments-list-core.d.ts +6 -5
  133. package/dist/types/components/payments-list/payments-list-filters.d.ts +13 -0
  134. package/dist/types/components.d.ts +89 -10
  135. package/dist/types/ui-components/custom-popper/custom-popper.d.ts +21 -0
  136. package/dist/types/ui-components/filters/table-filters-menu.d.ts +11 -0
  137. package/dist/types/ui-components/filters/utils.d.ts +2 -0
  138. package/dist/types/utils/check-pkg-version.d.ts +1 -0
  139. package/dist/webcomponents/p-05718341.entry.js +1 -0
  140. package/dist/webcomponents/{p-b676bca5.entry.js → p-0de026dd.entry.js} +1 -1
  141. package/dist/webcomponents/p-0e84986e.entry.js +10 -0
  142. package/dist/webcomponents/p-1612894d.js +1 -0
  143. package/dist/webcomponents/p-20dafb46.entry.js +1 -0
  144. package/dist/webcomponents/p-2c51d29f.js +1 -0
  145. package/dist/webcomponents/p-3a1f19f3.entry.js +1 -0
  146. package/dist/webcomponents/{p-be39c802.entry.js → p-3c7fac29.entry.js} +1 -1
  147. package/dist/webcomponents/p-428e9b64.entry.js +1 -0
  148. package/dist/webcomponents/{p-edb62047.entry.js → p-430f81c6.entry.js} +1 -1
  149. package/dist/webcomponents/{p-4e017b58.js → p-437f9114.js} +1 -1
  150. package/dist/webcomponents/p-44055818.js +1 -0
  151. package/dist/webcomponents/{p-f5ebca3e.entry.js → p-4628cc9b.entry.js} +1 -1
  152. package/dist/webcomponents/p-4cc9df76.entry.js +1 -0
  153. package/dist/webcomponents/p-5540a47c.entry.js +1 -0
  154. package/dist/webcomponents/{p-fb58feb5.entry.js → p-570a0f02.entry.js} +1 -1
  155. package/dist/webcomponents/{p-c9f8f7ec.entry.js → p-59cf5391.entry.js} +1 -1
  156. package/dist/webcomponents/p-7bdffc78.entry.js +1 -0
  157. package/dist/webcomponents/p-7ddfce86.entry.js +1 -0
  158. package/dist/webcomponents/p-7fe67d7f.entry.js +1 -0
  159. package/dist/webcomponents/p-804c0f1f.entry.js +1 -0
  160. package/dist/webcomponents/p-8281f09a.js +1 -0
  161. package/dist/webcomponents/p-8921a478.entry.js +1 -0
  162. package/dist/webcomponents/p-8a7112a0.entry.js +1 -0
  163. package/dist/webcomponents/p-8c83b73e.entry.js +1 -0
  164. package/dist/webcomponents/p-8d03a7bd.entry.js +1 -0
  165. package/dist/webcomponents/{p-bd278ff4.entry.js → p-938bf2b4.entry.js} +1 -1
  166. package/dist/webcomponents/p-9b154d98.entry.js +1 -0
  167. package/dist/webcomponents/{p-4e01fec8.entry.js → p-b14da2fd.entry.js} +1 -1
  168. package/dist/webcomponents/{p-124c1ecd.entry.js → p-bdc91c61.entry.js} +1 -1
  169. package/dist/webcomponents/{p-487b72a8.entry.js → p-c64ce69d.entry.js} +1 -1
  170. package/dist/webcomponents/p-dbc1d7b3.entry.js +1 -0
  171. package/dist/webcomponents/p-eea79a55.entry.js +1 -0
  172. package/dist/webcomponents/{p-b6c3b7bc.entry.js → p-f6a2dc78.entry.js} +1 -1
  173. package/dist/webcomponents/webcomponents.esm.js +1 -1
  174. package/package.json +3 -1
  175. package/dist/cjs/styled-host-cc053016.js +0 -14
  176. package/dist/esm/styled-host-ab9da520.js +0 -12
  177. package/dist/webcomponents/p-07109641.entry.js +0 -1
  178. package/dist/webcomponents/p-11b6ed0c.entry.js +0 -1
  179. package/dist/webcomponents/p-15976984.entry.js +0 -1
  180. package/dist/webcomponents/p-1cf90026.entry.js +0 -1
  181. package/dist/webcomponents/p-3423ddfd.entry.js +0 -1
  182. package/dist/webcomponents/p-39c6f36a.entry.js +0 -1
  183. package/dist/webcomponents/p-421ed39d.entry.js +0 -1
  184. package/dist/webcomponents/p-69c18f39.entry.js +0 -1
  185. package/dist/webcomponents/p-6abb2a04.entry.js +0 -1
  186. package/dist/webcomponents/p-721dcf51.entry.js +0 -1
  187. package/dist/webcomponents/p-817da23c.entry.js +0 -1
  188. package/dist/webcomponents/p-a99032e1.entry.js +0 -1
  189. package/dist/webcomponents/p-ba4bae6f.js +0 -1
  190. package/dist/webcomponents/p-d4a44a1e.entry.js +0 -1
  191. package/dist/webcomponents/p-d78eb6ce.js +0 -1
  192. package/dist/webcomponents/p-e2b2213f.entry.js +0 -1
  193. package/dist/webcomponents/p-e7fd1357.entry.js +0 -1
  194. package/dist/webcomponents/p-eccf2e8e.entry.js +0 -1
@@ -0,0 +1,239 @@
1
+ import { h } from "@stencil/core";
2
+ import { createPopper } from "@popperjs/core";
3
+ export class CustomPopper {
4
+ constructor() {
5
+ this.placement = 'bottom';
6
+ this.offset = [0, 10];
7
+ this.strategy = 'absolute';
8
+ this.trigger = 'click';
9
+ this.anchorRef = undefined;
10
+ this.isOpen = false;
11
+ }
12
+ componentDidLoad() {
13
+ this.popperInstance = createPopper(this.anchorRef, this.popperContentRef, this.popperOptions);
14
+ if (this.trigger === 'click') {
15
+ window.addEventListener('click', this.handleClick.bind(this));
16
+ }
17
+ else if (this.trigger === 'hover') {
18
+ this.anchorRef.addEventListener('mouseenter', this.show.bind(this));
19
+ this.anchorRef.addEventListener('mouseleave', this.hide.bind(this));
20
+ this.popperContentRef.addEventListener('mouseenter', this.show.bind(this));
21
+ this.popperContentRef.addEventListener('mouseleave', this.hide.bind(this));
22
+ }
23
+ else if (this.trigger === 'focus') {
24
+ this.anchorRef.addEventListener('focus', this.show.bind(this));
25
+ this.anchorRef.addEventListener('blur', this.hide.bind(this));
26
+ }
27
+ }
28
+ disconnectedCallback() {
29
+ if (this.trigger === 'click') {
30
+ window.removeEventListener('click', this.handleClick.bind(this));
31
+ }
32
+ else if (this.trigger === 'hover') {
33
+ this.anchorRef.removeEventListener('mouseenter', this.show.bind(this));
34
+ this.anchorRef.removeEventListener('mouseleave', this.hide.bind(this));
35
+ this.popperContentRef.removeEventListener('mouseenter', this.show.bind(this));
36
+ this.popperContentRef.removeEventListener('mouseleave', this.hide.bind(this));
37
+ }
38
+ else if (this.trigger === 'focus') {
39
+ this.anchorRef.removeEventListener('focus', this.show.bind(this));
40
+ this.anchorRef.removeEventListener('blur', this.hide.bind(this));
41
+ }
42
+ }
43
+ handleClick(event) {
44
+ const path = event.composedPath();
45
+ const isAnchorClicked = path.includes(this.anchorRef);
46
+ const isPopperContentClicked = path.includes(this.popperContentRef);
47
+ if (!this.isOpen && isAnchorClicked) {
48
+ this.show();
49
+ }
50
+ else if (this.isOpen && !isPopperContentClicked) {
51
+ this.hide();
52
+ }
53
+ else if (this.isOpen && isAnchorClicked) {
54
+ this.hide();
55
+ }
56
+ }
57
+ get popperOptions() {
58
+ return {
59
+ placement: this.placement,
60
+ modifiers: [
61
+ {
62
+ name: 'offset',
63
+ options: {
64
+ offset: this.offset,
65
+ },
66
+ },
67
+ ],
68
+ strategy: this.strategy,
69
+ };
70
+ }
71
+ show() {
72
+ this.isOpen = true;
73
+ this.popperContentRef.setAttribute('data-show', '');
74
+ this.popperInstance.update();
75
+ this.showEvent.emit();
76
+ }
77
+ hide() {
78
+ this.isOpen = false;
79
+ this.popperContentRef.removeAttribute('data-show');
80
+ this.popperInstance.update();
81
+ this.hideEvent.emit();
82
+ }
83
+ render() {
84
+ return (h("div", { key: '2fd0d1c55f982d9882b17f26c1e997de8de53768' }, h("style", { key: 'ae7fb7b0eae12cfcea357299b6457f523831ac12' }, `
85
+ .popper-content {
86
+ display: none;
87
+ }
88
+ .popper-content[data-show] {
89
+ display: block;
90
+ z-index: 1030;
91
+ }
92
+ `), h("div", { key: '2c747dff168ef5e84642d5c490ffa4e8fc5c2350', class: "popper-content", ref: (el) => this.popperContentRef = el }, h("slot", { key: '720f23f2a51da2bb9de5c17d7a548d5ddf90ea53' }))));
93
+ }
94
+ static get is() { return "custom-popper"; }
95
+ static get properties() {
96
+ return {
97
+ "placement": {
98
+ "type": "string",
99
+ "mutable": false,
100
+ "complexType": {
101
+ "original": "Placement",
102
+ "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\"",
103
+ "references": {
104
+ "Placement": {
105
+ "location": "import",
106
+ "path": "@popperjs/core",
107
+ "id": "../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/index.d.ts::Placement"
108
+ }
109
+ }
110
+ },
111
+ "required": false,
112
+ "optional": false,
113
+ "docs": {
114
+ "tags": [],
115
+ "text": ""
116
+ },
117
+ "attribute": "placement",
118
+ "reflect": false,
119
+ "defaultValue": "'bottom'"
120
+ },
121
+ "offset": {
122
+ "type": "unknown",
123
+ "mutable": false,
124
+ "complexType": {
125
+ "original": "[number, number]",
126
+ "resolved": "[number, number]",
127
+ "references": {}
128
+ },
129
+ "required": false,
130
+ "optional": false,
131
+ "docs": {
132
+ "tags": [],
133
+ "text": ""
134
+ },
135
+ "defaultValue": "[0, 10]"
136
+ },
137
+ "strategy": {
138
+ "type": "string",
139
+ "mutable": false,
140
+ "complexType": {
141
+ "original": "PositioningStrategy",
142
+ "resolved": "\"absolute\" | \"fixed\"",
143
+ "references": {
144
+ "PositioningStrategy": {
145
+ "location": "import",
146
+ "path": "@popperjs/core",
147
+ "id": "../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/index.d.ts::PositioningStrategy"
148
+ }
149
+ }
150
+ },
151
+ "required": false,
152
+ "optional": false,
153
+ "docs": {
154
+ "tags": [],
155
+ "text": ""
156
+ },
157
+ "attribute": "strategy",
158
+ "reflect": false,
159
+ "defaultValue": "'absolute'"
160
+ },
161
+ "trigger": {
162
+ "type": "string",
163
+ "mutable": false,
164
+ "complexType": {
165
+ "original": "string",
166
+ "resolved": "string",
167
+ "references": {}
168
+ },
169
+ "required": false,
170
+ "optional": false,
171
+ "docs": {
172
+ "tags": [],
173
+ "text": ""
174
+ },
175
+ "attribute": "trigger",
176
+ "reflect": false,
177
+ "defaultValue": "'click'"
178
+ },
179
+ "anchorRef": {
180
+ "type": "unknown",
181
+ "mutable": false,
182
+ "complexType": {
183
+ "original": "HTMLElement",
184
+ "resolved": "HTMLElement",
185
+ "references": {
186
+ "HTMLElement": {
187
+ "location": "global",
188
+ "id": "global::HTMLElement"
189
+ }
190
+ }
191
+ },
192
+ "required": false,
193
+ "optional": false,
194
+ "docs": {
195
+ "tags": [],
196
+ "text": ""
197
+ }
198
+ }
199
+ };
200
+ }
201
+ static get states() {
202
+ return {
203
+ "isOpen": {}
204
+ };
205
+ }
206
+ static get events() {
207
+ return [{
208
+ "method": "showEvent",
209
+ "name": "showEvent",
210
+ "bubbles": true,
211
+ "cancelable": true,
212
+ "composed": true,
213
+ "docs": {
214
+ "tags": [],
215
+ "text": ""
216
+ },
217
+ "complexType": {
218
+ "original": "any",
219
+ "resolved": "any",
220
+ "references": {}
221
+ }
222
+ }, {
223
+ "method": "hideEvent",
224
+ "name": "hideEvent",
225
+ "bubbles": true,
226
+ "cancelable": true,
227
+ "composed": true,
228
+ "docs": {
229
+ "tags": [],
230
+ "text": ""
231
+ },
232
+ "complexType": {
233
+ "original": "any",
234
+ "resolved": "any",
235
+ "references": {}
236
+ }
237
+ }];
238
+ }
239
+ }
@@ -0,0 +1,89 @@
1
+ import { h } from "@stencil/core";
2
+ import { Button } from "../button";
3
+ import { hasFilters } from "./utils";
4
+ export class TableFiltersMenu {
5
+ constructor() {
6
+ this.anchorButton = undefined;
7
+ this.menu = undefined;
8
+ this.showClearButton = false;
9
+ this.params = undefined;
10
+ this.clearParams = undefined;
11
+ }
12
+ watchParamsHandler(newValue) {
13
+ this.showClearButton = hasFilters(newValue);
14
+ }
15
+ show() {
16
+ this.menu.classList.add('show');
17
+ }
18
+ hide() {
19
+ this.menu.classList.remove('show');
20
+ }
21
+ render() {
22
+ return (h("div", { key: '26c76e4989db63505bbb6d4ecfed10f964839c73', class: "d-flex gap-2" }, h("div", { key: '5b9b28d3c1daeb5c38fd5f2fb2529e8251f6d193', class: "dropdown pb-3" }, h(Button, { key: '45adcccffe23b4d357f0870f961eecfa0a8b3199', variant: "primary", type: "button dropdown-toggle", ref: (el) => (this.anchorButton = el), class: "btn btn-primary dropdown-toggle", "data-test-id": "open-filters-button", "data-bs-toggle": "dropdown" }, "Filters"), h("custom-popper", { key: '8f381f3db3956a642107bba64f2a2a4370bae2cf', offset: [20, 10], strategy: "fixed", anchorRef: this.anchorButton, trigger: "click" }, h("form", { key: '8e5cb0a64848e0720732fc95206deaf56ca338c9', class: "dropdown-menu", part: "dropdown-menu", "data-test-id": "filter-menu", ref: (el) => (this.menu = el), onSubmit: (e) => e.preventDefault() }, h("slot", { key: 'a102749963913d0a58e0210ea9c3bf3d4a14c1f3' })))), h("div", { key: 'ac38e6b46ce79967e66da4d40c0778df0b07e1a6' }, h(Button, { key: '2c8ef6ff571121b8cab1b17f2ac7035792f1d7f4', variant: "secondary", onClick: () => this.clearParams(), hidden: !this.showClearButton, "data-test-id": "clear-filters-button" }, "Clear Filters"))));
23
+ }
24
+ static get is() { return "table-filters-menu"; }
25
+ static get properties() {
26
+ return {
27
+ "params": {
28
+ "type": "any",
29
+ "mutable": false,
30
+ "complexType": {
31
+ "original": "any",
32
+ "resolved": "any",
33
+ "references": {}
34
+ },
35
+ "required": false,
36
+ "optional": false,
37
+ "docs": {
38
+ "tags": [],
39
+ "text": ""
40
+ },
41
+ "attribute": "params",
42
+ "reflect": false
43
+ },
44
+ "clearParams": {
45
+ "type": "unknown",
46
+ "mutable": false,
47
+ "complexType": {
48
+ "original": "() => void",
49
+ "resolved": "() => void",
50
+ "references": {}
51
+ },
52
+ "required": false,
53
+ "optional": false,
54
+ "docs": {
55
+ "tags": [],
56
+ "text": ""
57
+ }
58
+ }
59
+ };
60
+ }
61
+ static get states() {
62
+ return {
63
+ "anchorButton": {},
64
+ "menu": {},
65
+ "showClearButton": {}
66
+ };
67
+ }
68
+ static get watchers() {
69
+ return [{
70
+ "propName": "params",
71
+ "methodName": "watchParamsHandler"
72
+ }];
73
+ }
74
+ static get listeners() {
75
+ return [{
76
+ "name": "showEvent",
77
+ "method": "show",
78
+ "target": undefined,
79
+ "capture": false,
80
+ "passive": false
81
+ }, {
82
+ "name": "hideEvent",
83
+ "method": "hide",
84
+ "target": undefined,
85
+ "capture": false,
86
+ "passive": false
87
+ }];
88
+ }
89
+ }
@@ -0,0 +1,20 @@
1
+ export const onFilterChange = (newFilters, params) => {
2
+ let newParams = Object.assign({}, params);
3
+ delete newParams.before_cursor;
4
+ delete newParams.after_cursor;
5
+ Object.keys(newFilters).forEach((key) => {
6
+ if (newFilters[key].length) {
7
+ newParams[key] = newFilters[key];
8
+ }
9
+ else {
10
+ delete newParams[key];
11
+ }
12
+ });
13
+ return newParams;
14
+ };
15
+ export const hasFilters = (params) => {
16
+ const paginationKeys = ['after_cursor', 'before_cursor'];
17
+ const paramKeys = Object.keys(params);
18
+ const filterKeys = paramKeys.filter((paramKey) => !paginationKeys.includes(paramKey));
19
+ return !!filterKeys.length;
20
+ };
@@ -0,0 +1,19 @@
1
+ import packageJson from "../../package.json";
2
+ const latestVersion = async (packageName) => {
3
+ const response = await fetch('https://registry.npmjs.org/' + packageName + '/latest');
4
+ const json = await response.json();
5
+ return json.version;
6
+ };
7
+ export const checkPkgVersion = async () => {
8
+ const version = packageJson.version;
9
+ const packageName = packageJson.name;
10
+ const latest = await latestVersion(packageName);
11
+ // remove rc from version and everything that comes after -rc
12
+ const latestNotRC = latest.replace(/-rc.*/, '');
13
+ // checkif there's a major version difference
14
+ const versionParts = version.split('.');
15
+ const latestParts = latest.split('.');
16
+ if (versionParts[0] !== latestParts[0]) {
17
+ console.warn(`The package ${packageName} is out of date. The latest version is ${latestNotRC}. Please update.`);
18
+ }
19
+ };