themelia-react-ui 1.0.0 → 1.0.2
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 +190 -1
- package/README.md +92 -13
- package/dist/{accordion-BRWh3BM1.js → accordion-BRTcsp8J.js} +8 -8
- package/dist/accordion-BRTcsp8J.js.map +1 -0
- package/dist/{action-menu-Cx3SdfbN.js → action-menu-Drxw_vJk.js} +36 -36
- package/dist/action-menu-Drxw_vJk.js.map +1 -0
- package/dist/affordance-geometry.generated-CL84ZN9A.js +63 -0
- package/dist/affordance-geometry.generated-CL84ZN9A.js.map +1 -0
- package/dist/{ai-artifact-DkOArd3-.js → ai-artifact-DLVdK0Py.js} +151 -155
- package/dist/ai-artifact-DLVdK0Py.js.map +1 -0
- package/dist/{app-shell-BH_bGcE2.js → app-shell-C_fKpljx.js} +11 -10
- package/dist/app-shell-C_fKpljx.js.map +1 -0
- package/dist/{attachment-DsLgNHXt.js → attachment-DbjUWsP0.js} +12 -12
- package/dist/{attachment-DsLgNHXt.js.map → attachment-DbjUWsP0.js.map} +1 -1
- package/dist/auth-CAQcasMV.js +723 -0
- package/dist/auth-CAQcasMV.js.map +1 -0
- package/dist/{avatar-CsnWaYmt.js → avatar-Bu2HhitA.js} +76 -71
- package/dist/avatar-Bu2HhitA.js.map +1 -0
- package/dist/{badge-BZXZT9wd.js → badge-CzId1Wlm.js} +4 -4
- package/dist/{badge-BZXZT9wd.js.map → badge-CzId1Wlm.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/buttons.js +3 -2
- package/dist/base/cards.js +3 -3
- package/dist/base/carousel.js +25 -27
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +150 -148
- package/dist/base/cascader.js.map +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +3 -2
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +1 -1
- package/dist/base/command.js +1 -1
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +3 -3
- package/dist/base/display.js +7 -7
- package/dist/base/feedback.js +4 -3
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +233 -0
- package/dist/base/inline-edit.js.map +1 -0
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/navigation.js +6 -6
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +1 -1
- package/dist/base/repeaters.js +33 -33
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +1 -1
- package/dist/base/signature-pad.js +83 -81
- package/dist/base/signature-pad.js.map +1 -1
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +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 +6 -6
- 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/blocks/admin.js +134 -134
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +120 -117
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +3 -0
- package/dist/blocks/analytics.js +530 -491
- package/dist/blocks/analytics.js.map +1 -1
- package/dist/blocks/collaboration.js +2 -2
- package/dist/blocks/commerce/receipt.js +1 -1
- package/dist/blocks/commerce.js +395 -383
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +1 -1
- package/dist/blocks/onboarding.js +6 -6
- package/dist/blocks/onboarding.js.map +1 -1
- package/dist/blocks/planning.js +311 -0
- package/dist/blocks/planning.js.map +1 -0
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-DdQ_I5ra.js → breadcrumbs-BuYz5SDU.js} +9 -8
- package/dist/breadcrumbs-BuYz5SDU.js.map +1 -0
- package/dist/button-BZDasD04.js +651 -0
- package/dist/button-BZDasD04.js.map +1 -0
- package/dist/{button-BS6l5JUw.js → button-BZyfTvwm.js} +3 -3
- package/dist/button-BZyfTvwm.js.map +1 -0
- package/dist/buttons-D_6KJvEE.js +99 -0
- package/dist/buttons-D_6KJvEE.js.map +1 -0
- package/dist/{cards-BMB0laLG.js → cards-qGSErLw_.js} +12 -12
- package/dist/{cards-BMB0laLG.js.map → cards-qGSErLw_.js.map} +1 -1
- package/dist/chart-Bsc5BICK.js +150 -0
- package/dist/chart-Bsc5BICK.js.map +1 -0
- package/dist/checkbox-BQNDjUCh.js +34 -0
- package/dist/checkbox-BQNDjUCh.js.map +1 -0
- package/dist/choice-inputs-Mk3iWbhr.js +725 -0
- package/dist/choice-inputs-Mk3iWbhr.js.map +1 -0
- package/dist/{code-block-DIlqzoiD.js → code-block-DzHKRybS.js} +23 -23
- package/dist/code-block-DzHKRybS.js.map +1 -0
- package/dist/{collapsible-DsnktFNv.js → collapsible-ClvC7Bj3.js} +3 -3
- package/dist/{collapsible-DsnktFNv.js.map → collapsible-ClvC7Bj3.js.map} +1 -1
- package/dist/{collection-content-C4fthJV_.js → collection-content-D6S8cv_n.js} +3 -3
- package/dist/{collection-content-C4fthJV_.js.map → collection-content-D6S8cv_n.js.map} +1 -1
- package/dist/{combobox-HDftpzxt.js → combobox-BFnbJJp3.js} +18 -18
- package/dist/combobox-BFnbJJp3.js.map +1 -0
- package/dist/{combobox-CHD750do.js → combobox-hozNwUcc.js} +313 -316
- package/dist/combobox-hozNwUcc.js.map +1 -0
- package/dist/{command-D0kWBZfd.js → command-BnmSchli.js} +9 -9
- package/dist/command-BnmSchli.js.map +1 -0
- package/dist/comments-u5L0OGip.js +1156 -0
- package/dist/comments-u5L0OGip.js.map +1 -0
- package/dist/components/base/buttons/button-group.recipes.d.ts +1 -1
- package/dist/components/base/buttons/button.recipes.d.ts +10 -19
- package/dist/components/base/buttons/use-pending-button-focus.d.ts +3 -0
- package/dist/components/base/cards/card.recipes.d.ts +13 -5
- package/dist/components/base/cards/partials/card-primitives.d.ts +9 -4
- package/dist/components/base/cards/smart-card.types.d.ts +3 -1
- package/dist/components/base/date-pickers/date-picker.recipes.d.ts +5 -18
- package/dist/components/base/date-pickers/datepicker.types.d.ts +3 -0
- package/dist/components/base/forms/form-field.d.ts +1 -0
- package/dist/components/base/forms/form-sizing.d.ts +3 -3
- package/dist/components/base/inline-edit/index.d.ts +2 -0
- package/dist/components/base/inline-edit/inline-edit.d.ts +81 -0
- package/dist/components/base/inline-edit/inline-edit.recipes.d.ts +6 -0
- package/dist/components/base/navigation/tabs.d.ts +3 -5
- package/dist/components/base/popover/popover.recipes.d.ts +3 -3
- package/dist/components/base/structure/structure.recipes.d.ts +6 -0
- package/dist/components/base/table/index.d.ts +1 -1
- package/dist/components/base/text-inputs/clear-native-field.d.ts +2 -0
- package/dist/components/base/text-inputs/input-trailing-action.d.ts +3 -0
- package/dist/components/blocks/analytics/index.d.ts +1 -0
- package/dist/components/blocks/analytics/types.d.ts +1 -1
- package/dist/components/blocks/analytics/usage-card/index.d.ts +3 -0
- package/dist/components/blocks/analytics/usage-card/types.d.ts +52 -0
- package/dist/components/blocks/analytics/usage-card/usage-card.d.ts +6 -0
- package/dist/components/blocks/analytics/usage-card/usage-card.data.d.ts +19 -0
- package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +22 -0
- package/dist/components/blocks/collaboration/message/message.recipes.d.ts +12 -0
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/document-stack.d.ts +1 -4
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/inbox-clean.d.ts +1 -4
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/index.d.ts +3 -3
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/stacked-cards.d.ts +1 -6
- package/dist/components/blocks/planning/index.d.ts +3 -0
- package/dist/components/blocks/planning/task-card.d.ts +3 -0
- package/dist/components/blocks/planning/task-card.strings.d.ts +15 -0
- package/dist/components/blocks/planning/task-card.types.d.ts +66 -0
- package/dist/components/features/combobox/components/error-message.d.ts +1 -1
- package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -0
- package/dist/components/features/filters/facets/search-facet.d.ts +0 -12
- package/dist/components/features/filters/facets/tags-facet.d.ts +1 -1
- package/dist/components/features/media-library/media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.types.d.ts +9 -1
- package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
- package/dist/components/features/overlays/hooks/use-pending-overlay-focus.d.ts +2 -0
- package/dist/components/features/overlays/overlays.types.d.ts +5 -4
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +2 -1
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/table.types.d.ts +1 -1
- package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +3 -1
- package/dist/components/layout/auth/auth.types.d.ts +1 -0
- package/dist/components/layout/page/page.d.ts +0 -1
- package/dist/components/layout/page/page.types.d.ts +9 -3
- package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -1
- package/dist/components/layout/sidebar/sidebar.types.d.ts +4 -0
- package/dist/components/layout/workspace/workspace.types.d.ts +3 -0
- package/dist/components/typography/heading.d.ts +5 -2
- package/dist/components/typography/index.d.ts +1 -1
- package/dist/components/typography/text.styles.d.ts +10 -0
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/table.d.ts +2 -1
- package/dist/container.recipes-D9t8MHR3.js +27 -0
- package/dist/container.recipes-D9t8MHR3.js.map +1 -0
- package/dist/{containers-CPNyNo1_.js → containers-DqB-bSYE.js} +34 -56
- package/dist/containers-DqB-bSYE.js.map +1 -0
- package/dist/control-group-recipes-DBXmfh2E.js +21 -0
- package/dist/control-group-recipes-DBXmfh2E.js.map +1 -0
- package/dist/{copyable-B7SBXJMr.js → copyable-BTSByfmq.js} +6 -6
- package/dist/{copyable-B7SBXJMr.js.map → copyable-BTSByfmq.js.map} +1 -1
- package/dist/{data-display-b3d1TfL4.js → data-display-Bihs9Ven.js} +542 -329
- package/dist/data-display-Bihs9Ven.js.map +1 -0
- package/dist/{date-BFNMnrS5.js → date-DOKhJPu7.js} +4 -4
- package/dist/{date-BFNMnrS5.js.map → date-DOKhJPu7.js.map} +1 -1
- package/dist/{date-picker-DI6kPNof.js → date-picker-DzP5HQq7.js} +492 -472
- package/dist/date-picker-DzP5HQq7.js.map +1 -0
- package/dist/date-pickers-BpgGz7S-.js +196 -0
- package/dist/date-pickers-BpgGz7S-.js.map +1 -0
- package/dist/{display-ByI5tkqy.js → display-CS6Hbk18.js} +8 -8
- package/dist/{display-ByI5tkqy.js.map → display-CS6Hbk18.js.map} +1 -1
- package/dist/{dropdown-menu-BlnyHr-9.js → dropdown-menu-D-boNgGO.js} +7 -7
- package/dist/{dropdown-menu-BlnyHr-9.js.map → dropdown-menu-D-boNgGO.js.map} +1 -1
- package/dist/features/activities.js +152 -141
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +182 -179
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/async-preview.js +9 -9
- 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 +25 -23
- package/dist/features/data-view.js.map +1 -1
- package/dist/features/email-composer/engine.js +1 -1
- package/dist/features/email-composer.js +103 -104
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +375 -373
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +222 -224
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +29 -29
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map.js +59 -58
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +856 -855
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +1 -1
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +1210 -1209
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +133 -132
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +29 -31
- package/dist/features/resource-assignment.js.map +1 -1
- package/dist/features/resource.js +13 -13
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +82 -82
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +4 -4
- package/dist/features/sync.js.map +1 -1
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +456 -450
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-CJkUAapr.js +233 -0
- package/dist/feedback-CJkUAapr.js.map +1 -0
- package/dist/field-affordance-recipes-uKY4MsZ_.js +25 -0
- package/dist/field-affordance-recipes-uKY4MsZ_.js.map +1 -0
- package/dist/{field-state-recipes-CBTRt9Bt.js → field-state-recipes-DQQpiLWC.js} +3 -3
- package/dist/field-state-recipes-DQQpiLWC.js.map +1 -0
- package/dist/{filters-qtrcv1hf.js → filters-D6FF8L6s.js} +715 -720
- package/dist/filters-D6FF8L6s.js.map +1 -0
- package/dist/{form-field-C6W-y2hR.js → form-field-CZwrkP7m.js} +17 -9
- package/dist/form-field-CZwrkP7m.js.map +1 -0
- package/dist/{form-sizing-39NohSqn.js → form-sizing-QP8aIRaW.js} +10 -6
- package/dist/form-sizing-QP8aIRaW.js.map +1 -0
- package/dist/{forms-BF-HSbff.js → forms-B5NCbkSC.js} +35 -35
- package/dist/{forms-BF-HSbff.js.map → forms-B5NCbkSC.js.map} +1 -1
- package/dist/forms-numeric-Crrm80Lm.js +867 -0
- package/dist/forms-numeric-Crrm80Lm.js.map +1 -0
- package/dist/{header-B8ex54cY.js → header-kxruN3RM.js} +53 -49
- package/dist/header-kxruN3RM.js.map +1 -0
- package/dist/{hooks-D6UBVzf2.js → hooks-BrlnCwQd.js} +2 -2
- package/dist/{hooks-D6UBVzf2.js.map → hooks-BrlnCwQd.js.map} +1 -1
- package/dist/{http-CLTVJc5I.js → http-CdEIHyQf.js} +2 -2
- package/dist/http-CdEIHyQf.js.map +1 -0
- package/dist/{icon-badge-Dv0RYQwj.js → icon-badge-Btc6pQrp.js} +4 -4
- package/dist/{icon-badge-Dv0RYQwj.js.map → icon-badge-Btc6pQrp.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/input-SX9V0AL3.js +255 -0
- package/dist/input-SX9V0AL3.js.map +1 -0
- package/dist/input-vxcaNCYC.js +20 -0
- package/dist/input-vxcaNCYC.js.map +1 -0
- package/dist/{item-pJ0GsOiJ.js → item-DE4YnuJx.js} +18 -17
- package/dist/item-DE4YnuJx.js.map +1 -0
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/auth.js +1 -1
- package/dist/layout/containers.js +1 -1
- package/dist/layout/header.js +1 -1
- package/dist/layout/hooks.js +1 -1
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.js +1 -1
- package/dist/layout/settings.js +1 -1
- package/dist/layout/sidebar.js +2 -2
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +10 -10
- package/dist/lib/affordance-geometry.generated.d.ts +44 -4
- package/dist/lib/control-group-recipes.d.ts +22 -0
- package/dist/lib/field-affordance-recipes.d.ts +35 -2
- package/dist/lib/field-state-recipes.d.ts +2 -2
- package/dist/lib/navigation-row-recipes.d.ts +3 -2
- package/dist/lib/overlay-anatomy-recipes.d.ts +1 -1
- package/dist/lib/surface-recipes.d.ts +5 -2
- package/dist/lib/token-merge.generated.d.ts +144 -2
- package/dist/lib/ui-provider/types.d.ts +4 -2
- package/dist/lib/use-prefers-reduced-motion.d.ts +2 -0
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-Ca4YmvBi.js → media-gallery-DLp3HAz0.js} +75 -74
- package/dist/media-gallery-DLp3HAz0.js.map +1 -0
- package/dist/{mentions-CRio8mTm.js → mentions-Cl0Kt_Pd.js} +52 -50
- package/dist/{mentions-CRio8mTm.js.map → mentions-Cl0Kt_Pd.js.map} +1 -1
- package/dist/message-SZUNB1eX.js +127 -0
- package/dist/message-SZUNB1eX.js.map +1 -0
- package/dist/{navigation-BTrEb5u4.js → navigation-DnQSNMT0.js} +64 -55
- package/dist/navigation-DnQSNMT0.js.map +1 -0
- package/dist/{navigation-DqEITuD2.js → navigation-DyytsLRB.js} +37 -37
- package/dist/navigation-DyytsLRB.js.map +1 -0
- package/dist/{navigation-row-recipes-BFpvGPGE.js → navigation-row-recipes-DQEXQcqY.js} +3 -3
- package/dist/navigation-row-recipes-DQEXQcqY.js.map +1 -0
- package/dist/{number-BNT_BIzJ.js → number-DasMFWEG.js} +4 -4
- package/dist/{number-BNT_BIzJ.js.map → number-DasMFWEG.js.map} +1 -1
- package/dist/overlays-DUbs1KEi.js +1011 -0
- package/dist/overlays-DUbs1KEi.js.map +1 -0
- package/dist/{page-BMBGjJY8.js → page-hGmT4nWK.js} +75 -64
- package/dist/page-hGmT4nWK.js.map +1 -0
- package/dist/{page-header-BH41wCyY.js → page-header-D8nERkn5.js} +9 -9
- package/dist/page-header-D8nERkn5.js.map +1 -0
- package/dist/{pagination-C29vvt3I.js → pagination-NLGqRirf.js} +20 -20
- package/dist/pagination-NLGqRirf.js.map +1 -0
- package/dist/{popover-TInGXsjg.js → popover-CghIYdQf.js} +23 -22
- package/dist/popover-CghIYdQf.js.map +1 -0
- package/dist/{popover-menu-BzqXqE72.js → popover-menu-B4PoWhRl.js} +6 -6
- package/dist/{popover-menu-BzqXqE72.js.map → popover-menu-B4PoWhRl.js.map} +1 -1
- package/dist/{popover.recipes-zgBhMlUu.js → popover.recipes-QlD4JenO.js} +5 -5
- package/dist/popover.recipes-QlD4JenO.js.map +1 -0
- package/dist/{primitives-DKPOGVpj.js → primitives-C7ff0QaI.js} +120 -113
- package/dist/primitives-C7ff0QaI.js.map +1 -0
- package/dist/primitives.js +3 -3
- package/dist/progress-BroqrAyV.js +169 -0
- package/dist/progress-BroqrAyV.js.map +1 -0
- package/dist/{receipt-DYWTQGEc.js → receipt-BuJynLgf.js} +8 -8
- package/dist/{receipt-DYWTQGEc.js.map → receipt-BuJynLgf.js.map} +1 -1
- package/dist/{rich-text-B7sBAdDG.js → rich-text-DlxDOtf4.js} +4 -4
- package/dist/{rich-text-B7sBAdDG.js.map → rich-text-DlxDOtf4.js.map} +1 -1
- package/dist/rich-text-editor-BKyG7rWz.js +574 -0
- package/dist/rich-text-editor-BKyG7rWz.js.map +1 -0
- package/dist/{rich-text-editor.recipes-DxvOE0Lp.js → rich-text-editor.recipes-B72Nfuze.js} +35 -26
- package/dist/rich-text-editor.recipes-B72Nfuze.js.map +1 -0
- package/dist/{scroll-area-BheMQ270.js → scroll-area-D-pIhEKl.js} +3 -3
- package/dist/scroll-area-D-pIhEKl.js.map +1 -0
- package/dist/{separator-Gk_WXH-l.js → separator-BNIgG3au.js} +3 -3
- package/dist/{separator-Gk_WXH-l.js.map → separator-BNIgG3au.js.map} +1 -1
- package/dist/{separator-DO0EbCEm.js → separator-BhtFyo4x.js} +2 -2
- package/dist/{separator-DO0EbCEm.js.map → separator-BhtFyo4x.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/{settings-D9f_wdIC.js → settings-DOTOzeZ2.js} +10 -9
- package/dist/{settings-D9f_wdIC.js.map → settings-DOTOzeZ2.js.map} +1 -1
- package/dist/{sheet-vOUloJ4O.js → sheet-BFhrNehm.js} +11 -11
- package/dist/sheet-BFhrNehm.js.map +1 -0
- package/dist/{sidebar-CNBKFDRW.js → sidebar-CyR4XKwR.js} +219 -200
- package/dist/sidebar-CyR4XKwR.js.map +1 -0
- package/dist/{sidebar-C3UKkbC5.js → sidebar-SvGJ0Zwi.js} +63 -58
- package/dist/sidebar-SvGJ0Zwi.js.map +1 -0
- package/dist/{skeleton-BvRhK8y-.js → skeleton-3F0uhYn3.js} +4 -4
- package/dist/{skeleton-BvRhK8y-.js.map → skeleton-3F0uhYn3.js.map} +1 -1
- package/dist/{smart-card-B5FcKODh.js → smart-card-DjGVV2xr.js} +206 -199
- package/dist/smart-card-DjGVV2xr.js.map +1 -0
- package/dist/{spinner-JtlFJ7Nc.js → spinner-Cpf7oRkF.js} +5 -5
- package/dist/{spinner-JtlFJ7Nc.js.map → spinner-Cpf7oRkF.js.map} +1 -1
- package/dist/{structure-BvW4vG4H.js → structure-CRdqVawd.js} +14 -14
- package/dist/{structure-BvW4vG4H.js.map → structure-CRdqVawd.js.map} +1 -1
- package/dist/{structure.recipes-DjqnBpwz.js → structure.recipes-Bqhf9oIh.js} +2 -2
- package/dist/structure.recipes-Bqhf9oIh.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/{surface-recipes-CQfRr-VL.js → surface-recipes-Dd__PD-w.js} +4 -3
- package/dist/surface-recipes-Dd__PD-w.js.map +1 -0
- package/dist/{table-DnlAJ-xR.js → table-CLtJTxoR.js} +17 -16
- package/dist/table-CLtJTxoR.js.map +1 -0
- package/dist/table-CcRDZiLP.js +1444 -0
- package/dist/table-CcRDZiLP.js.map +1 -0
- package/dist/tabs-BNgu7g0u.js +188 -0
- package/dist/tabs-BNgu7g0u.js.map +1 -0
- package/dist/text-inputs-DsR56TR-.js +330 -0
- package/dist/text-inputs-DsR56TR-.js.map +1 -0
- package/dist/{text.styles-BwB7vAF2.js → text.styles-Q4sGAIgA.js} +18 -10
- package/dist/text.styles-Q4sGAIgA.js.map +1 -0
- package/dist/theme.css +77 -115
- package/dist/{timelines-CnZ2S_Gr.js → timelines-D1pkt3se.js} +84 -78
- package/dist/timelines-D1pkt3se.js.map +1 -0
- package/dist/{tree-COD9BGdU.js → tree-BtmYyMZV.js} +8 -8
- package/dist/{tree-COD9BGdU.js.map → tree-BtmYyMZV.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/typography-BxQgiZyw.js +96 -0
- package/dist/typography-BxQgiZyw.js.map +1 -0
- package/dist/typography.js +1 -1
- package/dist/{ui-provider-CftIB6TY.js → ui-provider-DRPn3qNl.js} +3 -2
- package/dist/ui-provider-DRPn3qNl.js.map +1 -0
- package/dist/ui-provider.js +1 -1
- package/dist/{upload-DIzw1dx1.js → upload-CDbYw1WN.js} +326 -323
- package/dist/upload-CDbYw1WN.js.map +1 -0
- package/dist/{upload-queue-xRJ3qDmd.js → upload-queue-CNd_hH_a.js} +25 -25
- package/dist/upload-queue-CNd_hH_a.js.map +1 -0
- package/dist/usage-card-VyJLUwRr.js +457 -0
- package/dist/usage-card-VyJLUwRr.js.map +1 -0
- package/dist/utils-BvH9PSmq.js +4275 -0
- package/dist/utils-BvH9PSmq.js.map +1 -0
- package/dist/value-inputs-D0KCrfVC.js +840 -0
- package/dist/value-inputs-D0KCrfVC.js.map +1 -0
- package/dist/{workspace-Cbqz4FzN.js → workspace-CcR8r-Nt.js} +115 -122
- package/dist/workspace-CcR8r-Nt.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +112 -18
- package/docs/consumer-skill/examples/analytics.tsx +34 -0
- package/docs/consumer-skill/examples/app-layout.tsx +42 -12
- package/docs/consumer-skill/examples/detail.tsx +24 -9
- package/docs/consumer-skill/examples/manifest.json +27 -1
- package/docs/consumer-skill/examples/planning-usage-edit.tsx +29 -0
- package/docs/consumer-skill/examples/scoped-directory.tsx +77 -0
- package/docs/consumer-skill/examples/website.tsx +56 -0
- package/docs/consumer-skill/references/analytics.md +70 -0
- package/docs/consumer-skill/references/composition.md +219 -2
- package/docs/consumer-skill/references/design-contract.md +37 -10
- package/docs/consumer-skill/references/discovery.md +93 -5
- package/docs/consumer-skill/references/installation.md +20 -3
- package/docs/consumer-skill/references/integration.md +26 -0
- package/docs/consumer-skill/references/public-api.json +2416 -388
- package/docs/consumer-skill/references/review.md +126 -0
- package/docs/consumer-skill/references/theming.md +52 -7
- package/docs/consumer-skill/references/tokens.json +177 -9
- package/docs/consumer-skill/references/workflows.md +129 -1
- package/docs/consumer-skill/scripts/check-composition.mjs +31 -0
- package/docs/consumer-skill/scripts/composition-policy.mjs +317 -0
- package/docs/consumer-skill/scripts/discovery.mjs +65 -8
- package/docs/consumer-skill/scripts/surface-policy.mjs +66 -0
- package/package.json +30 -6
- package/dist/accordion-BRWh3BM1.js.map +0 -1
- package/dist/action-menu-Cx3SdfbN.js.map +0 -1
- package/dist/affordance-geometry.generated-DXl-Zb3Z.js +0 -23
- package/dist/affordance-geometry.generated-DXl-Zb3Z.js.map +0 -1
- package/dist/ai-artifact-DkOArd3-.js.map +0 -1
- package/dist/app-shell-BH_bGcE2.js.map +0 -1
- package/dist/auth-BDB1V_2q.js +0 -704
- package/dist/auth-BDB1V_2q.js.map +0 -1
- package/dist/avatar-CsnWaYmt.js.map +0 -1
- package/dist/breadcrumbs-DdQ_I5ra.js.map +0 -1
- package/dist/button-BS6l5JUw.js.map +0 -1
- package/dist/buttons-Co6GavvM.js +0 -674
- package/dist/buttons-Co6GavvM.js.map +0 -1
- package/dist/chart-DVfcwQu6.js +0 -149
- package/dist/chart-DVfcwQu6.js.map +0 -1
- package/dist/choice-inputs-CavA-SGV.js +0 -644
- package/dist/choice-inputs-CavA-SGV.js.map +0 -1
- package/dist/code-block-DIlqzoiD.js.map +0 -1
- package/dist/combobox-CHD750do.js.map +0 -1
- package/dist/combobox-HDftpzxt.js.map +0 -1
- package/dist/command-D0kWBZfd.js.map +0 -1
- package/dist/comments-CvYeglMS.js +0 -1132
- package/dist/comments-CvYeglMS.js.map +0 -1
- package/dist/containers-CPNyNo1_.js.map +0 -1
- package/dist/data-display-b3d1TfL4.js.map +0 -1
- package/dist/date-picker-DI6kPNof.js.map +0 -1
- package/dist/date-pickers-ByP6Cv2z.js +0 -224
- package/dist/date-pickers-ByP6Cv2z.js.map +0 -1
- package/dist/feedback-a9j9J-9A.js +0 -391
- package/dist/feedback-a9j9J-9A.js.map +0 -1
- package/dist/field-affordance-recipes-CHdUtn2Z.js +0 -17
- package/dist/field-affordance-recipes-CHdUtn2Z.js.map +0 -1
- package/dist/field-state-recipes-CBTRt9Bt.js.map +0 -1
- package/dist/filters-qtrcv1hf.js.map +0 -1
- package/dist/form-field-C6W-y2hR.js.map +0 -1
- package/dist/form-sizing-39NohSqn.js.map +0 -1
- package/dist/forms-numeric-Y15Bg5Nr.js +0 -867
- package/dist/forms-numeric-Y15Bg5Nr.js.map +0 -1
- package/dist/header-B8ex54cY.js.map +0 -1
- package/dist/http-CLTVJc5I.js.map +0 -1
- package/dist/input-DMorJiTI.js +0 -202
- package/dist/input-DMorJiTI.js.map +0 -1
- package/dist/input-ci9fIgFH.js +0 -20
- package/dist/input-ci9fIgFH.js.map +0 -1
- package/dist/item-pJ0GsOiJ.js.map +0 -1
- package/dist/media-gallery-Ca4YmvBi.js.map +0 -1
- package/dist/message-B5-6LeYl.js +0 -108
- package/dist/message-B5-6LeYl.js.map +0 -1
- package/dist/navigation-BTrEb5u4.js.map +0 -1
- package/dist/navigation-DqEITuD2.js.map +0 -1
- package/dist/navigation-row-recipes-BFpvGPGE.js.map +0 -1
- package/dist/overlays-DBqV0J_V.js +0 -982
- package/dist/overlays-DBqV0J_V.js.map +0 -1
- package/dist/page-BMBGjJY8.js.map +0 -1
- package/dist/page-header-BH41wCyY.js.map +0 -1
- package/dist/pagination-C29vvt3I.js.map +0 -1
- package/dist/popover-TInGXsjg.js.map +0 -1
- package/dist/popover.recipes-zgBhMlUu.js.map +0 -1
- package/dist/primitives-DKPOGVpj.js.map +0 -1
- package/dist/rich-text-editor-BZSJchAF.js +0 -575
- package/dist/rich-text-editor-BZSJchAF.js.map +0 -1
- package/dist/rich-text-editor.recipes-DxvOE0Lp.js.map +0 -1
- package/dist/scroll-area-BheMQ270.js.map +0 -1
- package/dist/select-B2mb-qN2.js +0 -108
- package/dist/select-B2mb-qN2.js.map +0 -1
- package/dist/sheet-vOUloJ4O.js.map +0 -1
- package/dist/sidebar-C3UKkbC5.js.map +0 -1
- package/dist/sidebar-CNBKFDRW.js.map +0 -1
- package/dist/smart-card-B5FcKODh.js.map +0 -1
- package/dist/structure.recipes-DjqnBpwz.js.map +0 -1
- package/dist/surface-recipes-CQfRr-VL.js.map +0 -1
- package/dist/table-DnlAJ-xR.js.map +0 -1
- package/dist/table-ghtAQ-JJ.js +0 -1424
- package/dist/table-ghtAQ-JJ.js.map +0 -1
- package/dist/tabs-DY09eoZg.js +0 -187
- package/dist/tabs-DY09eoZg.js.map +0 -1
- package/dist/text-inputs-BhOcedTo.js +0 -331
- package/dist/text-inputs-BhOcedTo.js.map +0 -1
- package/dist/text.styles-BwB7vAF2.js.map +0 -1
- package/dist/timelines-CnZ2S_Gr.js.map +0 -1
- package/dist/typography-Cv8MT-82.js +0 -96
- package/dist/typography-Cv8MT-82.js.map +0 -1
- package/dist/ui-provider-CftIB6TY.js.map +0 -1
- package/dist/upload-DIzw1dx1.js.map +0 -1
- package/dist/upload-queue-xRJ3qDmd.js.map +0 -1
- package/dist/utils-C2EKeIw3.js +0 -72
- package/dist/utils-C2EKeIw3.js.map +0 -1
- package/dist/value-inputs-Co1fu-xv.js +0 -824
- package/dist/value-inputs-Co1fu-xv.js.map +0 -1
- package/dist/workspace-Cbqz4FzN.js.map +0 -1
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { a as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { t as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { t as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
2
|
+
import { _ as e, s as t } from "./ui-provider-DRPn3qNl.js";
|
|
3
|
+
import { useStrings as n } from "./lib/strings.js";
|
|
4
|
+
import { t as r } from "./utils-BvH9PSmq.js";
|
|
5
|
+
import { a as i, n as a, r as o } from "./typography-BxQgiZyw.js";
|
|
6
|
+
import { t as s } from "./button-BZDasD04.js";
|
|
7
|
+
import { r as c, t as l } from "./structure-CRdqVawd.js";
|
|
8
|
+
import { n as u, t as d } from "./feedback-CJkUAapr.js";
|
|
9
|
+
import { _ as f, g as p, m } from "./primitives-C7ff0QaI.js";
|
|
10
|
+
import { t as h } from "./number-DasMFWEG.js";
|
|
11
|
+
import { n as g, t as _ } from "./date-DOKhJPu7.js";
|
|
12
|
+
import { t as v } from "./badge-CzId1Wlm.js";
|
|
13
|
+
import { t as y } from "./field-affordance-recipes-uKY4MsZ_.js";
|
|
14
|
+
import { a as b, i as x, n as S, o as C, r as w, s as T, t as E } from "./command-BnmSchli.js";
|
|
15
|
+
import { d as D, p as O, u as k } from "./form-sizing-QP8aIRaW.js";
|
|
16
|
+
import { t as A } from "./input-SX9V0AL3.js";
|
|
17
|
+
import { t as j } from "./date-picker-DzP5HQq7.js";
|
|
18
|
+
import { a as M, c as N, i as P, o as F, r as I, t as ee } from "./popover-CghIYdQf.js";
|
|
19
|
+
import { i as te, r as L, t as ne } from "./tabs-BNgu7g0u.js";
|
|
20
|
+
import { t as R } from "./popover-menu-B4PoWhRl.js";
|
|
21
|
+
import { t as z } from "./use-debounced-callback-Cx1h-hdv.js";
|
|
22
|
+
import { n as re, r as ie, t as ae } from "./control-group-recipes-DBXmfh2E.js";
|
|
23
|
+
import { t as oe } from "./use-debounce-DZ_1ZBPa.js";
|
|
24
|
+
import B, { Component as se, createContext as ce, useCallback as V, useContext as le, useEffect as H, useId as ue, useMemo as U, useRef as W, useState as G } from "react";
|
|
25
|
+
import { Fragment as de, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
26
|
+
import { CalendarIcon as fe, Check as pe, ChevronDown as me, ChevronLeft as J, ChevronsUpDown as he, Filter as ge, Loader2 as _e, Plus as ve, X as ye } from "lucide-react";
|
|
27
|
+
import { format as be, isValid as xe, parse as Se } from "date-fns";
|
|
24
28
|
//#region src/components/features/filters/filters.strings.ts
|
|
25
|
-
var
|
|
29
|
+
var Ce = {
|
|
26
30
|
loading: "Loading",
|
|
27
31
|
loadingOptions: "Loading {filterLabel} options...",
|
|
28
32
|
addFilter: "Add filter",
|
|
@@ -104,7 +108,7 @@ var me = {
|
|
|
104
108
|
function Y(e, t) {
|
|
105
109
|
return e.replace(/{(\w+)}/g, (e, n) => String(t[n] ?? e)).replace(/:(\w+)/g, (e, n) => t[n] === void 0 ? e : String(t[n]));
|
|
106
110
|
}
|
|
107
|
-
function
|
|
111
|
+
function we(e, t, n) {
|
|
108
112
|
let r = t.split("."), i = e;
|
|
109
113
|
for (let e of r) {
|
|
110
114
|
if (typeof i != "object" || !i) return t;
|
|
@@ -114,7 +118,7 @@ function he(e, t, n) {
|
|
|
114
118
|
}
|
|
115
119
|
//#endregion
|
|
116
120
|
//#region src/components/features/filters/filters.types.ts
|
|
117
|
-
var
|
|
121
|
+
var X = {
|
|
118
122
|
SELECT: "select",
|
|
119
123
|
MULTI_SELECT: "multi_select",
|
|
120
124
|
ASYNC_SELECT: "async_select",
|
|
@@ -139,12 +143,12 @@ var ge = "h-control", X = {
|
|
|
139
143
|
HAS_ANY: "has_any",
|
|
140
144
|
HAS_ALL: "has_all"
|
|
141
145
|
};
|
|
142
|
-
function
|
|
146
|
+
function Te(e) {
|
|
143
147
|
return e;
|
|
144
148
|
}
|
|
145
149
|
//#endregion
|
|
146
150
|
//#region src/components/features/filters/operator-options.ts
|
|
147
|
-
function
|
|
151
|
+
function Ee(e) {
|
|
148
152
|
return [
|
|
149
153
|
{
|
|
150
154
|
label: e.contains,
|
|
@@ -160,7 +164,7 @@ function ve(e) {
|
|
|
160
164
|
}
|
|
161
165
|
];
|
|
162
166
|
}
|
|
163
|
-
function
|
|
167
|
+
function De(e) {
|
|
164
168
|
return [{
|
|
165
169
|
label: e.is,
|
|
166
170
|
value: Z.EQUALS
|
|
@@ -169,7 +173,7 @@ function ye(e) {
|
|
|
169
173
|
value: Z.NOT
|
|
170
174
|
}];
|
|
171
175
|
}
|
|
172
|
-
function
|
|
176
|
+
function Oe(e) {
|
|
173
177
|
return [
|
|
174
178
|
{
|
|
175
179
|
label: e.equals,
|
|
@@ -185,7 +189,7 @@ function be(e) {
|
|
|
185
189
|
}
|
|
186
190
|
];
|
|
187
191
|
}
|
|
188
|
-
function
|
|
192
|
+
function ke(e) {
|
|
189
193
|
return [
|
|
190
194
|
{
|
|
191
195
|
label: e.before,
|
|
@@ -201,15 +205,15 @@ function xe(e) {
|
|
|
201
205
|
}
|
|
202
206
|
];
|
|
203
207
|
}
|
|
204
|
-
function
|
|
208
|
+
function Ae(e) {
|
|
205
209
|
return [{
|
|
206
210
|
label: e.equals,
|
|
207
211
|
value: Z.EQUALS
|
|
208
212
|
}];
|
|
209
213
|
}
|
|
210
|
-
function
|
|
214
|
+
function je(e, t) {
|
|
211
215
|
switch (e) {
|
|
212
|
-
case X.SEARCH: return
|
|
216
|
+
case X.SEARCH: return Ee(t);
|
|
213
217
|
case X.TAGS: return [
|
|
214
218
|
{
|
|
215
219
|
label: t.has,
|
|
@@ -225,13 +229,13 @@ function Ce(e, t) {
|
|
|
225
229
|
}
|
|
226
230
|
];
|
|
227
231
|
case X.SELECT:
|
|
228
|
-
case X.ASYNC_SELECT: return
|
|
229
|
-
case X.RANGE: return
|
|
230
|
-
case X.DATE: return
|
|
231
|
-
default: return
|
|
232
|
+
case X.ASYNC_SELECT: return De(t);
|
|
233
|
+
case X.RANGE: return Oe(t);
|
|
234
|
+
case X.DATE: return ke(t);
|
|
235
|
+
default: return Ee(t);
|
|
232
236
|
}
|
|
233
237
|
}
|
|
234
|
-
function
|
|
238
|
+
function Me(e) {
|
|
235
239
|
switch (e) {
|
|
236
240
|
case X.SEARCH: return Z.CONTAINS;
|
|
237
241
|
case X.TAGS: return Z.HAS;
|
|
@@ -244,7 +248,7 @@ function we(e) {
|
|
|
244
248
|
}
|
|
245
249
|
//#endregion
|
|
246
250
|
//#region src/components/features/filters/utils/filter-utils.ts
|
|
247
|
-
function
|
|
251
|
+
function Ne(e, t, n) {
|
|
248
252
|
if (e.type === "date" && Array.isArray(t) && t.every((e) => typeof e == "string")) return !0;
|
|
249
253
|
if (e.validation?.required && (!t || Array.isArray(t) && t.length === 0)) return n("validation.required");
|
|
250
254
|
if (typeof t == "number") {
|
|
@@ -260,51 +264,51 @@ function Te(e, t, n) {
|
|
|
260
264
|
}
|
|
261
265
|
//#endregion
|
|
262
266
|
//#region src/components/features/filters/filter-context.tsx
|
|
263
|
-
var
|
|
264
|
-
function
|
|
265
|
-
let c =
|
|
267
|
+
var Pe = ce(void 0);
|
|
268
|
+
function Fe({ children: e, filters: t, activeFilters: r, onFilterChange: i, navigating: a = !1, strings: o, onError: s }) {
|
|
269
|
+
let c = W(t), l = W(i), u = W(s);
|
|
266
270
|
u.current = s;
|
|
267
|
-
let [d, f] =
|
|
271
|
+
let [d, f] = G(0), p = W(/* @__PURE__ */ new Map()), m = U(() => {
|
|
268
272
|
let e = /* @__PURE__ */ new Map();
|
|
269
|
-
for (let
|
|
270
|
-
if (
|
|
271
|
-
let
|
|
272
|
-
e.set(
|
|
273
|
-
fetcher:
|
|
273
|
+
for (let n of t) {
|
|
274
|
+
if (n.type !== X.ASYNC_SELECT) continue;
|
|
275
|
+
let t = n.asyncConfig?.fetcher, r = n.asyncConfig?.mapToOption, i = n.asyncConfig?.limit ?? 10, a = p.current.get(n.key), o = a && a.fetcher === t && a.mapToOption === r;
|
|
276
|
+
e.set(n.key, o && a.limit === i ? a : {
|
|
277
|
+
fetcher: t,
|
|
274
278
|
mapToOption: r,
|
|
275
279
|
limit: i,
|
|
276
280
|
options: o ? a.options : /* @__PURE__ */ new Map()
|
|
277
281
|
});
|
|
278
282
|
}
|
|
279
283
|
return e.size === p.current.size && [...e].every(([e, t]) => p.current.get(e) === t) ? p.current : (p.current = e, e);
|
|
280
|
-
}, [
|
|
281
|
-
|
|
282
|
-
c.current =
|
|
283
|
-
}, [
|
|
284
|
+
}, [t]), h = JSON.stringify(r.filter((e) => m.has(e.key)).map(({ key: e, value: t }) => [e, t])), g = n(Ce, o);
|
|
285
|
+
H(() => {
|
|
286
|
+
c.current = t;
|
|
287
|
+
}, [t]), H(() => {
|
|
284
288
|
l.current = i;
|
|
285
289
|
}, [i]);
|
|
286
|
-
let _ =
|
|
290
|
+
let _ = V((e) => {
|
|
287
291
|
let t = [...r, e];
|
|
288
292
|
l.current(t);
|
|
289
|
-
}, [r]), v =
|
|
293
|
+
}, [r]), v = V((e) => {
|
|
290
294
|
let t = r.filter((t) => t.id !== e && t.key !== e);
|
|
291
295
|
l.current(t);
|
|
292
|
-
}, [r]), y =
|
|
296
|
+
}, [r]), y = V((e, t) => {
|
|
293
297
|
let n = r.map((n) => n.id === e || n.key === e ? {
|
|
294
298
|
...n,
|
|
295
299
|
...t
|
|
296
300
|
} : n);
|
|
297
301
|
l.current(n);
|
|
298
|
-
}, [r]), b =
|
|
302
|
+
}, [r]), b = V(() => {
|
|
299
303
|
l.current([]);
|
|
300
|
-
}, []), x =
|
|
304
|
+
}, []), x = V((e) => {
|
|
301
305
|
l.current(e);
|
|
302
|
-
}, []), S =
|
|
306
|
+
}, []), S = V((e) => c.current.find((t) => t.key === e), []), C = V((e) => r.find((t) => t.key === e)?.value || [], [r]), w = V((e, t) => {
|
|
303
307
|
let n = r.find((t) => t.key === e);
|
|
304
308
|
if (t.length === 0) n && v(e);
|
|
305
309
|
else if (n) y(e, { value: t });
|
|
306
310
|
else {
|
|
307
|
-
let n = c.current.find((t) => t.key === e), r = n?.operator ?? n?.operators?.[0]?.value ?? (n ?
|
|
311
|
+
let n = c.current.find((t) => t.key === e), r = n?.operator ?? n?.operators?.[0]?.value ?? (n ? Me(n.type) : "equals");
|
|
308
312
|
_({
|
|
309
313
|
id: e,
|
|
310
314
|
key: e,
|
|
@@ -317,21 +321,21 @@ function De({ children: t, filters: n, activeFilters: r, onFilterChange: i, navi
|
|
|
317
321
|
_,
|
|
318
322
|
v,
|
|
319
323
|
y
|
|
320
|
-
]), T =
|
|
324
|
+
]), T = V((e) => r.some((t) => t.key === e && t.value.length > 0), [r]), E = V((e) => r.find((t) => t.key === e)?.operator || "equals", [r]), D = V((e, t) => {
|
|
321
325
|
r.find((t) => t.key === e) && y(e, { operator: t });
|
|
322
|
-
}, [r, y]), O =
|
|
326
|
+
}, [r, y]), O = V((e, t) => {
|
|
323
327
|
let n = c.current.find((t) => t.key === e);
|
|
324
|
-
return n ?
|
|
325
|
-
}, [g]), k =
|
|
328
|
+
return n ? Ne(n, t, (e) => we(g, e)) : !1;
|
|
329
|
+
}, [g]), k = V((e) => c.current.filter((t) => t.dependencies?.some((t) => t.key === e)), []), A = V((e, t) => {
|
|
326
330
|
let n = m.get(e)?.options;
|
|
327
331
|
if (!n) return;
|
|
328
332
|
let r = !1;
|
|
329
333
|
for (let e of t) n.get(e.value)?.label !== e.label && (r = !0), n.set(e.value, e);
|
|
330
334
|
r && f((e) => e + 1);
|
|
331
|
-
}, [m]), j =
|
|
335
|
+
}, [m]), j = V((e, t) => m.get(e)?.options.get(t)?.label, [m, d]), M = V((e, t) => {
|
|
332
336
|
u.current?.(e, t);
|
|
333
337
|
}, []);
|
|
334
|
-
|
|
338
|
+
H(() => {
|
|
335
339
|
let e = new AbortController(), t = (t, n) => {
|
|
336
340
|
e.signal.aborted || t && t.name === "AbortError" || u.current?.(t, {
|
|
337
341
|
phase: "fetch-options",
|
|
@@ -356,9 +360,9 @@ function De({ children: t, filters: n, activeFilters: r, onFilterChange: i, navi
|
|
|
356
360
|
m,
|
|
357
361
|
A
|
|
358
362
|
]);
|
|
359
|
-
let N =
|
|
363
|
+
let N = U(() => ({
|
|
360
364
|
activeFilters: r,
|
|
361
|
-
filters:
|
|
365
|
+
filters: t,
|
|
362
366
|
addFilter: _,
|
|
363
367
|
removeFilter: v,
|
|
364
368
|
updateFilter: y,
|
|
@@ -379,7 +383,7 @@ function De({ children: t, filters: n, activeFilters: r, onFilterChange: i, navi
|
|
|
379
383
|
reportError: M
|
|
380
384
|
}), [
|
|
381
385
|
r,
|
|
382
|
-
|
|
386
|
+
t,
|
|
383
387
|
_,
|
|
384
388
|
v,
|
|
385
389
|
y,
|
|
@@ -399,27 +403,27 @@ function De({ children: t, filters: n, activeFilters: r, onFilterChange: i, navi
|
|
|
399
403
|
j,
|
|
400
404
|
M
|
|
401
405
|
]);
|
|
402
|
-
return /* @__PURE__ */
|
|
406
|
+
return /* @__PURE__ */ K(Pe.Provider, {
|
|
403
407
|
value: N,
|
|
404
|
-
children:
|
|
408
|
+
children: e
|
|
405
409
|
});
|
|
406
410
|
}
|
|
407
411
|
function Q() {
|
|
408
|
-
let e =
|
|
412
|
+
let e = le(Pe);
|
|
409
413
|
if (!e) throw Error("useFilters must be used within a FilterProvider");
|
|
410
414
|
return e;
|
|
411
415
|
}
|
|
412
416
|
//#endregion
|
|
413
417
|
//#region src/components/features/filters/hooks/use-filter-groups.ts
|
|
414
|
-
function
|
|
415
|
-
let { dynamicFilterOptions: t } = e, { filters: n, isFilterActive: r } = Q(), i =
|
|
418
|
+
function Ie(e = {}) {
|
|
419
|
+
let { dynamicFilterOptions: t } = e, { filters: n, isFilterActive: r } = Q(), i = U(() => t ? n.map((e) => {
|
|
416
420
|
let n = t[e.key];
|
|
417
421
|
return Array.isArray(n) ? {
|
|
418
422
|
...e,
|
|
419
423
|
options: n
|
|
420
424
|
} : e;
|
|
421
425
|
}) : n, [n, t]);
|
|
422
|
-
return
|
|
426
|
+
return U(() => {
|
|
423
427
|
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);
|
|
424
428
|
return {
|
|
425
429
|
processedFilters: i,
|
|
@@ -434,233 +438,233 @@ function Oe(e = {}) {
|
|
|
434
438
|
}
|
|
435
439
|
//#endregion
|
|
436
440
|
//#region src/components/features/filters/partials/filter-operator-select.tsx
|
|
437
|
-
function
|
|
438
|
-
let [c, l] =
|
|
439
|
-
return /* @__PURE__ */
|
|
441
|
+
function Le({ operator: e, operators: t, onOperatorChange: n, segmentResetClass: a }) {
|
|
442
|
+
let [c, l] = G(!1), { strings: u } = Q(), d = t.find((t) => t.value === e)?.label || e;
|
|
443
|
+
return /* @__PURE__ */ K(R, {
|
|
440
444
|
open: c,
|
|
441
445
|
onOpenChange: l,
|
|
442
446
|
search: !1,
|
|
443
447
|
contentLabel: u.operator,
|
|
444
|
-
trigger: /* @__PURE__ */
|
|
448
|
+
trigger: /* @__PURE__ */ K(s, {
|
|
445
449
|
tone: "secondary",
|
|
446
450
|
buttonStyle: "ghost",
|
|
447
|
-
className:
|
|
451
|
+
className: r("filter-operator-select--component", a, "h-full px-control text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
|
|
448
452
|
onClick: (e) => {
|
|
449
453
|
e.stopPropagation();
|
|
450
454
|
},
|
|
451
455
|
type: "button",
|
|
452
|
-
children: /* @__PURE__ */
|
|
456
|
+
children: /* @__PURE__ */ K(i, {
|
|
453
457
|
tag: "span",
|
|
454
458
|
type: "secondary",
|
|
455
459
|
children: d
|
|
456
460
|
})
|
|
457
461
|
}),
|
|
458
|
-
header: /* @__PURE__ */
|
|
462
|
+
header: /* @__PURE__ */ K(o, {
|
|
459
463
|
tag: "span",
|
|
460
464
|
children: u.operator
|
|
461
465
|
}),
|
|
462
466
|
contentClassName: "w-48",
|
|
463
|
-
items:
|
|
467
|
+
items: t.map((t) => ({
|
|
464
468
|
value: t.value,
|
|
465
469
|
label: t.label,
|
|
466
470
|
selected: t.value === e
|
|
467
471
|
})),
|
|
468
472
|
onSelect: (e) => {
|
|
469
|
-
|
|
473
|
+
n(e.value), l(!1);
|
|
470
474
|
}
|
|
471
475
|
});
|
|
472
476
|
}
|
|
473
477
|
//#endregion
|
|
474
478
|
//#region src/components/features/filters/partials/filter-value-display.tsx
|
|
475
|
-
function
|
|
479
|
+
function Re({ filter: e, value: t }) {
|
|
476
480
|
let { strings: n } = Q();
|
|
477
|
-
return t.length === 0 && e.type !== X.DATE ? /* @__PURE__ */
|
|
481
|
+
return t.length === 0 && e.type !== X.DATE ? /* @__PURE__ */ K(i, {
|
|
478
482
|
tag: "span",
|
|
479
483
|
type: "secondary",
|
|
480
484
|
className: "filter-value-display--component leading-none",
|
|
481
485
|
children: n.nothingSelected
|
|
482
|
-
}) : e.type === X.ASYNC_SELECT && !e.options?.length ? /* @__PURE__ */
|
|
486
|
+
}) : e.type === X.ASYNC_SELECT && !e.options?.length ? /* @__PURE__ */ K(i, {
|
|
483
487
|
tag: "span",
|
|
484
488
|
weight: "semibold",
|
|
485
489
|
className: "filter-value-display--component leading-none",
|
|
486
|
-
children:
|
|
487
|
-
}) : e.options && e.type !== X.DATE ? /* @__PURE__ */
|
|
490
|
+
children: Be(e, t, n)
|
|
491
|
+
}) : e.options && e.type !== X.DATE ? /* @__PURE__ */ q(l, {
|
|
488
492
|
direction: "horizontal",
|
|
489
493
|
gap: "xs",
|
|
490
494
|
wrap: !1,
|
|
491
495
|
className: "filter-value-display--component",
|
|
492
|
-
children: [/* @__PURE__ */
|
|
496
|
+
children: [/* @__PURE__ */ q("div", {
|
|
493
497
|
className: "relative flex",
|
|
494
498
|
children: [t.slice(0, 2).map((t, n) => {
|
|
495
499
|
let r = e.options?.find((e) => e.value === t);
|
|
496
|
-
return r?.icon ? /* @__PURE__ */
|
|
500
|
+
return r?.icon ? /* @__PURE__ */ K("div", {
|
|
497
501
|
className: `${n > 0 ? "-ml-space-sm" : ""} border-background bg-background relative rounded-full border`,
|
|
498
502
|
style: { zIndex: 10 - n },
|
|
499
503
|
children: r.icon
|
|
500
504
|
}, t) : null;
|
|
501
|
-
}), t.length > 2 && /* @__PURE__ */
|
|
505
|
+
}), t.length > 2 && /* @__PURE__ */ K("div", {
|
|
502
506
|
className: "bg-muted border-background relative -ml-space-sm flex size-icon items-center justify-center rounded-full border",
|
|
503
|
-
children: /* @__PURE__ */
|
|
507
|
+
children: /* @__PURE__ */ q(i, {
|
|
504
508
|
tag: "span",
|
|
505
509
|
size: "xs",
|
|
506
510
|
weight: "medium",
|
|
507
|
-
children: ["+", /* @__PURE__ */
|
|
511
|
+
children: ["+", /* @__PURE__ */ K(h, {
|
|
508
512
|
value: t.length - 2,
|
|
509
513
|
size: "inherit",
|
|
510
514
|
align: "center"
|
|
511
515
|
})]
|
|
512
516
|
})
|
|
513
517
|
})]
|
|
514
|
-
}), /* @__PURE__ */
|
|
518
|
+
}), /* @__PURE__ */ K(i, {
|
|
515
519
|
tag: "span",
|
|
516
520
|
weight: "semibold",
|
|
517
521
|
className: "truncate leading-none",
|
|
518
|
-
children:
|
|
522
|
+
children: Ve(e, t, n)
|
|
519
523
|
})]
|
|
520
|
-
}) : e.type === X.DATE ? /* @__PURE__ */
|
|
524
|
+
}) : e.type === X.DATE ? /* @__PURE__ */ q(l, {
|
|
521
525
|
direction: "horizontal",
|
|
522
526
|
gap: "xs",
|
|
523
527
|
wrap: !1,
|
|
524
528
|
className: "filter-value-display--component",
|
|
525
|
-
children: [/* @__PURE__ */
|
|
526
|
-
}) : /* @__PURE__ */
|
|
529
|
+
children: [/* @__PURE__ */ K(fe, { className: "text-muted-foreground size-icon-sm" }), ze(e, t, n)]
|
|
530
|
+
}) : /* @__PURE__ */ K(i, {
|
|
527
531
|
tag: "span",
|
|
528
532
|
weight: "semibold",
|
|
529
533
|
className: "filter-value-display--component truncate leading-none",
|
|
530
|
-
children:
|
|
534
|
+
children: Ve(e, t, n)
|
|
531
535
|
});
|
|
532
536
|
}
|
|
533
|
-
function
|
|
534
|
-
return e.operator === "between" && t.length === 2 ?
|
|
537
|
+
function ze(e, t, n) {
|
|
538
|
+
return e.operator === "between" && t.length === 2 ? We(t[0], t[1], e.dateFormat?.display) : t.length === 1 ? Ue(t[0], e.dateFormat?.display) : t.length === 2 ? We(t[0], t[1], e.dateFormat?.display) : /* @__PURE__ */ K(f, {
|
|
535
539
|
weight: "semibold",
|
|
536
540
|
className: "truncate leading-none",
|
|
537
541
|
children: e.datePickerConfig?.noDatePlaceholder || n.calendar.notDateSelected
|
|
538
542
|
});
|
|
539
543
|
}
|
|
540
|
-
function
|
|
544
|
+
function Be(e, t, n) {
|
|
541
545
|
return t.length === 0 ? "" : Y(n.selected, {
|
|
542
546
|
count: t.length,
|
|
543
547
|
filterLabel: (t.length > 1 ? e.pluralLabel : e.label) ?? e.label
|
|
544
548
|
});
|
|
545
549
|
}
|
|
546
|
-
function
|
|
550
|
+
function Ve(e, t, n) {
|
|
547
551
|
return t.length > 1 ? Y(n.selected, {
|
|
548
552
|
count: t.length,
|
|
549
553
|
filterLabel: e.pluralLabel ?? e.label
|
|
550
554
|
}) : t.map((t) => e.options?.find((e) => e.value === t)?.label || t).join(", ");
|
|
551
555
|
}
|
|
552
|
-
function
|
|
556
|
+
function He(e) {
|
|
553
557
|
let t = new Date(e);
|
|
554
558
|
return !Number.isNaN(t.getTime());
|
|
555
559
|
}
|
|
556
|
-
function
|
|
557
|
-
return
|
|
560
|
+
function Ue(e, t) {
|
|
561
|
+
return He(e) ? /* @__PURE__ */ K(_, {
|
|
558
562
|
value: e,
|
|
559
563
|
format: t,
|
|
560
564
|
weight: "semibold",
|
|
561
565
|
className: "truncate leading-none"
|
|
562
|
-
}) : /* @__PURE__ */
|
|
566
|
+
}) : /* @__PURE__ */ K(f, {
|
|
563
567
|
weight: "semibold",
|
|
564
568
|
className: "truncate leading-none",
|
|
565
569
|
children: e
|
|
566
570
|
});
|
|
567
571
|
}
|
|
568
|
-
function
|
|
569
|
-
return
|
|
572
|
+
function We(e, t, n) {
|
|
573
|
+
return He(e) && He(t) ? /* @__PURE__ */ K(g, {
|
|
570
574
|
from: e,
|
|
571
575
|
to: t,
|
|
572
576
|
format: n,
|
|
573
577
|
weight: "semibold",
|
|
574
578
|
className: "truncate leading-none"
|
|
575
|
-
}) : /* @__PURE__ */
|
|
579
|
+
}) : /* @__PURE__ */ q("span", {
|
|
576
580
|
className: "inline-flex min-w-0 items-center gap-space-xs truncate leading-none",
|
|
577
581
|
children: [
|
|
578
|
-
|
|
579
|
-
/* @__PURE__ */
|
|
582
|
+
Ue(e, n),
|
|
583
|
+
/* @__PURE__ */ K(f, {
|
|
580
584
|
weight: "semibold",
|
|
581
585
|
children: "–"
|
|
582
586
|
}),
|
|
583
|
-
|
|
587
|
+
Ue(t, n)
|
|
584
588
|
]
|
|
585
589
|
});
|
|
586
590
|
}
|
|
587
591
|
//#endregion
|
|
588
592
|
//#region src/components/features/filters/partials/active-filter-item.tsx
|
|
589
|
-
function
|
|
590
|
-
let { strings:
|
|
593
|
+
function Ge({ filter: n, value: a, active: o, popoverOpen: c, triggerRef: l, operators: u, operator: d, onOperatorChange: f, onFilterClear: p, onFilterClick: m }) {
|
|
594
|
+
let { defaultScale: h } = t(), g = e(void 0, h), { strings: _ } = Q(), v = B.useId(), y = B.useId(), b = `${ie.joinedItem} !border-0 !rounded-none !shadow-none focus-visible:!ring-0 focus-visible:!border-transparent`, x = () => /* @__PURE__ */ K("div", {
|
|
591
595
|
"aria-hidden": !0,
|
|
592
596
|
className: "w-px self-stretch bg-border"
|
|
593
597
|
});
|
|
594
|
-
return /* @__PURE__ */
|
|
598
|
+
return /* @__PURE__ */ q("div", {
|
|
595
599
|
role: "group",
|
|
596
|
-
"aria-label":
|
|
597
|
-
"data-active":
|
|
598
|
-
className:
|
|
600
|
+
"aria-label": n.label,
|
|
601
|
+
"data-active": o || void 0,
|
|
602
|
+
className: r("active-filter-item--component", ie.joinedFrame, ae[g], "bg-background", n.displayConfig?.className),
|
|
599
603
|
children: [
|
|
600
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ q(s, {
|
|
601
605
|
type: "button",
|
|
602
606
|
tone: "secondary",
|
|
603
607
|
buttonStyle: "ghost",
|
|
604
|
-
className:
|
|
605
|
-
ref:
|
|
608
|
+
className: r(b, "flex h-full items-center gap-space-sm px-control hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
|
|
609
|
+
ref: l,
|
|
606
610
|
"aria-haspopup": "dialog",
|
|
607
|
-
"aria-expanded":
|
|
608
|
-
onClick:
|
|
611
|
+
"aria-expanded": c,
|
|
612
|
+
onClick: m,
|
|
609
613
|
children: [
|
|
610
|
-
!!
|
|
614
|
+
!!n.icon && /* @__PURE__ */ K("span", {
|
|
611
615
|
className: "flex items-center text-muted-foreground",
|
|
612
|
-
children:
|
|
616
|
+
children: n.icon
|
|
613
617
|
}),
|
|
614
|
-
/* @__PURE__ */
|
|
615
|
-
id:
|
|
618
|
+
/* @__PURE__ */ K(i, {
|
|
619
|
+
id: v,
|
|
616
620
|
tag: "span",
|
|
617
621
|
weight: "semibold",
|
|
618
|
-
children:
|
|
622
|
+
children: n.label
|
|
619
623
|
}),
|
|
620
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ K(me, { className: "size-icon-sm" })
|
|
621
625
|
]
|
|
622
626
|
}),
|
|
623
|
-
/* @__PURE__ */
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
-
operator:
|
|
626
|
-
operators:
|
|
627
|
-
onOperatorChange:
|
|
628
|
-
segmentResetClass:
|
|
627
|
+
/* @__PURE__ */ K(x, {}),
|
|
628
|
+
/* @__PURE__ */ K(Le, {
|
|
629
|
+
operator: d,
|
|
630
|
+
operators: u,
|
|
631
|
+
onOperatorChange: f,
|
|
632
|
+
segmentResetClass: b
|
|
629
633
|
}),
|
|
630
|
-
/* @__PURE__ */
|
|
631
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ K(x, {}),
|
|
635
|
+
/* @__PURE__ */ K(s, {
|
|
632
636
|
type: "button",
|
|
633
637
|
tone: "secondary",
|
|
634
638
|
buttonStyle: "ghost",
|
|
635
|
-
"aria-labelledby": `${
|
|
639
|
+
"aria-labelledby": `${v} ${y}`,
|
|
636
640
|
"aria-haspopup": "dialog",
|
|
637
|
-
"aria-expanded":
|
|
638
|
-
onClick:
|
|
639
|
-
className:
|
|
640
|
-
children: /* @__PURE__ */
|
|
641
|
-
id:
|
|
641
|
+
"aria-expanded": c,
|
|
642
|
+
onClick: m,
|
|
643
|
+
className: r(b, "flex h-full 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"),
|
|
644
|
+
children: /* @__PURE__ */ K("span", {
|
|
645
|
+
id: y,
|
|
642
646
|
className: "min-w-0",
|
|
643
|
-
children: /* @__PURE__ */
|
|
644
|
-
filter:
|
|
645
|
-
value:
|
|
647
|
+
children: /* @__PURE__ */ K(Re, {
|
|
648
|
+
filter: n,
|
|
649
|
+
value: a
|
|
646
650
|
})
|
|
647
651
|
})
|
|
648
652
|
}),
|
|
649
|
-
!!
|
|
653
|
+
!!o && /* @__PURE__ */ q(de, { children: [/* @__PURE__ */ K(x, {}), /* @__PURE__ */ q(s, {
|
|
650
654
|
type: "button",
|
|
651
655
|
tone: "secondary",
|
|
652
656
|
buttonStyle: "ghost",
|
|
653
|
-
className:
|
|
657
|
+
className: r(b, "flex h-full 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"),
|
|
654
658
|
onClick: (e) => {
|
|
655
|
-
e.stopPropagation(), e.preventDefault(),
|
|
659
|
+
e.stopPropagation(), e.preventDefault(), p();
|
|
656
660
|
},
|
|
657
|
-
children: [/* @__PURE__ */
|
|
661
|
+
children: [/* @__PURE__ */ K(ye, {
|
|
658
662
|
"aria-hidden": "true",
|
|
659
663
|
className: "size-icon"
|
|
660
|
-
}), /* @__PURE__ */
|
|
664
|
+
}), /* @__PURE__ */ K(i, {
|
|
661
665
|
tag: "span",
|
|
662
666
|
className: "sr-only",
|
|
663
|
-
children:
|
|
667
|
+
children: _.clear
|
|
664
668
|
})]
|
|
665
669
|
})] })
|
|
666
670
|
]
|
|
@@ -668,18 +672,18 @@ function Le({ filter: e, value: i, active: a, popoverOpen: o, triggerRef: s, ope
|
|
|
668
672
|
}
|
|
669
673
|
//#endregion
|
|
670
674
|
//#region src/components/features/filters/hooks/use-async-options.ts
|
|
671
|
-
function
|
|
675
|
+
function Ke(e, t, n) {
|
|
672
676
|
for (let [t, r] of e) Date.now() - r.timestamp > n && e.delete(t);
|
|
673
677
|
return e.get(t);
|
|
674
678
|
}
|
|
675
|
-
function
|
|
676
|
-
let { asyncConfig: i } = e, a = i?.fetcher, o = i?.mapToOption, s =
|
|
679
|
+
function qe(e, t, n, r = {}) {
|
|
680
|
+
let { asyncConfig: i } = e, a = i?.fetcher, o = i?.mapToOption, s = U(() => /* @__PURE__ */ new Map(), [
|
|
677
681
|
e.key,
|
|
678
682
|
a,
|
|
679
683
|
o
|
|
680
|
-
]), c =
|
|
684
|
+
]), c = W(r.onError);
|
|
681
685
|
c.current = r.onError;
|
|
682
|
-
let l = i?.debounceMs ?? e.delay ?? 300, u = (
|
|
686
|
+
let l = i?.debounceMs ?? e.delay ?? 300, u = (oe(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({
|
|
683
687
|
query: u,
|
|
684
688
|
limit: d
|
|
685
689
|
})) : JSON.stringify([
|
|
@@ -692,7 +696,7 @@ function ze(e, t, n, r = {}) {
|
|
|
692
696
|
e.key,
|
|
693
697
|
u,
|
|
694
698
|
d
|
|
695
|
-
]), x =
|
|
699
|
+
]), x = V(async (e) => a && o ? (await a({
|
|
696
700
|
query: u,
|
|
697
701
|
limit: d,
|
|
698
702
|
signal: e
|
|
@@ -701,8 +705,8 @@ function ze(e, t, n, r = {}) {
|
|
|
701
705
|
o,
|
|
702
706
|
u,
|
|
703
707
|
d
|
|
704
|
-
]), [S, C] =
|
|
705
|
-
let e =
|
|
708
|
+
]), [S, C] = G(() => {
|
|
709
|
+
let e = Ke(s, b, h);
|
|
706
710
|
return {
|
|
707
711
|
cache: s,
|
|
708
712
|
data: e?.data ?? [],
|
|
@@ -710,11 +714,11 @@ function ze(e, t, n, r = {}) {
|
|
|
710
714
|
fetching: !1,
|
|
711
715
|
error: !1
|
|
712
716
|
};
|
|
713
|
-
}), [w, T] =
|
|
714
|
-
return
|
|
717
|
+
}), [w, T] = G(0), E = V(() => T((e) => e + 1), []), D = W(0);
|
|
718
|
+
return H(() => {
|
|
715
719
|
let t = D.current !== w;
|
|
716
720
|
if (D.current = w, !v) return;
|
|
717
|
-
let n =
|
|
721
|
+
let n = Ke(s, b, h), r = n !== void 0 && Date.now() - n.timestamp < m, i = new AbortController();
|
|
718
722
|
if (r && !t) return C({
|
|
719
723
|
cache: s,
|
|
720
724
|
data: n.data,
|
|
@@ -776,23 +780,23 @@ function ze(e, t, n, r = {}) {
|
|
|
776
780
|
}
|
|
777
781
|
//#endregion
|
|
778
782
|
//#region src/components/features/filters/partials/async-filter-content.tsx
|
|
779
|
-
function
|
|
780
|
-
let { strings:
|
|
781
|
-
if (t !==
|
|
782
|
-
let e =
|
|
783
|
-
|
|
783
|
+
function Je({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: a, triggerSource: o = "chip" }) {
|
|
784
|
+
let { strings: c, cacheAsyncOptions: f, getAsyncOptionLabel: p, reportError: m } = Q(), [h, g] = G(""), [_, v] = G(t ?? []), y = W(t);
|
|
785
|
+
if (t !== y.current) {
|
|
786
|
+
let e = y.current ?? [], n = t ?? [];
|
|
787
|
+
y.current = t, (n.length !== e.length || n.some((t, n) => t !== e[n])) && v(n);
|
|
784
788
|
}
|
|
785
|
-
let { options:
|
|
786
|
-
|
|
787
|
-
|
|
789
|
+
let { options: T, isLoading: D, isFetching: O, isError: k, refetch: A, isBelowMinQuery: j, minQueryLength: M } = qe(e, h, !0, { onError: m });
|
|
790
|
+
H(() => {
|
|
791
|
+
T.length > 0 && f(e.key, T);
|
|
788
792
|
}, [
|
|
789
793
|
f,
|
|
790
794
|
e.key,
|
|
791
|
-
|
|
795
|
+
T
|
|
792
796
|
]);
|
|
793
|
-
let
|
|
794
|
-
let t = new Set(
|
|
795
|
-
for (let t of
|
|
797
|
+
let N = e.multiple !== !1, F = e.maxSelected, ee = o === "toolbar", te = _.length !== t.length || _.some((e) => !t.includes(e)), L = U(() => {
|
|
798
|
+
let t = new Set(_), n = new Set(T.map((e) => e.value)), r = [];
|
|
799
|
+
for (let t of _) if (!n.has(t)) {
|
|
796
800
|
let n = p(e.key, t);
|
|
797
801
|
n && r.push({
|
|
798
802
|
value: t,
|
|
@@ -800,156 +804,156 @@ function Be({ filter: e, value: t, onFilterChange: i, onBackToFilterList: a, onC
|
|
|
800
804
|
icon: e.icon
|
|
801
805
|
});
|
|
802
806
|
}
|
|
803
|
-
return [...r, ...
|
|
807
|
+
return [...r, ...T].sort((e, n) => +!t.has(e.value) - !t.has(n.value));
|
|
804
808
|
}, [
|
|
805
|
-
|
|
806
|
-
|
|
809
|
+
T,
|
|
810
|
+
_,
|
|
807
811
|
e.key,
|
|
808
812
|
e.icon,
|
|
809
813
|
p
|
|
810
|
-
]),
|
|
811
|
-
if (
|
|
812
|
-
if (
|
|
814
|
+
]), ne = (t) => {
|
|
815
|
+
if (N) {
|
|
816
|
+
if (_.includes(t)) v(_.filter((e) => e !== t));
|
|
813
817
|
else {
|
|
814
|
-
if (
|
|
815
|
-
|
|
818
|
+
if (F && _.length >= F) return;
|
|
819
|
+
v([..._, t]);
|
|
816
820
|
}
|
|
817
|
-
} else
|
|
818
|
-
},
|
|
819
|
-
|
|
820
|
-
},
|
|
821
|
+
} else v([t]), e.closeOnSelect === !0 && (n([t]), a());
|
|
822
|
+
}, R = () => {
|
|
823
|
+
n(_), a();
|
|
824
|
+
}, z = U(() => D || O ? /* @__PURE__ */ K(u, { label: c.searching }) : k ? /* @__PURE__ */ K(d, {
|
|
821
825
|
variant: "inline",
|
|
822
|
-
title:
|
|
823
|
-
action: /* @__PURE__ */
|
|
826
|
+
title: c.fetchError,
|
|
827
|
+
action: /* @__PURE__ */ K(s, {
|
|
824
828
|
tone: "secondary",
|
|
825
829
|
buttonStyle: "outline",
|
|
826
830
|
size: "sm",
|
|
827
831
|
onClick: (e) => {
|
|
828
|
-
e.stopPropagation(),
|
|
832
|
+
e.stopPropagation(), A();
|
|
829
833
|
},
|
|
830
|
-
children:
|
|
834
|
+
children: c.retryFetch
|
|
831
835
|
})
|
|
832
|
-
}) :
|
|
836
|
+
}) : j ? /* @__PURE__ */ K("div", {
|
|
833
837
|
className: "text-muted-foreground flex items-center justify-center py-space-xl",
|
|
834
|
-
children: /* @__PURE__ */
|
|
838
|
+
children: /* @__PURE__ */ K(i, {
|
|
835
839
|
tag: "span",
|
|
836
840
|
size: "xs",
|
|
837
841
|
type: "secondary",
|
|
838
|
-
children: Y(
|
|
842
|
+
children: Y(c.minQueryHint, { min: M })
|
|
839
843
|
})
|
|
840
|
-
}) :
|
|
844
|
+
}) : c.noOptionsFound, [
|
|
841
845
|
D,
|
|
846
|
+
O,
|
|
842
847
|
k,
|
|
843
848
|
j,
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
M
|
|
849
|
+
M,
|
|
850
|
+
c,
|
|
851
|
+
A
|
|
848
852
|
]);
|
|
849
|
-
return /* @__PURE__ */
|
|
850
|
-
/* @__PURE__ */
|
|
851
|
-
start:
|
|
853
|
+
return /* @__PURE__ */ q(de, { children: [
|
|
854
|
+
/* @__PURE__ */ q(P, {
|
|
855
|
+
start: ee ? /* @__PURE__ */ K(s, {
|
|
852
856
|
tone: "secondary",
|
|
853
857
|
buttonStyle: "ghost",
|
|
854
858
|
size: "sm",
|
|
855
859
|
iconOnly: !0,
|
|
856
860
|
className: "shrink-0",
|
|
857
|
-
onClick:
|
|
858
|
-
"aria-label":
|
|
859
|
-
children: /* @__PURE__ */
|
|
861
|
+
onClick: r,
|
|
862
|
+
"aria-label": c.backToFilters,
|
|
863
|
+
children: /* @__PURE__ */ K(J, {
|
|
860
864
|
"aria-hidden": "true",
|
|
861
865
|
className: "size-icon-sm rtl:rotate-180"
|
|
862
866
|
})
|
|
863
867
|
}) : void 0,
|
|
864
|
-
children: [/* @__PURE__ */
|
|
868
|
+
children: [/* @__PURE__ */ K(i, {
|
|
865
869
|
tag: "span",
|
|
866
870
|
weight: "semibold",
|
|
867
871
|
children: e.label
|
|
868
|
-
}), /* @__PURE__ */
|
|
872
|
+
}), /* @__PURE__ */ K(i, {
|
|
869
873
|
tag: "span",
|
|
870
874
|
size: "xs",
|
|
871
875
|
type: "secondary",
|
|
872
|
-
children:
|
|
876
|
+
children: c.selectValues
|
|
873
877
|
})]
|
|
874
878
|
}),
|
|
875
|
-
/* @__PURE__ */
|
|
879
|
+
/* @__PURE__ */ q(E, {
|
|
876
880
|
shouldFilter: !1,
|
|
877
881
|
inset: "flush",
|
|
878
882
|
className: "rounded-none",
|
|
879
|
-
children: [/* @__PURE__ */
|
|
880
|
-
placeholder: Y(
|
|
883
|
+
children: [/* @__PURE__ */ K(x, {
|
|
884
|
+
placeholder: Y(c.searchPlaceholder, { filterLabel: e.label.toLowerCase() }),
|
|
881
885
|
value: h,
|
|
882
886
|
onValueChange: g
|
|
883
|
-
}), /* @__PURE__ */
|
|
887
|
+
}), /* @__PURE__ */ K(C, { children: L.length === 0 ? /* @__PURE__ */ K(S, { children: z }) : /* @__PURE__ */ q(w, { children: [!(!O || D) && /* @__PURE__ */ q(l, {
|
|
884
888
|
direction: "horizontal",
|
|
885
889
|
gap: "sm",
|
|
886
890
|
wrap: !1,
|
|
887
891
|
className: "px-control-sm py-space-xs",
|
|
888
|
-
children: [/* @__PURE__ */
|
|
892
|
+
children: [/* @__PURE__ */ K(_e, { className: "text-muted-foreground size-icon-sm animate-spin" }), /* @__PURE__ */ K(i, {
|
|
889
893
|
tag: "span",
|
|
890
894
|
size: "xs",
|
|
891
895
|
type: "secondary",
|
|
892
|
-
children:
|
|
896
|
+
children: c.searching
|
|
893
897
|
})]
|
|
894
|
-
}),
|
|
895
|
-
onSelect: () =>
|
|
896
|
-
"data-checked":
|
|
897
|
-
disabled: e.disabled || !!
|
|
898
|
+
}), L.map((e) => /* @__PURE__ */ q(b, {
|
|
899
|
+
onSelect: () => ne(e.value),
|
|
900
|
+
"data-checked": _.includes(e.value) || void 0,
|
|
901
|
+
disabled: e.disabled || !!F && _.length >= F && !_.includes(e.value),
|
|
898
902
|
className: "flex items-center gap-space-sm",
|
|
899
|
-
children: [e.icon, /* @__PURE__ */
|
|
903
|
+
children: [e.icon, /* @__PURE__ */ K(i, {
|
|
900
904
|
tag: "span",
|
|
901
905
|
lineHeight: "tight",
|
|
902
906
|
children: e.label
|
|
903
907
|
})]
|
|
904
908
|
}, e.value))] }) })]
|
|
905
909
|
}),
|
|
906
|
-
|
|
907
|
-
caption: Y(
|
|
908
|
-
count:
|
|
909
|
-
filterLabel: (
|
|
910
|
+
te && /* @__PURE__ */ K(I, {
|
|
911
|
+
caption: Y(c.selected, {
|
|
912
|
+
count: _.length,
|
|
913
|
+
filterLabel: (_.length > 1 ? e.pluralLabel : e.label) ?? e.label
|
|
910
914
|
}),
|
|
911
|
-
children: /* @__PURE__ */
|
|
915
|
+
children: /* @__PURE__ */ K(s, {
|
|
912
916
|
tone: "primary",
|
|
913
917
|
size: "sm",
|
|
914
|
-
onClick:
|
|
915
|
-
children:
|
|
918
|
+
onClick: R,
|
|
919
|
+
children: c.confirm
|
|
916
920
|
})
|
|
917
921
|
})
|
|
918
922
|
] });
|
|
919
923
|
}
|
|
920
924
|
//#endregion
|
|
921
925
|
//#region src/components/features/filters/facets/date-facet.tsx
|
|
922
|
-
var
|
|
923
|
-
function
|
|
924
|
-
let { strings: a } = Q(), o = e.operators?.some((e) => e.value === "between") || e.operator === "between" || e.key.toLowerCase().includes("range") || e.key.toLowerCase().includes("between"), s = e.dateFormat?.param ?? "yyyy-MM-dd", c = e.dateFormat?.display ?? "PPP", l = o ? e.datePickerConfig?.noRangePlaceholder ?? e.placeholder ?? a.calendar.notDateRangeSelected : e.datePickerConfig?.noDatePlaceholder ?? e.placeholder ?? a.calendar.notDateSelected, u = !!e.datePickerConfig?.showConfirmButton, d = e.datePickerConfig?.autoApply ?? !u, f = e.datePickerConfig?.showShortcuts ?? !0, p = o && (
|
|
925
|
-
from:
|
|
926
|
-
to:
|
|
927
|
-
} : void 0, m = !o &&
|
|
926
|
+
var Ye = [];
|
|
927
|
+
function Xe({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
928
|
+
let { strings: a } = Q(), o = e.operators?.some((e) => e.value === "between") || e.operator === "between" || e.key.toLowerCase().includes("range") || e.key.toLowerCase().includes("between"), s = e.dateFormat?.param ?? "yyyy-MM-dd", c = e.dateFormat?.display ?? "PPP", l = o ? e.datePickerConfig?.noRangePlaceholder ?? e.placeholder ?? a.calendar.notDateRangeSelected : e.datePickerConfig?.noDatePlaceholder ?? e.placeholder ?? a.calendar.notDateSelected, u = !!e.datePickerConfig?.showConfirmButton, d = e.datePickerConfig?.autoApply ?? !u, f = e.datePickerConfig?.showShortcuts ?? !0, p = o && (t.start || t.end) ? {
|
|
929
|
+
from: t.start,
|
|
930
|
+
to: t.end
|
|
931
|
+
} : void 0, m = !o && t.start && xe(t.start) ? t.start : void 0, h = {
|
|
928
932
|
format: s,
|
|
929
933
|
readableFormat: c,
|
|
930
934
|
placeholder: l,
|
|
931
935
|
disablePortal: !0,
|
|
932
936
|
numberOfMonths: 1,
|
|
933
|
-
className:
|
|
937
|
+
className: r("date-facet--component", "w-full", i)
|
|
934
938
|
};
|
|
935
|
-
return o ? /* @__PURE__ */
|
|
939
|
+
return o ? /* @__PURE__ */ K(j, {
|
|
936
940
|
mode: "range",
|
|
937
941
|
value: p,
|
|
938
942
|
onValueChange: (e) => {
|
|
939
|
-
|
|
943
|
+
n({
|
|
940
944
|
start: e.range?.from ?? void 0,
|
|
941
945
|
end: e.range?.to ?? void 0
|
|
942
946
|
});
|
|
943
947
|
},
|
|
944
948
|
withConfirm: u,
|
|
945
949
|
closeOnSelect: d,
|
|
946
|
-
presets: f ? void 0 :
|
|
950
|
+
presets: f ? void 0 : Ye,
|
|
947
951
|
...h
|
|
948
|
-
}) : /* @__PURE__ */
|
|
952
|
+
}) : /* @__PURE__ */ K(j, {
|
|
949
953
|
mode: "single",
|
|
950
954
|
value: m,
|
|
951
955
|
onValueChange: (e) => {
|
|
952
|
-
|
|
956
|
+
n({
|
|
953
957
|
start: e.date ?? void 0,
|
|
954
958
|
end: void 0
|
|
955
959
|
});
|
|
@@ -960,45 +964,45 @@ function He({ filter: e, value: n, onValueChange: r, className: i }) {
|
|
|
960
964
|
}
|
|
961
965
|
//#endregion
|
|
962
966
|
//#region src/components/features/filters/partials/date-filter-content.tsx
|
|
963
|
-
function
|
|
964
|
-
let { strings:
|
|
967
|
+
function Ze({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, triggerSource: i = "chip" }) {
|
|
968
|
+
let { strings: a } = Q(), o = (t) => {
|
|
965
969
|
if (!t) return;
|
|
966
970
|
if (e.dateFormat?.param) {
|
|
967
|
-
let n =
|
|
968
|
-
return
|
|
971
|
+
let n = Se(t, e.dateFormat.param, /* @__PURE__ */ new Date());
|
|
972
|
+
return xe(n) ? n : void 0;
|
|
969
973
|
}
|
|
970
974
|
let n = new Date(t);
|
|
971
|
-
return
|
|
972
|
-
}, c =
|
|
973
|
-
if (t &&
|
|
975
|
+
return xe(n) ? n : void 0;
|
|
976
|
+
}, c = o(t[0]), l = o(t[1]), u = (t) => {
|
|
977
|
+
if (t && xe(t)) return be(t, e.dateFormat?.param ?? "yyyy-MM-dd");
|
|
974
978
|
}, d = ({ start: e, end: t }) => {
|
|
975
|
-
let
|
|
976
|
-
i &&
|
|
977
|
-
}, f =
|
|
979
|
+
let r = [], i = u(e), a = u(t);
|
|
980
|
+
i && r.push(i), a && r.push(a), n(r);
|
|
981
|
+
}, f = i === "toolbar", p = {
|
|
978
982
|
start: c,
|
|
979
983
|
end: l
|
|
980
984
|
};
|
|
981
|
-
return /* @__PURE__ */
|
|
985
|
+
return /* @__PURE__ */ q("div", {
|
|
982
986
|
className: "flex flex-col",
|
|
983
|
-
children: [/* @__PURE__ */
|
|
984
|
-
start: f ? /* @__PURE__ */
|
|
987
|
+
children: [/* @__PURE__ */ K(P, {
|
|
988
|
+
start: f ? /* @__PURE__ */ K(s, {
|
|
985
989
|
type: "button",
|
|
986
990
|
tone: "secondary",
|
|
987
991
|
buttonStyle: "ghost",
|
|
988
992
|
size: "sm",
|
|
989
993
|
iconOnly: !0,
|
|
990
|
-
onClick:
|
|
994
|
+
onClick: r,
|
|
991
995
|
className: "shrink-0",
|
|
992
|
-
"aria-label":
|
|
993
|
-
children: /* @__PURE__ */
|
|
996
|
+
"aria-label": a.backToFilters,
|
|
997
|
+
children: /* @__PURE__ */ K(J, {
|
|
994
998
|
"aria-hidden": "true",
|
|
995
999
|
className: "size-icon-sm rtl:rotate-180"
|
|
996
1000
|
})
|
|
997
1001
|
}) : void 0,
|
|
998
|
-
children: /* @__PURE__ */
|
|
999
|
-
}), /* @__PURE__ */
|
|
1002
|
+
children: /* @__PURE__ */ K(M, { children: e.label })
|
|
1003
|
+
}), /* @__PURE__ */ K("div", {
|
|
1000
1004
|
className: "p-surface",
|
|
1001
|
-
children: /* @__PURE__ */
|
|
1005
|
+
children: /* @__PURE__ */ K(Xe, {
|
|
1002
1006
|
filter: e,
|
|
1003
1007
|
value: p,
|
|
1004
1008
|
onValueChange: d
|
|
@@ -1008,7 +1012,7 @@ function Ue({ filter: e, value: t, onFilterChange: r, onBackToFilterList: i, tri
|
|
|
1008
1012
|
}
|
|
1009
1013
|
//#endregion
|
|
1010
1014
|
//#region src/components/features/filters/partials/filter-error-boundary.tsx
|
|
1011
|
-
var
|
|
1015
|
+
var Qe = class extends se {
|
|
1012
1016
|
state = {
|
|
1013
1017
|
hasError: !1,
|
|
1014
1018
|
error: null
|
|
@@ -1033,54 +1037,53 @@ var We = class extends ee {
|
|
|
1033
1037
|
};
|
|
1034
1038
|
render() {
|
|
1035
1039
|
if (this.state.hasError) {
|
|
1036
|
-
let { fallback: e, filterKey: t, labels:
|
|
1037
|
-
return e ? /* @__PURE__ */
|
|
1040
|
+
let { fallback: e, filterKey: t, labels: n } = this.props;
|
|
1041
|
+
return e ? /* @__PURE__ */ K("div", {
|
|
1038
1042
|
className: "filter-error-boundary--component contents",
|
|
1039
1043
|
children: e
|
|
1040
|
-
}) : /* @__PURE__ */
|
|
1041
|
-
className: "filter-error-boundary--component rounded-radius
|
|
1044
|
+
}) : /* @__PURE__ */ q("div", {
|
|
1045
|
+
className: "filter-error-boundary--component rounded-radius border border-destructive/30 bg-destructive/10 p-surface-xs text-destructive",
|
|
1042
1046
|
children: [
|
|
1043
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ q("div", {
|
|
1044
1048
|
className: "mb-space-xs flex items-center justify-between",
|
|
1045
|
-
children: [/* @__PURE__ */
|
|
1049
|
+
children: [/* @__PURE__ */ K(i, {
|
|
1046
1050
|
tag: "span",
|
|
1047
1051
|
weight: "semibold",
|
|
1048
|
-
children:
|
|
1049
|
-
}), /* @__PURE__ */
|
|
1052
|
+
children: n.title
|
|
1053
|
+
}), /* @__PURE__ */ K(s, {
|
|
1050
1054
|
type: "button",
|
|
1051
1055
|
tone: "destructive",
|
|
1052
1056
|
buttonStyle: "ghost",
|
|
1053
1057
|
size: "sm",
|
|
1054
1058
|
iconOnly: !0,
|
|
1055
1059
|
onClick: this.handleReset,
|
|
1056
|
-
|
|
1057
|
-
"
|
|
1058
|
-
children: /* @__PURE__ */ G(q, { className: "size-icon-sm" })
|
|
1060
|
+
"aria-label": n.reset,
|
|
1061
|
+
children: /* @__PURE__ */ K(ye, { className: "size-icon-sm" })
|
|
1059
1062
|
})]
|
|
1060
1063
|
}),
|
|
1061
|
-
/* @__PURE__ */
|
|
1062
|
-
/* @__PURE__ */
|
|
1064
|
+
/* @__PURE__ */ K(i, { children: n.getDescription(t) }),
|
|
1065
|
+
/* @__PURE__ */ K(m, {
|
|
1063
1066
|
size: "xs",
|
|
1064
1067
|
className: "mt-space-xs text-destructive",
|
|
1065
|
-
children: this.state.error?.message ||
|
|
1068
|
+
children: this.state.error?.message || n.unknownError
|
|
1066
1069
|
})
|
|
1067
1070
|
]
|
|
1068
1071
|
});
|
|
1069
1072
|
}
|
|
1070
|
-
return /* @__PURE__ */
|
|
1073
|
+
return /* @__PURE__ */ K("div", {
|
|
1071
1074
|
className: "filter-error-boundary--component contents",
|
|
1072
1075
|
children: this.props.children
|
|
1073
1076
|
});
|
|
1074
1077
|
}
|
|
1075
1078
|
};
|
|
1076
1079
|
function $(e) {
|
|
1077
|
-
let { strings: t, reportError: n } = Q(), r =
|
|
1080
|
+
let { strings: t, reportError: n } = Q(), r = U(() => ({
|
|
1078
1081
|
title: t.error.title,
|
|
1079
1082
|
reset: t.clear,
|
|
1080
1083
|
getDescription: (e) => e ? Y(t.error.descriptionWithKey, { filterKey: e }) : t.error.generic,
|
|
1081
1084
|
unknownError: t.error.unknown
|
|
1082
1085
|
}), [t]);
|
|
1083
|
-
return /* @__PURE__ */
|
|
1086
|
+
return /* @__PURE__ */ K(Qe, {
|
|
1084
1087
|
...e,
|
|
1085
1088
|
labels: r,
|
|
1086
1089
|
onError: n
|
|
@@ -1088,53 +1091,53 @@ function $(e) {
|
|
|
1088
1091
|
}
|
|
1089
1092
|
//#endregion
|
|
1090
1093
|
//#region src/components/features/filters/partials/filter-list-item.tsx
|
|
1091
|
-
function
|
|
1092
|
-
let { strings: n } = Q(),
|
|
1093
|
-
return /* @__PURE__ */
|
|
1094
|
+
function $e({ filter: e, onSelect: t }) {
|
|
1095
|
+
let { strings: n } = Q(), r = e.type === X.DATE ? e.operator === "between" ? n?.selectDateRange : n?.selectDate : e.options ? `${e.options.length} ${n?.options ?? ""}`.trim() : null;
|
|
1096
|
+
return /* @__PURE__ */ q(b, {
|
|
1094
1097
|
onSelect: t,
|
|
1095
|
-
children: [!!e.icon && /* @__PURE__ */
|
|
1098
|
+
children: [!!e.icon && /* @__PURE__ */ K("span", {
|
|
1096
1099
|
className: "shrink-0 text-muted-foreground [&_svg]:size-icon",
|
|
1097
1100
|
children: e.icon
|
|
1098
|
-
}), /* @__PURE__ */
|
|
1101
|
+
}), /* @__PURE__ */ q("div", {
|
|
1099
1102
|
className: "flex min-w-0 flex-col gap-dense leading-tight",
|
|
1100
|
-
children: [/* @__PURE__ */
|
|
1103
|
+
children: [/* @__PURE__ */ K(i, {
|
|
1101
1104
|
tag: "span",
|
|
1102
1105
|
lineHeight: "tight",
|
|
1103
1106
|
weight: "medium",
|
|
1104
1107
|
className: "truncate",
|
|
1105
1108
|
children: e.label
|
|
1106
|
-
}), !!
|
|
1109
|
+
}), !!r && /* @__PURE__ */ K(i, {
|
|
1107
1110
|
tag: "span",
|
|
1108
1111
|
lineHeight: "tight",
|
|
1109
1112
|
size: "xs",
|
|
1110
1113
|
type: "secondary",
|
|
1111
1114
|
className: "truncate",
|
|
1112
|
-
children:
|
|
1115
|
+
children: r
|
|
1113
1116
|
})]
|
|
1114
1117
|
})]
|
|
1115
1118
|
}, e.key);
|
|
1116
1119
|
}
|
|
1117
1120
|
//#endregion
|
|
1118
1121
|
//#region src/components/features/filters/partials/filter-list-content.tsx
|
|
1119
|
-
function
|
|
1122
|
+
function et({ availableFilters: e, activeFilters: t, onFilterSelect: n }) {
|
|
1120
1123
|
let { strings: r } = Q(), i = (e) => {
|
|
1121
1124
|
n(e);
|
|
1122
1125
|
};
|
|
1123
|
-
return /* @__PURE__ */
|
|
1126
|
+
return /* @__PURE__ */ q(E, {
|
|
1124
1127
|
inset: "compact",
|
|
1125
1128
|
className: "rounded-none",
|
|
1126
|
-
children: [/* @__PURE__ */
|
|
1127
|
-
/* @__PURE__ */
|
|
1128
|
-
e.length > 0 && /* @__PURE__ */
|
|
1129
|
+
children: [/* @__PURE__ */ K(x, { placeholder: r.searchFilters }), /* @__PURE__ */ q(C, { children: [
|
|
1130
|
+
/* @__PURE__ */ K(S, { children: r.noFiltersAvailable }),
|
|
1131
|
+
e.length > 0 && /* @__PURE__ */ K(w, {
|
|
1129
1132
|
heading: r.availableFilters,
|
|
1130
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1133
|
+
children: e.map((e) => /* @__PURE__ */ K($e, {
|
|
1131
1134
|
filter: e,
|
|
1132
1135
|
onSelect: () => i(e)
|
|
1133
1136
|
}, e.key))
|
|
1134
1137
|
}),
|
|
1135
|
-
t.length > 0 && /* @__PURE__ */
|
|
1138
|
+
t.length > 0 && /* @__PURE__ */ q(de, { children: [/* @__PURE__ */ K(T, {}), /* @__PURE__ */ K(w, {
|
|
1136
1139
|
heading: r.activeFilters,
|
|
1137
|
-
children: t.map((e) => /* @__PURE__ */
|
|
1140
|
+
children: t.map((e) => /* @__PURE__ */ K($e, {
|
|
1138
1141
|
filter: e,
|
|
1139
1142
|
onSelect: () => i(e)
|
|
1140
1143
|
}, e.key))
|
|
@@ -1144,84 +1147,85 @@ function Ke({ availableFilters: e, activeFilters: t, onFilterSelect: n }) {
|
|
|
1144
1147
|
}
|
|
1145
1148
|
//#endregion
|
|
1146
1149
|
//#region src/components/features/filters/partials/regular-filter-content.tsx
|
|
1147
|
-
function
|
|
1148
|
-
let { strings: c, reportError:
|
|
1149
|
-
|
|
1150
|
-
|
|
1150
|
+
function tt({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: a, triggerSource: o = "chip" }) {
|
|
1151
|
+
let { strings: c, reportError: u } = Q(), d = e.multiple === !0 || e.type === X.MULTI_SELECT, f = o === "toolbar", [p, m] = G(t || []);
|
|
1152
|
+
H(() => {
|
|
1153
|
+
m(t || []);
|
|
1151
1154
|
}, [t]);
|
|
1152
|
-
let
|
|
1153
|
-
if (
|
|
1154
|
-
let e =
|
|
1155
|
-
|
|
1156
|
-
} else
|
|
1157
|
-
},
|
|
1155
|
+
let h = (t) => {
|
|
1156
|
+
if (d) {
|
|
1157
|
+
let e = p.includes(t) ? p.filter((e) => e !== t) : [...p, t];
|
|
1158
|
+
m(e);
|
|
1159
|
+
} else m([t]), e.closeOnSelect === !0 && (n([t]), a());
|
|
1160
|
+
}, g = () => {
|
|
1158
1161
|
try {
|
|
1159
|
-
|
|
1162
|
+
n(p), a();
|
|
1160
1163
|
} catch (t) {
|
|
1161
|
-
|
|
1164
|
+
u(t, {
|
|
1162
1165
|
phase: "apply",
|
|
1163
1166
|
filterKey: e.key
|
|
1164
1167
|
});
|
|
1165
1168
|
}
|
|
1166
|
-
},
|
|
1167
|
-
return /* @__PURE__ */
|
|
1169
|
+
}, _ = JSON.stringify(p.slice().sort()) !== JSON.stringify((t ?? []).slice().sort());
|
|
1170
|
+
return /* @__PURE__ */ q("div", {
|
|
1168
1171
|
className: "flex flex-col",
|
|
1169
1172
|
children: [
|
|
1170
|
-
/* @__PURE__ */
|
|
1171
|
-
start:
|
|
1173
|
+
/* @__PURE__ */ K(P, {
|
|
1174
|
+
start: f ? /* @__PURE__ */ K(s, {
|
|
1172
1175
|
type: "button",
|
|
1173
1176
|
tone: "secondary",
|
|
1174
1177
|
buttonStyle: "ghost",
|
|
1175
1178
|
size: "sm",
|
|
1176
1179
|
iconOnly: !0,
|
|
1177
|
-
onClick:
|
|
1180
|
+
onClick: r,
|
|
1178
1181
|
className: "shrink-0",
|
|
1179
1182
|
"aria-label": c.backToFilters,
|
|
1180
|
-
children: /* @__PURE__ */
|
|
1183
|
+
children: /* @__PURE__ */ K(J, {
|
|
1181
1184
|
"aria-hidden": "true",
|
|
1182
1185
|
className: "size-icon-sm rtl:rotate-180"
|
|
1183
1186
|
})
|
|
1184
1187
|
}) : void 0,
|
|
1185
|
-
children: /* @__PURE__ */
|
|
1188
|
+
children: /* @__PURE__ */ K(i, {
|
|
1186
1189
|
tag: "span",
|
|
1187
1190
|
weight: "semibold",
|
|
1188
1191
|
children: e.label
|
|
1189
1192
|
})
|
|
1190
1193
|
}),
|
|
1191
|
-
/* @__PURE__ */
|
|
1194
|
+
/* @__PURE__ */ q(E, {
|
|
1192
1195
|
inset: "flush",
|
|
1193
1196
|
className: "rounded-none",
|
|
1194
|
-
children: [/* @__PURE__ */
|
|
1197
|
+
children: [/* @__PURE__ */ K(x, { placeholder: Y(c.searchPlaceholder, { filterLabel: e.label.toLowerCase() }) }), /* @__PURE__ */ q(C, {
|
|
1195
1198
|
className: "max-h-64",
|
|
1196
|
-
children: [/* @__PURE__ */
|
|
1199
|
+
children: [/* @__PURE__ */ K(S, { children: /* @__PURE__ */ K(i, {
|
|
1197
1200
|
type: "secondary",
|
|
1198
1201
|
align: "center",
|
|
1199
1202
|
className: "py-space-xl",
|
|
1200
1203
|
children: c.noOptionsFound
|
|
1201
|
-
}) }), /* @__PURE__ */
|
|
1202
|
-
let t =
|
|
1203
|
-
return /* @__PURE__ */
|
|
1204
|
-
onSelect: () =>
|
|
1204
|
+
}) }), /* @__PURE__ */ K(w, { children: e.options?.map((e) => {
|
|
1205
|
+
let t = p.includes(e.value);
|
|
1206
|
+
return /* @__PURE__ */ q(b, {
|
|
1207
|
+
onSelect: () => h(e.value),
|
|
1205
1208
|
"data-checked": t || void 0,
|
|
1206
1209
|
disabled: e.disabled,
|
|
1207
1210
|
className: "data-[checked=true]:**:[svg]:text-primary-accent",
|
|
1208
|
-
children: [!!e.icon && /* @__PURE__ */
|
|
1211
|
+
children: [!!e.icon && /* @__PURE__ */ K("span", {
|
|
1209
1212
|
className: "shrink-0 text-muted-foreground [&_svg]:size-icon",
|
|
1210
1213
|
children: e.icon
|
|
1211
|
-
}), /* @__PURE__ */
|
|
1214
|
+
}), /* @__PURE__ */ q(l, {
|
|
1215
|
+
gap: "dense",
|
|
1212
1216
|
className: "flex min-w-0 flex-1 flex-col leading-tight",
|
|
1213
|
-
children: [/* @__PURE__ */
|
|
1217
|
+
children: [/* @__PURE__ */ K(i, {
|
|
1214
1218
|
tag: "span",
|
|
1215
1219
|
lineHeight: "tight",
|
|
1216
1220
|
weight: t ? "medium" : "regular",
|
|
1217
1221
|
className: "truncate",
|
|
1218
1222
|
children: e.label
|
|
1219
|
-
}), !!e.description && /* @__PURE__ */
|
|
1223
|
+
}), !!e.description && /* @__PURE__ */ K(i, {
|
|
1220
1224
|
tag: "span",
|
|
1221
1225
|
size: "xs",
|
|
1222
1226
|
lineHeight: "tight",
|
|
1223
1227
|
type: "secondary",
|
|
1224
|
-
className: "truncate
|
|
1228
|
+
className: "truncate",
|
|
1225
1229
|
children: e.description
|
|
1226
1230
|
})]
|
|
1227
1231
|
})]
|
|
@@ -1229,15 +1233,15 @@ function qe({ filter: e, value: t, onFilterChange: i, onBackToFilterList: a, onC
|
|
|
1229
1233
|
}) })]
|
|
1230
1234
|
})]
|
|
1231
1235
|
}),
|
|
1232
|
-
!!
|
|
1236
|
+
!!_ && /* @__PURE__ */ K(I, {
|
|
1233
1237
|
caption: Y(c.selected, {
|
|
1234
|
-
count:
|
|
1235
|
-
filterLabel: (
|
|
1238
|
+
count: p.length,
|
|
1239
|
+
filterLabel: (p.length > 1 ? e.pluralLabel : e.label) ?? e.label
|
|
1236
1240
|
}),
|
|
1237
|
-
children: /* @__PURE__ */
|
|
1241
|
+
children: /* @__PURE__ */ K(s, {
|
|
1238
1242
|
tone: "primary",
|
|
1239
1243
|
size: "sm",
|
|
1240
|
-
onClick:
|
|
1244
|
+
onClick: g,
|
|
1241
1245
|
children: c.confirm
|
|
1242
1246
|
})
|
|
1243
1247
|
})
|
|
@@ -1246,116 +1250,115 @@ function qe({ filter: e, value: t, onFilterChange: i, onBackToFilterList: a, onC
|
|
|
1246
1250
|
}
|
|
1247
1251
|
//#endregion
|
|
1248
1252
|
//#region src/components/features/filters/facets/tags-facet.tsx
|
|
1249
|
-
function
|
|
1250
|
-
let {
|
|
1251
|
-
let e =
|
|
1252
|
-
e && !
|
|
1253
|
+
function nt({ filter: e, value: n, onValueChange: a, className: o }) {
|
|
1254
|
+
let { defaultScale: c } = t(), u = O(void 0, c), { strings: d } = Q(), [f, p] = G(""), m = V(() => {
|
|
1255
|
+
let e = f.trim();
|
|
1256
|
+
e && !n.includes(e) && (a([...n, e]), p(""));
|
|
1253
1257
|
}, [
|
|
1254
|
-
|
|
1255
|
-
|
|
1258
|
+
f,
|
|
1259
|
+
n,
|
|
1256
1260
|
a
|
|
1257
|
-
]),
|
|
1258
|
-
a(
|
|
1259
|
-
}, [
|
|
1260
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
1261
|
-
},
|
|
1262
|
-
a([]),
|
|
1263
|
-
}, [a]),
|
|
1261
|
+
]), h = V((e) => {
|
|
1262
|
+
a(n.filter((t) => t !== e));
|
|
1263
|
+
}, [n, a]), g = (e) => {
|
|
1264
|
+
e.key === "Enter" && (e.preventDefault(), m());
|
|
1265
|
+
}, _ = V(() => {
|
|
1266
|
+
a([]), p("");
|
|
1267
|
+
}, [a]), b = n.length > 0, x = n.length === 1 ? d.tag : d.tags, S = b ? /* @__PURE__ */ q(l, {
|
|
1264
1268
|
gap: "md",
|
|
1265
1269
|
className: "tags-facet--summary",
|
|
1266
|
-
children: [/* @__PURE__ */
|
|
1270
|
+
children: [/* @__PURE__ */ q(l, {
|
|
1267
1271
|
direction: "horizontal",
|
|
1268
1272
|
gap: "sm",
|
|
1269
1273
|
justify: "between",
|
|
1270
1274
|
wrap: !1,
|
|
1271
|
-
children: [/* @__PURE__ */
|
|
1275
|
+
children: [/* @__PURE__ */ q(i, {
|
|
1272
1276
|
tag: "span",
|
|
1273
1277
|
size: "xs",
|
|
1274
1278
|
type: "secondary",
|
|
1275
1279
|
children: [
|
|
1276
|
-
|
|
1280
|
+
n.length,
|
|
1277
1281
|
" ",
|
|
1278
|
-
|
|
1282
|
+
x
|
|
1279
1283
|
]
|
|
1280
|
-
}), /* @__PURE__ */
|
|
1281
|
-
onClick:
|
|
1284
|
+
}), /* @__PURE__ */ K(s, {
|
|
1285
|
+
onClick: _,
|
|
1282
1286
|
tone: "secondary",
|
|
1283
1287
|
buttonStyle: "ghost",
|
|
1284
1288
|
size: "sm",
|
|
1285
|
-
className: "
|
|
1289
|
+
className: "text-muted-foreground hover:text-foreground",
|
|
1286
1290
|
type: "button",
|
|
1287
|
-
"aria-label":
|
|
1288
|
-
children:
|
|
1291
|
+
"aria-label": d.clearAll,
|
|
1292
|
+
children: d.clearAll
|
|
1289
1293
|
})]
|
|
1290
|
-
}), /* @__PURE__ */
|
|
1294
|
+
}), /* @__PURE__ */ K(l, {
|
|
1291
1295
|
direction: "horizontal",
|
|
1292
1296
|
gap: "md",
|
|
1293
|
-
children:
|
|
1297
|
+
children: n.map((e) => /* @__PURE__ */ q(v, {
|
|
1294
1298
|
tone: "secondary",
|
|
1295
1299
|
className: "flex items-center gap-space-sm py-space-2xs pl-space-md pr-space-sm",
|
|
1296
|
-
children: [/* @__PURE__ */
|
|
1300
|
+
children: [/* @__PURE__ */ K(i, {
|
|
1297
1301
|
tag: "span",
|
|
1298
1302
|
size: "xs",
|
|
1299
1303
|
children: e
|
|
1300
|
-
}), /* @__PURE__ */
|
|
1301
|
-
onClick: () =>
|
|
1302
|
-
|
|
1303
|
-
buttonStyle: "ghost",
|
|
1304
|
-
size: "sm",
|
|
1305
|
-
iconOnly: !0,
|
|
1306
|
-
className: "ml-space-sm size-icon rounded-full p-0 hover:bg-muted-foreground/20",
|
|
1304
|
+
}), /* @__PURE__ */ K("button", {
|
|
1305
|
+
onClick: () => h(e),
|
|
1306
|
+
className: r(y.target, y.focus, y.toggle),
|
|
1307
1307
|
type: "button",
|
|
1308
|
-
"aria-label": `${
|
|
1309
|
-
children: /* @__PURE__ */
|
|
1308
|
+
"aria-label": `${d.removeTag} ${e}`,
|
|
1309
|
+
children: /* @__PURE__ */ K(ye, {
|
|
1310
|
+
className: y.icon,
|
|
1311
|
+
"aria-hidden": "true"
|
|
1312
|
+
})
|
|
1310
1313
|
})]
|
|
1311
1314
|
}, e))
|
|
1312
1315
|
})]
|
|
1313
1316
|
}) : null;
|
|
1314
|
-
return /* @__PURE__ */
|
|
1317
|
+
return /* @__PURE__ */ q(l, {
|
|
1315
1318
|
gap: "lg",
|
|
1316
|
-
className:
|
|
1317
|
-
children: [/* @__PURE__ */
|
|
1319
|
+
className: r("tags-facet--component", o),
|
|
1320
|
+
children: [/* @__PURE__ */ q(l, {
|
|
1318
1321
|
direction: "horizontal",
|
|
1319
1322
|
gap: "md",
|
|
1320
1323
|
wrap: !1,
|
|
1321
|
-
children: [/* @__PURE__ */
|
|
1324
|
+
children: [/* @__PURE__ */ K("div", {
|
|
1322
1325
|
className: "relative flex-1",
|
|
1323
|
-
children: /* @__PURE__ */
|
|
1326
|
+
children: /* @__PURE__ */ K(A, {
|
|
1324
1327
|
type: "text",
|
|
1325
|
-
value:
|
|
1326
|
-
onChange: (e) =>
|
|
1327
|
-
onKeyDown:
|
|
1328
|
-
placeholder: e.placeholder ??
|
|
1329
|
-
className: ge
|
|
1328
|
+
value: f,
|
|
1329
|
+
onChange: (e) => p(e.target.value),
|
|
1330
|
+
onKeyDown: g,
|
|
1331
|
+
placeholder: e.placeholder ?? d.enterTag
|
|
1330
1332
|
})
|
|
1331
|
-
}), /* @__PURE__ */
|
|
1332
|
-
onClick:
|
|
1333
|
-
disabled: !
|
|
1334
|
-
size:
|
|
1335
|
-
|
|
1333
|
+
}), /* @__PURE__ */ q(s, {
|
|
1334
|
+
onClick: m,
|
|
1335
|
+
disabled: !f.trim(),
|
|
1336
|
+
size: u,
|
|
1337
|
+
iconOnly: !0,
|
|
1338
|
+
className: r(k[u], re[u]),
|
|
1336
1339
|
type: "button",
|
|
1337
|
-
children: [/* @__PURE__ */
|
|
1340
|
+
children: [/* @__PURE__ */ K(ve, { className: "size-icon" }), /* @__PURE__ */ K(i, {
|
|
1338
1341
|
tag: "span",
|
|
1339
1342
|
size: "pxs",
|
|
1340
1343
|
className: "sr-only",
|
|
1341
|
-
children:
|
|
1344
|
+
children: d.addTag
|
|
1342
1345
|
})]
|
|
1343
1346
|
})]
|
|
1344
|
-
}),
|
|
1347
|
+
}), S]
|
|
1345
1348
|
});
|
|
1346
1349
|
}
|
|
1347
|
-
var
|
|
1348
|
-
|
|
1350
|
+
var rt = B.memo(nt);
|
|
1351
|
+
rt.displayName = "TagsFacet";
|
|
1349
1352
|
//#endregion
|
|
1350
1353
|
//#region src/components/features/filters/partials/tags-filter-content.tsx
|
|
1351
|
-
function
|
|
1352
|
-
let { strings:
|
|
1353
|
-
|
|
1354
|
+
function it({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: i, triggerSource: a = "chip" }) {
|
|
1355
|
+
let { strings: o, reportError: c } = Q(), [l, u] = G(t || []), d = a === "toolbar", f = l.length === 1 ? o.tag : o.tags;
|
|
1356
|
+
H(() => {
|
|
1354
1357
|
u(t || []);
|
|
1355
1358
|
}, [t]);
|
|
1356
1359
|
let m = () => {
|
|
1357
1360
|
try {
|
|
1358
|
-
|
|
1361
|
+
n(l), i();
|
|
1359
1362
|
} catch (t) {
|
|
1360
1363
|
c(t, {
|
|
1361
1364
|
phase: "apply",
|
|
@@ -1363,49 +1366,49 @@ function Xe({ filter: e, value: t, onFilterChange: r, onBackToFilterList: i, onC
|
|
|
1363
1366
|
});
|
|
1364
1367
|
}
|
|
1365
1368
|
}, h = JSON.stringify(l.slice().sort()) !== JSON.stringify((t ?? []).slice().sort());
|
|
1366
|
-
return /* @__PURE__ */
|
|
1369
|
+
return /* @__PURE__ */ q("div", {
|
|
1367
1370
|
className: "flex flex-col",
|
|
1368
1371
|
children: [
|
|
1369
|
-
/* @__PURE__ */
|
|
1370
|
-
start:
|
|
1372
|
+
/* @__PURE__ */ K(P, {
|
|
1373
|
+
start: d ? /* @__PURE__ */ K(s, {
|
|
1371
1374
|
type: "button",
|
|
1372
1375
|
tone: "secondary",
|
|
1373
1376
|
buttonStyle: "ghost",
|
|
1374
1377
|
size: "sm",
|
|
1375
1378
|
iconOnly: !0,
|
|
1376
|
-
onClick:
|
|
1379
|
+
onClick: r,
|
|
1377
1380
|
className: "shrink-0",
|
|
1378
|
-
"aria-label":
|
|
1379
|
-
children: /* @__PURE__ */
|
|
1381
|
+
"aria-label": o.backToFilters,
|
|
1382
|
+
children: /* @__PURE__ */ K(J, {
|
|
1380
1383
|
"aria-hidden": "true",
|
|
1381
1384
|
className: "size-icon-sm rtl:rotate-180"
|
|
1382
1385
|
})
|
|
1383
1386
|
}) : void 0,
|
|
1384
|
-
children: /* @__PURE__ */
|
|
1387
|
+
children: /* @__PURE__ */ K(M, { children: e.label })
|
|
1385
1388
|
}),
|
|
1386
|
-
/* @__PURE__ */
|
|
1389
|
+
/* @__PURE__ */ K("div", {
|
|
1387
1390
|
className: "p-surface",
|
|
1388
|
-
children: /* @__PURE__ */
|
|
1391
|
+
children: /* @__PURE__ */ K(rt, {
|
|
1389
1392
|
filter: e,
|
|
1390
1393
|
value: l,
|
|
1391
1394
|
onValueChange: u
|
|
1392
1395
|
})
|
|
1393
1396
|
}),
|
|
1394
|
-
!!h && /* @__PURE__ */
|
|
1395
|
-
caption: /* @__PURE__ */
|
|
1397
|
+
!!h && /* @__PURE__ */ K(I, {
|
|
1398
|
+
caption: /* @__PURE__ */ q(p, {
|
|
1396
1399
|
size: "xs",
|
|
1397
1400
|
className: "tabular-nums",
|
|
1398
1401
|
children: [
|
|
1399
1402
|
l.length,
|
|
1400
1403
|
" ",
|
|
1401
|
-
|
|
1404
|
+
f
|
|
1402
1405
|
]
|
|
1403
1406
|
}),
|
|
1404
|
-
children: /* @__PURE__ */
|
|
1407
|
+
children: /* @__PURE__ */ K(s, {
|
|
1405
1408
|
tone: "primary",
|
|
1406
1409
|
size: "sm",
|
|
1407
1410
|
onClick: m,
|
|
1408
|
-
children:
|
|
1411
|
+
children: o.confirm
|
|
1409
1412
|
})
|
|
1410
1413
|
})
|
|
1411
1414
|
]
|
|
@@ -1413,71 +1416,71 @@ function Xe({ filter: e, value: t, onFilterChange: r, onBackToFilterList: i, onC
|
|
|
1413
1416
|
}
|
|
1414
1417
|
//#endregion
|
|
1415
1418
|
//#region src/components/features/filters/partials/filter-popover-content.tsx
|
|
1416
|
-
function
|
|
1419
|
+
function at({ activeFilterInPopover: e, availableFilters: t, activeFilters: n, getFilterValue: i, setFilterValue: a, onFilterSelect: o, onBackToFilterList: s, onClose: c, triggerSource: l = "chip", finalFocus: u }) {
|
|
1417
1420
|
let { strings: d } = Q(), f = e?.type === X.DATE || e?.type === X.TAGS ? "w-auto min-w-80 gap-0 overflow-hidden" : e?.type === X.ASYNC_SELECT ? "w-72 gap-0 overflow-hidden" : "w-64 gap-0 overflow-hidden", p = (e, t) => {
|
|
1418
1421
|
a(e, t);
|
|
1419
1422
|
};
|
|
1420
|
-
return /* @__PURE__ */
|
|
1423
|
+
return /* @__PURE__ */ K(ee, {
|
|
1421
1424
|
finalFocus: u,
|
|
1422
1425
|
type: e?.type === X.DATE || e?.type === X.TAGS ? "display" : "menu",
|
|
1423
1426
|
"aria-label": e?.label ?? d.addFilter,
|
|
1424
1427
|
inset: "flush",
|
|
1425
|
-
className:
|
|
1428
|
+
className: r("filter-popover-content--component", f),
|
|
1426
1429
|
align: "start",
|
|
1427
|
-
children: e ? e.type === X.DATE ? /* @__PURE__ */
|
|
1430
|
+
children: e ? e.type === X.DATE ? /* @__PURE__ */ K(Ze, {
|
|
1428
1431
|
filter: e,
|
|
1429
1432
|
value: i(e.key),
|
|
1430
1433
|
onFilterChange: (t) => p(e.key, t),
|
|
1431
1434
|
onBackToFilterList: s,
|
|
1432
1435
|
triggerSource: l
|
|
1433
|
-
}) : e.type === X.TAGS ? /* @__PURE__ */
|
|
1436
|
+
}) : e.type === X.TAGS ? /* @__PURE__ */ K(it, {
|
|
1434
1437
|
filter: e,
|
|
1435
1438
|
value: i(e.key),
|
|
1436
1439
|
onFilterChange: (t) => p(e.key, t),
|
|
1437
1440
|
onBackToFilterList: s,
|
|
1438
1441
|
onClose: c,
|
|
1439
1442
|
triggerSource: l
|
|
1440
|
-
}) : e.type === X.ASYNC_SELECT ? /* @__PURE__ */
|
|
1443
|
+
}) : e.type === X.ASYNC_SELECT ? /* @__PURE__ */ K(Je, {
|
|
1441
1444
|
filter: e,
|
|
1442
1445
|
value: i(e.key),
|
|
1443
1446
|
onFilterChange: (t) => p(e.key, t),
|
|
1444
1447
|
onBackToFilterList: s,
|
|
1445
1448
|
onClose: c,
|
|
1446
1449
|
triggerSource: l
|
|
1447
|
-
}) : /* @__PURE__ */
|
|
1450
|
+
}) : /* @__PURE__ */ K(tt, {
|
|
1448
1451
|
filter: e,
|
|
1449
1452
|
value: i(e.key),
|
|
1450
1453
|
onFilterChange: (t) => p(e.key, t),
|
|
1451
1454
|
onBackToFilterList: s,
|
|
1452
1455
|
onClose: c,
|
|
1453
1456
|
triggerSource: l
|
|
1454
|
-
}) : /* @__PURE__ */
|
|
1455
|
-
availableFilters:
|
|
1456
|
-
activeFilters:
|
|
1457
|
+
}) : /* @__PURE__ */ K(et, {
|
|
1458
|
+
availableFilters: t,
|
|
1459
|
+
activeFilters: n,
|
|
1457
1460
|
onFilterSelect: o
|
|
1458
1461
|
})
|
|
1459
1462
|
});
|
|
1460
1463
|
}
|
|
1461
1464
|
//#endregion
|
|
1462
1465
|
//#region src/components/features/filters/partials/filter-pill.tsx
|
|
1463
|
-
function
|
|
1464
|
-
let d =
|
|
1465
|
-
return /* @__PURE__ */
|
|
1466
|
+
function ot({ filter: e, value: t, active: n, operator: r, operators: i, onOperatorChange: a, onValueChange: o, onClear: s, availableFilters: c, activeFilters: l, operatorChangeRef: u }) {
|
|
1467
|
+
let d = W(!1), f = u ?? d, [p, m] = G(!1), h = W(null), g = W(null);
|
|
1468
|
+
return /* @__PURE__ */ K($, {
|
|
1466
1469
|
filterKey: e.key,
|
|
1467
|
-
children: /* @__PURE__ */
|
|
1470
|
+
children: /* @__PURE__ */ q(F, {
|
|
1468
1471
|
open: p,
|
|
1469
1472
|
onOpenChange: (e) => {
|
|
1470
1473
|
e && f.current || m(e);
|
|
1471
1474
|
},
|
|
1472
|
-
children: [/* @__PURE__ */
|
|
1475
|
+
children: [/* @__PURE__ */ q("div", {
|
|
1473
1476
|
className: "filter-pill--component filter-pill--anchor relative",
|
|
1474
|
-
children: [/* @__PURE__ */
|
|
1475
|
-
render: /* @__PURE__ */
|
|
1477
|
+
children: [/* @__PURE__ */ K(N, {
|
|
1478
|
+
render: /* @__PURE__ */ K("span", {}),
|
|
1476
1479
|
nativeButton: !1,
|
|
1477
1480
|
tabIndex: -1,
|
|
1478
1481
|
"aria-hidden": "true",
|
|
1479
1482
|
className: "pointer-events-none absolute inset-0"
|
|
1480
|
-
}), /* @__PURE__ */
|
|
1483
|
+
}), /* @__PURE__ */ K(Ge, {
|
|
1481
1484
|
filter: e,
|
|
1482
1485
|
popoverOpen: p,
|
|
1483
1486
|
triggerRef: h,
|
|
@@ -1497,7 +1500,7 @@ function Qe({ filter: e, value: t, active: n, operator: r, operators: i, onOpera
|
|
|
1497
1500
|
f.current || (g.current = e?.currentTarget ?? h.current, m(!0));
|
|
1498
1501
|
}
|
|
1499
1502
|
})]
|
|
1500
|
-
}), /* @__PURE__ */
|
|
1503
|
+
}), /* @__PURE__ */ K(at, {
|
|
1501
1504
|
finalFocus: g,
|
|
1502
1505
|
activeFilterInPopover: e,
|
|
1503
1506
|
availableFilters: c,
|
|
@@ -1512,42 +1515,42 @@ function Qe({ filter: e, value: t, active: n, operator: r, operators: i, onOpera
|
|
|
1512
1515
|
})
|
|
1513
1516
|
});
|
|
1514
1517
|
}
|
|
1515
|
-
|
|
1518
|
+
ot.displayName = "FilterPill";
|
|
1516
1519
|
//#endregion
|
|
1517
1520
|
//#region src/components/features/filters/partials/filters-button.tsx
|
|
1518
|
-
function
|
|
1519
|
-
let [
|
|
1520
|
-
return
|
|
1521
|
-
|
|
1522
|
-
}, [
|
|
1523
|
-
open:
|
|
1524
|
-
onOpenChange:
|
|
1525
|
-
children: [/* @__PURE__ */
|
|
1521
|
+
function st({ triggerRef: e, availableFilters: n, activeFilters: i, activeFilterInPopover: a, getFilterValue: o, setFilterValue: c, setActiveFilterInPopover: l }) {
|
|
1522
|
+
let { defaultScale: u } = t(), d = O(void 0, u), [f, p] = G(!1), { strings: m } = Q();
|
|
1523
|
+
return H(() => {
|
|
1524
|
+
f || l(null);
|
|
1525
|
+
}, [f, l]), /* @__PURE__ */ q(F, {
|
|
1526
|
+
open: f,
|
|
1527
|
+
onOpenChange: p,
|
|
1528
|
+
children: [/* @__PURE__ */ K(N, {
|
|
1526
1529
|
asChild: !0,
|
|
1527
|
-
children: /* @__PURE__ */
|
|
1530
|
+
children: /* @__PURE__ */ K(s, {
|
|
1528
1531
|
ref: e,
|
|
1529
1532
|
tone: "secondary",
|
|
1530
1533
|
buttonStyle: "outline",
|
|
1531
|
-
size:
|
|
1534
|
+
size: d,
|
|
1532
1535
|
iconOnly: !0,
|
|
1533
|
-
"aria-label":
|
|
1534
|
-
className: "filters-button--component shrink-0",
|
|
1535
|
-
children: /* @__PURE__ */
|
|
1536
|
+
"aria-label": m.addFilter,
|
|
1537
|
+
className: r("filters-button--component shrink-0", k[d], re[d]),
|
|
1538
|
+
children: /* @__PURE__ */ K(ge, { className: "size-icon-sm" })
|
|
1536
1539
|
})
|
|
1537
|
-
}), /* @__PURE__ */
|
|
1538
|
-
activeFilterInPopover:
|
|
1539
|
-
availableFilters:
|
|
1540
|
-
activeFilters:
|
|
1541
|
-
getFilterValue:
|
|
1542
|
-
setFilterValue:
|
|
1540
|
+
}), /* @__PURE__ */ K(at, {
|
|
1541
|
+
activeFilterInPopover: a,
|
|
1542
|
+
availableFilters: n,
|
|
1543
|
+
activeFilters: i,
|
|
1544
|
+
getFilterValue: o,
|
|
1545
|
+
setFilterValue: c,
|
|
1543
1546
|
onFilterSelect: (e) => {
|
|
1544
|
-
|
|
1547
|
+
l(e);
|
|
1545
1548
|
},
|
|
1546
1549
|
onBackToFilterList: () => {
|
|
1547
|
-
|
|
1550
|
+
l(null);
|
|
1548
1551
|
},
|
|
1549
1552
|
onClose: () => {
|
|
1550
|
-
|
|
1553
|
+
l(null), p(!1);
|
|
1551
1554
|
},
|
|
1552
1555
|
triggerSource: "toolbar"
|
|
1553
1556
|
})]
|
|
@@ -1555,8 +1558,8 @@ function $e({ triggerRef: e, availableFilters: t, activeFilters: r, activeFilter
|
|
|
1555
1558
|
}
|
|
1556
1559
|
//#endregion
|
|
1557
1560
|
//#region src/components/features/filters/partials/filter-tabs.tsx
|
|
1558
|
-
function
|
|
1559
|
-
let { activeFilters:
|
|
1561
|
+
function ct({ tabs: e }) {
|
|
1562
|
+
let { activeFilters: t, filters: n, replaceFilters: a } = Q(), o = U(() => t.filter((e) => n.find((t) => t.key === e.key)?.type !== X.SEARCH), [t, n]), s = U(() => t.filter((e) => n.find((t) => t.key === e.key)?.type === X.SEARCH), [t, n]), c = U(() => {
|
|
1560
1563
|
for (let t of e) {
|
|
1561
1564
|
if (t.presets.length === 0) {
|
|
1562
1565
|
if (o.length === 0) return t.id;
|
|
@@ -1570,58 +1573,58 @@ function et({ tabs: e }) {
|
|
|
1570
1573
|
})) return t.id;
|
|
1571
1574
|
}
|
|
1572
1575
|
return null;
|
|
1573
|
-
}, [e, o]), l =
|
|
1576
|
+
}, [e, o]), l = V((e) => {
|
|
1574
1577
|
if (e.presets.length === 0) {
|
|
1575
1578
|
a([...s]);
|
|
1576
1579
|
return;
|
|
1577
1580
|
}
|
|
1578
1581
|
let t = e.presets.map((e) => {
|
|
1579
|
-
let t =
|
|
1582
|
+
let t = n.find((t) => t.key === e.key), r = e.operator ?? t?.operator ?? (t ? Me(t.type) : "equals");
|
|
1580
1583
|
return {
|
|
1581
1584
|
id: e.key,
|
|
1582
1585
|
key: e.key,
|
|
1583
1586
|
value: e.value,
|
|
1584
|
-
operator:
|
|
1587
|
+
operator: r
|
|
1585
1588
|
};
|
|
1586
1589
|
});
|
|
1587
1590
|
a([...s, ...t]);
|
|
1588
1591
|
}, [
|
|
1589
|
-
|
|
1592
|
+
n,
|
|
1590
1593
|
s,
|
|
1591
1594
|
a
|
|
1592
1595
|
]);
|
|
1593
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
1596
|
+
return e.length === 0 ? null : /* @__PURE__ */ K(ne, {
|
|
1594
1597
|
value: c,
|
|
1595
1598
|
onValueChange: (t) => {
|
|
1596
1599
|
let n = e.find((e) => e.id === t);
|
|
1597
1600
|
n && l(n);
|
|
1598
1601
|
},
|
|
1599
1602
|
className: "filter-tabs--component",
|
|
1600
|
-
children: /* @__PURE__ */
|
|
1603
|
+
children: /* @__PURE__ */ K(L, {
|
|
1601
1604
|
role: "group",
|
|
1602
1605
|
"aria-orientation": void 0,
|
|
1603
1606
|
activateOnFocus: !0,
|
|
1604
1607
|
className: "h-auto! flex-wrap justify-start gap-space-md bg-transparent p-0",
|
|
1605
1608
|
children: e.map((e) => {
|
|
1606
|
-
let
|
|
1607
|
-
return /* @__PURE__ */
|
|
1609
|
+
let t = c === e.id;
|
|
1610
|
+
return /* @__PURE__ */ q(te, {
|
|
1608
1611
|
value: e.id,
|
|
1609
1612
|
role: "button",
|
|
1610
1613
|
"aria-selected": void 0,
|
|
1611
1614
|
"aria-controls": void 0,
|
|
1612
|
-
"aria-pressed":
|
|
1613
|
-
className:
|
|
1614
|
-
children: [/* @__PURE__ */
|
|
1615
|
+
"aria-pressed": t,
|
|
1616
|
+
className: r("h-action-sm flex-none gap-space-sm rounded-inner px-control-sm py-0 transition-colors after:hidden data-active:bg-foreground data-active:text-background data-active:hover:bg-foreground data-active:hover:text-background", t ? "bg-foreground text-background" : "bg-muted text-muted-foreground hover:bg-accent hover:text-accent-foreground"),
|
|
1617
|
+
children: [/* @__PURE__ */ K(i, {
|
|
1615
1618
|
tag: "span",
|
|
1616
1619
|
weight: "semibold",
|
|
1617
1620
|
className: "text-inherit",
|
|
1618
1621
|
children: e.label
|
|
1619
|
-
}), e.count !== void 0 && /* @__PURE__ */
|
|
1622
|
+
}), e.count !== void 0 && /* @__PURE__ */ K(i, {
|
|
1620
1623
|
tag: "span",
|
|
1621
1624
|
size: "xs",
|
|
1622
1625
|
weight: "semibold",
|
|
1623
1626
|
numeric: !0,
|
|
1624
|
-
className:
|
|
1627
|
+
className: r("text-inherit", t ? "text-background" : "text-muted-foreground"),
|
|
1625
1628
|
children: e.count
|
|
1626
1629
|
})]
|
|
1627
1630
|
}, e.id);
|
|
@@ -1631,83 +1634,75 @@ function et({ tabs: e }) {
|
|
|
1631
1634
|
}
|
|
1632
1635
|
//#endregion
|
|
1633
1636
|
//#region src/components/features/filters/facets/search-facet.tsx
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1637
|
+
var lt = B.forwardRef(function(e, t) {
|
|
1638
|
+
return /* @__PURE__ */ K(_e, {
|
|
1639
|
+
...e,
|
|
1640
|
+
ref: t,
|
|
1641
|
+
className: r("animate-spin", e.className)
|
|
1642
|
+
});
|
|
1643
|
+
});
|
|
1644
|
+
function ut({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
1645
|
+
let { strings: a, isNavigating: o } = Q(), [s, c] = G(t[0] || ""), l = W(s);
|
|
1646
|
+
H(() => {
|
|
1647
|
+
l.current = s;
|
|
1648
|
+
}, [s]);
|
|
1649
|
+
let u = W(t[0] || null), d = W(!1);
|
|
1650
|
+
H(() => {
|
|
1651
|
+
if (d.current || o) return;
|
|
1652
|
+
let e = l.current;
|
|
1653
|
+
if (!t.length || t[0] === "") {
|
|
1654
|
+
e !== "" && (c(""), u.current = "");
|
|
1643
1655
|
return;
|
|
1644
1656
|
}
|
|
1645
|
-
|
|
1646
|
-
}, [
|
|
1647
|
-
let
|
|
1648
|
-
|
|
1649
|
-
}, e.delay ?? 300),
|
|
1650
|
-
|
|
1657
|
+
t[0] !== void 0 && t[0] !== e && t[0] !== u.current && (c(t[0]), u.current = t[0]);
|
|
1658
|
+
}, [t, o]);
|
|
1659
|
+
let f = z((e) => {
|
|
1660
|
+
u.current = e, d.current = !1, n([e]);
|
|
1661
|
+
}, e.delay ?? 300), p = (e) => {
|
|
1662
|
+
u.current !== e && f(e);
|
|
1651
1663
|
};
|
|
1652
1664
|
return /* @__PURE__ */ K("div", {
|
|
1653
|
-
className:
|
|
1654
|
-
children:
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
}
|
|
1678
|
-
|
|
1679
|
-
type: "button",
|
|
1680
|
-
tone: "secondary",
|
|
1681
|
-
buttonStyle: "ghost",
|
|
1682
|
-
size: "sm",
|
|
1683
|
-
iconOnly: !0,
|
|
1684
|
-
onClick: () => {
|
|
1685
|
-
f.current = !0, l(""), m("");
|
|
1686
|
-
},
|
|
1687
|
-
className: "absolute right-control-gap-small top-1/2 -translate-y-1/2",
|
|
1688
|
-
"aria-label": o.clearSearch,
|
|
1689
|
-
children: /* @__PURE__ */ G(q, { className: "size-icon-sm" })
|
|
1690
|
-
}),
|
|
1691
|
-
!!s && /* @__PURE__ */ G("span", {
|
|
1692
|
-
className: "text-muted-foreground absolute right-control-px top-1/2 -translate-y-1/2",
|
|
1693
|
-
children: /* @__PURE__ */ G(ue, { className: "size-icon animate-spin" })
|
|
1694
|
-
})
|
|
1695
|
-
]
|
|
1665
|
+
className: r("search-facet--component", "search-facet relative w-full min-w-0 rounded-inner bg-background", i),
|
|
1666
|
+
children: /* @__PURE__ */ K(A, {
|
|
1667
|
+
type: "text",
|
|
1668
|
+
"aria-label": e.label,
|
|
1669
|
+
value: s,
|
|
1670
|
+
onChange: (e) => {
|
|
1671
|
+
d.current = !0;
|
|
1672
|
+
let t = e.target.value;
|
|
1673
|
+
c(t), p(t);
|
|
1674
|
+
},
|
|
1675
|
+
onFocus: () => {
|
|
1676
|
+
d.current = !0;
|
|
1677
|
+
},
|
|
1678
|
+
onBlur: () => {
|
|
1679
|
+
setTimeout(() => {
|
|
1680
|
+
d.current = !1;
|
|
1681
|
+
}, 100);
|
|
1682
|
+
},
|
|
1683
|
+
placeholder: e.placeholder ?? (() => {
|
|
1684
|
+
let t = e.label.trim().toLowerCase();
|
|
1685
|
+
return !t || t === "search" ? Y(a.searchPlaceholder, { filterLabel: "" }).replace(/\s+([….?!])/g, "$1").replace(/\s{2,}/g, " ").trim() : Y(a.searchPlaceholder, { filterLabel: t });
|
|
1686
|
+
})(),
|
|
1687
|
+
clearable: s.trim() !== "" && !o,
|
|
1688
|
+
endIcon: o ? lt : void 0,
|
|
1689
|
+
strings: { clear: a.clearSearch }
|
|
1690
|
+
})
|
|
1696
1691
|
});
|
|
1697
1692
|
}
|
|
1698
|
-
var
|
|
1699
|
-
|
|
1693
|
+
var dt = B.memo(ut);
|
|
1694
|
+
dt.displayName = "SearchFacet";
|
|
1700
1695
|
//#endregion
|
|
1701
1696
|
//#region src/components/features/filters/partials/search-filters-list.tsx
|
|
1702
|
-
function
|
|
1703
|
-
return /* @__PURE__ */
|
|
1697
|
+
function ft({ filters: e, getFilterValue: t, setFilterValue: n, className: a }) {
|
|
1698
|
+
return /* @__PURE__ */ K(de, { children: e.map((e) => /* @__PURE__ */ q(l, {
|
|
1704
1699
|
gap: "lg",
|
|
1705
|
-
className:
|
|
1706
|
-
children: [/* @__PURE__ */
|
|
1700
|
+
className: r("search-filters-list--component", "w-full min-w-0 sm:w-64 sm:flex-none", e.displayConfig.className, a),
|
|
1701
|
+
children: [/* @__PURE__ */ K(dt, {
|
|
1707
1702
|
filter: e,
|
|
1708
|
-
value:
|
|
1709
|
-
onValueChange: (t) =>
|
|
1710
|
-
}), !!e.description && /* @__PURE__ */
|
|
1703
|
+
value: t(e.key),
|
|
1704
|
+
onValueChange: (t) => n(e.key, t)
|
|
1705
|
+
}), !!e.description && /* @__PURE__ */ K(i, {
|
|
1711
1706
|
size: "xs",
|
|
1712
1707
|
type: "secondary",
|
|
1713
1708
|
children: e.description
|
|
@@ -1716,65 +1711,66 @@ function rt({ filters: e, getFilterValue: n, setFilterValue: i, className: a })
|
|
|
1716
1711
|
}
|
|
1717
1712
|
//#endregion
|
|
1718
1713
|
//#region src/components/features/filters/filter-layout.tsx
|
|
1719
|
-
var
|
|
1714
|
+
var pt = {
|
|
1720
1715
|
compact: "lg",
|
|
1721
1716
|
default: "xl"
|
|
1722
|
-
},
|
|
1717
|
+
}, mt = {
|
|
1723
1718
|
compact: "sm",
|
|
1724
1719
|
default: "md"
|
|
1725
1720
|
};
|
|
1726
|
-
function
|
|
1727
|
-
let { getFilterValue: u, setFilterValue: d, isFilterActive: f, clearFilters: p, getFilterOperator: m, setFilterOperator: h, isNavigating: g, strings: _ } = Q(), { processedFilters: v, searchFilters: y, alwaysVisibleFilters: b, activeRegularFilters: x, popoverFilters: S, hasActive: C } =
|
|
1721
|
+
function ht({ className: e, dynamicFilterOptions: t = {}, loadingFilters: n = {}, variant: a = "default", showClearFilters: o = !1, tabs: c }) {
|
|
1722
|
+
let { getFilterValue: u, setFilterValue: d, isFilterActive: f, clearFilters: p, getFilterOperator: m, setFilterOperator: h, isNavigating: g, strings: _ } = Q(), { processedFilters: v, searchFilters: y, alwaysVisibleFilters: b, activeRegularFilters: x, popoverFilters: S, hasActive: C } = Ie({ dynamicFilterOptions: t }), [w, T] = G(null), E = v.find((e) => e.key === w) ?? null, D = V((e) => {
|
|
1728
1723
|
T(e?.key ?? null);
|
|
1729
1724
|
}, []);
|
|
1730
|
-
|
|
1725
|
+
H(() => {
|
|
1731
1726
|
w !== null && E === null && T(null);
|
|
1732
1727
|
}, [w, E]);
|
|
1733
|
-
let O =
|
|
1728
|
+
let O = W(null), k = W(null);
|
|
1734
1729
|
function A(e, t) {
|
|
1735
1730
|
t.length === 0 && e.displayConfig?.display !== "always" && (k.current = e.key), d(e.key, t);
|
|
1736
1731
|
}
|
|
1737
|
-
|
|
1732
|
+
H(() => {
|
|
1738
1733
|
let e = k.current;
|
|
1739
1734
|
e !== null && !f(e) && (O.current?.focus(), k.current = null);
|
|
1740
1735
|
}, [f]);
|
|
1741
1736
|
function j(e) {
|
|
1742
|
-
return e.operators && e.operators.length > 0 ? e.operators :
|
|
1737
|
+
return e.operators && e.operators.length > 0 ? e.operators : je(e.type, _.operators);
|
|
1743
1738
|
}
|
|
1744
1739
|
function M(e, t) {
|
|
1745
1740
|
h(e, t);
|
|
1746
1741
|
}
|
|
1747
|
-
return /* @__PURE__ */
|
|
1748
|
-
gap:
|
|
1749
|
-
className:
|
|
1750
|
-
children: [!!
|
|
1742
|
+
return /* @__PURE__ */ q(l, {
|
|
1743
|
+
gap: pt[a],
|
|
1744
|
+
className: r("filter-layout--component", e),
|
|
1745
|
+
children: [!!c && c.length > 0 && /* @__PURE__ */ K(ct, { tabs: c }), /* @__PURE__ */ q(l, {
|
|
1751
1746
|
direction: "horizontal",
|
|
1752
|
-
|
|
1753
|
-
|
|
1747
|
+
align: "center",
|
|
1748
|
+
gap: mt[a],
|
|
1749
|
+
children: [/* @__PURE__ */ K($, {
|
|
1754
1750
|
filterKey: "search-filters",
|
|
1755
|
-
children: /* @__PURE__ */
|
|
1751
|
+
children: /* @__PURE__ */ K(ft, {
|
|
1756
1752
|
filters: y,
|
|
1757
1753
|
getFilterValue: u,
|
|
1758
1754
|
setFilterValue: d
|
|
1759
1755
|
})
|
|
1760
|
-
}), /* @__PURE__ */
|
|
1761
|
-
className:
|
|
1756
|
+
}), /* @__PURE__ */ q("div", {
|
|
1757
|
+
className: r("contents", g && "pointer-events-none opacity-60"),
|
|
1762
1758
|
children: [
|
|
1763
|
-
Object.entries(
|
|
1759
|
+
Object.entries(n).filter(([, e]) => e).map(([e]) => {
|
|
1764
1760
|
let t = v.find((t) => t.key === e)?.label || e;
|
|
1765
|
-
return /* @__PURE__ */
|
|
1761
|
+
return /* @__PURE__ */ q(l, {
|
|
1766
1762
|
direction: "horizontal",
|
|
1767
1763
|
gap: "sm",
|
|
1768
1764
|
wrap: !1,
|
|
1769
|
-
className: "rounded-radius
|
|
1770
|
-
children: [/* @__PURE__ */
|
|
1765
|
+
className: "rounded-radius bg-muted/50 px-control-sm py-space-xs",
|
|
1766
|
+
children: [/* @__PURE__ */ K("div", { className: "border-muted-foreground/30 border-t-primary size-icon-sm animate-spin rounded-full border-2" }), /* @__PURE__ */ K(i, {
|
|
1771
1767
|
tag: "span",
|
|
1772
1768
|
type: "secondary",
|
|
1773
1769
|
children: Y(_.loadingOptions, { filterLabel: t })
|
|
1774
1770
|
})]
|
|
1775
1771
|
}, `loading-${e}`);
|
|
1776
1772
|
}),
|
|
1777
|
-
[...b, ...x].map((e) => /* @__PURE__ */
|
|
1773
|
+
[...b, ...x].map((e) => /* @__PURE__ */ K(ot, {
|
|
1778
1774
|
filter: e,
|
|
1779
1775
|
value: u(e.key) ?? [],
|
|
1780
1776
|
active: f(e.key),
|
|
@@ -1786,9 +1782,9 @@ function ot({ className: e, dynamicFilterOptions: i = {}, loadingFilters: a = {}
|
|
|
1786
1782
|
availableFilters: S,
|
|
1787
1783
|
activeFilters: [...x, ...b]
|
|
1788
1784
|
}, e.key)),
|
|
1789
|
-
S.length > 0 && /* @__PURE__ */
|
|
1785
|
+
S.length > 0 && /* @__PURE__ */ K($, {
|
|
1790
1786
|
filterKey: "filters-button",
|
|
1791
|
-
children: /* @__PURE__ */
|
|
1787
|
+
children: /* @__PURE__ */ K(st, {
|
|
1792
1788
|
triggerRef: O,
|
|
1793
1789
|
availableFilters: S,
|
|
1794
1790
|
activeFilters: x,
|
|
@@ -1798,10 +1794,9 @@ function ot({ className: e, dynamicFilterOptions: i = {}, loadingFilters: a = {}
|
|
|
1798
1794
|
setActiveFilterInPopover: D
|
|
1799
1795
|
})
|
|
1800
1796
|
}),
|
|
1801
|
-
!!
|
|
1797
|
+
!!o && C && /* @__PURE__ */ K(s, {
|
|
1802
1798
|
tone: "secondary",
|
|
1803
1799
|
buttonStyle: "ghost",
|
|
1804
|
-
size: "md",
|
|
1805
1800
|
onClick: p,
|
|
1806
1801
|
className: "text-muted-foreground ml-auto",
|
|
1807
1802
|
children: _.clearFilters
|
|
@@ -1813,8 +1808,8 @@ function ot({ className: e, dynamicFilterOptions: i = {}, loadingFilters: a = {}
|
|
|
1813
1808
|
}
|
|
1814
1809
|
//#endregion
|
|
1815
1810
|
//#region src/components/features/filters/filter-query.ts
|
|
1816
|
-
var
|
|
1817
|
-
function
|
|
1811
|
+
var gt = "__op", _t = ["page"], vt = new Set(Object.values(Z));
|
|
1812
|
+
function yt(e) {
|
|
1818
1813
|
let t = {};
|
|
1819
1814
|
if (!e) return t;
|
|
1820
1815
|
if (e instanceof URLSearchParams) return e.forEach((e, n) => {
|
|
@@ -1826,297 +1821,297 @@ function ut(e) {
|
|
|
1826
1821
|
}
|
|
1827
1822
|
return t;
|
|
1828
1823
|
}
|
|
1829
|
-
function
|
|
1824
|
+
function bt(e) {
|
|
1830
1825
|
let t = {};
|
|
1831
1826
|
for (let [n, r] of Object.entries(e)) r.length !== 0 && (t[n] = r.length === 1 ? r[0] : r);
|
|
1832
1827
|
return t;
|
|
1833
1828
|
}
|
|
1834
|
-
function
|
|
1829
|
+
function xt(e, t, n) {
|
|
1835
1830
|
let r = e[t] ?? [];
|
|
1836
1831
|
return n === "comma" ? r.flatMap((e) => e.split(",")) : r;
|
|
1837
1832
|
}
|
|
1838
|
-
function
|
|
1833
|
+
function St(e, t) {
|
|
1839
1834
|
return t.map((e) => e.trim()).filter((e) => e.length > 0).map((t) => {
|
|
1840
1835
|
if (!e.parse) return t;
|
|
1841
1836
|
let n = e.parse(t);
|
|
1842
1837
|
return n == null ? "" : String(n);
|
|
1843
1838
|
}).filter((e) => e.length > 0);
|
|
1844
1839
|
}
|
|
1845
|
-
function
|
|
1840
|
+
function Ct(e, t) {
|
|
1846
1841
|
return t.map((t) => {
|
|
1847
1842
|
let n = e.transform ? e.transform(t) : t, r = e.format ? e.format(n) : n;
|
|
1848
1843
|
return r == null ? "" : String(r);
|
|
1849
1844
|
}).filter((e) => e.length > 0);
|
|
1850
1845
|
}
|
|
1851
|
-
function
|
|
1852
|
-
return e.operator ?? e.operators?.[0]?.value ??
|
|
1846
|
+
function wt(e) {
|
|
1847
|
+
return e.operator ?? e.operators?.[0]?.value ?? Me(e.type);
|
|
1853
1848
|
}
|
|
1854
|
-
function
|
|
1849
|
+
function Tt(e, t, n) {
|
|
1855
1850
|
let [r] = t[`${e.key}${n}`] ?? [];
|
|
1856
|
-
return r &&
|
|
1851
|
+
return r && vt.has(r) ? r : wt(e);
|
|
1857
1852
|
}
|
|
1858
|
-
function
|
|
1853
|
+
function Et(e, t, n) {
|
|
1859
1854
|
return e === "always" || e !== "never" && t !== n;
|
|
1860
1855
|
}
|
|
1861
|
-
function
|
|
1856
|
+
function Dt(e) {
|
|
1862
1857
|
return e.type === X.MULTI_SELECT || e.type === X.TAGS || e.multiple === !0;
|
|
1863
1858
|
}
|
|
1864
|
-
function
|
|
1865
|
-
let r = n.operatorSuffix ??
|
|
1859
|
+
function Ot(e, t, n = {}) {
|
|
1860
|
+
let r = n.operatorSuffix ?? gt, i = n.arrayFormat ?? "repeat", a = yt(t);
|
|
1866
1861
|
return e.flatMap((e) => {
|
|
1867
|
-
let t =
|
|
1862
|
+
let t = St(e, xt(a, e.key, i));
|
|
1868
1863
|
return t.length === 0 ? [] : [{
|
|
1869
1864
|
id: e.key,
|
|
1870
1865
|
key: e.key,
|
|
1871
|
-
operator:
|
|
1872
|
-
value:
|
|
1866
|
+
operator: Tt(e, a, r),
|
|
1867
|
+
value: Dt(e) ? t : [t[0]]
|
|
1873
1868
|
}];
|
|
1874
1869
|
});
|
|
1875
1870
|
}
|
|
1876
|
-
function
|
|
1877
|
-
let i = r.operatorSuffix ??
|
|
1871
|
+
function kt(e, t, n, r = {}) {
|
|
1872
|
+
let i = r.operatorSuffix ?? gt, a = r.arrayFormat ?? "repeat", o = r.preserveUnrelated ?? !0, s = r.includeOperators ?? "changed", c = r.resetPageKeys ?? _t, l = o ? yt(n) : {}, u = new Map(e.map((e) => [e.key, e]));
|
|
1878
1873
|
for (let t of e) delete l[t.key], delete l[`${t.key}${i}`];
|
|
1879
1874
|
for (let e of c) delete l[e];
|
|
1880
1875
|
for (let e of t) {
|
|
1881
1876
|
let t = u.get(e.key);
|
|
1882
1877
|
if (!t) continue;
|
|
1883
|
-
let n =
|
|
1878
|
+
let n = Ct(t, e.value);
|
|
1884
1879
|
if (n.length === 0) continue;
|
|
1885
1880
|
l[e.key] = a === "comma" ? [n.join(",")] : n;
|
|
1886
|
-
let r =
|
|
1887
|
-
|
|
1881
|
+
let r = wt(t);
|
|
1882
|
+
Et(s, e.operator, r) && (l[`${e.key}${i}`] = [e.operator]);
|
|
1888
1883
|
}
|
|
1889
|
-
return
|
|
1884
|
+
return bt(l);
|
|
1890
1885
|
}
|
|
1891
|
-
function
|
|
1892
|
-
let r = n.preserveUnrelated ?? !0, i = n.resetPageKeys ??
|
|
1886
|
+
function At(e, t, n = {}) {
|
|
1887
|
+
let r = n.preserveUnrelated ?? !0, i = n.resetPageKeys ?? _t, a = r ? yt(e) : {}, o = yt(t);
|
|
1893
1888
|
for (let e of i) delete a[e];
|
|
1894
1889
|
for (let [e, t] of Object.entries(o)) t.length === 0 ? delete a[e] : a[e] = t;
|
|
1895
|
-
return
|
|
1890
|
+
return bt(a);
|
|
1896
1891
|
}
|
|
1897
1892
|
//#endregion
|
|
1898
1893
|
//#region src/components/features/filters/facets/select-facet.tsx
|
|
1899
|
-
function
|
|
1900
|
-
let { strings:
|
|
1901
|
-
e.multiple ?
|
|
1902
|
-
},
|
|
1894
|
+
function jt({ filter: e, value: n, onValueChange: a, className: o }) {
|
|
1895
|
+
let { defaultScale: c } = t(), l = O(void 0, c), { strings: u } = Q(), [d, f] = G(!1), [p, m] = G(""), h = n.length > 0, g = e.options, _ = (t) => {
|
|
1896
|
+
e.multiple ? n.includes(t) ? a(n.filter((e) => e !== t)) : a([...n, t]) : (a([t]), e.closeOnSelect !== !1 && f(!1));
|
|
1897
|
+
}, v = (e) => g?.find((t) => t.value === e)?.label ?? e, y = U(() => (g ?? []).map((e) => ({
|
|
1903
1898
|
value: e.value,
|
|
1904
1899
|
label: e.label,
|
|
1905
1900
|
description: e.description,
|
|
1906
1901
|
icon: e.icon,
|
|
1907
|
-
selected:
|
|
1902
|
+
selected: n.includes(e.value),
|
|
1908
1903
|
disabled: e.disabled
|
|
1909
|
-
})), [
|
|
1910
|
-
return /* @__PURE__ */
|
|
1911
|
-
className:
|
|
1912
|
-
children: /* @__PURE__ */
|
|
1913
|
-
open:
|
|
1914
|
-
onOpenChange:
|
|
1904
|
+
})), [g, n]), b = Y(u.searchPlaceholder, { filterLabel: e.label.toLowerCase() });
|
|
1905
|
+
return /* @__PURE__ */ K("div", {
|
|
1906
|
+
className: r("select-facet--component", "relative", o),
|
|
1907
|
+
children: /* @__PURE__ */ K(R, {
|
|
1908
|
+
open: d,
|
|
1909
|
+
onOpenChange: f,
|
|
1915
1910
|
search: !0,
|
|
1916
|
-
searchValue:
|
|
1917
|
-
onSearchChange:
|
|
1911
|
+
searchValue: p,
|
|
1912
|
+
onSearchChange: m,
|
|
1918
1913
|
strings: {
|
|
1919
|
-
searchPlaceholder:
|
|
1920
|
-
empty:
|
|
1914
|
+
searchPlaceholder: b,
|
|
1915
|
+
empty: u.noOptionsFound
|
|
1921
1916
|
},
|
|
1922
1917
|
contentClassName: "w-(--anchor-width) min-w-56",
|
|
1923
|
-
trigger: /* @__PURE__ */
|
|
1918
|
+
trigger: /* @__PURE__ */ q(s, {
|
|
1924
1919
|
tone: "secondary",
|
|
1925
1920
|
buttonStyle: "outline",
|
|
1926
|
-
size:
|
|
1921
|
+
size: l,
|
|
1927
1922
|
role: "combobox",
|
|
1928
|
-
"aria-expanded":
|
|
1929
|
-
className:
|
|
1930
|
-
children: [
|
|
1923
|
+
"aria-expanded": d,
|
|
1924
|
+
className: D(l),
|
|
1925
|
+
children: [h ? n.length === 1 ? /* @__PURE__ */ K(i, {
|
|
1931
1926
|
tag: "span",
|
|
1932
1927
|
weight: "semibold",
|
|
1933
1928
|
className: "truncate",
|
|
1934
|
-
children:
|
|
1935
|
-
}) : /* @__PURE__ */
|
|
1929
|
+
children: v(n[0])
|
|
1930
|
+
}) : /* @__PURE__ */ K(i, {
|
|
1936
1931
|
tag: "span",
|
|
1937
1932
|
weight: "semibold",
|
|
1938
|
-
children: Y(
|
|
1939
|
-
count:
|
|
1940
|
-
filterLabel: (
|
|
1933
|
+
children: Y(u.selected, {
|
|
1934
|
+
count: n.length,
|
|
1935
|
+
filterLabel: (n.length > 1 ? e.pluralLabel : e.label) ?? e.label
|
|
1941
1936
|
})
|
|
1942
|
-
}) : /* @__PURE__ */
|
|
1937
|
+
}) : /* @__PURE__ */ K(i, {
|
|
1943
1938
|
tag: "span",
|
|
1944
1939
|
type: "secondary",
|
|
1945
|
-
children: e.placeholder ??
|
|
1946
|
-
}), /* @__PURE__ */
|
|
1940
|
+
children: e.placeholder ?? u.select
|
|
1941
|
+
}), /* @__PURE__ */ K(he, { className: "ml-control-gap-small size-icon-sm shrink-0 opacity-50" })]
|
|
1947
1942
|
}),
|
|
1948
|
-
items:
|
|
1949
|
-
onSelect: (e) =>
|
|
1943
|
+
items: y,
|
|
1944
|
+
onSelect: (e) => _(e.value)
|
|
1950
1945
|
})
|
|
1951
1946
|
});
|
|
1952
1947
|
}
|
|
1953
1948
|
//#endregion
|
|
1954
1949
|
//#region src/components/features/filters/facets/async-select-facet.tsx
|
|
1955
|
-
function
|
|
1956
|
-
let { strings:
|
|
1950
|
+
function Mt({ filter: e, value: n, onValueChange: a, className: o }) {
|
|
1951
|
+
let { defaultScale: c } = t(), f = O(void 0, c), { strings: p, cacheAsyncOptions: m, getAsyncOptionLabel: h, reportError: g } = Q(), [_, v] = G(!1), [y, T] = G(""), k = U(() => /* @__PURE__ */ new Map(), [
|
|
1957
1952
|
e.key,
|
|
1958
1953
|
e.asyncConfig?.fetcher,
|
|
1959
1954
|
e.asyncConfig?.mapToOption
|
|
1960
|
-
]), { options:
|
|
1961
|
-
|
|
1962
|
-
if (
|
|
1963
|
-
for (let e of
|
|
1964
|
-
|
|
1955
|
+
]), { options: A, isLoading: j, isFetching: M, isError: P, refetch: I, isBelowMinQuery: te, minQueryLength: L } = qe(e, y, _, { onError: g });
|
|
1956
|
+
H(() => {
|
|
1957
|
+
if (A.length !== 0) {
|
|
1958
|
+
for (let e of A) k.set(e.value, e);
|
|
1959
|
+
m(e.key, A);
|
|
1965
1960
|
}
|
|
1966
1961
|
}, [
|
|
1967
|
-
|
|
1962
|
+
m,
|
|
1968
1963
|
e.key,
|
|
1969
|
-
|
|
1970
|
-
|
|
1964
|
+
k,
|
|
1965
|
+
A
|
|
1971
1966
|
]);
|
|
1972
|
-
let
|
|
1973
|
-
let t = new Set(
|
|
1974
|
-
for (let t of
|
|
1975
|
-
let n =
|
|
1976
|
-
if (n)
|
|
1967
|
+
let ne = e.multiple !== !1, R = e.maxSelected, z = U(() => e.options ?? [], [e.options]), re = U(() => {
|
|
1968
|
+
let t = new Set(n), r = new Set([...z, ...A].map((e) => e.value)), i = [];
|
|
1969
|
+
for (let t of n) if (!r.has(t)) {
|
|
1970
|
+
let n = k.get(t);
|
|
1971
|
+
if (n) i.push(n);
|
|
1977
1972
|
else {
|
|
1978
|
-
let n =
|
|
1973
|
+
let n = z.find((e) => e.value === t);
|
|
1979
1974
|
if (n) {
|
|
1980
|
-
|
|
1975
|
+
i.push(n);
|
|
1981
1976
|
continue;
|
|
1982
1977
|
}
|
|
1983
|
-
let
|
|
1984
|
-
|
|
1978
|
+
let r = h(e.key, t);
|
|
1979
|
+
r && i.push({
|
|
1985
1980
|
value: t,
|
|
1986
|
-
label:
|
|
1981
|
+
label: r,
|
|
1987
1982
|
icon: e.icon
|
|
1988
1983
|
});
|
|
1989
1984
|
}
|
|
1990
1985
|
}
|
|
1991
1986
|
return [
|
|
1992
|
-
...
|
|
1993
|
-
...
|
|
1994
|
-
...
|
|
1987
|
+
...i,
|
|
1988
|
+
...z,
|
|
1989
|
+
...A
|
|
1995
1990
|
].sort((e, n) => +!t.has(e.value) - !t.has(n.value));
|
|
1996
1991
|
}, [
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
1992
|
+
z,
|
|
1993
|
+
A,
|
|
1994
|
+
n,
|
|
2000
1995
|
e.key,
|
|
2001
1996
|
e.icon,
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
]),
|
|
2005
|
-
if (
|
|
2006
|
-
if (
|
|
1997
|
+
k,
|
|
1998
|
+
h
|
|
1999
|
+
]), ie = (t) => {
|
|
2000
|
+
if (ne) {
|
|
2001
|
+
if (n.includes(t)) a(n.filter((e) => e !== t));
|
|
2007
2002
|
else {
|
|
2008
|
-
if (
|
|
2009
|
-
a([...
|
|
2003
|
+
if (R && n.length >= R) return;
|
|
2004
|
+
a([...n, t]);
|
|
2010
2005
|
}
|
|
2011
|
-
} else a([t]), e.closeOnSelect !== !1 &&
|
|
2012
|
-
},
|
|
2013
|
-
let n =
|
|
2006
|
+
} else a([t]), e.closeOnSelect !== !1 && v(!1);
|
|
2007
|
+
}, ae = (t) => {
|
|
2008
|
+
let n = A.find((e) => e.value === t);
|
|
2014
2009
|
if (n) return n.label;
|
|
2015
|
-
let r =
|
|
2010
|
+
let r = z.find((e) => e.value === t);
|
|
2016
2011
|
if (r) return r.label;
|
|
2017
|
-
let i =
|
|
2018
|
-
return i ? i.label :
|
|
2019
|
-
},
|
|
2012
|
+
let i = k.get(t);
|
|
2013
|
+
return i ? i.label : h(e.key, t) ?? t;
|
|
2014
|
+
}, oe = n.length > 0, B = U(() => j || M ? /* @__PURE__ */ K(u, {
|
|
2020
2015
|
className: "async-select-facet--component",
|
|
2021
|
-
label:
|
|
2022
|
-
}) :
|
|
2016
|
+
label: p.searching
|
|
2017
|
+
}) : P ? /* @__PURE__ */ K(d, {
|
|
2023
2018
|
variant: "inline",
|
|
2024
|
-
title:
|
|
2025
|
-
action: /* @__PURE__ */
|
|
2019
|
+
title: p.fetchError,
|
|
2020
|
+
action: /* @__PURE__ */ K(s, {
|
|
2026
2021
|
tone: "secondary",
|
|
2027
2022
|
buttonStyle: "outline",
|
|
2028
2023
|
size: "sm",
|
|
2029
2024
|
onClick: (e) => {
|
|
2030
|
-
e.stopPropagation(),
|
|
2025
|
+
e.stopPropagation(), I();
|
|
2031
2026
|
},
|
|
2032
|
-
children:
|
|
2027
|
+
children: p.retryFetch
|
|
2033
2028
|
})
|
|
2034
|
-
}) :
|
|
2029
|
+
}) : te ? /* @__PURE__ */ K("div", {
|
|
2035
2030
|
className: "text-muted-foreground flex items-center justify-center py-space-xl",
|
|
2036
|
-
children: /* @__PURE__ */
|
|
2031
|
+
children: /* @__PURE__ */ K(i, {
|
|
2037
2032
|
tag: "span",
|
|
2038
2033
|
size: "xs",
|
|
2039
2034
|
type: "secondary",
|
|
2040
|
-
children: Y(
|
|
2035
|
+
children: Y(p.minQueryHint, { min: L })
|
|
2041
2036
|
})
|
|
2042
|
-
}) : /* @__PURE__ */
|
|
2037
|
+
}) : /* @__PURE__ */ K(i, {
|
|
2043
2038
|
tag: "span",
|
|
2044
2039
|
type: "secondary",
|
|
2045
|
-
children:
|
|
2040
|
+
children: p.noOptionsFound
|
|
2046
2041
|
}), [
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
A,
|
|
2050
|
-
N,
|
|
2042
|
+
j,
|
|
2043
|
+
M,
|
|
2051
2044
|
P,
|
|
2052
|
-
|
|
2053
|
-
|
|
2045
|
+
te,
|
|
2046
|
+
L,
|
|
2047
|
+
p,
|
|
2048
|
+
I
|
|
2054
2049
|
]);
|
|
2055
|
-
return /* @__PURE__ */
|
|
2056
|
-
className:
|
|
2057
|
-
children: /* @__PURE__ */
|
|
2058
|
-
open:
|
|
2050
|
+
return /* @__PURE__ */ K("div", {
|
|
2051
|
+
className: r("async-select-facet--component relative", o),
|
|
2052
|
+
children: /* @__PURE__ */ q(F, {
|
|
2053
|
+
open: _,
|
|
2059
2054
|
onOpenChange: (e) => {
|
|
2060
|
-
|
|
2055
|
+
v(e), e || T("");
|
|
2061
2056
|
},
|
|
2062
|
-
children: [/* @__PURE__ */
|
|
2057
|
+
children: [/* @__PURE__ */ K(N, { render: /* @__PURE__ */ q(s, {
|
|
2063
2058
|
tone: "secondary",
|
|
2064
2059
|
buttonStyle: "outline",
|
|
2065
|
-
size:
|
|
2060
|
+
size: f,
|
|
2066
2061
|
role: "combobox",
|
|
2067
|
-
"aria-expanded":
|
|
2068
|
-
className:
|
|
2069
|
-
children: [
|
|
2062
|
+
"aria-expanded": _,
|
|
2063
|
+
className: D(f),
|
|
2064
|
+
children: [oe ? n.length === 1 ? /* @__PURE__ */ K(i, {
|
|
2070
2065
|
tag: "span",
|
|
2071
2066
|
weight: "semibold",
|
|
2072
2067
|
className: "truncate",
|
|
2073
|
-
children:
|
|
2074
|
-
}) : /* @__PURE__ */
|
|
2068
|
+
children: ae(n[0])
|
|
2069
|
+
}) : /* @__PURE__ */ K(i, {
|
|
2075
2070
|
tag: "span",
|
|
2076
2071
|
weight: "semibold",
|
|
2077
|
-
children: Y(
|
|
2078
|
-
count:
|
|
2079
|
-
filterLabel: (
|
|
2072
|
+
children: Y(p.selected, {
|
|
2073
|
+
count: n.length,
|
|
2074
|
+
filterLabel: (n.length > 1 ? e.pluralLabel : e.label) ?? e.label
|
|
2080
2075
|
})
|
|
2081
|
-
}) : /* @__PURE__ */
|
|
2076
|
+
}) : /* @__PURE__ */ K(i, {
|
|
2082
2077
|
tag: "span",
|
|
2083
2078
|
type: "secondary",
|
|
2084
|
-
children: e.placeholder ??
|
|
2085
|
-
}), /* @__PURE__ */
|
|
2086
|
-
}) }), /* @__PURE__ */
|
|
2079
|
+
children: e.placeholder ?? p.select
|
|
2080
|
+
}), /* @__PURE__ */ K(he, { className: "ml-control-gap-small size-icon-sm shrink-0 opacity-50" })]
|
|
2081
|
+
}) }), /* @__PURE__ */ K(ee, {
|
|
2087
2082
|
type: "menu",
|
|
2088
2083
|
inset: "flush",
|
|
2089
2084
|
className: "w-full min-w-70 gap-0",
|
|
2090
|
-
children: /* @__PURE__ */
|
|
2085
|
+
children: /* @__PURE__ */ q(E, {
|
|
2091
2086
|
shouldFilter: !1,
|
|
2092
2087
|
inset: "flush",
|
|
2093
2088
|
className: "rounded-none",
|
|
2094
|
-
children: [/* @__PURE__ */
|
|
2095
|
-
placeholder: Y(
|
|
2096
|
-
value:
|
|
2097
|
-
onValueChange:
|
|
2098
|
-
}), /* @__PURE__ */
|
|
2089
|
+
children: [/* @__PURE__ */ K(x, {
|
|
2090
|
+
placeholder: Y(p.searchPlaceholder, { filterLabel: e.label }),
|
|
2091
|
+
value: y,
|
|
2092
|
+
onValueChange: T
|
|
2093
|
+
}), /* @__PURE__ */ K(C, { children: re.length === 0 ? /* @__PURE__ */ K(S, { children: B }) : /* @__PURE__ */ q(w, { children: [!(!M || j) && /* @__PURE__ */ q(l, {
|
|
2099
2094
|
direction: "horizontal",
|
|
2100
2095
|
gap: "sm",
|
|
2101
2096
|
wrap: !1,
|
|
2102
2097
|
className: "px-control-sm py-space-xs",
|
|
2103
|
-
children: [/* @__PURE__ */
|
|
2098
|
+
children: [/* @__PURE__ */ K(_e, { className: "text-muted-foreground size-icon-sm animate-spin" }), /* @__PURE__ */ K(i, {
|
|
2104
2099
|
tag: "span",
|
|
2105
2100
|
size: "xs",
|
|
2106
2101
|
type: "secondary",
|
|
2107
|
-
children:
|
|
2102
|
+
children: p.searching
|
|
2108
2103
|
})]
|
|
2109
|
-
}),
|
|
2104
|
+
}), re.map((e) => /* @__PURE__ */ q(b, {
|
|
2110
2105
|
value: e.value,
|
|
2111
|
-
onSelect: () =>
|
|
2112
|
-
disabled: e.disabled || !!
|
|
2106
|
+
onSelect: () => ie(e.value),
|
|
2107
|
+
disabled: e.disabled || !!R && n.length >= R && !n.includes(e.value),
|
|
2113
2108
|
children: [
|
|
2114
|
-
/* @__PURE__ */
|
|
2115
|
-
!!e.icon && /* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ K(pe, { className: r("mr-control-gap size-icon-sm", n.includes(e.value) ? "opacity-100" : "opacity-0") }),
|
|
2110
|
+
!!e.icon && /* @__PURE__ */ K("span", {
|
|
2116
2111
|
className: "mr-1.5",
|
|
2117
2112
|
children: e.icon
|
|
2118
2113
|
}),
|
|
2119
|
-
/* @__PURE__ */
|
|
2114
|
+
/* @__PURE__ */ K(i, {
|
|
2120
2115
|
tag: "span",
|
|
2121
2116
|
children: e.label
|
|
2122
2117
|
})
|
|
@@ -2129,48 +2124,48 @@ function Ct({ filter: e, value: i, onValueChange: a, className: o }) {
|
|
|
2129
2124
|
}
|
|
2130
2125
|
//#endregion
|
|
2131
2126
|
//#region src/components/features/filters/facets/range-facet.tsx
|
|
2132
|
-
function
|
|
2133
|
-
let { strings:
|
|
2134
|
-
(e.min !==
|
|
2127
|
+
function Nt({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
2128
|
+
let { strings: o } = Q(), [s, u] = G(t.min?.toString() ?? ""), [d, f] = G(t.max?.toString() ?? ""), p = ue(), m = z((e) => {
|
|
2129
|
+
(e.min !== t.min || e.max !== t.max) && n(e);
|
|
2135
2130
|
}, e.delay ?? 300);
|
|
2136
|
-
return
|
|
2137
|
-
min:
|
|
2131
|
+
return H(() => (m({
|
|
2132
|
+
min: s ? Number(s) : void 0,
|
|
2138
2133
|
max: d ? Number(d) : void 0
|
|
2139
2134
|
}), m.cancel), [
|
|
2140
|
-
|
|
2135
|
+
s,
|
|
2141
2136
|
d,
|
|
2142
2137
|
m
|
|
2143
|
-
]), /* @__PURE__ */
|
|
2138
|
+
]), /* @__PURE__ */ K(l, {
|
|
2144
2139
|
gap: "md",
|
|
2145
|
-
className:
|
|
2146
|
-
children: /* @__PURE__ */
|
|
2140
|
+
className: r("range-facet--component", i),
|
|
2141
|
+
children: /* @__PURE__ */ q(c, {
|
|
2147
2142
|
columns: {
|
|
2148
2143
|
base: 1,
|
|
2149
2144
|
sm: 2
|
|
2150
2145
|
},
|
|
2151
2146
|
gap: "md",
|
|
2152
|
-
children: [/* @__PURE__ */
|
|
2147
|
+
children: [/* @__PURE__ */ q(l, {
|
|
2153
2148
|
gap: "xs",
|
|
2154
|
-
children: [/* @__PURE__ */
|
|
2149
|
+
children: [/* @__PURE__ */ K(a, {
|
|
2155
2150
|
htmlFor: `${p}-min`,
|
|
2156
|
-
children:
|
|
2157
|
-
}), /* @__PURE__ */
|
|
2151
|
+
children: o.min
|
|
2152
|
+
}), /* @__PURE__ */ K(A, {
|
|
2158
2153
|
id: `${p}-min`,
|
|
2159
2154
|
type: "text",
|
|
2160
|
-
value:
|
|
2155
|
+
value: s,
|
|
2161
2156
|
onChange: (e) => {
|
|
2162
2157
|
let t = e.target.value;
|
|
2163
2158
|
(t === "" || /^\d*\.?\d*$/.test(t)) && u(t);
|
|
2164
2159
|
},
|
|
2165
|
-
placeholder:
|
|
2160
|
+
placeholder: o.min,
|
|
2166
2161
|
className: "w-full"
|
|
2167
2162
|
})]
|
|
2168
|
-
}), /* @__PURE__ */
|
|
2163
|
+
}), /* @__PURE__ */ q(l, {
|
|
2169
2164
|
gap: "xs",
|
|
2170
|
-
children: [/* @__PURE__ */
|
|
2165
|
+
children: [/* @__PURE__ */ K(a, {
|
|
2171
2166
|
htmlFor: `${p}-max`,
|
|
2172
|
-
children:
|
|
2173
|
-
}), /* @__PURE__ */
|
|
2167
|
+
children: o.max
|
|
2168
|
+
}), /* @__PURE__ */ K(A, {
|
|
2174
2169
|
id: `${p}-max`,
|
|
2175
2170
|
type: "text",
|
|
2176
2171
|
value: d,
|
|
@@ -2178,7 +2173,7 @@ function wt({ filter: e, value: n, onValueChange: r, className: a }) {
|
|
|
2178
2173
|
let t = e.target.value;
|
|
2179
2174
|
(t === "" || /^\d*\.?\d*$/.test(t)) && f(t);
|
|
2180
2175
|
},
|
|
2181
|
-
placeholder:
|
|
2176
|
+
placeholder: o.max,
|
|
2182
2177
|
className: "w-full"
|
|
2183
2178
|
})]
|
|
2184
2179
|
})]
|
|
@@ -2187,17 +2182,17 @@ function wt({ filter: e, value: n, onValueChange: r, className: a }) {
|
|
|
2187
2182
|
}
|
|
2188
2183
|
//#endregion
|
|
2189
2184
|
//#region src/components/features/filters/validators.ts
|
|
2190
|
-
function
|
|
2185
|
+
function Pt(e) {
|
|
2191
2186
|
return (t) => {
|
|
2192
2187
|
if (t == null || typeof t == "string" && t.length === 0) return !0;
|
|
2193
2188
|
let n = e.safeParse(t);
|
|
2194
2189
|
return n.success ? !0 : n.error?.issues?.[0]?.message ?? n.error?.message ?? !1;
|
|
2195
2190
|
};
|
|
2196
2191
|
}
|
|
2197
|
-
function
|
|
2192
|
+
function Ft(e, t) {
|
|
2198
2193
|
return (n) => e(n) ? !0 : t;
|
|
2199
2194
|
}
|
|
2200
2195
|
//#endregion
|
|
2201
|
-
export {
|
|
2196
|
+
export { je as A, Ie as C, ke as D, Ae as E, Te as F, Ce as I, we as L, Ee as M, Z as N, Me as O, X as P, Y as R, Le as S, Q as T, $ as _, jt as a, Ge as b, kt as c, dt as d, ct as f, rt as g, at as h, Mt as i, De as j, Oe as k, ht as l, ot as m, Pt as n, At as o, st as p, Nt as r, Ot as s, Ft as t, ft as u, Xe as v, Fe as w, Re as x, qe as y };
|
|
2202
2197
|
|
|
2203
|
-
//# sourceMappingURL=filters-
|
|
2198
|
+
//# sourceMappingURL=filters-D6FF8L6s.js.map
|