kempo-inventory 0.4.3 → 0.5.1

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
 
@@ -18,6 +18,12 @@ locked: true
18
18
  -->
19
19
  <fragment name="inventory-item-actions"></fragment>
20
20
 
21
+ <!--
22
+ A place for sections from any number of extensions (barcodes, say): fill the location named
23
+ inventory-item-sections with an admin/*.global.html file. Each section reads the item from ?id=.
24
+ -->
25
+ <location name="inventory-item-sections" />
26
+
21
27
  <script type="module">
22
28
  import { getItem, getFields } from '/inventory/sdk.js';
23
29
  import { getAllCurrentUserPermissions } from '/kempo/sdk.js';
package/kempo-config.json CHANGED
@@ -3,6 +3,9 @@
3
3
  "git": "https://github.com/dustinpoissant/kempo-inventory",
4
4
  "public-scope": "inventory",
5
5
  "schema": "./server/db/schema.js",
6
+ "suggestedPeers": [
7
+ { "name": "kempo-media", "reason": "Photos and other files on inventory items (brings kempo-files and kempo-thumbs with it)" }
8
+ ],
6
9
  "widgets": [
7
10
  {
8
11
  "key": "quantity",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kempo-inventory",
3
- "version": "0.4.3",
3
+ "version": "0.5.1",
4
4
  "description": "A basic inventory management system for kempo cms",
5
5
  "license": "MIT",
6
6
  "author": "Dustin Poissant <dustinpoissant@gmail.com>",
@@ -39,7 +39,7 @@
39
39
  "drizzle-orm": "^0.45.2"
40
40
  },
41
41
  "peerDependencies": {
42
- "kempo": ">=4.10.2",
42
+ "kempo": ">=4.11.0",
43
43
  "kempo-ui": ">=1.0.0",
44
44
  "kempo-media": ">=0.3.0",
45
45
  "kempo-files": ">=0.1.3",
@@ -78,7 +78,7 @@ const mountItemPage = ({ $container, item = null, fields = [], defaults = {}, as
78
78
  $actions.className = 'd-f mt-lg';
79
79
  $actions.style.cssText = 'gap: var(--spacer_h); flex-wrap: wrap;';
80
80
  const draw = () => render(html`
81
- <button type="button" class="btn success" id="saveItem" ?disabled=${saving} @click=${() => submit(false)}>${saving ? 'Saving…' : editing ? 'Save' : 'Create item'}</button>
81
+ <button type="button" class="btn success" id="saveItem" data-save ?disabled=${saving} @click=${() => submit(false)}>${saving ? 'Saving…' : editing ? 'Save' : 'Create item'}</button>
82
82
  ${editing ? '' : html`<button type="button" class="btn" id="saveAnother" ?disabled=${saving} @click=${() => submit(true)}>Create and add another</button>`}
83
83
  <button type="button" class="btn" id="cancelItem" ?disabled=${saving} @click=${cancel}>${cancelLabel}</button>`, $actions);
84
84
  draw();