Skip to content

Commit c01a97f

Browse files
kylebuch8castastrophe
authored andcommitted
feat: adding a schema to pfe-datetime (#574)
* adding a schema to pfe-datetime
1 parent f3bf2b2 commit c01a97f

File tree

4 files changed

+190
-66
lines changed

4 files changed

+190
-66
lines changed

CHANGELOG-prerelease.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Tag: [v1.0.0-prerelease.26](https://github.com/patternfly/patternfly-elements/re
1414
- [ab5bc0e](https://github.com/patternfly/patternfly-elements/commit/ab5bc0e66b1e0f2f4ba180ff80d24b84d0db3260) feat: added sm md and xl sizes for pfe-progress-indicator (#575)
1515
- [fc51ba](https://github.com/patternfly/patternfly-elements/commit/fc51baf1cb4313ca117cc505ba9c0e99dd44d0e9) feat: Add pfe-number schema (#576)
1616
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: pfe-card: storybook issue with incorrect attribute (#573)
17+
- []() Upgrade to latest version of storybook (#366)
18+
- [](https://github.com/patternfly/patternfly-elements/commit/) pfe-datetime: adding a json schema
1719

1820
## Prerelease 25 ( 2019-09-10 )
1921

elements/pfe-datetime/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ Possible values: `numeric`, `2-digit`
103103

104104
Possible values: `numeric`, `2-digit`
105105

106+
## Known Issues
107+
108+
The JSON schema with this component is not being compiled into the component because of naming conflicts in the JSON schema and the getters and setters in the component.
109+
110+
The issue is tracked in [#583](https://github.com/patternfly/patternfly-elements/issues/583).
111+
106112
## Test
107113

108114
npm run test
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "Datetime",
4+
"description": "Datetime is a \"loader\" that indicates to the user that part of the web page is loading, or waiting on other http events to be ready to use.",
5+
"type": "object",
6+
"tag": "pfe-datetime",
7+
"class": "pfe-datetime",
8+
"category": "content",
9+
"properties": {
10+
"slots": {
11+
"title": "Slots",
12+
"description": "Definition of the supported slots",
13+
"type": "object"
14+
},
15+
"attributes": {
16+
"title": "Attributes",
17+
"type": "object",
18+
"properties": {
19+
"datetime": {
20+
"title": "Date & Time",
21+
"type": "string",
22+
"observer": "_basicAttributeChanged"
23+
},
24+
"type": {
25+
"title": "Type",
26+
"description": "A formatted time for the indicated locale, or a relative time (1 hour ago)",
27+
"type": "string",
28+
"enum": [
29+
"local",
30+
"relative"
31+
]
32+
},
33+
"timestamp": {
34+
"title": "Timestamp",
35+
"type": "string"
36+
},
37+
"weekday": {
38+
"title": "Weekday",
39+
"type": "string",
40+
"enum": [
41+
"narrow",
42+
"short",
43+
"long"
44+
]
45+
},
46+
"month": {
47+
"title": "Month",
48+
"type": "string",
49+
"enum": [
50+
"numeric",
51+
"2-digit",
52+
"narrow",
53+
"short",
54+
"long"
55+
]
56+
},
57+
"day": {
58+
"title": "Day",
59+
"type": "string",
60+
"enum": [
61+
"numeric",
62+
"2-digit"
63+
]
64+
},
65+
"year": {
66+
"title": "Year",
67+
"type": "string",
68+
"enum": [
69+
"numeric",
70+
"2-digit"
71+
]
72+
},
73+
"hour": {
74+
"title": "Hour",
75+
"type": "string",
76+
"enum": [
77+
"numeric",
78+
"2-digit"
79+
]
80+
},
81+
"minute": {
82+
"title": "Minute",
83+
"type": "string",
84+
"enum": [
85+
"numeric",
86+
"2-digit"
87+
]
88+
},
89+
"second": {
90+
"title": "Second",
91+
"type": "string",
92+
"enum": [
93+
"numeric",
94+
"2-digit"
95+
]
96+
},
97+
"locale": {
98+
"title": "Locale",
99+
"description": "A locale code like en-US or en-GB",
100+
"type": "string",
101+
"default": "en-US"
102+
},
103+
"time_zone_name": {
104+
"title": "Time Zone",
105+
"type": "string",
106+
"enum": [
107+
"short",
108+
"long"
109+
]
110+
}
111+
}
112+
}
113+
},
114+
"required": ["slots", "attributes"],
115+
"additionalProperties": false
116+
}

0 commit comments

Comments
 (0)