@genesislcap/pbc-reporting-ui 2.0.3 → 2.0.5
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/dts/new/components/clone-report-config-modal/clone-report-config-modal.d.ts +4 -4
- package/dist/dts/new/components/clone-report-config-modal/clone-report-config-modal.d.ts.map +1 -1
- package/dist/dts/new/components/clone-report-config-modal/clone-report-config-modal.template.d.ts +1 -1
- package/dist/dts/new/components/clone-report-config-modal/clone-report-config-modal.template.d.ts.map +1 -1
- package/dist/dts/new/components/reporting-configurations/reporting-configurations.d.ts.map +1 -1
- package/dist/dts/new/main/edit-config/col-filters/col-filters-grid.helpers.d.ts.map +1 -1
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/data-transforms.d.ts +2 -0
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/data-transforms.d.ts.map +1 -1
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.d.ts +14 -1
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.d.ts.map +1 -1
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/data-transforms.template.d.ts.map +1 -1
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/data-transforms.types.d.ts +55 -2
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/data-transforms.types.d.ts.map +1 -1
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/date-format-modal/date-format-modal.d.ts +2 -2
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/date-format-modal/date-format-modal.d.ts.map +1 -1
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/number-format-modal/index.d.ts +2 -0
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/number-format-modal/index.d.ts.map +1 -0
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.d.ts +338 -0
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.d.ts.map +1 -0
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.styles.d.ts +2 -0
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.styles.d.ts.map +1 -0
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.template.d.ts +3 -0
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.template.d.ts.map +1 -0
- package/dist/dts/new/main/edit-config/datasource-config/datasource-config-item.d.ts.map +1 -1
- package/dist/dts/new/main/edit-config/datasource-config/datasources-config-container.helpers.d.ts.map +1 -1
- package/dist/dts/new/store/slices/datasources-config.d.ts +2 -0
- package/dist/dts/new/store/slices/datasources-config.d.ts.map +1 -1
- package/dist/dts/new/store/slices/types.d.ts.map +1 -1
- package/dist/dts/new/store/store.d.ts +7 -0
- package/dist/dts/new/store/store.d.ts.map +1 -1
- package/dist/dts/new/utils/endpoint.d.ts +1 -0
- package/dist/dts/new/utils/endpoint.d.ts.map +1 -1
- package/dist/dts/new/utils/formatters.d.ts.map +1 -1
- package/dist/esm/new/components/clone-report-config-modal/clone-report-config-modal.js +7 -7
- package/dist/esm/new/components/clone-report-config-modal/clone-report-config-modal.template.js +19 -6
- package/dist/esm/new/components/components.js +1 -1
- package/dist/esm/new/main/edit-config/col-filters/col-filters-grid.helpers.js +1 -0
- package/dist/esm/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.js +159 -3
- package/dist/esm/new/main/edit-config/data-transforms-derived-fields/data-transforms.js +16 -7
- package/dist/esm/new/main/edit-config/data-transforms-derived-fields/data-transforms.template.js +4 -3
- package/dist/esm/new/main/edit-config/data-transforms-derived-fields/data-transforms.types.js +58 -1
- package/dist/esm/new/main/edit-config/data-transforms-derived-fields/date-format-modal/date-format-modal.js +18 -11
- package/dist/esm/new/main/edit-config/data-transforms-derived-fields/date-format-modal/date-format-modal.template.js +2 -2
- package/dist/esm/new/main/edit-config/data-transforms-derived-fields/number-format-modal/index.js +1 -0
- package/dist/esm/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.js +125 -0
- package/dist/esm/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.styles.js +67 -0
- package/dist/esm/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.template.js +72 -0
- package/dist/esm/new/main/edit-config/datasource-config/datasource-config-item.js +4 -1
- package/dist/esm/new/main/edit-config/datasource-config/datasources-config-container.helpers.js +3 -0
- package/dist/esm/new/main/generated-reports/generated-reports.js +2 -2
- package/dist/esm/new/store/slices/datasources-config.js +11 -1
- package/dist/esm/new/utils/endpoint.js +9 -1
- package/dist/esm/new/utils/formatters.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RuleExpression } from '@genesislcap/foundation-ui';
|
|
2
2
|
import { PayloadAction } from '@reduxjs/toolkit';
|
|
3
|
+
import { Genesis } from '../../types';
|
|
3
4
|
import { DatasourceConfig, DatasourceName, DatasourceOutputTypes, TransformerConfig } from './types';
|
|
4
5
|
export declare const initialState: DatasourceConfig;
|
|
5
6
|
export declare const datasourceSlice: import("@reduxjs/toolkit").Slice<DatasourceConfig, {
|
|
@@ -31,6 +32,7 @@ export declare const datasourceSlice: import("@reduxjs/toolkit").Slice<Datasourc
|
|
|
31
32
|
key: DatasourceName;
|
|
32
33
|
column: string;
|
|
33
34
|
included: boolean;
|
|
35
|
+
type?: Genesis.GenesisFieldTypes;
|
|
34
36
|
}>): void;
|
|
35
37
|
setRowFilter(state: DatasourceConfig, action: PayloadAction<{
|
|
36
38
|
key: DatasourceName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasources-config.d.ts","sourceRoot":"","sources":["../../../../../src/new/store/slices/datasources-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAe,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG9D,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EAErB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,YAAY,EAAE,gBAAqB,CAAC;AAEjD,eAAO,MAAM,eAAe;uCAKf,gBAAgB,UACf,cAAc;QACpB,IAAI,EAAE,KAAK,gBAAgB,CAAC,cAAc,CAAC,EAAE,KAAK,GAAG,YAAY,CAAC,CAAC;QACnE,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;+BAgCK,gBAAgB,UACf,cAAc;QAAE,GAAG,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;sCAKvD,gBAAgB,UACf,cAAc;QAAE,GAAG,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,qBAAqB,CAAA;KAAE,CAAC;4BAIxD,gBAAgB,UAAU,cAAc;QAAE,GAAG,EAAE,cAAc,CAAA;KAAE,CAAC;2BAI/E,gBAAgB,UACf,cAAc;QACpB,GAAG,EAAE,cAAc,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC;IAcJ;;OAEG;6BAEM,gBAAgB,UACf,cAAc;
|
|
1
|
+
{"version":3,"file":"datasources-config.d.ts","sourceRoot":"","sources":["../../../../../src/new/store/slices/datasources-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAe,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG9D,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EAErB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,YAAY,EAAE,gBAAqB,CAAC;AAEjD,eAAO,MAAM,eAAe;uCAKf,gBAAgB,UACf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,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,oBAAoB,CAAC;QACjC,WAAW,EAAE,qBAAqB,CAAC;QACnC,yBAAyB,EAAE,iBAAiB,CAAC;KAC9C,CAAC;CACH,CAAC;AAIF,eAAO,MAAM,mBAAmB,iCAAkC,CAAC;AAEnE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE,MAAM,MAAM,QAAQ,GAAG;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC"}
|
|
@@ -98,6 +98,7 @@ export declare const store: import("../types").RootStateFromSlices<(import("@red
|
|
|
98
98
|
key: `REQ_REP_${string}` | `DATA_PIPELINE_${string}`;
|
|
99
99
|
column: string;
|
|
100
100
|
included: boolean;
|
|
101
|
+
type?: "STRING" | "ENUM" | "INT" | "SHORT" | "DOUBLE" | "LONG" | "BOOLEAN" | "BIGDECIMAL" | "DATE" | "DATETIME" | "RAW" | "NANO_TIMESTAMP";
|
|
101
102
|
};
|
|
102
103
|
type: string;
|
|
103
104
|
}): void;
|
|
@@ -327,6 +328,7 @@ export declare const store: import("../types").RootStateFromSlices<(import("@red
|
|
|
327
328
|
key: `REQ_REP_${string}` | `DATA_PIPELINE_${string}`;
|
|
328
329
|
column: string;
|
|
329
330
|
included: boolean;
|
|
331
|
+
type?: "STRING" | "ENUM" | "INT" | "SHORT" | "DOUBLE" | "LONG" | "BOOLEAN" | "BIGDECIMAL" | "DATE" | "DATETIME" | "RAW" | "NANO_TIMESTAMP";
|
|
330
332
|
};
|
|
331
333
|
type: string;
|
|
332
334
|
}): void;
|
|
@@ -559,6 +561,7 @@ export declare const store: import("../types").RootStateFromSlices<(import("@red
|
|
|
559
561
|
key: `REQ_REP_${string}` | `DATA_PIPELINE_${string}`;
|
|
560
562
|
column: string;
|
|
561
563
|
included: boolean;
|
|
564
|
+
type?: "STRING" | "ENUM" | "INT" | "SHORT" | "DOUBLE" | "LONG" | "BOOLEAN" | "BIGDECIMAL" | "DATE" | "DATETIME" | "RAW" | "NANO_TIMESTAMP";
|
|
562
565
|
};
|
|
563
566
|
type: string;
|
|
564
567
|
}): void;
|
|
@@ -788,6 +791,7 @@ export declare const store: import("../types").RootStateFromSlices<(import("@red
|
|
|
788
791
|
key: `REQ_REP_${string}` | `DATA_PIPELINE_${string}`;
|
|
789
792
|
column: string;
|
|
790
793
|
included: boolean;
|
|
794
|
+
type?: "STRING" | "ENUM" | "INT" | "SHORT" | "DOUBLE" | "LONG" | "BOOLEAN" | "BIGDECIMAL" | "DATE" | "DATETIME" | "RAW" | "NANO_TIMESTAMP";
|
|
791
795
|
};
|
|
792
796
|
type: string;
|
|
793
797
|
}): void;
|
|
@@ -1017,6 +1021,7 @@ export declare const store: import("../types").RootStateFromSlices<(import("@red
|
|
|
1017
1021
|
key: `REQ_REP_${string}` | `DATA_PIPELINE_${string}`;
|
|
1018
1022
|
column: string;
|
|
1019
1023
|
included: boolean;
|
|
1024
|
+
type?: "STRING" | "ENUM" | "INT" | "SHORT" | "DOUBLE" | "LONG" | "BOOLEAN" | "BIGDECIMAL" | "DATE" | "DATETIME" | "RAW" | "NANO_TIMESTAMP";
|
|
1020
1025
|
};
|
|
1021
1026
|
type: string;
|
|
1022
1027
|
}): void;
|
|
@@ -1246,6 +1251,7 @@ export declare const store: import("../types").RootStateFromSlices<(import("@red
|
|
|
1246
1251
|
key: `REQ_REP_${string}` | `DATA_PIPELINE_${string}`;
|
|
1247
1252
|
column: string;
|
|
1248
1253
|
included: boolean;
|
|
1254
|
+
type?: "STRING" | "ENUM" | "INT" | "SHORT" | "DOUBLE" | "LONG" | "BOOLEAN" | "BIGDECIMAL" | "DATE" | "DATETIME" | "RAW" | "NANO_TIMESTAMP";
|
|
1249
1255
|
};
|
|
1250
1256
|
type: string;
|
|
1251
1257
|
}): void;
|
|
@@ -1475,6 +1481,7 @@ export declare const store: import("../types").RootStateFromSlices<(import("@red
|
|
|
1475
1481
|
key: `REQ_REP_${string}` | `DATA_PIPELINE_${string}`;
|
|
1476
1482
|
column: string;
|
|
1477
1483
|
included: boolean;
|
|
1484
|
+
type?: "STRING" | "ENUM" | "INT" | "SHORT" | "DOUBLE" | "LONG" | "BOOLEAN" | "BIGDECIMAL" | "DATE" | "DATETIME" | "RAW" | "NANO_TIMESTAMP";
|
|
1478
1485
|
};
|
|
1479
1486
|
type: string;
|
|
1480
1487
|
}): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/new/store/store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,eAAe,EAAE,eAO7B,CAAC;AAEF,eAAO,MACL,KAAK
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/new/store/store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,eAAe,EAAE,eAO7B,CAAC;AAEF,eAAO,MACL,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QACR,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBACgD,CAAC;AAE/D,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChD,MAAM,MAAM,WAAW,GAAG,OAAO,QAAQ,CAAC;AAE1C,eAAO,MAAM,eAAe,UAAW,eAAe,SAGrD,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,eAGhC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Connect } from '@genesislcap/foundation-comms';
|
|
2
2
|
import { Genesis } from '../types';
|
|
3
|
+
export declare const tryReadFromSession: (key: string) => string;
|
|
3
4
|
export declare const getEndpointUrl: (endpoint: string, urlRoot?: string) => string;
|
|
4
5
|
export declare const getDatasourceSchema: (connect: Connect) => (resourceName: string) => Promise<Genesis.JSONSchema7>;
|
|
5
6
|
//# sourceMappingURL=endpoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../../../src/new/utils/endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../../../src/new/utils/endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAW,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,eAAO,MAAM,kBAAkB,QAAS,MAAM,WAK7C,CAAC;AAEF,eAAO,MAAM,cAAc,aACf,MAAM,YACP,MAAM,KACd,MAWF,CAAC;AAEF,eAAO,MAAM,mBAAmB,YAAa,OAAO,oBAA0B,MAAM,iCAwBnF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../../src/new/utils/formatters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../../src/new/utils/formatters.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU,4BAUtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,4BAGhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,uBAAiB,KAAK,qBAYrD,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { Connect } from '@genesislcap/foundation-comms';
|
|
3
|
+
import { customElement, GenesisElement, observable } from '@genesislcap/web-core';
|
|
4
|
+
import { showNotificationToast, transformFromServerPaylaod, validateReportingConfig, } from '../../utils';
|
|
5
|
+
import { cloneReportConfigModalStyles as styles } from './clone-report-config-modal.styles';
|
|
6
|
+
import { CloneReportConfigModalTemplate as template } from './clone-report-config-modal.template';
|
|
7
7
|
const EXCLUDED_FIELDS = [
|
|
8
8
|
'CREATED_ON',
|
|
9
9
|
'CREATED_BY',
|
|
@@ -11,7 +11,7 @@ const EXCLUDED_FIELDS = [
|
|
|
11
11
|
'LAST_UPDATED_BY',
|
|
12
12
|
'RECORD_ID',
|
|
13
13
|
'TIMESTAMP',
|
|
14
|
-
'ID'
|
|
14
|
+
'ID',
|
|
15
15
|
];
|
|
16
16
|
let CloneReportConfigModal = class CloneReportConfigModal extends GenesisElement {
|
|
17
17
|
constructor() {
|
|
@@ -53,7 +53,7 @@ let CloneReportConfigModal = class CloneReportConfigModal extends GenesisElement
|
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
const response = await this.connect.commitEvent(`EVENT_REPORT_CONFIG_INSERT`, {
|
|
56
|
-
DETAILS
|
|
56
|
+
DETAILS,
|
|
57
57
|
});
|
|
58
58
|
if (response.MESSAGE_TYPE === 'EVENT_ACK') {
|
|
59
59
|
showNotificationToast({
|
package/dist/esm/new/components/clone-report-config-modal/clone-report-config-modal.template.js
CHANGED
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
import { html, ref, sync } from
|
|
2
|
-
import { requiredTooltip, TOOLTIP, tooltip } from
|
|
1
|
+
import { html, ref, sync } from '@genesislcap/web-core';
|
|
2
|
+
import { requiredTooltip, TOOLTIP, tooltip } from '../../utils';
|
|
3
3
|
export const CloneReportConfigModalTemplate = html `
|
|
4
|
-
<rapid-modal
|
|
4
|
+
<rapid-modal
|
|
5
|
+
${ref('cloneReportConfigModal')}
|
|
6
|
+
class="clone-report-config-modal"
|
|
7
|
+
:onCloseCallback=${(x) => x.closeCloneReportConfigModal()}
|
|
8
|
+
>
|
|
5
9
|
<div slot="top" class="dialog-top">Clone Report Config</div>
|
|
6
10
|
<rapid-divider></rapid-divider>
|
|
7
11
|
<div class="dialog-content">
|
|
8
12
|
<div class="help-text">
|
|
9
|
-
<p>
|
|
13
|
+
<p>
|
|
14
|
+
Here you can clone a report configuration you've already made. You need to set a new
|
|
15
|
+
report and filename as they must be unique.
|
|
16
|
+
</p>
|
|
10
17
|
</div>
|
|
11
18
|
<label class="label">Report name${requiredTooltip}${tooltip(TOOLTIP.SETUP_NAME)}</label>
|
|
12
|
-
<rapid-text-field
|
|
19
|
+
<rapid-text-field
|
|
20
|
+
:value=${sync((x) => x.reportName)}
|
|
21
|
+
placeholder="Enter report name"
|
|
22
|
+
></rapid-text-field>
|
|
13
23
|
<label class="label">File name${requiredTooltip}${tooltip(TOOLTIP.SETUP_FILENAME)}</label>
|
|
14
|
-
<rapid-text-field
|
|
24
|
+
<rapid-text-field
|
|
25
|
+
:value=${sync((x) => x.fileName)}
|
|
26
|
+
placeholder="Enter file name"
|
|
27
|
+
></rapid-text-field>
|
|
15
28
|
</div>
|
|
16
29
|
<rapid-divider></rapid-divider>
|
|
17
30
|
<div slot="bottom" class="dialog-bottom">
|
|
@@ -3,8 +3,8 @@ import { baseComponents, provideDesignSystem, rapidActionsMenu, rapidButton, rap
|
|
|
3
3
|
import { rapidGridComponents, rapidAgActionsMenuRenderer, rapidAgSelectRenderer, } from '@genesislcap/rapid-grid-pro';
|
|
4
4
|
import { css } from '@genesislcap/web-core';
|
|
5
5
|
import { foundationAgRowSelectRenderer } from '../../old/components/renderers/row-select.renderer';
|
|
6
|
-
import { DataTransformRenderer } from './renderers/data-transform-renderer';
|
|
7
6
|
import { CloneReportConfigModal } from './clone-report-config-modal/clone-report-config-modal';
|
|
7
|
+
import { DataTransformRenderer } from './renderers/data-transform-renderer';
|
|
8
8
|
EntityManagement;
|
|
9
9
|
RapidRuleExpressionBuilder;
|
|
10
10
|
RapidValueExpressionBuilder;
|
|
@@ -18,6 +18,7 @@ export function rowSelectionChangedHandler(event) {
|
|
|
18
18
|
key: datasourceNameFromDisplay(event.data[GridColumnNames.Datasource]),
|
|
19
19
|
column: event.data[GridColumnNames.ColumnName],
|
|
20
20
|
included: (_b = event.node.isSelected()) !== null && _b !== void 0 ? _b : true,
|
|
21
|
+
type: event.data[GridColumnNames.Type],
|
|
21
22
|
});
|
|
22
23
|
event.api.redrawRows();
|
|
23
24
|
}
|
package/dist/esm/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { actions, selectors } from '../../../store';
|
|
2
2
|
import { GridColumnNames, datasourceNameFromDisplay } from '../shared';
|
|
3
|
-
import { DateLocaleFormats, DateMonthFormats, DateTimeFormats, DateTimeTokens, FormatTypes, LocaleDateOrderMap, } from './data-transforms.types';
|
|
3
|
+
import { DateLocaleFormats, DateMonthFormats, DateTimeFormats, DateTimeTokens, FormatTypes, LocaleDateOrderMap, NumericFormats, NumericCurrencies, isNumericFieldType, } from './data-transforms.types';
|
|
4
4
|
// export const lookupDataTransform =
|
|
5
5
|
// (exprBuilderFields: ExpressionBuilderTypes.Field[]) =>
|
|
6
6
|
// (data: DataTransformData): DataTransformData => {
|
|
@@ -27,6 +27,48 @@ export function lookupColumnFormat(data) {
|
|
|
27
27
|
const format = (_a = selectors.datasourceConfig.getDatasource(key).TRANSFORMER_CONFIGURATION.COLUMN_FORMATS) === null || _a === void 0 ? void 0 : _a[data[GridColumnNames.ColumnName]];
|
|
28
28
|
return Object.assign(Object.assign({}, data), { [GridColumnNames.Format]: format || '' });
|
|
29
29
|
}
|
|
30
|
+
export const getDefaultFormat = (type) => {
|
|
31
|
+
if (isNumericFieldType(type)) {
|
|
32
|
+
if (type === 'BIGDECIMAL' || type === 'DOUBLE') {
|
|
33
|
+
return '#.##';
|
|
34
|
+
}
|
|
35
|
+
return '#';
|
|
36
|
+
}
|
|
37
|
+
else if (type === 'DATE') {
|
|
38
|
+
return 'dd/MM/yyyy';
|
|
39
|
+
}
|
|
40
|
+
else if (type === 'DATETIME') {
|
|
41
|
+
return 'dd/MM/yyyy HH:mm:ss';
|
|
42
|
+
}
|
|
43
|
+
return '';
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Sets default formats for included fields in a datasource based on their types
|
|
47
|
+
* This should be called after datasource initialization when schema information is available
|
|
48
|
+
*/
|
|
49
|
+
export const setDefaultFormatsForDatasource = (datasourceName, schema) => {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
if (!schema.properties)
|
|
52
|
+
return;
|
|
53
|
+
const datasource = selectors.datasourceConfig.getDatasource(datasourceName);
|
|
54
|
+
const includedColumns = (_b = (_a = datasource === null || datasource === void 0 ? void 0 : datasource.TRANSFORMER_CONFIGURATION) === null || _a === void 0 ? void 0 : _a.INCLUDE_COLUMNS) !== null && _b !== void 0 ? _b : [];
|
|
55
|
+
Object.entries(schema.properties).forEach(([fieldName, fieldSchema]) => {
|
|
56
|
+
// Only set default format if the column is included
|
|
57
|
+
if (includedColumns.includes(fieldName)) {
|
|
58
|
+
const genesisType = fieldSchema.genesisType;
|
|
59
|
+
if (genesisType) {
|
|
60
|
+
const defaultFormat = getDefaultFormat(genesisType);
|
|
61
|
+
if (defaultFormat) {
|
|
62
|
+
actions.datasourceConfig.setColumnFormat({
|
|
63
|
+
key: datasourceName,
|
|
64
|
+
column: fieldName,
|
|
65
|
+
format: defaultFormat,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
};
|
|
30
72
|
export const valueExprCellRendereronChange = (datasourceKey) => (value, params) => {
|
|
31
73
|
const modelOrNull = value.model;
|
|
32
74
|
if (modelOrNull) {
|
|
@@ -44,8 +86,12 @@ export const valueExprCellRendereronChange = (datasourceKey) => (value, params)
|
|
|
44
86
|
}
|
|
45
87
|
};
|
|
46
88
|
export const getDateSeparator = (data) => {
|
|
47
|
-
if
|
|
48
|
-
|
|
89
|
+
// Check if this is a date/datetime type with month property
|
|
90
|
+
if (data.type === FormatTypes.Date || data.type === FormatTypes.Datetime) {
|
|
91
|
+
const dateData = data;
|
|
92
|
+
if (dateData.month === DateMonthFormats.Short || dateData.month === DateMonthFormats.Long) {
|
|
93
|
+
return ' ';
|
|
94
|
+
}
|
|
49
95
|
}
|
|
50
96
|
if (data.format === DateLocaleFormats.US) {
|
|
51
97
|
return '-';
|
|
@@ -155,3 +201,113 @@ const FormatToConfigTokens = Object.entries(DateTimeTokens).reduce((acc, [field,
|
|
|
155
201
|
return acc;
|
|
156
202
|
}, {});
|
|
157
203
|
export { FormatToConfigTokens };
|
|
204
|
+
/**
|
|
205
|
+
* Transforms a numeric format string back to the object structure used by the number format modal
|
|
206
|
+
* This is the inverse of mapToNumberFormat
|
|
207
|
+
*/
|
|
208
|
+
export const transformFromNumberFormatString = (formatString, type) => {
|
|
209
|
+
if (!formatString) {
|
|
210
|
+
return {
|
|
211
|
+
type,
|
|
212
|
+
format: NumericFormats.Unformatted,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
const numericConfig = {
|
|
216
|
+
type,
|
|
217
|
+
format: NumericFormats.Unformatted,
|
|
218
|
+
};
|
|
219
|
+
// Check for currency rounded format first (no decimal places)
|
|
220
|
+
if (formatString.match(/^[£$€¥]#,##0$/)) {
|
|
221
|
+
numericConfig.format = NumericFormats.CurrencyRounded;
|
|
222
|
+
// Determine currency from symbol
|
|
223
|
+
if (formatString.startsWith('$'))
|
|
224
|
+
numericConfig.currency = NumericCurrencies.US;
|
|
225
|
+
else if (formatString.startsWith('£'))
|
|
226
|
+
numericConfig.currency = NumericCurrencies.UK;
|
|
227
|
+
else if (formatString.startsWith('€'))
|
|
228
|
+
numericConfig.currency = NumericCurrencies.EU;
|
|
229
|
+
else if (formatString.startsWith('¥'))
|
|
230
|
+
numericConfig.currency = NumericCurrencies.CN;
|
|
231
|
+
}
|
|
232
|
+
else if (formatString.startsWith('$')) {
|
|
233
|
+
numericConfig.format = NumericFormats.Currency;
|
|
234
|
+
numericConfig.currency = NumericCurrencies.US;
|
|
235
|
+
}
|
|
236
|
+
else if (formatString.startsWith('£')) {
|
|
237
|
+
numericConfig.format = NumericFormats.Currency;
|
|
238
|
+
numericConfig.currency = NumericCurrencies.UK;
|
|
239
|
+
}
|
|
240
|
+
else if (formatString.startsWith('€')) {
|
|
241
|
+
numericConfig.format = NumericFormats.Currency;
|
|
242
|
+
numericConfig.currency = NumericCurrencies.EU;
|
|
243
|
+
}
|
|
244
|
+
else if (formatString.startsWith('¥')) {
|
|
245
|
+
numericConfig.format = NumericFormats.Currency;
|
|
246
|
+
numericConfig.currency = NumericCurrencies.CN;
|
|
247
|
+
}
|
|
248
|
+
else if (formatString.endsWith('%')) {
|
|
249
|
+
numericConfig.format = NumericFormats.Percent;
|
|
250
|
+
}
|
|
251
|
+
else if (formatString.includes('#,##0')) {
|
|
252
|
+
numericConfig.format = NumericFormats.Financial;
|
|
253
|
+
}
|
|
254
|
+
else if (formatString.match(/^#(\.#+)?$/)) {
|
|
255
|
+
numericConfig.format = NumericFormats.SimpleDecimal;
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
// Default to unformatted if we can't parse it
|
|
259
|
+
return numericConfig;
|
|
260
|
+
}
|
|
261
|
+
// Extract decimal places from the format string
|
|
262
|
+
const decimalMatch = formatString.match(/\.(#+)/);
|
|
263
|
+
if (decimalMatch) {
|
|
264
|
+
numericConfig.decimalPlaces = decimalMatch[1].length;
|
|
265
|
+
}
|
|
266
|
+
return numericConfig;
|
|
267
|
+
};
|
|
268
|
+
export const mapToNumberFormat = (format, decimalPlaces, currency) => {
|
|
269
|
+
switch (format) {
|
|
270
|
+
case NumericFormats.Financial:
|
|
271
|
+
// Financial format: #,##0.## (e.g., 1,000.12, 1,000.5, 1,000)
|
|
272
|
+
const decimalPattern = decimalPlaces !== undefined && decimalPlaces > 0 ? '.' + '#'.repeat(decimalPlaces) : '';
|
|
273
|
+
return `#,##0${decimalPattern}`;
|
|
274
|
+
case NumericFormats.SimpleDecimal:
|
|
275
|
+
// Simple decimal format: #.## (e.g., 123.45, 123.5, 123)
|
|
276
|
+
const simpleDecimalPattern = decimalPlaces !== undefined && decimalPlaces > 0 ? '.' + '#'.repeat(decimalPlaces) : '';
|
|
277
|
+
return `#${simpleDecimalPattern}`;
|
|
278
|
+
case NumericFormats.Percent:
|
|
279
|
+
// Percent format: ##.##% (e.g., 10.12%, 10.5%)
|
|
280
|
+
const percentDecimalPattern = decimalPlaces !== undefined && decimalPlaces > 0 ? '.' + '#'.repeat(decimalPlaces) : '';
|
|
281
|
+
return `##${percentDecimalPattern}%`;
|
|
282
|
+
case NumericFormats.Currency:
|
|
283
|
+
// Currency format: $#,##0.## (e.g., $1,000.12, $1,000.5)
|
|
284
|
+
const currencyDecimalPattern = decimalPlaces !== undefined && decimalPlaces > 0 ? '.' + '#'.repeat(decimalPlaces) : '';
|
|
285
|
+
const currencySymbol = getCurrencySymbol(currency);
|
|
286
|
+
return `${currencySymbol}#,##0${currencyDecimalPattern}`;
|
|
287
|
+
case NumericFormats.CurrencyRounded:
|
|
288
|
+
// Currency rounded format: $#,##0 (e.g., $1,000)
|
|
289
|
+
const currencySymbolRounded = getCurrencySymbol(currency);
|
|
290
|
+
return `${currencySymbolRounded}#,##0`;
|
|
291
|
+
case NumericFormats.Unformatted:
|
|
292
|
+
default:
|
|
293
|
+
// Unformatted: no pattern
|
|
294
|
+
return '';
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* Gets the currency symbol based on the currency type
|
|
299
|
+
*/
|
|
300
|
+
const getCurrencySymbol = (currency) => {
|
|
301
|
+
switch (currency) {
|
|
302
|
+
case NumericCurrencies.US:
|
|
303
|
+
return '$';
|
|
304
|
+
case NumericCurrencies.UK:
|
|
305
|
+
return '£';
|
|
306
|
+
case NumericCurrencies.EU:
|
|
307
|
+
return '€';
|
|
308
|
+
case NumericCurrencies.CN:
|
|
309
|
+
return '¥';
|
|
310
|
+
default:
|
|
311
|
+
return '$'; // Default to US dollar
|
|
312
|
+
}
|
|
313
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement, html } from '@genesislcap/web-core';
|
|
3
|
+
import { actions } from '../../../store';
|
|
4
|
+
import { ReportingEvents } from '../../../utils/event-map';
|
|
5
|
+
import { buttonCellRenderer } from '../../../utils/renderer';
|
|
3
6
|
import { DatasourceDataBaseComponent, GridColumnNames, lookupColumnIsIncluded, pathParameters, datasourceNameFromDisplay, } from '../shared';
|
|
7
|
+
import { lookupColumnFormat, transformFromFormatString, transformFromNumberFormatString, } from './data-transforms.helpers';
|
|
4
8
|
import { styles } from './data-transforms.styles';
|
|
5
9
|
import { template } from './data-transforms.template';
|
|
6
|
-
import {
|
|
7
|
-
import { lookupColumnFormat, transformFromFormatString } from './data-transforms.helpers';
|
|
8
|
-
import { ReportingEvents } from '../../../utils/event-map';
|
|
9
|
-
import { actions } from '../../../store';
|
|
10
|
+
import { isNumericFieldType, } from './data-transforms.types';
|
|
10
11
|
/**
|
|
11
12
|
* TODO: This component doesn't yet do derived fields, but it will
|
|
12
13
|
*/
|
|
@@ -14,8 +15,14 @@ let DataTransformsAndDerivedFields = class DataTransformsAndDerivedFields extend
|
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
16
17
|
this.clickHandlerGridDisplay = (rowData) => {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
if (isNumericFieldType(rowData[GridColumnNames.Type])) {
|
|
19
|
+
const formatConfig = transformFromNumberFormatString(rowData[GridColumnNames.Format], rowData[GridColumnNames.Type]);
|
|
20
|
+
this.numberFormatModal.showModal(Object.assign(Object.assign({}, rowData), formatConfig));
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const formatConfig = transformFromFormatString(rowData[GridColumnNames.Format], rowData[GridColumnNames.Type]);
|
|
24
|
+
this.dateFormatModal.showModal(Object.assign(Object.assign({}, rowData), formatConfig));
|
|
25
|
+
}
|
|
19
26
|
};
|
|
20
27
|
this.deleteFormat = (rowData) => {
|
|
21
28
|
actions.datasourceConfig.deleteColumnFormat({
|
|
@@ -33,7 +40,9 @@ let DataTransformsAndDerivedFields = class DataTransformsAndDerivedFields extend
|
|
|
33
40
|
this.fieldData = this.datasourceSpec
|
|
34
41
|
.flatMap(pathParameters)
|
|
35
42
|
.filter(lookupColumnIsIncluded)
|
|
36
|
-
.filter((data) => data[GridColumnNames.Type] === 'DATETIME' ||
|
|
43
|
+
.filter((data) => data[GridColumnNames.Type] === 'DATETIME' ||
|
|
44
|
+
data[GridColumnNames.Type] === 'DATE' ||
|
|
45
|
+
isNumericFieldType(data[GridColumnNames.Type]))
|
|
37
46
|
.map(lookupColumnFormat);
|
|
38
47
|
this.dataError = false;
|
|
39
48
|
}
|
package/dist/esm/new/main/edit-config/data-transforms-derived-fields/data-transforms.template.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { classNames, html, ref } from '@genesislcap/web-core';
|
|
2
2
|
import { DateFormatModal } from './date-format-modal';
|
|
3
|
+
import { NumberFormatModal } from './number-format-modal/number-format-modal';
|
|
3
4
|
DateFormatModal;
|
|
5
|
+
NumberFormatModal;
|
|
4
6
|
export const template = html `
|
|
5
7
|
<div class="grid-container ${(x) => classNames(['error', x.dataError])}">
|
|
6
8
|
<rapid-grid-pro
|
|
@@ -11,7 +13,6 @@ export const template = html `
|
|
|
11
13
|
grid-autosizing
|
|
12
14
|
></rapid-grid-pro>
|
|
13
15
|
</div>
|
|
14
|
-
<date-format-modal
|
|
15
|
-
|
|
16
|
-
></date-format-modal>
|
|
16
|
+
<date-format-modal ${ref('dateFormatModal')}></date-format-modal>
|
|
17
|
+
<number-format-modal ${ref('numberFormatModal')}></number-format-modal>
|
|
17
18
|
`;
|
package/dist/esm/new/main/edit-config/data-transforms-derived-fields/data-transforms.types.js
CHANGED
|
@@ -2,14 +2,29 @@ export var FormatTypes;
|
|
|
2
2
|
(function (FormatTypes) {
|
|
3
3
|
FormatTypes["Date"] = "DATE";
|
|
4
4
|
FormatTypes["Datetime"] = "DATETIME";
|
|
5
|
+
FormatTypes["Double"] = "DOUBLE";
|
|
6
|
+
FormatTypes["BigDecimal"] = "BIGDECIMAL";
|
|
7
|
+
FormatTypes["Int"] = "INT";
|
|
8
|
+
FormatTypes["Short"] = "SHORT";
|
|
9
|
+
FormatTypes["Long"] = "LONG";
|
|
5
10
|
})(FormatTypes || (FormatTypes = {}));
|
|
11
|
+
// Helper function to check if a field type is numeric
|
|
12
|
+
export const isNumericFieldType = (fieldType) => {
|
|
13
|
+
return [
|
|
14
|
+
FormatTypes.Double,
|
|
15
|
+
FormatTypes.BigDecimal,
|
|
16
|
+
FormatTypes.Int,
|
|
17
|
+
FormatTypes.Short,
|
|
18
|
+
FormatTypes.Long,
|
|
19
|
+
].includes(fieldType);
|
|
20
|
+
};
|
|
6
21
|
export var DateLocaleFormats;
|
|
7
22
|
(function (DateLocaleFormats) {
|
|
8
23
|
DateLocaleFormats["Unformatted"] = "Unformatted";
|
|
9
24
|
DateLocaleFormats["US"] = "en-US";
|
|
10
25
|
DateLocaleFormats["UK"] = "en-GB";
|
|
11
26
|
})(DateLocaleFormats || (DateLocaleFormats = {}));
|
|
12
|
-
export const
|
|
27
|
+
export const dateFormatsWithLabels = [
|
|
13
28
|
{
|
|
14
29
|
value: DateLocaleFormats.Unformatted,
|
|
15
30
|
label: `Unformatted`,
|
|
@@ -71,6 +86,48 @@ export const DateTimeTokens = {
|
|
|
71
86
|
[DateTimeFormats.Show]: 'ss',
|
|
72
87
|
},
|
|
73
88
|
};
|
|
89
|
+
export var NumericFormats;
|
|
90
|
+
(function (NumericFormats) {
|
|
91
|
+
NumericFormats["Unformatted"] = "Unformatted";
|
|
92
|
+
NumericFormats["Financial"] = "Financial";
|
|
93
|
+
NumericFormats["Percent"] = "Percent";
|
|
94
|
+
NumericFormats["Currency"] = "Currency";
|
|
95
|
+
NumericFormats["CurrencyRounded"] = "Currency Rounded";
|
|
96
|
+
NumericFormats["SimpleDecimal"] = "Simple Decimal";
|
|
97
|
+
})(NumericFormats || (NumericFormats = {}));
|
|
98
|
+
export const numericFormatsWithLabels = [
|
|
99
|
+
{
|
|
100
|
+
value: NumericFormats.Unformatted,
|
|
101
|
+
label: `${NumericFormats.Unformatted}`,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
value: NumericFormats.Financial,
|
|
105
|
+
label: `${NumericFormats.Financial} (1,000.12)`,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
value: NumericFormats.Percent,
|
|
109
|
+
label: `${NumericFormats.Percent} (10.12%)`,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
value: NumericFormats.SimpleDecimal,
|
|
113
|
+
label: `${NumericFormats.SimpleDecimal} (123.45)`,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
value: NumericFormats.Currency,
|
|
117
|
+
label: `${NumericFormats.Currency} (£1,000.12)`,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
value: NumericFormats.CurrencyRounded,
|
|
121
|
+
label: `${NumericFormats.CurrencyRounded} (£1,000)`,
|
|
122
|
+
},
|
|
123
|
+
];
|
|
124
|
+
export var NumericCurrencies;
|
|
125
|
+
(function (NumericCurrencies) {
|
|
126
|
+
NumericCurrencies["US"] = "$ English (US)";
|
|
127
|
+
NumericCurrencies["UK"] = "\u00A3 English (UK)";
|
|
128
|
+
NumericCurrencies["EU"] = "\u20AC Euro";
|
|
129
|
+
NumericCurrencies["CN"] = "\u00A5 Chinese";
|
|
130
|
+
})(NumericCurrencies || (NumericCurrencies = {}));
|
|
74
131
|
export const LocaleDateOrderMap = {
|
|
75
132
|
[DateLocaleFormats.UK]: ['day', 'month', 'year'],
|
|
76
133
|
[DateLocaleFormats.US]: ['month', 'day', 'year'],
|
|
@@ -2,14 +2,14 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { EventEmitter } from '@genesislcap/foundation-events';
|
|
3
3
|
import { formatTimestamp } from '@genesislcap/foundation-utils';
|
|
4
4
|
import { customElement, DOM, GenesisElement, observable, volatile } from '@genesislcap/web-core';
|
|
5
|
+
import { actions } from '../../../../store';
|
|
6
|
+
import { getDateFormatOptions } from '../../../../utils';
|
|
7
|
+
import { ReportingEvents } from '../../../../utils/event-map';
|
|
8
|
+
import { datasourceNameFromDisplay, GridColumnNames } from '../../shared';
|
|
9
|
+
import { mapToDateFormat } from '../data-transforms.helpers';
|
|
5
10
|
import { FormatTypes, DateLocaleFormats, } from '../data-transforms.types';
|
|
6
11
|
import { dateFormatModalStyles as styles } from './date-format-modal.styles';
|
|
7
12
|
import { dateFormatModalTemplate as template } from './date-format-modal.template';
|
|
8
|
-
import { datasourceNameFromDisplay, GridColumnNames } from '../../shared';
|
|
9
|
-
import { getDateFormatOptions } from '../../../../utils';
|
|
10
|
-
import { mapToDateFormat } from '../data-transforms.helpers';
|
|
11
|
-
import { actions } from '../../../../store';
|
|
12
|
-
import { ReportingEvents } from '../../../../utils/event-map';
|
|
13
13
|
let DateFormatModal = class DateFormatModal extends EventEmitter(GenesisElement) {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
@@ -118,12 +118,19 @@ let DateFormatModal = class DateFormatModal extends EventEmitter(GenesisElement)
|
|
|
118
118
|
this.formatString = mapToDateFormat(this.displayConfigurationRow);
|
|
119
119
|
}
|
|
120
120
|
showModal(displayConfigurationRow) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
displayConfigurationRow.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
// Type guard to ensure we only accept date/datetime configurations
|
|
122
|
+
if (displayConfigurationRow.type === FormatTypes.Date ||
|
|
123
|
+
displayConfigurationRow.type === FormatTypes.Datetime) {
|
|
124
|
+
this.displayConfigurationRow = displayConfigurationRow;
|
|
125
|
+
this.formatString =
|
|
126
|
+
displayConfigurationRow.format !== DateLocaleFormats.Unformatted
|
|
127
|
+
? mapToDateFormat(this.displayConfigurationRow)
|
|
128
|
+
: '';
|
|
129
|
+
this.dateModal.show();
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
throw new Error('Date format modal can only handle Date or Datetime configurations');
|
|
133
|
+
}
|
|
127
134
|
}
|
|
128
135
|
discardChanges() {
|
|
129
136
|
this.resetDisplayRow();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sync } from '@genesislcap/foundation-utils';
|
|
2
2
|
import { html, ref, repeat, when } from '@genesislcap/web-core';
|
|
3
|
-
import {
|
|
3
|
+
import { dateFormatsWithLabels, DateLocaleFormats, DateMonthFormats, DateStandardFormats, DateTimeFormats, DateYearFormats, } from '../data-transforms.types';
|
|
4
4
|
export const dateFormatModalTemplate = html `
|
|
5
5
|
<rapid-modal
|
|
6
6
|
${ref('dateModal')}
|
|
@@ -17,7 +17,7 @@ export const dateFormatModalTemplate = html `
|
|
|
17
17
|
class="date-format-select"
|
|
18
18
|
:value="${sync((x) => x.gridLocaleType)}"
|
|
19
19
|
>
|
|
20
|
-
${repeat(() =>
|
|
20
|
+
${repeat(() => dateFormatsWithLabels, html `
|
|
21
21
|
<rapid-option data-test-id="${(x) => x.label}" value="${(x) => x.value}">
|
|
22
22
|
${(x) => x.label}
|
|
23
23
|
</rapid-option>
|
package/dist/esm/new/main/edit-config/data-transforms-derived-fields/number-format-modal/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './number-format-modal';
|