@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,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var DSDropzone_exports = {};
|
|
30
|
+
__export(DSDropzone_exports, {
|
|
31
|
+
DSDropzone: () => DSDropzone,
|
|
32
|
+
DSDropzoneWithSchema: () => DSDropzoneWithSchema
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(DSDropzone_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
39
|
+
var import_useDSDropzone = require("./config/useDSDropzone.js");
|
|
40
|
+
var import_constants = require("./constants/index.js");
|
|
41
|
+
var import_styled = require("./styled.js");
|
|
42
|
+
var import_DSActivezone = require("./parts/DSActivezone/DSActivezone.js");
|
|
43
|
+
const DSDropzone = (props) => {
|
|
44
|
+
const { propsWithDefault, globalProps, xstyledProps, dropZoneState } = (0, import_useDSDropzone.useDSDropzone)(props);
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
46
|
+
import_styled.StyledDropZone,
|
|
47
|
+
{
|
|
48
|
+
...globalProps,
|
|
49
|
+
...xstyledProps,
|
|
50
|
+
...dropZoneState.getRootProps({
|
|
51
|
+
isFocused: dropZoneState.isFocused,
|
|
52
|
+
isDragAccept: dropZoneState.isDragAccept,
|
|
53
|
+
isDragReject: dropZoneState.isDragReject
|
|
54
|
+
}),
|
|
55
|
+
isFocused: dropZoneState.isFocused,
|
|
56
|
+
isDragAccept: dropZoneState.isDragAccept,
|
|
57
|
+
isDragReject: dropZoneState.isDragReject,
|
|
58
|
+
isDragActive: dropZoneState.isDragActive,
|
|
59
|
+
hasError: propsWithDefault.hasError,
|
|
60
|
+
disabled: propsWithDefault.dropConfig.disabled,
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { ...dropZoneState.getInputProps() }),
|
|
63
|
+
propsWithDefault.children,
|
|
64
|
+
dropZoneState.isDragActive ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DSActivezone.DSActivezone, {}) : null
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
DSDropzone.propTypes = import_react_desc_prop_types.DSDropzonePropTypes;
|
|
70
|
+
DSDropzone.displayName = import_constants.DSDropzoneName;
|
|
71
|
+
const DSDropzoneWithSchema = (0, import_ds_props_helpers.describe)(DSDropzone);
|
|
72
|
+
DSDropzoneWithSchema.propTypes = import_react_desc_prop_types.DSDropzonePropTypes;
|
|
73
|
+
//# sourceMappingURL=DSDropzone.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSDropzone.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSDropzoneT, DSDropzonePropTypes } from './react-desc-prop-types.js';\nimport { useDSDropzone } from './config/useDSDropzone.js';\nimport { DSDropzoneName } from './constants/index.js';\nimport { StyledDropZone } from './styled.js';\nimport { DSActivezone } from './parts/DSActivezone/DSActivezone.js';\n\nconst DSDropzone: React.ComponentType<DSDropzoneT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps, dropZoneState } = useDSDropzone(props);\n return (\n <StyledDropZone\n {...globalProps}\n {...xstyledProps}\n {...dropZoneState.getRootProps({\n isFocused: dropZoneState.isFocused,\n isDragAccept: dropZoneState.isDragAccept,\n isDragReject: dropZoneState.isDragReject,\n })}\n isFocused={dropZoneState.isFocused}\n isDragAccept={dropZoneState.isDragAccept}\n isDragReject={dropZoneState.isDragReject}\n isDragActive={dropZoneState.isDragActive}\n hasError={propsWithDefault.hasError}\n disabled={propsWithDefault.dropConfig.disabled}\n >\n <input {...dropZoneState.getInputProps()} />\n {propsWithDefault.children}\n {dropZoneState.isDragActive ? <DSActivezone /> : null}\n </StyledDropZone>\n );\n};\n\nDSDropzone.propTypes = DSDropzonePropTypes;\nDSDropzone.displayName = DSDropzoneName;\nconst DSDropzoneWithSchema = describe(DSDropzone);\nDSDropzoneWithSchema.propTypes = DSDropzonePropTypes;\n\nexport { DSDropzone, DSDropzoneWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADWnB;AAVJ,8BAAyB;AACzB,mCAAsD;AACtD,2BAA8B;AAC9B,uBAA+B;AAC/B,oBAA+B;AAC/B,0BAA6B;AAE7B,MAAM,aAAqD,CAAC,UAAU;AACpE,QAAM,EAAE,kBAAkB,aAAa,cAAc,cAAc,QAAI,oCAAc,KAAK;AAC1F,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG,cAAc,aAAa;AAAA,QAC7B,WAAW,cAAc;AAAA,QACzB,cAAc,cAAc;AAAA,QAC5B,cAAc,cAAc;AAAA,MAC9B,CAAC;AAAA,MACD,WAAW,cAAc;AAAA,MACzB,cAAc,cAAc;AAAA,MAC5B,cAAc,cAAc;AAAA,MAC5B,cAAc,cAAc;AAAA,MAC5B,UAAU,iBAAiB;AAAA,MAC3B,UAAU,iBAAiB,WAAW;AAAA,MAEtC;AAAA,oDAAC,WAAO,GAAG,cAAc,cAAc,GAAG;AAAA,QACzC,iBAAiB;AAAA,QACjB,cAAc,eAAe,4CAAC,oCAAa,IAAK;AAAA;AAAA;AAAA,EACnD;AAEJ;AAEA,WAAW,YAAY;AACvB,WAAW,cAAc;AACzB,MAAM,2BAAuB,kCAAS,UAAU;AAChD,qBAAqB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useDSDropzone_exports = {};
|
|
30
|
+
__export(useDSDropzone_exports, {
|
|
31
|
+
useDSDropzone: () => useDSDropzone
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useDSDropzone_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_lodash = require("lodash");
|
|
37
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
38
|
+
var import_uid = require("uid");
|
|
39
|
+
var import_react_desc_prop_types = require("../react-desc-prop-types.js");
|
|
40
|
+
var import_react_dropzone = require("react-dropzone");
|
|
41
|
+
var import_useValidateProps = require("./useValidateProps.js");
|
|
42
|
+
const useDSDropzone = (propsFromUser) => {
|
|
43
|
+
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(propsFromUser, import_react_desc_prop_types.defaultProps);
|
|
44
|
+
(0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSDropzonePropTypes);
|
|
45
|
+
const globalProps = (0, import_lodash.omit)((0, import_ds_utilities.useGetGlobalAttributes)(propsWithDefault), [
|
|
46
|
+
"cols",
|
|
47
|
+
"rows",
|
|
48
|
+
"wrap"
|
|
49
|
+
]);
|
|
50
|
+
const xstyledProps = (0, import_ds_utilities.useGetXstyledProps)(propsWithDefault);
|
|
51
|
+
const { id, dropConfig } = propsWithDefault;
|
|
52
|
+
const instanceUid = import_react.default.useMemo(() => id || (0, import_uid.uid)(5), [id]);
|
|
53
|
+
const [isDragInside, setIsDragInside] = import_react.default.useState(false);
|
|
54
|
+
const dropConfigDefault = import_react.default.useMemo(
|
|
55
|
+
() => ({
|
|
56
|
+
...dropConfig,
|
|
57
|
+
noKeyboard: true,
|
|
58
|
+
onDragEnter: (event) => {
|
|
59
|
+
dropConfig?.onDragEnter?.(event);
|
|
60
|
+
setIsDragInside(true);
|
|
61
|
+
}
|
|
62
|
+
}),
|
|
63
|
+
[dropConfig]
|
|
64
|
+
);
|
|
65
|
+
const dropZoneState = (0, import_react_dropzone.useDropzone)(dropConfigDefault);
|
|
66
|
+
return import_react.default.useMemo(
|
|
67
|
+
() => ({
|
|
68
|
+
propsWithDefault,
|
|
69
|
+
globalProps,
|
|
70
|
+
xstyledProps,
|
|
71
|
+
instanceUid,
|
|
72
|
+
dropZoneState
|
|
73
|
+
// ...eventHandlers,
|
|
74
|
+
}),
|
|
75
|
+
[
|
|
76
|
+
propsWithDefault,
|
|
77
|
+
globalProps,
|
|
78
|
+
xstyledProps,
|
|
79
|
+
instanceUid,
|
|
80
|
+
dropZoneState
|
|
81
|
+
// eventHandlers,
|
|
82
|
+
]
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=useDSDropzone.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/useDSDropzone.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { omit } from 'lodash';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { type DSDropzoneT, DSDropzonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useDropzone } from 'react-dropzone';\n\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface DropzoneCTX {\n propsWithDefault: DSDropzoneT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useDSDropzone = (propsFromUser: DSDropzoneT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSDropzoneT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSDropzonePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSDropzoneT.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, dropConfig } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || uid(5), [id]);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n const [isDragInside, setIsDragInside] = React.useState(false);\n\n const dropConfigDefault = React.useMemo(\n () => ({\n ...dropConfig,\n noKeyboard: true,\n onDragEnter: (event) => {\n dropConfig?.onDragEnter?.(event);\n setIsDragInside(true);\n },\n }),\n [dropConfig],\n );\n const dropZoneState = useDropzone(dropConfigDefault);\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n dropZoneState,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n dropZoneState,\n // eventHandlers,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,oBAAqB;AACrB,0BAAyF;AACzF,iBAAoB;AACpB,mCAAoE;AACpE,4BAA4B;AAE5B,8BAAiC;AAS1B,MAAM,gBAAgB,CAAC,kBAAqC;AAIjE,QAAM,uBAAmB,kDAAwD,eAAe,yCAAY;AAC5G,gDAAiB,kBAAkB,gDAAmB;AAItD,QAAM,kBAAc,wBAAK,4CAAkD,gBAAgB,GAAG;AAAA,IAC5F;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,mBAAe,wCAAmB,gBAAgB;AAKxD,QAAM,EAAE,IAAI,WAAW,IAAI;AAC3B,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,UAAM,gBAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAI1D,QAAM,CAAC,cAAc,eAAe,IAAI,aAAAA,QAAM,SAAS,KAAK;AAE5D,QAAM,oBAAoB,aAAAA,QAAM;AAAA,IAC9B,OAAO;AAAA,MACL,GAAG;AAAA,MACH,YAAY;AAAA,MACZ,aAAa,CAAC,UAAU;AACtB,oBAAY,cAAc,KAAK;AAC/B,wBAAgB,IAAI;AAAA,MACtB;AAAA,IACF;AAAA,IACA,CAAC,UAAU;AAAA,EACb;AACA,QAAM,oBAAgB,mCAAY,iBAAiB;AACnD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useValidateProps_exports = {};
|
|
30
|
+
__export(useValidateProps_exports, {
|
|
31
|
+
useValidateProps: () => useValidateProps
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useValidateProps_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
36
|
+
var import_constants = require("../constants/index.js");
|
|
37
|
+
const useValidateProps = (props, propTypes) => {
|
|
38
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(props, propTypes, import_constants.DSDropzoneName);
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport type { WeakValidationMap } from 'react';\nimport { type DSDropzoneT } from '../react-desc-prop-types.js';\nimport { DSDropzoneName } from '../constants/index.js';\n\nexport const useValidateProps = (props: DSDropzoneT.InternalProps, propTypes: WeakValidationMap<unknown>): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSDropzoneName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA+C;AAG/C,uBAA+B;AAExB,MAAM,mBAAmB,CAAC,OAAkC,cAAgD;AAEjH,0DAA+B,OAAO,WAAW,+BAAc;AACjE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var constants_exports = {};
|
|
30
|
+
__export(constants_exports, {
|
|
31
|
+
DROPZONE_DATA_TESTID: () => DROPZONE_DATA_TESTID,
|
|
32
|
+
DROPZONE_SLOTS: () => DROPZONE_SLOTS,
|
|
33
|
+
DROP_ZONE_CONSTANTS: () => DROP_ZONE_CONSTANTS,
|
|
34
|
+
DSDropzoneName: () => DSDropzoneName
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(constants_exports);
|
|
37
|
+
var React = __toESM(require("react"));
|
|
38
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
39
|
+
const DSDropzoneName = "DSDropzone";
|
|
40
|
+
const DROP_ZONE_CONSTANTS = {
|
|
41
|
+
BORDER_WIDTH: 1,
|
|
42
|
+
BORDER_RADIUS: 2
|
|
43
|
+
};
|
|
44
|
+
const DROPZONE_SLOTS = {
|
|
45
|
+
ACTIVEZONE_LABEL: "activezone-label",
|
|
46
|
+
ACTIVEZONE_ICON: "activezone-icon",
|
|
47
|
+
ACTIVEZONE_WRAPPER: "activezone-wrapper",
|
|
48
|
+
WRAPPER: "wrapper"
|
|
49
|
+
};
|
|
50
|
+
const DROPZONE_DATA_TESTID = (0, import_ds_system.slotObjectToDataTestIds)(DSDropzoneName, DROPZONE_SLOTS);
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSDropzoneName = 'DSDropzone';\n\nexport const DROP_ZONE_CONSTANTS = {\n BORDER_WIDTH: 1,\n BORDER_RADIUS: 2,\n} as const;\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const DROPZONE_SLOTS = {\n ACTIVEZONE_LABEL: 'activezone-label',\n ACTIVEZONE_ICON: 'activezone-icon',\n ACTIVEZONE_WRAPPER: 'activezone-wrapper',\n WRAPPER: 'wrapper',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const DROPZONE_DATA_TESTID = slotObjectToDataTestIds(DSDropzoneName, DROPZONE_SLOTS);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,iBAAiB;AAEvB,MAAM,sBAAsB;AAAA,EACjC,cAAc;AAAA,EACd,eAAe;AACjB;AAGO,MAAM,iBAAiB;AAAA,EAC5B,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,SAAS;AACX;AAGO,MAAM,2BAAuB,0CAAwB,gBAAgB,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
DROPZONE_DATA_TESTID: () => import_constants.DROPZONE_DATA_TESTID,
|
|
32
|
+
DSActivezone: () => import_DSActivezone.DSActivezone,
|
|
33
|
+
DSActivezoneWithSchema: () => import_DSActivezone.DSActivezoneWithSchema,
|
|
34
|
+
DSDropzone: () => import_DSDropzone.DSDropzone,
|
|
35
|
+
DSDropzoneWithSchema: () => import_DSDropzone.DSDropzoneWithSchema
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(src_exports);
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_DSDropzone = require("./DSDropzone.js");
|
|
40
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
41
|
+
var import_constants = require("./constants/index.js");
|
|
42
|
+
var import_DSActivezone = require("./parts/DSActivezone/index.js");
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSDropzone, DSDropzoneWithSchema } from './DSDropzone.js';\nexport { type DSDropzoneT } from './react-desc-prop-types.js';\nexport { DROPZONE_DATA_TESTID } from './constants/index.js';\nexport { DSActivezone, DSActivezoneWithSchema } from './parts/DSActivezone/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,wBAAiD;AACjD,mCAAiC;AACjC,uBAAqC;AACrC,0BAAqD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var DSActivezone_exports = {};
|
|
30
|
+
__export(DSActivezone_exports, {
|
|
31
|
+
DSActivezone: () => DSActivezone,
|
|
32
|
+
DSActivezoneWithSchema: () => DSActivezoneWithSchema
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(DSActivezone_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
+
var import_ds_hooks_fontsize_media = require("@elliemae/ds-hooks-fontsize-media");
|
|
39
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
40
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
41
|
+
var import_ds_grid = require("@elliemae/ds-grid");
|
|
42
|
+
var import_ds_typography = require("@elliemae/ds-typography");
|
|
43
|
+
var import_useActivezone = require("./config/useActivezone.js");
|
|
44
|
+
var import_constants = require("../../constants/index.js");
|
|
45
|
+
console.log(import_constants.DROPZONE_SLOTS);
|
|
46
|
+
const StyledWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSDropzoneName, slot: import_constants.DROPZONE_SLOTS.ACTIVEZONE_WRAPPER })`
|
|
47
|
+
cursor: grabbing;
|
|
48
|
+
position: absolute;
|
|
49
|
+
border-radius: ${import_constants.DROP_ZONE_CONSTANTS.BORDER_RADIUS}px;
|
|
50
|
+
padding: ${(props) => props.theme.space.xxxs} 1.8461538461538463rem;
|
|
51
|
+
top: 0;
|
|
52
|
+
left: 0;
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
`;
|
|
56
|
+
const StyledLabel = (0, import_ds_system.styled)(import_ds_typography.DSTypography, { name: import_constants.DSDropzoneName, slot: import_constants.DROPZONE_SLOTS.ACTIVEZONE_LABEL })``;
|
|
57
|
+
const StyledIcon = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSDropzoneName, slot: import_constants.DROPZONE_SLOTS.ACTIVEZONE_ICON })``;
|
|
58
|
+
const colsDef = {
|
|
59
|
+
largeFont: ["auto"],
|
|
60
|
+
mediumFont: ["auto", "auto"],
|
|
61
|
+
smallFont: ["auto", "auto"]
|
|
62
|
+
};
|
|
63
|
+
const DSActivezone = (props) => {
|
|
64
|
+
const { propsWithDefault, globalProps, xstyledProps } = (0, import_useActivezone.useActivezone)(props);
|
|
65
|
+
const { Icon, label } = propsWithDefault;
|
|
66
|
+
const mainContentCols = (0, import_ds_hooks_fontsize_media.useFontsizeMedia)(colsDef);
|
|
67
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
68
|
+
StyledWrapper,
|
|
69
|
+
{
|
|
70
|
+
rows: ["auto"],
|
|
71
|
+
justifyContent: "center",
|
|
72
|
+
alignItems: "center",
|
|
73
|
+
bg: "brand-600",
|
|
74
|
+
gutter: "xxs",
|
|
75
|
+
cols: mainContentCols,
|
|
76
|
+
getOwnerProps: () => propsWithDefault,
|
|
77
|
+
...globalProps,
|
|
78
|
+
...xstyledProps,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledIcon, { justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { size: "l", color: "neutral-000" }) }),
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledLabel, { variant: "b2", color: "neutral-000", children: label })
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
DSActivezone.displayName = "DSActivezone";
|
|
87
|
+
const DSActivezoneWithSchema = (0, import_ds_props_helpers.describe)(DSActivezone);
|
|
88
|
+
DSActivezoneWithSchema.propTypes = import_react_desc_prop_types.DSActivezonePropTypesSchema;
|
|
89
|
+
//# sourceMappingURL=DSActivezone.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/DSActivezone/DSActivezone.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useFontsizeMedia } from '@elliemae/ds-hooks-fontsize-media';\nimport { type DSActivezoneT, DSActivezonePropTypesSchema } from './react-desc-prop-types.js';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { useActivezone } from './config/useActivezone.js';\nimport { DROPZONE_SLOTS, DROP_ZONE_CONSTANTS, DSDropzoneName } from '../../constants/index.js';\n\nconsole.log(DROPZONE_SLOTS);\n\nconst StyledWrapper = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_WRAPPER })`\n cursor: grabbing;\n position: absolute;\n border-radius: ${DROP_ZONE_CONSTANTS.BORDER_RADIUS}px;\n padding: ${(props) => props.theme.space.xxxs} 1.8461538461538463rem;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n`;\nconst StyledLabel = styled(DSTypography, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_LABEL })``;\nconst StyledIcon = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_ICON })``;\n\nconst colsDef = {\n largeFont: ['auto'],\n mediumFont: ['auto', 'auto'],\n smallFont: ['auto', 'auto'],\n};\n\nconst DSActivezone: React.ComponentType<DSActivezoneT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useActivezone(props);\n const { Icon, label } = propsWithDefault;\n const mainContentCols = useFontsizeMedia(colsDef);\n return (\n <StyledWrapper\n rows={['auto']}\n justifyContent=\"center\"\n alignItems=\"center\"\n bg=\"brand-600\"\n gutter=\"xxs\"\n cols={mainContentCols}\n getOwnerProps={() => propsWithDefault}\n {...globalProps}\n {...xstyledProps}\n >\n <StyledIcon justifyContent=\"center\">\n <Icon size=\"l\" color=\"neutral-000\" />\n </StyledIcon>\n <StyledLabel variant=\"b2\" color=\"neutral-000\">\n {label}\n </StyledLabel>\n </StyledWrapper>\n );\n};\n\nDSActivezone.displayName = 'DSActivezone';\nconst DSActivezoneWithSchema = describe(DSActivezone);\nDSActivezoneWithSchema.propTypes = DSActivezonePropTypesSchema;\n\nexport { DSActivezone, DSActivezoneWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoCnB;AAnCJ,8BAAyB;AACzB,qCAAiC;AACjC,mCAAgE;AAChE,uBAAuB;AACvB,qBAAqB;AACrB,2BAA6B;AAC7B,2BAA8B;AAC9B,uBAAoE;AAEpE,QAAQ,IAAI,+BAAc;AAE1B,MAAM,oBAAgB,yBAAO,qBAAM,EAAE,MAAM,iCAAgB,MAAM,gCAAe,mBAAmB,CAAC;AAAA;AAAA;AAAA,mBAGjF,qCAAoB;AAAA,aAC1B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAM1C,MAAM,kBAAc,yBAAO,mCAAc,EAAE,MAAM,iCAAgB,MAAM,gCAAe,iBAAiB,CAAC;AACxG,MAAM,iBAAa,yBAAO,qBAAM,EAAE,MAAM,iCAAgB,MAAM,gCAAe,gBAAgB,CAAC;AAE9F,MAAM,UAAU;AAAA,EACd,WAAW,CAAC,MAAM;AAAA,EAClB,YAAY,CAAC,QAAQ,MAAM;AAAA,EAC3B,WAAW,CAAC,QAAQ,MAAM;AAC5B;AAEA,MAAM,eAAyD,CAAC,UAAU;AACxE,QAAM,EAAE,kBAAkB,aAAa,aAAa,QAAI,oCAAc,KAAK;AAC3E,QAAM,EAAE,MAAM,MAAM,IAAI;AACxB,QAAM,sBAAkB,iDAAiB,OAAO;AAChD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,CAAC,MAAM;AAAA,MACb,gBAAe;AAAA,MACf,YAAW;AAAA,MACX,IAAG;AAAA,MACH,QAAO;AAAA,MACP,MAAM;AAAA,MACN,eAAe,MAAM;AAAA,MACpB,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ;AAAA,oDAAC,cAAW,gBAAe,UACzB,sDAAC,QAAK,MAAK,KAAI,OAAM,eAAc,GACrC;AAAA,QACA,4CAAC,eAAY,SAAQ,MAAK,OAAM,eAC7B,iBACH;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,aAAa,cAAc;AAC3B,MAAM,6BAAyB,kCAAS,YAAY;AACpD,uBAAuB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useActivezone_exports = {};
|
|
30
|
+
__export(useActivezone_exports, {
|
|
31
|
+
useActivezone: () => useActivezone
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useActivezone_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_lodash = require("lodash");
|
|
37
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
+
var import_uid = require("uid");
|
|
39
|
+
var import_react_desc_prop_types = require("../react-desc-prop-types.js");
|
|
40
|
+
var import_useValidateProps = require("./useValidateProps.js");
|
|
41
|
+
const useActivezone = (propsFromUser) => {
|
|
42
|
+
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(propsFromUser, import_react_desc_prop_types.defaultProps);
|
|
43
|
+
(0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSActivezonePropTypes);
|
|
44
|
+
const globalProps = (0, import_lodash.omit)((0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault), [
|
|
45
|
+
"cols",
|
|
46
|
+
"rows",
|
|
47
|
+
"wrap"
|
|
48
|
+
]);
|
|
49
|
+
const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
|
|
50
|
+
const { id } = propsWithDefault;
|
|
51
|
+
const instanceUid = import_react.default.useMemo(() => id || (0, import_uid.uid)(5), [id]);
|
|
52
|
+
return import_react.default.useMemo(
|
|
53
|
+
() => ({
|
|
54
|
+
propsWithDefault,
|
|
55
|
+
globalProps,
|
|
56
|
+
xstyledProps,
|
|
57
|
+
instanceUid
|
|
58
|
+
// ...eventHandlers,
|
|
59
|
+
}),
|
|
60
|
+
[
|
|
61
|
+
propsWithDefault,
|
|
62
|
+
globalProps,
|
|
63
|
+
xstyledProps,
|
|
64
|
+
instanceUid
|
|
65
|
+
// eventHandlers,
|
|
66
|
+
]
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=useActivezone.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/parts/DSActivezone/config/useActivezone.ts", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,oBAAqB;AACrB,8BAAyF;AACzF,iBAAoB;AACpB,mCAAwE;AACxE,8BAAiC;AAE1B,MAAM,gBAAgB,CAAC,kBAAuC;AAInE,QAAM,uBAAmB,sDAA0D,eAAe,yCAAY;AAC9G,gDAAiB,kBAAkB,kDAAqB;AAIxD,QAAM,kBAAc,wBAAK,gDAAoD,gBAAgB,GAAG;AAAA,IAC9F;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,mBAAe,4CAAmB,gBAAgB;AAKxD,QAAM,EAAE,GAAG,IAAI;AACf,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,UAAM,gBAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAO1D,SAAO,aAAAA,QAAM;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,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useValidateProps_exports = {};
|
|
30
|
+
__export(useValidateProps_exports, {
|
|
31
|
+
useValidateProps: () => useValidateProps
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useValidateProps_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
36
|
+
var import_constants = require("../../../constants/index.js");
|
|
37
|
+
const useValidateProps = (props, propTypes) => {
|
|
38
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, import_constants.DSDropzoneName);
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/parts/DSActivezone/config/useValidateProps.ts", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAG/C,uBAA+B;AAExB,MAAM,mBAAmB,CAAC,OAAoC,cAAgD;AACnH,8DAA+B,OAAO,WAAW,+BAAc;AACjE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var DSActivezone_exports = {};
|
|
30
|
+
__export(DSActivezone_exports, {
|
|
31
|
+
DSActivezone: () => import_DSActivezone.DSActivezone,
|
|
32
|
+
DSActivezoneWithSchema: () => import_DSActivezone.DSActivezoneWithSchema
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(DSActivezone_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_DSActivezone = require("./DSActivezone.js");
|
|
37
|
+
//# sourceMappingURL=index.js.map
|