@10x-media/form-builder 0.1.0-beta.0 → 0.1.0-beta.1
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/CHANGELOG.md +52 -0
- package/README.md +43 -1402
- package/dist/actions/buildActionBlocks.js +19 -0
- package/dist/actions/buildActionBlocks.js.map +1 -0
- package/dist/actions/builtin/confirmation.js +49 -0
- package/dist/actions/builtin/confirmation.js.map +1 -0
- package/dist/actions/builtin/emailTeam.js +46 -0
- package/dist/actions/builtin/emailTeam.js.map +1 -0
- package/dist/actions/builtin/index.d.ts +7 -0
- package/dist/actions/builtin/index.js +13 -0
- package/dist/actions/builtin/index.js.map +1 -0
- package/dist/actions/builtin/signedWebhook.js +49 -0
- package/dist/actions/builtin/signedWebhook.js.map +1 -0
- package/dist/actions/defineAction.d.ts +36 -0
- package/dist/actions/defineAction.js +6 -0
- package/dist/actions/defineAction.js.map +1 -0
- package/dist/actions/dispatch.js +48 -0
- package/dist/actions/dispatch.js.map +1 -0
- package/dist/actions/registry.d.ts +16 -0
- package/dist/actions/registry.js +16 -0
- package/dist/actions/registry.js.map +1 -0
- package/dist/actions/runActions.d.ts +9 -0
- package/dist/actions/runActions.js +34 -0
- package/dist/actions/runActions.js.map +1 -0
- package/dist/actions/sign.d.ts +7 -0
- package/dist/actions/sign.js +9 -0
- package/dist/actions/sign.js.map +1 -0
- package/dist/actions/task.js +82 -0
- package/dist/actions/task.js.map +1 -0
- package/dist/aggregation/aggregateResponses.d.ts +31 -0
- package/dist/aggregation/aggregateResponses.js +86 -0
- package/dist/aggregation/aggregateResponses.js.map +1 -0
- package/dist/aggregation/aggregateRows.d.ts +10 -0
- package/dist/aggregation/aggregateRows.js +64 -0
- package/dist/aggregation/aggregateRows.js.map +1 -0
- package/dist/aggregation/resolveResultsRequest.d.ts +32 -0
- package/dist/aggregation/resolveResultsRequest.js +56 -0
- package/dist/aggregation/resolveResultsRequest.js.map +1 -0
- package/dist/aggregation/types.d.ts +39 -0
- package/dist/calc/computeCalcFields.d.ts +15 -0
- package/dist/calc/computeCalcFields.js +27 -0
- package/dist/calc/computeCalcFields.js.map +1 -0
- package/dist/calc/evaluate.d.ts +8 -0
- package/dist/calc/evaluate.js +59 -0
- package/dist/calc/evaluate.js.map +1 -0
- package/dist/calc/normalizeCalc.d.ts +8 -0
- package/dist/calc/normalizeCalc.js +100 -0
- package/dist/calc/normalizeCalc.js.map +1 -0
- package/dist/calc/types.d.ts +28 -0
- package/dist/client/ConditionBuilder.js +121 -0
- package/dist/client/ConditionBuilder.js.map +1 -0
- package/dist/client/ConditionRow.js +150 -0
- package/dist/client/ConditionRow.js.map +1 -0
- package/dist/client/FlowBuilder.d.ts +15 -0
- package/dist/client/FlowBuilder.js +408 -0
- package/dist/client/FlowBuilder.js.map +1 -0
- package/dist/client/FormConditionField.d.ts +21 -0
- package/dist/client/FormConditionField.js +33 -0
- package/dist/client/FormConditionField.js.map +1 -0
- package/dist/client/synthesizeClientField.js +46 -0
- package/dist/client/synthesizeClientField.js.map +1 -0
- package/dist/collections/formSubmissions.js +138 -0
- package/dist/collections/formSubmissions.js.map +1 -0
- package/dist/collections/forms.js +187 -0
- package/dist/collections/forms.js.map +1 -0
- package/dist/collections/uploads.d.ts +29 -0
- package/dist/collections/uploads.js +46 -0
- package/dist/collections/uploads.js.map +1 -0
- package/dist/conditions/conditionType.js +14 -0
- package/dist/conditions/conditionType.js.map +1 -0
- package/dist/conditions/evaluate.d.ts +17 -0
- package/dist/conditions/evaluate.js +94 -0
- package/dist/conditions/evaluate.js.map +1 -0
- package/dist/conditions/fieldTypes.d.ts +9 -0
- package/dist/{fieldTypes-CzhhJXjg.js → conditions/fieldTypes.js} +2 -2
- package/dist/conditions/fieldTypes.js.map +1 -0
- package/dist/conditions/normalizeConditions.js +47 -0
- package/dist/conditions/normalizeConditions.js.map +1 -0
- package/dist/conditions/types.d.ts +8 -0
- package/dist/consent/buildConsentSourceConfig.js +49 -0
- package/dist/consent/buildConsentSourceConfig.js.map +1 -0
- package/dist/consent/builtin/index.d.ts +7 -0
- package/dist/consent/builtin/index.js +11 -0
- package/dist/consent/builtin/index.js.map +1 -0
- package/dist/consent/builtin/pageReference.js +75 -0
- package/dist/consent/builtin/pageReference.js.map +1 -0
- package/dist/consent/builtin/static.js +44 -0
- package/dist/consent/builtin/static.js.map +1 -0
- package/dist/consent/captureConsent.d.ts +28 -0
- package/dist/consent/captureConsent.js +26 -0
- package/dist/consent/captureConsent.js.map +1 -0
- package/dist/consent/defineConsentSource.d.ts +35 -0
- package/dist/consent/defineConsentSource.js +6 -0
- package/dist/consent/defineConsentSource.js.map +1 -0
- package/dist/consent/registry.d.ts +16 -0
- package/dist/consent/registry.js +16 -0
- package/dist/consent/registry.js.map +1 -0
- package/dist/consent/resolveConsentLinks.d.ts +19 -0
- package/dist/consent/resolveConsentLinks.js +26 -0
- package/dist/consent/resolveConsentLinks.js.map +1 -0
- package/dist/consent/resolvePublishedVersionRef.d.ts +17 -0
- package/dist/consent/resolvePublishedVersionRef.js +27 -0
- package/dist/consent/resolvePublishedVersionRef.js.map +1 -0
- package/dist/events/noopSink.js +6 -0
- package/dist/events/noopSink.js.map +1 -0
- package/dist/events/resolveEventSink.js +8 -0
- package/dist/events/resolveEventSink.js.map +1 -0
- package/dist/events/types.d.ts +31 -0
- package/dist/exports/client.d.ts +3 -21
- package/dist/exports/client.js +3 -319
- package/dist/exports/i18n.d.ts +3 -138
- package/dist/exports/i18n.js +2 -2
- package/dist/exports/react.d.ts +45 -550
- package/dist/exports/react.js +39 -1563
- package/dist/exports/rsc.d.ts +2 -16
- package/dist/exports/rsc.js +1 -54
- package/dist/exports/types.d.ts +27 -5
- package/dist/fields/buildFieldBlocks.js +46 -0
- package/dist/fields/buildFieldBlocks.js.map +1 -0
- package/dist/fields/builtin/calculation.js +24 -0
- package/dist/fields/builtin/calculation.js.map +1 -0
- package/dist/fields/builtin/checkbox.js +13 -0
- package/dist/fields/builtin/checkbox.js.map +1 -0
- package/dist/fields/builtin/consent.js +32 -0
- package/dist/fields/builtin/consent.js.map +1 -0
- package/dist/fields/builtin/email.js +18 -0
- package/dist/fields/builtin/email.js.map +1 -0
- package/dist/fields/builtin/file.js +40 -0
- package/dist/fields/builtin/file.js.map +1 -0
- package/dist/fields/builtin/index.js +25 -0
- package/dist/fields/builtin/index.js.map +1 -0
- package/dist/fields/builtin/number.js +17 -0
- package/dist/fields/builtin/number.js.map +1 -0
- package/dist/fields/builtin/select.js +44 -0
- package/dist/fields/builtin/select.js.map +1 -0
- package/dist/fields/builtin/text.js +13 -0
- package/dist/fields/builtin/text.js.map +1 -0
- package/dist/fields/builtin/textarea.js +13 -0
- package/dist/fields/builtin/textarea.js.map +1 -0
- package/dist/fields/defineFormField.d.ts +13 -0
- package/dist/fields/defineFormField.js +12 -0
- package/dist/fields/defineFormField.js.map +1 -0
- package/dist/fields/registry.d.ts +10 -0
- package/dist/fields/registry.js +24 -0
- package/dist/fields/registry.js.map +1 -0
- package/dist/fields/sharedConfig.js +89 -0
- package/dist/fields/sharedConfig.js.map +1 -0
- package/dist/fields/types.d.ts +88 -0
- package/dist/flow/engine.d.ts +17 -0
- package/dist/flow/engine.js +24 -0
- package/dist/flow/engine.js.map +1 -0
- package/dist/flow/normalizeFlow.js +35 -0
- package/dist/flow/normalizeFlow.js.map +1 -0
- package/dist/{types-DsJ_6kGJ.d.ts → flow/types.d.ts} +2 -2
- package/dist/index.d.ts +74 -4
- package/dist/index.js +40 -1889
- package/dist/index.js.map +1 -1
- package/dist/plugin/access.js +12 -0
- package/dist/plugin/access.js.map +1 -0
- package/dist/plugin/registerCollections.js +40 -0
- package/dist/plugin/registerCollections.js.map +1 -0
- package/dist/plugin/registerTranslations.js +19 -0
- package/dist/plugin/registerTranslations.js.map +1 -0
- package/dist/prefill/valuesFromSearchParams.d.ts +18 -0
- package/dist/prefill/valuesFromSearchParams.js +45 -0
- package/dist/prefill/valuesFromSearchParams.js.map +1 -0
- package/dist/presentations/defaults.d.ts +33 -0
- package/dist/presentations/defaults.js +35 -0
- package/dist/presentations/defaults.js.map +1 -0
- package/dist/presentations/registry.d.ts +15 -0
- package/dist/presentations/registry.js +15 -0
- package/dist/presentations/registry.js.map +1 -0
- package/dist/presentations/types.d.ts +18 -0
- package/dist/react/Form.d.ts +81 -0
- package/dist/react/Form.js +457 -0
- package/dist/react/Form.js.map +1 -0
- package/dist/react/FormContext.d.ts +16 -0
- package/dist/react/FormContext.js +14 -0
- package/dist/react/FormContext.js.map +1 -0
- package/dist/react/FormLayout.d.ts +20 -0
- package/dist/react/FormLayout.js +14 -0
- package/dist/react/FormLayout.js.map +1 -0
- package/dist/react/FormResults.d.ts +25 -0
- package/dist/react/FormResults.js +85 -0
- package/dist/react/FormResults.js.map +1 -0
- package/dist/react/Honeypot.d.ts +22 -0
- package/dist/react/Honeypot.js +38 -0
- package/dist/react/Honeypot.js.map +1 -0
- package/dist/react/Poll.d.ts +32 -0
- package/dist/react/Poll.js +77 -0
- package/dist/react/Poll.js.map +1 -0
- package/dist/react/cn.d.ts +6 -0
- package/dist/react/cn.js +8 -0
- package/dist/react/cn.js.map +1 -0
- package/dist/react/contract.d.ts +32 -0
- package/dist/react/contract.js +7 -0
- package/dist/react/contract.js.map +1 -0
- package/dist/react/events.js +14 -0
- package/dist/react/events.js.map +1 -0
- package/dist/react/fetchResults.d.ts +25 -0
- package/dist/react/fetchResults.js +31 -0
- package/dist/react/fetchResults.js.map +1 -0
- package/dist/react/presentation/Backdrop.d.ts +18 -0
- package/dist/react/presentation/Backdrop.js +14 -0
- package/dist/react/presentation/Backdrop.js.map +1 -0
- package/dist/react/presentation/DialogSurface.d.ts +35 -0
- package/dist/react/presentation/DialogSurface.js +56 -0
- package/dist/react/presentation/DialogSurface.js.map +1 -0
- package/dist/react/presentation/presentations.d.ts +7 -0
- package/dist/react/presentation/presentations.js +32 -0
- package/dist/react/presentation/presentations.js.map +1 -0
- package/dist/react/presentation/registry.d.ts +11 -0
- package/dist/react/presentation/registry.js +12 -0
- package/dist/react/presentation/registry.js.map +1 -0
- package/dist/react/presentation/types.d.ts +19 -0
- package/dist/react/presentation/useDismiss.d.ts +19 -0
- package/dist/react/presentation/useDismiss.js +33 -0
- package/dist/react/presentation/useDismiss.js.map +1 -0
- package/dist/react/presentation/useFocusTrap.d.ts +8 -0
- package/dist/react/presentation/useFocusTrap.js +35 -0
- package/dist/react/presentation/useFocusTrap.js.map +1 -0
- package/dist/react/presentation/useScrollLock.d.ts +6 -0
- package/dist/react/presentation/useScrollLock.js +18 -0
- package/dist/react/presentation/useScrollLock.js.map +1 -0
- package/dist/react/primitives/Checkbox.d.ts +26 -0
- package/dist/react/primitives/Checkbox.js +20 -0
- package/dist/react/primitives/Checkbox.js.map +1 -0
- package/dist/react/primitives/FieldShell.d.ts +31 -0
- package/dist/react/primitives/FieldShell.js +51 -0
- package/dist/react/primitives/FieldShell.js.map +1 -0
- package/dist/react/primitives/Input.d.ts +30 -0
- package/dist/react/primitives/Input.js +21 -0
- package/dist/react/primitives/Input.js.map +1 -0
- package/dist/react/primitives/Select.d.ts +34 -0
- package/dist/react/primitives/Select.js +26 -0
- package/dist/react/primitives/Select.js.map +1 -0
- package/dist/react/primitives/Textarea.d.ts +28 -0
- package/dist/react/primitives/Textarea.js +20 -0
- package/dist/react/primitives/Textarea.js.map +1 -0
- package/dist/react/recall.js +20 -0
- package/dist/react/recall.js.map +1 -0
- package/dist/react/registry.d.ts +16 -0
- package/dist/react/registry.js +16 -0
- package/dist/react/registry.js.map +1 -0
- package/dist/react/renderers/calculation.js +30 -0
- package/dist/react/renderers/calculation.js.map +1 -0
- package/dist/react/renderers/checkbox.js +35 -0
- package/dist/react/renderers/checkbox.js.map +1 -0
- package/dist/react/renderers/consent.js +54 -0
- package/dist/react/renderers/consent.js.map +1 -0
- package/dist/react/renderers/email.js +37 -0
- package/dist/react/renderers/email.js.map +1 -0
- package/dist/react/renderers/file.js +92 -0
- package/dist/react/renderers/file.js.map +1 -0
- package/dist/react/renderers/index.d.ts +8 -0
- package/dist/react/renderers/index.js +26 -0
- package/dist/react/renderers/index.js.map +1 -0
- package/dist/react/renderers/number.js +40 -0
- package/dist/react/renderers/number.js.map +1 -0
- package/dist/react/renderers/select.js +38 -0
- package/dist/react/renderers/select.js.map +1 -0
- package/dist/react/renderers/text.js +37 -0
- package/dist/react/renderers/text.js.map +1 -0
- package/dist/react/renderers/textarea.js +36 -0
- package/dist/react/renderers/textarea.js.map +1 -0
- package/dist/react/resolveForm.js +16 -0
- package/dist/react/resolveForm.js.map +1 -0
- package/dist/react/state.d.ts +15 -0
- package/dist/react/state.js +70 -0
- package/dist/react/state.js.map +1 -0
- package/dist/react/submitForm.d.ts +31 -0
- package/dist/react/submitForm.js +58 -0
- package/dist/react/submitForm.js.map +1 -0
- package/dist/react/toFormDocument.d.ts +24 -0
- package/dist/react/toFormDocument.js +22 -0
- package/dist/react/toFormDocument.js.map +1 -0
- package/dist/react/uploadFile.d.ts +23 -0
- package/dist/react/uploadFile.js +39 -0
- package/dist/react/uploadFile.js.map +1 -0
- package/dist/react/useField.d.ts +14 -0
- package/dist/react/useField.js +49 -0
- package/dist/react/useField.js.map +1 -0
- package/dist/react/useFormState.d.ts +8 -0
- package/dist/react/useFormState.js +9 -0
- package/dist/react/useFormState.js.map +1 -0
- package/dist/react/useFormStep.d.ts +8 -0
- package/dist/react/useFormStep.js +9 -0
- package/dist/react/useFormStep.js.map +1 -0
- package/dist/react/validateField.js +30 -0
- package/dist/react/validateField.js.map +1 -0
- package/dist/recall/interpolate.d.ts +10 -0
- package/dist/recall/interpolate.js +16 -0
- package/dist/recall/interpolate.js.map +1 -0
- package/dist/recall/resolver.d.ts +22 -0
- package/dist/recall/resolver.js +36 -0
- package/dist/recall/resolver.js.map +1 -0
- package/dist/spam/captcha.d.ts +12 -0
- package/dist/spam/captcha.js +11 -0
- package/dist/spam/captcha.js.map +1 -0
- package/dist/spam/constants.d.ts +12 -0
- package/dist/spam/constants.js +15 -0
- package/dist/spam/constants.js.map +1 -0
- package/dist/spam/identify.d.ts +12 -0
- package/dist/spam/identify.js +20 -0
- package/dist/spam/identify.js.map +1 -0
- package/dist/spam/rateLimiter.d.ts +18 -0
- package/dist/spam/rateLimiter.js +41 -0
- package/dist/spam/rateLimiter.js.map +1 -0
- package/dist/spam/reserved.js +30 -0
- package/dist/spam/reserved.js.map +1 -0
- package/dist/spam/resolveSpam.d.ts +12 -0
- package/dist/spam/resolveSpam.js +42 -0
- package/dist/spam/resolveSpam.js.map +1 -0
- package/dist/spam/spamGuard.js +68 -0
- package/dist/spam/spamGuard.js.map +1 -0
- package/dist/spam/types.d.ts +73 -0
- package/dist/spam/uploadHooks.js +33 -0
- package/dist/spam/uploadHooks.js.map +1 -0
- package/dist/submissions/SubmissionAnswers.d.ts +16 -0
- package/dist/submissions/SubmissionAnswers.js +57 -0
- package/dist/submissions/SubmissionAnswers.js.map +1 -0
- package/dist/submissions/runSubmission.js +205 -0
- package/dist/submissions/runSubmission.js.map +1 -0
- package/dist/submissions/types.d.ts +33 -0
- package/dist/submissions/validateSubmission.js +59 -0
- package/dist/submissions/validateSubmission.js.map +1 -0
- package/dist/translations/en.d.ts +12 -0
- package/dist/{translations-edMqq_2e.js → translations/en.js} +3 -22
- package/dist/translations/en.js.map +1 -0
- package/dist/translations/index.d.ts +14 -0
- package/dist/translations/index.js +26 -0
- package/dist/translations/index.js.map +1 -0
- package/dist/translations/keys.d.ts +132 -0
- package/dist/{keys-N5xGiUsh.js → translations/keys.js} +2 -2
- package/dist/translations/keys.js.map +1 -0
- package/dist/translations/makeTranslate.d.ts +11 -0
- package/dist/translations/makeTranslate.js +11 -0
- package/dist/translations/makeTranslate.js.map +1 -0
- package/dist/translations/server.js +25 -0
- package/dist/translations/server.js.map +1 -0
- package/dist/translations/useTranslation.js +12 -0
- package/dist/translations/useTranslation.js.map +1 -0
- package/dist/uploads/captureFileRef.d.ts +27 -0
- package/dist/uploads/captureFileRef.js +34 -0
- package/dist/uploads/captureFileRef.js.map +1 -0
- package/dist/uploads/resolveFileRef.d.ts +26 -0
- package/dist/uploads/resolveFileRef.js +44 -0
- package/dist/uploads/resolveFileRef.js.map +1 -0
- package/dist/uploads/types.d.ts +20 -0
- package/dist/validation/buildRuleBlocks.js +46 -0
- package/dist/validation/buildRuleBlocks.js.map +1 -0
- package/dist/validation/builtin/email.js +19 -0
- package/dist/validation/builtin/email.js.map +1 -0
- package/dist/validation/builtin/index.js +27 -0
- package/dist/validation/builtin/index.js.map +1 -0
- package/dist/validation/builtin/matchesField.js +20 -0
- package/dist/validation/builtin/matchesField.js.map +1 -0
- package/dist/validation/builtin/max.js +21 -0
- package/dist/validation/builtin/max.js.map +1 -0
- package/dist/validation/builtin/maxLength.js +26 -0
- package/dist/validation/builtin/maxLength.js.map +1 -0
- package/dist/validation/builtin/min.js +21 -0
- package/dist/validation/builtin/min.js.map +1 -0
- package/dist/validation/builtin/minLength.js +26 -0
- package/dist/validation/builtin/minLength.js.map +1 -0
- package/dist/validation/builtin/notAlreadySubmitted.js +32 -0
- package/dist/validation/builtin/notAlreadySubmitted.js.map +1 -0
- package/dist/validation/builtin/oneOf.js +34 -0
- package/dist/validation/builtin/oneOf.js.map +1 -0
- package/dist/validation/builtin/pattern.js +41 -0
- package/dist/validation/builtin/pattern.js.map +1 -0
- package/dist/validation/builtin/url.js +22 -0
- package/dist/validation/builtin/url.js.map +1 -0
- package/dist/validation/defineValidationRule.d.ts +12 -0
- package/dist/validation/defineValidationRule.js +11 -0
- package/dist/validation/defineValidationRule.js.map +1 -0
- package/dist/validation/message.js +14 -0
- package/dist/validation/message.js.map +1 -0
- package/dist/validation/registry.d.ts +10 -0
- package/dist/validation/registry.js +20 -0
- package/dist/validation/registry.js.map +1 -0
- package/dist/validation/runValidation.js +111 -0
- package/dist/validation/runValidation.js.map +1 -0
- package/dist/validation/types.d.ts +76 -0
- package/package.json +8 -5
- package/styles/form-builder.css +201 -11
- package/dist/constants-B-BUfetP.d.ts +0 -288
- package/dist/exports/client.js.map +0 -1
- package/dist/exports/react.js.map +0 -1
- package/dist/exports/rsc.js.map +0 -1
- package/dist/fieldTypes-B8jkNRob.d.ts +0 -188
- package/dist/fieldTypes-CzhhJXjg.js.map +0 -1
- package/dist/index-DfFYGbVF.d.ts +0 -481
- package/dist/keys-N5xGiUsh.js.map +0 -1
- package/dist/registry-CoCyhtvB.js +0 -282
- package/dist/registry-CoCyhtvB.js.map +0 -1
- package/dist/resolver-OeQyVH2N.js +0 -665
- package/dist/resolver-OeQyVH2N.js.map +0 -1
- package/dist/translations-edMqq_2e.js.map +0 -1
package/dist/exports/client.d.ts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/** Props: standard JSON field client props plus the `conditionTypes` map we pass via clientProps. */
|
|
5
|
-
type FormConditionFieldProps = {
|
|
6
|
-
path?: string;
|
|
7
|
-
field?: {
|
|
8
|
-
label?: unknown;
|
|
9
|
-
name?: string;
|
|
10
|
-
};
|
|
11
|
-
label?: unknown;
|
|
12
|
-
conditionTypes: Record<string, ConditionFieldType>;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* The `Field` mounted on a form field's `visibleWhen`/`validateWhen` json column. Binds the field's own
|
|
16
|
-
* path with `useField<Where>()` (the QueryPresetsWhereField precedent) and renders the native builder.
|
|
17
|
-
*/
|
|
18
|
-
declare const FormConditionField: (props: FormConditionFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { FormConditionField };
|
|
21
|
-
//# sourceMappingURL=client.d.ts.map
|
|
1
|
+
import { FlowBuilder } from "../client/FlowBuilder.js";
|
|
2
|
+
import { FormConditionField } from "../client/FormConditionField.js";
|
|
3
|
+
export { FlowBuilder, FormConditionField };
|
package/dist/exports/client.js
CHANGED
|
@@ -1,320 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { DateCondition, FieldLabel, NumberCondition, ReactSelect, SelectCondition, TextCondition, useField, useFormFields, useTranslation } from "@payloadcms/ui";
|
|
6
|
-
import { useMemo } from "react";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
//#region src/translations/useTranslation.ts
|
|
9
|
-
/**
|
|
10
|
-
* `useTranslation` bound to this plugin's keys, so `t(keys.X)` typechecks without
|
|
11
|
-
* a per-call `@ts-expect-error`. Returns Payload's `{ t, i18n }` unchanged.
|
|
12
|
-
*/
|
|
13
|
-
const useTranslation$1 = () => useTranslation();
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/client/synthesizeClientField.ts
|
|
16
|
-
/** Project a stored field row into a condition operand, or `null` when the row has no usable name. */
|
|
17
|
-
const operandFromRow = (row, conditionTypes) => {
|
|
18
|
-
const name = typeof row.name === "string" ? row.name.trim() : "";
|
|
19
|
-
if (name.length === 0) return null;
|
|
20
|
-
const conditionType = conditionTypes[row.blockType] ?? "text";
|
|
21
|
-
return {
|
|
22
|
-
name,
|
|
23
|
-
label: typeof row.label === "string" && row.label.length > 0 ? row.label : name,
|
|
24
|
-
conditionType,
|
|
25
|
-
options: Array.isArray(row.options) ? row.options : void 0
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Build the minimal `*FieldClient` a Payload leaf condition input requires for a given operand. Casts
|
|
30
|
-
* are localized to these four synths and nowhere else: `FieldBaseClient` requires only `name`, and each
|
|
31
|
-
* leaf is `FieldBaseClient & Pick<…, 'type' | …>` where every picked member but `type` (and `select`'s
|
|
32
|
-
* required `options`) is optional, so the literals are structurally complete. `dateClientField` omits
|
|
33
|
-
* `admin.date`, so `DateCondition` falls back to its default date format. Each synth returns a single
|
|
34
|
-
* concrete client type so leaf `field` props need no narrowing.
|
|
35
|
-
*/
|
|
36
|
-
const textClientField = (operand) => ({
|
|
37
|
-
name: operand.name,
|
|
38
|
-
label: operand.label,
|
|
39
|
-
type: "text"
|
|
40
|
-
});
|
|
41
|
-
const numberClientField = (operand) => ({
|
|
42
|
-
name: operand.name,
|
|
43
|
-
label: operand.label,
|
|
44
|
-
type: "number"
|
|
45
|
-
});
|
|
46
|
-
const dateClientField = (operand) => ({
|
|
47
|
-
name: operand.name,
|
|
48
|
-
label: operand.label,
|
|
49
|
-
type: "date"
|
|
50
|
-
});
|
|
51
|
-
const selectClientField = (operand) => ({
|
|
52
|
-
name: operand.name,
|
|
53
|
-
label: operand.label,
|
|
54
|
-
type: "select",
|
|
55
|
-
options: operand.options ?? []
|
|
56
|
-
});
|
|
57
|
-
//#endregion
|
|
58
|
-
//#region src/client/ConditionRow.tsx
|
|
59
|
-
/** ReactSelect's `onChange` hands back `Option | Option[]`; narrow it to the single chosen option. */
|
|
60
|
-
const singleOption = (selected) => Array.isArray(selected) ? selected[0] : selected;
|
|
61
|
-
const ConditionRow = ({ condition, operands, onChange, onRemove }) => {
|
|
62
|
-
const { t, i18n } = useTranslation$1();
|
|
63
|
-
const operand = operands.find((entry) => entry.name === condition.field);
|
|
64
|
-
const conditionType = operand?.conditionType ?? "text";
|
|
65
|
-
const operators = conditionOperators[conditionType];
|
|
66
|
-
const fieldOptions = operands.map((entry) => ({
|
|
67
|
-
label: entry.label,
|
|
68
|
-
value: entry.name
|
|
69
|
-
}));
|
|
70
|
-
const operatorOptions = operators.map((operator) => ({
|
|
71
|
-
label: i18n.t(operatorLabelKey(operator)),
|
|
72
|
-
value: operator
|
|
73
|
-
}));
|
|
74
|
-
const handleFieldChange = (selected) => {
|
|
75
|
-
const chosen = singleOption(selected);
|
|
76
|
-
const next = operands.find((entry) => entry.name === chosen?.value);
|
|
77
|
-
if (!next) return;
|
|
78
|
-
onChange({
|
|
79
|
-
field: next.name,
|
|
80
|
-
operator: firstOperatorFor(next.conditionType),
|
|
81
|
-
value: void 0
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
const handleOperatorChange = (selected) => {
|
|
85
|
-
const chosen = singleOption(selected);
|
|
86
|
-
if (!chosen) return;
|
|
87
|
-
const operator = chosen.value;
|
|
88
|
-
const keepValue = operatorValueShape(condition.operator) === operatorValueShape(operator);
|
|
89
|
-
onChange({
|
|
90
|
-
...condition,
|
|
91
|
-
operator,
|
|
92
|
-
value: keepValue ? condition.value : void 0
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
96
|
-
className: "form-builder-condition-row",
|
|
97
|
-
style: {
|
|
98
|
-
display: "flex",
|
|
99
|
-
gap: 8,
|
|
100
|
-
alignItems: "flex-start"
|
|
101
|
-
},
|
|
102
|
-
children: [
|
|
103
|
-
/* @__PURE__ */ jsx("div", {
|
|
104
|
-
style: { minWidth: 160 },
|
|
105
|
-
children: /* @__PURE__ */ jsx(ReactSelect, {
|
|
106
|
-
options: fieldOptions,
|
|
107
|
-
value: fieldOptions.find((option) => option.value === condition.field),
|
|
108
|
-
placeholder: t(keys.conditionSelectField),
|
|
109
|
-
isClearable: false,
|
|
110
|
-
onChange: handleFieldChange
|
|
111
|
-
})
|
|
112
|
-
}),
|
|
113
|
-
/* @__PURE__ */ jsx("div", {
|
|
114
|
-
style: { minWidth: 140 },
|
|
115
|
-
children: /* @__PURE__ */ jsx(ReactSelect, {
|
|
116
|
-
options: operatorOptions,
|
|
117
|
-
value: operatorOptions.find((option) => option.value === condition.operator),
|
|
118
|
-
disabled: !operand,
|
|
119
|
-
isClearable: false,
|
|
120
|
-
onChange: handleOperatorChange
|
|
121
|
-
})
|
|
122
|
-
}),
|
|
123
|
-
/* @__PURE__ */ jsx("div", {
|
|
124
|
-
style: { flex: 1 },
|
|
125
|
-
children: /* @__PURE__ */ jsx(ConditionValue, {
|
|
126
|
-
conditionType,
|
|
127
|
-
operand,
|
|
128
|
-
operator: condition.operator,
|
|
129
|
-
value: condition.value,
|
|
130
|
-
onChange: (value) => onChange({
|
|
131
|
-
...condition,
|
|
132
|
-
value
|
|
133
|
-
})
|
|
134
|
-
})
|
|
135
|
-
}),
|
|
136
|
-
/* @__PURE__ */ jsx("button", {
|
|
137
|
-
type: "button",
|
|
138
|
-
onClick: onRemove,
|
|
139
|
-
"aria-label": t(keys.conditionRemove),
|
|
140
|
-
children: t(keys.conditionRemove)
|
|
141
|
-
})
|
|
142
|
-
]
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
const ConditionValue = ({ conditionType, operand, operator, value, onChange }) => {
|
|
146
|
-
const { t } = useTranslation$1();
|
|
147
|
-
if (conditionType === "checkbox" || operatorValueShape(operator) === "boolean") {
|
|
148
|
-
const options = [{
|
|
149
|
-
label: t(keys.conditionTrue),
|
|
150
|
-
value: "true"
|
|
151
|
-
}, {
|
|
152
|
-
label: t(keys.conditionFalse),
|
|
153
|
-
value: "false"
|
|
154
|
-
}];
|
|
155
|
-
const handleBooleanChange = (selected) => {
|
|
156
|
-
onChange(singleOption(selected)?.value === "true");
|
|
157
|
-
};
|
|
158
|
-
return /* @__PURE__ */ jsx(ReactSelect, {
|
|
159
|
-
options,
|
|
160
|
-
value: options.find((option) => String(option.value) === String(value)) ?? options[0],
|
|
161
|
-
isClearable: false,
|
|
162
|
-
onChange: handleBooleanChange
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
if (!operand) return null;
|
|
166
|
-
switch (conditionType) {
|
|
167
|
-
case "number": return /* @__PURE__ */ jsx(NumberCondition, {
|
|
168
|
-
disabled: false,
|
|
169
|
-
field: numberClientField(operand),
|
|
170
|
-
operator,
|
|
171
|
-
value,
|
|
172
|
-
onChange: (next) => onChange(next)
|
|
173
|
-
});
|
|
174
|
-
case "date": return /* @__PURE__ */ jsx(DateCondition, {
|
|
175
|
-
disabled: false,
|
|
176
|
-
field: dateClientField(operand),
|
|
177
|
-
operator,
|
|
178
|
-
value,
|
|
179
|
-
onChange: (next) => onChange(next)
|
|
180
|
-
});
|
|
181
|
-
case "select": return /* @__PURE__ */ jsx(SelectCondition, {
|
|
182
|
-
disabled: false,
|
|
183
|
-
field: selectClientField(operand),
|
|
184
|
-
operator,
|
|
185
|
-
options: operand.options ?? [],
|
|
186
|
-
value,
|
|
187
|
-
onChange: (next) => onChange(next)
|
|
188
|
-
});
|
|
189
|
-
default: return /* @__PURE__ */ jsx(TextCondition, {
|
|
190
|
-
disabled: false,
|
|
191
|
-
field: textClientField(operand),
|
|
192
|
-
operator,
|
|
193
|
-
value,
|
|
194
|
-
onChange: (next) => onChange(next)
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
//#endregion
|
|
199
|
-
//#region src/client/ConditionBuilder.tsx
|
|
200
|
-
const toRow = (constraint) => {
|
|
201
|
-
const field = Object.keys(constraint)[0];
|
|
202
|
-
if (!field) return null;
|
|
203
|
-
const ops = constraint[field];
|
|
204
|
-
const operator = Object.keys(ops)[0];
|
|
205
|
-
if (!operator) return null;
|
|
206
|
-
return {
|
|
207
|
-
field,
|
|
208
|
-
operator,
|
|
209
|
-
value: ops[operator]
|
|
210
|
-
};
|
|
211
|
-
};
|
|
212
|
-
const fromRow = (row) => ({ [row.field]: { [row.operator]: row.value } });
|
|
213
|
-
const readGroups = (value) => {
|
|
214
|
-
if (!value || Object.keys(value).length === 0) return [];
|
|
215
|
-
const canonical = transformWhereQuery(value);
|
|
216
|
-
return (Array.isArray(canonical.or) ? canonical.or : []).map((group) => {
|
|
217
|
-
return (Array.isArray(group.and) ? group.and : []).map((constraint) => toRow(constraint)).filter((row) => row !== null);
|
|
218
|
-
});
|
|
219
|
-
};
|
|
220
|
-
const writeGroups = (groups) => ({ or: groups.filter((group) => group.length > 0).map((group) => ({ and: group.map(fromRow) })) });
|
|
221
|
-
const operandsFromData = (data, conditionTypes, selfName) => {
|
|
222
|
-
return (Array.isArray(data.fields) ? data.fields : []).map((row) => operandFromRow(row, conditionTypes)).filter((operand) => operand !== null && operand.name !== selfName);
|
|
223
|
-
};
|
|
224
|
-
const ConditionBuilder = ({ value, onChange, conditionTypes, selfName }) => {
|
|
225
|
-
const { t } = useTranslation$1();
|
|
226
|
-
const operandsJson = useFormFields(([fields]) => JSON.stringify(operandsFromData(reduceFieldsToValues(fields, true), conditionTypes, selfName)));
|
|
227
|
-
const operands = useMemo(() => JSON.parse(operandsJson), [operandsJson]);
|
|
228
|
-
const groups = readGroups(value);
|
|
229
|
-
const emit = (next) => onChange(writeGroups(next));
|
|
230
|
-
const addCondition = (groupIndex) => {
|
|
231
|
-
const first = operands[0];
|
|
232
|
-
if (!first) return;
|
|
233
|
-
const row = {
|
|
234
|
-
field: first.name,
|
|
235
|
-
operator: firstOperatorFor(first.conditionType),
|
|
236
|
-
value: void 0
|
|
237
|
-
};
|
|
238
|
-
emit(groups.length === 0 ? [[row]] : groups.map((group, index) => index === groupIndex ? [...group, row] : group));
|
|
239
|
-
};
|
|
240
|
-
const addOrGroup = () => {
|
|
241
|
-
const first = operands[0];
|
|
242
|
-
if (!first) return;
|
|
243
|
-
emit([...groups, [{
|
|
244
|
-
field: first.name,
|
|
245
|
-
operator: firstOperatorFor(first.conditionType),
|
|
246
|
-
value: void 0
|
|
247
|
-
}]]);
|
|
248
|
-
};
|
|
249
|
-
const updateRow = (groupIndex, rowIndex, row) => emit(groups.map((group, index) => index === groupIndex ? group.map((existing, position) => position === rowIndex ? row : existing) : group));
|
|
250
|
-
const removeRow = (groupIndex, rowIndex) => emit(groups.map((group, index) => index === groupIndex ? group.filter((_, position) => position !== rowIndex) : group).filter((group) => group.length > 0));
|
|
251
|
-
if (operands.length === 0) return /* @__PURE__ */ jsx("p", {
|
|
252
|
-
className: "form-builder-condition__hint",
|
|
253
|
-
children: t(keys.conditionNoFields)
|
|
254
|
-
});
|
|
255
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
256
|
-
className: "form-builder-condition",
|
|
257
|
-
children: [groups.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
258
|
-
className: "form-builder-condition__hint",
|
|
259
|
-
children: t(keys.conditionEmpty)
|
|
260
|
-
}) : groups.map((group, groupIndex) => /* @__PURE__ */ jsxs("div", {
|
|
261
|
-
className: "form-builder-condition__group",
|
|
262
|
-
children: [
|
|
263
|
-
groupIndex > 0 ? /* @__PURE__ */ jsx("div", {
|
|
264
|
-
className: "form-builder-condition__or",
|
|
265
|
-
children: t(keys.conditionOr)
|
|
266
|
-
}) : null,
|
|
267
|
-
group.map((row, rowIndex) => /* @__PURE__ */ jsxs("div", {
|
|
268
|
-
className: "form-builder-condition__and",
|
|
269
|
-
children: [rowIndex > 0 ? /* @__PURE__ */ jsx("span", { children: t(keys.conditionAnd) }) : null, /* @__PURE__ */ jsx(ConditionRow, {
|
|
270
|
-
condition: row,
|
|
271
|
-
operands,
|
|
272
|
-
onChange: (next) => updateRow(groupIndex, rowIndex, next),
|
|
273
|
-
onRemove: () => removeRow(groupIndex, rowIndex)
|
|
274
|
-
})]
|
|
275
|
-
}, rowIndex)),
|
|
276
|
-
/* @__PURE__ */ jsx("button", {
|
|
277
|
-
type: "button",
|
|
278
|
-
onClick: () => addCondition(groupIndex),
|
|
279
|
-
children: t(keys.conditionAddCondition)
|
|
280
|
-
})
|
|
281
|
-
]
|
|
282
|
-
}, groupIndex)), /* @__PURE__ */ jsx("div", {
|
|
283
|
-
className: "form-builder-condition__actions",
|
|
284
|
-
children: /* @__PURE__ */ jsx("button", {
|
|
285
|
-
type: "button",
|
|
286
|
-
onClick: () => groups.length === 0 ? addCondition(0) : addOrGroup(),
|
|
287
|
-
children: groups.length === 0 ? t(keys.conditionAddCondition) : t(keys.conditionAddOr)
|
|
288
|
-
})
|
|
289
|
-
})]
|
|
290
|
-
});
|
|
291
|
-
};
|
|
292
|
-
//#endregion
|
|
293
|
-
//#region src/client/FormConditionField.tsx
|
|
294
|
-
const toStaticLabel = (label) => {
|
|
295
|
-
if (typeof label === "string") return label;
|
|
296
|
-
if (label && typeof label === "object") return label;
|
|
297
|
-
};
|
|
298
|
-
/**
|
|
299
|
-
* The `Field` mounted on a form field's `visibleWhen`/`validateWhen` json column. Binds the field's own
|
|
300
|
-
* path with `useField<Where>()` (the QueryPresetsWhereField precedent) and renders the native builder.
|
|
301
|
-
*/
|
|
302
|
-
const FormConditionField = (props) => {
|
|
303
|
-
const { path, setValue, value } = useField();
|
|
304
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
305
|
-
className: "field-type form-builder-condition-field",
|
|
306
|
-
children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
307
|
-
label: toStaticLabel(props.field?.label ?? props.label),
|
|
308
|
-
path
|
|
309
|
-
}), /* @__PURE__ */ jsx(ConditionBuilder, {
|
|
310
|
-
value: value ?? void 0,
|
|
311
|
-
onChange: setValue,
|
|
312
|
-
conditionTypes: props.conditionTypes,
|
|
313
|
-
selfName: props.field?.name
|
|
314
|
-
})]
|
|
315
|
-
});
|
|
316
|
-
};
|
|
317
|
-
//#endregion
|
|
318
|
-
export { FormConditionField };
|
|
319
|
-
|
|
320
|
-
//# sourceMappingURL=client.js.map
|
|
2
|
+
import { FlowBuilder } from "../client/FlowBuilder.js";
|
|
3
|
+
import { FormConditionField } from "../client/FormConditionField.js";
|
|
4
|
+
export { FlowBuilder, FormConditionField };
|
package/dist/exports/i18n.d.ts
CHANGED
|
@@ -1,138 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* literals (enforced by requireI18nKeysTyped.grit). Every key here must have a
|
|
5
|
-
* value in every locale (`en.ts`), or it is a type error.
|
|
6
|
-
*/
|
|
7
|
-
declare const keys: {
|
|
8
|
-
readonly pluginName: "formBuilder:pluginName";
|
|
9
|
-
readonly fieldTitle: "formBuilder:fieldTitle";
|
|
10
|
-
readonly fieldTypeText: "formBuilder:fieldType.text";
|
|
11
|
-
readonly fieldTypeTextarea: "formBuilder:fieldType.textarea";
|
|
12
|
-
readonly fieldTypeEmail: "formBuilder:fieldType.email";
|
|
13
|
-
readonly fieldTypeNumber: "formBuilder:fieldType.number";
|
|
14
|
-
readonly fieldTypeSelect: "formBuilder:fieldType.select";
|
|
15
|
-
readonly fieldTypeCheckbox: "formBuilder:fieldType.checkbox";
|
|
16
|
-
readonly configOptions: "formBuilder:config.options";
|
|
17
|
-
readonly configOption: "formBuilder:config.option";
|
|
18
|
-
readonly configOptionLabel: "formBuilder:config.optionLabel";
|
|
19
|
-
readonly configOptionValue: "formBuilder:config.optionValue";
|
|
20
|
-
readonly validationRequired: "formBuilder:validation.required";
|
|
21
|
-
readonly validationEmail: "formBuilder:validation.email";
|
|
22
|
-
readonly validationNumber: "formBuilder:validation.number";
|
|
23
|
-
readonly validationSelect: "formBuilder:validation.select";
|
|
24
|
-
readonly formatYes: "formBuilder:format.yes";
|
|
25
|
-
readonly formatNo: "formBuilder:format.no";
|
|
26
|
-
readonly configName: "formBuilder:config.name";
|
|
27
|
-
readonly configLabel: "formBuilder:config.label";
|
|
28
|
-
readonly configRequired: "formBuilder:config.required";
|
|
29
|
-
readonly configWidth: "formBuilder:config.width";
|
|
30
|
-
readonly configPlaceholder: "formBuilder:config.placeholder";
|
|
31
|
-
readonly configDescription: "formBuilder:config.description";
|
|
32
|
-
readonly configVisibleWhen: "formBuilder:config.visibleWhen";
|
|
33
|
-
readonly configValidateWhen: "formBuilder:config.validateWhen";
|
|
34
|
-
readonly submissionAnswers: "formBuilder:submission.answers";
|
|
35
|
-
readonly submissionNoAnswers: "formBuilder:submission.noAnswers";
|
|
36
|
-
readonly ruleMinLength: "formBuilder:rule.minLength.label";
|
|
37
|
-
readonly ruleMaxLength: "formBuilder:rule.maxLength.label";
|
|
38
|
-
readonly ruleMin: "formBuilder:rule.min.label";
|
|
39
|
-
readonly ruleMax: "formBuilder:rule.max.label";
|
|
40
|
-
readonly rulePattern: "formBuilder:rule.pattern.label";
|
|
41
|
-
readonly ruleEmail: "formBuilder:rule.email.label";
|
|
42
|
-
readonly ruleUrl: "formBuilder:rule.url.label";
|
|
43
|
-
readonly ruleOneOf: "formBuilder:rule.oneOf.label";
|
|
44
|
-
readonly ruleMatchesField: "formBuilder:rule.matchesField.label";
|
|
45
|
-
readonly ruleNotAlreadySubmitted: "formBuilder:rule.notAlreadySubmitted.label";
|
|
46
|
-
readonly ruleMinLengthMessage: "formBuilder:rule.minLength.message";
|
|
47
|
-
readonly ruleMaxLengthMessage: "formBuilder:rule.maxLength.message";
|
|
48
|
-
readonly ruleMinMessage: "formBuilder:rule.min.message";
|
|
49
|
-
readonly ruleMaxMessage: "formBuilder:rule.max.message";
|
|
50
|
-
readonly rulePatternMessage: "formBuilder:rule.pattern.message";
|
|
51
|
-
readonly ruleEmailMessage: "formBuilder:rule.email.message";
|
|
52
|
-
readonly ruleUrlMessage: "formBuilder:rule.url.message";
|
|
53
|
-
readonly ruleOneOfMessage: "formBuilder:rule.oneOf.message";
|
|
54
|
-
readonly ruleMatchesFieldMessage: "formBuilder:rule.matchesField.message";
|
|
55
|
-
readonly ruleNotAlreadySubmittedMessage: "formBuilder:rule.notAlreadySubmitted.message";
|
|
56
|
-
readonly ruleParamMin: "formBuilder:rule.param.min";
|
|
57
|
-
readonly ruleParamMax: "formBuilder:rule.param.max";
|
|
58
|
-
readonly ruleParamPattern: "formBuilder:rule.param.pattern";
|
|
59
|
-
readonly ruleParamFlags: "formBuilder:rule.param.flags";
|
|
60
|
-
readonly ruleParamValues: "formBuilder:rule.param.values";
|
|
61
|
-
readonly ruleParamField: "formBuilder:rule.param.field";
|
|
62
|
-
readonly validationsLabel: "formBuilder:validations.label";
|
|
63
|
-
readonly validationMessageLabel: "formBuilder:validations.message";
|
|
64
|
-
readonly validationSeverityLabel: "formBuilder:validations.severity";
|
|
65
|
-
readonly validationSeverityError: "formBuilder:validations.severity.error";
|
|
66
|
-
readonly validationSeverityWarning: "formBuilder:validations.severity.warning";
|
|
67
|
-
readonly conditionAddCondition: "formBuilder:condition.addCondition";
|
|
68
|
-
readonly conditionAddOr: "formBuilder:condition.addOr";
|
|
69
|
-
readonly conditionAnd: "formBuilder:condition.and";
|
|
70
|
-
readonly conditionOr: "formBuilder:condition.or";
|
|
71
|
-
readonly conditionRemove: "formBuilder:condition.remove";
|
|
72
|
-
readonly conditionNoFields: "formBuilder:condition.noFields";
|
|
73
|
-
readonly conditionEmpty: "formBuilder:condition.empty";
|
|
74
|
-
readonly conditionSelectField: "formBuilder:condition.selectField";
|
|
75
|
-
readonly conditionValuePlaceholder: "formBuilder:condition.value";
|
|
76
|
-
readonly conditionTrue: "formBuilder:condition.true";
|
|
77
|
-
readonly conditionFalse: "formBuilder:condition.false";
|
|
78
|
-
readonly configAdvanced: "formBuilder:config.advanced";
|
|
79
|
-
readonly configHidden: "formBuilder:config.hidden";
|
|
80
|
-
readonly fieldTypeCalculation: "formBuilder:fieldType.calculation";
|
|
81
|
-
readonly configExpression: "formBuilder:config.expression";
|
|
82
|
-
readonly configCalcDisplay: "formBuilder:config.calcDisplay";
|
|
83
|
-
readonly configDefaultPresentation: "formBuilder:config.defaultPresentation";
|
|
84
|
-
readonly presentationPage: "formBuilder:presentation.page";
|
|
85
|
-
readonly presentationModal: "formBuilder:presentation.modal";
|
|
86
|
-
readonly presentationDrawer: "formBuilder:presentation.drawer";
|
|
87
|
-
readonly presentationInline: "formBuilder:presentation.inline";
|
|
88
|
-
readonly actionEmailTeam: "formBuilder:action.emailTeam";
|
|
89
|
-
readonly actionConfirmation: "formBuilder:action.confirmation";
|
|
90
|
-
readonly actionSignedWebhook: "formBuilder:action.signedWebhook";
|
|
91
|
-
readonly actionConfigTo: "formBuilder:action.config.to";
|
|
92
|
-
readonly actionConfigSubject: "formBuilder:action.config.subject";
|
|
93
|
-
readonly actionConfigBody: "formBuilder:action.config.body";
|
|
94
|
-
readonly actionConfigToField: "formBuilder:action.config.toField";
|
|
95
|
-
readonly actionConfigUrl: "formBuilder:action.config.url";
|
|
96
|
-
readonly actionConfigSecret: "formBuilder:action.config.secret";
|
|
97
|
-
readonly configActions: "formBuilder:config.actions";
|
|
98
|
-
readonly consentSourceStatic: "formBuilder:consentSource.static";
|
|
99
|
-
readonly consentSourcePageReference: "formBuilder:consentSource.pageReference";
|
|
100
|
-
readonly consentConfigLabel: "formBuilder:consent.config.label";
|
|
101
|
-
readonly consentConfigUrl: "formBuilder:consent.config.url";
|
|
102
|
-
readonly consentConfigVersion: "formBuilder:consent.config.version";
|
|
103
|
-
readonly consentConfigRelationTo: "formBuilder:consent.config.relationTo";
|
|
104
|
-
readonly consentConfigDocId: "formBuilder:consent.config.docId";
|
|
105
|
-
readonly consentConfigUrlField: "formBuilder:consent.config.urlField";
|
|
106
|
-
readonly consentConfigCaptureVersion: "formBuilder:consent.config.captureVersion";
|
|
107
|
-
readonly fieldTypeConsent: "formBuilder:fieldType.consent";
|
|
108
|
-
readonly consentConfigStatement: "formBuilder:consent.config.statement";
|
|
109
|
-
readonly consentConfigSource: "formBuilder:consent.config.source";
|
|
110
|
-
readonly consentConfigSourceConfig: "formBuilder:consent.config.sourceConfig";
|
|
111
|
-
readonly consentConfigOptional: "formBuilder:consent.config.optional";
|
|
112
|
-
readonly resultsTitle: "formBuilder:results.title";
|
|
113
|
-
readonly resultsResponses: "formBuilder:results.responses";
|
|
114
|
-
readonly resultsNoResponses: "formBuilder:results.noResponses";
|
|
115
|
-
readonly resultsTruncated: "formBuilder:results.truncated";
|
|
116
|
-
readonly configShowResults: "formBuilder:config.showResults";
|
|
117
|
-
readonly configResultsField: "formBuilder:config.resultsField";
|
|
118
|
-
readonly validationFileMissing: "formBuilder:validation.file.missing";
|
|
119
|
-
readonly validationFileMimeType: "formBuilder:validation.file.mimeType";
|
|
120
|
-
readonly validationFileTooLarge: "formBuilder:validation.file.tooLarge";
|
|
121
|
-
readonly fieldTypeFile: "formBuilder:fieldType.file";
|
|
122
|
-
readonly fileConfigRelationTo: "formBuilder:file.config.relationTo";
|
|
123
|
-
readonly fileConfigMimeTypes: "formBuilder:file.config.mimeTypes";
|
|
124
|
-
readonly fileConfigMaxSize: "formBuilder:file.config.maxSize";
|
|
125
|
-
readonly spamRateLimited: "formBuilder:spam.rateLimited";
|
|
126
|
-
readonly spamRejected: "formBuilder:spam.rejected";
|
|
127
|
-
readonly spamCaptchaFailed: "formBuilder:spam.captchaFailed";
|
|
128
|
-
};
|
|
129
|
-
type TranslationKey = (typeof keys)[keyof typeof keys];
|
|
130
|
-
//#endregion
|
|
131
|
-
//#region src/translations/index.d.ts
|
|
132
|
-
/** Per-locale messages merged into `config.i18n.translations`. English only for now. */
|
|
133
|
-
declare const translations: {
|
|
134
|
-
en: Record<string, Record<string, string>>;
|
|
135
|
-
};
|
|
136
|
-
//#endregion
|
|
137
|
-
export { type TranslationKey as FormBuilderTranslationKeys, keys, translations };
|
|
138
|
-
//# sourceMappingURL=i18n.d.ts.map
|
|
1
|
+
import { TranslationKey, keys } from "../translations/keys.js";
|
|
2
|
+
import { TranslationsOption, translations } from "../translations/index.js";
|
|
3
|
+
export { type TranslationKey as FormBuilderTranslationKeys, type TranslationKey, type TranslationsOption, keys, translations };
|
package/dist/exports/i18n.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { keys } from "../translations/keys.js";
|
|
2
|
+
import { translations } from "../translations/index.js";
|
|
3
3
|
export { keys, translations };
|