vsn 0.1.118 → 0.1.119

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": "vsn",
3
- "version": "0.1.118",
3
+ "version": "0.1.119",
4
4
  "description": "SEO Friendly Javascript/Typescript Framework",
5
5
  "keywords": [
6
6
  "framework",
package/src/Tag.ts CHANGED
@@ -39,7 +39,24 @@ export class Tag extends DOMObject {
39
39
  '@html',
40
40
  '@class',
41
41
  '@value',
42
- '@disabled'
42
+ '@disabled',
43
+ '@hidden',
44
+ '@selected',
45
+ '@readonly',
46
+ '@multiple',
47
+ '@required',
48
+ '@autofocus',
49
+ ];
50
+
51
+ public static readonly flagAttributes: string[] = [
52
+ '@disabled',
53
+ '@hidden',
54
+ '@checked',
55
+ '@selected',
56
+ '@readonly',
57
+ '@multiple',
58
+ '@required',
59
+ '@autofocus',
43
60
  ];
44
61
 
45
62
  protected inputTags: string[] = [
@@ -396,11 +413,12 @@ export class Tag extends DOMObject {
396
413
  const classes: string[] = value instanceof Array ? value : [value];
397
414
  if (classes.length)
398
415
  this.element.classList.add(...classes);
399
- } else if (key === '@disabled') {
416
+ } else if (Tag.flagAttributes.indexOf(key) > -1) {
417
+ const attrKey = key.replace('@', '');
400
418
  if (!!value) {
401
- this.element.setAttribute('disabled', '');
419
+ this.element.setAttribute(attrKey, '');
402
420
  } else {
403
- this.element.removeAttribute('disabled');
421
+ this.element.removeAttribute(attrKey);
404
422
  }
405
423
  }
406
424
  } else {
@@ -418,8 +436,9 @@ export class Tag extends DOMObject {
418
436
  return this.value;
419
437
  else if (key === '@class') {
420
438
  return Array.from(this.element.classList);
421
- } else if (key === '@disabled') {
422
- return this.element.hasAttribute('disabled');
439
+ } else if (Tag.flagAttributes.indexOf(key) > -1) {
440
+ const attrKey = key.replace('@', '');
441
+ return this.element.hasAttribute(attrKey);
423
442
  }
424
443
  }
425
444
  return this.element.getAttribute(key);
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.1.118';
1
+ export const VERSION = '0.1.119';
2
2