-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
163 additions
and
83 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
demos/storybook/shapes/editors/dash/DatePicker/minimal.ttl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
PREFIX dash: <http://datashapes.org/dash#> | ||
PREFIX ex: <http://example.org/> | ||
PREFIX sh: <http://www.w3.org/ns/shacl#> | ||
|
||
<> | ||
a sh:NodeShape ; | ||
sh:property [ | ||
sh:path ex:datePicker ; | ||
sh:name "date" ; | ||
dash:editor dash:DatePickerEditor ; | ||
sh:minCount 1 ; | ||
sh:maxCount 1 ; | ||
] ; | ||
. |
15 changes: 15 additions & 0 deletions
15
demos/storybook/shapes/editors/dash/DateTimePicker/minimal.ttl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
PREFIX dash: <http://datashapes.org/dash#> | ||
PREFIX ex: <http://example.org/> | ||
PREFIX sh: <http://www.w3.org/ns/shacl#> | ||
|
||
<> | ||
a sh:NodeShape ; | ||
sh:property | ||
[ | ||
sh:path ex:datePicker ; | ||
sh:name "date time" ; | ||
dash:editor dash:DateTimePickerEditor ; | ||
sh:minCount 1 ; | ||
sh:maxCount 1 ; | ||
] ; | ||
. |
16 changes: 16 additions & 0 deletions
16
demos/storybook/stories/Design Systems/Vaadin/Editors/DatePickerSelect.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { Meta } from '@storybook/web-components' | ||
import { createStory, defaultMeta } from '../../../common.js' | ||
import { configure } from '../configure.js' | ||
import datePicker from '../../../../shapes/editors/dash/DatePicker/minimal.ttl?raw' | ||
|
||
const meta: Meta = { | ||
...defaultMeta, | ||
} | ||
|
||
export default meta | ||
|
||
export const empty = createStory({ | ||
name: 'Empty value', | ||
shapes: datePicker, | ||
prefixes: ['xsd', 'schema'], | ||
})(configure) |
16 changes: 16 additions & 0 deletions
16
demos/storybook/stories/Design Systems/Vaadin/Editors/DateTimePickerSelect.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { Meta } from '@storybook/web-components' | ||
import { createStory, defaultMeta } from '../../../common.js' | ||
import { configure } from '../configure.js' | ||
import dateTimePicker from '../../../../shapes/editors/dash/DateTimePicker/minimal.ttl?raw' | ||
|
||
const meta: Meta = { | ||
...defaultMeta, | ||
} | ||
|
||
export default meta | ||
|
||
export const empty = createStory({ | ||
name: 'Empty value', | ||
shapes: dateTimePicker, | ||
prefixes: ['xsd', 'schema'], | ||
})(configure) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { GlobalDependencyLoader, SingleEditorComponent } from '@hydrofoil/shaperone-wc' | ||
import { spread } from '@open-wc/lit-helpers' | ||
import { dash, sh, xsd } from '@tpluscode/rdf-ns-builders' | ||
import { html } from 'lit' | ||
import { localizedLabel } from '@rdfjs-elements/lit-helpers/localizedLabel.js' | ||
import env from '@hydrofoil/shaperone-core/env.js' | ||
import { validity } from './validation.js' | ||
|
||
export default class extends GlobalDependencyLoader(SingleEditorComponent) { | ||
static readonly editor = dash.DatePickerEditor | ||
|
||
render() { | ||
return html` | ||
<vaadin-date-picker ${spread(validity(this.value))} | ||
.label="${localizedLabel(this.property.shape.pointer, { property: sh.name })}" | ||
.value="${this.value.object?.value || ''}" .readonly="${!!this.property.shape.readOnly}" | ||
@value-changed="${(e: CustomEvent) => this.setValue(env().literal(e.detail.value, xsd.date))}"></vaadin-date-picker>` | ||
} | ||
|
||
* dependencies() { | ||
yield import('@vaadin/date-picker') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { GlobalDependencyLoader, SingleEditorComponent } from '@hydrofoil/shaperone-wc' | ||
import { spread } from '@open-wc/lit-helpers' | ||
import { dash, sh, xsd } from '@tpluscode/rdf-ns-builders' | ||
import { html } from 'lit' | ||
import { localizedLabel } from '@rdfjs-elements/lit-helpers/localizedLabel.js' | ||
import env from '@hydrofoil/shaperone-core/env.js' | ||
import { validity } from './validation.js' | ||
|
||
export default class extends GlobalDependencyLoader(SingleEditorComponent) { | ||
static readonly editor = dash.DateTimePickerEditor | ||
|
||
render() { | ||
return html`<vaadin-date-time-picker ${spread(validity(this.value))} | ||
.label="${localizedLabel(this.property.shape.pointer, { property: sh.name })}" | ||
.value="${this.value.object?.value || ''}" .readonly="${!!this.property.shape.readOnly}" | ||
@value-changed="${(e: CustomEvent) => this.setValue(env().literal(e.detail.value, xsd.dateTime))}"></vaadin-date-time-picker>` | ||
} | ||
|
||
* dependencies() { | ||
yield import('@vaadin/date-time-picker') | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters