themelia-react-ui 2.0.5 → 3.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 +326 -0
- package/MIGRATION.md +858 -0
- package/README.md +35 -24
- package/dist/{accordion-B9MHG0cT.js → accordion-DNVqwEIC.js} +37 -37
- package/dist/accordion-DNVqwEIC.js.map +1 -0
- package/dist/action-menu-D5343RwT.js +286 -0
- package/dist/action-menu-D5343RwT.js.map +1 -0
- package/dist/ai-artifact-otrz9ZwS.js +1214 -0
- package/dist/ai-artifact-otrz9ZwS.js.map +1 -0
- package/dist/anchored-positioning-1U_eBFNx.js +9 -0
- package/dist/anchored-positioning-1U_eBFNx.js.map +1 -0
- package/dist/app-shell-CPN30Nb1.js +372 -0
- package/dist/app-shell-CPN30Nb1.js.map +1 -0
- package/dist/{attachment-Dg_69lPS.js → attachment-D2-fpfmv.js} +15 -15
- package/dist/{attachment-Dg_69lPS.js.map → attachment-D2-fpfmv.js.map} +1 -1
- package/dist/{auth-DTkkshS8.js → auth-g_oUTDDC.js} +236 -243
- package/dist/auth-g_oUTDDC.js.map +1 -0
- package/dist/{avatar-CeZaFmNH.js → avatar-Ca3Ihrq4.js} +4 -4
- package/dist/{avatar-CeZaFmNH.js.map → avatar-Ca3Ihrq4.js.map} +1 -1
- package/dist/{badge-xIiV_E7f.js → badge-oGiXblW7.js} +8 -9
- package/dist/badge-oGiXblW7.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/batch-action-bar.js +1 -1
- package/dist/base/buttons.js +2 -2
- package/dist/base/cards.js +3 -3
- package/dist/base/carousel.js +11 -11
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +2 -2
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +1 -1
- package/dist/base/command.js +1 -1
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +2 -2
- package/dist/base/display.js +7 -7
- package/dist/base/feedback.js +4 -4
- package/dist/base/forms-numeric.js +2 -2
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +13 -13
- package/dist/base/inline-edit.js.map +1 -1
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +203 -2
- package/dist/base/media-gallery.js.map +1 -0
- package/dist/base/metadata-list.js +1 -1
- package/dist/base/navigation.js +7 -7
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +32 -22
- package/dist/base/qr-code.js.map +1 -1
- package/dist/base/repeaters.js +208 -198
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sidebar.js +2 -2
- package/dist/base/signature-pad.js +14 -14
- package/dist/base/signature-pad.js.map +1 -1
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +8 -14
- package/dist/base/spinner.js.map +1 -1
- package/dist/base/structure.js +1 -1
- package/dist/base/table.js +1 -1
- package/dist/base/text-inputs.js +3 -3
- package/dist/base/toaster.js +2 -2
- package/dist/base/tree.js +2 -2
- package/dist/base/upload-queue.js +303 -2
- package/dist/base/upload-queue.js.map +1 -0
- package/dist/base/upload.js +3 -4
- package/dist/base/value-inputs.js +1 -1
- package/dist/{batch-action-bar-Cb8cuvyy.js → batch-action-bar-D6MZQNnC.js} +10 -10
- package/dist/{batch-action-bar-Cb8cuvyy.js.map → batch-action-bar-D6MZQNnC.js.map} +1 -1
- package/dist/blocks/admin.js +242 -228
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +398 -354
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/charts.js +1022 -0
- package/dist/blocks/analytics/charts.js.map +1 -0
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +173 -1392
- package/dist/blocks/analytics.js.map +1 -1
- package/dist/blocks/collaboration.js +1 -1
- package/dist/blocks/commerce/receipt.js +1 -1
- package/dist/blocks/commerce.js +1533 -1399
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +2 -3
- package/dist/blocks/onboarding.js +91 -82
- package/dist/blocks/onboarding.js.map +1 -1
- package/dist/blocks/planning.js +25 -25
- package/dist/blocks/planning.js.map +1 -1
- package/dist/blocks/timelines.js +2 -2
- package/dist/breadcrumbs-CQ9JSlez.js +136 -0
- package/dist/breadcrumbs-CQ9JSlez.js.map +1 -0
- package/dist/{button-S2Cubiiz.js → button-rd6FiHfQ.js} +12 -8
- package/dist/button-rd6FiHfQ.js.map +1 -0
- package/dist/{buttons-BedGfygC.js → buttons-pZVgPTZn.js} +230 -246
- package/dist/buttons-pZVgPTZn.js.map +1 -0
- package/dist/{cards-rNX1M4Xn.js → cards-CgWyqvgZ.js} +25 -22
- package/dist/{cards-rNX1M4Xn.js.map → cards-CgWyqvgZ.js.map} +1 -1
- package/dist/cascader-Cf05pwaq.js +444 -0
- package/dist/cascader-Cf05pwaq.js.map +1 -0
- package/dist/{chart-Darg_0Kv.js → chart-CygRCyIZ.js} +5 -5
- package/dist/{chart-Darg_0Kv.js.map → chart-CygRCyIZ.js.map} +1 -1
- package/dist/{checkbox-fflqmODR.js → checkbox-Dy5_XBMZ.js} +4 -4
- package/dist/{checkbox-fflqmODR.js.map → checkbox-Dy5_XBMZ.js.map} +1 -1
- package/dist/{choice-inputs-zUgBZfE4.js → choice-inputs-oJEsrb5Y.js} +195 -184
- package/dist/choice-inputs-oJEsrb5Y.js.map +1 -0
- package/dist/{code-block-BzmM9Eig.js → code-block-BrLD7mCi.js} +44 -60
- package/dist/code-block-BrLD7mCi.js.map +1 -0
- package/dist/collapsible-CRCCg_bO.js +80 -0
- package/dist/collapsible-CRCCg_bO.js.map +1 -0
- package/dist/{collection-content-gDh1v6O4.js → collection-content-D7SoDlYd.js} +3 -3
- package/dist/{collection-content-gDh1v6O4.js.map → collection-content-D7SoDlYd.js.map} +1 -1
- package/dist/combobox-Dl6f6kHz.js +362 -0
- package/dist/combobox-Dl6f6kHz.js.map +1 -0
- package/dist/combobox-DrDXtSSt.js +929 -0
- package/dist/combobox-DrDXtSSt.js.map +1 -0
- package/dist/command-CjZ2VzKC.js +432 -0
- package/dist/command-CjZ2VzKC.js.map +1 -0
- package/dist/comments-C2MZyRmh.js +1214 -0
- package/dist/comments-C2MZyRmh.js.map +1 -0
- package/dist/components/base/accordion/accordion.d.ts +11 -3
- package/dist/components/base/action-menu/action-menu.d.ts +11 -3
- package/dist/components/base/buttons/button.d.ts +2 -2
- package/dist/components/base/buttons/index.d.ts +1 -1
- package/dist/components/base/buttons/loader-button.d.ts +6 -15
- package/dist/components/base/cards/index.d.ts +1 -1
- package/dist/components/base/cards/partials/card-body-context.d.ts +6 -0
- package/dist/components/base/cards/smart-card.d.ts +0 -2
- package/dist/components/base/cards/smart-card.types.d.ts +12 -10
- package/dist/components/base/cascader/cascader.d.ts +8 -2
- package/dist/components/base/cascader/cascader.types.d.ts +24 -2
- package/dist/components/base/cascader/index.d.ts +1 -1
- package/dist/components/base/choice-inputs/choice-types.d.ts +4 -0
- package/dist/components/base/choice-inputs/pill-radio-group.d.ts +7 -6
- package/dist/components/base/choice-inputs/switch.d.ts +1 -1
- package/dist/components/base/code-block/use-code-copy.d.ts +2 -6
- package/dist/components/base/combobox/combobox-field.d.ts +2 -2
- package/dist/components/base/command/command.d.ts +1 -1
- package/dist/components/base/date-pickers/date-picker-internals.d.ts +3 -1
- package/dist/components/base/date-pickers/datepicker.types.d.ts +11 -7
- package/dist/components/base/date-pickers/time-picker.d.ts +17 -3
- package/dist/components/base/display/dialog.d.ts +3 -9
- package/dist/components/base/display/index.d.ts +2 -3
- package/dist/components/base/display/separator.d.ts +1 -1
- package/dist/components/base/feedback/alert.d.ts +2 -1
- package/dist/components/base/feedback/empty.d.ts +10 -2
- package/dist/components/base/feedback/state-display.d.ts +5 -1
- package/dist/components/base/feedback/state-display.strings.d.ts +9 -0
- package/dist/components/base/forms/form-field.d.ts +7 -2
- package/dist/components/base/forms/workflow.d.ts +2 -2
- package/dist/components/base/forms-numeric/coordinates-input.d.ts +4 -1
- package/dist/components/base/forms-numeric/decimal-input.d.ts +2 -2
- package/dist/components/base/forms-numeric/dimensions-input.d.ts +13 -18
- package/dist/components/base/forms-numeric/index.d.ts +3 -3
- package/dist/components/base/forms-numeric/numeric-composite-field.d.ts +12 -0
- package/dist/components/base/forms-numeric/weight-input.d.ts +6 -1
- package/dist/components/base/item/item.types.d.ts +6 -2
- package/dist/components/base/metadata-list/index.d.ts +1 -3
- package/dist/components/base/metadata-list/metadata-list.d.ts +4 -1
- package/dist/components/base/navigation/index.d.ts +2 -2
- package/dist/components/base/navigation/language-switcher.d.ts +17 -8
- package/dist/components/base/navigation/navigation-tabs.d.ts +8 -1
- package/dist/components/base/navigation/page-header/index.d.ts +1 -1
- package/dist/components/base/navigation/page-header/page-header.d.ts +13 -17
- package/dist/components/base/navigation/pagination.d.ts +5 -5
- package/dist/components/base/popover/popover.recipes.d.ts +0 -1
- package/dist/components/base/qr-code/qr-code.d.ts +4 -0
- package/dist/components/base/repeaters/index.d.ts +1 -1
- package/dist/components/base/repeaters/key-value-editor.d.ts +6 -1
- package/dist/components/base/sheet/sheet.d.ts +6 -15
- package/dist/components/base/sidebar/index.d.ts +1 -6
- package/dist/components/base/sidebar/sidebar.d.ts +40 -10
- package/dist/components/base/skeleton/skeleton.d.ts +1 -1
- package/dist/components/base/structure/structure.types.d.ts +11 -2
- package/dist/components/base/text-inputs/index.d.ts +1 -1
- package/dist/components/base/tree/index.d.ts +1 -0
- package/dist/components/base/tree/tree.d.ts +2 -2
- package/dist/components/base/tree/tree.types.d.ts +7 -1
- package/dist/components/base/upload/avatar-upload.d.ts +2 -1
- package/dist/components/base/upload/file-upload.validation.d.ts +37 -1
- package/dist/components/base/upload/image-upload.d.ts +4 -1
- package/dist/components/base/upload/index.d.ts +3 -9
- package/dist/components/base/value-inputs/date-time-input.d.ts +4 -0
- package/dist/components/base/value-inputs/slider.d.ts +5 -2
- package/dist/components/blocks/admin/action-surfaces/index.d.ts +17 -4
- package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +9 -3
- package/dist/components/blocks/admin/index.d.ts +1 -1
- package/dist/components/blocks/ai/ai-artifact/ai-artifact.d.ts +1 -1
- package/dist/components/blocks/ai/ai-artifact/types.d.ts +9 -4
- package/dist/components/blocks/ai/ai-chain-of-thought/ai-chain-of-thought.d.ts +1 -1
- package/dist/components/blocks/ai/ai-chain-of-thought/types.d.ts +11 -1
- package/dist/components/blocks/ai/ai-citation/ai-citation.d.ts +1 -1
- package/dist/components/blocks/ai/ai-citation/types.d.ts +8 -0
- package/dist/components/blocks/ai/ai-confirmation/ai-confirmation.d.ts +1 -1
- package/dist/components/blocks/ai/ai-confirmation/types.d.ts +21 -5
- package/dist/components/blocks/ai/ai-feedback/types.d.ts +7 -2
- package/dist/components/blocks/ai/ai-inline-citation/types.d.ts +9 -3
- package/dist/components/blocks/ai/ai-package-info/ai-package-info.d.ts +1 -1
- package/dist/components/blocks/ai/ai-package-info/types.d.ts +6 -0
- package/dist/components/blocks/ai/ai-reasoning/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-sources/ai-sources.d.ts +1 -1
- package/dist/components/blocks/ai/ai-sources/types.d.ts +10 -2
- package/dist/components/blocks/ai/ai-task/ai-task.d.ts +1 -1
- package/dist/components/blocks/ai/ai-task/types.d.ts +10 -1
- package/dist/components/blocks/ai/ai-tool-call/ai-tool-call.d.ts +1 -1
- package/dist/components/blocks/ai/ai-tool-call/types.d.ts +8 -0
- package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
- package/dist/components/blocks/analytics/activity-heatmap/types.d.ts +1 -1
- package/dist/components/blocks/analytics/analytics.strings.d.ts +2 -0
- package/dist/components/blocks/analytics/atoms/metric-trend-chip.d.ts +11 -1
- package/dist/components/blocks/analytics/chart-card/chart-card.d.ts +7 -5
- package/dist/components/blocks/analytics/charts/index.d.ts +27 -0
- package/dist/components/blocks/analytics/index.d.ts +17 -24
- package/dist/components/blocks/analytics/metric/metric.d.ts +7 -3
- package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +2 -0
- package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +4 -5
- package/dist/components/blocks/analytics/types.d.ts +13 -4
- package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
- package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
- package/dist/components/blocks/commerce/address-card/types.d.ts +5 -16
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +2 -2
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +6 -4
- package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +0 -2
- package/dist/components/blocks/commerce/cart-summary/index.d.ts +2 -2
- package/dist/components/blocks/commerce/cart-summary/types.d.ts +9 -11
- package/dist/components/blocks/commerce/coupon-input/coupon-input.d.ts +1 -1
- package/dist/components/blocks/commerce/coupon-input/types.d.ts +7 -3
- package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +0 -2
- package/dist/components/blocks/commerce/discount-stack/index.d.ts +2 -2
- package/dist/components/blocks/commerce/discount-stack/types.d.ts +4 -6
- package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
- package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +2 -0
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-balance.d.ts +18 -0
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-compact.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-copy-button.d.ts +0 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-dark.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-full.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-illustrated.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-minimal.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/types.d.ts +16 -5
- package/dist/components/blocks/commerce/index.d.ts +8 -8
- package/dist/components/blocks/commerce/inventory-level/inventory-level.strings.d.ts +2 -0
- package/dist/components/blocks/commerce/inventory-level/types.d.ts +1 -1
- package/dist/components/blocks/commerce/inventory-section/types.d.ts +0 -5
- package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +6 -3
- package/dist/components/blocks/commerce/loyalty-points/loyalty-points.d.ts +1 -1
- package/dist/components/blocks/commerce/loyalty-points/types.d.ts +11 -5
- package/dist/components/blocks/commerce/order-status/order-status.d.ts +1 -1
- package/dist/components/blocks/commerce/order-status/types.d.ts +12 -8
- package/dist/components/blocks/commerce/order-timeline/order-timeline.d.ts +1 -1
- package/dist/components/blocks/commerce/order-timeline/types.d.ts +3 -1
- package/dist/components/blocks/commerce/payment-method/index.d.ts +2 -2
- package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +0 -8
- package/dist/components/blocks/commerce/payment-method/types.d.ts +0 -2
- package/dist/components/blocks/commerce/receipt/index.d.ts +1 -1
- package/dist/components/blocks/commerce/receipt/receipt-items.d.ts +1 -1
- package/dist/components/blocks/commerce/receipt/types.d.ts +10 -0
- package/dist/components/blocks/commerce/refund-status/index.d.ts +2 -2
- package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +0 -2
- package/dist/components/blocks/commerce/refund-status/types.d.ts +0 -2
- package/dist/components/blocks/commerce/seo-listing/types.d.ts +7 -0
- package/dist/components/blocks/commerce/shared/code-entry.d.ts +39 -0
- package/dist/components/blocks/commerce/shared/order-status.d.ts +1 -1
- package/dist/components/blocks/commerce/subscription-summary/subscription-summary.d.ts +1 -1
- package/dist/components/blocks/commerce/subscription-summary/types.d.ts +10 -1
- package/dist/components/blocks/commerce/upcoming-booking/index.d.ts +2 -1
- package/dist/components/blocks/commerce/upcoming-booking/types.d.ts +8 -0
- package/dist/components/blocks/commerce/upcoming-booking/upcoming-booking.d.ts +2 -2
- package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -5
- package/dist/components/blocks/commerce/voucher-entry/types.d.ts +6 -3
- package/dist/components/blocks/commerce/voucher-entry/voucher-entry.d.ts +1 -1
- package/dist/components/blocks/content-block-hooks.d.ts +22 -0
- package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +5 -1
- package/dist/components/blocks/data-display/dense-info-card/helpers.d.ts +3 -1
- package/dist/components/blocks/data-display/dense-info-card/index.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-classification.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-dashboard.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-financial.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-project.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-score.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/types.d.ts +12 -5
- package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +10 -3
- package/dist/components/blocks/data-display/index.d.ts +0 -1
- package/dist/components/blocks/data-display/relationship-card-frame.d.ts +1 -1
- package/dist/components/blocks/onboarding/checklist/checklist.types.d.ts +5 -3
- package/dist/components/blocks/planning/task-card.types.d.ts +7 -3
- package/dist/components/blocks/timelines/changelog/types.d.ts +2 -2
- package/dist/components/blocks/timelines/index.d.ts +2 -2
- package/dist/components/blocks/timelines/milestones/types.d.ts +2 -2
- package/dist/components/blocks/timelines/shared/timeline.d.ts +6 -0
- package/dist/components/blocks/timelines/steps-card/index.d.ts +2 -1
- package/dist/components/blocks/timelines/steps-card/steps-card.d.ts +2 -2
- package/dist/components/blocks/timelines/steps-card/types.d.ts +13 -1
- package/dist/components/features/activities/activities.strings.d.ts +5 -3
- package/dist/components/features/activities/activities.types.d.ts +46 -22
- package/dist/components/features/activities/hooks/use-activity-feed.d.ts +6 -0
- package/dist/components/features/activities/hooks/use-activity-resources.d.ts +2 -1
- package/dist/components/features/activities/index.d.ts +1 -1
- package/dist/components/features/activities/partials/activity-headline.d.ts +5 -0
- package/dist/components/features/activities/partials/activity-row.d.ts +12 -13
- package/dist/components/features/activities/partials/row-layers.d.ts +7 -0
- package/dist/components/features/activities/relative-time.d.ts +18 -0
- package/dist/components/features/ai-chat/ai-chat.d.ts +6 -2
- package/dist/components/features/ai-chat/ai-chat.strings.d.ts +41 -2
- package/dist/components/features/ai-chat/ai-chat.types.d.ts +6 -0
- package/dist/components/features/ai-chat/hooks/use-ai-chat-scroll.d.ts +1 -1
- package/dist/components/features/ai-chat/partials/ai-chat-attachments-strip.d.ts +5 -1
- package/dist/components/features/ai-chat/partials/ai-chat-prompt-input.d.ts +2 -2
- package/dist/components/features/ai-chat/partials/ai-chat-queue.d.ts +3 -1
- package/dist/components/features/ai-chat/partials/ai-chat-suggestions-row.d.ts +6 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +20 -4
- package/dist/components/features/appointment-calendar/index.d.ts +1 -1
- package/dist/components/features/appointment-calendar/partials/appointment-agenda.d.ts +18 -10
- package/dist/components/features/async-preview/async-preview.d.ts +2 -2
- package/dist/components/features/async-preview/async-preview.types.d.ts +30 -1
- package/dist/components/features/async-preview/preview-trigger-cell.d.ts +7 -2
- package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
- package/dist/components/features/combobox/combobox.d.ts +12 -3
- package/dist/components/features/combobox/components/error-message.d.ts +3 -1
- package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +4 -3
- package/dist/components/features/combobox/hooks/use-combobox-state.d.ts +1 -0
- package/dist/components/features/combobox/hooks/use-load-more.d.ts +1 -0
- package/dist/components/features/combobox/index.d.ts +1 -1
- package/dist/components/features/combobox/types.d.ts +68 -37
- package/dist/components/features/comments/comments.strings.d.ts +6 -5
- package/dist/components/features/comments/comments.types.d.ts +40 -26
- package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -1
- package/dist/components/features/comments/hooks/use-comments.d.ts +8 -1
- package/dist/components/features/data-view/data-view.strings.d.ts +9 -2
- package/dist/components/features/data-view/data-view.types.d.ts +15 -2
- package/dist/components/features/email-composer/email-html.d.ts +5 -0
- package/dist/components/features/email-composer/http.d.ts +2 -0
- package/dist/components/features/email-composer/strings.d.ts +17 -2
- package/dist/components/features/email-composer/types.d.ts +19 -2
- package/dist/components/features/email-composer/use-composer.d.ts +2 -78
- package/dist/components/features/event-calendar/event-calendar-day-cell.d.ts +1 -1
- package/dist/components/features/event-calendar/event-calendar-event-badge.d.ts +1 -1
- package/dist/components/features/event-calendar/event-calendar-header.d.ts +1 -1
- package/dist/components/features/event-calendar/event-calendar-legend.d.ts +2 -2
- package/dist/components/features/event-calendar/event-calendar.d.ts +1 -1
- package/dist/components/features/event-calendar/event-calendar.types.d.ts +126 -21
- package/dist/components/features/filters/facets/date-facet.d.ts +4 -2
- package/dist/components/features/filters/facets/range-facet.d.ts +24 -7
- package/dist/components/features/filters/filter-context.d.ts +9 -0
- package/dist/components/features/filters/filters.strings.d.ts +36 -3
- package/dist/components/features/filters/filters.types.d.ts +75 -8
- package/dist/components/features/filters/hooks/use-filter-draft.d.ts +1 -0
- package/dist/components/features/filters/index.d.ts +2 -2
- package/dist/components/features/filters/operator-options.d.ts +25 -2
- package/dist/components/features/filters/partials/active-filter-item.d.ts +0 -13
- package/dist/components/features/filters/partials/async-options-status.d.ts +32 -0
- package/dist/components/features/filters/partials/date-filter-content.d.ts +3 -2
- package/dist/components/features/filters/partials/filter-draft-footer.d.ts +11 -0
- package/dist/components/features/filters/partials/filter-operator-select.d.ts +4 -2
- package/dist/components/features/filters/partials/filter-pill.d.ts +5 -1
- package/dist/components/features/filters/partials/filter-popover-content.d.ts +4 -2
- package/dist/components/features/filters/partials/filter-tabs.d.ts +2 -1
- package/dist/components/features/filters/partials/range-filter-content.d.ts +12 -0
- package/dist/components/features/filters/partials/regular-filter-content.d.ts +1 -1
- package/dist/components/features/filters/utils/filter-utils.d.ts +34 -5
- package/dist/components/features/global-search/global-search-dialog.d.ts +7 -1
- package/dist/components/features/global-search/global-search.d.ts +7 -1
- package/dist/components/features/global-search/global-search.strings.d.ts +19 -3
- package/dist/components/features/global-search/global-search.types.d.ts +30 -6
- package/dist/components/features/global-search/index.d.ts +1 -1
- package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +6 -1
- package/dist/components/features/global-search/partials/global-search-input.d.ts +2 -0
- package/dist/components/features/kanban/index.d.ts +2 -2
- package/dist/components/features/kanban/kanban-context.d.ts +4 -0
- package/dist/components/features/kanban/kanban-keyboard.d.ts +7 -2
- package/dist/components/features/kanban/kanban.d.ts +10 -1
- package/dist/components/features/kanban/kanban.strings.d.ts +11 -2
- package/dist/components/features/kanban/kanban.types.d.ts +26 -0
- package/dist/components/features/map/map.d.ts +4 -0
- package/dist/components/features/map/place-autocomplete.d.ts +10 -1
- package/dist/components/features/media-library/hooks/use-media-library.d.ts +3 -1
- package/dist/components/features/media-library/media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.strings.d.ts +39 -3
- package/dist/components/features/media-library/media-library.types.d.ts +82 -9
- package/dist/components/features/media-library/partials/media-library-partials.d.ts +3 -3
- package/dist/components/features/mentions/hooks/use-mentions-search.d.ts +7 -0
- package/dist/components/features/mentions/hooks/use-mentions.d.ts +16 -1
- package/dist/components/features/mentions/index.d.ts +1 -1
- package/dist/components/features/mentions/mentions.strings.d.ts +10 -2
- package/dist/components/features/mentions/partials/mention-chip.d.ts +1 -0
- package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +12 -1
- package/dist/components/features/mentions/partials/mention-picker.d.ts +8 -1
- package/dist/components/features/mentions/partials/mention-search-error.d.ts +6 -0
- package/dist/components/features/mentions/utils/index.d.ts +0 -1
- package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
- package/dist/components/features/overlays/dialog.d.ts +1 -1
- package/dist/components/features/overlays/drawer.d.ts +1 -1
- package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +2 -2
- package/dist/components/features/overlays/index.d.ts +2 -2
- package/dist/components/features/overlays/overlays.strings.d.ts +2 -1
- package/dist/components/features/overlays/overlays.types.d.ts +27 -10
- package/dist/components/features/products/components/index.d.ts +0 -10
- package/dist/components/features/products/components/product-contract-overview.d.ts +1 -1
- package/dist/components/features/products/components/product-details-card.d.ts +1 -1
- package/dist/components/features/products/components/product-operations-card.d.ts +1 -1
- package/dist/components/features/products/components/product-option-action-menu.d.ts +1 -1
- package/dist/components/features/products/components/product-options-summary.d.ts +1 -1
- package/dist/components/features/products/components/product-policies-card.d.ts +1 -1
- package/dist/components/features/products/components/product-quote-preview-card.d.ts +1 -1
- package/dist/components/features/products/components/product-readiness-card.d.ts +1 -1
- package/dist/components/features/products/components/product-structure-card.d.ts +1 -1
- package/dist/components/features/products/components/product-variant-action-menu.d.ts +1 -1
- package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
- package/dist/components/features/products/components/product-variants-table.d.ts +1 -1
- package/dist/components/features/products/partials/product-surface.d.ts +15 -0
- package/dist/components/features/products/products.strings.d.ts +8 -0
- package/dist/components/features/products/products.types.d.ts +26 -8
- package/dist/components/features/questionnaire/questionnaire.types.d.ts +7 -2
- package/dist/components/features/resource/index.d.ts +2 -3
- package/dist/components/features/resource/resource.d.ts +2 -10
- package/dist/components/features/resource/resource.types.d.ts +7 -147
- package/dist/components/features/resource-assignment/partials/assignment-surface.d.ts +15 -0
- package/dist/components/features/resource-assignment/resource-assignment.strings.d.ts +6 -1
- package/dist/components/features/resource-assignment/resource-assignment.types.d.ts +6 -0
- package/dist/components/features/rich-text-editor/form-rich-text-editor.d.ts +1 -1
- package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +5 -7
- package/dist/components/features/rich-text-editor/partials/editor-field-aria.d.ts +14 -0
- package/dist/components/features/rich-text-editor/partials/html-helpers.d.ts +2 -3
- package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +6 -2
- package/dist/components/features/rich-text-editor/partials/index.d.ts +2 -3
- package/dist/components/features/rich-text-editor/partials/rich-text-editor-tiptap.d.ts +0 -1
- package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +5 -4
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +1 -1
- package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +30 -4
- package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +10 -1
- package/dist/components/features/schema-form/partials/schema-form-field.d.ts +3 -1
- package/dist/components/features/schema-form/schema-form.d.ts +1 -1
- package/dist/components/features/schema-form/schema-form.types.d.ts +13 -5
- package/dist/components/features/schema-form/schema-form.utils.d.ts +1 -1
- package/dist/components/features/suggestions/suggestions.strings.d.ts +14 -0
- package/dist/components/features/suggestions/suggestions.types.d.ts +13 -5
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/filter-bar.d.ts +1 -1
- package/dist/components/features/table/index.d.ts +1 -0
- package/dist/components/features/table/pagination.d.ts +1 -1
- package/dist/components/features/table/partials/cell-value.d.ts +1 -1
- package/dist/components/features/table/table-body.d.ts +1 -1
- package/dist/components/features/table/table-header.d.ts +1 -1
- package/dist/components/features/table/table-helpers.d.ts +37 -12
- package/dist/components/features/table/table-region.recipes.d.ts +11 -0
- package/dist/components/features/table/table-toolbar.d.ts +1 -1
- package/dist/components/features/table/table.strings.d.ts +4 -0
- package/dist/components/features/table/table.types.d.ts +91 -49
- package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +4 -0
- package/dist/components/features/theme-tweaker/theme-tweaker.strings.d.ts +10 -7
- package/dist/components/features/theme-tweaker/theme-tweaker.utils.d.ts +17 -0
- package/dist/components/layout/app-shell/app-shell.types.d.ts +46 -49
- package/dist/components/layout/app-shell/index.d.ts +2 -2
- package/dist/components/layout/app-shell/shell-regions.d.ts +9 -0
- package/dist/components/layout/app-shell/shell-skip-link.d.ts +9 -0
- package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
- package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
- package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
- package/dist/components/layout/auth/auth-shell.d.ts +1 -1
- package/dist/components/layout/auth/auth.types.d.ts +0 -5
- package/dist/components/layout/containers/inline-gutter-context.d.ts +7 -0
- package/dist/components/layout/containers/main-landmark-context.d.ts +6 -0
- package/dist/components/layout/header/header.types.d.ts +19 -8
- package/dist/components/layout/header/partials/header-global-search-trigger.d.ts +1 -1
- package/dist/components/layout/header/partials/header-notifications.d.ts +1 -1
- package/dist/components/layout/header/partials/header-search.d.ts +1 -1
- package/dist/components/layout/hooks/use-command-shortcut.d.ts +10 -1
- package/dist/components/layout/layout.types.d.ts +6 -4
- package/dist/components/layout/navigation/breadcrumb-progress/breadcrumb-progress.d.ts +1 -1
- package/dist/components/layout/navigation/breadcrumb-progress/types.d.ts +9 -0
- package/dist/components/layout/navigation/section-nav/section-nav.d.ts +8 -1
- package/dist/components/layout/navigation/side-nav.d.ts +3 -2
- package/dist/components/layout/normalize-layout-path.d.ts +1 -0
- package/dist/components/layout/page/index.d.ts +2 -3
- package/dist/components/layout/page/page.strings.d.ts +12 -0
- package/dist/components/layout/page/page.types.d.ts +7 -110
- package/dist/components/layout/page/partials/page-header.d.ts +1 -1
- package/dist/components/layout/settings/index.d.ts +1 -1
- package/dist/components/layout/settings/settings.d.ts +4 -6
- package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-navigation-footer.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
- package/dist/components/layout/sidebar/index.d.ts +1 -1
- package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +17 -7
- package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -0
- package/dist/components/layout/sidebar/sidebar.types.d.ts +12 -12
- package/dist/components/layout/sidebar/sidebar.utils.d.ts +4 -0
- package/dist/components/layout/workspace/workspace.strings.d.ts +2 -2
- package/dist/components/layout/workspace/workspace.types.d.ts +13 -7
- package/dist/components/primitives/date.d.ts +22 -3
- package/dist/components/primitives/file-size.d.ts +8 -2
- package/dist/components/primitives/index.d.ts +1 -1
- package/dist/components/primitives/initials.d.ts +3 -1
- package/dist/components/primitives/link.d.ts +11 -3
- package/dist/components/primitives/money.d.ts +2 -2
- package/dist/components/primitives/number.d.ts +3 -2
- package/dist/components/typography/heading.d.ts +9 -3
- package/dist/components/typography/index.d.ts +1 -1
- package/dist/components/typography/rich-text/rich-text-tree.d.ts +7 -5
- package/dist/components/typography/text-link.d.ts +10 -3
- package/dist/components/ui/badge.d.ts +2 -4
- package/dist/components/ui/breadcrumb.d.ts +2 -3
- package/dist/components/ui/button.d.ts +8 -2
- package/dist/components/ui/collapsible.d.ts +1 -4
- package/dist/components/ui/command.d.ts +20 -18
- package/dist/components/ui/dialog.d.ts +3 -9
- package/dist/components/ui/empty.d.ts +2 -2
- package/dist/components/ui/input-group.d.ts +3 -3
- package/dist/components/ui/item.d.ts +3 -3
- package/dist/components/ui/popover.d.ts +3 -7
- package/dist/components/ui/sheet.d.ts +4 -12
- package/dist/components/ui/sidebar-state.d.ts +6 -1
- package/dist/components/ui/sidebar.d.ts +7 -4
- package/dist/components/ui/tabs.d.ts +2 -2
- package/dist/components/ui/toggle-group.d.ts +3 -3
- package/dist/components/ui/toggle.d.ts +2 -2
- package/dist/components/ui/tooltip.d.ts +1 -3
- package/dist/{containers-CIxwbZt5.js → containers-BdfLTP4w.js} +37 -32
- package/dist/containers-BdfLTP4w.js.map +1 -0
- package/dist/content-block-hooks-Z3iKjqd1.js +17 -0
- package/dist/content-block-hooks-Z3iKjqd1.js.map +1 -0
- package/dist/{copyable-DIznBqiT.js → copyable-Bmr14W0d.js} +6 -6
- package/dist/{copyable-DIznBqiT.js.map → copyable-Bmr14W0d.js.map} +1 -1
- package/dist/{data-display-BdgCAw8T.js → data-display-CWe9SOYh.js} +264 -250
- package/dist/data-display-CWe9SOYh.js.map +1 -0
- package/dist/date-3qsCE1ID.js +209 -0
- package/dist/date-3qsCE1ID.js.map +1 -0
- package/dist/date-picker-D1keJQIG.js +1617 -0
- package/dist/date-picker-D1keJQIG.js.map +1 -0
- package/dist/date-pickers-D8aJoeHc.js +185 -0
- package/dist/date-pickers-D8aJoeHc.js.map +1 -0
- package/dist/disclosure-panel-B0HFNZ9x.js.map +1 -1
- package/dist/{display-KsZLw9Ov.js → display-VlmP1I0i.js} +23 -46
- package/dist/display-VlmP1I0i.js.map +1 -0
- package/dist/{dropdown-menu-CLs8Lihj.js → dropdown-menu-B8hjvbkS.js} +9 -9
- package/dist/{dropdown-menu-CLs8Lihj.js.map → dropdown-menu-B8hjvbkS.js.map} +1 -1
- package/dist/dropzone-CHBNK3de.js +116 -0
- package/dist/dropzone-CHBNK3de.js.map +1 -0
- package/dist/features/activities.js +767 -700
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +280 -235
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/appointment-calendar.js +430 -334
- package/dist/features/appointment-calendar.js.map +1 -1
- package/dist/features/async-preview.js +351 -265
- package/dist/features/async-preview.js.map +1 -1
- package/dist/features/combobox.js +2 -2
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +212 -151
- package/dist/features/data-view.js.map +1 -1
- package/dist/features/email-composer/engine.js +1 -1
- package/dist/features/email-composer.js +347 -313
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +501 -348
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +2 -2
- package/dist/features/global-search.js +250 -210
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +280 -210
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map/style.css +15 -0
- package/dist/features/map.js +435 -404
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +1745 -1195
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +2 -2
- package/dist/features/overlays.js +2 -2
- package/dist/features/products.js +1862 -1759
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +188 -168
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +223 -191
- package/dist/features/resource-assignment.js.map +1 -1
- package/dist/features/resource.js +55 -217
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +28 -19
- package/dist/features/rich-text-editor.js.map +1 -1
- package/dist/features/schema-form.js +380 -287
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +90 -74
- package/dist/features/suggestions.js.map +1 -1
- package/dist/features/table.js +2 -2
- package/dist/features/theme-tweaker.js +718 -627
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-DmqmXKLn.js +254 -0
- package/dist/feedback-DmqmXKLn.js.map +1 -0
- package/dist/{field-affordance-recipes-DWcNcOjh.js → field-affordance-recipes-DfbMadot.js} +13 -9
- package/dist/field-affordance-recipes-DfbMadot.js.map +1 -0
- package/dist/field-control-attributes-B6i335wr.js +18 -0
- package/dist/field-control-attributes-B6i335wr.js.map +1 -0
- package/dist/field-state-recipes-EtCxpEy3.js +18 -0
- package/dist/field-state-recipes-EtCxpEy3.js.map +1 -0
- package/dist/filters-BviMRMLS.js +2692 -0
- package/dist/filters-BviMRMLS.js.map +1 -0
- package/dist/{focus-recipes-B653VaLq.js → focus-recipes-DSkiUvUp.js} +3 -3
- package/dist/focus-recipes-DSkiUvUp.js.map +1 -0
- package/dist/form-field-BdfCwSoQ.js +74 -0
- package/dist/form-field-BdfCwSoQ.js.map +1 -0
- package/dist/{form-sizing-Bs2qFUeE.js → form-sizing-DE_dZw32.js} +3 -3
- package/dist/{form-sizing-Bs2qFUeE.js.map → form-sizing-DE_dZw32.js.map} +1 -1
- package/dist/{forms-C0RGnJTe.js → forms-B8DzJnBN.js} +35 -35
- package/dist/forms-B8DzJnBN.js.map +1 -0
- package/dist/forms-numeric-DOBswjKj.js +992 -0
- package/dist/forms-numeric-DOBswjKj.js.map +1 -0
- package/dist/{header-DMMxG__r.js → header-Cq3G0ZRP.js} +163 -158
- package/dist/header-Cq3G0ZRP.js.map +1 -0
- package/dist/hooks/use-files.d.ts +2 -0
- package/dist/{hooks-DB6CJ4MR.js → hooks-DHfeSMAO.js} +34 -14
- package/dist/hooks-DHfeSMAO.js.map +1 -0
- package/dist/{http-D_6rOnzU.js → http-Cu-GPpss.js} +61 -35
- package/dist/http-Cu-GPpss.js.map +1 -0
- package/dist/{icon-badge-DZF-YjQp.js → icon-badge-B0Kq7wom.js} +3 -3
- package/dist/{icon-badge-DZF-YjQp.js.map → icon-badge-B0Kq7wom.js.map} +1 -1
- package/dist/index.js +6 -6
- package/dist/inline-gutter-context-CSqmrMFZ.js +11 -0
- package/dist/inline-gutter-context-CSqmrMFZ.js.map +1 -0
- package/dist/{input-DMBwAZmr.js → input-2YrgTUrz.js} +3 -3
- package/dist/{input-DMBwAZmr.js.map → input-2YrgTUrz.js.map} +1 -1
- package/dist/{input-CvyDQlY7.js → input-DfJyrjoR.js} +7 -7
- package/dist/{input-CvyDQlY7.js.map → input-DfJyrjoR.js.map} +1 -1
- package/dist/{interaction-recipes-XR9ZpVYL.js → interaction-recipes-DmuS1ase.js} +2 -2
- package/dist/{interaction-recipes-XR9ZpVYL.js.map → interaction-recipes-DmuS1ase.js.map} +1 -1
- package/dist/item-GJ9mvCcg.js +279 -0
- package/dist/item-GJ9mvCcg.js.map +1 -0
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/auth.js +1 -1
- package/dist/layout/containers.js +1 -1
- package/dist/layout/header.js +1 -1
- package/dist/layout/hooks.js +1 -1
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.js +2 -2
- package/dist/layout/settings.js +2 -2
- package/dist/layout/sidebar.js +3 -3
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +12 -12
- package/dist/layout.types-DbtnyAtd.js +33 -0
- package/dist/layout.types-DbtnyAtd.js.map +1 -0
- package/dist/lib/anchored-positioning.d.ts +11 -0
- package/dist/lib/field-affordance-recipes.d.ts +10 -0
- package/dist/lib/field-control-attributes.d.ts +11 -0
- package/dist/lib/field-state-recipes.d.ts +8 -0
- package/dist/lib/focus-recipes.d.ts +7 -0
- package/dist/lib/format.d.ts +26 -0
- package/dist/lib/money-format.d.ts +6 -0
- package/dist/lib/motion-recipes.d.ts +6 -0
- package/dist/lib/surface-recipes.d.ts +33 -3
- package/dist/lib/theme-scope.d.ts +17 -1
- package/dist/lib/token-merge.generated.d.ts +19 -25
- package/dist/lib/ui-provider/index.d.ts +1 -1
- package/dist/lib/ui-provider/types.d.ts +5 -0
- package/dist/lib/use-controllable-state.d.ts +16 -0
- package/dist/lib/use-copy-feedback.d.ts +15 -0
- package/dist/lib/utils.js +1 -1
- package/dist/lib/variant-props.d.ts +9 -0
- package/dist/main-landmark-context-BAsyqp2I.js +11 -0
- package/dist/main-landmark-context-BAsyqp2I.js.map +1 -0
- package/dist/mentions-zz0ewNIq.js +670 -0
- package/dist/mentions-zz0ewNIq.js.map +1 -0
- package/dist/message-BiiVrRrm.js +138 -0
- package/dist/message-BiiVrRrm.js.map +1 -0
- package/dist/{metadata-list-C3MkU-Om.js → metadata-list-G85roWjS.js} +13 -12
- package/dist/metadata-list-G85roWjS.js.map +1 -0
- package/dist/{motion-recipes-DitYv6P2.js → motion-recipes-CUc_aHuG.js} +7 -4
- package/dist/motion-recipes-CUc_aHuG.js.map +1 -0
- package/dist/navigation-C0Be5C3i.js +304 -0
- package/dist/navigation-C0Be5C3i.js.map +1 -0
- package/dist/navigation-CmqaQR_G.js +257 -0
- package/dist/navigation-CmqaQR_G.js.map +1 -0
- package/dist/normalize-layout-path-BmEgg6fu.js +14 -0
- package/dist/normalize-layout-path-BmEgg6fu.js.map +1 -0
- package/dist/number-NFWKIoiK.js +340 -0
- package/dist/number-NFWKIoiK.js.map +1 -0
- package/dist/{overflow-tab-bar-IVFVQFV6.js → overflow-tab-bar-DV7HE_3t.js} +8 -8
- package/dist/{overflow-tab-bar-IVFVQFV6.js.map → overflow-tab-bar-DV7HE_3t.js.map} +1 -1
- package/dist/{overlays-BSgCtM2v.js → overlays-D-gAIfPF.js} +369 -364
- package/dist/overlays-D-gAIfPF.js.map +1 -0
- package/dist/page-D4pQhgSq.js +216 -0
- package/dist/page-D4pQhgSq.js.map +1 -0
- package/dist/{page-header-commands-7P3sfE9u.js → page-header-commands-elelNOfd.js} +29 -29
- package/dist/{page-header-commands-7P3sfE9u.js.map → page-header-commands-elelNOfd.js.map} +1 -1
- package/dist/{pagination-CgCjElfu.js → pagination-BuSWw1US.js} +22 -23
- package/dist/pagination-BuSWw1US.js.map +1 -0
- package/dist/popover-BpMxbqEK.js +205 -0
- package/dist/popover-BpMxbqEK.js.map +1 -0
- package/dist/{popover-menu-DlnQ2zlR.js → popover-menu-CO-_iiuz.js} +7 -7
- package/dist/{popover-menu-DlnQ2zlR.js.map → popover-menu-CO-_iiuz.js.map} +1 -1
- package/dist/{popover.recipes-DdiEp0rd.js → popover.recipes-BqkdvlZn.js} +3 -4
- package/dist/{popover.recipes-DdiEp0rd.js.map → popover.recipes-BqkdvlZn.js.map} +1 -1
- package/dist/{portal-recipes-BpsV_iRw.js → portal-recipes-BPeS4rGB.js} +2 -2
- package/dist/{portal-recipes-BpsV_iRw.js.map → portal-recipes-BPeS4rGB.js.map} +1 -1
- package/dist/primitives-BlC1lXBr.js +447 -0
- package/dist/primitives-BlC1lXBr.js.map +1 -0
- package/dist/primitives.js +4 -4
- package/dist/{progress-BJhQP9WX.js → progress-RARK8AjB.js} +5 -5
- package/dist/{progress-BJhQP9WX.js.map → progress-RARK8AjB.js.map} +1 -1
- package/dist/receipt-CUf2Vegp.js +114 -0
- package/dist/receipt-CUf2Vegp.js.map +1 -0
- package/dist/rich-text-Cypm9__d.js +44 -0
- package/dist/rich-text-Cypm9__d.js.map +1 -0
- package/dist/rich-text-editor-Z6cQepsA.js +919 -0
- package/dist/rich-text-editor-Z6cQepsA.js.map +1 -0
- package/dist/rich-text-editor-toolbar-DYbRJARB.js +100 -0
- package/dist/rich-text-editor-toolbar-DYbRJARB.js.map +1 -0
- package/dist/rich-text-tree-DdKHIJx4.js +154 -0
- package/dist/rich-text-tree-DdKHIJx4.js.map +1 -0
- package/dist/{scroll-area-B0dB2cBi.js → scroll-area-B9HKbji0.js} +3 -3
- package/dist/{scroll-area-B0dB2cBi.js.map → scroll-area-B9HKbji0.js.map} +1 -1
- package/dist/{separator-Ct_WSWTJ.js → separator-DaDe26sf.js} +3 -3
- package/dist/separator-DaDe26sf.js.map +1 -0
- package/dist/{separator-Bb17I4pu.js → separator-KGsNXt2J.js} +2 -2
- package/dist/{separator-Bb17I4pu.js.map → separator-KGsNXt2J.js.map} +1 -1
- package/dist/services/actions/action-adapters.d.ts +5 -2
- package/dist/services/actions/index.d.ts +1 -1
- package/dist/services/actions.js +2 -2
- package/dist/services/actions.js.map +1 -1
- package/dist/settings-D5j_RJvT.js +160 -0
- package/dist/settings-D5j_RJvT.js.map +1 -0
- package/dist/sheet-B6j_BE9O.js +241 -0
- package/dist/sheet-B6j_BE9O.js.map +1 -0
- package/dist/{sidebar-f9gRWXIR.js → sidebar-C-iQ_TJP.js} +379 -350
- package/dist/sidebar-C-iQ_TJP.js.map +1 -0
- package/dist/sidebar-D5VO2W8S.js +715 -0
- package/dist/sidebar-D5VO2W8S.js.map +1 -0
- package/dist/{skeleton-BapcJd9C.js → skeleton-Cab_KgVo.js} +13 -13
- package/dist/skeleton-Cab_KgVo.js.map +1 -0
- package/dist/{smart-card-CW0hjetE.js → smart-card-C59z6KFO.js} +217 -210
- package/dist/smart-card-C59z6KFO.js.map +1 -0
- package/dist/{structure-DuxKl954.js → structure-DElaQwwN.js} +2 -2
- package/dist/{structure-DuxKl954.js.map → structure-DElaQwwN.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{surface-recipes-BKRVW8Os.js → surface-recipes-DV6rrOFq.js} +11 -3
- package/dist/surface-recipes-DV6rrOFq.js.map +1 -0
- package/dist/table-CSRUgpdK.js +180 -0
- package/dist/table-CSRUgpdK.js.map +1 -0
- package/dist/table-DdXDBsR_.js +1657 -0
- package/dist/table-DdXDBsR_.js.map +1 -0
- package/dist/tabs-WnHfV2pM.js +192 -0
- package/dist/tabs-WnHfV2pM.js.map +1 -0
- package/dist/{text-inputs-B1culiSK.js → text-inputs-ljyBYaCd.js} +112 -112
- package/dist/text-inputs-ljyBYaCd.js.map +1 -0
- package/dist/theme.css +21 -5
- package/dist/timelines-mOmS9Eh3.js +479 -0
- package/dist/timelines-mOmS9Eh3.js.map +1 -0
- package/dist/tooltip-yjX-Uv-p.js +112 -0
- package/dist/tooltip-yjX-Uv-p.js.map +1 -0
- package/dist/{tree-CzUJHnFs.js → tree-YpkxUG2Z.js} +80 -72
- package/dist/tree-YpkxUG2Z.js.map +1 -0
- package/dist/typography/rich-text.js +1 -1
- package/dist/{typography-BQnine1k.js → typography-C0dELqYV.js} +46 -40
- package/dist/typography-C0dELqYV.js.map +1 -0
- package/dist/typography.js +1 -1
- package/dist/{ui-provider-C-74NVLc.js → ui-provider-Bu1S-o96.js} +4 -3
- package/dist/ui-provider-Bu1S-o96.js.map +1 -0
- package/dist/ui-provider.js +2 -2
- package/dist/upload-DMuMYJFT.js +875 -0
- package/dist/upload-DMuMYJFT.js.map +1 -0
- package/dist/{usage-card-BeSLY0i0.js → usage-card-DDPki5P1.js} +57 -54
- package/dist/usage-card-DDPki5P1.js.map +1 -0
- package/dist/use-controllable-state-BlP8SyBI.js +13 -0
- package/dist/use-controllable-state-BlP8SyBI.js.map +1 -0
- package/dist/use-copy-feedback-CzcaqlLf.js +28 -0
- package/dist/use-copy-feedback-CzcaqlLf.js.map +1 -0
- package/dist/use-metric-format-options-Dk4rC1NO.js +251 -0
- package/dist/use-metric-format-options-Dk4rC1NO.js.map +1 -0
- package/dist/{utils-B6kKb8jB.js → utils-BVbAG2J6.js} +128 -112
- package/dist/utils-BVbAG2J6.js.map +1 -0
- package/dist/value-inputs-h5MwjGCo.js +982 -0
- package/dist/value-inputs-h5MwjGCo.js.map +1 -0
- package/dist/value-typography-D15uwfj-.js +154 -0
- package/dist/value-typography-D15uwfj-.js.map +1 -0
- package/dist/workspace-DIryPqBt.js +400 -0
- package/dist/workspace-DIryPqBt.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +7 -0
- package/docs/consumer-skill/agents/themelia-ui-designer.md +11 -2
- package/docs/consumer-skill/examples/analytics.tsx +1 -1
- package/docs/consumer-skill/examples/app-layout.tsx +3 -3
- package/docs/consumer-skill/examples/commerce-lines.tsx +7 -5
- package/docs/consumer-skill/examples/detail.tsx +3 -2
- package/docs/consumer-skill/examples/edit.tsx +3 -3
- package/docs/consumer-skill/examples/email-composer.tsx +1 -1
- package/docs/consumer-skill/examples/index-table.tsx +2 -2
- package/docs/consumer-skill/examples/scoped-directory.tsx +7 -6
- package/docs/consumer-skill/references/agents-md.md +27 -23
- package/docs/consumer-skill/references/analytics.md +33 -4
- package/docs/consumer-skill/references/building-views.md +213 -0
- package/docs/consumer-skill/references/catalogue.md +617 -0
- package/docs/consumer-skill/references/component-contracts.json +25852 -32067
- package/docs/consumer-skill/references/composition.md +42 -21
- package/docs/consumer-skill/references/design-contract.md +1 -0
- package/docs/consumer-skill/references/discovery.md +8 -5
- package/docs/consumer-skill/references/installation.md +59 -10
- package/docs/consumer-skill/references/integration.md +28 -5
- package/docs/consumer-skill/references/product-composition.md +2 -2
- package/docs/consumer-skill/references/public-api.json +726 -641
- package/docs/consumer-skill/references/review.md +57 -15
- package/docs/consumer-skill/references/rhf-workflows.md +72 -0
- package/docs/consumer-skill/references/screen-archetypes.md +2 -2
- package/docs/consumer-skill/references/theming.md +8 -3
- package/docs/consumer-skill/references/tokens.json +4 -4
- package/docs/consumer-skill/references/workflows.md +7 -7
- package/docs/consumer-skill/scripts/composition-policy.mjs +178 -44
- package/docs/consumer-skill/scripts/composition.mjs +4 -1
- package/docs/consumer-skill/scripts/discovery.mjs +3 -1
- package/docs/consumer-skill/scripts/setup-skills.mjs +74 -10
- package/docs/consumer-skills/themelia-components/SKILL.md +8 -4
- package/docs/consumer-skills/themelia-composition/SKILL.md +7 -3
- package/docs/consumer-skills/themelia-design/SKILL.md +7 -1
- package/docs/consumer-skills/themelia-tokenization/SKILL.md +1 -1
- package/package.json +12 -13
- package/templates/README.md +3 -2
- package/templates/admin-shell-template.tsx +50 -11
- package/templates/analytics-operations-template.tsx +20 -24
- package/templates/customers-template.tsx +30 -25
- package/templates/index.ts +2 -8
- package/templates/orders-template.tsx +28 -24
- package/templates/products-template.tsx +14 -4
- package/templates/user-permissions-template.tsx +11 -14
- package/dist/accordion-B9MHG0cT.js.map +0 -1
- package/dist/action-menu-Dr8K-ghE.js +0 -284
- package/dist/action-menu-Dr8K-ghE.js.map +0 -1
- package/dist/ai-artifact-C58tQcBy.js +0 -1185
- package/dist/ai-artifact-C58tQcBy.js.map +0 -1
- package/dist/anchored-positioning-DPnKTvNs.js +0 -6
- package/dist/anchored-positioning-DPnKTvNs.js.map +0 -1
- package/dist/app-shell-B_IuNWOo.js +0 -321
- package/dist/app-shell-B_IuNWOo.js.map +0 -1
- package/dist/auth-DTkkshS8.js.map +0 -1
- package/dist/badge-xIiV_E7f.js.map +0 -1
- package/dist/base/sheet.js +0 -3
- package/dist/breadcrumbs-J-K2kl4c.js +0 -129
- package/dist/breadcrumbs-J-K2kl4c.js.map +0 -1
- package/dist/button-S2Cubiiz.js.map +0 -1
- package/dist/buttons-BedGfygC.js.map +0 -1
- package/dist/cascader-B1MiqkBq.js +0 -439
- package/dist/cascader-B1MiqkBq.js.map +0 -1
- package/dist/choice-inputs-zUgBZfE4.js.map +0 -1
- package/dist/code-block-BzmM9Eig.js.map +0 -1
- package/dist/collapsible-BkAI_XD4.js +0 -81
- package/dist/collapsible-BkAI_XD4.js.map +0 -1
- package/dist/combobox-BEx0vJgF.js +0 -362
- package/dist/combobox-BEx0vJgF.js.map +0 -1
- package/dist/combobox-BwzoXFSG.js +0 -884
- package/dist/combobox-BwzoXFSG.js.map +0 -1
- package/dist/command-CrlPIL6m.js +0 -425
- package/dist/command-CrlPIL6m.js.map +0 -1
- package/dist/comments-Dmpp0YIc.js +0 -1169
- package/dist/comments-Dmpp0YIc.js.map +0 -1
- package/dist/components/base/buttons/tooltip-button.d.ts +0 -7
- package/dist/components/base/display/content-block.d.ts +0 -75
- package/dist/components/base/display/content-block.strings.d.ts +0 -5
- package/dist/components/base/sheet/index.d.ts +0 -29
- package/dist/components/blocks/ai/use-copy-feedback.d.ts +0 -6
- package/dist/components/blocks/data-display/metadata/index.d.ts +0 -30
- package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +0 -16
- package/dist/components/features/resource/resource.strings.d.ts +0 -12
- package/dist/components/features/rich-text-editor/partials/rich-text-editor-fallback.d.ts +0 -8
- package/dist/components/features/sync/index.d.ts +0 -26
- package/dist/components/features/sync/sync-range-dialog-form.d.ts +0 -5
- package/dist/components/features/sync/sync.strings.d.ts +0 -18
- package/dist/components/features/sync/sync.types.d.ts +0 -44
- package/dist/components/layout/page/partials/page-actions.d.ts +0 -3
- package/dist/components/ui/slot.d.ts +0 -6
- package/dist/containers-CIxwbZt5.js.map +0 -1
- package/dist/data-display-BdgCAw8T.js.map +0 -1
- package/dist/date-Cq8ioE4o.js +0 -144
- package/dist/date-Cq8ioE4o.js.map +0 -1
- package/dist/date-picker-RlIzKom_.js +0 -1551
- package/dist/date-picker-RlIzKom_.js.map +0 -1
- package/dist/date-pickers-DY-CpXS1.js +0 -179
- package/dist/date-pickers-DY-CpXS1.js.map +0 -1
- package/dist/display-KsZLw9Ov.js.map +0 -1
- package/dist/features/sync.js +0 -142
- package/dist/features/sync.js.map +0 -1
- package/dist/feedback-Dm4izqFn.js +0 -240
- package/dist/feedback-Dm4izqFn.js.map +0 -1
- package/dist/field-affordance-recipes-DWcNcOjh.js.map +0 -1
- package/dist/field-state-recipes-BVA2CWHo.js +0 -12
- package/dist/field-state-recipes-BVA2CWHo.js.map +0 -1
- package/dist/filters-DzgSJpMK.js +0 -2257
- package/dist/filters-DzgSJpMK.js.map +0 -1
- package/dist/focus-recipes-B653VaLq.js.map +0 -1
- package/dist/form-field-BriWAXyg.js +0 -63
- package/dist/form-field-BriWAXyg.js.map +0 -1
- package/dist/forms-C0RGnJTe.js.map +0 -1
- package/dist/forms-numeric-DIhghX1Q.js +0 -910
- package/dist/forms-numeric-DIhghX1Q.js.map +0 -1
- package/dist/header-DMMxG__r.js.map +0 -1
- package/dist/hooks-DB6CJ4MR.js.map +0 -1
- package/dist/http-D_6rOnzU.js.map +0 -1
- package/dist/item-DjCcM18E.js +0 -277
- package/dist/item-DjCcM18E.js.map +0 -1
- package/dist/layout.types-Cn7aUzJp.js +0 -20
- package/dist/layout.types-Cn7aUzJp.js.map +0 -1
- package/dist/media-gallery-C-vChPmE.js +0 -203
- package/dist/media-gallery-C-vChPmE.js.map +0 -1
- package/dist/mentions-0_4nWuI-.js +0 -570
- package/dist/mentions-0_4nWuI-.js.map +0 -1
- package/dist/message-g8p7eVtN.js +0 -128
- package/dist/message-g8p7eVtN.js.map +0 -1
- package/dist/metadata-list-C3MkU-Om.js.map +0 -1
- package/dist/motion-recipes-DitYv6P2.js.map +0 -1
- package/dist/navigation-C90-oQFq.js +0 -255
- package/dist/navigation-C90-oQFq.js.map +0 -1
- package/dist/navigation-DaRjthVk.js +0 -288
- package/dist/navigation-DaRjthVk.js.map +0 -1
- package/dist/number-CRU3kGuk.js +0 -354
- package/dist/number-CRU3kGuk.js.map +0 -1
- package/dist/overlays-BSgCtM2v.js.map +0 -1
- package/dist/page-DUUKDAjo.js +0 -331
- package/dist/page-DUUKDAjo.js.map +0 -1
- package/dist/pagination-CgCjElfu.js.map +0 -1
- package/dist/popover-B85RenIl.js +0 -201
- package/dist/popover-B85RenIl.js.map +0 -1
- package/dist/primitives-ByWgGUgt.js +0 -380
- package/dist/primitives-ByWgGUgt.js.map +0 -1
- package/dist/receipt-tOc7B3hw.js +0 -116
- package/dist/receipt-tOc7B3hw.js.map +0 -1
- package/dist/rich-text-Dth5E882.js +0 -78
- package/dist/rich-text-Dth5E882.js.map +0 -1
- package/dist/rich-text-editor-C1fOjBTd.js +0 -1195
- package/dist/rich-text-editor-C1fOjBTd.js.map +0 -1
- package/dist/rich-text-editor-toolbar-laT3tpBT.js +0 -98
- package/dist/rich-text-editor-toolbar-laT3tpBT.js.map +0 -1
- package/dist/sanitize-html-DsQmI48u.js +0 -92
- package/dist/sanitize-html-DsQmI48u.js.map +0 -1
- package/dist/separator-Ct_WSWTJ.js.map +0 -1
- package/dist/settings-Bar5wiSo.js +0 -167
- package/dist/settings-Bar5wiSo.js.map +0 -1
- package/dist/sheet-BGPERY55.js +0 -250
- package/dist/sheet-BGPERY55.js.map +0 -1
- package/dist/sidebar-D-JYMMbY.js +0 -686
- package/dist/sidebar-D-JYMMbY.js.map +0 -1
- package/dist/sidebar-f9gRWXIR.js.map +0 -1
- package/dist/skeleton-BapcJd9C.js.map +0 -1
- package/dist/slot-CLF9kLrS.js +0 -16
- package/dist/slot-CLF9kLrS.js.map +0 -1
- package/dist/smart-card-CW0hjetE.js.map +0 -1
- package/dist/surface-recipes-BKRVW8Os.js.map +0 -1
- package/dist/table-B4TE7iOV.js +0 -175
- package/dist/table-B4TE7iOV.js.map +0 -1
- package/dist/table-CFOWY9pQ.js +0 -1536
- package/dist/table-CFOWY9pQ.js.map +0 -1
- package/dist/tabs-e7ko9S2o.js +0 -191
- package/dist/tabs-e7ko9S2o.js.map +0 -1
- package/dist/text-inputs-B1culiSK.js.map +0 -1
- package/dist/timelines-D3Sl9ueq.js +0 -458
- package/dist/timelines-D3Sl9ueq.js.map +0 -1
- package/dist/tooltip-8wz5S_Zr.js +0 -113
- package/dist/tooltip-8wz5S_Zr.js.map +0 -1
- package/dist/tree-CzUJHnFs.js.map +0 -1
- package/dist/typography-BQnine1k.js.map +0 -1
- package/dist/ui-provider-C-74NVLc.js.map +0 -1
- package/dist/upload-BOW6U2tI.js +0 -855
- package/dist/upload-BOW6U2tI.js.map +0 -1
- package/dist/upload-queue-qUXn1ykN.js +0 -409
- package/dist/upload-queue-qUXn1ykN.js.map +0 -1
- package/dist/usage-card-BeSLY0i0.js.map +0 -1
- package/dist/utils-B6kKb8jB.js.map +0 -1
- package/dist/value-inputs-skdVB2zh.js +0 -980
- package/dist/value-inputs-skdVB2zh.js.map +0 -1
- package/dist/value-typography-uAmWUAL1.js +0 -116
- package/dist/value-typography-uAmWUAL1.js.map +0 -1
- package/dist/workspace-DHeHv0qw.js +0 -411
- package/dist/workspace-DHeHv0qw.js.map +0 -1
|
@@ -0,0 +1,2692 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { C as e, d as t, f as n } from "./ui-provider-Bu1S-o96.js";
|
|
3
|
+
import { useStrings as r } from "./lib/strings.js";
|
|
4
|
+
import { t as i } from "./utils-BVbAG2J6.js";
|
|
5
|
+
import { a, c as o, o as s } from "./typography-C0dELqYV.js";
|
|
6
|
+
import { t as c } from "./focus-recipes-DSkiUvUp.js";
|
|
7
|
+
import { n as l } from "./buttons-pZVgPTZn.js";
|
|
8
|
+
import { r as u, t as d } from "./structure-DElaQwwN.js";
|
|
9
|
+
import { i as f } from "./tone-recipes-BPsRAvhu.js";
|
|
10
|
+
import { a as p, o as m } from "./surface-recipes-DV6rrOFq.js";
|
|
11
|
+
import { n as h, t as g } from "./feedback-DmqmXKLn.js";
|
|
12
|
+
import { i as _, r as v } from "./popover.recipes-BqkdvlZn.js";
|
|
13
|
+
import { _ as y } from "./primitives-BlC1lXBr.js";
|
|
14
|
+
import { t as b } from "./number-NFWKIoiK.js";
|
|
15
|
+
import { n as x, s as S, t as C } from "./date-3qsCE1ID.js";
|
|
16
|
+
import { t as w } from "./badge-oGiXblW7.js";
|
|
17
|
+
import { t as T } from "./layer-recipes-CCpklYME.js";
|
|
18
|
+
import { n as E } from "./field-affordance-recipes-DfbMadot.js";
|
|
19
|
+
import { a as D, i as O, n as k, o as A, r as j, s as M, t as N } from "./command-CjZ2VzKC.js";
|
|
20
|
+
import { d as P, p as ee, y as F } from "./form-sizing-DE_dZw32.js";
|
|
21
|
+
import { t as I } from "./input-DfJyrjoR.js";
|
|
22
|
+
import { i as L, t as R } from "./date-picker-D1keJQIG.js";
|
|
23
|
+
import { a as te, c as z, i as ne, n as re, o as ie, r as ae, t as oe } from "./popover-BpMxbqEK.js";
|
|
24
|
+
import { t as se } from "./form-field-BdfCwSoQ.js";
|
|
25
|
+
import { n as ce, r as le, t as ue } from "./control-group-recipes-fMuFo0H7.js";
|
|
26
|
+
import { i as de, r as fe, t as pe } from "./tabs-WnHfV2pM.js";
|
|
27
|
+
import { t as me } from "./popover-menu-CO-_iiuz.js";
|
|
28
|
+
import { t as he } from "./use-debounced-callback-Cx1h-hdv.js";
|
|
29
|
+
import { t as ge } from "./use-debounce-DZ_1ZBPa.js";
|
|
30
|
+
import { i as _e, n as ve, r as ye, t as be } from "./cascader-Cf05pwaq.js";
|
|
31
|
+
import xe, { Component as Se, createContext as Ce, useCallback as B, useContext as we, useEffect as V, useId as Te, useLayoutEffect as Ee, useMemo as H, useRef as U, useState as W } from "react";
|
|
32
|
+
import { Fragment as De, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
33
|
+
import { CalendarIcon as Oe, Check as ke, ChevronDown as Ae, ChevronLeft as je, ChevronsUpDown as Me, Filter as Ne, Loader2 as Pe, Plus as Fe, X as Ie } from "lucide-react";
|
|
34
|
+
import { addDays as Le, endOfMonth as Re, endOfWeek as ze, endOfYear as Be, format as Ve, isValid as He, parse as Ue, startOfMonth as We, startOfWeek as Ge, startOfYear as Ke, subMonths as qe, subYears as Je } from "date-fns";
|
|
35
|
+
//#region src/components/features/filters/filters.strings.ts
|
|
36
|
+
var q = {
|
|
37
|
+
loading: "Loading",
|
|
38
|
+
loadingOptions: "Loading {filterLabel} options...",
|
|
39
|
+
addFilter: "Add filter",
|
|
40
|
+
clear: "Clear",
|
|
41
|
+
confirm: "Confirm",
|
|
42
|
+
clearFilters: "Clear filters",
|
|
43
|
+
clearAll: "Clear all",
|
|
44
|
+
selectDate: "Select date",
|
|
45
|
+
selectDateRange: "Select date range",
|
|
46
|
+
calendar: {
|
|
47
|
+
notDateSelected: "No date selected",
|
|
48
|
+
notDateRangeSelected: "No date range selected",
|
|
49
|
+
today: "Today",
|
|
50
|
+
yesterday: "Yesterday",
|
|
51
|
+
lastSevenDays: "Last 7 days",
|
|
52
|
+
lastThirtyDays: "Last 30 days",
|
|
53
|
+
thisMonth: "This month",
|
|
54
|
+
lastMonth: "Last month",
|
|
55
|
+
thisYear: "This year",
|
|
56
|
+
lastYear: "Last year"
|
|
57
|
+
},
|
|
58
|
+
selectValues: "Select values",
|
|
59
|
+
searchPlaceholder: "Search {filterLabel}...",
|
|
60
|
+
noOptionsFound: "No options found",
|
|
61
|
+
selected: "{count} {filterLabel} selected",
|
|
62
|
+
nothingSelected: "Nothing selected",
|
|
63
|
+
enterTag: "Enter tag",
|
|
64
|
+
addTag: "Add tag",
|
|
65
|
+
removeTag: "Remove",
|
|
66
|
+
tag: "tag",
|
|
67
|
+
tags: "tags",
|
|
68
|
+
enterTags: "Enter tags",
|
|
69
|
+
tagCount: "{count} {label}",
|
|
70
|
+
searchFilters: "Search filters...",
|
|
71
|
+
noFiltersAvailable: "No filters available",
|
|
72
|
+
availableFilters: "Available filters",
|
|
73
|
+
activeFilters: "Active filters",
|
|
74
|
+
clearSearch: "Clear search",
|
|
75
|
+
backToFilters: "Back to filters",
|
|
76
|
+
previousLevel: "Back",
|
|
77
|
+
selectCurrentLevel: "Select this level",
|
|
78
|
+
select: "Select",
|
|
79
|
+
options: "options",
|
|
80
|
+
optionCount: "{count} {label}",
|
|
81
|
+
operator: "Operator",
|
|
82
|
+
operators: {
|
|
83
|
+
contains: "contains",
|
|
84
|
+
equals: "is",
|
|
85
|
+
notContains: "does not contain",
|
|
86
|
+
is: "is",
|
|
87
|
+
isNot: "is not",
|
|
88
|
+
greaterThan: "greater than",
|
|
89
|
+
lessThan: "less than",
|
|
90
|
+
before: "before",
|
|
91
|
+
after: "after",
|
|
92
|
+
between: "between",
|
|
93
|
+
has: "has",
|
|
94
|
+
hasAny: "has any",
|
|
95
|
+
hasAll: "has all",
|
|
96
|
+
in: "is any of",
|
|
97
|
+
notIn: "is none of"
|
|
98
|
+
},
|
|
99
|
+
min: "Min",
|
|
100
|
+
max: "Max",
|
|
101
|
+
fetchError: "Failed to load options",
|
|
102
|
+
retryFetch: "Retry",
|
|
103
|
+
minQueryHint: "Type at least {min} characters...",
|
|
104
|
+
searching: "Searching...",
|
|
105
|
+
optionsFound: (e) => e === 1 ? "1 option found" : `${e} options found`,
|
|
106
|
+
error: {
|
|
107
|
+
title: "Filter error",
|
|
108
|
+
descriptionWithKey: "There was a problem with \"{filterKey}\" filter.",
|
|
109
|
+
generic: "There was a problem loading this filter.",
|
|
110
|
+
unknown: "Unknown error"
|
|
111
|
+
},
|
|
112
|
+
validation: {
|
|
113
|
+
required: "This filter is required",
|
|
114
|
+
minValue: "Value must be at least {min}",
|
|
115
|
+
maxValue: "Value must be at most {max}",
|
|
116
|
+
invalidFormat: "Invalid format"
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
function J(e, t) {
|
|
120
|
+
return e.replace(/{(\w+)}/g, (e, n) => String(t[n] ?? e)).replace(/:(\w+)/g, (e, n) => t[n] === void 0 ? e : String(t[n]));
|
|
121
|
+
}
|
|
122
|
+
function Ye(e, t, n) {
|
|
123
|
+
return typeof e == "function" ? e(t) : J(e ?? "{count} {label}", {
|
|
124
|
+
count: t,
|
|
125
|
+
label: n
|
|
126
|
+
}).trim();
|
|
127
|
+
}
|
|
128
|
+
function Xe(e, t, n) {
|
|
129
|
+
let r = t.split("."), i = e;
|
|
130
|
+
for (let e of r) {
|
|
131
|
+
if (typeof i != "object" || !i) return t;
|
|
132
|
+
i = i[e];
|
|
133
|
+
}
|
|
134
|
+
return typeof i == "string" ? n ? J(i, n) : i : t;
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/components/features/filters/filters.types.ts
|
|
138
|
+
var Y = {
|
|
139
|
+
SELECT: "select",
|
|
140
|
+
MULTI_SELECT: "multi_select",
|
|
141
|
+
ASYNC_SELECT: "async_select",
|
|
142
|
+
SEARCH: "search",
|
|
143
|
+
RANGE: "range",
|
|
144
|
+
DATE: "date",
|
|
145
|
+
TAGS: "tags"
|
|
146
|
+
}, X = {
|
|
147
|
+
EQUALS: "equals",
|
|
148
|
+
CONTAINS: "contains",
|
|
149
|
+
IN: "in",
|
|
150
|
+
NOT_IN: "not_in",
|
|
151
|
+
NOT: "not",
|
|
152
|
+
BEFORE: "before",
|
|
153
|
+
AFTER: "after",
|
|
154
|
+
BETWEEN: "between",
|
|
155
|
+
GT: "gt",
|
|
156
|
+
LT: "lt",
|
|
157
|
+
GTE: "gte",
|
|
158
|
+
LTE: "lte",
|
|
159
|
+
HAS: "has",
|
|
160
|
+
HAS_ANY: "has_any",
|
|
161
|
+
HAS_ALL: "has_all"
|
|
162
|
+
};
|
|
163
|
+
function Ze(e) {
|
|
164
|
+
return e;
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/components/features/filters/operator-options.ts
|
|
168
|
+
function Qe(e) {
|
|
169
|
+
return [
|
|
170
|
+
{
|
|
171
|
+
label: e.contains,
|
|
172
|
+
value: X.CONTAINS
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
label: e.equals,
|
|
176
|
+
value: X.EQUALS
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
label: e.notContains,
|
|
180
|
+
value: X.NOT
|
|
181
|
+
}
|
|
182
|
+
];
|
|
183
|
+
}
|
|
184
|
+
function $e(e) {
|
|
185
|
+
return [{
|
|
186
|
+
label: e.is,
|
|
187
|
+
value: X.EQUALS
|
|
188
|
+
}, {
|
|
189
|
+
label: e.isNot,
|
|
190
|
+
value: X.NOT
|
|
191
|
+
}];
|
|
192
|
+
}
|
|
193
|
+
function et(e) {
|
|
194
|
+
return [
|
|
195
|
+
{
|
|
196
|
+
label: e.equals,
|
|
197
|
+
value: X.EQUALS
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
label: e.greaterThan,
|
|
201
|
+
value: X.GT
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
label: e.lessThan,
|
|
205
|
+
value: X.LT
|
|
206
|
+
}
|
|
207
|
+
];
|
|
208
|
+
}
|
|
209
|
+
function tt(e) {
|
|
210
|
+
return [
|
|
211
|
+
{
|
|
212
|
+
label: e.before,
|
|
213
|
+
value: X.BEFORE
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
label: e.after,
|
|
217
|
+
value: X.AFTER
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
label: e.between,
|
|
221
|
+
value: X.BETWEEN
|
|
222
|
+
}
|
|
223
|
+
];
|
|
224
|
+
}
|
|
225
|
+
function nt(e) {
|
|
226
|
+
return [...$e(e), ...rt(e)];
|
|
227
|
+
}
|
|
228
|
+
function rt(e) {
|
|
229
|
+
return [{
|
|
230
|
+
label: e.in ?? q.operators.in,
|
|
231
|
+
value: X.IN
|
|
232
|
+
}, {
|
|
233
|
+
label: e.notIn ?? q.operators.notIn,
|
|
234
|
+
value: X.NOT_IN
|
|
235
|
+
}];
|
|
236
|
+
}
|
|
237
|
+
function it(e) {
|
|
238
|
+
return [{
|
|
239
|
+
label: e.equals,
|
|
240
|
+
value: X.EQUALS
|
|
241
|
+
}];
|
|
242
|
+
}
|
|
243
|
+
function at(e, t) {
|
|
244
|
+
switch (e) {
|
|
245
|
+
case Y.SEARCH: return Qe(t);
|
|
246
|
+
case Y.TAGS: return [
|
|
247
|
+
{
|
|
248
|
+
label: t.has,
|
|
249
|
+
value: X.HAS
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
label: t.hasAny,
|
|
253
|
+
value: X.HAS_ANY
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
label: t.hasAll,
|
|
257
|
+
value: X.HAS_ALL
|
|
258
|
+
}
|
|
259
|
+
];
|
|
260
|
+
case Y.SELECT:
|
|
261
|
+
case Y.ASYNC_SELECT: return $e(t);
|
|
262
|
+
case Y.MULTI_SELECT: return nt(t);
|
|
263
|
+
case Y.RANGE: return [{
|
|
264
|
+
label: t.between,
|
|
265
|
+
value: X.BETWEEN
|
|
266
|
+
}];
|
|
267
|
+
case Y.DATE: return tt(t);
|
|
268
|
+
default: return Qe(t);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
function ot(e) {
|
|
272
|
+
switch (e) {
|
|
273
|
+
case Y.SEARCH: return X.CONTAINS;
|
|
274
|
+
case Y.TAGS: return X.HAS;
|
|
275
|
+
case Y.SELECT:
|
|
276
|
+
case Y.ASYNC_SELECT: return X.EQUALS;
|
|
277
|
+
case Y.RANGE: return X.BETWEEN;
|
|
278
|
+
case Y.DATE: return X.BEFORE;
|
|
279
|
+
default: return X.EQUALS;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
function st(e) {
|
|
283
|
+
return e.type === Y.MULTI_SELECT && e.membershipOperators === !0;
|
|
284
|
+
}
|
|
285
|
+
function ct(e) {
|
|
286
|
+
return e ? e.operator ?? e.operators?.[0]?.value ?? (st(e) ? X.IN : ot(e.type)) : X.EQUALS;
|
|
287
|
+
}
|
|
288
|
+
function lt(e, t) {
|
|
289
|
+
return e.operators && e.operators.length > 0 ? e.operators : st(e) ? rt(t) : at(e.type, t);
|
|
290
|
+
}
|
|
291
|
+
function ut(e, t) {
|
|
292
|
+
switch (e) {
|
|
293
|
+
case X.EQUALS: return t.is;
|
|
294
|
+
case X.NOT: return t.isNot;
|
|
295
|
+
case X.CONTAINS: return t.contains;
|
|
296
|
+
case X.IN: return t.in ?? q.operators.in;
|
|
297
|
+
case X.NOT_IN: return t.notIn ?? q.operators.notIn;
|
|
298
|
+
case X.BEFORE: return t.before;
|
|
299
|
+
case X.AFTER: return t.after;
|
|
300
|
+
case X.BETWEEN: return t.between;
|
|
301
|
+
case X.GT: return t.greaterThan;
|
|
302
|
+
case X.LT: return t.lessThan;
|
|
303
|
+
case X.HAS: return t.has;
|
|
304
|
+
case X.HAS_ANY: return t.hasAny;
|
|
305
|
+
case X.HAS_ALL: return t.hasAll;
|
|
306
|
+
default: return;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region src/components/features/filters/utils/filter-utils.ts
|
|
311
|
+
function dt(e, t) {
|
|
312
|
+
let n = e[0] ?? "";
|
|
313
|
+
return e.length > 1 ? [n, e[1] ?? ""] : t === "lt" ? ["", n] : t === "equals" ? [n, n] : [n, ""];
|
|
314
|
+
}
|
|
315
|
+
function ft(e) {
|
|
316
|
+
return e.length === 2 && e.every((e) => e.trim().length > 0);
|
|
317
|
+
}
|
|
318
|
+
function pt(e, t) {
|
|
319
|
+
if (e) {
|
|
320
|
+
if (t) {
|
|
321
|
+
let n = Ue(e, t, /* @__PURE__ */ new Date());
|
|
322
|
+
if (He(n)) return n;
|
|
323
|
+
}
|
|
324
|
+
return S(e) ?? void 0;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
function mt(e, t) {
|
|
328
|
+
for (let n of e ?? []) {
|
|
329
|
+
if (n.value === t) return [n];
|
|
330
|
+
let e = mt(n.children, t);
|
|
331
|
+
if (e.length) return [n, ...e];
|
|
332
|
+
}
|
|
333
|
+
return [];
|
|
334
|
+
}
|
|
335
|
+
function Z(e) {
|
|
336
|
+
return e.replace(/\S+/g, (e) => /^\p{Lu}{2,}/u.test(e) ? e : e.toLowerCase());
|
|
337
|
+
}
|
|
338
|
+
function ht(e) {
|
|
339
|
+
return !!e?.some((e) => !!e.children?.length);
|
|
340
|
+
}
|
|
341
|
+
function gt(e) {
|
|
342
|
+
return e.map((e) => ({
|
|
343
|
+
value: e.value,
|
|
344
|
+
label: e.label,
|
|
345
|
+
description: e.description,
|
|
346
|
+
icon: e.icon ?? void 0,
|
|
347
|
+
disabled: e.disabled,
|
|
348
|
+
...e.children?.length ? { children: gt(e.children) } : {}
|
|
349
|
+
}));
|
|
350
|
+
}
|
|
351
|
+
function _t(e, t, n = " / ") {
|
|
352
|
+
let r = mt(e.options, t);
|
|
353
|
+
return r.length ? r.map((e) => e.label).join(n) : void 0;
|
|
354
|
+
}
|
|
355
|
+
function vt(e, t, n) {
|
|
356
|
+
let r = e.validation, i = Array.isArray(t) ? t : [t], a = t == null || t === "" || Array.isArray(t) && t.every((e) => e == null || String(e).trim() === "");
|
|
357
|
+
if (r?.required && a) return n("validation.required");
|
|
358
|
+
if (r?.min !== void 0 || r?.max !== void 0) for (let t of i) {
|
|
359
|
+
let i = typeof t == "number" ? t : e.type === "range" && typeof t == "string" && t.trim() !== "" ? Number(t) : void 0;
|
|
360
|
+
if (i !== void 0) {
|
|
361
|
+
if (Number.isNaN(i)) return n("validation.invalidFormat");
|
|
362
|
+
if (r?.min !== void 0 && i < r.min) return n("validation.minValue").replace("{min}", String(r.min));
|
|
363
|
+
if (r?.max !== void 0 && i > r.max) return n("validation.maxValue").replace("{max}", String(r.max));
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
if (r?.pattern) {
|
|
367
|
+
let e = new RegExp(r.pattern.source, r.pattern.flags.replace(/[gy]/g, ""));
|
|
368
|
+
for (let t of i) if (typeof t == "string" && t !== "" && !e.test(t)) return n("validation.invalidFormat");
|
|
369
|
+
}
|
|
370
|
+
if (r?.custom) {
|
|
371
|
+
let e = r.custom(t);
|
|
372
|
+
if (typeof e == "string" || !e) return e;
|
|
373
|
+
}
|
|
374
|
+
return !0;
|
|
375
|
+
}
|
|
376
|
+
function Q(e, t, n) {
|
|
377
|
+
if (!e.validation) return;
|
|
378
|
+
let r = vt(e, t, (e) => {
|
|
379
|
+
let t = e.replace("validation.", "");
|
|
380
|
+
return n.validation[t] ?? e;
|
|
381
|
+
});
|
|
382
|
+
if (r !== !0) return typeof r == "string" && r ? r : n.validation.invalidFormat;
|
|
383
|
+
}
|
|
384
|
+
function yt(e) {
|
|
385
|
+
return e.type === "multi_select" || e.type === "tags" || e.multiple === !0;
|
|
386
|
+
}
|
|
387
|
+
function bt(e, t) {
|
|
388
|
+
if (e === t) return !0;
|
|
389
|
+
let n = e ?? [], r = t ?? [];
|
|
390
|
+
return n.length === r.length && n.every((e, t) => e === r[t]);
|
|
391
|
+
}
|
|
392
|
+
//#endregion
|
|
393
|
+
//#region src/components/features/filters/filter-context.tsx
|
|
394
|
+
var xt = Ce(void 0), St = [];
|
|
395
|
+
function Ct(e, t) {
|
|
396
|
+
let n = /* @__PURE__ */ new Map();
|
|
397
|
+
for (let r of e) {
|
|
398
|
+
if (r.type !== Y.ASYNC_SELECT) continue;
|
|
399
|
+
let e = r.asyncConfig?.fetcher, i = r.asyncConfig?.mapToOption, a = r.asyncConfig?.limit ?? 10, o = t.get(r.key), s = o && o.fetcher === e && o.mapToOption === i;
|
|
400
|
+
n.set(r.key, s && o.limit === a ? o : {
|
|
401
|
+
fetcher: e,
|
|
402
|
+
mapToOption: i,
|
|
403
|
+
limit: a,
|
|
404
|
+
options: s ? o.options : /* @__PURE__ */ new Map()
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
return n.size === t.size && [...n].every(([e, n]) => t.get(e) === n) ? t : n;
|
|
408
|
+
}
|
|
409
|
+
function wt(e, t) {
|
|
410
|
+
return e?.type === Y.RANGE ? t.some((e) => e.trim().length > 0) ? t : St : t.every((e) => e.trim().length > 0) ? t : t.filter((e) => e.trim().length > 0);
|
|
411
|
+
}
|
|
412
|
+
function Tt({ children: e, filters: t, activeFilters: n, onFilterChange: i, navigating: a = !1, strings: o, onError: s }) {
|
|
413
|
+
let c = U(t), l = U(i), u = U(s);
|
|
414
|
+
u.current = s;
|
|
415
|
+
let [d, f] = W(() => /* @__PURE__ */ new Map()), p = U(d), m = B((e) => {
|
|
416
|
+
p.current = e, f(e);
|
|
417
|
+
}, []), h = B((e, t) => {
|
|
418
|
+
m(new Map(p.current).set(e, t));
|
|
419
|
+
}, [m]), g = B((e) => {
|
|
420
|
+
if (!p.current.has(e)) return;
|
|
421
|
+
let t = new Map(p.current);
|
|
422
|
+
t.delete(e), m(t);
|
|
423
|
+
}, [m]), [_, v] = W(0), [y, b] = W(() => Ct(t, /* @__PURE__ */ new Map())), x = H(() => Ct(t, y), [t, y]);
|
|
424
|
+
x !== y && b(x);
|
|
425
|
+
let S = U(n), C = U(null), w = B(() => {
|
|
426
|
+
let e = C.current;
|
|
427
|
+
return e && e.base === S.current ? e.next : S.current;
|
|
428
|
+
}, []), T = B((e) => {
|
|
429
|
+
let t = {
|
|
430
|
+
base: S.current,
|
|
431
|
+
next: e
|
|
432
|
+
};
|
|
433
|
+
C.current = t, queueMicrotask(() => {
|
|
434
|
+
C.current === t && (C.current = null);
|
|
435
|
+
}), l.current(e);
|
|
436
|
+
}, []), E = JSON.stringify(n.filter((e) => x.has(e.key)).map(({ key: e, value: t }) => [e, t])), D = r(q, o);
|
|
437
|
+
V(() => {
|
|
438
|
+
c.current = t;
|
|
439
|
+
}, [t]), Ee(() => {
|
|
440
|
+
S.current = n, C.current = null;
|
|
441
|
+
}, [n]), V(() => {
|
|
442
|
+
l.current = i;
|
|
443
|
+
}, [i]);
|
|
444
|
+
let O = B((e) => {
|
|
445
|
+
T([...w(), e]);
|
|
446
|
+
}, [T, w]), k = B((e) => {
|
|
447
|
+
let t = w();
|
|
448
|
+
g(t.find((t) => t.id === e)?.key ?? e), T(t.filter((t) => t.id !== e && t.key !== e));
|
|
449
|
+
}, [
|
|
450
|
+
g,
|
|
451
|
+
T,
|
|
452
|
+
w
|
|
453
|
+
]), A = B((e, t) => {
|
|
454
|
+
T(w().map((n) => n.id === e || n.key === e ? {
|
|
455
|
+
...n,
|
|
456
|
+
...t
|
|
457
|
+
} : n));
|
|
458
|
+
}, [T, w]), j = B(() => {
|
|
459
|
+
m(/* @__PURE__ */ new Map()), T([]);
|
|
460
|
+
}, [T, m]), M = B((e) => {
|
|
461
|
+
m(/* @__PURE__ */ new Map()), T(e);
|
|
462
|
+
}, [T, m]), N = B((e) => c.current.find((t) => t.key === e), []), P = B((e) => n.find((t) => t.key === e)?.value ?? St, [n]), ee = B((e) => {
|
|
463
|
+
let r = n.find((t) => t.key === e), i = t.find((t) => t.key === e);
|
|
464
|
+
return d.get(e) ?? r?.operator ?? ct(i);
|
|
465
|
+
}, [
|
|
466
|
+
n,
|
|
467
|
+
d,
|
|
468
|
+
t
|
|
469
|
+
]), F = B((e, t) => {
|
|
470
|
+
let n = N(e), r = wt(n, t), i = w().find((t) => t.key === e), a = p.current.get(e), o = a ?? i?.operator ?? ct(n);
|
|
471
|
+
n?.type === Y.DATE && o === "between" && r.length > 0 && !ft(r) || (g(e), r.length === 0 ? i && k(e) : i ? A(e, a ? {
|
|
472
|
+
value: r,
|
|
473
|
+
operator: a
|
|
474
|
+
} : { value: r }) : O({
|
|
475
|
+
id: e,
|
|
476
|
+
key: e,
|
|
477
|
+
value: r,
|
|
478
|
+
operator: o
|
|
479
|
+
}));
|
|
480
|
+
}, [
|
|
481
|
+
O,
|
|
482
|
+
g,
|
|
483
|
+
N,
|
|
484
|
+
w,
|
|
485
|
+
k,
|
|
486
|
+
A
|
|
487
|
+
]), I = B((e) => n.some((t) => t.key === e && t.value.length > 0), [n]), L = B((e, t) => {
|
|
488
|
+
let n = w().find((t) => t.key === e);
|
|
489
|
+
if (!n) {
|
|
490
|
+
h(e, t);
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
if (N(e)?.type === Y.DATE) {
|
|
494
|
+
if (t === "between" && !ft(n.value)) {
|
|
495
|
+
h(e, t);
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
g(e);
|
|
499
|
+
let r = t === "between" ? n.value : n.value.slice(0, 1);
|
|
500
|
+
A(e, {
|
|
501
|
+
operator: t,
|
|
502
|
+
value: r
|
|
503
|
+
});
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
A(e, { operator: t });
|
|
507
|
+
}, [
|
|
508
|
+
g,
|
|
509
|
+
N,
|
|
510
|
+
w,
|
|
511
|
+
h,
|
|
512
|
+
A
|
|
513
|
+
]), R = B((e, t) => {
|
|
514
|
+
let n = c.current.find((t) => t.key === e);
|
|
515
|
+
return n ? vt(n, t, (e) => Xe(D, e)) : !1;
|
|
516
|
+
}, [D]), te = B((e) => c.current.filter((t) => t.dependencies?.some((t) => t.key === e)), []), z = B((e, t) => {
|
|
517
|
+
let n = x.get(e)?.options;
|
|
518
|
+
if (!n) return;
|
|
519
|
+
let r = !1;
|
|
520
|
+
for (let e of t) n.get(e.value)?.label !== e.label && (r = !0), n.set(e.value, e);
|
|
521
|
+
r && v((e) => e + 1);
|
|
522
|
+
}, [x]), ne = B((e, t) => x.get(e)?.options.get(t)?.label, [x, _]), re = B((e, t) => {
|
|
523
|
+
u.current?.(e, t);
|
|
524
|
+
}, []);
|
|
525
|
+
V(() => {
|
|
526
|
+
let e = new AbortController(), t = (t, n) => {
|
|
527
|
+
e.signal.aborted || t && t.name === "AbortError" || u.current?.(t, {
|
|
528
|
+
phase: "fetch-options",
|
|
529
|
+
filterKey: n
|
|
530
|
+
});
|
|
531
|
+
}, n = new Map(JSON.parse(E));
|
|
532
|
+
for (let [r, i] of x) {
|
|
533
|
+
let a = n.get(r);
|
|
534
|
+
if (!a || a.length === 0) continue;
|
|
535
|
+
let o = a.filter((e) => !i.options.has(e));
|
|
536
|
+
if (o.length === 0) continue;
|
|
537
|
+
let { fetcher: s, mapToOption: l, limit: u } = i;
|
|
538
|
+
if (!l) continue;
|
|
539
|
+
let d = c.current.find((e) => e.key === r)?.asyncConfig?.resolveOptions, f = d ? d({
|
|
540
|
+
values: o,
|
|
541
|
+
signal: e.signal
|
|
542
|
+
}) : s?.({
|
|
543
|
+
query: "",
|
|
544
|
+
limit: u,
|
|
545
|
+
signal: e.signal
|
|
546
|
+
});
|
|
547
|
+
f && f.then((t) => {
|
|
548
|
+
e.signal.aborted || z(r, t.map(l));
|
|
549
|
+
}).catch((e) => t(e, r));
|
|
550
|
+
}
|
|
551
|
+
return () => e.abort();
|
|
552
|
+
}, [
|
|
553
|
+
E,
|
|
554
|
+
x,
|
|
555
|
+
z
|
|
556
|
+
]);
|
|
557
|
+
let ie = H(() => ({
|
|
558
|
+
activeFilters: n,
|
|
559
|
+
filters: t,
|
|
560
|
+
addFilter: O,
|
|
561
|
+
removeFilter: k,
|
|
562
|
+
updateFilter: A,
|
|
563
|
+
clearFilters: j,
|
|
564
|
+
replaceFilters: M,
|
|
565
|
+
getFilterByKey: N,
|
|
566
|
+
getFilterValue: P,
|
|
567
|
+
setFilterValue: F,
|
|
568
|
+
isFilterActive: I,
|
|
569
|
+
getFilterOperator: ee,
|
|
570
|
+
setFilterOperator: L,
|
|
571
|
+
validateFilter: R,
|
|
572
|
+
getDependentFilters: te,
|
|
573
|
+
isNavigating: a,
|
|
574
|
+
strings: D,
|
|
575
|
+
cacheAsyncOptions: z,
|
|
576
|
+
getAsyncOptionLabel: ne,
|
|
577
|
+
reportError: re
|
|
578
|
+
}), [
|
|
579
|
+
n,
|
|
580
|
+
t,
|
|
581
|
+
O,
|
|
582
|
+
k,
|
|
583
|
+
A,
|
|
584
|
+
j,
|
|
585
|
+
M,
|
|
586
|
+
N,
|
|
587
|
+
P,
|
|
588
|
+
F,
|
|
589
|
+
I,
|
|
590
|
+
ee,
|
|
591
|
+
L,
|
|
592
|
+
R,
|
|
593
|
+
te,
|
|
594
|
+
a,
|
|
595
|
+
D,
|
|
596
|
+
z,
|
|
597
|
+
ne,
|
|
598
|
+
re
|
|
599
|
+
]);
|
|
600
|
+
return /* @__PURE__ */ G(xt.Provider, {
|
|
601
|
+
value: ie,
|
|
602
|
+
children: e
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
function $() {
|
|
606
|
+
let e = we(xt);
|
|
607
|
+
if (!e) throw Error("useFilters must be used within a FilterProvider");
|
|
608
|
+
return e;
|
|
609
|
+
}
|
|
610
|
+
//#endregion
|
|
611
|
+
//#region src/components/features/filters/hooks/use-filter-groups.ts
|
|
612
|
+
function Et(e = {}) {
|
|
613
|
+
let { dynamicFilterOptions: t } = e, { filters: n, isFilterActive: r } = $(), i = H(() => t ? n.map((e) => {
|
|
614
|
+
let n = t[e.key];
|
|
615
|
+
return Array.isArray(n) ? {
|
|
616
|
+
...e,
|
|
617
|
+
options: n
|
|
618
|
+
} : e;
|
|
619
|
+
}) : n, [n, t]);
|
|
620
|
+
return H(() => {
|
|
621
|
+
let e = i.filter((e) => e.type === Y.SEARCH), t = i.filter((e) => !e.displayConfig?.hidden && e.displayConfig?.display !== "hidden"), n = i.filter((e) => e.type !== Y.SEARCH && !e.displayConfig?.hidden && e.displayConfig?.display !== "hidden" && r(e.key)), a = t.filter((e) => e.type !== Y.SEARCH && !r(e.key) && e.displayConfig?.display === "always"), o = t.filter((e) => e.type !== Y.SEARCH && !r(e.key) && e.displayConfig?.display !== "always"), s = n.map((e) => e.key);
|
|
622
|
+
return {
|
|
623
|
+
processedFilters: i,
|
|
624
|
+
searchFilters: e,
|
|
625
|
+
alwaysVisibleFilters: a,
|
|
626
|
+
activeRegularFilters: n,
|
|
627
|
+
popoverFilters: o,
|
|
628
|
+
activeFilterKeys: s,
|
|
629
|
+
hasActive: s.length > 0
|
|
630
|
+
};
|
|
631
|
+
}, [i, r]);
|
|
632
|
+
}
|
|
633
|
+
//#endregion
|
|
634
|
+
//#region src/components/features/filters/partials/filter-operator-select.tsx
|
|
635
|
+
function Dt({ operator: e, operators: t, onOperatorChange: n, disabled: r = !1, segmentResetClassName: a }) {
|
|
636
|
+
let [c, u] = W(!1), { strings: d } = $(), f = t.find((t) => t.value === e)?.label || ut(e, d.operators) || e;
|
|
637
|
+
return /* @__PURE__ */ G(me, {
|
|
638
|
+
open: c && !r,
|
|
639
|
+
onOpenChange: (e) => u(e && !r),
|
|
640
|
+
search: !1,
|
|
641
|
+
contentLabel: d.operator,
|
|
642
|
+
trigger: /* @__PURE__ */ G(l, {
|
|
643
|
+
tone: "secondary",
|
|
644
|
+
buttonStyle: "ghost",
|
|
645
|
+
className: i("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"),
|
|
646
|
+
onClick: (e) => {
|
|
647
|
+
e.stopPropagation();
|
|
648
|
+
},
|
|
649
|
+
type: "button",
|
|
650
|
+
children: /* @__PURE__ */ G(o, {
|
|
651
|
+
tag: "span",
|
|
652
|
+
type: "inherit",
|
|
653
|
+
children: f
|
|
654
|
+
})
|
|
655
|
+
}),
|
|
656
|
+
header: /* @__PURE__ */ G(s, {
|
|
657
|
+
tag: "span",
|
|
658
|
+
children: d.operator
|
|
659
|
+
}),
|
|
660
|
+
contentClassName: _.xs,
|
|
661
|
+
items: t.map((t) => ({
|
|
662
|
+
value: t.value,
|
|
663
|
+
label: t.label,
|
|
664
|
+
selected: t.value === e
|
|
665
|
+
})),
|
|
666
|
+
onSelect: (e) => {
|
|
667
|
+
n(e.value), u(!1);
|
|
668
|
+
}
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
//#endregion
|
|
672
|
+
//#region src/components/features/filters/partials/filter-value-display.tsx
|
|
673
|
+
function Ot({ filter: e, value: t }) {
|
|
674
|
+
let { strings: n, getFilterOperator: r } = $();
|
|
675
|
+
if (t.length === 0 && e.type !== Y.DATE) return /* @__PURE__ */ G(o, {
|
|
676
|
+
tag: "span",
|
|
677
|
+
type: "secondary",
|
|
678
|
+
lineHeight: "none",
|
|
679
|
+
className: "filter-value-display--component",
|
|
680
|
+
children: n.nothingSelected
|
|
681
|
+
});
|
|
682
|
+
if (e.type === Y.RANGE) {
|
|
683
|
+
let [i, a] = dt(t, r(e.key)), s = i && a ? `${i} – ${a}` : i ? `${n.min} ${i}` : a ? `${n.max} ${a}` : n.nothingSelected;
|
|
684
|
+
return /* @__PURE__ */ G(o, {
|
|
685
|
+
tag: "span",
|
|
686
|
+
type: "inherit",
|
|
687
|
+
weight: "semibold",
|
|
688
|
+
lineHeight: "none",
|
|
689
|
+
className: "filter-value-display--component",
|
|
690
|
+
children: s
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
return e.type === Y.ASYNC_SELECT && !e.options?.length ? /* @__PURE__ */ G(o, {
|
|
694
|
+
tag: "span",
|
|
695
|
+
type: "inherit",
|
|
696
|
+
weight: "semibold",
|
|
697
|
+
lineHeight: "none",
|
|
698
|
+
className: "filter-value-display--component",
|
|
699
|
+
children: At(e, t, n)
|
|
700
|
+
}) : e.options && e.type !== Y.DATE ? /* @__PURE__ */ K(d, {
|
|
701
|
+
direction: "horizontal",
|
|
702
|
+
gap: "xs",
|
|
703
|
+
wrap: !1,
|
|
704
|
+
className: "filter-value-display--component",
|
|
705
|
+
children: [/* @__PURE__ */ K("div", {
|
|
706
|
+
className: "relative isolate flex",
|
|
707
|
+
children: [t.slice(0, 2).map((t, n) => {
|
|
708
|
+
let r = mt(e.options, t).at(-1);
|
|
709
|
+
return r?.icon ? /* @__PURE__ */ G("div", {
|
|
710
|
+
className: i("border-background bg-background relative rounded-full border", n > 0 ? "-ml-space-sm z-[1]" : T.raised),
|
|
711
|
+
children: r.icon
|
|
712
|
+
}, t) : null;
|
|
713
|
+
}), t.length > 2 && /* @__PURE__ */ G("div", {
|
|
714
|
+
className: "bg-muted border-background relative z-0 -ml-space-sm flex size-icon items-center justify-center rounded-full border",
|
|
715
|
+
children: /* @__PURE__ */ K(o, {
|
|
716
|
+
tag: "span",
|
|
717
|
+
size: "xs",
|
|
718
|
+
weight: "medium",
|
|
719
|
+
children: ["+", /* @__PURE__ */ G(b, {
|
|
720
|
+
value: t.length - 2,
|
|
721
|
+
size: "inherit",
|
|
722
|
+
align: "center"
|
|
723
|
+
})]
|
|
724
|
+
})
|
|
725
|
+
})]
|
|
726
|
+
}), /* @__PURE__ */ G(o, {
|
|
727
|
+
tag: "span",
|
|
728
|
+
type: "inherit",
|
|
729
|
+
weight: "semibold",
|
|
730
|
+
lineHeight: "none",
|
|
731
|
+
className: "truncate",
|
|
732
|
+
children: jt(e, t, n)
|
|
733
|
+
})]
|
|
734
|
+
}) : e.type === Y.DATE ? /* @__PURE__ */ K(d, {
|
|
735
|
+
direction: "horizontal",
|
|
736
|
+
gap: "xs",
|
|
737
|
+
wrap: !1,
|
|
738
|
+
className: "filter-value-display--component",
|
|
739
|
+
children: [/* @__PURE__ */ G(Oe, { className: "text-muted-foreground size-icon-sm" }), /* @__PURE__ */ G(o, {
|
|
740
|
+
tag: "span",
|
|
741
|
+
type: "inherit",
|
|
742
|
+
weight: "semibold",
|
|
743
|
+
lineHeight: "none",
|
|
744
|
+
className: "min-w-0 truncate",
|
|
745
|
+
children: kt(e, t, n)
|
|
746
|
+
})]
|
|
747
|
+
}) : /* @__PURE__ */ G(o, {
|
|
748
|
+
tag: "span",
|
|
749
|
+
type: "inherit",
|
|
750
|
+
weight: "semibold",
|
|
751
|
+
lineHeight: "none",
|
|
752
|
+
className: "filter-value-display--component truncate",
|
|
753
|
+
children: jt(e, t, n)
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
function kt(e, t, n) {
|
|
757
|
+
return t.length === 1 ? Mt(t[0], e.dateFormat) : t.length === 2 ? Nt(t[0], t[1], e.dateFormat) : /* @__PURE__ */ G(y, { children: e.datePickerConfig?.noDatePlaceholder || n.calendar.notDateSelected });
|
|
758
|
+
}
|
|
759
|
+
function At(e, t, n) {
|
|
760
|
+
return t.length === 0 ? "" : J(n.selected, {
|
|
761
|
+
count: t.length,
|
|
762
|
+
filterLabel: Z((t.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
function jt(e, t, n) {
|
|
766
|
+
return t.length > 1 ? J(n.selected, {
|
|
767
|
+
count: t.length,
|
|
768
|
+
filterLabel: Z(e.pluralLabel ?? e.label)
|
|
769
|
+
}) : t.map((t) => _t(e, t) || t).join(", ");
|
|
770
|
+
}
|
|
771
|
+
function Mt(e, t) {
|
|
772
|
+
let n = pt(e, t?.param);
|
|
773
|
+
return n ? /* @__PURE__ */ G(C, {
|
|
774
|
+
value: n,
|
|
775
|
+
format: t?.display
|
|
776
|
+
}) : /* @__PURE__ */ G(y, { children: e });
|
|
777
|
+
}
|
|
778
|
+
function Nt(e, t, n) {
|
|
779
|
+
let r = pt(e, n?.param), i = pt(t, n?.param);
|
|
780
|
+
return r && i ? /* @__PURE__ */ G(x, {
|
|
781
|
+
from: r,
|
|
782
|
+
to: i,
|
|
783
|
+
format: n?.display
|
|
784
|
+
}) : /* @__PURE__ */ K("span", {
|
|
785
|
+
className: "inline-flex min-w-0 items-center gap-space-xs",
|
|
786
|
+
children: [
|
|
787
|
+
Mt(e, n),
|
|
788
|
+
/* @__PURE__ */ G(y, { children: "–" }),
|
|
789
|
+
Mt(t, n)
|
|
790
|
+
]
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
//#endregion
|
|
794
|
+
//#region src/components/features/filters/partials/active-filter-item.tsx
|
|
795
|
+
function Pt() {
|
|
796
|
+
return /* @__PURE__ */ G("div", {
|
|
797
|
+
"aria-hidden": !0,
|
|
798
|
+
className: i("w-px self-stretch", m.segmentDivider)
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
function Ft({ filter: t, value: r, active: a, popoverOpen: s, triggerRef: u, operators: d, operator: f, onOperatorChange: p, onFilterClear: m, onFilterClick: h }) {
|
|
802
|
+
let { defaultScale: g } = n(), _ = e(void 0, g), { strings: v, isNavigating: y } = $(), b = xe.useId(), x = xe.useId(), S = `${le.joinedItem} !border-0 !rounded-none !shadow-none ${c.inset}`;
|
|
803
|
+
return /* @__PURE__ */ K("div", {
|
|
804
|
+
role: "group",
|
|
805
|
+
"aria-label": t.label,
|
|
806
|
+
"aria-busy": y || void 0,
|
|
807
|
+
"data-active": a || void 0,
|
|
808
|
+
className: i("active-filter-item--component", le.joinedFrame, ue[_], "bg-background", y && "pointer-events-none opacity-50", t.displayConfig?.className),
|
|
809
|
+
children: [
|
|
810
|
+
/* @__PURE__ */ K(l, {
|
|
811
|
+
type: "button",
|
|
812
|
+
tone: "secondary",
|
|
813
|
+
buttonStyle: "ghost",
|
|
814
|
+
className: i(S, "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"),
|
|
815
|
+
ref: u,
|
|
816
|
+
"aria-haspopup": "dialog",
|
|
817
|
+
"aria-expanded": s,
|
|
818
|
+
onClick: y ? void 0 : h,
|
|
819
|
+
children: [
|
|
820
|
+
!!t.icon && /* @__PURE__ */ G("span", {
|
|
821
|
+
className: "flex items-center text-muted-foreground",
|
|
822
|
+
children: t.icon
|
|
823
|
+
}),
|
|
824
|
+
/* @__PURE__ */ G(o, {
|
|
825
|
+
id: b,
|
|
826
|
+
tag: "span",
|
|
827
|
+
type: "inherit",
|
|
828
|
+
weight: "semibold",
|
|
829
|
+
children: t.label
|
|
830
|
+
}),
|
|
831
|
+
/* @__PURE__ */ G(Ae, { className: "size-icon-sm" })
|
|
832
|
+
]
|
|
833
|
+
}),
|
|
834
|
+
/* @__PURE__ */ G(Pt, {}),
|
|
835
|
+
/* @__PURE__ */ G(Dt, {
|
|
836
|
+
operator: f,
|
|
837
|
+
operators: d,
|
|
838
|
+
onOperatorChange: p,
|
|
839
|
+
disabled: y,
|
|
840
|
+
segmentResetClassName: S
|
|
841
|
+
}),
|
|
842
|
+
/* @__PURE__ */ G(Pt, {}),
|
|
843
|
+
/* @__PURE__ */ G(l, {
|
|
844
|
+
type: "button",
|
|
845
|
+
tone: "secondary",
|
|
846
|
+
buttonStyle: "ghost",
|
|
847
|
+
"aria-labelledby": `${b} ${x}`,
|
|
848
|
+
"aria-haspopup": "dialog",
|
|
849
|
+
"aria-expanded": s,
|
|
850
|
+
onClick: y ? void 0 : h,
|
|
851
|
+
className: i(S, "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"),
|
|
852
|
+
children: /* @__PURE__ */ G("span", {
|
|
853
|
+
id: x,
|
|
854
|
+
className: "min-w-0",
|
|
855
|
+
children: /* @__PURE__ */ G(Ot, {
|
|
856
|
+
filter: t,
|
|
857
|
+
value: r
|
|
858
|
+
})
|
|
859
|
+
})
|
|
860
|
+
}),
|
|
861
|
+
!!a && /* @__PURE__ */ K(De, { children: [/* @__PURE__ */ G(Pt, {}), /* @__PURE__ */ K(l, {
|
|
862
|
+
type: "button",
|
|
863
|
+
tone: "secondary",
|
|
864
|
+
buttonStyle: "ghost",
|
|
865
|
+
className: i(S, "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"),
|
|
866
|
+
onClick: (e) => {
|
|
867
|
+
e.stopPropagation(), e.preventDefault(), y || m();
|
|
868
|
+
},
|
|
869
|
+
children: [/* @__PURE__ */ G(Ie, {
|
|
870
|
+
"aria-hidden": "true",
|
|
871
|
+
className: "size-icon"
|
|
872
|
+
}), /* @__PURE__ */ G(o, {
|
|
873
|
+
tag: "span",
|
|
874
|
+
className: "sr-only",
|
|
875
|
+
children: v.clear
|
|
876
|
+
})]
|
|
877
|
+
})] })
|
|
878
|
+
]
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
//#endregion
|
|
882
|
+
//#region src/components/features/filters/hooks/use-async-options.ts
|
|
883
|
+
function It(e, t, n) {
|
|
884
|
+
for (let [t, r] of e) Date.now() - r.timestamp > n && e.delete(t);
|
|
885
|
+
return e.get(t);
|
|
886
|
+
}
|
|
887
|
+
function Lt(e, t, n, r = {}) {
|
|
888
|
+
let { asyncConfig: i } = e, a = i?.fetcher, o = i?.mapToOption, s = H(() => /* @__PURE__ */ new Map(), [
|
|
889
|
+
e.key,
|
|
890
|
+
a,
|
|
891
|
+
o
|
|
892
|
+
]), c = U(r.onError);
|
|
893
|
+
c.current = r.onError;
|
|
894
|
+
let l = i?.debounceMs ?? e.delay ?? 300, u = (ge(t, l) ?? "").trim(), d = i?.limit ?? 10, f = i?.minQueryLength ?? 0, p = i?.preload ?? !0, m = i?.staleTime ?? 6e4, h = i?.gcTime ?? 3e5, g = u.length === 0 && p, _ = u.length >= f, v = !!i?.fetcher && n && (g || u.length > 0 && _), y = n && !g && u.length > 0 && u.length < f, b = H(() => i?.queryKey ? JSON.stringify(i.queryKey({
|
|
895
|
+
query: u,
|
|
896
|
+
limit: d
|
|
897
|
+
})) : JSON.stringify([
|
|
898
|
+
"filter",
|
|
899
|
+
e.key,
|
|
900
|
+
u,
|
|
901
|
+
d
|
|
902
|
+
]), [
|
|
903
|
+
i,
|
|
904
|
+
e.key,
|
|
905
|
+
u,
|
|
906
|
+
d
|
|
907
|
+
]), x = B(async (e) => a && o ? (await a({
|
|
908
|
+
query: u,
|
|
909
|
+
limit: d,
|
|
910
|
+
signal: e
|
|
911
|
+
})).map(o) : [], [
|
|
912
|
+
a,
|
|
913
|
+
o,
|
|
914
|
+
u,
|
|
915
|
+
d
|
|
916
|
+
]), [S, C] = W(() => {
|
|
917
|
+
let e = It(s, b, h);
|
|
918
|
+
return {
|
|
919
|
+
cache: s,
|
|
920
|
+
data: e?.data ?? [],
|
|
921
|
+
loading: !1,
|
|
922
|
+
fetching: !1,
|
|
923
|
+
error: !1
|
|
924
|
+
};
|
|
925
|
+
}), [w, T] = W(0), E = B(() => T((e) => e + 1), []), D = U(0);
|
|
926
|
+
return V(() => {
|
|
927
|
+
let t = D.current !== w;
|
|
928
|
+
if (D.current = w, !v) return;
|
|
929
|
+
let n = It(s, b, h), r = n !== void 0 && Date.now() - n.timestamp < m, i = new AbortController();
|
|
930
|
+
if (r && !t) return C({
|
|
931
|
+
cache: s,
|
|
932
|
+
data: n.data,
|
|
933
|
+
loading: !1,
|
|
934
|
+
fetching: !1,
|
|
935
|
+
error: !1
|
|
936
|
+
}), () => i.abort();
|
|
937
|
+
C((e) => ({
|
|
938
|
+
cache: s,
|
|
939
|
+
data: n?.data ?? (e.cache === s ? e.data : []),
|
|
940
|
+
loading: n === void 0,
|
|
941
|
+
fetching: !0,
|
|
942
|
+
error: !1
|
|
943
|
+
}));
|
|
944
|
+
let a = !1;
|
|
945
|
+
return x(i.signal).then((e) => {
|
|
946
|
+
a || (s.set(b, {
|
|
947
|
+
timestamp: Date.now(),
|
|
948
|
+
data: e
|
|
949
|
+
}), C({
|
|
950
|
+
cache: s,
|
|
951
|
+
data: e,
|
|
952
|
+
loading: !1,
|
|
953
|
+
fetching: !1,
|
|
954
|
+
error: !1
|
|
955
|
+
}));
|
|
956
|
+
}).catch((t) => {
|
|
957
|
+
a || i.signal.aborted || t && t.name === "AbortError" || (C((e) => ({
|
|
958
|
+
cache: s,
|
|
959
|
+
data: e.cache === s ? e.data : [],
|
|
960
|
+
loading: !1,
|
|
961
|
+
fetching: !1,
|
|
962
|
+
error: !0
|
|
963
|
+
})), c.current?.(t, {
|
|
964
|
+
phase: "fetch-options",
|
|
965
|
+
filterKey: e.key
|
|
966
|
+
}));
|
|
967
|
+
}), () => {
|
|
968
|
+
a = !0, i.abort();
|
|
969
|
+
};
|
|
970
|
+
}, [
|
|
971
|
+
s,
|
|
972
|
+
b,
|
|
973
|
+
x,
|
|
974
|
+
v,
|
|
975
|
+
m,
|
|
976
|
+
h,
|
|
977
|
+
w,
|
|
978
|
+
e.key
|
|
979
|
+
]), {
|
|
980
|
+
options: v && S.cache === s ? S.data : [],
|
|
981
|
+
isLoading: v && S.cache === s && S.loading,
|
|
982
|
+
isFetching: v && S.cache === s && S.fetching,
|
|
983
|
+
isError: v && S.cache === s && S.error,
|
|
984
|
+
refetch: E,
|
|
985
|
+
isBelowMinQuery: y,
|
|
986
|
+
minQueryLength: f
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
//#endregion
|
|
990
|
+
//#region src/components/features/filters/hooks/use-filter-draft.ts
|
|
991
|
+
function Rt(e) {
|
|
992
|
+
let [t, n] = W(() => ({
|
|
993
|
+
applied: e,
|
|
994
|
+
draft: e ?? []
|
|
995
|
+
})), r = t.draft;
|
|
996
|
+
t.applied !== e && (bt(t.applied, e) || (r = e ?? []), n({
|
|
997
|
+
applied: e,
|
|
998
|
+
draft: r
|
|
999
|
+
}));
|
|
1000
|
+
let i = B((e) => {
|
|
1001
|
+
n((t) => ({
|
|
1002
|
+
...t,
|
|
1003
|
+
draft: e
|
|
1004
|
+
}));
|
|
1005
|
+
}, []);
|
|
1006
|
+
return [r, i];
|
|
1007
|
+
}
|
|
1008
|
+
//#endregion
|
|
1009
|
+
//#region src/components/features/filters/partials/async-options-status.tsx
|
|
1010
|
+
function zt({ fetching: e, error: t, onRetry: n }) {
|
|
1011
|
+
let { strings: r } = $();
|
|
1012
|
+
return e ? /* @__PURE__ */ K(d, {
|
|
1013
|
+
direction: "horizontal",
|
|
1014
|
+
gap: "sm",
|
|
1015
|
+
wrap: !1,
|
|
1016
|
+
className: "px-control-sm py-space-xs",
|
|
1017
|
+
children: [/* @__PURE__ */ G(Pe, {
|
|
1018
|
+
"aria-hidden": "true",
|
|
1019
|
+
className: "text-muted-foreground size-icon-sm animate-spin"
|
|
1020
|
+
}), /* @__PURE__ */ G(o, {
|
|
1021
|
+
tag: "span",
|
|
1022
|
+
size: "xs",
|
|
1023
|
+
type: "secondary",
|
|
1024
|
+
children: r.searching
|
|
1025
|
+
})]
|
|
1026
|
+
}) : t ? /* @__PURE__ */ G(g, {
|
|
1027
|
+
variant: "inline",
|
|
1028
|
+
title: r.fetchError,
|
|
1029
|
+
action: /* @__PURE__ */ G(l, {
|
|
1030
|
+
tone: "secondary",
|
|
1031
|
+
buttonStyle: "outline",
|
|
1032
|
+
size: "sm",
|
|
1033
|
+
onClick: (e) => {
|
|
1034
|
+
e.stopPropagation(), n();
|
|
1035
|
+
},
|
|
1036
|
+
children: r.retryFetch
|
|
1037
|
+
})
|
|
1038
|
+
}) : null;
|
|
1039
|
+
}
|
|
1040
|
+
function Bt({ fetching: e, error: t, count: n, hasRows: r }) {
|
|
1041
|
+
let { strings: i } = $(), a = i.optionsFound ?? q.optionsFound, s = e ? r ? i.searching : "" : !t && n > 0 ? a?.(n) ?? "" : "";
|
|
1042
|
+
return /* @__PURE__ */ G(o, {
|
|
1043
|
+
tag: "span",
|
|
1044
|
+
role: "status",
|
|
1045
|
+
"aria-live": "polite",
|
|
1046
|
+
className: "sr-only",
|
|
1047
|
+
children: s
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
//#endregion
|
|
1051
|
+
//#region src/components/features/filters/partials/filter-draft-footer.tsx
|
|
1052
|
+
function Vt({ caption: e, error: t, onConfirm: n }) {
|
|
1053
|
+
let { strings: r } = $();
|
|
1054
|
+
return /* @__PURE__ */ G(ae, {
|
|
1055
|
+
caption: t ? /* @__PURE__ */ G(o, {
|
|
1056
|
+
tag: "span",
|
|
1057
|
+
size: "xs",
|
|
1058
|
+
type: "error",
|
|
1059
|
+
role: "alert",
|
|
1060
|
+
children: t
|
|
1061
|
+
}) : e,
|
|
1062
|
+
children: /* @__PURE__ */ G(l, {
|
|
1063
|
+
tone: "primary",
|
|
1064
|
+
size: "sm",
|
|
1065
|
+
onClick: n,
|
|
1066
|
+
disabled: !!t,
|
|
1067
|
+
children: r.confirm
|
|
1068
|
+
})
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
//#endregion
|
|
1072
|
+
//#region src/components/features/filters/partials/filter-editor-header.tsx
|
|
1073
|
+
function Ht({ title: e, description: t, onBack: n }) {
|
|
1074
|
+
let { strings: r } = $();
|
|
1075
|
+
return /* @__PURE__ */ K(ne, {
|
|
1076
|
+
start: n ? /* @__PURE__ */ G(l, {
|
|
1077
|
+
type: "button",
|
|
1078
|
+
tone: "secondary",
|
|
1079
|
+
buttonStyle: "ghost",
|
|
1080
|
+
size: "sm",
|
|
1081
|
+
iconOnly: !0,
|
|
1082
|
+
onClick: n,
|
|
1083
|
+
className: "shrink-0",
|
|
1084
|
+
"aria-label": r.backToFilters,
|
|
1085
|
+
children: /* @__PURE__ */ G(je, {
|
|
1086
|
+
"aria-hidden": "true",
|
|
1087
|
+
className: "size-icon-sm rtl:rotate-180"
|
|
1088
|
+
})
|
|
1089
|
+
}) : void 0,
|
|
1090
|
+
children: [/* @__PURE__ */ G(te, { children: e }), t != null && /* @__PURE__ */ G(re, { children: t })]
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
//#endregion
|
|
1094
|
+
//#region src/components/features/filters/partials/async-filter-content.tsx
|
|
1095
|
+
function Ut({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: i, triggerSource: a = "chip" }) {
|
|
1096
|
+
let { strings: s, cacheAsyncOptions: c, getAsyncOptionLabel: u, reportError: d } = $(), [f, p] = W(""), [m, _] = Rt(t), { options: v, isLoading: y, isFetching: b, isError: x, refetch: S, isBelowMinQuery: C, minQueryLength: w } = Lt(e, f, !0, { onError: d });
|
|
1097
|
+
V(() => {
|
|
1098
|
+
v.length > 0 && c(e.key, v);
|
|
1099
|
+
}, [
|
|
1100
|
+
c,
|
|
1101
|
+
e.key,
|
|
1102
|
+
v
|
|
1103
|
+
]);
|
|
1104
|
+
let T = e.multiple !== !1, E = e.maxSelected, M = a === "toolbar", P = m.length !== t.length || m.some((e) => !t.includes(e)), ee = P ? Q(e, m, s) : void 0, F = H(() => {
|
|
1105
|
+
let t = new Set(m), n = new Set(v.map((e) => e.value)), r = [];
|
|
1106
|
+
for (let t of m) if (!n.has(t)) {
|
|
1107
|
+
let n = u(e.key, t) ?? t;
|
|
1108
|
+
r.push({
|
|
1109
|
+
value: t,
|
|
1110
|
+
label: n,
|
|
1111
|
+
icon: e.icon
|
|
1112
|
+
});
|
|
1113
|
+
}
|
|
1114
|
+
return [...r, ...v].sort((e, n) => +!t.has(e.value) - !t.has(n.value));
|
|
1115
|
+
}, [
|
|
1116
|
+
v,
|
|
1117
|
+
m,
|
|
1118
|
+
e.key,
|
|
1119
|
+
e.icon,
|
|
1120
|
+
u
|
|
1121
|
+
]), I = (t) => {
|
|
1122
|
+
if (T) {
|
|
1123
|
+
if (m.includes(t)) _(m.filter((e) => e !== t));
|
|
1124
|
+
else {
|
|
1125
|
+
if (E && m.length >= E) return;
|
|
1126
|
+
_([...m, t]);
|
|
1127
|
+
}
|
|
1128
|
+
} else _([t]), e.closeOnSelect === !0 && (n([t]), i());
|
|
1129
|
+
}, L = () => {
|
|
1130
|
+
ee || (n(m), i());
|
|
1131
|
+
}, R = H(() => y || b ? /* @__PURE__ */ G(h, { label: s.searching }) : x ? /* @__PURE__ */ G(g, {
|
|
1132
|
+
variant: "inline",
|
|
1133
|
+
title: s.fetchError,
|
|
1134
|
+
action: /* @__PURE__ */ G(l, {
|
|
1135
|
+
tone: "secondary",
|
|
1136
|
+
buttonStyle: "outline",
|
|
1137
|
+
size: "sm",
|
|
1138
|
+
onClick: (e) => {
|
|
1139
|
+
e.stopPropagation(), S();
|
|
1140
|
+
},
|
|
1141
|
+
children: s.retryFetch
|
|
1142
|
+
})
|
|
1143
|
+
}) : C ? /* @__PURE__ */ G("div", {
|
|
1144
|
+
className: "text-muted-foreground flex items-center justify-center py-space-xl",
|
|
1145
|
+
children: /* @__PURE__ */ G(o, {
|
|
1146
|
+
tag: "span",
|
|
1147
|
+
size: "xs",
|
|
1148
|
+
type: "secondary",
|
|
1149
|
+
children: J(s.minQueryHint, { min: w })
|
|
1150
|
+
})
|
|
1151
|
+
}) : s.noOptionsFound, [
|
|
1152
|
+
y,
|
|
1153
|
+
b,
|
|
1154
|
+
x,
|
|
1155
|
+
C,
|
|
1156
|
+
w,
|
|
1157
|
+
s,
|
|
1158
|
+
S
|
|
1159
|
+
]), te = F.length === 0;
|
|
1160
|
+
return /* @__PURE__ */ K(De, { children: [
|
|
1161
|
+
/* @__PURE__ */ G(Ht, {
|
|
1162
|
+
title: e.label,
|
|
1163
|
+
description: s.selectValues,
|
|
1164
|
+
onBack: M ? r : void 0
|
|
1165
|
+
}),
|
|
1166
|
+
/* @__PURE__ */ K(N, {
|
|
1167
|
+
shouldFilter: !1,
|
|
1168
|
+
inset: "flush",
|
|
1169
|
+
className: "rounded-none",
|
|
1170
|
+
children: [/* @__PURE__ */ G(O, {
|
|
1171
|
+
placeholder: J(s.searchPlaceholder, { filterLabel: Z(e.label) }),
|
|
1172
|
+
value: f,
|
|
1173
|
+
onValueChange: p
|
|
1174
|
+
}), /* @__PURE__ */ G(A, {
|
|
1175
|
+
"aria-busy": b || void 0,
|
|
1176
|
+
children: te ? /* @__PURE__ */ G(k, { children: R }) : /* @__PURE__ */ K(j, { children: [/* @__PURE__ */ G(zt, {
|
|
1177
|
+
fetching: b,
|
|
1178
|
+
error: x,
|
|
1179
|
+
onRetry: S
|
|
1180
|
+
}), F.map((e) => /* @__PURE__ */ K(D, {
|
|
1181
|
+
onSelect: () => I(e.value),
|
|
1182
|
+
"data-checked": m.includes(e.value) || void 0,
|
|
1183
|
+
disabled: e.disabled || !!E && m.length >= E && !m.includes(e.value),
|
|
1184
|
+
className: "flex items-center gap-space-sm",
|
|
1185
|
+
children: [e.icon, /* @__PURE__ */ G(o, {
|
|
1186
|
+
tag: "span",
|
|
1187
|
+
type: "inherit",
|
|
1188
|
+
lineHeight: "tight",
|
|
1189
|
+
children: e.label
|
|
1190
|
+
})]
|
|
1191
|
+
}, e.value))] })
|
|
1192
|
+
})]
|
|
1193
|
+
}),
|
|
1194
|
+
/* @__PURE__ */ G(Bt, {
|
|
1195
|
+
fetching: b,
|
|
1196
|
+
error: x,
|
|
1197
|
+
count: v.length,
|
|
1198
|
+
hasRows: !te
|
|
1199
|
+
}),
|
|
1200
|
+
P && /* @__PURE__ */ G(Vt, {
|
|
1201
|
+
caption: J(s.selected, {
|
|
1202
|
+
count: m.length,
|
|
1203
|
+
filterLabel: Z((m.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
1204
|
+
}),
|
|
1205
|
+
error: ee,
|
|
1206
|
+
onConfirm: L
|
|
1207
|
+
})
|
|
1208
|
+
] });
|
|
1209
|
+
}
|
|
1210
|
+
//#endregion
|
|
1211
|
+
//#region src/components/features/filters/facets/date-facet.tsx
|
|
1212
|
+
var Wt = [], Gt = {
|
|
1213
|
+
today: (e) => ({
|
|
1214
|
+
from: e,
|
|
1215
|
+
to: e
|
|
1216
|
+
}),
|
|
1217
|
+
yesterday: (e) => ({
|
|
1218
|
+
from: Le(e, -1),
|
|
1219
|
+
to: Le(e, -1)
|
|
1220
|
+
}),
|
|
1221
|
+
thisWeek: (e, t) => ({
|
|
1222
|
+
from: Ge(e, { weekStartsOn: t }),
|
|
1223
|
+
to: ze(e, { weekStartsOn: t })
|
|
1224
|
+
}),
|
|
1225
|
+
lastSevenDays: (e) => ({
|
|
1226
|
+
from: Le(e, -6),
|
|
1227
|
+
to: e
|
|
1228
|
+
}),
|
|
1229
|
+
lastThirtyDays: (e) => ({
|
|
1230
|
+
from: Le(e, -30),
|
|
1231
|
+
to: e
|
|
1232
|
+
}),
|
|
1233
|
+
thisMonth: (e) => ({
|
|
1234
|
+
from: We(e),
|
|
1235
|
+
to: Re(e)
|
|
1236
|
+
}),
|
|
1237
|
+
lastMonth: (e) => ({
|
|
1238
|
+
from: We(qe(e, 1)),
|
|
1239
|
+
to: Re(qe(e, 1))
|
|
1240
|
+
}),
|
|
1241
|
+
thisYear: (e) => ({
|
|
1242
|
+
from: Ke(e),
|
|
1243
|
+
to: Be(e)
|
|
1244
|
+
}),
|
|
1245
|
+
lastYear: (e) => ({
|
|
1246
|
+
from: Ke(Je(e, 1)),
|
|
1247
|
+
to: Be(Je(e, 1))
|
|
1248
|
+
})
|
|
1249
|
+
};
|
|
1250
|
+
function Kt(e, t, n) {
|
|
1251
|
+
return e.map((e) => ({
|
|
1252
|
+
label: e === "thisWeek" ? t.thisWeek ?? L.thisWeek : t[e],
|
|
1253
|
+
getValue: () => Gt[e](/* @__PURE__ */ new Date(), n)
|
|
1254
|
+
}));
|
|
1255
|
+
}
|
|
1256
|
+
function qt({ filter: e, operator: n, value: r, onValueChange: a, className: o }) {
|
|
1257
|
+
let { strings: s } = $(), { weekStartsOn: c } = t(), l = n === void 0 ? e.operators?.some((e) => e.value === "between") || e.operator === "between" || e.key.toLowerCase().includes("range") || e.key.toLowerCase().includes("between") : n === "between", u = e.dateFormat?.param ?? "yyyy-MM-dd", d = e.dateFormat?.display ?? "PPP", f = l ? e.datePickerConfig?.noRangePlaceholder ?? e.placeholder ?? s.calendar.notDateRangeSelected : e.datePickerConfig?.noDatePlaceholder ?? e.placeholder ?? s.calendar.notDateSelected, p = !!e.datePickerConfig?.showConfirmButton, m = e.datePickerConfig?.autoApply ?? !p, h = e.datePickerConfig?.showShortcuts ?? !0, g = l && (r.start || r.end) ? {
|
|
1258
|
+
from: r.start,
|
|
1259
|
+
to: r.end
|
|
1260
|
+
} : void 0, _ = !l && r.start && He(r.start) ? r.start : void 0, v = s.calendar, y = e.datePickerConfig?.strings, b = {
|
|
1261
|
+
format: u,
|
|
1262
|
+
readableFormat: d,
|
|
1263
|
+
placeholder: f,
|
|
1264
|
+
strings: H(() => ({
|
|
1265
|
+
today: v.today,
|
|
1266
|
+
thisMonth: v.thisMonth,
|
|
1267
|
+
lastMonth: v.lastMonth,
|
|
1268
|
+
lastYear: v.lastYear,
|
|
1269
|
+
last30Days: v.lastThirtyDays,
|
|
1270
|
+
...v.thisWeek ? { thisWeek: v.thisWeek } : null,
|
|
1271
|
+
...v.from ? { from: v.from } : null,
|
|
1272
|
+
...v.to ? { to: v.to } : null,
|
|
1273
|
+
selectDate: s.selectDate,
|
|
1274
|
+
selectDateRange: s.selectDateRange,
|
|
1275
|
+
confirm: s.confirm,
|
|
1276
|
+
clear: s.clear,
|
|
1277
|
+
...y
|
|
1278
|
+
}), [
|
|
1279
|
+
v,
|
|
1280
|
+
y,
|
|
1281
|
+
s.selectDate,
|
|
1282
|
+
s.selectDateRange,
|
|
1283
|
+
s.confirm,
|
|
1284
|
+
s.clear
|
|
1285
|
+
]),
|
|
1286
|
+
locale: e.datePickerConfig?.locale,
|
|
1287
|
+
disablePortal: !0,
|
|
1288
|
+
numberOfMonths: 1,
|
|
1289
|
+
className: i("date-facet--component", "w-full", o)
|
|
1290
|
+
}, x = (e) => {
|
|
1291
|
+
a({
|
|
1292
|
+
start: e.date ?? void 0,
|
|
1293
|
+
end: void 0
|
|
1294
|
+
});
|
|
1295
|
+
}, S = (e) => {
|
|
1296
|
+
a({
|
|
1297
|
+
start: e.range?.from ?? void 0,
|
|
1298
|
+
end: e.range?.to ?? void 0
|
|
1299
|
+
});
|
|
1300
|
+
};
|
|
1301
|
+
if (l) {
|
|
1302
|
+
let t = e.datePickerConfig?.shortcuts, n = h ? e.datePickerConfig?.presets ?? (t ? Kt(t, v, c ?? 1) : void 0) : Wt;
|
|
1303
|
+
return /* @__PURE__ */ G(R, {
|
|
1304
|
+
mode: "range",
|
|
1305
|
+
value: g,
|
|
1306
|
+
onValueChange: S,
|
|
1307
|
+
withConfirm: p,
|
|
1308
|
+
closeOnSelect: m,
|
|
1309
|
+
presets: n,
|
|
1310
|
+
...b
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
return /* @__PURE__ */ G(R, {
|
|
1314
|
+
mode: "single",
|
|
1315
|
+
value: _,
|
|
1316
|
+
onValueChange: x,
|
|
1317
|
+
closeOnSelect: m,
|
|
1318
|
+
...b
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
//#endregion
|
|
1322
|
+
//#region src/components/features/filters/partials/date-filter-content.tsx
|
|
1323
|
+
function Jt({ filter: e, operator: t, value: n, onFilterChange: r, onBackToFilterList: i, triggerSource: a = "chip" }) {
|
|
1324
|
+
let { strings: s } = $(), [c, l] = W(), u = pt(n[0], e.dateFormat?.param), f = pt(n[1], e.dateFormat?.param), p = (t) => {
|
|
1325
|
+
if (t && He(t)) return Ve(t, e.dateFormat?.param ?? "yyyy-MM-dd");
|
|
1326
|
+
}, m = ({ start: t, end: n }) => {
|
|
1327
|
+
let i = [], a = p(t), o = p(n);
|
|
1328
|
+
a && i.push(a), o && i.push(o);
|
|
1329
|
+
let c = Q(e, i, s);
|
|
1330
|
+
l(c), c || r(i);
|
|
1331
|
+
}, h = a === "toolbar", g = {
|
|
1332
|
+
start: u,
|
|
1333
|
+
end: f
|
|
1334
|
+
};
|
|
1335
|
+
return /* @__PURE__ */ K("div", {
|
|
1336
|
+
className: "flex flex-col",
|
|
1337
|
+
children: [/* @__PURE__ */ G(Ht, {
|
|
1338
|
+
title: e.label,
|
|
1339
|
+
onBack: h ? i : void 0
|
|
1340
|
+
}), /* @__PURE__ */ K(d, {
|
|
1341
|
+
gap: "sm",
|
|
1342
|
+
className: v.menuRegion,
|
|
1343
|
+
children: [/* @__PURE__ */ G(qt, {
|
|
1344
|
+
filter: e,
|
|
1345
|
+
operator: t,
|
|
1346
|
+
value: g,
|
|
1347
|
+
onValueChange: m
|
|
1348
|
+
}), !!c && /* @__PURE__ */ G(o, {
|
|
1349
|
+
size: "xs",
|
|
1350
|
+
type: "error",
|
|
1351
|
+
role: "alert",
|
|
1352
|
+
children: c
|
|
1353
|
+
})]
|
|
1354
|
+
})]
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1357
|
+
//#endregion
|
|
1358
|
+
//#region src/components/features/filters/partials/filter-error-boundary.tsx
|
|
1359
|
+
var Yt = class extends Se {
|
|
1360
|
+
state = {
|
|
1361
|
+
hasError: !1,
|
|
1362
|
+
error: null
|
|
1363
|
+
};
|
|
1364
|
+
static getDerivedStateFromError(e) {
|
|
1365
|
+
return {
|
|
1366
|
+
hasError: !0,
|
|
1367
|
+
error: e
|
|
1368
|
+
};
|
|
1369
|
+
}
|
|
1370
|
+
componentDidCatch(e, t) {
|
|
1371
|
+
this.props.onError(e, {
|
|
1372
|
+
phase: "render",
|
|
1373
|
+
filterKey: this.props.filterKey
|
|
1374
|
+
});
|
|
1375
|
+
}
|
|
1376
|
+
handleReset = () => {
|
|
1377
|
+
this.setState({
|
|
1378
|
+
hasError: !1,
|
|
1379
|
+
error: null
|
|
1380
|
+
});
|
|
1381
|
+
};
|
|
1382
|
+
render() {
|
|
1383
|
+
if (this.state.hasError) {
|
|
1384
|
+
let { fallback: e, filterKey: t, labels: n } = this.props;
|
|
1385
|
+
return e ? /* @__PURE__ */ G("div", {
|
|
1386
|
+
className: "filter-error-boundary--component contents",
|
|
1387
|
+
children: e
|
|
1388
|
+
}) : /* @__PURE__ */ K("div", {
|
|
1389
|
+
className: i("filter-error-boundary--component rounded-radius border p-surface-xs", f.destructive.edge, f.destructive.wash, f.destructive.ink),
|
|
1390
|
+
children: [
|
|
1391
|
+
/* @__PURE__ */ K("div", {
|
|
1392
|
+
className: "mb-space-xs flex items-center justify-between",
|
|
1393
|
+
children: [/* @__PURE__ */ G(o, {
|
|
1394
|
+
tag: "span",
|
|
1395
|
+
weight: "semibold",
|
|
1396
|
+
children: n.title
|
|
1397
|
+
}), /* @__PURE__ */ G(l, {
|
|
1398
|
+
type: "button",
|
|
1399
|
+
tone: "destructive",
|
|
1400
|
+
buttonStyle: "ghost",
|
|
1401
|
+
size: "sm",
|
|
1402
|
+
iconOnly: !0,
|
|
1403
|
+
onClick: this.handleReset,
|
|
1404
|
+
"aria-label": n.reset,
|
|
1405
|
+
children: /* @__PURE__ */ G(Ie, { className: "size-icon-sm" })
|
|
1406
|
+
})]
|
|
1407
|
+
}),
|
|
1408
|
+
/* @__PURE__ */ G(o, { children: n.getDescription(t) }),
|
|
1409
|
+
!1
|
|
1410
|
+
]
|
|
1411
|
+
});
|
|
1412
|
+
}
|
|
1413
|
+
return /* @__PURE__ */ G("div", {
|
|
1414
|
+
className: "filter-error-boundary--component contents",
|
|
1415
|
+
children: this.props.children
|
|
1416
|
+
});
|
|
1417
|
+
}
|
|
1418
|
+
};
|
|
1419
|
+
function Xt(e) {
|
|
1420
|
+
let { strings: t, reportError: n } = $(), r = H(() => ({
|
|
1421
|
+
title: t.error.title,
|
|
1422
|
+
reset: t.error.dismiss ?? t.clear,
|
|
1423
|
+
getDescription: (e) => e ? J(t.error.descriptionWithKey, { filterKey: e }) : t.error.generic,
|
|
1424
|
+
unknownError: t.error.unknown
|
|
1425
|
+
}), [t]);
|
|
1426
|
+
return /* @__PURE__ */ G(Yt, {
|
|
1427
|
+
...e,
|
|
1428
|
+
labels: r,
|
|
1429
|
+
onError: n
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
//#endregion
|
|
1433
|
+
//#region src/components/features/filters/partials/filter-list-item.tsx
|
|
1434
|
+
function Zt({ filter: e, onSelect: t }) {
|
|
1435
|
+
let { strings: n } = $(), r = e.type === Y.DATE ? e.operator === "between" ? n?.selectDateRange : n?.selectDate : e.options ? Ye(n.optionCount, e.options.length, n.options) : null;
|
|
1436
|
+
return /* @__PURE__ */ K(D, {
|
|
1437
|
+
onSelect: t,
|
|
1438
|
+
children: [!!e.icon && /* @__PURE__ */ G("span", {
|
|
1439
|
+
className: "shrink-0 text-muted-foreground [&_svg]:size-icon",
|
|
1440
|
+
children: e.icon
|
|
1441
|
+
}), /* @__PURE__ */ K("div", {
|
|
1442
|
+
className: "flex min-w-0 flex-col gap-dense leading-tight",
|
|
1443
|
+
children: [/* @__PURE__ */ G(o, {
|
|
1444
|
+
tag: "span",
|
|
1445
|
+
type: "inherit",
|
|
1446
|
+
lineHeight: "tight",
|
|
1447
|
+
weight: "medium",
|
|
1448
|
+
className: "truncate",
|
|
1449
|
+
children: e.label
|
|
1450
|
+
}), !!r && /* @__PURE__ */ G(o, {
|
|
1451
|
+
tag: "span",
|
|
1452
|
+
lineHeight: "tight",
|
|
1453
|
+
size: "xs",
|
|
1454
|
+
type: "secondary",
|
|
1455
|
+
className: "truncate",
|
|
1456
|
+
children: r
|
|
1457
|
+
})]
|
|
1458
|
+
})]
|
|
1459
|
+
}, e.key);
|
|
1460
|
+
}
|
|
1461
|
+
//#endregion
|
|
1462
|
+
//#region src/components/features/filters/partials/filter-list-content.tsx
|
|
1463
|
+
function Qt({ availableFilters: e, activeFilters: t, onFilterSelect: n }) {
|
|
1464
|
+
let { strings: r } = $(), i = (e) => {
|
|
1465
|
+
n(e);
|
|
1466
|
+
};
|
|
1467
|
+
return /* @__PURE__ */ K(N, {
|
|
1468
|
+
inset: "compact",
|
|
1469
|
+
className: "rounded-none",
|
|
1470
|
+
children: [/* @__PURE__ */ G(O, { placeholder: r.searchFilters }), /* @__PURE__ */ K(A, { children: [
|
|
1471
|
+
/* @__PURE__ */ G(k, { children: r.noFiltersAvailable }),
|
|
1472
|
+
e.length > 0 && /* @__PURE__ */ G(j, {
|
|
1473
|
+
heading: r.availableFilters,
|
|
1474
|
+
children: e.map((e) => /* @__PURE__ */ G(Zt, {
|
|
1475
|
+
filter: e,
|
|
1476
|
+
onSelect: () => i(e)
|
|
1477
|
+
}, e.key))
|
|
1478
|
+
}),
|
|
1479
|
+
t.length > 0 && /* @__PURE__ */ K(De, { children: [/* @__PURE__ */ G(M, {}), /* @__PURE__ */ G(j, {
|
|
1480
|
+
heading: r.activeFilters,
|
|
1481
|
+
children: t.map((e) => /* @__PURE__ */ G(Zt, {
|
|
1482
|
+
filter: e,
|
|
1483
|
+
onSelect: () => i(e)
|
|
1484
|
+
}, e.key))
|
|
1485
|
+
})] })
|
|
1486
|
+
] })]
|
|
1487
|
+
});
|
|
1488
|
+
}
|
|
1489
|
+
//#endregion
|
|
1490
|
+
//#region src/components/features/filters/facets/range-facet.tsx
|
|
1491
|
+
var $t = /^-?\d*\.?\d*$/;
|
|
1492
|
+
function en(e) {
|
|
1493
|
+
if (e.trim() === "") return;
|
|
1494
|
+
let t = Number(e);
|
|
1495
|
+
return Number.isFinite(t) ? t : void 0;
|
|
1496
|
+
}
|
|
1497
|
+
function tn({ filter: e, value: t, onValueChange: n, className: r }) {
|
|
1498
|
+
let { strings: i, isNavigating: a } = $(), [o, s] = W(t.min?.toString() ?? ""), [c, l] = W(t.max?.toString() ?? ""), [u, d] = W(!1), f = en(o), p = en(c), [m, h] = W({
|
|
1499
|
+
min: t.min,
|
|
1500
|
+
max: t.max
|
|
1501
|
+
}), [g, _] = W({
|
|
1502
|
+
min: t.min,
|
|
1503
|
+
max: t.max
|
|
1504
|
+
}), v = g.min !== t.min || g.max !== t.max;
|
|
1505
|
+
v && _({
|
|
1506
|
+
min: t.min,
|
|
1507
|
+
max: t.max
|
|
1508
|
+
});
|
|
1509
|
+
let y = f !== t.min || p !== t.max, b = m.min !== t.min || m.max !== t.max, x = f === m.min && p === m.max;
|
|
1510
|
+
!u && !a && y && b && (x || v) && (s(t.min?.toString() ?? ""), l(t.max?.toString() ?? ""), h({
|
|
1511
|
+
min: t.min,
|
|
1512
|
+
max: t.max
|
|
1513
|
+
}));
|
|
1514
|
+
let S = f !== void 0 && p !== void 0 && f > p ? i.validation.invalidFormat : f === void 0 && p === void 0 ? void 0 : Q(e, [f === void 0 ? "" : String(f), p === void 0 ? "" : String(p)], i), C = he((e) => {
|
|
1515
|
+
h(e), (e.min !== t.min || e.max !== t.max) && n(e);
|
|
1516
|
+
}, e.delay ?? 300);
|
|
1517
|
+
return V(() => (S || C({
|
|
1518
|
+
min: f,
|
|
1519
|
+
max: p
|
|
1520
|
+
}), C.cancel), [
|
|
1521
|
+
f,
|
|
1522
|
+
p,
|
|
1523
|
+
S,
|
|
1524
|
+
C
|
|
1525
|
+
]), /* @__PURE__ */ G(nn, {
|
|
1526
|
+
min: o,
|
|
1527
|
+
max: c,
|
|
1528
|
+
onMinChange: (e) => {
|
|
1529
|
+
$t.test(e.target.value) && s(e.target.value);
|
|
1530
|
+
},
|
|
1531
|
+
onMaxChange: (e) => {
|
|
1532
|
+
$t.test(e.target.value) && l(e.target.value);
|
|
1533
|
+
},
|
|
1534
|
+
onFocusChange: d,
|
|
1535
|
+
className: r,
|
|
1536
|
+
invalid: !!S,
|
|
1537
|
+
error: S
|
|
1538
|
+
});
|
|
1539
|
+
}
|
|
1540
|
+
function nn({ min: e, max: t, onMinChange: n, onMaxChange: r, className: s, invalid: c, error: l, onFocusChange: f }) {
|
|
1541
|
+
let { strings: p } = $(), m = Te(), h = l ? `${m}-error` : void 0;
|
|
1542
|
+
return /* @__PURE__ */ K(d, {
|
|
1543
|
+
gap: "md",
|
|
1544
|
+
className: i("range-facet--component", s),
|
|
1545
|
+
onFocus: f ? () => f(!0) : void 0,
|
|
1546
|
+
onBlur: f ? (e) => {
|
|
1547
|
+
e.currentTarget.contains(e.relatedTarget) || f(!1);
|
|
1548
|
+
} : void 0,
|
|
1549
|
+
children: [/* @__PURE__ */ K(u, {
|
|
1550
|
+
columns: {
|
|
1551
|
+
base: 1,
|
|
1552
|
+
sm: 2
|
|
1553
|
+
},
|
|
1554
|
+
gap: "md",
|
|
1555
|
+
children: [/* @__PURE__ */ K(d, {
|
|
1556
|
+
gap: "xs",
|
|
1557
|
+
children: [/* @__PURE__ */ G(a, {
|
|
1558
|
+
htmlFor: `${m}-min`,
|
|
1559
|
+
className: "text-inherit",
|
|
1560
|
+
children: p.min
|
|
1561
|
+
}), /* @__PURE__ */ G(I, {
|
|
1562
|
+
id: `${m}-min`,
|
|
1563
|
+
type: "text",
|
|
1564
|
+
inputMode: "decimal",
|
|
1565
|
+
value: e,
|
|
1566
|
+
onChange: n,
|
|
1567
|
+
"aria-invalid": c || void 0,
|
|
1568
|
+
"aria-describedby": h,
|
|
1569
|
+
placeholder: p.min,
|
|
1570
|
+
className: "w-full"
|
|
1571
|
+
})]
|
|
1572
|
+
}), /* @__PURE__ */ K(d, {
|
|
1573
|
+
gap: "xs",
|
|
1574
|
+
children: [/* @__PURE__ */ G(a, {
|
|
1575
|
+
htmlFor: `${m}-max`,
|
|
1576
|
+
className: "text-inherit",
|
|
1577
|
+
children: p.max
|
|
1578
|
+
}), /* @__PURE__ */ G(I, {
|
|
1579
|
+
id: `${m}-max`,
|
|
1580
|
+
type: "text",
|
|
1581
|
+
inputMode: "decimal",
|
|
1582
|
+
value: t,
|
|
1583
|
+
onChange: r,
|
|
1584
|
+
"aria-invalid": c || void 0,
|
|
1585
|
+
"aria-describedby": h,
|
|
1586
|
+
placeholder: p.max,
|
|
1587
|
+
className: "w-full"
|
|
1588
|
+
})]
|
|
1589
|
+
})]
|
|
1590
|
+
}), !!l && /* @__PURE__ */ G(o, {
|
|
1591
|
+
id: h,
|
|
1592
|
+
size: "xs",
|
|
1593
|
+
type: "error",
|
|
1594
|
+
role: "alert",
|
|
1595
|
+
children: l
|
|
1596
|
+
})]
|
|
1597
|
+
});
|
|
1598
|
+
}
|
|
1599
|
+
//#endregion
|
|
1600
|
+
//#region src/components/features/filters/partials/range-filter-content.tsx
|
|
1601
|
+
function rn(e) {
|
|
1602
|
+
let t = e.trim();
|
|
1603
|
+
if (!t) return "";
|
|
1604
|
+
if (!/^-?(?:\d+\.?\d*|\.\d+)$/.test(t)) return;
|
|
1605
|
+
let n = Number(t);
|
|
1606
|
+
return Number.isFinite(n) ? t : void 0;
|
|
1607
|
+
}
|
|
1608
|
+
function an({ filter: e, operator: t, value: n, onFilterChange: r, onBackToFilterList: i, onClose: a, triggerSource: o }) {
|
|
1609
|
+
let { strings: s, reportError: c } = $(), [l, u] = dt(n, t), [d, f] = W(l), [p, m] = W(u);
|
|
1610
|
+
V(() => {
|
|
1611
|
+
f(l), m(u);
|
|
1612
|
+
}, [l, u]);
|
|
1613
|
+
let h = rn(d), g = rn(p), _ = h === void 0 || g === void 0 || !!(h && g) && Number(h) > Number(g), y = d !== l || p !== u, b = _ ? s.validation.invalidFormat : y ? Q(e, h || g ? [h, g] : [], s) : void 0, x = !!b;
|
|
1614
|
+
function S() {
|
|
1615
|
+
if (!(x || h === void 0 || g === void 0)) try {
|
|
1616
|
+
r(h || g ? [h, g] : []), a();
|
|
1617
|
+
} catch (t) {
|
|
1618
|
+
c(t, {
|
|
1619
|
+
phase: "apply",
|
|
1620
|
+
filterKey: e.key
|
|
1621
|
+
});
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
return /* @__PURE__ */ K("div", {
|
|
1625
|
+
className: "flex flex-col",
|
|
1626
|
+
children: [
|
|
1627
|
+
/* @__PURE__ */ G(Ht, {
|
|
1628
|
+
title: e.label,
|
|
1629
|
+
onBack: o === "toolbar" ? i : void 0
|
|
1630
|
+
}),
|
|
1631
|
+
/* @__PURE__ */ G("div", {
|
|
1632
|
+
className: v.menuRegion,
|
|
1633
|
+
children: /* @__PURE__ */ G(nn, {
|
|
1634
|
+
min: d,
|
|
1635
|
+
max: p,
|
|
1636
|
+
onMinChange: (e) => f(e.target.value),
|
|
1637
|
+
onMaxChange: (e) => m(e.target.value),
|
|
1638
|
+
invalid: x
|
|
1639
|
+
})
|
|
1640
|
+
}),
|
|
1641
|
+
y && /* @__PURE__ */ G(Vt, {
|
|
1642
|
+
error: b,
|
|
1643
|
+
onConfirm: S
|
|
1644
|
+
})
|
|
1645
|
+
]
|
|
1646
|
+
});
|
|
1647
|
+
}
|
|
1648
|
+
//#endregion
|
|
1649
|
+
//#region src/components/features/filters/partials/nested-filter-options.tsx
|
|
1650
|
+
function on({ filter: e, value: t, multiple: n, onChange: r, header: i }) {
|
|
1651
|
+
let { strings: a } = $(), o = H(() => gt(e.options ?? []), [e.options]), s = _e({
|
|
1652
|
+
items: o,
|
|
1653
|
+
selected: t,
|
|
1654
|
+
open: !0,
|
|
1655
|
+
multiple: n,
|
|
1656
|
+
selectable: e.selectableOptions ?? "leaf",
|
|
1657
|
+
strings: {
|
|
1658
|
+
...ye,
|
|
1659
|
+
root: e.label,
|
|
1660
|
+
search: J(a.searchPlaceholder, { filterLabel: Z(e.label) }),
|
|
1661
|
+
empty: a.noOptionsFound,
|
|
1662
|
+
back: a.previousLevel,
|
|
1663
|
+
selectCurrent: a.selectCurrentLevel
|
|
1664
|
+
},
|
|
1665
|
+
onChange: (e) => r(e == null ? [] : typeof e == "string" ? [e] : [...e])
|
|
1666
|
+
});
|
|
1667
|
+
return /* @__PURE__ */ G(ve, {
|
|
1668
|
+
controller: s,
|
|
1669
|
+
header: i,
|
|
1670
|
+
rootInPath: !0,
|
|
1671
|
+
className: "nested-filter-options--component"
|
|
1672
|
+
});
|
|
1673
|
+
}
|
|
1674
|
+
//#endregion
|
|
1675
|
+
//#region src/components/features/filters/partials/regular-filter-content.tsx
|
|
1676
|
+
function sn({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: i, triggerSource: a = "chip" }) {
|
|
1677
|
+
let { strings: s, reportError: c } = $(), l = yt(e), u = a === "toolbar", [f, p] = Rt(t), m = l && !!e.maxSelected && f.length >= e.maxSelected, h = (t) => {
|
|
1678
|
+
if (l) {
|
|
1679
|
+
let e = f.includes(t);
|
|
1680
|
+
if (!e && m) return;
|
|
1681
|
+
let n = e ? f.filter((e) => e !== t) : [...f, t];
|
|
1682
|
+
p(n);
|
|
1683
|
+
} else p([t]), e.closeOnSelect === !0 && (n([t]), i());
|
|
1684
|
+
}, g = (t) => {
|
|
1685
|
+
p(t), !l && e.closeOnSelect === !0 && t.length && (n(t), i());
|
|
1686
|
+
}, _ = () => {
|
|
1687
|
+
if (!b) try {
|
|
1688
|
+
n(f), i();
|
|
1689
|
+
} catch (t) {
|
|
1690
|
+
c(t, {
|
|
1691
|
+
phase: "apply",
|
|
1692
|
+
filterKey: e.key
|
|
1693
|
+
});
|
|
1694
|
+
}
|
|
1695
|
+
}, v = /* @__PURE__ */ G(Ht, {
|
|
1696
|
+
title: e.label,
|
|
1697
|
+
onBack: u ? r : void 0
|
|
1698
|
+
}), y = JSON.stringify(f.slice().sort()) !== JSON.stringify((t ?? []).slice().sort()), b = y ? Q(e, f, s) : void 0;
|
|
1699
|
+
return /* @__PURE__ */ K("div", {
|
|
1700
|
+
className: "flex flex-col",
|
|
1701
|
+
children: [ht(e.options) ? /* @__PURE__ */ G(on, {
|
|
1702
|
+
filter: e,
|
|
1703
|
+
value: f,
|
|
1704
|
+
multiple: l,
|
|
1705
|
+
onChange: g,
|
|
1706
|
+
header: v
|
|
1707
|
+
}) : /* @__PURE__ */ K(De, { children: [v, /* @__PURE__ */ K(N, {
|
|
1708
|
+
inset: "flush",
|
|
1709
|
+
className: "rounded-none",
|
|
1710
|
+
children: [/* @__PURE__ */ G(O, { placeholder: J(s.searchPlaceholder, { filterLabel: Z(e.label) }) }), /* @__PURE__ */ K(A, { children: [/* @__PURE__ */ G(k, { children: /* @__PURE__ */ G(o, {
|
|
1711
|
+
type: "secondary",
|
|
1712
|
+
align: "center",
|
|
1713
|
+
className: "py-space-xl",
|
|
1714
|
+
children: s.noOptionsFound
|
|
1715
|
+
}) }), /* @__PURE__ */ G(j, { children: e.options?.map((e) => {
|
|
1716
|
+
let t = f.includes(e.value);
|
|
1717
|
+
return /* @__PURE__ */ K(D, {
|
|
1718
|
+
onSelect: () => h(e.value),
|
|
1719
|
+
"data-checked": t || void 0,
|
|
1720
|
+
disabled: e.disabled || m && !t,
|
|
1721
|
+
className: "data-[checked=true]:**:[svg]:text-primary-accent",
|
|
1722
|
+
children: [!!e.icon && /* @__PURE__ */ G("span", {
|
|
1723
|
+
className: "shrink-0 text-muted-foreground [&_svg]:size-icon",
|
|
1724
|
+
children: e.icon
|
|
1725
|
+
}), /* @__PURE__ */ K(d, {
|
|
1726
|
+
gap: "dense",
|
|
1727
|
+
className: "flex min-w-0 flex-1 flex-col leading-tight",
|
|
1728
|
+
children: [/* @__PURE__ */ G(o, {
|
|
1729
|
+
tag: "span",
|
|
1730
|
+
type: "inherit",
|
|
1731
|
+
lineHeight: "tight",
|
|
1732
|
+
weight: t ? "medium" : "regular",
|
|
1733
|
+
className: "truncate",
|
|
1734
|
+
children: e.label
|
|
1735
|
+
}), !!e.description && /* @__PURE__ */ G(o, {
|
|
1736
|
+
tag: "span",
|
|
1737
|
+
size: "xs",
|
|
1738
|
+
lineHeight: "tight",
|
|
1739
|
+
type: "secondary",
|
|
1740
|
+
className: "truncate",
|
|
1741
|
+
children: e.description
|
|
1742
|
+
})]
|
|
1743
|
+
})]
|
|
1744
|
+
}, e.value);
|
|
1745
|
+
}) })] })]
|
|
1746
|
+
})] }), !!y && /* @__PURE__ */ G(Vt, {
|
|
1747
|
+
caption: J(s.selected, {
|
|
1748
|
+
count: f.length,
|
|
1749
|
+
filterLabel: Z((f.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
1750
|
+
}),
|
|
1751
|
+
error: b,
|
|
1752
|
+
onConfirm: _
|
|
1753
|
+
})]
|
|
1754
|
+
});
|
|
1755
|
+
}
|
|
1756
|
+
//#endregion
|
|
1757
|
+
//#region src/components/features/filters/facets/tags-facet.tsx
|
|
1758
|
+
function cn({ filter: e, value: t, onValueChange: r, className: a }) {
|
|
1759
|
+
let { defaultScale: s } = n(), c = F(void 0, s), { strings: u } = $(), [f, p] = W(""), m = B(() => {
|
|
1760
|
+
let e = f.trim();
|
|
1761
|
+
e && !t.includes(e) && (r([...t, e]), p(""));
|
|
1762
|
+
}, [
|
|
1763
|
+
f,
|
|
1764
|
+
t,
|
|
1765
|
+
r
|
|
1766
|
+
]), h = B((e) => {
|
|
1767
|
+
r(t.filter((t) => t !== e));
|
|
1768
|
+
}, [t, r]), g = (e) => {
|
|
1769
|
+
e.key === "Enter" && !e.nativeEvent.isComposing && (e.preventDefault(), m());
|
|
1770
|
+
}, _ = B(() => {
|
|
1771
|
+
r([]), p("");
|
|
1772
|
+
}, [r]), v = t.length > 0, y = t.length === 1 ? u.tag : u.tags, b = v ? /* @__PURE__ */ K(d, {
|
|
1773
|
+
gap: "md",
|
|
1774
|
+
className: "tags-facet--summary",
|
|
1775
|
+
children: [/* @__PURE__ */ K(d, {
|
|
1776
|
+
direction: "horizontal",
|
|
1777
|
+
gap: "sm",
|
|
1778
|
+
justify: "between",
|
|
1779
|
+
wrap: !1,
|
|
1780
|
+
children: [/* @__PURE__ */ G(o, {
|
|
1781
|
+
tag: "span",
|
|
1782
|
+
size: "xs",
|
|
1783
|
+
type: "secondary",
|
|
1784
|
+
children: Ye(u.tagCount, t.length, y)
|
|
1785
|
+
}), /* @__PURE__ */ G(l, {
|
|
1786
|
+
onClick: _,
|
|
1787
|
+
tone: "secondary",
|
|
1788
|
+
buttonStyle: "ghost",
|
|
1789
|
+
size: "sm",
|
|
1790
|
+
className: "text-muted-foreground hover:text-foreground",
|
|
1791
|
+
type: "button",
|
|
1792
|
+
"aria-label": u.clearAll,
|
|
1793
|
+
children: u.clearAll
|
|
1794
|
+
})]
|
|
1795
|
+
}), /* @__PURE__ */ G(d, {
|
|
1796
|
+
direction: "horizontal",
|
|
1797
|
+
gap: "md",
|
|
1798
|
+
children: t.map((e) => /* @__PURE__ */ K(w, {
|
|
1799
|
+
tone: "secondary",
|
|
1800
|
+
className: "flex items-center gap-space-sm py-space-2xs pl-space-md pr-space-sm",
|
|
1801
|
+
children: [/* @__PURE__ */ G(o, {
|
|
1802
|
+
tag: "span",
|
|
1803
|
+
size: "xs",
|
|
1804
|
+
children: e
|
|
1805
|
+
}), /* @__PURE__ */ G("button", {
|
|
1806
|
+
onClick: () => h(e),
|
|
1807
|
+
className: i(E.target, E.focus, E.toggle),
|
|
1808
|
+
type: "button",
|
|
1809
|
+
"aria-label": `${u.removeTag} ${e}`,
|
|
1810
|
+
children: /* @__PURE__ */ G(Ie, {
|
|
1811
|
+
className: E.icon,
|
|
1812
|
+
"aria-hidden": "true"
|
|
1813
|
+
})
|
|
1814
|
+
})]
|
|
1815
|
+
}, e))
|
|
1816
|
+
})]
|
|
1817
|
+
}) : null;
|
|
1818
|
+
return /* @__PURE__ */ K(d, {
|
|
1819
|
+
gap: "lg",
|
|
1820
|
+
className: i("tags-facet--component", a),
|
|
1821
|
+
children: [/* @__PURE__ */ K(d, {
|
|
1822
|
+
direction: "horizontal",
|
|
1823
|
+
gap: "md",
|
|
1824
|
+
wrap: !1,
|
|
1825
|
+
children: [/* @__PURE__ */ G("div", {
|
|
1826
|
+
className: "relative flex-1",
|
|
1827
|
+
children: /* @__PURE__ */ G(I, {
|
|
1828
|
+
type: "text",
|
|
1829
|
+
"aria-label": e.label,
|
|
1830
|
+
value: f,
|
|
1831
|
+
onChange: (e) => p(e.target.value),
|
|
1832
|
+
onKeyDown: g,
|
|
1833
|
+
placeholder: e.placeholder ?? u.enterTag
|
|
1834
|
+
})
|
|
1835
|
+
}), /* @__PURE__ */ K(l, {
|
|
1836
|
+
tone: "primary",
|
|
1837
|
+
onClick: m,
|
|
1838
|
+
disabled: !f.trim(),
|
|
1839
|
+
size: c,
|
|
1840
|
+
iconOnly: !0,
|
|
1841
|
+
className: i(P[c], ce[c]),
|
|
1842
|
+
type: "button",
|
|
1843
|
+
children: [/* @__PURE__ */ G(Fe, { className: "size-icon" }), /* @__PURE__ */ G(o, {
|
|
1844
|
+
tag: "span",
|
|
1845
|
+
size: "pxs",
|
|
1846
|
+
className: "sr-only",
|
|
1847
|
+
children: u.addTag
|
|
1848
|
+
})]
|
|
1849
|
+
})]
|
|
1850
|
+
}), b]
|
|
1851
|
+
});
|
|
1852
|
+
}
|
|
1853
|
+
var ln = xe.memo(cn);
|
|
1854
|
+
ln.displayName = "TagsFacet";
|
|
1855
|
+
//#endregion
|
|
1856
|
+
//#region src/components/features/filters/partials/tags-filter-content.tsx
|
|
1857
|
+
function un({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: i, triggerSource: a = "chip" }) {
|
|
1858
|
+
let { strings: o, reportError: s } = $(), [c, l] = Rt(t), u = a === "toolbar", d = () => {
|
|
1859
|
+
if (!p) try {
|
|
1860
|
+
n(c), i();
|
|
1861
|
+
} catch (t) {
|
|
1862
|
+
s(t, {
|
|
1863
|
+
phase: "apply",
|
|
1864
|
+
filterKey: e.key
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
}, f = JSON.stringify(c.slice().sort()) !== JSON.stringify((t ?? []).slice().sort()), p = f ? Q(e, c, o) : void 0;
|
|
1868
|
+
return /* @__PURE__ */ K("div", {
|
|
1869
|
+
className: "flex flex-col",
|
|
1870
|
+
children: [
|
|
1871
|
+
/* @__PURE__ */ G(Ht, {
|
|
1872
|
+
title: e.label,
|
|
1873
|
+
onBack: u ? r : void 0
|
|
1874
|
+
}),
|
|
1875
|
+
/* @__PURE__ */ G("div", {
|
|
1876
|
+
className: v.menuRegion,
|
|
1877
|
+
children: /* @__PURE__ */ G(ln, {
|
|
1878
|
+
filter: e,
|
|
1879
|
+
value: c,
|
|
1880
|
+
onValueChange: l
|
|
1881
|
+
})
|
|
1882
|
+
}),
|
|
1883
|
+
!!f && /* @__PURE__ */ G(Vt, {
|
|
1884
|
+
error: p,
|
|
1885
|
+
onConfirm: d
|
|
1886
|
+
})
|
|
1887
|
+
]
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
//#endregion
|
|
1891
|
+
//#region src/components/features/filters/partials/filter-popover-content.tsx
|
|
1892
|
+
var dn = "input:not([type=hidden]):not(:disabled), textarea:not(:disabled), button:not(:disabled), [tabindex]:not([tabindex=\"-1\"])";
|
|
1893
|
+
function fn(e) {
|
|
1894
|
+
if (!e) return;
|
|
1895
|
+
let t = [...e.querySelectorAll(dn)].filter((e) => !e.closest(".popover-header--component"));
|
|
1896
|
+
(t.find((e) => e.matches("input, textarea")) ?? t[0])?.focus({ preventScroll: !0 });
|
|
1897
|
+
}
|
|
1898
|
+
function pn({ activeFilterInPopover: e, operator: t, availableFilters: n, activeFilters: r, getFilterValue: a, setFilterValue: o, onFilterSelect: s, onBackToFilterList: c, onClose: l, triggerSource: u = "chip", finalFocus: d }) {
|
|
1899
|
+
let { strings: f, getFilterOperator: p } = $(), m = U(null), h = e?.key ?? null, g = U(h);
|
|
1900
|
+
V(() => {
|
|
1901
|
+
if (g.current === h) return;
|
|
1902
|
+
g.current = h;
|
|
1903
|
+
let e = m.current;
|
|
1904
|
+
if (!e?.hasAttribute("data-open")) return;
|
|
1905
|
+
fn(e);
|
|
1906
|
+
let t = e.ownerDocument.defaultView, n = t?.requestAnimationFrame(() => {
|
|
1907
|
+
e.ownerDocument.activeElement === e && fn(e);
|
|
1908
|
+
});
|
|
1909
|
+
return () => {
|
|
1910
|
+
n != null && t?.cancelAnimationFrame(n);
|
|
1911
|
+
};
|
|
1912
|
+
}, [h]);
|
|
1913
|
+
let v = e?.type === Y.DATE || e?.type === Y.TAGS ? "w-auto min-w-80 gap-0 overflow-hidden" : (e?.type, Y.ASYNC_SELECT, i(_.md, "gap-0 overflow-hidden")), y = (e, t) => {
|
|
1914
|
+
o(e, t);
|
|
1915
|
+
};
|
|
1916
|
+
return /* @__PURE__ */ G(oe, {
|
|
1917
|
+
ref: m,
|
|
1918
|
+
finalFocus: d,
|
|
1919
|
+
type: "menu",
|
|
1920
|
+
"aria-label": e?.label ?? f.addFilter,
|
|
1921
|
+
inset: "flush",
|
|
1922
|
+
className: i("filter-popover-content--component", v),
|
|
1923
|
+
align: "start",
|
|
1924
|
+
children: e ? e.type === Y.DATE ? /* @__PURE__ */ G(Jt, {
|
|
1925
|
+
filter: e,
|
|
1926
|
+
operator: t ?? p(e.key),
|
|
1927
|
+
value: a(e.key),
|
|
1928
|
+
onFilterChange: (t) => y(e.key, t),
|
|
1929
|
+
onBackToFilterList: c,
|
|
1930
|
+
triggerSource: u
|
|
1931
|
+
}) : e.type === Y.RANGE ? /* @__PURE__ */ G(an, {
|
|
1932
|
+
filter: e,
|
|
1933
|
+
operator: t ?? p(e.key) ?? "between",
|
|
1934
|
+
value: a(e.key),
|
|
1935
|
+
onFilterChange: (t) => y(e.key, t),
|
|
1936
|
+
onBackToFilterList: c,
|
|
1937
|
+
onClose: l,
|
|
1938
|
+
triggerSource: u
|
|
1939
|
+
}) : e.type === Y.TAGS ? /* @__PURE__ */ G(un, {
|
|
1940
|
+
filter: e,
|
|
1941
|
+
value: a(e.key),
|
|
1942
|
+
onFilterChange: (t) => y(e.key, t),
|
|
1943
|
+
onBackToFilterList: c,
|
|
1944
|
+
onClose: l,
|
|
1945
|
+
triggerSource: u
|
|
1946
|
+
}) : e.type === Y.ASYNC_SELECT ? /* @__PURE__ */ G(Ut, {
|
|
1947
|
+
filter: e,
|
|
1948
|
+
value: a(e.key),
|
|
1949
|
+
onFilterChange: (t) => y(e.key, t),
|
|
1950
|
+
onBackToFilterList: c,
|
|
1951
|
+
onClose: l,
|
|
1952
|
+
triggerSource: u
|
|
1953
|
+
}) : /* @__PURE__ */ G(sn, {
|
|
1954
|
+
filter: e,
|
|
1955
|
+
value: a(e.key),
|
|
1956
|
+
onFilterChange: (t) => y(e.key, t),
|
|
1957
|
+
onBackToFilterList: c,
|
|
1958
|
+
onClose: l,
|
|
1959
|
+
triggerSource: u
|
|
1960
|
+
}) : /* @__PURE__ */ G(Qt, {
|
|
1961
|
+
availableFilters: n,
|
|
1962
|
+
activeFilters: r,
|
|
1963
|
+
onFilterSelect: s
|
|
1964
|
+
})
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1967
|
+
//#endregion
|
|
1968
|
+
//#region src/components/features/filters/partials/filter-pill.tsx
|
|
1969
|
+
function mn({ filter: e, value: t, active: n, operator: r, operators: i, onOperatorChange: a, onValueChange: o, onClear: s, availableFilters: c, activeFilters: l, operatorChangeRef: u }) {
|
|
1970
|
+
let { isNavigating: d } = $(), f = U(void 0);
|
|
1971
|
+
V(() => () => clearTimeout(f.current), []);
|
|
1972
|
+
let p = () => d || u?.current === !0, [m, h] = W(!1), g = U(null), _ = U(null);
|
|
1973
|
+
return /* @__PURE__ */ G(Xt, {
|
|
1974
|
+
filterKey: e.key,
|
|
1975
|
+
children: /* @__PURE__ */ K(ie, {
|
|
1976
|
+
open: m,
|
|
1977
|
+
onOpenChange: (e) => {
|
|
1978
|
+
e && p() || h(e);
|
|
1979
|
+
},
|
|
1980
|
+
children: [/* @__PURE__ */ K("div", {
|
|
1981
|
+
className: "filter-pill--component filter-pill--anchor relative",
|
|
1982
|
+
children: [/* @__PURE__ */ G(z, {
|
|
1983
|
+
render: /* @__PURE__ */ G("span", {}),
|
|
1984
|
+
nativeButton: !1,
|
|
1985
|
+
tabIndex: -1,
|
|
1986
|
+
"aria-hidden": "true",
|
|
1987
|
+
className: "pointer-events-none absolute inset-0"
|
|
1988
|
+
}), /* @__PURE__ */ G(Ft, {
|
|
1989
|
+
filter: e,
|
|
1990
|
+
popoverOpen: m,
|
|
1991
|
+
triggerRef: g,
|
|
1992
|
+
value: t,
|
|
1993
|
+
active: n,
|
|
1994
|
+
operators: i,
|
|
1995
|
+
operator: r,
|
|
1996
|
+
onOperatorChange: (e) => {
|
|
1997
|
+
d || (u && (u.current = !0, clearTimeout(f.current), f.current = setTimeout(() => {
|
|
1998
|
+
u.current = !1;
|
|
1999
|
+
}, 100)), a(e), h(!1));
|
|
2000
|
+
},
|
|
2001
|
+
onFilterClear: () => {
|
|
2002
|
+
d || (h(!1), s(), g.current?.focus());
|
|
2003
|
+
},
|
|
2004
|
+
onFilterClick: (e) => {
|
|
2005
|
+
p() || (_.current = e?.currentTarget ?? g.current, h(!0));
|
|
2006
|
+
}
|
|
2007
|
+
})]
|
|
2008
|
+
}), /* @__PURE__ */ G(pn, {
|
|
2009
|
+
finalFocus: _,
|
|
2010
|
+
activeFilterInPopover: e,
|
|
2011
|
+
operator: r,
|
|
2012
|
+
availableFilters: c,
|
|
2013
|
+
activeFilters: l,
|
|
2014
|
+
getFilterValue: () => t,
|
|
2015
|
+
setFilterValue: (e, t) => o(t),
|
|
2016
|
+
onFilterSelect: () => {},
|
|
2017
|
+
onBackToFilterList: () => {},
|
|
2018
|
+
onClose: () => h(!1),
|
|
2019
|
+
triggerSource: "chip"
|
|
2020
|
+
})]
|
|
2021
|
+
})
|
|
2022
|
+
});
|
|
2023
|
+
}
|
|
2024
|
+
mn.displayName = "FilterPill";
|
|
2025
|
+
//#endregion
|
|
2026
|
+
//#region src/components/features/filters/partials/filters-button.tsx
|
|
2027
|
+
function hn({ triggerRef: e, availableFilters: t, activeFilters: r, activeFilterInPopover: a, getFilterValue: o, setFilterValue: s, setActiveFilterInPopover: c }) {
|
|
2028
|
+
let { defaultScale: u } = n(), d = F(void 0, u), [f, p] = W(!1), { strings: m, isNavigating: h } = $();
|
|
2029
|
+
return V(() => {
|
|
2030
|
+
f || c(null);
|
|
2031
|
+
}, [f, c]), /* @__PURE__ */ K(ie, {
|
|
2032
|
+
open: f,
|
|
2033
|
+
onOpenChange: (e) => {
|
|
2034
|
+
(!e || !h) && p(e);
|
|
2035
|
+
},
|
|
2036
|
+
children: [/* @__PURE__ */ G(z, { render: /* @__PURE__ */ G(l, {
|
|
2037
|
+
ref: e,
|
|
2038
|
+
tone: "secondary",
|
|
2039
|
+
buttonStyle: "outline",
|
|
2040
|
+
size: d,
|
|
2041
|
+
iconOnly: !0,
|
|
2042
|
+
"aria-label": m.addFilter,
|
|
2043
|
+
"aria-disabled": h || void 0,
|
|
2044
|
+
className: i("filters-button--component shrink-0", P[d], ce[d]),
|
|
2045
|
+
children: /* @__PURE__ */ G(Ne, { className: "size-icon-sm" })
|
|
2046
|
+
}) }), /* @__PURE__ */ G(pn, {
|
|
2047
|
+
activeFilterInPopover: a,
|
|
2048
|
+
availableFilters: t,
|
|
2049
|
+
activeFilters: r,
|
|
2050
|
+
getFilterValue: o,
|
|
2051
|
+
setFilterValue: s,
|
|
2052
|
+
onFilterSelect: (e) => {
|
|
2053
|
+
c(e);
|
|
2054
|
+
},
|
|
2055
|
+
onBackToFilterList: () => {
|
|
2056
|
+
c(null);
|
|
2057
|
+
},
|
|
2058
|
+
onClose: () => {
|
|
2059
|
+
c(null), p(!1);
|
|
2060
|
+
},
|
|
2061
|
+
triggerSource: "toolbar"
|
|
2062
|
+
})]
|
|
2063
|
+
});
|
|
2064
|
+
}
|
|
2065
|
+
//#endregion
|
|
2066
|
+
//#region src/components/features/filters/partials/filter-tabs.tsx
|
|
2067
|
+
function gn({ tabs: e }) {
|
|
2068
|
+
let { activeFilters: t, filters: n, replaceFilters: r } = $(), i = H(() => t.filter((e) => n.find((t) => t.key === e.key)?.type !== Y.SEARCH), [t, n]), a = H(() => t.filter((e) => n.find((t) => t.key === e.key)?.type === Y.SEARCH), [t, n]), s = H(() => {
|
|
2069
|
+
for (let t of e) {
|
|
2070
|
+
if (t.presets.length === 0) {
|
|
2071
|
+
if (i.length === 0) return t.id;
|
|
2072
|
+
continue;
|
|
2073
|
+
}
|
|
2074
|
+
if (t.presets.length === i.length && t.presets.every((e) => {
|
|
2075
|
+
let t = i.find((t) => t.key === e.key);
|
|
2076
|
+
if (!t) return !1;
|
|
2077
|
+
let n = [...e.value].sort(), r = [...t.value].sort();
|
|
2078
|
+
return !(n.length !== r.length || n.some((e, t) => e !== r[t]) || e.operator && t.operator !== e.operator);
|
|
2079
|
+
})) return t.id;
|
|
2080
|
+
}
|
|
2081
|
+
return null;
|
|
2082
|
+
}, [e, i]), c = B((e) => {
|
|
2083
|
+
if (e.presets.length === 0) {
|
|
2084
|
+
r([...a]);
|
|
2085
|
+
return;
|
|
2086
|
+
}
|
|
2087
|
+
let t = e.presets.map((e) => {
|
|
2088
|
+
let t = n.find((t) => t.key === e.key), r = e.operator ?? ct(t);
|
|
2089
|
+
return {
|
|
2090
|
+
id: e.key,
|
|
2091
|
+
key: e.key,
|
|
2092
|
+
value: e.value,
|
|
2093
|
+
operator: r
|
|
2094
|
+
};
|
|
2095
|
+
});
|
|
2096
|
+
r([...a, ...t]);
|
|
2097
|
+
}, [
|
|
2098
|
+
n,
|
|
2099
|
+
a,
|
|
2100
|
+
r
|
|
2101
|
+
]);
|
|
2102
|
+
return e.length === 0 ? null : /* @__PURE__ */ G(pe, {
|
|
2103
|
+
value: s,
|
|
2104
|
+
onValueChange: (t) => {
|
|
2105
|
+
let n = e.find((e) => e.id === t);
|
|
2106
|
+
n && c(n);
|
|
2107
|
+
},
|
|
2108
|
+
className: "filter-tabs--component",
|
|
2109
|
+
children: /* @__PURE__ */ G(fe, {
|
|
2110
|
+
variant: "chips",
|
|
2111
|
+
role: "group",
|
|
2112
|
+
"aria-orientation": void 0,
|
|
2113
|
+
className: "gap-space-md",
|
|
2114
|
+
children: e.map((e) => {
|
|
2115
|
+
let t = s === e.id;
|
|
2116
|
+
return /* @__PURE__ */ K(de, {
|
|
2117
|
+
value: e.id,
|
|
2118
|
+
role: "button",
|
|
2119
|
+
"aria-selected": void 0,
|
|
2120
|
+
"aria-controls": void 0,
|
|
2121
|
+
"aria-pressed": t,
|
|
2122
|
+
className: "filter-tabs--tab",
|
|
2123
|
+
children: [/* @__PURE__ */ G(o, {
|
|
2124
|
+
tag: "span",
|
|
2125
|
+
weight: "medium",
|
|
2126
|
+
className: "text-inherit",
|
|
2127
|
+
children: e.label
|
|
2128
|
+
}), e.count !== void 0 && /* @__PURE__ */ G(o, {
|
|
2129
|
+
tag: "span",
|
|
2130
|
+
size: "xs",
|
|
2131
|
+
type: "secondary",
|
|
2132
|
+
className: "tabular-nums",
|
|
2133
|
+
children: e.count
|
|
2134
|
+
})]
|
|
2135
|
+
}, e.id);
|
|
2136
|
+
})
|
|
2137
|
+
})
|
|
2138
|
+
});
|
|
2139
|
+
}
|
|
2140
|
+
//#endregion
|
|
2141
|
+
//#region src/components/features/filters/facets/search-facet.tsx
|
|
2142
|
+
var _n = xe.forwardRef(function(e, t) {
|
|
2143
|
+
return /* @__PURE__ */ G(Pe, {
|
|
2144
|
+
...e,
|
|
2145
|
+
ref: t,
|
|
2146
|
+
className: i("animate-spin", e.className)
|
|
2147
|
+
});
|
|
2148
|
+
});
|
|
2149
|
+
function vn({ filter: e, value: t, onValueChange: n, className: r }) {
|
|
2150
|
+
let { strings: a, isNavigating: o } = $(), [s, c] = W(t[0] || ""), l = U(s);
|
|
2151
|
+
V(() => {
|
|
2152
|
+
l.current = s;
|
|
2153
|
+
}, [s]);
|
|
2154
|
+
let u = U(t[0] ?? ""), d = U(!1);
|
|
2155
|
+
V(() => {
|
|
2156
|
+
if (d.current || o) return;
|
|
2157
|
+
let e = l.current;
|
|
2158
|
+
if (!t.length || t[0] === "") {
|
|
2159
|
+
e !== "" && (c(""), u.current = "");
|
|
2160
|
+
return;
|
|
2161
|
+
}
|
|
2162
|
+
t[0] !== void 0 && t[0] !== e && t[0] !== u.current && (c(t[0]), u.current = t[0]);
|
|
2163
|
+
}, [t, o]);
|
|
2164
|
+
let f = he((e) => {
|
|
2165
|
+
u.current = e, d.current = !1, n([e]);
|
|
2166
|
+
}, e.delay ?? 300), p = (t) => t.trim() === "" ? void 0 : Q(e, [t], a), m = p(s), h = (e) => {
|
|
2167
|
+
if (p(e)) {
|
|
2168
|
+
f.cancel();
|
|
2169
|
+
return;
|
|
2170
|
+
}
|
|
2171
|
+
if (u.current === e) {
|
|
2172
|
+
f.cancel(), d.current = !1;
|
|
2173
|
+
return;
|
|
2174
|
+
}
|
|
2175
|
+
f(e);
|
|
2176
|
+
};
|
|
2177
|
+
return /* @__PURE__ */ G(se, {
|
|
2178
|
+
error: m,
|
|
2179
|
+
className: i("search-facet--component", "search-facet relative w-full min-w-0 rounded-radius bg-background", r),
|
|
2180
|
+
children: /* @__PURE__ */ G(I, {
|
|
2181
|
+
type: "text",
|
|
2182
|
+
"aria-label": e.label,
|
|
2183
|
+
value: s,
|
|
2184
|
+
onChange: (e) => {
|
|
2185
|
+
d.current = !0;
|
|
2186
|
+
let t = e.target.value;
|
|
2187
|
+
c(t), h(t);
|
|
2188
|
+
},
|
|
2189
|
+
onFocus: () => {
|
|
2190
|
+
d.current = !0;
|
|
2191
|
+
},
|
|
2192
|
+
onBlur: () => {
|
|
2193
|
+
setTimeout(() => {
|
|
2194
|
+
d.current = !1;
|
|
2195
|
+
}, 100);
|
|
2196
|
+
},
|
|
2197
|
+
placeholder: e.placeholder ?? (() => {
|
|
2198
|
+
let t = Z(e.label.trim()), n = J(a.searchPlaceholder, { filterLabel: "" }).replace(/\s+([….?!])/g, "$1").replace(/\s{2,}/g, " ").trim(), r = n.replace(/[\s….?!]+$/u, "").toLocaleLowerCase();
|
|
2199
|
+
return !t || t.toLocaleLowerCase() === r ? n : J(a.searchPlaceholder, { filterLabel: t });
|
|
2200
|
+
})(),
|
|
2201
|
+
clearable: s.trim() !== "" && !o,
|
|
2202
|
+
endIcon: o ? _n : void 0,
|
|
2203
|
+
strings: { clear: a.clearSearch }
|
|
2204
|
+
})
|
|
2205
|
+
});
|
|
2206
|
+
}
|
|
2207
|
+
var yn = xe.memo(vn);
|
|
2208
|
+
yn.displayName = "SearchFacet";
|
|
2209
|
+
//#endregion
|
|
2210
|
+
//#region src/components/features/filters/partials/search-filters-list.tsx
|
|
2211
|
+
function bn({ filters: e, getFilterValue: t, setFilterValue: n, className: r }) {
|
|
2212
|
+
return /* @__PURE__ */ G(De, { children: e.map((e) => /* @__PURE__ */ K(d, {
|
|
2213
|
+
gap: "lg",
|
|
2214
|
+
className: i("search-filters-list--component", "w-full min-w-0 sm:w-64 sm:flex-none", e.displayConfig.className, r),
|
|
2215
|
+
children: [/* @__PURE__ */ G(yn, {
|
|
2216
|
+
filter: e,
|
|
2217
|
+
value: t(e.key),
|
|
2218
|
+
onValueChange: (t) => n(e.key, t)
|
|
2219
|
+
}), !!e.description && /* @__PURE__ */ G(o, {
|
|
2220
|
+
size: "xs",
|
|
2221
|
+
type: "secondary",
|
|
2222
|
+
children: e.description
|
|
2223
|
+
})]
|
|
2224
|
+
}, e.key)) });
|
|
2225
|
+
}
|
|
2226
|
+
//#endregion
|
|
2227
|
+
//#region src/components/features/filters/filter-layout.tsx
|
|
2228
|
+
var xn = {
|
|
2229
|
+
compact: "lg",
|
|
2230
|
+
default: "xl"
|
|
2231
|
+
}, Sn = {
|
|
2232
|
+
compact: "sm",
|
|
2233
|
+
default: "md"
|
|
2234
|
+
};
|
|
2235
|
+
function Cn({ className: e, dynamicFilterOptions: t = {}, loadingFilters: n = {}, variant: r = "default", showClearFilters: a = !1, tabs: s }) {
|
|
2236
|
+
let { getFilterValue: c, setFilterValue: u, isFilterActive: f, clearFilters: m, getFilterOperator: h, setFilterOperator: g, isNavigating: _, strings: v } = $(), { processedFilters: y, searchFilters: b, alwaysVisibleFilters: x, activeRegularFilters: S, popoverFilters: C, hasActive: w } = Et({ dynamicFilterOptions: t }), [T, E] = W(null), D = y.find((e) => e.key === T) ?? null, O = B((e) => {
|
|
2237
|
+
E(e?.key ?? null);
|
|
2238
|
+
}, []);
|
|
2239
|
+
V(() => {
|
|
2240
|
+
T !== null && D === null && E(null);
|
|
2241
|
+
}, [T, D]);
|
|
2242
|
+
let k = U(null), A = U(null);
|
|
2243
|
+
function j(e, t) {
|
|
2244
|
+
t.length === 0 && e.displayConfig?.display !== "always" && (A.current = e.key), u(e.key, t);
|
|
2245
|
+
}
|
|
2246
|
+
V(() => {
|
|
2247
|
+
let e = A.current;
|
|
2248
|
+
e !== null && !f(e) && (k.current?.focus(), A.current = null);
|
|
2249
|
+
}, [f]);
|
|
2250
|
+
function M(e) {
|
|
2251
|
+
return lt(e, v.operators);
|
|
2252
|
+
}
|
|
2253
|
+
function N(e, t) {
|
|
2254
|
+
g(e, t);
|
|
2255
|
+
}
|
|
2256
|
+
return /* @__PURE__ */ K(d, {
|
|
2257
|
+
gap: xn[r],
|
|
2258
|
+
className: i("filter-layout--component", e),
|
|
2259
|
+
children: [!!s && s.length > 0 && /* @__PURE__ */ G(gn, { tabs: s }), /* @__PURE__ */ K(d, {
|
|
2260
|
+
direction: "horizontal",
|
|
2261
|
+
align: "center",
|
|
2262
|
+
gap: Sn[r],
|
|
2263
|
+
"aria-busy": _ || void 0,
|
|
2264
|
+
children: [/* @__PURE__ */ G(Xt, {
|
|
2265
|
+
filterKey: "search-filters",
|
|
2266
|
+
children: /* @__PURE__ */ G(bn, {
|
|
2267
|
+
filters: b,
|
|
2268
|
+
getFilterValue: c,
|
|
2269
|
+
setFilterValue: u
|
|
2270
|
+
})
|
|
2271
|
+
}), /* @__PURE__ */ K("div", {
|
|
2272
|
+
className: "contents",
|
|
2273
|
+
children: [
|
|
2274
|
+
Object.entries(n).filter(([, e]) => e).map(([e]) => {
|
|
2275
|
+
let t = y.find((t) => t.key === e)?.label || e;
|
|
2276
|
+
return /* @__PURE__ */ K(d, {
|
|
2277
|
+
role: "status",
|
|
2278
|
+
direction: "horizontal",
|
|
2279
|
+
gap: "sm",
|
|
2280
|
+
wrap: !1,
|
|
2281
|
+
className: i("rounded-radius px-control-sm py-space-xs", p.band),
|
|
2282
|
+
children: [/* @__PURE__ */ G("div", {
|
|
2283
|
+
"aria-hidden": "true",
|
|
2284
|
+
className: "border-muted-foreground/30 border-t-primary size-icon-sm animate-spin rounded-full border-2"
|
|
2285
|
+
}), /* @__PURE__ */ G(o, {
|
|
2286
|
+
tag: "span",
|
|
2287
|
+
type: "secondary",
|
|
2288
|
+
children: J(v.loadingOptions, { filterLabel: t })
|
|
2289
|
+
})]
|
|
2290
|
+
}, `loading-${e}`);
|
|
2291
|
+
}),
|
|
2292
|
+
[...x, ...S].map((e) => /* @__PURE__ */ G(mn, {
|
|
2293
|
+
filter: e,
|
|
2294
|
+
value: c(e.key) ?? [],
|
|
2295
|
+
active: f(e.key),
|
|
2296
|
+
operator: h(e.key) || "equals",
|
|
2297
|
+
operators: M(e),
|
|
2298
|
+
onOperatorChange: (t) => N(e.key, t),
|
|
2299
|
+
onValueChange: (t) => j(e, t),
|
|
2300
|
+
onClear: () => j(e, []),
|
|
2301
|
+
availableFilters: C,
|
|
2302
|
+
activeFilters: [...S, ...x]
|
|
2303
|
+
}, e.key)),
|
|
2304
|
+
C.length > 0 && /* @__PURE__ */ G(Xt, {
|
|
2305
|
+
filterKey: "filters-button",
|
|
2306
|
+
children: /* @__PURE__ */ G(hn, {
|
|
2307
|
+
triggerRef: k,
|
|
2308
|
+
availableFilters: C,
|
|
2309
|
+
activeFilters: S,
|
|
2310
|
+
activeFilterInPopover: D,
|
|
2311
|
+
getFilterValue: c,
|
|
2312
|
+
setFilterValue: u,
|
|
2313
|
+
setActiveFilterInPopover: O
|
|
2314
|
+
})
|
|
2315
|
+
}),
|
|
2316
|
+
!!a && w && /* @__PURE__ */ G(l, {
|
|
2317
|
+
tone: "secondary",
|
|
2318
|
+
buttonStyle: "ghost",
|
|
2319
|
+
onClick: _ ? void 0 : m,
|
|
2320
|
+
"aria-disabled": _ || void 0,
|
|
2321
|
+
className: "text-muted-foreground ml-auto",
|
|
2322
|
+
children: v.clearFilters
|
|
2323
|
+
})
|
|
2324
|
+
]
|
|
2325
|
+
})]
|
|
2326
|
+
})]
|
|
2327
|
+
});
|
|
2328
|
+
}
|
|
2329
|
+
//#endregion
|
|
2330
|
+
//#region src/components/features/filters/filter-query.ts
|
|
2331
|
+
var wn = "__op", Tn = ["page"], En = new Set(Object.values(X));
|
|
2332
|
+
function Dn(e) {
|
|
2333
|
+
let t = {};
|
|
2334
|
+
if (!e) return t;
|
|
2335
|
+
if (e instanceof URLSearchParams) return e.forEach((e, n) => {
|
|
2336
|
+
t[n] = [...t[n] ?? [], e];
|
|
2337
|
+
}), t;
|
|
2338
|
+
for (let [n, r] of Object.entries(e)) {
|
|
2339
|
+
let e = (Array.isArray(r) ? r : [r]).filter((e) => e != null).map((e) => String(e));
|
|
2340
|
+
e.some(Boolean) && (t[n] = e);
|
|
2341
|
+
}
|
|
2342
|
+
return t;
|
|
2343
|
+
}
|
|
2344
|
+
function On(e) {
|
|
2345
|
+
let t = {};
|
|
2346
|
+
for (let [n, r] of Object.entries(e)) r.length !== 0 && (t[n] = r.length === 1 ? r[0] : r);
|
|
2347
|
+
return t;
|
|
2348
|
+
}
|
|
2349
|
+
function kn(e, t, n) {
|
|
2350
|
+
let r = e[t] ?? [];
|
|
2351
|
+
return n === "comma" ? r.flatMap((e) => e.split(",")) : r;
|
|
2352
|
+
}
|
|
2353
|
+
function An(e, t) {
|
|
2354
|
+
return t.map((e) => e.trim()).filter((e) => e.length > 0).map((t) => {
|
|
2355
|
+
if (!e.parse) return t;
|
|
2356
|
+
let n = e.parse(t);
|
|
2357
|
+
return n == null ? "" : String(n);
|
|
2358
|
+
}).filter((e) => e.length > 0);
|
|
2359
|
+
}
|
|
2360
|
+
function jn(e, t) {
|
|
2361
|
+
return t.map((t) => {
|
|
2362
|
+
let n = e.transform ? e.transform(t) : t, r = e.format ? e.format(n) : n;
|
|
2363
|
+
return r == null ? "" : String(r);
|
|
2364
|
+
}).filter((e) => e.length > 0);
|
|
2365
|
+
}
|
|
2366
|
+
var Mn = ct;
|
|
2367
|
+
function Nn(e, t, n) {
|
|
2368
|
+
let [r] = t[`${e.key}${n}`] ?? [];
|
|
2369
|
+
return r && En.has(r) ? r : Mn(e);
|
|
2370
|
+
}
|
|
2371
|
+
function Pn(e, t, n) {
|
|
2372
|
+
return e === "always" || e !== "never" && t !== n;
|
|
2373
|
+
}
|
|
2374
|
+
function Fn(e, t, n = {}) {
|
|
2375
|
+
let r = n.operatorSuffix ?? wn, i = n.arrayFormat ?? "repeat", a = Dn(t);
|
|
2376
|
+
return e.flatMap((e) => {
|
|
2377
|
+
let t = kn(a, e.key, i), n = Nn(e, a, r);
|
|
2378
|
+
if (e.type === Y.RANGE) {
|
|
2379
|
+
let r = dt(t, n).map((t) => An(e, [t])[0] ?? "");
|
|
2380
|
+
return r.some(Boolean) ? [{
|
|
2381
|
+
id: e.key,
|
|
2382
|
+
key: e.key,
|
|
2383
|
+
operator: n,
|
|
2384
|
+
value: r
|
|
2385
|
+
}] : [];
|
|
2386
|
+
}
|
|
2387
|
+
let o = An(e, t);
|
|
2388
|
+
if (o.length === 0) return [];
|
|
2389
|
+
let s = e.type === Y.DATE && n === X.BETWEEN;
|
|
2390
|
+
return s && !ft(o) ? [] : [{
|
|
2391
|
+
id: e.key,
|
|
2392
|
+
key: e.key,
|
|
2393
|
+
operator: n,
|
|
2394
|
+
value: s || yt(e) ? o : [o[0]]
|
|
2395
|
+
}];
|
|
2396
|
+
});
|
|
2397
|
+
}
|
|
2398
|
+
function In(e, t, n, r = {}) {
|
|
2399
|
+
let i = r.operatorSuffix ?? wn, a = r.arrayFormat ?? "repeat", o = r.preserveUnrelated ?? !0, s = r.includeOperators ?? "changed", c = r.resetPageKeys ?? Tn, l = o ? Dn(n) : {}, u = new Map(e.map((e) => [e.key, e]));
|
|
2400
|
+
for (let t of e) delete l[t.key], delete l[`${t.key}${i}`];
|
|
2401
|
+
for (let e of c) delete l[e];
|
|
2402
|
+
for (let e of t) {
|
|
2403
|
+
let t = u.get(e.key);
|
|
2404
|
+
if (!t) continue;
|
|
2405
|
+
let n = t.type === Y.RANGE ? dt(e.value, e.operator).map((e) => e ? jn(t, [e])[0] ?? "" : "") : jn(t, e.value);
|
|
2406
|
+
if (!n.some(Boolean) || t.type === Y.DATE && e.operator === X.BETWEEN && !ft(n)) continue;
|
|
2407
|
+
l[e.key] = a === "comma" ? [n.join(",")] : n;
|
|
2408
|
+
let r = Mn(t);
|
|
2409
|
+
Pn(s, e.operator, r) && (l[`${e.key}${i}`] = [e.operator]);
|
|
2410
|
+
}
|
|
2411
|
+
return On(l);
|
|
2412
|
+
}
|
|
2413
|
+
function Ln(e, t, n = {}) {
|
|
2414
|
+
let r = n.preserveUnrelated ?? !0, i = n.resetPageKeys ?? Tn, a = r ? Dn(e) : {}, o = Dn(t);
|
|
2415
|
+
for (let e of i) delete a[e];
|
|
2416
|
+
for (let [e, t] of Object.entries(o)) t.length === 0 ? delete a[e] : a[e] = t;
|
|
2417
|
+
return On(a);
|
|
2418
|
+
}
|
|
2419
|
+
//#endregion
|
|
2420
|
+
//#region src/components/features/filters/facets/select-facet.tsx
|
|
2421
|
+
function Rn({ filter: e, value: t, onValueChange: r, className: a }) {
|
|
2422
|
+
let { defaultScale: s } = n(), c = F(void 0, s), { strings: u } = $(), [d, f] = W(!1), [p, m] = W(""), h = t.length > 0, g = e.options, _ = yt(e), v = _ && !!e.maxSelected && t.length >= e.maxSelected, y = (n) => {
|
|
2423
|
+
_ ? t.includes(n) ? r(t.filter((e) => e !== n)) : v || r([...t, n]) : (r([n]), e.closeOnSelect !== !1 && f(!1));
|
|
2424
|
+
}, b = (t) => _t(e, t) ?? t, x = H(() => ht(g) ? gt(g ?? []) : null, [g]), S = H(() => (g ?? []).map((e) => ({
|
|
2425
|
+
value: e.value,
|
|
2426
|
+
label: e.label,
|
|
2427
|
+
description: e.description,
|
|
2428
|
+
icon: e.icon,
|
|
2429
|
+
selected: t.includes(e.value),
|
|
2430
|
+
disabled: e.disabled || v && !t.includes(e.value)
|
|
2431
|
+
})), [
|
|
2432
|
+
g,
|
|
2433
|
+
t,
|
|
2434
|
+
v
|
|
2435
|
+
]), C = J(u.searchPlaceholder, { filterLabel: e.label.toLowerCase() }), w = J(u.selected, {
|
|
2436
|
+
count: t.length,
|
|
2437
|
+
filterLabel: Z((t.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
2438
|
+
});
|
|
2439
|
+
return x ? /* @__PURE__ */ G("div", {
|
|
2440
|
+
className: i("select-facet--component", "relative", a),
|
|
2441
|
+
children: /* @__PURE__ */ G(be, {
|
|
2442
|
+
items: x,
|
|
2443
|
+
value: _ ? t : t[0] ?? null,
|
|
2444
|
+
multiple: _,
|
|
2445
|
+
selectable: e.selectableOptions ?? "leaf",
|
|
2446
|
+
size: c,
|
|
2447
|
+
"aria-label": e.label,
|
|
2448
|
+
strings: {
|
|
2449
|
+
placeholder: e.placeholder ?? u.select,
|
|
2450
|
+
search: C,
|
|
2451
|
+
empty: u.noOptionsFound,
|
|
2452
|
+
root: e.label,
|
|
2453
|
+
back: u.previousLevel,
|
|
2454
|
+
selectCurrent: u.selectCurrentLevel
|
|
2455
|
+
},
|
|
2456
|
+
renderValue: t.length > 1 ? () => w : void 0,
|
|
2457
|
+
onValueChange: (e) => r(e == null ? [] : typeof e == "string" ? [e] : [...e])
|
|
2458
|
+
})
|
|
2459
|
+
}) : /* @__PURE__ */ G("div", {
|
|
2460
|
+
className: i("select-facet--component", "relative", a),
|
|
2461
|
+
children: /* @__PURE__ */ G(me, {
|
|
2462
|
+
open: d,
|
|
2463
|
+
onOpenChange: f,
|
|
2464
|
+
search: !0,
|
|
2465
|
+
searchValue: p,
|
|
2466
|
+
onSearchChange: m,
|
|
2467
|
+
strings: {
|
|
2468
|
+
searchPlaceholder: C,
|
|
2469
|
+
empty: u.noOptionsFound
|
|
2470
|
+
},
|
|
2471
|
+
contentClassName: "w-(--anchor-width) min-w-56",
|
|
2472
|
+
trigger: /* @__PURE__ */ K(l, {
|
|
2473
|
+
tone: "secondary",
|
|
2474
|
+
buttonStyle: "outline",
|
|
2475
|
+
size: c,
|
|
2476
|
+
role: "combobox",
|
|
2477
|
+
"aria-expanded": d,
|
|
2478
|
+
className: ee(c),
|
|
2479
|
+
children: [h ? t.length === 1 ? /* @__PURE__ */ G(o, {
|
|
2480
|
+
tag: "span",
|
|
2481
|
+
weight: "semibold",
|
|
2482
|
+
className: "truncate",
|
|
2483
|
+
children: b(t[0])
|
|
2484
|
+
}) : /* @__PURE__ */ G(o, {
|
|
2485
|
+
tag: "span",
|
|
2486
|
+
weight: "semibold",
|
|
2487
|
+
children: w
|
|
2488
|
+
}) : /* @__PURE__ */ G(o, {
|
|
2489
|
+
tag: "span",
|
|
2490
|
+
type: "secondary",
|
|
2491
|
+
children: e.placeholder ?? u.select
|
|
2492
|
+
}), /* @__PURE__ */ G(Me, { className: "ml-control-gap-small size-icon-sm shrink-0 opacity-50" })]
|
|
2493
|
+
}),
|
|
2494
|
+
items: S,
|
|
2495
|
+
onSelect: (e) => y(e.value)
|
|
2496
|
+
})
|
|
2497
|
+
});
|
|
2498
|
+
}
|
|
2499
|
+
//#endregion
|
|
2500
|
+
//#region src/components/features/filters/facets/async-select-facet.tsx
|
|
2501
|
+
function zn({ filter: e, value: t, onValueChange: r, className: a }) {
|
|
2502
|
+
let { defaultScale: s } = n(), c = F(void 0, s), { strings: u, cacheAsyncOptions: d, getAsyncOptionLabel: f, reportError: p } = $(), [m, _] = W(!1), [v, y] = W(""), b = H(() => /* @__PURE__ */ new Map(), [
|
|
2503
|
+
e.key,
|
|
2504
|
+
e.asyncConfig?.fetcher,
|
|
2505
|
+
e.asyncConfig?.mapToOption
|
|
2506
|
+
]), { options: x, isLoading: S, isFetching: C, isError: w, refetch: T, isBelowMinQuery: E, minQueryLength: M } = Lt(e, v, m, { onError: p });
|
|
2507
|
+
V(() => {
|
|
2508
|
+
if (x.length !== 0) {
|
|
2509
|
+
for (let e of x) b.set(e.value, e);
|
|
2510
|
+
d(e.key, x);
|
|
2511
|
+
}
|
|
2512
|
+
}, [
|
|
2513
|
+
d,
|
|
2514
|
+
e.key,
|
|
2515
|
+
b,
|
|
2516
|
+
x
|
|
2517
|
+
]);
|
|
2518
|
+
let P = e.multiple !== !1, I = e.maxSelected, L = H(() => e.options ?? [], [e.options]), R = H(() => {
|
|
2519
|
+
let n = new Set(t), r = new Set([...L, ...x].map((e) => e.value)), i = [];
|
|
2520
|
+
for (let n of t) if (!r.has(n)) {
|
|
2521
|
+
let t = b.get(n);
|
|
2522
|
+
if (t) i.push(t);
|
|
2523
|
+
else {
|
|
2524
|
+
let t = L.find((e) => e.value === n);
|
|
2525
|
+
if (t) {
|
|
2526
|
+
i.push(t);
|
|
2527
|
+
continue;
|
|
2528
|
+
}
|
|
2529
|
+
let r = f(e.key, n) ?? n;
|
|
2530
|
+
i.push({
|
|
2531
|
+
value: n,
|
|
2532
|
+
label: r,
|
|
2533
|
+
icon: e.icon
|
|
2534
|
+
});
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
return [
|
|
2538
|
+
...i,
|
|
2539
|
+
...L,
|
|
2540
|
+
...x
|
|
2541
|
+
].sort((e, t) => +!n.has(e.value) - !n.has(t.value));
|
|
2542
|
+
}, [
|
|
2543
|
+
L,
|
|
2544
|
+
x,
|
|
2545
|
+
t,
|
|
2546
|
+
e.key,
|
|
2547
|
+
e.icon,
|
|
2548
|
+
b,
|
|
2549
|
+
f
|
|
2550
|
+
]), te = (n) => {
|
|
2551
|
+
if (P) {
|
|
2552
|
+
if (t.includes(n)) r(t.filter((e) => e !== n));
|
|
2553
|
+
else {
|
|
2554
|
+
if (I && t.length >= I) return;
|
|
2555
|
+
r([...t, n]);
|
|
2556
|
+
}
|
|
2557
|
+
} else r([n]), e.closeOnSelect !== !1 && _(!1);
|
|
2558
|
+
}, ne = (t) => {
|
|
2559
|
+
let n = x.find((e) => e.value === t);
|
|
2560
|
+
if (n) return n.label;
|
|
2561
|
+
let r = L.find((e) => e.value === t);
|
|
2562
|
+
if (r) return r.label;
|
|
2563
|
+
let i = b.get(t);
|
|
2564
|
+
return i ? i.label : f(e.key, t) ?? t;
|
|
2565
|
+
}, re = t.length > 0, ae = H(() => S || C ? /* @__PURE__ */ G(h, {
|
|
2566
|
+
className: "async-select-facet--component",
|
|
2567
|
+
label: u.searching
|
|
2568
|
+
}) : w ? /* @__PURE__ */ G(g, {
|
|
2569
|
+
variant: "inline",
|
|
2570
|
+
title: u.fetchError,
|
|
2571
|
+
action: /* @__PURE__ */ G(l, {
|
|
2572
|
+
tone: "secondary",
|
|
2573
|
+
buttonStyle: "outline",
|
|
2574
|
+
size: "sm",
|
|
2575
|
+
onClick: (e) => {
|
|
2576
|
+
e.stopPropagation(), T();
|
|
2577
|
+
},
|
|
2578
|
+
children: u.retryFetch
|
|
2579
|
+
})
|
|
2580
|
+
}) : E ? /* @__PURE__ */ G("div", {
|
|
2581
|
+
className: "text-muted-foreground flex items-center justify-center py-space-xl",
|
|
2582
|
+
children: /* @__PURE__ */ G(o, {
|
|
2583
|
+
tag: "span",
|
|
2584
|
+
size: "xs",
|
|
2585
|
+
type: "secondary",
|
|
2586
|
+
children: J(u.minQueryHint, { min: M })
|
|
2587
|
+
})
|
|
2588
|
+
}) : /* @__PURE__ */ G(o, {
|
|
2589
|
+
tag: "span",
|
|
2590
|
+
type: "secondary",
|
|
2591
|
+
children: u.noOptionsFound
|
|
2592
|
+
}), [
|
|
2593
|
+
S,
|
|
2594
|
+
C,
|
|
2595
|
+
w,
|
|
2596
|
+
E,
|
|
2597
|
+
M,
|
|
2598
|
+
u,
|
|
2599
|
+
T
|
|
2600
|
+
]);
|
|
2601
|
+
return /* @__PURE__ */ G("div", {
|
|
2602
|
+
className: i("async-select-facet--component relative", a),
|
|
2603
|
+
children: /* @__PURE__ */ K(ie, {
|
|
2604
|
+
open: m,
|
|
2605
|
+
onOpenChange: (e) => {
|
|
2606
|
+
_(e), e || y("");
|
|
2607
|
+
},
|
|
2608
|
+
children: [/* @__PURE__ */ G(z, { render: /* @__PURE__ */ K(l, {
|
|
2609
|
+
tone: "secondary",
|
|
2610
|
+
buttonStyle: "outline",
|
|
2611
|
+
size: c,
|
|
2612
|
+
role: "combobox",
|
|
2613
|
+
"aria-expanded": m,
|
|
2614
|
+
className: ee(c),
|
|
2615
|
+
children: [re ? t.length === 1 ? /* @__PURE__ */ G(o, {
|
|
2616
|
+
tag: "span",
|
|
2617
|
+
weight: "semibold",
|
|
2618
|
+
className: "truncate",
|
|
2619
|
+
children: ne(t[0])
|
|
2620
|
+
}) : /* @__PURE__ */ G(o, {
|
|
2621
|
+
tag: "span",
|
|
2622
|
+
weight: "semibold",
|
|
2623
|
+
children: J(u.selected, {
|
|
2624
|
+
count: t.length,
|
|
2625
|
+
filterLabel: Z((t.length > 1 ? e.pluralLabel : e.label) ?? e.label)
|
|
2626
|
+
})
|
|
2627
|
+
}) : /* @__PURE__ */ G(o, {
|
|
2628
|
+
tag: "span",
|
|
2629
|
+
type: "secondary",
|
|
2630
|
+
children: e.placeholder ?? u.select
|
|
2631
|
+
}), /* @__PURE__ */ G(Me, { className: "ml-control-gap-small size-icon-sm shrink-0 opacity-50" })]
|
|
2632
|
+
}) }), /* @__PURE__ */ K(oe, {
|
|
2633
|
+
type: "menu",
|
|
2634
|
+
inset: "flush",
|
|
2635
|
+
className: "w-full min-w-70 gap-0",
|
|
2636
|
+
children: [/* @__PURE__ */ K(N, {
|
|
2637
|
+
shouldFilter: !1,
|
|
2638
|
+
inset: "flush",
|
|
2639
|
+
className: "rounded-none",
|
|
2640
|
+
children: [/* @__PURE__ */ G(O, {
|
|
2641
|
+
placeholder: J(u.searchPlaceholder, { filterLabel: e.label }),
|
|
2642
|
+
value: v,
|
|
2643
|
+
onValueChange: y
|
|
2644
|
+
}), /* @__PURE__ */ G(A, {
|
|
2645
|
+
"aria-busy": C || void 0,
|
|
2646
|
+
children: R.length === 0 ? /* @__PURE__ */ G(k, { children: ae }) : /* @__PURE__ */ K(j, { children: [/* @__PURE__ */ G(zt, {
|
|
2647
|
+
fetching: C,
|
|
2648
|
+
error: w,
|
|
2649
|
+
onRetry: T
|
|
2650
|
+
}), R.map((e) => /* @__PURE__ */ K(D, {
|
|
2651
|
+
value: e.value,
|
|
2652
|
+
onSelect: () => te(e.value),
|
|
2653
|
+
disabled: e.disabled || !!I && t.length >= I && !t.includes(e.value),
|
|
2654
|
+
children: [
|
|
2655
|
+
/* @__PURE__ */ G(ke, { className: i("mr-control-gap size-icon-sm", t.includes(e.value) ? "opacity-100" : "opacity-0") }),
|
|
2656
|
+
!!e.icon && /* @__PURE__ */ G("span", {
|
|
2657
|
+
className: "mr-1.5",
|
|
2658
|
+
children: e.icon
|
|
2659
|
+
}),
|
|
2660
|
+
/* @__PURE__ */ G(o, {
|
|
2661
|
+
tag: "span",
|
|
2662
|
+
children: e.label
|
|
2663
|
+
})
|
|
2664
|
+
]
|
|
2665
|
+
}, e.value))] })
|
|
2666
|
+
})]
|
|
2667
|
+
}), /* @__PURE__ */ G(Bt, {
|
|
2668
|
+
fetching: C,
|
|
2669
|
+
error: w,
|
|
2670
|
+
count: x.length,
|
|
2671
|
+
hasRows: R.length > 0
|
|
2672
|
+
})]
|
|
2673
|
+
})]
|
|
2674
|
+
})
|
|
2675
|
+
});
|
|
2676
|
+
}
|
|
2677
|
+
//#endregion
|
|
2678
|
+
//#region src/components/features/filters/validators.ts
|
|
2679
|
+
function Bn(e) {
|
|
2680
|
+
return (t) => {
|
|
2681
|
+
if (t == null || typeof t == "string" && t.length === 0) return !0;
|
|
2682
|
+
let n = e.safeParse(t);
|
|
2683
|
+
return n.success ? !0 : n.error?.issues?.[0]?.message ?? n.error?.message ?? !1;
|
|
2684
|
+
};
|
|
2685
|
+
}
|
|
2686
|
+
function Vn(e, t) {
|
|
2687
|
+
return (n) => e(n) ? !0 : t;
|
|
2688
|
+
}
|
|
2689
|
+
//#endregion
|
|
2690
|
+
export { et as A, q as B, Et as C, tt as D, it as E, Qe as F, J as H, ct as I, X as L, lt as M, at as N, ot as O, $e as P, Y as R, Dt as S, $ as T, Xe as V, Xt as _, Ln as a, Ft as b, Cn as c, gn as d, hn as f, tn as g, ln as h, Rn as i, ut as j, nt as k, bn as l, pn as m, Bn as n, Fn as o, mn as p, zn as r, In as s, Vn as t, yn as u, qt as v, Tt as w, Ot as x, Lt as y, Ze as z };
|
|
2691
|
+
|
|
2692
|
+
//# sourceMappingURL=filters-BviMRMLS.js.map
|