@elliemae/ds-dropzone 3.22.0-next.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSDropzone.js +73 -0
- package/dist/cjs/DSDropzone.js.map +7 -0
- package/dist/cjs/config/useDSDropzone.js +85 -0
- package/dist/cjs/config/useDSDropzone.js.map +7 -0
- package/dist/cjs/config/useValidateProps.js +40 -0
- package/dist/cjs/config/useValidateProps.js.map +7 -0
- package/dist/cjs/constants/index.js +51 -0
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +43 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/parts/DSActivezone/DSActivezone.js +89 -0
- package/dist/cjs/parts/DSActivezone/DSActivezone.js.map +7 -0
- package/dist/cjs/parts/DSActivezone/config/useActivezone.js +69 -0
- package/dist/cjs/parts/DSActivezone/config/useActivezone.js.map +7 -0
- package/dist/cjs/parts/DSActivezone/config/useValidateProps.js +40 -0
- package/dist/cjs/parts/DSActivezone/config/useValidateProps.js.map +7 -0
- package/dist/cjs/parts/DSActivezone/index.js +37 -0
- package/dist/cjs/parts/DSActivezone/index.js.map +7 -0
- package/dist/cjs/parts/DSActivezone/react-desc-prop-types.js +50 -0
- package/dist/cjs/parts/DSActivezone/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/react-desc-prop-types.js +125 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/styled.js +78 -0
- package/dist/cjs/styled.js.map +7 -0
- package/dist/esm/DSDropzone.js +43 -0
- package/dist/esm/DSDropzone.js.map +7 -0
- package/dist/esm/config/useDSDropzone.js +55 -0
- package/dist/esm/config/useDSDropzone.js.map +7 -0
- package/dist/esm/config/useValidateProps.js +10 -0
- package/dist/esm/config/useValidateProps.js.map +7 -0
- package/dist/esm/constants/index.js +21 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/parts/DSActivezone/DSActivezone.js +59 -0
- package/dist/esm/parts/DSActivezone/DSActivezone.js.map +7 -0
- package/dist/esm/parts/DSActivezone/config/useActivezone.js +39 -0
- package/dist/esm/parts/DSActivezone/config/useActivezone.js.map +7 -0
- package/dist/esm/parts/DSActivezone/config/useValidateProps.js +10 -0
- package/dist/esm/parts/DSActivezone/config/useValidateProps.js.map +7 -0
- package/dist/esm/parts/DSActivezone/index.js +7 -0
- package/dist/esm/parts/DSActivezone/index.js.map +7 -0
- package/dist/esm/parts/DSActivezone/react-desc-prop-types.js +20 -0
- package/dist/esm/parts/DSActivezone/react-desc-prop-types.js.map +7 -0
- package/dist/esm/react-desc-prop-types.js +95 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/styled.js +48 -0
- package/dist/esm/styled.js.map +7 -0
- package/dist/types/DSDropzone.d.ts +5 -0
- package/dist/types/config/useDSDropzone.d.ts +16 -0
- package/dist/types/config/useValidateProps.d.ts +3 -0
- package/dist/types/constants/index.d.ts +12 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/parts/DSActivezone/DSActivezone.d.ts +5 -0
- package/dist/types/parts/DSActivezone/config/useActivezone.d.ts +8 -0
- package/dist/types/parts/DSActivezone/config/useValidateProps.d.ts +3 -0
- package/dist/types/parts/DSActivezone/index.d.ts +1 -0
- package/dist/types/parts/DSActivezone/react-desc-prop-types.d.ts +20 -0
- package/dist/types/parts/DSActivezone/tests/DSActivezone.test.d.ts +1 -0
- package/dist/types/react-desc-prop-types.d.ts +19 -0
- package/dist/types/styled.d.ts +17 -0
- package/dist/types/tests/DSDropzone.test.d.ts +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { omit } from "lodash";
|
|
4
|
+
import { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
5
|
+
import { uid } from "uid";
|
|
6
|
+
import { DSActivezonePropTypes, defaultProps } from "../react-desc-prop-types.js";
|
|
7
|
+
import { useValidateProps } from "./useValidateProps.js";
|
|
8
|
+
const useActivezone = (propsFromUser) => {
|
|
9
|
+
const propsWithDefault = useMemoMergePropsWithDefault(propsFromUser, defaultProps);
|
|
10
|
+
useValidateProps(propsWithDefault, DSActivezonePropTypes);
|
|
11
|
+
const globalProps = omit(useGetGlobalAttributes(propsWithDefault), [
|
|
12
|
+
"cols",
|
|
13
|
+
"rows",
|
|
14
|
+
"wrap"
|
|
15
|
+
]);
|
|
16
|
+
const xstyledProps = useGetXstyledProps(propsWithDefault);
|
|
17
|
+
const { id } = propsWithDefault;
|
|
18
|
+
const instanceUid = React2.useMemo(() => id || uid(5), [id]);
|
|
19
|
+
return React2.useMemo(
|
|
20
|
+
() => ({
|
|
21
|
+
propsWithDefault,
|
|
22
|
+
globalProps,
|
|
23
|
+
xstyledProps,
|
|
24
|
+
instanceUid
|
|
25
|
+
// ...eventHandlers,
|
|
26
|
+
}),
|
|
27
|
+
[
|
|
28
|
+
propsWithDefault,
|
|
29
|
+
globalProps,
|
|
30
|
+
xstyledProps,
|
|
31
|
+
instanceUid
|
|
32
|
+
// eventHandlers,
|
|
33
|
+
]
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
useActivezone
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=useActivezone.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSActivezone/config/useActivezone.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { omit } from 'lodash';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSActivezoneT, DSActivezonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport const useActivezone = (propsFromUser: DSActivezoneT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSActivezoneT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSActivezonePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSActivezoneT.InternalProps>(propsWithDefault), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const { id } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || uid(5), [id]);\n\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n // eventHandlers,\n ],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,YAAY;AACrB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAS,WAAW;AACpB,SAA6B,uBAAuB,oBAAoB;AACxE,SAAS,wBAAwB;AAE1B,MAAM,gBAAgB,CAAC,kBAAuC;AAInE,QAAM,mBAAmB,6BAA0D,eAAe,YAAY;AAC9G,mBAAiB,kBAAkB,qBAAqB;AAIxD,QAAM,cAAc,KAAK,uBAAoD,gBAAgB,GAAG;AAAA,IAC9F;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,eAAe,mBAAmB,gBAAgB;AAKxD,QAAM,EAAE,GAAG,IAAI;AACf,QAAM,cAAcA,OAAM,QAAQ,MAAM,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAO1D,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { DSDropzoneName } from "../../../constants/index.js";
|
|
4
|
+
const useValidateProps = (props, propTypes) => {
|
|
5
|
+
useValidateTypescriptPropTypes(props, propTypes, DSDropzoneName);
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
useValidateProps
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSActivezone/config/useValidateProps.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { type DSActivezoneT } from '../react-desc-prop-types.js';\nimport { DSDropzoneName } from '../../../constants/index.js';\n\nexport const useValidateProps = (props: DSActivezoneT.InternalProps, propTypes: WeakValidationMap<unknown>): void => {\n useValidateTypescriptPropTypes(props, propTypes, DSDropzoneName);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,sBAAsB;AAExB,MAAM,mBAAmB,CAAC,OAAoC,cAAgD;AACnH,iCAA+B,OAAO,WAAW,cAAc;AACjE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSActivezone/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSActivezone, DSActivezoneWithSchema } from './DSActivezone.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc,8BAA8B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { UploadFile } from "@elliemae/ds-icons";
|
|
4
|
+
const defaultProps = {
|
|
5
|
+
Icon: UploadFile,
|
|
6
|
+
label: "DROP FILES HERE"
|
|
7
|
+
};
|
|
8
|
+
const DSActivezonePropTypes = {
|
|
9
|
+
...globalAttributesPropTypes,
|
|
10
|
+
...xstyledPropTypes,
|
|
11
|
+
Icon: PropTypes.func.description("Custom Icon").defaultValue("UploadFile"),
|
|
12
|
+
label: PropTypes.string.description("Active zone label").defaultValue(defaultProps.label)
|
|
13
|
+
};
|
|
14
|
+
const DSActivezonePropTypesSchema = DSActivezonePropTypes;
|
|
15
|
+
export {
|
|
16
|
+
DSActivezonePropTypes,
|
|
17
|
+
DSActivezonePropTypesSchema,
|
|
18
|
+
defaultProps
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSActivezone/react-desc-prop-types.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\n/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type { SvgIconT } from '@elliemae/ds-icons';\nimport { UploadFile } from '@elliemae/ds-icons';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSActivezoneT {\n export interface RequiredProps {}\n\n export interface DefaultProps {\n Icon: React.ComponentType<SvgIconT.Props>;\n label: string;\n }\n\n export interface OptionalProps {}\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSActivezoneT.DefaultProps = {\n Icon: UploadFile,\n label: 'DROP FILES HERE',\n};\n\nexport const DSActivezonePropTypes: DSPropTypesSchema<DSActivezoneT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n Icon: PropTypes.func.description('Custom Icon').defaultValue('UploadFile'),\n label: PropTypes.string.description('Active zone label').defaultValue(defaultProps.label),\n};\n\nexport const DSActivezonePropTypesSchema = DSActivezonePropTypes as unknown as WeakValidationMap<DSActivezoneT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AAEvE,SAAS,kBAAkB;AA4BpB,MAAM,eAA2C;AAAA,EACtD,MAAM;AAAA,EACN,OAAO;AACT;AAEO,MAAM,wBAAgE;AAAA,EAC3E,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,UAAU,KAAK,YAAY,aAAa,EAAE,aAAa,YAAY;AAAA,EACzE,OAAO,UAAU,OAAO,YAAY,mBAAmB,EAAE,aAAa,aAAa,KAAK;AAC1F;AAEO,MAAM,8BAA8B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
const defaultProps = {
|
|
4
|
+
dropConfig: {}
|
|
5
|
+
};
|
|
6
|
+
const DSDropzonePropTypes = {
|
|
7
|
+
...globalAttributesPropTypes,
|
|
8
|
+
...xstyledPropTypes,
|
|
9
|
+
children: PropTypes.any,
|
|
10
|
+
hasError: PropTypes.bool.description("Show error border color"),
|
|
11
|
+
dropConfig: PropTypes.shape({
|
|
12
|
+
accept: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)).description(`
|
|
13
|
+
Set accepted file types.
|
|
14
|
+
Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.
|
|
15
|
+
Keep in mind that mime type determination is not reliable across platforms. CSV files,
|
|
16
|
+
for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
|
|
17
|
+
Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).
|
|
18
|
+
`),
|
|
19
|
+
multiple: PropTypes.bool.description("Allow drag 'n' drop (or selection from the file dialog) of multiple files"),
|
|
20
|
+
preventDropOnDocument: PropTypes.bool.description(
|
|
21
|
+
"If false, allow dropped items to take over the current browser window"
|
|
22
|
+
),
|
|
23
|
+
noClick: PropTypes.bool.description("If true, disables click to open the native file selection dialog"),
|
|
24
|
+
noKeyboard: PropTypes.bool.description(`
|
|
25
|
+
If true, disables SPACE/ENTER to open the native file selection dialog.
|
|
26
|
+
Note that it also stops tracking the focus state.`),
|
|
27
|
+
noDrag: PropTypes.bool.description("If true, disables drag&drop"),
|
|
28
|
+
noDragEventsBubbling: PropTypes.bool.description("If true, stops drag event propagation to parents"),
|
|
29
|
+
minSize: PropTypes.number.description("Minimum file size (in bytes)"),
|
|
30
|
+
maxSize: PropTypes.number.description("Maximum file size (in bytes)"),
|
|
31
|
+
maxFiles: PropTypes.number.description(`
|
|
32
|
+
Maximum accepted number of files
|
|
33
|
+
The default value is 0 which means there is no limitation to how many files are accepted.
|
|
34
|
+
`),
|
|
35
|
+
disabled: PropTypes.bool.description("Enable/disable the dropzone"),
|
|
36
|
+
getFilesFromEvent: PropTypes.func.description(`
|
|
37
|
+
Use this to provide a custom file aggregator
|
|
38
|
+
@param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
|
|
39
|
+
`),
|
|
40
|
+
onFileDialogCancel: PropTypes.func.description("Cb for when closing the file dialog with no selection"),
|
|
41
|
+
onFileDialogOpen: PropTypes.func.description("Cb for when opening the file dialog"),
|
|
42
|
+
useFsAccessApi: PropTypes.bool.description(`
|
|
43
|
+
Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
|
|
44
|
+
to open the file picker instead of using an <input type="file"> click event.
|
|
45
|
+
`),
|
|
46
|
+
onDragEnter: PropTypes.func.description(`
|
|
47
|
+
Cb for when the dragenter event occurs.
|
|
48
|
+
@param {DragEvent} event`),
|
|
49
|
+
onDragLeave: PropTypes.func.description(`
|
|
50
|
+
Cb for when the dragleave event occurs
|
|
51
|
+
@param {DragEvent} event
|
|
52
|
+
`),
|
|
53
|
+
onDragOver: PropTypes.func.description(`
|
|
54
|
+
Cb for when the dragover event occurs
|
|
55
|
+
@param {DragEvent} event
|
|
56
|
+
`),
|
|
57
|
+
onDrop: PropTypes.func.description(`
|
|
58
|
+
Cb for when the drop event occurs.
|
|
59
|
+
onDrop will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.
|
|
60
|
+
For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:
|
|
61
|
+
@param {File[]} acceptedFiles
|
|
62
|
+
@param {FileRejection[]} fileRejections
|
|
63
|
+
@param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
|
|
64
|
+
`),
|
|
65
|
+
onDropAccepted: PropTypes.func.description(`
|
|
66
|
+
Cb for when the drop event occurs.
|
|
67
|
+
Note that if no files are accepted, this callback is not invoked.
|
|
68
|
+
@param {File[]} files
|
|
69
|
+
@param {(DragEvent|Event)} event
|
|
70
|
+
`),
|
|
71
|
+
onDropRejected: PropTypes.func.description(`
|
|
72
|
+
Cb for when the drop event occurs.
|
|
73
|
+
Note that if no files are rejected, this callback is not invoked.
|
|
74
|
+
@param {FileRejection[]} fileRejections
|
|
75
|
+
@param {(DragEvent|Event)} event
|
|
76
|
+
`),
|
|
77
|
+
onError: PropTypes.func.description(`
|
|
78
|
+
Cb for when there's some error from any of the promises.
|
|
79
|
+
@param {Error} error
|
|
80
|
+
`),
|
|
81
|
+
validator: PropTypes.func.description(`
|
|
82
|
+
Custom validation function. It must return null if there's no errors.
|
|
83
|
+
@param {File} file
|
|
84
|
+
@returns {FileError|FileError[]|null}
|
|
85
|
+
`)
|
|
86
|
+
}).description(`react-dropzone options, see https://react-dropzone.js.org/ for more information V14.2.3`).defaultValue({})
|
|
87
|
+
// onSomethingEvent: PropTypes.func
|
|
88
|
+
// .description('some example of function, required if something is not foo')
|
|
89
|
+
// .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
DSDropzonePropTypes,
|
|
93
|
+
defaultProps
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type { DropzoneOptions } from 'react-dropzone';\n\nexport declare namespace DSDropzoneT {\n export interface RequiredProps {}\n\n export interface DefaultProps {}\n\n export interface OptionalProps {\n dropConfig?: DropzoneOptions;\n hasError?: boolean;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export type ExampleState = '0' | '1';\n}\n\nexport const defaultProps: DSDropzoneT.DefaultProps = {\n dropConfig: {},\n};\n\nexport const DSDropzonePropTypes: DSPropTypesSchema<DSDropzoneT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n children: PropTypes.any,\n hasError: PropTypes.bool.description('Show error border color'),\n dropConfig: PropTypes.shape({\n accept: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)).description(`\n Set accepted file types.\n Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.\n Keep in mind that mime type determination is not reliable across platforms. CSV files,\n for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).\n `),\n multiple: PropTypes.bool.description(\"Allow drag 'n' drop (or selection from the file dialog) of multiple files\"),\n\n preventDropOnDocument: PropTypes.bool.description(\n 'If false, allow dropped items to take over the current browser window',\n ),\n noClick: PropTypes.bool.description('If true, disables click to open the native file selection dialog'),\n noKeyboard: PropTypes.bool.description(`\n If true, disables SPACE/ENTER to open the native file selection dialog.\n Note that it also stops tracking the focus state.`),\n noDrag: PropTypes.bool.description('If true, disables drag&drop'),\n noDragEventsBubbling: PropTypes.bool.description('If true, stops drag event propagation to parents'),\n minSize: PropTypes.number.description('Minimum file size (in bytes)'),\n maxSize: PropTypes.number.description('Maximum file size (in bytes)'),\n maxFiles: PropTypes.number.description(`\n Maximum accepted number of files\n The default value is 0 which means there is no limitation to how many files are accepted.\n `),\n disabled: PropTypes.bool.description('Enable/disable the dropzone'),\n getFilesFromEvent: PropTypes.func.description(`\n Use this to provide a custom file aggregator\n @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n `),\n onFileDialogCancel: PropTypes.func.description('Cb for when closing the file dialog with no selection'),\n onFileDialogOpen: PropTypes.func.description('Cb for when opening the file dialog'),\n useFsAccessApi: PropTypes.bool.description(`\n Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n to open the file picker instead of using an <input type=\"file\"> click event.\n `),\n onDragEnter: PropTypes.func.description(`\n Cb for when the dragenter event occurs.\n @param {DragEvent} event`),\n onDragLeave: PropTypes.func.description(`\n Cb for when the dragleave event occurs\n @param {DragEvent} event\n `),\n onDragOver: PropTypes.func.description(`\n Cb for when the dragover event occurs\n @param {DragEvent} event\n `),\n onDrop: PropTypes.func.description(`\n Cb for when the drop event occurs.\n onDrop will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library: \n @param {File[]} acceptedFiles\n @param {FileRejection[]} fileRejections\n @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n `),\n onDropAccepted: PropTypes.func.description(`\n Cb for when the drop event occurs.\n Note that if no files are accepted, this callback is not invoked.\n @param {File[]} files\n @param {(DragEvent|Event)} event\n `),\n onDropRejected: PropTypes.func.description(`\n Cb for when the drop event occurs.\n Note that if no files are rejected, this callback is not invoked. \n @param {FileRejection[]} fileRejections\n @param {(DragEvent|Event)} event\n `),\n onError: PropTypes.func.description(`\n Cb for when there's some error from any of the promises.\n @param {Error} error\n `),\n validator: PropTypes.func.description(`\n Custom validation function. It must return null if there's no errors.\n @param {File} file\n @returns {FileError|FileError[]|null}\n `),\n })\n .description(`react-dropzone options, see https://react-dropzone.js.org/ for more information V14.2.3`)\n .defaultValue({}),\n // onSomethingEvent: PropTypes.func\n // .description('some example of function, required if something is not foo')\n // .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,2BAA2B,wBAAwB;AA8BhE,MAAM,eAAyC;AAAA,EACpD,YAAY,CAAC;AACf;AAEO,MAAM,sBAA4D;AAAA,EACvE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,UAAU;AAAA,EACpB,UAAU,UAAU,KAAK,YAAY,yBAAyB;AAAA,EAC9D,YAAY,UAAU,MAAM;AAAA,IAC1B,QAAQ,UAAU,SAAS,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAM7E;AAAA,IACC,UAAU,UAAU,KAAK,YAAY,2EAA2E;AAAA,IAEhH,uBAAuB,UAAU,KAAK;AAAA,MACpC;AAAA,IACF;AAAA,IACA,SAAS,UAAU,KAAK,YAAY,kEAAkE;AAAA,IACtG,YAAY,UAAU,KAAK,YAAY;AAAA;AAAA,oDAES;AAAA,IAChD,QAAQ,UAAU,KAAK,YAAY,6BAA6B;AAAA,IAChE,sBAAsB,UAAU,KAAK,YAAY,kDAAkD;AAAA,IACnG,SAAS,UAAU,OAAO,YAAY,8BAA8B;AAAA,IACpE,SAAS,UAAU,OAAO,YAAY,8BAA8B;AAAA,IACpE,UAAU,UAAU,OAAO,YAAY;AAAA;AAAA;AAAA,GAGxC;AAAA,IACC,UAAU,UAAU,KAAK,YAAY,6BAA6B;AAAA,IAClE,mBAAmB,UAAU,KAAK,YAAY;AAAA;AAAA;AAAA,GAG/C;AAAA,IACC,oBAAoB,UAAU,KAAK,YAAY,uDAAuD;AAAA,IACtG,kBAAkB,UAAU,KAAK,YAAY,qCAAqC;AAAA,IAClF,gBAAgB,UAAU,KAAK,YAAY;AAAA;AAAA;AAAA,GAG5C;AAAA,IACC,aAAa,UAAU,KAAK,YAAY;AAAA;AAAA,2BAEjB;AAAA,IACvB,aAAa,UAAU,KAAK,YAAY;AAAA;AAAA;AAAA,GAGzC;AAAA,IACC,YAAY,UAAU,KAAK,YAAY;AAAA;AAAA;AAAA,GAGxC;AAAA,IACC,QAAQ,UAAU,KAAK,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAOpC;AAAA,IACC,gBAAgB,UAAU,KAAK,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,GAK5C;AAAA,IACC,gBAAgB,UAAU,KAAK,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,GAK5C;AAAA,IACC,SAAS,UAAU,KAAK,YAAY;AAAA;AAAA;AAAA,GAGrC;AAAA,IACC,WAAW,UAAU,KAAK,YAAY;AAAA;AAAA;AAAA;AAAA,KAIrC;AAAA,EACH,CAAC,EACE,YAAY,yFAAyF,EACrG,aAAa,CAAC,CAAC;AAAA;AAAA;AAAA;AAIpB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { styled } from "@elliemae/ds-system";
|
|
3
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
4
|
+
import { DROPZONE_SLOTS, DROP_ZONE_CONSTANTS, DSDropzoneName } from "./constants/index.js";
|
|
5
|
+
const borderImage = (color) => `url("data:image/svg+xml,%3csvg aria-hidden='true' width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='${DROP_ZONE_CONSTANTS.BORDER_RADIUS}' ry='${DROP_ZONE_CONSTANTS.BORDER_RADIUS}' stroke='${encodeURIComponent(color)}' stroke-width='${DROP_ZONE_CONSTANTS.BORDER_WIDTH}' stroke-dasharray='4 6' stroke-dashoffset='0' stroke-linecap='round'/%3e%3c/svg%3e")`;
|
|
6
|
+
const StyledDropZone = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.WRAPPER })`
|
|
7
|
+
position: relative;
|
|
8
|
+
border-radius: ${DROP_ZONE_CONSTANTS.BORDER_RADIUS}px;
|
|
9
|
+
|
|
10
|
+
background-color: ${(props) => props.theme.colors.neutral["000"]};
|
|
11
|
+
background-image: ${(props) => {
|
|
12
|
+
if (props.disabled) {
|
|
13
|
+
return borderImage(props.theme.colors.neutral[400]);
|
|
14
|
+
}
|
|
15
|
+
if (props.isDragActive) {
|
|
16
|
+
return borderImage(props.theme.colors.brand[600]);
|
|
17
|
+
}
|
|
18
|
+
if (props.isDragReject || props.hasError) {
|
|
19
|
+
return borderImage(props.theme.colors.danger[900]);
|
|
20
|
+
}
|
|
21
|
+
if (props.isFocused) {
|
|
22
|
+
return borderImage(props.theme.colors.brand[600]);
|
|
23
|
+
}
|
|
24
|
+
return borderImage(props.theme.colors.neutral[400]);
|
|
25
|
+
}};
|
|
26
|
+
padding: ${(props) => props.theme.space.xs} 1.8461538461538463rem;
|
|
27
|
+
&:hover {
|
|
28
|
+
background-image: ${(props) => {
|
|
29
|
+
if (props.disabled) {
|
|
30
|
+
return borderImage(props.theme.colors.neutral[400]);
|
|
31
|
+
}
|
|
32
|
+
if (props.isDragActive) {
|
|
33
|
+
return borderImage(props.theme.colors.brand[600]);
|
|
34
|
+
}
|
|
35
|
+
if (props.isDragReject) {
|
|
36
|
+
return borderImage(props.theme.colors.danger[900]);
|
|
37
|
+
}
|
|
38
|
+
if (props.isFocused) {
|
|
39
|
+
return borderImage(props.theme.colors.brand[600]);
|
|
40
|
+
}
|
|
41
|
+
return borderImage(props.theme.colors.brand[600]);
|
|
42
|
+
}};
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
export {
|
|
46
|
+
StyledDropZone
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styled.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DROPZONE_SLOTS, DROP_ZONE_CONSTANTS, DSDropzoneName } from './constants/index.js';\nimport type { DropzoneState } from 'react-dropzone';\n\n// const borderImageCreator = (color: any, stroke: number) =>\n// encodeURIComponent(\n// `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\"><rect width=\"100%\" height=\"100%\" fill=\"none\" rx=\"8\" ry=\"8\" stroke=\"${color}\" stroke-width=\"${stroke}\" stroke-dasharray=\"6, 14\" stroke-dashoffset=\"0\" stroke-linecap=\"square\"/></svg>`,\n// );\n\n// const handleBorder = (props: StyledProps<DSDropzoneT.InternalProps>): string => {\n// const { isDragAccept, isDragReject, isFocused } = props;\n// console.log(props);\n// if (isDragAccept) return borderImageCreator(props.theme.colors.brand[600], 2);\n// if (isDragReject) return borderImageCreator(props.theme.colors.danger[900], 2);\n// return borderImageCreator(props.theme.colors.neutral[400], 2);\n// };\n\nconst borderImage = (color: string) =>\n `url(\"data:image/svg+xml,%3csvg aria-hidden='true' width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='${\n DROP_ZONE_CONSTANTS.BORDER_RADIUS\n }' ry='${DROP_ZONE_CONSTANTS.BORDER_RADIUS}' stroke='${encodeURIComponent(color)}' stroke-width='${\n DROP_ZONE_CONSTANTS.BORDER_WIDTH\n }' stroke-dasharray='4 6' stroke-dashoffset='0' stroke-linecap='round'/%3e%3c/svg%3e\")`;\n\nexport const StyledDropZone = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.WRAPPER })<\n DropzoneState & {\n disabled: boolean;\n hasError: boolean;\n }\n>`\n position: relative;\n border-radius: ${DROP_ZONE_CONSTANTS.BORDER_RADIUS}px;\n\n background-color: ${(props) => props.theme.colors.neutral['000']};\n background-image: ${(props) => {\n if (props.disabled) {\n return borderImage(props.theme.colors.neutral[400]);\n }\n if (props.isDragActive) {\n return borderImage(props.theme.colors.brand[600]);\n }\n if (props.isDragReject || props.hasError) {\n return borderImage(props.theme.colors.danger[900]);\n }\n if (props.isFocused) {\n return borderImage(props.theme.colors.brand[600]);\n }\n return borderImage(props.theme.colors.neutral[400]);\n }};\n padding: ${(props) => props.theme.space.xs} 1.8461538461538463rem;\n &:hover {\n background-image: ${(props) => {\n if (props.disabled) {\n return borderImage(props.theme.colors.neutral[400]);\n }\n if (props.isDragActive) {\n return borderImage(props.theme.colors.brand[600]);\n }\n if (props.isDragReject) {\n return borderImage(props.theme.colors.danger[900]);\n }\n if (props.isFocused) {\n return borderImage(props.theme.colors.brand[600]);\n }\n return borderImage(props.theme.colors.brand[600]);\n }};\n }\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,gBAAgB,qBAAqB,sBAAsB;AAgBpE,MAAM,cAAc,CAAC,UACnB,gLACE,oBAAoB,sBACb,oBAAoB,0BAA0B,mBAAmB,KAAK,oBAC7E,oBAAoB;AAGjB,MAAM,iBAAiB,OAAO,MAAM,EAAE,MAAM,gBAAgB,MAAM,eAAe,QAAQ,CAAC;AAAA;AAAA,mBAO9E,oBAAoB;AAAA;AAAA,sBAEjB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA,sBAC3C,CAAC,UAAU;AAC7B,MAAI,MAAM,UAAU;AAClB,WAAO,YAAY,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,EACpD;AACA,MAAI,MAAM,cAAc;AACtB,WAAO,YAAY,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA,EAClD;AACA,MAAI,MAAM,gBAAgB,MAAM,UAAU;AACxC,WAAO,YAAY,MAAM,MAAM,OAAO,OAAO,GAAG,CAAC;AAAA,EACnD;AACA,MAAI,MAAM,WAAW;AACnB,WAAO,YAAY,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA,EAClD;AACA,SAAO,YAAY,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AACpD;AAAA,aACW,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA,wBAElB,CAAC,UAAU;AAC7B,MAAI,MAAM,UAAU;AAClB,WAAO,YAAY,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,EACpD;AACA,MAAI,MAAM,cAAc;AACtB,WAAO,YAAY,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA,EAClD;AACA,MAAI,MAAM,cAAc;AACtB,WAAO,YAAY,MAAM,MAAM,OAAO,OAAO,GAAG,CAAC;AAAA,EACnD;AACA,MAAI,MAAM,WAAW;AACnB,WAAO,YAAY,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA,EAClD;AACA,SAAO,YAAY,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAClD;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DSDropzoneT } from './react-desc-prop-types.js';
|
|
3
|
+
declare const DSDropzone: React.ComponentType<DSDropzoneT.Props>;
|
|
4
|
+
declare const DSDropzoneWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSDropzoneT.Props>;
|
|
5
|
+
export { DSDropzone, DSDropzoneWithSchema };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-utilities';
|
|
3
|
+
import { type DSDropzoneT } from '../react-desc-prop-types.js';
|
|
4
|
+
export interface DropzoneCTX {
|
|
5
|
+
propsWithDefault: DSDropzoneT.InternalProps;
|
|
6
|
+
globalProps: ReturnType<typeof useGetGlobalAttributes>;
|
|
7
|
+
xstyledProps: ReturnType<typeof useGetXstyledProps>;
|
|
8
|
+
instanceUid: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const useDSDropzone: (propsFromUser: DSDropzoneT.Props) => {
|
|
11
|
+
propsWithDefault: DSDropzoneT.InternalProps;
|
|
12
|
+
globalProps: import("lodash").Omit<import("@elliemae/ds-utilities").GlobalAttributesT<Element>, "cols" | "rows" | "wrap">;
|
|
13
|
+
xstyledProps: import("@elliemae/ds-utilities").XstyledProps;
|
|
14
|
+
instanceUid: string;
|
|
15
|
+
dropZoneState: import("react-dropzone").DropzoneState;
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const DSDropzoneName = "DSDropzone";
|
|
2
|
+
export declare const DROP_ZONE_CONSTANTS: {
|
|
3
|
+
readonly BORDER_WIDTH: 1;
|
|
4
|
+
readonly BORDER_RADIUS: 2;
|
|
5
|
+
};
|
|
6
|
+
export declare const DROPZONE_SLOTS: {
|
|
7
|
+
readonly ACTIVEZONE_LABEL: "activezone-label";
|
|
8
|
+
readonly ACTIVEZONE_ICON: "activezone-icon";
|
|
9
|
+
readonly ACTIVEZONE_WRAPPER: "activezone-wrapper";
|
|
10
|
+
readonly WRAPPER: "wrapper";
|
|
11
|
+
};
|
|
12
|
+
export declare const DROPZONE_DATA_TESTID: Record<string, string>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { DSDropzone, DSDropzoneWithSchema } from './DSDropzone.js';
|
|
2
|
+
export { type DSDropzoneT } from './react-desc-prop-types.js';
|
|
3
|
+
export { DROPZONE_DATA_TESTID } from './constants/index.js';
|
|
4
|
+
export { DSActivezone, DSActivezoneWithSchema } from './parts/DSActivezone/index.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DSActivezoneT } from './react-desc-prop-types.js';
|
|
3
|
+
declare const DSActivezone: React.ComponentType<DSActivezoneT.Props>;
|
|
4
|
+
declare const DSActivezoneWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSActivezoneT.Props>;
|
|
5
|
+
export { DSActivezone, DSActivezoneWithSchema };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { type DSActivezoneT } from '../react-desc-prop-types.js';
|
|
3
|
+
export declare const useActivezone: (propsFromUser: DSActivezoneT.Props) => {
|
|
4
|
+
propsWithDefault: DSActivezoneT.InternalProps;
|
|
5
|
+
globalProps: import("lodash").Omit<import("@elliemae/ds-props-helpers").GlobalAttributesT<Element>, "cols" | "rows" | "wrap">;
|
|
6
|
+
xstyledProps: import("@elliemae/ds-props-helpers").XstyledProps;
|
|
7
|
+
instanceUid: string;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DSActivezone, DSActivezoneWithSchema } from './DSActivezone.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';
|
|
2
|
+
import type { SvgIconT } from '@elliemae/ds-icons';
|
|
3
|
+
import type { WeakValidationMap } from 'react';
|
|
4
|
+
export declare namespace DSActivezoneT {
|
|
5
|
+
interface RequiredProps {
|
|
6
|
+
}
|
|
7
|
+
interface DefaultProps {
|
|
8
|
+
Icon: React.ComponentType<SvgIconT.Props>;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
interface OptionalProps {
|
|
12
|
+
}
|
|
13
|
+
interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>, XstyledProps, RequiredProps {
|
|
14
|
+
}
|
|
15
|
+
interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>, XstyledProps, RequiredProps {
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export declare const defaultProps: DSActivezoneT.DefaultProps;
|
|
19
|
+
export declare const DSActivezonePropTypes: DSPropTypesSchema<DSActivezoneT.Props>;
|
|
20
|
+
export declare const DSActivezonePropTypesSchema: WeakValidationMap<DSActivezoneT.Props>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';
|
|
2
|
+
import type { DropzoneOptions } from 'react-dropzone';
|
|
3
|
+
export declare namespace DSDropzoneT {
|
|
4
|
+
interface RequiredProps {
|
|
5
|
+
}
|
|
6
|
+
interface DefaultProps {
|
|
7
|
+
}
|
|
8
|
+
interface OptionalProps {
|
|
9
|
+
dropConfig?: DropzoneOptions;
|
|
10
|
+
hasError?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof OptionalProps | keyof XstyledProps>, XstyledProps, RequiredProps {
|
|
13
|
+
}
|
|
14
|
+
interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof OptionalProps | keyof XstyledProps>, XstyledProps, RequiredProps {
|
|
15
|
+
}
|
|
16
|
+
type ExampleState = '0' | '1';
|
|
17
|
+
}
|
|
18
|
+
export declare const defaultProps: DSDropzoneT.DefaultProps;
|
|
19
|
+
export declare const DSDropzonePropTypes: DSPropTypesSchema<DSDropzoneT.Props>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledDropZone: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/react-desc-prop-types.js").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, import("react-dropzone").DropzoneRef & {
|
|
3
|
+
isFocused: boolean;
|
|
4
|
+
isDragActive: boolean;
|
|
5
|
+
isDragAccept: boolean;
|
|
6
|
+
isDragReject: boolean;
|
|
7
|
+
isFileDialogActive: boolean;
|
|
8
|
+
acceptedFiles: File[];
|
|
9
|
+
fileRejections: import("react-dropzone").FileRejection[];
|
|
10
|
+
rootRef: import("react").RefObject<HTMLElement>;
|
|
11
|
+
inputRef: import("react").RefObject<HTMLInputElement>;
|
|
12
|
+
getRootProps: <T extends import("react-dropzone").DropzoneRootProps>(props?: T | undefined) => T;
|
|
13
|
+
getInputProps: <T_1 extends import("react-dropzone").DropzoneInputProps>(props?: T_1 | undefined) => T_1;
|
|
14
|
+
} & {
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
hasError: boolean;
|
|
17
|
+
} & import("@elliemae/ds-system").OwnerInterface, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elliemae/ds-dropzone",
|
|
3
|
+
"version": "3.22.0-next.30",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "ICE MT - Dimsum - Dropzone",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"*.css",
|
|
20
|
+
"*.scss"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"pnpm": ">=6",
|
|
28
|
+
"node": ">=16"
|
|
29
|
+
},
|
|
30
|
+
"author": "ICE MT",
|
|
31
|
+
"jestSonar": {
|
|
32
|
+
"sonar56x": true,
|
|
33
|
+
"reportPath": "reports",
|
|
34
|
+
"reportFile": "tests.xml",
|
|
35
|
+
"indent": 4
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@xstyled/styled-components": "~3.6.0",
|
|
39
|
+
"react-dropzone": "~14.2.3",
|
|
40
|
+
"uid": "^2.0.2",
|
|
41
|
+
"@elliemae/ds-button": "3.22.0-next.30",
|
|
42
|
+
"@elliemae/ds-grid": "3.22.0-next.30",
|
|
43
|
+
"@elliemae/ds-icons": "3.22.0-next.30",
|
|
44
|
+
"@elliemae/ds-props-helpers": "3.22.0-next.30",
|
|
45
|
+
"@elliemae/ds-system": "3.22.0-next.30",
|
|
46
|
+
"@elliemae/ds-typography": "3.22.0-next.30",
|
|
47
|
+
"@elliemae/ds-hooks-fontsize-media": "3.22.0-next.30",
|
|
48
|
+
"@elliemae/ds-utilities": "3.22.0-next.30"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@xstyled/system": "3.7.0",
|
|
52
|
+
"lodash": "^4.17.21",
|
|
53
|
+
"styled-components": "~5.3.9"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@testing-library/jest-dom": "~5.16.4",
|
|
57
|
+
"@testing-library/react": "~12.1.3",
|
|
58
|
+
"@testing-library/user-event": "~13.5.0",
|
|
59
|
+
"lodash": "^4.17.21",
|
|
60
|
+
"react": "^17.0.2",
|
|
61
|
+
"react-dom": "^17.0.2",
|
|
62
|
+
"styled-components": "~5.3.9"
|
|
63
|
+
},
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public",
|
|
66
|
+
"typeSafety": false
|
|
67
|
+
},
|
|
68
|
+
"scripts": {
|
|
69
|
+
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
70
|
+
"test": "pui-cli test --passWithNoTests",
|
|
71
|
+
"lint": "node ../../../scripts/lint.mjs --fix",
|
|
72
|
+
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
|
|
73
|
+
"dts": "node ../../../scripts/dts.mjs",
|
|
74
|
+
"dts:withdeps": "pnpm --filter {.}... dts",
|
|
75
|
+
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
76
|
+
"dev:build": "pnpm --filter {.}... build",
|
|
77
|
+
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
78
|
+
"checkDeps": "npx -yes ../../util/ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
79
|
+
}
|
|
80
|
+
}
|