@oracle/oraclejet-core-pack 14.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/Avatar.json +458 -0
- package/oj-c/Button.json +536 -0
- package/oj-c/Collapsible.json +396 -0
- package/oj-c/FilePicker.json +555 -0
- package/oj-c/InputNumber.json +1321 -0
- package/oj-c/InputPassword.json +1164 -0
- package/oj-c/InputText.json +1411 -0
- package/oj-c/ListItemLayout.json +313 -0
- package/oj-c/MessageToast.json +334 -0
- package/oj-c/MeterBar.json +735 -0
- package/oj-c/MeterCircle.json +797 -0
- package/oj-c/ProgressBar.json +212 -0
- package/oj-c/ProgressCircle.json +223 -0
- package/oj-c/RatingGauge.json +495 -0
- package/oj-c/SelectMultiple.json +1143 -0
- package/oj-c/SelectSingle.json +1450 -0
- package/oj-c/SplitMenuButton.json +495 -0
- package/oj-c/TextArea.json +1283 -0
- package/oj-c/avatar/__webdriver__/AvatarWebElement.js +32 -0
- package/oj-c/avatar/__webdriver__/AvatarWebElementBase.js +87 -0
- package/oj-c/avatar/__webdriver__/index.js +74 -0
- package/oj-c/avatar/avatar-styles.css +10 -0
- package/oj-c/avatar/avatar.js +27 -0
- package/oj-c/avatar/component.json +227 -0
- package/oj-c/avatar/index.js +6 -0
- package/oj-c/avatar.js +6 -0
- package/oj-c/button/__tests__/button.test.js +20 -0
- package/oj-c/button/__webdriver__/ButtonWebElement.js +96 -0
- package/oj-c/button/__webdriver__/ButtonWebElementBase.js +96 -0
- package/oj-c/button/__webdriver__/index.js +74 -0
- package/oj-c/button/button-styles.css +11 -0
- package/oj-c/button/button.js +71 -0
- package/oj-c/button/component.json +243 -0
- package/oj-c/button/index.js +6 -0
- package/oj-c/button.js +6 -0
- package/oj-c/collapsible/__webdriver__/CollapsibleWebElement.js +116 -0
- package/oj-c/collapsible/__webdriver__/CollapsibleWebElementBase.js +60 -0
- package/oj-c/collapsible/__webdriver__/index.js +74 -0
- package/oj-c/collapsible/collapsible-styles.css +11 -0
- package/oj-c/collapsible/collapsible.js +69 -0
- package/oj-c/collapsible/component.json +184 -0
- package/oj-c/collapsible/index.js +6 -0
- package/oj-c/collapsible.js +6 -0
- package/oj-c/component.json +104 -0
- package/oj-c/corepackbundle.js +4049 -0
- package/oj-c/docs/avatar.html +149 -0
- package/oj-c/docs/button.html +149 -0
- package/oj-c/docs/collapsible.html +149 -0
- package/oj-c/docs/file-picker.html +149 -0
- package/oj-c/docs/index.html +168 -0
- package/oj-c/docs/input-number.html +149 -0
- package/oj-c/docs/input-password.html +149 -0
- package/oj-c/docs/input-text.html +149 -0
- package/oj-c/docs/jsDocMd.json +1 -0
- package/oj-c/docs/list-item-layout.html +149 -0
- package/oj-c/docs/message-toast.html +149 -0
- package/oj-c/docs/meter-bar.html +149 -0
- package/oj-c/docs/meter-circle.html +149 -0
- package/oj-c/docs/oj-c.Avatar.html +1778 -0
- package/oj-c/docs/oj-c.Button.html +2065 -0
- package/oj-c/docs/oj-c.Collapsible.html +1990 -0
- package/oj-c/docs/oj-c.FilePicker.html +2380 -0
- package/oj-c/docs/oj-c.InputNumber.html +5850 -0
- package/oj-c/docs/oj-c.InputPassword.html +4891 -0
- package/oj-c/docs/oj-c.InputText.html +5772 -0
- package/oj-c/docs/oj-c.ListItemLayout.html +1549 -0
- package/oj-c/docs/oj-c.MessageToast.html +1574 -0
- package/oj-c/docs/oj-c.MeterBar.html +3193 -0
- package/oj-c/docs/oj-c.MeterCircle.html +3502 -0
- package/oj-c/docs/oj-c.ProgressBar.html +1122 -0
- package/oj-c/docs/oj-c.ProgressCircle.html +1138 -0
- package/oj-c/docs/oj-c.RatingGauge.html +2320 -0
- package/oj-c/docs/oj-c.SelectMultiple.html +4720 -0
- package/oj-c/docs/oj-c.SelectSingle.html +5920 -0
- package/oj-c/docs/oj-c.SplitMenuButton.html +1891 -0
- package/oj-c/docs/oj-c.TextArea.html +5447 -0
- package/oj-c/docs/progress-bar.html +149 -0
- package/oj-c/docs/progress-circle.html +149 -0
- package/oj-c/docs/rating-gauge.html +149 -0
- package/oj-c/docs/scripts/deprecated.js +268 -0
- package/oj-c/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/oj-c/docs/scripts/prettify/lang-css.js +9 -0
- package/oj-c/docs/scripts/prettify/prettify.js +35 -0
- package/oj-c/docs/select-multiple.html +149 -0
- package/oj-c/docs/select-single.html +149 -0
- package/oj-c/docs/split-menu-button.html +149 -0
- 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 +851 -0
- package/oj-c/docs/styles/prettify-jsdoc.css +111 -0
- package/oj-c/docs/styles/prettify-tomorrow.css +132 -0
- package/oj-c/docs/text-area.html +149 -0
- package/oj-c/editable-value/UNSAFE_useAssistiveText/useAssistiveText.js +57 -0
- package/oj-c/editable-value/UNSAFE_useComponentMessaging/useComponentMessaging.js +80 -0
- package/oj-c/editable-value/UNSAFE_useConverter/useConverter.js +56 -0
- package/oj-c/editable-value/UNSAFE_useConverterLifecycle/useConverterLifecycle.js +26 -0
- package/oj-c/editable-value/UNSAFE_useDeferredValidators/useDeferredValidators.js +22 -0
- package/oj-c/editable-value/UNSAFE_useEditableValue/useEditableValue.js +154 -0
- package/oj-c/editable-value/UNSAFE_useStaleIdentity/useStaleIdentity.js +17 -0
- package/oj-c/editable-value/UNSAFE_useValidationLifecycle/useValidationLifecycle.js +118 -0
- package/oj-c/editable-value/UNSAFE_useValidators/useValidators.js +153 -0
- package/oj-c/editable-value/UNSAFE_useValue/useValue.js +42 -0
- package/oj-c/editable-value/UNSAFE_useValueLifecycle/useValueLifecycle.js +27 -0
- package/oj-c/editable-value/component.json +9 -0
- package/oj-c/editable-value/utils/utils.js +31 -0
- package/oj-c/file-picker/__webdriver__/FilePickerWebElement.js +32 -0
- package/oj-c/file-picker/__webdriver__/FilePickerWebElementBase.js +87 -0
- package/oj-c/file-picker/__webdriver__/index.js +74 -0
- package/oj-c/file-picker/component.json +209 -0
- package/oj-c/file-picker/file-picker-styles.css +17 -0
- package/oj-c/file-picker/file-picker.js +59 -0
- package/oj-c/file-picker/index.js +6 -0
- package/oj-c/file-picker.js +6 -0
- package/oj-c/hooks/UNSAFE_useDataProvider/DataProviderHandler.js +89 -0
- package/oj-c/hooks/UNSAFE_useDataProvider/useDataProvider.js +25 -0
- package/oj-c/hooks/UNSAFE_useDataProvider/utils.js +202 -0
- package/oj-c/hooks/UNSAFE_useListData/__tests__/useListData.test.js +124 -0
- package/oj-c/hooks/UNSAFE_useListData/useListData.js +297 -0
- package/oj-c/hooks/UNSAFE_useTreeData/__tests__/useTreeData.test.js +62 -0
- package/oj-c/hooks/UNSAFE_useTreeData/useTreeData.js +130 -0
- package/oj-c/hooks/component.json +9 -0
- package/oj-c/input-number/__dev__/input-number.doc.mdx +31 -0
- package/oj-c/input-number/__webdriver__/InputNumberWebElement.js +32 -0
- package/oj-c/input-number/__webdriver__/InputNumberWebElementBase.js +339 -0
- package/oj-c/input-number/__webdriver__/index.js +74 -0
- package/oj-c/input-number/component.json +536 -0
- package/oj-c/input-number/index.js +6 -0
- package/oj-c/input-number/input-number-styles.css +13 -0
- package/oj-c/input-number/input-number.js +119 -0
- package/oj-c/input-number/stepBasisUtils.js +76 -0
- package/oj-c/input-number/useImplicitNumberConverter.js +12 -0
- package/oj-c/input-number/useImplicitNumberRangeValidator.js +28 -0
- package/oj-c/input-number/useNumberInputTextPreact.js +153 -0
- package/oj-c/input-number.js +6 -0
- package/oj-c/input-password/__webdriver__/InputPasswordWebElement.js +32 -0
- package/oj-c/input-password/__webdriver__/InputPasswordWebElementBase.js +258 -0
- package/oj-c/input-password/__webdriver__/index.js +74 -0
- package/oj-c/input-password/component.json +488 -0
- package/oj-c/input-password/index.js +6 -0
- package/oj-c/input-password/input-password-styles.css +13 -0
- package/oj-c/input-password/input-password.js +112 -0
- package/oj-c/input-password/useInputPasswordPreact.js +46 -0
- package/oj-c/input-password.js +6 -0
- package/oj-c/input-text/__dev__/input-text.doc.mdx +30 -0
- package/oj-c/input-text/__tests__/input-text.test.js +70 -0
- package/oj-c/input-text/__webdriver__/InputTextWebElement.js +32 -0
- package/oj-c/input-text/__webdriver__/InputTextWebElementBase.js +294 -0
- package/oj-c/input-text/__webdriver__/index.js +74 -0
- package/oj-c/input-text/component.json +580 -0
- package/oj-c/input-text/index.js +6 -0
- package/oj-c/input-text/input-text-styles.css +13 -0
- package/oj-c/input-text/input-text.js +118 -0
- package/oj-c/input-text/useInputTextPreact.js +46 -0
- package/oj-c/input-text.js +6 -0
- package/oj-c/list-item-layout/__webdriver__/ListItemLayoutWebElement.js +32 -0
- package/oj-c/list-item-layout/__webdriver__/ListItemLayoutWebElementBase.js +42 -0
- package/oj-c/list-item-layout/__webdriver__/index.js +74 -0
- package/oj-c/list-item-layout/component.json +139 -0
- package/oj-c/list-item-layout/index.js +6 -0
- package/oj-c/list-item-layout/list-item-layout-styles.css +12 -0
- package/oj-c/list-item-layout/list-item-layout.js +30 -0
- package/oj-c/list-item-layout.js +6 -0
- package/oj-c/message-toast/__webdriver__/MessageToastWebElement.js +32 -0
- package/oj-c/message-toast/__webdriver__/MessageToastWebElementBase.js +78 -0
- package/oj-c/message-toast/__webdriver__/index.js +74 -0
- package/oj-c/message-toast/component.json +244 -0
- package/oj-c/message-toast/index.js +6 -0
- package/oj-c/message-toast/message-toast-styles.css +8 -0
- package/oj-c/message-toast/message-toast.js +35 -0
- package/oj-c/message-toast.js +6 -0
- package/oj-c/metadata/allComponents.json +5552 -0
- package/oj-c/meter-bar/__webdriver__/MeterBarWebElement.js +32 -0
- package/oj-c/meter-bar/__webdriver__/MeterBarWebElementBase.js +195 -0
- package/oj-c/meter-bar/__webdriver__/index.js +74 -0
- package/oj-c/meter-bar/component.json +246 -0
- package/oj-c/meter-bar/index.js +6 -0
- package/oj-c/meter-bar/meter-bar-styles.css +21 -0
- package/oj-c/meter-bar/meter-bar.js +44 -0
- package/oj-c/meter-bar.js +6 -0
- package/oj-c/meter-circle/__webdriver__/MeterCircleWebElement.js +32 -0
- package/oj-c/meter-circle/__webdriver__/MeterCircleWebElementBase.js +213 -0
- package/oj-c/meter-circle/__webdriver__/index.js +74 -0
- package/oj-c/meter-circle/component.json +289 -0
- package/oj-c/meter-circle/index.js +6 -0
- package/oj-c/meter-circle/meter-circle-styles.css +14 -0
- package/oj-c/meter-circle/meter-circle.js +47 -0
- package/oj-c/meter-circle.js +6 -0
- package/oj-c/min/avatar/avatar-styles.css +10 -0
- package/oj-c/min/avatar.js +2 -0
- package/oj-c/min/avatar.js.map +1 -0
- package/oj-c/min/button/button-styles.css +11 -0
- package/oj-c/min/button.js +2 -0
- package/oj-c/min/button.js.map +1 -0
- package/oj-c/min/collapsible/collapsible-styles.css +11 -0
- package/oj-c/min/collapsible.js +2 -0
- package/oj-c/min/collapsible.js.map +1 -0
- package/oj-c/min/corepackbundle.css +226 -0
- package/oj-c/min/corepackbundle.js +6 -0
- package/oj-c/min/corepackbundle.js.map +1 -0
- package/oj-c/min/editable-value/UNSAFE_useAssistiveText/useAssistiveText.d.ts +32 -0
- package/oj-c/min/editable-value/UNSAFE_useAssistiveText/useAssistiveText.js +57 -0
- package/oj-c/min/editable-value/UNSAFE_useComponentMessaging/useComponentMessaging.d.ts +24 -0
- package/oj-c/min/editable-value/UNSAFE_useComponentMessaging/useComponentMessaging.js +80 -0
- package/oj-c/min/editable-value/UNSAFE_useConverter/useConverter.d.ts +14 -0
- package/oj-c/min/editable-value/UNSAFE_useConverter/useConverter.js +56 -0
- package/oj-c/min/editable-value/UNSAFE_useConverterLifecycle/useConverterLifecycle.d.ts +11 -0
- package/oj-c/min/editable-value/UNSAFE_useConverterLifecycle/useConverterLifecycle.js +26 -0
- package/oj-c/min/editable-value/UNSAFE_useDeferredValidators/useDeferredValidators.d.ts +8 -0
- package/oj-c/min/editable-value/UNSAFE_useDeferredValidators/useDeferredValidators.js +22 -0
- package/oj-c/min/editable-value/UNSAFE_useEditableValue/useEditableValue.d.ts +47 -0
- package/oj-c/min/editable-value/UNSAFE_useEditableValue/useEditableValue.js +154 -0
- package/oj-c/min/editable-value/UNSAFE_useStaleIdentity/useStaleIdentity.d.ts +5 -0
- package/oj-c/min/editable-value/UNSAFE_useStaleIdentity/useStaleIdentity.js +17 -0
- package/oj-c/min/editable-value/UNSAFE_useValidationLifecycle/useValidationLifecycle.d.ts +15 -0
- package/oj-c/min/editable-value/UNSAFE_useValidationLifecycle/useValidationLifecycle.js +118 -0
- package/oj-c/min/editable-value/UNSAFE_useValidators/useValidators.d.ts +35 -0
- package/oj-c/min/editable-value/UNSAFE_useValidators/useValidators.js +153 -0
- package/oj-c/min/editable-value/UNSAFE_useValue/useValue.d.ts +23 -0
- package/oj-c/min/editable-value/UNSAFE_useValue/useValue.js +42 -0
- package/oj-c/min/editable-value/UNSAFE_useValueLifecycle/useValueLifecycle.d.ts +9 -0
- package/oj-c/min/editable-value/UNSAFE_useValueLifecycle/useValueLifecycle.js +27 -0
- package/oj-c/min/editable-value/component.json +9 -0
- package/oj-c/min/editable-value/utils/utils.d.ts +6 -0
- package/oj-c/min/editable-value/utils/utils.js +31 -0
- package/oj-c/min/file-picker/file-picker-styles.css +17 -0
- package/oj-c/min/file-picker.js +2 -0
- package/oj-c/min/file-picker.js.map +1 -0
- package/oj-c/min/hooks/UNSAFE_useDataProvider/DataProviderHandler.d.ts +18 -0
- package/oj-c/min/hooks/UNSAFE_useDataProvider/DataProviderHandler.js +89 -0
- package/oj-c/min/hooks/UNSAFE_useDataProvider/useDataProvider.d.ts +10 -0
- package/oj-c/min/hooks/UNSAFE_useDataProvider/useDataProvider.js +25 -0
- package/oj-c/min/hooks/UNSAFE_useDataProvider/utils.d.ts +3 -0
- package/oj-c/min/hooks/UNSAFE_useDataProvider/utils.js +202 -0
- package/oj-c/min/hooks/UNSAFE_useListData/__tests__/useListData.test.d.ts +1 -0
- package/oj-c/min/hooks/UNSAFE_useListData/__tests__/useListData.test.js +124 -0
- package/oj-c/min/hooks/UNSAFE_useListData/useListData.d.ts +21 -0
- package/oj-c/min/hooks/UNSAFE_useListData/useListData.js +297 -0
- package/oj-c/min/hooks/UNSAFE_useTreeData/__tests__/useTreeData.test.d.ts +1 -0
- package/oj-c/min/hooks/UNSAFE_useTreeData/__tests__/useTreeData.test.js +62 -0
- package/oj-c/min/hooks/UNSAFE_useTreeData/useTreeData.d.ts +27 -0
- package/oj-c/min/hooks/UNSAFE_useTreeData/useTreeData.js +130 -0
- package/oj-c/min/hooks/component.json +9 -0
- package/oj-c/min/input-number/input-number-styles.css +13 -0
- package/oj-c/min/input-number.js +2 -0
- package/oj-c/min/input-number.js.map +1 -0
- package/oj-c/min/input-password/input-password-styles.css +13 -0
- package/oj-c/min/input-password.js +2 -0
- package/oj-c/min/input-password.js.map +1 -0
- package/oj-c/min/input-text/input-text-styles.css +13 -0
- package/oj-c/min/input-text.js +2 -0
- package/oj-c/min/input-text.js.map +1 -0
- package/oj-c/min/list-item-layout/list-item-layout-styles.css +12 -0
- package/oj-c/min/list-item-layout.js +2 -0
- package/oj-c/min/list-item-layout.js.map +1 -0
- package/oj-c/min/message-toast/message-toast-styles.css +8 -0
- package/oj-c/min/message-toast.js +2 -0
- package/oj-c/min/message-toast.js.map +1 -0
- package/oj-c/min/meter-bar/meter-bar-styles.css +21 -0
- package/oj-c/min/meter-bar.js +2 -0
- package/oj-c/min/meter-bar.js.map +1 -0
- package/oj-c/min/meter-circle/meter-circle-styles.css +14 -0
- package/oj-c/min/meter-circle.js +2 -0
- package/oj-c/min/meter-circle.js.map +1 -0
- package/oj-c/min/progress-bar/progress-bar-styles.css +11 -0
- package/oj-c/min/progress-bar.js +2 -0
- package/oj-c/min/progress-bar.js.map +1 -0
- package/oj-c/min/progress-circle/progress-circle-styles.css +14 -0
- package/oj-c/min/progress-circle.js +2 -0
- package/oj-c/min/progress-circle.js.map +1 -0
- package/oj-c/min/rating-gauge/rating-gauge-styles.css +12 -0
- package/oj-c/min/rating-gauge.js +2 -0
- package/oj-c/min/rating-gauge.js.map +1 -0
- package/oj-c/min/select-common/UNSAFE_useDataProviderListeners/index.d.ts +2 -0
- package/oj-c/min/select-common/UNSAFE_useDataProviderListeners/index.js +6 -0
- package/oj-c/min/select-common/UNSAFE_useDataProviderListeners/useDataProviderListeners.d.ts +13 -0
- package/oj-c/min/select-common/UNSAFE_useDataProviderListeners/useDataProviderListeners.js +96 -0
- package/oj-c/min/select-common/UNSAFE_useWrapDataProvider/index.d.ts +1 -0
- package/oj-c/min/select-common/UNSAFE_useWrapDataProvider/index.js +6 -0
- package/oj-c/min/select-common/UNSAFE_useWrapDataProvider/useWrapDataProvider.d.ts +3 -0
- package/oj-c/min/select-common/UNSAFE_useWrapDataProvider/useWrapDataProvider.js +16 -0
- package/oj-c/min/select-common/UNSAFE_useWrapValueState/index.d.ts +1 -0
- package/oj-c/min/select-common/UNSAFE_useWrapValueState/index.js +6 -0
- package/oj-c/min/select-common/UNSAFE_useWrapValueState/useWrapValueState.d.ts +23 -0
- package/oj-c/min/select-common/UNSAFE_useWrapValueState/useWrapValueState.js +23 -0
- package/oj-c/min/select-common/component.json +9 -0
- package/oj-c/min/select-common/utils/utils.d.ts +10 -0
- package/oj-c/min/select-common/utils/utils.js +19 -0
- package/oj-c/min/select-multiple/select-multiple-styles.css +13 -0
- package/oj-c/min/select-multiple.js +3 -0
- package/oj-c/min/select-multiple.js.map +1 -0
- package/oj-c/min/select-single/select-single-styles.css +22 -0
- package/oj-c/min/select-single.js +3 -0
- package/oj-c/min/select-single.js.map +1 -0
- package/oj-c/min/split-menu-button/split-menu-button-styles.css +11 -0
- package/oj-c/min/split-menu-button.js +2 -0
- package/oj-c/min/split-menu-button.js.map +1 -0
- package/oj-c/min/text-area/text-area-styles.css +13 -0
- package/oj-c/min/text-area.js +2 -0
- package/oj-c/min/text-area.js.map +1 -0
- package/oj-c/min/utils/UNSAFE_focusTabUtils/focusUtils.d.ts +2 -0
- package/oj-c/min/utils/UNSAFE_focusTabUtils/focusUtils.js +23 -0
- package/oj-c/min/utils/UNSAFE_focusTabUtils/index.d.ts +1 -0
- package/oj-c/min/utils/UNSAFE_focusTabUtils/index.js +6 -0
- package/oj-c/min/utils/UNSAFE_keyUtils/index.d.ts +1 -0
- package/oj-c/min/utils/UNSAFE_keyUtils/index.js +19 -0
- package/oj-c/min/utils/UNSAFE_keyUtils/keySetUtils.d.ts +4 -0
- package/oj-c/min/utils/UNSAFE_keyUtils/keySetUtils.js +33 -0
- package/oj-c/min/utils/UNSAFE_meterUtils/index.d.ts +1 -0
- package/oj-c/min/utils/UNSAFE_meterUtils/index.js +6 -0
- package/oj-c/min/utils/UNSAFE_meterUtils/meterUtils.d.ts +2 -0
- package/oj-c/min/utils/UNSAFE_meterUtils/meterUtils.js +12 -0
- package/oj-c/min/utils/component.json +9 -0
- package/oj-c/progress-bar/__webdriver__/ProgressBarWebElement.js +32 -0
- package/oj-c/progress-bar/__webdriver__/ProgressBarWebElementBase.js +60 -0
- package/oj-c/progress-bar/__webdriver__/index.js +74 -0
- package/oj-c/progress-bar/component.json +123 -0
- package/oj-c/progress-bar/index.js +6 -0
- package/oj-c/progress-bar/progress-bar-styles.css +11 -0
- package/oj-c/progress-bar/progress-bar.js +26 -0
- package/oj-c/progress-bar.js +6 -0
- package/oj-c/progress-circle/__webdriver__/ProgressCircleWebElement.js +32 -0
- package/oj-c/progress-circle/__webdriver__/ProgressCircleWebElementBase.js +60 -0
- package/oj-c/progress-circle/__webdriver__/index.js +74 -0
- package/oj-c/progress-circle/component.json +128 -0
- package/oj-c/progress-circle/index.js +6 -0
- package/oj-c/progress-circle/progress-circle-styles.css +14 -0
- package/oj-c/progress-circle/progress-circle.js +26 -0
- package/oj-c/progress-circle.js +6 -0
- package/oj-c/rating-gauge/__webdriver__/RatingGaugeWebElement.js +32 -0
- package/oj-c/rating-gauge/__webdriver__/RatingGaugeWebElementBase.js +168 -0
- package/oj-c/rating-gauge/__webdriver__/index.js +74 -0
- package/oj-c/rating-gauge/component.json +188 -0
- package/oj-c/rating-gauge/index.js +6 -0
- package/oj-c/rating-gauge/rating-gauge-styles.css +12 -0
- package/oj-c/rating-gauge/rating-gauge.js +44 -0
- package/oj-c/rating-gauge.js +6 -0
- package/oj-c/select-common/UNSAFE_useDataProviderListeners/index.js +6 -0
- package/oj-c/select-common/UNSAFE_useDataProviderListeners/useDataProviderListeners.js +96 -0
- package/oj-c/select-common/UNSAFE_useWrapDataProvider/index.js +6 -0
- package/oj-c/select-common/UNSAFE_useWrapDataProvider/useWrapDataProvider.js +16 -0
- package/oj-c/select-common/UNSAFE_useWrapValueState/index.js +6 -0
- package/oj-c/select-common/UNSAFE_useWrapValueState/useWrapValueState.js +23 -0
- package/oj-c/select-common/component.json +9 -0
- package/oj-c/select-common/utils/utils.js +19 -0
- package/oj-c/select-multiple/__dev__/select-multiple.doc.mdx +30 -0
- package/oj-c/select-multiple/__webdriver__/SelectMultipleWebElement.js +32 -0
- package/oj-c/select-multiple/__webdriver__/SelectMultipleWebElementBase.js +258 -0
- package/oj-c/select-multiple/__webdriver__/index.js +74 -0
- package/oj-c/select-multiple/component.json +475 -0
- package/oj-c/select-multiple/index.js +6 -0
- package/oj-c/select-multiple/select-multiple-styles.css +13 -0
- package/oj-c/select-multiple/select-multiple.js +108 -0
- package/oj-c/select-multiple/useSelectMultiplePreact.js +123 -0
- package/oj-c/select-multiple/useSyncValueAndValueItems.js +125 -0
- package/oj-c/select-multiple/useValueItems.js +22 -0
- package/oj-c/select-multiple.js +6 -0
- package/oj-c/select-single/__dev__/select-single.doc.mdx +30 -0
- package/oj-c/select-single/__webdriver__/SelectSingleWebElement.js +32 -0
- package/oj-c/select-single/__webdriver__/SelectSingleWebElementBase.js +258 -0
- package/oj-c/select-single/__webdriver__/index.js +74 -0
- package/oj-c/select-single/component.json +545 -0
- package/oj-c/select-single/index.js +6 -0
- package/oj-c/select-single/select-single-styles.css +22 -0
- package/oj-c/select-single/select-single.js +108 -0
- package/oj-c/select-single/useSelectSinglePreact.js +157 -0
- package/oj-c/select-single/useSyncValueAndValueItem.js +110 -0
- package/oj-c/select-single/useValueItem.js +18 -0
- package/oj-c/select-single.js +6 -0
- package/oj-c/split-menu-button/__dev__/split-menu-button.doc.mdx +32 -0
- package/oj-c/split-menu-button/__tests__/split-menu-button.test.js +17 -0
- package/oj-c/split-menu-button/__webdriver__/SplitMenuButtonWebElement.js +32 -0
- package/oj-c/split-menu-button/__webdriver__/SplitMenuButtonWebElementBase.js +87 -0
- package/oj-c/split-menu-button/__webdriver__/index.js +74 -0
- package/oj-c/split-menu-button/component.json +205 -0
- package/oj-c/split-menu-button/index.js +6 -0
- package/oj-c/split-menu-button/split-menu-button-styles.css +11 -0
- package/oj-c/split-menu-button/split-menu-button.js +76 -0
- package/oj-c/split-menu-button.js +6 -0
- package/oj-c/text-area/__webdriver__/TextAreaWebElement.js +32 -0
- package/oj-c/text-area/__webdriver__/TextAreaWebElementBase.js +285 -0
- package/oj-c/text-area/__webdriver__/index.js +74 -0
- package/oj-c/text-area/component.json +497 -0
- package/oj-c/text-area/index.js +6 -0
- package/oj-c/text-area/text-area-styles.css +13 -0
- package/oj-c/text-area/text-area.js +138 -0
- package/oj-c/text-area/useTextAreaAutosizePreact.js +44 -0
- package/oj-c/text-area/useTextAreaPreact.js +46 -0
- package/oj-c/text-area.js +6 -0
- package/oj-c/types/avatar/avatar.d.ts +68 -0
- package/oj-c/types/avatar/index.d.ts +2 -0
- package/oj-c/types/button/__tests__/button.test.d.ts +1 -0
- package/oj-c/types/button/button.d.ts +91 -0
- package/oj-c/types/button/index.d.ts +2 -0
- package/oj-c/types/collapsible/collapsible.d.ts +88 -0
- package/oj-c/types/collapsible/index.d.ts +2 -0
- package/oj-c/types/editable-value/UNSAFE_useAssistiveText/useAssistiveText.d.ts +32 -0
- package/oj-c/types/editable-value/UNSAFE_useComponentMessaging/useComponentMessaging.d.ts +24 -0
- package/oj-c/types/editable-value/UNSAFE_useConverter/useConverter.d.ts +14 -0
- package/oj-c/types/editable-value/UNSAFE_useConverterLifecycle/useConverterLifecycle.d.ts +11 -0
- package/oj-c/types/editable-value/UNSAFE_useDeferredValidators/useDeferredValidators.d.ts +8 -0
- package/oj-c/types/editable-value/UNSAFE_useEditableValue/useEditableValue.d.ts +47 -0
- package/oj-c/types/editable-value/UNSAFE_useStaleIdentity/useStaleIdentity.d.ts +5 -0
- package/oj-c/types/editable-value/UNSAFE_useValidationLifecycle/useValidationLifecycle.d.ts +15 -0
- package/oj-c/types/editable-value/UNSAFE_useValidators/useValidators.d.ts +35 -0
- package/oj-c/types/editable-value/UNSAFE_useValue/useValue.d.ts +23 -0
- package/oj-c/types/editable-value/UNSAFE_useValueLifecycle/useValueLifecycle.d.ts +9 -0
- package/oj-c/types/editable-value/utils/utils.d.ts +6 -0
- package/oj-c/types/file-picker/file-picker.d.ts +103 -0
- package/oj-c/types/file-picker/index.d.ts +2 -0
- package/oj-c/types/hooks/UNSAFE_useDataProvider/DataProviderHandler.d.ts +18 -0
- package/oj-c/types/hooks/UNSAFE_useDataProvider/useDataProvider.d.ts +10 -0
- package/oj-c/types/hooks/UNSAFE_useDataProvider/utils.d.ts +3 -0
- package/oj-c/types/hooks/UNSAFE_useListData/__tests__/useListData.test.d.ts +1 -0
- package/oj-c/types/hooks/UNSAFE_useListData/useListData.d.ts +21 -0
- package/oj-c/types/hooks/UNSAFE_useTreeData/__tests__/useTreeData.test.d.ts +1 -0
- package/oj-c/types/hooks/UNSAFE_useTreeData/useTreeData.d.ts +27 -0
- package/oj-c/types/input-number/index.d.ts +2 -0
- package/oj-c/types/input-number/input-number.d.ts +231 -0
- package/oj-c/types/input-number/stepBasisUtils.d.ts +1 -0
- package/oj-c/types/input-number/useImplicitNumberConverter.d.ts +10 -0
- package/oj-c/types/input-number/useImplicitNumberRangeValidator.d.ts +17 -0
- package/oj-c/types/input-number/useNumberInputTextPreact.d.ts +54 -0
- package/oj-c/types/input-password/index.d.ts +2 -0
- package/oj-c/types/input-password/input-password.d.ts +183 -0
- package/oj-c/types/input-password/useInputPasswordPreact.d.ts +40 -0
- package/oj-c/types/input-text/__tests__/input-text.test.d.ts +1 -0
- package/oj-c/types/input-text/index.d.ts +2 -0
- package/oj-c/types/input-text/input-text.d.ts +212 -0
- package/oj-c/types/input-text/useInputTextPreact.d.ts +47 -0
- package/oj-c/types/list-item-layout/index.d.ts +2 -0
- package/oj-c/types/list-item-layout/list-item-layout.d.ts +53 -0
- package/oj-c/types/message-toast/index.d.ts +2 -0
- package/oj-c/types/message-toast/message-toast.d.ts +83 -0
- package/oj-c/types/meter-bar/index.d.ts +2 -0
- package/oj-c/types/meter-bar/meter-bar.d.ts +133 -0
- package/oj-c/types/meter-circle/index.d.ts +2 -0
- package/oj-c/types/meter-circle/meter-circle.d.ts +148 -0
- package/oj-c/types/progress-bar/index.d.ts +2 -0
- package/oj-c/types/progress-bar/progress-bar.d.ts +53 -0
- package/oj-c/types/progress-circle/index.d.ts +2 -0
- package/oj-c/types/progress-circle/progress-circle.d.ts +53 -0
- package/oj-c/types/rating-gauge/index.d.ts +2 -0
- package/oj-c/types/rating-gauge/rating-gauge.d.ts +109 -0
- package/oj-c/types/select-common/UNSAFE_useDataProviderListeners/index.d.ts +2 -0
- package/oj-c/types/select-common/UNSAFE_useDataProviderListeners/useDataProviderListeners.d.ts +13 -0
- package/oj-c/types/select-common/UNSAFE_useWrapDataProvider/index.d.ts +1 -0
- package/oj-c/types/select-common/UNSAFE_useWrapDataProvider/useWrapDataProvider.d.ts +3 -0
- package/oj-c/types/select-common/UNSAFE_useWrapValueState/index.d.ts +1 -0
- package/oj-c/types/select-common/UNSAFE_useWrapValueState/useWrapValueState.d.ts +23 -0
- package/oj-c/types/select-common/utils/utils.d.ts +10 -0
- package/oj-c/types/select-multiple/index.d.ts +2 -0
- package/oj-c/types/select-multiple/select-multiple.d.ts +176 -0
- package/oj-c/types/select-multiple/useSelectMultiplePreact.d.ts +42 -0
- package/oj-c/types/select-multiple/useSyncValueAndValueItems.d.ts +17 -0
- package/oj-c/types/select-multiple/useValueItems.d.ts +6 -0
- package/oj-c/types/select-single/index.d.ts +2 -0
- package/oj-c/types/select-single/select-single.d.ts +186 -0
- package/oj-c/types/select-single/useSelectSinglePreact.d.ts +42 -0
- package/oj-c/types/select-single/useSyncValueAndValueItem.d.ts +17 -0
- package/oj-c/types/select-single/useValueItem.d.ts +5 -0
- package/oj-c/types/split-menu-button/__tests__/split-menu-button.test.d.ts +1 -0
- package/oj-c/types/split-menu-button/index.d.ts +2 -0
- package/oj-c/types/split-menu-button/split-menu-button.d.ts +93 -0
- package/oj-c/types/text-area/index.d.ts +2 -0
- package/oj-c/types/text-area/text-area.d.ts +209 -0
- package/oj-c/types/text-area/useTextAreaAutosizePreact.d.ts +44 -0
- package/oj-c/types/text-area/useTextAreaPreact.d.ts +44 -0
- package/oj-c/types/utils/UNSAFE_focusTabUtils/focusUtils.d.ts +2 -0
- package/oj-c/types/utils/UNSAFE_focusTabUtils/index.d.ts +1 -0
- package/oj-c/types/utils/UNSAFE_keyUtils/index.d.ts +1 -0
- package/oj-c/types/utils/UNSAFE_keyUtils/keySetUtils.d.ts +4 -0
- package/oj-c/types/utils/UNSAFE_meterUtils/index.d.ts +1 -0
- package/oj-c/types/utils/UNSAFE_meterUtils/meterUtils.d.ts +2 -0
- package/oj-c/utils/UNSAFE_focusTabUtils/focusUtils.js +23 -0
- package/oj-c/utils/UNSAFE_focusTabUtils/index.js +6 -0
- package/oj-c/utils/UNSAFE_keyUtils/index.js +19 -0
- package/oj-c/utils/UNSAFE_keyUtils/keySetUtils.js +33 -0
- package/oj-c/utils/UNSAFE_meterUtils/index.js +6 -0
- package/oj-c/utils/UNSAFE_meterUtils/meterUtils.js +12 -0
- package/oj-c/utils/component.json +9 -0
- package/package.json +22 -0
- package/webdriver/docs/.nojekyll +1 -0
- package/webdriver/docs/assets/highlight.css +78 -0
- package/webdriver/docs/assets/icons.css +1043 -0
- package/webdriver/docs/assets/icons.png +0 -0
- package/webdriver/docs/assets/icons@2x.png +0 -0
- package/webdriver/docs/assets/main.js +52 -0
- package/webdriver/docs/assets/search.js +1 -0
- package/webdriver/docs/assets/style.css +1414 -0
- package/webdriver/docs/assets/widgets.png +0 -0
- package/webdriver/docs/assets/widgets@2x.png +0 -0
- package/webdriver/docs/classes/AvatarWebElement.html +117 -0
- package/webdriver/docs/classes/ButtonWebElement.html +163 -0
- package/webdriver/docs/classes/CollapsibleWebElement.html +111 -0
- package/webdriver/docs/classes/FilePickerWebElement.html +117 -0
- package/webdriver/docs/classes/InputNumberWebElement.html +231 -0
- package/webdriver/docs/classes/InputPasswordWebElement.html +195 -0
- package/webdriver/docs/classes/InputTextWebElement.html +211 -0
- package/webdriver/docs/classes/ListItemLayoutWebElement.html +97 -0
- package/webdriver/docs/classes/MessageToastWebElement.html +113 -0
- package/webdriver/docs/classes/MeterBarWebElement.html +153 -0
- package/webdriver/docs/classes/MeterCircleWebElement.html +159 -0
- package/webdriver/docs/classes/ProgressBarWebElement.html +105 -0
- package/webdriver/docs/classes/ProgressCircleWebElement.html +105 -0
- package/webdriver/docs/classes/RatingGaugeWebElement.html +147 -0
- package/webdriver/docs/classes/SelectMultipleWebElement.html +196 -0
- package/webdriver/docs/classes/SelectSingleWebElement.html +196 -0
- package/webdriver/docs/classes/SplitMenuButtonWebElement.html +117 -0
- package/webdriver/docs/classes/TextAreaWebElement.html +207 -0
- package/webdriver/docs/index.html +16 -0
- package/webdriver/docs/modules.html +181 -0
- package/webdriver/index.js +34 -0
- package/webdriver/index.ts +18 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
exports.__esModule = true;
|
|
18
|
+
exports.FilePickerWebElementBase = void 0;
|
|
19
|
+
var elements_1 = require("@oracle/oraclejet-webdriver/elements");
|
|
20
|
+
/**
|
|
21
|
+
* This is the base class for oj-c-file-picker WebElement, and is generated from the
|
|
22
|
+
* component's metadata. Do not modify these contents since they'll be replaced
|
|
23
|
+
* during the next generation.
|
|
24
|
+
* Put overrides into the WebElements's subclass, FilePickerWebElement.ts.
|
|
25
|
+
*/
|
|
26
|
+
var FilePickerWebElementBase = /** @class */ (function (_super) {
|
|
27
|
+
__extends(FilePickerWebElementBase, _super);
|
|
28
|
+
function FilePickerWebElementBase() {
|
|
29
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Gets the value of <code>accept</code> property.
|
|
33
|
+
* An array of strings of allowed MIME types or file extensions that can be uploaded. If not specified, accept all file types
|
|
34
|
+
* @return The value of <code>accept</code> property.
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
FilePickerWebElementBase.prototype.getAccept = function () {
|
|
38
|
+
return this.getProperty('accept');
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Gets the value of <code>capture</code> property.
|
|
42
|
+
* Specifies the preferred facing mode for the device's media capture mechanism.
|
|
43
|
+
* @return The value of <code>capture</code> property.
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
FilePickerWebElementBase.prototype.getCapture = function () {
|
|
47
|
+
return this.getProperty('capture');
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Gets the value of <code>disabled</code> property.
|
|
51
|
+
* Disables the filepicker if set to true
|
|
52
|
+
* @return The value of <code>disabled</code> property.
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
FilePickerWebElementBase.prototype.getDisabled = function () {
|
|
56
|
+
return this.getProperty('disabled');
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Gets the value of <code>primaryText</code> property.
|
|
60
|
+
* The primary text for the default file picker.
|
|
61
|
+
* @return The value of <code>primaryText</code> property.
|
|
62
|
+
*
|
|
63
|
+
*/
|
|
64
|
+
FilePickerWebElementBase.prototype.getPrimaryText = function () {
|
|
65
|
+
return this.getProperty('primaryText');
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Gets the value of <code>secondaryText</code> property.
|
|
69
|
+
* The secondary text for the default file picker.
|
|
70
|
+
* @return The value of <code>secondaryText</code> property.
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
FilePickerWebElementBase.prototype.getSecondaryText = function () {
|
|
74
|
+
return this.getProperty('secondaryText');
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Gets the value of <code>selectionMode</code> property.
|
|
78
|
+
* Whether to allow single or multiple file selection.
|
|
79
|
+
* @return The value of <code>selectionMode</code> property.
|
|
80
|
+
*
|
|
81
|
+
*/
|
|
82
|
+
FilePickerWebElementBase.prototype.getSelectionMode = function () {
|
|
83
|
+
return this.getProperty('selectionMode');
|
|
84
|
+
};
|
|
85
|
+
return FilePickerWebElementBase;
|
|
86
|
+
}(elements_1.OjWebElement));
|
|
87
|
+
exports.FilePickerWebElementBase = FilePickerWebElementBase;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.__esModule = true;
|
|
39
|
+
exports.findFilePicker = exports.FilePickerWebElement = void 0;
|
|
40
|
+
var oraclejet_webdriver_1 = require("@oracle/oraclejet-webdriver");
|
|
41
|
+
var FilePickerWebElement_1 = require("./FilePickerWebElement");
|
|
42
|
+
exports.FilePickerWebElement = FilePickerWebElement_1.FilePickerWebElement;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieve an instance of [[FilePickerWebElement]].
|
|
45
|
+
* @example
|
|
46
|
+
* ```javascript
|
|
47
|
+
* import { findFilePicker } from '@oracle/oraclejet-core-pack/webdriver';
|
|
48
|
+
* const el = await findFilePicker(driver, By.id('my-oj-c-file-picker'));
|
|
49
|
+
* ```
|
|
50
|
+
* @param driver A WebDriver/WebElement instance from where the element will be
|
|
51
|
+
* searched. If WebDriver is passed, the element will be searched globally in the
|
|
52
|
+
* document. If WebElement is passed, the search will be relative to this element.
|
|
53
|
+
* @param by The locator with which to find the element
|
|
54
|
+
*/
|
|
55
|
+
function findFilePicker(driver, by) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
+
var webEl, tagName;
|
|
58
|
+
return __generator(this, function (_a) {
|
|
59
|
+
switch (_a.label) {
|
|
60
|
+
case 0: return [4 /*yield*/, driver.findElement(by)];
|
|
61
|
+
case 1:
|
|
62
|
+
webEl = _a.sent();
|
|
63
|
+
if (!!(webEl instanceof FilePickerWebElement_1.FilePickerWebElement)) return [3 /*break*/, 3];
|
|
64
|
+
return [4 /*yield*/, webEl.getTagName()];
|
|
65
|
+
case 2:
|
|
66
|
+
tagName = _a.sent();
|
|
67
|
+
throw Error("findFilePicker(".concat(by, ") created ").concat(webEl.constructor.name, " for <").concat(tagName, ">, but expected ").concat(FilePickerWebElement_1.FilePickerWebElement.name));
|
|
68
|
+
case 3: return [2 /*return*/, webEl];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
exports.findFilePicker = findFilePicker;
|
|
74
|
+
(0, oraclejet_webdriver_1.register)('oj-c-file-picker', FilePickerWebElement_1.FilePickerWebElement);
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "file-picker",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"jetVersion": "^14.0.0",
|
|
5
|
+
"type": "composite",
|
|
6
|
+
"pack": "oj-c",
|
|
7
|
+
"implements": [
|
|
8
|
+
"CFilePickerElement"
|
|
9
|
+
],
|
|
10
|
+
"properties": {
|
|
11
|
+
"accept": {
|
|
12
|
+
"type": "Array<string>",
|
|
13
|
+
"description": "An array of strings of allowed MIME types or file extensions that can be uploaded. If not specified, accept all file types",
|
|
14
|
+
"displayName": "Accept",
|
|
15
|
+
"help": "#accept"
|
|
16
|
+
},
|
|
17
|
+
"capture": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Specifies the preferred facing mode for the device's media capture mechanism.",
|
|
20
|
+
"displayName": "Capture",
|
|
21
|
+
"help": "#capture",
|
|
22
|
+
"propertyEditorValues": {
|
|
23
|
+
"user": {
|
|
24
|
+
"description": "Specifies user-facing as the preferred mode",
|
|
25
|
+
"displayName": "User"
|
|
26
|
+
},
|
|
27
|
+
"environment": {
|
|
28
|
+
"description": "Specifies environment-facing as the preferred mode",
|
|
29
|
+
"displayName": "Environment"
|
|
30
|
+
},
|
|
31
|
+
"implementation": {
|
|
32
|
+
"description": "Specifies an implementation-specific default as the preferred facing mode",
|
|
33
|
+
"displayName": "Implementation"
|
|
34
|
+
},
|
|
35
|
+
"none": {
|
|
36
|
+
"description": "No capture mechanism is used",
|
|
37
|
+
"displayName": "None"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"enumValues": [
|
|
41
|
+
"none",
|
|
42
|
+
"user",
|
|
43
|
+
"environment",
|
|
44
|
+
"implementation"
|
|
45
|
+
],
|
|
46
|
+
"value": "none"
|
|
47
|
+
},
|
|
48
|
+
"disabled": {
|
|
49
|
+
"type": "boolean",
|
|
50
|
+
"description": "Disables the filepicker if set to true",
|
|
51
|
+
"displayName": "Disabled",
|
|
52
|
+
"help": "#disabled",
|
|
53
|
+
"value": false
|
|
54
|
+
},
|
|
55
|
+
"primaryText": {
|
|
56
|
+
"type": "string|function",
|
|
57
|
+
"description": "The primary text for the default file picker.",
|
|
58
|
+
"displayName": "Primary Text",
|
|
59
|
+
"help": "#primaryText"
|
|
60
|
+
},
|
|
61
|
+
"secondaryText": {
|
|
62
|
+
"type": "string|function",
|
|
63
|
+
"description": "The secondary text for the default file picker.",
|
|
64
|
+
"displayName": "Secondary Text",
|
|
65
|
+
"help": "#secondaryText"
|
|
66
|
+
},
|
|
67
|
+
"selectionMode": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"description": "Whether to allow single or multiple file selection.",
|
|
70
|
+
"displayName": "Selection Mode",
|
|
71
|
+
"help": "#selectionMode",
|
|
72
|
+
"propertyEditorValues": {
|
|
73
|
+
"multiple": {
|
|
74
|
+
"description": "multiple file selection",
|
|
75
|
+
"displayName": "Multiple"
|
|
76
|
+
},
|
|
77
|
+
"single": {
|
|
78
|
+
"description": "single file selection",
|
|
79
|
+
"displayName": "Single"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"enumValues": [
|
|
83
|
+
"multiple",
|
|
84
|
+
"single"
|
|
85
|
+
],
|
|
86
|
+
"value": "multiple"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"slots": {
|
|
90
|
+
"trigger": {
|
|
91
|
+
"description": "The trigger slot is used to replace the default content of the file picker.",
|
|
92
|
+
"help": "#trigger"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"events": {
|
|
96
|
+
"ojBeforeSelect": {
|
|
97
|
+
"cancelable": true,
|
|
98
|
+
"description": "Triggered before files are selected to allow for custom validation",
|
|
99
|
+
"help": "#event:beforeSelect",
|
|
100
|
+
"detail": {
|
|
101
|
+
"accept": {
|
|
102
|
+
"description": "This method can be called with an application-created Promise to cancel this event asynchronously. The Promise should be resolved or rejected to accept or cancel the event, respectively.",
|
|
103
|
+
"type": "function"
|
|
104
|
+
},
|
|
105
|
+
"files": {
|
|
106
|
+
"type": "FileList",
|
|
107
|
+
"description": "The selected files"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"ojInvalidSelect": {
|
|
112
|
+
"description": "Triggered when invalid files are selected",
|
|
113
|
+
"help": "#event:invalidSelect",
|
|
114
|
+
"detail": {
|
|
115
|
+
"messages": {
|
|
116
|
+
"type": "Array<object>",
|
|
117
|
+
"description": "Messages that should be displayed to the user describing invalid files.",
|
|
118
|
+
"extension": {
|
|
119
|
+
"vbdt": {
|
|
120
|
+
"itemProperties": {
|
|
121
|
+
"summary": {
|
|
122
|
+
"type": "string"
|
|
123
|
+
},
|
|
124
|
+
"detail": {
|
|
125
|
+
"type": "string"
|
|
126
|
+
},
|
|
127
|
+
"severity": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"enumValues": [
|
|
130
|
+
"error",
|
|
131
|
+
"confirmation",
|
|
132
|
+
"info",
|
|
133
|
+
"warning"
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"until": {
|
|
141
|
+
"type": "Promise|null",
|
|
142
|
+
"description": "This property may be populated with a Promise to provide short-term feedback during a user interaction (typically drag and drop); the feedback should be cleared upon the resolution of this Promise."
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"ojSelect": {
|
|
147
|
+
"description": "Triggered after the files are selected",
|
|
148
|
+
"help": "#event:select",
|
|
149
|
+
"detail": {
|
|
150
|
+
"files": {
|
|
151
|
+
"type": "FileList",
|
|
152
|
+
"description": "The files that were just selected."
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"methods": {
|
|
158
|
+
"focus": {
|
|
159
|
+
"description": "Sets focus on the file picker or the first tabbable element for file picker with custom content.",
|
|
160
|
+
"return": "void"
|
|
161
|
+
},
|
|
162
|
+
"blur": {
|
|
163
|
+
"description": "Blurs the file picker",
|
|
164
|
+
"return": "void"
|
|
165
|
+
},
|
|
166
|
+
"setProperty": {
|
|
167
|
+
"description": "Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a corresponding event.",
|
|
168
|
+
"help": "#setProperty",
|
|
169
|
+
"params": [
|
|
170
|
+
{
|
|
171
|
+
"name": "property",
|
|
172
|
+
"description": "The property name to set. Supports dot notation for subproperty access.",
|
|
173
|
+
"type": "string"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"name": "value",
|
|
177
|
+
"description": "The new value to set the property to.",
|
|
178
|
+
"type": "any"
|
|
179
|
+
}
|
|
180
|
+
],
|
|
181
|
+
"return": "void"
|
|
182
|
+
},
|
|
183
|
+
"getProperty": {
|
|
184
|
+
"description": "Retrieves the value of a property or a subproperty.",
|
|
185
|
+
"help": "#getProperty",
|
|
186
|
+
"params": [
|
|
187
|
+
{
|
|
188
|
+
"name": "property",
|
|
189
|
+
"description": "The property name to get. Supports dot notation for subproperty access.",
|
|
190
|
+
"type": "string"
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
"return": "any"
|
|
194
|
+
},
|
|
195
|
+
"setProperties": {
|
|
196
|
+
"description": "Performs a batch set of properties.",
|
|
197
|
+
"help": "#setProperties",
|
|
198
|
+
"params": [
|
|
199
|
+
{
|
|
200
|
+
"name": "properties",
|
|
201
|
+
"description": "An object containing the property and value pairs to set.",
|
|
202
|
+
"type": "object"
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"return": "void"
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"main": "oj-c/file-picker"
|
|
209
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
oj-c-file-picker:not(.oj-complete) {
|
|
2
|
+
visibility: hidden;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
oj-c-file-picker {
|
|
6
|
+
display: block;
|
|
7
|
+
max-width: 400px;
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
oj-c-file-picker.oj-c-file-picker-with-trigger {
|
|
12
|
+
display: inline-block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
oj-c-file-picker[hidden] {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
define(["require", "exports", "preact/jsx-runtime", '@oracle/oraclejet-preact/translationBundle', "@oracle/oraclejet-preact/UNSAFE_FilePicker", "preact/hooks", "preact/compat", "ojs/ojvcomponent", "@oracle/oraclejet-preact/hooks/UNSAFE_useTabbableMode", "../utils/UNSAFE_focusTabUtils/focusUtils", "css!oj-c/file-picker/file-picker-styles.css"], function (require, exports, jsx_runtime_1, translationBundle_1, UNSAFE_FilePicker_1, hooks_1, compat_1, ojvcomponent_1, UNSAFE_useTabbableMode_1, focusUtils_1) {
|
|
16
|
+
"use strict";
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.FilePicker = void 0;
|
|
19
|
+
translationBundle_1 = __importDefault(translationBundle_1);
|
|
20
|
+
const getPrimaryText = (primaryText) => {
|
|
21
|
+
if (typeof primaryText === 'function') {
|
|
22
|
+
return primaryText();
|
|
23
|
+
}
|
|
24
|
+
return primaryText;
|
|
25
|
+
};
|
|
26
|
+
const getSecondaryText = (secondaryText, selectionMode) => {
|
|
27
|
+
if (typeof secondaryText === 'function') {
|
|
28
|
+
return secondaryText({ selectionMode: selectionMode });
|
|
29
|
+
}
|
|
30
|
+
return secondaryText;
|
|
31
|
+
};
|
|
32
|
+
exports.FilePicker = (0, ojvcomponent_1.registerCustomElement)('oj-c-file-picker', (0, compat_1.forwardRef)((_a, ref) => {
|
|
33
|
+
var { capture = 'none', disabled = false, selectionMode = 'multiple' } = _a, otherProps = __rest(_a, ["capture", "disabled", "selectionMode"]);
|
|
34
|
+
const onCommit = (0, hooks_1.useCallback)((event) => {
|
|
35
|
+
var _a;
|
|
36
|
+
(_a = otherProps.onOjBeforeSelect) === null || _a === void 0 ? void 0 : _a.call(otherProps, { files: event.files }).then(() => {
|
|
37
|
+
var _a;
|
|
38
|
+
(_a = otherProps.onOjSelect) === null || _a === void 0 ? void 0 : _a.call(otherProps, { files: event.files });
|
|
39
|
+
}, (messages) => {
|
|
40
|
+
var _a;
|
|
41
|
+
(_a = otherProps.onOjInvalidSelect) === null || _a === void 0 ? void 0 : _a.call(otherProps, { messages: messages, until: null });
|
|
42
|
+
});
|
|
43
|
+
}, [otherProps.onOjBeforeSelect, otherProps.onOjSelect, otherProps.onOjInvalidSelect]);
|
|
44
|
+
(0, hooks_1.useImperativeHandle)(ref, () => ({
|
|
45
|
+
focus: () => (0, focusUtils_1.focusFirstTabStop)(rootRef.current),
|
|
46
|
+
blur: () => {
|
|
47
|
+
var _a;
|
|
48
|
+
const focusElement = document.activeElement;
|
|
49
|
+
if ((_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.contains(focusElement)) {
|
|
50
|
+
focusElement.blur();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}));
|
|
54
|
+
const rootRef = (0, hooks_1.useRef)(null);
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)(ojvcomponent_1.Root, Object.assign({ ref: rootRef, class: otherProps.trigger ? 'oj-c-file-picker-with-trigger' : undefined }, { children: (0, jsx_runtime_1.jsx)(UNSAFE_FilePicker_1.FilePicker, Object.assign({ capture: capture, isDisabled: disabled, selectionMode: selectionMode, onCommit: onCommit, onReject: otherProps.onOjInvalidSelect, accept: otherProps.accept, primaryText: getPrimaryText(otherProps.primaryText), secondaryText: getSecondaryText(otherProps.secondaryText, selectionMode), accessibleLabel: otherProps['aria-label'], width: "100%" }, { children: otherProps.trigger })) })));
|
|
56
|
+
}), "FilePicker", { "properties": { "accept": { "type": "Array<string>" }, "capture": { "type": "string", "enumValues": ["none", "user", "environment", "implementation"] }, "disabled": { "type": "boolean" }, "primaryText": { "type": "string|function" }, "secondaryText": { "type": "string|function" }, "selectionMode": { "type": "string", "enumValues": ["multiple", "single"] } }, "slots": { "trigger": {} }, "events": { "ojBeforeSelect": { "cancelable": true }, "ojInvalidSelect": {}, "ojSelect": {} }, "extension": { "_OBSERVED_GLOBAL_PROPS": ["aria-label"] }, "methods": { "focus": {}, "blur": {} } }, { "capture": "none", "disabled": false, "selectionMode": "multiple" }, {
|
|
57
|
+
'@oracle/oraclejet-preact': translationBundle_1.default
|
|
58
|
+
}, { consume: [UNSAFE_useTabbableMode_1.TabbableModeContext] });
|
|
59
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
define(["require", "exports", "./file-picker"], function (require, exports, file_picker_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.FilePicker = void 0;
|
|
5
|
+
Object.defineProperty(exports, "FilePicker", { enumerable: true, get: function () { return file_picker_1.FilePicker; } });
|
|
6
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
define(["require", "exports", "./file-picker/file-picker"], function (require, exports, file_picker_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.FilePicker = void 0;
|
|
5
|
+
Object.defineProperty(exports, "FilePicker", { enumerable: true, get: function () { return file_picker_1.FilePicker; } });
|
|
6
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
11
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
12
|
+
var m = o[Symbol.asyncIterator], i;
|
|
13
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
14
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
15
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
16
|
+
};
|
|
17
|
+
define(["require", "exports", "./utils"], function (require, exports, utils_1) {
|
|
18
|
+
"use strict";
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.DataProviderHandler = void 0;
|
|
21
|
+
class DataProviderHandler {
|
|
22
|
+
constructor(dataProvider, addBusyState, callback) {
|
|
23
|
+
this.handleMutateEvent = (event) => __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
const { detail } = event;
|
|
26
|
+
const resolver = this.addBusyState('updating data from mutation event');
|
|
27
|
+
const updatedData = yield (0, utils_1.getUpdatedItemsFromMutationDetail)(detail, this.currentData, this.dataProvider);
|
|
28
|
+
resolver === null || resolver === void 0 ? void 0 : resolver();
|
|
29
|
+
this.currentData = updatedData;
|
|
30
|
+
(_b = (_a = this.callback) === null || _a === void 0 ? void 0 : _a.onDataUpdated) === null || _b === void 0 ? void 0 : _b.call(_a, updatedData);
|
|
31
|
+
});
|
|
32
|
+
this.handleRefreshEvent = () => {
|
|
33
|
+
this._fetchDataAndNotify();
|
|
34
|
+
};
|
|
35
|
+
this.addBusyState = addBusyState;
|
|
36
|
+
this.callback = callback;
|
|
37
|
+
this.dataProvider = dataProvider;
|
|
38
|
+
this.currentData = [];
|
|
39
|
+
dataProvider.addEventListener('refresh', this.handleRefreshEvent);
|
|
40
|
+
dataProvider.addEventListener('mutate', this.handleMutateEvent);
|
|
41
|
+
this._fetchDataAndNotify();
|
|
42
|
+
}
|
|
43
|
+
destroy() {
|
|
44
|
+
this.callback = undefined;
|
|
45
|
+
this.currentData = [];
|
|
46
|
+
this.dataProvider.removeEventListener('refresh', this.handleRefreshEvent);
|
|
47
|
+
this.dataProvider.removeEventListener('mutate', this.handleMutateEvent);
|
|
48
|
+
}
|
|
49
|
+
_fetchData() {
|
|
50
|
+
var e_1, _a;
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const fetchedData = [];
|
|
53
|
+
const asyncIterable = this.dataProvider.fetchFirst({ size: -1 });
|
|
54
|
+
try {
|
|
55
|
+
for (var asyncIterable_1 = __asyncValues(asyncIterable), asyncIterable_1_1; asyncIterable_1_1 = yield asyncIterable_1.next(), !asyncIterable_1_1.done;) {
|
|
56
|
+
const results = asyncIterable_1_1.value;
|
|
57
|
+
const contextArray = results.data.map((item, index) => {
|
|
58
|
+
return {
|
|
59
|
+
data: item,
|
|
60
|
+
key: results.metadata[index].key,
|
|
61
|
+
metadata: results.metadata[index]
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
fetchedData.push(...contextArray);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
68
|
+
finally {
|
|
69
|
+
try {
|
|
70
|
+
if (asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return)) yield _a.call(asyncIterable_1);
|
|
71
|
+
}
|
|
72
|
+
finally { if (e_1) throw e_1.error; }
|
|
73
|
+
}
|
|
74
|
+
this.currentData = fetchedData.slice();
|
|
75
|
+
return fetchedData;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
_fetchDataAndNotify() {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
const resolver = this.addBusyState('fetching data');
|
|
82
|
+
const fetchedData = yield this._fetchData();
|
|
83
|
+
(_b = (_a = this.callback) === null || _a === void 0 ? void 0 : _a.onDataUpdated) === null || _b === void 0 ? void 0 : _b.call(_a, fetchedData);
|
|
84
|
+
resolver();
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.DataProviderHandler = DataProviderHandler;
|
|
89
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
define(["require", "exports", "preact/hooks", "./DataProviderHandler"], function (require, exports, hooks_1, DataProviderHandler_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useDataProvider = void 0;
|
|
5
|
+
function useDataProvider({ addBusyState, data }) {
|
|
6
|
+
const [fetchedData, setFetchedData] = (0, hooks_1.useState)([]);
|
|
7
|
+
const dataProviderHandler = (0, hooks_1.useRef)();
|
|
8
|
+
(0, hooks_1.useEffect)(() => {
|
|
9
|
+
if (data !== undefined) {
|
|
10
|
+
dataProviderHandler.current = new DataProviderHandler_1.DataProviderHandler(data, addBusyState, {
|
|
11
|
+
onDataUpdated: setFetchedData
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return () => {
|
|
15
|
+
var _a;
|
|
16
|
+
(_a = dataProviderHandler.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
17
|
+
dataProviderHandler.current = undefined;
|
|
18
|
+
};
|
|
19
|
+
}, [data, addBusyState]);
|
|
20
|
+
return {
|
|
21
|
+
data: fetchedData
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
exports.useDataProvider = useDataProvider;
|
|
25
|
+
});
|