@justifi/webcomponents 4.19.3 → 4.20.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.
- package/dist/cjs/{Analytics-a0a86d82.js → Analytics-3c89cfb4.js} +1 -1
- package/dist/cjs/business-details-core.cjs.entry.js +1 -1
- package/dist/cjs/check-pkg-version-4fa0367d.js +24 -0
- package/dist/cjs/custom-popper.cjs.entry.js +1894 -0
- package/dist/cjs/form-control-date_3.cjs.entry.js +4 -4
- package/dist/cjs/form-control-error-text_4.cjs.entry.js +9 -9
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-billing-form_2.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-details.cjs.entry.js +4 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +6 -4
- package/dist/cjs/justifi-card-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +1 -1
- package/dist/cjs/justifi-checkout.cjs.entry.js +6 -4
- package/dist/cjs/justifi-details.cjs.entry.js +1 -1
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +4 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +5 -3
- package/dist/cjs/justifi-payment-form.cjs.entry.js +8 -6
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +5 -3
- package/dist/cjs/justifi-payments-list.cjs.entry.js +12 -8
- package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +4 -2
- package/dist/cjs/justifi-refund-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-season-interruption-insurance-core.cjs.entry.js +1 -1
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +5 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-99f4d813.js → package-3a9ac89d.js} +3 -1
- package/dist/cjs/payment-details-core.cjs.entry.js +1 -1
- package/dist/cjs/{payment.service-4b1c0a20.js → payment.service-47e2d84e.js} +5 -2
- package/dist/cjs/payments-list-core.cjs.entry.js +18 -13
- package/dist/cjs/payments-list-filters_2.cjs.entry.js +17266 -0
- package/dist/cjs/payout-details-core.cjs.entry.js +2 -2
- package/dist/cjs/payouts-list-core.cjs.entry.js +3 -3
- package/dist/cjs/styled-host-9e0b67b3.js +14 -0
- package/dist/cjs/utils-f8a6962c.js +25 -0
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/services/payment.service.js +5 -2
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/business-details/business-details.js +2 -0
- package/dist/collection/components/business-forms/business-form/business-form.js +3 -1
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +3 -1
- package/dist/collection/components/checkout/checkout.js +4 -2
- package/dist/collection/components/form/form-control-date.js +26 -28
- package/dist/collection/components/form/form-control-select.js +45 -45
- package/dist/collection/components/form/form-control-text.js +34 -34
- package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +2 -0
- package/dist/collection/components/insurance/season-interruption/season-interruption-insurance.js +3 -1
- package/dist/collection/components/payment-details/payment-details.js +2 -0
- package/dist/collection/components/payment-form/payment-form.js +5 -3
- package/dist/collection/components/payments-list/get-payments.js +2 -2
- package/dist/collection/components/payments-list/payments-list-core.js +14 -9
- package/dist/collection/components/payments-list/payments-list-filters.js +84 -0
- package/dist/collection/components/payments-list/payments-list.js +25 -2
- package/dist/collection/components/payout-details/payout-details-core.js +1 -1
- package/dist/collection/components/payout-details/payout-details.js +2 -0
- package/dist/collection/components/payouts-list/payouts-list-core.js +2 -2
- package/dist/collection/components/payouts-list/payouts-list.js +2 -0
- package/dist/collection/components/refund-form/refund-form.js +1 -1
- package/dist/collection/ui-components/custom-popper/custom-popper.js +239 -0
- package/dist/collection/ui-components/filters/table-filters-menu.js +89 -0
- package/dist/collection/ui-components/filters/utils.js +20 -0
- package/dist/collection/utils/check-pkg-version.js +19 -0
- package/dist/docs.json +545 -19
- package/dist/esm/{Analytics-e460ab05.js → Analytics-b0f6936a.js} +1 -1
- package/dist/esm/business-details-core.entry.js +1 -1
- package/dist/esm/check-pkg-version-10cadb08.js +22 -0
- package/dist/esm/custom-popper.entry.js +1890 -0
- package/dist/esm/form-control-date_3.entry.js +4 -4
- package/dist/esm/form-control-error-text_4.entry.js +9 -9
- package/dist/esm/justifi-bank-account-form.entry.js +2 -2
- package/dist/esm/justifi-billing-form_2.entry.js +1 -1
- package/dist/esm/justifi-business-details.entry.js +4 -2
- package/dist/esm/justifi-business-form.entry.js +6 -4
- package/dist/esm/justifi-card-form.entry.js +2 -2
- package/dist/esm/justifi-checkout-core.entry.js +1 -1
- package/dist/esm/justifi-checkout.entry.js +6 -4
- package/dist/esm/justifi-details.entry.js +1 -1
- package/dist/esm/justifi-gross-payment-chart.entry.js +4 -2
- package/dist/esm/justifi-payment-details.entry.js +5 -3
- package/dist/esm/justifi-payment-form.entry.js +8 -6
- package/dist/esm/justifi-payment-method-form.entry.js +1 -1
- package/dist/esm/justifi-payment-provisioning-core.entry.js +1 -1
- package/dist/esm/justifi-payment-provisioning.entry.js +5 -3
- package/dist/esm/justifi-payments-list.entry.js +12 -8
- package/dist/esm/justifi-payout-details.entry.js +4 -2
- package/dist/esm/justifi-payouts-list.entry.js +4 -2
- package/dist/esm/justifi-refund-form.entry.js +2 -2
- package/dist/esm/justifi-season-interruption-insurance-core.entry.js +1 -1
- package/dist/esm/justifi-season-interruption-insurance.entry.js +5 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-0935c5e5.js → package-2ef16e2c.js} +3 -1
- package/dist/esm/payment-details-core.entry.js +1 -1
- package/dist/esm/{payment.service-02c596b9.js → payment.service-21a3e2d3.js} +5 -2
- package/dist/esm/payments-list-core.entry.js +15 -10
- package/dist/esm/payments-list-filters_2.entry.js +17261 -0
- package/dist/esm/payout-details-core.entry.js +2 -2
- package/dist/esm/payouts-list-core.entry.js +3 -3
- package/dist/esm/styled-host-3171ae1f.js +12 -0
- package/dist/esm/utils-3a4d8f3a.js +22 -0
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/check-pkg-version.js +22 -0
- package/dist/module/custom-popper.d.ts +11 -0
- package/dist/module/custom-popper.js +6 -0
- package/dist/module/custom-popper2.js +1912 -0
- package/dist/module/form-control-date2.js +7 -7
- package/dist/module/form-control-select2.js +9 -9
- package/dist/module/form-control-text2.js +7 -7
- package/dist/module/justifi-business-details.js +2 -0
- package/dist/module/justifi-business-form.js +3 -1
- package/dist/module/justifi-checkout.js +4 -2
- package/dist/module/justifi-gross-payment-chart.js +2 -0
- package/dist/module/justifi-payment-details.js +2 -0
- package/dist/module/justifi-payment-form.js +5 -3
- package/dist/module/justifi-payment-provisioning.js +3 -1
- package/dist/module/justifi-payments-list.js +50 -14
- package/dist/module/justifi-payout-details.js +2 -0
- package/dist/module/justifi-payouts-list.js +2 -0
- package/dist/module/justifi-refund-form.js +1 -1
- package/dist/module/justifi-season-interruption-insurance.js +3 -1
- package/dist/module/package.js +3 -1
- package/dist/module/payment.service.js +5 -2
- package/dist/module/payments-list-core2.js +51 -17
- package/dist/module/payments-list-filters.d.ts +11 -0
- package/dist/module/payments-list-filters.js +6 -0
- package/dist/module/payments-list-filters2.js +17294 -0
- package/dist/module/payout-details-core2.js +1 -1
- package/dist/module/payouts-list-core2.js +2 -2
- package/dist/module/styled-host.js +1 -1
- package/dist/module/table-filters-menu.d.ts +11 -0
- package/dist/module/table-filters-menu.js +6 -0
- package/dist/module/table-filters-menu2.js +80 -0
- package/dist/types/api/Payment.d.ts +9 -0
- package/dist/types/api/services/payment.service.d.ts +2 -2
- package/dist/types/components/form/form-control-date.d.ts +4 -4
- package/dist/types/components/form/form-control-select.d.ts +6 -6
- package/dist/types/components/form/form-control-text.d.ts +4 -4
- package/dist/types/components/payments-list/get-payments.d.ts +2 -1
- package/dist/types/components/payments-list/payments-list-core.d.ts +6 -5
- package/dist/types/components/payments-list/payments-list-filters.d.ts +13 -0
- package/dist/types/components/payments-list/payments-list.d.ts +3 -2
- package/dist/types/components.d.ts +91 -10
- package/dist/types/ui-components/custom-popper/custom-popper.d.ts +21 -0
- package/dist/types/ui-components/filters/table-filters-menu.d.ts +11 -0
- package/dist/types/ui-components/filters/utils.d.ts +2 -0
- package/dist/types/utils/check-pkg-version.d.ts +1 -0
- package/dist/webcomponents/p-034fc302.entry.js +1 -0
- package/dist/webcomponents/{p-f5ebca3e.entry.js → p-1c04aacd.entry.js} +1 -1
- package/dist/webcomponents/{p-b676bca5.entry.js → p-232016ba.entry.js} +1 -1
- package/dist/webcomponents/p-2c51d29f.js +1 -0
- package/dist/webcomponents/p-35846553.js +1 -0
- package/dist/webcomponents/{p-bd278ff4.entry.js → p-37888614.entry.js} +1 -1
- package/dist/webcomponents/{p-be39c802.entry.js → p-3c7fac29.entry.js} +1 -1
- package/dist/webcomponents/{p-edb62047.entry.js → p-430f81c6.entry.js} +1 -1
- package/dist/webcomponents/p-44055818.js +1 -0
- package/dist/webcomponents/p-538fd427.entry.js +1 -0
- package/dist/webcomponents/{p-fb58feb5.entry.js → p-570a0f02.entry.js} +1 -1
- package/dist/webcomponents/p-57d7534f.entry.js +1 -0
- package/dist/webcomponents/{p-c9f8f7ec.entry.js → p-59cf5391.entry.js} +1 -1
- package/dist/webcomponents/p-60d3571e.entry.js +1 -0
- package/dist/webcomponents/{p-4e017b58.js → p-707bdf68.js} +1 -1
- package/dist/webcomponents/p-75139399.entry.js +1 -0
- package/dist/webcomponents/p-7771f64b.entry.js +1 -0
- package/dist/webcomponents/p-7ddfce86.entry.js +1 -0
- package/dist/webcomponents/p-8a7112a0.entry.js +1 -0
- package/dist/webcomponents/p-9add7d3e.entry.js +1 -0
- package/dist/webcomponents/p-9b154d98.entry.js +1 -0
- package/dist/webcomponents/p-ab92abb1.entry.js +1 -0
- package/dist/webcomponents/{p-4e01fec8.entry.js → p-b14da2fd.entry.js} +1 -1
- package/dist/webcomponents/p-b91bcbfc.js +1 -0
- package/dist/webcomponents/{p-124c1ecd.entry.js → p-bdc91c61.entry.js} +1 -1
- package/dist/webcomponents/{p-eccf2e8e.entry.js → p-c1772671.entry.js} +1 -1
- package/dist/webcomponents/{p-487b72a8.entry.js → p-c64ce69d.entry.js} +1 -1
- package/dist/webcomponents/{p-b6c3b7bc.entry.js → p-c740b6ca.entry.js} +1 -1
- package/dist/webcomponents/p-ce5fe369.entry.js +10 -0
- package/dist/webcomponents/p-d9579cd6.entry.js +1 -0
- package/dist/webcomponents/p-d99a5f30.entry.js +1 -0
- package/dist/webcomponents/p-dc048c3c.entry.js +1 -0
- package/dist/webcomponents/p-f2924369.js +1 -0
- package/dist/webcomponents/p-fb7f7a8c.entry.js +1 -0
- package/dist/webcomponents/p-ffddac99.entry.js +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +3 -1
- package/dist/cjs/styled-host-cc053016.js +0 -14
- package/dist/esm/styled-host-ab9da520.js +0 -12
- package/dist/webcomponents/p-07109641.entry.js +0 -1
- package/dist/webcomponents/p-11b6ed0c.entry.js +0 -1
- package/dist/webcomponents/p-15976984.entry.js +0 -1
- package/dist/webcomponents/p-1cf90026.entry.js +0 -1
- package/dist/webcomponents/p-3423ddfd.entry.js +0 -1
- package/dist/webcomponents/p-39c6f36a.entry.js +0 -1
- package/dist/webcomponents/p-421ed39d.entry.js +0 -1
- package/dist/webcomponents/p-69c18f39.entry.js +0 -1
- package/dist/webcomponents/p-6abb2a04.entry.js +0 -1
- package/dist/webcomponents/p-721dcf51.entry.js +0 -1
- package/dist/webcomponents/p-817da23c.entry.js +0 -1
- package/dist/webcomponents/p-a99032e1.entry.js +0 -1
- package/dist/webcomponents/p-ba4bae6f.js +0 -1
- package/dist/webcomponents/p-d4a44a1e.entry.js +0 -1
- package/dist/webcomponents/p-d78eb6ce.js +0 -1
- package/dist/webcomponents/p-e2b2213f.entry.js +0 -1
- package/dist/webcomponents/p-e3f4a2a6.js +0 -1
- package/dist/webcomponents/p-e7fd1357.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: 'ff19898ad40884372621978edd5a44aa4b0a3b53' }, h("style", { key: '9d1c65abf4971046c219312792d9836656dda63a' }, `
|
|
85
|
+
.popper-content {
|
|
86
|
+
display: none;
|
|
87
|
+
}
|
|
88
|
+
.popper-content[data-show] {
|
|
89
|
+
display: block;
|
|
90
|
+
z-index: 1030;
|
|
91
|
+
}
|
|
92
|
+
`), h("div", { key: '50d1dabe33b1b0a3d9c82e8fb68e2aef1e81e549', class: "popper-content", ref: (el) => this.popperContentRef = el }, h("slot", { key: '1d1eae013b2e61dd8285c014f388d2c2d68406c5' }))));
|
|
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: 'dd6aae6e43579e8f833b1f3f6a6227d2522d79ec', class: "d-flex gap-2" }, h("div", { key: '6decd268cf11d67c3f9e3c2b22e60cbdf328763a', class: "dropdown pb-3" }, h(Button, { key: 'af22247916f55da650da95006e3317316a4122f5', 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: '0516d664adf8feccb9dd9cb74023241867285bd6', offset: [20, 10], strategy: "fixed", anchorRef: this.anchorButton, trigger: "click" }, h("form", { key: 'd42f891b0b30fa152e03bfe3fbcb12da4707974b', class: "dropdown-menu", part: "dropdown-menu", "data-test-id": "filter-menu", ref: (el) => (this.menu = el), onSubmit: (e) => e.preventDefault() }, h("slot", { key: '77eb00715458275e6df23da973103046364f50aa' })))), h("div", { key: 'c9070c2d5ee453cf3a97908514877975c55813b8' }, h(Button, { key: '99b38ff5ac51ee21227832b2200f2dcdec40a70c', 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
|
+
};
|