dynamic-modal 1.1.4 → 1.1.8

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.
Files changed (50) hide show
  1. package/README-ES.md +217 -217
  2. package/README.md +216 -216
  3. package/dist/components/input-upload/input-upload.js +1 -1
  4. package/dist/components/make-button/make-button.js +7 -17
  5. package/dist/components/make-input/make-input.js +7 -17
  6. package/dist/components/make-select/make-select.js +7 -17
  7. package/dist/components/make-textarea/make-textarea.js +7 -17
  8. package/dist/components/make-toggle/make-toggle.js +7 -17
  9. package/dist/components/portal/portal.js +7 -17
  10. package/dist/context/component/component-state.js +7 -17
  11. package/dist/hooks/field-render.d.ts +1 -0
  12. package/dist/hooks/field-render.js +22 -15
  13. package/dist/interfaces/modal.d.ts +5 -1
  14. package/dist/modal.js +38 -19
  15. package/eslint.config.mjs +14 -14
  16. package/examples/enable-if.ts +127 -127
  17. package/examples/live-data.ts +61 -61
  18. package/examples/render-if.ts +128 -128
  19. package/examples/simple.ts +74 -74
  20. package/index.ts +5 -5
  21. package/package.json +46 -47
  22. package/src/components/input-upload/input-upload.tsx +67 -67
  23. package/src/components/make-button/make-button.tsx +18 -18
  24. package/src/components/make-description/make-description.tsx +15 -15
  25. package/src/components/make-input/make-input.tsx +53 -53
  26. package/src/components/make-select/make-select.tsx +55 -55
  27. package/src/components/make-textarea/make-textarea.tsx +53 -53
  28. package/src/components/make-toggle/make-toggle.tsx +53 -53
  29. package/src/components/make-upload/make-upload.tsx +40 -40
  30. package/src/components/portal/portal.tsx +37 -37
  31. package/src/context/component/component-state.tsx +17 -17
  32. package/src/hooks/field-render.ts +120 -109
  33. package/src/hooks/modal-handler.ts +38 -38
  34. package/src/interfaces/component-state.ts +33 -33
  35. package/src/interfaces/field.ts +37 -37
  36. package/src/interfaces/input-upload.ts +21 -21
  37. package/src/interfaces/make-button.ts +19 -19
  38. package/src/interfaces/make-description.ts +14 -14
  39. package/src/interfaces/make-field-group.ts +14 -14
  40. package/src/interfaces/make-input.ts +14 -14
  41. package/src/interfaces/make-select.ts +15 -15
  42. package/src/interfaces/make-textarea.ts +11 -11
  43. package/src/interfaces/make-toggle.ts +9 -9
  44. package/src/interfaces/make-upload.ts +14 -14
  45. package/src/interfaces/modal.ts +50 -46
  46. package/src/interfaces/option.ts +3 -3
  47. package/src/interfaces/portal.ts +8 -8
  48. package/src/modal.tsx +196 -164
  49. package/src/tools/general.ts +8 -8
  50. package/tsconfig.json +13 -13
