Skip to content

Commit

Permalink
chore: Update npm dependencies and add rollup-plugin-node-resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
ngocjohn committed Oct 23, 2024
1 parent 2e832af commit 4259210
Show file tree
Hide file tree
Showing 4 changed files with 752 additions and 7 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
"rollup-plugin-serve": "^1.1.1",
"rollup-plugin-typescript2": "^0.36.0",
"swiper": "^11.1.4",
"typescript": "^5.4.5"
"typescript": "^5.4.5",
"rollup-plugin-node-resolve": "^5.2.0"
},
"resolutions": {
"lit": "^2.1.2",
Expand Down
16 changes: 11 additions & 5 deletions src/components/moon-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ import { Pagination } from 'swiper/modules';
import { MoonData, MoonDataItem } from '../types';
import { Moon } from '../utils/moon';

import swipercss from '../css/swiper-bundle.css';
import style from '../css/style.css';
import mainStyles from '../css/style.css';
import swiperStyleCss from '../css/swiperstyles.css';

@customElement('lunar-base-data')
export class LunarBaseData extends LitElement {
@state() moon!: Moon;
@state() swiper: Swiper | null = null;

// https://lit.dev/docs/components/styles/
static get styles(): CSSResultGroup {
return [swiperStyleCss, mainStyles];
}

protected firstUpdated(changedProps: PropertyValues): void {
super.firstUpdated(changedProps);
this.initSwiper();
Expand Down Expand Up @@ -93,9 +98,10 @@ export class LunarBaseData extends LitElement {
</div>
`;
}
}

// https://lit.dev/docs/components/styles/
static get styles(): CSSResultGroup {
return [swipercss, style];
declare global {
interface HTMLElementTagNameMap {
'lunar-base-data': LunarBaseData;
}
}
Loading

0 comments on commit 4259210

Please sign in to comment.