sf-i-events 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dev/index.html CHANGED
@@ -102,6 +102,8 @@
102
102
  transition: 0.3s;
103
103
  }
104
104
 
105
+
106
+
105
107
  sf-i-events::part(button-icon) {
106
108
 
107
109
  border-width: 0px;
@@ -130,6 +132,13 @@
130
132
 
131
133
  }
132
134
 
135
+ sf-i-events::part(month-title) {
136
+
137
+ color: #666;
138
+ font-weight: 600;
139
+
140
+ }
141
+
133
142
  sf-i-events::part(badge) {
134
143
 
135
144
  color: #666;
@@ -150,6 +159,24 @@
150
159
 
151
160
  }
152
161
 
162
+ sf-i-events::part(calendar-month) {
163
+
164
+ box-shadow: inset 2px 2px 6px rgba(5, 5, 5, 0.2);
165
+
166
+ }
167
+
168
+ sf-i-events::part(compliance-date-indicator-primary) {
169
+ background-color: #cd0078;
170
+ }
171
+
172
+ sf-i-events::part(compliance-calendar-day-with-compliance) {
173
+ box-shadow: 1px 1px 10px 0 rgba(0, 0, 0, 0.25), -1px -1px 10px 0 rgba(255, 255, 255, 0.6);
174
+ border-radius: 5px;
175
+ padding-bottom: 3px;
176
+ color: black;
177
+ font-weight: 600;
178
+ }
179
+
153
180
  sf-i-select::part(input-label),
154
181
  sf-i-sub-select::part(input-label),
155
182
  sf-i-events::part(input-label) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sf-i-events",
3
3
  "private": false,
4
- "version": "1.0.6",
4
+ "version": "1.0.8",
5
5
  "description": "Superflows Navigation Component",
6
6
  "main": "sf-i-events.js",
7
7
  "module": "sf-i-events.js",
