@nova-design-system/nova-webcomponents 3.0.0-beta.39 → 3.0.0-beta.41
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-2ae3d9eb.js → constants-79d2cdfc.js} +4 -4
- package/dist/cjs/constants-79d2cdfc.js.map +1 -0
- package/dist/cjs/dom.utils-4d43f69a.js +170 -0
- package/dist/cjs/dom.utils-4d43f69a.js.map +1 -0
- package/dist/cjs/index-5910ba06.js +0 -32
- package/dist/cjs/index.cjs.js +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 +32 -9
- package/dist/cjs/nv-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-avatar.cjs.entry.js +2 -2
- package/dist/cjs/nv-badge_2.cjs.entry.js +3 -3
- package/dist/cjs/nv-base.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 +34 -12
- package/dist/cjs/nv-button.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-calendar.cjs.entry.js +2 -2
- package/dist/cjs/nv-col.cjs.entry.js +1 -1
- package/dist/cjs/nv-datagrid.cjs.entry.js +325 -165
- package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-datagridcolumn.cjs.entry.js +1 -5
- package/dist/cjs/nv-datagridcolumn.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-dialog.cjs.entry.js +20 -9
- package/dist/cjs/nv-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +17 -12
- package/dist/cjs/nv-dialogfooter_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +4 -4
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +3 -3
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +3 -3
- package/dist/cjs/nv-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 +10 -10
- 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.cjs.entry.js +1 -1
- package/dist/cjs/nv-loader.cjs.entry.js +1 -1
- package/dist/cjs/nv-menu.cjs.entry.js +2 -2
- package/dist/cjs/nv-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-menuitem.cjs.entry.js +1 -1
- package/dist/cjs/nv-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 +267 -81
- package/dist/cjs/nv-table.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-tablecolumn.cjs.entry.js +1 -21
- package/dist/cjs/nv-tablecolumn.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/collection-manifest.json +1 -9
- package/dist/collection/components/nv-alert/nv-alert.docs.js +5 -0
- package/dist/collection/components/nv-alert/nv-alert.docs.js.map +1 -1
- package/dist/collection/components/nv-alert/nv-alert.js +51 -8
- package/dist/collection/components/nv-alert/nv-alert.js.map +1 -1
- package/dist/collection/components/nv-avatar/nv-avatar.js +1 -1
- package/dist/collection/components/nv-badge/nv-badge.js +2 -2
- package/dist/collection/components/nv-base/nv-base.js +1 -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.docs.js +4 -0
- package/dist/collection/components/nv-button/nv-button.docs.js.map +1 -1
- package/dist/collection/components/nv-button/nv-button.js +54 -13
- package/dist/collection/components/nv-button/nv-button.js.map +1 -1
- package/dist/collection/components/nv-calendar/nv-calendar.js +1 -1
- package/dist/collection/components/nv-col/nv-col.js +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.css +30 -0
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +25 -77
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.js +396 -194
- package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -1
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js +7 -16
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js.map +1 -1
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js +6 -9
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js.map +1 -1
- package/dist/collection/components/nv-dialog/nv-dialog.js +20 -29
- package/dist/collection/components/nv-dialog/nv-dialog.js.map +1 -1
- package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.js +71 -21
- package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.js.map +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-fielddropdown/nv-fielddropdown.js +4 -4
- 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-fieldnumber/nv-fieldnumber.js +3 -3
- 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 +3 -3
- package/dist/collection/components/nv-icon/nv-icon.js.map +1 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +1 -1
- package/dist/collection/components/nv-loader/nv-loader.js +1 -1
- package/dist/collection/components/nv-menu/nv-menu.docs.js +1 -1
- package/dist/collection/components/nv-menu/nv-menu.docs.js.map +1 -1
- package/dist/collection/components/nv-menu/nv-menu.js +3 -3
- package/dist/collection/components/nv-menu/nv-menu.js.map +1 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js +3 -3
- 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.css +30 -0
- package/dist/collection/components/nv-table/nv-table.docs.js +69 -74
- package/dist/collection/components/nv-table/nv-table.docs.js.map +1 -1
- package/dist/collection/components/nv-table/nv-table.js +349 -137
- package/dist/collection/components/nv-table/nv-table.js.map +1 -1
- package/dist/collection/components/nv-tablecolumn/nv-tablecolumn.js +11 -111
- package/dist/collection/components/nv-tablecolumn/nv-tablecolumn.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/interfaces/ColumnConfig.js +2 -0
- package/dist/collection/interfaces/ColumnConfig.js.map +1 -0
- package/dist/collection/interfaces/actionEvent.js +2 -0
- package/dist/collection/interfaces/actionEvent.js.map +1 -0
- package/dist/collection/utils/dom.utils.js +164 -0
- package/dist/collection/utils/dom.utils.js.map +1 -0
- package/dist/collection/utils/test/class.utils.test.js +25 -0
- package/dist/collection/utils/test/class.utils.test.js.map +1 -0
- package/dist/collection/utils/test/dom.utils.test.js +102 -0
- package/dist/collection/utils/test/dom.utils.test.js.map +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/nv-alert.js +35 -11
- package/dist/components/nv-alert.js.map +1 -1
- package/dist/components/nv-avatar.js +3 -3
- package/dist/components/nv-badge.js +1 -1
- package/dist/components/nv-base.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 +6 -6
- package/dist/components/nv-col.js +1 -1
- package/dist/components/nv-datagrid.js +332 -173
- package/dist/components/nv-datagrid.js.map +1 -1
- package/dist/components/nv-datagridcolumn.js +3 -7
- package/dist/components/nv-datagridcolumn.js.map +1 -1
- package/dist/components/nv-dialog.js +25 -15
- package/dist/components/nv-dialog.js.map +1 -1
- 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-fielddropdown.js +8 -8
- package/dist/components/nv-fielddropdownitem.js +1 -1
- package/dist/components/nv-fielddropdownitemcheck.js +1 -1
- package/dist/components/nv-fieldmultiselect.js +7 -7
- package/dist/components/nv-fieldnumber.js +4 -4
- package/dist/components/nv-fieldpassword.js +6 -6
- package/dist/components/nv-fieldradio.js +3 -3
- package/dist/components/nv-fieldselect.js +6 -6
- package/dist/components/nv-fieldtext.js +4 -4
- package/dist/components/nv-fieldtextarea.js +3 -3
- package/dist/components/nv-fieldtime.js +14 -14
- package/dist/components/nv-icon.js +1 -1
- package/dist/components/nv-iconbutton.js +1 -1
- package/dist/components/nv-loader.js +1 -1
- package/dist/components/nv-menu.js +5 -5
- package/dist/components/nv-menu.js.map +1 -1
- package/dist/components/nv-menuitem.js +1 -1
- package/dist/components/nv-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 +279 -91
- package/dist/components/nv-table.js.map +1 -1
- package/dist/components/nv-tablecolumn.js +5 -28
- package/dist/components/nv-tablecolumn.js.map +1 -1
- package/dist/components/nv-toggle.js +2 -2
- package/dist/components/nv-tooltip.js +1 -1
- package/dist/components/{p-659a5ae4.js → p-11cc38e0.js} +4 -4
- package/dist/components/{p-659a5ae4.js.map → p-11cc38e0.js.map} +1 -1
- package/dist/components/{p-17b6705f.js → p-1657eba4.js} +23 -16
- package/dist/components/p-1657eba4.js.map +1 -0
- package/dist/components/{p-88165c0e.js → p-33f9bdb1.js} +4 -4
- package/dist/components/{p-88165c0e.js.map → p-33f9bdb1.js.map} +1 -1
- package/dist/components/{p-f40a7e2f.js → p-4b184820.js} +3 -3
- package/dist/components/{p-f40a7e2f.js.map → p-4b184820.js.map} +1 -1
- package/dist/components/{p-48317c2c.js → p-4bb5eb79.js} +3 -3
- package/dist/components/{p-48317c2c.js.map → p-4bb5eb79.js.map} +1 -1
- package/dist/components/{p-842afd9a.js → p-69543282.js} +3 -3
- package/dist/components/{p-842afd9a.js.map → p-69543282.js.map} +1 -1
- package/dist/components/{p-fdf57d25.js → p-96605453.js} +5 -5
- package/dist/components/{p-fdf57d25.js.map → p-96605453.js.map} +1 -1
- package/dist/components/{p-33e07c91.js → p-a633892a.js} +2 -2
- package/dist/components/{p-33e07c91.js.map → p-a633892a.js.map} +1 -1
- package/dist/components/{p-fd65c51f.js → p-b316c35d.js} +2 -2
- package/dist/components/p-b316c35d.js.map +1 -0
- package/dist/components/{p-8d7a57d1.js → p-ba145f46.js} +38 -15
- package/dist/components/p-ba145f46.js.map +1 -0
- package/dist/components/p-cb34aa4f.js +167 -0
- package/dist/components/p-cb34aa4f.js.map +1 -0
- package/dist/components/{p-492ad81d.js → p-d17558a8.js} +2 -2
- package/dist/components/{p-492ad81d.js.map → p-d17558a8.js.map} +1 -1
- package/dist/components/{p-73e703a1.js → p-f201db34.js} +2 -2
- package/dist/components/{p-73e703a1.js.map → p-f201db34.js.map} +1 -1
- package/dist/components/{p-5f5e2bf2.js → p-f77c3072.js} +4 -4
- package/dist/components/p-f77c3072.js.map +1 -0
- package/dist/components/{p-83e1177b.js → p-fad78896.js} +3 -3
- package/dist/components/{p-83e1177b.js.map → p-fad78896.js.map} +1 -1
- package/dist/docs.json +352 -679
- package/dist/esm/{constants-8243d2ea.js → constants-75e6d7f0.js} +2 -2
- package/dist/esm/constants-75e6d7f0.js.map +1 -0
- package/dist/esm/dom.utils-ac71e0ef.js +167 -0
- package/dist/esm/dom.utils-ac71e0ef.js.map +1 -0
- package/dist/esm/index-fac2d5d2.js +0 -32
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/native.js +1 -1
- package/dist/esm/nv-alert.entry.js +32 -9
- package/dist/esm/nv-alert.entry.js.map +1 -1
- package/dist/esm/nv-avatar.entry.js +2 -2
- package/dist/esm/nv-badge_2.entry.js +3 -3
- package/dist/esm/nv-base.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 +34 -12
- package/dist/esm/nv-button.entry.js.map +1 -1
- package/dist/esm/nv-calendar.entry.js +2 -2
- package/dist/esm/nv-col.entry.js +1 -1
- package/dist/esm/nv-datagrid.entry.js +326 -166
- package/dist/esm/nv-datagrid.entry.js.map +1 -1
- package/dist/esm/nv-datagridcolumn.entry.js +1 -5
- package/dist/esm/nv-datagridcolumn.entry.js.map +1 -1
- package/dist/esm/nv-dialog.entry.js +20 -9
- package/dist/esm/nv-dialog.entry.js.map +1 -1
- package/dist/esm/nv-dialogfooter_2.entry.js +17 -12
- package/dist/esm/nv-dialogfooter_2.entry.js.map +1 -1
- package/dist/esm/nv-fieldcheckbox.entry.js +4 -4
- package/dist/esm/nv-fielddropdown.entry.js +3 -3
- package/dist/esm/nv-fielddropdownitem.entry.js +1 -1
- package/dist/esm/nv-fieldnumber.entry.js +3 -3
- package/dist/esm/nv-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 +10 -10
- package/dist/esm/nv-icon.entry.js +3 -3
- package/dist/esm/nv-icon.entry.js.map +1 -1
- package/dist/esm/nv-iconbutton.entry.js +1 -1
- package/dist/esm/nv-loader.entry.js +1 -1
- package/dist/esm/nv-menu.entry.js +2 -2
- package/dist/esm/nv-menu.entry.js.map +1 -1
- package/dist/esm/nv-menuitem.entry.js +1 -1
- package/dist/esm/nv-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 +268 -82
- package/dist/esm/nv-table.entry.js.map +1 -1
- package/dist/esm/nv-tablecolumn.entry.js +2 -22
- package/dist/esm/nv-tablecolumn.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/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-e1b22ca7.entry.js → p-0a2a9f8b.entry.js} +2 -2
- package/dist/native/{p-46c9aa04.entry.js → p-12d08abc.entry.js} +2 -2
- package/dist/native/{p-63c894f0.entry.js → p-15be3d96.entry.js} +2 -2
- package/dist/native/{p-943a19a5.entry.js → p-184cd119.entry.js} +2 -2
- package/dist/native/{p-2b99e720.entry.js → p-1a3d2a74.entry.js} +2 -2
- package/dist/native/{p-bac62e20.entry.js → p-27ad7af2.entry.js} +2 -2
- package/dist/native/p-27ad7af2.entry.js.map +1 -0
- package/dist/native/p-2b2a10f9.entry.js +2 -0
- package/dist/native/p-2b2a10f9.entry.js.map +1 -0
- package/dist/native/{p-3b2c7871.entry.js → p-359f0f53.entry.js} +2 -2
- package/dist/native/p-3b65037c.entry.js +2 -0
- package/dist/native/p-3b65037c.entry.js.map +1 -0
- package/dist/native/p-3be2c9a1.entry.js +2 -0
- package/dist/native/p-4283f375.entry.js +2 -0
- package/dist/native/p-4283f375.entry.js.map +1 -0
- package/dist/native/p-487b81bd.entry.js +2 -0
- package/dist/native/p-487b81bd.entry.js.map +1 -0
- package/dist/native/{p-fa33ec18.entry.js → p-491f4605.entry.js} +2 -2
- package/dist/native/{p-39b4ec02.entry.js → p-554f7b44.entry.js} +2 -2
- package/dist/native/{p-44e7e3e8.entry.js → p-69fb1c9d.entry.js} +2 -2
- package/dist/native/{p-cba14168.entry.js → p-729c9d45.entry.js} +2 -2
- package/dist/native/{p-6acbf729.entry.js → p-78f08578.entry.js} +2 -2
- package/dist/native/p-8664ab16.entry.js +7 -0
- package/dist/native/p-8664ab16.entry.js.map +1 -0
- package/dist/native/p-8d6516a3.entry.js +2 -0
- package/dist/native/{p-4a7fa613.entry.js.map → p-8d6516a3.entry.js.map} +1 -1
- package/dist/native/p-951baf95.entry.js +2 -0
- package/dist/native/{p-b2ace8e9.entry.js → p-9795090f.entry.js} +2 -2
- package/dist/native/{p-b2ace8e9.entry.js.map → p-9795090f.entry.js.map} +1 -1
- package/dist/native/p-af60740c.entry.js +2 -0
- package/dist/native/{p-3bfd5a30.entry.js.map → p-af60740c.entry.js.map} +1 -1
- package/dist/native/{p-fd65c51f.js → p-b316c35d.js} +2 -2
- package/dist/native/{p-fd65c51f.js.map → p-b316c35d.js.map} +1 -1
- package/dist/native/p-b58c661b.entry.js +2 -0
- package/dist/native/p-b58c661b.entry.js.map +1 -0
- package/dist/native/p-b7bc918b.entry.js +2 -0
- package/dist/native/p-b7bc918b.entry.js.map +1 -0
- package/dist/native/p-cb34aa4f.js +2 -0
- package/dist/native/p-cb34aa4f.js.map +1 -0
- package/dist/native/{p-4eacd598.entry.js → p-cda56476.entry.js} +2 -2
- package/dist/native/{p-dbb89408.entry.js → p-d1bf4d77.entry.js} +2 -2
- package/dist/native/{p-b13b2663.entry.js → p-d7665a07.entry.js} +2 -2
- package/dist/native/{p-833af1bf.entry.js → p-daeb7e22.entry.js} +2 -2
- package/dist/native/{p-634b49fe.entry.js → p-e36e956b.entry.js} +2 -2
- package/dist/native/{p-afc16010.entry.js → p-e9e77494.entry.js} +2 -2
- package/dist/native/{p-0bf35abc.entry.js → p-edee1c1f.entry.js} +2 -2
- package/dist/native/{p-4db7add6.entry.js → p-f1585fc2.entry.js} +2 -2
- package/dist/native/{p-ac81e143.entry.js → p-f3579407.entry.js} +2 -2
- package/dist/native/p-fca807b4.entry.js +13 -0
- package/dist/native/p-fca807b4.entry.js.map +1 -0
- package/dist/native/{p-2151f564.entry.js → p-fde56f9c.entry.js} +2 -2
- package/dist/types/components/nv-alert/nv-alert.d.ts +14 -0
- package/dist/types/components/nv-base/nv-base.docs.d.ts +1 -1
- package/dist/types/components/nv-button/nv-button.d.ts +16 -5
- package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +48 -31
- package/dist/types/components/nv-datagridcolumn/nv-datagridcolumn.d.ts +3 -2
- package/dist/types/components/nv-dialog/nv-dialog.d.ts +1 -7
- package/dist/types/components/nv-dialogfooter/nv-dialogfooter.d.ts +19 -10
- package/dist/types/components/nv-table/nv-table.d.ts +51 -39
- package/dist/types/components/nv-tablecolumn/nv-tablecolumn.d.ts +4 -42
- package/dist/types/components.d.ts +136 -256
- package/dist/types/interfaces/ColumnConfig.d.ts +13 -0
- package/dist/types/interfaces/actionEvent.d.ts +13 -0
- package/dist/types/utils/dom.utils.d.ts +12 -0
- package/dist/types/utils/test/class.utils.test.d.ts +1 -0
- package/dist/types/utils/test/dom.utils.test.d.ts +1 -0
- package/hydrate/index.js +958 -667
- package/hydrate/index.mjs +958 -667
- package/package.json +15 -27
- package/dist/blazor-docs.json +0 -15543
- package/dist/cjs/constants-2ae3d9eb.js.map +0 -1
- package/dist/cjs/nv-datagridbody.cjs.entry.js +0 -24
- package/dist/cjs/nv-datagridbody.cjs.entry.js.map +0 -1
- package/dist/cjs/nv-datagriddatacell.cjs.entry.js +0 -25
- package/dist/cjs/nv-datagriddatacell.cjs.entry.js.map +0 -1
- package/dist/cjs/nv-datagridhead.cjs.entry.js +0 -24
- package/dist/cjs/nv-datagridhead.cjs.entry.js.map +0 -1
- package/dist/cjs/nv-datagridrow.cjs.entry.js +0 -24
- package/dist/cjs/nv-datagridrow.cjs.entry.js.map +0 -1
- package/dist/cjs/nv-tablebody.cjs.entry.js +0 -24
- package/dist/cjs/nv-tablebody.cjs.entry.js.map +0 -1
- package/dist/cjs/nv-tabledatacell.cjs.entry.js +0 -43
- package/dist/cjs/nv-tabledatacell.cjs.entry.js.map +0 -1
- package/dist/cjs/nv-tablehead.cjs.entry.js +0 -24
- package/dist/cjs/nv-tablehead.cjs.entry.js.map +0 -1
- package/dist/cjs/nv-tablerow.cjs.entry.js +0 -24
- package/dist/cjs/nv-tablerow.cjs.entry.js.map +0 -1
- package/dist/collection/components/nv-datagridbody/nv-datagridbody.css +0 -0
- package/dist/collection/components/nv-datagridbody/nv-datagridbody.docs.js +0 -8
- package/dist/collection/components/nv-datagridbody/nv-datagridbody.docs.js.map +0 -1
- package/dist/collection/components/nv-datagridbody/nv-datagridbody.js +0 -23
- package/dist/collection/components/nv-datagridbody/nv-datagridbody.js.map +0 -1
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.css +0 -0
- package/dist/collection/components/nv-datagriddatacell/nv-datagriddatacell.css +0 -0
- package/dist/collection/components/nv-datagriddatacell/nv-datagriddatacell.docs.js +0 -6
- package/dist/collection/components/nv-datagriddatacell/nv-datagriddatacell.docs.js.map +0 -1
- package/dist/collection/components/nv-datagriddatacell/nv-datagriddatacell.js +0 -50
- package/dist/collection/components/nv-datagriddatacell/nv-datagriddatacell.js.map +0 -1
- package/dist/collection/components/nv-datagridhead/nv-datagridhead.css +0 -0
- package/dist/collection/components/nv-datagridhead/nv-datagridhead.docs.js +0 -8
- package/dist/collection/components/nv-datagridhead/nv-datagridhead.docs.js.map +0 -1
- package/dist/collection/components/nv-datagridhead/nv-datagridhead.js +0 -23
- package/dist/collection/components/nv-datagridhead/nv-datagridhead.js.map +0 -1
- package/dist/collection/components/nv-datagridrow/nv-datagridrow.css +0 -0
- package/dist/collection/components/nv-datagridrow/nv-datagridrow.docs.js +0 -8
- package/dist/collection/components/nv-datagridrow/nv-datagridrow.docs.js.map +0 -1
- package/dist/collection/components/nv-datagridrow/nv-datagridrow.js +0 -23
- package/dist/collection/components/nv-datagridrow/nv-datagridrow.js.map +0 -1
- package/dist/collection/components/nv-tablebody/nv-tablebody.css +0 -0
- package/dist/collection/components/nv-tablebody/nv-tablebody.docs.js +0 -8
- package/dist/collection/components/nv-tablebody/nv-tablebody.docs.js.map +0 -1
- package/dist/collection/components/nv-tablebody/nv-tablebody.js +0 -23
- package/dist/collection/components/nv-tablebody/nv-tablebody.js.map +0 -1
- package/dist/collection/components/nv-tablecolumn/nv-tablecolumn.css +0 -0
- package/dist/collection/components/nv-tabledatacell/nv-tabledatacell.css +0 -0
- package/dist/collection/components/nv-tabledatacell/nv-tabledatacell.docs.js +0 -6
- package/dist/collection/components/nv-tabledatacell/nv-tabledatacell.docs.js.map +0 -1
- package/dist/collection/components/nv-tabledatacell/nv-tabledatacell.js +0 -116
- package/dist/collection/components/nv-tabledatacell/nv-tabledatacell.js.map +0 -1
- package/dist/collection/components/nv-tablehead/nv-tablehead.css +0 -0
- package/dist/collection/components/nv-tablehead/nv-tablehead.docs.js +0 -8
- package/dist/collection/components/nv-tablehead/nv-tablehead.docs.js.map +0 -1
- package/dist/collection/components/nv-tablehead/nv-tablehead.js +0 -23
- package/dist/collection/components/nv-tablehead/nv-tablehead.js.map +0 -1
- package/dist/collection/components/nv-tablerow/nv-tablerow.css +0 -0
- package/dist/collection/components/nv-tablerow/nv-tablerow.docs.js +0 -8
- package/dist/collection/components/nv-tablerow/nv-tablerow.docs.js.map +0 -1
- package/dist/collection/components/nv-tablerow/nv-tablerow.js +0 -23
- package/dist/collection/components/nv-tablerow/nv-tablerow.js.map +0 -1
- package/dist/components/nv-datagridbody.d.ts +0 -11
- package/dist/components/nv-datagridbody.js +0 -38
- package/dist/components/nv-datagridbody.js.map +0 -1
- package/dist/components/nv-datagriddatacell.d.ts +0 -11
- package/dist/components/nv-datagriddatacell.js +0 -41
- package/dist/components/nv-datagriddatacell.js.map +0 -1
- package/dist/components/nv-datagridhead.d.ts +0 -11
- package/dist/components/nv-datagridhead.js +0 -38
- package/dist/components/nv-datagridhead.js.map +0 -1
- package/dist/components/nv-datagridrow.d.ts +0 -11
- package/dist/components/nv-datagridrow.js +0 -38
- package/dist/components/nv-datagridrow.js.map +0 -1
- package/dist/components/nv-tablebody.d.ts +0 -11
- package/dist/components/nv-tablebody.js +0 -38
- package/dist/components/nv-tablebody.js.map +0 -1
- package/dist/components/nv-tabledatacell.d.ts +0 -11
- package/dist/components/nv-tabledatacell.js +0 -61
- package/dist/components/nv-tabledatacell.js.map +0 -1
- package/dist/components/nv-tablehead.d.ts +0 -11
- package/dist/components/nv-tablehead.js +0 -38
- package/dist/components/nv-tablehead.js.map +0 -1
- package/dist/components/nv-tablerow.d.ts +0 -11
- package/dist/components/nv-tablerow.js +0 -38
- package/dist/components/nv-tablerow.js.map +0 -1
- package/dist/components/p-17b6705f.js.map +0 -1
- package/dist/components/p-5f5e2bf2.js.map +0 -1
- package/dist/components/p-8d7a57d1.js.map +0 -1
- package/dist/components/p-fd65c51f.js.map +0 -1
- package/dist/esm/constants-8243d2ea.js.map +0 -1
- package/dist/esm/nv-datagridbody.entry.js +0 -20
- package/dist/esm/nv-datagridbody.entry.js.map +0 -1
- package/dist/esm/nv-datagriddatacell.entry.js +0 -21
- package/dist/esm/nv-datagriddatacell.entry.js.map +0 -1
- package/dist/esm/nv-datagridhead.entry.js +0 -20
- package/dist/esm/nv-datagridhead.entry.js.map +0 -1
- package/dist/esm/nv-datagridrow.entry.js +0 -20
- package/dist/esm/nv-datagridrow.entry.js.map +0 -1
- package/dist/esm/nv-tablebody.entry.js +0 -20
- package/dist/esm/nv-tablebody.entry.js.map +0 -1
- package/dist/esm/nv-tabledatacell.entry.js +0 -39
- package/dist/esm/nv-tabledatacell.entry.js.map +0 -1
- package/dist/esm/nv-tablehead.entry.js +0 -20
- package/dist/esm/nv-tablehead.entry.js.map +0 -1
- package/dist/esm/nv-tablerow.entry.js +0 -20
- package/dist/esm/nv-tablerow.entry.js.map +0 -1
- package/dist/native/p-1bae8cdd.entry.js +0 -13
- package/dist/native/p-1bae8cdd.entry.js.map +0 -1
- package/dist/native/p-1ca72f74.entry.js +0 -2
- package/dist/native/p-1ca72f74.entry.js.map +0 -1
- package/dist/native/p-3422397d.entry.js +0 -2
- package/dist/native/p-3422397d.entry.js.map +0 -1
- package/dist/native/p-3bfd5a30.entry.js +0 -2
- package/dist/native/p-4a7fa613.entry.js +0 -2
- package/dist/native/p-51e0c5d3.entry.js +0 -2
- package/dist/native/p-51e0c5d3.entry.js.map +0 -1
- package/dist/native/p-57513eb0.entry.js +0 -2
- package/dist/native/p-57513eb0.entry.js.map +0 -1
- package/dist/native/p-5851fbed.entry.js +0 -2
- package/dist/native/p-5851fbed.entry.js.map +0 -1
- package/dist/native/p-5f1a7e6e.entry.js +0 -2
- package/dist/native/p-7211a3cb.entry.js +0 -7
- package/dist/native/p-7211a3cb.entry.js.map +0 -1
- package/dist/native/p-79765c7d.entry.js +0 -2
- package/dist/native/p-79765c7d.entry.js.map +0 -1
- package/dist/native/p-8b323a15.entry.js +0 -2
- package/dist/native/p-8b323a15.entry.js.map +0 -1
- package/dist/native/p-9c8eadde.entry.js +0 -2
- package/dist/native/p-9c8eadde.entry.js.map +0 -1
- package/dist/native/p-bac62e20.entry.js.map +0 -1
- package/dist/native/p-beab7cbd.entry.js +0 -2
- package/dist/native/p-bfb6e22c.entry.js +0 -2
- package/dist/native/p-bfb6e22c.entry.js.map +0 -1
- package/dist/native/p-c29be15d.entry.js +0 -2
- package/dist/native/p-c29be15d.entry.js.map +0 -1
- package/dist/native/p-ef9b66d4.entry.js +0 -2
- package/dist/native/p-ef9b66d4.entry.js.map +0 -1
- package/dist/native/p-f867541d.entry.js +0 -2
- package/dist/native/p-f867541d.entry.js.map +0 -1
- package/dist/native/p-f954a077.entry.js +0 -2
- package/dist/native/p-f954a077.entry.js.map +0 -1
- package/dist/native/p-ff7eea0e.entry.js +0 -2
- package/dist/native/p-ff7eea0e.entry.js.map +0 -1
- package/dist/types/components/nv-datagridbody/nv-datagridbody.d.ts +0 -7
- package/dist/types/components/nv-datagridbody/nv-datagridbody.docs.d.ts +0 -4
- package/dist/types/components/nv-datagriddatacell/nv-datagriddatacell.d.ts +0 -14
- package/dist/types/components/nv-datagriddatacell/nv-datagriddatacell.docs.d.ts +0 -4
- package/dist/types/components/nv-datagridhead/nv-datagridhead.d.ts +0 -7
- package/dist/types/components/nv-datagridhead/nv-datagridhead.docs.d.ts +0 -4
- package/dist/types/components/nv-datagridrow/nv-datagridrow.d.ts +0 -7
- package/dist/types/components/nv-datagridrow/nv-datagridrow.docs.d.ts +0 -4
- package/dist/types/components/nv-tablebody/nv-tablebody.d.ts +0 -7
- package/dist/types/components/nv-tablebody/nv-tablebody.docs.d.ts +0 -4
- package/dist/types/components/nv-tabledatacell/nv-tabledatacell.d.ts +0 -30
- package/dist/types/components/nv-tabledatacell/nv-tabledatacell.docs.d.ts +0 -4
- package/dist/types/components/nv-tablehead/nv-tablehead.d.ts +0 -7
- package/dist/types/components/nv-tablehead/nv-tablehead.docs.d.ts +0 -4
- package/dist/types/components/nv-tablerow/nv-tablerow.d.ts +0 -7
- package/dist/types/components/nv-tablerow/nv-tablerow.docs.d.ts +0 -4
- package/dist/vscode-data.json +0 -4407
- /package/dist/native/{p-e1b22ca7.entry.js.map → p-0a2a9f8b.entry.js.map} +0 -0
- /package/dist/native/{p-46c9aa04.entry.js.map → p-12d08abc.entry.js.map} +0 -0
- /package/dist/native/{p-63c894f0.entry.js.map → p-15be3d96.entry.js.map} +0 -0
- /package/dist/native/{p-943a19a5.entry.js.map → p-184cd119.entry.js.map} +0 -0
- /package/dist/native/{p-2b99e720.entry.js.map → p-1a3d2a74.entry.js.map} +0 -0
- /package/dist/native/{p-3b2c7871.entry.js.map → p-359f0f53.entry.js.map} +0 -0
- /package/dist/native/{p-beab7cbd.entry.js.map → p-3be2c9a1.entry.js.map} +0 -0
- /package/dist/native/{p-fa33ec18.entry.js.map → p-491f4605.entry.js.map} +0 -0
- /package/dist/native/{p-39b4ec02.entry.js.map → p-554f7b44.entry.js.map} +0 -0
- /package/dist/native/{p-44e7e3e8.entry.js.map → p-69fb1c9d.entry.js.map} +0 -0
- /package/dist/native/{p-cba14168.entry.js.map → p-729c9d45.entry.js.map} +0 -0
- /package/dist/native/{p-6acbf729.entry.js.map → p-78f08578.entry.js.map} +0 -0
- /package/dist/native/{p-5f1a7e6e.entry.js.map → p-951baf95.entry.js.map} +0 -0
- /package/dist/native/{p-4eacd598.entry.js.map → p-cda56476.entry.js.map} +0 -0
- /package/dist/native/{p-dbb89408.entry.js.map → p-d1bf4d77.entry.js.map} +0 -0
- /package/dist/native/{p-b13b2663.entry.js.map → p-d7665a07.entry.js.map} +0 -0
- /package/dist/native/{p-833af1bf.entry.js.map → p-daeb7e22.entry.js.map} +0 -0
- /package/dist/native/{p-634b49fe.entry.js.map → p-e36e956b.entry.js.map} +0 -0
- /package/dist/native/{p-afc16010.entry.js.map → p-e9e77494.entry.js.map} +0 -0
- /package/dist/native/{p-0bf35abc.entry.js.map → p-edee1c1f.entry.js.map} +0 -0
- /package/dist/native/{p-4db7add6.entry.js.map → p-f1585fc2.entry.js.map} +0 -0
- /package/dist/native/{p-ac81e143.entry.js.map → p-f3579407.entry.js.map} +0 -0
- /package/dist/native/{p-2151f564.entry.js.map → p-fde56f9c.entry.js.map} +0 -0
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { h, Host, } from "@stencil/core";
|
|
3
3
|
import { createTable, getCoreRowModel, createColumnHelper, } from "@tanstack/table-core";
|
|
4
|
+
import { deepCopyElement, excludedProps } from "../../utils/dom.utils";
|
|
4
5
|
/**
|
|
5
6
|
* A flexible data grid component powered by `@tanstack/table-core`.
|
|
6
7
|
* @slot default - Use this slot to insert HTML into the data grid content.
|
|
7
|
-
* @slot head - Use this slot to insert HTML into the data grid header.
|
|
8
8
|
* @slot before - Use this slot to insert HTML before the data grid.
|
|
9
9
|
* @slot after - Use this slot to insert HTML after the data grid.
|
|
10
|
-
* @slot body - Use this slot to insert HTML into the data grid body.
|
|
11
10
|
*
|
|
12
11
|
* @deprecated [EXPERIMENTAL]
|
|
13
12
|
* @experimental - This component is still under development and is not ready for use.
|
|
14
13
|
*/
|
|
15
14
|
export class NvDatagrid {
|
|
16
15
|
constructor() {
|
|
16
|
+
this.templateCache = new Map();
|
|
17
|
+
this.headerTemplateCache = new Map();
|
|
17
18
|
/****************************************************************************/
|
|
18
19
|
//#region STATES
|
|
19
20
|
this.table = null;
|
|
20
21
|
this.parsedColumns = []; // Parsed array
|
|
21
22
|
this.parsedData = []; // Parsed array
|
|
22
|
-
this.hasSlotHead = false;
|
|
23
|
-
this.hasSlotBody = false;
|
|
24
23
|
//#endregion STATES
|
|
25
24
|
/****************************************************************************/
|
|
26
25
|
//#region PROPERTIES
|
|
26
|
+
/**
|
|
27
|
+
* The data to display in the data grid.
|
|
28
|
+
* @example [{ "name": "Alice", "age": 25 }, { "name": "Bob", "age": 30 }]
|
|
29
|
+
* @default []
|
|
30
|
+
*/
|
|
31
|
+
this.data = [];
|
|
27
32
|
/**
|
|
28
33
|
* The columns to display in the data grid.
|
|
29
34
|
* @example
|
|
@@ -36,11 +41,10 @@ export class NvDatagrid {
|
|
|
36
41
|
*/
|
|
37
42
|
this.columns = [];
|
|
38
43
|
/**
|
|
39
|
-
*
|
|
40
|
-
* @
|
|
41
|
-
* @default []
|
|
44
|
+
* Fallback value to be displayed when data is not available
|
|
45
|
+
* @default 'N/A'
|
|
42
46
|
*/
|
|
43
|
-
this.
|
|
47
|
+
this.fallbackValue = 'N/A';
|
|
44
48
|
/**
|
|
45
49
|
* The message to display when there is no data available.
|
|
46
50
|
* @default 'No data available'
|
|
@@ -54,39 +58,94 @@ export class NvDatagrid {
|
|
|
54
58
|
}
|
|
55
59
|
//#endregion PROPERTIES
|
|
56
60
|
/****************************************************************************/
|
|
57
|
-
//#region
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
//#region METHODS
|
|
62
|
+
/**
|
|
63
|
+
* Caches templates for cells and headers upfront to improve performance.
|
|
64
|
+
*/
|
|
65
|
+
cacheTemplates() {
|
|
66
|
+
const columns = Array.from(this.el.querySelectorAll('nv-datagridcolumn'));
|
|
67
|
+
columns.forEach((col) => {
|
|
68
|
+
const key = col.accessor;
|
|
69
|
+
const cellSlot = col.querySelector('[slot="cell"]');
|
|
70
|
+
if (cellSlot) {
|
|
71
|
+
const element = deepCopyElement(cellSlot);
|
|
72
|
+
this.templateCache.set(key, element);
|
|
73
|
+
}
|
|
74
|
+
const headerSlot = col.querySelector('[slot="header"]');
|
|
75
|
+
if (headerSlot) {
|
|
76
|
+
const element = deepCopyElement(headerSlot);
|
|
77
|
+
this.headerTemplateCache.set(key, element);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const header = col.header;
|
|
81
|
+
if (header) {
|
|
82
|
+
const headerDiv = document.createElement('div');
|
|
83
|
+
headerDiv.textContent = header;
|
|
84
|
+
this.headerTemplateCache.set(key, headerDiv);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
});
|
|
60
88
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
this.parseColumnsArray(newItems, this.parsedColumns);
|
|
89
|
+
parseDataAndColumns() {
|
|
90
|
+
if (this.dataJson) {
|
|
91
|
+
this.parseJsonData(this.dataJson);
|
|
65
92
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
93
|
+
else if (this.data && this.data.length > 0) {
|
|
94
|
+
this.parseDataArray(this.data, this.parsedData);
|
|
95
|
+
}
|
|
96
|
+
if (this.columnsJson) {
|
|
97
|
+
this.parseJsonColumns(this.columnsJson, this.parsedColumns);
|
|
98
|
+
}
|
|
99
|
+
else if (this.columns && this.columns.length > 0) {
|
|
100
|
+
this.parseColumnsArray(this.columns, this.parsedColumns);
|
|
101
|
+
}
|
|
102
|
+
else if (this.headerTemplateCache.size > 0) {
|
|
103
|
+
const headerKeys = Array.from(this.headerTemplateCache.keys());
|
|
104
|
+
const arrayColumnsConfig = headerKeys.map(key => (Object.assign({}, { accessor: key, header: key ? key.charAt(0).toUpperCase() + key.slice(1) : '' })));
|
|
105
|
+
this.parseColumnsArray(arrayColumnsConfig, this.parsedColumns);
|
|
106
|
+
}
|
|
107
|
+
else if (this.parsedData.length > 0) {
|
|
108
|
+
const firstRow = this.parsedData[0];
|
|
109
|
+
const arrayColumnsConfig = Object.keys(firstRow).map(key => ({
|
|
110
|
+
accessor: key,
|
|
111
|
+
header: key.charAt(0).toUpperCase() + key.slice(1),
|
|
112
|
+
}));
|
|
113
|
+
this.parseColumnsArray(arrayColumnsConfig, this.parsedColumns);
|
|
69
114
|
}
|
|
70
115
|
}
|
|
71
|
-
|
|
72
|
-
|
|
116
|
+
deepEqual(a, b) {
|
|
117
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
73
118
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Parses the data array and sets the state accordingly
|
|
121
|
+
* @param {any[]} newValue - The new value of the data array.
|
|
122
|
+
* @param {any[]} oldValue - The old value of the data array.
|
|
123
|
+
*/
|
|
124
|
+
parseDataArray(newValue, oldValue) {
|
|
125
|
+
// Ensure both are arrays for proper comparison
|
|
126
|
+
const safeNewValue = Array.isArray(newValue) ? newValue : [];
|
|
127
|
+
const safeOldValue = Array.isArray(oldValue) ? oldValue : [];
|
|
128
|
+
if (this.deepEqual(safeNewValue, safeOldValue)) {
|
|
129
|
+
return; // Deep comparison
|
|
82
130
|
}
|
|
131
|
+
this.parsedData = Array.isArray(newValue) ? newValue : [];
|
|
83
132
|
}
|
|
84
|
-
|
|
85
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Parses the columns array and sets the state accordingly
|
|
135
|
+
* @param {Column[]} newValue - The new value of the columns array.
|
|
136
|
+
* @param {Column[]} oldValue - The old value of the columns array.
|
|
137
|
+
*/
|
|
138
|
+
parseColumnsArray(newValue, oldValue) {
|
|
139
|
+
// Ensure both are arrays for proper comparison
|
|
140
|
+
const safeNewValue = Array.isArray(newValue) ? newValue : [];
|
|
141
|
+
const safeOldValue = Array.isArray(oldValue) ? oldValue : [];
|
|
142
|
+
// Use a proper deep comparison function (e.g., Lodash's isEqual)
|
|
143
|
+
if (this.deepEqual(safeNewValue, safeOldValue)) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
// Assign only after confirming changes
|
|
147
|
+
this.parsedColumns = safeNewValue;
|
|
86
148
|
}
|
|
87
|
-
//#endregion WATCHERS
|
|
88
|
-
/****************************************************************************/
|
|
89
|
-
//#region METHODS
|
|
90
149
|
initializeTable() {
|
|
91
150
|
// Clear the previous table instance (if any)
|
|
92
151
|
this.table = null;
|
|
@@ -121,172 +180,270 @@ export class NvDatagrid {
|
|
|
121
180
|
}, // Default: no column sizing info
|
|
122
181
|
},
|
|
123
182
|
};
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
cell: info => info.getValue(),
|
|
134
|
-
}));
|
|
135
|
-
}
|
|
136
|
-
else if (tableOptions.data && tableOptions.data.length > 0) {
|
|
137
|
-
// Generate columns from data keys
|
|
138
|
-
const sampleRow = tableOptions.data[0];
|
|
139
|
-
return Object.keys(sampleRow).map(key => columnHelper.accessor(key, {
|
|
140
|
-
header: key.charAt(0).toUpperCase() + key.slice(1), // Capitalize key for header
|
|
141
|
-
cell: info => info.getValue(),
|
|
142
|
-
}));
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
183
|
+
if (this.parsedColumns.length > 0) {
|
|
184
|
+
// Validate and generate column definitions
|
|
185
|
+
const validColumns = this.parsedColumns.filter(column => (column === null || column === void 0 ? void 0 : column.accessor) && (column === null || column === void 0 ? void 0 : column.header));
|
|
186
|
+
// Update tableOptions based on parsed data and columns
|
|
187
|
+
const hasColumns = validColumns && Array.isArray(validColumns) && validColumns.length > 0;
|
|
188
|
+
const hasData = this.parsedData &&
|
|
189
|
+
Array.isArray(this.parsedData) &&
|
|
190
|
+
this.parsedData.length > 0;
|
|
191
|
+
if (!hasColumns && !hasData) {
|
|
145
192
|
// No columns and no data
|
|
146
|
-
return [];
|
|
147
193
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
if (this.parsedData &&
|
|
151
|
-
Array.isArray(this.parsedData) &&
|
|
152
|
-
this.parsedData.length > 0) {
|
|
153
|
-
return [...this.parsedData];
|
|
194
|
+
else if (hasColumns && !hasData) {
|
|
195
|
+
tableOptions.columns = this.generateColumns(validColumns, tableOptions);
|
|
154
196
|
}
|
|
155
197
|
else {
|
|
156
|
-
|
|
198
|
+
// Both columns and data are available
|
|
199
|
+
// No columns and data is available
|
|
200
|
+
tableOptions.data = this.getTableData();
|
|
201
|
+
tableOptions.columns = this.generateColumns(validColumns, tableOptions);
|
|
157
202
|
}
|
|
158
|
-
}
|
|
159
|
-
//
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
if (
|
|
203
|
+
}
|
|
204
|
+
// Initialize the table
|
|
205
|
+
this.table = createTable(tableOptions);
|
|
206
|
+
}
|
|
207
|
+
// Helper function to generate column definitions
|
|
208
|
+
generateColumns(validColumns, tableOptions) {
|
|
209
|
+
const columnHelper = createColumnHelper();
|
|
210
|
+
if (validColumns.length > 0) {
|
|
211
|
+
// Use defined columns
|
|
212
|
+
return validColumns.map(column => columnHelper.accessor(column.accessor, {
|
|
213
|
+
header: column.header,
|
|
214
|
+
cell: info => info.getValue(),
|
|
215
|
+
}));
|
|
216
|
+
}
|
|
217
|
+
else if (tableOptions.data && tableOptions.data.length > 0) {
|
|
218
|
+
// Generate columns from data keys
|
|
219
|
+
const sampleRow = tableOptions.data[0];
|
|
220
|
+
return Object.keys(sampleRow).map(key => columnHelper.accessor(key, {
|
|
221
|
+
header: key.charAt(0).toUpperCase() + key.slice(1), // Capitalize key for header
|
|
222
|
+
cell: info => info.getValue(),
|
|
223
|
+
}));
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
166
226
|
// No columns and no data
|
|
227
|
+
return [];
|
|
167
228
|
}
|
|
168
|
-
|
|
169
|
-
|
|
229
|
+
}
|
|
230
|
+
getTableData() {
|
|
231
|
+
if (this.parsedData &&
|
|
232
|
+
Array.isArray(this.parsedData) &&
|
|
233
|
+
this.parsedData.length > 0) {
|
|
234
|
+
return [...this.parsedData];
|
|
170
235
|
}
|
|
171
236
|
else {
|
|
172
|
-
|
|
173
|
-
// No columns and data is available
|
|
174
|
-
tableOptions.data = setTableData();
|
|
175
|
-
tableOptions.columns = generateColumns();
|
|
237
|
+
return [];
|
|
176
238
|
}
|
|
177
|
-
// Initialize the table
|
|
178
|
-
this.table = createTable(tableOptions);
|
|
179
239
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
240
|
+
renderTemplate(template, cellValue, row) {
|
|
241
|
+
if (!template) {
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
// Handle <template> elements correctly
|
|
245
|
+
const templateContent = template instanceof HTMLTemplateElement ? template.content : template;
|
|
246
|
+
const element = deepCopyElement(templateContent);
|
|
247
|
+
// Replace placeholders in text content, attributes, and properties
|
|
248
|
+
element.querySelectorAll('*').forEach(el => {
|
|
249
|
+
// Replace placeholders in text content
|
|
250
|
+
this.replacePlaceholdersTextContent(el, cellValue);
|
|
251
|
+
// Replace placeholders in attributes
|
|
252
|
+
this.replacePlaceholdersAttributes(el, cellValue);
|
|
253
|
+
// Replace placeholders in properties
|
|
254
|
+
this.replacePlaceholdersProperties(el, cellValue);
|
|
255
|
+
});
|
|
256
|
+
// Handle `data-bind-event`
|
|
257
|
+
element.querySelectorAll('[data-bind-event]').forEach(el => {
|
|
258
|
+
const bindEvent = el.getAttribute('data-bind-event') || '';
|
|
259
|
+
const splitted = bindEvent.split(':');
|
|
260
|
+
if (!bindEvent.includes(':') || splitted.length < 2) {
|
|
261
|
+
console.warn('Invalid data-bind-event format:', bindEvent);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
const eventType = splitted[0];
|
|
265
|
+
const keyAction = splitted[1];
|
|
266
|
+
const details = splitted.length > 2 ? splitted[2] : null;
|
|
267
|
+
el.addEventListener(eventType, () => {
|
|
268
|
+
var _a;
|
|
269
|
+
const keys = (_a = details === null || details === void 0 ? void 0 : details.split(',')) !== null && _a !== void 0 ? _a : [];
|
|
270
|
+
// Convert keys into a single object instead of an array of objects
|
|
271
|
+
const keyValue = keys.reduce((acc, key) => {
|
|
272
|
+
var _a;
|
|
273
|
+
if (row === null || row === void 0 ? void 0 : row.original) {
|
|
274
|
+
if (key in row.original) {
|
|
275
|
+
acc[key] = (_a = row.original) === null || _a === void 0 ? void 0 : _a[key];
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return acc;
|
|
279
|
+
}, {});
|
|
280
|
+
const action = { keyAction, details: keyValue };
|
|
281
|
+
this.action.emit(action);
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
// Ensure Web Components are properly connected
|
|
285
|
+
setTimeout(() => {
|
|
286
|
+
element.querySelectorAll('*').forEach(child => {
|
|
287
|
+
if (typeof child.connectedCallback === 'function') {
|
|
288
|
+
child.connectedCallback();
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}, 0);
|
|
292
|
+
return (h("div", { ref: el => {
|
|
293
|
+
if (el) {
|
|
294
|
+
el.innerHTML = ''; // Remove existing content
|
|
295
|
+
el.appendChild(element); // Append new element
|
|
296
|
+
}
|
|
297
|
+
} }));
|
|
189
298
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
299
|
+
replaceKeyWithValue(key, cellValue) {
|
|
300
|
+
var _a;
|
|
301
|
+
// Handle undefined or null values by returning the fallback
|
|
302
|
+
if (cellValue === undefined || cellValue === null) {
|
|
303
|
+
return this.fallbackValue;
|
|
304
|
+
}
|
|
305
|
+
// If cellValue is an object, attempt to retrieve the value
|
|
306
|
+
if (typeof cellValue === 'object') {
|
|
307
|
+
// Handle nested key paths (e.g., "user.name")
|
|
308
|
+
if (key.includes('.')) {
|
|
309
|
+
const resolvedValue = key.split('.').reduce((acc, keyPart) => {
|
|
310
|
+
if (acc && acc[keyPart] !== undefined) {
|
|
311
|
+
return acc[keyPart];
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
return undefined;
|
|
315
|
+
}
|
|
316
|
+
}, cellValue);
|
|
317
|
+
if (resolvedValue !== undefined) {
|
|
318
|
+
return String(resolvedValue);
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
const firstLevelKey = key.split('.')[0];
|
|
322
|
+
const rest = key.substring(firstLevelKey.length + 1);
|
|
323
|
+
const response = this.replaceKeyWithValue(rest, cellValue);
|
|
324
|
+
if (response !== this.fallbackValue) {
|
|
325
|
+
return response;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
// Handle single-level key lookup
|
|
330
|
+
return key in cellValue ? String(cellValue[key]) : this.fallbackValue;
|
|
331
|
+
}
|
|
332
|
+
// If cellValue is a primitive (string, number, boolean, etc.), return it as a string
|
|
333
|
+
return (_a = cellValue === null || cellValue === void 0 ? void 0 : cellValue.toString()) !== null && _a !== void 0 ? _a : this.fallbackValue;
|
|
334
|
+
}
|
|
335
|
+
replacePlaceholdersTextContent(element, cellValue) {
|
|
336
|
+
// ✅ Replace placeholders in text content
|
|
337
|
+
element.childNodes.forEach(node => {
|
|
338
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
339
|
+
node.textContent = node.textContent.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(key, cellValue));
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
replacePlaceholdersAttributes(element, cellValue) {
|
|
344
|
+
// ✅ Replace placeholders in attributes
|
|
345
|
+
Array.from(element.attributes).forEach(attr => {
|
|
346
|
+
if (attr.value.includes('__')) {
|
|
347
|
+
attr.value = attr.value.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(key, cellValue));
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
replacePlaceholdersProperties(element, cellValue) {
|
|
352
|
+
// ✅ Dynamically extract relevant properties
|
|
353
|
+
const properties = new Set();
|
|
354
|
+
// Collect only own enumerable properties
|
|
355
|
+
Object.keys(element).forEach(key => properties.add(key));
|
|
356
|
+
// Collect inherited properties from prototypes (HTMLElement -> Element -> Node)
|
|
357
|
+
let proto = Object.getPrototypeOf(element);
|
|
358
|
+
while (proto && proto !== HTMLElement.prototype) {
|
|
359
|
+
Object.keys(proto).forEach(key => properties.add(key));
|
|
360
|
+
proto = Object.getPrototypeOf(proto);
|
|
361
|
+
}
|
|
362
|
+
// ✅ Filter and copy only non-function properties and exclude irrelevant ones
|
|
363
|
+
properties.forEach(prop => {
|
|
364
|
+
if (typeof element[prop] !== 'function' && // Ignore methods
|
|
365
|
+
!prop.startsWith('on') && // Ignore event listeners (onclick, oninput, etc.)
|
|
366
|
+
!excludedProps.has(prop) // 🚨 Prevent text duplication and irrelevant props
|
|
367
|
+
) {
|
|
368
|
+
try {
|
|
369
|
+
const propValue = element[prop];
|
|
370
|
+
// ✅ Replace placeholders only if the value is a string
|
|
371
|
+
if (typeof propValue === 'string' && propValue.includes('__')) {
|
|
372
|
+
element[prop] = propValue.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(key, cellValue)); // ✅ TypeScript safe
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
catch (error) {
|
|
376
|
+
console.warn(`Could not assign property ${prop}:`, error.message);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
});
|
|
199
380
|
}
|
|
200
381
|
//#endregion METHODS
|
|
201
382
|
/****************************************************************************/
|
|
202
|
-
//#region
|
|
203
|
-
|
|
204
|
-
this.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
const mappedRows = headSlotRows.map(row => {
|
|
211
|
-
const cells = Array.from(row.querySelectorAll('nv-datagridcolumn'));
|
|
212
|
-
return cells.map(cell => ({
|
|
213
|
-
header: cell.getAttribute('header') || '',
|
|
214
|
-
accessor: cell.getAttribute('accessor') || '',
|
|
215
|
-
}));
|
|
216
|
-
});
|
|
217
|
-
// Flatten the nested arrays into a single array of columns
|
|
218
|
-
const flatMappedColumns = mappedRows.flat();
|
|
219
|
-
this.parsedColumns = flatMappedColumns;
|
|
220
|
-
}
|
|
221
|
-
this.hasSlotBody = !!this.el.querySelector('[slot="body"]');
|
|
222
|
-
if (this.hasSlotBody) {
|
|
223
|
-
const bodySlot = this.el.querySelector('[slot="body"]');
|
|
224
|
-
const bodySlotRows = this.hasSlotBody
|
|
225
|
-
? Array.from(bodySlot.querySelectorAll('nv-datagridrow'))
|
|
226
|
-
: [];
|
|
227
|
-
const mappedRows = bodySlotRows.map(row => {
|
|
228
|
-
const cells = Array.from(row.querySelectorAll('nv-datagriddatacell'));
|
|
229
|
-
return cells.map(cell => {
|
|
230
|
-
return {
|
|
231
|
-
accessor: cell.accessor,
|
|
232
|
-
value: cell.innerHTML,
|
|
233
|
-
};
|
|
234
|
-
});
|
|
235
|
-
});
|
|
236
|
-
// Flatten the nested arrays into a single array of data
|
|
237
|
-
const flatMappedData = mappedRows.map(row => row.reduce((acc, cell) => {
|
|
238
|
-
acc[cell.accessor] = cell.value;
|
|
239
|
-
return acc;
|
|
240
|
-
}, {}));
|
|
241
|
-
this.parsedData = flatMappedData;
|
|
242
|
-
}
|
|
243
|
-
if (this.columnsJson) {
|
|
244
|
-
this.parseJsonColumns(this.columnsJson);
|
|
383
|
+
//#region WATCHERS
|
|
384
|
+
parseColumns(newValue, oldValue = []) {
|
|
385
|
+
this.parseColumnsArray(newValue, oldValue);
|
|
386
|
+
}
|
|
387
|
+
parseJsonColumns(newValue, oldValue) {
|
|
388
|
+
try {
|
|
389
|
+
const newItems = newValue ? JSON.parse(newValue) : [];
|
|
390
|
+
this.parseColumnsArray(newItems, oldValue);
|
|
245
391
|
}
|
|
246
|
-
|
|
247
|
-
|
|
392
|
+
catch (e) {
|
|
393
|
+
console.error('Invalid JSON format for columnsJson:', e.message);
|
|
394
|
+
this.parsedColumns = [];
|
|
248
395
|
}
|
|
249
|
-
|
|
250
|
-
|
|
396
|
+
}
|
|
397
|
+
parseData(newValue, oldValue = []) {
|
|
398
|
+
this.parseDataArray(newValue, oldValue);
|
|
399
|
+
}
|
|
400
|
+
parseJsonData(newValue) {
|
|
401
|
+
try {
|
|
402
|
+
const newItems = newValue ? JSON.parse(newValue) : [];
|
|
403
|
+
this.parseDataArray(newItems, this.parsedData);
|
|
251
404
|
}
|
|
252
|
-
|
|
253
|
-
|
|
405
|
+
catch (e) {
|
|
406
|
+
console.error('Invalid JSON format for dataJson:', e.message);
|
|
407
|
+
this.parsedData = [];
|
|
254
408
|
}
|
|
255
409
|
}
|
|
256
|
-
|
|
410
|
+
handleParsedChange() {
|
|
257
411
|
this.initializeTable();
|
|
258
412
|
}
|
|
259
|
-
//#endregion
|
|
413
|
+
//#endregion WATCHERS
|
|
414
|
+
/****************************************************************************/
|
|
415
|
+
//#region LIFECYCLE
|
|
416
|
+
componentWillLoad() {
|
|
417
|
+
this.cacheTemplates();
|
|
418
|
+
this.parseDataAndColumns();
|
|
419
|
+
}
|
|
420
|
+
//#endregion EVENTS
|
|
260
421
|
/****************************************************************************/
|
|
261
422
|
//#region RENDER
|
|
262
423
|
render() {
|
|
263
424
|
var _a, _b, _c;
|
|
264
|
-
const headerGroups = !this.table ||
|
|
265
|
-
this.table === undefined ||
|
|
266
|
-
(this.parsedColumns.length === 0 && !this.hasSlotHead)
|
|
425
|
+
const headerGroups = !this.table || this.table === undefined || this.parsedColumns.length === 0
|
|
267
426
|
? []
|
|
268
427
|
: (_a = this.table) === null || _a === void 0 ? void 0 : _a.getHeaderGroups();
|
|
269
|
-
const rows = !this.table ||
|
|
270
|
-
this.table === undefined ||
|
|
271
|
-
(this.parsedData.length === 0 && !this.hasSlotBody)
|
|
428
|
+
const rows = !this.table || this.table === undefined || this.parsedData.length === 0
|
|
272
429
|
? []
|
|
273
430
|
: (_c = (_b = this.table) === null || _b === void 0 ? void 0 : _b.getRowModel()) === null || _c === void 0 ? void 0 : _c.rows;
|
|
274
|
-
return (h(Host, { key: '
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
: null)), h("tbody", null, !rows || rows.length === 0 ? (h("tr", null, h("td", { colSpan: this.parsedColumns.length || 12 }, this.noDataMessage))) : (rows.map(row => {
|
|
431
|
+
return (h(Host, { key: '03dc8123cf740c6b5eeb59f10443a2ec1b279f28' }, h("div", { key: '263fef353246dba3adb0a44b4e80ff5a4c2e97eb', class: "hidden" }, h("slot", { key: '3d2f02044ad8e09fb010cb0486f63b48e1048acf' })), h("slot", { key: 'e5b458c755eb6887d1fdb959b8883f4d48c5b2f9', name: "before" }), this.parsedColumns.length === 0 && this.parsedData.length === 0 ? (h("div", { class: "no-data" }, this.noColumnsNoDataMessage)) : (h("table", null, this.parsedColumns.length > 0 && headerGroups.length > 0 && (h("thead", null, this.parsedColumns.length > 0 && headerGroups
|
|
432
|
+
? headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map(headerGroup => (h("tr", { key: headerGroup.id }, headerGroup.headers.map(header => {
|
|
433
|
+
return (h("th", { key: header.id }, header.isPlaceholder
|
|
434
|
+
? null
|
|
435
|
+
: this.renderTemplate(this.headerTemplateCache.get(header.id), {}) || header.column.columnDef.header));
|
|
436
|
+
}))))
|
|
437
|
+
: 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 => {
|
|
282
438
|
const rowId = row.id;
|
|
283
439
|
const visibleCells = row === null || row === void 0 ? void 0 : row.getVisibleCells();
|
|
284
|
-
|
|
440
|
+
return (h("tr", { key: rowId }, visibleCells.map(cell => {
|
|
441
|
+
const cellAccessors = cell.column.id;
|
|
285
442
|
const cellValue = cell.getValue();
|
|
286
|
-
return
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}))))), h("slot", { key: '
|
|
443
|
+
return (h("td", { key: cell.id, "data-row-id": rowId }, this.renderTemplate(this.templateCache.get(cellAccessors), cellValue, row) ||
|
|
444
|
+
(cellValue !== null && cellValue !== void 0 ? cellValue : this.fallbackValue)));
|
|
445
|
+
})));
|
|
446
|
+
}))))), h("slot", { key: 'e80f9b8a5dbda4c05b719a99c173e2f106449668', name: "after" })));
|
|
290
447
|
}
|
|
291
448
|
static get is() { return "nv-datagrid"; }
|
|
292
449
|
static get originalStyleUrls() {
|
|
@@ -301,6 +458,30 @@ export class NvDatagrid {
|
|
|
301
458
|
}
|
|
302
459
|
static get properties() {
|
|
303
460
|
return {
|
|
461
|
+
"data": {
|
|
462
|
+
"type": "unknown",
|
|
463
|
+
"mutable": false,
|
|
464
|
+
"complexType": {
|
|
465
|
+
"original": "any[]",
|
|
466
|
+
"resolved": "any[]",
|
|
467
|
+
"references": {}
|
|
468
|
+
},
|
|
469
|
+
"required": false,
|
|
470
|
+
"optional": false,
|
|
471
|
+
"docs": {
|
|
472
|
+
"tags": [{
|
|
473
|
+
"name": "example",
|
|
474
|
+
"text": "[{ \"name\": \"Alice\", \"age\": 25 }, { \"name\": \"Bob\", \"age\": 30 }]"
|
|
475
|
+
}, {
|
|
476
|
+
"name": "default",
|
|
477
|
+
"text": "[]"
|
|
478
|
+
}],
|
|
479
|
+
"text": "The data to display in the data grid."
|
|
480
|
+
},
|
|
481
|
+
"getter": false,
|
|
482
|
+
"setter": false,
|
|
483
|
+
"defaultValue": "[]"
|
|
484
|
+
},
|
|
304
485
|
"columns": {
|
|
305
486
|
"type": "unknown",
|
|
306
487
|
"mutable": false,
|
|
@@ -331,7 +512,7 @@ export class NvDatagrid {
|
|
|
331
512
|
"setter": false,
|
|
332
513
|
"defaultValue": "[]"
|
|
333
514
|
},
|
|
334
|
-
"
|
|
515
|
+
"dataJson": {
|
|
335
516
|
"type": "string",
|
|
336
517
|
"mutable": false,
|
|
337
518
|
"complexType": {
|
|
@@ -344,40 +525,38 @@ export class NvDatagrid {
|
|
|
344
525
|
"docs": {
|
|
345
526
|
"tags": [{
|
|
346
527
|
"name": "example",
|
|
347
|
-
"text": "`[{\"
|
|
528
|
+
"text": "`[{ \"name\": \"Alice\", \"age\": 25 }, { \"name\": \"Bob\", \"age\": 30 }]`"
|
|
348
529
|
}],
|
|
349
|
-
"text": "The
|
|
530
|
+
"text": "The data to display in the data grid.\nIt can be passed directly as an array of objects or as a JSON string.\nIf both `data` and `dataJson` are provided, `data` takes precedence."
|
|
350
531
|
},
|
|
351
532
|
"getter": false,
|
|
352
533
|
"setter": false,
|
|
353
|
-
"attribute": "
|
|
534
|
+
"attribute": "data-json",
|
|
354
535
|
"reflect": true
|
|
355
536
|
},
|
|
356
|
-
"
|
|
357
|
-
"type": "
|
|
537
|
+
"columnsJson": {
|
|
538
|
+
"type": "string",
|
|
358
539
|
"mutable": false,
|
|
359
540
|
"complexType": {
|
|
360
|
-
"original": "
|
|
361
|
-
"resolved": "
|
|
541
|
+
"original": "string",
|
|
542
|
+
"resolved": "string",
|
|
362
543
|
"references": {}
|
|
363
544
|
},
|
|
364
545
|
"required": false,
|
|
365
|
-
"optional":
|
|
546
|
+
"optional": true,
|
|
366
547
|
"docs": {
|
|
367
548
|
"tags": [{
|
|
368
549
|
"name": "example",
|
|
369
|
-
"text": "[{
|
|
370
|
-
}, {
|
|
371
|
-
"name": "default",
|
|
372
|
-
"text": "[]"
|
|
550
|
+
"text": "`[{\"header\":\"Name\",\"accessor\":\"name\"},{\"header\":\"Age\",\"accessor\":\"age\"},{\"header\":\"Email\",\"accessor\":\"email\"}]`"
|
|
373
551
|
}],
|
|
374
|
-
"text": "The
|
|
552
|
+
"text": "The columns to display in the data grid.\nIt can be passed directly as an array of objects or as a JSON string.\nIf both `columns` and `columnsJson` are provided, `columns` takes precedence."
|
|
375
553
|
},
|
|
376
554
|
"getter": false,
|
|
377
555
|
"setter": false,
|
|
378
|
-
"
|
|
556
|
+
"attribute": "columns-json",
|
|
557
|
+
"reflect": true
|
|
379
558
|
},
|
|
380
|
-
"
|
|
559
|
+
"fallbackValue": {
|
|
381
560
|
"type": "string",
|
|
382
561
|
"mutable": false,
|
|
383
562
|
"complexType": {
|
|
@@ -386,18 +565,19 @@ export class NvDatagrid {
|
|
|
386
565
|
"references": {}
|
|
387
566
|
},
|
|
388
567
|
"required": false,
|
|
389
|
-
"optional":
|
|
568
|
+
"optional": false,
|
|
390
569
|
"docs": {
|
|
391
570
|
"tags": [{
|
|
392
|
-
"name": "
|
|
393
|
-
"text": "
|
|
571
|
+
"name": "default",
|
|
572
|
+
"text": "'N/A'"
|
|
394
573
|
}],
|
|
395
|
-
"text": "
|
|
574
|
+
"text": "Fallback value to be displayed when data is not available"
|
|
396
575
|
},
|
|
397
576
|
"getter": false,
|
|
398
577
|
"setter": false,
|
|
399
|
-
"attribute": "
|
|
400
|
-
"reflect": true
|
|
578
|
+
"attribute": "fallback-value",
|
|
579
|
+
"reflect": true,
|
|
580
|
+
"defaultValue": "'N/A'"
|
|
401
581
|
},
|
|
402
582
|
"noDataMessage": {
|
|
403
583
|
"type": "string",
|
|
@@ -419,7 +599,7 @@ export class NvDatagrid {
|
|
|
419
599
|
"getter": false,
|
|
420
600
|
"setter": false,
|
|
421
601
|
"attribute": "no-data-message",
|
|
422
|
-
"reflect":
|
|
602
|
+
"reflect": true,
|
|
423
603
|
"defaultValue": "'No data available'"
|
|
424
604
|
},
|
|
425
605
|
"noColumnsNoDataMessage": {
|
|
@@ -442,7 +622,7 @@ export class NvDatagrid {
|
|
|
442
622
|
"getter": false,
|
|
443
623
|
"setter": false,
|
|
444
624
|
"attribute": "no-columns-no-data-message",
|
|
445
|
-
"reflect":
|
|
625
|
+
"reflect": true,
|
|
446
626
|
"defaultValue": "'No data or columns available to display.'"
|
|
447
627
|
}
|
|
448
628
|
};
|
|
@@ -451,11 +631,33 @@ export class NvDatagrid {
|
|
|
451
631
|
return {
|
|
452
632
|
"table": {},
|
|
453
633
|
"parsedColumns": {},
|
|
454
|
-
"parsedData": {}
|
|
455
|
-
"hasSlotHead": {},
|
|
456
|
-
"hasSlotBody": {}
|
|
634
|
+
"parsedData": {}
|
|
457
635
|
};
|
|
458
636
|
}
|
|
637
|
+
static get events() {
|
|
638
|
+
return [{
|
|
639
|
+
"method": "action",
|
|
640
|
+
"name": "action",
|
|
641
|
+
"bubbles": true,
|
|
642
|
+
"cancelable": true,
|
|
643
|
+
"composed": true,
|
|
644
|
+
"docs": {
|
|
645
|
+
"tags": [],
|
|
646
|
+
"text": "*************************************************************************"
|
|
647
|
+
},
|
|
648
|
+
"complexType": {
|
|
649
|
+
"original": "ActionEvent",
|
|
650
|
+
"resolved": "ActionEvent",
|
|
651
|
+
"references": {
|
|
652
|
+
"ActionEvent": {
|
|
653
|
+
"location": "import",
|
|
654
|
+
"path": "../../interfaces/actionEvent",
|
|
655
|
+
"id": "src/interfaces/actionEvent.tsx::ActionEvent"
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}];
|
|
660
|
+
}
|
|
459
661
|
static get elementRef() { return "el"; }
|
|
460
662
|
static get watchers() {
|
|
461
663
|
return [{
|