@adrekic/zod-fieldsjson 0.0.1 → 0.0.2-schema-improvements.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/conditions/base.d.ts +3 -3
- package/dist/conditions/boolean.d.ts +3 -3
- package/dist/conditions/checkbox-list.d.ts +3 -3
- package/dist/conditions/date.d.ts +3 -3
- package/dist/conditions/index.d.ts +51 -51
- package/dist/conditions/multi-select.d.ts +3 -3
- package/dist/conditions/multi-string.d.ts +3 -3
- package/dist/conditions/number.d.ts +3 -3
- package/dist/conditions/otp.d.ts +3 -3
- package/dist/conditions/pass-fail.d.ts +3 -3
- package/dist/conditions/radio.d.ts +3 -3
- package/dist/conditions/rating.d.ts +3 -3
- package/dist/conditions/scan.d.ts +3 -3
- package/dist/conditions/select.d.ts +3 -3
- package/dist/conditions/string.d.ts +3 -3
- package/dist/conditions/text.d.ts +3 -3
- package/dist/conditions/time.d.ts +3 -3
- package/dist/conditions/upload.d.ts +3 -3
- package/dist/conditions/url.d.ts +3 -3
- package/dist/elements/base.d.ts +1 -1
- package/dist/elements/index.d.ts +212 -214
- package/dist/elements/section.d.ts +185 -186
- package/dist/fields/base.d.ts +14 -14
- package/dist/fields/boolean.d.ts +4 -4
- package/dist/fields/checkbox-list.d.ts +4 -4
- package/dist/fields/date.d.ts +4 -4
- package/dist/fields/index.d.ts +78 -79
- package/dist/fields/multi-select.d.ts +4 -4
- package/dist/fields/multi-string.d.ts +6 -6
- package/dist/fields/number.d.ts +4 -4
- package/dist/fields/otp.d.ts +5 -8
- package/dist/fields/pass-fail.d.ts +4 -4
- package/dist/fields/radio.d.ts +4 -4
- package/dist/fields/rating.d.ts +5 -5
- package/dist/fields/scan.d.ts +4 -4
- package/dist/fields/select.d.ts +4 -4
- package/dist/fields/string.d.ts +6 -6
- package/dist/fields/text.d.ts +6 -6
- package/dist/fields/time.d.ts +4 -4
- package/dist/fields/upload.d.ts +6 -6
- package/dist/fields/url.d.ts +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +60 -69
- package/dist/schema.d.ts +134 -135
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,ee=Object.getOwnPropertyNames,r=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty,ne=(e,r,ne,i)=>{if(r&&typeof r==`object`||typeof r==`function`)for(var a=ee(r),o=0,s=a.length,c;o<s;o++)c=a[o],!te.call(e,c)&&c!==ne&&t(e,c,{get:(e=>r[e]).bind(null,c),enumerable:!(i=n(r,c))||i.enumerable});return e},i=(n,ee,i)=>(i=n==null?{}:e(r(n)),ne(ee||!n||!n.__esModule||!te.call(n,`default`)?t(i,`default`,{value:n,enumerable:!0}):i,n));let a=require("zod/v4");a=i(a,1);var o=(e,t,n)=>a.object({id:a.string().meta({title:`Condition identifier`,description:`Identifier for this condition.`}),type:e.meta({title:`Condition type`,description:`Discriminator identifying the field type this condition applies to.`}),fieldId:a.string().meta({title:`Field identifier`,description:`Identifier of the field whose value is evaluated.`}),conditionValue:t.meta({title:`Comparison value`,description:`Value or range to compare against the referenced field value.`}),conditionModifier:n.meta({title:`Comparison operator`,description:`Operator used to compare the referenced field value with the comparison value.`})}),s=a.literal(`boolean`),c=a.literal([`equals`,`notEquals`]),re=o(s,a.boolean(),c).meta({title:`Boolean condition`,description:`A condition comparing the value of a boolean field with a configured comparison value.`}),l=a.literal(`checkbox-list`),ie=a.literal([`equals`,`notEquals`,`every`,`some`,`none`]),ae=o(l,a.array(a.string()),ie).meta({title:`Checkbox list condition`,description:`A condition comparing the value of a checkbox list field with a configured comparison value.`}),oe=a.object({value:a.string().meta({title:`Option value`,description:`Stored value identifying the option in field values and conditions.`}),label:a.string().meta({title:`Option label`,description:`Display text for the option.`})}).meta({title:`Selection option`,description:`A selectable option pairing a stored value with a display label.`}),u=a.object({from:a.number().nullable().meta({title:`Range start`,description:`Starting numeric bound, or null when unspecified.`}),to:a.number().nullable().meta({title:`Range end`,description:`Ending numeric bound, or null when unspecified.`})}).meta({title:`Number range`,description:`Numeric comparison bounds; either bound may be null.`}),se=a.literal([`+`,`-`]).meta({title:`UTC offset sign`,description:`Plus or minus sign preceding a UTC offset.`}),d=a.templateLiteral([a.string(),`:`,a.string()]).meta({title:`UTC offset components`,description:`Colon-separated components used for hours and minutes in a time or UTC offset.`}),ce=a.templateLiteral([se,d]).meta({title:`UTC offset`,description:`Signed, colon-separated UTC offset, such as +05:30 or -04:00.`}),f=a.templateLiteral([`T`,d,`:00`,ce]).meta({title:`Time with UTC offset`,description:`Time representation beginning with T, followed by hours and minutes, literal :00 seconds, and a signed UTC offset; for example T09:30:00+05:30.`}),le=a.object({from:f.nullable().meta({title:`Range start`,description:`Starting time bound, or null when unspecified.`}),to:f.nullable().meta({title:`Range end`,description:`Ending time bound, or null when unspecified.`})}).meta({title:`Time range`,description:`Time comparison bounds with UTC offsets; either bound may be null.`}),ue=a.object({from:a.string().nullable().meta({title:`Range start`,description:`Starting date bound, or null when unspecified.`}),to:a.string().nullable().meta({title:`Range end`,description:`Ending date bound, or null when unspecified.`})}).meta({title:`Date range`,description:`Date-string comparison bounds; either bound may be null.`}),p=a.literal(`date`),de=a.literal([`equals`,`notEquals`,`before`,`after`,`in`,`notIn`]),fe=o(p,a.union([a.string(),ue]),de).meta({title:`Date condition`,description:`A condition comparing the value of a date field with a configured comparison value.`}),m=a.literal(`multi-select`),pe=a.literal([`equals`,`notEquals`,`every`,`some`,`none`]),me=o(m,a.array(a.string()),pe).meta({title:`Multi-select condition`,description:`A condition comparing the value of a multi-select field with a configured comparison value.`}),h=a.literal(`multi-string`),he=a.literal([`equals`,`notEquals`,`every`,`some`,`none`]),ge=o(h,a.array(a.string()),he).meta({title:`Multi-string condition`,description:`A condition comparing the value of a multi-string field with a configured comparison value.`}),g=a.literal(`number`),_e=a.literal([`equals`,`notEquals`,`lessThan`,`lessThanOrEquals`,`greaterThan`,`greaterThanOrEquals`,`inRange`,`notInRange`]),ve=o(g,a.union([a.number(),u]),_e).meta({title:`Number condition`,description:`A condition comparing the value of a number field with a configured comparison value.`}),_=a.literal(`otp`),ye=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),be=o(_,a.string(),ye).meta({title:`One-time password condition`,description:`A condition comparing the value of a one-time password field with a configured comparison value.`}),v=e=>a.object({identifier:a.string().meta({title:`Element identifier`,description:`Identifier used to reference this field or section.`}),type:e.meta({title:`Element type`,description:`Discriminator identifying the kind of field or section.`})}),y=e=>a.object({...v(e).shape,label:a.string().meta({title:`Field label`,description:`Display label for the field.`}),description:a.string().nullable().optional().meta({title:`Field description`,description:`Optional help text for the field; may be null.`}),required:a.boolean().meta({title:`Required`,description:`Whether the form requires a value for this field.`})}),b=e=>a.object({...y(e).shape,options:a.array(oe).meta({title:`Options`,description:`Available choices, each with a stored value and a display label.`})}),x=e=>a.object({...y(e).shape,minimum_length:a.number().optional().meta({title:`Minimum length`,description:`Minimum number of characters allowed in the field value.`}),maximum_length:a.number().optional().meta({title:`Maximum length`,description:`Maximum number of characters allowed in the field value.`}),placeholder:a.string().optional().meta({title:`Placeholder`,description:`Hint displayed when the field has no value.`})}),S=a.literal([`pass`,`fail`,`na`]).meta({title:`Assessment status`,description:`Assessment outcome: pass, fail, or na for not applicable.`}),C=a.literal(`pass-fail`),xe=a.object({...y(C).shape,showNotesAndFilesOn:a.array(S).meta({title:`Notes and files statuses`,description:`Statuses for which the notes and file inputs are displayed.`})}).meta({title:`Pass/fail field`,description:`An assessment input with pass, fail, and not-applicable statuses and configurable notes and files.`}),Se=a.object({status:S.nullable(),notes:a.string(),files:a.tuple([])}),w=a.literal(`pass-fail`),Ce=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),we=o(w,a.union([S,a.array(S)]),Ce).meta({title:`Pass/fail condition`,description:`A condition comparing the value of a pass/fail field with a configured comparison value.`}),T=a.literal(`radio`),Te=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),Ee=o(T,a.union([a.string(),a.array(a.string())]),Te).meta({title:`Radio condition`,description:`A condition comparing the value of a radio field with a configured comparison value.`}),E=a.literal(`rating`),De=a.literal([`equals`,`notEquals`,`lessThan`,`lessThanOrEquals`,`greaterThan`,`greaterThanOrEquals`,`inRange`,`notInRange`]),Oe=o(E,a.union([a.number(),u]),De).meta({title:`Rating condition`,description:`A condition comparing the value of a rating field with a configured comparison value.`}),D=a.literal(`qr`),ke=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),Ae=o(D,a.string(),ke).meta({title:`QR scan condition`,description:`A condition comparing the value of a qr scan field with a configured comparison value.`}),O=a.literal(`select`),je=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),Me=o(O,a.union([a.string(),a.array(a.string())]),je).meta({title:`Select condition`,description:`A condition comparing the value of a select field with a configured comparison value.`}),k=a.literal(`string`),Ne=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),Pe=o(k,a.string(),Ne).meta({title:`String condition`,description:`A condition comparing the value of a string field with a configured comparison value.`}),A=a.literal(`text`),Fe=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),Ie=o(A,a.string(),Fe).meta({title:`Text condition`,description:`A condition comparing the value of a text field with a configured comparison value.`}),j=a.literal(`time`),Le=a.literal([`equals`,`notEquals`,`before`,`after`,`in`,`notIn`]),Re=o(j,a.union([f,le]),Le).meta({title:`Time condition`,description:`A condition comparing the value of a time field with a configured comparison value.`}),M=a.literal(`upload`),ze=a.literal([`equals`,`notEquals`]),Be=o(M,a.boolean(),ze).meta({title:`Upload condition`,description:`A condition comparing the value of a upload field with a configured comparison value.`}),N=a.literal(`url`),Ve=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),He=o(N,a.string(),Ve).meta({title:`URL condition`,description:`A condition comparing the value of a url field with a configured comparison value.`}),Ue=a.union([s,l,p,m,h,g,_,w,T,E,D,O,k,A,j,M,N]).meta({title:`Condition type`,description:`Field types supported by conditions.`}),We=a.discriminatedUnion(`type`,[re,ae,fe,me,ge,ve,be,we,Ee,Oe,Ae,Me,Pe,Ie,Re,Be,He]).meta({title:`Condition`,description:`A comparison against a referenced field, selected by its type discriminator.`}),P=a.literal(`boolean`),Ge=y(P).meta({title:`Boolean field`,description:`A true-or-false input.`}),Ke=a.boolean(),F=a.literal(`checkbox-list`),qe=b(F).meta({title:`Checkbox list field`,description:`A list of checkboxes allowing multiple options to be selected.`}),Je=a.array(a.string()),I=a.literal(`date`),Ye=y(I).meta({title:`Date field`,description:`An input for a date value.`}),Xe=a.string().nullable(),L=a.literal(`multi-select`),Ze=a.object({...b(L).shape,placeholder:a.string().optional().meta({title:`Placeholder`,description:`Hint displayed when the field has no value.`})}).meta({title:`Multi-select field`,description:`A selection input allowing multiple options to be selected.`}),Qe=a.array(a.string()),R=a.literal(`multi-string`),$e=a.object({...y(R).shape,minimum_length:a.number().optional().meta({title:`Minimum entries`,description:`Minimum number of strings allowed in the list.`}),maximum_length:a.number().optional().meta({title:`Maximum entries`,description:`Maximum number of strings allowed in the list.`}),placeholder:a.string().optional().meta({title:`Placeholder`,description:`Hint displayed when the field has no value.`})}).meta({title:`Multi-string field`,description:`An input for a list of strings, with optional limits on the number of entries.`}),et=a.array(a.string()),z=a.literal(`number`),tt=a.object({...y(z).shape,minimum:a.number().optional().meta({title:`Minimum value`,description:`Lower bound configured for the numeric input.`}),maximum:a.number().optional().meta({title:`Maximum value`,description:`Upper bound configured for the numeric input.`}),integers:a.boolean().optional().meta({title:`Integers only`,description:`Whether the input should allow only whole numbers.`}),placeholder:a.string().optional().meta({title:`Placeholder`,description:`Hint displayed when the field has no value.`})}).meta({title:`Number field`,description:`A numeric input with optional bounds and an integer-only setting.`}),nt=a.number().nullable(),B=a.literal([`alpha`,`numeric`,`alphanumeric`,`none`]).meta({title:`Code validation mode`,description:`Allowed characters: alpha for letters, numeric for digits, alphanumeric for letters and digits, or none for no character restriction.`}),V=a.literal(`otp`),rt=a.object({...y(V).shape,length:a.number().meta({title:`Code length`,description:`Number of characters in the code.`}),validationType:B}).meta({title:`One-time password field`,description:`A code input with a configured length and character validation mode.`}),it=a.string(),H=a.literal(`radio`),at=b(H).meta({title:`Radio field`,description:`A group of radio options allowing one option to be selected.`}),ot=a.string().nullable(),U=a.literal(`rating`),st=a.object({...y(U).shape,maxRating:a.number().meta({title:`Maximum rating`,description:`Highest rating available in the input.`})}).meta({title:`Rating field`,description:`A rating input with a configured maximum rating.`}),ct=a.number().nullable(),W=a.literal(`qr`),lt=y(W).meta({title:`QR scan field`,description:`An input for a value read from a QR code.`}),ut=a.string(),G=a.literal(`select`),dt=a.object({...b(G).shape,placeholder:a.string().optional().meta({title:`Placeholder`,description:`Hint displayed when the field has no value.`})}).meta({title:`Select field`,description:`A selection input allowing one option to be selected.`}),ft=a.string().nullable(),K=a.literal(`string`),pt=x(K).meta({title:`String field`,description:`A single-line text input with optional character limits and a placeholder.`}),mt=a.string(),q=a.literal(`text`),ht=x(q).meta({title:`Text field`,description:`A multiline text input with optional character limits and a placeholder.`}),gt=a.string(),J=a.literal(`time`),_t=y(J).meta({title:`Time field`,description:`An input for a time value with a UTC offset.`}),vt=f.nullable(),Y=a.literal(`upload`),yt=a.object({...y(Y).shape,extensions:a.array(a.string()).optional().meta({title:`Allowed extensions`,description:`File extensions accepted by the upload input.`}),maximum_size:a.number().optional().meta({title:`Maximum file size`,description:`Configured size limit for uploaded files.`}),maximum_files:a.number().optional().meta({title:`Maximum files`,description:`Maximum number of files allowed in the upload input.`})}).meta({title:`Upload field`,description:`A file upload input with optional extension, size, and file-count limits.`}),bt=a.tuple([]),X=a.literal(`url`),xt=a.object({...y(X).shape,placeholder:a.string().optional().meta({title:`Placeholder`,description:`Hint displayed when the field has no value.`})}).meta({title:`URL field`,description:`An input for a URL string with an optional placeholder.`}),St=a.string().nullable(),Ct=a.union([P,F,I,L,R,z,V,C,H,U,W,G,K,q,J,Y,X]),Z=a.discriminatedUnion(`type`,[Ge,qe,Ye,Ze,$e,tt,rt,xe,at,st,lt,dt,pt,ht,_t,yt,xt]).meta({title:`Field`,description:`Configuration for an input field, selected by its type discriminator.`}),wt=a.union([Ke,Je,Xe,Qe,et,nt,it,Se,ot,ct,ut,ft,mt,gt,vt,bt,St]),Tt=a.record(a.string(),wt),Q=a.literal(`section`),Et=a.record(a.string(),a.array(We)).meta({title:`Section conditions`,description:`Conditions stored on the source section for target sections that depend on it. Each key is the identifier of another section (the target section), and each value is a list of conditions based on fields contained in the source section.`}),$=a.object({...v(Q).shape,label:a.string().nullable().meta({title:`Section label`,description:`Display label for the section, or null for an unlabeled section.`}),description:a.string().nullable().optional().meta({title:`Section description`,description:`Optional help text for the section; may be null.`}),conditions:Et,fields:a.array(Z).meta({title:`Fields`,description:`Fields in this section, in display order.`})}).meta({title:`Section`,description:`A labeled group of fields with optional help text and associated conditions.`}),Dt=a.union([Ct,Q]).meta({title:`Element type`,description:`Supported field and section types.`}),Ot=a.discriminatedUnion(`type`,[$,Z]).meta({title:`Element`,description:`A field or section, selected by its type discriminator.`}),kt=a.array($).meta({title:`Field schema`,description:`An ordered collection of sections defining a form, its fields, and its conditions.`});exports.BaseJSONConditionSchema=o,exports.BaseJSONFieldElementSchema=v,exports.BaseJSONFieldSchema=y,exports.BaseJSONOptionsFieldSchema=b,exports.BaseJSONStringFieldSchema=x,exports.JSONBooleanConditionModifierSchema=c,exports.JSONBooleanConditionSchema=re,exports.JSONBooleanConditionTypeSchema=s,exports.JSONBooleanFieldSchema=Ge,exports.JSONBooleanFieldTypeSchema=P,exports.JSONBooleanFieldValueSchema=Ke,exports.JSONCheckboxListConditionModifierSchema=ie,exports.JSONCheckboxListConditionSchema=ae,exports.JSONCheckboxListConditionTypeSchema=l,exports.JSONCheckboxListFieldSchema=qe,exports.JSONCheckboxListFieldTypeSchema=F,exports.JSONCheckboxListFieldValueSchema=Je,exports.JSONConditionSchema=We,exports.JSONConditionTypeSchema=Ue,exports.JSONDateConditionModifierSchema=de,exports.JSONDateConditionSchema=fe,exports.JSONDateConditionTypeSchema=p,exports.JSONDateFieldSchema=Ye,exports.JSONDateFieldTypeSchema=I,exports.JSONDateFieldValueSchema=Xe,exports.JSONDateRangeSchema=ue,exports.JSONFieldElementSchema=Ot,exports.JSONFieldElementTypeSchema=Dt,exports.JSONFieldSchema=Z,exports.JSONFieldSchemaSchema=kt,exports.JSONFieldSectionConditionsSchema=Et,exports.JSONFieldSectionSchema=$,exports.JSONFieldSectionTypeSchema=Q,exports.JSONFieldTypeSchema=Ct,exports.JSONFieldValueSchema=wt,exports.JSONFieldValuesSchema=Tt,exports.JSONMultiSelectConditionModifierSchema=pe,exports.JSONMultiSelectConditionSchema=me,exports.JSONMultiSelectConditionTypeSchema=m,exports.JSONMultiSelectFieldSchema=Ze,exports.JSONMultiSelectFieldTypeSchema=L,exports.JSONMultiSelectFieldValueSchema=Qe,exports.JSONMultiStringConditionModifierSchema=he,exports.JSONMultiStringConditionSchema=ge,exports.JSONMultiStringConditionTypeSchema=h,exports.JSONMultiStringFieldSchema=$e,exports.JSONMultiStringFieldTypeSchema=R,exports.JSONMultiStringFieldValueSchema=et,exports.JSONNumberConditionModifierSchema=_e,exports.JSONNumberConditionSchema=ve,exports.JSONNumberConditionTypeSchema=g,exports.JSONNumberFieldSchema=tt,exports.JSONNumberFieldTypeSchema=z,exports.JSONNumberFieldValueSchema=nt,exports.JSONOTPConditionModifierSchema=ye,exports.JSONOTPConditionSchema=be,exports.JSONOTPConditionTypeSchema=_,exports.JSONOTPFieldSchema=rt,exports.JSONOTPFieldTypeSchema=V,exports.JSONOTPFieldValueSchema=it,exports.JSONPassFailConditionTypeSchema=w,exports.JSONPassFailFieldConditionModifierSchema=Ce,exports.JSONPassFailFieldConditionSchema=we,exports.JSONPassFailFieldSchema=xe,exports.JSONPassFailFieldTypeSchema=C,exports.JSONPassFailFieldValueSchema=Se,exports.JSONRadioConditionModifierSchema=Te,exports.JSONRadioConditionSchema=Ee,exports.JSONRadioConditionTypeSchema=T,exports.JSONRadioFieldSchema=at,exports.JSONRadioFieldTypeSchema=H,exports.JSONRadioFieldValueSchema=ot,exports.JSONRatingConditionModifierSchema=De,exports.JSONRatingConditionSchema=Oe,exports.JSONRatingConditionTypeSchema=E,exports.JSONRatingFieldSchema=st,exports.JSONRatingFieldTypeSchema=U,exports.JSONRatingFieldValueSchema=ct,exports.JSONScanConditionModifierSchema=ke,exports.JSONScanConditionSchema=Ae,exports.JSONScanConditionTypeSchema=D,exports.JSONScanFieldSchema=lt,exports.JSONScanFieldTypeSchema=W,exports.JSONScanFieldValueSchema=ut,exports.JSONSelectConditionModifierSchema=je,exports.JSONSelectConditionSchema=Me,exports.JSONSelectConditionTypeSchema=O,exports.JSONSelectFieldSchema=dt,exports.JSONSelectFieldTypeSchema=G,exports.JSONSelectFieldValueSchema=ft,exports.JSONStringConditionModifierSchema=Ne,exports.JSONStringConditionSchema=Pe,exports.JSONStringConditionTypeSchema=k,exports.JSONStringFieldSchema=pt,exports.JSONStringFieldTypeSchema=K,exports.JSONStringFieldValueSchema=mt,exports.JSONTextConditionModifierSchema=Fe,exports.JSONTextConditionSchema=Ie,exports.JSONTextConditionTypeSchema=A,exports.JSONTextFieldSchema=ht,exports.JSONTextFieldTypeSchema=q,exports.JSONTextFieldValueSchema=gt,exports.JSONTimeConditionModifierSchema=Le,exports.JSONTimeConditionSchema=Re,exports.JSONTimeConditionTypeSchema=j,exports.JSONTimeFieldSchema=_t,exports.JSONTimeFieldTypeSchema=J,exports.JSONTimeFieldValueSchema=vt,exports.JSONURLConditionModifierSchema=Ve,exports.JSONURLConditionSchema=He,exports.JSONURLConditionTypeSchema=N,exports.JSONURLFieldSchema=xt,exports.JSONURLFieldTypeSchema=X,exports.JSONURLFieldValueSchema=St,exports.JSONUploadConditionModifierSchema=ze,exports.JSONUploadConditionSchema=Be,exports.JSONUploadConditionTypeSchema=M,exports.JSONUploadFieldSchema=yt,exports.JSONUploadFieldTypeSchema=Y,exports.JSONUploadFieldValueSchema=bt,exports.NumberRangeSchema=u,exports.OTPFieldValidationTypeSchema=B,exports.PassFailFieldStatusSchema=S,exports.SelectFieldOptionSchema=oe,exports.TimeRangeSchema=le,exports.TimeSchema=f,exports.UTCOffsetSchema=ce,exports.UTCOffsetSignSchema=se,exports.UTCOffsetTimeSchema=d;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,ee=Object.getOwnPropertyNames,r=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty,ne=(e,r,ne,i)=>{if(r&&typeof r==`object`||typeof r==`function`)for(var a=ee(r),o=0,s=a.length,c;o<s;o++)c=a[o],!te.call(e,c)&&c!==ne&&t(e,c,{get:(e=>r[e]).bind(null,c),enumerable:!(i=n(r,c))||i.enumerable});return e},i=(n,ee,i)=>(i=n==null?{}:e(r(n)),ne(ee||!n||!n.__esModule||!te.call(n,`default`)?t(i,`default`,{value:n,enumerable:!0}):i,n));let a=require("zod/v4");a=i(a,1);var o=(e,t,n)=>a.object({id:a.string().meta({title:`Condition identifier`,description:`Identifier for this condition.`}),type:e.meta({title:`Condition type`,description:`Discriminator identifying the field type this condition applies to.`}),field:a.string().meta({title:`Field identifier`,description:`Identifier of the field whose value is evaluated.`}),value:t.meta({title:`Comparison value`,description:`Value or range to compare against the referenced field value.`}),modifier:n.meta({title:`Comparison operator`,description:`Operator used to compare the referenced field value with the comparison value.`})}),s=a.literal(`boolean`),c=a.literal([`equals`,`notEquals`]),re=o(s,a.boolean(),c).meta({title:`Boolean condition`,description:`A condition comparing the value of a boolean field with a configured comparison value.`}),l=a.literal(`checkbox-list`),ie=a.literal([`equals`,`notEquals`,`every`,`some`,`none`]),ae=o(l,a.array(a.string()),ie).meta({title:`Checkbox list condition`,description:`A condition comparing the value of a checkbox list field with a configured comparison value.`}),oe=a.object({value:a.string().meta({title:`Option value`,description:`Stored value identifying the option in field values and conditions.`}),label:a.string().meta({title:`Option label`,description:`Display text for the option.`})}).meta({title:`Selection option`,description:`A selectable option pairing a stored value with a display label.`}),u=a.object({from:a.number().nullable().meta({title:`Range start`,description:`Starting numeric bound, or null when unspecified.`}),to:a.number().nullable().meta({title:`Range end`,description:`Ending numeric bound, or null when unspecified.`})}).meta({title:`Number range`,description:`Numeric comparison bounds; either bound may be null.`}),se=a.literal([`+`,`-`]).meta({title:`UTC offset sign`,description:`Plus or minus sign preceding a UTC offset.`}),d=a.templateLiteral([a.string(),`:`,a.string()]).meta({title:`UTC offset components`,description:`Colon-separated components used for hours and minutes in a time or UTC offset.`}),ce=a.templateLiteral([se,d]).meta({title:`UTC offset`,description:`Signed, colon-separated UTC offset, such as +05:30 or -04:00.`}),f=a.templateLiteral([`T`,d,`:00`,ce]).meta({title:`Time with UTC offset`,description:`Time representation beginning with T, followed by hours and minutes, literal :00 seconds, and a signed UTC offset; for example T09:30:00+05:30.`}),le=a.object({from:f.nullable().meta({title:`Range start`,description:`Starting time bound, or null when unspecified.`}),to:f.nullable().meta({title:`Range end`,description:`Ending time bound, or null when unspecified.`})}).meta({title:`Time range`,description:`Time comparison bounds with UTC offsets; either bound may be null.`}),ue=a.object({from:a.string().nullable().meta({title:`Range start`,description:`Starting date bound, or null when unspecified.`}),to:a.string().nullable().meta({title:`Range end`,description:`Ending date bound, or null when unspecified.`})}).meta({title:`Date range`,description:`Date-string comparison bounds; either bound may be null.`}),p=a.literal(`date`),de=a.literal([`equals`,`notEquals`,`before`,`after`,`in`,`notIn`]),fe=o(p,a.union([a.string(),ue]),de).meta({title:`Date condition`,description:`A condition comparing the value of a date field with a configured comparison value.`}),m=a.literal(`multi-select`),pe=a.literal([`equals`,`notEquals`,`every`,`some`,`none`]),me=o(m,a.array(a.string()),pe).meta({title:`Multi-select condition`,description:`A condition comparing the value of a multi-select field with a configured comparison value.`}),h=a.literal(`multi-string`),he=a.literal([`equals`,`notEquals`,`every`,`some`,`none`]),ge=o(h,a.array(a.string()),he).meta({title:`Multi-string condition`,description:`A condition comparing the value of a multi-string field with a configured comparison value.`}),g=a.literal(`number`),_e=a.literal([`equals`,`notEquals`,`lessThan`,`lessThanOrEquals`,`greaterThan`,`greaterThanOrEquals`,`inRange`,`notInRange`]),ve=o(g,a.union([a.number(),u]),_e).meta({title:`Number condition`,description:`A condition comparing the value of a number field with a configured comparison value.`}),_=a.literal(`otp`),ye=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),be=o(_,a.string(),ye).meta({title:`One-time password condition`,description:`A condition comparing the value of a one-time password field with a configured comparison value.`}),v=e=>a.object({id:a.string().meta({title:`Element identifier`,description:`Identifier used to reference this field or section.`}),type:e.meta({title:`Element type`,description:`Discriminator identifying the kind of field or section.`})}),y=e=>a.object({...v(e).shape,label:a.string().optional().meta({title:`Field label`,description:`Display label for the field.`}),description:a.string().optional().meta({title:`Field description`,description:`Optional help text for the field.`}),required:a.boolean().optional().meta({title:`Required`,description:`Whether the form requires a value for this field.`})}),b=e=>a.object({...y(e).shape,options:a.array(oe).meta({title:`Options`,description:`Available choices, each with a stored value and a display label.`})}),x=e=>a.object({...y(e).shape,minLength:a.int().nonnegative().optional().meta({title:`Minimum length`,description:`Minimum number of characters allowed in the field value.`}),maxLength:a.int().nonnegative().optional().meta({title:`Maximum length`,description:`Maximum number of characters allowed in the field value.`}),placeholder:a.string().optional().meta({title:`Placeholder`,description:`Hint displayed when the field has no value.`})}),S=a.literal([`pass`,`fail`,`na`]).meta({title:`Assessment status`,description:`Assessment outcome: pass, fail, or na for not applicable.`}),C=a.literal(`pass-fail`),xe=a.object({...y(C).shape,showNotesAndFilesOn:a.array(S).meta({title:`Notes and files statuses`,description:`Statuses for which the notes and file inputs are displayed.`})}).meta({title:`Pass/fail field`,description:`An assessment input with pass, fail, and not-applicable statuses and configurable notes and files.`}),Se=a.object({status:S.nullable(),notes:a.string(),files:a.tuple([])}),w=a.literal(`pass-fail`),Ce=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),we=o(w,a.union([S,a.array(S)]),Ce).meta({title:`Pass/fail condition`,description:`A condition comparing the value of a pass/fail field with a configured comparison value.`}),T=a.literal(`radio`),Te=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),Ee=o(T,a.union([a.string(),a.array(a.string())]),Te).meta({title:`Radio condition`,description:`A condition comparing the value of a radio field with a configured comparison value.`}),E=a.literal(`rating`),De=a.literal([`equals`,`notEquals`,`lessThan`,`lessThanOrEquals`,`greaterThan`,`greaterThanOrEquals`,`inRange`,`notInRange`]),Oe=o(E,a.union([a.number(),u]),De).meta({title:`Rating condition`,description:`A condition comparing the value of a rating field with a configured comparison value.`}),D=a.literal(`qr`),ke=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),Ae=o(D,a.string(),ke).meta({title:`QR scan condition`,description:`A condition comparing the value of a qr scan field with a configured comparison value.`}),O=a.literal(`select`),je=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),Me=o(O,a.union([a.string(),a.array(a.string())]),je).meta({title:`Select condition`,description:`A condition comparing the value of a select field with a configured comparison value.`}),k=a.literal(`string`),Ne=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),Pe=o(k,a.string(),Ne).meta({title:`String condition`,description:`A condition comparing the value of a string field with a configured comparison value.`}),A=a.literal(`text`),Fe=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),Ie=o(A,a.string(),Fe).meta({title:`Text condition`,description:`A condition comparing the value of a text field with a configured comparison value.`}),j=a.literal(`time`),Le=a.literal([`equals`,`notEquals`,`before`,`after`,`in`,`notIn`]),Re=o(j,a.union([f,le]),Le).meta({title:`Time condition`,description:`A condition comparing the value of a time field with a configured comparison value.`}),M=a.literal(`upload`),ze=a.literal([`equals`,`notEquals`]),Be=o(M,a.boolean(),ze).meta({title:`Upload condition`,description:`A condition comparing the value of a upload field with a configured comparison value.`}),N=a.literal(`url`),Ve=a.literal([`equals`,`notEquals`,`includes`,`excludes`]),He=o(N,a.string(),Ve).meta({title:`URL condition`,description:`A condition comparing the value of a url field with a configured comparison value.`}),Ue=a.union([s,l,p,m,h,g,_,w,T,E,D,O,k,A,j,M,N]).meta({title:`Condition type`,description:`Field types supported by conditions.`}),We=a.discriminatedUnion(`type`,[re,ae,fe,me,ge,ve,be,we,Ee,Oe,Ae,Me,Pe,Ie,Re,Be,He]).meta({title:`Condition`,description:`A comparison against a referenced field, selected by its type discriminator.`}),P=a.literal(`boolean`),Ge=y(P).meta({title:`Boolean field`,description:`A true-or-false input.`}),Ke=a.boolean(),F=a.literal(`checkbox-list`),qe=b(F).meta({title:`Checkbox list field`,description:`A list of checkboxes allowing multiple options to be selected.`}),Je=a.array(a.string()),I=a.literal(`date`),Ye=y(I).meta({title:`Date field`,description:`An input for a date value.`}),Xe=a.string().nullable(),L=a.literal(`multi-select`),Ze=a.object({...b(L).shape,placeholder:a.string().optional().meta({title:`Placeholder`,description:`Hint displayed when the field has no value.`})}).meta({title:`Multi-select field`,description:`A selection input allowing multiple options to be selected.`}),Qe=a.array(a.string()),R=a.literal(`multi-string`),$e=a.object({...y(R).shape,minLength:a.int().nonnegative().optional().meta({title:`Minimum entries`,description:`Minimum number of strings allowed in the list.`}),maxLength:a.int().nonnegative().optional().meta({title:`Maximum entries`,description:`Maximum number of strings allowed in the list.`}),placeholder:a.string().optional().meta({title:`Placeholder`,description:`Hint displayed when the field has no value.`})}).meta({title:`Multi-string field`,description:`An input for a list of strings, with optional limits on the number of entries.`}),et=a.array(a.string()),z=a.literal(`number`),tt=a.object({...y(z).shape,minimum:a.number().optional().meta({title:`Minimum value`,description:`Lower bound configured for the numeric input.`}),maximum:a.number().optional().meta({title:`Maximum value`,description:`Upper bound configured for the numeric input.`}),integers:a.boolean().optional().meta({title:`Integers only`,description:`Whether the input should allow only whole numbers.`}),placeholder:a.string().optional().meta({title:`Placeholder`,description:`Hint displayed when the field has no value.`})}).meta({title:`Number field`,description:`A numeric input with optional bounds and an integer-only setting.`}),nt=a.number().nullable(),B=a.literal(`otp`),rt=a.object({...y(B).shape,length:a.int().positive().meta({title:`Code length`,description:`Number of characters in the code.`})}).meta({title:`One-time password field`,description:`A code input with a configured length and character validation mode.`}),it=a.string(),V=a.literal(`radio`),at=b(V).meta({title:`Radio field`,description:`A group of radio options allowing one option to be selected.`}),ot=a.string().nullable(),H=a.literal(`rating`),st=a.object({...y(H).shape,maxRating:a.int().positive().meta({title:`Maximum rating`,description:`Highest rating available in the input.`})}).meta({title:`Rating field`,description:`A rating input with a configured maximum rating.`}),ct=a.number().nullable(),U=a.literal(`qr`),lt=y(U).meta({title:`QR scan field`,description:`An input for a value read from a QR code.`}),ut=a.string(),W=a.literal(`select`),dt=a.object({...b(W).shape,placeholder:a.string().optional().meta({title:`Placeholder`,description:`Hint displayed when the field has no value.`})}).meta({title:`Select field`,description:`A selection input allowing one option to be selected.`}),ft=a.string().nullable(),G=a.literal(`string`),pt=x(G).meta({title:`String field`,description:`A single-line text input with optional character limits and a placeholder.`}),mt=a.string(),K=a.literal(`text`),ht=x(K).meta({title:`Text field`,description:`A multiline text input with optional character limits and a placeholder.`}),gt=a.string(),q=a.literal(`time`),_t=y(q).meta({title:`Time field`,description:`An input for a time value with a UTC offset.`}),vt=f.nullable(),J=a.literal(`upload`),yt=a.object({...y(J).shape,extensions:a.array(a.string()).optional().meta({title:`Allowed extensions`,description:`File extensions accepted by the upload input.`}),maxSize:a.int().nonnegative().optional().meta({title:`Maximum file size`,description:`Configured size limit for uploaded files.`}),maxFiles:a.int().nonnegative().optional().meta({title:`Maximum files`,description:`Maximum number of files allowed in the upload input.`})}).meta({title:`Upload field`,description:`A file upload input with optional extension, size, and file-count limits.`}),bt=a.tuple([]),Y=a.literal(`url`),X=a.object({...y(Y).shape,placeholder:a.string().optional().meta({title:`Placeholder`,description:`Hint displayed when the field has no value.`})}).meta({title:`URL field`,description:`An input for a URL string with an optional placeholder.`}),xt=a.string().nullable(),St=a.union([P,F,I,L,R,z,B,C,V,H,U,W,G,K,q,J,Y]),Z=a.discriminatedUnion(`type`,[Ge,qe,Ye,Ze,$e,tt,rt,xe,at,st,lt,dt,pt,ht,_t,yt,X]).meta({title:`Field`,description:`Configuration for an input field, selected by its type discriminator.`}),Ct=a.union([Ke,Je,Xe,Qe,et,nt,it,Se,ot,ct,ut,ft,mt,gt,vt,bt,xt]),wt=a.record(a.string(),Ct),Q=a.literal(`section`),Tt=a.record(a.string(),a.array(We)),$=a.object({...v(Q).shape,label:a.string().optional().meta({title:`Section label`,description:`Display label for the section, or null for an unlabeled section.`}),description:a.string().optional().meta({title:`Section description`,description:`Optional help text for the section; may be null.`}),conditions:Tt.optional().meta({title:`Section conditions`,description:`Conditions stored on the source section for target sections that depend on it. Each key is the identifier of another section (the target section), and each value is a list of conditions based on fields contained in the source section.`}),fields:a.array(Z).meta({title:`Fields`,description:`Fields in this section, in display order.`})}).meta({title:`Section`,description:`A labeled group of fields with optional help text and associated conditions.`}),Et=a.union([St,Q]).meta({title:`Element type`,description:`Supported field and section types.`}),Dt=a.discriminatedUnion(`type`,[$,Z]).meta({title:`Element`,description:`A field or section, selected by its type discriminator.`}),Ot=a.array($).meta({title:`Field schema`,description:`An ordered collection of sections defining a form, its fields, and its conditions.`});exports.BaseJSONConditionSchema=o,exports.BaseJSONFieldElementSchema=v,exports.BaseJSONFieldSchema=y,exports.BaseJSONOptionsFieldSchema=b,exports.BaseJSONStringFieldSchema=x,exports.JSONBooleanConditionModifierSchema=c,exports.JSONBooleanConditionSchema=re,exports.JSONBooleanConditionTypeSchema=s,exports.JSONBooleanFieldSchema=Ge,exports.JSONBooleanFieldTypeSchema=P,exports.JSONBooleanFieldValueSchema=Ke,exports.JSONCheckboxListConditionModifierSchema=ie,exports.JSONCheckboxListConditionSchema=ae,exports.JSONCheckboxListConditionTypeSchema=l,exports.JSONCheckboxListFieldSchema=qe,exports.JSONCheckboxListFieldTypeSchema=F,exports.JSONCheckboxListFieldValueSchema=Je,exports.JSONConditionSchema=We,exports.JSONConditionTypeSchema=Ue,exports.JSONDateConditionModifierSchema=de,exports.JSONDateConditionSchema=fe,exports.JSONDateConditionTypeSchema=p,exports.JSONDateFieldSchema=Ye,exports.JSONDateFieldTypeSchema=I,exports.JSONDateFieldValueSchema=Xe,exports.JSONDateRangeSchema=ue,exports.JSONFieldElementSchema=Dt,exports.JSONFieldElementTypeSchema=Et,exports.JSONFieldSchema=Z,exports.JSONFieldSchemaSchema=Ot,exports.JSONFieldSectionConditionsSchema=Tt,exports.JSONFieldSectionSchema=$,exports.JSONFieldSectionTypeSchema=Q,exports.JSONFieldTypeSchema=St,exports.JSONFieldValueSchema=Ct,exports.JSONFieldValuesSchema=wt,exports.JSONMultiSelectConditionModifierSchema=pe,exports.JSONMultiSelectConditionSchema=me,exports.JSONMultiSelectConditionTypeSchema=m,exports.JSONMultiSelectFieldSchema=Ze,exports.JSONMultiSelectFieldTypeSchema=L,exports.JSONMultiSelectFieldValueSchema=Qe,exports.JSONMultiStringConditionModifierSchema=he,exports.JSONMultiStringConditionSchema=ge,exports.JSONMultiStringConditionTypeSchema=h,exports.JSONMultiStringFieldSchema=$e,exports.JSONMultiStringFieldTypeSchema=R,exports.JSONMultiStringFieldValueSchema=et,exports.JSONNumberConditionModifierSchema=_e,exports.JSONNumberConditionSchema=ve,exports.JSONNumberConditionTypeSchema=g,exports.JSONNumberFieldSchema=tt,exports.JSONNumberFieldTypeSchema=z,exports.JSONNumberFieldValueSchema=nt,exports.JSONOTPConditionModifierSchema=ye,exports.JSONOTPConditionSchema=be,exports.JSONOTPConditionTypeSchema=_,exports.JSONOTPFieldSchema=rt,exports.JSONOTPFieldTypeSchema=B,exports.JSONOTPFieldValueSchema=it,exports.JSONPassFailConditionTypeSchema=w,exports.JSONPassFailFieldConditionModifierSchema=Ce,exports.JSONPassFailFieldConditionSchema=we,exports.JSONPassFailFieldSchema=xe,exports.JSONPassFailFieldTypeSchema=C,exports.JSONPassFailFieldValueSchema=Se,exports.JSONRadioConditionModifierSchema=Te,exports.JSONRadioConditionSchema=Ee,exports.JSONRadioConditionTypeSchema=T,exports.JSONRadioFieldSchema=at,exports.JSONRadioFieldTypeSchema=V,exports.JSONRadioFieldValueSchema=ot,exports.JSONRatingConditionModifierSchema=De,exports.JSONRatingConditionSchema=Oe,exports.JSONRatingConditionTypeSchema=E,exports.JSONRatingFieldSchema=st,exports.JSONRatingFieldTypeSchema=H,exports.JSONRatingFieldValueSchema=ct,exports.JSONScanConditionModifierSchema=ke,exports.JSONScanConditionSchema=Ae,exports.JSONScanConditionTypeSchema=D,exports.JSONScanFieldSchema=lt,exports.JSONScanFieldTypeSchema=U,exports.JSONScanFieldValueSchema=ut,exports.JSONSelectConditionModifierSchema=je,exports.JSONSelectConditionSchema=Me,exports.JSONSelectConditionTypeSchema=O,exports.JSONSelectFieldSchema=dt,exports.JSONSelectFieldTypeSchema=W,exports.JSONSelectFieldValueSchema=ft,exports.JSONStringConditionModifierSchema=Ne,exports.JSONStringConditionSchema=Pe,exports.JSONStringConditionTypeSchema=k,exports.JSONStringFieldSchema=pt,exports.JSONStringFieldTypeSchema=G,exports.JSONStringFieldValueSchema=mt,exports.JSONTextConditionModifierSchema=Fe,exports.JSONTextConditionSchema=Ie,exports.JSONTextConditionTypeSchema=A,exports.JSONTextFieldSchema=ht,exports.JSONTextFieldTypeSchema=K,exports.JSONTextFieldValueSchema=gt,exports.JSONTimeConditionModifierSchema=Le,exports.JSONTimeConditionSchema=Re,exports.JSONTimeConditionTypeSchema=j,exports.JSONTimeFieldSchema=_t,exports.JSONTimeFieldTypeSchema=q,exports.JSONTimeFieldValueSchema=vt,exports.JSONURLConditionModifierSchema=Ve,exports.JSONURLConditionSchema=He,exports.JSONURLConditionTypeSchema=N,exports.JSONURLFieldSchema=X,exports.JSONURLFieldTypeSchema=Y,exports.JSONURLFieldValueSchema=xt,exports.JSONUploadConditionModifierSchema=ze,exports.JSONUploadConditionSchema=Be,exports.JSONUploadConditionTypeSchema=M,exports.JSONUploadFieldSchema=yt,exports.JSONUploadFieldTypeSchema=J,exports.JSONUploadFieldValueSchema=bt,exports.NumberRangeSchema=u,exports.PassFailFieldStatusSchema=S,exports.SelectFieldOptionSchema=oe,exports.TimeRangeSchema=le,exports.TimeSchema=f,exports.UTCOffsetSchema=ce,exports.UTCOffsetSignSchema=se,exports.UTCOffsetTimeSchema=d;
|
package/dist/index.js
CHANGED
|
@@ -9,15 +9,15 @@ var t = (t, n, r) => e.object({
|
|
|
9
9
|
title: "Condition type",
|
|
10
10
|
description: "Discriminator identifying the field type this condition applies to."
|
|
11
11
|
}),
|
|
12
|
-
|
|
12
|
+
field: e.string().meta({
|
|
13
13
|
title: "Field identifier",
|
|
14
14
|
description: "Identifier of the field whose value is evaluated."
|
|
15
15
|
}),
|
|
16
|
-
|
|
16
|
+
value: n.meta({
|
|
17
17
|
title: "Comparison value",
|
|
18
18
|
description: "Value or range to compare against the referenced field value."
|
|
19
19
|
}),
|
|
20
|
-
|
|
20
|
+
modifier: r.meta({
|
|
21
21
|
title: "Comparison operator",
|
|
22
22
|
description: "Operator used to compare the referenced field value with the comparison value."
|
|
23
23
|
})
|
|
@@ -151,7 +151,7 @@ var t = (t, n, r) => e.object({
|
|
|
151
151
|
title: "One-time password condition",
|
|
152
152
|
description: "A condition comparing the value of a one-time password field with a configured comparison value."
|
|
153
153
|
}), h = (t) => e.object({
|
|
154
|
-
|
|
154
|
+
id: e.string().meta({
|
|
155
155
|
title: "Element identifier",
|
|
156
156
|
description: "Identifier used to reference this field or section."
|
|
157
157
|
}),
|
|
@@ -161,15 +161,15 @@ var t = (t, n, r) => e.object({
|
|
|
161
161
|
})
|
|
162
162
|
}), g = (t) => e.object({
|
|
163
163
|
...h(t).shape,
|
|
164
|
-
label: e.string().meta({
|
|
164
|
+
label: e.string().optional().meta({
|
|
165
165
|
title: "Field label",
|
|
166
166
|
description: "Display label for the field."
|
|
167
167
|
}),
|
|
168
|
-
description: e.string().
|
|
168
|
+
description: e.string().optional().meta({
|
|
169
169
|
title: "Field description",
|
|
170
|
-
description: "Optional help text for the field
|
|
170
|
+
description: "Optional help text for the field."
|
|
171
171
|
}),
|
|
172
|
-
required: e.boolean().meta({
|
|
172
|
+
required: e.boolean().optional().meta({
|
|
173
173
|
title: "Required",
|
|
174
174
|
description: "Whether the form requires a value for this field."
|
|
175
175
|
})
|
|
@@ -181,11 +181,11 @@ var t = (t, n, r) => e.object({
|
|
|
181
181
|
})
|
|
182
182
|
}), v = (t) => e.object({
|
|
183
183
|
...g(t).shape,
|
|
184
|
-
|
|
184
|
+
minLength: e.int().nonnegative().optional().meta({
|
|
185
185
|
title: "Minimum length",
|
|
186
186
|
description: "Minimum number of characters allowed in the field value."
|
|
187
187
|
}),
|
|
188
|
-
|
|
188
|
+
maxLength: e.int().nonnegative().optional().meta({
|
|
189
189
|
title: "Maximum length",
|
|
190
190
|
description: "Maximum number of characters allowed in the field value."
|
|
191
191
|
}),
|
|
@@ -356,11 +356,11 @@ var t = (t, n, r) => e.object({
|
|
|
356
356
|
description: "A selection input allowing multiple options to be selected."
|
|
357
357
|
}), Ue = e.array(e.string()), z = e.literal("multi-string"), We = e.object({
|
|
358
358
|
...g(z).shape,
|
|
359
|
-
|
|
359
|
+
minLength: e.int().nonnegative().optional().meta({
|
|
360
360
|
title: "Minimum entries",
|
|
361
361
|
description: "Minimum number of strings allowed in the list."
|
|
362
362
|
}),
|
|
363
|
-
|
|
363
|
+
maxLength: e.int().nonnegative().optional().meta({
|
|
364
364
|
title: "Maximum entries",
|
|
365
365
|
description: "Maximum number of strings allowed in the list."
|
|
366
366
|
}),
|
|
@@ -392,40 +392,31 @@ var t = (t, n, r) => e.object({
|
|
|
392
392
|
}).meta({
|
|
393
393
|
title: "Number field",
|
|
394
394
|
description: "A numeric input with optional bounds and an integer-only setting."
|
|
395
|
-
}), qe = e.number().nullable(),
|
|
396
|
-
"alpha",
|
|
397
|
-
"numeric",
|
|
398
|
-
"alphanumeric",
|
|
399
|
-
"none"
|
|
400
|
-
]).meta({
|
|
401
|
-
title: "Code validation mode",
|
|
402
|
-
description: "Allowed characters: alpha for letters, numeric for digits, alphanumeric for letters and digits, or none for no character restriction."
|
|
403
|
-
}), V = e.literal("otp"), Ye = e.object({
|
|
395
|
+
}), qe = e.number().nullable(), V = e.literal("otp"), Je = e.object({
|
|
404
396
|
...g(V).shape,
|
|
405
|
-
length: e.
|
|
397
|
+
length: e.int().positive().meta({
|
|
406
398
|
title: "Code length",
|
|
407
399
|
description: "Number of characters in the code."
|
|
408
|
-
})
|
|
409
|
-
validationType: Je
|
|
400
|
+
})
|
|
410
401
|
}).meta({
|
|
411
402
|
title: "One-time password field",
|
|
412
403
|
description: "A code input with a configured length and character validation mode."
|
|
413
|
-
}),
|
|
404
|
+
}), Ye = e.string(), H = e.literal("radio"), Xe = _(H).meta({
|
|
414
405
|
title: "Radio field",
|
|
415
406
|
description: "A group of radio options allowing one option to be selected."
|
|
416
|
-
}),
|
|
407
|
+
}), Ze = e.string().nullable(), U = e.literal("rating"), Qe = e.object({
|
|
417
408
|
...g(U).shape,
|
|
418
|
-
maxRating: e.
|
|
409
|
+
maxRating: e.int().positive().meta({
|
|
419
410
|
title: "Maximum rating",
|
|
420
411
|
description: "Highest rating available in the input."
|
|
421
412
|
})
|
|
422
413
|
}).meta({
|
|
423
414
|
title: "Rating field",
|
|
424
415
|
description: "A rating input with a configured maximum rating."
|
|
425
|
-
}),
|
|
416
|
+
}), $e = e.number().nullable(), W = e.literal("qr"), et = g(W).meta({
|
|
426
417
|
title: "QR scan field",
|
|
427
418
|
description: "An input for a value read from a QR code."
|
|
428
|
-
}),
|
|
419
|
+
}), tt = e.string(), G = e.literal("select"), nt = e.object({
|
|
429
420
|
..._(G).shape,
|
|
430
421
|
placeholder: e.string().optional().meta({
|
|
431
422
|
title: "Placeholder",
|
|
@@ -434,33 +425,33 @@ var t = (t, n, r) => e.object({
|
|
|
434
425
|
}).meta({
|
|
435
426
|
title: "Select field",
|
|
436
427
|
description: "A selection input allowing one option to be selected."
|
|
437
|
-
}),
|
|
428
|
+
}), rt = e.string().nullable(), K = e.literal("string"), it = v(K).meta({
|
|
438
429
|
title: "String field",
|
|
439
430
|
description: "A single-line text input with optional character limits and a placeholder."
|
|
440
|
-
}),
|
|
431
|
+
}), at = e.string(), q = e.literal("text"), ot = v(q).meta({
|
|
441
432
|
title: "Text field",
|
|
442
433
|
description: "A multiline text input with optional character limits and a placeholder."
|
|
443
|
-
}),
|
|
434
|
+
}), st = e.string(), J = e.literal("time"), ct = g(J).meta({
|
|
444
435
|
title: "Time field",
|
|
445
436
|
description: "An input for a time value with a UTC offset."
|
|
446
|
-
}),
|
|
437
|
+
}), lt = s.nullable(), Y = e.literal("upload"), ut = e.object({
|
|
447
438
|
...g(Y).shape,
|
|
448
439
|
extensions: e.array(e.string()).optional().meta({
|
|
449
440
|
title: "Allowed extensions",
|
|
450
441
|
description: "File extensions accepted by the upload input."
|
|
451
442
|
}),
|
|
452
|
-
|
|
443
|
+
maxSize: e.int().nonnegative().optional().meta({
|
|
453
444
|
title: "Maximum file size",
|
|
454
445
|
description: "Configured size limit for uploaded files."
|
|
455
446
|
}),
|
|
456
|
-
|
|
447
|
+
maxFiles: e.int().nonnegative().optional().meta({
|
|
457
448
|
title: "Maximum files",
|
|
458
449
|
description: "Maximum number of files allowed in the upload input."
|
|
459
450
|
})
|
|
460
451
|
}).meta({
|
|
461
452
|
title: "Upload field",
|
|
462
453
|
description: "A file upload input with optional extension, size, and file-count limits."
|
|
463
|
-
}),
|
|
454
|
+
}), dt = e.tuple([]), X = e.literal("url"), ft = e.object({
|
|
464
455
|
...g(X).shape,
|
|
465
456
|
placeholder: e.string().optional().meta({
|
|
466
457
|
title: "Placeholder",
|
|
@@ -469,7 +460,7 @@ var t = (t, n, r) => e.object({
|
|
|
469
460
|
}).meta({
|
|
470
461
|
title: "URL field",
|
|
471
462
|
description: "An input for a URL string with an optional placeholder."
|
|
472
|
-
}),
|
|
463
|
+
}), pt = e.string().nullable(), mt = e.union([
|
|
473
464
|
P,
|
|
474
465
|
I,
|
|
475
466
|
L,
|
|
@@ -494,52 +485,52 @@ var t = (t, n, r) => e.object({
|
|
|
494
485
|
He,
|
|
495
486
|
We,
|
|
496
487
|
Ke,
|
|
497
|
-
|
|
488
|
+
Je,
|
|
498
489
|
ge,
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
490
|
+
Xe,
|
|
491
|
+
Qe,
|
|
492
|
+
et,
|
|
493
|
+
nt,
|
|
494
|
+
it,
|
|
495
|
+
ot,
|
|
496
|
+
ct,
|
|
497
|
+
ut,
|
|
498
|
+
ft
|
|
508
499
|
]).meta({
|
|
509
500
|
title: "Field",
|
|
510
501
|
description: "Configuration for an input field, selected by its type discriminator."
|
|
511
|
-
}),
|
|
502
|
+
}), ht = e.union([
|
|
512
503
|
Le,
|
|
513
504
|
ze,
|
|
514
505
|
Ve,
|
|
515
506
|
Ue,
|
|
516
507
|
Ge,
|
|
517
508
|
qe,
|
|
518
|
-
|
|
509
|
+
Ye,
|
|
519
510
|
_e,
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
]),
|
|
530
|
-
title: "Section conditions",
|
|
531
|
-
description: "Conditions stored on the source section for target sections that depend on it. Each key is the identifier of another section (the target section), and each value is a list of conditions based on fields contained in the source section."
|
|
532
|
-
}), $ = e.object({
|
|
511
|
+
Ze,
|
|
512
|
+
$e,
|
|
513
|
+
tt,
|
|
514
|
+
rt,
|
|
515
|
+
at,
|
|
516
|
+
st,
|
|
517
|
+
lt,
|
|
518
|
+
dt,
|
|
519
|
+
pt
|
|
520
|
+
]), gt = e.record(e.string(), ht), Q = e.literal("section"), _t = e.record(e.string(), e.array(Ie)), $ = e.object({
|
|
533
521
|
...h(Q).shape,
|
|
534
|
-
label: e.string().
|
|
522
|
+
label: e.string().optional().meta({
|
|
535
523
|
title: "Section label",
|
|
536
524
|
description: "Display label for the section, or null for an unlabeled section."
|
|
537
525
|
}),
|
|
538
|
-
description: e.string().
|
|
526
|
+
description: e.string().optional().meta({
|
|
539
527
|
title: "Section description",
|
|
540
528
|
description: "Optional help text for the section; may be null."
|
|
541
529
|
}),
|
|
542
|
-
conditions:
|
|
530
|
+
conditions: _t.optional().meta({
|
|
531
|
+
title: "Section conditions",
|
|
532
|
+
description: "Conditions stored on the source section for target sections that depend on it. Each key is the identifier of another section (the target section), and each value is a list of conditions based on fields contained in the source section."
|
|
533
|
+
}),
|
|
543
534
|
fields: e.array(Z).meta({
|
|
544
535
|
title: "Fields",
|
|
545
536
|
description: "Fields in this section, in display order."
|
|
@@ -547,15 +538,15 @@ var t = (t, n, r) => e.object({
|
|
|
547
538
|
}).meta({
|
|
548
539
|
title: "Section",
|
|
549
540
|
description: "A labeled group of fields with optional help text and associated conditions."
|
|
550
|
-
}),
|
|
541
|
+
}), vt = e.union([mt, Q]).meta({
|
|
551
542
|
title: "Element type",
|
|
552
543
|
description: "Supported field and section types."
|
|
553
|
-
}),
|
|
544
|
+
}), yt = e.discriminatedUnion("type", [$, Z]).meta({
|
|
554
545
|
title: "Element",
|
|
555
546
|
description: "A field or section, selected by its type discriminator."
|
|
556
|
-
}),
|
|
547
|
+
}), bt = e.array($).meta({
|
|
557
548
|
title: "Field schema",
|
|
558
549
|
description: "An ordered collection of sections defining a form, its fields, and its conditions."
|
|
559
550
|
});
|
|
560
551
|
//#endregion
|
|
561
|
-
export { t as BaseJSONConditionSchema, h as BaseJSONFieldElementSchema, g as BaseJSONFieldSchema, _ as BaseJSONOptionsFieldSchema, v as BaseJSONStringFieldSchema, r as JSONBooleanConditionModifierSchema, ee as JSONBooleanConditionSchema, n as JSONBooleanConditionTypeSchema, F as JSONBooleanFieldSchema, P as JSONBooleanFieldTypeSchema, Le as JSONBooleanFieldValueSchema, te as JSONCheckboxListConditionModifierSchema, ne as JSONCheckboxListConditionSchema, i as JSONCheckboxListConditionTypeSchema, Re as JSONCheckboxListFieldSchema, I as JSONCheckboxListFieldTypeSchema, ze as JSONCheckboxListFieldValueSchema, Ie as JSONConditionSchema, Fe as JSONConditionTypeSchema, ce as JSONDateConditionModifierSchema, le as JSONDateConditionSchema, c as JSONDateConditionTypeSchema, Be as JSONDateFieldSchema, L as JSONDateFieldTypeSchema, Ve as JSONDateFieldValueSchema, se as JSONDateRangeSchema,
|
|
552
|
+
export { t as BaseJSONConditionSchema, h as BaseJSONFieldElementSchema, g as BaseJSONFieldSchema, _ as BaseJSONOptionsFieldSchema, v as BaseJSONStringFieldSchema, r as JSONBooleanConditionModifierSchema, ee as JSONBooleanConditionSchema, n as JSONBooleanConditionTypeSchema, F as JSONBooleanFieldSchema, P as JSONBooleanFieldTypeSchema, Le as JSONBooleanFieldValueSchema, te as JSONCheckboxListConditionModifierSchema, ne as JSONCheckboxListConditionSchema, i as JSONCheckboxListConditionTypeSchema, Re as JSONCheckboxListFieldSchema, I as JSONCheckboxListFieldTypeSchema, ze as JSONCheckboxListFieldValueSchema, Ie as JSONConditionSchema, Fe as JSONConditionTypeSchema, ce as JSONDateConditionModifierSchema, le as JSONDateConditionSchema, c as JSONDateConditionTypeSchema, Be as JSONDateFieldSchema, L as JSONDateFieldTypeSchema, Ve as JSONDateFieldValueSchema, se as JSONDateRangeSchema, yt as JSONFieldElementSchema, vt as JSONFieldElementTypeSchema, Z as JSONFieldSchema, bt as JSONFieldSchemaSchema, _t as JSONFieldSectionConditionsSchema, $ as JSONFieldSectionSchema, Q as JSONFieldSectionTypeSchema, mt as JSONFieldTypeSchema, ht as JSONFieldValueSchema, gt as JSONFieldValuesSchema, ue as JSONMultiSelectConditionModifierSchema, de as JSONMultiSelectConditionSchema, l as JSONMultiSelectConditionTypeSchema, He as JSONMultiSelectFieldSchema, R as JSONMultiSelectFieldTypeSchema, Ue as JSONMultiSelectFieldValueSchema, d as JSONMultiStringConditionModifierSchema, f as JSONMultiStringConditionSchema, u as JSONMultiStringConditionTypeSchema, We as JSONMultiStringFieldSchema, z as JSONMultiStringFieldTypeSchema, Ge as JSONMultiStringFieldValueSchema, fe as JSONNumberConditionModifierSchema, pe as JSONNumberConditionSchema, p as JSONNumberConditionTypeSchema, Ke as JSONNumberFieldSchema, B as JSONNumberFieldTypeSchema, qe as JSONNumberFieldValueSchema, me as JSONOTPConditionModifierSchema, he as JSONOTPConditionSchema, m as JSONOTPConditionTypeSchema, Je as JSONOTPFieldSchema, V as JSONOTPFieldTypeSchema, Ye as JSONOTPFieldValueSchema, x as JSONPassFailConditionTypeSchema, ve as JSONPassFailFieldConditionModifierSchema, ye as JSONPassFailFieldConditionSchema, ge as JSONPassFailFieldSchema, b as JSONPassFailFieldTypeSchema, _e as JSONPassFailFieldValueSchema, be as JSONRadioConditionModifierSchema, xe as JSONRadioConditionSchema, S as JSONRadioConditionTypeSchema, Xe as JSONRadioFieldSchema, H as JSONRadioFieldTypeSchema, Ze as JSONRadioFieldValueSchema, Se as JSONRatingConditionModifierSchema, Ce as JSONRatingConditionSchema, C as JSONRatingConditionTypeSchema, Qe as JSONRatingFieldSchema, U as JSONRatingFieldTypeSchema, $e as JSONRatingFieldValueSchema, we as JSONScanConditionModifierSchema, T as JSONScanConditionSchema, w as JSONScanConditionTypeSchema, et as JSONScanFieldSchema, W as JSONScanFieldTypeSchema, tt as JSONScanFieldValueSchema, D as JSONSelectConditionModifierSchema, O as JSONSelectConditionSchema, E as JSONSelectConditionTypeSchema, nt as JSONSelectFieldSchema, G as JSONSelectFieldTypeSchema, rt as JSONSelectFieldValueSchema, Te as JSONStringConditionModifierSchema, Ee as JSONStringConditionSchema, k as JSONStringConditionTypeSchema, it as JSONStringFieldSchema, K as JSONStringFieldTypeSchema, at as JSONStringFieldValueSchema, De as JSONTextConditionModifierSchema, Oe as JSONTextConditionSchema, A as JSONTextConditionTypeSchema, ot as JSONTextFieldSchema, q as JSONTextFieldTypeSchema, st as JSONTextFieldValueSchema, ke as JSONTimeConditionModifierSchema, Ae as JSONTimeConditionSchema, j as JSONTimeConditionTypeSchema, ct as JSONTimeFieldSchema, J as JSONTimeFieldTypeSchema, lt as JSONTimeFieldValueSchema, Ne as JSONURLConditionModifierSchema, Pe as JSONURLConditionSchema, N as JSONURLConditionTypeSchema, ft as JSONURLFieldSchema, X as JSONURLFieldTypeSchema, pt as JSONURLFieldValueSchema, je as JSONUploadConditionModifierSchema, Me as JSONUploadConditionSchema, M as JSONUploadConditionTypeSchema, ut as JSONUploadFieldSchema, Y as JSONUploadFieldTypeSchema, dt as JSONUploadFieldValueSchema, a as NumberRangeSchema, y as PassFailFieldStatusSchema, re as SelectFieldOptionSchema, oe as TimeRangeSchema, s as TimeSchema, ae as UTCOffsetSchema, ie as UTCOffsetSignSchema, o as UTCOffsetTimeSchema };
|