@progress/kendo-react-editor 5.15.0-dev.202307180734 → 5.15.0-dev.202307181521

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.
Files changed (37) hide show
  1. package/dist/cdn/js/kendo-react-editor.js +1 -1
  2. package/dist/es/Editor.js +7 -0
  3. package/dist/es/messages/index.d.ts +162 -0
  4. package/dist/es/messages/index.js +487 -1
  5. package/dist/es/package-metadata.js +1 -1
  6. package/dist/es/tools/insertTable/tool.js +3 -2
  7. package/dist/es/tools/main.d.ts +20 -0
  8. package/dist/es/tools/main.js +12 -0
  9. package/dist/es/tools/table-wizard/tableCellProperties.d.ts +35 -0
  10. package/dist/es/tools/table-wizard/tableCellProperties.js +471 -0
  11. package/dist/es/tools/table-wizard/tableProperties.d.ts +11 -0
  12. package/dist/es/tools/table-wizard/tableProperties.js +701 -0
  13. package/dist/es/tools/table-wizard/utils.d.ts +25 -0
  14. package/dist/es/tools/table-wizard/utils.js +90 -0
  15. package/dist/es/tools/tableEdit.d.ts +9 -0
  16. package/dist/es/tools/tableEdit.js +2 -2
  17. package/dist/es/tools/utils.d.ts +30 -1
  18. package/dist/es/tools/utils.js +39 -1
  19. package/dist/npm/Editor.js +7 -0
  20. package/dist/npm/messages/index.d.ts +162 -0
  21. package/dist/npm/messages/index.js +487 -1
  22. package/dist/npm/package-metadata.js +1 -1
  23. package/dist/npm/tools/insertTable/tool.js +2 -1
  24. package/dist/npm/tools/main.d.ts +20 -0
  25. package/dist/npm/tools/main.js +12 -0
  26. package/dist/npm/tools/table-wizard/tableCellProperties.d.ts +35 -0
  27. package/dist/npm/tools/table-wizard/tableCellProperties.js +479 -0
  28. package/dist/npm/tools/table-wizard/tableProperties.d.ts +11 -0
  29. package/dist/npm/tools/table-wizard/tableProperties.js +705 -0
  30. package/dist/npm/tools/table-wizard/utils.d.ts +25 -0
  31. package/dist/npm/tools/table-wizard/utils.js +97 -0
  32. package/dist/npm/tools/tableEdit.d.ts +9 -0
  33. package/dist/npm/tools/tableEdit.js +5 -3
  34. package/dist/npm/tools/utils.d.ts +30 -1
  35. package/dist/npm/tools/utils.js +43 -1
  36. package/dist/systemjs/kendo-react-editor.js +1 -1
  37. package/package.json +13 -13
