themelia-react-ui 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +417 -0
- package/README.md +67 -16
- package/dist/{accordion-B-5Focs8.js → accordion-CQXVcd7Q.js} +15 -15
- package/dist/accordion-CQXVcd7Q.js.map +1 -0
- package/dist/action-menu-BTpyPWJ2.js +264 -0
- package/dist/action-menu-BTpyPWJ2.js.map +1 -0
- package/dist/affordance-geometry.generated-CCIXb2A1.js +68 -0
- package/dist/affordance-geometry.generated-CCIXb2A1.js.map +1 -0
- package/dist/{ai-artifact-B5tPpXnS.js → ai-artifact-2PQ2fItc.js} +206 -215
- package/dist/ai-artifact-2PQ2fItc.js.map +1 -0
- package/dist/{app-shell-at8Kt4l_.js → app-shell-BE_j8-AT.js} +11 -10
- package/dist/app-shell-BE_j8-AT.js.map +1 -0
- package/dist/{attachment-BO2R47wn.js → attachment-q69dlt5Y.js} +14 -14
- package/dist/attachment-q69dlt5Y.js.map +1 -0
- package/dist/auth-M3vGMgDR.js +723 -0
- package/dist/auth-M3vGMgDR.js.map +1 -0
- package/dist/{avatar-Bpzty83c.js → avatar-djdaaQ_s.js} +15 -13
- package/dist/avatar-djdaaQ_s.js.map +1 -0
- package/dist/{badge-BZXZT9wd.js → badge-0tATj-tW.js} +9 -9
- package/dist/badge-0tATj-tW.js.map +1 -0
- 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 +33 -35
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +246 -222
- package/dist/base/cascader.js.map +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +2 -2
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +1 -1
- package/dist/base/command.js +1 -1
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +3 -3
- package/dist/base/display.js +7 -7
- package/dist/base/feedback.js +4 -4
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +94 -92
- package/dist/base/inline-edit.js.map +1 -1
- 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 +7 -4
- package/dist/base/qr-code.js.map +1 -1
- package/dist/base/repeaters.js +53 -53
- 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 +84 -82
- 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 +7 -7
- 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 +228 -219
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +182 -212
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +665 -620
- 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 +1439 -1553
- 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 +88 -97
- package/dist/blocks/planning.js.map +1 -1
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-DdQ_I5ra.js → breadcrumbs-BG_FfMK4.js} +10 -9
- package/dist/breadcrumbs-BG_FfMK4.js.map +1 -0
- package/dist/button-BS3KDg00.js +674 -0
- package/dist/button-BS3KDg00.js.map +1 -0
- package/dist/{button-BS6l5JUw.js → button-R9CCoH7A.js} +3 -3
- package/dist/button-R9CCoH7A.js.map +1 -0
- package/dist/buttons-DS0ZIwJ_.js +99 -0
- package/dist/buttons-DS0ZIwJ_.js.map +1 -0
- package/dist/{cards-Cum56XOF.js → cards-QoJ4syG9.js} +12 -12
- package/dist/{cards-Cum56XOF.js.map → cards-QoJ4syG9.js.map} +1 -1
- package/dist/chart-DwYRKKc-.js +152 -0
- package/dist/chart-DwYRKKc-.js.map +1 -0
- package/dist/checkbox-B7ygNTYp.js +35 -0
- package/dist/checkbox-B7ygNTYp.js.map +1 -0
- package/dist/choice-inputs-DrJ17tpL.js +752 -0
- package/dist/choice-inputs-DrJ17tpL.js.map +1 -0
- package/dist/{code-block-xHKbAJDj.js → code-block-CD0B7M93.js} +27 -27
- package/dist/code-block-CD0B7M93.js.map +1 -0
- package/dist/{collapsible-DsnktFNv.js → collapsible-oMUGM4tr.js} +3 -3
- package/dist/{collapsible-DsnktFNv.js.map → collapsible-oMUGM4tr.js.map} +1 -1
- package/dist/{collection-content-C4fthJV_.js → collection-content-Ys-OZOkY.js} +3 -3
- package/dist/{collection-content-C4fthJV_.js.map → collection-content-Ys-OZOkY.js.map} +1 -1
- package/dist/combobox-6dvVny2q.js +272 -0
- package/dist/combobox-6dvVny2q.js.map +1 -0
- package/dist/combobox-CB7039j7.js +865 -0
- package/dist/combobox-CB7039j7.js.map +1 -0
- package/dist/{command-C0xe7u9B.js → command-kPMPjIxJ.js} +35 -31
- package/dist/command-kPMPjIxJ.js.map +1 -0
- package/dist/{comments-DviPLnwy.js → comments-You0Bzbr.js} +434 -409
- package/dist/comments-You0Bzbr.js.map +1 -0
- package/dist/components/base/accordion/accordion-variants.d.ts +3 -3
- package/dist/components/base/action-menu/action-menu.d.ts +7 -2
- package/dist/components/base/avatar/stacked-avatars.d.ts +5 -4
- package/dist/components/base/badge/badge.d.ts +1 -1
- package/dist/components/base/badge/badge.recipes.d.ts +4 -4
- package/dist/components/base/buttons/base-button.d.ts +7 -0
- package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
- package/dist/components/base/buttons/button.recipes.d.ts +10 -19
- package/dist/components/base/buttons/button.variants.d.ts +1 -0
- package/dist/components/base/buttons/loader-button.d.ts +3 -1
- package/dist/components/base/buttons/text-button.d.ts +2 -2
- 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 +1 -1
- package/dist/components/base/carousel/carousel.d.ts +3 -1
- package/dist/components/base/chart/chart.d.ts +7 -7
- package/dist/components/base/choice-inputs/checkbox.d.ts +6 -7
- package/dist/components/base/choice-inputs/choice-types.d.ts +10 -1
- package/dist/components/base/choice-inputs/pill-radio-group.d.ts +9 -0
- package/dist/components/base/choice-inputs/select-popup.d.ts +9 -1
- package/dist/components/base/choice-inputs/switch-card.d.ts +1 -1
- package/dist/components/base/date-pickers/date-picker-field.d.ts +23 -0
- package/dist/components/base/date-pickers/date-picker.recipes.d.ts +5 -18
- package/dist/components/base/date-pickers/datepicker.types.d.ts +16 -3
- package/dist/components/base/display/alert-dialog.d.ts +8 -2
- package/dist/components/base/display/content-block.d.ts +4 -2
- package/dist/components/base/display/date-block.d.ts +1 -1
- package/dist/components/base/display/dialog.d.ts +12 -5
- package/dist/components/base/display/surface-title.d.ts +6 -1
- package/dist/components/base/feedback/alert.d.ts +1 -1
- package/dist/components/base/feedback/state-display.d.ts +5 -4
- package/dist/components/base/forms/form-field.d.ts +1 -0
- package/dist/components/base/forms/form-sizing.d.ts +35 -3
- package/dist/components/base/forms/workflow.d.ts +2 -0
- package/dist/components/base/forms-numeric/coordinates-input.d.ts +3 -0
- package/dist/components/base/forms-numeric/rounding-mode-select.d.ts +4 -1
- package/dist/components/base/navigation/dropdown-menu.d.ts +2 -2
- package/dist/components/base/navigation/language-switcher.d.ts +4 -1
- package/dist/components/base/navigation/overflow-tab-bar.d.ts +7 -0
- package/dist/components/base/navigation/page-header/page-header.d.ts +4 -1
- 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/qr-code/qr-code.d.ts +2 -0
- package/dist/components/base/sheet/index.d.ts +29 -1
- package/dist/components/base/sheet/sheet.d.ts +14 -5
- package/dist/components/base/spinner/spinner.d.ts +3 -2
- package/dist/components/base/structure/structure.types.d.ts +1 -1
- 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-group.d.ts +2 -2
- package/dist/components/base/text-inputs/input-trailing-action.d.ts +3 -0
- package/dist/components/base/upload/upload.recipes.d.ts +11 -0
- package/dist/components/base/value-inputs/date-time-input.d.ts +4 -2
- package/dist/components/base/value-inputs/tags-input.d.ts +2 -0
- package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +1 -1
- package/dist/components/blocks/analytics/format-metric-value.d.ts +11 -1
- package/dist/components/blocks/analytics/index.d.ts +1 -1
- package/dist/components/blocks/analytics/types.d.ts +1 -1
- package/dist/components/blocks/analytics/use-metric-format-options.d.ts +3 -0
- package/dist/components/blocks/collaboration/message/message.recipes.d.ts +12 -0
- package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
- package/dist/components/blocks/commerce/address-card/types.d.ts +3 -1
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +4 -0
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +2 -2
- package/dist/components/blocks/commerce/discount-stack/types.d.ts +1 -1
- package/dist/components/blocks/commerce/inventory-section/types.d.ts +4 -1
- package/dist/components/blocks/commerce/loyalty-points/types.d.ts +1 -1
- package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
- package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +1 -1
- package/dist/components/blocks/commerce/payment-method/types.d.ts +3 -1
- package/dist/components/blocks/commerce/seo-listing/seo-listing-card.d.ts +1 -1
- package/dist/components/blocks/commerce/seo-listing/types.d.ts +3 -1
- package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -1
- package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +4 -1
- 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/data-display/inline-stat/inline-stat.d.ts +4 -1
- 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/global-search/partials/global-search-idle-state.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/alert-dialog.d.ts +1 -1
- package/dist/components/features/overlays/drawer.d.ts +1 -1
- package/dist/components/features/overlays/hooks/use-overlay-actions.d.ts +2 -2
- package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +11 -4
- package/dist/components/features/overlays/hooks/use-pending-overlay-focus.d.ts +2 -0
- package/dist/components/features/overlays/overlay-tone-icon.d.ts +37 -0
- package/dist/components/features/overlays/overlays.types.d.ts +46 -22
- package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
- package/dist/components/features/products/partials/index.d.ts +1 -1
- package/dist/components/features/products/partials/product-metric-tile.d.ts +6 -0
- package/dist/components/features/products/partials/product-tone.d.ts +11 -1
- package/dist/components/features/products/products.types.d.ts +2 -1
- 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/partials/cell-renderers.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/index.d.ts +1 -1
- package/dist/components/layout/page/page.d.ts +0 -1
- package/dist/components/layout/page/page.types.d.ts +62 -6
- package/dist/components/layout/page/partials/page-header-commands.d.ts +13 -0
- package/dist/components/layout/page/partials/page-header.d.ts +1 -1
- 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/primitives/date.d.ts +16 -3
- package/dist/components/primitives/dimensions.d.ts +6 -0
- package/dist/components/primitives/duration.d.ts +6 -0
- package/dist/components/primitives/file-size.d.ts +6 -0
- package/dist/components/primitives/index.d.ts +1 -1
- package/dist/components/primitives/initials.d.ts +11 -2
- package/dist/components/primitives/link.d.ts +7 -0
- package/dist/components/primitives/money.d.ts +29 -7
- package/dist/components/primitives/number.d.ts +17 -0
- package/dist/components/primitives/value-typography.d.ts +54 -0
- package/dist/components/primitives/value.d.ts +31 -6
- package/dist/components/typography/heading.d.ts +13 -2
- package/dist/components/typography/index.d.ts +1 -1
- package/dist/components/typography/label.d.ts +3 -0
- package/dist/components/typography/running-text.d.ts +12 -0
- package/dist/components/typography/text-link.d.ts +23 -1
- package/dist/components/typography/text.d.ts +12 -0
- package/dist/components/typography/text.styles.d.ts +37 -5
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/overlay.recipes.d.ts +15 -2
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/select.d.ts +3 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/switch.d.ts +5 -0
- 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-6s-ucRQQ.js → containers-D_L4mTVb.js} +34 -57
- package/dist/containers-D_L4mTVb.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-DDjTeW_j.js} +6 -6
- package/dist/{copyable-B7SBXJMr.js.map → copyable-DDjTeW_j.js.map} +1 -1
- package/dist/data-display-3xWQUnMA.js +1335 -0
- package/dist/data-display-3xWQUnMA.js.map +1 -0
- package/dist/date-picker-DrDFj8Lo.js +1527 -0
- package/dist/date-picker-DrDFj8Lo.js.map +1 -0
- package/dist/date-pickers-CnFCb0n2.js +174 -0
- package/dist/date-pickers-CnFCb0n2.js.map +1 -0
- package/dist/date-uf3z37Nm.js +144 -0
- package/dist/date-uf3z37Nm.js.map +1 -0
- package/dist/{display-CFM5myut.js → display-DrdvPwF0.js} +25 -25
- package/dist/display-DrdvPwF0.js.map +1 -0
- package/dist/{dropdown-menu-BlnyHr-9.js → dropdown-menu-CURh59jb.js} +22 -15
- package/dist/dropdown-menu-CURh59jb.js.map +1 -0
- package/dist/features/activities.js +177 -163
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +187 -183
- 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 +353 -355
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +346 -354
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +225 -227
- 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 +898 -900
- 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 +1412 -1444
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +51 -49
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +103 -97
- 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 +187 -183
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +7 -7
- package/dist/features/sync.js.map +1 -1
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +508 -503
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/{feedback-DWUkgEjR.js → feedback-C7nR0UtT.js} +30 -31
- package/dist/feedback-C7nR0UtT.js.map +1 -0
- package/dist/field-affordance-recipes-CkOCdE2y.js +46 -0
- package/dist/field-affordance-recipes-CkOCdE2y.js.map +1 -0
- package/dist/{field-state-recipes-CBTRt9Bt.js → field-state-recipes-C-MFBX_8.js} +5 -5
- package/dist/field-state-recipes-C-MFBX_8.js.map +1 -0
- package/dist/{filters-BhsUtsxW.js → filters-Da-gNPsE.js} +760 -765
- package/dist/filters-Da-gNPsE.js.map +1 -0
- package/dist/{form-field-Bn7ZH1rA.js → form-field-VZRULhUK.js} +20 -12
- package/dist/form-field-VZRULhUK.js.map +1 -0
- package/dist/form-sizing-uWP4lzVh.js +126 -0
- package/dist/form-sizing-uWP4lzVh.js.map +1 -0
- package/dist/{forms-B7pzS25o.js → forms-DDeEnXSY.js} +38 -38
- package/dist/forms-DDeEnXSY.js.map +1 -0
- package/dist/forms-numeric-D3CO60IF.js +905 -0
- package/dist/forms-numeric-D3CO60IF.js.map +1 -0
- package/dist/{header-C59QZyxV.js → header-2ycNqGOR.js} +42 -37
- package/dist/header-2ycNqGOR.js.map +1 -0
- package/dist/{hooks-CM1Vp9Pe.js → hooks-DQ5SPwZw.js} +2 -2
- package/dist/{hooks-CM1Vp9Pe.js.map → hooks-DQ5SPwZw.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-DKlaKXoo.js} +4 -4
- package/dist/{icon-badge-Dv0RYQwj.js.map → icon-badge-DKlaKXoo.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/input-BoLm9Hks.js +20 -0
- package/dist/input-BoLm9Hks.js.map +1 -0
- package/dist/input-DhQdBnV3.js +255 -0
- package/dist/input-DhQdBnV3.js.map +1 -0
- package/dist/item-xzh8Df65.js +264 -0
- package/dist/item-xzh8Df65.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 +46 -10
- package/dist/lib/control-group-recipes.d.ts +22 -0
- package/dist/lib/field-affordance-recipes.d.ts +70 -2
- package/dist/lib/field-state-recipes.d.ts +6 -4
- package/dist/lib/format.d.ts +9 -0
- package/dist/lib/money-format.d.ts +30 -0
- package/dist/lib/navigation-row-recipes.d.ts +3 -2
- package/dist/lib/overlay-anatomy-recipes.d.ts +2 -2
- package/dist/lib/surface-recipes.d.ts +13 -8
- package/dist/lib/token-merge.generated.d.ts +144 -2
- package/dist/lib/track-recipes.d.ts +1 -1
- package/dist/lib/ui-provider/provider.d.ts +7 -2
- package/dist/lib/ui-provider/store.d.ts +6 -2
- package/dist/lib/ui-provider/types.d.ts +9 -4
- package/dist/lib/use-prefers-reduced-motion.d.ts +2 -0
- package/dist/lib/utils.js +1 -1
- package/dist/media-gallery-DQUQ0m3O.js +201 -0
- package/dist/media-gallery-DQUQ0m3O.js.map +1 -0
- package/dist/{mentions-B8Ko-fhS.js → mentions-DwnO1hh4.js} +40 -39
- package/dist/{mentions-B8Ko-fhS.js.map → mentions-DwnO1hh4.js.map} +1 -1
- package/dist/message-YfFmbXNP.js +127 -0
- package/dist/message-YfFmbXNP.js.map +1 -0
- package/dist/{navigation-BUIn2Qxx.js → navigation-Cbp5V8gG.js} +27 -28
- package/dist/navigation-Cbp5V8gG.js.map +1 -0
- package/dist/navigation-Cs1npsPm.js +300 -0
- package/dist/navigation-Cs1npsPm.js.map +1 -0
- package/dist/{navigation-row-recipes-GVh11KiT.js → navigation-row-recipes-DlU-4QYO.js} +3 -3
- package/dist/navigation-row-recipes-DlU-4QYO.js.map +1 -0
- package/dist/number-CKRBYmZK.js +352 -0
- package/dist/number-CKRBYmZK.js.map +1 -0
- package/dist/overlay.recipes-CNO2S9V6.js +34 -0
- package/dist/overlay.recipes-CNO2S9V6.js.map +1 -0
- package/dist/overlays-DhZO7N-I.js +994 -0
- package/dist/overlays-DhZO7N-I.js.map +1 -0
- package/dist/page-C6R_8jFt.js +325 -0
- package/dist/page-C6R_8jFt.js.map +1 -0
- package/dist/{page-header-DQRa0jug.js → page-header-hUTzcRZX.js} +12 -12
- package/dist/page-header-hUTzcRZX.js.map +1 -0
- package/dist/{pagination-C29vvt3I.js → pagination-Cm0jqa3I.js} +21 -21
- package/dist/pagination-Cm0jqa3I.js.map +1 -0
- package/dist/{popover-CoLDEg19.js → popover-Dcv_9jxr.js} +23 -22
- package/dist/popover-Dcv_9jxr.js.map +1 -0
- package/dist/{popover-menu-GLIQTJTx.js → popover-menu-DnRFKnHP.js} +6 -6
- package/dist/{popover-menu-GLIQTJTx.js.map → popover-menu-DnRFKnHP.js.map} +1 -1
- package/dist/{popover.recipes-zgBhMlUu.js → popover.recipes-wmbvL8Ah.js} +5 -5
- package/dist/popover.recipes-wmbvL8Ah.js.map +1 -0
- package/dist/primitives-BHrwQXFC.js +379 -0
- package/dist/primitives-BHrwQXFC.js.map +1 -0
- package/dist/primitives.js +5 -5
- package/dist/{progress-BOe8l_FZ.js → progress-Br9WTFya.js} +12 -11
- package/dist/progress-Br9WTFya.js.map +1 -0
- package/dist/{receipt-BM8xsGFy.js → receipt-CV89q1fs.js} +8 -8
- package/dist/{receipt-BM8xsGFy.js.map → receipt-CV89q1fs.js.map} +1 -1
- package/dist/rich-text-editor-CF8QYt5p.js +574 -0
- package/dist/rich-text-editor-CF8QYt5p.js.map +1 -0
- package/dist/{rich-text-editor.recipes-DxvOE0Lp.js → rich-text-editor.recipes-CnrbmTS1.js} +35 -26
- package/dist/rich-text-editor.recipes-CnrbmTS1.js.map +1 -0
- package/dist/{rich-text-B7sBAdDG.js → rich-text-j-FGAeZW.js} +4 -4
- package/dist/{rich-text-B7sBAdDG.js.map → rich-text-j-FGAeZW.js.map} +1 -1
- package/dist/{scroll-area-BheMQ270.js → scroll-area-DRdr16Pt.js} +3 -3
- package/dist/scroll-area-DRdr16Pt.js.map +1 -0
- package/dist/{separator-DO0EbCEm.js → separator-BMEvwnSX.js} +2 -2
- package/dist/{separator-DO0EbCEm.js.map → separator-BMEvwnSX.js.map} +1 -1
- package/dist/{separator-Gk_WXH-l.js → separator-Do5GWDYi.js} +4 -4
- package/dist/separator-Do5GWDYi.js.map +1 -0
- package/dist/services/actions/action-adapters.d.ts +4 -0
- package/dist/services/actions.js +8 -3
- package/dist/services/actions.js.map +1 -1
- package/dist/{settings-BnCyyPOJ.js → settings-DHk0L2MF.js} +20 -19
- package/dist/settings-DHk0L2MF.js.map +1 -0
- package/dist/sheet-DRFNY1_D.js +207 -0
- package/dist/sheet-DRFNY1_D.js.map +1 -0
- package/dist/sidebar-Cb8WzOvE.js +511 -0
- package/dist/sidebar-Cb8WzOvE.js.map +1 -0
- package/dist/{sidebar-DPR7fmqN.js → sidebar-Crc9M9JV.js} +220 -201
- package/dist/sidebar-Crc9M9JV.js.map +1 -0
- package/dist/{skeleton-CmT1ppqb.js → skeleton-DVMXr15h.js} +5 -5
- package/dist/{skeleton-CmT1ppqb.js.map → skeleton-DVMXr15h.js.map} +1 -1
- package/dist/smart-card-Bek-TwUp.js +599 -0
- package/dist/smart-card-Bek-TwUp.js.map +1 -0
- package/dist/{spinner-BY9HbUEh.js → spinner-CmTAbEp0.js} +8 -6
- package/dist/spinner-CmTAbEp0.js.map +1 -0
- package/dist/{structure-MvKVq-oL.js → structure-hzCW-XsV.js} +3 -3
- package/dist/{structure-MvKVq-oL.js.map → structure-hzCW-XsV.js.map} +1 -1
- package/dist/{structure.recipes-Bqhf9oIh.js → structure.recipes-EPz60cU8.js} +37 -19
- package/dist/structure.recipes-EPz60cU8.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/surface-recipes-DOdoBXGm.js +28 -0
- package/dist/surface-recipes-DOdoBXGm.js.map +1 -0
- package/dist/table-D6zKeYQX.js +162 -0
- package/dist/table-D6zKeYQX.js.map +1 -0
- package/dist/table-Dn4XSrSB.js +1444 -0
- package/dist/table-Dn4XSrSB.js.map +1 -0
- package/dist/tabs-Dk8E_knt.js +189 -0
- package/dist/tabs-Dk8E_knt.js.map +1 -0
- package/dist/text-inputs-BFpku0Qd.js +331 -0
- package/dist/text-inputs-BFpku0Qd.js.map +1 -0
- package/dist/{text.styles-BwB7vAF2.js → text.styles-g4He6UIW.js} +26 -15
- package/dist/text.styles-g4He6UIW.js.map +1 -0
- package/dist/theme.css +90 -124
- package/dist/themes/green.css +24 -0
- package/dist/{timelines-B9ICkQcV.js → timelines-CxuAFIc2.js} +97 -104
- package/dist/timelines-CxuAFIc2.js.map +1 -0
- package/dist/track-recipes-CDcKmndW.js +10 -0
- package/dist/track-recipes-CDcKmndW.js.map +1 -0
- package/dist/{tree-BdWSaoFT.js → tree-BotPlyiD.js} +13 -13
- package/dist/{tree-BdWSaoFT.js.map → tree-BotPlyiD.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/typography-CAr3dQhX.js +116 -0
- package/dist/typography-CAr3dQhX.js.map +1 -0
- package/dist/typography.js +2 -2
- package/dist/{ui-provider-CftIB6TY.js → ui-provider-D2_TeLqw.js} +22 -22
- package/dist/ui-provider-D2_TeLqw.js.map +1 -0
- package/dist/ui-provider.js +1 -1
- package/dist/{upload-D8Za5x_c.js → upload-B0WHW7ak.js} +278 -274
- package/dist/upload-B0WHW7ak.js.map +1 -0
- package/dist/{upload-queue-hIIYBLS7.js → upload-queue-BHZ_wBfd.js} +72 -75
- package/dist/upload-queue-BHZ_wBfd.js.map +1 -0
- package/dist/{usage-card-DnmnJ58D.js → usage-card-U0YBLTNT.js} +31 -33
- package/dist/usage-card-U0YBLTNT.js.map +1 -0
- package/dist/utils-Cospvlj1.js +4445 -0
- package/dist/utils-Cospvlj1.js.map +1 -0
- package/dist/value-inputs-CjfzGMsN.js +854 -0
- package/dist/value-inputs-CjfzGMsN.js.map +1 -0
- package/dist/value-typography-Deb3yQZg.js +116 -0
- package/dist/value-typography-Deb3yQZg.js.map +1 -0
- package/dist/{workspace-C1PZmk8L.js → workspace-YoFjXi6i.js} +97 -105
- package/dist/workspace-YoFjXi6i.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +123 -119
- package/docs/consumer-skill/examples/analytics.tsx +34 -0
- package/docs/consumer-skill/examples/app-layout.tsx +42 -14
- package/docs/consumer-skill/examples/detail.tsx +20 -5
- package/docs/consumer-skill/examples/edit.tsx +1 -1
- package/docs/consumer-skill/examples/layout-blocks.tsx +20 -0
- package/docs/consumer-skill/examples/manifest.json +37 -3
- package/docs/consumer-skill/examples/scoped-directory.tsx +2 -2
- 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 +195 -9
- package/docs/consumer-skill/references/design-contract.md +33 -7
- package/docs/consumer-skill/references/discovery.md +80 -5
- package/docs/consumer-skill/references/installation.md +22 -0
- package/docs/consumer-skill/references/integration.md +46 -1
- package/docs/consumer-skill/references/public-api.json +2083 -237
- package/docs/consumer-skill/references/review.md +74 -6
- package/docs/consumer-skill/references/theming.md +59 -8
- package/docs/consumer-skill/references/tokens.json +180 -9
- package/docs/consumer-skill/references/workflows.md +34 -0
- package/docs/consumer-skill/scripts/check-composition.mjs +1 -1
- package/docs/consumer-skill/scripts/composition-policy.mjs +271 -18
- package/docs/consumer-skill/scripts/discovery.mjs +69 -9
- package/docs/consumer-skill/scripts/pin-button-defaults.mjs +95 -0
- package/docs/consumer-skill/scripts/surface-policy.mjs +44 -0
- package/package.json +11 -6
- package/dist/accordion-B-5Focs8.js.map +0 -1
- package/dist/action-menu-Cx3SdfbN.js +0 -265
- package/dist/action-menu-Cx3SdfbN.js.map +0 -1
- package/dist/affordance-geometry.generated-D8Jcfb0G.js +0 -32
- package/dist/affordance-geometry.generated-D8Jcfb0G.js.map +0 -1
- package/dist/ai-artifact-B5tPpXnS.js.map +0 -1
- package/dist/app-shell-at8Kt4l_.js.map +0 -1
- package/dist/attachment-BO2R47wn.js.map +0 -1
- package/dist/auth-OFwWSAap.js +0 -704
- package/dist/auth-OFwWSAap.js.map +0 -1
- package/dist/avatar-Bpzty83c.js.map +0 -1
- package/dist/badge-BZXZT9wd.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/checkbox-BavDRjF7.js +0 -34
- package/dist/checkbox-BavDRjF7.js.map +0 -1
- package/dist/choice-inputs-CC7XqPQO.js +0 -619
- package/dist/choice-inputs-CC7XqPQO.js.map +0 -1
- package/dist/code-block-xHKbAJDj.js.map +0 -1
- package/dist/combobox-DEbdr-3u.js +0 -273
- package/dist/combobox-DEbdr-3u.js.map +0 -1
- package/dist/combobox-xv3yJbzl.js +0 -850
- package/dist/combobox-xv3yJbzl.js.map +0 -1
- package/dist/command-C0xe7u9B.js.map +0 -1
- package/dist/comments-DviPLnwy.js.map +0 -1
- package/dist/containers-6s-ucRQQ.js.map +0 -1
- package/dist/data-display-cWIRdeaf.js +0 -1129
- package/dist/data-display-cWIRdeaf.js.map +0 -1
- package/dist/date-BFNMnrS5.js +0 -140
- package/dist/date-BFNMnrS5.js.map +0 -1
- package/dist/date-picker-CA6ogMQB.js +0 -1521
- package/dist/date-picker-CA6ogMQB.js.map +0 -1
- package/dist/date-pickers-BPIKLdsD.js +0 -224
- package/dist/date-pickers-BPIKLdsD.js.map +0 -1
- package/dist/display-CFM5myut.js.map +0 -1
- package/dist/dropdown-menu-BlnyHr-9.js.map +0 -1
- package/dist/feedback-DWUkgEjR.js.map +0 -1
- package/dist/field-affordance-recipes-IjzPrCTw.js +0 -17
- package/dist/field-affordance-recipes-IjzPrCTw.js.map +0 -1
- package/dist/field-state-recipes-CBTRt9Bt.js.map +0 -1
- package/dist/filters-BhsUtsxW.js.map +0 -1
- package/dist/form-field-Bn7ZH1rA.js.map +0 -1
- package/dist/form-sizing-BWs70_a2.js +0 -100
- package/dist/form-sizing-BWs70_a2.js.map +0 -1
- package/dist/format-iamDSqs2.js +0 -110
- package/dist/format-iamDSqs2.js.map +0 -1
- package/dist/forms-B7pzS25o.js.map +0 -1
- package/dist/forms-numeric-BUBxELBv.js +0 -867
- package/dist/forms-numeric-BUBxELBv.js.map +0 -1
- package/dist/header-C59QZyxV.js.map +0 -1
- package/dist/http-CLTVJc5I.js.map +0 -1
- package/dist/input-WwYQZJzG.js +0 -202
- package/dist/input-WwYQZJzG.js.map +0 -1
- package/dist/input-ci9fIgFH.js +0 -20
- package/dist/input-ci9fIgFH.js.map +0 -1
- package/dist/item-pJ0GsOiJ.js +0 -257
- package/dist/item-pJ0GsOiJ.js.map +0 -1
- package/dist/media-gallery-DhDRgnVZ.js +0 -200
- package/dist/media-gallery-DhDRgnVZ.js.map +0 -1
- package/dist/message-COsdEvXT.js +0 -108
- package/dist/message-COsdEvXT.js.map +0 -1
- package/dist/navigation-BUIn2Qxx.js.map +0 -1
- package/dist/navigation-DBEu4POU.js +0 -267
- package/dist/navigation-DBEu4POU.js.map +0 -1
- package/dist/navigation-row-recipes-GVh11KiT.js.map +0 -1
- package/dist/number-BNT_BIzJ.js +0 -269
- package/dist/number-BNT_BIzJ.js.map +0 -1
- package/dist/overlay.recipes-BxW5FIfK.js +0 -6
- package/dist/overlay.recipes-BxW5FIfK.js.map +0 -1
- package/dist/overlays-B11wZka6.js +0 -982
- package/dist/overlays-B11wZka6.js.map +0 -1
- package/dist/page-BV6ioQg3.js +0 -202
- package/dist/page-BV6ioQg3.js.map +0 -1
- package/dist/page-header-DQRa0jug.js.map +0 -1
- package/dist/pagination-C29vvt3I.js.map +0 -1
- package/dist/popover-CoLDEg19.js.map +0 -1
- package/dist/popover.recipes-zgBhMlUu.js.map +0 -1
- package/dist/primitives-DKPOGVpj.js +0 -330
- package/dist/primitives-DKPOGVpj.js.map +0 -1
- package/dist/progress-BOe8l_FZ.js.map +0 -1
- package/dist/rich-text-editor-CoVrTiSv.js +0 -575
- package/dist/rich-text-editor-CoVrTiSv.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/separator-Gk_WXH-l.js.map +0 -1
- package/dist/settings-BnCyyPOJ.js.map +0 -1
- package/dist/sheet-B-q914Ad.js +0 -205
- package/dist/sheet-B-q914Ad.js.map +0 -1
- package/dist/sidebar-C_2p3Tfj.js +0 -501
- package/dist/sidebar-C_2p3Tfj.js.map +0 -1
- package/dist/sidebar-DPR7fmqN.js.map +0 -1
- package/dist/smart-card-CYLn46e6.js +0 -578
- package/dist/smart-card-CYLn46e6.js.map +0 -1
- package/dist/spinner-BY9HbUEh.js.map +0 -1
- package/dist/structure.recipes-Bqhf9oIh.js.map +0 -1
- package/dist/surface-recipes-CQfRr-VL.js +0 -27
- package/dist/surface-recipes-CQfRr-VL.js.map +0 -1
- package/dist/table-BS39xnlq.js +0 -1424
- package/dist/table-BS39xnlq.js.map +0 -1
- package/dist/table-DnlAJ-xR.js +0 -146
- package/dist/table-DnlAJ-xR.js.map +0 -1
- package/dist/tabs-B5cNMWiP.js +0 -187
- package/dist/tabs-B5cNMWiP.js.map +0 -1
- package/dist/text-inputs-Dh9XGyiS.js +0 -331
- package/dist/text-inputs-Dh9XGyiS.js.map +0 -1
- package/dist/text.styles-BwB7vAF2.js.map +0 -1
- package/dist/timelines-B9ICkQcV.js.map +0 -1
- package/dist/track-recipes-LLPNVwFg.js +0 -10
- package/dist/track-recipes-LLPNVwFg.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-D8Za5x_c.js.map +0 -1
- package/dist/upload-queue-hIIYBLS7.js.map +0 -1
- package/dist/usage-card-DnmnJ58D.js.map +0 -1
- package/dist/utils-C2EKeIw3.js +0 -72
- package/dist/utils-C2EKeIw3.js.map +0 -1
- package/dist/value-inputs-DX2dbxjj.js +0 -824
- package/dist/value-inputs-DX2dbxjj.js.map +0 -1
- package/dist/workspace-C1PZmk8L.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-D2_TeLqw.js";
|
|
3
|
+
import { useStrings as n } from "./lib/strings.js";
|
|
4
|
+
import { t as r } from "./utils-Cospvlj1.js";
|
|
5
|
+
import { a as i, i as a, s as o } from "./typography-CAr3dQhX.js";
|
|
6
|
+
import { t as s } from "./button-BS3KDg00.js";
|
|
7
|
+
import { r as c, t as l } from "./structure-hzCW-XsV.js";
|
|
8
|
+
import { n as u, t as d } from "./feedback-C7nR0UtT.js";
|
|
9
|
+
import { _ as f, g as p, m } from "./primitives-BHrwQXFC.js";
|
|
10
|
+
import { t as h } from "./number-CKRBYmZK.js";
|
|
11
|
+
import { n as g, t as _ } from "./date-uf3z37Nm.js";
|
|
12
|
+
import { t as v } from "./badge-0tATj-tW.js";
|
|
13
|
+
import { t as y } from "./field-affordance-recipes-CkOCdE2y.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-kPMPjIxJ.js";
|
|
15
|
+
import { d as D, g as O, u as k } from "./form-sizing-uWP4lzVh.js";
|
|
16
|
+
import { t as A } from "./input-DhQdBnV3.js";
|
|
17
|
+
import { t as j } from "./date-picker-DrDFj8Lo.js";
|
|
18
|
+
import { a as M, c as N, i as P, o as F, r as I, t as ee } from "./popover-Dcv_9jxr.js";
|
|
19
|
+
import { n as L, r as R, t as te } from "./control-group-recipes-DBXmfh2E.js";
|
|
20
|
+
import { i as z, r as B, t as ne } from "./tabs-Dk8E_knt.js";
|
|
21
|
+
import { t as re } from "./popover-menu-DnRFKnHP.js";
|
|
22
|
+
import { t as ie } from "./use-debounced-callback-Cx1h-hdv.js";
|
|
23
|
+
import { t as ae } from "./use-debounce-DZ_1ZBPa.js";
|
|
24
|
+
import V, { Component as oe, createContext as se, useCallback as H, useContext as ce, useEffect as U, useId as le, useMemo as W, useRef as G, useState as K } from "react";
|
|
25
|
+
import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
26
|
+
import { CalendarIcon as ue, Check as de, ChevronDown as fe, ChevronLeft as pe, ChevronsUpDown as me, Filter as he, Loader2 as ge, Plus as _e, X as ve } from "lucide-react";
|
|
27
|
+
import { format as ye, isValid as be, parse as xe } from "date-fns";
|
|
24
28
|
//#region src/components/features/filters/filters.strings.ts
|
|
25
|
-
var
|
|
29
|
+
var Se = {
|
|
26
30
|
loading: "Loading",
|
|
27
31
|
loadingOptions: "Loading {filterLabel} options...",
|
|
28
32
|
addFilter: "Add filter",
|
|
@@ -101,20 +105,20 @@ var me = {
|
|
|
101
105
|
invalidFormat: "Invalid format"
|
|
102
106
|
}
|
|
103
107
|
};
|
|
104
|
-
function
|
|
108
|
+
function X(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 Ce(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;
|
|
111
115
|
i = i[e];
|
|
112
116
|
}
|
|
113
|
-
return typeof i == "string" ? n ?
|
|
117
|
+
return typeof i == "string" ? n ? X(i, n) : i : t;
|
|
114
118
|
}
|
|
115
119
|
//#endregion
|
|
116
120
|
//#region src/components/features/filters/filters.types.ts
|
|
117
|
-
var
|
|
121
|
+
var Z = {
|
|
118
122
|
SELECT: "select",
|
|
119
123
|
MULTI_SELECT: "multi_select",
|
|
120
124
|
ASYNC_SELECT: "async_select",
|
|
@@ -122,7 +126,7 @@ var ge = "h-control", X = {
|
|
|
122
126
|
RANGE: "range",
|
|
123
127
|
DATE: "date",
|
|
124
128
|
TAGS: "tags"
|
|
125
|
-
},
|
|
129
|
+
}, Q = {
|
|
126
130
|
EQUALS: "equals",
|
|
127
131
|
CONTAINS: "contains",
|
|
128
132
|
IN: "in",
|
|
@@ -139,112 +143,112 @@ var ge = "h-control", X = {
|
|
|
139
143
|
HAS_ANY: "has_any",
|
|
140
144
|
HAS_ALL: "has_all"
|
|
141
145
|
};
|
|
142
|
-
function
|
|
146
|
+
function we(e) {
|
|
143
147
|
return e;
|
|
144
148
|
}
|
|
145
149
|
//#endregion
|
|
146
150
|
//#region src/components/features/filters/operator-options.ts
|
|
147
|
-
function
|
|
151
|
+
function Te(e) {
|
|
148
152
|
return [
|
|
149
153
|
{
|
|
150
154
|
label: e.contains,
|
|
151
|
-
value:
|
|
155
|
+
value: Q.CONTAINS
|
|
152
156
|
},
|
|
153
157
|
{
|
|
154
158
|
label: e.equals,
|
|
155
|
-
value:
|
|
159
|
+
value: Q.EQUALS
|
|
156
160
|
},
|
|
157
161
|
{
|
|
158
162
|
label: e.notContains,
|
|
159
|
-
value:
|
|
163
|
+
value: Q.NOT
|
|
160
164
|
}
|
|
161
165
|
];
|
|
162
166
|
}
|
|
163
|
-
function
|
|
167
|
+
function Ee(e) {
|
|
164
168
|
return [{
|
|
165
169
|
label: e.is,
|
|
166
|
-
value:
|
|
170
|
+
value: Q.EQUALS
|
|
167
171
|
}, {
|
|
168
172
|
label: e.isNot,
|
|
169
|
-
value:
|
|
173
|
+
value: Q.NOT
|
|
170
174
|
}];
|
|
171
175
|
}
|
|
172
|
-
function
|
|
176
|
+
function De(e) {
|
|
173
177
|
return [
|
|
174
178
|
{
|
|
175
179
|
label: e.equals,
|
|
176
|
-
value:
|
|
180
|
+
value: Q.EQUALS
|
|
177
181
|
},
|
|
178
182
|
{
|
|
179
183
|
label: e.greaterThan,
|
|
180
|
-
value:
|
|
184
|
+
value: Q.GT
|
|
181
185
|
},
|
|
182
186
|
{
|
|
183
187
|
label: e.lessThan,
|
|
184
|
-
value:
|
|
188
|
+
value: Q.LT
|
|
185
189
|
}
|
|
186
190
|
];
|
|
187
191
|
}
|
|
188
|
-
function
|
|
192
|
+
function Oe(e) {
|
|
189
193
|
return [
|
|
190
194
|
{
|
|
191
195
|
label: e.before,
|
|
192
|
-
value:
|
|
196
|
+
value: Q.BEFORE
|
|
193
197
|
},
|
|
194
198
|
{
|
|
195
199
|
label: e.after,
|
|
196
|
-
value:
|
|
200
|
+
value: Q.AFTER
|
|
197
201
|
},
|
|
198
202
|
{
|
|
199
203
|
label: e.between,
|
|
200
|
-
value:
|
|
204
|
+
value: Q.BETWEEN
|
|
201
205
|
}
|
|
202
206
|
];
|
|
203
207
|
}
|
|
204
|
-
function
|
|
208
|
+
function ke(e) {
|
|
205
209
|
return [{
|
|
206
210
|
label: e.equals,
|
|
207
|
-
value:
|
|
211
|
+
value: Q.EQUALS
|
|
208
212
|
}];
|
|
209
213
|
}
|
|
210
|
-
function
|
|
214
|
+
function Ae(e, t) {
|
|
211
215
|
switch (e) {
|
|
212
|
-
case
|
|
213
|
-
case
|
|
216
|
+
case Z.SEARCH: return Te(t);
|
|
217
|
+
case Z.TAGS: return [
|
|
214
218
|
{
|
|
215
219
|
label: t.has,
|
|
216
|
-
value:
|
|
220
|
+
value: Q.HAS
|
|
217
221
|
},
|
|
218
222
|
{
|
|
219
223
|
label: t.hasAny,
|
|
220
|
-
value:
|
|
224
|
+
value: Q.HAS_ANY
|
|
221
225
|
},
|
|
222
226
|
{
|
|
223
227
|
label: t.hasAll,
|
|
224
|
-
value:
|
|
228
|
+
value: Q.HAS_ALL
|
|
225
229
|
}
|
|
226
230
|
];
|
|
227
|
-
case
|
|
228
|
-
case
|
|
229
|
-
case
|
|
230
|
-
case
|
|
231
|
-
default: return
|
|
231
|
+
case Z.SELECT:
|
|
232
|
+
case Z.ASYNC_SELECT: return Ee(t);
|
|
233
|
+
case Z.RANGE: return De(t);
|
|
234
|
+
case Z.DATE: return Oe(t);
|
|
235
|
+
default: return Te(t);
|
|
232
236
|
}
|
|
233
237
|
}
|
|
234
|
-
function
|
|
238
|
+
function je(e) {
|
|
235
239
|
switch (e) {
|
|
236
|
-
case
|
|
237
|
-
case
|
|
238
|
-
case
|
|
239
|
-
case
|
|
240
|
-
case
|
|
241
|
-
case
|
|
242
|
-
default: return
|
|
240
|
+
case Z.SEARCH: return Q.CONTAINS;
|
|
241
|
+
case Z.TAGS: return Q.HAS;
|
|
242
|
+
case Z.SELECT:
|
|
243
|
+
case Z.ASYNC_SELECT: return Q.EQUALS;
|
|
244
|
+
case Z.RANGE: return Q.EQUALS;
|
|
245
|
+
case Z.DATE: return Q.BEFORE;
|
|
246
|
+
default: return Q.EQUALS;
|
|
243
247
|
}
|
|
244
248
|
}
|
|
245
249
|
//#endregion
|
|
246
250
|
//#region src/components/features/filters/utils/filter-utils.ts
|
|
247
|
-
function
|
|
251
|
+
function Me(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 Ne = se(void 0);
|
|
268
|
+
function Pe({ children: e, filters: t, activeFilters: r, onFilterChange: i, navigating: a = !1, strings: o, onError: s }) {
|
|
269
|
+
let c = G(t), l = G(i), u = G(s);
|
|
266
270
|
u.current = s;
|
|
267
|
-
let [d, f] =
|
|
271
|
+
let [d, f] = K(0), p = G(/* @__PURE__ */ new Map()), m = W(() => {
|
|
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 !== Z.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(Se, o);
|
|
285
|
+
U(() => {
|
|
286
|
+
c.current = t;
|
|
287
|
+
}, [t]), U(() => {
|
|
284
288
|
l.current = i;
|
|
285
289
|
}, [i]);
|
|
286
|
-
let _ =
|
|
290
|
+
let _ = H((e) => {
|
|
287
291
|
let t = [...r, e];
|
|
288
292
|
l.current(t);
|
|
289
|
-
}, [r]), v =
|
|
293
|
+
}, [r]), v = H((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 = H((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 = H(() => {
|
|
299
303
|
l.current([]);
|
|
300
|
-
}, []), x =
|
|
304
|
+
}, []), x = H((e) => {
|
|
301
305
|
l.current(e);
|
|
302
|
-
}, []), S =
|
|
306
|
+
}, []), S = H((e) => c.current.find((t) => t.key === e), []), C = H((e) => r.find((t) => t.key === e)?.value || [], [r]), w = H((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 ? je(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 = H((e) => r.some((t) => t.key === e && t.value.length > 0), [r]), E = H((e) => r.find((t) => t.key === e)?.operator || "equals", [r]), D = H((e, t) => {
|
|
321
325
|
r.find((t) => t.key === e) && y(e, { operator: t });
|
|
322
|
-
}, [r, y]), O =
|
|
326
|
+
}, [r, y]), O = H((e, t) => {
|
|
323
327
|
let n = c.current.find((t) => t.key === e);
|
|
324
|
-
return n ?
|
|
325
|
-
}, [g]), k =
|
|
328
|
+
return n ? Me(n, t, (e) => Ce(g, e)) : !1;
|
|
329
|
+
}, [g]), k = H((e) => c.current.filter((t) => t.dependencies?.some((t) => t.key === e)), []), A = H((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 = H((e, t) => m.get(e)?.options.get(t)?.label, [m, d]), M = H((e, t) => {
|
|
332
336
|
u.current?.(e, t);
|
|
333
337
|
}, []);
|
|
334
|
-
|
|
338
|
+
U(() => {
|
|
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 = W(() => ({
|
|
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,28 +403,28 @@ 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__ */ J(Ne.Provider, {
|
|
403
407
|
value: N,
|
|
404
|
-
children:
|
|
408
|
+
children: e
|
|
405
409
|
});
|
|
406
410
|
}
|
|
407
|
-
function
|
|
408
|
-
let e =
|
|
411
|
+
function $() {
|
|
412
|
+
let e = ce(Ne);
|
|
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 } =
|
|
418
|
+
function Fe(e = {}) {
|
|
419
|
+
let { dynamicFilterOptions: t } = e, { filters: n, isFilterActive: r } = $(), i = W(() => 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
|
|
423
|
-
let e = i.filter((e) => e.type ===
|
|
426
|
+
return W(() => {
|
|
427
|
+
let e = i.filter((e) => e.type === Z.SEARCH), t = i.filter((e) => !e.displayConfig?.hidden && e.displayConfig?.display !== "hidden"), n = i.filter((e) => e.type !== Z.SEARCH && !e.displayConfig?.hidden && e.displayConfig?.display !== "hidden" && r(e.key)), a = t.filter((e) => e.type !== Z.SEARCH && !r(e.key) && e.displayConfig?.display === "always"), o = t.filter((e) => e.type !== Z.SEARCH && !r(e.key) && e.displayConfig?.display !== "always"), s = n.map((e) => e.key);
|
|
424
428
|
return {
|
|
425
429
|
processedFilters: i,
|
|
426
430
|
searchFilters: e,
|
|
@@ -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 Ie({ operator: e, operators: t, onOperatorChange: n, segmentResetClass: a }) {
|
|
442
|
+
let [c, l] = K(!1), { strings: u } = $(), d = t.find((t) => t.value === e)?.label || e;
|
|
443
|
+
return /* @__PURE__ */ J(re, {
|
|
440
444
|
open: c,
|
|
441
445
|
onOpenChange: l,
|
|
442
446
|
search: !1,
|
|
443
447
|
contentLabel: u.operator,
|
|
444
|
-
trigger: /* @__PURE__ */
|
|
448
|
+
trigger: /* @__PURE__ */ J(s, {
|
|
445
449
|
tone: "secondary",
|
|
446
450
|
buttonStyle: "ghost",
|
|
447
|
-
className:
|
|
451
|
+
className: r("filter-operator-select--component", a, "h-full min-h-0 px-control text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
|
|
448
452
|
onClick: (e) => {
|
|
449
453
|
e.stopPropagation();
|
|
450
454
|
},
|
|
451
455
|
type: "button",
|
|
452
|
-
children: /* @__PURE__ */
|
|
456
|
+
children: /* @__PURE__ */ J(o, {
|
|
453
457
|
tag: "span",
|
|
454
458
|
type: "secondary",
|
|
455
459
|
children: d
|
|
456
460
|
})
|
|
457
461
|
}),
|
|
458
|
-
header: /* @__PURE__ */
|
|
462
|
+
header: /* @__PURE__ */ J(i, {
|
|
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
|
|
476
|
-
let { strings: n } =
|
|
477
|
-
return t.length === 0 && e.type !==
|
|
479
|
+
function Le({ filter: e, value: t }) {
|
|
480
|
+
let { strings: n } = $();
|
|
481
|
+
return t.length === 0 && e.type !== Z.DATE ? /* @__PURE__ */ J(o, {
|
|
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 ===
|
|
486
|
+
}) : e.type === Z.ASYNC_SELECT && !e.options?.length ? /* @__PURE__ */ J(o, {
|
|
483
487
|
tag: "span",
|
|
484
488
|
weight: "semibold",
|
|
485
489
|
className: "filter-value-display--component leading-none",
|
|
486
|
-
children:
|
|
487
|
-
}) : e.options && e.type !==
|
|
490
|
+
children: ze(e, t, n)
|
|
491
|
+
}) : e.options && e.type !== Z.DATE ? /* @__PURE__ */ Y(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__ */ Y("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__ */ J("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__ */ J("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__ */ Y(o, {
|
|
504
508
|
tag: "span",
|
|
505
509
|
size: "xs",
|
|
506
510
|
weight: "medium",
|
|
507
|
-
children: ["+", /* @__PURE__ */
|
|
511
|
+
children: ["+", /* @__PURE__ */ J(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__ */ J(o, {
|
|
515
519
|
tag: "span",
|
|
516
520
|
weight: "semibold",
|
|
517
521
|
className: "truncate leading-none",
|
|
518
|
-
children:
|
|
522
|
+
children: Be(e, t, n)
|
|
519
523
|
})]
|
|
520
|
-
}) : e.type ===
|
|
524
|
+
}) : e.type === Z.DATE ? /* @__PURE__ */ Y(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__ */ J(ue, { className: "text-muted-foreground size-icon-sm" }), Re(e, t, n)]
|
|
530
|
+
}) : /* @__PURE__ */ J(o, {
|
|
527
531
|
tag: "span",
|
|
528
532
|
weight: "semibold",
|
|
529
533
|
className: "filter-value-display--component truncate leading-none",
|
|
530
|
-
children:
|
|
534
|
+
children: Be(e, t, n)
|
|
531
535
|
});
|
|
532
536
|
}
|
|
533
|
-
function
|
|
534
|
-
return e.operator === "between" && t.length === 2 ?
|
|
537
|
+
function Re(e, t, n) {
|
|
538
|
+
return e.operator === "between" && t.length === 2 ? Ue(t[0], t[1], e.dateFormat?.display) : t.length === 1 ? He(t[0], e.dateFormat?.display) : t.length === 2 ? Ue(t[0], t[1], e.dateFormat?.display) : /* @__PURE__ */ J(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
|
|
541
|
-
return t.length === 0 ? "" :
|
|
544
|
+
function ze(e, t, n) {
|
|
545
|
+
return t.length === 0 ? "" : X(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
|
|
547
|
-
return t.length > 1 ?
|
|
550
|
+
function Be(e, t, n) {
|
|
551
|
+
return t.length > 1 ? X(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 Ve(e) {
|
|
553
557
|
let t = new Date(e);
|
|
554
558
|
return !Number.isNaN(t.getTime());
|
|
555
559
|
}
|
|
556
|
-
function
|
|
557
|
-
return
|
|
560
|
+
function He(e, t) {
|
|
561
|
+
return Ve(e) ? /* @__PURE__ */ J(_, {
|
|
558
562
|
value: e,
|
|
559
563
|
format: t,
|
|
560
564
|
weight: "semibold",
|
|
561
565
|
className: "truncate leading-none"
|
|
562
|
-
}) : /* @__PURE__ */
|
|
566
|
+
}) : /* @__PURE__ */ J(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 Ue(e, t, n) {
|
|
573
|
+
return Ve(e) && Ve(t) ? /* @__PURE__ */ J(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__ */ Y("span", {
|
|
576
580
|
className: "inline-flex min-w-0 items-center gap-space-xs truncate leading-none",
|
|
577
581
|
children: [
|
|
578
|
-
|
|
579
|
-
/* @__PURE__ */
|
|
582
|
+
He(e, n),
|
|
583
|
+
/* @__PURE__ */ J(f, {
|
|
580
584
|
weight: "semibold",
|
|
581
585
|
children: "–"
|
|
582
586
|
}),
|
|
583
|
-
|
|
587
|
+
He(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 We({ filter: n, value: i, active: a, 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: _ } = $(), v = V.useId(), y = V.useId(), b = `${R.joinedItem} !border-0 !rounded-none !shadow-none focus-visible:!ring-0 focus-visible:!border-transparent`, x = () => /* @__PURE__ */ J("div", {
|
|
591
595
|
"aria-hidden": !0,
|
|
592
596
|
className: "w-px self-stretch bg-border"
|
|
593
597
|
});
|
|
594
|
-
return /* @__PURE__ */
|
|
598
|
+
return /* @__PURE__ */ Y("div", {
|
|
595
599
|
role: "group",
|
|
596
|
-
"aria-label":
|
|
600
|
+
"aria-label": n.label,
|
|
597
601
|
"data-active": a || void 0,
|
|
598
|
-
className:
|
|
602
|
+
className: r("active-filter-item--component", R.joinedFrame, te[g], "bg-background", n.displayConfig?.className),
|
|
599
603
|
children: [
|
|
600
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ Y(s, {
|
|
601
605
|
type: "button",
|
|
602
606
|
tone: "secondary",
|
|
603
607
|
buttonStyle: "ghost",
|
|
604
|
-
className:
|
|
605
|
-
ref:
|
|
608
|
+
className: r(b, "flex h-full min-h-0 items-center gap-space-sm px-control hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
|
|
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__ */ J("span", {
|
|
611
615
|
className: "flex items-center text-muted-foreground",
|
|
612
|
-
children:
|
|
616
|
+
children: n.icon
|
|
613
617
|
}),
|
|
614
|
-
/* @__PURE__ */
|
|
615
|
-
id:
|
|
618
|
+
/* @__PURE__ */ J(o, {
|
|
619
|
+
id: v,
|
|
616
620
|
tag: "span",
|
|
617
621
|
weight: "semibold",
|
|
618
|
-
children:
|
|
622
|
+
children: n.label
|
|
619
623
|
}),
|
|
620
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ J(fe, { className: "size-icon-sm" })
|
|
621
625
|
]
|
|
622
626
|
}),
|
|
623
|
-
/* @__PURE__ */
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
-
operator:
|
|
626
|
-
operators:
|
|
627
|
-
onOperatorChange:
|
|
628
|
-
segmentResetClass:
|
|
627
|
+
/* @__PURE__ */ J(x, {}),
|
|
628
|
+
/* @__PURE__ */ J(Ie, {
|
|
629
|
+
operator: d,
|
|
630
|
+
operators: u,
|
|
631
|
+
onOperatorChange: f,
|
|
632
|
+
segmentResetClass: b
|
|
629
633
|
}),
|
|
630
|
-
/* @__PURE__ */
|
|
631
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ J(x, {}),
|
|
635
|
+
/* @__PURE__ */ J(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-h-0 min-w-0 flex-1 items-center justify-start px-control hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
|
|
644
|
+
children: /* @__PURE__ */ J("span", {
|
|
645
|
+
id: y,
|
|
642
646
|
className: "min-w-0",
|
|
643
|
-
children: /* @__PURE__ */
|
|
644
|
-
filter:
|
|
647
|
+
children: /* @__PURE__ */ J(Le, {
|
|
648
|
+
filter: n,
|
|
645
649
|
value: i
|
|
646
650
|
})
|
|
647
651
|
})
|
|
648
652
|
}),
|
|
649
|
-
!!a && /* @__PURE__ */
|
|
653
|
+
!!a && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(x, {}), /* @__PURE__ */ Y(s, {
|
|
650
654
|
type: "button",
|
|
651
655
|
tone: "secondary",
|
|
652
656
|
buttonStyle: "ghost",
|
|
653
|
-
className:
|
|
657
|
+
className: r(b, "flex h-full min-h-0 shrink-0 items-center justify-center px-space-sm text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
|
|
654
658
|
onClick: (e) => {
|
|
655
|
-
e.stopPropagation(), e.preventDefault(),
|
|
659
|
+
e.stopPropagation(), e.preventDefault(), p();
|
|
656
660
|
},
|
|
657
|
-
children: [/* @__PURE__ */
|
|
661
|
+
children: [/* @__PURE__ */ J(ve, {
|
|
658
662
|
"aria-hidden": "true",
|
|
659
663
|
className: "size-icon"
|
|
660
|
-
}), /* @__PURE__ */
|
|
664
|
+
}), /* @__PURE__ */ J(o, {
|
|
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 Ge(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 Ke(e, t, n, r = {}) {
|
|
680
|
+
let { asyncConfig: i } = e, a = i?.fetcher, o = i?.mapToOption, s = W(() => /* @__PURE__ */ new Map(), [
|
|
677
681
|
e.key,
|
|
678
682
|
a,
|
|
679
683
|
o
|
|
680
|
-
]), c =
|
|
684
|
+
]), c = G(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 = (ae(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 = W(() => 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 = H(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] = K(() => {
|
|
709
|
+
let e = Ge(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] = K(0), E = H(() => T((e) => e + 1), []), D = G(0);
|
|
718
|
+
return U(() => {
|
|
715
719
|
let t = D.current !== w;
|
|
716
720
|
if (D.current = w, !v) return;
|
|
717
|
-
let n =
|
|
721
|
+
let n = Ge(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 qe({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: i, triggerSource: a = "chip" }) {
|
|
784
|
+
let { strings: c, cacheAsyncOptions: f, getAsyncOptionLabel: p, reportError: m } = $(), [h, g] = K(""), [_, v] = K(t ?? []), y = G(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 } = Ke(e, h, !0, { onError: m });
|
|
790
|
+
U(() => {
|
|
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 = a === "toolbar", L = _.length !== t.length || _.some((e) => !t.includes(e)), R = W(() => {
|
|
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
814
|
]), te = (t) => {
|
|
811
|
-
if (
|
|
812
|
-
if (
|
|
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
|
|
821
|
+
} else v([t]), e.closeOnSelect === !0 && (n([t]), i());
|
|
818
822
|
}, z = () => {
|
|
819
|
-
|
|
820
|
-
},
|
|
823
|
+
n(_), i();
|
|
824
|
+
}, B = W(() => D || O ? /* @__PURE__ */ J(u, { label: c.searching }) : k ? /* @__PURE__ */ J(d, {
|
|
821
825
|
variant: "inline",
|
|
822
|
-
title:
|
|
823
|
-
action: /* @__PURE__ */
|
|
826
|
+
title: c.fetchError,
|
|
827
|
+
action: /* @__PURE__ */ J(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__ */ J("div", {
|
|
833
837
|
className: "text-muted-foreground flex items-center justify-center py-space-xl",
|
|
834
|
-
children: /* @__PURE__ */
|
|
838
|
+
children: /* @__PURE__ */ J(o, {
|
|
835
839
|
tag: "span",
|
|
836
840
|
size: "xs",
|
|
837
841
|
type: "secondary",
|
|
838
|
-
children:
|
|
842
|
+
children: X(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__ */ Y(q, { children: [
|
|
854
|
+
/* @__PURE__ */ Y(P, {
|
|
855
|
+
start: ee ? /* @__PURE__ */ J(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__ */ J(pe, {
|
|
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__ */ J(o, {
|
|
865
869
|
tag: "span",
|
|
866
870
|
weight: "semibold",
|
|
867
871
|
children: e.label
|
|
868
|
-
}), /* @__PURE__ */
|
|
872
|
+
}), /* @__PURE__ */ J(o, {
|
|
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__ */ Y(E, {
|
|
876
880
|
shouldFilter: !1,
|
|
877
881
|
inset: "flush",
|
|
878
882
|
className: "rounded-none",
|
|
879
|
-
children: [/* @__PURE__ */
|
|
880
|
-
placeholder:
|
|
883
|
+
children: [/* @__PURE__ */ J(x, {
|
|
884
|
+
placeholder: X(c.searchPlaceholder, { filterLabel: e.label.toLowerCase() }),
|
|
881
885
|
value: h,
|
|
882
886
|
onValueChange: g
|
|
883
|
-
}), /* @__PURE__ */
|
|
887
|
+
}), /* @__PURE__ */ J(C, { children: R.length === 0 ? /* @__PURE__ */ J(S, { children: B }) : /* @__PURE__ */ Y(w, { children: [!(!O || D) && /* @__PURE__ */ Y(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__ */ J(ge, { className: "text-muted-foreground size-icon-sm animate-spin" }), /* @__PURE__ */ J(o, {
|
|
889
893
|
tag: "span",
|
|
890
894
|
size: "xs",
|
|
891
895
|
type: "secondary",
|
|
892
|
-
children:
|
|
896
|
+
children: c.searching
|
|
893
897
|
})]
|
|
894
|
-
}),
|
|
898
|
+
}), R.map((e) => /* @__PURE__ */ Y(b, {
|
|
895
899
|
onSelect: () => te(e.value),
|
|
896
|
-
"data-checked":
|
|
897
|
-
disabled: e.disabled || !!
|
|
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__ */ J(o, {
|
|
900
904
|
tag: "span",
|
|
901
905
|
lineHeight: "tight",
|
|
902
906
|
children: e.label
|
|
903
907
|
})]
|
|
904
908
|
}, e.value))] }) })]
|
|
905
909
|
}),
|
|
906
|
-
|
|
907
|
-
caption:
|
|
908
|
-
count:
|
|
909
|
-
filterLabel: (
|
|
910
|
+
L && /* @__PURE__ */ J(I, {
|
|
911
|
+
caption: X(c.selected, {
|
|
912
|
+
count: _.length,
|
|
913
|
+
filterLabel: (_.length > 1 ? e.pluralLabel : e.label) ?? e.label
|
|
910
914
|
}),
|
|
911
|
-
children: /* @__PURE__ */
|
|
915
|
+
children: /* @__PURE__ */ J(s, {
|
|
912
916
|
tone: "primary",
|
|
913
917
|
size: "sm",
|
|
914
918
|
onClick: z,
|
|
915
|
-
children:
|
|
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 } =
|
|
925
|
-
from:
|
|
926
|
-
to:
|
|
927
|
-
} : void 0, m = !o &&
|
|
926
|
+
var Je = [];
|
|
927
|
+
function Ye({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
928
|
+
let { strings: a } = $(), o = e.operators?.some((e) => e.value === "between") || e.operator === "between" || e.key.toLowerCase().includes("range") || e.key.toLowerCase().includes("between"), s = e.dateFormat?.param ?? "yyyy-MM-dd", c = e.dateFormat?.display ?? "PPP", l = o ? e.datePickerConfig?.noRangePlaceholder ?? e.placeholder ?? a.calendar.notDateRangeSelected : e.datePickerConfig?.noDatePlaceholder ?? e.placeholder ?? a.calendar.notDateSelected, u = !!e.datePickerConfig?.showConfirmButton, d = e.datePickerConfig?.autoApply ?? !u, f = e.datePickerConfig?.showShortcuts ?? !0, p = o && (t.start || t.end) ? {
|
|
929
|
+
from: t.start,
|
|
930
|
+
to: t.end
|
|
931
|
+
} : void 0, m = !o && t.start && be(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__ */ J(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 : Je,
|
|
947
951
|
...h
|
|
948
|
-
}) : /* @__PURE__ */
|
|
952
|
+
}) : /* @__PURE__ */ J(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 Xe({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, triggerSource: i = "chip" }) {
|
|
968
|
+
let { strings: a } = $(), o = (t) => {
|
|
965
969
|
if (!t) return;
|
|
966
970
|
if (e.dateFormat?.param) {
|
|
967
|
-
let n =
|
|
968
|
-
return
|
|
971
|
+
let n = xe(t, e.dateFormat.param, /* @__PURE__ */ new Date());
|
|
972
|
+
return be(n) ? n : void 0;
|
|
969
973
|
}
|
|
970
974
|
let n = new Date(t);
|
|
971
|
-
return
|
|
972
|
-
}, c =
|
|
973
|
-
if (t &&
|
|
975
|
+
return be(n) ? n : void 0;
|
|
976
|
+
}, c = o(t[0]), l = o(t[1]), u = (t) => {
|
|
977
|
+
if (t && be(t)) return ye(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__ */ Y("div", {
|
|
982
986
|
className: "flex flex-col",
|
|
983
|
-
children: [/* @__PURE__ */
|
|
984
|
-
start: f ? /* @__PURE__ */
|
|
987
|
+
children: [/* @__PURE__ */ J(P, {
|
|
988
|
+
start: f ? /* @__PURE__ */ J(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__ */ J(pe, {
|
|
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__ */ J(M, { children: e.label })
|
|
1003
|
+
}), /* @__PURE__ */ J("div", {
|
|
1000
1004
|
className: "p-surface",
|
|
1001
|
-
children: /* @__PURE__ */
|
|
1005
|
+
children: /* @__PURE__ */ J(Ye, {
|
|
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 Ze = class extends oe {
|
|
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__ */ J("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__ */ Y("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__ */ Y("div", {
|
|
1044
1048
|
className: "mb-space-xs flex items-center justify-between",
|
|
1045
|
-
children: [/* @__PURE__ */
|
|
1049
|
+
children: [/* @__PURE__ */ J(o, {
|
|
1046
1050
|
tag: "span",
|
|
1047
1051
|
weight: "semibold",
|
|
1048
|
-
children:
|
|
1049
|
-
}), /* @__PURE__ */
|
|
1052
|
+
children: n.title
|
|
1053
|
+
}), /* @__PURE__ */ J(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__ */ J(ve, { className: "size-icon-sm" })
|
|
1059
1062
|
})]
|
|
1060
1063
|
}),
|
|
1061
|
-
/* @__PURE__ */
|
|
1062
|
-
/* @__PURE__ */
|
|
1064
|
+
/* @__PURE__ */ J(o, { children: n.getDescription(t) }),
|
|
1065
|
+
/* @__PURE__ */ J(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__ */ J("div", {
|
|
1071
1074
|
className: "filter-error-boundary--component contents",
|
|
1072
1075
|
children: this.props.children
|
|
1073
1076
|
});
|
|
1074
1077
|
}
|
|
1075
1078
|
};
|
|
1076
|
-
function
|
|
1077
|
-
let { strings: t, reportError: n } =
|
|
1079
|
+
function Qe(e) {
|
|
1080
|
+
let { strings: t, reportError: n } = $(), r = W(() => ({
|
|
1078
1081
|
title: t.error.title,
|
|
1079
1082
|
reset: t.clear,
|
|
1080
|
-
getDescription: (e) => e ?
|
|
1083
|
+
getDescription: (e) => e ? X(t.error.descriptionWithKey, { filterKey: e }) : t.error.generic,
|
|
1081
1084
|
unknownError: t.error.unknown
|
|
1082
1085
|
}), [t]);
|
|
1083
|
-
return /* @__PURE__ */
|
|
1086
|
+
return /* @__PURE__ */ J(Ze, {
|
|
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 } =
|
|
1093
|
-
return /* @__PURE__ */
|
|
1094
|
+
function $e({ filter: e, onSelect: t }) {
|
|
1095
|
+
let { strings: n } = $(), r = e.type === Z.DATE ? e.operator === "between" ? n?.selectDateRange : n?.selectDate : e.options ? `${e.options.length} ${n?.options ?? ""}`.trim() : null;
|
|
1096
|
+
return /* @__PURE__ */ Y(b, {
|
|
1094
1097
|
onSelect: t,
|
|
1095
|
-
children: [!!e.icon && /* @__PURE__ */
|
|
1098
|
+
children: [!!e.icon && /* @__PURE__ */ J("span", {
|
|
1096
1099
|
className: "shrink-0 text-muted-foreground [&_svg]:size-icon",
|
|
1097
1100
|
children: e.icon
|
|
1098
|
-
}), /* @__PURE__ */
|
|
1101
|
+
}), /* @__PURE__ */ Y("div", {
|
|
1099
1102
|
className: "flex min-w-0 flex-col gap-dense leading-tight",
|
|
1100
|
-
children: [/* @__PURE__ */
|
|
1103
|
+
children: [/* @__PURE__ */ J(o, {
|
|
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__ */ J(o, {
|
|
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
|
|
1120
|
-
let { strings: r } =
|
|
1122
|
+
function et({ availableFilters: e, activeFilters: t, onFilterSelect: n }) {
|
|
1123
|
+
let { strings: r } = $(), i = (e) => {
|
|
1121
1124
|
n(e);
|
|
1122
1125
|
};
|
|
1123
|
-
return /* @__PURE__ */
|
|
1126
|
+
return /* @__PURE__ */ Y(E, {
|
|
1124
1127
|
inset: "compact",
|
|
1125
1128
|
className: "rounded-none",
|
|
1126
|
-
children: [/* @__PURE__ */
|
|
1127
|
-
/* @__PURE__ */
|
|
1128
|
-
e.length > 0 && /* @__PURE__ */
|
|
1129
|
+
children: [/* @__PURE__ */ J(x, { placeholder: r.searchFilters }), /* @__PURE__ */ Y(C, { children: [
|
|
1130
|
+
/* @__PURE__ */ J(S, { children: r.noFiltersAvailable }),
|
|
1131
|
+
e.length > 0 && /* @__PURE__ */ J(w, {
|
|
1129
1132
|
heading: r.availableFilters,
|
|
1130
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1133
|
+
children: e.map((e) => /* @__PURE__ */ J($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__ */ Y(q, { children: [/* @__PURE__ */ J(T, {}), /* @__PURE__ */ J(w, {
|
|
1136
1139
|
heading: r.activeFilters,
|
|
1137
|
-
children: t.map((e) => /* @__PURE__ */
|
|
1140
|
+
children: t.map((e) => /* @__PURE__ */ J($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: i, triggerSource: a = "chip" }) {
|
|
1151
|
+
let { strings: c, reportError: u } = $(), d = e.multiple === !0 || e.type === Z.MULTI_SELECT, f = a === "toolbar", [p, m] = K(t || []);
|
|
1152
|
+
U(() => {
|
|
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]), i());
|
|
1160
|
+
}, g = () => {
|
|
1158
1161
|
try {
|
|
1159
|
-
|
|
1162
|
+
n(p), i();
|
|
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__ */ Y("div", {
|
|
1168
1171
|
className: "flex flex-col",
|
|
1169
1172
|
children: [
|
|
1170
|
-
/* @__PURE__ */
|
|
1171
|
-
start:
|
|
1173
|
+
/* @__PURE__ */ J(P, {
|
|
1174
|
+
start: f ? /* @__PURE__ */ J(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__ */ J(pe, {
|
|
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__ */ J(o, {
|
|
1186
1189
|
tag: "span",
|
|
1187
1190
|
weight: "semibold",
|
|
1188
1191
|
children: e.label
|
|
1189
1192
|
})
|
|
1190
1193
|
}),
|
|
1191
|
-
/* @__PURE__ */
|
|
1194
|
+
/* @__PURE__ */ Y(E, {
|
|
1192
1195
|
inset: "flush",
|
|
1193
1196
|
className: "rounded-none",
|
|
1194
|
-
children: [/* @__PURE__ */
|
|
1197
|
+
children: [/* @__PURE__ */ J(x, { placeholder: X(c.searchPlaceholder, { filterLabel: e.label.toLowerCase() }) }), /* @__PURE__ */ Y(C, {
|
|
1195
1198
|
className: "max-h-64",
|
|
1196
|
-
children: [/* @__PURE__ */
|
|
1199
|
+
children: [/* @__PURE__ */ J(S, { children: /* @__PURE__ */ J(o, {
|
|
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__ */ J(w, { children: e.options?.map((e) => {
|
|
1205
|
+
let t = p.includes(e.value);
|
|
1206
|
+
return /* @__PURE__ */ Y(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__ */ J("span", {
|
|
1209
1212
|
className: "shrink-0 text-muted-foreground [&_svg]:size-icon",
|
|
1210
1213
|
children: e.icon
|
|
1211
|
-
}), /* @__PURE__ */
|
|
1214
|
+
}), /* @__PURE__ */ Y(l, {
|
|
1215
|
+
gap: "dense",
|
|
1212
1216
|
className: "flex min-w-0 flex-1 flex-col leading-tight",
|
|
1213
|
-
children: [/* @__PURE__ */
|
|
1217
|
+
children: [/* @__PURE__ */ J(o, {
|
|
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__ */ J(o, {
|
|
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
|
-
!!
|
|
1233
|
-
caption:
|
|
1234
|
-
count:
|
|
1235
|
-
filterLabel: (
|
|
1236
|
+
!!_ && /* @__PURE__ */ J(I, {
|
|
1237
|
+
caption: X(c.selected, {
|
|
1238
|
+
count: p.length,
|
|
1239
|
+
filterLabel: (p.length > 1 ? e.pluralLabel : e.label) ?? e.label
|
|
1236
1240
|
}),
|
|
1237
|
-
children: /* @__PURE__ */
|
|
1241
|
+
children: /* @__PURE__ */ J(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,116 @@ 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: i, className: a }) {
|
|
1254
|
+
let { defaultScale: c } = t(), u = O(void 0, c), { strings: d } = $(), [f, p] = K(""), m = H(() => {
|
|
1255
|
+
let e = f.trim();
|
|
1256
|
+
e && !n.includes(e) && (i([...n, e]), p(""));
|
|
1253
1257
|
}, [
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
]),
|
|
1258
|
-
|
|
1259
|
-
}, [
|
|
1260
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
1261
|
-
},
|
|
1262
|
-
|
|
1263
|
-
}, [
|
|
1258
|
+
f,
|
|
1259
|
+
n,
|
|
1260
|
+
i
|
|
1261
|
+
]), h = H((e) => {
|
|
1262
|
+
i(n.filter((t) => t !== e));
|
|
1263
|
+
}, [n, i]), g = (e) => {
|
|
1264
|
+
e.key === "Enter" && (e.preventDefault(), m());
|
|
1265
|
+
}, _ = H(() => {
|
|
1266
|
+
i([]), p("");
|
|
1267
|
+
}, [i]), b = n.length > 0, x = n.length === 1 ? d.tag : d.tags, S = b ? /* @__PURE__ */ Y(l, {
|
|
1264
1268
|
gap: "md",
|
|
1265
1269
|
className: "tags-facet--summary",
|
|
1266
|
-
children: [/* @__PURE__ */
|
|
1270
|
+
children: [/* @__PURE__ */ Y(l, {
|
|
1267
1271
|
direction: "horizontal",
|
|
1268
1272
|
gap: "sm",
|
|
1269
1273
|
justify: "between",
|
|
1270
1274
|
wrap: !1,
|
|
1271
|
-
children: [/* @__PURE__ */
|
|
1275
|
+
children: [/* @__PURE__ */ Y(o, {
|
|
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__ */ J(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__ */ J(l, {
|
|
1291
1295
|
direction: "horizontal",
|
|
1292
1296
|
gap: "md",
|
|
1293
|
-
children:
|
|
1297
|
+
children: n.map((e) => /* @__PURE__ */ Y(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__ */ J(o, {
|
|
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__ */ J("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__ */ J(ve, {
|
|
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__ */ Y(l, {
|
|
1315
1318
|
gap: "lg",
|
|
1316
|
-
className:
|
|
1317
|
-
children: [/* @__PURE__ */
|
|
1319
|
+
className: r("tags-facet--component", a),
|
|
1320
|
+
children: [/* @__PURE__ */ Y(l, {
|
|
1318
1321
|
direction: "horizontal",
|
|
1319
1322
|
gap: "md",
|
|
1320
1323
|
wrap: !1,
|
|
1321
|
-
children: [/* @__PURE__ */
|
|
1324
|
+
children: [/* @__PURE__ */ J("div", {
|
|
1322
1325
|
className: "relative flex-1",
|
|
1323
|
-
children: /* @__PURE__ */
|
|
1326
|
+
children: /* @__PURE__ */ J(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
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1333
|
+
}), /* @__PURE__ */ Y(s, {
|
|
1334
|
+
tone: "primary",
|
|
1335
|
+
onClick: m,
|
|
1336
|
+
disabled: !f.trim(),
|
|
1337
|
+
size: u,
|
|
1338
|
+
iconOnly: !0,
|
|
1339
|
+
className: r(k[u], L[u]),
|
|
1336
1340
|
type: "button",
|
|
1337
|
-
children: [/* @__PURE__ */
|
|
1341
|
+
children: [/* @__PURE__ */ J(_e, { className: "size-icon" }), /* @__PURE__ */ J(o, {
|
|
1338
1342
|
tag: "span",
|
|
1339
1343
|
size: "pxs",
|
|
1340
1344
|
className: "sr-only",
|
|
1341
|
-
children:
|
|
1345
|
+
children: d.addTag
|
|
1342
1346
|
})]
|
|
1343
1347
|
})]
|
|
1344
|
-
}),
|
|
1348
|
+
}), S]
|
|
1345
1349
|
});
|
|
1346
1350
|
}
|
|
1347
|
-
var
|
|
1348
|
-
|
|
1351
|
+
var rt = V.memo(nt);
|
|
1352
|
+
rt.displayName = "TagsFacet";
|
|
1349
1353
|
//#endregion
|
|
1350
1354
|
//#region src/components/features/filters/partials/tags-filter-content.tsx
|
|
1351
|
-
function
|
|
1352
|
-
let { strings:
|
|
1353
|
-
|
|
1355
|
+
function it({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: i, triggerSource: a = "chip" }) {
|
|
1356
|
+
let { strings: o, reportError: c } = $(), [l, u] = K(t || []), d = a === "toolbar", f = l.length === 1 ? o.tag : o.tags;
|
|
1357
|
+
U(() => {
|
|
1354
1358
|
u(t || []);
|
|
1355
1359
|
}, [t]);
|
|
1356
1360
|
let m = () => {
|
|
1357
1361
|
try {
|
|
1358
|
-
|
|
1362
|
+
n(l), i();
|
|
1359
1363
|
} catch (t) {
|
|
1360
1364
|
c(t, {
|
|
1361
1365
|
phase: "apply",
|
|
@@ -1363,49 +1367,49 @@ function Xe({ filter: e, value: t, onFilterChange: r, onBackToFilterList: i, onC
|
|
|
1363
1367
|
});
|
|
1364
1368
|
}
|
|
1365
1369
|
}, h = JSON.stringify(l.slice().sort()) !== JSON.stringify((t ?? []).slice().sort());
|
|
1366
|
-
return /* @__PURE__ */
|
|
1370
|
+
return /* @__PURE__ */ Y("div", {
|
|
1367
1371
|
className: "flex flex-col",
|
|
1368
1372
|
children: [
|
|
1369
|
-
/* @__PURE__ */
|
|
1370
|
-
start:
|
|
1373
|
+
/* @__PURE__ */ J(P, {
|
|
1374
|
+
start: d ? /* @__PURE__ */ J(s, {
|
|
1371
1375
|
type: "button",
|
|
1372
1376
|
tone: "secondary",
|
|
1373
1377
|
buttonStyle: "ghost",
|
|
1374
1378
|
size: "sm",
|
|
1375
1379
|
iconOnly: !0,
|
|
1376
|
-
onClick:
|
|
1380
|
+
onClick: r,
|
|
1377
1381
|
className: "shrink-0",
|
|
1378
|
-
"aria-label":
|
|
1379
|
-
children: /* @__PURE__ */
|
|
1382
|
+
"aria-label": o.backToFilters,
|
|
1383
|
+
children: /* @__PURE__ */ J(pe, {
|
|
1380
1384
|
"aria-hidden": "true",
|
|
1381
1385
|
className: "size-icon-sm rtl:rotate-180"
|
|
1382
1386
|
})
|
|
1383
1387
|
}) : void 0,
|
|
1384
|
-
children: /* @__PURE__ */
|
|
1388
|
+
children: /* @__PURE__ */ J(M, { children: e.label })
|
|
1385
1389
|
}),
|
|
1386
|
-
/* @__PURE__ */
|
|
1390
|
+
/* @__PURE__ */ J("div", {
|
|
1387
1391
|
className: "p-surface",
|
|
1388
|
-
children: /* @__PURE__ */
|
|
1392
|
+
children: /* @__PURE__ */ J(rt, {
|
|
1389
1393
|
filter: e,
|
|
1390
1394
|
value: l,
|
|
1391
1395
|
onValueChange: u
|
|
1392
1396
|
})
|
|
1393
1397
|
}),
|
|
1394
|
-
!!h && /* @__PURE__ */
|
|
1395
|
-
caption: /* @__PURE__ */
|
|
1398
|
+
!!h && /* @__PURE__ */ J(I, {
|
|
1399
|
+
caption: /* @__PURE__ */ Y(p, {
|
|
1396
1400
|
size: "xs",
|
|
1397
1401
|
className: "tabular-nums",
|
|
1398
1402
|
children: [
|
|
1399
1403
|
l.length,
|
|
1400
1404
|
" ",
|
|
1401
|
-
|
|
1405
|
+
f
|
|
1402
1406
|
]
|
|
1403
1407
|
}),
|
|
1404
|
-
children: /* @__PURE__ */
|
|
1408
|
+
children: /* @__PURE__ */ J(s, {
|
|
1405
1409
|
tone: "primary",
|
|
1406
1410
|
size: "sm",
|
|
1407
1411
|
onClick: m,
|
|
1408
|
-
children:
|
|
1412
|
+
children: o.confirm
|
|
1409
1413
|
})
|
|
1410
1414
|
})
|
|
1411
1415
|
]
|
|
@@ -1413,71 +1417,71 @@ function Xe({ filter: e, value: t, onFilterChange: r, onBackToFilterList: i, onC
|
|
|
1413
1417
|
}
|
|
1414
1418
|
//#endregion
|
|
1415
1419
|
//#region src/components/features/filters/partials/filter-popover-content.tsx
|
|
1416
|
-
function
|
|
1417
|
-
let { strings: d } =
|
|
1420
|
+
function at({ activeFilterInPopover: e, availableFilters: t, activeFilters: n, getFilterValue: i, setFilterValue: a, onFilterSelect: o, onBackToFilterList: s, onClose: c, triggerSource: l = "chip", finalFocus: u }) {
|
|
1421
|
+
let { strings: d } = $(), f = e?.type === Z.DATE || e?.type === Z.TAGS ? "w-auto min-w-80 gap-0 overflow-hidden" : e?.type === Z.ASYNC_SELECT ? "w-72 gap-0 overflow-hidden" : "w-64 gap-0 overflow-hidden", p = (e, t) => {
|
|
1418
1422
|
a(e, t);
|
|
1419
1423
|
};
|
|
1420
|
-
return /* @__PURE__ */
|
|
1424
|
+
return /* @__PURE__ */ J(ee, {
|
|
1421
1425
|
finalFocus: u,
|
|
1422
|
-
type: e?.type ===
|
|
1426
|
+
type: e?.type === Z.DATE || e?.type === Z.TAGS ? "display" : "menu",
|
|
1423
1427
|
"aria-label": e?.label ?? d.addFilter,
|
|
1424
1428
|
inset: "flush",
|
|
1425
|
-
className:
|
|
1429
|
+
className: r("filter-popover-content--component", f),
|
|
1426
1430
|
align: "start",
|
|
1427
|
-
children: e ? e.type ===
|
|
1431
|
+
children: e ? e.type === Z.DATE ? /* @__PURE__ */ J(Xe, {
|
|
1428
1432
|
filter: e,
|
|
1429
1433
|
value: i(e.key),
|
|
1430
1434
|
onFilterChange: (t) => p(e.key, t),
|
|
1431
1435
|
onBackToFilterList: s,
|
|
1432
1436
|
triggerSource: l
|
|
1433
|
-
}) : e.type ===
|
|
1437
|
+
}) : e.type === Z.TAGS ? /* @__PURE__ */ J(it, {
|
|
1434
1438
|
filter: e,
|
|
1435
1439
|
value: i(e.key),
|
|
1436
1440
|
onFilterChange: (t) => p(e.key, t),
|
|
1437
1441
|
onBackToFilterList: s,
|
|
1438
1442
|
onClose: c,
|
|
1439
1443
|
triggerSource: l
|
|
1440
|
-
}) : e.type ===
|
|
1444
|
+
}) : e.type === Z.ASYNC_SELECT ? /* @__PURE__ */ J(qe, {
|
|
1441
1445
|
filter: e,
|
|
1442
1446
|
value: i(e.key),
|
|
1443
1447
|
onFilterChange: (t) => p(e.key, t),
|
|
1444
1448
|
onBackToFilterList: s,
|
|
1445
1449
|
onClose: c,
|
|
1446
1450
|
triggerSource: l
|
|
1447
|
-
}) : /* @__PURE__ */
|
|
1451
|
+
}) : /* @__PURE__ */ J(tt, {
|
|
1448
1452
|
filter: e,
|
|
1449
1453
|
value: i(e.key),
|
|
1450
1454
|
onFilterChange: (t) => p(e.key, t),
|
|
1451
1455
|
onBackToFilterList: s,
|
|
1452
1456
|
onClose: c,
|
|
1453
1457
|
triggerSource: l
|
|
1454
|
-
}) : /* @__PURE__ */
|
|
1455
|
-
availableFilters:
|
|
1456
|
-
activeFilters:
|
|
1458
|
+
}) : /* @__PURE__ */ J(et, {
|
|
1459
|
+
availableFilters: t,
|
|
1460
|
+
activeFilters: n,
|
|
1457
1461
|
onFilterSelect: o
|
|
1458
1462
|
})
|
|
1459
1463
|
});
|
|
1460
1464
|
}
|
|
1461
1465
|
//#endregion
|
|
1462
1466
|
//#region src/components/features/filters/partials/filter-pill.tsx
|
|
1463
|
-
function
|
|
1464
|
-
let d =
|
|
1465
|
-
return /* @__PURE__ */
|
|
1467
|
+
function ot({ filter: e, value: t, active: n, operator: r, operators: i, onOperatorChange: a, onValueChange: o, onClear: s, availableFilters: c, activeFilters: l, operatorChangeRef: u }) {
|
|
1468
|
+
let d = G(!1), f = u ?? d, [p, m] = K(!1), h = G(null), g = G(null);
|
|
1469
|
+
return /* @__PURE__ */ J(Qe, {
|
|
1466
1470
|
filterKey: e.key,
|
|
1467
|
-
children: /* @__PURE__ */
|
|
1471
|
+
children: /* @__PURE__ */ Y(F, {
|
|
1468
1472
|
open: p,
|
|
1469
1473
|
onOpenChange: (e) => {
|
|
1470
1474
|
e && f.current || m(e);
|
|
1471
1475
|
},
|
|
1472
|
-
children: [/* @__PURE__ */
|
|
1476
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
1473
1477
|
className: "filter-pill--component filter-pill--anchor relative",
|
|
1474
|
-
children: [/* @__PURE__ */
|
|
1475
|
-
render: /* @__PURE__ */
|
|
1478
|
+
children: [/* @__PURE__ */ J(N, {
|
|
1479
|
+
render: /* @__PURE__ */ J("span", {}),
|
|
1476
1480
|
nativeButton: !1,
|
|
1477
1481
|
tabIndex: -1,
|
|
1478
1482
|
"aria-hidden": "true",
|
|
1479
1483
|
className: "pointer-events-none absolute inset-0"
|
|
1480
|
-
}), /* @__PURE__ */
|
|
1484
|
+
}), /* @__PURE__ */ J(We, {
|
|
1481
1485
|
filter: e,
|
|
1482
1486
|
popoverOpen: p,
|
|
1483
1487
|
triggerRef: h,
|
|
@@ -1497,7 +1501,7 @@ function Qe({ filter: e, value: t, active: n, operator: r, operators: i, onOpera
|
|
|
1497
1501
|
f.current || (g.current = e?.currentTarget ?? h.current, m(!0));
|
|
1498
1502
|
}
|
|
1499
1503
|
})]
|
|
1500
|
-
}), /* @__PURE__ */
|
|
1504
|
+
}), /* @__PURE__ */ J(at, {
|
|
1501
1505
|
finalFocus: g,
|
|
1502
1506
|
activeFilterInPopover: e,
|
|
1503
1507
|
availableFilters: c,
|
|
@@ -1512,42 +1516,42 @@ function Qe({ filter: e, value: t, active: n, operator: r, operators: i, onOpera
|
|
|
1512
1516
|
})
|
|
1513
1517
|
});
|
|
1514
1518
|
}
|
|
1515
|
-
|
|
1519
|
+
ot.displayName = "FilterPill";
|
|
1516
1520
|
//#endregion
|
|
1517
1521
|
//#region src/components/features/filters/partials/filters-button.tsx
|
|
1518
|
-
function
|
|
1519
|
-
let [
|
|
1520
|
-
return
|
|
1521
|
-
|
|
1522
|
-
}, [
|
|
1523
|
-
open:
|
|
1524
|
-
onOpenChange:
|
|
1525
|
-
children: [/* @__PURE__ */
|
|
1522
|
+
function st({ triggerRef: e, availableFilters: n, activeFilters: i, activeFilterInPopover: a, getFilterValue: o, setFilterValue: c, setActiveFilterInPopover: l }) {
|
|
1523
|
+
let { defaultScale: u } = t(), d = O(void 0, u), [f, p] = K(!1), { strings: m } = $();
|
|
1524
|
+
return U(() => {
|
|
1525
|
+
f || l(null);
|
|
1526
|
+
}, [f, l]), /* @__PURE__ */ Y(F, {
|
|
1527
|
+
open: f,
|
|
1528
|
+
onOpenChange: p,
|
|
1529
|
+
children: [/* @__PURE__ */ J(N, {
|
|
1526
1530
|
asChild: !0,
|
|
1527
|
-
children: /* @__PURE__ */
|
|
1531
|
+
children: /* @__PURE__ */ J(s, {
|
|
1528
1532
|
ref: e,
|
|
1529
1533
|
tone: "secondary",
|
|
1530
1534
|
buttonStyle: "outline",
|
|
1531
|
-
size:
|
|
1535
|
+
size: d,
|
|
1532
1536
|
iconOnly: !0,
|
|
1533
|
-
"aria-label":
|
|
1534
|
-
className: "filters-button--component shrink-0",
|
|
1535
|
-
children: /* @__PURE__ */
|
|
1537
|
+
"aria-label": m.addFilter,
|
|
1538
|
+
className: r("filters-button--component shrink-0", k[d], L[d]),
|
|
1539
|
+
children: /* @__PURE__ */ J(he, { className: "size-icon-sm" })
|
|
1536
1540
|
})
|
|
1537
|
-
}), /* @__PURE__ */
|
|
1538
|
-
activeFilterInPopover:
|
|
1539
|
-
availableFilters:
|
|
1540
|
-
activeFilters:
|
|
1541
|
-
getFilterValue:
|
|
1542
|
-
setFilterValue:
|
|
1541
|
+
}), /* @__PURE__ */ J(at, {
|
|
1542
|
+
activeFilterInPopover: a,
|
|
1543
|
+
availableFilters: n,
|
|
1544
|
+
activeFilters: i,
|
|
1545
|
+
getFilterValue: o,
|
|
1546
|
+
setFilterValue: c,
|
|
1543
1547
|
onFilterSelect: (e) => {
|
|
1544
|
-
|
|
1548
|
+
l(e);
|
|
1545
1549
|
},
|
|
1546
1550
|
onBackToFilterList: () => {
|
|
1547
|
-
|
|
1551
|
+
l(null);
|
|
1548
1552
|
},
|
|
1549
1553
|
onClose: () => {
|
|
1550
|
-
|
|
1554
|
+
l(null), p(!1);
|
|
1551
1555
|
},
|
|
1552
1556
|
triggerSource: "toolbar"
|
|
1553
1557
|
})]
|
|
@@ -1555,73 +1559,72 @@ function $e({ triggerRef: e, availableFilters: t, activeFilters: r, activeFilter
|
|
|
1555
1559
|
}
|
|
1556
1560
|
//#endregion
|
|
1557
1561
|
//#region src/components/features/filters/partials/filter-tabs.tsx
|
|
1558
|
-
function
|
|
1559
|
-
let { activeFilters:
|
|
1562
|
+
function ct({ tabs: e }) {
|
|
1563
|
+
let { activeFilters: t, filters: n, replaceFilters: i } = $(), a = W(() => t.filter((e) => n.find((t) => t.key === e.key)?.type !== Z.SEARCH), [t, n]), s = W(() => t.filter((e) => n.find((t) => t.key === e.key)?.type === Z.SEARCH), [t, n]), c = W(() => {
|
|
1560
1564
|
for (let t of e) {
|
|
1561
1565
|
if (t.presets.length === 0) {
|
|
1562
|
-
if (
|
|
1566
|
+
if (a.length === 0) return t.id;
|
|
1563
1567
|
continue;
|
|
1564
1568
|
}
|
|
1565
|
-
if (t.presets.length ===
|
|
1566
|
-
let t =
|
|
1569
|
+
if (t.presets.length === a.length && t.presets.every((e) => {
|
|
1570
|
+
let t = a.find((t) => t.key === e.key);
|
|
1567
1571
|
if (!t) return !1;
|
|
1568
1572
|
let n = [...e.value].sort(), r = [...t.value].sort();
|
|
1569
1573
|
return !(n.length !== r.length || n.some((e, t) => e !== r[t]) || e.operator && t.operator !== e.operator);
|
|
1570
1574
|
})) return t.id;
|
|
1571
1575
|
}
|
|
1572
1576
|
return null;
|
|
1573
|
-
}, [e,
|
|
1577
|
+
}, [e, a]), l = H((e) => {
|
|
1574
1578
|
if (e.presets.length === 0) {
|
|
1575
|
-
|
|
1579
|
+
i([...s]);
|
|
1576
1580
|
return;
|
|
1577
1581
|
}
|
|
1578
1582
|
let t = e.presets.map((e) => {
|
|
1579
|
-
let t =
|
|
1583
|
+
let t = n.find((t) => t.key === e.key), r = e.operator ?? t?.operator ?? (t ? je(t.type) : "equals");
|
|
1580
1584
|
return {
|
|
1581
1585
|
id: e.key,
|
|
1582
1586
|
key: e.key,
|
|
1583
1587
|
value: e.value,
|
|
1584
|
-
operator:
|
|
1588
|
+
operator: r
|
|
1585
1589
|
};
|
|
1586
1590
|
});
|
|
1587
|
-
|
|
1591
|
+
i([...s, ...t]);
|
|
1588
1592
|
}, [
|
|
1589
|
-
|
|
1593
|
+
n,
|
|
1590
1594
|
s,
|
|
1591
|
-
|
|
1595
|
+
i
|
|
1592
1596
|
]);
|
|
1593
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
1597
|
+
return e.length === 0 ? null : /* @__PURE__ */ J(ne, {
|
|
1594
1598
|
value: c,
|
|
1595
1599
|
onValueChange: (t) => {
|
|
1596
1600
|
let n = e.find((e) => e.id === t);
|
|
1597
1601
|
n && l(n);
|
|
1598
1602
|
},
|
|
1599
1603
|
className: "filter-tabs--component",
|
|
1600
|
-
children: /* @__PURE__ */
|
|
1604
|
+
children: /* @__PURE__ */ J(B, {
|
|
1601
1605
|
role: "group",
|
|
1602
1606
|
"aria-orientation": void 0,
|
|
1603
1607
|
activateOnFocus: !0,
|
|
1604
1608
|
className: "h-auto! flex-wrap justify-start gap-space-md bg-transparent p-0",
|
|
1605
1609
|
children: e.map((e) => {
|
|
1606
|
-
let
|
|
1607
|
-
return /* @__PURE__ */
|
|
1610
|
+
let t = c === e.id;
|
|
1611
|
+
return /* @__PURE__ */ Y(z, {
|
|
1608
1612
|
value: e.id,
|
|
1609
1613
|
role: "button",
|
|
1610
1614
|
"aria-selected": void 0,
|
|
1611
1615
|
"aria-controls": void 0,
|
|
1612
|
-
"aria-pressed":
|
|
1613
|
-
className:
|
|
1614
|
-
children: [/* @__PURE__ */
|
|
1616
|
+
"aria-pressed": t,
|
|
1617
|
+
className: r("h-action-sm flex-none gap-space-sm rounded-inner px-control-sm py-0 transition-colors after:hidden data-active:bg-secondary data-active:text-secondary-foreground data-active:hover:bg-secondary data-active:hover:text-secondary-foreground", t ? "bg-secondary text-secondary-foreground" : "text-muted-foreground hover:bg-accent hover:text-accent-foreground"),
|
|
1618
|
+
children: [/* @__PURE__ */ J(o, {
|
|
1615
1619
|
tag: "span",
|
|
1616
|
-
weight: "
|
|
1620
|
+
weight: "medium",
|
|
1617
1621
|
className: "text-inherit",
|
|
1618
1622
|
children: e.label
|
|
1619
|
-
}), e.count !== void 0 && /* @__PURE__ */
|
|
1623
|
+
}), e.count !== void 0 && /* @__PURE__ */ J(o, {
|
|
1620
1624
|
tag: "span",
|
|
1621
1625
|
size: "xs",
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
className: t("ml-space-sm text-inherit", n ? "text-background" : "text-muted-foreground"),
|
|
1626
|
+
type: "secondary",
|
|
1627
|
+
className: "tabular-nums",
|
|
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 = V.forwardRef(function(e, t) {
|
|
1638
|
+
return /* @__PURE__ */ J(ge, {
|
|
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 } = $(), [s, c] = K(t[0] || ""), l = G(s);
|
|
1646
|
+
U(() => {
|
|
1647
|
+
l.current = s;
|
|
1648
|
+
}, [s]);
|
|
1649
|
+
let u = G(t[0] || null), d = G(!1);
|
|
1650
|
+
U(() => {
|
|
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 = ie((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
|
-
return /* @__PURE__ */
|
|
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
|
-
]
|
|
1664
|
+
return /* @__PURE__ */ J("div", {
|
|
1665
|
+
className: r("search-facet--component", "search-facet relative w-full min-w-0 rounded-inner bg-background", i),
|
|
1666
|
+
children: /* @__PURE__ */ J(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" ? X(a.searchPlaceholder, { filterLabel: "" }).replace(/\s+([….?!])/g, "$1").replace(/\s{2,}/g, " ").trim() : X(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 = V.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: i }) {
|
|
1698
|
+
return /* @__PURE__ */ J(q, { children: e.map((e) => /* @__PURE__ */ Y(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, i),
|
|
1701
|
+
children: [/* @__PURE__ */ J(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__ */ J(o, {
|
|
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: _ } =
|
|
1721
|
+
function ht({ className: e, dynamicFilterOptions: t = {}, loadingFilters: n = {}, variant: i = "default", showClearFilters: a = !1, tabs: c }) {
|
|
1722
|
+
let { getFilterValue: u, setFilterValue: d, isFilterActive: f, clearFilters: p, getFilterOperator: m, setFilterOperator: h, isNavigating: g, strings: _ } = $(), { processedFilters: v, searchFilters: y, alwaysVisibleFilters: b, activeRegularFilters: x, popoverFilters: S, hasActive: C } = Fe({ dynamicFilterOptions: t }), [w, T] = K(null), E = v.find((e) => e.key === w) ?? null, D = H((e) => {
|
|
1728
1723
|
T(e?.key ?? null);
|
|
1729
1724
|
}, []);
|
|
1730
|
-
|
|
1725
|
+
U(() => {
|
|
1731
1726
|
w !== null && E === null && T(null);
|
|
1732
1727
|
}, [w, E]);
|
|
1733
|
-
let O =
|
|
1728
|
+
let O = G(null), k = G(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
|
+
U(() => {
|
|
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 : Ae(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__ */ Y(l, {
|
|
1743
|
+
gap: pt[i],
|
|
1744
|
+
className: r("filter-layout--component", e),
|
|
1745
|
+
children: [!!c && c.length > 0 && /* @__PURE__ */ J(ct, { tabs: c }), /* @__PURE__ */ Y(l, {
|
|
1751
1746
|
direction: "horizontal",
|
|
1752
|
-
|
|
1753
|
-
|
|
1747
|
+
align: "center",
|
|
1748
|
+
gap: mt[i],
|
|
1749
|
+
children: [/* @__PURE__ */ J(Qe, {
|
|
1754
1750
|
filterKey: "search-filters",
|
|
1755
|
-
children: /* @__PURE__ */
|
|
1751
|
+
children: /* @__PURE__ */ J(ft, {
|
|
1756
1752
|
filters: y,
|
|
1757
1753
|
getFilterValue: u,
|
|
1758
1754
|
setFilterValue: d
|
|
1759
1755
|
})
|
|
1760
|
-
}), /* @__PURE__ */
|
|
1761
|
-
className:
|
|
1756
|
+
}), /* @__PURE__ */ Y("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__ */ Y(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__ */ J("div", { className: "border-muted-foreground/30 border-t-primary size-icon-sm animate-spin rounded-full border-2" }), /* @__PURE__ */ J(o, {
|
|
1771
1767
|
tag: "span",
|
|
1772
1768
|
type: "secondary",
|
|
1773
|
-
children:
|
|
1769
|
+
children: X(_.loadingOptions, { filterLabel: t })
|
|
1774
1770
|
})]
|
|
1775
1771
|
}, `loading-${e}`);
|
|
1776
1772
|
}),
|
|
1777
|
-
[...b, ...x].map((e) => /* @__PURE__ */
|
|
1773
|
+
[...b, ...x].map((e) => /* @__PURE__ */ J(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__ */ J(Qe, {
|
|
1790
1786
|
filterKey: "filters-button",
|
|
1791
|
-
children: /* @__PURE__ */
|
|
1787
|
+
children: /* @__PURE__ */ J(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
|
+
!!a && C && /* @__PURE__ */ J(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(Q));
|
|
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 ?? je(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
|
|
1862
|
-
return e.type ===
|
|
1856
|
+
function Dt(e) {
|
|
1857
|
+
return e.type === Z.MULTI_SELECT || e.type === Z.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: i, className: a }) {
|
|
1895
|
+
let { defaultScale: c } = t(), l = O(void 0, c), { strings: u } = $(), [d, f] = K(!1), [p, m] = K(""), h = n.length > 0, g = e.options, _ = (t) => {
|
|
1896
|
+
e.multiple ? n.includes(t) ? i(n.filter((e) => e !== t)) : i([...n, t]) : (i([t]), e.closeOnSelect !== !1 && f(!1));
|
|
1897
|
+
}, v = (e) => g?.find((t) => t.value === e)?.label ?? e, y = W(() => (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 = X(u.searchPlaceholder, { filterLabel: e.label.toLowerCase() });
|
|
1905
|
+
return /* @__PURE__ */ J("div", {
|
|
1906
|
+
className: r("select-facet--component", "relative", a),
|
|
1907
|
+
children: /* @__PURE__ */ J(re, {
|
|
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__ */ Y(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__ */ J(o, {
|
|
1931
1926
|
tag: "span",
|
|
1932
1927
|
weight: "semibold",
|
|
1933
1928
|
className: "truncate",
|
|
1934
|
-
children:
|
|
1935
|
-
}) : /* @__PURE__ */
|
|
1929
|
+
children: v(n[0])
|
|
1930
|
+
}) : /* @__PURE__ */ J(o, {
|
|
1936
1931
|
tag: "span",
|
|
1937
1932
|
weight: "semibold",
|
|
1938
|
-
children:
|
|
1939
|
-
count:
|
|
1940
|
-
filterLabel: (
|
|
1933
|
+
children: X(u.selected, {
|
|
1934
|
+
count: n.length,
|
|
1935
|
+
filterLabel: (n.length > 1 ? e.pluralLabel : e.label) ?? e.label
|
|
1941
1936
|
})
|
|
1942
|
-
}) : /* @__PURE__ */
|
|
1937
|
+
}) : /* @__PURE__ */ J(o, {
|
|
1943
1938
|
tag: "span",
|
|
1944
1939
|
type: "secondary",
|
|
1945
|
-
children: e.placeholder ??
|
|
1946
|
-
}), /* @__PURE__ */
|
|
1940
|
+
children: e.placeholder ?? u.select
|
|
1941
|
+
}), /* @__PURE__ */ J(me, { 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: i, className: a }) {
|
|
1951
|
+
let { defaultScale: c } = t(), f = O(void 0, c), { strings: p, cacheAsyncOptions: m, getAsyncOptionLabel: h, reportError: g } = $(), [_, v] = K(!1), [y, T] = K(""), k = W(() => /* @__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: L, minQueryLength: R } = Ke(e, y, _, { onError: g });
|
|
1956
|
+
U(() => {
|
|
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 te = e.multiple !== !1, z = e.maxSelected, B = W(() => e.options ?? [], [e.options]), ne = W(() => {
|
|
1968
|
+
let t = new Set(n), r = new Set([...B, ...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 = B.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
|
+
...B,
|
|
1989
|
+
...A
|
|
1995
1990
|
].sort((e, n) => +!t.has(e.value) - !t.has(n.value));
|
|
1996
1991
|
}, [
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
1992
|
+
B,
|
|
1993
|
+
A,
|
|
1994
|
+
n,
|
|
2000
1995
|
e.key,
|
|
2001
1996
|
e.icon,
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
]),
|
|
2005
|
-
if (
|
|
2006
|
-
if (
|
|
1997
|
+
k,
|
|
1998
|
+
h
|
|
1999
|
+
]), re = (t) => {
|
|
2000
|
+
if (te) {
|
|
2001
|
+
if (n.includes(t)) i(n.filter((e) => e !== t));
|
|
2007
2002
|
else {
|
|
2008
|
-
if (
|
|
2009
|
-
|
|
2003
|
+
if (z && n.length >= z) return;
|
|
2004
|
+
i([...n, t]);
|
|
2010
2005
|
}
|
|
2011
|
-
} else
|
|
2012
|
-
},
|
|
2013
|
-
let n =
|
|
2006
|
+
} else i([t]), e.closeOnSelect !== !1 && v(!1);
|
|
2007
|
+
}, ie = (t) => {
|
|
2008
|
+
let n = A.find((e) => e.value === t);
|
|
2014
2009
|
if (n) return n.label;
|
|
2015
|
-
let r =
|
|
2010
|
+
let r = B.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
|
+
}, ae = n.length > 0, V = W(() => j || M ? /* @__PURE__ */ J(u, {
|
|
2020
2015
|
className: "async-select-facet--component",
|
|
2021
|
-
label:
|
|
2022
|
-
}) :
|
|
2016
|
+
label: p.searching
|
|
2017
|
+
}) : P ? /* @__PURE__ */ J(d, {
|
|
2023
2018
|
variant: "inline",
|
|
2024
|
-
title:
|
|
2025
|
-
action: /* @__PURE__ */
|
|
2019
|
+
title: p.fetchError,
|
|
2020
|
+
action: /* @__PURE__ */ J(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
|
+
}) : L ? /* @__PURE__ */ J("div", {
|
|
2035
2030
|
className: "text-muted-foreground flex items-center justify-center py-space-xl",
|
|
2036
|
-
children: /* @__PURE__ */
|
|
2031
|
+
children: /* @__PURE__ */ J(o, {
|
|
2037
2032
|
tag: "span",
|
|
2038
2033
|
size: "xs",
|
|
2039
2034
|
type: "secondary",
|
|
2040
|
-
children:
|
|
2035
|
+
children: X(p.minQueryHint, { min: R })
|
|
2041
2036
|
})
|
|
2042
|
-
}) : /* @__PURE__ */
|
|
2037
|
+
}) : /* @__PURE__ */ J(o, {
|
|
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
|
+
L,
|
|
2046
|
+
R,
|
|
2047
|
+
p,
|
|
2048
|
+
I
|
|
2054
2049
|
]);
|
|
2055
|
-
return /* @__PURE__ */
|
|
2056
|
-
className:
|
|
2057
|
-
children: /* @__PURE__ */
|
|
2058
|
-
open:
|
|
2050
|
+
return /* @__PURE__ */ J("div", {
|
|
2051
|
+
className: r("async-select-facet--component relative", a),
|
|
2052
|
+
children: /* @__PURE__ */ Y(F, {
|
|
2053
|
+
open: _,
|
|
2059
2054
|
onOpenChange: (e) => {
|
|
2060
|
-
|
|
2055
|
+
v(e), e || T("");
|
|
2061
2056
|
},
|
|
2062
|
-
children: [/* @__PURE__ */
|
|
2057
|
+
children: [/* @__PURE__ */ J(N, { render: /* @__PURE__ */ Y(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: [ae ? n.length === 1 ? /* @__PURE__ */ J(o, {
|
|
2070
2065
|
tag: "span",
|
|
2071
2066
|
weight: "semibold",
|
|
2072
2067
|
className: "truncate",
|
|
2073
|
-
children:
|
|
2074
|
-
}) : /* @__PURE__ */
|
|
2068
|
+
children: ie(n[0])
|
|
2069
|
+
}) : /* @__PURE__ */ J(o, {
|
|
2075
2070
|
tag: "span",
|
|
2076
2071
|
weight: "semibold",
|
|
2077
|
-
children:
|
|
2078
|
-
count:
|
|
2079
|
-
filterLabel: (
|
|
2072
|
+
children: X(p.selected, {
|
|
2073
|
+
count: n.length,
|
|
2074
|
+
filterLabel: (n.length > 1 ? e.pluralLabel : e.label) ?? e.label
|
|
2080
2075
|
})
|
|
2081
|
-
}) : /* @__PURE__ */
|
|
2076
|
+
}) : /* @__PURE__ */ J(o, {
|
|
2082
2077
|
tag: "span",
|
|
2083
2078
|
type: "secondary",
|
|
2084
|
-
children: e.placeholder ??
|
|
2085
|
-
}), /* @__PURE__ */
|
|
2086
|
-
}) }), /* @__PURE__ */
|
|
2079
|
+
children: e.placeholder ?? p.select
|
|
2080
|
+
}), /* @__PURE__ */ J(me, { className: "ml-control-gap-small size-icon-sm shrink-0 opacity-50" })]
|
|
2081
|
+
}) }), /* @__PURE__ */ J(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__ */ Y(E, {
|
|
2091
2086
|
shouldFilter: !1,
|
|
2092
2087
|
inset: "flush",
|
|
2093
2088
|
className: "rounded-none",
|
|
2094
|
-
children: [/* @__PURE__ */
|
|
2095
|
-
placeholder:
|
|
2096
|
-
value:
|
|
2097
|
-
onValueChange:
|
|
2098
|
-
}), /* @__PURE__ */
|
|
2089
|
+
children: [/* @__PURE__ */ J(x, {
|
|
2090
|
+
placeholder: X(p.searchPlaceholder, { filterLabel: e.label }),
|
|
2091
|
+
value: y,
|
|
2092
|
+
onValueChange: T
|
|
2093
|
+
}), /* @__PURE__ */ J(C, { children: ne.length === 0 ? /* @__PURE__ */ J(S, { children: V }) : /* @__PURE__ */ Y(w, { children: [!(!M || j) && /* @__PURE__ */ Y(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__ */ J(ge, { className: "text-muted-foreground size-icon-sm animate-spin" }), /* @__PURE__ */ J(o, {
|
|
2104
2099
|
tag: "span",
|
|
2105
2100
|
size: "xs",
|
|
2106
2101
|
type: "secondary",
|
|
2107
|
-
children:
|
|
2102
|
+
children: p.searching
|
|
2108
2103
|
})]
|
|
2109
|
-
}),
|
|
2104
|
+
}), ne.map((e) => /* @__PURE__ */ Y(b, {
|
|
2110
2105
|
value: e.value,
|
|
2111
|
-
onSelect: () =>
|
|
2112
|
-
disabled: e.disabled || !!
|
|
2106
|
+
onSelect: () => re(e.value),
|
|
2107
|
+
disabled: e.disabled || !!z && n.length >= z && !n.includes(e.value),
|
|
2113
2108
|
children: [
|
|
2114
|
-
/* @__PURE__ */
|
|
2115
|
-
!!e.icon && /* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ J(de, { className: r("mr-control-gap size-icon-sm", n.includes(e.value) ? "opacity-100" : "opacity-0") }),
|
|
2110
|
+
!!e.icon && /* @__PURE__ */ J("span", {
|
|
2116
2111
|
className: "mr-1.5",
|
|
2117
2112
|
children: e.icon
|
|
2118
2113
|
}),
|
|
2119
|
-
/* @__PURE__ */
|
|
2114
|
+
/* @__PURE__ */ J(o, {
|
|
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 } = $(), [s, u] = K(t.min?.toString() ?? ""), [d, f] = K(t.max?.toString() ?? ""), p = le(), m = ie((e) => {
|
|
2129
|
+
(e.min !== t.min || e.max !== t.max) && n(e);
|
|
2135
2130
|
}, e.delay ?? 300);
|
|
2136
|
-
return
|
|
2137
|
-
min:
|
|
2131
|
+
return U(() => (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__ */ J(l, {
|
|
2144
2139
|
gap: "md",
|
|
2145
|
-
className:
|
|
2146
|
-
children: /* @__PURE__ */
|
|
2140
|
+
className: r("range-facet--component", i),
|
|
2141
|
+
children: /* @__PURE__ */ Y(c, {
|
|
2147
2142
|
columns: {
|
|
2148
2143
|
base: 1,
|
|
2149
2144
|
sm: 2
|
|
2150
2145
|
},
|
|
2151
2146
|
gap: "md",
|
|
2152
|
-
children: [/* @__PURE__ */
|
|
2147
|
+
children: [/* @__PURE__ */ Y(l, {
|
|
2153
2148
|
gap: "xs",
|
|
2154
|
-
children: [/* @__PURE__ */
|
|
2149
|
+
children: [/* @__PURE__ */ J(a, {
|
|
2155
2150
|
htmlFor: `${p}-min`,
|
|
2156
|
-
children:
|
|
2157
|
-
}), /* @__PURE__ */
|
|
2151
|
+
children: o.min
|
|
2152
|
+
}), /* @__PURE__ */ J(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__ */ Y(l, {
|
|
2169
2164
|
gap: "xs",
|
|
2170
|
-
children: [/* @__PURE__ */
|
|
2165
|
+
children: [/* @__PURE__ */ J(a, {
|
|
2171
2166
|
htmlFor: `${p}-max`,
|
|
2172
|
-
children:
|
|
2173
|
-
}), /* @__PURE__ */
|
|
2167
|
+
children: o.max
|
|
2168
|
+
}), /* @__PURE__ */ J(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 { Ae as A, Fe as C, Oe as D, ke as E, we as F, Se as I, Ce as L, Te as M, Q as N, je as O, Z as P, X as R, Ie as S, $ as T, Qe as _, jt as a, We as b, kt as c, dt as d, ct as f, rt as g, at as h, Mt as i, Ee as j, De 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, Ye as v, Pe as w, Le as x, Ke as y };
|
|
2202
2197
|
|
|
2203
|
-
//# sourceMappingURL=filters-
|
|
2198
|
+
//# sourceMappingURL=filters-Da-gNPsE.js.map
|