flinker-dom 1.0.10 → 1.0.12

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.
@@ -77,13 +77,15 @@ export class StyleSheetProcessor {
77
77
  this.list = Array.of();
78
78
  const all = ['none', 'hover', 'focus', 'placeholder'];
79
79
  all.forEach(t => {
80
- switch (t) {
81
- case ('hover'):
82
- this.hash.set('hover', new HoverPseudoClass(styleSheet));
83
- break;
84
- default:
85
- this.hash.set(t, new PseudoClass(t, styleSheet));
86
- break;
80
+ if (t === 'hover') {
81
+ const pc = new HoverPseudoClass(styleSheet);
82
+ this.hash.set('hover', pc);
83
+ this.list.push(pc);
84
+ }
85
+ else {
86
+ const pc = new PseudoClass(t, styleSheet, t === 'placeholder' ? '::' : ':');
87
+ this.hash.set(t, pc);
88
+ this.list.push(pc);
87
89
  }
88
90
  });
89
91
  }
@@ -107,15 +109,16 @@ export class StyleSheetProcessor {
107
109
  }
108
110
  }
109
111
  export class PseudoClass {
110
- constructor(type, styleSheet) {
112
+ constructor(type, styleSheet, divider = ':') {
111
113
  this.type = type;
112
114
  this.styleSheet = styleSheet;
113
115
  this.style = '';
114
116
  this.hashSum = '';
117
+ this.divider = divider;
115
118
  }
116
119
  insertRule(className, tag) {
117
120
  if (this.style) {
118
- const rule = tag + '.' + className + (this.type === 'none' ? '' : ':' + this.type) + '{' + this.style + '}';
121
+ const rule = tag + '.' + className + (this.type === 'none' ? '' : this.divider + this.type) + '{' + this.style + '}';
119
122
  this.styleSheet.insertRule(rule);
120
123
  }
121
124
  }
@@ -14,7 +14,8 @@ export declare class PseudoClass {
14
14
  readonly styleSheet: CSSStyleSheet;
15
15
  style: string;
16
16
  hashSum: string;
17
- constructor(type: PseudoClassType, styleSheet: CSSStyleSheet);
17
+ readonly divider: string;
18
+ constructor(type: PseudoClassType, styleSheet: CSSStyleSheet, divider?: string);
18
19
  insertRule(className: string, tag: string): void;
19
20
  setValue(key: string, value: string, priority: RulePriority, appendToClassName?: boolean): void;
20
21
  isEmpty(): boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "flinker-dom",
3
3
  "description": "Free TypeScript library for writing frontend apps",
4
- "version": "1.0.10",
4
+ "version": "1.0.12",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/Dittner/FlinkerDOM.git"