@design.estate/dees-catalog 1.0.217 → 1.0.219
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/dist_bundle/bundle.js +3 -3
- package/dist_bundle/bundle.js.map +3 -3
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/dees-table.d.ts +1 -1
- package/dist_ts_web/elements/dees-table.js +10 -9
- package/dist_watch/bundle.js +9 -7
- package/dist_watch/bundle.js.map +3 -3
- package/package.json +1 -1
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/dees-table.ts +9 -7
package/package.json
CHANGED
|
@@ -269,7 +269,7 @@ export class DeesTable<T> extends DeesElement {
|
|
|
269
269
|
left: 0px;
|
|
270
270
|
position: absolute;
|
|
271
271
|
background: #fa610140;
|
|
272
|
-
color:
|
|
272
|
+
color: ${cssManager.bdTheme('#333', '#fff')};
|
|
273
273
|
font-family: inherit;
|
|
274
274
|
font-size: inherit;
|
|
275
275
|
font-weight: inherit;
|
|
@@ -603,8 +603,11 @@ export class DeesTable<T> extends DeesElement {
|
|
|
603
603
|
return actions;
|
|
604
604
|
}
|
|
605
605
|
|
|
606
|
-
handleCellEditing(event: Event, itemArg: T, key: string) {
|
|
606
|
+
async handleCellEditing(event: Event, itemArg: T, key: string) {
|
|
607
|
+
const domtools = await this.domtoolsPromise;
|
|
607
608
|
const target = event.target as HTMLElement;
|
|
609
|
+
const originalColor = target.style.color;
|
|
610
|
+
target.style.color = 'transparent';
|
|
608
611
|
const transformedItem = this.displayFunction(itemArg);
|
|
609
612
|
const initialValue = (transformedItem[key] as unknown as string) || '';
|
|
610
613
|
// Create an input element
|
|
@@ -612,16 +615,16 @@ export class DeesTable<T> extends DeesElement {
|
|
|
612
615
|
input.type = 'text';
|
|
613
616
|
input.value = initialValue;
|
|
614
617
|
|
|
615
|
-
const blurInput = (blurArg = true, saveArg = false) => {
|
|
618
|
+
const blurInput = async (blurArg = true, saveArg = false) => {
|
|
616
619
|
if (blurArg) {
|
|
617
620
|
input.blur();
|
|
618
621
|
}
|
|
619
622
|
if (saveArg) {
|
|
620
623
|
itemArg[key] = input.value as any; // Convert string to T (you might need better type casting depending on your data structure)
|
|
621
|
-
target.innerHTML = input.value; // Update the cell's display
|
|
622
|
-
} else {
|
|
623
|
-
target.innerHTML = initialValue;
|
|
624
624
|
}
|
|
625
|
+
input.remove();
|
|
626
|
+
target.style.color = originalColor;
|
|
627
|
+
this.requestUpdate();
|
|
625
628
|
};
|
|
626
629
|
|
|
627
630
|
// When the input loses focus or the Enter key is pressed, update the data
|
|
@@ -635,7 +638,6 @@ export class DeesTable<T> extends DeesElement {
|
|
|
635
638
|
});
|
|
636
639
|
|
|
637
640
|
// Replace the cell's content with the input
|
|
638
|
-
target.innerHTML = '';
|
|
639
641
|
target.appendChild(input);
|
|
640
642
|
input.focus();
|
|
641
643
|
}
|