themelia-react-ui 2.0.5 → 2.0.6
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/CHANGELOG.md +76 -0
- package/MIGRATION.md +119 -0
- package/README.md +13 -6
- package/dist/{accordion-B9MHG0cT.js → accordion-0tQUZ20r.js} +7 -7
- package/dist/accordion-0tQUZ20r.js.map +1 -0
- package/dist/{action-menu-Dr8K-ghE.js → action-menu-C0gjzLyE.js} +7 -7
- package/dist/{action-menu-Dr8K-ghE.js.map → action-menu-C0gjzLyE.js.map} +1 -1
- package/dist/{ai-artifact-C58tQcBy.js → ai-artifact-CGGpQryR.js} +172 -157
- package/dist/ai-artifact-CGGpQryR.js.map +1 -0
- package/dist/{app-shell-B_IuNWOo.js → app-shell-EHuuRDGy.js} +5 -5
- package/dist/{app-shell-B_IuNWOo.js.map → app-shell-EHuuRDGy.js.map} +1 -1
- package/dist/{attachment-Dg_69lPS.js → attachment-BCpA4e7i.js} +8 -8
- package/dist/{attachment-Dg_69lPS.js.map → attachment-BCpA4e7i.js.map} +1 -1
- package/dist/{auth-DTkkshS8.js → auth-B0girIk_.js} +15 -15
- package/dist/auth-B0girIk_.js.map +1 -0
- package/dist/{avatar-CeZaFmNH.js → avatar-B9Jnp-T-.js} +3 -3
- package/dist/{avatar-CeZaFmNH.js.map → avatar-B9Jnp-T-.js.map} +1 -1
- package/dist/{badge-xIiV_E7f.js → badge-wWauMgAt.js} +3 -3
- package/dist/{badge-xIiV_E7f.js.map → badge-wWauMgAt.js.map} +1 -1
- package/dist/base/accordion.js +1 -1
- package/dist/base/action-menu.js +1 -1
- package/dist/base/attachment.js +1 -1
- package/dist/base/avatar.js +1 -1
- package/dist/base/badge.js +1 -1
- package/dist/base/batch-action-bar.js +1 -1
- package/dist/base/buttons.js +1 -1
- package/dist/base/cards.js +2 -2
- package/dist/base/carousel.js +3 -3
- package/dist/base/cascader.js +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +2 -2
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +1 -1
- package/dist/base/command.js +1 -1
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +2 -2
- package/dist/base/display.js +6 -6
- package/dist/base/feedback.js +4 -4
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +8 -8
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/metadata-list.js +1 -1
- package/dist/base/navigation.js +6 -6
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +1 -1
- package/dist/base/repeaters.js +195 -188
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +2 -2
- package/dist/base/signature-pad.js +7 -7
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +5 -5
- package/dist/base/spinner.js.map +1 -1
- package/dist/base/structure.js +1 -1
- package/dist/base/table.js +1 -1
- package/dist/base/text-inputs.js +2 -2
- package/dist/base/toaster.js +1 -1
- package/dist/base/tree.js +1 -1
- package/dist/base/upload-queue.js +1 -1
- package/dist/base/upload.js +3 -3
- package/dist/base/value-inputs.js +1 -1
- package/dist/{batch-action-bar-Cb8cuvyy.js → batch-action-bar-BoqWIIpV.js} +5 -5
- package/dist/{batch-action-bar-Cb8cuvyy.js.map → batch-action-bar-BoqWIIpV.js.map} +1 -1
- package/dist/blocks/admin.js +17 -17
- package/dist/blocks/ai.js +227 -221
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +424 -449
- package/dist/blocks/analytics.js.map +1 -1
- package/dist/blocks/collaboration.js +1 -1
- package/dist/blocks/commerce/receipt.js +1 -1
- package/dist/blocks/commerce.js +225 -220
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +2 -2
- package/dist/blocks/onboarding.js +5 -5
- package/dist/blocks/planning.js +11 -11
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-J-K2kl4c.js → breadcrumbs-Bp9Ke7kd.js} +4 -4
- package/dist/breadcrumbs-Bp9Ke7kd.js.map +1 -0
- package/dist/{button-S2Cubiiz.js → button-ChBovTx0.js} +2 -2
- package/dist/{button-S2Cubiiz.js.map → button-ChBovTx0.js.map} +1 -1
- package/dist/{buttons-BedGfygC.js → buttons-DeW0bQeK.js} +6 -6
- package/dist/{buttons-BedGfygC.js.map → buttons-DeW0bQeK.js.map} +1 -1
- package/dist/{cards-rNX1M4Xn.js → cards-CNXnmvV5.js} +8 -8
- package/dist/{cards-rNX1M4Xn.js.map → cards-CNXnmvV5.js.map} +1 -1
- package/dist/{cascader-B1MiqkBq.js → cascader-CrAl9zD5.js} +15 -15
- package/dist/{cascader-B1MiqkBq.js.map → cascader-CrAl9zD5.js.map} +1 -1
- package/dist/{chart-Darg_0Kv.js → chart-I7ROnsl8.js} +5 -5
- package/dist/{chart-Darg_0Kv.js.map → chart-I7ROnsl8.js.map} +1 -1
- package/dist/{checkbox-fflqmODR.js → checkbox-MoyHIAPs.js} +3 -3
- package/dist/{checkbox-fflqmODR.js.map → checkbox-MoyHIAPs.js.map} +1 -1
- package/dist/{choice-inputs-zUgBZfE4.js → choice-inputs-DHGtx0QV.js} +122 -110
- package/dist/choice-inputs-DHGtx0QV.js.map +1 -0
- package/dist/{code-block-BzmM9Eig.js → code-block-BSJyq9e-.js} +7 -7
- package/dist/{code-block-BzmM9Eig.js.map → code-block-BSJyq9e-.js.map} +1 -1
- package/dist/{collapsible-BkAI_XD4.js → collapsible-BzJ91LUG.js} +3 -3
- package/dist/{collapsible-BkAI_XD4.js.map → collapsible-BzJ91LUG.js.map} +1 -1
- package/dist/{collection-content-gDh1v6O4.js → collection-content-CSnwtOTH.js} +3 -3
- package/dist/{collection-content-gDh1v6O4.js.map → collection-content-CSnwtOTH.js.map} +1 -1
- package/dist/{combobox-BEx0vJgF.js → combobox-Bcvu5J8O.js} +11 -10
- package/dist/{combobox-BEx0vJgF.js.map → combobox-Bcvu5J8O.js.map} +1 -1
- package/dist/combobox-C2JiSQPc.js +915 -0
- package/dist/combobox-C2JiSQPc.js.map +1 -0
- package/dist/{command-CrlPIL6m.js → command-9e52NPgK.js} +6 -6
- package/dist/{command-CrlPIL6m.js.map → command-9e52NPgK.js.map} +1 -1
- package/dist/{comments-Dmpp0YIc.js → comments-BsgErEqd.js} +33 -28
- package/dist/comments-BsgErEqd.js.map +1 -0
- package/dist/components/base/choice-inputs/choice-types.d.ts +4 -0
- package/dist/components/base/choice-inputs/pill-radio-group.d.ts +7 -6
- package/dist/components/base/combobox/combobox-field.d.ts +2 -2
- package/dist/components/base/date-pickers/date-picker-internals.d.ts +3 -1
- package/dist/components/base/date-pickers/datepicker.types.d.ts +10 -4
- package/dist/components/base/date-pickers/time-picker.d.ts +17 -3
- package/dist/components/base/feedback/state-display.d.ts +5 -1
- package/dist/components/base/feedback/state-display.strings.d.ts +9 -0
- package/dist/components/base/forms/form-field.d.ts +7 -2
- package/dist/components/base/forms-numeric/coordinates-input.d.ts +4 -1
- package/dist/components/base/forms-numeric/decimal-input.d.ts +2 -2
- package/dist/components/base/forms-numeric/dimensions-input.d.ts +4 -1
- package/dist/components/base/forms-numeric/numeric-composite-field.d.ts +12 -0
- package/dist/components/base/forms-numeric/weight-input.d.ts +6 -1
- package/dist/components/base/navigation/language-switcher.d.ts +12 -4
- package/dist/components/base/repeaters/key-value-editor.d.ts +2 -1
- package/dist/components/base/sidebar/sidebar.d.ts +2 -0
- package/dist/components/base/upload/avatar-upload.d.ts +2 -1
- package/dist/components/base/upload/image-upload.d.ts +2 -1
- package/dist/components/blocks/ai/ai-citation/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-reasoning/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-sources/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-tool-call/types.d.ts +2 -0
- package/dist/components/blocks/analytics/metric/metric.d.ts +4 -0
- package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +2 -0
- package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +4 -5
- package/dist/components/blocks/analytics/types.d.ts +2 -2
- package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
- package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +4 -3
- package/dist/components/features/activities/activities.types.d.ts +18 -11
- package/dist/components/features/activities/hooks/use-activity-resources.d.ts +2 -1
- package/dist/components/features/ai-chat/hooks/use-ai-chat-scroll.d.ts +1 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +4 -2
- package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
- package/dist/components/features/combobox/combobox.d.ts +2 -2
- package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +2 -1
- package/dist/components/features/combobox/hooks/use-combobox-state.d.ts +1 -0
- package/dist/components/features/combobox/hooks/use-load-more.d.ts +1 -0
- package/dist/components/features/combobox/types.d.ts +37 -8
- package/dist/components/features/email-composer/types.d.ts +3 -1
- package/dist/components/features/filters/facets/date-facet.d.ts +4 -2
- package/dist/components/features/filters/facets/range-facet.d.ts +12 -0
- package/dist/components/features/filters/filters.types.d.ts +3 -3
- package/dist/components/features/filters/partials/date-filter-content.d.ts +3 -2
- package/dist/components/features/filters/partials/filter-popover-content.d.ts +4 -2
- package/dist/components/features/filters/partials/range-filter-content.d.ts +12 -0
- package/dist/components/features/filters/utils/filter-utils.d.ts +5 -1
- package/dist/components/features/media-library/hooks/use-media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.strings.d.ts +6 -0
- package/dist/components/features/media-library/media-library.types.d.ts +36 -8
- package/dist/components/features/media-library/partials/media-library-partials.d.ts +3 -3
- package/dist/components/features/mentions/hooks/use-mentions.d.ts +16 -1
- package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +5 -1
- package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +1 -7
- package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +2 -2
- package/dist/components/features/products/products.types.d.ts +2 -2
- package/dist/components/features/questionnaire/questionnaire.types.d.ts +3 -0
- package/dist/components/features/resource/resource.d.ts +1 -1
- package/dist/components/features/resource/resource.types.d.ts +2 -0
- package/dist/components/features/rich-text-editor/form-rich-text-editor.d.ts +1 -1
- package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +1 -1
- package/dist/components/features/rich-text-editor/partials/editor-field-aria.d.ts +14 -0
- package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +3 -1
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +1 -1
- package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +17 -3
- package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +5 -1
- package/dist/components/features/schema-form/partials/schema-form-field.d.ts +3 -1
- package/dist/components/features/schema-form/schema-form.utils.d.ts +1 -1
- package/dist/components/features/suggestions/suggestions.types.d.ts +1 -1
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/index.d.ts +1 -0
- package/dist/components/features/table/table-body.d.ts +1 -1
- package/dist/components/features/table/table-helpers.d.ts +6 -3
- package/dist/components/features/table/table.strings.d.ts +3 -0
- package/dist/components/features/table/table.types.d.ts +17 -1
- package/dist/components/layout/header/header.types.d.ts +3 -2
- package/dist/components/layout/layout.types.d.ts +5 -3
- package/dist/components/layout/navigation/side-nav.d.ts +3 -2
- package/dist/components/layout/normalize-layout-path.d.ts +1 -0
- package/dist/components/layout/settings/settings.d.ts +1 -1
- package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
- package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +3 -1
- package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -0
- package/dist/components/layout/sidebar/sidebar.types.d.ts +2 -0
- package/dist/components/primitives/link.d.ts +3 -2
- package/dist/components/primitives/money.d.ts +1 -1
- package/dist/components/primitives/number.d.ts +1 -1
- package/dist/components/typography/rich-text/rich-text-tree.d.ts +7 -5
- package/dist/{containers-CIxwbZt5.js → containers-CSdc32h9.js} +2 -2
- package/dist/{containers-CIxwbZt5.js.map → containers-CSdc32h9.js.map} +1 -1
- package/dist/{copyable-DIznBqiT.js → copyable-3fdHfMR3.js} +4 -4
- package/dist/{copyable-DIznBqiT.js.map → copyable-3fdHfMR3.js.map} +1 -1
- package/dist/{data-display-BdgCAw8T.js → data-display-Cmj-xZYl.js} +16 -15
- package/dist/data-display-Cmj-xZYl.js.map +1 -0
- package/dist/{date-Cq8ioE4o.js → date-Br0FicVv.js} +4 -4
- package/dist/{date-Cq8ioE4o.js.map → date-Br0FicVv.js.map} +1 -1
- package/dist/date-picker-CyQlFYsP.js +1617 -0
- package/dist/date-picker-CyQlFYsP.js.map +1 -0
- package/dist/date-pickers-tj2MXmXd.js +185 -0
- package/dist/date-pickers-tj2MXmXd.js.map +1 -0
- package/dist/{display-KsZLw9Ov.js → display-CT_N2a3w.js} +7 -7
- package/dist/{display-KsZLw9Ov.js.map → display-CT_N2a3w.js.map} +1 -1
- package/dist/{dropdown-menu-CLs8Lihj.js → dropdown-menu-C08iIugv.js} +6 -6
- package/dist/{dropdown-menu-CLs8Lihj.js.map → dropdown-menu-C08iIugv.js.map} +1 -1
- package/dist/features/activities.js +283 -270
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +40 -27
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/appointment-calendar.js +126 -126
- package/dist/features/appointment-calendar.js.map +1 -1
- package/dist/features/async-preview.js +9 -9
- package/dist/features/combobox.js +1 -1
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +10 -10
- package/dist/features/email-composer.js +24 -19
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +129 -125
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +2 -2
- package/dist/features/global-search.js +16 -20
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +18 -28
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map/style.css +15 -0
- package/dist/features/map.js +331 -314
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +1044 -866
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +2 -2
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +978 -964
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +159 -152
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +8 -8
- package/dist/features/resource.js +74 -71
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +28 -19
- package/dist/features/rich-text-editor.js.map +1 -1
- package/dist/features/schema-form.js +297 -256
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +57 -50
- package/dist/features/suggestions.js.map +1 -1
- package/dist/features/sync.js +3 -3
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +400 -399
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-Dzo1xtAU.js +246 -0
- package/dist/feedback-Dzo1xtAU.js.map +1 -0
- package/dist/{field-affordance-recipes-DWcNcOjh.js → field-affordance-recipes-D6H7tVJi.js} +2 -2
- package/dist/{field-affordance-recipes-DWcNcOjh.js.map → field-affordance-recipes-D6H7tVJi.js.map} +1 -1
- package/dist/field-control-attributes-B6i335wr.js +18 -0
- package/dist/field-control-attributes-B6i335wr.js.map +1 -0
- package/dist/{field-state-recipes-BVA2CWHo.js → field-state-recipes-7sza8QbC.js} +4 -2
- package/dist/{field-state-recipes-BVA2CWHo.js.map → field-state-recipes-7sza8QbC.js.map} +1 -1
- package/dist/{filters-DzgSJpMK.js → filters-Dl80yYtN.js} +763 -605
- package/dist/filters-Dl80yYtN.js.map +1 -0
- package/dist/form-field-CAPdwdnZ.js +74 -0
- package/dist/form-field-CAPdwdnZ.js.map +1 -0
- package/dist/{form-sizing-Bs2qFUeE.js → form-sizing-CgcrUbLU.js} +2 -2
- package/dist/{form-sizing-Bs2qFUeE.js.map → form-sizing-CgcrUbLU.js.map} +1 -1
- package/dist/{forms-C0RGnJTe.js → forms-B3W8CH7-.js} +8 -8
- package/dist/{forms-C0RGnJTe.js.map → forms-B3W8CH7-.js.map} +1 -1
- package/dist/forms-numeric-CwjQJe-O.js +991 -0
- package/dist/forms-numeric-CwjQJe-O.js.map +1 -0
- package/dist/{header-DMMxG__r.js → header-ZIIsRKxP.js} +113 -113
- package/dist/header-ZIIsRKxP.js.map +1 -0
- package/dist/hooks/use-files.d.ts +2 -0
- package/dist/{hooks-DB6CJ4MR.js → hooks-BitHSh-Y.js} +3 -3
- package/dist/{hooks-DB6CJ4MR.js.map → hooks-BitHSh-Y.js.map} +1 -1
- package/dist/{icon-badge-DZF-YjQp.js → icon-badge-npxF1SLX.js} +2 -2
- package/dist/{icon-badge-DZF-YjQp.js.map → icon-badge-npxF1SLX.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{input-CvyDQlY7.js → input-7KAc7XQL.js} +6 -6
- package/dist/{input-CvyDQlY7.js.map → input-7KAc7XQL.js.map} +1 -1
- package/dist/{input-DMBwAZmr.js → input-DIREVYHs.js} +3 -3
- package/dist/{input-DMBwAZmr.js.map → input-DIREVYHs.js.map} +1 -1
- package/dist/{interaction-recipes-XR9ZpVYL.js → interaction-recipes-4wZ2tvfb.js} +2 -2
- package/dist/{interaction-recipes-XR9ZpVYL.js.map → interaction-recipes-4wZ2tvfb.js.map} +1 -1
- package/dist/{item-DjCcM18E.js → item-FfWnaYST.js} +99 -98
- package/dist/item-FfWnaYST.js.map +1 -0
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/auth.js +1 -1
- package/dist/layout/containers.js +1 -1
- package/dist/layout/header.js +1 -1
- package/dist/layout/hooks.js +1 -1
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.js +1 -1
- package/dist/layout/settings.js +1 -1
- package/dist/layout/sidebar.js +2 -2
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +11 -11
- package/dist/layout.types-E_GAApzO.js +30 -0
- package/dist/layout.types-E_GAApzO.js.map +1 -0
- package/dist/lib/field-control-attributes.d.ts +11 -0
- package/dist/lib/field-state-recipes.d.ts +2 -0
- package/dist/lib/format.d.ts +1 -0
- package/dist/lib/surface-recipes.d.ts +1 -1
- package/dist/lib/token-merge.generated.d.ts +6 -6
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-C-vChPmE.js → media-gallery-C81DAnKI.js} +6 -6
- package/dist/{media-gallery-C-vChPmE.js.map → media-gallery-C81DAnKI.js.map} +1 -1
- package/dist/{mentions-0_4nWuI-.js → mentions-qOnedSt4.js} +236 -167
- package/dist/mentions-qOnedSt4.js.map +1 -0
- package/dist/message-BJHnn43M.js +135 -0
- package/dist/message-BJHnn43M.js.map +1 -0
- package/dist/{metadata-list-C3MkU-Om.js → metadata-list-XkqZ_UXH.js} +11 -11
- package/dist/{metadata-list-C3MkU-Om.js.map → metadata-list-XkqZ_UXH.js.map} +1 -1
- package/dist/{navigation-DaRjthVk.js → navigation-BgtPJAhi.js} +119 -119
- package/dist/navigation-BgtPJAhi.js.map +1 -0
- package/dist/{navigation-C90-oQFq.js → navigation-Bt-v7rWP.js} +52 -46
- package/dist/navigation-Bt-v7rWP.js.map +1 -0
- package/dist/normalize-layout-path-BmEgg6fu.js +14 -0
- package/dist/normalize-layout-path-BmEgg6fu.js.map +1 -0
- package/dist/{number-CRU3kGuk.js → number-CYqBcrSj.js} +78 -86
- package/dist/number-CYqBcrSj.js.map +1 -0
- package/dist/{overflow-tab-bar-IVFVQFV6.js → overflow-tab-bar-BQCA2Zn2.js} +7 -7
- package/dist/{overflow-tab-bar-IVFVQFV6.js.map → overflow-tab-bar-BQCA2Zn2.js.map} +1 -1
- package/dist/{overlays-BSgCtM2v.js → overlays-CC8zI3Du.js} +264 -260
- package/dist/overlays-CC8zI3Du.js.map +1 -0
- package/dist/{page-DUUKDAjo.js → page-BoQ1VaFJ.js} +13 -13
- package/dist/{page-DUUKDAjo.js.map → page-BoQ1VaFJ.js.map} +1 -1
- package/dist/{page-header-commands-7P3sfE9u.js → page-header-commands-DIKspJfx.js} +4 -4
- package/dist/{page-header-commands-7P3sfE9u.js.map → page-header-commands-DIKspJfx.js.map} +1 -1
- package/dist/{pagination-CgCjElfu.js → pagination-Br8TdV9A.js} +4 -4
- package/dist/{pagination-CgCjElfu.js.map → pagination-Br8TdV9A.js.map} +1 -1
- package/dist/{popover-B85RenIl.js → popover-k8TdUcAt.js} +10 -10
- package/dist/popover-k8TdUcAt.js.map +1 -0
- package/dist/{popover-menu-DlnQ2zlR.js → popover-menu-yn-o0kyA.js} +7 -7
- package/dist/{popover-menu-DlnQ2zlR.js.map → popover-menu-yn-o0kyA.js.map} +1 -1
- package/dist/{popover.recipes-DdiEp0rd.js → popover.recipes-DJ0AkUan.js} +2 -2
- package/dist/{popover.recipes-DdiEp0rd.js.map → popover.recipes-DJ0AkUan.js.map} +1 -1
- package/dist/{portal-recipes-BpsV_iRw.js → portal-recipes-DyUXqUtD.js} +2 -2
- package/dist/{portal-recipes-BpsV_iRw.js.map → portal-recipes-DyUXqUtD.js.map} +1 -1
- package/dist/{primitives-ByWgGUgt.js → primitives-BkkQjYl7.js} +22 -17
- package/dist/primitives-BkkQjYl7.js.map +1 -0
- package/dist/primitives.js +4 -4
- package/dist/{progress-BJhQP9WX.js → progress-DZFXXzPs.js} +4 -4
- package/dist/{progress-BJhQP9WX.js.map → progress-DZFXXzPs.js.map} +1 -1
- package/dist/{receipt-tOc7B3hw.js → receipt-C7LhOg7Q.js} +6 -6
- package/dist/{receipt-tOc7B3hw.js.map → receipt-C7LhOg7Q.js.map} +1 -1
- package/dist/rich-text-BnTzZjIo.js +45 -0
- package/dist/rich-text-BnTzZjIo.js.map +1 -0
- package/dist/rich-text-editor-CAurDwT5.js +1273 -0
- package/dist/rich-text-editor-CAurDwT5.js.map +1 -0
- package/dist/{rich-text-editor-toolbar-laT3tpBT.js → rich-text-editor-toolbar-DbXig7Jk.js} +36 -35
- package/dist/rich-text-editor-toolbar-DbXig7Jk.js.map +1 -0
- package/dist/rich-text-tree-BqyQ_7-R.js +66 -0
- package/dist/rich-text-tree-BqyQ_7-R.js.map +1 -0
- package/dist/{sanitize-html-DsQmI48u.js → sanitize-html-BWkH4dLM.js} +29 -16
- package/dist/sanitize-html-BWkH4dLM.js.map +1 -0
- package/dist/{scroll-area-B0dB2cBi.js → scroll-area-Bj6CRUif.js} +2 -2
- package/dist/{scroll-area-B0dB2cBi.js.map → scroll-area-Bj6CRUif.js.map} +1 -1
- package/dist/{separator-Bb17I4pu.js → separator-B9ewiCGO.js} +2 -2
- package/dist/{separator-Bb17I4pu.js.map → separator-B9ewiCGO.js.map} +1 -1
- package/dist/{separator-Ct_WSWTJ.js → separator-DM6gs2vu.js} +3 -3
- package/dist/{separator-Ct_WSWTJ.js.map → separator-DM6gs2vu.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/settings-DZPHgpx4.js +155 -0
- package/dist/settings-DZPHgpx4.js.map +1 -0
- package/dist/{sheet-BGPERY55.js → sheet-C4DHsgLk.js} +6 -6
- package/dist/{sheet-BGPERY55.js.map → sheet-C4DHsgLk.js.map} +1 -1
- package/dist/sidebar-C8BnDwTH.js +709 -0
- package/dist/sidebar-C8BnDwTH.js.map +1 -0
- package/dist/{sidebar-f9gRWXIR.js → sidebar-CmD6a-HK.js} +16 -13
- package/dist/sidebar-CmD6a-HK.js.map +1 -0
- package/dist/{skeleton-BapcJd9C.js → skeleton-DDgdhmu9.js} +5 -5
- package/dist/{skeleton-BapcJd9C.js.map → skeleton-DDgdhmu9.js.map} +1 -1
- package/dist/{smart-card-CW0hjetE.js → smart-card-B6vLxqa_.js} +8 -8
- package/dist/{smart-card-CW0hjetE.js.map → smart-card-B6vLxqa_.js.map} +1 -1
- package/dist/{structure-DuxKl954.js → structure-DZJ2wbAU.js} +2 -2
- package/dist/{structure-DuxKl954.js.map → structure-DZJ2wbAU.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{surface-recipes-BKRVW8Os.js → surface-recipes-C8mNycaY.js} +2 -2
- package/dist/{surface-recipes-BKRVW8Os.js.map → surface-recipes-C8mNycaY.js.map} +1 -1
- package/dist/{table-CFOWY9pQ.js → table-CBonSdTp.js} +534 -486
- package/dist/table-CBonSdTp.js.map +1 -0
- package/dist/{table-B4TE7iOV.js → table-CXSPHH25.js} +75 -71
- package/dist/table-CXSPHH25.js.map +1 -0
- package/dist/{tabs-e7ko9S2o.js → tabs-C4Kr_hCr.js} +50 -49
- package/dist/tabs-C4Kr_hCr.js.map +1 -0
- package/dist/{text-inputs-B1culiSK.js → text-inputs-jdkS3ReG.js} +9 -9
- package/dist/{text-inputs-B1culiSK.js.map → text-inputs-jdkS3ReG.js.map} +1 -1
- package/dist/{timelines-D3Sl9ueq.js → timelines-CoPwdJP0.js} +10 -10
- package/dist/{timelines-D3Sl9ueq.js.map → timelines-CoPwdJP0.js.map} +1 -1
- package/dist/{tooltip-8wz5S_Zr.js → tooltip-31NwIpTo.js} +4 -4
- package/dist/{tooltip-8wz5S_Zr.js.map → tooltip-31NwIpTo.js.map} +1 -1
- package/dist/{tree-CzUJHnFs.js → tree-CeYVzdFE.js} +6 -6
- package/dist/{tree-CzUJHnFs.js.map → tree-CeYVzdFE.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/{typography-BQnine1k.js → typography-C7-YMW1S.js} +2 -2
- package/dist/{typography-BQnine1k.js.map → typography-C7-YMW1S.js.map} +1 -1
- package/dist/typography.js +1 -1
- package/dist/{upload-BOW6U2tI.js → upload-Hdm5gObf.js} +303 -291
- package/dist/upload-Hdm5gObf.js.map +1 -0
- package/dist/{upload-queue-qUXn1ykN.js → upload-queue-D0sYPuqo.js} +8 -8
- package/dist/{upload-queue-qUXn1ykN.js.map → upload-queue-D0sYPuqo.js.map} +1 -1
- package/dist/{usage-card-BeSLY0i0.js → usage-card-9s8hLDfn.js} +9 -9
- package/dist/{usage-card-BeSLY0i0.js.map → usage-card-9s8hLDfn.js.map} +1 -1
- package/dist/{utils-B6kKb8jB.js → utils-DhuoqFy4.js} +31 -37
- package/dist/utils-DhuoqFy4.js.map +1 -0
- package/dist/{value-inputs-skdVB2zh.js → value-inputs-D3aPgq9H.js} +15 -15
- package/dist/{value-inputs-skdVB2zh.js.map → value-inputs-D3aPgq9H.js.map} +1 -1
- package/dist/{value-typography-uAmWUAL1.js → value-typography-uSzzG9Gf.js} +32 -26
- package/dist/value-typography-uSzzG9Gf.js.map +1 -0
- package/dist/{workspace-DHeHv0qw.js → workspace-CC8Vchiu.js} +12 -12
- package/dist/{workspace-DHeHv0qw.js.map → workspace-CC8Vchiu.js.map} +1 -1
- package/docs/consumer-skill/examples/edit.tsx +3 -3
- package/docs/consumer-skill/references/agents-md.md +19 -19
- package/docs/consumer-skill/references/analytics.md +15 -0
- package/docs/consumer-skill/references/component-contracts.json +14724 -13057
- package/docs/consumer-skill/references/composition.md +21 -4
- package/docs/consumer-skill/references/design-contract.md +1 -0
- package/docs/consumer-skill/references/installation.md +51 -8
- package/docs/consumer-skill/references/integration.md +24 -1
- package/docs/consumer-skill/references/public-api.json +172 -34
- package/docs/consumer-skill/references/review.md +51 -11
- package/docs/consumer-skill/references/rhf-workflows.md +72 -0
- package/docs/consumer-skill/references/theming.md +7 -2
- package/docs/consumer-skill/references/tokens.json +1 -1
- package/docs/consumer-skill/scripts/composition-policy.mjs +144 -30
- package/docs/consumer-skill/scripts/setup-skills.mjs +46 -9
- package/package.json +4 -2
- package/templates/admin-shell-template.tsx +1 -2
- package/templates/customers-template.tsx +18 -16
- package/dist/accordion-B9MHG0cT.js.map +0 -1
- package/dist/ai-artifact-C58tQcBy.js.map +0 -1
- package/dist/auth-DTkkshS8.js.map +0 -1
- package/dist/breadcrumbs-J-K2kl4c.js.map +0 -1
- package/dist/choice-inputs-zUgBZfE4.js.map +0 -1
- package/dist/combobox-BwzoXFSG.js +0 -884
- package/dist/combobox-BwzoXFSG.js.map +0 -1
- package/dist/comments-Dmpp0YIc.js.map +0 -1
- package/dist/data-display-BdgCAw8T.js.map +0 -1
- package/dist/date-picker-RlIzKom_.js +0 -1551
- package/dist/date-picker-RlIzKom_.js.map +0 -1
- package/dist/date-pickers-DY-CpXS1.js +0 -179
- package/dist/date-pickers-DY-CpXS1.js.map +0 -1
- package/dist/feedback-Dm4izqFn.js +0 -240
- package/dist/feedback-Dm4izqFn.js.map +0 -1
- package/dist/filters-DzgSJpMK.js.map +0 -1
- package/dist/form-field-BriWAXyg.js +0 -63
- package/dist/form-field-BriWAXyg.js.map +0 -1
- package/dist/forms-numeric-DIhghX1Q.js +0 -910
- package/dist/forms-numeric-DIhghX1Q.js.map +0 -1
- package/dist/header-DMMxG__r.js.map +0 -1
- package/dist/item-DjCcM18E.js.map +0 -1
- package/dist/layout.types-Cn7aUzJp.js +0 -20
- package/dist/layout.types-Cn7aUzJp.js.map +0 -1
- package/dist/mentions-0_4nWuI-.js.map +0 -1
- package/dist/message-g8p7eVtN.js +0 -128
- package/dist/message-g8p7eVtN.js.map +0 -1
- package/dist/navigation-C90-oQFq.js.map +0 -1
- package/dist/navigation-DaRjthVk.js.map +0 -1
- package/dist/number-CRU3kGuk.js.map +0 -1
- package/dist/overlays-BSgCtM2v.js.map +0 -1
- package/dist/popover-B85RenIl.js.map +0 -1
- package/dist/primitives-ByWgGUgt.js.map +0 -1
- package/dist/rich-text-Dth5E882.js +0 -78
- package/dist/rich-text-Dth5E882.js.map +0 -1
- package/dist/rich-text-editor-C1fOjBTd.js +0 -1195
- package/dist/rich-text-editor-C1fOjBTd.js.map +0 -1
- package/dist/rich-text-editor-toolbar-laT3tpBT.js.map +0 -1
- package/dist/safe-image-src-C6kQSMBZ.js +0 -17
- package/dist/safe-image-src-C6kQSMBZ.js.map +0 -1
- package/dist/sanitize-html-DsQmI48u.js.map +0 -1
- package/dist/settings-Bar5wiSo.js +0 -167
- package/dist/settings-Bar5wiSo.js.map +0 -1
- package/dist/sidebar-D-JYMMbY.js +0 -686
- package/dist/sidebar-D-JYMMbY.js.map +0 -1
- package/dist/sidebar-f9gRWXIR.js.map +0 -1
- package/dist/table-B4TE7iOV.js.map +0 -1
- package/dist/table-CFOWY9pQ.js.map +0 -1
- package/dist/tabs-e7ko9S2o.js.map +0 -1
- package/dist/upload-BOW6U2tI.js.map +0 -1
- package/dist/utils-B6kKb8jB.js.map +0 -1
- package/dist/value-typography-uAmWUAL1.js.map +0 -1
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { S as e, d as t } from "./ui-provider-C-74NVLc.js";
|
|
3
3
|
import { useStrings as n } from "./lib/strings.js";
|
|
4
|
-
import { t as r } from "./utils-
|
|
5
|
-
import { n as i } from "./buttons-
|
|
6
|
-
import { a, c as o, o as s } from "./typography-
|
|
4
|
+
import { t as r } from "./utils-DhuoqFy4.js";
|
|
5
|
+
import { n as i } from "./buttons-DeW0bQeK.js";
|
|
6
|
+
import { a, c as o, o as s } from "./typography-C7-YMW1S.js";
|
|
7
7
|
import { t as c } from "./focus-recipes-B653VaLq.js";
|
|
8
|
-
import { r as l, t as u } from "./structure-
|
|
8
|
+
import { r as l, t as u } from "./structure-DZJ2wbAU.js";
|
|
9
9
|
import { i as d } from "./tone-recipes-BPsRAvhu.js";
|
|
10
|
-
import { n as f, t as p } from "./feedback-
|
|
11
|
-
import { i as m, r as h } from "./popover.recipes-
|
|
12
|
-
import { _ as g, m as _ } from "./primitives-
|
|
13
|
-
import { t as v } from "./number-
|
|
14
|
-
import { n as y,
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as
|
|
17
|
-
import { n as
|
|
18
|
-
import { a as
|
|
19
|
-
import { d as
|
|
20
|
-
import { t as
|
|
21
|
-
import { t as
|
|
22
|
-
import { a as ee, c as
|
|
10
|
+
import { n as f, t as p } from "./feedback-Dzo1xtAU.js";
|
|
11
|
+
import { i as m, r as h } from "./popover.recipes-DJ0AkUan.js";
|
|
12
|
+
import { _ as g, m as _ } from "./primitives-BkkQjYl7.js";
|
|
13
|
+
import { t as v } from "./number-CYqBcrSj.js";
|
|
14
|
+
import { n as y, s as b, t as x } from "./date-Br0FicVv.js";
|
|
15
|
+
import { t as S } from "./badge-wWauMgAt.js";
|
|
16
|
+
import { t as C } from "./layer-recipes-CCpklYME.js";
|
|
17
|
+
import { n as w } from "./field-affordance-recipes-D6H7tVJi.js";
|
|
18
|
+
import { a as T, i as E, n as D, o as O, r as k, s as A, t as j } from "./command-9e52NPgK.js";
|
|
19
|
+
import { d as M, p as N, y as P } from "./form-sizing-CgcrUbLU.js";
|
|
20
|
+
import { t as F } from "./input-7KAc7XQL.js";
|
|
21
|
+
import { t as I } from "./date-picker-CyQlFYsP.js";
|
|
22
|
+
import { a as ee, c as te, i as L, n as R, o as ne, r as z, t as re } from "./popover-k8TdUcAt.js";
|
|
23
23
|
import { n as ie, r as ae, t as oe } from "./control-group-recipes-fMuFo0H7.js";
|
|
24
|
-
import { i as se, r as ce, t as le } from "./tabs-
|
|
25
|
-
import { t as ue } from "./popover-menu-
|
|
24
|
+
import { i as se, r as ce, t as le } from "./tabs-C4Kr_hCr.js";
|
|
25
|
+
import { t as ue } from "./popover-menu-yn-o0kyA.js";
|
|
26
26
|
import { t as de } from "./use-debounced-callback-Cx1h-hdv.js";
|
|
27
27
|
import { t as fe } from "./use-debounce-DZ_1ZBPa.js";
|
|
28
|
-
import { i as pe, n as me, r as he, t as ge } from "./cascader-
|
|
29
|
-
import
|
|
30
|
-
import { Fragment as
|
|
28
|
+
import { i as pe, n as me, r as he, t as ge } from "./cascader-CrAl9zD5.js";
|
|
29
|
+
import B, { Component as _e, createContext as ve, useCallback as V, useContext as ye, useEffect as H, useId as be, useMemo as U, useRef as W, useState as G } from "react";
|
|
30
|
+
import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
31
31
|
import { CalendarIcon as xe, Check as Se, ChevronDown as Ce, ChevronLeft as we, ChevronsUpDown as Te, Filter as Ee, Loader2 as De, Plus as Oe, X as ke } from "lucide-react";
|
|
32
|
-
import { format as Ae, isValid as
|
|
32
|
+
import { format as Ae, isValid as je, parse as Me } from "date-fns";
|
|
33
33
|
//#region src/components/features/filters/filters.strings.ts
|
|
34
|
-
var
|
|
34
|
+
var Ne = {
|
|
35
35
|
loading: "Loading",
|
|
36
36
|
loadingOptions: "Loading {filterLabel} options...",
|
|
37
37
|
addFilter: "Add filter",
|
|
@@ -115,7 +115,7 @@ var Me = {
|
|
|
115
115
|
function Y(e, t) {
|
|
116
116
|
return e.replace(/{(\w+)}/g, (e, n) => String(t[n] ?? e)).replace(/:(\w+)/g, (e, n) => t[n] === void 0 ? e : String(t[n]));
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Pe(e, t, n) {
|
|
119
119
|
let r = t.split("."), i = e;
|
|
120
120
|
for (let e of r) {
|
|
121
121
|
if (typeof i != "object" || !i) return t;
|
|
@@ -150,12 +150,12 @@ var X = {
|
|
|
150
150
|
HAS_ANY: "has_any",
|
|
151
151
|
HAS_ALL: "has_all"
|
|
152
152
|
};
|
|
153
|
-
function
|
|
153
|
+
function Fe(e) {
|
|
154
154
|
return e;
|
|
155
155
|
}
|
|
156
156
|
//#endregion
|
|
157
157
|
//#region src/components/features/filters/operator-options.ts
|
|
158
|
-
function
|
|
158
|
+
function Ie(e) {
|
|
159
159
|
return [
|
|
160
160
|
{
|
|
161
161
|
label: e.contains,
|
|
@@ -171,7 +171,7 @@ function Fe(e) {
|
|
|
171
171
|
}
|
|
172
172
|
];
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function Le(e) {
|
|
175
175
|
return [{
|
|
176
176
|
label: e.is,
|
|
177
177
|
value: Z.EQUALS
|
|
@@ -180,7 +180,7 @@ function Ie(e) {
|
|
|
180
180
|
value: Z.NOT
|
|
181
181
|
}];
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function Re(e) {
|
|
184
184
|
return [
|
|
185
185
|
{
|
|
186
186
|
label: e.equals,
|
|
@@ -196,7 +196,7 @@ function Le(e) {
|
|
|
196
196
|
}
|
|
197
197
|
];
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function ze(e) {
|
|
200
200
|
return [
|
|
201
201
|
{
|
|
202
202
|
label: e.before,
|
|
@@ -212,15 +212,15 @@ function Re(e) {
|
|
|
212
212
|
}
|
|
213
213
|
];
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function Be(e) {
|
|
216
216
|
return [{
|
|
217
217
|
label: e.equals,
|
|
218
218
|
value: Z.EQUALS
|
|
219
219
|
}];
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function Ve(e, t) {
|
|
222
222
|
switch (e) {
|
|
223
|
-
case X.SEARCH: return
|
|
223
|
+
case X.SEARCH: return Ie(t);
|
|
224
224
|
case X.TAGS: return [
|
|
225
225
|
{
|
|
226
226
|
label: t.has,
|
|
@@ -236,29 +236,48 @@ function Be(e, t) {
|
|
|
236
236
|
}
|
|
237
237
|
];
|
|
238
238
|
case X.SELECT:
|
|
239
|
-
case X.ASYNC_SELECT: return
|
|
240
|
-
case X.RANGE: return
|
|
241
|
-
|
|
242
|
-
|
|
239
|
+
case X.ASYNC_SELECT: return Le(t);
|
|
240
|
+
case X.RANGE: return [{
|
|
241
|
+
label: t.between,
|
|
242
|
+
value: Z.BETWEEN
|
|
243
|
+
}];
|
|
244
|
+
case X.DATE: return ze(t);
|
|
245
|
+
default: return Ie(t);
|
|
243
246
|
}
|
|
244
247
|
}
|
|
245
|
-
function
|
|
248
|
+
function He(e) {
|
|
246
249
|
switch (e) {
|
|
247
250
|
case X.SEARCH: return Z.CONTAINS;
|
|
248
251
|
case X.TAGS: return Z.HAS;
|
|
249
252
|
case X.SELECT:
|
|
250
253
|
case X.ASYNC_SELECT: return Z.EQUALS;
|
|
251
|
-
case X.RANGE: return Z.
|
|
254
|
+
case X.RANGE: return Z.BETWEEN;
|
|
252
255
|
case X.DATE: return Z.BEFORE;
|
|
253
256
|
default: return Z.EQUALS;
|
|
254
257
|
}
|
|
255
258
|
}
|
|
256
259
|
//#endregion
|
|
257
260
|
//#region src/components/features/filters/utils/filter-utils.ts
|
|
258
|
-
function
|
|
261
|
+
function Ue(e, t) {
|
|
262
|
+
let n = e[0] ?? "";
|
|
263
|
+
return e.length > 1 ? [n, e[1] ?? ""] : t === "lt" ? ["", n] : t === "equals" ? [n, n] : [n, ""];
|
|
264
|
+
}
|
|
265
|
+
function We(e) {
|
|
266
|
+
return e.length === 2 && e.every((e) => e.trim().length > 0);
|
|
267
|
+
}
|
|
268
|
+
function Ge(e, t) {
|
|
269
|
+
if (e) {
|
|
270
|
+
if (t) {
|
|
271
|
+
let n = Me(e, t, /* @__PURE__ */ new Date());
|
|
272
|
+
if (je(n)) return n;
|
|
273
|
+
}
|
|
274
|
+
return b(e) ?? void 0;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function Ke(e, t) {
|
|
259
278
|
for (let n of e ?? []) {
|
|
260
279
|
if (n.value === t) return [n];
|
|
261
|
-
let e =
|
|
280
|
+
let e = Ke(n.children, t);
|
|
262
281
|
if (e.length) return [n, ...e];
|
|
263
282
|
}
|
|
264
283
|
return [];
|
|
@@ -266,24 +285,24 @@ function He(e, t) {
|
|
|
266
285
|
function Q(e) {
|
|
267
286
|
return e.replace(/\S+/g, (e) => /^\p{Lu}{2,}/u.test(e) ? e : e.toLowerCase());
|
|
268
287
|
}
|
|
269
|
-
function
|
|
288
|
+
function qe(e) {
|
|
270
289
|
return !!e?.some((e) => !!e.children?.length);
|
|
271
290
|
}
|
|
272
|
-
function
|
|
291
|
+
function Je(e) {
|
|
273
292
|
return e.map((e) => ({
|
|
274
293
|
value: e.value,
|
|
275
294
|
label: e.label,
|
|
276
295
|
description: e.description,
|
|
277
296
|
icon: e.icon ?? void 0,
|
|
278
297
|
disabled: e.disabled,
|
|
279
|
-
...e.children?.length ? { children:
|
|
298
|
+
...e.children?.length ? { children: Je(e.children) } : {}
|
|
280
299
|
}));
|
|
281
300
|
}
|
|
282
|
-
function
|
|
283
|
-
let r =
|
|
301
|
+
function Ye(e, t, n = " / ") {
|
|
302
|
+
let r = Ke(e.options, t);
|
|
284
303
|
return r.length ? r.map((e) => e.label).join(n) : void 0;
|
|
285
304
|
}
|
|
286
|
-
function
|
|
305
|
+
function Xe(e, t, n) {
|
|
287
306
|
if (e.type === "date" && Array.isArray(t) && t.every((e) => typeof e == "string")) return !0;
|
|
288
307
|
if (e.validation?.required && (!t || Array.isArray(t) && t.length === 0)) return n("validation.required");
|
|
289
308
|
if (typeof t == "number") {
|
|
@@ -299,15 +318,21 @@ function Ke(e, t, n) {
|
|
|
299
318
|
}
|
|
300
319
|
//#endregion
|
|
301
320
|
//#region src/components/features/filters/filter-context.tsx
|
|
302
|
-
var
|
|
303
|
-
function
|
|
304
|
-
let c =
|
|
321
|
+
var Ze = ve(void 0);
|
|
322
|
+
function Qe({ children: e, filters: t, activeFilters: r, onFilterChange: i, navigating: a = !1, strings: o, onError: s }) {
|
|
323
|
+
let c = W(t), l = W(i), u = W(s);
|
|
305
324
|
u.current = s;
|
|
306
|
-
let [d, f] =
|
|
325
|
+
let [d, f] = G(() => /* @__PURE__ */ new Map()), p = V((e) => {
|
|
326
|
+
f((t) => {
|
|
327
|
+
if (!t.has(e)) return t;
|
|
328
|
+
let n = new Map(t);
|
|
329
|
+
return n.delete(e), n;
|
|
330
|
+
});
|
|
331
|
+
}, []), [m, h] = G(0), g = W(/* @__PURE__ */ new Map()), _ = U(() => {
|
|
307
332
|
let e = /* @__PURE__ */ new Map();
|
|
308
333
|
for (let n of t) {
|
|
309
334
|
if (n.type !== X.ASYNC_SELECT) continue;
|
|
310
|
-
let t = n.asyncConfig?.fetcher, r = n.asyncConfig?.mapToOption, i = n.asyncConfig?.limit ?? 10, a =
|
|
335
|
+
let t = n.asyncConfig?.fetcher, r = n.asyncConfig?.mapToOption, i = n.asyncConfig?.limit ?? 10, a = g.current.get(n.key), o = a && a.fetcher === t && a.mapToOption === r;
|
|
311
336
|
e.set(n.key, o && a.limit === i ? a : {
|
|
312
337
|
fetcher: t,
|
|
313
338
|
mapToOption: r,
|
|
@@ -315,69 +340,104 @@ function Je({ children: e, filters: t, activeFilters: r, onFilterChange: i, navi
|
|
|
315
340
|
options: o ? a.options : /* @__PURE__ */ new Map()
|
|
316
341
|
});
|
|
317
342
|
}
|
|
318
|
-
return e.size ===
|
|
319
|
-
}, [t]),
|
|
320
|
-
|
|
343
|
+
return e.size === g.current.size && [...e].every(([e, t]) => g.current.get(e) === t) ? g.current : (g.current = e, e);
|
|
344
|
+
}, [t]), v = JSON.stringify(r.filter((e) => _.has(e.key)).map(({ key: e, value: t }) => [e, t])), y = n(Ne, o);
|
|
345
|
+
H(() => {
|
|
321
346
|
c.current = t;
|
|
322
|
-
}, [t]),
|
|
347
|
+
}, [t]), H(() => {
|
|
323
348
|
l.current = i;
|
|
324
349
|
}, [i]);
|
|
325
|
-
let
|
|
350
|
+
let b = V((e) => {
|
|
326
351
|
let t = [...r, e];
|
|
327
352
|
l.current(t);
|
|
328
|
-
}, [r]),
|
|
353
|
+
}, [r]), x = V((e) => {
|
|
354
|
+
p(r.find((t) => t.id === e)?.key ?? e);
|
|
329
355
|
let t = r.filter((t) => t.id !== e && t.key !== e);
|
|
330
356
|
l.current(t);
|
|
331
|
-
}, [r]),
|
|
357
|
+
}, [r, p]), S = V((e, t) => {
|
|
332
358
|
let n = r.map((n) => n.id === e || n.key === e ? {
|
|
333
359
|
...n,
|
|
334
360
|
...t
|
|
335
361
|
} : n);
|
|
336
362
|
l.current(n);
|
|
337
|
-
}, [r]),
|
|
338
|
-
l.current([]);
|
|
339
|
-
}, []),
|
|
340
|
-
l.current(e);
|
|
341
|
-
}, []),
|
|
342
|
-
let n = r.find((t) => t.key === e);
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
363
|
+
}, [r]), C = V(() => {
|
|
364
|
+
f(/* @__PURE__ */ new Map()), l.current([]);
|
|
365
|
+
}, []), w = V((e) => {
|
|
366
|
+
f(/* @__PURE__ */ new Map()), l.current(e);
|
|
367
|
+
}, []), T = V((e) => c.current.find((t) => t.key === e), []), E = V((e) => r.find((t) => t.key === e)?.value || [], [r]), D = V((e) => {
|
|
368
|
+
let n = r.find((t) => t.key === e), i = t.find((t) => t.key === e);
|
|
369
|
+
return i?.type === X.DATE ? d.get(e) ?? n?.operator ?? i.operator ?? i.operators?.[0]?.value ?? He(i.type) : n?.operator ?? "equals";
|
|
370
|
+
}, [
|
|
371
|
+
r,
|
|
372
|
+
d,
|
|
373
|
+
t
|
|
374
|
+
]), O = V((e, t) => {
|
|
375
|
+
let n = r.find((t) => t.key === e), i = T(e), a = i?.type === X.DATE ? D(e) : void 0;
|
|
376
|
+
if (!(a === "between" && t.length > 0 && !We(t))) {
|
|
377
|
+
if (t.length === 0) p(e), n && x(e);
|
|
378
|
+
else if (a && p(e), n) S(e, a ? {
|
|
350
379
|
value: t,
|
|
351
|
-
operator:
|
|
380
|
+
operator: a
|
|
381
|
+
} : { value: t });
|
|
382
|
+
else {
|
|
383
|
+
let n = a ?? i?.operator ?? i?.operators?.[0]?.value ?? (i ? He(i.type) : "equals");
|
|
384
|
+
b({
|
|
385
|
+
id: e,
|
|
386
|
+
key: e,
|
|
387
|
+
value: t,
|
|
388
|
+
operator: n
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}, [
|
|
393
|
+
r,
|
|
394
|
+
b,
|
|
395
|
+
p,
|
|
396
|
+
T,
|
|
397
|
+
D,
|
|
398
|
+
x,
|
|
399
|
+
S
|
|
400
|
+
]), k = V((e) => r.some((t) => t.key === e && t.value.length > 0), [r]), A = V((e, t) => {
|
|
401
|
+
let n = r.find((t) => t.key === e);
|
|
402
|
+
if (T(e)?.type === X.DATE) {
|
|
403
|
+
if (!n || t === "between" && !We(n.value)) {
|
|
404
|
+
f((n) => new Map(n).set(e, t));
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
p(e);
|
|
408
|
+
let r = t === "between" ? n.value : n.value.slice(0, 1);
|
|
409
|
+
S(e, {
|
|
410
|
+
operator: t,
|
|
411
|
+
value: r
|
|
352
412
|
});
|
|
413
|
+
return;
|
|
353
414
|
}
|
|
415
|
+
n && S(e, { operator: t });
|
|
354
416
|
}, [
|
|
355
417
|
r,
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
]),
|
|
360
|
-
r.find((t) => t.key === e) && y(e, { operator: t });
|
|
361
|
-
}, [r, y]), O = B((e, t) => {
|
|
418
|
+
p,
|
|
419
|
+
T,
|
|
420
|
+
S
|
|
421
|
+
]), j = V((e, t) => {
|
|
362
422
|
let n = c.current.find((t) => t.key === e);
|
|
363
|
-
return n ?
|
|
364
|
-
}, [
|
|
365
|
-
let n =
|
|
423
|
+
return n ? Xe(n, t, (e) => Pe(y, e)) : !1;
|
|
424
|
+
}, [y]), M = V((e) => c.current.filter((t) => t.dependencies?.some((t) => t.key === e)), []), N = V((e, t) => {
|
|
425
|
+
let n = _.get(e)?.options;
|
|
366
426
|
if (!n) return;
|
|
367
427
|
let r = !1;
|
|
368
428
|
for (let e of t) n.get(e.value)?.label !== e.label && (r = !0), n.set(e.value, e);
|
|
369
|
-
r &&
|
|
370
|
-
}, [
|
|
429
|
+
r && h((e) => e + 1);
|
|
430
|
+
}, [_]), P = V((e, t) => _.get(e)?.options.get(t)?.label, [_, m]), F = V((e, t) => {
|
|
371
431
|
u.current?.(e, t);
|
|
372
432
|
}, []);
|
|
373
|
-
|
|
433
|
+
H(() => {
|
|
374
434
|
let e = new AbortController(), t = (t, n) => {
|
|
375
435
|
e.signal.aborted || t && t.name === "AbortError" || u.current?.(t, {
|
|
376
436
|
phase: "fetch-options",
|
|
377
437
|
filterKey: n
|
|
378
438
|
});
|
|
379
|
-
}, n = new Map(JSON.parse(
|
|
380
|
-
for (let [r, i] of
|
|
439
|
+
}, n = new Map(JSON.parse(v));
|
|
440
|
+
for (let [r, i] of _) {
|
|
381
441
|
let a = n.get(r);
|
|
382
442
|
if (!a || a.length === 0 || a.every((e) => i.options.has(e))) continue;
|
|
383
443
|
let { fetcher: o, mapToOption: s, limit: c } = i;
|
|
@@ -386,42 +446,39 @@ function Je({ children: e, filters: t, activeFilters: r, onFilterChange: i, navi
|
|
|
386
446
|
limit: c,
|
|
387
447
|
signal: e.signal
|
|
388
448
|
}).then((t) => {
|
|
389
|
-
e.signal.aborted ||
|
|
449
|
+
e.signal.aborted || N(r, t.map(s));
|
|
390
450
|
}).catch((e) => t(e, r));
|
|
391
451
|
}
|
|
392
452
|
return () => e.abort();
|
|
393
453
|
}, [
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
454
|
+
v,
|
|
455
|
+
_,
|
|
456
|
+
N
|
|
397
457
|
]);
|
|
398
|
-
let
|
|
458
|
+
let I = U(() => ({
|
|
399
459
|
activeFilters: r,
|
|
400
460
|
filters: t,
|
|
401
|
-
addFilter:
|
|
402
|
-
removeFilter:
|
|
403
|
-
updateFilter:
|
|
404
|
-
clearFilters:
|
|
405
|
-
replaceFilters:
|
|
406
|
-
getFilterByKey:
|
|
407
|
-
getFilterValue:
|
|
408
|
-
setFilterValue:
|
|
409
|
-
isFilterActive:
|
|
410
|
-
getFilterOperator:
|
|
411
|
-
setFilterOperator:
|
|
412
|
-
validateFilter:
|
|
413
|
-
getDependentFilters:
|
|
461
|
+
addFilter: b,
|
|
462
|
+
removeFilter: x,
|
|
463
|
+
updateFilter: S,
|
|
464
|
+
clearFilters: C,
|
|
465
|
+
replaceFilters: w,
|
|
466
|
+
getFilterByKey: T,
|
|
467
|
+
getFilterValue: E,
|
|
468
|
+
setFilterValue: O,
|
|
469
|
+
isFilterActive: k,
|
|
470
|
+
getFilterOperator: D,
|
|
471
|
+
setFilterOperator: A,
|
|
472
|
+
validateFilter: j,
|
|
473
|
+
getDependentFilters: M,
|
|
414
474
|
isNavigating: a,
|
|
415
|
-
strings:
|
|
416
|
-
cacheAsyncOptions:
|
|
417
|
-
getAsyncOptionLabel:
|
|
418
|
-
reportError:
|
|
475
|
+
strings: y,
|
|
476
|
+
cacheAsyncOptions: N,
|
|
477
|
+
getAsyncOptionLabel: P,
|
|
478
|
+
reportError: F
|
|
419
479
|
}), [
|
|
420
480
|
r,
|
|
421
481
|
t,
|
|
422
|
-
_,
|
|
423
|
-
v,
|
|
424
|
-
y,
|
|
425
482
|
b,
|
|
426
483
|
x,
|
|
427
484
|
S,
|
|
@@ -429,36 +486,39 @@ function Je({ children: e, filters: t, activeFilters: r, onFilterChange: i, navi
|
|
|
429
486
|
w,
|
|
430
487
|
T,
|
|
431
488
|
E,
|
|
432
|
-
D,
|
|
433
489
|
O,
|
|
434
490
|
k,
|
|
435
|
-
|
|
436
|
-
g,
|
|
491
|
+
D,
|
|
437
492
|
A,
|
|
438
493
|
j,
|
|
439
|
-
M
|
|
494
|
+
M,
|
|
495
|
+
a,
|
|
496
|
+
y,
|
|
497
|
+
N,
|
|
498
|
+
P,
|
|
499
|
+
F
|
|
440
500
|
]);
|
|
441
|
-
return /* @__PURE__ */
|
|
442
|
-
value:
|
|
501
|
+
return /* @__PURE__ */ q(Ze.Provider, {
|
|
502
|
+
value: I,
|
|
443
503
|
children: e
|
|
444
504
|
});
|
|
445
505
|
}
|
|
446
506
|
function $() {
|
|
447
|
-
let e = ye(
|
|
507
|
+
let e = ye(Ze);
|
|
448
508
|
if (!e) throw Error("useFilters must be used within a FilterProvider");
|
|
449
509
|
return e;
|
|
450
510
|
}
|
|
451
511
|
//#endregion
|
|
452
512
|
//#region src/components/features/filters/hooks/use-filter-groups.ts
|
|
453
|
-
function
|
|
454
|
-
let { dynamicFilterOptions: t } = e, { filters: n, isFilterActive: r } = $(), i =
|
|
513
|
+
function $e(e = {}) {
|
|
514
|
+
let { dynamicFilterOptions: t } = e, { filters: n, isFilterActive: r } = $(), i = U(() => t ? n.map((e) => {
|
|
455
515
|
let n = t[e.key];
|
|
456
516
|
return Array.isArray(n) ? {
|
|
457
517
|
...e,
|
|
458
518
|
options: n
|
|
459
519
|
} : e;
|
|
460
520
|
}) : n, [n, t]);
|
|
461
|
-
return
|
|
521
|
+
return U(() => {
|
|
462
522
|
let e = i.filter((e) => e.type === X.SEARCH), t = i.filter((e) => !e.displayConfig?.hidden && e.displayConfig?.display !== "hidden"), n = i.filter((e) => e.type !== X.SEARCH && !e.displayConfig?.hidden && e.displayConfig?.display !== "hidden" && r(e.key)), a = t.filter((e) => e.type !== X.SEARCH && !r(e.key) && e.displayConfig?.display === "always"), o = t.filter((e) => e.type !== X.SEARCH && !r(e.key) && e.displayConfig?.display !== "always"), s = n.map((e) => e.key);
|
|
463
523
|
return {
|
|
464
524
|
processedFilters: i,
|
|
@@ -473,14 +533,14 @@ function Ye(e = {}) {
|
|
|
473
533
|
}
|
|
474
534
|
//#endregion
|
|
475
535
|
//#region src/components/features/filters/partials/filter-operator-select.tsx
|
|
476
|
-
function
|
|
477
|
-
let [c, l] =
|
|
478
|
-
return /* @__PURE__ */
|
|
536
|
+
function et({ operator: e, operators: t, onOperatorChange: n, segmentResetClass: a }) {
|
|
537
|
+
let [c, l] = G(!1), { strings: u } = $(), d = t.find((t) => t.value === e)?.label || e;
|
|
538
|
+
return /* @__PURE__ */ q(ue, {
|
|
479
539
|
open: c,
|
|
480
540
|
onOpenChange: l,
|
|
481
541
|
search: !1,
|
|
482
542
|
contentLabel: u.operator,
|
|
483
|
-
trigger: /* @__PURE__ */
|
|
543
|
+
trigger: /* @__PURE__ */ q(i, {
|
|
484
544
|
tone: "secondary",
|
|
485
545
|
buttonStyle: "ghost",
|
|
486
546
|
className: r("filter-operator-select--component", a, "h-full min-h-0 px-control text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
|
|
@@ -488,13 +548,13 @@ function Xe({ operator: e, operators: t, onOperatorChange: n, segmentResetClass:
|
|
|
488
548
|
e.stopPropagation();
|
|
489
549
|
},
|
|
490
550
|
type: "button",
|
|
491
|
-
children: /* @__PURE__ */
|
|
551
|
+
children: /* @__PURE__ */ q(o, {
|
|
492
552
|
tag: "span",
|
|
493
553
|
type: "inherit",
|
|
494
554
|
children: d
|
|
495
555
|
})
|
|
496
556
|
}),
|
|
497
|
-
header: /* @__PURE__ */
|
|
557
|
+
header: /* @__PURE__ */ q(s, {
|
|
498
558
|
tag: "span",
|
|
499
559
|
children: u.operator
|
|
500
560
|
}),
|
|
@@ -511,130 +571,140 @@ function Xe({ operator: e, operators: t, onOperatorChange: n, segmentResetClass:
|
|
|
511
571
|
}
|
|
512
572
|
//#endregion
|
|
513
573
|
//#region src/components/features/filters/partials/filter-value-display.tsx
|
|
514
|
-
function
|
|
515
|
-
let { strings: n } = $();
|
|
516
|
-
|
|
574
|
+
function tt({ filter: e, value: t }) {
|
|
575
|
+
let { strings: n, getFilterOperator: i } = $();
|
|
576
|
+
if (t.length === 0 && e.type !== X.DATE) return /* @__PURE__ */ q(o, {
|
|
517
577
|
tag: "span",
|
|
518
578
|
type: "secondary",
|
|
519
579
|
lineHeight: "none",
|
|
520
580
|
className: "filter-value-display--component",
|
|
521
581
|
children: n.nothingSelected
|
|
522
|
-
})
|
|
582
|
+
});
|
|
583
|
+
if (e.type === X.RANGE) {
|
|
584
|
+
let [r, a] = Ue(t, i(e.key)), s = r && a ? `${r} – ${a}` : r ? `${n.min} ${r}` : a ? `${n.max} ${a}` : n.nothingSelected;
|
|
585
|
+
return /* @__PURE__ */ q(o, {
|
|
586
|
+
tag: "span",
|
|
587
|
+
type: "inherit",
|
|
588
|
+
weight: "semibold",
|
|
589
|
+
lineHeight: "none",
|
|
590
|
+
className: "filter-value-display--component",
|
|
591
|
+
children: s
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
return e.type === X.ASYNC_SELECT && !e.options?.length ? /* @__PURE__ */ q(o, {
|
|
523
595
|
tag: "span",
|
|
524
596
|
type: "inherit",
|
|
525
597
|
weight: "semibold",
|
|
526
598
|
lineHeight: "none",
|
|
527
599
|
className: "filter-value-display--component",
|
|
528
|
-
children:
|
|
529
|
-
}) : e.options && e.type !== X.DATE ? /* @__PURE__ */
|
|
600
|
+
children: rt(e, t, n)
|
|
601
|
+
}) : e.options && e.type !== X.DATE ? /* @__PURE__ */ J(u, {
|
|
530
602
|
direction: "horizontal",
|
|
531
603
|
gap: "xs",
|
|
532
604
|
wrap: !1,
|
|
533
605
|
className: "filter-value-display--component",
|
|
534
|
-
children: [/* @__PURE__ */
|
|
606
|
+
children: [/* @__PURE__ */ J("div", {
|
|
535
607
|
className: "relative isolate flex",
|
|
536
608
|
children: [t.slice(0, 2).map((t, n) => {
|
|
537
|
-
let i =
|
|
538
|
-
return i?.icon ? /* @__PURE__ */
|
|
539
|
-
className: r("border-background bg-background relative rounded-full border", n > 0 ? "-ml-space-sm z-[1]" :
|
|
609
|
+
let i = Ke(e.options, t).at(-1);
|
|
610
|
+
return i?.icon ? /* @__PURE__ */ q("div", {
|
|
611
|
+
className: r("border-background bg-background relative rounded-full border", n > 0 ? "-ml-space-sm z-[1]" : C.raised),
|
|
540
612
|
children: i.icon
|
|
541
613
|
}, t) : null;
|
|
542
|
-
}), t.length > 2 && /* @__PURE__ */
|
|
614
|
+
}), t.length > 2 && /* @__PURE__ */ q("div", {
|
|
543
615
|
className: "bg-muted border-background relative z-0 -ml-space-sm flex size-icon items-center justify-center rounded-full border",
|
|
544
|
-
children: /* @__PURE__ */
|
|
616
|
+
children: /* @__PURE__ */ J(o, {
|
|
545
617
|
tag: "span",
|
|
546
618
|
size: "xs",
|
|
547
619
|
weight: "medium",
|
|
548
|
-
children: ["+", /* @__PURE__ */
|
|
620
|
+
children: ["+", /* @__PURE__ */ q(v, {
|
|
549
621
|
value: t.length - 2,
|
|
550
622
|
size: "inherit",
|
|
551
623
|
align: "center"
|
|
552
624
|
})]
|
|
553
625
|
})
|
|
554
626
|
})]
|
|
555
|
-
}), /* @__PURE__ */
|
|
627
|
+
}), /* @__PURE__ */ q(o, {
|
|
556
628
|
tag: "span",
|
|
557
629
|
type: "inherit",
|
|
558
630
|
weight: "semibold",
|
|
559
631
|
lineHeight: "none",
|
|
560
632
|
className: "truncate",
|
|
561
|
-
children:
|
|
633
|
+
children: it(e, t, n)
|
|
562
634
|
})]
|
|
563
|
-
}) : e.type === X.DATE ? /* @__PURE__ */
|
|
635
|
+
}) : e.type === X.DATE ? /* @__PURE__ */ J(u, {
|
|
564
636
|
direction: "horizontal",
|
|
565
637
|
gap: "xs",
|
|
566
638
|
wrap: !1,
|
|
567
639
|
className: "filter-value-display--component",
|
|
568
|
-
children: [/* @__PURE__ */
|
|
640
|
+
children: [/* @__PURE__ */ q(xe, { className: "text-muted-foreground size-icon-sm" }), /* @__PURE__ */ q(o, {
|
|
569
641
|
tag: "span",
|
|
570
642
|
type: "inherit",
|
|
571
643
|
weight: "semibold",
|
|
572
644
|
lineHeight: "none",
|
|
573
645
|
className: "min-w-0 truncate",
|
|
574
|
-
children:
|
|
646
|
+
children: nt(e, t, n)
|
|
575
647
|
})]
|
|
576
|
-
}) : /* @__PURE__ */
|
|
648
|
+
}) : /* @__PURE__ */ q(o, {
|
|
577
649
|
tag: "span",
|
|
578
650
|
type: "inherit",
|
|
579
651
|
weight: "semibold",
|
|
580
652
|
lineHeight: "none",
|
|
581
653
|
className: "filter-value-display--component truncate",
|
|
582
|
-
children:
|
|
654
|
+
children: it(e, t, n)
|
|
583
655
|
});
|
|
584
656
|
}
|
|
585
|
-
function
|
|
586
|
-
return
|
|
657
|
+
function nt(e, t, n) {
|
|
658
|
+
return t.length === 1 ? at(t[0], e.dateFormat) : t.length === 2 ? ot(t[0], t[1], e.dateFormat) : /* @__PURE__ */ q(g, { children: e.datePickerConfig?.noDatePlaceholder || n.calendar.notDateSelected });
|
|
587
659
|
}
|
|
588
|
-
function
|
|
660
|
+
function rt(e, t, n) {
|
|
589
661
|
return t.length === 0 ? "" : Y(n.selected, {
|
|
590
662
|
count: t.length,
|
|
591
663
|
filterLabel: Q((t.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
592
664
|
});
|
|
593
665
|
}
|
|
594
|
-
function
|
|
666
|
+
function it(e, t, n) {
|
|
595
667
|
return t.length > 1 ? Y(n.selected, {
|
|
596
668
|
count: t.length,
|
|
597
669
|
filterLabel: Q(e.pluralLabel ?? e.label)
|
|
598
|
-
}) : t.map((t) =>
|
|
599
|
-
}
|
|
600
|
-
function
|
|
601
|
-
let
|
|
602
|
-
return
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
format: n
|
|
615
|
-
}) : /* @__PURE__ */ q("span", {
|
|
670
|
+
}) : t.map((t) => Ye(e, t) || t).join(", ");
|
|
671
|
+
}
|
|
672
|
+
function at(e, t) {
|
|
673
|
+
let n = Ge(e, t?.param);
|
|
674
|
+
return n ? /* @__PURE__ */ q(x, {
|
|
675
|
+
value: n,
|
|
676
|
+
format: t?.display
|
|
677
|
+
}) : /* @__PURE__ */ q(g, { children: e });
|
|
678
|
+
}
|
|
679
|
+
function ot(e, t, n) {
|
|
680
|
+
let r = Ge(e, n?.param), i = Ge(t, n?.param);
|
|
681
|
+
return r && i ? /* @__PURE__ */ q(y, {
|
|
682
|
+
from: r,
|
|
683
|
+
to: i,
|
|
684
|
+
format: n?.display
|
|
685
|
+
}) : /* @__PURE__ */ J("span", {
|
|
616
686
|
className: "inline-flex min-w-0 items-center gap-space-xs",
|
|
617
687
|
children: [
|
|
618
|
-
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
|
|
688
|
+
at(e, n),
|
|
689
|
+
/* @__PURE__ */ q(g, { children: "–" }),
|
|
690
|
+
at(t, n)
|
|
621
691
|
]
|
|
622
692
|
});
|
|
623
693
|
}
|
|
624
694
|
//#endregion
|
|
625
695
|
//#region src/components/features/filters/partials/active-filter-item.tsx
|
|
626
|
-
function
|
|
627
|
-
let { defaultScale: g } = t(), _ = e(void 0, g), { strings: v } = $(), y =
|
|
696
|
+
function st({ filter: n, value: a, active: s, popoverOpen: l, triggerRef: u, operators: d, operator: f, onOperatorChange: p, onFilterClear: m, onFilterClick: h }) {
|
|
697
|
+
let { defaultScale: g } = t(), _ = e(void 0, g), { strings: v } = $(), y = B.useId(), b = B.useId(), x = `${ae.joinedItem} !border-0 !rounded-none !shadow-none ${c.inset}`, S = () => /* @__PURE__ */ q("div", {
|
|
628
698
|
"aria-hidden": !0,
|
|
629
699
|
className: "w-px self-stretch bg-border"
|
|
630
700
|
});
|
|
631
|
-
return /* @__PURE__ */
|
|
701
|
+
return /* @__PURE__ */ J("div", {
|
|
632
702
|
role: "group",
|
|
633
703
|
"aria-label": n.label,
|
|
634
704
|
"data-active": s || void 0,
|
|
635
705
|
className: r("active-filter-item--component", ae.joinedFrame, oe[_], "bg-background", n.displayConfig?.className),
|
|
636
706
|
children: [
|
|
637
|
-
/* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ J(i, {
|
|
638
708
|
type: "button",
|
|
639
709
|
tone: "secondary",
|
|
640
710
|
buttonStyle: "ghost",
|
|
@@ -644,29 +714,29 @@ function it({ filter: n, value: a, active: s, popoverOpen: l, triggerRef: u, ope
|
|
|
644
714
|
"aria-expanded": l,
|
|
645
715
|
onClick: h,
|
|
646
716
|
children: [
|
|
647
|
-
!!n.icon && /* @__PURE__ */
|
|
717
|
+
!!n.icon && /* @__PURE__ */ q("span", {
|
|
648
718
|
className: "flex items-center text-muted-foreground",
|
|
649
719
|
children: n.icon
|
|
650
720
|
}),
|
|
651
|
-
/* @__PURE__ */
|
|
721
|
+
/* @__PURE__ */ q(o, {
|
|
652
722
|
id: y,
|
|
653
723
|
tag: "span",
|
|
654
724
|
type: "inherit",
|
|
655
725
|
weight: "semibold",
|
|
656
726
|
children: n.label
|
|
657
727
|
}),
|
|
658
|
-
/* @__PURE__ */
|
|
728
|
+
/* @__PURE__ */ q(Ce, { className: "size-icon-sm" })
|
|
659
729
|
]
|
|
660
730
|
}),
|
|
661
|
-
/* @__PURE__ */
|
|
662
|
-
/* @__PURE__ */
|
|
731
|
+
/* @__PURE__ */ q(S, {}),
|
|
732
|
+
/* @__PURE__ */ q(et, {
|
|
663
733
|
operator: f,
|
|
664
734
|
operators: d,
|
|
665
735
|
onOperatorChange: p,
|
|
666
736
|
segmentResetClass: x
|
|
667
737
|
}),
|
|
668
|
-
/* @__PURE__ */
|
|
669
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ q(S, {}),
|
|
739
|
+
/* @__PURE__ */ q(i, {
|
|
670
740
|
type: "button",
|
|
671
741
|
tone: "secondary",
|
|
672
742
|
buttonStyle: "ghost",
|
|
@@ -675,16 +745,16 @@ function it({ filter: n, value: a, active: s, popoverOpen: l, triggerRef: u, ope
|
|
|
675
745
|
"aria-expanded": l,
|
|
676
746
|
onClick: h,
|
|
677
747
|
className: r(x, "flex h-full min-h-0 min-w-0 flex-1 items-center justify-start px-control hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
|
|
678
|
-
children: /* @__PURE__ */
|
|
748
|
+
children: /* @__PURE__ */ q("span", {
|
|
679
749
|
id: b,
|
|
680
750
|
className: "min-w-0",
|
|
681
|
-
children: /* @__PURE__ */
|
|
751
|
+
children: /* @__PURE__ */ q(tt, {
|
|
682
752
|
filter: n,
|
|
683
753
|
value: a
|
|
684
754
|
})
|
|
685
755
|
})
|
|
686
756
|
}),
|
|
687
|
-
!!s && /* @__PURE__ */
|
|
757
|
+
!!s && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(S, {}), /* @__PURE__ */ J(i, {
|
|
688
758
|
type: "button",
|
|
689
759
|
tone: "secondary",
|
|
690
760
|
buttonStyle: "ghost",
|
|
@@ -692,10 +762,10 @@ function it({ filter: n, value: a, active: s, popoverOpen: l, triggerRef: u, ope
|
|
|
692
762
|
onClick: (e) => {
|
|
693
763
|
e.stopPropagation(), e.preventDefault(), m();
|
|
694
764
|
},
|
|
695
|
-
children: [/* @__PURE__ */
|
|
765
|
+
children: [/* @__PURE__ */ q(ke, {
|
|
696
766
|
"aria-hidden": "true",
|
|
697
767
|
className: "size-icon"
|
|
698
|
-
}), /* @__PURE__ */
|
|
768
|
+
}), /* @__PURE__ */ q(o, {
|
|
699
769
|
tag: "span",
|
|
700
770
|
className: "sr-only",
|
|
701
771
|
children: v.clear
|
|
@@ -706,18 +776,18 @@ function it({ filter: n, value: a, active: s, popoverOpen: l, triggerRef: u, ope
|
|
|
706
776
|
}
|
|
707
777
|
//#endregion
|
|
708
778
|
//#region src/components/features/filters/hooks/use-async-options.ts
|
|
709
|
-
function
|
|
779
|
+
function ct(e, t, n) {
|
|
710
780
|
for (let [t, r] of e) Date.now() - r.timestamp > n && e.delete(t);
|
|
711
781
|
return e.get(t);
|
|
712
782
|
}
|
|
713
|
-
function
|
|
714
|
-
let { asyncConfig: i } = e, a = i?.fetcher, o = i?.mapToOption, s =
|
|
783
|
+
function lt(e, t, n, r = {}) {
|
|
784
|
+
let { asyncConfig: i } = e, a = i?.fetcher, o = i?.mapToOption, s = U(() => /* @__PURE__ */ new Map(), [
|
|
715
785
|
e.key,
|
|
716
786
|
a,
|
|
717
787
|
o
|
|
718
|
-
]), c =
|
|
788
|
+
]), c = W(r.onError);
|
|
719
789
|
c.current = r.onError;
|
|
720
|
-
let l = i?.debounceMs ?? e.delay ?? 300, u = (fe(t, l) ?? "").trim(), d = i?.limit ?? 10, f = i?.minQueryLength ?? 0, p = i?.preload ?? !0, m = i?.staleTime ?? 6e4, h = i?.gcTime ?? 3e5, g = u.length === 0 && p, _ = u.length >= f, v = !!i?.fetcher && n && (g || u.length > 0 && _), y = n && !g && u.length > 0 && u.length < f, b =
|
|
790
|
+
let l = i?.debounceMs ?? e.delay ?? 300, u = (fe(t, l) ?? "").trim(), d = i?.limit ?? 10, f = i?.minQueryLength ?? 0, p = i?.preload ?? !0, m = i?.staleTime ?? 6e4, h = i?.gcTime ?? 3e5, g = u.length === 0 && p, _ = u.length >= f, v = !!i?.fetcher && n && (g || u.length > 0 && _), y = n && !g && u.length > 0 && u.length < f, b = U(() => i?.queryKey ? JSON.stringify(i.queryKey({
|
|
721
791
|
query: u,
|
|
722
792
|
limit: d
|
|
723
793
|
})) : JSON.stringify([
|
|
@@ -730,7 +800,7 @@ function ot(e, t, n, r = {}) {
|
|
|
730
800
|
e.key,
|
|
731
801
|
u,
|
|
732
802
|
d
|
|
733
|
-
]), x =
|
|
803
|
+
]), x = V(async (e) => a && o ? (await a({
|
|
734
804
|
query: u,
|
|
735
805
|
limit: d,
|
|
736
806
|
signal: e
|
|
@@ -739,8 +809,8 @@ function ot(e, t, n, r = {}) {
|
|
|
739
809
|
o,
|
|
740
810
|
u,
|
|
741
811
|
d
|
|
742
|
-
]), [S, C] =
|
|
743
|
-
let e =
|
|
812
|
+
]), [S, C] = G(() => {
|
|
813
|
+
let e = ct(s, b, h);
|
|
744
814
|
return {
|
|
745
815
|
cache: s,
|
|
746
816
|
data: e?.data ?? [],
|
|
@@ -748,11 +818,11 @@ function ot(e, t, n, r = {}) {
|
|
|
748
818
|
fetching: !1,
|
|
749
819
|
error: !1
|
|
750
820
|
};
|
|
751
|
-
}), [w, T] =
|
|
752
|
-
return
|
|
821
|
+
}), [w, T] = G(0), E = V(() => T((e) => e + 1), []), D = W(0);
|
|
822
|
+
return H(() => {
|
|
753
823
|
let t = D.current !== w;
|
|
754
824
|
if (D.current = w, !v) return;
|
|
755
|
-
let n =
|
|
825
|
+
let n = ct(s, b, h), r = n !== void 0 && Date.now() - n.timestamp < m, i = new AbortController();
|
|
756
826
|
if (r && !t) return C({
|
|
757
827
|
cache: s,
|
|
758
828
|
data: n.data,
|
|
@@ -814,10 +884,10 @@ function ot(e, t, n, r = {}) {
|
|
|
814
884
|
}
|
|
815
885
|
//#endregion
|
|
816
886
|
//#region src/components/features/filters/partials/filter-editor-header.tsx
|
|
817
|
-
function
|
|
887
|
+
function ut({ title: e, description: t, onBack: n }) {
|
|
818
888
|
let { strings: r } = $();
|
|
819
|
-
return /* @__PURE__ */
|
|
820
|
-
start: n ? /* @__PURE__ */
|
|
889
|
+
return /* @__PURE__ */ J(L, {
|
|
890
|
+
start: n ? /* @__PURE__ */ q(i, {
|
|
821
891
|
type: "button",
|
|
822
892
|
tone: "secondary",
|
|
823
893
|
buttonStyle: "ghost",
|
|
@@ -826,31 +896,31 @@ function st({ title: e, description: t, onBack: n }) {
|
|
|
826
896
|
onClick: n,
|
|
827
897
|
className: "shrink-0",
|
|
828
898
|
"aria-label": r.backToFilters,
|
|
829
|
-
children: /* @__PURE__ */
|
|
899
|
+
children: /* @__PURE__ */ q(we, {
|
|
830
900
|
"aria-hidden": "true",
|
|
831
901
|
className: "size-icon-sm rtl:rotate-180"
|
|
832
902
|
})
|
|
833
903
|
}) : void 0,
|
|
834
|
-
children: [/* @__PURE__ */
|
|
904
|
+
children: [/* @__PURE__ */ q(ee, { children: e }), t != null && /* @__PURE__ */ q(R, { children: t })]
|
|
835
905
|
});
|
|
836
906
|
}
|
|
837
907
|
//#endregion
|
|
838
908
|
//#region src/components/features/filters/partials/async-filter-content.tsx
|
|
839
|
-
function
|
|
840
|
-
let { strings: c, cacheAsyncOptions: l, getAsyncOptionLabel: d, reportError: m } = $(), [h, g] =
|
|
909
|
+
function dt({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: a, triggerSource: s = "chip" }) {
|
|
910
|
+
let { strings: c, cacheAsyncOptions: l, getAsyncOptionLabel: d, reportError: m } = $(), [h, g] = G(""), [_, v] = G(t ?? []), y = W(t);
|
|
841
911
|
if (t !== y.current) {
|
|
842
912
|
let e = y.current ?? [], n = t ?? [];
|
|
843
913
|
y.current = t, (n.length !== e.length || n.some((t, n) => t !== e[n])) && v(n);
|
|
844
914
|
}
|
|
845
|
-
let { options: b, isLoading: x, isFetching: S, isError: C, refetch:
|
|
846
|
-
|
|
915
|
+
let { options: b, isLoading: x, isFetching: S, isError: C, refetch: w, isBelowMinQuery: A, minQueryLength: M } = lt(e, h, !0, { onError: m });
|
|
916
|
+
H(() => {
|
|
847
917
|
b.length > 0 && l(e.key, b);
|
|
848
918
|
}, [
|
|
849
919
|
l,
|
|
850
920
|
e.key,
|
|
851
921
|
b
|
|
852
922
|
]);
|
|
853
|
-
let N = e.multiple !== !1, P = e.maxSelected, F = s === "toolbar",
|
|
923
|
+
let N = e.multiple !== !1, P = e.maxSelected, F = s === "toolbar", I = _.length !== t.length || _.some((e) => !t.includes(e)), ee = U(() => {
|
|
854
924
|
let t = new Set(_), n = new Set(b.map((e) => e.value)), r = [];
|
|
855
925
|
for (let t of _) if (!n.has(t)) {
|
|
856
926
|
let n = d(e.key, t);
|
|
@@ -877,21 +947,21 @@ function ct({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
877
947
|
} else v([t]), e.closeOnSelect === !0 && (n([t]), a());
|
|
878
948
|
}, L = () => {
|
|
879
949
|
n(_), a();
|
|
880
|
-
},
|
|
950
|
+
}, R = U(() => x || S ? /* @__PURE__ */ q(f, { label: c.searching }) : C ? /* @__PURE__ */ q(p, {
|
|
881
951
|
variant: "inline",
|
|
882
952
|
title: c.fetchError,
|
|
883
|
-
action: /* @__PURE__ */
|
|
953
|
+
action: /* @__PURE__ */ q(i, {
|
|
884
954
|
tone: "secondary",
|
|
885
955
|
buttonStyle: "outline",
|
|
886
956
|
size: "sm",
|
|
887
957
|
onClick: (e) => {
|
|
888
|
-
e.stopPropagation(),
|
|
958
|
+
e.stopPropagation(), w();
|
|
889
959
|
},
|
|
890
960
|
children: c.retryFetch
|
|
891
961
|
})
|
|
892
|
-
}) :
|
|
962
|
+
}) : A ? /* @__PURE__ */ q("div", {
|
|
893
963
|
className: "text-muted-foreground flex items-center justify-center py-space-xl",
|
|
894
|
-
children: /* @__PURE__ */
|
|
964
|
+
children: /* @__PURE__ */ q(o, {
|
|
895
965
|
tag: "span",
|
|
896
966
|
size: "xs",
|
|
897
967
|
type: "secondary",
|
|
@@ -901,42 +971,42 @@ function ct({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
901
971
|
x,
|
|
902
972
|
S,
|
|
903
973
|
C,
|
|
904
|
-
|
|
974
|
+
A,
|
|
905
975
|
M,
|
|
906
976
|
c,
|
|
907
|
-
|
|
977
|
+
w
|
|
908
978
|
]);
|
|
909
|
-
return /* @__PURE__ */
|
|
910
|
-
/* @__PURE__ */
|
|
979
|
+
return /* @__PURE__ */ J(K, { children: [
|
|
980
|
+
/* @__PURE__ */ q(ut, {
|
|
911
981
|
title: e.label,
|
|
912
982
|
description: c.selectValues,
|
|
913
983
|
onBack: F ? r : void 0
|
|
914
984
|
}),
|
|
915
|
-
/* @__PURE__ */
|
|
985
|
+
/* @__PURE__ */ J(j, {
|
|
916
986
|
shouldFilter: !1,
|
|
917
987
|
inset: "flush",
|
|
918
988
|
className: "rounded-none",
|
|
919
|
-
children: [/* @__PURE__ */
|
|
989
|
+
children: [/* @__PURE__ */ q(E, {
|
|
920
990
|
placeholder: Y(c.searchPlaceholder, { filterLabel: Q(e.label) }),
|
|
921
991
|
value: h,
|
|
922
992
|
onValueChange: g
|
|
923
|
-
}), /* @__PURE__ */
|
|
993
|
+
}), /* @__PURE__ */ q(O, { children: ee.length === 0 ? /* @__PURE__ */ q(D, { children: R }) : /* @__PURE__ */ J(k, { children: [!(!S || x) && /* @__PURE__ */ J(u, {
|
|
924
994
|
direction: "horizontal",
|
|
925
995
|
gap: "sm",
|
|
926
996
|
wrap: !1,
|
|
927
997
|
className: "px-control-sm py-space-xs",
|
|
928
|
-
children: [/* @__PURE__ */
|
|
998
|
+
children: [/* @__PURE__ */ q(De, { className: "text-muted-foreground size-icon-sm animate-spin" }), /* @__PURE__ */ q(o, {
|
|
929
999
|
tag: "span",
|
|
930
1000
|
size: "xs",
|
|
931
1001
|
type: "secondary",
|
|
932
1002
|
children: c.searching
|
|
933
1003
|
})]
|
|
934
|
-
}),
|
|
1004
|
+
}), ee.map((e) => /* @__PURE__ */ J(T, {
|
|
935
1005
|
onSelect: () => te(e.value),
|
|
936
1006
|
"data-checked": _.includes(e.value) || void 0,
|
|
937
1007
|
disabled: e.disabled || !!P && _.length >= P && !_.includes(e.value),
|
|
938
1008
|
className: "flex items-center gap-space-sm",
|
|
939
|
-
children: [e.icon, /* @__PURE__ */
|
|
1009
|
+
children: [e.icon, /* @__PURE__ */ q(o, {
|
|
940
1010
|
tag: "span",
|
|
941
1011
|
type: "inherit",
|
|
942
1012
|
lineHeight: "tight",
|
|
@@ -944,12 +1014,12 @@ function ct({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
944
1014
|
})]
|
|
945
1015
|
}, e.value))] }) })]
|
|
946
1016
|
}),
|
|
947
|
-
|
|
1017
|
+
I && /* @__PURE__ */ q(z, {
|
|
948
1018
|
caption: Y(c.selected, {
|
|
949
1019
|
count: _.length,
|
|
950
1020
|
filterLabel: Q((_.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
951
1021
|
}),
|
|
952
|
-
children: /* @__PURE__ */
|
|
1022
|
+
children: /* @__PURE__ */ q(i, {
|
|
953
1023
|
tone: "primary",
|
|
954
1024
|
size: "sm",
|
|
955
1025
|
onClick: L,
|
|
@@ -960,74 +1030,67 @@ function ct({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
960
1030
|
}
|
|
961
1031
|
//#endregion
|
|
962
1032
|
//#region src/components/features/filters/facets/date-facet.tsx
|
|
963
|
-
var
|
|
964
|
-
function
|
|
965
|
-
let { strings:
|
|
966
|
-
from:
|
|
967
|
-
to:
|
|
968
|
-
} : void 0,
|
|
969
|
-
format:
|
|
970
|
-
readableFormat:
|
|
971
|
-
placeholder:
|
|
1033
|
+
var ft = [];
|
|
1034
|
+
function pt({ filter: e, operator: t, value: n, onValueChange: i, className: a }) {
|
|
1035
|
+
let { strings: o } = $(), s = t === void 0 ? e.operators?.some((e) => e.value === "between") || e.operator === "between" || e.key.toLowerCase().includes("range") || e.key.toLowerCase().includes("between") : t === "between", c = e.dateFormat?.param ?? "yyyy-MM-dd", l = e.dateFormat?.display ?? "PPP", u = s ? e.datePickerConfig?.noRangePlaceholder ?? e.placeholder ?? o.calendar.notDateRangeSelected : e.datePickerConfig?.noDatePlaceholder ?? e.placeholder ?? o.calendar.notDateSelected, d = !!e.datePickerConfig?.showConfirmButton, f = e.datePickerConfig?.autoApply ?? !d, p = e.datePickerConfig?.showShortcuts ?? !0, m = s && (n.start || n.end) ? {
|
|
1036
|
+
from: n.start,
|
|
1037
|
+
to: n.end
|
|
1038
|
+
} : void 0, h = !s && n.start && je(n.start) ? n.start : void 0, g = {
|
|
1039
|
+
format: c,
|
|
1040
|
+
readableFormat: l,
|
|
1041
|
+
placeholder: u,
|
|
972
1042
|
disablePortal: !0,
|
|
973
1043
|
numberOfMonths: 1,
|
|
974
|
-
className: r("date-facet--component", "w-full",
|
|
1044
|
+
className: r("date-facet--component", "w-full", a)
|
|
975
1045
|
};
|
|
976
|
-
return
|
|
1046
|
+
return s ? /* @__PURE__ */ q(I, {
|
|
977
1047
|
mode: "range",
|
|
978
|
-
value:
|
|
1048
|
+
value: m,
|
|
979
1049
|
onValueChange: (e) => {
|
|
980
|
-
|
|
1050
|
+
i({
|
|
981
1051
|
start: e.range?.from ?? void 0,
|
|
982
1052
|
end: e.range?.to ?? void 0
|
|
983
1053
|
});
|
|
984
1054
|
},
|
|
985
|
-
withConfirm:
|
|
986
|
-
closeOnSelect:
|
|
987
|
-
presets:
|
|
988
|
-
...
|
|
989
|
-
}) : /* @__PURE__ */
|
|
1055
|
+
withConfirm: d,
|
|
1056
|
+
closeOnSelect: f,
|
|
1057
|
+
presets: p ? void 0 : ft,
|
|
1058
|
+
...g
|
|
1059
|
+
}) : /* @__PURE__ */ q(I, {
|
|
990
1060
|
mode: "single",
|
|
991
|
-
value:
|
|
1061
|
+
value: h,
|
|
992
1062
|
onValueChange: (e) => {
|
|
993
|
-
|
|
1063
|
+
i({
|
|
994
1064
|
start: e.date ?? void 0,
|
|
995
1065
|
end: void 0
|
|
996
1066
|
});
|
|
997
1067
|
},
|
|
998
|
-
closeOnSelect:
|
|
999
|
-
...
|
|
1068
|
+
closeOnSelect: f,
|
|
1069
|
+
...g
|
|
1000
1070
|
});
|
|
1001
1071
|
}
|
|
1002
1072
|
//#endregion
|
|
1003
1073
|
//#region src/components/features/filters/partials/date-filter-content.tsx
|
|
1004
|
-
function
|
|
1005
|
-
let
|
|
1006
|
-
if (
|
|
1007
|
-
if (e.dateFormat?.param) {
|
|
1008
|
-
let n = je(t, e.dateFormat.param, /* @__PURE__ */ new Date());
|
|
1009
|
-
return J(n) ? n : void 0;
|
|
1010
|
-
}
|
|
1011
|
-
let n = new Date(t);
|
|
1012
|
-
return J(n) ? n : void 0;
|
|
1013
|
-
}, o = a(t[0]), s = a(t[1]), c = (t) => {
|
|
1014
|
-
if (t && J(t)) return Ae(t, e.dateFormat?.param ?? "yyyy-MM-dd");
|
|
1074
|
+
function mt({ filter: e, operator: t, value: n, onFilterChange: r, onBackToFilterList: i, triggerSource: a = "chip" }) {
|
|
1075
|
+
let o = Ge(n[0], e.dateFormat?.param), s = Ge(n[1], e.dateFormat?.param), c = (t) => {
|
|
1076
|
+
if (t && je(t)) return Ae(t, e.dateFormat?.param ?? "yyyy-MM-dd");
|
|
1015
1077
|
}, l = ({ start: e, end: t }) => {
|
|
1016
|
-
let
|
|
1017
|
-
i &&
|
|
1018
|
-
}, u =
|
|
1078
|
+
let n = [], i = c(e), a = c(t);
|
|
1079
|
+
i && n.push(i), a && n.push(a), r(n);
|
|
1080
|
+
}, u = a === "toolbar", d = {
|
|
1019
1081
|
start: o,
|
|
1020
1082
|
end: s
|
|
1021
1083
|
};
|
|
1022
|
-
return /* @__PURE__ */
|
|
1084
|
+
return /* @__PURE__ */ J("div", {
|
|
1023
1085
|
className: "flex flex-col",
|
|
1024
|
-
children: [/* @__PURE__ */
|
|
1086
|
+
children: [/* @__PURE__ */ q(ut, {
|
|
1025
1087
|
title: e.label,
|
|
1026
|
-
onBack: u ?
|
|
1027
|
-
}), /* @__PURE__ */
|
|
1088
|
+
onBack: u ? i : void 0
|
|
1089
|
+
}), /* @__PURE__ */ q("div", {
|
|
1028
1090
|
className: h.menuRegion,
|
|
1029
|
-
children: /* @__PURE__ */
|
|
1091
|
+
children: /* @__PURE__ */ q(pt, {
|
|
1030
1092
|
filter: e,
|
|
1093
|
+
operator: t,
|
|
1031
1094
|
value: d,
|
|
1032
1095
|
onValueChange: l
|
|
1033
1096
|
})
|
|
@@ -1036,7 +1099,7 @@ function dt({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, tri
|
|
|
1036
1099
|
}
|
|
1037
1100
|
//#endregion
|
|
1038
1101
|
//#region src/components/features/filters/partials/filter-error-boundary.tsx
|
|
1039
|
-
var
|
|
1102
|
+
var ht = class extends _e {
|
|
1040
1103
|
state = {
|
|
1041
1104
|
hasError: !1,
|
|
1042
1105
|
error: null
|
|
@@ -1062,19 +1125,19 @@ var ft = class extends _e {
|
|
|
1062
1125
|
render() {
|
|
1063
1126
|
if (this.state.hasError) {
|
|
1064
1127
|
let { fallback: e, filterKey: t, labels: n } = this.props;
|
|
1065
|
-
return e ? /* @__PURE__ */
|
|
1128
|
+
return e ? /* @__PURE__ */ q("div", {
|
|
1066
1129
|
className: "filter-error-boundary--component contents",
|
|
1067
1130
|
children: e
|
|
1068
|
-
}) : /* @__PURE__ */
|
|
1131
|
+
}) : /* @__PURE__ */ J("div", {
|
|
1069
1132
|
className: r("filter-error-boundary--component rounded-radius border p-surface-xs", d.destructive.edge, d.destructive.wash, d.destructive.ink),
|
|
1070
1133
|
children: [
|
|
1071
|
-
/* @__PURE__ */
|
|
1134
|
+
/* @__PURE__ */ J("div", {
|
|
1072
1135
|
className: "mb-space-xs flex items-center justify-between",
|
|
1073
|
-
children: [/* @__PURE__ */
|
|
1136
|
+
children: [/* @__PURE__ */ q(o, {
|
|
1074
1137
|
tag: "span",
|
|
1075
1138
|
weight: "semibold",
|
|
1076
1139
|
children: n.title
|
|
1077
|
-
}), /* @__PURE__ */
|
|
1140
|
+
}), /* @__PURE__ */ q(i, {
|
|
1078
1141
|
type: "button",
|
|
1079
1142
|
tone: "destructive",
|
|
1080
1143
|
buttonStyle: "ghost",
|
|
@@ -1082,11 +1145,11 @@ var ft = class extends _e {
|
|
|
1082
1145
|
iconOnly: !0,
|
|
1083
1146
|
onClick: this.handleReset,
|
|
1084
1147
|
"aria-label": n.reset,
|
|
1085
|
-
children: /* @__PURE__ */
|
|
1148
|
+
children: /* @__PURE__ */ q(ke, { className: "size-icon-sm" })
|
|
1086
1149
|
})]
|
|
1087
1150
|
}),
|
|
1088
|
-
/* @__PURE__ */
|
|
1089
|
-
/* @__PURE__ */
|
|
1151
|
+
/* @__PURE__ */ q(o, { children: n.getDescription(t) }),
|
|
1152
|
+
/* @__PURE__ */ q(_, {
|
|
1090
1153
|
size: "xs",
|
|
1091
1154
|
className: "mt-space-xs text-destructive",
|
|
1092
1155
|
children: this.state.error?.message || n.unknownError
|
|
@@ -1094,20 +1157,20 @@ var ft = class extends _e {
|
|
|
1094
1157
|
]
|
|
1095
1158
|
});
|
|
1096
1159
|
}
|
|
1097
|
-
return /* @__PURE__ */
|
|
1160
|
+
return /* @__PURE__ */ q("div", {
|
|
1098
1161
|
className: "filter-error-boundary--component contents",
|
|
1099
1162
|
children: this.props.children
|
|
1100
1163
|
});
|
|
1101
1164
|
}
|
|
1102
1165
|
};
|
|
1103
|
-
function
|
|
1104
|
-
let { strings: t, reportError: n } = $(), r =
|
|
1166
|
+
function gt(e) {
|
|
1167
|
+
let { strings: t, reportError: n } = $(), r = U(() => ({
|
|
1105
1168
|
title: t.error.title,
|
|
1106
1169
|
reset: t.clear,
|
|
1107
1170
|
getDescription: (e) => e ? Y(t.error.descriptionWithKey, { filterKey: e }) : t.error.generic,
|
|
1108
1171
|
unknownError: t.error.unknown
|
|
1109
1172
|
}), [t]);
|
|
1110
|
-
return /* @__PURE__ */
|
|
1173
|
+
return /* @__PURE__ */ q(ht, {
|
|
1111
1174
|
...e,
|
|
1112
1175
|
labels: r,
|
|
1113
1176
|
onError: n
|
|
@@ -1115,23 +1178,23 @@ function pt(e) {
|
|
|
1115
1178
|
}
|
|
1116
1179
|
//#endregion
|
|
1117
1180
|
//#region src/components/features/filters/partials/filter-list-item.tsx
|
|
1118
|
-
function
|
|
1181
|
+
function _t({ filter: e, onSelect: t }) {
|
|
1119
1182
|
let { strings: n } = $(), r = e.type === X.DATE ? e.operator === "between" ? n?.selectDateRange : n?.selectDate : e.options ? `${e.options.length} ${n?.options ?? ""}`.trim() : null;
|
|
1120
|
-
return /* @__PURE__ */
|
|
1183
|
+
return /* @__PURE__ */ J(T, {
|
|
1121
1184
|
onSelect: t,
|
|
1122
|
-
children: [!!e.icon && /* @__PURE__ */
|
|
1185
|
+
children: [!!e.icon && /* @__PURE__ */ q("span", {
|
|
1123
1186
|
className: "shrink-0 text-muted-foreground [&_svg]:size-icon",
|
|
1124
1187
|
children: e.icon
|
|
1125
|
-
}), /* @__PURE__ */
|
|
1188
|
+
}), /* @__PURE__ */ J("div", {
|
|
1126
1189
|
className: "flex min-w-0 flex-col gap-dense leading-tight",
|
|
1127
|
-
children: [/* @__PURE__ */
|
|
1190
|
+
children: [/* @__PURE__ */ q(o, {
|
|
1128
1191
|
tag: "span",
|
|
1129
1192
|
type: "inherit",
|
|
1130
1193
|
lineHeight: "tight",
|
|
1131
1194
|
weight: "medium",
|
|
1132
1195
|
className: "truncate",
|
|
1133
1196
|
children: e.label
|
|
1134
|
-
}), !!r && /* @__PURE__ */
|
|
1197
|
+
}), !!r && /* @__PURE__ */ q(o, {
|
|
1135
1198
|
tag: "span",
|
|
1136
1199
|
lineHeight: "tight",
|
|
1137
1200
|
size: "xs",
|
|
@@ -1144,25 +1207,25 @@ function mt({ filter: e, onSelect: t }) {
|
|
|
1144
1207
|
}
|
|
1145
1208
|
//#endregion
|
|
1146
1209
|
//#region src/components/features/filters/partials/filter-list-content.tsx
|
|
1147
|
-
function
|
|
1210
|
+
function vt({ availableFilters: e, activeFilters: t, onFilterSelect: n }) {
|
|
1148
1211
|
let { strings: r } = $(), i = (e) => {
|
|
1149
1212
|
n(e);
|
|
1150
1213
|
};
|
|
1151
|
-
return /* @__PURE__ */
|
|
1214
|
+
return /* @__PURE__ */ J(j, {
|
|
1152
1215
|
inset: "compact",
|
|
1153
1216
|
className: "rounded-none",
|
|
1154
|
-
children: [/* @__PURE__ */
|
|
1155
|
-
/* @__PURE__ */
|
|
1156
|
-
e.length > 0 && /* @__PURE__ */
|
|
1217
|
+
children: [/* @__PURE__ */ q(E, { placeholder: r.searchFilters }), /* @__PURE__ */ J(O, { children: [
|
|
1218
|
+
/* @__PURE__ */ q(D, { children: r.noFiltersAvailable }),
|
|
1219
|
+
e.length > 0 && /* @__PURE__ */ q(k, {
|
|
1157
1220
|
heading: r.availableFilters,
|
|
1158
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1221
|
+
children: e.map((e) => /* @__PURE__ */ q(_t, {
|
|
1159
1222
|
filter: e,
|
|
1160
1223
|
onSelect: () => i(e)
|
|
1161
1224
|
}, e.key))
|
|
1162
1225
|
}),
|
|
1163
|
-
t.length > 0 && /* @__PURE__ */
|
|
1226
|
+
t.length > 0 && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(A, {}), /* @__PURE__ */ q(k, {
|
|
1164
1227
|
heading: r.activeFilters,
|
|
1165
|
-
children: t.map((e) => /* @__PURE__ */
|
|
1228
|
+
children: t.map((e) => /* @__PURE__ */ q(_t, {
|
|
1166
1229
|
filter: e,
|
|
1167
1230
|
onSelect: () => i(e)
|
|
1168
1231
|
}, e.key))
|
|
@@ -1171,9 +1234,138 @@ function ht({ availableFilters: e, activeFilters: t, onFilterSelect: n }) {
|
|
|
1171
1234
|
});
|
|
1172
1235
|
}
|
|
1173
1236
|
//#endregion
|
|
1237
|
+
//#region src/components/features/filters/facets/range-facet.tsx
|
|
1238
|
+
function yt({ filter: e, value: t, onValueChange: n, className: r }) {
|
|
1239
|
+
let [i, a] = G(t.min?.toString() ?? ""), [o, s] = G(t.max?.toString() ?? ""), c = de((e) => {
|
|
1240
|
+
(e.min !== t.min || e.max !== t.max) && n(e);
|
|
1241
|
+
}, e.delay ?? 300);
|
|
1242
|
+
return H(() => (c({
|
|
1243
|
+
min: i ? Number(i) : void 0,
|
|
1244
|
+
max: o ? Number(o) : void 0
|
|
1245
|
+
}), c.cancel), [
|
|
1246
|
+
i,
|
|
1247
|
+
o,
|
|
1248
|
+
c
|
|
1249
|
+
]), /* @__PURE__ */ q(bt, {
|
|
1250
|
+
min: i,
|
|
1251
|
+
max: o,
|
|
1252
|
+
onMinChange: (e) => {
|
|
1253
|
+
let t = e.target.value;
|
|
1254
|
+
(t === "" || /^\d*\.?\d*$/.test(t)) && a(t);
|
|
1255
|
+
},
|
|
1256
|
+
onMaxChange: (e) => {
|
|
1257
|
+
let t = e.target.value;
|
|
1258
|
+
(t === "" || /^\d*\.?\d*$/.test(t)) && s(t);
|
|
1259
|
+
},
|
|
1260
|
+
className: r
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1263
|
+
function bt({ min: e, max: t, onMinChange: n, onMaxChange: i, className: o, invalid: s }) {
|
|
1264
|
+
let { strings: c } = $(), d = be();
|
|
1265
|
+
return /* @__PURE__ */ q(u, {
|
|
1266
|
+
gap: "md",
|
|
1267
|
+
className: r("range-facet--component", o),
|
|
1268
|
+
children: /* @__PURE__ */ J(l, {
|
|
1269
|
+
columns: {
|
|
1270
|
+
base: 1,
|
|
1271
|
+
sm: 2
|
|
1272
|
+
},
|
|
1273
|
+
gap: "md",
|
|
1274
|
+
children: [/* @__PURE__ */ J(u, {
|
|
1275
|
+
gap: "xs",
|
|
1276
|
+
children: [/* @__PURE__ */ q(a, {
|
|
1277
|
+
htmlFor: `${d}-min`,
|
|
1278
|
+
className: "text-inherit",
|
|
1279
|
+
children: c.min
|
|
1280
|
+
}), /* @__PURE__ */ q(F, {
|
|
1281
|
+
id: `${d}-min`,
|
|
1282
|
+
type: "text",
|
|
1283
|
+
inputMode: "decimal",
|
|
1284
|
+
value: e,
|
|
1285
|
+
onChange: n,
|
|
1286
|
+
"aria-invalid": s || void 0,
|
|
1287
|
+
placeholder: c.min,
|
|
1288
|
+
className: "w-full"
|
|
1289
|
+
})]
|
|
1290
|
+
}), /* @__PURE__ */ J(u, {
|
|
1291
|
+
gap: "xs",
|
|
1292
|
+
children: [/* @__PURE__ */ q(a, {
|
|
1293
|
+
htmlFor: `${d}-max`,
|
|
1294
|
+
className: "text-inherit",
|
|
1295
|
+
children: c.max
|
|
1296
|
+
}), /* @__PURE__ */ q(F, {
|
|
1297
|
+
id: `${d}-max`,
|
|
1298
|
+
type: "text",
|
|
1299
|
+
inputMode: "decimal",
|
|
1300
|
+
value: t,
|
|
1301
|
+
onChange: i,
|
|
1302
|
+
"aria-invalid": s || void 0,
|
|
1303
|
+
placeholder: c.max,
|
|
1304
|
+
className: "w-full"
|
|
1305
|
+
})]
|
|
1306
|
+
})]
|
|
1307
|
+
})
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
//#endregion
|
|
1311
|
+
//#region src/components/features/filters/partials/range-filter-content.tsx
|
|
1312
|
+
function xt(e) {
|
|
1313
|
+
let t = e.trim();
|
|
1314
|
+
if (!t) return "";
|
|
1315
|
+
if (!/^-?(?:\d+\.?\d*|\.\d+)$/.test(t)) return;
|
|
1316
|
+
let n = Number(t);
|
|
1317
|
+
return Number.isFinite(n) ? t : void 0;
|
|
1318
|
+
}
|
|
1319
|
+
function St({ filter: e, operator: t, value: n, onFilterChange: r, onBackToFilterList: a, onClose: o, triggerSource: s }) {
|
|
1320
|
+
let { strings: c, reportError: l } = $(), [u, d] = Ue(n, t), [f, p] = G(u), [m, g] = G(d);
|
|
1321
|
+
H(() => {
|
|
1322
|
+
p(u), g(d);
|
|
1323
|
+
}, [u, d]);
|
|
1324
|
+
let _ = xt(f), v = xt(m), y = _ === void 0 || v === void 0 || !!(_ && v) && Number(_) > Number(v), b = f !== u || m !== d;
|
|
1325
|
+
function x() {
|
|
1326
|
+
if (!(y || _ === void 0 || v === void 0)) try {
|
|
1327
|
+
r(_ || v ? [_, v] : []), o();
|
|
1328
|
+
} catch (t) {
|
|
1329
|
+
l(t, {
|
|
1330
|
+
phase: "apply",
|
|
1331
|
+
filterKey: e.key
|
|
1332
|
+
});
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
return /* @__PURE__ */ J("div", {
|
|
1336
|
+
className: "flex flex-col",
|
|
1337
|
+
children: [
|
|
1338
|
+
/* @__PURE__ */ q(ut, {
|
|
1339
|
+
title: e.label,
|
|
1340
|
+
onBack: s === "toolbar" ? a : void 0
|
|
1341
|
+
}),
|
|
1342
|
+
/* @__PURE__ */ q("div", {
|
|
1343
|
+
className: h.menuRegion,
|
|
1344
|
+
children: /* @__PURE__ */ q(bt, {
|
|
1345
|
+
min: f,
|
|
1346
|
+
max: m,
|
|
1347
|
+
onMinChange: (e) => p(e.target.value),
|
|
1348
|
+
onMaxChange: (e) => g(e.target.value),
|
|
1349
|
+
invalid: y
|
|
1350
|
+
})
|
|
1351
|
+
}),
|
|
1352
|
+
b && /* @__PURE__ */ q(z, {
|
|
1353
|
+
caption: y ? c.validation.invalidFormat : void 0,
|
|
1354
|
+
children: /* @__PURE__ */ q(i, {
|
|
1355
|
+
tone: "primary",
|
|
1356
|
+
size: "sm",
|
|
1357
|
+
onClick: x,
|
|
1358
|
+
disabled: y,
|
|
1359
|
+
children: c.confirm
|
|
1360
|
+
})
|
|
1361
|
+
})
|
|
1362
|
+
]
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
//#endregion
|
|
1174
1366
|
//#region src/components/features/filters/partials/nested-filter-options.tsx
|
|
1175
|
-
function
|
|
1176
|
-
let { strings: a } = $(), o =
|
|
1367
|
+
function Ct({ filter: e, value: t, multiple: n, onChange: r, header: i }) {
|
|
1368
|
+
let { strings: a } = $(), o = U(() => Je(e.options ?? []), [e.options]), s = pe({
|
|
1177
1369
|
items: o,
|
|
1178
1370
|
selected: t,
|
|
1179
1371
|
open: !0,
|
|
@@ -1189,7 +1381,7 @@ function gt({ filter: e, value: t, multiple: n, onChange: r, header: i }) {
|
|
|
1189
1381
|
},
|
|
1190
1382
|
onChange: (e) => r(e == null ? [] : typeof e == "string" ? [e] : [...e])
|
|
1191
1383
|
});
|
|
1192
|
-
return /* @__PURE__ */
|
|
1384
|
+
return /* @__PURE__ */ q(me, {
|
|
1193
1385
|
controller: s,
|
|
1194
1386
|
header: i,
|
|
1195
1387
|
rootInPath: !0,
|
|
@@ -1198,9 +1390,9 @@ function gt({ filter: e, value: t, multiple: n, onChange: r, header: i }) {
|
|
|
1198
1390
|
}
|
|
1199
1391
|
//#endregion
|
|
1200
1392
|
//#region src/components/features/filters/partials/regular-filter-content.tsx
|
|
1201
|
-
function
|
|
1202
|
-
let { strings: c, reportError: l } = $(), d = e.multiple === !0 || e.type === X.MULTI_SELECT, f = s === "toolbar", [p, m] =
|
|
1203
|
-
|
|
1393
|
+
function wt({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: a, triggerSource: s = "chip" }) {
|
|
1394
|
+
let { strings: c, reportError: l } = $(), d = e.multiple === !0 || e.type === X.MULTI_SELECT, f = s === "toolbar", [p, m] = G(t || []);
|
|
1395
|
+
H(() => {
|
|
1204
1396
|
m(t || []);
|
|
1205
1397
|
}, [t]);
|
|
1206
1398
|
let h = (t) => {
|
|
@@ -1219,49 +1411,49 @@ function _t({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
1219
1411
|
filterKey: e.key
|
|
1220
1412
|
});
|
|
1221
1413
|
}
|
|
1222
|
-
}, v = /* @__PURE__ */
|
|
1414
|
+
}, v = /* @__PURE__ */ q(ut, {
|
|
1223
1415
|
title: e.label,
|
|
1224
1416
|
onBack: f ? r : void 0
|
|
1225
1417
|
}), y = JSON.stringify(p.slice().sort()) !== JSON.stringify((t ?? []).slice().sort());
|
|
1226
|
-
return /* @__PURE__ */
|
|
1418
|
+
return /* @__PURE__ */ J("div", {
|
|
1227
1419
|
className: "flex flex-col",
|
|
1228
|
-
children: [
|
|
1420
|
+
children: [qe(e.options) ? /* @__PURE__ */ q(Ct, {
|
|
1229
1421
|
filter: e,
|
|
1230
1422
|
value: p,
|
|
1231
1423
|
multiple: d,
|
|
1232
1424
|
onChange: g,
|
|
1233
1425
|
header: v
|
|
1234
|
-
}) : /* @__PURE__ */
|
|
1426
|
+
}) : /* @__PURE__ */ J(K, { children: [v, /* @__PURE__ */ J(j, {
|
|
1235
1427
|
inset: "flush",
|
|
1236
1428
|
className: "rounded-none",
|
|
1237
|
-
children: [/* @__PURE__ */
|
|
1429
|
+
children: [/* @__PURE__ */ q(E, { placeholder: Y(c.searchPlaceholder, { filterLabel: Q(e.label) }) }), /* @__PURE__ */ J(O, {
|
|
1238
1430
|
className: "max-h-64",
|
|
1239
|
-
children: [/* @__PURE__ */
|
|
1431
|
+
children: [/* @__PURE__ */ q(D, { children: /* @__PURE__ */ q(o, {
|
|
1240
1432
|
type: "secondary",
|
|
1241
1433
|
align: "center",
|
|
1242
1434
|
className: "py-space-xl",
|
|
1243
1435
|
children: c.noOptionsFound
|
|
1244
|
-
}) }), /* @__PURE__ */
|
|
1436
|
+
}) }), /* @__PURE__ */ q(k, { children: e.options?.map((e) => {
|
|
1245
1437
|
let t = p.includes(e.value);
|
|
1246
|
-
return /* @__PURE__ */
|
|
1438
|
+
return /* @__PURE__ */ J(T, {
|
|
1247
1439
|
onSelect: () => h(e.value),
|
|
1248
1440
|
"data-checked": t || void 0,
|
|
1249
1441
|
disabled: e.disabled,
|
|
1250
1442
|
className: "data-[checked=true]:**:[svg]:text-primary-accent",
|
|
1251
|
-
children: [!!e.icon && /* @__PURE__ */
|
|
1443
|
+
children: [!!e.icon && /* @__PURE__ */ q("span", {
|
|
1252
1444
|
className: "shrink-0 text-muted-foreground [&_svg]:size-icon",
|
|
1253
1445
|
children: e.icon
|
|
1254
|
-
}), /* @__PURE__ */
|
|
1446
|
+
}), /* @__PURE__ */ J(u, {
|
|
1255
1447
|
gap: "dense",
|
|
1256
1448
|
className: "flex min-w-0 flex-1 flex-col leading-tight",
|
|
1257
|
-
children: [/* @__PURE__ */
|
|
1449
|
+
children: [/* @__PURE__ */ q(o, {
|
|
1258
1450
|
tag: "span",
|
|
1259
1451
|
type: "inherit",
|
|
1260
1452
|
lineHeight: "tight",
|
|
1261
1453
|
weight: t ? "medium" : "regular",
|
|
1262
1454
|
className: "truncate",
|
|
1263
1455
|
children: e.label
|
|
1264
|
-
}), !!e.description && /* @__PURE__ */
|
|
1456
|
+
}), !!e.description && /* @__PURE__ */ q(o, {
|
|
1265
1457
|
tag: "span",
|
|
1266
1458
|
size: "xs",
|
|
1267
1459
|
lineHeight: "tight",
|
|
@@ -1273,12 +1465,12 @@ function _t({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
1273
1465
|
}, e.value);
|
|
1274
1466
|
}) })]
|
|
1275
1467
|
})]
|
|
1276
|
-
})] }), !!y && /* @__PURE__ */
|
|
1468
|
+
})] }), !!y && /* @__PURE__ */ q(z, {
|
|
1277
1469
|
caption: Y(c.selected, {
|
|
1278
1470
|
count: p.length,
|
|
1279
1471
|
filterLabel: Q((p.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
1280
1472
|
}),
|
|
1281
|
-
children: /* @__PURE__ */
|
|
1473
|
+
children: /* @__PURE__ */ q(i, {
|
|
1282
1474
|
tone: "primary",
|
|
1283
1475
|
size: "sm",
|
|
1284
1476
|
onClick: _,
|
|
@@ -1289,29 +1481,29 @@ function _t({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
1289
1481
|
}
|
|
1290
1482
|
//#endregion
|
|
1291
1483
|
//#region src/components/features/filters/facets/tags-facet.tsx
|
|
1292
|
-
function
|
|
1293
|
-
let { defaultScale: c } = t(), l =
|
|
1484
|
+
function Tt({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
1485
|
+
let { defaultScale: c } = t(), l = P(void 0, c), { strings: d } = $(), [f, p] = G(""), m = V(() => {
|
|
1294
1486
|
let e = f.trim();
|
|
1295
1487
|
e && !n.includes(e) && (a([...n, e]), p(""));
|
|
1296
1488
|
}, [
|
|
1297
1489
|
f,
|
|
1298
1490
|
n,
|
|
1299
1491
|
a
|
|
1300
|
-
]), h =
|
|
1492
|
+
]), h = V((e) => {
|
|
1301
1493
|
a(n.filter((t) => t !== e));
|
|
1302
1494
|
}, [n, a]), g = (e) => {
|
|
1303
1495
|
e.key === "Enter" && (e.preventDefault(), m());
|
|
1304
|
-
}, _ =
|
|
1496
|
+
}, _ = V(() => {
|
|
1305
1497
|
a([]), p("");
|
|
1306
|
-
}, [a]), v = n.length > 0, y = n.length === 1 ? d.tag : d.tags, b = v ? /* @__PURE__ */
|
|
1498
|
+
}, [a]), v = n.length > 0, y = n.length === 1 ? d.tag : d.tags, b = v ? /* @__PURE__ */ J(u, {
|
|
1307
1499
|
gap: "md",
|
|
1308
1500
|
className: "tags-facet--summary",
|
|
1309
|
-
children: [/* @__PURE__ */
|
|
1501
|
+
children: [/* @__PURE__ */ J(u, {
|
|
1310
1502
|
direction: "horizontal",
|
|
1311
1503
|
gap: "sm",
|
|
1312
1504
|
justify: "between",
|
|
1313
1505
|
wrap: !1,
|
|
1314
|
-
children: [/* @__PURE__ */
|
|
1506
|
+
children: [/* @__PURE__ */ J(o, {
|
|
1315
1507
|
tag: "span",
|
|
1316
1508
|
size: "xs",
|
|
1317
1509
|
type: "secondary",
|
|
@@ -1320,7 +1512,7 @@ function vt({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
|
1320
1512
|
" ",
|
|
1321
1513
|
y
|
|
1322
1514
|
]
|
|
1323
|
-
}), /* @__PURE__ */
|
|
1515
|
+
}), /* @__PURE__ */ q(i, {
|
|
1324
1516
|
onClick: _,
|
|
1325
1517
|
tone: "secondary",
|
|
1326
1518
|
buttonStyle: "ghost",
|
|
@@ -1330,54 +1522,54 @@ function vt({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
|
1330
1522
|
"aria-label": d.clearAll,
|
|
1331
1523
|
children: d.clearAll
|
|
1332
1524
|
})]
|
|
1333
|
-
}), /* @__PURE__ */
|
|
1525
|
+
}), /* @__PURE__ */ q(u, {
|
|
1334
1526
|
direction: "horizontal",
|
|
1335
1527
|
gap: "md",
|
|
1336
|
-
children: n.map((e) => /* @__PURE__ */
|
|
1528
|
+
children: n.map((e) => /* @__PURE__ */ J(S, {
|
|
1337
1529
|
tone: "secondary",
|
|
1338
1530
|
className: "flex items-center gap-space-sm py-space-2xs pl-space-md pr-space-sm",
|
|
1339
|
-
children: [/* @__PURE__ */
|
|
1531
|
+
children: [/* @__PURE__ */ q(o, {
|
|
1340
1532
|
tag: "span",
|
|
1341
1533
|
size: "xs",
|
|
1342
1534
|
children: e
|
|
1343
|
-
}), /* @__PURE__ */
|
|
1535
|
+
}), /* @__PURE__ */ q("button", {
|
|
1344
1536
|
onClick: () => h(e),
|
|
1345
|
-
className: r(
|
|
1537
|
+
className: r(w.target, w.focus, w.toggle),
|
|
1346
1538
|
type: "button",
|
|
1347
1539
|
"aria-label": `${d.removeTag} ${e}`,
|
|
1348
|
-
children: /* @__PURE__ */
|
|
1349
|
-
className:
|
|
1540
|
+
children: /* @__PURE__ */ q(ke, {
|
|
1541
|
+
className: w.icon,
|
|
1350
1542
|
"aria-hidden": "true"
|
|
1351
1543
|
})
|
|
1352
1544
|
})]
|
|
1353
1545
|
}, e))
|
|
1354
1546
|
})]
|
|
1355
1547
|
}) : null;
|
|
1356
|
-
return /* @__PURE__ */
|
|
1548
|
+
return /* @__PURE__ */ J(u, {
|
|
1357
1549
|
gap: "lg",
|
|
1358
1550
|
className: r("tags-facet--component", s),
|
|
1359
|
-
children: [/* @__PURE__ */
|
|
1551
|
+
children: [/* @__PURE__ */ J(u, {
|
|
1360
1552
|
direction: "horizontal",
|
|
1361
1553
|
gap: "md",
|
|
1362
1554
|
wrap: !1,
|
|
1363
|
-
children: [/* @__PURE__ */
|
|
1555
|
+
children: [/* @__PURE__ */ q("div", {
|
|
1364
1556
|
className: "relative flex-1",
|
|
1365
|
-
children: /* @__PURE__ */
|
|
1557
|
+
children: /* @__PURE__ */ q(F, {
|
|
1366
1558
|
type: "text",
|
|
1367
1559
|
value: f,
|
|
1368
1560
|
onChange: (e) => p(e.target.value),
|
|
1369
1561
|
onKeyDown: g,
|
|
1370
1562
|
placeholder: e.placeholder ?? d.enterTag
|
|
1371
1563
|
})
|
|
1372
|
-
}), /* @__PURE__ */
|
|
1564
|
+
}), /* @__PURE__ */ J(i, {
|
|
1373
1565
|
tone: "primary",
|
|
1374
1566
|
onClick: m,
|
|
1375
1567
|
disabled: !f.trim(),
|
|
1376
1568
|
size: l,
|
|
1377
1569
|
iconOnly: !0,
|
|
1378
|
-
className: r(
|
|
1570
|
+
className: r(M[l], ie[l]),
|
|
1379
1571
|
type: "button",
|
|
1380
|
-
children: [/* @__PURE__ */
|
|
1572
|
+
children: [/* @__PURE__ */ q(Oe, { className: "size-icon" }), /* @__PURE__ */ q(o, {
|
|
1381
1573
|
tag: "span",
|
|
1382
1574
|
size: "pxs",
|
|
1383
1575
|
className: "sr-only",
|
|
@@ -1387,13 +1579,13 @@ function vt({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
|
1387
1579
|
}), b]
|
|
1388
1580
|
});
|
|
1389
1581
|
}
|
|
1390
|
-
var
|
|
1391
|
-
|
|
1582
|
+
var Et = B.memo(Tt);
|
|
1583
|
+
Et.displayName = "TagsFacet";
|
|
1392
1584
|
//#endregion
|
|
1393
1585
|
//#region src/components/features/filters/partials/tags-filter-content.tsx
|
|
1394
|
-
function
|
|
1395
|
-
let { strings: s, reportError: c } = $(), [l, u] =
|
|
1396
|
-
|
|
1586
|
+
function Dt({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: a, triggerSource: o = "chip" }) {
|
|
1587
|
+
let { strings: s, reportError: c } = $(), [l, u] = G(t || []), d = o === "toolbar";
|
|
1588
|
+
H(() => {
|
|
1397
1589
|
u(t || []);
|
|
1398
1590
|
}, [t]);
|
|
1399
1591
|
let f = () => {
|
|
@@ -1406,22 +1598,22 @@ function bt({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
1406
1598
|
});
|
|
1407
1599
|
}
|
|
1408
1600
|
}, p = JSON.stringify(l.slice().sort()) !== JSON.stringify((t ?? []).slice().sort());
|
|
1409
|
-
return /* @__PURE__ */
|
|
1601
|
+
return /* @__PURE__ */ J("div", {
|
|
1410
1602
|
className: "flex flex-col",
|
|
1411
1603
|
children: [
|
|
1412
|
-
/* @__PURE__ */
|
|
1604
|
+
/* @__PURE__ */ q(ut, {
|
|
1413
1605
|
title: e.label,
|
|
1414
1606
|
onBack: d ? r : void 0
|
|
1415
1607
|
}),
|
|
1416
|
-
/* @__PURE__ */
|
|
1608
|
+
/* @__PURE__ */ q("div", {
|
|
1417
1609
|
className: h.menuRegion,
|
|
1418
|
-
children: /* @__PURE__ */
|
|
1610
|
+
children: /* @__PURE__ */ q(Et, {
|
|
1419
1611
|
filter: e,
|
|
1420
1612
|
value: l,
|
|
1421
1613
|
onValueChange: u
|
|
1422
1614
|
})
|
|
1423
1615
|
}),
|
|
1424
|
-
!!p && /* @__PURE__ */
|
|
1616
|
+
!!p && /* @__PURE__ */ q(z, { children: /* @__PURE__ */ q(i, {
|
|
1425
1617
|
tone: "primary",
|
|
1426
1618
|
size: "sm",
|
|
1427
1619
|
onClick: f,
|
|
@@ -1432,92 +1624,101 @@ function bt({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
1432
1624
|
}
|
|
1433
1625
|
//#endregion
|
|
1434
1626
|
//#region src/components/features/filters/partials/filter-popover-content.tsx
|
|
1435
|
-
var
|
|
1436
|
-
function
|
|
1627
|
+
var Ot = "input:not([type=hidden]):not(:disabled), textarea:not(:disabled), button:not(:disabled), [tabindex]:not([tabindex=\"-1\"])";
|
|
1628
|
+
function kt(e) {
|
|
1437
1629
|
if (!e) return;
|
|
1438
|
-
let t = [...e.querySelectorAll(
|
|
1630
|
+
let t = [...e.querySelectorAll(Ot)].filter((e) => !e.closest(".popover-header--component"));
|
|
1439
1631
|
(t.find((e) => e.matches("input, textarea")) ?? t[0])?.focus({ preventScroll: !0 });
|
|
1440
1632
|
}
|
|
1441
|
-
function
|
|
1442
|
-
let { strings:
|
|
1443
|
-
|
|
1444
|
-
if (
|
|
1445
|
-
|
|
1446
|
-
let e =
|
|
1633
|
+
function At({ activeFilterInPopover: e, operator: t, availableFilters: n, activeFilters: i, getFilterValue: a, setFilterValue: o, onFilterSelect: s, onBackToFilterList: c, onClose: l, triggerSource: u = "chip", finalFocus: d }) {
|
|
1634
|
+
let { strings: f, getFilterOperator: p } = $(), h = W(null), g = e?.key ?? null, _ = W(g);
|
|
1635
|
+
H(() => {
|
|
1636
|
+
if (_.current === g) return;
|
|
1637
|
+
_.current = g;
|
|
1638
|
+
let e = h.current;
|
|
1447
1639
|
if (!e?.hasAttribute("data-open")) return;
|
|
1448
|
-
|
|
1640
|
+
kt(e);
|
|
1449
1641
|
let t = e.ownerDocument.defaultView, n = t?.requestAnimationFrame(() => {
|
|
1450
|
-
e.ownerDocument.activeElement === e &&
|
|
1642
|
+
e.ownerDocument.activeElement === e && kt(e);
|
|
1451
1643
|
});
|
|
1452
1644
|
return () => {
|
|
1453
1645
|
n != null && t?.cancelAnimationFrame(n);
|
|
1454
1646
|
};
|
|
1455
|
-
}, [
|
|
1456
|
-
let
|
|
1457
|
-
|
|
1647
|
+
}, [g]);
|
|
1648
|
+
let v = e?.type === X.DATE || e?.type === X.TAGS ? "w-auto min-w-80 gap-0 overflow-hidden" : (e?.type, X.ASYNC_SELECT, r(m.md, "gap-0 overflow-hidden")), y = (e, t) => {
|
|
1649
|
+
o(e, t);
|
|
1458
1650
|
};
|
|
1459
|
-
return /* @__PURE__ */
|
|
1460
|
-
ref:
|
|
1461
|
-
finalFocus:
|
|
1651
|
+
return /* @__PURE__ */ q(re, {
|
|
1652
|
+
ref: h,
|
|
1653
|
+
finalFocus: d,
|
|
1462
1654
|
type: "menu",
|
|
1463
|
-
"aria-label": e?.label ??
|
|
1655
|
+
"aria-label": e?.label ?? f.addFilter,
|
|
1464
1656
|
inset: "flush",
|
|
1465
|
-
className: r("filter-popover-content--component",
|
|
1657
|
+
className: r("filter-popover-content--component", v),
|
|
1466
1658
|
align: "start",
|
|
1467
|
-
children: e ? e.type === X.DATE ? /* @__PURE__ */
|
|
1659
|
+
children: e ? e.type === X.DATE ? /* @__PURE__ */ q(mt, {
|
|
1660
|
+
filter: e,
|
|
1661
|
+
operator: t ?? p(e.key),
|
|
1662
|
+
value: a(e.key),
|
|
1663
|
+
onFilterChange: (t) => y(e.key, t),
|
|
1664
|
+
onBackToFilterList: c,
|
|
1665
|
+
triggerSource: u
|
|
1666
|
+
}) : e.type === X.RANGE ? /* @__PURE__ */ q(St, {
|
|
1468
1667
|
filter: e,
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1668
|
+
operator: t ?? p(e.key) ?? "between",
|
|
1669
|
+
value: a(e.key),
|
|
1670
|
+
onFilterChange: (t) => y(e.key, t),
|
|
1671
|
+
onBackToFilterList: c,
|
|
1672
|
+
onClose: l,
|
|
1673
|
+
triggerSource: u
|
|
1674
|
+
}) : e.type === X.TAGS ? /* @__PURE__ */ q(Dt, {
|
|
1474
1675
|
filter: e,
|
|
1475
|
-
value:
|
|
1476
|
-
onFilterChange: (t) =>
|
|
1477
|
-
onBackToFilterList:
|
|
1478
|
-
onClose:
|
|
1479
|
-
triggerSource:
|
|
1480
|
-
}) : e.type === X.ASYNC_SELECT ? /* @__PURE__ */
|
|
1676
|
+
value: a(e.key),
|
|
1677
|
+
onFilterChange: (t) => y(e.key, t),
|
|
1678
|
+
onBackToFilterList: c,
|
|
1679
|
+
onClose: l,
|
|
1680
|
+
triggerSource: u
|
|
1681
|
+
}) : e.type === X.ASYNC_SELECT ? /* @__PURE__ */ q(dt, {
|
|
1481
1682
|
filter: e,
|
|
1482
|
-
value:
|
|
1483
|
-
onFilterChange: (t) =>
|
|
1484
|
-
onBackToFilterList:
|
|
1485
|
-
onClose:
|
|
1486
|
-
triggerSource:
|
|
1487
|
-
}) : /* @__PURE__ */
|
|
1683
|
+
value: a(e.key),
|
|
1684
|
+
onFilterChange: (t) => y(e.key, t),
|
|
1685
|
+
onBackToFilterList: c,
|
|
1686
|
+
onClose: l,
|
|
1687
|
+
triggerSource: u
|
|
1688
|
+
}) : /* @__PURE__ */ q(wt, {
|
|
1488
1689
|
filter: e,
|
|
1489
|
-
value:
|
|
1490
|
-
onFilterChange: (t) =>
|
|
1491
|
-
onBackToFilterList:
|
|
1492
|
-
onClose:
|
|
1493
|
-
triggerSource:
|
|
1494
|
-
}) : /* @__PURE__ */
|
|
1495
|
-
availableFilters:
|
|
1496
|
-
activeFilters:
|
|
1497
|
-
onFilterSelect:
|
|
1690
|
+
value: a(e.key),
|
|
1691
|
+
onFilterChange: (t) => y(e.key, t),
|
|
1692
|
+
onBackToFilterList: c,
|
|
1693
|
+
onClose: l,
|
|
1694
|
+
triggerSource: u
|
|
1695
|
+
}) : /* @__PURE__ */ q(vt, {
|
|
1696
|
+
availableFilters: n,
|
|
1697
|
+
activeFilters: i,
|
|
1698
|
+
onFilterSelect: s
|
|
1498
1699
|
})
|
|
1499
1700
|
});
|
|
1500
1701
|
}
|
|
1501
1702
|
//#endregion
|
|
1502
1703
|
//#region src/components/features/filters/partials/filter-pill.tsx
|
|
1503
|
-
function
|
|
1504
|
-
let d =
|
|
1505
|
-
return /* @__PURE__ */
|
|
1704
|
+
function jt({ filter: e, value: t, active: n, operator: r, operators: i, onOperatorChange: a, onValueChange: o, onClear: s, availableFilters: c, activeFilters: l, operatorChangeRef: u }) {
|
|
1705
|
+
let d = W(!1), f = u ?? d, [p, m] = G(!1), h = W(null), g = W(null);
|
|
1706
|
+
return /* @__PURE__ */ q(gt, {
|
|
1506
1707
|
filterKey: e.key,
|
|
1507
|
-
children: /* @__PURE__ */
|
|
1708
|
+
children: /* @__PURE__ */ J(ne, {
|
|
1508
1709
|
open: p,
|
|
1509
1710
|
onOpenChange: (e) => {
|
|
1510
1711
|
e && f.current || m(e);
|
|
1511
1712
|
},
|
|
1512
|
-
children: [/* @__PURE__ */
|
|
1713
|
+
children: [/* @__PURE__ */ J("div", {
|
|
1513
1714
|
className: "filter-pill--component filter-pill--anchor relative",
|
|
1514
|
-
children: [/* @__PURE__ */
|
|
1515
|
-
render: /* @__PURE__ */
|
|
1715
|
+
children: [/* @__PURE__ */ q(te, {
|
|
1716
|
+
render: /* @__PURE__ */ q("span", {}),
|
|
1516
1717
|
nativeButton: !1,
|
|
1517
1718
|
tabIndex: -1,
|
|
1518
1719
|
"aria-hidden": "true",
|
|
1519
1720
|
className: "pointer-events-none absolute inset-0"
|
|
1520
|
-
}), /* @__PURE__ */
|
|
1721
|
+
}), /* @__PURE__ */ q(st, {
|
|
1521
1722
|
filter: e,
|
|
1522
1723
|
popoverOpen: p,
|
|
1523
1724
|
triggerRef: h,
|
|
@@ -1537,9 +1738,10 @@ function wt({ filter: e, value: t, active: n, operator: r, operators: i, onOpera
|
|
|
1537
1738
|
f.current || (g.current = e?.currentTarget ?? h.current, m(!0));
|
|
1538
1739
|
}
|
|
1539
1740
|
})]
|
|
1540
|
-
}), /* @__PURE__ */
|
|
1741
|
+
}), /* @__PURE__ */ q(At, {
|
|
1541
1742
|
finalFocus: g,
|
|
1542
1743
|
activeFilterInPopover: e,
|
|
1744
|
+
operator: r,
|
|
1543
1745
|
availableFilters: c,
|
|
1544
1746
|
activeFilters: l,
|
|
1545
1747
|
getFilterValue: () => t,
|
|
@@ -1552,29 +1754,29 @@ function wt({ filter: e, value: t, active: n, operator: r, operators: i, onOpera
|
|
|
1552
1754
|
})
|
|
1553
1755
|
});
|
|
1554
1756
|
}
|
|
1555
|
-
|
|
1757
|
+
jt.displayName = "FilterPill";
|
|
1556
1758
|
//#endregion
|
|
1557
1759
|
//#region src/components/features/filters/partials/filters-button.tsx
|
|
1558
|
-
function
|
|
1559
|
-
let { defaultScale: u } = t(), d =
|
|
1560
|
-
return
|
|
1760
|
+
function Mt({ triggerRef: e, availableFilters: n, activeFilters: a, activeFilterInPopover: o, getFilterValue: s, setFilterValue: c, setActiveFilterInPopover: l }) {
|
|
1761
|
+
let { defaultScale: u } = t(), d = P(void 0, u), [f, p] = G(!1), { strings: m } = $();
|
|
1762
|
+
return H(() => {
|
|
1561
1763
|
f || l(null);
|
|
1562
|
-
}, [f, l]), /* @__PURE__ */
|
|
1764
|
+
}, [f, l]), /* @__PURE__ */ J(ne, {
|
|
1563
1765
|
open: f,
|
|
1564
1766
|
onOpenChange: p,
|
|
1565
|
-
children: [/* @__PURE__ */
|
|
1767
|
+
children: [/* @__PURE__ */ q(te, {
|
|
1566
1768
|
asChild: !0,
|
|
1567
|
-
children: /* @__PURE__ */
|
|
1769
|
+
children: /* @__PURE__ */ q(i, {
|
|
1568
1770
|
ref: e,
|
|
1569
1771
|
tone: "secondary",
|
|
1570
1772
|
buttonStyle: "outline",
|
|
1571
1773
|
size: d,
|
|
1572
1774
|
iconOnly: !0,
|
|
1573
1775
|
"aria-label": m.addFilter,
|
|
1574
|
-
className: r("filters-button--component shrink-0",
|
|
1575
|
-
children: /* @__PURE__ */
|
|
1776
|
+
className: r("filters-button--component shrink-0", M[d], ie[d]),
|
|
1777
|
+
children: /* @__PURE__ */ q(Ee, { className: "size-icon-sm" })
|
|
1576
1778
|
})
|
|
1577
|
-
}), /* @__PURE__ */
|
|
1779
|
+
}), /* @__PURE__ */ q(At, {
|
|
1578
1780
|
activeFilterInPopover: o,
|
|
1579
1781
|
availableFilters: n,
|
|
1580
1782
|
activeFilters: a,
|
|
@@ -1595,8 +1797,8 @@ function Tt({ triggerRef: e, availableFilters: n, activeFilters: a, activeFilter
|
|
|
1595
1797
|
}
|
|
1596
1798
|
//#endregion
|
|
1597
1799
|
//#region src/components/features/filters/partials/filter-tabs.tsx
|
|
1598
|
-
function
|
|
1599
|
-
let { activeFilters: t, filters: n, replaceFilters: r } = $(), i =
|
|
1800
|
+
function Nt({ tabs: e }) {
|
|
1801
|
+
let { activeFilters: t, filters: n, replaceFilters: r } = $(), i = U(() => t.filter((e) => n.find((t) => t.key === e.key)?.type !== X.SEARCH), [t, n]), a = U(() => t.filter((e) => n.find((t) => t.key === e.key)?.type === X.SEARCH), [t, n]), s = U(() => {
|
|
1600
1802
|
for (let t of e) {
|
|
1601
1803
|
if (t.presets.length === 0) {
|
|
1602
1804
|
if (i.length === 0) return t.id;
|
|
@@ -1610,13 +1812,13 @@ function Et({ tabs: e }) {
|
|
|
1610
1812
|
})) return t.id;
|
|
1611
1813
|
}
|
|
1612
1814
|
return null;
|
|
1613
|
-
}, [e, i]), c =
|
|
1815
|
+
}, [e, i]), c = V((e) => {
|
|
1614
1816
|
if (e.presets.length === 0) {
|
|
1615
1817
|
r([...a]);
|
|
1616
1818
|
return;
|
|
1617
1819
|
}
|
|
1618
1820
|
let t = e.presets.map((e) => {
|
|
1619
|
-
let t = n.find((t) => t.key === e.key), r = e.operator ?? t?.operator ?? (t ?
|
|
1821
|
+
let t = n.find((t) => t.key === e.key), r = e.operator ?? t?.operator ?? (t ? He(t.type) : "equals");
|
|
1620
1822
|
return {
|
|
1621
1823
|
id: e.key,
|
|
1622
1824
|
key: e.key,
|
|
@@ -1630,14 +1832,14 @@ function Et({ tabs: e }) {
|
|
|
1630
1832
|
a,
|
|
1631
1833
|
r
|
|
1632
1834
|
]);
|
|
1633
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
1835
|
+
return e.length === 0 ? null : /* @__PURE__ */ q(le, {
|
|
1634
1836
|
value: s,
|
|
1635
1837
|
onValueChange: (t) => {
|
|
1636
1838
|
let n = e.find((e) => e.id === t);
|
|
1637
1839
|
n && c(n);
|
|
1638
1840
|
},
|
|
1639
1841
|
className: "filter-tabs--component",
|
|
1640
|
-
children: /* @__PURE__ */
|
|
1842
|
+
children: /* @__PURE__ */ q(ce, {
|
|
1641
1843
|
variant: "chips",
|
|
1642
1844
|
role: "group",
|
|
1643
1845
|
"aria-orientation": void 0,
|
|
@@ -1645,19 +1847,19 @@ function Et({ tabs: e }) {
|
|
|
1645
1847
|
className: "gap-space-md",
|
|
1646
1848
|
children: e.map((e) => {
|
|
1647
1849
|
let t = s === e.id;
|
|
1648
|
-
return /* @__PURE__ */
|
|
1850
|
+
return /* @__PURE__ */ J(se, {
|
|
1649
1851
|
value: e.id,
|
|
1650
1852
|
role: "button",
|
|
1651
1853
|
"aria-selected": void 0,
|
|
1652
1854
|
"aria-controls": void 0,
|
|
1653
1855
|
"aria-pressed": t,
|
|
1654
1856
|
className: "filter-tabs--tab",
|
|
1655
|
-
children: [/* @__PURE__ */
|
|
1857
|
+
children: [/* @__PURE__ */ q(o, {
|
|
1656
1858
|
tag: "span",
|
|
1657
1859
|
weight: "medium",
|
|
1658
1860
|
className: "text-inherit",
|
|
1659
1861
|
children: e.label
|
|
1660
|
-
}), e.count !== void 0 && /* @__PURE__ */
|
|
1862
|
+
}), e.count !== void 0 && /* @__PURE__ */ q(o, {
|
|
1661
1863
|
tag: "span",
|
|
1662
1864
|
size: "xs",
|
|
1663
1865
|
type: "secondary",
|
|
@@ -1671,20 +1873,20 @@ function Et({ tabs: e }) {
|
|
|
1671
1873
|
}
|
|
1672
1874
|
//#endregion
|
|
1673
1875
|
//#region src/components/features/filters/facets/search-facet.tsx
|
|
1674
|
-
var
|
|
1675
|
-
return /* @__PURE__ */
|
|
1876
|
+
var Pt = B.forwardRef(function(e, t) {
|
|
1877
|
+
return /* @__PURE__ */ q(De, {
|
|
1676
1878
|
...e,
|
|
1677
1879
|
ref: t,
|
|
1678
1880
|
className: r("animate-spin", e.className)
|
|
1679
1881
|
});
|
|
1680
1882
|
});
|
|
1681
|
-
function
|
|
1682
|
-
let { strings: a, isNavigating: o } = $(), [s, c] =
|
|
1683
|
-
|
|
1883
|
+
function Ft({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
1884
|
+
let { strings: a, isNavigating: o } = $(), [s, c] = G(t[0] || ""), l = W(s);
|
|
1885
|
+
H(() => {
|
|
1684
1886
|
l.current = s;
|
|
1685
1887
|
}, [s]);
|
|
1686
|
-
let u =
|
|
1687
|
-
|
|
1888
|
+
let u = W(t[0] ?? ""), d = W(!1);
|
|
1889
|
+
H(() => {
|
|
1688
1890
|
if (d.current || o) return;
|
|
1689
1891
|
let e = l.current;
|
|
1690
1892
|
if (!t.length || t[0] === "") {
|
|
@@ -1696,11 +1898,15 @@ function Ot({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
|
1696
1898
|
let f = de((e) => {
|
|
1697
1899
|
u.current = e, d.current = !1, n([e]);
|
|
1698
1900
|
}, e.delay ?? 300), p = (e) => {
|
|
1699
|
-
u.current
|
|
1901
|
+
if (u.current === e) {
|
|
1902
|
+
f.cancel(), d.current = !1;
|
|
1903
|
+
return;
|
|
1904
|
+
}
|
|
1905
|
+
f(e);
|
|
1700
1906
|
};
|
|
1701
|
-
return /* @__PURE__ */
|
|
1907
|
+
return /* @__PURE__ */ q("div", {
|
|
1702
1908
|
className: r("search-facet--component", "search-facet relative w-full min-w-0 rounded-radius bg-background", i),
|
|
1703
|
-
children: /* @__PURE__ */
|
|
1909
|
+
children: /* @__PURE__ */ q(F, {
|
|
1704
1910
|
type: "text",
|
|
1705
1911
|
"aria-label": e.label,
|
|
1706
1912
|
value: s,
|
|
@@ -1722,24 +1928,24 @@ function Ot({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
|
1722
1928
|
return !t || t === "search" ? Y(a.searchPlaceholder, { filterLabel: "" }).replace(/\s+([….?!])/g, "$1").replace(/\s{2,}/g, " ").trim() : Y(a.searchPlaceholder, { filterLabel: t });
|
|
1723
1929
|
})(),
|
|
1724
1930
|
clearable: s.trim() !== "" && !o,
|
|
1725
|
-
endIcon: o ?
|
|
1931
|
+
endIcon: o ? Pt : void 0,
|
|
1726
1932
|
strings: { clear: a.clearSearch }
|
|
1727
1933
|
})
|
|
1728
1934
|
});
|
|
1729
1935
|
}
|
|
1730
|
-
var
|
|
1731
|
-
|
|
1936
|
+
var It = B.memo(Ft);
|
|
1937
|
+
It.displayName = "SearchFacet";
|
|
1732
1938
|
//#endregion
|
|
1733
1939
|
//#region src/components/features/filters/partials/search-filters-list.tsx
|
|
1734
|
-
function
|
|
1735
|
-
return /* @__PURE__ */ K
|
|
1940
|
+
function Lt({ filters: e, getFilterValue: t, setFilterValue: n, className: i }) {
|
|
1941
|
+
return /* @__PURE__ */ q(K, { children: e.map((e) => /* @__PURE__ */ J(u, {
|
|
1736
1942
|
gap: "lg",
|
|
1737
1943
|
className: r("search-filters-list--component", "w-full min-w-0 sm:w-64 sm:flex-none", e.displayConfig.className, i),
|
|
1738
|
-
children: [/* @__PURE__ */
|
|
1944
|
+
children: [/* @__PURE__ */ q(It, {
|
|
1739
1945
|
filter: e,
|
|
1740
1946
|
value: t(e.key),
|
|
1741
1947
|
onValueChange: (t) => n(e.key, t)
|
|
1742
|
-
}), !!e.description && /* @__PURE__ */
|
|
1948
|
+
}), !!e.description && /* @__PURE__ */ q(o, {
|
|
1743
1949
|
size: "xs",
|
|
1744
1950
|
type: "secondary",
|
|
1745
1951
|
children: e.description
|
|
@@ -1748,66 +1954,66 @@ function At({ filters: e, getFilterValue: t, setFilterValue: n, className: i })
|
|
|
1748
1954
|
}
|
|
1749
1955
|
//#endregion
|
|
1750
1956
|
//#region src/components/features/filters/filter-layout.tsx
|
|
1751
|
-
var
|
|
1957
|
+
var Rt = {
|
|
1752
1958
|
compact: "lg",
|
|
1753
1959
|
default: "xl"
|
|
1754
|
-
},
|
|
1960
|
+
}, zt = {
|
|
1755
1961
|
compact: "sm",
|
|
1756
1962
|
default: "md"
|
|
1757
1963
|
};
|
|
1758
|
-
function
|
|
1759
|
-
let { getFilterValue: l, setFilterValue: d, isFilterActive: f, clearFilters: p, getFilterOperator: m, setFilterOperator: h, isNavigating: g, strings: _ } = $(), { processedFilters: v, searchFilters: y, alwaysVisibleFilters: b, activeRegularFilters: x, popoverFilters: S, hasActive: C } =
|
|
1964
|
+
function Bt({ className: e, dynamicFilterOptions: t = {}, loadingFilters: n = {}, variant: a = "default", showClearFilters: s = !1, tabs: c }) {
|
|
1965
|
+
let { getFilterValue: l, setFilterValue: d, isFilterActive: f, clearFilters: p, getFilterOperator: m, setFilterOperator: h, isNavigating: g, strings: _ } = $(), { processedFilters: v, searchFilters: y, alwaysVisibleFilters: b, activeRegularFilters: x, popoverFilters: S, hasActive: C } = $e({ dynamicFilterOptions: t }), [w, T] = G(null), E = v.find((e) => e.key === w) ?? null, D = V((e) => {
|
|
1760
1966
|
T(e?.key ?? null);
|
|
1761
1967
|
}, []);
|
|
1762
|
-
|
|
1968
|
+
H(() => {
|
|
1763
1969
|
w !== null && E === null && T(null);
|
|
1764
1970
|
}, [w, E]);
|
|
1765
|
-
let O =
|
|
1971
|
+
let O = W(null), k = W(null);
|
|
1766
1972
|
function A(e, t) {
|
|
1767
1973
|
t.length === 0 && e.displayConfig?.display !== "always" && (k.current = e.key), d(e.key, t);
|
|
1768
1974
|
}
|
|
1769
|
-
|
|
1975
|
+
H(() => {
|
|
1770
1976
|
let e = k.current;
|
|
1771
1977
|
e !== null && !f(e) && (O.current?.focus(), k.current = null);
|
|
1772
1978
|
}, [f]);
|
|
1773
1979
|
function j(e) {
|
|
1774
|
-
return e.operators && e.operators.length > 0 ? e.operators :
|
|
1980
|
+
return e.operators && e.operators.length > 0 ? e.operators : Ve(e.type, _.operators);
|
|
1775
1981
|
}
|
|
1776
1982
|
function M(e, t) {
|
|
1777
1983
|
h(e, t);
|
|
1778
1984
|
}
|
|
1779
|
-
return /* @__PURE__ */
|
|
1780
|
-
gap:
|
|
1985
|
+
return /* @__PURE__ */ J(u, {
|
|
1986
|
+
gap: Rt[a],
|
|
1781
1987
|
className: r("filter-layout--component", e),
|
|
1782
|
-
children: [!!c && c.length > 0 && /* @__PURE__ */
|
|
1988
|
+
children: [!!c && c.length > 0 && /* @__PURE__ */ q(Nt, { tabs: c }), /* @__PURE__ */ J(u, {
|
|
1783
1989
|
direction: "horizontal",
|
|
1784
1990
|
align: "center",
|
|
1785
|
-
gap:
|
|
1786
|
-
children: [/* @__PURE__ */
|
|
1991
|
+
gap: zt[a],
|
|
1992
|
+
children: [/* @__PURE__ */ q(gt, {
|
|
1787
1993
|
filterKey: "search-filters",
|
|
1788
|
-
children: /* @__PURE__ */
|
|
1994
|
+
children: /* @__PURE__ */ q(Lt, {
|
|
1789
1995
|
filters: y,
|
|
1790
1996
|
getFilterValue: l,
|
|
1791
1997
|
setFilterValue: d
|
|
1792
1998
|
})
|
|
1793
|
-
}), /* @__PURE__ */
|
|
1999
|
+
}), /* @__PURE__ */ J("div", {
|
|
1794
2000
|
className: r("contents", g && "pointer-events-none opacity-60"),
|
|
1795
2001
|
children: [
|
|
1796
2002
|
Object.entries(n).filter(([, e]) => e).map(([e]) => {
|
|
1797
2003
|
let t = v.find((t) => t.key === e)?.label || e;
|
|
1798
|
-
return /* @__PURE__ */
|
|
2004
|
+
return /* @__PURE__ */ J(u, {
|
|
1799
2005
|
direction: "horizontal",
|
|
1800
2006
|
gap: "sm",
|
|
1801
2007
|
wrap: !1,
|
|
1802
2008
|
className: "rounded-radius bg-muted/50 px-control-sm py-space-xs",
|
|
1803
|
-
children: [/* @__PURE__ */
|
|
2009
|
+
children: [/* @__PURE__ */ q("div", { className: "border-muted-foreground/30 border-t-primary size-icon-sm animate-spin rounded-full border-2" }), /* @__PURE__ */ q(o, {
|
|
1804
2010
|
tag: "span",
|
|
1805
2011
|
type: "secondary",
|
|
1806
2012
|
children: Y(_.loadingOptions, { filterLabel: t })
|
|
1807
2013
|
})]
|
|
1808
2014
|
}, `loading-${e}`);
|
|
1809
2015
|
}),
|
|
1810
|
-
[...b, ...x].map((e) => /* @__PURE__ */
|
|
2016
|
+
[...b, ...x].map((e) => /* @__PURE__ */ q(jt, {
|
|
1811
2017
|
filter: e,
|
|
1812
2018
|
value: l(e.key) ?? [],
|
|
1813
2019
|
active: f(e.key),
|
|
@@ -1819,9 +2025,9 @@ function Nt({ className: e, dynamicFilterOptions: t = {}, loadingFilters: n = {}
|
|
|
1819
2025
|
availableFilters: S,
|
|
1820
2026
|
activeFilters: [...x, ...b]
|
|
1821
2027
|
}, e.key)),
|
|
1822
|
-
S.length > 0 && /* @__PURE__ */
|
|
2028
|
+
S.length > 0 && /* @__PURE__ */ q(gt, {
|
|
1823
2029
|
filterKey: "filters-button",
|
|
1824
|
-
children: /* @__PURE__ */
|
|
2030
|
+
children: /* @__PURE__ */ q(Mt, {
|
|
1825
2031
|
triggerRef: O,
|
|
1826
2032
|
availableFilters: S,
|
|
1827
2033
|
activeFilters: x,
|
|
@@ -1831,7 +2037,7 @@ function Nt({ className: e, dynamicFilterOptions: t = {}, loadingFilters: n = {}
|
|
|
1831
2037
|
setActiveFilterInPopover: D
|
|
1832
2038
|
})
|
|
1833
2039
|
}),
|
|
1834
|
-
!!s && C && /* @__PURE__ */
|
|
2040
|
+
!!s && C && /* @__PURE__ */ q(i, {
|
|
1835
2041
|
tone: "secondary",
|
|
1836
2042
|
buttonStyle: "ghost",
|
|
1837
2043
|
onClick: p,
|
|
@@ -1845,93 +2051,105 @@ function Nt({ className: e, dynamicFilterOptions: t = {}, loadingFilters: n = {}
|
|
|
1845
2051
|
}
|
|
1846
2052
|
//#endregion
|
|
1847
2053
|
//#region src/components/features/filters/filter-query.ts
|
|
1848
|
-
var
|
|
1849
|
-
function
|
|
2054
|
+
var Vt = "__op", Ht = ["page"], Ut = new Set(Object.values(Z));
|
|
2055
|
+
function Wt(e) {
|
|
1850
2056
|
let t = {};
|
|
1851
2057
|
if (!e) return t;
|
|
1852
2058
|
if (e instanceof URLSearchParams) return e.forEach((e, n) => {
|
|
1853
2059
|
t[n] = [...t[n] ?? [], e];
|
|
1854
2060
|
}), t;
|
|
1855
2061
|
for (let [n, r] of Object.entries(e)) {
|
|
1856
|
-
let e = (Array.isArray(r) ? r : [r]).filter((e) => e != null
|
|
1857
|
-
e.
|
|
2062
|
+
let e = (Array.isArray(r) ? r : [r]).filter((e) => e != null).map((e) => String(e));
|
|
2063
|
+
e.some(Boolean) && (t[n] = e);
|
|
1858
2064
|
}
|
|
1859
2065
|
return t;
|
|
1860
2066
|
}
|
|
1861
|
-
function
|
|
2067
|
+
function Gt(e) {
|
|
1862
2068
|
let t = {};
|
|
1863
2069
|
for (let [n, r] of Object.entries(e)) r.length !== 0 && (t[n] = r.length === 1 ? r[0] : r);
|
|
1864
2070
|
return t;
|
|
1865
2071
|
}
|
|
1866
|
-
function
|
|
2072
|
+
function Kt(e, t, n) {
|
|
1867
2073
|
let r = e[t] ?? [];
|
|
1868
2074
|
return n === "comma" ? r.flatMap((e) => e.split(",")) : r;
|
|
1869
2075
|
}
|
|
1870
|
-
function
|
|
2076
|
+
function qt(e, t) {
|
|
1871
2077
|
return t.map((e) => e.trim()).filter((e) => e.length > 0).map((t) => {
|
|
1872
2078
|
if (!e.parse) return t;
|
|
1873
2079
|
let n = e.parse(t);
|
|
1874
2080
|
return n == null ? "" : String(n);
|
|
1875
2081
|
}).filter((e) => e.length > 0);
|
|
1876
2082
|
}
|
|
1877
|
-
function
|
|
2083
|
+
function Jt(e, t) {
|
|
1878
2084
|
return t.map((t) => {
|
|
1879
2085
|
let n = e.transform ? e.transform(t) : t, r = e.format ? e.format(n) : n;
|
|
1880
2086
|
return r == null ? "" : String(r);
|
|
1881
2087
|
}).filter((e) => e.length > 0);
|
|
1882
2088
|
}
|
|
1883
|
-
function
|
|
1884
|
-
return e.operator ?? e.operators?.[0]?.value ??
|
|
2089
|
+
function Yt(e) {
|
|
2090
|
+
return e.operator ?? e.operators?.[0]?.value ?? He(e.type);
|
|
1885
2091
|
}
|
|
1886
|
-
function
|
|
2092
|
+
function Xt(e, t, n) {
|
|
1887
2093
|
let [r] = t[`${e.key}${n}`] ?? [];
|
|
1888
|
-
return r &&
|
|
2094
|
+
return r && Ut.has(r) ? r : Yt(e);
|
|
1889
2095
|
}
|
|
1890
|
-
function
|
|
2096
|
+
function Zt(e, t, n) {
|
|
1891
2097
|
return e === "always" || e !== "never" && t !== n;
|
|
1892
2098
|
}
|
|
1893
|
-
function
|
|
2099
|
+
function Qt(e) {
|
|
1894
2100
|
return e.type === X.MULTI_SELECT || e.type === X.TAGS || e.multiple === !0;
|
|
1895
2101
|
}
|
|
1896
|
-
function
|
|
1897
|
-
let r = n.operatorSuffix ??
|
|
2102
|
+
function $t(e, t, n = {}) {
|
|
2103
|
+
let r = n.operatorSuffix ?? Vt, i = n.arrayFormat ?? "repeat", a = Wt(t);
|
|
1898
2104
|
return e.flatMap((e) => {
|
|
1899
|
-
let t =
|
|
1900
|
-
|
|
2105
|
+
let t = Kt(a, e.key, i), n = Xt(e, a, r);
|
|
2106
|
+
if (e.type === X.RANGE) {
|
|
2107
|
+
let i = t.length === 1 && !e.operator && !e.operators?.length && !a[`${e.key}${r}`]?.[0] ? Z.EQUALS : n, o = Ue(t, i).map((t) => qt(e, [t])[0] ?? "");
|
|
2108
|
+
return o.some(Boolean) ? [{
|
|
2109
|
+
id: e.key,
|
|
2110
|
+
key: e.key,
|
|
2111
|
+
operator: i,
|
|
2112
|
+
value: o
|
|
2113
|
+
}] : [];
|
|
2114
|
+
}
|
|
2115
|
+
let o = qt(e, t);
|
|
2116
|
+
if (o.length === 0) return [];
|
|
2117
|
+
let s = e.type === X.DATE && n === Z.BETWEEN;
|
|
2118
|
+
return s && !We(o) ? [] : [{
|
|
1901
2119
|
id: e.key,
|
|
1902
2120
|
key: e.key,
|
|
1903
|
-
operator:
|
|
1904
|
-
value:
|
|
2121
|
+
operator: n,
|
|
2122
|
+
value: s || Qt(e) ? o : [o[0]]
|
|
1905
2123
|
}];
|
|
1906
2124
|
});
|
|
1907
2125
|
}
|
|
1908
|
-
function
|
|
1909
|
-
let i = r.operatorSuffix ??
|
|
2126
|
+
function en(e, t, n, r = {}) {
|
|
2127
|
+
let i = r.operatorSuffix ?? Vt, a = r.arrayFormat ?? "repeat", o = r.preserveUnrelated ?? !0, s = r.includeOperators ?? "changed", c = r.resetPageKeys ?? Ht, l = o ? Wt(n) : {}, u = new Map(e.map((e) => [e.key, e]));
|
|
1910
2128
|
for (let t of e) delete l[t.key], delete l[`${t.key}${i}`];
|
|
1911
2129
|
for (let e of c) delete l[e];
|
|
1912
2130
|
for (let e of t) {
|
|
1913
2131
|
let t = u.get(e.key);
|
|
1914
2132
|
if (!t) continue;
|
|
1915
|
-
let n =
|
|
1916
|
-
if (n.
|
|
2133
|
+
let n = t.type === X.RANGE ? Ue(e.value, e.operator).map((e) => e ? Jt(t, [e])[0] ?? "" : "") : Jt(t, e.value);
|
|
2134
|
+
if (!n.some(Boolean) || t.type === X.DATE && e.operator === Z.BETWEEN && !We(n)) continue;
|
|
1917
2135
|
l[e.key] = a === "comma" ? [n.join(",")] : n;
|
|
1918
|
-
let r =
|
|
1919
|
-
|
|
2136
|
+
let r = Yt(t);
|
|
2137
|
+
Zt(s, e.operator, r) && (l[`${e.key}${i}`] = [e.operator]);
|
|
1920
2138
|
}
|
|
1921
|
-
return
|
|
2139
|
+
return Gt(l);
|
|
1922
2140
|
}
|
|
1923
|
-
function
|
|
1924
|
-
let r = n.preserveUnrelated ?? !0, i = n.resetPageKeys ??
|
|
2141
|
+
function tn(e, t, n = {}) {
|
|
2142
|
+
let r = n.preserveUnrelated ?? !0, i = n.resetPageKeys ?? Ht, a = r ? Wt(e) : {}, o = Wt(t);
|
|
1925
2143
|
for (let e of i) delete a[e];
|
|
1926
2144
|
for (let [e, t] of Object.entries(o)) t.length === 0 ? delete a[e] : a[e] = t;
|
|
1927
|
-
return
|
|
2145
|
+
return Gt(a);
|
|
1928
2146
|
}
|
|
1929
2147
|
//#endregion
|
|
1930
2148
|
//#region src/components/features/filters/facets/select-facet.tsx
|
|
1931
|
-
function
|
|
1932
|
-
let { defaultScale: c } = t(), l =
|
|
2149
|
+
function nn({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
2150
|
+
let { defaultScale: c } = t(), l = P(void 0, c), { strings: u } = $(), [d, f] = G(!1), [p, m] = G(""), h = n.length > 0, g = e.options, _ = (t) => {
|
|
1933
2151
|
e.multiple ? n.includes(t) ? a(n.filter((e) => e !== t)) : a([...n, t]) : (a([t]), e.closeOnSelect !== !1 && f(!1));
|
|
1934
|
-
}, v = (t) =>
|
|
2152
|
+
}, v = (t) => Ye(e, t) ?? t, y = U(() => qe(g) ? Je(g ?? []) : null, [g]), b = U(() => (g ?? []).map((e) => ({
|
|
1935
2153
|
value: e.value,
|
|
1936
2154
|
label: e.label,
|
|
1937
2155
|
description: e.description,
|
|
@@ -1942,9 +2160,9 @@ function Yt({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
|
1942
2160
|
count: n.length,
|
|
1943
2161
|
filterLabel: Q((n.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
1944
2162
|
});
|
|
1945
|
-
return y ? /* @__PURE__ */
|
|
2163
|
+
return y ? /* @__PURE__ */ q("div", {
|
|
1946
2164
|
className: r("select-facet--component", "relative", s),
|
|
1947
|
-
children: /* @__PURE__ */
|
|
2165
|
+
children: /* @__PURE__ */ q(ge, {
|
|
1948
2166
|
items: y,
|
|
1949
2167
|
value: e.multiple ? n : n[0] ?? null,
|
|
1950
2168
|
multiple: !!e.multiple,
|
|
@@ -1962,9 +2180,9 @@ function Yt({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
|
1962
2180
|
renderValue: n.length > 1 ? () => S : void 0,
|
|
1963
2181
|
onValueChange: (e) => a(e == null ? [] : typeof e == "string" ? [e] : [...e])
|
|
1964
2182
|
})
|
|
1965
|
-
}) : /* @__PURE__ */
|
|
2183
|
+
}) : /* @__PURE__ */ q("div", {
|
|
1966
2184
|
className: r("select-facet--component", "relative", s),
|
|
1967
|
-
children: /* @__PURE__ */
|
|
2185
|
+
children: /* @__PURE__ */ q(ue, {
|
|
1968
2186
|
open: d,
|
|
1969
2187
|
onOpenChange: f,
|
|
1970
2188
|
search: !0,
|
|
@@ -1975,27 +2193,27 @@ function Yt({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
|
1975
2193
|
empty: u.noOptionsFound
|
|
1976
2194
|
},
|
|
1977
2195
|
contentClassName: "w-(--anchor-width) min-w-56",
|
|
1978
|
-
trigger: /* @__PURE__ */
|
|
2196
|
+
trigger: /* @__PURE__ */ J(i, {
|
|
1979
2197
|
tone: "secondary",
|
|
1980
2198
|
buttonStyle: "outline",
|
|
1981
2199
|
size: l,
|
|
1982
2200
|
role: "combobox",
|
|
1983
2201
|
"aria-expanded": d,
|
|
1984
|
-
className:
|
|
1985
|
-
children: [h ? n.length === 1 ? /* @__PURE__ */
|
|
2202
|
+
className: N(l),
|
|
2203
|
+
children: [h ? n.length === 1 ? /* @__PURE__ */ q(o, {
|
|
1986
2204
|
tag: "span",
|
|
1987
2205
|
weight: "semibold",
|
|
1988
2206
|
className: "truncate",
|
|
1989
2207
|
children: v(n[0])
|
|
1990
|
-
}) : /* @__PURE__ */
|
|
2208
|
+
}) : /* @__PURE__ */ q(o, {
|
|
1991
2209
|
tag: "span",
|
|
1992
2210
|
weight: "semibold",
|
|
1993
2211
|
children: S
|
|
1994
|
-
}) : /* @__PURE__ */
|
|
2212
|
+
}) : /* @__PURE__ */ q(o, {
|
|
1995
2213
|
tag: "span",
|
|
1996
2214
|
type: "secondary",
|
|
1997
2215
|
children: e.placeholder ?? u.select
|
|
1998
|
-
}), /* @__PURE__ */
|
|
2216
|
+
}), /* @__PURE__ */ q(Te, { className: "ml-control-gap-small size-icon-sm shrink-0 opacity-50" })]
|
|
1999
2217
|
}),
|
|
2000
2218
|
items: b,
|
|
2001
2219
|
onSelect: (e) => _(e.value)
|
|
@@ -2004,13 +2222,13 @@ function Yt({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
|
2004
2222
|
}
|
|
2005
2223
|
//#endregion
|
|
2006
2224
|
//#region src/components/features/filters/facets/async-select-facet.tsx
|
|
2007
|
-
function
|
|
2008
|
-
let { defaultScale: c } = t(), l =
|
|
2225
|
+
function rn({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
2226
|
+
let { defaultScale: c } = t(), l = P(void 0, c), { strings: d, cacheAsyncOptions: m, getAsyncOptionLabel: h, reportError: g } = $(), [_, v] = G(!1), [y, b] = G(""), x = U(() => /* @__PURE__ */ new Map(), [
|
|
2009
2227
|
e.key,
|
|
2010
2228
|
e.asyncConfig?.fetcher,
|
|
2011
2229
|
e.asyncConfig?.mapToOption
|
|
2012
|
-
]), { options: S, isLoading: C, isFetching:
|
|
2013
|
-
|
|
2230
|
+
]), { options: S, isLoading: C, isFetching: w, isError: A, refetch: M, isBelowMinQuery: F, minQueryLength: I } = lt(e, y, _, { onError: g });
|
|
2231
|
+
H(() => {
|
|
2014
2232
|
if (S.length !== 0) {
|
|
2015
2233
|
for (let e of S) x.set(e.value, e);
|
|
2016
2234
|
m(e.key, S);
|
|
@@ -2021,7 +2239,7 @@ function Xt({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
|
2021
2239
|
x,
|
|
2022
2240
|
S
|
|
2023
2241
|
]);
|
|
2024
|
-
let
|
|
2242
|
+
let ee = e.multiple !== !1, L = e.maxSelected, R = U(() => e.options ?? [], [e.options]), z = U(() => {
|
|
2025
2243
|
let t = new Set(n), r = new Set([...R, ...S].map((e) => e.value)), i = [];
|
|
2026
2244
|
for (let t of n) if (!r.has(t)) {
|
|
2027
2245
|
let n = x.get(t);
|
|
@@ -2053,122 +2271,122 @@ function Xt({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
|
2053
2271
|
e.icon,
|
|
2054
2272
|
x,
|
|
2055
2273
|
h
|
|
2056
|
-
]),
|
|
2057
|
-
if (
|
|
2274
|
+
]), ie = (t) => {
|
|
2275
|
+
if (ee) {
|
|
2058
2276
|
if (n.includes(t)) a(n.filter((e) => e !== t));
|
|
2059
2277
|
else {
|
|
2060
2278
|
if (L && n.length >= L) return;
|
|
2061
2279
|
a([...n, t]);
|
|
2062
2280
|
}
|
|
2063
2281
|
} else a([t]), e.closeOnSelect !== !1 && v(!1);
|
|
2064
|
-
},
|
|
2282
|
+
}, ae = (t) => {
|
|
2065
2283
|
let n = S.find((e) => e.value === t);
|
|
2066
2284
|
if (n) return n.label;
|
|
2067
2285
|
let r = R.find((e) => e.value === t);
|
|
2068
2286
|
if (r) return r.label;
|
|
2069
2287
|
let i = x.get(t);
|
|
2070
2288
|
return i ? i.label : h(e.key, t) ?? t;
|
|
2071
|
-
},
|
|
2289
|
+
}, oe = n.length > 0, se = U(() => C || w ? /* @__PURE__ */ q(f, {
|
|
2072
2290
|
className: "async-select-facet--component",
|
|
2073
2291
|
label: d.searching
|
|
2074
|
-
}) :
|
|
2292
|
+
}) : A ? /* @__PURE__ */ q(p, {
|
|
2075
2293
|
variant: "inline",
|
|
2076
2294
|
title: d.fetchError,
|
|
2077
|
-
action: /* @__PURE__ */
|
|
2295
|
+
action: /* @__PURE__ */ q(i, {
|
|
2078
2296
|
tone: "secondary",
|
|
2079
2297
|
buttonStyle: "outline",
|
|
2080
2298
|
size: "sm",
|
|
2081
2299
|
onClick: (e) => {
|
|
2082
|
-
e.stopPropagation(),
|
|
2300
|
+
e.stopPropagation(), M();
|
|
2083
2301
|
},
|
|
2084
2302
|
children: d.retryFetch
|
|
2085
2303
|
})
|
|
2086
|
-
}) : F ? /* @__PURE__ */
|
|
2304
|
+
}) : F ? /* @__PURE__ */ q("div", {
|
|
2087
2305
|
className: "text-muted-foreground flex items-center justify-center py-space-xl",
|
|
2088
|
-
children: /* @__PURE__ */
|
|
2306
|
+
children: /* @__PURE__ */ q(o, {
|
|
2089
2307
|
tag: "span",
|
|
2090
2308
|
size: "xs",
|
|
2091
2309
|
type: "secondary",
|
|
2092
|
-
children: Y(d.minQueryHint, { min:
|
|
2310
|
+
children: Y(d.minQueryHint, { min: I })
|
|
2093
2311
|
})
|
|
2094
|
-
}) : /* @__PURE__ */
|
|
2312
|
+
}) : /* @__PURE__ */ q(o, {
|
|
2095
2313
|
tag: "span",
|
|
2096
2314
|
type: "secondary",
|
|
2097
2315
|
children: d.noOptionsFound
|
|
2098
2316
|
}), [
|
|
2099
2317
|
C,
|
|
2100
|
-
|
|
2101
|
-
|
|
2318
|
+
w,
|
|
2319
|
+
A,
|
|
2102
2320
|
F,
|
|
2103
|
-
|
|
2321
|
+
I,
|
|
2104
2322
|
d,
|
|
2105
|
-
|
|
2323
|
+
M
|
|
2106
2324
|
]);
|
|
2107
|
-
return /* @__PURE__ */
|
|
2325
|
+
return /* @__PURE__ */ q("div", {
|
|
2108
2326
|
className: r("async-select-facet--component relative", s),
|
|
2109
|
-
children: /* @__PURE__ */
|
|
2327
|
+
children: /* @__PURE__ */ J(ne, {
|
|
2110
2328
|
open: _,
|
|
2111
2329
|
onOpenChange: (e) => {
|
|
2112
2330
|
v(e), e || b("");
|
|
2113
2331
|
},
|
|
2114
|
-
children: [/* @__PURE__ */
|
|
2332
|
+
children: [/* @__PURE__ */ q(te, { render: /* @__PURE__ */ J(i, {
|
|
2115
2333
|
tone: "secondary",
|
|
2116
2334
|
buttonStyle: "outline",
|
|
2117
2335
|
size: l,
|
|
2118
2336
|
role: "combobox",
|
|
2119
2337
|
"aria-expanded": _,
|
|
2120
|
-
className:
|
|
2121
|
-
children: [
|
|
2338
|
+
className: N(l),
|
|
2339
|
+
children: [oe ? n.length === 1 ? /* @__PURE__ */ q(o, {
|
|
2122
2340
|
tag: "span",
|
|
2123
2341
|
weight: "semibold",
|
|
2124
2342
|
className: "truncate",
|
|
2125
|
-
children:
|
|
2126
|
-
}) : /* @__PURE__ */
|
|
2343
|
+
children: ae(n[0])
|
|
2344
|
+
}) : /* @__PURE__ */ q(o, {
|
|
2127
2345
|
tag: "span",
|
|
2128
2346
|
weight: "semibold",
|
|
2129
2347
|
children: Y(d.selected, {
|
|
2130
2348
|
count: n.length,
|
|
2131
2349
|
filterLabel: Q((n.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
2132
2350
|
})
|
|
2133
|
-
}) : /* @__PURE__ */
|
|
2351
|
+
}) : /* @__PURE__ */ q(o, {
|
|
2134
2352
|
tag: "span",
|
|
2135
2353
|
type: "secondary",
|
|
2136
2354
|
children: e.placeholder ?? d.select
|
|
2137
|
-
}), /* @__PURE__ */
|
|
2138
|
-
}) }), /* @__PURE__ */
|
|
2355
|
+
}), /* @__PURE__ */ q(Te, { className: "ml-control-gap-small size-icon-sm shrink-0 opacity-50" })]
|
|
2356
|
+
}) }), /* @__PURE__ */ q(re, {
|
|
2139
2357
|
type: "menu",
|
|
2140
2358
|
inset: "flush",
|
|
2141
2359
|
className: "w-full min-w-70 gap-0",
|
|
2142
|
-
children: /* @__PURE__ */
|
|
2360
|
+
children: /* @__PURE__ */ J(j, {
|
|
2143
2361
|
shouldFilter: !1,
|
|
2144
2362
|
inset: "flush",
|
|
2145
2363
|
className: "rounded-none",
|
|
2146
|
-
children: [/* @__PURE__ */
|
|
2364
|
+
children: [/* @__PURE__ */ q(E, {
|
|
2147
2365
|
placeholder: Y(d.searchPlaceholder, { filterLabel: e.label }),
|
|
2148
2366
|
value: y,
|
|
2149
2367
|
onValueChange: b
|
|
2150
|
-
}), /* @__PURE__ */
|
|
2368
|
+
}), /* @__PURE__ */ q(O, { children: z.length === 0 ? /* @__PURE__ */ q(D, { children: se }) : /* @__PURE__ */ J(k, { children: [!(!w || C) && /* @__PURE__ */ J(u, {
|
|
2151
2369
|
direction: "horizontal",
|
|
2152
2370
|
gap: "sm",
|
|
2153
2371
|
wrap: !1,
|
|
2154
2372
|
className: "px-control-sm py-space-xs",
|
|
2155
|
-
children: [/* @__PURE__ */
|
|
2373
|
+
children: [/* @__PURE__ */ q(De, { className: "text-muted-foreground size-icon-sm animate-spin" }), /* @__PURE__ */ q(o, {
|
|
2156
2374
|
tag: "span",
|
|
2157
2375
|
size: "xs",
|
|
2158
2376
|
type: "secondary",
|
|
2159
2377
|
children: d.searching
|
|
2160
2378
|
})]
|
|
2161
|
-
}),
|
|
2379
|
+
}), z.map((e) => /* @__PURE__ */ J(T, {
|
|
2162
2380
|
value: e.value,
|
|
2163
|
-
onSelect: () =>
|
|
2381
|
+
onSelect: () => ie(e.value),
|
|
2164
2382
|
disabled: e.disabled || !!L && n.length >= L && !n.includes(e.value),
|
|
2165
2383
|
children: [
|
|
2166
|
-
/* @__PURE__ */
|
|
2167
|
-
!!e.icon && /* @__PURE__ */
|
|
2384
|
+
/* @__PURE__ */ q(Se, { className: r("mr-control-gap size-icon-sm", n.includes(e.value) ? "opacity-100" : "opacity-0") }),
|
|
2385
|
+
!!e.icon && /* @__PURE__ */ q("span", {
|
|
2168
2386
|
className: "mr-1.5",
|
|
2169
2387
|
children: e.icon
|
|
2170
2388
|
}),
|
|
2171
|
-
/* @__PURE__ */
|
|
2389
|
+
/* @__PURE__ */ q(o, {
|
|
2172
2390
|
tag: "span",
|
|
2173
2391
|
children: e.label
|
|
2174
2392
|
})
|
|
@@ -2180,78 +2398,18 @@ function Xt({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
|
2180
2398
|
});
|
|
2181
2399
|
}
|
|
2182
2400
|
//#endregion
|
|
2183
|
-
//#region src/components/features/filters/facets/range-facet.tsx
|
|
2184
|
-
function Zt({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
2185
|
-
let { strings: o } = $(), [s, c] = W(t.min?.toString() ?? ""), [d, f] = W(t.max?.toString() ?? ""), p = be(), m = de((e) => {
|
|
2186
|
-
(e.min !== t.min || e.max !== t.max) && n(e);
|
|
2187
|
-
}, e.delay ?? 300);
|
|
2188
|
-
return V(() => (m({
|
|
2189
|
-
min: s ? Number(s) : void 0,
|
|
2190
|
-
max: d ? Number(d) : void 0
|
|
2191
|
-
}), m.cancel), [
|
|
2192
|
-
s,
|
|
2193
|
-
d,
|
|
2194
|
-
m
|
|
2195
|
-
]), /* @__PURE__ */ K(u, {
|
|
2196
|
-
gap: "md",
|
|
2197
|
-
className: r("range-facet--component", i),
|
|
2198
|
-
children: /* @__PURE__ */ q(l, {
|
|
2199
|
-
columns: {
|
|
2200
|
-
base: 1,
|
|
2201
|
-
sm: 2
|
|
2202
|
-
},
|
|
2203
|
-
gap: "md",
|
|
2204
|
-
children: [/* @__PURE__ */ q(u, {
|
|
2205
|
-
gap: "xs",
|
|
2206
|
-
children: [/* @__PURE__ */ K(a, {
|
|
2207
|
-
htmlFor: `${p}-min`,
|
|
2208
|
-
className: "text-inherit",
|
|
2209
|
-
children: o.min
|
|
2210
|
-
}), /* @__PURE__ */ K(P, {
|
|
2211
|
-
id: `${p}-min`,
|
|
2212
|
-
type: "text",
|
|
2213
|
-
value: s,
|
|
2214
|
-
onChange: (e) => {
|
|
2215
|
-
let t = e.target.value;
|
|
2216
|
-
(t === "" || /^\d*\.?\d*$/.test(t)) && c(t);
|
|
2217
|
-
},
|
|
2218
|
-
placeholder: o.min,
|
|
2219
|
-
className: "w-full"
|
|
2220
|
-
})]
|
|
2221
|
-
}), /* @__PURE__ */ q(u, {
|
|
2222
|
-
gap: "xs",
|
|
2223
|
-
children: [/* @__PURE__ */ K(a, {
|
|
2224
|
-
htmlFor: `${p}-max`,
|
|
2225
|
-
className: "text-inherit",
|
|
2226
|
-
children: o.max
|
|
2227
|
-
}), /* @__PURE__ */ K(P, {
|
|
2228
|
-
id: `${p}-max`,
|
|
2229
|
-
type: "text",
|
|
2230
|
-
value: d,
|
|
2231
|
-
onChange: (e) => {
|
|
2232
|
-
let t = e.target.value;
|
|
2233
|
-
(t === "" || /^\d*\.?\d*$/.test(t)) && f(t);
|
|
2234
|
-
},
|
|
2235
|
-
placeholder: o.max,
|
|
2236
|
-
className: "w-full"
|
|
2237
|
-
})]
|
|
2238
|
-
})]
|
|
2239
|
-
})
|
|
2240
|
-
});
|
|
2241
|
-
}
|
|
2242
|
-
//#endregion
|
|
2243
2401
|
//#region src/components/features/filters/validators.ts
|
|
2244
|
-
function
|
|
2402
|
+
function an(e) {
|
|
2245
2403
|
return (t) => {
|
|
2246
2404
|
if (t == null || typeof t == "string" && t.length === 0) return !0;
|
|
2247
2405
|
let n = e.safeParse(t);
|
|
2248
2406
|
return n.success ? !0 : n.error?.issues?.[0]?.message ?? n.error?.message ?? !1;
|
|
2249
2407
|
};
|
|
2250
2408
|
}
|
|
2251
|
-
function
|
|
2409
|
+
function on(e, t) {
|
|
2252
2410
|
return (n) => e(n) ? !0 : t;
|
|
2253
2411
|
}
|
|
2254
2412
|
//#endregion
|
|
2255
|
-
export {
|
|
2413
|
+
export { Ve as A, $e as C, ze as D, Be as E, Fe as F, Ne as I, Pe as L, Ie as M, Z as N, He as O, X as P, Y as R, et as S, $ as T, gt as _, tn as a, st as b, Bt as c, Nt as d, Mt as f, yt as g, Et as h, nn as i, Le as j, Re as k, Lt as l, At as m, an as n, $t as o, jt as p, rn as r, en as s, on as t, It as u, pt as v, Qe as w, tt as x, lt as y };
|
|
2256
2414
|
|
|
2257
|
-
//# sourceMappingURL=filters-
|
|
2415
|
+
//# sourceMappingURL=filters-Dl80yYtN.js.map
|