@opengeoweb/layer-select 9.2.0 → 9.3.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/index.esm.js +1 -33
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -10,6 +10,7 @@ import { LegendLayout } from '@opengeoweb/webmap-react';
|
|
|
10
10
|
import { webmapUtils, LayerType, getCapabilities, WMGetServiceFromStore, clearImageCache } from '@opengeoweb/webmap';
|
|
11
11
|
import { snackbarActions } from '@opengeoweb/snackbar';
|
|
12
12
|
import { ReactHookFormProvider, defaultFormOptions, ReactHookFormTextField } from '@opengeoweb/form-fields';
|
|
13
|
+
import { useFormContext } from 'react-hook-form';
|
|
13
14
|
|
|
14
15
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
15
16
|
|
|
@@ -44236,39 +44237,6 @@ const LayerInfoDialogConnect = () => {
|
|
|
44236
44237
|
});
|
|
44237
44238
|
};
|
|
44238
44239
|
|
|
44239
|
-
const HookFormContext = React__default.createContext(null);
|
|
44240
|
-
/**
|
|
44241
|
-
* This custom hook allows you to access the form context. useFormContext is intended to be used in deeply nested structures, where it would become inconvenient to pass the context as a prop. To be used with {@link FormProvider}.
|
|
44242
|
-
*
|
|
44243
|
-
* @remarks
|
|
44244
|
-
* [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)
|
|
44245
|
-
*
|
|
44246
|
-
* @returns return all useForm methods
|
|
44247
|
-
*
|
|
44248
|
-
* @example
|
|
44249
|
-
* ```tsx
|
|
44250
|
-
* function App() {
|
|
44251
|
-
* const methods = useForm();
|
|
44252
|
-
* const onSubmit = data => console.log(data);
|
|
44253
|
-
*
|
|
44254
|
-
* return (
|
|
44255
|
-
* <FormProvider {...methods} >
|
|
44256
|
-
* <form onSubmit={methods.handleSubmit(onSubmit)}>
|
|
44257
|
-
* <NestedInput />
|
|
44258
|
-
* <input type="submit" />
|
|
44259
|
-
* </form>
|
|
44260
|
-
* </FormProvider>
|
|
44261
|
-
* );
|
|
44262
|
-
* }
|
|
44263
|
-
*
|
|
44264
|
-
* function NestedInput() {
|
|
44265
|
-
* const { register } = useFormContext(); // retrieve all hook methods
|
|
44266
|
-
* return <input {...register("test")} />;
|
|
44267
|
-
* }
|
|
44268
|
-
* ```
|
|
44269
|
-
*/
|
|
44270
|
-
const useFormContext = () => React__default.useContext(HookFormContext);
|
|
44271
|
-
|
|
44272
44240
|
const style = {
|
|
44273
44241
|
textField: {
|
|
44274
44242
|
width: '100%',
|