package/README.md CHANGED
@@ -1,217 +1,217 @@
1
- # dynamic-modal
2
-
3
- <<<<<<< README.md
4
- `dynamic-modal` is a TypeScript library for creating reusable modals in React and Next.js applications. It uses JSON objects to configure the modal structure, eliminating the need to write HTML. This approach simplifies modal creation and customization, allowing you to open and close modals using a custom hook.
5
-
6
- ## Requirements
7
-
8
- To use `dynamic-modal` properly, ensure you have the following dependencies installed:
9
-
10
- - React
11
-
12
- Additionally, `dynamic-modal` is compatible with **Next.js**.
13
-
14
- ## Installation
15
-
16
- Install the library via npm:
17
-
18
- ```bash
19
- npm install dynamic-modal
20
- ```
21
-
22
- ## Setup for Next.js (14 or 15)
23
- Define your components for use inside modal, create file and configure all modal components. Here´s an example using HeroUI (previously NextUI):
24
-
25
- ```jsx
26
- 'use client'
27
- import { Autocomplete, AutocompleteItem, Button, Input, Select, SelectItem, Switch, Textarea } from "@heroui/react";
28
- import { IComponentState } from "dynamic-modal/src/interfaces/component-state";
29
-
30
- export const ModalComponents: IComponentState = {
31
- ModalButtonCancel: (props) => {
32
- return (
33
- <Button
34
- {...props}
35
- color={props.color as "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined}
36
- variant={'bordered'}
37
- >
38
- {props.text}
39
- </Button>
40
- )
41
- },
42
- ModalButtonAction: (props) => {
43
- return (
44
- <Button
45
- {...props}
46
- color={props.color as "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined}
47
- variant={'solid'}
48
- >
49
- {props.text}
50
- </Button>)
51
- },
52
- Button: ({ text, ...props }) => {
53
- return (
54
- <Button
55
- {...props}
56
- color={props.color as "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined}
57
- variant={props.variant as "flat" | "bordered" | "solid" | "light" | "faded" | "shadow" | "ghost" | undefined}
58
- >
59
- {text}
60
- </Button>)
61
- },
62
- Input: ({ invalid, error, disabled, onChange, ...props }) => {
63
- return (
64
- <Input
65
- {...props}
66
- onValueChange={onChange}
67
- errorMessage={error?.message}
68
- isInvalid={invalid}
69
- isDisabled={disabled}
70
- />
71
- )
72
- },
73
- Select: ({ options, invalid, error, isMulti, isSearch, disabled, onChange, value, ...props }) => {
74
- return (
75
- !isSearch ?
76
- <Select
77
- {...props}
78
- selectedKeys={isMulti ? value : [value]}
79
- onSelectionChange={onChange}
80
- selectionMode={isMulti ? 'multiple' : 'single'}
81
- errorMessage={error?.message}
82
- isInvalid={invalid}
83
- isDisabled={disabled}
84
- >
85
- {options.map((option) => (
86
- <SelectItem key={option.id}>{option.name}</SelectItem>
87
- ))}
88
- </Select> :
89
- <Autocomplete
90
- {...props}
91
- selectedKey={value}
92
- onSelectionChange={onChange}
93
- errorMessage={error?.message}
94
- isInvalid={invalid}
95
- isDisabled={disabled}
96
- >
97
- {options.map((item) => (
98
- <AutocompleteItem key={item.id}>{item.name}</AutocompleteItem>
99
- ))}
100
- </Autocomplete>
101
- )
102
- },
103
- Textarea: ({ invalid, error, disabled, ...props }) => {
104
- return (
105
- <Textarea
106
- {...props}
107
- errorMessage={error?.message}
108
- isInvalid={invalid}
109
- isDisabled={disabled}
110
- />
111
- )
112
- },
113
- Toggle: ({ value, onChange, label, invalid, ...props }) => {
114
- return(
115
- <Switch {...props} isSelected={value} onValueChange={onChange}>
116
- {label}
117
- </Switch>
118
- )
119
- }
120
- }
121
- ```
122
-
123
- In the main provider of your React application, import your modal components (defined previously) and wrap your app with the `ComponentState` component to ensure `dynamic-modal` functions properly. Here’s an example:
124
-
125
- ```jsx
126
- import { ComponentState } from 'dynamic-modal'
127
- import { ModalComponents } from "@data/modal-component/modal-component";
128
-
129
- function Provider({ children }: Readonly<{ children: ReactNode }>) {
130
- return (
131
- <ComponentState components={ModalComponents}>
132
- <Component {...pageProps} />
133
- </ComponentState>
134
- );
135
- }
136
-
137
- export default Provider;
138
-
139
- ```
140
- In the root layout define `portal` for modal (this component use react portal)
141
-
142
- ```jsx
143
- //imports...
144
-
145
- export default function RootLayout ({
146
- children
147
- }: Readonly<{
148
- children: ReactNode;
149
- }>) {
150
- return (
151
- <html lang="en">
152
- <body className={inter.className}>
153
- <Provider>
154
- {children}
155
- </Provider>
156
- <div id='modal-portal'/>
157
- </body>
158
- </html>
159
- )
160
- }
161
- ```
162
-
163
- ## Setup for Next.js 13 and old
164
- Edit file named `_document.tsx` and define `portal` for modal (this component use react portal)
165
-
166
- ```jsx
167
- import { Html, Head, Main, NextScript } from 'next/document'
168
-
169
- export default function Document () {
170
- return (
171
- <Html>
172
- <Head />
173
- <body>
174
- <Main />
175
- <div id='modal-portal'/>
176
- <NextScript />
177
- </body>
178
- </Html>
179
- )
180
- }
181
- ```
182
-
183
- ## Usage
184
- To control the modal’s open and close states, use the `useModalHandler` custom hook and call `openModal` whenever you need to display the modal.
185
-
186
- ```jsx
187
- import { useModalHandler, DynamicModal } from 'dynamic-modal';
188
- import { Button } from '@nextui-org/react';
189
- //Create your modal, import and use
190
- import testModal from '@modal-config/test';
191
-
192
- function ExampleComponent() {
193
- const { openModal, modalProps } = useModalHandler();
194
-
195
- return (
196
- <>
197
- <Button
198
- onClick={() => {
199
- openModal(testModal.default({}, (data) => {
200
- console.log('modal data', data);
201
- }));
202
- }}
203
- >
204
- Open modal
205
- </Button>
206
-
207
- <DynamicModal {...modalProps} />
208
- </>
209
- );
210
- }
211
-
212
- export default ExampleComponent;
213
-
214
- ```
215
-
216
- ## Examples
1
+ # dynamic-modal
2
+
3
+ <<<<<<< README.md
4
+ `dynamic-modal` is a TypeScript library for creating reusable modals in React and Next.js applications. It uses JSON objects to configure the modal structure, eliminating the need to write HTML. This approach simplifies modal creation and customization, allowing you to open and close modals using a custom hook.
5
+
6
+ ## Requirements
7
+
8
+ To use `dynamic-modal` properly, ensure you have the following dependencies installed:
9
+
10
+ - React
11
+
12
+ Additionally, `dynamic-modal` is compatible with **Next.js**.
13
+
14
+ ## Installation
15
+
16
+ Install the library via npm:
17
+
18
+ ```bash
19
+ npm install dynamic-modal
20
+ ```
21
+
22
+ ## Setup for Next.js (14 or 15)
23
+ Define your components for use inside modal, create file and configure all modal components. Here´s an example using HeroUI (previously NextUI):
24
+
25
+ ```jsx
26
+ 'use client'
27
+ import { Autocomplete, AutocompleteItem, Button, Input, Select, SelectItem, Switch, Textarea } from "@heroui/react"
28
+ import { IComponentState } from "dynamic-modal/src/interfaces/component-state"
29
+
30
+ export const ModalComponents: IComponentState = {
31
+ ModalButtonCancel: (props) => {
32
+ return (
33
+ <Button
34
+ {...props}
35
+ color={props.color as "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined}
36
+ variant={'bordered'}
37
+ >
38
+ {props.text}
39
+ </Button>
40
+ )
41
+ },
42
+ ModalButtonAction: (props) => {
43
+ return (
44
+ <Button
45
+ {...props}
46
+ color={props.color as "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined}
47
+ variant={'solid'}
48
+ >
49
+ {props.text}
50
+ </Button>)
51
+ },
52
+ Button: ({ text, ...props }) => {
53
+ return (
54
+ <Button
55
+ {...props}
56
+ color={props.color as "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined}
57
+ variant={props.variant as "flat" | "bordered" | "solid" | "light" | "faded" | "shadow" | "ghost" | undefined}
58
+ >
59
+ {text}
60
+ </Button>)
61
+ },
62
+ Input: ({ invalid, error, disabled, onChange, ...props }) => {
63
+ return (
64
+ <Input
65
+ {...props}
66
+ onValueChange={onChange}
67
+ errorMessage={error?.message}
68
+ isInvalid={invalid}
69
+ isDisabled={disabled}
70
+ />
71
+ )
72
+ },
73
+ Select: ({ options, invalid, error, isMulti, isSearch, disabled, onChange, value, ...props }) => {
74
+ return (
75
+ !isSearch ?
76
+ <Select
77
+ {...props}
78
+ selectedKeys={isMulti ? value : [value]}
79
+ onSelectionChange={onChange}
80
+ selectionMode={isMulti ? 'multiple' : 'single'}
81
+ errorMessage={error?.message}
82
+ isInvalid={invalid}
83
+ isDisabled={disabled}
84
+ >
85
+ {options.map((option) => (
86
+ <SelectItem key={option.id}>{option.name}</SelectItem>
87
+ ))}
88
+ </Select> :
89
+ <Autocomplete
90
+ {...props}
91
+ selectedKey={value}
92
+ onSelectionChange={onChange}
93
+ errorMessage={error?.message}
94
+ isInvalid={invalid}
95
+ isDisabled={disabled}
96
+ >
97
+ {options.map((item) => (
98
+ <AutocompleteItem key={item.id}>{item.name}</AutocompleteItem>
99
+ ))}
100
+ </Autocomplete>
101
+ )
102
+ },
103
+ Textarea: ({ invalid, error, disabled, ...props }) => {
104
+ return (
105
+ <Textarea
106
+ {...props}
107
+ errorMessage={error?.message}
108
+ isInvalid={invalid}
109
+ isDisabled={disabled}
110
+ />
111
+ )
112
+ },
113
+ Toggle: ({ value, onChange, label, invalid, ...props }) => {
114
+ return(
115
+ <Switch {...props} isSelected={value} onValueChange={onChange}>
116
+ {label}
117
+ </Switch>
118
+ )
119
+ }
120
+ }
121
+ ```
122
+
123
+ In the main provider of your React application, import your modal components (defined previously) and wrap your app with the `ComponentState` component to ensure `dynamic-modal` functions properly. Here’s an example:
124
+
125
+ ```jsx
126
+ import { ComponentState } from 'dynamic-modal'
127
+ import { ModalComponents } from "@data/modal-component/modal-component"
128
+
129
+ function Provider({ children }: Readonly<{ children: ReactNode }>) {
130
+ return (
131
+ <ComponentState components={ModalComponents}>
132
+ <Component {...pageProps} />
133
+ </ComponentState>
134
+ )
135
+ }
136
+
137
+ export default Provider
138
+
139
+ ```
140
+ In the root layout define `portal` for modal (this component use react portal)
141
+
142
+ ```jsx
143
+ //imports...
144
+
145
+ export default function RootLayout ({
146
+ children
147
+ }: Readonly<{
148
+ children: ReactNode
149
+ }>) {
150
+ return (
151
+ <html lang="en">
152
+ <body className={inter.className}>
153
+ <Provider>
154
+ {children}
155
+ </Provider>
156
+ <div id='modal-portal'/>
157
+ </body>
158
+ </html>
159
+ )
160
+ }
161
+ ```
162
+
163
+ ## Setup for Next.js 13 and old
164
+ Edit file named `_document.tsx` and define `portal` for modal (this component use react portal)
165
+
166
+ ```jsx
167
+ import { Html, Head, Main, NextScript } from 'next/document'
168
+
169
+ export default function Document () {
170
+ return (
171
+ <Html>
172
+ <Head />
173
+ <body>
174
+ <Main />
175
+ <div id='modal-portal'/>
176
+ <NextScript />
177
+ </body>
178
+ </Html>
179
+ )
180
+ }
181
+ ```
182
+
183
+ ## Usage
184
+ To control the modal’s open and close states, use the `useModalHandler` custom hook and call `openModal` whenever you need to display the modal.
185
+
186
+ ```jsx
187
+ import { useModalHandler, DynamicModal } from 'dynamic-modal'
188
+ import { Button } from '@nextui-org/react'
189
+ //Create your modal, import and use
190
+ import testModal from '@modal-config/test'
191
+
192
+ function ExampleComponent() {
193
+ const { openModal, modalProps } = useModalHandler()
194
+
195
+ return (
196
+ <>
197
+ <Button
198
+ onClick={() => {
199
+ openModal(testModal.default({}, (data) => {
200
+ console.log('modal data', data)
201
+ }))
202
+ }}
203
+ >
204
+ Open modal
205
+ </Button>
206
+
207
+ <DynamicModal {...modalProps} />
208
+ </>
209
+ )
210
+ }
211
+
212
+ export default ExampleComponent
213
+
214
+ ```
215
+
216
+ ## Examples
217
217
  The examples folder in the repository contains different configuration modes to help you customize your modal.
