@nova-design-system/nova-webcomponents 3.0.0 → 3.1.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/{constants-bcd6b2e2.js → constants-8fb8ccc0.js} +14 -1
- package/dist/cjs/constants-8fb8ccc0.js.map +1 -0
- package/dist/cjs/index-9bda5507.js +4 -4
- package/dist/cjs/index.cjs.js +4 -471
- 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-alert.cjs.entry.js +5 -5
- package/dist/cjs/nv-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-avatar.cjs.entry.js +1 -1
- package/dist/cjs/nv-badge_2.cjs.entry.js +17 -8
- package/dist/cjs/nv-badge_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-button.cjs.entry.js +1 -1
- package/dist/cjs/nv-calendar.cjs.entry.js +841 -842
- package/dist/cjs/nv-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-datagrid.cjs.entry.js +376 -39
- package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-dialog.cjs.entry.js +18 -12
- package/dist/cjs/nv-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +1 -1
- package/dist/cjs/nv-fielddate.cjs.entry.js +8 -17
- package/dist/cjs/nv-fielddate.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddaterange.cjs.entry.js +26 -28
- package/dist/cjs/nv-fielddaterange.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +12 -5
- 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 +10 -4
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +8 -4
- package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldpassword.cjs.entry.js +8 -4
- package/dist/cjs/nv-fieldpassword.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldradio.cjs.entry.js +3 -3
- package/dist/cjs/nv-fieldselect.cjs.entry.js +10 -6
- package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtext.cjs.entry.js +8 -4
- package/dist/cjs/nv-fieldtext.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js +8 -4
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtime.cjs.entry.js +15 -12
- package/dist/cjs/nv-fieldtime.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-icon.cjs.entry.js +3 -3
- 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 +3 -1
- 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-table.cjs.entry.js +2 -2
- package/dist/cjs/nv-table.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-toggle.cjs.entry.js +2 -2
- package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
- package/dist/collection/components/nv-alert/nv-alert.css +3 -0
- package/dist/collection/components/nv-alert/nv-alert.js +6 -11
- package/dist/collection/components/nv-alert/nv-alert.js.map +1 -1
- package/dist/collection/components/nv-badge/nv-badge.css +181 -1
- package/dist/collection/components/nv-badge/nv-badge.docs.js +20 -1
- package/dist/collection/components/nv-badge/nv-badge.docs.js.map +1 -1
- package/dist/collection/components/nv-badge/nv-badge.js +39 -15
- package/dist/collection/components/nv-badge/nv-badge.js.map +1 -1
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.docs.js +0 -1
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.docs.js.map +1 -1
- package/dist/collection/components/nv-calendar/nv-calendar.css +19 -0
- package/dist/collection/components/nv-calendar/nv-calendar.docs.js +33 -38
- package/dist/collection/components/nv-calendar/nv-calendar.docs.js.map +1 -1
- package/dist/collection/components/nv-calendar/nv-calendar.js +680 -897
- package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
- package/dist/collection/components/nv-calendar/nv-calendar.utils.js +202 -0
- package/dist/collection/components/nv-calendar/nv-calendar.utils.js.map +1 -0
- package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js +667 -0
- package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js.map +1 -0
- package/dist/collection/components/nv-datagrid/nv-datagrid.css +98 -0
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +103 -5
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.js +391 -56
- package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -1
- package/dist/collection/components/nv-dialog/nv-dialog.css +29 -5
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js +0 -1
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js.map +1 -1
- package/dist/collection/components/nv-dialog/nv-dialog.js +16 -10
- package/dist/collection/components/nv-dialog/nv-dialog.js.map +1 -1
- package/dist/collection/components/nv-fielddate/nv-fielddate.docs.js +16 -8
- package/dist/collection/components/nv-fielddate/nv-fielddate.docs.js.map +1 -1
- package/dist/collection/components/nv-fielddate/nv-fielddate.js +48 -39
- package/dist/collection/components/nv-fielddate/nv-fielddate.js.map +1 -1
- package/dist/collection/components/nv-fielddate/styles/nv-fielddate.css +7 -0
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js +12 -15
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js.map +1 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +75 -64
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -1
- package/dist/collection/components/nv-fielddaterange/styles/nv-fielddaterange.css +13 -11
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js +8 -0
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js.map +1 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +31 -4
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
- package/dist/collection/components/nv-fielddropdown/styles/nv-fielddropdown.css +5 -0
- 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.css +24 -0
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js +8 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +29 -3
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +1 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +5 -0
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js +8 -0
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +27 -3
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js.map +1 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.css +5 -0
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js +8 -0
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +27 -3
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js.map +1 -1
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +3 -3
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +5 -0
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js +8 -0
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +29 -5
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js.map +1 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.css +5 -0
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js +8 -0
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +27 -3
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js.map +1 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.css +23 -0
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js +8 -0
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +27 -3
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js.map +1 -1
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +13 -10
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js.map +1 -1
- package/dist/collection/components/nv-fieldtime/styles/nv-fieldtime.css +19 -2
- package/dist/collection/components/nv-icon/nv-icon.js +1 -1
- package/dist/collection/components/nv-icon/nv-icons.js +3 -470
- 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 -1
- 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-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.js +1 -1
- package/dist/collection/components/nv-table/nv-table.js +8 -11
- package/dist/collection/components/nv-table/nv-table.js.map +1 -1
- package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/templates/navigation.docs.js +0 -1
- package/dist/collection/templates/navigation.docs.js.map +1 -1
- package/dist/collection/utils/constants.js +11 -0
- package/dist/collection/utils/constants.js.map +1 -1
- package/dist/components/index.js +4 -471
- package/dist/components/index.js.map +1 -1
- package/dist/components/nv-alert.js +6 -6
- package/dist/components/nv-alert.js.map +1 -1
- package/dist/components/nv-avatar.js +2 -2
- 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-calendar.js +1 -1
- package/dist/components/nv-datagrid.js +400 -43
- package/dist/components/nv-datagrid.js.map +1 -1
- package/dist/components/nv-dialog.js +22 -16
- package/dist/components/nv-dialog.js.map +1 -1
- package/dist/components/nv-dialogfooter.js +1 -1
- package/dist/components/nv-fielddate.js +18 -26
- package/dist/components/nv-fielddate.js.map +1 -1
- package/dist/components/nv-fielddaterange.js +37 -38
- package/dist/components/nv-fielddaterange.js.map +1 -1
- package/dist/components/nv-fielddropdown.js +18 -10
- 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 +17 -10
- package/dist/components/nv-fieldmultiselect.js.map +1 -1
- package/dist/components/nv-fieldnumber.js +13 -8
- package/dist/components/nv-fieldnumber.js.map +1 -1
- package/dist/components/nv-fieldpassword.js +12 -7
- package/dist/components/nv-fieldpassword.js.map +1 -1
- package/dist/components/nv-fieldradio.js +3 -3
- package/dist/components/nv-fieldselect.js +14 -9
- package/dist/components/nv-fieldselect.js.map +1 -1
- package/dist/components/nv-fieldtext.js +1 -158
- package/dist/components/nv-fieldtext.js.map +1 -1
- package/dist/components/nv-fieldtextarea.js +10 -5
- package/dist/components/nv-fieldtextarea.js.map +1 -1
- package/dist/components/nv-fieldtime.js +19 -16
- 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 +6 -4
- 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-table.js +2 -2
- package/dist/components/nv-table.js.map +1 -1
- package/dist/components/nv-toggle.js +2 -2
- package/dist/components/nv-tooltip.js +1 -1
- package/dist/components/p-0a0f6daf.js +187 -0
- package/dist/components/p-0a0f6daf.js.map +1 -0
- package/dist/components/{p-b7b78e64.js → p-10b37876.js} +2 -2
- package/dist/components/{p-b7b78e64.js.map → p-10b37876.js.map} +1 -1
- package/dist/components/{p-dc3faba3.js → p-10faa938.js} +4 -4
- package/dist/components/{p-dc3faba3.js.map → p-10faa938.js.map} +1 -1
- package/dist/{esm/constants-98e2dcc2.js → components/p-1f505531.js} +15 -2
- package/dist/components/p-1f505531.js.map +1 -0
- package/dist/components/{p-2012b8ba.js → p-35a70c5e.js} +2 -2
- package/dist/components/{p-2012b8ba.js.map → p-35a70c5e.js.map} +1 -1
- package/dist/components/{p-6c364a23.js → p-41c56ddc.js} +5 -5
- package/dist/components/{p-6c364a23.js.map → p-41c56ddc.js.map} +1 -1
- package/dist/components/{p-a30b55fc.js → p-608eb9da.js} +2 -2
- package/dist/components/{p-a30b55fc.js.map → p-608eb9da.js.map} +1 -1
- package/dist/components/p-76646ce9.js +88 -0
- package/dist/components/p-76646ce9.js.map +1 -0
- package/dist/components/p-854c32dc.js +1132 -0
- package/dist/components/p-854c32dc.js.map +1 -0
- package/dist/components/p-9decffb6.js +167 -0
- package/dist/components/p-9decffb6.js.map +1 -0
- package/dist/components/{p-2d9ba7d3.js → p-a2527411.js} +3 -3
- package/dist/components/{p-2d9ba7d3.js.map → p-a2527411.js.map} +1 -1
- package/dist/components/{p-f4d86795.js → p-b48d5a94.js} +3 -3
- package/dist/components/{p-f4d86795.js.map → p-b48d5a94.js.map} +1 -1
- package/dist/components/{p-4d3ec142.js → p-eb632278.js} +3 -3
- package/dist/components/{p-4d3ec142.js.map → p-eb632278.js.map} +1 -1
- package/dist/components/{p-150daf68.js → p-f5cb0a63.js} +2 -2
- package/dist/components/{p-150daf68.js.map → p-f5cb0a63.js.map} +1 -1
- package/dist/components/{p-c14f6b8e.js → p-f76bb0c3.js} +3 -3
- package/dist/components/{p-c14f6b8e.js.map → p-f76bb0c3.js.map} +1 -1
- package/dist/{components/p-8348db09.js → esm/constants-b97e736d.js} +15 -2
- package/dist/esm/constants-b97e736d.js.map +1 -0
- package/dist/esm/index-1fb7a9a6.js +4 -4
- package/dist/esm/index.js +4 -471
- 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-alert.entry.js +5 -5
- package/dist/esm/nv-alert.entry.js.map +1 -1
- package/dist/esm/nv-avatar.entry.js +1 -1
- package/dist/esm/nv-badge_2.entry.js +17 -8
- package/dist/esm/nv-badge_2.entry.js.map +1 -1
- package/dist/esm/nv-button.entry.js +1 -1
- package/dist/esm/nv-calendar.entry.js +841 -842
- package/dist/esm/nv-calendar.entry.js.map +1 -1
- package/dist/esm/nv-datagrid.entry.js +376 -39
- package/dist/esm/nv-datagrid.entry.js.map +1 -1
- package/dist/esm/nv-dialog.entry.js +18 -12
- package/dist/esm/nv-dialog.entry.js.map +1 -1
- package/dist/esm/nv-dialogfooter_2.entry.js +1 -1
- package/dist/esm/nv-fielddate.entry.js +8 -17
- package/dist/esm/nv-fielddate.entry.js.map +1 -1
- package/dist/esm/nv-fielddaterange.entry.js +26 -28
- package/dist/esm/nv-fielddaterange.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdown.entry.js +12 -5
- 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 +10 -4
- package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldnumber.entry.js +8 -4
- package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
- package/dist/esm/nv-fieldpassword.entry.js +8 -4
- package/dist/esm/nv-fieldpassword.entry.js.map +1 -1
- package/dist/esm/nv-fieldradio.entry.js +3 -3
- package/dist/esm/nv-fieldselect.entry.js +10 -6
- package/dist/esm/nv-fieldselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldtext.entry.js +8 -4
- package/dist/esm/nv-fieldtext.entry.js.map +1 -1
- package/dist/esm/nv-fieldtextarea.entry.js +8 -4
- package/dist/esm/nv-fieldtextarea.entry.js.map +1 -1
- package/dist/esm/nv-fieldtime.entry.js +15 -12
- package/dist/esm/nv-fieldtime.entry.js.map +1 -1
- package/dist/esm/nv-icon.entry.js +3 -3
- 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 +3 -1
- 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-table.entry.js +2 -2
- package/dist/esm/nv-table.entry.js.map +1 -1
- package/dist/esm/nv-toggle.entry.js +2 -2
- 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.css +1 -1
- package/dist/native/native.esm.js +1 -1
- package/dist/native/native.esm.js.map +1 -1
- package/dist/native/{p-b094296d.entry.js → p-08a75cfa.entry.js} +2 -2
- package/dist/native/{p-d5cbf5c8.entry.js → p-14c07207.entry.js} +2 -2
- package/dist/native/p-1da72182.entry.js +2 -0
- package/dist/native/p-1da72182.entry.js.map +1 -0
- package/dist/native/p-2523eead.entry.js +2 -0
- package/dist/native/p-2523eead.entry.js.map +1 -0
- package/dist/native/p-3953464e.entry.js +7 -0
- package/dist/native/p-3953464e.entry.js.map +1 -0
- package/dist/native/{p-701b5557.entry.js → p-3b7ef609.entry.js} +2 -2
- package/dist/native/{p-63e6aed3.entry.js → p-3cd77d82.entry.js} +2 -2
- package/dist/native/p-3cd77d82.entry.js.map +1 -0
- package/dist/native/p-470588c2.entry.js +13 -0
- package/dist/native/p-470588c2.entry.js.map +1 -0
- package/dist/native/p-49cac014.entry.js +2 -0
- package/dist/native/p-49cac014.entry.js.map +1 -0
- package/dist/native/p-4d164ed6.entry.js +2 -0
- package/dist/native/p-4d164ed6.entry.js.map +1 -0
- package/dist/native/p-4e635fa7.entry.js +2 -0
- package/dist/native/p-4e635fa7.entry.js.map +1 -0
- package/dist/native/p-5d21532a.entry.js +2 -0
- package/dist/native/p-5d21532a.entry.js.map +1 -0
- package/dist/native/{p-39bb95ff.entry.js → p-615947e7.entry.js} +2 -2
- package/dist/native/{p-bad11367.entry.js → p-656c56f0.entry.js} +2 -2
- package/dist/native/p-656c56f0.entry.js.map +1 -0
- package/dist/native/{p-fa77a591.entry.js → p-7042ba8a.entry.js} +2 -2
- package/dist/native/p-7e154bfd.entry.js +2 -0
- package/dist/native/p-7e154bfd.entry.js.map +1 -0
- package/dist/native/p-7eba904e.entry.js +2 -0
- package/dist/native/p-7eba904e.entry.js.map +1 -0
- package/dist/native/{p-6b348684.entry.js → p-7fd4d13d.entry.js} +2 -2
- package/dist/native/{p-fb5bddba.entry.js → p-90e6d9dd.entry.js} +2 -2
- package/dist/native/p-ae7ab110.entry.js +2 -0
- package/dist/native/p-ae7ab110.entry.js.map +1 -0
- package/dist/native/{p-f85aca27.entry.js → p-b8b6875d.entry.js} +2 -2
- package/dist/native/p-b94d9f0b.entry.js +2 -0
- package/dist/native/p-b94d9f0b.entry.js.map +1 -0
- package/dist/native/p-c0f79bac.entry.js +2 -0
- package/dist/native/p-c0f79bac.entry.js.map +1 -0
- package/dist/native/{p-6ff228da.entry.js → p-c67186f8.entry.js} +2 -2
- package/dist/native/{p-eee01062.entry.js → p-c71c6f23.entry.js} +2 -2
- package/dist/native/p-d9a52884.entry.js +2 -0
- package/dist/native/p-d9a52884.entry.js.map +1 -0
- package/dist/native/{p-d7a76400.entry.js → p-efe6a46c.entry.js} +2 -2
- package/dist/native/p-f2ef6771.entry.js +2 -0
- package/dist/native/p-f5f68992.entry.js +2 -0
- package/dist/native/p-f5f68992.entry.js.map +1 -0
- package/dist/native/{p-59768ee5.js → p-f85c08f1.js} +2 -2
- package/dist/native/p-f85c08f1.js.map +1 -0
- package/dist/native/p-fc97f071.entry.js +2 -0
- package/dist/native/p-fc97f071.entry.js.map +1 -0
- package/dist/types/components/nv-alert/nv-alert.d.ts +1 -1
- package/dist/types/components/nv-badge/nv-badge.d.ts +11 -3
- package/dist/types/components/nv-calendar/nv-calendar.d.ts +69 -107
- package/dist/types/components/nv-calendar/nv-calendar.utils.d.ts +60 -0
- package/dist/types/components/nv-calendar/test/nv-calendar.utils.test.d.ts +1 -0
- package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +47 -10
- package/dist/types/components/nv-dialog/nv-dialog.d.ts +4 -0
- package/dist/types/components/nv-fielddate/nv-fielddate.d.ts +6 -7
- package/dist/types/components/nv-fielddaterange/nv-fielddaterange.d.ts +13 -12
- package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +4 -0
- package/dist/types/components/nv-fieldmultiselect/nv-fieldmultiselect.d.ts +4 -0
- package/dist/types/components/nv-fieldnumber/nv-fieldnumber.d.ts +4 -0
- package/dist/types/components/nv-fieldpassword/nv-fieldpassword.d.ts +4 -0
- package/dist/types/components/nv-fieldselect/nv-fieldselect.d.ts +4 -0
- package/dist/types/components/nv-fieldtext/nv-fieldtext.d.ts +4 -0
- package/dist/types/components/nv-fieldtextarea/nv-fieldtextarea.d.ts +4 -0
- package/dist/types/components/nv-icon/nv-icons.d.ts +1 -1
- package/dist/types/components/nv-table/nv-table.d.ts +13 -2
- package/dist/types/components.d.ts +269 -116
- package/dist/types/index.d.ts +0 -2
- package/dist/types/utils/constants.d.ts +9 -0
- package/dist/vscode-data.json +221 -1587
- package/hydrate/index.js +1466 -1063
- package/hydrate/index.mjs +1466 -1063
- package/package.json +1 -1
- package/dist/cjs/constants-bcd6b2e2.js.map +0 -1
- package/dist/collection/interfaces/actionEvent.js +0 -2
- package/dist/collection/interfaces/actionEvent.js.map +0 -1
- package/dist/collection/interfaces/calendarShortcut.js +0 -2
- package/dist/collection/interfaces/calendarShortcut.js.map +0 -1
- package/dist/collection/interfaces/dateRange.js +0 -2
- package/dist/collection/interfaces/dateRange.js.map +0 -1
- package/dist/components/p-373926aa.js +0 -177
- package/dist/components/p-373926aa.js.map +0 -1
- package/dist/components/p-591730e7.js +0 -88
- package/dist/components/p-591730e7.js.map +0 -1
- package/dist/components/p-8348db09.js.map +0 -1
- package/dist/components/p-f331117c.js +0 -1133
- package/dist/components/p-f331117c.js.map +0 -1
- package/dist/esm/constants-98e2dcc2.js.map +0 -1
- package/dist/native/p-0ee428d5.entry.js +0 -2
- package/dist/native/p-0ee428d5.entry.js.map +0 -1
- package/dist/native/p-2691e02d.entry.js +0 -2
- package/dist/native/p-37f0210e.entry.js +0 -2
- package/dist/native/p-37f0210e.entry.js.map +0 -1
- package/dist/native/p-4a440970.entry.js +0 -2
- package/dist/native/p-4a440970.entry.js.map +0 -1
- package/dist/native/p-4ae26462.entry.js +0 -7
- package/dist/native/p-4ae26462.entry.js.map +0 -1
- package/dist/native/p-4d9c4618.entry.js +0 -2
- package/dist/native/p-4d9c4618.entry.js.map +0 -1
- package/dist/native/p-59768ee5.js.map +0 -1
- package/dist/native/p-59e0bd2b.entry.js +0 -2
- package/dist/native/p-59e0bd2b.entry.js.map +0 -1
- package/dist/native/p-5c00f092.entry.js +0 -2
- package/dist/native/p-5c00f092.entry.js.map +0 -1
- package/dist/native/p-63e6aed3.entry.js.map +0 -1
- package/dist/native/p-7f5eb2ac.entry.js +0 -2
- package/dist/native/p-7f5eb2ac.entry.js.map +0 -1
- package/dist/native/p-84a73e2a.entry.js +0 -2
- package/dist/native/p-84a73e2a.entry.js.map +0 -1
- package/dist/native/p-93dc2f47.entry.js +0 -2
- package/dist/native/p-93dc2f47.entry.js.map +0 -1
- package/dist/native/p-9a267f16.entry.js +0 -13
- package/dist/native/p-9a267f16.entry.js.map +0 -1
- package/dist/native/p-9d6431c7.entry.js +0 -2
- package/dist/native/p-9d6431c7.entry.js.map +0 -1
- package/dist/native/p-b2ce83ad.entry.js +0 -2
- package/dist/native/p-b2ce83ad.entry.js.map +0 -1
- package/dist/native/p-bad11367.entry.js.map +0 -1
- package/dist/native/p-e1a4f776.entry.js +0 -2
- package/dist/native/p-e1a4f776.entry.js.map +0 -1
- package/dist/native/p-e49bbd02.entry.js +0 -2
- package/dist/native/p-e49bbd02.entry.js.map +0 -1
- package/dist/native/p-f6bdc270.entry.js +0 -2
- package/dist/native/p-f6bdc270.entry.js.map +0 -1
- package/dist/types/interfaces/actionEvent.d.ts +0 -13
- package/dist/types/interfaces/calendarShortcut.d.ts +0 -17
- package/dist/types/interfaces/dateRange.d.ts +0 -13
- /package/dist/native/{p-b094296d.entry.js.map → p-08a75cfa.entry.js.map} +0 -0
- /package/dist/native/{p-d5cbf5c8.entry.js.map → p-14c07207.entry.js.map} +0 -0
- /package/dist/native/{p-701b5557.entry.js.map → p-3b7ef609.entry.js.map} +0 -0
- /package/dist/native/{p-39bb95ff.entry.js.map → p-615947e7.entry.js.map} +0 -0
- /package/dist/native/{p-fa77a591.entry.js.map → p-7042ba8a.entry.js.map} +0 -0
- /package/dist/native/{p-6b348684.entry.js.map → p-7fd4d13d.entry.js.map} +0 -0
- /package/dist/native/{p-fb5bddba.entry.js.map → p-90e6d9dd.entry.js.map} +0 -0
- /package/dist/native/{p-f85aca27.entry.js.map → p-b8b6875d.entry.js.map} +0 -0
- /package/dist/native/{p-6ff228da.entry.js.map → p-c67186f8.entry.js.map} +0 -0
- /package/dist/native/{p-eee01062.entry.js.map → p-c71c6f23.entry.js.map} +0 -0
- /package/dist/native/{p-d7a76400.entry.js.map → p-efe6a46c.entry.js.map} +0 -0
- /package/dist/native/{p-2691e02d.entry.js.map → p-f2ef6771.entry.js.map} +0 -0
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import { h, Host, } from "@stencil/core";
|
|
3
|
-
import { createTable, getCoreRowModel, createColumnHelper, getFilteredRowModel, getPaginationRowModel, } from "@tanstack/table-core";
|
|
3
|
+
import { createTable, getCoreRowModel, createColumnHelper, getFilteredRowModel, getPaginationRowModel, getSortedRowModel, } from "@tanstack/table-core";
|
|
4
4
|
import { deepCopyElement, excludedProps } from "../../utils/dom.utils";
|
|
5
5
|
import { debounce } from "../../utils/input.utils";
|
|
6
|
+
import { SortingPossibility, } from "../../utils/constants";
|
|
6
7
|
/**
|
|
7
8
|
* A flexible data grid component powered by `@tanstack/table-core`.
|
|
8
9
|
* @slot default - Use this slot to insert HTML into the data grid content.
|
|
9
10
|
* @slot before - Use this slot to insert HTML before the data grid.
|
|
10
11
|
* @slot after - Use this slot to insert HTML after the data grid.
|
|
11
|
-
*
|
|
12
|
-
* @deprecated [EXPERIMENTAL]
|
|
13
|
-
* @experimental - This component is still under development and is not ready for use.
|
|
14
12
|
*/
|
|
15
13
|
export class NvDatagrid {
|
|
16
14
|
constructor() {
|
|
@@ -25,6 +23,8 @@ export class NvDatagrid {
|
|
|
25
23
|
this.globalFilterSearchTerm = '';
|
|
26
24
|
this.columnData = [];
|
|
27
25
|
this.paginationState = null;
|
|
26
|
+
this.sorting = [];
|
|
27
|
+
this.rowSelectionState = {};
|
|
28
28
|
//#endregion STATES
|
|
29
29
|
/****************************************************************************/
|
|
30
30
|
//#region PROPERTIES
|
|
@@ -60,6 +60,12 @@ export class NvDatagrid {
|
|
|
60
60
|
* @default 'No data or columns available to display.'
|
|
61
61
|
*/
|
|
62
62
|
this.noColumnsNoDataMessage = 'No data or columns available to display.';
|
|
63
|
+
/**
|
|
64
|
+
* Whether to automatically generate columns if none are provided.
|
|
65
|
+
* If columns are explicitly set, this property is ignored.
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
this.autoGenerateColumns = false;
|
|
63
69
|
/**
|
|
64
70
|
* Whether to enable global filtering for the data grid.
|
|
65
71
|
* This allows users to search across all columns for a specific value.
|
|
@@ -69,11 +75,9 @@ export class NvDatagrid {
|
|
|
69
75
|
*/
|
|
70
76
|
this.enableGlobalFilter = false;
|
|
71
77
|
/**
|
|
72
|
-
*
|
|
73
|
-
* If columns are explicitly set, this property is ignored.
|
|
74
|
-
* @default false
|
|
78
|
+
* Position the global filter input field
|
|
75
79
|
*/
|
|
76
|
-
this.
|
|
80
|
+
this.globalFilterPosition = 'end';
|
|
77
81
|
/**
|
|
78
82
|
* Whether to enable pagination for the data grid.
|
|
79
83
|
* @default false
|
|
@@ -81,6 +85,7 @@ export class NvDatagrid {
|
|
|
81
85
|
this.enablePagination = false;
|
|
82
86
|
/**
|
|
83
87
|
* The number of rows to display per page.
|
|
88
|
+
* If the number is not present in the property pageSizes it takes the first of the list.
|
|
84
89
|
* @default 10
|
|
85
90
|
*/
|
|
86
91
|
this.pageSize = 10;
|
|
@@ -89,6 +94,15 @@ export class NvDatagrid {
|
|
|
89
94
|
* @default [10, 20, 30, 40, 50]
|
|
90
95
|
*/
|
|
91
96
|
this.pageSizes = [10, 20, 30, 40, 50];
|
|
97
|
+
/**
|
|
98
|
+
* Whether to enable sorting for the data grid.
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
this.enableSorting = false;
|
|
102
|
+
/**
|
|
103
|
+
* Whether to enable row selection for the data grid.
|
|
104
|
+
*/
|
|
105
|
+
this.enableRowSelection = false;
|
|
92
106
|
this.debouncedFilter = debounce((value) => {
|
|
93
107
|
var _a;
|
|
94
108
|
(_a = this.table) === null || _a === void 0 ? void 0 : _a.setGlobalFilter(value);
|
|
@@ -121,8 +135,32 @@ export class NvDatagrid {
|
|
|
121
135
|
};
|
|
122
136
|
this.handlePageSizeChange = (event) => {
|
|
123
137
|
const target = event.target;
|
|
138
|
+
let effectivePageSize = Number(target.value);
|
|
139
|
+
if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
|
|
140
|
+
effectivePageSize = this.pageSizes[0];
|
|
141
|
+
}
|
|
124
142
|
// Simply use `setPageSize` to update the page size directly
|
|
125
|
-
this.paginationState = Object.assign(Object.assign({}, this.paginationState), { pageSize:
|
|
143
|
+
this.paginationState = Object.assign(Object.assign({}, this.paginationState), { pageSize: effectivePageSize }); // This triggers the paginationState watcher
|
|
144
|
+
};
|
|
145
|
+
this.handleSortingClick = (event, header) => {
|
|
146
|
+
var _a;
|
|
147
|
+
if (!header.column.getCanSort()) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
(_a = header.column.getToggleSortingHandler()) === null || _a === void 0 ? void 0 : _a(event);
|
|
151
|
+
};
|
|
152
|
+
this.getSortTitle = (header) => {
|
|
153
|
+
if (!header.column.getCanSort())
|
|
154
|
+
return;
|
|
155
|
+
const nextOrder = header.column.getNextSortingOrder();
|
|
156
|
+
switch (nextOrder) {
|
|
157
|
+
case SortingPossibility.Asc:
|
|
158
|
+
return 'Sort ascending';
|
|
159
|
+
case SortingPossibility.Desc:
|
|
160
|
+
return 'Sort descending';
|
|
161
|
+
default:
|
|
162
|
+
return 'Clear sort';
|
|
163
|
+
}
|
|
126
164
|
};
|
|
127
165
|
}
|
|
128
166
|
//#endregion PROPERTIES
|
|
@@ -315,9 +353,14 @@ export class NvDatagrid {
|
|
|
315
353
|
}
|
|
316
354
|
if (this.enablePagination) {
|
|
317
355
|
tableOptions.getPaginationRowModel = getPaginationRowModel();
|
|
356
|
+
const pageIndex = (_b = (_a = this.paginationState) === null || _a === void 0 ? void 0 : _a.pageIndex) !== null && _b !== void 0 ? _b : 0;
|
|
357
|
+
let effectivePageSize = (_d = (_c = this.paginationState) === null || _c === void 0 ? void 0 : _c.pageSize) !== null && _d !== void 0 ? _d : 10;
|
|
358
|
+
if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
|
|
359
|
+
effectivePageSize = this.pageSizes[0];
|
|
360
|
+
}
|
|
318
361
|
const pagination = {
|
|
319
|
-
pageIndex:
|
|
320
|
-
pageSize:
|
|
362
|
+
pageIndex: pageIndex,
|
|
363
|
+
pageSize: effectivePageSize,
|
|
321
364
|
};
|
|
322
365
|
// Set the initial pagination value with safeguards
|
|
323
366
|
tableOptions.state.pagination = pagination;
|
|
@@ -328,6 +371,33 @@ export class NvDatagrid {
|
|
|
328
371
|
this.paginationState = newPagination;
|
|
329
372
|
};
|
|
330
373
|
}
|
|
374
|
+
if (this.enableSorting) {
|
|
375
|
+
tableOptions.getSortedRowModel = getSortedRowModel();
|
|
376
|
+
tableOptions.enableSorting = this.enableSorting;
|
|
377
|
+
tableOptions.state.sorting = this.sorting;
|
|
378
|
+
tableOptions.onSortingChange = updater => {
|
|
379
|
+
const newSorting = typeof updater === 'function' ? updater(this.sorting) : updater;
|
|
380
|
+
this.sorting = newSorting; // Will automatically trigger the searchTerm watcher and update the table
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
if (this.enableRowSelection) {
|
|
384
|
+
tableOptions.state.rowSelection = this.rowSelectionState;
|
|
385
|
+
tableOptions.onRowSelectionChange = updater => {
|
|
386
|
+
const newRowSelectionState = typeof updater === 'function'
|
|
387
|
+
? updater(this.rowSelectionState)
|
|
388
|
+
: updater;
|
|
389
|
+
this.rowSelectionState = newRowSelectionState;
|
|
390
|
+
// Emit the original rows instead of IDs
|
|
391
|
+
const selectedRows = Object.keys(newRowSelectionState)
|
|
392
|
+
.filter(rowId => newRowSelectionState[rowId])
|
|
393
|
+
.map(rowId => {
|
|
394
|
+
// Assuming rowId corresponds to the index in parsedData
|
|
395
|
+
const index = parseInt(rowId, 10); // Convert rowId to an integer index
|
|
396
|
+
return this.parsedData[index]; // Get the original row data
|
|
397
|
+
});
|
|
398
|
+
this.selectedRows.emit(selectedRows); // Emit the original rows
|
|
399
|
+
};
|
|
400
|
+
}
|
|
331
401
|
// Initialize the table
|
|
332
402
|
this.table = createTable(tableOptions);
|
|
333
403
|
}
|
|
@@ -362,14 +432,67 @@ export class NvDatagrid {
|
|
|
362
432
|
};
|
|
363
433
|
return checkValue(row.original);
|
|
364
434
|
}
|
|
435
|
+
createIconSpan(checked, indeterminate) {
|
|
436
|
+
const span = document.createElement('span');
|
|
437
|
+
span.className = 'icon';
|
|
438
|
+
if (checked && !indeterminate) {
|
|
439
|
+
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
440
|
+
svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
|
|
441
|
+
svg.setAttribute('width', '14');
|
|
442
|
+
svg.setAttribute('height', '14');
|
|
443
|
+
svg.setAttribute('viewBox', '0 0 14 14');
|
|
444
|
+
svg.setAttribute('fill', 'none');
|
|
445
|
+
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
446
|
+
path.setAttribute('d', 'M11.6667 3.5L5.25004 9.91667L2.33337 7');
|
|
447
|
+
path.setAttribute('stroke-linecap', 'round');
|
|
448
|
+
path.setAttribute('stroke-linejoin', 'round');
|
|
449
|
+
svg.appendChild(path);
|
|
450
|
+
span.appendChild(svg);
|
|
451
|
+
}
|
|
452
|
+
if (indeterminate) {
|
|
453
|
+
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
454
|
+
svg.classList.add('indeterminate-svg');
|
|
455
|
+
svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
|
|
456
|
+
svg.setAttribute('viewBox', '0 0 14 14');
|
|
457
|
+
svg.setAttribute('fill', 'none');
|
|
458
|
+
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
459
|
+
path.setAttribute('d', 'M2.9165 7H11.0832');
|
|
460
|
+
path.setAttribute('stroke-linecap', 'round');
|
|
461
|
+
path.setAttribute('stroke-linejoin', 'round');
|
|
462
|
+
svg.appendChild(path);
|
|
463
|
+
span.appendChild(svg);
|
|
464
|
+
}
|
|
465
|
+
return span;
|
|
466
|
+
}
|
|
467
|
+
createIndeterminateCheckbox(options = {}) {
|
|
468
|
+
const { indeterminate, checked = false, disabled = false, className = '', onChange, } = options;
|
|
469
|
+
const input = document.createElement('input');
|
|
470
|
+
input.type = 'checkbox';
|
|
471
|
+
input.checked = checked;
|
|
472
|
+
input.disabled = disabled;
|
|
473
|
+
input.className = `${className} cursor-pointer`.trim();
|
|
474
|
+
if (typeof indeterminate === 'boolean') {
|
|
475
|
+
input.indeterminate = !checked && indeterminate;
|
|
476
|
+
}
|
|
477
|
+
if (onChange) {
|
|
478
|
+
input.addEventListener('change', onChange);
|
|
479
|
+
}
|
|
480
|
+
const iconSpan = this.createIconSpan(checked, indeterminate);
|
|
481
|
+
const container = document.createElement('div');
|
|
482
|
+
container.className = 'checkbox-container';
|
|
483
|
+
container.appendChild(input);
|
|
484
|
+
container.appendChild(iconSpan);
|
|
485
|
+
return container;
|
|
486
|
+
}
|
|
365
487
|
// Helper function to generate column definitions
|
|
366
488
|
generateColumns(validColumns, tableOptions) {
|
|
489
|
+
let generatedColumns = [];
|
|
367
490
|
const columnHelper = createColumnHelper();
|
|
368
491
|
if (validColumns.length > 0) {
|
|
369
492
|
// Use defined columns
|
|
370
|
-
|
|
493
|
+
generatedColumns = validColumns.map(column => {
|
|
371
494
|
var _a, _b;
|
|
372
|
-
|
|
495
|
+
const identifiedColumnDef = {
|
|
373
496
|
header: (_b = (this.renderTemplate(this.headerTemplateCache.get(column.accessor), (_a = column.header) !== null && _a !== void 0 ? _a : column.accessor, null) ||
|
|
374
497
|
column.header)) !== null && _b !== void 0 ? _b : column.accessor,
|
|
375
498
|
cell: (info) => {
|
|
@@ -387,35 +510,83 @@ export class NvDatagrid {
|
|
|
387
510
|
value)) !== null && _b !== void 0 ? _b : value) !== null && _c !== void 0 ? _c : this.fallbackValue;
|
|
388
511
|
},
|
|
389
512
|
enableGlobalFilter: this.enableGlobalFilter,
|
|
390
|
-
|
|
513
|
+
enableSorting: this.enableSorting,
|
|
514
|
+
};
|
|
515
|
+
if (this.enableSorting) {
|
|
516
|
+
identifiedColumnDef.sortUndefined = 'last'; // Force undefined values to the end
|
|
517
|
+
identifiedColumnDef.sortDescFirst = false; // First sort order will be ascending (nullable values can mess up auto detection of sort order)
|
|
518
|
+
}
|
|
519
|
+
return columnHelper.accessor(column.accessor, identifiedColumnDef);
|
|
391
520
|
});
|
|
392
521
|
}
|
|
393
522
|
else if (tableOptions.data && tableOptions.data.length > 0) {
|
|
394
523
|
// Generate columns from data keys
|
|
395
524
|
const sampleRow = tableOptions.data[0];
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
525
|
+
generatedColumns = Object.keys(sampleRow).map(key => {
|
|
526
|
+
const identifiedColumnDef = {
|
|
527
|
+
header: this.renderTemplate(this.headerTemplateCache.get(key), key.charAt(0).toUpperCase() + key.slice(1), null) || key.charAt(0).toUpperCase() + key.slice(1), // Capitalize key for header
|
|
528
|
+
cell: (info) => {
|
|
529
|
+
var _a, _b, _c;
|
|
530
|
+
const value = info.getValue();
|
|
531
|
+
const cellAccessors = key;
|
|
532
|
+
const row = info.row;
|
|
533
|
+
return ((_a = this.columnData.find(x => x.accessor === cellAccessors)) === null || _a === void 0 ? void 0 : _a.repeatTemplate) && Array.isArray(value)
|
|
534
|
+
? value.map((item) => {
|
|
535
|
+
var _a, _b;
|
|
536
|
+
return (_b = (_a = (this.renderTemplate(this.templateCache.get(cellAccessors), item, row) ||
|
|
537
|
+
item)) !== null && _a !== void 0 ? _a : value) !== null && _b !== void 0 ? _b : this.fallbackValue;
|
|
538
|
+
})
|
|
539
|
+
: (_c = (_b = (this.renderTemplate(this.templateCache.get(cellAccessors), value, row) ||
|
|
540
|
+
value)) !== null && _b !== void 0 ? _b : value) !== null && _c !== void 0 ? _c : this.fallbackValue;
|
|
541
|
+
},
|
|
542
|
+
enableGlobalFilter: this.enableGlobalFilter,
|
|
543
|
+
enableSorting: this.enableSorting,
|
|
544
|
+
};
|
|
545
|
+
if (this.enableSorting) {
|
|
546
|
+
identifiedColumnDef.sortUndefined = 'last'; // Force undefined values to the end
|
|
547
|
+
identifiedColumnDef.sortDescFirst = false; // First sort order will be ascending (nullable values can mess up auto detection of sort order)
|
|
548
|
+
}
|
|
549
|
+
return columnHelper.accessor(key, identifiedColumnDef);
|
|
550
|
+
});
|
|
414
551
|
}
|
|
415
552
|
else {
|
|
416
553
|
// No columns and no data
|
|
417
|
-
return [];
|
|
418
554
|
}
|
|
555
|
+
if (this.enableRowSelection) {
|
|
556
|
+
const rowSelection = columnHelper.accessor('select', {
|
|
557
|
+
header: ({ table }) => {
|
|
558
|
+
return (h("div", { class: "flex px-1", ref: el => {
|
|
559
|
+
const checkbox = this.createIndeterminateCheckbox({
|
|
560
|
+
checked: table === null || table === void 0 ? void 0 : table.getIsAllRowsSelected(),
|
|
561
|
+
indeterminate: table === null || table === void 0 ? void 0 : table.getIsSomeRowsSelected(),
|
|
562
|
+
onChange: table === null || table === void 0 ? void 0 : table.getToggleAllRowsSelectedHandler(),
|
|
563
|
+
});
|
|
564
|
+
if (el) {
|
|
565
|
+
el.innerHTML = ''; // Remove existing content
|
|
566
|
+
el.appendChild(checkbox); // Append new checkbox
|
|
567
|
+
}
|
|
568
|
+
} }));
|
|
569
|
+
},
|
|
570
|
+
cell: ({ row }) => {
|
|
571
|
+
return (h("div", { class: "flex px-1", ref: el => {
|
|
572
|
+
const checkbox = this.createIndeterminateCheckbox({
|
|
573
|
+
checked: row === null || row === void 0 ? void 0 : row.getIsSelected(),
|
|
574
|
+
disabled: !(row === null || row === void 0 ? void 0 : row.getCanSelect()),
|
|
575
|
+
indeterminate: row === null || row === void 0 ? void 0 : row.getIsSomeSelected(),
|
|
576
|
+
onChange: row === null || row === void 0 ? void 0 : row.getToggleSelectedHandler(),
|
|
577
|
+
});
|
|
578
|
+
if (el) {
|
|
579
|
+
el.innerHTML = ''; // Remove existing content
|
|
580
|
+
el.appendChild(checkbox); // Append new checkbox
|
|
581
|
+
}
|
|
582
|
+
} }));
|
|
583
|
+
},
|
|
584
|
+
enableGlobalFilter: false,
|
|
585
|
+
enableSorting: false,
|
|
586
|
+
});
|
|
587
|
+
generatedColumns = [rowSelection, ...generatedColumns];
|
|
588
|
+
}
|
|
589
|
+
return generatedColumns;
|
|
419
590
|
}
|
|
420
591
|
getTableData() {
|
|
421
592
|
if (this.parsedData &&
|
|
@@ -663,6 +834,46 @@ export class NvDatagrid {
|
|
|
663
834
|
});
|
|
664
835
|
}
|
|
665
836
|
}
|
|
837
|
+
getArrowSorting(header) {
|
|
838
|
+
if (!header.column.getCanSort())
|
|
839
|
+
return null;
|
|
840
|
+
const sortState = header.column.getIsSorted();
|
|
841
|
+
if (sortState === SortingPossibility.Asc) {
|
|
842
|
+
return (h("div", { class: "inline-flex align-middle" }, h("nv-icon", { name: "arrow-up" })));
|
|
843
|
+
}
|
|
844
|
+
if (sortState === SortingPossibility.Desc) {
|
|
845
|
+
return (h("div", { class: "inline-flex align-middle" }, h("nv-icon", { name: "arrow-down" })));
|
|
846
|
+
}
|
|
847
|
+
return null;
|
|
848
|
+
}
|
|
849
|
+
getHeaderCell(header) {
|
|
850
|
+
const isSortable = header.column.getCanSort();
|
|
851
|
+
const sortTitle = this.getSortTitle(header);
|
|
852
|
+
const content = header.isPlaceholder
|
|
853
|
+
? null
|
|
854
|
+
: header.column.columnDef.header
|
|
855
|
+
? this.flexRender(header.column.columnDef.header, header.getContext())
|
|
856
|
+
: null; // Ensure content is not null
|
|
857
|
+
const sortIcon = this.getArrowSorting(header);
|
|
858
|
+
const handleClick = this.createSortingClickHandler(header);
|
|
859
|
+
if (this.enableRowSelection) {
|
|
860
|
+
return (h("th", { key: header.id }, content, " "));
|
|
861
|
+
}
|
|
862
|
+
const returnHtml = (h("th", { key: header.id }, h("button", { type: "button", class: isSortable
|
|
863
|
+
? 'w-full text-left cursor-pointer select-none bg-transparent border-none p-0 m-0 focus:outline-none'
|
|
864
|
+
: 'w-full text-left bg-transparent border-none p-0 m-0 cursor-default', onClick: handleClick, title: sortTitle }, h("span", { class: "inline-flex items-center gap-1" }, content, sortIcon))));
|
|
865
|
+
return returnHtml;
|
|
866
|
+
}
|
|
867
|
+
// 👇 Helper method to avoid arrow function in JSX
|
|
868
|
+
createSortingClickHandler(header) {
|
|
869
|
+
return (e) => {
|
|
870
|
+
this.handleSortingClick(e, header);
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
getPagination() {
|
|
874
|
+
var _a;
|
|
875
|
+
return (this.enablePagination && (h("div", { class: "flex items-center gap-2" }, h("button", { class: "border rounded p-1", disabled: !this.table.getCanPreviousPage(), onClick: this.table.firstPage }, "<<"), h("button", { class: "border rounded p-1", disabled: !this.table.getCanPreviousPage(), onClick: this.table.previousPage }, "<"), h("button", { class: "border rounded p-1", disabled: !this.table.getCanNextPage(), onClick: this.table.nextPage }, ">"), h("button", { class: "border rounded p-1", disabled: !this.table.getCanNextPage(), onClick: this.table.lastPage }, ">>"), h("span", { class: "flex items-center gap-1" }, h("div", null, "Page"), h("strong", null, this.table.getState().pagination.pageIndex + 1, " of", ' ', this.table.getPageCount().toLocaleString())), h("span", { class: "flex items-center gap-1" }, "| Go to page:", ' ', h("input", { type: "number", min: this.minPageIndex, max: this.table.getPageCount(), value: this.table.getState().pagination.pageIndex + 1, class: "border p-1 rounded w-16", "aria-label": "Go to page", onInput: this.handlePageIndexChange })), ((_a = this.pageSizes) === null || _a === void 0 ? void 0 : _a.length) > 0 && (h("select", { "aria-label": "Rows per page", onChange: this.handlePageSizeChange }, this.pageSizes.map(pageSize => (h("option", { value: String(pageSize), selected: this.table.getState().pagination.pageSize === pageSize }, "Show ", pageSize))))))));
|
|
876
|
+
}
|
|
666
877
|
//#endregion METHODS
|
|
667
878
|
/****************************************************************************/
|
|
668
879
|
//#region WATCHERS
|
|
@@ -720,6 +931,39 @@ export class NvDatagrid {
|
|
|
720
931
|
this.table.options.state.pagination = newValue;
|
|
721
932
|
}
|
|
722
933
|
}
|
|
934
|
+
handleSorting(newValue) {
|
|
935
|
+
if (!this.table) {
|
|
936
|
+
console.warn('Table is not initialized yet.');
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
// Not working
|
|
940
|
+
/*// Set the sorting for the table
|
|
941
|
+
this.table.setSorting(newValue);*/
|
|
942
|
+
// Manually update the sorting state
|
|
943
|
+
this.table.options.state.sorting = newValue;
|
|
944
|
+
}
|
|
945
|
+
handlePageSize(newValue) {
|
|
946
|
+
let effectivePageSize = newValue;
|
|
947
|
+
if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
|
|
948
|
+
effectivePageSize = this.pageSizes[0];
|
|
949
|
+
}
|
|
950
|
+
// Simply use `setPageSize` to update the page size directly
|
|
951
|
+
this.paginationState = Object.assign(Object.assign({}, this.paginationState), { pageSize: effectivePageSize }); // This triggers the paginationState watcher
|
|
952
|
+
}
|
|
953
|
+
handleRowSelectionState(newValue, oldValue) {
|
|
954
|
+
if (!this.table) {
|
|
955
|
+
console.warn('Table is not initialized yet.');
|
|
956
|
+
return;
|
|
957
|
+
}
|
|
958
|
+
// Only update if there is a meaningful change
|
|
959
|
+
if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
|
|
960
|
+
// Not working
|
|
961
|
+
/*// Set the rowSelection for the table
|
|
962
|
+
this.table.setRowSelection(newValue);*/
|
|
963
|
+
// Manually update the row selection state
|
|
964
|
+
this.table.options.state.rowSelection = newValue;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
723
967
|
//#endregion WATCHERS
|
|
724
968
|
/****************************************************************************/
|
|
725
969
|
//#region LIFECYCLE
|
|
@@ -729,7 +973,10 @@ export class NvDatagrid {
|
|
|
729
973
|
this.initializeTable();
|
|
730
974
|
if (this.enablePagination) {
|
|
731
975
|
// Ensure a valid page size
|
|
732
|
-
|
|
976
|
+
let effectivePageSize = this.pageSize > 0 ? this.pageSize : 10;
|
|
977
|
+
if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
|
|
978
|
+
effectivePageSize = this.pageSizes[0];
|
|
979
|
+
}
|
|
733
980
|
this.paginationState = {
|
|
734
981
|
pageIndex: Math.max(0, this.minPageIndex - 1),
|
|
735
982
|
pageSize: effectivePageSize,
|
|
@@ -747,11 +994,9 @@ export class NvDatagrid {
|
|
|
747
994
|
const rows = !this.table || this.table === undefined || this.parsedData.length === 0
|
|
748
995
|
? []
|
|
749
996
|
: (_c = (_b = this.table) === null || _b === void 0 ? void 0 : _b.getRowModel()) === null || _c === void 0 ? void 0 : _c.rows;
|
|
750
|
-
return (h(Host, { key: '
|
|
997
|
+
return (h(Host, { key: '7ed48645de6272bb3fed7897406e2a798021bba2' }, h("div", { key: '4ae6135c7ca302e06c3d26509dbf813128631a2e', class: "hidden" }, h("slot", { key: '3f8078b877a4e2ebe46842fc3a52d7059cb3cc68' })), h("slot", { key: 'c97cb30a0ce80dc8c25c2b855eb6086937dbe76b', name: "before" }), this.enableGlobalFilter && this.table && (h("div", { key: '68cd75ed6ecad3de049797ebfe7787f5a0b357fa', class: `search-container justify-${this.globalFilterPosition}` }, h("nv-fieldtext", { key: '80b4f8b50c3dda39555597a44707f3a296fbb8e6', value: this.globalFilterSearchTerm, onInput: this.handleGlobalFilteringOnInput, placeholder: "Search all columns..." }))), this.parsedColumns.length === 0 && this.parsedData.length === 0 ? (h("div", { class: "no-data" }, this.noColumnsNoDataMessage)) : (h("div", null, h("table", null, this.parsedColumns.length > 0 && headerGroups.length > 0 && (h("thead", null, this.parsedColumns.length > 0 && headerGroups
|
|
751
998
|
? headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map(headerGroup => (h("tr", { key: headerGroup.id }, headerGroup.headers.map(header => {
|
|
752
|
-
return (
|
|
753
|
-
? null
|
|
754
|
-
: this.flexRender(header.column.columnDef.header, header.getContext())));
|
|
999
|
+
return this.getHeaderCell(header);
|
|
755
1000
|
}))))
|
|
756
1001
|
: null)), h("tbody", null, !rows || rows.length === 0 || this.parsedData.length === 0 ? (h("tr", null, h("td", { colSpan: this.parsedColumns.length || 12, class: "no-data" }, this.noDataMessage))) : (rows.map(row => {
|
|
757
1002
|
const rowId = row.id;
|
|
@@ -759,7 +1004,8 @@ export class NvDatagrid {
|
|
|
759
1004
|
return (h("tr", { key: rowId }, visibleCells.map(cell => {
|
|
760
1005
|
return (h("td", { key: cell.id, "data-row-id": rowId }, this.flexRender(cell.column.columnDef.cell, cell.getContext())));
|
|
761
1006
|
})));
|
|
762
|
-
})))
|
|
1007
|
+
}))), this.table && this.enableRowSelection ? (h("tfoot", null, h("tr", null, h("td", { colSpan: 20 }, this.enableRowSelection && this.table ? (h("div", null, this.rowSelectionState &&
|
|
1008
|
+
Object.keys(this.rowSelectionState).length > 0 ? (h("span", null, Object.keys(this.rowSelectionState).length, " of", ' ', ((_e = (_d = this.table.getPreFilteredRowModel()) === null || _d === void 0 ? void 0 : _d.rows) === null || _e === void 0 ? void 0 : _e.length) || 0, ' ', "Total Rows Selected")) : (h("span", null, "No rows selected")))) : null)))) : null), this.getPagination())), h("slot", { key: 'f7209e67ff423310bb4b59b866f486ade897781a', name: "after" })));
|
|
763
1009
|
}
|
|
764
1010
|
static get is() { return "nv-datagrid"; }
|
|
765
1011
|
static get originalStyleUrls() {
|
|
@@ -941,7 +1187,7 @@ export class NvDatagrid {
|
|
|
941
1187
|
"reflect": true,
|
|
942
1188
|
"defaultValue": "'No data or columns available to display.'"
|
|
943
1189
|
},
|
|
944
|
-
"
|
|
1190
|
+
"autoGenerateColumns": {
|
|
945
1191
|
"type": "boolean",
|
|
946
1192
|
"mutable": false,
|
|
947
1193
|
"complexType": {
|
|
@@ -956,15 +1202,15 @@ export class NvDatagrid {
|
|
|
956
1202
|
"name": "default",
|
|
957
1203
|
"text": "false"
|
|
958
1204
|
}],
|
|
959
|
-
"text": "Whether to
|
|
1205
|
+
"text": "Whether to automatically generate columns if none are provided.\nIf columns are explicitly set, this property is ignored."
|
|
960
1206
|
},
|
|
961
1207
|
"getter": false,
|
|
962
1208
|
"setter": false,
|
|
963
|
-
"attribute": "
|
|
1209
|
+
"attribute": "auto-generate-columns",
|
|
964
1210
|
"reflect": true,
|
|
965
1211
|
"defaultValue": "false"
|
|
966
1212
|
},
|
|
967
|
-
"
|
|
1213
|
+
"enableGlobalFilter": {
|
|
968
1214
|
"type": "boolean",
|
|
969
1215
|
"mutable": false,
|
|
970
1216
|
"complexType": {
|
|
@@ -979,14 +1225,40 @@ export class NvDatagrid {
|
|
|
979
1225
|
"name": "default",
|
|
980
1226
|
"text": "false"
|
|
981
1227
|
}],
|
|
982
|
-
"text": "Whether to
|
|
1228
|
+
"text": "Whether to enable global filtering for the data grid.\nThis allows users to search across all columns for a specific value.\nThe search is case-insensitive and supports partial matches.\nIt use string.includes() to match the search term."
|
|
983
1229
|
},
|
|
984
1230
|
"getter": false,
|
|
985
1231
|
"setter": false,
|
|
986
|
-
"attribute": "
|
|
1232
|
+
"attribute": "enable-global-filter",
|
|
987
1233
|
"reflect": true,
|
|
988
1234
|
"defaultValue": "false"
|
|
989
1235
|
},
|
|
1236
|
+
"globalFilterPosition": {
|
|
1237
|
+
"type": "string",
|
|
1238
|
+
"mutable": false,
|
|
1239
|
+
"complexType": {
|
|
1240
|
+
"original": "`${GlobalFilterPosition}`",
|
|
1241
|
+
"resolved": "\"center\" | \"end\" | \"start\"",
|
|
1242
|
+
"references": {
|
|
1243
|
+
"GlobalFilterPosition": {
|
|
1244
|
+
"location": "import",
|
|
1245
|
+
"path": "../../utils/constants",
|
|
1246
|
+
"id": "src/utils/constants.ts::GlobalFilterPosition"
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
},
|
|
1250
|
+
"required": false,
|
|
1251
|
+
"optional": false,
|
|
1252
|
+
"docs": {
|
|
1253
|
+
"tags": [],
|
|
1254
|
+
"text": "Position the global filter input field"
|
|
1255
|
+
},
|
|
1256
|
+
"getter": false,
|
|
1257
|
+
"setter": false,
|
|
1258
|
+
"attribute": "global-filter-position",
|
|
1259
|
+
"reflect": true,
|
|
1260
|
+
"defaultValue": "'end'"
|
|
1261
|
+
},
|
|
990
1262
|
"enablePagination": {
|
|
991
1263
|
"type": "boolean",
|
|
992
1264
|
"mutable": false,
|
|
@@ -1025,7 +1297,7 @@ export class NvDatagrid {
|
|
|
1025
1297
|
"name": "default",
|
|
1026
1298
|
"text": "10"
|
|
1027
1299
|
}],
|
|
1028
|
-
"text": "The number of rows to display per page."
|
|
1300
|
+
"text": "The number of rows to display per page.\nIf the number is not present in the property pageSizes it takes the first of the list."
|
|
1029
1301
|
},
|
|
1030
1302
|
"getter": false,
|
|
1031
1303
|
"setter": false,
|
|
@@ -1053,6 +1325,49 @@ export class NvDatagrid {
|
|
|
1053
1325
|
"getter": false,
|
|
1054
1326
|
"setter": false,
|
|
1055
1327
|
"defaultValue": "[10, 20, 30, 40, 50]"
|
|
1328
|
+
},
|
|
1329
|
+
"enableSorting": {
|
|
1330
|
+
"type": "boolean",
|
|
1331
|
+
"mutable": false,
|
|
1332
|
+
"complexType": {
|
|
1333
|
+
"original": "boolean",
|
|
1334
|
+
"resolved": "boolean",
|
|
1335
|
+
"references": {}
|
|
1336
|
+
},
|
|
1337
|
+
"required": false,
|
|
1338
|
+
"optional": false,
|
|
1339
|
+
"docs": {
|
|
1340
|
+
"tags": [{
|
|
1341
|
+
"name": "default",
|
|
1342
|
+
"text": "false"
|
|
1343
|
+
}],
|
|
1344
|
+
"text": "Whether to enable sorting for the data grid."
|
|
1345
|
+
},
|
|
1346
|
+
"getter": false,
|
|
1347
|
+
"setter": false,
|
|
1348
|
+
"attribute": "enable-sorting",
|
|
1349
|
+
"reflect": true,
|
|
1350
|
+
"defaultValue": "false"
|
|
1351
|
+
},
|
|
1352
|
+
"enableRowSelection": {
|
|
1353
|
+
"type": "boolean",
|
|
1354
|
+
"mutable": false,
|
|
1355
|
+
"complexType": {
|
|
1356
|
+
"original": "boolean",
|
|
1357
|
+
"resolved": "boolean",
|
|
1358
|
+
"references": {}
|
|
1359
|
+
},
|
|
1360
|
+
"required": false,
|
|
1361
|
+
"optional": false,
|
|
1362
|
+
"docs": {
|
|
1363
|
+
"tags": [],
|
|
1364
|
+
"text": "Whether to enable row selection for the data grid."
|
|
1365
|
+
},
|
|
1366
|
+
"getter": false,
|
|
1367
|
+
"setter": false,
|
|
1368
|
+
"attribute": "enable-row-selection",
|
|
1369
|
+
"reflect": true,
|
|
1370
|
+
"defaultValue": "false"
|
|
1056
1371
|
}
|
|
1057
1372
|
};
|
|
1058
1373
|
}
|
|
@@ -1063,7 +1378,9 @@ export class NvDatagrid {
|
|
|
1063
1378
|
"parsedData": {},
|
|
1064
1379
|
"globalFilterSearchTerm": {},
|
|
1065
1380
|
"columnData": {},
|
|
1066
|
-
"paginationState": {}
|
|
1381
|
+
"paginationState": {},
|
|
1382
|
+
"sorting": {},
|
|
1383
|
+
"rowSelectionState": {}
|
|
1067
1384
|
};
|
|
1068
1385
|
}
|
|
1069
1386
|
static get events() {
|
|
@@ -1078,15 +1395,24 @@ export class NvDatagrid {
|
|
|
1078
1395
|
"text": "Emitted when an action is triggered on a cell."
|
|
1079
1396
|
},
|
|
1080
1397
|
"complexType": {
|
|
1081
|
-
"original": "
|
|
1082
|
-
"resolved": "
|
|
1083
|
-
"references": {
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1398
|
+
"original": "{\n /**\n * Key action to be performed\n */\n keyAction: string;\n\n /**\n * Details of the action to be performed\n */\n details: any;\n }",
|
|
1399
|
+
"resolved": "{ keyAction: string; details: any; }",
|
|
1400
|
+
"references": {}
|
|
1401
|
+
}
|
|
1402
|
+
}, {
|
|
1403
|
+
"method": "selectedRows",
|
|
1404
|
+
"name": "selectedRows",
|
|
1405
|
+
"bubbles": true,
|
|
1406
|
+
"cancelable": true,
|
|
1407
|
+
"composed": true,
|
|
1408
|
+
"docs": {
|
|
1409
|
+
"tags": [],
|
|
1410
|
+
"text": "Emitted when the selection of the rows are changed."
|
|
1411
|
+
},
|
|
1412
|
+
"complexType": {
|
|
1413
|
+
"original": "any[]",
|
|
1414
|
+
"resolved": "any[]",
|
|
1415
|
+
"references": {}
|
|
1090
1416
|
}
|
|
1091
1417
|
}];
|
|
1092
1418
|
}
|
|
@@ -1116,6 +1442,15 @@ export class NvDatagrid {
|
|
|
1116
1442
|
}, {
|
|
1117
1443
|
"propName": "paginationState",
|
|
1118
1444
|
"methodName": "handlePaginationState"
|
|
1445
|
+
}, {
|
|
1446
|
+
"propName": "sorting",
|
|
1447
|
+
"methodName": "handleSorting"
|
|
1448
|
+
}, {
|
|
1449
|
+
"propName": "pageSize",
|
|
1450
|
+
"methodName": "handlePageSize"
|
|
1451
|
+
}, {
|
|
1452
|
+
"propName": "rowSelectionState",
|
|
1453
|
+
"methodName": "handleRowSelectionState"
|
|
1119
1454
|
}];
|
|
1120
1455
|
}
|
|
1121
1456
|
}
|