@orderlyshop/web-components 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/AGENTS.md +110 -0
- package/README.md +685 -0
- package/bin/orderly-build-category-pages.mjs +160 -0
- package/bin/orderly-generate-category-pages.mjs +308 -0
- package/bin/orderly-hydrate-static-pages.mjs +595 -0
- package/bin/orderly-init-navigation.mjs +327 -0
- package/bin/orderly-init-shop.mjs +876 -0
- package/bin/orderly-init-taxonomy.mjs +2 -0
- package/bin/orderly-publish-site.mjs +342 -0
- package/custom-elements.json +495 -0
- package/dist/browser/orderly-web-components.define.global.js +3085 -0
- package/dist/browser/orderly-web-components.define.global.js.map +1 -0
- package/dist/browser/orderly-web-components.global.js +3085 -0
- package/dist/browser/orderly-web-components.global.js.map +1 -0
- package/dist/default-shop-DWdB_MRd.d.ts +220 -0
- package/dist/default-shop.d.ts +6 -0
- package/dist/default-shop.js +762 -0
- package/dist/default-shop.js.map +1 -0
- package/dist/define-IAQk8OmQ.d.ts +9 -0
- package/dist/define.d.ts +2 -0
- package/dist/define.js +10266 -0
- package/dist/define.js.map +1 -0
- package/dist/index.d.ts +683 -0
- package/dist/index.js +10589 -0
- package/dist/index.js.map +1 -0
- package/dist/navigation.d.ts +51 -0
- package/dist/navigation.js +818 -0
- package/dist/navigation.js.map +1 -0
- package/dist/query.d.ts +31 -0
- package/dist/query.js +115 -0
- package/dist/query.js.map +1 -0
- package/dist/registry-CPDecU3g.d.ts +6 -0
- package/dist/shop-BnT1C6kG.d.ts +173 -0
- package/dist/shop-query.d.ts +8 -0
- package/dist/shop-query.js +100 -0
- package/dist/shop-query.js.map +1 -0
- package/dist/shop.d.ts +8 -0
- package/dist/shop.js +10359 -0
- package/dist/shop.js.map +1 -0
- package/dist/stores.d.ts +46 -0
- package/dist/stores.js +145 -0
- package/dist/stores.js.map +1 -0
- package/dist/taxonomy.d.ts +35 -0
- package/dist/taxonomy.js +247 -0
- package/dist/taxonomy.js.map +1 -0
- package/dist/types-CCQDd6Nd.d.ts +95 -0
- package/docs/components/README.md +610 -0
- package/docs/components/product-grid.md +176 -0
- package/docs/components/product-rail.md +174 -0
- package/examples/shop/README.md +71 -0
- package/examples/shop/package.json +28 -0
- package/examples/shop/src/category.html +20 -0
- package/examples/shop/src/checkout.html +21 -0
- package/examples/shop/src/forretningsbetingelser.html +80 -0
- package/examples/shop/src/includes/body-end.html +1 -0
- package/examples/shop/src/includes/body-start.html +2 -0
- package/examples/shop/src/includes/head.html +32 -0
- package/examples/shop/src/index.html +25 -0
- package/examples/shop/src/navigation.ts +154 -0
- package/examples/shop/src/product.html +24 -0
- package/examples/shop/src/templates/shop-footer.html +76 -0
- package/examples/shop/tsconfig.json +32 -0
- package/examples/shop/vite.config.mjs +184 -0
- package/html-custom-data.json +262 -0
- package/package.json +118 -0
- package/server/README.md +111 -0
- package/server/apache/.htaccess +18 -0
- package/server/nginx/orderly-products.conf +24 -0
- package/server/node/product-snapshot-server.mjs +133 -0
- package/server/php/orderly-product.php +204 -0
|
@@ -0,0 +1,610 @@
|
|
|
1
|
+
# Component API Reference
|
|
2
|
+
|
|
3
|
+
This reference is optimized for developers and agents using `@orderlyshop/web-components` in vanilla HTML, JavaScript, and TypeScript projects.
|
|
4
|
+
|
|
5
|
+
Machine-readable metadata is also shipped:
|
|
6
|
+
|
|
7
|
+
- `custom-elements.json` for custom element tooling and agents.
|
|
8
|
+
- `html-custom-data.json` for VS Code HTML autocomplete.
|
|
9
|
+
|
|
10
|
+
## Common Conventions
|
|
11
|
+
|
|
12
|
+
- Core contracts such as `SearchQuery`, `SearchObject`, `DraftOrder`, and `OrderlyClient` are assigned as JavaScript properties.
|
|
13
|
+
- Primitive configuration is exposed as attributes.
|
|
14
|
+
- Default rendering uses light DOM and stable `orderly-*` classes.
|
|
15
|
+
- `defineOrderlyWebComponents()` installs package-owned baseline CSS, so default components have usable spacing, layout, responsive behavior, and product presentation without a shop stylesheet.
|
|
16
|
+
- Override the default look with normal CSS targeting `orderly-*` classes or variables such as `--orderly-color-accent`, `--orderly-color-page`, and `--orderly-content-max-width`.
|
|
17
|
+
- Templates use `data-orderly-template`, `data-orderly-bind`, `data-orderly-slot`, and `data-orderly-action`.
|
|
18
|
+
- Shared document-level templates can use `data-orderly-for="product-tile"` or another component name so one shop template registry can serve every page.
|
|
19
|
+
- Responsive templates can use `data-orderly-viewport="mobile"`, `data-orderly-viewport="desktop"`, or `data-orderly-media`.
|
|
20
|
+
- `base-url` configures the backend when no `client` property is supplied.
|
|
21
|
+
- Built-in labels and messages are Danish by default. Set `configureShop({ uiLanguage: "EN" })` for English defaults; explicit attributes, typed properties, and templates still override those strings.
|
|
22
|
+
|
|
23
|
+
## Declarative Query Format
|
|
24
|
+
|
|
25
|
+
`orderly-product-grid`, `orderly-product-rail`, and `orderly-collection-page` support simple declarative search query markup.
|
|
26
|
+
|
|
27
|
+
Attributes:
|
|
28
|
+
|
|
29
|
+
- `keywords`: maps to `SearchQuery.Query`.
|
|
30
|
+
- `tags`: comma-separated values mapped to `SearchQuery.Tags`.
|
|
31
|
+
- `hidden-query`: maps to `SearchQuery.HiddenQuery`.
|
|
32
|
+
- `order-by`: comma-separated values mapped to `SearchQuery.OrderBy`.
|
|
33
|
+
- `store-id`: maps to `SearchQuery.StoreId`.
|
|
34
|
+
- `featured`: boolean mapped to `SearchQuery.Featured`.
|
|
35
|
+
|
|
36
|
+
Example:
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<orderly-product-rail
|
|
40
|
+
title="Børnetøj"
|
|
41
|
+
keywords="H&M"
|
|
42
|
+
tags="børnetøj,bluser"
|
|
43
|
+
order-by="CreatedTime desc">
|
|
44
|
+
</orderly-product-rail>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Equivalent child markup:
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<orderly-product-rail title="Børnetøj">
|
|
51
|
+
<query>
|
|
52
|
+
<tags>børnetøj,bluser</tags>
|
|
53
|
+
<keywords>H&M</keywords>
|
|
54
|
+
<order-by>CreatedTime desc</order-by>
|
|
55
|
+
</query>
|
|
56
|
+
</orderly-product-rail>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
For the full Core query contract, assign the typed `query` property from JavaScript.
|
|
60
|
+
Vanilla browser scripts that use the standalone bundle can create typed queries with `OrderlyWebComponents.createSearchQuery({ query, tags, orderBy })`; module-based shops can import the same helper from `@orderlyshop/web-components/query`.
|
|
61
|
+
|
|
62
|
+
## Global Template Registry
|
|
63
|
+
|
|
64
|
+
Local templates placed inside an element take precedence. If no local template matches, components look for global templates in the document and in the JavaScript registry.
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<template data-orderly-template="product" data-orderly-for="product-tile">
|
|
68
|
+
<article class="product-card">
|
|
69
|
+
<h3 data-orderly-bind="title"></h3>
|
|
70
|
+
<orderly-stored-image data-orderly-bind="image" fit="contain"></orderly-stored-image>
|
|
71
|
+
<button type="button" data-orderly-action="add-to-basket">
|
|
72
|
+
<span data-orderly-bind="basket-action-icon"></span>
|
|
73
|
+
</button>
|
|
74
|
+
</article>
|
|
75
|
+
</template>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Use `data-orderly-for` with a full custom element name, a prefix-independent component name such as `product-tile`, or `*`. Global templates support `data-orderly-viewport` and `data-orderly-media`.
|
|
79
|
+
|
|
80
|
+
## Components
|
|
81
|
+
|
|
82
|
+
### `orderly-page-layout`
|
|
83
|
+
|
|
84
|
+
Reusable page structure with slots for `utility`, `header`, `header-actions`, `primary-nav`, `left`, `right`, `content-before`, `content`, `content-after`, `footer`, and `overlay`.
|
|
85
|
+
|
|
86
|
+
Attributes:
|
|
87
|
+
|
|
88
|
+
- `logo-src`
|
|
89
|
+
- `logo-alt`
|
|
90
|
+
- `logo-href`
|
|
91
|
+
|
|
92
|
+
Templates:
|
|
93
|
+
|
|
94
|
+
- `layout`
|
|
95
|
+
|
|
96
|
+
### `orderly-category-page`
|
|
97
|
+
|
|
98
|
+
Default shop category page that composes layout, navigation, search, collection, product grid, basket, product detail, and footer.
|
|
99
|
+
|
|
100
|
+
Attributes:
|
|
101
|
+
|
|
102
|
+
- `base-url`
|
|
103
|
+
- `slug`
|
|
104
|
+
- `brand-label`
|
|
105
|
+
- `product-href`
|
|
106
|
+
- `checkout-href`
|
|
107
|
+
- `checkout-label`
|
|
108
|
+
- `search-placeholder`
|
|
109
|
+
- `empty-label`
|
|
110
|
+
|
|
111
|
+
Properties:
|
|
112
|
+
|
|
113
|
+
- `client`
|
|
114
|
+
- `defaultQuery`
|
|
115
|
+
- `query` through child grid/collection composition
|
|
116
|
+
- `category`
|
|
117
|
+
- `navigationItems`
|
|
118
|
+
- `sortOptions`
|
|
119
|
+
- `basketController`
|
|
120
|
+
|
|
121
|
+
Templates:
|
|
122
|
+
|
|
123
|
+
- `layout`
|
|
124
|
+
- `empty-category`
|
|
125
|
+
|
|
126
|
+
`orderly-category-page` can resolve its category from generated path URLs by default, from `slug`, or from a static hash route when a shop opts into hash routing:
|
|
127
|
+
|
|
128
|
+
```html
|
|
129
|
+
<a href="/categories/sko/">Sko</a>
|
|
130
|
+
<orderly-category-page></orderly-category-page>
|
|
131
|
+
|
|
132
|
+
<orderly-category-page slug="sko"></orderly-category-page>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
`navigationDefinitions` must define an explicit unique `slug` on every item. If the configured navigation is invalid, the component renders a visible category configuration error instead of silently falling back to another category.
|
|
136
|
+
|
|
137
|
+
When a product is opened in the default product detail popup, the popup includes an icon link to the full product page. It uses `product-href`, defaulting to `/product.html`, and appends the Core `SearchObject.ShareURL.URL` as `#url=...`. For `https://orderly.shop/...` product URLs, the hash value is compacted to the path before encoding.
|
|
138
|
+
|
|
139
|
+
### `orderly-home-page`
|
|
140
|
+
|
|
141
|
+
Default storefront homepage that renders one horizontal `orderly-product-rail` for every configured top-level category. It also composes page layout, side navigation, basket icon, basket drawer, product detail dialog, and footer.
|
|
142
|
+
|
|
143
|
+
Attributes:
|
|
144
|
+
|
|
145
|
+
- `base-url`
|
|
146
|
+
- `brand-label`
|
|
147
|
+
- `eyebrow`
|
|
148
|
+
- `title`
|
|
149
|
+
- `rail-cta-label`
|
|
150
|
+
- `empty-label`
|
|
151
|
+
- `product-href`
|
|
152
|
+
- `checkout-href`
|
|
153
|
+
- `checkout-label`
|
|
154
|
+
|
|
155
|
+
Properties:
|
|
156
|
+
|
|
157
|
+
- `client`
|
|
158
|
+
- `defaultQuery`
|
|
159
|
+
- `navigationItems`
|
|
160
|
+
- `sortOptions`
|
|
161
|
+
- `basketController`
|
|
162
|
+
- `basketLabels`
|
|
163
|
+
|
|
164
|
+
Slots:
|
|
165
|
+
|
|
166
|
+
- `utility`
|
|
167
|
+
- `header-actions`
|
|
168
|
+
- `content-before`
|
|
169
|
+
- `content-after`
|
|
170
|
+
- `footer`
|
|
171
|
+
- `overlay`
|
|
172
|
+
|
|
173
|
+
Templates:
|
|
174
|
+
|
|
175
|
+
- `layout`
|
|
176
|
+
- `rail`
|
|
177
|
+
- `grid`
|
|
178
|
+
- `product`
|
|
179
|
+
- `loading`
|
|
180
|
+
- `empty`
|
|
181
|
+
|
|
182
|
+
### `orderly-checkout-page`
|
|
183
|
+
|
|
184
|
+
Default checkout page that composes page layout, side navigation, checkout form, basket order summary, footer, and shared basket state.
|
|
185
|
+
|
|
186
|
+
Attributes:
|
|
187
|
+
|
|
188
|
+
- `base-url`
|
|
189
|
+
- `brand-label`
|
|
190
|
+
- `title`
|
|
191
|
+
- `description`
|
|
192
|
+
- `order-title`
|
|
193
|
+
- `terms-href`
|
|
194
|
+
|
|
195
|
+
Properties:
|
|
196
|
+
|
|
197
|
+
- `client`
|
|
198
|
+
- `basketController`
|
|
199
|
+
- `navigationItems`
|
|
200
|
+
- `basketLabels`
|
|
201
|
+
- `checkoutLabels`
|
|
202
|
+
|
|
203
|
+
Slots:
|
|
204
|
+
|
|
205
|
+
- `utility`
|
|
206
|
+
- `header-actions`
|
|
207
|
+
- `content-before`
|
|
208
|
+
- `content-after`
|
|
209
|
+
- `footer`
|
|
210
|
+
- `overlay`
|
|
211
|
+
|
|
212
|
+
Templates:
|
|
213
|
+
|
|
214
|
+
- `layout`
|
|
215
|
+
- `checkout`
|
|
216
|
+
- `basket`
|
|
217
|
+
- `line`
|
|
218
|
+
- `empty`
|
|
219
|
+
|
|
220
|
+
### `orderly-product-detail-page`
|
|
221
|
+
|
|
222
|
+
Default product detail page that composes page layout, navigation, product detail, basket drawer, and footer. It resolves the `SearchObject` itself by calling `SearchService.Search` with `SearchQuery.ShareUrl`.
|
|
223
|
+
|
|
224
|
+
```html
|
|
225
|
+
<orderly-product-detail-page share-url="https://shop.example/products/my-product"></orderly-product-detail-page>
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
For static product routes, omit `share-url` and pass the encoded product share URL in the page hash:
|
|
229
|
+
|
|
230
|
+
```html
|
|
231
|
+
<a href="/product.html#url=https%3A%2F%2Fshop.example%2Fproducts%2Fmy-product">View product</a>
|
|
232
|
+
<orderly-product-detail-page></orderly-product-detail-page>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Orderly product URLs can use the compact form. The component restores `https://orderly.shop/` before searching:
|
|
236
|
+
|
|
237
|
+
```html
|
|
238
|
+
<a href="/product.html#url=mickey-mouse-billedramme-fra-danish-design-str-40x50-cm-p7yxrjsfbq.html">Se produkt</a>
|
|
239
|
+
<orderly-product-detail-page></orderly-product-detail-page>
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Attributes:
|
|
243
|
+
|
|
244
|
+
- `base-url`
|
|
245
|
+
- `share-url`
|
|
246
|
+
- `brand-label`
|
|
247
|
+
- `checkout-href`
|
|
248
|
+
- `checkout-label`
|
|
249
|
+
- `add-label`
|
|
250
|
+
- `loading-label`
|
|
251
|
+
- `not-found-label`
|
|
252
|
+
- `error-label`
|
|
253
|
+
|
|
254
|
+
Properties:
|
|
255
|
+
|
|
256
|
+
- `client`
|
|
257
|
+
- `shareUrl`
|
|
258
|
+
- `product`
|
|
259
|
+
- `defaultQuery`
|
|
260
|
+
- `navigationItems`
|
|
261
|
+
- `basketController`
|
|
262
|
+
- `basketLabels`
|
|
263
|
+
|
|
264
|
+
Events:
|
|
265
|
+
|
|
266
|
+
- `orderly-product-loaded`
|
|
267
|
+
- `orderly-product-not-found`
|
|
268
|
+
- `orderly-error`
|
|
269
|
+
|
|
270
|
+
Templates:
|
|
271
|
+
|
|
272
|
+
- `layout`
|
|
273
|
+
- `product`
|
|
274
|
+
- `thumbnail`
|
|
275
|
+
- `basket`
|
|
276
|
+
- `line`
|
|
277
|
+
- `empty`
|
|
278
|
+
|
|
279
|
+
### `orderly-product-grid`
|
|
280
|
+
|
|
281
|
+
Search-backed product listing with sort controls, continuation-token paging, loading states, and template overrides.
|
|
282
|
+
|
|
283
|
+
Detailed reference: [product-grid.md](./product-grid.md)
|
|
284
|
+
|
|
285
|
+
### `orderly-product-rail`
|
|
286
|
+
|
|
287
|
+
Horizontal product rail for homepages and editorial rows. It composes `orderly-product-grid`.
|
|
288
|
+
|
|
289
|
+
Detailed reference: [product-rail.md](./product-rail.md)
|
|
290
|
+
|
|
291
|
+
### `orderly-collection-page`
|
|
292
|
+
|
|
293
|
+
Collection hero plus product grid.
|
|
294
|
+
|
|
295
|
+
Attributes:
|
|
296
|
+
|
|
297
|
+
- `base-url`
|
|
298
|
+
- `title`
|
|
299
|
+
- `description`
|
|
300
|
+
- `hero-image`
|
|
301
|
+
- `cta-label`
|
|
302
|
+
- `cta-href`
|
|
303
|
+
- Declarative query attributes: `keywords`, `tags`, `hidden-query`, `order-by`, `store-id`, `featured`
|
|
304
|
+
|
|
305
|
+
Properties:
|
|
306
|
+
|
|
307
|
+
- `client`
|
|
308
|
+
- `query`
|
|
309
|
+
- `defaultQuery`
|
|
310
|
+
- `basketController`
|
|
311
|
+
- `sortOptions`
|
|
312
|
+
|
|
313
|
+
Templates:
|
|
314
|
+
|
|
315
|
+
- `layout`
|
|
316
|
+
- `hero`
|
|
317
|
+
- `grid`
|
|
318
|
+
- `product`
|
|
319
|
+
- `loading`
|
|
320
|
+
- `empty`
|
|
321
|
+
|
|
322
|
+
### `orderly-product-tile`
|
|
323
|
+
|
|
324
|
+
Product card for `SearchObject`.
|
|
325
|
+
|
|
326
|
+
Default product cards include `schema.org/Product` and `schema.org/Offer` microdata for Google product snippets. Custom templates should preserve the `data-orderly-bind="schema-*"` placeholders when they replace the default product card markup.
|
|
327
|
+
|
|
328
|
+
Attributes:
|
|
329
|
+
|
|
330
|
+
- `add-label`
|
|
331
|
+
- `remove-label`
|
|
332
|
+
|
|
333
|
+
Properties:
|
|
334
|
+
|
|
335
|
+
- `product`
|
|
336
|
+
- `basketController`
|
|
337
|
+
|
|
338
|
+
Events:
|
|
339
|
+
|
|
340
|
+
- `orderly-product-selected`
|
|
341
|
+
- `orderly-add-to-basket`
|
|
342
|
+
- `orderly-remove-from-basket`
|
|
343
|
+
|
|
344
|
+
Templates:
|
|
345
|
+
|
|
346
|
+
- `product`
|
|
347
|
+
- `default`
|
|
348
|
+
|
|
349
|
+
### `orderly-product-page`
|
|
350
|
+
|
|
351
|
+
Product detail view with thumbnail gallery and add-to-basket action.
|
|
352
|
+
|
|
353
|
+
Attributes:
|
|
354
|
+
|
|
355
|
+
- `add-label`
|
|
356
|
+
|
|
357
|
+
Properties:
|
|
358
|
+
|
|
359
|
+
- `product`
|
|
360
|
+
- `selectedImageIndex`
|
|
361
|
+
- `basketController`
|
|
362
|
+
|
|
363
|
+
Events:
|
|
364
|
+
|
|
365
|
+
- `orderly-add-to-basket`
|
|
366
|
+
- `orderly-product-image-selected`
|
|
367
|
+
|
|
368
|
+
Templates:
|
|
369
|
+
|
|
370
|
+
- `product`
|
|
371
|
+
- `thumbnail`
|
|
372
|
+
|
|
373
|
+
### `orderly-credit`
|
|
374
|
+
|
|
375
|
+
Formats and renders a Core `Credit` value as stylable money markup. DKK values are formatted as `kr. <pris>`, for example `kr. 100,00`.
|
|
376
|
+
|
|
377
|
+
```html
|
|
378
|
+
<orderly-credit amount="100" currency="DKK"></orderly-credit>
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
Properties:
|
|
382
|
+
|
|
383
|
+
- `credit`
|
|
384
|
+
- `amount`
|
|
385
|
+
- `currency`
|
|
386
|
+
- `locale`
|
|
387
|
+
- `emptyLabel`
|
|
388
|
+
|
|
389
|
+
Attributes:
|
|
390
|
+
|
|
391
|
+
- `amount`
|
|
392
|
+
- `currency`
|
|
393
|
+
- `locale`
|
|
394
|
+
- `empty-label`
|
|
395
|
+
|
|
396
|
+
Templates:
|
|
397
|
+
|
|
398
|
+
- `credit`
|
|
399
|
+
- `default`
|
|
400
|
+
|
|
401
|
+
### `orderly-stored-image`
|
|
402
|
+
|
|
403
|
+
Renders `StoredImage` with configured URL prefix, rotation, crop, and fit handling.
|
|
404
|
+
|
|
405
|
+
Attributes:
|
|
406
|
+
|
|
407
|
+
- `fit`
|
|
408
|
+
- `variant`
|
|
409
|
+
- `alt`
|
|
410
|
+
|
|
411
|
+
Properties:
|
|
412
|
+
|
|
413
|
+
- `image`
|
|
414
|
+
|
|
415
|
+
Templates:
|
|
416
|
+
|
|
417
|
+
- `image`
|
|
418
|
+
|
|
419
|
+
### `orderly-basket-icon`
|
|
420
|
+
|
|
421
|
+
Basket button with item count badge.
|
|
422
|
+
|
|
423
|
+
Attributes:
|
|
424
|
+
|
|
425
|
+
- `label`
|
|
426
|
+
|
|
427
|
+
Properties:
|
|
428
|
+
|
|
429
|
+
- `basketController`
|
|
430
|
+
|
|
431
|
+
Events:
|
|
432
|
+
|
|
433
|
+
- `orderly-basket-open`
|
|
434
|
+
- `orderly-basket-change`
|
|
435
|
+
|
|
436
|
+
Both events use the current `DraftOrder` as `event.detail`. Derive item count from `event.detail.OrderLines` instead of relying on a separate basket data shape.
|
|
437
|
+
|
|
438
|
+
Templates:
|
|
439
|
+
|
|
440
|
+
- `basket-icon`
|
|
441
|
+
- `icon`
|
|
442
|
+
|
|
443
|
+
### `orderly-basket`
|
|
444
|
+
|
|
445
|
+
Basket overview backed by `DraftOrder`.
|
|
446
|
+
|
|
447
|
+
Attributes:
|
|
448
|
+
|
|
449
|
+
- `base-url`
|
|
450
|
+
- `empty-label`
|
|
451
|
+
- `clear-label`
|
|
452
|
+
- `continue-label`
|
|
453
|
+
- `continue-href`
|
|
454
|
+
- `quantity-label`
|
|
455
|
+
- `remove-label`
|
|
456
|
+
- `subtotal-label`
|
|
457
|
+
- `shipping-label`
|
|
458
|
+
- `total-label`
|
|
459
|
+
- `total-note`
|
|
460
|
+
- `delivery-note`
|
|
461
|
+
- `checkout-href`
|
|
462
|
+
- `checkout-label`
|
|
463
|
+
- `checkout-action`
|
|
464
|
+
|
|
465
|
+
Properties:
|
|
466
|
+
|
|
467
|
+
- `client`
|
|
468
|
+
- `basketController`
|
|
469
|
+
|
|
470
|
+
Events:
|
|
471
|
+
|
|
472
|
+
- `orderly-basket-change`
|
|
473
|
+
- `orderly-basket-verified`
|
|
474
|
+
|
|
475
|
+
Both events use the current `DraftOrder` as `event.detail`. Basket components do not expose a duplicated internal basket data type.
|
|
476
|
+
|
|
477
|
+
Templates:
|
|
478
|
+
|
|
479
|
+
- `basket`
|
|
480
|
+
- `line`
|
|
481
|
+
- `empty`
|
|
482
|
+
|
|
483
|
+
### `orderly-checkout`
|
|
484
|
+
|
|
485
|
+
Checkout form for contact/address, delivery methods, service points, draft verification, and order creation.
|
|
486
|
+
|
|
487
|
+
The default checkout layout hides the address country field and uses `DK` as the default `Address.CountryCodeIso2Letter`. When a Danish 4-digit postal code is entered, the component looks up the city name through Dataforsyningen's `https://api.dataforsyningen.dk/postnumre/{postnr}` endpoint and fills the city field if it is empty or was previously auto-filled.
|
|
488
|
+
|
|
489
|
+
The default delivery UI follows the Orderly storefront pattern:
|
|
490
|
+
|
|
491
|
+
- address fields are filled before delivery methods are shown
|
|
492
|
+
- delivery methods render as selectable radio cards
|
|
493
|
+
- service points render as a separate radio-card list when the selected delivery method requires a pickup point
|
|
494
|
+
- selecting a delivery method or service point verifies the draft so basket totals can update immediately
|
|
495
|
+
|
|
496
|
+
Attributes:
|
|
497
|
+
|
|
498
|
+
- `base-url`
|
|
499
|
+
- `terms-href`
|
|
500
|
+
- `delivery-address-prompt-label`
|
|
501
|
+
- `no-delivery-methods-label`
|
|
502
|
+
- `service-point-help-label`
|
|
503
|
+
- `no-service-points-label`
|
|
504
|
+
|
|
505
|
+
Properties:
|
|
506
|
+
|
|
507
|
+
- `client`
|
|
508
|
+
- `basketController`
|
|
509
|
+
- `profileStore`
|
|
510
|
+
- `labels`
|
|
511
|
+
|
|
512
|
+
Events:
|
|
513
|
+
|
|
514
|
+
- `orderly-checkout-ready`
|
|
515
|
+
- `orderly-checkout-delivery-selected`
|
|
516
|
+
- `orderly-order-created`
|
|
517
|
+
- `orderly-error`
|
|
518
|
+
|
|
519
|
+
Templates:
|
|
520
|
+
|
|
521
|
+
- `checkout`
|
|
522
|
+
|
|
523
|
+
Default template slots:
|
|
524
|
+
|
|
525
|
+
- `deliveryMethods`
|
|
526
|
+
- `servicePoints`
|
|
527
|
+
|
|
528
|
+
### `orderly-navigation`
|
|
529
|
+
|
|
530
|
+
Navigation menu backed by `NavigationController`.
|
|
531
|
+
|
|
532
|
+
For items with children, the item link expands the branch on first click when it is closed. A second click on the expanded item navigates/selects it. Items without children navigate/select on the first click.
|
|
533
|
+
|
|
534
|
+
Navigation is sticky by default so side navigation remains visible while category/product content scrolls. Set `sticky="false"` to opt out. The same attribute works when navigation is slotted into `left`, `right`, or `primary-nav`.
|
|
535
|
+
|
|
536
|
+
Attributes:
|
|
537
|
+
|
|
538
|
+
- `sticky`
|
|
539
|
+
|
|
540
|
+
Properties:
|
|
541
|
+
|
|
542
|
+
- `items`
|
|
543
|
+
- `controller`
|
|
544
|
+
- `sticky`
|
|
545
|
+
|
|
546
|
+
Events:
|
|
547
|
+
|
|
548
|
+
- `orderly-navigation-select`
|
|
549
|
+
|
|
550
|
+
Templates:
|
|
551
|
+
|
|
552
|
+
- `navigation`
|
|
553
|
+
- `item`
|
|
554
|
+
|
|
555
|
+
### Search Controls
|
|
556
|
+
|
|
557
|
+
Search controls bind to a target `orderly-product-grid`.
|
|
558
|
+
|
|
559
|
+
Components:
|
|
560
|
+
|
|
561
|
+
- `orderly-search-box`
|
|
562
|
+
- `orderly-sort-select`
|
|
563
|
+
- `orderly-filter-panel`
|
|
564
|
+
- `orderly-load-more`
|
|
565
|
+
|
|
566
|
+
Common attributes:
|
|
567
|
+
|
|
568
|
+
- `for`
|
|
569
|
+
- `mode`: `textbox` (default) or `icon`. Icon mode renders a search icon and opens a full-page overlay with a search input.
|
|
570
|
+
- `placeholder`
|
|
571
|
+
- `label`
|
|
572
|
+
- `close-label`
|
|
573
|
+
- `prompt-label`
|
|
574
|
+
- `loading-label`
|
|
575
|
+
- `error-label`
|
|
576
|
+
- `empty-label`
|
|
577
|
+
- `debounce-ms`: debounce delay for automatic search. Defaults to `500`.
|
|
578
|
+
|
|
579
|
+
Icon mode searches automatically after the debounce delay and renders product results below the search field using `orderly-product-grid` and `orderly-product-tile`. It reuses the target grid's product, loading, and empty templates when available.
|
|
580
|
+
|
|
581
|
+
Templates:
|
|
582
|
+
|
|
583
|
+
- `search-box`
|
|
584
|
+
- `sort-select`
|
|
585
|
+
- `filter-panel`
|
|
586
|
+
- `load-more`
|
|
587
|
+
|
|
588
|
+
### `orderly-shop-footer`
|
|
589
|
+
|
|
590
|
+
Configurable shop footer with logo, about text, address, contact information, opening hours, and information links.
|
|
591
|
+
|
|
592
|
+
For shop-owned footer content, prefer a global template in shared HTML:
|
|
593
|
+
|
|
594
|
+
```html
|
|
595
|
+
<template data-orderly-template="footer" data-orderly-for="shop-footer">
|
|
596
|
+
<div class="orderly-shop-footer">
|
|
597
|
+
<p class="orderly-shop-footer__about">Independent shop copy.</p>
|
|
598
|
+
</div>
|
|
599
|
+
</template>
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
The programmatic `configureShopFooter()` API remains available when a shop needs to build footer data from JavaScript.
|
|
603
|
+
|
|
604
|
+
Templates:
|
|
605
|
+
|
|
606
|
+
- `footer`
|
|
607
|
+
- `address-line`
|
|
608
|
+
- `contact-item`
|
|
609
|
+
- `opening-hour`
|
|
610
|
+
- `information-link`
|