@foxy.io/elements 1.50.0 → 1.52.0-beta.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/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-admin-transaction-card.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-billing-address-card.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +2 -2
- package/dist/cdn/foxy-client-card.js +1 -1
- package/dist/cdn/foxy-client-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
- package/dist/cdn/foxy-filter-attribute-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n-editor.js +1 -1
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-native-integration-card.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-card.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-card-embed.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +1 -195
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-container-card.js +1 -1
- package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-shipping-service-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-store-card.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-store-transaction-folder-card.js +1 -1
- package/dist/cdn/foxy-store-transaction-folder-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-template-set-card.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +7 -7
- package/dist/cdn/foxy-update-payment-method-form.js +1 -1
- package/dist/cdn/foxy-user-card.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-user-invitation-card.js +1 -1
- package/dist/cdn/foxy-user-invitation-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/{shared-490dadf8.js → shared-00b3766c.js} +1 -1
- package/dist/cdn/{shared-1301af85.js → shared-0378a2e7.js} +1 -1
- package/dist/cdn/{shared-67aeac0f.js → shared-058530fc.js} +1 -1
- package/dist/cdn/{shared-4dc0bd88.js → shared-05ee3727.js} +1 -1
- package/dist/cdn/{shared-bb2b7d41.js → shared-0f762c6f.js} +1 -1
- package/dist/cdn/{shared-6880e1f6.js → shared-0f92b865.js} +1 -1
- package/dist/cdn/{shared-021fbb51.js → shared-0fd68dc0.js} +2 -2
- package/dist/cdn/{shared-1fa1abbd.js → shared-11b28365.js} +1 -1
- package/dist/cdn/{shared-ddc1c32f.js → shared-1495abba.js} +1 -1
- package/dist/cdn/{shared-f7965314.js → shared-1597defa.js} +1 -1
- package/dist/cdn/{shared-084e1772.js → shared-1599feba.js} +1 -1
- package/dist/cdn/{shared-b0453b08.js → shared-19073761.js} +1 -1
- package/dist/cdn/{shared-8bf38c47.js → shared-1dc640ee.js} +1 -1
- package/dist/cdn/{shared-a9a8eb7c.js → shared-248965c0.js} +1 -1
- package/dist/cdn/{shared-9a454e09.js → shared-33a23cec.js} +1 -1
- package/dist/cdn/{shared-fc6e64a4.js → shared-377cce47.js} +2 -2
- package/dist/cdn/{shared-ee752063.js → shared-3eac4b7c.js} +1 -1
- package/dist/cdn/{shared-de4ec7bb.js → shared-436e1842.js} +1 -1
- package/dist/cdn/{shared-be071e3d.js → shared-515003f6.js} +1 -1
- package/dist/cdn/{shared-1492fa1c.js → shared-5d82169f.js} +1 -1
- package/dist/cdn/{shared-2a84ee72.js → shared-60497743.js} +1 -1
- package/dist/cdn/{shared-4cc1fb20.js → shared-609c9693.js} +1 -1
- package/dist/cdn/{shared-f05c924a.js → shared-62263428.js} +1 -1
- package/dist/cdn/{shared-0ea24ca2.js → shared-65094878.js} +1 -1
- package/dist/cdn/{shared-3c53446d.js → shared-6a0e1b94.js} +3 -3
- package/dist/cdn/{shared-8dd6e5cc.js → shared-6cdfb858.js} +1 -1
- package/dist/cdn/{shared-0a7a4660.js → shared-72511c81.js} +1 -1
- package/dist/cdn/{shared-3c0e3876.js → shared-7892fd3f.js} +4 -4
- package/dist/cdn/{shared-334b7e24.js → shared-80950330.js} +1 -1
- package/dist/cdn/{shared-bc8a1435.js → shared-81c78cb4.js} +1 -1
- package/dist/cdn/{shared-55fa26c2.js → shared-851a1b41.js} +1 -1
- package/dist/cdn/{shared-328aa161.js → shared-887ac0b0.js} +1 -1
- package/dist/cdn/{shared-591ee1bf.js → shared-8a428414.js} +1 -1
- package/dist/cdn/{shared-7a5d645f.js → shared-8d69329d.js} +1 -1
- package/dist/cdn/{shared-9a291941.js → shared-8d8975d5.js} +1 -1
- package/dist/cdn/{shared-f9bb0924.js → shared-8df8e77c.js} +1 -1
- package/dist/cdn/{shared-7c5881c1.js → shared-8efde31e.js} +1 -1
- package/dist/cdn/{shared-add0286c.js → shared-96207bb5.js} +1 -1
- package/dist/cdn/{shared-1da8110b.js → shared-9687ab7b.js} +1 -1
- package/dist/cdn/{shared-b0db52f7.js → shared-99c53365.js} +1 -1
- package/dist/cdn/{shared-d48e260f.js → shared-9a3bf65c.js} +1 -1
- package/dist/cdn/{shared-26b55da2.js → shared-9b35fe34.js} +1 -1
- package/dist/cdn/{shared-910d49eb.js → shared-a0baefff.js} +1 -1
- package/dist/cdn/{shared-ad470adf.js → shared-a20ef119.js} +2 -2
- package/dist/cdn/{shared-43fb8242.js → shared-a53bd0d6.js} +1 -1
- package/dist/cdn/{shared-ba43928a.js → shared-a5d6db21.js} +1 -1
- package/dist/cdn/{shared-d01853e2.js → shared-a6f696b9.js} +1 -1
- package/dist/cdn/shared-af6ccc54.js +1 -0
- package/dist/cdn/{shared-a18827a4.js → shared-afdf7b0c.js} +1 -1
- package/dist/cdn/shared-b1fa9899.js +1 -0
- package/dist/cdn/{shared-5fbbaea2.js → shared-b5e048f5.js} +1 -1
- package/dist/cdn/{shared-83613f15.js → shared-b948488a.js} +1 -1
- package/dist/cdn/{shared-31e75a4a.js → shared-ce05e482.js} +1 -1
- package/dist/cdn/shared-ce7777ce.js +1 -0
- package/dist/cdn/{shared-aa258319.js → shared-d14a664a.js} +1 -1
- package/dist/cdn/{shared-18e301f2.js → shared-db623837.js} +1 -1
- package/dist/cdn/{shared-47ce4456.js → shared-e2d843ca.js} +1 -1
- package/dist/cdn/{shared-68c69a0f.js → shared-e3c62f45.js} +1 -1
- package/dist/cdn/shared-e650caf3.js +1 -0
- package/dist/cdn/{shared-d74aac59.js → shared-ec015a24.js} +1 -1
- package/dist/cdn/{shared-462566b0.js → shared-f1588331.js} +1 -1
- package/dist/cdn/{shared-8f61408a.js → shared-f4f01846.js} +1 -1
- package/dist/cdn/{shared-097487d0.js → shared-f8e360e6.js} +1 -1
- package/dist/cdn/{shared-7e1a3361.js → shared-f9e4a1cc.js} +1 -1
- package/dist/cdn/{shared-986bcd05.js → shared-fa977775.js} +1 -1
- package/dist/cdn/{shared-e9d87207.js → shared-faa174b6.js} +1 -1
- package/dist/cdn/translations/admin-subscription-form/en.json +64 -9
- package/dist/cdn/translations/cart-form/en.json +64 -9
- package/dist/cdn/translations/item-form/en.json +64 -9
- package/dist/cdn/translations/report-form/en.json +83 -33
- package/dist/cdn/translations/reports-table/en.json +1 -0
- package/dist/cdn/translations/transaction/en.json +64 -9
- package/dist/elements/internal/InternalNativeDateControl/InternalNativeDateControl.d.ts +18 -0
- package/dist/elements/internal/InternalNativeDateControl/InternalNativeDateControl.js +109 -0
- package/dist/elements/internal/InternalNativeDateControl/InternalNativeDateControl.js.map +1 -0
- package/dist/elements/internal/InternalNativeDateControl/index.d.ts +3 -0
- package/dist/elements/internal/InternalNativeDateControl/index.js +5 -0
- package/dist/elements/internal/InternalNativeDateControl/index.js.map +1 -0
- package/dist/elements/public/ItemForm/ItemForm.d.ts +3 -0
- package/dist/elements/public/ItemForm/ItemForm.js +79 -4
- package/dist/elements/public/ItemForm/ItemForm.js.map +1 -1
- package/dist/elements/public/ItemForm/index.d.ts +3 -0
- package/dist/elements/public/ItemForm/index.js +3 -0
- package/dist/elements/public/ItemForm/index.js.map +1 -1
- package/dist/elements/public/ReportForm/ReportForm.d.ts +20 -18
- package/dist/elements/public/ReportForm/ReportForm.js +126 -339
- package/dist/elements/public/ReportForm/ReportForm.js.map +1 -1
- package/dist/elements/public/ReportForm/index.d.ts +5 -9
- package/dist/elements/public/ReportForm/index.js +5 -9
- package/dist/elements/public/ReportForm/index.js.map +1 -1
- package/dist/elements/public/ReportForm/utils.d.ts +1 -0
- package/dist/elements/public/ReportForm/utils.js +4 -0
- package/dist/elements/public/ReportForm/utils.js.map +1 -1
- package/dist/mixins/themeable.js +4 -8
- package/dist/mixins/themeable.js.map +1 -1
- package/dist/utils/safe-date.js +7 -1
- package/dist/utils/safe-date.js.map +1 -1
- package/package.json +2 -2
- package/dist/cdn/shared-04277241.js +0 -1
- package/dist/cdn/shared-200aa12d.js +0 -1
- package/dist/cdn/shared-56a16e03.js +0 -1
- package/dist/cdn/shared-e6c743bd.js +0 -1
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { PropertyDeclarations, TemplateResult } from 'lit-element';
|
|
2
|
+
import type { Data } from './types';
|
|
3
|
+
import { BooleanSelector } from '@foxy.io/sdk/core';
|
|
4
|
+
import { InternalForm } from '../../internal/InternalForm/InternalForm';
|
|
5
5
|
import { NucleonV8N } from '../NucleonElement/types';
|
|
6
|
-
declare const Base: typeof
|
|
6
|
+
declare const Base: typeof InternalForm & import("lit-element").Constructor<import("../../../mixins/translatable").TranslatableMixinHost> & {
|
|
7
7
|
defaultNS: string;
|
|
8
|
-
}
|
|
9
|
-
styles: import("lit-element").CSSResultArray;
|
|
10
|
-
} & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/src/types").ScopedElementsHost>;
|
|
8
|
+
};
|
|
11
9
|
/**
|
|
12
10
|
* Form element for creating or editing reports (`fx:report`).
|
|
13
11
|
*
|
|
@@ -15,18 +13,22 @@ declare const Base: typeof NucleonElement & import("lit-element").Constructor<im
|
|
|
15
13
|
* @since 1.16.0
|
|
16
14
|
*/
|
|
17
15
|
export declare class ReportForm extends Base<Data> {
|
|
18
|
-
static get scopedElements(): ScopedElementsMap;
|
|
19
16
|
static get properties(): PropertyDeclarations;
|
|
20
17
|
static get v8n(): NucleonV8N<Data>;
|
|
21
18
|
private __showRangeTime;
|
|
22
|
-
|
|
23
|
-
private
|
|
24
|
-
private
|
|
25
|
-
private
|
|
26
|
-
private
|
|
27
|
-
private
|
|
28
|
-
private
|
|
29
|
-
private
|
|
30
|
-
private
|
|
19
|
+
private readonly __rawPresetOptions;
|
|
20
|
+
private readonly __presetOptions;
|
|
21
|
+
private readonly __nameOptions;
|
|
22
|
+
private readonly __datetimePreciseGetValue;
|
|
23
|
+
private readonly __datetimePreciseSetValue;
|
|
24
|
+
private readonly __datetimeStartGetValue;
|
|
25
|
+
private readonly __datetimeStartSetValue;
|
|
26
|
+
private readonly __datetimeEndGetValue;
|
|
27
|
+
private readonly __datetimeEndSetValue;
|
|
28
|
+
private readonly __presetGetValue;
|
|
29
|
+
private readonly __presetSetValue;
|
|
30
|
+
get readonlySelector(): BooleanSelector;
|
|
31
|
+
get hiddenSelector(): BooleanSelector;
|
|
32
|
+
renderBody(): TemplateResult;
|
|
31
33
|
}
|
|
32
34
|
export {};
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { html } from 'lit-element';
|
|
3
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
4
|
-
import { getCurrentMonth, getCurrentQuarter, getCurrentYear, getLast30Days, getLast365Days, getPreviousMonth, getPreviousQuarter, getPreviousYear, toAPIDateTime, toDatePickerValue, toDateTimePickerValue, } from "./utils.js";
|
|
5
|
-
import { ChoiceChangeEvent } from "../../private/Choice/ChoiceChangeEvent.js";
|
|
6
|
-
import { ConfigurableMixin } from "../../../mixins/configurable.js";
|
|
7
|
-
import { NucleonElement } from "../NucleonElement/NucleonElement.js";
|
|
8
|
-
import { ResponsiveMixin } from "../../../mixins/responsive.js";
|
|
9
|
-
import { ThemeableMixin } from "../../../mixins/themeable.js";
|
|
1
|
+
import { getCurrentMonth, getCurrentQuarter, getCurrentYear, getLast30Days, getLast365Days, getPreviousMonth, getPreviousQuarter, getPreviousYear, toAPIDateTime, toDatePickerValue, toNativeDateTimePickerValue, } from "./utils.js";
|
|
10
2
|
import { TranslatableMixin } from "../../../mixins/translatable.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
const Base = ScopedElementsMixin(ResponsiveMixin(ThemeableMixin(ConfigurableMixin(TranslatableMixin(NucleonElement, 'report-form')))));
|
|
3
|
+
import { BooleanSelector } from '@foxy.io/sdk/core';
|
|
4
|
+
import { InternalForm } from "../../internal/InternalForm/InternalForm.js";
|
|
5
|
+
import { html } from 'lit-element';
|
|
6
|
+
const Base = TranslatableMixin(InternalForm, 'report-form');
|
|
16
7
|
/**
|
|
17
8
|
* Form element for creating or editing reports (`fx:report`).
|
|
18
9
|
*
|
|
@@ -23,21 +14,73 @@ export class ReportForm extends Base {
|
|
|
23
14
|
constructor() {
|
|
24
15
|
super(...arguments);
|
|
25
16
|
this.__showRangeTime = false;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
'
|
|
39
|
-
|
|
40
|
-
|
|
17
|
+
this.__rawPresetOptions = [
|
|
18
|
+
{ value: '0', label: 'option_previous_quarter', ...getPreviousQuarter() },
|
|
19
|
+
{ value: '1', label: 'option_previous_month', ...getPreviousMonth() },
|
|
20
|
+
{ value: '2', label: 'option_previous_year', ...getPreviousYear() },
|
|
21
|
+
{ value: '3', label: 'option_this_quarter', ...getCurrentQuarter() },
|
|
22
|
+
{ value: '4', label: 'option_this_month', ...getCurrentMonth() },
|
|
23
|
+
{ value: '5', label: 'option_this_year', ...getCurrentYear() },
|
|
24
|
+
{ value: '6', label: 'option_last_365_days', ...getLast365Days() },
|
|
25
|
+
{ value: '7', label: 'option_last_30_days', ...getLast30Days() },
|
|
26
|
+
];
|
|
27
|
+
this.__presetOptions = JSON.stringify([
|
|
28
|
+
...this.__rawPresetOptions,
|
|
29
|
+
{ value: 'custom', label: 'option_custom' },
|
|
30
|
+
]);
|
|
31
|
+
this.__nameOptions = JSON.stringify([
|
|
32
|
+
{ value: 'complete', label: 'option_complete' },
|
|
33
|
+
{ value: 'customers', label: 'option_customers' },
|
|
34
|
+
{ value: 'customers_ltv', label: 'option_customers_ltv' },
|
|
35
|
+
{ value: 'transactions', label: 'option_transactions' },
|
|
36
|
+
]);
|
|
37
|
+
this.__datetimePreciseGetValue = () => {
|
|
38
|
+
return this.__showRangeTime;
|
|
39
|
+
};
|
|
40
|
+
this.__datetimePreciseSetValue = (value) => {
|
|
41
|
+
this.__showRangeTime = value;
|
|
42
|
+
};
|
|
43
|
+
this.__datetimeStartGetValue = () => {
|
|
44
|
+
const value = this.form.datetime_start;
|
|
45
|
+
return value
|
|
46
|
+
? this.__showRangeTime || this.data
|
|
47
|
+
? toNativeDateTimePickerValue(value)
|
|
48
|
+
: toDatePickerValue(value)
|
|
49
|
+
: '';
|
|
50
|
+
};
|
|
51
|
+
this.__datetimeStartSetValue = (value) => {
|
|
52
|
+
var _a;
|
|
53
|
+
const time = this.__showRangeTime ? `${(_a = value.split('T')[1]) !== null && _a !== void 0 ? _a : '00:00'}:00` : '00:00:00';
|
|
54
|
+
this.edit({ datetime_start: `${value.split('T')[0]}T${time}` });
|
|
55
|
+
};
|
|
56
|
+
this.__datetimeEndGetValue = () => {
|
|
57
|
+
const value = this.form.datetime_end;
|
|
58
|
+
return value
|
|
59
|
+
? this.__showRangeTime || this.data
|
|
60
|
+
? toNativeDateTimePickerValue(value)
|
|
61
|
+
: toDatePickerValue(value)
|
|
62
|
+
: '';
|
|
63
|
+
};
|
|
64
|
+
this.__datetimeEndSetValue = (value) => {
|
|
65
|
+
var _a;
|
|
66
|
+
const time = this.__showRangeTime ? `${(_a = value.split('T')[1]) !== null && _a !== void 0 ? _a : '23:59'}:59` : '23:59:59';
|
|
67
|
+
this.edit({ datetime_end: `${value.split('T')[0]}T${time}` });
|
|
68
|
+
};
|
|
69
|
+
this.__presetGetValue = () => {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
return ((_b = (_a = this.__rawPresetOptions.find(option => {
|
|
72
|
+
const { datetime_end: end, datetime_start: start } = this.form;
|
|
73
|
+
return (start && end && toAPIDateTime(option.start) === start && toAPIDateTime(option.end) === end);
|
|
74
|
+
})) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 'custom');
|
|
75
|
+
};
|
|
76
|
+
this.__presetSetValue = (value) => {
|
|
77
|
+
const option = this.__rawPresetOptions.find(option => option.value === value);
|
|
78
|
+
if (option) {
|
|
79
|
+
this.edit({
|
|
80
|
+
datetime_start: toAPIDateTime(option.start),
|
|
81
|
+
datetime_end: toAPIDateTime(option.end),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
41
84
|
};
|
|
42
85
|
}
|
|
43
86
|
static get properties() {
|
|
@@ -48,330 +91,74 @@ export class ReportForm extends Base {
|
|
|
48
91
|
}
|
|
49
92
|
static get v8n() {
|
|
50
93
|
return [
|
|
51
|
-
({
|
|
52
|
-
({
|
|
53
|
-
({
|
|
94
|
+
({ datetime_start: v }) => !!v || 'datetime-start:v8n_required',
|
|
95
|
+
({ datetime_end: v }) => !!v || 'datetime-end:v8n_required',
|
|
96
|
+
({ name: v }) => !!v || 'name:v8n_required',
|
|
54
97
|
];
|
|
55
98
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
aria-busy=${this.in('busy')}
|
|
63
|
-
aria-live="polite"
|
|
64
|
-
class="space-y-l relative"
|
|
65
|
-
>
|
|
66
|
-
<div class="space-y-m">
|
|
67
|
-
${hidden.matches('name', true) ? '' : this.__renderName()}
|
|
68
|
-
${hidden.matches('range', true) ? '' : this.__renderRange()}
|
|
69
|
-
${hidden.matches('timestamps', true) || !this.data ? '' : this.__renderTimestamps()}
|
|
70
|
-
${hidden.matches('create', true) || this.data ? '' : this.__renderCreate()}
|
|
71
|
-
${hidden.matches('delete', true) || !this.data ? '' : this.__renderDelete()}
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<div
|
|
75
|
-
data-testid="spinner"
|
|
76
|
-
class=${classMap({
|
|
77
|
-
'transition duration-500 ease-in-out absolute inset-0 flex': true,
|
|
78
|
-
'opacity-0 pointer-events-none': this.in('idle'),
|
|
79
|
-
})}
|
|
80
|
-
>
|
|
81
|
-
<foxy-spinner
|
|
82
|
-
layout="vertical"
|
|
83
|
-
class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l"
|
|
84
|
-
state=${this.in('fail') ? 'error' : this.in('busy') ? 'busy' : 'empty'}
|
|
85
|
-
lang=${this.lang}
|
|
86
|
-
ns="${this.ns} ${(_b = (_a = customElements.get('foxy-spinner')) === null || _a === void 0 ? void 0 : _a.defaultNS) !== null && _b !== void 0 ? _b : ''}"
|
|
87
|
-
>
|
|
88
|
-
</foxy-spinner>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
`;
|
|
99
|
+
get readonlySelector() {
|
|
100
|
+
const alwaysMatch = [super.readonlySelector.toString()];
|
|
101
|
+
if (this.data) {
|
|
102
|
+
alwaysMatch.unshift('name', 'preset', 'datetime-precise', 'datetime-start', 'datetime-end');
|
|
103
|
+
}
|
|
104
|
+
return new BooleanSelector(alwaysMatch.join(' ').trim());
|
|
92
105
|
}
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return html `
|
|
99
|
-
<div data-testid=${scope}>
|
|
100
|
-
${this.renderTemplateOrSlot(`${scope}:before`)}
|
|
101
|
-
|
|
102
|
-
<x-group frame>
|
|
103
|
-
<foxy-i18n lang=${this.lang} slot="header" key="name" ns=${this.ns}></foxy-i18n>
|
|
104
|
-
|
|
105
|
-
<x-choice
|
|
106
|
-
data-testid="name-choice"
|
|
107
|
-
.value=${this.form.name}
|
|
108
|
-
.items=${items}
|
|
109
|
-
?readonly=${isReadonly}
|
|
110
|
-
?disabled=${isDisabled}
|
|
111
|
-
@change=${(evt) => {
|
|
112
|
-
if (evt instanceof ChoiceChangeEvent) {
|
|
113
|
-
this.edit({ name: evt.detail });
|
|
114
|
-
}
|
|
115
|
-
}}
|
|
116
|
-
>
|
|
117
|
-
${items.map(value => {
|
|
118
|
-
return html `
|
|
119
|
-
<div slot="${value}-label" class="py-s leading-s">
|
|
120
|
-
<foxy-i18n class="block" lang=${this.lang} key="name_${value}" ns=${this.ns}>
|
|
121
|
-
</foxy-i18n>
|
|
122
|
-
|
|
123
|
-
<foxy-i18n
|
|
124
|
-
class="block text-s opacity-70"
|
|
125
|
-
lang=${this.lang}
|
|
126
|
-
key="name_${value}_explainer"
|
|
127
|
-
ns=${this.ns}
|
|
128
|
-
>
|
|
129
|
-
</foxy-i18n>
|
|
130
|
-
</div>
|
|
131
|
-
`;
|
|
132
|
-
})}
|
|
133
|
-
</x-choice>
|
|
134
|
-
</x-group>
|
|
135
|
-
|
|
136
|
-
${this.renderTemplateOrSlot(`${scope}:after`)}
|
|
137
|
-
</div>
|
|
138
|
-
`;
|
|
106
|
+
get hiddenSelector() {
|
|
107
|
+
const alwaysMatch = [super.hiddenSelector.toString()];
|
|
108
|
+
if (this.data)
|
|
109
|
+
alwaysMatch.unshift('preset', 'datetime-precise');
|
|
110
|
+
return new BooleanSelector(alwaysMatch.join(' ').trim());
|
|
139
111
|
}
|
|
140
|
-
|
|
112
|
+
renderBody() {
|
|
141
113
|
var _a;
|
|
142
|
-
const options = [
|
|
143
|
-
[
|
|
144
|
-
{ value: '0', label: 'preset_previous_quarter', ...getPreviousQuarter() },
|
|
145
|
-
{ value: '1', label: 'preset_previous_month', ...getPreviousMonth() },
|
|
146
|
-
{ value: '2', label: 'preset_previous_year', ...getPreviousYear() },
|
|
147
|
-
],
|
|
148
|
-
[
|
|
149
|
-
{ value: '3', label: 'preset_this_quarter', ...getCurrentQuarter() },
|
|
150
|
-
{ value: '4', label: 'preset_this_month', ...getCurrentMonth() },
|
|
151
|
-
{ value: '5', label: 'preset_this_year', ...getCurrentYear() },
|
|
152
|
-
],
|
|
153
|
-
[
|
|
154
|
-
{ value: '6', label: 'preset_last_365_days', ...getLast365Days() },
|
|
155
|
-
{ value: '7', label: 'preset_last_30_days', ...getLast30Days() },
|
|
156
|
-
],
|
|
157
|
-
];
|
|
158
|
-
const currentOption = options.flat(1).find(option => {
|
|
159
|
-
const { datetime_end: end, datetime_start: start } = this.form;
|
|
160
|
-
return (start && end && toAPIDateTime(option.start) === start && toAPIDateTime(option.end) === end);
|
|
161
|
-
});
|
|
162
|
-
const renderer = (root) => {
|
|
163
|
-
const custom = html `<vaadin-item value="custom">${this.t('preset_custom')}</vaadin-item>`;
|
|
164
|
-
const separator = html `<hr />`;
|
|
165
|
-
const predefined = options.map(group => {
|
|
166
|
-
const items = group.map(({ value, label }) => {
|
|
167
|
-
return html `<vaadin-item value=${value}>${this.t(label)}</vaadin-item>`;
|
|
168
|
-
});
|
|
169
|
-
return html `${items}${separator}`;
|
|
170
|
-
});
|
|
171
|
-
if (!root.firstElementChild)
|
|
172
|
-
root.appendChild(document.createElement('vaadin-list-box'));
|
|
173
|
-
render(html `${predefined}${custom}`, root.firstElementChild);
|
|
174
|
-
};
|
|
175
114
|
return html `
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
.renderer=${renderer}
|
|
185
|
-
@change=${(evt) => {
|
|
186
|
-
const select = evt.currentTarget;
|
|
187
|
-
const option = options.flat(1).find(option => option.value === select.value);
|
|
188
|
-
if (option) {
|
|
189
|
-
this.edit({
|
|
190
|
-
datetime_start: toAPIDateTime(option.start),
|
|
191
|
-
datetime_end: toAPIDateTime(option.end),
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
}}
|
|
115
|
+
${this.renderHeader()}
|
|
116
|
+
|
|
117
|
+
<foxy-internal-summary-control infer="" label="" helper-text="">
|
|
118
|
+
<foxy-internal-select-control
|
|
119
|
+
helper-text=${this.t(`name.helper_text_${(_a = this.form.name) !== null && _a !== void 0 ? _a : 'none'}`)}
|
|
120
|
+
options=${this.__nameOptions}
|
|
121
|
+
layout="summary-item"
|
|
122
|
+
infer="name"
|
|
195
123
|
>
|
|
196
|
-
</
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return html `
|
|
205
|
-
<vaadin-date-time-picker
|
|
206
|
-
date-placeholder=${this.t('select_date')}
|
|
207
|
-
time-placeholder=${this.t('select_time')}
|
|
208
|
-
error-message=${ifDefined(error ? this.t(error) : undefined)}
|
|
209
|
-
data-testid="range:${type}"
|
|
210
|
-
class="w-full"
|
|
211
|
-
label=${this.t(type)}
|
|
212
|
-
step="1"
|
|
213
|
-
?disabled=${!this.in('idle') || this.disabledSelector.matches('range', true)}
|
|
214
|
-
?readonly=${this.readonlySelector.matches('range', true)}
|
|
215
|
-
.checkValidity=${() => !error}
|
|
216
|
-
.value=${value ? toDateTimePickerValue(value) : ''}
|
|
217
|
-
@keydown=${(evt) => evt.key === 'Enter' && this.submit()}
|
|
218
|
-
@change=${(evt) => {
|
|
219
|
-
const picker = evt.currentTarget;
|
|
220
|
-
this.edit({ [field]: picker.value });
|
|
221
|
-
}}
|
|
222
|
-
>
|
|
223
|
-
</vaadin-date-time-picker>
|
|
224
|
-
`;
|
|
225
|
-
}
|
|
226
|
-
__renderRangeDatePicker(type) {
|
|
227
|
-
const field = type === 'end' ? 'datetime_end' : 'datetime_start';
|
|
228
|
-
const error = this.errors.find(error => error.startsWith(`${field}_`));
|
|
229
|
-
const value = this.form[field];
|
|
230
|
-
return html `
|
|
231
|
-
<vaadin-date-picker
|
|
232
|
-
error-message=${ifDefined(error ? this.t(error) : undefined)}
|
|
233
|
-
placeholder=${this.t('select_date')}
|
|
234
|
-
data-testid="range:${type}"
|
|
235
|
-
class="w-full"
|
|
236
|
-
label=${this.t(type)}
|
|
237
|
-
step="1"
|
|
238
|
-
?disabled=${!this.in('idle') || this.disabledSelector.matches('range', true)}
|
|
239
|
-
?readonly=${this.readonlySelector.matches('range', true)}
|
|
240
|
-
.checkValidity=${() => !error}
|
|
241
|
-
.value=${value ? toDatePickerValue(value) : ''}
|
|
242
|
-
@keydown=${(evt) => evt.key === 'Enter' && this.submit()}
|
|
243
|
-
@change=${(evt) => {
|
|
244
|
-
const picker = evt.currentTarget;
|
|
245
|
-
const time = type === 'end' ? '23:59:59' : '00:00:00';
|
|
246
|
-
this.edit({ [field]: `${picker.value}T${time}` });
|
|
247
|
-
}}
|
|
248
|
-
>
|
|
249
|
-
</vaadin-date-picker>
|
|
250
|
-
`;
|
|
251
|
-
}
|
|
252
|
-
__renderRange() {
|
|
253
|
-
const renderer = this.__showRangeTime
|
|
254
|
-
? this.__renderRangeDateTimePicker
|
|
255
|
-
: this.__renderRangeDatePicker;
|
|
256
|
-
return html `
|
|
257
|
-
<div data-testid="range">
|
|
258
|
-
${this.renderTemplateOrSlot('range:before')}
|
|
259
|
-
|
|
260
|
-
<x-group frame>
|
|
261
|
-
<foxy-i18n slot="header" lang=${this.lang} key="range" ns=${this.ns}></foxy-i18n>
|
|
262
|
-
|
|
263
|
-
<div
|
|
264
|
-
style="--lumo-border-radius: var(--lumo-border-radius-s)"
|
|
265
|
-
class="p-m grid gap-m ${this.__showRangeTime ? 'grid-cols-1' : 'sm-grid-cols-2'}"
|
|
266
|
-
>
|
|
267
|
-
<div class=${this.__showRangeTime ? 'col-span-1' : 'sm-col-span-2'}>
|
|
268
|
-
${this.__renderRangePreset()}
|
|
269
|
-
</div>
|
|
270
|
-
|
|
271
|
-
${renderer.call(this, 'start')} ${renderer.call(this, 'end')}
|
|
272
|
-
|
|
273
|
-
<vaadin-checkbox
|
|
274
|
-
data-testid="range:toggle"
|
|
275
|
-
class="-my-xs w-full ${this.__showRangeTime ? 'col-span-1' : 'sm-col-span-2'}"
|
|
276
|
-
?disabled=${!this.in('idle') || this.disabledSelector.matches('range', true)}
|
|
277
|
-
?checked=${this.__showRangeTime}
|
|
278
|
-
@change=${(evt) => {
|
|
279
|
-
const checkbox = evt.currentTarget;
|
|
280
|
-
this.__showRangeTime = checkbox.checked;
|
|
281
|
-
}}
|
|
282
|
-
>
|
|
283
|
-
<foxy-i18n lang=${this.lang} key="use_precise_time" ns=${this.ns}></foxy-i18n>
|
|
284
|
-
</vaadin-checkbox>
|
|
285
|
-
</div>
|
|
286
|
-
</x-group>
|
|
287
|
-
|
|
288
|
-
${this.renderTemplateOrSlot('range:after')}
|
|
289
|
-
</div>
|
|
290
|
-
`;
|
|
291
|
-
}
|
|
292
|
-
__renderTimestamps() {
|
|
293
|
-
return html `
|
|
294
|
-
<div>
|
|
295
|
-
${this.renderTemplateOrSlot('timestamps:before')}
|
|
296
|
-
|
|
297
|
-
<x-metadata
|
|
298
|
-
data-testid="timestamps"
|
|
299
|
-
.items=${['date_modified', 'date_created'].map(field => {
|
|
300
|
-
var _a;
|
|
301
|
-
return ({
|
|
302
|
-
name: this.t(field),
|
|
303
|
-
value: ((_a = this.data) === null || _a === void 0 ? void 0 : _a[field]) ? this.t('date', { value: new Date(this.data[field]) })
|
|
304
|
-
: '',
|
|
305
|
-
});
|
|
306
|
-
})}
|
|
124
|
+
</foxy-internal-select-control>
|
|
125
|
+
|
|
126
|
+
<foxy-internal-select-control
|
|
127
|
+
options=${this.__presetOptions}
|
|
128
|
+
layout="summary-item"
|
|
129
|
+
infer="preset"
|
|
130
|
+
.getValue=${this.__presetGetValue}
|
|
131
|
+
.setValue=${this.__presetSetValue}
|
|
307
132
|
>
|
|
308
|
-
</
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
const isCleanSnapshotInvalid = this.in({ idle: { snapshot: { clean: 'invalid' } } });
|
|
318
|
-
const isDirtySnapshotInvalid = this.in({ idle: { snapshot: { dirty: 'invalid' } } });
|
|
319
|
-
const isTemplateInvalid = isCleanTemplateInvalid || isDirtyTemplateInvalid;
|
|
320
|
-
const isSnaphotInvalid = isCleanSnapshotInvalid || isDirtySnapshotInvalid;
|
|
321
|
-
const isInvalid = isTemplateInvalid || isSnaphotInvalid;
|
|
322
|
-
const isIdle = this.in('idle');
|
|
323
|
-
return html `
|
|
324
|
-
<div>
|
|
325
|
-
${this.renderTemplateOrSlot('create:before')}
|
|
326
|
-
|
|
327
|
-
<vaadin-button
|
|
328
|
-
data-testid="create"
|
|
329
|
-
class="w-full"
|
|
330
|
-
theme="primary success"
|
|
331
|
-
?disabled=${!isIdle || isInvalid || this.disabledSelector.matches('create', true)}
|
|
332
|
-
@click=${this.submit}
|
|
133
|
+
</foxy-internal-select-control>
|
|
134
|
+
</foxy-internal-summary-control>
|
|
135
|
+
|
|
136
|
+
<foxy-internal-summary-control infer="" label="" helper-text="">
|
|
137
|
+
<foxy-internal-native-date-control
|
|
138
|
+
format=${this.__showRangeTime || this.data ? 'datetime-local' : 'date'}
|
|
139
|
+
infer="datetime-start"
|
|
140
|
+
.getValue=${this.__datetimeStartGetValue}
|
|
141
|
+
.setValue=${this.__datetimeStartSetValue}
|
|
333
142
|
>
|
|
334
|
-
|
|
335
|
-
</vaadin-button>
|
|
143
|
+
</foxy-internal-native-date-control>
|
|
336
144
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
return html `
|
|
343
|
-
<div>
|
|
344
|
-
<foxy-internal-confirm-dialog
|
|
345
|
-
data-testid="confirm"
|
|
346
|
-
message="delete_prompt"
|
|
347
|
-
confirm="delete"
|
|
348
|
-
cancel="cancel"
|
|
349
|
-
header="delete"
|
|
350
|
-
theme="primary error"
|
|
351
|
-
lang=${this.lang}
|
|
352
|
-
ns=${this.ns}
|
|
353
|
-
id="confirm"
|
|
354
|
-
@hide=${(evt) => !evt.detail.cancelled && this.delete()}
|
|
145
|
+
<foxy-internal-native-date-control
|
|
146
|
+
format=${this.__showRangeTime || this.data ? 'datetime-local' : 'date'}
|
|
147
|
+
infer="datetime-end"
|
|
148
|
+
.getValue=${this.__datetimeEndGetValue}
|
|
149
|
+
.setValue=${this.__datetimeEndSetValue}
|
|
355
150
|
>
|
|
356
|
-
</foxy-internal-
|
|
357
|
-
|
|
358
|
-
${this.renderTemplateOrSlot('delete:before')}
|
|
151
|
+
</foxy-internal-native-date-control>
|
|
359
152
|
|
|
360
|
-
<
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
?disabled=${!this.in('idle') || this.disabledSelector.matches('delete', true)}
|
|
365
|
-
@click=${(evt) => {
|
|
366
|
-
const confirm = this.renderRoot.querySelector('#confirm');
|
|
367
|
-
confirm.show(evt.currentTarget);
|
|
368
|
-
}}
|
|
153
|
+
<foxy-internal-switch-control
|
|
154
|
+
infer="datetime-precise"
|
|
155
|
+
.getValue=${this.__datetimePreciseGetValue}
|
|
156
|
+
.setValue=${this.__datetimePreciseSetValue}
|
|
369
157
|
>
|
|
370
|
-
|
|
371
|
-
|
|
158
|
+
</foxy-internal-switch-control>
|
|
159
|
+
</foxy-internal-summary-control>
|
|
372
160
|
|
|
373
|
-
|
|
374
|
-
</div>
|
|
161
|
+
${super.renderBody()}
|
|
375
162
|
`;
|
|
376
163
|
}
|
|
377
164
|
}
|