@@ -1 +1 @@
1
- {"version":3,"file":"sf-i-events.d.ts","sourceRoot":"","sources":["src/sf-i-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,UAAU,EAAa,gBAAgB,EAAC,MAAM,KAAK,CAAC;AAe5D;;;;;;;;;;GAU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,oBAAoB,EAAE,GAAG,CAAC;IAE1B,UAAU,SAAgB,GAAG,OAAO,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,sBAQjF;IAED,aAAa,aAKZ;IAED,QAAQ,QAAS,MAAM,UAKtB;IAED,UAAU,QAAS,MAAM,UAKxB;IAED,qBAAqB,UAAW,MAAM,QAAQ,MAAM,YAGnD;IAED,iBAAiB,UAAW,MAAM,QAAQ,MAAM,YAG/C;IAED,SAAS,UAAW,MAAM,QAAQ,MAAM,YAMvC;IAED,WAAW,UAAW,MAAM,QAAQ,MAAM,YAqDzC;IAED,cAAc,eAsCb;IAED,cAAc,aAwBb;IAED,YAAY,UAAW,GAAG,UA8DzB;IAED,WAAW,UAAiB,GAAG,mBAqB9B;IAED,SAAS,sBA2BR;IAED,YAAY,sBAsBX;IAED,UAAU,aAKT;IAED,QAAQ,sBAOP;;cAMkB,YAAY,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,IAAI;IAMnG,iBAAiB;IAIjB,MAAM;CAgChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,SAAS,CAAC;KAC1B;CACF"}
package/sf-i-events.js CHANGED
@@ -71,7 +71,6 @@ let SfIEvents = class SfIEvents extends LitElement {
71
71
  };
72
72
  this.getLastDayOfLastMonth = (month, year) => {
73
73
  const date = new Date(year, month, 0);
74
- console.log('last date of last month', month, date.getDate());
75
74
  return date.getDate();
76
75
  };
77
76
  this.getLastDayOfMonth = (month, year) => {
@@ -85,29 +84,38 @@ let SfIEvents = class SfIEvents extends LitElement {
85
84
  };
86
85
  this.insertDates = (month, year) => {
87
86
  var html = "";
88
- html += '<div class="d-flex align-center flex-grow flex-wrap">';
87
+ html += '<div class="d-flex align-baseline flex-grow flex-wrap">';
89
88
  const dateNumber = this.getLastDayOfLastMonth(month, year);
90
89
  for (var i = 0; i < this.getBlanks(month, year); i++) {
91
- html += '<div class="day-item date-item-before">';
90
+ html += '<div class="day-item date-item-before fw-100">';
92
91
  html += dateNumber - (this.getBlanks(month, year) - i - 1);
93
92
  html += '</div>';
94
93
  }
95
94
  for (i = 0; i < this.getLastDayOfMonth(month, year); i++) {
96
95
  const mmdd = ("0" + (month + 1)).slice(-2) + "/" + ("0" + (i + 1)).slice(-2);
96
+ var partName = "";
97
97
  if (this.events[mmdd] != null) {
98
- console.log('found not null event');
99
- html += '<div class="day-item date-item-selected">';
98
+ partName = "compliance-calendar-day-with-compliance";
99
+ html += '<div part="' + partName + '" class="day-item date-item fw-600">';
100
+ html += '<div>';
100
101
  html += (i + 1);
101
102
  html += '</div>';
103
+ html += '<div class="d-flex justify-center">';
104
+ html += '<div part="compliance-date-indicator-primary" class="dot"></div>';
105
+ html += '</div>';
106
+ html += '</div>';
102
107
  }
103
108
  else {
104
- html += '<div class="day-item date-item">';
109
+ partName = "";
110
+ html += '<div part="' + partName + '" class="day-item date-item fw-300">';
111
+ html += '<div>';
105
112
  html += (i + 1);
106
113
  html += '</div>';
114
+ html += '</div>';
107
115
  }
108
116
  }
109
117
  for (i = 0; i < 42 - (this.getBlanks(month, year) + this.getLastDayOfMonth(month, year)); i++) {
110
- html += '<div class="day-item date-item-before">';
118
+ html += '<div class="day-item date-item-before fw-100">';
111
119
  html += (i + 1);
112
120
  html += '</div>';
113
121
  }
@@ -117,25 +125,25 @@ let SfIEvents = class SfIEvents extends LitElement {
117
125
  this.insertDayNames = () => {
118
126
  var html = "";
119
127
  html += '<div class="d-flex align-center flex-grow">';
120
- html += '<div class="day-item">';
128
+ html += '<div class="day-item fw-100">';
121
129
  html += 'S';
122
130
  html += '</div>';
123
- html += '<div class="day-item">';
131
+ html += '<div class="day-item fw-100">';
124
132
  html += 'M';
125
133
  html += '</div>';
126
- html += '<div class="day-item">';
134
+ html += '<div class="day-item fw-100">';
127
135
  html += 'T';
128
136
  html += '</div>';
129
- html += '<div class="day-item">';
137
+ html += '<div class="day-item fw-100">';
130
138
  html += 'W';
131
139
  html += '</div>';
132
- html += '<div class="day-item">';
140
+ html += '<div class="day-item fw-100">';
133
141
  html += 'T';
134
142
  html += '</div>';
135
- html += '<div class="day-item">';
143
+ html += '<div class="day-item fw-100">';
136
144
  html += 'F';
137
145
  html += '</div>';
138
- html += '<div class="day-item">';
146
+ html += '<div class="day-item fw-100">';
139
147
  html += 'S';
140
148
  html += '</div>';
141
149
  html += '</div>';
@@ -146,9 +154,9 @@ let SfIEvents = class SfIEvents extends LitElement {
146
154
  var startDate = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + this.calendarStartYYYY);
147
155
  var html = '';
148
156
  for (var i = 0; i < 12; i++) {
149
- html += '<div class="calendar-item d-flex flex-col flex-grow">';
157
+ html += '<div class="calendar-item d-flex flex-col flex-grow" part="calendar-month">';
150
158
  html += '<div class="d-flex">';
151
- html += '<div class="title-item">' + this.monthNames[startDate.getMonth()] + '&nbsp;&nbsp;' + startDate.getFullYear() + '</div>';
159
+ html += '<div part="month-title" class="title-item">' + this.monthNames[startDate.getMonth()] + '&nbsp;&nbsp;' + startDate.getFullYear() + '</div>';
152
160
  html += '</div>';
153
161
  html += this.insertDayNames();
154
162
  html += this.insertDates(startDate.getMonth(), startDate.getFullYear());
@@ -160,7 +168,7 @@ let SfIEvents = class SfIEvents extends LitElement {
160
168
  this.processEvent = (value) => {
161
169
  console.log('processing due date', value.duedate.replace(/['"]+/g, ''));
162
170
  const duedateArr = value.duedate.replace(/['"]+/g, '').split(",");
163
- const startMonth = parseInt(this.calendarStartMM) - 1;
171
+ const startMonth = parseInt(this.calendarStartMM);
164
172
  for (var i = 0; i < duedateArr.length; i++) {
165
173
  const dateArr = duedateArr[i].split("/");
166
174
  console.log('datearr', dateArr);
@@ -168,16 +176,19 @@ let SfIEvents = class SfIEvents extends LitElement {
168
176
  if (dateArr[1] == "*") {
169
177
  var j = startMonth;
170
178
  while (true) {
171
- if (j === (startMonth - 1)) {
172
- break;
173
- }
179
+ console.log('processing event', dateArr[2], dateArr[1], j);
174
180
  const mmdd = ("0" + j).slice(-2) + "/" + ("0" + dateArr[0]).slice(-2);
175
181
  if (this.events == null) {
176
182
  this.events = {};
177
183
  }
178
184
  this.events[mmdd] = value;
185
+ if (startMonth !== 12) {
186
+ if (j === (startMonth - 1)) {
187
+ break;
188
+ }
189
+ }
179
190
  j++;
180
- if (j === 12) {
191
+ if (j === 13) {
181
192
  j = 0;
182
193
  }
183
194
  }
@@ -354,10 +365,10 @@ SfIEvents.styles = css `
354
365
  color: #999;
355
366
  }
356
367
 
357
- .date-item-selected {
358
- color: white;
359
- background-color: #cd0078;
360
- border-radius: 8px;
368
+ .dot {
369
+ width: 6px;
370
+ height: 6px;
371
+ border-radius: 3px;
361
372
  }
362
373
 
363
374
  .title-item {
@@ -394,10 +405,30 @@ SfIEvents.styles = css `
394
405
  white-space: nowrap;
395
406
  }
396
407
 
408
+ .fw-100 {
409
+ font-weight: 100;
410
+ }
411
+
412
+ .fw-200 {
413
+ font-weight: 200;
414
+ }
415
+
416
+ .fw-300 {
417
+ font-weight: 300;
418
+ }
419
+
420
+ .fw-600 {
421
+ font-weight: 600;
422
+ }
423
+
397
424
  .align-start {
398
425
  align-items: flex-start;
399
426
  }
400
427
 
428
+ .align-baseline {
429
+ align-items: baseline;
430
+ }
431
+
401
432
  .align-end {
402
433
  align-items: flex-end;
403
434
  }
@@ -541,7 +572,9 @@ SfIEvents.styles = css `
541
572
 
542
573
  .calendar-item {
543
574
  width: 20%;
544
- margin: 2.5%;
575
+ margin: 1.5%;
576
+ padding: 1%;
577
+ border-radius: 10px;
545
578
  }
546
579
 
547
580
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sf-i-events.js","sourceRoot":"","sources":["src/sf-i-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;AAEH,OAAO,EAAC,UAAU,EAAE,IAAI,EAAE,GAAG,EAAmB,MAAM,KAAK,CAAC;AAC5D,2FAA2F;AAC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AG1B;IADC,KAAK,CAAC,iBAAiB,CAAC;4CACV;AAGf;IADC,KAAK,CAAC,qBAAqB,CAAC;uDACH;AApUf,SAAS;IADrB,aAAa,CAAC,aAAa,CAAC;GAChB,SAAS,CA+qBrB;SA/qBY,SAAS","sourcesContent":["/**\n * @license\n * Copyright 2022 Superflow.dev\n * SPDX-License-Identifier: MIT\n */\n\nimport {LitElement, html, css, PropertyValueMap} from 'lit';\n// import {customElement, query, queryAssignedElements, property} from 'lit/decorators.js';\nimport {customElement, query, property} from 'lit/decorators.js';\nimport Util from './util';\n// import {LitElement, html, css} from 'lit';\n// import {customElement} from 'lit/decorators.js';\n\n\n/*\n\nModes: View, Add, Edit, Delete, Admin\nDB: partitionKey, rangeKey, values\n\n*/\n\n/**\n * SfIEvents element.\n * @fires renderComplete - When the list is populated\n * @fires valueChanged - When the value is changed\n * @property apiId - backend api id\n * @property label - input label\n * @property name - name of the input\n * @property mode - mode of operation\n * @property selectedId - id to preselect\n * @property selectedValue - callback function\n */\n@customElement('sf-i-events')\nexport class SfIEvents extends LitElement {\n \n @property()\n apiIdList!: string;\n\n @property()\n apiIdDetail!: string;\n\n @property()\n apiMethodList!: string;\n\n @property()\n apiMethodDetail!: string;\n\n @property()\n apiBodyList!: string;\n\n @property()\n apiBodyDetail!: string;\n\n @property()\n apiResponseFieldList!: string;\n\n @property()\n calendarStartDD!: string;\n\n @property()\n calendarStartMM!: string;\n\n @property()\n calendarStartYYYY!: string;\n\n @property()\n calendar: Date [] = [];\n\n @property()\n monthNames: string [] = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n\n @property()\n events: any = null;\n\n getApiBodyList = () => {\n return JSON.parse(this.apiBodyList);\n }\n\n getApiBodyDetail = () => {\n return JSON.parse(this.apiBodyDetail);\n }\n\n @property()\n mode!: string;\n\n @property()\n flow: string = \"\";\n\n static override styles = css`\n\n \n .SfIEventsC {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n justify-content: space-between;\n }\n\n .flex-grow {\n flex-grow: 1;\n }\n\n .flex-wrap {\n flex-wrap: wrap;\n }\n\n .left-sticky {\n left: 0px;\n position: sticky;\n }\n\n .link {\n text-decoration: underline;\n cursor: pointer;\n }\n\n .gone {\n display: none\n }\n\n .loader-element {\n position: fixed;\n right: 10px;\n top: 10px;\n margin-left: 5px;\n }\n\n #calendar-container {\n width: 90%;\n }\n\n .day-item {\n width: 14%;\n margin-bottom: 5px;\n text-align: center;\n }\n\n .date-item {\n font-size: 80%;\n color: #333;\n }\n\n .date-item-before {\n font-size: 80%;\n color: #999;\n }\n\n .date-item-selected {\n color: white;\n background-color: #cd0078;\n border-radius: 8px;\n }\n\n .title-item {\n margin-bottom: 10px;\n }\n\n .calendar-item {\n width: 90%;\n margin-bottom: 20px;\n }\n\n .td-head {\n text-transform: capitalize;\n }\n\n .td-body {\n padding: 5px;\n }\n\n .td-dark {\n background-color: #e9e9e9;\n }\n\n .td-highlight {\n background-color: black;\n color: white;\n }\n\n .td-light {\n background-color: #f6f6f6;\n }\n\n td {\n white-space: nowrap;\n }\n\n .align-start {\n align-items: flex-start;\n }\n\n .align-end {\n align-items: flex-end;\n }\n\n .align-center {\n align-items: center;\n }\n \n .lds-dual-ring {\n display: inline-block;\n width: 50px;\n height: 50px;\n }\n .lds-dual-ring:after {\n content: \" \";\n display: block;\n width: 50px;\n height: 50px;\n margin: 0px;\n border-radius: 50%;\n border: 2px solid #fff;\n border-color: #888 #ddd #888 #ddd;\n background-color: white;\n animation: lds-dual-ring 0.8s linear infinite;\n }\n\n .lds-dual-ring-lg {\n display: inline-block;\n width: 30px;\n height: 30px;\n }\n .lds-dual-ring-lg:after {\n content: \" \";\n display: block;\n width: 30px;\n height: 30px;\n margin: 0px;\n border-radius: 50%;\n border: 3px solid #fff;\n border-color: #888 #ddd #888 #ddd;\n animation: lds-dual-ring 0.8s linear infinite;\n }\n\n .div-row-error {\n display: flex;\n justify-content: center;\n position: fixed;\n position: fixed;\n top: 0px;\n right: 0px;\n margin-top: 20px;\n margin-right: 20px;\n display: none;\n align-items:center;\n background-color: white;\n border: dashed 1px red;\n padding: 20px;\n }\n\n .div-row-error-message {\n color: red;\n padding: 5px;\n background-color: white;\n text-align: center;\n }\n\n .div-row-success {\n display: flex;\n justify-content: center;\n position: fixed;\n top: 0px;\n right: 0px;\n margin-top: 20px;\n margin-right: 20px;\n display: none;\n align-items:center;\n background-color: white;\n border: dashed 1px green;\n padding: 20px;\n }\n\n .div-row-success-message {\n color: green;\n padding: 5px;\n background-color: white;\n text-align: center;\n }\n\n .d-flex {\n display: flex;\n }\n\n .flex-col {\n flex-direction: column;\n }\n\n .justify-center {\n justify-content: center;\n }\n\n .justify-between {\n justify-content: space-between;\n }\n\n .justify-end {\n justify-content: flex-end;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n } \n\n .hide {\n display: none;\n }\n\n .lb {\n width: 5%\n }\n .rb {\n width: 5%\n }\n\n @media (orientation: landscape) {\n\n .lb {\n width: 30%\n }\n .rb {\n width: 30%\n }\n\n #calendar-container {\n width: 40%;\n }\n\n .calendar-item {\n width: 20%;\n margin: 2.5%;\n }\n\n }\n\n `;\n\n @query('.div-row-error')\n _SfRowError: any;\n\n @query('.div-row-error-message')\n _SfRowErrorMessage: any;\n\n @query('.div-row-success')\n _SfRowSuccess: any;\n\n @query('.div-row-success-message')\n _SfRowSuccessMessage: any;\n\n @query('.loader-element')\n _SfLoader: any;\n\n @query('#calendar-container')\n _SfCalendarContainer: any;\n\n prepareXhr = async (data: any, url: string, loaderElement: any, authorization: any) => {\n\n \n if(loaderElement != null) {\n loaderElement.innerHTML = '<div class=\"lds-dual-ring\"></div>';\n }\n return await Util.callApi(url, data, authorization);\n\n }\n\n clearMessages = () => {\n this._SfRowError.style.display = 'none';\n this._SfRowErrorMessage.innerHTML = '';\n this._SfRowSuccess.style.display = 'none';\n this._SfRowSuccessMessage.innerHTML = '';\n }\n\n setError = (msg: string) => {\n this._SfRowError.style.display = 'flex';\n this._SfRowErrorMessage.innerHTML = msg;\n this._SfRowSuccess.style.display = 'none';\n this._SfRowSuccessMessage.innerHTML = '';\n }\n\n setSuccess = (msg: string) => {\n this._SfRowError.style.display = 'none';\n this._SfRowErrorMessage.innerHTML = '';\n this._SfRowSuccess.style.display = 'flex';\n this._SfRowSuccessMessage.innerHTML = msg;\n }\n\n getLastDayOfLastMonth = (month: number, year: number) => {\n const date = new Date(year, month, 0);\n console.log('last date of last month', month, date.getDate());\n return date.getDate()\n }\n\n getLastDayOfMonth = (month: number, year: number) => {\n const date = new Date(year, month + 1, 0);\n return date.getDate()\n }\n\n getBlanks = (month: number, year: number) => {\n\n const date = new Date((\"0\" + (month+1)).slice(-2) + '/01/' + year);\n const day = date.getDay();\n return day;\n\n }\n\n insertDates = (month: number, year: number) => {\n\n var html = \"\";\n\n html += '<div class=\"d-flex align-center flex-grow flex-wrap\">';\n\n const dateNumber = this.getLastDayOfLastMonth(month, year);\n\n for(var i = 0; i < this.getBlanks(month, year); i++) {\n\n html += '<div class=\"day-item date-item-before\">';\n html += dateNumber-(this.getBlanks(month, year) - i - 1);\n html += '</div>'; \n\n }\n\n for(i = 0; i < this.getLastDayOfMonth(month, year); i++) {\n\n const mmdd = (\"0\" + (month+1)).slice(-2) + \"/\" + (\"0\" + (i+1)).slice(-2);\n\n if(this.events[mmdd] != null) {\n\n console.log('found not null event');\n\n html += '<div class=\"day-item date-item-selected\">';\n html += (i + 1);\n html += '</div>'; \n \n } else {\n\n html += '<div class=\"day-item date-item\">';\n html += (i + 1);\n html += '</div>'; \n \n }\n\n }\n\n for(i = 0; i < 42 - (this.getBlanks(month, year) + this.getLastDayOfMonth(month, year)); i++) {\n html += '<div class=\"day-item date-item-before\">';\n html += (i+1);\n html += '</div>'; \n }\n\n html += '</div>';\n\n return html;\n\n }\n\n insertDayNames = () => {\n\n var html = \"\";\n\n html += '<div class=\"d-flex align-center flex-grow\">';\n\n html += '<div class=\"day-item\">';\n html += 'S';\n html += '</div>';\n\n html += '<div class=\"day-item\">';\n html += 'M';\n html += '</div>';\n\n html += '<div class=\"day-item\">';\n html += 'T';\n html += '</div>';\n\n html += '<div class=\"day-item\">';\n html += 'W';\n html += '</div>';\n\n html += '<div class=\"day-item\">';\n html += 'T';\n html += '</div>';\n\n html += '<div class=\"day-item\">';\n html += 'F';\n html += '</div>';\n\n html += '<div class=\"day-item\">';\n html += 'S';\n html += '</div>';\n\n html += '</div>';\n\n return html;\n\n }\n\n renderCalendar = () => {\n\n console.log('redering calendar', this.events);\n\n var startDate = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + this.calendarStartYYYY);\n\n var html = '';\n\n for(var i = 0; i < 12; i++) {\n\n html += '<div class=\"calendar-item d-flex flex-col flex-grow\">';\n html += '<div class=\"d-flex\">';\n html += '<div class=\"title-item\">' + this.monthNames[startDate.getMonth()] + '&nbsp;&nbsp;' + startDate.getFullYear() + '</div>';\n html += '</div>';\n html += this.insertDayNames();\n html += this.insertDates(startDate.getMonth(), startDate.getFullYear());\n html += '</div>';\n\n startDate.setMonth(startDate.getMonth() + 1);\n \n }\n\n (this._SfCalendarContainer as HTMLDivElement).innerHTML = html;\n\n }\n\n processEvent = (value: any) => {\n\n console.log('processing due date', value.duedate.replace(/['\"]+/g, ''));\n const duedateArr = value.duedate.replace(/['\"]+/g, '').split(\",\") as Array<string>;\n\n const startMonth = parseInt(this.calendarStartMM) - 1;\n\n for(var i = 0; i < duedateArr.length; i++) {\n\n const dateArr = duedateArr[i].split(\"/\");\n console.log('datearr', dateArr);\n\n if(dateArr[2] == \"*\") {\n if(dateArr[1] == \"*\") {\n\n var j = startMonth;\n\n while(true) {\n\n if(j === (startMonth - 1)) {\n break;\n }\n\n const mmdd = (\"0\" +j).slice(-2) + \"/\" + (\"0\" + dateArr[0]).slice(-2);\n\n if(this.events == null) {\n this.events = {};\n }\n this.events[mmdd] = value;\n\n j++;\n\n if(j === 12) {\n j = 0;\n }\n\n } \n\n } else {\n\n const mmdd = (\"0\" +dateArr[1]).slice(-2) + \"/\" + (\"0\" + dateArr[0]).slice(-2);\n\n if(this.events == null) {\n this.events = {};\n }\n this.events[mmdd] = value;\n\n }\n }\n\n }\n\n console.log('calendar processed', this.calendar);\n console.log('event processed', this.events);\n\n }\n\n fetchDetail = async (value: any) => {\n\n const body: any = this.getApiBodyList();\n body.id = value;\n console.log('detail', value, body);\n let url = \"https://\"+this.apiIdDetail+\".execute-api.us-east-1.amazonaws.com/test/\" + this.apiMethodDetail;\n\n const authorization = btoa(Util.readCookie('email') + \":\" + Util.readCookie('accessToken'));\n const xhr : any = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;\n this._SfLoader.innerHTML = '';\n if(xhr.status == 200) {\n\n const jsonRespose = JSON.parse(xhr.responseText);\n console.log('jsonResponse', jsonRespose);\n this.processEvent(jsonRespose.data.value)\n \n } else {\n const jsonRespose = JSON.parse(xhr.responseText);\n this.setError(jsonRespose.error);\n }\n\n }\n\n fetchList = async () => {\n\n const body: any = this.getApiBodyList();\n let url = \"https://\"+this.apiIdList+\".execute-api.us-east-1.amazonaws.com/test/\" + this.apiMethodList;\n\n console.log('events', url, body);\n\n const authorization = btoa(Util.readCookie('email') + \":\" + Util.readCookie('accessToken'));\n const xhr : any = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;\n this._SfLoader.innerHTML = '';\n if(xhr.status == 200) {\n\n const jsonRespose = JSON.parse(xhr.responseText);\n const fieldArr = JSON.parse(jsonRespose.data.value[this.apiResponseFieldList]) as Array<string>;\n\n for(var i = 0; i < fieldArr.length; i++) {\n\n console.log('events', fieldArr[i]);\n await this.fetchDetail(fieldArr[i])\n\n }\n \n } else {\n const jsonRespose = JSON.parse(xhr.responseText);\n this.setError(jsonRespose.error);\n }\n\n }\n\n initCalendar = async () => {\n\n var newDate = null;\n var newMonth = null;\n var newYear = null;\n var startDate = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + this.calendarStartYYYY);\n\n console.log('startDate', startDate);\n \n do {\n\n this.calendar.push(startDate);\n startDate.setDate(startDate.getDate() + 1);\n\n newDate = (\"0\" + startDate.getDate()).slice(-2);\n newMonth = (\"0\" + startDate.getMonth()).slice(-2);\n newYear = (startDate.getFullYear());\n\n } while(!(newDate == this.calendarStartDD && newMonth == ((\"0\" + ((parseInt(this.calendarStartMM) - 1) + \"\")).slice(-2)) && newYear === (parseInt(this.calendarStartYYYY) + 1)));\n\n console.log(this.calendar);\n\n }\n\n initInputs = () => {\n\n this.calendarStartDD = (\"0\" + this.calendarStartDD).slice(-2);\n this.calendarStartMM = (\"0\" + this.calendarStartMM).slice(-2);\n\n }\n\n loadMode = async () => {\n\n this.initInputs();\n this.initCalendar();\n await this.fetchList();\n this.renderCalendar();\n\n }\n\n constructor() {\n super();\n }\n\n protected override firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n\n this.loadMode();\n\n }\n \n override connectedCallback() {\n super.connectedCallback()\n }\n \n override render() {\n\n return html`\n \n <link href=\"https://fonts.googleapis.com/icon?family=Material+Icons\" rel=\"stylesheet\">\n <div class=\"SfIEventsC\">\n \n <div class=\"d-flex justify-center\">\n <div class=\"loader-element\"></div>\n </div>\n <div class=\"d-flex justify-center\">\n <div class=\"d-flex flex-grow flex-wrap justify-center align-start\" id=\"calendar-container\">\n \n </div>\n </div>\n <div class=\"d-flex justify-between\">\n <div class=\"lb\"></div>\n <div>\n <div class=\"div-row-error div-row-submit gone\">\n <div part=\"errormsg\" class=\"div-row-error-message\"></div>\n </div>\n <div class=\"div-row-success div-row-submit gone\">\n <div part=\"successmsg\" class=\"div-row-success-message\"></div>\n </div>\n </div>\n <div class=\"rb\"></div>\n </div>\n </div>\n\n `;\n }\n\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sf-i-events': SfIEvents;\n }\n}\n"]}
1
+ {"version":3,"file":"sf-i-events.js","sourceRoot":"","sources":["src/sf-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IADC,QAAQ,EAAE;kDACc;AAGzB;IADC,QAAQ,EAAE;8CACU;AAGrB;IADC,QAAQ,EAAE;gDACY;AAGvB;IADC,QAAQ,EAAE;uDACmB;AAG9B;IADC,QAAQ,EAAE;kDACc;AAGzB;IADC,QAAQ,EAAE;kDACc;AAGzB;IADC,QAAQ,EAAE;oDACgB;AAG3B;IADC,QAAQ,EAAE;2CACY;AAGvB;IADC,QAAQ,EAAE;6CACyI;AAGpJ;IADC,QAAQ,EAAE;yCACQ;AAWnB;IADC,QAAQ,EAAE;uCACG;AAGd;IADC,QAAQ,EAAE;uCACO;AAsRlB;IADC,KAAK,CAAC,gBAAgB,CAAC;8CACP;AAGjB;IADC,KAAK,CAAC,wBAAwB,CAAC;qDACR;AAGxB;IADC,KAAK,CAAC,kBAAkB,CAAC;gDACP;AAGnB;IADC,KAAK,CAAC,0BAA0B,CAAC;uDACR;AAG1B;IADC,KAAK,CAAC,iBAAiB,CAAC;4CACV;AAGf;IADC,KAAK,CAAC,qBAAqB,CAAC;uDACH;AA1Vf,SAAS;IADrB,aAAa,CAAC,aAAa,CAAC;GAChB,SAAS,CAgtBrB;SAhtBY,SAAS","sourcesContent":["/**\n * @license\n * Copyright 2022 Superflow.dev\n * SPDX-License-Identifier: MIT\n */\n\nimport {LitElement, html, css, PropertyValueMap} from 'lit';\n// import {customElement, query, queryAssignedElements, property} from 'lit/decorators.js';\nimport {customElement, query, property} from 'lit/decorators.js';\nimport Util from './util';\n// import {LitElement, html, css} from 'lit';\n// import {customElement} from 'lit/decorators.js';\n\n\n/*\n\nModes: View, Add, Edit, Delete, Admin\nDB: partitionKey, rangeKey, values\n\n*/\n\n/**\n * SfIEvents element.\n * @fires renderComplete - When the list is populated\n * @fires valueChanged - When the value is changed\n * @property apiId - backend api id\n * @property label - input label\n * @property name - name of the input\n * @property mode - mode of operation\n * @property selectedId - id to preselect\n * @property selectedValue - callback function\n */\n@customElement('sf-i-events')\nexport class SfIEvents extends LitElement {\n \n @property()\n apiIdList!: string;\n\n @property()\n apiIdDetail!: string;\n\n @property()\n apiMethodList!: string;\n\n @property()\n apiMethodDetail!: string;\n\n @property()\n apiBodyList!: string;\n\n @property()\n apiBodyDetail!: string;\n\n @property()\n apiResponseFieldList!: string;\n\n @property()\n calendarStartDD!: string;\n\n @property()\n calendarStartMM!: string;\n\n @property()\n calendarStartYYYY!: string;\n\n @property()\n calendar: Date [] = [];\n\n @property()\n monthNames: string [] = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n\n @property()\n events: any = null;\n\n getApiBodyList = () => {\n return JSON.parse(this.apiBodyList);\n }\n\n getApiBodyDetail = () => {\n return JSON.parse(this.apiBodyDetail);\n }\n\n @property()\n mode!: string;\n\n @property()\n flow: string = \"\";\n\n static override styles = css`\n\n \n .SfIEventsC {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n justify-content: space-between;\n }\n\n .flex-grow {\n flex-grow: 1;\n }\n\n .flex-wrap {\n flex-wrap: wrap;\n }\n\n .left-sticky {\n left: 0px;\n position: sticky;\n }\n\n .link {\n text-decoration: underline;\n cursor: pointer;\n }\n\n .gone {\n display: none\n }\n\n .loader-element {\n position: fixed;\n right: 10px;\n top: 10px;\n margin-left: 5px;\n }\n\n #calendar-container {\n width: 90%;\n }\n\n .day-item {\n width: 14%;\n margin-bottom: 5px;\n text-align: center;\n }\n\n .date-item {\n font-size: 80%;\n color: #333;\n }\n\n .date-item-before {\n font-size: 80%;\n color: #999;\n }\n\n .dot {\n width: 6px;\n height: 6px;\n border-radius: 3px;\n }\n\n .title-item {\n margin-bottom: 10px;\n }\n\n .calendar-item {\n width: 90%;\n margin-bottom: 20px;\n }\n\n .td-head {\n text-transform: capitalize;\n }\n\n .td-body {\n padding: 5px;\n }\n\n .td-dark {\n background-color: #e9e9e9;\n }\n\n .td-highlight {\n background-color: black;\n color: white;\n }\n\n .td-light {\n background-color: #f6f6f6;\n }\n\n td {\n white-space: nowrap;\n }\n\n .fw-100 {\n font-weight: 100;\n }\n\n .fw-200 {\n font-weight: 200;\n }\n\n .fw-300 {\n font-weight: 300;\n }\n\n .fw-600 {\n font-weight: 600;\n }\n\n .align-start {\n align-items: flex-start;\n }\n\n .align-baseline {\n align-items: baseline;\n }\n\n .align-end {\n align-items: flex-end;\n }\n\n .align-center {\n align-items: center;\n }\n \n .lds-dual-ring {\n display: inline-block;\n width: 50px;\n height: 50px;\n }\n .lds-dual-ring:after {\n content: \" \";\n display: block;\n width: 50px;\n height: 50px;\n margin: 0px;\n border-radius: 50%;\n border: 2px solid #fff;\n border-color: #888 #ddd #888 #ddd;\n background-color: white;\n animation: lds-dual-ring 0.8s linear infinite;\n }\n\n .lds-dual-ring-lg {\n display: inline-block;\n width: 30px;\n height: 30px;\n }\n .lds-dual-ring-lg:after {\n content: \" \";\n display: block;\n width: 30px;\n height: 30px;\n margin: 0px;\n border-radius: 50%;\n border: 3px solid #fff;\n border-color: #888 #ddd #888 #ddd;\n animation: lds-dual-ring 0.8s linear infinite;\n }\n\n .div-row-error {\n display: flex;\n justify-content: center;\n position: fixed;\n position: fixed;\n top: 0px;\n right: 0px;\n margin-top: 20px;\n margin-right: 20px;\n display: none;\n align-items:center;\n background-color: white;\n border: dashed 1px red;\n padding: 20px;\n }\n\n .div-row-error-message {\n color: red;\n padding: 5px;\n background-color: white;\n text-align: center;\n }\n\n .div-row-success {\n display: flex;\n justify-content: center;\n position: fixed;\n top: 0px;\n right: 0px;\n margin-top: 20px;\n margin-right: 20px;\n display: none;\n align-items:center;\n background-color: white;\n border: dashed 1px green;\n padding: 20px;\n }\n\n .div-row-success-message {\n color: green;\n padding: 5px;\n background-color: white;\n text-align: center;\n }\n\n .d-flex {\n display: flex;\n }\n\n .flex-col {\n flex-direction: column;\n }\n\n .justify-center {\n justify-content: center;\n }\n\n .justify-between {\n justify-content: space-between;\n }\n\n .justify-end {\n justify-content: flex-end;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n } \n\n .hide {\n display: none;\n }\n\n .lb {\n width: 5%\n }\n .rb {\n width: 5%\n }\n\n @media (orientation: landscape) {\n\n .lb {\n width: 30%\n }\n .rb {\n width: 30%\n }\n\n #calendar-container {\n width: 40%;\n }\n\n .calendar-item {\n width: 20%;\n margin: 1.5%;\n padding: 1%;\n border-radius: 10px;\n }\n\n }\n\n `;\n\n @query('.div-row-error')\n _SfRowError: any;\n\n @query('.div-row-error-message')\n _SfRowErrorMessage: any;\n\n @query('.div-row-success')\n _SfRowSuccess: any;\n\n @query('.div-row-success-message')\n _SfRowSuccessMessage: any;\n\n @query('.loader-element')\n _SfLoader: any;\n\n @query('#calendar-container')\n _SfCalendarContainer: any;\n\n prepareXhr = async (data: any, url: string, loaderElement: any, authorization: any) => {\n\n \n if(loaderElement != null) {\n loaderElement.innerHTML = '<div class=\"lds-dual-ring\"></div>';\n }\n return await Util.callApi(url, data, authorization);\n\n }\n\n clearMessages = () => {\n this._SfRowError.style.display = 'none';\n this._SfRowErrorMessage.innerHTML = '';\n this._SfRowSuccess.style.display = 'none';\n this._SfRowSuccessMessage.innerHTML = '';\n }\n\n setError = (msg: string) => {\n this._SfRowError.style.display = 'flex';\n this._SfRowErrorMessage.innerHTML = msg;\n this._SfRowSuccess.style.display = 'none';\n this._SfRowSuccessMessage.innerHTML = '';\n }\n\n setSuccess = (msg: string) => {\n this._SfRowError.style.display = 'none';\n this._SfRowErrorMessage.innerHTML = '';\n this._SfRowSuccess.style.display = 'flex';\n this._SfRowSuccessMessage.innerHTML = msg;\n }\n\n getLastDayOfLastMonth = (month: number, year: number) => {\n const date = new Date(year, month, 0);\n return date.getDate()\n }\n\n getLastDayOfMonth = (month: number, year: number) => {\n const date = new Date(year, month + 1, 0);\n return date.getDate()\n }\n\n getBlanks = (month: number, year: number) => {\n\n const date = new Date((\"0\" + (month+1)).slice(-2) + '/01/' + year);\n const day = date.getDay();\n return day;\n\n }\n\n insertDates = (month: number, year: number) => {\n\n var html = \"\";\n\n html += '<div class=\"d-flex align-baseline flex-grow flex-wrap\">';\n\n const dateNumber = this.getLastDayOfLastMonth(month, year);\n\n for(var i = 0; i < this.getBlanks(month, year); i++) {\n\n html += '<div class=\"day-item date-item-before fw-100\">';\n html += dateNumber-(this.getBlanks(month, year) - i - 1);\n html += '</div>'; \n\n }\n\n for(i = 0; i < this.getLastDayOfMonth(month, year); i++) {\n\n const mmdd = (\"0\" + (month+1)).slice(-2) + \"/\" + (\"0\" + (i+1)).slice(-2);\n\n var partName = \"\";\n\n if(this.events[mmdd] != null) {\n partName = \"compliance-calendar-day-with-compliance\";\n html += '<div part=\"' + partName + '\" class=\"day-item date-item fw-600\">';\n html += '<div>'\n html += (i + 1);\n html += '</div>'\n html += '<div class=\"d-flex justify-center\">'\n html += '<div part=\"compliance-date-indicator-primary\" class=\"dot\"></div>'\n html += '</div>'\n html += '</div>'; \n } else {\n partName = \"\";\n html += '<div part=\"' + partName + '\" class=\"day-item date-item fw-300\">';\n html += '<div>'\n html += (i + 1);\n html += '</div>'\n html += '</div>'; \n }\n\n }\n\n for(i = 0; i < 42 - (this.getBlanks(month, year) + this.getLastDayOfMonth(month, year)); i++) {\n html += '<div class=\"day-item date-item-before fw-100\">';\n html += (i+1);\n html += '</div>'; \n }\n\n html += '</div>';\n\n return html;\n\n }\n\n insertDayNames = () => {\n\n var html = \"\";\n\n html += '<div class=\"d-flex align-center flex-grow\">';\n\n html += '<div class=\"day-item fw-100\">';\n html += 'S';\n html += '</div>';\n\n html += '<div class=\"day-item fw-100\">';\n html += 'M';\n html += '</div>';\n\n html += '<div class=\"day-item fw-100\">';\n html += 'T';\n html += '</div>';\n\n html += '<div class=\"day-item fw-100\">';\n html += 'W';\n html += '</div>';\n\n html += '<div class=\"day-item fw-100\">';\n html += 'T';\n html += '</div>';\n\n html += '<div class=\"day-item fw-100\">';\n html += 'F';\n html += '</div>';\n\n html += '<div class=\"day-item fw-100\">';\n html += 'S';\n html += '</div>';\n\n html += '</div>';\n\n return html;\n\n }\n\n renderCalendar = () => {\n\n console.log('redering calendar', this.events);\n\n var startDate = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + this.calendarStartYYYY);\n\n var html = '';\n\n for(var i = 0; i < 12; i++) {\n\n html += '<div class=\"calendar-item d-flex flex-col flex-grow\" part=\"calendar-month\">';\n html += '<div class=\"d-flex\">';\n html += '<div part=\"month-title\" class=\"title-item\">' + this.monthNames[startDate.getMonth()] + '&nbsp;&nbsp;' + startDate.getFullYear() + '</div>';\n html += '</div>';\n html += this.insertDayNames();\n html += this.insertDates(startDate.getMonth(), startDate.getFullYear());\n html += '</div>';\n\n startDate.setMonth(startDate.getMonth() + 1);\n \n }\n\n (this._SfCalendarContainer as HTMLDivElement).innerHTML = html;\n\n }\n\n processEvent = (value: any) => {\n\n console.log('processing due date', value.duedate.replace(/['\"]+/g, ''));\n const duedateArr = value.duedate.replace(/['\"]+/g, '').split(\",\") as Array<string>;\n\n const startMonth = parseInt(this.calendarStartMM);\n\n for(var i = 0; i < duedateArr.length; i++) {\n\n const dateArr = duedateArr[i].split(\"/\");\n console.log('datearr', dateArr);\n\n if(dateArr[2] == \"*\") {\n if(dateArr[1] == \"*\") {\n\n var j = startMonth;\n\n while(true) {\n\n console.log('processing event',dateArr[2],dateArr[1],j);\n\n const mmdd = (\"0\" +j).slice(-2) + \"/\" + (\"0\" + dateArr[0]).slice(-2);\n\n if(this.events == null) {\n this.events = {};\n }\n this.events[mmdd] = value;\n\n\n if(startMonth !== 12) {\n\n if(j === (startMonth - 1)) {\n break;\n }\n }\n\n\n j++;\n\n if(j === 13) {\n j = 0;\n }\n\n } \n\n } else {\n\n const mmdd = (\"0\" +dateArr[1]).slice(-2) + \"/\" + (\"0\" + dateArr[0]).slice(-2);\n\n if(this.events == null) {\n this.events = {};\n }\n this.events[mmdd] = value;\n\n }\n }\n\n }\n\n console.log('calendar processed', this.calendar);\n console.log('event processed', this.events);\n\n }\n\n fetchDetail = async (value: any) => {\n\n const body: any = this.getApiBodyList();\n body.id = value;\n console.log('detail', value, body);\n let url = \"https://\"+this.apiIdDetail+\".execute-api.us-east-1.amazonaws.com/test/\" + this.apiMethodDetail;\n\n const authorization = btoa(Util.readCookie('email') + \":\" + Util.readCookie('accessToken'));\n const xhr : any = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;\n this._SfLoader.innerHTML = '';\n if(xhr.status == 200) {\n\n const jsonRespose = JSON.parse(xhr.responseText);\n console.log('jsonResponse', jsonRespose);\n this.processEvent(jsonRespose.data.value)\n \n } else {\n const jsonRespose = JSON.parse(xhr.responseText);\n this.setError(jsonRespose.error);\n }\n\n }\n\n fetchList = async () => {\n\n const body: any = this.getApiBodyList();\n let url = \"https://\"+this.apiIdList+\".execute-api.us-east-1.amazonaws.com/test/\" + this.apiMethodList;\n\n console.log('events', url, body);\n\n const authorization = btoa(Util.readCookie('email') + \":\" + Util.readCookie('accessToken'));\n const xhr : any = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;\n this._SfLoader.innerHTML = '';\n if(xhr.status == 200) {\n\n const jsonRespose = JSON.parse(xhr.responseText);\n const fieldArr = JSON.parse(jsonRespose.data.value[this.apiResponseFieldList]) as Array<string>;\n\n for(var i = 0; i < fieldArr.length; i++) {\n\n console.log('events', fieldArr[i]);\n await this.fetchDetail(fieldArr[i])\n\n }\n \n } else {\n const jsonRespose = JSON.parse(xhr.responseText);\n this.setError(jsonRespose.error);\n }\n\n }\n\n initCalendar = async () => {\n\n var newDate = null;\n var newMonth = null;\n var newYear = null;\n var startDate = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + this.calendarStartYYYY);\n\n console.log('startDate', startDate);\n \n do {\n\n this.calendar.push(startDate);\n startDate.setDate(startDate.getDate() + 1);\n\n newDate = (\"0\" + startDate.getDate()).slice(-2);\n newMonth = (\"0\" + startDate.getMonth()).slice(-2);\n newYear = (startDate.getFullYear());\n\n } while(!(newDate == this.calendarStartDD && newMonth == ((\"0\" + ((parseInt(this.calendarStartMM) - 1) + \"\")).slice(-2)) && newYear === (parseInt(this.calendarStartYYYY) + 1)));\n\n console.log(this.calendar);\n\n }\n\n initInputs = () => {\n\n this.calendarStartDD = (\"0\" + this.calendarStartDD).slice(-2);\n this.calendarStartMM = (\"0\" + this.calendarStartMM).slice(-2);\n\n }\n\n loadMode = async () => {\n\n this.initInputs();\n this.initCalendar();\n await this.fetchList();\n this.renderCalendar();\n\n }\n\n constructor() {\n super();\n }\n\n protected override firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n\n this.loadMode();\n\n }\n \n override connectedCallback() {\n super.connectedCallback()\n }\n \n override render() {\n\n return html`\n \n <link href=\"https://fonts.googleapis.com/icon?family=Material+Icons\" rel=\"stylesheet\">\n <div class=\"SfIEventsC\">\n \n <div class=\"d-flex justify-center\">\n <div class=\"loader-element\"></div>\n </div>\n <div class=\"d-flex justify-center\">\n <div class=\"d-flex flex-grow flex-wrap justify-center align-start\" id=\"calendar-container\">\n \n </div>\n </div>\n <div class=\"d-flex justify-between\">\n <div class=\"lb\"></div>\n <div>\n <div class=\"div-row-error div-row-submit gone\">\n <div part=\"errormsg\" class=\"div-row-error-message\"></div>\n </div>\n <div class=\"div-row-success div-row-submit gone\">\n <div part=\"successmsg\" class=\"div-row-success-message\"></div>\n </div>\n </div>\n <div class=\"rb\"></div>\n </div>\n </div>\n\n `;\n }\n\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sf-i-events': SfIEvents;\n }\n}\n"]}
@@ -145,10 +145,10 @@ export class SfIEvents extends LitElement {
145
145
  color: #999;
146
146
  }
147
147
 
148
- .date-item-selected {
149
- color: white;
150
- background-color: #cd0078;
151
- border-radius: 8px;
148
+ .dot {
149
+ width: 6px;
150
+ height: 6px;
151
+ border-radius: 3px;
152
152
  }
153
153
 
154
154
  .title-item {
@@ -185,10 +185,30 @@ export class SfIEvents extends LitElement {
185
185
  white-space: nowrap;
186
186
  }
187
187
 
188
+ .fw-100 {
189
+ font-weight: 100;
190
+ }
191
+
192
+ .fw-200 {
193
+ font-weight: 200;
194
+ }
195
+
196
+ .fw-300 {
197
+ font-weight: 300;
198
+ }
199
+
200
+ .fw-600 {
201
+ font-weight: 600;
202
+ }
203
+
188
204
  .align-start {
189
205
  align-items: flex-start;
190
206
  }
191
207
 
208
+ .align-baseline {
209
+ align-items: baseline;
210
+ }
211
+
192
212
  .align-end {
193
213
  align-items: flex-end;
194
214
  }
@@ -332,7 +352,9 @@ export class SfIEvents extends LitElement {
332
352
 
333
353
  .calendar-item {
334
354
  width: 20%;
335
- margin: 2.5%;
355
+ margin: 1.5%;
356
+ padding: 1%;
357
+ border-radius: 10px;
336
358
  }
337
359
 
338
360
  }
@@ -390,7 +412,6 @@ export class SfIEvents extends LitElement {
390
412
 
391
413
  getLastDayOfLastMonth = (month: number, year: number) => {
392
414
  const date = new Date(year, month, 0);
393
- console.log('last date of last month', month, date.getDate());
394
415
  return date.getDate()
395
416
  }
396
417
 
@@ -411,13 +432,13 @@ export class SfIEvents extends LitElement {
411
432
 
412
433
  var html = "";
413
434
 
414
- html += '<div class="d-flex align-center flex-grow flex-wrap">';
435
+ html += '<div class="d-flex align-baseline flex-grow flex-wrap">';
415
436
 
416
437
  const dateNumber = this.getLastDayOfLastMonth(month, year);
417
438
 
418
439
  for(var i = 0; i < this.getBlanks(month, year); i++) {
419
440
 
420
- html += '<div class="day-item date-item-before">';
441
+ html += '<div class="day-item date-item-before fw-100">';
421
442
  html += dateNumber-(this.getBlanks(month, year) - i - 1);
422
443
  html += '</div>';
423
444
 
@@ -427,26 +448,31 @@ export class SfIEvents extends LitElement {
427
448
 
428
449
  const mmdd = ("0" + (month+1)).slice(-2) + "/" + ("0" + (i+1)).slice(-2);
429
450
 
430
- if(this.events[mmdd] != null) {
431
-
432
- console.log('found not null event');
451
+ var partName = "";
433
452
 
434
- html += '<div class="day-item date-item-selected">';
435
- html += (i + 1);
453
+ if(this.events[mmdd] != null) {
454
+ partName = "compliance-calendar-day-with-compliance";
455
+ html += '<div part="' + partName + '" class="day-item date-item fw-600">';
456
+ html += '<div>'
457
+ html += (i + 1);
458
+ html += '</div>'
459
+ html += '<div class="d-flex justify-center">'
460
+ html += '<div part="compliance-date-indicator-primary" class="dot"></div>'
461
+ html += '</div>'
436
462
  html += '</div>';
437
-
438
463
  } else {
439
-
440
- html += '<div class="day-item date-item">';
441
- html += (i + 1);
442
- html += '</div>';
443
-
464
+ partName = "";
465
+ html += '<div part="' + partName + '" class="day-item date-item fw-300">';
466
+ html += '<div>'
467
+ html += (i + 1);
468
+ html += '</div>'
469
+ html += '</div>';
444
470
  }
445
471
 
446
472
  }
447
473
 
448
474
  for(i = 0; i < 42 - (this.getBlanks(month, year) + this.getLastDayOfMonth(month, year)); i++) {
449
- html += '<div class="day-item date-item-before">';
475
+ html += '<div class="day-item date-item-before fw-100">';
450
476
  html += (i+1);
451
477
  html += '</div>';
452
478
  }
@@ -463,31 +489,31 @@ export class SfIEvents extends LitElement {
463
489
 
464
490
  html += '<div class="d-flex align-center flex-grow">';
465
491
 
466
- html += '<div class="day-item">';
492
+ html += '<div class="day-item fw-100">';
467
493
  html += 'S';
468
494
  html += '</div>';
469
495
 
470
- html += '<div class="day-item">';
496
+ html += '<div class="day-item fw-100">';
471
497
  html += 'M';
472
498
  html += '</div>';
473
499
 
474
- html += '<div class="day-item">';
500
+ html += '<div class="day-item fw-100">';
475
501
  html += 'T';
476
502
  html += '</div>';
477
503
 
478
- html += '<div class="day-item">';
504
+ html += '<div class="day-item fw-100">';
479
505
  html += 'W';
480
506
  html += '</div>';
481
507
 
482
- html += '<div class="day-item">';
508
+ html += '<div class="day-item fw-100">';
483
509
  html += 'T';
484
510
  html += '</div>';
485
511
 
486
- html += '<div class="day-item">';
512
+ html += '<div class="day-item fw-100">';
487
513
  html += 'F';
488
514
  html += '</div>';
489
515
 
490
- html += '<div class="day-item">';
516
+ html += '<div class="day-item fw-100">';
491
517
  html += 'S';
492
518
  html += '</div>';
493
519
 
@@ -507,9 +533,9 @@ export class SfIEvents extends LitElement {
507
533
 
508
534
  for(var i = 0; i < 12; i++) {
509
535
 
510
- html += '<div class="calendar-item d-flex flex-col flex-grow">';
536
+ html += '<div class="calendar-item d-flex flex-col flex-grow" part="calendar-month">';
511
537
  html += '<div class="d-flex">';
512
- html += '<div class="title-item">' + this.monthNames[startDate.getMonth()] + '&nbsp;&nbsp;' + startDate.getFullYear() + '</div>';
538
+ html += '<div part="month-title" class="title-item">' + this.monthNames[startDate.getMonth()] + '&nbsp;&nbsp;' + startDate.getFullYear() + '</div>';
513
539
  html += '</div>';
514
540
  html += this.insertDayNames();
515
541
  html += this.insertDates(startDate.getMonth(), startDate.getFullYear());
@@ -528,7 +554,7 @@ export class SfIEvents extends LitElement {
528
554
  console.log('processing due date', value.duedate.replace(/['"]+/g, ''));
529
555
  const duedateArr = value.duedate.replace(/['"]+/g, '').split(",") as Array<string>;
530
556
 
531
- const startMonth = parseInt(this.calendarStartMM) - 1;
557
+ const startMonth = parseInt(this.calendarStartMM);
532
558
 
533
559
  for(var i = 0; i < duedateArr.length; i++) {
534
560
 
@@ -542,9 +568,7 @@ export class SfIEvents extends LitElement {
542
568
 
543
569
  while(true) {
544
570
 
545
- if(j === (startMonth - 1)) {
546
- break;
547
- }
571
+ console.log('processing event',dateArr[2],dateArr[1],j);
548
572
 
549
573
  const mmdd = ("0" +j).slice(-2) + "/" + ("0" + dateArr[0]).slice(-2);
550
574
 
@@ -553,9 +577,18 @@ export class SfIEvents extends LitElement {
553
577
  }
554
578
  this.events[mmdd] = value;
555
579
 
580
+
581
+ if(startMonth !== 12) {
582
+
583
+ if(j === (startMonth - 1)) {
584
+ break;
585
+ }
586
+ }
587
+
588
+
556
589
  j++;
557
590
 
558
- if(j === 12) {
591
+ if(j === 13) {
559
592
  j = 0;
560
593
  }
561
594