@dooboostore/dom-render 1.0.98

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.
Files changed (230) hide show
  1. package/DomRender.d.ts +24 -0
  2. package/DomRender.js +115 -0
  3. package/DomRenderProxy.d.ts +38 -0
  4. package/DomRenderProxy.js +586 -0
  5. package/README.MD +938 -0
  6. package/components/ComponentBase.d.ts +41 -0
  7. package/components/ComponentBase.js +210 -0
  8. package/components/ComponentSet.d.ts +22 -0
  9. package/components/ComponentSet.js +23 -0
  10. package/components/appender/Appender.d.ts +23 -0
  11. package/components/appender/Appender.js +59 -0
  12. package/components/checkbox/CheckBox.d.ts +47 -0
  13. package/components/checkbox/CheckBox.js +118 -0
  14. package/components/choose/Choose.d.ts +39 -0
  15. package/components/choose/Choose.js +110 -0
  16. package/components/details/Details.d.ts +57 -0
  17. package/components/details/Details.js +199 -0
  18. package/components/dialog/Dialog.d.ts +1 -0
  19. package/components/dialog/Dialog.js +85 -0
  20. package/components/dialog/example/ImageEditorDialog.d.ts +1 -0
  21. package/components/dialog/example/ImageEditorDialog.js +116 -0
  22. package/components/forOf/ForOf.d.ts +18 -0
  23. package/components/forOf/ForOf.js +32 -0
  24. package/components/if/If.d.ts +21 -0
  25. package/components/if/If.js +40 -0
  26. package/components/index.d.ts +27 -0
  27. package/components/index.js +13 -0
  28. package/components/input/Input.d.ts +34 -0
  29. package/components/input/Input.js +86 -0
  30. package/components/promise/PromiseSwitch.d.ts +55 -0
  31. package/components/promise/PromiseSwitch.js +181 -0
  32. package/components/radio/Radio.d.ts +45 -0
  33. package/components/radio/Radio.js +123 -0
  34. package/components/select/Select.d.ts +23 -0
  35. package/components/select/Select.js +52 -0
  36. package/components/this/This.d.ts +24 -0
  37. package/components/this/This.js +62 -0
  38. package/components/timer/Timer.d.ts +26 -0
  39. package/components/timer/Timer.js +102 -0
  40. package/configs/Config.d.ts +34 -0
  41. package/configs/Config.js +2 -0
  42. package/configs/TargetAttr.d.ts +7 -0
  43. package/configs/TargetAttr.js +2 -0
  44. package/configs/TargetElement.d.ts +16 -0
  45. package/configs/TargetElement.js +2 -0
  46. package/css/parse/index.d.ts +49 -0
  47. package/css/parse/index.js +498 -0
  48. package/css/stringify/compiler.d.ts +34 -0
  49. package/css/stringify/compiler.js +36 -0
  50. package/css/stringify/compress.d.ts +104 -0
  51. package/css/stringify/compress.js +147 -0
  52. package/css/stringify/identity.d.ts +109 -0
  53. package/css/stringify/identity.js +183 -0
  54. package/css/stringify/index.d.ts +24 -0
  55. package/css/stringify/index.js +27 -0
  56. package/css/stringify/types.d.ts +15 -0
  57. package/css/stringify/types.js +2 -0
  58. package/css/types.d.ts +10 -0
  59. package/css/types.js +2 -0
  60. package/decorators/DomRenderNoProxy.d.ts +4 -0
  61. package/decorators/DomRenderNoProxy.js +15 -0
  62. package/events/EventManager.d.ts +68 -0
  63. package/events/EventManager.js +477 -0
  64. package/index.d.ts +2 -0
  65. package/index.js +2 -0
  66. package/iterators/Range.d.ts +24 -0
  67. package/iterators/Range.js +70 -0
  68. package/lifecycle/OnBeforeReturnGet.d.ts +4 -0
  69. package/lifecycle/OnBeforeReturnGet.js +2 -0
  70. package/lifecycle/OnBeforeReturnSet.d.ts +5 -0
  71. package/lifecycle/OnBeforeReturnSet.js +4 -0
  72. package/lifecycle/OnChangeAttrRender.d.ts +9 -0
  73. package/lifecycle/OnChangeAttrRender.js +4 -0
  74. package/lifecycle/OnChildRenderedByProperty.d.ts +5 -0
  75. package/lifecycle/OnChildRenderedByProperty.js +4 -0
  76. package/lifecycle/OnCreateRender.d.ts +5 -0
  77. package/lifecycle/OnCreateRender.js +4 -0
  78. package/lifecycle/OnCreateRenderData.d.ts +10 -0
  79. package/lifecycle/OnCreateRenderData.js +4 -0
  80. package/lifecycle/OnCreateRendered.d.ts +8 -0
  81. package/lifecycle/OnCreateRendered.js +4 -0
  82. package/lifecycle/OnCreatedThisChild.d.ts +6 -0
  83. package/lifecycle/OnCreatedThisChild.js +4 -0
  84. package/lifecycle/OnDestroyRender.d.ts +9 -0
  85. package/lifecycle/OnDestroyRender.js +4 -0
  86. package/lifecycle/OnInitRender.d.ts +6 -0
  87. package/lifecycle/OnInitRender.js +4 -0
  88. package/lifecycle/OnProxyDomRender.d.ts +5 -0
  89. package/lifecycle/OnProxyDomRender.js +2 -0
  90. package/lifecycle/dr-this/OnDrThisBind.d.ts +5 -0
  91. package/lifecycle/dr-this/OnDrThisBind.js +4 -0
  92. package/lifecycle/dr-this/OnDrThisUnBind.d.ts +5 -0
  93. package/lifecycle/dr-this/OnDrThisUnBind.js +4 -0
  94. package/managers/RenderManager.d.ts +2 -0
  95. package/managers/RenderManager.js +12 -0
  96. package/messenger/DefaultMessenger.d.ts +4 -0
  97. package/messenger/DefaultMessenger.js +4 -0
  98. package/messenger/Messenger.d.ts +79 -0
  99. package/messenger/Messenger.js +185 -0
  100. package/operators/Appender.d.ts +15 -0
  101. package/operators/Appender.js +90 -0
  102. package/operators/Dr.d.ts +9 -0
  103. package/operators/Dr.js +53 -0
  104. package/operators/DrAppender.d.ts +9 -0
  105. package/operators/DrAppender.js +69 -0
  106. package/operators/DrFor.d.ts +9 -0
  107. package/operators/DrFor.js +58 -0
  108. package/operators/DrForOf.d.ts +9 -0
  109. package/operators/DrForOf.js +120 -0
  110. package/operators/DrForm.d.ts +9 -0
  111. package/operators/DrForm.js +79 -0
  112. package/operators/DrIf.d.ts +9 -0
  113. package/operators/DrIf.js +70 -0
  114. package/operators/DrInnerHTML.d.ts +9 -0
  115. package/operators/DrInnerHTML.js +48 -0
  116. package/operators/DrInnerText.d.ts +9 -0
  117. package/operators/DrInnerText.js +46 -0
  118. package/operators/DrPre.d.ts +8 -0
  119. package/operators/DrPre.js +22 -0
  120. package/operators/DrRepeat.d.ts +9 -0
  121. package/operators/DrRepeat.js +70 -0
  122. package/operators/DrStripElement.d.ts +9 -0
  123. package/operators/DrStripElement.js +50 -0
  124. package/operators/DrTargetAttr.d.ts +8 -0
  125. package/operators/DrTargetAttr.js +45 -0
  126. package/operators/DrTargetElement.d.ts +13 -0
  127. package/operators/DrTargetElement.js +91 -0
  128. package/operators/DrTargetElementIsElement.d.ts +13 -0
  129. package/operators/DrTargetElementIsElement.js +79 -0
  130. package/operators/DrThis.d.ts +7 -0
  131. package/operators/DrThis.js +72 -0
  132. package/operators/DrThisProperty.d.ts +11 -0
  133. package/operators/DrThisProperty.js +93 -0
  134. package/operators/OperatorExecuter.d.ts +50 -0
  135. package/operators/OperatorExecuter.js +50 -0
  136. package/operators/OperatorExecuterAttrRequire.d.ts +9 -0
  137. package/operators/OperatorExecuterAttrRequire.js +25 -0
  138. package/package.json +70 -0
  139. package/rawsets/AttrInitCallBack.d.ts +6 -0
  140. package/rawsets/AttrInitCallBack.js +2 -0
  141. package/rawsets/Attrs.d.ts +27 -0
  142. package/rawsets/Attrs.js +2 -0
  143. package/rawsets/CreatorMetaData.d.ts +20 -0
  144. package/rawsets/CreatorMetaData.js +2 -0
  145. package/rawsets/DestroyOptionType.d.ts +5 -0
  146. package/rawsets/DestroyOptionType.js +6 -0
  147. package/rawsets/ElementInitCallBack.d.ts +9 -0
  148. package/rawsets/ElementInitCallBack.js +2 -0
  149. package/rawsets/RawSet.d.ts +180 -0
  150. package/rawsets/RawSet.js +1450 -0
  151. package/rawsets/RawSetOperatorType.d.ts +4 -0
  152. package/rawsets/RawSetOperatorType.js +5 -0
  153. package/rawsets/RawSetType.d.ts +8 -0
  154. package/rawsets/RawSetType.js +9 -0
  155. package/rawsets/Render.d.ts +27 -0
  156. package/rawsets/Render.js +2 -0
  157. package/routers/HashRouter.d.ts +24 -0
  158. package/routers/HashRouter.js +86 -0
  159. package/routers/PathRouter.d.ts +23 -0
  160. package/routers/PathRouter.js +73 -0
  161. package/routers/Router.d.ts +68 -0
  162. package/routers/Router.js +132 -0
  163. package/types/Types.d.ts +12 -0
  164. package/types/Types.js +26 -0
  165. package/validators/AllCheckedValidatorArray.d.ts +7 -0
  166. package/validators/AllCheckedValidatorArray.js +11 -0
  167. package/validators/AllUnCheckedValidatorArray.d.ts +7 -0
  168. package/validators/AllUnCheckedValidatorArray.js +11 -0
  169. package/validators/CheckedValidator.d.ts +6 -0
  170. package/validators/CheckedValidator.js +11 -0
  171. package/validators/CountEqualsCheckedValidatorArray.d.ts +8 -0
  172. package/validators/CountEqualsCheckedValidatorArray.js +12 -0
  173. package/validators/CountEqualsUnCheckedValidatorArray.d.ts +8 -0
  174. package/validators/CountEqualsUnCheckedValidatorArray.js +12 -0
  175. package/validators/CountGreaterThanCheckedValidatorArray.d.ts +8 -0
  176. package/validators/CountGreaterThanCheckedValidatorArray.js +12 -0
  177. package/validators/CountGreaterThanEqualsCheckedValidatorArray.d.ts +8 -0
  178. package/validators/CountGreaterThanEqualsCheckedValidatorArray.js +12 -0
  179. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.d.ts +8 -0
  180. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.js +12 -0
  181. package/validators/CountGreaterThanUnCheckedValidatorArray.d.ts +8 -0
  182. package/validators/CountGreaterThanUnCheckedValidatorArray.js +12 -0
  183. package/validators/CountLessThanCheckedValidatorArray.d.ts +8 -0
  184. package/validators/CountLessThanCheckedValidatorArray.js +12 -0
  185. package/validators/CountLessThanEqualsCheckedValidatorArray.d.ts +8 -0
  186. package/validators/CountLessThanEqualsCheckedValidatorArray.js +12 -0
  187. package/validators/CountLessThanEqualsUnCheckedValidatorArray.d.ts +8 -0
  188. package/validators/CountLessThanEqualsUnCheckedValidatorArray.js +12 -0
  189. package/validators/CountLessThanUnCheckedValidatorArray.d.ts +8 -0
  190. package/validators/CountLessThanUnCheckedValidatorArray.js +12 -0
  191. package/validators/CountUnCheckedValidatorArray.d.ts +8 -0
  192. package/validators/CountUnCheckedValidatorArray.js +12 -0
  193. package/validators/EmptyValidator.d.ts +6 -0
  194. package/validators/EmptyValidator.js +12 -0
  195. package/validators/ExcludeCheckedValidatorArray.d.ts +9 -0
  196. package/validators/ExcludeCheckedValidatorArray.js +17 -0
  197. package/validators/FormValidator.d.ts +8 -0
  198. package/validators/FormValidator.js +16 -0
  199. package/validators/IncludeCheckedValidatorArray.d.ts +9 -0
  200. package/validators/IncludeCheckedValidatorArray.js +17 -0
  201. package/validators/MultipleValidator.d.ts +9 -0
  202. package/validators/MultipleValidator.js +25 -0
  203. package/validators/NonPassValidator.d.ts +6 -0
  204. package/validators/NonPassValidator.js +10 -0
  205. package/validators/NotEmptyValidator.d.ts +6 -0
  206. package/validators/NotEmptyValidator.js +13 -0
  207. package/validators/NotRegExpTestValidator.d.ts +7 -0
  208. package/validators/NotRegExpTestValidator.js +20 -0
  209. package/validators/PassValidator.d.ts +6 -0
  210. package/validators/PassValidator.js +10 -0
  211. package/validators/RegExpTestValidator.d.ts +7 -0
  212. package/validators/RegExpTestValidator.js +21 -0
  213. package/validators/RequiredValidator.d.ts +6 -0
  214. package/validators/RequiredValidator.js +12 -0
  215. package/validators/UnCheckedValidator.d.ts +6 -0
  216. package/validators/UnCheckedValidator.js +11 -0
  217. package/validators/ValidMultipleValidator.d.ts +10 -0
  218. package/validators/ValidMultipleValidator.js +12 -0
  219. package/validators/ValidValidator.d.ts +7 -0
  220. package/validators/ValidValidator.js +11 -0
  221. package/validators/ValidValidatorArray.d.ts +8 -0
  222. package/validators/ValidValidatorArray.js +11 -0
  223. package/validators/Validator.d.ts +58 -0
  224. package/validators/Validator.js +203 -0
  225. package/validators/ValidatorArray.d.ts +18 -0
  226. package/validators/ValidatorArray.js +77 -0
  227. package/validators/ValueEqualsValidator.d.ts +7 -0
  228. package/validators/ValueEqualsValidator.js +11 -0
  229. package/validators/ValueNotEqualsValidator.d.ts +7 -0
  230. package/validators/ValueNotEqualsValidator.js +11 -0
