mdkcontroller 1.2.2 → 1.2.3

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.
@@ -1,3 +1,14 @@
1
+ .dk-table textarea {
2
+ resize: none;
3
+ overflow: auto;
4
+ scrollbar-width: none;
5
+ }
6
+
7
+ .dk-table textarea::-webkit-scrollbar {
8
+ display: none;
9
+ /* Chrome & Safari */
10
+ }
11
+
1
12
  .dk-table {
2
13
  font-family: Arial, Helvetica, sans-serif;
3
14
  border-collapse: collapse;
@@ -7,6 +18,7 @@
7
18
 
8
19
  .dk-table td {
9
20
  border: 1px solid #ddd;
21
+ overflow: hidden;
10
22
  }
11
23
 
12
24
  .dk-table th {
@@ -55,7 +67,7 @@
55
67
  .dk-table .RowNavigator td {
56
68
  background: white;
57
69
  border-bottom: 1px solid #ff2828d6;
58
- border-radius: 7px;
70
+ /* border-radius: 7px; */
59
71
  }
60
72
 
61
73
  .dk-table .edit {
@@ -67,6 +79,7 @@
67
79
  }
68
80
 
69
81
  .dk-table .RowNavigator td>input,
82
+ .dk-table .RowNavigator td>textarea,
70
83
  .dk-table .RowNavigator td>select {
71
84
  height: 23px;
72
85
  font-size: 18px;
@@ -80,51 +93,28 @@
80
93
  background-color: #f1f1f1;
81
94
  }
82
95
 
83
- .dk-table .edit input[type="checkbox"] {
96
+ /* .dk-table .edit input[type="checkbox"] {
84
97
  min-height: 22px;
85
98
  width: 30px;
86
99
  margin: auto;
87
100
  display: block;
88
- }
101
+ } */
89
102
 
90
- .dk-table .edit input[type="checkbox"]:disabled {
103
+ /* .dk-table .edit input[type="checkbox"]:disabled {
91
104
  cursor: not-allowed;
92
105
  }
93
106
 
94
107
  .dk-table .edit input:not([type="checkbox"]) :focus {
95
108
  outline: 1px solid rgba(65, 185, 65, 0.705);
96
- }
109
+ } */
97
110
 
98
- .dk-table .edit input:not(:disabled),
99
- .dk-table .edit select {
111
+ .dk-table .edit td * {
100
112
  display: block;
101
- color: #495057;
102
- background-color: #fff;
103
- background-image: none;
104
- background-clip: padding-box;
105
- border: 1px solid rgba(0, 0, 0, 0.15);
106
- border-radius: 0.25rem;
107
- transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
108
113
  width: -webkit-fill-available;
109
114
  padding: 0;
115
+ border: 0px;
110
116
  outline: none;
111
- }
112
-
113
- .dk-actionsBar {
114
- padding: 5px 10px;
115
- width: max-content;
116
- }
117
-
118
- .dk-actionsBar button {
119
- border: 2px solid #0e9966b6;
120
- border-radius: 5px;
121
- cursor: pointer;
122
- transition: all 1s;
123
- }
124
-
125
- .dk-actionsBar button:active,
126
- .dk-actionsBar button:hover {
127
- border-color: #0fbd7db6;
117
+ font-family: sans-serif;
128
118
  }
129
119
 
130
120
  .active {
@@ -65,12 +65,13 @@ class DKGrid {
65
65
  let totalWidth = 0;
66
66
  const colWidths = this.config.column.map(f => {
67
67
  let width = f.width || (f.dataType === "string" ? 200 : f.dataType === "date" ? 140 : f.dataType === "number" ? 100 : 80);
68
+ f.width = width;
68
69
  totalWidth += width;
69
70
  return `<col style="width: ${width}px;">`;
70
71
  }).join("");
71
72
  this.editorDefault = '<tr>' + this.config.column.map(f => {
72
73
  switch (f.dataType) {
73
- case "string": return `<td><input type='text'name='${f.fieldName}'/></td>`;
74
+ case "string": return `<td><textarea name='${f.fieldName}'></textarea></td>`;
74
75
  case "bool": return `<td><input type="checkbox" name='${f.fieldName}'></td>`;
75
76
  case "date": return `<td><input type="date" name='${f.fieldName}'></td>`;
76
77
  case "number": return `<td><input type="number" name='${f.fieldName}'></td>`;
@@ -142,8 +143,9 @@ class DKGrid {
142
143
  const dkgrid = this;
143
144
  this.tableEditor.addEventListener('keydown', function (event) {
144
145
  const keyCode = event.keyCode || event.which;
145
-
146
- dkgrid.#keyDownOnTable(keyCode);
146
+ if (!event.shiftKey) {
147
+ dkgrid.#keyDownOnTable(keyCode);
148
+ }
147
149
  });
148
150
 
149
151
  this.tableRaw.addEventListener('click', function (event) {
@@ -245,8 +247,9 @@ class DKGrid {
245
247
  tbEditor.querySelector('tbody').querySelectorAll('td').forEachExt(
246
248
  child => {
247
249
  const input = child.firstChild;
250
+ input.style.height = (trTag.clientHeight) + 'px';
248
251
  try {
249
- if (input.tagName == "INPUT" || input.tagName == "SELECT") {
252
+ if (input.tagName == "INPUT" || input.tagName == "SELECT" || input.tagName == "TEXTAREA") {
250
253
  if (input.tagName == "SELECT") {
251
254
  let itemSelector = tableConfig.column.find(f => f.fieldName == input.name).items;
252
255
  this.fireEvent('onSelectorSelecting', (rs) => {
@@ -289,7 +292,7 @@ class DKGrid {
289
292
  tbEditor.querySelector('tbody').querySelectorAll('td').forEachExt(
290
293
  child => {
291
294
  const input = child.firstChild;
292
- if (input.tagName == "INPUT" || input.tagName == "SELECT") {
295
+ if (input.tagName == "INPUT" || input.tagName == "SELECT" || input.tagName == "TEXTAREA") {
293
296
  objectEditing[input.name] = input.value;
294
297
  if (input.type == 'checkbox') {
295
298
  objectEditing[input.name] = input.checked;
@@ -476,7 +479,7 @@ class DKGrid {
476
479
  this.fireEvent('onAddNewRow', null, newOb);
477
480
  }
478
481
  if (!newOb[primaryKey]) {
479
- newOb[primaryKey] = DKGrid.generateRandomString(32);
482
+ newOb[primaryKey] = Date.now() + '_' + DKGrid.generateRandomString(12);
480
483
  }
481
484
  newTR.dataset.primaryValue = newOb[primaryKey];
482
485
  const cache = this.#cache;
package/package.json CHANGED
@@ -5,11 +5,12 @@
5
5
  "express": "^4.18.2",
6
6
  "fluent-ffmpeg": "^2.1.2",
7
7
  "handlebars": "^4.7.8",
8
+ "js-yaml": "^4.1.0",
8
9
  "lowdb": "^7.0.1",
9
10
  "socket.io": "^4.7.2"
10
11
  },
11
12
  "name": "mdkcontroller",
12
- "version": "1.2.2",
13
+ "version": "1.2.3",
13
14
  "keywords": [],
14
15
  "author": "KHANHNBD <khanh272421@gmail.com>",
15
16
  "license": "ISC",
@@ -27,4 +28,4 @@
27
28
  "Cores/",
28
29
  "dk_modules/"
29
30
  ]
30
- }
31
+ }