@@ -0,0 +1,705 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
25
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
26
+ if (ar || !(i in from)) {
27
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
28
+ ar[i] = from[i];
29
+ }
30
+ }
31
+ return to.concat(ar || Array.prototype.slice.call(from));
32
+ };
33
+ Object.defineProperty(exports, "__esModule", { value: true });
34
+ exports.TableProperties = void 0;
35
+ var React = require("react");
36
+ var kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
37
+ var kendo_react_inputs_1 = require("@progress/kendo-react-inputs");
38
+ var kendo_react_dropdowns_1 = require("@progress/kendo-react-dropdowns");
39
+ var kendo_react_dialogs_1 = require("@progress/kendo-react-dialogs");
40
+ var kendo_react_layout_1 = require("@progress/kendo-react-layout");
41
+ var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
42
+ var utils_1 = require("./../utils");
43
+ var utils_2 = require("./utils");
44
+ var tableCellProperties_1 = require("./tableCellProperties");
45
+ var kendo_editor_common_1 = require("@progress/kendo-editor-common");
46
+ var tableEdit_1 = require("../tableEdit");
47
+ var kendo_react_intl_1 = require("@progress/kendo-react-intl");
48
+ var messages_1 = require("./../../messages");
49
+ var lastCell = function (table) {
50
+ var lastRow = table.lastChild;
51
+ var cell = lastRow.lastChild;
52
+ return { node: cell, pos: table.content.size - cell.nodeSize };
53
+ };
54
+ var addTableNodes = function (state, tablePos, table, toAdd, command) {
55
+ var last = lastCell(table);
56
+ var cellPos = tablePos + last.pos;
57
+ var cell = state.doc.nodeAt(cellPos);
58
+ if (!cell) {
59
+ return state;
60
+ }
61
+ var res = state.doc.resolve(cellPos);
62
+ var sel = new kendo_editor_common_1.CellSelection(res, res);
63
+ var selTr = state.tr.setSelection(sel);
64
+ var resultState = state.apply(selTr);
65
+ for (var i = 0; i < toAdd; i++) {
66
+ command(resultState, function (tr) {
67
+ resultState = resultState.apply(tr);
68
+ });
69
+ }
70
+ return resultState;
71
+ };
72
+ var removeTableNodes = function (state, tablePos, toDelete, command) {
73
+ var resultState = state;
74
+ for (var i = 0; i < toDelete; i++) {
75
+ var table = resultState.doc.nodeAt(tablePos);
76
+ if (table) {
77
+ var last = lastCell(table);
78
+ var cellPos = tablePos + last.pos;
79
+ var res = resultState.doc.resolve(cellPos);
80
+ var selection = new kendo_editor_common_1.CellSelection(res, res);
81
+ var selTr = resultState.tr.setSelection(selection);
82
+ resultState = resultState.apply(selTr);
83
+ command(resultState, function (tr) {
84
+ resultState = resultState.apply(tr);
85
+ });
86
+ }
87
+ }
88
+ return resultState;
89
+ };
90
+ var resizeTable = function (state, tablePos, rows, columns) {
91
+ var nextState = state;
92
+ var table = nextState.doc.nodeAt(tablePos);
93
+ if (!table) {
94
+ return nextState;
95
+ }
96
+ var map = kendo_editor_common_1.TableMap.get(table);
97
+ if (map.width === columns && map.height === rows) {
98
+ return nextState;
99
+ }
100
+ if (columns > map.width) {
101
+ nextState = addTableNodes(nextState, tablePos, table, columns - map.width, kendo_editor_common_1.addColumnAfter);
102
+ }
103
+ else if (columns < map.width) {
104
+ nextState = removeTableNodes(nextState, tablePos, map.width - columns, tableEdit_1.deleteColumnCmd);
105
+ }
106
+ table = nextState.doc.nodeAt(tablePos);
107
+ if (!table) {
108
+ return nextState;
109
+ }
110
+ map = kendo_editor_common_1.TableMap.get(table);
111
+ if (rows > map.height) {
112
+ nextState = addTableNodes(nextState, tablePos, table, rows - map.height, kendo_editor_common_1.addRowAfter);
113
+ }
114
+ else if (rows < map.height) {
115
+ nextState = removeTableNodes(nextState, tablePos, map.height - rows, tableEdit_1.deleteRowCmd);
116
+ }
117
+ return nextState;
118
+ };
119
+ var setTableStyles = function (state, data, tablePos) {
120
+ var _a;
121
+ var table = state.doc.nodeAt(tablePos);
122
+ if (!table) {
123
+ return state;
124
+ }
125
+ var attrs = __assign({}, table.attrs);
126
+ attrs = (0, utils_2.setNodeStyle)(attrs, 'width', data.width !== null ? data.width + data.widthUnit : '');
127
+ attrs = (0, utils_2.setNodeStyle)(attrs, 'height', data.height !== null ? data.height + data.heightUnit : '');
128
+ attrs = (0, utils_2.setNodeStyle)(attrs, 'text-align', data.textAlign || '');
129
+ attrs = (0, utils_2.setNodeStyle)(attrs, 'background-color', data.backgroundColor || '');
130
+ attrs = (0, utils_2.setNodeStyle)(attrs, 'border-width', data.borderWidth ? data.borderWidth + 'px' : '');
131
+ attrs = (0, utils_2.setNodeStyle)(attrs, 'border-style', data.borderStyle || '');
132
+ attrs = (0, utils_2.setNodeStyle)(attrs, 'border-color', data.borderColor || '');
133
+ attrs = (0, utils_2.setNodeStyle)(attrs, 'border-spacing', data.cellSpacing !== null ? data.cellSpacing + 'px' : '');
134
+ if (data.cellSpacing !== null) {
135
+ attrs = (0, utils_2.setNodeStyle)(attrs, 'border-collapse', 'unset');
136
+ }
137
+ else {
138
+ attrs = (0, utils_2.setNodeStyle)(attrs, 'border-collapse', data.collapseBorders ? 'collapse' : '');
139
+ }
140
+ var posStyles = ((_a = data.position) === null || _a === void 0 ? void 0 : _a.style) || {};
141
+ Object.keys(posStyles).forEach(function (style) {
142
+ attrs = (0, utils_2.setNodeStyle)(attrs, style, posStyles[style]);
143
+ });
144
+ attrs.id = data.id || null;
145
+ attrs.class = data.className || null;
146
+ var tr = state.tr.setNodeMarkup(tablePos, null, attrs);
147
+ state = state.apply(tr);
148
+ return state;
149
+ };
150
+ var toCellsMap = function (map) {
151
+ var cells = [];
152
+ for (var h = 0; h < map.height; h++) {
153
+ var start = h * map.width;
154
+ var end = start + map.width;
155
+ cells.push(map.map.slice(start, end));
156
+ }
157
+ return cells;
158
+ };
159
+ var headerCellsCount = function (table, map) {
160
+ var headerRows = 0;
161
+ var headerColumns = 0;
162
+ var cells = toCellsMap(map);
163
+ cells.forEach(function (row) {
164
+ var headerCells = true;
165
+ row.forEach(function (cellPos) {
166
+ var cell = table.nodeAt(cellPos);
167
+ if (cell && cell.type.name !== 'table_header') {
168
+ headerCells = false;
169
+ }
170
+ });
171
+ if (headerCells) {
172
+ headerRows++;
173
+ }
174
+ });
175
+ for (var col = 0; col < map.width; col++) {
176
+ var headerCells = true;
177
+ for (var row = 0; row < map.height; row++) {
178
+ var cellPos = cells[row] && cells[row][col];
179
+ var cell = typeof cellPos === 'number' && table.nodeAt(cellPos);
180
+ if (cell && cell.type.name !== 'table_header') {
181
+ headerCells = false;
182
+ }
183
+ }
184
+ if (headerCells) {
185
+ headerColumns++;
186
+ }
187
+ }
188
+ return { rows: headerRows, columns: headerColumns };
189
+ };
190
+ var setCellType = function (state, cell, pos, type, attrs) {
191
+ if (cell.type.name !== type.name || Object.keys(attrs).length > 0) {
192
+ var tr = state.tr.setNodeMarkup(pos, type, __assign(__assign({}, cell.attrs), attrs));
193
+ return state.apply(tr);
194
+ }
195
+ return state;
196
+ };
197
+ var resetId = function (cell, attrs) {
198
+ if (/^cell-[0-9]+-[0-9]+$/.test(cell.attrs.id || '')) {
199
+ attrs.id = null;
200
+ }
201
+ };
202
+ var setTableHeaderCells = function (state, data, tablePos) {
203
+ var table = state.doc.nodeAt(tablePos);
204
+ var map = table && kendo_editor_common_1.TableMap.get(table);
205
+ if (!table || !map) {
206
+ return state;
207
+ }
208
+ // const headerCells = headerCellsCount(table, map);
209
+ // if (data.headerRows === headerCells.rows && data.headerColumns === headerCells.columns) {
210
+ // return state;
211
+ // }
212
+ var cells = toCellsMap(map);
213
+ var newState = state;
214
+ var _a = state.schema.nodes, table_header = _a.table_header, table_cell = _a.table_cell;
215
+ var id = String(new Date().getTime());
216
+ var ids = [];
217
+ var cellId = function (row, col) {
218
+ var result = "cell-".concat(row).concat(col, "-").concat(id);
219
+ if (!ids[row]) {
220
+ ids.push([]);
221
+ }
222
+ if (!ids[row][col]) {
223
+ ids[row].push([]);
224
+ }
225
+ ids[row][col] = result;
226
+ return result;
227
+ };
228
+ var headers = function (row, col, colHeader, rowHeader) {
229
+ var result = [];
230
+ if (rowHeader) {
231
+ for (var r = 0; r < row; r++) {
232
+ if (ids[r] && ids[r][col]) {
233
+ result.push(ids[r][col]);
234
+ }
235
+ }
236
+ }
237
+ if (colHeader) {
238
+ for (var c = 0; c < col; c++) {
239
+ if (ids[row] && ids[row][c]) {
240
+ result.push(ids[row][c]);
241
+ }
242
+ }
243
+ }
244
+ return result.join(' ');
245
+ };
246
+ cells.forEach(function (row, rowIndex) {
247
+ row.forEach(function (cellPos, cellIndex) {
248
+ var cell = table.nodeAt(cellPos);
249
+ if (cell) {
250
+ var colHeader = cellIndex < data.headerColumns;
251
+ var rowHeader = rowIndex < data.headerRows;
252
+ var attrs = __assign({}, cell.attrs);
253
+ resetId(cell, attrs);
254
+ attrs.headers = null;
255
+ attrs.scope = null;
256
+ if (rowHeader || colHeader) {
257
+ if (data.associateHeaders === 'scope') {
258
+ attrs.scope = rowHeader ? 'col' : 'row';
259
+ }
260
+ if (data.associateHeaders === 'id') {
261
+ attrs.id = cellId(rowIndex, cellIndex);
262
+ if (cellIndex > 0 || rowIndex > 0) {
263
+ attrs.headers = headers(rowIndex, cellIndex, colHeader, rowHeader) || null;
264
+ }
265
+ }
266
+ newState = setCellType(newState, cell, tablePos + cellPos + 1, table_header, attrs);
267
+ }
268
+ else {
269
+ if (data.associateHeaders === 'id') {
270
+ attrs.headers = headers(rowIndex, cellIndex, data.headerColumns > 0, data.headerRows > 0) || null;
271
+ }
272
+ newState = setCellType(newState, cell, tablePos + cellPos + 1, table_cell, attrs);
273
+ }
274
+ }
275
+ });
276
+ });
277
+ return newState;
278
+ };
279
+ var setTablePosition = function (state, wrapperNode, wrapperPos, styles) {
280
+ var attrs = __assign({}, wrapperNode.attrs);
281
+ attrs = (0, utils_2.setNodeStyle)(attrs, 'margin-left', '');
282
+ attrs = (0, utils_2.setNodeStyle)(attrs, 'margin-right', '');
283
+ Object.keys(styles || {}).forEach(function (s) {
284
+ attrs = (0, utils_2.setNodeStyle)(attrs, s, (styles || {})[s] || '');
285
+ });
286
+ return state.apply(state.tr.setNodeMarkup(wrapperPos, null, attrs));
287
+ };
288
+ var parseCaptionContent = function (content, schema) {
289
+ var doc = (0, kendo_editor_common_1.parseContent)('<p>' + content + '</p>', schema);
290
+ return doc.content.firstChild.content;
291
+ };
292
+ var createCaption = function (data, schema) {
293
+ if (!data.caption) {
294
+ return;
295
+ }
296
+ var captAttrs = { caption: '', style: 'display: table-caption' };
297
+ if (data.captionAlignment) {
298
+ captAttrs = (0, utils_2.setNodeStyle)(captAttrs, 'text-align', data.captionAlignment);
299
+ }
300
+ if (data.captionPosition) {
301
+ captAttrs = (0, utils_2.setNodeStyle)(captAttrs, 'caption-side', data.captionPosition);
302
+ }
303
+ var captionContent = parseCaptionContent(data.caption, schema);
304
+ var captionNode = (captionContent && schema.nodes.table_caption_external.createAndFill(captAttrs, captionContent)) || undefined;
305
+ return captionNode;
306
+ };
307
+ var hasCaption = function (wrapperNode) {
308
+ return wrapperNode.firstChild && wrapperNode.firstChild.type.name === 'table_caption_external';
309
+ };
310
+ var setTableCaption = function (state, wrapperNode, wrapperPos, data) {
311
+ var nextState = state;
312
+ var captionNode;
313
+ var captContentPos = wrapperPos + 2;
314
+ var captPos = wrapperPos + 1;
315
+ var schema = nextState.schema;
316
+ if (hasCaption(wrapperNode)) {
317
+ captionNode = wrapperNode.firstChild;
318
+ if (data.caption) {
319
+ var captionContent = parseCaptionContent(data.caption, schema);
320
+ nextState = nextState.apply(nextState.tr.replaceWith(captContentPos, captContentPos + captionNode.content.size, captionContent));
321
+ captionNode = nextState.doc.nodeAt(captPos);
322
+ if (captionNode) {
323
+ var captAttrs = __assign({}, captionNode.attrs);
324
+ captAttrs = (0, utils_2.setNodeStyle)(captAttrs, 'text-align', data.captionAlignment || '');
325
+ captAttrs = (0, utils_2.setNodeStyle)(captAttrs, 'caption-side', data.captionPosition || '');
326
+ nextState = nextState.apply(nextState.tr.setNodeAttribute(captPos, 'style', captAttrs.style));
327
+ }
328
+ }
329
+ else {
330
+ nextState = nextState.apply(nextState.tr.deleteRange(captContentPos, captContentPos + captionNode.content.size));
331
+ }
332
+ }
333
+ else {
334
+ captionNode = createCaption(data, schema);
335
+ if (captionNode) {
336
+ nextState = nextState.apply(nextState.tr.replaceWith(captContentPos, captContentPos, captionNode));
337
+ }
338
+ }
339
+ return nextState;
340
+ };
341
+ var updateWrapper = function (state, data, tablePos, tableWrapper, tableWrapperPos) {
342
+ if (!tableWrapper && (data.position || data.caption)) {
343
+ var wrapperAttrs_1 = { table: '', style: 'display: table' };
344
+ var children = [];
345
+ if (data.position) {
346
+ Object.keys(data.position.style).forEach(function (s) {
347
+ wrapperAttrs_1 = (0, utils_2.setNodeStyle)(wrapperAttrs_1, s, data.position.style[s] || '');
348
+ });
349
+ }
350
+ var captionNode = createCaption(data, state.schema);
351
+ if (captionNode) {
352
+ children.push(captionNode);
353
+ }
354
+ var table = state.doc.nodeAt(tablePos);
355
+ children.push(table);
356
+ var createdWrapper = state.schema.nodes.table_wrapper.createAndFill(wrapperAttrs_1, children);
357
+ if (createdWrapper) {
358
+ var tr = state.tr.replaceWith(tablePos, tablePos + table.content.size, createdWrapper);
359
+ state = state.apply(tr);
360
+ return { state: state, pos: tablePos };
361
+ }
362
+ }
363
+ else if (tableWrapper && (data.position || data.caption || (!data.caption && hasCaption(tableWrapper.node)))) {
364
+ state = setTablePosition(state, tableWrapper.node, tableWrapperPos, data.position && data.position.style);
365
+ state = setTableCaption(state, tableWrapper.node, tableWrapperPos, data);
366
+ return { state: state, pos: tableWrapperPos };
367
+ }
368
+ else if (tableWrapper && !(data.position || data.caption)) {
369
+ return { state: state, node: tableWrapper.node, pos: state.selection.$from.start(tableWrapper.depth) - 1 };
370
+ }
371
+ return { state: state, pos: tablePos };
372
+ };
373
+ /**
374
+ * @hidden
375
+ */
376
+ var TableProperties = function (props) {
377
+ var view = props.view, buttonProps = __rest(props, ["view"]);
378
+ var loc = (0, kendo_react_intl_1.useLocalization)();
379
+ var _a = React.useState(false), showDialog = _a[0], setShowDialog = _a[1];
380
+ var inTable = Boolean(view && (0, utils_1.parentNode)(view.state.selection.$from, function (n) { return n.type.spec.tableRole === 'table'; }));
381
+ var onClick = React.useCallback(function () {
382
+ setShowDialog(true);
383
+ }, []);
384
+ var onClose = React.useCallback(function () {
385
+ setShowDialog(false);
386
+ }, []);
387
+ var onSave = React.useCallback(function (data) {
388
+ if (view && data) {
389
+ var $from = view.state.selection.$from;
390
+ var table = (0, utils_1.parentNode)($from, function (n) { return n.type.spec.tableRole === 'table'; });
391
+ if (!table) {
392
+ return;
393
+ }
394
+ var tablePos = $from.start(table.depth) - 1;
395
+ var state = resizeTable(view.state, tablePos, data.rows, data.columns);
396
+ if (!state) {
397
+ return;
398
+ }
399
+ var transaction_1 = state.tr;
400
+ (0, tableCellProperties_1.tableCells)(state).forEach(function (cell) {
401
+ var attrs = __assign({}, cell.node.attrs);
402
+ attrs = (0, utils_2.setNodeStyle)(attrs, 'padding', typeof data.cellPadding === 'number' ? data.cellPadding + 'px' : '');
403
+ transaction_1.setNodeMarkup(cell.pos, null, attrs);
404
+ });
405
+ state = state.apply(transaction_1);
406
+ state = setTableStyles(state, data, tablePos);
407
+ state = setTableHeaderCells(state, data, tablePos);
408
+ var tableParent = (0, utils_1.parentNode)($from, function (n) { return n.type.name === 'table_wrapper'; });
409
+ var tableParentPos = $from.start((tableParent === null || tableParent === void 0 ? void 0 : tableParent.depth) || 0) - 1;
410
+ var result = updateWrapper(state, data, tablePos, tableParent, tableParentPos);
411
+ state = result.state;
412
+ var from = result.pos;
413
+ var node = state.doc.nodeAt(result.pos);
414
+ if (!node) {
415
+ return;
416
+ }
417
+ var to = from + (tableParent || table).node.content.size;
418
+ var tr = view.state.tr.replaceWith(from, to, node);
419
+ var atEnd = kendo_editor_common_1.Selection.atEnd(node);
420
+ var selection = kendo_editor_common_1.TextSelection.create(tr.doc, from + atEnd.to);
421
+ tr.setSelection(selection);
422
+ view.dispatch(tr);
423
+ }
424
+ setShowDialog(false);
425
+ }, [view]);
426
+ return (React.createElement(React.Fragment, null,
427
+ React.createElement(kendo_react_buttons_1.Button, __assign({ type: "button", title: loc.toLanguageString(messages_1.keys.tableProperties, messages_1.messages[messages_1.keys.tableProperties]), icon: 'table-properties', svgIcon: kendo_svg_icons_1.tablePropertiesIcon, onClick: onClick, disabled: !inTable }, utils_1.onDownPreventDefault, buttonProps)),
428
+ showDialog && React.createElement(TablePropertiesDialog, { onClose: onClose, onSave: onSave, view: view })));
429
+ };
430
+ exports.TableProperties = TableProperties;
431
+ var alignData = [
432
+ { textKey: messages_1.keys.tablePropertiesAlignLeft, text: messages_1.messages[messages_1.keys.tablePropertiesAlignLeft],
433
+ value: 'left', icon: 'table-align-middle-left', svgIcon: kendo_svg_icons_1.tableAlignMiddleLeftIcon },
434
+ { textKey: messages_1.keys.tablePropertiesAlignCenter, text: messages_1.messages[messages_1.keys.tablePropertiesAlignCenter],
435
+ value: 'center', icon: 'table-align-middle-center', svgIcon: kendo_svg_icons_1.tableAlignMiddleCenterIcon },
436
+ { textKey: messages_1.keys.tablePropertiesAlignRight, text: messages_1.messages[messages_1.keys.tablePropertiesAlignRight],
437
+ value: 'right', icon: 'table-align-middle-right', svgIcon: kendo_svg_icons_1.tableAlignMiddleRightIcon },
438
+ { textKey: messages_1.keys.tablePropertiesNoAlignment, text: messages_1.messages[messages_1.keys.tablePropertiesNoAlignment],
439
+ value: '', icon: 'align-remove', svgIcon: kendo_svg_icons_1.tableAlignRemoveIcon }
440
+ ];
441
+ var tablePosition = [{
442
+ textKey: messages_1.keys.tablePropertiesLeft,
443
+ text: messages_1.messages[messages_1.keys.tablePropertiesLeft],
444
+ value: 'left',
445
+ style: { 'margin-left': '', 'margin-right': 'auto' },
446
+ icon: 'table-position-left',
447
+ svgIcon: kendo_svg_icons_1.tablePositionStartIcon
448
+ }, {
449
+ textKey: messages_1.keys.tablePropertiesCenter,
450
+ text: messages_1.messages[messages_1.keys.tablePropertiesCenter],
451
+ value: 'center',
452
+ style: { 'margin-left': 'auto', 'margin-right': 'auto' },
453
+ icon: 'table-position-center',
454
+ svgIcon: kendo_svg_icons_1.tablePositionCenterIcon
455
+ }, {
456
+ textKey: messages_1.keys.tablePropertiesRight,
457
+ text: messages_1.messages[messages_1.keys.tablePropertiesRight],
458
+ value: 'right',
459
+ style: { 'margin-left': 'auto', 'margin-right': '' },
460
+ icon: 'table-position-right',
461
+ svgIcon: kendo_svg_icons_1.tablePositionEndIcon
462
+ }];
463
+ var captionPositionData = [{
464
+ textKey: messages_1.keys.tablePropertiesTop,
465
+ text: messages_1.messages[messages_1.keys.tablePropertiesTop],
466
+ value: 'top',
467
+ icon: 'position-top',
468
+ svgIcon: kendo_svg_icons_1.positionTopIcon
469
+ }, {
470
+ textKey: messages_1.keys.tablePropertiesBottom,
471
+ text: messages_1.messages[messages_1.keys.tablePropertiesBottom],
472
+ value: 'bottom',
473
+ icon: 'position-bottom',
474
+ svgIcon: kendo_svg_icons_1.positionBottomIcon
475
+ }];
476
+ var associateHeadersData = [
477
+ { textKey: messages_1.keys.tablePropertiesNone, text: messages_1.messages[messages_1.keys.tablePropertiesNone], value: 'none' },
478
+ { textKey: messages_1.keys.tablePropertiesUsingScopeAttribute, text: messages_1.messages[messages_1.keys.tablePropertiesUsingScopeAttribute], value: 'scope' },
479
+ { textKey: messages_1.keys.tablePropertiesUsingIdAttributes, text: messages_1.messages[messages_1.keys.tablePropertiesUsingIdAttributes], value: 'id' }
480
+ ];
481
+ var initialData = {
482
+ rows: 0,
483
+ columns: 0,
484
+ width: null,
485
+ widthUnit: '',
486
+ height: null,
487
+ heightUnit: '',
488
+ position: null,
489
+ textAlign: '',
490
+ cellPadding: null,
491
+ cellSpacing: null,
492
+ backgroundColor: undefined,
493
+ borderWidth: null,
494
+ borderColor: undefined,
495
+ borderStyle: null,
496
+ collapseBorders: false,
497
+ id: '',
498
+ className: '',
499
+ caption: '',
500
+ captionAlignment: null,
501
+ captionPosition: null,
502
+ headerRows: 0,
503
+ headerColumns: 0,
504
+ associateHeaders: 'none'
505
+ };
506
+ var TablePropertiesDialog = function (props) {
507
+ var defaults = React.useMemo(function () {
508
+ var _a, _b, _c;
509
+ var cells = (0, tableCellProperties_1.selectedCells)(props.view.state);
510
+ var $pos = props.view.state.selection.$from;
511
+ var table = cells.length ? (0, utils_1.parentNode)($pos, function (n) { return n.type.spec.tableRole === 'table'; }) : null;
512
+ if (!table) {
513
+ return initialData;
514
+ }
515
+ var tableParent = (0, utils_1.parentNode)($pos, function (n) { return n.type.name === 'table_wrapper'; });
516
+ var captionStr = '';
517
+ var captionStyles = {};
518
+ var parentStyles = {};
519
+ if (tableParent) {
520
+ parentStyles = (0, utils_2.parseStyle)(tableParent.node.attrs.style);
521
+ tableParent.node.content.forEach(function (node) {
522
+ if (node.type.name === 'table_caption_external') {
523
+ var fr = (0, kendo_editor_common_1.pmDocToFragment)(node);
524
+ captionStr = (0, kendo_editor_common_1.fragmentToHtml)(fr);
525
+ captionStyles = (0, utils_2.parseStyle)(node.attrs.style);
526
+ }
527
+ });
528
+ }
529
+ var styles = (0, utils_2.parseStyle)(((_a = table.node.attrs) === null || _a === void 0 ? void 0 : _a.style) || '');
530
+ var map = kendo_editor_common_1.TableMap.get(table.node);
531
+ var pos = (parentStyles['margin-left'] === 'auto' && parentStyles['margin-right'] === 'auto') ? tablePosition.find(function (p) { return p.value === 'center'; }) :
532
+ parentStyles['margin-right'] === 'auto' ? tablePosition.find(function (p) { return p.value === 'left'; }) :
533
+ parentStyles['margin-left'] === 'auto' ? tablePosition.find(function (p) { return p.value === 'right'; }) : null;
534
+ var headerCells = headerCellsCount(table.node, map);
535
+ return __assign(__assign(__assign(__assign(__assign({}, initialData), { columns: map.width, rows: map.height }), (0, utils_2.nodeSize)(table.node, 'width')), (0, utils_2.nodeSize)(table.node, 'height')), { textAlign: styles['text-align'] || '', position: pos || null, cellPadding: styles.padding ? parseFloat(styles.padding) : null, cellSpacing: styles['border-spacing'] ? parseFloat(styles['border-spacing']) : null, backgroundColor: styles['background-color'], borderWidth: styles['border-width'] ? parseFloat(styles['border-width']) : null, borderColor: styles['border-color'], borderStyle: styles['border-style'], collapseBorders: styles['border-collapse'] === 'collapse', caption: captionStr, captionAlignment: captionStyles['text-align'], captionPosition: captionStyles['caption-side'], headerRows: headerCells.rows, headerColumns: headerCells.columns,
536
+ // associateHeaders
537
+ id: (_b = table.node.attrs) === null || _b === void 0 ? void 0 : _b.id, className: (_c = table.node.attrs) === null || _c === void 0 ? void 0 : _c.class });
538
+ }, [props.view]);
539
+ var loc = (0, kendo_react_intl_1.useLocalization)();
540
+ var _a = React.useState(0), selected = _a[0], setSelected = _a[1];
541
+ var onSelect = React.useCallback(function (event) {
542
+ setSelected(event.selected);
543
+ }, []);
544
+ // General tab refs
545
+ var rows = React.useRef(null);
546
+ var columns = React.useRef(null);
547
+ var width = React.useRef(null);
548
+ var height = React.useRef(null);
549
+ var cellSpacing = React.useRef(null);
550
+ var cellPadding = React.useRef(null);
551
+ var borderWidth = React.useRef(null);
552
+ var widthUnit = React.useRef(null);
553
+ var heightUnit = React.useRef(null);
554
+ var position = React.useRef(null);
555
+ var alignment = React.useRef(null);
556
+ var borderStyle = React.useRef(null);
557
+ var backgroundColor = React.useRef(null);
558
+ var borderColor = React.useRef(null);
559
+ var collapseBorders = React.useRef(null);
560
+ // Advanced tab refs
561
+ var id = React.useRef(null);
562
+ var className = React.useRef(null);
563
+ var caption = React.useRef(null);
564
+ var headerRows = React.useRef(null);
565
+ var headerColumns = React.useRef(null);
566
+ var captionAlignment = React.useRef(null);
567
+ var captionPosition = React.useRef(null);
568
+ var associateHeaders = React.useRef(null);
569
+ var onSave = React.useCallback(function () {
570
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
571
+ var data = {
572
+ rows: ((_a = rows.current) === null || _a === void 0 ? void 0 : _a.value) || 0,
573
+ columns: ((_b = columns.current) === null || _b === void 0 ? void 0 : _b.value) || 0,
574
+ width: width.current ? width.current.value : null,
575
+ height: height.current ? height.current.value : null,
576
+ cellSpacing: cellSpacing.current ? cellSpacing.current.value : null,
577
+ cellPadding: cellPadding.current ? cellPadding.current.value : null,
578
+ borderWidth: borderWidth.current ? borderWidth.current.value : null,
579
+ widthUnit: ((_c = widthUnit.current) === null || _c === void 0 ? void 0 : _c.value) || '',
580
+ heightUnit: ((_d = heightUnit.current) === null || _d === void 0 ? void 0 : _d.value) || '',
581
+ position: ((_e = position.current) === null || _e === void 0 ? void 0 : _e.value) || null,
582
+ textAlign: ((_f = alignment.current) === null || _f === void 0 ? void 0 : _f.value) ? alignment.current.value.value : null,
583
+ borderStyle: ((_g = borderStyle.current) === null || _g === void 0 ? void 0 : _g.value) ? borderStyle.current.value.value : null,
584
+ backgroundColor: (_h = backgroundColor.current) === null || _h === void 0 ? void 0 : _h.value,
585
+ borderColor: (_j = borderColor.current) === null || _j === void 0 ? void 0 : _j.value,
586
+ collapseBorders: Boolean((_l = (_k = collapseBorders.current) === null || _k === void 0 ? void 0 : _k.element) === null || _l === void 0 ? void 0 : _l.checked),
587
+ id: String(((_m = id.current) === null || _m === void 0 ? void 0 : _m.value) || ''),
588
+ className: String(((_o = className.current) === null || _o === void 0 ? void 0 : _o.value) || ''),
589
+ caption: String(((_p = caption.current) === null || _p === void 0 ? void 0 : _p.value) || ''),
590
+ headerRows: ((_q = headerRows.current) === null || _q === void 0 ? void 0 : _q.value) || 0,
591
+ headerColumns: ((_r = headerColumns.current) === null || _r === void 0 ? void 0 : _r.value) || 0,
592
+ captionAlignment: ((_s = captionAlignment.current) === null || _s === void 0 ? void 0 : _s.value) ? captionAlignment.current.value.value : null,
593
+ captionPosition: ((_t = captionPosition.current) === null || _t === void 0 ? void 0 : _t.value) ? captionPosition.current.value.value : null,
594
+ associateHeaders: ((_u = associateHeaders.current) === null || _u === void 0 ? void 0 : _u.value) ? associateHeaders.current.value.value : 'none'
595
+ };
596
+ props.onSave.call(undefined, data);
597
+ }, [props.onSave]);
598
+ var general = (React.createElement("div", { className: "k-form k-form-md" },
599
+ React.createElement("fieldset", { className: "k-form-fieldset" },
600
+ React.createElement("div", { className: "k-form-layout k-d-grid k-grid-cols-4 k-gap-x-4" },
601
+ React.createElement("div", { className: "k-form-field k-col-span-2" },
602
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesRows, messages_1.messages[messages_1.keys.tablePropertiesRows])),
603
+ React.createElement("div", { className: "k-form-field-wrap" },
604
+ React.createElement(kendo_react_inputs_1.NumericTextBox, { ref: rows, defaultValue: defaults.rows, min: 1 }))),
605
+ React.createElement("div", { className: "k-form-field k-col-span-2" },
606
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesColumns, messages_1.messages[messages_1.keys.tablePropertiesColumns])),
607
+ React.createElement("div", { className: "k-form-field-wrap" },
608
+ React.createElement(kendo_react_inputs_1.NumericTextBox, { ref: columns, defaultValue: defaults.columns, min: 1 }))),
609
+ React.createElement("div", { className: "k-form-field k-col-span-1" },
610
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesWidth, messages_1.messages[messages_1.keys.tablePropertiesWidth])),
611
+ React.createElement("div", { className: "k-form-field-wrap" },
612
+ React.createElement(kendo_react_inputs_1.NumericTextBox, { ref: width, defaultValue: defaults.width, min: 0, placeholder: loc.toLanguageString(messages_1.keys.sizeAuto, messages_1.messages[messages_1.keys.sizeAuto]) }))),
613
+ React.createElement("div", { className: "k-form-field k-col-span-1" },
614
+ React.createElement("label", { className: "k-label k-form-label" }, "\u00A0"),
615
+ React.createElement("div", { className: "k-form-field-wrap" },
616
+ React.createElement(kendo_react_dropdowns_1.AutoComplete, { ref: widthUnit, defaultValue: defaults.widthUnit, data: utils_1.units, popupSettings: utils_1.popupSettings }))),
617
+ React.createElement("div", { className: "k-form-field k-col-span-1" },
618
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesHeight, messages_1.messages[messages_1.keys.tablePropertiesHeight])),
619
+ React.createElement("div", { className: "k-form-field-wrap" },
620
+ React.createElement(kendo_react_inputs_1.NumericTextBox, { ref: height, defaultValue: defaults.height, min: 0, placeholder: loc.toLanguageString(messages_1.keys.sizeAuto, messages_1.messages[messages_1.keys.sizeAuto]) }))),
621
+ React.createElement("div", { className: "k-form-field k-col-span-1" },
622
+ React.createElement("label", { className: "k-label k-form-label" }, "\u00A0"),
623
+ React.createElement("div", { className: "k-form-field-wrap" },
624
+ React.createElement(kendo_react_dropdowns_1.AutoComplete, { ref: heightUnit, defaultValue: defaults.heightUnit, data: utils_1.units, popupSettings: utils_1.popupSettings }))),
625
+ React.createElement("div", { className: "k-form-field k-col-span-2" },
626
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesPosition, messages_1.messages[messages_1.keys.tablePropertiesPosition])),
627
+ React.createElement("div", { className: "k-form-field-wrap" },
628
+ React.createElement(kendo_react_dropdowns_1.DropDownList, { ref: position, defaultValue: defaults.position, popupSettings: utils_1.popupSettings, data: tablePosition.map(function (i) { return (__assign(__assign({}, i), { text: loc.toLanguageString(i.textKey, i.text) })); }), textField: 'text', dataItemKey: 'value', valueRender: tableCellProperties_1.valueRenderWithIcon, itemRender: tableCellProperties_1.itemRenderWithIcon }))),
629
+ React.createElement("div", { className: "k-form-field k-col-span-2" },
630
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesAlignment, messages_1.messages[messages_1.keys.tablePropertiesAlignment])),
631
+ React.createElement("div", { className: "k-form-field-wrap" },
632
+ React.createElement(kendo_react_dropdowns_1.DropDownList, { ref: alignment, defaultValue: alignData.find(function (a) { return a.value === defaults.textAlign; }), data: alignData.map(function (i) { return (__assign(__assign({}, i), { text: loc.toLanguageString(i.textKey, i.text) })); }), textField: 'text', dataItemKey: 'value', popupSettings: utils_1.popupSettings, valueRender: tableCellProperties_1.valueRenderWithIcon, itemRender: tableCellProperties_1.itemRenderWithIcon }))),
633
+ React.createElement("div", { className: "k-form-field k-col-span-2" },
634
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesCellSpacing, messages_1.messages[messages_1.keys.tablePropertiesCellSpacing])),
635
+ React.createElement("div", { className: "k-form-field-wrap" },
636
+ React.createElement(kendo_react_inputs_1.NumericTextBox, { ref: cellSpacing, defaultValue: defaults.cellSpacing, placeholder: loc.toLanguageString(messages_1.keys.sizeAuto, messages_1.messages[messages_1.keys.sizeAuto]), min: 0 }))),
637
+ React.createElement("div", { className: "k-form-field k-col-span-2" },
638
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesCellPadding, messages_1.messages[messages_1.keys.tablePropertiesCellPadding])),
639
+ React.createElement("div", { className: "k-form-field-wrap" },
640
+ React.createElement(kendo_react_inputs_1.NumericTextBox, { ref: cellPadding, defaultValue: defaults.cellPadding, placeholder: loc.toLanguageString(messages_1.keys.sizeAuto, messages_1.messages[messages_1.keys.sizeAuto]), min: 0 }))),
641
+ React.createElement("div", { className: "k-form-field k-col-span-full" },
642
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesTableBackground, messages_1.messages[messages_1.keys.tablePropertiesTableBackground])),
643
+ React.createElement("div", { className: "k-form-field-wrap" },
644
+ React.createElement(kendo_react_inputs_1.ColorPicker, { ref: backgroundColor, defaultValue: defaults.backgroundColor }))),
645
+ React.createElement("div", { className: "k-form-field k-col-span-1" },
646
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesBorderWidth, messages_1.messages[messages_1.keys.tablePropertiesBorderWidth])),
647
+ React.createElement("div", { className: "k-form-field-wrap" },
648
+ React.createElement(kendo_react_inputs_1.NumericTextBox, { ref: borderWidth, defaultValue: defaults.borderWidth, min: 0 }))),
649
+ React.createElement("div", { className: "k-form-field k-col-span-1" },
650
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesBorderColor, messages_1.messages[messages_1.keys.tablePropertiesBorderColor])),
651
+ React.createElement("div", { className: "k-form-field-wrap" },
652
+ React.createElement(kendo_react_inputs_1.ColorPicker, { ref: borderColor, defaultValue: defaults.borderColor }))),
653
+ React.createElement("div", { className: "k-form-field k-col-span-2" },
654
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesBorderStyle, messages_1.messages[messages_1.keys.tablePropertiesBorderStyle])),
655
+ React.createElement("div", { className: "k-form-field-wrap" },
656
+ React.createElement(kendo_react_dropdowns_1.DropDownList, { ref: borderStyle, defaultValue: utils_1.borderStyles.find(function (s) { return s.value === defaults.borderStyle; }), popupSettings: utils_1.popupSettings, data: utils_1.borderStyles.map(function (i) { return (__assign(__assign({}, i), { text: loc.toLanguageString(i.textKey, i.text) })); }), textField: 'text', dataItemKey: 'value' }))),
657
+ React.createElement("div", { className: "k-form-field k-col-span-full" },
658
+ React.createElement("div", { className: "k-form-field-wrap" },
659
+ React.createElement(kendo_react_inputs_1.Checkbox, { ref: collapseBorders, className: "k-checkbox-wrap", label: loc.toLanguageString(messages_1.keys.tablePropertiesCollapseBorders, messages_1.messages[messages_1.keys.tablePropertiesCollapseBorders]), defaultChecked: defaults.collapseBorders })))))));
660
+ var advanced = (React.createElement("div", { className: "k-form k-form-md" },
661
+ React.createElement("fieldset", { className: "k-form-fieldset" },
662
+ React.createElement("div", { className: "k-form-layout k-d-grid" },
663
+ React.createElement("div", { className: "k-form-field" },
664
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesId, messages_1.messages[messages_1.keys.tablePropertiesId])),
665
+ React.createElement("div", { className: "k-form-field-wrap" },
666
+ React.createElement(kendo_react_inputs_1.TextBox, { ref: id, defaultValue: defaults.id }))),
667
+ React.createElement("div", { className: "k-form-field" },
668
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesCssClass, messages_1.messages[messages_1.keys.tablePropertiesCssClass])),
669
+ React.createElement("div", { className: "k-form-field-wrap" },
670
+ React.createElement(kendo_react_inputs_1.TextBox, { ref: className, defaultValue: defaults.className }))),
671
+ React.createElement("fieldset", { className: "k-form-fieldset" },
672
+ React.createElement("legend", { className: "k-form-legend" }, loc.toLanguageString(messages_1.keys.tablePropertiesAccessibility, messages_1.messages[messages_1.keys.tablePropertiesAccessibility])),
673
+ React.createElement("div", { className: "k-d-grid k-grid-cols-4 k-gap-x-4" },
674
+ React.createElement("div", { className: "k-form-field k-col-span-full" },
675
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesCaption, messages_1.messages[messages_1.keys.tablePropertiesCaption])),
676
+ React.createElement("div", { className: "k-form-field-wrap" },
677
+ React.createElement(kendo_react_inputs_1.TextBox, { ref: caption, defaultValue: defaults.caption }))),
678
+ React.createElement("div", { className: "k-form-field k-col-span-2" },
679
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesCaptionPosition, messages_1.messages[messages_1.keys.tablePropertiesCaptionPosition])),
680
+ React.createElement("div", { className: "k-form-field-wrap" },
681
+ React.createElement(kendo_react_dropdowns_1.DropDownList, { ref: captionPosition, defaultValue: captionPositionData.find(function (i) { return i.value === defaults.captionPosition; }), data: captionPositionData.map(function (i) { return (__assign(__assign({}, i), { text: loc.toLanguageString(i.textKey, i.text) })); }), popupSettings: utils_1.popupSettings, textField: 'text', dataItemKey: 'value', valueRender: tableCellProperties_1.valueRenderWithIcon, itemRender: tableCellProperties_1.itemRenderWithIcon }))),
682
+ React.createElement("div", { className: "k-form-field k-col-span-2" },
683
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesCaptionAlignment, messages_1.messages[messages_1.keys.tablePropertiesCaptionAlignment])),
684
+ React.createElement("div", { className: "k-form-field-wrap" },
685
+ React.createElement(kendo_react_dropdowns_1.DropDownList, { ref: captionAlignment, defaultValue: alignData.find(function (i) { return i.value === defaults.captionAlignment; }), data: alignData.map(function (i) { return (__assign(__assign({}, i), { text: loc.toLanguageString(i.textKey, i.text) })); }), popupSettings: utils_1.popupSettings, textField: 'text', dataItemKey: 'value', valueRender: tableCellProperties_1.valueRenderWithIcon, itemRender: tableCellProperties_1.itemRenderWithIcon }))),
686
+ React.createElement("div", { className: "k-form-field k-col-span-1" },
687
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesHeaderRows, messages_1.messages[messages_1.keys.tablePropertiesHeaderRows])),
688
+ React.createElement("div", { className: "k-form-field-wrap" },
689
+ React.createElement(kendo_react_inputs_1.NumericTextBox, { ref: headerRows, defaultValue: defaults.headerRows, min: 0 }))),
690
+ React.createElement("div", { className: "k-form-field k-col-span-1" },
691
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesHeaderCols, messages_1.messages[messages_1.keys.tablePropertiesHeaderCols])),
692
+ React.createElement("div", { className: "k-form-field-wrap" },
693
+ React.createElement(kendo_react_inputs_1.NumericTextBox, { ref: headerColumns, defaultValue: defaults.headerColumns, min: 0 }))),
694
+ React.createElement("div", { className: "k-form-field k-col-span-2" },
695
+ React.createElement("label", { className: "k-label k-form-label" }, loc.toLanguageString(messages_1.keys.tablePropertiesAssociateHeaders, messages_1.messages[messages_1.keys.tablePropertiesAssociateHeaders])),
696
+ React.createElement("div", { className: "k-form-field-wrap" },
697
+ React.createElement(kendo_react_dropdowns_1.DropDownList, { ref: associateHeaders, defaultValue: associateHeadersData[0], data: associateHeadersData.map(function (i) { return (__assign(__assign({}, i), { text: loc.toLanguageString(i.textKey, i.text) })); }), popupSettings: utils_1.popupSettings, textField: 'text', dataItemKey: 'value' })))))))));
698
+ var content = (React.createElement(kendo_react_layout_1.TabStrip, { selected: selected, onSelect: onSelect, animation: false, keepTabsMounted: true },
699
+ React.createElement(kendo_react_layout_1.TabStripTab, { title: loc.toLanguageString(messages_1.keys.tablePropertiesGeneral, messages_1.messages[messages_1.keys.tablePropertiesGeneral]) }, general),
700
+ React.createElement(kendo_react_layout_1.TabStripTab, { title: loc.toLanguageString(messages_1.keys.tablePropertiesAdvanced, messages_1.messages[messages_1.keys.tablePropertiesAdvanced]) }, advanced)));
701
+ var actionButtons = [(React.createElement(kendo_react_buttons_1.Button, { themeColor: 'primary', key: "save", onClick: onSave }, loc.toLanguageString(messages_1.keys.tablePropertiesSave, messages_1.messages[messages_1.keys.tablePropertiesSave]))), (React.createElement(kendo_react_buttons_1.Button, { onClick: props.onClose, key: "cancel" }, loc.toLanguageString(messages_1.keys.tablePropertiesCancel, messages_1.messages[messages_1.keys.tablePropertiesCancel])))];
702
+ return (React.createElement(kendo_react_dialogs_1.Window, { className: 'k-editor-window k-editor-table-wizard-window', title: loc.toLanguageString(messages_1.keys.tableProperties, messages_1.messages[messages_1.keys.tableProperties]), onClose: props.onClose, key: "dialog", style: { userSelect: 'none' }, width: 480, height: 630, modal: true, minimizeButton: function () { return null; }, maximizeButton: function () { return null; }, resizable: false },
703
+ content,
704
+ React.createElement.apply(React, __spreadArray([kendo_react_dialogs_1.WindowActionsBar, { layout: 'start' }], actionButtons, false))));
705
+ };