@gmcode/forms 0.0.9 → 0.1.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/dist/{en-Bw2ceTNi.mjs → en-kNGdq3xk.mjs} +4 -1
- package/dist/en-kNGdq3xk.mjs.map +1 -0
- package/dist/index.d.mts +6 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +7 -6
- package/dist/index.mjs.map +1 -1
- package/dist/locales.d.mts +6 -0
- package/dist/locales.d.mts.map +1 -1
- package/dist/locales.mjs +4 -1
- package/dist/locales.mjs.map +1 -1
- package/package.json +10 -8
- package/dist/en-Bw2ceTNi.mjs.map +0 -1
|
@@ -4,6 +4,9 @@ var en_default = { translation: {
|
|
|
4
4
|
date: "The field must be a valid date",
|
|
5
5
|
decrease: "Decrease",
|
|
6
6
|
email: "The field must be a valid email address.",
|
|
7
|
+
hasMixed: "The field must contain at least one uppercase and one lowercase letter.",
|
|
8
|
+
hasNumber: "The field must contain at least one number.",
|
|
9
|
+
hasSymbol: "The field must contain at least one symbol.",
|
|
7
10
|
increase: "Increase",
|
|
8
11
|
integer: "The field must be an integer.",
|
|
9
12
|
maxChars: "The field must not be greater than {{max}} characters.",
|
|
@@ -21,4 +24,4 @@ var en_default = { translation: {
|
|
|
21
24
|
|
|
22
25
|
//#endregion
|
|
23
26
|
export { en_default as t };
|
|
24
|
-
//# sourceMappingURL=en-
|
|
27
|
+
//# sourceMappingURL=en-kNGdq3xk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en-kNGdq3xk.mjs","names":[],"sources":["../src/locales/en.ts"],"sourcesContent":["import type { Resource } from 'i18next'\n\nexport default {\n translation: {\n array: 'The field must be an array.',\n date: 'The field must be a valid date',\n decrease: 'Decrease',\n email: 'The field must be a valid email address.',\n hasMixed:\n 'The field must contain at least one uppercase and one lowercase letter.',\n hasNumber: 'The field must contain at least one number.',\n hasSymbol: 'The field must contain at least one symbol.',\n increase: 'Increase',\n integer: 'The field must be an integer.',\n maxChars: 'The field must not be greater than {{max}} characters.',\n maxValue: 'The field must not be greater than {{max}}.',\n minChars: 'The field must be at least {{min}} characters.',\n minValue: 'The field must be at least {{min}}.',\n missing: 'The value is not supported.',\n number: 'The field must be a number.',\n numeric: 'The field must be a number.',\n required: 'The field is required.',\n reset: 'Reset',\n string: 'The field must be a string.',\n submit: 'Submit'\n }\n} satisfies Resource\n"],"mappings":";AAEA,iBAAe,EACb,aAAa;CACX,OAAO;CACP,MAAM;CACN,UAAU;CACV,OAAO;CACP,UACE;CACF,WAAW;CACX,WAAW;CACX,UAAU;CACV,SAAS;CACT,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACV,SAAS;CACT,QAAQ;CACR,SAAS;CACT,UAAU;CACV,OAAO;CACP,QAAQ;CACR,QAAQ;AACV,EACF"}
|
package/dist/index.d.mts
CHANGED
|
@@ -2,8 +2,8 @@ import { i18n as i18n$1 } from "i18next";
|
|
|
2
2
|
import { Button, Field, FieldSet } from "@gmcode/react-ui";
|
|
3
3
|
import { Control, ControllerRenderProps, DefaultValues, FieldPath, FieldValues, FieldValues as FieldValues$1, UseFormReturn, UseFormSetValue } from "react-hook-form";
|
|
4
4
|
import { InferSchema, InferSchema as InferSchema$1, useTsvResolver } from "@gmcode/tsv-hookform";
|
|
5
|
-
import { ComponentProps, FC, HTMLInputAutoCompleteAttribute, HTMLInputTypeAttribute, ReactNode, SVGProps } from "react";
|
|
6
|
-
import { InputCheckboxRule, InputColorRule, InputEmailRule, InputNumberRule, InputRule, InputSelectRule, InputTextRule, Message, MessageParams, MessageParams as MessageParams$1, Ruleset, Ruleset as Ruleset$1, Sanitized, SanitizedValues, Schema, SchemaOptions, SchemaRule, SchemaValues } from "@gmcode/tsv-input";
|
|
5
|
+
import { ChangeEventHandler, ComponentProps, FC, HTMLInputAutoCompleteAttribute, HTMLInputTypeAttribute, ReactNode, SVGProps } from "react";
|
|
6
|
+
import { InputCheckboxRule, InputColorRule, InputEmailRule, InputNumberRule, InputPasswordRule, InputRule, InputSelectRule, InputTextRule, Message, MessageParams, MessageParams as MessageParams$1, Ruleset, Ruleset as Ruleset$1, Sanitized, SanitizedValues, Schema, SchemaOptions, SchemaRule, SchemaValues } from "@gmcode/tsv-input";
|
|
7
7
|
import { DayPickerLocale, Matcher } from "react-day-picker";
|
|
8
8
|
import { Checkbox as Checkbox$1 } from "radix-ui";
|
|
9
9
|
import { CancelTokenCallback, FormDataErrors, GlobalEventCallback, RequestPayload } from "@inertiajs/core";
|
|
@@ -57,13 +57,14 @@ declare function CheckboxField<TFieldValues extends FieldValues$1 = FieldValues$
|
|
|
57
57
|
}): import("react").JSX.Element;
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region src/components/input-field.d.ts
|
|
60
|
-
declare function InputField<TFieldValues extends FieldValues$1 = FieldValues$1>({ autoComplete, control, disabled, inputId, inputName, label, placeholder, readOnly, type, ...props }: ComponentProps<typeof Field> & {
|
|
60
|
+
declare function InputField<TFieldValues extends FieldValues$1 = FieldValues$1>({ autoComplete, control, disabled, inputId, inputName, label, placeholder, readOnly, type, ...props }: Omit<ComponentProps<typeof Field>, 'onChange'> & {
|
|
61
61
|
autoComplete?: HTMLInputAutoCompleteAttribute;
|
|
62
62
|
control: Control<TFieldValues>;
|
|
63
63
|
disabled?: boolean;
|
|
64
64
|
inputId?: string;
|
|
65
65
|
inputName: FieldPath<TFieldValues>;
|
|
66
66
|
label?: string;
|
|
67
|
+
onChange?: ChangeEventHandler<HTMLDivElement, HTMLInputElement>;
|
|
67
68
|
placeholder?: string;
|
|
68
69
|
readOnly?: boolean;
|
|
69
70
|
type?: HTMLInputTypeAttribute;
|
|
@@ -97,9 +98,8 @@ type RenderFN<TValues extends FieldValues$1> = ({ errors, form, loading }: {
|
|
|
97
98
|
form: UseFormReturn<TValues>;
|
|
98
99
|
loading: boolean;
|
|
99
100
|
}) => ReactNode;
|
|
100
|
-
declare function Form<TRuleset extends Ruleset$1, TSchema extends Schema<TRuleset>, TValues extends InferSchema$1<TSchema>>({ children, className, defaults, onBefore, onBeforeUpdate, onCancel, onCancelToken, onError, onFinish, onFlash, onPrefetched, onPrefetching, onProgress, onStart, onSuccess, preserveScroll, resetOnSuccess, rootError: displayRootError, route, schema, setDefaultsOnSuccess }: {
|
|
101
|
+
declare function Form<TRuleset extends Ruleset$1, TSchema extends Schema<TRuleset>, TValues extends InferSchema$1<TSchema>>({ children, className, defaults, onBefore, onBeforeUpdate, onCancel, onCancelToken, onError, onFinish, onFlash, onPrefetched, onPrefetching, onProgress, onStart, onSuccess, preserveScroll, resetOnSuccess, rootError: displayRootError, route, schema, setDefaultsOnSuccess, ...props }: Omit<ComponentProps<'form'>, 'action' | 'children' | 'method' | 'onSubmit'> & {
|
|
101
102
|
children: RenderFN<TValues>;
|
|
102
|
-
className?: string;
|
|
103
103
|
defaults?: Partial<DefaultValues<TValues>>;
|
|
104
104
|
onBefore?: GlobalEventCallback<'before', RequestPayload>;
|
|
105
105
|
onBeforeUpdate?: GlobalEventCallback<'beforeUpdate', RequestPayload>;
|
|
@@ -244,5 +244,5 @@ declare function TextareaField<TFieldValues extends FieldValues$1 = FieldValues$
|
|
|
244
244
|
resize?: 'both' | 'none' | 'x' | 'y';
|
|
245
245
|
}): import("react").JSX.Element;
|
|
246
246
|
//#endregion
|
|
247
|
-
export { CalendarField, CheckboxField, EmailField, type ErrorData, ErrorMonitor, FancyRadioField, type FieldValues, Form, HiddenField, type InferSchema, InfoCheckboxField, InputCheckboxRule, InputColorRule, InputEmailRule, InputField, InputNumberRule, InputRule, InputSelectRule, InputTextRule, Message, type MessageParams, type Method, NullableSelectField, NumericField, type Option, PasswordField, type RouteDefinition, type Ruleset, type Sanitized, type SanitizedValues, Schema, type SchemaOptions, type SchemaRule, type SchemaValues, SelectField, Submit, SwitchField, TextField, TextareaField, i18n, useTsvResolver };
|
|
247
|
+
export { CalendarField, CheckboxField, EmailField, type ErrorData, ErrorMonitor, FancyRadioField, type FieldValues, Form, HiddenField, type InferSchema, InfoCheckboxField, InputCheckboxRule, InputColorRule, InputEmailRule, InputField, InputNumberRule, InputPasswordRule, InputRule, InputSelectRule, InputTextRule, Message, type MessageParams, type Method, NullableSelectField, NumericField, type Option, PasswordField, type RouteDefinition, type Ruleset, type Sanitized, type SanitizedValues, Schema, type SchemaOptions, type SchemaRule, type SchemaValues, SelectField, Submit, SwitchField, TextField, TextareaField, i18n, useTsvResolver };
|
|
248
248
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/i18n.ts","../src/types/index.d.ts","../src/components/calendar-field.tsx","../src/components/checkbox-field.tsx","../src/components/input-field.tsx","../src/components/email-field.tsx","../src/components/error-monitor.tsx","../src/components/fancy-radio-field.tsx","../src/components/form.tsx","../src/components/hidden-field.tsx","../src/components/info-checkbox-field.tsx","../src/components/nullable-select-field.tsx","../src/components/numeric-field.tsx","../src/components/password-field.tsx","../src/components/select-field.tsx","../src/components/submit.tsx","../src/components/switch-field.tsx","../src/components/text-field.tsx","../src/components/textarea-field.tsx"],"mappings":";;;;;;;;;;;cAGM,MAAM;;;KCAA;KAEA,gBAAgB,gBAAgB,SAAS;EACnD;KACG,gBAAgB;EAAa,SAAS;;EAAc,QAAQ;;UAEhD;EACf;EACA;EACA,OAAO;EACP;;UAGe;EACf;EACA,SAAS;;;;iBCPK,cAAc,qBAAqB,gBAAc,iBAC/D,SACA,cACA,UACA,SACA,WACA,OACA,QACA,iBACG,SACF,sBAAsB;EACvB,SAAS,QAAQ;EACjB,gBAAgB,MAAM;EACtB,WAAW,UAAU;EACrB;EACA,WAAW,UAAU;EACrB;EACA,SAAS,QAAQ;EACjB,gBAAgB,+BAA+B;oBAChD,IAAA;;;iBCvBe,cAAc,qBAAqB,gBAAc,iBAC/D,SACA,UACA,SACA,WACA,OACA,iBACA,aACA,UACA,gBACA,UACG,SACF,sBAAsB;EACvB,SAAS,QAAQ;EACjB;EACA;EACA,WAAW,UAAU;EACrB;EACA,mBACE,SAAS,WAAkB,cAC3B,OAAO,sBAAsB,cAAc,UAAU;EAEvD;EACA;EACA;oBACD,IAAA;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/i18n.ts","../src/types/index.d.ts","../src/components/calendar-field.tsx","../src/components/checkbox-field.tsx","../src/components/input-field.tsx","../src/components/email-field.tsx","../src/components/error-monitor.tsx","../src/components/fancy-radio-field.tsx","../src/components/form.tsx","../src/components/hidden-field.tsx","../src/components/info-checkbox-field.tsx","../src/components/nullable-select-field.tsx","../src/components/numeric-field.tsx","../src/components/password-field.tsx","../src/components/select-field.tsx","../src/components/submit.tsx","../src/components/switch-field.tsx","../src/components/text-field.tsx","../src/components/textarea-field.tsx"],"mappings":";;;;;;;;;;;cAGM,MAAM;;;KCAA;KAEA,gBAAgB,gBAAgB,SAAS;EACnD;KACG,gBAAgB;EAAa,SAAS;;EAAc,QAAQ;;UAEhD;EACf;EACA;EACA,OAAO;EACP;;UAGe;EACf;EACA,SAAS;;;;iBCPK,cAAc,qBAAqB,gBAAc,iBAC/D,SACA,cACA,UACA,SACA,WACA,OACA,QACA,iBACG,SACF,sBAAsB;EACvB,SAAS,QAAQ;EACjB,gBAAgB,MAAM;EACtB,WAAW,UAAU;EACrB;EACA,WAAW,UAAU;EACrB;EACA,SAAS,QAAQ;EACjB,gBAAgB,+BAA+B;oBAChD,IAAA;;;iBCvBe,cAAc,qBAAqB,gBAAc,iBAC/D,SACA,UACA,SACA,WACA,OACA,iBACA,aACA,UACA,gBACA,UACG,SACF,sBAAsB;EACvB,SAAS,QAAQ;EACjB;EACA;EACA,WAAW,UAAU;EACrB;EACA,mBACE,SAAS,WAAkB,cAC3B,OAAO,sBAAsB,cAAc,UAAU;EAEvD;EACA;EACA;oBACD,IAAA;;;iBCrBe,WAAW,qBAAqB,gBAAc,iBAC5D,cACA,SACA,UACA,SACA,WAC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sB,WAAW,iCAAc,IAAA;;;iBCHlC,kBACd,qBAAqB,gBAAc,iBAEnC,UACA,WACA,SACA,UACA,SACA,WACA,OACA,iBACA,aACA,UACA,MACA,gBACA,UACG,SACF,sBAAsB;EACvB,SAAS,QAAQ;EACjB;EACA;EACA,WAAW,UAAU;EACrB;EACA,mBACE,SAAS,WAAkB,cAC3B,OAAO,sBAAsB,cAAc,UAAU;EAEvD;EACA;EACA;EACA;oBACD,IAAA;;;iBCXe,oBACd,qBAAqB,gBAAc,iBAEnC,cACA,SACA,aACA,UACA,SACA,WACA,OACA,SACA,aACA,aACG,SACF,sBAAsB;EACvB,eAAe;EACf,SAAS,QAAQ;EACjB;EACA;EACA;EACA,WAAW,UAAU;EACrB;EACA,SAAS;EACT;EACA,UAAU,gBAAgB;EAC1B,OAAO;oBACR,IAAA;;;iBCAe,aAAa,qBAAqB,gBAAc,iBAC9D,cACA,SACA,UACA,SACA,WACA,WACA,OACA,aACA,MACA,OACG,SACF,sBAAsB;EACvB,eAAe;EACf,SAAS,QAAQ;EACjB;EACA;EACA;EACA,WAAW,UAAU;EACrB;EACA;EACA,OAAO;EACP;IACE;IACA;IACA,UAAU,gBAAgB;IAC1B;;oBAEH,IAAA;;;iBC7Ee,cAAc,qBAAqB,gBAAc,iBAC/D,cACA,SACG,SACF,sBAAsB,WAAW,iCAAc,IAAA;;;iBCYlC,YAAY,qBAAqB,gBAAc,iBAC7D,cACA,SACA,aACA,UACA,SACA,WACA,OACA,SACA,gBACG,SACF,sBAAsB;EACvB,eAAe;EACf,SAAS,QAAQ;EACjB;EACA;EACA;EACA,WAAW,UAAU;EACrB;EACA,SAAS;EACT;EACA,OAAO;oBACR,IAAA;;;iBCtCe,SACd,OACA,SACA,SACG,SACF,sBAAsB;EACvB;EACA;oBACD,IAAA;;;iBCLe,YAAY,qBAAqB,gBAAc,iBAC7D,SACA,UACA,SACA,WACA,OACA,iBACA,aACA,UACA,gBACA,UACG,SACF,sBAAsB;EACvB,SAAS,QAAQ;EACjB;EACA;EACA,WAAW,UAAU;EACrB;EACA,mBACE,SAAS,WAAkB,cAC3B,OAAO,sBAAsB,cAAc,UAAU;EAEvD;EACA;EACA;oBACD,IAAA;;;iBC5Be,UAAU,qBAAqB,gBAAc,iBAC3D,cACA,SACG,SACF,sBAAsB,WAAW,iCAAc,IAAA;;;iBCDlC,cAAc,qBAAqB,gBAAc,iBAC/D,mBACA,SACA,SACA,WACA,OACA,SACA,SACA,gBACA,aACA,WACG,SACF,sBAAsB;EACvB;EACA,SAAS,QAAQ;EACjB;EACA,WAAW,UAAU;EACrB;EACA;EACA;EACA,kBAAkB,gBAAgB,MAAM;EACxC;EACA;oBACD,IAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as en_default } from "./en-
|
|
1
|
+
import { t as en_default } from "./en-kNGdq3xk.mjs";
|
|
2
2
|
import { createInstance } from "i18next";
|
|
3
3
|
import { Button, Calendar, Checkbox, Field, FieldDescription, FieldError, FieldLabel, FieldSet, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, Label, RadioGroup, RadioGroupItem, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Spinner, Switch, TextareaAutosize, cn, flash } from "@gmcode/react-ui";
|
|
4
4
|
import { Controller, useForm } from "react-hook-form";
|
|
@@ -9,7 +9,7 @@ import { useTsvResolver, useTsvResolver as useTsvResolver$1 } from "@gmcode/tsv-
|
|
|
9
9
|
import { useForm as useForm$1 } from "@inertiajs/react";
|
|
10
10
|
import { useEffect, useState } from "react";
|
|
11
11
|
import { Minus, Plus, X } from "lucide-react";
|
|
12
|
-
import { InputCheckboxRule, InputColorRule, InputEmailRule, InputNumberRule, InputRule, InputSelectRule, InputTextRule, Message, Schema } from "@gmcode/tsv-input";
|
|
12
|
+
import { InputCheckboxRule, InputColorRule, InputEmailRule, InputNumberRule, InputPasswordRule, InputRule, InputSelectRule, InputTextRule, Message, Schema } from "@gmcode/tsv-input";
|
|
13
13
|
|
|
14
14
|
//#region src/i18n.ts
|
|
15
15
|
const i18n = createInstance({
|
|
@@ -150,9 +150,9 @@ function CheckboxField({ control, disabled, inputId, inputName, label, onChecked
|
|
|
150
150
|
//#region src/components/input-field.tsx
|
|
151
151
|
function InputField(t0) {
|
|
152
152
|
const $ = c(26);
|
|
153
|
-
if ($[0] !== "
|
|
153
|
+
if ($[0] !== "963cedd0a6cfacf8200253d589709508da00dc8c89d35cc10c99714d44b78c30") {
|
|
154
154
|
for (let $i = 0; $i < 26; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
155
|
-
$[0] = "
|
|
155
|
+
$[0] = "963cedd0a6cfacf8200253d589709508da00dc8c89d35cc10c99714d44b78c30";
|
|
156
156
|
}
|
|
157
157
|
let autoComplete;
|
|
158
158
|
let control;
|
|
@@ -364,7 +364,7 @@ function _temp$2(option) {
|
|
|
364
364
|
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region src/components/form.tsx
|
|
367
|
-
function Form({ children, className, defaults = {}, onBefore, onBeforeUpdate, onCancel, onCancelToken, onError, onFinish, onFlash, onPrefetched, onPrefetching, onProgress, onStart, onSuccess, preserveScroll = true, resetOnSuccess = true, rootError: displayRootError = "flash", route, schema, setDefaultsOnSuccess = false }) {
|
|
367
|
+
function Form({ children, className, defaults = {}, onBefore, onBeforeUpdate, onCancel, onCancelToken, onError, onFinish, onFlash, onPrefetched, onPrefetching, onProgress, onStart, onSuccess, preserveScroll = true, resetOnSuccess = true, rootError: displayRootError = "flash", route, schema, setDefaultsOnSuccess = false, ...props }) {
|
|
368
368
|
const [rootError, setRootError] = useState();
|
|
369
369
|
const defaultValues = Object.fromEntries(Object.keys(schema.ruleset).map((field) => [field, defaults[field] ?? ""]));
|
|
370
370
|
const reactForm = useForm({
|
|
@@ -424,6 +424,7 @@ function Form({ children, className, defaults = {}, onBefore, onBeforeUpdate, on
|
|
|
424
424
|
className: cn("grid gap-6", className),
|
|
425
425
|
method: route.method,
|
|
426
426
|
onSubmit: reactForm.handleSubmit(onSubmit),
|
|
427
|
+
...props,
|
|
427
428
|
children: [/* @__PURE__ */ jsx(Fragment, { children: children({
|
|
428
429
|
errors: inertiaForm.errors,
|
|
429
430
|
form: reactForm,
|
|
@@ -901,5 +902,5 @@ function TextareaField({ cacheMeasurements, control, inputId, inputName, label,
|
|
|
901
902
|
}
|
|
902
903
|
|
|
903
904
|
//#endregion
|
|
904
|
-
export { CalendarField, CheckboxField, EmailField, ErrorMonitor, FancyRadioField, Form, HiddenField, InfoCheckboxField, InputCheckboxRule, InputColorRule, InputEmailRule, InputField, InputNumberRule, InputRule, InputSelectRule, InputTextRule, Message, NullableSelectField, NumericField, PasswordField, Schema, SelectField, Submit, SwitchField, TextField, TextareaField, i18n, useTsvResolver };
|
|
905
|
+
export { CalendarField, CheckboxField, EmailField, ErrorMonitor, FancyRadioField, Form, HiddenField, InfoCheckboxField, InputCheckboxRule, InputColorRule, InputEmailRule, InputField, InputNumberRule, InputPasswordRule, InputRule, InputSelectRule, InputTextRule, Message, NullableSelectField, NumericField, PasswordField, Schema, SelectField, Submit, SwitchField, TextField, TextareaField, i18n, useTsvResolver };
|
|
905
906
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["error","label","autoComplete","placeholder","readOnly","type","control","disabled","inputName","label","description","defaultValue","control","disabled","inputName","label","autoComplete","placeholder","description","control","disabled","inputName","$","label","autoComplete","placeholder","description","control","disabled","inputName"],"sources":["../src/i18n.ts","../src/components/error-monitor.tsx","../src/lib/utils.ts","../src/components/calendar-field.tsx","../src/components/checkbox-field.tsx","../src/components/input-field.tsx","../src/components/email-field.tsx","../src/components/fancy-radio-field.tsx","../src/components/form.tsx","../src/components/hidden-field.tsx","../src/components/info-checkbox-field.tsx","../src/components/nullable-select-field.tsx","../src/components/numeric-field.tsx","../src/components/password-field.tsx","../src/components/select-field.tsx","../src/components/submit.tsx","../src/components/switch-field.tsx","../src/components/text-field.tsx","../src/components/textarea-field.tsx"],"sourcesContent":["import { type i18n as Ti18n, createInstance } from 'i18next'\nimport en from '@/locales/en'\n\nconst i18n: Ti18n = createInstance({\n fallbackLng: 'en',\n interpolation: { escapeValue: false },\n resources: { en }\n})\n\nvoid i18n.init()\n\nexport default i18n\n","import { FieldError } from '@gmcode/react-ui'\nimport { useTranslation } from 'react-i18next'\nimport type { ErrorData } from '@/types'\n\nexport function ErrorMonitor({ error }: { error?: ErrorData }) {\n // i18n\n const { t } = useTranslation()\n\n if (!error?.message) {\n return null\n }\n\n if (t.name === 'notReadyT') {\n return <FieldError errors={error} />\n }\n\n // @ts-expect-error: assert error.message to be a translation key\n return <FieldError errors={{ message: t(error.message, error.params) }} />\n}\n","/**\n * Convert a javascript `Date` object to a string with the format `aaaa-mm-dd`.\n */\nexport function dateToString(date: Date): string {\n return `${date.getFullYear()}-${(date.getMonth() + 1 + '').padStart(2, '0')}-${(date.getDate() + '').padStart(2, '0')}`\n}\n\n/**\n * Convert a string to a javascript `Date` object or undefined if the string is\n * not a valid date.\n */\nexport function stringToDate(string: string | undefined): Date | undefined {\n if (!string) {\n return undefined\n }\n\n const date = new Date(string)\n\n if (isNaN(date.getFullYear())) {\n return undefined\n }\n\n return date\n}\n","import { Calendar, Field, FieldLabel } from '@gmcode/react-ui'\nimport type { ComponentProps } from 'react'\nimport type { DayPickerLocale, Matcher } from 'react-day-picker'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { FieldValues } from 'react-hook-form'\nimport { ErrorMonitor } from '@/components/error-monitor'\nimport {\n dateToString as defaultDateToString,\n stringToDate as defaultStringToDate\n} from '@/lib/utils'\n\nexport function CalendarField<TFieldValues extends FieldValues = FieldValues>({\n control,\n dateToString = defaultDateToString,\n disabled,\n inputId,\n inputName,\n label,\n locale,\n stringToDate = defaultStringToDate,\n ...props\n}: ComponentProps<typeof Field> & {\n control: Control<TFieldValues>\n dateToString?: (date: Date) => string\n disabled?: Matcher | Matcher[]\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n locale?: Partial<DayPickerLocale>\n stringToDate?: (string: string | undefined) => Date | undefined\n}) {\n return (\n <Controller\n control={control}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n {...props}\n >\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <Calendar\n aria-invalid={fieldState.invalid}\n className=\"w-full rounded-md border\"\n disabled={disabled}\n fixedWeeks={true}\n id={inputId ?? (label ? inputName : undefined)}\n locale={locale}\n mode=\"single\"\n onSelect={(date) => field.onChange(date ? dateToString(date) : '')}\n selected={stringToDate(field.value)}\n />\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n","import { Checkbox, Field, FieldLabel } from '@gmcode/react-ui'\nimport type { Checkbox as CheckboxPrimitive } from 'radix-ui'\nimport type { ComponentProps } from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { ControllerRenderProps, FieldValues } from 'react-hook-form'\nimport { ErrorMonitor } from '@/components/error-monitor'\n\nexport function CheckboxField<TFieldValues extends FieldValues = FieldValues>({\n control,\n disabled,\n inputId,\n inputName,\n label,\n onCheckedChange,\n orientation = 'horizontal',\n readOnly,\n uncheckedValue = '',\n value = 'true',\n ...props\n}: ComponentProps<typeof Field> & {\n control: Control<TFieldValues>\n disabled?: boolean\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n onCheckedChange?: (\n checked: CheckboxPrimitive.CheckedState,\n field: ControllerRenderProps<TFieldValues, FieldPath<TFieldValues>>\n ) => void\n readOnly?: boolean\n uncheckedValue?: string\n value?: string\n}) {\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n orientation={orientation}\n {...props}\n >\n <Checkbox\n aria-invalid={fieldState.invalid}\n aria-readonly={readOnly}\n checked={field.value === value}\n className=\"aria-readonly:opacity-50\"\n disabled={field.disabled}\n id={inputId ?? (label ? inputName : undefined)}\n name={field.name}\n onBlur={field.onBlur}\n onCheckedChange={(checked) => {\n if (!readOnly) {\n field.onChange(checked === true ? value : uncheckedValue)\n if (onCheckedChange) onCheckedChange(checked, field)\n }\n }}\n ref={field.ref}\n value={value}\n />\n\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n","import { Field, FieldLabel, Input } from '@gmcode/react-ui'\nimport type {\n ComponentProps,\n HTMLInputAutoCompleteAttribute,\n HTMLInputTypeAttribute\n} from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { FieldValues } from 'react-hook-form'\nimport { ErrorMonitor } from '@/components/error-monitor'\n\nexport function InputField<TFieldValues extends FieldValues = FieldValues>({\n autoComplete,\n control,\n disabled,\n inputId,\n inputName,\n label,\n placeholder,\n readOnly,\n type,\n ...props\n}: ComponentProps<typeof Field> & {\n autoComplete?: HTMLInputAutoCompleteAttribute\n control: Control<TFieldValues>\n disabled?: boolean\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n placeholder?: string\n readOnly?: boolean\n type?: HTMLInputTypeAttribute\n}) {\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n {...props}\n >\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <Input\n aria-invalid={fieldState.invalid}\n autoComplete={autoComplete}\n id={inputId ?? (label ? inputName : undefined)}\n placeholder={placeholder}\n readOnly={readOnly}\n type={type}\n {...field}\n />\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n","import type { ComponentProps } from 'react'\nimport type { FieldValues } from 'react-hook-form'\nimport { InputField } from '@/components/input-field'\n\nexport function EmailField<TFieldValues extends FieldValues = FieldValues>({\n autoComplete = 'on',\n type = 'email',\n ...props\n}: ComponentProps<typeof InputField<TFieldValues>>) {\n return (\n <InputField\n autoComplete={autoComplete}\n type={type}\n {...props}\n />\n )\n}\n","import {\n FieldDescription,\n FieldLabel,\n FieldSet,\n Label,\n RadioGroup,\n RadioGroupItem\n} from '@gmcode/react-ui'\nimport type { ComponentProps, FC, SVGProps } from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { FieldValues } from 'react-hook-form'\nimport { ErrorMonitor } from '@/components/error-monitor'\nimport type { Option } from '@/types'\n\nexport function FancyRadioField<\n TFieldValues extends FieldValues = FieldValues\n>({\n control,\n defaultValue,\n description,\n disabled,\n groupId,\n inputName,\n label,\n options,\n ...props\n}: ComponentProps<typeof FieldSet> & {\n control: Control<TFieldValues>\n defaultValue: string\n description?: string\n disabled?: boolean\n groupId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n options: Array<Option & { Icon?: FC<SVGProps<SVGSVGElement>> }>\n}) {\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <FieldSet\n data-invalid={fieldState.invalid}\n {...props}\n >\n {label && (\n <FieldLabel htmlFor={groupId ?? inputName}>{label}</FieldLabel>\n )}\n\n {description && <FieldDescription>{description}</FieldDescription>}\n\n <ErrorMonitor error={fieldState.error} />\n\n <RadioGroup\n defaultValue={defaultValue}\n disabled={field.disabled}\n id={groupId ?? (label ? inputName : undefined)}\n name={field.name}\n onBlur={field.onBlur}\n onValueChange={field.onChange}\n ref={field.ref}\n >\n {options.map((option) => (\n <Label\n className=\"rounded-md border ring-ring/50 transition-all hover:bg-accent/50 has-focus-visible:ring-[3px]\"\n data-slot=\"field-label\"\n key={option.key ?? option.id ?? option.value}\n >\n <div className=\"flex w-full items-center gap-3 rounded-md p-3 transition-all has-aria-checked:border-l-8 has-aria-checked:border-ring\">\n <RadioGroupItem\n className=\"sr-only\"\n id={option.id}\n value={option.value}\n />\n {option.Icon && <option.Icon />}\n {option.label}\n </div>\n </Label>\n ))}\n </RadioGroup>\n </FieldSet>\n )}\n />\n )\n}\n","import { cn, flash } from '@gmcode/react-ui'\nimport { type InferSchema, useTsvResolver } from '@gmcode/tsv-hookform'\nimport type { Ruleset } from '@gmcode/tsv-input'\nimport type {\n CancelTokenCallback,\n Errors,\n FormDataErrors,\n GlobalEventCallback,\n Page,\n RequestPayload,\n SharedPageProps\n} from '@inertiajs/core'\nimport { useForm as useInertiaForm } from '@inertiajs/react'\nimport { type ReactNode, useEffect, useState } from 'react'\nimport type {\n DefaultValues,\n FieldValues,\n Path,\n UseFormReturn\n} from 'react-hook-form'\nimport { useForm as userReactForm } from 'react-hook-form'\nimport { I18nextProvider } from 'react-i18next'\nimport { ErrorMonitor } from '@/components/error-monitor'\nimport i18n from '@/i18n'\nimport type { Schema } from '@/index'\nimport type { ErrorData, Method, RouteDefinition } from '@/types'\n\ntype RenderFN<TValues extends FieldValues> = ({\n errors,\n form,\n loading\n}: {\n errors: FormDataErrors<object>\n form: UseFormReturn<TValues>\n loading: boolean\n}) => ReactNode\n\nexport function Form<\n TRuleset extends Ruleset,\n TSchema extends Schema<TRuleset>,\n TValues extends InferSchema<TSchema>\n>({\n children,\n className,\n defaults = {},\n onBefore,\n onBeforeUpdate,\n onCancel,\n onCancelToken,\n onError,\n onFinish,\n onFlash,\n onPrefetched,\n onPrefetching,\n onProgress,\n onStart,\n onSuccess,\n preserveScroll = true,\n resetOnSuccess = true,\n rootError: displayRootError = 'flash',\n route,\n schema,\n setDefaultsOnSuccess = false\n}: {\n children: RenderFN<TValues>\n className?: string\n defaults?: Partial<DefaultValues<TValues>>\n onBefore?: GlobalEventCallback<'before', RequestPayload>\n onBeforeUpdate?: GlobalEventCallback<'beforeUpdate', RequestPayload>\n onCancel?: GlobalEventCallback<'cancel', RequestPayload>\n onCancelToken?: CancelTokenCallback\n onError?: GlobalEventCallback<'error', RequestPayload>\n onFinish?: GlobalEventCallback<'finish', RequestPayload>\n onFlash?: GlobalEventCallback<'flash', RequestPayload>\n onPrefetched?: GlobalEventCallback<'prefetched', RequestPayload>\n onPrefetching?: GlobalEventCallback<'prefetching', RequestPayload>\n onProgress?: GlobalEventCallback<'progress', RequestPayload>\n onStart?: GlobalEventCallback<'start', RequestPayload>\n onSuccess?: GlobalEventCallback<'success', RequestPayload>\n preserveScroll?: boolean\n /**\n * Reset input values to their defaults on success.\n *\n * @defaultValue `true`\n */\n resetOnSuccess?: boolean\n /**\n * How to display the root error from inertia.\n *\n * - `\"flash\"` - use the Toaster component\n * - `\"monitor\"` - use the ErrorMonitor component\n * - `\"none\"` - don't display the root error\n *\n * @defaultValue `\"flash\"`\n */\n rootError?: 'flash' | 'monitor' | 'none'\n route: RouteDefinition<Method>\n schema: Schema<TRuleset>\n /**\n * Set the submitted values as default values on success.\n *\n * @defaultValue `false`\n */\n setDefaultsOnSuccess?: boolean\n}) {\n const [rootError, setRootError] = useState<ErrorData>()\n\n const defaultValues = Object.fromEntries(\n Object.keys(schema.ruleset).map((field) => [field, defaults[field] ?? ''])\n ) as DefaultValues<TValues>\n\n // React Hook Form\n const reactForm = userReactForm<TValues>({\n defaultValues,\n resolver: useTsvResolver(schema)\n })\n\n // Inertia\n const inertiaForm = useInertiaForm<object>(defaultValues)\n\n function onErrorWithToast(errors: Errors) {\n if (errors.root) {\n if (displayRootError === 'flash') {\n flash({ level: 'error', title: errors.root })\n } else if (displayRootError === 'monitor') {\n setRootError({ message: errors.root })\n }\n }\n\n if (onError) {\n onError(errors)\n }\n }\n\n function onSuccessWithReset(page: Page<SharedPageProps>) {\n if (setDefaultsOnSuccess) {\n inertiaForm.setDefaults()\n reactForm.reset(reactForm.getValues())\n }\n\n if (resetOnSuccess) {\n inertiaForm.reset()\n reactForm.reset()\n }\n\n if (onSuccess) {\n onSuccess(page)\n }\n }\n\n // Submit handler\n function onSubmit(values: TValues) {\n inertiaForm.transform(() => values)\n inertiaForm[route.method](route.url, {\n onBefore,\n onBeforeUpdate,\n onCancel,\n onCancelToken,\n onError: onErrorWithToast,\n onFinish,\n onFlash,\n onPrefetched,\n onPrefetching,\n onProgress,\n onStart,\n onSuccess: onSuccessWithReset,\n preserveScroll\n })\n }\n\n // Add inertia (server) errors to react form.\n useEffect(() => {\n for (const [key, error] of Object.entries(inertiaForm.errors)) {\n if (error) {\n reactForm.setError(key as Path<TValues>, {\n message: error as string,\n type: 'inertia'\n })\n }\n }\n }, [inertiaForm.errors, reactForm])\n\n return (\n <I18nextProvider i18n={i18n}>\n <form\n action={route.url}\n className={cn('grid gap-6', className)}\n method={route.method}\n onSubmit={reactForm.handleSubmit(onSubmit)}\n >\n <>\n {children({\n errors: inertiaForm.errors,\n form: reactForm,\n loading: inertiaForm.processing\n })}\n </>\n\n {displayRootError === 'monitor' && <ErrorMonitor error={rootError} />}\n </form>\n </I18nextProvider>\n )\n}\n","import { cn } from '@gmcode/react-ui'\nimport type { ComponentProps } from 'react'\nimport type { FieldValues } from 'react-hook-form'\nimport { InputField } from '@/components/input-field'\n\nexport function HiddenField<TFieldValues extends FieldValues = FieldValues>({\n autoComplete = 'off',\n className,\n type = 'hidden',\n ...props\n}: ComponentProps<typeof InputField<TFieldValues>>) {\n return (\n <InputField\n autoComplete={autoComplete}\n className={cn('hidden', className)}\n type={type}\n {...props}\n />\n )\n}\n","import { Checkbox, Field, Label, cn } from '@gmcode/react-ui'\nimport type { Checkbox as CheckboxPrimitive } from 'radix-ui'\nimport type { ComponentProps } from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { ControllerRenderProps, FieldValues } from 'react-hook-form'\nimport { ErrorMonitor } from '@/components/error-monitor'\n\nexport function InfoCheckboxField<\n TFieldValues extends FieldValues = FieldValues\n>({\n children,\n className,\n control,\n disabled,\n inputId,\n inputName,\n label,\n onCheckedChange,\n orientation = 'horizontal',\n readOnly,\n text,\n uncheckedValue = '',\n value = 'true',\n ...props\n}: ComponentProps<typeof Field> & {\n control: Control<TFieldValues>\n disabled?: boolean\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n onCheckedChange?: (\n checked: CheckboxPrimitive.CheckedState,\n field: ControllerRenderProps<TFieldValues, FieldPath<TFieldValues>>\n ) => void\n readOnly?: boolean\n text?: string\n uncheckedValue?: string\n value?: string\n}) {\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n className={cn('block', className)}\n data-invalid={fieldState.invalid}\n orientation={orientation}\n {...props}\n >\n <Label\n className=\"flex items-start gap-3 rounded-lg border p-3 hover:bg-accent/50 has-aria-checked:border-info-foreground has-aria-checked:bg-info\"\n data-slot=\"field-label\"\n >\n <Checkbox\n aria-invalid={fieldState.invalid}\n aria-readonly={readOnly}\n checked={field.value === value}\n className=\"aria-readonly:opacity-50 data-[state=checked]:border-info-foreground data-[state=checked]:bg-info-foreground data-[state=checked]:text-white dark:data-[state=checked]:border-info-foreground dark:data-[state=checked]:bg-info-foreground\"\n disabled={field.disabled}\n id={inputId}\n name={field.name}\n onBlur={field.onBlur}\n onCheckedChange={(checked) => {\n if (!readOnly) {\n field.onChange(checked === true ? value : uncheckedValue)\n if (onCheckedChange) onCheckedChange(checked, field)\n }\n }}\n ref={field.ref}\n value={value}\n />\n\n <div className=\"grid gap-1.5 font-normal\">\n <p className=\"text-sm leading-none font-medium\">{label}</p>\n {text ? (\n <p className=\"text-sm text-muted-foreground\">{text}</p>\n ) : (\n children\n )}\n <ErrorMonitor error={fieldState.error} />\n </div>\n </Label>\n </Field>\n )}\n />\n )\n}\n","import {\n Button,\n Field,\n FieldDescription,\n FieldLabel,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue\n} from '@gmcode/react-ui'\nimport { X } from 'lucide-react'\nimport type {\n ComponentProps,\n HTMLInputAutoCompleteAttribute,\n HTMLInputTypeAttribute\n} from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type {\n FieldPathValue,\n FieldValues,\n UseFormSetValue\n} from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { ErrorMonitor } from '@/components/error-monitor'\nimport type { Option } from '@/types'\n\nexport function NullableSelectField<\n TFieldValues extends FieldValues = FieldValues\n>({\n autoComplete,\n control,\n description,\n disabled,\n inputId,\n inputName,\n label,\n options,\n placeholder,\n setValue,\n ...props\n}: ComponentProps<typeof Field> & {\n autoComplete?: HTMLInputAutoCompleteAttribute\n control: Control<TFieldValues>\n description?: string\n disabled?: boolean\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n options: Option[]\n placeholder?: string\n setValue: UseFormSetValue<TFieldValues>\n type?: HTMLInputTypeAttribute\n}) {\n // i18n\n const { t } = useTranslation()\n\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n {...props}\n >\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <div className=\"flex items-end gap-4\">\n <Select\n autoComplete={autoComplete}\n disabled={field.disabled}\n name={field.name}\n onValueChange={field.onChange}\n value={field.value}\n >\n <SelectTrigger\n aria-invalid={fieldState.invalid}\n className=\"flex-1 overflow-hidden\"\n id={inputId ?? (label ? inputName : undefined)}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.map((option) => (\n <SelectItem\n id={option.id}\n key={option.key ?? option.id ?? option.value}\n value={option.value}\n >\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n <Button\n aria-label={t(($) => $.reset)}\n className=\"flex-none\"\n onClick={() =>\n setValue(\n inputName,\n '' as FieldPathValue<TFieldValues, FieldPath<TFieldValues>>\n )\n }\n type=\"button\"\n variant=\"outline\"\n >\n <X />\n </Button>\n </div>\n\n {description && <FieldDescription>{description}</FieldDescription>}\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n","import {\n Field,\n FieldLabel,\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput\n} from '@gmcode/react-ui'\nimport { Minus, Plus } from 'lucide-react'\nimport type {\n ComponentProps,\n HTMLInputAutoCompleteAttribute,\n HTMLInputTypeAttribute\n} from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type {\n FieldPathValue,\n FieldValues,\n UseFormSetValue\n} from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { ErrorMonitor } from '@/components/error-monitor'\n\nfunction stepInput(\n original: string,\n add: boolean,\n step?: number,\n min?: number,\n max?: number\n) {\n let parsed = Number(original)\n\n if (isNaN(parsed)) {\n return ''\n }\n\n if (add) {\n parsed += step === undefined ? 1 : step\n } else {\n parsed -= step === undefined ? 1 : step\n }\n\n if (min !== undefined) {\n parsed = Math.max(parsed, min)\n }\n\n if (max !== undefined) {\n parsed = Math.min(parsed, max)\n }\n\n return parsed.toString()\n}\n\nexport function NumericField<TFieldValues extends FieldValues = FieldValues>({\n autoComplete,\n control,\n disabled,\n inputId,\n inputMode = 'numeric',\n inputName,\n label,\n placeholder,\n type,\n ui,\n ...props\n}: ComponentProps<typeof Field> & {\n autoComplete?: HTMLInputAutoCompleteAttribute\n control: Control<TFieldValues>\n disabled?: boolean\n inputId?: string\n inputMode?: 'decimal' | 'numeric'\n inputName: FieldPath<TFieldValues>\n label?: string\n placeholder?: string\n type?: HTMLInputTypeAttribute\n ui?: {\n max?: number\n min?: number\n setValue: UseFormSetValue<TFieldValues>\n step?: number\n }\n}) {\n // i18n\n const { t } = useTranslation()\n\n function stepValue(value: string, add: boolean) {\n if (ui?.setValue) {\n ui.setValue(\n inputName,\n stepInput(value, add, ui.step, ui.min, ui.max) as FieldPathValue<\n TFieldValues,\n FieldPath<TFieldValues>\n >,\n { shouldValidate: true }\n )\n }\n }\n\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n {...props}\n >\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <InputGroup>\n <InputGroupInput\n aria-invalid={fieldState.invalid}\n autoComplete={autoComplete}\n id={inputId ?? (label ? inputName : undefined)}\n inputMode={inputMode}\n placeholder={placeholder}\n type={type}\n {...field}\n />\n\n {ui && (\n <InputGroupAddon align=\"inline-end\">\n <InputGroupButton\n aria-label={t(($) => $.decrease)}\n disabled={disabled}\n onClick={() => stepValue(field.value, false)}\n size=\"icon-xs\"\n >\n <Minus />\n </InputGroupButton>\n\n <InputGroupButton\n aria-label={t(($) => $.increase)}\n disabled={disabled}\n onClick={() => stepValue(field.value, true)}\n size=\"icon-xs\"\n >\n <Plus />\n </InputGroupButton>\n </InputGroupAddon>\n )}\n </InputGroup>\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n","import type { ComponentProps } from 'react'\nimport type { FieldValues } from 'react-hook-form'\nimport { InputField } from '@/components/input-field'\n\nexport function PasswordField<TFieldValues extends FieldValues = FieldValues>({\n autoComplete = 'off',\n type = 'password',\n ...props\n}: ComponentProps<typeof InputField<TFieldValues>>) {\n return (\n <InputField\n autoComplete={autoComplete}\n type={type}\n {...props}\n />\n )\n}\n","import {\n Field,\n FieldDescription,\n FieldLabel,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue\n} from '@gmcode/react-ui'\nimport type {\n ComponentProps,\n HTMLInputAutoCompleteAttribute,\n HTMLInputTypeAttribute\n} from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { FieldValues } from 'react-hook-form'\nimport { ErrorMonitor } from '@/components/error-monitor'\nimport type { Option } from '@/types'\n\nexport function SelectField<TFieldValues extends FieldValues = FieldValues>({\n autoComplete,\n control,\n description,\n disabled,\n inputId,\n inputName,\n label,\n options,\n placeholder,\n ...props\n}: ComponentProps<typeof Field> & {\n autoComplete?: HTMLInputAutoCompleteAttribute\n control: Control<TFieldValues>\n description?: string\n disabled?: boolean\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n options: Option[]\n placeholder?: string\n type?: HTMLInputTypeAttribute\n}) {\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n {...props}\n >\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <Select\n autoComplete={autoComplete}\n disabled={field.disabled}\n name={field.name}\n onValueChange={field.onChange}\n value={field.value}\n >\n <SelectTrigger\n aria-invalid={fieldState.invalid}\n id={inputId ?? (label ? inputName : undefined)}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.map((option) => (\n <SelectItem\n id={option.id}\n key={option.key ?? option.id ?? option.value}\n value={option.value}\n >\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n {description && <FieldDescription>{description}</FieldDescription>}\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n","import { Button, Spinner, cn } from '@gmcode/react-ui'\nimport type { ComponentProps } from 'react'\nimport { useTranslation } from 'react-i18next'\n\nexport function Submit({\n label,\n loading = false,\n type = 'submit',\n ...props\n}: ComponentProps<typeof Button> & {\n label?: string\n loading?: boolean\n}) {\n // i18n\n const { t } = useTranslation()\n\n return (\n <Button\n disabled={loading}\n type={type}\n {...props}\n >\n <div className=\"relative\">\n <span className={cn({ invisible: loading })}>\n {label ?? t(($) => $.submit)}\n </span>\n <Spinner\n className={cn(\n 'trans absolute top-1/2 left-1/2 hidden -translate-x-1/2 -translate-y-1/2',\n { block: loading }\n )}\n />\n </div>\n </Button>\n )\n}\n","import { Field, FieldLabel, Switch } from '@gmcode/react-ui'\nimport type { Checkbox as CheckboxPrimitive } from 'radix-ui'\nimport type { ComponentProps } from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { ControllerRenderProps, FieldValues } from 'react-hook-form'\nimport { ErrorMonitor } from '@/components/error-monitor'\n\nexport function SwitchField<TFieldValues extends FieldValues = FieldValues>({\n control,\n disabled,\n inputId,\n inputName,\n label,\n onCheckedChange,\n orientation = 'horizontal',\n readOnly,\n uncheckedValue = '',\n value = 'true',\n ...props\n}: ComponentProps<typeof Field> & {\n control: Control<TFieldValues>\n disabled?: boolean\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n onCheckedChange?: (\n checked: CheckboxPrimitive.CheckedState,\n field: ControllerRenderProps<TFieldValues, FieldPath<TFieldValues>>\n ) => void\n readOnly?: boolean\n uncheckedValue?: string\n value?: string\n}) {\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n orientation={orientation}\n {...props}\n >\n <Switch\n aria-invalid={fieldState.invalid}\n aria-readonly={readOnly}\n checked={field.value === value}\n className=\"aria-readonly:opacity-50\"\n disabled={field.disabled}\n id={inputId ?? (label ? inputName : undefined)}\n name={field.name}\n onBlur={field.onBlur}\n onCheckedChange={(checked) => {\n if (!readOnly) {\n field.onChange(checked === true ? value : uncheckedValue)\n if (onCheckedChange) onCheckedChange(checked, field)\n }\n }}\n ref={field.ref}\n value={value}\n />\n\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n","import type { ComponentProps } from 'react'\nimport type { FieldValues } from 'react-hook-form'\nimport { InputField } from '@/components/input-field'\n\nexport function TextField<TFieldValues extends FieldValues = FieldValues>({\n autoComplete = 'on',\n type = 'text',\n ...props\n}: ComponentProps<typeof InputField<TFieldValues>>) {\n return (\n <InputField\n autoComplete={autoComplete}\n type={type}\n {...props}\n />\n )\n}\n","import { Field, FieldLabel, TextareaAutosize, cn } from '@gmcode/react-ui'\nimport type { ComponentProps } from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { FieldValues } from 'react-hook-form'\nimport type { TextareaHeightChangeMeta } from 'react-textarea-autosize'\nimport { ErrorMonitor } from '@/components/error-monitor'\n\nexport function TextareaField<TFieldValues extends FieldValues = FieldValues>({\n cacheMeasurements,\n control,\n inputId,\n inputName,\n label,\n maxRows,\n minRows,\n onHeightChange,\n placeholder,\n resize = 'none',\n ...props\n}: ComponentProps<typeof Field> & {\n cacheMeasurements?: boolean\n control: Control<TFieldValues>\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n maxRows?: number\n minRows?: number\n onHeightChange?: (height: number, meta: TextareaHeightChangeMeta) => void\n placeholder?: string\n resize?: 'both' | 'none' | 'x' | 'y'\n}) {\n return (\n <Controller\n control={control}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n {...props}\n >\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <TextareaAutosize\n aria-invalid={fieldState.invalid}\n autoComplete=\"off\"\n cacheMeasurements={cacheMeasurements}\n className={cn({\n resize: resize === 'both',\n 'resize-none': resize === 'none',\n 'resize-x': resize === 'x',\n 'resize-y': resize === 'y'\n })}\n id={inputId ?? (label ? inputName : undefined)}\n maxRows={maxRows}\n minRows={minRows}\n onHeightChange={onHeightChange}\n placeholder={placeholder}\n {...field}\n />\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,MAAM,OAAc,eAAe;CACjC,aAAa;CACb,eAAe,EAAE,aAAa,MAAM;CACpC,WAAW,EAAE,eAAG;AAClB,CAAC;AAEI,KAAK,KAAK;;;;ACLf,SAAO,aAAA,IAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA,EAAA,OAAA,oEAAA;EAAA,KAAA,IAAA,KAAA,GAAA,KAAA,GAAA,MAAA,GAAA,EAAA,MAAA,OAAA,IAAA,2BAAA;EAAA,EAAA,KAAA;CAAA;CAAsB,MAAA,EAAA,UAAA;CAE3B,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S,YAAY,OAAO,QAAQ,cAAc;OACxD,IAAI,iBAAiB,gBAAgB,SAAS,KAAK;MACrD;KACF;KACA,KAAK,MAAM;KACJ;IAAM;IAGd,SACC,oBAAC,YAAD;KAAY,SAAS,WAAW;eAAY;IAAkB;IAGhE,oBAAC,cAAD,EAAc,OAAO,WAAW,MAAM;GACjC;;CACP;AAGR;;;;ACpEA,SAAgB,UAA0D,EACxE,eAAe,MACf,OAAO,QACP,GAAG,SAC+C;CAClD,OACE,oBAAC,YAAD;EACgB;EACR;EACN,GAAI;CAAM;AAGhB;;;;ACTA,SAAgB,cAA8D,EAC5E,mBACA,SACA,SACA,WACA,OACA,SACA,SACA,gBACA,aACA,SAAS,QACT,GAAG,SAYF;CACD,OACE,oBAAC,YAAD;EACW;EACT,MAAM;EACN,SAAS,EAAE,OAAO,iBAChB,qBAAC,OAAD;GACE,gBAAc,WAAW;GACzB,GAAI;aAFN;IAIG,SACC,oBAAC,YAAD;KAAY,SAAS,WAAW;eAAY;IAAkB;IAGhE,oBAAC,kBAAD;KACE,gBAAc,WAAW;KACzB,cAAa;KACM;KACnB,WAAW,GAAG;MACZ,QAAQ,WAAW;MACnB,eAAe,WAAW;MAC1B,YAAY,WAAW;MACvB,YAAY,WAAW;KACzB,CAAC;KACD,IAAI,YAAY,QAAQ,YAAY;KAC3B;KACA;KACO;KACH;KACb,GAAI;IAAM;IAGZ,oBAAC,cAAD,EAAc,OAAO,WAAW,MAAM;GACjC;;CACP;AAGR"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["error","label","autoComplete","placeholder","readOnly","type","control","disabled","inputName","label","description","defaultValue","control","disabled","inputName","label","autoComplete","placeholder","description","control","disabled","inputName","$","label","autoComplete","placeholder","description","control","disabled","inputName"],"sources":["../src/i18n.ts","../src/components/error-monitor.tsx","../src/lib/utils.ts","../src/components/calendar-field.tsx","../src/components/checkbox-field.tsx","../src/components/input-field.tsx","../src/components/email-field.tsx","../src/components/fancy-radio-field.tsx","../src/components/form.tsx","../src/components/hidden-field.tsx","../src/components/info-checkbox-field.tsx","../src/components/nullable-select-field.tsx","../src/components/numeric-field.tsx","../src/components/password-field.tsx","../src/components/select-field.tsx","../src/components/submit.tsx","../src/components/switch-field.tsx","../src/components/text-field.tsx","../src/components/textarea-field.tsx"],"sourcesContent":["import { type i18n as Ti18n, createInstance } from 'i18next'\nimport en from '@/locales/en'\n\nconst i18n: Ti18n = createInstance({\n fallbackLng: 'en',\n interpolation: { escapeValue: false },\n resources: { en }\n})\n\nvoid i18n.init()\n\nexport default i18n\n","import { FieldError } from '@gmcode/react-ui'\nimport { useTranslation } from 'react-i18next'\nimport type { ErrorData } from '@/types'\n\nexport function ErrorMonitor({ error }: { error?: ErrorData }) {\n // i18n\n const { t } = useTranslation()\n\n if (!error?.message) {\n return null\n }\n\n if (t.name === 'notReadyT') {\n return <FieldError errors={error} />\n }\n\n // @ts-expect-error: assert error.message to be a translation key\n return <FieldError errors={{ message: t(error.message, error.params) }} />\n}\n","/**\n * Convert a javascript `Date` object to a string with the format `aaaa-mm-dd`.\n */\nexport function dateToString(date: Date): string {\n return `${date.getFullYear()}-${(date.getMonth() + 1 + '').padStart(2, '0')}-${(date.getDate() + '').padStart(2, '0')}`\n}\n\n/**\n * Convert a string to a javascript `Date` object or undefined if the string is\n * not a valid date.\n */\nexport function stringToDate(string: string | undefined): Date | undefined {\n if (!string) {\n return undefined\n }\n\n const date = new Date(string)\n\n if (isNaN(date.getFullYear())) {\n return undefined\n }\n\n return date\n}\n","import { Calendar, Field, FieldLabel } from '@gmcode/react-ui'\nimport type { ComponentProps } from 'react'\nimport type { DayPickerLocale, Matcher } from 'react-day-picker'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { FieldValues } from 'react-hook-form'\nimport { ErrorMonitor } from '@/components/error-monitor'\nimport {\n dateToString as defaultDateToString,\n stringToDate as defaultStringToDate\n} from '@/lib/utils'\n\nexport function CalendarField<TFieldValues extends FieldValues = FieldValues>({\n control,\n dateToString = defaultDateToString,\n disabled,\n inputId,\n inputName,\n label,\n locale,\n stringToDate = defaultStringToDate,\n ...props\n}: ComponentProps<typeof Field> & {\n control: Control<TFieldValues>\n dateToString?: (date: Date) => string\n disabled?: Matcher | Matcher[]\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n locale?: Partial<DayPickerLocale>\n stringToDate?: (string: string | undefined) => Date | undefined\n}) {\n return (\n <Controller\n control={control}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n {...props}\n >\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <Calendar\n aria-invalid={fieldState.invalid}\n className=\"w-full rounded-md border\"\n disabled={disabled}\n fixedWeeks={true}\n id={inputId ?? (label ? inputName : undefined)}\n locale={locale}\n mode=\"single\"\n onSelect={(date) => field.onChange(date ? dateToString(date) : '')}\n selected={stringToDate(field.value)}\n />\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n","import { Checkbox, Field, FieldLabel } from '@gmcode/react-ui'\nimport type { Checkbox as CheckboxPrimitive } from 'radix-ui'\nimport type { ComponentProps } from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { ControllerRenderProps, FieldValues } from 'react-hook-form'\nimport { ErrorMonitor } from '@/components/error-monitor'\n\nexport function CheckboxField<TFieldValues extends FieldValues = FieldValues>({\n control,\n disabled,\n inputId,\n inputName,\n label,\n onCheckedChange,\n orientation = 'horizontal',\n readOnly,\n uncheckedValue = '',\n value = 'true',\n ...props\n}: ComponentProps<typeof Field> & {\n control: Control<TFieldValues>\n disabled?: boolean\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n onCheckedChange?: (\n checked: CheckboxPrimitive.CheckedState,\n field: ControllerRenderProps<TFieldValues, FieldPath<TFieldValues>>\n ) => void\n readOnly?: boolean\n uncheckedValue?: string\n value?: string\n}) {\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n orientation={orientation}\n {...props}\n >\n <Checkbox\n aria-invalid={fieldState.invalid}\n aria-readonly={readOnly}\n checked={field.value === value}\n className=\"aria-readonly:opacity-50\"\n disabled={field.disabled}\n id={inputId ?? (label ? inputName : undefined)}\n name={field.name}\n onBlur={field.onBlur}\n onCheckedChange={(checked) => {\n if (!readOnly) {\n field.onChange(checked === true ? value : uncheckedValue)\n if (onCheckedChange) onCheckedChange(checked, field)\n }\n }}\n ref={field.ref}\n value={value}\n />\n\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n","import { Field, FieldLabel, Input } from '@gmcode/react-ui'\nimport type {\n ChangeEventHandler,\n ComponentProps,\n HTMLInputAutoCompleteAttribute,\n HTMLInputTypeAttribute\n} from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { FieldValues } from 'react-hook-form'\nimport { ErrorMonitor } from '@/components/error-monitor'\n\nexport function InputField<TFieldValues extends FieldValues = FieldValues>({\n autoComplete,\n control,\n disabled,\n inputId,\n inputName,\n label,\n placeholder,\n readOnly,\n type,\n ...props\n}: Omit<ComponentProps<typeof Field>, 'onChange'> & {\n autoComplete?: HTMLInputAutoCompleteAttribute\n control: Control<TFieldValues>\n disabled?: boolean\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n onChange?: ChangeEventHandler<HTMLDivElement, HTMLInputElement>\n placeholder?: string\n readOnly?: boolean\n type?: HTMLInputTypeAttribute\n}) {\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n {...props}\n >\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <Input\n aria-invalid={fieldState.invalid}\n autoComplete={autoComplete}\n id={inputId ?? (label ? inputName : undefined)}\n placeholder={placeholder}\n readOnly={readOnly}\n type={type}\n {...field}\n />\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n","import type { ComponentProps } from 'react'\nimport type { FieldValues } from 'react-hook-form'\nimport { InputField } from '@/components/input-field'\n\nexport function EmailField<TFieldValues extends FieldValues = FieldValues>({\n autoComplete = 'on',\n type = 'email',\n ...props\n}: ComponentProps<typeof InputField<TFieldValues>>) {\n return (\n <InputField\n autoComplete={autoComplete}\n type={type}\n {...props}\n />\n )\n}\n","import {\n FieldDescription,\n FieldLabel,\n FieldSet,\n Label,\n RadioGroup,\n RadioGroupItem\n} from '@gmcode/react-ui'\nimport type { ComponentProps, FC, SVGProps } from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { FieldValues } from 'react-hook-form'\nimport { ErrorMonitor } from '@/components/error-monitor'\nimport type { Option } from '@/types'\n\nexport function FancyRadioField<\n TFieldValues extends FieldValues = FieldValues\n>({\n control,\n defaultValue,\n description,\n disabled,\n groupId,\n inputName,\n label,\n options,\n ...props\n}: ComponentProps<typeof FieldSet> & {\n control: Control<TFieldValues>\n defaultValue: string\n description?: string\n disabled?: boolean\n groupId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n options: Array<Option & { Icon?: FC<SVGProps<SVGSVGElement>> }>\n}) {\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <FieldSet\n data-invalid={fieldState.invalid}\n {...props}\n >\n {label && (\n <FieldLabel htmlFor={groupId ?? inputName}>{label}</FieldLabel>\n )}\n\n {description && <FieldDescription>{description}</FieldDescription>}\n\n <ErrorMonitor error={fieldState.error} />\n\n <RadioGroup\n defaultValue={defaultValue}\n disabled={field.disabled}\n id={groupId ?? (label ? inputName : undefined)}\n name={field.name}\n onBlur={field.onBlur}\n onValueChange={field.onChange}\n ref={field.ref}\n >\n {options.map((option) => (\n <Label\n className=\"rounded-md border ring-ring/50 transition-all hover:bg-accent/50 has-focus-visible:ring-[3px]\"\n data-slot=\"field-label\"\n key={option.key ?? option.id ?? option.value}\n >\n <div className=\"flex w-full items-center gap-3 rounded-md p-3 transition-all has-aria-checked:border-l-8 has-aria-checked:border-ring\">\n <RadioGroupItem\n className=\"sr-only\"\n id={option.id}\n value={option.value}\n />\n {option.Icon && <option.Icon />}\n {option.label}\n </div>\n </Label>\n ))}\n </RadioGroup>\n </FieldSet>\n )}\n />\n )\n}\n","import { cn, flash } from '@gmcode/react-ui'\nimport { type InferSchema, useTsvResolver } from '@gmcode/tsv-hookform'\nimport type { Ruleset } from '@gmcode/tsv-input'\nimport type {\n CancelTokenCallback,\n Errors,\n FormDataErrors,\n GlobalEventCallback,\n Page,\n RequestPayload,\n SharedPageProps\n} from '@inertiajs/core'\nimport { useForm as useInertiaForm } from '@inertiajs/react'\nimport { type ComponentProps, type ReactNode, useEffect, useState } from 'react'\nimport type {\n DefaultValues,\n FieldValues,\n Path,\n UseFormReturn\n} from 'react-hook-form'\nimport { useForm as userReactForm } from 'react-hook-form'\nimport { I18nextProvider } from 'react-i18next'\nimport { ErrorMonitor } from '@/components/error-monitor'\nimport i18n from '@/i18n'\nimport type { Schema } from '@/index'\nimport type { ErrorData, Method, RouteDefinition } from '@/types'\n\ntype RenderFN<TValues extends FieldValues> = ({\n errors,\n form,\n loading\n}: {\n errors: FormDataErrors<object>\n form: UseFormReturn<TValues>\n loading: boolean\n}) => ReactNode\n\nexport function Form<\n TRuleset extends Ruleset,\n TSchema extends Schema<TRuleset>,\n TValues extends InferSchema<TSchema>\n>({\n children,\n className,\n defaults = {},\n onBefore,\n onBeforeUpdate,\n onCancel,\n onCancelToken,\n onError,\n onFinish,\n onFlash,\n onPrefetched,\n onPrefetching,\n onProgress,\n onStart,\n onSuccess,\n preserveScroll = true,\n resetOnSuccess = true,\n rootError: displayRootError = 'flash',\n route,\n schema,\n setDefaultsOnSuccess = false,\n ...props\n}: Omit<\n ComponentProps<'form'>,\n 'action' | 'children' | 'method' | 'onSubmit'\n> & {\n children: RenderFN<TValues>\n defaults?: Partial<DefaultValues<TValues>>\n onBefore?: GlobalEventCallback<'before', RequestPayload>\n onBeforeUpdate?: GlobalEventCallback<'beforeUpdate', RequestPayload>\n onCancel?: GlobalEventCallback<'cancel', RequestPayload>\n onCancelToken?: CancelTokenCallback\n onError?: GlobalEventCallback<'error', RequestPayload>\n onFinish?: GlobalEventCallback<'finish', RequestPayload>\n onFlash?: GlobalEventCallback<'flash', RequestPayload>\n onPrefetched?: GlobalEventCallback<'prefetched', RequestPayload>\n onPrefetching?: GlobalEventCallback<'prefetching', RequestPayload>\n onProgress?: GlobalEventCallback<'progress', RequestPayload>\n onStart?: GlobalEventCallback<'start', RequestPayload>\n onSuccess?: GlobalEventCallback<'success', RequestPayload>\n preserveScroll?: boolean\n /**\n * Reset input values to their defaults on success.\n *\n * @defaultValue `true`\n */\n resetOnSuccess?: boolean\n /**\n * How to display the root error from inertia.\n *\n * - `\"flash\"` - use the Toaster component\n * - `\"monitor\"` - use the ErrorMonitor component\n * - `\"none\"` - don't display the root error\n *\n * @defaultValue `\"flash\"`\n */\n rootError?: 'flash' | 'monitor' | 'none'\n route: RouteDefinition<Method>\n schema: Schema<TRuleset>\n /**\n * Set the submitted values as default values on success.\n *\n * @defaultValue `false`\n */\n setDefaultsOnSuccess?: boolean\n}) {\n const [rootError, setRootError] = useState<ErrorData>()\n\n const defaultValues = Object.fromEntries(\n Object.keys(schema.ruleset).map((field) => [field, defaults[field] ?? ''])\n ) as DefaultValues<TValues>\n\n // React Hook Form\n const reactForm = userReactForm<TValues>({\n defaultValues,\n resolver: useTsvResolver(schema)\n })\n\n // Inertia\n const inertiaForm = useInertiaForm<object>(defaultValues)\n\n function onErrorWithToast(errors: Errors) {\n if (errors.root) {\n if (displayRootError === 'flash') {\n flash({ level: 'error', title: errors.root })\n } else if (displayRootError === 'monitor') {\n setRootError({ message: errors.root })\n }\n }\n\n if (onError) {\n onError(errors)\n }\n }\n\n function onSuccessWithReset(page: Page<SharedPageProps>) {\n if (setDefaultsOnSuccess) {\n inertiaForm.setDefaults()\n reactForm.reset(reactForm.getValues())\n }\n\n if (resetOnSuccess) {\n inertiaForm.reset()\n reactForm.reset()\n }\n\n if (onSuccess) {\n onSuccess(page)\n }\n }\n\n // Submit handler\n function onSubmit(values: TValues) {\n inertiaForm.transform(() => values)\n inertiaForm[route.method](route.url, {\n onBefore,\n onBeforeUpdate,\n onCancel,\n onCancelToken,\n onError: onErrorWithToast,\n onFinish,\n onFlash,\n onPrefetched,\n onPrefetching,\n onProgress,\n onStart,\n onSuccess: onSuccessWithReset,\n preserveScroll\n })\n }\n\n // Add inertia (server) errors to react form.\n useEffect(() => {\n for (const [key, error] of Object.entries(inertiaForm.errors)) {\n if (error) {\n reactForm.setError(key as Path<TValues>, {\n message: error as string,\n type: 'inertia'\n })\n }\n }\n }, [inertiaForm.errors, reactForm])\n\n return (\n <I18nextProvider i18n={i18n}>\n <form\n action={route.url}\n className={cn('grid gap-6', className)}\n method={route.method}\n onSubmit={reactForm.handleSubmit(onSubmit)}\n {...props}\n >\n <>\n {children({\n errors: inertiaForm.errors,\n form: reactForm,\n loading: inertiaForm.processing\n })}\n </>\n\n {displayRootError === 'monitor' && <ErrorMonitor error={rootError} />}\n </form>\n </I18nextProvider>\n )\n}\n","import { cn } from '@gmcode/react-ui'\nimport type { ComponentProps } from 'react'\nimport type { FieldValues } from 'react-hook-form'\nimport { InputField } from '@/components/input-field'\n\nexport function HiddenField<TFieldValues extends FieldValues = FieldValues>({\n autoComplete = 'off',\n className,\n type = 'hidden',\n ...props\n}: ComponentProps<typeof InputField<TFieldValues>>) {\n return (\n <InputField\n autoComplete={autoComplete}\n className={cn('hidden', className)}\n type={type}\n {...props}\n />\n )\n}\n","import { Checkbox, Field, Label, cn } from '@gmcode/react-ui'\nimport type { Checkbox as CheckboxPrimitive } from 'radix-ui'\nimport type { ComponentProps } from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { ControllerRenderProps, FieldValues } from 'react-hook-form'\nimport { ErrorMonitor } from '@/components/error-monitor'\n\nexport function InfoCheckboxField<\n TFieldValues extends FieldValues = FieldValues\n>({\n children,\n className,\n control,\n disabled,\n inputId,\n inputName,\n label,\n onCheckedChange,\n orientation = 'horizontal',\n readOnly,\n text,\n uncheckedValue = '',\n value = 'true',\n ...props\n}: ComponentProps<typeof Field> & {\n control: Control<TFieldValues>\n disabled?: boolean\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n onCheckedChange?: (\n checked: CheckboxPrimitive.CheckedState,\n field: ControllerRenderProps<TFieldValues, FieldPath<TFieldValues>>\n ) => void\n readOnly?: boolean\n text?: string\n uncheckedValue?: string\n value?: string\n}) {\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n className={cn('block', className)}\n data-invalid={fieldState.invalid}\n orientation={orientation}\n {...props}\n >\n <Label\n className=\"flex items-start gap-3 rounded-lg border p-3 hover:bg-accent/50 has-aria-checked:border-info-foreground has-aria-checked:bg-info\"\n data-slot=\"field-label\"\n >\n <Checkbox\n aria-invalid={fieldState.invalid}\n aria-readonly={readOnly}\n checked={field.value === value}\n className=\"aria-readonly:opacity-50 data-[state=checked]:border-info-foreground data-[state=checked]:bg-info-foreground data-[state=checked]:text-white dark:data-[state=checked]:border-info-foreground dark:data-[state=checked]:bg-info-foreground\"\n disabled={field.disabled}\n id={inputId}\n name={field.name}\n onBlur={field.onBlur}\n onCheckedChange={(checked) => {\n if (!readOnly) {\n field.onChange(checked === true ? value : uncheckedValue)\n if (onCheckedChange) onCheckedChange(checked, field)\n }\n }}\n ref={field.ref}\n value={value}\n />\n\n <div className=\"grid gap-1.5 font-normal\">\n <p className=\"text-sm leading-none font-medium\">{label}</p>\n {text ? (\n <p className=\"text-sm text-muted-foreground\">{text}</p>\n ) : (\n children\n )}\n <ErrorMonitor error={fieldState.error} />\n </div>\n </Label>\n </Field>\n )}\n />\n )\n}\n","import {\n Button,\n Field,\n FieldDescription,\n FieldLabel,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue\n} from '@gmcode/react-ui'\nimport { X } from 'lucide-react'\nimport type {\n ComponentProps,\n HTMLInputAutoCompleteAttribute,\n HTMLInputTypeAttribute\n} from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type {\n FieldPathValue,\n FieldValues,\n UseFormSetValue\n} from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { ErrorMonitor } from '@/components/error-monitor'\nimport type { Option } from '@/types'\n\nexport function NullableSelectField<\n TFieldValues extends FieldValues = FieldValues\n>({\n autoComplete,\n control,\n description,\n disabled,\n inputId,\n inputName,\n label,\n options,\n placeholder,\n setValue,\n ...props\n}: ComponentProps<typeof Field> & {\n autoComplete?: HTMLInputAutoCompleteAttribute\n control: Control<TFieldValues>\n description?: string\n disabled?: boolean\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n options: Option[]\n placeholder?: string\n setValue: UseFormSetValue<TFieldValues>\n type?: HTMLInputTypeAttribute\n}) {\n // i18n\n const { t } = useTranslation()\n\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n {...props}\n >\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <div className=\"flex items-end gap-4\">\n <Select\n autoComplete={autoComplete}\n disabled={field.disabled}\n name={field.name}\n onValueChange={field.onChange}\n value={field.value}\n >\n <SelectTrigger\n aria-invalid={fieldState.invalid}\n className=\"flex-1 overflow-hidden\"\n id={inputId ?? (label ? inputName : undefined)}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.map((option) => (\n <SelectItem\n id={option.id}\n key={option.key ?? option.id ?? option.value}\n value={option.value}\n >\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n <Button\n aria-label={t(($) => $.reset)}\n className=\"flex-none\"\n onClick={() =>\n setValue(\n inputName,\n '' as FieldPathValue<TFieldValues, FieldPath<TFieldValues>>\n )\n }\n type=\"button\"\n variant=\"outline\"\n >\n <X />\n </Button>\n </div>\n\n {description && <FieldDescription>{description}</FieldDescription>}\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n","import {\n Field,\n FieldLabel,\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput\n} from '@gmcode/react-ui'\nimport { Minus, Plus } from 'lucide-react'\nimport type {\n ComponentProps,\n HTMLInputAutoCompleteAttribute,\n HTMLInputTypeAttribute\n} from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type {\n FieldPathValue,\n FieldValues,\n UseFormSetValue\n} from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { ErrorMonitor } from '@/components/error-monitor'\n\nfunction stepInput(\n original: string,\n add: boolean,\n step?: number,\n min?: number,\n max?: number\n) {\n let parsed = Number(original)\n\n if (isNaN(parsed)) {\n return ''\n }\n\n if (add) {\n parsed += step === undefined ? 1 : step\n } else {\n parsed -= step === undefined ? 1 : step\n }\n\n if (min !== undefined) {\n parsed = Math.max(parsed, min)\n }\n\n if (max !== undefined) {\n parsed = Math.min(parsed, max)\n }\n\n return parsed.toString()\n}\n\nexport function NumericField<TFieldValues extends FieldValues = FieldValues>({\n autoComplete,\n control,\n disabled,\n inputId,\n inputMode = 'numeric',\n inputName,\n label,\n placeholder,\n type,\n ui,\n ...props\n}: ComponentProps<typeof Field> & {\n autoComplete?: HTMLInputAutoCompleteAttribute\n control: Control<TFieldValues>\n disabled?: boolean\n inputId?: string\n inputMode?: 'decimal' | 'numeric'\n inputName: FieldPath<TFieldValues>\n label?: string\n placeholder?: string\n type?: HTMLInputTypeAttribute\n ui?: {\n max?: number\n min?: number\n setValue: UseFormSetValue<TFieldValues>\n step?: number\n }\n}) {\n // i18n\n const { t } = useTranslation()\n\n function stepValue(value: string, add: boolean) {\n if (ui?.setValue) {\n ui.setValue(\n inputName,\n stepInput(value, add, ui.step, ui.min, ui.max) as FieldPathValue<\n TFieldValues,\n FieldPath<TFieldValues>\n >,\n { shouldValidate: true }\n )\n }\n }\n\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n {...props}\n >\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <InputGroup>\n <InputGroupInput\n aria-invalid={fieldState.invalid}\n autoComplete={autoComplete}\n id={inputId ?? (label ? inputName : undefined)}\n inputMode={inputMode}\n placeholder={placeholder}\n type={type}\n {...field}\n />\n\n {ui && (\n <InputGroupAddon align=\"inline-end\">\n <InputGroupButton\n aria-label={t(($) => $.decrease)}\n disabled={disabled}\n onClick={() => stepValue(field.value, false)}\n size=\"icon-xs\"\n >\n <Minus />\n </InputGroupButton>\n\n <InputGroupButton\n aria-label={t(($) => $.increase)}\n disabled={disabled}\n onClick={() => stepValue(field.value, true)}\n size=\"icon-xs\"\n >\n <Plus />\n </InputGroupButton>\n </InputGroupAddon>\n )}\n </InputGroup>\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n","import type { ComponentProps } from 'react'\nimport type { FieldValues } from 'react-hook-form'\nimport { InputField } from '@/components/input-field'\n\nexport function PasswordField<TFieldValues extends FieldValues = FieldValues>({\n autoComplete = 'off',\n type = 'password',\n ...props\n}: ComponentProps<typeof InputField<TFieldValues>>) {\n return (\n <InputField\n autoComplete={autoComplete}\n type={type}\n {...props}\n />\n )\n}\n","import {\n Field,\n FieldDescription,\n FieldLabel,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue\n} from '@gmcode/react-ui'\nimport type {\n ComponentProps,\n HTMLInputAutoCompleteAttribute,\n HTMLInputTypeAttribute\n} from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { FieldValues } from 'react-hook-form'\nimport { ErrorMonitor } from '@/components/error-monitor'\nimport type { Option } from '@/types'\n\nexport function SelectField<TFieldValues extends FieldValues = FieldValues>({\n autoComplete,\n control,\n description,\n disabled,\n inputId,\n inputName,\n label,\n options,\n placeholder,\n ...props\n}: ComponentProps<typeof Field> & {\n autoComplete?: HTMLInputAutoCompleteAttribute\n control: Control<TFieldValues>\n description?: string\n disabled?: boolean\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n options: Option[]\n placeholder?: string\n type?: HTMLInputTypeAttribute\n}) {\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n {...props}\n >\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <Select\n autoComplete={autoComplete}\n disabled={field.disabled}\n name={field.name}\n onValueChange={field.onChange}\n value={field.value}\n >\n <SelectTrigger\n aria-invalid={fieldState.invalid}\n id={inputId ?? (label ? inputName : undefined)}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.map((option) => (\n <SelectItem\n id={option.id}\n key={option.key ?? option.id ?? option.value}\n value={option.value}\n >\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n {description && <FieldDescription>{description}</FieldDescription>}\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n","import { Button, Spinner, cn } from '@gmcode/react-ui'\nimport type { ComponentProps } from 'react'\nimport { useTranslation } from 'react-i18next'\n\nexport function Submit({\n label,\n loading = false,\n type = 'submit',\n ...props\n}: ComponentProps<typeof Button> & {\n label?: string\n loading?: boolean\n}) {\n // i18n\n const { t } = useTranslation()\n\n return (\n <Button\n disabled={loading}\n type={type}\n {...props}\n >\n <div className=\"relative\">\n <span className={cn({ invisible: loading })}>\n {label ?? t(($) => $.submit)}\n </span>\n <Spinner\n className={cn(\n 'trans absolute top-1/2 left-1/2 hidden -translate-x-1/2 -translate-y-1/2',\n { block: loading }\n )}\n />\n </div>\n </Button>\n )\n}\n","import { Field, FieldLabel, Switch } from '@gmcode/react-ui'\nimport type { Checkbox as CheckboxPrimitive } from 'radix-ui'\nimport type { ComponentProps } from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { ControllerRenderProps, FieldValues } from 'react-hook-form'\nimport { ErrorMonitor } from '@/components/error-monitor'\n\nexport function SwitchField<TFieldValues extends FieldValues = FieldValues>({\n control,\n disabled,\n inputId,\n inputName,\n label,\n onCheckedChange,\n orientation = 'horizontal',\n readOnly,\n uncheckedValue = '',\n value = 'true',\n ...props\n}: ComponentProps<typeof Field> & {\n control: Control<TFieldValues>\n disabled?: boolean\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n onCheckedChange?: (\n checked: CheckboxPrimitive.CheckedState,\n field: ControllerRenderProps<TFieldValues, FieldPath<TFieldValues>>\n ) => void\n readOnly?: boolean\n uncheckedValue?: string\n value?: string\n}) {\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n orientation={orientation}\n {...props}\n >\n <Switch\n aria-invalid={fieldState.invalid}\n aria-readonly={readOnly}\n checked={field.value === value}\n className=\"aria-readonly:opacity-50\"\n disabled={field.disabled}\n id={inputId ?? (label ? inputName : undefined)}\n name={field.name}\n onBlur={field.onBlur}\n onCheckedChange={(checked) => {\n if (!readOnly) {\n field.onChange(checked === true ? value : uncheckedValue)\n if (onCheckedChange) onCheckedChange(checked, field)\n }\n }}\n ref={field.ref}\n value={value}\n />\n\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n","import type { ComponentProps } from 'react'\nimport type { FieldValues } from 'react-hook-form'\nimport { InputField } from '@/components/input-field'\n\nexport function TextField<TFieldValues extends FieldValues = FieldValues>({\n autoComplete = 'on',\n type = 'text',\n ...props\n}: ComponentProps<typeof InputField<TFieldValues>>) {\n return (\n <InputField\n autoComplete={autoComplete}\n type={type}\n {...props}\n />\n )\n}\n","import { Field, FieldLabel, TextareaAutosize, cn } from '@gmcode/react-ui'\nimport type { ComponentProps } from 'react'\nimport { type Control, Controller, type FieldPath } from 'react-hook-form'\nimport type { FieldValues } from 'react-hook-form'\nimport type { TextareaHeightChangeMeta } from 'react-textarea-autosize'\nimport { ErrorMonitor } from '@/components/error-monitor'\n\nexport function TextareaField<TFieldValues extends FieldValues = FieldValues>({\n cacheMeasurements,\n control,\n inputId,\n inputName,\n label,\n maxRows,\n minRows,\n onHeightChange,\n placeholder,\n resize = 'none',\n ...props\n}: ComponentProps<typeof Field> & {\n cacheMeasurements?: boolean\n control: Control<TFieldValues>\n inputId?: string\n inputName: FieldPath<TFieldValues>\n label?: string\n maxRows?: number\n minRows?: number\n onHeightChange?: (height: number, meta: TextareaHeightChangeMeta) => void\n placeholder?: string\n resize?: 'both' | 'none' | 'x' | 'y'\n}) {\n return (\n <Controller\n control={control}\n name={inputName}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.invalid}\n {...props}\n >\n {label && (\n <FieldLabel htmlFor={inputId ?? inputName}>{label}</FieldLabel>\n )}\n\n <TextareaAutosize\n aria-invalid={fieldState.invalid}\n autoComplete=\"off\"\n cacheMeasurements={cacheMeasurements}\n className={cn({\n resize: resize === 'both',\n 'resize-none': resize === 'none',\n 'resize-x': resize === 'x',\n 'resize-y': resize === 'y'\n })}\n id={inputId ?? (label ? inputName : undefined)}\n maxRows={maxRows}\n minRows={minRows}\n onHeightChange={onHeightChange}\n placeholder={placeholder}\n {...field}\n />\n\n <ErrorMonitor error={fieldState.error} />\n </Field>\n )}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,MAAM,OAAc,eAAe;CACjC,aAAa;CACb,eAAe,EAAE,aAAa,MAAM;CACpC,WAAW,EAAE,eA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@@ -4,6 +4,9 @@ declare const en: {
|
|
|
4
4
|
date: string;
|
|
5
5
|
decrease: string;
|
|
6
6
|
email: string;
|
|
7
|
+
hasMixed: string;
|
|
8
|
+
hasNumber: string;
|
|
9
|
+
hasSymbol: string;
|
|
7
10
|
increase: string;
|
|
8
11
|
integer: string;
|
|
9
12
|
maxChars: string;
|
|
@@ -23,6 +26,9 @@ declare const it: {
|
|
|
23
26
|
date: string;
|
|
24
27
|
decrease: string;
|
|
25
28
|
email: string;
|
|
29
|
+
hasMixed: string;
|
|
30
|
+
hasNumber: string;
|
|
31
|
+
hasSymbol: string;
|
|
26
32
|
increase: string;
|
|
27
33
|
integer: string;
|
|
28
34
|
maxChars: string;
|
package/dist/locales.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.d.mts","names":[],"sources":["../src/locales/index.ts"],"mappings":";cAGM
|
|
1
|
+
{"version":3,"file":"locales.d.mts","names":[],"sources":["../src/locales/index.ts"],"mappings":";cAGM;;;;;;;;;;;;;;;;;;;;;;cACA"}
|
package/dist/locales.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as en_default } from "./en-
|
|
1
|
+
import { t as en_default } from "./en-kNGdq3xk.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/locales/it.ts
|
|
4
4
|
var it_default = { translation: {
|
|
@@ -6,6 +6,9 @@ var it_default = { translation: {
|
|
|
6
6
|
date: "Il campo deve essere una data valida",
|
|
7
7
|
decrease: "Diminuisci",
|
|
8
8
|
email: "Il campo deve essere un indirizzo email valido.",
|
|
9
|
+
hasMixed: "Il campo deve contenere almeno un carattere maiuscolo ed un carattere minuscolo.",
|
|
10
|
+
hasNumber: "Il campo deve contenere almeno un numero.",
|
|
11
|
+
hasSymbol: "Il campo deve contenere almeno un simbolo.",
|
|
9
12
|
increase: "Aumenta",
|
|
10
13
|
integer: "Il campo deve essere un numero intero.",
|
|
11
14
|
maxChars: "Il campo non può contenere più di {{max}} caratteri.",
|
package/dist/locales.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.mjs","names":["enResource","itResource"],"sources":["../src/locales/it.ts","../src/locales/index.ts"],"sourcesContent":["import type en from '@/locales/en'\n\nexport default {\n translation: {\n array: 'Il campo deve essere un array.',\n date: 'Il campo deve essere una data valida',\n decrease: 'Diminuisci',\n email: 'Il campo deve essere un indirizzo email valido.',\n increase: 'Aumenta',\n integer: 'Il campo deve essere un numero intero.',\n maxChars: 'Il campo non può contenere più di {{max}} caratteri.',\n maxValue: 'Il campo non può essere superiore a {{max}}.',\n minChars: 'Il campo deve contenere almeno {{min}} caratteri.',\n minValue: 'Il campo deve essere almeno {{min}}.',\n missing: 'Il valore non è supportato.',\n number: 'Il campo deve essere un numero.',\n numeric: 'Il campo deve essere un numero.',\n required: 'Il campo è obbligatorio.',\n reset: 'Reset',\n string: 'Il campo deve essere una stringa.',\n submit: 'Invia'\n }\n} satisfies typeof en\n","import enResource from './en'\nimport itResource from './it'\n\nconst en = enResource.translation\nconst it = itResource.translation\n\nexport { en, it }\n"],"mappings":";;;AAEA,iBAAe,EACb,aAAa;CACX,OAAO;CACP,MAAM;CACN,UAAU;CACV,OAAO;CACP,UAAU;CACV,SAAS;CACT,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACV,SAAS;CACT,QAAQ;CACR,SAAS;CACT,UAAU;CACV,OAAO;CACP,QAAQ;CACR,QAAQ;AACV,EACF;;;;
|
|
1
|
+
{"version":3,"file":"locales.mjs","names":["enResource","itResource"],"sources":["../src/locales/it.ts","../src/locales/index.ts"],"sourcesContent":["import type en from '@/locales/en'\n\nexport default {\n translation: {\n array: 'Il campo deve essere un array.',\n date: 'Il campo deve essere una data valida',\n decrease: 'Diminuisci',\n email: 'Il campo deve essere un indirizzo email valido.',\n hasMixed:\n 'Il campo deve contenere almeno un carattere maiuscolo ed un carattere minuscolo.',\n hasNumber: 'Il campo deve contenere almeno un numero.',\n hasSymbol: 'Il campo deve contenere almeno un simbolo.',\n increase: 'Aumenta',\n integer: 'Il campo deve essere un numero intero.',\n maxChars: 'Il campo non può contenere più di {{max}} caratteri.',\n maxValue: 'Il campo non può essere superiore a {{max}}.',\n minChars: 'Il campo deve contenere almeno {{min}} caratteri.',\n minValue: 'Il campo deve essere almeno {{min}}.',\n missing: 'Il valore non è supportato.',\n number: 'Il campo deve essere un numero.',\n numeric: 'Il campo deve essere un numero.',\n required: 'Il campo è obbligatorio.',\n reset: 'Reset',\n string: 'Il campo deve essere una stringa.',\n submit: 'Invia'\n }\n} satisfies typeof en\n","import enResource from './en'\nimport itResource from './it'\n\nconst en = enResource.translation\nconst it = itResource.translation\n\nexport { en, it }\n"],"mappings":";;;AAEA,iBAAe,EACb,aAAa;CACX,OAAO;CACP,MAAM;CACN,UAAU;CACV,OAAO;CACP,UACE;CACF,WAAW;CACX,WAAW;CACX,UAAU;CACV,SAAS;CACT,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACV,SAAS;CACT,QAAQ;CACR,SAAS;CACT,UAAU;CACV,OAAO;CACP,QAAQ;CACR,QAAQ;AACV,EACF;;;;ACvBA,MAAM,KAAKA,WAAW;AACtB,MAAM,KAAKC,WAAW"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gmcode/forms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Fully functional inertia react forms with client side validations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18next",
|
|
@@ -39,21 +39,23 @@
|
|
|
39
39
|
"react-hook-form": "^7.71.2",
|
|
40
40
|
"react-i18next": "^17.0.8",
|
|
41
41
|
"react-textarea-autosize": "^8.5.9",
|
|
42
|
-
"@gmcode/react-ui": "0.3.
|
|
43
|
-
"@gmcode/tsv-hookform": "0.1.
|
|
44
|
-
"@gmcode/tsv-input": "0.
|
|
42
|
+
"@gmcode/react-ui": "0.3.6",
|
|
43
|
+
"@gmcode/tsv-hookform": "0.1.6",
|
|
44
|
+
"@gmcode/tsv-input": "0.3.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/react": "^19.2.17",
|
|
48
48
|
"@types/react-dom": "^19.2.3",
|
|
49
49
|
"msw": "^2.15.0",
|
|
50
50
|
"typescript": "^6.0.3",
|
|
51
|
-
"vite
|
|
51
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.2.7",
|
|
52
|
+
"vite-plus": "0.2.7",
|
|
53
|
+
"vitest": "4.1.10",
|
|
52
54
|
"vitest-browser-react": "^2.2.0",
|
|
53
|
-
"@repo/themes": "0.0.1",
|
|
54
|
-
"@repo/badge": "0.0.1",
|
|
55
55
|
"@repo/typescript": "0.0.1",
|
|
56
|
-
"@repo/mock-inertia": "3.5.0"
|
|
56
|
+
"@repo/mock-inertia": "3.5.0",
|
|
57
|
+
"@repo/themes": "0.0.1",
|
|
58
|
+
"@repo/badge": "0.0.1"
|
|
57
59
|
},
|
|
58
60
|
"peerDependencies": {
|
|
59
61
|
"@inertiajs/core": "^3.5.0",
|
package/dist/en-Bw2ceTNi.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"en-Bw2ceTNi.mjs","names":[],"sources":["../src/locales/en.ts"],"sourcesContent":["import type { Resource } from 'i18next'\n\nexport default {\n translation: {\n array: 'The field must be an array.',\n date: 'The field must be a valid date',\n decrease: 'Decrease',\n email: 'The field must be a valid email address.',\n increase: 'Increase',\n integer: 'The field must be an integer.',\n maxChars: 'The field must not be greater than {{max}} characters.',\n maxValue: 'The field must not be greater than {{max}}.',\n minChars: 'The field must be at least {{min}} characters.',\n minValue: 'The field must be at least {{min}}.',\n missing: 'The value is not supported.',\n number: 'The field must be a number.',\n numeric: 'The field must be a number.',\n required: 'The field is required.',\n reset: 'Reset',\n string: 'The field must be a string.',\n submit: 'Submit'\n }\n} satisfies Resource\n"],"mappings":";AAEA,iBAAe,EACb,aAAa;CACX,OAAO;CACP,MAAM;CACN,UAAU;CACV,OAAO;CACP,UAAU;CACV,SAAS;CACT,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACV,SAAS;CACT,QAAQ;CACR,SAAS;CACT,UAAU;CACV,OAAO;CACP,QAAQ;CACR,QAAQ;AACV,EACF"}
|