use Cro::HTTP::Router;
use Cro::WebApp::Template;
sub happy_tm_xmas-routes() is export {
route {
$cromponent.add: Results, ActiveTable, THead, HCell, Row, Cell;
This file contains hidden or 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
class Cell is export { | |
has $.data is required; | |
multi method new($data) { | |
$.new: :$data | |
} | |
method RENDER { | |
q:to/END/ | |
<td><.data></td> |
This file contains hidden or 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
use HTML::Functional; # :CRO exclusions not needed here | |
my @components = <Results ActiveTable Table Grid>; | |
#warn self.thead.raku; $*ERR.flush; | |
role THead { | |
has @.thead; | |
method thead( --> Str() ) { | |
thead do for @!thead -> $cell { |
This file contains hidden or 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
class Cell { | |
has $.data; | |
multi method new($data) { | |
$.new: :$data | |
} | |
method RENDER { | |
q:to/END/ | |
<td><.data></td> |
use Cromponent;
use Cromponent::MyLib;
my $cromponent = Cromponent.new;
my ($index, $topic);
{ #block to avoid namespace collision
use HTML::Functional;
class ActiveTable is export {
has THead() $.thead;
method RENDER {
q:to/END/
<table class="striped">
<?.thead>
<&THead(.thead)>
?>
class ActiveTable is export {
has THead() $.thead;
method RENDER {
q:to/END/
<table class="striped">
<?.thead>
<&THead(.thead)>
?>
This file contains hidden or 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
#!/usr/bin/env raku | |
use lib "lib"; | |
use Cro::WebApp::Template; | |
use Cro::HTTP::Router; | |
use Cro::HTTP::Server; | |
use Cromponent; | |
class Col { |
This file contains hidden or 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
use Cro::HTTP::Router; | |
use Cro::WebApp::Template; | |
my constant $location = 'templates'; | |
my constant $base = $*PROGRAM.parent.parent.parent.parent.add($location); | |
#| API for an HTML::Component that uses the Cro::WebApp cro template | |
#| mechanism, each component has one static cro template file that is | |
#| registered with the Cro::Template::Repository when it is instantiated. | |
#| |
md
<div hx-target="this" hx-swap="outerHTML">
<p>Tree Height is 235m</p>
<p>Tree Area is 8648m^2</p>
<div hx-target="#svg">
<button hx-get="/merry_cromas/tree_me">Tree Me</button>
<button hx-get="/merry_cromas/bauble_up">Bauble Up</button>
NewerOlder