@@ -0,0 +1,147 @@
1
+ import { Compiler as BaseCompiler } from './compiler';
2
+ /**
3
+ * Compressed CSS compiler
4
+ */
5
+ export class CompressCompiler extends BaseCompiler {
6
+ /**
7
+ * Override emit to handle position
8
+ */
9
+ emit(str, pos) {
10
+ return super.emit(str);
11
+ }
12
+ /**
13
+ * Compile `node`.
14
+ */
15
+ compile(node) {
16
+ return node.stylesheet.rules.map(rule => this.visit(rule)).join('');
17
+ }
18
+ /**
19
+ * Visit comment node.
20
+ */
21
+ comment(node) {
22
+ return this.emit('', node.position);
23
+ }
24
+ /**
25
+ * Visit import node.
26
+ */
27
+ import(node) {
28
+ return this.emit('@import ' + node.import + ';', node.position);
29
+ }
30
+ /**
31
+ * Visit media node.
32
+ */
33
+ media(node) {
34
+ return this.emit('@media ' + node.media, node.position)
35
+ + this.emit('{')
36
+ + this.mapVisit(node.rules)
37
+ + this.emit('}');
38
+ }
39
+ /**
40
+ * Visit document node.
41
+ */
42
+ document(node) {
43
+ const doc = '@' + (node.vendor || '') + 'document ' + node.document;
44
+ return this.emit(doc, node.position)
45
+ + this.emit('{')
46
+ + this.mapVisit(node.rules)
47
+ + this.emit('}');
48
+ }
49
+ /**
50
+ * Visit charset node.
51
+ */
52
+ charset(node) {
53
+ return this.emit('@charset ' + node.charset + ';', node.position);
54
+ }
55
+ /**
56
+ * Visit namespace node.
57
+ */
58
+ namespace(node) {
59
+ return this.emit('@namespace ' + node.namespace + ';', node.position);
60
+ }
61
+ /**
62
+ * Visit supports node.
63
+ */
64
+ supports(node) {
65
+ return this.emit('@supports ' + node.supports, node.position)
66
+ + this.emit('{')
67
+ + this.mapVisit(node.rules)
68
+ + this.emit('}');
69
+ }
70
+ /**
71
+ * Visit keyframes node.
72
+ */
73
+ keyframes(node) {
74
+ return this.emit('@'
75
+ + (node.vendor || '')
76
+ + 'keyframes '
77
+ + node.name, node.position)
78
+ + this.emit('{')
79
+ + this.mapVisit(node.keyframes)
80
+ + this.emit('}');
81
+ }
82
+ /**
83
+ * Visit keyframe node.
84
+ */
85
+ keyframe(node) {
86
+ const decls = node.declarations;
87
+ return this.emit(node.values.join(','), node.position)
88
+ + this.emit('{')
89
+ + this.mapVisit(decls)
90
+ + this.emit('}');
91
+ }
92
+ /**
93
+ * Visit page node.
94
+ */
95
+ page(node) {
96
+ const sel = node.selectors.length
97
+ ? node.selectors.join(', ')
98
+ : '';
99
+ return this.emit('@page ' + sel, node.position)
100
+ + this.emit('{')
101
+ + this.mapVisit(node.declarations)
102
+ + this.emit('}');
103
+ }
104
+ /**
105
+ * Visit font-face node.
106
+ */
107
+ 'font-face'(node) {
108
+ return this.emit('@font-face', node.position)
109
+ + this.emit('{')
110
+ + this.mapVisit(node.declarations)
111
+ + this.emit('}');
112
+ }
113
+ /**
114
+ * Visit host node.
115
+ */
116
+ host(node) {
117
+ return this.emit('@host', node.position)
118
+ + this.emit('{')
119
+ + this.mapVisit(node.rules)
120
+ + this.emit('}');
121
+ }
122
+ /**
123
+ * Visit custom-media node.
124
+ */
125
+ 'custom-media'(node) {
126
+ return this.emit('@custom-media ' + node.name + ' ' + node.media + ';', node.position);
127
+ }
128
+ /**
129
+ * Visit rule node.
130
+ */
131
+ rule(node) {
132
+ const decls = node.declarations;
133
+ if (!decls.length)
134
+ return '';
135
+ return this.emit(node.selectors.join(','), node.position)
136
+ + this.emit('{')
137
+ + this.mapVisit(decls)
138
+ + this.emit('}');
139
+ }
140
+ /**
141
+ * Visit declaration node.
142
+ */
143
+ declaration(node) {
144
+ return this.emit(node.property + ':' + node.value, node.position) + this.emit(';');
145
+ }
146
+ }
147
+ //# sourceMappingURL=compress.js.map
@@ -0,0 +1,109 @@
1
+ import { Compiler as BaseCompiler } from './compiler';
2
+ interface Node {
3
+ type: string;
4
+ position?: any;
5
+ stylesheet?: {
6
+ rules: Node[];
7
+ };
8
+ comment?: string;
9
+ import?: string;
10
+ media?: string;
11
+ vendor?: string;
12
+ document?: string;
13
+ charset?: string;
14
+ namespace?: string;
15
+ supports?: string;
16
+ name?: string;
17
+ keyframes?: Node[];
18
+ values?: string[];
19
+ declarations?: Node[];
20
+ selectors?: string[];
21
+ rules?: Node[];
22
+ property?: string;
23
+ value?: string;
24
+ }
25
+ interface CompilerOptions {
26
+ indent?: string;
27
+ }
28
+ /**
29
+ * Initialize a new `Compiler`.
30
+ */
31
+ export declare class IdentityCompiler extends BaseCompiler {
32
+ private indentation;
33
+ private level;
34
+ constructor(options?: CompilerOptions);
35
+ /**
36
+ * Compile `node`.
37
+ */
38
+ compile(node: Node): string;
39
+ /**
40
+ * Visit stylesheet node.
41
+ */
42
+ stylesheet(node: Node): string;
43
+ /**
44
+ * Visit comment node.
45
+ */
46
+ comment(node: Node): string;
47
+ /**
48
+ * Visit import node.
49
+ */
50
+ import(node: Node): string;
51
+ /**
52
+ * Visit media node.
53
+ */
54
+ media(node: Node): string;
55
+ /**
56
+ * Visit document node.
57
+ */
58
+ document(node: Node): string;
59
+ /**
60
+ * Visit charset node.
61
+ */
62
+ charset(node: Node): string;
63
+ /**
64
+ * Visit namespace node.
65
+ */
66
+ namespace(node: Node): string;
67
+ /**
68
+ * Visit supports node.
69
+ */
70
+ supports(node: Node): string;
71
+ /**
72
+ * Visit keyframes node.
73
+ */
74
+ keyframes(node: Node): string;
75
+ /**
76
+ * Visit keyframe node.
77
+ */
78
+ keyframe(node: Node): string;
79
+ /**
80
+ * Visit page node.
81
+ */
82
+ page(node: Node): string;
83
+ /**
84
+ * Visit font-face node.
85
+ */
86
+ 'font-face'(node: Node): string;
87
+ /**
88
+ * Visit host node.
89
+ */
90
+ host(node: Node): string;
91
+ /**
92
+ * Visit custom-media node.
93
+ */
94
+ 'custom-media'(node: Node): string;
95
+ /**
96
+ * Visit rule node.
97
+ */
98
+ rule(node: Node): string;
99
+ /**
100
+ * Visit declaration node.
101
+ */
102
+ declaration(node: Node): string;
103
+ /**
104
+ * Increase, decrease or return current indentation.
105
+ */
106
+ indent(level?: number): string;
107
+ }
108
+ export {};
109
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1,183 @@
1
+ import { Compiler as BaseCompiler } from './compiler';
2
+ /**
3
+ * Initialize a new `Compiler`.
4
+ */
5
+ export class IdentityCompiler extends BaseCompiler {
6
+ constructor(options = {}) {
7
+ super(options);
8
+ this.indentation = typeof options.indent === 'string' ? options.indent : ' ';
9
+ this.level = 1;
10
+ }
11
+ /**
12
+ * Compile `node`.
13
+ */
14
+ compile(node) {
15
+ return this.stylesheet(node);
16
+ }
17
+ /**
18
+ * Visit stylesheet node.
19
+ */
20
+ stylesheet(node) {
21
+ return this.mapVisit(node.stylesheet.rules, '\n\n');
22
+ }
23
+ /**
24
+ * Visit comment node.
25
+ */
26
+ comment(node) {
27
+ return this.emit(this.indent() + '/*' + node.comment + '*/');
28
+ }
29
+ /**
30
+ * Visit import node.
31
+ */
32
+ import(node) {
33
+ return this.emit('@import ' + node.import + ';');
34
+ }
35
+ /**
36
+ * Visit media node.
37
+ */
38
+ media(node) {
39
+ return this.emit('@media ' + node.media)
40
+ + this.emit(' {\n'
41
+ + this.indent(1))
42
+ + this.mapVisit(node.rules, '\n\n')
43
+ + this.emit(this.indent(-1)
44
+ + '\n}');
45
+ }
46
+ /**
47
+ * Visit document node.
48
+ */
49
+ document(node) {
50
+ const doc = '@' + (node.vendor || '') + 'document ' + node.document;
51
+ return this.emit(doc)
52
+ + this.emit(' '
53
+ + ' {\n'
54
+ + this.indent(1))
55
+ + this.mapVisit(node.rules, '\n\n')
56
+ + this.emit(this.indent(-1)
57
+ + '\n}');
58
+ }
59
+ /**
60
+ * Visit charset node.
61
+ */
62
+ charset(node) {
63
+ return this.emit('@charset ' + node.charset + ';');
64
+ }
65
+ /**
66
+ * Visit namespace node.
67
+ */
68
+ namespace(node) {
69
+ return this.emit('@namespace ' + node.namespace + ';');
70
+ }
71
+ /**
72
+ * Visit supports node.
73
+ */
74
+ supports(node) {
75
+ return this.emit('@supports ' + node.supports)
76
+ + this.emit(' {\n'
77
+ + this.indent(1))
78
+ + this.mapVisit(node.rules, '\n\n')
79
+ + this.emit(this.indent(-1)
80
+ + '\n}');
81
+ }
82
+ /**
83
+ * Visit keyframes node.
84
+ */
85
+ keyframes(node) {
86
+ return this.emit('@' + (node.vendor || '') + 'keyframes ' + node.name)
87
+ + this.emit(' {\n'
88
+ + this.indent(1))
89
+ + this.mapVisit(node.keyframes, '\n')
90
+ + this.emit(this.indent(-1)
91
+ + '}');
92
+ }
93
+ /**
94
+ * Visit keyframe node.
95
+ */
96
+ keyframe(node) {
97
+ const decls = node.declarations;
98
+ return this.emit(this.indent())
99
+ + this.emit(node.values.join(', '))
100
+ + this.emit(' {\n'
101
+ + this.indent(1))
102
+ + this.mapVisit(decls, '\n')
103
+ + this.emit(this.indent(-1)
104
+ + '\n'
105
+ + this.indent() + '}\n');
106
+ }
107
+ /**
108
+ * Visit page node.
109
+ */
110
+ page(node) {
111
+ const sel = node.selectors.length
112
+ ? node.selectors.join(', ') + ' '
113
+ : '';
114
+ return this.emit('@page ' + sel)
115
+ + this.emit('{\n')
116
+ + this.emit(this.indent(1))
117
+ + this.mapVisit(node.declarations, '\n')
118
+ + this.emit(this.indent(-1))
119
+ + this.emit('\n}');
120
+ }
121
+ /**
122
+ * Visit font-face node.
123
+ */
124
+ 'font-face'(node) {
125
+ return this.emit('@font-face ')
126
+ + this.emit('{\n')
127
+ + this.emit(this.indent(1))
128
+ + this.mapVisit(node.declarations, '\n')
129
+ + this.emit(this.indent(-1))
130
+ + this.emit('\n}');
131
+ }
132
+ /**
133
+ * Visit host node.
134
+ */
135
+ host(node) {
136
+ return this.emit('@host')
137
+ + this.emit(' {\n'
138
+ + this.indent(1))
139
+ + this.mapVisit(node.rules, '\n\n')
140
+ + this.emit(this.indent(-1)
141
+ + '\n}');
142
+ }
143
+ /**
144
+ * Visit custom-media node.
145
+ */
146
+ 'custom-media'(node) {
147
+ return this.emit('@custom-media ' + node.name + ' ' + node.media + ';');
148
+ }
149
+ /**
150
+ * Visit rule node.
151
+ */
152
+ rule(node) {
153
+ const indent = this.indent();
154
+ const decls = node.declarations;
155
+ if (!decls.length)
156
+ return '';
157
+ return this.emit(node.selectors.map(s => indent + s).join(',\n'))
158
+ + this.emit(' {\n')
159
+ + this.emit(this.indent(1))
160
+ + this.mapVisit(decls, '\n')
161
+ + this.emit(this.indent(-1))
162
+ + this.emit('\n' + this.indent() + '}');
163
+ }
164
+ /**
165
+ * Visit declaration node.
166
+ */
167
+ declaration(node) {
168
+ return this.emit(this.indent())
169
+ + this.emit(node.property + ': ' + node.value)
170
+ + this.emit(';');
171
+ }
172
+ /**
173
+ * Increase, decrease or return current indentation.
174
+ */
175
+ indent(level) {
176
+ if (level != null) {
177
+ this.level += level;
178
+ return '';
179
+ }
180
+ return Array(this.level).join(this.indentation);
181
+ }
182
+ }
183
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Module dependencies.
3
+ */
4
+ import { CompileResult, CompilerOptions } from './types';
5
+ /**
6
+ * Stringfy the given AST `node`.
7
+ *
8
+ * Options:
9
+ *
10
+ * - `compress` space-optimized output
11
+ * - `sourcemap` return an object with `.code` and `.map`
12
+ *
13
+ * @param {Object} node
14
+ * @param {Object} [options]
15
+ * @return {String}
16
+ * @api public
17
+ */
18
+ interface StringifyOptions extends CompilerOptions {
19
+ compress?: boolean;
20
+ sourcemap?: boolean | 'generator';
21
+ }
22
+ export default function (node: any, options?: StringifyOptions): string | CompileResult;
23
+ export {};
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Module dependencies.
3
+ */
4
+ import { CompressCompiler } from './compress';
5
+ import { IdentityCompiler } from './identity';
6
+ export default function (node, options = {}) {
7
+ const compiler = options.compress
8
+ ? new CompressCompiler(options)
9
+ : new IdentityCompiler(options);
10
+ // source maps
11
+ // if (options.sourcemap) {
12
+ // var sourcemaps = require('./source-map-support');
13
+ // sourcemaps(compiler);
14
+ //
15
+ // var code = compiler.compile(node);
16
+ // compiler.applySourceMaps();
17
+ //
18
+ // var map = options.sourcemap === 'generator'
19
+ // ? compiler.map
20
+ // : compiler.map.toJSON();
21
+ //
22
+ // return { code: code, map: map };
23
+ // }
24
+ const code = compiler.compile(node);
25
+ return code;
26
+ }
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,15 @@
1
+ export interface CompileResult {
2
+ code: string;
3
+ map?: any;
4
+ }
5
+ export interface Compiler {
6
+ compile(node: any): string;
7
+ map?: any;
8
+ applySourceMaps?(): void;
9
+ }
10
+ export interface CompilerOptions {
11
+ compress?: boolean;
12
+ sourcemap?: boolean | 'generator';
13
+ indent?: string;
14
+ }
15
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
package/css/types.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ export interface CompileResult {
2
+ code: string;
3
+ map?: any;
4
+ }
5
+ export interface Compiler {
6
+ compile(node: any): string;
7
+ map?: any;
8
+ applySourceMaps?(): void;
9
+ }
10
+ //# sourceMappingURL=types.d.ts.map
package/css/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,4 @@
1
+ import 'reflect-metadata';
2
+ export declare const DomRenderNoProxyKey = "DomRender:NoProxy";
3
+ export declare const DomRenderNoProxy: (target: any, propertyKey?: string | symbol) => void;
4
+ //# sourceMappingURL=DomRenderNoProxy.d.ts.map
@@ -0,0 +1,15 @@
1
+ import 'reflect-metadata';
2
+ // export type ReflectField = (target: Object|{constructor: ConstructorType<any>, [key: string]: Function}, propertyKey: string | symbol) => void;
3
+ export const DomRenderNoProxyKey = 'DomRender:NoProxy';
4
+ export const DomRenderNoProxy = (target, propertyKey) => {
5
+ // 클래스 데코레이터로 사용된 경우
6
+ if (propertyKey === undefined) {
7
+ // target은 클래스 생성자
8
+ Reflect.defineMetadata(DomRenderNoProxyKey, true, target);
9
+ return;
10
+ }
11
+ // 프로퍼티 데코레이터로 사용된 경우
12
+ // target은 프로토타입, propertyKey는 프로퍼티 이름
13
+ Reflect.defineMetadata(DomRenderNoProxyKey, true, target, propertyKey);
14
+ };
15
+ //# sourceMappingURL=DomRenderNoProxy.js.map
@@ -0,0 +1,68 @@
1
+ import { Config } from '../configs/Config';
2
+ export declare class EventManager {
3
+ static readonly attrPrefix = "dr-";
4
+ readonly eventNames: string[];
5
+ static ownerVariablePathAttrName: string;
6
+ static readonly eventParam: string;
7
+ static readonly onInitAttrName: string;
8
+ static readonly valueAttrName: string;
9
+ static linkAttrs: {
10
+ name: string;
11
+ property: string;
12
+ event: string;
13
+ }[];
14
+ static readonly linkTargetMapAttrName: string;
15
+ static readonly onRenderedInitAttrName: string;
16
+ static readonly attrAttrName: string;
17
+ static readonly normalAttrMapAttrName: string;
18
+ static readonly styleAttrName: string;
19
+ static readonly classAttrName: string;
20
+ static readonly VALUE_VARNAME = "$value";
21
+ static readonly SCRIPTS_VARNAME = "$scripts";
22
+ static readonly FAG_VARNAME = "$fag";
23
+ static readonly RAWSET_VARNAME = "$rawSet";
24
+ static readonly RENDER_VARNAME = "$render";
25
+ static readonly NEAR_THIS_VARNAME = "$nearThis";
26
+ static readonly PARENT_THIS_VARNAME = "$parentThis";
27
+ static readonly ROOT_OBJECT_VARNAME = "$rootObject";
28
+ static readonly SCRIPT_UTILS_VARNAME = "$scriptUtils";
29
+ static readonly RANGE_VARNAME = "$range";
30
+ static readonly ROUTER_VARNAME = "$router";
31
+ static readonly INNER_HTML_VARNAME = "$innerHTML";
32
+ static readonly ELEMENT_VARNAME = "$element";
33
+ static readonly TARGET_VARNAME = "$target";
34
+ static readonly EVENT_VARNAME = "$event";
35
+ static readonly COMPONENT_VARNAME = "$component";
36
+ static readonly INNERHTML_VARNAME = "$innerHTML";
37
+ static readonly ATTRIBUTE_VARNAME = "$attribute";
38
+ static readonly CREATOR_META_DATA_VARNAME = "$creatorMetaData";
39
+ static readonly PARENT_THIS_PATH_VARNAME = "$parentPath";
40
+ static readonly CURRENT_THIS_VARNAME = "$currentThis";
41
+ static readonly CURRENT_THIS_PATH_VARNAME = "$currentThisPath";
42
+ static readonly NEAR_THIS_PATH_VARNAME = "$nearThisPath";
43
+ static readonly VARNAMES: string[];
44
+ static readonly WINDOW_EVENT_POPSTATE = "popstate";
45
+ static readonly WINDOW_EVENT_RESIZE = "resize";
46
+ static readonly WINDOW_EVENTS: string[];
47
+ static readonly attrNames: string[];
48
+ readonly bindScript: string;
49
+ constructor();
50
+ findAttrElements(fragment: DocumentFragment | Element, config?: Config): Set<Element>;
51
+ applyEvent(obj: any, childNodes: Set<ChildNode> | Set<Element>, config?: Config): void;
52
+ onRenderedEvent(obj: any, childNodes: Set<ChildNode> | Set<Element> | Node[], config?: Config): void;
53
+ changeVar(obj: any, elements: Set<Element> | Set<ChildNode>, varName?: string, config?: Config): void;
54
+ addDrEvents(obj: any, eventName: string, elements: Set<Element> | Set<ChildNode>, config?: Config): void;
55
+ addDrEventPram(obj: any, attr: string, elements: Set<ChildNode> | Set<Element>, config?: Config): void;
56
+ procAttr<T extends Element = Element>(elements: Set<Element> | Set<ChildNode> | Node[], attrName: string, callBack: (h: T, value: string, attributes: any) => void): void;
57
+ getValue<T = any>(obj: any, name: string, bindObj?: any): T;
58
+ setValue(obj: any, name: string, value?: any): void;
59
+ static isUsingThisVar(raws: string | null | undefined, varName: string | null | undefined): boolean;
60
+ static setBindProperty(scripts: {
61
+ [p: string]: any;
62
+ } | undefined, obj: any): {
63
+ [p: string]: any;
64
+ } | undefined;
65
+ getBindScript(config?: Config): string;
66
+ }
67
+ export declare const eventManager: EventManager;
68
+ //# sourceMappingURL=EventManager.d.ts.map