@pictogrammers/components 0.5.5 → 0.5.6

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@pictogrammers/components",
3
3
  "type": "module",
4
- "version": "0.5.5",
4
+ "version": "0.5.6",
5
5
  "license": "MIT",
6
6
  "author": "Austin Andrews",
7
7
  "scripts": {
@@ -21,6 +21,10 @@ export default class PgInputText extends HTMLElement {
21
21
  this.$input.addEventListener('change', this.handleChange.bind(this));
22
22
  }
23
23
 
24
+ focus() {
25
+ this.$input.focus();
26
+ }
27
+
24
28
  skipValue = false;
25
29
 
26
30
  render(changes) {
@@ -57,5 +57,11 @@ export default class PgModalConfirm extends PgOverlay {
57
57
  if (changes.message) {
58
58
  this.$message.textContent = this.message;
59
59
  }
60
+ if (changes.okay) {
61
+ this.$okay.textContent = this.okay;
62
+ }
63
+ if (changes.cancel) {
64
+ this.$cancel.textContent = this.cancel;
65
+ }
60
66
  }
61
67
  }
@@ -3,9 +3,13 @@ import { Component, Prop } from '@pictogrammers/element';
3
3
  const layers: Set<HTMLElement> = new Set();
4
4
  const promises: Map<HTMLElement, (value: any) => void> = new Map();
5
5
 
6
+ type OmitByPrefix<T, Prefix extends string> = {
7
+ [K in keyof T as K extends `${Prefix}${string}` ? never : K]: T[K];
8
+ };
9
+
6
10
  @Component()
7
11
  export default class PgOverlay extends HTMLElement {
8
- static open<T extends typeof PgOverlay>(this: T, props: Partial<Omit<InstanceType<T>, keyof PgOverlay>>): Promise<any> {
12
+ static open<T extends typeof PgOverlay>(this: T, props: Partial<OmitByPrefix<Omit<InstanceType<T>, keyof PgOverlay>, '$'>>): Promise<any> {
9
13
  var ele = document.createElement(this.name);
10
14
  props && Object.assign(ele, props);
11
15
  document.body.appendChild(ele);