@schema-engine/forms-radiant 0.5.2 → 0.5.3
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/README.md +8 -8
- package/dist/adapters/index.js +2 -2
- package/dist/adapters/radiant/controller/form-controller.d.ts +30 -2
- package/dist/adapters/radiant/controller/form-controller.js +2 -2
- package/dist/adapters/radiant/controller/index.js +2 -2
- package/dist/adapters/radiant/index.js +2 -2
- package/dist/chunk-2H5775NI.js +10 -0
- package/dist/chunk-2H5775NI.js.map +7 -0
- package/dist/chunk-2KSCBICE.js +10 -0
- package/dist/chunk-2KSCBICE.js.map +7 -0
- package/dist/chunk-2OBPB2QL.js +10 -0
- package/dist/chunk-2OBPB2QL.js.map +7 -0
- package/dist/{chunk-XYUTMBYZ.js → chunk-3QTNAM6M.js} +1 -1
- package/dist/chunk-3WML4OXX.js +16 -0
- package/dist/chunk-3WML4OXX.js.map +7 -0
- package/dist/{chunk-SN7RRH7N.js → chunk-45JU4O3K.js} +10 -4
- package/dist/chunk-45JU4O3K.js.map +7 -0
- package/dist/{chunk-TDJF3RSM.js → chunk-4FT7DVBC.js} +1 -1
- package/dist/{chunk-JGMWBGY2.js → chunk-4RQ7A5G7.js} +1 -1
- package/dist/{chunk-OCKLBWOI.js → chunk-62POCW7X.js} +1 -1
- package/dist/chunk-6574CH3A.js +10 -0
- package/dist/chunk-6574CH3A.js.map +7 -0
- package/dist/chunk-6ALXWOXJ.js +16 -0
- package/dist/chunk-6ALXWOXJ.js.map +7 -0
- package/dist/{chunk-CJYPRHUB.js → chunk-6GFJSZQB.js} +1 -1
- package/dist/chunk-6HW74OL4.js +10 -0
- package/dist/chunk-6HW74OL4.js.map +7 -0
- package/dist/chunk-6S4GD7KX.js +10 -0
- package/dist/chunk-6S4GD7KX.js.map +7 -0
- package/dist/{chunk-HLWV3EKQ.js → chunk-6UE466BN.js} +1 -1
- package/dist/{chunk-WBLO2CCZ.js → chunk-7CLURAQ4.js} +1 -1
- package/dist/{chunk-KEA2XEQI.js → chunk-7D57PLC2.js} +2 -2
- package/dist/chunk-7KHD5OKX.js +10 -0
- package/dist/chunk-7KHD5OKX.js.map +7 -0
- package/dist/{chunk-PFJRNIDY.js → chunk-AC4UWDNH.js} +1 -1
- package/dist/{chunk-K7MOCD53.js → chunk-ADJAHDCI.js} +18 -25
- package/dist/chunk-ADJAHDCI.js.map +7 -0
- package/dist/chunk-B6EUQ4D5.js +75 -0
- package/dist/chunk-B6EUQ4D5.js.map +7 -0
- package/dist/{chunk-RY2I6GBB.js → chunk-DX3WYPBL.js} +2 -2
- package/dist/chunk-EB2VDCHX.js +10 -0
- package/dist/chunk-EB2VDCHX.js.map +7 -0
- package/dist/{chunk-PDYPUAZ5.js → chunk-ENF4DAVV.js} +1 -1
- package/dist/{chunk-VJN3SBME.js → chunk-FJJ5BYRC.js} +1 -1
- package/dist/{chunk-F5DXZJMH.js → chunk-GIBWCGYU.js} +1 -1
- package/dist/{chunk-ZHCQCFRT.js → chunk-GL7E33AZ.js} +10 -10
- package/dist/chunk-GL7E33AZ.js.map +7 -0
- package/dist/chunk-J6ODFESM.js +85 -0
- package/dist/chunk-J6ODFESM.js.map +7 -0
- package/dist/{chunk-KHIVOTMG.js → chunk-JADS4IJA.js} +1 -1
- package/dist/{chunk-PJ7NMKHV.js → chunk-JKVODGP7.js} +1 -1
- package/dist/{chunk-QPLWIKBU.js → chunk-KPUUZZBP.js} +2 -2
- package/dist/{chunk-4JYXJYVD.js → chunk-KZR4H5BT.js} +2 -1
- package/dist/chunk-KZR4H5BT.js.map +7 -0
- package/dist/chunk-L6PO4H2I.js +10 -0
- package/dist/chunk-L6PO4H2I.js.map +7 -0
- package/dist/chunk-LO5JPEX5.js +10 -0
- package/dist/chunk-LO5JPEX5.js.map +7 -0
- package/dist/{chunk-C27EGCLO.js → chunk-LTS7B7ZT.js} +30 -30
- package/dist/{chunk-U2Z4AIO2.js → chunk-M32DZQE5.js} +2 -2
- package/dist/{chunk-FREP6CYY.js → chunk-N3XCKR6G.js} +2 -2
- package/dist/chunk-NANXPMLM.js +10 -0
- package/dist/chunk-NANXPMLM.js.map +7 -0
- package/dist/{chunk-MIAUDZGK.js → chunk-ODZE43JO.js} +1 -1
- package/dist/chunk-OPO7RVCM.js.map +7 -0
- package/dist/chunk-PEIGLXJ6.js +10 -0
- package/dist/chunk-PEIGLXJ6.js.map +7 -0
- package/dist/{chunk-SLV6UP6W.js → chunk-PKVVM6K7.js} +8 -8
- package/dist/chunk-R37KBQV6.js +33 -0
- package/dist/chunk-R37KBQV6.js.map +7 -0
- package/dist/{chunk-CIKIFVWO.js → chunk-R4Z4U75R.js} +1 -1
- package/dist/{chunk-DOK7KJEJ.js → chunk-RELHGAT4.js} +2 -2
- package/dist/{chunk-BNT4RRD6.js → chunk-RIUOK6NR.js} +1 -1
- package/dist/{chunk-6YYC6GI7.js → chunk-RV256BAE.js} +30 -19
- package/dist/chunk-RV256BAE.js.map +7 -0
- package/dist/{chunk-4K2WI4QW.js → chunk-SO67TWXH.js} +1 -1
- package/dist/{chunk-UAJQCYDA.js → chunk-SON6ATTU.js} +2 -2
- package/dist/{chunk-RRBVMVHP.js → chunk-SRTT3DHU.js} +1 -1
- package/dist/chunk-UJBM5FU2.js +10 -0
- package/dist/chunk-UJBM5FU2.js.map +7 -0
- package/dist/{chunk-SJ62JN3K.js → chunk-UTOM23GQ.js} +1 -1
- package/dist/chunk-VUWRRTK5.js +10 -0
- package/dist/chunk-VUWRRTK5.js.map +7 -0
- package/dist/chunk-W33X4SOZ.js +10 -0
- package/dist/chunk-W33X4SOZ.js.map +7 -0
- package/dist/{chunk-7VW5FEGO.js → chunk-WAMAPNQE.js} +1 -1
- package/dist/chunk-WO7RSUQ5.js +10 -0
- package/dist/chunk-WO7RSUQ5.js.map +7 -0
- package/dist/chunk-WUJCVBMV.js +10 -0
- package/dist/chunk-WUJCVBMV.js.map +7 -0
- package/dist/{chunk-WYNF44JO.js → chunk-XTCBQJ4R.js} +77 -1
- package/dist/chunk-XTCBQJ4R.js.map +7 -0
- package/dist/{chunk-TM2P4ICL.js → chunk-YIEPBY2G.js} +1 -1
- package/dist/{chunk-VKKA7RZK.js → chunk-YT4JJMBX.js} +14 -6
- package/dist/chunk-YT4JJMBX.js.map +7 -0
- package/dist/chunk-Z6YBGHRZ.js +10 -0
- package/dist/chunk-Z6YBGHRZ.js.map +7 -0
- package/dist/components/blocks/form-actions.js +2 -2
- package/dist/components/blocks/index.js +11 -11
- package/dist/components/blocks/minimal-progress.js +3 -3
- package/dist/components/blocks/step-header.js +3 -3
- package/dist/components/blocks/step-indicators.js +3 -3
- package/dist/components/blocks/wizard-actions.js +3 -3
- package/dist/components/form-debugger/form-debugger.d.ts +4 -2
- package/dist/components/form-debugger/form-debugger.js +4 -4
- package/dist/components/form-debugger/index.js +4 -4
- package/dist/components/form-instance.js +13 -12
- package/dist/components/form-instance.script.js +5 -5
- package/dist/components/form-step.js +2 -2
- package/dist/components/index.js +16 -15
- package/dist/components/internals/child-grid.d.ts +46 -0
- package/dist/components/internals/child-grid.js +11 -0
- package/dist/components/internals/child-grid.js.map +7 -0
- package/dist/components/internals/constraint-element.js +2 -2
- package/dist/components/internals/field-renderer.js +4 -4
- package/dist/components/internals/form-elements.js +5 -5
- package/dist/components/internals/form-renderer.js +14 -13
- package/dist/components/internals/grid-container.d.ts +15 -0
- package/dist/components/internals/grid-container.js +10 -0
- package/dist/components/internals/grid-container.js.map +7 -0
- package/dist/components/internals/recipe-renderer.js +9 -8
- package/dist/components/shells/index.js +3 -3
- package/dist/components/shells/shells.js +3 -3
- package/dist/contexts/form-instance-context.d.ts +6 -13
- package/dist/contexts/form-instance-context.js +1 -1
- package/dist/contexts/index.js +1 -1
- package/dist/elements/actions/submit-button.registration.d.ts +18 -8
- package/dist/elements/actions/submit-button.registration.js +42 -2
- package/dist/elements/actions/submit-button.types.d.ts +3 -378
- package/dist/elements/actions/submit-button.types.js +3 -3
- package/dist/elements/actions/submit-button.types.js.map +3 -3
- package/dist/elements/content/form-submission-alert.js +2 -2
- package/dist/elements/content/form-submission-alert.registration.d.ts +19 -127
- package/dist/elements/content/form-submission-alert.registration.js +40 -4
- package/dist/elements/content/form-submission-alert.types.d.ts +3 -401
- package/dist/elements/content/form-submission-alert.types.js +3 -4
- package/dist/elements/content/form-submission-alert.types.js.map +3 -3
- package/dist/elements/field-group.js +4 -4
- package/dist/elements/form-field.js +3 -3
- package/dist/elements/inputs/form-array-elements.js +10 -8
- package/dist/elements/inputs/form-array-elements.registration.d.ts +23 -8
- package/dist/elements/inputs/form-array-elements.registration.js +36 -10
- package/dist/elements/inputs/form-array-elements.types.d.ts +4 -392
- package/dist/elements/inputs/form-array-elements.types.js +3 -3
- package/dist/elements/inputs/form-array-elements.types.js.map +3 -3
- package/dist/elements/inputs/form-checkbox-group.js +5 -5
- package/dist/elements/inputs/form-checkbox-group.registration.d.ts +148 -125
- package/dist/elements/inputs/form-checkbox-group.registration.js +35 -7
- package/dist/elements/inputs/form-checkbox-group.types.d.ts +3 -409
- package/dist/elements/inputs/form-checkbox-group.types.js +6 -4
- package/dist/elements/inputs/form-checkbox-group.types.js.map +3 -3
- package/dist/elements/inputs/form-checkbox.js +5 -5
- package/dist/elements/inputs/form-checkbox.registration.d.ts +145 -122
- package/dist/elements/inputs/form-checkbox.registration.js +39 -7
- package/dist/elements/inputs/form-checkbox.types.d.ts +3 -391
- package/dist/elements/inputs/form-checkbox.types.js +5 -3
- package/dist/elements/inputs/form-checkbox.types.js.map +3 -3
- package/dist/elements/inputs/form-combobox.js +5 -5
- package/dist/elements/inputs/form-combobox.registration.d.ts +149 -126
- package/dist/elements/inputs/form-combobox.registration.js +35 -7
- package/dist/elements/inputs/form-combobox.types.d.ts +3 -405
- package/dist/elements/inputs/form-combobox.types.js +6 -4
- package/dist/elements/inputs/form-combobox.types.js.map +3 -3
- package/dist/elements/inputs/form-drop-zone.js +5 -5
- package/dist/elements/inputs/form-drop-zone.registration.d.ts +145 -122
- package/dist/elements/inputs/form-drop-zone.registration.js +37 -7
- package/dist/elements/inputs/form-drop-zone.types.d.ts +3 -392
- package/dist/elements/inputs/form-drop-zone.types.js +4 -2
- package/dist/elements/inputs/form-drop-zone.types.js.map +3 -3
- package/dist/elements/inputs/form-fieldset.d.ts +8 -0
- package/dist/elements/inputs/form-fieldset.js +8 -6
- package/dist/elements/inputs/form-fieldset.registration.d.ts +23 -8
- package/dist/elements/inputs/form-fieldset.registration.js +36 -8
- package/dist/elements/inputs/form-fieldset.types.d.ts +4 -387
- package/dist/elements/inputs/form-fieldset.types.js +3 -3
- package/dist/elements/inputs/form-fieldset.types.js.map +3 -3
- package/dist/elements/inputs/form-input-otp.js +5 -5
- package/dist/elements/inputs/form-input-otp.registration.d.ts +173 -134
- package/dist/elements/inputs/form-input-otp.registration.js +37 -7
- package/dist/elements/inputs/form-input-otp.types.d.ts +3 -632
- package/dist/elements/inputs/form-input-otp.types.js +5 -3
- package/dist/elements/inputs/form-input-otp.types.js.map +3 -3
- package/dist/elements/inputs/form-input.js +5 -5
- package/dist/elements/inputs/form-input.registration.d.ts +150 -127
- package/dist/elements/inputs/form-input.registration.js +39 -7
- package/dist/elements/inputs/form-input.types.d.ts +3 -428
- package/dist/elements/inputs/form-input.types.js +4 -2
- package/dist/elements/inputs/form-input.types.js.map +3 -3
- package/dist/elements/inputs/form-masked-input.js +5 -5
- package/dist/elements/inputs/form-masked-input.registration.d.ts +151 -128
- package/dist/elements/inputs/form-masked-input.registration.js +36 -7
- package/dist/elements/inputs/form-masked-input.types.d.ts +3 -419
- package/dist/elements/inputs/form-masked-input.types.js +4 -2
- package/dist/elements/inputs/form-masked-input.types.js.map +3 -3
- package/dist/elements/inputs/form-number.js +5 -5
- package/dist/elements/inputs/form-number.registration.d.ts +148 -125
- package/dist/elements/inputs/form-number.registration.js +39 -7
- package/dist/elements/inputs/form-number.types.d.ts +3 -413
- package/dist/elements/inputs/form-number.types.js +5 -3
- package/dist/elements/inputs/form-number.types.js.map +3 -3
- package/dist/elements/inputs/form-phone-input.js +5 -5
- package/dist/elements/inputs/form-phone-input.registration.d.ts +149 -120
- package/dist/elements/inputs/form-phone-input.registration.js +35 -7
- package/dist/elements/inputs/form-phone-input.types.d.ts +4 -389
- package/dist/elements/inputs/form-phone-input.types.js +4 -2
- package/dist/elements/inputs/form-phone-input.types.js.map +3 -3
- package/dist/elements/inputs/form-radio.js +5 -5
- package/dist/elements/inputs/form-radio.registration.d.ts +148 -125
- package/dist/elements/inputs/form-radio.registration.js +35 -7
- package/dist/elements/inputs/form-radio.types.d.ts +3 -409
- package/dist/elements/inputs/form-radio.types.js +6 -4
- package/dist/elements/inputs/form-radio.types.js.map +3 -3
- package/dist/elements/inputs/form-select.js +5 -5
- package/dist/elements/inputs/form-select.registration.d.ts +150 -127
- package/dist/elements/inputs/form-select.registration.js +35 -7
- package/dist/elements/inputs/form-select.types.d.ts +3 -407
- package/dist/elements/inputs/form-select.types.js +6 -4
- package/dist/elements/inputs/form-select.types.js.map +3 -3
- package/dist/elements/inputs/form-slider.js +5 -5
- package/dist/elements/inputs/form-slider.registration.d.ts +146 -123
- package/dist/elements/inputs/form-slider.registration.js +37 -7
- package/dist/elements/inputs/form-slider.types.d.ts +3 -399
- package/dist/elements/inputs/form-slider.types.js +5 -3
- package/dist/elements/inputs/form-slider.types.js.map +3 -3
- package/dist/elements/inputs/form-switch.js +5 -5
- package/dist/elements/inputs/form-switch.registration.d.ts +143 -120
- package/dist/elements/inputs/form-switch.registration.js +39 -7
- package/dist/elements/inputs/form-switch.types.d.ts +3 -395
- package/dist/elements/inputs/form-switch.types.js +5 -3
- package/dist/elements/inputs/form-switch.types.js.map +3 -3
- package/dist/elements/inputs/form-textarea.js +5 -5
- package/dist/elements/inputs/form-textarea.registration.d.ts +147 -124
- package/dist/elements/inputs/form-textarea.registration.js +39 -7
- package/dist/elements/inputs/form-textarea.types.d.ts +3 -409
- package/dist/elements/inputs/form-textarea.types.js +4 -2
- package/dist/elements/inputs/form-textarea.types.js.map +3 -3
- package/dist/elements/radiant-elements.d.ts +7391 -0
- package/dist/elements/radiant-elements.js +48 -0
- package/dist/elements/radiant-elements.js.map +7 -0
- package/dist/hooks/grid-styles.d.ts +1 -17
- package/dist/hooks/grid-styles.js +1 -3
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +1 -3
- package/dist/index.css +0 -3
- package/dist/index.css.map +2 -2
- package/dist/index.js +65 -80
- package/dist/index.js.map +1 -1
- package/dist/lib/instance-view.d.ts +3 -3
- package/dist/lib/instance-view.js +1 -1
- package/dist/primitives.d.ts +2 -0
- package/dist/primitives.js +10 -5
- package/dist/recipes/bind-recipes.d.ts +3 -3
- package/dist/recipes/types.d.ts +2 -3
- package/dist/registrations/elements.d.ts +2 -1
- package/dist/registrations/elements.js +66 -78
- package/dist/registrations/index.js +66 -78
- package/dist/registries/builder-registry.js +9 -9
- package/dist/registries/index.js +9 -9
- package/package.json +9 -7
- package/skill/SKILL.md +12 -11
- package/skill/reference/forms-radiant.md +2 -2
- package/dist/chunk-3BGAFK3V.js +0 -18
- package/dist/chunk-3BGAFK3V.js.map +0 -7
- package/dist/chunk-4JYXJYVD.js.map +0 -7
- package/dist/chunk-4LAZI7C4.js +0 -26
- package/dist/chunk-4LAZI7C4.js.map +0 -7
- package/dist/chunk-5XIIWHVW.js +0 -27
- package/dist/chunk-5XIIWHVW.js.map +0 -7
- package/dist/chunk-6BONJDNL.js +0 -26
- package/dist/chunk-6BONJDNL.js.map +0 -7
- package/dist/chunk-6YYC6GI7.js.map +0 -7
- package/dist/chunk-BB36KW6N.js +0 -34
- package/dist/chunk-BB36KW6N.js.map +0 -7
- package/dist/chunk-BFY4LHEG.js +0 -25
- package/dist/chunk-BFY4LHEG.js.map +0 -7
- package/dist/chunk-CQG7AUEG.js +0 -11
- package/dist/chunk-CQG7AUEG.js.map +0 -7
- package/dist/chunk-EF2CVOUK.js +0 -23
- package/dist/chunk-EF2CVOUK.js.map +0 -7
- package/dist/chunk-F57ZZSP4.js +0 -26
- package/dist/chunk-F57ZZSP4.js.map +0 -7
- package/dist/chunk-FMA2OC5V.js +0 -29
- package/dist/chunk-FMA2OC5V.js.map +0 -7
- package/dist/chunk-FWGGDZGI.js +0 -26
- package/dist/chunk-FWGGDZGI.js.map +0 -7
- package/dist/chunk-G6IJ5JRQ.js +0 -26
- package/dist/chunk-G6IJ5JRQ.js.map +0 -7
- package/dist/chunk-GB4ETJCS.js.map +0 -7
- package/dist/chunk-GI7QPTA6.js +0 -26
- package/dist/chunk-GI7QPTA6.js.map +0 -7
- package/dist/chunk-GME6PPB2.js +0 -26
- package/dist/chunk-GME6PPB2.js.map +0 -7
- package/dist/chunk-GUCH7BGJ.js +0 -26
- package/dist/chunk-GUCH7BGJ.js.map +0 -7
- package/dist/chunk-HIDI5WS7.js +0 -17
- package/dist/chunk-HIDI5WS7.js.map +0 -7
- package/dist/chunk-HXWAAIA4.js +0 -58
- package/dist/chunk-HXWAAIA4.js.map +0 -7
- package/dist/chunk-HYMMEGK3.js +0 -12
- package/dist/chunk-HYMMEGK3.js.map +0 -7
- package/dist/chunk-IGV5F6AC.js +0 -26
- package/dist/chunk-IGV5F6AC.js.map +0 -7
- package/dist/chunk-IWA6ES3O.js +0 -26
- package/dist/chunk-IWA6ES3O.js.map +0 -7
- package/dist/chunk-K7MOCD53.js.map +0 -7
- package/dist/chunk-LZJ3UDK7.js +0 -23
- package/dist/chunk-LZJ3UDK7.js.map +0 -7
- package/dist/chunk-MJOW3X36.js +0 -33
- package/dist/chunk-MJOW3X36.js.map +0 -7
- package/dist/chunk-NHZSKPKZ.js +0 -21
- package/dist/chunk-NHZSKPKZ.js.map +0 -7
- package/dist/chunk-NP7HH6IT.js +0 -20
- package/dist/chunk-NP7HH6IT.js.map +0 -7
- package/dist/chunk-NVIRGEQU.js +0 -25
- package/dist/chunk-NVIRGEQU.js.map +0 -7
- package/dist/chunk-PD3G4JDD.js +0 -24
- package/dist/chunk-PD3G4JDD.js.map +0 -7
- package/dist/chunk-PPL3NENE.js +0 -26
- package/dist/chunk-PPL3NENE.js.map +0 -7
- package/dist/chunk-QVX4Q6AT.js +0 -26
- package/dist/chunk-QVX4Q6AT.js.map +0 -7
- package/dist/chunk-RLDRCHT4.js +0 -24
- package/dist/chunk-RLDRCHT4.js.map +0 -7
- package/dist/chunk-RP4PAGBV.js +0 -25
- package/dist/chunk-RP4PAGBV.js.map +0 -7
- package/dist/chunk-SN7RRH7N.js.map +0 -7
- package/dist/chunk-TTTD6WXJ.js +0 -26
- package/dist/chunk-TTTD6WXJ.js.map +0 -7
- package/dist/chunk-TXOSFNQT.js +0 -35
- package/dist/chunk-TXOSFNQT.js.map +0 -7
- package/dist/chunk-UYNK56NL.js +0 -22
- package/dist/chunk-UYNK56NL.js.map +0 -7
- package/dist/chunk-VKKA7RZK.js.map +0 -7
- package/dist/chunk-VMCK5D33.js +0 -30
- package/dist/chunk-VMCK5D33.js.map +0 -7
- package/dist/chunk-WNRR7VQX.js +0 -32
- package/dist/chunk-WNRR7VQX.js.map +0 -7
- package/dist/chunk-WVMXFJZ6.js +0 -25
- package/dist/chunk-WVMXFJZ6.js.map +0 -7
- package/dist/chunk-WYNF44JO.js.map +0 -7
- package/dist/chunk-XBLX66UW.js +0 -31
- package/dist/chunk-XBLX66UW.js.map +0 -7
- package/dist/chunk-ZHCQCFRT.js.map +0 -7
- package/dist/chunk-ZSYE5AS5.js +0 -30
- package/dist/chunk-ZSYE5AS5.js.map +0 -7
- /package/dist/{chunk-XYUTMBYZ.js.map → chunk-3QTNAM6M.js.map} +0 -0
- /package/dist/{chunk-TDJF3RSM.js.map → chunk-4FT7DVBC.js.map} +0 -0
- /package/dist/{chunk-JGMWBGY2.js.map → chunk-4RQ7A5G7.js.map} +0 -0
- /package/dist/{chunk-OCKLBWOI.js.map → chunk-62POCW7X.js.map} +0 -0
- /package/dist/{chunk-CJYPRHUB.js.map → chunk-6GFJSZQB.js.map} +0 -0
- /package/dist/{chunk-HLWV3EKQ.js.map → chunk-6UE466BN.js.map} +0 -0
- /package/dist/{chunk-WBLO2CCZ.js.map → chunk-7CLURAQ4.js.map} +0 -0
- /package/dist/{chunk-KEA2XEQI.js.map → chunk-7D57PLC2.js.map} +0 -0
- /package/dist/{chunk-PFJRNIDY.js.map → chunk-AC4UWDNH.js.map} +0 -0
- /package/dist/{chunk-RY2I6GBB.js.map → chunk-DX3WYPBL.js.map} +0 -0
- /package/dist/{chunk-PDYPUAZ5.js.map → chunk-ENF4DAVV.js.map} +0 -0
- /package/dist/{chunk-VJN3SBME.js.map → chunk-FJJ5BYRC.js.map} +0 -0
- /package/dist/{chunk-F5DXZJMH.js.map → chunk-GIBWCGYU.js.map} +0 -0
- /package/dist/{chunk-SEOQGZ53.js → chunk-GXNBKQVI.js} +0 -0
- /package/dist/{chunk-SEOQGZ53.js.map → chunk-GXNBKQVI.js.map} +0 -0
- /package/dist/{chunk-KHIVOTMG.js.map → chunk-JADS4IJA.js.map} +0 -0
- /package/dist/{chunk-PJ7NMKHV.js.map → chunk-JKVODGP7.js.map} +0 -0
- /package/dist/{chunk-QPLWIKBU.js.map → chunk-KPUUZZBP.js.map} +0 -0
- /package/dist/{chunk-C27EGCLO.js.map → chunk-LTS7B7ZT.js.map} +0 -0
- /package/dist/{chunk-U2Z4AIO2.js.map → chunk-M32DZQE5.js.map} +0 -0
- /package/dist/{chunk-FREP6CYY.js.map → chunk-N3XCKR6G.js.map} +0 -0
- /package/dist/{chunk-MIAUDZGK.js.map → chunk-ODZE43JO.js.map} +0 -0
- /package/dist/{chunk-GB4ETJCS.js → chunk-OPO7RVCM.js} +0 -0
- /package/dist/{chunk-SLV6UP6W.js.map → chunk-PKVVM6K7.js.map} +0 -0
- /package/dist/{chunk-CIKIFVWO.js.map → chunk-R4Z4U75R.js.map} +0 -0
- /package/dist/{chunk-DOK7KJEJ.js.map → chunk-RELHGAT4.js.map} +0 -0
- /package/dist/{chunk-BNT4RRD6.js.map → chunk-RIUOK6NR.js.map} +0 -0
- /package/dist/{chunk-4K2WI4QW.js.map → chunk-SO67TWXH.js.map} +0 -0
- /package/dist/{chunk-UAJQCYDA.js.map → chunk-SON6ATTU.js.map} +0 -0
- /package/dist/{chunk-RRBVMVHP.js.map → chunk-SRTT3DHU.js.map} +0 -0
- /package/dist/{chunk-SJ62JN3K.js.map → chunk-UTOM23GQ.js.map} +0 -0
- /package/dist/{chunk-7VW5FEGO.js.map → chunk-WAMAPNQE.js.map} +0 -0
- /package/dist/{chunk-TM2P4ICL.js.map → chunk-YIEPBY2G.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/elements/inputs/form-array-elements.tsx"],
|
|
4
|
+
"sourcesContent": ["import './form-array-elements.css';\nimport { customElement, onEvent, prop, RadiantElement, state } from '@ecopages/radiant';\nimport { onContextUpdate } from '@ecopages/radiant/context';\nimport { RuiButton } from '@ecopages/radiant-ui/button';\nimport { RuiFieldError } from '@ecopages/radiant-ui/field';\nimport type { JSX_PROPS, JsxRenderable } from '@ecopages/jsx';\nimport { MapItems } from '@ecopages/jsx/client';\nimport { computed, peek, state as createState, type State } from '@ecopages/signals';\nimport { FormElements } from '@/components/internals/form-elements';\nimport { resolveFormEngine } from '@/contexts/resolve-form-engine';\nimport { formEngineContext } from '@/components/provider';\nimport type { ArrayElementsProps } from './form-array-elements.types';\nimport {\n\tarrayItemScope,\n\tcreateArrayRowDefault,\n\tseedArrayRows,\n\tusesScalarArrayItem,\n\ttype FormEngineRuntime as FormEngine,\n\tisFieldRequired,\n\tgetValueAtPath,\n\tsetValueAtPath,\n} from '@schema-engine/forms';\nimport {\n\tissueText,\n\tselectFieldState,\n\ttype FormIssueFormatter,\n\ttype FormStateContainer,\n} from '@schema-engine/forms/state-container';\nimport { formInstanceContext, type FormInstanceContextValue } from '@/contexts/form-instance-context';\nimport { isRenderedRequired, withContainerState } from '@/lib/field-rules';\nimport { RequiredMarker } from '../field-group';\nimport { mergeFieldGridHost } from '@/hooks/grid-styles';\nimport { ChildGrid } from '@/components/internals/child-grid';\nimport { GRID_ITEM_CLASS, getAppearanceAttributes } from '@schema-engine/layout';\n\nfunction TrashIcon() {\n\treturn (\n\t\t<svg\n\t\t\tclass=\"se-form-array__icon\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\taria-hidden=\"true\"\n\t\t\tfill=\"none\"\n\t\t\tstroke=\"currentColor\"\n\t\t\tstroke-width=\"2\"\n\t\t\tstroke-linecap=\"round\"\n\t\t\tstroke-linejoin=\"round\"\n\t\t>\n\t\t\t<path d=\"M3 6h18\" />\n\t\t\t<path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\" />\n\t\t\t<path d=\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" />\n\t\t\t<path d=\"M10 11v6\" />\n\t\t\t<path d=\"M14 11v6\" />\n\t\t</svg>\n\t);\n}\n\nfunction PlusIcon() {\n\treturn (\n\t\t<svg\n\t\t\tclass=\"se-form-array__icon\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\taria-hidden=\"true\"\n\t\t\tfill=\"none\"\n\t\t\tstroke=\"currentColor\"\n\t\t\tstroke-width=\"2\"\n\t\t\tstroke-linecap=\"round\"\n\t\t\tstroke-linejoin=\"round\"\n\t\t>\n\t\t\t<path d=\"M12 5v14\" />\n\t\t\t<path d=\"M5 12h14\" />\n\t\t</svg>\n\t);\n}\n\nfunction createInitialArrayValue(config: ArrayElementsProps): unknown[] | undefined {\n\tconst formValue = getValueAtPath(config.initialFormValues ?? {}, config.name);\n\tconst configuredRows = [formValue, config.defaultValue].find(Array.isArray);\n\tconst scalar = usesScalarArrayItem(config, config.elements);\n\tconst rows = seedArrayRows(\n\t\tconfig,\n\t\tconfiguredRows?.map((row) => structuredClone(row)),\n\t\tscalar,\n\t);\n\treturn rows.length || configuredRows ? rows : undefined;\n}\n\n/**\n * One row of the array, as `MapItems` receives it.\n *\n * @remarks\n * `index` is part of the row because the row's field names (`contacts.0.role`) and its remove label\n * are built from it, and `config` and `engine` because the row callback runs once per item. A row whose\n * index, config or engine changes is a new object under the same key, so the renderer patches its nodes\n * in place; an unchanged row stays the same object and is skipped.\n */\ninterface ArrayRow {\n\treadonly id: string;\n\treadonly index: number;\n\treadonly config: ArrayElementsProps;\n\treadonly engine?: FormEngine;\n}\n\ninterface ArrayContentProps {\n\tconfig: ArrayElementsProps;\n\trows: State<readonly ArrayRow[]>;\n\tinitialValues: Record<string, unknown>;\n\trenderValues: Record<string, unknown>;\n\tfieldError?: string;\n}\n\n/**\n * @remarks\n * The error region is a controlled `RuiFieldError`: no `rui-field` wraps the array to fill it, so the\n * array passes its message as `error`. Its `id` is what the owning fieldset's `aria-describedby` points\n * at while the array has an error.\n *\n * A disabled array, authored or by a constraint, renders its rows and its add\n * and remove buttons disabled, and its rows get the required marker as a\n * fieldset's children do (`withContainerState`).\n */\nfunction arrayErrorId(config: ArrayElementsProps): string {\n\treturn `${config.instanceId ?? config.id ?? config.name}-error`;\n}\n\nfunction renderArrayContent({ config, rows, initialValues, renderValues, fieldError }: ArrayContentProps) {\n\tconst count = computed(() => rows.get().length);\n\tconst maxItems = config.maxItems;\n\tconst disabled = config.disabled === true;\n\n\treturn (\n\t\t<div class=\"se-form-array\">\n\t\t\t{computed(() =>\n\t\t\t\tcount.get() === 0 ? (\n\t\t\t\t\t<p class=\"se-form-array__empty\">{config.emptyStateMessage || 'No items added yet'}</p>\n\t\t\t\t) : null,\n\t\t\t)}\n\t\t\t<MapItems each={rows}>\n\t\t\t\t{({ id, index, config, engine }) => {\n\t\t\t\t\tconst removeLabel = config.removeButtonText || 'Remove item';\n\t\t\t\t\tconst disabled = config.disabled === true;\n\t\t\t\t\tconst elements = withContainerState(config, config.elements);\n\t\t\t\t\tconst minItems = config.minItems ?? 0;\n\t\t\t\t\tconst isSingleField = usesScalarArrayItem(config, config.elements);\n\t\t\t\t\tconst scope = arrayItemScope(config.name, index, id, {\n\t\t\t\t\t\tscalar: isSingleField,\n\t\t\t\t\t\tparentInstanceId: config.instanceId,\n\t\t\t\t\t});\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div class=\"se-form-array__item\" key={id} data-se-row-id={id}>\n\t\t\t\t\t\t\t<ChildGrid elements={config.elements} engine={engine} class=\"se-form-array__fields\">\n\t\t\t\t\t\t\t\t<FormElements\n\t\t\t\t\t\t\t\t\telements={elements}\n\t\t\t\t\t\t\t\t\tengine={engine}\n\t\t\t\t\t\t\t\t\tinitialValues={initialValues}\n\t\t\t\t\t\t\t\t\tvalues={renderValues}\n\t\t\t\t\t\t\t\t\tnamePrefix={scope.namePrefix}\n\t\t\t\t\t\t\t\t\tnameStrategy={scope.nameStrategy}\n\t\t\t\t\t\t\t\t\tinstanceId={scope.instanceId}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ChildGrid>\n\t\t\t\t\t\t\t{computed(() =>\n\t\t\t\t\t\t\t\tcount.get() > minItems ? (\n\t\t\t\t\t\t\t\t\t<RuiButton\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tclass=\"se-form-array__remove\"\n\t\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tsquare\n\t\t\t\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\t\t\t\taria-label={`${removeLabel} ${index + 1}`}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<TrashIcon />\n\t\t\t\t\t\t\t\t\t</RuiButton>\n\t\t\t\t\t\t\t\t) : null,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t}}\n\t\t\t</MapItems>\n\t\t\t{computed(() =>\n\t\t\t\t!maxItems || count.get() < maxItems ? (\n\t\t\t\t\t<RuiButton type=\"button\" class=\"se-form-array__add\" variant=\"outline\" disabled={disabled}>\n\t\t\t\t\t\t<PlusIcon />\n\t\t\t\t\t\t{config.addButtonText || 'Add item'}\n\t\t\t\t\t</RuiButton>\n\t\t\t\t) : null,\n\t\t\t)}\n\t\t\t<RuiFieldError id={arrayErrorId(config)} error={fieldError ?? ''} />\n\t\t</div>\n\t);\n}\n\n@customElement('se-form-array')\nexport class SeFormArray extends RadiantElement {\n\tdeclare readonly [JSX_PROPS]?: { config: ArrayElementsProps };\n\n\t@prop({ type: Object }) config!: ArrayElementsProps;\n\n\t@state private engine?: FormEngine;\n\tprivate container?: FormStateContainer;\n\tprivate unsubscribeContainer?: () => void;\n\tprivate formatIssue?: FormIssueFormatter;\n\tprivate preservedHydratedContainer = false;\n\tprivate readonly rows = createState<readonly ArrayRow[]>([]);\n\tprivate viewHoldsServerRows = false;\n\n\t@state private fieldError?: string;\n\n\t/**\n\t * Follows the form instance's container, which a new config or engine replaces.\n\t *\n\t * @remarks\n\t * The rows come from the container's `rowIds`, so they never get out of step with its values, and the\n\t * array's own error is the container's error at the array's path: no `rui-field` wraps the array to\n\t * present it, and `rui-form` ignores errors it has no control for.\n\t */\n\t@onContextUpdate({ context: formInstanceContext, requestUpdate: false })\n\tonFormInstance(value: FormInstanceContextValue | undefined): void {\n\t\tthis.formatIssue = value?.formatIssue;\n\t\tconst container = value?.runtime?.container;\n\t\tif (container !== this.container) {\n\t\t\tthis.unsubscribeContainer?.();\n\t\t\tthis.container = container;\n\t\t\tthis.unsubscribeContainer = this.container?.subscribe(() => this.syncFromContainer());\n\t\t}\n\t\tthis.syncFromContainer();\n\t}\n\n\t/**\n\t * Follows the engine the enclosing renderer publishes, including one bound after this host connected.\n\t *\n\t * @remarks The rows carry the engine they render with, so an engine that arrives rebuilds them.\n\t */\n\t@onContextUpdate({ context: formEngineContext, select: (context) => context?.engine, requestUpdate: false })\n\tonRendererEngine(engine: FormEngine | undefined): void {\n\t\tif (!engine || this.engine === engine) return;\n\t\tthis.engine = engine;\n\t\tthis.syncFromContainer();\n\t}\n\n\t/** Takes the rows and the array's own error from the container's current snapshot. */\n\tprivate syncFromContainer(): void {\n\t\tconst { container, config } = this;\n\t\tif (!container || !config?.name) return;\n\t\tconst snapshot = container.getSnapshot();\n\t\tconst issue = selectFieldState(snapshot, config.name).error;\n\t\tthis.fieldError = issue && issueText(issue, config.name, this.formatIssue);\n\t\tthis.describeGroup();\n\t\tthis.setRows(snapshot.rowIds[config.name] ?? []);\n\t}\n\n\t/**\n\t * @remarks\n\t * The fieldset is rendered by `FormArrayElements`, outside this host's view, so its\n\t * `aria-describedby` is written here, only while the error region has text.\n\t */\n\tprivate describeGroup(): void {\n\t\tconst group = this.parentElement;\n\t\tif (!group?.matches('fieldset') || !this.config) return;\n\t\tif (this.fieldError) group.setAttribute('aria-describedby', arrayErrorId(this.config));\n\t\telse group.removeAttribute('aria-describedby');\n\t}\n\n\tprivate initialArrayValue(): unknown[] | undefined {\n\t\treturn createInitialArrayValue(this.config);\n\t}\n\n\tprivate currentValues(): Record<string, unknown> {\n\t\treturn this.container?.getSnapshot().values ?? this.config.initialFormValues ?? {};\n\t}\n\n\tprivate rowInitialValues(): Record<string, unknown> {\n\t\tconst values = structuredClone(this.config.initialFormValues ?? {});\n\t\tconst arrayValue = this.initialArrayValue();\n\t\tif (arrayValue) setValueAtPath(values, this.config.name, arrayValue);\n\t\treturn values;\n\t}\n\n\t/**\n\t * @remarks\n\t * Read from the renderer's context (see {@link onRendererEngine}). A host that is not connected is\n\t * being rendered by the owning render, which is the only place its engine can come from.\n\t */\n\tprivate resolveEngine(): FormEngine | undefined {\n\t\treturn this.engine ?? (this.isConnected ? undefined : resolveFormEngine(this));\n\t}\n\n\t/** The ids the server rendered, until the container answers with its own, which are the same. */\n\tprivate get ids(): readonly string[] {\n\t\treturn this.container?.getSnapshot().rowIds[this.config.name] ?? this.config.ssrRowIds ?? [];\n\t}\n\n\t/**\n\t * Whether the first hydrated render places the server rows through `this.slotted`.\n\t *\n\t * @remarks Placing the slotted nodes keeps the server container, so its child controls upgrade against the server rows. Later updates render the current keyed rows normally.\n\t */\n\tprivate preserveHydratedContainer(): boolean {\n\t\tif (this.preservedHydratedContainer || !this.isConnected || !this.isServerRendered) return false;\n\t\tthis.preservedHydratedContainer = this.slotted !== null;\n\t\tthis.viewHoldsServerRows = this.preservedHydratedContainer;\n\t\treturn this.preservedHydratedContainer;\n\t}\n\n\tprivate renderedIds(): string[] {\n\t\treturn peek(this.rows).map(({ id }) => id);\n\t}\n\n\t/**\n\t * Publishes the row ids to the list signal.\n\t *\n\t * @remarks\n\t * A row whose id, index, config and engine are unchanged keeps its object, so `MapItems` skips it. The first\n\t * hydrated render places the server rows through `this.slotted` and has no list mounted, so the first\n\t * change of the ids after it renders the host once to mount the list in their place. An engine arriving\n\t * alone leaves the server rows in place; a config change re-runs `render`, which reads `config`, so the\n\t * list is mounted with the new config.\n\t */\n\tprivate setRows(ids: readonly string[]): void {\n\t\tconst { config } = this;\n\t\tconst engine = this.resolveEngine();\n\t\tconst current = peek(this.rows);\n\t\tconst known = new Map(current.map((row) => [row.id, row]));\n\t\tconst next = ids.map((id, index) => {\n\t\t\tconst row = known.get(id);\n\t\t\treturn row?.index === index && row.config === config && row.engine === engine\n\t\t\t\t? row\n\t\t\t\t: { id, index, config, engine };\n\t\t});\n\t\tif (next.length === current.length && next.every((row, index) => row === current[index])) return;\n\t\tthis.rows.set(next);\n\t\tconst sameShape = next.length === current.length && next.every((row, index) => row.id === current[index]?.id);\n\t\tif (this.viewHoldsServerRows && !sameShape) {\n\t\t\tthis.viewHoldsServerRows = false;\n\t\t\tthis.requestUpdate();\n\t\t}\n\t}\n\n\tprivate emptyItem(): unknown {\n\t\tconst { config } = this;\n\t\treturn createArrayRowDefault(config, usesScalarArrayItem(config, config.elements));\n\t}\n\n\tprotected override onConnected(): void {\n\t\tthis.engine ??= resolveFormEngine(this);\n\t\tthis.setRows(this.ids);\n\t}\n\n\toverride disconnectedCallback(): void {\n\t\tthis.engine = undefined;\n\t\tthis.unsubscribeContainer?.();\n\t\tthis.unsubscribeContainer = undefined;\n\t\tthis.container = undefined;\n\t\tthis.rows.set([]);\n\t\tsuper.disconnectedCallback();\n\t}\n\n\t/**\n\t * @remarks\n\t * The buttons are not wired in the view: the first hydrated render adopts server markup that carries no handlers,\n\t * so the host listens for them. `closest('se-form-array')` must be this host, or a nested array's buttons would\n\t * also add to or remove from the outer array.\n\t */\n\t@onEvent({ type: 'click', selector: '.se-form-array__add' })\n\tonAdd(event: Event): void {\n\t\tif (!this.ownsControl(event) || !this.container) return;\n\t\tconst maxItems = this.config.maxItems;\n\t\tif (maxItems && this.ids.length >= maxItems) {\n\t\t\treturn;\n\t\t}\n\t\tthis.container.fieldArray(this.config.name).append(this.emptyItem());\n\t}\n\n\t@onEvent({ type: 'click', selector: '.se-form-array__remove' })\n\tonRemove(event: Event): void {\n\t\tif (!this.ownsControl(event) || !this.container) return;\n\t\tconst id = (event.target as Element).closest('[data-se-row-id]')?.getAttribute('data-se-row-id');\n\t\tif (this.ids.length <= (this.config.minItems ?? 0)) {\n\t\t\treturn;\n\t\t}\n\t\tconst index = this.ids.indexOf(id ?? '');\n\t\tif (index >= 0) this.container.fieldArray(this.config.name).remove(index);\n\t}\n\n\tprivate ownsControl(event: Event): boolean {\n\t\treturn (event.target as Element | null)?.closest('se-form-array') === this;\n\t}\n\n\toverride render(): JsxRenderable {\n\t\tconst config = this.config;\n\t\tif (!config) {\n\t\t\treturn null;\n\t\t}\n\t\tif (this.preserveHydratedContainer()) return this.slotted;\n\t\tconst engine = this.resolveEngine();\n\t\tif (!engine && !this.isConnected) return this.slotted;\n\t\tif (!engine && this.renderedIds().length > 0) return null;\n\t\tthis.setRows(this.renderedIds());\n\t\tconst renderValues = this.currentValues();\n\t\tconst initialValues = this.rowInitialValues();\n\n\t\treturn renderArrayContent({\n\t\t\tconfig,\n\t\t\trows: this.rows,\n\t\t\tinitialValues,\n\t\t\trenderValues,\n\t\t\tfieldError: this.fieldError,\n\t\t});\n\t}\n}\n\n/**\n * @remarks\n * The server rows are rendered here and handed to `se-form-array` as children: the host's own view is serialized after\n * the owning render's engine scope has closed, so it cannot render rows itself on the server. The host places them with\n * `this.slotted`, which lets Radiant mark their position instead of serializing a second copy in a slotted template.\n */\nexport function FormArrayElements(config: ArrayElementsProps) {\n\tconst { ssrInitialRows: _ssrInitialRows, ssrRowIds, initialFormValues, ...fieldConfig } = config;\n\tconst engine = resolveFormEngine();\n\tconst fieldHost = mergeFieldGridHost(fieldConfig.grid, fieldConfig.style, engine?.getLayout().id);\n\tconst initialValues = structuredClone(initialFormValues ?? {});\n\tconst initialRows = createInitialArrayValue({ ...fieldConfig, initialFormValues });\n\tif (initialRows) setValueAtPath(initialValues, fieldConfig.name, initialRows);\n\tconst arrayConfig = {\n\t\t...fieldConfig,\n\t\tssrInitialRows: initialRows ?? [],\n\t\tssrRowIds: ssrRowIds ?? [],\n\t\tinitialFormValues,\n\t};\n\tconst children = engine\n\t\t? renderArrayContent({\n\t\t\t\tconfig: arrayConfig,\n\t\t\t\trows: createState<readonly ArrayRow[]>(\n\t\t\t\t\tarrayConfig.ssrRowIds.map((id, index) => ({ id, index, config: arrayConfig, engine })),\n\t\t\t\t),\n\t\t\t\tinitialValues,\n\t\t\t\trenderValues: initialValues,\n\t\t\t})\n\t\t: null;\n\n\treturn (\n\t\t<fieldset\n\t\t\tclasses={['se-form-field', GRID_ITEM_CLASS, 'se-form-array-field', fieldConfig.className]}\n\t\t\taria-label={fieldConfig.label ? undefined : fieldConfig.name}\n\t\t\tdata-se-theme={fieldHost.themeId}\n\t\t\tstyle={fieldHost.style}\n\t\t\t{...getAppearanceAttributes(fieldConfig.appearance)}\n\t\t>\n\t\t\t{fieldConfig.label ? (\n\t\t\t\t<legend class=\"se-form-array-field__label\">\n\t\t\t\t\t{fieldConfig.label}\n\t\t\t\t\t<RequiredMarker required={isFieldRequired(fieldConfig.rules) || isRenderedRequired(fieldConfig)} />\n\t\t\t\t</legend>\n\t\t\t) : null}\n\t\t\t{fieldConfig.description ? <p class=\"se-form-array-field__description\">{fieldConfig.description}</p> : null}\n\t\t\t<SeFormArray config={arrayConfig}>{children}</SeFormArray>\n\t\t</fieldset>\n\t);\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'se-form-array': SeFormArray;\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,eAAe,SAAS,MAAM,gBAAgB,aAAa;AACpE,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAE9B,SAAS,gBAAgB;AACzB,SAAS,UAAU,MAAM,SAAS,mBAA+B;AAKjE;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAGM;AAMP,SAAS,iBAAiB,+BAA+B;AAIvD,SAUC,KAVD;AAFF,SAAS,YAAY;AACpB,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAM;AAAA,MACN,SAAQ;AAAA,MACR,eAAY;AAAA,MACZ,MAAK;AAAA,MACL,QAAO;AAAA,MACP,gBAAa;AAAA,MACb,kBAAe;AAAA,MACf,mBAAgB;AAAA,MAEhB;AAAA,4BAAC,UAAK,GAAE,WAAU;AAAA,QAClB,oBAAC,UAAK,GAAE,4CAA2C;AAAA,QACnD,oBAAC,UAAK,GAAE,0CAAyC;AAAA,QACjD,oBAAC,UAAK,GAAE,YAAW;AAAA,QACnB,oBAAC,UAAK,GAAE,YAAW;AAAA;AAAA;AAAA,EACpB;AAEF;AAEA,SAAS,WAAW;AACnB,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAM;AAAA,MACN,SAAQ;AAAA,MACR,eAAY;AAAA,MACZ,MAAK;AAAA,MACL,QAAO;AAAA,MACP,gBAAa;AAAA,MACb,kBAAe;AAAA,MACf,mBAAgB;AAAA,MAEhB;AAAA,4B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@ -0,0 +1,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormElements
|
|
3
|
+
} from "./chunk-SO67TWXH.js";
|
|
4
|
+
import {
|
|
5
|
+
ChildGrid
|
|
6
|
+
} from "./chunk-R37KBQV6.js";
|
|
7
|
+
import {
|
|
8
|
+
mergeFieldGridHost
|
|
9
|
+
} from "./chunk-6ALXWOXJ.js";
|
|
10
|
+
import {
|
|
11
|
+
withContainerState
|
|
12
|
+
} from "./chunk-T5UN2BZP.js";
|
|
13
|
+
import {
|
|
14
|
+
resolveFormEngine
|
|
15
|
+
} from "./chunk-SJ44RSNG.js";
|
|
16
|
+
|
|
17
|
+
// src/elements/inputs/form-fieldset.tsx
|
|
18
|
+
import { GRID_ITEM_CLASS, GRID_SUBGRID_CLASS, elementIsSubgrid, getAppearanceAttributes } from "@schema-engine/layout";
|
|
19
|
+
import { objectFieldScope } from "@schema-engine/forms";
|
|
20
|
+
import { jsx, jsxs } from "@ecopages/jsx/jsx-runtime";
|
|
21
|
+
function idToken(identity) {
|
|
22
|
+
return identity.replace(/[^A-Za-z0-9-]/gu, (character) => `_${character.codePointAt(0)?.toString(16)}_`);
|
|
23
|
+
}
|
|
24
|
+
function FormFieldSet(config) {
|
|
25
|
+
const scope = objectFieldScope(config.name, config);
|
|
26
|
+
const fieldHost = mergeFieldGridHost(config.grid, config.style);
|
|
27
|
+
const elements = withContainerState(config, config.elements);
|
|
28
|
+
const fields = /* @__PURE__ */ jsx(
|
|
29
|
+
FormElements,
|
|
30
|
+
{
|
|
31
|
+
elements,
|
|
32
|
+
engine: resolveFormEngine(),
|
|
33
|
+
namePrefix: scope.namePrefix,
|
|
34
|
+
instanceId: scope.instanceId
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
const description = config.description ? /* @__PURE__ */ jsx("p", { class: "se-fieldset__description", children: config.description }) : null;
|
|
38
|
+
if (elementIsSubgrid(config)) {
|
|
39
|
+
const legendId = `${idToken(config.id ?? config.name)}-legend`;
|
|
40
|
+
return /* @__PURE__ */ jsxs(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
classes: ["se-form-field", GRID_ITEM_CLASS, GRID_SUBGRID_CLASS, "se-fieldset", config.className],
|
|
44
|
+
role: "group",
|
|
45
|
+
"aria-labelledby": config.legend ? legendId : void 0,
|
|
46
|
+
"data-se-theme": fieldHost.themeId,
|
|
47
|
+
style: fieldHost.style,
|
|
48
|
+
...getAppearanceAttributes(config.appearance),
|
|
49
|
+
children: [
|
|
50
|
+
config.legend ? /* @__PURE__ */ jsx("div", { class: "se-fieldset__legend", id: legendId, children: config.legend }) : null,
|
|
51
|
+
description,
|
|
52
|
+
/* @__PURE__ */ jsx(ChildGrid, { subgrid: true, class: "se-fieldset__fields", children: fields })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
return /* @__PURE__ */ jsxs(
|
|
58
|
+
"fieldset",
|
|
59
|
+
{
|
|
60
|
+
classes: ["se-form-field", GRID_ITEM_CLASS, "se-fieldset", config.className],
|
|
61
|
+
"data-se-theme": fieldHost.themeId,
|
|
62
|
+
style: fieldHost.style,
|
|
63
|
+
...getAppearanceAttributes(config.appearance),
|
|
64
|
+
children: [
|
|
65
|
+
config.legend ? /* @__PURE__ */ jsx("legend", { class: "se-fieldset__legend", children: config.legend }) : null,
|
|
66
|
+
description,
|
|
67
|
+
/* @__PURE__ */ jsx(ChildGrid, { elements: config.elements, class: "se-fieldset__fields", children: fields })
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
FormFieldSet
|
|
75
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/elements/inputs/form-fieldset.tsx"],
|
|
4
|
+
"sourcesContent": ["import { GRID_ITEM_CLASS, GRID_SUBGRID_CLASS, elementIsSubgrid, getAppearanceAttributes } from '@schema-engine/layout';\nimport { FormElements } from '@/components/internals/form-elements';\nimport { mergeFieldGridHost } from '@/hooks/grid-styles';\nimport { ChildGrid } from '@/components/internals/child-grid';\nimport { resolveFormEngine } from '@/contexts/resolve-form-engine';\nimport type { FieldSetProps } from './form-fieldset.types';\nimport { objectFieldScope } from '@schema-engine/forms';\nimport { withContainerState } from '@/lib/field-rules';\nimport './form-fieldset.css';\n\n/**\n * The element's identity as one id token, the same on the server and the client.\n *\n * @remarks\n * `aria-labelledby` is a list of ids split at whitespace, so a name such as `Mailing address` would point at two\n * ids that do not exist. Every character outside `[A-Za-z0-9-]`, `_` included, becomes `_<code point in hex>_`, so\n * the result has no whitespace and two different names never give the same token. It is derived from the\n * element alone, never random, so server markup and hydration agree. A subgrid fieldset's legend id is built\n * from it.\n */\nfunction idToken(identity: string): string {\n\treturn identity.replace(/[^A-Za-z0-9-]/gu, (character) => `_${character.codePointAt(0)?.toString(16)}_`);\n}\n\n/**\n * @remarks\n * A disabled fieldset, authored or by a constraint, renders its children\n * disabled. A fieldset with a matching `require` constraint, or inside one,\n * renders them with their required marker. Both are what the constraint hosts\n * compose for the children afterwards, and each `se-field` then applies the live rule. A\n * fieldset whose only required source is its own required rule passes nothing\n * down, because no constraint host governs a field without a constraint wrapper\n * around it. Arrays pass both to their rows the same way.\n *\n * With `grid.subgrid` it renders a `div` with `role=\"group\"` and `aria-labelledby` its legend instead of a\n * `<fieldset>`: Chromium lays a fieldset's content out in an anonymous box that is not a grid item, so it cannot\n * be a subgrid. `display: contents` on a fieldset was rejected because engines expose its semantics\n * inconsistently; a role on a real box reads the same everywhere. Nothing relies on the native `disabled`, since\n * the state above goes to the children. The legend id comes from {@link idToken}. The group keeps the fieldset's\n * border and padding, so the legend is a heading row rather than a gap in the border, and the first and last\n * columns are inset by them. Without `grid.subgrid` it stays a native `<fieldset>`.\n */\nexport function FormFieldSet(config: FieldSetProps) {\n\tconst scope = objectFieldScope(config.name, config);\n\tconst fieldHost = mergeFieldGridHost(config.grid, config.style);\n\tconst elements = withContainerState(config, config.elements);\n\tconst fields = (\n\t\t<FormElements\n\t\t\telements={elements}\n\t\t\tengine={resolveFormEngine()}\n\t\t\tnamePrefix={scope.namePrefix}\n\t\t\tinstanceId={scope.instanceId}\n\t\t/>\n\t);\n\tconst description = config.description ? <p class=\"se-fieldset__description\">{config.description}</p> : null;\n\n\tif (elementIsSubgrid(config)) {\n\t\tconst legendId = `${idToken(config.id ?? config.name)}-legend`;\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclasses={['se-form-field', GRID_ITEM_CLASS, GRID_SUBGRID_CLASS, 'se-fieldset', config.className]}\n\t\t\t\t// oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- Chromium cannot make a fieldset a subgrid, see remarks\n\t\t\t\trole=\"group\"\n\t\t\t\taria-labelledby={config.legend ? legendId : undefined}\n\t\t\t\tdata-se-theme={fieldHost.themeId}\n\t\t\t\tstyle={fieldHost.style}\n\t\t\t\t{...getAppearanceAttributes(config.appearance)}\n\t\t\t>\n\t\t\t\t{config.legend ? (\n\t\t\t\t\t<div class=\"se-fieldset__legend\" id={legendId}>\n\t\t\t\t\t\t{config.legend}\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t\t{description}\n\t\t\t\t<ChildGrid subgrid class=\"se-fieldset__fields\">\n\t\t\t\t\t{fields}\n\t\t\t\t</ChildGrid>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<fieldset\n\t\t\tclasses={['se-form-field', GRID_ITEM_CLASS, 'se-fieldset', config.className]}\n\t\t\tdata-se-theme={fieldHost.themeId}\n\t\t\tstyle={fieldHost.style}\n\t\t\t{...getAppearanceAttributes(config.appearance)}\n\t\t>\n\t\t\t{config.legend ? <legend class=\"se-fieldset__legend\">{config.legend}</legend> : null}\n\t\t\t{description}\n\t\t\t<ChildGrid elements={config.elements} class=\"se-fieldset__fields\">\n\t\t\t\t{fields}\n\t\t\t</ChildGrid>\n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AAA,MACA,SAAS,CAAC,iBAAiB,iBAAiB,eAAe,OAAO,SAAS;AAAA,MAC3E,iBAAe,UAAU;AAAA,MACzB,OAAO,UAAU;AAAA,MAChB,GAAG,wBAAwB,OAAO,UAAU;AAAA,MAE5C;AAAA,eAAO,SAAS,oBAAC,YAAO,OAAM,uBAAuB,iBAAO,QAAO,IAAY;AAAA,QAC/E;AAAA,QACD,oBAAC,aAAU,UAAU,OAAO,UAAU,OAAM,uBAC1C,kBACF;AAAA;AAAA;AAAA,EACD;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deriveFormSteps,
|
|
3
3
|
deriveInitialInstance
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KZR4H5BT.js";
|
|
5
5
|
import {
|
|
6
6
|
formInstanceContext
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OPO7RVCM.js";
|
|
8
8
|
import {
|
|
9
9
|
__decorateElement,
|
|
10
10
|
__decoratorStart,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/elements/inputs/form-radio.registration.ts"],
|
|
4
|
+
"sourcesContent": ["import { radiantElements } from '../radiant-elements';\n\nexport const RadioElementRegistration = radiantElements.get('radio');\n"],
|
|
5
|
+
"mappings": ";;;;;AAEO,IAAM,2BAA2B,gBAAgB,IAAI,OAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StepHeaderBlock
|
|
3
|
+
} from "./chunk-DX3WYPBL.js";
|
|
4
|
+
import {
|
|
5
|
+
StepIndicatorsBlock
|
|
6
|
+
} from "./chunk-KPUUZZBP.js";
|
|
1
7
|
import {
|
|
2
8
|
WizardActionsBlock
|
|
3
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-M32DZQE5.js";
|
|
4
10
|
import {
|
|
5
11
|
FormActionsBlock
|
|
6
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ENF4DAVV.js";
|
|
7
13
|
import {
|
|
8
14
|
MinimalProgressBlock
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
StepHeaderBlock
|
|
12
|
-
} from "./chunk-RY2I6GBB.js";
|
|
13
|
-
import {
|
|
14
|
-
StepIndicatorsBlock
|
|
15
|
-
} from "./chunk-QPLWIKBU.js";
|
|
15
|
+
} from "./chunk-N3XCKR6G.js";
|
|
16
16
|
import {
|
|
17
17
|
CardShell,
|
|
18
18
|
HeroShell,
|
|
19
19
|
SidebarShell,
|
|
20
20
|
SplitScreenShell,
|
|
21
21
|
StackShell
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-7D57PLC2.js";
|
|
23
23
|
|
|
24
24
|
// src/registries/builder-registry.ts
|
|
25
25
|
import {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/registries/builder-registry.ts", "../src/recipes/bind-recipes.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n\tcreateFormEngine,\n\ttype CreateFormEngineOptions,\n\ttype ElementRegistrationConstraint,\n\ttype RecipeRegistrationConstraint,\n\ttype ActionRegistrationConstraint,\n} from '@schema-engine/forms';\nimport type { LayoutInput } from '@schema-engine/layout';\nimport { radiantRecipes } from '@/recipes/bind-recipes';\n\n/**\n * Factory for a Radiant form engine with canonical view recipes already bound.\n *\n * Radiant has no shadcn registry, so shells and step blocks ship in this\n * package. Specs remain in `@schema-engine/forms/recipes/built-in`. Register elements\n * explicitly; caller recipes are appended so same-`$type` overrides last-win.\n */\nexport function createRadiantFormEngine<\n\tconst TElements extends readonly ElementRegistrationConstraint[] = readonly [],\n\tconst TRecipes extends readonly RecipeRegistrationConstraint[] = readonly [],\n\tconst TActions extends readonly ActionRegistrationConstraint[] = readonly [],\n\tconst TLayout extends LayoutInput = Record<never, never>,\n>(options?: CreateFormEngineOptions<TElements, TRecipes, TActions, TLayout>) {\n\treturn createFormEngine({\n\t\t...options,\n\t\trecipes: [...radiantRecipes, ...(options?.recipes ?? [])] as const,\n\t});\n}\n", "import { defineFormRecipe, type RecipeSlotSchemas, type RecipeSpec } from '@schema-engine/forms/recipes';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport {\n\tbareControlsSpec,\n\tcardSpec,\n\tcardWizardSpec,\n\theroBackgroundSpec,\n\theroWizardSpec,\n\tsidebarWizardSpec,\n\tsplitScreenSpec,\n\tsplitScreenWizardSpec,\n\twizardSpec,\n} from '@schema-engine/forms/recipes/built-in';\nimport {\n\tStepHeaderBlock,\n\tMinimalProgressBlock,\n\tStepIndicatorsBlock,\n\tWizardActionsBlock,\n\tFormActionsBlock,\n} from '@/components/blocks';\nimport { CardShell, HeroShell, SidebarShell, SplitScreenShell, StackShell } from '@/components/shells';\nimport type { RadiantRecipePayload } from './types';\n\n/**\n * Binds a recipe spec to Radiant components, requiring exactly the slots the spec declares.\n */\nexport function defineRecipe<\n\tconst TType extends string,\n\tTSlots extends RecipeSlotSchemas,\n\tTSchema extends StandardSchemaV1,\n>(spec: RecipeSpec<TType, TSchema, TSlots>, payload: RadiantRecipePayload<TSlots>) {\n\treturn defineFormRecipe(spec, payload);\n}\n\nexport const CardRecipe = defineRecipe(cardSpec, {\n\tshell: CardShell,\n\tslots: { header: StepHeaderBlock, actions: FormActionsBlock },\n});\nexport const SplitScreenRecipe = defineRecipe(splitScreenSpec, {\n\tshell: SplitScreenShell,\n\tslots: { actions: FormActionsBlock },\n});\nexport const HeroBackgroundRecipe = defineRecipe(heroBackgroundSpec, {\n\tshell: HeroShell,\n\tslots: { header: StepHeaderBlock, actions: FormActionsBlock },\n});\nexport const BareControlsRecipe = defineRecipe(bareControlsSpec, {\n\tshell: StackShell,\n\tslots: { actions: WizardActionsBlock },\n});\nexport const WizardRecipe = defineRecipe(wizardSpec, {\n\tshell: StackShell,\n\tslots: { header: StepHeaderBlock, progress: StepIndicatorsBlock, actions: WizardActionsBlock },\n});\nexport const SidebarWizardRecipe = defineRecipe(sidebarWizardSpec, {\n\tshell: SidebarShell,\n\tslots: { header: StepHeaderBlock, progress: StepIndicatorsBlock, actions: WizardActionsBlock },\n});\nexport const CardWizardRecipe = defineRecipe(cardWizardSpec, {\n\tshell: CardShell,\n\tslots: { header: StepHeaderBlock, progress: MinimalProgressBlock, actions: WizardActionsBlock },\n});\nexport const HeroWizardRecipe = defineRecipe(heroWizardSpec, {\n\tshell: HeroShell,\n\tslots: { header: StepHeaderBlock, progress: MinimalProgressBlock, actions: WizardActionsBlock },\n});\nexport const SplitScreenWizardRecipe = defineRecipe(splitScreenWizardSpec, {\n\tshell: SplitScreenShell,\n\tslots: { header: StepHeaderBlock, progress: StepIndicatorsBlock, actions: WizardActionsBlock },\n});\n\nexport const radiantRecipes = [\n\tCardRecipe,\n\tSplitScreenRecipe,\n\tHeroBackgroundRecipe,\n\tBareControlsRecipe,\n\tWizardRecipe,\n\tSidebarWizardRecipe,\n\tCardWizardRecipe,\n\tHeroWizardRecipe,\n\tSplitScreenWizardRecipe,\n] as const;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EACC;AAAA,OAKM;;;ACNP,SAAS,wBAAiE;AAE1E;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAcA,SAAS,aAId,MAA0C,SAAuC;AAClF,SAAO,iBAAiB,MAAM,OAAO;AACtC;AAEO,IAAM,aAAa,aAAa,UAAU;AAAA,EAChD,OAAO;AAAA,EACP,OAAO,EAAE,QAAQ,iBAAiB,SAAS,iBAAiB;AAC7D,CAAC;AACM,IAAM,oBAAoB,aAAa,iBAAiB;AAAA,EAC9D,OAAO;AAAA,EACP,OAAO,EAA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
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createRadiantPhoneValidationRegistration
|
|
3
|
+
} from "./chunk-VJH7TDR6.js";
|
|
4
|
+
import {
|
|
5
|
+
FormPhoneInput
|
|
6
|
+
} from "./chunk-JADS4IJA.js";
|
|
7
|
+
import {
|
|
8
|
+
FormRadio
|
|
9
|
+
} from "./chunk-4FT7DVBC.js";
|
|
10
|
+
import {
|
|
11
|
+
FormSelect
|
|
12
|
+
} from "./chunk-4RQ7A5G7.js";
|
|
13
|
+
import {
|
|
14
|
+
FormSlider
|
|
15
|
+
} from "./chunk-WAMAPNQE.js";
|
|
16
|
+
import {
|
|
17
|
+
FormSwitch
|
|
18
|
+
} from "./chunk-GIBWCGYU.js";
|
|
19
|
+
import {
|
|
20
|
+
FormTextarea
|
|
21
|
+
} from "./chunk-6GFJSZQB.js";
|
|
22
|
+
import {
|
|
23
|
+
FormSubmissionAlert
|
|
24
|
+
} from "./chunk-UTOM23GQ.js";
|
|
25
|
+
import {
|
|
26
|
+
SubmitButton
|
|
27
|
+
} from "./chunk-A5MWHHAZ.js";
|
|
28
|
+
import {
|
|
29
|
+
FormCheckbox
|
|
30
|
+
} from "./chunk-FJJ5BYRC.js";
|
|
31
|
+
import {
|
|
32
|
+
FormCombobox
|
|
33
|
+
} from "./chunk-RIUOK6NR.js";
|
|
34
|
+
import {
|
|
35
|
+
FormDropZone
|
|
36
|
+
} from "./chunk-AC4UWDNH.js";
|
|
37
|
+
import {
|
|
38
|
+
FormFieldSet
|
|
39
|
+
} from "./chunk-B6EUQ4D5.js";
|
|
40
|
+
import {
|
|
41
|
+
FormInputOTP
|
|
42
|
+
} from "./chunk-62POCW7X.js";
|
|
43
|
+
import {
|
|
44
|
+
FormInput
|
|
45
|
+
} from "./chunk-SRTT3DHU.js";
|
|
46
|
+
import {
|
|
47
|
+
FormMaskedInput
|
|
48
|
+
} from "./chunk-ODZE43JO.js";
|
|
49
|
+
import {
|
|
50
|
+
FormNumber
|
|
51
|
+
} from "./chunk-JKVODGP7.js";
|
|
52
|
+
import {
|
|
53
|
+
FormArrayElements
|
|
54
|
+
} from "./chunk-ADJAHDCI.js";
|
|
55
|
+
import {
|
|
56
|
+
FormCheckboxGroup
|
|
57
|
+
} from "./chunk-R4Z4U75R.js";
|
|
58
|
+
|
|
59
|
+
// src/elements/radiant-elements.ts
|
|
60
|
+
import { bindRegistry } from "@schema-engine/registry";
|
|
61
|
+
import { defaultElementContracts } from "@schema-engine/forms/default-elements";
|
|
62
|
+
var radiantElements = bindRegistry(defaultElementContracts, {
|
|
63
|
+
submit: { render: SubmitButton },
|
|
64
|
+
"submission-alert": { render: FormSubmissionAlert },
|
|
65
|
+
arrayElements: { render: FormArrayElements },
|
|
66
|
+
"checkbox-group": { render: FormCheckboxGroup },
|
|
67
|
+
checkbox: { render: FormCheckbox },
|
|
68
|
+
combobox: { render: FormCombobox },
|
|
69
|
+
"drop-zone": { render: FormDropZone },
|
|
70
|
+
fieldSet: { render: FormFieldSet },
|
|
71
|
+
"input-otp": { render: FormInputOTP },
|
|
72
|
+
input: { render: FormInput },
|
|
73
|
+
"masked-input": { render: FormMaskedInput },
|
|
74
|
+
number: { render: FormNumber },
|
|
75
|
+
"phone-input": { render: FormPhoneInput, validations: [createRadiantPhoneValidationRegistration()] },
|
|
76
|
+
radio: { render: FormRadio },
|
|
77
|
+
select: { render: FormSelect },
|
|
78
|
+
slider: { render: FormSlider },
|
|
79
|
+
switch: { render: FormSwitch },
|
|
80
|
+
textarea: { render: FormTextarea }
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
radiantElements
|
|
85
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/elements/radiant-elements.ts"],
|
|
4
|
+
"sourcesContent": ["import { bindRegistry } from '@schema-engine/registry';\nimport { defaultElementContracts, type ElementBindings } from '@schema-engine/forms/default-elements';\nimport { createRadiantPhoneValidationRegistration } from '@/lib/phone-validation';\nimport { SubmitButton } from './actions/submit-button';\nimport { FormSubmissionAlert } from './content/form-submission-alert';\nimport { FormArrayElements } from './inputs/form-array-elements';\nimport { FormCheckboxGroup } from './inputs/form-checkbox-group';\nimport { FormCheckbox } from './inputs/form-checkbox';\nimport { FormCombobox } from './inputs/form-combobox';\nimport { FormDropZone } from './inputs/form-drop-zone';\nimport { FormFieldSet } from './inputs/form-fieldset';\nimport { FormInputOTP } from './inputs/form-input-otp';\nimport { FormInput } from './inputs/form-input';\nimport { FormMaskedInput } from './inputs/form-masked-input';\nimport { FormNumber } from './inputs/form-number';\nimport { FormPhoneInput } from './inputs/form-phone-input';\nimport { FormRadio } from './inputs/form-radio';\nimport { FormSelect } from './inputs/form-select';\nimport { FormSlider } from './inputs/form-slider';\nimport { FormSwitch } from './inputs/form-switch';\nimport { FormTextarea } from './inputs/form-textarea';\n\n/**\n * Every element of the package: the contracts of `@schema-engine/forms/default-elements` with the Radiant component of each.\n *\n * @remarks\n * The schema, metadata and value each element writes belong to its contract, shared with every other renderer. The\n * binding adds only the Radiant `render`, and the phone input's own `validations`. `bindRegistry` fails to compile, and\n * fails to build, when a contract has no binding here.\n */\nexport const radiantElements = bindRegistry(defaultElementContracts, {\n\tsubmit: { render: SubmitButton },\n\t'submission-alert': { render: FormSubmissionAlert },\n\tarrayElements: { render: FormArrayElements },\n\t'checkbox-group': { render: FormCheckboxGroup },\n\tcheckbox: { render: FormCheckbox },\n\tcombobox: { render: FormCombobox },\n\t'drop-zone': { render: FormDropZone },\n\tfieldSet: { render: FormFieldSet },\n\t'input-otp': { render: FormInputOTP },\n\tinput: { render: FormInput },\n\t'masked-input': { render: FormMaskedInput },\n\tnumber: { render: FormNumber },\n\t'phone-input': { render: FormPhoneInput, validations: [createRadiantPhoneValidationRegistration()] },\n\tradio: { render: FormRadio },\n\tselect: { render: FormSelect },\n\tslider: { render: FormSlider },\n\tswitch: { render: FormSwitch },\n\ttextarea: { render: FormTextarea },\n} satisfies ElementBindings<typeof defaultElementContracts>);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,+BAAqD;AA6BvD,IAAM,kBAAkB,aAAa,yBAAyB;AAAA,EACpE,QAAQ,EAAE,QAAQ,aAAa;AAAA,EAC/B,oBAAoB,EAAE,QAAQ,oBAAoB;AAAA,EAClD,eAAe,EAAE,QAAQ,kBAAkB;AAAA,EAC3C,kBAAkB,EAAE,QAAQ,kBAAkB;AAAA,EAC9C,UAAU,EAAE,QAAQ,aAAa;AAAA,EACjC,UAAU,EAAE,QAAQ,aAAa;AAAA,EACjC,aAAa,EAAE,QAAQ,aAAa;AAAA,EACpC,UAAU,EAAE,QAAQ,aAAa;AAAA,EACjC,aAAa,EAAE,QAAQ,aAAa;AAAA,EACpC,OAAO,EAAE,QAAQ,UAAU;AAAA,EAC3B,gBAAgB,EAAE,QAAQ,gBAAgB;AAAA,EAC1C,QAAQ,EAAE,QAAQ,WAAW;AAAA,EAC7B,eAAe,EAAE,QAAQ,gBAAgB,aAAa,CAAC,yCAAyC,CAAC,EAAE;AAAA,EACnG,OAAO,EAAE,QAAQ,UAAU;AAAA,EAC3B,QAAQ,EAAE,QAAQ,WAAW;AAAA,EAC7B,QAAQ,EAAE,QAAQ,WAAW;AAAA,EAC7B,QAAQ,EAAE,QAAQ,WAAW;AAAA,EAC7B,UAAU,EAAE,QAAQ,aAAa;AAClC,CAA2D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
deriveFormSteps,
|
|
3
3
|
deriveInitialInstance,
|
|
4
4
|
deriveNavigation
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KZR4H5BT.js";
|
|
6
6
|
import {
|
|
7
7
|
formInstanceContext
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OPO7RVCM.js";
|
|
9
9
|
import {
|
|
10
10
|
__decorateElement,
|
|
11
11
|
__decoratorStart,
|
|
@@ -17,8 +17,9 @@ function deriveFormSteps(config, instance) {
|
|
|
17
17
|
function deriveNavigation(config, instance) {
|
|
18
18
|
return createViewNavigation(instance.steps, instance.current, instance);
|
|
19
19
|
}
|
|
20
|
-
var initialSteps = (config) => config.steps.map(({ id }, index) => ({
|
|
20
|
+
var initialSteps = (config) => config.steps.map(({ id, title }, index) => ({
|
|
21
21
|
id,
|
|
22
|
+
title,
|
|
22
23
|
skipped: false,
|
|
23
24
|
visited: index === 0,
|
|
24
25
|
complete: false,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lib/instance-view.ts"],
|
|
4
|
+
"sourcesContent": ["import type { FormStepState, FormWizard, NormalizedFormConfig } from '@schema-engine/forms';\nimport {\n\tcreateViewNavigation,\n\tprojectViewSteps,\n\ttype ViewNavigation,\n\ttype ViewStep,\n} from '@schema-engine/forms/recipes';\nimport type { FormInstanceContextValue } from '@/contexts/form-instance-context';\n\n/** Serializable form chrome without field definitions, rules, or defaults. */\nexport interface FormMeta {\n\tid: string;\n\ttitle?: string;\n\tdescription?: string;\n\tsteps: { id: string; title?: string; description?: string }[];\n}\n\nexport function createFormMeta(config: NormalizedFormConfig): FormMeta {\n\treturn {\n\t\tid: config.id,\n\t\ttitle: config.title,\n\t\tdescription: config.description,\n\t\tsteps: config.steps.map(({ id, title, description }) => ({ id, title, description })),\n\t};\n}\n\n/**\n * Derives the steps that are not skipped from form metadata and the live instance state.\n *\n * @remarks\n * Recipe blocks read this instead of a prebuilt view model so SSR consumers can\n * resolve everything from serializable props plus the instance context, without\n * a separate view context whose provider publishes after children serialize.\n */\nexport function deriveFormSteps(config: FormMeta, instance: Pick<FormWizard, 'current' | 'steps'>): ViewStep[] {\n\treturn projectViewSteps(config.steps, instance.steps, instance.current);\n}\n\n/** The navigation a block reads: what can be reached from the current step, and the commands that move there. */\nexport function deriveNavigation(config: FormMeta, instance: FormWizard): ViewNavigation {\n\treturn createViewNavigation(instance.steps, instance.current, instance);\n}\n\n/** The steps before any runtime has them: none skipped, the first visited. */\nexport const initialSteps = (config: FormMeta): FormStepState[] =>\n\tconfig.steps.map(({ id, title }, index) => ({\n\t\tid,\n\t\ttitle,\n\t\tskipped: false,\n\t\tvisited: index === 0,\n\t\tcomplete: false,\n\t\tinvalid: false,\n\t\treachable: false,\n\t}));\n\n/**\n * Initial instance state derived from form metadata.\n *\n * @remarks\n * SSR consumers construct before any context provider publishes, so block hosts\n * fall back to this (the first step, untouched step states, inert navigation) and the\n * live `formInstanceContext` takes over once hydration resolves.\n */\nexport function deriveInitialInstance(config: FormMeta): FormInstanceContextValue {\n\treturn {\n\t\tcurrent: config.steps[0]?.id ?? '',\n\t\tsteps: initialSteps(config),\n\t\tnavigating: false,\n\t\tisWizard: false,\n\t\tmeta: config,\n\t\tnext: async () => 'refused',\n\t\tback: async () => 'refused',\n\t\tgoTo: async () => 'refused',\n\t\tsubmission: { status: 'idle', failures: [], submitCount: 0 },\n\t\truntime: undefined,\n\t\tformatIssue: undefined,\n\t};\n}\n"],
|
|
5
|
+
"mappings": ";AACA;AAAA,EACC;AAAA,EACA;AAAA,OAGM;AAWA,SAAS,eAAe,QAAwC;AACtE,SAAO;AAAA,IACN,IAAI,OAAO;AAAA,IACX,OAAO,OAAO;AAAA,IACd,aAAa,OAAO;AAAA,IACpB,OAAO,OAAO,MAAM,IAAI,CAAC,EAAE,IAAI,OAAO,YAAY,OAAO,EAAE,IAAI,OAAO,YAAY,EAAE;AAAA,EACrF;AACD;AAUO,SAAS,gBAAgB,QAAkB,UAA6D;AAC9G,SAAO,iBAAiB,OAAO,OAAO,SAAS,OAAO,SAAS,OAAO;AACvE;AAGO,SAAS,iBAAiB,QAAkB,UAAsC;AACxF,SAAO,qBAAqB,SAAS,OAAO,SAAS,SAAS,QAAQ;AACvE;AAGO,IAAM,eAAe,CAAC,WAC5B,OAAO,MAAM,IAAI,CAAC,EAAE,IAAI,MAAM,GAAG,WAAW;AAAA,EAC3C;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,SAAS,UAAU;AAAA,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,WAAW;AACZ,EAAE;AAUI,SAAS,sBAAsB,QAA4C;AACjF,SAAO;AAAA,IACN,SAAS,OAAO,MAAM,CAAC,GAAG,MAAM;AAAA,IAChC,OAAO,aAAa,MAAM;AAAA,IAC1B,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,MAAM,YAAY;AAAA,IAClB,MAAM,YAAY;AAAA,IAClB,MAAM,YAAY;AAAA,IAClB,YAAY,EAAE,QAAQ,QAAQ,UAAU,CAAC,GAAG,aAAa,EAAE;AAAA,IAC3D,SAAS;AAAA,IACT,aAAa;AAAA,EACd;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/elements/inputs/form-masked-input.registration.ts"],
|
|
4
|
+
"sourcesContent": ["import { radiantElements } from '../radiant-elements';\n\nexport const MaskedInputElementRegistration = radiantElements.get('masked-input');\n"],
|
|
5
|
+
"mappings": ";;;;;AAEO,IAAM,iCAAiC,gBAAgB,IAAI,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/elements/actions/submit-button.registration.ts"],
|
|
4
|
+
"sourcesContent": ["import { radiantElements } from '../radiant-elements';\n\nexport const SubmitButtonElementRegistration = radiantElements.get('submit');\n"],
|
|
5
|
+
"mappings": ";;;;;AAEO,IAAM,kCAAkC,gBAAgB,IAAI,QAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SwitchElementRegistration
|
|
3
|
-
} from "./chunk-GI7QPTA6.js";
|
|
4
|
-
import {
|
|
5
|
-
TextareaElementRegistration
|
|
6
|
-
} from "./chunk-4LAZI7C4.js";
|
|
7
1
|
import {
|
|
8
2
|
SubmissionAlertElementRegistration
|
|
9
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Z6YBGHRZ.js";
|
|
10
4
|
import {
|
|
11
5
|
SubmitButtonElementRegistration
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
PhoneInputElementRegistration
|
|
15
|
-
} from "./chunk-VMCK5D33.js";
|
|
16
|
-
import {
|
|
17
|
-
RadioElementRegistration
|
|
18
|
-
} from "./chunk-QVX4Q6AT.js";
|
|
6
|
+
} from "./chunk-LO5JPEX5.js";
|
|
19
7
|
import {
|
|
20
8
|
SelectElementRegistration
|
|
21
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6574CH3A.js";
|
|
22
10
|
import {
|
|
23
11
|
SliderElementRegistration
|
|
24
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6S4GD7KX.js";
|
|
25
13
|
import {
|
|
26
|
-
|
|
27
|
-
} from "./chunk-
|
|
14
|
+
SwitchElementRegistration
|
|
15
|
+
} from "./chunk-UJBM5FU2.js";
|
|
28
16
|
import {
|
|
29
|
-
|
|
30
|
-
} from "./chunk-
|
|
17
|
+
TextareaElementRegistration
|
|
18
|
+
} from "./chunk-VUWRRTK5.js";
|
|
31
19
|
import {
|
|
32
20
|
MaskedInputElementRegistration
|
|
33
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-L6PO4H2I.js";
|
|
34
22
|
import {
|
|
35
23
|
NumberElementRegistration
|
|
36
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-2H5775NI.js";
|
|
37
25
|
import {
|
|
38
|
-
|
|
39
|
-
} from "./chunk-
|
|
26
|
+
PhoneInputElementRegistration
|
|
27
|
+
} from "./chunk-2KSCBICE.js";
|
|
40
28
|
import {
|
|
41
|
-
|
|
42
|
-
} from "./chunk-
|
|
29
|
+
RadioElementRegistration
|
|
30
|
+
} from "./chunk-EB2VDCHX.js";
|
|
43
31
|
import {
|
|
44
32
|
DropZoneElementRegistration
|
|
45
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-PEIGLXJ6.js";
|
|
46
34
|
import {
|
|
47
35
|
FieldSetRegistration
|
|
48
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-7KHD5OKX.js";
|
|
37
|
+
import {
|
|
38
|
+
InputOTPElementRegistration
|
|
39
|
+
} from "./chunk-NANXPMLM.js";
|
|
40
|
+
import {
|
|
41
|
+
InputElementRegistration
|
|
42
|
+
} from "./chunk-WO7RSUQ5.js";
|
|
49
43
|
import {
|
|
50
44
|
ArrayElementRegistration
|
|
51
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-2OBPB2QL.js";
|
|
52
46
|
import {
|
|
53
47
|
CheckboxGroupElementRegistration
|
|
54
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-6HW74OL4.js";
|
|
49
|
+
import {
|
|
50
|
+
CheckboxElementRegistration
|
|
51
|
+
} from "./chunk-WUJCVBMV.js";
|
|
52
|
+
import {
|
|
53
|
+
ComboboxElementRegistration
|
|
54
|
+
} from "./chunk-W33X4SOZ.js";
|
|
55
55
|
|
|
56
56
|
// src/registrations/index.ts
|
|
57
57
|
var schemaFormRegistrations = [
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
deriveFormSteps,
|
|
3
3
|
deriveInitialInstance,
|
|
4
4
|
deriveNavigation
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KZR4H5BT.js";
|
|
6
6
|
import {
|
|
7
7
|
formInstanceContext
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OPO7RVCM.js";
|
|
9
9
|
import {
|
|
10
10
|
__decorateElement,
|
|
11
11
|
__decoratorStart,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deriveFormSteps,
|
|
3
3
|
deriveInitialInstance
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KZR4H5BT.js";
|
|
5
5
|
import {
|
|
6
6
|
formInstanceContext
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OPO7RVCM.js";
|
|
8
8
|
import {
|
|
9
9
|
__decorateElement,
|
|
10
10
|
__decoratorStart,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/elements/inputs/form-input-otp.registration.ts"],
|
|
4
|
+
"sourcesContent": ["import { radiantElements } from '../radiant-elements';\n\nexport const InputOTPElementRegistration = radiantElements.get('input-otp');\n"],
|
|
5
|
+
"mappings": ";;;;;AAEO,IAAM,8BAA8B,gBAAgB,IAAI,WAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|