iglooform 2.5.60 → 2.5.61
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/EmptyRoute.tsx +9 -0
- package/.dumi/tmp/core/defineApp.ts +16 -0
- package/.dumi/tmp/core/exportStaticRuntimePlugin.ts +11 -0
- package/.dumi/tmp/core/helmet.ts +10 -0
- package/.dumi/tmp/core/helmetContext.ts +4 -0
- package/.dumi/tmp/core/history.ts +66 -0
- package/.dumi/tmp/core/historyIntelli.ts +132 -0
- package/.dumi/tmp/core/plugin.ts +55 -0
- package/.dumi/tmp/core/pluginConfig.ts +281 -0
- package/.dumi/tmp/core/pluginConfigJoi.d.ts +55 -0
- package/.dumi/tmp/core/polyfill.ts +201 -0
- package/.dumi/tmp/core/route.tsx +50 -0
- package/.dumi/tmp/core/terminal.ts +37 -0
- package/.dumi/tmp/dumi/exports.ts +5 -0
- package/.dumi/tmp/dumi/locales/config.ts +95 -0
- package/.dumi/tmp/dumi/locales/runtime.tsx +43 -0
- package/.dumi/tmp/dumi/meta/atoms.ts +4 -0
- package/.dumi/tmp/dumi/meta/index.ts +255 -0
- package/.dumi/tmp/dumi/meta/runtime.ts +31 -0
- package/.dumi/tmp/dumi/meta/tabs.ts +5 -0
- package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +48 -0
- package/.dumi/tmp/dumi/theme/builtins/API.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Badge.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Container.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Table.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Tree.ts +4 -0
- package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +4 -0
- package/.dumi/tmp/dumi/theme/loading.tsx +25 -0
- package/.dumi/tmp/dumi/theme/nprogress.css +59 -0
- package/.dumi/tmp/dumi/theme/slots/ColorSwitch.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Content.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/ContentFooter.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Features.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Footer.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Header.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/HeaderExtra.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Hero.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Logo.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Navbar.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/NavbarExtra.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/NotFound.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +5 -0
- package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/SocialIcon.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Toc.ts +4 -0
- package/.dumi/tmp/exports.ts +17 -0
- package/.dumi/tmp/plugin-html2sketch/index.ts +35 -0
- package/.dumi/tmp/testBrowser.tsx +88 -0
- package/.dumi/tmp/umi.ts +106 -0
- package/.idea/codeStyles/Project.xml +59 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/iglooform.iml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/es/form/pages/index.js +34 -3
- package/es/types.d.ts +1 -0
- package/lib/form/pages/index.js +34 -3
- package/lib/types.d.ts +1 -0
- package/package.json +1 -1
- package/yarn-error.log +16168 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// This file is generated by Umi automatically
|
|
3
|
+
// DO NOT CHANGE IT MANUALLY!
|
|
4
|
+
import type { nodeToGroup, nodeToSymbol, SketchFormat } from 'html2sketch';
|
|
5
|
+
import { ApplyPluginsType } from 'dumi';
|
|
6
|
+
import { getPluginManager } from '@@/core/plugin';
|
|
7
|
+
|
|
8
|
+
const html2sketch = typeof window !== 'undefined' ? window.html2sketch as {
|
|
9
|
+
nodeToGroup: typeof nodeToGroup;
|
|
10
|
+
nodeToSymbol: typeof nodeToSymbol;
|
|
11
|
+
} : null;
|
|
12
|
+
|
|
13
|
+
async function toSketchJSON(
|
|
14
|
+
node: HTMLElement,
|
|
15
|
+
opts: { type: 'group' | 'symbol' },
|
|
16
|
+
) {
|
|
17
|
+
return opts.type === 'group'
|
|
18
|
+
? (await html2sketch.nodeToGroup(node)).toSketchJSON()
|
|
19
|
+
: (await html2sketch.nodeToSymbol(node)).toSketchJSON();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function runtimeToSketchJSON(
|
|
23
|
+
target: HTMLElement | Document,
|
|
24
|
+
opts: Parameters<typeof toSketchJSON>[1],
|
|
25
|
+
): ReturnType<typeof toSketchJSON> | Promise<null> {
|
|
26
|
+
return getPluginManager().applyPlugins({
|
|
27
|
+
key: 'toSketchJSON',
|
|
28
|
+
type: ApplyPluginsType.modify,
|
|
29
|
+
initialValue: null,
|
|
30
|
+
args: { target, opts },
|
|
31
|
+
async: true,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const getSketchJSON = null;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// This file is generated by Umi automatically
|
|
3
|
+
// DO NOT CHANGE IT MANUALLY!
|
|
4
|
+
import React, { useEffect, useState } from 'react';
|
|
5
|
+
import { ApplyPluginsType } from 'umi';
|
|
6
|
+
import { renderClient, RenderClientOpts } from '/Users/lei/iglooform/node_modules/@umijs/renderer-react';
|
|
7
|
+
import { createHistory } from './core/history';
|
|
8
|
+
import { createPluginManager } from './core/plugin';
|
|
9
|
+
import { getRoutes } from './core/route';
|
|
10
|
+
import type { Location } from 'history';
|
|
11
|
+
|
|
12
|
+
import { getPluginManager as getDumiPluginManager } from './core/plugin';
|
|
13
|
+
import { setPluginManager as setDumiPluginManager } from '/Users/lei/iglooform/node_modules/dumi/dist/client/theme-api/utils.js';
|
|
14
|
+
const publicPath = '/';
|
|
15
|
+
const runtimePublicPath = false;
|
|
16
|
+
|
|
17
|
+
type TestBrowserProps = {
|
|
18
|
+
location?: Partial<Location>;
|
|
19
|
+
historyRef?: React.MutableRefObject<Location>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function TestBrowser(props: TestBrowserProps) {
|
|
23
|
+
const pluginManager = createPluginManager();
|
|
24
|
+
const [context, setContext] = useState<RenderClientOpts | undefined>(
|
|
25
|
+
undefined
|
|
26
|
+
);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const genContext = async () => {
|
|
29
|
+
const { routes, routeComponents } = await getRoutes(pluginManager);
|
|
30
|
+
// allow user to extend routes
|
|
31
|
+
await pluginManager.applyPlugins({
|
|
32
|
+
key: 'patchRoutes',
|
|
33
|
+
type: ApplyPluginsType.event,
|
|
34
|
+
args: {
|
|
35
|
+
routes,
|
|
36
|
+
routeComponents,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
const contextOpts = pluginManager.applyPlugins({
|
|
40
|
+
key: 'modifyContextOpts',
|
|
41
|
+
type: ApplyPluginsType.modify,
|
|
42
|
+
initialValue: {},
|
|
43
|
+
});
|
|
44
|
+
const basename = contextOpts.basename || '/';
|
|
45
|
+
const history = createHistory({
|
|
46
|
+
type: 'memory',
|
|
47
|
+
basename,
|
|
48
|
+
});
|
|
49
|
+
const context = {
|
|
50
|
+
routes,
|
|
51
|
+
routeComponents,
|
|
52
|
+
pluginManager,
|
|
53
|
+
rootElement: contextOpts.rootElement || document.getElementById('root'),
|
|
54
|
+
publicPath,
|
|
55
|
+
runtimePublicPath,
|
|
56
|
+
history,
|
|
57
|
+
basename,
|
|
58
|
+
components: true,
|
|
59
|
+
};
|
|
60
|
+
const modifiedContext = pluginManager.applyPlugins({
|
|
61
|
+
key: 'modifyClientRenderOpts',
|
|
62
|
+
type: ApplyPluginsType.modify,
|
|
63
|
+
initialValue: context,
|
|
64
|
+
});
|
|
65
|
+
return modifiedContext;
|
|
66
|
+
};
|
|
67
|
+
genContext().then((context) => {
|
|
68
|
+
setContext(context);
|
|
69
|
+
if (props.location) {
|
|
70
|
+
context?.history?.push(props.location);
|
|
71
|
+
}
|
|
72
|
+
if (props.historyRef) {
|
|
73
|
+
props.historyRef.current = context?.history;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}, []);
|
|
77
|
+
|
|
78
|
+
if (context === undefined) {
|
|
79
|
+
return <div id="loading" />;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const Children = renderClient(context);
|
|
83
|
+
return (
|
|
84
|
+
<React.Fragment>
|
|
85
|
+
<Children />
|
|
86
|
+
</React.Fragment>
|
|
87
|
+
);
|
|
88
|
+
}
|
package/.dumi/tmp/umi.ts
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// This file is generated by Umi automatically
|
|
3
|
+
// DO NOT CHANGE IT MANUALLY!
|
|
4
|
+
import './core/polyfill';
|
|
5
|
+
import { getPluginManager as getDumiPluginManager } from './core/plugin';
|
|
6
|
+
import { setPluginManager as setDumiPluginManager } from '/Users/lei/iglooform/node_modules/dumi/dist/client/theme-api/utils.js';
|
|
7
|
+
import { renderClient } from '/Users/lei/iglooform/node_modules/@umijs/renderer-react';
|
|
8
|
+
import { getRoutes } from './core/route';
|
|
9
|
+
import { createPluginManager } from './core/plugin';
|
|
10
|
+
import { createHistory } from './core/history';
|
|
11
|
+
import Loading from '@@/dumi/theme/loading';
|
|
12
|
+
import { ApplyPluginsType } from 'umi';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const publicPath = "/";
|
|
16
|
+
const runtimePublicPath = false;
|
|
17
|
+
|
|
18
|
+
async function render() {
|
|
19
|
+
const pluginManager = createPluginManager();
|
|
20
|
+
const { routes, routeComponents } = await getRoutes(pluginManager);
|
|
21
|
+
|
|
22
|
+
// allow user to extend routes
|
|
23
|
+
await pluginManager.applyPlugins({
|
|
24
|
+
key: 'patchRoutes',
|
|
25
|
+
type: ApplyPluginsType.event,
|
|
26
|
+
args: {
|
|
27
|
+
routes,
|
|
28
|
+
routeComponents,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const contextOpts = pluginManager.applyPlugins({
|
|
33
|
+
key: 'modifyContextOpts',
|
|
34
|
+
type: ApplyPluginsType.modify,
|
|
35
|
+
initialValue: {},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const basename = contextOpts.basename || '/';
|
|
39
|
+
const historyType = contextOpts.historyType || 'browser';
|
|
40
|
+
|
|
41
|
+
const history = createHistory({
|
|
42
|
+
type: historyType,
|
|
43
|
+
basename,
|
|
44
|
+
...contextOpts.historyOpts,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return (pluginManager.applyPlugins({
|
|
48
|
+
key: 'render',
|
|
49
|
+
type: ApplyPluginsType.compose,
|
|
50
|
+
initialValue() {
|
|
51
|
+
const context = {
|
|
52
|
+
routes,
|
|
53
|
+
routeComponents,
|
|
54
|
+
pluginManager,
|
|
55
|
+
rootElement: contextOpts.rootElement || document.getElementById('root'),
|
|
56
|
+
loadingComponent: Loading,
|
|
57
|
+
publicPath,
|
|
58
|
+
runtimePublicPath,
|
|
59
|
+
history,
|
|
60
|
+
historyType,
|
|
61
|
+
basename,
|
|
62
|
+
callback: contextOpts.callback,
|
|
63
|
+
};
|
|
64
|
+
const modifiedContext = pluginManager.applyPlugins({
|
|
65
|
+
key: 'modifyClientRenderOpts',
|
|
66
|
+
type: ApplyPluginsType.modify,
|
|
67
|
+
initialValue: context,
|
|
68
|
+
});
|
|
69
|
+
return renderClient(modifiedContext);
|
|
70
|
+
},
|
|
71
|
+
}))();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
// always remove trailing slash from location.pathname
|
|
76
|
+
if (
|
|
77
|
+
typeof history !== 'undefined' &&
|
|
78
|
+
location.pathname.length > 1 &&
|
|
79
|
+
location.pathname.endsWith('/')
|
|
80
|
+
) {
|
|
81
|
+
history.replaceState(
|
|
82
|
+
{},
|
|
83
|
+
'',
|
|
84
|
+
location.pathname.slice(0, -1) + location.search + location.hash,
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
(function () {
|
|
89
|
+
var cache = typeof navigator !== 'undefined' && navigator.cookieEnabled && typeof window.localStorage !== 'undefined' && localStorage.getItem('dumi:prefers-color') || 'light';
|
|
90
|
+
var isDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
91
|
+
var enums = ['light', 'dark', 'auto'];
|
|
92
|
+
|
|
93
|
+
document.documentElement.setAttribute(
|
|
94
|
+
'data-prefers-color',
|
|
95
|
+
cache === enums[2]
|
|
96
|
+
? (isDark ? enums[1] : enums[0])
|
|
97
|
+
: (enums.indexOf(cache) > -1 ? cache : enums[0])
|
|
98
|
+
);
|
|
99
|
+
})();
|
|
100
|
+
render();
|
|
101
|
+
|
|
102
|
+
window.g_umi = {
|
|
103
|
+
version: '4.0.75',
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
setDumiPluginManager(getDumiPluginManager());
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
+
<code_scheme name="Project" version="173">
|
|
3
|
+
<HTMLCodeStyleSettings>
|
|
4
|
+
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
5
|
+
</HTMLCodeStyleSettings>
|
|
6
|
+
<JSCodeStyleSettings version="0">
|
|
7
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
8
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
9
|
+
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
10
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
11
|
+
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
12
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
13
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
14
|
+
</JSCodeStyleSettings>
|
|
15
|
+
<TypeScriptCodeStyleSettings version="0">
|
|
16
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
17
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
18
|
+
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
19
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
20
|
+
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
21
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
22
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
23
|
+
</TypeScriptCodeStyleSettings>
|
|
24
|
+
<VueCodeStyleSettings>
|
|
25
|
+
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
26
|
+
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
27
|
+
</VueCodeStyleSettings>
|
|
28
|
+
<codeStyleSettings language="HTML">
|
|
29
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
30
|
+
<indentOptions>
|
|
31
|
+
<option name="INDENT_SIZE" value="2" />
|
|
32
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
33
|
+
<option name="TAB_SIZE" value="2" />
|
|
34
|
+
</indentOptions>
|
|
35
|
+
</codeStyleSettings>
|
|
36
|
+
<codeStyleSettings language="JavaScript">
|
|
37
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
38
|
+
<indentOptions>
|
|
39
|
+
<option name="INDENT_SIZE" value="2" />
|
|
40
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
41
|
+
<option name="TAB_SIZE" value="2" />
|
|
42
|
+
</indentOptions>
|
|
43
|
+
</codeStyleSettings>
|
|
44
|
+
<codeStyleSettings language="TypeScript">
|
|
45
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
46
|
+
<indentOptions>
|
|
47
|
+
<option name="INDENT_SIZE" value="2" />
|
|
48
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
49
|
+
<option name="TAB_SIZE" value="2" />
|
|
50
|
+
</indentOptions>
|
|
51
|
+
</codeStyleSettings>
|
|
52
|
+
<codeStyleSettings language="Vue">
|
|
53
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
54
|
+
<indentOptions>
|
|
55
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
56
|
+
</indentOptions>
|
|
57
|
+
</codeStyleSettings>
|
|
58
|
+
</code_scheme>
|
|
59
|
+
</component>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
7
|
+
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
+
</content>
|
|
9
|
+
<orderEntry type="inheritedJdk" />
|
|
10
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
+
</component>
|
|
12
|
+
</module>
|
|
@@ -0,0 +1,8 @@
|
|
|
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
ADDED
package/es/form/pages/index.js
CHANGED
|
@@ -164,6 +164,39 @@ var Pages = function Pages(_ref) {
|
|
|
164
164
|
};
|
|
165
165
|
}();
|
|
166
166
|
|
|
167
|
+
var handlePrevious = /*#__PURE__*/function () {
|
|
168
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
169
|
+
var handlePrevious;
|
|
170
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
171
|
+
while (1) {
|
|
172
|
+
switch (_context2.prev = _context2.next) {
|
|
173
|
+
case 0:
|
|
174
|
+
handlePrevious = renderElements[current].handlePrevious;
|
|
175
|
+
|
|
176
|
+
if (!(typeof handlePrevious === 'function')) {
|
|
177
|
+
_context2.next = 4;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
_context2.next = 4;
|
|
182
|
+
return handlePrevious(current);
|
|
183
|
+
|
|
184
|
+
case 4:
|
|
185
|
+
setCurrent(current - 1);
|
|
186
|
+
|
|
187
|
+
case 5:
|
|
188
|
+
case "end":
|
|
189
|
+
return _context2.stop();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}, _callee2);
|
|
193
|
+
}));
|
|
194
|
+
|
|
195
|
+
return function handlePrevious() {
|
|
196
|
+
return _ref6.apply(this, arguments);
|
|
197
|
+
};
|
|
198
|
+
}();
|
|
199
|
+
|
|
167
200
|
var _renderElements$curre2 = renderElements[current],
|
|
168
201
|
getButtonDisabledState = _renderElements$curre2.getButtonDisabledState,
|
|
169
202
|
getPreviousDisabledState = _renderElements$curre2.getPreviousDisabledState;
|
|
@@ -200,9 +233,7 @@ var Pages = function Pages(_ref) {
|
|
|
200
233
|
className: 'igloo-pages-footer',
|
|
201
234
|
children: [current === 0 && _jsx("div", {}), current > 0 && _jsx(Button, {
|
|
202
235
|
className: 'igloo-pages-preview-button',
|
|
203
|
-
onClick:
|
|
204
|
-
return setCurrent(current - 1);
|
|
205
|
-
},
|
|
236
|
+
onClick: handlePrevious,
|
|
206
237
|
disabled: previousDisabled,
|
|
207
238
|
children: previewText || formatMessage({
|
|
208
239
|
id: 'Previous'
|
package/es/types.d.ts
CHANGED
|
@@ -88,6 +88,7 @@ export interface FormItemExtraConfig extends FormItemProps {
|
|
|
88
88
|
showOptional?: boolean;
|
|
89
89
|
previewFormater?(value: any, form?: FormInstance): any;
|
|
90
90
|
handleNext?(values: any): any;
|
|
91
|
+
handlePrevious?(currentIndex: number): any;
|
|
91
92
|
render?(preview: boolean, form?: FormInstance, value?: any, onChange?: (params: any) => any, setShowStepButton?: IglooComponentProps['setShowStepButton']): any;
|
|
92
93
|
locales?: {
|
|
93
94
|
[key: string]: string;
|
package/lib/form/pages/index.js
CHANGED
|
@@ -187,6 +187,39 @@ var Pages = function Pages(_ref) {
|
|
|
187
187
|
};
|
|
188
188
|
}();
|
|
189
189
|
|
|
190
|
+
var handlePrevious = /*#__PURE__*/function () {
|
|
191
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
192
|
+
var handlePrevious;
|
|
193
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
194
|
+
while (1) {
|
|
195
|
+
switch (_context2.prev = _context2.next) {
|
|
196
|
+
case 0:
|
|
197
|
+
handlePrevious = renderElements[current].handlePrevious;
|
|
198
|
+
|
|
199
|
+
if (!(typeof handlePrevious === 'function')) {
|
|
200
|
+
_context2.next = 4;
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
_context2.next = 4;
|
|
205
|
+
return handlePrevious(current);
|
|
206
|
+
|
|
207
|
+
case 4:
|
|
208
|
+
setCurrent(current - 1);
|
|
209
|
+
|
|
210
|
+
case 5:
|
|
211
|
+
case "end":
|
|
212
|
+
return _context2.stop();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}, _callee2);
|
|
216
|
+
}));
|
|
217
|
+
|
|
218
|
+
return function handlePrevious() {
|
|
219
|
+
return _ref6.apply(this, arguments);
|
|
220
|
+
};
|
|
221
|
+
}();
|
|
222
|
+
|
|
190
223
|
var _renderElements$curre2 = renderElements[current],
|
|
191
224
|
getButtonDisabledState = _renderElements$curre2.getButtonDisabledState,
|
|
192
225
|
getPreviousDisabledState = _renderElements$curre2.getPreviousDisabledState;
|
|
@@ -223,9 +256,7 @@ var Pages = function Pages(_ref) {
|
|
|
223
256
|
className: 'igloo-pages-footer',
|
|
224
257
|
children: [current === 0 && (0, _jsxRuntime.jsx)("div", {}), current > 0 && (0, _jsxRuntime.jsx)(_button.default, {
|
|
225
258
|
className: 'igloo-pages-preview-button',
|
|
226
|
-
onClick:
|
|
227
|
-
return setCurrent(current - 1);
|
|
228
|
-
},
|
|
259
|
+
onClick: handlePrevious,
|
|
229
260
|
disabled: previousDisabled,
|
|
230
261
|
children: previewText || formatMessage({
|
|
231
262
|
id: 'Previous'
|
package/lib/types.d.ts
CHANGED
|
@@ -88,6 +88,7 @@ export interface FormItemExtraConfig extends FormItemProps {
|
|
|
88
88
|
showOptional?: boolean;
|
|
89
89
|
previewFormater?(value: any, form?: FormInstance): any;
|
|
90
90
|
handleNext?(values: any): any;
|
|
91
|
+
handlePrevious?(currentIndex: number): any;
|
|
91
92
|
render?(preview: boolean, form?: FormInstance, value?: any, onChange?: (params: any) => any, setShowStepButton?: IglooComponentProps['setShowStepButton']): any;
|
|
92
93
|
locales?: {
|
|
93
94
|
[key: string]: string;
|