@nova-design-system/nova-webcomponents 3.24.0 → 3.26.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/_commonjsHelpers-CFO10eej.js +0 -3
- package/dist/cjs/clsx-BtxeOLZW.js +0 -3
- package/dist/cjs/collapse.animation-CcG0GAWk.js +0 -3
- package/dist/cjs/constants-BugGJYqL.js +0 -3
- package/dist/cjs/dom.utils-8VY5SfMZ.js +177 -0
- package/dist/cjs/events.utils-BE6R5q9C.js +0 -3
- package/dist/cjs/fade.animation-BQSqXXOJ.js +0 -3
- package/dist/cjs/grow.animation-ynu_HmA_.js +0 -3
- package/dist/cjs/i18n.utils-BbKpUgYq.js +77 -0
- package/dist/cjs/index-BQjqJTJB.js +4832 -0
- package/dist/cjs/index.cjs.js +54 -3
- package/dist/cjs/index.esm-CG1TVKfu.js +0 -3
- package/dist/cjs/inputmask-DtXnpVWa.js +0 -3
- package/dist/cjs/loader.cjs.js +3 -5
- package/dist/cjs/native.cjs.js +32 -7
- package/dist/cjs/nv-accordion-item.cjs.entry.js +8 -8
- package/dist/cjs/nv-accordion.cjs.entry.js +10 -9
- package/dist/cjs/nv-alert.cjs.entry.js +6 -5
- package/dist/cjs/nv-avatar.cjs.entry.js +3 -4
- package/dist/cjs/nv-badge_2.cjs.entry.js +18 -12
- package/dist/cjs/nv-breadcrumb.cjs.entry.js +14 -12
- package/dist/cjs/nv-breadcrumbs.cjs.entry.js +4 -5
- package/dist/cjs/nv-button.cjs.entry.js +9 -6
- package/dist/cjs/nv-buttongroup.cjs.entry.js +12 -7
- package/dist/cjs/nv-calendar.cjs.entry.js +27 -20
- package/dist/cjs/nv-col.cjs.entry.js +3 -4
- package/dist/cjs/nv-datagrid.cjs.entry.js +47 -185
- package/dist/cjs/nv-datagridcolumn.cjs.entry.js +1 -2
- package/dist/cjs/nv-dialog.cjs.entry.js +19 -21
- package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +11 -30
- package/dist/cjs/nv-drawer.cjs.entry.js +19 -20
- package/dist/cjs/nv-drawerfooter_2.cjs.entry.js +11 -30
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +10 -9
- package/dist/cjs/nv-fielddate.cjs.entry.js +15 -14
- package/dist/cjs/nv-fielddaterange.cjs.entry.js +15 -15
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +32 -30
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +5 -9
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +27 -23
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +10 -9
- package/dist/cjs/nv-fieldpassword.cjs.entry.js +10 -9
- package/dist/cjs/nv-fieldradio.cjs.entry.js +9 -8
- package/dist/cjs/nv-fieldselect.cjs.entry.js +20 -13
- package/dist/cjs/nv-fieldslider.cjs.entry.js +33 -16
- package/dist/cjs/nv-fieldtext.cjs.entry.js +7 -8
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js +42 -35
- package/dist/cjs/nv-fieldtime.cjs.entry.js +15 -10
- package/dist/cjs/nv-icon.cjs.entry.js +4 -5
- package/dist/cjs/nv-iconbutton_2.cjs.entry.js +13 -10
- package/dist/cjs/nv-menu.cjs.entry.js +9 -14
- package/dist/cjs/nv-menuitem.cjs.entry.js +4 -6
- package/dist/cjs/nv-notification-bullet.cjs.entry.js +3 -4
- package/dist/cjs/nv-notification.cjs.entry.js +4 -5
- package/dist/cjs/nv-notificationcontainer.cjs.entry.js +4 -5
- package/dist/cjs/nv-paginationtable.cjs.entry.js +228 -0
- package/dist/cjs/nv-popover.cjs.entry.js +105 -34
- package/dist/cjs/nv-row.cjs.entry.js +4 -5
- package/dist/cjs/nv-sidebar.cjs.entry.js +10 -7
- package/dist/cjs/nv-sidebarcontent.cjs.entry.js +4 -5
- package/dist/cjs/nv-sidebardivider.cjs.entry.js +4 -5
- package/dist/cjs/nv-sidebarfooter.cjs.entry.js +4 -5
- package/dist/cjs/nv-sidebargroup.cjs.entry.js +4 -5
- package/dist/cjs/nv-sidebarheader.cjs.entry.js +4 -5
- package/dist/cjs/nv-sidebarlogo.cjs.entry.js +4 -5
- package/dist/cjs/nv-sidebarnavitem.cjs.entry.js +9 -8
- package/dist/cjs/nv-sidebarnavsubitem.cjs.entry.js +4 -5
- package/dist/cjs/nv-split.cjs.entry.js +10 -7
- package/dist/cjs/nv-stack.cjs.entry.js +4 -5
- package/dist/cjs/nv-table.cjs.entry.js +6 -5
- package/dist/cjs/nv-tableheader.cjs.entry.js +4 -5
- package/dist/cjs/nv-toggle.cjs.entry.js +8 -7
- package/dist/cjs/nv-togglebutton.cjs.entry.js +4 -6
- package/dist/cjs/nv-togglebuttongroup.cjs.entry.js +13 -10
- package/dist/cjs/nv-tooltip.cjs.entry.js +10 -10
- package/dist/cjs/slide.animation-Cb3tpLQv.js +0 -3
- package/dist/cjs/style-value-types.es-B1vLqX9m.js +0 -3
- package/dist/cjs/timeline.animation-KteJaZPb.js +0 -3
- package/dist/cjs/uri.utils-DiMLQx64.js +0 -3
- package/dist/cjs/v4-C1vaJ4yP.js +0 -3
- package/dist/cjs/{i18n.utils-ku0bScip.js → worker-client-ByL3TenE.js} +35 -78
- package/dist/collection/animations/collapse.animation.js +0 -1
- package/dist/collection/animations/fade.animation.js +0 -1
- package/dist/collection/animations/grow.animation.js +0 -1
- package/dist/collection/animations/index.js +0 -1
- package/dist/collection/animations/slide.animation.js +0 -1
- package/dist/collection/animations/timeline.animation.js +0 -1
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/nv-accordion/nv-accordion.docs.js +0 -1
- package/dist/collection/components/nv-accordion/nv-accordion.js +1 -4
- package/dist/collection/components/nv-accordion-item/nv-accordion-item.docs.js +0 -1
- package/dist/collection/components/nv-accordion-item/nv-accordion-item.js +2 -4
- package/dist/collection/components/nv-alert/nv-alert.docs.js +0 -1
- package/dist/collection/components/nv-alert/nv-alert.js +4 -3
- package/dist/collection/components/nv-avatar/nv-avatar.docs.js +0 -1
- package/dist/collection/components/nv-avatar/nv-avatar.js +2 -2
- package/dist/collection/components/nv-badge/nv-badge.css +4 -1
- package/dist/collection/components/nv-badge/nv-badge.docs.js +0 -1
- package/dist/collection/components/nv-badge/nv-badge.js +3 -2
- package/dist/collection/components/nv-breadcrumb/nv-breadcrumb.docs.js +0 -1
- package/dist/collection/components/nv-breadcrumb/nv-breadcrumb.js +12 -10
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.css +0 -3
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.docs.js +0 -1
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.js +1 -2
- package/dist/collection/components/nv-button/nv-button.docs.js +0 -1
- package/dist/collection/components/nv-button/nv-button.js +6 -4
- package/dist/collection/components/nv-buttongroup/nv-buttongroup.docs.js +0 -1
- package/dist/collection/components/nv-buttongroup/nv-buttongroup.js +4 -3
- package/dist/collection/components/nv-buttongroup/nv-buttongroup.utils.js +0 -1
- package/dist/collection/components/nv-buttongroup/styles/nv-buttongroup.css +4 -4
- package/dist/collection/components/nv-buttongroup/test/nv-buttongroup.utils.test.js +0 -1
- package/dist/collection/components/nv-calendar/nv-calendar.css +110 -1
- package/dist/collection/components/nv-calendar/nv-calendar.docs.js +0 -1
- package/dist/collection/components/nv-calendar/nv-calendar.js +9 -12
- package/dist/collection/components/nv-calendar/nv-calendar.utils.js +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-actions.js +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-grid.js +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-header.js +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-shortcuts.js +0 -1
- package/dist/collection/components/nv-calendar/partials/day-cell.js +0 -1
- package/dist/collection/components/nv-calendar/partials/index.js +0 -1
- package/dist/collection/components/nv-calendar/partials/week-numbers.js +0 -1
- package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js +0 -2
- package/dist/collection/components/nv-calendar/test/partials/calendar-actions.logic.test.js +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-grid.logic.test.js +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-header.logic.test.js +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-shortcuts.logic.test.js +0 -1
- package/dist/collection/components/nv-calendar/test/partials/day-cell.logic.test.js +0 -1
- package/dist/collection/components/nv-calendar/test/partials/week-numbers.logic.test.js +0 -1
- package/dist/collection/components/nv-col/nv-col.docs.js +0 -1
- package/dist/collection/components/nv-col/nv-col.js +0 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +0 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.js +6 -5
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.docs.js +0 -1
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js +0 -1
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js +0 -7
- package/dist/collection/components/nv-dialog/nv-dialog.js +17 -45
- package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.docs.js +0 -1
- package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.js +8 -15
- package/dist/collection/components/nv-dialogheader/nv-dialogheader.docs.js +0 -1
- package/dist/collection/components/nv-dialogheader/nv-dialogheader.js +1 -13
- package/dist/collection/components/nv-drawer/nv-drawer.docs.js +0 -1
- package/dist/collection/components/nv-drawer/nv-drawer.js +13 -16
- package/dist/collection/components/nv-drawerfooter/nv-drawerfooter.docs.js +0 -1
- package/dist/collection/components/nv-drawerfooter/nv-drawerfooter.js +8 -15
- package/dist/collection/components/nv-drawerheader/nv-drawerheader.docs.js +0 -1
- package/dist/collection/components/nv-drawerheader/nv-drawerheader.js +1 -13
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.css +9 -0
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.docs.js +0 -1
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js +6 -6
- package/dist/collection/components/nv-fielddate/nv-fielddate.docs.js +0 -1
- package/dist/collection/components/nv-fielddate/nv-fielddate.js +6 -9
- package/dist/collection/components/nv-fielddate/test/nv-fielddate.logic.test.js +0 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js +0 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +6 -10
- package/dist/collection/components/nv-fielddaterange/test/nv-fielddaterange.logic.test.js +0 -2
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js +0 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +16 -13
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.docs.js +0 -1
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js +3 -7
- package/dist/collection/components/nv-fielddropdownitem/styles/nv-fielddropdownitem.css +78 -8
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.docs.js +0 -1
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js +1 -3
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js +0 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +5 -6
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js +0 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +4 -5
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js +0 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +7 -7
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.docs.js +0 -1
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +5 -5
- package/dist/collection/components/nv-fieldradio/styles/nv-fieldradio.css +20 -0
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js +0 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +5 -6
- package/dist/collection/components/nv-fieldselect/styles/nv-fieldselect.css +90 -7
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js +0 -1
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.js +3 -4
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.utils.js +0 -1
- package/dist/collection/components/nv-fieldslider/partials/field-input.js +0 -1
- package/dist/collection/components/nv-fieldslider/partials/range-thumb.js +0 -1
- package/dist/collection/components/nv-fieldslider/partials/single-thumb.js +0 -1
- package/dist/collection/components/nv-fieldslider/partials/tick-marks.js +0 -1
- package/dist/collection/components/nv-fieldslider/test/nv-fieldslider.utils.test.js +0 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js +0 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +7 -7
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js +14 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +50 -30
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.docs.js +0 -1
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +3 -5
- package/dist/collection/components/nv-fieldtime/utils/format-utils.js +0 -1
- package/dist/collection/components/nv-icon/nv-icon.docs.js +0 -1
- package/dist/collection/components/nv-icon/nv-icon.js +7 -5
- package/dist/collection/components/nv-icon/nv-icons.js +0 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.docs.js +0 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +11 -7
- package/dist/collection/components/nv-loader/nv-loader.docs.js +0 -1
- package/dist/collection/components/nv-loader/nv-loader.js +5 -4
- package/dist/collection/components/nv-menu/nv-menu.docs.js +0 -1
- package/dist/collection/components/nv-menu/nv-menu.js +14 -12
- package/dist/collection/components/nv-menuitem/nv-menuitem.docs.js +0 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js +4 -5
- package/dist/collection/components/nv-notification/nv-notification.docs.js +0 -1
- package/dist/collection/components/nv-notification/nv-notification.js +5 -4
- package/dist/collection/components/nv-notification-bullet/nv-notification-bullet.docs.js +0 -1
- package/dist/collection/components/nv-notification-bullet/nv-notification-bullet.js +0 -1
- package/dist/collection/components/nv-notificationcontainer/nv-notificationcontainer.docs.js +0 -1
- package/dist/collection/components/nv-notificationcontainer/nv-notificationcontainer.js +3 -3
- package/dist/collection/components/nv-paginationtable/nv-paginationtable.css +17 -0
- package/dist/collection/components/nv-paginationtable/nv-paginationtable.docs.js +248 -0
- package/dist/collection/components/nv-paginationtable/nv-paginationtable.js +537 -0
- package/dist/collection/components/nv-paginationtable/nv-paginationtable.utils.js +64 -0
- package/dist/collection/components/nv-paginationtable/test/nv-paginationtable.utils.test.js +360 -0
- package/dist/collection/components/nv-popover/nv-popover.docs.js +0 -1
- package/dist/collection/components/nv-popover/nv-popover.js +19 -14
- package/dist/collection/components/nv-row/nv-row.docs.js +0 -1
- package/dist/collection/components/nv-row/nv-row.js +1 -2
- package/dist/collection/components/nv-sidebar/nv-sidebar.docs.js +0 -1
- package/dist/collection/components/nv-sidebar/nv-sidebar.js +1 -2
- package/dist/collection/components/nv-sidebarcontent/nv-sidebarcontent.docs.js +0 -1
- package/dist/collection/components/nv-sidebarcontent/nv-sidebarcontent.js +1 -2
- package/dist/collection/components/nv-sidebardivider/nv-sidebardivider.docs.js +0 -1
- package/dist/collection/components/nv-sidebardivider/nv-sidebardivider.js +1 -2
- package/dist/collection/components/nv-sidebarfooter/nv-sidebarfooter.docs.js +0 -1
- package/dist/collection/components/nv-sidebarfooter/nv-sidebarfooter.js +1 -2
- package/dist/collection/components/nv-sidebargroup/nv-sidebargroup.docs.js +0 -1
- package/dist/collection/components/nv-sidebargroup/nv-sidebargroup.js +1 -2
- package/dist/collection/components/nv-sidebarheader/nv-sidebarheader.docs.js +0 -1
- package/dist/collection/components/nv-sidebarheader/nv-sidebarheader.js +1 -2
- package/dist/collection/components/nv-sidebarlogo/nv-sidebarlogo.docs.js +0 -1
- package/dist/collection/components/nv-sidebarlogo/nv-sidebarlogo.js +1 -2
- package/dist/collection/components/nv-sidebarnavitem/nv-sidebarnavitem.docs.js +0 -1
- package/dist/collection/components/nv-sidebarnavitem/nv-sidebarnavitem.js +6 -6
- package/dist/collection/components/nv-sidebarnavsubitem/nv-sidebarnavsubitem.docs.js +0 -1
- package/dist/collection/components/nv-sidebarnavsubitem/nv-sidebarnavsubitem.js +1 -2
- package/dist/collection/components/nv-split/nv-split.docs.js +0 -1
- package/dist/collection/components/nv-split/nv-split.js +1 -2
- package/dist/collection/components/nv-stack/nv-stack.docs.js +0 -1
- package/dist/collection/components/nv-stack/nv-stack.js +1 -2
- package/dist/collection/components/nv-table/nv-table.docs.js +0 -1
- package/dist/collection/components/nv-table/nv-table.js +1 -3
- package/dist/collection/components/nv-table/nv-table.utils.js +2 -1
- package/dist/collection/components/nv-table/test/nv-table.utils.test.js +0 -2
- package/dist/collection/components/nv-tableheader/nv-tableheader.docs.js +0 -1
- package/dist/collection/components/nv-tableheader/nv-tableheader.js +1 -2
- package/dist/collection/components/nv-toggle/nv-toggle.css +26 -0
- package/dist/collection/components/nv-toggle/nv-toggle.docs.js +0 -1
- package/dist/collection/components/nv-toggle/nv-toggle.js +4 -4
- package/dist/collection/components/nv-togglebutton/nv-togglebutton.docs.js +0 -1
- package/dist/collection/components/nv-togglebutton/nv-togglebutton.js +5 -5
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.docs.js +0 -1
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.js +5 -6
- package/dist/collection/components/nv-tooltip/nv-tooltip.css +7 -0
- package/dist/collection/components/nv-tooltip/nv-tooltip.docs.js +0 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +20 -13
- package/dist/collection/index.js +2 -1
- package/dist/collection/interfaces/Column.js +0 -1
- package/dist/collection/interfaces/ColumnConfig.js +0 -1
- package/dist/collection/interfaces/localization.js +0 -1
- package/dist/collection/templates/navigation.docs.js +0 -1
- package/dist/collection/utils/class.utils.js +0 -1
- package/dist/collection/utils/constants.js +0 -1
- package/dist/collection/utils/dom.utils.js +8 -1
- package/dist/collection/utils/events.utils.js +0 -1
- package/dist/collection/utils/i18n.utils.js +0 -1
- package/dist/collection/utils/input.utils.js +0 -1
- package/dist/collection/utils/search-engine/engine.js +0 -1
- package/dist/collection/utils/search-engine/guards.js +0 -1
- package/dist/collection/utils/search-engine/index.js +0 -1
- package/dist/collection/utils/search-engine/indexer.js +0 -1
- package/dist/collection/utils/search-engine/normalize.js +0 -1
- package/dist/collection/utils/search-engine/strategies/fuzzy.js +0 -1
- package/dist/collection/utils/search-engine/strategies/smart.js +0 -1
- package/dist/collection/utils/search-engine/strategies/strict.js +0 -1
- package/dist/collection/utils/search-engine/test/engine.test.js +0 -1
- package/dist/collection/utils/search-engine/test/guards.test.js +0 -1
- package/dist/collection/utils/search-engine/test/indexer.test.js +0 -1
- package/dist/collection/utils/search-engine/test/normalize.test.js +0 -1
- package/dist/collection/utils/search-engine/test/strategies.test.js +0 -1
- package/dist/collection/utils/search-engine/types.js +0 -1
- package/dist/collection/utils/search-engine/worker/index.js +0 -1
- package/dist/collection/utils/search-engine/worker/search.worker.js +0 -1
- package/dist/collection/utils/search-engine/worker/worker-client.js +0 -1
- package/dist/collection/utils/string.utils.js +0 -1
- package/dist/collection/utils/test/class.utils.test.js +0 -2
- package/dist/collection/utils/test/dom.utils.test.js +24 -3
- package/dist/collection/utils/test/i18n.utils.test.js +0 -1
- package/dist/collection/utils/test/input.utils.test.js +0 -1
- package/dist/collection/utils/test/uri.utils.test.js +0 -1
- package/dist/collection/utils/uri.utils.js +0 -1
- package/dist/components/_.entry.js +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -583
- package/dist/components/nv-accordion-item.js +1 -9
- package/dist/components/nv-accordion.js +1 -229
- package/dist/components/nv-alert.js +1 -211
- package/dist/components/nv-avatar.js +1 -105
- package/dist/components/nv-badge.js +1 -9
- package/dist/components/nv-breadcrumb.js +1 -80
- package/dist/components/nv-breadcrumbs.js +1 -39
- package/dist/components/nv-button.js +1 -9
- package/dist/components/nv-buttongroup.js +1 -223
- package/dist/components/nv-calendar.js +1 -9
- package/dist/components/nv-col.js +1 -58
- package/dist/components/nv-datagrid.js +1 -4580
- package/dist/components/nv-datagridcolumn.js +1 -47
- package/dist/components/nv-dialog.js +1 -362
- package/dist/components/nv-dialogfooter.js +1 -9
- package/dist/components/nv-dialogheader.js +1 -9
- package/dist/components/nv-drawer.js +1 -507
- package/dist/components/nv-drawerfooter.js +1 -9
- package/dist/components/nv-drawerheader.js +1 -9
- package/dist/components/nv-fieldcheckbox.js +1 -9
- package/dist/components/nv-fielddate.js +1 -507
- package/dist/components/nv-fielddaterange.js +1 -670
- package/dist/components/nv-fielddropdown.js +1 -768
- package/dist/components/nv-fielddropdownitem.js +1 -9
- package/dist/components/nv-fielddropdownitemcheck.js +1 -9
- package/dist/components/nv-fieldmultiselect.js +1 -1587
- package/dist/components/nv-fieldnumber.js +1 -9
- package/dist/components/nv-fieldpassword.js +1 -227
- package/dist/components/nv-fieldradio.js +1 -137
- package/dist/components/nv-fieldselect.js +1 -460
- package/dist/components/nv-fieldslider.js +1 -801
- package/dist/components/nv-fieldtext.js +1 -9
- package/dist/components/nv-fieldtextarea.js +1 -282
- package/dist/components/nv-fieldtime.js +1 -1189
- package/dist/components/nv-icon.js +1 -9
- package/dist/components/nv-iconbutton.js +1 -9
- package/dist/components/nv-loader.js +1 -9
- package/dist/components/nv-menu.js +1 -254
- package/dist/components/nv-menuitem.js +1 -9
- package/dist/components/nv-notification-bullet.js +1 -9
- package/dist/components/nv-notification.js +1 -212
- package/dist/components/nv-notificationcontainer.js +1 -61
- package/dist/components/nv-paginationtable.d.ts +11 -0
- package/dist/components/nv-paginationtable.js +1 -0
- package/dist/components/nv-popover.js +1 -9
- package/dist/components/nv-row.js +1 -40
- package/dist/components/nv-sidebar.js +1 -210
- package/dist/components/nv-sidebarcontent.js +1 -40
- package/dist/components/nv-sidebardivider.js +1 -40
- package/dist/components/nv-sidebarfooter.js +1 -40
- package/dist/components/nv-sidebargroup.js +1 -43
- package/dist/components/nv-sidebarheader.js +1 -40
- package/dist/components/nv-sidebarlogo.js +1 -54
- package/dist/components/nv-sidebarnavitem.js +1 -336
- package/dist/components/nv-sidebarnavsubitem.js +1 -55
- package/dist/components/nv-split.js +1 -370
- package/dist/components/nv-stack.js +1 -55
- package/dist/components/nv-table.js +1 -261
- package/dist/components/nv-tableheader.js +1 -114
- package/dist/components/nv-toggle.js +1 -111
- package/dist/components/nv-togglebutton.js +1 -91
- package/dist/components/nv-togglebuttongroup.js +1 -200
- package/dist/components/nv-tooltip.js +1 -9
- package/dist/components/p-9xYwU7ku.js +1 -724
- package/dist/components/p-B5KLppep.js +1 -0
- package/dist/components/p-B6GgGra-.js +1 -29
- package/dist/components/p-BAlaMmS4.js +1 -0
- package/dist/components/p-BPufjY85.js +1 -0
- package/dist/components/p-BReL3Lsa.js +1 -286
- package/dist/components/p-BaF3Tuua.js +1 -0
- package/dist/components/p-BdYh22OP.js +1 -57
- package/dist/components/p-BfaMgLx7.js +9 -0
- package/dist/components/p-Bh6WGsHA.js +1 -0
- package/dist/components/p-C2J7j_fw.js +1 -0
- package/dist/components/p-C9p4yTS2.js +1 -0
- package/dist/components/p-CAKTe96z.js +1 -0
- package/dist/components/p-CEI7jWvn.js +1 -0
- package/dist/components/p-CR9MpYzU.js +1 -0
- package/dist/components/p-CZcMM7Lh.js +1 -0
- package/dist/components/p-Ce1IBFTa.js +1 -0
- package/dist/components/p-CgHCo_Ho.js +1 -42
- package/dist/components/p-ChV9xqsO.js +1 -6
- package/dist/components/p-CnI0auJM.js +1 -24
- package/dist/components/p-CuXVGECR.js +1 -0
- package/dist/components/p-D02w_Ru6.js +1 -91
- package/dist/components/p-D15RdWEG.js +1 -0
- package/dist/components/p-D1C_pu0E.js +1 -218
- package/dist/components/p-D2otK4Ce.js +1 -91
- package/dist/components/p-D3eWMME9.js +1 -534
- package/dist/components/p-DDqZBSGn.js +1 -0
- package/dist/components/p-DHNSuxz-.js +1 -0
- package/dist/components/p-DhDxhFz-.js +1 -0
- package/dist/components/p-DqU-wS_x.js +1 -0
- package/dist/components/p-Dz1GUhVy.js +15 -1119
- package/dist/components/p-FSPz8FER.js +1 -0
- package/dist/components/p-RUeDcouW.js +1 -0
- package/dist/components/p-iXsbKJzR.js +2 -0
- package/dist/components/p-jZF_Ggmx.js +1 -0
- package/dist/components/p-laRga5dw.js +1 -0
- package/dist/components/p-nmQOuX7R.js +1 -0
- package/dist/components/p-yHGZRC6Q.js +1 -0
- package/dist/esm/_commonjsHelpers-B85MJLTf.js +0 -3
- package/dist/esm/clsx-ChV9xqsO.js +0 -3
- package/dist/esm/collapse.animation-DZDm0vSK.js +0 -3
- package/dist/esm/constants-BReL3Lsa.js +0 -3
- package/dist/esm/dom.utils-CuXVGECR.js +173 -0
- package/dist/esm/events.utils-B6GgGra-.js +0 -3
- package/dist/esm/fade.animation-DcRL9lcm.js +0 -3
- package/dist/esm/grow.animation-D7ep_aVl.js +0 -3
- package/dist/esm/i18n.utils-CR9MpYzU.js +74 -0
- package/dist/esm/index-S-IZ4AN_.js +4796 -0
- package/dist/esm/index.esm-D3eWMME9.js +0 -3
- package/dist/esm/index.js +53 -3
- package/dist/esm/inputmask-CSo292ul.js +0 -3
- package/dist/esm/loader.js +3 -5
- package/dist/esm/native.js +32 -7
- package/dist/esm/nv-accordion-item.entry.js +8 -8
- package/dist/esm/nv-accordion.entry.js +10 -9
- package/dist/esm/nv-alert.entry.js +6 -5
- package/dist/esm/nv-avatar.entry.js +3 -4
- package/dist/esm/nv-badge_2.entry.js +18 -12
- package/dist/esm/nv-breadcrumb.entry.js +14 -12
- package/dist/esm/nv-breadcrumbs.entry.js +4 -5
- package/dist/esm/nv-button.entry.js +9 -6
- package/dist/esm/nv-buttongroup.entry.js +12 -7
- package/dist/esm/nv-calendar.entry.js +27 -20
- package/dist/esm/nv-col.entry.js +3 -4
- package/dist/esm/nv-datagrid.entry.js +42 -180
- package/dist/esm/nv-datagridcolumn.entry.js +1 -2
- package/dist/esm/nv-dialog.entry.js +19 -21
- package/dist/esm/nv-dialogfooter_2.entry.js +11 -30
- package/dist/esm/nv-drawer.entry.js +19 -20
- package/dist/esm/nv-drawerfooter_2.entry.js +11 -30
- package/dist/esm/nv-fieldcheckbox.entry.js +10 -9
- package/dist/esm/nv-fielddate.entry.js +15 -14
- package/dist/esm/nv-fielddaterange.entry.js +15 -15
- package/dist/esm/nv-fielddropdown.entry.js +19 -17
- package/dist/esm/nv-fielddropdownitem.entry.js +5 -9
- package/dist/esm/nv-fieldmultiselect.entry.js +14 -10
- package/dist/esm/nv-fieldnumber.entry.js +10 -9
- package/dist/esm/nv-fieldpassword.entry.js +10 -9
- package/dist/esm/nv-fieldradio.entry.js +9 -8
- package/dist/esm/nv-fieldselect.entry.js +20 -13
- package/dist/esm/nv-fieldslider.entry.js +33 -16
- package/dist/esm/nv-fieldtext.entry.js +7 -8
- package/dist/esm/nv-fieldtextarea.entry.js +42 -35
- package/dist/esm/nv-fieldtime.entry.js +15 -10
- package/dist/esm/nv-icon.entry.js +4 -5
- package/dist/esm/nv-iconbutton_2.entry.js +13 -10
- package/dist/esm/nv-menu.entry.js +9 -14
- package/dist/esm/nv-menuitem.entry.js +4 -6
- package/dist/esm/nv-notification-bullet.entry.js +3 -4
- package/dist/esm/nv-notification.entry.js +4 -5
- package/dist/esm/nv-notificationcontainer.entry.js +4 -5
- package/dist/esm/nv-paginationtable.entry.js +226 -0
- package/dist/esm/nv-popover.entry.js +105 -34
- package/dist/esm/nv-row.entry.js +4 -5
- package/dist/esm/nv-sidebar.entry.js +10 -7
- package/dist/esm/nv-sidebarcontent.entry.js +4 -5
- package/dist/esm/nv-sidebardivider.entry.js +4 -5
- package/dist/esm/nv-sidebarfooter.entry.js +4 -5
- package/dist/esm/nv-sidebargroup.entry.js +4 -5
- package/dist/esm/nv-sidebarheader.entry.js +4 -5
- package/dist/esm/nv-sidebarlogo.entry.js +4 -5
- package/dist/esm/nv-sidebarnavitem.entry.js +9 -8
- package/dist/esm/nv-sidebarnavsubitem.entry.js +4 -5
- package/dist/esm/nv-split.entry.js +10 -7
- package/dist/esm/nv-stack.entry.js +4 -5
- package/dist/esm/nv-table.entry.js +6 -5
- package/dist/esm/nv-tableheader.entry.js +4 -5
- package/dist/esm/nv-toggle.entry.js +8 -7
- package/dist/esm/nv-togglebutton.entry.js +4 -6
- package/dist/esm/nv-togglebuttongroup.entry.js +13 -10
- package/dist/esm/nv-tooltip.entry.js +10 -10
- package/dist/esm/slide.animation-CmH5d1of.js +0 -3
- package/dist/esm/style-value-types.es-xlgmw4x8.js +0 -3
- package/dist/esm/timeline.animation-CgHCo_Ho.js +0 -3
- package/dist/esm/uri.utils-CnI0auJM.js +0 -3
- package/dist/esm/v4-BdYh22OP.js +0 -3
- package/dist/{components/p-IlwlcG9l.js → esm/worker-client-BaF3Tuua.js} +20 -77
- package/dist/lib/generators/angular-output.js +0 -1
- package/dist/lib/generators/docs-blazor.js +0 -1
- package/dist/lib/generators/vue-output.js +0 -1
- package/dist/lib/scripts/nextjs-entry-shim.js +25 -0
- package/dist/lib/utils/componentBinding.js +0 -1
- package/dist/lib/utils/parseToCSharpTypes.js +0 -1
- package/dist/lib/utils/spread.js +0 -1
- package/dist/lib/utils/test/parseToCSharpTypes.test.js +0 -1
- package/dist/native/index.esm.js +1 -2
- package/dist/native/native.css +1 -1
- package/dist/native/native.esm.js +1 -2
- package/dist/native/p-043d500e.entry.js +1 -0
- package/dist/native/p-04956305.entry.js +1 -0
- package/dist/native/p-06a17aba.entry.js +1 -0
- package/dist/native/p-0819a7b1.entry.js +1 -0
- package/dist/native/p-0bfd188c.entry.js +1 -0
- package/dist/native/p-0e8b544b.entry.js +1 -0
- package/dist/native/p-0ec34d19.entry.js +1 -0
- package/dist/native/p-11eb959b.entry.js +1 -0
- package/dist/native/p-13YSIyGW.js +1 -2
- package/dist/native/p-17f2525a.entry.js +1 -0
- package/dist/native/p-1a5db5e9.entry.js +1 -0
- package/dist/native/p-1bf1a213.entry.js +1 -0
- package/dist/native/p-1dd3da3b.entry.js +1 -0
- package/dist/native/p-2106dfbd.entry.js +1 -0
- package/dist/native/p-31301f1e.entry.js +1 -0
- package/dist/native/p-3a04a563.entry.js +1 -0
- package/dist/native/p-3fb1a188.entry.js +1 -0
- package/dist/native/p-48e7b457.entry.js +1 -0
- package/dist/native/p-5cbf5973.entry.js +1 -0
- package/dist/native/p-64104dbd.entry.js +1 -0
- package/dist/native/p-6a9363a6.entry.js +1 -0
- package/dist/native/p-6b655545.entry.js +1 -0
- package/dist/native/p-702a6646.entry.js +1 -0
- package/dist/native/p-70abbe4f.entry.js +1 -0
- package/dist/native/p-79d8c26b.entry.js +1 -0
- package/dist/native/p-7a8e2ef3.entry.js +1 -0
- package/dist/native/p-7c413f8b.entry.js +1 -0
- package/dist/native/p-85c8be32.entry.js +1 -0
- package/dist/native/p-87a1b06c.entry.js +1 -0
- package/dist/native/p-89f7d483.entry.js +1 -0
- package/dist/native/p-8ce17efd.entry.js +1 -0
- package/dist/native/p-8dadc0c9.entry.js +1 -0
- package/dist/native/p-945ca1db.entry.js +1 -0
- package/dist/native/p-97a5f8d5.entry.js +1 -0
- package/dist/native/p-98ea927d.entry.js +1 -0
- package/dist/native/p-B6GgGra-.js +1 -2
- package/dist/native/p-B85MJLTf.js +1 -2
- package/dist/native/p-BReL3Lsa.js +1 -2
- package/dist/native/p-BaF3Tuua.js +1 -0
- package/dist/native/p-BdYh22OP.js +1 -2
- package/dist/native/p-Blc6XEY7.js +1 -2
- package/dist/native/p-CR9MpYzU.js +1 -0
- package/dist/native/p-CgHCo_Ho.js +1 -2
- package/dist/native/p-ChV9xqsO.js +1 -2
- package/dist/native/p-CnI0auJM.js +1 -2
- package/dist/native/p-CuXVGECR.js +1 -0
- package/dist/native/p-D3eWMME9.js +1 -2
- package/dist/native/p-DmUOtOcY.js +1 -2
- package/dist/native/p-Hfc8Oh0x.js +3 -4
- package/dist/native/p-S-IZ4AN_.js +2 -0
- package/dist/native/p-a8bc3b92.entry.js +1 -0
- package/dist/native/p-a92e2ad8.entry.js +1 -0
- package/dist/native/p-a9a07a8d.entry.js +1 -0
- package/dist/native/p-a9a20f37.entry.js +1 -0
- package/dist/native/p-aa232a20.entry.js +1 -0
- package/dist/native/p-ae4fc02a.entry.js +1 -0
- package/dist/native/p-b0d97496.entry.js +1 -0
- package/dist/native/p-bd143e7b.entry.js +1 -0
- package/dist/native/p-bdaab534.entry.js +1 -0
- package/dist/native/p-bdbc92d9.entry.js +1 -0
- package/dist/native/p-bef3d325.entry.js +1 -0
- package/dist/native/p-c3ea1eca.entry.js +1 -0
- package/dist/native/p-c825c542.entry.js +1 -0
- package/dist/native/p-ce2c17dc.entry.js +1 -0
- package/dist/native/p-d46ea49a.entry.js +1 -0
- package/dist/native/p-dc0d1690.entry.js +1 -0
- package/dist/native/p-e05b6008.entry.js +1 -0
- package/dist/native/p-e1021e2c.entry.js +1 -0
- package/dist/native/p-e937d495.entry.js +1 -0
- package/dist/native/p-f22d2ad9.entry.js +1 -0
- package/dist/native/p-f2a32774.entry.js +1 -0
- package/dist/native/p-f5eff2b2.entry.js +1 -0
- package/dist/native/p-f64f1bea.entry.js +1 -0
- package/dist/native/p-fba55e2f.entry.js +1 -0
- package/dist/native/p-sqVK8yoD.js +1 -2
- package/dist/native/p-xlgmw4x8.js +2 -3
- package/dist/types/components/nv-breadcrumb/nv-breadcrumb.d.ts +4 -2
- package/dist/types/components/nv-dialog/nv-dialog.d.ts +4 -9
- package/dist/types/components/nv-dialogfooter/nv-dialogfooter.d.ts +3 -4
- package/dist/types/components/nv-dialogheader/nv-dialogheader.d.ts +0 -3
- package/dist/types/components/nv-drawer/nv-drawer.d.ts +3 -3
- package/dist/types/components/nv-drawerfooter/nv-drawerfooter.d.ts +3 -4
- package/dist/types/components/nv-drawerheader/nv-drawerheader.d.ts +0 -3
- package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +4 -0
- package/dist/types/components/nv-fielddropdownitem/nv-fielddropdownitem.d.ts +2 -3
- package/dist/types/components/nv-fieldtextarea/nv-fieldtextarea.d.ts +9 -1
- package/dist/types/components/nv-menu/nv-menu.d.ts +5 -1
- package/dist/types/components/nv-paginationtable/nv-paginationtable.d.ts +112 -0
- package/dist/types/components/nv-paginationtable/nv-paginationtable.docs.d.ts +4 -0
- package/dist/types/components/nv-paginationtable/nv-paginationtable.utils.d.ts +61 -0
- package/dist/types/components/nv-paginationtable/test/nv-paginationtable.utils.test.d.ts +1 -0
- package/dist/types/components/nv-popover/nv-popover.d.ts +2 -3
- package/dist/types/components/nv-tooltip/nv-tooltip.d.ts +4 -2
- package/dist/types/components.d.ts +182 -5
- package/dist/types/index.d.ts +1 -0
- package/dist/types/nova-docs.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +87 -4
- package/dist/types/utils/dom.utils.d.ts +6 -0
- package/dist/types/utils/events.utils.d.ts +2 -2
- package/dist/vscode-data.json +641 -588
- package/hydrate/index.d.ts +12 -0
- package/hydrate/index.js +6999 -1257
- package/hydrate/index.mjs +6998 -1258
- package/package.json +11 -9
- package/dist/cjs/_commonjsHelpers-CFO10eej.js.map +0 -1
- package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -8
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
- package/dist/cjs/clsx-BtxeOLZW.js.map +0 -1
- package/dist/cjs/collapse.animation-CcG0GAWk.js.map +0 -1
- package/dist/cjs/constants-BugGJYqL.js.map +0 -1
- package/dist/cjs/events.utils-BE6R5q9C.js.map +0 -1
- package/dist/cjs/fade.animation-BQSqXXOJ.js.map +0 -1
- package/dist/cjs/grow.animation-ynu_HmA_.js.map +0 -1
- package/dist/cjs/i18n.utils-ku0bScip.js.map +0 -1
- package/dist/cjs/index-B1na8x6M.js +0 -2841
- package/dist/cjs/index-B1na8x6M.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/index.esm-CG1TVKfu.js.map +0 -1
- package/dist/cjs/inputmask-DtXnpVWa.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/native.cjs.js.map +0 -1
- package/dist/cjs/nv-accordion-item.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-accordion.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-alert.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-avatar.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-badge.nv-fielddropdownitemcheck.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-breadcrumb.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-breadcrumbs.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-button.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-buttongroup.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-calendar.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-col.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-datagrid.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-datagridcolumn.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-dialog.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-dialogfooter.nv-dialogheader.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-drawer.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-drawerfooter.nv-drawerheader.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldcheckbox.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fielddate.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fielddaterange.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fielddropdown.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fielddropdownitem.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldmultiselect.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldnumber.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldpassword.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldradio.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldselect.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldslider.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldtext.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldtextarea.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldtime.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-icon.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-iconbutton.nv-loader.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-menu.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-menuitem.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-notification-bullet.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-notification.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-notificationcontainer.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-popover.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-row.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebar.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebarcontent.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebardivider.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebarfooter.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebargroup.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebarheader.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebarlogo.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebarnavitem.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebarnavsubitem.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-split.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-stack.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-table.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-tableheader.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-toggle.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-togglebutton.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-togglebuttongroup.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-tooltip.entry.cjs.js.map +0 -1
- package/dist/cjs/slide.animation-Cb3tpLQv.js.map +0 -1
- package/dist/cjs/style-value-types.es-B1vLqX9m.js.map +0 -1
- package/dist/cjs/timeline.animation-KteJaZPb.js.map +0 -1
- package/dist/cjs/uri.utils-DiMLQx64.js.map +0 -1
- package/dist/cjs/v4-C1vaJ4yP.js.map +0 -1
- package/dist/collection/animations/collapse.animation.js.map +0 -1
- package/dist/collection/animations/fade.animation.js.map +0 -1
- package/dist/collection/animations/grow.animation.js.map +0 -1
- package/dist/collection/animations/index.js.map +0 -1
- package/dist/collection/animations/slide.animation.js.map +0 -1
- package/dist/collection/animations/timeline.animation.js.map +0 -1
- package/dist/collection/components/nv-accordion/nv-accordion.docs.js.map +0 -1
- package/dist/collection/components/nv-accordion/nv-accordion.js.map +0 -1
- package/dist/collection/components/nv-accordion-item/nv-accordion-item.docs.js.map +0 -1
- package/dist/collection/components/nv-accordion-item/nv-accordion-item.js.map +0 -1
- package/dist/collection/components/nv-alert/nv-alert.docs.js.map +0 -1
- package/dist/collection/components/nv-alert/nv-alert.js.map +0 -1
- package/dist/collection/components/nv-avatar/nv-avatar.docs.js.map +0 -1
- package/dist/collection/components/nv-avatar/nv-avatar.js.map +0 -1
- package/dist/collection/components/nv-badge/nv-badge.docs.js.map +0 -1
- package/dist/collection/components/nv-badge/nv-badge.js.map +0 -1
- package/dist/collection/components/nv-breadcrumb/nv-breadcrumb.docs.js.map +0 -1
- package/dist/collection/components/nv-breadcrumb/nv-breadcrumb.js.map +0 -1
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.docs.js.map +0 -1
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.js.map +0 -1
- package/dist/collection/components/nv-button/nv-button.docs.js.map +0 -1
- package/dist/collection/components/nv-button/nv-button.js.map +0 -1
- package/dist/collection/components/nv-buttongroup/nv-buttongroup.docs.js.map +0 -1
- package/dist/collection/components/nv-buttongroup/nv-buttongroup.js.map +0 -1
- package/dist/collection/components/nv-buttongroup/nv-buttongroup.utils.js.map +0 -1
- package/dist/collection/components/nv-buttongroup/test/nv-buttongroup.utils.test.js.map +0 -1
- package/dist/collection/components/nv-calendar/nv-calendar.docs.js.map +0 -1
- package/dist/collection/components/nv-calendar/nv-calendar.js.map +0 -1
- package/dist/collection/components/nv-calendar/nv-calendar.utils.js.map +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-actions.js.map +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-grid.js.map +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-header.js.map +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-shortcuts.js.map +0 -1
- package/dist/collection/components/nv-calendar/partials/day-cell.js.map +0 -1
- package/dist/collection/components/nv-calendar/partials/index.js.map +0 -1
- package/dist/collection/components/nv-calendar/partials/week-numbers.js.map +0 -1
- package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js.map +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-actions.logic.test.js.map +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-grid.logic.test.js.map +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-header.logic.test.js.map +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-shortcuts.logic.test.js.map +0 -1
- package/dist/collection/components/nv-calendar/test/partials/day-cell.logic.test.js.map +0 -1
- package/dist/collection/components/nv-calendar/test/partials/week-numbers.logic.test.js.map +0 -1
- package/dist/collection/components/nv-col/nv-col.docs.js.map +0 -1
- package/dist/collection/components/nv-col/nv-col.js.map +0 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +0 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +0 -1
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.docs.js.map +0 -1
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js.map +0 -1
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js.map +0 -1
- package/dist/collection/components/nv-dialog/nv-dialog.js.map +0 -1
- package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.docs.js.map +0 -1
- package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.js.map +0 -1
- package/dist/collection/components/nv-dialogheader/nv-dialogheader.docs.js.map +0 -1
- package/dist/collection/components/nv-dialogheader/nv-dialogheader.js.map +0 -1
- package/dist/collection/components/nv-drawer/nv-drawer.docs.js.map +0 -1
- package/dist/collection/components/nv-drawer/nv-drawer.js.map +0 -1
- package/dist/collection/components/nv-drawerfooter/nv-drawerfooter.docs.js.map +0 -1
- package/dist/collection/components/nv-drawerfooter/nv-drawerfooter.js.map +0 -1
- package/dist/collection/components/nv-drawerheader/nv-drawerheader.docs.js.map +0 -1
- package/dist/collection/components/nv-drawerheader/nv-drawerheader.js.map +0 -1
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js.map +0 -1
- package/dist/collection/components/nv-fielddate/nv-fielddate.docs.js.map +0 -1
- package/dist/collection/components/nv-fielddate/nv-fielddate.js.map +0 -1
- package/dist/collection/components/nv-fielddate/test/nv-fielddate.logic.test.js.map +0 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js.map +0 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +0 -1
- package/dist/collection/components/nv-fielddaterange/test/nv-fielddaterange.logic.test.js.map +0 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js.map +0 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +0 -1
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.docs.js.map +0 -1
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js.map +0 -1
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.docs.js.map +0 -1
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js.map +0 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +0 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js.map +0 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js.map +0 -1
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js.map +0 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.utils.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/partials/field-input.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/partials/range-thumb.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/partials/single-thumb.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/partials/tick-marks.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/test/nv-fieldslider.utils.test.js.map +0 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js.map +0 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js.map +0 -1
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js.map +0 -1
- package/dist/collection/components/nv-fieldtime/utils/format-utils.js.map +0 -1
- package/dist/collection/components/nv-icon/nv-icon.docs.js.map +0 -1
- package/dist/collection/components/nv-icon/nv-icon.js.map +0 -1
- package/dist/collection/components/nv-icon/nv-icons.js.map +0 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.docs.js.map +0 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js.map +0 -1
- package/dist/collection/components/nv-loader/nv-loader.docs.js.map +0 -1
- package/dist/collection/components/nv-loader/nv-loader.js.map +0 -1
- package/dist/collection/components/nv-menu/nv-menu.docs.js.map +0 -1
- package/dist/collection/components/nv-menu/nv-menu.js.map +0 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.docs.js.map +0 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js.map +0 -1
- package/dist/collection/components/nv-notification/nv-notification.docs.js.map +0 -1
- package/dist/collection/components/nv-notification/nv-notification.js.map +0 -1
- package/dist/collection/components/nv-notification-bullet/nv-notification-bullet.docs.js.map +0 -1
- package/dist/collection/components/nv-notification-bullet/nv-notification-bullet.js.map +0 -1
- package/dist/collection/components/nv-notificationcontainer/nv-notificationcontainer.docs.js.map +0 -1
- package/dist/collection/components/nv-notificationcontainer/nv-notificationcontainer.js.map +0 -1
- package/dist/collection/components/nv-popover/nv-popover.docs.js.map +0 -1
- package/dist/collection/components/nv-popover/nv-popover.js.map +0 -1
- package/dist/collection/components/nv-row/nv-row.docs.js.map +0 -1
- package/dist/collection/components/nv-row/nv-row.js.map +0 -1
- package/dist/collection/components/nv-sidebar/nv-sidebar.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebar/nv-sidebar.js.map +0 -1
- package/dist/collection/components/nv-sidebarcontent/nv-sidebarcontent.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebarcontent/nv-sidebarcontent.js.map +0 -1
- package/dist/collection/components/nv-sidebardivider/nv-sidebardivider.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebardivider/nv-sidebardivider.js.map +0 -1
- package/dist/collection/components/nv-sidebarfooter/nv-sidebarfooter.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebarfooter/nv-sidebarfooter.js.map +0 -1
- package/dist/collection/components/nv-sidebargroup/nv-sidebargroup.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebargroup/nv-sidebargroup.js.map +0 -1
- package/dist/collection/components/nv-sidebarheader/nv-sidebarheader.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebarheader/nv-sidebarheader.js.map +0 -1
- package/dist/collection/components/nv-sidebarlogo/nv-sidebarlogo.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebarlogo/nv-sidebarlogo.js.map +0 -1
- package/dist/collection/components/nv-sidebarnavitem/nv-sidebarnavitem.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebarnavitem/nv-sidebarnavitem.js.map +0 -1
- package/dist/collection/components/nv-sidebarnavsubitem/nv-sidebarnavsubitem.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebarnavsubitem/nv-sidebarnavsubitem.js.map +0 -1
- package/dist/collection/components/nv-split/nv-split.docs.js.map +0 -1
- package/dist/collection/components/nv-split/nv-split.js.map +0 -1
- package/dist/collection/components/nv-stack/nv-stack.docs.js.map +0 -1
- package/dist/collection/components/nv-stack/nv-stack.js.map +0 -1
- package/dist/collection/components/nv-table/nv-table.docs.js.map +0 -1
- package/dist/collection/components/nv-table/nv-table.js.map +0 -1
- package/dist/collection/components/nv-table/nv-table.utils.js.map +0 -1
- package/dist/collection/components/nv-table/test/nv-table.utils.test.js.map +0 -1
- package/dist/collection/components/nv-tableheader/nv-tableheader.docs.js.map +0 -1
- package/dist/collection/components/nv-tableheader/nv-tableheader.js.map +0 -1
- package/dist/collection/components/nv-toggle/nv-toggle.docs.js.map +0 -1
- package/dist/collection/components/nv-toggle/nv-toggle.js.map +0 -1
- package/dist/collection/components/nv-togglebutton/nv-togglebutton.docs.js.map +0 -1
- package/dist/collection/components/nv-togglebutton/nv-togglebutton.js.map +0 -1
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.docs.js.map +0 -1
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.js.map +0 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.docs.js.map +0 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/interfaces/Column.js.map +0 -1
- package/dist/collection/interfaces/ColumnConfig.js.map +0 -1
- package/dist/collection/interfaces/localization.js.map +0 -1
- package/dist/collection/templates/navigation.docs.js.map +0 -1
- package/dist/collection/utils/class.utils.js.map +0 -1
- package/dist/collection/utils/constants.js.map +0 -1
- package/dist/collection/utils/dom.utils.js.map +0 -1
- package/dist/collection/utils/events.utils.js.map +0 -1
- package/dist/collection/utils/i18n.utils.js.map +0 -1
- package/dist/collection/utils/input.utils.js.map +0 -1
- package/dist/collection/utils/search-engine/engine.js.map +0 -1
- package/dist/collection/utils/search-engine/guards.js.map +0 -1
- package/dist/collection/utils/search-engine/index.js.map +0 -1
- package/dist/collection/utils/search-engine/indexer.js.map +0 -1
- package/dist/collection/utils/search-engine/normalize.js.map +0 -1
- package/dist/collection/utils/search-engine/strategies/fuzzy.js.map +0 -1
- package/dist/collection/utils/search-engine/strategies/smart.js.map +0 -1
- package/dist/collection/utils/search-engine/strategies/strict.js.map +0 -1
- package/dist/collection/utils/search-engine/test/engine.test.js.map +0 -1
- package/dist/collection/utils/search-engine/test/guards.test.js.map +0 -1
- package/dist/collection/utils/search-engine/test/indexer.test.js.map +0 -1
- package/dist/collection/utils/search-engine/test/normalize.test.js.map +0 -1
- package/dist/collection/utils/search-engine/test/strategies.test.js.map +0 -1
- package/dist/collection/utils/search-engine/types.js.map +0 -1
- package/dist/collection/utils/search-engine/worker/index.js.map +0 -1
- package/dist/collection/utils/search-engine/worker/search.worker.js.map +0 -1
- package/dist/collection/utils/search-engine/worker/worker-client.js.map +0 -1
- package/dist/collection/utils/string.utils.js.map +0 -1
- package/dist/collection/utils/test/class.utils.test.js.map +0 -1
- package/dist/collection/utils/test/dom.utils.test.js.map +0 -1
- package/dist/collection/utils/test/i18n.utils.test.js.map +0 -1
- package/dist/collection/utils/test/input.utils.test.js.map +0 -1
- package/dist/collection/utils/test/uri.utils.test.js.map +0 -1
- package/dist/collection/utils/uri.utils.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/nv-accordion-item.js.map +0 -1
- package/dist/components/nv-accordion.js.map +0 -1
- package/dist/components/nv-alert.js.map +0 -1
- package/dist/components/nv-avatar.js.map +0 -1
- package/dist/components/nv-badge.js.map +0 -1
- package/dist/components/nv-breadcrumb.js.map +0 -1
- package/dist/components/nv-breadcrumbs.js.map +0 -1
- package/dist/components/nv-button.js.map +0 -1
- package/dist/components/nv-buttongroup.js.map +0 -1
- package/dist/components/nv-calendar.js.map +0 -1
- package/dist/components/nv-col.js.map +0 -1
- package/dist/components/nv-datagrid.js.map +0 -1
- package/dist/components/nv-datagridcolumn.js.map +0 -1
- package/dist/components/nv-dialog.js.map +0 -1
- package/dist/components/nv-dialogfooter.js.map +0 -1
- package/dist/components/nv-dialogheader.js.map +0 -1
- package/dist/components/nv-drawer.js.map +0 -1
- package/dist/components/nv-drawerfooter.js.map +0 -1
- package/dist/components/nv-drawerheader.js.map +0 -1
- package/dist/components/nv-fieldcheckbox.js.map +0 -1
- package/dist/components/nv-fielddate.js.map +0 -1
- package/dist/components/nv-fielddaterange.js.map +0 -1
- package/dist/components/nv-fielddropdown.js.map +0 -1
- package/dist/components/nv-fielddropdownitem.js.map +0 -1
- package/dist/components/nv-fielddropdownitemcheck.js.map +0 -1
- package/dist/components/nv-fieldmultiselect.js.map +0 -1
- package/dist/components/nv-fieldnumber.js.map +0 -1
- package/dist/components/nv-fieldpassword.js.map +0 -1
- package/dist/components/nv-fieldradio.js.map +0 -1
- package/dist/components/nv-fieldselect.js.map +0 -1
- package/dist/components/nv-fieldslider.js.map +0 -1
- package/dist/components/nv-fieldtext.js.map +0 -1
- package/dist/components/nv-fieldtextarea.js.map +0 -1
- package/dist/components/nv-fieldtime.js.map +0 -1
- package/dist/components/nv-icon.js.map +0 -1
- package/dist/components/nv-iconbutton.js.map +0 -1
- package/dist/components/nv-loader.js.map +0 -1
- package/dist/components/nv-menu.js.map +0 -1
- package/dist/components/nv-menuitem.js.map +0 -1
- package/dist/components/nv-notification-bullet.js.map +0 -1
- package/dist/components/nv-notification.js.map +0 -1
- package/dist/components/nv-notificationcontainer.js.map +0 -1
- package/dist/components/nv-popover.js.map +0 -1
- package/dist/components/nv-row.js.map +0 -1
- package/dist/components/nv-sidebar.js.map +0 -1
- package/dist/components/nv-sidebarcontent.js.map +0 -1
- package/dist/components/nv-sidebardivider.js.map +0 -1
- package/dist/components/nv-sidebarfooter.js.map +0 -1
- package/dist/components/nv-sidebargroup.js.map +0 -1
- package/dist/components/nv-sidebarheader.js.map +0 -1
- package/dist/components/nv-sidebarlogo.js.map +0 -1
- package/dist/components/nv-sidebarnavitem.js.map +0 -1
- package/dist/components/nv-sidebarnavsubitem.js.map +0 -1
- package/dist/components/nv-split.js.map +0 -1
- package/dist/components/nv-stack.js.map +0 -1
- package/dist/components/nv-table.js.map +0 -1
- package/dist/components/nv-tableheader.js.map +0 -1
- package/dist/components/nv-toggle.js.map +0 -1
- package/dist/components/nv-togglebutton.js.map +0 -1
- package/dist/components/nv-togglebuttongroup.js.map +0 -1
- package/dist/components/nv-tooltip.js.map +0 -1
- package/dist/components/p-9xYwU7ku.js.map +0 -1
- package/dist/components/p-B45HbBWe.js +0 -191
- package/dist/components/p-B45HbBWe.js.map +0 -1
- package/dist/components/p-B5jN7NKA.js +0 -59
- package/dist/components/p-B5jN7NKA.js.map +0 -1
- package/dist/components/p-B6GgGra-.js.map +0 -1
- package/dist/components/p-B7VlEQVW.js +0 -1475
- package/dist/components/p-B7VlEQVW.js.map +0 -1
- package/dist/components/p-B9i3m6rk.js +0 -1941
- package/dist/components/p-B9i3m6rk.js.map +0 -1
- package/dist/components/p-BILd3Ta-.js +0 -209
- package/dist/components/p-BILd3Ta-.js.map +0 -1
- package/dist/components/p-BISctfud.js +0 -214
- package/dist/components/p-BISctfud.js.map +0 -1
- package/dist/components/p-BReL3Lsa.js.map +0 -1
- package/dist/components/p-BVOv1zgq.js +0 -82
- package/dist/components/p-BVOv1zgq.js.map +0 -1
- package/dist/components/p-BdYh22OP.js.map +0 -1
- package/dist/components/p-Bg_l3jn1.js +0 -191
- package/dist/components/p-Bg_l3jn1.js.map +0 -1
- package/dist/components/p-C2QAWGhf.js +0 -88
- package/dist/components/p-C2QAWGhf.js.map +0 -1
- package/dist/components/p-C63Xpg9a.js +0 -2338
- package/dist/components/p-C63Xpg9a.js.map +0 -1
- package/dist/components/p-COnt5ux_.js +0 -51
- package/dist/components/p-COnt5ux_.js.map +0 -1
- package/dist/components/p-Cc7XnqPp.js +0 -260
- package/dist/components/p-Cc7XnqPp.js.map +0 -1
- package/dist/components/p-CgHCo_Ho.js.map +0 -1
- package/dist/components/p-ChV9xqsO.js.map +0 -1
- package/dist/components/p-CnI0auJM.js.map +0 -1
- package/dist/components/p-D02w_Ru6.js.map +0 -1
- package/dist/components/p-D1C_pu0E.js.map +0 -1
- package/dist/components/p-D2otK4Ce.js.map +0 -1
- package/dist/components/p-D3eWMME9.js.map +0 -1
- package/dist/components/p-D6APFL6N.js +0 -243
- package/dist/components/p-D6APFL6N.js.map +0 -1
- package/dist/components/p-DZJHk4fr.js +0 -3759
- package/dist/components/p-DZJHk4fr.js.map +0 -1
- package/dist/components/p-DiUP3TzF.js +0 -140
- package/dist/components/p-DiUP3TzF.js.map +0 -1
- package/dist/components/p-DpDooigg.js +0 -99
- package/dist/components/p-DpDooigg.js.map +0 -1
- package/dist/components/p-Dr-67WvG.js +0 -94
- package/dist/components/p-Dr-67WvG.js.map +0 -1
- package/dist/components/p-DvapDVBj.js +0 -176
- package/dist/components/p-DvapDVBj.js.map +0 -1
- package/dist/components/p-Dz1GUhVy.js.map +0 -1
- package/dist/components/p-IlwlcG9l.js.map +0 -1
- package/dist/components/p-W6vOfMC9.js +0 -63
- package/dist/components/p-W6vOfMC9.js.map +0 -1
- package/dist/components/p-nfYynlVq.js +0 -90
- package/dist/components/p-nfYynlVq.js.map +0 -1
- package/dist/components/p-tyaJ-nGV.js +0 -97
- package/dist/components/p-tyaJ-nGV.js.map +0 -1
- package/dist/components/p-u-maNLLs.js +0 -145
- package/dist/components/p-u-maNLLs.js.map +0 -1
- package/dist/esm/_commonjsHelpers-B85MJLTf.js.map +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js +0 -6
- package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
- package/dist/esm/clsx-ChV9xqsO.js.map +0 -1
- package/dist/esm/collapse.animation-DZDm0vSK.js.map +0 -1
- package/dist/esm/constants-BReL3Lsa.js.map +0 -1
- package/dist/esm/events.utils-B6GgGra-.js.map +0 -1
- package/dist/esm/fade.animation-DcRL9lcm.js.map +0 -1
- package/dist/esm/grow.animation-D7ep_aVl.js.map +0 -1
- package/dist/esm/i18n.utils-IlwlcG9l.js +0 -2485
- package/dist/esm/i18n.utils-IlwlcG9l.js.map +0 -1
- package/dist/esm/index-CasQushP.js +0 -2811
- package/dist/esm/index-CasQushP.js.map +0 -1
- package/dist/esm/index.esm-D3eWMME9.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/inputmask-CSo292ul.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/native.js.map +0 -1
- package/dist/esm/nv-accordion-item.entry.js.map +0 -1
- package/dist/esm/nv-accordion.entry.js.map +0 -1
- package/dist/esm/nv-alert.entry.js.map +0 -1
- package/dist/esm/nv-avatar.entry.js.map +0 -1
- package/dist/esm/nv-badge.nv-fielddropdownitemcheck.entry.js.map +0 -1
- package/dist/esm/nv-breadcrumb.entry.js.map +0 -1
- package/dist/esm/nv-breadcrumbs.entry.js.map +0 -1
- package/dist/esm/nv-button.entry.js.map +0 -1
- package/dist/esm/nv-buttongroup.entry.js.map +0 -1
- package/dist/esm/nv-calendar.entry.js.map +0 -1
- package/dist/esm/nv-col.entry.js.map +0 -1
- package/dist/esm/nv-datagrid.entry.js.map +0 -1
- package/dist/esm/nv-datagridcolumn.entry.js.map +0 -1
- package/dist/esm/nv-dialog.entry.js.map +0 -1
- package/dist/esm/nv-dialogfooter.nv-dialogheader.entry.js.map +0 -1
- package/dist/esm/nv-drawer.entry.js.map +0 -1
- package/dist/esm/nv-drawerfooter.nv-drawerheader.entry.js.map +0 -1
- package/dist/esm/nv-fieldcheckbox.entry.js.map +0 -1
- package/dist/esm/nv-fielddate.entry.js.map +0 -1
- package/dist/esm/nv-fielddaterange.entry.js.map +0 -1
- package/dist/esm/nv-fielddropdown.entry.js.map +0 -1
- package/dist/esm/nv-fielddropdownitem.entry.js.map +0 -1
- package/dist/esm/nv-fieldmultiselect.entry.js.map +0 -1
- package/dist/esm/nv-fieldnumber.entry.js.map +0 -1
- package/dist/esm/nv-fieldpassword.entry.js.map +0 -1
- package/dist/esm/nv-fieldradio.entry.js.map +0 -1
- package/dist/esm/nv-fieldselect.entry.js.map +0 -1
- package/dist/esm/nv-fieldslider.entry.js.map +0 -1
- package/dist/esm/nv-fieldtext.entry.js.map +0 -1
- package/dist/esm/nv-fieldtextarea.entry.js.map +0 -1
- package/dist/esm/nv-fieldtime.entry.js.map +0 -1
- package/dist/esm/nv-icon.entry.js.map +0 -1
- package/dist/esm/nv-iconbutton.nv-loader.entry.js.map +0 -1
- package/dist/esm/nv-menu.entry.js.map +0 -1
- package/dist/esm/nv-menuitem.entry.js.map +0 -1
- package/dist/esm/nv-notification-bullet.entry.js.map +0 -1
- package/dist/esm/nv-notification.entry.js.map +0 -1
- package/dist/esm/nv-notificationcontainer.entry.js.map +0 -1
- package/dist/esm/nv-popover.entry.js.map +0 -1
- package/dist/esm/nv-row.entry.js.map +0 -1
- package/dist/esm/nv-sidebar.entry.js.map +0 -1
- package/dist/esm/nv-sidebarcontent.entry.js.map +0 -1
- package/dist/esm/nv-sidebardivider.entry.js.map +0 -1
- package/dist/esm/nv-sidebarfooter.entry.js.map +0 -1
- package/dist/esm/nv-sidebargroup.entry.js.map +0 -1
- package/dist/esm/nv-sidebarheader.entry.js.map +0 -1
- package/dist/esm/nv-sidebarlogo.entry.js.map +0 -1
- package/dist/esm/nv-sidebarnavitem.entry.js.map +0 -1
- package/dist/esm/nv-sidebarnavsubitem.entry.js.map +0 -1
- package/dist/esm/nv-split.entry.js.map +0 -1
- package/dist/esm/nv-stack.entry.js.map +0 -1
- package/dist/esm/nv-table.entry.js.map +0 -1
- package/dist/esm/nv-tableheader.entry.js.map +0 -1
- package/dist/esm/nv-toggle.entry.js.map +0 -1
- package/dist/esm/nv-togglebutton.entry.js.map +0 -1
- package/dist/esm/nv-togglebuttongroup.entry.js.map +0 -1
- package/dist/esm/nv-tooltip.entry.js.map +0 -1
- package/dist/esm/slide.animation-CmH5d1of.js.map +0 -1
- package/dist/esm/style-value-types.es-xlgmw4x8.js.map +0 -1
- package/dist/esm/timeline.animation-CgHCo_Ho.js.map +0 -1
- package/dist/esm/uri.utils-CnI0auJM.js.map +0 -1
- package/dist/esm/v4-BdYh22OP.js.map +0 -1
- package/dist/lib/generators/angular-output.js.map +0 -1
- package/dist/lib/generators/docs-blazor.js.map +0 -1
- package/dist/lib/generators/vue-output.js.map +0 -1
- package/dist/lib/utils/componentBinding.js.map +0 -1
- package/dist/lib/utils/parseToCSharpTypes.js.map +0 -1
- package/dist/lib/utils/spread.js.map +0 -1
- package/dist/lib/utils/test/parseToCSharpTypes.test.js.map +0 -1
- package/dist/native/index.esm.js.map +0 -1
- package/dist/native/loader.esm.js.map +0 -1
- package/dist/native/native.esm.js.map +0 -1
- package/dist/native/nv-accordion-item.entry.esm.js.map +0 -1
- package/dist/native/nv-accordion.entry.esm.js.map +0 -1
- package/dist/native/nv-alert.entry.esm.js.map +0 -1
- package/dist/native/nv-avatar.entry.esm.js.map +0 -1
- package/dist/native/nv-badge.nv-fielddropdownitemcheck.entry.esm.js.map +0 -1
- package/dist/native/nv-breadcrumb.entry.esm.js.map +0 -1
- package/dist/native/nv-breadcrumbs.entry.esm.js.map +0 -1
- package/dist/native/nv-button.entry.esm.js.map +0 -1
- package/dist/native/nv-buttongroup.entry.esm.js.map +0 -1
- package/dist/native/nv-calendar.entry.esm.js.map +0 -1
- package/dist/native/nv-col.entry.esm.js.map +0 -1
- package/dist/native/nv-datagrid.entry.esm.js.map +0 -1
- package/dist/native/nv-datagridcolumn.entry.esm.js.map +0 -1
- package/dist/native/nv-dialog.entry.esm.js.map +0 -1
- package/dist/native/nv-dialogfooter.nv-dialogheader.entry.esm.js.map +0 -1
- package/dist/native/nv-drawer.entry.esm.js.map +0 -1
- package/dist/native/nv-drawerfooter.nv-drawerheader.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldcheckbox.entry.esm.js.map +0 -1
- package/dist/native/nv-fielddate.entry.esm.js.map +0 -1
- package/dist/native/nv-fielddaterange.entry.esm.js.map +0 -1
- package/dist/native/nv-fielddropdown.entry.esm.js.map +0 -1
- package/dist/native/nv-fielddropdownitem.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldmultiselect.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldnumber.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldpassword.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldradio.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldselect.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldslider.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldtext.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldtextarea.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldtime.entry.esm.js.map +0 -1
- package/dist/native/nv-icon.entry.esm.js.map +0 -1
- package/dist/native/nv-iconbutton.nv-loader.entry.esm.js.map +0 -1
- package/dist/native/nv-menu.entry.esm.js.map +0 -1
- package/dist/native/nv-menuitem.entry.esm.js.map +0 -1
- package/dist/native/nv-notification-bullet.entry.esm.js.map +0 -1
- package/dist/native/nv-notification.entry.esm.js.map +0 -1
- package/dist/native/nv-notificationcontainer.entry.esm.js.map +0 -1
- package/dist/native/nv-popover.entry.esm.js.map +0 -1
- package/dist/native/nv-row.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebar.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebarcontent.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebardivider.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebarfooter.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebargroup.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebarheader.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebarlogo.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebarnavitem.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebarnavsubitem.entry.esm.js.map +0 -1
- package/dist/native/nv-split.entry.esm.js.map +0 -1
- package/dist/native/nv-stack.entry.esm.js.map +0 -1
- package/dist/native/nv-table.entry.esm.js.map +0 -1
- package/dist/native/nv-tableheader.entry.esm.js.map +0 -1
- package/dist/native/nv-toggle.entry.esm.js.map +0 -1
- package/dist/native/nv-togglebutton.entry.esm.js.map +0 -1
- package/dist/native/nv-togglebuttongroup.entry.esm.js.map +0 -1
- package/dist/native/nv-tooltip.entry.esm.js.map +0 -1
- package/dist/native/p-02e6228a.entry.js +0 -2
- package/dist/native/p-02e6228a.entry.js.map +0 -1
- package/dist/native/p-04a2fe7f.entry.js +0 -2
- package/dist/native/p-04a2fe7f.entry.js.map +0 -1
- package/dist/native/p-08204da4.entry.js +0 -2
- package/dist/native/p-08204da4.entry.js.map +0 -1
- package/dist/native/p-0e07b91b.entry.js +0 -2
- package/dist/native/p-0e07b91b.entry.js.map +0 -1
- package/dist/native/p-136dfb3e.entry.js +0 -2
- package/dist/native/p-136dfb3e.entry.js.map +0 -1
- package/dist/native/p-13YSIyGW.js.map +0 -1
- package/dist/native/p-1f2dd37f.entry.js +0 -2
- package/dist/native/p-1f2dd37f.entry.js.map +0 -1
- package/dist/native/p-255a0482.entry.js +0 -2
- package/dist/native/p-255a0482.entry.js.map +0 -1
- package/dist/native/p-3305a7e6.entry.js +0 -2
- package/dist/native/p-3305a7e6.entry.js.map +0 -1
- package/dist/native/p-36b0a6f0.entry.js +0 -2
- package/dist/native/p-36b0a6f0.entry.js.map +0 -1
- package/dist/native/p-434bc910.entry.js +0 -2
- package/dist/native/p-434bc910.entry.js.map +0 -1
- package/dist/native/p-436029a5.entry.js +0 -2
- package/dist/native/p-436029a5.entry.js.map +0 -1
- package/dist/native/p-460fdf02.entry.js +0 -2
- package/dist/native/p-460fdf02.entry.js.map +0 -1
- package/dist/native/p-477e02cf.entry.js +0 -2
- package/dist/native/p-477e02cf.entry.js.map +0 -1
- package/dist/native/p-4efb582b.entry.js +0 -2
- package/dist/native/p-4efb582b.entry.js.map +0 -1
- package/dist/native/p-4f1dfa32.entry.js +0 -2
- package/dist/native/p-4f1dfa32.entry.js.map +0 -1
- package/dist/native/p-50ce41ac.entry.js +0 -2
- package/dist/native/p-50ce41ac.entry.js.map +0 -1
- package/dist/native/p-51b7de55.entry.js +0 -13
- package/dist/native/p-51b7de55.entry.js.map +0 -1
- package/dist/native/p-5dd120dc.entry.js +0 -2
- package/dist/native/p-5dd120dc.entry.js.map +0 -1
- package/dist/native/p-60bb0d48.entry.js +0 -2
- package/dist/native/p-60bb0d48.entry.js.map +0 -1
- package/dist/native/p-67181258.entry.js +0 -2
- package/dist/native/p-67181258.entry.js.map +0 -1
- package/dist/native/p-6a81884b.entry.js +0 -2
- package/dist/native/p-6a81884b.entry.js.map +0 -1
- package/dist/native/p-6aa483de.entry.js +0 -2
- package/dist/native/p-6aa483de.entry.js.map +0 -1
- package/dist/native/p-6fc79712.entry.js +0 -2
- package/dist/native/p-6fc79712.entry.js.map +0 -1
- package/dist/native/p-70e9e067.entry.js +0 -2
- package/dist/native/p-70e9e067.entry.js.map +0 -1
- package/dist/native/p-729589cb.entry.js +0 -2
- package/dist/native/p-729589cb.entry.js.map +0 -1
- package/dist/native/p-78bf7650.entry.js +0 -2
- package/dist/native/p-78bf7650.entry.js.map +0 -1
- package/dist/native/p-7e6e9ea2.entry.js +0 -2
- package/dist/native/p-7e6e9ea2.entry.js.map +0 -1
- package/dist/native/p-8f1cd9e2.entry.js +0 -2
- package/dist/native/p-8f1cd9e2.entry.js.map +0 -1
- package/dist/native/p-910cd685.entry.js +0 -2
- package/dist/native/p-910cd685.entry.js.map +0 -1
- package/dist/native/p-91eaf02e.entry.js +0 -2
- package/dist/native/p-91eaf02e.entry.js.map +0 -1
- package/dist/native/p-93b77ed4.entry.js +0 -2
- package/dist/native/p-93b77ed4.entry.js.map +0 -1
- package/dist/native/p-93e35975.entry.js +0 -2
- package/dist/native/p-93e35975.entry.js.map +0 -1
- package/dist/native/p-96c45604.entry.js +0 -2
- package/dist/native/p-96c45604.entry.js.map +0 -1
- package/dist/native/p-9b6ad782.entry.js +0 -2
- package/dist/native/p-9b6ad782.entry.js.map +0 -1
- package/dist/native/p-9f32c3ea.entry.js +0 -2
- package/dist/native/p-9f32c3ea.entry.js.map +0 -1
- package/dist/native/p-B6GgGra-.js.map +0 -1
- package/dist/native/p-B85MJLTf.js.map +0 -1
- package/dist/native/p-BReL3Lsa.js.map +0 -1
- package/dist/native/p-BdYh22OP.js.map +0 -1
- package/dist/native/p-Blc6XEY7.js.map +0 -1
- package/dist/native/p-CasQushP.js +0 -3
- package/dist/native/p-CasQushP.js.map +0 -1
- package/dist/native/p-CgHCo_Ho.js.map +0 -1
- package/dist/native/p-ChV9xqsO.js.map +0 -1
- package/dist/native/p-CnI0auJM.js.map +0 -1
- package/dist/native/p-D3eWMME9.js.map +0 -1
- package/dist/native/p-DQuL1Twl.js +0 -2
- package/dist/native/p-DQuL1Twl.js.map +0 -1
- package/dist/native/p-DmUOtOcY.js.map +0 -1
- package/dist/native/p-Hfc8Oh0x.js.map +0 -1
- package/dist/native/p-IlwlcG9l.js +0 -2
- package/dist/native/p-IlwlcG9l.js.map +0 -1
- package/dist/native/p-a6fea322.entry.js +0 -2
- package/dist/native/p-a6fea322.entry.js.map +0 -1
- package/dist/native/p-ae279ae9.entry.js +0 -2
- package/dist/native/p-ae279ae9.entry.js.map +0 -1
- package/dist/native/p-b7765048.entry.js +0 -2
- package/dist/native/p-b7765048.entry.js.map +0 -1
- package/dist/native/p-ba1286aa.entry.js +0 -2
- package/dist/native/p-ba1286aa.entry.js.map +0 -1
- package/dist/native/p-bb52a5a9.entry.js +0 -2
- package/dist/native/p-bb52a5a9.entry.js.map +0 -1
- package/dist/native/p-bc90247e.entry.js +0 -2
- package/dist/native/p-bc90247e.entry.js.map +0 -1
- package/dist/native/p-c2a73a5a.entry.js +0 -2
- package/dist/native/p-c2a73a5a.entry.js.map +0 -1
- package/dist/native/p-c4c11549.entry.js +0 -2
- package/dist/native/p-c4c11549.entry.js.map +0 -1
- package/dist/native/p-c5ecdc49.entry.js +0 -2
- package/dist/native/p-c5ecdc49.entry.js.map +0 -1
- package/dist/native/p-cb1b9edb.entry.js +0 -2
- package/dist/native/p-cb1b9edb.entry.js.map +0 -1
- package/dist/native/p-cdaf54b0.entry.js +0 -2
- package/dist/native/p-cdaf54b0.entry.js.map +0 -1
- package/dist/native/p-ceb8fe8a.entry.js +0 -2
- package/dist/native/p-ceb8fe8a.entry.js.map +0 -1
- package/dist/native/p-daf7541b.entry.js +0 -2
- package/dist/native/p-daf7541b.entry.js.map +0 -1
- package/dist/native/p-de4f53a5.entry.js +0 -2
- package/dist/native/p-de4f53a5.entry.js.map +0 -1
- package/dist/native/p-ded4be77.entry.js +0 -2
- package/dist/native/p-ded4be77.entry.js.map +0 -1
- package/dist/native/p-e1fc5f8c.entry.js +0 -2
- package/dist/native/p-e1fc5f8c.entry.js.map +0 -1
- package/dist/native/p-e6c69f7d.entry.js +0 -2
- package/dist/native/p-e6c69f7d.entry.js.map +0 -1
- package/dist/native/p-e83603f1.entry.js +0 -2
- package/dist/native/p-e83603f1.entry.js.map +0 -1
- package/dist/native/p-ec217581.entry.js +0 -2
- package/dist/native/p-ec217581.entry.js.map +0 -1
- package/dist/native/p-ee694832.entry.js +0 -2
- package/dist/native/p-ee694832.entry.js.map +0 -1
- package/dist/native/p-f39aef8e.entry.js +0 -2
- package/dist/native/p-f39aef8e.entry.js.map +0 -1
- package/dist/native/p-f7e0146e.entry.js +0 -2
- package/dist/native/p-f7e0146e.entry.js.map +0 -1
- package/dist/native/p-sqVK8yoD.js.map +0 -1
- package/dist/native/p-xlgmw4x8.js.map +0 -1
|
@@ -1,2485 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Text normalization utilities for the search engine.
|
|
3
|
-
* Provides functions for normalizing and tokenizing text for search operations.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Normalizes text for search comparison.
|
|
7
|
-
* - Converts to lowercase
|
|
8
|
-
* - Removes accents/diacritics
|
|
9
|
-
* - Replaces punctuation with spaces
|
|
10
|
-
* - Trims whitespace
|
|
11
|
-
* - Collapses multiple spaces into single space
|
|
12
|
-
*
|
|
13
|
-
* @param {string} text - The text to normalize
|
|
14
|
-
* @returns {string} The normalized text
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* normalize('Système Grid') // 'systeme grid'
|
|
18
|
-
* normalize('Hello, World!') // 'hello world'
|
|
19
|
-
* normalize(' Multiple Spaces ') // 'multiple spaces'
|
|
20
|
-
*/
|
|
21
|
-
function normalize(text) {
|
|
22
|
-
if (!text)
|
|
23
|
-
return '';
|
|
24
|
-
return (text
|
|
25
|
-
// Convert to lowercase
|
|
26
|
-
.toLowerCase()
|
|
27
|
-
// Remove accents/diacritics using Unicode normalization
|
|
28
|
-
.normalize('NFD')
|
|
29
|
-
.replace(/[\u0300-\u036f]/g, '')
|
|
30
|
-
// Replace punctuation and special characters with spaces
|
|
31
|
-
.replace(/[^\w\s]/g, ' ')
|
|
32
|
-
// Collapse multiple spaces into single space
|
|
33
|
-
.replace(/\s+/g, ' ')
|
|
34
|
-
// Trim leading/trailing whitespace
|
|
35
|
-
.trim());
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Tokenizes text into an array of normalized tokens.
|
|
39
|
-
* Splits by whitespace and normalizes each token.
|
|
40
|
-
*
|
|
41
|
-
* @param {string} text - The text to tokenize
|
|
42
|
-
* @returns {string[]} Array of normalized tokens
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* tokenize('System Grid Control') // ['system', 'grid', 'control']
|
|
46
|
-
* tokenize('Hello, World!') // ['hello', 'world']
|
|
47
|
-
*/
|
|
48
|
-
function tokenize(text) {
|
|
49
|
-
const normalized = normalize(text);
|
|
50
|
-
if (!normalized)
|
|
51
|
-
return [];
|
|
52
|
-
return normalized.split(' ').filter(token => token.length > 0);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* @fileoverview Guard functions for validating and clamping search parameters.
|
|
57
|
-
* Ensures safe limits for search operations to protect UI performance.
|
|
58
|
-
*/
|
|
59
|
-
/** Default maximum results to return */
|
|
60
|
-
const DEFAULT_MAX_RESULTS = 25;
|
|
61
|
-
/** Minimum allowed max results */
|
|
62
|
-
const MIN_MAX_RESULTS = 10;
|
|
63
|
-
/** Hard cap for max results - protects DOM from rendering too many items */
|
|
64
|
-
const HARD_CAP_MAX_RESULTS = 500;
|
|
65
|
-
/** Default threshold for offloading to Web Worker */
|
|
66
|
-
const DEFAULT_WORKER_THRESHOLD = 2000;
|
|
67
|
-
/** Minimum worker threshold (0 = always use worker) */
|
|
68
|
-
const MIN_WORKER_THRESHOLD = 0;
|
|
69
|
-
/** Maximum worker threshold */
|
|
70
|
-
const MAX_WORKER_THRESHOLD = 50000;
|
|
71
|
-
/** Default fuzzy threshold (0-1, lower = stricter) */
|
|
72
|
-
const DEFAULT_FUZZY_THRESHOLD = 0.3;
|
|
73
|
-
/** Debounce delay for fuzzy mode (ms) */
|
|
74
|
-
const FUZZY_DEBOUNCE_DELAY = 300;
|
|
75
|
-
/**
|
|
76
|
-
* Clamps the maxResults value to safe limits.
|
|
77
|
-
* - Minimum: 10
|
|
78
|
-
* - Default: 200
|
|
79
|
-
* - Hard cap: 500
|
|
80
|
-
*
|
|
81
|
-
* @param {number} [value] - The maxResults value to clamp (undefined uses default)
|
|
82
|
-
* @returns {number} The clamped maxResults value
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* clampMaxResults(undefined) // 200 (default)
|
|
86
|
-
* clampMaxResults(5) // 10 (minimum)
|
|
87
|
-
* clampMaxResults(1000) // 500 (hard cap)
|
|
88
|
-
* clampMaxResults(100) // 100 (valid)
|
|
89
|
-
*/
|
|
90
|
-
function clampMaxResults(value) {
|
|
91
|
-
if (value === undefined || value === null) {
|
|
92
|
-
return DEFAULT_MAX_RESULTS;
|
|
93
|
-
}
|
|
94
|
-
if (value < MIN_MAX_RESULTS) {
|
|
95
|
-
return MIN_MAX_RESULTS;
|
|
96
|
-
}
|
|
97
|
-
if (value > HARD_CAP_MAX_RESULTS) {
|
|
98
|
-
return HARD_CAP_MAX_RESULTS;
|
|
99
|
-
}
|
|
100
|
-
return Math.floor(value);
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Clamps the workerThreshold value to safe limits.
|
|
104
|
-
* - Minimum: 0 (always use worker)
|
|
105
|
-
* - Default: 2000
|
|
106
|
-
* - Maximum: 50000
|
|
107
|
-
*
|
|
108
|
-
* @param {number} [value] - The workerThreshold value to clamp (undefined uses default)
|
|
109
|
-
* @returns {number} The clamped workerThreshold value
|
|
110
|
-
*
|
|
111
|
-
* @example
|
|
112
|
-
* clampWorkerThreshold(undefined) // 2000 (default)
|
|
113
|
-
* clampWorkerThreshold(-100) // 0 (minimum)
|
|
114
|
-
* clampWorkerThreshold(100000) // 50000 (maximum)
|
|
115
|
-
* clampWorkerThreshold(5000) // 5000 (valid)
|
|
116
|
-
*/
|
|
117
|
-
function clampWorkerThreshold(value) {
|
|
118
|
-
if (value === undefined || value === null) {
|
|
119
|
-
return DEFAULT_WORKER_THRESHOLD;
|
|
120
|
-
}
|
|
121
|
-
if (value < MIN_WORKER_THRESHOLD) {
|
|
122
|
-
return MIN_WORKER_THRESHOLD;
|
|
123
|
-
}
|
|
124
|
-
if (value > MAX_WORKER_THRESHOLD) {
|
|
125
|
-
return MAX_WORKER_THRESHOLD;
|
|
126
|
-
}
|
|
127
|
-
return Math.floor(value);
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Clamps the fuzzyThreshold value to valid range.
|
|
131
|
-
* - Minimum: 0 (strictest)
|
|
132
|
-
* - Default: 0.3
|
|
133
|
-
* - Maximum: 1 (most permissive)
|
|
134
|
-
*
|
|
135
|
-
* @param {number} [value] - The fuzzyThreshold value to clamp (undefined uses default)
|
|
136
|
-
* @returns {number} The clamped fuzzyThreshold value
|
|
137
|
-
*
|
|
138
|
-
* @example
|
|
139
|
-
* clampFuzzyThreshold(undefined) // 0.3 (default)
|
|
140
|
-
* clampFuzzyThreshold(-0.5) // 0 (minimum)
|
|
141
|
-
* clampFuzzyThreshold(1.5) // 1 (maximum)
|
|
142
|
-
* clampFuzzyThreshold(0.5) // 0.5 (valid)
|
|
143
|
-
*/
|
|
144
|
-
function clampFuzzyThreshold(value) {
|
|
145
|
-
if (value === undefined || value === null) {
|
|
146
|
-
return DEFAULT_FUZZY_THRESHOLD;
|
|
147
|
-
}
|
|
148
|
-
if (value < 0) {
|
|
149
|
-
return 0;
|
|
150
|
-
}
|
|
151
|
-
if (value > 1) {
|
|
152
|
-
return 1;
|
|
153
|
-
}
|
|
154
|
-
return value;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* @fileoverview Indexing utilities for the search engine.
|
|
159
|
-
* Pre-computes normalized text and tokens for efficient searching.
|
|
160
|
-
*/
|
|
161
|
-
/**
|
|
162
|
-
* Builds a search index from raw items.
|
|
163
|
-
* Pre-computes normalized text and tokens for each item for efficient searching.
|
|
164
|
-
*
|
|
165
|
-
* @param {RawItem[]} items - Array of raw items with id and label
|
|
166
|
-
* @returns {IndexedItem[]} Array of indexed items with pre-computed norm and tokens
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* const items = [
|
|
170
|
-
* { id: '1', label: 'System Grid Control' },
|
|
171
|
-
* { id: '2', label: 'Network Manager' }
|
|
172
|
-
* ];
|
|
173
|
-
* const indexed = buildIndex(items);
|
|
174
|
-
* // [
|
|
175
|
-
* // { id: '1', label: 'System Grid Control', norm: 'system grid control', tokens: ['system', 'grid', 'control'] },
|
|
176
|
-
* // { id: '2', label: 'Network Manager', norm: 'network manager', tokens: ['network', 'manager'] }
|
|
177
|
-
* // ]
|
|
178
|
-
*/
|
|
179
|
-
function buildIndex(items) {
|
|
180
|
-
if (!items || !Array.isArray(items)) {
|
|
181
|
-
return [];
|
|
182
|
-
}
|
|
183
|
-
return items.map(item => {
|
|
184
|
-
const norm = normalize(item.label);
|
|
185
|
-
return {
|
|
186
|
-
id: item.id,
|
|
187
|
-
label: item.label,
|
|
188
|
-
norm,
|
|
189
|
-
tokens: tokenize(item.label),
|
|
190
|
-
};
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* @fileoverview Strict search strategy using normalized substring matching.
|
|
196
|
-
* Fast and deterministic - best for IDs, codes, and references.
|
|
197
|
-
*/
|
|
198
|
-
/**
|
|
199
|
-
* Searches items using strict substring matching.
|
|
200
|
-
* The normalized query must be a substring of the normalized label.
|
|
201
|
-
*
|
|
202
|
-
* This is the fastest search mode but requires exact substring matches.
|
|
203
|
-
* Word order matters: "Grid System" won't match "System Grid".
|
|
204
|
-
*
|
|
205
|
-
* @param {IndexedItem[]} indexedItems - Array of pre-indexed items
|
|
206
|
-
* @param {string} query - The search query
|
|
207
|
-
* @returns {string[]} Array of matching item IDs
|
|
208
|
-
*
|
|
209
|
-
* @example
|
|
210
|
-
* // Given items: [{ id: '1', label: 'System Grid Control', norm: 'system grid control', tokens: [...] }]
|
|
211
|
-
* searchStrict(items, 'System Grid') // ['1'] - matches
|
|
212
|
-
* searchStrict(items, 'Grid Sys') // ['1'] - matches (substring)
|
|
213
|
-
* searchStrict(items, 'Grid System') // [] - no match (wrong order)
|
|
214
|
-
*/
|
|
215
|
-
function searchStrict(indexedItems, query) {
|
|
216
|
-
if (!query || !indexedItems?.length) {
|
|
217
|
-
return indexedItems?.map(item => item.id) || [];
|
|
218
|
-
}
|
|
219
|
-
const normalizedQuery = normalize(query);
|
|
220
|
-
if (!normalizedQuery) {
|
|
221
|
-
return indexedItems.map(item => item.id);
|
|
222
|
-
}
|
|
223
|
-
return indexedItems
|
|
224
|
-
.filter(item => item.norm.includes(normalizedQuery))
|
|
225
|
-
.map(item => item.id);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* @fileoverview Smart search strategy using token-based matching.
|
|
230
|
-
* All query tokens must exist in the target label (order ignored).
|
|
231
|
-
*/
|
|
232
|
-
/**
|
|
233
|
-
* Searches items using token-based matching.
|
|
234
|
-
* All query tokens must exist in the item's normalized text (order ignored).
|
|
235
|
-
*
|
|
236
|
-
* This provides a "smart" feel without fuzzy matching overhead.
|
|
237
|
-
* Word order doesn't matter: "Grid System" will match "System Grid".
|
|
238
|
-
*
|
|
239
|
-
* @param {IndexedItem[]} indexedItems - Array of pre-indexed items
|
|
240
|
-
* @param {string} query - The search query
|
|
241
|
-
* @returns {string[]} Array of matching item IDs
|
|
242
|
-
*
|
|
243
|
-
* @example
|
|
244
|
-
* // Given items: [{ id: '1', label: 'System Grid Control', norm: 'system grid control', tokens: [...] }]
|
|
245
|
-
* searchSmart(items, 'System Grid') // ['1'] - matches (all tokens present)
|
|
246
|
-
* searchSmart(items, 'Grid System') // ['1'] - matches (order ignored)
|
|
247
|
-
* searchSmart(items, 'Grid Sys') // ['1'] - matches (partial tokens allowed as substrings)
|
|
248
|
-
* searchSmart(items, 'System Unknown') // [] - no match ('unknown' not present)
|
|
249
|
-
*/
|
|
250
|
-
function searchSmart(indexedItems, query) {
|
|
251
|
-
if (!query || !indexedItems?.length) {
|
|
252
|
-
return indexedItems?.map(item => item.id) || [];
|
|
253
|
-
}
|
|
254
|
-
const queryTokens = tokenize(query);
|
|
255
|
-
if (!queryTokens.length) {
|
|
256
|
-
return indexedItems.map(item => item.id);
|
|
257
|
-
}
|
|
258
|
-
return indexedItems
|
|
259
|
-
.filter(item => {
|
|
260
|
-
// All query tokens must be found as substrings in the normalized text
|
|
261
|
-
return queryTokens.every(queryToken => item.norm.includes(queryToken));
|
|
262
|
-
})
|
|
263
|
-
.map(item => item.id);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Fuse.js v7.0.0 - Lightweight fuzzy-search (http://fusejs.io)
|
|
268
|
-
*
|
|
269
|
-
* Copyright (c) 2023 Kiro Risk (http://kiro.me)
|
|
270
|
-
* All Rights Reserved. Apache Software License 2.0
|
|
271
|
-
*
|
|
272
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
273
|
-
*/
|
|
274
|
-
|
|
275
|
-
function isArray(value) {
|
|
276
|
-
return !Array.isArray
|
|
277
|
-
? getTag(value) === '[object Array]'
|
|
278
|
-
: Array.isArray(value)
|
|
279
|
-
}
|
|
280
|
-
function baseToString(value) {
|
|
281
|
-
// Exit early for strings to avoid a performance hit in some environments.
|
|
282
|
-
if (typeof value == 'string') {
|
|
283
|
-
return value
|
|
284
|
-
}
|
|
285
|
-
let result = value + '';
|
|
286
|
-
return result == '0' && 1 / value == -Infinity ? '-0' : result
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
function toString(value) {
|
|
290
|
-
return value == null ? '' : baseToString(value)
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function isString(value) {
|
|
294
|
-
return typeof value === 'string'
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
function isNumber(value) {
|
|
298
|
-
return typeof value === 'number'
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
// Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js
|
|
302
|
-
function isBoolean(value) {
|
|
303
|
-
return (
|
|
304
|
-
value === true ||
|
|
305
|
-
value === false ||
|
|
306
|
-
(isObjectLike(value) && getTag(value) == '[object Boolean]')
|
|
307
|
-
)
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
function isObject(value) {
|
|
311
|
-
return typeof value === 'object'
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
// Checks if `value` is object-like.
|
|
315
|
-
function isObjectLike(value) {
|
|
316
|
-
return isObject(value) && value !== null
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
function isDefined(value) {
|
|
320
|
-
return value !== undefined && value !== null
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
function isBlank(value) {
|
|
324
|
-
return !value.trim().length
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
// Gets the `toStringTag` of `value`.
|
|
328
|
-
// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js
|
|
329
|
-
function getTag(value) {
|
|
330
|
-
return value == null
|
|
331
|
-
? value === undefined
|
|
332
|
-
? '[object Undefined]'
|
|
333
|
-
: '[object Null]'
|
|
334
|
-
: Object.prototype.toString.call(value)
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
const INCORRECT_INDEX_TYPE = "Incorrect 'index' type";
|
|
338
|
-
|
|
339
|
-
const LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) =>
|
|
340
|
-
`Invalid value for key ${key}`;
|
|
341
|
-
|
|
342
|
-
const PATTERN_LENGTH_TOO_LARGE = (max) =>
|
|
343
|
-
`Pattern length exceeds max of ${max}.`;
|
|
344
|
-
|
|
345
|
-
const MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`;
|
|
346
|
-
|
|
347
|
-
const INVALID_KEY_WEIGHT_VALUE = (key) =>
|
|
348
|
-
`Property 'weight' in key '${key}' must be a positive integer`;
|
|
349
|
-
|
|
350
|
-
const hasOwn = Object.prototype.hasOwnProperty;
|
|
351
|
-
|
|
352
|
-
class KeyStore {
|
|
353
|
-
constructor(keys) {
|
|
354
|
-
this._keys = [];
|
|
355
|
-
this._keyMap = {};
|
|
356
|
-
|
|
357
|
-
let totalWeight = 0;
|
|
358
|
-
|
|
359
|
-
keys.forEach((key) => {
|
|
360
|
-
let obj = createKey(key);
|
|
361
|
-
|
|
362
|
-
this._keys.push(obj);
|
|
363
|
-
this._keyMap[obj.id] = obj;
|
|
364
|
-
|
|
365
|
-
totalWeight += obj.weight;
|
|
366
|
-
});
|
|
367
|
-
|
|
368
|
-
// Normalize weights so that their sum is equal to 1
|
|
369
|
-
this._keys.forEach((key) => {
|
|
370
|
-
key.weight /= totalWeight;
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
get(keyId) {
|
|
374
|
-
return this._keyMap[keyId]
|
|
375
|
-
}
|
|
376
|
-
keys() {
|
|
377
|
-
return this._keys
|
|
378
|
-
}
|
|
379
|
-
toJSON() {
|
|
380
|
-
return JSON.stringify(this._keys)
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
function createKey(key) {
|
|
385
|
-
let path = null;
|
|
386
|
-
let id = null;
|
|
387
|
-
let src = null;
|
|
388
|
-
let weight = 1;
|
|
389
|
-
let getFn = null;
|
|
390
|
-
|
|
391
|
-
if (isString(key) || isArray(key)) {
|
|
392
|
-
src = key;
|
|
393
|
-
path = createKeyPath(key);
|
|
394
|
-
id = createKeyId(key);
|
|
395
|
-
} else {
|
|
396
|
-
if (!hasOwn.call(key, 'name')) {
|
|
397
|
-
throw new Error(MISSING_KEY_PROPERTY('name'))
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
const name = key.name;
|
|
401
|
-
src = name;
|
|
402
|
-
|
|
403
|
-
if (hasOwn.call(key, 'weight')) {
|
|
404
|
-
weight = key.weight;
|
|
405
|
-
|
|
406
|
-
if (weight <= 0) {
|
|
407
|
-
throw new Error(INVALID_KEY_WEIGHT_VALUE(name))
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
path = createKeyPath(name);
|
|
412
|
-
id = createKeyId(name);
|
|
413
|
-
getFn = key.getFn;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
return { path, id, weight, src, getFn }
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
function createKeyPath(key) {
|
|
420
|
-
return isArray(key) ? key : key.split('.')
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
function createKeyId(key) {
|
|
424
|
-
return isArray(key) ? key.join('.') : key
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
function get(obj, path) {
|
|
428
|
-
let list = [];
|
|
429
|
-
let arr = false;
|
|
430
|
-
|
|
431
|
-
const deepGet = (obj, path, index) => {
|
|
432
|
-
if (!isDefined(obj)) {
|
|
433
|
-
return
|
|
434
|
-
}
|
|
435
|
-
if (!path[index]) {
|
|
436
|
-
// If there's no path left, we've arrived at the object we care about.
|
|
437
|
-
list.push(obj);
|
|
438
|
-
} else {
|
|
439
|
-
let key = path[index];
|
|
440
|
-
|
|
441
|
-
const value = obj[key];
|
|
442
|
-
|
|
443
|
-
if (!isDefined(value)) {
|
|
444
|
-
return
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
// If we're at the last value in the path, and if it's a string/number/bool,
|
|
448
|
-
// add it to the list
|
|
449
|
-
if (
|
|
450
|
-
index === path.length - 1 &&
|
|
451
|
-
(isString(value) || isNumber(value) || isBoolean(value))
|
|
452
|
-
) {
|
|
453
|
-
list.push(toString(value));
|
|
454
|
-
} else if (isArray(value)) {
|
|
455
|
-
arr = true;
|
|
456
|
-
// Search each item in the array.
|
|
457
|
-
for (let i = 0, len = value.length; i < len; i += 1) {
|
|
458
|
-
deepGet(value[i], path, index + 1);
|
|
459
|
-
}
|
|
460
|
-
} else if (path.length) {
|
|
461
|
-
// An object. Recurse further.
|
|
462
|
-
deepGet(value, path, index + 1);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
// Backwards compatibility (since path used to be a string)
|
|
468
|
-
deepGet(obj, isString(path) ? path.split('.') : path, 0);
|
|
469
|
-
|
|
470
|
-
return arr ? list : list[0]
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
const MatchOptions = {
|
|
474
|
-
// Whether the matches should be included in the result set. When `true`, each record in the result
|
|
475
|
-
// set will include the indices of the matched characters.
|
|
476
|
-
// These can consequently be used for highlighting purposes.
|
|
477
|
-
includeMatches: false,
|
|
478
|
-
// When `true`, the matching function will continue to the end of a search pattern even if
|
|
479
|
-
// a perfect match has already been located in the string.
|
|
480
|
-
findAllMatches: false,
|
|
481
|
-
// Minimum number of characters that must be matched before a result is considered a match
|
|
482
|
-
minMatchCharLength: 1
|
|
483
|
-
};
|
|
484
|
-
|
|
485
|
-
const BasicOptions = {
|
|
486
|
-
// When `true`, the algorithm continues searching to the end of the input even if a perfect
|
|
487
|
-
// match is found before the end of the same input.
|
|
488
|
-
isCaseSensitive: false,
|
|
489
|
-
// When true, the matching function will continue to the end of a search pattern even if
|
|
490
|
-
includeScore: false,
|
|
491
|
-
// List of properties that will be searched. This also supports nested properties.
|
|
492
|
-
keys: [],
|
|
493
|
-
// Whether to sort the result list, by score
|
|
494
|
-
shouldSort: true,
|
|
495
|
-
// Default sort function: sort by ascending score, ascending index
|
|
496
|
-
sortFn: (a, b) =>
|
|
497
|
-
a.score === b.score ? (a.idx < b.idx ? -1 : 1) : a.score < b.score ? -1 : 1
|
|
498
|
-
};
|
|
499
|
-
|
|
500
|
-
const FuzzyOptions = {
|
|
501
|
-
// Approximately where in the text is the pattern expected to be found?
|
|
502
|
-
location: 0,
|
|
503
|
-
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
|
|
504
|
-
// (of both letters and location), a threshold of '1.0' would match anything.
|
|
505
|
-
threshold: 0.6,
|
|
506
|
-
// Determines how close the match must be to the fuzzy location (specified above).
|
|
507
|
-
// An exact letter match which is 'distance' characters away from the fuzzy location
|
|
508
|
-
// would score as a complete mismatch. A distance of '0' requires the match be at
|
|
509
|
-
// the exact location specified, a threshold of '1000' would require a perfect match
|
|
510
|
-
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
|
|
511
|
-
distance: 100
|
|
512
|
-
};
|
|
513
|
-
|
|
514
|
-
const AdvancedOptions = {
|
|
515
|
-
// When `true`, it enables the use of unix-like search commands
|
|
516
|
-
useExtendedSearch: false,
|
|
517
|
-
// The get function to use when fetching an object's properties.
|
|
518
|
-
// The default will search nested paths *ie foo.bar.baz*
|
|
519
|
-
getFn: get,
|
|
520
|
-
// When `true`, search will ignore `location` and `distance`, so it won't matter
|
|
521
|
-
// where in the string the pattern appears.
|
|
522
|
-
// More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
|
|
523
|
-
ignoreLocation: false,
|
|
524
|
-
// When `true`, the calculation for the relevance score (used for sorting) will
|
|
525
|
-
// ignore the field-length norm.
|
|
526
|
-
// More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
|
|
527
|
-
ignoreFieldNorm: false,
|
|
528
|
-
// The weight to determine how much field length norm effects scoring.
|
|
529
|
-
fieldNormWeight: 1
|
|
530
|
-
};
|
|
531
|
-
|
|
532
|
-
var Config = {
|
|
533
|
-
...BasicOptions,
|
|
534
|
-
...MatchOptions,
|
|
535
|
-
...FuzzyOptions,
|
|
536
|
-
...AdvancedOptions
|
|
537
|
-
};
|
|
538
|
-
|
|
539
|
-
const SPACE = /[^ ]+/g;
|
|
540
|
-
|
|
541
|
-
// Field-length norm: the shorter the field, the higher the weight.
|
|
542
|
-
// Set to 3 decimals to reduce index size.
|
|
543
|
-
function norm(weight = 1, mantissa = 3) {
|
|
544
|
-
const cache = new Map();
|
|
545
|
-
const m = Math.pow(10, mantissa);
|
|
546
|
-
|
|
547
|
-
return {
|
|
548
|
-
get(value) {
|
|
549
|
-
const numTokens = value.match(SPACE).length;
|
|
550
|
-
|
|
551
|
-
if (cache.has(numTokens)) {
|
|
552
|
-
return cache.get(numTokens)
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
// Default function is 1/sqrt(x), weight makes that variable
|
|
556
|
-
const norm = 1 / Math.pow(numTokens, 0.5 * weight);
|
|
557
|
-
|
|
558
|
-
// In place of `toFixed(mantissa)`, for faster computation
|
|
559
|
-
const n = parseFloat(Math.round(norm * m) / m);
|
|
560
|
-
|
|
561
|
-
cache.set(numTokens, n);
|
|
562
|
-
|
|
563
|
-
return n
|
|
564
|
-
},
|
|
565
|
-
clear() {
|
|
566
|
-
cache.clear();
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
class FuseIndex {
|
|
572
|
-
constructor({
|
|
573
|
-
getFn = Config.getFn,
|
|
574
|
-
fieldNormWeight = Config.fieldNormWeight
|
|
575
|
-
} = {}) {
|
|
576
|
-
this.norm = norm(fieldNormWeight, 3);
|
|
577
|
-
this.getFn = getFn;
|
|
578
|
-
this.isCreated = false;
|
|
579
|
-
|
|
580
|
-
this.setIndexRecords();
|
|
581
|
-
}
|
|
582
|
-
setSources(docs = []) {
|
|
583
|
-
this.docs = docs;
|
|
584
|
-
}
|
|
585
|
-
setIndexRecords(records = []) {
|
|
586
|
-
this.records = records;
|
|
587
|
-
}
|
|
588
|
-
setKeys(keys = []) {
|
|
589
|
-
this.keys = keys;
|
|
590
|
-
this._keysMap = {};
|
|
591
|
-
keys.forEach((key, idx) => {
|
|
592
|
-
this._keysMap[key.id] = idx;
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
create() {
|
|
596
|
-
if (this.isCreated || !this.docs.length) {
|
|
597
|
-
return
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
this.isCreated = true;
|
|
601
|
-
|
|
602
|
-
// List is Array<String>
|
|
603
|
-
if (isString(this.docs[0])) {
|
|
604
|
-
this.docs.forEach((doc, docIndex) => {
|
|
605
|
-
this._addString(doc, docIndex);
|
|
606
|
-
});
|
|
607
|
-
} else {
|
|
608
|
-
// List is Array<Object>
|
|
609
|
-
this.docs.forEach((doc, docIndex) => {
|
|
610
|
-
this._addObject(doc, docIndex);
|
|
611
|
-
});
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
this.norm.clear();
|
|
615
|
-
}
|
|
616
|
-
// Adds a doc to the end of the index
|
|
617
|
-
add(doc) {
|
|
618
|
-
const idx = this.size();
|
|
619
|
-
|
|
620
|
-
if (isString(doc)) {
|
|
621
|
-
this._addString(doc, idx);
|
|
622
|
-
} else {
|
|
623
|
-
this._addObject(doc, idx);
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
// Removes the doc at the specified index of the index
|
|
627
|
-
removeAt(idx) {
|
|
628
|
-
this.records.splice(idx, 1);
|
|
629
|
-
|
|
630
|
-
// Change ref index of every subsquent doc
|
|
631
|
-
for (let i = idx, len = this.size(); i < len; i += 1) {
|
|
632
|
-
this.records[i].i -= 1;
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
getValueForItemAtKeyId(item, keyId) {
|
|
636
|
-
return item[this._keysMap[keyId]]
|
|
637
|
-
}
|
|
638
|
-
size() {
|
|
639
|
-
return this.records.length
|
|
640
|
-
}
|
|
641
|
-
_addString(doc, docIndex) {
|
|
642
|
-
if (!isDefined(doc) || isBlank(doc)) {
|
|
643
|
-
return
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
let record = {
|
|
647
|
-
v: doc,
|
|
648
|
-
i: docIndex,
|
|
649
|
-
n: this.norm.get(doc)
|
|
650
|
-
};
|
|
651
|
-
|
|
652
|
-
this.records.push(record);
|
|
653
|
-
}
|
|
654
|
-
_addObject(doc, docIndex) {
|
|
655
|
-
let record = { i: docIndex, $: {} };
|
|
656
|
-
|
|
657
|
-
// Iterate over every key (i.e, path), and fetch the value at that key
|
|
658
|
-
this.keys.forEach((key, keyIndex) => {
|
|
659
|
-
let value = key.getFn ? key.getFn(doc) : this.getFn(doc, key.path);
|
|
660
|
-
|
|
661
|
-
if (!isDefined(value)) {
|
|
662
|
-
return
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
if (isArray(value)) {
|
|
666
|
-
let subRecords = [];
|
|
667
|
-
const stack = [{ nestedArrIndex: -1, value }];
|
|
668
|
-
|
|
669
|
-
while (stack.length) {
|
|
670
|
-
const { nestedArrIndex, value } = stack.pop();
|
|
671
|
-
|
|
672
|
-
if (!isDefined(value)) {
|
|
673
|
-
continue
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
if (isString(value) && !isBlank(value)) {
|
|
677
|
-
let subRecord = {
|
|
678
|
-
v: value,
|
|
679
|
-
i: nestedArrIndex,
|
|
680
|
-
n: this.norm.get(value)
|
|
681
|
-
};
|
|
682
|
-
|
|
683
|
-
subRecords.push(subRecord);
|
|
684
|
-
} else if (isArray(value)) {
|
|
685
|
-
value.forEach((item, k) => {
|
|
686
|
-
stack.push({
|
|
687
|
-
nestedArrIndex: k,
|
|
688
|
-
value: item
|
|
689
|
-
});
|
|
690
|
-
});
|
|
691
|
-
} else ;
|
|
692
|
-
}
|
|
693
|
-
record.$[keyIndex] = subRecords;
|
|
694
|
-
} else if (isString(value) && !isBlank(value)) {
|
|
695
|
-
let subRecord = {
|
|
696
|
-
v: value,
|
|
697
|
-
n: this.norm.get(value)
|
|
698
|
-
};
|
|
699
|
-
|
|
700
|
-
record.$[keyIndex] = subRecord;
|
|
701
|
-
}
|
|
702
|
-
});
|
|
703
|
-
|
|
704
|
-
this.records.push(record);
|
|
705
|
-
}
|
|
706
|
-
toJSON() {
|
|
707
|
-
return {
|
|
708
|
-
keys: this.keys,
|
|
709
|
-
records: this.records
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
function createIndex(
|
|
715
|
-
keys,
|
|
716
|
-
docs,
|
|
717
|
-
{ getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}
|
|
718
|
-
) {
|
|
719
|
-
const myIndex = new FuseIndex({ getFn, fieldNormWeight });
|
|
720
|
-
myIndex.setKeys(keys.map(createKey));
|
|
721
|
-
myIndex.setSources(docs);
|
|
722
|
-
myIndex.create();
|
|
723
|
-
return myIndex
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
function parseIndex(
|
|
727
|
-
data,
|
|
728
|
-
{ getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}
|
|
729
|
-
) {
|
|
730
|
-
const { keys, records } = data;
|
|
731
|
-
const myIndex = new FuseIndex({ getFn, fieldNormWeight });
|
|
732
|
-
myIndex.setKeys(keys);
|
|
733
|
-
myIndex.setIndexRecords(records);
|
|
734
|
-
return myIndex
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
function computeScore$1(
|
|
738
|
-
pattern,
|
|
739
|
-
{
|
|
740
|
-
errors = 0,
|
|
741
|
-
currentLocation = 0,
|
|
742
|
-
expectedLocation = 0,
|
|
743
|
-
distance = Config.distance,
|
|
744
|
-
ignoreLocation = Config.ignoreLocation
|
|
745
|
-
} = {}
|
|
746
|
-
) {
|
|
747
|
-
const accuracy = errors / pattern.length;
|
|
748
|
-
|
|
749
|
-
if (ignoreLocation) {
|
|
750
|
-
return accuracy
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
const proximity = Math.abs(expectedLocation - currentLocation);
|
|
754
|
-
|
|
755
|
-
if (!distance) {
|
|
756
|
-
// Dodge divide by zero error.
|
|
757
|
-
return proximity ? 1.0 : accuracy
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
return accuracy + proximity / distance
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
function convertMaskToIndices(
|
|
764
|
-
matchmask = [],
|
|
765
|
-
minMatchCharLength = Config.minMatchCharLength
|
|
766
|
-
) {
|
|
767
|
-
let indices = [];
|
|
768
|
-
let start = -1;
|
|
769
|
-
let end = -1;
|
|
770
|
-
let i = 0;
|
|
771
|
-
|
|
772
|
-
for (let len = matchmask.length; i < len; i += 1) {
|
|
773
|
-
let match = matchmask[i];
|
|
774
|
-
if (match && start === -1) {
|
|
775
|
-
start = i;
|
|
776
|
-
} else if (!match && start !== -1) {
|
|
777
|
-
end = i - 1;
|
|
778
|
-
if (end - start + 1 >= minMatchCharLength) {
|
|
779
|
-
indices.push([start, end]);
|
|
780
|
-
}
|
|
781
|
-
start = -1;
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
// (i-1 - start) + 1 => i - start
|
|
786
|
-
if (matchmask[i - 1] && i - start >= minMatchCharLength) {
|
|
787
|
-
indices.push([start, i - 1]);
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
return indices
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
// Machine word size
|
|
794
|
-
const MAX_BITS = 32;
|
|
795
|
-
|
|
796
|
-
function search$1(
|
|
797
|
-
text,
|
|
798
|
-
pattern,
|
|
799
|
-
patternAlphabet,
|
|
800
|
-
{
|
|
801
|
-
location = Config.location,
|
|
802
|
-
distance = Config.distance,
|
|
803
|
-
threshold = Config.threshold,
|
|
804
|
-
findAllMatches = Config.findAllMatches,
|
|
805
|
-
minMatchCharLength = Config.minMatchCharLength,
|
|
806
|
-
includeMatches = Config.includeMatches,
|
|
807
|
-
ignoreLocation = Config.ignoreLocation
|
|
808
|
-
} = {}
|
|
809
|
-
) {
|
|
810
|
-
if (pattern.length > MAX_BITS) {
|
|
811
|
-
throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS))
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
const patternLen = pattern.length;
|
|
815
|
-
// Set starting location at beginning text and initialize the alphabet.
|
|
816
|
-
const textLen = text.length;
|
|
817
|
-
// Handle the case when location > text.length
|
|
818
|
-
const expectedLocation = Math.max(0, Math.min(location, textLen));
|
|
819
|
-
// Highest score beyond which we give up.
|
|
820
|
-
let currentThreshold = threshold;
|
|
821
|
-
// Is there a nearby exact match? (speedup)
|
|
822
|
-
let bestLocation = expectedLocation;
|
|
823
|
-
|
|
824
|
-
// Performance: only computer matches when the minMatchCharLength > 1
|
|
825
|
-
// OR if `includeMatches` is true.
|
|
826
|
-
const computeMatches = minMatchCharLength > 1 || includeMatches;
|
|
827
|
-
// A mask of the matches, used for building the indices
|
|
828
|
-
const matchMask = computeMatches ? Array(textLen) : [];
|
|
829
|
-
|
|
830
|
-
let index;
|
|
831
|
-
|
|
832
|
-
// Get all exact matches, here for speed up
|
|
833
|
-
while ((index = text.indexOf(pattern, bestLocation)) > -1) {
|
|
834
|
-
let score = computeScore$1(pattern, {
|
|
835
|
-
currentLocation: index,
|
|
836
|
-
expectedLocation,
|
|
837
|
-
distance,
|
|
838
|
-
ignoreLocation
|
|
839
|
-
});
|
|
840
|
-
|
|
841
|
-
currentThreshold = Math.min(score, currentThreshold);
|
|
842
|
-
bestLocation = index + patternLen;
|
|
843
|
-
|
|
844
|
-
if (computeMatches) {
|
|
845
|
-
let i = 0;
|
|
846
|
-
while (i < patternLen) {
|
|
847
|
-
matchMask[index + i] = 1;
|
|
848
|
-
i += 1;
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
// Reset the best location
|
|
854
|
-
bestLocation = -1;
|
|
855
|
-
|
|
856
|
-
let lastBitArr = [];
|
|
857
|
-
let finalScore = 1;
|
|
858
|
-
let binMax = patternLen + textLen;
|
|
859
|
-
|
|
860
|
-
const mask = 1 << (patternLen - 1);
|
|
861
|
-
|
|
862
|
-
for (let i = 0; i < patternLen; i += 1) {
|
|
863
|
-
// Scan for the best match; each iteration allows for one more error.
|
|
864
|
-
// Run a binary search to determine how far from the match location we can stray
|
|
865
|
-
// at this error level.
|
|
866
|
-
let binMin = 0;
|
|
867
|
-
let binMid = binMax;
|
|
868
|
-
|
|
869
|
-
while (binMin < binMid) {
|
|
870
|
-
const score = computeScore$1(pattern, {
|
|
871
|
-
errors: i,
|
|
872
|
-
currentLocation: expectedLocation + binMid,
|
|
873
|
-
expectedLocation,
|
|
874
|
-
distance,
|
|
875
|
-
ignoreLocation
|
|
876
|
-
});
|
|
877
|
-
|
|
878
|
-
if (score <= currentThreshold) {
|
|
879
|
-
binMin = binMid;
|
|
880
|
-
} else {
|
|
881
|
-
binMax = binMid;
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
binMid = Math.floor((binMax - binMin) / 2 + binMin);
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
// Use the result from this iteration as the maximum for the next.
|
|
888
|
-
binMax = binMid;
|
|
889
|
-
|
|
890
|
-
let start = Math.max(1, expectedLocation - binMid + 1);
|
|
891
|
-
let finish = findAllMatches
|
|
892
|
-
? textLen
|
|
893
|
-
: Math.min(expectedLocation + binMid, textLen) + patternLen;
|
|
894
|
-
|
|
895
|
-
// Initialize the bit array
|
|
896
|
-
let bitArr = Array(finish + 2);
|
|
897
|
-
|
|
898
|
-
bitArr[finish + 1] = (1 << i) - 1;
|
|
899
|
-
|
|
900
|
-
for (let j = finish; j >= start; j -= 1) {
|
|
901
|
-
let currentLocation = j - 1;
|
|
902
|
-
let charMatch = patternAlphabet[text.charAt(currentLocation)];
|
|
903
|
-
|
|
904
|
-
if (computeMatches) {
|
|
905
|
-
// Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)
|
|
906
|
-
matchMask[currentLocation] = +!!charMatch;
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
// First pass: exact match
|
|
910
|
-
bitArr[j] = ((bitArr[j + 1] << 1) | 1) & charMatch;
|
|
911
|
-
|
|
912
|
-
// Subsequent passes: fuzzy match
|
|
913
|
-
if (i) {
|
|
914
|
-
bitArr[j] |=
|
|
915
|
-
((lastBitArr[j + 1] | lastBitArr[j]) << 1) | 1 | lastBitArr[j + 1];
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
if (bitArr[j] & mask) {
|
|
919
|
-
finalScore = computeScore$1(pattern, {
|
|
920
|
-
errors: i,
|
|
921
|
-
currentLocation,
|
|
922
|
-
expectedLocation,
|
|
923
|
-
distance,
|
|
924
|
-
ignoreLocation
|
|
925
|
-
});
|
|
926
|
-
|
|
927
|
-
// This match will almost certainly be better than any existing match.
|
|
928
|
-
// But check anyway.
|
|
929
|
-
if (finalScore <= currentThreshold) {
|
|
930
|
-
// Indeed it is
|
|
931
|
-
currentThreshold = finalScore;
|
|
932
|
-
bestLocation = currentLocation;
|
|
933
|
-
|
|
934
|
-
// Already passed `loc`, downhill from here on in.
|
|
935
|
-
if (bestLocation <= expectedLocation) {
|
|
936
|
-
break
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
// When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.
|
|
940
|
-
start = Math.max(1, 2 * expectedLocation - bestLocation);
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
|
|
945
|
-
// No hope for a (better) match at greater error levels.
|
|
946
|
-
const score = computeScore$1(pattern, {
|
|
947
|
-
errors: i + 1,
|
|
948
|
-
currentLocation: expectedLocation,
|
|
949
|
-
expectedLocation,
|
|
950
|
-
distance,
|
|
951
|
-
ignoreLocation
|
|
952
|
-
});
|
|
953
|
-
|
|
954
|
-
if (score > currentThreshold) {
|
|
955
|
-
break
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
lastBitArr = bitArr;
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
const result = {
|
|
962
|
-
isMatch: bestLocation >= 0,
|
|
963
|
-
// Count exact matches (those with a score of 0) to be "almost" exact
|
|
964
|
-
score: Math.max(0.001, finalScore)
|
|
965
|
-
};
|
|
966
|
-
|
|
967
|
-
if (computeMatches) {
|
|
968
|
-
const indices = convertMaskToIndices(matchMask, minMatchCharLength);
|
|
969
|
-
if (!indices.length) {
|
|
970
|
-
result.isMatch = false;
|
|
971
|
-
} else if (includeMatches) {
|
|
972
|
-
result.indices = indices;
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
return result
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
function createPatternAlphabet(pattern) {
|
|
980
|
-
let mask = {};
|
|
981
|
-
|
|
982
|
-
for (let i = 0, len = pattern.length; i < len; i += 1) {
|
|
983
|
-
const char = pattern.charAt(i);
|
|
984
|
-
mask[char] = (mask[char] || 0) | (1 << (len - i - 1));
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
return mask
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
class BitapSearch {
|
|
991
|
-
constructor(
|
|
992
|
-
pattern,
|
|
993
|
-
{
|
|
994
|
-
location = Config.location,
|
|
995
|
-
threshold = Config.threshold,
|
|
996
|
-
distance = Config.distance,
|
|
997
|
-
includeMatches = Config.includeMatches,
|
|
998
|
-
findAllMatches = Config.findAllMatches,
|
|
999
|
-
minMatchCharLength = Config.minMatchCharLength,
|
|
1000
|
-
isCaseSensitive = Config.isCaseSensitive,
|
|
1001
|
-
ignoreLocation = Config.ignoreLocation
|
|
1002
|
-
} = {}
|
|
1003
|
-
) {
|
|
1004
|
-
this.options = {
|
|
1005
|
-
location,
|
|
1006
|
-
threshold,
|
|
1007
|
-
distance,
|
|
1008
|
-
includeMatches,
|
|
1009
|
-
findAllMatches,
|
|
1010
|
-
minMatchCharLength,
|
|
1011
|
-
isCaseSensitive,
|
|
1012
|
-
ignoreLocation
|
|
1013
|
-
};
|
|
1014
|
-
|
|
1015
|
-
this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
|
|
1016
|
-
|
|
1017
|
-
this.chunks = [];
|
|
1018
|
-
|
|
1019
|
-
if (!this.pattern.length) {
|
|
1020
|
-
return
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
const addChunk = (pattern, startIndex) => {
|
|
1024
|
-
this.chunks.push({
|
|
1025
|
-
pattern,
|
|
1026
|
-
alphabet: createPatternAlphabet(pattern),
|
|
1027
|
-
startIndex
|
|
1028
|
-
});
|
|
1029
|
-
};
|
|
1030
|
-
|
|
1031
|
-
const len = this.pattern.length;
|
|
1032
|
-
|
|
1033
|
-
if (len > MAX_BITS) {
|
|
1034
|
-
let i = 0;
|
|
1035
|
-
const remainder = len % MAX_BITS;
|
|
1036
|
-
const end = len - remainder;
|
|
1037
|
-
|
|
1038
|
-
while (i < end) {
|
|
1039
|
-
addChunk(this.pattern.substr(i, MAX_BITS), i);
|
|
1040
|
-
i += MAX_BITS;
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
if (remainder) {
|
|
1044
|
-
const startIndex = len - MAX_BITS;
|
|
1045
|
-
addChunk(this.pattern.substr(startIndex), startIndex);
|
|
1046
|
-
}
|
|
1047
|
-
} else {
|
|
1048
|
-
addChunk(this.pattern, 0);
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
searchIn(text) {
|
|
1053
|
-
const { isCaseSensitive, includeMatches } = this.options;
|
|
1054
|
-
|
|
1055
|
-
if (!isCaseSensitive) {
|
|
1056
|
-
text = text.toLowerCase();
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
// Exact match
|
|
1060
|
-
if (this.pattern === text) {
|
|
1061
|
-
let result = {
|
|
1062
|
-
isMatch: true,
|
|
1063
|
-
score: 0
|
|
1064
|
-
};
|
|
1065
|
-
|
|
1066
|
-
if (includeMatches) {
|
|
1067
|
-
result.indices = [[0, text.length - 1]];
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
return result
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
// Otherwise, use Bitap algorithm
|
|
1074
|
-
const {
|
|
1075
|
-
location,
|
|
1076
|
-
distance,
|
|
1077
|
-
threshold,
|
|
1078
|
-
findAllMatches,
|
|
1079
|
-
minMatchCharLength,
|
|
1080
|
-
ignoreLocation
|
|
1081
|
-
} = this.options;
|
|
1082
|
-
|
|
1083
|
-
let allIndices = [];
|
|
1084
|
-
let totalScore = 0;
|
|
1085
|
-
let hasMatches = false;
|
|
1086
|
-
|
|
1087
|
-
this.chunks.forEach(({ pattern, alphabet, startIndex }) => {
|
|
1088
|
-
const { isMatch, score, indices } = search$1(text, pattern, alphabet, {
|
|
1089
|
-
location: location + startIndex,
|
|
1090
|
-
distance,
|
|
1091
|
-
threshold,
|
|
1092
|
-
findAllMatches,
|
|
1093
|
-
minMatchCharLength,
|
|
1094
|
-
includeMatches,
|
|
1095
|
-
ignoreLocation
|
|
1096
|
-
});
|
|
1097
|
-
|
|
1098
|
-
if (isMatch) {
|
|
1099
|
-
hasMatches = true;
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
totalScore += score;
|
|
1103
|
-
|
|
1104
|
-
if (isMatch && indices) {
|
|
1105
|
-
allIndices = [...allIndices, ...indices];
|
|
1106
|
-
}
|
|
1107
|
-
});
|
|
1108
|
-
|
|
1109
|
-
let result = {
|
|
1110
|
-
isMatch: hasMatches,
|
|
1111
|
-
score: hasMatches ? totalScore / this.chunks.length : 1
|
|
1112
|
-
};
|
|
1113
|
-
|
|
1114
|
-
if (hasMatches && includeMatches) {
|
|
1115
|
-
result.indices = allIndices;
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
return result
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
|
|
1122
|
-
class BaseMatch {
|
|
1123
|
-
constructor(pattern) {
|
|
1124
|
-
this.pattern = pattern;
|
|
1125
|
-
}
|
|
1126
|
-
static isMultiMatch(pattern) {
|
|
1127
|
-
return getMatch(pattern, this.multiRegex)
|
|
1128
|
-
}
|
|
1129
|
-
static isSingleMatch(pattern) {
|
|
1130
|
-
return getMatch(pattern, this.singleRegex)
|
|
1131
|
-
}
|
|
1132
|
-
search(/*text*/) {}
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
function getMatch(pattern, exp) {
|
|
1136
|
-
const matches = pattern.match(exp);
|
|
1137
|
-
return matches ? matches[1] : null
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
// Token: 'file
|
|
1141
|
-
|
|
1142
|
-
class ExactMatch extends BaseMatch {
|
|
1143
|
-
constructor(pattern) {
|
|
1144
|
-
super(pattern);
|
|
1145
|
-
}
|
|
1146
|
-
static get type() {
|
|
1147
|
-
return 'exact'
|
|
1148
|
-
}
|
|
1149
|
-
static get multiRegex() {
|
|
1150
|
-
return /^="(.*)"$/
|
|
1151
|
-
}
|
|
1152
|
-
static get singleRegex() {
|
|
1153
|
-
return /^=(.*)$/
|
|
1154
|
-
}
|
|
1155
|
-
search(text) {
|
|
1156
|
-
const isMatch = text === this.pattern;
|
|
1157
|
-
|
|
1158
|
-
return {
|
|
1159
|
-
isMatch,
|
|
1160
|
-
score: isMatch ? 0 : 1,
|
|
1161
|
-
indices: [0, this.pattern.length - 1]
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
// Token: !fire
|
|
1167
|
-
|
|
1168
|
-
class InverseExactMatch extends BaseMatch {
|
|
1169
|
-
constructor(pattern) {
|
|
1170
|
-
super(pattern);
|
|
1171
|
-
}
|
|
1172
|
-
static get type() {
|
|
1173
|
-
return 'inverse-exact'
|
|
1174
|
-
}
|
|
1175
|
-
static get multiRegex() {
|
|
1176
|
-
return /^!"(.*)"$/
|
|
1177
|
-
}
|
|
1178
|
-
static get singleRegex() {
|
|
1179
|
-
return /^!(.*)$/
|
|
1180
|
-
}
|
|
1181
|
-
search(text) {
|
|
1182
|
-
const index = text.indexOf(this.pattern);
|
|
1183
|
-
const isMatch = index === -1;
|
|
1184
|
-
|
|
1185
|
-
return {
|
|
1186
|
-
isMatch,
|
|
1187
|
-
score: isMatch ? 0 : 1,
|
|
1188
|
-
indices: [0, text.length - 1]
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1193
|
-
// Token: ^file
|
|
1194
|
-
|
|
1195
|
-
class PrefixExactMatch extends BaseMatch {
|
|
1196
|
-
constructor(pattern) {
|
|
1197
|
-
super(pattern);
|
|
1198
|
-
}
|
|
1199
|
-
static get type() {
|
|
1200
|
-
return 'prefix-exact'
|
|
1201
|
-
}
|
|
1202
|
-
static get multiRegex() {
|
|
1203
|
-
return /^\^"(.*)"$/
|
|
1204
|
-
}
|
|
1205
|
-
static get singleRegex() {
|
|
1206
|
-
return /^\^(.*)$/
|
|
1207
|
-
}
|
|
1208
|
-
search(text) {
|
|
1209
|
-
const isMatch = text.startsWith(this.pattern);
|
|
1210
|
-
|
|
1211
|
-
return {
|
|
1212
|
-
isMatch,
|
|
1213
|
-
score: isMatch ? 0 : 1,
|
|
1214
|
-
indices: [0, this.pattern.length - 1]
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
// Token: !^fire
|
|
1220
|
-
|
|
1221
|
-
class InversePrefixExactMatch extends BaseMatch {
|
|
1222
|
-
constructor(pattern) {
|
|
1223
|
-
super(pattern);
|
|
1224
|
-
}
|
|
1225
|
-
static get type() {
|
|
1226
|
-
return 'inverse-prefix-exact'
|
|
1227
|
-
}
|
|
1228
|
-
static get multiRegex() {
|
|
1229
|
-
return /^!\^"(.*)"$/
|
|
1230
|
-
}
|
|
1231
|
-
static get singleRegex() {
|
|
1232
|
-
return /^!\^(.*)$/
|
|
1233
|
-
}
|
|
1234
|
-
search(text) {
|
|
1235
|
-
const isMatch = !text.startsWith(this.pattern);
|
|
1236
|
-
|
|
1237
|
-
return {
|
|
1238
|
-
isMatch,
|
|
1239
|
-
score: isMatch ? 0 : 1,
|
|
1240
|
-
indices: [0, text.length - 1]
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
// Token: .file$
|
|
1246
|
-
|
|
1247
|
-
class SuffixExactMatch extends BaseMatch {
|
|
1248
|
-
constructor(pattern) {
|
|
1249
|
-
super(pattern);
|
|
1250
|
-
}
|
|
1251
|
-
static get type() {
|
|
1252
|
-
return 'suffix-exact'
|
|
1253
|
-
}
|
|
1254
|
-
static get multiRegex() {
|
|
1255
|
-
return /^"(.*)"\$$/
|
|
1256
|
-
}
|
|
1257
|
-
static get singleRegex() {
|
|
1258
|
-
return /^(.*)\$$/
|
|
1259
|
-
}
|
|
1260
|
-
search(text) {
|
|
1261
|
-
const isMatch = text.endsWith(this.pattern);
|
|
1262
|
-
|
|
1263
|
-
return {
|
|
1264
|
-
isMatch,
|
|
1265
|
-
score: isMatch ? 0 : 1,
|
|
1266
|
-
indices: [text.length - this.pattern.length, text.length - 1]
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
// Token: !.file$
|
|
1272
|
-
|
|
1273
|
-
class InverseSuffixExactMatch extends BaseMatch {
|
|
1274
|
-
constructor(pattern) {
|
|
1275
|
-
super(pattern);
|
|
1276
|
-
}
|
|
1277
|
-
static get type() {
|
|
1278
|
-
return 'inverse-suffix-exact'
|
|
1279
|
-
}
|
|
1280
|
-
static get multiRegex() {
|
|
1281
|
-
return /^!"(.*)"\$$/
|
|
1282
|
-
}
|
|
1283
|
-
static get singleRegex() {
|
|
1284
|
-
return /^!(.*)\$$/
|
|
1285
|
-
}
|
|
1286
|
-
search(text) {
|
|
1287
|
-
const isMatch = !text.endsWith(this.pattern);
|
|
1288
|
-
return {
|
|
1289
|
-
isMatch,
|
|
1290
|
-
score: isMatch ? 0 : 1,
|
|
1291
|
-
indices: [0, text.length - 1]
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
class FuzzyMatch extends BaseMatch {
|
|
1297
|
-
constructor(
|
|
1298
|
-
pattern,
|
|
1299
|
-
{
|
|
1300
|
-
location = Config.location,
|
|
1301
|
-
threshold = Config.threshold,
|
|
1302
|
-
distance = Config.distance,
|
|
1303
|
-
includeMatches = Config.includeMatches,
|
|
1304
|
-
findAllMatches = Config.findAllMatches,
|
|
1305
|
-
minMatchCharLength = Config.minMatchCharLength,
|
|
1306
|
-
isCaseSensitive = Config.isCaseSensitive,
|
|
1307
|
-
ignoreLocation = Config.ignoreLocation
|
|
1308
|
-
} = {}
|
|
1309
|
-
) {
|
|
1310
|
-
super(pattern);
|
|
1311
|
-
this._bitapSearch = new BitapSearch(pattern, {
|
|
1312
|
-
location,
|
|
1313
|
-
threshold,
|
|
1314
|
-
distance,
|
|
1315
|
-
includeMatches,
|
|
1316
|
-
findAllMatches,
|
|
1317
|
-
minMatchCharLength,
|
|
1318
|
-
isCaseSensitive,
|
|
1319
|
-
ignoreLocation
|
|
1320
|
-
});
|
|
1321
|
-
}
|
|
1322
|
-
static get type() {
|
|
1323
|
-
return 'fuzzy'
|
|
1324
|
-
}
|
|
1325
|
-
static get multiRegex() {
|
|
1326
|
-
return /^"(.*)"$/
|
|
1327
|
-
}
|
|
1328
|
-
static get singleRegex() {
|
|
1329
|
-
return /^(.*)$/
|
|
1330
|
-
}
|
|
1331
|
-
search(text) {
|
|
1332
|
-
return this._bitapSearch.searchIn(text)
|
|
1333
|
-
}
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
// Token: 'file
|
|
1337
|
-
|
|
1338
|
-
class IncludeMatch extends BaseMatch {
|
|
1339
|
-
constructor(pattern) {
|
|
1340
|
-
super(pattern);
|
|
1341
|
-
}
|
|
1342
|
-
static get type() {
|
|
1343
|
-
return 'include'
|
|
1344
|
-
}
|
|
1345
|
-
static get multiRegex() {
|
|
1346
|
-
return /^'"(.*)"$/
|
|
1347
|
-
}
|
|
1348
|
-
static get singleRegex() {
|
|
1349
|
-
return /^'(.*)$/
|
|
1350
|
-
}
|
|
1351
|
-
search(text) {
|
|
1352
|
-
let location = 0;
|
|
1353
|
-
let index;
|
|
1354
|
-
|
|
1355
|
-
const indices = [];
|
|
1356
|
-
const patternLen = this.pattern.length;
|
|
1357
|
-
|
|
1358
|
-
// Get all exact matches
|
|
1359
|
-
while ((index = text.indexOf(this.pattern, location)) > -1) {
|
|
1360
|
-
location = index + patternLen;
|
|
1361
|
-
indices.push([index, location - 1]);
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
const isMatch = !!indices.length;
|
|
1365
|
-
|
|
1366
|
-
return {
|
|
1367
|
-
isMatch,
|
|
1368
|
-
score: isMatch ? 0 : 1,
|
|
1369
|
-
indices
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
// ❗Order is important. DO NOT CHANGE.
|
|
1375
|
-
const searchers = [
|
|
1376
|
-
ExactMatch,
|
|
1377
|
-
IncludeMatch,
|
|
1378
|
-
PrefixExactMatch,
|
|
1379
|
-
InversePrefixExactMatch,
|
|
1380
|
-
InverseSuffixExactMatch,
|
|
1381
|
-
SuffixExactMatch,
|
|
1382
|
-
InverseExactMatch,
|
|
1383
|
-
FuzzyMatch
|
|
1384
|
-
];
|
|
1385
|
-
|
|
1386
|
-
const searchersLen = searchers.length;
|
|
1387
|
-
|
|
1388
|
-
// Regex to split by spaces, but keep anything in quotes together
|
|
1389
|
-
const SPACE_RE = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;
|
|
1390
|
-
const OR_TOKEN = '|';
|
|
1391
|
-
|
|
1392
|
-
// Return a 2D array representation of the query, for simpler parsing.
|
|
1393
|
-
// Example:
|
|
1394
|
-
// "^core go$ | rb$ | py$ xy$" => [["^core", "go$"], ["rb$"], ["py$", "xy$"]]
|
|
1395
|
-
function parseQuery(pattern, options = {}) {
|
|
1396
|
-
return pattern.split(OR_TOKEN).map((item) => {
|
|
1397
|
-
let query = item
|
|
1398
|
-
.trim()
|
|
1399
|
-
.split(SPACE_RE)
|
|
1400
|
-
.filter((item) => item && !!item.trim());
|
|
1401
|
-
|
|
1402
|
-
let results = [];
|
|
1403
|
-
for (let i = 0, len = query.length; i < len; i += 1) {
|
|
1404
|
-
const queryItem = query[i];
|
|
1405
|
-
|
|
1406
|
-
// 1. Handle multiple query match (i.e, once that are quoted, like `"hello world"`)
|
|
1407
|
-
let found = false;
|
|
1408
|
-
let idx = -1;
|
|
1409
|
-
while (!found && ++idx < searchersLen) {
|
|
1410
|
-
const searcher = searchers[idx];
|
|
1411
|
-
let token = searcher.isMultiMatch(queryItem);
|
|
1412
|
-
if (token) {
|
|
1413
|
-
results.push(new searcher(token, options));
|
|
1414
|
-
found = true;
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
|
-
if (found) {
|
|
1419
|
-
continue
|
|
1420
|
-
}
|
|
1421
|
-
|
|
1422
|
-
// 2. Handle single query matches (i.e, once that are *not* quoted)
|
|
1423
|
-
idx = -1;
|
|
1424
|
-
while (++idx < searchersLen) {
|
|
1425
|
-
const searcher = searchers[idx];
|
|
1426
|
-
let token = searcher.isSingleMatch(queryItem);
|
|
1427
|
-
if (token) {
|
|
1428
|
-
results.push(new searcher(token, options));
|
|
1429
|
-
break
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
return results
|
|
1435
|
-
})
|
|
1436
|
-
}
|
|
1437
|
-
|
|
1438
|
-
// These extended matchers can return an array of matches, as opposed
|
|
1439
|
-
// to a singl match
|
|
1440
|
-
const MultiMatchSet = new Set([FuzzyMatch.type, IncludeMatch.type]);
|
|
1441
|
-
|
|
1442
|
-
/**
|
|
1443
|
-
* Command-like searching
|
|
1444
|
-
* ======================
|
|
1445
|
-
*
|
|
1446
|
-
* Given multiple search terms delimited by spaces.e.g. `^jscript .python$ ruby !java`,
|
|
1447
|
-
* search in a given text.
|
|
1448
|
-
*
|
|
1449
|
-
* Search syntax:
|
|
1450
|
-
*
|
|
1451
|
-
* | Token | Match type | Description |
|
|
1452
|
-
* | ----------- | -------------------------- | -------------------------------------- |
|
|
1453
|
-
* | `jscript` | fuzzy-match | Items that fuzzy match `jscript` |
|
|
1454
|
-
* | `=scheme` | exact-match | Items that are `scheme` |
|
|
1455
|
-
* | `'python` | include-match | Items that include `python` |
|
|
1456
|
-
* | `!ruby` | inverse-exact-match | Items that do not include `ruby` |
|
|
1457
|
-
* | `^java` | prefix-exact-match | Items that start with `java` |
|
|
1458
|
-
* | `!^earlang` | inverse-prefix-exact-match | Items that do not start with `earlang` |
|
|
1459
|
-
* | `.js$` | suffix-exact-match | Items that end with `.js` |
|
|
1460
|
-
* | `!.go$` | inverse-suffix-exact-match | Items that do not end with `.go` |
|
|
1461
|
-
*
|
|
1462
|
-
* A single pipe character acts as an OR operator. For example, the following
|
|
1463
|
-
* query matches entries that start with `core` and end with either`go`, `rb`,
|
|
1464
|
-
* or`py`.
|
|
1465
|
-
*
|
|
1466
|
-
* ```
|
|
1467
|
-
* ^core go$ | rb$ | py$
|
|
1468
|
-
* ```
|
|
1469
|
-
*/
|
|
1470
|
-
class ExtendedSearch {
|
|
1471
|
-
constructor(
|
|
1472
|
-
pattern,
|
|
1473
|
-
{
|
|
1474
|
-
isCaseSensitive = Config.isCaseSensitive,
|
|
1475
|
-
includeMatches = Config.includeMatches,
|
|
1476
|
-
minMatchCharLength = Config.minMatchCharLength,
|
|
1477
|
-
ignoreLocation = Config.ignoreLocation,
|
|
1478
|
-
findAllMatches = Config.findAllMatches,
|
|
1479
|
-
location = Config.location,
|
|
1480
|
-
threshold = Config.threshold,
|
|
1481
|
-
distance = Config.distance
|
|
1482
|
-
} = {}
|
|
1483
|
-
) {
|
|
1484
|
-
this.query = null;
|
|
1485
|
-
this.options = {
|
|
1486
|
-
isCaseSensitive,
|
|
1487
|
-
includeMatches,
|
|
1488
|
-
minMatchCharLength,
|
|
1489
|
-
findAllMatches,
|
|
1490
|
-
ignoreLocation,
|
|
1491
|
-
location,
|
|
1492
|
-
threshold,
|
|
1493
|
-
distance
|
|
1494
|
-
};
|
|
1495
|
-
|
|
1496
|
-
this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
|
|
1497
|
-
this.query = parseQuery(this.pattern, this.options);
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
static condition(_, options) {
|
|
1501
|
-
return options.useExtendedSearch
|
|
1502
|
-
}
|
|
1503
|
-
|
|
1504
|
-
searchIn(text) {
|
|
1505
|
-
const query = this.query;
|
|
1506
|
-
|
|
1507
|
-
if (!query) {
|
|
1508
|
-
return {
|
|
1509
|
-
isMatch: false,
|
|
1510
|
-
score: 1
|
|
1511
|
-
}
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
const { includeMatches, isCaseSensitive } = this.options;
|
|
1515
|
-
|
|
1516
|
-
text = isCaseSensitive ? text : text.toLowerCase();
|
|
1517
|
-
|
|
1518
|
-
let numMatches = 0;
|
|
1519
|
-
let allIndices = [];
|
|
1520
|
-
let totalScore = 0;
|
|
1521
|
-
|
|
1522
|
-
// ORs
|
|
1523
|
-
for (let i = 0, qLen = query.length; i < qLen; i += 1) {
|
|
1524
|
-
const searchers = query[i];
|
|
1525
|
-
|
|
1526
|
-
// Reset indices
|
|
1527
|
-
allIndices.length = 0;
|
|
1528
|
-
numMatches = 0;
|
|
1529
|
-
|
|
1530
|
-
// ANDs
|
|
1531
|
-
for (let j = 0, pLen = searchers.length; j < pLen; j += 1) {
|
|
1532
|
-
const searcher = searchers[j];
|
|
1533
|
-
const { isMatch, indices, score } = searcher.search(text);
|
|
1534
|
-
|
|
1535
|
-
if (isMatch) {
|
|
1536
|
-
numMatches += 1;
|
|
1537
|
-
totalScore += score;
|
|
1538
|
-
if (includeMatches) {
|
|
1539
|
-
const type = searcher.constructor.type;
|
|
1540
|
-
if (MultiMatchSet.has(type)) {
|
|
1541
|
-
allIndices = [...allIndices, ...indices];
|
|
1542
|
-
} else {
|
|
1543
|
-
allIndices.push(indices);
|
|
1544
|
-
}
|
|
1545
|
-
}
|
|
1546
|
-
} else {
|
|
1547
|
-
totalScore = 0;
|
|
1548
|
-
numMatches = 0;
|
|
1549
|
-
allIndices.length = 0;
|
|
1550
|
-
break
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1554
|
-
// OR condition, so if TRUE, return
|
|
1555
|
-
if (numMatches) {
|
|
1556
|
-
let result = {
|
|
1557
|
-
isMatch: true,
|
|
1558
|
-
score: totalScore / numMatches
|
|
1559
|
-
};
|
|
1560
|
-
|
|
1561
|
-
if (includeMatches) {
|
|
1562
|
-
result.indices = allIndices;
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
return result
|
|
1566
|
-
}
|
|
1567
|
-
}
|
|
1568
|
-
|
|
1569
|
-
// Nothing was matched
|
|
1570
|
-
return {
|
|
1571
|
-
isMatch: false,
|
|
1572
|
-
score: 1
|
|
1573
|
-
}
|
|
1574
|
-
}
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
|
-
const registeredSearchers = [];
|
|
1578
|
-
|
|
1579
|
-
function register(...args) {
|
|
1580
|
-
registeredSearchers.push(...args);
|
|
1581
|
-
}
|
|
1582
|
-
|
|
1583
|
-
function createSearcher(pattern, options) {
|
|
1584
|
-
for (let i = 0, len = registeredSearchers.length; i < len; i += 1) {
|
|
1585
|
-
let searcherClass = registeredSearchers[i];
|
|
1586
|
-
if (searcherClass.condition(pattern, options)) {
|
|
1587
|
-
return new searcherClass(pattern, options)
|
|
1588
|
-
}
|
|
1589
|
-
}
|
|
1590
|
-
|
|
1591
|
-
return new BitapSearch(pattern, options)
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
const LogicalOperator = {
|
|
1595
|
-
AND: '$and',
|
|
1596
|
-
OR: '$or'
|
|
1597
|
-
};
|
|
1598
|
-
|
|
1599
|
-
const KeyType = {
|
|
1600
|
-
PATH: '$path',
|
|
1601
|
-
PATTERN: '$val'
|
|
1602
|
-
};
|
|
1603
|
-
|
|
1604
|
-
const isExpression = (query) =>
|
|
1605
|
-
!!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);
|
|
1606
|
-
|
|
1607
|
-
const isPath = (query) => !!query[KeyType.PATH];
|
|
1608
|
-
|
|
1609
|
-
const isLeaf = (query) =>
|
|
1610
|
-
!isArray(query) && isObject(query) && !isExpression(query);
|
|
1611
|
-
|
|
1612
|
-
const convertToExplicit = (query) => ({
|
|
1613
|
-
[LogicalOperator.AND]: Object.keys(query).map((key) => ({
|
|
1614
|
-
[key]: query[key]
|
|
1615
|
-
}))
|
|
1616
|
-
});
|
|
1617
|
-
|
|
1618
|
-
// When `auto` is `true`, the parse function will infer and initialize and add
|
|
1619
|
-
// the appropriate `Searcher` instance
|
|
1620
|
-
function parse(query, options, { auto = true } = {}) {
|
|
1621
|
-
const next = (query) => {
|
|
1622
|
-
let keys = Object.keys(query);
|
|
1623
|
-
|
|
1624
|
-
const isQueryPath = isPath(query);
|
|
1625
|
-
|
|
1626
|
-
if (!isQueryPath && keys.length > 1 && !isExpression(query)) {
|
|
1627
|
-
return next(convertToExplicit(query))
|
|
1628
|
-
}
|
|
1629
|
-
|
|
1630
|
-
if (isLeaf(query)) {
|
|
1631
|
-
const key = isQueryPath ? query[KeyType.PATH] : keys[0];
|
|
1632
|
-
|
|
1633
|
-
const pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];
|
|
1634
|
-
|
|
1635
|
-
if (!isString(pattern)) {
|
|
1636
|
-
throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key))
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1639
|
-
const obj = {
|
|
1640
|
-
keyId: createKeyId(key),
|
|
1641
|
-
pattern
|
|
1642
|
-
};
|
|
1643
|
-
|
|
1644
|
-
if (auto) {
|
|
1645
|
-
obj.searcher = createSearcher(pattern, options);
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
return obj
|
|
1649
|
-
}
|
|
1650
|
-
|
|
1651
|
-
let node = {
|
|
1652
|
-
children: [],
|
|
1653
|
-
operator: keys[0]
|
|
1654
|
-
};
|
|
1655
|
-
|
|
1656
|
-
keys.forEach((key) => {
|
|
1657
|
-
const value = query[key];
|
|
1658
|
-
|
|
1659
|
-
if (isArray(value)) {
|
|
1660
|
-
value.forEach((item) => {
|
|
1661
|
-
node.children.push(next(item));
|
|
1662
|
-
});
|
|
1663
|
-
}
|
|
1664
|
-
});
|
|
1665
|
-
|
|
1666
|
-
return node
|
|
1667
|
-
};
|
|
1668
|
-
|
|
1669
|
-
if (!isExpression(query)) {
|
|
1670
|
-
query = convertToExplicit(query);
|
|
1671
|
-
}
|
|
1672
|
-
|
|
1673
|
-
return next(query)
|
|
1674
|
-
}
|
|
1675
|
-
|
|
1676
|
-
// Practical scoring function
|
|
1677
|
-
function computeScore(
|
|
1678
|
-
results,
|
|
1679
|
-
{ ignoreFieldNorm = Config.ignoreFieldNorm }
|
|
1680
|
-
) {
|
|
1681
|
-
results.forEach((result) => {
|
|
1682
|
-
let totalScore = 1;
|
|
1683
|
-
|
|
1684
|
-
result.matches.forEach(({ key, norm, score }) => {
|
|
1685
|
-
const weight = key ? key.weight : null;
|
|
1686
|
-
|
|
1687
|
-
totalScore *= Math.pow(
|
|
1688
|
-
score === 0 && weight ? Number.EPSILON : score,
|
|
1689
|
-
(weight || 1) * (ignoreFieldNorm ? 1 : norm)
|
|
1690
|
-
);
|
|
1691
|
-
});
|
|
1692
|
-
|
|
1693
|
-
result.score = totalScore;
|
|
1694
|
-
});
|
|
1695
|
-
}
|
|
1696
|
-
|
|
1697
|
-
function transformMatches(result, data) {
|
|
1698
|
-
const matches = result.matches;
|
|
1699
|
-
data.matches = [];
|
|
1700
|
-
|
|
1701
|
-
if (!isDefined(matches)) {
|
|
1702
|
-
return
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
matches.forEach((match) => {
|
|
1706
|
-
if (!isDefined(match.indices) || !match.indices.length) {
|
|
1707
|
-
return
|
|
1708
|
-
}
|
|
1709
|
-
|
|
1710
|
-
const { indices, value } = match;
|
|
1711
|
-
|
|
1712
|
-
let obj = {
|
|
1713
|
-
indices,
|
|
1714
|
-
value
|
|
1715
|
-
};
|
|
1716
|
-
|
|
1717
|
-
if (match.key) {
|
|
1718
|
-
obj.key = match.key.src;
|
|
1719
|
-
}
|
|
1720
|
-
|
|
1721
|
-
if (match.idx > -1) {
|
|
1722
|
-
obj.refIndex = match.idx;
|
|
1723
|
-
}
|
|
1724
|
-
|
|
1725
|
-
data.matches.push(obj);
|
|
1726
|
-
});
|
|
1727
|
-
}
|
|
1728
|
-
|
|
1729
|
-
function transformScore(result, data) {
|
|
1730
|
-
data.score = result.score;
|
|
1731
|
-
}
|
|
1732
|
-
|
|
1733
|
-
function format(
|
|
1734
|
-
results,
|
|
1735
|
-
docs,
|
|
1736
|
-
{
|
|
1737
|
-
includeMatches = Config.includeMatches,
|
|
1738
|
-
includeScore = Config.includeScore
|
|
1739
|
-
} = {}
|
|
1740
|
-
) {
|
|
1741
|
-
const transformers = [];
|
|
1742
|
-
|
|
1743
|
-
if (includeMatches) transformers.push(transformMatches);
|
|
1744
|
-
if (includeScore) transformers.push(transformScore);
|
|
1745
|
-
|
|
1746
|
-
return results.map((result) => {
|
|
1747
|
-
const { idx } = result;
|
|
1748
|
-
|
|
1749
|
-
const data = {
|
|
1750
|
-
item: docs[idx],
|
|
1751
|
-
refIndex: idx
|
|
1752
|
-
};
|
|
1753
|
-
|
|
1754
|
-
if (transformers.length) {
|
|
1755
|
-
transformers.forEach((transformer) => {
|
|
1756
|
-
transformer(result, data);
|
|
1757
|
-
});
|
|
1758
|
-
}
|
|
1759
|
-
|
|
1760
|
-
return data
|
|
1761
|
-
})
|
|
1762
|
-
}
|
|
1763
|
-
|
|
1764
|
-
class Fuse {
|
|
1765
|
-
constructor(docs, options = {}, index) {
|
|
1766
|
-
this.options = { ...Config, ...options };
|
|
1767
|
-
|
|
1768
|
-
this._keyStore = new KeyStore(this.options.keys);
|
|
1769
|
-
|
|
1770
|
-
this.setCollection(docs, index);
|
|
1771
|
-
}
|
|
1772
|
-
|
|
1773
|
-
setCollection(docs, index) {
|
|
1774
|
-
this._docs = docs;
|
|
1775
|
-
|
|
1776
|
-
if (index && !(index instanceof FuseIndex)) {
|
|
1777
|
-
throw new Error(INCORRECT_INDEX_TYPE)
|
|
1778
|
-
}
|
|
1779
|
-
|
|
1780
|
-
this._myIndex =
|
|
1781
|
-
index ||
|
|
1782
|
-
createIndex(this.options.keys, this._docs, {
|
|
1783
|
-
getFn: this.options.getFn,
|
|
1784
|
-
fieldNormWeight: this.options.fieldNormWeight
|
|
1785
|
-
});
|
|
1786
|
-
}
|
|
1787
|
-
|
|
1788
|
-
add(doc) {
|
|
1789
|
-
if (!isDefined(doc)) {
|
|
1790
|
-
return
|
|
1791
|
-
}
|
|
1792
|
-
|
|
1793
|
-
this._docs.push(doc);
|
|
1794
|
-
this._myIndex.add(doc);
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
remove(predicate = (/* doc, idx */) => false) {
|
|
1798
|
-
const results = [];
|
|
1799
|
-
|
|
1800
|
-
for (let i = 0, len = this._docs.length; i < len; i += 1) {
|
|
1801
|
-
const doc = this._docs[i];
|
|
1802
|
-
if (predicate(doc, i)) {
|
|
1803
|
-
this.removeAt(i);
|
|
1804
|
-
i -= 1;
|
|
1805
|
-
len -= 1;
|
|
1806
|
-
|
|
1807
|
-
results.push(doc);
|
|
1808
|
-
}
|
|
1809
|
-
}
|
|
1810
|
-
|
|
1811
|
-
return results
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
removeAt(idx) {
|
|
1815
|
-
this._docs.splice(idx, 1);
|
|
1816
|
-
this._myIndex.removeAt(idx);
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
getIndex() {
|
|
1820
|
-
return this._myIndex
|
|
1821
|
-
}
|
|
1822
|
-
|
|
1823
|
-
search(query, { limit = -1 } = {}) {
|
|
1824
|
-
const {
|
|
1825
|
-
includeMatches,
|
|
1826
|
-
includeScore,
|
|
1827
|
-
shouldSort,
|
|
1828
|
-
sortFn,
|
|
1829
|
-
ignoreFieldNorm
|
|
1830
|
-
} = this.options;
|
|
1831
|
-
|
|
1832
|
-
let results = isString(query)
|
|
1833
|
-
? isString(this._docs[0])
|
|
1834
|
-
? this._searchStringList(query)
|
|
1835
|
-
: this._searchObjectList(query)
|
|
1836
|
-
: this._searchLogical(query);
|
|
1837
|
-
|
|
1838
|
-
computeScore(results, { ignoreFieldNorm });
|
|
1839
|
-
|
|
1840
|
-
if (shouldSort) {
|
|
1841
|
-
results.sort(sortFn);
|
|
1842
|
-
}
|
|
1843
|
-
|
|
1844
|
-
if (isNumber(limit) && limit > -1) {
|
|
1845
|
-
results = results.slice(0, limit);
|
|
1846
|
-
}
|
|
1847
|
-
|
|
1848
|
-
return format(results, this._docs, {
|
|
1849
|
-
includeMatches,
|
|
1850
|
-
includeScore
|
|
1851
|
-
})
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1854
|
-
_searchStringList(query) {
|
|
1855
|
-
const searcher = createSearcher(query, this.options);
|
|
1856
|
-
const { records } = this._myIndex;
|
|
1857
|
-
const results = [];
|
|
1858
|
-
|
|
1859
|
-
// Iterate over every string in the index
|
|
1860
|
-
records.forEach(({ v: text, i: idx, n: norm }) => {
|
|
1861
|
-
if (!isDefined(text)) {
|
|
1862
|
-
return
|
|
1863
|
-
}
|
|
1864
|
-
|
|
1865
|
-
const { isMatch, score, indices } = searcher.searchIn(text);
|
|
1866
|
-
|
|
1867
|
-
if (isMatch) {
|
|
1868
|
-
results.push({
|
|
1869
|
-
item: text,
|
|
1870
|
-
idx,
|
|
1871
|
-
matches: [{ score, value: text, norm, indices }]
|
|
1872
|
-
});
|
|
1873
|
-
}
|
|
1874
|
-
});
|
|
1875
|
-
|
|
1876
|
-
return results
|
|
1877
|
-
}
|
|
1878
|
-
|
|
1879
|
-
_searchLogical(query) {
|
|
1880
|
-
|
|
1881
|
-
const expression = parse(query, this.options);
|
|
1882
|
-
|
|
1883
|
-
const evaluate = (node, item, idx) => {
|
|
1884
|
-
if (!node.children) {
|
|
1885
|
-
const { keyId, searcher } = node;
|
|
1886
|
-
|
|
1887
|
-
const matches = this._findMatches({
|
|
1888
|
-
key: this._keyStore.get(keyId),
|
|
1889
|
-
value: this._myIndex.getValueForItemAtKeyId(item, keyId),
|
|
1890
|
-
searcher
|
|
1891
|
-
});
|
|
1892
|
-
|
|
1893
|
-
if (matches && matches.length) {
|
|
1894
|
-
return [
|
|
1895
|
-
{
|
|
1896
|
-
idx,
|
|
1897
|
-
item,
|
|
1898
|
-
matches
|
|
1899
|
-
}
|
|
1900
|
-
]
|
|
1901
|
-
}
|
|
1902
|
-
|
|
1903
|
-
return []
|
|
1904
|
-
}
|
|
1905
|
-
|
|
1906
|
-
const res = [];
|
|
1907
|
-
for (let i = 0, len = node.children.length; i < len; i += 1) {
|
|
1908
|
-
const child = node.children[i];
|
|
1909
|
-
const result = evaluate(child, item, idx);
|
|
1910
|
-
if (result.length) {
|
|
1911
|
-
res.push(...result);
|
|
1912
|
-
} else if (node.operator === LogicalOperator.AND) {
|
|
1913
|
-
return []
|
|
1914
|
-
}
|
|
1915
|
-
}
|
|
1916
|
-
return res
|
|
1917
|
-
};
|
|
1918
|
-
|
|
1919
|
-
const records = this._myIndex.records;
|
|
1920
|
-
const resultMap = {};
|
|
1921
|
-
const results = [];
|
|
1922
|
-
|
|
1923
|
-
records.forEach(({ $: item, i: idx }) => {
|
|
1924
|
-
if (isDefined(item)) {
|
|
1925
|
-
let expResults = evaluate(expression, item, idx);
|
|
1926
|
-
|
|
1927
|
-
if (expResults.length) {
|
|
1928
|
-
// Dedupe when adding
|
|
1929
|
-
if (!resultMap[idx]) {
|
|
1930
|
-
resultMap[idx] = { idx, item, matches: [] };
|
|
1931
|
-
results.push(resultMap[idx]);
|
|
1932
|
-
}
|
|
1933
|
-
expResults.forEach(({ matches }) => {
|
|
1934
|
-
resultMap[idx].matches.push(...matches);
|
|
1935
|
-
});
|
|
1936
|
-
}
|
|
1937
|
-
}
|
|
1938
|
-
});
|
|
1939
|
-
|
|
1940
|
-
return results
|
|
1941
|
-
}
|
|
1942
|
-
|
|
1943
|
-
_searchObjectList(query) {
|
|
1944
|
-
const searcher = createSearcher(query, this.options);
|
|
1945
|
-
const { keys, records } = this._myIndex;
|
|
1946
|
-
const results = [];
|
|
1947
|
-
|
|
1948
|
-
// List is Array<Object>
|
|
1949
|
-
records.forEach(({ $: item, i: idx }) => {
|
|
1950
|
-
if (!isDefined(item)) {
|
|
1951
|
-
return
|
|
1952
|
-
}
|
|
1953
|
-
|
|
1954
|
-
let matches = [];
|
|
1955
|
-
|
|
1956
|
-
// Iterate over every key (i.e, path), and fetch the value at that key
|
|
1957
|
-
keys.forEach((key, keyIndex) => {
|
|
1958
|
-
matches.push(
|
|
1959
|
-
...this._findMatches({
|
|
1960
|
-
key,
|
|
1961
|
-
value: item[keyIndex],
|
|
1962
|
-
searcher
|
|
1963
|
-
})
|
|
1964
|
-
);
|
|
1965
|
-
});
|
|
1966
|
-
|
|
1967
|
-
if (matches.length) {
|
|
1968
|
-
results.push({
|
|
1969
|
-
idx,
|
|
1970
|
-
item,
|
|
1971
|
-
matches
|
|
1972
|
-
});
|
|
1973
|
-
}
|
|
1974
|
-
});
|
|
1975
|
-
|
|
1976
|
-
return results
|
|
1977
|
-
}
|
|
1978
|
-
_findMatches({ key, value, searcher }) {
|
|
1979
|
-
if (!isDefined(value)) {
|
|
1980
|
-
return []
|
|
1981
|
-
}
|
|
1982
|
-
|
|
1983
|
-
let matches = [];
|
|
1984
|
-
|
|
1985
|
-
if (isArray(value)) {
|
|
1986
|
-
value.forEach(({ v: text, i: idx, n: norm }) => {
|
|
1987
|
-
if (!isDefined(text)) {
|
|
1988
|
-
return
|
|
1989
|
-
}
|
|
1990
|
-
|
|
1991
|
-
const { isMatch, score, indices } = searcher.searchIn(text);
|
|
1992
|
-
|
|
1993
|
-
if (isMatch) {
|
|
1994
|
-
matches.push({
|
|
1995
|
-
score,
|
|
1996
|
-
key,
|
|
1997
|
-
value: text,
|
|
1998
|
-
idx,
|
|
1999
|
-
norm,
|
|
2000
|
-
indices
|
|
2001
|
-
});
|
|
2002
|
-
}
|
|
2003
|
-
});
|
|
2004
|
-
} else {
|
|
2005
|
-
const { v: text, n: norm } = value;
|
|
2006
|
-
|
|
2007
|
-
const { isMatch, score, indices } = searcher.searchIn(text);
|
|
2008
|
-
|
|
2009
|
-
if (isMatch) {
|
|
2010
|
-
matches.push({ score, key, value: text, norm, indices });
|
|
2011
|
-
}
|
|
2012
|
-
}
|
|
2013
|
-
|
|
2014
|
-
return matches
|
|
2015
|
-
}
|
|
2016
|
-
}
|
|
2017
|
-
|
|
2018
|
-
Fuse.version = '7.0.0';
|
|
2019
|
-
Fuse.createIndex = createIndex;
|
|
2020
|
-
Fuse.parseIndex = parseIndex;
|
|
2021
|
-
Fuse.config = Config;
|
|
2022
|
-
|
|
2023
|
-
{
|
|
2024
|
-
Fuse.parseQuery = parse;
|
|
2025
|
-
}
|
|
2026
|
-
|
|
2027
|
-
{
|
|
2028
|
-
register(ExtendedSearch);
|
|
2029
|
-
}
|
|
2030
|
-
|
|
2031
|
-
/**
|
|
2032
|
-
* @fileoverview Fuzzy search strategy using Fuse.js.
|
|
2033
|
-
* Typo-tolerant matching for user-friendly search experience.
|
|
2034
|
-
*/
|
|
2035
|
-
/** Cache for Fuse instances to avoid recreation on every search */
|
|
2036
|
-
let fuseCache = null;
|
|
2037
|
-
/**
|
|
2038
|
-
* Gets or creates a Fuse.js instance for the given items.
|
|
2039
|
-
* Caches the instance to improve performance for repeated searches.
|
|
2040
|
-
* Recreates if items or threshold change.
|
|
2041
|
-
* @param {IndexedItem[]} items - Array of pre-indexed items
|
|
2042
|
-
* @param {number} threshold - Fuzzy threshold (0-1, lower = stricter, default 0.3)
|
|
2043
|
-
* @returns {Fuse<IndexedItem>} Fuse.js instance
|
|
2044
|
-
*/
|
|
2045
|
-
function getFuseInstance(items, threshold) {
|
|
2046
|
-
// Check if we can reuse cached instance (same items AND same threshold)
|
|
2047
|
-
if (fuseCache &&
|
|
2048
|
-
fuseCache.items === items &&
|
|
2049
|
-
fuseCache.threshold === threshold) {
|
|
2050
|
-
return fuseCache.fuse;
|
|
2051
|
-
}
|
|
2052
|
-
// Create new Fuse instance
|
|
2053
|
-
const fuse = new Fuse(items, {
|
|
2054
|
-
keys: ['label', 'norm'],
|
|
2055
|
-
threshold: threshold,
|
|
2056
|
-
includeScore: true,
|
|
2057
|
-
ignoreLocation: true,
|
|
2058
|
-
findAllMatches: true,
|
|
2059
|
-
});
|
|
2060
|
-
// Cache for reuse
|
|
2061
|
-
fuseCache = { items, threshold, fuse };
|
|
2062
|
-
return fuse;
|
|
2063
|
-
}
|
|
2064
|
-
/**
|
|
2065
|
-
* Searches items using fuzzy matching with Fuse.js.
|
|
2066
|
-
* Tolerates typos and finds approximate matches.
|
|
2067
|
-
*
|
|
2068
|
-
* @param {IndexedItem[]} indexedItems - Array of pre-indexed items
|
|
2069
|
-
* @param {string} query - The search query
|
|
2070
|
-
* @param {number} threshold - Fuzzy threshold (0-1, lower = stricter, default 0.3)
|
|
2071
|
-
* @returns {string[]} Array of matching item IDs sorted by relevance
|
|
2072
|
-
* @example
|
|
2073
|
-
* // Given items: [{ id: '1', label: 'System Grid Control', ... }]
|
|
2074
|
-
* searchFuzzy(items, 'Sytem') // ['1'] - matches despite typo
|
|
2075
|
-
* searchFuzzy(items, 'Systm Grid') // ['1'] - matches despite typo
|
|
2076
|
-
*/
|
|
2077
|
-
function searchFuzzy(indexedItems, query, threshold = 0.3) {
|
|
2078
|
-
if (!query || !indexedItems?.length) {
|
|
2079
|
-
return indexedItems?.map(item => item.id) || [];
|
|
2080
|
-
}
|
|
2081
|
-
const fuse = getFuseInstance(indexedItems, threshold);
|
|
2082
|
-
const results = fuse.search(query);
|
|
2083
|
-
// Return IDs sorted by relevance (best matches first)
|
|
2084
|
-
return results.map(result => result.item.id);
|
|
2085
|
-
}
|
|
2086
|
-
|
|
2087
|
-
/**
|
|
2088
|
-
* @fileoverview Main search engine that orchestrates search operations.
|
|
2089
|
-
* Provides a unified interface for all filter modes.
|
|
2090
|
-
*/
|
|
2091
|
-
/**
|
|
2092
|
-
* Default search options.
|
|
2093
|
-
*/
|
|
2094
|
-
const DEFAULT_OPTIONS = {
|
|
2095
|
-
filterMode: 'strict',
|
|
2096
|
-
startFilterAt: 0,
|
|
2097
|
-
};
|
|
2098
|
-
/**
|
|
2099
|
-
* Main search function that applies the appropriate strategy based on filter mode.
|
|
2100
|
-
*
|
|
2101
|
-
* @param {IndexedItem[]} indexedItems - Array of pre-indexed items
|
|
2102
|
-
* @param {SearchOptions} options - Search options including query, filterMode, maxResults
|
|
2103
|
-
* @returns {SearchResult} Search result with matching IDs, total count, and truncation flag
|
|
2104
|
-
*
|
|
2105
|
-
* @example
|
|
2106
|
-
* const result = search(indexedItems, {
|
|
2107
|
-
* query: 'System Grid',
|
|
2108
|
-
* filterMode: 'smart',
|
|
2109
|
-
* maxResults: 100
|
|
2110
|
-
* });
|
|
2111
|
-
* // { ids: ['1', '2', '3'], total: 3, truncated: false }
|
|
2112
|
-
*/
|
|
2113
|
-
function search(indexedItems, options) {
|
|
2114
|
-
const { query, filterMode = DEFAULT_OPTIONS.filterMode, maxResults: rawMaxResults, startFilterAt = DEFAULT_OPTIONS.startFilterAt, fuzzyThreshold: rawFuzzyThreshold, } = options;
|
|
2115
|
-
// Apply guards
|
|
2116
|
-
const maxResults = clampMaxResults(rawMaxResults);
|
|
2117
|
-
const fuzzyThreshold = clampFuzzyThreshold(rawFuzzyThreshold);
|
|
2118
|
-
// If query is too short, return all items (up to maxResults)
|
|
2119
|
-
if (!query || query.length < startFilterAt) {
|
|
2120
|
-
const allIds = indexedItems.map(item => item.id);
|
|
2121
|
-
const truncated = allIds.length > maxResults;
|
|
2122
|
-
return {
|
|
2123
|
-
ids: allIds.slice(0, maxResults),
|
|
2124
|
-
total: allIds.length,
|
|
2125
|
-
truncated,
|
|
2126
|
-
};
|
|
2127
|
-
}
|
|
2128
|
-
// Apply the appropriate search strategy
|
|
2129
|
-
let matchingIds;
|
|
2130
|
-
switch (filterMode) {
|
|
2131
|
-
case 'strict':
|
|
2132
|
-
matchingIds = searchStrict(indexedItems, query);
|
|
2133
|
-
break;
|
|
2134
|
-
case 'smart':
|
|
2135
|
-
matchingIds = searchSmart(indexedItems, query);
|
|
2136
|
-
break;
|
|
2137
|
-
case 'fuzzy':
|
|
2138
|
-
// Fuzzy search using Fuse.js on main thread
|
|
2139
|
-
matchingIds = searchFuzzy(indexedItems, query, fuzzyThreshold);
|
|
2140
|
-
break;
|
|
2141
|
-
default:
|
|
2142
|
-
matchingIds = searchStrict(indexedItems, query);
|
|
2143
|
-
}
|
|
2144
|
-
// Apply maxResults limit
|
|
2145
|
-
const total = matchingIds.length;
|
|
2146
|
-
const truncated = total > maxResults;
|
|
2147
|
-
const limitedIds = truncated ? matchingIds.slice(0, maxResults) : matchingIds;
|
|
2148
|
-
return {
|
|
2149
|
-
ids: limitedIds,
|
|
2150
|
-
total,
|
|
2151
|
-
truncated,
|
|
2152
|
-
};
|
|
2153
|
-
}
|
|
2154
|
-
/**
|
|
2155
|
-
* Determines if filtering should be offloaded to a Web Worker.
|
|
2156
|
-
*
|
|
2157
|
-
* @param {number} itemCount - Number of items to search
|
|
2158
|
-
* @param {FilterMode} filterMode - Current filter mode
|
|
2159
|
-
* @param {number} workerThreshold - Threshold for offloading to worker
|
|
2160
|
-
* @returns {boolean} True if filtering should use Web Worker
|
|
2161
|
-
*/
|
|
2162
|
-
function shouldUseWorker(itemCount, filterMode, workerThreshold) {
|
|
2163
|
-
// Fuzzy mode always requires worker (Fuse.js runs there)
|
|
2164
|
-
if (filterMode === 'fuzzy') {
|
|
2165
|
-
return true;
|
|
2166
|
-
}
|
|
2167
|
-
// Large datasets should use worker to keep main thread responsive
|
|
2168
|
-
return itemCount > workerThreshold;
|
|
2169
|
-
}
|
|
2170
|
-
/**
|
|
2171
|
-
* Checks if Web Workers are supported in the current environment.
|
|
2172
|
-
*
|
|
2173
|
-
* @returns {boolean} True if Web Workers are supported
|
|
2174
|
-
*/
|
|
2175
|
-
function isWorkerSupported() {
|
|
2176
|
-
return typeof Worker !== 'undefined';
|
|
2177
|
-
}
|
|
2178
|
-
/**
|
|
2179
|
-
* Gets the effective filter mode, falling back if necessary.
|
|
2180
|
-
* If fuzzy mode is requested but Workers aren't supported, falls back to smart.
|
|
2181
|
-
*
|
|
2182
|
-
* @param {FilterMode} requestedMode - The requested filter mode
|
|
2183
|
-
* @returns {FilterMode} The effective filter mode to use
|
|
2184
|
-
*/
|
|
2185
|
-
function getEffectiveFilterMode(requestedMode) {
|
|
2186
|
-
if (requestedMode === 'fuzzy' && !isWorkerSupported()) {
|
|
2187
|
-
console.warn('Web Workers not supported. Falling back from fuzzy to smart mode.');
|
|
2188
|
-
return 'smart';
|
|
2189
|
-
}
|
|
2190
|
-
return requestedMode;
|
|
2191
|
-
}
|
|
2192
|
-
|
|
2193
|
-
/**
|
|
2194
|
-
* @fileoverview Client for communicating with the search Web Worker.
|
|
2195
|
-
* Provides a clean async API for search operations.
|
|
2196
|
-
*/
|
|
2197
|
-
/**
|
|
2198
|
-
* Client for managing search operations via Web Worker.
|
|
2199
|
-
* Handles worker lifecycle, request tracking, and fallback behavior.
|
|
2200
|
-
*/
|
|
2201
|
-
class SearchWorkerClient {
|
|
2202
|
-
/**
|
|
2203
|
-
* Creates a new SearchWorkerClient.
|
|
2204
|
-
* @param {string} [workerUrl] - URL to the worker script (optional, uses inline worker if not provided)
|
|
2205
|
-
*/
|
|
2206
|
-
constructor(workerUrl) {
|
|
2207
|
-
this.workerUrl = workerUrl;
|
|
2208
|
-
this.worker = null;
|
|
2209
|
-
this.pendingRequests = new Map();
|
|
2210
|
-
this.requestCounter = 0;
|
|
2211
|
-
this.isInitialized = false;
|
|
2212
|
-
this.initPromise = null;
|
|
2213
|
-
/** Flag indicating if fallback mode is active (no worker available) */
|
|
2214
|
-
this.isFallbackMode = false;
|
|
2215
|
-
}
|
|
2216
|
-
/**
|
|
2217
|
-
* Checks if Web Workers are supported in the current environment.
|
|
2218
|
-
* @returns {boolean} True if Web Workers are supported
|
|
2219
|
-
*/
|
|
2220
|
-
static isSupported() {
|
|
2221
|
-
return typeof Worker !== 'undefined';
|
|
2222
|
-
}
|
|
2223
|
-
/**
|
|
2224
|
-
* Generates a unique request ID.
|
|
2225
|
-
* @returns {string} A unique request ID
|
|
2226
|
-
*/
|
|
2227
|
-
generateRequestId() {
|
|
2228
|
-
return `req-${++this.requestCounter}-${Date.now()}`;
|
|
2229
|
-
}
|
|
2230
|
-
/**
|
|
2231
|
-
* Creates and initializes the worker.
|
|
2232
|
-
* Note: Workers require a workerUrl to be provided. Inline workers are not
|
|
2233
|
-
* supported due to ES module limitations with importScripts.
|
|
2234
|
-
* @returns {Worker | null} The created Worker instance or null if creation failed
|
|
2235
|
-
*/
|
|
2236
|
-
createWorker() {
|
|
2237
|
-
if (!SearchWorkerClient.isSupported()) {
|
|
2238
|
-
console.warn('Web Workers are not supported in this environment.');
|
|
2239
|
-
this.onFallback?.();
|
|
2240
|
-
return null;
|
|
2241
|
-
}
|
|
2242
|
-
try {
|
|
2243
|
-
if (this.workerUrl) {
|
|
2244
|
-
return new Worker(this.workerUrl, { type: 'module' });
|
|
2245
|
-
}
|
|
2246
|
-
// No workerUrl provided - fallback to main thread processing
|
|
2247
|
-
// Inline workers with ES modules are not supported
|
|
2248
|
-
console.warn('No workerUrl provided. Falling back to main thread processing.');
|
|
2249
|
-
this.onFallback?.();
|
|
2250
|
-
return null;
|
|
2251
|
-
}
|
|
2252
|
-
catch (error) {
|
|
2253
|
-
console.error('Failed to create Web Worker:', error);
|
|
2254
|
-
this.onFallback?.();
|
|
2255
|
-
return null;
|
|
2256
|
-
}
|
|
2257
|
-
}
|
|
2258
|
-
/**
|
|
2259
|
-
* Sets up message handlers for the worker.
|
|
2260
|
-
*/
|
|
2261
|
-
setupMessageHandler() {
|
|
2262
|
-
if (!this.worker)
|
|
2263
|
-
return;
|
|
2264
|
-
this.worker.onmessage = (event) => {
|
|
2265
|
-
const { requestId, type, payload } = event.data;
|
|
2266
|
-
const pending = this.pendingRequests.get(requestId);
|
|
2267
|
-
if (!pending) {
|
|
2268
|
-
console.warn(`Received response for unknown request: ${requestId}`);
|
|
2269
|
-
return;
|
|
2270
|
-
}
|
|
2271
|
-
this.pendingRequests.delete(requestId);
|
|
2272
|
-
if (type === 'ERROR') {
|
|
2273
|
-
pending.reject(new Error(payload.error));
|
|
2274
|
-
}
|
|
2275
|
-
else {
|
|
2276
|
-
pending.resolve(payload);
|
|
2277
|
-
}
|
|
2278
|
-
};
|
|
2279
|
-
this.worker.onerror = (error) => {
|
|
2280
|
-
console.error('Worker error:', error);
|
|
2281
|
-
// Reject all pending requests
|
|
2282
|
-
this.pendingRequests.forEach(pending => {
|
|
2283
|
-
pending.reject(new Error('Worker error'));
|
|
2284
|
-
});
|
|
2285
|
-
this.pendingRequests.clear();
|
|
2286
|
-
};
|
|
2287
|
-
}
|
|
2288
|
-
/**
|
|
2289
|
-
* Sends a request to the worker and returns a promise for the result.
|
|
2290
|
-
* @param {WorkerRequest} request - The request object to send to the worker
|
|
2291
|
-
* @returns {Promise<SearchResult>} Promise that resolves to the search result
|
|
2292
|
-
*/
|
|
2293
|
-
sendRequest(request) {
|
|
2294
|
-
return new Promise((resolve, reject) => {
|
|
2295
|
-
if (!this.worker) {
|
|
2296
|
-
reject(new Error('Worker not initialized'));
|
|
2297
|
-
return;
|
|
2298
|
-
}
|
|
2299
|
-
this.pendingRequests.set(request.requestId, { resolve, reject });
|
|
2300
|
-
this.worker.postMessage(request);
|
|
2301
|
-
});
|
|
2302
|
-
}
|
|
2303
|
-
/**
|
|
2304
|
-
* Initializes the worker with items to search.
|
|
2305
|
-
* @param {RawItem[]} items - Array of items to index
|
|
2306
|
-
* @returns {Promise<void>} Promise that resolves when initialization is complete
|
|
2307
|
-
*/
|
|
2308
|
-
async init(items) {
|
|
2309
|
-
// If already initializing, wait for it
|
|
2310
|
-
if (this.initPromise) {
|
|
2311
|
-
await this.initPromise;
|
|
2312
|
-
// Re-init with new items
|
|
2313
|
-
}
|
|
2314
|
-
this.initPromise = this.doInit(items);
|
|
2315
|
-
await this.initPromise;
|
|
2316
|
-
}
|
|
2317
|
-
async doInit(items) {
|
|
2318
|
-
// If already in fallback mode, don't try to create worker again
|
|
2319
|
-
if (this.isFallbackMode) {
|
|
2320
|
-
return;
|
|
2321
|
-
}
|
|
2322
|
-
// Create worker if not exists
|
|
2323
|
-
if (!this.worker) {
|
|
2324
|
-
this.worker = this.createWorker();
|
|
2325
|
-
if (!this.worker) {
|
|
2326
|
-
// Worker creation failed - enter fallback mode silently
|
|
2327
|
-
this.isFallbackMode = true;
|
|
2328
|
-
this.onFallback?.();
|
|
2329
|
-
return;
|
|
2330
|
-
}
|
|
2331
|
-
this.setupMessageHandler();
|
|
2332
|
-
}
|
|
2333
|
-
const requestId = this.generateRequestId();
|
|
2334
|
-
try {
|
|
2335
|
-
await this.sendRequest({
|
|
2336
|
-
type: 'INIT',
|
|
2337
|
-
requestId,
|
|
2338
|
-
payload: { items },
|
|
2339
|
-
});
|
|
2340
|
-
this.isInitialized = true;
|
|
2341
|
-
}
|
|
2342
|
-
catch {
|
|
2343
|
-
// Worker init failed - enter fallback mode
|
|
2344
|
-
this.isFallbackMode = true;
|
|
2345
|
-
this.onFallback?.();
|
|
2346
|
-
this.terminate();
|
|
2347
|
-
}
|
|
2348
|
-
}
|
|
2349
|
-
/**
|
|
2350
|
-
* Performs a search operation.
|
|
2351
|
-
* @param {string} query - Search query string
|
|
2352
|
-
* @param {FilterMode} filterMode - Filter mode (strict/smart/fuzzy)
|
|
2353
|
-
* @param {number} maxResults - Maximum results to return
|
|
2354
|
-
* @param {number} fuzzyThreshold - Threshold for fuzzy matching
|
|
2355
|
-
* @returns {Promise<SearchResult>} Promise resolving to search results
|
|
2356
|
-
*/
|
|
2357
|
-
async search(query, filterMode = 'strict', maxResults = DEFAULT_MAX_RESULTS, fuzzyThreshold = DEFAULT_FUZZY_THRESHOLD) {
|
|
2358
|
-
if (!this.isInitialized || !this.worker) {
|
|
2359
|
-
throw new Error('Worker not initialized. Call init() first.');
|
|
2360
|
-
}
|
|
2361
|
-
const requestId = this.generateRequestId();
|
|
2362
|
-
return this.sendRequest({
|
|
2363
|
-
type: 'SEARCH',
|
|
2364
|
-
requestId,
|
|
2365
|
-
payload: {
|
|
2366
|
-
query,
|
|
2367
|
-
filterMode,
|
|
2368
|
-
maxResults: clampMaxResults(maxResults),
|
|
2369
|
-
fuzzyThreshold: clampFuzzyThreshold(fuzzyThreshold),
|
|
2370
|
-
},
|
|
2371
|
-
});
|
|
2372
|
-
}
|
|
2373
|
-
/**
|
|
2374
|
-
* Cancels all pending requests.
|
|
2375
|
-
*/
|
|
2376
|
-
cancelPending() {
|
|
2377
|
-
this.pendingRequests.forEach(pending => {
|
|
2378
|
-
pending.reject(new Error('Request cancelled'));
|
|
2379
|
-
});
|
|
2380
|
-
this.pendingRequests.clear();
|
|
2381
|
-
}
|
|
2382
|
-
/**
|
|
2383
|
-
* Terminates the worker and cleans up resources.
|
|
2384
|
-
*/
|
|
2385
|
-
terminate() {
|
|
2386
|
-
this.cancelPending();
|
|
2387
|
-
this.worker?.terminate();
|
|
2388
|
-
this.worker = null;
|
|
2389
|
-
this.isInitialized = false;
|
|
2390
|
-
this.initPromise = null;
|
|
2391
|
-
// Note: we don't reset isFallbackMode here to avoid retrying worker creation
|
|
2392
|
-
}
|
|
2393
|
-
/**
|
|
2394
|
-
* Returns whether the worker is ready to perform searches.
|
|
2395
|
-
* @returns {boolean} True if the worker is initialized and ready
|
|
2396
|
-
*/
|
|
2397
|
-
get isReady() {
|
|
2398
|
-
return this.isInitialized && this.worker !== null;
|
|
2399
|
-
}
|
|
2400
|
-
/**
|
|
2401
|
-
* Returns whether the client is in fallback mode (no worker available).
|
|
2402
|
-
* @returns {boolean} True if the client is operating in fallback mode
|
|
2403
|
-
*/
|
|
2404
|
-
get inFallbackMode() {
|
|
2405
|
-
return this.isFallbackMode;
|
|
2406
|
-
}
|
|
2407
|
-
}
|
|
2408
|
-
|
|
2409
|
-
/**
|
|
2410
|
-
* @fileoverview Internationalization utilities for Nova components.
|
|
2411
|
-
* Provides automatic locale detection and default translations.
|
|
2412
|
-
*/
|
|
2413
|
-
/**
|
|
2414
|
-
* Default translations for truncated results text.
|
|
2415
|
-
* Supports placeholders: {shown} and {total}
|
|
2416
|
-
*/
|
|
2417
|
-
const TRUNCATED_RESULTS_TRANSLATIONS = {
|
|
2418
|
-
en: '{shown} results shown out of {total} — refine your search',
|
|
2419
|
-
fr: '{shown} résultats affichés sur {total} — affinez votre recherche',
|
|
2420
|
-
de: '{shown} von {total} Ergebnissen angezeigt — verfeinern Sie Ihre Suche',
|
|
2421
|
-
es: '{shown} resultados mostrados de {total} — refine su búsqueda',
|
|
2422
|
-
it: '{shown} risultati mostrati su {total} — perfeziona la tua ricerca',
|
|
2423
|
-
nl: '{shown} resultaten getoond van {total} — verfijn uw zoekopdracht',
|
|
2424
|
-
pt: '{shown} resultados exibidos de {total} — refine sua pesquisa',
|
|
2425
|
-
ru: '{shown} результатов показано из {total} — уточните поиск',
|
|
2426
|
-
ja: '{shown}件の結果が{total}件中表示されています — 検索を絞り込んでください',
|
|
2427
|
-
zh: '{shown}个结果,共{total}个 — 请细化您的搜索',
|
|
2428
|
-
ko: '{shown}개 결과가 {total}개 중 표시됨 — 검색을 구체화하세요',
|
|
2429
|
-
};
|
|
2430
|
-
/**
|
|
2431
|
-
* Gets the browser's locale (language code).
|
|
2432
|
-
* Falls back to 'en' if detection fails.
|
|
2433
|
-
*
|
|
2434
|
-
* @returns {string} The locale code (e.g., 'en', 'fr', 'de')
|
|
2435
|
-
*/
|
|
2436
|
-
function getBrowserLocale() {
|
|
2437
|
-
if (typeof navigator === 'undefined') {
|
|
2438
|
-
return 'en';
|
|
2439
|
-
}
|
|
2440
|
-
// Try navigator.language first (e.g., 'en-US', 'fr-FR')
|
|
2441
|
-
const language = navigator.language || navigator.languages?.[0] || 'en';
|
|
2442
|
-
// Extract the base language code (e.g., 'en' from 'en-US')
|
|
2443
|
-
return language.split('-')[0].toLowerCase();
|
|
2444
|
-
}
|
|
2445
|
-
/**
|
|
2446
|
-
* Gets the localized truncated results text.
|
|
2447
|
-
* Automatically detects browser locale and provides appropriate translation.
|
|
2448
|
-
* Falls back to English if translation is not available.
|
|
2449
|
-
*
|
|
2450
|
-
* @param {string} [locale] - Optional locale override. If not provided, uses browser locale.
|
|
2451
|
-
* @returns {string} The localized text with placeholders {shown} and {total}
|
|
2452
|
-
*
|
|
2453
|
-
* @example
|
|
2454
|
-
* getTruncatedResultsText() // Uses browser locale
|
|
2455
|
-
* getTruncatedResultsText('fr') // Returns French translation
|
|
2456
|
-
* getTruncatedResultsText('de') // Returns German translation
|
|
2457
|
-
*/
|
|
2458
|
-
function getTruncatedResultsText(locale) {
|
|
2459
|
-
const targetLocale = locale
|
|
2460
|
-
? locale.split('-')[0].toLowerCase()
|
|
2461
|
-
: getBrowserLocale();
|
|
2462
|
-
return (TRUNCATED_RESULTS_TRANSLATIONS[targetLocale] ||
|
|
2463
|
-
TRUNCATED_RESULTS_TRANSLATIONS.en);
|
|
2464
|
-
}
|
|
2465
|
-
/**
|
|
2466
|
-
* Formats the truncated results text by replacing placeholders with actual values.
|
|
2467
|
-
*
|
|
2468
|
-
* @param {string} template - The text template with {shown} and {total} placeholders
|
|
2469
|
-
* @param {number} shown - The number of items shown
|
|
2470
|
-
* @param {number} total - The total number of items
|
|
2471
|
-
* @returns {string} The formatted text with replaced placeholders
|
|
2472
|
-
*
|
|
2473
|
-
* @example
|
|
2474
|
-
* formatTruncatedResults('{shown} of {total}', 10, 100) // '10 of 100'
|
|
2475
|
-
*/
|
|
2476
|
-
function formatTruncatedResults(template, shown, total) {
|
|
2477
|
-
return template
|
|
2478
|
-
.replace(/{shown}/g, String(shown))
|
|
2479
|
-
.replace(/{total}/g, String(total));
|
|
2480
|
-
}
|
|
2481
|
-
|
|
2482
|
-
export { FUZZY_DEBOUNCE_DELAY as F, SearchWorkerClient as S, search as a, buildIndex as b, clampMaxResults as c, getTruncatedResultsText as d, clampWorkerThreshold as e, formatTruncatedResults as f, getEffectiveFilterMode as g, isWorkerSupported as i, shouldUseWorker as s };
|
|
2483
|
-
//# sourceMappingURL=i18n.utils-IlwlcG9l.js.map
|
|
2484
|
-
|
|
2485
|
-
//# sourceMappingURL=i18n.utils-IlwlcG9l.js.map
|