Skip to content

Commit 5f8057b

Browse files
committed
doc(elements): make the difference clearer between pos-value and pos-predicate; also document pos-label because it is a specialized case of pos-value
issue: #83
1 parent 087f095 commit 5f8057b

File tree

7 files changed

+99
-4
lines changed

7 files changed

+99
-4
lines changed

docs/elements/components/pos-label/readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
<!-- Auto Generated Below -->
66

77

8+
## Overview
9+
10+
Displays a human-readable label of the resource, provided by [Thing.label()](https://pod-os.org/reference/core/classes/thing/#label)
11+
812
## Events
913

1014
| Event | Description | Type |

docs/elements/components/pos-predicate/readme.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@
33
<!-- Auto Generated Below -->
44

55

6+
## Overview
7+
8+
Displays an RDF term (predicate) in a human-friendly way, using a provided label. The user can still expand the label
9+
to the full URI to see the actual predicate.
10+
11+
This will only show the predicate itself, not any value. If you want to display a value, use [pos-value](../pos-value) instead.
12+
613
## Properties
714

8-
| Property | Attribute | Description | Type | Default |
9-
| -------- | --------- | ----------- | -------- | ----------- |
10-
| `label` | `label` | | `string` | `undefined` |
11-
| `uri` | `uri` | | `string` | `undefined` |
15+
| Property | Attribute | Description | Type | Default |
16+
| -------- | --------- | --------------------------------------------------- | -------- | ----------- |
17+
| `label` | `label` | The human-readable label to show for this predicate | `string` | `undefined` |
18+
| `uri` | `uri` | The full URI of the predicate | `string` | `undefined` |
1219

1320

1421
## Dependencies

docs/elements/components/pos-value/readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
<!-- Auto Generated Below -->
66

77

8+
## Overview
9+
10+
Shows a single value linked to the resource using the given predicate.
11+
The value is determined by [Thing.anyValue()](https://pod-os.org/reference/core/classes/thing/#anyvalue)
12+
813
## Properties
914

1015
| Property | Attribute | Description | Type | Default |

elements/src/components.d.ts

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ export namespace Components {
7676
interface PosInternalRouter {
7777
"uri": string;
7878
}
79+
/**
80+
* Displays a human-readable label of the resource, provided by [Thing.label()](https://pod-os.org/reference/core/classes/thing/#label)
81+
*/
7982
interface PosLabel {
8083
}
8184
interface PosList {
@@ -116,8 +119,19 @@ export namespace Components {
116119
*/
117120
"blurredBackground": boolean;
118121
}
122+
/**
123+
* Displays an RDF term (predicate) in a human-friendly way, using a provided label. The user can still expand the label
124+
* to the full URI to see the actual predicate.
125+
* This will only show the predicate itself, not any value. If you want to display a value, use [pos-value](../pos-value) instead.
126+
*/
119127
interface PosPredicate {
128+
/**
129+
* The human-readable label to show for this predicate
130+
*/
120131
"label": string;
132+
/**
133+
* The full URI of the predicate
134+
*/
121135
"uri": string;
122136
}
123137
interface PosRelations {
@@ -169,6 +183,10 @@ export namespace Components {
169183
interface PosUserMenu {
170184
"webId": string;
171185
}
186+
/**
187+
* Shows a single value linked to the resource using the given predicate.
188+
* The value is determined by [Thing.anyValue()](https://pod-os.org/reference/core/classes/thing/#anyvalue)
189+
*/
172190
interface PosValue {
173191
/**
174192
* URI of the predicate to get the value from
@@ -558,6 +576,9 @@ declare global {
558576
interface HTMLPosLabelElementEventMap {
559577
"pod-os:resource": any;
560578
}
579+
/**
580+
* Displays a human-readable label of the resource, provided by [Thing.label()](https://pod-os.org/reference/core/classes/thing/#label)
581+
*/
561582
interface HTMLPosLabelElement extends Components.PosLabel, HTMLStencilElement {
562583
addEventListener<K extends keyof HTMLPosLabelElementEventMap>(type: K, listener: (this: HTMLPosLabelElement, ev: PosLabelCustomEvent<HTMLPosLabelElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
563584
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -731,6 +752,11 @@ declare global {
731752
prototype: HTMLPosPictureElement;
732753
new (): HTMLPosPictureElement;
733754
};
755+
/**
756+
* Displays an RDF term (predicate) in a human-friendly way, using a provided label. The user can still expand the label
757+
* to the full URI to see the actual predicate.
758+
* This will only show the predicate itself, not any value. If you want to display a value, use [pos-value](../pos-value) instead.
759+
*/
734760
interface HTMLPosPredicateElement extends Components.PosPredicate, HTMLStencilElement {
735761
}
736762
var HTMLPosPredicateElement: {
@@ -926,6 +952,10 @@ declare global {
926952
interface HTMLPosValueElementEventMap {
927953
"pod-os:resource": any;
928954
}
955+
/**
956+
* Shows a single value linked to the resource using the given predicate.
957+
* The value is determined by [Thing.anyValue()](https://pod-os.org/reference/core/classes/thing/#anyvalue)
958+
*/
929959
interface HTMLPosValueElement extends Components.PosValue, HTMLStencilElement {
930960
addEventListener<K extends keyof HTMLPosValueElementEventMap>(type: K, listener: (this: HTMLPosValueElement, ev: PosValueCustomEvent<HTMLPosValueElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
931961
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -1092,6 +1122,9 @@ declare namespace LocalJSX {
10921122
interface PosInternalRouter {
10931123
"uri"?: string;
10941124
}
1125+
/**
1126+
* Displays a human-readable label of the resource, provided by [Thing.label()](https://pod-os.org/reference/core/classes/thing/#label)
1127+
*/
10951128
interface PosLabel {
10961129
"onPod-os:resource"?: (event: PosLabelCustomEvent<any>) => void;
10971130
}
@@ -1151,8 +1184,19 @@ declare namespace LocalJSX {
11511184
"blurredBackground"?: boolean;
11521185
"onPod-os:resource"?: (event: PosPictureCustomEvent<any>) => void;
11531186
}
1187+
/**
1188+
* Displays an RDF term (predicate) in a human-friendly way, using a provided label. The user can still expand the label
1189+
* to the full URI to see the actual predicate.
1190+
* This will only show the predicate itself, not any value. If you want to display a value, use [pos-value](../pos-value) instead.
1191+
*/
11541192
interface PosPredicate {
1193+
/**
1194+
* The human-readable label to show for this predicate
1195+
*/
11551196
"label"?: string;
1197+
/**
1198+
* The full URI of the predicate
1199+
*/
11561200
"uri"?: string;
11571201
}
11581202
interface PosRelations {
@@ -1227,6 +1271,10 @@ declare namespace LocalJSX {
12271271
"onPod-os:logout"?: (event: PosUserMenuCustomEvent<any>) => void;
12281272
"webId": string;
12291273
}
1274+
/**
1275+
* Shows a single value linked to the resource using the given predicate.
1276+
* The value is determined by [Thing.anyValue()](https://pod-os.org/reference/core/classes/thing/#anyvalue)
1277+
*/
12301278
interface PosValue {
12311279
"onPod-os:resource"?: (event: PosValueCustomEvent<any>) => void;
12321280
/**
@@ -1314,6 +1362,9 @@ declare module "@stencil/core" {
13141362
*/
13151363
"pos-image": LocalJSX.PosImage & JSXBase.HTMLAttributes<HTMLPosImageElement>;
13161364
"pos-internal-router": LocalJSX.PosInternalRouter & JSXBase.HTMLAttributes<HTMLPosInternalRouterElement>;
1365+
/**
1366+
* Displays a human-readable label of the resource, provided by [Thing.label()](https://pod-os.org/reference/core/classes/thing/#label)
1367+
*/
13171368
"pos-label": LocalJSX.PosLabel & JSXBase.HTMLAttributes<HTMLPosLabelElement>;
13181369
"pos-list": LocalJSX.PosList & JSXBase.HTMLAttributes<HTMLPosListElement>;
13191370
"pos-literals": LocalJSX.PosLiterals & JSXBase.HTMLAttributes<HTMLPosLiteralsElement>;
@@ -1324,6 +1375,11 @@ declare module "@stencil/core" {
13241375
"pos-navigation-bar": LocalJSX.PosNavigationBar & JSXBase.HTMLAttributes<HTMLPosNavigationBarElement>;
13251376
"pos-new-thing-form": LocalJSX.PosNewThingForm & JSXBase.HTMLAttributes<HTMLPosNewThingFormElement>;
13261377
"pos-picture": LocalJSX.PosPicture & JSXBase.HTMLAttributes<HTMLPosPictureElement>;
1378+
/**
1379+
* Displays an RDF term (predicate) in a human-friendly way, using a provided label. The user can still expand the label
1380+
* to the full URI to see the actual predicate.
1381+
* This will only show the predicate itself, not any value. If you want to display a value, use [pos-value](../pos-value) instead.
1382+
*/
13271383
"pos-predicate": LocalJSX.PosPredicate & JSXBase.HTMLAttributes<HTMLPosPredicateElement>;
13281384
"pos-relations": LocalJSX.PosRelations & JSXBase.HTMLAttributes<HTMLPosRelationsElement>;
13291385
"pos-resource": LocalJSX.PosResource & JSXBase.HTMLAttributes<HTMLPosResourceElement>;
@@ -1341,6 +1397,10 @@ declare module "@stencil/core" {
13411397
"pos-type-badges": LocalJSX.PosTypeBadges & JSXBase.HTMLAttributes<HTMLPosTypeBadgesElement>;
13421398
"pos-type-router": LocalJSX.PosTypeRouter & JSXBase.HTMLAttributes<HTMLPosTypeRouterElement>;
13431399
"pos-user-menu": LocalJSX.PosUserMenu & JSXBase.HTMLAttributes<HTMLPosUserMenuElement>;
1400+
/**
1401+
* Shows a single value linked to the resource using the given predicate.
1402+
* The value is determined by [Thing.anyValue()](https://pod-os.org/reference/core/classes/thing/#anyvalue)
1403+
*/
13441404
"pos-value": LocalJSX.PosValue & JSXBase.HTMLAttributes<HTMLPosValueElement>;
13451405
}
13461406
}

elements/src/components/pos-label/pos-label.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { Thing } from '@pod-os/core';
22
import { Component, Event, State } from '@stencil/core';
33
import { ResourceAware, ResourceEventEmitter, subscribeResource } from '../events/ResourceAware';
44

5+
/**
6+
* Displays a human-readable label of the resource, provided by [Thing.label()](https://pod-os.org/reference/core/classes/thing/#label)
7+
*/
58
@Component({
69
tag: 'pos-label',
710
shadow: true,

elements/src/components/pos-predicate/pos-predicate.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
import { Component, h, Prop, State } from '@stencil/core';
22

3+
/**
4+
* Displays an RDF term (predicate) in a human-friendly way, using a provided label. The user can still expand the label
5+
* to the full URI to see the actual predicate.
6+
*
7+
* This will only show the predicate itself, not any value. If you want to display a value, use [pos-value](../pos-value) instead.
8+
*/
39
@Component({
410
tag: 'pos-predicate',
511
shadow: true,
612
styleUrl: './pos-predicate.css',
713
})
814
export class PosPredicate {
15+
/**
16+
* The full URI of the predicate
17+
*/
918
@Prop()
1019
uri: string;
1120

21+
/**
22+
* The human-readable label to show for this predicate
23+
*/
1224
@Prop()
1325
label: string;
1426

elements/src/components/pos-value/pos-value.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { Thing } from '@pod-os/core';
22
import { Component, Event, Prop, State } from '@stencil/core';
33
import { ResourceAware, ResourceEventEmitter, subscribeResource } from '../events/ResourceAware';
44

5+
/**
6+
* Shows a single value linked to the resource using the given predicate.
7+
* The value is determined by [Thing.anyValue()](https://pod-os.org/reference/core/classes/thing/#anyvalue)
8+
*/
59
@Component({
610
tag: 'pos-value',
711
shadow: true,

0 commit comments

Comments
 (0)