@design.estate/dees-catalog 1.0.217 → 1.0.218
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 +2 -2
- 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 +6 -8
- package/dist_watch/bundle.js +5 -6
- 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 +5 -6
package/package.json
CHANGED
|
@@ -603,7 +603,8 @@ 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;
|
|
608
609
|
const transformedItem = this.displayFunction(itemArg);
|
|
609
610
|
const initialValue = (transformedItem[key] as unknown as string) || '';
|
|
@@ -612,16 +613,15 @@ export class DeesTable<T> extends DeesElement {
|
|
|
612
613
|
input.type = 'text';
|
|
613
614
|
input.value = initialValue;
|
|
614
615
|
|
|
615
|
-
const blurInput = (blurArg = true, saveArg = false) => {
|
|
616
|
+
const blurInput = async (blurArg = true, saveArg = false) => {
|
|
616
617
|
if (blurArg) {
|
|
617
618
|
input.blur();
|
|
618
619
|
}
|
|
619
620
|
if (saveArg) {
|
|
620
621
|
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
622
|
}
|
|
623
|
+
input.remove();
|
|
624
|
+
this.requestUpdate();
|
|
625
625
|
};
|
|
626
626
|
|
|
627
627
|
// When the input loses focus or the Enter key is pressed, update the data
|
|
@@ -635,7 +635,6 @@ export class DeesTable<T> extends DeesElement {
|
|
|
635
635
|
});
|
|
636
636
|
|
|
637
637
|
// Replace the cell's content with the input
|
|
638
|
-
target.innerHTML = '';
|
|
639
638
|
target.appendChild(input);
|
|
640
639
|
input.focus();
|
|
641
640
|
}
|