@nova-design-system/nova-webcomponents 3.0.0-beta.46 → 3.0.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-9bda5507.js +0 -4
- 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-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/nv-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/nv-button.cjs.entry.js +1 -1
- package/dist/cjs/nv-calendar.cjs.entry.js +48 -19
- package/dist/cjs/nv-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-col.cjs.entry.js +1 -1
- package/dist/cjs/nv-datagrid.cjs.entry.js +351 -91
- package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-datagridcolumn.cjs.entry.js +1 -1
- package/dist/cjs/nv-dialog.cjs.entry.js +1 -1
- package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +4 -4
- package/dist/cjs/nv-fielddate.cjs.entry.js +5 -5
- package/dist/cjs/nv-fielddaterange.cjs.entry.js +4 -4
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +15 -29
- package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +28 -71
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +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-fieldradio.cjs.entry.js +3 -3
- package/dist/cjs/nv-fieldselect.cjs.entry.js +5 -5
- 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 +9 -9
- package/dist/cjs/nv-icon.cjs.entry.js +1 -1
- package/dist/cjs/nv-iconbutton_2.cjs.entry.js +2 -2
- package/dist/cjs/nv-menu.cjs.entry.js +16 -42
- 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-popover.cjs.entry.js +1 -1
- package/dist/cjs/nv-row.cjs.entry.js +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 +2 -2
- package/dist/cjs/nv-toggle.cjs.entry.js +2 -2
- package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/nv-breadcrumb/nv-breadcrumb.js +1 -1
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.js +1 -1
- package/dist/collection/components/nv-button/nv-button.js +1 -1
- package/dist/collection/components/nv-calendar/nv-calendar.docs.js +0 -9
- package/dist/collection/components/nv-calendar/nv-calendar.docs.js.map +1 -1
- package/dist/collection/components/nv-calendar/nv-calendar.js +48 -19
- package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
- package/dist/collection/components/nv-col/nv-col.js +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +542 -75
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.js +366 -95
- package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -1
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js +1 -1
- package/dist/collection/components/nv-dialog/nv-dialog.js +1 -1
- package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.js +1 -1
- package/dist/collection/components/nv-dialogheader/nv-dialogheader.js +1 -1
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js +4 -4
- package/dist/collection/components/nv-fielddate/nv-fielddate.js +5 -5
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +4 -4
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js +8 -8
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js.map +1 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +22 -39
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js +1 -1
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js +1 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js +6 -6
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +35 -85
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +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-fieldradio/nv-fieldradio.js +3 -3
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +5 -5
- 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 +9 -9
- package/dist/collection/components/nv-icon/nv-icon.js +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.docs.js +3 -3
- package/dist/collection/components/nv-menu/nv-menu.docs.js.map +1 -1
- package/dist/collection/components/nv-menu/nv-menu.js +31 -59
- package/dist/collection/components/nv-menu/nv-menu.js.map +1 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js +1 -1
- package/dist/collection/components/nv-popover/nv-popover.js +1 -1
- package/dist/collection/components/nv-row/nv-row.js +1 -1
- package/dist/collection/components/nv-stack/nv-stack.docs.js +7 -6
- package/dist/collection/components/nv-stack/nv-stack.docs.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.js +2 -2
- package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
- 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 +3 -3
- package/dist/components/nv-breadcrumbs.js +1 -1
- package/dist/components/nv-button.js +1 -1
- package/dist/components/nv-calendar.js +1 -1
- package/dist/components/nv-col.js +1 -1
- package/dist/components/nv-datagrid.js +359 -94
- package/dist/components/nv-datagrid.js.map +1 -1
- package/dist/components/nv-datagridcolumn.js +1 -1
- package/dist/components/nv-dialog.js +6 -6
- package/dist/components/nv-dialogfooter.js +1 -1
- package/dist/components/nv-dialogheader.js +1 -1
- package/dist/components/nv-fieldcheckbox.js +1 -1
- package/dist/components/nv-fielddate.js +12 -12
- package/dist/components/nv-fielddaterange.js +11 -11
- package/dist/components/nv-fielddropdown.js +21 -36
- 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 +36 -81
- package/dist/components/nv-fieldmultiselect.js.map +1 -1
- package/dist/components/nv-fieldnumber.js +6 -6
- package/dist/components/nv-fieldnumber.js.map +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-fieldtext.js +4 -4
- package/dist/components/nv-fieldtextarea.js +3 -3
- package/dist/components/nv-fieldtime.js +13 -13
- 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 +21 -50
- package/dist/components/nv-menu.js.map +1 -1
- package/dist/components/nv-menuitem.js +1 -1
- package/dist/components/nv-popover.js +1 -1
- package/dist/components/nv-row.js +1 -1
- package/dist/components/nv-stack.js +1 -1
- package/dist/components/nv-stack.js.map +1 -1
- package/dist/components/nv-table.js +2 -2
- package/dist/components/nv-toggle.js +2 -2
- package/dist/components/nv-tooltip.js +1 -1
- package/dist/components/{p-d88ced51.js → p-02752770.js} +2 -2
- package/dist/components/{p-d88ced51.js.map → p-02752770.js.map} +1 -1
- package/dist/components/{p-7b89fb48.js → p-150daf68.js} +2 -2
- package/dist/components/{p-7b89fb48.js.map → p-150daf68.js.map} +1 -1
- package/dist/components/{p-56ef8131.js → p-2012b8ba.js} +3 -3
- package/dist/components/{p-56ef8131.js.map → p-2012b8ba.js.map} +1 -1
- package/dist/components/{p-8674c7af.js → p-2d9ba7d3.js} +3 -3
- package/dist/components/{p-8674c7af.js.map → p-2d9ba7d3.js.map} +1 -1
- package/dist/components/{p-5a5f11c2.js → p-373926aa.js} +2 -2
- package/dist/components/{p-5a5f11c2.js.map → p-373926aa.js.map} +1 -1
- package/dist/components/{p-dcabc6fa.js → p-4d3ec142.js} +3 -3
- package/dist/components/{p-dcabc6fa.js.map → p-4d3ec142.js.map} +1 -1
- package/dist/components/{p-91b58443.js → p-591730e7.js} +2 -2
- package/dist/components/{p-91b58443.js.map → p-591730e7.js.map} +1 -1
- package/dist/components/{p-b4768da6.js → p-6c364a23.js} +5 -5
- package/dist/components/{p-b4768da6.js.map → p-6c364a23.js.map} +1 -1
- package/dist/components/{p-f469df15.js → p-a30b55fc.js} +2 -2
- package/dist/components/{p-f469df15.js.map → p-a30b55fc.js.map} +1 -1
- package/dist/components/{p-664c5a14.js → p-b7b78e64.js} +2 -2
- package/dist/components/{p-664c5a14.js.map → p-b7b78e64.js.map} +1 -1
- package/dist/components/{p-8c5a861b.js → p-c14f6b8e.js} +3 -3
- package/dist/components/{p-8c5a861b.js.map → p-c14f6b8e.js.map} +1 -1
- package/dist/components/{p-a9e1bf70.js → p-dc3faba3.js} +4 -4
- package/dist/components/{p-a9e1bf70.js.map → p-dc3faba3.js.map} +1 -1
- package/dist/components/{p-9d6aaf76.js → p-e00cbb8a.js} +5 -5
- package/dist/components/{p-9d6aaf76.js.map → p-e00cbb8a.js.map} +1 -1
- package/dist/components/{p-a9f162a8.js → p-f331117c.js} +53 -24
- package/dist/components/p-f331117c.js.map +1 -0
- package/dist/components/{p-18bc0291.js → p-f4d86795.js} +3 -3
- package/dist/components/{p-18bc0291.js.map → p-f4d86795.js.map} +1 -1
- package/dist/esm/index-1fb7a9a6.js +0 -4
- 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-breadcrumb.entry.js +1 -1
- package/dist/esm/nv-breadcrumbs.entry.js +1 -1
- package/dist/esm/nv-button.entry.js +1 -1
- package/dist/esm/nv-calendar.entry.js +48 -19
- package/dist/esm/nv-calendar.entry.js.map +1 -1
- package/dist/esm/nv-col.entry.js +1 -1
- package/dist/esm/nv-datagrid.entry.js +351 -91
- package/dist/esm/nv-datagrid.entry.js.map +1 -1
- package/dist/esm/nv-datagridcolumn.entry.js +1 -1
- package/dist/esm/nv-dialog.entry.js +1 -1
- package/dist/esm/nv-dialogfooter_2.entry.js +2 -2
- package/dist/esm/nv-fieldcheckbox.entry.js +4 -4
- package/dist/esm/nv-fielddate.entry.js +5 -5
- package/dist/esm/nv-fielddaterange.entry.js +4 -4
- package/dist/esm/nv-fielddropdown.entry.js +15 -29
- package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdownitem.entry.js +1 -1
- package/dist/esm/nv-fieldmultiselect.entry.js +28 -71
- package/dist/esm/nv-fieldmultiselect.entry.js.map +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-fieldradio.entry.js +3 -3
- package/dist/esm/nv-fieldselect.entry.js +5 -5
- 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 +9 -9
- package/dist/esm/nv-icon.entry.js +1 -1
- package/dist/esm/nv-iconbutton_2.entry.js +2 -2
- package/dist/esm/nv-menu.entry.js +16 -42
- package/dist/esm/nv-menu.entry.js.map +1 -1
- package/dist/esm/nv-menuitem.entry.js +1 -1
- package/dist/esm/nv-popover.entry.js +1 -1
- package/dist/esm/nv-row.entry.js +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 +2 -2
- package/dist/esm/nv-toggle.entry.js +2 -2
- package/dist/esm/nv-tooltip.entry.js +1 -1
- package/dist/native/native.esm.js +1 -1
- package/dist/native/native.esm.js.map +1 -1
- package/dist/native/p-0245863d.entry.js +2 -0
- package/dist/native/{p-8946883b.entry.js → p-0ee428d5.entry.js} +2 -2
- package/dist/native/{p-8f7c1bb8.entry.js → p-244f56ac.entry.js} +2 -2
- package/dist/native/p-2691e02d.entry.js +2 -0
- package/dist/native/{p-aeac63ea.entry.js → p-37f0210e.entry.js} +2 -2
- package/dist/native/{p-000ef9c9.entry.js → p-39bb95ff.entry.js} +2 -2
- package/dist/native/{p-76cd466a.entry.js → p-4ae26462.entry.js} +2 -2
- package/dist/native/{p-75f4bfe8.entry.js → p-4d9c4618.entry.js} +2 -2
- package/dist/native/p-4d9c4618.entry.js.map +1 -0
- package/dist/native/{p-d4e48d08.entry.js → p-59e0bd2b.entry.js} +2 -2
- package/dist/native/{p-d4e48d08.entry.js.map → p-59e0bd2b.entry.js.map} +1 -1
- package/dist/native/{p-626a1372.entry.js → p-5c00f092.entry.js} +2 -2
- package/dist/native/p-63e6aed3.entry.js +2 -0
- package/dist/native/p-63e6aed3.entry.js.map +1 -0
- package/dist/native/{p-4fe5ebe9.entry.js → p-6b348684.entry.js} +2 -2
- package/dist/native/{p-aa957898.entry.js → p-6ff228da.entry.js} +2 -2
- package/dist/native/{p-aa957898.entry.js.map → p-6ff228da.entry.js.map} +1 -1
- package/dist/native/{p-74f7f404.entry.js → p-701b5557.entry.js} +2 -2
- package/dist/native/{p-002e7bf1.entry.js → p-7f5eb2ac.entry.js} +2 -2
- package/dist/native/{p-e4f84faa.entry.js → p-84a73e2a.entry.js} +2 -2
- package/dist/native/p-9135fdf5.entry.js +2 -0
- package/dist/native/p-93dc2f47.entry.js +2 -0
- package/dist/native/{p-7e1fa44c.entry.js.map → p-93dc2f47.entry.js.map} +1 -1
- package/dist/native/{p-be5f62e5.entry.js → p-9a267f16.entry.js} +2 -2
- package/dist/native/p-9a267f16.entry.js.map +1 -0
- package/dist/native/{p-60d6ffa3.entry.js → p-9d6431c7.entry.js} +2 -2
- package/dist/native/{p-b11fdaed.entry.js → p-b094296d.entry.js} +2 -2
- package/dist/native/{p-43cc98dc.entry.js → p-b2ce83ad.entry.js} +2 -2
- package/dist/native/{p-115ad66c.entry.js → p-bad11367.entry.js} +2 -2
- package/dist/native/{p-6603d939.entry.js → p-c7b201cd.entry.js} +2 -2
- package/dist/native/{p-4c859a14.entry.js → p-d7a76400.entry.js} +2 -2
- package/dist/native/p-e1a4f776.entry.js +2 -0
- package/dist/native/p-e1a4f776.entry.js.map +1 -0
- package/dist/native/p-e49bbd02.entry.js +2 -0
- package/dist/native/p-e49bbd02.entry.js.map +1 -0
- package/dist/native/{p-98030346.entry.js → p-e5de64d5.entry.js} +2 -2
- package/dist/native/p-eee01062.entry.js +2 -0
- package/dist/native/{p-3df6febe.entry.js.map → p-eee01062.entry.js.map} +1 -1
- package/dist/native/{p-b6164ebc.entry.js → p-f6bdc270.entry.js} +2 -2
- package/dist/native/{p-50dcce07.entry.js → p-f85aca27.entry.js} +2 -2
- package/dist/native/{p-1e5453be.entry.js → p-fa77a591.entry.js} +2 -2
- package/dist/native/{p-d5158e27.entry.js → p-fb5bddba.entry.js} +2 -2
- package/dist/types/components/nv-calendar/nv-calendar.d.ts +10 -7
- package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +37 -2
- package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +16 -20
- package/dist/types/components/nv-fieldmultiselect/nv-fieldmultiselect.d.ts +16 -34
- package/dist/types/components/nv-menu/nv-menu.d.ts +46 -12
- package/dist/types/components.d.ts +174 -43
- package/dist/vscode-data.json +8 -20
- package/hydrate/index.js +535 -407
- package/hydrate/index.mjs +535 -407
- package/package.json +3 -2
- package/dist/cjs/nv-base.cjs.entry.js +0 -74
- package/dist/cjs/nv-base.cjs.entry.js.map +0 -1
- package/dist/collection/components/nv-base/nv-base.docs.js +0 -5
- package/dist/collection/components/nv-base/nv-base.docs.js.map +0 -1
- package/dist/collection/components/nv-base/nv-base.js +0 -68
- package/dist/collection/components/nv-base/nv-base.js.map +0 -1
- package/dist/components/nv-base.d.ts +0 -11
- package/dist/components/nv-base.js +0 -88
- package/dist/components/nv-base.js.map +0 -1
- package/dist/components/p-a9f162a8.js.map +0 -1
- package/dist/esm/nv-base.entry.js +0 -70
- package/dist/esm/nv-base.entry.js.map +0 -1
- package/dist/native/p-2ed9934a.entry.js +0 -2
- package/dist/native/p-2ed9934a.entry.js.map +0 -1
- package/dist/native/p-3df6febe.entry.js +0 -2
- package/dist/native/p-4977fcd0.entry.js +0 -2
- package/dist/native/p-75f4bfe8.entry.js.map +0 -1
- package/dist/native/p-7e1fa44c.entry.js +0 -2
- package/dist/native/p-b8b58064.entry.js +0 -2
- package/dist/native/p-be5f62e5.entry.js.map +0 -1
- package/dist/native/p-c6fe73a9.entry.js +0 -2
- package/dist/native/p-c6fe73a9.entry.js.map +0 -1
- package/dist/native/p-ce64d562.entry.js +0 -2
- package/dist/native/p-d352a8b3.entry.js +0 -2
- package/dist/native/p-d352a8b3.entry.js.map +0 -1
- package/dist/native/p-e200185a.entry.js +0 -2
- package/dist/native/p-e200185a.entry.js.map +0 -1
- package/dist/types/components/nv-base/nv-base.d.ts +0 -17
- package/dist/types/components/nv-base/nv-base.docs.d.ts +0 -5
- /package/dist/native/{p-ce64d562.entry.js.map → p-0245863d.entry.js.map} +0 -0
- /package/dist/native/{p-8946883b.entry.js.map → p-0ee428d5.entry.js.map} +0 -0
- /package/dist/native/{p-8f7c1bb8.entry.js.map → p-244f56ac.entry.js.map} +0 -0
- /package/dist/native/{p-4977fcd0.entry.js.map → p-2691e02d.entry.js.map} +0 -0
- /package/dist/native/{p-aeac63ea.entry.js.map → p-37f0210e.entry.js.map} +0 -0
- /package/dist/native/{p-000ef9c9.entry.js.map → p-39bb95ff.entry.js.map} +0 -0
- /package/dist/native/{p-76cd466a.entry.js.map → p-4ae26462.entry.js.map} +0 -0
- /package/dist/native/{p-626a1372.entry.js.map → p-5c00f092.entry.js.map} +0 -0
- /package/dist/native/{p-4fe5ebe9.entry.js.map → p-6b348684.entry.js.map} +0 -0
- /package/dist/native/{p-74f7f404.entry.js.map → p-701b5557.entry.js.map} +0 -0
- /package/dist/native/{p-002e7bf1.entry.js.map → p-7f5eb2ac.entry.js.map} +0 -0
- /package/dist/native/{p-e4f84faa.entry.js.map → p-84a73e2a.entry.js.map} +0 -0
- /package/dist/native/{p-b8b58064.entry.js.map → p-9135fdf5.entry.js.map} +0 -0
- /package/dist/native/{p-60d6ffa3.entry.js.map → p-9d6431c7.entry.js.map} +0 -0
- /package/dist/native/{p-b11fdaed.entry.js.map → p-b094296d.entry.js.map} +0 -0
- /package/dist/native/{p-43cc98dc.entry.js.map → p-b2ce83ad.entry.js.map} +0 -0
- /package/dist/native/{p-115ad66c.entry.js.map → p-bad11367.entry.js.map} +0 -0
- /package/dist/native/{p-6603d939.entry.js.map → p-c7b201cd.entry.js.map} +0 -0
- /package/dist/native/{p-4c859a14.entry.js.map → p-d7a76400.entry.js.map} +0 -0
- /package/dist/native/{p-98030346.entry.js.map → p-e5de64d5.entry.js.map} +0 -0
- /package/dist/native/{p-b6164ebc.entry.js.map → p-f6bdc270.entry.js.map} +0 -0
- /package/dist/native/{p-50dcce07.entry.js.map → p-f85aca27.entry.js.map} +0 -0
- /package/dist/native/{p-1e5453be.entry.js.map → p-fa77a591.entry.js.map} +0 -0
- /package/dist/native/{p-d5158e27.entry.js.map → p-fb5bddba.entry.js.map} +0 -0
|
@@ -344,13 +344,13 @@ const NvFieldselect = class {
|
|
|
344
344
|
* @returns {HTMLStencilElement} The HTML element to render.
|
|
345
345
|
*/
|
|
346
346
|
render() {
|
|
347
|
-
return (index.h(index.Host, { key: '
|
|
347
|
+
return (index.h(index.Host, { key: '38cb85c6698c5541793a1e5d34b36417cd743759' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'd81b9837c43c1a19a2d87b51cede9e7c32bda50c', htmlFor: this.inputId }, index.h("slot", { key: '9d7c10281b117f2006ca1997f91e4e0b99fc5ab5', name: "label" }, this.label))), index.h("div", { key: '2796a31f2aac0604054c4542564fca77c2ac4272', class: "select-wrapper" }, index.h("slot", { key: '0407c6379597b09e1bb11ee6b43110b1d5fb98ea', name: "before-input" }), index.h("div", { key: 'c0ae999fc017fb0352b0a1cfe2ff75e313955f23', class: "select-container", onClick: this.handleSelectContainerClick }, index.h("slot", { key: 'ea2b63ddb3b70521b63e15efd1c3daf06c38cc0a', name: "leading-input" }), this.internalReadonly && (index.h("input", { key: 'f543f67c0360ac315ed873eb14a93af35dd90670', 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
|
|
348
348
|
? `${this.inputId}-error`
|
|
349
|
-
: `${this.inputId}-description` })), index.h("select", { key: '
|
|
349
|
+
: `${this.inputId}-description` })), index.h("select", { key: 'b2ae3854c40ea798069417127cd763c8a0db040e', 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
|
|
350
350
|
? `${this.inputId}-error`
|
|
351
|
-
: `${this.inputId}-description` }, this.parsedOptions.length > 0 ? (this.parsedOptions.map(option => (index.h("option", { value: option.value, selected: option.selected, disabled: option.disabled }, option.label)))) : (index.h("slot", null))), index.h("div", { key: '
|
|
352
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
353
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '
|
|
351
|
+
: `${this.inputId}-description` }, this.parsedOptions.length > 0 ? (this.parsedOptions.map(option => (index.h("option", { value: option.value, selected: option.selected, disabled: option.disabled }, option.label)))) : (index.h("slot", null))), index.h("div", { key: 'dd59af14105272eaa77218136f5b7b0b40a5b40b', class: "select-icons" }, this.error && (index.h("nv-icon", { key: '719e239472f6b697298682cc8d1b10933d3504ec', name: "alert-circle", class: "validation", size: "md" })), this.success && (index.h("nv-icon", { key: '5d63d5ddbcd8f46296bc067afd45f3921f4f3917', name: "circle-check", class: "validation", size: "md" })), !this.multiple && (index.h("nv-iconbutton", { key: '978a540682409a88ce55d2219dbeb9f2fc82cd51', name: "chevron-down", size: "md", emphasis: "lower", tabindex: -1 })))), index.h("slot", { key: '3483846a9f38be08caaf6f2b02332caefae0cbed', name: "after-input" })), (this.description ||
|
|
352
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '5b47c05942549b6e2238696132ab2f3c9af5b7f0', class: "description", id: `${this.inputId}-description` }, index.h("slot", { key: '46b7f053ae343949b540240e1ec438850bb9a015', name: "description" }, this.description))), (this.errorDescription ||
|
|
353
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '6126ab6967fc430c6a1d3ddfb191a98a8c2ecce9', class: "error-description", id: `${this.inputId}-error` }, index.h("slot", { key: 'afc6a0443c6fe1175213d36a2c59ffefe2923eab', name: "error-description" }, this.errorDescription)))));
|
|
354
354
|
}
|
|
355
355
|
static get formAssociated() { return true; }
|
|
356
356
|
get el() { return index.getElement(this); }
|
|
@@ -108,9 +108,9 @@ const NvFieldtext = class {
|
|
|
108
108
|
/****************************************************************************/
|
|
109
109
|
//#region RENDER
|
|
110
110
|
render() {
|
|
111
|
-
return (index.h(index.Host, { key: '
|
|
112
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
113
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '
|
|
111
|
+
return (index.h(index.Host, { key: 'e4891525becd4b0757ec380d45d9694ebc6c3318' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '1157e609be8150d014e9190dcf53f74bcee20119', htmlFor: this.inputId }, index.h("slot", { key: '888fb12e994f6f4f47bc2be496cd74aeedb628c0', name: "label" }, this.label))), index.h("div", { key: '0555b12dbbe5fa81f5af464d3b48c35b243aec32', class: "input-wrapper" }, index.h("slot", { key: '5210a9b903c560775453741d8815286dbe8bbb53', name: "before-input" }), index.h("div", { key: '7bc11232dfa46706982bf3645054a7a1f67832f9', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: '87abc6976b432a3dc51246c97564108f9baccff8', name: "leading-input" }), index.h("input", { key: 'b0c3e30bc5363f6b49ea1361005e125826184016', 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 }), this.error && (index.h("nv-icon", { key: '5e359bc40906bbf2c63eb7d196dd8294b15dd672', name: "alert-circle", class: "validation", size: "md" })), this.success && (index.h("nv-icon", { key: '4812b31e512bf388fa84f9d35a949de5f9b86d59', name: "circle-check", class: "validation", size: "md" }))), index.h("slot", { key: '06922c63f02470be6c74ee6ba4bf93baabd03e57', name: "after-input" })), (this.description ||
|
|
112
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '960bcb53a55aed3e1b8cd1b193ad26f5c6b151fd', class: "description" }, index.h("slot", { key: '07c09b8543e9b91928821a100869943de94a65a7', name: "description" }, this.description))), (this.errorDescription ||
|
|
113
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '456d00a47f01f70938d99faa774da1a9e51b036d', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '590aef8c37efd2fa472c9b7b92fd82d29c4e6d39', name: "error-description" }, this.errorDescription)))));
|
|
114
114
|
}
|
|
115
115
|
static get formAssociated() { return true; }
|
|
116
116
|
get el() { return index.getElement(this); }
|
|
@@ -178,9 +178,9 @@ const NvFieldtextarea = class {
|
|
|
178
178
|
/****************************************************************************/
|
|
179
179
|
//#region RENDER
|
|
180
180
|
render() {
|
|
181
|
-
return (index.h(index.Host, { key: '
|
|
182
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
183
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '
|
|
181
|
+
return (index.h(index.Host, { key: '606902cda67b3f523ab32d8e9c6fd11b6bc0f3a7' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '3167dfd5f17028ad20a82b5646ccfa788a5bbb86', htmlFor: this.inputId }, index.h("slot", { key: 'ae98d87f3e1b7cb2864b6b7e7183d3a37c1a7e14', name: "label" }, this.label))), index.h("div", { key: '8f25bdadd8f94938dc9b6c631b0586fc6bcbc37c', class: "textarea-wrapper" }, index.h("div", { key: '6568df9f332e8bca84445ba596d6eceaaed64b9e', class: "textarea-container", onClick: this.handleTextareaContainerClick }, index.h("textarea", { key: 'fca9ba5bd6925cc1a201625e5785ad451fc8849b', 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.clsx(this.resize === 'none' && 'resize-none', this.resize === 'vertical' && 'resize-y', this.resize === 'horizontal' && 'resize-x', this.resize === 'both' && 'resize') }))), (this.description ||
|
|
182
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: 'c5c8c1999105df446a603a3e02f431ad37de4c5e', class: "description" }, index.h("slot", { key: 'bbcea14c7585e1ff1c995eb4f21cb532a160ed40', name: "description" }, this.description))), (this.errorDescription ||
|
|
183
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '2d43d92b5c9b93faeac45bdcfa142d4dfd70511a', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '33514ea705969b353f11c49ca65090706e6aadf8', name: "error-description" }, this.errorDescription)))));
|
|
184
184
|
}
|
|
185
185
|
static get formAssociated() { return true; }
|
|
186
186
|
get el() { return index.getElement(this); }
|
|
@@ -968,26 +968,26 @@ const NvFieldtime = class {
|
|
|
968
968
|
}, key: `${option}-${index$1}`, onClick: e => this.handleTimeOptionClick(e, type) }, option)))));
|
|
969
969
|
}
|
|
970
970
|
render() {
|
|
971
|
-
return (index.h(index.Host, { key: '
|
|
972
|
-
index.h("input", { key: '
|
|
971
|
+
return (index.h(index.Host, { key: 'fb5bc4740731089bf81ab7b24e57f24f966c5f92', onclick: e => this.handleHostClick(e) }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'd9f44f4ab94a13a620df743979d95b1f59572bfe', htmlFor: this.inputId }, index.h("slot", { key: 'fbc8176ea3443511764b2993939d1110fd932a5a', name: "label" }, this.label))), index.h("nv-popover", { key: 'ea376ec38db428db158c998e8963e27048ef03b0', ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, index.h("div", { key: 'fa825918cea4a64db76324f953645f6db7cb81b9', class: "input-wrapper", slot: "trigger" }, index.h("slot", { key: '37d7fd2eae40e4f47e9b626c226d060cf5e350e2', name: "before-input" }), index.h("div", { key: '6b73d8c9598bfaf470b5c5a455db0b08397cc8c8', class: "input-container" }, index.h("slot", { key: '88f20151d7ccc1e3ad6f6aba4b5926cccc22c19c', name: "leading-input" }), string_utils.startsWithIgnoreCase(this.format, 'HH') && [
|
|
972
|
+
index.h("input", { key: '292ee8c62fd248b28fb46275ba06846d69b3b602', ref: el => (this.inputElements[constants.TimeType.Hours] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.hours, onInput: e => this.handleInputChange(e, constants.TimeType.Hours), placeholder: this.format.includes('hh') ? 'hh' : 'HH', inputMode: "numeric", onFocus: () => this.handleFocus(constants.TimeType.Hours), name: this.name
|
|
973
973
|
? `${constants.TimeType.Hours}-${this.name}`
|
|
974
974
|
: constants.TimeType.Hours, id: this.inputId, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
|
|
975
975
|
], this.format.includes('mm') && [
|
|
976
|
-
index.h("span", { key: '
|
|
977
|
-
index.h("input", { key: '
|
|
976
|
+
index.h("span", { key: 'c7de2283771d60e1e9f756257e34da0eefcf27f3' }, ":"),
|
|
977
|
+
index.h("input", { key: '521fad8cc60c9ced2ba634441b789fba15340ae7', ref: el => (this.inputElements[constants.TimeType.Minutes] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.minutes, onInput: e => this.handleInputChange(e, constants.TimeType.Minutes), placeholder: "mm", inputMode: "numeric", onFocus: () => this.handleFocus(constants.TimeType.Minutes), name: this.name
|
|
978
978
|
? `${constants.TimeType.Minutes}-${this.name}`
|
|
979
979
|
: constants.TimeType.Minutes, id: `${this.inputId}-minutes`, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
|
|
980
980
|
], this.format.includes('ss') && [
|
|
981
|
-
index.h("span", { key: '
|
|
982
|
-
index.h("input", { key: '
|
|
981
|
+
index.h("span", { key: 'ceef993e3efdc2fa01d466033522e09ee78683b1' }, ":"),
|
|
982
|
+
index.h("input", { key: '9c51f0fcecb86a913e9ae4cd3c5bcfbf34ac4ab8', ref: el => (this.inputElements[constants.TimeType.Seconds] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.seconds, onInput: e => this.handleInputChange(e, constants.TimeType.Seconds), placeholder: "ss", inputMode: "numeric", onFocus: () => this.handleFocus(constants.TimeType.Seconds), name: this.name
|
|
983
983
|
? `${constants.TimeType.Seconds}-${this.name}`
|
|
984
984
|
: constants.TimeType.Seconds, id: `${this.inputId}-seconds`, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
|
|
985
|
-
], index.h("nv-iconbutton", { key: '
|
|
985
|
+
], index.h("nv-iconbutton", { key: '7a5516b7d91dc99f6963ee9daacee9305b16dfb0', name: this.open ? 'chevron-top' : 'chevron-down', size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide time picker' : 'Show time picker', "aria-pressed": this.open.toString(), onClick: () => this.HandleDropdownIconClick() }), this.error && (index.h("nv-icon", { key: 'a9a9a02e312caf25a52b91e1d4db6b6ee9d850d6', name: "alert-circle", class: "validation", size: "sm" })), this.success && (index.h("nv-icon", { key: '93a69f343771dbdb8c6bd694ea9f5ddeeba39801', name: "circle-check", class: "validation", size: "sm" }))), index.h("slot", { key: '678d9af754b860ac99a50d70cb9b975e79f164c9', name: "after-input" })), index.h("div", { key: '2bd255e97d8b34b66fa0af2f209d5175e67b62a3', class: "time-dropdown", slot: "content" }, index.h("div", { key: '017b58a9a7ccb44918a408fb680fa1c18d8f5672', class: "time-columns" }, string_utils.startsWithIgnoreCase(this.format, 'HH') &&
|
|
986
986
|
this.RenderTimeOptionsColumn(constants.TimeType.Hours), this.format.includes('mm') &&
|
|
987
987
|
this.RenderTimeOptionsColumn(constants.TimeType.Minutes), this.format.includes('ss') &&
|
|
988
988
|
this.RenderTimeOptionsColumn(constants.TimeType.Seconds)))), (this.description ||
|
|
989
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
990
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '
|
|
989
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '35f5fb47bfeb9cde2c3551df391cf52ccaf10c72', class: "description" }, index.h("slot", { key: 'b450124765db5b2337f03a5f68c4a9466c80ca85', name: "description" }, this.description))), (this.errorDescription ||
|
|
990
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '87d441f595f7ba8be04ca749235ec3918e9a80b0', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '35717f533b4a4c310f4fb805c3989398f340b8b1', name: "error-description" }, this.errorDescription)))));
|
|
991
991
|
}
|
|
992
992
|
static get formAssociated() { return true; }
|
|
993
993
|
get el() { return index.getElement(this); }
|
|
@@ -58,7 +58,7 @@ const NvIcon = class {
|
|
|
58
58
|
/****************************************************************************/
|
|
59
59
|
//#region RENDER
|
|
60
60
|
render() {
|
|
61
|
-
return (index.h(index.Host, { key: '
|
|
61
|
+
return (index.h(index.Host, { key: '5d5988e7c0f49781b57b86da6e46e38eeac5ddae', class: clsx.clsx(this.color && `${this.color}`), role: "img", "aria-label": `${this.name}-icon` }, index.h("svg", { key: 'ab4007e92d6a13245293dbbb7dc746ab21cdbe33', 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: 'c9cb4fea1695e81c4e9e775c217dfb9ac3b7c9ec', href: `#${this.name}` }))));
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
NvIcon.style = NvIconStyle0;
|
|
@@ -124,7 +124,7 @@ const NvIconbutton = class {
|
|
|
124
124
|
/****************************************************************************/
|
|
125
125
|
//#region RENDER
|
|
126
126
|
render() {
|
|
127
|
-
return (index.h(index.Host, { key: '
|
|
127
|
+
return (index.h(index.Host, { key: 'f678bd976942aa35ae36c536fdd86cd65a43263a', role: "button", type: this.type, tabindex: "0", disabled: this.disabled ? true : undefined, class: clsx.clsx('root', `size-${this.size}`, `emphasis-${this.emphasis}`, this.loading && 'loading', `shape-${this.shape}`), onClick: this.handleClick }, this.loading && index.h("nv-loader", { key: 'b874de8701de163c1f4235c2034a13da30279191', size: this.size }), !this.loading && index.h("nv-icon", { key: '222ccc93e3af3dcec81308b3b90ca724ecdfa2fb', name: this.name, size: this.size }), index.h("slot", { key: 'c7a257f7715a9320ffe46e09b59a2d570d1f052c' })));
|
|
128
128
|
}
|
|
129
129
|
static get formAssociated() { return true; }
|
|
130
130
|
get el() { return index.getElement(this); }
|
|
@@ -155,7 +155,7 @@ const NvLoader = class {
|
|
|
155
155
|
//#region RENDER
|
|
156
156
|
/* <slot> empty to force rendering change */
|
|
157
157
|
render() {
|
|
158
|
-
return (index.h(index.Host, { key: '
|
|
158
|
+
return (index.h(index.Host, { key: 'f3094e46eb7072534f497694d3c28030f0118acc', class: clsx.clsx(this.size && `size-${this.size}`, this.color && `color-${this.color}`) }));
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
161
|
NvLoader.style = NvLoaderStyle0;
|
|
@@ -35,25 +35,23 @@ const NvMenu = class {
|
|
|
35
35
|
* position on the axis to fit on the screen, so users can always see it.
|
|
36
36
|
*/
|
|
37
37
|
this.placement = 'bottom-end';
|
|
38
|
+
//#endregion LIFECYCLE
|
|
39
|
+
/****************************************************************************/
|
|
40
|
+
//#region RENDER
|
|
38
41
|
/**
|
|
39
|
-
*
|
|
42
|
+
* Generates menu items from the `items` property.
|
|
43
|
+
* @param {MenuItem[]} items - The items to display in the menu.
|
|
44
|
+
* @returns {HTMLElement[]} The rendered items.
|
|
40
45
|
*/
|
|
41
|
-
this.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.parsedItems = JSON.parse(newValue);
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
console.error('Error parsing menu items:', error);
|
|
54
|
-
this.parsedItems = [];
|
|
55
|
-
}
|
|
56
|
-
}
|
|
46
|
+
this.renderMenuItems = () => {
|
|
47
|
+
return this.items.map(item => {
|
|
48
|
+
var _a;
|
|
49
|
+
if (item.hasSubmenu && ((_a = item.submenuItems) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
50
|
+
return (index.h("nv-menu", { nested: true, placement: "right-start", items: item.submenuItems }, index.h("nv-menuitem", { slot: "trigger", hasSubmenu: true, disabled: item.disabled, icon: item.icon, shortcut: item.shortcut, id: item.value, name: item.label, label: item.label })));
|
|
51
|
+
}
|
|
52
|
+
return (index.h("nv-menuitem", { disabled: item.disabled, icon: item.icon, shortcut: item.shortcut, id: item.value, name: item.label, label: item.label }));
|
|
53
|
+
});
|
|
54
|
+
};
|
|
57
55
|
}
|
|
58
56
|
//#endregion PROPERTIES
|
|
59
57
|
/****************************************************************************/
|
|
@@ -193,35 +191,11 @@ const NvMenu = class {
|
|
|
193
191
|
this.triggerElement = Array.from(this.el.children).find(child => {
|
|
194
192
|
return child.getAttribute('slot') === 'trigger';
|
|
195
193
|
});
|
|
196
|
-
// If the items attribute is provided, parse its value.
|
|
197
|
-
if (this.items) {
|
|
198
|
-
this.handleItemsChange(this.items);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
//#endregion LIFECYCLE
|
|
202
|
-
/****************************************************************************/
|
|
203
|
-
//#region RENDER
|
|
204
|
-
/**
|
|
205
|
-
* Generates menu items from the `items` property.
|
|
206
|
-
* @param {MenuItem[]} items - The items to display in the menu.
|
|
207
|
-
* @returns {HTMLElement[]} The rendered items.
|
|
208
|
-
*/
|
|
209
|
-
renderMenuItems(items) {
|
|
210
|
-
return items.map(item => {
|
|
211
|
-
var _a;
|
|
212
|
-
if (item.hasSubmenu && ((_a = item.submenuItems) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
213
|
-
return (index.h("nv-menu", { nested: true, placement: "right-start", items: JSON.stringify(item.submenuItems) }, index.h("nv-menuitem", { slot: "trigger", "has-submenu": true, disabled: item.disabled, icon: item.icon, shortcut: item.shortcut, id: item.value, name: item.label, label: item.label })));
|
|
214
|
-
}
|
|
215
|
-
return (index.h("nv-menuitem", { disabled: item.disabled, icon: item.icon, shortcut: item.shortcut, id: item.value, name: item.label, label: item.label }));
|
|
216
|
-
});
|
|
217
194
|
}
|
|
218
195
|
render() {
|
|
219
|
-
return (index.h(index.Host, { key: '
|
|
196
|
+
return (index.h(index.Host, { key: 'b66fd4f51c7f754d2d49265fe6175cc1a2c0b03a' }, index.h("slot", { key: 'acd3dc4ad3ed94a4bcbef735049e59bf37a8f67d', name: "trigger" }), index.h("nv-popover", { key: '28218c78f3fa21a9dcfd5ea13d3416eda11efc49', ref: el => (this.popoverElement = el), triggerMode: "click", triggerElement: this.triggerElement, placement: this.placement, nested: this.nested, open: this.open }, this.items ? (index.h("ul", { slot: "content" }, this.renderMenuItems())) : (index.h("slot", { name: "content" })))));
|
|
220
197
|
}
|
|
221
198
|
get el() { return index.getElement(this); }
|
|
222
|
-
static get watchers() { return {
|
|
223
|
-
"items": ["handleItemsChange"]
|
|
224
|
-
}; }
|
|
225
199
|
};
|
|
226
200
|
NvMenu.style = NvMenuStyle0;
|
|
227
201
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"nv-menu.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,SAAS,GAAG,k2DAAk2D,CAAC;AACr3D,qBAAe,SAAS;;MC8DX,MAAM;IALnB;;;QASU,sBAAi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QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAgB,EAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,EAAE,EAAE,IAAI,CAAC,KAAK,EACd,IAAI,EAAE,IAAI,CAAC,KAAK,EAChB,KAAK,EAAE,IAAI,CAAC,KAAK,GACJ,EACf;SACH,CAAC,CAAC;KACJ;IAED,MAAM;QACJ,QACEA,QAACC,UAAI,uDACHD,mEAAM,IAAI,EAAC,SAAS,GAAQ,EAC5BA,yEACE,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC,EACrC,WAAW,EAAC,OAAO,EACnB,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAE,IAAI,CAAC,IAAI,IAEd,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,IAC1BA,gBAAI,IAAI,EAAC,SAAS,IAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,CAAM,KAEhEA,kBAAM,IAAI,EAAC,SAAS,GAAQ,CAC7B,CACU,CACR,EACP;KACH;;;;;;;;;;","names":["h","Host"],"sources":["src/components/nv-menu/nv-menu.scss?tag=nv-menu","src/components/nv-menu/nv-menu.tsx"],"sourcesContent":["@use \"../nv-menuitem/nv-menuitem\" as nv-menuitem;\n\n@mixin root-styles() {\n display: inline-block;\n position: relative;\n\n &:has([fluid]:not([fluid=\"false\"])) {\n display: block;\n }\n}\n\n@mixin content-styles() {\n padding: var(--menu-contextual-padding-y)\n var(--menu-contextual-padding-x);\n border-radius: var(--menu-contextual-radius);\n gap: var(--menu-contextual-gap-y);\n background-color: var(--components-menu-contextual-background);\n border-color: var(--components-menu-contextual-border);\n display: flex;\n flex-direction: column;\n}\n\n@mixin separator-styles() {\n display: block;\n margin: var(--menu-contextual-divider-padding-top)\n var(--menu-contextual-divider-padding-x)\n var(--menu-contextual-divider-padding-bottom)\n var(--menu-contextual-divider-padding-x) ;\n}\n\nnv-menu {\n @include root-styles();\n\n nv-popover {\n display: unset;\n\n [data-scope=popover]{\n background-color: transparent !important;\n padding: 0 !important;\n }\n }\n\n [slot=\"content\"] {\n @include content-styles();\n }\n\n nv-menu[open]:not([open=\"false\"]) {\n > nv-menuitem {\n @include nv-menuitem.focused-styles();\n }\n }\n\n hr {\n @include separator-styles();\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n Listen,\n Event,\n EventEmitter,\n Method,\n State,\n Watch,\n} from '@stencil/core';\nimport type { Placement } from '@floating-ui/dom';\nimport { IconName } from '../nv-icon/nv-icons';\n\n/**\n * Interface to define the structure of a menu item\n */\ninterface MenuItem {\n /**\n * The label of the menu item.\n */\n label: string;\n /**\n * The value of the menu item.\n */\n value?: string;\n /**\n * Whether the menu item is disabled.\n */\n disabled?: boolean;\n /**\n * Whether the menu item has a submenu.\n */\n hasSubmenu?: boolean;\n /**\n * The icon of the menu item.\n */\n icon?: string;\n /**\n * The shortcut of the menu item.\n */\n shortcut?: string;\n /**\n * Whether the menu item is nested.\n */\n nested?: boolean;\n /**\n * The submenu items of the menu item.\n */\n submenuItems?: MenuItem[];\n}\n\n/**\n * @slot trigger - The button element that toggles the menu popover\n * @slot content - The content of the menu, should be wrapped in a ul element containing nv-menuitem elements\n */\n@Component({\n tag: 'nv-menu',\n styleUrl: 'nv-menu.scss',\n shadow: false,\n})\nexport class NvMenu {\n @Element() el: HTMLNvMenuElement;\n private triggerElement!: HTMLElement;\n private popoverElement!: HTMLNvPopoverElement;\n private isHandlingKeyDown: boolean = false;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Use this to toggle the initial visibility of the menu, by default the menu\n * is hidden.\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean = false;\n\n /**\n * Use this if the menu is nested inside another menu. This will prevent the\n * parent menu from closing when the child menu is opened.\n */\n @Prop({ reflect: true })\n readonly nested: boolean = false;\n\n /**\n * Use this to disable the menu from closing automatically when a menu item is\n * selected.\n */\n @Prop({ reflect: true })\n readonly disableCloseOnSelect: boolean = false;\n\n /**\n * Decides where the menu shows up next to the button it's linked to (above,\n * below, to the sides). If there isn't enough room, it will adjust its\n * position on the axis to fit on the screen, so users can always see it.\n */\n @Prop({ reflect: true })\n readonly placement: Placement = 'bottom-end';\n\n /**\n * (New feature) Items to display in the menu, provided as a JSON string.\n * Format: [{ label: string, value?: string, disabled?: boolean, hasSubmenu?: boolean, ... }]\n */\n @Prop({ reflect: true })\n readonly items?: string;\n\n /**\n * Parsed items stored in state.\n */\n @State()\n private parsedItems: MenuItem[] = [];\n\n /**\n * Watcher to parse the items when the `items` property changes.\n * @param {string} newValue - The new value of the `items` property.\n */\n @Watch('items')\n handleItemsChange(newValue: string) {\n if (typeof newValue === 'string') {\n try {\n this.parsedItems = JSON.parse(newValue);\n } catch (error) {\n console.error('Error parsing menu items:', error);\n this.parsedItems = [];\n }\n }\n }\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Opens the menu.\n */\n @Method()\n async show() {\n this.open = true;\n }\n\n /**\n * Closes the menu.\n */\n @Method()\n async close() {\n this.open = false;\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted from nv-menuitem elements with the corresponding id and name when\n * selected (via click or keyboard). This event listener can be attached to\n * either the nv-menu or the nv-menuitem element.\n */\n @Event()\n menuitemSelected: EventEmitter<\n HTMLNvMenuitemElementEventMap['menuitemSelected']\n >;\n\n @Listen('menuitemSelected')\n handleMenuItemSelect(\n event: CustomEvent<HTMLNvMenuitemElementEventMap['menuitemSelected']>,\n ) {\n if (this.disableCloseOnSelect) return;\n if (event.detail.hasSubmenu) return;\n this.open = false;\n }\n\n @Listen('keydown', { passive: false })\n handleKeydown(event: KeyboardEvent) {\n // If the menu is not open, check if the trigger is focused\n // and the user presses Enter or ArrowDown, open the menu\n if (!this.open) {\n if (\n (event.key === 'Enter' ||\n event.key === 'ArrowDown' ||\n event.key === ' ') &&\n document.activeElement === this.triggerElement\n ) {\n event.preventDefault();\n this.show();\n // Then, put the focus on the first menuitem\n const firstMenuItem = this.popoverElement.querySelector('nv-menuitem');\n if (firstMenuItem) {\n requestAnimationFrame(() => (firstMenuItem as HTMLElement).focus());\n }\n }\n return;\n }\n\n if (this.isHandlingKeyDown) return;\n this.isHandlingKeyDown = true;\n\n if (\n event.key === 'ArrowDown' ||\n event.key === 'ArrowUp' ||\n event.key === 'ArrowLeft' ||\n event.key === 'ArrowRight' ||\n event.key === 'Escape'\n ) {\n event.preventDefault();\n }\n\n if (event.key === 'Escape' && !this.nested) {\n this.close();\n this.triggerElement.focus();\n this.isHandlingKeyDown = false;\n return;\n }\n\n const menuContent = this.el.querySelector('[slot=\"content\"]');\n const menuItems = (\n Array.from(menuContent.childNodes) as Array<\n HTMLNvMenuitemElement | HTMLNvMenuElement\n >\n ).filter(item => item.matches?.('nv-menuitem, nv-menu'));\n\n let currentIndex = menuItems.indexOf(\n document.activeElement as HTMLNvMenuitemElement,\n );\n if (currentIndex === -1)\n currentIndex = menuItems.indexOf(\n document.activeElement.parentElement as HTMLNvMenuitemElement,\n );\n if (\n currentIndex === -1 &&\n menuItems.find(item => item.matches('nv-menu[open]'))\n ) {\n this.isHandlingKeyDown = false;\n return;\n }\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n menuItems.forEach(item => {\n if (item.matches('nv-menu')) (item as HTMLNvMenuElement).close();\n });\n }\n\n if (event.key === 'ArrowDown') {\n let nextIndex = (currentIndex + 1) % menuItems.length;\n while (menuItems[nextIndex].matches('nv-menuitem[disabled]')) {\n nextIndex = (nextIndex + 1) % menuItems.length;\n }\n const nextFocusable = menuItems[nextIndex];\n if (nextFocusable.matches('nv-menuitem')) {\n nextFocusable.focus();\n } else if (nextFocusable.matches('nv-menu')) {\n nextFocusable.querySelector('nv-menuitem').focus();\n }\n }\n\n if (event.key === 'ArrowUp') {\n let prevIndex = (currentIndex - 1 + menuItems.length) % menuItems.length;\n while (menuItems[prevIndex].matches('nv-menuitem[disabled]')) {\n prevIndex = (prevIndex - 1 + menuItems.length) % menuItems.length;\n }\n const prevFocusable = menuItems[prevIndex];\n if (prevFocusable.matches('nv-menuitem')) {\n prevFocusable.focus();\n } else if (prevFocusable.matches('nv-menu')) {\n prevFocusable.querySelector('nv-menuitem').focus();\n }\n }\n\n if (event.key === 'ArrowRight') {\n const submenu = menuItems[currentIndex];\n if (!submenu.matches('nv-menu')) {\n this.isHandlingKeyDown = false;\n return;\n }\n (submenu as HTMLNvMenuElement).show();\n }\n\n if (event.key === 'ArrowLeft' && this.nested) {\n if (menuItems.find(item => item.matches('nv-menu[open]'))) {\n this.isHandlingKeyDown = false;\n return;\n }\n this.close();\n this.triggerElement.focus();\n }\n\n this.isHandlingKeyDown = false;\n }\n\n @Listen('openChanged')\n handleOpenChanged(event: CustomEvent<boolean>) {\n if (event.target === this.el.querySelector('nv-popover')) {\n this.open = event.detail;\n }\n const triggerHasFocus = this.triggerElement === document.activeElement;\n const triggerHasFocusVisible =\n this.triggerElement.matches(':focus-visible');\n if (triggerHasFocus && triggerHasFocusVisible) this.focusFirstItem();\n }\n\n private focusFirstItem() {\n const firstButton = this.popoverElement.querySelector('nv-menuitem');\n if (firstButton) {\n requestAnimationFrame(() => firstButton.focus());\n }\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n this.triggerElement = Array.from(this.el.children).find(child => {\n return child.getAttribute('slot') === 'trigger';\n }) as HTMLElement;\n\n // If the items attribute is provided, parse its value.\n if (this.items) {\n this.handleItemsChange(this.items);\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n /**\n * Generates menu items from the `items` property.\n * @param {MenuItem[]} items - The items to display in the menu.\n * @returns {HTMLElement[]} The rendered items.\n */\n private renderMenuItems(items: MenuItem[]) {\n return items.map(item => {\n if (item.hasSubmenu && item.submenuItems?.length > 0) {\n return (\n <nv-menu\n nested\n placement=\"right-start\"\n items={JSON.stringify(item.submenuItems)}\n >\n <nv-menuitem\n slot=\"trigger\"\n has-submenu\n disabled={item.disabled}\n icon={item.icon as IconName}\n shortcut={item.shortcut}\n id={item.value}\n name={item.label}\n label={item.label}\n ></nv-menuitem>\n </nv-menu>\n );\n }\n return (\n <nv-menuitem\n disabled={item.disabled}\n icon={item.icon as IconName}\n shortcut={item.shortcut}\n id={item.value}\n name={item.label}\n label={item.label}\n ></nv-menuitem>\n );\n });\n }\n\n render() {\n return (\n <Host>\n <slot name=\"trigger\"></slot>\n <nv-popover\n ref={el => (this.popoverElement = el)}\n triggerMode=\"click\"\n triggerElement={this.triggerElement}\n placement={this.placement}\n nested={this.nested}\n open={this.open}\n >\n {this.parsedItems.length > 0 ? (\n <ul slot=\"content\">{this.renderMenuItems(this.parsedItems)}</ul>\n ) : (\n <slot name=\"content\"></slot>\n )}\n </nv-popover>\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
|
|
1
|
+
{"file":"nv-menu.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,SAAS,GAAG,k2DAAk2D,CAAC;AACr3D,qBAAe,SAAS;;MCsBX,MAAM;IALnB;;;QASU,sBAAiB,GAAY,KAAK,CAAC;;;;;;;QAU3C,SAAI,GAAY,KAAK,CAAC;;;;;QAOb,WAAM,GAAY,KAAK,CAAC;;;;;QAOxB,yBAAoB,GAAY,KAAK,CAAC;;;;;;QAQtC,cAAS,GAAc,YAAY,CAAC;;;;;;;;;QAyPrC,oBAAe,GAAG;YACxB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI;;gBACxB,IAAI,IAAI,CAAC,UAAU,IAAI,CAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,MAAM,IAAG,CAAC,EAAE;oBACpD,QACEA,qBAAS,MAAM,QAAC,SAAS,EAAC,aAAa,EAAC,KAAK,EAAE,IAAI,CAAC,YAAY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AM,sBAAsB,GAC1B,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAChD,IAAI,eAAe,IAAI,sBAAsB;YAAE,IAAI,CAAC,cAAc,EAAE,CAAC;KACtE;IAEO,cAAc;QACpB,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QACrE,IAAI,WAAW,EAAE;YACf,qBAAqB,CAAC,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC;SAClD;KACF;;;;IAMD,iBAAiB;QACf,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK;YAC3D,OAAO,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC;SACjD,CAAgB,CAAC;KACnB;IA0CD,MAAM;QACJ,QACEA,QAACC,UAAI,uDACHD,mEAAM,IAAI,EAAC,SAAS,GAAQ,EAC5BA,yEACE,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC,EACrC,WAAW,EAAC,OAAO,EACnB,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAE,IAAI,CAAC,IAAI,IAEd,IAAI,CAAC,KAAK,IACTA,gBAAI,IAAI,EAAC,SAAS,IAAE,IAAI,CAAC,eAAe,EAAE,CAAM,KAEhDA,kBAAM,IAAI,EAAC,SAAS,GAAQ,CAC7B,CACU,CACR,EACP;KACH;;;;;;;","names":["h","Host"],"sources":["src/components/nv-menu/nv-menu.scss?tag=nv-menu","src/components/nv-menu/nv-menu.tsx"],"sourcesContent":["@use \"../nv-menuitem/nv-menuitem\" as nv-menuitem;\n\n@mixin root-styles() {\n display: inline-block;\n position: relative;\n\n &:has([fluid]:not([fluid=\"false\"])) {\n display: block;\n }\n}\n\n@mixin content-styles() {\n padding: var(--menu-contextual-padding-y)\n var(--menu-contextual-padding-x);\n border-radius: var(--menu-contextual-radius);\n gap: var(--menu-contextual-gap-y);\n background-color: var(--components-menu-contextual-background);\n border-color: var(--components-menu-contextual-border);\n display: flex;\n flex-direction: column;\n}\n\n@mixin separator-styles() {\n display: block;\n margin: var(--menu-contextual-divider-padding-top)\n var(--menu-contextual-divider-padding-x)\n var(--menu-contextual-divider-padding-bottom)\n var(--menu-contextual-divider-padding-x) ;\n}\n\nnv-menu {\n @include root-styles();\n\n nv-popover {\n display: unset;\n\n [data-scope=popover]{\n background-color: transparent !important;\n padding: 0 !important;\n }\n }\n\n [slot=\"content\"] {\n @include content-styles();\n }\n\n nv-menu[open]:not([open=\"false\"]) {\n > nv-menuitem {\n @include nv-menuitem.focused-styles();\n }\n }\n\n hr {\n @include separator-styles();\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n Listen,\n Event,\n EventEmitter,\n Method,\n} from '@stencil/core';\nimport type { Placement } from '@floating-ui/dom';\nimport { IconName } from '../nv-icon/nv-icons';\n\n/**\n * @slot trigger - The button element that toggles the menu popover\n * @slot content - The content of the menu, should be wrapped in a ul element containing nv-menuitem elements\n */\n@Component({\n tag: 'nv-menu',\n styleUrl: 'nv-menu.scss',\n shadow: false,\n})\nexport class NvMenu {\n @Element() el: HTMLNvMenuElement;\n private triggerElement!: HTMLElement;\n private popoverElement!: HTMLNvPopoverElement;\n private isHandlingKeyDown: boolean = false;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Use this to toggle the initial visibility of the menu, by default the menu\n * is hidden.\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean = false;\n\n /**\n * Use this if the menu is nested inside another menu. This will prevent the\n * parent menu from closing when the child menu is opened.\n */\n @Prop({ reflect: true })\n readonly nested: boolean = false;\n\n /**\n * Use this to disable the menu from closing automatically when a menu item is\n * selected.\n */\n @Prop({ reflect: true })\n readonly disableCloseOnSelect: boolean = false;\n\n /**\n * Decides where the menu shows up next to the button it's linked to (above,\n * below, to the sides). If there isn't enough room, it will adjust its\n * position on the axis to fit on the screen, so users can always see it.\n */\n @Prop({ reflect: true })\n readonly placement: Placement = 'bottom-end';\n\n /**\n * List of items used to automatically generate dropdown items. This\n * provides an alternative to using the slot manually.\n *\n * @example\n * items = [{\n * \"label\": \"Option 1\",\n * \"value\": \"option1\",\n * },\n * {\n * \"label\": \"Option 2\",\n * \"value\": \"option2\",\n * }]\n */\n @Prop({ reflect: true })\n readonly items?: {\n /**\n * The label of the menu item.\n */\n label: string;\n /**\n * The value of the menu item.\n */\n value?: string;\n /**\n * Whether the menu item is disabled.\n */\n disabled?: boolean;\n /**\n * Whether the menu item has a submenu.\n */\n hasSubmenu?: boolean;\n /**\n * The icon of the menu item.\n */\n icon?: string;\n /**\n * The shortcut of the menu item.\n */\n shortcut?: string;\n /**\n * Whether the menu item is nested.\n */\n nested?: boolean;\n /**\n * The submenu items of the menu item.\n */\n submenuItems?: InstanceType<typeof NvMenu>['items'];\n }[];\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Opens the menu.\n */\n @Method()\n async show() {\n this.open = true;\n }\n\n /**\n * Closes the menu.\n */\n @Method()\n async close() {\n this.open = false;\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted from nv-menuitem elements with the corresponding id and name when\n * selected (via click or keyboard). This event listener can be attached to\n * either the nv-menu or the nv-menuitem element.\n */\n @Event()\n menuitemSelected: EventEmitter<\n HTMLNvMenuitemElementEventMap['menuitemSelected']\n >;\n\n @Listen('menuitemSelected')\n handleMenuItemSelect(\n event: CustomEvent<HTMLNvMenuitemElementEventMap['menuitemSelected']>,\n ) {\n if (this.disableCloseOnSelect) return;\n if (event.detail.hasSubmenu) return;\n this.open = false;\n }\n\n @Listen('keydown', { passive: false })\n handleKeydown(event: KeyboardEvent) {\n // If the menu is not open, check if the trigger is focused\n // and the user presses Enter or ArrowDown, open the menu\n if (!this.open) {\n if (\n (event.key === 'Enter' ||\n event.key === 'ArrowDown' ||\n event.key === ' ') &&\n document.activeElement === this.triggerElement\n ) {\n event.preventDefault();\n this.show();\n // Then, put the focus on the first menuitem\n const firstMenuItem = this.popoverElement.querySelector('nv-menuitem');\n if (firstMenuItem) {\n requestAnimationFrame(() => (firstMenuItem as HTMLElement).focus());\n }\n }\n return;\n }\n\n if (this.isHandlingKeyDown) return;\n this.isHandlingKeyDown = true;\n\n if (\n event.key === 'ArrowDown' ||\n event.key === 'ArrowUp' ||\n event.key === 'ArrowLeft' ||\n event.key === 'ArrowRight' ||\n event.key === 'Escape'\n ) {\n event.preventDefault();\n }\n\n if (event.key === 'Escape' && !this.nested) {\n this.close();\n this.triggerElement.focus();\n this.isHandlingKeyDown = false;\n return;\n }\n\n const menuContent = this.el.querySelector('[slot=\"content\"]');\n const menuItems = (\n Array.from(menuContent.childNodes) as Array<\n HTMLNvMenuitemElement | HTMLNvMenuElement\n >\n ).filter(item => item.matches?.('nv-menuitem, nv-menu'));\n\n let currentIndex = menuItems.indexOf(\n document.activeElement as HTMLNvMenuitemElement,\n );\n if (currentIndex === -1)\n currentIndex = menuItems.indexOf(\n document.activeElement.parentElement as HTMLNvMenuitemElement,\n );\n if (\n currentIndex === -1 &&\n menuItems.find(item => item.matches('nv-menu[open]'))\n ) {\n this.isHandlingKeyDown = false;\n return;\n }\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n menuItems.forEach(item => {\n if (item.matches('nv-menu')) (item as HTMLNvMenuElement).close();\n });\n }\n\n if (event.key === 'ArrowDown') {\n let nextIndex = (currentIndex + 1) % menuItems.length;\n while (menuItems[nextIndex].matches('nv-menuitem[disabled]')) {\n nextIndex = (nextIndex + 1) % menuItems.length;\n }\n const nextFocusable = menuItems[nextIndex];\n if (nextFocusable.matches('nv-menuitem')) {\n nextFocusable.focus();\n } else if (nextFocusable.matches('nv-menu')) {\n nextFocusable.querySelector('nv-menuitem').focus();\n }\n }\n\n if (event.key === 'ArrowUp') {\n let prevIndex = (currentIndex - 1 + menuItems.length) % menuItems.length;\n while (menuItems[prevIndex].matches('nv-menuitem[disabled]')) {\n prevIndex = (prevIndex - 1 + menuItems.length) % menuItems.length;\n }\n const prevFocusable = menuItems[prevIndex];\n if (prevFocusable.matches('nv-menuitem')) {\n prevFocusable.focus();\n } else if (prevFocusable.matches('nv-menu')) {\n prevFocusable.querySelector('nv-menuitem').focus();\n }\n }\n\n if (event.key === 'ArrowRight') {\n const submenu = menuItems[currentIndex];\n if (!submenu.matches('nv-menu')) {\n this.isHandlingKeyDown = false;\n return;\n }\n (submenu as HTMLNvMenuElement).show();\n }\n\n if (event.key === 'ArrowLeft' && this.nested) {\n if (menuItems.find(item => item.matches('nv-menu[open]'))) {\n this.isHandlingKeyDown = false;\n return;\n }\n this.close();\n this.triggerElement.focus();\n }\n\n this.isHandlingKeyDown = false;\n }\n\n @Listen('openChanged')\n handleOpenChanged(event: CustomEvent<boolean>) {\n if (event.target === this.el.querySelector('nv-popover')) {\n this.open = event.detail;\n }\n const triggerHasFocus = this.triggerElement === document.activeElement;\n const triggerHasFocusVisible =\n this.triggerElement.matches(':focus-visible');\n if (triggerHasFocus && triggerHasFocusVisible) this.focusFirstItem();\n }\n\n private focusFirstItem() {\n const firstButton = this.popoverElement.querySelector('nv-menuitem');\n if (firstButton) {\n requestAnimationFrame(() => firstButton.focus());\n }\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n this.triggerElement = Array.from(this.el.children).find(child => {\n return child.getAttribute('slot') === 'trigger';\n }) as HTMLElement;\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n /**\n * Generates menu items from the `items` property.\n * @param {MenuItem[]} items - The items to display in the menu.\n * @returns {HTMLElement[]} The rendered items.\n */\n private renderMenuItems = () => {\n return this.items.map(item => {\n if (item.hasSubmenu && item.submenuItems?.length > 0) {\n return (\n <nv-menu nested placement=\"right-start\" items={item.submenuItems}>\n <nv-menuitem\n slot=\"trigger\"\n hasSubmenu\n disabled={item.disabled}\n icon={item.icon as IconName}\n shortcut={item.shortcut}\n id={item.value}\n name={item.label}\n label={item.label}\n ></nv-menuitem>\n </nv-menu>\n );\n }\n return (\n <nv-menuitem\n disabled={item.disabled}\n icon={item.icon as IconName}\n shortcut={item.shortcut}\n id={item.value}\n name={item.label}\n label={item.label}\n ></nv-menuitem>\n );\n });\n };\n\n render() {\n return (\n <Host>\n <slot name=\"trigger\"></slot>\n <nv-popover\n ref={el => (this.popoverElement = el)}\n triggerMode=\"click\"\n triggerElement={this.triggerElement}\n placement={this.placement}\n nested={this.nested}\n open={this.open}\n >\n {this.items ? (\n <ul slot=\"content\">{this.renderMenuItems()}</ul>\n ) : (\n <slot name=\"content\"></slot>\n )}\n </nv-popover>\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
|
|
@@ -50,7 +50,7 @@ const NvMenuitem = class {
|
|
|
50
50
|
/****************************************************************************/
|
|
51
51
|
//#region RENDER
|
|
52
52
|
render() {
|
|
53
|
-
return (index.h(index.Host, { key: '
|
|
53
|
+
return (index.h(index.Host, { key: 'd736bc00759cb97fe52d2d6dc091667057a5585c', role: "menuitem", tabindex: this.disabled ? '-1' : '0' }, this.icon && index.h("nv-icon", { key: 'cf29c75feedcb61d16d33433f834751c821a4256', name: this.icon }), index.h("slot", { key: '0ebe8b2faac9981023c224e3c5cd4f131e088c0e' }), this.label && index.h("span", { key: 'd2659aceb0ecc1cad794ae16d15432379677012c', "data-scope": "text" }, this.label), this.shortcut && !this.hasSubmenu && index.h("kbd", { key: '7d7772b6efda6faccafc425772c905d4aabd2ef5' }, this.shortcut), this.hasSubmenu && index.h("nv-icon", { key: 'c756d3ceffc907fa0c37338595a7fd09f8238a7b', name: "chevron-right" })));
|
|
54
54
|
}
|
|
55
55
|
get el() { return index.getElement(this); }
|
|
56
56
|
};
|
|
@@ -2367,7 +2367,7 @@ const NvPopover = class {
|
|
|
2367
2367
|
/****************************************************************************/
|
|
2368
2368
|
//#region RENDER
|
|
2369
2369
|
render() {
|
|
2370
|
-
return (index.h(index.Host, { key: '
|
|
2370
|
+
return (index.h(index.Host, { key: '830051c35f7e10dfa4e31d401663bd5727ac988f' }, index.h("slot", { key: 'a49852a712bf6ab9c8557035ca4618d007939f03', name: "trigger" }), index.h("div", { key: '6d9cd4bd873cb92b1716a8ea88a3877a029cbe9c', "data-scope": "popover", hidden: true, ref: el => (this.popoverElement = el) }, this.hasArrow && (index.h("div", { key: 'f935c9248b602aa1c39e7d28c5503a24067fb744', "data-scope": "arrow", ref: el => (this.arrowElement = el) })), index.h("slot", { key: '6b682de05037b2d3b60c9139c448620fab963ea1', name: "content" }))));
|
|
2371
2371
|
}
|
|
2372
2372
|
get el() { return index.getElement(this); }
|
|
2373
2373
|
static get watchers() { return {
|
|
@@ -14,7 +14,7 @@ const NvRow = class {
|
|
|
14
14
|
/****************************************************************************/
|
|
15
15
|
//#region RENDER
|
|
16
16
|
render() {
|
|
17
|
-
return (index.h(index.Host, { key: '
|
|
17
|
+
return (index.h(index.Host, { key: '7daaa109808165553e69707c72550f284e087011' }, index.h("slot", { key: 'a00fd8c81352b485d8508f9bd68af4dd81d959e1' })));
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
NvRow.style = NvRowStyle0;
|
|
@@ -23,7 +23,7 @@ const NvStack = class {
|
|
|
23
23
|
/****************************************************************************/
|
|
24
24
|
//#region RENDER
|
|
25
25
|
render() {
|
|
26
|
-
return (index.h(index.Host, { key: '
|
|
26
|
+
return (index.h(index.Host, { key: '02e184fbc9e9ddd4b02b107baf093047fa3697b0', class: clsx.clsx(this.fill && 'nv-stack-fill', this.flex && 'nv-stack-flex', this.full && 'w-full', this.gutter && !this.vertical && `gap-x-${this.gutter}`, this.gutter && this.vertical && `gap-y-${this.gutter}`, this.vertical && 'nv-stack-vertical') }, index.h("slot", { key: '1a501fcc419f97f2714be822120072b49590e5ea' })));
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
NvStack.style = NvStackStyle0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"nv-stack.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,UAAU,GAAG,s8BAAs8B,CAAC;AAC19B,sBAAe,UAAU;;MCWZ,OAAO;IALpB;;;;;;;;QAcW,WAAM,GAAW,CAAC,CAAC;KAsD7B;;;;IAlBC,MAAM;QACJ,QACEA,QAACC,UAAI,qDACH,KAAK,EAAEC,SAAI,CACT,IAAI,CAAC,IAAI,IAAI,eAAe,EAC5B,IAAI,CAAC,IAAI,IAAI,eAAe,EAC5B,IAAI,CAAC,IAAI,IAAI,QAAQ,EACrB,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,
|
|
1
|
+
{"file":"nv-stack.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,UAAU,GAAG,s8BAAs8B,CAAC;AAC19B,sBAAe,UAAU;;MCWZ,OAAO;IALpB;;;;;;;;QAcW,WAAM,GAAW,CAAC,CAAC;KAsD7B;;;;IAlBC,MAAM;QACJ,QACEA,QAACC,UAAI,qDACH,KAAK,EAAEC,SAAI,CACT,IAAI,CAAC,IAAI,IAAI,eAAe,EAC5B,IAAI,CAAC,IAAI,IAAI,eAAe,EAC5B,IAAI,CAAC,IAAI,IAAI,QAAQ,EACrB,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,SAAS,IAAI,CAAC,MAAM,EAAE,EACvD,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,IAAI,SAAS,IAAI,CAAC,MAAM,EAAE,EACtD,IAAI,CAAC,QAAQ,IAAI,mBAAmB,CACrC,IAEDF,oEAAa,CACR,EACP;KACH;;;;;;","names":["h","Host","clsx"],"sources":["src/components/nv-stack/nv-stack.scss?tag=nv-stack","src/components/nv-stack/nv-stack.tsx"],"sourcesContent":["nv-stack {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n flex-direction: row;\n\n nv-col {\n display: flex;\n }\n\n &:not(nv-row) {\n flex-wrap: nowrap;\n }\n\n > .nv-stack-item-flex {\n flex-shrink: 1;\n flex-grow: 1;\n }\n\n > .nv-stack-item-lead {\n margin-right: auto;\n }\n\n > .nv-stack-item-lead + * {\n margin-left: 0;\n }\n\n > .nv-stack-item-center {\n margin-right: auto;\n margin-left: auto;\n }\n\n > .nv-stack-item-tail {\n margin-left: auto;\n }\n\n > .nv-stack-nowrap {\n white-space: nowrap;\n }\n\n // Vertical\n &.nv-stack-vertical {\n align-items: stretch;\n flex-direction: column;\n\n > .nv-stack-item-lead {\n margin-right: 0;\n margin-bottom: auto;\n }\n\n > .nv-stack-item-lead + * {\n margin-top: 0;\n }\n\n > .nv-stack-item-tail {\n margin-left: 0;\n margin-top: auto;\n }\n\n > .nv-stack-item-center {\n margin: auto 0;\n }\n }\n\n &.nv-stack-flex {\n > * {\n flex-shrink: 1;\n flex-grow: 1;\n }\n }\n\n &.nv-stack-fill {\n > * {\n height: 100%;\n }\n\n &.nv-stack-vertical {\n > * {\n height: auto;\n width: 100%;\n }\n }\n }\n}","import { Component, Host, Prop, h } from '@stencil/core';\nimport clsx from 'clsx';\n\n/**\n * @deprecated Please use tailwind classes instead\n * @slot default - Content of the stack\n */\n@Component({\n tag: 'nv-stack',\n styleUrl: './nv-stack.scss',\n shadow: false,\n})\nexport class NvStack {\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Gutter refers to the space that exists between children components inside\n * the stack container.\n */\n @Prop({ reflect: true })\n readonly gutter: number = 2;\n\n /**\n * Fill will force the children to fill the stack depending of the direction\n * of the stack. In horizontal position, the children take the height of the\n * stack. In vertical position, the children take the width of the stack.\n */\n @Prop({ reflect: true })\n readonly fill: boolean;\n\n /**\n * Flex will force the children to share the stack between the children\n * depending of the direction of the stack. In horizontal position, the\n * children width will share the width of the stack. In vertical position,\n * the children height will share the height of the stack.\n */\n @Prop({ reflect: true })\n readonly flex: boolean;\n\n /**\n * Full set the width of the stack to 100%.\n * (same effect as WFull props)\n */\n @Prop({ reflect: true })\n readonly full: boolean;\n\n /**\n * Display the element of the stack vertically.\n */\n @Prop({ reflect: true })\n readonly vertical: boolean;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host\n class={clsx(\n this.fill && 'nv-stack-fill',\n this.flex && 'nv-stack-flex',\n this.full && 'w-full',\n this.gutter && !this.vertical && `gap-x-${this.gutter}`,\n this.gutter && this.vertical && `gap-y-${this.gutter}`,\n this.vertical && 'nv-stack-vertical',\n )}\n >\n <slot></slot>\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
|
|
@@ -315,14 +315,14 @@ const NvTable = class {
|
|
|
315
315
|
const rows = !this.table || this.table === undefined || this.parsedData.length === 0
|
|
316
316
|
? []
|
|
317
317
|
: this.table.data;
|
|
318
|
-
return (index.h(index.Host, { key: '
|
|
318
|
+
return (index.h(index.Host, { key: 'b2962fba4d5a12aa660d0c0f69298c93947ef592' }, index.h("div", { key: 'f60e5c09d57c0ccf5cb9996ca85fcc8792270b85', class: "hidden" }, index.h("slot", { key: '9c4aefff542478535b3f342b1c75f68d717c3bf8' })), index.h("slot", { key: 'bfd0f5406187bcad69d9ed41e2f294314a3572f1', name: "before" }), this.parsedColumns.length === 0 && this.parsedData.length === 0 ? (index.h("div", { class: "no-data" }, this.noColumnsNoDataMessage)) : (index.h("table", { class: "table" }, this.parsedColumns.length > 0 && headerGroups.length > 0 && (index.h("thead", { class: "table-header" }, index.h("tr", null, headerGroups &&
|
|
319
319
|
headerGroups.map(col => {
|
|
320
320
|
return (index.h("th", { key: col.name }, this.renderTemplate(this.headerTemplateCache.get(col.name), {}) || col.header));
|
|
321
321
|
})))), index.h("tbody", { class: "table-body" }, !rows || rows.length === 0 ? (index.h("tr", null, index.h("td", { colSpan: headerGroups.length || 12, class: "no-data" }, this.noDataMessage))) : (rows.map(row => (index.h("tr", { key: JSON.stringify(row) }, headerGroups.map(col => {
|
|
322
322
|
var _a;
|
|
323
323
|
return (index.h("td", null, this.renderTemplate(this.templateCache.get(col.name), row) ||
|
|
324
324
|
((_a = row[col.name]) !== null && _a !== void 0 ? _a : this.fallbackValue)));
|
|
325
|
-
})))))))), index.h("slot", { key: '
|
|
325
|
+
})))))))), index.h("slot", { key: 'e0039c9af9506bc8f2ded8cc81bbd2667ee1f2c1', name: "after" })));
|
|
326
326
|
}
|
|
327
327
|
get el() { return index.getElement(this); }
|
|
328
328
|
static get watchers() { return {
|
|
@@ -66,8 +66,8 @@ const NvToggle = class {
|
|
|
66
66
|
/****************************************************************************/
|
|
67
67
|
//#region RENDER
|
|
68
68
|
render() {
|
|
69
|
-
return (index.h(index.Host, { key: '
|
|
70
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
69
|
+
return (index.h(index.Host, { key: 'e80390a43bab3d55373f6b05db1516210f90c3b5', class: clsx.clsx(this.labelPlacement === 'before' && 'label-placement-before') }, index.h("div", { key: '66156f05cc18bb63a8625cdff72d9c177e4cf86b', class: "input-container" }, index.h("input", { key: 'db0c2c078c23431605befb8dd972a29bfdefb16f', 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: '576df464b48fa11bf8a46bede5f1d822db569636', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'f529b009876a5de5061747f78372a66ccfdcac61', htmlFor: this.inputId, class: clsx.clsx(this.hideLabel && 'visually-hidden') }, index.h("slot", { key: '3ace029242d920b783fe0038f8721b416f54633f', name: "label" }, this.label))), (this.description ||
|
|
70
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '2eeb41266ee52ef40c1600750084fda0fac8dc6f', class: "description" }, index.h("slot", { key: '605541594fcc7f3192766a5395c5a81f42de7728', name: "description" }, this.description))))));
|
|
71
71
|
}
|
|
72
72
|
static get formAssociated() { return true; }
|
|
73
73
|
get el() { return index.getElement(this); }
|
|
@@ -36,7 +36,7 @@ const NvTooltip = class {
|
|
|
36
36
|
/****************************************************************************/
|
|
37
37
|
//#region RENDER
|
|
38
38
|
render() {
|
|
39
|
-
return (index.h(index.Host, { key: '
|
|
39
|
+
return (index.h(index.Host, { key: '8309e08944469fad76997a6dfcb8b434461aa5a3' }, index.h("slot", { key: 'f3da94e2f2f581f7b8c93f4b3e70de67e305508a' }), index.h("nv-popover", { key: 'a28c50f59f9a781afd8a8ab60260d065dcadf96d', triggerMode: "hover", hasArrow: true, placement: this.placement, triggerElement: this.triggerElement, groupName: 'tooltip', enterDelay: this.enterDelay }, index.h("p", { key: '76f63a5f220de640f4eeada8aeba97e9ead73fc9', slot: "content" }, this.message), index.h("slot", { key: 'f55f71b357b23c29b40b9c022a5a1718c4c8c8fb', name: "content" }))));
|
|
40
40
|
}
|
|
41
41
|
get el() { return index.getElement(this); }
|
|
42
42
|
};
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"components/nv-alert/nv-alert.js",
|
|
4
4
|
"components/nv-avatar/nv-avatar.js",
|
|
5
5
|
"components/nv-badge/nv-badge.js",
|
|
6
|
-
"components/nv-base/nv-base.js",
|
|
7
6
|
"components/nv-breadcrumb/nv-breadcrumb.js",
|
|
8
7
|
"components/nv-breadcrumbs/nv-breadcrumbs.js",
|
|
9
8
|
"components/nv-button/nv-button.js",
|
|
@@ -31,7 +31,7 @@ export class NvBreadcrumb {
|
|
|
31
31
|
/****************************************************************************/
|
|
32
32
|
//#region RENDER
|
|
33
33
|
render() {
|
|
34
|
-
return (h(Host, { key: '
|
|
34
|
+
return (h(Host, { key: '50f858dc015ef2cd51f54a08fa53ec88ee42ac41', role: "listitem", "aria-current": this.current ? 'location' : undefined, class: clsx({ 'visually-hidden': this.current }) }, this.type === 'collapsed' ? (h("button", { ref: el => (this.popoverTrigger = el) }, "...")) : (h("slot", null)), this.tooltip && (h("nv-tooltip", { key: '1df40faa4a483d4abf8895def5db87696cf0d08e', message: this.tooltip, triggerElement: this.popoverTrigger, placement: "top" })), this.type === 'collapsed' && (h("nv-popover", { key: '90174908cdcf1b3e1f8a8a82a01cfa505311c930', triggerMode: "click", groupName: "breadcrumbs", triggerElement: this.popoverTrigger }, h("ul", { key: '72282abd41c80bb8edf0c6b19506be32bf5ed688', slot: "content" }, h("slot", { key: '4b9c325c0d27162c4856796f6a7d7c9b39edf993' })))), h("span", { key: '62316fc8efc09067a0a64d4e90e76d57b329ee81', "data-scope": "separator" }, "/")));
|
|
35
35
|
}
|
|
36
36
|
static get is() { return "nv-breadcrumb"; }
|
|
37
37
|
static get originalStyleUrls() {
|
|
@@ -5,7 +5,7 @@ import { Host, h } from "@stencil/core";
|
|
|
5
5
|
export class NvBreadcrumbs {
|
|
6
6
|
//#region RENDER
|
|
7
7
|
render() {
|
|
8
|
-
return (h(Host, { key: '
|
|
8
|
+
return (h(Host, { key: '19ad2bb41f4254a98a571cbadb50ba5ed7d29f62', role: "navigation", "aria-label": "breadcrumbs" }, h("ol", { key: '11b77f0f11c6b1dc2ce5ab3f4f7b23e8ec728b61' }, h("slot", { key: 'c0c683f93c6874aa5f84fb735d13c1b5eabcd951' }))));
|
|
9
9
|
}
|
|
10
10
|
static get is() { return "nv-breadcrumbs"; }
|
|
11
11
|
static get originalStyleUrls() {
|
|
@@ -140,7 +140,7 @@ export class NvButton {
|
|
|
140
140
|
/****************************************************************************/
|
|
141
141
|
//#region RENDER
|
|
142
142
|
render() {
|
|
143
|
-
return (h(Host, { key: '
|
|
143
|
+
return (h(Host, { key: 'f8b20f9052d71f93eaf03f98550a7237225cadf2', role: "button", tabindex: "0", onClick: this.handleButtonClick }, this.loading && (h("nv-loader", { key: 'c1cefa72ee24dad9ce16bbfe1f51e6cec6dc7fbc', size: this.size === ButtonSize.Large ? 'sm' : 'xs' })), h("slot", { key: '36a311494e45ebc23b1133923a676d58e87f3800', name: "leading-icon" }), h("slot", { key: 'f6fea826cda9a09f7152f4e30cc6981c89e73ebe' }), h("slot", { key: 'd59c23ff85ea7efc16c69c5adbeb0e91786f1f68', name: "trailing-icon" })));
|
|
144
144
|
}
|
|
145
145
|
static get is() { return "nv-button"; }
|
|
146
146
|
static get formAssociated() { return true; }
|
|
@@ -4,15 +4,6 @@ const toKebabCase = (str) => str
|
|
|
4
4
|
.replace(/[^a-z0-9]+/g, '')
|
|
5
5
|
.replace(/^-+|-+$/g, '');
|
|
6
6
|
const formats = [
|
|
7
|
-
{
|
|
8
|
-
name: 'ISO 8601',
|
|
9
|
-
dateFormat: 'YYYY-MM-DD[T]HH:mm:ss[Z]',
|
|
10
|
-
singleValue: '2025-03-15T00:00:00Z',
|
|
11
|
-
rangeValue: JSON.stringify({
|
|
12
|
-
start: '2025-03-15T00:00:00Z',
|
|
13
|
-
end: '2025-03-20T00:00:00Z',
|
|
14
|
-
}),
|
|
15
|
-
},
|
|
16
7
|
{
|
|
17
8
|
name: 'YYYY-MM-DD',
|
|
18
9
|
dateFormat: 'YYYY-MM-DD',
|