@foxford/pdf-generator 1.1.0 → 1.1.1
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/build/cjs/index.js +182 -6
- package/build/es/index.js +182 -6
- package/build/umd/generator.js +1 -1
- package/build/worker/generator.worker.js +1 -1
- package/package.json +1 -1
package/build/cjs/index.js
CHANGED
|
@@ -121,7 +121,8 @@ Object.freeze({
|
|
|
121
121
|
letter: 'Letter',
|
|
122
122
|
attestation: 'Attestation',
|
|
123
123
|
custom: 'Certificate',
|
|
124
|
-
pupil_interactive_training: 'InteractiveTraining'
|
|
124
|
+
pupil_interactive_training: 'InteractiveTraining',
|
|
125
|
+
schedule: 'Schedule'
|
|
125
126
|
});
|
|
126
127
|
var DOCUMENT_NAME_MAP = Object.freeze({
|
|
127
128
|
diploma: 'Диплом',
|
|
@@ -135,7 +136,8 @@ var DOCUMENT_NAME_MAP = Object.freeze({
|
|
|
135
136
|
template: 'Сертификат',
|
|
136
137
|
attestation: 'Ведомость успеваемости',
|
|
137
138
|
letter: 'Благодарственное письмо',
|
|
138
|
-
pupil_interactive_training: 'Сертификат'
|
|
139
|
+
pupil_interactive_training: 'Сертификат',
|
|
140
|
+
schedule: 'Расписание'
|
|
139
141
|
});
|
|
140
142
|
var TITLE_KEY_PARAMS_MAP = {
|
|
141
143
|
diploma: 'params.resource.name',
|
|
@@ -149,7 +151,8 @@ var TITLE_KEY_PARAMS_MAP = {
|
|
|
149
151
|
template: 'params.resource.name',
|
|
150
152
|
letter: 'params.resource.title',
|
|
151
153
|
custom: 'params.resource.name',
|
|
152
|
-
pupil_interactive_training: 'params.resource.name'
|
|
154
|
+
pupil_interactive_training: 'params.resource.name',
|
|
155
|
+
schedule: 'params.resource.name'
|
|
153
156
|
};
|
|
154
157
|
var DOCUMENT_SIZES = {
|
|
155
158
|
A1: [841, 1189],
|
|
@@ -161,6 +164,29 @@ var DOCUMENT_SIZES = {
|
|
|
161
164
|
letter: [216, 280],
|
|
162
165
|
tabloid: [280, 432]
|
|
163
166
|
};
|
|
167
|
+
var DOCUMENT_CUSTOM_VIEWBOX = {
|
|
168
|
+
attestation: '0 0 794 1122',
|
|
169
|
+
schedule: null
|
|
170
|
+
};
|
|
171
|
+
var WEEK_DAYS = [{
|
|
172
|
+
text: 'Пн',
|
|
173
|
+
textFull: 'ПОНЕДЕЛЬНИК'
|
|
174
|
+
}, {
|
|
175
|
+
text: 'Вт',
|
|
176
|
+
textFull: 'ВТОРНИК'
|
|
177
|
+
}, {
|
|
178
|
+
text: 'Ср',
|
|
179
|
+
textFull: 'СРЕДА'
|
|
180
|
+
}, {
|
|
181
|
+
text: 'Чт',
|
|
182
|
+
textFull: 'ЧЕТВЕРГ'
|
|
183
|
+
}, {
|
|
184
|
+
text: 'Пт',
|
|
185
|
+
textFull: 'ПЯТНИЦА'
|
|
186
|
+
}, {
|
|
187
|
+
text: 'Сб',
|
|
188
|
+
textFull: 'СУББОТА'
|
|
189
|
+
}];
|
|
164
190
|
|
|
165
191
|
var _excluded$3 = ["resources"];
|
|
166
192
|
var SPLIT_REGEX = /\r?\n/;
|
|
@@ -27356,6 +27382,152 @@ var InteractiveTraining = /*#__PURE__*/React__default['default'].memo(function I
|
|
|
27356
27382
|
});
|
|
27357
27383
|
});
|
|
27358
27384
|
|
|
27385
|
+
var TABLE_WIDTH = 1120;
|
|
27386
|
+
var TIME_WIDTH = 56;
|
|
27387
|
+
var HEADER_HEIGHT = 48;
|
|
27388
|
+
var LINE_HEIGHT = 72;
|
|
27389
|
+
var LINE_PADDING = 20;
|
|
27390
|
+
var CELL_PADDING = 12;
|
|
27391
|
+
var T_PADDING = (TABLE_WIDTH - TIME_WIDTH) / WEEK_DAYS.length;
|
|
27392
|
+
var Schedule = /*#__PURE__*/React__default['default'].memo(function Schedule(_ref) {
|
|
27393
|
+
var document = _ref.document;
|
|
27394
|
+
var tablePositions = (document.params.items || []).reduce(function (acc, item) {
|
|
27395
|
+
var counts = item.lessons.reduce(function (counts, _ref2) {
|
|
27396
|
+
var weekDay = _ref2.weekDay;
|
|
27397
|
+
return counts[weekDay] ? _objectSpread2(_objectSpread2({}, counts), {}, _defineProperty({}, weekDay, counts[weekDay] + 1)) : _objectSpread2(_objectSpread2({}, counts), {}, _defineProperty({}, weekDay, 1));
|
|
27398
|
+
}, {});
|
|
27399
|
+
var maxInDayLessons = Object.values(counts).sort(function (a, b) {
|
|
27400
|
+
return b - a;
|
|
27401
|
+
})[0];
|
|
27402
|
+
var y = acc.reduce(function (partialSum, a) {
|
|
27403
|
+
return partialSum + a.lineHeight;
|
|
27404
|
+
}, 0);
|
|
27405
|
+
return [].concat(_toConsumableArray(acc), [{
|
|
27406
|
+
y: y ? y + HEADER_HEIGHT : HEADER_HEIGHT,
|
|
27407
|
+
lineHeight: LINE_HEIGHT * maxInDayLessons
|
|
27408
|
+
}]);
|
|
27409
|
+
}, []);
|
|
27410
|
+
return /*#__PURE__*/jsxRuntime.jsxs(React__default['default'].Fragment, {
|
|
27411
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
27412
|
+
x: "1",
|
|
27413
|
+
y: "1",
|
|
27414
|
+
width: "100%",
|
|
27415
|
+
height: "100%",
|
|
27416
|
+
fill: "#F6F7FB"
|
|
27417
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("g", {
|
|
27418
|
+
children: [WEEK_DAYS.map(function (_ref3, index) {
|
|
27419
|
+
var textFull = _ref3.textFull;
|
|
27420
|
+
return /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
27421
|
+
fill: "#818183",
|
|
27422
|
+
fontFamily: "CircleRegular",
|
|
27423
|
+
fontSize: "12",
|
|
27424
|
+
dy: HEADER_HEIGHT / 2,
|
|
27425
|
+
x: T_PADDING * index + TIME_WIDTH + CELL_PADDING,
|
|
27426
|
+
children: textFull
|
|
27427
|
+
}, index);
|
|
27428
|
+
}), (document.params.items || []).map(function (_ref4, i) {
|
|
27429
|
+
var time = _ref4.time;
|
|
27430
|
+
return /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
27431
|
+
fill: "#818183",
|
|
27432
|
+
fontFamily: "CircleRegular",
|
|
27433
|
+
fontSize: "14",
|
|
27434
|
+
dx: CELL_PADDING,
|
|
27435
|
+
dy: tablePositions[i].y + CELL_PADDING * 2,
|
|
27436
|
+
children: time
|
|
27437
|
+
}, "time_".concat(i));
|
|
27438
|
+
}), (document.params.items || []).map(function (_ref5, i) {
|
|
27439
|
+
var lessons = _ref5.lessons;
|
|
27440
|
+
return WEEK_DAYS.map(function (_, weekDayIndex) {
|
|
27441
|
+
var weekLessons = lessons.filter(function (_ref6) {
|
|
27442
|
+
var weekDay = _ref6.weekDay;
|
|
27443
|
+
return weekDay === weekDayIndex + 1;
|
|
27444
|
+
});
|
|
27445
|
+
if (weekLessons.length === 0) {
|
|
27446
|
+
return null;
|
|
27447
|
+
}
|
|
27448
|
+
return weekLessons.map(function (_ref7, lessonIndex) {
|
|
27449
|
+
var courseName = _ref7.courseName,
|
|
27450
|
+
teacherName = _ref7.teacherName;
|
|
27451
|
+
return /*#__PURE__*/jsxRuntime.jsxs(React__default['default'].Fragment, {
|
|
27452
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("clipPath", {
|
|
27453
|
+
id: "item_".concat(i, "_").concat(weekDayIndex, "_").concat(lessonIndex),
|
|
27454
|
+
children: /*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
27455
|
+
x: weekDayIndex * T_PADDING + TIME_WIDTH + CELL_PADDING,
|
|
27456
|
+
y: tablePositions[i].y,
|
|
27457
|
+
width: "150",
|
|
27458
|
+
height: tablePositions[i].lineHeight
|
|
27459
|
+
})
|
|
27460
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("text", {
|
|
27461
|
+
fontFamily: "CircleRegular",
|
|
27462
|
+
fontSize: "15",
|
|
27463
|
+
clipPath: "url(#".concat("item_".concat(i, "_").concat(weekDayIndex, "_").concat(lessonIndex), ")"),
|
|
27464
|
+
x: weekDayIndex * T_PADDING + TIME_WIDTH + CELL_PADDING,
|
|
27465
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("tspan", {
|
|
27466
|
+
dy: tablePositions[i].y + CELL_PADDING * 2 + lessonIndex * LINE_HEIGHT,
|
|
27467
|
+
fill: "#333333",
|
|
27468
|
+
children: courseName
|
|
27469
|
+
}), /*#__PURE__*/jsxRuntime.jsx("tspan", {
|
|
27470
|
+
fill: "#818183",
|
|
27471
|
+
x: weekDayIndex * T_PADDING + TIME_WIDTH + CELL_PADDING,
|
|
27472
|
+
dy: LINE_PADDING,
|
|
27473
|
+
children: teacherName
|
|
27474
|
+
})]
|
|
27475
|
+
})]
|
|
27476
|
+
}, "item_".concat(i, "_").concat(weekDayIndex, "_").concat(lessonIndex));
|
|
27477
|
+
});
|
|
27478
|
+
});
|
|
27479
|
+
})]
|
|
27480
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("g", {
|
|
27481
|
+
children: [WEEK_DAYS.map(function (_ref8, weekDayIndex) {
|
|
27482
|
+
_ref8.textFull;
|
|
27483
|
+
return /*#__PURE__*/jsxRuntime.jsx(React__default['default'].Fragment, {
|
|
27484
|
+
children: /*#__PURE__*/jsxRuntime.jsx("line", {
|
|
27485
|
+
x1: T_PADDING * weekDayIndex + TIME_WIDTH,
|
|
27486
|
+
y1: "0",
|
|
27487
|
+
x2: T_PADDING * weekDayIndex + TIME_WIDTH,
|
|
27488
|
+
y2: tablePositions.reduce(function (acc, position) {
|
|
27489
|
+
return acc + position.lineHeight;
|
|
27490
|
+
}, HEADER_HEIGHT),
|
|
27491
|
+
stroke: "#D4D4D4"
|
|
27492
|
+
})
|
|
27493
|
+
}, weekDayIndex);
|
|
27494
|
+
}), /*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
27495
|
+
x: "0",
|
|
27496
|
+
y: "0",
|
|
27497
|
+
width: "100%",
|
|
27498
|
+
height: HEADER_HEIGHT,
|
|
27499
|
+
style: {
|
|
27500
|
+
fill: 'none',
|
|
27501
|
+
stroke: '#D4D4D4',
|
|
27502
|
+
strokeWidth: 1,
|
|
27503
|
+
strokeLinecap: 'butt',
|
|
27504
|
+
strokeLinejoin: 'miter',
|
|
27505
|
+
strokeMiterlimit: 10,
|
|
27506
|
+
strokeDasharray: 'none',
|
|
27507
|
+
strokeOpacity: 1
|
|
27508
|
+
}
|
|
27509
|
+
}), (document.params.items || []).map(function (item, index) {
|
|
27510
|
+
return /*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
27511
|
+
x: "0",
|
|
27512
|
+
y: tablePositions[index].y,
|
|
27513
|
+
width: "100%",
|
|
27514
|
+
height: tablePositions[index].lineHeight,
|
|
27515
|
+
style: {
|
|
27516
|
+
fill: 'none',
|
|
27517
|
+
stroke: '#D4D4D4',
|
|
27518
|
+
strokeWidth: 1,
|
|
27519
|
+
strokeLinecap: 'butt',
|
|
27520
|
+
strokeLinejoin: 'miter',
|
|
27521
|
+
strokeMiterlimit: 10,
|
|
27522
|
+
strokeDasharray: 'none',
|
|
27523
|
+
strokeOpacity: 1
|
|
27524
|
+
}
|
|
27525
|
+
}, "item_rect_".concat(index));
|
|
27526
|
+
})]
|
|
27527
|
+
})]
|
|
27528
|
+
});
|
|
27529
|
+
});
|
|
27530
|
+
|
|
27359
27531
|
function _classCallCheck$1(instance, Constructor) {
|
|
27360
27532
|
if (!(instance instanceof Constructor)) {
|
|
27361
27533
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -27856,7 +28028,7 @@ function withLayout(WrapperComponent) {
|
|
|
27856
28028
|
id: "certificatePortraitTemlate",
|
|
27857
28029
|
width: "".concat(width, "mm"),
|
|
27858
28030
|
height: "".concat(height, "mm"),
|
|
27859
|
-
viewBox:
|
|
28031
|
+
viewBox: DOCUMENT_CUSTOM_VIEWBOX[document.kind] !== undefined ? DOCUMENT_CUSTOM_VIEWBOX[document.kind] : "0 0 ".concat(width, " ").concat(height),
|
|
27860
28032
|
xmlSpace: "preserve",
|
|
27861
28033
|
orientation: meta.layout,
|
|
27862
28034
|
children: /*#__PURE__*/jsxRuntime.jsx(WrapperComponent, _objectSpread2({
|
|
@@ -27877,6 +28049,7 @@ var cl = withLayout(withStyle(Letter));
|
|
|
27877
28049
|
var cu = withLayout(withStyle(Custom));
|
|
27878
28050
|
var at = withLayout(withStyle(Attestation));
|
|
27879
28051
|
var it = withLayout(withStyle(InteractiveTraining));
|
|
28052
|
+
var sc = withLayout(withStyle(Schedule));
|
|
27880
28053
|
|
|
27881
28054
|
var TEMPLATE_MAP = [{
|
|
27882
28055
|
kind: 'diploma',
|
|
@@ -27914,6 +28087,9 @@ var TEMPLATE_MAP = [{
|
|
|
27914
28087
|
}, {
|
|
27915
28088
|
kind: 'custom',
|
|
27916
28089
|
template: cu
|
|
28090
|
+
}, {
|
|
28091
|
+
kind: 'schedule',
|
|
28092
|
+
template: sc
|
|
27917
28093
|
}];
|
|
27918
28094
|
var getDocumentTemplate = function getDocumentTemplate(alias) {
|
|
27919
28095
|
return TEMPLATE_MAP.filter(function (item) {
|
|
@@ -28270,7 +28446,7 @@ var initialState = function () {
|
|
|
28270
28446
|
resources: []
|
|
28271
28447
|
};
|
|
28272
28448
|
}();
|
|
28273
|
-
var workerUrl = "https://dist.ngcdn.ru" + "/libs/pdf-generator/" + "1.1.
|
|
28449
|
+
var workerUrl = "https://dist.ngcdn.ru" + "/libs/pdf-generator/" + "1.1.1" + '/' + "generator.worker.js";
|
|
28274
28450
|
var Generator = /*#__PURE__*/function (_React$Component) {
|
|
28275
28451
|
_inherits$1(Generator, _React$Component);
|
|
28276
28452
|
var _super = _createSuper(Generator);
|
|
@@ -28938,7 +29114,7 @@ var WebDocument = /*#__PURE__*/_createClass$1(function WebDocument(params) {
|
|
|
28938
29114
|
this._onError = params.onError || null;
|
|
28939
29115
|
this.info = {};
|
|
28940
29116
|
this._fonts = [];
|
|
28941
|
-
this.workerUrl = "https://dist.ngcdn.ru" + "/libs/pdf-generator/" + "1.1.
|
|
29117
|
+
this.workerUrl = "https://dist.ngcdn.ru" + "/libs/pdf-generator/" + "1.1.1" + '/' + "generator.worker.js";
|
|
28942
29118
|
});
|
|
28943
29119
|
var createDocument = function createDocument(data) {
|
|
28944
29120
|
return new WebDocument(data);
|
package/build/es/index.js
CHANGED
|
@@ -85,7 +85,8 @@ Object.freeze({
|
|
|
85
85
|
letter: 'Letter',
|
|
86
86
|
attestation: 'Attestation',
|
|
87
87
|
custom: 'Certificate',
|
|
88
|
-
pupil_interactive_training: 'InteractiveTraining'
|
|
88
|
+
pupil_interactive_training: 'InteractiveTraining',
|
|
89
|
+
schedule: 'Schedule'
|
|
89
90
|
});
|
|
90
91
|
var DOCUMENT_NAME_MAP = Object.freeze({
|
|
91
92
|
diploma: 'Диплом',
|
|
@@ -99,7 +100,8 @@ var DOCUMENT_NAME_MAP = Object.freeze({
|
|
|
99
100
|
template: 'Сертификат',
|
|
100
101
|
attestation: 'Ведомость успеваемости',
|
|
101
102
|
letter: 'Благодарственное письмо',
|
|
102
|
-
pupil_interactive_training: 'Сертификат'
|
|
103
|
+
pupil_interactive_training: 'Сертификат',
|
|
104
|
+
schedule: 'Расписание'
|
|
103
105
|
});
|
|
104
106
|
var TITLE_KEY_PARAMS_MAP = {
|
|
105
107
|
diploma: 'params.resource.name',
|
|
@@ -113,7 +115,8 @@ var TITLE_KEY_PARAMS_MAP = {
|
|
|
113
115
|
template: 'params.resource.name',
|
|
114
116
|
letter: 'params.resource.title',
|
|
115
117
|
custom: 'params.resource.name',
|
|
116
|
-
pupil_interactive_training: 'params.resource.name'
|
|
118
|
+
pupil_interactive_training: 'params.resource.name',
|
|
119
|
+
schedule: 'params.resource.name'
|
|
117
120
|
};
|
|
118
121
|
var DOCUMENT_SIZES = {
|
|
119
122
|
A1: [841, 1189],
|
|
@@ -125,6 +128,29 @@ var DOCUMENT_SIZES = {
|
|
|
125
128
|
letter: [216, 280],
|
|
126
129
|
tabloid: [280, 432]
|
|
127
130
|
};
|
|
131
|
+
var DOCUMENT_CUSTOM_VIEWBOX = {
|
|
132
|
+
attestation: '0 0 794 1122',
|
|
133
|
+
schedule: null
|
|
134
|
+
};
|
|
135
|
+
var WEEK_DAYS = [{
|
|
136
|
+
text: 'Пн',
|
|
137
|
+
textFull: 'ПОНЕДЕЛЬНИК'
|
|
138
|
+
}, {
|
|
139
|
+
text: 'Вт',
|
|
140
|
+
textFull: 'ВТОРНИК'
|
|
141
|
+
}, {
|
|
142
|
+
text: 'Ср',
|
|
143
|
+
textFull: 'СРЕДА'
|
|
144
|
+
}, {
|
|
145
|
+
text: 'Чт',
|
|
146
|
+
textFull: 'ЧЕТВЕРГ'
|
|
147
|
+
}, {
|
|
148
|
+
text: 'Пт',
|
|
149
|
+
textFull: 'ПЯТНИЦА'
|
|
150
|
+
}, {
|
|
151
|
+
text: 'Сб',
|
|
152
|
+
textFull: 'СУББОТА'
|
|
153
|
+
}];
|
|
128
154
|
|
|
129
155
|
var _excluded$3 = ["resources"];
|
|
130
156
|
var SPLIT_REGEX = /\r?\n/;
|
|
@@ -27320,6 +27346,152 @@ var InteractiveTraining = /*#__PURE__*/React__default.memo(function InteractiveT
|
|
|
27320
27346
|
});
|
|
27321
27347
|
});
|
|
27322
27348
|
|
|
27349
|
+
var TABLE_WIDTH = 1120;
|
|
27350
|
+
var TIME_WIDTH = 56;
|
|
27351
|
+
var HEADER_HEIGHT = 48;
|
|
27352
|
+
var LINE_HEIGHT = 72;
|
|
27353
|
+
var LINE_PADDING = 20;
|
|
27354
|
+
var CELL_PADDING = 12;
|
|
27355
|
+
var T_PADDING = (TABLE_WIDTH - TIME_WIDTH) / WEEK_DAYS.length;
|
|
27356
|
+
var Schedule = /*#__PURE__*/React__default.memo(function Schedule(_ref) {
|
|
27357
|
+
var document = _ref.document;
|
|
27358
|
+
var tablePositions = (document.params.items || []).reduce(function (acc, item) {
|
|
27359
|
+
var counts = item.lessons.reduce(function (counts, _ref2) {
|
|
27360
|
+
var weekDay = _ref2.weekDay;
|
|
27361
|
+
return counts[weekDay] ? _objectSpread2(_objectSpread2({}, counts), {}, _defineProperty({}, weekDay, counts[weekDay] + 1)) : _objectSpread2(_objectSpread2({}, counts), {}, _defineProperty({}, weekDay, 1));
|
|
27362
|
+
}, {});
|
|
27363
|
+
var maxInDayLessons = Object.values(counts).sort(function (a, b) {
|
|
27364
|
+
return b - a;
|
|
27365
|
+
})[0];
|
|
27366
|
+
var y = acc.reduce(function (partialSum, a) {
|
|
27367
|
+
return partialSum + a.lineHeight;
|
|
27368
|
+
}, 0);
|
|
27369
|
+
return [].concat(_toConsumableArray(acc), [{
|
|
27370
|
+
y: y ? y + HEADER_HEIGHT : HEADER_HEIGHT,
|
|
27371
|
+
lineHeight: LINE_HEIGHT * maxInDayLessons
|
|
27372
|
+
}]);
|
|
27373
|
+
}, []);
|
|
27374
|
+
return /*#__PURE__*/jsxs(React__default.Fragment, {
|
|
27375
|
+
children: [/*#__PURE__*/jsx("rect", {
|
|
27376
|
+
x: "1",
|
|
27377
|
+
y: "1",
|
|
27378
|
+
width: "100%",
|
|
27379
|
+
height: "100%",
|
|
27380
|
+
fill: "#F6F7FB"
|
|
27381
|
+
}), /*#__PURE__*/jsxs("g", {
|
|
27382
|
+
children: [WEEK_DAYS.map(function (_ref3, index) {
|
|
27383
|
+
var textFull = _ref3.textFull;
|
|
27384
|
+
return /*#__PURE__*/jsx("text", {
|
|
27385
|
+
fill: "#818183",
|
|
27386
|
+
fontFamily: "CircleRegular",
|
|
27387
|
+
fontSize: "12",
|
|
27388
|
+
dy: HEADER_HEIGHT / 2,
|
|
27389
|
+
x: T_PADDING * index + TIME_WIDTH + CELL_PADDING,
|
|
27390
|
+
children: textFull
|
|
27391
|
+
}, index);
|
|
27392
|
+
}), (document.params.items || []).map(function (_ref4, i) {
|
|
27393
|
+
var time = _ref4.time;
|
|
27394
|
+
return /*#__PURE__*/jsx("text", {
|
|
27395
|
+
fill: "#818183",
|
|
27396
|
+
fontFamily: "CircleRegular",
|
|
27397
|
+
fontSize: "14",
|
|
27398
|
+
dx: CELL_PADDING,
|
|
27399
|
+
dy: tablePositions[i].y + CELL_PADDING * 2,
|
|
27400
|
+
children: time
|
|
27401
|
+
}, "time_".concat(i));
|
|
27402
|
+
}), (document.params.items || []).map(function (_ref5, i) {
|
|
27403
|
+
var lessons = _ref5.lessons;
|
|
27404
|
+
return WEEK_DAYS.map(function (_, weekDayIndex) {
|
|
27405
|
+
var weekLessons = lessons.filter(function (_ref6) {
|
|
27406
|
+
var weekDay = _ref6.weekDay;
|
|
27407
|
+
return weekDay === weekDayIndex + 1;
|
|
27408
|
+
});
|
|
27409
|
+
if (weekLessons.length === 0) {
|
|
27410
|
+
return null;
|
|
27411
|
+
}
|
|
27412
|
+
return weekLessons.map(function (_ref7, lessonIndex) {
|
|
27413
|
+
var courseName = _ref7.courseName,
|
|
27414
|
+
teacherName = _ref7.teacherName;
|
|
27415
|
+
return /*#__PURE__*/jsxs(React__default.Fragment, {
|
|
27416
|
+
children: [/*#__PURE__*/jsx("clipPath", {
|
|
27417
|
+
id: "item_".concat(i, "_").concat(weekDayIndex, "_").concat(lessonIndex),
|
|
27418
|
+
children: /*#__PURE__*/jsx("rect", {
|
|
27419
|
+
x: weekDayIndex * T_PADDING + TIME_WIDTH + CELL_PADDING,
|
|
27420
|
+
y: tablePositions[i].y,
|
|
27421
|
+
width: "150",
|
|
27422
|
+
height: tablePositions[i].lineHeight
|
|
27423
|
+
})
|
|
27424
|
+
}), /*#__PURE__*/jsxs("text", {
|
|
27425
|
+
fontFamily: "CircleRegular",
|
|
27426
|
+
fontSize: "15",
|
|
27427
|
+
clipPath: "url(#".concat("item_".concat(i, "_").concat(weekDayIndex, "_").concat(lessonIndex), ")"),
|
|
27428
|
+
x: weekDayIndex * T_PADDING + TIME_WIDTH + CELL_PADDING,
|
|
27429
|
+
children: [/*#__PURE__*/jsx("tspan", {
|
|
27430
|
+
dy: tablePositions[i].y + CELL_PADDING * 2 + lessonIndex * LINE_HEIGHT,
|
|
27431
|
+
fill: "#333333",
|
|
27432
|
+
children: courseName
|
|
27433
|
+
}), /*#__PURE__*/jsx("tspan", {
|
|
27434
|
+
fill: "#818183",
|
|
27435
|
+
x: weekDayIndex * T_PADDING + TIME_WIDTH + CELL_PADDING,
|
|
27436
|
+
dy: LINE_PADDING,
|
|
27437
|
+
children: teacherName
|
|
27438
|
+
})]
|
|
27439
|
+
})]
|
|
27440
|
+
}, "item_".concat(i, "_").concat(weekDayIndex, "_").concat(lessonIndex));
|
|
27441
|
+
});
|
|
27442
|
+
});
|
|
27443
|
+
})]
|
|
27444
|
+
}), /*#__PURE__*/jsxs("g", {
|
|
27445
|
+
children: [WEEK_DAYS.map(function (_ref8, weekDayIndex) {
|
|
27446
|
+
_ref8.textFull;
|
|
27447
|
+
return /*#__PURE__*/jsx(React__default.Fragment, {
|
|
27448
|
+
children: /*#__PURE__*/jsx("line", {
|
|
27449
|
+
x1: T_PADDING * weekDayIndex + TIME_WIDTH,
|
|
27450
|
+
y1: "0",
|
|
27451
|
+
x2: T_PADDING * weekDayIndex + TIME_WIDTH,
|
|
27452
|
+
y2: tablePositions.reduce(function (acc, position) {
|
|
27453
|
+
return acc + position.lineHeight;
|
|
27454
|
+
}, HEADER_HEIGHT),
|
|
27455
|
+
stroke: "#D4D4D4"
|
|
27456
|
+
})
|
|
27457
|
+
}, weekDayIndex);
|
|
27458
|
+
}), /*#__PURE__*/jsx("rect", {
|
|
27459
|
+
x: "0",
|
|
27460
|
+
y: "0",
|
|
27461
|
+
width: "100%",
|
|
27462
|
+
height: HEADER_HEIGHT,
|
|
27463
|
+
style: {
|
|
27464
|
+
fill: 'none',
|
|
27465
|
+
stroke: '#D4D4D4',
|
|
27466
|
+
strokeWidth: 1,
|
|
27467
|
+
strokeLinecap: 'butt',
|
|
27468
|
+
strokeLinejoin: 'miter',
|
|
27469
|
+
strokeMiterlimit: 10,
|
|
27470
|
+
strokeDasharray: 'none',
|
|
27471
|
+
strokeOpacity: 1
|
|
27472
|
+
}
|
|
27473
|
+
}), (document.params.items || []).map(function (item, index) {
|
|
27474
|
+
return /*#__PURE__*/jsx("rect", {
|
|
27475
|
+
x: "0",
|
|
27476
|
+
y: tablePositions[index].y,
|
|
27477
|
+
width: "100%",
|
|
27478
|
+
height: tablePositions[index].lineHeight,
|
|
27479
|
+
style: {
|
|
27480
|
+
fill: 'none',
|
|
27481
|
+
stroke: '#D4D4D4',
|
|
27482
|
+
strokeWidth: 1,
|
|
27483
|
+
strokeLinecap: 'butt',
|
|
27484
|
+
strokeLinejoin: 'miter',
|
|
27485
|
+
strokeMiterlimit: 10,
|
|
27486
|
+
strokeDasharray: 'none',
|
|
27487
|
+
strokeOpacity: 1
|
|
27488
|
+
}
|
|
27489
|
+
}, "item_rect_".concat(index));
|
|
27490
|
+
})]
|
|
27491
|
+
})]
|
|
27492
|
+
});
|
|
27493
|
+
});
|
|
27494
|
+
|
|
27323
27495
|
function _classCallCheck$1(instance, Constructor) {
|
|
27324
27496
|
if (!(instance instanceof Constructor)) {
|
|
27325
27497
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -27820,7 +27992,7 @@ function withLayout(WrapperComponent) {
|
|
|
27820
27992
|
id: "certificatePortraitTemlate",
|
|
27821
27993
|
width: "".concat(width, "mm"),
|
|
27822
27994
|
height: "".concat(height, "mm"),
|
|
27823
|
-
viewBox:
|
|
27995
|
+
viewBox: DOCUMENT_CUSTOM_VIEWBOX[document.kind] !== undefined ? DOCUMENT_CUSTOM_VIEWBOX[document.kind] : "0 0 ".concat(width, " ").concat(height),
|
|
27824
27996
|
xmlSpace: "preserve",
|
|
27825
27997
|
orientation: meta.layout,
|
|
27826
27998
|
children: /*#__PURE__*/jsx(WrapperComponent, _objectSpread2({
|
|
@@ -27841,6 +28013,7 @@ var cl = withLayout(withStyle(Letter));
|
|
|
27841
28013
|
var cu = withLayout(withStyle(Custom));
|
|
27842
28014
|
var at = withLayout(withStyle(Attestation));
|
|
27843
28015
|
var it = withLayout(withStyle(InteractiveTraining));
|
|
28016
|
+
var sc = withLayout(withStyle(Schedule));
|
|
27844
28017
|
|
|
27845
28018
|
var TEMPLATE_MAP = [{
|
|
27846
28019
|
kind: 'diploma',
|
|
@@ -27878,6 +28051,9 @@ var TEMPLATE_MAP = [{
|
|
|
27878
28051
|
}, {
|
|
27879
28052
|
kind: 'custom',
|
|
27880
28053
|
template: cu
|
|
28054
|
+
}, {
|
|
28055
|
+
kind: 'schedule',
|
|
28056
|
+
template: sc
|
|
27881
28057
|
}];
|
|
27882
28058
|
var getDocumentTemplate = function getDocumentTemplate(alias) {
|
|
27883
28059
|
return TEMPLATE_MAP.filter(function (item) {
|
|
@@ -28234,7 +28410,7 @@ var initialState = function () {
|
|
|
28234
28410
|
resources: []
|
|
28235
28411
|
};
|
|
28236
28412
|
}();
|
|
28237
|
-
var workerUrl = "https://dist.ngcdn.ru" + "/libs/pdf-generator/" + "1.1.
|
|
28413
|
+
var workerUrl = "https://dist.ngcdn.ru" + "/libs/pdf-generator/" + "1.1.1" + '/' + "generator.worker.js";
|
|
28238
28414
|
var Generator = /*#__PURE__*/function (_React$Component) {
|
|
28239
28415
|
_inherits$1(Generator, _React$Component);
|
|
28240
28416
|
var _super = _createSuper(Generator);
|
|
@@ -28902,7 +29078,7 @@ var WebDocument = /*#__PURE__*/_createClass$1(function WebDocument(params) {
|
|
|
28902
29078
|
this._onError = params.onError || null;
|
|
28903
29079
|
this.info = {};
|
|
28904
29080
|
this._fonts = [];
|
|
28905
|
-
this.workerUrl = "https://dist.ngcdn.ru" + "/libs/pdf-generator/" + "1.1.
|
|
29081
|
+
this.workerUrl = "https://dist.ngcdn.ru" + "/libs/pdf-generator/" + "1.1.1" + '/' + "generator.worker.js";
|
|
28906
29082
|
});
|
|
28907
29083
|
var createDocument = function createDocument(data) {
|
|
28908
29084
|
return new WebDocument(data);
|