@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design.estate/dees-catalog",
3
- "version": "1.0.217",
3
+ "version": "1.0.219",
4
4
  "private": false,
5
5
  "description": "website for lossless.com",
6
6
  "main": "dist_ts_web/index.js",
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/dees-catalog',
6
- version: '1.0.217',
6
+ version: '1.0.219',
7
7
  description: 'website for lossless.com'
8
8
  }
@@ -269,7 +269,7 @@ export class DeesTable<T> extends DeesElement {
269
269
  left: 0px;
270
270
  position: absolute;
271
271
  background: #fa610140;
272
- color: inherit;
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
  }