@@ -56,7 +56,7 @@ const InputUpload = (_a) => {
56
56
  };
57
57
  return (react_1.default.createElement("div", { className: 'flex flex-col w-full gap-1 text-center' },
58
58
  props.label && react_1.default.createElement("label", { className: "block mb-2 text-sm font-medium text-gray-900 dark:text-white", htmlFor: `file-input-${props.id}` }, props.label),
59
- react_1.default.createElement("input", Object.assign({ className: "file:transition-all file:delay-150 block w-full text-sm text-slate-500\n file:mr-4 file:py-2 file:px-4 file:rounded-md\n file:border-0 file:text-sm file:font-semibold\n file:bg-gray-100 file:text-blue-600\n hover:file:bg-blue-700 hover:file:text-white cursor-pointer disabled:cursor-not-allowed", "aria-describedby": `file-input-${props.id}-help`, id: `file-input-${props.id}`, type: "file", onChange: onChangeHandler }, props)),
59
+ react_1.default.createElement("input", Object.assign({ className: "file:transition-all file:delay-150 block w-full text-sm text-slate-500\r\n file:mr-4 file:py-2 file:px-4 file:rounded-md\r\n file:border-0 file:text-sm file:font-semibold\r\n file:bg-gray-100 file:text-blue-600\r\n hover:file:bg-blue-700 hover:file:text-white cursor-pointer disabled:cursor-not-allowed", "aria-describedby": `file-input-${props.id}-help`, id: `file-input-${props.id}`, type: "file", onChange: onChangeHandler }, props)),
60
60
  react_1.default.createElement("p", { className: "mt-1 text-sm text-gray-500 dark:text-gray-300 text-start", id: `file-input-${props.id}-help` }, (_b = props.helpText) === null || _b === void 0 ? void 0 : _b.toUpperCase())));
