Skip to content

Commit

Permalink
Add support for template and slot
Browse files Browse the repository at this point in the history
- add support for template element
- add support for slot element
- add support for slot attribute
  • Loading branch information
marschall committed Jul 7, 2024
1 parent 9742bb2 commit e582fd5
Show file tree
Hide file tree
Showing 17 changed files with 76 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tags-web-components
slot: aBlock
self slot with: aBlock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tags-web-components
slot

^ self brush: WASlotTag new
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tags-web-components
template: aBlock
self template with: aBlock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tags-web-components
template

^ self brush: WATemplateTag new
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The slot HTML element—part of the Web Components technology suite—is a placeholder inside a web component that you can fill with your own markup, which lets you create separate DOM trees and present them together.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
attributes
name: aSring
"The slot's name."
self attributeAt: 'name' put: aSring
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
tag
^ 'slot'
11 changes: 11 additions & 0 deletions repository/Seaside-Canvas.package/WASlotTag.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "Anonymous 7/6/2024 14:52",
"super" : "WATagBrush",
"category" : "Seaside-Canvas-Tags",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WASlotTag",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
attributes-webcomponents
slot: aString
"The slot global attribute assigns a slot in a shadow DOM shadow tree to an element: An element with a slot attribute is assigned to the slot created by the <slot> element whose name attribute's value matches that slot attribute's value."

self attributes at: 'slot' put: aString
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The template HTML element serves as a mechanism for holding HTML fragments, which can either be used later via JavaScript or generated immediately into shadow DOM.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
attributes
shadowRootClonable: aBoolean
"Sets the value of the clonable property of a ShadowRoot created using this element to true. If set, a clone of the shadow host (the parent element of this <template>) created with Node.cloneNode() or Document.importNode() will include a shadow root in the copy."
self attributeAt: 'shadowrootclonable' put: aBoolean
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
attributes
shadowRootDelegatesFocus: aBoolean
"Sets the value of the delegatesFocus property of a ShadowRoot created using this element to true. If this is set and a non-focusable element in the shadow tree is selected, then focus is delegated to the first focusable element in the tree. The value defaults to false."
self attributeAt: 'shadowrootdelegatesfocus' put: aBoolean
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
attributes
shadowRootMode: aString
"Creates a shadow root for the parent element. It is a declarative version of the Element.attachShadow() method and accepts the same enumerated values.
open
Exposes the internal shadow root DOM for JavaScript (recommended for most use cases).
closed
Hides the internal shadow root DOM from JavaScript."
self attributeAt: 'shadowrootmode' put: aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
attributes
shadowRootSerializable: aBoolean
"Sets the value of the serializable property of a ShadowRoot created using this element to true. If set, the shadow root may be serialized by calling the Element.getHTML() or ShadowRoot.getHTML() methods with the options.serializableShadowRoots parameter set true. The value defaults to false."
self attributeAt: 'shadowrootserializable' put: aBoolean
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
tag
^ 'template'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "Anonymous 7/6/2024 14:40",
"super" : "WATagBrush",
"category" : "Seaside-Canvas-Tags",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WATemplateTag",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
SystemOrganization addCategory: #'Seaside-Canvas'!
SystemOrganization addCategory: #'Seaside-Canvas-Base'!
SystemOrganization addCategory: #'Seaside-Canvas-Canvas'!
SystemOrganization addCategory: #'Seaside-Canvas-Tags'!
self packageOrganizer ensurePackage: #'Seaside-Canvas' withTags: #(#Base #Canvas #Tags)!

0 comments on commit e582fd5

Please sign in to comment.