Skip to content

Commit

Permalink
Merge pull request #7 from zigomir/miscellaneous-slot
Browse files Browse the repository at this point in the history
Add misc slot
  • Loading branch information
zigomir authored Sep 17, 2020
2 parents 5171276 + e40c4cb commit 9c7f7b1
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "caly",
"version": "0.6.0",
"version": "0.7.0",
"description": "Caly is a small calendar!",
"main": "dist/index.cjs.js",
"module": "dist/custom-elements/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ exports[`should render caly-calendar: render-2010-01-01 1`] = `
<caly-calendar month="1" selected="2010-01-01" year="2010">
<mock:shadow-root>
<div class="grid">
<section class="misc">
<slot name="misc"></slot>
</section>
<section class="navigation">
<div class="button">
<slot name="back">
Expand Down
9 changes: 7 additions & 2 deletions src/components/caly-calendar/caly-calendar.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
.grid {
display: inline-grid;
grid-template-areas: var(--grid,
"nav nav"
"mn mn"
"misc misc"
"nav nav"
"mn mn"
);
column-gap: var(--grid-column-gap, 0px);
}
Expand All @@ -43,6 +44,10 @@
color: var(--out-of-range-color, #d3d3d3);
}

.misc {
grid-area: misc;
}

.navigation {
grid-area: nav;
height: var(--navigation-height, 16px);
Expand Down
9 changes: 7 additions & 2 deletions src/components/caly-calendar/caly-calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ interface IMonth {
}

/**
* @slot back – Slot for the previous month button
* @slot forward – Slot for the next month button
* @slot misc - Slot for the miscellaneous, e.g. date preset buttons
* @slot back - Slot for the previous month button
* @slot forward - Slot for the next month button
*/
@Component({
tag: 'caly-calendar',
Expand Down Expand Up @@ -131,6 +132,10 @@ export class CalyCalendar {

return (
<div class="grid">
<section class="misc">
<slot name="misc"></slot>
</section>

<section class="navigation">
<div onClick={() => this.back()} class="button">
<slot name="back">&lt;</slot>
Expand Down
9 changes: 5 additions & 4 deletions src/components/caly-calendar/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ Caly, a 6k customizable calendar.

## Slots

| Slot | Description |
| --------------------------------------------- | ----------- |
| `"back – Slot for the previous month button"` | |
| `"forward – Slot for the next month button"` | |
| Slot | Description |
| ----------- | ---------------------------------------------------- |
| `"back"` | Slot for the previous month button |
| `"forward"` | Slot for the next month button |
| `"misc"` | Slot for the miscellaneous, e.g. date preset buttons |


## CSS Custom Properties
Expand Down
5 changes: 0 additions & 5 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@

--cell-width: 40px;
--cell-height: 40px;

--grid:
"nav nav"
"mn mn";

--grid-column-gap: 15px;

--in-range-bg-color: yellow;
Expand Down

0 comments on commit 9c7f7b1

Please sign in to comment.