kempo-inventory 0.5.0 → 0.5.2

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/README.md CHANGED
@@ -341,7 +341,7 @@ Changes to the same item are added together and one that nets to nothing is left
341
341
 
342
342
  ### Adding to the item page
343
343
 
344
- An extension can add to the admin item page by supplying a fragment named `inventory-item-actions`, in `admin/inventory-item-actions.fragment.html` in its own package. It appears under the item form, and reads the item from `?id=` in the address. (kempo-products-inventory uses it for "Make product from this item".)
344
+ An extension can add to the admin item page by supplying a fragment named `inventory-item-actions`, in `admin/inventory-item-actions.fragment.html` in its own package. It appears under the item form, and reads the item from `?id=` in the address. (kempo-products-inventory uses it for "Make product from this item".) That fragment has one winner, so for a section that several extensions may each add, fill the **`inventory-item-sections` location** instead with an `admin/*.global.html` file (`<content location="inventory-item-sections" priority="10">…</content>`). Every contribution is shown, ordered by `priority`, and reads the item from `?id=` too. (kempo-inventory-barcodes uses it for an item's barcodes.)
345
345
 
346
346
  ### Hooks
347
347
 
@@ -4,19 +4,37 @@ locked: true
4
4
  <page title="Edit Item - Admin">
5
5
  <content>
6
6
  <script type="module" src="/kempo-ui/components/Icon.js"></script>
7
+ <script type="module" src="/kempo-ui/components/Tabs.js"></script>
7
8
 
8
9
  <div class="d-f mb" style="align-items: center; gap: var(--spacer);">
9
10
  <a href="/admin/extension/kempo-inventory/" class="btn" id="backLink"><k-icon name="arrow" direction="left"></k-icon> Inventory</a>
10
11
  <h1 class="flex mb0" id="title">Edit Item</h1>
11
12
  </div>
12
13
 
13
- <div id="editItem" style="max-width: 44rem;"></div>
14
+ <k-tabs active="details" hash-routing>
15
+ <k-tab for="details">Details</k-tab>
14
16
 
15
- <!--
16
- An extension can add to this page by supplying a fragment with this name in its own admin/
17
- directory (inventory-item-actions.fragment.html). It reads the item from ?id= in the address.
18
- -->
19
- <fragment name="inventory-item-actions"></fragment>
17
+ <k-tab-content name="details" class="pt">
18
+ <div id="editItem" style="max-width: 44rem;"></div>
19
+
20
+ <!--
21
+ An extension can add to this page by supplying a fragment with this name in its own admin/
22
+ directory (inventory-item-actions.fragment.html). It reads the item from ?id= in the address.
23
+ -->
24
+ <fragment name="inventory-item-actions"></fragment>
25
+
26
+ <!--
27
+ Sections from extensions below the form. Prefer inventory-item-tabs, which gives each extension its own tab.
28
+ -->
29
+ <location name="inventory-item-sections" />
30
+ </k-tab-content>
31
+
32
+ <!--
33
+ Tabs from any number of extensions (barcodes, say): supply an admin/*.global.html file that adds a k-tab and a
34
+ k-tab-content for the location inventory-item-tabs. Each tab reads the item from ?id= in the address.
35
+ -->
36
+ <location name="inventory-item-tabs" />
37
+ </k-tabs>
20
38
 
21
39
  <script type="module">
22
40
  import { getItem, getFields } from '/inventory/sdk.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kempo-inventory",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "A basic inventory management system for kempo cms",
5
5
  "license": "MIT",
6
6
  "author": "Dustin Poissant <dustinpoissant@gmail.com>",