@talxis/base-controls 1.2501.10 → 1.2503.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/components/DatasetControl/DatasetControl.js +21 -34
- package/dist/components/DatasetControl/DatasetControl.js.map +1 -1
- package/dist/components/DatasetControl/ErrorBoundary.js +33 -0
- package/dist/components/DatasetControl/ErrorBoundary.js.map +1 -0
- package/dist/components/DatasetControl/QuickFind/QuickFind.d.ts +10 -0
- package/dist/components/DatasetControl/QuickFind/QuickFind.js +38 -0
- package/dist/components/DatasetControl/QuickFind/QuickFind.js.map +1 -0
- package/dist/components/DatasetControl/styles.d.ts +3 -1
- package/dist/components/DatasetControl/styles.js +2 -2
- package/dist/components/DatasetControl/styles.js.map +1 -1
- package/dist/components/DatasetControl/translations.d.ts +8 -0
- package/dist/components/DatasetControl/translations.js +3 -1
- package/dist/components/DatasetControl/translations.js.map +1 -1
- package/dist/components/DateTime/DateTime.js +2 -1
- package/dist/components/DateTime/DateTime.js.map +1 -1
- package/dist/components/DateTime/components/Calendar.d.ts +2 -1
- package/dist/components/DateTime/components/Calendar.js +4 -4
- package/dist/components/DateTime/components/Calendar.js.map +1 -1
- package/dist/components/DateTime/hooks/useDateTime.js +18 -17
- package/dist/components/DateTime/hooks/useDateTime.js.map +1 -1
- package/dist/components/DateTime/translations.d.ts +1 -1
- package/dist/components/Decimal/Decimal.js +5 -1
- package/dist/components/Decimal/Decimal.js.map +1 -1
- package/dist/components/Duration/Duration.js +49 -26
- package/dist/components/Duration/Duration.js.map +1 -1
- package/dist/components/Duration/durationOptions.d.ts +1 -1
- package/dist/components/Grid/Grid.js +1 -1
- package/dist/components/Grid/Grid.js.map +1 -1
- package/dist/components/Grid/core/components/AgGrid/AgGrid.js +78 -174
- package/dist/components/Grid/core/components/AgGrid/AgGrid.js.map +1 -1
- package/dist/components/Grid/core/components/AgGrid/context.d.ts +3 -0
- package/dist/components/Grid/core/components/AgGrid/context.js +6 -0
- package/dist/components/Grid/core/components/AgGrid/context.js.map +1 -0
- package/dist/components/Grid/core/components/AgGrid/model/AgGrid.d.ts +41 -6
- package/dist/components/Grid/core/components/AgGrid/model/AgGrid.js +235 -49
- package/dist/components/Grid/core/components/AgGrid/model/AgGrid.js.map +1 -1
- package/dist/components/Grid/core/components/AgGrid/model/Comparator.d.ts +9 -0
- package/dist/components/Grid/core/components/AgGrid/model/Comparator.js +86 -0
- package/dist/components/Grid/core/components/AgGrid/model/Comparator.js.map +1 -0
- package/dist/components/Grid/core/components/AgGrid/styles.d.ts +28 -32
- package/dist/components/Grid/core/components/AgGrid/styles.js +31 -35
- package/dist/components/Grid/core/components/AgGrid/styles.js.map +1 -1
- package/dist/components/Grid/core/components/Cell/Cell.d.ts +13 -0
- package/dist/components/Grid/core/components/Cell/Cell.js +145 -0
- package/dist/components/Grid/core/components/Cell/Cell.js.map +1 -0
- package/dist/components/Grid/core/components/Cell/CellContent/CellContent.d.ts +3 -0
- package/dist/components/Grid/core/components/Cell/CellContent/CellContent.js +212 -0
- package/dist/components/Grid/core/components/Cell/CellContent/CellContent.js.map +1 -0
- package/dist/components/Grid/core/components/Cell/CellContent/styles.d.ts +33 -0
- package/dist/components/Grid/core/components/Cell/CellContent/styles.js +39 -0
- package/dist/components/Grid/core/components/Cell/CellContent/styles.js.map +1 -0
- package/dist/components/Grid/core/components/Cell/Commands/Commands.js.map +1 -1
- package/dist/components/Grid/core/components/Cell/Notifications/Notifications.d.ts +12 -0
- package/dist/components/Grid/core/components/Cell/Notifications/Notifications.js +112 -0
- package/dist/components/Grid/core/components/Cell/Notifications/Notifications.js.map +1 -0
- package/dist/components/Grid/core/components/Cell/Notifications/styles.d.ts +39 -0
- package/dist/components/Grid/core/components/Cell/Notifications/styles.js +46 -0
- package/dist/components/Grid/core/components/Cell/Notifications/styles.js.map +1 -0
- package/dist/components/Grid/core/components/Cell/styles.d.ts +40 -0
- package/dist/components/Grid/core/components/Cell/styles.js +59 -0
- package/dist/components/Grid/core/components/Cell/styles.js.map +1 -0
- package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.js +3 -2
- package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.js.map +1 -1
- package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/GlobalCheckbox.js +31 -13
- package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/GlobalCheckbox.js.map +1 -1
- package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.d.ts +3 -2
- package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.js +5 -4
- package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.js.map +1 -1
- package/dist/components/Grid/core/components/ColumnHeader/styles.d.ts +3 -1
- package/dist/components/Grid/core/components/ColumnHeader/styles.js +4 -2
- package/dist/components/Grid/core/components/ColumnHeader/styles.js.map +1 -1
- package/dist/components/Grid/core/components/Save/Save.js +5 -6
- package/dist/components/Grid/core/components/Save/Save.js.map +1 -1
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/ChangeEditor.js +10 -7
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/ChangeEditor.js.map +1 -1
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.d.ts +1 -0
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.js +26 -7
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.js.map +1 -1
- package/dist/components/Grid/core/controllers/useGridController.js +8 -2
- package/dist/components/Grid/core/controllers/useGridController.js.map +1 -1
- package/dist/components/Grid/core/interfaces/IGridColumn.d.ts +2 -0
- package/dist/components/Grid/core/model/Grid.d.ts +17 -8
- package/dist/components/Grid/core/model/Grid.js +229 -45
- package/dist/components/Grid/core/model/Grid.js.map +1 -1
- package/dist/components/Grid/core/model/GridDependency.d.ts +1 -1
- package/dist/components/Grid/core/model/Metadata.d.ts +3 -2
- package/dist/components/Grid/core/services/KeyListener.d.ts +2 -0
- package/dist/components/Grid/core/services/KeyListener.js +6 -3
- package/dist/components/Grid/core/services/KeyListener.js.map +1 -1
- package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValue.js +3 -3
- package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValue.js.map +1 -1
- package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/model/ConditionComponentValue.d.ts +19 -7
- package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/Component.d.ts +2 -2
- package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/Component.js +9 -9
- package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/Component.js.map +1 -0
- package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/controller/useComponentController.d.ts +2 -2
- package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/controller/useComponentController.js +1 -1
- package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/controller/useComponentController.js.map +1 -0
- package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/model/Component.d.ts +2 -2
- package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/model/Component.js +15 -19
- package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/model/Component.js.map +1 -0
- package/dist/components/Grid/filtering/model/Condition.d.ts +1 -1
- package/dist/components/Grid/filtering/model/Condition.js +1 -1
- package/dist/components/Grid/filtering/model/Condition.js.map +1 -1
- package/dist/components/Grid/interfaces.d.ts +1 -1
- package/dist/components/Grid/selection/model/Selection.d.ts +3 -4
- package/dist/components/Grid/selection/model/Selection.js +8 -26
- package/dist/components/Grid/selection/model/Selection.js.map +1 -1
- package/dist/components/Grid/sorting/Sorting.d.ts +1 -1
- package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.js +1 -1
- package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.js.map +1 -1
- package/dist/components/Grid/sorting/controllers/useColumnSortingController.d.ts +1 -1
- package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.d.ts +2 -0
- package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.js +11 -0
- package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.js.map +1 -0
- package/dist/components/GridCellRenderer/DefaultContentRenderer/index.d.ts +1 -0
- package/dist/components/GridCellRenderer/DefaultContentRenderer/index.js +2 -0
- package/dist/components/GridCellRenderer/DefaultContentRenderer/index.js.map +1 -0
- package/dist/components/GridCellRenderer/GridCellRenderer.d.ts +3 -0
- package/dist/components/GridCellRenderer/GridCellRenderer.js +252 -0
- package/dist/components/GridCellRenderer/GridCellRenderer.js.map +1 -0
- package/dist/components/GridCellRenderer/OptionSet/OptionSet.d.ts +5 -0
- package/dist/components/GridCellRenderer/OptionSet/OptionSet.js +69 -0
- package/dist/components/GridCellRenderer/OptionSet/OptionSet.js.map +1 -0
- package/dist/components/GridCellRenderer/OptionSet/index.d.ts +1 -0
- package/dist/components/GridCellRenderer/OptionSet/index.js +2 -0
- package/dist/components/GridCellRenderer/OptionSet/index.js.map +1 -0
- package/dist/components/{Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet → GridCellRenderer/OptionSet}/styles.d.ts +10 -12
- package/dist/components/GridCellRenderer/OptionSet/styles.js +29 -0
- package/dist/components/GridCellRenderer/OptionSet/styles.js.map +1 -0
- package/dist/components/GridCellRenderer/index.d.ts +1 -0
- package/dist/components/GridCellRenderer/index.js +2 -0
- package/dist/components/GridCellRenderer/index.js.map +1 -0
- package/dist/components/GridCellRenderer/interfaces.d.ts +53 -0
- package/dist/components/GridCellRenderer/styles.d.ts +72 -0
- package/dist/components/GridCellRenderer/styles.js +105 -0
- package/dist/components/GridCellRenderer/styles.js.map +1 -0
- package/dist/components/GridCellRenderer/translations.d.ts +6 -0
- package/dist/components/GridCellRenderer/translations.js +11 -0
- package/dist/components/GridCellRenderer/translations.js.map +1 -0
- package/dist/components/GridCellRenderer/useComponentProps.d.ts +6 -0
- package/dist/components/GridCellRenderer/useComponentProps.js +10 -0
- package/dist/components/GridCellRenderer/useComponentProps.js.map +1 -0
- package/dist/components/Lookup/Lookup.js +8 -3
- package/dist/components/Lookup/Lookup.js.map +1 -1
- package/dist/components/Lookup/hooks/useFetchXml.d.ts +1 -1
- package/dist/components/Lookup/hooks/useLookup.d.ts +1 -1
- package/dist/components/Lookup/interfaces.d.ts +1 -1
- package/dist/components/Lookup/styles.d.ts +19 -7
- package/dist/components/Lookup/styles.js +22 -8
- package/dist/components/Lookup/styles.js.map +1 -1
- package/dist/components/MultiSelectOptionSet/MultiSelectOptionSet.js +51 -28
- package/dist/components/MultiSelectOptionSet/MultiSelectOptionSet.js.map +1 -1
- package/dist/components/NestedControlRenderer/NestedControl.d.ts +86 -0
- package/dist/components/NestedControlRenderer/NestedControl.js +456 -0
- package/dist/components/NestedControlRenderer/NestedControl.js.map +1 -0
- package/dist/components/NestedControlRenderer/NestedControlError.d.ts +4 -0
- package/dist/components/NestedControlRenderer/NestedControlError.js +13 -0
- package/dist/components/NestedControlRenderer/NestedControlError.js.map +1 -0
- package/dist/components/NestedControlRenderer/NestedControlRenderer.d.ts +3 -0
- package/dist/components/NestedControlRenderer/NestedControlRenderer.js +194 -0
- package/dist/components/NestedControlRenderer/NestedControlRenderer.js.map +1 -0
- package/dist/components/NestedControlRenderer/index.d.ts +1 -0
- package/dist/components/NestedControlRenderer/index.js +2 -0
- package/dist/components/NestedControlRenderer/index.js.map +1 -0
- package/dist/components/NestedControlRenderer/interfaces.d.ts +118 -0
- package/dist/components/NestedControlRenderer/manifest/Control.d.ts +16 -0
- package/dist/components/NestedControlRenderer/manifest/Control.js +40 -0
- package/dist/components/NestedControlRenderer/manifest/Control.js.map +1 -0
- package/dist/components/NestedControlRenderer/manifest/Manifest.d.ts +5 -0
- package/dist/components/NestedControlRenderer/manifest/Manifest.js +12 -0
- package/dist/components/NestedControlRenderer/manifest/Manifest.js.map +1 -0
- package/dist/components/NestedControlRenderer/manifest/TypeGroup.d.ts +6 -0
- package/dist/components/NestedControlRenderer/manifest/TypeGroup.js +13 -0
- package/dist/components/NestedControlRenderer/manifest/TypeGroup.js.map +1 -0
- package/dist/components/NestedControlRenderer/manifest/index.d.ts +1 -0
- package/dist/components/NestedControlRenderer/manifest/index.js +2 -0
- package/dist/components/NestedControlRenderer/manifest/index.js.map +1 -0
- package/dist/components/NestedControlRenderer/manifest/property/Property.d.ts +16 -0
- package/dist/components/NestedControlRenderer/manifest/property/Property.js +34 -0
- package/dist/components/NestedControlRenderer/manifest/property/Property.js.map +1 -0
- package/dist/components/NestedControlRenderer/manifest/property/Value.d.ts +8 -0
- package/dist/components/NestedControlRenderer/manifest/property/Value.js +12 -0
- package/dist/components/NestedControlRenderer/manifest/property/Value.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/DateProperty.d.ts +5 -0
- package/dist/components/NestedControlRenderer/properties/DateProperty.js +22 -0
- package/dist/components/NestedControlRenderer/properties/DateProperty.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/FileProperty.d.ts +5 -0
- package/dist/components/NestedControlRenderer/properties/FileProperty.js +16 -0
- package/dist/components/NestedControlRenderer/properties/FileProperty.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/LookupProperty.d.ts +6 -0
- package/dist/components/NestedControlRenderer/properties/LookupProperty.js +36 -0
- package/dist/components/NestedControlRenderer/properties/LookupProperty.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/NumberProperty.d.ts +5 -0
- package/dist/components/NestedControlRenderer/properties/NumberProperty.js +17 -0
- package/dist/components/NestedControlRenderer/properties/NumberProperty.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/OptionSetProperty.d.ts +5 -0
- package/dist/components/NestedControlRenderer/properties/OptionSetProperty.js +23 -0
- package/dist/components/NestedControlRenderer/properties/OptionSetProperty.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/Property.d.ts +16 -0
- package/dist/components/NestedControlRenderer/properties/Property.js +41 -0
- package/dist/components/NestedControlRenderer/properties/Property.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/TextProperty.d.ts +5 -0
- package/dist/components/NestedControlRenderer/properties/TextProperty.js +15 -0
- package/dist/components/NestedControlRenderer/properties/TextProperty.js.map +1 -0
- package/dist/components/NestedControlRenderer/styles.d.ts +14 -0
- package/dist/components/NestedControlRenderer/styles.js +21 -0
- package/dist/components/NestedControlRenderer/styles.js.map +1 -0
- package/dist/components/NestedControlRenderer/translations.d.ts +14 -0
- package/dist/components/NestedControlRenderer/translations.js +19 -0
- package/dist/components/NestedControlRenderer/translations.js.map +1 -0
- package/dist/components/OptionSet/OptionSet.js +3 -3
- package/dist/components/OptionSet/OptionSet.js.map +1 -1
- package/dist/components/OptionSet/useComboBoxTheme.js +17 -17
- package/dist/components/OptionSet/useComboBoxTheme.js.map +1 -1
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TextField/interfaces.d.ts +2 -2
- package/dist/components/TwoOptions/TwoOptions.js +2 -1
- package/dist/components/TwoOptions/TwoOptions.js.map +1 -1
- package/dist/components/index.d.ts +13 -0
- package/dist/components/index.js +15 -0
- package/dist/components/index.js.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useControl.d.ts +1 -7
- package/dist/hooks/useControl.js +12 -40
- package/dist/hooks/useControl.js.map +1 -1
- package/dist/hooks/useControlLabels.d.ts +14 -0
- package/dist/hooks/useControlLabels.js +47 -0
- package/dist/hooks/useControlLabels.js.map +1 -0
- package/dist/hooks/useControlSizing.d.ts +1 -1
- package/dist/hooks/useInputBasedControl.d.ts +2 -1
- package/dist/hooks/useInputBasedControl.js +3 -5
- package/dist/hooks/useInputBasedControl.js.map +1 -1
- package/dist/hooks/usePrevious.d.ts +1 -0
- package/dist/index.d.ts +453 -141
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces/context.d.ts +3 -2
- package/dist/interfaces/index.d.ts +1 -1
- package/dist/interfaces/property.d.ts +6 -1
- package/dist/utils/BaseControls.d.ts +16 -0
- package/dist/utils/BaseControls.js +82 -0
- package/dist/utils/BaseControls.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/theme/ControlTheme.d.ts +2 -2
- package/dist/utils/theme/ControlTheme.js +1 -1
- package/dist/utils/theme/ControlTheme.js.map +1 -1
- package/dist/utils/theme/components/ThemeWrapper.d.ts +9 -0
- package/dist/utils/theme/components/ThemeWrapper.js +11 -0
- package/dist/utils/theme/components/ThemeWrapper.js.map +1 -0
- package/dist/utils/theme/components/index.d.ts +1 -0
- package/dist/utils/theme/components/index.js +2 -0
- package/dist/utils/theme/components/index.js.map +1 -0
- package/dist/utils/theme/hooks/useControlTheme.d.ts +1 -1
- package/dist/utils/theme/hooks/useControlTheme.js.map +1 -1
- package/dist/utils/theme/index.d.ts +1 -0
- package/dist/utils/theme/index.js +1 -0
- package/dist/utils/theme/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.d.ts +0 -10
- package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.js +0 -82
- package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.d.ts +0 -11
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.js +0 -93
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.d.ts +0 -36
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.js +0 -42
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.d.ts +0 -11
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.js +0 -221
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.d.ts +0 -10
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.js +0 -49
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/styles.js +0 -27
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/styles.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.d.ts +0 -99
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.js +0 -123
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.js.map +0 -1
- package/dist/components/Grid/core/components/Component/Component.js.map +0 -1
- package/dist/components/Grid/core/components/Component/controller/useComponentController.js.map +0 -1
- package/dist/components/Grid/core/components/Component/model/Component.js.map +0 -1
- package/dist/components/Grid/core/model/Metadata.js +0 -26
- package/dist/components/Grid/core/model/Metadata.js.map +0 -1
- package/dist/components/Grid/selection/controllers/useSelectionController.d.ts +0 -11
- package/dist/components/Grid/selection/controllers/useSelectionController.js +0 -21
- package/dist/components/Grid/selection/controllers/useSelectionController.js.map +0 -1
- package/dist/hooks/useRerender.d.ts +0 -1
- package/dist/hooks/useRerender.js +0 -9
- package/dist/hooks/useRerender.js.map +0 -1
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { forwardRef, useRef, useImperativeHandle, useMemo, useEffect } from 'react';
|
|
3
|
+
import { NestedControl } from './NestedControl.js';
|
|
4
|
+
import { GridCellRenderer } from '../GridCellRenderer/GridCellRenderer.js';
|
|
5
|
+
import { getNestedControlStyles } from './styles.js';
|
|
6
|
+
import { useRerender, Spinner } from '@talxis/react-components';
|
|
7
|
+
import { MessageBar, MessageBarType, MessageBarButton, SpinnerSize, Shimmer } from '@fluentui/react';
|
|
8
|
+
import ReactDOM from 'react-dom';
|
|
9
|
+
import { getDefaultNestedControlRendererTranslations } from './translations.js';
|
|
10
|
+
import { useControlLabels } from '../../hooks/useControlLabels.js';
|
|
11
|
+
import { BaseControls } from '../../utils/BaseControls.js';
|
|
12
|
+
import { Duration } from '../Duration/Duration.js';
|
|
13
|
+
import { Decimal } from '../Decimal/Decimal.js';
|
|
14
|
+
import { DateTime } from '../DateTime/DateTime.js';
|
|
15
|
+
import { TwoOptions } from '../TwoOptions/TwoOptions.js';
|
|
16
|
+
import { MultiSelectOptionSet } from '../MultiSelectOptionSet/MultiSelectOptionSet.js';
|
|
17
|
+
import { Lookup } from '../Lookup/Lookup.js';
|
|
18
|
+
import { OptionSet } from '../OptionSet/OptionSet.js';
|
|
19
|
+
import { TextField } from '../TextField/TextField.js';
|
|
20
|
+
|
|
21
|
+
const NestedControlRenderer = (props) => {
|
|
22
|
+
const onOverrideComponentProps = props.onOverrideComponentProps ?? ((props) => props);
|
|
23
|
+
const labels = useControlLabels({
|
|
24
|
+
translations: props.translations,
|
|
25
|
+
languageId: props.context.userSettings.languageId,
|
|
26
|
+
defaultTranslations: getDefaultNestedControlRendererTranslations()
|
|
27
|
+
});
|
|
28
|
+
const rerender = useRerender();
|
|
29
|
+
const isBaseControl = useMemo(() => {
|
|
30
|
+
return BaseControls.IsBaseControl(props.parameters.ControlName);
|
|
31
|
+
}, [props.parameters.ControlName]);
|
|
32
|
+
const styles = useMemo(() => getNestedControlStyles(isBaseControl), [isBaseControl]);
|
|
33
|
+
const internalControlRendererRef = useRef(null);
|
|
34
|
+
const ref = useRef();
|
|
35
|
+
ref.current = {
|
|
36
|
+
...ref.current,
|
|
37
|
+
props: props,
|
|
38
|
+
isBaseControl: isBaseControl,
|
|
39
|
+
controlName: props.parameters.ControlName
|
|
40
|
+
};
|
|
41
|
+
ref.current.componentProps = onOverrideComponentProps({
|
|
42
|
+
rootContainerProps: {},
|
|
43
|
+
controlContainerProps: {},
|
|
44
|
+
messageBarProps: {
|
|
45
|
+
//@ts-ignore - typescript
|
|
46
|
+
messageBarType: MessageBarType.error,
|
|
47
|
+
buttonProps: {
|
|
48
|
+
className: styles.messageBarBtn
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
loadingProps: {
|
|
52
|
+
containerProps: {},
|
|
53
|
+
spinnerProps: {
|
|
54
|
+
size: SpinnerSize.xSmall
|
|
55
|
+
},
|
|
56
|
+
shimmerProps: {
|
|
57
|
+
styles: {
|
|
58
|
+
root: styles.shimmerRoot,
|
|
59
|
+
shimmerWrapper: {
|
|
60
|
+
height: 32
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
onOverrideRender: (control, isCustomPcfComponent, defaultRender) => defaultRender(),
|
|
66
|
+
onOverrideUnmount: (control, defaultUnmount) => defaultUnmount(),
|
|
67
|
+
onOverrideControlProps: (props) => props,
|
|
68
|
+
});
|
|
69
|
+
const getRef = () => {
|
|
70
|
+
return ref.current;
|
|
71
|
+
};
|
|
72
|
+
const getBaseControl = () => {
|
|
73
|
+
switch (getRef().controlName) {
|
|
74
|
+
case 'TextField':
|
|
75
|
+
return TextField;
|
|
76
|
+
case 'OptionSet':
|
|
77
|
+
return OptionSet;
|
|
78
|
+
case 'Lookup':
|
|
79
|
+
return Lookup;
|
|
80
|
+
case 'MultiSelectOptionSet':
|
|
81
|
+
return MultiSelectOptionSet;
|
|
82
|
+
case 'TwoOptions':
|
|
83
|
+
return TwoOptions;
|
|
84
|
+
case 'DateTime':
|
|
85
|
+
return DateTime;
|
|
86
|
+
case 'Decimal':
|
|
87
|
+
return Decimal;
|
|
88
|
+
case 'Duration':
|
|
89
|
+
return Duration;
|
|
90
|
+
case 'GridCellRenderer':
|
|
91
|
+
return GridCellRenderer;
|
|
92
|
+
default:
|
|
93
|
+
return GridCellRenderer;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const onRender = (control, defaultRender) => {
|
|
97
|
+
if (getRef().isBaseControl) {
|
|
98
|
+
const controlProps = control.getProps();
|
|
99
|
+
return ReactDOM.render(React__default.createElement(getBaseControl(), controlProps), control.getContainer());
|
|
100
|
+
}
|
|
101
|
+
return defaultRender();
|
|
102
|
+
};
|
|
103
|
+
const onUmount = (control, defaultUnmount) => {
|
|
104
|
+
if (control.isMountedPcfComponent()) {
|
|
105
|
+
return defaultUnmount();
|
|
106
|
+
}
|
|
107
|
+
return ReactDOM.unmountComponentAtNode(control.getContainer());
|
|
108
|
+
};
|
|
109
|
+
const createControlInstance = () => {
|
|
110
|
+
new NestedControl({
|
|
111
|
+
parentPcfContext: getRef().props.context,
|
|
112
|
+
onGetContainerElement: () => getRef().controlContainer,
|
|
113
|
+
onGetControlName: () => getRef().controlName,
|
|
114
|
+
onGetBindings: () => {
|
|
115
|
+
return getRef().props.parameters.Bindings ?? {};
|
|
116
|
+
},
|
|
117
|
+
callbacks: {
|
|
118
|
+
//onInit could either by sync or async
|
|
119
|
+
onInit: (instance) => {
|
|
120
|
+
getRef().control = instance;
|
|
121
|
+
//if we are already mounted, we need to rerender
|
|
122
|
+
if (getRef().mounted) {
|
|
123
|
+
rerender();
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
onControlStateChanged: () => internalControlRendererRef.current?.rerender(),
|
|
127
|
+
onGetControlStates: () => getRef().props.parameters.ControlStates,
|
|
128
|
+
onNotifyOutputChanged: (outputs) => getRef().props.onNotifyOutputChanged?.(outputs)
|
|
129
|
+
},
|
|
130
|
+
overrides: {
|
|
131
|
+
onGetProps: getRef().componentProps.onOverrideControlProps,
|
|
132
|
+
onRender: (control, defaultRender) => {
|
|
133
|
+
getRef().componentProps.onOverrideRender(control, !getRef().isBaseControl, () => {
|
|
134
|
+
onRender(control, defaultRender);
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
onUnmount: (control, defaultUnmount) => {
|
|
138
|
+
getRef().componentProps.onOverrideUnmount(control, () => onUmount(control, defaultUnmount));
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
useMemo(() => {
|
|
144
|
+
createControlInstance();
|
|
145
|
+
}, []);
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
const ref = getRef();
|
|
148
|
+
ref.mounted = true;
|
|
149
|
+
ref.controlContainer = internalControlRendererRef.current.getContainer();
|
|
150
|
+
return () => {
|
|
151
|
+
const ref = getRef();
|
|
152
|
+
ref.control?.unmount();
|
|
153
|
+
ref.controlContainer = null;
|
|
154
|
+
ref.control = null;
|
|
155
|
+
};
|
|
156
|
+
}, []);
|
|
157
|
+
useEffect(() => {
|
|
158
|
+
getRef().control?.render();
|
|
159
|
+
});
|
|
160
|
+
return jsx(InternalNestedControlRenderer, { ref: internalControlRendererRef, labels: labels, control: getRef().control ?? undefined, parameters: getRef().props.parameters, componentProps: getRef().componentProps });
|
|
161
|
+
};
|
|
162
|
+
const InternalNestedControlRenderer = forwardRef((props, ref) => {
|
|
163
|
+
//once control is defined, it is initialized
|
|
164
|
+
const { control, parameters, componentProps, labels } = props;
|
|
165
|
+
const customControlContainerRef = useRef(null);
|
|
166
|
+
const errorMessage = control?.getErrorMessage();
|
|
167
|
+
const rerender = useRerender();
|
|
168
|
+
useImperativeHandle(ref, () => {
|
|
169
|
+
return {
|
|
170
|
+
getContainer: () => customControlContainerRef.current,
|
|
171
|
+
rerender: () => rerender()
|
|
172
|
+
};
|
|
173
|
+
});
|
|
174
|
+
const renderLoading = () => {
|
|
175
|
+
if (parameters.LoadingType === 'shimmer') {
|
|
176
|
+
return jsx(Shimmer, { ...componentProps?.loadingProps?.shimmerProps });
|
|
177
|
+
}
|
|
178
|
+
return jsx(Spinner, { ...componentProps?.loadingProps?.spinnerProps });
|
|
179
|
+
};
|
|
180
|
+
const onShowErrorDialog = () => {
|
|
181
|
+
if (window.Xrm?.Navigation) {
|
|
182
|
+
window.Xrm.Navigation.openErrorDialog({
|
|
183
|
+
message: errorMessage
|
|
184
|
+
});
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
alert(errorMessage);
|
|
188
|
+
};
|
|
189
|
+
return (jsxs("div", { ...componentProps.rootContainerProps, children: [(!control || control.isLoading()) && jsx("div", { ...componentProps?.loadingProps?.containerProps, children: renderLoading() }), errorMessage &&
|
|
190
|
+
jsxs(MessageBar, { messageBarType: MessageBarType.error, isMultiline: false, actions: jsx("div", { children: jsx(MessageBarButton, { className: componentProps.messageBarProps.buttonProps.className, onClick: () => onShowErrorDialog(), children: labels.detail() }) }), ...componentProps?.messageBarProps, children: [labels.control(), " ", jsx("b", { children: parameters.ControlName }), " ", labels.failedToLoad(), "."] }), jsx("div", { ref: customControlContainerRef, ...componentProps.controlContainerProps })] }));
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
export { NestedControlRenderer };
|
|
194
|
+
//# sourceMappingURL=NestedControlRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NestedControlRenderer.js","sources":["../../../src/components/NestedControlRenderer/NestedControlRenderer.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\nimport { NestedControl } from './NestedControl';\nimport { INestedControlRenderer, INestedControlRendererComponentProps, INestedControlRendererParameters } from './interfaces';\nimport { TextField } from '../TextField';\nimport { Decimal } from '../Decimal';\nimport { Duration } from '../Duration';\nimport { TwoOptions } from '../TwoOptions';\nimport { DateTime } from '../DateTime';\nimport { MultiSelectOptionSet } from '../MultiSelectOptionSet';\nimport { Lookup } from '../Lookup';\nimport { OptionSet } from '../OptionSet';\nimport { GridCellRenderer } from '../GridCellRenderer/GridCellRenderer';\nimport { BaseControls } from '../../utils';\nimport { getNestedControlStyles } from './styles';\nimport { Spinner, useRerender } from '@talxis/react-components';\nimport { MessageBar, MessageBarButton, MessageBarType, Shimmer, SpinnerSize } from '@fluentui/react';\nimport ReactDOM from 'react-dom';\nimport { useControlLabels } from '../../hooks';\nimport { getDefaultNestedControlRendererTranslations } from './translations';\n\ninterface IRef {\n control: NestedControl | null;\n props: INestedControlRenderer;\n controlName: string;\n componentProps: INestedControlRendererComponentProps;\n isBaseControl: boolean;\n mounted: boolean;\n controlContainer: HTMLDivElement | null;\n}\n\nexport const NestedControlRenderer = (props: INestedControlRenderer) => {\n const onOverrideComponentProps = props.onOverrideComponentProps ?? ((props) => props);\n const labels = useControlLabels({\n translations: props.translations,\n languageId : props.context.userSettings.languageId,\n defaultTranslations: getDefaultNestedControlRendererTranslations()\n })\n const rerender = useRerender();\n const isBaseControl = useMemo(() => {\n return BaseControls.IsBaseControl(props.parameters.ControlName);\n }, [props.parameters.ControlName]);\n\n const styles = useMemo(() => getNestedControlStyles(isBaseControl), [isBaseControl]);\n const internalControlRendererRef = useRef<IInternalNestedControlRendererRef>(null);\n const ref = useRef<Partial<IRef>>();\n \n ref.current = {\n ...ref.current,\n props: props,\n isBaseControl: isBaseControl,\n controlName: props.parameters.ControlName \n }\n\n ref.current.componentProps = onOverrideComponentProps({\n rootContainerProps: {},\n controlContainerProps: {},\n messageBarProps: {\n //@ts-ignore - typescript\n messageBarType: MessageBarType.error,\n buttonProps: {\n className: styles.messageBarBtn\n }\n },\n loadingProps: {\n containerProps: {},\n spinnerProps: {\n size: SpinnerSize.xSmall\n },\n shimmerProps: {\n styles: {\n root: styles.shimmerRoot,\n shimmerWrapper: {\n height: 32\n }\n }\n },\n },\n onOverrideRender: (control, isCustomPcfComponent, defaultRender) => defaultRender(),\n onOverrideUnmount: (control, defaultUnmount) => defaultUnmount(),\n onOverrideControlProps: (props) => props,\n });\n\n const getRef = (): IRef => {\n return ref.current as any;\n }\n\n const getBaseControl = (): any => {\n switch (getRef().controlName) {\n case 'TextField':\n return TextField\n case 'OptionSet':\n return OptionSet;\n case 'Lookup':\n return Lookup;\n case 'MultiSelectOptionSet':\n return MultiSelectOptionSet;\n case 'TwoOptions':\n return TwoOptions;\n case 'DateTime':\n return DateTime;\n case 'Decimal':\n return Decimal;\n case 'Duration':\n return Duration;\n case 'GridCellRenderer':\n return GridCellRenderer;\n default:\n return GridCellRenderer;\n }\n };\n\n const onRender = (control: NestedControl, defaultRender: () => Promise<void>) => {\n if (getRef().isBaseControl) {\n const controlProps = control.getProps();\n return ReactDOM.render(React.createElement(getBaseControl(), controlProps), control.getContainer());\n }\n return defaultRender();\n }\n\n const onUmount = (control: NestedControl, defaultUnmount: () => void) => {\n if (control.isMountedPcfComponent()) {\n return defaultUnmount();\n }\n return ReactDOM.unmountComponentAtNode(control.getContainer())\n }\n\n const createControlInstance = () => {\n new NestedControl({\n parentPcfContext: getRef().props.context,\n onGetContainerElement: () => getRef().controlContainer!,\n onGetControlName: () => getRef().controlName,\n onGetBindings: () => {\n return getRef().props.parameters.Bindings ?? {};\n },\n callbacks: {\n //onInit could either by sync or async\n onInit: (instance) => {\n getRef().control = instance;\n //if we are already mounted, we need to rerender\n if (getRef().mounted) {\n rerender();\n }\n },\n onControlStateChanged: () => internalControlRendererRef.current?.rerender(),\n onGetControlStates: () => getRef().props.parameters.ControlStates,\n onNotifyOutputChanged: (outputs) => getRef().props.onNotifyOutputChanged?.(outputs)\n },\n overrides: {\n onGetProps: getRef().componentProps.onOverrideControlProps,\n onRender: (control: NestedControl, defaultRender) => {\n getRef().componentProps.onOverrideRender(control, !getRef().isBaseControl, () => {\n onRender(control, defaultRender);\n })\n },\n onUnmount: (control, defaultUnmount) => {\n getRef().componentProps.onOverrideUnmount(control, () => onUmount(control, defaultUnmount))\n }\n },\n })\n\n }\n useMemo(() => {\n createControlInstance();\n }, []);\n\n useEffect(() => {\n const ref = getRef();\n ref.mounted = true;\n ref.controlContainer = internalControlRendererRef.current!.getContainer();\n return () => {\n const ref = getRef();\n ref.control?.unmount();\n ref.controlContainer = null;\n ref.control = null;\n }\n }, []);\n\n useEffect(() => {\n getRef().control?.render();\n })\n\n return <InternalNestedControlRenderer\n ref={internalControlRendererRef}\n labels={labels}\n control={getRef().control ?? undefined}\n parameters={getRef().props.parameters}\n componentProps={getRef().componentProps} />\n}\n\ninterface IInternalNestedControlRendererProps {\n parameters: INestedControlRendererParameters;\n componentProps: INestedControlRendererComponentProps;\n labels: any;\n loadingType?: 'spinner' | 'shimmer';\n control?: NestedControl;\n\n}\n\ninterface IInternalNestedControlRendererRef {\n getContainer: () => HTMLDivElement;\n rerender: () => void;\n}\n\n\nconst InternalNestedControlRenderer = forwardRef<IInternalNestedControlRendererRef, IInternalNestedControlRendererProps>((props, ref) => {\n //once control is defined, it is initialized\n const { control, parameters, componentProps, labels } = props;\n const customControlContainerRef = useRef<HTMLDivElement>(null);\n const errorMessage = control?.getErrorMessage();\n const rerender = useRerender();\n\n useImperativeHandle(ref, () => {\n return {\n getContainer: () => customControlContainerRef.current!,\n rerender: () => rerender()\n }\n })\n\n const renderLoading = () => {\n if (parameters.LoadingType === 'shimmer') {\n return <Shimmer {...componentProps?.loadingProps?.shimmerProps} />\n }\n return <Spinner {...componentProps?.loadingProps?.spinnerProps} />\n }\n\n const onShowErrorDialog = () => {\n if(window.Xrm?.Navigation) {\n window.Xrm.Navigation.openErrorDialog({\n message: errorMessage\n })\n return;\n }\n alert(errorMessage);\n }\n\n return (\n <div {...componentProps.rootContainerProps}>\n {(!control || control.isLoading()) && <div {...componentProps?.loadingProps?.containerProps}>{renderLoading()}</div>\n }\n {errorMessage &&\n <MessageBar messageBarType={MessageBarType.error} isMultiline={false} actions={<div>\n <MessageBarButton className={componentProps.messageBarProps.buttonProps.className} onClick={() => onShowErrorDialog()}>{labels.detail()}</MessageBarButton>\n </div>} {...componentProps?.messageBarProps}>\n {labels.control()} <b>{parameters.ControlName}</b> {labels.failedToLoad()}.\n </MessageBar>\n }\n <div ref={customControlContainerRef} {...componentProps.controlContainerProps} />\n </div>)\n})\n"],"names":["React","_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;AA8Ba,MAAA,qBAAqB,GAAG,CAAC,KAA6B,KAAI;AACnE,IAAA,MAAM,wBAAwB,GAAG,KAAK,CAAC,wBAAwB,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IACtF,MAAM,MAAM,GAAG,gBAAgB,CAAC;QAC5B,YAAY,EAAE,KAAK,CAAC,YAAY;AAChC,QAAA,UAAU,EAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU;QAClD,mBAAmB,EAAE,2CAA2C,EAAE;AACrE,KAAA,CAAC,CAAA;AACF,IAAA,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;AAC/B,IAAA,MAAM,aAAa,GAAG,OAAO,CAAC,MAAK;QAC/B,OAAO,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;KACnE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;AAEnC,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,sBAAsB,CAAC,aAAa,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;AACrF,IAAA,MAAM,0BAA0B,GAAG,MAAM,CAAoC,IAAI,CAAC,CAAC;AACnF,IAAA,MAAM,GAAG,GAAG,MAAM,EAAiB,CAAC;IAEpC,GAAG,CAAC,OAAO,GAAG;QACV,GAAG,GAAG,CAAC,OAAO;AACd,QAAA,KAAK,EAAE,KAAK;AACZ,QAAA,aAAa,EAAE,aAAa;AAC5B,QAAA,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW;KAC5C,CAAA;AAED,IAAA,GAAG,CAAC,OAAO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EAAoB,CAAA,EAAA,CACzJ,EAAM,GAAA,cAAc,EAAE,eAAe,EAAA,QAAA,EAAA,CACtC,MAAM,CAAC,OAAO,EAAE,EAAA,GAAA,EAAEA,GAAI,CAAA,GAAA,EAAA,EAAA,QAAA,EAAA,UAAU,CAAC,WAAW,EAAA,CAAK,EAAE,GAAA,EAAA,MAAM,CAAC,YAAY,EAAE,EAChE,GAAA,CAAA,EAAA,CAAA,EAEjBA,aAAK,GAAG,EAAE,yBAAyB,EAAA,GAAM,cAAc,CAAC,qBAAqB,EAAI,CAAA,CAAA,EAAA,CAC/E,EAAC;AACf,CAAC,CAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NestedControlRenderer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IButtonProps, IMessageBar, IShimmerProps, ISpinnerProps } from "@fluentui/react";
|
|
3
|
+
import { IParameters } from "../../interfaces";
|
|
4
|
+
import { IControl, IOutputs } from "../../interfaces/context";
|
|
5
|
+
import { NestedControl } from "./NestedControl";
|
|
6
|
+
import { DataType } from "@talxis/client-libraries";
|
|
7
|
+
import { getDefaultNestedControlRendererTranslations } from "./translations";
|
|
8
|
+
type ControlNameOptions = 'TextField' | 'OptionSet' | 'MultiSelectOptionSet' | 'Lookup' | 'Decimal' | 'Duration' | 'DateTime' | 'GridCellRenderer' | (string & {});
|
|
9
|
+
export interface INestedControlRenderer extends IControl<INestedControlRendererParameters, IOutputs, ReturnType<typeof getDefaultNestedControlRendererTranslations>, INestedControlRendererComponentProps> {
|
|
10
|
+
}
|
|
11
|
+
export interface INestedControlRendererParameters extends IParameters {
|
|
12
|
+
/**
|
|
13
|
+
* Specifies the name of the control to be rendered. This can be either a custom PCF control or a base control.
|
|
14
|
+
*/
|
|
15
|
+
ControlName: ControlNameOptions;
|
|
16
|
+
/**
|
|
17
|
+
* Optional bindings that will be passed to the control. These bindings provide data and metadata to the control.
|
|
18
|
+
*/
|
|
19
|
+
Bindings?: {
|
|
20
|
+
[key: string]: IBinding;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Specifies the type of loading indicator to display before the control is fully loaded.
|
|
24
|
+
* Options include 'spinner', 'shimmer', or 'none' for no loading indicator.
|
|
25
|
+
*/
|
|
26
|
+
LoadingType?: 'spinner' | 'shimmer' | 'none';
|
|
27
|
+
/**
|
|
28
|
+
* Optional configuration to set the control's state, such as enabling or disabling the control.
|
|
29
|
+
*/
|
|
30
|
+
ControlStates?: IControlStates;
|
|
31
|
+
}
|
|
32
|
+
export interface INestedControlRendererComponentProps {
|
|
33
|
+
/**
|
|
34
|
+
* Props for the loading indicator that appears before the control is fully loaded.
|
|
35
|
+
*/
|
|
36
|
+
loadingProps: {
|
|
37
|
+
spinnerProps: ISpinnerProps;
|
|
38
|
+
shimmerProps: IShimmerProps;
|
|
39
|
+
containerProps: React.HTMLAttributes<HTMLDivElement>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Props for the message bar that displays error messages.
|
|
43
|
+
*/
|
|
44
|
+
messageBarProps: IMessageBar & {
|
|
45
|
+
buttonProps: IButtonProps;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Props for the top-level container that wraps the control and other elements like the loading indicator.
|
|
49
|
+
*/
|
|
50
|
+
rootContainerProps: React.HTMLAttributes<HTMLDivElement>;
|
|
51
|
+
/**
|
|
52
|
+
* Props for the container used to render the control.
|
|
53
|
+
*/
|
|
54
|
+
controlContainerProps: React.HTMLAttributes<HTMLDivElement>;
|
|
55
|
+
/**
|
|
56
|
+
* Callback function that allows you to override the generated control props.
|
|
57
|
+
*/
|
|
58
|
+
onOverrideControlProps: (props: IControl<any, any, any, any>) => IControl<any, any, any, any>;
|
|
59
|
+
/**
|
|
60
|
+
* Callback function that allows you to override the default control render.
|
|
61
|
+
*/
|
|
62
|
+
onOverrideRender: (control: NestedControl, isCustomPcfComponent: boolean, defaultRender: () => void) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Callback function that allows you to override the default control unmount behavior.
|
|
65
|
+
*/
|
|
66
|
+
onOverrideUnmount: (control: NestedControl, defaultUnmount: () => void) => void;
|
|
67
|
+
}
|
|
68
|
+
export interface IBinding {
|
|
69
|
+
/**
|
|
70
|
+
* The data type of the binding.
|
|
71
|
+
*/
|
|
72
|
+
type: DataType;
|
|
73
|
+
/**
|
|
74
|
+
* Indicates whether the binding is static or bound.
|
|
75
|
+
*/
|
|
76
|
+
isStatic: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* The value of the binding.
|
|
79
|
+
*/
|
|
80
|
+
value: any;
|
|
81
|
+
/**
|
|
82
|
+
* Indicates whether the binding has an error.
|
|
83
|
+
*/
|
|
84
|
+
error?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* The error message associated with the binding, if any.
|
|
87
|
+
*/
|
|
88
|
+
errorMessage?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Optional metadata for the binding.
|
|
91
|
+
*/
|
|
92
|
+
metadata?: {
|
|
93
|
+
/**
|
|
94
|
+
* The entity name associated with the binding.
|
|
95
|
+
*/
|
|
96
|
+
entityName?: string;
|
|
97
|
+
/**
|
|
98
|
+
* The logical name of the attribute associated with the binding.
|
|
99
|
+
*/
|
|
100
|
+
attributeName?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Callback function to override the metadata for the binding.
|
|
103
|
+
* Always return the spread metadata attribute to ensure proper merging.
|
|
104
|
+
*/
|
|
105
|
+
onOverrideMetadata?: (metadata: any) => any;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Callback function to notify when the binding's output value changes.
|
|
109
|
+
*/
|
|
110
|
+
onNotifyOutputChanged?: (newValue: any) => void;
|
|
111
|
+
}
|
|
112
|
+
export interface IControlStates {
|
|
113
|
+
/**
|
|
114
|
+
* Indicates whether the control is disabled.
|
|
115
|
+
*/
|
|
116
|
+
isControlDisabled?: boolean;
|
|
117
|
+
}
|
|
118
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Property } from "./property/Property";
|
|
2
|
+
import { TypeGroup } from "./TypeGroup";
|
|
3
|
+
export declare class Control {
|
|
4
|
+
readonly namespace: string;
|
|
5
|
+
readonly constructorName: string;
|
|
6
|
+
readonly version: string;
|
|
7
|
+
readonly displayNameKey: string;
|
|
8
|
+
readonly descriptionKey: string;
|
|
9
|
+
readonly controlType: string;
|
|
10
|
+
readonly previewImage: string;
|
|
11
|
+
readonly properties: Map<string, Property>;
|
|
12
|
+
readonly typegroups: Map<string, TypeGroup>;
|
|
13
|
+
constructor(controlElement: Element);
|
|
14
|
+
private _createProperties;
|
|
15
|
+
private _createTypeGroups;
|
|
16
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Property } from './property/Property.js';
|
|
2
|
+
import { TypeGroup } from './TypeGroup.js';
|
|
3
|
+
|
|
4
|
+
class Control {
|
|
5
|
+
constructor(controlElement) {
|
|
6
|
+
this.properties = new Map();
|
|
7
|
+
this.typegroups = new Map();
|
|
8
|
+
this.namespace = controlElement.getAttribute('namespace');
|
|
9
|
+
this.constructorName = controlElement.getAttribute('constructor');
|
|
10
|
+
this.version = controlElement.getAttribute('version');
|
|
11
|
+
this.displayNameKey = controlElement.getAttribute('display-name-key');
|
|
12
|
+
this.descriptionKey = controlElement.getAttribute('description-key');
|
|
13
|
+
this.controlType = controlElement.getAttribute('control-type');
|
|
14
|
+
this.previewImage = controlElement.getAttribute('previewImage');
|
|
15
|
+
this._createProperties(controlElement);
|
|
16
|
+
this._createTypeGroups(controlElement);
|
|
17
|
+
}
|
|
18
|
+
_createProperties(controlElement) {
|
|
19
|
+
const propertyElements = controlElement.querySelectorAll(':scope>property');
|
|
20
|
+
let bindingPropertyFound = false;
|
|
21
|
+
for (const propertyElement of propertyElements) {
|
|
22
|
+
const usage = propertyElement.getAttribute('usage');
|
|
23
|
+
let isBindingProperty = false;
|
|
24
|
+
if (usage === 'bound' && !bindingPropertyFound) {
|
|
25
|
+
bindingPropertyFound = true;
|
|
26
|
+
isBindingProperty = true;
|
|
27
|
+
}
|
|
28
|
+
this.properties.set(propertyElement.getAttribute('name'), new Property(propertyElement, isBindingProperty));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
_createTypeGroups(controlElement) {
|
|
32
|
+
const typeGroupElements = controlElement.querySelectorAll(':scope>type-group');
|
|
33
|
+
for (const typeGroupElement of typeGroupElements) {
|
|
34
|
+
this.typegroups.set(typeGroupElement.getAttribute('name'), new TypeGroup(typeGroupElement));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { Control };
|
|
40
|
+
//# sourceMappingURL=Control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Control.js","sources":["../../../../src/components/NestedControlRenderer/manifest/Control.ts"],"sourcesContent":["import { Property } from \"./property/Property\";\nimport { TypeGroup } from \"./TypeGroup\";\n\nexport class Control {\n public readonly namespace: string;\n public readonly constructorName: string;\n public readonly version: string;\n public readonly displayNameKey: string;\n public readonly descriptionKey: string;\n public readonly controlType: string;\n public readonly previewImage: string;\n public readonly properties: Map<string, Property> = new Map();\n public readonly typegroups: Map<string, TypeGroup> = new Map();\n\n constructor(controlElement: Element) {\n this.namespace = controlElement.getAttribute('namespace')!;\n this.constructorName = controlElement.getAttribute('constructor')!;\n this.version = controlElement.getAttribute('version')!;\n this.displayNameKey = controlElement.getAttribute('display-name-key')!;\n this.descriptionKey = controlElement.getAttribute('description-key')!;\n this.controlType = controlElement.getAttribute('control-type')!;\n this.previewImage = controlElement.getAttribute('previewImage')!;\n this._createProperties(controlElement);\n this._createTypeGroups(controlElement);\n }\n \n private _createProperties(controlElement: Element) {\n const propertyElements = controlElement.querySelectorAll(':scope>property');\n let bindingPropertyFound = false;\n for (const propertyElement of propertyElements) {\n const usage = propertyElement.getAttribute('usage');\n let isBindingProperty = false;\n if (usage === 'bound' && !bindingPropertyFound) {\n bindingPropertyFound = true;\n isBindingProperty = true;\n }\n this.properties.set(propertyElement.getAttribute('name')!, new Property(propertyElement, isBindingProperty));\n }\n }\n private _createTypeGroups(controlElement: Element) {\n const typeGroupElements = controlElement.querySelectorAll(':scope>type-group');\n for (const typeGroupElement of typeGroupElements) {\n this.typegroups.set(typeGroupElement.getAttribute('name')!, new TypeGroup(typeGroupElement));\n }\n }\n}"],"names":[],"mappings":";;;MAGa,OAAO,CAAA;AAWhB,IAAA,WAAA,CAAY,cAAuB,EAAA;AAHnB,QAAA,IAAA,CAAA,UAAU,GAA0B,IAAI,GAAG,EAAE,CAAC;AAC9C,QAAA,IAAA,CAAA,UAAU,GAA2B,IAAI,GAAG,EAAE,CAAC;QAG3D,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC,YAAY,CAAC,WAAW,CAAE,CAAC;QAC3D,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC,YAAY,CAAC,aAAa,CAAE,CAAC;QACnE,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,YAAY,CAAC,SAAS,CAAE,CAAC;QACvD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC,YAAY,CAAC,kBAAkB,CAAE,CAAC;QACvE,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC,YAAY,CAAC,iBAAiB,CAAE,CAAC;QACtE,IAAI,CAAC,WAAW,GAAG,cAAc,CAAC,YAAY,CAAC,cAAc,CAAE,CAAC;QAChE,IAAI,CAAC,YAAY,GAAG,cAAc,CAAC,YAAY,CAAC,cAAc,CAAE,CAAC;AACjE,QAAA,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;AACvC,QAAA,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;KAC1C;AAEO,IAAA,iBAAiB,CAAC,cAAuB,EAAA;QAC7C,MAAM,gBAAgB,GAAG,cAAc,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;QAC5E,IAAI,oBAAoB,GAAG,KAAK,CAAC;AACjC,QAAA,KAAK,MAAM,eAAe,IAAI,gBAAgB,EAAE;YAC5C,MAAM,KAAK,GAAG,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YACpD,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAC9B,YAAA,IAAI,KAAK,KAAK,OAAO,IAAI,CAAC,oBAAoB,EAAE;gBAC5C,oBAAoB,GAAG,IAAI,CAAC;gBAC5B,iBAAiB,GAAG,IAAI,CAAC;AAC5B,aAAA;YACD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,eAAe,CAAC,YAAY,CAAC,MAAM,CAAE,EAAE,IAAI,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAChH,SAAA;KACJ;AACO,IAAA,iBAAiB,CAAC,cAAuB,EAAA;QAC7C,MAAM,iBAAiB,GAAG,cAAc,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;AAC/E,QAAA,KAAK,MAAM,gBAAgB,IAAI,iBAAiB,EAAE;AAC9C,YAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,gBAAgB,CAAC,YAAY,CAAC,MAAM,CAAE,EAAE,IAAI,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAChG,SAAA;KACJ;AACJ;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Control } from './Control.js';
|
|
2
|
+
|
|
3
|
+
class Manifest {
|
|
4
|
+
constructor(manifestXmlString) {
|
|
5
|
+
const xmlDoc = new DOMParser().parseFromString(manifestXmlString, "text/xml");
|
|
6
|
+
const controlElement = xmlDoc.querySelector("control");
|
|
7
|
+
this.control = new Control(controlElement);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { Manifest };
|
|
12
|
+
//# sourceMappingURL=Manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Manifest.js","sources":["../../../../src/components/NestedControlRenderer/manifest/Manifest.ts"],"sourcesContent":["import { Control } from \"./Control\";\n\nexport class Manifest {\n public readonly control: Control;\n\n constructor(manifestXmlString: string) {\n const xmlDoc = new DOMParser().parseFromString(manifestXmlString, \"text/xml\");\n const controlElement = xmlDoc.querySelector(\"control\")!;\n this.control = new Control(controlElement);\n }\n}"],"names":[],"mappings":";;MAEa,QAAQ,CAAA;AAGjB,IAAA,WAAA,CAAY,iBAAyB,EAAA;AACjC,QAAA,MAAM,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;QAC9E,MAAM,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,SAAS,CAAE,CAAC;QACxD,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;KAC9C;AACJ;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class TypeGroup {
|
|
2
|
+
constructor(typeGroupElement) {
|
|
3
|
+
this.types = [];
|
|
4
|
+
this.name = typeGroupElement.getAttribute('name');
|
|
5
|
+
const types = typeGroupElement.querySelectorAll(':scope>type');
|
|
6
|
+
for (const type of types) {
|
|
7
|
+
this.types.push(type.innerHTML);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { TypeGroup };
|
|
13
|
+
//# sourceMappingURL=TypeGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeGroup.js","sources":["../../../../src/components/NestedControlRenderer/manifest/TypeGroup.ts"],"sourcesContent":["import { DataType } from \"@talxis/client-libraries\";\n\n\nexport class TypeGroup {\n public readonly name: string;\n public readonly types: DataType[] = [];\n\n constructor(typeGroupElement: Element) {\n this.name = typeGroupElement.getAttribute('name')!;\n const types = typeGroupElement.querySelectorAll(':scope>type');\n for (const type of types as any) {\n this.types.push(type.innerHTML);\n }\n }\n}"],"names":[],"mappings":"MAGa,SAAS,CAAA;AAIlB,IAAA,WAAA,CAAY,gBAAyB,EAAA;QAFrB,IAAK,CAAA,KAAA,GAAe,EAAE,CAAC;QAGnC,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC,YAAY,CAAC,MAAM,CAAE,CAAC;QACnD,MAAM,KAAK,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;AAC/D,QAAA,KAAK,MAAM,IAAI,IAAI,KAAY,EAAE;YAC7B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACnC,SAAA;KACJ;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Manifest';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DataType } from "@talxis/client-libraries";
|
|
2
|
+
import { Value } from "./Value";
|
|
3
|
+
export declare class Property {
|
|
4
|
+
readonly defaultValue: string | null;
|
|
5
|
+
readonly descriptionKey: string | null;
|
|
6
|
+
readonly displayNameKey: string;
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly ofTypeGroup: string | null;
|
|
9
|
+
readonly ofType: DataType | null;
|
|
10
|
+
readonly required: boolean;
|
|
11
|
+
readonly usage: 'bound' | 'input' | 'output';
|
|
12
|
+
readonly values: Map<string, Value>;
|
|
13
|
+
readonly isBindingProperty: boolean;
|
|
14
|
+
constructor(propertyElement: Element, isBindingProperty: boolean);
|
|
15
|
+
private _createValues;
|
|
16
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Value } from './Value.js';
|
|
2
|
+
|
|
3
|
+
class Property {
|
|
4
|
+
constructor(propertyElement, isBindingProperty) {
|
|
5
|
+
this.values = new Map();
|
|
6
|
+
this.isBindingProperty = false;
|
|
7
|
+
this.isBindingProperty = isBindingProperty;
|
|
8
|
+
this.defaultValue = propertyElement.getAttribute('default-value');
|
|
9
|
+
this.descriptionKey = propertyElement.getAttribute('description-key');
|
|
10
|
+
this.displayNameKey = propertyElement.getAttribute('display-name-key');
|
|
11
|
+
this.name = propertyElement.getAttribute('name');
|
|
12
|
+
this.ofTypeGroup = propertyElement.getAttribute('of-type-group');
|
|
13
|
+
this.ofType = propertyElement.getAttribute('of-type');
|
|
14
|
+
this.required = propertyElement.getAttribute('required') === 'true';
|
|
15
|
+
this.usage = propertyElement.getAttribute('usage');
|
|
16
|
+
if (this.ofType === 'Enum') {
|
|
17
|
+
this._createValues(propertyElement);
|
|
18
|
+
for (const value of [...this.values.values()]) {
|
|
19
|
+
if (value.default) {
|
|
20
|
+
this.defaultValue = value.content;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
_createValues(propertyElement) {
|
|
26
|
+
const values = propertyElement.querySelectorAll(':scope>value');
|
|
27
|
+
for (const value of values) {
|
|
28
|
+
this.values.set(value.getAttribute('name'), new Value(value));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { Property };
|
|
34
|
+
//# sourceMappingURL=Property.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Property.js","sources":["../../../../../src/components/NestedControlRenderer/manifest/property/Property.ts"],"sourcesContent":["import { DataType } from \"@talxis/client-libraries\";\nimport { Value } from \"./Value\";\n\nexport class Property {\n public readonly defaultValue: string | null;\n public readonly descriptionKey: string | null;\n public readonly displayNameKey: string;\n public readonly name: string;\n public readonly ofTypeGroup: string | null;\n public readonly ofType: DataType | null;\n public readonly required: boolean;\n public readonly usage: 'bound' | 'input' | 'output';\n public readonly values: Map<string, Value> = new Map();\n public readonly isBindingProperty: boolean = false;\n\n constructor(propertyElement: Element, isBindingProperty: boolean) {\n this.isBindingProperty = isBindingProperty;\n this.defaultValue = propertyElement.getAttribute('default-value')\n this.descriptionKey = propertyElement.getAttribute('description-key');\n this.displayNameKey = propertyElement.getAttribute('display-name-key')!;\n this.name = propertyElement.getAttribute('name')!;\n this.ofTypeGroup = propertyElement.getAttribute('of-type-group');\n this.ofType = propertyElement.getAttribute('of-type') as DataType;\n this.required = propertyElement.getAttribute('required') === 'true';\n this.usage = propertyElement.getAttribute('usage')! as typeof this.usage;\n if (this.ofType === 'Enum') {\n this._createValues(propertyElement);\n for (const value of [...this.values.values()]) {\n if (value.default) {\n this.defaultValue = value.content;\n }\n }\n }\n }\n\n private _createValues(propertyElement: Element) {\n const values = propertyElement.querySelectorAll(':scope>value');\n for (const value of values) {\n this.values.set(value.getAttribute('name')!, new Value(value))\n }\n }\n}"],"names":[],"mappings":";;MAGa,QAAQ,CAAA;IAYjB,WAAY,CAAA,eAAwB,EAAE,iBAA0B,EAAA;AAHhD,QAAA,IAAA,CAAA,MAAM,GAAuB,IAAI,GAAG,EAAE,CAAC;QACvC,IAAiB,CAAA,iBAAA,GAAY,KAAK,CAAC;AAG/C,QAAA,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,YAAY,GAAG,eAAe,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QACjE,IAAI,CAAC,cAAc,GAAG,eAAe,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;QACtE,IAAI,CAAC,cAAc,GAAG,eAAe,CAAC,YAAY,CAAC,kBAAkB,CAAE,CAAC;QACxE,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,YAAY,CAAC,MAAM,CAAE,CAAC;QAClD,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,GAAG,eAAe,CAAC,YAAY,CAAC,SAAS,CAAa,CAAC;QAClE,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,MAAM,CAAC;QACpE,IAAI,CAAC,KAAK,GAAG,eAAe,CAAC,YAAY,CAAC,OAAO,CAAuB,CAAC;AACzE,QAAA,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE;AACxB,YAAA,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;AACpC,YAAA,KAAK,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE;gBAC3C,IAAI,KAAK,CAAC,OAAO,EAAE;AACf,oBAAA,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;AACrC,iBAAA;AACJ,aAAA;AACJ,SAAA;KACJ;AAEO,IAAA,aAAa,CAAC,eAAwB,EAAA;QAC1C,MAAM,MAAM,GAAG,eAAe,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;AAChE,QAAA,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;AACxB,YAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAE,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;AACjE,SAAA;KACJ;AACJ;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
class Value {
|
|
2
|
+
constructor(valueElement) {
|
|
3
|
+
this.name = valueElement.getAttribute('name');
|
|
4
|
+
this.displayNameKey = valueElement.getAttribute('display-name-key');
|
|
5
|
+
this.descriptionKey = valueElement.getAttribute('description-key');
|
|
6
|
+
this.default = valueElement.getAttribute('default') === 'true';
|
|
7
|
+
this.content = valueElement.innerHTML;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { Value };
|
|
12
|
+
//# sourceMappingURL=Value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Value.js","sources":["../../../../../src/components/NestedControlRenderer/manifest/property/Value.ts"],"sourcesContent":["export class Value {\n public readonly name: string;\n public readonly displayNameKey: string;\n public readonly descriptionKey: string | null;\n public readonly default: boolean;\n public readonly content: string;\n\n constructor(valueElement: Element) {\n this.name = valueElement.getAttribute('name')!;\n this.displayNameKey = valueElement.getAttribute('display-name-key')!\n this.descriptionKey = valueElement.getAttribute('description-key');\n this.default = valueElement.getAttribute('default') === 'true';\n this.content = valueElement.innerHTML;\n }\n}"],"names":[],"mappings":"MAAa,KAAK,CAAA;AAOd,IAAA,WAAA,CAAY,YAAqB,EAAA;QAC7B,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,YAAY,CAAC,MAAM,CAAE,CAAC;QAC/C,IAAI,CAAC,cAAc,GAAG,YAAY,CAAC,YAAY,CAAC,kBAAkB,CAAE,CAAA;QACpE,IAAI,CAAC,cAAc,GAAG,YAAY,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;QACnE,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,MAAM,CAAC;AAC/D,QAAA,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC;KACzC;AACJ;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import { Property } from './Property.js';
|
|
3
|
+
import { FieldValue } from '@talxis/client-libraries';
|
|
4
|
+
|
|
5
|
+
class DateProperty extends Property {
|
|
6
|
+
getParameter() {
|
|
7
|
+
const value = this.getValue();
|
|
8
|
+
const date = dayjs(value);
|
|
9
|
+
const formattedValue = new FieldValue(value, this.dataType).getFormattedValue();
|
|
10
|
+
return {
|
|
11
|
+
raw: date.isValid() ? date.toDate() : value,
|
|
12
|
+
formatted: formattedValue ?? undefined,
|
|
13
|
+
attributes: this.attributeMetadata ?? {
|
|
14
|
+
Behavior: 0,
|
|
15
|
+
//TODO: default format
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { DateProperty };
|
|
22
|
+
//# sourceMappingURL=DateProperty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateProperty.js","sources":["../../../../src/components/NestedControlRenderer/properties/DateProperty.ts"],"sourcesContent":["import dayjs from \"dayjs\";\nimport { IDateTimeProperty } from \"../../../interfaces\";\nimport { Property } from \"./Property\";\nimport { FieldValue } from \"@talxis/client-libraries\";\n\nexport class DateProperty extends Property {\n public getParameter(): IDateTimeProperty {\n const value = this.getValue();\n const date = dayjs(value);\n const formattedValue = new FieldValue(value, this.dataType).getFormattedValue();\n return {\n raw: date.isValid() ? date.toDate() : value,\n formatted: formattedValue ?? undefined,\n attributes: <any>this.attributeMetadata ?? {\n Behavior: 0,\n //TODO: default format\n }\n }\n }\n}"],"names":[],"mappings":";;;;AAKM,MAAO,YAAa,SAAQ,QAAQ,CAAA;IAC/B,YAAY,GAAA;AACf,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;AAC9B,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;AAC1B,QAAA,MAAM,cAAc,GAAG,IAAI,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,iBAAiB,EAAE,CAAC;QAChF,OAAO;AACH,YAAA,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK;YAC3C,SAAS,EAAE,cAAc,IAAI,SAAS;AACtC,YAAA,UAAU,EAAO,IAAI,CAAC,iBAAiB,IAAI;AACvC,gBAAA,QAAQ,EAAE,CAAC;;AAEd,aAAA;SACJ,CAAA;KACJ;AACJ;;;;"}
|