sf-i-events 1.0.7 → 1.0.9
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 +29 -0
- package/package.json +1 -1
- package/sf-i-events.d.ts.map +1 -1
- package/sf-i-events.js +63 -28
- package/sf-i-events.js.map +1 -1
- package/src/sf-i-events.ts +75 -36
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,8 @@
|
|
|
130
132
|
|
|
131
133
|
}
|
|
132
134
|
|
|
135
|
+
|
|
136
|
+
|
|
133
137
|
sf-i-events::part(badge) {
|
|
134
138
|
|
|
135
139
|
color: #666;
|
|
@@ -150,6 +154,31 @@
|
|
|
150
154
|
|
|
151
155
|
}
|
|
152
156
|
|
|
157
|
+
sf-i-events::part(month-title) {
|
|
158
|
+
|
|
159
|
+
color: #666;
|
|
160
|
+
font-weight: 600;
|
|
161
|
+
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
sf-i-events::part(calendar-month) {
|
|
165
|
+
|
|
166
|
+
box-shadow: inset 2px 2px 6px rgba(5, 5, 5, 0.2);
|
|
167
|
+
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
sf-i-events::part(compliance-date-indicator-primary) {
|
|
171
|
+
background-color: #cd0078;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
sf-i-events::part(compliance-calendar-day-with-compliance) {
|
|
175
|
+
box-shadow: 1px 1px 10px 0 rgba(0, 0, 0, 0.25), -1px -1px 10px 0 rgba(255, 255, 255, 0.6);
|
|
176
|
+
border-radius: 5px;
|
|
177
|
+
padding-bottom: 3px;
|
|
178
|
+
color: black;
|
|
179
|
+
font-weight: 600;
|
|
180
|
+
}
|
|
181
|
+
|
|
153
182
|
sf-i-select::part(input-label),
|
|
154
183
|
sf-i-sub-select::part(input-label),
|
|
155
184
|
sf-i-events::part(input-label) {
|
package/package.json
CHANGED
package/sf-i-events.d.ts.map
CHANGED
|
@@ -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;;;;;;;;;;GAUG;AACH,qBACa,SAAU,SAAQ,UAAU;IAGvC,SAAS,EAAG,MAAM,CAAC;IAGnB,WAAW,EAAG,MAAM,CAAC;IAGrB,aAAa,EAAG,MAAM,CAAC;IAGvB,eAAe,EAAG,MAAM,CAAC;IAGzB,WAAW,EAAG,MAAM,CAAC;IAGrB,aAAa,EAAG,MAAM,CAAC;IAGvB,oBAAoB,EAAG,MAAM,CAAC;IAG9B,eAAe,EAAG,MAAM,CAAC;IAGzB,eAAe,EAAG,MAAM,CAAC;IAGzB,iBAAiB,EAAG,MAAM,CAAC;IAG3B,QAAQ,EAAE,IAAI,EAAG,CAAM;IAGvB,UAAU,EAAE,MAAM,EAAG,CAA+H;IAGpJ,MAAM,EAAE,GAAG,CAAQ;IAEnB,cAAc,YAEb;IAED,gBAAgB,YAEf;IAGD,IAAI,EAAG,MAAM,CAAC;IAGd,IAAI,EAAE,MAAM,CAAM;IAElB,OAAgB,MAAM,
|
|
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;;;;;;;;;;GAUG;AACH,qBACa,SAAU,SAAQ,UAAU;IAGvC,SAAS,EAAG,MAAM,CAAC;IAGnB,WAAW,EAAG,MAAM,CAAC;IAGrB,aAAa,EAAG,MAAM,CAAC;I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AAG,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-
|
|
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
|
-
|
|
99
|
-
html += '<div class="day-item date-item-
|
|
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
|
-
|
|
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()] + ' ' + startDate.getFullYear() + '</div>';
|
|
159
|
+
html += '<div part="month-title" class="title-item">' + this.monthNames[startDate.getMonth()] + ' ' + 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)
|
|
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
|
-
|
|
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 ===
|
|
191
|
+
if (j === 13) {
|
|
181
192
|
j = 0;
|
|
182
193
|
}
|
|
183
194
|
}
|
|
@@ -213,9 +224,10 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
213
224
|
}
|
|
214
225
|
};
|
|
215
226
|
this.fetchList = async () => {
|
|
227
|
+
console.log('calendar fetching list');
|
|
216
228
|
const body = this.getApiBodyList();
|
|
217
229
|
let url = "https://" + this.apiIdList + ".execute-api.us-east-1.amazonaws.com/test/" + this.apiMethodList;
|
|
218
|
-
console.log('events', url, body);
|
|
230
|
+
console.log('calendar events', url, body);
|
|
219
231
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
220
232
|
const xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization));
|
|
221
233
|
this._SfLoader.innerHTML = '';
|
|
@@ -252,8 +264,10 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
252
264
|
this.calendarStartMM = ("0" + this.calendarStartMM).slice(-2);
|
|
253
265
|
};
|
|
254
266
|
this.loadMode = async () => {
|
|
267
|
+
console.log('calendar load mode');
|
|
255
268
|
this.initInputs();
|
|
256
269
|
this.initCalendar();
|
|
270
|
+
console.log('calendar init done');
|
|
257
271
|
await this.fetchList();
|
|
258
272
|
this.renderCalendar();
|
|
259
273
|
};
|
|
@@ -354,11 +368,10 @@ SfIEvents.styles = css `
|
|
|
354
368
|
color: #999;
|
|
355
369
|
}
|
|
356
370
|
|
|
357
|
-
.
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
border-radius:
|
|
361
|
-
font-size: 80%;
|
|
371
|
+
.dot {
|
|
372
|
+
width: 6px;
|
|
373
|
+
height: 6px;
|
|
374
|
+
border-radius: 3px;
|
|
362
375
|
}
|
|
363
376
|
|
|
364
377
|
.title-item {
|
|
@@ -395,10 +408,30 @@ SfIEvents.styles = css `
|
|
|
395
408
|
white-space: nowrap;
|
|
396
409
|
}
|
|
397
410
|
|
|
411
|
+
.fw-100 {
|
|
412
|
+
font-weight: 100;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.fw-200 {
|
|
416
|
+
font-weight: 200;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.fw-300 {
|
|
420
|
+
font-weight: 300;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.fw-600 {
|
|
424
|
+
font-weight: 600;
|
|
425
|
+
}
|
|
426
|
+
|
|
398
427
|
.align-start {
|
|
399
428
|
align-items: flex-start;
|
|
400
429
|
}
|
|
401
430
|
|
|
431
|
+
.align-baseline {
|
|
432
|
+
align-items: baseline;
|
|
433
|
+
}
|
|
434
|
+
|
|
402
435
|
.align-end {
|
|
403
436
|
align-items: flex-end;
|
|
404
437
|
}
|
|
@@ -542,7 +575,9 @@ SfIEvents.styles = css `
|
|
|
542
575
|
|
|
543
576
|
.calendar-item {
|
|
544
577
|
width: 20%;
|
|
545
|
-
margin:
|
|
578
|
+
margin: 1.5%;
|
|
579
|
+
padding: 1%;
|
|
580
|
+
border-radius: 10px;
|
|
546
581
|
}
|
|
547
582
|
|
|
548
583
|
}
|
package/sf-i-events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sf-i-events.js","sourceRoot":"","sources":["src/sf-i-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;AAEH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AGxB;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;AArUf,SAAS;IADrB,aAAa,CAAC,aAAa,CAAC;GAChB,SAAS,CAgrBrB;SAhrBY,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 font-size: 80%;\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()] + ' ' + 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 HTMLElementTagName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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiR1B,CAAA;AArUF;IADC,QAAQ,EAAE;4CACQ;AAGnB;IADC,QAAQ,EAAE;8CACU;AAGrB;IADC,QAAQ,EAAE;gDACY;AAGvB;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,CAutBrB;SAvtBY,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()] + ' ' + 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 console.log('calendar fetching list');\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('calendar 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 console.log('calendar load mode');\n\n this.initInputs();\n this.initCalendar();\n\n console.log('calendar init done');\n\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"]}
|
package/src/sf-i-events.ts
CHANGED
|
@@ -145,11 +145,10 @@ export class SfIEvents extends LitElement {
|
|
|
145
145
|
color: #999;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
border-radius:
|
|
152
|
-
font-size: 80%;
|
|
148
|
+
.dot {
|
|
149
|
+
width: 6px;
|
|
150
|
+
height: 6px;
|
|
151
|
+
border-radius: 3px;
|
|
153
152
|
}
|
|
154
153
|
|
|
155
154
|
.title-item {
|
|
@@ -186,10 +185,30 @@ export class SfIEvents extends LitElement {
|
|
|
186
185
|
white-space: nowrap;
|
|
187
186
|
}
|
|
188
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
|
+
|
|
189
204
|
.align-start {
|
|
190
205
|
align-items: flex-start;
|
|
191
206
|
}
|
|
192
207
|
|
|
208
|
+
.align-baseline {
|
|
209
|
+
align-items: baseline;
|
|
210
|
+
}
|
|
211
|
+
|
|
193
212
|
.align-end {
|
|
194
213
|
align-items: flex-end;
|
|
195
214
|
}
|
|
@@ -333,7 +352,9 @@ export class SfIEvents extends LitElement {
|
|
|
333
352
|
|
|
334
353
|
.calendar-item {
|
|
335
354
|
width: 20%;
|
|
336
|
-
margin:
|
|
355
|
+
margin: 1.5%;
|
|
356
|
+
padding: 1%;
|
|
357
|
+
border-radius: 10px;
|
|
337
358
|
}
|
|
338
359
|
|
|
339
360
|
}
|
|
@@ -391,7 +412,6 @@ export class SfIEvents extends LitElement {
|
|
|
391
412
|
|
|
392
413
|
getLastDayOfLastMonth = (month: number, year: number) => {
|
|
393
414
|
const date = new Date(year, month, 0);
|
|
394
|
-
console.log('last date of last month', month, date.getDate());
|
|
395
415
|
return date.getDate()
|
|
396
416
|
}
|
|
397
417
|
|
|
@@ -412,13 +432,13 @@ export class SfIEvents extends LitElement {
|
|
|
412
432
|
|
|
413
433
|
var html = "";
|
|
414
434
|
|
|
415
|
-
html += '<div class="d-flex align-
|
|
435
|
+
html += '<div class="d-flex align-baseline flex-grow flex-wrap">';
|
|
416
436
|
|
|
417
437
|
const dateNumber = this.getLastDayOfLastMonth(month, year);
|
|
418
438
|
|
|
419
439
|
for(var i = 0; i < this.getBlanks(month, year); i++) {
|
|
420
440
|
|
|
421
|
-
html += '<div class="day-item date-item-before">';
|
|
441
|
+
html += '<div class="day-item date-item-before fw-100">';
|
|
422
442
|
html += dateNumber-(this.getBlanks(month, year) - i - 1);
|
|
423
443
|
html += '</div>';
|
|
424
444
|
|
|
@@ -428,26 +448,31 @@ export class SfIEvents extends LitElement {
|
|
|
428
448
|
|
|
429
449
|
const mmdd = ("0" + (month+1)).slice(-2) + "/" + ("0" + (i+1)).slice(-2);
|
|
430
450
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
console.log('found not null event');
|
|
451
|
+
var partName = "";
|
|
434
452
|
|
|
435
|
-
|
|
436
|
-
|
|
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>'
|
|
437
462
|
html += '</div>';
|
|
438
|
-
|
|
439
463
|
} else {
|
|
440
|
-
|
|
441
|
-
html += '<div class="day-item date-item">';
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
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>';
|
|
445
470
|
}
|
|
446
471
|
|
|
447
472
|
}
|
|
448
473
|
|
|
449
474
|
for(i = 0; i < 42 - (this.getBlanks(month, year) + this.getLastDayOfMonth(month, year)); i++) {
|
|
450
|
-
html += '<div class="day-item date-item-before">';
|
|
475
|
+
html += '<div class="day-item date-item-before fw-100">';
|
|
451
476
|
html += (i+1);
|
|
452
477
|
html += '</div>';
|
|
453
478
|
}
|
|
@@ -464,31 +489,31 @@ export class SfIEvents extends LitElement {
|
|
|
464
489
|
|
|
465
490
|
html += '<div class="d-flex align-center flex-grow">';
|
|
466
491
|
|
|
467
|
-
html += '<div class="day-item">';
|
|
492
|
+
html += '<div class="day-item fw-100">';
|
|
468
493
|
html += 'S';
|
|
469
494
|
html += '</div>';
|
|
470
495
|
|
|
471
|
-
html += '<div class="day-item">';
|
|
496
|
+
html += '<div class="day-item fw-100">';
|
|
472
497
|
html += 'M';
|
|
473
498
|
html += '</div>';
|
|
474
499
|
|
|
475
|
-
html += '<div class="day-item">';
|
|
500
|
+
html += '<div class="day-item fw-100">';
|
|
476
501
|
html += 'T';
|
|
477
502
|
html += '</div>';
|
|
478
503
|
|
|
479
|
-
html += '<div class="day-item">';
|
|
504
|
+
html += '<div class="day-item fw-100">';
|
|
480
505
|
html += 'W';
|
|
481
506
|
html += '</div>';
|
|
482
507
|
|
|
483
|
-
html += '<div class="day-item">';
|
|
508
|
+
html += '<div class="day-item fw-100">';
|
|
484
509
|
html += 'T';
|
|
485
510
|
html += '</div>';
|
|
486
511
|
|
|
487
|
-
html += '<div class="day-item">';
|
|
512
|
+
html += '<div class="day-item fw-100">';
|
|
488
513
|
html += 'F';
|
|
489
514
|
html += '</div>';
|
|
490
515
|
|
|
491
|
-
html += '<div class="day-item">';
|
|
516
|
+
html += '<div class="day-item fw-100">';
|
|
492
517
|
html += 'S';
|
|
493
518
|
html += '</div>';
|
|
494
519
|
|
|
@@ -508,9 +533,9 @@ export class SfIEvents extends LitElement {
|
|
|
508
533
|
|
|
509
534
|
for(var i = 0; i < 12; i++) {
|
|
510
535
|
|
|
511
|
-
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">';
|
|
512
537
|
html += '<div class="d-flex">';
|
|
513
|
-
html += '<div class="title-item">' + this.monthNames[startDate.getMonth()] + ' ' + startDate.getFullYear() + '</div>';
|
|
538
|
+
html += '<div part="month-title" class="title-item">' + this.monthNames[startDate.getMonth()] + ' ' + startDate.getFullYear() + '</div>';
|
|
514
539
|
html += '</div>';
|
|
515
540
|
html += this.insertDayNames();
|
|
516
541
|
html += this.insertDates(startDate.getMonth(), startDate.getFullYear());
|
|
@@ -529,7 +554,7 @@ export class SfIEvents extends LitElement {
|
|
|
529
554
|
console.log('processing due date', value.duedate.replace(/['"]+/g, ''));
|
|
530
555
|
const duedateArr = value.duedate.replace(/['"]+/g, '').split(",") as Array<string>;
|
|
531
556
|
|
|
532
|
-
const startMonth = parseInt(this.calendarStartMM)
|
|
557
|
+
const startMonth = parseInt(this.calendarStartMM);
|
|
533
558
|
|
|
534
559
|
for(var i = 0; i < duedateArr.length; i++) {
|
|
535
560
|
|
|
@@ -543,9 +568,7 @@ export class SfIEvents extends LitElement {
|
|
|
543
568
|
|
|
544
569
|
while(true) {
|
|
545
570
|
|
|
546
|
-
|
|
547
|
-
break;
|
|
548
|
-
}
|
|
571
|
+
console.log('processing event',dateArr[2],dateArr[1],j);
|
|
549
572
|
|
|
550
573
|
const mmdd = ("0" +j).slice(-2) + "/" + ("0" + dateArr[0]).slice(-2);
|
|
551
574
|
|
|
@@ -554,9 +577,18 @@ export class SfIEvents extends LitElement {
|
|
|
554
577
|
}
|
|
555
578
|
this.events[mmdd] = value;
|
|
556
579
|
|
|
580
|
+
|
|
581
|
+
if(startMonth !== 12) {
|
|
582
|
+
|
|
583
|
+
if(j === (startMonth - 1)) {
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
|
|
557
589
|
j++;
|
|
558
590
|
|
|
559
|
-
if(j ===
|
|
591
|
+
if(j === 13) {
|
|
560
592
|
j = 0;
|
|
561
593
|
}
|
|
562
594
|
|
|
@@ -606,10 +638,12 @@ export class SfIEvents extends LitElement {
|
|
|
606
638
|
|
|
607
639
|
fetchList = async () => {
|
|
608
640
|
|
|
641
|
+
console.log('calendar fetching list');
|
|
642
|
+
|
|
609
643
|
const body: any = this.getApiBodyList();
|
|
610
644
|
let url = "https://"+this.apiIdList+".execute-api.us-east-1.amazonaws.com/test/" + this.apiMethodList;
|
|
611
645
|
|
|
612
|
-
console.log('events', url, body);
|
|
646
|
+
console.log('calendar events', url, body);
|
|
613
647
|
|
|
614
648
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
615
649
|
const xhr : any = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;
|
|
@@ -666,8 +700,13 @@ export class SfIEvents extends LitElement {
|
|
|
666
700
|
|
|
667
701
|
loadMode = async () => {
|
|
668
702
|
|
|
703
|
+
console.log('calendar load mode');
|
|
704
|
+
|
|
669
705
|
this.initInputs();
|
|
670
706
|
this.initCalendar();
|
|
707
|
+
|
|
708
|
+
console.log('calendar init done');
|
|
709
|
+
|
|
671
710
|
await this.fetchList();
|
|
672
711
|
this.renderCalendar();
|
|
673
712
|
|