iglooform 3.3.7 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dumi/tmp/core/defineApp.ts +1 -1
- package/.dumi/tmp/core/helmet.ts +1 -1
- package/.dumi/tmp/core/history.ts +1 -1
- package/.dumi/tmp/core/historyIntelli.ts +1 -1
- package/.dumi/tmp/core/plugin.ts +2 -2
- package/.dumi/tmp/core/polyfill.ts +197 -197
- package/.dumi/tmp/core/route.tsx +33 -33
- package/.dumi/tmp/dumi/exports.ts +1 -1
- package/.dumi/tmp/dumi/locales/runtime.tsx +2 -2
- package/.dumi/tmp/dumi/meta/index.ts +33 -33
- package/.dumi/tmp/dumi/meta/runtime.ts +1 -1
- package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +2 -2
- package/.dumi/tmp/dumi/theme/builtins/API.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Badge.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Container.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Table.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Tree.ts +1 -1
- package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +1 -1
- package/.dumi/tmp/dumi/theme/loading.tsx +1 -1
- package/.dumi/tmp/dumi/theme/slots/ColorSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Content.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/ContentFooter.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Features.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Footer.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Header.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/HeaderExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Hero.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Logo.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Navbar.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/NavbarExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/NotFound.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +2 -2
- package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/SocialIcon.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Toc.ts +1 -1
- package/.dumi/tmp/exports.ts +5 -5
- package/.dumi/tmp/testBrowser.tsx +3 -3
- package/.dumi/tmp/umi.ts +4 -4
- package/es/button/style/index.less +24 -20
- package/es/documents/index.js +27 -3
- package/es/media/index.d.ts +1 -0
- package/es/media/index.js +67 -36
- package/es/media/media.d.ts +4 -1
- package/es/media/media.js +76 -29
- package/lib/button/style/index.less +24 -20
- package/lib/documents/index.js +27 -3
- package/lib/media/index.d.ts +1 -0
- package/lib/media/index.js +66 -36
- package/lib/media/media.d.ts +4 -1
- package/lib/media/media.js +75 -29
- package/package.json +1 -1
- package/.idea/iglooform.iml +0 -9
- package/.idea/misc.xml +0 -5
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/es/admin-amount/style/index.d.ts +0 -0
- package/es/admin-upload/style/index.d.ts +0 -1
- package/es/alert-message/style/index.d.ts +0 -1
- package/es/babel-plugin-import-option.d.ts +0 -7
- package/es/back-top/index.d.ts +0 -5
- package/es/back-top/style/index.d.ts +0 -1
- package/es/button/style/index.d.ts +0 -1
- package/es/card-detail/style/index.d.ts +0 -1
- package/es/checkbox/style/index.d.ts +0 -1
- package/es/claim-list/style/index.d.ts +0 -1
- package/es/config-provider.d.ts +0 -9
- package/es/confirmation/style/index.d.ts +0 -1
- package/es/currency-context/index.d.ts +0 -8
- package/es/currency-context/style/index.d.ts +0 -0
- package/es/date-picker/style/index.d.ts +0 -1
- package/es/declaration/style/index.d.ts +0 -1
- package/es/detail-panel/style/index.d.ts +0 -1
- package/es/documents/style/index.d.ts +0 -1
- package/es/filter/style/index.d.ts +0 -1
- package/es/form/addable-section/style/index.d.ts +0 -1
- package/es/form/divider/style/index.d.ts +0 -1
- package/es/form/element/style/index.d.ts +0 -1
- package/es/form/hstep/style/index.d.ts +0 -1
- package/es/form/hsteps/style/index.d.ts +0 -1
- package/es/form/login/style/index.d.ts +0 -1
- package/es/form/messages.d.ts +0 -48
- package/es/form/page/style/index.d.ts +0 -1
- package/es/form/pages/style/index.d.ts +0 -1
- package/es/form/render/style/index.d.ts +0 -1
- package/es/form/section/style/index.d.ts +0 -1
- package/es/form/step/style/index.d.ts +0 -1
- package/es/form/steps/style/index.d.ts +0 -1
- package/es/form/style/index.d.ts +0 -1
- package/es/free-form/addable-section/style/index.d.ts +0 -1
- package/es/free-form/element/style/index.d.ts +0 -1
- package/es/free-form/messages.d.ts +0 -48
- package/es/free-form/page/style/index.d.ts +0 -1
- package/es/free-form/pages/style/index.d.ts +0 -1
- package/es/free-form/section/style/index.d.ts +0 -1
- package/es/free-form/step/style/index.d.ts +0 -1
- package/es/free-form/steps/style/index.d.ts +0 -1
- package/es/free-form/style/index.d.ts +0 -1
- package/es/home-menu/style/index.d.ts +0 -1
- package/es/input/style/amount/index.d.ts +0 -2
- package/es/input/style/index.d.ts +0 -2
- package/es/input/style/input-date/index.d.ts +0 -2
- package/es/input/style/otp/index.d.ts +0 -2
- package/es/input/style/phone-number/index.d.ts +0 -2
- package/es/input/style/text-area/index.d.ts +0 -2
- package/es/layout/defaultHeader.d.ts +0 -4
- package/es/layout/style/index.d.ts +0 -1
- package/es/locale/en-US.d.ts +0 -2
- package/es/locale/format-message.d.ts +0 -10
- package/es/locale/formatted-message.d.ts +0 -6
- package/es/locale/id-ID.d.ts +0 -2
- package/es/locale/index.d.ts +0 -4
- package/es/locale/locale-context.d.ts +0 -12
- package/es/locale/locale-provider.d.ts +0 -13
- package/es/locale/ms-MY.d.ts +0 -2
- package/es/locale/th-TH.d.ts +0 -2
- package/es/locale/vi-VN.d.ts +0 -2
- package/es/locale/zh-CN.d.ts +0 -2
- package/es/locale/zh-TW.d.ts +0 -2
- package/es/login-page/index.d.ts +0 -7
- package/es/login-page/style/index.d.ts +0 -1
- package/es/media/file-icon.d.ts +0 -9
- package/es/media/style/index.d.ts +0 -1
- package/es/message/style/index.d.ts +0 -1
- package/es/mobile-insurer-detail/style/index.d.ts +0 -1
- package/es/mobile-insurer-list/style/index.d.ts +0 -1
- package/es/modal/style/index.d.ts +0 -1
- package/es/ocr/micro-blink/style/index.d.ts +0 -1
- package/es/platform/index.d.ts +0 -2
- package/es/platform/platform-card/index.d.ts +0 -12
- package/es/platform/platform-card/style/index.d.ts +0 -1
- package/es/platform/switch-platform/index.d.ts +0 -12
- package/es/platform/switch-platform/style/index.d.ts +0 -1
- package/es/policy-list/style/index.d.ts +0 -1
- package/es/radio/style/index.d.ts +0 -1
- package/es/search-box/style/index.d.ts +0 -1
- package/es/select/style/index.d.ts +0 -1
- package/es/status-box/style/index.d.ts +0 -1
- package/es/table/style/index.d.ts +0 -1
- package/es/tabs/index.d.ts +0 -15
- package/es/tabs/style/index.d.ts +0 -1
- package/es/typography/style/index.d.ts +0 -1
- package/es/upload/style/index.d.ts +0 -1
- package/es/upload-photo/media.d.ts +0 -7
- package/es/upload-photo/style/index.d.ts +0 -1
- package/es/upload-preview/style/index.d.ts +0 -1
- package/es/utils/agent-detect.d.ts +0 -1
- package/es/utils/tools.d.ts +0 -5
- package/es/utils/useAsyncEffect.d.ts +0 -3
- package/lib/admin-amount/style/index.d.ts +0 -0
- package/lib/admin-upload/style/index.d.ts +0 -1
- package/lib/alert-message/style/index.d.ts +0 -1
- package/lib/babel-plugin-import-option.d.ts +0 -7
- package/lib/back-top/index.d.ts +0 -5
- package/lib/back-top/style/index.d.ts +0 -1
- package/lib/button/style/index.d.ts +0 -1
- package/lib/card-detail/style/index.d.ts +0 -1
- package/lib/checkbox/style/index.d.ts +0 -1
- package/lib/claim-list/style/index.d.ts +0 -1
- package/lib/config-provider.d.ts +0 -9
- package/lib/confirmation/style/index.d.ts +0 -1
- package/lib/currency-context/index.d.ts +0 -8
- package/lib/currency-context/style/index.d.ts +0 -0
- package/lib/date-picker/style/index.d.ts +0 -1
- package/lib/declaration/style/index.d.ts +0 -1
- package/lib/detail-panel/style/index.d.ts +0 -1
- package/lib/documents/style/index.d.ts +0 -1
- package/lib/filter/style/index.d.ts +0 -1
- package/lib/form/addable-section/style/index.d.ts +0 -1
- package/lib/form/divider/style/index.d.ts +0 -1
- package/lib/form/element/style/index.d.ts +0 -1
- package/lib/form/hstep/style/index.d.ts +0 -1
- package/lib/form/hsteps/style/index.d.ts +0 -1
- package/lib/form/login/style/index.d.ts +0 -1
- package/lib/form/messages.d.ts +0 -48
- package/lib/form/page/style/index.d.ts +0 -1
- package/lib/form/pages/style/index.d.ts +0 -1
- package/lib/form/render/style/index.d.ts +0 -1
- package/lib/form/section/style/index.d.ts +0 -1
- package/lib/form/step/style/index.d.ts +0 -1
- package/lib/form/steps/style/index.d.ts +0 -1
- package/lib/form/style/index.d.ts +0 -1
- package/lib/free-form/addable-section/style/index.d.ts +0 -1
- package/lib/free-form/element/style/index.d.ts +0 -1
- package/lib/free-form/messages.d.ts +0 -48
- package/lib/free-form/page/style/index.d.ts +0 -1
- package/lib/free-form/pages/style/index.d.ts +0 -1
- package/lib/free-form/section/style/index.d.ts +0 -1
- package/lib/free-form/step/style/index.d.ts +0 -1
- package/lib/free-form/steps/style/index.d.ts +0 -1
- package/lib/free-form/style/index.d.ts +0 -1
- package/lib/home-menu/style/index.d.ts +0 -1
- package/lib/input/style/amount/index.d.ts +0 -2
- package/lib/input/style/index.d.ts +0 -2
- package/lib/input/style/input-date/index.d.ts +0 -2
- package/lib/input/style/otp/index.d.ts +0 -2
- package/lib/input/style/phone-number/index.d.ts +0 -2
- package/lib/input/style/text-area/index.d.ts +0 -2
- package/lib/layout/defaultHeader.d.ts +0 -4
- package/lib/layout/style/index.d.ts +0 -1
- package/lib/locale/en-US.d.ts +0 -2
- package/lib/locale/format-message.d.ts +0 -10
- package/lib/locale/formatted-message.d.ts +0 -6
- package/lib/locale/id-ID.d.ts +0 -2
- package/lib/locale/index.d.ts +0 -4
- package/lib/locale/locale-context.d.ts +0 -12
- package/lib/locale/locale-provider.d.ts +0 -13
- package/lib/locale/ms-MY.d.ts +0 -2
- package/lib/locale/th-TH.d.ts +0 -2
- package/lib/locale/vi-VN.d.ts +0 -2
- package/lib/locale/zh-CN.d.ts +0 -2
- package/lib/locale/zh-TW.d.ts +0 -2
- package/lib/login-page/index.d.ts +0 -7
- package/lib/login-page/style/index.d.ts +0 -1
- package/lib/media/file-icon.d.ts +0 -9
- package/lib/media/style/index.d.ts +0 -1
- package/lib/message/style/index.d.ts +0 -1
- package/lib/mobile-insurer-detail/style/index.d.ts +0 -1
- package/lib/mobile-insurer-list/style/index.d.ts +0 -1
- package/lib/modal/style/index.d.ts +0 -1
- package/lib/ocr/micro-blink/style/index.d.ts +0 -1
- package/lib/platform/index.d.ts +0 -2
- package/lib/platform/platform-card/index.d.ts +0 -12
- package/lib/platform/platform-card/style/index.d.ts +0 -1
- package/lib/platform/switch-platform/index.d.ts +0 -12
- package/lib/platform/switch-platform/style/index.d.ts +0 -1
- package/lib/policy-list/style/index.d.ts +0 -1
- package/lib/radio/style/index.d.ts +0 -1
- package/lib/search-box/style/index.d.ts +0 -1
- package/lib/select/style/index.d.ts +0 -1
- package/lib/status-box/style/index.d.ts +0 -1
- package/lib/table/style/index.d.ts +0 -1
- package/lib/tabs/index.d.ts +0 -15
- package/lib/tabs/style/index.d.ts +0 -1
- package/lib/typography/style/index.d.ts +0 -1
- package/lib/upload/style/index.d.ts +0 -1
- package/lib/upload-photo/media.d.ts +0 -7
- package/lib/upload-photo/style/index.d.ts +0 -1
- package/lib/upload-preview/style/index.d.ts +0 -1
- package/lib/utils/agent-detect.d.ts +0 -1
- package/lib/utils/tools.d.ts +0 -5
- package/lib/utils/useAsyncEffect.d.ts +0 -3
package/lib/media/index.js
CHANGED
|
@@ -49,40 +49,54 @@ var MediaWithPreview = function MediaWithPreview(_ref) {
|
|
|
49
49
|
download = _ref$download === void 0 ? {
|
|
50
50
|
actionType: 'downloadBlob'
|
|
51
51
|
} : _ref$download,
|
|
52
|
-
getNonCORSUrl = _ref.getNonCORSUrl
|
|
52
|
+
getNonCORSUrl = _ref.getNonCORSUrl,
|
|
53
|
+
loadingProp = _ref.loading;
|
|
53
54
|
var _ref2 = _typeof(srcProp) === 'object' ? [srcProp.origin, srcProp.nonCORS] : [srcProp],
|
|
54
55
|
_ref3 = _slicedToArray(_ref2, 2),
|
|
55
56
|
src = _ref3[0],
|
|
56
57
|
nonCORSSrcProp = _ref3[1];
|
|
57
|
-
var _useState = (0, _react.useState)(
|
|
58
|
+
var _useState = (0, _react.useState)(true),
|
|
58
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
var _useState3 = (0, _react.useState)(
|
|
60
|
+
loading = _useState2[0],
|
|
61
|
+
setLoading = _useState2[1];
|
|
62
|
+
var _useState3 = (0, _react.useState)(nonCORSSrcProp),
|
|
62
63
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var _useState5 = (0, _react.useState)(
|
|
64
|
+
nonCORSSrc = _useState4[0],
|
|
65
|
+
setNonCORSSrc = _useState4[1];
|
|
66
|
+
var _useState5 = (0, _react.useState)(1),
|
|
66
67
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var _useState7 = (0, _react.useState)(
|
|
68
|
+
scale = _useState6[0],
|
|
69
|
+
setScale = _useState6[1];
|
|
70
|
+
var _useState7 = (0, _react.useState)(type),
|
|
70
71
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var _useState9 = (0, _react.useState)(
|
|
72
|
+
mediaType = _useState8[0],
|
|
73
|
+
setType = _useState8[1];
|
|
74
|
+
var _useState9 = (0, _react.useState)(false),
|
|
74
75
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var _useState11 = (0, _react.useState)(
|
|
76
|
+
showModal = _useState10[0],
|
|
77
|
+
setShowModal = _useState10[1];
|
|
78
|
+
var _useState11 = (0, _react.useState)(index),
|
|
78
79
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
current = _useState12[0],
|
|
81
|
+
setCurrent = _useState12[1];
|
|
82
|
+
var _useState13 = (0, _react.useState)(''),
|
|
83
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
84
|
+
direction = _useState14[0],
|
|
85
|
+
setDirection = _useState14[1];
|
|
86
|
+
(0, _react.useEffect)(function () {
|
|
87
|
+
setType(type);
|
|
88
|
+
}, [type]);
|
|
89
|
+
(0, _react.useEffect)(function () {
|
|
90
|
+
if (loadingProp === undefined) return;
|
|
91
|
+
setLoading(loadingProp);
|
|
92
|
+
}, [loadingProp]);
|
|
81
93
|
(0, _react.useEffect)(function () {
|
|
82
94
|
setNonCORSSrc(nonCORSSrcProp);
|
|
83
95
|
}, [nonCORSSrcProp]);
|
|
84
96
|
(0, _react.useEffect)(function () {
|
|
97
|
+
if (!src) return;
|
|
85
98
|
if (mediaType) {
|
|
99
|
+
setLoading(false);
|
|
86
100
|
return;
|
|
87
101
|
}
|
|
88
102
|
var unmounted = false;
|
|
@@ -92,27 +106,29 @@ var MediaWithPreview = function MediaWithPreview(_ref) {
|
|
|
92
106
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
93
107
|
while (1) switch (_context.prev = _context.next) {
|
|
94
108
|
case 0:
|
|
109
|
+
setLoading(true);
|
|
95
110
|
_context.t0 = nonCORSSrc;
|
|
96
111
|
if (_context.t0) {
|
|
97
|
-
_context.next =
|
|
112
|
+
_context.next = 6;
|
|
98
113
|
break;
|
|
99
114
|
}
|
|
100
|
-
_context.next =
|
|
115
|
+
_context.next = 5;
|
|
101
116
|
return getNonCORSUrl === null || getNonCORSUrl === void 0 ? void 0 : getNonCORSUrl(src);
|
|
102
|
-
case 4:
|
|
103
|
-
_context.t0 = _context.sent;
|
|
104
117
|
case 5:
|
|
118
|
+
_context.t0 = _context.sent;
|
|
119
|
+
case 6:
|
|
105
120
|
_nonCORSSrc = _context.t0;
|
|
106
|
-
_context.next =
|
|
121
|
+
_context.next = 9;
|
|
107
122
|
return (0, _tools.getResourceContentType)(_nonCORSSrc !== null && _nonCORSSrc !== void 0 ? _nonCORSSrc : src);
|
|
108
|
-
case
|
|
123
|
+
case 9:
|
|
109
124
|
contentType = _context.sent;
|
|
110
125
|
typeClass = (0, _tools.classifyType)(contentType);
|
|
111
126
|
if (!unmounted) {
|
|
112
127
|
!nonCORSSrc && setNonCORSSrc(_nonCORSSrc);
|
|
113
128
|
setType(typeClass);
|
|
114
129
|
}
|
|
115
|
-
|
|
130
|
+
setLoading(false);
|
|
131
|
+
case 13:
|
|
116
132
|
case "end":
|
|
117
133
|
return _context.stop();
|
|
118
134
|
}
|
|
@@ -126,7 +142,7 @@ var MediaWithPreview = function MediaWithPreview(_ref) {
|
|
|
126
142
|
return function () {
|
|
127
143
|
unmounted = true;
|
|
128
144
|
};
|
|
129
|
-
}, [src, nonCORSSrc]);
|
|
145
|
+
}, [mediaType, src, nonCORSSrc]);
|
|
130
146
|
(0, _react.useEffect)(function () {
|
|
131
147
|
var handleKeyDown = function handleKeyDown(e) {
|
|
132
148
|
if (!showModal || list.length === 1) return;
|
|
@@ -366,15 +382,29 @@ var MediaWithPreview = function MediaWithPreview(_ref) {
|
|
|
366
382
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
367
383
|
className: className,
|
|
368
384
|
style: style,
|
|
369
|
-
children: [
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
385
|
+
children: [loading && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
386
|
+
style: {
|
|
387
|
+
position: 'relative',
|
|
388
|
+
width: 80,
|
|
389
|
+
height: 80,
|
|
390
|
+
display: 'flex',
|
|
391
|
+
justifyContent: 'center',
|
|
392
|
+
alignItems: 'center',
|
|
393
|
+
overflow: 'hidden',
|
|
394
|
+
border: '1px solid #EEEEEE'
|
|
395
|
+
},
|
|
396
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_media.default.Loading, {})
|
|
397
|
+
}), !loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
398
|
+
children: canRenderMedia ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_media.default, {
|
|
399
|
+
type: mediaType,
|
|
400
|
+
src: src,
|
|
401
|
+
onClick: open,
|
|
402
|
+
name: name
|
|
403
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_fileIcon.default, {
|
|
404
|
+
type: mediaType,
|
|
405
|
+
onDownloadClick: onDownloadByFileIcon,
|
|
406
|
+
disabledDownload: !download
|
|
407
|
+
})
|
|
378
408
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Modal, {
|
|
379
409
|
open: showModal,
|
|
380
410
|
onCancel: close,
|
package/lib/media/media.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC, CSSProperties } from 'react';
|
|
2
|
+
declare const Loading: () => import("react/jsx-runtime").JSX.Element;
|
|
2
3
|
interface MediaProps {
|
|
3
4
|
src: string;
|
|
4
5
|
type: string;
|
|
@@ -7,5 +8,7 @@ interface MediaProps {
|
|
|
7
8
|
style?: CSSProperties;
|
|
8
9
|
name?: string;
|
|
9
10
|
}
|
|
10
|
-
declare const Media: FC<MediaProps
|
|
11
|
+
declare const Media: FC<MediaProps> & {
|
|
12
|
+
Loading: typeof Loading;
|
|
13
|
+
};
|
|
11
14
|
export default Media;
|
package/lib/media/media.js
CHANGED
|
@@ -6,9 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _entry = require("react-pdf/dist/esm/entry.
|
|
9
|
+
var _entry = require("react-pdf/dist/esm/entry.webpack");
|
|
10
10
|
var _antd = require("antd");
|
|
11
11
|
var _locale = require("../locale");
|
|
12
|
+
var _iglooicon = require("iglooicon");
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -18,6 +19,26 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
18
19
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
19
20
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
20
21
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
+
var Loading = function Loading() {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
24
|
+
style: {
|
|
25
|
+
display: 'flex',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
width: '100%',
|
|
29
|
+
height: '100%',
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
zIndex: 1
|
|
32
|
+
},
|
|
33
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.LoadingOutlined, {
|
|
34
|
+
spinning: true,
|
|
35
|
+
style: {
|
|
36
|
+
fontSize: 24,
|
|
37
|
+
color: '#999999'
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
};
|
|
21
42
|
var MediaItem = function MediaItem(_ref) {
|
|
22
43
|
var type = _ref.type,
|
|
23
44
|
src = _ref.src;
|
|
@@ -30,15 +51,25 @@ var MediaItem = function MediaItem(_ref) {
|
|
|
30
51
|
_useState2 = _slicedToArray(_useState, 2),
|
|
31
52
|
errorText = _useState2[0],
|
|
32
53
|
setErrorText = _useState2[1];
|
|
54
|
+
var _useState3 = (0, _react.useState)(true),
|
|
55
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
56
|
+
loading = _useState4[0],
|
|
57
|
+
setLoading = _useState4[1];
|
|
33
58
|
switch (type) {
|
|
34
59
|
case 'video':
|
|
35
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
60
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
61
|
+
children: [loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Loading, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("video", {
|
|
62
|
+
src: src,
|
|
63
|
+
style: {
|
|
64
|
+
maxWidth: 80,
|
|
65
|
+
maxHeight: 80,
|
|
66
|
+
opacity: loading ? 0 : 1
|
|
67
|
+
},
|
|
68
|
+
autoPlay: false,
|
|
69
|
+
onLoadedData: function onLoadedData() {
|
|
70
|
+
return setLoading(false);
|
|
71
|
+
}
|
|
72
|
+
})]
|
|
42
73
|
});
|
|
43
74
|
case 'pdf':
|
|
44
75
|
var needPassword = function needPassword() {
|
|
@@ -53,36 +84,50 @@ var MediaItem = function MediaItem(_ref) {
|
|
|
53
84
|
}));
|
|
54
85
|
}
|
|
55
86
|
};
|
|
56
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
87
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
57
88
|
style: {
|
|
58
89
|
maxWidth: 80,
|
|
59
90
|
maxHeight: 80,
|
|
60
91
|
position: 'absolute'
|
|
61
92
|
},
|
|
62
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
93
|
+
children: [loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Loading, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
94
|
+
style: {
|
|
95
|
+
opacity: loading ? 0 : 1
|
|
96
|
+
},
|
|
97
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_entry.Document, {
|
|
98
|
+
ref: documentRef,
|
|
99
|
+
file: src,
|
|
100
|
+
onPassword: needPassword,
|
|
101
|
+
error: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
102
|
+
style: {
|
|
103
|
+
textAlign: 'center'
|
|
104
|
+
},
|
|
105
|
+
children: errorText
|
|
106
|
+
}),
|
|
107
|
+
onLoadSuccess: function onLoadSuccess() {
|
|
108
|
+
return setLoading(false);
|
|
69
109
|
},
|
|
70
|
-
children:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
scale: 0.1
|
|
110
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_entry.Page, {
|
|
111
|
+
pageNumber: 1,
|
|
112
|
+
scale: 0.1
|
|
113
|
+
})
|
|
75
114
|
})
|
|
76
|
-
})
|
|
115
|
+
})]
|
|
77
116
|
});
|
|
78
117
|
default:
|
|
79
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
118
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
119
|
+
children: [loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Loading, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
120
|
+
src: src,
|
|
121
|
+
style: {
|
|
122
|
+
maxWidth: 80,
|
|
123
|
+
maxHeight: 80,
|
|
124
|
+
position: 'absolute',
|
|
125
|
+
opacity: loading ? 0 : 1
|
|
126
|
+
},
|
|
127
|
+
onLoad: function onLoad() {
|
|
128
|
+
return setLoading(false);
|
|
129
|
+
}
|
|
130
|
+
})]
|
|
86
131
|
});
|
|
87
132
|
}
|
|
88
133
|
};
|
|
@@ -121,5 +166,6 @@ var Media = function Media(_ref2) {
|
|
|
121
166
|
})
|
|
122
167
|
});
|
|
123
168
|
};
|
|
169
|
+
Media.Loading = Loading;
|
|
124
170
|
var _default = Media;
|
|
125
171
|
exports.default = _default;
|
package/package.json
CHANGED
package/.idea/iglooform.iml
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="JAVA_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
-
<exclude-output />
|
|
5
|
-
<content url="file://$MODULE_DIR$" />
|
|
6
|
-
<orderEntry type="inheritedJdk" />
|
|
7
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
|
-
</component>
|
|
9
|
-
</module>
|
package/.idea/misc.xml
DELETED
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/iglooform.iml" filepath="$PROJECT_DIR$/.idea/iglooform.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/vcs.xml
DELETED
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
package/es/back-top/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
package/es/config-provider.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { ConfigProviderProps } from 'antd/es/config-provider';
|
|
3
|
-
export declare let staticAntdConfig: ConfigProviderProps;
|
|
4
|
-
declare const ConfigProvider: FC<{
|
|
5
|
-
currentLang: string;
|
|
6
|
-
config?: ConfigProviderProps;
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
}>;
|
|
9
|
-
export default ConfigProvider;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
package/es/form/messages.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
declare const messages: {
|
|
2
|
-
default: string;
|
|
3
|
-
required: string;
|
|
4
|
-
enum: string;
|
|
5
|
-
whitespace: string;
|
|
6
|
-
date: {
|
|
7
|
-
format: string;
|
|
8
|
-
parse: string;
|
|
9
|
-
invalid: string;
|
|
10
|
-
};
|
|
11
|
-
types: {
|
|
12
|
-
string: string;
|
|
13
|
-
method: string;
|
|
14
|
-
array: string;
|
|
15
|
-
object: string;
|
|
16
|
-
number: string;
|
|
17
|
-
date: string;
|
|
18
|
-
boolean: string;
|
|
19
|
-
integer: string;
|
|
20
|
-
float: string;
|
|
21
|
-
regexp: string;
|
|
22
|
-
email: string;
|
|
23
|
-
url: string;
|
|
24
|
-
hex: string;
|
|
25
|
-
};
|
|
26
|
-
string: {
|
|
27
|
-
len: string;
|
|
28
|
-
min: string;
|
|
29
|
-
max: string;
|
|
30
|
-
range: string;
|
|
31
|
-
};
|
|
32
|
-
number: {
|
|
33
|
-
len: string;
|
|
34
|
-
min: string;
|
|
35
|
-
max: string;
|
|
36
|
-
range: string;
|
|
37
|
-
};
|
|
38
|
-
array: {
|
|
39
|
-
len: string;
|
|
40
|
-
min: string;
|
|
41
|
-
max: string;
|
|
42
|
-
range: string;
|
|
43
|
-
};
|
|
44
|
-
pattern: {
|
|
45
|
-
mismatch: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export default messages;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
package/es/form/style/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
declare const messages: {
|
|
2
|
-
default: string;
|
|
3
|
-
required: string;
|
|
4
|
-
enum: string;
|
|
5
|
-
whitespace: string;
|
|
6
|
-
date: {
|
|
7
|
-
format: string;
|
|
8
|
-
parse: string;
|
|
9
|
-
invalid: string;
|
|
10
|
-
};
|
|
11
|
-
types: {
|
|
12
|
-
string: string;
|
|
13
|
-
method: string;
|
|
14
|
-
array: string;
|
|
15
|
-
object: string;
|
|
16
|
-
number: string;
|
|
17
|
-
date: string;
|
|
18
|
-
boolean: string;
|
|
19
|
-
integer: string;
|
|
20
|
-
float: string;
|
|
21
|
-
regexp: string;
|
|
22
|
-
email: string;
|
|
23
|
-
url: string;
|
|
24
|
-
hex: string;
|
|
25
|
-
};
|
|
26
|
-
string: {
|
|
27
|
-
len: string;
|
|
28
|
-
min: string;
|
|
29
|
-
max: string;
|
|
30
|
-
range: string;
|
|
31
|
-
};
|
|
32
|
-
number: {
|
|
33
|
-
len: string;
|
|
34
|
-
min: string;
|
|
35
|
-
max: string;
|
|
36
|
-
range: string;
|
|
37
|
-
};
|
|
38
|
-
array: {
|
|
39
|
-
len: string;
|
|
40
|
-
min: string;
|
|
41
|
-
max: string;
|
|
42
|
-
range: string;
|
|
43
|
-
};
|
|
44
|
-
pattern: {
|
|
45
|
-
mismatch: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export default messages;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|