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