jsxgrid 2.1.0 → 2.2.0
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/README.md +36 -0
- package/dist/fields/jsgrid.field.XDateTimeField.min.js +1 -1
- package/dist/fields/jsgrid.field.XRowSelectField.min.js +1 -1
- package/dist/fields/jsgrid.field.Xcheckbox.min.js +1 -1
- package/dist/fields/jsgrid.field.Xcontrol.min.js +1 -1
- package/dist/fields/jsgrid.field.XimgField.min.js +1 -1
- package/dist/fields/jsgrid.field.Xjsoneditor.min.js +1 -1
- package/dist/fields/jsgrid.field.Xnumber.min.js +1 -1
- package/dist/fields/jsgrid.field.Xselect.min.js +1 -1
- package/dist/fields/jsgrid.field.Xtext.min.js +1 -1
- package/dist/fields/jsgrid.field.Xtextarea.min.js +1 -1
- package/dist/fields/lib/jsGridSummaryPlugin.min.js +1 -1
- package/dist/fields/lib/jsgrid.popup.basic.min.js +1 -1
- package/dist/i18n/jsgrid-Ko.js +18 -0
- package/dist/i18n/jsgrid-cs.js +18 -0
- package/dist/i18n/jsgrid-de.js +18 -0
- package/dist/i18n/jsgrid-el.js +18 -0
- package/dist/i18n/jsgrid-es.js +18 -0
- package/dist/i18n/jsgrid-fa.js +18 -0
- package/dist/i18n/jsgrid-fr.js +18 -0
- package/dist/i18n/jsgrid-he.js +18 -0
- package/dist/i18n/jsgrid-it.js +18 -0
- package/dist/i18n/jsgrid-ja.js +18 -0
- package/dist/i18n/jsgrid-ka.js +18 -0
- package/dist/i18n/jsgrid-lt.js +18 -0
- package/dist/i18n/jsgrid-pl.js +18 -0
- package/dist/i18n/jsgrid-pt-br.js +18 -0
- package/dist/i18n/jsgrid-pt.js +18 -0
- package/dist/i18n/jsgrid-ru.js +18 -0
- package/dist/i18n/jsgrid-tr.js +18 -0
- package/dist/i18n/jsgrid-zh-cn.js +18 -0
- package/dist/i18n/jsgrid-zh-tw.js +18 -0
- package/dist/jsxgrid-fields.js +1 -1
- package/dist/jsxgrid-fields.min.js +1 -1
- package/dist/jsxgrid-theme.css +1 -1
- package/dist/jsxgrid-xfields.js +1 -1
- package/dist/jsxgrid-xfields.min.js +1 -1
- package/dist/jsxgrid.css +1 -1
- package/dist/jsxgrid.js +52 -5
- package/dist/jsxgrid.min.js +2 -2
- package/package.json +1 -1
- package/src/i18n/Ko.js +18 -0
- package/src/i18n/cs.js +18 -0
- package/src/i18n/de.js +18 -0
- package/src/i18n/el.js +18 -0
- package/src/i18n/es.js +18 -0
- package/src/i18n/fa.js +18 -0
- package/src/i18n/fr.js +18 -0
- package/src/i18n/he.js +18 -0
- package/src/i18n/it.js +18 -0
- package/src/i18n/ja.js +18 -0
- package/src/i18n/ka.js +18 -0
- package/src/i18n/lt.js +18 -0
- package/src/i18n/pl.js +18 -0
- package/src/i18n/pt-br.js +18 -0
- package/src/i18n/pt.js +18 -0
- package/src/i18n/ru.js +18 -0
- package/src/i18n/tr.js +18 -0
- package/src/i18n/zh-cn.js +18 -0
- package/src/i18n/zh-tw.js +18 -0
- package/src/jsgrid.core.js +44 -2
- package/src/jsgrid.validation.js +6 -1
package/src/i18n/pl.js
CHANGED
|
@@ -28,6 +28,24 @@
|
|
|
28
28
|
insertButtonTooltip: "Dodaj",
|
|
29
29
|
updateButtonTooltip: "Aktualizuj",
|
|
30
30
|
cancelEditButtonTooltip: "Anuluj edytowanie"
|
|
31
|
+
},
|
|
32
|
+
Xcontrol: {
|
|
33
|
+
searchModeButtonTooltip: "Wyszukiwanie",
|
|
34
|
+
insertModeButtonTooltip: "Dodawanie",
|
|
35
|
+
editButtonTooltip: "Edytuj",
|
|
36
|
+
deleteButtonTooltip: "Usuń",
|
|
37
|
+
searchButtonTooltip: "Szukaj",
|
|
38
|
+
clearFilterButtonTooltip: "Wyczyść filtr",
|
|
39
|
+
insertButtonTooltip: "Dodaj",
|
|
40
|
+
updateButtonTooltip: "Aktualizuj",
|
|
41
|
+
cancelEditButtonTooltip: "Anuluj edytowanie"
|
|
42
|
+
},
|
|
43
|
+
XimgField: {
|
|
44
|
+
editButtonText: "Otwórz menedżera plików"
|
|
45
|
+
},
|
|
46
|
+
Xjsoneditor: {
|
|
47
|
+
editText: "Edytor",
|
|
48
|
+
closeText: "Zapisz"
|
|
31
49
|
}
|
|
32
50
|
},
|
|
33
51
|
|
package/src/i18n/pt-br.js
CHANGED
|
@@ -28,6 +28,24 @@
|
|
|
28
28
|
insertButtonTooltip: "Adicionar",
|
|
29
29
|
updateButtonTooltip: "Atualizar",
|
|
30
30
|
cancelEditButtonTooltip: "Cancelar Edição"
|
|
31
|
+
},
|
|
32
|
+
Xcontrol: {
|
|
33
|
+
searchModeButtonTooltip: "Mudar para busca",
|
|
34
|
+
insertModeButtonTooltip: "Mudar para inserção",
|
|
35
|
+
editButtonTooltip: "Editar",
|
|
36
|
+
deleteButtonTooltip: "Remover",
|
|
37
|
+
searchButtonTooltip: "Buscar",
|
|
38
|
+
clearFilterButtonTooltip: "Remover filtro",
|
|
39
|
+
insertButtonTooltip: "Adicionar",
|
|
40
|
+
updateButtonTooltip: "Atualizar",
|
|
41
|
+
cancelEditButtonTooltip: "Cancelar Edição"
|
|
42
|
+
},
|
|
43
|
+
XimgField: {
|
|
44
|
+
editButtonText: "Abrir gerenciador de arquivos"
|
|
45
|
+
},
|
|
46
|
+
Xjsoneditor: {
|
|
47
|
+
editText: "Editor",
|
|
48
|
+
closeText: "Salvar"
|
|
31
49
|
}
|
|
32
50
|
},
|
|
33
51
|
|
package/src/i18n/pt.js
CHANGED
|
@@ -28,6 +28,24 @@
|
|
|
28
28
|
insertButtonTooltip: "Adicionar",
|
|
29
29
|
updateButtonTooltip: "Atualizar",
|
|
30
30
|
cancelEditButtonTooltip: "Cancelar Edição"
|
|
31
|
+
},
|
|
32
|
+
Xcontrol: {
|
|
33
|
+
searchModeButtonTooltip: "Mudar para busca",
|
|
34
|
+
insertModeButtonTooltip: "Mudar para inserção",
|
|
35
|
+
editButtonTooltip: "Editar",
|
|
36
|
+
deleteButtonTooltip: "Remover",
|
|
37
|
+
searchButtonTooltip: "Buscar",
|
|
38
|
+
clearFilterButtonTooltip: "Remover filtro",
|
|
39
|
+
insertButtonTooltip: "Adicionar",
|
|
40
|
+
updateButtonTooltip: "Atualizar",
|
|
41
|
+
cancelEditButtonTooltip: "Cancelar Edição"
|
|
42
|
+
},
|
|
43
|
+
XimgField: {
|
|
44
|
+
editButtonText: "Abrir gestor de ficheiros"
|
|
45
|
+
},
|
|
46
|
+
Xjsoneditor: {
|
|
47
|
+
editText: "Editor",
|
|
48
|
+
closeText: "Guardar"
|
|
31
49
|
}
|
|
32
50
|
},
|
|
33
51
|
|
package/src/i18n/ru.js
CHANGED
|
@@ -28,6 +28,24 @@
|
|
|
28
28
|
insertButtonTooltip: "Добавить",
|
|
29
29
|
updateButtonTooltip: "Сохранить",
|
|
30
30
|
cancelEditButtonTooltip: "Отменить"
|
|
31
|
+
},
|
|
32
|
+
Xcontrol: {
|
|
33
|
+
searchModeButtonTooltip: "Поиск",
|
|
34
|
+
insertModeButtonTooltip: "Добавить запись",
|
|
35
|
+
editButtonTooltip: "Изменить",
|
|
36
|
+
deleteButtonTooltip: "Удалить",
|
|
37
|
+
searchButtonTooltip: "Найти",
|
|
38
|
+
clearFilterButtonTooltip: "Очистить фильтр",
|
|
39
|
+
insertButtonTooltip: "Добавить",
|
|
40
|
+
updateButtonTooltip: "Сохранить",
|
|
41
|
+
cancelEditButtonTooltip: "Отменить"
|
|
42
|
+
},
|
|
43
|
+
XimgField: {
|
|
44
|
+
editButtonText: "Открыть менеджер файлов"
|
|
45
|
+
},
|
|
46
|
+
Xjsoneditor: {
|
|
47
|
+
editText: "Редактор",
|
|
48
|
+
closeText: "Сохранить"
|
|
31
49
|
}
|
|
32
50
|
},
|
|
33
51
|
|
package/src/i18n/tr.js
CHANGED
|
@@ -28,6 +28,24 @@
|
|
|
28
28
|
insertButtonTooltip: "Ekle",
|
|
29
29
|
updateButtonTooltip: "Güncelle",
|
|
30
30
|
cancelEditButtonTooltip: "Güncelleme iptali"
|
|
31
|
+
},
|
|
32
|
+
Xcontrol: {
|
|
33
|
+
searchModeButtonTooltip: "Arama moduna geç",
|
|
34
|
+
insertModeButtonTooltip: "Yeni kayıt moduna geç",
|
|
35
|
+
editButtonTooltip: "Değiştir",
|
|
36
|
+
deleteButtonTooltip: "Sil",
|
|
37
|
+
searchButtonTooltip: "Bul",
|
|
38
|
+
clearFilterButtonTooltip: "Filtreyi temizle",
|
|
39
|
+
insertButtonTooltip: "Ekle",
|
|
40
|
+
updateButtonTooltip: "Güncelle",
|
|
41
|
+
cancelEditButtonTooltip: "Güncelleme iptali"
|
|
42
|
+
},
|
|
43
|
+
XimgField: {
|
|
44
|
+
editButtonText: "Dosya yöneticisini aç"
|
|
45
|
+
},
|
|
46
|
+
Xjsoneditor: {
|
|
47
|
+
editText: "Düzenleyici",
|
|
48
|
+
closeText: "Kaydet"
|
|
31
49
|
}
|
|
32
50
|
},
|
|
33
51
|
|
package/src/i18n/zh-cn.js
CHANGED
|
@@ -28,6 +28,24 @@
|
|
|
28
28
|
insertButtonTooltip: "插入",
|
|
29
29
|
updateButtonTooltip: "更新",
|
|
30
30
|
cancelEditButtonTooltip: "取消编辑"
|
|
31
|
+
},
|
|
32
|
+
Xcontrol: {
|
|
33
|
+
searchModeButtonTooltip: "切换为搜索",
|
|
34
|
+
insertModeButtonTooltip: "切换为新增",
|
|
35
|
+
editButtonTooltip: "编辑",
|
|
36
|
+
deleteButtonTooltip: "删除",
|
|
37
|
+
searchButtonTooltip: "搜索",
|
|
38
|
+
clearFilterButtonTooltip: "清空过滤",
|
|
39
|
+
insertButtonTooltip: "插入",
|
|
40
|
+
updateButtonTooltip: "更新",
|
|
41
|
+
cancelEditButtonTooltip: "取消编辑"
|
|
42
|
+
},
|
|
43
|
+
XimgField: {
|
|
44
|
+
editButtonText: "打开文件管理器"
|
|
45
|
+
},
|
|
46
|
+
Xjsoneditor: {
|
|
47
|
+
editText: "编辑器",
|
|
48
|
+
closeText: "保存"
|
|
31
49
|
}
|
|
32
50
|
},
|
|
33
51
|
|
package/src/i18n/zh-tw.js
CHANGED
|
@@ -28,6 +28,24 @@
|
|
|
28
28
|
insertButtonTooltip: "新增",
|
|
29
29
|
updateButtonTooltip: "修改",
|
|
30
30
|
cancelEditButtonTooltip: "取消編輯"
|
|
31
|
+
},
|
|
32
|
+
Xcontrol: {
|
|
33
|
+
searchModeButtonTooltip: "切換為搜尋",
|
|
34
|
+
insertModeButtonTooltip: "切換為新增",
|
|
35
|
+
editButtonTooltip: "編輯",
|
|
36
|
+
deleteButtonTooltip: "刪除",
|
|
37
|
+
searchButtonTooltip: "搜尋",
|
|
38
|
+
clearFilterButtonTooltip: "清除搜尋條件",
|
|
39
|
+
insertButtonTooltip: "新增",
|
|
40
|
+
updateButtonTooltip: "修改",
|
|
41
|
+
cancelEditButtonTooltip: "取消編輯"
|
|
42
|
+
},
|
|
43
|
+
XimgField: {
|
|
44
|
+
editButtonText: "開啟檔案總管"
|
|
45
|
+
},
|
|
46
|
+
Xjsoneditor: {
|
|
47
|
+
editText: "編輯器",
|
|
48
|
+
closeText: "儲存"
|
|
31
49
|
}
|
|
32
50
|
},
|
|
33
51
|
|
package/src/jsgrid.core.js
CHANGED
|
@@ -83,6 +83,14 @@
|
|
|
83
83
|
height: "auto",
|
|
84
84
|
updateOnResize: true,
|
|
85
85
|
|
|
86
|
+
// Per-instance locale: a key from jsGrid.locales (e.g. "ru"), or an
|
|
87
|
+
// inline locale config object with the same {grid, fields} shape.
|
|
88
|
+
// Applied once at construction time, before the rest of `config` -
|
|
89
|
+
// any option the caller also sets explicitly still wins. Unlike
|
|
90
|
+
// jsGrid.locale(), this never touches shared prototypes, so two
|
|
91
|
+
// grids on the same page can run in different languages at once.
|
|
92
|
+
locale: null,
|
|
93
|
+
|
|
86
94
|
rowClass: $.noop,
|
|
87
95
|
rowRenderer: null,
|
|
88
96
|
|
|
@@ -196,6 +204,7 @@
|
|
|
196
204
|
gridBodyClass: "jsgrid-grid-body",
|
|
197
205
|
|
|
198
206
|
_init: function(config) {
|
|
207
|
+
this._initInstanceLocale(config && config.locale);
|
|
199
208
|
$.extend(this, config);
|
|
200
209
|
this._initLoadStrategy();
|
|
201
210
|
this._initController();
|
|
@@ -205,6 +214,24 @@
|
|
|
205
214
|
this._callEventHandler(this.onInit)
|
|
206
215
|
},
|
|
207
216
|
|
|
217
|
+
_initInstanceLocale: function(locale) {
|
|
218
|
+
if(!locale) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
var localeConfig = $.isPlainObject(locale) ? locale : jsGrid.locales[locale];
|
|
223
|
+
if(!localeConfig) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if(localeConfig.grid) {
|
|
228
|
+
$.extend(this, localeConfig.grid);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
this._fieldsLocaleConfig = localeConfig.fields;
|
|
232
|
+
this._validatorsLocaleConfig = localeConfig.validators;
|
|
233
|
+
},
|
|
234
|
+
|
|
208
235
|
loadStrategy: function() {
|
|
209
236
|
return this.pageLoading
|
|
210
237
|
? new jsGrid.loadStrategies.PageLoadingStrategy(this)
|
|
@@ -241,9 +268,15 @@
|
|
|
241
268
|
|
|
242
269
|
_initFields: function() {
|
|
243
270
|
var self = this;
|
|
271
|
+
var fieldsLocale = self._fieldsLocaleConfig;
|
|
244
272
|
self.fields = $.map(self.fields, function(field) {
|
|
245
273
|
if($.isPlainObject(field)) {
|
|
246
274
|
var fieldConstructor = (field.type && jsGrid.fields[field.type]) || jsGrid.Field;
|
|
275
|
+
var fieldLocale = fieldsLocale && field.type && fieldsLocale[field.type];
|
|
276
|
+
if(fieldLocale) {
|
|
277
|
+
// locale strings are defaults; explicit keys on the field config still win
|
|
278
|
+
field = $.extend({}, fieldLocale, field);
|
|
279
|
+
}
|
|
247
280
|
field = new fieldConstructor(field);
|
|
248
281
|
}
|
|
249
282
|
field._grid = self;
|
|
@@ -415,7 +448,9 @@
|
|
|
415
448
|
},
|
|
416
449
|
|
|
417
450
|
_createValidation: function() {
|
|
418
|
-
return getOrApply(this.validation, this
|
|
451
|
+
return getOrApply(this.validation, this, {
|
|
452
|
+
validatorsLocale: this._validatorsLocaleConfig
|
|
453
|
+
});
|
|
419
454
|
},
|
|
420
455
|
|
|
421
456
|
_clear: function() {
|
|
@@ -1629,6 +1664,13 @@
|
|
|
1629
1664
|
};
|
|
1630
1665
|
|
|
1631
1666
|
var setLocale = function(obj, localeConfig) {
|
|
1667
|
+
if(!obj) {
|
|
1668
|
+
// target not loaded on the page (e.g. a locale file's fields.control
|
|
1669
|
+
// section with no native control.js loaded) - skip this branch
|
|
1670
|
+
// instead of throwing and aborting the rest of the locale.
|
|
1671
|
+
return;
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1632
1674
|
$.each(localeConfig, function(field, value) {
|
|
1633
1675
|
if($.isPlainObject(value)) {
|
|
1634
1676
|
setLocale(obj[field] || obj[field[0].toUpperCase() + field.slice(1)], value);
|
|
@@ -1637,7 +1679,7 @@
|
|
|
1637
1679
|
|
|
1638
1680
|
if(obj.hasOwnProperty(field)) {
|
|
1639
1681
|
obj[field] = value;
|
|
1640
|
-
} else {
|
|
1682
|
+
} else if(obj.prototype) {
|
|
1641
1683
|
obj.prototype[field] = value;
|
|
1642
1684
|
}
|
|
1643
1685
|
});
|
package/src/jsgrid.validation.js
CHANGED
|
@@ -62,7 +62,12 @@
|
|
|
62
62
|
validator = { validator: validator };
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
// this grid's own locale (jsGrid's `locale` init option), if any,
|
|
66
|
+
// overrides the shared default message but still loses to a message
|
|
67
|
+
// set explicitly on the rule itself
|
|
68
|
+
var localeOverride = this.validatorsLocale && this.validatorsLocale[validatorName];
|
|
69
|
+
|
|
70
|
+
return $.extend({}, validator, localeOverride, rule);
|
|
66
71
|
}
|
|
67
72
|
};
|
|
68
73
|
|