themelia-react-ui 2.0.4 → 2.0.5
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 +135 -0
- package/README.md +113 -18
- package/dist/{accordion-96o0pN62.js → accordion-B9MHG0cT.js} +11 -11
- package/dist/accordion-B9MHG0cT.js.map +1 -0
- package/dist/{action-menu-CHgs8vmj.js → action-menu-Dr8K-ghE.js} +48 -45
- package/dist/action-menu-Dr8K-ghE.js.map +1 -0
- package/dist/{affordance-geometry.generated-B8yGOr8-.js → affordance-geometry.generated-P-aVJisu.js} +36 -36
- package/dist/affordance-geometry.generated-P-aVJisu.js.map +1 -0
- package/dist/{ai-artifact-BZUGwBq6.js → ai-artifact-C58tQcBy.js} +210 -174
- package/dist/ai-artifact-C58tQcBy.js.map +1 -0
- package/dist/app-shell-B_IuNWOo.js +321 -0
- package/dist/app-shell-B_IuNWOo.js.map +1 -0
- package/dist/{attachment-DkoqHPPl.js → attachment-Dg_69lPS.js} +9 -9
- package/dist/{attachment-DkoqHPPl.js.map → attachment-Dg_69lPS.js.map} +1 -1
- package/dist/{auth-D2FVZ1MH.js → auth-DTkkshS8.js} +43 -46
- package/dist/auth-DTkkshS8.js.map +1 -0
- package/dist/{avatar-DWO_HHhB.js → avatar-CeZaFmNH.js} +8 -8
- package/dist/avatar-CeZaFmNH.js.map +1 -0
- package/dist/{badge-DErMA7ul.js → badge-xIiV_E7f.js} +5 -5
- package/dist/{badge-DErMA7ul.js.map → badge-xIiV_E7f.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 +2 -372
- 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 +2 -2
- 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 +3 -3
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +10 -10
- 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 +7 -7
- 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 +12 -12
- 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/signature-pad.js.map +1 -1
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +4 -4
- 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 +36 -36
- package/dist/base/toaster.js.map +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-CdfIkCsV.js → batch-action-bar-Cb8cuvyy.js} +6 -6
- package/dist/batch-action-bar-Cb8cuvyy.js.map +1 -0
- package/dist/blocks/admin.js +21 -21
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +230 -216
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +325 -306
- 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 +1259 -1184
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +2 -2
- package/dist/blocks/onboarding.js +6 -6
- package/dist/blocks/onboarding.js.map +1 -1
- package/dist/blocks/planning.js +11 -11
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-B-WFKecD.js → breadcrumbs-J-K2kl4c.js} +6 -6
- package/dist/{breadcrumbs-B-WFKecD.js.map → breadcrumbs-J-K2kl4c.js.map} +1 -1
- package/dist/{button-DkmK-z8E.js → button-S2Cubiiz.js} +3 -3
- package/dist/button-S2Cubiiz.js.map +1 -0
- package/dist/{buttons-BbfzgczK.js → buttons-BedGfygC.js} +16 -16
- package/dist/buttons-BedGfygC.js.map +1 -0
- package/dist/cards-rNX1M4Xn.js +69 -0
- package/dist/cards-rNX1M4Xn.js.map +1 -0
- package/dist/cascader-B1MiqkBq.js +439 -0
- package/dist/cascader-B1MiqkBq.js.map +1 -0
- package/dist/chart-Darg_0Kv.js +162 -0
- package/dist/chart-Darg_0Kv.js.map +1 -0
- package/dist/{checkbox-CzYUTPeJ.js → checkbox-fflqmODR.js} +2 -2
- package/dist/{checkbox-CzYUTPeJ.js.map → checkbox-fflqmODR.js.map} +1 -1
- package/dist/{choice-inputs-JLtij2y4.js → choice-inputs-zUgBZfE4.js} +258 -257
- package/dist/choice-inputs-zUgBZfE4.js.map +1 -0
- package/dist/{code-block-CGNaUtAE.js → code-block-BzmM9Eig.js} +8 -8
- package/dist/code-block-BzmM9Eig.js.map +1 -0
- package/dist/{collapsible-Do4G0zcC.js → collapsible-BkAI_XD4.js} +5 -5
- package/dist/{collapsible-Do4G0zcC.js.map → collapsible-BkAI_XD4.js.map} +1 -1
- package/dist/{collection-content-C0e8SsTm.js → collection-content-gDh1v6O4.js} +3 -3
- package/dist/{collection-content-C0e8SsTm.js.map → collection-content-gDh1v6O4.js.map} +1 -1
- package/dist/combobox-BEx0vJgF.js +362 -0
- package/dist/combobox-BEx0vJgF.js.map +1 -0
- package/dist/{combobox-CBJDs6w_.js → combobox-BwzoXFSG.js} +254 -247
- package/dist/combobox-BwzoXFSG.js.map +1 -0
- package/dist/{command-D8NrBj-b.js → command-CrlPIL6m.js} +11 -11
- package/dist/command-CrlPIL6m.js.map +1 -0
- package/dist/{comments-Di4w0H_S.js → comments-Dmpp0YIc.js} +29 -29
- package/dist/{comments-Di4w0H_S.js.map → comments-Dmpp0YIc.js.map} +1 -1
- package/dist/components/base/action-menu/action-menu.d.ts +7 -1
- package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
- package/dist/components/base/cards/card.recipes.d.ts +6 -4
- package/dist/components/base/cards/partials/card-primitives.d.ts +9 -2
- package/dist/components/base/cards/partials/smart-card-header-row.d.ts +3 -1
- package/dist/components/base/cards/smart-card.types.d.ts +3 -4
- package/dist/components/base/cascader/cascader-panel.d.ts +76 -0
- package/dist/components/base/chart/chart.d.ts +6 -1
- package/dist/components/base/choice-inputs/choice-types.d.ts +1 -1
- package/dist/components/base/combobox/index.d.ts +4 -2
- package/dist/components/base/feedback/alert.d.ts +1 -1
- package/dist/components/base/forms/form-sizing.d.ts +7 -7
- package/dist/components/base/forms/workflow.d.ts +7 -1
- package/dist/components/base/forms-numeric/coordinates-input.d.ts +4 -0
- package/dist/components/base/metadata-list/metadata-list.d.ts +1 -1
- package/dist/components/base/navigation/dropdown-menu.d.ts +1 -1
- package/dist/components/base/navigation/page-header/page-header-commands.d.ts +14 -7
- package/dist/components/base/navigation/page-header/page-header.d.ts +10 -3
- package/dist/components/base/popover/popover.d.ts +3 -3
- package/dist/components/base/popover/popover.recipes.d.ts +10 -6
- package/dist/components/base/sheet/sheet.d.ts +2 -0
- package/dist/components/base/sidebar/index.d.ts +1 -1
- package/dist/components/base/sidebar/sidebar.d.ts +27 -5
- package/dist/components/base/toaster/index.d.ts +1 -0
- package/dist/components/blocks/ai/ai-file-tree/types.d.ts +1 -1
- package/dist/components/blocks/ai/ai-tool-call/types.d.ts +3 -1
- package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
- package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +2 -0
- package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
- package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +1 -1
- package/dist/components/blocks/commerce/cart-summary/types.d.ts +3 -1
- package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +1 -1
- package/dist/components/blocks/commerce/discount-stack/types.d.ts +3 -1
- package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
- package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +11 -2
- package/dist/components/blocks/commerce/index.d.ts +7 -6
- package/dist/components/blocks/commerce/inventory-section/inventory-section.d.ts +1 -1
- package/dist/components/blocks/commerce/inventory-section/types.d.ts +7 -2
- package/dist/components/blocks/commerce/invoice-header/index.d.ts +2 -1
- package/dist/components/blocks/commerce/invoice-header/invoice-header.d.ts +1 -1
- package/dist/components/blocks/commerce/invoice-header/types.d.ts +20 -6
- package/dist/components/blocks/commerce/invoice-line-items/invoice-line-items.d.ts +1 -1
- package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +24 -7
- package/dist/components/blocks/commerce/invoice-mini/index.d.ts +2 -1
- package/dist/components/blocks/commerce/invoice-mini/types.d.ts +7 -1
- package/dist/components/blocks/commerce/order-customer/order-customer.d.ts +1 -1
- package/dist/components/blocks/commerce/order-customer/types.d.ts +9 -1
- package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +1 -1
- package/dist/components/blocks/commerce/refund-status/types.d.ts +3 -1
- package/dist/components/blocks/commerce/shipment-tracking/shipment-tracking.d.ts +1 -1
- package/dist/components/blocks/commerce/shipment-tracking/types.d.ts +3 -1
- package/dist/components/blocks/commerce/tax-breakdown/tax-breakdown.d.ts +1 -1
- package/dist/components/blocks/commerce/tax-breakdown/types.d.ts +3 -1
- package/dist/components/features/activities/activities.types.d.ts +8 -2
- package/dist/components/features/activities/partials/activity-marker.d.ts +7 -3
- package/dist/components/features/activities/partials/activity-row.d.ts +24 -0
- package/dist/components/features/event-calendar/colors.d.ts +2 -2
- package/dist/components/features/event-calendar/event-calendar.types.d.ts +4 -0
- package/dist/components/features/filters/facets/select-facet.d.ts +2 -1
- package/dist/components/features/filters/filters.strings.d.ts +4 -0
- package/dist/components/features/filters/filters.types.d.ts +3 -0
- package/dist/components/features/filters/partials/filter-editor-header.d.ts +16 -0
- package/dist/components/features/filters/partials/filter-popover-content.d.ts +1 -1
- package/dist/components/features/filters/partials/nested-filter-options.d.ts +21 -0
- package/dist/components/features/filters/partials/regular-filter-content.d.ts +2 -1
- package/dist/components/features/filters/utils/filter-utils.d.ts +21 -3
- package/dist/components/features/global-search/global-search.types.d.ts +2 -0
- package/dist/components/features/global-search/partials/global-search-input.d.ts +10 -0
- package/dist/components/features/global-search/partials/global-search-result-row.d.ts +7 -1
- package/dist/components/features/media-library/media-library.strings.d.ts +2 -0
- package/dist/components/features/media-library/media-library.types.d.ts +14 -4
- package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
- package/dist/components/features/products/components/product-options-matrix.d.ts +1 -1
- package/dist/components/features/products/components/product-variant-editor.d.ts +1 -1
- package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
- package/dist/components/features/products/products.strings.d.ts +9 -1
- package/dist/components/features/products/products.types.d.ts +43 -6
- package/dist/components/features/resource/resource.d.ts +5 -1
- package/dist/components/features/resource/resource.types.d.ts +12 -1
- package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +1 -1
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +12 -2
- package/dist/components/features/table/partials/resource-cell.d.ts +22 -5
- package/dist/components/features/table/table.types.d.ts +1 -1
- package/dist/components/layout/app-shell/app-shell.types.d.ts +35 -6
- package/dist/components/layout/app-shell/index.d.ts +1 -1
- package/dist/components/layout/app-shell/shell-regions.d.ts +27 -0
- package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
- package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
- package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
- package/dist/components/layout/containers/two-column-layout.d.ts +2 -0
- package/dist/components/layout/header/header.recipes.d.ts +6 -0
- package/dist/components/layout/header/header.types.d.ts +6 -6
- package/dist/components/layout/navigation/section-nav/section-nav.d.ts +5 -0
- package/dist/components/layout/page/index.d.ts +2 -1
- package/dist/components/layout/page/page.d.ts +1 -0
- package/dist/components/layout/page/page.strings.d.ts +11 -0
- package/dist/components/layout/page/page.types.d.ts +69 -17
- package/dist/components/layout/page/partials/page-header.d.ts +1 -1
- package/dist/components/layout/settings/settings.d.ts +9 -2
- package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
- package/dist/components/layout/sidebar/index.d.ts +2 -1
- package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +36 -0
- package/dist/components/layout/sidebar/sidebar.context.d.ts +5 -7
- package/dist/components/layout/sidebar/sidebar.types.d.ts +48 -10
- package/dist/components/layout/sidebar/sidebar.utils.d.ts +9 -1
- package/dist/components/layout/workspace/workspace.types.d.ts +8 -1
- package/dist/components/ui/alert-dialog.d.ts +2 -2
- package/dist/components/ui/combobox.d.ts +1 -1
- package/dist/components/ui/dialog.d.ts +2 -2
- package/dist/components/ui/overlay-layer.d.ts +18 -0
- package/dist/components/ui/sheet.d.ts +5 -1
- package/dist/components/ui/sidebar-state.d.ts +82 -0
- package/dist/components/ui/sidebar.d.ts +5 -17
- package/dist/{containers-CRmHf7GP.js → containers-CIxwbZt5.js} +26 -18
- package/dist/containers-CIxwbZt5.js.map +1 -0
- package/dist/{control-group-recipes-DBXmfh2E.js → control-group-recipes-fMuFo0H7.js} +6 -6
- package/dist/control-group-recipes-fMuFo0H7.js.map +1 -0
- package/dist/{copyable-CnGCZdX4.js → copyable-DIznBqiT.js} +7 -7
- package/dist/{copyable-CnGCZdX4.js.map → copyable-DIznBqiT.js.map} +1 -1
- package/dist/{data-display-D4oujtx0.js → data-display-BdgCAw8T.js} +268 -277
- package/dist/data-display-BdgCAw8T.js.map +1 -0
- package/dist/{date-Q7jnXxpk.js → date-Cq8ioE4o.js} +5 -5
- package/dist/{date-Q7jnXxpk.js.map → date-Cq8ioE4o.js.map} +1 -1
- package/dist/{date-picker-zOt1oNss.js → date-picker-RlIzKom_.js} +446 -437
- package/dist/date-picker-RlIzKom_.js.map +1 -0
- package/dist/{date-pickers-cj8IXbDC.js → date-pickers-DY-CpXS1.js} +12 -12
- package/dist/{date-pickers-cj8IXbDC.js.map → date-pickers-DY-CpXS1.js.map} +1 -1
- package/dist/{display-BB4BL_-K.js → display-KsZLw9Ov.js} +9 -9
- package/dist/{display-BB4BL_-K.js.map → display-KsZLw9Ov.js.map} +1 -1
- package/dist/dropdown-menu-CLs8Lihj.js +194 -0
- package/dist/dropdown-menu-CLs8Lihj.js.map +1 -0
- package/dist/features/activities.js +302 -253
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +15 -14
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/appointment-calendar.js +22 -22
- package/dist/features/appointment-calendar.js.map +1 -1
- package/dist/features/async-preview.js +11 -10
- package/dist/features/async-preview.js.map +1 -1
- package/dist/features/combobox.js +1 -1
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +13 -13
- package/dist/features/data-view.js.map +1 -1
- package/dist/features/email-composer.js +237 -238
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +140 -146
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +167 -138
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +6 -7
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map.js +269 -260
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +375 -326
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +1 -1
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +1266 -1193
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +13 -13
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +8 -8
- package/dist/features/resource.js +69 -66
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +13 -13
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +3 -3
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +94 -95
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/{feedback-DZNL5Lg1.js → feedback-Dm4izqFn.js} +80 -79
- package/dist/feedback-Dm4izqFn.js.map +1 -0
- package/dist/{field-affordance-recipes-DjwGx8eM.js → field-affordance-recipes-DWcNcOjh.js} +4 -4
- package/dist/field-affordance-recipes-DWcNcOjh.js.map +1 -0
- package/dist/{filters-BcT-uoFy.js → filters-DzgSJpMK.js} +693 -645
- package/dist/filters-DzgSJpMK.js.map +1 -0
- package/dist/{form-field-CsgRmdit.js → form-field-BriWAXyg.js} +6 -6
- package/dist/{form-field-CsgRmdit.js.map → form-field-BriWAXyg.js.map} +1 -1
- package/dist/{form-sizing-NXgjkmBG.js → form-sizing-Bs2qFUeE.js} +4 -4
- package/dist/form-sizing-Bs2qFUeE.js.map +1 -0
- package/dist/{forms-BV5m5aQF.js → forms-C0RGnJTe.js} +17 -13
- package/dist/forms-C0RGnJTe.js.map +1 -0
- package/dist/{forms-numeric-Cd33AKbD.js → forms-numeric-DIhghX1Q.js} +86 -82
- package/dist/forms-numeric-DIhghX1Q.js.map +1 -0
- package/dist/{header-BA697l4a.js → header-DMMxG__r.js} +67 -63
- package/dist/header-DMMxG__r.js.map +1 -0
- package/dist/header.recipes-BigdJjw1.js +6 -0
- package/dist/header.recipes-BigdJjw1.js.map +1 -0
- package/dist/{hooks-BQ-L7Uu2.js → hooks-DB6CJ4MR.js} +26 -14
- package/dist/hooks-DB6CJ4MR.js.map +1 -0
- package/dist/{icon-badge-COWbCCWu.js → icon-badge-DZF-YjQp.js} +4 -4
- package/dist/{icon-badge-COWbCCWu.js.map → icon-badge-DZF-YjQp.js.map} +1 -1
- package/dist/index.js +4 -5
- package/dist/{input-Cdw4k0fb.js → input-CvyDQlY7.js} +8 -8
- package/dist/{input-Cdw4k0fb.js.map → input-CvyDQlY7.js.map} +1 -1
- package/dist/input-DMBwAZmr.js +21 -0
- package/dist/input-DMBwAZmr.js.map +1 -0
- package/dist/{item-BvZ2DR_x.js → item-DjCcM18E.js} +16 -16
- package/dist/item-DjCcM18E.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 +2 -2
- package/dist/layout/settings.js +1 -1
- package/dist/layout/sidebar.js +3 -3
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +11 -11
- package/dist/lib/affordance-geometry.generated.d.ts +35 -35
- package/dist/lib/control-group-recipes.d.ts +5 -5
- package/dist/lib/field-affordance-recipes.d.ts +2 -2
- package/dist/lib/motion-recipes.d.ts +3 -0
- package/dist/lib/navigation-row-recipes.d.ts +7 -7
- package/dist/lib/overlay-anatomy-recipes.d.ts +3 -3
- package/dist/lib/portal-recipes.d.ts +3 -0
- package/dist/lib/token-merge.generated.d.ts +13 -10
- package/dist/lib/utils.js +1 -1
- package/dist/map-demo-tile.svg +1 -1
- package/dist/{media-gallery-CSl5W1Fy.js → media-gallery-C-vChPmE.js} +6 -6
- package/dist/{media-gallery-CSl5W1Fy.js.map → media-gallery-C-vChPmE.js.map} +1 -1
- package/dist/{mentions-RKOQaaIB.js → mentions-0_4nWuI-.js} +10 -10
- package/dist/{mentions-RKOQaaIB.js.map → mentions-0_4nWuI-.js.map} +1 -1
- package/dist/{message-INU2xsxu.js → message-g8p7eVtN.js} +7 -7
- package/dist/message-g8p7eVtN.js.map +1 -0
- package/dist/{metadata-list-qVV7AVxa.js → metadata-list-C3MkU-Om.js} +64 -64
- package/dist/metadata-list-C3MkU-Om.js.map +1 -0
- package/dist/{motion-recipes-ChBg4HBq.js → motion-recipes-DitYv6P2.js} +10 -2
- package/dist/motion-recipes-DitYv6P2.js.map +1 -0
- package/dist/navigation-C90-oQFq.js +255 -0
- package/dist/navigation-C90-oQFq.js.map +1 -0
- package/dist/{navigation-BQNcg1jT.js → navigation-DaRjthVk.js} +101 -82
- package/dist/navigation-DaRjthVk.js.map +1 -0
- package/dist/{navigation-row-recipes-WZEs-hYo.js → navigation-row-recipes-BGVLvU_O.js} +9 -9
- package/dist/navigation-row-recipes-BGVLvU_O.js.map +1 -0
- package/dist/{number-E_OiIfJz.js → number-CRU3kGuk.js} +5 -5
- package/dist/{number-E_OiIfJz.js.map → number-CRU3kGuk.js.map} +1 -1
- package/dist/overflow-tab-bar-IVFVQFV6.js +172 -0
- package/dist/overflow-tab-bar-IVFVQFV6.js.map +1 -0
- package/dist/overlays-BSgCtM2v.js +1013 -0
- package/dist/overlays-BSgCtM2v.js.map +1 -0
- package/dist/page-DUUKDAjo.js +331 -0
- package/dist/page-DUUKDAjo.js.map +1 -0
- package/dist/page-header-commands-7P3sfE9u.js +193 -0
- package/dist/page-header-commands-7P3sfE9u.js.map +1 -0
- package/dist/{pagination-Ch8X_47u.js → pagination-CgCjElfu.js} +7 -7
- package/dist/{pagination-Ch8X_47u.js.map → pagination-CgCjElfu.js.map} +1 -1
- package/dist/popover-B85RenIl.js +201 -0
- package/dist/popover-B85RenIl.js.map +1 -0
- package/dist/{popover-menu-BYaCdFhf.js → popover-menu-DlnQ2zlR.js} +7 -7
- package/dist/{popover-menu-BYaCdFhf.js.map → popover-menu-DlnQ2zlR.js.map} +1 -1
- package/dist/{popover.recipes-D3j8R8Yp.js → popover.recipes-DdiEp0rd.js} +18 -11
- package/dist/popover.recipes-DdiEp0rd.js.map +1 -0
- package/dist/portal-recipes-BpsV_iRw.js +9 -0
- package/dist/portal-recipes-BpsV_iRw.js.map +1 -0
- package/dist/{primitives-Du64iDbb.js → primitives-ByWgGUgt.js} +5 -5
- package/dist/{primitives-Du64iDbb.js.map → primitives-ByWgGUgt.js.map} +1 -1
- package/dist/primitives.js +4 -4
- package/dist/{progress-BvF2oCdV.js → progress-BJhQP9WX.js} +9 -9
- package/dist/{progress-BvF2oCdV.js.map → progress-BJhQP9WX.js.map} +1 -1
- package/dist/{receipt-D789Jwyy.js → receipt-tOc7B3hw.js} +7 -7
- package/dist/receipt-tOc7B3hw.js.map +1 -0
- package/dist/{rich-text-CLJEf76s.js → rich-text-Dth5E882.js} +3 -3
- package/dist/{rich-text-CLJEf76s.js.map → rich-text-Dth5E882.js.map} +1 -1
- package/dist/{rich-text-editor-Cm1dpUpQ.js → rich-text-editor-C1fOjBTd.js} +429 -430
- package/dist/rich-text-editor-C1fOjBTd.js.map +1 -0
- package/dist/{rich-text-editor-toolbar-L__e4x47.js → rich-text-editor-toolbar-laT3tpBT.js} +32 -28
- package/dist/rich-text-editor-toolbar-laT3tpBT.js.map +1 -0
- package/dist/{scroll-area-La5RXsEk.js → scroll-area-B0dB2cBi.js} +2 -2
- package/dist/{scroll-area-La5RXsEk.js.map → scroll-area-B0dB2cBi.js.map} +1 -1
- package/dist/{separator-DAEV0w65.js → separator-Bb17I4pu.js} +2 -2
- package/dist/{separator-DAEV0w65.js.map → separator-Bb17I4pu.js.map} +1 -1
- package/dist/{separator-GNfPG-90.js → separator-Ct_WSWTJ.js} +3 -3
- package/dist/{separator-GNfPG-90.js.map → separator-Ct_WSWTJ.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/{settings-BA2iboic.js → settings-Bar5wiSo.js} +31 -38
- package/dist/settings-Bar5wiSo.js.map +1 -0
- package/dist/sheet-BGPERY55.js +250 -0
- package/dist/sheet-BGPERY55.js.map +1 -0
- package/dist/sidebar-D-JYMMbY.js +686 -0
- package/dist/sidebar-D-JYMMbY.js.map +1 -0
- package/dist/sidebar-f9gRWXIR.js +1001 -0
- package/dist/sidebar-f9gRWXIR.js.map +1 -0
- package/dist/skeleton-BapcJd9C.js +265 -0
- package/dist/skeleton-BapcJd9C.js.map +1 -0
- package/dist/smart-card-CW0hjetE.js +617 -0
- package/dist/smart-card-CW0hjetE.js.map +1 -0
- package/dist/{structure-C0V0_Fyf.js → structure-DuxKl954.js} +2 -2
- package/dist/{structure-C0V0_Fyf.js.map → structure-DuxKl954.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{table-CpvnzJn9.js → table-B4TE7iOV.js} +3 -3
- package/dist/{table-CpvnzJn9.js.map → table-B4TE7iOV.js.map} +1 -1
- package/dist/{table-DH7rozUv.js → table-CFOWY9pQ.js} +394 -388
- package/dist/table-CFOWY9pQ.js.map +1 -0
- package/dist/{tabs-eqVsJZWO.js → tabs-e7ko9S2o.js} +11 -11
- package/dist/tabs-e7ko9S2o.js.map +1 -0
- package/dist/{text-inputs-DXItiR0O.js → text-inputs-B1culiSK.js} +17 -17
- package/dist/text-inputs-B1culiSK.js.map +1 -0
- package/dist/theme.css +40 -37
- package/dist/{timelines-DmtztAY_.js → timelines-D3Sl9ueq.js} +13 -12
- package/dist/timelines-D3Sl9ueq.js.map +1 -0
- package/dist/tooltip-8wz5S_Zr.js +113 -0
- package/dist/tooltip-8wz5S_Zr.js.map +1 -0
- package/dist/{tree-CV11PURP.js → tree-CzUJHnFs.js} +8 -8
- package/dist/{tree-CV11PURP.js.map → tree-CzUJHnFs.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/{typography-CSyJrh28.js → typography-BQnine1k.js} +12 -12
- package/dist/{typography-CSyJrh28.js.map → typography-BQnine1k.js.map} +1 -1
- package/dist/typography.js +1 -1
- package/dist/ui-provider-C-74NVLc.js +178 -0
- package/dist/ui-provider-C-74NVLc.js.map +1 -0
- package/dist/ui-provider.js +2 -3
- package/dist/{upload-C9SA0X-8.js → upload-BOW6U2tI.js} +25 -24
- package/dist/upload-BOW6U2tI.js.map +1 -0
- package/dist/{upload-queue-DhQJiSRc.js → upload-queue-qUXn1ykN.js} +16 -14
- package/dist/upload-queue-qUXn1ykN.js.map +1 -0
- package/dist/{usage-card-DVTRDmGz.js → usage-card-BeSLY0i0.js} +24 -17
- package/dist/usage-card-BeSLY0i0.js.map +1 -0
- package/dist/{utils-CF3c95Io.js → utils-B6kKb8jB.js} +237 -141
- package/dist/utils-B6kKb8jB.js.map +1 -0
- package/dist/value-inputs-skdVB2zh.js +980 -0
- package/dist/value-inputs-skdVB2zh.js.map +1 -0
- package/dist/{value-typography-ClupF0Gz.js → value-typography-uAmWUAL1.js} +2 -2
- package/dist/{value-typography-ClupF0Gz.js.map → value-typography-uAmWUAL1.js.map} +1 -1
- package/dist/{workspace-9EFVXUyk.js → workspace-DHeHv0qw.js} +50 -49
- package/dist/workspace-DHeHv0qw.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +4 -3
- package/docs/consumer-skill/agents/themelia-ui-designer.md +96 -0
- package/docs/consumer-skill/examples/app-layout.tsx +52 -1
- package/docs/consumer-skill/examples/commerce-lines.tsx +271 -0
- package/docs/consumer-skill/examples/custom-composition.tsx +21 -0
- package/docs/consumer-skill/examples/detail.tsx +5 -4
- package/docs/consumer-skill/examples/editable-sections.tsx +38 -0
- package/docs/consumer-skill/examples/index-table.tsx +4 -4
- package/docs/consumer-skill/examples/manifest.json +38 -1
- package/docs/consumer-skill/examples/product-media.tsx +41 -0
- package/docs/consumer-skill/examples/product-parts.tsx +81 -0
- package/docs/consumer-skill/examples/rhf-edit-page.tsx +1 -1
- package/docs/consumer-skill/examples/rhf-overlay-form.tsx +24 -11
- package/docs/consumer-skill/examples/token-domain-structure.tsx +68 -0
- package/docs/consumer-skill/references/agents-md.md +19 -17
- package/docs/consumer-skill/references/analytics.md +18 -1
- package/docs/consumer-skill/references/commerce-composition.md +97 -0
- package/docs/consumer-skill/references/component-contracts.json +7131 -1754
- package/docs/consumer-skill/references/composition-mapping.md +17 -3
- package/docs/consumer-skill/references/composition.md +159 -31
- package/docs/consumer-skill/references/critique-rubric.md +98 -0
- package/docs/consumer-skill/references/custom-composition.md +261 -0
- package/docs/consumer-skill/references/data-reading.md +79 -0
- package/docs/consumer-skill/references/design-contract.md +11 -9
- package/docs/consumer-skill/references/discovery.md +27 -3
- package/docs/consumer-skill/references/domain-structures.md +124 -0
- package/docs/consumer-skill/references/installation.md +15 -4
- package/docs/consumer-skill/references/integration.md +35 -0
- package/docs/consumer-skill/references/product-composition.md +94 -0
- package/docs/consumer-skill/references/public-api.json +2881 -420
- package/docs/consumer-skill/references/review.md +39 -2
- package/docs/consumer-skill/references/rhf-workflows.md +7 -0
- package/docs/consumer-skill/references/screen-archetypes.md +19 -7
- package/docs/consumer-skill/references/screen-decisions.md +126 -0
- package/docs/consumer-skill/references/theming.md +17 -18
- package/docs/consumer-skill/references/tokens.json +9 -9
- package/docs/consumer-skill/references/view-craft.md +153 -0
- package/docs/consumer-skill/references/view-spec.md +73 -0
- package/docs/consumer-skill/references/workflows.md +7 -1
- package/docs/consumer-skill/scripts/composition-policy.mjs +39 -3
- package/docs/consumer-skill/scripts/composition-schema.mjs +1 -1
- package/docs/consumer-skill/scripts/composition.mjs +61 -5
- package/docs/consumer-skill/scripts/discovery.mjs +54 -0
- package/docs/consumer-skill/scripts/inspect-component.mjs +1 -1
- package/docs/consumer-skill/scripts/inspection.mjs +73 -18
- package/docs/consumer-skill/scripts/setup-skills.mjs +41 -6
- package/docs/consumer-skill/scripts/surface-policy.mjs +5 -5
- package/docs/consumer-skills/themelia-components/SKILL.md +14 -13
- package/docs/consumer-skills/themelia-composition/SKILL.md +16 -17
- package/docs/consumer-skills/themelia-design/SKILL.md +55 -0
- package/docs/consumer-skills/themelia-foundation/SKILL.md +2 -1
- package/docs/consumer-skills/themelia-tokenization/SKILL.md +24 -17
- package/package.json +1 -1
- package/dist/accordion-96o0pN62.js.map +0 -1
- package/dist/action-menu-CHgs8vmj.js.map +0 -1
- package/dist/affordance-geometry.generated-B8yGOr8-.js.map +0 -1
- package/dist/ai-artifact-BZUGwBq6.js.map +0 -1
- package/dist/app-shell-D63ATkIK.js +0 -237
- package/dist/app-shell-D63ATkIK.js.map +0 -1
- package/dist/auth-D2FVZ1MH.js.map +0 -1
- package/dist/avatar-DWO_HHhB.js.map +0 -1
- package/dist/base/cascader.js.map +0 -1
- package/dist/batch-action-bar-CdfIkCsV.js.map +0 -1
- package/dist/button-DkmK-z8E.js.map +0 -1
- package/dist/buttons-BbfzgczK.js.map +0 -1
- package/dist/cards-4JTWqvVe.js +0 -68
- package/dist/cards-4JTWqvVe.js.map +0 -1
- package/dist/chart-C19flDQb.js +0 -155
- package/dist/chart-C19flDQb.js.map +0 -1
- package/dist/choice-inputs-JLtij2y4.js.map +0 -1
- package/dist/code-block-CGNaUtAE.js.map +0 -1
- package/dist/combobox-CBJDs6w_.js.map +0 -1
- package/dist/combobox-hbhSS18O.js +0 -355
- package/dist/combobox-hbhSS18O.js.map +0 -1
- package/dist/command-D8NrBj-b.js.map +0 -1
- package/dist/containers-CRmHf7GP.js.map +0 -1
- package/dist/control-group-recipes-DBXmfh2E.js.map +0 -1
- package/dist/data-display-D4oujtx0.js.map +0 -1
- package/dist/date-picker-zOt1oNss.js.map +0 -1
- package/dist/dropdown-menu-CjY8Vt7W.js +0 -193
- package/dist/dropdown-menu-CjY8Vt7W.js.map +0 -1
- package/dist/feedback-DZNL5Lg1.js.map +0 -1
- package/dist/field-affordance-recipes-DjwGx8eM.js.map +0 -1
- package/dist/filters-BcT-uoFy.js.map +0 -1
- package/dist/form-sizing-NXgjkmBG.js.map +0 -1
- package/dist/forms-BV5m5aQF.js.map +0 -1
- package/dist/forms-numeric-Cd33AKbD.js.map +0 -1
- package/dist/header-BA697l4a.js.map +0 -1
- package/dist/hooks-BQ-L7Uu2.js.map +0 -1
- package/dist/input-DOPL5_QE.js +0 -21
- package/dist/input-DOPL5_QE.js.map +0 -1
- package/dist/item-BvZ2DR_x.js.map +0 -1
- package/dist/message-INU2xsxu.js.map +0 -1
- package/dist/metadata-list-qVV7AVxa.js.map +0 -1
- package/dist/motion-recipes-ChBg4HBq.js.map +0 -1
- package/dist/navigation-BQNcg1jT.js.map +0 -1
- package/dist/navigation-DLF3E1IC.js +0 -145
- package/dist/navigation-DLF3E1IC.js.map +0 -1
- package/dist/navigation-row-recipes-WZEs-hYo.js.map +0 -1
- package/dist/overflow-tab-bar-CrbqMteP.js +0 -284
- package/dist/overflow-tab-bar-CrbqMteP.js.map +0 -1
- package/dist/overlays-BlKynmde.js +0 -1004
- package/dist/overlays-BlKynmde.js.map +0 -1
- package/dist/page-CIwNUtGr.js +0 -227
- package/dist/page-CIwNUtGr.js.map +0 -1
- package/dist/page-header-commands-DFMlNYzN.js +0 -128
- package/dist/page-header-commands-DFMlNYzN.js.map +0 -1
- package/dist/popover-uwzX2vo7.js +0 -198
- package/dist/popover-uwzX2vo7.js.map +0 -1
- package/dist/popover.recipes-D3j8R8Yp.js.map +0 -1
- package/dist/receipt-D789Jwyy.js.map +0 -1
- package/dist/rich-text-editor-Cm1dpUpQ.js.map +0 -1
- package/dist/rich-text-editor-toolbar-L__e4x47.js.map +0 -1
- package/dist/settings-BA2iboic.js.map +0 -1
- package/dist/sheet-DoAxTb2J.js +0 -213
- package/dist/sheet-DoAxTb2J.js.map +0 -1
- package/dist/sidebar-ByqKR_W5.js +0 -512
- package/dist/sidebar-ByqKR_W5.js.map +0 -1
- package/dist/sidebar-D2iSnGJ7.js +0 -619
- package/dist/sidebar-D2iSnGJ7.js.map +0 -1
- package/dist/skeleton-CUj8O5Bd.js +0 -264
- package/dist/skeleton-CUj8O5Bd.js.map +0 -1
- package/dist/smart-card-CqkzQsK-.js +0 -614
- package/dist/smart-card-CqkzQsK-.js.map +0 -1
- package/dist/table-DH7rozUv.js.map +0 -1
- package/dist/tabs-eqVsJZWO.js.map +0 -1
- package/dist/text-inputs-DXItiR0O.js.map +0 -1
- package/dist/theme-scope-BJ6eE2xt.js +0 -50
- package/dist/theme-scope-BJ6eE2xt.js.map +0 -1
- package/dist/timelines-DmtztAY_.js.map +0 -1
- package/dist/tooltip-B4hjKtoV.js +0 -111
- package/dist/tooltip-B4hjKtoV.js.map +0 -1
- package/dist/ui-provider-CQCuCBcy.js +0 -136
- package/dist/ui-provider-CQCuCBcy.js.map +0 -1
- package/dist/upload-C9SA0X-8.js.map +0 -1
- package/dist/upload-queue-DhQJiSRc.js.map +0 -1
- package/dist/usage-card-DVTRDmGz.js.map +0 -1
- package/dist/use-mobile-vaLKwgyf.js +0 -15
- package/dist/use-mobile-vaLKwgyf.js.map +0 -1
- package/dist/utils-CF3c95Io.js.map +0 -1
- package/dist/value-inputs-C0o70p-U.js +0 -980
- package/dist/value-inputs-C0o70p-U.js.map +0 -1
- package/dist/workspace-9EFVXUyk.js.map +0 -1
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
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-B6kKb8jB.js";
|
|
5
|
+
import { n as i } from "./buttons-BedGfygC.js";
|
|
6
|
+
import { a, c as o, o as s } from "./typography-BQnine1k.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-DuxKl954.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 } from "./popover.recipes-
|
|
12
|
-
import { _ as
|
|
13
|
-
import { t as v } from "./number-
|
|
14
|
-
import { n as y, t as b } from "./date-
|
|
15
|
-
import { t as x } from "./badge-
|
|
10
|
+
import { n as f, t as p } from "./feedback-Dm4izqFn.js";
|
|
11
|
+
import { i as m, r as h } from "./popover.recipes-DdiEp0rd.js";
|
|
12
|
+
import { _ as g, m as _ } from "./primitives-ByWgGUgt.js";
|
|
13
|
+
import { t as v } from "./number-CRU3kGuk.js";
|
|
14
|
+
import { n as y, t as b } from "./date-Cq8ioE4o.js";
|
|
15
|
+
import { t as x } from "./badge-xIiV_E7f.js";
|
|
16
16
|
import { t as S } from "./layer-recipes-CCpklYME.js";
|
|
17
|
-
import { n as C } from "./field-affordance-recipes-
|
|
18
|
-
import { a as w, i as T, n as E, o as D, r as O, s as k, t as A } from "./command-
|
|
19
|
-
import { d as j, p as M, y as N } from "./form-sizing-
|
|
20
|
-
import { t as P } from "./input-
|
|
21
|
-
import { t as F } from "./date-picker-
|
|
22
|
-
import { a as
|
|
23
|
-
import { n as
|
|
24
|
-
import { i as
|
|
25
|
-
import { t as
|
|
26
|
-
import { t as
|
|
27
|
-
import { t as
|
|
28
|
-
import
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
17
|
+
import { n as C } from "./field-affordance-recipes-DWcNcOjh.js";
|
|
18
|
+
import { a as w, i as T, n as E, o as D, r as O, s as k, t as A } from "./command-CrlPIL6m.js";
|
|
19
|
+
import { d as j, p as M, y as N } from "./form-sizing-Bs2qFUeE.js";
|
|
20
|
+
import { t as P } from "./input-CvyDQlY7.js";
|
|
21
|
+
import { t as F } from "./date-picker-RlIzKom_.js";
|
|
22
|
+
import { a as ee, c as I, i as te, n as L, o as ne, r as R, t as re } from "./popover-B85RenIl.js";
|
|
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-e7ko9S2o.js";
|
|
25
|
+
import { t as ue } from "./popover-menu-DlnQ2zlR.js";
|
|
26
|
+
import { t as de } from "./use-debounced-callback-Cx1h-hdv.js";
|
|
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-B1MiqkBq.js";
|
|
29
|
+
import z, { Component as _e, createContext as ve, useCallback as B, useContext as ye, useEffect as V, useId as be, useMemo as H, useRef as U, useState as W } from "react";
|
|
30
|
+
import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
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 J, parse as je } from "date-fns";
|
|
32
33
|
//#region src/components/features/filters/filters.strings.ts
|
|
33
|
-
var
|
|
34
|
+
var Me = {
|
|
34
35
|
loading: "Loading",
|
|
35
36
|
loadingOptions: "Loading {filterLabel} options...",
|
|
36
37
|
addFilter: "Add filter",
|
|
@@ -72,6 +73,8 @@ var Ee = {
|
|
|
72
73
|
activeFilters: "Active filters",
|
|
73
74
|
clearSearch: "Clear search",
|
|
74
75
|
backToFilters: "Back to filters",
|
|
76
|
+
previousLevel: "Back",
|
|
77
|
+
selectCurrentLevel: "Select this level",
|
|
75
78
|
select: "Select",
|
|
76
79
|
options: "options",
|
|
77
80
|
operator: "Operator",
|
|
@@ -109,20 +112,20 @@ var Ee = {
|
|
|
109
112
|
invalidFormat: "Invalid format"
|
|
110
113
|
}
|
|
111
114
|
};
|
|
112
|
-
function
|
|
115
|
+
function Y(e, t) {
|
|
113
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]));
|
|
114
117
|
}
|
|
115
|
-
function
|
|
118
|
+
function Ne(e, t, n) {
|
|
116
119
|
let r = t.split("."), i = e;
|
|
117
120
|
for (let e of r) {
|
|
118
121
|
if (typeof i != "object" || !i) return t;
|
|
119
122
|
i = i[e];
|
|
120
123
|
}
|
|
121
|
-
return typeof i == "string" ? n ?
|
|
124
|
+
return typeof i == "string" ? n ? Y(i, n) : i : t;
|
|
122
125
|
}
|
|
123
126
|
//#endregion
|
|
124
127
|
//#region src/components/features/filters/filters.types.ts
|
|
125
|
-
var
|
|
128
|
+
var X = {
|
|
126
129
|
SELECT: "select",
|
|
127
130
|
MULTI_SELECT: "multi_select",
|
|
128
131
|
ASYNC_SELECT: "async_select",
|
|
@@ -130,7 +133,7 @@ var Z = {
|
|
|
130
133
|
RANGE: "range",
|
|
131
134
|
DATE: "date",
|
|
132
135
|
TAGS: "tags"
|
|
133
|
-
},
|
|
136
|
+
}, Z = {
|
|
134
137
|
EQUALS: "equals",
|
|
135
138
|
CONTAINS: "contains",
|
|
136
139
|
IN: "in",
|
|
@@ -147,112 +150,140 @@ var Z = {
|
|
|
147
150
|
HAS_ANY: "has_any",
|
|
148
151
|
HAS_ALL: "has_all"
|
|
149
152
|
};
|
|
150
|
-
function
|
|
153
|
+
function Pe(e) {
|
|
151
154
|
return e;
|
|
152
155
|
}
|
|
153
156
|
//#endregion
|
|
154
157
|
//#region src/components/features/filters/operator-options.ts
|
|
155
|
-
function
|
|
158
|
+
function Fe(e) {
|
|
156
159
|
return [
|
|
157
160
|
{
|
|
158
161
|
label: e.contains,
|
|
159
|
-
value:
|
|
162
|
+
value: Z.CONTAINS
|
|
160
163
|
},
|
|
161
164
|
{
|
|
162
165
|
label: e.equals,
|
|
163
|
-
value:
|
|
166
|
+
value: Z.EQUALS
|
|
164
167
|
},
|
|
165
168
|
{
|
|
166
169
|
label: e.notContains,
|
|
167
|
-
value:
|
|
170
|
+
value: Z.NOT
|
|
168
171
|
}
|
|
169
172
|
];
|
|
170
173
|
}
|
|
171
|
-
function
|
|
174
|
+
function Ie(e) {
|
|
172
175
|
return [{
|
|
173
176
|
label: e.is,
|
|
174
|
-
value:
|
|
177
|
+
value: Z.EQUALS
|
|
175
178
|
}, {
|
|
176
179
|
label: e.isNot,
|
|
177
|
-
value:
|
|
180
|
+
value: Z.NOT
|
|
178
181
|
}];
|
|
179
182
|
}
|
|
180
|
-
function
|
|
183
|
+
function Le(e) {
|
|
181
184
|
return [
|
|
182
185
|
{
|
|
183
186
|
label: e.equals,
|
|
184
|
-
value:
|
|
187
|
+
value: Z.EQUALS
|
|
185
188
|
},
|
|
186
189
|
{
|
|
187
190
|
label: e.greaterThan,
|
|
188
|
-
value:
|
|
191
|
+
value: Z.GT
|
|
189
192
|
},
|
|
190
193
|
{
|
|
191
194
|
label: e.lessThan,
|
|
192
|
-
value:
|
|
195
|
+
value: Z.LT
|
|
193
196
|
}
|
|
194
197
|
];
|
|
195
198
|
}
|
|
196
|
-
function
|
|
199
|
+
function Re(e) {
|
|
197
200
|
return [
|
|
198
201
|
{
|
|
199
202
|
label: e.before,
|
|
200
|
-
value:
|
|
203
|
+
value: Z.BEFORE
|
|
201
204
|
},
|
|
202
205
|
{
|
|
203
206
|
label: e.after,
|
|
204
|
-
value:
|
|
207
|
+
value: Z.AFTER
|
|
205
208
|
},
|
|
206
209
|
{
|
|
207
210
|
label: e.between,
|
|
208
|
-
value:
|
|
211
|
+
value: Z.BETWEEN
|
|
209
212
|
}
|
|
210
213
|
];
|
|
211
214
|
}
|
|
212
|
-
function
|
|
215
|
+
function ze(e) {
|
|
213
216
|
return [{
|
|
214
217
|
label: e.equals,
|
|
215
|
-
value:
|
|
218
|
+
value: Z.EQUALS
|
|
216
219
|
}];
|
|
217
220
|
}
|
|
218
|
-
function
|
|
221
|
+
function Be(e, t) {
|
|
219
222
|
switch (e) {
|
|
220
|
-
case
|
|
221
|
-
case
|
|
223
|
+
case X.SEARCH: return Fe(t);
|
|
224
|
+
case X.TAGS: return [
|
|
222
225
|
{
|
|
223
226
|
label: t.has,
|
|
224
|
-
value:
|
|
227
|
+
value: Z.HAS
|
|
225
228
|
},
|
|
226
229
|
{
|
|
227
230
|
label: t.hasAny,
|
|
228
|
-
value:
|
|
231
|
+
value: Z.HAS_ANY
|
|
229
232
|
},
|
|
230
233
|
{
|
|
231
234
|
label: t.hasAll,
|
|
232
|
-
value:
|
|
235
|
+
value: Z.HAS_ALL
|
|
233
236
|
}
|
|
234
237
|
];
|
|
235
|
-
case
|
|
236
|
-
case
|
|
237
|
-
case
|
|
238
|
-
case
|
|
239
|
-
default: return
|
|
238
|
+
case X.SELECT:
|
|
239
|
+
case X.ASYNC_SELECT: return Ie(t);
|
|
240
|
+
case X.RANGE: return Le(t);
|
|
241
|
+
case X.DATE: return Re(t);
|
|
242
|
+
default: return Fe(t);
|
|
240
243
|
}
|
|
241
244
|
}
|
|
242
|
-
function
|
|
245
|
+
function Ve(e) {
|
|
243
246
|
switch (e) {
|
|
244
|
-
case
|
|
245
|
-
case
|
|
246
|
-
case
|
|
247
|
-
case
|
|
248
|
-
case
|
|
249
|
-
case
|
|
250
|
-
default: return
|
|
247
|
+
case X.SEARCH: return Z.CONTAINS;
|
|
248
|
+
case X.TAGS: return Z.HAS;
|
|
249
|
+
case X.SELECT:
|
|
250
|
+
case X.ASYNC_SELECT: return Z.EQUALS;
|
|
251
|
+
case X.RANGE: return Z.EQUALS;
|
|
252
|
+
case X.DATE: return Z.BEFORE;
|
|
253
|
+
default: return Z.EQUALS;
|
|
251
254
|
}
|
|
252
255
|
}
|
|
253
256
|
//#endregion
|
|
254
257
|
//#region src/components/features/filters/utils/filter-utils.ts
|
|
255
|
-
function
|
|
258
|
+
function He(e, t) {
|
|
259
|
+
for (let n of e ?? []) {
|
|
260
|
+
if (n.value === t) return [n];
|
|
261
|
+
let e = He(n.children, t);
|
|
262
|
+
if (e.length) return [n, ...e];
|
|
263
|
+
}
|
|
264
|
+
return [];
|
|
265
|
+
}
|
|
266
|
+
function Q(e) {
|
|
267
|
+
return e.replace(/\S+/g, (e) => /^\p{Lu}{2,}/u.test(e) ? e : e.toLowerCase());
|
|
268
|
+
}
|
|
269
|
+
function Ue(e) {
|
|
270
|
+
return !!e?.some((e) => !!e.children?.length);
|
|
271
|
+
}
|
|
272
|
+
function We(e) {
|
|
273
|
+
return e.map((e) => ({
|
|
274
|
+
value: e.value,
|
|
275
|
+
label: e.label,
|
|
276
|
+
description: e.description,
|
|
277
|
+
icon: e.icon ?? void 0,
|
|
278
|
+
disabled: e.disabled,
|
|
279
|
+
...e.children?.length ? { children: We(e.children) } : {}
|
|
280
|
+
}));
|
|
281
|
+
}
|
|
282
|
+
function Ge(e, t, n = " / ") {
|
|
283
|
+
let r = He(e.options, t);
|
|
284
|
+
return r.length ? r.map((e) => e.label).join(n) : void 0;
|
|
285
|
+
}
|
|
286
|
+
function Ke(e, t, n) {
|
|
256
287
|
if (e.type === "date" && Array.isArray(t) && t.every((e) => typeof e == "string")) return !0;
|
|
257
288
|
if (e.validation?.required && (!t || Array.isArray(t) && t.length === 0)) return n("validation.required");
|
|
258
289
|
if (typeof t == "number") {
|
|
@@ -268,14 +299,14 @@ function Ie(e, t, n) {
|
|
|
268
299
|
}
|
|
269
300
|
//#endregion
|
|
270
301
|
//#region src/components/features/filters/filter-context.tsx
|
|
271
|
-
var
|
|
272
|
-
function
|
|
273
|
-
let c =
|
|
302
|
+
var qe = ve(void 0);
|
|
303
|
+
function Je({ children: e, filters: t, activeFilters: r, onFilterChange: i, navigating: a = !1, strings: o, onError: s }) {
|
|
304
|
+
let c = U(t), l = U(i), u = U(s);
|
|
274
305
|
u.current = s;
|
|
275
|
-
let [d, f] =
|
|
306
|
+
let [d, f] = W(0), p = U(/* @__PURE__ */ new Map()), m = H(() => {
|
|
276
307
|
let e = /* @__PURE__ */ new Map();
|
|
277
308
|
for (let n of t) {
|
|
278
|
-
if (n.type !==
|
|
309
|
+
if (n.type !== X.ASYNC_SELECT) continue;
|
|
279
310
|
let t = n.asyncConfig?.fetcher, r = n.asyncConfig?.mapToOption, i = n.asyncConfig?.limit ?? 10, a = p.current.get(n.key), o = a && a.fetcher === t && a.mapToOption === r;
|
|
280
311
|
e.set(n.key, o && a.limit === i ? a : {
|
|
281
312
|
fetcher: t,
|
|
@@ -285,34 +316,34 @@ function Re({ children: e, filters: t, activeFilters: r, onFilterChange: i, navi
|
|
|
285
316
|
});
|
|
286
317
|
}
|
|
287
318
|
return e.size === p.current.size && [...e].every(([e, t]) => p.current.get(e) === t) ? p.current : (p.current = e, e);
|
|
288
|
-
}, [t]), h = JSON.stringify(r.filter((e) => m.has(e.key)).map(({ key: e, value: t }) => [e, t])), g = n(
|
|
289
|
-
|
|
319
|
+
}, [t]), h = JSON.stringify(r.filter((e) => m.has(e.key)).map(({ key: e, value: t }) => [e, t])), g = n(Me, o);
|
|
320
|
+
V(() => {
|
|
290
321
|
c.current = t;
|
|
291
|
-
}, [t]),
|
|
322
|
+
}, [t]), V(() => {
|
|
292
323
|
l.current = i;
|
|
293
324
|
}, [i]);
|
|
294
|
-
let _ =
|
|
325
|
+
let _ = B((e) => {
|
|
295
326
|
let t = [...r, e];
|
|
296
327
|
l.current(t);
|
|
297
|
-
}, [r]), v =
|
|
328
|
+
}, [r]), v = B((e) => {
|
|
298
329
|
let t = r.filter((t) => t.id !== e && t.key !== e);
|
|
299
330
|
l.current(t);
|
|
300
|
-
}, [r]), y =
|
|
331
|
+
}, [r]), y = B((e, t) => {
|
|
301
332
|
let n = r.map((n) => n.id === e || n.key === e ? {
|
|
302
333
|
...n,
|
|
303
334
|
...t
|
|
304
335
|
} : n);
|
|
305
336
|
l.current(n);
|
|
306
|
-
}, [r]), b =
|
|
337
|
+
}, [r]), b = B(() => {
|
|
307
338
|
l.current([]);
|
|
308
|
-
}, []), x =
|
|
339
|
+
}, []), x = B((e) => {
|
|
309
340
|
l.current(e);
|
|
310
|
-
}, []), S =
|
|
341
|
+
}, []), S = B((e) => c.current.find((t) => t.key === e), []), C = B((e) => r.find((t) => t.key === e)?.value || [], [r]), w = B((e, t) => {
|
|
311
342
|
let n = r.find((t) => t.key === e);
|
|
312
343
|
if (t.length === 0) n && v(e);
|
|
313
344
|
else if (n) y(e, { value: t });
|
|
314
345
|
else {
|
|
315
|
-
let n = c.current.find((t) => t.key === e), r = n?.operator ?? n?.operators?.[0]?.value ?? (n ?
|
|
346
|
+
let n = c.current.find((t) => t.key === e), r = n?.operator ?? n?.operators?.[0]?.value ?? (n ? Ve(n.type) : "equals");
|
|
316
347
|
_({
|
|
317
348
|
id: e,
|
|
318
349
|
key: e,
|
|
@@ -325,21 +356,21 @@ function Re({ children: e, filters: t, activeFilters: r, onFilterChange: i, navi
|
|
|
325
356
|
_,
|
|
326
357
|
v,
|
|
327
358
|
y
|
|
328
|
-
]), T =
|
|
359
|
+
]), T = B((e) => r.some((t) => t.key === e && t.value.length > 0), [r]), E = B((e) => r.find((t) => t.key === e)?.operator || "equals", [r]), D = B((e, t) => {
|
|
329
360
|
r.find((t) => t.key === e) && y(e, { operator: t });
|
|
330
|
-
}, [r, y]), O =
|
|
361
|
+
}, [r, y]), O = B((e, t) => {
|
|
331
362
|
let n = c.current.find((t) => t.key === e);
|
|
332
|
-
return n ?
|
|
333
|
-
}, [g]), k =
|
|
363
|
+
return n ? Ke(n, t, (e) => Ne(g, e)) : !1;
|
|
364
|
+
}, [g]), k = B((e) => c.current.filter((t) => t.dependencies?.some((t) => t.key === e)), []), A = B((e, t) => {
|
|
334
365
|
let n = m.get(e)?.options;
|
|
335
366
|
if (!n) return;
|
|
336
367
|
let r = !1;
|
|
337
368
|
for (let e of t) n.get(e.value)?.label !== e.label && (r = !0), n.set(e.value, e);
|
|
338
369
|
r && f((e) => e + 1);
|
|
339
|
-
}, [m]), j =
|
|
370
|
+
}, [m]), j = B((e, t) => m.get(e)?.options.get(t)?.label, [m, d]), M = B((e, t) => {
|
|
340
371
|
u.current?.(e, t);
|
|
341
372
|
}, []);
|
|
342
|
-
|
|
373
|
+
V(() => {
|
|
343
374
|
let e = new AbortController(), t = (t, n) => {
|
|
344
375
|
e.signal.aborted || t && t.name === "AbortError" || u.current?.(t, {
|
|
345
376
|
phase: "fetch-options",
|
|
@@ -364,7 +395,7 @@ function Re({ children: e, filters: t, activeFilters: r, onFilterChange: i, navi
|
|
|
364
395
|
m,
|
|
365
396
|
A
|
|
366
397
|
]);
|
|
367
|
-
let N =
|
|
398
|
+
let N = H(() => ({
|
|
368
399
|
activeFilters: r,
|
|
369
400
|
filters: t,
|
|
370
401
|
addFilter: _,
|
|
@@ -407,28 +438,28 @@ function Re({ children: e, filters: t, activeFilters: r, onFilterChange: i, navi
|
|
|
407
438
|
j,
|
|
408
439
|
M
|
|
409
440
|
]);
|
|
410
|
-
return /* @__PURE__ */
|
|
441
|
+
return /* @__PURE__ */ K(qe.Provider, {
|
|
411
442
|
value: N,
|
|
412
443
|
children: e
|
|
413
444
|
});
|
|
414
445
|
}
|
|
415
446
|
function $() {
|
|
416
|
-
let e =
|
|
447
|
+
let e = ye(qe);
|
|
417
448
|
if (!e) throw Error("useFilters must be used within a FilterProvider");
|
|
418
449
|
return e;
|
|
419
450
|
}
|
|
420
451
|
//#endregion
|
|
421
452
|
//#region src/components/features/filters/hooks/use-filter-groups.ts
|
|
422
|
-
function
|
|
423
|
-
let { dynamicFilterOptions: t } = e, { filters: n, isFilterActive: r } = $(), i =
|
|
453
|
+
function Ye(e = {}) {
|
|
454
|
+
let { dynamicFilterOptions: t } = e, { filters: n, isFilterActive: r } = $(), i = H(() => t ? n.map((e) => {
|
|
424
455
|
let n = t[e.key];
|
|
425
456
|
return Array.isArray(n) ? {
|
|
426
457
|
...e,
|
|
427
458
|
options: n
|
|
428
459
|
} : e;
|
|
429
460
|
}) : n, [n, t]);
|
|
430
|
-
return
|
|
431
|
-
let e = i.filter((e) => e.type ===
|
|
461
|
+
return H(() => {
|
|
462
|
+
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);
|
|
432
463
|
return {
|
|
433
464
|
processedFilters: i,
|
|
434
465
|
searchFilters: e,
|
|
@@ -442,14 +473,14 @@ function ze(e = {}) {
|
|
|
442
473
|
}
|
|
443
474
|
//#endregion
|
|
444
475
|
//#region src/components/features/filters/partials/filter-operator-select.tsx
|
|
445
|
-
function
|
|
446
|
-
let [c, l] =
|
|
447
|
-
return /* @__PURE__ */
|
|
476
|
+
function Xe({ operator: e, operators: t, onOperatorChange: n, segmentResetClass: a }) {
|
|
477
|
+
let [c, l] = W(!1), { strings: u } = $(), d = t.find((t) => t.value === e)?.label || e;
|
|
478
|
+
return /* @__PURE__ */ K(ue, {
|
|
448
479
|
open: c,
|
|
449
480
|
onOpenChange: l,
|
|
450
481
|
search: !1,
|
|
451
482
|
contentLabel: u.operator,
|
|
452
|
-
trigger: /* @__PURE__ */
|
|
483
|
+
trigger: /* @__PURE__ */ K(i, {
|
|
453
484
|
tone: "secondary",
|
|
454
485
|
buttonStyle: "ghost",
|
|
455
486
|
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"),
|
|
@@ -457,13 +488,13 @@ function Be({ operator: e, operators: t, onOperatorChange: n, segmentResetClass:
|
|
|
457
488
|
e.stopPropagation();
|
|
458
489
|
},
|
|
459
490
|
type: "button",
|
|
460
|
-
children: /* @__PURE__ */
|
|
491
|
+
children: /* @__PURE__ */ K(o, {
|
|
461
492
|
tag: "span",
|
|
462
493
|
type: "inherit",
|
|
463
494
|
children: d
|
|
464
495
|
})
|
|
465
496
|
}),
|
|
466
|
-
header: /* @__PURE__ */
|
|
497
|
+
header: /* @__PURE__ */ K(s, {
|
|
467
498
|
tag: "span",
|
|
468
499
|
children: u.operator
|
|
469
500
|
}),
|
|
@@ -480,130 +511,130 @@ function Be({ operator: e, operators: t, onOperatorChange: n, segmentResetClass:
|
|
|
480
511
|
}
|
|
481
512
|
//#endregion
|
|
482
513
|
//#region src/components/features/filters/partials/filter-value-display.tsx
|
|
483
|
-
function
|
|
514
|
+
function Ze({ filter: e, value: t }) {
|
|
484
515
|
let { strings: n } = $();
|
|
485
|
-
return t.length === 0 && e.type !==
|
|
516
|
+
return t.length === 0 && e.type !== X.DATE ? /* @__PURE__ */ K(o, {
|
|
486
517
|
tag: "span",
|
|
487
518
|
type: "secondary",
|
|
488
519
|
lineHeight: "none",
|
|
489
520
|
className: "filter-value-display--component",
|
|
490
521
|
children: n.nothingSelected
|
|
491
|
-
}) : e.type ===
|
|
522
|
+
}) : e.type === X.ASYNC_SELECT && !e.options?.length ? /* @__PURE__ */ K(o, {
|
|
492
523
|
tag: "span",
|
|
493
524
|
type: "inherit",
|
|
494
525
|
weight: "semibold",
|
|
495
526
|
lineHeight: "none",
|
|
496
527
|
className: "filter-value-display--component",
|
|
497
|
-
children:
|
|
498
|
-
}) : e.options && e.type !==
|
|
528
|
+
children: $e(e, t, n)
|
|
529
|
+
}) : e.options && e.type !== X.DATE ? /* @__PURE__ */ q(u, {
|
|
499
530
|
direction: "horizontal",
|
|
500
531
|
gap: "xs",
|
|
501
532
|
wrap: !1,
|
|
502
533
|
className: "filter-value-display--component",
|
|
503
|
-
children: [/* @__PURE__ */
|
|
534
|
+
children: [/* @__PURE__ */ q("div", {
|
|
504
535
|
className: "relative isolate flex",
|
|
505
536
|
children: [t.slice(0, 2).map((t, n) => {
|
|
506
|
-
let i = e.options
|
|
507
|
-
return i?.icon ? /* @__PURE__ */
|
|
537
|
+
let i = He(e.options, t).at(-1);
|
|
538
|
+
return i?.icon ? /* @__PURE__ */ K("div", {
|
|
508
539
|
className: r("border-background bg-background relative rounded-full border", n > 0 ? "-ml-space-sm z-[1]" : S.raised),
|
|
509
540
|
children: i.icon
|
|
510
541
|
}, t) : null;
|
|
511
|
-
}), t.length > 2 && /* @__PURE__ */
|
|
542
|
+
}), t.length > 2 && /* @__PURE__ */ K("div", {
|
|
512
543
|
className: "bg-muted border-background relative z-0 -ml-space-sm flex size-icon items-center justify-center rounded-full border",
|
|
513
|
-
children: /* @__PURE__ */
|
|
544
|
+
children: /* @__PURE__ */ q(o, {
|
|
514
545
|
tag: "span",
|
|
515
546
|
size: "xs",
|
|
516
547
|
weight: "medium",
|
|
517
|
-
children: ["+", /* @__PURE__ */
|
|
548
|
+
children: ["+", /* @__PURE__ */ K(v, {
|
|
518
549
|
value: t.length - 2,
|
|
519
550
|
size: "inherit",
|
|
520
551
|
align: "center"
|
|
521
552
|
})]
|
|
522
553
|
})
|
|
523
554
|
})]
|
|
524
|
-
}), /* @__PURE__ */
|
|
555
|
+
}), /* @__PURE__ */ K(o, {
|
|
525
556
|
tag: "span",
|
|
526
557
|
type: "inherit",
|
|
527
558
|
weight: "semibold",
|
|
528
559
|
lineHeight: "none",
|
|
529
560
|
className: "truncate",
|
|
530
|
-
children:
|
|
561
|
+
children: et(e, t, n)
|
|
531
562
|
})]
|
|
532
|
-
}) : e.type ===
|
|
563
|
+
}) : e.type === X.DATE ? /* @__PURE__ */ q(u, {
|
|
533
564
|
direction: "horizontal",
|
|
534
565
|
gap: "xs",
|
|
535
566
|
wrap: !1,
|
|
536
567
|
className: "filter-value-display--component",
|
|
537
|
-
children: [/* @__PURE__ */
|
|
568
|
+
children: [/* @__PURE__ */ K(xe, { className: "text-muted-foreground size-icon-sm" }), /* @__PURE__ */ K(o, {
|
|
538
569
|
tag: "span",
|
|
539
570
|
type: "inherit",
|
|
540
571
|
weight: "semibold",
|
|
541
572
|
lineHeight: "none",
|
|
542
573
|
className: "min-w-0 truncate",
|
|
543
|
-
children:
|
|
574
|
+
children: Qe(e, t, n)
|
|
544
575
|
})]
|
|
545
|
-
}) : /* @__PURE__ */
|
|
576
|
+
}) : /* @__PURE__ */ K(o, {
|
|
546
577
|
tag: "span",
|
|
547
578
|
type: "inherit",
|
|
548
579
|
weight: "semibold",
|
|
549
580
|
lineHeight: "none",
|
|
550
581
|
className: "filter-value-display--component truncate",
|
|
551
|
-
children:
|
|
582
|
+
children: et(e, t, n)
|
|
552
583
|
});
|
|
553
584
|
}
|
|
554
|
-
function
|
|
555
|
-
return e.operator === "between" && t.length === 2 ?
|
|
585
|
+
function Qe(e, t, n) {
|
|
586
|
+
return e.operator === "between" && t.length === 2 ? rt(t[0], t[1], e.dateFormat?.display) : t.length === 1 ? nt(t[0], e.dateFormat?.display) : t.length === 2 ? rt(t[0], t[1], e.dateFormat?.display) : /* @__PURE__ */ K(g, { children: e.datePickerConfig?.noDatePlaceholder || n.calendar.notDateSelected });
|
|
556
587
|
}
|
|
557
|
-
function
|
|
558
|
-
return t.length === 0 ? "" :
|
|
588
|
+
function $e(e, t, n) {
|
|
589
|
+
return t.length === 0 ? "" : Y(n.selected, {
|
|
559
590
|
count: t.length,
|
|
560
|
-
filterLabel: (t.length > 1 ? e.pluralLabel : e.label) ?? e.label
|
|
591
|
+
filterLabel: Q((t.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
561
592
|
});
|
|
562
593
|
}
|
|
563
|
-
function
|
|
564
|
-
return t.length > 1 ?
|
|
594
|
+
function et(e, t, n) {
|
|
595
|
+
return t.length > 1 ? Y(n.selected, {
|
|
565
596
|
count: t.length,
|
|
566
|
-
filterLabel: e.pluralLabel ?? e.label
|
|
567
|
-
}) : t.map((t) =>
|
|
597
|
+
filterLabel: Q(e.pluralLabel ?? e.label)
|
|
598
|
+
}) : t.map((t) => Ge(e, t) || t).join(", ");
|
|
568
599
|
}
|
|
569
|
-
function
|
|
600
|
+
function tt(e) {
|
|
570
601
|
let t = new Date(e);
|
|
571
602
|
return !Number.isNaN(t.getTime());
|
|
572
603
|
}
|
|
573
|
-
function
|
|
574
|
-
return
|
|
604
|
+
function nt(e, t) {
|
|
605
|
+
return tt(e) ? /* @__PURE__ */ K(b, {
|
|
575
606
|
value: e,
|
|
576
607
|
format: t
|
|
577
|
-
}) : /* @__PURE__ */
|
|
608
|
+
}) : /* @__PURE__ */ K(g, { children: e });
|
|
578
609
|
}
|
|
579
|
-
function
|
|
580
|
-
return
|
|
610
|
+
function rt(e, t, n) {
|
|
611
|
+
return tt(e) && tt(t) ? /* @__PURE__ */ K(y, {
|
|
581
612
|
from: e,
|
|
582
613
|
to: t,
|
|
583
614
|
format: n
|
|
584
|
-
}) : /* @__PURE__ */
|
|
615
|
+
}) : /* @__PURE__ */ q("span", {
|
|
585
616
|
className: "inline-flex min-w-0 items-center gap-space-xs",
|
|
586
617
|
children: [
|
|
587
|
-
|
|
588
|
-
/* @__PURE__ */
|
|
589
|
-
|
|
618
|
+
nt(e, n),
|
|
619
|
+
/* @__PURE__ */ K(g, { children: "–" }),
|
|
620
|
+
nt(t, n)
|
|
590
621
|
]
|
|
591
622
|
});
|
|
592
623
|
}
|
|
593
624
|
//#endregion
|
|
594
625
|
//#region src/components/features/filters/partials/active-filter-item.tsx
|
|
595
|
-
function
|
|
596
|
-
let { defaultScale: g } =
|
|
626
|
+
function it({ filter: n, value: a, active: s, popoverOpen: l, triggerRef: u, operators: d, operator: f, onOperatorChange: p, onFilterClear: m, onFilterClick: h }) {
|
|
627
|
+
let { defaultScale: g } = t(), _ = e(void 0, g), { strings: v } = $(), y = z.useId(), b = z.useId(), x = `${ae.joinedItem} !border-0 !rounded-none !shadow-none ${c.inset}`, S = () => /* @__PURE__ */ K("div", {
|
|
597
628
|
"aria-hidden": !0,
|
|
598
629
|
className: "w-px self-stretch bg-border"
|
|
599
630
|
});
|
|
600
|
-
return /* @__PURE__ */
|
|
631
|
+
return /* @__PURE__ */ q("div", {
|
|
601
632
|
role: "group",
|
|
602
633
|
"aria-label": n.label,
|
|
603
634
|
"data-active": s || void 0,
|
|
604
|
-
className: r("active-filter-item--component",
|
|
635
|
+
className: r("active-filter-item--component", ae.joinedFrame, oe[_], "bg-background", n.displayConfig?.className),
|
|
605
636
|
children: [
|
|
606
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ q(i, {
|
|
607
638
|
type: "button",
|
|
608
639
|
tone: "secondary",
|
|
609
640
|
buttonStyle: "ghost",
|
|
@@ -613,29 +644,29 @@ function Je({ filter: n, value: a, active: s, popoverOpen: l, triggerRef: u, ope
|
|
|
613
644
|
"aria-expanded": l,
|
|
614
645
|
onClick: h,
|
|
615
646
|
children: [
|
|
616
|
-
!!n.icon && /* @__PURE__ */
|
|
647
|
+
!!n.icon && /* @__PURE__ */ K("span", {
|
|
617
648
|
className: "flex items-center text-muted-foreground",
|
|
618
649
|
children: n.icon
|
|
619
650
|
}),
|
|
620
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ K(o, {
|
|
621
652
|
id: y,
|
|
622
653
|
tag: "span",
|
|
623
654
|
type: "inherit",
|
|
624
655
|
weight: "semibold",
|
|
625
656
|
children: n.label
|
|
626
657
|
}),
|
|
627
|
-
/* @__PURE__ */
|
|
658
|
+
/* @__PURE__ */ K(Ce, { className: "size-icon-sm" })
|
|
628
659
|
]
|
|
629
660
|
}),
|
|
630
|
-
/* @__PURE__ */
|
|
631
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ K(S, {}),
|
|
662
|
+
/* @__PURE__ */ K(Xe, {
|
|
632
663
|
operator: f,
|
|
633
664
|
operators: d,
|
|
634
665
|
onOperatorChange: p,
|
|
635
666
|
segmentResetClass: x
|
|
636
667
|
}),
|
|
637
|
-
/* @__PURE__ */
|
|
638
|
-
/* @__PURE__ */
|
|
668
|
+
/* @__PURE__ */ K(S, {}),
|
|
669
|
+
/* @__PURE__ */ K(i, {
|
|
639
670
|
type: "button",
|
|
640
671
|
tone: "secondary",
|
|
641
672
|
buttonStyle: "ghost",
|
|
@@ -644,16 +675,16 @@ function Je({ filter: n, value: a, active: s, popoverOpen: l, triggerRef: u, ope
|
|
|
644
675
|
"aria-expanded": l,
|
|
645
676
|
onClick: h,
|
|
646
677
|
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"),
|
|
647
|
-
children: /* @__PURE__ */
|
|
678
|
+
children: /* @__PURE__ */ K("span", {
|
|
648
679
|
id: b,
|
|
649
680
|
className: "min-w-0",
|
|
650
|
-
children: /* @__PURE__ */
|
|
681
|
+
children: /* @__PURE__ */ K(Ze, {
|
|
651
682
|
filter: n,
|
|
652
683
|
value: a
|
|
653
684
|
})
|
|
654
685
|
})
|
|
655
686
|
}),
|
|
656
|
-
!!s && /* @__PURE__ */
|
|
687
|
+
!!s && /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(S, {}), /* @__PURE__ */ q(i, {
|
|
657
688
|
type: "button",
|
|
658
689
|
tone: "secondary",
|
|
659
690
|
buttonStyle: "ghost",
|
|
@@ -661,10 +692,10 @@ function Je({ filter: n, value: a, active: s, popoverOpen: l, triggerRef: u, ope
|
|
|
661
692
|
onClick: (e) => {
|
|
662
693
|
e.stopPropagation(), e.preventDefault(), m();
|
|
663
694
|
},
|
|
664
|
-
children: [/* @__PURE__ */
|
|
695
|
+
children: [/* @__PURE__ */ K(ke, {
|
|
665
696
|
"aria-hidden": "true",
|
|
666
697
|
className: "size-icon"
|
|
667
|
-
}), /* @__PURE__ */
|
|
698
|
+
}), /* @__PURE__ */ K(o, {
|
|
668
699
|
tag: "span",
|
|
669
700
|
className: "sr-only",
|
|
670
701
|
children: v.clear
|
|
@@ -675,18 +706,18 @@ function Je({ filter: n, value: a, active: s, popoverOpen: l, triggerRef: u, ope
|
|
|
675
706
|
}
|
|
676
707
|
//#endregion
|
|
677
708
|
//#region src/components/features/filters/hooks/use-async-options.ts
|
|
678
|
-
function
|
|
709
|
+
function at(e, t, n) {
|
|
679
710
|
for (let [t, r] of e) Date.now() - r.timestamp > n && e.delete(t);
|
|
680
711
|
return e.get(t);
|
|
681
712
|
}
|
|
682
|
-
function
|
|
683
|
-
let { asyncConfig: i } = e, a = i?.fetcher, o = i?.mapToOption, s =
|
|
713
|
+
function ot(e, t, n, r = {}) {
|
|
714
|
+
let { asyncConfig: i } = e, a = i?.fetcher, o = i?.mapToOption, s = H(() => /* @__PURE__ */ new Map(), [
|
|
684
715
|
e.key,
|
|
685
716
|
a,
|
|
686
717
|
o
|
|
687
|
-
]), c =
|
|
718
|
+
]), c = U(r.onError);
|
|
688
719
|
c.current = r.onError;
|
|
689
|
-
let l = i?.debounceMs ?? e.delay ?? 300, u = (
|
|
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 = H(() => i?.queryKey ? JSON.stringify(i.queryKey({
|
|
690
721
|
query: u,
|
|
691
722
|
limit: d
|
|
692
723
|
})) : JSON.stringify([
|
|
@@ -699,7 +730,7 @@ function Xe(e, t, n, r = {}) {
|
|
|
699
730
|
e.key,
|
|
700
731
|
u,
|
|
701
732
|
d
|
|
702
|
-
]), x =
|
|
733
|
+
]), x = B(async (e) => a && o ? (await a({
|
|
703
734
|
query: u,
|
|
704
735
|
limit: d,
|
|
705
736
|
signal: e
|
|
@@ -708,8 +739,8 @@ function Xe(e, t, n, r = {}) {
|
|
|
708
739
|
o,
|
|
709
740
|
u,
|
|
710
741
|
d
|
|
711
|
-
]), [S, C] =
|
|
712
|
-
let e =
|
|
742
|
+
]), [S, C] = W(() => {
|
|
743
|
+
let e = at(s, b, h);
|
|
713
744
|
return {
|
|
714
745
|
cache: s,
|
|
715
746
|
data: e?.data ?? [],
|
|
@@ -717,11 +748,11 @@ function Xe(e, t, n, r = {}) {
|
|
|
717
748
|
fetching: !1,
|
|
718
749
|
error: !1
|
|
719
750
|
};
|
|
720
|
-
}), [w, T] =
|
|
721
|
-
return
|
|
751
|
+
}), [w, T] = W(0), E = B(() => T((e) => e + 1), []), D = U(0);
|
|
752
|
+
return V(() => {
|
|
722
753
|
let t = D.current !== w;
|
|
723
754
|
if (D.current = w, !v) return;
|
|
724
|
-
let n =
|
|
755
|
+
let n = at(s, b, h), r = n !== void 0 && Date.now() - n.timestamp < m, i = new AbortController();
|
|
725
756
|
if (r && !t) return C({
|
|
726
757
|
cache: s,
|
|
727
758
|
data: n.data,
|
|
@@ -782,22 +813,44 @@ function Xe(e, t, n, r = {}) {
|
|
|
782
813
|
};
|
|
783
814
|
}
|
|
784
815
|
//#endregion
|
|
816
|
+
//#region src/components/features/filters/partials/filter-editor-header.tsx
|
|
817
|
+
function st({ title: e, description: t, onBack: n }) {
|
|
818
|
+
let { strings: r } = $();
|
|
819
|
+
return /* @__PURE__ */ q(te, {
|
|
820
|
+
start: n ? /* @__PURE__ */ K(i, {
|
|
821
|
+
type: "button",
|
|
822
|
+
tone: "secondary",
|
|
823
|
+
buttonStyle: "ghost",
|
|
824
|
+
size: "sm",
|
|
825
|
+
iconOnly: !0,
|
|
826
|
+
onClick: n,
|
|
827
|
+
className: "shrink-0",
|
|
828
|
+
"aria-label": r.backToFilters,
|
|
829
|
+
children: /* @__PURE__ */ K(we, {
|
|
830
|
+
"aria-hidden": "true",
|
|
831
|
+
className: "size-icon-sm rtl:rotate-180"
|
|
832
|
+
})
|
|
833
|
+
}) : void 0,
|
|
834
|
+
children: [/* @__PURE__ */ K(ee, { children: e }), t != null && /* @__PURE__ */ K(L, { children: t })]
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
//#endregion
|
|
785
838
|
//#region src/components/features/filters/partials/async-filter-content.tsx
|
|
786
|
-
function
|
|
787
|
-
let { strings: c, cacheAsyncOptions: l, getAsyncOptionLabel: d, reportError: m } = $(), [h, g] =
|
|
839
|
+
function ct({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: a, triggerSource: s = "chip" }) {
|
|
840
|
+
let { strings: c, cacheAsyncOptions: l, getAsyncOptionLabel: d, reportError: m } = $(), [h, g] = W(""), [_, v] = W(t ?? []), y = U(t);
|
|
788
841
|
if (t !== y.current) {
|
|
789
842
|
let e = y.current ?? [], n = t ?? [];
|
|
790
843
|
y.current = t, (n.length !== e.length || n.some((t, n) => t !== e[n])) && v(n);
|
|
791
844
|
}
|
|
792
|
-
let { options: b, isLoading: x, isFetching: S, isError: C, refetch: k, isBelowMinQuery: j, minQueryLength: M } =
|
|
793
|
-
|
|
845
|
+
let { options: b, isLoading: x, isFetching: S, isError: C, refetch: k, isBelowMinQuery: j, minQueryLength: M } = ot(e, h, !0, { onError: m });
|
|
846
|
+
V(() => {
|
|
794
847
|
b.length > 0 && l(e.key, b);
|
|
795
848
|
}, [
|
|
796
849
|
l,
|
|
797
850
|
e.key,
|
|
798
851
|
b
|
|
799
852
|
]);
|
|
800
|
-
let N = e.multiple !== !1, P = e.maxSelected, F = s === "toolbar",
|
|
853
|
+
let N = e.multiple !== !1, P = e.maxSelected, F = s === "toolbar", ee = _.length !== t.length || _.some((e) => !t.includes(e)), I = H(() => {
|
|
801
854
|
let t = new Set(_), n = new Set(b.map((e) => e.value)), r = [];
|
|
802
855
|
for (let t of _) if (!n.has(t)) {
|
|
803
856
|
let n = d(e.key, t);
|
|
@@ -814,7 +867,7 @@ function Ze({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
814
867
|
e.key,
|
|
815
868
|
e.icon,
|
|
816
869
|
d
|
|
817
|
-
]),
|
|
870
|
+
]), te = (t) => {
|
|
818
871
|
if (N) {
|
|
819
872
|
if (_.includes(t)) v(_.filter((e) => e !== t));
|
|
820
873
|
else {
|
|
@@ -822,12 +875,12 @@ function Ze({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
822
875
|
v([..._, t]);
|
|
823
876
|
}
|
|
824
877
|
} else v([t]), e.closeOnSelect === !0 && (n([t]), a());
|
|
825
|
-
},
|
|
878
|
+
}, L = () => {
|
|
826
879
|
n(_), a();
|
|
827
|
-
},
|
|
880
|
+
}, ne = H(() => x || S ? /* @__PURE__ */ K(f, { label: c.searching }) : C ? /* @__PURE__ */ K(p, {
|
|
828
881
|
variant: "inline",
|
|
829
882
|
title: c.fetchError,
|
|
830
|
-
action: /* @__PURE__ */
|
|
883
|
+
action: /* @__PURE__ */ K(i, {
|
|
831
884
|
tone: "secondary",
|
|
832
885
|
buttonStyle: "outline",
|
|
833
886
|
size: "sm",
|
|
@@ -836,13 +889,13 @@ function Ze({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
836
889
|
},
|
|
837
890
|
children: c.retryFetch
|
|
838
891
|
})
|
|
839
|
-
}) : j ? /* @__PURE__ */
|
|
892
|
+
}) : j ? /* @__PURE__ */ K("div", {
|
|
840
893
|
className: "text-muted-foreground flex items-center justify-center py-space-xl",
|
|
841
|
-
children: /* @__PURE__ */
|
|
894
|
+
children: /* @__PURE__ */ K(o, {
|
|
842
895
|
tag: "span",
|
|
843
896
|
size: "xs",
|
|
844
897
|
type: "secondary",
|
|
845
|
-
children:
|
|
898
|
+
children: Y(c.minQueryHint, { min: M })
|
|
846
899
|
})
|
|
847
900
|
}) : c.noOptionsFound, [
|
|
848
901
|
x,
|
|
@@ -853,58 +906,37 @@ function Ze({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
853
906
|
c,
|
|
854
907
|
k
|
|
855
908
|
]);
|
|
856
|
-
return /* @__PURE__ */
|
|
857
|
-
/* @__PURE__ */
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
size: "sm",
|
|
862
|
-
iconOnly: !0,
|
|
863
|
-
className: "shrink-0",
|
|
864
|
-
onClick: r,
|
|
865
|
-
"aria-label": c.backToFilters,
|
|
866
|
-
children: /* @__PURE__ */ J(_e, {
|
|
867
|
-
"aria-hidden": "true",
|
|
868
|
-
className: "size-icon-sm rtl:rotate-180"
|
|
869
|
-
})
|
|
870
|
-
}) : void 0,
|
|
871
|
-
children: [/* @__PURE__ */ J(o, {
|
|
872
|
-
tag: "span",
|
|
873
|
-
type: "inherit",
|
|
874
|
-
weight: "semibold",
|
|
875
|
-
children: e.label
|
|
876
|
-
}), /* @__PURE__ */ J(o, {
|
|
877
|
-
tag: "span",
|
|
878
|
-
size: "xs",
|
|
879
|
-
type: "secondary",
|
|
880
|
-
children: c.selectValues
|
|
881
|
-
})]
|
|
909
|
+
return /* @__PURE__ */ q(G, { children: [
|
|
910
|
+
/* @__PURE__ */ K(st, {
|
|
911
|
+
title: e.label,
|
|
912
|
+
description: c.selectValues,
|
|
913
|
+
onBack: F ? r : void 0
|
|
882
914
|
}),
|
|
883
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ q(A, {
|
|
884
916
|
shouldFilter: !1,
|
|
885
917
|
inset: "flush",
|
|
886
918
|
className: "rounded-none",
|
|
887
|
-
children: [/* @__PURE__ */
|
|
888
|
-
placeholder:
|
|
919
|
+
children: [/* @__PURE__ */ K(T, {
|
|
920
|
+
placeholder: Y(c.searchPlaceholder, { filterLabel: Q(e.label) }),
|
|
889
921
|
value: h,
|
|
890
922
|
onValueChange: g
|
|
891
|
-
}), /* @__PURE__ */
|
|
923
|
+
}), /* @__PURE__ */ K(D, { children: I.length === 0 ? /* @__PURE__ */ K(E, { children: ne }) : /* @__PURE__ */ q(O, { children: [!(!S || x) && /* @__PURE__ */ q(u, {
|
|
892
924
|
direction: "horizontal",
|
|
893
925
|
gap: "sm",
|
|
894
926
|
wrap: !1,
|
|
895
927
|
className: "px-control-sm py-space-xs",
|
|
896
|
-
children: [/* @__PURE__ */
|
|
928
|
+
children: [/* @__PURE__ */ K(De, { className: "text-muted-foreground size-icon-sm animate-spin" }), /* @__PURE__ */ K(o, {
|
|
897
929
|
tag: "span",
|
|
898
930
|
size: "xs",
|
|
899
931
|
type: "secondary",
|
|
900
932
|
children: c.searching
|
|
901
933
|
})]
|
|
902
|
-
}),
|
|
903
|
-
onSelect: () =>
|
|
934
|
+
}), I.map((e) => /* @__PURE__ */ q(w, {
|
|
935
|
+
onSelect: () => te(e.value),
|
|
904
936
|
"data-checked": _.includes(e.value) || void 0,
|
|
905
937
|
disabled: e.disabled || !!P && _.length >= P && !_.includes(e.value),
|
|
906
938
|
className: "flex items-center gap-space-sm",
|
|
907
|
-
children: [e.icon, /* @__PURE__ */
|
|
939
|
+
children: [e.icon, /* @__PURE__ */ K(o, {
|
|
908
940
|
tag: "span",
|
|
909
941
|
type: "inherit",
|
|
910
942
|
lineHeight: "tight",
|
|
@@ -912,15 +944,15 @@ function Ze({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
912
944
|
})]
|
|
913
945
|
}, e.value))] }) })]
|
|
914
946
|
}),
|
|
915
|
-
|
|
916
|
-
caption:
|
|
947
|
+
ee && /* @__PURE__ */ K(R, {
|
|
948
|
+
caption: Y(c.selected, {
|
|
917
949
|
count: _.length,
|
|
918
|
-
filterLabel: (_.length > 1 ? e.pluralLabel : e.label) ?? e.label
|
|
950
|
+
filterLabel: Q((_.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
919
951
|
}),
|
|
920
|
-
children: /* @__PURE__ */
|
|
952
|
+
children: /* @__PURE__ */ K(i, {
|
|
921
953
|
tone: "primary",
|
|
922
954
|
size: "sm",
|
|
923
|
-
onClick:
|
|
955
|
+
onClick: L,
|
|
924
956
|
children: c.confirm
|
|
925
957
|
})
|
|
926
958
|
})
|
|
@@ -928,12 +960,12 @@ function Ze({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
928
960
|
}
|
|
929
961
|
//#endregion
|
|
930
962
|
//#region src/components/features/filters/facets/date-facet.tsx
|
|
931
|
-
var
|
|
932
|
-
function
|
|
963
|
+
var lt = [];
|
|
964
|
+
function ut({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
933
965
|
let { strings: a } = $(), o = e.operators?.some((e) => e.value === "between") || e.operator === "between" || e.key.toLowerCase().includes("range") || e.key.toLowerCase().includes("between"), s = e.dateFormat?.param ?? "yyyy-MM-dd", c = e.dateFormat?.display ?? "PPP", l = o ? e.datePickerConfig?.noRangePlaceholder ?? e.placeholder ?? a.calendar.notDateRangeSelected : e.datePickerConfig?.noDatePlaceholder ?? e.placeholder ?? a.calendar.notDateSelected, u = !!e.datePickerConfig?.showConfirmButton, d = e.datePickerConfig?.autoApply ?? !u, f = e.datePickerConfig?.showShortcuts ?? !0, p = o && (t.start || t.end) ? {
|
|
934
966
|
from: t.start,
|
|
935
967
|
to: t.end
|
|
936
|
-
} : void 0, m = !o && t.start &&
|
|
968
|
+
} : void 0, m = !o && t.start && J(t.start) ? t.start : void 0, h = {
|
|
937
969
|
format: s,
|
|
938
970
|
readableFormat: c,
|
|
939
971
|
placeholder: l,
|
|
@@ -941,7 +973,7 @@ function $e({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
|
941
973
|
numberOfMonths: 1,
|
|
942
974
|
className: r("date-facet--component", "w-full", i)
|
|
943
975
|
};
|
|
944
|
-
return o ? /* @__PURE__ */
|
|
976
|
+
return o ? /* @__PURE__ */ K(F, {
|
|
945
977
|
mode: "range",
|
|
946
978
|
value: p,
|
|
947
979
|
onValueChange: (e) => {
|
|
@@ -952,9 +984,9 @@ function $e({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
|
952
984
|
},
|
|
953
985
|
withConfirm: u,
|
|
954
986
|
closeOnSelect: d,
|
|
955
|
-
presets: f ? void 0 :
|
|
987
|
+
presets: f ? void 0 : lt,
|
|
956
988
|
...h
|
|
957
|
-
}) : /* @__PURE__ */
|
|
989
|
+
}) : /* @__PURE__ */ K(F, {
|
|
958
990
|
mode: "single",
|
|
959
991
|
value: m,
|
|
960
992
|
onValueChange: (e) => {
|
|
@@ -969,55 +1001,42 @@ function $e({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
|
969
1001
|
}
|
|
970
1002
|
//#endregion
|
|
971
1003
|
//#region src/components/features/filters/partials/date-filter-content.tsx
|
|
972
|
-
function
|
|
973
|
-
let
|
|
1004
|
+
function dt({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, triggerSource: i = "chip" }) {
|
|
1005
|
+
let a = (t) => {
|
|
974
1006
|
if (!t) return;
|
|
975
1007
|
if (e.dateFormat?.param) {
|
|
976
|
-
let n =
|
|
977
|
-
return
|
|
1008
|
+
let n = je(t, e.dateFormat.param, /* @__PURE__ */ new Date());
|
|
1009
|
+
return J(n) ? n : void 0;
|
|
978
1010
|
}
|
|
979
1011
|
let n = new Date(t);
|
|
980
|
-
return
|
|
981
|
-
},
|
|
982
|
-
if (t &&
|
|
983
|
-
},
|
|
984
|
-
let r = [], i =
|
|
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");
|
|
1015
|
+
}, l = ({ start: e, end: t }) => {
|
|
1016
|
+
let r = [], i = c(e), a = c(t);
|
|
985
1017
|
i && r.push(i), a && r.push(a), n(r);
|
|
986
|
-
},
|
|
987
|
-
start:
|
|
988
|
-
end:
|
|
1018
|
+
}, u = i === "toolbar", d = {
|
|
1019
|
+
start: o,
|
|
1020
|
+
end: s
|
|
989
1021
|
};
|
|
990
|
-
return /* @__PURE__ */
|
|
1022
|
+
return /* @__PURE__ */ q("div", {
|
|
991
1023
|
className: "flex flex-col",
|
|
992
|
-
children: [/* @__PURE__ */
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
iconOnly: !0,
|
|
999
|
-
onClick: r,
|
|
1000
|
-
className: "shrink-0",
|
|
1001
|
-
"aria-label": o.backToFilters,
|
|
1002
|
-
children: /* @__PURE__ */ J(_e, {
|
|
1003
|
-
"aria-hidden": "true",
|
|
1004
|
-
className: "size-icon-sm rtl:rotate-180"
|
|
1005
|
-
})
|
|
1006
|
-
}) : void 0,
|
|
1007
|
-
children: /* @__PURE__ */ J(I, { children: e.label })
|
|
1008
|
-
}), /* @__PURE__ */ J("div", {
|
|
1009
|
-
className: "p-surface",
|
|
1010
|
-
children: /* @__PURE__ */ J($e, {
|
|
1024
|
+
children: [/* @__PURE__ */ K(st, {
|
|
1025
|
+
title: e.label,
|
|
1026
|
+
onBack: u ? r : void 0
|
|
1027
|
+
}), /* @__PURE__ */ K("div", {
|
|
1028
|
+
className: h.menuRegion,
|
|
1029
|
+
children: /* @__PURE__ */ K(ut, {
|
|
1011
1030
|
filter: e,
|
|
1012
|
-
value:
|
|
1013
|
-
onValueChange:
|
|
1031
|
+
value: d,
|
|
1032
|
+
onValueChange: l
|
|
1014
1033
|
})
|
|
1015
1034
|
})]
|
|
1016
1035
|
});
|
|
1017
1036
|
}
|
|
1018
1037
|
//#endregion
|
|
1019
1038
|
//#region src/components/features/filters/partials/filter-error-boundary.tsx
|
|
1020
|
-
var
|
|
1039
|
+
var ft = class extends _e {
|
|
1021
1040
|
state = {
|
|
1022
1041
|
hasError: !1,
|
|
1023
1042
|
error: null
|
|
@@ -1043,19 +1062,19 @@ var tt = class extends ue {
|
|
|
1043
1062
|
render() {
|
|
1044
1063
|
if (this.state.hasError) {
|
|
1045
1064
|
let { fallback: e, filterKey: t, labels: n } = this.props;
|
|
1046
|
-
return e ? /* @__PURE__ */
|
|
1065
|
+
return e ? /* @__PURE__ */ K("div", {
|
|
1047
1066
|
className: "filter-error-boundary--component contents",
|
|
1048
1067
|
children: e
|
|
1049
|
-
}) : /* @__PURE__ */
|
|
1068
|
+
}) : /* @__PURE__ */ q("div", {
|
|
1050
1069
|
className: r("filter-error-boundary--component rounded-radius border p-surface-xs", d.destructive.edge, d.destructive.wash, d.destructive.ink),
|
|
1051
1070
|
children: [
|
|
1052
|
-
/* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ q("div", {
|
|
1053
1072
|
className: "mb-space-xs flex items-center justify-between",
|
|
1054
|
-
children: [/* @__PURE__ */
|
|
1073
|
+
children: [/* @__PURE__ */ K(o, {
|
|
1055
1074
|
tag: "span",
|
|
1056
1075
|
weight: "semibold",
|
|
1057
1076
|
children: n.title
|
|
1058
|
-
}), /* @__PURE__ */
|
|
1077
|
+
}), /* @__PURE__ */ K(i, {
|
|
1059
1078
|
type: "button",
|
|
1060
1079
|
tone: "destructive",
|
|
1061
1080
|
buttonStyle: "ghost",
|
|
@@ -1063,11 +1082,11 @@ var tt = class extends ue {
|
|
|
1063
1082
|
iconOnly: !0,
|
|
1064
1083
|
onClick: this.handleReset,
|
|
1065
1084
|
"aria-label": n.reset,
|
|
1066
|
-
children: /* @__PURE__ */
|
|
1085
|
+
children: /* @__PURE__ */ K(ke, { className: "size-icon-sm" })
|
|
1067
1086
|
})]
|
|
1068
1087
|
}),
|
|
1069
|
-
/* @__PURE__ */
|
|
1070
|
-
/* @__PURE__ */
|
|
1088
|
+
/* @__PURE__ */ K(o, { children: n.getDescription(t) }),
|
|
1089
|
+
/* @__PURE__ */ K(_, {
|
|
1071
1090
|
size: "xs",
|
|
1072
1091
|
className: "mt-space-xs text-destructive",
|
|
1073
1092
|
children: this.state.error?.message || n.unknownError
|
|
@@ -1075,20 +1094,20 @@ var tt = class extends ue {
|
|
|
1075
1094
|
]
|
|
1076
1095
|
});
|
|
1077
1096
|
}
|
|
1078
|
-
return /* @__PURE__ */
|
|
1097
|
+
return /* @__PURE__ */ K("div", {
|
|
1079
1098
|
className: "filter-error-boundary--component contents",
|
|
1080
1099
|
children: this.props.children
|
|
1081
1100
|
});
|
|
1082
1101
|
}
|
|
1083
1102
|
};
|
|
1084
|
-
function
|
|
1085
|
-
let { strings: t, reportError: n } = $(), r =
|
|
1103
|
+
function pt(e) {
|
|
1104
|
+
let { strings: t, reportError: n } = $(), r = H(() => ({
|
|
1086
1105
|
title: t.error.title,
|
|
1087
1106
|
reset: t.clear,
|
|
1088
|
-
getDescription: (e) => e ?
|
|
1107
|
+
getDescription: (e) => e ? Y(t.error.descriptionWithKey, { filterKey: e }) : t.error.generic,
|
|
1089
1108
|
unknownError: t.error.unknown
|
|
1090
1109
|
}), [t]);
|
|
1091
|
-
return /* @__PURE__ */
|
|
1110
|
+
return /* @__PURE__ */ K(ft, {
|
|
1092
1111
|
...e,
|
|
1093
1112
|
labels: r,
|
|
1094
1113
|
onError: n
|
|
@@ -1096,23 +1115,23 @@ function nt(e) {
|
|
|
1096
1115
|
}
|
|
1097
1116
|
//#endregion
|
|
1098
1117
|
//#region src/components/features/filters/partials/filter-list-item.tsx
|
|
1099
|
-
function
|
|
1100
|
-
let { strings: n } = $(), r = e.type ===
|
|
1101
|
-
return /* @__PURE__ */
|
|
1118
|
+
function mt({ filter: e, onSelect: t }) {
|
|
1119
|
+
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__ */ q(w, {
|
|
1102
1121
|
onSelect: t,
|
|
1103
|
-
children: [!!e.icon && /* @__PURE__ */
|
|
1122
|
+
children: [!!e.icon && /* @__PURE__ */ K("span", {
|
|
1104
1123
|
className: "shrink-0 text-muted-foreground [&_svg]:size-icon",
|
|
1105
1124
|
children: e.icon
|
|
1106
|
-
}), /* @__PURE__ */
|
|
1125
|
+
}), /* @__PURE__ */ q("div", {
|
|
1107
1126
|
className: "flex min-w-0 flex-col gap-dense leading-tight",
|
|
1108
|
-
children: [/* @__PURE__ */
|
|
1127
|
+
children: [/* @__PURE__ */ K(o, {
|
|
1109
1128
|
tag: "span",
|
|
1110
1129
|
type: "inherit",
|
|
1111
1130
|
lineHeight: "tight",
|
|
1112
1131
|
weight: "medium",
|
|
1113
1132
|
className: "truncate",
|
|
1114
1133
|
children: e.label
|
|
1115
|
-
}), !!r && /* @__PURE__ */
|
|
1134
|
+
}), !!r && /* @__PURE__ */ K(o, {
|
|
1116
1135
|
tag: "span",
|
|
1117
1136
|
lineHeight: "tight",
|
|
1118
1137
|
size: "xs",
|
|
@@ -1125,25 +1144,25 @@ function rt({ filter: e, onSelect: t }) {
|
|
|
1125
1144
|
}
|
|
1126
1145
|
//#endregion
|
|
1127
1146
|
//#region src/components/features/filters/partials/filter-list-content.tsx
|
|
1128
|
-
function
|
|
1147
|
+
function ht({ availableFilters: e, activeFilters: t, onFilterSelect: n }) {
|
|
1129
1148
|
let { strings: r } = $(), i = (e) => {
|
|
1130
1149
|
n(e);
|
|
1131
1150
|
};
|
|
1132
|
-
return /* @__PURE__ */
|
|
1151
|
+
return /* @__PURE__ */ q(A, {
|
|
1133
1152
|
inset: "compact",
|
|
1134
1153
|
className: "rounded-none",
|
|
1135
|
-
children: [/* @__PURE__ */
|
|
1136
|
-
/* @__PURE__ */
|
|
1137
|
-
e.length > 0 && /* @__PURE__ */
|
|
1154
|
+
children: [/* @__PURE__ */ K(T, { placeholder: r.searchFilters }), /* @__PURE__ */ q(D, { children: [
|
|
1155
|
+
/* @__PURE__ */ K(E, { children: r.noFiltersAvailable }),
|
|
1156
|
+
e.length > 0 && /* @__PURE__ */ K(O, {
|
|
1138
1157
|
heading: r.availableFilters,
|
|
1139
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1158
|
+
children: e.map((e) => /* @__PURE__ */ K(mt, {
|
|
1140
1159
|
filter: e,
|
|
1141
1160
|
onSelect: () => i(e)
|
|
1142
1161
|
}, e.key))
|
|
1143
1162
|
}),
|
|
1144
|
-
t.length > 0 && /* @__PURE__ */
|
|
1163
|
+
t.length > 0 && /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(k, {}), /* @__PURE__ */ K(O, {
|
|
1145
1164
|
heading: r.activeFilters,
|
|
1146
|
-
children: t.map((e) => /* @__PURE__ */
|
|
1165
|
+
children: t.map((e) => /* @__PURE__ */ K(mt, {
|
|
1147
1166
|
filter: e,
|
|
1148
1167
|
onSelect: () => i(e)
|
|
1149
1168
|
}, e.key))
|
|
@@ -1152,10 +1171,36 @@ function it({ availableFilters: e, activeFilters: t, onFilterSelect: n }) {
|
|
|
1152
1171
|
});
|
|
1153
1172
|
}
|
|
1154
1173
|
//#endregion
|
|
1174
|
+
//#region src/components/features/filters/partials/nested-filter-options.tsx
|
|
1175
|
+
function gt({ filter: e, value: t, multiple: n, onChange: r, header: i }) {
|
|
1176
|
+
let { strings: a } = $(), o = H(() => We(e.options ?? []), [e.options]), s = pe({
|
|
1177
|
+
items: o,
|
|
1178
|
+
selected: t,
|
|
1179
|
+
open: !0,
|
|
1180
|
+
multiple: n,
|
|
1181
|
+
selectable: e.selectableOptions ?? "leaf",
|
|
1182
|
+
strings: {
|
|
1183
|
+
...he,
|
|
1184
|
+
root: e.label,
|
|
1185
|
+
search: Y(a.searchPlaceholder, { filterLabel: Q(e.label) }),
|
|
1186
|
+
empty: a.noOptionsFound,
|
|
1187
|
+
back: a.previousLevel,
|
|
1188
|
+
selectCurrent: a.selectCurrentLevel
|
|
1189
|
+
},
|
|
1190
|
+
onChange: (e) => r(e == null ? [] : typeof e == "string" ? [e] : [...e])
|
|
1191
|
+
});
|
|
1192
|
+
return /* @__PURE__ */ K(me, {
|
|
1193
|
+
controller: s,
|
|
1194
|
+
header: i,
|
|
1195
|
+
rootInPath: !0,
|
|
1196
|
+
className: "nested-filter-options--component"
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
//#endregion
|
|
1155
1200
|
//#region src/components/features/filters/partials/regular-filter-content.tsx
|
|
1156
|
-
function
|
|
1157
|
-
let { strings: c, reportError: l } = $(), d = e.multiple === !0 || e.type ===
|
|
1158
|
-
|
|
1201
|
+
function _t({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: a, triggerSource: s = "chip" }) {
|
|
1202
|
+
let { strings: c, reportError: l } = $(), d = e.multiple === !0 || e.type === X.MULTI_SELECT, f = s === "toolbar", [p, m] = W(t || []);
|
|
1203
|
+
V(() => {
|
|
1159
1204
|
m(t || []);
|
|
1160
1205
|
}, [t]);
|
|
1161
1206
|
let h = (t) => {
|
|
@@ -1163,7 +1208,9 @@ function at({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
1163
1208
|
let e = p.includes(t) ? p.filter((e) => e !== t) : [...p, t];
|
|
1164
1209
|
m(e);
|
|
1165
1210
|
} else m([t]), e.closeOnSelect === !0 && (n([t]), a());
|
|
1166
|
-
}, g = () => {
|
|
1211
|
+
}, g = (t) => {
|
|
1212
|
+
m(t), !d && e.closeOnSelect === !0 && t.length && (n(t), a());
|
|
1213
|
+
}, _ = () => {
|
|
1167
1214
|
try {
|
|
1168
1215
|
n(p), a();
|
|
1169
1216
|
} catch (t) {
|
|
@@ -1172,115 +1219,99 @@ function at({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
1172
1219
|
filterKey: e.key
|
|
1173
1220
|
});
|
|
1174
1221
|
}
|
|
1175
|
-
},
|
|
1176
|
-
|
|
1222
|
+
}, v = /* @__PURE__ */ K(st, {
|
|
1223
|
+
title: e.label,
|
|
1224
|
+
onBack: f ? r : void 0
|
|
1225
|
+
}), y = JSON.stringify(p.slice().sort()) !== JSON.stringify((t ?? []).slice().sort());
|
|
1226
|
+
return /* @__PURE__ */ q("div", {
|
|
1177
1227
|
className: "flex flex-col",
|
|
1178
|
-
children: [
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
className: "
|
|
1220
|
-
children: e.
|
|
1221
|
-
}), /* @__PURE__ */ Y(u, {
|
|
1222
|
-
gap: "dense",
|
|
1223
|
-
className: "flex min-w-0 flex-1 flex-col leading-tight",
|
|
1224
|
-
children: [/* @__PURE__ */ J(o, {
|
|
1225
|
-
tag: "span",
|
|
1226
|
-
type: "inherit",
|
|
1227
|
-
lineHeight: "tight",
|
|
1228
|
-
weight: t ? "medium" : "regular",
|
|
1229
|
-
className: "truncate",
|
|
1230
|
-
children: e.label
|
|
1231
|
-
}), !!e.description && /* @__PURE__ */ J(o, {
|
|
1232
|
-
tag: "span",
|
|
1233
|
-
size: "xs",
|
|
1234
|
-
lineHeight: "tight",
|
|
1235
|
-
type: "secondary",
|
|
1236
|
-
className: "truncate",
|
|
1237
|
-
children: e.description
|
|
1238
|
-
})]
|
|
1228
|
+
children: [Ue(e.options) ? /* @__PURE__ */ K(gt, {
|
|
1229
|
+
filter: e,
|
|
1230
|
+
value: p,
|
|
1231
|
+
multiple: d,
|
|
1232
|
+
onChange: g,
|
|
1233
|
+
header: v
|
|
1234
|
+
}) : /* @__PURE__ */ q(G, { children: [v, /* @__PURE__ */ q(A, {
|
|
1235
|
+
inset: "flush",
|
|
1236
|
+
className: "rounded-none",
|
|
1237
|
+
children: [/* @__PURE__ */ K(T, { placeholder: Y(c.searchPlaceholder, { filterLabel: Q(e.label) }) }), /* @__PURE__ */ q(D, {
|
|
1238
|
+
className: "max-h-64",
|
|
1239
|
+
children: [/* @__PURE__ */ K(E, { children: /* @__PURE__ */ K(o, {
|
|
1240
|
+
type: "secondary",
|
|
1241
|
+
align: "center",
|
|
1242
|
+
className: "py-space-xl",
|
|
1243
|
+
children: c.noOptionsFound
|
|
1244
|
+
}) }), /* @__PURE__ */ K(O, { children: e.options?.map((e) => {
|
|
1245
|
+
let t = p.includes(e.value);
|
|
1246
|
+
return /* @__PURE__ */ q(w, {
|
|
1247
|
+
onSelect: () => h(e.value),
|
|
1248
|
+
"data-checked": t || void 0,
|
|
1249
|
+
disabled: e.disabled,
|
|
1250
|
+
className: "data-[checked=true]:**:[svg]:text-primary-accent",
|
|
1251
|
+
children: [!!e.icon && /* @__PURE__ */ K("span", {
|
|
1252
|
+
className: "shrink-0 text-muted-foreground [&_svg]:size-icon",
|
|
1253
|
+
children: e.icon
|
|
1254
|
+
}), /* @__PURE__ */ q(u, {
|
|
1255
|
+
gap: "dense",
|
|
1256
|
+
className: "flex min-w-0 flex-1 flex-col leading-tight",
|
|
1257
|
+
children: [/* @__PURE__ */ K(o, {
|
|
1258
|
+
tag: "span",
|
|
1259
|
+
type: "inherit",
|
|
1260
|
+
lineHeight: "tight",
|
|
1261
|
+
weight: t ? "medium" : "regular",
|
|
1262
|
+
className: "truncate",
|
|
1263
|
+
children: e.label
|
|
1264
|
+
}), !!e.description && /* @__PURE__ */ K(o, {
|
|
1265
|
+
tag: "span",
|
|
1266
|
+
size: "xs",
|
|
1267
|
+
lineHeight: "tight",
|
|
1268
|
+
type: "secondary",
|
|
1269
|
+
className: "truncate",
|
|
1270
|
+
children: e.description
|
|
1239
1271
|
})]
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1242
|
-
})]
|
|
1272
|
+
})]
|
|
1273
|
+
}, e.value);
|
|
1274
|
+
}) })]
|
|
1275
|
+
})]
|
|
1276
|
+
})] }), !!y && /* @__PURE__ */ K(R, {
|
|
1277
|
+
caption: Y(c.selected, {
|
|
1278
|
+
count: p.length,
|
|
1279
|
+
filterLabel: Q((p.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
1243
1280
|
}),
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
children: /* @__PURE__ */ J(i, {
|
|
1250
|
-
tone: "primary",
|
|
1251
|
-
size: "sm",
|
|
1252
|
-
onClick: g,
|
|
1253
|
-
children: c.confirm
|
|
1254
|
-
})
|
|
1281
|
+
children: /* @__PURE__ */ K(i, {
|
|
1282
|
+
tone: "primary",
|
|
1283
|
+
size: "sm",
|
|
1284
|
+
onClick: _,
|
|
1285
|
+
children: c.confirm
|
|
1255
1286
|
})
|
|
1256
|
-
]
|
|
1287
|
+
})]
|
|
1257
1288
|
});
|
|
1258
1289
|
}
|
|
1259
1290
|
//#endregion
|
|
1260
1291
|
//#region src/components/features/filters/facets/tags-facet.tsx
|
|
1261
|
-
function
|
|
1262
|
-
let { defaultScale: c } =
|
|
1292
|
+
function vt({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
1293
|
+
let { defaultScale: c } = t(), l = N(void 0, c), { strings: d } = $(), [f, p] = W(""), m = B(() => {
|
|
1263
1294
|
let e = f.trim();
|
|
1264
1295
|
e && !n.includes(e) && (a([...n, e]), p(""));
|
|
1265
1296
|
}, [
|
|
1266
1297
|
f,
|
|
1267
1298
|
n,
|
|
1268
1299
|
a
|
|
1269
|
-
]), h =
|
|
1300
|
+
]), h = B((e) => {
|
|
1270
1301
|
a(n.filter((t) => t !== e));
|
|
1271
1302
|
}, [n, a]), g = (e) => {
|
|
1272
1303
|
e.key === "Enter" && (e.preventDefault(), m());
|
|
1273
|
-
}, _ =
|
|
1304
|
+
}, _ = B(() => {
|
|
1274
1305
|
a([]), p("");
|
|
1275
|
-
}, [a]), v = n.length > 0, y = n.length === 1 ? d.tag : d.tags, b = v ? /* @__PURE__ */
|
|
1306
|
+
}, [a]), v = n.length > 0, y = n.length === 1 ? d.tag : d.tags, b = v ? /* @__PURE__ */ q(u, {
|
|
1276
1307
|
gap: "md",
|
|
1277
1308
|
className: "tags-facet--summary",
|
|
1278
|
-
children: [/* @__PURE__ */
|
|
1309
|
+
children: [/* @__PURE__ */ q(u, {
|
|
1279
1310
|
direction: "horizontal",
|
|
1280
1311
|
gap: "sm",
|
|
1281
1312
|
justify: "between",
|
|
1282
1313
|
wrap: !1,
|
|
1283
|
-
children: [/* @__PURE__ */
|
|
1314
|
+
children: [/* @__PURE__ */ q(o, {
|
|
1284
1315
|
tag: "span",
|
|
1285
1316
|
size: "xs",
|
|
1286
1317
|
type: "secondary",
|
|
@@ -1289,7 +1320,7 @@ function ot({ filter: t, value: n, onValueChange: a, className: s }) {
|
|
|
1289
1320
|
" ",
|
|
1290
1321
|
y
|
|
1291
1322
|
]
|
|
1292
|
-
}), /* @__PURE__ */
|
|
1323
|
+
}), /* @__PURE__ */ K(i, {
|
|
1293
1324
|
onClick: _,
|
|
1294
1325
|
tone: "secondary",
|
|
1295
1326
|
buttonStyle: "ghost",
|
|
@@ -1299,22 +1330,22 @@ function ot({ filter: t, value: n, onValueChange: a, className: s }) {
|
|
|
1299
1330
|
"aria-label": d.clearAll,
|
|
1300
1331
|
children: d.clearAll
|
|
1301
1332
|
})]
|
|
1302
|
-
}), /* @__PURE__ */
|
|
1333
|
+
}), /* @__PURE__ */ K(u, {
|
|
1303
1334
|
direction: "horizontal",
|
|
1304
1335
|
gap: "md",
|
|
1305
|
-
children: n.map((e) => /* @__PURE__ */
|
|
1336
|
+
children: n.map((e) => /* @__PURE__ */ q(x, {
|
|
1306
1337
|
tone: "secondary",
|
|
1307
1338
|
className: "flex items-center gap-space-sm py-space-2xs pl-space-md pr-space-sm",
|
|
1308
|
-
children: [/* @__PURE__ */
|
|
1339
|
+
children: [/* @__PURE__ */ K(o, {
|
|
1309
1340
|
tag: "span",
|
|
1310
1341
|
size: "xs",
|
|
1311
1342
|
children: e
|
|
1312
|
-
}), /* @__PURE__ */
|
|
1343
|
+
}), /* @__PURE__ */ K("button", {
|
|
1313
1344
|
onClick: () => h(e),
|
|
1314
1345
|
className: r(C.target, C.focus, C.toggle),
|
|
1315
1346
|
type: "button",
|
|
1316
1347
|
"aria-label": `${d.removeTag} ${e}`,
|
|
1317
|
-
children: /* @__PURE__ */
|
|
1348
|
+
children: /* @__PURE__ */ K(ke, {
|
|
1318
1349
|
className: C.icon,
|
|
1319
1350
|
"aria-hidden": "true"
|
|
1320
1351
|
})
|
|
@@ -1322,31 +1353,31 @@ function ot({ filter: t, value: n, onValueChange: a, className: s }) {
|
|
|
1322
1353
|
}, e))
|
|
1323
1354
|
})]
|
|
1324
1355
|
}) : null;
|
|
1325
|
-
return /* @__PURE__ */
|
|
1356
|
+
return /* @__PURE__ */ q(u, {
|
|
1326
1357
|
gap: "lg",
|
|
1327
1358
|
className: r("tags-facet--component", s),
|
|
1328
|
-
children: [/* @__PURE__ */
|
|
1359
|
+
children: [/* @__PURE__ */ q(u, {
|
|
1329
1360
|
direction: "horizontal",
|
|
1330
1361
|
gap: "md",
|
|
1331
1362
|
wrap: !1,
|
|
1332
|
-
children: [/* @__PURE__ */
|
|
1363
|
+
children: [/* @__PURE__ */ K("div", {
|
|
1333
1364
|
className: "relative flex-1",
|
|
1334
|
-
children: /* @__PURE__ */
|
|
1365
|
+
children: /* @__PURE__ */ K(P, {
|
|
1335
1366
|
type: "text",
|
|
1336
1367
|
value: f,
|
|
1337
1368
|
onChange: (e) => p(e.target.value),
|
|
1338
1369
|
onKeyDown: g,
|
|
1339
|
-
placeholder:
|
|
1370
|
+
placeholder: e.placeholder ?? d.enterTag
|
|
1340
1371
|
})
|
|
1341
|
-
}), /* @__PURE__ */
|
|
1372
|
+
}), /* @__PURE__ */ q(i, {
|
|
1342
1373
|
tone: "primary",
|
|
1343
1374
|
onClick: m,
|
|
1344
1375
|
disabled: !f.trim(),
|
|
1345
1376
|
size: l,
|
|
1346
1377
|
iconOnly: !0,
|
|
1347
|
-
className: r(j[l],
|
|
1378
|
+
className: r(j[l], ie[l]),
|
|
1348
1379
|
type: "button",
|
|
1349
|
-
children: [/* @__PURE__ */
|
|
1380
|
+
children: [/* @__PURE__ */ K(Oe, { className: "size-icon" }), /* @__PURE__ */ K(o, {
|
|
1350
1381
|
tag: "span",
|
|
1351
1382
|
size: "pxs",
|
|
1352
1383
|
className: "sr-only",
|
|
@@ -1356,16 +1387,16 @@ function ot({ filter: t, value: n, onValueChange: a, className: s }) {
|
|
|
1356
1387
|
}), b]
|
|
1357
1388
|
});
|
|
1358
1389
|
}
|
|
1359
|
-
var
|
|
1360
|
-
|
|
1390
|
+
var yt = z.memo(vt);
|
|
1391
|
+
yt.displayName = "TagsFacet";
|
|
1361
1392
|
//#endregion
|
|
1362
1393
|
//#region src/components/features/filters/partials/tags-filter-content.tsx
|
|
1363
|
-
function
|
|
1364
|
-
let { strings: s, reportError: c } = $(), [l, u] =
|
|
1365
|
-
|
|
1394
|
+
function bt({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: a, triggerSource: o = "chip" }) {
|
|
1395
|
+
let { strings: s, reportError: c } = $(), [l, u] = W(t || []), d = o === "toolbar";
|
|
1396
|
+
V(() => {
|
|
1366
1397
|
u(t || []);
|
|
1367
1398
|
}, [t]);
|
|
1368
|
-
let
|
|
1399
|
+
let f = () => {
|
|
1369
1400
|
try {
|
|
1370
1401
|
n(l), a();
|
|
1371
1402
|
} catch (t) {
|
|
@@ -1374,96 +1405,93 @@ function ct({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onC
|
|
|
1374
1405
|
filterKey: e.key
|
|
1375
1406
|
});
|
|
1376
1407
|
}
|
|
1377
|
-
},
|
|
1378
|
-
return /* @__PURE__ */
|
|
1408
|
+
}, p = JSON.stringify(l.slice().sort()) !== JSON.stringify((t ?? []).slice().sort());
|
|
1409
|
+
return /* @__PURE__ */ q("div", {
|
|
1379
1410
|
className: "flex flex-col",
|
|
1380
1411
|
children: [
|
|
1381
|
-
/* @__PURE__ */
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
tone: "secondary",
|
|
1385
|
-
buttonStyle: "ghost",
|
|
1386
|
-
size: "sm",
|
|
1387
|
-
iconOnly: !0,
|
|
1388
|
-
onClick: r,
|
|
1389
|
-
className: "shrink-0",
|
|
1390
|
-
"aria-label": s.backToFilters,
|
|
1391
|
-
children: /* @__PURE__ */ J(_e, {
|
|
1392
|
-
"aria-hidden": "true",
|
|
1393
|
-
className: "size-icon-sm rtl:rotate-180"
|
|
1394
|
-
})
|
|
1395
|
-
}) : void 0,
|
|
1396
|
-
children: /* @__PURE__ */ J(I, { children: e.label })
|
|
1412
|
+
/* @__PURE__ */ K(st, {
|
|
1413
|
+
title: e.label,
|
|
1414
|
+
onBack: d ? r : void 0
|
|
1397
1415
|
}),
|
|
1398
|
-
/* @__PURE__ */
|
|
1399
|
-
className:
|
|
1400
|
-
children: /* @__PURE__ */
|
|
1416
|
+
/* @__PURE__ */ K("div", {
|
|
1417
|
+
className: h.menuRegion,
|
|
1418
|
+
children: /* @__PURE__ */ K(yt, {
|
|
1401
1419
|
filter: e,
|
|
1402
1420
|
value: l,
|
|
1403
1421
|
onValueChange: u
|
|
1404
1422
|
})
|
|
1405
1423
|
}),
|
|
1406
|
-
!!
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
" ",
|
|
1413
|
-
f
|
|
1414
|
-
]
|
|
1415
|
-
}),
|
|
1416
|
-
children: /* @__PURE__ */ J(i, {
|
|
1417
|
-
tone: "primary",
|
|
1418
|
-
size: "sm",
|
|
1419
|
-
onClick: p,
|
|
1420
|
-
children: s.confirm
|
|
1421
|
-
})
|
|
1422
|
-
})
|
|
1424
|
+
!!p && /* @__PURE__ */ K(R, { children: /* @__PURE__ */ K(i, {
|
|
1425
|
+
tone: "primary",
|
|
1426
|
+
size: "sm",
|
|
1427
|
+
onClick: f,
|
|
1428
|
+
children: s.confirm
|
|
1429
|
+
}) })
|
|
1423
1430
|
]
|
|
1424
1431
|
});
|
|
1425
1432
|
}
|
|
1426
1433
|
//#endregion
|
|
1427
1434
|
//#region src/components/features/filters/partials/filter-popover-content.tsx
|
|
1428
|
-
|
|
1429
|
-
|
|
1435
|
+
var xt = "input:not([type=hidden]):not(:disabled), textarea:not(:disabled), button:not(:disabled), [tabindex]:not([tabindex=\"-1\"])";
|
|
1436
|
+
function St(e) {
|
|
1437
|
+
if (!e) return;
|
|
1438
|
+
let t = [...e.querySelectorAll(xt)].filter((e) => !e.closest(".popover-header--component"));
|
|
1439
|
+
(t.find((e) => e.matches("input, textarea")) ?? t[0])?.focus({ preventScroll: !0 });
|
|
1440
|
+
}
|
|
1441
|
+
function Ct({ activeFilterInPopover: e, availableFilters: t, activeFilters: n, getFilterValue: i, setFilterValue: a, onFilterSelect: o, onBackToFilterList: s, onClose: c, triggerSource: l = "chip", finalFocus: u }) {
|
|
1442
|
+
let { strings: d } = $(), f = U(null), p = e?.key ?? null, h = U(p);
|
|
1443
|
+
V(() => {
|
|
1444
|
+
if (h.current === p) return;
|
|
1445
|
+
h.current = p;
|
|
1446
|
+
let e = f.current;
|
|
1447
|
+
if (!e?.hasAttribute("data-open")) return;
|
|
1448
|
+
St(e);
|
|
1449
|
+
let t = e.ownerDocument.defaultView, n = t?.requestAnimationFrame(() => {
|
|
1450
|
+
e.ownerDocument.activeElement === e && St(e);
|
|
1451
|
+
});
|
|
1452
|
+
return () => {
|
|
1453
|
+
n != null && t?.cancelAnimationFrame(n);
|
|
1454
|
+
};
|
|
1455
|
+
}, [p]);
|
|
1456
|
+
let g = 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")), _ = (e, t) => {
|
|
1430
1457
|
a(e, t);
|
|
1431
1458
|
};
|
|
1432
|
-
return /* @__PURE__ */
|
|
1459
|
+
return /* @__PURE__ */ K(re, {
|
|
1460
|
+
ref: f,
|
|
1433
1461
|
finalFocus: u,
|
|
1434
|
-
type:
|
|
1462
|
+
type: "menu",
|
|
1435
1463
|
"aria-label": e?.label ?? d.addFilter,
|
|
1436
1464
|
inset: "flush",
|
|
1437
|
-
className: r("filter-popover-content--component",
|
|
1465
|
+
className: r("filter-popover-content--component", g),
|
|
1438
1466
|
align: "start",
|
|
1439
|
-
children: e ? e.type ===
|
|
1467
|
+
children: e ? e.type === X.DATE ? /* @__PURE__ */ K(dt, {
|
|
1440
1468
|
filter: e,
|
|
1441
1469
|
value: i(e.key),
|
|
1442
|
-
onFilterChange: (t) =>
|
|
1470
|
+
onFilterChange: (t) => _(e.key, t),
|
|
1443
1471
|
onBackToFilterList: s,
|
|
1444
1472
|
triggerSource: l
|
|
1445
|
-
}) : e.type ===
|
|
1473
|
+
}) : e.type === X.TAGS ? /* @__PURE__ */ K(bt, {
|
|
1446
1474
|
filter: e,
|
|
1447
1475
|
value: i(e.key),
|
|
1448
|
-
onFilterChange: (t) =>
|
|
1476
|
+
onFilterChange: (t) => _(e.key, t),
|
|
1449
1477
|
onBackToFilterList: s,
|
|
1450
1478
|
onClose: c,
|
|
1451
1479
|
triggerSource: l
|
|
1452
|
-
}) : e.type ===
|
|
1480
|
+
}) : e.type === X.ASYNC_SELECT ? /* @__PURE__ */ K(ct, {
|
|
1453
1481
|
filter: e,
|
|
1454
1482
|
value: i(e.key),
|
|
1455
|
-
onFilterChange: (t) =>
|
|
1483
|
+
onFilterChange: (t) => _(e.key, t),
|
|
1456
1484
|
onBackToFilterList: s,
|
|
1457
1485
|
onClose: c,
|
|
1458
1486
|
triggerSource: l
|
|
1459
|
-
}) : /* @__PURE__ */
|
|
1487
|
+
}) : /* @__PURE__ */ K(_t, {
|
|
1460
1488
|
filter: e,
|
|
1461
1489
|
value: i(e.key),
|
|
1462
|
-
onFilterChange: (t) =>
|
|
1490
|
+
onFilterChange: (t) => _(e.key, t),
|
|
1463
1491
|
onBackToFilterList: s,
|
|
1464
1492
|
onClose: c,
|
|
1465
1493
|
triggerSource: l
|
|
1466
|
-
}) : /* @__PURE__ */
|
|
1494
|
+
}) : /* @__PURE__ */ K(ht, {
|
|
1467
1495
|
availableFilters: t,
|
|
1468
1496
|
activeFilters: n,
|
|
1469
1497
|
onFilterSelect: o
|
|
@@ -1472,24 +1500,24 @@ function lt({ activeFilterInPopover: e, availableFilters: t, activeFilters: n, g
|
|
|
1472
1500
|
}
|
|
1473
1501
|
//#endregion
|
|
1474
1502
|
//#region src/components/features/filters/partials/filter-pill.tsx
|
|
1475
|
-
function
|
|
1476
|
-
let d =
|
|
1477
|
-
return /* @__PURE__ */
|
|
1503
|
+
function wt({ filter: e, value: t, active: n, operator: r, operators: i, onOperatorChange: a, onValueChange: o, onClear: s, availableFilters: c, activeFilters: l, operatorChangeRef: u }) {
|
|
1504
|
+
let d = U(!1), f = u ?? d, [p, m] = W(!1), h = U(null), g = U(null);
|
|
1505
|
+
return /* @__PURE__ */ K(pt, {
|
|
1478
1506
|
filterKey: e.key,
|
|
1479
|
-
children: /* @__PURE__ */
|
|
1507
|
+
children: /* @__PURE__ */ q(ne, {
|
|
1480
1508
|
open: p,
|
|
1481
1509
|
onOpenChange: (e) => {
|
|
1482
1510
|
e && f.current || m(e);
|
|
1483
1511
|
},
|
|
1484
|
-
children: [/* @__PURE__ */
|
|
1512
|
+
children: [/* @__PURE__ */ q("div", {
|
|
1485
1513
|
className: "filter-pill--component filter-pill--anchor relative",
|
|
1486
|
-
children: [/* @__PURE__ */
|
|
1487
|
-
render: /* @__PURE__ */
|
|
1514
|
+
children: [/* @__PURE__ */ K(I, {
|
|
1515
|
+
render: /* @__PURE__ */ K("span", {}),
|
|
1488
1516
|
nativeButton: !1,
|
|
1489
1517
|
tabIndex: -1,
|
|
1490
1518
|
"aria-hidden": "true",
|
|
1491
1519
|
className: "pointer-events-none absolute inset-0"
|
|
1492
|
-
}), /* @__PURE__ */
|
|
1520
|
+
}), /* @__PURE__ */ K(it, {
|
|
1493
1521
|
filter: e,
|
|
1494
1522
|
popoverOpen: p,
|
|
1495
1523
|
triggerRef: h,
|
|
@@ -1509,7 +1537,7 @@ function ut({ filter: e, value: t, active: n, operator: r, operators: i, onOpera
|
|
|
1509
1537
|
f.current || (g.current = e?.currentTarget ?? h.current, m(!0));
|
|
1510
1538
|
}
|
|
1511
1539
|
})]
|
|
1512
|
-
}), /* @__PURE__ */
|
|
1540
|
+
}), /* @__PURE__ */ K(Ct, {
|
|
1513
1541
|
finalFocus: g,
|
|
1514
1542
|
activeFilterInPopover: e,
|
|
1515
1543
|
availableFilters: c,
|
|
@@ -1524,29 +1552,29 @@ function ut({ filter: e, value: t, active: n, operator: r, operators: i, onOpera
|
|
|
1524
1552
|
})
|
|
1525
1553
|
});
|
|
1526
1554
|
}
|
|
1527
|
-
|
|
1555
|
+
wt.displayName = "FilterPill";
|
|
1528
1556
|
//#endregion
|
|
1529
1557
|
//#region src/components/features/filters/partials/filters-button.tsx
|
|
1530
|
-
function
|
|
1531
|
-
let { defaultScale: u } =
|
|
1532
|
-
return
|
|
1558
|
+
function Tt({ triggerRef: e, availableFilters: n, activeFilters: a, activeFilterInPopover: o, getFilterValue: s, setFilterValue: c, setActiveFilterInPopover: l }) {
|
|
1559
|
+
let { defaultScale: u } = t(), d = N(void 0, u), [f, p] = W(!1), { strings: m } = $();
|
|
1560
|
+
return V(() => {
|
|
1533
1561
|
f || l(null);
|
|
1534
|
-
}, [f, l]), /* @__PURE__ */
|
|
1562
|
+
}, [f, l]), /* @__PURE__ */ q(ne, {
|
|
1535
1563
|
open: f,
|
|
1536
1564
|
onOpenChange: p,
|
|
1537
|
-
children: [/* @__PURE__ */
|
|
1565
|
+
children: [/* @__PURE__ */ K(I, {
|
|
1538
1566
|
asChild: !0,
|
|
1539
|
-
children: /* @__PURE__ */
|
|
1540
|
-
ref:
|
|
1567
|
+
children: /* @__PURE__ */ K(i, {
|
|
1568
|
+
ref: e,
|
|
1541
1569
|
tone: "secondary",
|
|
1542
1570
|
buttonStyle: "outline",
|
|
1543
1571
|
size: d,
|
|
1544
1572
|
iconOnly: !0,
|
|
1545
1573
|
"aria-label": m.addFilter,
|
|
1546
|
-
className: r("filters-button--component shrink-0", j[d],
|
|
1547
|
-
children: /* @__PURE__ */
|
|
1574
|
+
className: r("filters-button--component shrink-0", j[d], ie[d]),
|
|
1575
|
+
children: /* @__PURE__ */ K(Ee, { className: "size-icon-sm" })
|
|
1548
1576
|
})
|
|
1549
|
-
}), /* @__PURE__ */
|
|
1577
|
+
}), /* @__PURE__ */ K(Ct, {
|
|
1550
1578
|
activeFilterInPopover: o,
|
|
1551
1579
|
availableFilters: n,
|
|
1552
1580
|
activeFilters: a,
|
|
@@ -1567,8 +1595,8 @@ function dt({ triggerRef: t, availableFilters: n, activeFilters: a, activeFilter
|
|
|
1567
1595
|
}
|
|
1568
1596
|
//#endregion
|
|
1569
1597
|
//#region src/components/features/filters/partials/filter-tabs.tsx
|
|
1570
|
-
function
|
|
1571
|
-
let { activeFilters: t, filters: n, replaceFilters: r } = $(), i =
|
|
1598
|
+
function Et({ tabs: e }) {
|
|
1599
|
+
let { activeFilters: t, filters: n, replaceFilters: r } = $(), i = H(() => t.filter((e) => n.find((t) => t.key === e.key)?.type !== X.SEARCH), [t, n]), a = H(() => t.filter((e) => n.find((t) => t.key === e.key)?.type === X.SEARCH), [t, n]), s = H(() => {
|
|
1572
1600
|
for (let t of e) {
|
|
1573
1601
|
if (t.presets.length === 0) {
|
|
1574
1602
|
if (i.length === 0) return t.id;
|
|
@@ -1582,13 +1610,13 @@ function ft({ tabs: e }) {
|
|
|
1582
1610
|
})) return t.id;
|
|
1583
1611
|
}
|
|
1584
1612
|
return null;
|
|
1585
|
-
}, [e, i]), c =
|
|
1613
|
+
}, [e, i]), c = B((e) => {
|
|
1586
1614
|
if (e.presets.length === 0) {
|
|
1587
1615
|
r([...a]);
|
|
1588
1616
|
return;
|
|
1589
1617
|
}
|
|
1590
1618
|
let t = e.presets.map((e) => {
|
|
1591
|
-
let t = n.find((t) => t.key === e.key), r = e.operator ?? t?.operator ?? (t ?
|
|
1619
|
+
let t = n.find((t) => t.key === e.key), r = e.operator ?? t?.operator ?? (t ? Ve(t.type) : "equals");
|
|
1592
1620
|
return {
|
|
1593
1621
|
id: e.key,
|
|
1594
1622
|
key: e.key,
|
|
@@ -1602,14 +1630,14 @@ function ft({ tabs: e }) {
|
|
|
1602
1630
|
a,
|
|
1603
1631
|
r
|
|
1604
1632
|
]);
|
|
1605
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
1633
|
+
return e.length === 0 ? null : /* @__PURE__ */ K(le, {
|
|
1606
1634
|
value: s,
|
|
1607
1635
|
onValueChange: (t) => {
|
|
1608
1636
|
let n = e.find((e) => e.id === t);
|
|
1609
1637
|
n && c(n);
|
|
1610
1638
|
},
|
|
1611
1639
|
className: "filter-tabs--component",
|
|
1612
|
-
children: /* @__PURE__ */
|
|
1640
|
+
children: /* @__PURE__ */ K(ce, {
|
|
1613
1641
|
variant: "chips",
|
|
1614
1642
|
role: "group",
|
|
1615
1643
|
"aria-orientation": void 0,
|
|
@@ -1617,19 +1645,19 @@ function ft({ tabs: e }) {
|
|
|
1617
1645
|
className: "gap-space-md",
|
|
1618
1646
|
children: e.map((e) => {
|
|
1619
1647
|
let t = s === e.id;
|
|
1620
|
-
return /* @__PURE__ */
|
|
1648
|
+
return /* @__PURE__ */ q(se, {
|
|
1621
1649
|
value: e.id,
|
|
1622
1650
|
role: "button",
|
|
1623
1651
|
"aria-selected": void 0,
|
|
1624
1652
|
"aria-controls": void 0,
|
|
1625
1653
|
"aria-pressed": t,
|
|
1626
1654
|
className: "filter-tabs--tab",
|
|
1627
|
-
children: [/* @__PURE__ */
|
|
1655
|
+
children: [/* @__PURE__ */ K(o, {
|
|
1628
1656
|
tag: "span",
|
|
1629
1657
|
weight: "medium",
|
|
1630
1658
|
className: "text-inherit",
|
|
1631
1659
|
children: e.label
|
|
1632
|
-
}), e.count !== void 0 && /* @__PURE__ */
|
|
1660
|
+
}), e.count !== void 0 && /* @__PURE__ */ K(o, {
|
|
1633
1661
|
tag: "span",
|
|
1634
1662
|
size: "xs",
|
|
1635
1663
|
type: "secondary",
|
|
@@ -1643,20 +1671,20 @@ function ft({ tabs: e }) {
|
|
|
1643
1671
|
}
|
|
1644
1672
|
//#endregion
|
|
1645
1673
|
//#region src/components/features/filters/facets/search-facet.tsx
|
|
1646
|
-
var
|
|
1647
|
-
return /* @__PURE__ */
|
|
1674
|
+
var Dt = z.forwardRef(function(e, t) {
|
|
1675
|
+
return /* @__PURE__ */ K(De, {
|
|
1648
1676
|
...e,
|
|
1649
1677
|
ref: t,
|
|
1650
1678
|
className: r("animate-spin", e.className)
|
|
1651
1679
|
});
|
|
1652
1680
|
});
|
|
1653
|
-
function
|
|
1654
|
-
let { strings: a, isNavigating: o } = $(), [s, c] =
|
|
1655
|
-
|
|
1681
|
+
function Ot({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
1682
|
+
let { strings: a, isNavigating: o } = $(), [s, c] = W(t[0] || ""), l = U(s);
|
|
1683
|
+
V(() => {
|
|
1656
1684
|
l.current = s;
|
|
1657
1685
|
}, [s]);
|
|
1658
|
-
let u =
|
|
1659
|
-
|
|
1686
|
+
let u = U(t[0] || null), d = U(!1);
|
|
1687
|
+
V(() => {
|
|
1660
1688
|
if (d.current || o) return;
|
|
1661
1689
|
let e = l.current;
|
|
1662
1690
|
if (!t.length || t[0] === "") {
|
|
@@ -1665,14 +1693,14 @@ function mt({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
|
1665
1693
|
}
|
|
1666
1694
|
t[0] !== void 0 && t[0] !== e && t[0] !== u.current && (c(t[0]), u.current = t[0]);
|
|
1667
1695
|
}, [t, o]);
|
|
1668
|
-
let f =
|
|
1696
|
+
let f = de((e) => {
|
|
1669
1697
|
u.current = e, d.current = !1, n([e]);
|
|
1670
1698
|
}, e.delay ?? 300), p = (e) => {
|
|
1671
1699
|
u.current !== e && f(e);
|
|
1672
1700
|
};
|
|
1673
|
-
return /* @__PURE__ */
|
|
1674
|
-
className: r("search-facet--component", "search-facet relative w-full min-w-0 rounded-
|
|
1675
|
-
children: /* @__PURE__ */
|
|
1701
|
+
return /* @__PURE__ */ K("div", {
|
|
1702
|
+
className: r("search-facet--component", "search-facet relative w-full min-w-0 rounded-radius bg-background", i),
|
|
1703
|
+
children: /* @__PURE__ */ K(P, {
|
|
1676
1704
|
type: "text",
|
|
1677
1705
|
"aria-label": e.label,
|
|
1678
1706
|
value: s,
|
|
@@ -1691,27 +1719,27 @@ function mt({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
|
1691
1719
|
},
|
|
1692
1720
|
placeholder: e.placeholder ?? (() => {
|
|
1693
1721
|
let t = e.label.trim().toLowerCase();
|
|
1694
|
-
return !t || t === "search" ?
|
|
1722
|
+
return !t || t === "search" ? Y(a.searchPlaceholder, { filterLabel: "" }).replace(/\s+([….?!])/g, "$1").replace(/\s{2,}/g, " ").trim() : Y(a.searchPlaceholder, { filterLabel: t });
|
|
1695
1723
|
})(),
|
|
1696
1724
|
clearable: s.trim() !== "" && !o,
|
|
1697
|
-
endIcon: o ?
|
|
1725
|
+
endIcon: o ? Dt : void 0,
|
|
1698
1726
|
strings: { clear: a.clearSearch }
|
|
1699
1727
|
})
|
|
1700
1728
|
});
|
|
1701
1729
|
}
|
|
1702
|
-
var
|
|
1703
|
-
|
|
1730
|
+
var kt = z.memo(Ot);
|
|
1731
|
+
kt.displayName = "SearchFacet";
|
|
1704
1732
|
//#endregion
|
|
1705
1733
|
//#region src/components/features/filters/partials/search-filters-list.tsx
|
|
1706
|
-
function
|
|
1707
|
-
return /* @__PURE__ */
|
|
1734
|
+
function At({ filters: e, getFilterValue: t, setFilterValue: n, className: i }) {
|
|
1735
|
+
return /* @__PURE__ */ K(G, { children: e.map((e) => /* @__PURE__ */ q(u, {
|
|
1708
1736
|
gap: "lg",
|
|
1709
1737
|
className: r("search-filters-list--component", "w-full min-w-0 sm:w-64 sm:flex-none", e.displayConfig.className, i),
|
|
1710
|
-
children: [/* @__PURE__ */
|
|
1738
|
+
children: [/* @__PURE__ */ K(kt, {
|
|
1711
1739
|
filter: e,
|
|
1712
1740
|
value: t(e.key),
|
|
1713
1741
|
onValueChange: (t) => n(e.key, t)
|
|
1714
|
-
}), !!e.description && /* @__PURE__ */
|
|
1742
|
+
}), !!e.description && /* @__PURE__ */ K(o, {
|
|
1715
1743
|
size: "xs",
|
|
1716
1744
|
type: "secondary",
|
|
1717
1745
|
children: e.description
|
|
@@ -1720,66 +1748,66 @@ function gt({ filters: e, getFilterValue: t, setFilterValue: n, className: i })
|
|
|
1720
1748
|
}
|
|
1721
1749
|
//#endregion
|
|
1722
1750
|
//#region src/components/features/filters/filter-layout.tsx
|
|
1723
|
-
var
|
|
1751
|
+
var jt = {
|
|
1724
1752
|
compact: "lg",
|
|
1725
1753
|
default: "xl"
|
|
1726
|
-
},
|
|
1754
|
+
}, Mt = {
|
|
1727
1755
|
compact: "sm",
|
|
1728
1756
|
default: "md"
|
|
1729
1757
|
};
|
|
1730
|
-
function
|
|
1731
|
-
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 } =
|
|
1758
|
+
function Nt({ className: e, dynamicFilterOptions: t = {}, loadingFilters: n = {}, variant: a = "default", showClearFilters: s = !1, tabs: c }) {
|
|
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 } = Ye({ dynamicFilterOptions: t }), [w, T] = W(null), E = v.find((e) => e.key === w) ?? null, D = B((e) => {
|
|
1732
1760
|
T(e?.key ?? null);
|
|
1733
1761
|
}, []);
|
|
1734
|
-
|
|
1762
|
+
V(() => {
|
|
1735
1763
|
w !== null && E === null && T(null);
|
|
1736
1764
|
}, [w, E]);
|
|
1737
|
-
let O =
|
|
1765
|
+
let O = U(null), k = U(null);
|
|
1738
1766
|
function A(e, t) {
|
|
1739
1767
|
t.length === 0 && e.displayConfig?.display !== "always" && (k.current = e.key), d(e.key, t);
|
|
1740
1768
|
}
|
|
1741
|
-
|
|
1769
|
+
V(() => {
|
|
1742
1770
|
let e = k.current;
|
|
1743
1771
|
e !== null && !f(e) && (O.current?.focus(), k.current = null);
|
|
1744
1772
|
}, [f]);
|
|
1745
1773
|
function j(e) {
|
|
1746
|
-
return e.operators && e.operators.length > 0 ? e.operators :
|
|
1774
|
+
return e.operators && e.operators.length > 0 ? e.operators : Be(e.type, _.operators);
|
|
1747
1775
|
}
|
|
1748
1776
|
function M(e, t) {
|
|
1749
1777
|
h(e, t);
|
|
1750
1778
|
}
|
|
1751
|
-
return /* @__PURE__ */
|
|
1752
|
-
gap:
|
|
1779
|
+
return /* @__PURE__ */ q(u, {
|
|
1780
|
+
gap: jt[a],
|
|
1753
1781
|
className: r("filter-layout--component", e),
|
|
1754
|
-
children: [!!c && c.length > 0 && /* @__PURE__ */
|
|
1782
|
+
children: [!!c && c.length > 0 && /* @__PURE__ */ K(Et, { tabs: c }), /* @__PURE__ */ q(u, {
|
|
1755
1783
|
direction: "horizontal",
|
|
1756
1784
|
align: "center",
|
|
1757
|
-
gap:
|
|
1758
|
-
children: [/* @__PURE__ */
|
|
1785
|
+
gap: Mt[a],
|
|
1786
|
+
children: [/* @__PURE__ */ K(pt, {
|
|
1759
1787
|
filterKey: "search-filters",
|
|
1760
|
-
children: /* @__PURE__ */
|
|
1788
|
+
children: /* @__PURE__ */ K(At, {
|
|
1761
1789
|
filters: y,
|
|
1762
1790
|
getFilterValue: l,
|
|
1763
1791
|
setFilterValue: d
|
|
1764
1792
|
})
|
|
1765
|
-
}), /* @__PURE__ */
|
|
1793
|
+
}), /* @__PURE__ */ q("div", {
|
|
1766
1794
|
className: r("contents", g && "pointer-events-none opacity-60"),
|
|
1767
1795
|
children: [
|
|
1768
1796
|
Object.entries(n).filter(([, e]) => e).map(([e]) => {
|
|
1769
1797
|
let t = v.find((t) => t.key === e)?.label || e;
|
|
1770
|
-
return /* @__PURE__ */
|
|
1798
|
+
return /* @__PURE__ */ q(u, {
|
|
1771
1799
|
direction: "horizontal",
|
|
1772
1800
|
gap: "sm",
|
|
1773
1801
|
wrap: !1,
|
|
1774
1802
|
className: "rounded-radius bg-muted/50 px-control-sm py-space-xs",
|
|
1775
|
-
children: [/* @__PURE__ */
|
|
1803
|
+
children: [/* @__PURE__ */ K("div", { className: "border-muted-foreground/30 border-t-primary size-icon-sm animate-spin rounded-full border-2" }), /* @__PURE__ */ K(o, {
|
|
1776
1804
|
tag: "span",
|
|
1777
1805
|
type: "secondary",
|
|
1778
|
-
children:
|
|
1806
|
+
children: Y(_.loadingOptions, { filterLabel: t })
|
|
1779
1807
|
})]
|
|
1780
1808
|
}, `loading-${e}`);
|
|
1781
1809
|
}),
|
|
1782
|
-
[...b, ...x].map((e) => /* @__PURE__ */
|
|
1810
|
+
[...b, ...x].map((e) => /* @__PURE__ */ K(wt, {
|
|
1783
1811
|
filter: e,
|
|
1784
1812
|
value: l(e.key) ?? [],
|
|
1785
1813
|
active: f(e.key),
|
|
@@ -1791,9 +1819,9 @@ function yt({ className: e, dynamicFilterOptions: t = {}, loadingFilters: n = {}
|
|
|
1791
1819
|
availableFilters: S,
|
|
1792
1820
|
activeFilters: [...x, ...b]
|
|
1793
1821
|
}, e.key)),
|
|
1794
|
-
S.length > 0 && /* @__PURE__ */
|
|
1822
|
+
S.length > 0 && /* @__PURE__ */ K(pt, {
|
|
1795
1823
|
filterKey: "filters-button",
|
|
1796
|
-
children: /* @__PURE__ */
|
|
1824
|
+
children: /* @__PURE__ */ K(Tt, {
|
|
1797
1825
|
triggerRef: O,
|
|
1798
1826
|
availableFilters: S,
|
|
1799
1827
|
activeFilters: x,
|
|
@@ -1803,7 +1831,7 @@ function yt({ className: e, dynamicFilterOptions: t = {}, loadingFilters: n = {}
|
|
|
1803
1831
|
setActiveFilterInPopover: D
|
|
1804
1832
|
})
|
|
1805
1833
|
}),
|
|
1806
|
-
!!s && C && /* @__PURE__ */
|
|
1834
|
+
!!s && C && /* @__PURE__ */ K(i, {
|
|
1807
1835
|
tone: "secondary",
|
|
1808
1836
|
buttonStyle: "ghost",
|
|
1809
1837
|
onClick: p,
|
|
@@ -1817,8 +1845,8 @@ function yt({ className: e, dynamicFilterOptions: t = {}, loadingFilters: n = {}
|
|
|
1817
1845
|
}
|
|
1818
1846
|
//#endregion
|
|
1819
1847
|
//#region src/components/features/filters/filter-query.ts
|
|
1820
|
-
var
|
|
1821
|
-
function
|
|
1848
|
+
var Pt = "__op", Ft = ["page"], It = new Set(Object.values(Z));
|
|
1849
|
+
function Lt(e) {
|
|
1822
1850
|
let t = {};
|
|
1823
1851
|
if (!e) return t;
|
|
1824
1852
|
if (e instanceof URLSearchParams) return e.forEach((e, n) => {
|
|
@@ -1830,203 +1858,223 @@ function Ct(e) {
|
|
|
1830
1858
|
}
|
|
1831
1859
|
return t;
|
|
1832
1860
|
}
|
|
1833
|
-
function
|
|
1861
|
+
function Rt(e) {
|
|
1834
1862
|
let t = {};
|
|
1835
1863
|
for (let [n, r] of Object.entries(e)) r.length !== 0 && (t[n] = r.length === 1 ? r[0] : r);
|
|
1836
1864
|
return t;
|
|
1837
1865
|
}
|
|
1838
|
-
function
|
|
1866
|
+
function zt(e, t, n) {
|
|
1839
1867
|
let r = e[t] ?? [];
|
|
1840
1868
|
return n === "comma" ? r.flatMap((e) => e.split(",")) : r;
|
|
1841
1869
|
}
|
|
1842
|
-
function
|
|
1870
|
+
function Bt(e, t) {
|
|
1843
1871
|
return t.map((e) => e.trim()).filter((e) => e.length > 0).map((t) => {
|
|
1844
1872
|
if (!e.parse) return t;
|
|
1845
1873
|
let n = e.parse(t);
|
|
1846
1874
|
return n == null ? "" : String(n);
|
|
1847
1875
|
}).filter((e) => e.length > 0);
|
|
1848
1876
|
}
|
|
1849
|
-
function
|
|
1877
|
+
function Vt(e, t) {
|
|
1850
1878
|
return t.map((t) => {
|
|
1851
1879
|
let n = e.transform ? e.transform(t) : t, r = e.format ? e.format(n) : n;
|
|
1852
1880
|
return r == null ? "" : String(r);
|
|
1853
1881
|
}).filter((e) => e.length > 0);
|
|
1854
1882
|
}
|
|
1855
|
-
function
|
|
1856
|
-
return e.operator ?? e.operators?.[0]?.value ??
|
|
1883
|
+
function Ht(e) {
|
|
1884
|
+
return e.operator ?? e.operators?.[0]?.value ?? Ve(e.type);
|
|
1857
1885
|
}
|
|
1858
|
-
function
|
|
1886
|
+
function Ut(e, t, n) {
|
|
1859
1887
|
let [r] = t[`${e.key}${n}`] ?? [];
|
|
1860
|
-
return r &&
|
|
1888
|
+
return r && It.has(r) ? r : Ht(e);
|
|
1861
1889
|
}
|
|
1862
|
-
function
|
|
1890
|
+
function Wt(e, t, n) {
|
|
1863
1891
|
return e === "always" || e !== "never" && t !== n;
|
|
1864
1892
|
}
|
|
1865
|
-
function
|
|
1866
|
-
return e.type ===
|
|
1893
|
+
function Gt(e) {
|
|
1894
|
+
return e.type === X.MULTI_SELECT || e.type === X.TAGS || e.multiple === !0;
|
|
1867
1895
|
}
|
|
1868
|
-
function
|
|
1869
|
-
let r = n.operatorSuffix ??
|
|
1896
|
+
function Kt(e, t, n = {}) {
|
|
1897
|
+
let r = n.operatorSuffix ?? Pt, i = n.arrayFormat ?? "repeat", a = Lt(t);
|
|
1870
1898
|
return e.flatMap((e) => {
|
|
1871
|
-
let t =
|
|
1899
|
+
let t = Bt(e, zt(a, e.key, i));
|
|
1872
1900
|
return t.length === 0 ? [] : [{
|
|
1873
1901
|
id: e.key,
|
|
1874
1902
|
key: e.key,
|
|
1875
|
-
operator:
|
|
1876
|
-
value:
|
|
1903
|
+
operator: Ut(e, a, r),
|
|
1904
|
+
value: Gt(e) ? t : [t[0]]
|
|
1877
1905
|
}];
|
|
1878
1906
|
});
|
|
1879
1907
|
}
|
|
1880
|
-
function
|
|
1881
|
-
let i = r.operatorSuffix ??
|
|
1908
|
+
function qt(e, t, n, r = {}) {
|
|
1909
|
+
let i = r.operatorSuffix ?? Pt, a = r.arrayFormat ?? "repeat", o = r.preserveUnrelated ?? !0, s = r.includeOperators ?? "changed", c = r.resetPageKeys ?? Ft, l = o ? Lt(n) : {}, u = new Map(e.map((e) => [e.key, e]));
|
|
1882
1910
|
for (let t of e) delete l[t.key], delete l[`${t.key}${i}`];
|
|
1883
1911
|
for (let e of c) delete l[e];
|
|
1884
1912
|
for (let e of t) {
|
|
1885
1913
|
let t = u.get(e.key);
|
|
1886
1914
|
if (!t) continue;
|
|
1887
|
-
let n =
|
|
1915
|
+
let n = Vt(t, e.value);
|
|
1888
1916
|
if (n.length === 0) continue;
|
|
1889
1917
|
l[e.key] = a === "comma" ? [n.join(",")] : n;
|
|
1890
|
-
let r =
|
|
1891
|
-
|
|
1918
|
+
let r = Ht(t);
|
|
1919
|
+
Wt(s, e.operator, r) && (l[`${e.key}${i}`] = [e.operator]);
|
|
1892
1920
|
}
|
|
1893
|
-
return
|
|
1921
|
+
return Rt(l);
|
|
1894
1922
|
}
|
|
1895
|
-
function
|
|
1896
|
-
let r = n.preserveUnrelated ?? !0, i = n.resetPageKeys ??
|
|
1923
|
+
function Jt(e, t, n = {}) {
|
|
1924
|
+
let r = n.preserveUnrelated ?? !0, i = n.resetPageKeys ?? Ft, a = r ? Lt(e) : {}, o = Lt(t);
|
|
1897
1925
|
for (let e of i) delete a[e];
|
|
1898
1926
|
for (let [e, t] of Object.entries(o)) t.length === 0 ? delete a[e] : a[e] = t;
|
|
1899
|
-
return
|
|
1927
|
+
return Rt(a);
|
|
1900
1928
|
}
|
|
1901
1929
|
//#endregion
|
|
1902
1930
|
//#region src/components/features/filters/facets/select-facet.tsx
|
|
1903
|
-
function
|
|
1904
|
-
let { defaultScale: c } =
|
|
1905
|
-
|
|
1906
|
-
}, v = (
|
|
1931
|
+
function Yt({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
1932
|
+
let { defaultScale: c } = t(), l = N(void 0, c), { strings: u } = $(), [d, f] = W(!1), [p, m] = W(""), h = n.length > 0, g = e.options, _ = (t) => {
|
|
1933
|
+
e.multiple ? n.includes(t) ? a(n.filter((e) => e !== t)) : a([...n, t]) : (a([t]), e.closeOnSelect !== !1 && f(!1));
|
|
1934
|
+
}, v = (t) => Ge(e, t) ?? t, y = H(() => Ue(g) ? We(g ?? []) : null, [g]), b = H(() => (g ?? []).map((e) => ({
|
|
1907
1935
|
value: e.value,
|
|
1908
1936
|
label: e.label,
|
|
1909
1937
|
description: e.description,
|
|
1910
1938
|
icon: e.icon,
|
|
1911
1939
|
selected: n.includes(e.value),
|
|
1912
1940
|
disabled: e.disabled
|
|
1913
|
-
})), [g, n]),
|
|
1914
|
-
|
|
1941
|
+
})), [g, n]), x = Y(u.searchPlaceholder, { filterLabel: e.label.toLowerCase() }), S = Y(u.selected, {
|
|
1942
|
+
count: n.length,
|
|
1943
|
+
filterLabel: Q((n.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
1944
|
+
});
|
|
1945
|
+
return y ? /* @__PURE__ */ K("div", {
|
|
1915
1946
|
className: r("select-facet--component", "relative", s),
|
|
1916
|
-
children: /* @__PURE__ */
|
|
1947
|
+
children: /* @__PURE__ */ K(ge, {
|
|
1948
|
+
items: y,
|
|
1949
|
+
value: e.multiple ? n : n[0] ?? null,
|
|
1950
|
+
multiple: !!e.multiple,
|
|
1951
|
+
selectable: e.selectableOptions ?? "leaf",
|
|
1952
|
+
size: l,
|
|
1953
|
+
"aria-label": e.label,
|
|
1954
|
+
strings: {
|
|
1955
|
+
placeholder: e.placeholder ?? u.select,
|
|
1956
|
+
search: x,
|
|
1957
|
+
empty: u.noOptionsFound,
|
|
1958
|
+
root: e.label,
|
|
1959
|
+
back: u.previousLevel,
|
|
1960
|
+
selectCurrent: u.selectCurrentLevel
|
|
1961
|
+
},
|
|
1962
|
+
renderValue: n.length > 1 ? () => S : void 0,
|
|
1963
|
+
onValueChange: (e) => a(e == null ? [] : typeof e == "string" ? [e] : [...e])
|
|
1964
|
+
})
|
|
1965
|
+
}) : /* @__PURE__ */ K("div", {
|
|
1966
|
+
className: r("select-facet--component", "relative", s),
|
|
1967
|
+
children: /* @__PURE__ */ K(ue, {
|
|
1917
1968
|
open: d,
|
|
1918
1969
|
onOpenChange: f,
|
|
1919
1970
|
search: !0,
|
|
1920
1971
|
searchValue: p,
|
|
1921
1972
|
onSearchChange: m,
|
|
1922
1973
|
strings: {
|
|
1923
|
-
searchPlaceholder:
|
|
1974
|
+
searchPlaceholder: x,
|
|
1924
1975
|
empty: u.noOptionsFound
|
|
1925
1976
|
},
|
|
1926
1977
|
contentClassName: "w-(--anchor-width) min-w-56",
|
|
1927
|
-
trigger: /* @__PURE__ */
|
|
1978
|
+
trigger: /* @__PURE__ */ q(i, {
|
|
1928
1979
|
tone: "secondary",
|
|
1929
1980
|
buttonStyle: "outline",
|
|
1930
1981
|
size: l,
|
|
1931
1982
|
role: "combobox",
|
|
1932
1983
|
"aria-expanded": d,
|
|
1933
1984
|
className: M(l),
|
|
1934
|
-
children: [h ? n.length === 1 ? /* @__PURE__ */
|
|
1985
|
+
children: [h ? n.length === 1 ? /* @__PURE__ */ K(o, {
|
|
1935
1986
|
tag: "span",
|
|
1936
1987
|
weight: "semibold",
|
|
1937
1988
|
className: "truncate",
|
|
1938
1989
|
children: v(n[0])
|
|
1939
|
-
}) : /* @__PURE__ */
|
|
1990
|
+
}) : /* @__PURE__ */ K(o, {
|
|
1940
1991
|
tag: "span",
|
|
1941
1992
|
weight: "semibold",
|
|
1942
|
-
children:
|
|
1943
|
-
|
|
1944
|
-
filterLabel: (n.length > 1 ? t.pluralLabel : t.label) ?? t.label
|
|
1945
|
-
})
|
|
1946
|
-
}) : /* @__PURE__ */ J(o, {
|
|
1993
|
+
children: S
|
|
1994
|
+
}) : /* @__PURE__ */ K(o, {
|
|
1947
1995
|
tag: "span",
|
|
1948
1996
|
type: "secondary",
|
|
1949
|
-
children:
|
|
1950
|
-
}), /* @__PURE__ */
|
|
1997
|
+
children: e.placeholder ?? u.select
|
|
1998
|
+
}), /* @__PURE__ */ K(Te, { className: "ml-control-gap-small size-icon-sm shrink-0 opacity-50" })]
|
|
1951
1999
|
}),
|
|
1952
|
-
items:
|
|
2000
|
+
items: b,
|
|
1953
2001
|
onSelect: (e) => _(e.value)
|
|
1954
2002
|
})
|
|
1955
2003
|
});
|
|
1956
2004
|
}
|
|
1957
2005
|
//#endregion
|
|
1958
2006
|
//#region src/components/features/filters/facets/async-select-facet.tsx
|
|
1959
|
-
function
|
|
1960
|
-
let { defaultScale: c } =
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
]), { options: S, isLoading: C, isFetching: k, isError: j, refetch: P, isBelowMinQuery: F, minQueryLength:
|
|
1965
|
-
|
|
2007
|
+
function Xt({ filter: e, value: n, onValueChange: a, className: s }) {
|
|
2008
|
+
let { defaultScale: c } = t(), l = N(void 0, c), { strings: d, cacheAsyncOptions: m, getAsyncOptionLabel: h, reportError: g } = $(), [_, v] = W(!1), [y, b] = W(""), x = H(() => /* @__PURE__ */ new Map(), [
|
|
2009
|
+
e.key,
|
|
2010
|
+
e.asyncConfig?.fetcher,
|
|
2011
|
+
e.asyncConfig?.mapToOption
|
|
2012
|
+
]), { options: S, isLoading: C, isFetching: k, isError: j, refetch: P, isBelowMinQuery: F, minQueryLength: ee } = ot(e, y, _, { onError: g });
|
|
2013
|
+
V(() => {
|
|
1966
2014
|
if (S.length !== 0) {
|
|
1967
2015
|
for (let e of S) x.set(e.value, e);
|
|
1968
|
-
m(
|
|
2016
|
+
m(e.key, S);
|
|
1969
2017
|
}
|
|
1970
2018
|
}, [
|
|
1971
2019
|
m,
|
|
1972
|
-
|
|
2020
|
+
e.key,
|
|
1973
2021
|
x,
|
|
1974
2022
|
S
|
|
1975
2023
|
]);
|
|
1976
|
-
let
|
|
1977
|
-
let
|
|
1978
|
-
for (let
|
|
1979
|
-
let n = x.get(
|
|
2024
|
+
let te = e.multiple !== !1, L = e.maxSelected, R = H(() => e.options ?? [], [e.options]), ie = H(() => {
|
|
2025
|
+
let t = new Set(n), r = new Set([...R, ...S].map((e) => e.value)), i = [];
|
|
2026
|
+
for (let t of n) if (!r.has(t)) {
|
|
2027
|
+
let n = x.get(t);
|
|
1980
2028
|
if (n) i.push(n);
|
|
1981
2029
|
else {
|
|
1982
|
-
let n =
|
|
2030
|
+
let n = R.find((e) => e.value === t);
|
|
1983
2031
|
if (n) {
|
|
1984
2032
|
i.push(n);
|
|
1985
2033
|
continue;
|
|
1986
2034
|
}
|
|
1987
|
-
let r = h(
|
|
2035
|
+
let r = h(e.key, t);
|
|
1988
2036
|
r && i.push({
|
|
1989
|
-
value:
|
|
2037
|
+
value: t,
|
|
1990
2038
|
label: r,
|
|
1991
|
-
icon:
|
|
2039
|
+
icon: e.icon
|
|
1992
2040
|
});
|
|
1993
2041
|
}
|
|
1994
2042
|
}
|
|
1995
2043
|
return [
|
|
1996
2044
|
...i,
|
|
1997
|
-
...
|
|
2045
|
+
...R,
|
|
1998
2046
|
...S
|
|
1999
|
-
].sort((
|
|
2047
|
+
].sort((e, n) => +!t.has(e.value) - !t.has(n.value));
|
|
2000
2048
|
}, [
|
|
2001
|
-
|
|
2049
|
+
R,
|
|
2002
2050
|
S,
|
|
2003
2051
|
n,
|
|
2004
|
-
|
|
2005
|
-
|
|
2052
|
+
e.key,
|
|
2053
|
+
e.icon,
|
|
2006
2054
|
x,
|
|
2007
2055
|
h
|
|
2008
|
-
]),
|
|
2009
|
-
if (
|
|
2010
|
-
if (n.includes(
|
|
2056
|
+
]), ae = (t) => {
|
|
2057
|
+
if (te) {
|
|
2058
|
+
if (n.includes(t)) a(n.filter((e) => e !== t));
|
|
2011
2059
|
else {
|
|
2012
|
-
if (
|
|
2013
|
-
a([...n,
|
|
2060
|
+
if (L && n.length >= L) return;
|
|
2061
|
+
a([...n, t]);
|
|
2014
2062
|
}
|
|
2015
|
-
} else a([
|
|
2016
|
-
},
|
|
2017
|
-
let n = S.find((
|
|
2063
|
+
} else a([t]), e.closeOnSelect !== !1 && v(!1);
|
|
2064
|
+
}, oe = (t) => {
|
|
2065
|
+
let n = S.find((e) => e.value === t);
|
|
2018
2066
|
if (n) return n.label;
|
|
2019
|
-
let r =
|
|
2067
|
+
let r = R.find((e) => e.value === t);
|
|
2020
2068
|
if (r) return r.label;
|
|
2021
|
-
let i = x.get(
|
|
2022
|
-
return i ? i.label : h(
|
|
2023
|
-
},
|
|
2069
|
+
let i = x.get(t);
|
|
2070
|
+
return i ? i.label : h(e.key, t) ?? t;
|
|
2071
|
+
}, se = n.length > 0, ce = H(() => C || k ? /* @__PURE__ */ K(f, {
|
|
2024
2072
|
className: "async-select-facet--component",
|
|
2025
2073
|
label: d.searching
|
|
2026
|
-
}) : j ? /* @__PURE__ */
|
|
2074
|
+
}) : j ? /* @__PURE__ */ K(p, {
|
|
2027
2075
|
variant: "inline",
|
|
2028
2076
|
title: d.fetchError,
|
|
2029
|
-
action: /* @__PURE__ */
|
|
2077
|
+
action: /* @__PURE__ */ K(i, {
|
|
2030
2078
|
tone: "secondary",
|
|
2031
2079
|
buttonStyle: "outline",
|
|
2032
2080
|
size: "sm",
|
|
@@ -2035,15 +2083,15 @@ function It({ filter: t, value: n, onValueChange: a, className: s }) {
|
|
|
2035
2083
|
},
|
|
2036
2084
|
children: d.retryFetch
|
|
2037
2085
|
})
|
|
2038
|
-
}) : F ? /* @__PURE__ */
|
|
2086
|
+
}) : F ? /* @__PURE__ */ K("div", {
|
|
2039
2087
|
className: "text-muted-foreground flex items-center justify-center py-space-xl",
|
|
2040
|
-
children: /* @__PURE__ */
|
|
2088
|
+
children: /* @__PURE__ */ K(o, {
|
|
2041
2089
|
tag: "span",
|
|
2042
2090
|
size: "xs",
|
|
2043
2091
|
type: "secondary",
|
|
2044
|
-
children:
|
|
2092
|
+
children: Y(d.minQueryHint, { min: ee })
|
|
2045
2093
|
})
|
|
2046
|
-
}) : /* @__PURE__ */
|
|
2094
|
+
}) : /* @__PURE__ */ K(o, {
|
|
2047
2095
|
tag: "span",
|
|
2048
2096
|
type: "secondary",
|
|
2049
2097
|
children: d.noOptionsFound
|
|
@@ -2052,75 +2100,75 @@ function It({ filter: t, value: n, onValueChange: a, className: s }) {
|
|
|
2052
2100
|
k,
|
|
2053
2101
|
j,
|
|
2054
2102
|
F,
|
|
2055
|
-
|
|
2103
|
+
ee,
|
|
2056
2104
|
d,
|
|
2057
2105
|
P
|
|
2058
2106
|
]);
|
|
2059
|
-
return /* @__PURE__ */
|
|
2107
|
+
return /* @__PURE__ */ K("div", {
|
|
2060
2108
|
className: r("async-select-facet--component relative", s),
|
|
2061
|
-
children: /* @__PURE__ */
|
|
2109
|
+
children: /* @__PURE__ */ q(ne, {
|
|
2062
2110
|
open: _,
|
|
2063
2111
|
onOpenChange: (e) => {
|
|
2064
2112
|
v(e), e || b("");
|
|
2065
2113
|
},
|
|
2066
|
-
children: [/* @__PURE__ */
|
|
2114
|
+
children: [/* @__PURE__ */ K(I, { render: /* @__PURE__ */ q(i, {
|
|
2067
2115
|
tone: "secondary",
|
|
2068
2116
|
buttonStyle: "outline",
|
|
2069
2117
|
size: l,
|
|
2070
2118
|
role: "combobox",
|
|
2071
2119
|
"aria-expanded": _,
|
|
2072
2120
|
className: M(l),
|
|
2073
|
-
children: [
|
|
2121
|
+
children: [se ? n.length === 1 ? /* @__PURE__ */ K(o, {
|
|
2074
2122
|
tag: "span",
|
|
2075
2123
|
weight: "semibold",
|
|
2076
2124
|
className: "truncate",
|
|
2077
|
-
children:
|
|
2078
|
-
}) : /* @__PURE__ */
|
|
2125
|
+
children: oe(n[0])
|
|
2126
|
+
}) : /* @__PURE__ */ K(o, {
|
|
2079
2127
|
tag: "span",
|
|
2080
2128
|
weight: "semibold",
|
|
2081
|
-
children:
|
|
2129
|
+
children: Y(d.selected, {
|
|
2082
2130
|
count: n.length,
|
|
2083
|
-
filterLabel: (n.length > 1 ?
|
|
2131
|
+
filterLabel: Q((n.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
2084
2132
|
})
|
|
2085
|
-
}) : /* @__PURE__ */
|
|
2133
|
+
}) : /* @__PURE__ */ K(o, {
|
|
2086
2134
|
tag: "span",
|
|
2087
2135
|
type: "secondary",
|
|
2088
|
-
children:
|
|
2089
|
-
}), /* @__PURE__ */
|
|
2090
|
-
}) }), /* @__PURE__ */
|
|
2136
|
+
children: e.placeholder ?? d.select
|
|
2137
|
+
}), /* @__PURE__ */ K(Te, { className: "ml-control-gap-small size-icon-sm shrink-0 opacity-50" })]
|
|
2138
|
+
}) }), /* @__PURE__ */ K(re, {
|
|
2091
2139
|
type: "menu",
|
|
2092
2140
|
inset: "flush",
|
|
2093
2141
|
className: "w-full min-w-70 gap-0",
|
|
2094
|
-
children: /* @__PURE__ */
|
|
2142
|
+
children: /* @__PURE__ */ q(A, {
|
|
2095
2143
|
shouldFilter: !1,
|
|
2096
2144
|
inset: "flush",
|
|
2097
2145
|
className: "rounded-none",
|
|
2098
|
-
children: [/* @__PURE__ */
|
|
2099
|
-
placeholder:
|
|
2146
|
+
children: [/* @__PURE__ */ K(T, {
|
|
2147
|
+
placeholder: Y(d.searchPlaceholder, { filterLabel: e.label }),
|
|
2100
2148
|
value: y,
|
|
2101
2149
|
onValueChange: b
|
|
2102
|
-
}), /* @__PURE__ */
|
|
2150
|
+
}), /* @__PURE__ */ K(D, { children: ie.length === 0 ? /* @__PURE__ */ K(E, { children: ce }) : /* @__PURE__ */ q(O, { children: [!(!k || C) && /* @__PURE__ */ q(u, {
|
|
2103
2151
|
direction: "horizontal",
|
|
2104
2152
|
gap: "sm",
|
|
2105
2153
|
wrap: !1,
|
|
2106
2154
|
className: "px-control-sm py-space-xs",
|
|
2107
|
-
children: [/* @__PURE__ */
|
|
2155
|
+
children: [/* @__PURE__ */ K(De, { className: "text-muted-foreground size-icon-sm animate-spin" }), /* @__PURE__ */ K(o, {
|
|
2108
2156
|
tag: "span",
|
|
2109
2157
|
size: "xs",
|
|
2110
2158
|
type: "secondary",
|
|
2111
2159
|
children: d.searching
|
|
2112
2160
|
})]
|
|
2113
|
-
}),
|
|
2161
|
+
}), ie.map((e) => /* @__PURE__ */ q(w, {
|
|
2114
2162
|
value: e.value,
|
|
2115
|
-
onSelect: () =>
|
|
2116
|
-
disabled: e.disabled || !!
|
|
2163
|
+
onSelect: () => ae(e.value),
|
|
2164
|
+
disabled: e.disabled || !!L && n.length >= L && !n.includes(e.value),
|
|
2117
2165
|
children: [
|
|
2118
|
-
/* @__PURE__ */
|
|
2119
|
-
!!e.icon && /* @__PURE__ */
|
|
2166
|
+
/* @__PURE__ */ K(Se, { className: r("mr-control-gap size-icon-sm", n.includes(e.value) ? "opacity-100" : "opacity-0") }),
|
|
2167
|
+
!!e.icon && /* @__PURE__ */ K("span", {
|
|
2120
2168
|
className: "mr-1.5",
|
|
2121
2169
|
children: e.icon
|
|
2122
2170
|
}),
|
|
2123
|
-
/* @__PURE__ */
|
|
2171
|
+
/* @__PURE__ */ K(o, {
|
|
2124
2172
|
tag: "span",
|
|
2125
2173
|
children: e.label
|
|
2126
2174
|
})
|
|
@@ -2133,33 +2181,33 @@ function It({ filter: t, value: n, onValueChange: a, className: s }) {
|
|
|
2133
2181
|
}
|
|
2134
2182
|
//#endregion
|
|
2135
2183
|
//#region src/components/features/filters/facets/range-facet.tsx
|
|
2136
|
-
function
|
|
2137
|
-
let { strings: o } = $(), [s, c] =
|
|
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) => {
|
|
2138
2186
|
(e.min !== t.min || e.max !== t.max) && n(e);
|
|
2139
2187
|
}, e.delay ?? 300);
|
|
2140
|
-
return
|
|
2188
|
+
return V(() => (m({
|
|
2141
2189
|
min: s ? Number(s) : void 0,
|
|
2142
2190
|
max: d ? Number(d) : void 0
|
|
2143
2191
|
}), m.cancel), [
|
|
2144
2192
|
s,
|
|
2145
2193
|
d,
|
|
2146
2194
|
m
|
|
2147
|
-
]), /* @__PURE__ */
|
|
2195
|
+
]), /* @__PURE__ */ K(u, {
|
|
2148
2196
|
gap: "md",
|
|
2149
2197
|
className: r("range-facet--component", i),
|
|
2150
|
-
children: /* @__PURE__ */
|
|
2198
|
+
children: /* @__PURE__ */ q(l, {
|
|
2151
2199
|
columns: {
|
|
2152
2200
|
base: 1,
|
|
2153
2201
|
sm: 2
|
|
2154
2202
|
},
|
|
2155
2203
|
gap: "md",
|
|
2156
|
-
children: [/* @__PURE__ */
|
|
2204
|
+
children: [/* @__PURE__ */ q(u, {
|
|
2157
2205
|
gap: "xs",
|
|
2158
|
-
children: [/* @__PURE__ */
|
|
2206
|
+
children: [/* @__PURE__ */ K(a, {
|
|
2159
2207
|
htmlFor: `${p}-min`,
|
|
2160
2208
|
className: "text-inherit",
|
|
2161
2209
|
children: o.min
|
|
2162
|
-
}), /* @__PURE__ */
|
|
2210
|
+
}), /* @__PURE__ */ K(P, {
|
|
2163
2211
|
id: `${p}-min`,
|
|
2164
2212
|
type: "text",
|
|
2165
2213
|
value: s,
|
|
@@ -2170,13 +2218,13 @@ function Lt({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
|
2170
2218
|
placeholder: o.min,
|
|
2171
2219
|
className: "w-full"
|
|
2172
2220
|
})]
|
|
2173
|
-
}), /* @__PURE__ */
|
|
2221
|
+
}), /* @__PURE__ */ q(u, {
|
|
2174
2222
|
gap: "xs",
|
|
2175
|
-
children: [/* @__PURE__ */
|
|
2223
|
+
children: [/* @__PURE__ */ K(a, {
|
|
2176
2224
|
htmlFor: `${p}-max`,
|
|
2177
2225
|
className: "text-inherit",
|
|
2178
2226
|
children: o.max
|
|
2179
|
-
}), /* @__PURE__ */
|
|
2227
|
+
}), /* @__PURE__ */ K(P, {
|
|
2180
2228
|
id: `${p}-max`,
|
|
2181
2229
|
type: "text",
|
|
2182
2230
|
value: d,
|
|
@@ -2193,17 +2241,17 @@ function Lt({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
|
2193
2241
|
}
|
|
2194
2242
|
//#endregion
|
|
2195
2243
|
//#region src/components/features/filters/validators.ts
|
|
2196
|
-
function
|
|
2244
|
+
function Qt(e) {
|
|
2197
2245
|
return (t) => {
|
|
2198
2246
|
if (t == null || typeof t == "string" && t.length === 0) return !0;
|
|
2199
2247
|
let n = e.safeParse(t);
|
|
2200
2248
|
return n.success ? !0 : n.error?.issues?.[0]?.message ?? n.error?.message ?? !1;
|
|
2201
2249
|
};
|
|
2202
2250
|
}
|
|
2203
|
-
function
|
|
2251
|
+
function $t(e, t) {
|
|
2204
2252
|
return (n) => e(n) ? !0 : t;
|
|
2205
2253
|
}
|
|
2206
2254
|
//#endregion
|
|
2207
|
-
export {
|
|
2255
|
+
export { Be as A, Ye as C, Re as D, ze as E, Pe as F, Me as I, Ne as L, Fe as M, Z as N, Ve as O, X as P, Y as R, Xe as S, $ as T, pt as _, Yt as a, it as b, qt as c, kt as d, Et as f, yt as g, Ct as h, Xt as i, Ie as j, Le as k, Nt as l, wt as m, Qt as n, Jt as o, Tt as p, Zt as r, Kt as s, $t as t, At as u, ut as v, Je as w, Ze as x, ot as y };
|
|
2208
2256
|
|
|
2209
|
-
//# sourceMappingURL=filters-
|
|
2257
|
+
//# sourceMappingURL=filters-DzgSJpMK.js.map
|