@molecule/app-related-items-card-solid 0.0.1-stage → 1.1.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 +9 -4
- package/dist/RelatedItemsCard.d.ts +4 -0
- package/dist/RelatedItemsCard.d.ts.map +1 -1
- package/dist/RelatedItemsCard.jsx +18 -2
- package/dist/RelatedItemsCard.jsx.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-21T12:47:07.430Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-related-items-card-solid
|
|
@@ -103,6 +103,10 @@ Common usage: "Company → Deals", "Contact → Notes", "Ticket → Related
|
|
|
103
103
|
Articles", "Post → Related Posts". Apps supply the item data and a renderer;
|
|
104
104
|
the card provides consistent header + list + empty-state + view-all chrome.
|
|
105
105
|
|
|
106
|
+
Clickable rows (`onItemClick`): the `<li>` stays a list item and the card
|
|
107
|
+
wraps the row content in an inner `role="button"` div — focusable, with
|
|
108
|
+
Enter/Space running the same handler the click does.
|
|
109
|
+
|
|
106
110
|
Rows keep their DOM node while the item at their index changes, as React's
|
|
107
111
|
index-keyed rows do: `<Index>` reconciles by position and the memo rebuilds
|
|
108
112
|
the rendered content for the new item.
|
|
@@ -138,8 +142,9 @@ Peer dependencies:
|
|
|
138
142
|
- The "View all" label is hardcoded English in the React reference (not
|
|
139
143
|
routed through i18n) and is the same literal here; pass a translated link
|
|
140
144
|
via `headerActions` in localized apps.
|
|
141
|
-
- `onItemClick` rows
|
|
142
|
-
|
|
143
|
-
|
|
145
|
+
- `onItemClick` rows stay `<li>` list items: the card wraps each row's
|
|
146
|
+
content in an inner `role="button"` control (focusable, Enter/Space
|
|
147
|
+
activate it) so the click works from the keyboard too. A real
|
|
148
|
+
`<button>`/`<a>` inside `renderItem` still takes its own clicks and focus.
|
|
144
149
|
- `viewAllHref` renders a plain `<a href>` (full page load in SPA routers);
|
|
145
150
|
use `headerActions` with your router's Link for client-side navigation.
|
|
@@ -17,6 +17,10 @@ import type { RelatedItemsCardProps } from './types.js';
|
|
|
17
17
|
* Articles", "Post → Related Posts". Apps supply the item data and a renderer;
|
|
18
18
|
* the card provides consistent header + list + empty-state + view-all chrome.
|
|
19
19
|
*
|
|
20
|
+
* Clickable rows (`onItemClick`): the `<li>` stays a list item and the card
|
|
21
|
+
* wraps the row content in an inner `role="button"` div — focusable, with
|
|
22
|
+
* Enter/Space running the same handler the click does.
|
|
23
|
+
*
|
|
20
24
|
* Rows keep their DOM node while the item at their index changes, as React's
|
|
21
25
|
* index-keyed rows do: `<Index>` reconciles by position and the memo rebuilds
|
|
22
26
|
* the rendered content for the new item.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelatedItemsCard.d.ts","sourceRoot":"","sources":["../src/RelatedItemsCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAc,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAM/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEvD
|
|
1
|
+
{"version":3,"file":"RelatedItemsCard.d.ts","sourceRoot":"","sources":["../src/RelatedItemsCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAc,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAM/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEvD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CA0DhF"}
|
|
@@ -19,6 +19,10 @@ import { Card } from '@molecule/app-ui-solid';
|
|
|
19
19
|
* Articles", "Post → Related Posts". Apps supply the item data and a renderer;
|
|
20
20
|
* the card provides consistent header + list + empty-state + view-all chrome.
|
|
21
21
|
*
|
|
22
|
+
* Clickable rows (`onItemClick`): the `<li>` stays a list item and the card
|
|
23
|
+
* wraps the row content in an inner `role="button"` div — focusable, with
|
|
24
|
+
* Enter/Space running the same handler the click does.
|
|
25
|
+
*
|
|
22
26
|
* Rows keep their DOM node while the item at their index changes, as React's
|
|
23
27
|
* index-keyed rows do: `<Index>` reconciles by position and the memo rebuilds
|
|
24
28
|
* the rendered content for the new item.
|
|
@@ -46,8 +50,20 @@ export function RelatedItemsCard(props) {
|
|
|
46
50
|
<Index each={props.items}>
|
|
47
51
|
{(item, i) => {
|
|
48
52
|
const content = createMemo(() => props.renderItem(item(), i));
|
|
49
|
-
return (<li
|
|
50
|
-
{
|
|
53
|
+
return (<li>
|
|
54
|
+
{props.onItemClick ? (
|
|
55
|
+
// Keyboard activation for a clickable row — the same call
|
|
56
|
+
// the mouse click makes. The row control is a
|
|
57
|
+
// `role="button"` div (an `<li>` may not carry button
|
|
58
|
+
// semantics), so it activates Enter and Space itself.
|
|
59
|
+
<div role="button" tabIndex={0} class={cm.cursorPointer} onClick={() => props.onItemClick?.(item(), i)} onKeyDown={(event) => {
|
|
60
|
+
if (event.key !== 'Enter' && event.key !== ' ')
|
|
61
|
+
return;
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
props.onItemClick?.(item(), i);
|
|
64
|
+
}}>
|
|
65
|
+
{content()}
|
|
66
|
+
</div>) : (content())}
|
|
51
67
|
</li>);
|
|
52
68
|
}}
|
|
53
69
|
</Index>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelatedItemsCard.jsx","sourceRoot":"","sources":["../src/RelatedItemsCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAY,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAI7C
|
|
1
|
+
{"version":3,"file":"RelatedItemsCard.jsx","sourceRoot":"","sources":["../src/RelatedItemsCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAY,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAI7C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,gBAAgB,CAAI,KAA+B;IACjE,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;IACxB,OAAO,CACL,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAC7D;MAAA,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACtB;QAAA,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CACzE;UAAA,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QA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K,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;gBAC7D,OAAO,CACL,CAAC,EAAE,CACD;oBAAA,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;oBACnB,0DAA0D;oBAC1D,8CAA8C;oBAC9C,sDAAsD;oBACtD,sDAAsD;oBACtD,CAAC,GAAG,CACF,IAAI,CAAC,QAAQ,CACb,QAAQ,CAAC,CAAC,CAAC,CAAC,CACZ,KAAK,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CACxB,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAC9C,SAAS,CAAC,CAAC,CAAC,KAAoB,EAAQ,EAAE;4BACxC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG;gCAAE,OAAM;4BACtD,KAAK,CAAC,cAAc,EAAE,CAAA;4BACtB,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAA;wBAChC,CAAC,CAAC,CAEF;wBAAA,CAAC,OAAO,EAAE,CACZ;sBAAA,EAAE,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,CACF,OAAO,EAAE,CACV,CACH;kBAAA,EAAE,EAAE,CAAC,CACN,CAAA;YACH,CAAC,CACH;YAAA,EAAE,KAAK,CACT;UAAA,EAAE,EAAE,CAAC,CACN,CACH;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -45,9 +45,10 @@
|
|
|
45
45
|
* - The "View all" label is hardcoded English in the React reference (not
|
|
46
46
|
* routed through i18n) and is the same literal here; pass a translated link
|
|
47
47
|
* via `headerActions` in localized apps.
|
|
48
|
-
* - `onItemClick` rows
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* - `onItemClick` rows stay `<li>` list items: the card wraps each row's
|
|
49
|
+
* content in an inner `role="button"` control (focusable, Enter/Space
|
|
50
|
+
* activate it) so the click works from the keyboard too. A real
|
|
51
|
+
* `<button>`/`<a>` inside `renderItem` still takes its own clicks and focus.
|
|
51
52
|
* - `viewAllHref` renders a plain `<a href>` (full page load in SPA routers);
|
|
52
53
|
* use `headerActions` with your router's Link for client-side navigation.
|
|
53
54
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAEH,cAAc,wBAAwB,CAAA;AACtC,cAAc,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -45,9 +45,10 @@
|
|
|
45
45
|
* - The "View all" label is hardcoded English in the React reference (not
|
|
46
46
|
* routed through i18n) and is the same literal here; pass a translated link
|
|
47
47
|
* via `headerActions` in localized apps.
|
|
48
|
-
* - `onItemClick` rows
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* - `onItemClick` rows stay `<li>` list items: the card wraps each row's
|
|
49
|
+
* content in an inner `role="button"` control (focusable, Enter/Space
|
|
50
|
+
* activate it) so the click works from the keyboard too. A real
|
|
51
|
+
* `<button>`/`<a>` inside `renderItem` still takes its own clicks and focus.
|
|
51
52
|
* - `viewAllHref` renders a plain `<a href>` (full page load in SPA routers);
|
|
52
53
|
* use `headerActions` with your router's Link for client-side navigation.
|
|
53
54
|
*
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAEH,cAAc,wBAAwB,CAAA;AACtC,cAAc,YAAY,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-related-items-card-solid",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Card container for cross-linked items: company→deals, contact→notes, ticket→articles",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-related-items-card-solid",
|
|
6
6
|
"type": "module",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@molecule/app-framework-conformance": "0.0.0",
|
|
52
|
-
"@molecule/app-i18n": "1.2.
|
|
52
|
+
"@molecule/app-i18n": "1.2.2",
|
|
53
53
|
"@molecule/app-icons": "1.0.4",
|
|
54
|
-
"@molecule/app-solid": "3.
|
|
55
|
-
"@molecule/app-ui": "1.
|
|
56
|
-
"@molecule/app-ui-solid": "1.1
|
|
54
|
+
"@molecule/app-solid": "3.9.0",
|
|
55
|
+
"@molecule/app-ui": "1.5.0",
|
|
56
|
+
"@molecule/app-ui-solid": "1.2.1",
|
|
57
57
|
"@types/node": "26.6.5",
|
|
58
58
|
"jsdom": "30.1.3",
|
|
59
59
|
"solid-js": "1.9.17",
|