-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 1395-layout-flex-button-input
- Loading branch information
Showing
8 changed files
with
167 additions
and
27 deletions.
There are no files selected for viewing
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,42 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title><%= htmlWebpackPlugin.options.title %></title> | ||
<%= htmlWebpackPlugin.options.font %> | ||
</head> | ||
<body> | ||
<ids-container role="main" padding="8" hidden> | ||
<ids-toolbar> | ||
<ids-toolbar-section align="end" type="fluid"> | ||
<ids-menu-button menu="add-event" value="${view}"> | ||
<ids-icon icon="add"></ids-icon> | ||
<span class="audible">Add Event</span> | ||
</ids-menu-button> | ||
<ids-popup-menu id="add-event" trigger="click"> | ||
<ids-menu-group> | ||
<ids-menu-item value="add-api"> | ||
<ids-text>Add Event (API)</ids-text> | ||
</ids-menu-item> | ||
<ids-menu-item value="add-modal"> | ||
<ids-text>Add Event (Modal)</ids-text> | ||
</ids-menu-item> | ||
<ids-menu-item value="clear"> | ||
<ids-text>Clear Events</ids-text> | ||
</ids-menu-item> | ||
</ids-menu-group> | ||
</ids-popup-menu> | ||
|
||
<ids-theme-switcher mode="light" version="new"></ids-theme-switcher> | ||
</ids-toolbar-section> | ||
</ids-toolbar> | ||
<ids-layout-grid auto-fit="true" padding="md"> | ||
<ids-text font-size="12" type="h1">Calendar View</ids-text> | ||
</ids-layout-grid> | ||
<ids-layout-grid auto-fit="true" padding-x="md"> | ||
<ids-layout-grid-cell> | ||
<ids-calendar date="10/22/2019" show-legend show-details show-today view-picker></ids-calendar> | ||
</ids-layout-grid-cell> | ||
</ids-layout-grid> | ||
</ids-container> | ||
</body> | ||
</html> |
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,59 @@ | ||
import eventsJSON from '../../../assets/data/events.json'; | ||
import eventTypesJSON from '../../../assets/data/event-types.json'; | ||
|
||
const eventsURL: any = eventsJSON; | ||
const eventTypesURL: any = eventTypesJSON; | ||
|
||
/** | ||
* Fetch events.json | ||
* @returns {Promise} events.json content | ||
*/ | ||
function getCalendarEvents(): Promise<any> { | ||
return fetch(eventsURL).then((res) => res.json()); | ||
} | ||
|
||
/** | ||
* Fetch event-types.json | ||
* @returns {Promise} event-types.json content | ||
*/ | ||
function getEventTypes(): Promise<any> { | ||
return fetch(eventTypesURL).then((res) => res.json()); | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', async () => { | ||
const calendar: any = document.querySelector('ids-calendar'); | ||
const addEventMenu = document.querySelector('#add-event'); | ||
|
||
// Set event types | ||
calendar.eventTypesData = await getEventTypes(); | ||
calendar.eventsData = await getCalendarEvents(); | ||
|
||
addEventMenu?.addEventListener('selected', (evt: any) => { | ||
// Mock user defined id | ||
const id: string = Date.now().toString() + Math.floor(Math.random() * 100); | ||
|
||
switch (evt.detail.value) { | ||
case 'add-modal': | ||
calendar.createNewEvent(id, true); | ||
break; | ||
case 'add-api': | ||
calendar.createNewEvent(id, false); | ||
break; | ||
case 'clear': | ||
calendar.clearEvents(); | ||
break; | ||
default: | ||
break; | ||
} | ||
}); | ||
|
||
// Listen to dayselected events | ||
calendar.addEventListener('dayselected', (evt: any) => { | ||
console.info('dayselected', evt.detail); | ||
}); | ||
|
||
calendar.disableSettings = { | ||
dates: ['10/22/2019', '10/23/2019', '10/24/2019', '10/25/2019'], | ||
isEnable: true | ||
}; | ||
}); |
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
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