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.
- package/dist/esm/processor.js +12 -9
- package/dist/types/processor.d.ts +2 -1
- package/package.json +1 -1
package/dist/esm/processor.js
CHANGED
|
@@ -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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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' ? '' :
|
|
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
|
-
|
|
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;
|