@oracle/oraclejet-core-pack 16.1.3 → 17.0.0
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/oj-c/ActionCard.json +82 -7
- package/oj-c/AreaChart.json +866 -382
- package/oj-c/AreaChartGroup.json +13 -7
- package/oj-c/AreaChartItem.json +23 -31
- package/oj-c/AreaChartSeries.json +21 -22
- package/oj-c/Avatar.json +11 -11
- package/oj-c/Button.json +55 -28
- package/oj-c/ButtonsetMultiple.json +567 -0
- package/oj-c/ButtonsetSingle.json +567 -0
- package/oj-c/CardView.json +638 -0
- package/oj-c/Checkbox.json +100 -85
- package/oj-c/Checkboxset.json +73 -81
- package/oj-c/Collapsible.json +70 -32
- package/oj-c/ConveyorBelt.json +325 -0
- package/oj-c/DatePicker.json +454 -0
- package/oj-c/DragHandle.json +135 -0
- package/oj-c/DrawerLayout.json +401 -0
- package/oj-c/DrawerPopup.json +36 -22
- package/oj-c/Dropdown/Dropdown.js +9 -0
- package/oj-c/Dropdown/index.js +6 -0
- package/oj-c/FilePicker.json +24 -83
- package/oj-c/FormLayout.json +27 -32
- package/oj-c/HighlightText.json +6 -6
- package/oj-c/InputDateMask.json +104 -117
- package/oj-c/InputDatePicker.json +1514 -0
- package/oj-c/InputDateText.json +104 -117
- package/oj-c/InputMonthMask.json +106 -130
- package/oj-c/InputNumber.json +87 -130
- package/oj-c/InputPassword.json +76 -112
- package/oj-c/InputSensitiveText.json +54 -64
- package/oj-c/InputText.json +85 -108
- package/oj-c/LabelledLink.json +31 -30
- package/oj-c/Legend.json +350 -356
- package/oj-c/LegendItem.json +79 -26
- package/oj-c/LegendSection.json +11 -5
- package/oj-c/LineChart.json +869 -385
- package/oj-c/LineChartGroup.json +13 -7
- package/oj-c/LineChartItem.json +23 -31
- package/oj-c/LineChartSeries.json +25 -26
- package/oj-c/ListItemLayout.json +16 -16
- package/oj-c/ListView.json +393 -33
- package/oj-c/MenuButton.json +46 -38
- package/oj-c/MessageBanner.json +162 -15
- package/oj-c/MessageToast.json +123 -26
- package/oj-c/MeterBar.json +40 -29
- package/oj-c/MeterCircle.json +44 -33
- package/oj-c/Popup.json +628 -0
- package/oj-c/ProgressBar.json +7 -7
- package/oj-c/ProgressCircle.json +7 -7
- package/oj-c/Radioset.json +42 -51
- package/oj-c/RatingGauge.json +23 -23
- package/oj-c/SelectMultiple.json +100 -117
- package/oj-c/SelectSingle.json +109 -112
- package/oj-c/SelectionCard.json +12 -6
- package/oj-c/Selector.json +9 -16
- package/oj-c/SelectorAll.json +7 -14
- package/oj-c/Sheet/Sheet.js +9 -0
- package/oj-c/Sheet/index.js +6 -0
- package/oj-c/SplitMenuButton.json +351 -27
- package/oj-c/TabBar.json +553 -0
- package/oj-c/TabBarMixed.json +43 -29
- package/oj-c/TagCloud.json +36 -36
- package/oj-c/TagCloudItem.json +17 -18
- package/oj-c/TextArea.json +84 -126
- package/oj-c/ToggleButton.json +513 -0
- package/oj-c/action-card/__webdriver__/ActionCardWebElement.js +1 -1
- package/oj-c/action-card/__webdriver__/ActionCardWebElement.js.map +1 -1
- package/oj-c/action-card/action-card.js +41 -4
- package/oj-c/action-card/component.json +20 -2
- package/oj-c/action-card.js +1 -1
- package/oj-c/area-chart/__webdriver__/AreaChartWebElementBase.d.ts +11 -0
- package/oj-c/area-chart/__webdriver__/AreaChartWebElementBase.js +9 -0
- package/oj-c/area-chart/__webdriver__/AreaChartWebElementBase.js.map +1 -1
- package/oj-c/area-chart/area-chart.js +7 -13
- package/oj-c/area-chart/component.json +51 -12
- package/oj-c/area-chart-group/component.json +8 -2
- package/oj-c/area-chart-group.js +1 -1
- package/oj-c/area-chart-item/component.json +8 -2
- package/oj-c/area-chart-item.js +1 -1
- package/oj-c/area-chart-series/component.json +8 -2
- package/oj-c/area-chart-series.js +1 -1
- package/oj-c/area-chart.js +1 -1
- package/oj-c/avatar/avatar-styles.css +1 -0
- package/oj-c/avatar/component.json +5 -2
- package/oj-c/avatar.js +1 -1
- package/oj-c/button/button.js +36 -34
- package/oj-c/button/component.json +18 -19
- package/oj-c/button.js +1 -1
- package/oj-c/buttonset-multiple/__webdriver__/ButtonsetMultipleWebElement.d.ts +8 -0
- package/oj-c/buttonset-multiple/__webdriver__/ButtonsetMultipleWebElement.js +13 -0
- package/oj-c/buttonset-multiple/__webdriver__/ButtonsetMultipleWebElement.js.map +1 -0
- package/oj-c/buttonset-multiple/__webdriver__/ButtonsetMultipleWebElementBase.d.ts +101 -0
- package/oj-c/buttonset-multiple/__webdriver__/ButtonsetMultipleWebElementBase.js +104 -0
- package/oj-c/buttonset-multiple/__webdriver__/ButtonsetMultipleWebElementBase.js.map +1 -0
- package/oj-c/buttonset-multiple/__webdriver__/index.d.ts +17 -0
- package/oj-c/buttonset-multiple/__webdriver__/index.js +34 -0
- package/oj-c/buttonset-multiple/__webdriver__/index.js.map +1 -0
- package/oj-c/buttonset-multiple/buttonset-multiple-styles.css +12 -0
- package/oj-c/buttonset-multiple/buttonset-multiple.js +55 -0
- package/oj-c/buttonset-multiple/component.json +228 -0
- package/oj-c/buttonset-multiple/index.js +6 -0
- package/oj-c/buttonset-multiple.js +6 -0
- package/oj-c/buttonset-single/__webdriver__/ButtonsetSingleWebElement.d.ts +8 -0
- package/oj-c/buttonset-single/__webdriver__/ButtonsetSingleWebElement.js +13 -0
- package/oj-c/buttonset-single/__webdriver__/ButtonsetSingleWebElement.js.map +1 -0
- package/oj-c/buttonset-single/__webdriver__/ButtonsetSingleWebElementBase.d.ts +101 -0
- package/oj-c/buttonset-single/__webdriver__/ButtonsetSingleWebElementBase.js +104 -0
- package/oj-c/buttonset-single/__webdriver__/ButtonsetSingleWebElementBase.js.map +1 -0
- package/oj-c/buttonset-single/__webdriver__/index.d.ts +17 -0
- package/oj-c/buttonset-single/__webdriver__/index.js +34 -0
- package/oj-c/buttonset-single/__webdriver__/index.js.map +1 -0
- package/oj-c/buttonset-single/buttonset-single-styles.css +12 -0
- package/oj-c/buttonset-single/buttonset-single.js +55 -0
- package/oj-c/buttonset-single/component.json +228 -0
- package/oj-c/buttonset-single/index.js +6 -0
- package/oj-c/buttonset-single.js +6 -0
- package/oj-c/card-view/__webdriver__/CardViewWebElement.d.ts +33 -0
- package/oj-c/card-view/__webdriver__/CardViewWebElement.js +70 -0
- package/oj-c/card-view/__webdriver__/CardViewWebElement.js.map +1 -0
- package/oj-c/card-view/__webdriver__/CardViewWebElementBase.d.ts +95 -0
- package/oj-c/card-view/__webdriver__/CardViewWebElementBase.js +104 -0
- package/oj-c/card-view/__webdriver__/CardViewWebElementBase.js.map +1 -0
- package/oj-c/card-view/__webdriver__/index.d.ts +17 -0
- package/oj-c/card-view/__webdriver__/index.js +34 -0
- package/oj-c/card-view/__webdriver__/index.js.map +1 -0
- package/oj-c/card-view/card-view-styles.css +15 -0
- package/oj-c/card-view/card-view.js +71 -0
- package/oj-c/card-view/cardViewItem.js +15 -0
- package/oj-c/card-view/component.json +323 -0
- package/oj-c/card-view/index.js +6 -0
- package/oj-c/card-view/useCardViewPreact.js +80 -0
- package/oj-c/card-view.js +6 -0
- package/oj-c/checkbox/checkbox.js +51 -91
- package/oj-c/checkbox/component.json +32 -19
- package/oj-c/checkbox/useCheckboxPreact.js +2 -4
- package/oj-c/checkbox.js +1 -1
- package/oj-c/checkboxset/checkboxset.js +38 -77
- package/oj-c/checkboxset/component.json +32 -24
- package/oj-c/checkboxset/useCheckboxsetPreact.js +1 -1
- package/oj-c/checkboxset.js +1 -1
- package/oj-c/collapsible/__webdriver__/CollapsibleWebElementBase.d.ts +1 -1
- package/oj-c/collapsible/__webdriver__/CollapsibleWebElementBase.js +1 -1
- package/oj-c/collapsible/__webdriver__/CollapsibleWebElementBase.js.map +1 -1
- package/oj-c/collapsible/collapsible.js +9 -6
- package/oj-c/collapsible/component.json +40 -13
- package/oj-c/collapsible.js +1 -1
- package/oj-c/component.json +49 -5
- package/oj-c/conveyor-belt/__webdriver__/ConveyorBeltWebElement.d.ts +8 -0
- package/oj-c/conveyor-belt/__webdriver__/ConveyorBeltWebElement.js +13 -0
- package/oj-c/conveyor-belt/__webdriver__/ConveyorBeltWebElement.js.map +1 -0
- package/oj-c/conveyor-belt/__webdriver__/ConveyorBeltWebElementBase.d.ts +44 -0
- package/oj-c/conveyor-belt/__webdriver__/ConveyorBeltWebElementBase.js +59 -0
- package/oj-c/conveyor-belt/__webdriver__/ConveyorBeltWebElementBase.js.map +1 -0
- package/oj-c/conveyor-belt/__webdriver__/index.d.ts +17 -0
- package/oj-c/conveyor-belt/__webdriver__/index.js +34 -0
- package/oj-c/conveyor-belt/__webdriver__/index.js.map +1 -0
- package/oj-c/conveyor-belt/component.json +181 -0
- package/oj-c/conveyor-belt/conveyor-belt-styles.css +20 -0
- package/oj-c/conveyor-belt/conveyor-belt.js +125 -0
- package/oj-c/conveyor-belt/conveyorBeltItem.js +13 -0
- package/oj-c/conveyor-belt/index.js +6 -0
- package/oj-c/conveyor-belt.js +6 -0
- package/oj-c/corepackbundle.js +6975 -5062
- package/oj-c/date-picker/__webdriver__/DatePickerWebElement.d.ts +8 -0
- package/oj-c/date-picker/__webdriver__/DatePickerWebElement.js +13 -0
- package/oj-c/date-picker/__webdriver__/DatePickerWebElement.js.map +1 -0
- package/oj-c/date-picker/__webdriver__/DatePickerWebElementBase.d.ts +93 -0
- package/oj-c/date-picker/__webdriver__/DatePickerWebElementBase.js +122 -0
- package/oj-c/date-picker/__webdriver__/DatePickerWebElementBase.js.map +1 -0
- package/oj-c/date-picker/__webdriver__/index.d.ts +17 -0
- package/oj-c/date-picker/__webdriver__/index.js +34 -0
- package/oj-c/date-picker/__webdriver__/index.js.map +1 -0
- package/oj-c/date-picker/component.json +179 -0
- package/oj-c/date-picker/date-picker-styles.css +14 -0
- package/oj-c/date-picker/date-picker.js +34 -0
- package/oj-c/date-picker/index.js +6 -0
- package/oj-c/date-picker.js +6 -0
- package/oj-c/drag-handle/component.json +82 -0
- package/oj-c/drag-handle/drag-handle.js +11 -0
- package/oj-c/drag-handle/index.js +6 -0
- package/oj-c/drag-handle.js +6 -0
- package/oj-c/drawer-layout/__webdriver__/DrawerLayoutWebElement.d.ts +8 -0
- package/oj-c/drawer-layout/__webdriver__/DrawerLayoutWebElement.js +13 -0
- package/oj-c/drawer-layout/__webdriver__/DrawerLayoutWebElement.js.map +1 -0
- package/oj-c/drawer-layout/__webdriver__/DrawerLayoutWebElementBase.d.ts +72 -0
- package/oj-c/drawer-layout/__webdriver__/DrawerLayoutWebElementBase.js +95 -0
- package/oj-c/drawer-layout/__webdriver__/DrawerLayoutWebElementBase.js.map +1 -0
- package/oj-c/drawer-layout/__webdriver__/index.d.ts +17 -0
- package/oj-c/drawer-layout/__webdriver__/index.js +34 -0
- package/oj-c/drawer-layout/__webdriver__/index.js.map +1 -0
- package/oj-c/drawer-layout/component.json +208 -0
- package/oj-c/drawer-layout/drawer-layout-styles.css +11 -0
- package/oj-c/drawer-layout/drawer-layout.js +37 -0
- package/oj-c/drawer-layout/index.js +6 -0
- package/oj-c/drawer-layout.js +6 -0
- package/oj-c/drawer-popup/component.json +53 -15
- package/oj-c/drawer-popup/drawer-popup.js +33 -5
- package/oj-c/drawer-popup.js +1 -1
- package/oj-c/editable-value/UNSAFE_useComponentMessaging/useComponentMessaging.js +2 -2
- package/oj-c/editable-value/UNSAFE_useEditableValue/useEditableValue.js +2 -1
- package/oj-c/editable-value/UNSAFE_useValueLifecycle/useValueLifecycle.js +2 -5
- package/oj-c/file-picker/__webdriver__/FilePickerWebElement.d.ts +15 -0
- package/oj-c/file-picker/__webdriver__/FilePickerWebElement.js +89 -19
- package/oj-c/file-picker/__webdriver__/FilePickerWebElement.js.map +1 -1
- package/oj-c/file-picker/component.json +10 -19
- package/oj-c/file-picker/file-picker.js +1 -9
- package/oj-c/file-picker.js +1 -1
- package/oj-c/form-layout/component.json +16 -11
- package/oj-c/form-layout/form-layout.js +11 -43
- package/oj-c/form-layout.js +1 -1
- package/oj-c/highlight-text/component.json +5 -2
- package/oj-c/highlight-text.js +1 -1
- package/oj-c/hooks/PRIVATE_useVisData/useVisData.js +44 -0
- package/oj-c/hooks/UNSAFE_useChartData/useChartData.js +4 -4
- package/oj-c/hooks/UNSAFE_useEditableValue/converterUtils.js +50 -0
- package/oj-c/hooks/UNSAFE_useEditableValue/index.js +6 -0
- package/oj-c/hooks/UNSAFE_useEditableValue/reducer.js +164 -0
- package/oj-c/hooks/UNSAFE_useEditableValue/types.js +4 -0
- package/oj-c/hooks/UNSAFE_useEditableValue/useEditableValue.js +336 -0
- package/oj-c/hooks/UNSAFE_useEditableValue/utils.js +35 -0
- package/oj-c/hooks/UNSAFE_useEditableValue/validationUtils.js +53 -0
- package/oj-c/hooks/UNSAFE_useListData/useListData.js +4 -1
- package/oj-c/hooks/UNSAFE_useMergedFormContext/useMergedFormContext.js +23 -0
- package/oj-c/hooks/UNSAFE_useVisBusyState/useVisBusyState.js +16 -0
- package/oj-c/input-date-mask/component.json +17 -7
- package/oj-c/input-date-mask/input-date-mask.js +11 -10
- package/oj-c/input-date-mask/useInputDateMaskPreact.js +22 -15
- package/oj-c/input-date-mask.js +1 -1
- package/oj-c/input-date-picker/DateRangeValidator.js +53 -0
- package/oj-c/input-date-picker/DateRestrictionValidator.js +35 -0
- package/oj-c/input-date-picker/__webdriver__/InputDatePickerWebElement.d.ts +17 -0
- package/oj-c/input-date-picker/__webdriver__/InputDatePickerWebElement.js +73 -0
- package/oj-c/input-date-picker/__webdriver__/InputDatePickerWebElement.js.map +1 -0
- package/oj-c/input-date-picker/__webdriver__/InputDatePickerWebElementBase.d.ts +291 -0
- package/oj-c/input-date-picker/__webdriver__/InputDatePickerWebElementBase.js +302 -0
- package/oj-c/input-date-picker/__webdriver__/InputDatePickerWebElementBase.js.map +1 -0
- package/oj-c/input-date-picker/__webdriver__/index.d.ts +17 -0
- package/oj-c/input-date-picker/__webdriver__/index.js +34 -0
- package/oj-c/input-date-picker/__webdriver__/index.js.map +1 -0
- package/oj-c/input-date-picker/component.json +563 -0
- package/oj-c/input-date-picker/index.js +6 -0
- package/oj-c/input-date-picker/input-date-picker-styles.css +13 -0
- package/oj-c/input-date-picker/input-date-picker.js +39 -0
- package/oj-c/input-date-picker/useCombinedImplicitValidators.js +13 -0
- package/oj-c/input-date-picker/useImplicitCalendarDateConverter.js +17 -0
- package/oj-c/input-date-picker/useImplicitDateRangeValidator.js +29 -0
- package/oj-c/input-date-picker/useImplicitDateRestrictionValidator.js +16 -0
- package/oj-c/input-date-picker/useInputDatePicker.js +141 -0
- package/oj-c/input-date-picker/utils.js +23 -0
- package/oj-c/input-date-picker.js +6 -0
- package/oj-c/input-date-text/__webdriver__/InputDateTextWebElementBase.d.ts +0 -7
- package/oj-c/input-date-text/__webdriver__/InputDateTextWebElementBase.js +0 -9
- package/oj-c/input-date-text/__webdriver__/InputDateTextWebElementBase.js.map +1 -1
- package/oj-c/input-date-text/component.json +34 -21
- package/oj-c/input-date-text/input-date-text.js +52 -94
- package/oj-c/input-date-text/useInputDateTextPreact.js +19 -13
- package/oj-c/input-date-text.js +1 -1
- package/oj-c/input-month-mask/component.json +17 -7
- package/oj-c/input-month-mask/input-month-mask.js +11 -10
- package/oj-c/input-month-mask/useImplicitCalendarMonthRangeValidator.js +9 -1
- package/oj-c/input-month-mask/useInputMonthMaskPreact.js +19 -13
- package/oj-c/input-month-mask.js +1 -1
- package/oj-c/input-number/__webdriver__/InputNumberWebElementBase.d.ts +0 -7
- package/oj-c/input-number/__webdriver__/InputNumberWebElementBase.js +0 -9
- package/oj-c/input-number/__webdriver__/InputNumberWebElementBase.js.map +1 -1
- package/oj-c/input-number/component.json +22 -19
- package/oj-c/input-number/input-number.js +52 -96
- package/oj-c/input-number.js +1 -1
- package/oj-c/input-password/__webdriver__/InputPasswordWebElementBase.d.ts +0 -7
- package/oj-c/input-password/__webdriver__/InputPasswordWebElementBase.js +0 -9
- package/oj-c/input-password/__webdriver__/InputPasswordWebElementBase.js.map +1 -1
- package/oj-c/input-password/component.json +22 -19
- package/oj-c/input-password/input-password.js +47 -90
- package/oj-c/input-password.js +1 -1
- package/oj-c/input-sensitive-text/component.json +13 -6
- package/oj-c/input-sensitive-text/input-sensitive-text.js +11 -10
- package/oj-c/input-sensitive-text.js +1 -1
- package/oj-c/input-text/component.json +22 -16
- package/oj-c/input-text/input-text.js +57 -96
- package/oj-c/input-text/useInputTextPreact.js +15 -12
- package/oj-c/input-text.js +1 -1
- package/oj-c/labelled-link/component.json +12 -3
- package/oj-c/labelled-link.js +1 -1
- package/oj-c/legend/component.json +17 -2
- package/oj-c/legend/events.js +3 -2
- package/oj-c/legend/legend.js +28 -16
- package/oj-c/legend/utils.js +28 -6
- package/oj-c/legend-item/component.json +41 -6
- package/oj-c/legend-item/legend-item.js +4 -3
- package/oj-c/legend-item.js +1 -1
- package/oj-c/legend-section/component.json +18 -2
- package/oj-c/legend-section.js +1 -1
- package/oj-c/legend.js +1 -1
- package/oj-c/line-chart/__webdriver__/LineChartWebElementBase.d.ts +11 -0
- package/oj-c/line-chart/__webdriver__/LineChartWebElementBase.js +9 -0
- package/oj-c/line-chart/__webdriver__/LineChartWebElementBase.js.map +1 -1
- package/oj-c/line-chart/component.json +55 -16
- package/oj-c/line-chart/line-chart.js +7 -13
- package/oj-c/line-chart-group/component.json +8 -2
- package/oj-c/line-chart-group.js +1 -1
- package/oj-c/line-chart-item/component.json +8 -2
- package/oj-c/line-chart-item.js +1 -1
- package/oj-c/line-chart-series/component.json +10 -4
- package/oj-c/line-chart-series/line-chart-series.js +1 -1
- package/oj-c/line-chart-series.js +1 -1
- package/oj-c/line-chart.js +1 -1
- package/oj-c/list-item-layout/__webdriver__/ListItemLayoutWebElement.d.ts +12 -3
- package/oj-c/list-item-layout/__webdriver__/ListItemLayoutWebElement.js +12 -3
- package/oj-c/list-item-layout/__webdriver__/ListItemLayoutWebElement.js.map +1 -1
- package/oj-c/list-item-layout/component.json +10 -14
- package/oj-c/list-item-layout/list-item-layout.js +3 -3
- package/oj-c/list-item-layout.js +1 -1
- package/oj-c/list-view/DataFetchLiveRegion.js +30 -0
- package/oj-c/list-view/__webdriver__/ListViewWebElement.d.ts +1 -1
- package/oj-c/list-view/__webdriver__/ListViewWebElement.js +4 -7
- package/oj-c/list-view/__webdriver__/ListViewWebElement.js.map +1 -1
- package/oj-c/list-view/__webdriver__/ListViewWebElementBase.d.ts +26 -0
- package/oj-c/list-view/__webdriver__/ListViewWebElementBase.js +18 -0
- package/oj-c/list-view/__webdriver__/ListViewWebElementBase.js.map +1 -1
- package/oj-c/list-view/component.json +207 -3
- package/oj-c/list-view/list-view.js +32 -7
- package/oj-c/list-view/useListViewPreact.js +101 -10
- package/oj-c/list-view.js +1 -1
- package/oj-c/menu-button/__webdriver__/MenuButtonWebElement.d.ts +1 -0
- package/oj-c/menu-button/__webdriver__/MenuButtonWebElement.js +14 -8
- package/oj-c/menu-button/__webdriver__/MenuButtonWebElement.js.map +1 -1
- package/oj-c/menu-button/component.json +21 -17
- package/oj-c/menu-button/menu-button.js +5 -8
- package/oj-c/menu-button.js +1 -1
- package/oj-c/message-banner/__webdriver__/MessageBannerWebElementBase.d.ts +7 -0
- package/oj-c/message-banner/__webdriver__/MessageBannerWebElementBase.js +9 -0
- package/oj-c/message-banner/__webdriver__/MessageBannerWebElementBase.js.map +1 -1
- package/oj-c/message-banner/component.json +28 -3
- package/oj-c/message-banner/message-banner.js +30 -3
- package/oj-c/message-banner.js +1 -1
- package/oj-c/message-toast/component.json +9 -4
- package/oj-c/message-toast.js +1 -1
- package/oj-c/metadata/allComponents.json +4181 -637
- package/oj-c/meter-bar/component.json +11 -3
- package/oj-c/meter-bar/meter-bar-styles.css +14 -2
- package/oj-c/meter-bar/meter-bar.js +2 -2
- package/oj-c/meter-bar.js +1 -1
- package/oj-c/meter-circle/component.json +11 -3
- package/oj-c/meter-circle/meter-circle-styles.css +5 -0
- package/oj-c/meter-circle/meter-circle.js +2 -2
- package/oj-c/meter-circle.js +1 -1
- package/oj-c/min/Dropdown/Dropdown.js +9 -0
- package/oj-c/min/Dropdown/index.js +6 -0
- package/oj-c/min/Sheet/Sheet.js +9 -0
- package/oj-c/min/Sheet/index.js +6 -0
- package/oj-c/min/action-card.js +1 -1
- package/oj-c/min/action-card.js.map +1 -1
- package/oj-c/min/area-chart-group.js +1 -1
- package/oj-c/min/area-chart-group.js.map +1 -1
- package/oj-c/min/area-chart-item.js +1 -1
- package/oj-c/min/area-chart-item.js.map +1 -1
- package/oj-c/min/area-chart-series.js +1 -1
- package/oj-c/min/area-chart-series.js.map +1 -1
- package/oj-c/min/area-chart.js +1 -1
- package/oj-c/min/area-chart.js.map +1 -1
- package/oj-c/min/avatar/avatar-styles.css +1 -0
- package/oj-c/min/avatar.js +1 -1
- package/oj-c/min/avatar.js.map +1 -1
- package/oj-c/min/button.js +1 -1
- package/oj-c/min/button.js.map +1 -1
- package/oj-c/min/buttonset-multiple/buttonset-multiple-styles.css +12 -0
- package/oj-c/min/buttonset-multiple.js +2 -0
- package/oj-c/min/buttonset-multiple.js.map +1 -0
- package/oj-c/min/buttonset-single/buttonset-single-styles.css +12 -0
- package/oj-c/min/buttonset-single.js +2 -0
- package/oj-c/min/buttonset-single.js.map +1 -0
- package/oj-c/min/card-view/card-view-styles.css +15 -0
- package/oj-c/min/card-view.js +2 -0
- package/oj-c/min/card-view.js.map +1 -0
- package/oj-c/min/checkbox.js +1 -1
- package/oj-c/min/checkbox.js.map +1 -1
- package/oj-c/min/checkboxset.js +1 -1
- package/oj-c/min/checkboxset.js.map +1 -1
- package/oj-c/min/collapsible.js +1 -1
- package/oj-c/min/collapsible.js.map +1 -1
- package/oj-c/min/conveyor-belt/conveyor-belt-styles.css +20 -0
- package/oj-c/min/conveyor-belt.js +2 -0
- package/oj-c/min/conveyor-belt.js.map +1 -0
- package/oj-c/min/corepackbundle.css +121 -16
- package/oj-c/min/corepackbundle.js +1 -1
- package/oj-c/min/corepackbundle.js.map +1 -1
- package/oj-c/min/date-picker/date-picker-styles.css +14 -0
- package/oj-c/min/date-picker.js +2 -0
- package/oj-c/min/date-picker.js.map +1 -0
- package/oj-c/min/drag-handle.js +2 -0
- package/oj-c/min/drag-handle.js.map +1 -0
- package/oj-c/min/drawer-layout/drawer-layout-styles.css +11 -0
- package/oj-c/min/drawer-layout.js +2 -0
- package/oj-c/min/drawer-layout.js.map +1 -0
- package/oj-c/min/drawer-popup.js +1 -1
- package/oj-c/min/drawer-popup.js.map +1 -1
- package/oj-c/min/editable-value/UNSAFE_useComponentMessaging/useComponentMessaging.js +2 -2
- package/oj-c/min/editable-value/UNSAFE_useEditableValue/useEditableValue.js +2 -1
- package/oj-c/min/editable-value/UNSAFE_useValueLifecycle/useValueLifecycle.js +2 -5
- package/oj-c/min/file-picker.js +1 -1
- package/oj-c/min/file-picker.js.map +1 -1
- package/oj-c/min/form-layout.js +1 -1
- package/oj-c/min/form-layout.js.map +1 -1
- package/oj-c/min/highlight-text.js +1 -1
- package/oj-c/min/highlight-text.js.map +1 -1
- package/oj-c/min/hooks/PRIVATE_useVisData/useVisData.js +44 -0
- package/oj-c/min/hooks/UNSAFE_useChartData/useChartData.js +4 -4
- package/oj-c/min/hooks/UNSAFE_useEditableValue/converterUtils.js +50 -0
- package/oj-c/min/hooks/UNSAFE_useEditableValue/index.js +6 -0
- package/oj-c/min/hooks/UNSAFE_useEditableValue/reducer.js +164 -0
- package/oj-c/min/hooks/UNSAFE_useEditableValue/types.js +4 -0
- package/oj-c/min/hooks/UNSAFE_useEditableValue/useEditableValue.js +336 -0
- package/oj-c/min/hooks/UNSAFE_useEditableValue/utils.js +35 -0
- package/oj-c/min/hooks/UNSAFE_useEditableValue/validationUtils.js +53 -0
- package/oj-c/min/hooks/UNSAFE_useListData/useListData.js +4 -1
- package/oj-c/min/hooks/UNSAFE_useMergedFormContext/useMergedFormContext.js +23 -0
- package/oj-c/min/hooks/UNSAFE_useVisBusyState/useVisBusyState.js +16 -0
- package/oj-c/min/input-date-mask.js +1 -1
- package/oj-c/min/input-date-mask.js.map +1 -1
- package/oj-c/min/input-date-picker/input-date-picker-styles.css +13 -0
- package/oj-c/min/input-date-picker.js +3 -0
- package/oj-c/min/input-date-picker.js.map +1 -0
- package/oj-c/min/input-date-text.js +1 -1
- package/oj-c/min/input-date-text.js.map +1 -1
- package/oj-c/min/input-month-mask.js +1 -1
- package/oj-c/min/input-month-mask.js.map +1 -1
- package/oj-c/min/input-number.js +1 -1
- package/oj-c/min/input-number.js.map +1 -1
- package/oj-c/min/input-password.js +1 -1
- package/oj-c/min/input-password.js.map +1 -1
- package/oj-c/min/input-sensitive-text.js +1 -1
- package/oj-c/min/input-sensitive-text.js.map +1 -1
- package/oj-c/min/input-text.js +1 -1
- package/oj-c/min/input-text.js.map +1 -1
- package/oj-c/min/labelled-link.js +1 -1
- package/oj-c/min/labelled-link.js.map +1 -1
- package/oj-c/min/legend-item.js +1 -1
- package/oj-c/min/legend-item.js.map +1 -1
- package/oj-c/min/legend-section.js +1 -1
- package/oj-c/min/legend-section.js.map +1 -1
- package/oj-c/min/legend.js +1 -1
- package/oj-c/min/legend.js.map +1 -1
- package/oj-c/min/line-chart-group.js +1 -1
- package/oj-c/min/line-chart-group.js.map +1 -1
- package/oj-c/min/line-chart-item.js +1 -1
- package/oj-c/min/line-chart-item.js.map +1 -1
- package/oj-c/min/line-chart-series.js +1 -1
- package/oj-c/min/line-chart-series.js.map +1 -1
- package/oj-c/min/line-chart.js +1 -1
- package/oj-c/min/line-chart.js.map +1 -1
- package/oj-c/min/list-item-layout.js +1 -1
- package/oj-c/min/list-item-layout.js.map +1 -1
- package/oj-c/min/list-view.js +1 -1
- package/oj-c/min/list-view.js.map +1 -1
- package/oj-c/min/menu-button.js +1 -1
- package/oj-c/min/menu-button.js.map +1 -1
- package/oj-c/min/message-banner.js +1 -1
- package/oj-c/min/message-banner.js.map +1 -1
- package/oj-c/min/message-toast.js +1 -1
- package/oj-c/min/message-toast.js.map +1 -1
- package/oj-c/min/meter-bar/meter-bar-styles.css +14 -2
- package/oj-c/min/meter-bar.js +1 -1
- package/oj-c/min/meter-bar.js.map +1 -1
- package/oj-c/min/meter-circle/meter-circle-styles.css +5 -0
- package/oj-c/min/meter-circle.js +1 -1
- package/oj-c/min/meter-circle.js.map +1 -1
- package/oj-c/min/popup/popup-styles.css +12 -0
- package/oj-c/min/popup/resources/nls/popup-strings.d.ts +8 -0
- package/oj-c/min/popup/resources/nls/popup-strings.js +10 -0
- package/oj-c/min/popup.js +2 -0
- package/oj-c/min/popup.js.map +1 -0
- package/oj-c/min/progress-bar.js +1 -1
- package/oj-c/min/progress-bar.js.map +1 -1
- package/oj-c/min/progress-circle.js +1 -1
- package/oj-c/min/progress-circle.js.map +1 -1
- package/oj-c/min/radioset/radioset-styles.css +5 -6
- package/oj-c/min/radioset.js +1 -1
- package/oj-c/min/radioset.js.map +1 -1
- package/oj-c/min/rating-gauge.js +1 -1
- package/oj-c/min/rating-gauge.js.map +1 -1
- package/oj-c/min/select-common/utils/utils.js +40 -2
- package/oj-c/min/select-multiple.js +2 -2
- package/oj-c/min/select-multiple.js.map +1 -1
- package/oj-c/min/select-single.js +2 -2
- package/oj-c/min/select-single.js.map +1 -1
- package/oj-c/min/selection-card.js +1 -1
- package/oj-c/min/selection-card.js.map +1 -1
- package/oj-c/min/selector-all.js +1 -1
- package/oj-c/min/selector-all.js.map +1 -1
- package/oj-c/min/selector.js +1 -1
- package/oj-c/min/selector.js.map +1 -1
- package/oj-c/min/split-menu-button.js +1 -1
- package/oj-c/min/split-menu-button.js.map +1 -1
- package/oj-c/min/tab-bar/tab-bar-styles.css +11 -0
- package/oj-c/min/tab-bar-mixed.js +1 -1
- package/oj-c/min/tab-bar-mixed.js.map +1 -1
- package/oj-c/min/tab-bar.js +2 -0
- package/oj-c/min/tab-bar.js.map +1 -0
- package/oj-c/min/tag-cloud-item.js +1 -1
- package/oj-c/min/tag-cloud-item.js.map +1 -1
- package/oj-c/min/tag-cloud.js +1 -1
- package/oj-c/min/tag-cloud.js.map +1 -1
- package/oj-c/min/text-area.js +1 -1
- package/oj-c/min/text-area.js.map +1 -1
- package/oj-c/min/toggle-button/toggle-button-styles.css +12 -0
- package/oj-c/min/toggle-button.js +2 -0
- package/oj-c/min/toggle-button.js.map +1 -0
- package/oj-c/min/utils/PRIVATE_ItemsMenu/items-menu.js +7 -5
- package/oj-c/min/utils/PRIVATE_chartUtils/axisUtils.js +1 -0
- package/oj-c/min/utils/PRIVATE_toggleUtils/index.js +7 -0
- package/oj-c/min/utils/PRIVATE_toggleUtils/toggle-item-icon.js +14 -0
- package/oj-c/min/utils/PRIVATE_toggleUtils/toggleTypes.js +4 -0
- package/oj-c/min/utils/PRIVATE_toggleUtils/widthStyle.js +19 -0
- package/oj-c/min/utils/UNSAFE_keyUtils/keySetUtils.js +21 -1
- package/oj-c/min/utils/UNSAFE_vizUtils/TemplateHandler.js +15 -3
- package/oj-c/popup/README.md +6 -0
- package/oj-c/popup/__webdriver__/PopupWebElement.d.ts +8 -0
- package/oj-c/popup/__webdriver__/PopupWebElement.js +13 -0
- package/oj-c/popup/__webdriver__/PopupWebElement.js.map +1 -0
- package/oj-c/popup/__webdriver__/PopupWebElementBase.d.ts +138 -0
- package/oj-c/popup/__webdriver__/PopupWebElementBase.js +167 -0
- package/oj-c/popup/__webdriver__/PopupWebElementBase.js.map +1 -0
- package/oj-c/popup/__webdriver__/index.d.ts +17 -0
- package/oj-c/popup/__webdriver__/index.js +34 -0
- package/oj-c/popup/__webdriver__/index.js.map +1 -0
- package/oj-c/popup/component.json +310 -0
- package/oj-c/popup/index.js +6 -0
- package/oj-c/popup/popup-styles.css +12 -0
- package/oj-c/popup/popup.js +127 -0
- package/oj-c/popup/resources/nls/popup-strings.js +10 -0
- package/oj-c/popup/themes/base/_popup.scss +22 -0
- package/oj-c/popup/themes/redwood/_popup.scss +19 -0
- package/oj-c/popup/themes/stable/_popup.scss +19 -0
- package/oj-c/popup.js +6 -0
- package/oj-c/progress-bar/component.json +5 -2
- package/oj-c/progress-bar.js +1 -1
- package/oj-c/progress-circle/component.json +5 -2
- package/oj-c/progress-circle.js +1 -1
- package/oj-c/radioset/component.json +10 -9
- package/oj-c/radioset/radioset-styles.css +5 -6
- package/oj-c/radioset/radioset.js +24 -17
- package/oj-c/radioset.js +1 -1
- package/oj-c/rating-gauge/component.json +5 -2
- package/oj-c/rating-gauge.js +1 -1
- package/oj-c/select-common/utils/utils.js +40 -2
- package/oj-c/select-multiple/__webdriver__/SelectMultipleWebElementBase.d.ts +7 -7
- package/oj-c/select-multiple/__webdriver__/SelectMultipleWebElementBase.js +9 -9
- package/oj-c/select-multiple/__webdriver__/SelectMultipleWebElementBase.js.map +1 -1
- package/oj-c/select-multiple/component.json +31 -20
- package/oj-c/select-multiple/select-multiple.js +44 -91
- package/oj-c/select-multiple/useSelectMultiplePreact.js +17 -12
- package/oj-c/select-multiple/useSyncValueAndValueItems.js +32 -8
- package/oj-c/select-multiple.js +1 -1
- package/oj-c/select-single/__webdriver__/SelectSingleWebElementBase.d.ts +7 -7
- package/oj-c/select-single/__webdriver__/SelectSingleWebElementBase.js +9 -9
- package/oj-c/select-single/__webdriver__/SelectSingleWebElementBase.js.map +1 -1
- package/oj-c/select-single/component.json +39 -21
- package/oj-c/select-single/select-single.js +45 -94
- package/oj-c/select-single/useSelectSinglePreact.js +25 -12
- package/oj-c/select-single/useSyncValueAndValueItem.js +32 -7
- package/oj-c/select-single.js +1 -1
- package/oj-c/selection-card/component.json +11 -2
- package/oj-c/selection-card.js +1 -1
- package/oj-c/selector/component.json +5 -2
- package/oj-c/selector-all/component.json +5 -2
- package/oj-c/selector-all/selector-all.js +1 -1
- package/oj-c/selector-all.js +1 -1
- package/oj-c/selector.js +1 -1
- package/oj-c/split-menu-button/__webdriver__/SplitMenuButtonWebElement.d.ts +1 -0
- package/oj-c/split-menu-button/__webdriver__/SplitMenuButtonWebElement.js +13 -8
- package/oj-c/split-menu-button/__webdriver__/SplitMenuButtonWebElement.js.map +1 -1
- package/oj-c/split-menu-button/__webdriver__/SplitMenuButtonWebElementBase.d.ts +59 -1
- package/oj-c/split-menu-button/__webdriver__/SplitMenuButtonWebElementBase.js.map +1 -1
- package/oj-c/split-menu-button/component.json +125 -13
- package/oj-c/split-menu-button/split-menu-button.js +3 -4
- package/oj-c/split-menu-button.js +1 -1
- package/oj-c/tab-bar/ContentRenderer.js +41 -0
- package/oj-c/tab-bar/DataTabBar.js +54 -0
- package/oj-c/tab-bar/DataTabBar.types.js +4 -0
- package/oj-c/tab-bar/DataTabBarIcon.js +16 -0
- package/oj-c/tab-bar/__webdriver__/TabBarWebElement.d.ts +8 -0
- package/oj-c/tab-bar/__webdriver__/TabBarWebElement.js +13 -0
- package/oj-c/tab-bar/__webdriver__/TabBarWebElement.js.map +1 -0
- package/oj-c/tab-bar/__webdriver__/TabBarWebElementBase.d.ts +65 -0
- package/oj-c/tab-bar/__webdriver__/TabBarWebElementBase.js +86 -0
- package/oj-c/tab-bar/__webdriver__/TabBarWebElementBase.js.map +1 -0
- package/oj-c/tab-bar/__webdriver__/index.d.ts +17 -0
- package/oj-c/tab-bar/__webdriver__/index.js +34 -0
- package/oj-c/tab-bar/__webdriver__/index.js.map +1 -0
- package/oj-c/tab-bar/component.json +223 -0
- package/oj-c/tab-bar/index.js +6 -0
- package/oj-c/tab-bar/tab-bar-styles.css +11 -0
- package/oj-c/tab-bar/tab-bar.js +70 -0
- package/oj-c/tab-bar-mixed/DataTabBarMixed.js +1 -1
- package/oj-c/tab-bar-mixed/component.json +11 -2
- package/oj-c/tab-bar-mixed/sumBadge.js +3 -3
- package/oj-c/tab-bar-mixed/tab-bar-mixed.js +1 -1
- package/oj-c/tab-bar-mixed.js +1 -1
- package/oj-c/tab-bar.js +6 -0
- package/oj-c/tag-cloud/component.json +11 -2
- package/oj-c/tag-cloud/tag-cloud.js +3 -9
- package/oj-c/tag-cloud-item/component.json +8 -2
- package/oj-c/tag-cloud-item.js +1 -1
- package/oj-c/tag-cloud.js +1 -1
- package/oj-c/text-area/__webdriver__/TextAreaWebElementBase.d.ts +0 -7
- package/oj-c/text-area/__webdriver__/TextAreaWebElementBase.js +0 -9
- package/oj-c/text-area/__webdriver__/TextAreaWebElementBase.js.map +1 -1
- package/oj-c/text-area/component.json +24 -20
- package/oj-c/text-area/text-area.js +70 -98
- package/oj-c/text-area/useTextAreaAutosizePreact.js +12 -9
- package/oj-c/text-area/useTextAreaPreact.js +12 -9
- package/oj-c/text-area.js +1 -1
- package/oj-c/toggle-button/__webdriver__/ToggleButtonWebElement.d.ts +8 -0
- package/oj-c/toggle-button/__webdriver__/ToggleButtonWebElement.js +13 -0
- package/oj-c/toggle-button/__webdriver__/ToggleButtonWebElement.js.map +1 -0
- package/oj-c/toggle-button/__webdriver__/ToggleButtonWebElementBase.d.ts +72 -0
- package/oj-c/toggle-button/__webdriver__/ToggleButtonWebElementBase.js +95 -0
- package/oj-c/toggle-button/__webdriver__/ToggleButtonWebElementBase.js.map +1 -0
- package/oj-c/toggle-button/__webdriver__/index.d.ts +17 -0
- package/oj-c/toggle-button/__webdriver__/index.js +34 -0
- package/oj-c/toggle-button/__webdriver__/index.js.map +1 -0
- package/oj-c/toggle-button/component.json +229 -0
- package/oj-c/toggle-button/index.js +6 -0
- package/oj-c/toggle-button/toggle-button-styles.css +12 -0
- package/oj-c/toggle-button/toggle-button.js +83 -0
- package/oj-c/toggle-button.js +6 -0
- package/oj-c/types/Dropdown/Dropdown.d.ts +5 -0
- package/oj-c/types/Dropdown/index.d.ts +1 -0
- package/oj-c/types/Sheet/Sheet.d.ts +5 -0
- package/oj-c/types/Sheet/index.d.ts +1 -0
- package/oj-c/types/action-card/action-card.d.ts +12 -4
- package/oj-c/types/area-chart/area-chart.d.ts +12 -4
- package/oj-c/types/button/button.d.ts +5 -3
- package/oj-c/types/buttonset-multiple/buttonset-multiple.d.ts +95 -0
- package/oj-c/types/buttonset-multiple/index.d.ts +2 -0
- package/oj-c/types/buttonset-single/buttonset-single.d.ts +95 -0
- package/oj-c/types/buttonset-single/index.d.ts +2 -0
- package/oj-c/types/card-view/card-view.d.ts +120 -0
- package/oj-c/types/card-view/cardViewItem.d.ts +9 -0
- package/oj-c/types/card-view/index.d.ts +2 -0
- package/oj-c/types/card-view/useCardViewPreact.d.ts +25 -0
- package/oj-c/types/checkbox/checkbox.d.ts +23 -39
- package/oj-c/types/checkbox/useCheckboxPreact.d.ts +3 -3
- package/oj-c/types/checkboxset/checkboxset.d.ts +29 -41
- package/oj-c/types/checkboxset/useCheckboxsetPreact.d.ts +2 -2
- package/oj-c/types/conveyor-belt/conveyor-belt.d.ts +77 -0
- package/oj-c/types/conveyor-belt/conveyorBeltItem.d.ts +24 -0
- package/oj-c/types/conveyor-belt/index.d.ts +2 -0
- package/oj-c/types/date-picker/date-picker.d.ts +113 -0
- package/oj-c/types/date-picker/index.d.ts +2 -0
- package/oj-c/types/drag-handle/drag-handle.d.ts +24 -0
- package/oj-c/types/drag-handle/index.d.ts +2 -0
- package/oj-c/types/drawer-layout/drawer-layout.d.ts +91 -0
- package/oj-c/types/drawer-layout/index.d.ts +2 -0
- package/oj-c/types/drawer-popup/drawer-popup.d.ts +7 -2
- package/oj-c/types/editable-value/UNSAFE_useComponentMessaging/useComponentMessaging.d.ts +3 -3
- package/oj-c/types/editable-value/UNSAFE_useEditableValue/useEditableValue.d.ts +4 -3
- package/oj-c/types/editable-value/UNSAFE_useValidators/useValidators.d.ts +2 -2
- package/oj-c/types/editable-value/UNSAFE_useValue/useValue.d.ts +4 -4
- package/oj-c/types/file-picker/file-picker.d.ts +0 -1
- package/oj-c/types/form-layout/form-layout.d.ts +3 -8
- package/oj-c/types/hooks/PRIVATE_useVisData/useVisData.d.ts +10 -0
- package/oj-c/types/hooks/UNSAFE_useChartData/dataUtil.d.ts +1 -1
- package/oj-c/types/hooks/UNSAFE_useChartData/useChartData.d.ts +1 -0
- package/oj-c/types/hooks/UNSAFE_useEditableValue/converterUtils.d.ts +14 -0
- package/oj-c/types/hooks/UNSAFE_useEditableValue/index.d.ts +2 -0
- package/oj-c/types/hooks/UNSAFE_useEditableValue/reducer.d.ts +106 -0
- package/oj-c/types/hooks/UNSAFE_useEditableValue/types.d.ts +7 -0
- package/oj-c/types/hooks/UNSAFE_useEditableValue/useEditableValue.d.ts +43 -0
- package/oj-c/types/hooks/UNSAFE_useEditableValue/utils.d.ts +8 -0
- package/oj-c/types/hooks/UNSAFE_useEditableValue/validationUtils.d.ts +27 -0
- package/oj-c/types/hooks/UNSAFE_useMergedFormContext/useMergedFormContext.d.ts +16 -0
- package/oj-c/types/hooks/UNSAFE_useVisBusyState/useVisBusyState.d.ts +1 -0
- package/oj-c/types/input-date-mask/input-date-mask.d.ts +3 -3
- package/oj-c/types/input-date-mask/useInputDateMaskPreact.d.ts +6 -5
- package/oj-c/types/input-date-picker/DateRangeValidator.d.ts +31 -0
- package/oj-c/types/input-date-picker/DateRestrictionValidator.d.ts +25 -0
- package/oj-c/types/input-date-picker/index.d.ts +2 -0
- package/oj-c/types/input-date-picker/input-date-picker.d.ts +219 -0
- package/oj-c/types/input-date-picker/useCombinedImplicitValidators.d.ts +2 -0
- package/oj-c/types/input-date-picker/useImplicitCalendarDateConverter.d.ts +7 -0
- package/oj-c/types/input-date-picker/useImplicitDateRangeValidator.d.ts +4 -0
- package/oj-c/types/input-date-picker/useImplicitDateRestrictionValidator.d.ts +6 -0
- package/oj-c/types/input-date-picker/useInputDatePicker.d.ts +45 -0
- package/oj-c/types/input-date-picker/utils.d.ts +3 -0
- package/oj-c/types/input-date-text/input-date-text.d.ts +16 -26
- package/oj-c/types/input-date-text/useInputDateTextPreact.d.ts +3 -5
- package/oj-c/types/input-month-mask/input-month-mask.d.ts +3 -3
- package/oj-c/types/input-month-mask/useInputMonthMaskPreact.d.ts +5 -6
- package/oj-c/types/input-number/input-number.d.ts +15 -25
- package/oj-c/types/input-number/useNumberInputTextPreact.d.ts +3 -3
- package/oj-c/types/input-password/input-password.d.ts +16 -26
- package/oj-c/types/input-password/useInputPasswordPreact.d.ts +3 -3
- package/oj-c/types/input-sensitive-text/input-sensitive-text.d.ts +3 -3
- package/oj-c/types/input-sensitive-text/useInputSensitiveTextPreact.d.ts +3 -3
- package/oj-c/types/input-text/input-text.d.ts +16 -21
- package/oj-c/types/input-text/useInputTextPreact.d.ts +5 -10
- package/oj-c/types/legend/events.d.ts +2 -2
- package/oj-c/types/legend/legend.d.ts +4 -2
- package/oj-c/types/legend/utils.d.ts +5 -3
- package/oj-c/types/legend-item/legend-item.d.ts +6 -1
- package/oj-c/types/line-chart/line-chart.d.ts +9 -1
- package/oj-c/types/list-view/DataFetchLiveRegion.d.ts +5 -0
- package/oj-c/types/list-view/index.d.ts +1 -1
- package/oj-c/types/list-view/list-view.d.ts +60 -3
- package/oj-c/types/list-view/useListViewPreact.d.ts +5 -2
- package/oj-c/types/menu-button/menu-button.d.ts +10 -9
- package/oj-c/types/message-banner/message-banner.d.ts +7 -1
- package/oj-c/types/message-toast/message-toast.d.ts +2 -0
- package/oj-c/types/meter-circle/meter-circle.d.ts +1 -0
- package/oj-c/types/popup/index.d.ts +2 -0
- package/oj-c/types/popup/popup.d.ts +150 -0
- package/oj-c/types/popup/resources/nls/popup-strings.d.ts +8 -0
- package/oj-c/types/radioset/useRadiosetPreact.d.ts +2 -2
- package/oj-c/types/select-common/UNSAFE_useDataProviderListeners/useDataProviderListeners.d.ts +4 -4
- package/oj-c/types/select-common/UNSAFE_useWrapValueState/useWrapValueState.d.ts +5 -5
- package/oj-c/types/select-common/utils/utils.d.ts +2 -0
- package/oj-c/types/select-multiple/select-multiple.d.ts +15 -28
- package/oj-c/types/select-multiple/useSelectMultiplePreact.d.ts +4 -7
- package/oj-c/types/select-multiple/useSyncValueAndValueItems.d.ts +7 -4
- package/oj-c/types/select-single/select-single.d.ts +16 -30
- package/oj-c/types/select-single/useSelectSinglePreact.d.ts +4 -8
- package/oj-c/types/select-single/useSyncValueAndValueItem.d.ts +7 -4
- package/oj-c/types/split-menu-button/split-menu-button.d.ts +6 -8
- package/oj-c/types/tab-bar/ContentRenderer.d.ts +5 -0
- package/oj-c/types/tab-bar/DataTabBar.d.ts +2 -0
- package/oj-c/types/tab-bar/DataTabBar.types.d.ts +32 -0
- package/oj-c/types/tab-bar/DataTabBarIcon.d.ts +10 -0
- package/oj-c/types/tab-bar/index.d.ts +2 -0
- package/oj-c/types/tab-bar/tab-bar.d.ts +125 -0
- package/oj-c/types/tag-cloud/tag-cloud.d.ts +1 -0
- package/oj-c/types/text-area/text-area.d.ts +16 -26
- package/oj-c/types/text-area/useTextAreaAutosizePreact.d.ts +3 -5
- package/oj-c/types/text-area/useTextAreaPreact.d.ts +3 -5
- package/oj-c/types/toggle-button/index.d.ts +2 -0
- package/oj-c/types/toggle-button/toggle-button.d.ts +94 -0
- package/oj-c/types/utils/PRIVATE_ItemsMenu/index.d.ts +1 -1
- package/oj-c/types/utils/PRIVATE_ItemsMenu/items-menu.d.ts +8 -4
- package/oj-c/types/utils/PRIVATE_ItemsMenu/menuTypes.d.ts +20 -1
- package/oj-c/types/utils/PRIVATE_chartUtils/events.d.ts +4 -5
- package/oj-c/types/utils/PRIVATE_chartUtils/lineAreaUtils.d.ts +1 -1
- package/oj-c/types/utils/PRIVATE_chartUtils/plotAreaUtils.d.ts +2 -25
- package/oj-c/types/utils/PRIVATE_toggleUtils/index.d.ts +3 -0
- package/oj-c/types/utils/PRIVATE_toggleUtils/toggle-item-icon.d.ts +6 -0
- package/oj-c/types/utils/PRIVATE_toggleUtils/toggleTypes.d.ts +14 -0
- package/oj-c/types/utils/PRIVATE_toggleUtils/widthStyle.d.ts +11 -0
- package/oj-c/types/utils/UNSAFE_keyUtils/keySetUtils.d.ts +2 -0
- package/oj-c/types/utils/UNSAFE_vizTypes/chartTypes.d.ts +1 -0
- package/oj-c/utils/PRIVATE_ItemsMenu/items-menu.js +7 -5
- package/oj-c/utils/PRIVATE_chartUtils/axisUtils.js +1 -0
- package/oj-c/utils/PRIVATE_toggleUtils/index.js +7 -0
- package/oj-c/utils/PRIVATE_toggleUtils/toggle-item-icon.js +14 -0
- package/oj-c/utils/PRIVATE_toggleUtils/toggleTypes.js +4 -0
- package/oj-c/utils/PRIVATE_toggleUtils/widthStyle.js +19 -0
- package/oj-c/utils/UNSAFE_keyUtils/keySetUtils.js +21 -1
- package/oj-c/utils/UNSAFE_vizUtils/TemplateHandler.js +15 -3
- package/package.json +4 -4
- package/webdriver/docs/assets/navigation.js +1 -1
- package/webdriver/docs/assets/search.js +1 -1
- package/webdriver/docs/classes/ActionCardWebElement.html +1 -1
- package/webdriver/docs/classes/AreaChartWebElement.html +6 -2
- package/webdriver/docs/classes/AvatarWebElement.html +1 -1
- package/webdriver/docs/classes/ButtonWebElement.html +1 -1
- package/webdriver/docs/classes/ButtonsetMultipleWebElement.html +143 -0
- package/webdriver/docs/classes/ButtonsetSingleWebElement.html +143 -0
- package/webdriver/docs/classes/CardViewWebElement.html +150 -0
- package/webdriver/docs/classes/CheckboxWebElement.html +1 -1
- package/webdriver/docs/classes/CheckboxsetWebElement.html +1 -1
- package/webdriver/docs/classes/CollapsibleWebElement.html +2 -2
- package/webdriver/docs/classes/ConveyorBeltWebElement.html +122 -0
- package/webdriver/docs/classes/DatePickerWebElement.html +143 -0
- package/webdriver/docs/classes/DrawerLayoutWebElement.html +139 -0
- package/webdriver/docs/classes/DrawerPopupWebElement.html +1 -1
- package/webdriver/docs/classes/FilePickerWebElement.html +10 -1
- package/webdriver/docs/classes/FormLayoutWebElement.html +1 -1
- package/webdriver/docs/classes/HighlightTextWebElement.html +1 -1
- package/webdriver/docs/classes/InputDateMaskWebElement.html +1 -1
- package/webdriver/docs/classes/InputDatePickerWebElement.html +231 -0
- package/webdriver/docs/classes/InputDateTextWebElement.html +2 -5
- package/webdriver/docs/classes/InputMonthMaskWebElement.html +1 -1
- package/webdriver/docs/classes/InputNumberWebElement.html +2 -5
- package/webdriver/docs/classes/InputPasswordWebElement.html +2 -5
- package/webdriver/docs/classes/InputSensitiveTextWebElement.html +1 -1
- package/webdriver/docs/classes/InputTextWebElement.html +1 -1
- package/webdriver/docs/classes/LabelledLinkWebElement.html +1 -1
- package/webdriver/docs/classes/LegendWebElement.html +1 -1
- package/webdriver/docs/classes/LineChartWebElement.html +6 -2
- package/webdriver/docs/classes/ListItemLayoutWebElement.html +13 -9
- package/webdriver/docs/classes/ListViewWebElement.html +13 -5
- package/webdriver/docs/classes/MenuButtonWebElement.html +1 -1
- package/webdriver/docs/classes/MessageBannerWebElement.html +6 -2
- package/webdriver/docs/classes/MessageToastWebElement.html +1 -1
- package/webdriver/docs/classes/MeterBarWebElement.html +1 -1
- package/webdriver/docs/classes/MeterCircleWebElement.html +1 -1
- package/webdriver/docs/classes/PopupWebElement.html +171 -0
- package/webdriver/docs/classes/ProgressBarWebElement.html +1 -1
- package/webdriver/docs/classes/ProgressCircleWebElement.html +1 -1
- package/webdriver/docs/classes/RadiosetWebElement.html +1 -1
- package/webdriver/docs/classes/RatingGaugeWebElement.html +1 -1
- package/webdriver/docs/classes/SelectMultipleWebElement.html +7 -6
- package/webdriver/docs/classes/SelectSingleWebElement.html +7 -6
- package/webdriver/docs/classes/SelectionCardWebElement.html +1 -1
- package/webdriver/docs/classes/SelectorAllWebElement.html +1 -1
- package/webdriver/docs/classes/SelectorWebElement.html +1 -1
- package/webdriver/docs/classes/SplitMenuButtonWebElement.html +3 -3
- package/webdriver/docs/classes/TabBarMixedWebElement.html +1 -1
- package/webdriver/docs/classes/TabBarWebElement.html +135 -0
- package/webdriver/docs/classes/TagCloudWebElement.html +1 -1
- package/webdriver/docs/classes/TextAreaWebElement.html +2 -5
- package/webdriver/docs/classes/ToggleButtonWebElement.html +139 -0
- package/webdriver/docs/functions/findActionCard.html +1 -1
- package/webdriver/docs/functions/findAreaChart.html +1 -1
- package/webdriver/docs/functions/findAvatar.html +1 -1
- package/webdriver/docs/functions/findButton.html +1 -1
- package/webdriver/docs/functions/findButtonsetMultiple.html +8 -0
- package/webdriver/docs/functions/findButtonsetSingle.html +8 -0
- package/webdriver/docs/functions/findCardView.html +8 -0
- package/webdriver/docs/functions/findCheckbox.html +1 -1
- package/webdriver/docs/functions/findCheckboxset.html +1 -1
- package/webdriver/docs/functions/findCollapsible.html +1 -1
- package/webdriver/docs/functions/findConveyorBelt.html +8 -0
- package/webdriver/docs/functions/findDatePicker.html +8 -0
- package/webdriver/docs/functions/findDrawerLayout.html +8 -0
- package/webdriver/docs/functions/findDrawerPopup.html +1 -1
- package/webdriver/docs/functions/findFilePicker.html +1 -1
- package/webdriver/docs/functions/findFormLayout.html +1 -1
- package/webdriver/docs/functions/findHighlightText.html +1 -1
- package/webdriver/docs/functions/findInputDateMask.html +1 -1
- package/webdriver/docs/functions/findInputDatePicker.html +8 -0
- package/webdriver/docs/functions/findInputDateText.html +1 -1
- package/webdriver/docs/functions/findInputMonthMask.html +1 -1
- package/webdriver/docs/functions/findInputNumber.html +1 -1
- package/webdriver/docs/functions/findInputPassword.html +1 -1
- package/webdriver/docs/functions/findInputSensitiveText.html +1 -1
- package/webdriver/docs/functions/findInputText.html +1 -1
- package/webdriver/docs/functions/findLabelledLink.html +1 -1
- package/webdriver/docs/functions/findLegend.html +1 -1
- package/webdriver/docs/functions/findLineChart.html +1 -1
- package/webdriver/docs/functions/findListItemLayout.html +1 -1
- package/webdriver/docs/functions/findListView.html +1 -1
- package/webdriver/docs/functions/findMenuButton.html +1 -1
- package/webdriver/docs/functions/findMessageBanner.html +1 -1
- package/webdriver/docs/functions/findMessageToast.html +1 -1
- package/webdriver/docs/functions/findMeterBar.html +1 -1
- package/webdriver/docs/functions/findMeterCircle.html +1 -1
- package/webdriver/docs/functions/findPopup.html +8 -0
- package/webdriver/docs/functions/findProgressBar.html +1 -1
- package/webdriver/docs/functions/findProgressCircle.html +1 -1
- package/webdriver/docs/functions/findRadioset.html +1 -1
- package/webdriver/docs/functions/findRatingGauge.html +1 -1
- package/webdriver/docs/functions/findSelectMultiple.html +1 -1
- package/webdriver/docs/functions/findSelectSingle.html +1 -1
- package/webdriver/docs/functions/findSelectionCard.html +1 -1
- package/webdriver/docs/functions/findSelector.html +1 -1
- package/webdriver/docs/functions/findSelectorAll.html +1 -1
- package/webdriver/docs/functions/findSplitMenuButton.html +1 -1
- package/webdriver/docs/functions/findTabBar.html +8 -0
- package/webdriver/docs/functions/findTabBarMixed.html +1 -1
- package/webdriver/docs/functions/findTagCloud.html +1 -1
- package/webdriver/docs/functions/findTextArea.html +1 -1
- package/webdriver/docs/functions/findToggleButton.html +8 -0
- package/webdriver/docs/index.html +1 -1
- package/webdriver/docs/modules.html +21 -1
- package/webdriver/index.d.ts +10 -0
- package/webdriver/index.js +10 -0
- package/webdriver/index.js.map +1 -1
- package/webdriver/index.ts +11 -1
- package/oj-c/docs/action-card.html +0 -249
- package/oj-c/docs/area-chart-group.html +0 -249
- package/oj-c/docs/area-chart-item.html +0 -249
- package/oj-c/docs/area-chart-series.html +0 -249
- package/oj-c/docs/area-chart.html +0 -249
- package/oj-c/docs/avatar.html +0 -249
- package/oj-c/docs/button.html +0 -249
- package/oj-c/docs/checkbox.html +0 -249
- package/oj-c/docs/checkboxset.html +0 -249
- package/oj-c/docs/collapsible.html +0 -249
- package/oj-c/docs/drawer-popup.html +0 -249
- package/oj-c/docs/file-picker.html +0 -249
- package/oj-c/docs/form-layout.html +0 -249
- package/oj-c/docs/highlight-text.html +0 -249
- package/oj-c/docs/index.html +0 -247
- package/oj-c/docs/input-date-mask.html +0 -249
- package/oj-c/docs/input-date-text.html +0 -249
- package/oj-c/docs/input-month-mask.html +0 -249
- package/oj-c/docs/input-number.html +0 -249
- package/oj-c/docs/input-password.html +0 -249
- package/oj-c/docs/input-sensitive-text.html +0 -249
- package/oj-c/docs/input-text.html +0 -249
- package/oj-c/docs/jsDocMd.json +0 -1
- package/oj-c/docs/labelled-link.html +0 -249
- package/oj-c/docs/legend-item.html +0 -249
- package/oj-c/docs/legend-section.html +0 -249
- package/oj-c/docs/legend.html +0 -249
- package/oj-c/docs/line-chart-group.html +0 -249
- package/oj-c/docs/line-chart-item.html +0 -249
- package/oj-c/docs/line-chart-series.html +0 -249
- package/oj-c/docs/line-chart.html +0 -249
- package/oj-c/docs/list-item-layout.html +0 -249
- package/oj-c/docs/list-view.html +0 -249
- package/oj-c/docs/menu-button.html +0 -249
- package/oj-c/docs/message-banner.html +0 -249
- package/oj-c/docs/message-toast.html +0 -249
- package/oj-c/docs/meter-bar.html +0 -249
- package/oj-c/docs/meter-circle.html +0 -249
- package/oj-c/docs/oj-c.ActionCard.html +0 -1045
- package/oj-c/docs/oj-c.AreaChart.html +0 -9396
- package/oj-c/docs/oj-c.AreaChartGroup.html +0 -610
- package/oj-c/docs/oj-c.AreaChartItem.html +0 -1104
- package/oj-c/docs/oj-c.AreaChartSeries.html +0 -1044
- package/oj-c/docs/oj-c.Avatar.html +0 -1907
- package/oj-c/docs/oj-c.Button.html +0 -2301
- package/oj-c/docs/oj-c.Checkbox.html +0 -3493
- package/oj-c/docs/oj-c.Checkboxset.html +0 -4589
- package/oj-c/docs/oj-c.Collapsible.html +0 -2064
- package/oj-c/docs/oj-c.DrawerPopup.html +0 -1631
- package/oj-c/docs/oj-c.FilePicker.html +0 -2664
- package/oj-c/docs/oj-c.FormLayout.html +0 -2159
- package/oj-c/docs/oj-c.HighlightText.html +0 -1078
- package/oj-c/docs/oj-c.InputDateMask.html +0 -5271
- package/oj-c/docs/oj-c.InputDateText.html +0 -5534
- package/oj-c/docs/oj-c.InputMonthMask.html +0 -5940
- package/oj-c/docs/oj-c.InputNumber.html +0 -6369
- package/oj-c/docs/oj-c.InputPassword.html +0 -5261
- package/oj-c/docs/oj-c.InputSensitiveText.html +0 -5723
- package/oj-c/docs/oj-c.InputText.html +0 -6124
- package/oj-c/docs/oj-c.LabelledLink.html +0 -2552
- package/oj-c/docs/oj-c.Legend.html +0 -5146
- package/oj-c/docs/oj-c.LegendItem.html +0 -1493
- package/oj-c/docs/oj-c.LegendSection.html +0 -460
- package/oj-c/docs/oj-c.LineChart.html +0 -9491
- package/oj-c/docs/oj-c.LineChartGroup.html +0 -610
- package/oj-c/docs/oj-c.LineChartItem.html +0 -1104
- package/oj-c/docs/oj-c.LineChartSeries.html +0 -1168
- package/oj-c/docs/oj-c.ListItemLayout.html +0 -1680
- package/oj-c/docs/oj-c.ListView.html +0 -2733
- package/oj-c/docs/oj-c.MenuButton.html +0 -2444
- package/oj-c/docs/oj-c.MessageBanner.html +0 -2107
- package/oj-c/docs/oj-c.MessageToast.html +0 -2254
- package/oj-c/docs/oj-c.MeterBar.html +0 -3308
- package/oj-c/docs/oj-c.MeterCircle.html +0 -3845
- package/oj-c/docs/oj-c.ProgressBar.html +0 -1250
- package/oj-c/docs/oj-c.ProgressCircle.html +0 -1266
- package/oj-c/docs/oj-c.Radioset.html +0 -4585
- package/oj-c/docs/oj-c.RatingGauge.html +0 -2738
- package/oj-c/docs/oj-c.SelectMultiple.html +0 -5381
- package/oj-c/docs/oj-c.SelectSingle.html +0 -5691
- package/oj-c/docs/oj-c.Selector.html +0 -1363
- package/oj-c/docs/oj-c.SelectorAll.html +0 -1128
- package/oj-c/docs/oj-c.SplitMenuButton.html +0 -1990
- package/oj-c/docs/oj-c.TabBarMixed.html +0 -2660
- package/oj-c/docs/oj-c.TagCloud.html +0 -2441
- package/oj-c/docs/oj-c.TagCloudItem.html +0 -794
- package/oj-c/docs/oj-c.TextArea.html +0 -5809
- package/oj-c/docs/progress-bar.html +0 -249
- package/oj-c/docs/progress-circle.html +0 -249
- package/oj-c/docs/radioset.html +0 -249
- package/oj-c/docs/rating-gauge.html +0 -249
- package/oj-c/docs/scripts/deprecated.js +0 -268
- package/oj-c/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/oj-c/docs/scripts/prettify/lang-css.js +0 -9
- package/oj-c/docs/scripts/prettify/prettify.js +0 -35
- package/oj-c/docs/select-multiple.html +0 -249
- package/oj-c/docs/select-single.html +0 -249
- package/oj-c/docs/selection-card.html +0 -249
- package/oj-c/docs/selector-all.html +0 -249
- package/oj-c/docs/selector.html +0 -249
- package/oj-c/docs/split-menu-button.html +0 -249
- package/oj-c/docs/styles/images/bookmark.png +0 -0
- package/oj-c/docs/styles/images/linesarrowup.png +0 -0
- package/oj-c/docs/styles/images/linesarrowup_blue.png +0 -0
- package/oj-c/docs/styles/images/linesarrowup_hov.png +0 -0
- package/oj-c/docs/styles/images/linesarrowup_white.png +0 -0
- package/oj-c/docs/styles/images/oracle_logo_sm.png +0 -0
- package/oj-c/docs/styles/jsdoc-default.css +0 -851
- package/oj-c/docs/styles/prettify-jsdoc.css +0 -111
- package/oj-c/docs/styles/prettify-tomorrow.css +0 -132
- package/oj-c/docs/tab-bar-mixed.html +0 -249
- package/oj-c/docs/tag-cloud-item.html +0 -249
- package/oj-c/docs/tag-cloud.html +0 -249
- package/oj-c/docs/text-area.html +0 -249
- package/oj-c/editable-value/UNSAFE_useConverterObject/useConverterObject.js +0 -42
- package/oj-c/editable-value/UNSAFE_useEditableValueRawValueObject/useEditableValueRawValueObject.js +0 -147
- package/oj-c/editable-value/UNSAFE_useValueRawValueObject/useValueRawValueObject.js +0 -40
- package/oj-c/editable-value/UNSAFE_useValueRawValueObjectLifecycle/useValueRawValueObjectLifecycle.js +0 -27
- package/oj-c/min/editable-value/UNSAFE_useConverterObject/useConverterObject.js +0 -42
- package/oj-c/min/editable-value/UNSAFE_useEditableValueRawValueObject/useEditableValueRawValueObject.js +0 -147
- package/oj-c/min/editable-value/UNSAFE_useValueRawValueObject/useValueRawValueObject.js +0 -40
- package/oj-c/min/editable-value/UNSAFE_useValueRawValueObjectLifecycle/useValueRawValueObjectLifecycle.js +0 -27
- package/oj-c/types/editable-value/UNSAFE_useConverterObject/useConverterObject.d.ts +0 -15
- package/oj-c/types/editable-value/UNSAFE_useEditableValueRawValueObject/useEditableValueRawValueObject.d.ts +0 -49
- package/oj-c/types/editable-value/UNSAFE_useValueRawValueObject/useValueRawValueObject.d.ts +0 -23
- package/oj-c/types/editable-value/UNSAFE_useValueRawValueObjectLifecycle/useValueRawValueObjectLifecycle.d.ts +0 -9
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
define(["require", "exports", "preact/hooks", "./converterUtils", "./utils", "oj-c/editable-value/UNSAFE_useStaleIdentity/useStaleIdentity", "./reducer", "./validationUtils"], function (require, exports, hooks_1, converterUtils_1, utils_1, useStaleIdentity_1, reducer_1, validationUtils_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useEditableValue = void 0;
|
|
5
|
+
const ConverterErrorSymbol = Symbol('ConverterError');
|
|
6
|
+
function useEditableValue({ addBusyState, ariaDescribedBy, converter, defaultDisplayValue, deferredValidators, disabled, displayOptions, messagesCustom, onMessagesCustomChanged, onRawValueChanged, onValidChanged, onValueChanged, readonly, validators, value }) {
|
|
7
|
+
const initialRender = (0, hooks_1.useRef)(true);
|
|
8
|
+
const { setStaleIdentity } = (0, useStaleIdentity_1.useStaleIdentity)();
|
|
9
|
+
const [state, dispatch] = (0, hooks_1.useReducer)((reducer_1.reducer), {
|
|
10
|
+
shownMessages: [],
|
|
11
|
+
hiddenMessages: [],
|
|
12
|
+
customMessages: messagesCustom,
|
|
13
|
+
componentMessages: [],
|
|
14
|
+
value: value,
|
|
15
|
+
valid: 'pending'
|
|
16
|
+
}, (args) => {
|
|
17
|
+
const conversion = converter
|
|
18
|
+
? (0, converterUtils_1.format)(value, defaultDisplayValue, converter)
|
|
19
|
+
: { result: 'success', value: (0, utils_1.treatNull)(value, defaultDisplayValue) };
|
|
20
|
+
return {
|
|
21
|
+
...args,
|
|
22
|
+
displayValue: conversion.result === 'success' ? conversion.value : defaultDisplayValue
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
const _dispatch = (0, hooks_1.useCallback)((updateFn, payload) => {
|
|
26
|
+
updateFn(dispatch, payload, {
|
|
27
|
+
onMessagesCustomChanged,
|
|
28
|
+
onRawValueChanged,
|
|
29
|
+
onValidChanged,
|
|
30
|
+
onValueChanged
|
|
31
|
+
});
|
|
32
|
+
return true;
|
|
33
|
+
}, [dispatch, onMessagesCustomChanged, onRawValueChanged, onValidChanged, onValueChanged]);
|
|
34
|
+
const refreshDisplayValue = (0, hooks_1.useCallback)((value) => {
|
|
35
|
+
let newDisplayValue;
|
|
36
|
+
if (!converter) {
|
|
37
|
+
newDisplayValue = (0, utils_1.treatNull)(value, defaultDisplayValue);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
const conversion = (0, converterUtils_1.format)(value, defaultDisplayValue, converter);
|
|
41
|
+
if (conversion.result === 'failure') {
|
|
42
|
+
_dispatch(reducer_1.updateComponentMessages, [conversion.error]);
|
|
43
|
+
_dispatch(reducer_1.updateValidStatus, 'invalidShown');
|
|
44
|
+
newDisplayValue = (0, utils_1.treatNull)(value, defaultDisplayValue);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
newDisplayValue = conversion.value;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
_dispatch(reducer_1.updateDisplayValue, newDisplayValue);
|
|
51
|
+
return true;
|
|
52
|
+
}, [converter, _dispatch, defaultDisplayValue]);
|
|
53
|
+
const getValueForValidation = (0, hooks_1.useCallback)(() => {
|
|
54
|
+
if (state.valid !== 'invalidShown') {
|
|
55
|
+
return state.value;
|
|
56
|
+
}
|
|
57
|
+
if (!converter) {
|
|
58
|
+
return (0, utils_1.normalizeValue)(state.displayValue);
|
|
59
|
+
}
|
|
60
|
+
const conversion = (0, converterUtils_1.parse)((0, utils_1.normalizeValue)(state.displayValue), converter);
|
|
61
|
+
if (conversion.result === 'failure') {
|
|
62
|
+
_dispatch(reducer_1.updateComponentMessages, [conversion.error]);
|
|
63
|
+
_dispatch(reducer_1.updateValidStatus, 'invalidShown');
|
|
64
|
+
return ConverterErrorSymbol;
|
|
65
|
+
}
|
|
66
|
+
return conversion.value;
|
|
67
|
+
}, [converter, _dispatch, state.displayValue, state.valid, state.value]);
|
|
68
|
+
const normalizeAndParseValue = (0, hooks_1.useCallback)((value) => {
|
|
69
|
+
if (!converter) {
|
|
70
|
+
return (0, utils_1.normalizeValue)(value);
|
|
71
|
+
}
|
|
72
|
+
const conversion = (0, converterUtils_1.parse)((0, utils_1.normalizeValue)(value), converter);
|
|
73
|
+
conversion.result === 'failure' &&
|
|
74
|
+
_dispatch(reducer_1.updateComponentMessages, [conversion.error]) &&
|
|
75
|
+
_dispatch(reducer_1.updateValidStatus, 'invalidShown');
|
|
76
|
+
return conversion.result === 'success' ? conversion.value : ConverterErrorSymbol;
|
|
77
|
+
}, [converter, _dispatch]);
|
|
78
|
+
const fullValidate = (0, hooks_1.useCallback)(async (value, options = {}) => {
|
|
79
|
+
const { doNotClearMessagesCustom = false } = options;
|
|
80
|
+
const hasCustomErrorMessages = doNotClearMessagesCustom && (0, utils_1.hasErrorMessages)(messagesCustom);
|
|
81
|
+
_dispatch(reducer_1.updateValidStatus, 'pending');
|
|
82
|
+
if (doNotClearMessagesCustom) {
|
|
83
|
+
_dispatch(reducer_1.updateComponentMessages, []);
|
|
84
|
+
_dispatch(reducer_1.updateHiddenMessages, []);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
_dispatch(reducer_1.clearAllMessages);
|
|
88
|
+
}
|
|
89
|
+
if ((!validators || validators.length === 0) &&
|
|
90
|
+
(!deferredValidators || deferredValidators.length === 0)) {
|
|
91
|
+
_dispatch(reducer_1.updateValidStatus, hasCustomErrorMessages ? 'invalidShown' : 'valid');
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
const errors = [];
|
|
95
|
+
const deferredValidate = (0, validationUtils_1.validateSync)({ validators: deferredValidators ?? [], value });
|
|
96
|
+
deferredValidate.result === 'failure' && errors.push(...deferredValidate.errors);
|
|
97
|
+
let nonDeferredValidate = undefined;
|
|
98
|
+
if (value !== null && value !== undefined) {
|
|
99
|
+
nonDeferredValidate = (0, validationUtils_1.validateAsync)({ validators: validators ?? [], value });
|
|
100
|
+
}
|
|
101
|
+
errors.push(...(nonDeferredValidate?.errors ?? []));
|
|
102
|
+
const maybeErrorPromises = nonDeferredValidate?.maybeErrorPromises ?? [];
|
|
103
|
+
if (!errors.length && !maybeErrorPromises.length) {
|
|
104
|
+
_dispatch(reducer_1.updateValidStatus, hasCustomErrorMessages ? 'invalidShown' : 'valid');
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
const hasSyncError = errors.length !== 0;
|
|
108
|
+
hasSyncError &&
|
|
109
|
+
_dispatch(reducer_1.updateComponentMessages, errors) &&
|
|
110
|
+
_dispatch(reducer_1.updateValidStatus, 'invalidShown');
|
|
111
|
+
if (!maybeErrorPromises.length) {
|
|
112
|
+
return !hasSyncError;
|
|
113
|
+
}
|
|
114
|
+
const resolver = addBusyState?.('running asynchronous validation');
|
|
115
|
+
const { isStale } = setStaleIdentity('useEditableValue-full-validate');
|
|
116
|
+
let hasAsyncError = false;
|
|
117
|
+
const asyncValidations = [];
|
|
118
|
+
for (const maybeErrorPromise of maybeErrorPromises) {
|
|
119
|
+
const asyncValidation = maybeErrorPromise.then((maybeValidationError) => {
|
|
120
|
+
if (maybeValidationError && !isStale()) {
|
|
121
|
+
_dispatch(reducer_1.addComponentMessage, maybeValidationError);
|
|
122
|
+
_dispatch(reducer_1.updateValidStatus, 'invalidShown');
|
|
123
|
+
hasAsyncError = true;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
asyncValidations.push(asyncValidation);
|
|
127
|
+
}
|
|
128
|
+
await Promise.all(asyncValidations);
|
|
129
|
+
if (!hasSyncError && !hasAsyncError && !isStale()) {
|
|
130
|
+
_dispatch(reducer_1.updateValidStatus, hasCustomErrorMessages ? 'invalidShown' : 'valid');
|
|
131
|
+
}
|
|
132
|
+
resolver?.();
|
|
133
|
+
return !hasSyncError && !hasAsyncError;
|
|
134
|
+
}, [addBusyState, _dispatch, deferredValidators, messagesCustom, setStaleIdentity, validators]);
|
|
135
|
+
const runFullValidationAndUpdateValue = async () => {
|
|
136
|
+
if (disabled || readonly)
|
|
137
|
+
return;
|
|
138
|
+
const parsedValueOrSymbol = getValueForValidation();
|
|
139
|
+
if (parsedValueOrSymbol === ConverterErrorSymbol)
|
|
140
|
+
return;
|
|
141
|
+
const newValue = parsedValueOrSymbol;
|
|
142
|
+
const validated = await validateValueOnInternalChange(newValue, {
|
|
143
|
+
doNotClearMessagesCustom: true
|
|
144
|
+
});
|
|
145
|
+
validated && _dispatch(reducer_1.updateValue, newValue) && refreshDisplayValue(newValue);
|
|
146
|
+
};
|
|
147
|
+
const validateValueOnInternalChange = (0, hooks_1.useCallback)(async (value, options = {}) => {
|
|
148
|
+
const { isStale } = setStaleIdentity('useEditableValue-validateValueOnInternalChange');
|
|
149
|
+
const resolver = addBusyState?.('Running validateValueOnInternalChange');
|
|
150
|
+
const validationResult = await fullValidate(value, options);
|
|
151
|
+
resolver?.();
|
|
152
|
+
if (isStale()) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
return validationResult;
|
|
156
|
+
}, [addBusyState, fullValidate, setStaleIdentity]);
|
|
157
|
+
const onCommit = (0, hooks_1.useCallback)(async ({ value }) => {
|
|
158
|
+
const parsedValueOrSymbol = normalizeAndParseValue(value);
|
|
159
|
+
if (parsedValueOrSymbol === ConverterErrorSymbol) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const parsedValue = parsedValueOrSymbol;
|
|
163
|
+
const validated = await validateValueOnInternalChange(parsedValue);
|
|
164
|
+
validated && _dispatch(reducer_1.updateValue, parsedValue) && refreshDisplayValue(parsedValue);
|
|
165
|
+
}, [_dispatch, normalizeAndParseValue, refreshDisplayValue, validateValueOnInternalChange]);
|
|
166
|
+
const onInput = (0, hooks_1.useCallback)(({ value }) => {
|
|
167
|
+
_dispatch(reducer_1.updateDisplayValue, value ?? defaultDisplayValue);
|
|
168
|
+
}, [_dispatch, defaultDisplayValue]);
|
|
169
|
+
const validate = (0, hooks_1.useCallback)(async () => {
|
|
170
|
+
if (readonly || disabled) {
|
|
171
|
+
return 'valid';
|
|
172
|
+
}
|
|
173
|
+
const newValueOrSymbol = normalizeAndParseValue(state.displayValue);
|
|
174
|
+
if (newValueOrSymbol === ConverterErrorSymbol) {
|
|
175
|
+
return 'invalid';
|
|
176
|
+
}
|
|
177
|
+
const newValue = newValueOrSymbol;
|
|
178
|
+
const resolver = addBusyState?.('Running component method validate');
|
|
179
|
+
const validated = await fullValidate(newValue);
|
|
180
|
+
resolver?.();
|
|
181
|
+
if (validated) {
|
|
182
|
+
if (newValue !== state.value) {
|
|
183
|
+
_dispatch(reducer_1.updateValue, newValue);
|
|
184
|
+
refreshDisplayValue(newValue);
|
|
185
|
+
}
|
|
186
|
+
return 'valid';
|
|
187
|
+
}
|
|
188
|
+
return 'invalid';
|
|
189
|
+
}, [
|
|
190
|
+
addBusyState,
|
|
191
|
+
disabled,
|
|
192
|
+
_dispatch,
|
|
193
|
+
fullValidate,
|
|
194
|
+
normalizeAndParseValue,
|
|
195
|
+
readonly,
|
|
196
|
+
refreshDisplayValue,
|
|
197
|
+
state.displayValue,
|
|
198
|
+
state.value
|
|
199
|
+
]);
|
|
200
|
+
const reset = (0, hooks_1.useCallback)(() => {
|
|
201
|
+
_dispatch(reducer_1.clearAllMessages);
|
|
202
|
+
const valueToValidate = state.value;
|
|
203
|
+
const validated = (0, validationUtils_1.validateSync)({
|
|
204
|
+
validators: deferredValidators ?? [],
|
|
205
|
+
value: valueToValidate
|
|
206
|
+
});
|
|
207
|
+
validated.result === 'failure' && _dispatch(reducer_1.updateHiddenMessages, validated.errors);
|
|
208
|
+
_dispatch(reducer_1.updateValidStatus, validated.result === 'failure' ? 'invalidHidden' : 'valid');
|
|
209
|
+
refreshDisplayValue(state.value);
|
|
210
|
+
}, [deferredValidators, _dispatch, refreshDisplayValue, state.value]);
|
|
211
|
+
const showMessages = (0, hooks_1.useCallback)(() => {
|
|
212
|
+
if (state.hiddenMessages && state.hiddenMessages.length > 0) {
|
|
213
|
+
_dispatch(reducer_1.showHiddenMessages);
|
|
214
|
+
_dispatch(reducer_1.updateValidStatus, 'invalidShown');
|
|
215
|
+
}
|
|
216
|
+
}, [_dispatch, state.hiddenMessages]);
|
|
217
|
+
if (!initialRender.current && state.previousValue !== value) {
|
|
218
|
+
_dispatch(reducer_1.updatePreviousValue, value);
|
|
219
|
+
if (value !== state.value) {
|
|
220
|
+
_dispatch(reducer_1.clearAllMessages);
|
|
221
|
+
const validated = (0, validationUtils_1.validateSync)({ validators: deferredValidators ?? [], value });
|
|
222
|
+
validated.result === 'success' && _dispatch(reducer_1.updateValidStatus, 'valid');
|
|
223
|
+
validated.result === 'failure' &&
|
|
224
|
+
_dispatch(reducer_1.updateValidStatus, 'invalidHidden') &&
|
|
225
|
+
_dispatch(reducer_1.updateHiddenMessages, validated.errors);
|
|
226
|
+
_dispatch(reducer_1.updateValue, value);
|
|
227
|
+
refreshDisplayValue(value);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
if (!initialRender.current && state.previousConverter !== converter) {
|
|
231
|
+
_dispatch(reducer_1.updatePreviousConverter, converter);
|
|
232
|
+
state.valid !== 'invalidShown' && refreshDisplayValue(value);
|
|
233
|
+
state.valid === 'invalidShown' && runFullValidationAndUpdateValue();
|
|
234
|
+
}
|
|
235
|
+
if (!initialRender.current && state.previousValidators !== validators) {
|
|
236
|
+
_dispatch(reducer_1.updatePreviousValidators, validators);
|
|
237
|
+
state.valid === 'invalidShown' && runFullValidationAndUpdateValue();
|
|
238
|
+
}
|
|
239
|
+
if (!initialRender.current &&
|
|
240
|
+
((!state.customMessages && messagesCustom) ||
|
|
241
|
+
(state.customMessages && !messagesCustom) ||
|
|
242
|
+
(state.customMessages &&
|
|
243
|
+
messagesCustom &&
|
|
244
|
+
!(0, utils_1.isShallowEqual)(state.customMessages, messagesCustom)))) {
|
|
245
|
+
const compMsgs = state.componentMessages ?? [];
|
|
246
|
+
const hiddenMsgs = state.hiddenMessages ?? [];
|
|
247
|
+
const customMsgs = messagesCustom ?? [];
|
|
248
|
+
const hasErrors = (0, utils_1.hasErrorMessages)(customMsgs);
|
|
249
|
+
const hasHiddenMessages = hiddenMsgs.length > 0;
|
|
250
|
+
const hasNoMessages = compMsgs.length === 0 && hiddenMsgs.length === 0 && customMsgs.length === 0;
|
|
251
|
+
_dispatch(reducer_1.updateCustomMessages, customMsgs);
|
|
252
|
+
hasErrors && _dispatch(reducer_1.updateValidStatus, 'invalidShown');
|
|
253
|
+
!hasErrors &&
|
|
254
|
+
state.valid !== 'pending' &&
|
|
255
|
+
((hasNoMessages && _dispatch(reducer_1.updateValidStatus, 'valid')) ||
|
|
256
|
+
(hasHiddenMessages && _dispatch(reducer_1.updateValidStatus, 'invalidHidden')));
|
|
257
|
+
}
|
|
258
|
+
if (!initialRender.current &&
|
|
259
|
+
(state.previousDeferredValidators !== deferredValidators ||
|
|
260
|
+
state.previousDisabled !== disabled ||
|
|
261
|
+
state.previousReadonly !== readonly)) {
|
|
262
|
+
const isRequiredToggledToFalse = deferredValidators?.length === 0;
|
|
263
|
+
state.previousDeferredValidators !== deferredValidators &&
|
|
264
|
+
_dispatch(reducer_1.updatePreviousDeferredValidators, deferredValidators);
|
|
265
|
+
state.previousDisabled !== disabled && _dispatch(reducer_1.updatePreviousDisabled, disabled);
|
|
266
|
+
state.previousReadonly !== readonly && _dispatch(reducer_1.updatePreviousReadonly, readonly);
|
|
267
|
+
if (isRequiredToggledToFalse || (!readonly && !disabled)) {
|
|
268
|
+
switch (state.valid) {
|
|
269
|
+
case 'valid':
|
|
270
|
+
const newValue = getValueForValidation();
|
|
271
|
+
if (newValue !== ConverterErrorSymbol) {
|
|
272
|
+
const deferredValidate = (0, validationUtils_1.validateSync)({
|
|
273
|
+
validators: deferredValidators ?? [],
|
|
274
|
+
value: newValue
|
|
275
|
+
});
|
|
276
|
+
deferredValidate.result === 'failure' &&
|
|
277
|
+
_dispatch(reducer_1.updateHiddenMessages, deferredValidate.errors) &&
|
|
278
|
+
_dispatch(reducer_1.updateValidStatus, 'invalidHidden');
|
|
279
|
+
}
|
|
280
|
+
break;
|
|
281
|
+
case 'invalidHidden':
|
|
282
|
+
if (deferredValidators?.length === 0) {
|
|
283
|
+
_dispatch(reducer_1.updateValidStatus, 'valid');
|
|
284
|
+
_dispatch(reducer_1.updateHiddenMessages, []);
|
|
285
|
+
}
|
|
286
|
+
break;
|
|
287
|
+
case 'invalidShown':
|
|
288
|
+
runFullValidationAndUpdateValue();
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
if (initialRender.current) {
|
|
294
|
+
initialRender.current = false;
|
|
295
|
+
}
|
|
296
|
+
(0, hooks_1.useEffect)(() => {
|
|
297
|
+
_dispatch(reducer_1.updatePreviousValue, value);
|
|
298
|
+
_dispatch(reducer_1.updatePreviousConverter, converter);
|
|
299
|
+
_dispatch(reducer_1.updatePreviousValidators, validators);
|
|
300
|
+
_dispatch(reducer_1.updatePreviousDeferredValidators, deferredValidators);
|
|
301
|
+
_dispatch(reducer_1.updatePreviousDisabled, disabled);
|
|
302
|
+
_dispatch(reducer_1.updatePreviousReadonly, readonly);
|
|
303
|
+
_dispatch(reducer_1.updateCustomMessages, messagesCustom);
|
|
304
|
+
if (!disabled && !readonly) {
|
|
305
|
+
const validated = (0, validationUtils_1.validateSync)({ validators: deferredValidators ?? [], value });
|
|
306
|
+
validated.result === 'failure' &&
|
|
307
|
+
_dispatch(reducer_1.updateHiddenMessages, validated.errors) &&
|
|
308
|
+
_dispatch(reducer_1.updateValidStatus, 'invalidHidden');
|
|
309
|
+
validated.result === 'success' &&
|
|
310
|
+
_dispatch(reducer_1.updateValidStatus, (0, utils_1.hasErrorMessages)(messagesCustom) ? 'invalidShown' : 'valid') &&
|
|
311
|
+
refreshDisplayValue(value);
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
_dispatch(reducer_1.updateValidStatus, 'valid');
|
|
315
|
+
refreshDisplayValue(value);
|
|
316
|
+
}
|
|
317
|
+
}, []);
|
|
318
|
+
return {
|
|
319
|
+
value: state.value,
|
|
320
|
+
displayValue: state.displayValue,
|
|
321
|
+
methods: {
|
|
322
|
+
reset,
|
|
323
|
+
showMessages,
|
|
324
|
+
validate
|
|
325
|
+
},
|
|
326
|
+
textFieldProps: {
|
|
327
|
+
'aria-describedby': ariaDescribedBy,
|
|
328
|
+
messages: displayOptions?.messages !== 'none' ? state.shownMessages : undefined,
|
|
329
|
+
onCommit,
|
|
330
|
+
onInput,
|
|
331
|
+
value: state.displayValue
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
exports.useEditableValue = useEditableValue;
|
|
336
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
define(["require", "exports"], function (require, exports) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.treatNull = exports.normalizeValue = exports.isShallowEqual = exports.hasErrorMessages = exports.createMessageFromError = void 0;
|
|
5
|
+
const createMessageFromError = (error) => {
|
|
6
|
+
if (typeof error.getMessage === 'function') {
|
|
7
|
+
return {
|
|
8
|
+
severity: 'error',
|
|
9
|
+
detail: error.getMessage().detail
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
return { severity: 'error', detail: error.message };
|
|
13
|
+
};
|
|
14
|
+
exports.createMessageFromError = createMessageFromError;
|
|
15
|
+
const treatNull = (value, defaultValue) => {
|
|
16
|
+
if (value === null) {
|
|
17
|
+
return defaultValue;
|
|
18
|
+
}
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
exports.treatNull = treatNull;
|
|
22
|
+
const normalizeValue = (value) => {
|
|
23
|
+
if (typeof value === 'string' && value === '') {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
};
|
|
28
|
+
exports.normalizeValue = normalizeValue;
|
|
29
|
+
const isShallowEqual = (a, b) => a === b || (a.length === b.length && a.every((v, i) => v === b[i]));
|
|
30
|
+
exports.isShallowEqual = isShallowEqual;
|
|
31
|
+
const hasErrorMessages = (messages) => {
|
|
32
|
+
return !!messages && messages.some((message) => message.severity === 'error');
|
|
33
|
+
};
|
|
34
|
+
exports.hasErrorMessages = hasErrorMessages;
|
|
35
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
define(["require", "exports", "./utils"], function (require, exports, utils_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.validateSync = exports.validateAsync = void 0;
|
|
5
|
+
function validateSync({ validators, value }) {
|
|
6
|
+
const errors = [];
|
|
7
|
+
for (const validator of validators) {
|
|
8
|
+
try {
|
|
9
|
+
validator.validate(value);
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
errors.push((0, utils_1.createMessageFromError)(error));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if (errors.length) {
|
|
16
|
+
return { result: 'failure', errors };
|
|
17
|
+
}
|
|
18
|
+
return { result: 'success' };
|
|
19
|
+
}
|
|
20
|
+
exports.validateSync = validateSync;
|
|
21
|
+
function validateAsync({ validators, value }) {
|
|
22
|
+
const doValidate = (validator, value) => {
|
|
23
|
+
try {
|
|
24
|
+
const validateResult = validator.validate(value);
|
|
25
|
+
if (validateResult instanceof Promise) {
|
|
26
|
+
return validateResult.then(() => { }, (error) => (0, utils_1.createMessageFromError)(error));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
return (0, utils_1.createMessageFromError)(error);
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
33
|
+
};
|
|
34
|
+
const errors = [];
|
|
35
|
+
const maybeErrorPromises = [];
|
|
36
|
+
for (const validator of validators) {
|
|
37
|
+
const maybeComponentMessageItem = doValidate(validator, value);
|
|
38
|
+
if (maybeComponentMessageItem !== undefined) {
|
|
39
|
+
if (maybeComponentMessageItem instanceof Promise) {
|
|
40
|
+
maybeErrorPromises.push(maybeComponentMessageItem);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
errors.push(maybeComponentMessageItem);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
errors,
|
|
49
|
+
maybeErrorPromises
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
exports.validateAsync = validateAsync;
|
|
53
|
+
});
|
|
@@ -82,6 +82,9 @@ define(["require", "exports", "ojs/ojdataproviderfactory", "preact/hooks"], func
|
|
|
82
82
|
iteratorRef.current = iterator;
|
|
83
83
|
try {
|
|
84
84
|
const result = await iterator.next();
|
|
85
|
+
if (iterator !== iteratorRef.current) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
85
88
|
const fetchParameters = result.value.fetchParameters;
|
|
86
89
|
if (fetchParameters.signal && fetchParameters.signal.aborted) {
|
|
87
90
|
return;
|
|
@@ -129,7 +132,7 @@ define(["require", "exports", "ojs/ojdataproviderfactory", "preact/hooks"], func
|
|
|
129
132
|
isDoneRef.current = value.done;
|
|
130
133
|
}
|
|
131
134
|
const total = value.total;
|
|
132
|
-
if (total > 0) {
|
|
135
|
+
if (total > 0 || (total === 0 && isDoneRef.current)) {
|
|
133
136
|
totalSizeRef.current = total;
|
|
134
137
|
fetchRange({
|
|
135
138
|
offset: range.offset,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
define(["require", "exports", "@oracle/oraclejet-preact/hooks/UNSAFE_useFormContext"], function (require, exports, UNSAFE_useFormContext_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useMergedFormContext = void 0;
|
|
5
|
+
function useMergedFormContext({ propContainerReadonly, propLabelWrapping, propReadonly, propUserAssistanceDensity }) {
|
|
6
|
+
const formContext = (0, UNSAFE_useFormContext_1.useFormContext)();
|
|
7
|
+
const uadValue = propUserAssistanceDensity ?? formContext.userAssistanceDensity;
|
|
8
|
+
const readonlyValue = propReadonly ?? formContext.isReadonly;
|
|
9
|
+
const { isFormLayout: formContextIsFormLayout, isReadonly: formContextIsReadonly, labelWrapping: formContextLabelWrapping, ...otherFormContextProps } = formContext;
|
|
10
|
+
const containerProps = {
|
|
11
|
+
...otherFormContextProps,
|
|
12
|
+
isFormLayout: propContainerReadonly !== undefined || formContextIsFormLayout,
|
|
13
|
+
isReadonly: propContainerReadonly ?? formContextIsReadonly,
|
|
14
|
+
labelWrapping: propLabelWrapping ?? formContextLabelWrapping
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
containerProps,
|
|
18
|
+
readonlyValue,
|
|
19
|
+
uadValue
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
exports.useMergedFormContext = useMergedFormContext;
|
|
23
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
define(["require", "exports", "preact/hooks", "ojs/ojcontext"], function (require, exports, hooks_1, Context) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useVisBusyState = void 0;
|
|
5
|
+
function useVisBusyState(rootRef, baseDescription) {
|
|
6
|
+
const addBusyState = (0, hooks_1.useCallback)(() => {
|
|
7
|
+
if (rootRef.current) {
|
|
8
|
+
const busyContext = Context.getContext(rootRef.current).getBusyContext();
|
|
9
|
+
return busyContext.addBusyState({ description: baseDescription });
|
|
10
|
+
}
|
|
11
|
+
return () => { };
|
|
12
|
+
}, [baseDescription, rootRef]);
|
|
13
|
+
return addBusyState;
|
|
14
|
+
}
|
|
15
|
+
exports.useVisBusyState = useVisBusyState;
|
|
16
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define("oj-c/editable-value/UNSAFE_useAssistiveText/useAssistiveText",["require","exports","preact/hooks"],(function(require,e,t){"use strict";function a(e,t,a,s,r,n){const o="compact"!==n?a?.definition:void 0;return e?.instruction||("none"===r?.validatorHint?void 0:t)||o||("none"===r?.converterHint?void 0:s)}function s(e){if(!e.length)return;return e.map((e=>"function"==typeof e.getHint?e.getHint():void 0)).filter(Boolean).join("\n")}Object.defineProperty(e,"__esModule",{value:!0}),e.useAssistiveText=void 0,e.useAssistiveText=function({addBusyState:e,converter:r,displayOptions:n,help:o,helpHints:l,userAssistanceDensity:i,validators:u}){const[d,c]=(0,t.useState)(u&&u.length?s(u):void 0),p=(0,t.useRef)();(0,t.useEffect)((()=>{if(!u||!u.length)return void c(void 0);c(s(u));const t=u.map((e=>e.hint)).filter(Boolean),a=p.current=Symbol(),r=e?.("resolving the async validator hints");Promise.allSettled(t).then((e=>{c((t=>{const s=e.map((e=>"fulfilled"===e.status?e.value:void 0)).filter(Boolean);return a===p.current&&s.length?[t,...s].join("\n"):t})),r?.()}))}),[u]);const g="compact"!==i?l?.sourceText:l?.definition||l?.sourceText;return{assistiveText:a(o,d,l,r?.getHint?.()??void 0,n,i),helpSourceLink:l?.source,helpSourceText:g}}})),define("oj-c/editable-value/utils/utils",["require","exports"],(function(require,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isShallowEqual=e.normalizeValue=e.treatNull=e.createMessageFromError=void 0,e.createMessageFromError=function(e){return"function"==typeof e.getMessage?{severity:"error",detail:e.getMessage().detail}:{severity:"error",detail:e.message}},e.treatNull=function(e,t){return null===e?t:e},e.normalizeValue=function(e){return"string"==typeof e&&""===e?null:e};e.isShallowEqual=(e,t)=>e===t||e.length===t.length&&e.every(((e,a)=>e===t[a]))})),define("oj-c/editable-value/UNSAFE_useComponentMessaging/useComponentMessaging",["require","exports","@oracle/oraclejet-preact/hooks/UNSAFE_useUncontrolledState","preact/hooks","../utils/utils"],(function(require,e,t,a,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useComponentMessaging=void 0,e.useComponentMessaging=function({messagesCustom:e=[],onMessagesCustomChanged:r}){const[n,o]=(0,t.useUncontrolledState)(e,r),[l,i]=(0,a.useState)([]),[u,d]=(0,a.useState)([]),c=(0,a.useRef)(e),p=(0,a.useCallback)(((...e)=>{i((t=>[...t,...e]))}),[]),g=(0,a.useCallback)((e=>{i((t=>[...t,e]))}),[]),v=(0,a.useCallback)((()=>{i([]),d([])}),[]),f=(0,a.useCallback)((()=>{d([])}),[]),m=(0,a.useCallback)((()=>{i([]),d([]),o([])}),[]),V=(0,a.useCallback)((()=>n.some((e=>"error"===e.severity))),[n]),y=(0,a.useCallback)((()=>0===l.length&&0===u.length&&!1===V()),[l,u,V]),b=(0,a.useCallback)((()=>0!==u.length),[u]),C=(0,a.useCallback)((()=>{i((e=>[...e,...u])),d([])}),[u]);return(0,a.useEffect)((()=>{c.current!==e&&(c.current=e,(0,s.isShallowEqual)(n,e)||o(e))}),[n,e]),(0,a.useMemo)((()=>({componentMessages:l,deferredComponentMessages:u,messagesCustom:n,visibleMessages:[...n,...l],addComponentMessage:p,addDeferredComponentMessage:g,clearAllComponentMessages:v,clearAllMessages:m,clearDeferredComponentMessages:f,hasCustomErrorMessages:V,hasHiddenMessages:b,hasNoErrorMessages:y,setComponentMessages:i,setDeferredComponentMessages:d,showHiddenMessages:C})),[l,u,n,V,b,y,C])}})),define("oj-c/editable-value/UNSAFE_useDeferredValidators/useDeferredValidators",["require","exports","ojs/ojvalidator-required","preact/hooks","@oracle/oraclejet-preact/hooks/UNSAFE_useTranslationBundle"],(function(require,e,t,a,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useDeferredValidators=void 0,e.useDeferredValidators=function({labelHint:e,required:r,requiredMessageDetail:n}){const o=(0,s.useTranslationBundle)("@oracle/oraclejet-preact"),l=n||o.formControl_requiredMessageDetail(),i=(0,a.useMemo)((()=>r?new t({label:e,messageDetail:l}):null),[r]);return(0,a.useMemo)((()=>[i].filter(Boolean)),[i])}})),define("oj-c/editable-value/UNSAFE_useConverter/useConverter",["require","exports","ojs/ojconverter-nativenumber","preact/hooks","@oracle/oraclejet-preact/hooks/UNSAFE_useTranslationBundle","../utils/utils"],(function(require,e,t,a,s,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useConverter=e.ConverterErrorSymbol=void 0,e.ConverterErrorSymbol=Symbol("ConverterError"),e.useConverter=function({componentMessagingState:n,validationState:o,converter:l}){const i=(0,s.useTranslationBundle)("@oracle/oraclejet-preact").inputNumber_converterParseError(),u=(0,a.useCallback)((a=>{if(!l||(""===(s=a)||null===s))return a;var s;try{return l.parse(a)}catch(a){const s=a?.cause===t.USER_INPUT_ERROR?{severity:"error",detail:i}:(0,r.createMessageFromError)(a);return n.setComponentMessages([s]),o.setValid("invalidShown"),e.ConverterErrorSymbol}}),[l,n,o]),d=(0,a.useCallback)(((e,t=!1)=>{if(!l||function(e){return null===e}(e))return(0,r.treatNull)(e,"")??"";try{return l.format(e)}catch(a){return t||(n.setComponentMessages([(0,r.createMessageFromError)(a)]),o.setValid("invalidShown")),(0,r.treatNull)(e,"")}}),[l,n,o]);return(0,a.useMemo)((()=>({format:d,parse:u})),[d,u])}})),define("oj-c/editable-value/UNSAFE_useStaleIdentity/useStaleIdentity",["require","exports","preact/hooks"],(function(require,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useStaleIdentity=void 0,e.useStaleIdentity=function(){const e=(0,t.useRef)(new Map);return{setStaleIdentity:(0,t.useCallback)((t=>{const a=Symbol();return e.current.set(t,a),{isStale:()=>a!==e.current.get(t)}}),[])}}})),define("oj-c/editable-value/UNSAFE_useValidators/useValidators",["require","exports","@oracle/oraclejet-preact/hooks/UNSAFE_useUncontrolledState","preact/hooks","../UNSAFE_useStaleIdentity/useStaleIdentity","../utils/utils"],(function(require,e,t,a,s,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useValidators=e.ValidationResult=void 0,e.ValidationResult={VALID:"VALID",INVALID:"INVALID",STALE:"STALE"},e.useValidators=function({componentMessagingState:n,defaultValidState:o,deferredValidators:l=[],validators:i=[],addBusyState:u,onValidChanged:d}){const[c,p]=(0,t.useUncontrolledState)(o,d),{setStaleIdentity:g}=(0,s.useStaleIdentity)();(0,a.useLayoutEffect)((()=>{void 0!==o&&d?.(o)}),[]);const{addComponentMessage:v,clearAllComponentMessages:f,clearAllMessages:m,hasCustomErrorMessages:V,setComponentMessages:y}=n,b=(0,a.useCallback)((async(e,t={})=>{const{doNotClearMessagesCustom:a=!1}=t,s=V();if(p("pending"),a?f():m(),0===i.length&&0===l.length)return p(s&&a?"invalidShown":"valid"),!0;function n(e,t){try{const a=e.validate(t);if(a instanceof Promise)return a.then((()=>{}),(e=>(0,r.createMessageFromError)(e)))}catch(e){return(0,r.createMessageFromError)(e)}}const o=[],d=[],c=C(e);if(void 0!==c&&o.push(...c),null!=e)for(const t of i){const a=n(t,e);void 0!==a&&(a instanceof Promise?d.push(a):o.push(a))}if(!o.length&&!d.length)return p(s&&a?"invalidShown":"valid"),!0;const b=0!==o.length;if(b&&(y(o),p("invalidShown")),!d.length)return!b;const h=u?.("running validation"),{isStale:S}=g("useValidators-validate");let M=!1;for(const e of d){const t=await e;t&&!S()&&(v(t),p("invalidShown"),M=!0)}return b||M||S()||p(s&&a?"invalidShown":"valid"),h?.(),!b&&!M}),[v,f,m,l,i]),C=(0,a.useCallback)((e=>{const t=[];for(const a of l)try{a.validate(e)}catch(e){t.push((0,r.createMessageFromError)(e))}if(t.length)return t}),[l]),h=(0,a.useCallback)((async(t,a={})=>{const{isStale:s}=g("useValidationLifeCycle-validateValueOnInternalChange"),r=u?.("running validateValueOnInternalChange"),n=await b(t,a);return r?.(),s()?e.ValidationResult.STALE:n?e.ValidationResult.VALID:e.ValidationResult.INVALID}),[u,b]),S=(0,a.useCallback)((t=>{const{clearAllMessages:a,setDeferredComponentMessages:s}=n;a();const r=C(t);return r?(s(r),p("invalidHidden")):p("valid"),e.ValidationResult.VALID}),[n,C]);return(0,a.useMemo)((()=>({valid:c,setValid:p,deferredValidate:C,fullValidate:b,validateValueOnExternalChange:S,validateValueOnInternalChange:h})),[c,C,b,S,h])}})),define("oj-c/editable-value/UNSAFE_useValidationLifecycle/useValidationLifecycle",["require","exports","preact/hooks","../UNSAFE_useConverter/useConverter","../UNSAFE_useValidators/useValidators","../utils/utils"],(function(require,e,t,a,s,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useValidationLifecycle=void 0,e.useValidationLifecycle=function({componentMessagingState:e,disabled:n,deferredValidators:o,readonly:l,validationState:i,validators:u,getValueForValidation:d,setValueAfterValidation:c}){const p=(0,t.useRef)(o),g=(0,t.useRef)(u),v=(0,t.useRef)(e.messagesCustom),f=(0,t.useRef)(l),m=(0,t.useRef)(n),V=(0,t.useRef)(!0),y=(0,t.useCallback)((async()=>{if(l||n)return;const{valid:e,validateValueOnInternalChange:t}=i,r=d(e);if(r===a.ConverterErrorSymbol)return;await t(r,{doNotClearMessagesCustom:!0})===s.ValidationResult.VALID&&c(r)}),[n,l,i,d,c]);return(0,t.useEffect)((()=>{if(!V.current)return;if(V.current=!1,l||n)return;const t=d("valid");if(t===a.ConverterErrorSymbol)return;const{deferredValidate:s,setValid:r}=i,{hasCustomErrorMessages:o,setDeferredComponentMessages:u}=e,c=s(t);c&&(u(c),r("invalidHidden")),o()&&r("invalidShown")}),[n,l]),(0,t.useEffect)((()=>{const t=p.current!==o&&0===o.length;if(p.current===o&&f.current===l&&m.current===n)return;f.current=l,m.current=n,p.current=o;if(!(t||!l&&!n))return;const{valid:s,deferredValidate:r,setValid:u}=i,{clearDeferredComponentMessages:c,setDeferredComponentMessages:g}=e;switch(s){case"valid":const e=d(s);if(e!==a.ConverterErrorSymbol){const t=r(e);t&&(g(t),u("invalidHidden"))}break;case"invalidHidden":0===o.length&&(u("valid"),c());break;case"invalidShown":y()}}),[n,l,o,e,i,d,y]),(0,t.useEffect)((()=>{if(g.current!==u&&(g.current=u,!l&&!n&&"invalidShown"===i.valid))y()}),[n,l,u,i]),(0,t.useEffect)((()=>{if((0,r.isShallowEqual)(v.current,e.messagesCustom))return;const{messagesCustom:t,hasCustomErrorMessages:a,hasHiddenMessages:s,hasNoErrorMessages:n}=e,{valid:o,setValid:l}=i;if(v.current=t,a())l("invalidShown");else{if("pending"===o)return;n()?l("valid"):s()&&l("invalidHidden")}}),[e,i]),{runFullValidationAndUpdateValue:y}}})),define("oj-c/editable-value/UNSAFE_useValueRawValueObject/useValueRawValueObject",["require","exports","@oracle/oraclejet-preact/hooks/UNSAFE_useUncontrolledState","preact/hooks"],(function(require,e,t,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useValueRawValueObject=void 0,e.useValueRawValueObject=function({value:e,format:s,parse:r,onRawValueChanged:n,onTransientValueChanged:o,onValueChanged:l}){const[i,u]=(0,t.useUncontrolledState)(s(e,!0),n),[d,c]=(0,t.useUncontrolledState)(e,l);(0,a.useEffect)((()=>{n?.(i)}),[]);const[p,g]=(0,t.useUncontrolledState)(e,o);return(0,a.useEffect)((()=>{void 0!==e&&o?.(e)}),[]),{displayValue:i,transientValue:p,value:d,getValueForValidation:(0,a.useCallback)((e=>"invalidShown"!==e?d:r(i)),[i,r,d]),setValueAfterValidation:(0,a.useCallback)((e=>{c(e),u(s(e))}),[s]),setDisplayValue:u,setTransientValue:g,setValue:c,refreshDisplayValue:(0,a.useCallback)((()=>{u(s(d))}),[s,d])}}})),define("oj-c/editable-value/UNSAFE_useValueRawValueObjectLifecycle/useValueRawValueObjectLifecycle",["require","exports","preact/hooks","../UNSAFE_useValidators/useValidators"],(function(require,e,t,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useValueRawValueObjectLifecycle=void 0,e.useValueRawValueObjectLifecycle=function({value:e,valueState:s,format:r,validateValueOnExternalChange:n}){const o=(0,t.useRef)(e);(0,t.useEffect)((()=>{const{value:e,setDisplayValue:t}=s;t(r(e))}),[]),(0,t.useEffect)((()=>{if(o.current!==e&&(o.current=e,void 0!==e&&e!==s.value)){const{setDisplayValue:t,setValue:o}=s;n(e)===a.ValidationResult.VALID&&(o(e),t(r(e)))}}),[r,e,s])}})),define("oj-c/editable-value/UNSAFE_useConverterObject/useConverterObject",["require","exports","preact/hooks","../utils/utils"],(function(require,e,t,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useConverterObject=e.ConverterErrorSymbol=void 0,e.ConverterErrorSymbol=Symbol("ConverterError"),e.useConverterObject=function({componentMessagingState:s,validationState:r,converter:n}){const o=(0,t.useCallback)((t=>{if(void 0===t)return null;try{return n.parse(t)}catch(t){const n=(0,a.createMessageFromError)(t);return s.setComponentMessages([n]),r.setValid("invalidShown"),e.ConverterErrorSymbol}}),[n,s,r]),l=(0,t.useCallback)(((e,t=!1)=>{if(null!==e)try{return n.format(e)}catch(n){return t||(s.setComponentMessages([(0,a.createMessageFromError)(n)]),r.setValid("invalidShown")),e}}),[s,n,r]);return(0,t.useMemo)((()=>({format:l,parse:o})),[l,o])}})),define("oj-c/editable-value/UNSAFE_useEditableValueRawValueObject/useEditableValueRawValueObject",["require","exports","preact/hooks","../UNSAFE_useComponentMessaging/useComponentMessaging","../UNSAFE_useDeferredValidators/useDeferredValidators","../UNSAFE_useValidationLifecycle/useValidationLifecycle","../UNSAFE_useValidators/useValidators","../UNSAFE_useValueRawValueObject/useValueRawValueObject","../UNSAFE_useValueRawValueObjectLifecycle/useValueRawValueObjectLifecycle","../UNSAFE_useConverterObject/useConverterObject"],(function(require,e,t,a,s,r,n,o,l,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useEditableValueRawValueObject=void 0,e.useEditableValueRawValueObject=function({ariaDescribedBy:e,converter:u,disabled:d,displayOptions:c,implicitComponentValidator:p,labelHint:g,messagesCustom:v,readonly:f,required:m,requiredMessageDetail:V,validators:y,value:b,addBusyState:C,onMessagesCustomChanged:h,onRawValueChanged:S,onValidChanged:M,onValueChanged:E,onTransientValueChanged:j,wrapValueState:D}){const w=(0,a.useComponentMessaging)({messagesCustom:v,onMessagesCustomChanged:h}),{clearAllMessages:A,visibleMessages:_}=w,O=(0,s.useDeferredValidators)({labelHint:g,required:m,requiredMessageDetail:V}),k=p?y?[p,...y]:[p]:y,R=(0,n.useValidators)({componentMessagingState:w,defaultValidState:"valid",deferredValidators:O,validators:k,addBusyState:C,onValidChanged:M}),{validateValueOnExternalChange:F,validateValueOnInternalChange:x}=R,{format:I,parse:U}=(0,i.useConverterObject)({componentMessagingState:w,converter:u,validationState:R}),N=(0,o.useValueRawValueObject)({value:b,format:I,parse:U,onRawValueChanged:S,onTransientValueChanged:j,onValueChanged:E}),L=D?D(N):N,{displayValue:P,value:q,getValueForValidation:T,setValueAfterValidation:H,refreshDisplayValue:B,setDisplayValue:W,setTransientValue:z,setValue:Y}=L;(0,r.useValidationLifecycle)({componentMessagingState:w,validationState:R,deferredValidators:O,validators:y,getValueForValidation:T,setValueAfterValidation:H,readonly:f,disabled:d}),(0,l.useValueRawValueObjectLifecycle)({value:b,format:I,parse:U,valueState:L,validateValueOnExternalChange:F});const G=(0,t.useCallback)((async(e,t=!0)=>{const a=await x(e);return a===n.ValidationResult.VALID&&t&&Y(e),a}),[x]),K=(0,t.useCallback)((async({value:e})=>{if(""===e||null===e)throw new Error("cannot commit an empty string or null");const t=U(e);if(t===i.ConverterErrorSymbol)return;const a=t;if(await G(a)===n.ValidationResult.VALID){const e=I(a);W(e)}}),[G,I,U]),$=(0,t.useCallback)((({value:e})=>{if(""===e||null===e)throw new Error("cannot get an empty string or null in onInput");W(e)}),[]),J=(0,t.useCallback)((()=>{A(),F(q),B()}),[q,A,B,F]),Q=(0,t.useCallback)((async()=>{if(f||d)return"valid";const{fullValidate:e}=R,{displayValue:t,value:a,setValueAfterValidation:s}=L,r=U(t);if(r===i.ConverterErrorSymbol)return"invalid";const n=r,o=C?.("running component method validate"),l=await e(n);return o?.(),l?(n!==a&&s(n),"valid"):"invalid"}),[U,R,L,C,f,d]),X=(0,t.useCallback)((()=>{const{hasHiddenMessages:e,showHiddenMessages:t}=w,{setValid:a}=R;e()&&(t(),a("invalidShown"))}),[w,R]);return{value:q,setValue:Y,displayValue:P,setDisplayValue:W,setTransientValue:z,methods:{reset:J,validate:Q,showMessages:X},textFieldProps:{messages:"none"!==c?.messages?_:void 0,value:P,"aria-describedby":e,onCommit:K,onInput:$},onCommitValue:G}}})),define("oj-c/input-date-mask/CalendarDateConverter",["require","exports","@oracle/oraclejet-preact/utils/UNSAFE_calendarDateUtils","ojs/ojconfig"],(function(require,e,t,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CalendarDateConverter=void 0;e.CalendarDateConverter=class{constructor(e){this.locale=e?.locale??(0,a.getLocale)(),this.calendarDateConverter_parseErrorFn=e?.calendarDateConverter_parseErrorFn,this.customMask=e?.customMask}format(e){const a=(0,t.getCalendarDateFromIso)(e);if(!a)throw new Error("value must be a date-only ISO string");return a}parse(e){if(void 0!==e&&!(0,t.isCompleteCalendarDate)(e)){const e=(new Date).getFullYear(),a=(0,t.formatIsoDateStrAsExample)(this.locale,`${e}-11-29`,this.customMask),s=this.calendarDateConverter_parseErrorFn&&this.calendarDateConverter_parseErrorFn({dateExample:a});throw new Error(s??"parse failed")}const a=e;return(0,t.getIsoDateStr)(a.year,a.month,a.day)}}})),define("oj-c/input-date-text/useImplicitDateRangeValidator",["require","exports","ojs/ojvalidator-localdaterange","preact/hooks"],(function(require,e,t,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useImplicitDateRangeValidator=void 0,e.useImplicitDateRangeValidator=function({formatObj:e,dateRangeOverflowMessageDetail:s,dateRangeUnderflowMessageDetail:r,max:n,min:o}){return(0,a.useMemo)((()=>void 0!==o||void 0!==n?new t.LocalDateRangeValidator({formatObj:e,max:n,min:o,rangeOverflowMessageDetail:s,rangeUnderflowMessageDetail:r}):null),[e,s,r,o,n])}})),define("oj-c/input-date-mask/useInputDateMaskPreact",["require","exports","oj-c/editable-value/UNSAFE_useEditableValueRawValueObject/useEditableValueRawValueObject","./CalendarDateConverter","preact/hooks","@oracle/oraclejet-preact/hooks/UNSAFE_useTranslationBundle","ojs/ojconverter-preferences","@oracle/oraclejet-preact/utils/UNSAFE_calendarDateUtils","oj-c/input-date-text/useImplicitDateRangeValidator","ojs/ojconfig","oj-c/editable-value/utils/utils"],(function(require,e,t,a,s,r,n,o,l,i,u){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useInputDateMaskPreact=void 0,e.useInputDateMaskPreact=function({dateRangeOverflowMessageDetail:e,dateRangeUnderflowMessageDetail:n,disabled:p,displayOptions:g,labelEdge:v,labelHint:f,labelStartWidth:m,max:V,messagesCustom:y,min:b,readonly:C,required:h,requiredMessageDetail:S,textAlign:M,userAssistanceDensity:E,validators:j,value:D,onMessagesCustomChanged:w,onRawValueChanged:A,onValidChanged:_,onValueChanged:O,...k},R){const F=(0,u.treatNull)(b),x=(0,u.treatNull)(V),I=(0,r.useTranslationBundle)("@oracle/oraclejet-preact").calendarDateConverter_parseError,U=(0,s.useMemo)((()=>c()),[]),N=(0,s.useMemo)((()=>new a.CalendarDateConverter({calendarDateConverter_parseErrorFn:I,customMask:U})),[I,U]),L=(0,s.useMemo)((()=>({format:e=>(0,o.formatIsoDateStrAsExample)((0,i.getLocale)(),e,U)})),[U]),P=(0,l.useImplicitDateRangeValidator)({formatObj:L,dateRangeOverflowMessageDetail:e,dateRangeUnderflowMessageDetail:n,max:x,min:F}),{methods:q,textFieldProps:T,value:H,setValue:B}=(0,t.useEditableValueRawValueObject)({ariaDescribedBy:k["aria-describedby"],converter:N,disabled:p,displayOptions:g,implicitComponentValidator:P,labelHint:f,messagesCustom:y,readonly:C,required:h,requiredMessageDetail:S,validators:j,value:D,addBusyState:R,onMessagesCustomChanged:w,onRawValueChanged:A,onValidChanged:_,onValueChanged:O}),W=void 0===H||!d(T.value);return{value:H,setValue:B,methods:q,inputDateMaskProps:{isDisabled:p,isReadonly:C,isRequired:h,isRequiredShown:h&&("compact"===E||W),label:f,labelEdge:v,labelStartWidth:m,masks:U,textAlign:M,userAssistanceDensity:E,...T}}};const d=e=>void 0!==e&&(void 0!==e.year||void 0!==e.month||void 0!==e.day),c=()=>{const e=(0,n.getDateTimePreferences)(),t=e.dateStyle?.short?.pattern;if(t&&!t.toUpperCase().includes("MMM"))return(0,o.getDatePlaceholdersFromPattern)(t)}})),define("oj-c/input-date-mask/input-date-mask",["require","exports","preact/jsx-runtime","@oracle/oraclejet-preact/translationBundle","@oracle/oraclejet-preact/hooks/UNSAFE_useFormContext","@oracle/oraclejet-preact/hooks/UNSAFE_useFormVariantContext","@oracle/oraclejet-preact/hooks/UNSAFE_useTabbableMode","@oracle/oraclejet-preact/UNSAFE_InputDateMask","oj-c/editable-value/UNSAFE_useAssistiveText/useAssistiveText","ojs/ojcontext","ojs/ojvcomponent","preact/compat","preact/hooks","./useInputDateMaskPreact","@oracle/oraclejet-preact/utils/UNSAFE_styles/Layout","@oracle/oraclejet-preact/UNSAFE_IntlDateTime","css!oj-c/input-date-mask/input-date-mask-styles.css"],(function(require,e,t,a,s,r,n,o,l,i,u,d,c,p,g,v){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InputDateMask=void 0;const f={messages:"display",validatorHint:"display"},m={instruction:""},V={definition:"",source:""},y=[],b=[];e.InputDateMask=(0,u.registerCustomElement)("oj-c-input-date-mask",(0,d.forwardRef)((({columnSpan:e=1,disabled:a=!1,displayOptions:n=f,help:d=m,helpHints:C=V,messagesCustom:h=y,readonly:S=!1,required:M=!1,userAssistanceDensity:E="reflow",validators:j=b,value:D=null,...w},A)=>{const _=(0,c.useRef)(),O=(0,c.useRef)(),k=(0,c.useCallback)(((e="InputDateMask: busyState")=>_.current?i.getContext(_.current).getBusyContext().addBusyState({description:e}):()=>{}),[]),{inputDateMaskProps:R,methods:F}=(0,p.useInputDateMaskPreact)({disabled:a,displayOptions:n,messagesCustom:h,readonly:S,required:M,userAssistanceDensity:E,validators:j,value:D,...w},k);(0,c.useImperativeHandle)(A,(()=>({blur:()=>O.current?.blur(),focus:()=>O.current?.focus(),...F})),[F]);const x=(0,l.useAssistiveText)({displayOptions:n,help:d,helpHints:C,userAssistanceDensity:R.userAssistanceDensity,validators:j}),I=(0,r.useFormVariantContext)(),U={isFormLayout:void 0!==w.containerReadonly,isReadonly:w.containerReadonly,labelWrapping:w.labelWrapping};if(!v.DateTimeUtils.isDateOnlyIsoString(D))throw new Error("value must be a date-only ISO string");if(!v.DateTimeUtils.isDateOnlyIsoString(w.min))throw new Error("min must be a date-only ISO string");if(!v.DateTimeUtils.isDateOnlyIsoString(w.max))throw new Error("max must be a date-only ISO string");return(0,t.jsx)(u.Root,{id:w.id,ref:_,class:g.layoutSpanStyles.layoutSpanColumn[e],children:(0,t.jsx)(s.FormContext.Provider,{value:U,children:(0,t.jsx)(o.InputDateMask,{ref:O,...x,...R,variant:I})})})})),"InputDateMask",{properties:{columnSpan:{type:"number"},containerReadonly:{type:"boolean",binding:{consume:{name:"containerReadonly"}}},dateRangeOverflowMessageDetail:{type:"string"},dateRangeUnderflowMessageDetail:{type:"string"},disabled:{type:"boolean"},displayOptions:{type:"object",properties:{messages:{type:"string",enumValues:["none","display"]},validatorHint:{type:"string",enumValues:["none","display"]}}},help:{type:"object",properties:{instruction:{type:"string"}}},helpHints:{type:"object",properties:{definition:{type:"string"},source:{type:"string"},sourceText:{type:"string"}}},labelEdge:{type:"string",enumValues:["none","start","top","inside"],binding:{consume:{name:"containerLabelEdge"}}},labelHint:{type:"string"},labelStartWidth:{type:"number|string",binding:{consume:{name:"labelWidth"}}},labelWrapping:{type:"string",enumValues:["truncate","wrap"],binding:{consume:{name:"labelWrapping"}}},max:{type:"string|null"},messagesCustom:{type:"Array<object>",writeback:!0},min:{type:"string|null"},readonly:{type:"boolean",binding:{consume:{name:"containerReadonly"}}},required:{type:"boolean"},requiredMessageDetail:{type:"string"},textAlign:{type:"string",enumValues:["end","start","right"]},userAssistanceDensity:{type:"string",enumValues:["compact","reflow","efficient"],binding:{consume:{name:"containerUserAssistanceDensity"}}},validators:{type:"Array<object>|null"},value:{type:"string|null",writeback:!0},rawValue:{type:"object",properties:{year:{type:"number"},month:{type:"number"},day:{type:"number"}},readOnly:!0,writeback:!0},valid:{type:"string",enumValues:["pending","valid","invalidHidden","invalidShown"],readOnly:!0,writeback:!0}},extension:{_WRITEBACK_PROPS:["messagesCustom","rawValue","valid","value"],_READ_ONLY_PROPS:["rawValue","valid"],_OBSERVED_GLOBAL_PROPS:["aria-describedby","id"]},methods:{blur:{},focus:{},showMessages:{},reset:{},validate:{}}},{columnSpan:1,disabled:!1,displayOptions:{messages:"display",validatorHint:"display"},help:{instruction:""},helpHints:{definition:"",source:""},messagesCustom:[],readonly:!1,required:!1,userAssistanceDensity:"reflow",validators:[],value:null},{"@oracle/oraclejet-preact":a.default},{consume:[r.FormVariantContext,n.TabbableModeContext]})}));
|
|
1
|
+
define("oj-c/hooks/UNSAFE_useMergedFormContext/useMergedFormContext",["require","exports","@oracle/oraclejet-preact/hooks/UNSAFE_useFormContext"],(function(require,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useMergedFormContext=void 0,e.useMergedFormContext=function({propContainerReadonly:e,propLabelWrapping:t,propReadonly:s,propUserAssistanceDensity:r}){const n=(0,a.useFormContext)(),o=r??n.userAssistanceDensity,i=s??n.isReadonly,{isFormLayout:l,isReadonly:u,labelWrapping:d,...c}=n;return{containerProps:{...c,isFormLayout:void 0!==e||l,isReadonly:e??u,labelWrapping:t??d},readonlyValue:i,uadValue:o}}})),define("oj-c/editable-value/UNSAFE_useAssistiveText/useAssistiveText",["require","exports","preact/hooks"],(function(require,e,a){"use strict";function t(e,a,t,s,r,n){const o="compact"!==n?t?.definition:void 0;return e?.instruction||("none"===r?.validatorHint?void 0:a)||o||("none"===r?.converterHint?void 0:s)}function s(e){if(!e.length)return;return e.map((e=>"function"==typeof e.getHint?e.getHint():void 0)).filter(Boolean).join("\n")}Object.defineProperty(e,"__esModule",{value:!0}),e.useAssistiveText=void 0,e.useAssistiveText=function({addBusyState:e,converter:r,displayOptions:n,help:o,helpHints:i,userAssistanceDensity:l,validators:u}){const[d,c]=(0,a.useState)(u&&u.length?s(u):void 0),p=(0,a.useRef)();(0,a.useEffect)((()=>{if(!u||!u.length)return void c(void 0);c(s(u));const a=u.map((e=>e.hint)).filter(Boolean),t=p.current=Symbol(),r=e?.("resolving the async validator hints");Promise.allSettled(a).then((e=>{c((a=>{const s=e.map((e=>"fulfilled"===e.status?e.value:void 0)).filter(Boolean);return t===p.current&&s.length?[a,...s].join("\n"):a})),r?.()}))}),[u]);const v="compact"!==l?i?.sourceText:i?.definition||i?.sourceText;return{assistiveText:t(o,d,i,r?.getHint?.()??void 0,n,l),helpSourceLink:i?.source,helpSourceText:v}}})),define("oj-c/input-date-mask/CalendarDateConverter",["require","exports","@oracle/oraclejet-preact/utils/UNSAFE_calendarDateUtils","ojs/ojconfig"],(function(require,e,a,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CalendarDateConverter=void 0;e.CalendarDateConverter=class{constructor(e){this.locale=e?.locale??(0,t.getLocale)(),this.calendarDateConverter_parseErrorFn=e?.calendarDateConverter_parseErrorFn,this.customMask=e?.customMask}format(e){const t=(0,a.getCalendarDateFromIso)(e);if(!t)throw new Error("value must be a date-only ISO string");return t}parse(e){if(void 0!==e&&!(0,a.isCompleteCalendarDate)(e)){const e=(new Date).getFullYear(),t=(0,a.formatIsoDateStrAsExample)(this.locale,`${e}-11-29`,this.customMask),s=this.calendarDateConverter_parseErrorFn&&this.calendarDateConverter_parseErrorFn({dateExample:t});throw new Error(s??"parse failed")}const t=e;return(0,a.getIsoDateStr)(t.year,t.month,t.day)}}})),define("oj-c/input-date-text/useImplicitDateRangeValidator",["require","exports","ojs/ojvalidator-localdaterange","preact/hooks"],(function(require,e,a,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useImplicitDateRangeValidator=void 0,e.useImplicitDateRangeValidator=function({formatObj:e,dateRangeOverflowMessageDetail:s,dateRangeUnderflowMessageDetail:r,max:n,min:o}){return(0,t.useMemo)((()=>void 0!==o||void 0!==n?new a.LocalDateRangeValidator({formatObj:e,max:n,min:o,rangeOverflowMessageDetail:s,rangeUnderflowMessageDetail:r}):null),[e,s,r,o,n])}})),define("oj-c/editable-value/utils/utils",["require","exports"],(function(require,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isShallowEqual=e.normalizeValue=e.treatNull=e.createMessageFromError=void 0,e.createMessageFromError=function(e){return"function"==typeof e.getMessage?{severity:"error",detail:e.getMessage().detail}:{severity:"error",detail:e.message}},e.treatNull=function(e,a){return null===e?a:e},e.normalizeValue=function(e){return"string"==typeof e&&""===e?null:e};e.isShallowEqual=(e,a)=>e===a||e.length===a.length&&e.every(((e,t)=>e===a[t]))})),define("oj-c/hooks/UNSAFE_useEditableValue/utils",["require","exports"],(function(require,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.treatNull=e.normalizeValue=e.isShallowEqual=e.hasErrorMessages=e.createMessageFromError=void 0;e.createMessageFromError=e=>"function"==typeof e.getMessage?{severity:"error",detail:e.getMessage().detail}:{severity:"error",detail:e.message};e.treatNull=(e,a)=>null===e?a:e;e.normalizeValue=e=>"string"==typeof e&&""===e?null:e;e.isShallowEqual=(e,a)=>e===a||e.length===a.length&&e.every(((e,t)=>e===a[t]));e.hasErrorMessages=e=>!!e&&e.some((e=>"error"===e.severity))})),define("oj-c/hooks/UNSAFE_useEditableValue/converterUtils",["require","exports","./utils"],(function(require,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parse=e.format=void 0,e.parse=function(e,t){if(void 0===e)return{result:"success",value:null};if(""===(s=e)||null===s)return{result:"success",value:e};var s;try{return{result:"success",value:t.parse(e)}}catch(e){return{result:"failure",error:(0,a.createMessageFromError)(e)}}},e.format=function(e,t,s){if(function(e){return null===e}(e))return{result:"success",value:t};try{return{result:"success",value:s.format(e)}}catch(e){return{result:"failure",error:(0,a.createMessageFromError)(e)}}}})),define("oj-c/editable-value/UNSAFE_useStaleIdentity/useStaleIdentity",["require","exports","preact/hooks"],(function(require,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useStaleIdentity=void 0,e.useStaleIdentity=function(){const e=(0,a.useRef)(new Map);return{setStaleIdentity:(0,a.useCallback)((a=>{const t=Symbol();return e.current.set(a,t),{isStale:()=>t!==e.current.get(a)}}),[])}}})),define("oj-c/hooks/UNSAFE_useEditableValue/reducer",["require","exports"],(function(require,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.updateValue=e.updateValidStatus=e.updatePreviousValue=e.updatePreviousValidators=e.updatePreviousReadonly=e.updatePreviousDisabled=e.updatePreviousDeferredValidators=e.updatePreviousConverter=e.updateHiddenMessages=e.updateDisplayValue=e.updateCustomMessages=e.updateComponentMessages=e.showHiddenMessages=e.clearAllMessages=e.addComponentMessage=e.reducer=void 0,e.reducer=function(e,a){const t=e.customMessages??[],s=e.hiddenMessages,r=e.componentMessages,n=e.shownMessages;switch(a.type){case"UPDATE_DISPLAY_VALUE":return{...e,displayValue:a.payload};case"UPDATE_VALID":return{...e,valid:a.payload};case"UPDATE_VALUE":return{...e,value:a.payload};case"UPDATE_PREVIOUS_CONVERTER":return{...e,previousConverter:a.payload};case"UPDATE_PREVIOUS_DEFERRED_VALIDATORS":return{...e,previousDeferredValidators:a.payload};case"UPDATE_PREVIOUS_DISABLED":return{...e,previousDisabled:a.payload};case"UPDATE_PREVIOUS_READONLY":return{...e,previousReadonly:a.payload};case"UPDATE_PREVIOUS_VALIDATORS":return{...e,previousValidators:a.payload};case"UPDATE_PREVIOUS_VALUE":return{...e,previousValue:a.payload};case"UPDATE_COMPONENT_MESSAGES":return{...e,componentMessages:a.payload,shownMessages:[...t,...a.payload]};case"UPDATE_HIDDEN_MESSAGES":return{...e,hiddenMessages:a.payload};case"UPDATE_CUSTOM_MESSAGES":return{...e,customMessages:a.payload,shownMessages:[...a.payload,...r]};case"CLEAR_ALL_MESSAGES":return{...e,shownMessages:[],hiddenMessages:[],customMessages:[],componentMessages:[]};case"ADD_COMPONENT_MESSAGE":return{...e,componentMessages:[...r,a.payload],shownMessages:[...n,a.payload]};case"SHOW_HIDDEN_MESSAGES":return 0===s.length?e:{...e,hiddenMessages:[],shownMessages:[...t,...r,...s]};default:return e}},e.updateDisplayValue=function(e,a,{onRawValueChanged:t}){e({type:"UPDATE_DISPLAY_VALUE",payload:a}),t?.(a)},e.updateValidStatus=function(e,a,{onValidChanged:t}){e({type:"UPDATE_VALID",payload:a}),t?.(a)},e.updateValue=function(e,a,{onValueChanged:t}){e({type:"UPDATE_VALUE",payload:a}),t?.(a)},e.updateComponentMessages=function(e,a){e({type:"UPDATE_COMPONENT_MESSAGES",payload:a})},e.updateHiddenMessages=function(e,a){e({type:"UPDATE_HIDDEN_MESSAGES",payload:a})},e.updateCustomMessages=function(e,a){e({type:"UPDATE_CUSTOM_MESSAGES",payload:a})},e.updatePreviousValue=function(e,a){e({type:"UPDATE_PREVIOUS_VALUE",payload:a})},e.updatePreviousConverter=function(e,a){e({type:"UPDATE_PREVIOUS_CONVERTER",payload:a})},e.updatePreviousDeferredValidators=function(e,a){e({type:"UPDATE_PREVIOUS_DEFERRED_VALIDATORS",payload:a})},e.updatePreviousDisabled=function(e,a){e({type:"UPDATE_PREVIOUS_DISABLED",payload:a})},e.updatePreviousReadonly=function(e,a){e({type:"UPDATE_PREVIOUS_READONLY",payload:a})},e.updatePreviousValidators=function(e,a){e({type:"UPDATE_PREVIOUS_VALIDATORS",payload:a})},e.clearAllMessages=function(e,a,{onMessagesCustomChanged:t}){e({type:"CLEAR_ALL_MESSAGES"}),t?.([])},e.showHiddenMessages=function(e){e({type:"SHOW_HIDDEN_MESSAGES"})},e.addComponentMessage=function(e,a){e({type:"ADD_COMPONENT_MESSAGE",payload:a})}})),define("oj-c/hooks/UNSAFE_useEditableValue/validationUtils",["require","exports","./utils"],(function(require,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateSync=e.validateAsync=void 0,e.validateSync=function({validators:e,value:t}){const s=[];for(const r of e)try{r.validate(t)}catch(e){s.push((0,a.createMessageFromError)(e))}return s.length?{result:"failure",errors:s}:{result:"success"}},e.validateAsync=function({validators:e,value:t}){const s=(e,t)=>{try{const s=e.validate(t);if(s instanceof Promise)return s.then((()=>{}),(e=>(0,a.createMessageFromError)(e)))}catch(e){return(0,a.createMessageFromError)(e)}},r=[],n=[];for(const a of e){const e=s(a,t);void 0!==e&&(e instanceof Promise?n.push(e):r.push(e))}return{errors:r,maybeErrorPromises:n}}})),define("oj-c/hooks/UNSAFE_useEditableValue/useEditableValue",["require","exports","preact/hooks","./converterUtils","./utils","oj-c/editable-value/UNSAFE_useStaleIdentity/useStaleIdentity","./reducer","./validationUtils"],(function(require,e,a,t,s,r,n,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useEditableValue=void 0;const i=Symbol("ConverterError");e.useEditableValue=function({addBusyState:e,ariaDescribedBy:l,converter:u,defaultDisplayValue:d,deferredValidators:c,disabled:p,displayOptions:v,messagesCustom:g,onMessagesCustomChanged:y,onRawValueChanged:m,onValidChanged:f,onValueChanged:S,readonly:M,validators:h,value:E}){const D=(0,a.useRef)(!0),{setStaleIdentity:V}=(0,r.useStaleIdentity)(),[b,_]=(0,a.useReducer)(n.reducer,{shownMessages:[],hiddenMessages:[],customMessages:g,componentMessages:[],value:E,valid:"pending"},(e=>{const a=u?(0,t.format)(E,d,u):{result:"success",value:(0,s.treatNull)(E,d)};return{...e,displayValue:"success"===a.result?a.value:d}})),C=(0,a.useCallback)(((e,a)=>(e(_,a,{onMessagesCustomChanged:y,onRawValueChanged:m,onValidChanged:f,onValueChanged:S}),!0)),[_,y,m,f,S]),A=(0,a.useCallback)((e=>{let a;if(u){const r=(0,t.format)(e,d,u);"failure"===r.result?(C(n.updateComponentMessages,[r.error]),C(n.updateValidStatus,"invalidShown"),a=(0,s.treatNull)(e,d)):a=r.value}else a=(0,s.treatNull)(e,d);return C(n.updateDisplayValue,a),!0}),[u,C,d]),P=(0,a.useCallback)((()=>{if("invalidShown"!==b.valid)return b.value;if(!u)return(0,s.normalizeValue)(b.displayValue);const e=(0,t.parse)((0,s.normalizeValue)(b.displayValue),u);return"failure"===e.result?(C(n.updateComponentMessages,[e.error]),C(n.updateValidStatus,"invalidShown"),i):e.value}),[u,C,b.displayValue,b.valid,b.value]),U=(0,a.useCallback)((e=>{if(!u)return(0,s.normalizeValue)(e);const a=(0,t.parse)((0,s.normalizeValue)(e),u);return"failure"===a.result&&C(n.updateComponentMessages,[a.error])&&C(n.updateValidStatus,"invalidShown"),"success"===a.result?a.value:i}),[u,C]),j=(0,a.useCallback)((async(a,t={})=>{const{doNotClearMessagesCustom:r=!1}=t,i=r&&(0,s.hasErrorMessages)(g);if(C(n.updateValidStatus,"pending"),r?(C(n.updateComponentMessages,[]),C(n.updateHiddenMessages,[])):C(n.clearAllMessages),!(h&&0!==h.length||c&&0!==c.length))return C(n.updateValidStatus,i?"invalidShown":"valid"),!0;const l=[],u=(0,o.validateSync)({validators:c??[],value:a});let d;"failure"===u.result&&l.push(...u.errors),null!=a&&(d=(0,o.validateAsync)({validators:h??[],value:a})),l.push(...d?.errors??[]);const p=d?.maybeErrorPromises??[];if(!l.length&&!p.length)return C(n.updateValidStatus,i?"invalidShown":"valid"),!0;const v=0!==l.length;if(v&&C(n.updateComponentMessages,l)&&C(n.updateValidStatus,"invalidShown"),!p.length)return!v;const y=e?.("running asynchronous validation"),{isStale:m}=V("useEditableValue-full-validate");let f=!1;const S=[];for(const e of p){const a=e.then((e=>{e&&!m()&&(C(n.addComponentMessage,e),C(n.updateValidStatus,"invalidShown"),f=!0)}));S.push(a)}return await Promise.all(S),v||f||m()||C(n.updateValidStatus,i?"invalidShown":"valid"),y?.(),!v&&!f}),[e,C,c,g,V,h]),R=async()=>{if(p||M)return;const e=P();if(e===i)return;const a=e;await w(a,{doNotClearMessagesCustom:!0})&&C(n.updateValue,a)&&A(a)},w=(0,a.useCallback)((async(a,t={})=>{const{isStale:s}=V("useEditableValue-validateValueOnInternalChange"),r=e?.("Running validateValueOnInternalChange"),n=await j(a,t);return r?.(),!s()&&n}),[e,j,V]),O=(0,a.useCallback)((async({value:e})=>{const a=U(e);if(a===i)return;const t=a;await w(t)&&C(n.updateValue,t)&&A(t)}),[C,U,A,w]),k=(0,a.useCallback)((({value:e})=>{C(n.updateDisplayValue,e??d)}),[C,d]),I=(0,a.useCallback)((async()=>{if(M||p)return"valid";const a=U(b.displayValue);if(a===i)return"invalid";const t=a,s=e?.("Running component method validate"),r=await j(t);return s?.(),r?(t!==b.value&&(C(n.updateValue,t),A(t)),"valid"):"invalid"}),[e,p,C,j,U,M,A,b.displayValue,b.value]),x=(0,a.useCallback)((()=>{C(n.clearAllMessages);const e=b.value,a=(0,o.validateSync)({validators:c??[],value:e});"failure"===a.result&&C(n.updateHiddenMessages,a.errors),C(n.updateValidStatus,"failure"===a.result?"invalidHidden":"valid"),A(b.value)}),[c,C,A,b.value]),F=(0,a.useCallback)((()=>{b.hiddenMessages&&b.hiddenMessages.length>0&&(C(n.showHiddenMessages),C(n.updateValidStatus,"invalidShown"))}),[C,b.hiddenMessages]);if(!D.current&&b.previousValue!==E&&(C(n.updatePreviousValue,E),E!==b.value)){C(n.clearAllMessages);const e=(0,o.validateSync)({validators:c??[],value:E});"success"===e.result&&C(n.updateValidStatus,"valid"),"failure"===e.result&&C(n.updateValidStatus,"invalidHidden")&&C(n.updateHiddenMessages,e.errors),C(n.updateValue,E),A(E)}if(D.current||b.previousConverter===u||(C(n.updatePreviousConverter,u),"invalidShown"!==b.valid&&A(E),"invalidShown"===b.valid&&R()),D.current||b.previousValidators===h||(C(n.updatePreviousValidators,h),"invalidShown"===b.valid&&R()),!D.current&&(!b.customMessages&&g||b.customMessages&&!g||b.customMessages&&g&&!(0,s.isShallowEqual)(b.customMessages,g))){const e=b.componentMessages??[],a=b.hiddenMessages??[],t=g??[],r=(0,s.hasErrorMessages)(t),o=a.length>0,i=0===e.length&&0===a.length&&0===t.length;C(n.updateCustomMessages,t),r&&C(n.updateValidStatus,"invalidShown"),!r&&"pending"!==b.valid&&(i&&C(n.updateValidStatus,"valid")||o&&C(n.updateValidStatus,"invalidHidden"))}if(!D.current&&(b.previousDeferredValidators!==c||b.previousDisabled!==p||b.previousReadonly!==M)){const e=0===c?.length;if(b.previousDeferredValidators!==c&&C(n.updatePreviousDeferredValidators,c),b.previousDisabled!==p&&C(n.updatePreviousDisabled,p),b.previousReadonly!==M&&C(n.updatePreviousReadonly,M),e||!M&&!p)switch(b.valid){case"valid":const e=P();if(e!==i){const a=(0,o.validateSync)({validators:c??[],value:e});"failure"===a.result&&C(n.updateHiddenMessages,a.errors)&&C(n.updateValidStatus,"invalidHidden")}break;case"invalidHidden":0===c?.length&&(C(n.updateValidStatus,"valid"),C(n.updateHiddenMessages,[]));break;case"invalidShown":R()}}return D.current&&(D.current=!1),(0,a.useEffect)((()=>{if(C(n.updatePreviousValue,E),C(n.updatePreviousConverter,u),C(n.updatePreviousValidators,h),C(n.updatePreviousDeferredValidators,c),C(n.updatePreviousDisabled,p),C(n.updatePreviousReadonly,M),C(n.updateCustomMessages,g),p||M)C(n.updateValidStatus,"valid"),A(E);else{const e=(0,o.validateSync)({validators:c??[],value:E});"failure"===e.result&&C(n.updateHiddenMessages,e.errors)&&C(n.updateValidStatus,"invalidHidden"),"success"===e.result&&C(n.updateValidStatus,(0,s.hasErrorMessages)(g)?"invalidShown":"valid")&&A(E)}}),[]),{value:b.value,displayValue:b.displayValue,methods:{reset:x,showMessages:F,validate:I},textFieldProps:{"aria-describedby":l,messages:"none"!==v?.messages?b.shownMessages:void 0,onCommit:O,onInput:k,value:b.displayValue}}}})),define("oj-c/editable-value/UNSAFE_useDeferredValidators/useDeferredValidators",["require","exports","ojs/ojvalidator-required","preact/hooks","@oracle/oraclejet-preact/hooks/UNSAFE_useTranslationBundle"],(function(require,e,a,t,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useDeferredValidators=void 0,e.useDeferredValidators=function({labelHint:e,required:r,requiredMessageDetail:n}){const o=(0,s.useTranslationBundle)("@oracle/oraclejet-preact"),i=n||o.formControl_requiredMessageDetail(),l=(0,t.useMemo)((()=>r?new a({label:e,messageDetail:i}):null),[r]);return(0,t.useMemo)((()=>[l].filter(Boolean)),[l])}})),define("oj-c/input-date-mask/useInputDateMaskPreact",["require","exports","./CalendarDateConverter","preact/hooks","@oracle/oraclejet-preact/hooks/UNSAFE_useTranslationBundle","ojs/ojconverter-preferences","@oracle/oraclejet-preact/utils/UNSAFE_calendarDateUtils","oj-c/input-date-text/useImplicitDateRangeValidator","ojs/ojconfig","oj-c/editable-value/utils/utils","oj-c/hooks/UNSAFE_useEditableValue/useEditableValue","oj-c/editable-value/UNSAFE_useDeferredValidators/useDeferredValidators"],(function(require,e,a,t,s,r,n,o,i,l,u,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getMasksFromDatePatternPreferences=e.useInputDateMaskPreact=void 0,e.useInputDateMaskPreact=function({dateRangeOverflowMessageDetail:r,dateRangeUnderflowMessageDetail:p,disabled:v,displayOptions:g,labelEdge:y,labelHint:m,labelStartWidth:f,max:S,messagesCustom:M,min:h,readonly:E,required:D,requiredMessageDetail:V,textAlign:b,userAssistanceDensity:_,validators:C,value:A,onMessagesCustomChanged:P,onRawValueChanged:U,onValidChanged:j,onValueChanged:R,...w},O){const k=(0,l.treatNull)(h),I=(0,l.treatNull)(S),x=(0,s.useTranslationBundle)("@oracle/oraclejet-preact").calendarDateConverter_parseError,F=(0,t.useMemo)((()=>(0,e.getMasksFromDatePatternPreferences)()),[]),T=(0,t.useMemo)((()=>new a.CalendarDateConverter({calendarDateConverter_parseErrorFn:x,customMask:F})),[x,F]),N=(0,t.useMemo)((()=>({format:e=>(0,n.formatIsoDateStrAsExample)((0,i.getLocale)(),e,F)})),[F]),H=(0,o.useImplicitDateRangeValidator)({formatObj:N,dateRangeOverflowMessageDetail:r,dateRangeUnderflowMessageDetail:p,max:I,min:k}),L=(0,t.useMemo)((()=>[...H?[H]:[],...C||[]]),[H,C]),q=(0,d.useDeferredValidators)({labelHint:m,required:D,requiredMessageDetail:V}),{methods:B,textFieldProps:W,value:G}=(0,u.useEditableValue)({addBusyState:O,ariaDescribedBy:w["aria-describedby"],converter:T,defaultDisplayValue:void 0,deferredValidators:q,disabled:v,displayOptions:g,messagesCustom:M,onMessagesCustomChanged:P,onRawValueChanged:U,onValidChanged:j,onValueChanged:R,readonly:E,validators:L,value:A}),z=void 0===G||!c(W.value);return{methods:B,inputDateMaskProps:{isDisabled:v,isReadonly:E,isRequired:D,isRequiredShown:D&&("compact"===_||z),label:m,labelEdge:y,labelStartWidth:f,masks:F,textAlign:b,userAssistanceDensity:_,...W}}};const c=e=>void 0!==e&&(void 0!==e.year||void 0!==e.month||void 0!==e.day);e.getMasksFromDatePatternPreferences=()=>{const e=(0,r.getDateTimePreferences)(),a=e.dateStyle?.short?.pattern;if(a&&!a.toUpperCase().includes("MMM"))return(0,n.getDatePlaceholdersFromPattern)(a)}})),define("oj-c/input-date-mask/input-date-mask",["require","exports","preact/jsx-runtime","@oracle/oraclejet-preact/translationBundle","@oracle/oraclejet-preact/hooks/UNSAFE_useFormContext","oj-c/hooks/UNSAFE_useMergedFormContext/useMergedFormContext","@oracle/oraclejet-preact/hooks/UNSAFE_useFormVariantContext","@oracle/oraclejet-preact/hooks/UNSAFE_useTabbableMode","@oracle/oraclejet-preact/UNSAFE_InputDateMask","oj-c/editable-value/UNSAFE_useAssistiveText/useAssistiveText","ojs/ojcontext","ojs/ojvcomponent","preact/compat","preact/hooks","./useInputDateMaskPreact","@oracle/oraclejet-preact/utils/UNSAFE_styles/Layout","@oracle/oraclejet-preact/UNSAFE_IntlDateTime","css!oj-c/input-date-mask/input-date-mask-styles.css"],(function(require,e,a,t,s,r,n,o,i,l,u,d,c,p,v,g,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InputDateMask=void 0;const m={messages:"display",validatorHint:"display"},f={instruction:""},S={definition:"",source:""},M=[],h=[];e.InputDateMask=(0,d.registerCustomElement)("oj-c-input-date-mask",(0,c.forwardRef)((({columnSpan:e=1,containerReadonly:t,disabled:o=!1,displayOptions:c=m,help:E=f,helpHints:D=S,labelWrapping:V,messagesCustom:b=M,readonly:_,required:C=!1,userAssistanceDensity:A,validators:P=h,value:U=null,...j},R)=>{const w=(0,p.useRef)(),O=(0,p.useRef)(),k=(0,p.useCallback)(((e="InputDateMask: busyState")=>w.current?u.getContext(w.current).getBusyContext().addBusyState({description:e}):()=>{}),[]),{containerProps:I,uadValue:x,readonlyValue:F}=(0,r.useMergedFormContext)({propContainerReadonly:t,propLabelWrapping:V,propReadonly:_,propUserAssistanceDensity:A}),{inputDateMaskProps:T,methods:N}=(0,v.useInputDateMaskPreact)({disabled:o,displayOptions:c,messagesCustom:b,readonly:F,required:C,userAssistanceDensity:x,validators:P,value:U,...j},k);(0,p.useImperativeHandle)(R,(()=>({blur:()=>O.current?.blur(),focus:()=>O.current?.focus(),...N})),[N]);const H=(0,l.useAssistiveText)({displayOptions:c,help:E,helpHints:D,userAssistanceDensity:T.userAssistanceDensity,validators:P}),L=(0,n.useFormVariantContext)();if(!y.DateTimeUtils.isDateOnlyIsoString(U))throw new Error("value must be a date-only ISO string");if(!y.DateTimeUtils.isDateOnlyIsoString(j.min))throw new Error("min must be a date-only ISO string");if(!y.DateTimeUtils.isDateOnlyIsoString(j.max))throw new Error("max must be a date-only ISO string");return(0,a.jsx)(d.Root,{id:j.id,ref:w,class:g.layoutSpanStyles.layoutSpanColumn[e],children:(0,a.jsx)(s.FormContext.Provider,{value:I,children:(0,a.jsx)(i.InputDateMask,{ref:O,...H,...T,variant:L})})})})),"InputDateMask",{properties:{columnSpan:{type:"number"},containerReadonly:{type:"boolean",binding:{consume:{name:"containerReadonly"}}},dateRangeOverflowMessageDetail:{type:"string"},dateRangeUnderflowMessageDetail:{type:"string"},disabled:{type:"boolean"},displayOptions:{type:"object",properties:{messages:{type:"string",enumValues:["none","display"]},validatorHint:{type:"string",enumValues:["none","display"]}}},help:{type:"object",properties:{instruction:{type:"string"}}},helpHints:{type:"object",properties:{definition:{type:"string"},source:{type:"string"},sourceText:{type:"string"}}},labelEdge:{type:"string",enumValues:["none","start","top","inside"],binding:{consume:{name:"containerLabelEdge"}}},labelHint:{type:"string"},labelStartWidth:{type:"number|string",binding:{consume:{name:"labelWidth"}}},labelWrapping:{type:"string",enumValues:["truncate","wrap"],binding:{consume:{name:"labelWrapping"}}},max:{type:"string|null"},messagesCustom:{type:"Array<object>",writeback:!0},min:{type:"string|null"},readonly:{type:"boolean",binding:{consume:{name:"containerReadonly"}}},required:{type:"boolean"},requiredMessageDetail:{type:"string"},textAlign:{type:"string",enumValues:["end","start","right"]},userAssistanceDensity:{type:"string",enumValues:["compact","reflow","efficient"],binding:{consume:{name:"containerUserAssistanceDensity"}}},validators:{type:"Array<object>|null"},value:{type:"string|null",writeback:!0},rawValue:{type:"object",properties:{year:{type:"number"},month:{type:"number"},day:{type:"number"}},readOnly:!0,writeback:!0},valid:{type:"string",enumValues:["pending","valid","invalidHidden","invalidShown"],readOnly:!0,writeback:!0}},extension:{_WRITEBACK_PROPS:["messagesCustom","rawValue","valid","value"],_READ_ONLY_PROPS:["rawValue","valid"],_OBSERVED_GLOBAL_PROPS:["aria-describedby","id"]},methods:{blur:{},focus:{},showMessages:{},reset:{},validate:{}}},{columnSpan:1,disabled:!1,displayOptions:{messages:"display",validatorHint:"display"},help:{instruction:""},helpHints:{definition:"",source:""},messagesCustom:[],required:!1,validators:[],value:null},{"@oracle/oraclejet-preact":t.default},{consume:[n.FormVariantContext,o.TabbableModeContext]})})),define("oj-c/input-date-mask",["require","exports","oj-c/input-date-mask/input-date-mask"],(function(require,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InputDateMask=void 0,Object.defineProperty(e,"InputDateMask",{enumerable:!0,get:function(){return a.InputDateMask}})}));
|
|
2
2
|
//# sourceMappingURL=input-date-mask.js.map
|