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
|
@@ -68,16 +68,18 @@
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
&:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
71
|
+
&:not(:disabled):not(.ant-btn-disabled) {
|
|
72
|
+
&:hover {
|
|
73
|
+
color: @btn-default-hover-color;
|
|
74
|
+
border-color: @btn-default-hover-border-color;
|
|
75
|
+
background-color: @btn-default-hover-backgroud-color;
|
|
76
|
+
}
|
|
77
|
+
&:active,
|
|
78
|
+
&:focus {
|
|
79
|
+
color: @btn-default-focus-color;
|
|
80
|
+
border-color: @btn-default-focus-border-color;
|
|
81
|
+
background-color: @btn-default-focus-backgroud-color;
|
|
82
|
+
}
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
|
|
@@ -105,16 +107,18 @@
|
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
|
|
108
|
-
&:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
&:not(:disabled):not(.ant-btn-disabled) {
|
|
111
|
+
&:hover {
|
|
112
|
+
color: @btn-primary-hover-color;
|
|
113
|
+
border-color: @btn-primary-hover-border-color;
|
|
114
|
+
background-color: @btn-primary-hover-backgroud-color;
|
|
115
|
+
}
|
|
116
|
+
&:active,
|
|
117
|
+
&:focus {
|
|
118
|
+
color: @btn-primary-focus-color;
|
|
119
|
+
border-color: @btn-primary-focus-border-color;
|
|
120
|
+
background-color: @btn-primary-focus-backgroud-color;
|
|
121
|
+
}
|
|
118
122
|
}
|
|
119
123
|
}
|
|
120
124
|
|
package/es/documents/index.js
CHANGED
|
@@ -31,7 +31,14 @@ var Documents = function Documents(_ref) {
|
|
|
31
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
32
32
|
current = _useState2[0],
|
|
33
33
|
setCurrent = _useState2[1];
|
|
34
|
-
var _useState3 = useState(
|
|
34
|
+
var _useState3 = useState(function () {
|
|
35
|
+
return docList.map(function (d) {
|
|
36
|
+
return {
|
|
37
|
+
loading: true,
|
|
38
|
+
src: typeof d === 'string' ? d : d.src
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
}),
|
|
35
42
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
43
|
list = _useState4[0],
|
|
37
44
|
setList = _useState4[1];
|
|
@@ -91,8 +98,25 @@ var Documents = function Documents(_ref) {
|
|
|
91
98
|
return /*#__PURE__*/_jsx(Space, {
|
|
92
99
|
size: [8, 8],
|
|
93
100
|
wrap: true,
|
|
94
|
-
children: list.map(function (
|
|
95
|
-
|
|
101
|
+
children: list.map(function (item, index) {
|
|
102
|
+
if (item.loading) {
|
|
103
|
+
var loading = item.loading,
|
|
104
|
+
_src2 = item.src;
|
|
105
|
+
return /*#__PURE__*/_jsx("div", {
|
|
106
|
+
style: {
|
|
107
|
+
left: "".concat((index - current) * 100, "%")
|
|
108
|
+
},
|
|
109
|
+
children: /*#__PURE__*/_jsx(MediaWithPreview, {
|
|
110
|
+
loading: loading,
|
|
111
|
+
index: index,
|
|
112
|
+
src: _src2,
|
|
113
|
+
className: className,
|
|
114
|
+
style: style
|
|
115
|
+
})
|
|
116
|
+
}, index);
|
|
117
|
+
}
|
|
118
|
+
var _ref3 = item,
|
|
119
|
+
_src = _ref3.src,
|
|
96
120
|
type = _ref3.type,
|
|
97
121
|
nonCORSSrc = _ref3.nonCORSSrc;
|
|
98
122
|
var src = !!nonCORSSrc ? {
|
package/es/media/index.d.ts
CHANGED
package/es/media/index.js
CHANGED
|
@@ -19,6 +19,7 @@ import FileIcon from "./file-icon";
|
|
|
19
19
|
import { MinusOutlined, PlusOutlined, ArrowRightOutlined, ArrowLeftOutlined, CrossOutlined, DownloadOutlined } from 'iglooicon';
|
|
20
20
|
import "./style";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
23
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
24
|
var MediaWithPreview = function MediaWithPreview(_ref) {
|
|
24
25
|
var srcProp = _ref.src,
|
|
@@ -41,40 +42,54 @@ var MediaWithPreview = function MediaWithPreview(_ref) {
|
|
|
41
42
|
download = _ref$download === void 0 ? {
|
|
42
43
|
actionType: 'downloadBlob'
|
|
43
44
|
} : _ref$download,
|
|
44
|
-
getNonCORSUrl = _ref.getNonCORSUrl
|
|
45
|
+
getNonCORSUrl = _ref.getNonCORSUrl,
|
|
46
|
+
loadingProp = _ref.loading;
|
|
45
47
|
var _ref2 = _typeof(srcProp) === 'object' ? [srcProp.origin, srcProp.nonCORS] : [srcProp],
|
|
46
48
|
_ref3 = _slicedToArray(_ref2, 2),
|
|
47
49
|
src = _ref3[0],
|
|
48
50
|
nonCORSSrcProp = _ref3[1];
|
|
49
|
-
var _useState = useState(
|
|
51
|
+
var _useState = useState(true),
|
|
50
52
|
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var _useState3 = useState(
|
|
53
|
+
loading = _useState2[0],
|
|
54
|
+
setLoading = _useState2[1];
|
|
55
|
+
var _useState3 = useState(nonCORSSrcProp),
|
|
54
56
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
var _useState5 = useState(
|
|
57
|
+
nonCORSSrc = _useState4[0],
|
|
58
|
+
setNonCORSSrc = _useState4[1];
|
|
59
|
+
var _useState5 = useState(1),
|
|
58
60
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
var _useState7 = useState(
|
|
61
|
+
scale = _useState6[0],
|
|
62
|
+
setScale = _useState6[1];
|
|
63
|
+
var _useState7 = useState(type),
|
|
62
64
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var _useState9 = useState(
|
|
65
|
+
mediaType = _useState8[0],
|
|
66
|
+
setType = _useState8[1];
|
|
67
|
+
var _useState9 = useState(false),
|
|
66
68
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var _useState11 = useState(
|
|
69
|
+
showModal = _useState10[0],
|
|
70
|
+
setShowModal = _useState10[1];
|
|
71
|
+
var _useState11 = useState(index),
|
|
70
72
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
current = _useState12[0],
|
|
74
|
+
setCurrent = _useState12[1];
|
|
75
|
+
var _useState13 = useState(''),
|
|
76
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
77
|
+
direction = _useState14[0],
|
|
78
|
+
setDirection = _useState14[1];
|
|
79
|
+
useEffect(function () {
|
|
80
|
+
setType(type);
|
|
81
|
+
}, [type]);
|
|
82
|
+
useEffect(function () {
|
|
83
|
+
if (loadingProp === undefined) return;
|
|
84
|
+
setLoading(loadingProp);
|
|
85
|
+
}, [loadingProp]);
|
|
73
86
|
useEffect(function () {
|
|
74
87
|
setNonCORSSrc(nonCORSSrcProp);
|
|
75
88
|
}, [nonCORSSrcProp]);
|
|
76
89
|
useEffect(function () {
|
|
90
|
+
if (!src) return;
|
|
77
91
|
if (mediaType) {
|
|
92
|
+
setLoading(false);
|
|
78
93
|
return;
|
|
79
94
|
}
|
|
80
95
|
var unmounted = false;
|
|
@@ -84,27 +99,29 @@ var MediaWithPreview = function MediaWithPreview(_ref) {
|
|
|
84
99
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
85
100
|
while (1) switch (_context.prev = _context.next) {
|
|
86
101
|
case 0:
|
|
102
|
+
setLoading(true);
|
|
87
103
|
_context.t0 = nonCORSSrc;
|
|
88
104
|
if (_context.t0) {
|
|
89
|
-
_context.next =
|
|
105
|
+
_context.next = 6;
|
|
90
106
|
break;
|
|
91
107
|
}
|
|
92
|
-
_context.next =
|
|
108
|
+
_context.next = 5;
|
|
93
109
|
return getNonCORSUrl === null || getNonCORSUrl === void 0 ? void 0 : getNonCORSUrl(src);
|
|
94
|
-
case 4:
|
|
95
|
-
_context.t0 = _context.sent;
|
|
96
110
|
case 5:
|
|
111
|
+
_context.t0 = _context.sent;
|
|
112
|
+
case 6:
|
|
97
113
|
_nonCORSSrc = _context.t0;
|
|
98
|
-
_context.next =
|
|
114
|
+
_context.next = 9;
|
|
99
115
|
return getResourceContentType(_nonCORSSrc !== null && _nonCORSSrc !== void 0 ? _nonCORSSrc : src);
|
|
100
|
-
case
|
|
116
|
+
case 9:
|
|
101
117
|
contentType = _context.sent;
|
|
102
118
|
typeClass = classifyType(contentType);
|
|
103
119
|
if (!unmounted) {
|
|
104
120
|
!nonCORSSrc && setNonCORSSrc(_nonCORSSrc);
|
|
105
121
|
setType(typeClass);
|
|
106
122
|
}
|
|
107
|
-
|
|
123
|
+
setLoading(false);
|
|
124
|
+
case 13:
|
|
108
125
|
case "end":
|
|
109
126
|
return _context.stop();
|
|
110
127
|
}
|
|
@@ -118,7 +135,7 @@ var MediaWithPreview = function MediaWithPreview(_ref) {
|
|
|
118
135
|
return function () {
|
|
119
136
|
unmounted = true;
|
|
120
137
|
};
|
|
121
|
-
}, [src, nonCORSSrc]);
|
|
138
|
+
}, [mediaType, src, nonCORSSrc]);
|
|
122
139
|
useEffect(function () {
|
|
123
140
|
var handleKeyDown = function handleKeyDown(e) {
|
|
124
141
|
if (!showModal || list.length === 1) return;
|
|
@@ -358,15 +375,29 @@ var MediaWithPreview = function MediaWithPreview(_ref) {
|
|
|
358
375
|
return /*#__PURE__*/_jsxs("div", {
|
|
359
376
|
className: className,
|
|
360
377
|
style: style,
|
|
361
|
-
children: [
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
378
|
+
children: [loading && /*#__PURE__*/_jsx("div", {
|
|
379
|
+
style: {
|
|
380
|
+
position: 'relative',
|
|
381
|
+
width: 80,
|
|
382
|
+
height: 80,
|
|
383
|
+
display: 'flex',
|
|
384
|
+
justifyContent: 'center',
|
|
385
|
+
alignItems: 'center',
|
|
386
|
+
overflow: 'hidden',
|
|
387
|
+
border: '1px solid #EEEEEE'
|
|
388
|
+
},
|
|
389
|
+
children: /*#__PURE__*/_jsx(Media.Loading, {})
|
|
390
|
+
}), !loading && /*#__PURE__*/_jsx(_Fragment, {
|
|
391
|
+
children: canRenderMedia ? /*#__PURE__*/_jsx(Media, {
|
|
392
|
+
type: mediaType,
|
|
393
|
+
src: src,
|
|
394
|
+
onClick: open,
|
|
395
|
+
name: name
|
|
396
|
+
}) : /*#__PURE__*/_jsx(FileIcon, {
|
|
397
|
+
type: mediaType,
|
|
398
|
+
onDownloadClick: onDownloadByFileIcon,
|
|
399
|
+
disabledDownload: !download
|
|
400
|
+
})
|
|
370
401
|
}), /*#__PURE__*/_jsxs(Modal, {
|
|
371
402
|
open: showModal,
|
|
372
403
|
onCancel: close,
|
package/es/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/es/media/media.js
CHANGED
|
@@ -5,11 +5,33 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
5
|
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; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import React, { useRef, useState, useContext } from 'react';
|
|
8
|
-
import { Document, Page } from 'react-pdf/dist/esm/entry.
|
|
8
|
+
import { Document, Page } from 'react-pdf/dist/esm/entry.webpack';
|
|
9
9
|
import { Tooltip } from 'antd';
|
|
10
10
|
import { LocaleContext } from "../locale";
|
|
11
|
+
import { LoadingOutlined } from 'iglooicon';
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
var Loading = function Loading() {
|
|
16
|
+
return /*#__PURE__*/_jsx("div", {
|
|
17
|
+
style: {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
width: '100%',
|
|
22
|
+
height: '100%',
|
|
23
|
+
position: 'absolute',
|
|
24
|
+
zIndex: 1
|
|
25
|
+
},
|
|
26
|
+
children: /*#__PURE__*/_jsx(LoadingOutlined, {
|
|
27
|
+
spinning: true,
|
|
28
|
+
style: {
|
|
29
|
+
fontSize: 24,
|
|
30
|
+
color: '#999999'
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
};
|
|
13
35
|
var MediaItem = function MediaItem(_ref) {
|
|
14
36
|
var type = _ref.type,
|
|
15
37
|
src = _ref.src;
|
|
@@ -22,15 +44,25 @@ var MediaItem = function MediaItem(_ref) {
|
|
|
22
44
|
_useState2 = _slicedToArray(_useState, 2),
|
|
23
45
|
errorText = _useState2[0],
|
|
24
46
|
setErrorText = _useState2[1];
|
|
47
|
+
var _useState3 = useState(true),
|
|
48
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
|
+
loading = _useState4[0],
|
|
50
|
+
setLoading = _useState4[1];
|
|
25
51
|
switch (type) {
|
|
26
52
|
case 'video':
|
|
27
|
-
return /*#__PURE__*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
53
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
54
|
+
children: [loading && /*#__PURE__*/_jsx(Loading, {}), /*#__PURE__*/_jsx("video", {
|
|
55
|
+
src: src,
|
|
56
|
+
style: {
|
|
57
|
+
maxWidth: 80,
|
|
58
|
+
maxHeight: 80,
|
|
59
|
+
opacity: loading ? 0 : 1
|
|
60
|
+
},
|
|
61
|
+
autoPlay: false,
|
|
62
|
+
onLoadedData: function onLoadedData() {
|
|
63
|
+
return setLoading(false);
|
|
64
|
+
}
|
|
65
|
+
})]
|
|
34
66
|
});
|
|
35
67
|
case 'pdf':
|
|
36
68
|
var needPassword = function needPassword() {
|
|
@@ -45,36 +77,50 @@ var MediaItem = function MediaItem(_ref) {
|
|
|
45
77
|
}));
|
|
46
78
|
}
|
|
47
79
|
};
|
|
48
|
-
return /*#__PURE__*/
|
|
80
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
49
81
|
style: {
|
|
50
82
|
maxWidth: 80,
|
|
51
83
|
maxHeight: 80,
|
|
52
84
|
position: 'absolute'
|
|
53
85
|
},
|
|
54
|
-
children: /*#__PURE__*/_jsx(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
86
|
+
children: [loading && /*#__PURE__*/_jsx(Loading, {}), /*#__PURE__*/_jsx("div", {
|
|
87
|
+
style: {
|
|
88
|
+
opacity: loading ? 0 : 1
|
|
89
|
+
},
|
|
90
|
+
children: /*#__PURE__*/_jsx(Document, {
|
|
91
|
+
ref: documentRef,
|
|
92
|
+
file: src,
|
|
93
|
+
onPassword: needPassword,
|
|
94
|
+
error: /*#__PURE__*/_jsx("div", {
|
|
95
|
+
style: {
|
|
96
|
+
textAlign: 'center'
|
|
97
|
+
},
|
|
98
|
+
children: errorText
|
|
99
|
+
}),
|
|
100
|
+
onLoadSuccess: function onLoadSuccess() {
|
|
101
|
+
return setLoading(false);
|
|
61
102
|
},
|
|
62
|
-
children:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
scale: 0.1
|
|
103
|
+
children: /*#__PURE__*/_jsx(Page, {
|
|
104
|
+
pageNumber: 1,
|
|
105
|
+
scale: 0.1
|
|
106
|
+
})
|
|
67
107
|
})
|
|
68
|
-
})
|
|
108
|
+
})]
|
|
69
109
|
});
|
|
70
110
|
default:
|
|
71
|
-
return /*#__PURE__*/
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
111
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
112
|
+
children: [loading && /*#__PURE__*/_jsx(Loading, {}), /*#__PURE__*/_jsx("img", {
|
|
113
|
+
src: src,
|
|
114
|
+
style: {
|
|
115
|
+
maxWidth: 80,
|
|
116
|
+
maxHeight: 80,
|
|
117
|
+
position: 'absolute',
|
|
118
|
+
opacity: loading ? 0 : 1
|
|
119
|
+
},
|
|
120
|
+
onLoad: function onLoad() {
|
|
121
|
+
return setLoading(false);
|
|
122
|
+
}
|
|
123
|
+
})]
|
|
78
124
|
});
|
|
79
125
|
}
|
|
80
126
|
};
|
|
@@ -113,4 +159,5 @@ var Media = function Media(_ref2) {
|
|
|
113
159
|
})
|
|
114
160
|
});
|
|
115
161
|
};
|
|
162
|
+
Media.Loading = Loading;
|
|
116
163
|
export default Media;
|
|
@@ -68,16 +68,18 @@
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
&:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
71
|
+
&:not(:disabled):not(.ant-btn-disabled) {
|
|
72
|
+
&:hover {
|
|
73
|
+
color: @btn-default-hover-color;
|
|
74
|
+
border-color: @btn-default-hover-border-color;
|
|
75
|
+
background-color: @btn-default-hover-backgroud-color;
|
|
76
|
+
}
|
|
77
|
+
&:active,
|
|
78
|
+
&:focus {
|
|
79
|
+
color: @btn-default-focus-color;
|
|
80
|
+
border-color: @btn-default-focus-border-color;
|
|
81
|
+
background-color: @btn-default-focus-backgroud-color;
|
|
82
|
+
}
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
|
|
@@ -105,16 +107,18 @@
|
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
|
|
108
|
-
&:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
&:not(:disabled):not(.ant-btn-disabled) {
|
|
111
|
+
&:hover {
|
|
112
|
+
color: @btn-primary-hover-color;
|
|
113
|
+
border-color: @btn-primary-hover-border-color;
|
|
114
|
+
background-color: @btn-primary-hover-backgroud-color;
|
|
115
|
+
}
|
|
116
|
+
&:active,
|
|
117
|
+
&:focus {
|
|
118
|
+
color: @btn-primary-focus-color;
|
|
119
|
+
border-color: @btn-primary-focus-border-color;
|
|
120
|
+
background-color: @btn-primary-focus-backgroud-color;
|
|
121
|
+
}
|
|
118
122
|
}
|
|
119
123
|
}
|
|
120
124
|
|
package/lib/documents/index.js
CHANGED
|
@@ -40,7 +40,14 @@ var Documents = function Documents(_ref) {
|
|
|
40
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
41
41
|
current = _useState2[0],
|
|
42
42
|
setCurrent = _useState2[1];
|
|
43
|
-
var _useState3 = (0, _react.useState)(
|
|
43
|
+
var _useState3 = (0, _react.useState)(function () {
|
|
44
|
+
return docList.map(function (d) {
|
|
45
|
+
return {
|
|
46
|
+
loading: true,
|
|
47
|
+
src: typeof d === 'string' ? d : d.src
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}),
|
|
44
51
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
45
52
|
list = _useState4[0],
|
|
46
53
|
setList = _useState4[1];
|
|
@@ -100,8 +107,25 @@ var Documents = function Documents(_ref) {
|
|
|
100
107
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, {
|
|
101
108
|
size: [8, 8],
|
|
102
109
|
wrap: true,
|
|
103
|
-
children: list.map(function (
|
|
104
|
-
|
|
110
|
+
children: list.map(function (item, index) {
|
|
111
|
+
if (item.loading) {
|
|
112
|
+
var loading = item.loading,
|
|
113
|
+
_src2 = item.src;
|
|
114
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
115
|
+
style: {
|
|
116
|
+
left: "".concat((index - current) * 100, "%")
|
|
117
|
+
},
|
|
118
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_media.default, {
|
|
119
|
+
loading: loading,
|
|
120
|
+
index: index,
|
|
121
|
+
src: _src2,
|
|
122
|
+
className: className,
|
|
123
|
+
style: style
|
|
124
|
+
})
|
|
125
|
+
}, index);
|
|
126
|
+
}
|
|
127
|
+
var _ref3 = item,
|
|
128
|
+
_src = _ref3.src,
|
|
105
129
|
type = _ref3.type,
|
|
106
130
|
nonCORSSrc = _ref3.nonCORSSrc;
|
|
107
131
|
var src = !!nonCORSSrc ? {
|