@orderlyshop/web-components 0.1.0-build.7045
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 +505 -0
- package/dist/browser/orderly-web-components.define.global.js +3551 -0
- package/dist/browser/orderly-web-components.define.global.js.map +1 -0
- package/dist/browser/orderly-web-components.global.js +3551 -0
- package/dist/browser/orderly-web-components.global.js.map +1 -0
- package/dist/default-shop-DgX6uy10.d.ts +221 -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-BNMhl19n.d.ts +9 -0
- package/dist/define.d.ts +2 -0
- package/dist/define.js +11094 -0
- package/dist/define.js.map +1 -0
- package/dist/index.d.ts +683 -0
- package/dist/index.js +11417 -0
- package/dist/index.js.map +1 -0
- package/dist/navigation.d.ts +61 -0
- package/dist/navigation.js +1125 -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-BgQhGRzS.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 +11187 -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-Bjez59Hr.d.ts +96 -0
- package/docs/components/README.md +708 -0
- package/docs/components/product-grid.md +182 -0
- package/docs/components/product-rail.md +174 -0
- package/examples/shop/README.md +72 -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 +81 -0
- package/examples/shop/src/includes/body-end.html +1 -0
- package/examples/shop/src/includes/body-start.html +3 -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/page-layouts.html +162 -0
- package/examples/shop/src/templates/shop-footer.html +76 -0
- package/examples/shop/tsconfig.json +32 -0
- package/examples/shop/vite.config.mjs +190 -0
- package/html-custom-data.json +279 -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,708 @@
|
|
|
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, responsive full-width tracks, capped tile widths, 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. The default hero stretches across the available page width and centers its intro content.
|
|
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
|
+
In vertical mode, or when the horizontal menu falls back to its mobile drawer, items with children expand on first click and navigate/select on the next click. In horizontal desktop mode, top-level and second-level links navigate/select on click when they have an `href`, while dedicated toggles control which branch or dropdown is open.
|
|
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
|
+
Set `layout="horizontal"` to render a desktop navigation bar in the same pattern as `orderly.shop`: choose a top-level item, render the next level as a separate horizontal row, and show the third level as a dropdown from the active second-level item. The top row stays on one line and scrolls horizontally when it overflows instead of wrapping. The second row spans the full available navigation width, including the separator line above it. On narrow viewports the component automatically falls back to the existing drawer-style mobile navigation, so the horizontal option does not require a separate mobile implementation.
|
|
537
|
+
|
|
538
|
+
In horizontal mode, the active or expanded top-level and second-level categories also render a dedicated indicator line. By default it tracks the text width inside the link padding, and it remains purely presentational and themeable through CSS custom properties.
|
|
539
|
+
|
|
540
|
+
Attributes:
|
|
541
|
+
|
|
542
|
+
- `layout`: `vertical` (default) or `horizontal`
|
|
543
|
+
- `sticky`
|
|
544
|
+
|
|
545
|
+
Properties:
|
|
546
|
+
|
|
547
|
+
- `items`
|
|
548
|
+
- `controller`
|
|
549
|
+
- `layout`
|
|
550
|
+
- `sticky`
|
|
551
|
+
|
|
552
|
+
Events:
|
|
553
|
+
|
|
554
|
+
- `orderly-navigation-select`
|
|
555
|
+
|
|
556
|
+
Slots:
|
|
557
|
+
|
|
558
|
+
- `before-items`: inline content before the navigation items. Useful for logos or compact utility content.
|
|
559
|
+
- `after-items`: inline content after the navigation items. Useful for marketing copy, badges, or CTA blocks.
|
|
560
|
+
|
|
561
|
+
Templates:
|
|
562
|
+
|
|
563
|
+
- `navigation`
|
|
564
|
+
- `item`
|
|
565
|
+
|
|
566
|
+
Styling hooks:
|
|
567
|
+
|
|
568
|
+
- Data attributes:
|
|
569
|
+
- `[data-orderly-layout="horizontal"]`
|
|
570
|
+
- `[data-orderly-level="0"]`, `[data-orderly-level="1"]`, ...
|
|
571
|
+
- `[data-orderly-has-children]`
|
|
572
|
+
- `[data-orderly-active]`
|
|
573
|
+
- `[data-orderly-expanded]`
|
|
574
|
+
- CSS custom properties:
|
|
575
|
+
- `--orderly-navigation-horizontal-padding`
|
|
576
|
+
- `--orderly-navigation-horizontal-inline-padding`
|
|
577
|
+
- `--orderly-navigation-link-padding`
|
|
578
|
+
- `--orderly-navigation-link-padding-horizontal`
|
|
579
|
+
- `--orderly-navigation-link-radius`
|
|
580
|
+
- `--orderly-navigation-link-background`
|
|
581
|
+
- `--orderly-navigation-link-color`
|
|
582
|
+
- `--orderly-navigation-link-hover-background`
|
|
583
|
+
- `--orderly-navigation-link-hover-color`
|
|
584
|
+
- `--orderly-navigation-link-active-background`
|
|
585
|
+
- `--orderly-navigation-link-active-color`
|
|
586
|
+
- `--orderly-navigation-indicator-color`
|
|
587
|
+
- `--orderly-navigation-indicator-height`
|
|
588
|
+
- `--orderly-navigation-indicator-radius`
|
|
589
|
+
- `--orderly-navigation-indicator-inset`
|
|
590
|
+
- `--orderly-navigation-indicator-start-offset`
|
|
591
|
+
- `--orderly-navigation-indicator-end-offset`
|
|
592
|
+
- `--orderly-navigation-indicator-offset`
|
|
593
|
+
- `--orderly-navigation-indicator-collapsed-scale`
|
|
594
|
+
- `--orderly-navigation-child-link-color`
|
|
595
|
+
- `--orderly-navigation-child-link-font-size`
|
|
596
|
+
- `--orderly-navigation-child-link-font-weight`
|
|
597
|
+
- `--orderly-navigation-subnav-padding`
|
|
598
|
+
- `--orderly-navigation-subnav-border-top`
|
|
599
|
+
- `--orderly-navigation-subnav-link-padding`
|
|
600
|
+
- `--orderly-navigation-dropdown-offset`
|
|
601
|
+
- `--orderly-navigation-dropdown-min-width`
|
|
602
|
+
- `--orderly-navigation-dropdown-max-width`
|
|
603
|
+
- `--orderly-navigation-dropdown-border`
|
|
604
|
+
- `--orderly-navigation-dropdown-radius`
|
|
605
|
+
- `--orderly-navigation-dropdown-background`
|
|
606
|
+
- `--orderly-navigation-dropdown-shadow`
|
|
607
|
+
- `--orderly-navigation-megamenu-border`
|
|
608
|
+
- `--orderly-navigation-megamenu-radius`
|
|
609
|
+
- `--orderly-navigation-megamenu-background`
|
|
610
|
+
- `--orderly-navigation-megamenu-shadow`
|
|
611
|
+
|
|
612
|
+
Example:
|
|
613
|
+
|
|
614
|
+
```html
|
|
615
|
+
<orderly-navigation
|
|
616
|
+
layout="horizontal"
|
|
617
|
+
aria-label="Main navigation"
|
|
618
|
+
></orderly-navigation>
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
Inline custom content:
|
|
622
|
+
|
|
623
|
+
```html
|
|
624
|
+
<orderly-navigation layout="horizontal" aria-label="Main navigation">
|
|
625
|
+
<a slot="before-items" href="/" class="shop-nav__logo">
|
|
626
|
+
<img src="/brand/logo.svg" alt="Orderly" />
|
|
627
|
+
</a>
|
|
628
|
+
|
|
629
|
+
<aside slot="after-items" class="shop-nav__promo">
|
|
630
|
+
Fri fragt over 499 kr.
|
|
631
|
+
</aside>
|
|
632
|
+
</orderly-navigation>
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
Custom item template:
|
|
636
|
+
|
|
637
|
+
```html
|
|
638
|
+
<orderly-navigation layout="horizontal" aria-label="Main navigation">
|
|
639
|
+
<template data-orderly-template="item">
|
|
640
|
+
<li class="shop-nav__item" data-orderly-item>
|
|
641
|
+
<a class="shop-nav__link" data-orderly-action="select">
|
|
642
|
+
<span data-orderly-bind="label"></span>
|
|
643
|
+
</a>
|
|
644
|
+
<button class="shop-nav__toggle" type="button" data-orderly-action="toggle">
|
|
645
|
+
More
|
|
646
|
+
</button>
|
|
647
|
+
<div class="shop-nav__children" data-orderly-slot="children"></div>
|
|
648
|
+
</li>
|
|
649
|
+
</template>
|
|
650
|
+
</orderly-navigation>
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
### Search Controls
|
|
654
|
+
|
|
655
|
+
Search controls bind to a target `orderly-product-grid`.
|
|
656
|
+
|
|
657
|
+
Components:
|
|
658
|
+
|
|
659
|
+
- `orderly-search-box`
|
|
660
|
+
- `orderly-sort-select`
|
|
661
|
+
- `orderly-filter-panel`
|
|
662
|
+
- `orderly-load-more`
|
|
663
|
+
|
|
664
|
+
Common attributes:
|
|
665
|
+
|
|
666
|
+
- `for`
|
|
667
|
+
- `mode`: `textbox` (default) or `icon`. Icon mode renders a search icon and opens a full-page overlay with a search input.
|
|
668
|
+
- `placeholder`
|
|
669
|
+
- `label`
|
|
670
|
+
- `close-label`
|
|
671
|
+
- `prompt-label`
|
|
672
|
+
- `loading-label`
|
|
673
|
+
- `error-label`
|
|
674
|
+
- `empty-label`
|
|
675
|
+
- `debounce-ms`: debounce delay for automatic search. Defaults to `500`.
|
|
676
|
+
|
|
677
|
+
Icon mode opens a full-page overlay, immediately renders product results below the search field, and then searches automatically after the debounce delay as the user types. When no search text has been entered yet, the overlay defaults to the target grid's current sort order or the shop's default "latest products" sort. It reuses the target grid's product, loading, and empty templates when available.
|
|
678
|
+
|
|
679
|
+
Templates:
|
|
680
|
+
|
|
681
|
+
- `search-box`
|
|
682
|
+
- `sort-select`
|
|
683
|
+
- `filter-panel`
|
|
684
|
+
- `load-more`
|
|
685
|
+
|
|
686
|
+
### `orderly-shop-footer`
|
|
687
|
+
|
|
688
|
+
Configurable shop footer with logo, about text, address, contact information, opening hours, and information links.
|
|
689
|
+
|
|
690
|
+
For shop-owned footer content, prefer a global template in shared HTML:
|
|
691
|
+
|
|
692
|
+
```html
|
|
693
|
+
<template data-orderly-template="footer" data-orderly-for="shop-footer">
|
|
694
|
+
<div class="orderly-shop-footer">
|
|
695
|
+
<p class="orderly-shop-footer__about">Independent shop copy.</p>
|
|
696
|
+
</div>
|
|
697
|
+
</template>
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
The programmatic `configureShopFooter()` API remains available when a shop needs to build footer data from JavaScript.
|
|
701
|
+
|
|
702
|
+
Templates:
|
|
703
|
+
|
|
704
|
+
- `footer`
|
|
705
|
+
- `address-line`
|
|
706
|
+
- `contact-item`
|
|
707
|
+
- `opening-hour`
|
|
708
|
+
- `information-link`
|