ros.grant.common 2.0.1628 → 2.0.1630

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.
@@ -24,6 +24,26 @@ class LocalizedAirStrings {
24
24
  'ru': 'гггг',
25
25
  'en': 'yyyy'
26
26
  }
27
+ },
28
+ locale: {
29
+ 'ru': {
30
+ days: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'],
31
+ daysShort: ['Вос','Пон','Вто','Сре','Чет','Пят','Суб'],
32
+ daysMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
33
+ months: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
34
+ monthsShort: ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'],
35
+ today: 'Сегодня',
36
+ clear: 'Очистить',
37
+ },
38
+ 'en': {
39
+ days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
40
+ daysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
41
+ daysMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
42
+ months: ['January','February','March','April','May','June', 'July','August','September','October','November','December'],
43
+ monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
44
+ today: 'Today',
45
+ clear: 'Clear',
46
+ }
27
47
  }
28
48
  }
29
49
 
@@ -46,6 +66,10 @@ class LocalizedAirStrings {
46
66
  public get getYears(): string {
47
67
  return this._strings.placeholder.years[this._locale]
48
68
  }
69
+
70
+ public get getLocaleStrings() {
71
+ return this._strings.locale[this._locale]
72
+ }
49
73
  }
50
74
 
51
75
  function InitAirDateTimePickers() {
@@ -60,8 +84,11 @@ class AirDateTimePickerInitializer {
60
84
  private static view: string;
61
85
  private static defaultDateMask: string = 'DD.MM.YYYY';
62
86
  private static defaultConvertedDateMask: string = 'YYYY-MM-DD';
87
+ private static localizedAirStrings
63
88
 
64
89
  public static init() {
90
+ this.localizedAirStrings = new LocalizedAirStrings()
91
+
65
92
  $('.custom-air-date-time input').each((i, item) => {
66
93
  let attr = $(item).data();
67
94
  let datepicker = ($(item) as any).datepicker().data('datepicker');
@@ -70,6 +97,7 @@ class AirDateTimePickerInitializer {
70
97
  AirDateTimePickerInitializer.initInputMask(item);
71
98
  AirDateTimePickerInitializer.validateItem(item, attr, datepicker);
72
99
  });
100
+ new LocalizedAirStrings()
73
101
  }
74
102
 
75
103
  public static initItem(selector) {
@@ -87,27 +115,26 @@ class AirDateTimePickerInitializer {
87
115
  let isTime: boolean = this.stringToBooleanFormat($(input).attr('data-timepicker'));
88
116
  let mask: string;
89
117
  let placeholder: string;
90
- let localizedAirStrings = new LocalizedAirStrings()
91
118
 
92
119
  if (this.view == 'days') {
93
120
  if (isTime) {
94
121
  mask = '99.99.9999 99:99';
95
- placeholder = localizedAirStrings.getTimes;
122
+ placeholder = this.localizedAirStrings.getTimes;
96
123
  }
97
124
  else {
98
125
  mask = '99.99.9999';
99
- placeholder = localizedAirStrings.getDays;
126
+ placeholder = this.localizedAirStrings.getDays;
100
127
  }
101
128
  }
102
129
 
103
130
  if (this.view == 'months') {
104
131
  mask = '99.9999';
105
- placeholder = localizedAirStrings.getMonth;
132
+ placeholder = this.localizedAirStrings.getMonth;
106
133
  }
107
134
 
108
135
  if (this.view == 'years') {
109
136
  mask = '9999';
110
- placeholder = localizedAirStrings.getYears;
137
+ placeholder = this.localizedAirStrings.getYears;
111
138
  }
112
139
 
113
140
  ($(input) as any).inputmask({
@@ -120,7 +147,7 @@ class AirDateTimePickerInitializer {
120
147
 
121
148
  public static initElement(dateTimeElement: any, attr: any, datepicker: any) {
122
149
  let { dateMask, toFormatDateMask } = AirDateTimePickerInitializer.GetAttrDateMask(attr);
123
- let { dateMin, dateMax } = AirDateTimePickerInitializer.GetAttrDateMinAndMax(attr, dateMask, toFormatDateMask);
150
+ let {dateMin, dateMax} = AirDateTimePickerInitializer.GetAttrDateMinAndMax(attr, dateMask, toFormatDateMask);
124
151
 
125
152
  this.minHoursAbsolute = parseInt(attr.minHours) || 0;
126
153
  this.maxHoursAbsolute = parseInt(attr.maxHours) || 23;
@@ -148,6 +175,7 @@ class AirDateTimePickerInitializer {
148
175
  minHours: this.minHoursAbsolute,
149
176
  maxHours: this.maxHoursAbsolute,
150
177
  todayButton: todayButtonDate,
178
+ language: this.localizedAirStrings.getLocaleStrings,
151
179
  onSelect: function (formattedDate, date, inst) {
152
180
  if (date) {
153
181
  if (inst.timepicker) {
@@ -288,12 +316,12 @@ class AirDateTimePickerInitializer {
288
316
 
289
317
  if (attr.view === 'days') {
290
318
  if (attr.dateMin) {
291
- let formatDate = moment(attr.dateMin, dateMask).format(toFormatDateMask);
319
+ let formatDate = moment(new Date(attr.dateMin)).format(toFormatDateMask);
292
320
  dateMin = new Date(formatDate);
293
321
  }
294
322
 
295
323
  if (attr.dateMax) {
296
- let formatDate = moment(attr.dateMax, dateMask).format(toFormatDateMask);
324
+ let formatDate = moment(new Date(attr.dateMax)).format(toFormatDateMask);
297
325
  dateMax = new Date(formatDate);
298
326
  }
299
327
  }
@@ -8,7 +8,7 @@ class LocalizedAjaxStrings {
8
8
  messages: {
9
9
  success: {
10
10
  'ru': 'Успешное выполнение',
11
- 'en': 'Success'
11
+ 'en': 'Completion successful'
12
12
  }
13
13
  }
14
14
  }
@@ -9,6 +9,48 @@ $(document).ready(function () {
9
9
  });
10
10
  });
11
11
 
12
+ class LocalizedFileStrings {
13
+ _locale = 'ru'
14
+ _strings = {
15
+ placeholder: {
16
+ 'ru': 'Перенесите файл с устройства или нажмите на данное поле для добавления файла',
17
+ 'en': 'Transfer a file or click this field to add a file.'
18
+ },
19
+ maxSizePlaseholder: {
20
+ 'ru': 'Размер файла: не больше',
21
+ 'en': 'File size: up to'
22
+ },
23
+ formatPlaseholder: {
24
+ 'ru': 'Расширение файла:',
25
+ 'en': 'Allowed file extensions:'
26
+ },
27
+ sizes: {
28
+ 'ru': [' Кбайт', ' Мбайт', ' Гбайт', ' Тбайт', ' Пбайт', ' Эбайт'],
29
+ 'en': [' KB', ' MB', ' GB', ' TB', ' PB', ' EB']
30
+ }
31
+ }
32
+
33
+ constructor() {
34
+ this._locale = $('.page-wrapper').data('lang') || 'ru'
35
+ }
36
+
37
+ get getPlaceholder() {
38
+ return this._strings.placeholder[this._locale]
39
+ }
40
+
41
+ get getMaxSizePlaseholder() {
42
+ return this._strings.maxSizePlaseholder[this._locale]
43
+ }
44
+
45
+ get getFormatPlaseholder() {
46
+ return this._strings.formatPlaseholder[this._locale]
47
+ }
48
+
49
+ get getSizes() {
50
+ return this._strings.sizes[this._locale]
51
+ }
52
+ }
53
+
12
54
  function InitCustomFileInputs() {
13
55
  if (window.invokeInitCustomFileInputs) {
14
56
  $('.custom-file-input').each(initCustomFileInput);
@@ -35,7 +77,7 @@ function initCustomFileInputv1(index, fileInput, blazorComponent) {
35
77
  request: {
36
78
  inputName: fileInput.dataset.fileInputName,
37
79
  endpoint: fileInput.dataset.endPoint,
38
- customHeaders: { RequestVerificationToken: fileInput.dataset.requestVerificationToken },
80
+ customHeaders: {RequestVerificationToken: fileInput.dataset.requestVerificationToken},
39
81
  params: formValues
40
82
  },
41
83
  deleteFile: {
@@ -44,7 +86,7 @@ function initCustomFileInputv1(index, fileInput, blazorComponent) {
44
86
  confirmMessage: "Вы уверены, что хотите удалить этот файл?",
45
87
  deletingFailedText: "При удалении произошла ошибка",
46
88
  deletingStatusText: "Удаление..",
47
- customHeaders: { RequestVerificationToken: fileInput.dataset.requestVerificationToken },
89
+ customHeaders: {RequestVerificationToken: fileInput.dataset.requestVerificationToken},
48
90
  method: "POST",
49
91
  params: formValues
50
92
  },
@@ -74,25 +116,25 @@ function initCustomFileInputv1(index, fileInput, blazorComponent) {
74
116
  callbacks: {
75
117
  onDeleteComplete: function (id, xhr, isError) {
76
118
  if (blazorComponent) {
77
- blazorComponent.invokeMethodAsync("NotifyDeleteComplete", { fileId: xhr.qquuid, isError: isError });
78
- }
79
- else {
119
+ blazorComponent.invokeMethodAsync("NotifyDeleteComplete", {fileId: xhr.qquuid, isError: isError});
120
+ } else {
80
121
  $(fileInput).trigger("file-uploader-on-delete-complete", [fileInput, id, xhr, isError]);
81
122
  }
82
123
  },
83
124
  onComplete: function (id, name, responseJSON, xhr) {
84
125
  if (blazorComponent) {
85
- blazorComponent.invokeMethodAsync("NotifyComplete", { name: name });
86
- }
87
- else {
126
+ blazorComponent.invokeMethodAsync("NotifyComplete", {name: name});
127
+ } else {
88
128
  $(fileInput).trigger("file-uploader-on-complete", [fileInput, id, name, responseJSON, xhr]);
89
129
  }
90
130
 
91
131
  if (responseJSON.success) {
92
132
  if (blazorComponent) {
93
- blazorComponent.invokeMethodAsync("NotifyCompleteSuccess", { fileId: responseJSON.uuid, name: name });
94
- }
95
- else {
133
+ blazorComponent.invokeMethodAsync("NotifyCompleteSuccess", {
134
+ fileId: responseJSON.uuid,
135
+ name: name
136
+ });
137
+ } else {
96
138
  $(fileInput).trigger("file-uploader-on-complete-success", [fileInput, id, name, responseJSON, xhr]);
97
139
  }
98
140
 
@@ -128,78 +170,85 @@ function initCustomFileInputv2(index, fileInput, blazorComponent) {
128
170
  }
129
171
  var maxFileSizeMb = fileInput.dataset.maxSize / 1024 / 1024;
130
172
  var modal = $('#custom-file-input-modal');
173
+
174
+ var html = document.createElement('div')
175
+
176
+ var localizedFileStrings = new LocalizedFileStrings()
177
+
131
178
  if (modal.length == 0) {
132
- $('.page-wrapper').append("\
133
- <div class='new-custom-file-input-data'>\
134
- <div id='custom-file-input-modal' modal-size='2' class='modal sm'>\
135
- <div class='modal-content'>\
136
- <div class='modal-header'>\
137
- <div class='modal-title uppercase'><H4>Ошибка загрузки файла</H4></div>\
138
- <span class='close close-click'> <svg width='14' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M13 1L1 13M1 1l12 12' stroke='#3A3A3A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg></span>\
139
- </div>\
140
- <div class='modal-body'>\
141
- <span class='dialog_label text-center d-block'></span>\
142
- </div>\
143
- </div>\
144
- </div>\
145
- <script type='text/template' id='qq-new-custom-file-template'>\
146
- <div class='qq-uploader-selector new-qq-uploader-selector'>\
147
- <ul class='qq-upload-list-selector qq-upload-list new-custom-file-input' role='region' aria-live='polite' aria-relevant='additions removals'>\
148
- <li class='new-custom-file-input__item'>\
149
- <span role='status' class='qq-upload-status-text-selector qq-upload-status-text'></span>\
150
- <a class='qq-download-link'></a>\
151
- <div class='qq-file-info'>\
152
- <div class='qq-file-name'>\
153
- <span class='qq-upload-file-selector qq-upload-file'></span>\
154
- </div>\
155
- <div class='info'>\
156
- <span class='qq-upload-size-selector qq-upload-size'>29.8 Мбайт</span>\
157
- <button type='button' class='qq-btn qq-upload-delete-selector qq-upload-delete'>\
158
- <span class='qq-btn qq-delete-icon' aria-label='Удалить'></span>\
159
- </button>\
160
- </div>\
161
- </div>\
162
- </li>\
163
- </ul>\
164
- <div class='qq-uploader-selector qq-uploader qq-gallery'>\
165
- <div class='qq-loading'>\
166
- <svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px'\
167
- width='24px' height='30px' viewBox='0 0 24 30' style='enable-background:new 0 0 50 50;' xml:space='preserve'>\
168
- <rect x='0' y='10' width='4' height='10' fill='#333' opacity='0.2'>\
169
- <animate attributeName='opacity' attributeType='XML' values='0.2; 1; .2' begin='0s' dur='0.6s' repeatCount='indefinite' />\
170
- <animate attributeName='height' attributeType='XML' values='10; 20; 10' begin='0s' dur='0.6s' repeatCount='indefinite' />\
171
- <animate attributeName='y' attributeType='XML' values='10; 5; 10' begin='0s' dur='0.6s' repeatCount='indefinite' />\
172
- </rect>\
173
- <rect x='8' y='10' width='4' height='10' fill='#333' opacity='0.2'>\
174
- <animate attributeName='opacity' attributeType='XML' values='0.2; 1; .2' begin='0.15s' dur='0.6s' repeatCount='indefinite' />\
175
- <animate attributeName='height' attributeType='XML' values='10; 20; 10' begin='0.15s' dur='0.6s' repeatCount='indefinite' />\
176
- <animate attributeName='y' attributeType='XML' values='10; 5; 10' begin='0.15s' dur='0.6s' repeatCount='indefinite' />\
177
- </rect>\
178
- <rect x='16' y='10' width='4' height='10' fill='#333' opacity='0.2'>\
179
- <animate attributeName='opacity' attributeType='XML' values='0.2; 1; .2' begin='0.3s' dur='0.6s' repeatCount='indefinite' />\
180
- <animate attributeName='height' attributeType='XML' values='10; 20; 10' begin='0.3s' dur='0.6s' repeatCount='indefinite' />\
181
- <animate attributeName='y' attributeType='XML' values='10; 5; 10' begin='0.3s' dur='0.6s' repeatCount='indefinite' />\
182
- </rect>\
183
- </svg>\
184
- </div>\
185
- <div class='qq-ulodaer-placholder'>\
186
- <div>Перенесите файл с устройства или нажмите на данное поле для добавления файла</div>\
187
- <span>Размер файла: не больше 11 Мбайт<br>Расширение файла: jpg</span>\
188
- </div>\
189
- <div class='qq-upload-drop-area-selector qq-upload-drop-area' qq-hide-dropzone='' style='display: none;'>\
190
- </div>\
191
- <div class='qq-upload-button-selector qq-upload-button' style='position: relative; overflow: hidden; direction: ltr;'>\
192
- <div>Загрузите файл</div>\
193
- <input qq-button-id='3583fc56-ea1c-4f35-93d8-37cf24eb15c3' multiple='' accept='application/pdf,image/jpeg,image/png,image/tiff' type='file' name='AdditionalUserDataDocument' style='position: absolute; right: 0px; top: 0px; font-family: Arial; font-size: 118px; margin: 0px; padding: 0px; cursor: pointer; opacity: 0; height: 100%;' autocomplete='off'>\
194
- </div>\
195
- <span class='qq-drop-processing-selector qq-drop-processing qq-hide'>\
196
- <span>Загружаем файлы...</span>\
197
- <span class='qq-drop-processing-spinner-selector qq-drop-processing-spinner'></span>\
198
- </span>\
199
- </div>\
200
- </div>\
201
- </script>\
202
- </div>");
179
+ $('.page-wrapper').append(`
180
+ <div class='new-custom-file-input-data'>
181
+ <div id='custom-file-input-modal' modal-size='2' class='modal sm'>
182
+ <div class='modal-content'>
183
+ <div class='modal-header'>
184
+ <div class='modal-title uppercase'><H4>Ошибка загрузки файла</H4></div>
185
+ <span class='close close-click'> <svg width='14' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M13 1L1 13M1 1l12 12' stroke='#3A3A3A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg></span>
186
+ </div>
187
+ <div class='modal-body'>
188
+ <span class='dialog_label text-center d-block'></span>
189
+ </div>
190
+ </div>
191
+ </div>
192
+ <script type='text/template' id='qq-new-custom-file-template'>
193
+ <div class='qq-uploader-selector new-qq-uploader-selector'>
194
+ <ul class='qq-upload-list-selector qq-upload-list new-custom-file-input' role='region' aria-live='polite' aria-relevant='additions removals'>
195
+ <li class='new-custom-file-input__item'>
196
+ <span role='status' class='qq-upload-status-text-selector qq-upload-status-text'></span>
197
+ <a class='qq-download-link'></a>
198
+ <div class='qq-file-info'>
199
+ <div class='qq-file-name'>
200
+ <span class='qq-upload-file-selector qq-upload-file'></span>
201
+ </div>
202
+ <div class='info'>
203
+ <span class='qq-upload-size-selector qq-upload-size'>29.8 Мбайт</span>
204
+ <button type='button' class='qq-btn qq-upload-delete-selector qq-upload-delete'>
205
+ <span class='qq-btn qq-delete-icon' aria-label='Удалить'></span>
206
+ </button>
207
+ </div>
208
+ </div>
209
+ </li>
210
+ </ul>
211
+ <div class='qq-uploader-selector qq-uploader qq-gallery'>
212
+ <div class='qq-loading'>
213
+ <svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px'
214
+ width='24px' height='30px' viewBox='0 0 24 30' style='enable-background:new 0 0 50 50;' xml:space='preserve'>
215
+ <rect x='0' y='10' width='4' height='10' fill='#333' opacity='0.2'>
216
+ <animate attributeName='opacity' attributeType='XML' values='0.2; 1; .2' begin='0s' dur='0.6s' repeatCount='indefinite' />
217
+ <animate attributeName='height' attributeType='XML' values='10; 20; 10' begin='0s' dur='0.6s' repeatCount='indefinite' />
218
+ <animate attributeName='y' attributeType='XML' values='10; 5; 10' begin='0s' dur='0.6s' repeatCount='indefinite' />
219
+ </rect>
220
+ <rect x='8' y='10' width='4' height='10' fill='#333' opacity='0.2'>
221
+ <animate attributeName='opacity' attributeType='XML' values='0.2; 1; .2' begin='0.15s' dur='0.6s' repeatCount='indefinite' />
222
+ <animate attributeName='height' attributeType='XML' values='10; 20; 10' begin='0.15s' dur='0.6s' repeatCount='indefinite' />
223
+ <animate attributeName='y' attributeType='XML' values='10; 5; 10' begin='0.15s' dur='0.6s' repeatCount='indefinite' />
224
+ </rect>
225
+ <rect x='16' y='10' width='4' height='10' fill='#333' opacity='0.2'>
226
+ <animate attributeName='opacity' attributeType='XML' values='0.2; 1; .2' begin='0.3s' dur='0.6s' repeatCount='indefinite' />
227
+ <animate attributeName='height' attributeType='XML' values='10; 20; 10' begin='0.3s' dur='0.6s' repeatCount='indefinite' />
228
+ <animate attributeName='y' attributeType='XML' values='10; 5; 10' begin='0.3s' dur='0.6s' repeatCount='indefinite' />
229
+ </rect>
230
+ </svg>
231
+ </div>
232
+ <div class='qq-ulodaer-placholder'>
233
+ <div>${localizedFileStrings.getPlaceholder}</div>
234
+ <span>${localizedFileStrings.getMaxSizePlaseholder} 11 ${localizedFileStrings.getSizes[1]}<br>${localizedFileStrings.getFormatPlaseholder}: jpg</span>
235
+ </div>
236
+ <div class='qq-upload-drop-area-selector qq-upload-drop-area' qq-hide-dropzone='' style='display: none;'>
237
+ </div>
238
+ <div class='qq-upload-button-selector qq-upload-button' style='position: relative; overflow: hidden; direction: ltr;'>
239
+ <div>Загрузите файл</div>
240
+ <input qq-button-id='3583fc56-ea1c-4f35-93d8-37cf24eb15c3' multiple='' accept='application/pdf,image/jpeg,image/png,image/tiff' type='file' name='AdditionalUserDataDocument' style='position: absolute; right: 0px; top: 0px; font-family: Arial; font-size: 118px; margin: 0px; padding: 0px; cursor: pointer; opacity: 0; height: 100%;' autocomplete='off'>
241
+ </div>
242
+ <span class='qq-drop-processing-selector qq-drop-processing qq-hide'>
243
+ <span>Загружаем файлы...</span>
244
+ <span class='qq-drop-processing-spinner-selector qq-drop-processing-spinner'></span>
245
+ </span>
246
+ </div>
247
+ </div>
248
+ </script>
249
+ </div>
250
+ `)
251
+
203
252
  modal = $('#custom-file-input-modal');
204
253
  }
205
254
 
@@ -211,7 +260,7 @@ function initCustomFileInputv2(index, fileInput, blazorComponent) {
211
260
  request: {
212
261
  inputName: fileInput.dataset.fileInputName,
213
262
  endpoint: fileInput.dataset.endPoint,
214
- customHeaders: { RequestVerificationToken: fileInput.dataset.requestVerificationToken },
263
+ customHeaders: {RequestVerificationToken: fileInput.dataset.requestVerificationToken},
215
264
  params: formValues
216
265
  },
217
266
  deleteFile: {
@@ -220,7 +269,7 @@ function initCustomFileInputv2(index, fileInput, blazorComponent) {
220
269
  confirmMessage: "Вы уверены, что хотите удалить этот файл?",
221
270
  deletingFailedText: "При удалении произошла ошибка",
222
271
  deletingStatusText: "Удаление..",
223
- customHeaders: { RequestVerificationToken: fileInput.dataset.requestVerificationToken },
272
+ customHeaders: {RequestVerificationToken: fileInput.dataset.requestVerificationToken},
224
273
  method: "POST",
225
274
  params: formValues,
226
275
  forceConfirm: true
@@ -282,7 +331,7 @@ function initCustomFileInputv2(index, fileInput, blazorComponent) {
282
331
  formatProgress: "{percent}% из {total_size}",
283
332
  waitingForResponse: "Загрузка..",
284
333
  defaultResponseError: "Не удалось добавить файл",
285
- sizeSymbols: [' Кбайт', ' Мбайт', ' Гбайт', ' Тбайт', ' Пбайт', ' Эбайт']
334
+ sizeSymbols: localizedFileStrings.getSizes
286
335
  },
287
336
  validation: {
288
337
  acceptFiles: getArrayFromString(fileInput.dataset.acceptFiles),
@@ -294,32 +343,31 @@ function initCustomFileInputv2(index, fileInput, blazorComponent) {
294
343
  callbacks: {
295
344
  onDeleteComplete: function (id, xhr, isError) {
296
345
  if (blazorComponent) {
297
- blazorComponent.invokeMethodAsync("NotifyDeleteComplete", { fileId: xhr.qquuid, isError: isError });
298
- }
299
- else {
346
+ blazorComponent.invokeMethodAsync("NotifyDeleteComplete", {fileId: xhr.qquuid, isError: isError});
347
+ } else {
300
348
  $(fileInput).trigger("file-uploader-on-delete-complete", [fileInput, id, xhr, isError]);
301
349
  }
302
350
  checkFileCount(fileInput);
303
351
  },
304
352
  onComplete: function (id, name, responseJSON, xhr) {
305
353
  if (blazorComponent) {
306
- blazorComponent.invokeMethodAsync("NotifyComplete", { name: name });
307
- }
308
- else {
354
+ blazorComponent.invokeMethodAsync("NotifyComplete", {name: name});
355
+ } else {
309
356
  $(fileInput).trigger("file-uploader-on-complete", [fileInput, id, name, responseJSON, xhr]);
310
357
  }
311
358
  if (responseJSON.success) {
312
359
  if (blazorComponent) {
313
- blazorComponent.invokeMethodAsync("NotifyCompleteSuccess", { fileId: responseJSON.uuid, name: name });
314
- }
315
- else {
360
+ blazorComponent.invokeMethodAsync("NotifyCompleteSuccess", {
361
+ fileId: responseJSON.uuid,
362
+ name: name
363
+ });
364
+ } else {
316
365
  $(fileInput).trigger("file-uploader-on-complete-success", [fileInput, id, name, responseJSON, xhr]);
317
366
  }
318
367
  if (fileInput.dataset.downloadFileEndPoint) {
319
368
  addDownloadLinkForElement(uploader.getItemByFileId(id), fileInput.dataset.downloadFileEndPoint, uploader.getUuid(id), fileInput.dataset.queryParameter);
320
369
  }
321
- }
322
- else if (id) {
370
+ } else if (id) {
323
371
  uploader.getItemByFileId(id).remove();
324
372
  }
325
373
  checkFileCount(fileInput);
@@ -364,12 +412,14 @@ function initCustomFileInputv2(index, fileInput, blazorComponent) {
364
412
  $(fileInput).find('.qq-loading').hide();
365
413
  checkFileCount(fileInput);
366
414
  updateDisabledState(fileInput);
367
- updatePlaceholder(fileInput, maxFileSizeMb, allowedTypes);
415
+ updatePlaceholder(fileInput, maxFileSizeMb, allowedTypes, localizedFileStrings);
368
416
  window[`uploader_${fileInput.id}`] = uploader;
369
417
  }
370
418
 
371
- function updatePlaceholder(fileInput, maxFileSizeMb, allowedTypes) {
372
- $(fileInput).find('.qq-ulodaer-placholder span').html(`Размер файла: не больше ${maxFileSizeMb} Мбайт<br>Расширение файла: ${allowedTypes.toString().replaceAll(",", ", ")}`);
419
+ function updatePlaceholder(fileInput, maxFileSizeMb, allowedTypes, localizedFileStrings) {
420
+ $(fileInput).find('.qq-ulodaer-placholder span')
421
+ .html(`${localizedFileStrings.getMaxSizePlaseholder} ${maxFileSizeMb} ${localizedFileStrings.getSizes[1]}<br>${localizedFileStrings.getFormatPlaseholder} ${allowedTypes.toString()
422
+ .replaceAll(",", ", ")}`);
373
423
  }
374
424
 
375
425
  function updateDisabledState(fileInput) {
@@ -2,14 +2,41 @@
2
2
  customTooltips();
3
3
  });
4
4
 
5
+ class LocalizedLabelStrings {
6
+ _locale = 'ru'
7
+ _strings = {
8
+ openPlaceholder: {
9
+ 'ru': 'Свернуть подсказку',
10
+ 'en': 'Hide the hint'
11
+ },
12
+ closePlaceholder: {
13
+ 'ru': 'Развернуть подсказку',
14
+ 'en': 'Show the hint'
15
+ },
16
+ }
17
+
18
+ constructor() {
19
+ this._locale = $('.page-wrapper').data('lang') || 'ru'
20
+ }
21
+
22
+ get getOpenPlaceholder() {
23
+ return this._strings.openPlaceholder[this._locale]
24
+ }
25
+
26
+ get getClosePlaceholder() {
27
+ return this._strings.closePlaceholder[this._locale]
28
+ }
29
+ }
30
+
5
31
  function customTooltips() {
6
32
  const tooltipTriggerSelector = '.tooltip-trigger';
7
33
  const customLabelSelector = '.custom-label-with-tooltip';
8
34
  const tooltipContentBlockSelector = '.custom-tooltip-content-block';
9
35
  const textSelector = '.text';
36
+ const localizedLabelStrings = new LocalizedLabelStrings()
10
37
 
11
- const expandHint = 'Развернуть подсказку';
12
- const minimizeTooltip = 'Свернуть подсказку';
38
+ const expandHint = localizedLabelStrings.getOpenPlaceholder;
39
+ const minimizeTooltip = localizedLabelStrings.getClosePlaceholder;
13
40
  const yes = 'Y';
14
41
  const no = 'N';
15
42
  const active = 'active';
@@ -54,7 +54,6 @@ class FieldStatusShower {
54
54
  * Скрывать старые статусы, при изменении инпута и клике!
55
55
  */
56
56
  public static enableHideOnInputChange() {
57
- console.log('2');
58
57
  $(document).on('change', 'input, textarea, select', (e) => {
59
58
  $(`.${this.baseClass}`)
60
59
  .not($(e.currentTarget).parents(`.${this.baseClass}`))
@@ -128,7 +127,6 @@ class FieldStatusShower {
128
127
  * Отправить ивент себе же=)
129
128
  */
130
129
  public static sendEvent(rawInput: HTMLElement) {
131
- console.log('5');
132
130
  document.dispatchEvent(new CustomEvent(FieldStatusEvents.Error, { detail: rawInput } as any));
133
131
  }
134
132
 
@@ -26,21 +26,12 @@
26
26
  animation-fill-mode: forwards;
27
27
  position: absolute;
28
28
  right: 0;
29
+ opacity: 1;
29
30
  }
30
31
 
31
32
  &.locale-en {
32
33
  &:before {
33
34
  content: "saved";
34
- color: var(--Green);
35
- font-weight: 500;
36
- -moz-animation: cssAnimationContentSaveEn 0s ease-in 3s forwards;
37
- -webkit-animation: cssAnimationContentSaveEn 0s ease-in 3s forwards;
38
- -o-animation: cssAnimationContentSaveEn 0s ease-in 3s forwards;
39
- animation: cssAnimationContentSaveEn 0s ease-in 3s forwards;
40
- -webkit-animation-fill-mode: forwards;
41
- animation-fill-mode: forwards;
42
- position: absolute;
43
- right: 0;
44
35
  }
45
36
  }
46
37
 
@@ -79,20 +70,6 @@
79
70
  }
80
71
  }
81
72
 
82
- @keyframes cssAnimationContentSaveEn {
83
- from {
84
- content: "saving.";
85
- }
86
-
87
- 50% {
88
- content: "saving..";
89
- }
90
-
91
- to {
92
- content: "saving...";
93
- }
94
- }
95
-
96
73
  @-webkit-keyframes cssAnimationContent {
97
74
  to {
98
75
  width: 0;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.1628",
2
+ "version": "2.0.1630",
3
3
  "name": "ros.grant.common",
4
4
  "private": false,
5
5
  "scripts": {
@@ -1,19 +0,0 @@
1
- class LocalizedStrings {
2
- private _locale: 'ru' | 'en' = 'ru'
3
- private _strings = {
4
- messages: {
5
- success: {
6
- 'ru': 'Успешное выполнение',
7
- 'en': 'Success'
8
- }
9
- }
10
- }
11
-
12
- constructor() {
13
- this._locale = $('.page-wrapper').data('lang') || 'ru'
14
- }
15
-
16
- public get getSuccessMessage(): string {
17
- return this._strings.messages.success[this._locale]
18
- }
19
- }