@voyant-travel/inventory-react 0.1.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/LICENSE +201 -0
- package/dist/admin/index.d.ts +91 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +132 -0
- package/dist/admin/pages/product-detail-page.d.ts +18 -0
- package/dist/admin/pages/product-detail-page.d.ts.map +1 -0
- package/dist/admin/pages/product-detail-page.js +63 -0
- package/dist/admin/product-categories-host.d.ts +7 -0
- package/dist/admin/product-categories-host.d.ts.map +1 -0
- package/dist/admin/product-categories-host.js +11 -0
- package/dist/admin/product-detail-api.d.ts +22 -0
- package/dist/admin/product-detail-api.d.ts.map +1 -0
- package/dist/admin/product-detail-api.js +58 -0
- package/dist/admin/products-host.d.ts +11 -0
- package/dist/admin/products-host.d.ts.map +1 -0
- package/dist/admin/products-host.js +17 -0
- package/dist/admin/products-list-skeleton.d.ts +10 -0
- package/dist/admin/products-list-skeleton.d.ts.map +1 -0
- package/dist/admin/products-list-skeleton.js +23 -0
- package/dist/client.d.ts +16 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +79 -0
- package/dist/components/option-unit-dialog.d.ts +11 -0
- package/dist/components/option-unit-dialog.d.ts.map +1 -0
- package/dist/components/option-unit-dialog.js +17 -0
- package/dist/components/option-unit-form.d.ts +17 -0
- package/dist/components/option-unit-form.d.ts.map +1 -0
- package/dist/components/option-unit-form.js +123 -0
- package/dist/components/product-action-ledger-card.d.ts +17 -0
- package/dist/components/product-action-ledger-card.d.ts.map +1 -0
- package/dist/components/product-action-ledger-card.js +73 -0
- package/dist/components/product-catalog-card.d.ts +14 -0
- package/dist/components/product-catalog-card.d.ts.map +1 -0
- package/dist/components/product-catalog-card.js +44 -0
- package/dist/components/product-categories-page.d.ts +7 -0
- package/dist/components/product-categories-page.d.ts.map +1 -0
- package/dist/components/product-categories-page.js +9 -0
- package/dist/components/product-category-combobox.d.ts +10 -0
- package/dist/components/product-category-combobox.d.ts.map +1 -0
- package/dist/components/product-category-combobox.js +47 -0
- package/dist/components/product-category-dialog.d.ts +9 -0
- package/dist/components/product-category-dialog.d.ts.map +1 -0
- package/dist/components/product-category-dialog.js +17 -0
- package/dist/components/product-category-form.d.ts +15 -0
- package/dist/components/product-category-form.d.ts.map +1 -0
- package/dist/components/product-category-form.js +82 -0
- package/dist/components/product-category-list.d.ts +5 -0
- package/dist/components/product-category-list.d.ts.map +1 -0
- package/dist/components/product-category-list.js +48 -0
- package/dist/components/product-combobox.d.ts +13 -0
- package/dist/components/product-combobox.d.ts.map +1 -0
- package/dist/components/product-combobox.js +23 -0
- package/dist/components/product-contract-template-combobox.d.ts +9 -0
- package/dist/components/product-contract-template-combobox.d.ts.map +1 -0
- package/dist/components/product-contract-template-combobox.js +97 -0
- package/dist/components/product-day-dialog.d.ts +20 -0
- package/dist/components/product-day-dialog.d.ts.map +1 -0
- package/dist/components/product-day-dialog.js +20 -0
- package/dist/components/product-day-form.d.ts +19 -0
- package/dist/components/product-day-form.d.ts.map +1 -0
- package/dist/components/product-day-form.js +77 -0
- package/dist/components/product-day-media-tray.d.ts +11 -0
- package/dist/components/product-day-media-tray.d.ts.map +1 -0
- package/dist/components/product-day-media-tray.js +74 -0
- package/dist/components/product-day-service-dialog.d.ts +14 -0
- package/dist/components/product-day-service-dialog.d.ts.map +1 -0
- package/dist/components/product-day-service-dialog.js +19 -0
- package/dist/components/product-day-service-form.d.ts +44 -0
- package/dist/components/product-day-service-form.d.ts.map +1 -0
- package/dist/components/product-day-service-form.js +152 -0
- package/dist/components/product-detail/commerce-client.d.ts +314 -0
- package/dist/components/product-detail/commerce-client.d.ts.map +1 -0
- package/dist/components/product-detail/commerce-client.js +261 -0
- package/dist/components/product-detail/host.d.ts +54 -0
- package/dist/components/product-detail/host.d.ts.map +1 -0
- package/dist/components/product-detail/host.js +27 -0
- package/dist/components/product-detail/index.d.ts +6 -0
- package/dist/components/product-detail/index.d.ts.map +1 -0
- package/dist/components/product-detail/index.js +5 -0
- package/dist/components/product-detail/product-activity-section.d.ts +4 -0
- package/dist/components/product-detail/product-activity-section.d.ts.map +1 -0
- package/dist/components/product-detail/product-activity-section.js +37 -0
- package/dist/components/product-detail/product-day-sheet.d.ts +14 -0
- package/dist/components/product-detail/product-day-sheet.d.ts.map +1 -0
- package/dist/components/product-detail/product-day-sheet.js +75 -0
- package/dist/components/product-detail/product-day-translation.d.ts +41 -0
- package/dist/components/product-detail/product-day-translation.d.ts.map +1 -0
- package/dist/components/product-detail/product-day-translation.js +111 -0
- package/dist/components/product-detail/product-departure-dialog.d.ts +11 -0
- package/dist/components/product-detail/product-departure-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-departure-dialog.js +10 -0
- package/dist/components/product-detail/product-departure-form.d.ts +25 -0
- package/dist/components/product-detail/product-departure-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-departure-form.js +241 -0
- package/dist/components/product-detail/product-departure-pricing-override-dialog.d.ts +8 -0
- package/dist/components/product-detail/product-departure-pricing-override-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-departure-pricing-override-dialog.js +126 -0
- package/dist/components/product-detail/product-detail-availability-sections.d.ts +19 -0
- package/dist/components/product-detail/product-detail-availability-sections.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-availability-sections.js +29 -0
- package/dist/components/product-detail/product-detail-channel-section.d.ts +8 -0
- package/dist/components/product-detail/product-detail-channel-section.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-channel-section.js +16 -0
- package/dist/components/product-detail/product-detail-day-row.d.ts +14 -0
- package/dist/components/product-detail/product-detail-day-row.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-day-row.js +43 -0
- package/dist/components/product-detail/product-detail-dialog.d.ts +10 -0
- package/dist/components/product-detail/product-detail-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-dialog.js +10 -0
- package/dist/components/product-detail/product-detail-form.d.ts +22 -0
- package/dist/components/product-detail/product-detail-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-form.js +205 -0
- package/dist/components/product-detail/product-detail-header.d.ts +12 -0
- package/dist/components/product-detail/product-detail-header.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-header.js +19 -0
- package/dist/components/product-detail/product-detail-itinerary-section.d.ts +4 -0
- package/dist/components/product-detail/product-detail-itinerary-section.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-itinerary-section.js +201 -0
- package/dist/components/product-detail/product-detail-media-sections.d.ts +15 -0
- package/dist/components/product-detail/product-detail-media-sections.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-media-sections.js +19 -0
- package/dist/components/product-detail/product-detail-organize-section.d.ts +6 -0
- package/dist/components/product-detail/product-detail-organize-section.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-organize-section.js +18 -0
- package/dist/components/product-detail/product-detail-page.d.ts +4 -0
- package/dist/components/product-detail/product-detail-page.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-page.js +95 -0
- package/dist/components/product-detail/product-detail-section-shell.d.ts +19 -0
- package/dist/components/product-detail/product-detail-section-shell.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-section-shell.js +23 -0
- package/dist/components/product-detail/product-detail-sections.d.ts +7 -0
- package/dist/components/product-detail/product-detail-sections.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-sections.js +6 -0
- package/dist/components/product-detail/product-detail-shared.d.ts +264 -0
- package/dist/components/product-detail/product-detail-shared.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-shared.js +157 -0
- package/dist/components/product-detail/product-detail-skeleton.d.ts +9 -0
- package/dist/components/product-detail/product-detail-skeleton.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-skeleton.js +53 -0
- package/dist/components/product-detail/product-detail-summary-section.d.ts +6 -0
- package/dist/components/product-detail/product-detail-summary-section.d.ts.map +1 -0
- package/dist/components/product-detail/product-detail-summary-section.js +66 -0
- package/dist/components/product-detail/product-extra-dialog.d.ts +21 -0
- package/dist/components/product-detail/product-extra-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-extra-dialog.js +131 -0
- package/dist/components/product-detail/product-itinerary-form.d.ts +16 -0
- package/dist/components/product-detail/product-itinerary-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-itinerary-form.js +38 -0
- package/dist/components/product-detail/product-market-rules-section.d.ts +6 -0
- package/dist/components/product-detail/product-market-rules-section.d.ts.map +1 -0
- package/dist/components/product-detail/product-market-rules-section.js +81 -0
- package/dist/components/product-detail/product-media-gallery.d.ts +19 -0
- package/dist/components/product-detail/product-media-gallery.d.ts.map +1 -0
- package/dist/components/product-detail/product-media-gallery.js +114 -0
- package/dist/components/product-detail/product-option-price-rule-dialog.d.ts +12 -0
- package/dist/components/product-detail/product-option-price-rule-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-option-price-rule-dialog.js +10 -0
- package/dist/components/product-detail/product-option-price-rule-form.d.ts +29 -0
- package/dist/components/product-detail/product-option-price-rule-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-option-price-rule-form.js +122 -0
- package/dist/components/product-detail/product-option-pricing-grid.d.ts +16 -0
- package/dist/components/product-detail/product-option-pricing-grid.d.ts.map +1 -0
- package/dist/components/product-detail/product-option-pricing-grid.js +236 -0
- package/dist/components/product-detail/product-options-extra-price-rules.d.ts +8 -0
- package/dist/components/product-detail/product-options-extra-price-rules.d.ts.map +1 -0
- package/dist/components/product-detail/product-options-extra-price-rules.js +123 -0
- package/dist/components/product-detail/product-options-pricing-helpers.d.ts +14 -0
- package/dist/components/product-detail/product-options-pricing-helpers.d.ts.map +1 -0
- package/dist/components/product-detail/product-options-pricing-helpers.js +49 -0
- package/dist/components/product-detail/product-options-pricing-panel.d.ts +17 -0
- package/dist/components/product-detail/product-options-pricing-panel.d.ts.map +1 -0
- package/dist/components/product-detail/product-options-pricing-panel.js +88 -0
- package/dist/components/product-detail/product-options-pricing.d.ts +5 -0
- package/dist/components/product-detail/product-options-pricing.d.ts.map +1 -0
- package/dist/components/product-detail/product-options-pricing.js +4 -0
- package/dist/components/product-detail/product-options-shared.d.ts +236 -0
- package/dist/components/product-detail/product-options-shared.d.ts.map +1 -0
- package/dist/components/product-detail/product-options-shared.js +57 -0
- package/dist/components/product-detail/product-options-traveler-category-dialog.d.ts +12 -0
- package/dist/components/product-detail/product-options-traveler-category-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-options-traveler-category-dialog.js +132 -0
- package/dist/components/product-detail/product-options-unit-price-matrix.d.ts +10 -0
- package/dist/components/product-detail/product-options-unit-price-matrix.d.ts.map +1 -0
- package/dist/components/product-detail/product-options-unit-price-matrix.js +103 -0
- package/dist/components/product-detail/product-payment-policy-section.d.ts +17 -0
- package/dist/components/product-detail/product-payment-policy-section.d.ts.map +1 -0
- package/dist/components/product-detail/product-payment-policy-section.js +58 -0
- package/dist/components/product-detail/product-schedule-dialog.d.ts +11 -0
- package/dist/components/product-detail/product-schedule-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-schedule-dialog.js +10 -0
- package/dist/components/product-detail/product-schedule-form.d.ts +17 -0
- package/dist/components/product-detail/product-schedule-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-schedule-form.js +223 -0
- package/dist/components/product-detail/product-service-dialog.d.ts +12 -0
- package/dist/components/product-detail/product-service-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-service-dialog.js +10 -0
- package/dist/components/product-detail/product-service-form.d.ts +22 -0
- package/dist/components/product-detail/product-service-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-service-form.js +154 -0
- package/dist/components/product-detail/product-translation-popover.d.ts +94 -0
- package/dist/components/product-detail/product-translation-popover.d.ts.map +1 -0
- package/dist/components/product-detail/product-translation-popover.js +238 -0
- package/dist/components/product-detail/product-unit-dialog.d.ts +14 -0
- package/dist/components/product-detail/product-unit-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-unit-dialog.js +10 -0
- package/dist/components/product-detail/product-unit-form.d.ts +34 -0
- package/dist/components/product-detail/product-unit-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-unit-form.js +139 -0
- package/dist/components/product-detail/product-unit-price-rule-dialog.d.ts +17 -0
- package/dist/components/product-detail/product-unit-price-rule-dialog.d.ts.map +1 -0
- package/dist/components/product-detail/product-unit-price-rule-dialog.js +10 -0
- package/dist/components/product-detail/product-unit-price-rule-form.d.ts +29 -0
- package/dist/components/product-detail/product-unit-price-rule-form.d.ts.map +1 -0
- package/dist/components/product-detail/product-unit-price-rule-form.js +144 -0
- package/dist/components/product-detail/rrule-labels.d.ts +2 -0
- package/dist/components/product-detail/rrule-labels.d.ts.map +1 -0
- package/dist/components/product-detail/rrule-labels.js +65 -0
- package/dist/components/product-detail/timezone-options.d.ts +9 -0
- package/dist/components/product-detail/timezone-options.d.ts.map +1 -0
- package/dist/components/product-detail/timezone-options.js +28 -0
- package/dist/components/product-detail/use-product-detail-data.d.ts +41 -0
- package/dist/components/product-detail/use-product-detail-data.d.ts.map +1 -0
- package/dist/components/product-detail/use-product-detail-data.js +143 -0
- package/dist/components/product-detail/use-product-detail-dialogs.d.ts +24 -0
- package/dist/components/product-detail/use-product-detail-dialogs.d.ts.map +1 -0
- package/dist/components/product-detail/use-product-detail-dialogs.js +40 -0
- package/dist/components/product-detail/zod-resolver.d.ts +4 -0
- package/dist/components/product-detail/zod-resolver.d.ts.map +1 -0
- package/dist/components/product-detail/zod-resolver.js +39 -0
- package/dist/components/product-detail-page.d.ts +57 -0
- package/dist/components/product-detail-page.d.ts.map +1 -0
- package/dist/components/product-detail-page.js +118 -0
- package/dist/components/product-detail.d.ts +2 -0
- package/dist/components/product-detail.d.ts.map +1 -0
- package/dist/components/product-detail.js +1 -0
- package/dist/components/product-dialog.d.ts +9 -0
- package/dist/components/product-dialog.d.ts.map +1 -0
- package/dist/components/product-dialog.js +13 -0
- package/dist/components/product-facility-combobox.d.ts +9 -0
- package/dist/components/product-facility-combobox.d.ts.map +1 -0
- package/dist/components/product-facility-combobox.js +94 -0
- package/dist/components/product-form.d.ts +14 -0
- package/dist/components/product-form.d.ts.map +1 -0
- package/dist/components/product-form.js +191 -0
- package/dist/components/product-itinerary-day-row.d.ts +22 -0
- package/dist/components/product-itinerary-day-row.d.ts.map +1 -0
- package/dist/components/product-itinerary-day-row.js +17 -0
- package/dist/components/product-itinerary-dialog.d.ts +16 -0
- package/dist/components/product-itinerary-dialog.d.ts.map +1 -0
- package/dist/components/product-itinerary-dialog.js +85 -0
- package/dist/components/product-itinerary-section.d.ts +16 -0
- package/dist/components/product-itinerary-section.d.ts.map +1 -0
- package/dist/components/product-itinerary-section.js +105 -0
- package/dist/components/product-list.d.ts +7 -0
- package/dist/components/product-list.d.ts.map +1 -0
- package/dist/components/product-list.js +155 -0
- package/dist/components/product-media-dialog.d.ts +11 -0
- package/dist/components/product-media-dialog.d.ts.map +1 -0
- package/dist/components/product-media-dialog.js +17 -0
- package/dist/components/product-media-form.d.ts +17 -0
- package/dist/components/product-media-form.d.ts.map +1 -0
- package/dist/components/product-media-form.js +101 -0
- package/dist/components/product-media-lightbox.d.ts +7 -0
- package/dist/components/product-media-lightbox.d.ts.map +1 -0
- package/dist/components/product-media-lightbox.js +31 -0
- package/dist/components/product-media-section.d.ts +27 -0
- package/dist/components/product-media-section.d.ts.map +1 -0
- package/dist/components/product-media-section.js +130 -0
- package/dist/components/product-media-tile.d.ts +17 -0
- package/dist/components/product-media-tile.d.ts.map +1 -0
- package/dist/components/product-media-tile.js +16 -0
- package/dist/components/product-option-dialog.d.ts +11 -0
- package/dist/components/product-option-dialog.d.ts.map +1 -0
- package/dist/components/product-option-dialog.js +17 -0
- package/dist/components/product-option-form.d.ts +17 -0
- package/dist/components/product-option-form.d.ts.map +1 -0
- package/dist/components/product-option-form.js +91 -0
- package/dist/components/product-options-section.d.ts +13 -0
- package/dist/components/product-options-section.d.ts.map +1 -0
- package/dist/components/product-options-section.js +200 -0
- package/dist/components/product-quick-view-sheet.d.ts +23 -0
- package/dist/components/product-quick-view-sheet.d.ts.map +1 -0
- package/dist/components/product-quick-view-sheet.js +65 -0
- package/dist/components/product-tag-dialog.d.ts +9 -0
- package/dist/components/product-tag-dialog.d.ts.map +1 -0
- package/dist/components/product-tag-dialog.js +17 -0
- package/dist/components/product-tag-form.d.ts +15 -0
- package/dist/components/product-tag-form.d.ts.map +1 -0
- package/dist/components/product-tag-form.js +48 -0
- package/dist/components/product-tag-list.d.ts +5 -0
- package/dist/components/product-tag-list.d.ts.map +1 -0
- package/dist/components/product-tag-list.js +44 -0
- package/dist/components/product-tags-page.d.ts +7 -0
- package/dist/components/product-tags-page.d.ts.map +1 -0
- package/dist/components/product-tags-page.js +9 -0
- package/dist/components/product-tax-class-combobox.d.ts +9 -0
- package/dist/components/product-tax-class-combobox.d.ts.map +1 -0
- package/dist/components/product-tax-class-combobox.js +100 -0
- package/dist/components/product-translations-card.d.ts +7 -0
- package/dist/components/product-translations-card.d.ts.map +1 -0
- package/dist/components/product-translations-card.js +188 -0
- package/dist/components/product-type-combobox.d.ts +9 -0
- package/dist/components/product-type-combobox.d.ts.map +1 -0
- package/dist/components/product-type-combobox.js +48 -0
- package/dist/components/product-types-page.d.ts +6 -0
- package/dist/components/product-types-page.d.ts.map +1 -0
- package/dist/components/product-types-page.js +103 -0
- package/dist/components/product-version-dialog.d.ts +8 -0
- package/dist/components/product-version-dialog.d.ts.map +1 -0
- package/dist/components/product-version-dialog.js +39 -0
- package/dist/components/product-versions-section.d.ts +7 -0
- package/dist/components/product-versions-section.d.ts.map +1 -0
- package/dist/components/product-versions-section.js +19 -0
- package/dist/components/products-page.d.ts +8 -0
- package/dist/components/products-page.d.ts.map +1 -0
- package/dist/components/products-page.js +8 -0
- package/dist/extras/client.d.ts +14 -0
- package/dist/extras/client.d.ts.map +1 -0
- package/dist/extras/client.js +58 -0
- package/dist/extras/components/extra-catalog-card.d.ts +13 -0
- package/dist/extras/components/extra-catalog-card.d.ts.map +1 -0
- package/dist/extras/components/extra-catalog-card.js +52 -0
- package/dist/extras/components/product-combobox.d.ts +9 -0
- package/dist/extras/components/product-combobox.d.ts.map +1 -0
- package/dist/extras/components/product-combobox.js +46 -0
- package/dist/extras/hooks/index.d.ts +4 -0
- package/dist/extras/hooks/index.d.ts.map +1 -0
- package/dist/extras/hooks/index.js +3 -0
- package/dist/extras/hooks/use-product-extra-mutation.d.ts +70 -0
- package/dist/extras/hooks/use-product-extra-mutation.d.ts.map +1 -0
- package/dist/extras/hooks/use-product-extra-mutation.js +38 -0
- package/dist/extras/hooks/use-product-extra.d.ts +24 -0
- package/dist/extras/hooks/use-product-extra.d.ts.map +1 -0
- package/dist/extras/hooks/use-product-extra.js +12 -0
- package/dist/extras/hooks/use-product-extras.d.ts +30 -0
- package/dist/extras/hooks/use-product-extras.d.ts.map +1 -0
- package/dist/extras/hooks/use-product-extras.js +12 -0
- package/dist/extras/i18n/en.d.ts +52 -0
- package/dist/extras/i18n/en.d.ts.map +1 -0
- package/dist/extras/i18n/en.js +51 -0
- package/dist/extras/i18n/index.d.ts +5 -0
- package/dist/extras/i18n/index.d.ts.map +1 -0
- package/dist/extras/i18n/index.js +3 -0
- package/dist/extras/i18n/messages.d.ts +37 -0
- package/dist/extras/i18n/messages.d.ts.map +1 -0
- package/dist/extras/i18n/messages.js +1 -0
- package/dist/extras/i18n/provider.d.ts +126 -0
- package/dist/extras/i18n/provider.d.ts.map +1 -0
- package/dist/extras/i18n/provider.js +44 -0
- package/dist/extras/i18n/ro.d.ts +52 -0
- package/dist/extras/i18n/ro.d.ts.map +1 -0
- package/dist/extras/i18n/ro.js +51 -0
- package/dist/extras/index.d.ts +7 -0
- package/dist/extras/index.d.ts.map +1 -0
- package/dist/extras/index.js +6 -0
- package/dist/extras/provider.d.ts +2 -0
- package/dist/extras/provider.d.ts.map +1 -0
- package/dist/extras/provider.js +1 -0
- package/dist/extras/query-keys.d.ts +16 -0
- package/dist/extras/query-keys.d.ts.map +1 -0
- package/dist/extras/query-keys.js +8 -0
- package/dist/extras/query-options.d.ts +455 -0
- package/dist/extras/query-options.d.ts.map +1 -0
- package/dist/extras/query-options.js +44 -0
- package/dist/extras/schemas.d.ts +416 -0
- package/dist/extras/schemas.d.ts.map +1 -0
- package/dist/extras/schemas.js +89 -0
- package/dist/extras/ui.d.ts +3 -0
- package/dist/extras/ui.d.ts.map +1 -0
- package/dist/extras/ui.js +2 -0
- package/dist/extras-compat.d.ts +3 -0
- package/dist/extras-compat.d.ts.map +1 -0
- package/dist/extras-compat.js +1 -0
- package/dist/extras.d.ts +10 -0
- package/dist/extras.d.ts.map +1 -0
- package/dist/extras.js +9 -0
- package/dist/hooks/index.d.ts +36 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +35 -0
- package/dist/hooks/use-duplicate-product-option-mutation.d.ts +19 -0
- package/dist/hooks/use-duplicate-product-option-mutation.d.ts.map +1 -0
- package/dist/hooks/use-duplicate-product-option-mutation.js +65 -0
- package/dist/hooks/use-option-unit-mutation.d.ts +60 -0
- package/dist/hooks/use-option-unit-mutation.d.ts.map +1 -0
- package/dist/hooks/use-option-unit-mutation.js +41 -0
- package/dist/hooks/use-option-unit.d.ts +21 -0
- package/dist/hooks/use-option-unit.d.ts.map +1 -0
- package/dist/hooks/use-option-unit.js +12 -0
- package/dist/hooks/use-option-units.d.ts +27 -0
- package/dist/hooks/use-option-units.d.ts.map +1 -0
- package/dist/hooks/use-option-units.js +12 -0
- package/dist/hooks/use-product-action-ledger.d.ts +48 -0
- package/dist/hooks/use-product-action-ledger.d.ts.map +1 -0
- package/dist/hooks/use-product-action-ledger.js +12 -0
- package/dist/hooks/use-product-categories.d.ts +32 -0
- package/dist/hooks/use-product-categories.d.ts.map +1 -0
- package/dist/hooks/use-product-categories.js +29 -0
- package/dist/hooks/use-product-category-mutation.d.ts +65 -0
- package/dist/hooks/use-product-category-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-category-mutation.js +39 -0
- package/dist/hooks/use-product-category.d.ts +26 -0
- package/dist/hooks/use-product-category.d.ts.map +1 -0
- package/dist/hooks/use-product-category.js +18 -0
- package/dist/hooks/use-product-day-mutation.d.ts +43 -0
- package/dist/hooks/use-product-day-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-day-mutation.js +54 -0
- package/dist/hooks/use-product-day-service-mutation.d.ts +66 -0
- package/dist/hooks/use-product-day-service-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-day-service-mutation.js +41 -0
- package/dist/hooks/use-product-day-services.d.ts +21 -0
- package/dist/hooks/use-product-day-services.d.ts.map +1 -0
- package/dist/hooks/use-product-day-services.js +12 -0
- package/dist/hooks/use-product-day-translation-mutation.d.ts +49 -0
- package/dist/hooks/use-product-day-translation-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-day-translation-mutation.js +38 -0
- package/dist/hooks/use-product-day-translations.d.ts +19 -0
- package/dist/hooks/use-product-day-translations.d.ts.map +1 -0
- package/dist/hooks/use-product-day-translations.js +20 -0
- package/dist/hooks/use-product-days.d.ts +16 -0
- package/dist/hooks/use-product-days.d.ts.map +1 -0
- package/dist/hooks/use-product-days.js +12 -0
- package/dist/hooks/use-product-itineraries.d.ts +15 -0
- package/dist/hooks/use-product-itineraries.d.ts.map +1 -0
- package/dist/hooks/use-product-itineraries.js +12 -0
- package/dist/hooks/use-product-itinerary-days.d.ts +16 -0
- package/dist/hooks/use-product-itinerary-days.d.ts.map +1 -0
- package/dist/hooks/use-product-itinerary-days.js +12 -0
- package/dist/hooks/use-product-itinerary-mutation.d.ts +54 -0
- package/dist/hooks/use-product-itinerary-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-itinerary-mutation.js +63 -0
- package/dist/hooks/use-product-media-mutation.d.ts +101 -0
- package/dist/hooks/use-product-media-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-media-mutation.js +69 -0
- package/dist/hooks/use-product-media.d.ts +26 -0
- package/dist/hooks/use-product-media.d.ts.map +1 -0
- package/dist/hooks/use-product-media.js +12 -0
- package/dist/hooks/use-product-mutation.d.ts +121 -0
- package/dist/hooks/use-product-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-mutation.js +44 -0
- package/dist/hooks/use-product-option-mutation.d.ts +49 -0
- package/dist/hooks/use-product-option-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-option-mutation.js +39 -0
- package/dist/hooks/use-product-option.d.ts +18 -0
- package/dist/hooks/use-product-option.d.ts.map +1 -0
- package/dist/hooks/use-product-option.js +12 -0
- package/dist/hooks/use-product-options.d.ts +24 -0
- package/dist/hooks/use-product-options.d.ts.map +1 -0
- package/dist/hooks/use-product-options.js +12 -0
- package/dist/hooks/use-product-tag-mutation.d.ts +25 -0
- package/dist/hooks/use-product-tag-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-tag-mutation.js +39 -0
- package/dist/hooks/use-product-tag.d.ts +10 -0
- package/dist/hooks/use-product-tag.d.ts.map +1 -0
- package/dist/hooks/use-product-tag.js +18 -0
- package/dist/hooks/use-product-tags.d.ts +16 -0
- package/dist/hooks/use-product-tags.d.ts.map +1 -0
- package/dist/hooks/use-product-tags.js +25 -0
- package/dist/hooks/use-product-translation-mutation.d.ts +52 -0
- package/dist/hooks/use-product-translation-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-translation-mutation.js +47 -0
- package/dist/hooks/use-product-translations.d.ts +28 -0
- package/dist/hooks/use-product-translations.d.ts.map +1 -0
- package/dist/hooks/use-product-translations.js +24 -0
- package/dist/hooks/use-product-type-mutation.d.ts +50 -0
- package/dist/hooks/use-product-type-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-type-mutation.js +47 -0
- package/dist/hooks/use-product-type.d.ts +15 -0
- package/dist/hooks/use-product-type.d.ts.map +1 -0
- package/dist/hooks/use-product-type.js +12 -0
- package/dist/hooks/use-product-types.d.ts +21 -0
- package/dist/hooks/use-product-types.d.ts.map +1 -0
- package/dist/hooks/use-product-types.js +9 -0
- package/dist/hooks/use-product-version-mutation.d.ts +16 -0
- package/dist/hooks/use-product-version-mutation.d.ts.map +1 -0
- package/dist/hooks/use-product-version-mutation.js +22 -0
- package/dist/hooks/use-product-versions.d.ts +15 -0
- package/dist/hooks/use-product-versions.d.ts.map +1 -0
- package/dist/hooks/use-product-versions.js +12 -0
- package/dist/hooks/use-product.d.ts +45 -0
- package/dist/hooks/use-product.d.ts.map +1 -0
- package/dist/hooks/use-product.js +23 -0
- package/dist/hooks/use-products.d.ts +51 -0
- package/dist/hooks/use-products.d.ts.map +1 -0
- package/dist/hooks/use-products.js +38 -0
- package/dist/i18n/en-catalog.d.ts +199 -0
- package/dist/i18n/en-catalog.d.ts.map +1 -0
- package/dist/i18n/en-catalog.js +198 -0
- package/dist/i18n/en-core.d.ts +323 -0
- package/dist/i18n/en-core.d.ts.map +1 -0
- package/dist/i18n/en-core.js +322 -0
- package/dist/i18n/en-operations.d.ts +287 -0
- package/dist/i18n/en-operations.d.ts.map +1 -0
- package/dist/i18n/en-operations.js +286 -0
- package/dist/i18n/en.d.ts +803 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +8 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/message-shared.d.ts +6 -0
- package/dist/i18n/message-shared.d.ts.map +1 -0
- package/dist/i18n/message-shared.js +1 -0
- package/dist/i18n/messages-catalog.d.ts +199 -0
- package/dist/i18n/messages-catalog.d.ts.map +1 -0
- package/dist/i18n/messages-catalog.js +1 -0
- package/dist/i18n/messages-core.d.ts +304 -0
- package/dist/i18n/messages-core.d.ts.map +1 -0
- package/dist/i18n/messages-core.js +1 -0
- package/dist/i18n/messages-operations.d.ts +287 -0
- package/dist/i18n/messages-operations.d.ts.map +1 -0
- package/dist/i18n/messages-operations.js +1 -0
- package/dist/i18n/messages.d.ts +6 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +1 -0
- package/dist/i18n/provider.d.ts +1628 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +44 -0
- package/dist/i18n/ro-catalog.d.ts +199 -0
- package/dist/i18n/ro-catalog.d.ts.map +1 -0
- package/dist/i18n/ro-catalog.js +198 -0
- package/dist/i18n/ro-core.d.ts +323 -0
- package/dist/i18n/ro-core.d.ts.map +1 -0
- package/dist/i18n/ro-core.js +322 -0
- package/dist/i18n/ro-operations.d.ts +287 -0
- package/dist/i18n/ro-operations.d.ts.map +1 -0
- package/dist/i18n/ro-operations.js +286 -0
- package/dist/i18n/ro.d.ts +803 -0
- package/dist/i18n/ro.d.ts.map +1 -0
- package/dist/i18n/ro.js +8 -0
- package/dist/i18n-en.d.ts +2 -0
- package/dist/i18n-en.d.ts.map +1 -0
- package/dist/i18n-en.js +1 -0
- package/dist/i18n-ro.d.ts +2 -0
- package/dist/i18n-ro.d.ts.map +1 -0
- package/dist/i18n-ro.js +1 -0
- package/dist/i18n.d.ts +2 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/operations.d.ts +53 -0
- package/dist/operations.d.ts.map +1 -0
- package/dist/operations.js +13 -0
- package/dist/provider.d.ts +2 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +1 -0
- package/dist/query-keys.d.ts +114 -0
- package/dist/query-keys.d.ts.map +1 -0
- package/dist/query-keys.js +34 -0
- package/dist/query-options-action-ledger.d.ts +194 -0
- package/dist/query-options-action-ledger.d.ts.map +1 -0
- package/dist/query-options-action-ledger.js +20 -0
- package/dist/query-options.d.ts +1313 -0
- package/dist/query-options.d.ts.map +1 -0
- package/dist/query-options.js +281 -0
- package/dist/schemas.d.ts +1098 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +320 -0
- package/dist/ui.d.ts +44 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +42 -0
- package/package.json +159 -0
- package/src/styles.css +12 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChannelInfo, ChannelProductMapping } from "./product-detail-shared.js";
|
|
2
|
+
export declare function ProductChannelsSection({ allChannels, mappings, onAddChannel, onRemoveChannel, }: {
|
|
3
|
+
allChannels: ChannelInfo[];
|
|
4
|
+
mappings: ChannelProductMapping[];
|
|
5
|
+
onAddChannel: (channelId: string) => void;
|
|
6
|
+
onRemoveChannel: (mappingId: string) => void;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=product-detail-channel-section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-detail-channel-section.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-detail-channel-section.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAEpF,wBAAgB,sBAAsB,CAAC,EACrC,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,eAAe,GAChB,EAAE;IACD,WAAW,EAAE,WAAW,EAAE,CAAA;IAC1B,QAAQ,EAAE,qBAAqB,EAAE,CAAA;IACjC,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;CAC7C,2CA2EA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Badge, Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@voyant-travel/ui/components";
|
|
3
|
+
import { Plus, Trash2 } from "lucide-react";
|
|
4
|
+
import { useProductDetailMessages } from "./host.js";
|
|
5
|
+
import { Section } from "./product-detail-section-shell.js";
|
|
6
|
+
export function ProductChannelsSection({ allChannels, mappings, onAddChannel, onRemoveChannel, }) {
|
|
7
|
+
const messages = useProductDetailMessages();
|
|
8
|
+
const productMessages = messages.products.core;
|
|
9
|
+
const assignedChannelIds = new Set(mappings.map((mapping) => mapping.channelId));
|
|
10
|
+
const assignedChannels = allChannels.filter((channel) => assignedChannelIds.has(channel.id));
|
|
11
|
+
const unassignedChannels = allChannels.filter((channel) => !assignedChannelIds.has(channel.id) && channel.status === "active");
|
|
12
|
+
return (_jsx(Section, { title: productMessages.channelsTitle, children: _jsxs("div", { className: "flex flex-col gap-3", children: [assignedChannels.length === 0 ? (_jsx("p", { className: "text-sm text-muted-foreground", children: productMessages.channelsEmpty })) : (_jsx("div", { className: "flex flex-col divide-y", children: assignedChannels.map((channel) => {
|
|
13
|
+
const mapping = mappings.find((entry) => entry.channelId === channel.id);
|
|
14
|
+
return (_jsxs("div", { className: "flex items-center justify-between py-2 first:pt-0 last:pb-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-sm", children: channel.name }), _jsx(Badge, { variant: "outline", className: "text-[10px] capitalize", children: channel.kind.replace("_", " ") })] }), mapping ? (_jsx(Button, { variant: "ghost", size: "icon", className: "h-7 w-7 text-muted-foreground hover:text-destructive", onClick: () => onRemoveChannel(mapping.id), children: _jsx(Trash2, { className: "h-3.5 w-3.5" }) })) : null] }, channel.id));
|
|
15
|
+
}) })), unassignedChannels.length > 0 ? (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", size: "sm", className: "w-full", children: [_jsx(Plus, { className: "mr-1.5 h-3.5 w-3.5" }), productMessages.addChannel] }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-56", children: unassignedChannels.map((channel) => (_jsxs(DropdownMenuItem, { onClick: () => onAddChannel(channel.id), children: [channel.name, _jsx("span", { className: "ml-auto text-xs capitalize text-muted-foreground", children: channel.kind.replace("_", " ") })] }, channel.id))) })] })) : null, allChannels.length === 0 ? (_jsxs("p", { className: "text-xs text-muted-foreground", children: [productMessages.noChannelsDefined, " ", _jsx("a", { href: "/settings/channels", className: "underline", children: productMessages.createChannelsInSettings })] })) : null] }) }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type DayService, type ProductDay } from "./product-detail-shared.js";
|
|
2
|
+
export interface ProductDetailDayRowProps {
|
|
3
|
+
day: ProductDay;
|
|
4
|
+
productId: string;
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
onToggle: () => void;
|
|
7
|
+
onEdit: () => void;
|
|
8
|
+
onDelete: () => void;
|
|
9
|
+
onAddService: () => void;
|
|
10
|
+
onEditService: (service: DayService) => void;
|
|
11
|
+
onDeleteService: (serviceId: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function ProductDetailDayRow({ day, productId, expanded, onToggle, onEdit, onDelete, onAddService, onEditService, onDeleteService, }: ProductDetailDayRowProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=product-detail-day-row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-detail-day-row.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-detail-day-row.tsx"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,UAAU,EAGf,KAAK,UAAU,EAChB,MAAM,4BAA4B,CAAA;AAEnC,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,UAAU,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,aAAa,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAA;IAC5C,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;CAC7C;AAwBD,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,eAAe,GAChB,EAAE,wBAAwB,2CAgI1B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { formatMessage } from "@voyant-travel/i18n";
|
|
4
|
+
import { Badge, DropdownMenuItem, DropdownMenuSeparator } from "@voyant-travel/ui/components";
|
|
5
|
+
import { ChevronDown, ChevronRight, Image as ImageIcon, Pencil, Plus, Trash2 } from "lucide-react";
|
|
6
|
+
import { useProductDetailApi, useProductDetailMessages } from "./host.js";
|
|
7
|
+
import { ActionMenu } from "./product-detail-sections.js";
|
|
8
|
+
import { getProductDayMediaQueryOptions, getProductDayServicesQueryOptions, } from "./product-detail-shared.js";
|
|
9
|
+
function getServiceTypeLabel(serviceType, messages) {
|
|
10
|
+
switch (serviceType) {
|
|
11
|
+
case "accommodation":
|
|
12
|
+
return messages.serviceTypeAccommodation;
|
|
13
|
+
case "transfer":
|
|
14
|
+
return messages.serviceTypeTransfer;
|
|
15
|
+
case "experience":
|
|
16
|
+
return messages.serviceTypeExperience;
|
|
17
|
+
case "guide":
|
|
18
|
+
return messages.serviceTypeGuide;
|
|
19
|
+
case "meal":
|
|
20
|
+
return messages.serviceTypeMeal;
|
|
21
|
+
case "other":
|
|
22
|
+
return messages.serviceTypeOther;
|
|
23
|
+
default:
|
|
24
|
+
return serviceType;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function ProductDetailDayRow({ day, productId, expanded, onToggle, onEdit, onDelete, onAddService, onEditService, onDeleteService, }) {
|
|
28
|
+
const api = useProductDetailApi();
|
|
29
|
+
const messages = useProductDetailMessages();
|
|
30
|
+
const dayRowMessages = messages.products.operations.dayRows;
|
|
31
|
+
const serviceMessages = messages.products.operations.services;
|
|
32
|
+
const { data: servicesData } = useQuery({
|
|
33
|
+
...getProductDayServicesQueryOptions(api, productId, day.id),
|
|
34
|
+
enabled: expanded,
|
|
35
|
+
});
|
|
36
|
+
const { data: dayMediaData } = useQuery(getProductDayMediaQueryOptions(api, productId, day.id));
|
|
37
|
+
const mediaCount = dayMediaData?.data.length ?? 0;
|
|
38
|
+
const cover = dayMediaData?.data.find((m) => m.isCover) ?? dayMediaData?.data[0];
|
|
39
|
+
return (_jsxs("div", { className: "rounded-lg border", children: [_jsxs("div", { className: "flex items-center gap-3 px-4 py-3", children: [_jsx("button", { type: "button", onClick: onToggle, className: "text-muted-foreground transition-colors hover:text-foreground", children: expanded ? _jsx(ChevronDown, { className: "h-4 w-4" }) : _jsx(ChevronRight, { className: "h-4 w-4" }) }), cover?.mediaType === "image" ? (_jsx("img", { src: cover.url, alt: cover.altText ?? cover.name, className: "h-10 w-14 flex-shrink-0 rounded object-cover" })) : (_jsx("div", { className: "flex h-10 w-14 flex-shrink-0 items-center justify-center rounded border bg-muted/50 text-muted-foreground", children: _jsx(ImageIcon, { className: "h-4 w-4" }) })), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("span", { className: "text-sm font-medium", children: [formatMessage(dayRowMessages.title, { dayNumber: day.dayNumber }), day.title ? `: ${day.title}` : ""] }), day.location ? (_jsx("span", { className: "ml-2 text-xs text-muted-foreground", children: day.location })) : null] }), mediaCount > 0 ? (_jsx(Badge, { variant: "outline", className: "text-[10px]", children: formatMessage(dayRowMessages.photoCount, {
|
|
40
|
+
count: mediaCount,
|
|
41
|
+
suffix: mediaCount === 1 ? "" : "s",
|
|
42
|
+
}) })) : null, _jsxs(ActionMenu, { children: [_jsxs(DropdownMenuItem, { onClick: onEdit, children: [_jsx(Pencil, { className: "h-4 w-4" }), dayRowMessages.editAction] }), _jsxs(DropdownMenuItem, { onClick: onAddService, children: [_jsx(Plus, { className: "h-4 w-4" }), dayRowMessages.addServiceAction] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { variant: "destructive", onClick: onDelete, children: [_jsx(Trash2, { className: "h-4 w-4" }), dayRowMessages.deleteAction] })] })] }), expanded ? (_jsx("div", { className: "border-t", children: !servicesData?.data || servicesData.data.length === 0 ? (_jsx("p", { className: "py-4 text-center text-xs text-muted-foreground", children: dayRowMessages.emptyServices })) : (_jsxs("table", { className: "w-full text-xs", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-b bg-muted/30 text-muted-foreground", children: [_jsx("th", { className: "py-2 pl-4 pr-3 text-left font-medium", children: dayRowMessages.tableName }), _jsx("th", { className: "px-3 py-2 text-left font-medium", children: dayRowMessages.tableType }), _jsx("th", { className: "px-3 py-2 text-left font-medium", children: dayRowMessages.tableCost }), _jsx("th", { className: "px-3 py-2 text-left font-medium", children: dayRowMessages.tableQuantity }), _jsx("th", { className: "w-10 px-3 py-2" })] }) }), _jsx("tbody", { children: servicesData.data.map((service) => (_jsxs("tr", { className: "border-b last:border-b-0", children: [_jsx("td", { className: "py-2 pl-4 pr-3", children: service.name }), _jsx("td", { className: "px-3 py-2", children: _jsx(Badge, { variant: "outline", className: "text-xs capitalize", children: getServiceTypeLabel(service.serviceType, serviceMessages) }) }), _jsxs("td", { className: "px-3 py-2 font-mono", children: [(service.costAmountCents / 100).toFixed(2), " ", service.costCurrency] }), _jsx("td", { className: "px-3 py-2", children: service.quantity }), _jsx("td", { className: "px-3 py-2", children: _jsxs(ActionMenu, { children: [_jsxs(DropdownMenuItem, { onClick: () => onEditService(service), children: [_jsx(Pencil, { className: "h-4 w-4" }), dayRowMessages.editAction] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { variant: "destructive", onClick: () => onDeleteService(service.id), children: [_jsx(Trash2, { className: "h-4 w-4" }), dayRowMessages.deleteAction] })] }) })] }, service.id))) })] })) })) : null] }));
|
|
43
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ProductData } from "./product-detail-form.js";
|
|
2
|
+
export type { ProductData };
|
|
3
|
+
type ProductDialogProps = {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onOpenChange: (open: boolean) => void;
|
|
6
|
+
product?: ProductData;
|
|
7
|
+
onSuccess: (id?: string) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function ProductDialog({ open, onOpenChange, product, onSuccess }: ProductDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=product-detail-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-detail-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-detail-dialog.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,0BAA0B,CAAA;AAE9E,YAAY,EAAE,WAAW,EAAE,CAAA;AAE3B,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC,CAAA;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,kBAAkB,2CAuB3F"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Sheet, SheetBody, SheetContent, SheetHeader, SheetTitle, } from "@voyant-travel/ui/components";
|
|
3
|
+
import { useProductDetailMessages } from "./host.js";
|
|
4
|
+
import { ProductDetailForm } from "./product-detail-form.js";
|
|
5
|
+
export function ProductDialog({ open, onOpenChange, product, onSuccess }) {
|
|
6
|
+
const messages = useProductDetailMessages();
|
|
7
|
+
const productMessages = messages.products.core;
|
|
8
|
+
const isEditing = !!product;
|
|
9
|
+
return (_jsx(Sheet, { open: open, onOpenChange: onOpenChange, children: _jsxs(SheetContent, { side: "right", size: "lg", children: [_jsx(SheetHeader, { children: _jsx(SheetTitle, { children: isEditing ? productMessages.detailSheetEditTitle : productMessages.detailSheetNewTitle }) }), _jsx(SheetBody, { children: _jsx(ProductDetailForm, { product: product, onSuccess: onSuccess, onCancel: () => onOpenChange(false) }) })] }) }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type ProductData = {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
status: "draft" | "active" | "archived";
|
|
5
|
+
description: string | null;
|
|
6
|
+
inclusionsHtml: string | null;
|
|
7
|
+
exclusionsHtml: string | null;
|
|
8
|
+
termsHtml: string | null;
|
|
9
|
+
bookingMode: "date" | "date_time" | "open" | "stay" | "transfer" | "itinerary" | "other";
|
|
10
|
+
productTypeId: string | null;
|
|
11
|
+
taxClassId: string | null;
|
|
12
|
+
sellCurrency: string;
|
|
13
|
+
tags: string[];
|
|
14
|
+
defaultLanguageTag?: string | null;
|
|
15
|
+
};
|
|
16
|
+
export interface ProductDetailFormProps {
|
|
17
|
+
product?: ProductData;
|
|
18
|
+
onSuccess: (id?: string) => void;
|
|
19
|
+
onCancel?: () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function ProductDetailForm({ product, onSuccess, onCancel }: ProductDetailFormProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=product-detail-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-detail-form.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-detail-form.tsx"],"names":[],"mappings":"AAwCA,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAA;IACvC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,WAAW,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAA;IACxF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACnC,CAAA;AAgBD,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAmCD,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,sBAAsB,2CA8ZzF"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// agent-quality: file-size exception -- owner: inventory-react; existing UI surface stays co-located until a dedicated split preserves behavior and tests.
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
4
|
+
import { Badge, Button, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@voyant-travel/ui/components";
|
|
5
|
+
import { Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, } from "@voyant-travel/ui/components/combobox";
|
|
6
|
+
import { currencies } from "@voyant-travel/utils/currencies";
|
|
7
|
+
import { Loader2, X } from "lucide-react";
|
|
8
|
+
import { useEffect, useState } from "react";
|
|
9
|
+
import { useForm } from "react-hook-form";
|
|
10
|
+
import { z } from "zod/v4";
|
|
11
|
+
import { useProductDetailApi, useProductDetailMessages, useProductLocale } from "./host.js";
|
|
12
|
+
import { ContentLanguageSwitcher, LanguageCombobox, TranslatableField, useProductTranslationDrafts, } from "./product-translation-popover.js";
|
|
13
|
+
import { zodResolver } from "./zod-resolver.js";
|
|
14
|
+
const CURRENCY_OPTIONS = Object.values(currencies).map((c) => ({
|
|
15
|
+
value: c.code,
|
|
16
|
+
label: `${c.code} — ${c.name} (${c.symbol})`,
|
|
17
|
+
}));
|
|
18
|
+
function initialValues(product) {
|
|
19
|
+
if (product) {
|
|
20
|
+
return {
|
|
21
|
+
name: product.name,
|
|
22
|
+
status: product.status,
|
|
23
|
+
description: product.description ?? "",
|
|
24
|
+
inclusionsHtml: product.inclusionsHtml ?? "",
|
|
25
|
+
exclusionsHtml: product.exclusionsHtml ?? "",
|
|
26
|
+
termsHtml: product.termsHtml ?? "",
|
|
27
|
+
bookingMode: product.bookingMode,
|
|
28
|
+
productTypeId: product.productTypeId ?? "",
|
|
29
|
+
taxClassId: product.taxClassId ?? "",
|
|
30
|
+
sellCurrency: product.sellCurrency,
|
|
31
|
+
tags: product.tags ?? [],
|
|
32
|
+
defaultLanguageTag: product.defaultLanguageTag ?? "",
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
name: "",
|
|
37
|
+
status: "draft",
|
|
38
|
+
description: "",
|
|
39
|
+
inclusionsHtml: "",
|
|
40
|
+
exclusionsHtml: "",
|
|
41
|
+
termsHtml: "",
|
|
42
|
+
bookingMode: "itinerary",
|
|
43
|
+
productTypeId: "",
|
|
44
|
+
taxClassId: "",
|
|
45
|
+
sellCurrency: "EUR",
|
|
46
|
+
tags: [],
|
|
47
|
+
defaultLanguageTag: "",
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export function ProductDetailForm({ product, onSuccess, onCancel }) {
|
|
51
|
+
const messages = useProductDetailMessages();
|
|
52
|
+
const api = useProductDetailApi();
|
|
53
|
+
const productMessages = messages.products.core;
|
|
54
|
+
const isEditing = !!product;
|
|
55
|
+
const productFormSchema = z.object({
|
|
56
|
+
name: z.string().min(1, productMessages.validationNameRequired),
|
|
57
|
+
status: z.enum(["draft", "active", "archived"]),
|
|
58
|
+
description: z.string().optional().nullable(),
|
|
59
|
+
inclusionsHtml: z.string().optional().nullable(),
|
|
60
|
+
exclusionsHtml: z.string().optional().nullable(),
|
|
61
|
+
termsHtml: z.string().optional().nullable(),
|
|
62
|
+
bookingMode: z.enum(["date", "date_time", "open", "stay", "transfer", "itinerary", "other"]),
|
|
63
|
+
productTypeId: z.string().optional().nullable(),
|
|
64
|
+
taxClassId: z.string().optional().nullable(),
|
|
65
|
+
sellCurrency: z
|
|
66
|
+
.string()
|
|
67
|
+
.min(3, productMessages.validationIsoCurrency)
|
|
68
|
+
.max(3, productMessages.validationIsoCurrency),
|
|
69
|
+
tags: z.array(z.string()).default([]),
|
|
70
|
+
defaultLanguageTag: z.string().optional().nullable(),
|
|
71
|
+
});
|
|
72
|
+
const productStatuses = [
|
|
73
|
+
{ value: "draft", label: productMessages.statusDraft },
|
|
74
|
+
{ value: "active", label: productMessages.statusActive },
|
|
75
|
+
{ value: "archived", label: productMessages.statusArchived },
|
|
76
|
+
];
|
|
77
|
+
// Ordered most-common-first for this operator (multi-day tours, then day
|
|
78
|
+
// trips). The chosen mode also drives the option pricing layout
|
|
79
|
+
// (rooms vs per-person seats) — see deriveOptionPricingLayout.
|
|
80
|
+
const bookingModes = [
|
|
81
|
+
{ value: "itinerary", label: productMessages.bookingModeItinerary },
|
|
82
|
+
{ value: "stay", label: productMessages.bookingModeStay },
|
|
83
|
+
{ value: "date", label: productMessages.bookingModeDate },
|
|
84
|
+
{ value: "date_time", label: productMessages.bookingModeDateTime },
|
|
85
|
+
{ value: "transfer", label: productMessages.bookingModeTransfer },
|
|
86
|
+
{ value: "open", label: productMessages.bookingModeOpen },
|
|
87
|
+
{ value: "other", label: productMessages.bookingModeOther },
|
|
88
|
+
];
|
|
89
|
+
const form = useForm({
|
|
90
|
+
resolver: zodResolver(productFormSchema),
|
|
91
|
+
defaultValues: initialValues(product),
|
|
92
|
+
});
|
|
93
|
+
const translations = useProductTranslationDrafts(product?.id ?? null);
|
|
94
|
+
const resolvedLocale = useProductLocale();
|
|
95
|
+
const adminBaseLocale = resolvedLocale.split("-")[0]?.toLowerCase() || "en";
|
|
96
|
+
const defaultLanguageTag = form.watch("defaultLanguageTag")?.trim() || adminBaseLocale;
|
|
97
|
+
const [activeLanguage, setActiveLanguage] = useState(defaultLanguageTag);
|
|
98
|
+
// Following the default language keeps the active field in sync when the
|
|
99
|
+
// product changes (form.reset) or the default-language setting is edited.
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
setActiveLanguage(defaultLanguageTag);
|
|
102
|
+
}, [defaultLanguageTag]);
|
|
103
|
+
const [tagInput, setTagInput] = useState("");
|
|
104
|
+
const { data: typesData } = useQuery({
|
|
105
|
+
queryKey: ["product-types"],
|
|
106
|
+
queryFn: () => api.get("/v1/products/product-types?limit=25&active=true"),
|
|
107
|
+
});
|
|
108
|
+
const { data: taxClassesData } = useQuery({
|
|
109
|
+
queryKey: ["tax-classes"],
|
|
110
|
+
queryFn: () => api.get("/v1/admin/finance/tax-classes?limit=100&active=true"),
|
|
111
|
+
});
|
|
112
|
+
const productTypes = typesData?.data ?? [];
|
|
113
|
+
const taxClasses = taxClassesData?.data ?? [];
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
form.reset(initialValues(product));
|
|
116
|
+
setTagInput("");
|
|
117
|
+
}, [product, form]);
|
|
118
|
+
const onSubmit = async (values) => {
|
|
119
|
+
const resolvedDefaultLanguage = values.defaultLanguageTag?.trim() || adminBaseLocale;
|
|
120
|
+
const payload = {
|
|
121
|
+
name: values.name,
|
|
122
|
+
status: values.status,
|
|
123
|
+
description: values.description || null,
|
|
124
|
+
inclusionsHtml: values.inclusionsHtml || null,
|
|
125
|
+
exclusionsHtml: values.exclusionsHtml || null,
|
|
126
|
+
termsHtml: values.termsHtml || null,
|
|
127
|
+
bookingMode: values.bookingMode,
|
|
128
|
+
productTypeId: values.productTypeId || null,
|
|
129
|
+
taxClassId: values.taxClassId || null,
|
|
130
|
+
sellCurrency: values.sellCurrency,
|
|
131
|
+
tags: values.tags,
|
|
132
|
+
defaultLanguageTag: resolvedDefaultLanguage,
|
|
133
|
+
};
|
|
134
|
+
const persistOptions = {
|
|
135
|
+
defaultLanguageTag: resolvedDefaultLanguage,
|
|
136
|
+
baseName: values.name,
|
|
137
|
+
baseDescription: values.description ?? "",
|
|
138
|
+
baseInclusionsHtml: values.inclusionsHtml ?? "",
|
|
139
|
+
baseExclusionsHtml: values.exclusionsHtml ?? "",
|
|
140
|
+
baseTermsHtml: values.termsHtml ?? "",
|
|
141
|
+
};
|
|
142
|
+
if (isEditing) {
|
|
143
|
+
await api.patch(`/v1/products/${product.id}`, payload);
|
|
144
|
+
await translations.persist(product.id, persistOptions);
|
|
145
|
+
onSuccess();
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
const result = await api.post("/v1/products", payload);
|
|
149
|
+
await translations.persist(result.id, persistOptions);
|
|
150
|
+
onSuccess(result.id);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
return (_jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-1 flex-col gap-4 overflow-hidden", children: [_jsxs("div", { className: "grid gap-4", children: [_jsx(ContentLanguageSwitcher, { activeLanguage: activeLanguage, defaultLanguageTag: defaultLanguageTag, languageTags: translations.drafts.map((draft) => draft.languageTag), messages: productMessages, onSelect: setActiveLanguage, onAddLanguage: (code) => {
|
|
154
|
+
translations.addLanguage(code);
|
|
155
|
+
setActiveLanguage(code);
|
|
156
|
+
}, onRemoveLanguage: (code) => {
|
|
157
|
+
translations.removeLanguage(code);
|
|
158
|
+
if (activeLanguage === code)
|
|
159
|
+
setActiveLanguage(defaultLanguageTag);
|
|
160
|
+
} }), _jsx(TranslatableField, { label: productMessages.nameLabel, type: "text", field: "name", activeLanguage: activeLanguage, defaultLanguageTag: defaultLanguageTag, base: {
|
|
161
|
+
value: form.watch("name") ?? "",
|
|
162
|
+
onChange: (value) => form.setValue("name", value, { shouldDirty: true, shouldValidate: true }),
|
|
163
|
+
}, translations: translations, messages: productMessages, placeholder: productMessages.namePlaceholder, autoFocus: true, error: form.formState.errors.name?.message }), _jsx(TranslatableField, { label: productMessages.descriptionLabel, type: "richtext", field: "description", activeLanguage: activeLanguage, defaultLanguageTag: defaultLanguageTag, base: {
|
|
164
|
+
value: form.watch("description") ?? "",
|
|
165
|
+
onChange: (value) => form.setValue("description", value, { shouldDirty: true }),
|
|
166
|
+
}, translations: translations, messages: productMessages, placeholder: productMessages.descriptionPlaceholder }), _jsx(TranslatableField, { label: productMessages.slugLabel, type: "text", field: "slug", activeLanguage: activeLanguage, defaultLanguageTag: defaultLanguageTag, translations: translations, messages: productMessages, placeholder: productMessages.slugPlaceholder }), _jsx(TranslatableField, { label: productMessages.inclusionsLabel, type: "richtext", field: "inclusionsHtml", activeLanguage: activeLanguage, defaultLanguageTag: defaultLanguageTag, base: {
|
|
167
|
+
value: form.watch("inclusionsHtml") ?? "",
|
|
168
|
+
onChange: (value) => form.setValue("inclusionsHtml", value, { shouldDirty: true }),
|
|
169
|
+
}, translations: translations, messages: productMessages, placeholder: productMessages.inclusionsPlaceholder }), _jsx(TranslatableField, { label: productMessages.exclusionsLabel, type: "richtext", field: "exclusionsHtml", activeLanguage: activeLanguage, defaultLanguageTag: defaultLanguageTag, base: {
|
|
170
|
+
value: form.watch("exclusionsHtml") ?? "",
|
|
171
|
+
onChange: (value) => form.setValue("exclusionsHtml", value, { shouldDirty: true }),
|
|
172
|
+
}, translations: translations, messages: productMessages, placeholder: productMessages.exclusionsPlaceholder }), _jsx(TranslatableField, { label: productMessages.termsLabel, type: "richtext", field: "termsHtml", activeLanguage: activeLanguage, defaultLanguageTag: defaultLanguageTag, base: {
|
|
173
|
+
value: form.watch("termsHtml") ?? "",
|
|
174
|
+
onChange: (value) => form.setValue("termsHtml", value, { shouldDirty: true }),
|
|
175
|
+
}, translations: translations, messages: productMessages, placeholder: productMessages.termsPlaceholder }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: productMessages.defaultLanguageLabel }), _jsx(LanguageCombobox, { value: form.watch("defaultLanguageTag")?.trim() || adminBaseLocale, onValueChange: (code) => form.setValue("defaultLanguageTag", code, { shouldDirty: true }), placeholder: productMessages.translationLanguageSearch, emptyLabel: productMessages.translationLanguageEmpty }), _jsx("p", { className: "text-xs text-muted-foreground", children: productMessages.defaultLanguageHint })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: productMessages.tagsLabel }), _jsx("div", { className: "flex flex-wrap gap-1.5", children: (form.watch("tags") ?? []).map((tag) => (_jsxs(Badge, { variant: "secondary", className: "gap-1 text-xs", children: [tag, _jsx("button", { type: "button", className: "ml-0.5 rounded-full hover:text-destructive", onClick: () => {
|
|
176
|
+
const current = form.getValues("tags") ?? [];
|
|
177
|
+
form.setValue("tags", current.filter((t) => t !== tag), { shouldDirty: true });
|
|
178
|
+
}, children: _jsx(X, { className: "h-3 w-3" }) })] }, tag))) }), _jsx(Input, { value: tagInput, onChange: (e) => setTagInput(e.target.value), onKeyDown: (e) => {
|
|
179
|
+
if (e.key === "Enter" || e.key === ",") {
|
|
180
|
+
e.preventDefault();
|
|
181
|
+
const value = tagInput.trim().replace(/,+$/, "");
|
|
182
|
+
const current = form.getValues("tags") ?? [];
|
|
183
|
+
if (value && !current.includes(value)) {
|
|
184
|
+
form.setValue("tags", [...current, value], { shouldDirty: true });
|
|
185
|
+
}
|
|
186
|
+
setTagInput("");
|
|
187
|
+
}
|
|
188
|
+
}, placeholder: productMessages.tagInputPlaceholder })] }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: productMessages.bookingModeLabel }), _jsxs(Select, { value: form.watch("bookingMode"), onValueChange: (v) => form.setValue("bookingMode", v), items: bookingModes, children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: bookingModes.map((m) => (_jsx(SelectItem, { value: m.value, children: m.label }, m.value))) })] })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: productMessages.productTypeLabel }), _jsxs(Select, { value: form.watch("productTypeId") ?? "", onValueChange: (v) => form.setValue("productTypeId", v === "__none__" ? null : v, {
|
|
189
|
+
shouldDirty: true,
|
|
190
|
+
}), items: [
|
|
191
|
+
{ value: "__none__", label: productMessages.productTypeNone },
|
|
192
|
+
...productTypes.map((t) => ({ value: t.id, label: t.name })),
|
|
193
|
+
], children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, { placeholder: productMessages.productTypeNone }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "__none__", children: productMessages.productTypeNone }), productTypes.map((t) => (_jsx(SelectItem, { value: t.id, children: t.name }, t.id)))] })] })] })] }), isEditing && (_jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: productMessages.statusLabel }), _jsxs(Select, { value: form.watch("status"), onValueChange: (v) => form.setValue("status", v), items: productStatuses, children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: productStatuses.map((s) => (_jsx(SelectItem, { value: s.value, children: s.label }, s.value))) })] })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: productMessages.taxClassLabel }), _jsxs(Select, { value: form.watch("taxClassId") ?? "", onValueChange: (v) => form.setValue("taxClassId", v === "__none__" ? null : v, {
|
|
194
|
+
shouldDirty: true,
|
|
195
|
+
}), items: [
|
|
196
|
+
{ value: "__none__", label: productMessages.taxClassNone },
|
|
197
|
+
...taxClasses.map((taxClass) => ({
|
|
198
|
+
value: taxClass.id,
|
|
199
|
+
label: taxClass.label,
|
|
200
|
+
})),
|
|
201
|
+
], children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, { placeholder: productMessages.taxClassNone }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "__none__", children: productMessages.taxClassNone }), taxClasses.map((taxClass) => (_jsx(SelectItem, { value: taxClass.id, children: taxClass.label }, taxClass.id)))] })] })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: productMessages.sellCurrencyLabel }), _jsx(CurrencyCombobox, { value: form.watch("sellCurrency"), onChange: (v) => form.setValue("sellCurrency", v, { shouldDirty: true }), messages: productMessages }), form.formState.errors.sellCurrency && (_jsx("p", { className: "text-xs text-destructive", children: form.formState.errors.sellCurrency.message }))] })] }))] }), _jsxs("div", { className: "flex items-center justify-end gap-2", children: [onCancel ? (_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: onCancel, children: productMessages.cancel })) : null, _jsxs(Button, { type: "submit", size: "sm", disabled: form.formState.isSubmitting, children: [form.formState.isSubmitting && _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), isEditing ? productMessages.saveChanges : productMessages.createProduct] })] })] }));
|
|
202
|
+
}
|
|
203
|
+
function CurrencyCombobox({ value, onChange, messages, }) {
|
|
204
|
+
return (_jsxs(Combobox, { value: value, onValueChange: (v) => onChange(v ?? ""), children: [_jsx(ComboboxInput, { placeholder: messages.currencySearchPlaceholder, className: "w-full" }), _jsx(ComboboxContent, { children: _jsxs(ComboboxList, { children: [CURRENCY_OPTIONS.map((c) => (_jsxs(ComboboxItem, { value: c.value, children: [_jsx("span", { className: "font-mono text-xs", children: c.value }), _jsx("span", { className: "truncate text-muted-foreground", children: c.label.split(" — ")[1] })] }, c.value))), _jsx(ComboboxEmpty, { children: messages.currencyEmpty })] }) })] }));
|
|
205
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ProductRecord } from "./product-detail-shared.js";
|
|
2
|
+
export interface ProductDetailHeaderProps {
|
|
3
|
+
product: ProductRecord;
|
|
4
|
+
isDuplicating: boolean;
|
|
5
|
+
isDeleting: boolean;
|
|
6
|
+
onEdit: () => void;
|
|
7
|
+
onAddBooking: () => void;
|
|
8
|
+
onDuplicate: () => void;
|
|
9
|
+
onDelete: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function ProductDetailHeader({ product, isDuplicating, isDeleting, onEdit, onAddBooking, onDuplicate, onDelete, }: ProductDetailHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=product-detail-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-detail-header.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-detail-header.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAG/D,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,aAAa,CAAA;IACtB,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,EAAE,OAAO,CAAA;IACnB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,aAAa,EACb,UAAU,EACV,MAAM,EACN,YAAY,EACZ,WAAW,EACX,QAAQ,GACT,EAAE,wBAAwB,2CAwC1B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Badge, Button, DropdownMenuItem } from "@voyant-travel/ui/components";
|
|
3
|
+
import { CalendarPlus, Copy, Pencil, Trash2 } from "lucide-react";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
import { useProductDetailHost, useProductDetailMessages } from "./host.js";
|
|
6
|
+
import { ActionMenu } from "./product-detail-sections.js";
|
|
7
|
+
import { getProductStatusLabel, statusVariant } from "./product-detail-shared.js";
|
|
8
|
+
export function ProductDetailHeader({ product, isDuplicating, isDeleting, onEdit, onAddBooking, onDuplicate, onDelete, }) {
|
|
9
|
+
const messages = useProductDetailMessages();
|
|
10
|
+
const productMessages = messages.products.core;
|
|
11
|
+
const { setBreadcrumbs } = useProductDetailHost();
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setBreadcrumbs?.([
|
|
14
|
+
{ label: productMessages.breadcrumbProducts, href: "/products" },
|
|
15
|
+
{ label: product.name },
|
|
16
|
+
]);
|
|
17
|
+
}, [setBreadcrumbs, productMessages.breadcrumbProducts, product.name]);
|
|
18
|
+
return (_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h1", { className: "text-2xl font-bold tracking-tight", children: product.name }), _jsx(Badge, { variant: statusVariant[product.status] ?? "secondary", children: getProductStatusLabel(product.status, messages) })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { variant: "outline", size: "sm", onClick: onEdit, children: [_jsx(Pencil, { className: "h-4 w-4" }), productMessages.edit] }), _jsxs(Button, { variant: "outline", size: "sm", onClick: onAddBooking, children: [_jsx(CalendarPlus, { className: "h-4 w-4" }), productMessages.addBooking] }), _jsxs(ActionMenu, { children: [_jsxs(DropdownMenuItem, { disabled: isDuplicating, onClick: onDuplicate, children: [_jsx(Copy, { className: "h-4 w-4" }), productMessages.duplicate] }), _jsxs(DropdownMenuItem, { variant: "destructive", disabled: isDeleting, onClick: onDelete, children: [_jsx(Trash2, { className: "h-4 w-4" }), productMessages.delete] })] })] })] }));
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-detail-itinerary-section.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-detail-itinerary-section.tsx"],"names":[],"mappings":"AA6EA,wBAAgB,6BAA6B,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,2CAsXjF"}
|