@nova-design-system/nova-webcomponents 3.18.0 → 3.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +13 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/native.cjs.js +1 -1
- package/dist/cjs/nv-badge_2.cjs.entry.js +1 -1
- package/dist/cjs/nv-fielddate.cjs.entry.js +10 -6
- package/dist/cjs/nv-fielddate.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddaterange.cjs.entry.js +11 -7
- package/dist/cjs/nv-fielddaterange.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +193 -209
- package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +7 -4
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +4 -0
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +24 -7
- 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-fieldradio.cjs.entry.js +3 -3
- package/dist/cjs/nv-fieldselect.cjs.entry.js +5 -5
- package/dist/cjs/nv-fieldslider.cjs.entry.js +6 -4
- package/dist/cjs/nv-fieldslider.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtext.cjs.entry.js +3 -3
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js +3 -3
- package/dist/cjs/nv-fieldtime.cjs.entry.js +4 -3
- package/dist/cjs/nv-fieldtime.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-icon.cjs.entry.js +2 -2
- package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-iconbutton_2.cjs.entry.js +2 -2
- package/dist/cjs/nv-menu.cjs.entry.js +2 -2
- package/dist/cjs/nv-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-menuitem.cjs.entry.js +1 -1
- package/dist/cjs/nv-notification.cjs.entry.js +1 -1
- package/dist/cjs/nv-notificationcontainer.cjs.entry.js +1 -1
- package/dist/cjs/nv-popover.cjs.entry.js +2 -2
- 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-split.cjs.entry.js +1 -1
- package/dist/cjs/nv-stack.cjs.entry.js +1 -1
- package/dist/cjs/nv-table.cjs.entry.js +1 -1
- package/dist/cjs/nv-toggle.cjs.entry.js +2 -2
- package/dist/cjs/nv-togglebutton.cjs.entry.js +1 -1
- package/dist/cjs/nv-togglebuttongroup.cjs.entry.js +1 -1
- package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
- package/dist/collection/components/nv-fielddate/nv-fielddate.js +10 -6
- package/dist/collection/components/nv-fielddate/nv-fielddate.js.map +1 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +10 -6
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -1
- package/dist/collection/components/nv-fielddaterange/styles/nv-fielddaterange.css +2 -0
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js +31 -13
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js.map +1 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +310 -245
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js +29 -6
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js.map +1 -1
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js +1 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +4 -0
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +1 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +26 -9
- 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-fieldradio/nv-fieldradio.js +3 -3
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +5 -5
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.js +3 -3
- package/dist/collection/components/nv-fieldslider/partials/field-input.js +3 -1
- package/dist/collection/components/nv-fieldslider/partials/field-input.js.map +1 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +3 -3
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +3 -3
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +4 -3
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js.map +1 -1
- package/dist/collection/components/nv-icon/nv-icon.js +1 -1
- package/dist/collection/components/nv-icon/nv-icons.js +13 -0
- package/dist/collection/components/nv-icon/nv-icons.js.map +1 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +1 -1
- package/dist/collection/components/nv-loader/nv-loader.js +1 -1
- package/dist/collection/components/nv-menu/nv-menu.js +3 -3
- package/dist/collection/components/nv-menu/nv-menu.js.map +1 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js +2 -2
- package/dist/collection/components/nv-notification/nv-notification.js +1 -1
- package/dist/collection/components/nv-notificationcontainer/nv-notificationcontainer.js +1 -1
- package/dist/collection/components/nv-popover/nv-popover.js +2 -2
- 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-split/nv-split.js +1 -1
- package/dist/collection/components/nv-stack/nv-stack.js +1 -1
- package/dist/collection/components/nv-table/nv-table.js +1 -1
- package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
- package/dist/collection/components/nv-togglebutton/nv-togglebutton.js +1 -1
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.js +1 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
- package/dist/components/index.js +13 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/nv-accordion-item.js +1 -1
- package/dist/components/nv-accordion.js +4 -4
- 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-breadcrumb.js +2 -2
- package/dist/components/nv-button.js +1 -1
- package/dist/components/nv-datagrid.js +2 -2
- package/dist/components/nv-dialog.js +4 -4
- package/dist/components/nv-dialogfooter.js +1 -1
- package/dist/components/nv-fielddate.js +14 -10
- package/dist/components/nv-fielddate.js.map +1 -1
- package/dist/components/nv-fielddaterange.js +15 -11
- package/dist/components/nv-fielddaterange.js.map +1 -1
- package/dist/components/nv-fielddropdown.js +207 -220
- package/dist/components/nv-fielddropdown.js.map +1 -1
- package/dist/components/nv-fielddropdownitem.js +1 -1
- package/dist/components/nv-fielddropdownitemcheck.js +1 -1
- package/dist/components/nv-fieldmultiselect.js +10 -6
- package/dist/components/nv-fieldmultiselect.js.map +1 -1
- package/dist/components/nv-fieldnumber.js +1 -1
- package/dist/components/nv-fieldpassword.js +6 -6
- package/dist/components/nv-fieldradio.js +3 -3
- package/dist/components/nv-fieldselect.js +8 -8
- package/dist/components/nv-fieldslider.js +10 -8
- package/dist/components/nv-fieldslider.js.map +1 -1
- package/dist/components/nv-fieldtext.js +1 -1
- package/dist/components/nv-fieldtextarea.js +3 -3
- package/dist/components/nv-fieldtime.js +8 -7
- package/dist/components/nv-fieldtime.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 +5 -5
- package/dist/components/nv-menu.js.map +1 -1
- package/dist/components/nv-menuitem.js +1 -1
- package/dist/components/nv-notification.js +2 -2
- package/dist/components/nv-notificationcontainer.js +1 -1
- package/dist/components/nv-popover.js +1 -1
- package/dist/components/nv-row.js +1 -1
- package/dist/components/nv-split.js +1 -1
- package/dist/components/nv-stack.js +1 -1
- package/dist/components/nv-table.js +1 -1
- package/dist/components/nv-toggle.js +2 -2
- package/dist/components/nv-togglebutton.js +1 -1
- package/dist/components/nv-togglebuttongroup.js +1 -1
- package/dist/components/nv-tooltip.js +1 -1
- package/dist/components/{p-015330b8.js → p-18f50d91.js} +2 -2
- package/dist/components/{p-015330b8.js.map → p-18f50d91.js.map} +1 -1
- package/dist/components/{p-c981bb48.js → p-222136c2.js} +2 -2
- package/dist/components/{p-c981bb48.js.map → p-222136c2.js.map} +1 -1
- package/dist/components/{p-fca4d85b.js → p-2ac6f42d.js} +3 -3
- package/dist/components/{p-fca4d85b.js.map → p-2ac6f42d.js.map} +1 -1
- package/dist/components/{p-fabbaf47.js → p-334e19d3.js} +4 -4
- package/dist/components/{p-fabbaf47.js.map → p-334e19d3.js.map} +1 -1
- package/dist/components/{p-5e315239.js → p-45a3cf85.js} +11 -7
- package/dist/components/p-45a3cf85.js.map +1 -0
- package/dist/components/{p-ebfecbaa.js → p-4799b6c3.js} +3 -3
- package/dist/components/p-4799b6c3.js.map +1 -0
- package/dist/components/{p-4cd6f629.js → p-49205084.js} +5 -5
- package/dist/components/{p-4cd6f629.js.map → p-49205084.js.map} +1 -1
- package/dist/components/{p-6ca3d847.js → p-5a5db065.js} +4 -4
- package/dist/components/{p-6ca3d847.js.map → p-5a5db065.js.map} +1 -1
- package/dist/components/{p-1bd396b1.js → p-60083982.js} +4 -4
- package/dist/components/{p-1bd396b1.js.map → p-60083982.js.map} +1 -1
- package/dist/components/{p-ea45f1ab.js → p-81d915ef.js} +3 -3
- package/dist/components/{p-ea45f1ab.js.map → p-81d915ef.js.map} +1 -1
- package/dist/components/p-946a047c.js +88 -0
- package/dist/components/p-946a047c.js.map +1 -0
- package/dist/components/{p-715e5235.js → p-a6c29711.js} +2 -2
- package/dist/components/{p-715e5235.js.map → p-a6c29711.js.map} +1 -1
- package/dist/components/{p-d1b02966.js → p-b67f31af.js} +28 -11
- package/dist/components/{p-d1b02966.js.map → p-b67f31af.js.map} +1 -1
- package/dist/components/{p-2574f8c2.js → p-e1b2eba2.js} +2 -2
- package/dist/components/{p-2574f8c2.js.map → p-e1b2eba2.js.map} +1 -1
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/native.js +1 -1
- package/dist/esm/nv-badge_2.entry.js +1 -1
- package/dist/esm/nv-fielddate.entry.js +10 -6
- package/dist/esm/nv-fielddate.entry.js.map +1 -1
- package/dist/esm/nv-fielddaterange.entry.js +11 -7
- package/dist/esm/nv-fielddaterange.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdown.entry.js +193 -209
- package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdownitem.entry.js +7 -4
- package/dist/esm/nv-fielddropdownitem.entry.js.map +1 -1
- package/dist/esm/nv-fieldmultiselect.entry.js +4 -0
- package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldnumber.entry.js +24 -7
- package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
- package/dist/esm/nv-fieldpassword.entry.js +3 -3
- package/dist/esm/nv-fieldradio.entry.js +3 -3
- package/dist/esm/nv-fieldselect.entry.js +5 -5
- package/dist/esm/nv-fieldslider.entry.js +6 -4
- package/dist/esm/nv-fieldslider.entry.js.map +1 -1
- package/dist/esm/nv-fieldtext.entry.js +3 -3
- package/dist/esm/nv-fieldtextarea.entry.js +3 -3
- package/dist/esm/nv-fieldtime.entry.js +4 -3
- package/dist/esm/nv-fieldtime.entry.js.map +1 -1
- package/dist/esm/nv-icon.entry.js +2 -2
- package/dist/esm/nv-icon.entry.js.map +1 -1
- package/dist/esm/nv-iconbutton_2.entry.js +2 -2
- package/dist/esm/nv-menu.entry.js +2 -2
- package/dist/esm/nv-menu.entry.js.map +1 -1
- package/dist/esm/nv-menuitem.entry.js +1 -1
- package/dist/esm/nv-notification.entry.js +1 -1
- package/dist/esm/nv-notificationcontainer.entry.js +1 -1
- package/dist/esm/nv-popover.entry.js +2 -2
- package/dist/esm/nv-popover.entry.js.map +1 -1
- package/dist/esm/nv-row.entry.js +1 -1
- package/dist/esm/nv-split.entry.js +1 -1
- package/dist/esm/nv-stack.entry.js +1 -1
- package/dist/esm/nv-table.entry.js +1 -1
- package/dist/esm/nv-toggle.entry.js +2 -2
- package/dist/esm/nv-togglebutton.entry.js +1 -1
- package/dist/esm/nv-togglebuttongroup.entry.js +1 -1
- package/dist/esm/nv-tooltip.entry.js +1 -1
- package/dist/native/index.esm.js +1 -1
- package/dist/native/index.esm.js.map +1 -1
- package/dist/native/native.esm.js +1 -1
- package/dist/native/native.esm.js.map +1 -1
- package/dist/native/{p-acada158.entry.js → p-0177409b.entry.js} +2 -2
- package/dist/native/{p-14d2f70a.entry.js → p-075d231e.entry.js} +2 -2
- package/dist/native/{p-d878e90a.entry.js → p-144d0f8a.entry.js} +2 -2
- package/dist/native/p-144d0f8a.entry.js.map +1 -0
- package/dist/native/{p-b4c15f25.entry.js → p-17666092.entry.js} +2 -2
- package/dist/native/{p-107e80c6.entry.js → p-218135b1.entry.js} +2 -2
- package/dist/native/p-218135b1.entry.js.map +1 -0
- package/dist/native/p-2a7f80f4.entry.js +2 -0
- package/dist/native/p-2a7f80f4.entry.js.map +1 -0
- package/dist/native/{p-e5b7ce4e.entry.js → p-445221dc.entry.js} +2 -2
- package/dist/native/{p-4e6fb719.entry.js → p-44a78545.entry.js} +2 -2
- package/dist/native/p-57420a2f.entry.js +2 -0
- package/dist/native/{p-5c678bc7.entry.js → p-587d94f3.entry.js} +2 -2
- package/dist/native/{p-95184ea2.entry.js → p-6a418ec4.entry.js} +2 -2
- package/dist/native/{p-5039ceb8.entry.js → p-859bf9ad.entry.js} +2 -2
- package/dist/native/{p-5039ceb8.entry.js.map → p-859bf9ad.entry.js.map} +1 -1
- package/dist/native/{p-ae43eee2.entry.js → p-9950e075.entry.js} +2 -2
- package/dist/native/{p-ad029453.entry.js → p-9c432751.entry.js} +2 -2
- package/dist/native/{p-8c053954.entry.js → p-a026654f.entry.js} +2 -2
- package/dist/native/p-a026654f.entry.js.map +1 -0
- package/dist/native/{p-417fba7d.entry.js → p-a2f58133.entry.js} +2 -2
- package/dist/native/{p-3464b86a.entry.js → p-b02c896a.entry.js} +2 -2
- package/dist/native/{p-9613087c.entry.js → p-b4382c94.entry.js} +2 -2
- package/dist/native/{p-23ee0384.entry.js → p-bd9bf6a1.entry.js} +2 -2
- package/dist/native/p-bd9bf6a1.entry.js.map +1 -0
- package/dist/native/p-c901693d.entry.js +2 -0
- package/dist/native/p-c901693d.entry.js.map +1 -0
- package/dist/native/{p-5f98d4cd.entry.js → p-c9fea0df.entry.js} +2 -2
- package/dist/native/{p-5f98d4cd.entry.js.map → p-c9fea0df.entry.js.map} +1 -1
- package/dist/native/{p-ca39f78d.entry.js → p-d62869ff.entry.js} +2 -2
- package/dist/native/p-d63689da.entry.js +2 -0
- package/dist/native/p-d63689da.entry.js.map +1 -0
- package/dist/native/p-d8f3cf92.entry.js +2 -0
- package/dist/native/p-d8f3cf92.entry.js.map +1 -0
- package/dist/native/{p-539666dd.entry.js → p-dfb6b65e.entry.js} +2 -2
- package/dist/native/{p-230af58a.entry.js → p-e6f24210.entry.js} +2 -2
- package/dist/native/p-e6f24210.entry.js.map +1 -0
- package/dist/native/{p-da2060a5.entry.js → p-eb74feb7.entry.js} +2 -2
- package/dist/native/{p-6d427897.entry.js → p-fa3e588e.entry.js} +2 -2
- package/dist/native/{p-112d096c.entry.js → p-fffbd3c1.entry.js} +2 -2
- package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +54 -35
- package/dist/types/components/nv-fielddropdownitem/nv-fielddropdownitem.d.ts +7 -0
- package/dist/types/components/nv-fieldnumber/nv-fieldnumber.d.ts +7 -3
- package/dist/types/components/nv-fieldslider/partials/field-input.d.ts +1 -1
- package/dist/types/components/nv-icon/nv-icons.d.ts +1 -1
- package/dist/types/components.d.ts +63 -17
- package/dist/vscode-data.json +50 -3
- package/hydrate/index.js +307 -284
- package/hydrate/index.mjs +307 -284
- package/package.json +1 -1
- package/dist/components/p-5e315239.js.map +0 -1
- package/dist/components/p-ebfecbaa.js.map +0 -1
- package/dist/components/p-ed43bcec.js +0 -88
- package/dist/components/p-ed43bcec.js.map +0 -1
- package/dist/native/p-00d1e5e1.entry.js +0 -2
- package/dist/native/p-00d1e5e1.entry.js.map +0 -1
- package/dist/native/p-107e80c6.entry.js.map +0 -1
- package/dist/native/p-230af58a.entry.js.map +0 -1
- package/dist/native/p-23ee0384.entry.js.map +0 -1
- package/dist/native/p-5e70f9ce.entry.js +0 -2
- package/dist/native/p-835abdb9.entry.js +0 -2
- package/dist/native/p-835abdb9.entry.js.map +0 -1
- package/dist/native/p-8c053954.entry.js.map +0 -1
- package/dist/native/p-b72b5e88.entry.js +0 -2
- package/dist/native/p-b72b5e88.entry.js.map +0 -1
- package/dist/native/p-d7f444fb.entry.js +0 -2
- package/dist/native/p-d7f444fb.entry.js.map +0 -1
- package/dist/native/p-d878e90a.entry.js.map +0 -1
- /package/dist/native/{p-acada158.entry.js.map → p-0177409b.entry.js.map} +0 -0
- /package/dist/native/{p-14d2f70a.entry.js.map → p-075d231e.entry.js.map} +0 -0
- /package/dist/native/{p-b4c15f25.entry.js.map → p-17666092.entry.js.map} +0 -0
- /package/dist/native/{p-e5b7ce4e.entry.js.map → p-445221dc.entry.js.map} +0 -0
- /package/dist/native/{p-4e6fb719.entry.js.map → p-44a78545.entry.js.map} +0 -0
- /package/dist/native/{p-5e70f9ce.entry.js.map → p-57420a2f.entry.js.map} +0 -0
- /package/dist/native/{p-5c678bc7.entry.js.map → p-587d94f3.entry.js.map} +0 -0
- /package/dist/native/{p-95184ea2.entry.js.map → p-6a418ec4.entry.js.map} +0 -0
- /package/dist/native/{p-ae43eee2.entry.js.map → p-9950e075.entry.js.map} +0 -0
- /package/dist/native/{p-ad029453.entry.js.map → p-9c432751.entry.js.map} +0 -0
- /package/dist/native/{p-417fba7d.entry.js.map → p-a2f58133.entry.js.map} +0 -0
- /package/dist/native/{p-3464b86a.entry.js.map → p-b02c896a.entry.js.map} +0 -0
- /package/dist/native/{p-9613087c.entry.js.map → p-b4382c94.entry.js.map} +0 -0
- /package/dist/native/{p-ca39f78d.entry.js.map → p-d62869ff.entry.js.map} +0 -0
- /package/dist/native/{p-539666dd.entry.js.map → p-dfb6b65e.entry.js.map} +0 -0
- /package/dist/native/{p-da2060a5.entry.js.map → p-eb74feb7.entry.js.map} +0 -0
- /package/dist/native/{p-6d427897.entry.js.map → p-fa3e588e.entry.js.map} +0 -0
- /package/dist/native/{p-112d096c.entry.js.map → p-fffbd3c1.entry.js.map} +0 -0
|
@@ -69,7 +69,15 @@ export class NvFieldnumber {
|
|
|
69
69
|
//#region METHODS
|
|
70
70
|
this.handleInput = (event) => {
|
|
71
71
|
const input = event.target;
|
|
72
|
-
|
|
72
|
+
if (input.value === '') {
|
|
73
|
+
this.value = null;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const nextValue = input.valueAsNumber;
|
|
77
|
+
if (Number.isNaN(nextValue)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
this.value = nextValue;
|
|
73
81
|
};
|
|
74
82
|
this.handleInputContainerClick = () => {
|
|
75
83
|
this.inputElement.focus();
|
|
@@ -87,17 +95,26 @@ export class NvFieldnumber {
|
|
|
87
95
|
event.preventDefault();
|
|
88
96
|
};
|
|
89
97
|
this.isMinValueReached = () => {
|
|
90
|
-
return this.min !== undefined &&
|
|
98
|
+
return (this.min !== undefined &&
|
|
99
|
+
typeof this.value === 'number' &&
|
|
100
|
+
this.value <= this.min);
|
|
91
101
|
};
|
|
92
102
|
this.isMaxValueReached = () => {
|
|
93
|
-
return this.max !== undefined &&
|
|
103
|
+
return (this.max !== undefined &&
|
|
104
|
+
typeof this.value === 'number' &&
|
|
105
|
+
this.value >= this.max);
|
|
94
106
|
};
|
|
95
107
|
}
|
|
96
108
|
//#endregion EVENTS
|
|
97
109
|
/****************************************************************************/
|
|
98
110
|
//#region WATCHERS
|
|
99
111
|
watchValueHandler(newValue) {
|
|
100
|
-
|
|
112
|
+
const normalized = typeof newValue === 'number' && !Number.isNaN(newValue) ? newValue : null;
|
|
113
|
+
if (this.lastEmittedValue === normalized) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
this.lastEmittedValue = normalized;
|
|
117
|
+
this.valueChanged.emit(normalized);
|
|
101
118
|
}
|
|
102
119
|
//#endregion METHODS
|
|
103
120
|
/****************************************************************************/
|
|
@@ -115,9 +132,9 @@ export class NvFieldnumber {
|
|
|
115
132
|
/****************************************************************************/
|
|
116
133
|
//#region RENDER
|
|
117
134
|
render() {
|
|
118
|
-
return (h(Host, { key: '
|
|
119
|
-
this.el.querySelector('[slot="description"]')) && (h("div", { key: '
|
|
120
|
-
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '
|
|
135
|
+
return (h(Host, { key: '9b3239f09e6aace03f79f07399723fdbf557f070' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: '322478abbaf477a33debcd828387402299ce6762', htmlFor: this.inputId }, h("slot", { key: '75b791ca0fb7eec55faaf966a32733e37b87fb90', name: "label" }, this.label))), h("div", { key: '5ce6c27db2b6b0ba8618ed2eac1f61abf8177793', class: "input-wrapper" }, h("slot", { key: '3a4a86e358d575fc312d27ee5ffba68474904bd4', name: "before-input" }), h("div", { key: '8e07c3c37ea4869aa309fba913663e1d225e21fd', class: "input-container", onClick: this.handleInputContainerClick }, h("slot", { key: '91e7c82e46d3268493669e6dd121f643be86a6be', name: "leading-input" }), h("input", { key: '3dcbd9d10e4425ebb29b16b1157845ea4ee7bdef', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, type: "number", autofocus: this.autofocus, required: this.required, max: this.max, min: this.min, step: this.step, value: typeof this.value === 'number' ? this.value : undefined, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput }), h("slot", { key: '7d0d4a77d121433f4feb8aa2139be8e94f8e57a5', name: "trailing-input" }), this.error && (h("nv-icon", { key: '2a3969e56de0fc3911901c9540e300caf2b6d681', name: "alert-circle", class: "validation", size: "md" })), this.success && (h("nv-icon", { key: '8964d7ffaa2cc2a70caf781a37e66383234c6895', name: "circle-check", class: "validation", size: "md" })), h("div", { key: '1ca2fd7095afbc12a1a54c8b09551f28fe5a3579', class: "stepper" }, h("nv-iconbutton", { key: '1c3f9200c5409bc05fab9061dff3847a92298d45', size: "md", name: "minus", emphasis: "lower", onClick: this.handleMinus, disabled: this.isMinValueReached(), onMouseDown: this.preventSelection, tabindex: "-1" }), h("nv-iconbutton", { key: 'eb65687b3c31d2ac8bdb534f5ca300a1ada9cd64', size: "md", name: "plus", emphasis: "lower", onClick: this.handlePlus, disabled: this.isMaxValueReached(), onMouseDown: this.preventSelection, tabindex: "-1" }))), h("slot", { key: '01006c0c2487bce4f908104d263acb0231cdb701', name: "after-input" })), (this.description ||
|
|
136
|
+
this.el.querySelector('[slot="description"]')) && (h("div", { key: '9db93a8aa6bb002a3286763909118e9c7a1661c0', class: "description" }, h("slot", { key: '13b0f797bace74e641cdd658bb798bccbfec70dc', name: "description" }, this.description))), (this.errorDescription ||
|
|
137
|
+
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '4ca240bc22fb83a283637e60384e59d687d67e9e', hidden: !this.error, class: "error-description" }, h("slot", { key: '145b68572a38e91559431ff51ec38a64027d4978', name: "error-description" }, this.errorDescription)))));
|
|
121
138
|
}
|
|
122
139
|
static get is() { return "nv-fieldnumber"; }
|
|
123
140
|
static get formAssociated() { return true; }
|
|
@@ -460,7 +477,7 @@ export class NvFieldnumber {
|
|
|
460
477
|
"type": "number",
|
|
461
478
|
"mutable": true,
|
|
462
479
|
"complexType": {
|
|
463
|
-
"original": "number",
|
|
480
|
+
"original": "number | null",
|
|
464
481
|
"resolved": "number",
|
|
465
482
|
"references": {}
|
|
466
483
|
},
|
|
@@ -532,7 +549,7 @@ export class NvFieldnumber {
|
|
|
532
549
|
"text": "Emitted when the input value changes."
|
|
533
550
|
},
|
|
534
551
|
"complexType": {
|
|
535
|
-
"original": "number",
|
|
552
|
+
"original": "number | null",
|
|
536
553
|
"resolved": "number",
|
|
537
554
|
"references": {}
|
|
538
555
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nv-fieldnumber.js","sourceRoot":"","sources":["../../../src/components/nv-fieldnumber/nv-fieldnumber.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC;;;;;;;;GAQG;AAOH,MAAM,OAAO,aAAa;IAN1B;QA2BE,uBAAuB;QACvB,8EAA8E;QAC9E,oBAAoB;QAEpB;;;;;WAKG;QAEM,YAAO,GAAW,MAAM,EAAE,CAAC;QAmCpC;;;;WAIG;QAEM,aAAQ,GAAY,KAAK,CAAC;QAEnC;;;;WAIG;QAEM,aAAQ,GAAY,KAAK,CAAC;QAEnC;;;WAGG;QAEM,aAAQ,GAAY,KAAK,CAAC;QAEnC;;;;WAIG;QAEH,UAAK,GAAY,KAAK,CAAC;QAWvB;;;WAGG;QAEM,YAAO,GAAY,KAAK,CAAC;QAgBlC;;;WAGG;QAEM,SAAI,GAAW,CAAC,CAAC;QAU1B;;;;WAIG;QAGM,cAAS,GAAY,KAAK,CAAC;QAEpC;;WAEG;QAEM,UAAK,GAAY,KAAK,CAAC;QAsBhC,qBAAqB;QACrB,8EAA8E;QAC9E,iBAAiB;QAET,gBAAW,GAAG,CAAC,KAAY,EAAE,EA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M,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAC,mBAAmB;gBACjD,6DAAM,IAAI,EAAC,mBAAmB,IAAE,IAAI,CAAC,gBAAgB,CAAQ,CACzD,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGF","sourcesContent":["import {\n Component,\n Prop,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Watch,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * @slot leading-input - Content to be placed before the input text, within the input container.\n * @slot trailing-input - Content to be placed after the input text, within the input container.\n * @slot before-input - Content to be placed before the input text, outside the input container.\n * @slot after-input - Content to be placed after the input text, outside the input 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-fieldnumber',\n styleUrl: 'nv-fieldnumber.scss',\n shadow: false,\n formAssociated: true,\n})\nexport class NvFieldnumber {\n @Element() el: HTMLNvFieldnumberElement;\n private inputElement!: HTMLInputElement;\n\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Message defines a 'hint ' message for the number field.\n * @deprecated Use `description` instead.\n */\n @Prop({ reflect: true })\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({ reflect: true })\n readonly validation: string;\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 * input 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 input 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 input 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 input 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 input’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 * The disabled prop lets you turn off the input 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 input 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 input 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 input 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 input 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 input field’s appearance to indicate successful input or\n * validation.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * The maximum value that the input field can accept. Use this in combination\n * with min to create a range of valid values.\n */\n @Prop({ reflect: true })\n readonly max: number;\n\n /**\n * The minimum value that the input field can accept. Use this in combination\n * with max to create a range of valid values.\n */\n @Prop({ reflect: true })\n readonly min: number;\n\n /**\n * Define the increment value for the input field. It determines how much the\n * value will increase or decrease when the user clicks the stepper buttons.\n */\n @Prop({ reflect: true })\n readonly step: number = 1;\n\n /**\n * The value of the input field. It’s the text that users type in or the value\n * that you set programmatically. This is the main way to interact with the\n * input field, and it’s essential for creating forms that users can fill out.\n */\n @Prop({ reflect: true, mutable: true })\n value: number;\n\n /**\n * Applies focus to the input field as soon as the component is mounted. This\n * is equivalent to setting the native autofocus attribute on an <input>\n * element.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the input value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<number>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('value')\n watchValueHandler(newValue: number) {\n this.valueChanged.emit(newValue);\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region METHODS\n\n private handleInput = (event: Event) => {\n const input = event.target as HTMLInputElement;\n this.value = input.valueAsNumber;\n };\n\n private handleInputContainerClick = () => {\n this.inputElement.focus();\n };\n\n private handlePlus = () => {\n this.inputElement.stepUp();\n this.value = Number(this.inputElement.value);\n };\n\n private handleMinus = () => {\n this.inputElement.stepDown();\n this.value = Number(this.inputElement.value);\n };\n\n // prevents text selection when clicking the buttons multiple times\n private preventSelection = (event: Event) => {\n event.preventDefault();\n };\n\n private isMinValueReached = (): boolean => {\n return this.min !== undefined && this.value <= this.min;\n };\n\n private isMaxValueReached = (): boolean => {\n return this.max !== undefined && this.value >= this.max;\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\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 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=\"input-wrapper\">\n <slot name=\"before-input\"></slot>\n\n <div class=\"input-container\" onClick={this.handleInputContainerClick}>\n <slot name=\"leading-input\"></slot>\n\n <input\n id={this.inputId}\n ref={e => (this.inputElement = e)}\n placeholder={this.placeholder}\n name={this.name}\n type=\"number\"\n autofocus={this.autofocus}\n required={this.required}\n max={this.max}\n min={this.min}\n step={this.step}\n value={this.value}\n disabled={this.disabled}\n readOnly={this.readonly}\n onInput={this.handleInput}\n />\n\n <slot name=\"trailing-input\"></slot>\n\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n {this.success && (\n <nv-icon name=\"circle-check\" class=\"validation\" size=\"md\" />\n )}\n\n <div class=\"stepper\">\n <nv-iconbutton\n size=\"md\"\n name=\"minus\"\n emphasis=\"lower\"\n onClick={this.handleMinus}\n disabled={this.isMinValueReached()}\n onMouseDown={this.preventSelection}\n tabindex=\"-1\"\n ></nv-iconbutton>\n <nv-iconbutton\n size=\"md\"\n name=\"plus\"\n emphasis=\"lower\"\n onClick={this.handlePlus}\n disabled={this.isMaxValueReached()}\n onMouseDown={this.preventSelection}\n tabindex=\"-1\"\n />\n </div>\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\">\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"]}
|
|
1
|
+
{"version":3,"file":"nv-fieldnumber.js","sourceRoot":"","sources":["../../../src/components/nv-fieldnumber/nv-fieldnumber.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC;;;;;;;;GAQG;AAOH,MAAM,OAAO,aAAa;IAN1B;QA2BE,uBAAuB;QACvB,8EAA8E;QAC9E,oBAAoB;QAEpB;;;;;WAKG;QAEM,YAAO,GAAW,MAAM,EAAE,CAAC;QAmCpC;;;;WAIG;QAEM,aAAQ,GAAY,KAAK,CAAC;QAEnC;;;;WAIG;QAEM,aAAQ,GAAY,KAAK,CAAC;QAEnC;;;WAGG;QAEM,aAAQ,GAAY,KAAK,CAAC;QAEnC;;;;WAIG;QAEH,UAAK,GAAY,KAAK,CAAC;QAWvB;;;WAGG;QAEM,YAAO,GAAY,KAAK,CAAC;QAgBlC;;;WAGG;QAEM,SAAI,GAAW,CAAC,CAAC;QAU1B;;;;WAIG;QAGM,cAAS,GAAY,KAAK,CAAC;QAEpC;;WAEG;QAEM,UAAK,GAAY,KAAK,CAAC;QAoChC,qBAAqB;QACrB,8EAA8E;QAC9E,iBAAiB;QAET,gBAAW,GAAG,CAAC,KAAY,EAAE,EAAE;YACrC,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;YAC/C,IAAI,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGF","sourcesContent":["import {\n Component,\n Prop,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Watch,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * @slot leading-input - Content to be placed before the input text, within the input container.\n * @slot trailing-input - Content to be placed after the input text, within the input container.\n * @slot before-input - Content to be placed before the input text, outside the input container.\n * @slot after-input - Content to be placed after the input text, outside the input 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-fieldnumber',\n styleUrl: 'nv-fieldnumber.scss',\n shadow: false,\n formAssociated: true,\n})\nexport class NvFieldnumber {\n @Element() el: HTMLNvFieldnumberElement;\n private inputElement!: HTMLInputElement;\n\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Message defines a 'hint ' message for the number field.\n * @deprecated Use `description` instead.\n */\n @Prop({ reflect: true })\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({ reflect: true })\n readonly validation: string;\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 * input 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 input 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 input 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 input 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 input’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 * The disabled prop lets you turn off the input 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 input 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 input 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 input 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 input 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 input field’s appearance to indicate successful input or\n * validation.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * The maximum value that the input field can accept. Use this in combination\n * with min to create a range of valid values.\n */\n @Prop({ reflect: true })\n readonly max: number;\n\n /**\n * The minimum value that the input field can accept. Use this in combination\n * with max to create a range of valid values.\n */\n @Prop({ reflect: true })\n readonly min: number;\n\n /**\n * Define the increment value for the input field. It determines how much the\n * value will increase or decrease when the user clicks the stepper buttons.\n */\n @Prop({ reflect: true })\n readonly step: number = 1;\n\n /**\n * The value of the input field. It’s the text that users type in or the value\n * that you set programmatically. This is the main way to interact with the\n * input field, and it’s essential for creating forms that users can fill out.\n */\n @Prop({ reflect: true, mutable: true })\n value: number | null;\n\n /**\n * Applies focus to the input field as soon as the component is mounted. This\n * is equivalent to setting the native autofocus attribute on an <input>\n * element.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the input value changes.\n * @bind value\n */\n // eslint-disable-next-line nova/bind-event-naming, nova/event-inline-interfaces\n @Event()\n valueChanged: EventEmitter<number | null>; // eslint-disable-line nova/event-inline-interfaces\n\n /**\n * Tracks the last emitted value to avoid double firing for normalized nulls.\n */\n private lastEmittedValue?: number | null;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('value')\n watchValueHandler(newValue: number | null | undefined) {\n const normalized =\n typeof newValue === 'number' && !Number.isNaN(newValue) ? newValue : null;\n\n if (this.lastEmittedValue === normalized) {\n return;\n }\n\n this.lastEmittedValue = normalized;\n this.valueChanged.emit(normalized);\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region METHODS\n\n private handleInput = (event: Event) => {\n const input = event.target as HTMLInputElement;\n if (input.value === '') {\n this.value = null;\n return;\n }\n\n const nextValue = input.valueAsNumber;\n\n if (Number.isNaN(nextValue)) {\n return;\n }\n\n this.value = nextValue;\n };\n\n private handleInputContainerClick = () => {\n this.inputElement.focus();\n };\n\n private handlePlus = () => {\n this.inputElement.stepUp();\n this.value = Number(this.inputElement.value);\n };\n\n private handleMinus = () => {\n this.inputElement.stepDown();\n this.value = Number(this.inputElement.value);\n };\n\n // prevents text selection when clicking the buttons multiple times\n private preventSelection = (event: Event) => {\n event.preventDefault();\n };\n\n private isMinValueReached = (): boolean => {\n return (\n this.min !== undefined &&\n typeof this.value === 'number' &&\n this.value <= this.min\n );\n };\n\n private isMaxValueReached = (): boolean => {\n return (\n this.max !== undefined &&\n typeof this.value === 'number' &&\n this.value >= this.max\n );\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\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 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=\"input-wrapper\">\n <slot name=\"before-input\"></slot>\n\n <div class=\"input-container\" onClick={this.handleInputContainerClick}>\n <slot name=\"leading-input\"></slot>\n\n <input\n id={this.inputId}\n ref={e => (this.inputElement = e)}\n placeholder={this.placeholder}\n name={this.name}\n type=\"number\"\n autofocus={this.autofocus}\n required={this.required}\n max={this.max}\n min={this.min}\n step={this.step}\n value={typeof this.value === 'number' ? this.value : undefined}\n disabled={this.disabled}\n readOnly={this.readonly}\n onInput={this.handleInput}\n />\n\n <slot name=\"trailing-input\"></slot>\n\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n {this.success && (\n <nv-icon name=\"circle-check\" class=\"validation\" size=\"md\" />\n )}\n\n <div class=\"stepper\">\n <nv-iconbutton\n size=\"md\"\n name=\"minus\"\n emphasis=\"lower\"\n onClick={this.handleMinus}\n disabled={this.isMinValueReached()}\n onMouseDown={this.preventSelection}\n tabindex=\"-1\"\n ></nv-iconbutton>\n <nv-iconbutton\n size=\"md\"\n name=\"plus\"\n emphasis=\"lower\"\n onClick={this.handlePlus}\n disabled={this.isMaxValueReached()}\n onMouseDown={this.preventSelection}\n tabindex=\"-1\"\n />\n </div>\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\">\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"]}
|
|
@@ -105,9 +105,9 @@ export class NvFieldpassword {
|
|
|
105
105
|
/****************************************************************************/
|
|
106
106
|
//#region RENDER
|
|
107
107
|
render() {
|
|
108
|
-
return (h(Host, { key: '
|
|
109
|
-
this.el.querySelector('[slot="description"]')) && (h("div", { key: '
|
|
110
|
-
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '
|
|
108
|
+
return (h(Host, { key: '3fd88ed71cb3c34fbd4a35cb861617687add3c76' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: 'b08c3c1d7ca6f196c547fdb42c2289f4fbacd461', htmlFor: this.inputId }, h("slot", { key: '2469c277ea25d8c9ea521cc05da068cf63465637', name: "label" }, this.label))), h("div", { key: '606a09205e3caa2490c3db48411eebc5bddbb786', class: "input-wrapper" }, h("slot", { key: '843cf4814cf84c9d6ca5fec7a13c30820dd0075a', name: "before-input" }), h("div", { key: '4b06bdf556442e8ccb4f28a450bcb5f432740b8a', class: "input-container", onClick: this.handleInputContainerClick }, h("slot", { key: 'c07a3575a5b831e5f803558607fbf677e5b2ffac', name: "leading-input" }), h("input", { key: 'c9536d50ff4ed09cffd13ba06d4599492f77feac', id: this.inputId, ref: e => (this.inputElement = e), autofocus: this.autofocus, autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, type: this.showPasswordState ? 'text' : 'password', inputMode: this.mode, value: this.value, required: this.required, maxlength: this.maxlength, minlength: this.minlength, pattern: this.pattern, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput }), (this.success || this.error) && (h("nv-icon", { key: 'df7f3b45b0dec7dabfdea7496ff6576413101cf5', name: this.success ? 'circle-check' : 'alert-circle', class: "validation", size: "md" })), !this.hidePasswordIcon && (h("nv-iconbutton", { key: 'ef3bc855fe5f70ed537d9b564b7f8b990998da48', name: this.showPasswordState ? 'eye' : 'eye-off', size: "md", emphasis: "lower", onClick: this.togglePasswordVisibility, "aria-label": this.showPasswordState ? 'Hide password' : 'Show password', "aria-pressed": this.showPasswordState.toString() }))), h("slot", { key: 'd7e892c362bcab7724c0250a8e097bdd3a7f28a2', name: "after-input" })), (this.description ||
|
|
109
|
+
this.el.querySelector('[slot="description"]')) && (h("div", { key: '5933be1bda9a32ceabcae5144e6a6a131203f9d6', class: "description" }, h("slot", { key: '31671c862c3e5988ef4939d21a75f721b47eacf6', name: "description" }, this.description))), (this.errorDescription ||
|
|
110
|
+
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: 'a38ff2519ae8da933b5884c0e576d91b8825dec7', hidden: !this.error, class: "error-description" }, h("slot", { key: 'ec242e6f6cf28b7e34bfcec658874067019ba540', name: "error-description" }, this.errorDescription)))));
|
|
111
111
|
}
|
|
112
112
|
static get is() { return "nv-fieldpassword"; }
|
|
113
113
|
static get formAssociated() { return true; }
|
|
@@ -83,9 +83,9 @@ export class NvFieldradio {
|
|
|
83
83
|
/****************************************************************************/
|
|
84
84
|
//#region RENDER
|
|
85
85
|
render() {
|
|
86
|
-
return (h(Host, { key: '
|
|
87
|
-
this.el.querySelector('[slot="description"]')) && (h("div", { key: '
|
|
88
|
-
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '
|
|
86
|
+
return (h(Host, { key: '18cad87f89d7532fab554e1ad74fcc615ddd8026', class: clsx(this.labelPlacement === 'before' && 'label-placement-before', this.error && 'error') }, h("input", { key: '347c33c2ff2b6377d009c108739e4016f97da16b', type: "radio", id: this.inputId, name: this.name, autofocus: this.autofocus, autocomplete: "off", value: this.value, checked: this.checked, disabled: this.disabled }), h("div", { key: '067cebdaf42e94c0b447a91b852a44fa7d5f58cf', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: '9c90d0c9e27125576e8194113412795243492c9d', htmlFor: this.inputId }, h("slot", { key: 'c5da5d8f8715635ec0adfd46ee704b7c0d940bdd', name: "label" }, this.label))), (this.description ||
|
|
87
|
+
this.el.querySelector('[slot="description"]')) && (h("div", { key: 'f5e00078f008ab49bbac08c3d3614cae05b783a7', class: "description" }, h("slot", { key: 'b70921bbe8acda5c9b7c8e7d81e2d696bc2e4613', name: "description" }, this.description))), (this.errorDescription ||
|
|
88
|
+
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: 'a6ccddfb948ba5db46f355bb3afd73873fcfe8e6', hidden: !this.error, class: "error-description" }, h("slot", { key: '896448579ceee1ba50672e58e8a70e21d5d9fc64', name: "error-description" }, this.errorDescription))))));
|
|
89
89
|
}
|
|
90
90
|
static get is() { return "nv-fieldradio"; }
|
|
91
91
|
static get formAssociated() { return true; }
|
|
@@ -335,13 +335,13 @@ export class NvFieldselect {
|
|
|
335
335
|
* @returns {HTMLStencilElement} The HTML element to render.
|
|
336
336
|
*/
|
|
337
337
|
render() {
|
|
338
|
-
return (h(Host, { key: '
|
|
338
|
+
return (h(Host, { key: 'a1a4eb304e38fb1b058b66af5d3c86edcb05610f' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: '8aa279dba4e264b17ebd3b33dcff4480ce6c5d57', htmlFor: this.inputId }, h("slot", { key: 'a7cd14d0efc0f22739ee5496d64aad0930000a6e', name: "label" }, this.label))), h("div", { key: '3929ad8d896250574d437d94ab35c72e55884e04', class: "select-wrapper" }, h("slot", { key: 'c92b18f7639b33ebfcf2f3a4b1c24ab4b5a54fa5', name: "before-input" }), h("div", { key: '8554dc402e570dd48ca5031f5e6e4d48f84e9a7d', class: "select-container", onClick: this.handleSelectContainerClick }, h("slot", { key: 'b76cd121460e53f5f0a1e4e7ca0e96f5e733f6f3', name: "leading-input" }), this.internalReadonly && (h("input", { key: 'f0600651b33c5768bab22f27109de445bdb70fff', id: this.inputId + '-readonly', type: "text", value: this.computedDisplayValue, readonly: true, class: "readonly-input", "aria-readonly": "true", "aria-label": this.label, "aria-describedby": this.error
|
|
339
339
|
? `${this.inputId}-error`
|
|
340
|
-
: `${this.inputId}-description` })), h("select", { key: '
|
|
340
|
+
: `${this.inputId}-description` })), h("select", { key: 'e1f9211919f9eef80c50c21536ee98e6dba71cb6', id: this.inputId, ref: el => (this.selectElement = el), name: this.name, autofocus: this.autofocus, disabled: this.disabled, required: this.required, multiple: this.multiple, onChange: this.handleSelectChange, class: this.internalReadonly ? 'hidden' : '', "aria-label": this.label, "aria-describedby": this.error
|
|
341
341
|
? `${this.inputId}-error`
|
|
342
|
-
: `${this.inputId}-description` }, this.options && this.options.length > 0 ? (this.options.map(option => (h("option", { value: option.value, selected: option.selected, disabled: option.disabled }, option.label)))) : (h("slot", null))), h("div", { key: '
|
|
343
|
-
this.el.querySelector('[slot="description"]')) && (h("div", { key: '
|
|
344
|
-
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '
|
|
342
|
+
: `${this.inputId}-description` }, this.options && this.options.length > 0 ? (this.options.map(option => (h("option", { value: option.value, selected: option.selected, disabled: option.disabled }, option.label)))) : (h("slot", null))), h("div", { key: '4e17199de9ac55f30ab27f37ad0f69526a96a53b', class: "select-icons" }, this.error && (h("nv-icon", { key: '6e02a15e6a72cd54910b44dcc3445bc0a875d301', name: "alert-circle", class: "validation", size: "md" })), this.success && (h("nv-icon", { key: '2c936e0fe3070fdb1540e50196850531c1a186f3', name: "circle-check", class: "validation", size: "md" })), !this.multiple && (h("nv-iconbutton", { key: '55ff8a3ad2908c9380041b684274ebb275197605', name: "chevron-down", size: "md", emphasis: "lower", tabindex: -1 })))), h("slot", { key: 'd32c4fa7b22a705dcb89224de06c1f5f0a965f34', name: "after-input" })), (this.description ||
|
|
343
|
+
this.el.querySelector('[slot="description"]')) && (h("div", { key: '1a8ba7867fa31618ae6d9149ce03ee63b0c958a1', class: "description", id: `${this.inputId}-description` }, h("slot", { key: '527ee48037f1d76e6478b90de86b5e4f0b819677', name: "description" }, this.description))), (this.errorDescription ||
|
|
344
|
+
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '5279561b8a6a20101447a05b4f99d4aea4e6994b', class: "error-description", id: `${this.inputId}-error` }, h("slot", { key: '101f92f3d2bba8c4c9502542fada0a1363ab5ad1', name: "error-description" }, this.errorDescription)))));
|
|
345
345
|
}
|
|
346
346
|
static get is() { return "nv-fieldselect"; }
|
|
347
347
|
static get formAssociated() { return true; }
|
|
@@ -464,11 +464,11 @@ export class NvFieldslider {
|
|
|
464
464
|
/****************************************************************************/
|
|
465
465
|
//#region RENDER
|
|
466
466
|
render() {
|
|
467
|
-
return (h(Host, { key: '
|
|
467
|
+
return (h(Host, { key: 'e4d4719682957f858468c3df97c82d5be29e87b8' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: 'a6d84550e4b91a4f23252e31ebbd3680b5a81aad', htmlFor: this.startInputId }, h("slot", { key: '44ce936f4b50ae5be5c3b8769b990fda82ff9b27', name: "label" }, this.label))), h("div", { key: '578a9673356506f87d906ff34254f93c0f724ebb', class: "slider-container" }, this.range ? (h(FieldInput, { range: this.range, hasField: this.hasField, value: this.valueInternal, rangeValue: this.rangeValueInternal, index: 0, inputId: this.startInputId, min: this.min, max: this.max, step: this.step, disabled: this.disabled, readonly: this.readonly, onInput: this.handleFieldChange, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue, name: this.name, endName: this.endName })) : null, h("div", { key: '1dd30a5e703309993e8d61dc44bf1ad0adbc11e0', class: "track-container" }, h("div", { key: '870f688ec85678ac490cfc1542cc8d1802a43ec7', class: "track", onPointerDown: this.onTrackInteraction }, this.range ? (h(RangeThumb, { rangeValue: this.rangeValueInternal, rawRangePosition: this.rawRangePosition, activeDragThumb: this.activeDragThumb, isDragging: this.isDragging, snap: this.snap, min: this.min, max: this.max, step: this.step, disabled: this.disabled, readonly: this.readonly, onKeyDown: this.onKeyDown, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue })) : (h(SingleThumb, { value: this.valueInternal, min: this.min, max: this.max, step: this.step, rawPosition: this.rawPosition, isDragging: this.isDragging, snap: this.snap, disabled: this.disabled, readonly: this.readonly, onKeyDown: this.onKeyDown, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue }))), h(TickMarks, { key: '75fb4d22e84ea569928e475e35d0031130f6c6ed', ticks: this.internalTicks, min: this.min, max: this.max })), this.range ? (h(FieldInput, { range: this.range, hasField: this.hasField, value: this.valueInternal, rangeValue: this.rangeValueInternal, index: 1, inputId: this.endInputId, min: this.min, max: this.max, step: this.step, disabled: this.disabled, readonly: this.readonly, onInput: this.handleFieldChange, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue, name: this.name, endName: this.endName })) : (h(FieldInput, { range: this.range, hasField: this.hasField, value: this.valueInternal, rangeValue: this.rangeValueInternal, inputId: this.startInputId, min: this.min, max: this.max, step: this.step, disabled: this.disabled, readonly: this.readonly, onInput: this.handleFieldChange, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue, name: this.name }))), (this.success ||
|
|
468
468
|
this.description ||
|
|
469
|
-
this.el.querySelector('[slot="description"]')) && (h("div", { key: '
|
|
469
|
+
this.el.querySelector('[slot="description"]')) && (h("div", { key: 'b88410b4d04254b66c146b39dc4215f92c42b9b8', class: "description" }, this.success && (h("nv-icon", { key: '4b3886cd627e8243d899399c60b85c47ce823170', name: "circle-check", class: "validation", size: "md" })), h("slot", { key: 'b262880c747c3f6d1e51b1d4214761d7aecc9f9c', name: "description" }, this.description))), (this.error ||
|
|
470
470
|
this.errorDescription ||
|
|
471
|
-
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '
|
|
471
|
+
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: 'ad5d61a003680c4ff53217bf594dcb4e5fa1b053', class: "error-description", hidden: !this.error }, this.error && (h("nv-icon", { key: '3898c1781b38497b3bd797587980ed9fd32c8afc', name: "alert-circle", class: "validation", size: "md" })), h("slot", { key: '7fa0cf391cdb113eba7dbcd76a66044fc4d60281', name: "error-description" }, this.errorDescription)))));
|
|
472
472
|
}
|
|
473
473
|
static get is() { return "nv-fieldslider"; }
|
|
474
474
|
static get formAssociated() { return true; }
|
|
@@ -28,7 +28,9 @@ export const FieldInput = props => {
|
|
|
28
28
|
const handleValueChanged = (event) => {
|
|
29
29
|
event.stopPropagation();
|
|
30
30
|
const newValue = event.detail;
|
|
31
|
-
|
|
31
|
+
// Accept null as a valid value (when field is cleared)
|
|
32
|
+
// Only reject NaN numbers
|
|
33
|
+
if (typeof newValue === 'number' && Number.isNaN(newValue)) {
|
|
32
34
|
return;
|
|
33
35
|
}
|
|
34
36
|
onInput({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-input.js","sourceRoot":"","sources":["../../../../src/components/nv-fieldslider/partials/field-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,CAAC,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,IAAI,MAAM,MAAM,CAAC;AA6CxB;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAyC,KAAK,CAAC,EAAE;IACtE,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,UAAU,EACV,KAAK,EACL,OAAO,EACP,GAAG,EACH,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,gBAAgB,EAChB,eAAe,EACf,IAAI,EACJ,OAAO,GACR,GAAG,KAAK,CAAC;IAEV,0DAA0D;IAC1D,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAErD,uDAAuD;IACvD,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAElE,yDAAyD;IACzD,IAAI,SAAiB,CAAC;IACtB,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAChB,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QACzB,CAAC;aAAM,CAAC;YACN,+DAA+D;YAC/D,SAAS,GAAG,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;SAAM,CAAC;QACN,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,MAAM,kBAAkB,GAAG,CACzB,KAAoE,EAC9D,EAAE;QACR,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC;QAE9B,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"field-input.js","sourceRoot":"","sources":["../../../../src/components/nv-fieldslider/partials/field-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,CAAC,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,IAAI,MAAM,MAAM,CAAC;AA6CxB;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAyC,KAAK,CAAC,EAAE;IACtE,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,UAAU,EACV,KAAK,EACL,OAAO,EACP,GAAG,EACH,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,gBAAgB,EAChB,eAAe,EACf,IAAI,EACJ,OAAO,GACR,GAAG,KAAK,CAAC;IAEV,0DAA0D;IAC1D,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAErD,uDAAuD;IACvD,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAElE,yDAAyD;IACzD,IAAI,SAAiB,CAAC;IACtB,IAAI,KAAK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,CAClB,YAAM,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,gBAAgB,IAC5C,eAAe,CACX,CACR,CACc,CACb,CACP,CAAC,CAAC,CAAC,CACF,aACE,EAAE,EAAE,OAAO,EACX,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,SAAS,GACf,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FunctionalComponent, h } from '@stencil/core';\nimport clsx from 'clsx';\n\n/**\n * Props for the FieldInput component\n */\nexport interface FieldInputProps {\n /** Whether this is a range slider */\n range: boolean;\n /** Whether to show the input field */\n hasField: boolean;\n /** The value for single mode */\n value: number;\n /** The values for range mode [min, max] */\n rangeValue: number[];\n /** Index (0 or 1) for range mode, ignored in single mode */\n index?: number;\n /** ID for the input field */\n inputId: string;\n /** Minimum allowed value */\n min: number;\n /** Maximum allowed value */\n max: number;\n /** Step size */\n step: number;\n /** Whether the slider is disabled */\n disabled: boolean;\n /** Whether the slider is readonly */\n readonly: boolean;\n /** Handler for input changes */\n onInput: (details: {\n /** Parsed value */\n value: number | null;\n /** Index (0 or 1) for range mode, ignored in single mode */\n index?: number;\n }) => void;\n /** Label to display before the value */\n labelBeforeValue?: string;\n /** Label to display after the value */\n labelAfterValue?: string;\n /** Name attribute for the input field (for form submission) */\n name?: string;\n /** Name attribute for the end input field (when in range mode) */\n endName?: string;\n}\n\n/**\n * Renders field input for direct value entry\n * @param {FieldInputProps} props - Component properties\n * @returns {JSX.Element} JSX element representing the field input\n */\nexport const FieldInput: FunctionalComponent<FieldInputProps> = props => {\n const {\n range,\n hasField,\n value,\n rangeValue,\n index,\n inputId,\n min,\n max,\n step,\n disabled,\n readonly,\n onInput,\n labelBeforeValue,\n labelAfterValue,\n name,\n endName,\n } = props;\n\n // Determine the appropriate value based on mode and index\n const fieldValue = range ? rangeValue[index] : value;\n\n // In range mode, we need data-index for event handling\n const dataAttrs = range ? { 'data-index': index.toString() } : {};\n\n // Determine the appropriate name based on mode and index\n let inputName: string;\n if (range) {\n if (index === 0) {\n inputName = name || '';\n } else {\n // Use endName if provided, otherwise append \"-end\" to the name\n inputName = endName || (name ? `${name}-end` : '');\n }\n } else {\n inputName = name || '';\n }\n\n const handleValueChanged = (\n event: CustomEvent<HTMLNvFieldnumberElementEventMap['valueChanged']>,\n ): void => {\n event.stopPropagation();\n const newValue = event.detail;\n\n // Accept null as a valid value (when field is cleared)\n // Only reject NaN numbers\n if (typeof newValue === 'number' && Number.isNaN(newValue)) {\n return;\n }\n\n onInput({\n value: newValue,\n index,\n });\n };\n\n return hasField ? (\n <div class={clsx(!hasField && 'hidden-input')}>\n <nv-fieldnumber\n id={inputId}\n value={fieldValue}\n min={min}\n max={max}\n step={step}\n disabled={disabled}\n readonly={readonly}\n name={inputName}\n {...dataAttrs}\n onInput={e => e.stopPropagation()}\n onValueChanged={handleValueChanged}\n >\n {labelBeforeValue && (\n <span class=\"label-before\" slot=\"leading-input\">\n {labelBeforeValue}\n </span>\n )}\n {labelAfterValue && (\n <span class=\"label-after\" slot=\"trailing-input\">\n {labelAfterValue}\n </span>\n )}\n </nv-fieldnumber>\n </div>\n ) : (\n <input\n id={inputId}\n type=\"hidden\"\n value={fieldValue}\n disabled={disabled}\n readonly={readonly}\n name={inputName}\n />\n );\n};\n"]}
|
|
@@ -111,9 +111,9 @@ export class NvFieldtext {
|
|
|
111
111
|
/****************************************************************************/
|
|
112
112
|
//#region RENDER
|
|
113
113
|
render() {
|
|
114
|
-
return (h(Host, { key: '
|
|
115
|
-
this.el.querySelector('[slot="description"]')) && (h("div", { key: '
|
|
116
|
-
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '
|
|
114
|
+
return (h(Host, { key: '59c03a594971eab5cb8ae4bf7b5342899bba4336' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: 'a36f03b76cee03be0fe2608fd40a88455818a83b', htmlFor: this.inputId }, h("slot", { key: '284a3f6f9efaed1ee7a40675fd377bdbe3d08d9e', name: "label" }, this.label))), h("div", { key: '963b853f5de42058d1cdced00c7bdc38f4583000', class: "input-wrapper" }, h("slot", { key: 'dce7ea85a9ae76c923ea3dc732d93614b94ba391', name: "before-input" }), h("div", { key: 'eac7b8e1d85f9623287f839cdc7ef3133c9c75d8', class: "input-container", onClick: this.handleInputContainerClick }, h("slot", { key: 'db3ab29c4a0767ffc8f8c1368085052769bdc4cc', name: "leading-input" }), h("input", { key: 'd4759f1dd7bab6da0a4486cf326cb55c61fcb750', 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, autofocus: this.autofocus, autocomplete: this.autocomplete, multiple: this.multiple, value: this.value, onInput: this.handleInput }), h("slot", { key: 'e8950b2b41ce5e350e39084c3d6936a1a11960e4', name: "trailing-input" }), this.error && (h("nv-icon", { key: '83eb974690dfd69858877ba434e4dd30802208c8', name: "alert-circle", class: "validation", size: "md" })), this.success && (h("nv-icon", { key: '2b8e37bd41e2b98ae17a249379528dd6e1773e6e', name: "circle-check", class: "validation", size: "md" }))), h("slot", { key: '72e5ae030d15c61409095f4067436ee890d21a1e', name: "after-input" })), (this.description ||
|
|
115
|
+
this.el.querySelector('[slot="description"]')) && (h("div", { key: '54a353743334cf7d96597a543d0e2a7c52833a31', class: "description" }, h("slot", { key: '70dd9595b638f0dc56db6ecb24a93fcca629a2d3', name: "description" }, this.description))), (this.errorDescription ||
|
|
116
|
+
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '47a26240ae8875cedb50b95d0ad41dab762af6d3', hidden: !this.error, class: "error-description" }, h("slot", { key: '0c84a7c46128a5c0960b5e2ecfda94f76ef9d7d7', name: "error-description" }, this.errorDescription)))));
|
|
117
117
|
}
|
|
118
118
|
static get is() { return "nv-fieldtext"; }
|
|
119
119
|
static get formAssociated() { return true; }
|
|
@@ -177,9 +177,9 @@ export class NvFieldtextarea {
|
|
|
177
177
|
/****************************************************************************/
|
|
178
178
|
//#region RENDER
|
|
179
179
|
render() {
|
|
180
|
-
return (h(Host, { key: '
|
|
181
|
-
this.el.querySelector('[slot="description"]')) && (h("div", { key: '
|
|
182
|
-
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '
|
|
180
|
+
return (h(Host, { key: '3011ab5796ff80bef57fa31f8c0c3862ea8b2ec9' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: '5ce143e110d23ae0812d8e3282c7cfd7013dbf8c', htmlFor: this.inputId }, h("slot", { key: 'd2aec99e424f7acef8b6831ce88a094e7b97d5a2', name: "label" }, this.label))), h("div", { key: 'd7ca0f0a7002649b62c90a0f414ce951a45fb36f', class: "textarea-wrapper" }, h("div", { key: '7052a545876c11736cc851099aeca3d827e23e94', class: "textarea-container", onClick: this.handleTextareaContainerClick }, h("textarea", { key: 'efd08cdc7604f7394beb6040c4a4e85fffdd01a5', id: this.inputId, ref: e => (this.textareaElement = e), placeholder: this.placeholder, autofocus: this.autofocus, 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(this.resize === 'none' && 'resize-none', this.resize === 'vertical' && 'resize-y', this.resize === 'horizontal' && 'resize-x', this.resize === 'both' && 'resize') }))), (this.description ||
|
|
181
|
+
this.el.querySelector('[slot="description"]')) && (h("div", { key: '03c0ac2d2a63ac5836ec45b64fa368d7e6462e41', class: "description" }, h("slot", { key: 'afe544101550988895f12598adbc13e25d5f221f', name: "description" }, this.description))), (this.errorDescription ||
|
|
182
|
+
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '45f08a76bf8abfc53a231d4e8977bbe6ed80b64d', hidden: !this.error, class: "error-description" }, h("slot", { key: '4f37c2099badf5ccf9b58bb5ce71292c3b2baae5', name: "error-description" }, this.errorDescription)))));
|
|
183
183
|
}
|
|
184
184
|
static get is() { return "nv-fieldtextarea"; }
|
|
185
185
|
static get formAssociated() { return true; }
|
|
@@ -153,6 +153,7 @@ export class NvFieldtime {
|
|
|
153
153
|
if (firstVisibleType && this.inputElements[firstVisibleType]) {
|
|
154
154
|
this.inputElements[firstVisibleType].blur();
|
|
155
155
|
}
|
|
156
|
+
this.open = false;
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
159
|
//#endregion LISTENERS
|
|
@@ -827,9 +828,9 @@ export class NvFieldtime {
|
|
|
827
828
|
}, key: `${option}-${index}`, onClick: e => this.handleTimeOptionClick(e, type) }, option)))));
|
|
828
829
|
}
|
|
829
830
|
render() {
|
|
830
|
-
return (h(Host, { key: '
|
|
831
|
-
this.el.querySelector('[slot="description"]')) && (h("div", { key: '
|
|
832
|
-
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '
|
|
831
|
+
return (h(Host, { key: 'f66fe2a29f23a0bc967821a0c9bca4347b622286', onclick: (e) => this.handleHostClick(e), "aria-expanded": this.open ? 'true' : 'false' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: 'f01ce1b034b1b547cbdde5814db9357ee1913e04', htmlFor: this.inputId }, h("slot", { key: 'd81dcb20883b93280db6e76e0299f679f1f9ed84', name: "label" }, this.label))), h("nv-popover", { key: '8c9e83002edcfba89ca4ca282fc82db714ed2f43', ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, h("div", { key: '3a5b26e4be67f277ead2a9fe2f04e5d12a4bd596', class: "input-wrapper", slot: "trigger" }, h("slot", { key: '2ea5f8269c6f0892c53a002a298ca3ceed8f8a00', name: "before-input" }), h("div", { key: 'ab97bbbf183118d7b510f82c800b4a3fa1fefda3', class: "input-container" }, h("slot", { key: 'a80d2f68b24d4226c18bf0df18ebf13ac6e0873e', name: "leading-input" }), this.renderTimeInputFields(), h("nv-iconbutton", { key: '1f7aacf1ab073c0c6ef10b50e948a7ecbca4dd75', name: 'clock', size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide time picker' : 'Show time picker', onClick: () => this.HandleDropdownIconClick() }), this.error && (h("nv-icon", { key: '8f414a3b3daae6f0625b3c62b920621bf8698db3', name: "alert-circle", class: "validation", size: "sm" })), this.success && (h("nv-icon", { key: '13b5671664466b6bb50f2561b5cffb96517a1068', name: "circle-check", class: "validation", size: "sm" }))), h("slot", { key: 'b5d6085a9864ef84d4113062a0b1cb8a807ab241', name: "after-input" })), h("div", { key: '2950c5fac3a0f219e5db2e3a7e9f605d86e50aa2', class: "time-dropdown", slot: "content" }, h("div", { key: 'c5b7ff3818a05e1f6d7ca76657f57b85bb595345', class: "time-columns" }, this.renderTimeDropdownColumns()))), (this.description ||
|
|
832
|
+
this.el.querySelector('[slot="description"]')) && (h("div", { key: 'c8cb90fad74721a9b5eb0ab50980f3fd7c587e62', class: "description" }, h("slot", { key: '641d1a6a9dbf580267664831d5b371a601afb039', name: "description" }, this.description))), (this.errorDescription ||
|
|
833
|
+
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '5721b81d7a16b626bfa7c3af20897f33b7c37080', hidden: !this.error, class: "error-description" }, h("slot", { key: '84cef1043666ab6dd86f70d4ba0054d7f33ca589', name: "error-description" }, this.errorDescription)))));
|
|
833
834
|
}
|
|
834
835
|
static get is() { return "nv-fieldtime"; }
|
|
835
836
|
static get formAssociated() { return true; }
|