61
61
  };
62
62
  exports.default = InputUpload;
@@ -16,23 +16,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
16
16
  }) : function(o, v) {
17
17
  o["default"] = v;
18
18
  });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
36
26
  Object.defineProperty(exports, "__esModule", { value: true });
37
27
  const react_1 = __importStar(require("react"));
38
28
  const component_state_1 = require("../../context/component/component-state");
@@ -16,23 +16,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
16
16
  }) : function(o, v) {
17
17
  o["default"] = v;
18
18
  });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
36
26
  var __rest = (this && this.__rest) || function (s, e) {
37
27
  var t = {};
38
28
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -16,23 +16,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
16
16
  }) : function(o, v) {
17
17
  o["default"] = v;
18
18
  });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
36
26
  var __rest = (this && this.__rest) || function (s, e) {
37
27
  var t = {};
38
28
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -16,23 +16,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
16
16
  }) : function(o, v) {
17
17
  o["default"] = v;
18
18
  });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
36
26
  var __rest = (this && this.__rest) || function (s, e) {
37
27
  var t = {};
38
28
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -16,23 +16,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
16
16
  }) : function(o, v) {
17
17
  o["default"] = v;
18
18
  });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
36
26
  var __rest = (this && this.__rest) || function (s, e) {
37
27
  var t = {};
38
28
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -16,23 +16,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
16
16
  }) : function(o, v) {
17
17
  o["default"] = v;
18
18
  });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
36
26
  Object.defineProperty(exports, "__esModule", { value: true });
37
27
  exports.Portal = void 0;
38
28
  const react_1 = __importStar(require("react"));