@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,110 @@
1
+ import { ComponentBase } from '../ComponentBase';
2
+ import { DomRender } from '../../DomRender';
3
+ import { RawSet } from '../../rawsets/RawSet';
4
+ export var Choose;
5
+ (function (Choose_1) {
6
+ Choose_1.selector = 'dr-choose';
7
+ class ChildOtherWiseBase extends ComponentBase {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.hidden = true;
11
+ }
12
+ }
13
+ class ChildBase extends ChildOtherWiseBase {
14
+ }
15
+ // @Component({
16
+ // template: '<div dr-if="!@this@.hidden" dr-strip="true" >#innerHTML#</div>',
17
+ // selector: `${selector}.When`
18
+ // })
19
+ class When extends ChildBase {
20
+ constructor() {
21
+ super({ onlyParentType: (Choose) });
22
+ }
23
+ }
24
+ Choose_1.When = When;
25
+ // @Component({
26
+ // template: '<div dr-if="!@this@.hidden" dr-strip="true" >#innerHTML#</div>',
27
+ // selector: `${selector}.OtherWise`
28
+ // })
29
+ class OtherWise extends ChildBase {
30
+ constructor() {
31
+ super({ onlyParentType: (Choose) });
32
+ }
33
+ }
34
+ Choose_1.OtherWise = OtherWise;
35
+ // @Component({
36
+ // template: '#innerHTML#',
37
+ // selector: `${selector}`
38
+ // })
39
+ class Choose extends ComponentBase {
40
+ onCreatedThisChild(child, data) {
41
+ super.onCreatedThisChild(child, data);
42
+ this.setChange(child);
43
+ }
44
+ onChangeAttrRender(name, value, other) {
45
+ super.onChangeAttrRender(name, value, other);
46
+ // console.log('-----------changer Choose', name, value);
47
+ // this.getChildren(Pending).forEach(it => {
48
+ // console.log('------------asdasd', it, it.attribute?.defaultView)
49
+ // })
50
+ if (this.equalsAttributeName(name, 'data')) {
51
+ this.choose = undefined;
52
+ const children = this.getChildren([When, OtherWise]).sort((a, b) => (a instanceof OtherWise ? 1 : 0) - (b instanceof OtherWise ? 1 : 0));
53
+ children.forEach(it => this.setChange(it));
54
+ }
55
+ }
56
+ setChange(child) {
57
+ var _a;
58
+ child.data = this.getAttribute('data');
59
+ // when.hidden = true;
60
+ if (!this.choose && child instanceof When && ((_a = child.getAttribute('test')) === null || _a === void 0 ? void 0 : _a(this.getAttribute('data')))) {
61
+ // console.log('------------', child.attribute?.test?.(this.attribute?.data))
62
+ this.choose = child;
63
+ if (child.hidden) {
64
+ child.hidden = false;
65
+ }
66
+ // console.log('--------', when)
67
+ }
68
+ else if (this.choose !== child) {
69
+ child.hidden = true;
70
+ }
71
+ if (!this.choose && child instanceof OtherWise) {
72
+ this.choose = child;
73
+ if (child.hidden) {
74
+ child.hidden = false;
75
+ }
76
+ }
77
+ }
78
+ }
79
+ Choose_1.Choose = Choose;
80
+ })(Choose || (Choose = {}));
81
+ export default {
82
+ chooseWhen: (config) => {
83
+ return RawSet.createComponentTargetElement({
84
+ name: `${Choose.selector}-when`,
85
+ template: '<div dr-if="!@this@.hidden" dr-option-strip="true" >#innerHTML#</div>',
86
+ objFactory: (e, o, r2, counstructorParam) => {
87
+ return DomRender.run({ rootObject: new Choose.When(), config: config });
88
+ }
89
+ });
90
+ },
91
+ chooseOtherWise: (config) => {
92
+ return RawSet.createComponentTargetElement({
93
+ name: `${Choose.selector}-other-wise`,
94
+ template: '<div dr-if="!@this@.hidden" dr-option-strip="true" >#innerHTML#</div>',
95
+ objFactory: (e, o, r2, counstructorParam) => {
96
+ return DomRender.run({ rootObject: new Choose.OtherWise(), config: config });
97
+ }
98
+ });
99
+ },
100
+ choose: (config) => {
101
+ return RawSet.createComponentTargetElement({
102
+ name: `${Choose.selector}`,
103
+ template: '#innerHTML#',
104
+ objFactory: (e, o, r2, counstructorParam) => {
105
+ return DomRender.run({ rootObject: new Choose.Choose(...counstructorParam), config: config });
106
+ }
107
+ });
108
+ },
109
+ };
110
+ //# sourceMappingURL=Choose.js.map
@@ -0,0 +1,57 @@
1
+ import { ComponentBase } from '../ComponentBase';
2
+ import { RunConfig } from '../../DomRender';
3
+ import { RawSet } from '../../rawsets/RawSet';
4
+ import { OtherData } from '../../lifecycle/OnChangeAttrRender';
5
+ import { OnInitRender } from '../../lifecycle/OnInitRender';
6
+ import { OnCreateRenderDataParams } from '../../lifecycle/OnCreateRenderData';
7
+ import { OnCreateRender } from 'lifecycle/OnCreateRender';
8
+ export declare namespace Details {
9
+ const selector = "dr-details";
10
+ type Attribute = {
11
+ class?: string;
12
+ toggle_form_reset?: boolean;
13
+ disableOtherClickClose?: boolean;
14
+ toggle?: (open: boolean) => void;
15
+ };
16
+ type BodyAttribute = {
17
+ float?: 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
18
+ } & Attribute;
19
+ type FormAttribute = {
20
+ disabledSubmit?: null;
21
+ submit?: (event: SubmitEvent, element: HTMLFormElement) => void;
22
+ } & BodyAttribute;
23
+ class Summary extends ComponentBase<Attribute> {
24
+ constructor();
25
+ }
26
+ class Body extends ComponentBase<BodyAttribute> {
27
+ private $element?;
28
+ constructor();
29
+ }
30
+ const isBody: (instance: any) => instance is Body;
31
+ class Form extends ComponentBase<FormAttribute> {
32
+ private $element?;
33
+ constructor();
34
+ submit(element: HTMLFormElement, event: SubmitEvent): void;
35
+ reset(): void;
36
+ }
37
+ const isForm: (instance: any) => instance is Form;
38
+ class Details extends ComponentBase<Attribute> implements OnCreateRender, OnInitRender {
39
+ private documentClickSubscription?;
40
+ private toggleSubscription?;
41
+ private element?;
42
+ onCreateRenderData(data: OnCreateRenderDataParams): void;
43
+ onCreateRender(...param: any[]): void;
44
+ toggle(element: HTMLDetailsElement): void;
45
+ onInitRender(param: any, rawSet: RawSet): void;
46
+ onChangeAttrRender(name: string, value: any, other: OtherData): void;
47
+ onDestroyRender(...metaData: any[]): void;
48
+ }
49
+ }
50
+ declare const _default: {
51
+ detailsSummary: (config?: RunConfig) => import("../../configs/TargetElement").TargetElement;
52
+ detailsBody: (config?: RunConfig) => import("../../configs/TargetElement").TargetElement;
53
+ detailsForm: (config?: RunConfig) => import("../../configs/TargetElement").TargetElement;
54
+ details: (config?: RunConfig) => import("../../configs/TargetElement").TargetElement;
55
+ };
56
+ export default _default;
57
+ //# sourceMappingURL=Details.d.ts.map
@@ -0,0 +1,199 @@
1
+ import { ComponentBase } from '../ComponentBase';
2
+ import { DomRender } from '../../DomRender';
3
+ import { RawSet } from '../../rawsets/RawSet';
4
+ import { ValidUtils } from '@dooboostore/core-web/valid/ValidUtils';
5
+ import { EventUtils } from '@dooboostore/core-web/event/EventUtils';
6
+ export var Details;
7
+ (function (Details_1) {
8
+ Details_1.selector = 'dr-details';
9
+ // @Component({
10
+ // template: '<summary class="${`${@this@.getAttribute(\'class\')} details-summary-container`}$">#innerHTML#</summary>',
11
+ // styles: '',
12
+ // selector: `${selector}.Summary`
13
+ // })
14
+ class Summary extends ComponentBase {
15
+ constructor() {
16
+ super({ onlyParentType: [Details] });
17
+ }
18
+ }
19
+ Details_1.Summary = Summary;
20
+ // @Component({
21
+ // template: '<div class="${`${@this@.getAttribute(\'class\')} details-body-container details-body-${@this@.getAttribute(\'float\')}-container`}$" dr-on-init="@this@.$element = $element;">#innerHTML#</div>',
22
+ // selector: `${selector}.Body`
23
+ // })
24
+ class Body extends ComponentBase {
25
+ constructor() {
26
+ super({ onlyParentType: [Details] });
27
+ }
28
+ }
29
+ Details_1.Body = Body;
30
+ Details_1.isBody = (instance) => {
31
+ return instance instanceof Body;
32
+ };
33
+ // @Component({
34
+ // template: '<form class="${`${@this@.getAttribute(\'class\')} details-body-container details-body-${@this@.getAttribute(\'float\')}-container details-form-container`}$" dr-on-init="@this@.$element = $element;" dr-event-submit="@this@.submit($element,$event);">#innerHTML#</form>',
35
+ // styles: detailsFormStyle,
36
+ // selector: `${selector}.Form`
37
+ // })
38
+ class Form extends ComponentBase {
39
+ constructor() {
40
+ super({ onlyParentType: [Details] });
41
+ }
42
+ submit(element, event) {
43
+ var _a;
44
+ if (this.hasAttribute('disabledSubmit')) {
45
+ event.preventDefault();
46
+ }
47
+ if (this.hasAttribute('submit')) {
48
+ (_a = this.getAttribute('submit')) === null || _a === void 0 ? void 0 : _a(event, element);
49
+ }
50
+ }
51
+ reset() {
52
+ var _a;
53
+ (_a = this.$element) === null || _a === void 0 ? void 0 : _a.reset();
54
+ }
55
+ }
56
+ Details_1.Form = Form;
57
+ Details_1.isForm = (instance) => {
58
+ return instance instanceof Form;
59
+ };
60
+ // @Component({
61
+ // template: template,
62
+ // styles: style,
63
+ // // noStrip: true,
64
+ // selector: `${selector}`
65
+ // })
66
+ class Details extends ComponentBase {
67
+ onCreateRenderData(data) {
68
+ super.onCreateRenderData(data);
69
+ }
70
+ onCreateRender(...param) {
71
+ }
72
+ toggle(element) {
73
+ const toggleAttribute = this.getAttribute('toggle');
74
+ if (toggleAttribute) {
75
+ toggleAttribute === null || toggleAttribute === void 0 ? void 0 : toggleAttribute(element.open);
76
+ }
77
+ }
78
+ onInitRender(param, rawSet) {
79
+ var _a;
80
+ super.onInitRender(param, rawSet);
81
+ if (ValidUtils.isBrowser() && ((_a = this.rawSet) === null || _a === void 0 ? void 0 : _a.dataSet.config.window)) {
82
+ const detailsElement = this.element;
83
+ const document = this.rawSet.dataSet.config.window.document;
84
+ this.documentClickSubscription = EventUtils.htmlElementEventObservable(document, 'click').subscribe(event => {
85
+ if (this.getAttribute('disableOtherClickClose')) {
86
+ return;
87
+ }
88
+ if (detailsElement && !(detailsElement === null || detailsElement === void 0 ? void 0 : detailsElement.contains(event === null || event === void 0 ? void 0 : event.target))) {
89
+ detailsElement.open = false;
90
+ }
91
+ });
92
+ if (detailsElement) {
93
+ this.toggleSubscription = EventUtils.htmlElementEventObservable(detailsElement, 'toggle').subscribe(it => {
94
+ var _a;
95
+ if (ValidUtils.coreValidUtils.isNotNullUndefined(this.getAttribute('toggle_form_reset'))) {
96
+ (_a = this.children) === null || _a === void 0 ? void 0 : _a.filter(Details_1.isForm).forEach(it => {
97
+ it.reset();
98
+ });
99
+ }
100
+ });
101
+ }
102
+ }
103
+ // console.log('aaaaaaaaaaaaaaaaaaaaa', rawSet);
104
+ }
105
+ onChangeAttrRender(name, value, other) {
106
+ super.onChangeAttrRender(name, value, other);
107
+ }
108
+ onDestroyRender(...metaData) {
109
+ var _a, _b;
110
+ (_a = this.toggleSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
111
+ (_b = this.documentClickSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
112
+ // console.log('onDestroyRender', metaData);
113
+ // if (ValidUtils.isBrowser()) {
114
+ // document.removeEventListener('click', this.ccc)
115
+ // }
116
+ }
117
+ }
118
+ Details_1.Details = Details;
119
+ })(Details || (Details = {}));
120
+ export default {
121
+ detailsSummary: (config) => {
122
+ return RawSet.createComponentTargetElement({
123
+ name: `${Details.selector}-summary`,
124
+ template: '<summary class="${`${@this@.getAttribute(\'class\')} details-summary-container`}$">#innerHTML#</summary>',
125
+ objFactory: (e, o, r2, counstructorParam) => {
126
+ return DomRender.run({ rootObject: new Details.Summary(), config: config });
127
+ }
128
+ });
129
+ },
130
+ detailsBody: (config) => {
131
+ return RawSet.createComponentTargetElement({
132
+ name: `${Details.selector}-body`,
133
+ template: '<div class="${`${@this@.getAttribute(\'class\')} details-body-container details-body-${@this@.getAttribute(\'float\')}-container`}$" dr-on-init="@this@.$element = $element;">#innerHTML#</div>',
134
+ objFactory: (e, o, r2, counstructorParam) => {
135
+ return DomRender.run({ rootObject: new Details.Body(), config: config });
136
+ }
137
+ });
138
+ },
139
+ detailsForm: (config) => {
140
+ return RawSet.createComponentTargetElement({
141
+ name: `${Details.selector}-form`,
142
+ template: '<form class="${`${@this@.getAttribute(\'class\')} details-body-container details-body-${@this@.getAttribute(\'float\')}-container details-form-container`}$" dr-on-init="@this@.$element = $element;" dr-event-submit="@this@.submit($element,$event);">#innerHTML#</form>',
143
+ objFactory: (e, o, r2, counstructorParam) => {
144
+ return DomRender.run({ rootObject: new Details.Form(), config: config });
145
+ }
146
+ });
147
+ },
148
+ details: (config) => {
149
+ return RawSet.createComponentTargetElement({
150
+ name: `${Details.selector}`,
151
+ styles: `
152
+ .details-container {
153
+ position: relative;
154
+ }
155
+
156
+ .details-container .details-body-container {
157
+ position: absolute;
158
+ }
159
+
160
+
161
+ .details-container .details-body-bottom-left-container {
162
+ position: absolute;
163
+ left: 0;
164
+ top: 100%;
165
+ /*margin-top: 0px;*/
166
+ /*width: max-content;*/
167
+ }
168
+
169
+ .details-container .details-body-bottom-right-container {
170
+ position: absolute;
171
+ right: 0;
172
+ top: 100%;
173
+ /*margin-top: 0px;*/
174
+ /*width: max-content;*/
175
+ }
176
+
177
+ .details-container .details-body-top-left-container {
178
+ position: absolute;
179
+ left: 0;
180
+ bottom: 100%;
181
+ /*margin-bottom: 0px;*/
182
+ /*width: max-content;*/
183
+ }
184
+
185
+ .details-container .details-body-top-right-container {
186
+ position: absolute;
187
+ right: 0;
188
+ bottom: 100%;
189
+ /*margin-bottom: 0px;*/
190
+ }
191
+ `,
192
+ template: '<details class="${`${@this@.getAttribute(\'class\')} details-container`}$" dr-on-init="@this@.element = $element;" dr-event-toggle="@this@.toggle($element)"> #innerHTML# </details>',
193
+ objFactory: (e, o, r2, counstructorParam) => {
194
+ return DomRender.run({ rootObject: new Details.Details(...counstructorParam), config: config });
195
+ }
196
+ });
197
+ },
198
+ };
199
+ //# sourceMappingURL=Details.js.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=Dialog.d.ts.map
@@ -0,0 +1,85 @@
1
+ // import { Component } from '@dooboostore/simple-boot-front/decorators/Component';
2
+ // import { ComponentBase } from '../ComponentBase';
3
+ // import { OtherData } from '@dooboostore/dom-render/lifecycle/OnChangeAttrRender';
4
+ // import template from './dialog.html'
5
+ //
6
+ // export namespace Dialog {
7
+ // export const selector = 'System:Dialog';
8
+ // export type Attribute<D> = {
9
+ // show?: null;
10
+ // backdropClickClose?: null;
11
+ // class?: string;
12
+ // close?: () => void
13
+ // toggle?: (element:HTMLDialogElement) => void,
14
+ // data?: D
15
+ // }
16
+ //
17
+ //
18
+ // @Component({
19
+ // template,
20
+ // // styles: style,
21
+ // selector: `${selector}`
22
+ // })
23
+ // export class Dialog<D = any> extends ComponentBase<Attribute<D>> {
24
+ // private element?: HTMLDialogElement;
25
+ //
26
+ // closeDialog() {
27
+ // if (this.element) {
28
+ // this.element.close();
29
+ // this.getAttribute('toggle')?.(this.element);
30
+ // }
31
+ // }
32
+ //
33
+ // destroyDialog() {
34
+ // this.getAttribute('close')?.();
35
+ // }
36
+ //
37
+ // onInitElement(element: HTMLDialogElement) {
38
+ // this.element = element;
39
+ // if (this.hasAttribute('show')) {
40
+ // this.element.showModal();
41
+ // }
42
+ // this.getAttribute('toggle')?.(this.element);
43
+ //
44
+ // this.element.addEventListener('click', (event) => {
45
+ // if (this.getAttribute('backdropClickClose') !== null) {
46
+ // if (event.target === this.element) {
47
+ // this.closeDialog();
48
+ // }
49
+ // }
50
+ // });
51
+ // }
52
+ //
53
+ // showModal() {
54
+ // this.element?.showModal();
55
+ // if (this.element)
56
+ // this.getAttribute('toggle')?.(this.element);
57
+ // }
58
+ //
59
+ // show() {
60
+ // this.element?.show();
61
+ // if (this.element)
62
+ // this.getAttribute('toggle')?.(this.element);
63
+ // }
64
+ //
65
+ // close() {
66
+ // this.element?.close();
67
+ // }
68
+ // setData(data?: D | null) {
69
+ //
70
+ // }
71
+ // onChangeAttrRender(name: string, value: any, other: OtherData) {
72
+ // super.onChangeAttrRender(name, value, other);
73
+ // if (this.equalsAttributeName(name, 'show') && this.element) {
74
+ // if (this.hasAttribute('show')) {
75
+ // this.showModal();
76
+ // } else {
77
+ // this.close();
78
+ // }
79
+ // } else if (name === 'data') {
80
+ // this.setData(this.getAttribute('data'))
81
+ // }
82
+ // }
83
+ // }
84
+ // }
85
+ //# sourceMappingURL=Dialog.js.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=ImageEditorDialog.d.ts.map
@@ -0,0 +1,116 @@
1
+ // import { Component } from '@dooboostore/simple-boot-front/decorators/Component';
2
+ // import template from './imageEditorDialog.html'
3
+ // import styles from './imageEditorDialog.css'
4
+ // import { ComponentBase } from '@dooboostore/app-system/component/ComponentBase';
5
+ // import { AuthStore } from '@src/store/AuthStore';
6
+ // import { OnCreateRender } from '@dooboostore/dom-render/lifecycle/OnCreateRender';
7
+ // import { OnDestroyRender, OnDestroyRenderParams } from '@dooboostore/dom-render/lifecycle/OnDestroyRender';
8
+ // import { Subscription } from '@dooboostore/core/message';
9
+ // import { Inject } from '@dooboostore/simple-boot/decorators/inject/Inject';
10
+ // import { AuthService } from '@src/service/AuthService';
11
+ // import { UserService } from '@src/service/UserService';
12
+ // import { ObjetService } from '@src/service/ObjetService';
13
+ // import { Talks } from '@src/entities/Talks';
14
+ // import { TalkService } from '@src/service/TalkService';
15
+ // import { ItemService } from '@src/service/ItemService';
16
+ // import { SimFrontOption } from '@dooboostore/simple-boot-front/option/SimFrontOption';
17
+ // import { DomRenderNoProxy } from '@dooboostore/dom-render/decorators/DomRenderNoProxy';
18
+ // import { Appender } from '@dooboostore/dom-render/operators/Appender';
19
+ // import { ConvertUtils as WebConvertUtils } from '@dooboostore/core-web/convert/ConvertUtils';
20
+ // import { WorldService } from '@src/service/WorldService';
21
+ // import { ConvertUtils } from '@dooboostore/core/convert/ConvertUtils';
22
+ // import { Router } from '@dooboostore/dom-render/routers/Router';
23
+ //
24
+ // export type ImageEditorDialogData = {}
25
+ //
26
+ // export type Attribute = {
27
+ // show?: null,
28
+ // data: ImageEditorDialogData,
29
+ // close: () => void,
30
+ // };
31
+ //
32
+ // @Component({
33
+ // template,
34
+ // styles,
35
+ // selector: 'ImageEditorDialog'
36
+ // })
37
+ // export class ImageEditorDialog extends ComponentBase<Attribute> implements OnCreateRender, OnDestroyRender {
38
+ // private formElement?: HTMLFormElement;
39
+ // private dialogElement?: HTMLDialogElement;
40
+ // private open = false;
41
+ //
42
+ // constructor(
43
+ // private simConfig: SimFrontOption,
44
+ // private authStore: AuthStore,
45
+ // @Inject({symbol: UserService.SYMBOL}) private userService: UserService,
46
+ // @Inject({symbol: TalkService.SYMBOL}) private talkService: TalkService,
47
+ // @Inject({symbol: ItemService.SYMBOL}) private itemService: ItemService,
48
+ // @Inject({symbol: ObjetService.SYMBOL}) private objetService: ObjetService,
49
+ // @Inject({symbol: WorldService.SYMBOL}) private worldService: WorldService,
50
+ // @Inject({symbol: AuthService.SYMBOL}) private authService: AuthService,
51
+ // private router: Router
52
+ // ) {
53
+ // super();
54
+ // }
55
+ //
56
+ // onInitDialog(element: HTMLDialogElement) {
57
+ // this.dialogElement = element;
58
+ // // console.log('----------onInitDialog------', this.dialogElement, this.dialogElement.isConnected, this.hasAttribute('show'))
59
+ // if (this.hasAttribute('show')) {
60
+ // this.dialogElement.showModal();
61
+ // }
62
+ // this.open = this.dialogElement.open;
63
+ // }
64
+ //
65
+ // onCreateRender(...param: any[]): void {
66
+ // }
67
+ //
68
+ // async onProfileImageChange(event: Event) {
69
+ // const fileInputElement = event.currentTarget as HTMLInputElement;
70
+ // const files = fileInputElement.files;
71
+ // if (files && files.length) {
72
+ // const file = files[0];
73
+ // if (file.size > 0) {
74
+ // await this.worldService.setWorld({
75
+ // profile:await WebConvertUtils.toBase64(this.compressImage(file), {type: file.type, quality: 0.2})
76
+ // });
77
+ // this.authStore.refresh();
78
+ // }
79
+ // }
80
+ // }
81
+ //
82
+ //
83
+ // async formSubmit(form: HTMLFormElement, event: SubmitEvent) {
84
+ // event.preventDefault();
85
+ // }
86
+ //
87
+ // compressImage(file: File) {
88
+ // return WebConvertUtils.compressImage(file, {maxWidth: 100})
89
+ // }
90
+ //
91
+ // destroyDialog() {
92
+ // this.formElement?.reset();
93
+ // this.attribute?.close?.();
94
+ // }
95
+ //
96
+ //
97
+ // // form
98
+ // onInitFrom(element: HTMLFormElement) {
99
+ // this.formElement = element;
100
+ // }
101
+ //
102
+ //
103
+ // closeDialog() {
104
+ // if (this.dialogElement) {
105
+ // this.dialogElement.close();
106
+ // this.open = this.dialogElement.open;
107
+ // }
108
+ // }
109
+ //
110
+ //
111
+ // onDestroyRender(data: OnDestroyRenderParams) {
112
+ // }
113
+ //
114
+ //
115
+ // }
116
+ //# sourceMappingURL=ImageEditorDialog.js.map
@@ -0,0 +1,18 @@
1
+ import { ComponentBase } from '../ComponentBase';
2
+ import { RunConfig } from '../../DomRender';
3
+ import { OtherData } from '../../lifecycle/OnChangeAttrRender';
4
+ export declare namespace ForOf {
5
+ const selector = "System:ForOf";
6
+ type Attribute<D> = {
7
+ value: D;
8
+ };
9
+ class ForOf<D> extends ComponentBase<Attribute<D>> {
10
+ private value?;
11
+ onChangeAttrRender(name: string, value: any, other: OtherData): void;
12
+ }
13
+ }
14
+ declare const _default: {
15
+ forOf: (config?: RunConfig) => import("../../configs/TargetElement").TargetElement;
16
+ };
17
+ export default _default;
18
+ //# sourceMappingURL=ForOf.d.ts.map
@@ -0,0 +1,32 @@
1
+ import { ComponentBase } from '../ComponentBase';
2
+ import { DomRender } from '../../DomRender';
3
+ import { RawSet } from '../../rawsets/RawSet';
4
+ export var ForOf;
5
+ (function (ForOf_1) {
6
+ ForOf_1.selector = 'System:ForOf';
7
+ // @Component({
8
+ // template: '<div dr-for-of="@this@.data" dr-option-strip="true">#innerHTML#</div>',
9
+ // selector: `${selector}`
10
+ // })
11
+ class ForOf extends ComponentBase {
12
+ onChangeAttrRender(name, value, other) {
13
+ super.onChangeAttrRender(name, value, other);
14
+ if (this.equalsAttributeName(name, 'value')) {
15
+ this.value = value;
16
+ }
17
+ }
18
+ }
19
+ ForOf_1.ForOf = ForOf;
20
+ })(ForOf || (ForOf = {}));
21
+ export default {
22
+ forOf: (config) => {
23
+ return RawSet.createComponentTargetElement({
24
+ name: ForOf.selector,
25
+ template: '<div dr-for-of="@this@.data" dr-option-strip="true">#innerHTML#</div>',
26
+ objFactory: (e, o, r2, counstructorParam) => {
27
+ return DomRender.run({ rootObject: new ForOf.ForOf(...counstructorParam), config: config });
28
+ }
29
+ });
30
+ },
31
+ };
32
+ //# sourceMappingURL=ForOf.js.map
@@ -0,0 +1,21 @@
1
+ import { ComponentBase } from '../ComponentBase';
2
+ import { OtherData } from '../../lifecycle/OnChangeAttrRender';
3
+ import { RunConfig } from '../../DomRender';
4
+ import { OnInitRender } from '../../lifecycle/OnInitRender';
5
+ import { RawSet } from '../../rawsets/RawSet';
6
+ export declare namespace If {
7
+ const selector = "dr-if";
8
+ type Attribute<D> = {
9
+ value?: null | boolean;
10
+ };
11
+ class If<D> extends ComponentBase<Attribute<D>> implements OnInitRender {
12
+ private sw;
13
+ onInitRender(param: any, rawSet: RawSet): void;
14
+ onChangeAttrRender(name: string, value: any, other: OtherData): void;
15
+ }
16
+ }
17
+ declare const _default: {
18
+ if: (config?: RunConfig) => import("../../configs/TargetElement").TargetElement;
19
+ };
20
+ export default _default;
21
+ //# sourceMappingURL=If.d.ts.map