/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
esm
/
client
/
/opt/canhelp/node_modules/next/dist/esm/client
mkdir
upload
Name
Size
Mode
Actions
app-dir/
-
0755
rm
compat/
-
0755
rm
components/
-
0755
rm
dev/
-
0755
rm
legacy/
-
0755
rm
lib/
-
0755
rm
portal/
-
0755
rm
react-client-callbacks/
-
0755
rm
request/
-
0755
rm
tracing/
-
0755
rm
add-base-path.js
433
0644
edit
dl
rm
add-base-path.js.map
978
0644
edit
dl
rm
add-locale.js
501
0644
edit
dl
rm
add-locale.js.map
899
0644
edit
dl
rm
app-bootstrap.js
2210
0644
edit
dl
rm
app-bootstrap.js.map
3964
0644
edit
dl
rm
app-build-id.js
985
0644
edit
dl
rm
app-build-id.js.map
1418
0644
edit
dl
rm
app-call-server.js
600
0644
edit
dl
rm
app-call-server.js.map
1041
0644
edit
dl
rm
app-find-source-map-url.js
1124
0644
edit
dl
rm
app-find-source-map-url.js.map
2081
0644
edit
dl
rm
app-globals.js
301
0644
edit
dl
rm
app-globals.js.map
600
0644
edit
dl
rm
app-index.js
10228
0644
edit
dl
rm
app-index.js.map
17238
0644
edit
dl
rm
app-link-gc.js
4025
0644
edit
dl
rm
app-link-gc.js.map
5146
0644
edit
dl
rm
app-next-dev.js
733
0644
edit
dl
rm
app-next-dev.js.map
1264
0644
edit
dl
rm
app-next-turbopack.js
843
0644
edit
dl
rm
app-next-turbopack.js.map
1682
0644
edit
dl
rm
app-next.js
856
0644
edit
dl
rm
app-next.js.map
1266
0644
edit
dl
rm
app-webpack.js
2727
0644
edit
dl
rm
app-webpack.js.map
3207
0644
edit
dl
rm
assign-location.js
995
0644
edit
dl
rm
assign-location.js.map
1557
0644
edit
dl
rm
detect-domain-locale.js
380
0644
edit
dl
rm
detect-domain-locale.js.map
711
0644
edit
dl
rm
flight-data-helpers.js
5088
0644
edit
dl
rm
flight-data-helpers.js.map
8657
0644
edit
dl
rm
form-shared.js
5552
0644
edit
dl
rm
form-shared.js.map
10622
0644
edit
dl
rm
form.js
5212
0644
edit
dl
rm
form.js.map
8306
0644
edit
dl
rm
get-domain-locale.js
998
0644
edit
dl
rm
get-domain-locale.js.map
2451
0644
edit
dl
rm
has-base-path.js
257
0644
edit
dl
rm
has-base-path.js.map
598
0644
edit
dl
rm
head-manager.js
4988
0644
edit
dl
rm
head-manager.js.map
8320
0644
edit
dl
rm
image-component.js
12878
0644
edit
dl
rm
image-component.js.map
21446
0644
edit
dl
rm
index.js
31257
0644
edit
dl
rm
index.js.map
52799
0644
edit
dl
rm
link.js
18165
0644
edit
dl
rm
link.js.map
34394
0644
edit
dl
rm
next-dev-turbopack.js
1417
0644
edit
dl
rm
next-dev-turbopack.js.map
3054
0644
edit
dl
rm
next-dev.js
626
0644
edit
dl
rm
next-dev.js.map
1230
0644
edit
dl
rm
next-turbopack.js
1166
0644
edit
dl
rm
next-turbopack.js.map
2397
0644
edit
dl
rm
next.js
383
0644
edit
dl
rm
next.js.map
893
0644
edit
dl
rm
normalize-locale-path.js
339
0644
edit
dl
rm
normalize-locale-path.js.map
872
0644
edit
dl
rm
normalize-trailing-slash.js
935
0644
edit
dl
rm
normalize-trailing-slash.js.map
1736
0644
edit
dl
rm
page-bootstrap.js
6314
0644
edit
dl
rm
page-bootstrap.js.map
9025
0644
edit
dl
rm
page-loader.js
6820
0644
edit
dl
rm
page-loader.js.map
12220
0644
edit
dl
rm
remove-base-path.js
526
0644
edit
dl
rm
remove-base-path.js.map
1138
0644
edit
dl
rm
remove-locale.js
600
0644
edit
dl
rm
remove-locale.js.map
1301
0644
edit
dl
rm
request-idle-callback.js
634
0644
edit
dl
rm
request-idle-callback.js.map
1392
0644
edit
dl
rm
resolve-href.js
4816
0644
edit
dl
rm
resolve-href.js.map
7983
0644
edit
dl
rm
route-announcer.js
2346
0644
edit
dl
rm
route-announcer.js.map
3523
0644
edit
dl
rm
route-loader.js
13075
0644
edit
dl
rm
route-loader.js.map
23036
0644
edit
dl
rm
route-params.js
6815
0644
edit
dl
rm
route-params.js.map
10822
0644
edit
dl
rm
router.js
5873
0644
edit
dl
rm
router.js.map
8845
0644
edit
dl
rm
script.js
12619
0644
edit
dl
rm
script.js.map
18711
0644
edit
dl
rm
set-attributes-from-props.js
1817
0644
edit
dl
rm
set-attributes-from-props.js.map
3101
0644
edit
dl
rm
trusted-types.js
1410
0644
edit
dl
rm
trusted-types.js.map
1956
0644
edit
dl
rm
use-client-disallowed.js
476
0644
edit
dl
rm
use-client-disallowed.js.map
739
0644
edit
dl
rm
use-intersection.js
3248
0644
edit
dl
rm
use-intersection.js.map
6647
0644
edit
dl
rm
use-merged-ref.js
2345
0644
edit
dl
rm
use-merged-ref.js.map
3566
0644
edit
dl
rm
web-vitals.js
491
0644
edit
dl
rm
web-vitals.js.map
1005
0644
edit
dl
rm
webpack.js
1877
0644
edit
dl
rm
webpack.js.map
2542
0644
edit
dl
rm
with-router.js
781
0644
edit
dl
rm
with-router.js.map
1935
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/esm/client/form.js
(5212B)
'use client'; import { jsx as _jsx } from "react/jsx-runtime"; import { useContext, forwardRef } from 'react'; import { addBasePath } from './add-base-path'; import { RouterContext } from '../shared/lib/router-context.shared-runtime'; import { checkFormActionUrl, createFormSubmitDestinationUrl, DISALLOWED_FORM_PROPS, hasReactClientActionAttributes, hasUnsupportedSubmitterAttributes } from './form-shared'; const Form = /*#__PURE__*/ forwardRef(function FormComponent(param, ref) { let { replace, scroll, prefetch: prefetchProp, ...props } = param; const router = useContext(RouterContext); const actionProp = props.action; const isNavigatingForm = typeof actionProp === 'string'; // Validate `action` if (process.env.NODE_ENV === 'development') { if (isNavigatingForm) { checkFormActionUrl(actionProp, 'action'); } } // Validate `prefetch` if (process.env.NODE_ENV === 'development') { if (prefetchProp !== undefined) { console.error('Passing `prefetch` to a <Form> has no effect in the pages directory.'); } } // Validate `scroll` and `replace` if (process.env.NODE_ENV === 'development') { if (!isNavigatingForm && (replace !== undefined || scroll !== undefined)) { console.error('Passing `replace` or `scroll` to a <Form> whose `action` is a function has no effect.\n' + 'See the relevant docs to learn how to control this behavior for navigations triggered from actions:\n' + ' `router.replace()` - https://nextjs.org/docs/pages/api-reference/functions/use-router#routerreplace\n'); } } // Clean up any unsupported form props (and warn if present) for (const key of DISALLOWED_FORM_PROPS){ if (key in props) { if (process.env.NODE_ENV === 'development') { console.error("<Form> does not support changing `" + key + "`."); } delete props[key]; } } if (!isNavigatingForm) { return /*#__PURE__*/ _jsx("form", { ...props, ref: ref }); } const actionHref = addBasePath(actionProp); return /*#__PURE__*/ _jsx("form", { ...props, ref: ref, action: actionHref, onSubmit: (event)=>onFormSubmit(event, { router, actionHref, replace, scroll, onSubmit: props.onSubmit }) }); }); export default Form; function onFormSubmit(event, param) { let { actionHref, onSubmit, replace, scroll, router } = param; if (typeof onSubmit === 'function') { onSubmit(event); // if the user called event.preventDefault(), do nothing. // (this matches what Link does for `onClick`) if (event.defaultPrevented) { return; } } if (!router) { // Form was somehow used outside of the router (but not in app/, the implementation is forked!). // We can't perform a soft navigation, so let the native submit handling do its thing. return; } const formElement = event.currentTarget; const submitter = event.nativeEvent.submitter; let action = actionHref; if (submitter) { // this is page-router-only, so we don't need to worry about false positives // from the attributes that react adds for server actions. if (hasUnsupportedSubmitterAttributes(submitter)) { return; } // client actions have `formAction="javascript:..."`. We obviously can't prefetch/navigate to that. if (hasReactClientActionAttributes(submitter)) { return; } // If the submitter specified an alternate formAction, // use that URL instead -- this is what a native form would do. // NOTE: `submitter.formAction` is unreliable, because it will give us `location.href` if it *wasn't* set // NOTE: this should not have `basePath` added, because we can't add it before hydration const submitterFormAction = submitter.getAttribute('formAction'); if (submitterFormAction !== null) { if (process.env.NODE_ENV === 'development') { checkFormActionUrl(submitterFormAction, 'formAction'); } action = submitterFormAction; } } const targetUrl = createFormSubmitDestinationUrl(action, formElement); // Finally, no more reasons for bailing out. event.preventDefault(); const method = replace ? 'replace' : 'push'; const targetHref = targetUrl.href // TODO: will pages router be happy about an absolute URL here? ; // TODO(form): Make this use a transition so that pending states work // // Unlike the app router, pages router doesn't use startTransition, // and can't easily be wrapped in one because of implementation details // (e.g. it doesn't use any react state) // But it's important to have this wrapped in a transition because // pending states from e.g. `useFormStatus` rely on that. // So this needs some follow up work. router[method](targetHref, undefined, { scroll }); } //# sourceMappingURL=form.js.map
Save
cmd:
run