@elliemae/ds-uploader 3.27.0-next.1 → 3.27.0-next.3
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/index.js +3 -5
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/index.js +2 -4
- package/dist/esm/index.js.map +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +8 -23
- package/dist/cjs/DSUploader.js +0 -192
- package/dist/cjs/DSUploader.js.map +0 -7
- package/dist/cjs/constants.js +0 -57
- package/dist/cjs/constants.js.map +0 -7
- package/dist/cjs/index.d.js +0 -28
- package/dist/cjs/index.d.js.map +0 -7
- package/dist/cjs/react-desc-prop-types.js +0 -91
- package/dist/cjs/react-desc-prop-types.js.map +0 -7
- package/dist/cjs/styled.js +0 -171
- package/dist/cjs/styled.js.map +0 -7
- package/dist/esm/DSUploader.js +0 -179
- package/dist/esm/DSUploader.js.map +0 -7
- package/dist/esm/constants.js +0 -27
- package/dist/esm/constants.js.map +0 -7
- package/dist/esm/index.d.js +0 -2
- package/dist/esm/index.d.js.map +0 -7
- package/dist/esm/react-desc-prop-types.js +0 -61
- package/dist/esm/react-desc-prop-types.js.map +0 -7
- package/dist/esm/styled.js +0 -141
- package/dist/esm/styled.js.map +0 -7
- package/dist/types/DSUploader.d.ts +0 -6
- package/dist/types/constants.d.ts +0 -18
- package/dist/types/index.d.d.ts +0 -27
- package/dist/types/react-desc-prop-types.d.ts +0 -32
- package/dist/types/styled.d.ts +0 -14
- package/dist/types/tests/DSUploader.test.d.ts +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -29,12 +29,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
30
|
var src_exports = {};
|
|
31
31
|
__export(src_exports, {
|
|
32
|
-
|
|
33
|
-
UploaderWithSchema: () => import_DSUploader.UploaderWithSchema,
|
|
34
|
-
default: () => import_DSUploader.default
|
|
32
|
+
default: () => import_ds_legacy_uploader.default
|
|
35
33
|
});
|
|
36
34
|
module.exports = __toCommonJS(src_exports);
|
|
37
35
|
var React = __toESM(require("react"));
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
__reExport(src_exports, require("@elliemae/ds-legacy-uploader"), module.exports);
|
|
37
|
+
var import_ds_legacy_uploader = __toESM(require("@elliemae/ds-legacy-uploader"));
|
|
40
38
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["export * from '@elliemae/ds-legacy-uploader';\nexport { default } from '@elliemae/ds-legacy-uploader';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,yCAAd;AACA,gCAAwB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export * from "@elliemae/ds-legacy-uploader";
|
|
3
|
+
import { default as default2 } from "@elliemae/ds-legacy-uploader";
|
|
4
4
|
export {
|
|
5
|
-
DSUploader,
|
|
6
|
-
UploaderWithSchema,
|
|
7
5
|
default2 as default
|
|
8
6
|
};
|
|
9
7
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAAA,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from '@elliemae/ds-legacy-uploader';\nexport { default } from '@elliemae/ds-legacy-uploader';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,SAAS,WAAAA,gBAAe;",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from '@elliemae/ds-legacy-uploader';
|
|
2
|
+
export { default } from '@elliemae/ds-legacy-uploader';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-uploader",
|
|
3
|
-
"version": "3.27.0-next.
|
|
3
|
+
"version": "3.27.0-next.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Uploader",
|
|
6
6
|
"files": [
|
|
@@ -13,14 +13,6 @@
|
|
|
13
13
|
".": {
|
|
14
14
|
"import": "./dist/esm/index.js",
|
|
15
15
|
"require": "./dist/cjs/index.js"
|
|
16
|
-
},
|
|
17
|
-
"./propTypes": {
|
|
18
|
-
"import": "./dist/esm/propTypes.js",
|
|
19
|
-
"require": "./dist/cjs/propTypes.js"
|
|
20
|
-
},
|
|
21
|
-
"./DSUploader": {
|
|
22
|
-
"import": "./dist/esm/DSUploader.js",
|
|
23
|
-
"require": "./dist/cjs/DSUploader.js"
|
|
24
16
|
}
|
|
25
17
|
},
|
|
26
18
|
"sideEffects": [
|
|
@@ -43,19 +35,12 @@
|
|
|
43
35
|
"indent": 4
|
|
44
36
|
},
|
|
45
37
|
"dependencies": {
|
|
46
|
-
"
|
|
47
|
-
"@elliemae/ds-button": "3.27.0-next.1",
|
|
48
|
-
"@elliemae/ds-classnames": "3.27.0-next.1",
|
|
49
|
-
"@elliemae/ds-system": "3.27.0-next.1",
|
|
50
|
-
"@elliemae/ds-icons": "3.27.0-next.1",
|
|
51
|
-
"@elliemae/ds-tooltip": "3.27.0-next.1",
|
|
52
|
-
"@elliemae/ds-props-helpers": "3.27.0-next.1",
|
|
53
|
-
"@elliemae/ds-utilities": "3.27.0-next.1"
|
|
38
|
+
"@elliemae/ds-legacy-uploader": "1.0.1"
|
|
54
39
|
},
|
|
55
40
|
"devDependencies": {
|
|
56
41
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
57
42
|
"@elliemae/pui-theme": "~2.7.0",
|
|
58
|
-
"@elliemae/ds-monorepo-devops": "3.27.0-next.
|
|
43
|
+
"@elliemae/ds-monorepo-devops": "3.27.0-next.3"
|
|
59
44
|
},
|
|
60
45
|
"peerDependencies": {
|
|
61
46
|
"lodash": "^4.17.21",
|
|
@@ -68,13 +53,13 @@
|
|
|
68
53
|
},
|
|
69
54
|
"scripts": {
|
|
70
55
|
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
71
|
-
"test": "
|
|
72
|
-
"lint": "
|
|
73
|
-
"eslint:fix": "
|
|
74
|
-
"dts": "
|
|
56
|
+
"test": "exit 0 | echo",
|
|
57
|
+
"lint": "exit 0 | echo",
|
|
58
|
+
"eslint:fix": "exit 0 | echo",
|
|
59
|
+
"dts": "exit 0 | echo",
|
|
75
60
|
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
76
61
|
"dev:build": "pnpm --filter {.}... build",
|
|
77
62
|
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
78
|
-
"checkDeps": "
|
|
63
|
+
"checkDeps": "exit 0 | echo"
|
|
79
64
|
}
|
|
80
65
|
}
|
package/dist/cjs/DSUploader.js
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
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 DSUploader_exports = {};
|
|
30
|
-
__export(DSUploader_exports, {
|
|
31
|
-
DSUploader: () => DSUploader,
|
|
32
|
-
UploaderWithSchema: () => UploaderWithSchema,
|
|
33
|
-
default: () => DSUploader_default
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(DSUploader_exports);
|
|
36
|
-
var React = __toESM(require("react"));
|
|
37
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
-
var import_react = require("react");
|
|
39
|
-
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
40
|
-
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
41
|
-
var import_ds_button = require("@elliemae/ds-button");
|
|
42
|
-
var import_react_dropzone = require("react-dropzone");
|
|
43
|
-
var import_ds_tooltip = __toESM(require("@elliemae/ds-tooltip"));
|
|
44
|
-
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
45
|
-
var import_styled = require("./styled.js");
|
|
46
|
-
var import_constants = require("./constants.js");
|
|
47
|
-
const ActionButton = ({ labelText, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
|
-
import_ds_button.DSButtonV2,
|
|
49
|
-
{
|
|
50
|
-
...otherProps,
|
|
51
|
-
buttonType: import_ds_button.BUTTON_TYPES.TEXT,
|
|
52
|
-
style: { padding: 0, height: "initial", borderWidth: "0px" },
|
|
53
|
-
children: labelText
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
const DSUploader = (props) => {
|
|
57
|
-
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
|
|
58
|
-
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.propTypes, import_constants.DSUploaderName);
|
|
59
|
-
const {
|
|
60
|
-
containerProps,
|
|
61
|
-
label,
|
|
62
|
-
icon: UploadFileIcon,
|
|
63
|
-
defaultActionLabel,
|
|
64
|
-
dragActiveInstructionalText,
|
|
65
|
-
dragActiveIcon: DragActiveIcon,
|
|
66
|
-
altActionLabel,
|
|
67
|
-
acceptedTypesText,
|
|
68
|
-
disabledDefault,
|
|
69
|
-
disabledAlt,
|
|
70
|
-
onDefaultHandlerClick,
|
|
71
|
-
onAltHandlerClick,
|
|
72
|
-
actions,
|
|
73
|
-
showAltAction,
|
|
74
|
-
defaultActionTooltipText,
|
|
75
|
-
altActionTooltipText,
|
|
76
|
-
...rest
|
|
77
|
-
} = propsWithDefault;
|
|
78
|
-
const { disabled, ...globalAttributes } = (0, import_ds_props_helpers.useGetGlobalAttributes)(rest);
|
|
79
|
-
const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(rest);
|
|
80
|
-
const getOwnerProps = (0, import_react.useCallback)(() => propsWithDefault, [propsWithDefault]);
|
|
81
|
-
const getOwnerPropsArguments = (0, import_react.useCallback)(() => ({}), []);
|
|
82
|
-
const { getRootProps, getInputProps, isDragActive } = (0, import_react_dropzone.useDropzone)(rest);
|
|
83
|
-
const { onClick: onOpenFile, ...rootProps } = getRootProps();
|
|
84
|
-
const disabledAll = disabledDefault && disabledAlt || disabled;
|
|
85
|
-
const delfaultActionButton = (0, import_react.useMemo)(
|
|
86
|
-
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
87
|
-
ActionButton,
|
|
88
|
-
{
|
|
89
|
-
disabled: disabledDefault || disabledAll,
|
|
90
|
-
labelText: actions.defaultAction ? actions.defaultAction : defaultActionLabel,
|
|
91
|
-
onClick: (...args) => {
|
|
92
|
-
if (!disabledDefault)
|
|
93
|
-
(0, import_ds_utilities.runAll)(onDefaultHandlerClick, onOpenFile)(...args);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
),
|
|
97
|
-
[actions.defaultAction, defaultActionLabel, disabledDefault, onDefaultHandlerClick, onOpenFile]
|
|
98
|
-
);
|
|
99
|
-
const altActionButton = (0, import_react.useMemo)(
|
|
100
|
-
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
101
|
-
ActionButton,
|
|
102
|
-
{
|
|
103
|
-
disabled: disabledAlt || disabledAll,
|
|
104
|
-
labelText: actions.altAction ? actions.altAction : altActionLabel,
|
|
105
|
-
onClick: (...args) => {
|
|
106
|
-
if (!disabledAlt)
|
|
107
|
-
onAltHandlerClick(...args);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
),
|
|
111
|
-
[actions.altAction, altActionLabel, disabledAlt, onAltHandlerClick]
|
|
112
|
-
);
|
|
113
|
-
const defaultAction = (0, import_react.useMemo)(
|
|
114
|
-
() => !defaultActionTooltipText ? delfaultActionButton : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
115
|
-
import_ds_tooltip.default,
|
|
116
|
-
{
|
|
117
|
-
containerProps: { id: "default-action-tooltip" },
|
|
118
|
-
interactionType: "hover",
|
|
119
|
-
title: defaultActionTooltipText,
|
|
120
|
-
triggerComponent: delfaultActionButton
|
|
121
|
-
}
|
|
122
|
-
),
|
|
123
|
-
[defaultActionTooltipText, delfaultActionButton]
|
|
124
|
-
);
|
|
125
|
-
const altAction = (0, import_react.useMemo)(
|
|
126
|
-
() => !altActionTooltipText ? altActionButton : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
127
|
-
import_ds_tooltip.default,
|
|
128
|
-
{
|
|
129
|
-
containerProps: { id: "alt-action-tooltip" },
|
|
130
|
-
interactionType: "hover",
|
|
131
|
-
title: altActionTooltipText,
|
|
132
|
-
triggerComponent: altActionButton
|
|
133
|
-
}
|
|
134
|
-
),
|
|
135
|
-
[altActionTooltipText, altActionButton]
|
|
136
|
-
);
|
|
137
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
138
|
-
import_styled.StyledUploaderWrapper,
|
|
139
|
-
{
|
|
140
|
-
...containerProps,
|
|
141
|
-
...globalAttributes,
|
|
142
|
-
...xstyledProps,
|
|
143
|
-
getOwnerProps,
|
|
144
|
-
getOwnerPropsArguments,
|
|
145
|
-
children: [
|
|
146
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
147
|
-
import_styled.StyledUploader,
|
|
148
|
-
{
|
|
149
|
-
...rootProps,
|
|
150
|
-
isDragActive,
|
|
151
|
-
getOwnerProps,
|
|
152
|
-
getOwnerPropsArguments,
|
|
153
|
-
disabled: disabledAll,
|
|
154
|
-
children: [
|
|
155
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledUploaderIconArea, { getOwnerProps, getOwnerPropsArguments, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UploadFileIcon, { size: "l" }) }),
|
|
156
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledDividerVertical, { getOwnerProps, getOwnerPropsArguments }),
|
|
157
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledUploaderInfo, { getOwnerProps, getOwnerPropsArguments, children: [
|
|
158
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledInfoText, { getOwnerProps, getOwnerPropsArguments, children: label }),
|
|
159
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledUploaderActions, { getOwnerProps, getOwnerPropsArguments, children: [
|
|
160
|
-
actions.defaultAction ? defaultAction : null,
|
|
161
|
-
(actions.altAction || showAltAction) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
162
|
-
actions.defaultAction && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
163
|
-
import_styled.StyledDividerVerticalActions,
|
|
164
|
-
{
|
|
165
|
-
getOwnerProps,
|
|
166
|
-
getOwnerPropsArguments
|
|
167
|
-
}
|
|
168
|
-
),
|
|
169
|
-
altAction
|
|
170
|
-
] })
|
|
171
|
-
] })
|
|
172
|
-
] }),
|
|
173
|
-
!disabledAll && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledUploaderDragActive, { getOwnerProps, getOwnerPropsArguments, children: [
|
|
174
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DragActiveIcon, { color: ["neutral", "0"], mr: "xxs" }),
|
|
175
|
-
dragActiveInstructionalText
|
|
176
|
-
] }),
|
|
177
|
-
!disabledAll && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { ...getInputProps(), "aria-label": "file" })
|
|
178
|
-
]
|
|
179
|
-
}
|
|
180
|
-
),
|
|
181
|
-
typeof acceptedTypesText === "string" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledAcceptedTypes, { getOwnerProps, getOwnerPropsArguments, children: acceptedTypesText.toUpperCase() })
|
|
182
|
-
]
|
|
183
|
-
}
|
|
184
|
-
);
|
|
185
|
-
};
|
|
186
|
-
DSUploader.actions = import_constants.defaultActions;
|
|
187
|
-
DSUploader.propTypes = import_react_desc_prop_types.propTypes;
|
|
188
|
-
DSUploader.displayName = import_constants.DSUploaderName;
|
|
189
|
-
const UploaderWithSchema = (0, import_ds_props_helpers.describe)(DSUploader);
|
|
190
|
-
UploaderWithSchema.propTypes = import_react_desc_prop_types.propTypes;
|
|
191
|
-
var DSUploader_default = DSUploader;
|
|
192
|
-
//# sourceMappingURL=DSUploader.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/DSUploader.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { type ComponentType, useCallback, useMemo } from 'react';\nimport { runAll } from '@elliemae/ds-utilities';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n useGetXstyledProps,\n} from '@elliemae/ds-props-helpers';\nimport { DSButtonV2, BUTTON_TYPES } from '@elliemae/ds-button';\nimport { useDropzone } from 'react-dropzone';\nimport DSTooltip from '@elliemae/ds-tooltip';\nimport { defaultProps, type DSUploaderT, type ActionButtonPropsT, propTypes } from './react-desc-prop-types.js';\nimport {\n StyledAcceptedTypes,\n StyledDividerVertical,\n StyledInfoText,\n StyledUploader,\n StyledUploaderDragActive,\n StyledUploaderIconArea,\n StyledUploaderInfo,\n StyledUploaderWrapper,\n StyledUploaderActions,\n StyledDividerVerticalActions,\n} from './styled.js';\nimport { DSUploaderName, defaultActions } from './constants.js';\nconst ActionButton = ({ labelText, ...otherProps }: ActionButtonPropsT): React.ReactElement => (\n <DSButtonV2\n {...otherProps}\n buttonType={BUTTON_TYPES.TEXT}\n style={{ padding: 0, height: 'initial', borderWidth: '0px' }}\n >\n {labelText}\n </DSButtonV2>\n);\n\nconst DSUploader: ComponentType<DSUploaderT.DefaultProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSUploaderT.DefaultProps>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, propTypes, DSUploaderName);\n\n const {\n containerProps,\n label,\n icon: UploadFileIcon,\n defaultActionLabel,\n dragActiveInstructionalText,\n dragActiveIcon: DragActiveIcon,\n altActionLabel,\n acceptedTypesText,\n disabledDefault,\n disabledAlt,\n onDefaultHandlerClick,\n onAltHandlerClick,\n actions,\n showAltAction,\n defaultActionTooltipText,\n altActionTooltipText,\n ...rest\n } = propsWithDefault;\n\n const { disabled, ...globalAttributes } = useGetGlobalAttributes(rest);\n const xstyledProps = useGetXstyledProps(rest);\n\n const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = useCallback(() => ({}), []);\n\n const { getRootProps, getInputProps, isDragActive } = useDropzone(rest);\n const { onClick: onOpenFile, ...rootProps } = getRootProps();\n const disabledAll = (disabledDefault && disabledAlt) || disabled;\n\n const delfaultActionButton = useMemo(\n () => (\n <ActionButton\n disabled={disabledDefault || disabledAll}\n labelText={actions.defaultAction ? (actions.defaultAction as string) : defaultActionLabel}\n onClick={(...args) => {\n if (!disabledDefault) runAll(onDefaultHandlerClick, onOpenFile)(...args);\n }}\n />\n ),\n [actions.defaultAction, defaultActionLabel, disabledDefault, onDefaultHandlerClick, onOpenFile],\n );\n\n const altActionButton = useMemo(\n () => (\n <ActionButton\n disabled={disabledAlt || disabledAll}\n labelText={actions.altAction ? (actions.altAction as string) : altActionLabel}\n onClick={(...args) => {\n if (!disabledAlt) onAltHandlerClick(...args);\n }}\n />\n ),\n [actions.altAction, altActionLabel, disabledAlt, onAltHandlerClick],\n );\n\n const defaultAction = useMemo(\n () =>\n !defaultActionTooltipText ? (\n delfaultActionButton\n ) : (\n <DSTooltip\n containerProps={{ id: 'default-action-tooltip' }}\n interactionType=\"hover\"\n title={defaultActionTooltipText}\n triggerComponent={delfaultActionButton}\n />\n ),\n [defaultActionTooltipText, delfaultActionButton],\n );\n\n const altAction = useMemo(\n () =>\n !altActionTooltipText ? (\n altActionButton\n ) : (\n <DSTooltip\n containerProps={{ id: 'alt-action-tooltip' }}\n interactionType=\"hover\"\n title={altActionTooltipText}\n triggerComponent={altActionButton}\n />\n ),\n [altActionTooltipText, altActionButton],\n );\n\n return (\n <StyledUploaderWrapper\n {...containerProps}\n {...globalAttributes}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledUploader\n {...rootProps}\n isDragActive={isDragActive}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n disabled={disabledAll}\n >\n <StyledUploaderIconArea getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <UploadFileIcon size=\"l\" />\n </StyledUploaderIconArea>\n <StyledDividerVertical getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments} />\n <StyledUploaderInfo getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <StyledInfoText getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {label}\n </StyledInfoText>\n <StyledUploaderActions getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {actions.defaultAction ? defaultAction : null}\n {(actions.altAction || showAltAction) && (\n <>\n {actions.defaultAction && (\n <StyledDividerVerticalActions\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n )}\n {altAction}\n </>\n )}\n </StyledUploaderActions>\n </StyledUploaderInfo>\n {!disabledAll && (\n <StyledUploaderDragActive getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <DragActiveIcon color={['neutral', '0']} mr=\"xxs\" />\n {dragActiveInstructionalText}\n </StyledUploaderDragActive>\n )}\n {!disabledAll && <input {...getInputProps()} aria-label=\"file\" />}\n </StyledUploader>\n {typeof acceptedTypesText === 'string' && (\n <StyledAcceptedTypes getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {acceptedTypesText.toUpperCase()}\n </StyledAcceptedTypes>\n )}\n </StyledUploaderWrapper>\n );\n};\n\nDSUploader.actions = defaultActions;\nDSUploader.propTypes = propTypes;\nDSUploader.displayName = DSUploaderName;\nconst UploaderWithSchema = describe(DSUploader);\nUploaderWithSchema.propTypes = propTypes;\n\nexport { UploaderWithSchema, DSUploader };\nexport default DSUploader;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD6BrB;AA3BF,mBAAgE;AAChE,0BAAuB;AACvB,8BAMO;AACP,uBAAyC;AACzC,4BAA4B;AAC5B,wBAAsB;AACtB,mCAAmF;AACnF,oBAWO;AACP,uBAA+C;AAC/C,MAAM,eAAe,CAAC,EAAE,WAAW,GAAG,WAAW,MAC/C;AAAA,EAAC;AAAA;AAAA,IACE,GAAG;AAAA,IACJ,YAAY,8BAAa;AAAA,IACzB,OAAO,EAAE,SAAS,GAAG,QAAQ,WAAW,aAAa,MAAM;AAAA,IAE1D;AAAA;AACH;AAGF,MAAM,aAAsD,CAAC,UAAU;AACrE,QAAM,uBAAmB,sDAAuD,OAAO,yCAAY;AACnG,8DAA+B,kBAAkB,wCAAW,+BAAc;AA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,CAAC,WAAW,GAAG,GAAG,IAAG,OAAM;AAAA,gBACjD;AAAA,iBACH;AAAA,cAED,CAAC,eAAe,4CAAC,WAAO,GAAG,cAAc,GAAG,cAAW,QAAO;AAAA;AAAA;AAAA,QACjE;AAAA,QACC,OAAO,sBAAsB,YAC5B,4CAAC,qCAAoB,eAA8B,wBAChD,4BAAkB,YAAY,GACjC;AAAA;AAAA;AAAA,EAEJ;AAEJ;AAEA,WAAW,UAAU;AACrB,WAAW,YAAY;AACvB,WAAW,cAAc;AACzB,MAAM,yBAAqB,kCAAS,UAAU;AAC9C,mBAAmB,YAAY;AAG/B,IAAO,qBAAQ;",
|
|
6
|
-
"names": ["DSTooltip"]
|
|
7
|
-
}
|
package/dist/cjs/constants.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
DSUploaderDataTestIds: () => DSUploaderDataTestIds,
|
|
32
|
-
DSUploaderName: () => DSUploaderName,
|
|
33
|
-
DSUploaderSlots: () => DSUploaderSlots,
|
|
34
|
-
defaultActions: () => defaultActions
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(constants_exports);
|
|
37
|
-
var React = __toESM(require("react"));
|
|
38
|
-
var import_ds_system = require("@elliemae/ds-system");
|
|
39
|
-
const DSUploaderName = "DSUploader";
|
|
40
|
-
const DSUploaderSlots = {
|
|
41
|
-
ROOT: "root",
|
|
42
|
-
UPLOADER: "uploader",
|
|
43
|
-
ICON_AREA: "icon-area",
|
|
44
|
-
DIVIDER_VERTICAL: "divider-vertical",
|
|
45
|
-
ACTIONS_DIVIDER_VERTICAL: "actions-divider-vertical",
|
|
46
|
-
UPLOADER_INFO: "uploader-info",
|
|
47
|
-
INFO_TEXT: "info-text",
|
|
48
|
-
UPLOADER_DRAG_ACTIVE: "uploader-drag-active",
|
|
49
|
-
ACCEPTED_TYPES: "accepted-types",
|
|
50
|
-
UPLOADER_ACTIONS: "uploader-actions"
|
|
51
|
-
};
|
|
52
|
-
const defaultActions = {
|
|
53
|
-
defaultAction: "LOCAL DRIVE",
|
|
54
|
-
altAction: "DOCUMENTS"
|
|
55
|
-
};
|
|
56
|
-
const DSUploaderDataTestIds = (0, import_ds_system.slotObjectToDataTestIds)(DSUploaderName, DSUploaderSlots);
|
|
57
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/constants.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSUploaderName = 'DSUploader';\n\nexport const DSUploaderSlots = {\n ROOT: 'root',\n UPLOADER: 'uploader',\n ICON_AREA: 'icon-area',\n DIVIDER_VERTICAL: 'divider-vertical',\n ACTIONS_DIVIDER_VERTICAL: 'actions-divider-vertical',\n UPLOADER_INFO: 'uploader-info',\n INFO_TEXT: 'info-text',\n UPLOADER_DRAG_ACTIVE: 'uploader-drag-active',\n ACCEPTED_TYPES: 'accepted-types',\n UPLOADER_ACTIONS: 'uploader-actions',\n};\n\nexport const defaultActions = {\n defaultAction: 'LOCAL DRIVE',\n altAction: 'DOCUMENTS',\n} as const;\n\nexport const DSUploaderDataTestIds = slotObjectToDataTestIds(DSUploaderName, DSUploaderSlots);\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,kBAAkB;AAAA,EAC7B,MAAM;AAAA,EACN,UAAU;AAAA,EACV,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,0BAA0B;AAAA,EAC1B,eAAe;AAAA,EACf,WAAW;AAAA,EACX,sBAAsB;AAAA,EACtB,gBAAgB;AAAA,EAChB,kBAAkB;AACpB;AAEO,MAAM,iBAAiB;AAAA,EAC5B,eAAe;AAAA,EACf,WAAW;AACb;AAEO,MAAM,4BAAwB,0CAAwB,gBAAgB,eAAe;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/cjs/index.d.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
-
var index_d_exports = {};
|
|
26
|
-
module.exports = __toCommonJS(index_d_exports);
|
|
27
|
-
var React = __toESM(require("react"));
|
|
28
|
-
//# sourceMappingURL=index.d.js.map
|
package/dist/cjs/index.d.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.d.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { DropzoneOptions } from 'react-dropzone';\n\nexport interface DSUploaderPropsT extends DropzoneOptions {\n containerProps?: Record<string, unknown>;\n label?: string;\n icon?: React.FC<{ size: string }>;\n defaultActionLabel?: string;\n dragActiveInstructionalText?: string;\n dragActiveIcon?: React.FC;\n altActionLabel?: string;\n acceptedTypesText?: string;\n disabledDefault?: boolean;\n disabledAlt?: boolean;\n onDefaultHandlerClick?: () => void | null;\n onAltHandlerClick?: () => void | null;\n actions?: Record<string, unknown>;\n showAltAction?: boolean;\n defaultActionTooltipText: string;\n altActionTooltipText: string;\n}\n\nexport interface ActionButtonPropsT {\n labelText: string;\n variant: undefined | 'variant-disabled';\n onClick: () => void | null;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
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 react_desc_prop_types_exports = {};
|
|
30
|
-
__export(react_desc_prop_types_exports, {
|
|
31
|
-
defaultProps: () => defaultProps,
|
|
32
|
-
propTypes: () => propTypes
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
35
|
-
var React = __toESM(require("react"));
|
|
36
|
-
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
-
var import_ds_icons = require("@elliemae/ds-icons");
|
|
38
|
-
var import_constants = require("./constants.js");
|
|
39
|
-
const propTypes = {
|
|
40
|
-
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
41
|
-
...import_ds_props_helpers.xstyledPropTypes,
|
|
42
|
-
containerProps: import_ds_props_helpers.PropTypes.object.description("Set of Properties attached to the main container."),
|
|
43
|
-
maxFiles: import_ds_props_helpers.PropTypes.number.description("Number of files accepted."),
|
|
44
|
-
minSize: import_ds_props_helpers.PropTypes.number.description("Minimun file size accepted in bytes."),
|
|
45
|
-
maxSize: import_ds_props_helpers.PropTypes.number.description("Maximum file size accepted in bytes."),
|
|
46
|
-
onDropRejected: import_ds_props_helpers.PropTypes.func.description(
|
|
47
|
-
"Cb called when files are rejected using maxFiles, minSize or maxSize properties."
|
|
48
|
-
),
|
|
49
|
-
disabled: import_ds_props_helpers.PropTypes.bool.description("Disables the DSUploader."),
|
|
50
|
-
multiple: import_ds_props_helpers.PropTypes.bool.description("Set to false to restrict multiple files selection/upload."),
|
|
51
|
-
accept: import_ds_props_helpers.PropTypes.string.description("String containing the accepted MIME type for the DSUploader"),
|
|
52
|
-
label: import_ds_props_helpers.PropTypes.string.description("Uploader label.").defaultValue("Browse"),
|
|
53
|
-
icon: import_ds_props_helpers.PropTypes.func.description("Uploader left icon.").defaultValue(import_ds_icons.UploadFile),
|
|
54
|
-
actions: import_ds_props_helpers.PropTypes.shape({
|
|
55
|
-
defaultAction: import_ds_props_helpers.PropTypes.string,
|
|
56
|
-
altAction: import_ds_props_helpers.PropTypes.string
|
|
57
|
-
}).description("Uploader actions.").defaultValue({ defaultAction: "LOCAL DRIVE" }),
|
|
58
|
-
defaultActionLabel: import_ds_props_helpers.PropTypes.string.description("First action button label."),
|
|
59
|
-
showAltAction: import_ds_props_helpers.PropTypes.bool.description("whether to show alternate action button or not.").defaultValue(true),
|
|
60
|
-
altActionLabel: import_ds_props_helpers.PropTypes.string.description("Second action button label.").defaultValue("LOCAL DRIVE"),
|
|
61
|
-
dragActiveInstructionalText: import_ds_props_helpers.PropTypes.string.description("informative text when user drags a file over the uploader zone.").defaultValue("DROP FILES HERE"),
|
|
62
|
-
dragActiveIcon: import_ds_props_helpers.PropTypes.func.description("Icon when user drags a file over the uploader zone."),
|
|
63
|
-
acceptedTypesText: import_ds_props_helpers.PropTypes.string.description("Information text to show what types are supported.").defaultValue("JPG, JPEG, PNG, PDF"),
|
|
64
|
-
disabledDefault: import_ds_props_helpers.PropTypes.bool.description("Whether the default uploader is disabled or not.").defaultValue(false),
|
|
65
|
-
disabledAlt: import_ds_props_helpers.PropTypes.bool.description("Whether the alternative uploader is disabled or not.").defaultValue(false),
|
|
66
|
-
onDefaultHandlerClick: import_ds_props_helpers.PropTypes.func.description("First action button click handler."),
|
|
67
|
-
onAltHandlerClick: import_ds_props_helpers.PropTypes.func.description("Second action button click handler."),
|
|
68
|
-
defaultActionTooltipText: import_ds_props_helpers.PropTypes.string.description("shows tooltip in default action button."),
|
|
69
|
-
altActionTooltipText: import_ds_props_helpers.PropTypes.string.description("Shows tooltip in alternate action button.")
|
|
70
|
-
};
|
|
71
|
-
const defaultProps = {
|
|
72
|
-
containerProps: {},
|
|
73
|
-
label: "Browse",
|
|
74
|
-
icon: import_ds_icons.UploadFile,
|
|
75
|
-
defaultActionLabel: "LOCAL DRIVE",
|
|
76
|
-
dragActiveInstructionalText: "DROP FILES HERE",
|
|
77
|
-
dragActiveIcon: import_ds_icons.UploadFile,
|
|
78
|
-
altActionLabel: "DOCUMENTS",
|
|
79
|
-
acceptedTypesText: "JPG, JPEG, PNG, PDF",
|
|
80
|
-
disabledDefault: false,
|
|
81
|
-
disabledAlt: false,
|
|
82
|
-
onDefaultHandlerClick: () => {
|
|
83
|
-
},
|
|
84
|
-
onAltHandlerClick: () => {
|
|
85
|
-
},
|
|
86
|
-
actions: import_constants.defaultActions,
|
|
87
|
-
showAltAction: false,
|
|
88
|
-
defaultActionTooltipText: "",
|
|
89
|
-
altActionTooltipText: ""
|
|
90
|
-
};
|
|
91
|
-
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { type WeakValidationMap } from 'react';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { UploadFile, SvgIconT } from '@elliemae/ds-icons';\nimport { defaultActions } from './constants.js';\n/** Inherits the props of react-dropzone https://react-dropzone.netlify.com/ */\n\nexport namespace DSUploaderT {\n export interface DefaultProps {\n containerProps: Record<string, unknown>;\n label: string;\n icon: React.FC<SvgIconT.Props>;\n defaultActionLabel?: string;\n dragActiveInstructionalText?: string;\n dragActiveIcon: React.FC<SvgIconT.Props>;\n altActionLabel: string;\n acceptedTypesText: string;\n disabledDefault: boolean;\n disabledAlt: boolean;\n onDefaultHandlerClick: () => void | null;\n onAltHandlerClick: () => void | null;\n actions: Record<string, unknown>;\n showAltAction: boolean;\n defaultActionTooltipText: string;\n altActionTooltipText: string;\n }\n\n export type ActionsT = Record<string, unknown>;\n}\n\nexport interface ActionButtonPropsT {\n labelText?: string;\n variant?: undefined | 'variant-disabled';\n onClick: () => void | null;\n disabled?: boolean;\n}\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n containerProps: PropTypes.object.description('Set of Properties attached to the main container.'),\n maxFiles: PropTypes.number.description('Number of files accepted.'),\n minSize: PropTypes.number.description('Minimun file size accepted in bytes.'),\n maxSize: PropTypes.number.description('Maximum file size accepted in bytes.'),\n onDropRejected: PropTypes.func.description(\n 'Cb called when files are rejected using maxFiles, minSize or maxSize properties.',\n ),\n disabled: PropTypes.bool.description('Disables the DSUploader.'),\n multiple: PropTypes.bool.description('Set to false to restrict multiple files selection/upload.'),\n accept: PropTypes.string.description('String containing the accepted MIME type for the DSUploader'),\n\n label: PropTypes.string.description('Uploader label.').defaultValue('Browse'),\n icon: PropTypes.func.description('Uploader left icon.').defaultValue(UploadFile),\n actions: PropTypes.shape({\n defaultAction: PropTypes.string,\n altAction: PropTypes.string,\n })\n .description('Uploader actions.')\n .defaultValue({ defaultAction: 'LOCAL DRIVE' }),\n defaultActionLabel: PropTypes.string.description('First action button label.'),\n showAltAction: PropTypes.bool.description('whether to show alternate action button or not.').defaultValue(true),\n altActionLabel: PropTypes.string.description('Second action button label.').defaultValue('LOCAL DRIVE'),\n dragActiveInstructionalText: PropTypes.string\n .description('informative text when user drags a file over the uploader zone.')\n .defaultValue('DROP FILES HERE'),\n dragActiveIcon: PropTypes.func.description('Icon when user drags a file over the uploader zone.'),\n acceptedTypesText: PropTypes.string\n .description('Information text to show what types are supported.')\n .defaultValue('JPG, JPEG, PNG, PDF'),\n disabledDefault: PropTypes.bool.description('Whether the default uploader is disabled or not.').defaultValue(false),\n disabledAlt: PropTypes.bool.description('Whether the alternative uploader is disabled or not.').defaultValue(false),\n onDefaultHandlerClick: PropTypes.func.description('First action button click handler.'),\n onAltHandlerClick: PropTypes.func.description('Second action button click handler.'),\n defaultActionTooltipText: PropTypes.string.description('shows tooltip in default action button.'),\n altActionTooltipText: PropTypes.string.description('Shows tooltip in alternate action button.'),\n} as unknown as WeakValidationMap<DSUploaderT.DefaultProps>;\n\nexport const defaultProps: DSUploaderT.DefaultProps = {\n containerProps: {},\n label: 'Browse',\n icon: UploadFile,\n defaultActionLabel: 'LOCAL DRIVE',\n dragActiveInstructionalText: 'DROP FILES HERE',\n dragActiveIcon: UploadFile,\n altActionLabel: 'DOCUMENTS',\n acceptedTypesText: 'JPG, JPEG, PNG, PDF',\n disabledDefault: false,\n disabledAlt: false,\n onDefaultHandlerClick: () => {},\n onAltHandlerClick: () => {},\n actions: defaultActions,\n showAltAction: false,\n defaultActionTooltipText: '',\n altActionTooltipText: '',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAAuE;AACvE,sBAAqC;AACrC,uBAA+B;AAiCxB,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,gBAAgB,kCAAU,OAAO,YAAY,mDAAmD;AAAA,EAChG,UAAU,kCAAU,OAAO,YAAY,2BAA2B;AAAA,EAClE,SAAS,kCAAU,OAAO,YAAY,sCAAsC;AAAA,EAC5E,SAAS,kCAAU,OAAO,YAAY,sCAAsC;AAAA,EAC5E,gBAAgB,kCAAU,KAAK;AAAA,IAC7B;AAAA,EACF;AAAA,EACA,UAAU,kCAAU,KAAK,YAAY,0BAA0B;AAAA,EAC/D,UAAU,kCAAU,KAAK,YAAY,2DAA2D;AAAA,EAChG,QAAQ,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