@nova-design-system/nova-webcomponents 3.0.0-beta.27 → 3.0.0-beta.28
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/LICENSE.MD +61 -108
- package/dist/blazor-docs.json +1305 -194
- package/dist/cjs/index-c50face0.js +48 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/native.cjs.js +1 -1
- package/dist/cjs/nv-datagrid.cjs.entry.js +3226 -0
- package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-datagridbody.cjs.entry.js +24 -0
- package/dist/cjs/nv-datagridbody.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-datagridcolumn.cjs.entry.js +27 -0
- package/dist/cjs/nv-datagridcolumn.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-datagriddatacell.cjs.entry.js +26 -0
- package/dist/cjs/nv-datagriddatacell.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-datagridhead.cjs.entry.js +24 -0
- package/dist/cjs/nv-datagridhead.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-datagridrow.cjs.entry.js +24 -0
- package/dist/cjs/nv-datagridrow.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +4 -4
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +3 -3
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +3 -3
- package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldpassword.cjs.entry.js +3 -3
- package/dist/cjs/nv-fieldpassword.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldradio.cjs.entry.js +3 -3
- package/dist/cjs/nv-fieldradio.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldselect.cjs.entry.js +5 -5
- package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtext.cjs.entry.js +3 -3
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js +4 -4
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtoggle.cjs.entry.js +8 -4
- package/dist/cjs/nv-fieldtoggle.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-icon.cjs.entry.js +1 -1
- package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-iconbutton.cjs.entry.js +1 -1
- package/dist/cjs/nv-iconbutton.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-loader.cjs.entry.js +1 -1
- package/dist/cjs/nv-loader.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-menu.cjs.entry.js +1 -1
- package/dist/cjs/nv-menuitem.cjs.entry.js +1 -1
- package/dist/cjs/nv-menuitem.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-popover.cjs.entry.js +1 -1
- package/dist/cjs/nv-popover.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-row.cjs.entry.js +1 -1
- package/dist/cjs/nv-row.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-stack.cjs.entry.js +1 -1
- package/dist/cjs/nv-stack.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-table.cjs.entry.js +134 -0
- package/dist/cjs/nv-table.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-tablebody.cjs.entry.js +24 -0
- package/dist/cjs/nv-tablebody.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-tablecolumn.cjs.entry.js +30 -0
- package/dist/cjs/nv-tablecolumn.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-tabledatacell.cjs.entry.js +28 -0
- package/dist/cjs/nv-tabledatacell.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-tablehead.cjs.entry.js +24 -0
- package/dist/cjs/nv-tablehead.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-tablerow.cjs.entry.js +24 -0
- package/dist/cjs/nv-tablerow.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/nv-tooltip.cjs.entry.js.map +1 -1
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/nv-datagrid/nv-datagrid.css +5 -0
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +225 -0
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -0
- package/dist/collection/components/nv-datagrid/nv-datagrid.js +441 -0
- package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -0
- package/dist/collection/components/nv-datagridbody/nv-datagridbody.css +0 -0
- package/dist/collection/components/nv-datagridbody/nv-datagridbody.docs.js +8 -0
- package/dist/collection/components/nv-datagridbody/nv-datagridbody.docs.js.map +1 -0
- package/dist/collection/components/nv-datagridbody/nv-datagridbody.js +23 -0
- package/dist/collection/components/nv-datagridbody/nv-datagridbody.js.map +1 -0
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.css +0 -0
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.docs.js +6 -0
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.docs.js.map +1 -0
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js +66 -0
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js.map +1 -0
- package/dist/collection/components/nv-datagriddatacell/nv-datagriddatacell.css +0 -0
- package/dist/collection/components/nv-datagriddatacell/nv-datagriddatacell.docs.js +6 -0
- package/dist/collection/components/nv-datagriddatacell/nv-datagriddatacell.docs.js.map +1 -0
- package/dist/collection/components/nv-datagriddatacell/nv-datagriddatacell.js +51 -0
- package/dist/collection/components/nv-datagriddatacell/nv-datagriddatacell.js.map +1 -0
- package/dist/collection/components/nv-datagridhead/nv-datagridhead.css +0 -0
- package/dist/collection/components/nv-datagridhead/nv-datagridhead.docs.js +8 -0
- package/dist/collection/components/nv-datagridhead/nv-datagridhead.docs.js.map +1 -0
- package/dist/collection/components/nv-datagridhead/nv-datagridhead.js +23 -0
- package/dist/collection/components/nv-datagridhead/nv-datagridhead.js.map +1 -0
- package/dist/collection/components/nv-datagridrow/nv-datagridrow.css +0 -0
- package/dist/collection/components/nv-datagridrow/nv-datagridrow.docs.js +8 -0
- package/dist/collection/components/nv-datagridrow/nv-datagridrow.docs.js.map +1 -0
- package/dist/collection/components/nv-datagridrow/nv-datagridrow.js +23 -0
- package/dist/collection/components/nv-datagridrow/nv-datagridrow.js.map +1 -0
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js +4 -4
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +3 -3
- package/dist/collection/components/nv-fielddropdownitem/DropdownItemSelectedEventDetail.js.map +1 -1
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js +1 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +3 -3
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js.map +1 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +3 -3
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js.map +1 -1
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +3 -3
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js.map +1 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +5 -5
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js.map +1 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +3 -3
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +7 -7
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js.map +1 -1
- package/dist/collection/components/nv-fieldtoggle/nv-fieldtoggle.js +8 -4
- package/dist/collection/components/nv-fieldtoggle/nv-fieldtoggle.js.map +1 -1
- package/dist/collection/components/nv-icon/nv-icon.js +1 -1
- package/dist/collection/components/nv-icon/nv-icon.js.map +1 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +1 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js.map +1 -1
- package/dist/collection/components/nv-loader/nv-loader.js +1 -1
- package/dist/collection/components/nv-loader/nv-loader.js.map +1 -1
- package/dist/collection/components/nv-menu/nv-menu.js +1 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js +1 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js.map +1 -1
- package/dist/collection/components/nv-popover/nv-popover.js +1 -1
- package/dist/collection/components/nv-popover/nv-popover.js.map +1 -1
- package/dist/collection/components/nv-row/nv-row.js +1 -1
- package/dist/collection/components/nv-row/nv-row.js.map +1 -1
- package/dist/collection/components/nv-stack/nv-stack.js +1 -1
- package/dist/collection/components/nv-stack/nv-stack.js.map +1 -1
- package/dist/collection/components/nv-table/nv-table.css +5 -0
- package/dist/collection/components/nv-table/nv-table.docs.js +178 -0
- package/dist/collection/components/nv-table/nv-table.docs.js.map +1 -0
- package/dist/collection/components/nv-table/nv-table.js +287 -0
- package/dist/collection/components/nv-table/nv-table.js.map +1 -0
- package/dist/collection/components/nv-tablebody/nv-tablebody.css +0 -0
- package/dist/collection/components/nv-tablebody/nv-tablebody.docs.js +8 -0
- package/dist/collection/components/nv-tablebody/nv-tablebody.docs.js.map +1 -0
- package/dist/collection/components/nv-tablebody/nv-tablebody.js +23 -0
- package/dist/collection/components/nv-tablebody/nv-tablebody.js.map +1 -0
- package/dist/collection/components/nv-tablecolumn/nv-tablecolumn.css +0 -0
- package/dist/collection/components/nv-tablecolumn/nv-tablecolumn.docs.js +6 -0
- package/dist/collection/components/nv-tablecolumn/nv-tablecolumn.docs.js.map +1 -0
- package/dist/collection/components/nv-tablecolumn/nv-tablecolumn.js +131 -0
- package/dist/collection/components/nv-tablecolumn/nv-tablecolumn.js.map +1 -0
- package/dist/collection/components/nv-tabledatacell/nv-tabledatacell.css +0 -0
- package/dist/collection/components/nv-tabledatacell/nv-tabledatacell.docs.js +6 -0
- package/dist/collection/components/nv-tabledatacell/nv-tabledatacell.docs.js.map +1 -0
- package/dist/collection/components/nv-tabledatacell/nv-tabledatacell.js +95 -0
- package/dist/collection/components/nv-tabledatacell/nv-tabledatacell.js.map +1 -0
- package/dist/collection/components/nv-tablehead/nv-tablehead.css +0 -0
- package/dist/collection/components/nv-tablehead/nv-tablehead.docs.js +8 -0
- package/dist/collection/components/nv-tablehead/nv-tablehead.docs.js.map +1 -0
- package/dist/collection/components/nv-tablehead/nv-tablehead.js +23 -0
- package/dist/collection/components/nv-tablehead/nv-tablehead.js.map +1 -0
- package/dist/collection/components/nv-tablerow/nv-tablerow.css +0 -0
- package/dist/collection/components/nv-tablerow/nv-tablerow.docs.js +8 -0
- package/dist/collection/components/nv-tablerow/nv-tablerow.docs.js.map +1 -0
- package/dist/collection/components/nv-tablerow/nv-tablerow.js +23 -0
- package/dist/collection/components/nv-tablerow/nv-tablerow.js.map +1 -0
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.js.map +1 -1
- package/dist/collection/interfaces/Column.js +2 -0
- package/dist/collection/interfaces/Column.js.map +1 -0
- package/dist/components/nv-alert.js +1 -1
- package/dist/components/nv-avatar.js +1 -1
- package/dist/components/nv-badge.js +1 -1
- package/dist/components/nv-button.js +1 -1
- package/dist/components/nv-datagrid.d.ts +11 -0
- package/dist/components/nv-datagrid.js +3259 -0
- package/dist/components/nv-datagrid.js.map +1 -0
- package/dist/components/nv-datagridbody.d.ts +11 -0
- package/dist/components/nv-datagridbody.js +38 -0
- package/dist/components/nv-datagridbody.js.map +1 -0
- package/dist/components/nv-datagridcolumn.d.ts +11 -0
- package/dist/components/nv-datagridcolumn.js +44 -0
- package/dist/components/nv-datagridcolumn.js.map +1 -0
- package/dist/components/nv-datagriddatacell.d.ts +11 -0
- package/dist/components/nv-datagriddatacell.js +42 -0
- package/dist/components/nv-datagriddatacell.js.map +1 -0
- package/dist/components/nv-datagridhead.d.ts +11 -0
- package/dist/components/nv-datagridhead.js +38 -0
- package/dist/components/nv-datagridhead.js.map +1 -0
- package/dist/components/nv-datagridrow.d.ts +11 -0
- package/dist/components/nv-datagridrow.js +38 -0
- package/dist/components/nv-datagridrow.js.map +1 -0
- package/dist/components/nv-fieldcheckbox.js +4 -4
- package/dist/components/nv-fielddropdown.js +8 -8
- package/dist/components/nv-fielddropdownitem.js +1 -1
- package/dist/components/nv-fieldnumber.js +4 -4
- package/dist/components/nv-fieldnumber.js.map +1 -1
- package/dist/components/nv-fieldpassword.js +6 -6
- package/dist/components/nv-fieldpassword.js.map +1 -1
- package/dist/components/nv-fieldradio.js +3 -3
- package/dist/components/nv-fieldradio.js.map +1 -1
- package/dist/components/nv-fieldselect.js +6 -6
- package/dist/components/nv-fieldselect.js.map +1 -1
- package/dist/components/nv-fieldtext.js +4 -4
- package/dist/components/nv-fieldtextarea.js +5 -5
- package/dist/components/nv-fieldtextarea.js.map +1 -1
- package/dist/components/nv-fieldtoggle.js +8 -4
- package/dist/components/nv-fieldtoggle.js.map +1 -1
- package/dist/components/nv-icon.js +1 -1
- package/dist/components/nv-iconbutton.js +1 -1
- package/dist/components/nv-loader.js +1 -1
- package/dist/components/nv-menu.js +2 -2
- package/dist/components/nv-menuitem.js +2 -2
- package/dist/components/nv-menuitem.js.map +1 -1
- package/dist/components/nv-popover.js +1 -1
- package/dist/components/nv-row.js +1 -1
- package/dist/components/nv-row.js.map +1 -1
- package/dist/components/nv-stack.js +1 -1
- package/dist/components/nv-stack.js.map +1 -1
- package/dist/components/nv-table.d.ts +11 -0
- package/dist/components/nv-table.js +164 -0
- package/dist/components/nv-table.js.map +1 -0
- package/dist/components/nv-tablebody.d.ts +11 -0
- package/dist/components/nv-tablebody.js +38 -0
- package/dist/components/nv-tablebody.js.map +1 -0
- package/dist/components/nv-tablecolumn.d.ts +11 -0
- package/dist/components/nv-tablecolumn.js +50 -0
- package/dist/components/nv-tablecolumn.js.map +1 -0
- package/dist/components/nv-tabledatacell.d.ts +11 -0
- package/dist/components/nv-tabledatacell.js +46 -0
- package/dist/components/nv-tabledatacell.js.map +1 -0
- package/dist/components/nv-tablehead.d.ts +11 -0
- package/dist/components/nv-tablehead.js +38 -0
- package/dist/components/nv-tablehead.js.map +1 -0
- package/dist/components/nv-tablerow.d.ts +11 -0
- package/dist/components/nv-tablerow.js +38 -0
- package/dist/components/nv-tablerow.js.map +1 -0
- package/dist/components/nv-tooltip.js +2 -2
- package/dist/components/nv-tooltip.js.map +1 -1
- package/dist/components/{p-76eb28db.js → p-45405075.js} +3 -3
- package/dist/components/{p-76eb28db.js.map → p-45405075.js.map} +1 -1
- package/dist/components/{p-9647924f.js → p-45c63143.js} +4 -4
- package/dist/components/{p-9647924f.js.map → p-45c63143.js.map} +1 -1
- package/dist/components/{p-9be1ebd4.js → p-689a7b38.js} +2 -2
- package/dist/components/{p-9be1ebd4.js.map → p-689a7b38.js.map} +1 -1
- package/dist/components/{p-ff97f99e.js → p-89fb6636.js} +2 -2
- package/dist/components/{p-ff97f99e.js.map → p-89fb6636.js.map} +1 -1
- package/dist/components/{p-69cc7819.js → p-8c8cf8ea.js} +2 -2
- package/dist/components/{p-69cc7819.js.map → p-8c8cf8ea.js.map} +1 -1
- package/dist/docs.json +1322 -278
- package/dist/esm/index-e7b35c14.js +48 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/native.js +1 -1
- package/dist/esm/nv-datagrid.entry.js +3222 -0
- package/dist/esm/nv-datagrid.entry.js.map +1 -0
- package/dist/esm/nv-datagridbody.entry.js +20 -0
- package/dist/esm/nv-datagridbody.entry.js.map +1 -0
- package/dist/esm/nv-datagridcolumn.entry.js +23 -0
- package/dist/esm/nv-datagridcolumn.entry.js.map +1 -0
- package/dist/esm/nv-datagriddatacell.entry.js +22 -0
- package/dist/esm/nv-datagriddatacell.entry.js.map +1 -0
- package/dist/esm/nv-datagridhead.entry.js +20 -0
- package/dist/esm/nv-datagridhead.entry.js.map +1 -0
- package/dist/esm/nv-datagridrow.entry.js +20 -0
- package/dist/esm/nv-datagridrow.entry.js.map +1 -0
- package/dist/esm/nv-fieldcheckbox.entry.js +4 -4
- package/dist/esm/nv-fielddropdown.entry.js +3 -3
- package/dist/esm/nv-fielddropdownitem.entry.js +1 -1
- package/dist/esm/nv-fieldnumber.entry.js +3 -3
- package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
- package/dist/esm/nv-fieldpassword.entry.js +3 -3
- package/dist/esm/nv-fieldpassword.entry.js.map +1 -1
- package/dist/esm/nv-fieldradio.entry.js +3 -3
- package/dist/esm/nv-fieldradio.entry.js.map +1 -1
- package/dist/esm/nv-fieldselect.entry.js +5 -5
- package/dist/esm/nv-fieldselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldtext.entry.js +3 -3
- package/dist/esm/nv-fieldtextarea.entry.js +4 -4
- package/dist/esm/nv-fieldtextarea.entry.js.map +1 -1
- package/dist/esm/nv-fieldtoggle.entry.js +8 -4
- package/dist/esm/nv-fieldtoggle.entry.js.map +1 -1
- package/dist/esm/nv-icon.entry.js +1 -1
- package/dist/esm/nv-icon.entry.js.map +1 -1
- package/dist/esm/nv-iconbutton.entry.js +1 -1
- package/dist/esm/nv-iconbutton.entry.js.map +1 -1
- package/dist/esm/nv-loader.entry.js +1 -1
- package/dist/esm/nv-loader.entry.js.map +1 -1
- package/dist/esm/nv-menu.entry.js +1 -1
- package/dist/esm/nv-menuitem.entry.js +1 -1
- package/dist/esm/nv-menuitem.entry.js.map +1 -1
- package/dist/esm/nv-popover.entry.js +1 -1
- package/dist/esm/nv-popover.entry.js.map +1 -1
- package/dist/esm/nv-row.entry.js +1 -1
- package/dist/esm/nv-row.entry.js.map +1 -1
- package/dist/esm/nv-stack.entry.js +1 -1
- package/dist/esm/nv-stack.entry.js.map +1 -1
- package/dist/esm/nv-table.entry.js +130 -0
- package/dist/esm/nv-table.entry.js.map +1 -0
- package/dist/esm/nv-tablebody.entry.js +20 -0
- package/dist/esm/nv-tablebody.entry.js.map +1 -0
- package/dist/esm/nv-tablecolumn.entry.js +26 -0
- package/dist/esm/nv-tablecolumn.entry.js.map +1 -0
- package/dist/esm/nv-tabledatacell.entry.js +24 -0
- package/dist/esm/nv-tabledatacell.entry.js.map +1 -0
- package/dist/esm/nv-tablehead.entry.js +20 -0
- package/dist/esm/nv-tablehead.entry.js.map +1 -0
- package/dist/esm/nv-tablerow.entry.js +20 -0
- package/dist/esm/nv-tablerow.entry.js.map +1 -0
- package/dist/esm/nv-tooltip.entry.js +1 -1
- package/dist/esm/nv-tooltip.entry.js.map +1 -1
- package/dist/native/native.css +1 -1
- package/dist/native/native.esm.js +1 -1
- package/dist/native/native.esm.js.map +1 -1
- package/dist/native/p-01be802d.entry.js +2 -0
- package/dist/native/p-01be802d.entry.js.map +1 -0
- package/dist/native/{p-71fbdb92.entry.js → p-0cfe2048.entry.js} +2 -2
- package/dist/native/{p-71fbdb92.entry.js.map → p-0cfe2048.entry.js.map} +1 -1
- package/dist/native/{p-4a43953f.entry.js → p-13070761.entry.js} +2 -2
- package/dist/native/{p-000749ae.entry.js → p-1edb76e1.entry.js} +2 -2
- package/dist/native/{p-000749ae.entry.js.map → p-1edb76e1.entry.js.map} +1 -1
- package/dist/native/{p-c16a4fbe.entry.js → p-20c7fc4d.entry.js} +2 -2
- package/dist/native/p-20c7fc4d.entry.js.map +1 -0
- package/dist/native/p-28cf537b.entry.js +2 -0
- package/dist/native/{p-4b550f95.entry.js.map → p-28cf537b.entry.js.map} +1 -1
- package/dist/native/p-36d5158c.entry.js +13 -0
- package/dist/native/p-36d5158c.entry.js.map +1 -0
- package/dist/native/{p-396b65bb.entry.js → p-38817aa3.entry.js} +2 -2
- package/dist/native/{p-396b65bb.entry.js.map → p-38817aa3.entry.js.map} +1 -1
- package/dist/native/{p-bb243eaf.entry.js → p-39dbb15b.entry.js} +2 -2
- package/dist/native/p-4b926563.entry.js +2 -0
- package/dist/native/p-4b926563.entry.js.map +1 -0
- package/dist/native/{p-d5c24d8f.entry.js → p-4e351d8e.entry.js} +2 -2
- package/dist/native/p-671699bf.entry.js +2 -0
- package/dist/native/p-671699bf.entry.js.map +1 -0
- package/dist/native/{p-25e1bc94.entry.js → p-75b5fdce.entry.js} +2 -2
- package/dist/native/{p-25e1bc94.entry.js.map → p-75b5fdce.entry.js.map} +1 -1
- package/dist/native/p-7a7b9b95.entry.js +2 -0
- package/dist/native/p-7a7b9b95.entry.js.map +1 -0
- package/dist/native/{p-5172aa15.entry.js → p-808cf007.entry.js} +2 -2
- package/dist/native/{p-23b20b80.entry.js → p-81256924.entry.js} +2 -2
- package/dist/native/{p-23b20b80.entry.js.map → p-81256924.entry.js.map} +1 -1
- package/dist/native/{p-8de6396f.entry.js → p-844f4878.entry.js} +2 -2
- package/dist/native/{p-8de6396f.entry.js.map → p-844f4878.entry.js.map} +1 -1
- package/dist/native/p-861f91d3.entry.js +2 -0
- package/dist/native/p-861f91d3.entry.js.map +1 -0
- package/dist/native/p-9221f72a.entry.js +2 -0
- package/dist/native/p-9221f72a.entry.js.map +1 -0
- package/dist/native/p-982e474f.entry.js +2 -0
- package/dist/native/p-982e474f.entry.js.map +1 -0
- package/dist/native/p-99850272.entry.js +2 -0
- package/dist/native/p-99850272.entry.js.map +1 -0
- package/dist/native/{p-d4e0b6e1.entry.js → p-bdab3562.entry.js} +2 -2
- package/dist/native/{p-4fae1b2c.entry.js → p-c1c661a0.entry.js} +2 -2
- package/dist/native/p-c1c661a0.entry.js.map +1 -0
- package/dist/native/{p-89468485.entry.js → p-c4f7e36d.entry.js} +2 -2
- package/dist/native/{p-89468485.entry.js.map → p-c4f7e36d.entry.js.map} +1 -1
- package/dist/native/{p-20ea1b61.entry.js → p-dba9c57c.entry.js} +2 -2
- package/dist/native/{p-20ea1b61.entry.js.map → p-dba9c57c.entry.js.map} +1 -1
- package/dist/native/p-dbae3920.entry.js +2 -0
- package/dist/native/{p-0d335326.entry.js.map → p-dbae3920.entry.js.map} +1 -1
- package/dist/native/p-de6e0e1f.entry.js +2 -0
- package/dist/native/p-de6e0e1f.entry.js.map +1 -0
- package/dist/native/{p-aeaa326f.entry.js → p-e2df46e2.entry.js} +2 -2
- package/dist/native/{p-aeaa326f.entry.js.map → p-e2df46e2.entry.js.map} +1 -1
- package/dist/native/p-e842220b.entry.js +2 -0
- package/dist/native/p-e842220b.entry.js.map +1 -0
- package/dist/native/{p-a016e4b6.entry.js → p-ea4092a7.entry.js} +2 -2
- package/dist/native/{p-a016e4b6.entry.js.map → p-ea4092a7.entry.js.map} +1 -1
- package/dist/native/p-f7b96c42.entry.js +2 -0
- package/dist/native/p-f7b96c42.entry.js.map +1 -0
- package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +87 -0
- package/dist/types/components/nv-datagrid/nv-datagrid.docs.d.ts +4 -0
- package/dist/types/components/nv-datagridbody/nv-datagridbody.d.ts +7 -0
- package/dist/types/components/nv-datagridbody/nv-datagridbody.docs.d.ts +4 -0
- package/dist/types/components/nv-datagridcolumn/nv-datagridcolumn.d.ts +16 -0
- package/dist/types/components/nv-datagridcolumn/nv-datagridcolumn.docs.d.ts +4 -0
- package/dist/types/components/nv-datagriddatacell/nv-datagriddatacell.d.ts +14 -0
- package/dist/types/components/nv-datagriddatacell/nv-datagriddatacell.docs.d.ts +4 -0
- package/dist/types/components/nv-datagridhead/nv-datagridhead.d.ts +7 -0
- package/dist/types/components/nv-datagridhead/nv-datagridhead.docs.d.ts +4 -0
- package/dist/types/components/nv-datagridrow/nv-datagridrow.d.ts +7 -0
- package/dist/types/components/nv-datagridrow/nv-datagridrow.docs.d.ts +4 -0
- package/dist/types/components/nv-fielddropdownitem/DropdownItemSelectedEventDetail.d.ts +12 -0
- package/dist/types/components/nv-fieldtextarea/nv-fieldtextarea.d.ts +2 -2
- package/dist/types/components/nv-fieldtoggle/nv-fieldtoggle.d.ts +4 -4
- package/dist/types/components/nv-menuitem/nv-menuitem.d.ts +3 -0
- package/dist/types/components/nv-table/nv-table.d.ts +72 -0
- package/dist/types/components/nv-table/nv-table.docs.d.ts +4 -0
- package/dist/types/components/nv-tablebody/nv-tablebody.d.ts +7 -0
- package/dist/types/components/nv-tablebody/nv-tablebody.docs.d.ts +4 -0
- package/dist/types/components/nv-tablecolumn/nv-tablecolumn.d.ts +51 -0
- package/dist/types/components/nv-tablecolumn/nv-tablecolumn.docs.d.ts +4 -0
- package/dist/types/components/nv-tabledatacell/nv-tabledatacell.d.ts +30 -0
- package/dist/types/components/nv-tabledatacell/nv-tabledatacell.docs.d.ts +4 -0
- package/dist/types/components/nv-tablehead/nv-tablehead.d.ts +7 -0
- package/dist/types/components/nv-tablehead/nv-tablehead.docs.d.ts +4 -0
- package/dist/types/components/nv-tablerow/nv-tablerow.d.ts +7 -0
- package/dist/types/components/nv-tablerow/nv-tablerow.docs.d.ts +4 -0
- package/dist/types/components.d.ts +408 -8
- package/dist/types/interfaces/Column.d.ts +13 -0
- package/dist/types/nova-docs.d.ts +18 -0
- package/dist/vscode-data.json +3659 -0
- package/hydrate/index.js +3746 -44
- package/hydrate/index.mjs +3746 -44
- package/package.json +1 -1
- package/dist/native/p-0d335326.entry.js +0 -2
- package/dist/native/p-4b550f95.entry.js +0 -2
- package/dist/native/p-4fae1b2c.entry.js.map +0 -1
- package/dist/native/p-c16a4fbe.entry.js.map +0 -1
- /package/dist/native/{p-4a43953f.entry.js.map → p-13070761.entry.js.map} +0 -0
- /package/dist/native/{p-bb243eaf.entry.js.map → p-39dbb15b.entry.js.map} +0 -0
- /package/dist/native/{p-d5c24d8f.entry.js.map → p-4e351d8e.entry.js.map} +0 -0
- /package/dist/native/{p-5172aa15.entry.js.map → p-808cf007.entry.js.map} +0 -0
- /package/dist/native/{p-d4e0b6e1.entry.js.map → p-bdab3562.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"nv-fieldselect.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,gBAAgB,GAAG,upNAAupN,CAAC;AACjrN,4BAAe,gBAAgB;;MC2BlB,aAAa;;;;;;;;;;;;;;QA8OP,uBAAkB,GAAG,CAAC,KAAY;YACj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,aAAa,GAAQ,CAC5B,EAEL,CAAC,IAAI,CAAC,WAAW;YAChB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,sBAAsB,CAAC,MAC7CA,kEAAK,KAAK,EAAC,aAAa,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,cAAc,IACzDA,mEAAM,IAAI,EAAC,aAAa,IAAE,IAAI,CAAC,WAAW,CAAQ,CAC9C,CACP,EAEA,CAAC,IAAI,CAAC,gBAAgB;YACrB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,4BAA4B,CAAC,MACnDA,kEAAK,KAAK,EAAC,mBAAmB,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,QAAQ,IACzDA,mEAAM,IAAI,EAAC,mBAAmB,IAAE,IAAI,CAAC,gBAAgB,CAAQ,CACzD,CACP,CACI,EACP;KACH;;;;;;;;;;;;;","names":["uuidv4","h","Host"],"sources":["src/components/nv-fieldselect/nv-fieldselect.scss?tag=nv-fieldselect","src/components/nv-fieldselect/nv-fieldselect.tsx"],"sourcesContent":["@import \"../../styles/form-field\";\n\n@mixin form-field-select-wrapper() {\n display: flex;\n flex-wrap: wrap;\n gap: var(--form-gap-x);\n align-items: stretch;\n align-self: stretch;\n}\n\n@mixin form-field-select-container() {\n display: flex;\n flex-grow: 1;\n padding: calc(var(--form-field-padding-y) - 1px) var(--form-field-padding-x);\n justify-content: center;\n align-items: center;\n gap: var(--form-field-gap);\n align-self: stretch;\n border-radius: var(--form-field-radius);\n border-width: 1px;\n border-style: solid;\n border-color: var(--nv-field-border-default);\n opacity: var(--components-form-opacity-default);\n background: var(--nv-field-background);\n transition: all 150ms ease-out;\n\n &:hover {\n border-color: var(--nv-field-border-hover);\n }\n\n &:focus-within {\n border-color: var(--nv-field-border-focus);\n box-shadow: 0 0 0 var(--focus-field-stroke) var(--nv-field-focus-box-shadow);\n }\n\n &:has(select:disabled) {\n // opacity: var(--components-form-opacity-disabled, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(--components-form-field-background-disabled);\n border-color: var(--nv-field-border-disabled);\n }\n}\n\n@mixin form-field-select() {\n display: flex;\n align-items: center;\n flex: 1 0 0;\n overflow: hidden;\n background-color: transparent;\n color: var(--components-form-field-content-text);\n text-overflow: ellipsis;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-field-line-height);\n\n &:focus {\n outline: none;\n }\n\n &::placeholder {\n overflow: hidden;\n color: var(--components-form-field-content-placeholder);\n text-overflow: ellipsis;\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 400;\n line-height: var(--form-field-line-height);\n }\n}\n\nnv-fieldselect {\n @include form-field-variables();\n @include form-field-root();\n\n &[readonly]:not([readonly=\"false\"]) {\n @include form-field-readonly-variables();\n }\n\n &[display-value]:not([display-value=\"false\"]) {\n @include form-field-readonly-variables();\n }\n\n &[error]:not([error=\"false\"]) {\n @include form-field-error-variables();\n }\n\n &[success]:not([success=\"false\"]) {\n @include form-field-success-variables();\n }\n\n &[required]:not([required=\"false\"]) label {\n @include form-field-label-required();\n }\n\n label {\n @include form-field-label();\n }\n\n .select-wrapper {\n @include form-field-select-wrapper();\n\n .select-container {\n @include form-field-select-container();\n\n input {\n @include form-field-input();\n\n &:read-only {\n // opacity: var(--components-form-opacity-disabled, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(--components-form-field-background-readonly, rgb(0 0 0 / 10%));\n border-color: var(--nv-field-border-readonly);\n }\n }\n\n select {\n @include form-field-select();\n\n & option {\n background-color: var(--nv-field-background);\n color: var(--components-form-field-content-text, #1d1d1d);\n font-size: var(--form-field-font-size, 16px);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-field-line-height, 24px);\n\n &:checked {\n background-color: var(--color-orange-500);\n color: var(--color-base-content-high-emphasis);\n font-size: var(--form-field-font-size, 16px);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-field-line-height, 24px);\n }\n }\n\n &.hidden {\n display: none;\n }\n }\n\n nv-icon.readonly-icon {\n @include form-field-icon();\n }\n\n nv-icon.validation {\n @include form-field-icon();\n }\n }\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Watch,\n Element,\n State,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * @slot default - Content to be placed inside the select element.\n * @slot leading-input - Content to be placed before the select input, within the select container.\n * @slot before-input - Content to be placed before the select input, outside the select container.\n * @slot after-input - Content to be placed after the select input, outside the select container.\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fieldselect',\n shadow: false,\n formAssociated: true,\n styleUrl: 'nv-fieldselect.scss',\n})\nexport class NvFieldselect {\n @Element() el: HTMLNvFieldselectElement;\n private selectElement!: HTMLSelectElement;\n private internals: ElementInternals;\n\n /****************************************************************************/\n //#region STATES\n\n @State()\n private computedDisplayValue: string = '';\n\n @State()\n private internalReadonly: boolean = false;\n\n //#endregion STATES\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Message defines a 'hint ' message for the Select Field.\n * @deprecated use description instead.\n */\n @Prop()\n readonly message: string;\n\n /**\n * Add the message to the validation state.\n * @deprecated use errorDescription and set the error prop instead.\n */\n @Prop()\n readonly validation: string;\n\n componentWillRender() {\n this.updateDisplayValue(); // Ensure display value is updated before render\n\n if (this.message) {\n this.description = this.message;\n }\n\n if (this.validation) {\n this.errorDescription = this.validation;\n this.error = true;\n }\n }\n\n //#endregion DEPRECATED\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the select element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated\n * to ensure unique identification, facilitating proper label association and\n * accessibility.\n */\n @Prop({ reflect: true })\n readonly selectId: string = uuidv4();\n\n /**\n * Lets you define the text that explains what users should choose in the\n * select field. It’s a crucial element for making forms clear and\n * user-friendly.\n */\n @Prop({ reflect: true })\n readonly label?: string;\n\n /**\n * Add helpful hints or extra information under the select field. This is\n * where you can clarify what users should choose or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true, mutable: true })\n description?: string;\n\n /**\n * Defines the name attribute of the select field, which is crucial for form\n * submission. This value is used as the key in the key-value pair sent to\n * the server, representing the selected data in form submissions. It should be\n * unique within the form to avoid conflicts\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * The disabled prop lets you turn off the select field so that users can’t\n * choose something. When disabled, the field is grayed out and won’t respond to\n * clicks or touches.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Display the select field’s content without allowing users to change it.\n * Users can still click on it, select, and copy the text, but they won’t be\n * able to change or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Marks the select field as required, ensuring that the user must fill it out\n * before submitting the form.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Alters the select field’s appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true, mutable: true })\n error: boolean = false;\n\n /**\n * Show a helpful message under the select field when there’s a problem. It\n * explains what’s wrong and how users can fix it, making the error easier to\n * understand and resolve.\n * @validator message\n */\n @Prop({ reflect: true, mutable: true })\n errorDescription: string;\n\n /**\n * Changes the select field’s appearance to indicate successful input or\n * validation.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * When enabled, allows the select to handle multiple selections.\n */\n @Prop({ reflect: true })\n readonly multiple: boolean = false;\n\n /**\n * The value of the select field.\n * - If `multiple` is `false`, it's a single string.\n * - If `multiple` is `true`, it's a comma-separated string of selected values.\n */\n @Prop({ reflect: true, mutable: true })\n value: string = '';\n\n /**\n * When enabled, displays the value element instead of the label when readonly.\n * By default, the label is displayed in readonly mode. Also it automatically\n * sets the component to readonly.\n */\n @Prop({ reflect: true })\n readonly displayValue: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the selected value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>; // Emit as a string\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n /**\n * Updates the display value when the value property changes. This watcher is\n * used to update the display value when the selected value changes. This is\n * necessary for readonly select fields to display the selected value.\n * @internal This watcher is not intended to be called outside of the component.\n * @param {string} newValue - The new value of the select field.\n */\n @Watch('value')\n updateDisplayValueWatcher(newValue: string) {\n this.updateDisplayValue();\n\n if (this.selectElement) {\n const selectedValues = newValue.split(',').map(val => val.trim());\n const options = this.selectElement.options;\n\n if (options) {\n Array.from(options).forEach(option => {\n option.selected = this.multiple\n ? selectedValues.includes(option.value)\n : option.value === selectedValues[0];\n });\n\n if (!this.multiple) {\n this.selectElement.value = newValue; // Only set when not multiple\n }\n } else {\n this.selectElement.value = selectedValues[0] || '';\n }\n }\n\n // Update form value\n this.setFormValue();\n }\n\n /**\n * Watcher for the displayValue prop to ensure internalReadonly is true when displayValue is true.\n * @param {boolean} newValue - The new value of displayValue.\n */\n @Watch('displayValue')\n handleDisplayValueChange(newValue: boolean) {\n this.internalReadonly = newValue; // Set internalReadonly to true if displayValue is true\n\n if (this.readonly) {\n this.internalReadonly = true;\n }\n }\n\n /**\n * Watcher for the readonly prop to ensure internalReadonly is true when readonly is true.\n * @param {boolean} newValue - The new value of readonly.\n */\n @Watch('readonly')\n handleReadonlyChange(newValue: boolean) {\n this.internalReadonly = newValue; // Set internalReadonly to true if displayValue is true\n\n if (this.displayValue) {\n this.internalReadonly = true;\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles the change event on the select element. This method is used to\n * update the value property when the selected options change. It is also\n * used to emit the selectChanged event when the selected value changes.\n * @param {Event} event - The change event on the select element.\n * @emits selectChanged\n */\n private readonly handleSelectChange = (event: Event) => {\n const select = event.target as HTMLSelectElement;\n let selectedValues: string[] = Array.from(select.selectedOptions).map(\n option => option.value,\n );\n\n if (!this.multiple) {\n selectedValues = selectedValues.slice(0, 1);\n }\n\n this.value = this.multiple\n ? selectedValues.join(', ')\n : selectedValues[0] || '';\n this.valueChanged.emit(this.value);\n\n // Update form value\n this.setFormValue();\n };\n\n /**\n * Handles focus when the select container is clicked.\n */\n private readonly handleSelectContainerClick = () => {\n if (!this.internalReadonly && this.selectElement) {\n this.selectElement.focus();\n }\n };\n\n /**\n * Updates the display value of the select field. This method is used to\n * update the display value when the selected value changes. This is necessary\n * for readonly select fields to display the selected value. This method is\n * called in the componentDidLoad lifecycle hook and the updateDisplayValueWatcher\n * watcher.\n * @internal This method is not intended to be called outside of the component.\n */\n private updateDisplayValue(): void {\n if (this.internalReadonly && !this.displayValue) {\n if (this.multiple) {\n const selectedLabels = this.value\n .split(',')\n .map(key => key.trim())\n .map(key => this.getLabelFromId(key) || '')\n .filter(label => label !== '');\n this.computedDisplayValue = selectedLabels.join(', ') || '';\n } else {\n this.computedDisplayValue = this.getLabelFromId(this.value) || '';\n }\n } else if (this.internalReadonly && this.displayValue) {\n this.computedDisplayValue = this.value || '';\n }\n }\n\n /**\n * Retrieves the label from the <option> elements based on the provided key (value).\n * This method uses the id or value attribute directly from the <select> options.\n * @param {string} key - The key (value) for which to find the corresponding label.\n * @returns {string} The label if found; otherwise, an empty string.\n */\n private getLabelFromId(key: string): string {\n this.ensureSelectElement();\n if (!this.selectElement) {\n return '';\n }\n\n // Cache the option list\n const options = this.selectElement.options;\n\n if (options) {\n const option = Array.from(options).find(option => option.value === key);\n return option ? option.textContent.trim() || '' : '';\n } else {\n return '';\n }\n }\n\n /**\n * Sets the value of the form element for form submission. This method is\n * called when the selected value changes or when the value property is set.\n * @internal This method is not intended to be called outside of the component.\n */\n private setFormValue(): void {\n this.internals.setFormValue(this.value);\n }\n\n /**\n * Ensures the select element is available. This method is used to ensure\n * the select element is available before attempting to access it.\n * @internal This method is not intended to be called outside of the component.\n */\n private ensureSelectElement(): void {\n if (!this.selectElement) {\n this.selectElement = this.el.querySelector('select') as HTMLSelectElement;\n }\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n /**\n * Lifecycle method that is called before the component is rendered. This is\n * where the internal state is set up before rendering occurs.\n */\n componentWillLoad() {\n // Set internalReadonly based on the readonly prop\n this.internalReadonly = this.readonly;\n\n // Ensure internalReadonly is true if displayValue is true during loading\n if (this.displayValue) {\n this.internalReadonly = true;\n }\n\n if ('attachInternals' in this.el) {\n this.internals = (\n this.el as HTMLElement & { attachInternals: () => ElementInternals }\n ).attachInternals();\n } else {\n // Fallback logic for browsers without attachInternals support\n this.internals = {\n setFormValue: (value: string) => {\n const formElement = this.el.closest('form');\n if (formElement) {\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = this.name;\n input.value = value;\n formElement.appendChild(input);\n }\n },\n } as ElementInternals;\n }\n\n // Initialize value as an empty string if multiple is true\n if (this.multiple && typeof this.value !== 'string') {\n this.value = '';\n }\n }\n\n /**\n * Lifecycle method that is called after the component has been rendered.\n * This is where the display value is updated and the initial select element's\n * state is set.\n */\n componentDidLoad() {\n this.updateDisplayValue();\n\n if (this.selectElement) {\n // Only set the value for single selection, skip for multiple\n if (!this.multiple) {\n this.selectElement.value = this.value;\n }\n\n const selectedValues = this.multiple\n ? this.value.split(',').map(v => v.trim())\n : [this.value];\n\n const options = this.selectElement.options;\n\n if (options) {\n Array.from(options).forEach(option => {\n option.selected = this.multiple\n ? selectedValues.includes(option.value)\n : option.value === selectedValues[0];\n });\n } else {\n // Handle case where there are no options\n this.selectElement.value = selectedValues[0] || '';\n }\n }\n\n // Set the initial form value\n this.setFormValue();\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDERING\n\n /**\n * The render method creates the HTML structure for the component, including\n * the label, select element, and any error or description messages. It also\n * applies the appropriate CSS classes based on the readonly state and\n * displayValue prop. This method is called when the component is rendered.\n * @returns {HTMLStencilElement} The HTML element to render.\n */\n render() {\n return (\n <Host>\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.selectId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n <div class=\"select-wrapper\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"select-container\"\n onClick={this.handleSelectContainerClick}\n >\n <slot name=\"leading-input\"></slot>\n\n {this.internalReadonly && (\n <input\n id={this.selectId + '-readonly'}\n type=\"text\"\n value={this.computedDisplayValue}\n readOnly\n class=\"readonly-input\"\n aria-readonly=\"true\"\n aria-label={this.label}\n aria-describedby={\n this.error\n ? `${this.selectId}-error`\n : `${this.selectId}-description`\n }\n />\n )}\n\n <select\n id={this.selectId}\n ref={el => (this.selectElement = el)}\n name={this.name}\n disabled={this.disabled}\n required={this.required}\n multiple={this.multiple}\n onChange={this.handleSelectChange}\n class={this.internalReadonly ? 'hidden' : ''}\n aria-label={this.label}\n aria-describedby={\n this.error\n ? `${this.selectId}-error`\n : `${this.selectId}-description`\n }\n >\n <slot></slot>\n </select>\n\n {this.internalReadonly && (\n <nv-icon name=\"chevron-down\" class=\"readonly-icon\" size=\"sm\" />\n )}\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"sm\" />\n )}\n {this.success && (\n <nv-icon name=\"circle-check\" class=\"validation\" size=\"sm\" />\n )}\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\" id={`${this.selectId}-description`}>\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div class=\"error-description\" id={`${this.selectId}-error`}>\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n\n //#endregion RENDERING\n}\n"],"version":3}
|
|
1
|
+
{"file":"n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C,IAAI,GAAG,CAC7D,EACA,IAAI,CAAC,OAAO,KACXA,sEAAS,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,YAAY,EAAC,IAAI,EAAC,IAAI,GAAG,CAC7D,CACG,EAENA,mEAAM,IAAI,EAAC,aAAa,GAAQ,CAC5B,EAEL,CAAC,IAAI,CAAC,WAAW;YAChB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,sBAAsB,CAAC,MAC7CA,kEAAK,KAAK,EAAC,aAAa,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,cAAc,IACzDA,mEAAM,IAAI,EAAC,aAAa,IAAE,IAAI,CAAC,WAAW,CAAQ,CAC9C,CACP,EAEA,CAAC,IAAI,CAAC,gBAAgB;YACrB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,4BAA4B,CAAC,MACnDA,kEAAK,KAAK,EAAC,mBAAmB,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,QAAQ,IACzDA,mEAAM,IAAI,EAAC,mBAAmB,IAAE,IAAI,CAAC,gBAAgB,CAAQ,CACzD,CACP,CACI,EACP;KACH;;;;;;;;;;;;;","names":["uuidv4","h","Host"],"sources":["src/components/nv-fieldselect/nv-fieldselect.scss?tag=nv-fieldselect","src/components/nv-fieldselect/nv-fieldselect.tsx"],"sourcesContent":["@import \"../../styles/form-field\";\n\n@mixin form-field-select-wrapper() {\n display: flex;\n flex-wrap: wrap;\n gap: var(--form-gap-x);\n align-items: stretch;\n align-self: stretch;\n}\n\n@mixin form-field-select-container() {\n display: flex;\n flex-grow: 1;\n padding: calc(var(--form-field-padding-y) - 1px) var(--form-field-padding-x);\n justify-content: center;\n align-items: center;\n gap: var(--form-field-gap);\n align-self: stretch;\n border-radius: var(--form-field-radius);\n border-width: 1px;\n border-style: solid;\n border-color: var(--nv-field-border-default);\n opacity: var(--components-form-opacity-default);\n background: var(--nv-field-background);\n transition: all 150ms ease-out;\n\n &:hover {\n border-color: var(--nv-field-border-hover);\n }\n\n &:focus-within {\n border-color: var(--nv-field-border-focus);\n box-shadow: 0 0 0 var(--focus-field-stroke) var(--nv-field-focus-box-shadow);\n }\n\n &:has(select:disabled) {\n // opacity: var(--components-form-opacity-disabled, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(--components-form-field-background-disabled);\n border-color: var(--nv-field-border-disabled);\n }\n}\n\n@mixin form-field-select() {\n display: flex;\n align-items: center;\n flex: 1 0 0;\n overflow: hidden;\n background-color: transparent;\n color: var(--components-form-field-content-text);\n text-overflow: ellipsis;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-field-line-height);\n\n &:focus {\n outline: none;\n }\n\n &::placeholder {\n overflow: hidden;\n color: var(--components-form-field-content-placeholder);\n text-overflow: ellipsis;\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 400;\n line-height: var(--form-field-line-height);\n }\n}\n\nnv-fieldselect {\n @include form-field-variables();\n @include form-field-root();\n\n &[readonly]:not([readonly=\"false\"]) {\n @include form-field-readonly-variables();\n }\n\n &[display-value]:not([display-value=\"false\"]) {\n @include form-field-readonly-variables();\n }\n\n &[error]:not([error=\"false\"]) {\n @include form-field-error-variables();\n }\n\n &[success]:not([success=\"false\"]) {\n @include form-field-success-variables();\n }\n\n &[required]:not([required=\"false\"]) label {\n @include form-field-label-required();\n }\n\n label {\n @include form-field-label();\n }\n\n .select-wrapper {\n @include form-field-select-wrapper();\n\n .select-container {\n @include form-field-select-container();\n\n input {\n @include form-field-input();\n\n &:read-only {\n // opacity: var(--components-form-opacity-disabled, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(--components-form-field-background-readonly, rgb(0 0 0 / 10%));\n border-color: var(--nv-field-border-readonly);\n }\n }\n\n select {\n @include form-field-select();\n\n & option {\n background-color: var(--nv-field-background);\n color: var(--components-form-field-content-text, #1d1d1d);\n font-size: var(--form-field-font-size, 16px);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-field-line-height, 24px);\n\n &:checked {\n background-color: var(--color-orange-500);\n color: var(--color-base-content-high-emphasis);\n font-size: var(--form-field-font-size, 16px);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-field-line-height, 24px);\n }\n }\n\n &.hidden {\n display: none;\n }\n }\n\n nv-icon.readonly-icon {\n @include form-field-icon();\n }\n\n nv-icon.validation {\n @include form-field-icon();\n }\n }\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Watch,\n Element,\n State,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * @slot default - Content to be placed inside the select element.\n * @slot leading-input - Content to be placed before the select input, within the select container.\n * @slot before-input - Content to be placed before the select input, outside the select container.\n * @slot after-input - Content to be placed after the select input, outside the select container.\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fieldselect',\n shadow: false,\n formAssociated: true,\n styleUrl: 'nv-fieldselect.scss',\n})\nexport class NvFieldselect {\n @Element() el: HTMLNvFieldselectElement;\n private selectElement!: HTMLSelectElement;\n private internals: ElementInternals;\n\n /****************************************************************************/\n //#region STATES\n\n @State()\n private computedDisplayValue: string = '';\n\n @State()\n private internalReadonly: boolean = false;\n\n //#endregion STATES\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Message defines a 'hint ' message for the Select Field.\n * @deprecated use description instead.\n */\n @Prop()\n readonly message: string;\n\n /**\n * Add the message to the validation state.\n * @deprecated use errorDescription and set the error prop instead.\n */\n @Prop()\n readonly validation: string;\n\n componentWillRender() {\n this.updateDisplayValue(); // Ensure display value is updated before render\n\n if (this.message) {\n this.description = this.message;\n }\n\n if (this.validation) {\n this.errorDescription = this.validation;\n this.error = true;\n }\n }\n\n //#endregion DEPRECATED\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the select element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated\n * to ensure unique identification, facilitating proper label association and\n * accessibility.\n */\n @Prop({ reflect: true })\n readonly selectId: string = uuidv4();\n\n /**\n * Lets you define the text that explains what users should choose in the\n * select field. It’s a crucial element for making forms clear and\n * user-friendly.\n */\n @Prop({ reflect: true })\n readonly label?: string;\n\n /**\n * Add helpful hints or extra information under the select field. This is\n * where you can clarify what users should choose or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true, mutable: true })\n description?: string;\n\n /**\n * Defines the name attribute of the select field, which is crucial for form\n * submission. This value is used as the key in the key-value pair sent to\n * the server, representing the selected data in form submissions. It should be\n * unique within the form to avoid conflicts\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * The disabled prop lets you turn off the select field so that users can’t\n * choose something. When disabled, the field is grayed out and won’t respond to\n * clicks or touches.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Display the select field’s content without allowing users to change it.\n * Users can still click on it, select, and copy the text, but they won’t be\n * able to change or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Marks the select field as required, ensuring that the user must fill it out\n * before submitting the form.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Alters the select field’s appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true, mutable: true })\n error: boolean = false;\n\n /**\n * Show a helpful message under the select field when there’s a problem. It\n * explains what’s wrong and how users can fix it, making the error easier to\n * understand and resolve.\n * @validator message\n */\n @Prop({ reflect: true, mutable: true })\n errorDescription: string;\n\n /**\n * Changes the select field’s appearance to indicate successful input or\n * validation.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * When enabled, allows the select to handle multiple selections.\n */\n @Prop({ reflect: true })\n readonly multiple: boolean = false;\n\n /**\n * The value of the select field.\n * - If `multiple` is `false`, it's a single string.\n * - If `multiple` is `true`, it's a comma-separated string of selected values.\n */\n @Prop({ reflect: true, mutable: true })\n value: string = '';\n\n /**\n * When enabled, displays the value element instead of the label when readonly.\n * By default, the label is displayed in readonly mode. Also it automatically\n * sets the component to readonly.\n */\n @Prop({ reflect: true })\n readonly displayValue: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the selected value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>; // Emit as a string\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n /**\n * Updates the display value when the value property changes. This watcher is\n * used to update the display value when the selected value changes. This is\n * necessary for readonly select fields to display the selected value.\n * @internal This watcher is not intended to be called outside of the component.\n * @param {string} newValue - The new value of the select field.\n */\n @Watch('value')\n updateDisplayValueWatcher(newValue: string) {\n this.updateDisplayValue();\n\n if (this.selectElement) {\n const selectedValues = newValue.split(',').map(val => val.trim());\n const options = this.selectElement.options;\n\n if (options) {\n Array.from(options).forEach(option => {\n option.selected = this.multiple\n ? selectedValues.includes(option.value)\n : option.value === selectedValues[0];\n });\n\n if (!this.multiple) {\n this.selectElement.value = newValue; // Only set when not multiple\n }\n } else {\n this.selectElement.value = selectedValues[0] || '';\n }\n }\n\n // Update form value\n this.setFormValue();\n }\n\n /**\n * Watcher for the displayValue prop to ensure internalReadonly is true when displayValue is true.\n * @param {boolean} newValue - The new value of displayValue.\n */\n @Watch('displayValue')\n handleDisplayValueChange(newValue: boolean) {\n this.internalReadonly = newValue; // Set internalReadonly to true if displayValue is true\n\n if (this.readonly) {\n this.internalReadonly = true;\n }\n }\n\n /**\n * Watcher for the readonly prop to ensure internalReadonly is true when readonly is true.\n * @param {boolean} newValue - The new value of readonly.\n */\n @Watch('readonly')\n handleReadonlyChange(newValue: boolean) {\n this.internalReadonly = newValue; // Set internalReadonly to true if displayValue is true\n\n if (this.displayValue) {\n this.internalReadonly = true;\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles the change event on the select element. This method is used to\n * update the value property when the selected options change. It is also\n * used to emit the selectChanged event when the selected value changes.\n * @param {Event} event - The change event on the select element.\n * @emits selectChanged\n */\n private readonly handleSelectChange = (event: Event) => {\n const select = event.target as HTMLSelectElement;\n let selectedValues: string[] = Array.from(select.selectedOptions).map(\n option => option.value,\n );\n\n if (!this.multiple) {\n selectedValues = selectedValues.slice(0, 1);\n }\n\n this.value = this.multiple\n ? selectedValues.join(', ')\n : selectedValues[0] || '';\n this.valueChanged.emit(this.value);\n\n // Update form value\n this.setFormValue();\n };\n\n /**\n * Handles focus when the select container is clicked.\n */\n private readonly handleSelectContainerClick = () => {\n if (!this.internalReadonly && this.selectElement) {\n this.selectElement.focus();\n }\n };\n\n /**\n * Updates the display value of the select field. This method is used to\n * update the display value when the selected value changes. This is necessary\n * for readonly select fields to display the selected value. This method is\n * called in the componentDidLoad lifecycle hook and the updateDisplayValueWatcher\n * watcher.\n * @internal This method is not intended to be called outside of the component.\n */\n private updateDisplayValue(): void {\n if (this.internalReadonly && !this.displayValue) {\n if (this.multiple) {\n const selectedLabels = this.value\n .split(',')\n .map(key => key.trim())\n .map(key => this.getLabelFromId(key) || '')\n .filter(label => label !== '');\n this.computedDisplayValue = selectedLabels.join(', ') || '';\n } else {\n this.computedDisplayValue = this.getLabelFromId(this.value) || '';\n }\n } else if (this.internalReadonly && this.displayValue) {\n this.computedDisplayValue = this.value || '';\n }\n }\n\n /**\n * Retrieves the label from the <option> elements based on the provided key (value).\n * This method uses the id or value attribute directly from the <select> options.\n * @param {string} key - The key (value) for which to find the corresponding label.\n * @returns {string} The label if found; otherwise, an empty string.\n */\n private getLabelFromId(key: string): string {\n this.ensureSelectElement();\n if (!this.selectElement) {\n return '';\n }\n\n // Cache the option list\n const options = this.selectElement.options;\n\n if (options) {\n const option = Array.from(options).find(option => option.value === key);\n return option ? option.textContent.trim() || '' : '';\n } else {\n return '';\n }\n }\n\n /**\n * Sets the value of the form element for form submission. This method is\n * called when the selected value changes or when the value property is set.\n * @internal This method is not intended to be called outside of the component.\n */\n private setFormValue(): void {\n this.internals.setFormValue(this.value);\n }\n\n /**\n * Ensures the select element is available. This method is used to ensure\n * the select element is available before attempting to access it.\n * @internal This method is not intended to be called outside of the component.\n */\n private ensureSelectElement(): void {\n if (!this.selectElement) {\n this.selectElement = this.el.querySelector('select') as HTMLSelectElement;\n }\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n /**\n * Lifecycle method that is called before the component is rendered. This is\n * where the internal state is set up before rendering occurs.\n */\n componentWillLoad() {\n // Set internalReadonly based on the readonly prop\n this.internalReadonly = this.readonly;\n\n // Ensure internalReadonly is true if displayValue is true during loading\n if (this.displayValue) {\n this.internalReadonly = true;\n }\n\n if ('attachInternals' in this.el) {\n this.internals = (\n this.el as HTMLElement & {\n /**\n * Attach the element to the form internals.\n * @returns {ElementInternals} - The element internals object.\n */\n attachInternals: () => ElementInternals;\n }\n ).attachInternals();\n } else {\n // Fallback logic for browsers without attachInternals support\n this.internals = {\n setFormValue: (value: string) => {\n const formElement = this.el.closest('form');\n if (formElement) {\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = this.name;\n input.value = value;\n formElement.appendChild(input);\n }\n },\n } as ElementInternals;\n }\n\n // Initialize value as an empty string if multiple is true\n if (this.multiple && typeof this.value !== 'string') {\n this.value = '';\n }\n }\n\n /**\n * Lifecycle method that is called after the component has been rendered.\n * This is where the display value is updated and the initial select element's\n * state is set.\n */\n componentDidLoad() {\n this.updateDisplayValue();\n\n if (this.selectElement) {\n // Only set the value for single selection, skip for multiple\n if (!this.multiple) {\n this.selectElement.value = this.value;\n }\n\n const selectedValues = this.multiple\n ? this.value.split(',').map(v => v.trim())\n : [this.value];\n\n const options = this.selectElement.options;\n\n if (options) {\n Array.from(options).forEach(option => {\n option.selected = this.multiple\n ? selectedValues.includes(option.value)\n : option.value === selectedValues[0];\n });\n } else {\n // Handle case where there are no options\n this.selectElement.value = selectedValues[0] || '';\n }\n }\n\n // Set the initial form value\n this.setFormValue();\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDERING\n\n /**\n * The render method creates the HTML structure for the component, including\n * the label, select element, and any error or description messages. It also\n * applies the appropriate CSS classes based on the readonly state and\n * displayValue prop. This method is called when the component is rendered.\n * @returns {HTMLStencilElement} The HTML element to render.\n */\n render() {\n return (\n <Host>\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.selectId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n <div class=\"select-wrapper\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"select-container\"\n onClick={this.handleSelectContainerClick}\n >\n <slot name=\"leading-input\"></slot>\n\n {this.internalReadonly && (\n <input\n id={this.selectId + '-readonly'}\n type=\"text\"\n value={this.computedDisplayValue}\n readOnly\n class=\"readonly-input\"\n aria-readonly=\"true\"\n aria-label={this.label}\n aria-describedby={\n this.error\n ? `${this.selectId}-error`\n : `${this.selectId}-description`\n }\n />\n )}\n\n <select\n id={this.selectId}\n ref={el => (this.selectElement = el)}\n name={this.name}\n disabled={this.disabled}\n required={this.required}\n multiple={this.multiple}\n onChange={this.handleSelectChange}\n class={this.internalReadonly ? 'hidden' : ''}\n aria-label={this.label}\n aria-describedby={\n this.error\n ? `${this.selectId}-error`\n : `${this.selectId}-description`\n }\n >\n <slot></slot>\n </select>\n\n {this.internalReadonly && (\n <nv-icon name=\"chevron-down\" class=\"readonly-icon\" size=\"sm\" />\n )}\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"sm\" />\n )}\n {this.success && (\n <nv-icon name=\"circle-check\" class=\"validation\" size=\"sm\" />\n )}\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\" id={`${this.selectId}-description`}>\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div class=\"error-description\" id={`${this.selectId}-error`}>\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n\n //#endregion RENDERING\n}\n"],"version":3}
|
|
@@ -69,9 +69,9 @@ const NvFieldtext = class {
|
|
|
69
69
|
/****************************************************************************/
|
|
70
70
|
//#region RENDER
|
|
71
71
|
render() {
|
|
72
|
-
return (index.h(index.Host, { key: '
|
|
73
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
74
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '
|
|
72
|
+
return (index.h(index.Host, { key: '8c9c791ef7164a3d1dc248242ced345652fae05d' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '8e768c2299d48e0ec4f2f4052503b38ec07367e9', htmlFor: this.inputId }, index.h("slot", { key: '316e1beffe5534bd1386c9a85818a4fc134de595', name: "label" }, this.label))), index.h("div", { key: '9a52ffcbcf9ef514c108c0f64ab09b0f1c70f80b', class: "input-wrapper" }, index.h("slot", { key: 'bcb5d42ea25518e7d4408f6044ec70343476bd80', name: "before-input" }), index.h("div", { key: '478c7770b2d00c7a0a4182cc4e23b426d74924b9', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: '0b9538c630b6d1e27b439c54e47c31c39cce6001', name: "leading-input" }), index.h("input", { key: '3a3ccf0c9fb16ef47f1c143c4d54a73e400e2b29', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, type: this.type, disabled: this.disabled, readOnly: this.readonly, required: this.required, maxlength: this.maxlength, minlength: this.minlength, pattern: this.pattern, autocomplete: this.autocomplete, multiple: this.multiple, value: this.value, onInput: this.handleInput }), this.error && (index.h("nv-icon", { key: 'cd45c694b5480e3ee92d58ac05e51c97a1dd12f6', name: "alert-circle", class: "validation", size: "sm" })), this.success && (index.h("nv-icon", { key: '6fca533bbceb8c4f4f9ed7dbcd9373df54d8496d', name: "circle-check", class: "validation", size: "sm" }))), index.h("slot", { key: '0ee33ded353265eeed3253b5c9f039b739508a82', name: "after-input" })), (this.description ||
|
|
73
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '12bd5f917245feb4562dd8903c157429ef72dae9', class: "description" }, index.h("slot", { key: '37894343aa3ad21d37dc93f47a27723fdc7cc89a', name: "description" }, this.description))), (this.errorDescription ||
|
|
74
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '04253d575a1c987f48a95e32c41a38e0fe10c3a4', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '2db01455b977c68638271427283d95b811f41d54', name: "error-description" }, this.errorDescription)))));
|
|
75
75
|
}
|
|
76
76
|
static get formAssociated() { return true; }
|
|
77
77
|
get el() { return index.getElement(this); }
|
|
@@ -29,7 +29,7 @@ const NvFieldtextarea = class {
|
|
|
29
29
|
};
|
|
30
30
|
this.message = undefined;
|
|
31
31
|
this.validation = undefined;
|
|
32
|
-
this.
|
|
32
|
+
this.textareaId = v4.v4();
|
|
33
33
|
this.label = undefined;
|
|
34
34
|
this.description = undefined;
|
|
35
35
|
this.placeholder = undefined;
|
|
@@ -133,9 +133,9 @@ const NvFieldtextarea = class {
|
|
|
133
133
|
/****************************************************************************/
|
|
134
134
|
//#region RENDER
|
|
135
135
|
render() {
|
|
136
|
-
return (index.h(index.Host, { key: '
|
|
137
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
138
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '
|
|
136
|
+
return (index.h(index.Host, { key: 'f5b311b7b6ce4ad9d6ff0a63103018a065d8ff66' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '377483fb782672a29a9a9b3824e102587eb166b1', htmlFor: this.textareaId }, index.h("slot", { key: '2705fb3d2736caef5b289fb3338790e62d758d56', name: "label" }, this.label))), index.h("div", { key: '49d270fed9367b58eb1197a9e91d86c36cee90a8', class: "textarea-wrapper" }, index.h("div", { key: '28e591c39cff80eeb5fa6105bafa2423f02b8da9', class: "textarea-container", onClick: this.handleTextareaContainerClick }, index.h("textarea", { key: '0dc54edc1a23221287810ecff5b51c7b91fe2b7b', id: this.textareaId, ref: e => (this.textareaElement = e), placeholder: this.placeholder, name: this.name, disabled: this.disabled, readOnly: this.readonly, required: this.required, maxlength: this.maxlength, minlength: this.minlength, autocomplete: "off", value: this.value, onInput: this.handleTextarea, rows: this.rows, class: clsx.clsx(this.getResize()) }))), (this.description ||
|
|
137
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '32f6d57c4c3fa1fb937c8b92ef630280bc4238e1', class: "description" }, index.h("slot", { key: '1896e7a524753172cdeb19aa21fc83afd394c1a7', name: "description" }, this.description))), (this.errorDescription ||
|
|
138
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '94757defcafe57f7074871f81987a2733f509f88', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '561620515caa5c115c9bd8bb9139bf7fa29e22fb', name: "error-description" }, this.errorDescription)))));
|
|
139
139
|
}
|
|
140
140
|
static get formAssociated() { return true; }
|
|
141
141
|
get el() { return index.getElement(this); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"nv-fieldtextarea.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,kBAAkB,GAAG,o2JAAo2J,CAAC;AACh4J,8BAAe,kBAAkB;;MCuBpB,eAAe;;;;;;;QAyNlB,mBAAc,GAAG,CAAC,KAAY;YACpC,MAAM,QAAQ,GAAG,KAAK,CAAC,MAA6B,CAAC;YACrD,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;YAC5B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAEvC,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACjB,IAAI,CAAC,oBAAoB,EAAE,CAA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,IAE1CA,uEACE,EAAE,EAAE,IAAI,CAAC,OAAO,EAChB,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,EACpC,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,YAAY,EAAC,KAAK,EAClB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,cAAc,EAC5B,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAEE,SAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,GAC7B,CACE,CACF,EAEL,CAAC,IAAI,CAAC,WAAW;YAChB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,sBAAsB,CAAC,MAC7CF,kEAAK,KAAK,EAAC,aAAa,IACtBA,mEAAM,IAAI,EAAC,aAAa,IAAE,IAAI,CAAC,WAAW,CAAQ,CAC9C,CACP,EAEA,CAAC,IAAI,CAAC,gBAAgB;YACrB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,4BAA4B,CAAC,MACnDA,kEAAK,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAC,mBAAmB,IACjDA,mEAAM,IAAI,EAAC,mBAAmB,IAAE,IAAI,CAAC,gBAAgB,CAAQ,CACzD,CACP,CACI,EACP;KACH;;;;;;;;;;;;","names":["uuidv4","h","Host","clsx"],"sources":["src/components/nv-fieldtextarea/nv-fieldtextarea.scss?tag=nv-fieldtextarea","src/components/nv-fieldtextarea/nv-fieldtextarea.tsx"],"sourcesContent":["@import \"../../styles/form-field\";\n\n@mixin form-field-textarea-wrapper() {\n display: flex;\n flex-wrap: wrap;\n gap: var(--form-gap-x);\n align-items: stretch;\n align-self: stretch;\n}\n\n@mixin form-field-textarea-container() {\n display: flex;\n flex-grow: 1;\n padding: calc(var(--form-field-padding-y) - 1px) var(--form-field-padding-x);\n justify-content: center;\n align-items: center;\n gap: var(--form-field-gap);\n align-self: stretch;\n border-radius: var(--form-field-radius);\n border-width: 1px;\n border-style: solid;\n border-color: var(--nv-field-border-default);\n opacity: var(--components-form-opacity-default);\n background: var(--nv-field-background);\n transition: all 150ms ease-out;\n\n &:hover {\n border-color: var(--nv-field-border-hover);\n }\n\n &:focus-within {\n border-color: var(--nv-field-border-focus);\n box-shadow: 0 0 0 var(--focus-field-stroke) var(--nv-field-focus-box-shadow);\n }\n // Keep ReadOnly before Disabled\n &:has(textarea:read-only) {\n // opacity: var(--components-form-opacity-readonly, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(--components-form-field-background-readonly);\n border-color: var(--nv-field-border-readonly);\n }\n\n &:has(textarea:disabled) {\n // opacity: var(--components-form-opacity-disabled, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(--components-form-field-background-disabled);\n border-color: var(--nv-field-border-disabled);\n }\n}\n\n@mixin form-field-textarea() {\n display: flex;\n align-items: center;\n flex: 1 0 0;\n overflow: hidden;\n background-color: transparent;\n color: var(--components-form-field-content-text);\n text-overflow: ellipsis;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-field-line-height);\n\n &:focus {\n outline: none;\n }\n\n &::placeholder {\n overflow: hidden;\n color: var(--components-form-field-content-placeholder);\n text-overflow: ellipsis;\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 400;\n line-height: var(--form-field-line-height);\n }\n}\n\nnv-fieldtextarea {\n @include form-field-variables();\n @include form-field-root();\n\n &[readonly]:not([readonly=\"false\"]) {\n @include form-field-readonly-variables();\n }\n\n &[error]:not([error=\"false\"]) {\n @include form-field-error-variables();\n }\n\n &[success]:not([success=\"false\"]) {\n @include form-field-success-variables();\n }\n\n &[required]:not([required=\"false\"]) label {\n @include form-field-label-required();\n }\n\n label {\n @include form-field-label();\n }\n\n .textarea-wrapper {\n @include form-field-textarea-wrapper();\n\n .textarea-container {\n @include form-field-textarea-container();\n\n textarea {\n @include form-field-textarea();\n }\n\n nv-icon.validation {\n @include form-field-icon();\n }\n }\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Element,\n Watch,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\nimport clsx from 'clsx';\n\n/**\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fieldtextarea',\n shadow: false,\n formAssociated: true,\n styleUrl: 'nv-fieldtextarea.scss',\n})\nexport class NvFieldtextarea {\n @Element() el: HTMLNvFieldtextareaElement;\n private textareaElement!: HTMLTextAreaElement;\n\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Message defines a 'hint ' message for the Text Field.\n * @deprecated use description instead.\n */\n @Prop()\n readonly message: string;\n\n /**\n * Add the message to the validation state.\n * @deprecated use errorDescription and set the error prop instead.\n */\n @Prop()\n readonly validation: string;\n\n componentWillRender() {\n if (this.message) {\n this.description = this.message;\n }\n\n if (this.validation) {\n this.errorDescription = this.validation;\n this.error = true;\n }\n }\n\n //#endregion DEPRECATED\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated\n * to ensure unique identification, facilitating proper label association and\n * accessibility.\n */\n @Prop({ reflect: true })\n readonly inputId: string = uuidv4();\n\n /**\n * Lets you define the text that explains what users should enter in the text\n * textarea field. It’s a crucial element for making forms clear and\n * user-friendly.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Add helpful hints or extra information under the text textarea field. This is\n * where you can clarify what users should enter or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true, mutable: true })\n description: string;\n\n /**\n * Display temporary text inside the textarea field to give users a hint about\n * what to type. It’s a great way to provide examples or suggestions directly\n * in the field before they start typing.\n */\n @Prop({ reflect: true })\n readonly placeholder: string;\n\n /**\n * Defines the name attribute of the textarea field, which is crucial for form\n * submission. This value is used as the key in the key-value pair sent to\n * the server, representing the textarea’s data in form submissions. It should be\n * unique within the form to avoid conflicts\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * Specifies the value of the textarea field, which determines the text displayed\n * within the field. This prop is typically used in controlled components\n * where the textarea’s value is managed by the component’s state.\n */\n @Prop({ reflect: true, mutable: true })\n value: string;\n\n /**\n * The disabled prop lets you turn off the textarea field so that users can’t\n * type in it. When disabled, the field is grayed out and won’t respond to#\n * clicks or touches.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Display the textarea field’s content without allowing users to change it.\n * Users can still click on it, select, and copy the text, but they won’t be\n * able to type or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Marks the textarea field as required, ensuring that the user must fill it out\n * before submitting the form.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Alters the textarea field’s appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true, mutable: true })\n error: boolean = false;\n\n /**\n * Show a helpful message under the textarea field when there’s a problem. It\n * explains what’s wrong and how users can fix it, making the error easier to\n * understand and resolve.\n * @validator message\n */\n @Prop({ reflect: true, mutable: true })\n errorDescription: string;\n\n /**\n * Changes the textarea field’s appearance to indicate successful textarea or\n * validation.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * Limits how many characters users can type into the textarea field. It’s\n * helpful for making sure users don’t enter too much information, keeping\n * their textarea within the allowed limit.\n */\n @Prop({ reflect: true })\n readonly maxlength: number;\n\n /**\n * Ensures that users type at least a certain number of characters into the\n * textarea field. It’s a way to make sure users provide enough information\n * before moving on.\n */\n @Prop({ reflect: true })\n readonly minlength: number;\n\n /**\n * The number of visible text lines for the control. The default is 3. This\n * can be useful when you want to limit the size of the textarea field or when\n * you want to make the textarea field smaller to fit a specific layout. The\n * textarea field will expand vertically to fit the text as the user types.\n */\n @Prop({ reflect: true })\n readonly rows: number = 3;\n\n /**\n * Controls the resize property of a textarea. It can be set to none, both,\n * horizontal, or vertical. The default is vertical.\n */\n @Prop({ reflect: true })\n readonly resize: 'none' | 'both' | 'horizontal' | 'vertical' = 'vertical';\n\n /**\n * Enable this to make the textarea automatically resize as the user types,\n * adjusting the height to fit the content. For the best experience, avoid\n * vertical resizing, as it’s controlled by this feature. Horizontal resizing\n * can still be allowed if desired.\n */\n @Prop({ reflect: true })\n readonly autosize: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the textarea value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n /**\n * If autosize is true, we need to make sure to update the min-height when\n * the rows change.\n */\n @Watch('rows')\n rowsChanged() {\n if (this.autosize) {\n this.adjustTextareaHeight();\n }\n }\n\n /**\n * If autosize is true, we need to make sure to update the height and\n * min-height, if false, we need to remove the height property.\n */\n @Watch('autosize')\n autosizeChanged() {\n if (this.autosize) {\n this.adjustTextareaHeight();\n } else {\n this.textareaElement?.style.removeProperty('height');\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region METHODS\n\n private handleTextarea = (event: Event) => {\n const textarea = event.target as HTMLTextAreaElement;\n this.value = textarea.value;\n this.valueChanged.emit(textarea.value);\n\n if (this.autosize) {\n this.adjustTextareaHeight();\n }\n };\n\n private handleTextareaContainerClick = () => {\n this.textareaElement.focus();\n };\n\n private adjustTextareaHeight() {\n if (this.textareaElement && this.autosize) {\n this.textareaElement.style.height = 'auto';\n\n // Get computed styles\n const computedStyle = window.getComputedStyle(this.textareaElement);\n const lineHeight = parseFloat(computedStyle.lineHeight);\n const paddingTop = parseFloat(computedStyle.paddingTop);\n const paddingBottom = parseFloat(computedStyle.paddingBottom);\n const borderTopWidth = parseFloat(computedStyle.borderTopWidth);\n const borderBottomWidth = parseFloat(computedStyle.borderBottomWidth);\n\n // Calculate min-height based on rows\n const minHeight =\n lineHeight * this.rows +\n paddingTop +\n paddingBottom +\n borderTopWidth +\n borderBottomWidth;\n\n this.textareaElement.style.minHeight = `${minHeight}px`;\n this.textareaElement.style.height =\n this.textareaElement.scrollHeight + 'px';\n }\n }\n\n /**\n * Class Properties\n * resize-none\tresize: none;\n * resize-y\t resize: vertical;\n * resize-x\t resize: horizontal;\n * resize\t resize: both;\n * @returns {string} The resize class.\n */\n private getResize() {\n if (this.resize === 'none') return 'resize-none';\n if (this.resize === 'vertical') return 'resize-y';\n if (this.resize === 'horizontal') return 'resize-x';\n if (this.resize === 'both') return 'resize';\n return 'resize-none';\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentDidLoad() {\n if (this.autosize) {\n this.adjustTextareaHeight();\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host>\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.inputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n <div class=\"textarea-wrapper\">\n <div\n class=\"textarea-container\"\n onClick={this.handleTextareaContainerClick}\n >\n <textarea\n id={this.inputId}\n ref={e => (this.textareaElement = e)}\n placeholder={this.placeholder}\n name={this.name}\n disabled={this.disabled}\n readOnly={this.readonly}\n required={this.required}\n maxlength={this.maxlength}\n minlength={this.minlength}\n autocomplete=\"off\"\n value={this.value}\n onInput={this.handleTextarea}\n rows={this.rows}\n class={clsx(this.getResize())}\n />\n </div>\n </div>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div hidden={!this.error} class=\"error-description\">\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
|
|
1
|
+
{"file":"nv-fieldtextarea.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,kBAAkB,GAAG,o2JAAo2J,CAAC;AACh4J,8BAAe,kBAAkB;;MCuBpB,eAAe;;;;;;;QAyNlB,mBAAc,GAAG,CAAC,KAAY;YACpC,MAAM,QAAQ,GAAG,KAAK,CAAC,MAA6B,CAAC;YACrD,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;YAC5B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAEvC,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACjB,IAAI,CAAC,oBAAoB,EAAE,CAAC;aAC7B;SACF,CAAC;QAEM,iCAA4B,GAAG;YACrC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;SAC9B,CAAC;;;0BA1L4BA,KAAM,EAAE;;;;;;wBAiDT,KAAK;wBAQL,KAAK;wBAOL,KAAK;qBAQjB,KAAK;;uBAgBM,KAAK;;;oBAyBT,CAAC;sBAOsC,UAAU;wBAS5C,KAAK;;IAvJlC,mBAAmB;QACjB,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC;SACjC;QAED,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC;YACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;SACnB;KACF;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,KAAK,EAAEE,SAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,GAC7B,CACE,CACF,EAEL,CAAC,IAAI,CAAC,WAAW;YAChB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,sBAAsB,CAAC,MAC7CF,kEAAK,KAAK,EAAC,aAAa,IACtBA,mEAAM,IAAI,EAAC,aAAa,IAAE,IAAI,CAAC,WAAW,CAAQ,CAC9C,CACP,EAEA,CAAC,IAAI,CAAC,gBAAgB;YACrB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,4BAA4B,CAAC,MACnDA,kEAAK,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAC,mBAAmB,IACjDA,mEAAM,IAAI,EAAC,mBAAmB,IAAE,IAAI,CAAC,gBAAgB,CAAQ,CACzD,CACP,CACI,EACP;KACH;;;;;;;;;;;;","names":["uuidv4","h","Host","clsx"],"sources":["src/components/nv-fieldtextarea/nv-fieldtextarea.scss?tag=nv-fieldtextarea","src/components/nv-fieldtextarea/nv-fieldtextarea.tsx"],"sourcesContent":["@import \"../../styles/form-field\";\n\n@mixin form-field-textarea-wrapper() {\n display: flex;\n flex-wrap: wrap;\n gap: var(--form-gap-x);\n align-items: stretch;\n align-self: stretch;\n}\n\n@mixin form-field-textarea-container() {\n display: flex;\n flex-grow: 1;\n padding: calc(var(--form-field-padding-y) - 1px) var(--form-field-padding-x);\n justify-content: center;\n align-items: center;\n gap: var(--form-field-gap);\n align-self: stretch;\n border-radius: var(--form-field-radius);\n border-width: 1px;\n border-style: solid;\n border-color: var(--nv-field-border-default);\n opacity: var(--components-form-opacity-default);\n background: var(--nv-field-background);\n transition: all 150ms ease-out;\n\n &:hover {\n border-color: var(--nv-field-border-hover);\n }\n\n &:focus-within {\n border-color: var(--nv-field-border-focus);\n box-shadow: 0 0 0 var(--focus-field-stroke) var(--nv-field-focus-box-shadow);\n }\n // Keep ReadOnly before Disabled\n &:has(textarea:read-only) {\n // opacity: var(--components-form-opacity-readonly, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(--components-form-field-background-readonly);\n border-color: var(--nv-field-border-readonly);\n }\n\n &:has(textarea:disabled) {\n // opacity: var(--components-form-opacity-disabled, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(--components-form-field-background-disabled);\n border-color: var(--nv-field-border-disabled);\n }\n}\n\n@mixin form-field-textarea() {\n display: flex;\n align-items: center;\n flex: 1 0 0;\n overflow: hidden;\n background-color: transparent;\n color: var(--components-form-field-content-text);\n text-overflow: ellipsis;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-field-line-height);\n\n &:focus {\n outline: none;\n }\n\n &::placeholder {\n overflow: hidden;\n color: var(--components-form-field-content-placeholder);\n text-overflow: ellipsis;\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 400;\n line-height: var(--form-field-line-height);\n }\n}\n\nnv-fieldtextarea {\n @include form-field-variables();\n @include form-field-root();\n\n &[readonly]:not([readonly=\"false\"]) {\n @include form-field-readonly-variables();\n }\n\n &[error]:not([error=\"false\"]) {\n @include form-field-error-variables();\n }\n\n &[success]:not([success=\"false\"]) {\n @include form-field-success-variables();\n }\n\n &[required]:not([required=\"false\"]) label {\n @include form-field-label-required();\n }\n\n label {\n @include form-field-label();\n }\n\n .textarea-wrapper {\n @include form-field-textarea-wrapper();\n\n .textarea-container {\n @include form-field-textarea-container();\n\n textarea {\n @include form-field-textarea();\n }\n\n nv-icon.validation {\n @include form-field-icon();\n }\n }\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Element,\n Watch,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\nimport clsx from 'clsx';\n\n/**\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fieldtextarea',\n shadow: false,\n formAssociated: true,\n styleUrl: 'nv-fieldtextarea.scss',\n})\nexport class NvFieldtextarea {\n @Element() el: HTMLNvFieldtextareaElement;\n private textareaElement!: HTMLTextAreaElement;\n\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Message defines a 'hint ' message for the Text Field.\n * @deprecated use description instead.\n */\n @Prop()\n readonly message: string;\n\n /**\n * Add the message to the validation state.\n * @deprecated use errorDescription and set the error prop instead.\n */\n @Prop()\n readonly validation: string;\n\n componentWillRender() {\n if (this.message) {\n this.description = this.message;\n }\n\n if (this.validation) {\n this.errorDescription = this.validation;\n this.error = true;\n }\n }\n\n //#endregion DEPRECATED\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the textarea element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated\n * to ensure unique identification, facilitating proper label association and\n * accessibility.\n */\n @Prop({ reflect: true })\n readonly textareaId: string = uuidv4();\n\n /**\n * Lets you define the text that explains what users should enter in the text\n * textarea field. It’s a crucial element for making forms clear and\n * user-friendly.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Add helpful hints or extra information under the text textarea field. This is\n * where you can clarify what users should enter or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true, mutable: true })\n description: string;\n\n /**\n * Display temporary text inside the textarea field to give users a hint about\n * what to type. It’s a great way to provide examples or suggestions directly\n * in the field before they start typing.\n */\n @Prop({ reflect: true })\n readonly placeholder: string;\n\n /**\n * Defines the name attribute of the textarea field, which is crucial for form\n * submission. This value is used as the key in the key-value pair sent to\n * the server, representing the textarea’s data in form submissions. It should be\n * unique within the form to avoid conflicts\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * Specifies the value of the textarea field, which determines the text displayed\n * within the field. This prop is typically used in controlled components\n * where the textarea’s value is managed by the component’s state.\n */\n @Prop({ reflect: true, mutable: true })\n value: string;\n\n /**\n * The disabled prop lets you turn off the textarea field so that users can’t\n * type in it. When disabled, the field is grayed out and won’t respond to#\n * clicks or touches.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Display the textarea field’s content without allowing users to change it.\n * Users can still click on it, select, and copy the text, but they won’t be\n * able to type or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Marks the textarea field as required, ensuring that the user must fill it out\n * before submitting the form.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Alters the textarea field’s appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true, mutable: true })\n error: boolean = false;\n\n /**\n * Show a helpful message under the textarea field when there’s a problem. It\n * explains what’s wrong and how users can fix it, making the error easier to\n * understand and resolve.\n * @validator message\n */\n @Prop({ reflect: true, mutable: true })\n errorDescription: string;\n\n /**\n * Changes the textarea field’s appearance to indicate successful textarea or\n * validation.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * Limits how many characters users can type into the textarea field. It’s\n * helpful for making sure users don’t enter too much information, keeping\n * their textarea within the allowed limit.\n */\n @Prop({ reflect: true })\n readonly maxlength: number;\n\n /**\n * Ensures that users type at least a certain number of characters into the\n * textarea field. It’s a way to make sure users provide enough information\n * before moving on.\n */\n @Prop({ reflect: true })\n readonly minlength: number;\n\n /**\n * The number of visible text lines for the control. The default is 3. This\n * can be useful when you want to limit the size of the textarea field or when\n * you want to make the textarea field smaller to fit a specific layout. The\n * textarea field will expand vertically to fit the text as the user types.\n */\n @Prop({ reflect: true })\n readonly rows: number = 3;\n\n /**\n * Controls the resize property of a textarea. It can be set to none, both,\n * horizontal, or vertical. The default is vertical.\n */\n @Prop({ reflect: true })\n readonly resize: 'none' | 'both' | 'horizontal' | 'vertical' = 'vertical';\n\n /**\n * Enable this to make the textarea automatically resize as the user types,\n * adjusting the height to fit the content. For the best experience, avoid\n * vertical resizing, as it’s controlled by this feature. Horizontal resizing\n * can still be allowed if desired.\n */\n @Prop({ reflect: true })\n readonly autosize: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the textarea value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n /**\n * If autosize is true, we need to make sure to update the min-height when\n * the rows change.\n */\n @Watch('rows')\n rowsChanged() {\n if (this.autosize) {\n this.adjustTextareaHeight();\n }\n }\n\n /**\n * If autosize is true, we need to make sure to update the height and\n * min-height, if false, we need to remove the height property.\n */\n @Watch('autosize')\n autosizeChanged() {\n if (this.autosize) {\n this.adjustTextareaHeight();\n } else {\n this.textareaElement?.style.removeProperty('height');\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region METHODS\n\n private handleTextarea = (event: Event) => {\n const textarea = event.target as HTMLTextAreaElement;\n this.value = textarea.value;\n this.valueChanged.emit(textarea.value);\n\n if (this.autosize) {\n this.adjustTextareaHeight();\n }\n };\n\n private handleTextareaContainerClick = () => {\n this.textareaElement.focus();\n };\n\n private adjustTextareaHeight() {\n if (this.textareaElement && this.autosize) {\n this.textareaElement.style.height = 'auto';\n\n // Get computed styles\n const computedStyle = window.getComputedStyle(this.textareaElement);\n const lineHeight = parseFloat(computedStyle.lineHeight);\n const paddingTop = parseFloat(computedStyle.paddingTop);\n const paddingBottom = parseFloat(computedStyle.paddingBottom);\n const borderTopWidth = parseFloat(computedStyle.borderTopWidth);\n const borderBottomWidth = parseFloat(computedStyle.borderBottomWidth);\n\n // Calculate min-height based on rows\n const minHeight =\n lineHeight * this.rows +\n paddingTop +\n paddingBottom +\n borderTopWidth +\n borderBottomWidth;\n\n this.textareaElement.style.minHeight = `${minHeight}px`;\n this.textareaElement.style.height =\n this.textareaElement.scrollHeight + 'px';\n }\n }\n\n /**\n * Class Properties\n * resize-none\tresize: none;\n * resize-y\t resize: vertical;\n * resize-x\t resize: horizontal;\n * resize\t resize: both;\n * @returns {string} The resize class.\n */\n private getResize() {\n if (this.resize === 'none') return 'resize-none';\n if (this.resize === 'vertical') return 'resize-y';\n if (this.resize === 'horizontal') return 'resize-x';\n if (this.resize === 'both') return 'resize';\n return 'resize-none';\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentDidLoad() {\n if (this.autosize) {\n this.adjustTextareaHeight();\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host>\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.textareaId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n <div class=\"textarea-wrapper\">\n <div\n class=\"textarea-container\"\n onClick={this.handleTextareaContainerClick}\n >\n <textarea\n id={this.textareaId}\n ref={e => (this.textareaElement = e)}\n placeholder={this.placeholder}\n name={this.name}\n disabled={this.disabled}\n readOnly={this.readonly}\n required={this.required}\n maxlength={this.maxlength}\n minlength={this.minlength}\n autocomplete=\"off\"\n value={this.value}\n onInput={this.handleTextarea}\n rows={this.rows}\n class={clsx(this.getResize())}\n />\n </div>\n </div>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div hidden={!this.error} class=\"error-description\">\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
|
|
@@ -24,7 +24,9 @@ const NvFieldtoggle = class {
|
|
|
24
24
|
this.disabled = false;
|
|
25
25
|
this.readonly = false;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
//#endregion EVENTS
|
|
28
|
+
/****************************************************************************/
|
|
29
|
+
//#region WATCHERS
|
|
28
30
|
/**
|
|
29
31
|
* Watches for changes to the checked state and emits the new value.
|
|
30
32
|
* @param {boolean} checked - The new value of the checked state.
|
|
@@ -47,10 +49,12 @@ const NvFieldtoggle = class {
|
|
|
47
49
|
this.checked = target.checked;
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
|
-
|
|
52
|
+
//#endregion WATCHERS
|
|
53
|
+
/****************************************************************************/
|
|
54
|
+
//#region RENDER
|
|
51
55
|
render() {
|
|
52
|
-
return (index.h(index.Host, { key: '
|
|
53
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
56
|
+
return (index.h(index.Host, { key: '18603a99c814b19f77a3e78f4a7dd3960bdc0841', class: clsx.clsx(this.labelPlacement === 'before' && 'label-placement-before') }, index.h("div", { key: '3fb419bde30424ee2abdb63d75ef8ef3c78754c8', class: "input-container" }, index.h("input", { key: '2c6d98d5c1e05bb33832c48fbe4b2e68f133a70f', type: "checkbox", id: this.inputId, name: this.name, autocomplete: "off", value: this.value, checked: Boolean(this.checked), disabled: this.disabled || this.readonly, readonly: this.readonly })), index.h("div", { key: 'cc81c4e259750d75fb4e799365da64cedb71304c', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '44177bd0153a833d5b5ef7a4e2e1d6dedfea3c91', htmlFor: this.inputId, class: clsx.clsx(this.hideLabel && 'visually-hidden') }, index.h("slot", { key: '05719cf662559b26b3074e4b9bd67ed908e4c9bf', name: "label" }, this.label))), (this.description ||
|
|
57
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: 'db2e5122431af687ce42c85476bb38bca868ee26', class: "description" }, index.h("slot", { key: '68256d968071f13d7441b1801d17162b91021a8b', name: "description" }, this.description))))));
|
|
54
58
|
}
|
|
55
59
|
get el() { return index.getElement(this); }
|
|
56
60
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"nv-fieldtoggle.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,gBAAgB,GAAG,ilHAAilH,CAAC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AC,OAAO,EACrB,KAAK,EAAEE,SAAI,CAAC,IAAI,CAAC,SAAS,IAAI,iBAAiB,CAAC,IAEhDF,mEAAM,IAAI,EAAC,OAAO,IAAE,IAAI,CAAC,KAAK,CAAQ,CAChC,CACT,EAEA,CAAC,IAAI,CAAC,WAAW;YAChB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,sBAAsB,CAAC,MAC7CA,kEAAK,KAAK,EAAC,aAAa,IACtBA,mEAAM,IAAI,EAAC,aAAa,IAAE,IAAI,CAAC,WAAW,CAAQ,CAC9C,CACP,CACG,CACD,EACP;KACH;;;;;;;;;;","names":["uuidv4","h","Host","clsx"],"sources":["src/components/nv-fieldtoggle/nv-fieldtoggle.scss?tag=nv-fieldtoggle","src/components/nv-fieldtoggle/nv-fieldtoggle.tsx"],"sourcesContent":["@import \"../../styles/focus-ring\";\n\n@mixin root-styles() {\n display: inline-flex;\n align-items: flex-start;\n gap: var(--form-gap-x);\n position: relative;\n\n &:not([disabled], [readonly]) {\n input,\n label {\n cursor: pointer;\n }\n }\n}\n\n@mixin label-before-styles() {\n flex-direction: row-reverse;\n}\n\n@mixin label-styles() {\n align-self: stretch;\n color: var(--components-form-text-label-default);\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-label-font-size);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-label-line-height);\n}\n\n@mixin description-styles() {\n align-self: stretch;\n color: var(--components-form-text-description-default);\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-description-font-size);\n font-style: normal;\n font-weight: 450;\n line-height: var(--form-description-line-height);\n}\n\n@mixin text-container-styles() {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n flex: 1 0 0;\n}\n\n@mixin input-container-styles() {\n position: relative;\n color: var(--components-form-shape-foreground-default);\n\n &:has(input[type=\"checkbox\"]:disabled:not([readonly])) {\n color: var(--components-form-shape-foreground-disabled);\n }\n}\n\n@mixin input-styles() {\n appearance: none;\n position: relative;\n display: flex;\n width: var(--form-toggle-width);\n height: var(--form-toggle-height);\n flex-direction: column;\n align-items: flex-start;\n border-radius: var(--form-toggle-radius);\n border-width: var(--form-toggle-border-width);\n border-style: solid;\n border-color: var(--components-form-field-border-default);\n background: var(--components-form-field-background-default);\n\n &::after {\n content: '';\n display: block;\n width: var(--form-toggle-switch-dot-default);\n height: var(--form-toggle-switch-dot-default);\n background-color: var(--components-form-shape-foreground-switch-dot);\n border-radius: var(--radius-rounded-full);\n position: absolute;\n top: 50%;\n left: 25%;\n transform: translate(-50%, -50%);\n }\n\n &:hover {\n border-color: var(--components-form-field-border-hover);\n }\n\n &:focus {\n border-color: var(--components-form-field-border-default);\n }\n\n @include focus-ring();\n\n &:checked {\n background: var(--components-form-field-background-checked);\n border-color: var(--components-form-field-background-checked);\n\n &::after {\n content: '';\n display: block;\n width: var(--form-toggle-switch-dot-default);\n height: var(--form-toggle-switch-dot-default);\n background-color: var(--components-form-shape-foreground-default);\n border-radius: var(--radius-rounded-full);\n position: absolute;\n top: 50%;\n left: 75%;\n transform: translate(-50%, -50%);\n }\n\n &:focus {\n background: var(--components-form-field-background-checked);\n border-color: var(--components-form-field-border-focus);\n }\n }\n\n &:disabled:not([readonly]) {\n box-shadow: unset;\n background: var(--components-form-field-background-disabled);\n border-color: var(--components-form-field-border-default);\n\n &:checked {\n &::after {\n background-color: var(--components-form-shape-foreground-disabled);\n }\n }\n }\n}\n\nnv-fieldtoggle {\n @include root-styles();\n\n &.label-placement-before {\n @include label-before-styles();\n }\n\n &[disabled] {\n // TODO: Find a way to use the --components-form-opacity-disabled variable properly, right now it outputs a value of 50px instead of 0.5.\n // opacity: var(--components-form-opacity-disabled); Error: Invalid value for --components-form-opacity-disabled (expected a <number> but got \"50px\")\n opacity: 0.5;\n }\n label {\n @include label-styles();\n }\n\n .input-container {\n @include input-container-styles();\n\n input[type=\"checkbox\"] {\n @include input-styles();\n }\n }\n\n .description {\n @include description-styles();\n }\n\n .text-container {\n @include text-container-styles();\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Element,\n Watch,\n Event,\n EventEmitter,\n Listen,\n} from '@stencil/core';\nimport clsx from 'clsx';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { type FieldLabelPlacement } from '../../utils/constants';\n\n/**\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n */\n@Component({\n tag: 'nv-fieldtoggle',\n styleUrl: 'nv-fieldtoggle.scss',\n shadow: false,\n})\nexport class NvFieldtoggle {\n @Element() el!: HTMLNvFieldtoggleElement;\n\n /******************************** PROPERTIES ********************************/\n /**\n * Sets the ID for the radio button’s input element and the for attribute of\n * the associated label. If no ID is provided, a random one will be\n * automatically generated to ensure unique identification, facilitating\n * proper label association and accessibility.\n */\n @Prop()\n readonly inputId: string = uuidv4();\n\n /**\n * The name attribute for the toggle input, used to reference the form data\n * after submission.\n */\n @Prop()\n readonly name?: string;\n\n /**\n * The value attribute of the toggle input, representing the value sent on\n * form submission when the toggle is checked.\n */\n @Prop()\n readonly value?: string;\n\n /** The label displayed next to the toggle.*/\n @Prop()\n readonly label?: string;\n\n /**\n * Determines the position of the label relative to the toggle, either\n * 'start' (before) or 'end' (after).\n */\n @Prop({ reflect: true })\n readonly labelPlacement: `${FieldLabelPlacement}`;\n\n /**\n * Hides the label visually while still keeping it available for screen\n * readers.\n */\n @Prop()\n readonly hideLabel: boolean = false;\n\n /**\n * A description providing additional context or information about the\n * toggle.\n */\n @Prop({ reflect: true })\n readonly description?: string;\n\n /** Indicates whether the toggle is checked or not. */\n @Prop({ reflect: true, mutable: true })\n checked: boolean = false;\n\n /** Disables the toggle, preventing user interaction. */\n @Prop()\n readonly disabled: boolean = false;\n\n /**\n * Sets the toggle to read-only, preventing user changes but still allowing\n * focus and selection of text.\n */\n @Prop()\n readonly readonly: boolean = false;\n\n /******************************** EVENTS ************************************/\n /**\n * Emits when the checked state changes.\n * @bind checked\n */\n @Event()\n checkedChanged: EventEmitter<boolean>;\n\n /****************************** WATCHERS ************************************/\n /**\n * Watches for changes to the checked state and emits the new value.\n * @param {boolean} checked - The new value of the checked state.\n */\n @Watch('checked')\n onCheckedChanged(checked: boolean) {\n this.checkedChanged.emit(checked);\n }\n\n /**\n * Listens for the change event on the toggle input element and updates the checked state.\n * the checked state of the host elements.\n * @param {Event} event - The change event.\n */\n @Listen('change')\n handleChange(event: Event) {\n const target = event.target as HTMLInputElement;\n\n if (target.type === 'checkbox' && target.id === this.inputId) {\n if (this.readonly || this.disabled) {\n event.preventDefault();\n return;\n }\n\n this.checked = target.checked;\n }\n }\n\n /********************************* RENDER ***********************************/\n render() {\n return (\n <Host\n class={clsx(\n this.labelPlacement === 'before' && 'label-placement-before',\n )}\n >\n <div class=\"input-container\">\n <input\n type=\"checkbox\"\n id={this.inputId}\n name={this.name}\n autocomplete=\"off\"\n value={this.value}\n checked={Boolean(this.checked)}\n disabled={this.disabled || this.readonly}\n readonly={this.readonly}\n />\n </div>\n\n <div class=\"text-container\">\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label\n htmlFor={this.inputId}\n class={clsx(this.hideLabel && 'visually-hidden')}\n >\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"nv-fieldtoggle.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,gBAAgB,GAAG,ilHAAilH,CAAC;AAC3mH,4BAAe,gBAAgB;;MCwBlB,aAAa;;;;uBAaGA,KAAM,EAAE;;;;;yBAgCL,KAAK;;uBAWhB,KAAK;wBAIK,KAAK;wBAOL,KAAK;;;;;;;;;IAsBlC,gBAAgB,CAAC,OAAgB;QAC/B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KACnC;;;;;;IAQD,YAAY,CAAC,KAAY;QACvB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EAAC,aAAa,IACtBA,mEAAM,IAAI,EAAC,aAAa,IAAE,IAAI,CAAC,WAAW,CAAQ,CAC9C,CACP,CACG,CACD,EACP;KACH;;;;;;;;;;","names":["uuidv4","h","Host","clsx"],"sources":["src/components/nv-fieldtoggle/nv-fieldtoggle.scss?tag=nv-fieldtoggle","src/components/nv-fieldtoggle/nv-fieldtoggle.tsx"],"sourcesContent":["@import \"../../styles/focus-ring\";\n\n@mixin root-styles() {\n display: inline-flex;\n align-items: flex-start;\n gap: var(--form-gap-x);\n position: relative;\n\n &:not([disabled], [readonly]) {\n input,\n label {\n cursor: pointer;\n }\n }\n}\n\n@mixin label-before-styles() {\n flex-direction: row-reverse;\n}\n\n@mixin label-styles() {\n align-self: stretch;\n color: var(--components-form-text-label-default);\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-label-font-size);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-label-line-height);\n}\n\n@mixin description-styles() {\n align-self: stretch;\n color: var(--components-form-text-description-default);\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-description-font-size);\n font-style: normal;\n font-weight: 450;\n line-height: var(--form-description-line-height);\n}\n\n@mixin text-container-styles() {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n flex: 1 0 0;\n}\n\n@mixin input-container-styles() {\n position: relative;\n color: var(--components-form-shape-foreground-default);\n\n &:has(input[type=\"checkbox\"]:disabled:not([readonly])) {\n color: var(--components-form-shape-foreground-disabled);\n }\n}\n\n@mixin input-styles() {\n appearance: none;\n position: relative;\n display: flex;\n width: var(--form-toggle-width);\n height: var(--form-toggle-height);\n flex-direction: column;\n align-items: flex-start;\n border-radius: var(--form-toggle-radius);\n border-width: var(--form-toggle-border-width);\n border-style: solid;\n border-color: var(--components-form-field-border-default);\n background: var(--components-form-field-background-default);\n\n &::after {\n content: '';\n display: block;\n width: var(--form-toggle-switch-dot-default);\n height: var(--form-toggle-switch-dot-default);\n background-color: var(--components-form-shape-foreground-switch-dot);\n border-radius: var(--radius-rounded-full);\n position: absolute;\n top: 50%;\n left: 25%;\n transform: translate(-50%, -50%);\n }\n\n &:hover {\n border-color: var(--components-form-field-border-hover);\n }\n\n &:focus {\n border-color: var(--components-form-field-border-default);\n }\n\n @include focus-ring();\n\n &:checked {\n background: var(--components-form-field-background-checked);\n border-color: var(--components-form-field-background-checked);\n\n &::after {\n content: '';\n display: block;\n width: var(--form-toggle-switch-dot-default);\n height: var(--form-toggle-switch-dot-default);\n background-color: var(--components-form-shape-foreground-default);\n border-radius: var(--radius-rounded-full);\n position: absolute;\n top: 50%;\n left: 75%;\n transform: translate(-50%, -50%);\n }\n\n &:focus {\n background: var(--components-form-field-background-checked);\n border-color: var(--components-form-field-border-focus);\n }\n }\n\n &:disabled:not([readonly]) {\n box-shadow: unset;\n background: var(--components-form-field-background-disabled);\n border-color: var(--components-form-field-border-default);\n\n &:checked {\n &::after {\n background-color: var(--components-form-shape-foreground-disabled);\n }\n }\n }\n}\n\nnv-fieldtoggle {\n @include root-styles();\n\n &.label-placement-before {\n @include label-before-styles();\n }\n\n &[disabled] {\n // TODO: Find a way to use the --components-form-opacity-disabled variable properly, right now it outputs a value of 50px instead of 0.5.\n // opacity: var(--components-form-opacity-disabled); Error: Invalid value for --components-form-opacity-disabled (expected a <number> but got \"50px\")\n opacity: 0.5;\n }\n label {\n @include label-styles();\n }\n\n .input-container {\n @include input-container-styles();\n\n input[type=\"checkbox\"] {\n @include input-styles();\n }\n }\n\n .description {\n @include description-styles();\n }\n\n .text-container {\n @include text-container-styles();\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Element,\n Watch,\n Event,\n EventEmitter,\n Listen,\n} from '@stencil/core';\nimport clsx from 'clsx';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { type FieldLabelPlacement } from '../../utils/constants';\n\n/**\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n */\n@Component({\n tag: 'nv-fieldtoggle',\n styleUrl: 'nv-fieldtoggle.scss',\n shadow: false,\n})\nexport class NvFieldtoggle {\n @Element() el!: HTMLNvFieldtoggleElement;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the radio button’s input element and the for attribute of\n * the associated label. If no ID is provided, a random one will be\n * automatically generated to ensure unique identification, facilitating\n * proper label association and accessibility.\n */\n @Prop()\n readonly inputId: string = uuidv4();\n\n /**\n * The name attribute for the toggle input, used to reference the form data\n * after submission.\n */\n @Prop()\n readonly name?: string;\n\n /**\n * The value attribute of the toggle input, representing the value sent on\n * form submission when the toggle is checked.\n */\n @Prop()\n readonly value?: string;\n\n /** The label displayed next to the toggle.*/\n @Prop()\n readonly label?: string;\n\n /**\n * Determines the position of the label relative to the toggle, either\n * 'start' (before) or 'end' (after).\n */\n @Prop({ reflect: true })\n readonly labelPlacement: `${FieldLabelPlacement}`;\n\n /**\n * Hides the label visually while still keeping it available for screen\n * readers.\n */\n @Prop()\n readonly hideLabel: boolean = false;\n\n /**\n * A description providing additional context or information about the\n * toggle.\n */\n @Prop({ reflect: true })\n readonly description?: string;\n\n /** Indicates whether the toggle is checked or not. */\n @Prop({ reflect: true, mutable: true })\n checked: boolean = false;\n\n /** Disables the toggle, preventing user interaction. */\n @Prop()\n readonly disabled: boolean = false;\n\n /**\n * Sets the toggle to read-only, preventing user changes but still allowing\n * focus and selection of text.\n */\n @Prop()\n readonly readonly: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emits when the checked state changes.\n * @bind checked\n */\n @Event()\n checkedChanged: EventEmitter<boolean>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n /**\n * Watches for changes to the checked state and emits the new value.\n * @param {boolean} checked - The new value of the checked state.\n */\n @Watch('checked')\n onCheckedChanged(checked: boolean) {\n this.checkedChanged.emit(checked);\n }\n\n /**\n * Listens for the change event on the toggle input element and updates the checked state.\n * the checked state of the host elements.\n * @param {Event} event - The change event.\n */\n @Listen('change')\n handleChange(event: Event) {\n const target = event.target as HTMLInputElement;\n\n if (target.type === 'checkbox' && target.id === this.inputId) {\n if (this.readonly || this.disabled) {\n event.preventDefault();\n return;\n }\n\n this.checked = target.checked;\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host\n class={clsx(\n this.labelPlacement === 'before' && 'label-placement-before',\n )}\n >\n <div class=\"input-container\">\n <input\n type=\"checkbox\"\n id={this.inputId}\n name={this.name}\n autocomplete=\"off\"\n value={this.value}\n checked={Boolean(this.checked)}\n disabled={this.disabled || this.readonly}\n readonly={this.readonly}\n />\n </div>\n\n <div class=\"text-container\">\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label\n htmlFor={this.inputId}\n class={clsx(this.hideLabel && 'visually-hidden')}\n >\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n </div>\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
|
|
@@ -56,7 +56,7 @@ const NvIcon = class {
|
|
|
56
56
|
//#region RENDER
|
|
57
57
|
render() {
|
|
58
58
|
//const iconSprite = getAssetPath('assets/icon-sprite.svg');
|
|
59
|
-
return (index.h(index.Host, { key: '
|
|
59
|
+
return (index.h(index.Host, { key: '1862efaf5cb956c36b1dad264518f7eb37a10c34', class: clsx.clsx(this.color && `${this.color}`), role: "img", "aria-label": `${this.name}-icon` }, index.h("svg", { key: '7beb3a4697c73a42e28b8d59128cea93978ba282', stroke: "currentColor", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: `nv-icon-${this.size}` }, index.h("use", { key: '50e901a1dc92fb8ada8489e9be15c1bf069df5e6', href: `${this.spriteUrl}#${this.name}` }))));
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
NvIcon.style = NvIconStyle0;
|