@propeller-commerce/propeller-v2-vue-ui 0.3.14
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 +549 -0
- package/LICENSE +21 -0
- package/MIGRATION.md +178 -0
- package/README.md +282 -0
- package/STYLING.md +119 -0
- package/dist/ProductVideos.vue_vue_type_script_setup_true_lang-BSXOpWBD.js +1706 -0
- package/dist/ProductVideos.vue_vue_type_script_setup_true_lang-BSXOpWBD.js.map +1 -0
- package/dist/ProductVideos.vue_vue_type_script_setup_true_lang-cfRT3L_k.cjs +1705 -0
- package/dist/ProductVideos.vue_vue_type_script_setup_true_lang-cfRT3L_k.cjs.map +1 -0
- package/dist/__mocks__/decorators.d.ts +17 -0
- package/dist/__mocks__/fixtures.d.ts +43 -0
- package/dist/__mocks__/mockServices.d.ts +7 -0
- package/dist/components/AccountIconAndMenu.vue.d.ts +152 -0
- package/dist/components/ActionCode.vue.d.ts +29 -0
- package/dist/components/AddToCart.vue.d.ts +122 -0
- package/dist/components/AddToFavorite.vue.d.ts +19 -0
- package/dist/components/AddressCard.vue.d.ts +169 -0
- package/dist/components/AddressSelector.vue.d.ts +30 -0
- package/dist/components/Breadcrumbs.vue.d.ts +69 -0
- package/dist/components/CartBonusItems.vue.d.ts +21 -0
- package/dist/components/CartCarriers.vue.d.ts +24 -0
- package/dist/components/CartIconAndSidebar.vue.d.ts +104 -0
- package/dist/components/CartItem.vue.d.ts +178 -0
- package/dist/components/CartOverview.vue.d.ts +41 -0
- package/dist/components/CartPaymethods.vue.d.ts +23 -0
- package/dist/components/CartSummary.vue.d.ts +58 -0
- package/dist/components/CategoryDescription.vue.d.ts +29 -0
- package/dist/components/CategoryShortDescription.vue.d.ts +18 -0
- package/dist/components/ClusterCard.vue.d.ts +251 -0
- package/dist/components/ClusterConfigurator.vue.d.ts +41 -0
- package/dist/components/ClusterInfo.vue.d.ts +73 -0
- package/dist/components/ClusterJsonLd.vue.d.ts +10 -0
- package/dist/components/ClusterOptions.vue.d.ts +44 -0
- package/dist/components/CompanySwitcher.vue.d.ts +18 -0
- package/dist/components/DeliveryDate.vue.d.ts +27 -0
- package/dist/components/FavoriteListDetails.vue.d.ts +94 -0
- package/dist/components/FavoriteListItem.vue.d.ts +141 -0
- package/dist/components/FavoriteLists.vue.d.ts +73 -0
- package/dist/components/ForgotPassword.vue.d.ts +35 -0
- package/dist/components/GridFilters.vue.d.ts +64 -0
- package/dist/components/GridPagination.vue.d.ts +34 -0
- package/dist/components/GridTitle.vue.d.ts +22 -0
- package/dist/components/GridToolbar.vue.d.ts +117 -0
- package/dist/components/ItemListJsonLd.vue.d.ts +10 -0
- package/dist/components/ItemStock.vue.d.ts +31 -0
- package/dist/components/ItemsOverview.vue.d.ts +40 -0
- package/dist/components/LoginForm.vue.d.ts +139 -0
- package/dist/components/Menu.vue.d.ts +73 -0
- package/dist/components/OrderActions.vue.d.ts +25 -0
- package/dist/components/OrderBonusItems.vue.d.ts +19 -0
- package/dist/components/OrderItemCard.vue.d.ts +47 -0
- package/dist/components/OrderList.vue.d.ts +66 -0
- package/dist/components/OrderShipments.vue.d.ts +11 -0
- package/dist/components/OrderSummary.vue.d.ts +49 -0
- package/dist/components/OrderTotals.vue.d.ts +34 -0
- package/dist/components/PriceToggle.vue.d.ts +24 -0
- package/dist/components/ProductBulkPrices.vue.d.ts +35 -0
- package/dist/components/ProductBundles.vue.d.ts +88 -0
- package/dist/components/ProductCard.vue.d.ts +332 -0
- package/dist/components/ProductDescription.vue.d.ts +30 -0
- package/dist/components/ProductDownloads.vue.d.ts +22 -0
- package/dist/components/ProductGallery.vue.d.ts +25 -0
- package/dist/components/ProductGrid.vue.d.ts +290 -0
- package/dist/components/ProductInfo.vue.d.ts +179 -0
- package/dist/components/ProductJsonLd.vue.d.ts +10 -0
- package/dist/components/ProductPrice.vue.d.ts +42 -0
- package/dist/components/ProductShortDescription.vue.d.ts +18 -0
- package/dist/components/ProductSlider.vue.d.ts +176 -0
- package/dist/components/ProductSpecifications.vue.d.ts +37 -0
- package/dist/components/ProductTabs.vue.d.ts +83 -0
- package/dist/components/ProductVideos.vue.d.ts +22 -0
- package/dist/components/PropellerProvider.vue.d.ts +40 -0
- package/dist/components/PurchaseAuthorizationConfigurator.vue.d.ts +44 -0
- package/dist/components/PurchaseAuthorizationRequests.vue.d.ts +50 -0
- package/dist/components/QuoteActions.vue.d.ts +22 -0
- package/dist/components/RegisterForm.vue.d.ts +87 -0
- package/dist/components/SearchBar.vue.d.ts +71 -0
- package/dist/components/UserDetails.vue.d.ts +44 -0
- package/dist/components/defaults/DefaultProductBadges.vue.d.ts +3 -0
- package/dist/components/defaults/DefaultProductImage.vue.d.ts +3 -0
- package/dist/components/defaults/DefaultProductSurcharges.vue.d.ts +3 -0
- package/dist/composables/shared/usePagination.d.ts +19 -0
- package/dist/composables/shared/useServiceFetch.d.ts +9 -0
- package/dist/composables/shared/useUserIdentity.d.ts +13 -0
- package/dist/composables/shared/utils/cartInit.d.ts +18 -0
- package/dist/composables/shared/utils/fetchActiveCart.d.ts +10 -0
- package/dist/composables/shared/utils/mergeAnonymousCart.d.ts +12 -0
- package/dist/composables/vue/useAddress.d.ts +50 -0
- package/dist/composables/vue/useAuth.d.ts +80 -0
- package/dist/composables/vue/useCart.d.ts +64 -0
- package/dist/composables/vue/useCheckout.d.ts +41 -0
- package/dist/composables/vue/useClusterConfigurator.d.ts +26 -0
- package/dist/composables/vue/useCompany.d.ts +31 -0
- package/dist/composables/vue/useFavorites.d.ts +39 -0
- package/dist/composables/vue/useInfraProps.d.ts +27 -0
- package/dist/composables/vue/useMenu.d.ts +24 -0
- package/dist/composables/vue/useOrders.d.ts +64 -0
- package/dist/composables/vue/useProductBundles.d.ts +37 -0
- package/dist/composables/vue/useProductInfo.d.ts +33 -0
- package/dist/composables/vue/useProductSearch.d.ts +49 -0
- package/dist/composables/vue/useProductSlider.d.ts +31 -0
- package/dist/composables/vue/useProductSpecs.d.ts +24 -0
- package/dist/composables/vue/usePurchaseAuthorization.d.ts +102 -0
- package/dist/composables/vue/useResolvedProps.d.ts +42 -0
- package/dist/composables/vue/useServices.d.ts +13 -0
- package/dist/context/ProductGridContext.d.ts +59 -0
- package/dist/context/PropellerContext.d.ts +51 -0
- package/dist/index-BN8nyGRL.js +518 -0
- package/dist/index-BN8nyGRL.js.map +1 -0
- package/dist/index-CrrZsxTR.cjs +517 -0
- package/dist/index-CrrZsxTR.cjs.map +1 -0
- package/dist/index.cjs +20086 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +109 -0
- package/dist/index.js +20088 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +67 -0
- package/dist/pure.cjs +16 -0
- package/dist/pure.cjs.map +1 -0
- package/dist/pure.d.ts +37 -0
- package/dist/pure.js +16 -0
- package/dist/pure.js.map +1 -0
- package/dist/shared.cjs +50 -0
- package/dist/shared.cjs.map +1 -0
- package/dist/shared.d.ts +14 -0
- package/dist/shared.js +50 -0
- package/dist/shared.js.map +1 -0
- package/dist/styles.css +2 -0
- package/package.json +91 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { GraphQLClient, Product, Cluster, Cart, CartMainItem, AttributeFilter, ProductTextFilterInput, ProductsResponse, Category, Contact, Customer } from '@propeller-commerce/propeller-sdk-v2';
|
|
3
|
+
export interface ProductGridProps {
|
|
4
|
+
/**
|
|
5
|
+
* Initialised Propeller SDK GraphQL client.
|
|
6
|
+
* Required when `products` is not provided — used for internal data fetching.
|
|
7
|
+
*/
|
|
8
|
+
graphqlClient?: GraphQLClient;
|
|
9
|
+
/**
|
|
10
|
+
* Pre-fetched products/clusters to display.
|
|
11
|
+
* When provided the component skips internal API calls entirely.
|
|
12
|
+
* Pass an empty array (not undefined) to show the empty state while the
|
|
13
|
+
* parent controls loading.
|
|
14
|
+
*/
|
|
15
|
+
products?: (Product | Cluster)[];
|
|
16
|
+
/** Language code for product data. Defaults to 'NL'. */
|
|
17
|
+
language?: string;
|
|
18
|
+
/** Tax zone used for price calculation. Defaults to 'NL'. */
|
|
19
|
+
taxZone?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Category ID to list products for (category-page mode).
|
|
22
|
+
* When omitted alongside `term` and `brand`, `config.baseCategoryId` is used.
|
|
23
|
+
*/
|
|
24
|
+
categoryId?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Search term — passes `term` into categoryProductSearchInput and uses
|
|
27
|
+
* `config.baseCategoryId` so the whole catalog is searched.
|
|
28
|
+
*/
|
|
29
|
+
term?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Manufacturer/brand name — passes `manufacturers: [brand]` into
|
|
32
|
+
* categoryProductSearchInput and uses `config.baseCategoryId`.
|
|
33
|
+
*/
|
|
34
|
+
brand?: string;
|
|
35
|
+
/** Number of columns in the grid. Accepts 2, 3, 4, 5, or 6. Defaults to 3. */
|
|
36
|
+
columns?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Show a skeleton loader.
|
|
39
|
+
* Useful when the parent controls loading state and passes `products` down.
|
|
40
|
+
* The grid automatically shows a skeleton during internal fetches regardless
|
|
41
|
+
* of this prop. Defaults to false.
|
|
42
|
+
*/
|
|
43
|
+
isLoading?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Controls portal visibility mode.
|
|
46
|
+
* 'open' — full e-commerce; AddToCart is visible in product cards.
|
|
47
|
+
* 'semi-closed' — catalog-only; AddToCart is hidden.
|
|
48
|
+
* Defaults to 'open'.
|
|
49
|
+
*/
|
|
50
|
+
portalMode?: string;
|
|
51
|
+
/** Authenticated user passed through to ProductCard / AddToCart. */
|
|
52
|
+
user?: Contact | Customer | null;
|
|
53
|
+
/** Active company ID from the company switcher. Overrides user's default company for price calculation. Triggers a re-fetch when changed. */
|
|
54
|
+
companyId?: number;
|
|
55
|
+
/**
|
|
56
|
+
* When true, tax-inclusive (gross) price is the leading price.
|
|
57
|
+
* Defaults to false.
|
|
58
|
+
*/
|
|
59
|
+
includeTax?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Enables stock validation inside AddToCart.
|
|
62
|
+
* Blocks add when requested quantity exceeds available stock.
|
|
63
|
+
* Defaults to false.
|
|
64
|
+
*/
|
|
65
|
+
stockValidation?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* When false, hides the AddToCart control in product cards.
|
|
68
|
+
* ClusterCards always show their "View cluster" navigation button.
|
|
69
|
+
* Defaults to true.
|
|
70
|
+
*/
|
|
71
|
+
allowAddToCart?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Called after each internal data fetch with the filterable attributes
|
|
74
|
+
* returned by the API (for driving a sibling FiltersSidebar).
|
|
75
|
+
*/
|
|
76
|
+
onFiltersChange?: (filters: AttributeFilter[]) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Active text filters to apply — built by the parent from FiltersSidebar
|
|
79
|
+
* `onFilterChange` callbacks. Each entry maps to a `textFilters` input
|
|
80
|
+
* row in the CategoryService query.
|
|
81
|
+
* When this prop changes the grid automatically re-fetches (page resets to 1).
|
|
82
|
+
*/
|
|
83
|
+
textFilters?: ProductTextFilterInput[];
|
|
84
|
+
/**
|
|
85
|
+
* Active price range lower bound from the FiltersSidebar `onPriceChange`.
|
|
86
|
+
* Triggers a re-fetch when changed.
|
|
87
|
+
*/
|
|
88
|
+
priceFilterMin?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Active price range upper bound from the FiltersSidebar `onPriceChange`.
|
|
91
|
+
* Triggers a re-fetch when changed.
|
|
92
|
+
*/
|
|
93
|
+
priceFilterMax?: number;
|
|
94
|
+
/**
|
|
95
|
+
* Called when sort state changes internally (for syncing a sibling toolbar).
|
|
96
|
+
*/
|
|
97
|
+
onSortChange?: (sort: any) => void;
|
|
98
|
+
/**
|
|
99
|
+
* Called after each internal data fetch with the min/max price of the
|
|
100
|
+
* current product set — use to populate a price range slider in the parent.
|
|
101
|
+
*/
|
|
102
|
+
onPriceBoundsChange?: (min: number, max: number) => void;
|
|
103
|
+
/**
|
|
104
|
+
* Called after each fetch with the total number of products found —
|
|
105
|
+
* use to display a result count in the parent toolbar.
|
|
106
|
+
*/
|
|
107
|
+
onItemsFoundChange?: (count: number) => void;
|
|
108
|
+
/**
|
|
109
|
+
* Called after each fetch with the number of items visible on the current page
|
|
110
|
+
* (after client-side language filtering).
|
|
111
|
+
*/
|
|
112
|
+
onPageItemCountChange?: (count: number) => void;
|
|
113
|
+
/**
|
|
114
|
+
* Called when the user clicks Previous / Next in the built-in pagination —
|
|
115
|
+
* use to keep the parent URL / page state in sync.
|
|
116
|
+
*/
|
|
117
|
+
onPageChange?: (page: number) => void;
|
|
118
|
+
/**
|
|
119
|
+
* Called after each successful internal data fetch with the full
|
|
120
|
+
* ProductsResponse object — use to drive an external GridPagination
|
|
121
|
+
* component by passing the result as its `products` prop.
|
|
122
|
+
*/
|
|
123
|
+
onProductsResponse?: (products: ProductsResponse) => void;
|
|
124
|
+
/**
|
|
125
|
+
* Called after each successful internal data fetch with the full
|
|
126
|
+
* Category object — use to populate sibling components like GridTitle,
|
|
127
|
+
* CategoryDescription, and CategoryShortDescription.
|
|
128
|
+
*/
|
|
129
|
+
onCategoryChange?: (category: Category) => void;
|
|
130
|
+
/**
|
|
131
|
+
* Called whenever the internal loading state changes.
|
|
132
|
+
* Use to disable sibling components (e.g. GridFilters) while a fetch is in flight.
|
|
133
|
+
*/
|
|
134
|
+
onLoadingChange?: (isLoading: boolean) => void;
|
|
135
|
+
/**
|
|
136
|
+
* Externally controlled current page.
|
|
137
|
+
* When provided, the grid uses this value instead of its internal page
|
|
138
|
+
* counter. Wire this to the `onPageChange` callback from a sibling
|
|
139
|
+
* GridPagination so the two components stay in sync.
|
|
140
|
+
* When changed the grid automatically re-fetches.
|
|
141
|
+
*/
|
|
142
|
+
page?: number;
|
|
143
|
+
/**
|
|
144
|
+
* Number of products per page. Defaults to 12.
|
|
145
|
+
* When changed the grid automatically re-fetches (page resets to 1).
|
|
146
|
+
*/
|
|
147
|
+
pageSize?: number;
|
|
148
|
+
/**
|
|
149
|
+
* Sort field to use (e.g. 'NAME', 'PRICE').
|
|
150
|
+
* When provided overrides internal sort state.
|
|
151
|
+
* When changed the grid automatically re-fetches (page resets to 1).
|
|
152
|
+
*/
|
|
153
|
+
sortField?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Sort direction: 'ASC' or 'DESC'.
|
|
156
|
+
* Only used when sortField is also provided.
|
|
157
|
+
* When changed the grid automatically re-fetches (page resets to 1).
|
|
158
|
+
*/
|
|
159
|
+
sortOrder?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Configuration object providing:
|
|
162
|
+
* imageSearchFiltersGrid, imageVariantFiltersMedium — passed to CategoryService
|
|
163
|
+
* baseCategoryId — used when querying by term or brand
|
|
164
|
+
* urls.getProductUrl / urls.getClusterUrl — for card URL generation
|
|
165
|
+
*/
|
|
166
|
+
configuration?: any;
|
|
167
|
+
/** ID of an existing cart to add items into. */
|
|
168
|
+
cartId?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Auto-create a cart when none is available.
|
|
171
|
+
* Always pair with `onCartCreated` to persist the new cart ID.
|
|
172
|
+
*/
|
|
173
|
+
createCart?: boolean;
|
|
174
|
+
/** Called after AddToCart creates a new cart internally. */
|
|
175
|
+
onCartCreated?: (cart: Cart) => void;
|
|
176
|
+
/** Called after every successful add-to-cart operation. */
|
|
177
|
+
afterAddToCart?: (cart: Cart, item?: CartMainItem) => void;
|
|
178
|
+
/**
|
|
179
|
+
* When true, AddToCart shows a success modal instead of a toast.
|
|
180
|
+
* Defaults to false.
|
|
181
|
+
*/
|
|
182
|
+
showModal?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Render − / + stepper buttons in AddToCart.
|
|
185
|
+
* Defaults to true.
|
|
186
|
+
*/
|
|
187
|
+
allowIncrDecr?: boolean;
|
|
188
|
+
/** Called when "Proceed to checkout" is clicked in the AddToCart modal. */
|
|
189
|
+
onProceedToCheckout?: () => void;
|
|
190
|
+
/** Called when "Request a Quote" is clicked in the AddToCart modal. */
|
|
191
|
+
onRequestQuoteClick?: (cart: Cart) => void;
|
|
192
|
+
/**
|
|
193
|
+
* Label overrides forwarded directly to the embedded AddToCart component.
|
|
194
|
+
* Keys: add, adding, addedToCart, outOfStock, noCartId, errorAdding,
|
|
195
|
+
* modalTitle, quantity, continueShopping, proceedToCheckout
|
|
196
|
+
*/
|
|
197
|
+
addToCartLabels?: Record<string, string>;
|
|
198
|
+
/** Translated labels forwarded to embedded `<ProductCard>` instances.
|
|
199
|
+
* See `ProductCardProps.labels` for slugs. */
|
|
200
|
+
productCardLabels?: Record<string, string>;
|
|
201
|
+
/** Translated labels forwarded to embedded `<ClusterCard>` instances.
|
|
202
|
+
* See `ClusterCardProps.labels` for slugs. */
|
|
203
|
+
clusterCardLabels?: Record<string, string>;
|
|
204
|
+
/**
|
|
205
|
+
* Show the stock / availability widget on each product card.
|
|
206
|
+
* Forwarded directly to `ProductCard.showStock`.
|
|
207
|
+
* Defaults to false.
|
|
208
|
+
*/
|
|
209
|
+
showStock?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Show only the availability indicator inside the stock widget.
|
|
212
|
+
* Forwarded to `ProductCard.showAvailability`.
|
|
213
|
+
* Defaults to true.
|
|
214
|
+
*/
|
|
215
|
+
showAvailability?: boolean;
|
|
216
|
+
/**
|
|
217
|
+
* Show the price below the product name.
|
|
218
|
+
* Defaults to true.
|
|
219
|
+
*/
|
|
220
|
+
showPrice?: boolean;
|
|
221
|
+
/**
|
|
222
|
+
* Label overrides forwarded to the embedded ItemStock component inside each card.
|
|
223
|
+
* Keys: inStock, outOfStock, lowStock, available, notAvailable, pieces
|
|
224
|
+
*/
|
|
225
|
+
stockLabels?: Record<string, string>;
|
|
226
|
+
/** Translated labels forwarded to the embedded `<ProductPrice>` display
|
|
227
|
+
* inside each `<ProductCard>`. See `ProductPriceProps.labels` for slugs. */
|
|
228
|
+
priceLabels?: Record<string, string>;
|
|
229
|
+
/** Show a heart-icon favourite toggle on each card. */
|
|
230
|
+
enableAddFavorite?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Called when a favourite is toggled on any card.
|
|
233
|
+
* Receives the full Product or Cluster object and the new favourite state.
|
|
234
|
+
*/
|
|
235
|
+
onToggleFavorite?: (item: Product | Cluster, isFavorite: boolean) => void;
|
|
236
|
+
/**
|
|
237
|
+
* Called when a cluster card name, image, or "View cluster" button is
|
|
238
|
+
* clicked — use for SPA-style routing instead of full-page navigation.
|
|
239
|
+
*/
|
|
240
|
+
onClusterClick?: (cluster: Cluster) => void;
|
|
241
|
+
/**
|
|
242
|
+
* Called when a product card name or image is clicked — use for SPA
|
|
243
|
+
* routing instead of full-page navigation.
|
|
244
|
+
*/
|
|
245
|
+
onProductClick?: (product: Product) => void;
|
|
246
|
+
/** Extra CSS class applied to the root element. */
|
|
247
|
+
className?: string;
|
|
248
|
+
/** Translated labels keyed by the slugs used inside the component (see
|
|
249
|
+
* `getLabel` calls). Missing keys fall back to the English defaults. */
|
|
250
|
+
labels?: Record<string, string>;
|
|
251
|
+
priceComponent?: Component;
|
|
252
|
+
stockComponent?: Component;
|
|
253
|
+
addToCartComponent?: Component;
|
|
254
|
+
imageComponent?: Component;
|
|
255
|
+
badgesComponent?: Component;
|
|
256
|
+
favoriteComponent?: Component;
|
|
257
|
+
productCardComponent?: Component;
|
|
258
|
+
clusterCardComponent?: Component;
|
|
259
|
+
}
|
|
260
|
+
declare function __VLS_template(): {
|
|
261
|
+
attrs: Partial<{}>;
|
|
262
|
+
slots: {
|
|
263
|
+
beforeItem?(_: {
|
|
264
|
+
item: Product | Cluster;
|
|
265
|
+
index: number;
|
|
266
|
+
}): any;
|
|
267
|
+
afterItem?(_: {
|
|
268
|
+
item: Product | Cluster;
|
|
269
|
+
index: number;
|
|
270
|
+
}): any;
|
|
271
|
+
};
|
|
272
|
+
refs: {};
|
|
273
|
+
rootEl: HTMLDivElement;
|
|
274
|
+
};
|
|
275
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
276
|
+
declare const __VLS_component: import('vue').DefineComponent<ProductGridProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ProductGridProps> & Readonly<{}>, {
|
|
277
|
+
showPrice: boolean;
|
|
278
|
+
showStock: boolean;
|
|
279
|
+
showAvailability: boolean;
|
|
280
|
+
allowAddToCart: boolean;
|
|
281
|
+
allowIncrDecr: boolean;
|
|
282
|
+
isLoading: boolean;
|
|
283
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
284
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
285
|
+
export default _default;
|
|
286
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
287
|
+
new (): {
|
|
288
|
+
$slots: S;
|
|
289
|
+
};
|
|
290
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { GraphQLClient, Product, Contact, Customer } from '@propeller-commerce/propeller-sdk-v2';
|
|
3
|
+
export interface ProductInfoProps {
|
|
4
|
+
/** The authenticated user (Contact or Customer) */
|
|
5
|
+
user: Contact | Customer | null;
|
|
6
|
+
/** Active company ID from the company switcher.
|
|
7
|
+
* Overrides default company for price calculation.
|
|
8
|
+
* Triggers a re-fetch when changed. */
|
|
9
|
+
companyId?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Pre-fetched product object to display.
|
|
12
|
+
* When provided the component skips internal fetching.
|
|
13
|
+
*/
|
|
14
|
+
product?: Product;
|
|
15
|
+
/**
|
|
16
|
+
* Product ID to fetch data for when no `product` prop is provided.
|
|
17
|
+
* Requires `graphqlClient` to be set.
|
|
18
|
+
*/
|
|
19
|
+
productId?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Initialised Propeller SDK GraphQL client.
|
|
22
|
+
* Required when `productId` is provided for internal data fetching.
|
|
23
|
+
*/
|
|
24
|
+
graphqlClient?: GraphQLClient;
|
|
25
|
+
/**
|
|
26
|
+
* Image search filter passed to ProductService.getProduct().
|
|
27
|
+
* Controls how many image items are returned.
|
|
28
|
+
* Example: { page: 1, offset: 20 }
|
|
29
|
+
*/
|
|
30
|
+
imageSearchFilters?: any;
|
|
31
|
+
/**
|
|
32
|
+
* Image variant transformation filter passed to ProductService.getProduct().
|
|
33
|
+
* Controls image size/format variants returned with the product.
|
|
34
|
+
* Example: imageVariantFiltersLarge from @/data/defaults
|
|
35
|
+
* Defaults to { transformations: [] } when omitted.
|
|
36
|
+
*/
|
|
37
|
+
imageVariantFilters?: any;
|
|
38
|
+
/**
|
|
39
|
+
* Tax zone to use for price calculation.
|
|
40
|
+
*/
|
|
41
|
+
taxZone?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Called once the product data is loaded — either immediately (when
|
|
44
|
+
* `product` prop is supplied) or after the internal fetch completes.
|
|
45
|
+
* Use this to hydrate sibling components (gallery, price, descriptions, etc.).
|
|
46
|
+
*/
|
|
47
|
+
onProductLoaded?: (product: Product) => void;
|
|
48
|
+
/** Show the product name. Defaults to true. */
|
|
49
|
+
showTitle?: boolean;
|
|
50
|
+
/** Show the product SKU. Defaults to true. */
|
|
51
|
+
showSku?: boolean;
|
|
52
|
+
/** Language code used to resolve localised names. Defaults to 'NL'. */
|
|
53
|
+
language?: string;
|
|
54
|
+
/** Extra CSS class applied to the root element. */
|
|
55
|
+
className?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Config object providing imageSearchFiltersGrid and imageVariantFiltersSmall.
|
|
58
|
+
*/
|
|
59
|
+
configuration?: any;
|
|
60
|
+
/**
|
|
61
|
+
* Attribute codes/names to look up and display as badge overlays on the product image.
|
|
62
|
+
* Each code is resolved against `product.attributes.items[].attributeDescription.code`
|
|
63
|
+
* (or `.name`). Attributes with no matching value are silently omitted.
|
|
64
|
+
* Example: ['new', 'sale']
|
|
65
|
+
*/
|
|
66
|
+
imageLabels?: string[];
|
|
67
|
+
/**
|
|
68
|
+
* Attribute codes/names to look up and display as extra text rows below the product name.
|
|
69
|
+
* Resolved the same way as `imageLabels`.
|
|
70
|
+
* Example: ['brand', 'color']
|
|
71
|
+
*/
|
|
72
|
+
textLabels?: string[];
|
|
73
|
+
showImage?: boolean;
|
|
74
|
+
showBadges?: boolean;
|
|
75
|
+
showFavorite?: boolean;
|
|
76
|
+
showPrice?: boolean;
|
|
77
|
+
showStock?: boolean;
|
|
78
|
+
showAddToCart?: boolean;
|
|
79
|
+
showBundles?: boolean;
|
|
80
|
+
showBulkPrices?: boolean;
|
|
81
|
+
showSurcharges?: boolean;
|
|
82
|
+
imageComponent?: Component;
|
|
83
|
+
badgesComponent?: Component;
|
|
84
|
+
favoriteComponent?: Component;
|
|
85
|
+
priceComponent?: Component;
|
|
86
|
+
stockComponent?: Component;
|
|
87
|
+
addToCartComponent?: Component;
|
|
88
|
+
bundlesComponent?: Component;
|
|
89
|
+
bulkPricesComponent?: Component;
|
|
90
|
+
surchargesComponent?: Component;
|
|
91
|
+
includeTax?: boolean;
|
|
92
|
+
currency?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Override any UI string.
|
|
95
|
+
* Forwarded down to nested default components in the new shell.
|
|
96
|
+
*/
|
|
97
|
+
labels?: Record<string, string>;
|
|
98
|
+
}
|
|
99
|
+
declare function __VLS_template(): {
|
|
100
|
+
attrs: Partial<{}>;
|
|
101
|
+
slots: {
|
|
102
|
+
beforeContent?(_: {
|
|
103
|
+
product: Product | null;
|
|
104
|
+
}): any;
|
|
105
|
+
image?(_: {
|
|
106
|
+
product: Product;
|
|
107
|
+
language: string | undefined;
|
|
108
|
+
imageSearchFilters: any;
|
|
109
|
+
imageVariantFilters: any;
|
|
110
|
+
}): any;
|
|
111
|
+
badges?(_: {
|
|
112
|
+
product: Product;
|
|
113
|
+
labels: Record<string, string> | undefined;
|
|
114
|
+
}): any;
|
|
115
|
+
title?(_: {
|
|
116
|
+
product: Product | null;
|
|
117
|
+
name: string;
|
|
118
|
+
}): any;
|
|
119
|
+
sku?(_: {
|
|
120
|
+
product: Product | null;
|
|
121
|
+
sku: string;
|
|
122
|
+
}): any;
|
|
123
|
+
favorite?(_: {
|
|
124
|
+
product: Product;
|
|
125
|
+
user: Contact | Customer | null;
|
|
126
|
+
}): any;
|
|
127
|
+
price?(_: {
|
|
128
|
+
product: Product;
|
|
129
|
+
price: import('@propeller-commerce/propeller-sdk-v2').ProductPrice;
|
|
130
|
+
includeTax: boolean | undefined;
|
|
131
|
+
currency: string | undefined;
|
|
132
|
+
labels: Record<string, string> | undefined;
|
|
133
|
+
}): any;
|
|
134
|
+
stock?(_: {
|
|
135
|
+
product: Product;
|
|
136
|
+
inventory: import('@propeller-commerce/propeller-sdk-v2').ProductInventory;
|
|
137
|
+
showStock: boolean;
|
|
138
|
+
showAvailability: boolean;
|
|
139
|
+
labels: Record<string, string> | undefined;
|
|
140
|
+
}): any;
|
|
141
|
+
addToCart?(_: {
|
|
142
|
+
product: Product;
|
|
143
|
+
cartId: undefined;
|
|
144
|
+
labels: Record<string, string> | undefined;
|
|
145
|
+
}): any;
|
|
146
|
+
bundles?(_: {
|
|
147
|
+
product: Product;
|
|
148
|
+
labels: Record<string, string> | undefined;
|
|
149
|
+
}): any;
|
|
150
|
+
bulkPrices?(_: {
|
|
151
|
+
product: Product;
|
|
152
|
+
bulkPrices: import('@propeller-commerce/propeller-sdk-v2').ProductPrice[];
|
|
153
|
+
includeTax: boolean | undefined;
|
|
154
|
+
labels: Record<string, string> | undefined;
|
|
155
|
+
}): any;
|
|
156
|
+
surcharges?(_: {
|
|
157
|
+
product: Product;
|
|
158
|
+
includeTax: boolean | undefined;
|
|
159
|
+
labels: Record<string, string> | undefined;
|
|
160
|
+
}): any;
|
|
161
|
+
afterContent?(_: {
|
|
162
|
+
product: Product | null;
|
|
163
|
+
}): any;
|
|
164
|
+
};
|
|
165
|
+
refs: {};
|
|
166
|
+
rootEl: any;
|
|
167
|
+
};
|
|
168
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
169
|
+
declare const __VLS_component: import('vue').DefineComponent<ProductInfoProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ProductInfoProps> & Readonly<{}>, {
|
|
170
|
+
showSku: boolean;
|
|
171
|
+
showTitle: boolean;
|
|
172
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
173
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
174
|
+
export default _default;
|
|
175
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
176
|
+
new (): {
|
|
177
|
+
$slots: S;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Product } from '@propeller-commerce/propeller-sdk-v2';
|
|
2
|
+
import { JsonLdContext } from '@propeller-commerce/propeller-v2-core-ui';
|
|
3
|
+
export interface ProductJsonLdProps {
|
|
4
|
+
/** The product to describe. */
|
|
5
|
+
product: Product;
|
|
6
|
+
/** Per-request context: siteUrl, language, currency, portalMode, user, URL builders. */
|
|
7
|
+
context: JsonLdContext;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: import('vue').DefineComponent<ProductJsonLdProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ProductJsonLdProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ClusterOption, Contact, Customer, Product, ProductPrice } from '@propeller-commerce/propeller-sdk-v2';
|
|
2
|
+
export interface ProductPriceProps {
|
|
3
|
+
/**
|
|
4
|
+
* ProductPrice object from the product.
|
|
5
|
+
* Obtain from `product.price`.
|
|
6
|
+
*/
|
|
7
|
+
price: ProductPrice;
|
|
8
|
+
/** Currency symbol to display. Defaults to '€'. */
|
|
9
|
+
currency?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Controls portal visibility mode.
|
|
12
|
+
* 'open' — full e-commerce; price is always visible.
|
|
13
|
+
* 'semi-closed' — catalog-only; price is hidden for anonymous users.
|
|
14
|
+
* Defaults to 'open'.
|
|
15
|
+
*/
|
|
16
|
+
portalMode?: string;
|
|
17
|
+
/** Authenticated user — used for semi-closed visibility. */
|
|
18
|
+
user?: Contact | Customer | null;
|
|
19
|
+
/**
|
|
20
|
+
* When true, net price (incl. tax) is the leading price.
|
|
21
|
+
* When false (default), gross price (excl. tax) is the leading price.
|
|
22
|
+
* Note: in the Propeller SDK `price.gross` = excl. VAT, `price.net` = incl. VAT.
|
|
23
|
+
*/
|
|
24
|
+
includeTax?: boolean;
|
|
25
|
+
/** Tax zone code. Defaults to 'NL'. */
|
|
26
|
+
taxZone?: string;
|
|
27
|
+
/** Cluster options (cluster.options). Required option default prices are added even without an active selection. */
|
|
28
|
+
options?: ClusterOption[];
|
|
29
|
+
/** Active option product selections — pass Object.values(selectedOptionProducts). Price updates on every change. */
|
|
30
|
+
selectedOptionProducts?: Product[];
|
|
31
|
+
/**
|
|
32
|
+
* Override any UI string.
|
|
33
|
+
* Available keys: inclTax, exclTax, loginToSeePrices
|
|
34
|
+
*/
|
|
35
|
+
labels?: Record<string, string>;
|
|
36
|
+
/** Tailwind text-size class for the leading price. Defaults to 'text-3xl'. */
|
|
37
|
+
priceSize?: string;
|
|
38
|
+
/** Extra CSS class applied to the root element. */
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
declare const _default: import('vue').DefineComponent<ProductPriceProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ProductPriceProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
42
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Product, Cluster } from '@propeller-commerce/propeller-sdk-v2';
|
|
2
|
+
export interface ProductShortDescriptionProps {
|
|
3
|
+
/**
|
|
4
|
+
* Product or Cluster object.
|
|
5
|
+
* The component reads `product.shortDescriptions` (an array of LocalizedString)
|
|
6
|
+
* and renders the matching language entry as HTML.
|
|
7
|
+
*/
|
|
8
|
+
product: Product | Cluster;
|
|
9
|
+
/**
|
|
10
|
+
* Language code used to resolve the correct localised short description.
|
|
11
|
+
* Defaults to 'NL'.
|
|
12
|
+
*/
|
|
13
|
+
language?: string;
|
|
14
|
+
/** Extra CSS class applied to the root element. */
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const _default: import('vue').DefineComponent<ProductShortDescriptionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ProductShortDescriptionProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
export default _default;
|