@genesislcap/pbc-reporting-ui 15.19.0 → 15.19.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/custom-elements.json +4247 -5382
- package/dist/dts/react.d.ts +44 -44
- package/dist/react.cjs +65 -65
- package/dist/react.mjs +57 -57
- package/package.json +22 -23
- package/.env +0 -3
- package/api-extractor.json +0 -4
- package/dist/dts/new/main/edit-config/col-filters/col-filters-grid.helpers.test.d.ts +0 -2
- package/dist/dts/new/main/edit-config/col-filters/col-filters-grid.helpers.test.d.ts.map +0 -1
- package/dist/dts/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.test.d.ts +0 -2
- package/dist/dts/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.test.d.ts.map +0 -1
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.test.d.ts +0 -2
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.test.d.ts.map +0 -1
- package/dist/dts/new/main/edit-config/datasource-config/datasources-config-container.helpers.test.d.ts +0 -2
- package/dist/dts/new/main/edit-config/datasource-config/datasources-config-container.helpers.test.d.ts.map +0 -1
- package/dist/dts/new/main/edit-config/row-filters/row-filters.helpers.test.d.ts +0 -2
- package/dist/dts/new/main/edit-config/row-filters/row-filters.helpers.test.d.ts.map +0 -1
- package/dist/dts/new/main/edit-config/shared/datasource-data-base-component.test.d.ts +0 -5
- package/dist/dts/new/main/edit-config/shared/datasource-data-base-component.test.d.ts.map +0 -1
- package/dist/dts/new/utils/alias-generator.test.d.ts +0 -2
- package/dist/dts/new/utils/alias-generator.test.d.ts.map +0 -1
- package/dist/dts/new/utils/endpoint.test.d.ts +0 -2
- package/dist/dts/new/utils/endpoint.test.d.ts.map +0 -1
- package/dist/dts/new/utils/transformers.test.d.ts +0 -2
- package/dist/dts/new/utils/transformers.test.d.ts.map +0 -1
- package/dist/dts/new/utils/validators.test.d.ts +0 -2
- package/dist/dts/new/utils/validators.test.d.ts.map +0 -1
- package/dist/dts/old/main/main.test.d.ts +0 -2
- package/dist/dts/old/main/main.test.d.ts.map +0 -1
- package/dist/dts/old/utils/filterObjectArray.test.d.ts +0 -2
- package/dist/dts/old/utils/filterObjectArray.test.d.ts.map +0 -1
- package/dist/esm/new/main/edit-config/col-filters/col-filters-grid.helpers.test.js +0 -200
- package/dist/esm/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.test.js +0 -152
- package/dist/esm/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.test.js +0 -629
- package/dist/esm/new/main/edit-config/datasource-config/datasources-config-container.helpers.test.js +0 -268
- package/dist/esm/new/main/edit-config/row-filters/row-filters.helpers.test.js +0 -1
- package/dist/esm/new/main/edit-config/shared/datasource-data-base-component.test.js +0 -426
- package/dist/esm/new/utils/alias-generator.test.js +0 -36
- package/dist/esm/new/utils/endpoint.test.js +0 -162
- package/dist/esm/new/utils/transformers.test.js +0 -469
- package/dist/esm/new/utils/validators.test.js +0 -139
- package/dist/esm/old/main/main.test.js +0 -5
- package/dist/esm/old/utils/filterObjectArray.test.js +0 -46
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/src/globals.d.ts +0 -7
- package/src/index.federated.ts +0 -1
- package/src/index.ts +0 -8
- package/src/new/components/clone-report-config-modal/clone-report-config-modal.styles.ts +0 -47
- package/src/new/components/clone-report-config-modal/clone-report-config-modal.template.ts +0 -55
- package/src/new/components/clone-report-config-modal/clone-report-config-modal.ts +0 -173
- package/src/new/components/components.ts +0 -118
- package/src/new/components/renderers/data-transform-renderer.ts +0 -111
- package/src/new/components/reporting-configurations/reporting-configurations.styles.ts +0 -42
- package/src/new/components/reporting-configurations/reporting-configurations.template.ts +0 -59
- package/src/new/components/reporting-configurations/reporting-configurations.ts +0 -366
- package/src/new/components/shared/file-template-picker.template.ts +0 -45
- package/src/new/lib/redux-store/README.md +0 -55
- package/src/new/lib/redux-store/index.ts +0 -2
- package/src/new/lib/redux-store/state-utils.ts +0 -1
- package/src/new/lib/redux-store/store.ts +0 -135
- package/src/new/main/edit-config/base-config/base-config.styles.ts +0 -26
- package/src/new/main/edit-config/base-config/base-config.template.ts +0 -71
- package/src/new/main/edit-config/base-config/base-config.ts +0 -116
- package/src/new/main/edit-config/col-filters/col-filters-grid.helpers.test.ts +0 -232
- package/src/new/main/edit-config/col-filters/col-filters-grid.helpers.ts +0 -35
- package/src/new/main/edit-config/col-filters/col-filters-grid.styles.ts +0 -22
- package/src/new/main/edit-config/col-filters/col-filters-grid.ts +0 -150
- package/src/new/main/edit-config/col-filters/col-filters-grid.types.ts +0 -7
- package/src/new/main/edit-config/col-filters/col-filters-tutorial.ts +0 -25
- package/src/new/main/edit-config/col-filters/col-fitlers-grid.template.ts +0 -15
- package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.test.ts +0 -187
- package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.ts +0 -89
- package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.styles.ts +0 -22
- package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.template.ts +0 -14
- package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.ts +0 -119
- package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.types.ts +0 -10
- package/src/new/main/edit-config/col-rename-alias/col-rename-alias-tutorial.ts +0 -33
- package/src/new/main/edit-config/config-journey-orchestrator.styles.ts +0 -120
- package/src/new/main/edit-config/config-journey-orchestrator.template.ts +0 -149
- package/src/new/main/edit-config/config-journey-orchestrator.ts +0 -92
- package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms-tutorial.ts +0 -127
- package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.test.ts +0 -799
- package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.ts +0 -371
- package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.styles.ts +0 -22
- package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.template.ts +0 -21
- package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.ts +0 -162
- package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.types.ts +0 -211
- package/src/new/main/edit-config/data-transforms-derived-fields/date-format-modal/date-format-modal.styles.ts +0 -79
- package/src/new/main/edit-config/data-transforms-derived-fields/date-format-modal/date-format-modal.template.ts +0 -217
- package/src/new/main/edit-config/data-transforms-derived-fields/date-format-modal/date-format-modal.ts +0 -280
- package/src/new/main/edit-config/data-transforms-derived-fields/date-format-modal/index.ts +0 -1
- package/src/new/main/edit-config/data-transforms-derived-fields/format-warning.ts +0 -43
- package/src/new/main/edit-config/data-transforms-derived-fields/number-format-modal/index.ts +0 -1
- package/src/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.styles.ts +0 -68
- package/src/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.template.ts +0 -93
- package/src/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.ts +0 -152
- package/src/new/main/edit-config/datasource-config/datasource-config-container.styles.ts +0 -22
- package/src/new/main/edit-config/datasource-config/datasource-config-item.styles.ts +0 -76
- package/src/new/main/edit-config/datasource-config/datasource-config-item.template.ts +0 -141
- package/src/new/main/edit-config/datasource-config/datasource-config-item.ts +0 -212
- package/src/new/main/edit-config/datasource-config/datasources-config-container.helpers.test.ts +0 -341
- package/src/new/main/edit-config/datasource-config/datasources-config-container.helpers.ts +0 -99
- package/src/new/main/edit-config/datasource-config/datasources-config-container.template.ts +0 -68
- package/src/new/main/edit-config/datasource-config/datasources-config-container.ts +0 -55
- package/src/new/main/edit-config/datasource-config/types.ts +0 -6
- package/src/new/main/edit-config/outputs-config/outputs-config.style.ts +0 -11
- package/src/new/main/edit-config/outputs-config/outputs-config.template.ts +0 -66
- package/src/new/main/edit-config/outputs-config/outputs-config.ts +0 -66
- package/src/new/main/edit-config/row-filters/row-filters-tutorial.styles.ts +0 -16
- package/src/new/main/edit-config/row-filters/row-filters-tutorial.template.ts +0 -229
- package/src/new/main/edit-config/row-filters/row-filters-tutorial.ts +0 -15
- package/src/new/main/edit-config/row-filters/row-filters.helpers.test.ts +0 -2
- package/src/new/main/edit-config/row-filters/row-filters.helpers.ts +0 -53
- package/src/new/main/edit-config/row-filters/row-filters.styles.ts +0 -23
- package/src/new/main/edit-config/row-filters/row-filters.template.ts +0 -15
- package/src/new/main/edit-config/row-filters/row-filters.ts +0 -58
- package/src/new/main/edit-config/row-filters/row-filters.types.ts +0 -14
- package/src/new/main/edit-config/scheduling/scheduling.styles.ts +0 -59
- package/src/new/main/edit-config/scheduling/scheduling.template.ts +0 -80
- package/src/new/main/edit-config/scheduling/scheduling.ts +0 -101
- package/src/new/main/edit-config/shared/datasource-data-base-component.helpers.ts.ts +0 -250
- package/src/new/main/edit-config/shared/datasource-data-base-component.test.ts +0 -568
- package/src/new/main/edit-config/shared/datasource-data-base-component.ts +0 -65
- package/src/new/main/edit-config/shared/datasource-data-base-component.types.ts +0 -55
- package/src/new/main/edit-config/shared/index.ts +0 -3
- package/src/new/main/edit-config/tabbed-datasource-container/index.ts +0 -2
- package/src/new/main/edit-config/tabbed-datasource-container/tabbed-datasource-container.styles.ts +0 -12
- package/src/new/main/edit-config/tabbed-datasource-container/tabbed-datasource-container.template.ts +0 -29
- package/src/new/main/edit-config/tabbed-datasource-container/tabbed-datasource-container.ts +0 -69
- package/src/new/main/edit-config/tabbed-datasource-container/tabbed-datasource-container.types.ts +0 -7
- package/src/new/main/generated-reports/generated-reports.styles.ts +0 -15
- package/src/new/main/generated-reports/generated-reports.template.ts +0 -29
- package/src/new/main/generated-reports/generated-reports.ts +0 -270
- package/src/new/main/index.ts +0 -3
- package/src/new/main/main.styles.ts +0 -31
- package/src/new/main/main.template.ts +0 -92
- package/src/new/main/main.ts +0 -117
- package/src/new/main/report-destinations/report-destinations.template.ts +0 -39
- package/src/new/main/report-destinations/report-destinations.ts +0 -63
- package/src/new/store/index.ts +0 -3
- package/src/new/store/slices/base-config.ts +0 -50
- package/src/new/store/slices/datasources-config.ts +0 -297
- package/src/new/store/slices/index.ts +0 -3
- package/src/new/store/slices/types.ts +0 -90
- package/src/new/store/store.ts +0 -36
- package/src/new/store/types.ts +0 -10
- package/src/new/styles/constraints.styles.ts +0 -32
- package/src/new/styles/forms.styles.ts +0 -38
- package/src/new/styles/index.ts +0 -3
- package/src/new/styles/misc.styles.ts +0 -25
- package/src/new/types/display.ts +0 -4
- package/src/new/types/index.ts +0 -4
- package/src/new/types/misc.ts +0 -73
- package/src/new/types/redux.ts +0 -73
- package/src/new/types/rights.ts +0 -28
- package/src/new/utils/alias-generator.test.ts +0 -44
- package/src/new/utils/alias-generator.ts +0 -18
- package/src/new/utils/date-filter-params.ts +0 -28
- package/src/new/utils/endpoint.test.ts +0 -193
- package/src/new/utils/endpoint.ts +0 -62
- package/src/new/utils/event-map.ts +0 -11
- package/src/new/utils/format-utils.ts +0 -22
- package/src/new/utils/formatters.ts +0 -36
- package/src/new/utils/index.ts +0 -10
- package/src/new/utils/notifications.ts +0 -9
- package/src/new/utils/renderer.ts +0 -38
- package/src/new/utils/rights.ts +0 -66
- package/src/new/utils/sorter.ts +0 -19
- package/src/new/utils/tooltip.ts +0 -94
- package/src/new/utils/transformers.test.ts +0 -549
- package/src/new/utils/transformers.ts +0 -174
- package/src/new/utils/validators.test.ts +0 -165
- package/src/new/utils/validators.ts +0 -81
- package/src/old/assets/images/index.ts +0 -69
- package/src/old/components/create-edit/create-edit.styles.ts +0 -16
- package/src/old/components/create-edit/create-edit.template.ts +0 -15
- package/src/old/components/create-edit/create-edit.ts +0 -70
- package/src/old/components/create-edit/index.ts +0 -3
- package/src/old/components/list/columns.ts +0 -175
- package/src/old/components/list/index.ts +0 -3
- package/src/old/components/list/list.styles.ts +0 -9
- package/src/old/components/list/list.template.ts +0 -40
- package/src/old/components/list/list.ts +0 -109
- package/src/old/components/preview/columns.ts +0 -58
- package/src/old/components/preview/index.ts +0 -3
- package/src/old/components/preview/preview.styles.ts +0 -22
- package/src/old/components/preview/preview.template.ts +0 -33
- package/src/old/components/preview/preview.ts +0 -143
- package/src/old/components/rapid-components.ts +0 -64
- package/src/old/components/renderers/custom-header-component.ts +0 -92
- package/src/old/components/renderers/filter-value-renderer.ts +0 -237
- package/src/old/components/renderers/row-select.renderer.ts +0 -148
- package/src/old/components/select-fields/columns.ts +0 -83
- package/src/old/components/select-fields/data.ts +0 -218
- package/src/old/components/select-fields/index.ts +0 -3
- package/src/old/components/select-fields/select-fields.styles.ts +0 -22
- package/src/old/components/select-fields/select-fields.template.ts +0 -58
- package/src/old/components/select-fields/select-fields.ts +0 -218
- package/src/old/components/select-filters/columns.ts +0 -78
- package/src/old/components/select-filters/index.ts +0 -3
- package/src/old/components/select-filters/select-filters.styles.ts +0 -21
- package/src/old/components/select-filters/select-filters.template.ts +0 -58
- package/src/old/components/select-filters/select-filters.ts +0 -255
- package/src/old/components/wizard/debug.ts +0 -35
- package/src/old/components/wizard/index.ts +0 -2
- package/src/old/components/wizard/steps/filters.ts +0 -13
- package/src/old/components/wizard/steps/index.ts +0 -4
- package/src/old/components/wizard/steps/name.ts +0 -72
- package/src/old/components/wizard/steps/run.ts +0 -14
- package/src/old/components/wizard/steps/select.ts +0 -14
- package/src/old/components/wizard/wizard.styles.ts +0 -198
- package/src/old/components/wizard/wizard.template.ts +0 -147
- package/src/old/components/wizard/wizard.ts +0 -398
- package/src/old/components/wizard/wizard.types.ts +0 -43
- package/src/old/components/zero-components.ts +0 -61
- package/src/old/config/config.ts +0 -59
- package/src/old/config/configure.ts +0 -66
- package/src/old/config/index.ts +0 -2
- package/src/old/config/templates.ts +0 -59
- package/src/old/constants/grid-config.ts +0 -19
- package/src/old/layouts/default.ts +0 -30
- package/src/old/layouts/index.ts +0 -2
- package/src/old/layouts/two-pane-horizontal.ts +0 -81
- package/src/old/main/index.ts +0 -3
- package/src/old/main/main.styles.ts +0 -69
- package/src/old/main/main.template.ts +0 -127
- package/src/old/main/main.test.ts +0 -7
- package/src/old/main/main.ts +0 -250
- package/src/old/main/types.ts +0 -29
- package/src/old/styles/colors.ts +0 -16
- package/src/old/styles/helpers.ts +0 -181
- package/src/old/styles/index.ts +0 -4
- package/src/old/styles/normalize.ts +0 -14
- package/src/old/styles/styles.ts +0 -24
- package/src/old/tags/index.ts +0 -1
- package/src/old/tags/tags.ts +0 -79
- package/src/old/tsconfig.json +0 -10
- package/src/old/utils/filterObjectArray.test.ts +0 -110
- package/src/old/utils/filterObjectArray.ts +0 -23
- package/src/old/utils/getFiltersByType.ts +0 -92
- package/src/old/utils/getSelectedFields.ts +0 -16
- package/src/old/utils/index.ts +0 -4
- package/src/old/utils/logger.ts +0 -3
- package/src/sandbox.ts +0 -51
- package/src/tsconfig.base.json +0 -24
- package/src/typings.d.ts +0 -1
- package/tsconfig.json +0 -9
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '@genesislcap/foundation-events';
|
|
2
|
-
import { formatTimestamp } from '@genesislcap/foundation-utils';
|
|
3
|
-
import { Modal } from '@genesislcap/rapid-design-system';
|
|
4
|
-
import { customElement, DOM, GenesisElement, observable, volatile } from '@genesislcap/web-core';
|
|
5
|
-
import { actions, selectors, subscribe } from '../../../../store';
|
|
6
|
-
import { getDateFormatOptions } from '../../../../utils';
|
|
7
|
-
import { ReportingEventDetailMap, ReportingEvents } from '../../../../utils/event-map';
|
|
8
|
-
import { datasourceNameFromDisplay, GridColumnNames } from '../../shared';
|
|
9
|
-
import { mapToDateFormat } from '../data-transforms.helpers';
|
|
10
|
-
import {
|
|
11
|
-
FormatTypes,
|
|
12
|
-
DateLocaleFormats,
|
|
13
|
-
DateMonthFormats,
|
|
14
|
-
DateStandardFormats,
|
|
15
|
-
DateTimeFormats,
|
|
16
|
-
DateYearFormats,
|
|
17
|
-
DisplayConfigurationRow,
|
|
18
|
-
DateDisplayConfigurationRow,
|
|
19
|
-
DatetimeDisplayConfigurationRow,
|
|
20
|
-
} from '../data-transforms.types';
|
|
21
|
-
import { dateFormatModalStyles as styles } from './date-format-modal.styles';
|
|
22
|
-
import { dateFormatModalTemplate as template } from './date-format-modal.template';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Modal to edit date/datetime column display formats.
|
|
26
|
-
* @public
|
|
27
|
-
*
|
|
28
|
-
* @fires refresh-column-format-grid
|
|
29
|
-
*/
|
|
30
|
-
@customElement({
|
|
31
|
-
name: 'date-format-modal',
|
|
32
|
-
template,
|
|
33
|
-
styles,
|
|
34
|
-
})
|
|
35
|
-
export class DateFormatModal extends EventEmitter<ReportingEventDetailMap>(GenesisElement) {
|
|
36
|
-
dateModal: Modal;
|
|
37
|
-
@observable isXlsx: boolean = false;
|
|
38
|
-
private unsubscribe: () => void;
|
|
39
|
-
|
|
40
|
-
@observable displayConfigurationRow:
|
|
41
|
-
| DateDisplayConfigurationRow
|
|
42
|
-
| DatetimeDisplayConfigurationRow
|
|
43
|
-
| null = null;
|
|
44
|
-
|
|
45
|
-
connectedCallback() {
|
|
46
|
-
super.connectedCallback();
|
|
47
|
-
this.updateState();
|
|
48
|
-
this.unsubscribe = subscribe(this.updateState);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
disconnectedCallback() {
|
|
52
|
-
super.disconnectedCallback();
|
|
53
|
-
if (this.unsubscribe) {
|
|
54
|
-
this.unsubscribe();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
updateState = () => {
|
|
59
|
-
this.isXlsx = selectors.baseConfig.getConfig().OUTPUT_FORMAT === 'XLSX';
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
displayConfigurationRowChanged(oldValue, newValue) {
|
|
63
|
-
if (newValue) {
|
|
64
|
-
this.resetDateValues();
|
|
65
|
-
|
|
66
|
-
DOM.queueUpdate(() => {
|
|
67
|
-
this.getDateFormats();
|
|
68
|
-
this.getDateTimeFormats();
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
@observable gridLocaleType: DateLocaleFormats | undefined = undefined;
|
|
73
|
-
gridLocaleTypeChanged(_: string, newValue: DateLocaleFormats) {
|
|
74
|
-
if (!newValue) return;
|
|
75
|
-
if (
|
|
76
|
-
!(
|
|
77
|
-
this.displayConfigurationRow[GridColumnNames.Type] === FormatTypes.Date ||
|
|
78
|
-
this.displayConfigurationRow[GridColumnNames.Type] === FormatTypes.Datetime
|
|
79
|
-
)
|
|
80
|
-
) {
|
|
81
|
-
throw new Error('Setting local type unavailable');
|
|
82
|
-
}
|
|
83
|
-
if (this.displayConfigurationRow.format === newValue || !newValue) return;
|
|
84
|
-
this.displayConfigurationRow.format = newValue;
|
|
85
|
-
|
|
86
|
-
this.resetDateValues();
|
|
87
|
-
|
|
88
|
-
DOM.queueUpdate(() => {
|
|
89
|
-
this.getDateFormats();
|
|
90
|
-
this.getDateTimeFormats();
|
|
91
|
-
this.formatString = mapToDateFormat(this.displayConfigurationRow);
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
@observable gridYearType: DateYearFormats | undefined = undefined;
|
|
96
|
-
gridYearTypeChanged(_: string, newValue: DateYearFormats) {
|
|
97
|
-
if (!newValue) return;
|
|
98
|
-
if (
|
|
99
|
-
!(
|
|
100
|
-
this.displayConfigurationRow[GridColumnNames.Type] === FormatTypes.Date ||
|
|
101
|
-
this.displayConfigurationRow[GridColumnNames.Type] === FormatTypes.Datetime
|
|
102
|
-
)
|
|
103
|
-
) {
|
|
104
|
-
throw new Error('Setting year type unavailable');
|
|
105
|
-
}
|
|
106
|
-
if (this.displayConfigurationRow.year === newValue || !newValue) return;
|
|
107
|
-
this.displayConfigurationRow.year = newValue;
|
|
108
|
-
this.formatString = mapToDateFormat(this.displayConfigurationRow);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
@observable gridMonthType: DateMonthFormats | undefined = undefined;
|
|
112
|
-
gridMonthTypeChanged(_: string, newValue: DateMonthFormats) {
|
|
113
|
-
if (!newValue) return;
|
|
114
|
-
if (
|
|
115
|
-
!(
|
|
116
|
-
this.displayConfigurationRow[GridColumnNames.Type] === FormatTypes.Date ||
|
|
117
|
-
this.displayConfigurationRow[GridColumnNames.Type] === FormatTypes.Datetime
|
|
118
|
-
)
|
|
119
|
-
) {
|
|
120
|
-
throw new Error('Setting month type unavailable');
|
|
121
|
-
}
|
|
122
|
-
if (this.displayConfigurationRow.month === newValue || !newValue) return;
|
|
123
|
-
this.displayConfigurationRow.month = newValue;
|
|
124
|
-
this.formatString = mapToDateFormat(this.displayConfigurationRow);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
@observable gridDayType: DateStandardFormats | undefined = undefined;
|
|
128
|
-
gridDayTypeChanged(_: string, newValue: DateStandardFormats) {
|
|
129
|
-
if (!newValue) return;
|
|
130
|
-
if (
|
|
131
|
-
!(
|
|
132
|
-
this.displayConfigurationRow[GridColumnNames.Type] === FormatTypes.Date ||
|
|
133
|
-
this.displayConfigurationRow[GridColumnNames.Type] === FormatTypes.Datetime
|
|
134
|
-
)
|
|
135
|
-
) {
|
|
136
|
-
throw new Error('Setting day type unavailable');
|
|
137
|
-
}
|
|
138
|
-
if (this.displayConfigurationRow.day === newValue || !newValue) return;
|
|
139
|
-
this.displayConfigurationRow.day = newValue;
|
|
140
|
-
this.formatString = mapToDateFormat(this.displayConfigurationRow);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
@observable gridHourType: DateTimeFormats | undefined = undefined;
|
|
144
|
-
gridHourTypeChanged(_: string, newValue: DateTimeFormats) {
|
|
145
|
-
if (!newValue) return;
|
|
146
|
-
if (!(this.displayConfigurationRow.type === FormatTypes.Datetime)) {
|
|
147
|
-
throw new Error('Setting hour type unavailable');
|
|
148
|
-
}
|
|
149
|
-
if (this.displayConfigurationRow.hour === newValue || !newValue) return;
|
|
150
|
-
this.displayConfigurationRow.hour = newValue;
|
|
151
|
-
this.formatString = mapToDateFormat(this.displayConfigurationRow);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
@observable gridMinuteType: DateTimeFormats | undefined = undefined;
|
|
155
|
-
gridMinuteTypeChanged(_: string, newValue: DateTimeFormats) {
|
|
156
|
-
if (!newValue) return;
|
|
157
|
-
if (!(this.displayConfigurationRow.type === FormatTypes.Datetime)) {
|
|
158
|
-
throw new Error('Setting minute type unavailable');
|
|
159
|
-
}
|
|
160
|
-
if (this.displayConfigurationRow.minute === newValue || !newValue) return;
|
|
161
|
-
this.displayConfigurationRow.minute = newValue;
|
|
162
|
-
this.formatString = mapToDateFormat(this.displayConfigurationRow);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
@observable gridSecondType: DateTimeFormats | undefined = undefined;
|
|
166
|
-
gridSecondTypeChanged(_: string, newValue: DateTimeFormats) {
|
|
167
|
-
if (!newValue) return;
|
|
168
|
-
if (!(this.displayConfigurationRow.type === FormatTypes.Datetime)) {
|
|
169
|
-
throw new Error('Setting second type unavailable');
|
|
170
|
-
}
|
|
171
|
-
if (this.displayConfigurationRow.second === newValue || !newValue) return;
|
|
172
|
-
this.displayConfigurationRow.second = newValue;
|
|
173
|
-
this.formatString = mapToDateFormat(this.displayConfigurationRow);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
showModal(displayConfigurationRow: DisplayConfigurationRow) {
|
|
177
|
-
// Type guard to ensure we only accept date/datetime configurations
|
|
178
|
-
if (
|
|
179
|
-
displayConfigurationRow.type === FormatTypes.Date ||
|
|
180
|
-
displayConfigurationRow.type === FormatTypes.Datetime
|
|
181
|
-
) {
|
|
182
|
-
this.displayConfigurationRow = displayConfigurationRow as
|
|
183
|
-
| DateDisplayConfigurationRow
|
|
184
|
-
| DatetimeDisplayConfigurationRow;
|
|
185
|
-
this.formatString =
|
|
186
|
-
displayConfigurationRow.format !== DateLocaleFormats.Unformatted
|
|
187
|
-
? mapToDateFormat(this.displayConfigurationRow)
|
|
188
|
-
: '';
|
|
189
|
-
this.dateModal.show();
|
|
190
|
-
} else {
|
|
191
|
-
throw new Error('Date format modal can only handle Date or Datetime configurations');
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
discardChanges() {
|
|
196
|
-
this.resetDisplayRow();
|
|
197
|
-
this.formatString = '';
|
|
198
|
-
this.dateModal.close();
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
saveChanges() {
|
|
202
|
-
if (!this.gridLocaleType || this.gridLocaleType === DateLocaleFormats.Unformatted) {
|
|
203
|
-
actions.datasourceConfig.deleteColumnFormat({
|
|
204
|
-
key: datasourceNameFromDisplay(this.displayConfigurationRow[GridColumnNames.Datasource]),
|
|
205
|
-
column: this.displayConfigurationRow[GridColumnNames.ColumnName],
|
|
206
|
-
});
|
|
207
|
-
} else {
|
|
208
|
-
const format = mapToDateFormat(this.displayConfigurationRow);
|
|
209
|
-
actions.datasourceConfig.setColumnFormat({
|
|
210
|
-
key: datasourceNameFromDisplay(this.displayConfigurationRow[GridColumnNames.Datasource]),
|
|
211
|
-
column: this.displayConfigurationRow[GridColumnNames.ColumnName],
|
|
212
|
-
format,
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
this.$emit(ReportingEvents.refreshColumnFormatGrid);
|
|
216
|
-
DOM.queueUpdate(() => {
|
|
217
|
-
this.resetDisplayRow();
|
|
218
|
-
this.dateModal.close();
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
@volatile
|
|
223
|
-
get dateFormatOptions() {
|
|
224
|
-
const date = new Date('2050-2-2').getTime();
|
|
225
|
-
if (this.gridLocaleType === DateLocaleFormats.Unformatted) {
|
|
226
|
-
return formatTimestamp(
|
|
227
|
-
date,
|
|
228
|
-
this.displayConfigurationRow?.[GridColumnNames.Type] === 'DATETIME' ? true : false,
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
const options = getDateFormatOptions({
|
|
233
|
-
year: this.gridYearType,
|
|
234
|
-
month: this.gridMonthType,
|
|
235
|
-
day: this.gridDayType,
|
|
236
|
-
hour: this.gridHourType,
|
|
237
|
-
minute: this.gridMinuteType,
|
|
238
|
-
second: this.gridSecondType,
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
if (this.displayConfigurationRow)
|
|
242
|
-
return Intl.DateTimeFormat(this.gridLocaleType, options).format(date);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
@observable formatString: string;
|
|
246
|
-
|
|
247
|
-
getDateTimeFormats() {
|
|
248
|
-
if (this.displayConfigurationRow.type === FormatTypes.Datetime) {
|
|
249
|
-
this.gridHourType = (<{ hour?: DateTimeFormats }>this.displayConfigurationRow).hour;
|
|
250
|
-
this.gridMinuteType = (<{ minute?: DateTimeFormats }>this.displayConfigurationRow).minute;
|
|
251
|
-
this.gridSecondType = (<{ second?: DateTimeFormats }>this.displayConfigurationRow).second;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
resetDisplayRow() {
|
|
256
|
-
this.displayConfigurationRow = undefined;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
resetDateValues() {
|
|
260
|
-
this.gridLocaleType = undefined;
|
|
261
|
-
this.gridDayType = undefined;
|
|
262
|
-
this.gridMonthType = undefined;
|
|
263
|
-
this.gridYearType = undefined;
|
|
264
|
-
this.gridHourType = undefined;
|
|
265
|
-
this.gridMinuteType = undefined;
|
|
266
|
-
this.gridSecondType = undefined;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
getDateFormats() {
|
|
270
|
-
if (
|
|
271
|
-
this.displayConfigurationRow[GridColumnNames.Type] === FormatTypes.Date ||
|
|
272
|
-
this.displayConfigurationRow[GridColumnNames.Type] === FormatTypes.Datetime
|
|
273
|
-
) {
|
|
274
|
-
this.gridLocaleType = (<{ format?: DateLocaleFormats }>this.displayConfigurationRow).format;
|
|
275
|
-
this.gridYearType = (<{ year?: DateYearFormats }>this.displayConfigurationRow).year;
|
|
276
|
-
this.gridMonthType = (<{ month?: DateMonthFormats }>this.displayConfigurationRow).month;
|
|
277
|
-
this.gridDayType = (<{ day?: DateStandardFormats }>this.displayConfigurationRow).day;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './date-format-modal';
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { customElement, html, css, GenesisElement, attr, classNames } from '@genesislcap/web-core';
|
|
2
|
-
|
|
3
|
-
@customElement({
|
|
4
|
-
name: 'format-warning',
|
|
5
|
-
template: html<FormatWarning>`
|
|
6
|
-
<div class="${(x) => classNames(['warning', x.warning])}">
|
|
7
|
-
<p>
|
|
8
|
-
<strong class="${(x) => classNames(['warning', x.warning])}">
|
|
9
|
-
${(x) => (x.warning ? 'Warning' : 'Info')}:
|
|
10
|
-
</strong>
|
|
11
|
-
Reporting generates
|
|
12
|
-
<code>.xlsx</code>
|
|
13
|
-
files with dates and numbers correctly formatted for Excel by default. If you enable formats
|
|
14
|
-
for dates or numbers they'll be interpreted as text in Excel.
|
|
15
|
-
</p>
|
|
16
|
-
</div>
|
|
17
|
-
`,
|
|
18
|
-
styles: css`
|
|
19
|
-
div {
|
|
20
|
-
border-color: var(--accent-foreground-rest);
|
|
21
|
-
border-width: 1px;
|
|
22
|
-
border-style: solid;
|
|
23
|
-
padding-left: calc(var(--design-unit) * 3px);
|
|
24
|
-
padding-right: calc(var(--design-unit) * 3px);
|
|
25
|
-
border-radius: 3px;
|
|
26
|
-
}
|
|
27
|
-
div.warning {
|
|
28
|
-
border-color: var(--warning-color);
|
|
29
|
-
}
|
|
30
|
-
p {
|
|
31
|
-
margin: calc(var(--design-unit) * 1px);
|
|
32
|
-
}
|
|
33
|
-
strong {
|
|
34
|
-
color: var(--accent-foreground-rest);
|
|
35
|
-
}
|
|
36
|
-
strong.warning {
|
|
37
|
-
color: var(--warning-color);
|
|
38
|
-
}
|
|
39
|
-
`,
|
|
40
|
-
})
|
|
41
|
-
export class FormatWarning extends GenesisElement {
|
|
42
|
-
@attr({ mode: 'boolean' }) warning: boolean = false;
|
|
43
|
-
}
|
package/src/new/main/edit-config/data-transforms-derived-fields/number-format-modal/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './number-format-modal';
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { css } from '@genesislcap/web-core';
|
|
2
|
-
|
|
3
|
-
export const numberFormatModalStyles = css`
|
|
4
|
-
.number-format-select {
|
|
5
|
-
min-width: 230px;
|
|
6
|
-
max-width: 230px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.format-options-container {
|
|
10
|
-
display: flex;
|
|
11
|
-
gap: 10px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.modal-format-options {
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
gap: 10px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.label {
|
|
21
|
-
color: var(--neutral-foreground-hint);
|
|
22
|
-
margin: 0;
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
font-size: var(--type-ramp-base-font-size);
|
|
25
|
-
line-height: var(--type-ramp-base-line-height);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.action-button-container {
|
|
29
|
-
display: flex;
|
|
30
|
-
justify-content: flex-end;
|
|
31
|
-
gap: calc(var(--design-unit) * 2.5px);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.save-button {
|
|
35
|
-
max-width: 100px;
|
|
36
|
-
align-self: flex-end;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
rapid-number-field {
|
|
40
|
-
display: flex;
|
|
41
|
-
width: fit-content;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
rapid-number-field::part(root) {
|
|
45
|
-
width: 230px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.footer-container {
|
|
49
|
-
display: flex;
|
|
50
|
-
justify-content: space-between;
|
|
51
|
-
align-items: center;
|
|
52
|
-
padding-top: calc(var(--design-unit) * 4px);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.footer-container p {
|
|
56
|
-
color: var(--neutral-foreground-hint);
|
|
57
|
-
font-size: var(--type-ramp-base-font-size);
|
|
58
|
-
font-weight: 500;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
rapid-modal::part(top) {
|
|
62
|
-
font-weight: 600;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
rapid-modal {
|
|
66
|
-
--dialog-min-width: 420px;
|
|
67
|
-
}
|
|
68
|
-
`;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { sync } from '@genesislcap/foundation-utils';
|
|
2
|
-
import { html, ref, repeat, when } from '@genesislcap/web-core';
|
|
3
|
-
import {
|
|
4
|
-
NumericCurrencies,
|
|
5
|
-
NumericFormats,
|
|
6
|
-
numericFormatsWithLabels,
|
|
7
|
-
} from '../data-transforms.types';
|
|
8
|
-
import type { NumberFormatModal } from './number-format-modal';
|
|
9
|
-
|
|
10
|
-
export const numberFormatModalTemplate = html<NumberFormatModal>`
|
|
11
|
-
<rapid-modal
|
|
12
|
-
${ref('numberModal')}
|
|
13
|
-
show-close-icon="false"
|
|
14
|
-
:onCloseCallback=${(x) => x.resetDisplayRow}
|
|
15
|
-
>
|
|
16
|
-
<p slot="top">Configure Number Format</p>
|
|
17
|
-
<div class="modal-format-options">
|
|
18
|
-
<label class="label">Format Type</label>
|
|
19
|
-
<rapid-select
|
|
20
|
-
data-test-id="number-format-select-format-type"
|
|
21
|
-
class="number-format-select"
|
|
22
|
-
:value="${sync((x) => x.gridFormatType)}"
|
|
23
|
-
>
|
|
24
|
-
${repeat(
|
|
25
|
-
() => numericFormatsWithLabels,
|
|
26
|
-
html`
|
|
27
|
-
<rapid-option data-test-id="${(x) => x.label}" value="${(x) => x.value}">
|
|
28
|
-
${(x) => x.label}
|
|
29
|
-
</rapid-option>
|
|
30
|
-
`,
|
|
31
|
-
)}
|
|
32
|
-
</rapid-select>
|
|
33
|
-
${when(
|
|
34
|
-
(x) =>
|
|
35
|
-
x.gridFormatType !== NumericFormats.CurrencyRounded &&
|
|
36
|
-
x.gridFormatType !== NumericFormats.Unformatted,
|
|
37
|
-
html`
|
|
38
|
-
<label class="label">Decimal Places</label>
|
|
39
|
-
<rapid-number-field
|
|
40
|
-
data-test-id="attribute-form-number-decimals"
|
|
41
|
-
value="${sync((x) => x.gridFormatDecimalPlaces, 'number', 'input')}"
|
|
42
|
-
placeholder="Decimal places"
|
|
43
|
-
maxlength="1"
|
|
44
|
-
min="0"
|
|
45
|
-
></rapid-number-field>
|
|
46
|
-
`,
|
|
47
|
-
)}
|
|
48
|
-
${when(
|
|
49
|
-
(x) =>
|
|
50
|
-
x.gridFormatType === NumericFormats.Currency ||
|
|
51
|
-
x.gridFormatType === NumericFormats.CurrencyRounded,
|
|
52
|
-
html`
|
|
53
|
-
<label class="label">Currency</label>
|
|
54
|
-
<rapid-select
|
|
55
|
-
data-test-id="number-format-select-currency"
|
|
56
|
-
class="number-format-select"
|
|
57
|
-
:value="${sync((x) => x.gridFormatCurrency)}"
|
|
58
|
-
>
|
|
59
|
-
${repeat(
|
|
60
|
-
() => Object.values(NumericCurrencies),
|
|
61
|
-
html`
|
|
62
|
-
<rapid-option data-test-id="${(x) => x}">${(x) => x}</rapid-option>
|
|
63
|
-
`,
|
|
64
|
-
)}
|
|
65
|
-
</rapid-select>
|
|
66
|
-
`,
|
|
67
|
-
)}
|
|
68
|
-
<div class="footer-container">
|
|
69
|
-
<p>
|
|
70
|
-
${(x) =>
|
|
71
|
-
x.gridFormatType !== NumericFormats.Unformatted ? `Formatted: ${x.formatPreview}` : ''}
|
|
72
|
-
</p>
|
|
73
|
-
<div class="action-button-container">
|
|
74
|
-
<rapid-button
|
|
75
|
-
data-test-id="date-format-cancel"
|
|
76
|
-
class="save-button"
|
|
77
|
-
@click=${(x) => x.discardChanges()}
|
|
78
|
-
>
|
|
79
|
-
Discard
|
|
80
|
-
</rapid-button>
|
|
81
|
-
<rapid-button
|
|
82
|
-
data-test-id="number-format-save"
|
|
83
|
-
class="save-button"
|
|
84
|
-
appearance="primary"
|
|
85
|
-
@click=${(x) => x.saveChanges()}
|
|
86
|
-
>
|
|
87
|
-
Save
|
|
88
|
-
</rapid-button>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
</rapid-modal>
|
|
93
|
-
`;
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '@genesislcap/foundation-events';
|
|
2
|
-
import { Modal } from '@genesislcap/rapid-design-system';
|
|
3
|
-
import { customElement, DOM, GenesisElement, observable, volatile } from '@genesislcap/web-core';
|
|
4
|
-
import { actions, selectors, subscribe } from '../../../../store';
|
|
5
|
-
import { ReportingEventDetailMap, ReportingEvents } from '../../../../utils/event-map';
|
|
6
|
-
import { datasourceNameFromDisplay, GridColumnNames } from '../../shared';
|
|
7
|
-
import { mapToNumberFormat } from '../data-transforms.helpers';
|
|
8
|
-
import {
|
|
9
|
-
NumericCurrencies,
|
|
10
|
-
NumericFormats,
|
|
11
|
-
isNumericFieldType,
|
|
12
|
-
DisplayConfigurationRow,
|
|
13
|
-
NumericDisplayConfigurationRow,
|
|
14
|
-
} from '../data-transforms.types';
|
|
15
|
-
import { numberFormatModalStyles as styles } from './number-format-modal.styles';
|
|
16
|
-
import { numberFormatModalTemplate as template } from './number-format-modal.template';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Modal to edit numeric column display formats.
|
|
20
|
-
* @public
|
|
21
|
-
*
|
|
22
|
-
* @fires refresh-column-format-grid
|
|
23
|
-
*/
|
|
24
|
-
@customElement({
|
|
25
|
-
name: 'number-format-modal',
|
|
26
|
-
template,
|
|
27
|
-
styles,
|
|
28
|
-
})
|
|
29
|
-
export class NumberFormatModal extends EventEmitter<ReportingEventDetailMap>(GenesisElement) {
|
|
30
|
-
numberModal: Modal;
|
|
31
|
-
@observable isXlsx: boolean = false;
|
|
32
|
-
private unsubscribe: () => void;
|
|
33
|
-
|
|
34
|
-
@observable displayConfigurationRow: NumericDisplayConfigurationRow | null = null;
|
|
35
|
-
displayConfigurationRowChanged(oldValue, newValue) {
|
|
36
|
-
if (newValue) this.getGridFormat();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
connectedCallback() {
|
|
40
|
-
super.connectedCallback();
|
|
41
|
-
this.updateState();
|
|
42
|
-
this.unsubscribe = subscribe(this.updateState);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
disconnectedCallback() {
|
|
46
|
-
super.disconnectedCallback();
|
|
47
|
-
if (this.unsubscribe) {
|
|
48
|
-
this.unsubscribe();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
updateState = () => {
|
|
53
|
-
this.isXlsx = selectors.baseConfig.getConfig().OUTPUT_FORMAT === 'XLSX';
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
@observable gridFormatType: NumericFormats | undefined = undefined;
|
|
57
|
-
gridFormatTypeChanged(_: string, newValue: NumericFormats) {
|
|
58
|
-
if (!newValue) return;
|
|
59
|
-
if (this.displayConfigurationRow.format === newValue || !newValue) return;
|
|
60
|
-
this.displayConfigurationRow.format = newValue;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@observable gridFormatDecimalPlaces: number | undefined = undefined;
|
|
64
|
-
gridFormatDecimalPlacesChanged(_: string, newValue: number) {
|
|
65
|
-
if (!newValue) return;
|
|
66
|
-
if (this.displayConfigurationRow.decimalPlaces === newValue) return;
|
|
67
|
-
this.displayConfigurationRow.decimalPlaces = newValue;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
@observable gridFormatCurrency: NumericCurrencies | undefined = undefined;
|
|
71
|
-
gridFormatCurrencyChanged(_: string, newValue: NumericCurrencies) {
|
|
72
|
-
if (!newValue) return;
|
|
73
|
-
if (this.displayConfigurationRow.currency === newValue || !newValue) return;
|
|
74
|
-
this.displayConfigurationRow.currency = newValue;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
showModal(displayConfigurationRow: DisplayConfigurationRow) {
|
|
78
|
-
if (isNumericFieldType(displayConfigurationRow.type)) {
|
|
79
|
-
this.displayConfigurationRow = displayConfigurationRow as NumericDisplayConfigurationRow;
|
|
80
|
-
this.numberModal.show();
|
|
81
|
-
} else {
|
|
82
|
-
throw new Error('Number format modal can only handle numeric configurations');
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
saveChanges() {
|
|
87
|
-
if (!this.gridFormatType || this.gridFormatType === NumericFormats.Unformatted) {
|
|
88
|
-
actions.datasourceConfig.deleteColumnFormat({
|
|
89
|
-
key: datasourceNameFromDisplay(this.displayConfigurationRow[GridColumnNames.Datasource]),
|
|
90
|
-
column: this.displayConfigurationRow[GridColumnNames.ColumnName],
|
|
91
|
-
});
|
|
92
|
-
} else {
|
|
93
|
-
const format = mapToNumberFormat(
|
|
94
|
-
this.gridFormatType || NumericFormats.Unformatted,
|
|
95
|
-
this.gridFormatDecimalPlaces,
|
|
96
|
-
this.gridFormatCurrency,
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
actions.datasourceConfig.setColumnFormat({
|
|
100
|
-
key: datasourceNameFromDisplay(this.displayConfigurationRow[GridColumnNames.Datasource]),
|
|
101
|
-
column: this.displayConfigurationRow[GridColumnNames.ColumnName],
|
|
102
|
-
format,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
this.$emit(ReportingEvents.refreshColumnFormatGrid);
|
|
106
|
-
DOM.queueUpdate(() => {
|
|
107
|
-
this.resetNumberValues();
|
|
108
|
-
this.numberModal.close();
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
resetDisplayRow() {
|
|
113
|
-
this.displayConfigurationRow = undefined;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
resetNumberValues() {
|
|
117
|
-
this.gridFormatType = undefined;
|
|
118
|
-
this.gridFormatCurrency = undefined;
|
|
119
|
-
this.gridFormatDecimalPlaces = undefined;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
discardChanges() {
|
|
123
|
-
this.resetDisplayRow();
|
|
124
|
-
this.resetNumberValues();
|
|
125
|
-
this.numberModal.close();
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
getGridFormat() {
|
|
129
|
-
this.gridFormatType = this.displayConfigurationRow.format as NumericFormats;
|
|
130
|
-
this.gridFormatCurrency = this.displayConfigurationRow.currency;
|
|
131
|
-
this.gridFormatDecimalPlaces = this.displayConfigurationRow.decimalPlaces;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
@volatile
|
|
135
|
-
get formatPreview() {
|
|
136
|
-
if (!this.gridFormatType || this.gridFormatType === NumericFormats.Unformatted) {
|
|
137
|
-
return '';
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const formatString = mapToNumberFormat(
|
|
141
|
-
this.gridFormatType,
|
|
142
|
-
this.gridFormatDecimalPlaces,
|
|
143
|
-
this.gridFormatCurrency,
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
if (!formatString) {
|
|
147
|
-
return '';
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return formatString;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { css } from '@genesislcap/web-core';
|
|
2
|
-
|
|
3
|
-
export const styles = css`
|
|
4
|
-
div.container {
|
|
5
|
-
display: flex;
|
|
6
|
-
justify-content: space-between;
|
|
7
|
-
align-items: center;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
rapid-button.add {
|
|
11
|
-
display: flex;
|
|
12
|
-
margin: 5px;
|
|
13
|
-
background-color: var(--success-color);
|
|
14
|
-
min-width: calc(var(--base-height-multiplier) * (var(--design-unit) - 1) * 1px);
|
|
15
|
-
width: calc(var(--base-height-multiplier) * (var(--design-unit) - 1) * 1px);
|
|
16
|
-
height: calc(var(--base-height-multiplier) * (var(--design-unit) - 1) * 1px);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
rapid-button.add::part(control) {
|
|
20
|
-
padding: 0;
|
|
21
|
-
}
|
|
22
|
-
`;
|