@dooboostore/dom-render 1.0.102 → 1.0.103
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/DomRender.d.ts +21 -6
- package/DomRender.js +54 -23
- package/DomRenderProxy.d.ts +7 -3
- package/DomRenderProxy.js +120 -49
- package/README.MD +380 -65
- package/components/ComponentBase.d.ts +11 -9
- package/components/ComponentBase.js +41 -14
- package/components/ComponentSet.d.ts +2 -2
- package/components/appender/Appender.d.ts +2 -2
- package/components/checkbox/CheckBox.d.ts +4 -4
- package/components/choose/Choose.d.ts +4 -4
- package/components/choose/Choose.js +0 -16
- package/components/details/Details.d.ts +5 -5
- package/components/forOf/ForOf.d.ts +2 -2
- package/components/if/If.d.ts +2 -2
- package/components/index.d.ts +26 -24
- package/components/index.js +2 -1
- package/components/input/Input.d.ts +2 -2
- package/components/input/Input.js +27 -24
- package/components/promise/PromiseSwitch.d.ts +6 -6
- package/components/promise/PromiseSwitch.js +15 -0
- package/components/radio/Radio.d.ts +4 -4
- package/components/router/Route.d.ts +32 -0
- package/components/router/Route.js +116 -0
- package/components/select/Select.d.ts +3 -3
- package/components/select/Select.js +2 -2
- package/components/this/This.d.ts +9 -2
- package/components/this/This.js +24 -2
- package/components/timer/Timer.d.ts +2 -2
- package/configs/Config.d.ts +6 -1
- package/decorators/DomRenderNoProxy.d.ts +2 -0
- package/decorators/DomRenderNoProxy.js +15 -0
- package/dist/bundle.js +2 -0
- package/events/EventManager.d.ts +16 -4
- package/events/EventManager.js +320 -140
- package/index.d.ts +48 -1
- package/index.js +40 -0
- package/lifecycle/OnDestroyRender.d.ts +1 -1
- package/lifecycle/OnProxyDomRender.d.ts +1 -0
- package/lifecycle/OnProxyDomRender.js +1 -1
- package/operators/DrForOf.js +2 -1
- package/operators/DrIf.js +3 -2
- package/operators/DrTargetElement.js +2 -1
- package/operators/DrTargetElementIsElement.d.ts +0 -5
- package/operators/DrTargetElementIsElement.js +2 -1
- package/operators/DrThis.js +40 -11
- package/operators/OperatorExecuter.js +3 -1
- package/package.json +5 -4
- package/rawsets/Attrs.d.ts +2 -0
- package/rawsets/RawSet.d.ts +2 -2
- package/rawsets/RawSet.js +48 -33
- package/routers/HashRouter.d.ts +5 -4
- package/routers/HashRouter.js +8 -5
- package/routers/PathRouter.d.ts +5 -4
- package/routers/PathRouter.js +6 -4
- package/routers/Router.d.ts +22 -8
- package/routers/Router.js +44 -24
|
@@ -12,18 +12,18 @@ import { ElementUtils } from '@dooboostore/core-web/element/ElementUtils';
|
|
|
12
12
|
import { RawSet } from '../rawsets/RawSet';
|
|
13
13
|
import { DomRenderNoProxy } from '../decorators/DomRenderNoProxy';
|
|
14
14
|
import { ConvertUtils } from '@dooboostore/core/convert/ConvertUtils';
|
|
15
|
-
import * as Render from '../rawsets/Render';
|
|
16
15
|
import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';
|
|
17
16
|
export const ATTRIBUTE_METADATA_KEY = Symbol('attribute');
|
|
18
17
|
export const QUERY_METADATA_KEY = Symbol('query');
|
|
19
18
|
export const EVENT_METADATA_KEY = Symbol('event');
|
|
20
19
|
export function attribute(options) {
|
|
21
|
-
return (target, propertyKey) => {
|
|
20
|
+
return (target, propertyKey, descriptor) => {
|
|
22
21
|
const attributes = ReflectUtils.getMetadata(ATTRIBUTE_METADATA_KEY, target.constructor) || [];
|
|
23
22
|
attributes.push({
|
|
24
23
|
propertyKey: propertyKey,
|
|
25
24
|
name: (options === null || options === void 0 ? void 0 : options.name) || propertyKey,
|
|
26
|
-
converter: options === null || options === void 0 ? void 0 : options.converter
|
|
25
|
+
converter: options === null || options === void 0 ? void 0 : options.converter,
|
|
26
|
+
isMethod: !!descriptor
|
|
27
27
|
});
|
|
28
28
|
ReflectUtils.defineMetadata(ATTRIBUTE_METADATA_KEY, attributes, target.constructor);
|
|
29
29
|
};
|
|
@@ -51,22 +51,35 @@ export function event(options) {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
export class ComponentBase {
|
|
54
|
+
get componentConfig() {
|
|
55
|
+
return this._config;
|
|
56
|
+
}
|
|
54
57
|
get render() {
|
|
55
58
|
return this._render;
|
|
56
59
|
}
|
|
57
60
|
get rawSet() {
|
|
58
61
|
return this._rawSet;
|
|
59
62
|
}
|
|
60
|
-
_queryElements(selector) {
|
|
63
|
+
_queryElements(selector, rawSet) {
|
|
61
64
|
var _a, _b, _c, _d;
|
|
62
65
|
const e = this.getElement();
|
|
66
|
+
// console.log('queryElement-->', e);
|
|
63
67
|
if (e) {
|
|
64
68
|
return ElementUtils.querySelectorAll(e, selector);
|
|
65
69
|
}
|
|
66
70
|
else {
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
let startNode = (_a = rawSet.point) === null || _a === void 0 ? void 0 : _a.start;
|
|
72
|
+
let endNode = (_b = rawSet.point) === null || _b === void 0 ? void 0 : _b.end;
|
|
73
|
+
// console.log('-----', startNode, endNode)
|
|
74
|
+
// console.log('-----', startNode?.isConnected, endNode?.isConnected)
|
|
75
|
+
if (((_c = rawSet.point) === null || _c === void 0 ? void 0 : _c.start) && startNode && !startNode.isConnected && startNode instanceof HTMLElement && startNode.hasAttribute('id')) {
|
|
76
|
+
rawSet.point.start = startNode = rawSet.dataSet.config.window.document.querySelector('#' + startNode.id);
|
|
77
|
+
}
|
|
78
|
+
if (((_d = rawSet.point) === null || _d === void 0 ? void 0 : _d.end) && endNode && !endNode.isConnected && endNode instanceof HTMLElement && endNode.hasAttribute('id')) {
|
|
79
|
+
rawSet.point.end = endNode = rawSet.dataSet.config.window.document.querySelector('#' + endNode.id);
|
|
80
|
+
}
|
|
69
81
|
if (startNode && endNode) {
|
|
82
|
+
// console.log('query!!', startNode, endNode);
|
|
70
83
|
return ElementUtils.querySelectorAll({ start: startNode, end: endNode }, selector);
|
|
71
84
|
}
|
|
72
85
|
}
|
|
@@ -138,8 +151,8 @@ export class ComponentBase {
|
|
|
138
151
|
const targets = Array.isArray(typeOrTypes) ? typeOrTypes : [typeOrTypes];
|
|
139
152
|
return this._children.filter(child => targets.some(targetConstructor => child instanceof targetConstructor));
|
|
140
153
|
}
|
|
141
|
-
constructor(
|
|
142
|
-
this.
|
|
154
|
+
constructor(_config) {
|
|
155
|
+
this._config = _config;
|
|
143
156
|
this._children = [];
|
|
144
157
|
this._boundEventListeners = [];
|
|
145
158
|
}
|
|
@@ -162,10 +175,10 @@ export class ComponentBase {
|
|
|
162
175
|
if ((_a = data.render) === null || _a === void 0 ? void 0 : _a.rawSet) {
|
|
163
176
|
this.setRawSet(data.render.rawSet);
|
|
164
177
|
}
|
|
165
|
-
if ((_b = this.
|
|
166
|
-
const isOk = Array.isArray((_c = this.
|
|
178
|
+
if ((_b = this._config) === null || _b === void 0 ? void 0 : _b.onlyParentType) {
|
|
179
|
+
const isOk = Array.isArray((_c = this._config) === null || _c === void 0 ? void 0 : _c.onlyParentType) ? (_d = this._config) === null || _d === void 0 ? void 0 : _d.onlyParentType : [(_e = this._config) === null || _e === void 0 ? void 0 : _e.onlyParentType].some(it => { var _a; return ((_a = data.render) === null || _a === void 0 ? void 0 : _a.parentThis) instanceof it; });
|
|
167
180
|
if (!isOk) {
|
|
168
|
-
throw new Error('only my parentThis ' + ((_f = this.
|
|
181
|
+
throw new Error('only my parentThis ' + ((_f = this._config) === null || _f === void 0 ? void 0 : _f.onlyParentType));
|
|
169
182
|
}
|
|
170
183
|
}
|
|
171
184
|
}
|
|
@@ -178,12 +191,24 @@ export class ComponentBase {
|
|
|
178
191
|
for (const attrInfo of attributes) {
|
|
179
192
|
if (this.equalsAttributeName(name, attrInfo.name)) {
|
|
180
193
|
const finalValue = attrInfo.converter ? attrInfo.converter(value) : value;
|
|
181
|
-
|
|
194
|
+
if (attrInfo.isMethod) {
|
|
195
|
+
const method = this[attrInfo.propertyKey];
|
|
196
|
+
if (typeof method === 'function') {
|
|
197
|
+
method.call(this, finalValue);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
this[attrInfo.propertyKey] = finalValue;
|
|
202
|
+
}
|
|
182
203
|
}
|
|
183
204
|
}
|
|
184
205
|
}
|
|
185
206
|
}
|
|
186
207
|
onInitRender(param, rawSet) {
|
|
208
|
+
// console.log('onInitRender!!',param, rawSet);
|
|
209
|
+
// console.dir(rawSet, {depth: 33})
|
|
210
|
+
// console.table(rawSet);
|
|
211
|
+
// console.log('--------', rawSet.point)
|
|
187
212
|
if (rawSet) {
|
|
188
213
|
this.setRawSet(rawSet);
|
|
189
214
|
const e = this.getElement();
|
|
@@ -192,10 +217,12 @@ export class ComponentBase {
|
|
|
192
217
|
}
|
|
193
218
|
// Handle @query decorators
|
|
194
219
|
const queries = ReflectUtils.getMetadata(QUERY_METADATA_KEY, this.constructor);
|
|
220
|
+
// console.log('queries', queries)
|
|
195
221
|
if (queries && Array.isArray(queries)) {
|
|
196
222
|
for (const queryInfo of queries) {
|
|
197
223
|
const { selector, propertyKey, isMethod } = queryInfo;
|
|
198
|
-
const elements = this._queryElements(selector);
|
|
224
|
+
const elements = this._queryElements(selector, rawSet);
|
|
225
|
+
// console.log('-------element', elements);
|
|
199
226
|
if (isMethod) {
|
|
200
227
|
const method = this[propertyKey];
|
|
201
228
|
if (typeof method === 'function') {
|
|
@@ -225,7 +252,7 @@ export class ComponentBase {
|
|
|
225
252
|
const events = ReflectUtils.getMetadata(EVENT_METADATA_KEY, this.constructor);
|
|
226
253
|
if (events && Array.isArray(events)) {
|
|
227
254
|
for (const eventInfo of events) {
|
|
228
|
-
const elements = this._queryElements(eventInfo.query);
|
|
255
|
+
const elements = this._queryElements(eventInfo.query, rawSet);
|
|
229
256
|
elements.forEach(element => {
|
|
230
257
|
const listener = this[eventInfo.methodName].bind(this);
|
|
231
258
|
element.addEventListener(eventInfo.eventName, listener);
|
|
@@ -5,8 +5,8 @@ export type ComponentSetConfig = {
|
|
|
5
5
|
export declare class ComponentSet<T = any> {
|
|
6
6
|
obj: T;
|
|
7
7
|
private _config;
|
|
8
|
-
private _template
|
|
9
|
-
private _styles
|
|
8
|
+
private _template?;
|
|
9
|
+
private _styles?;
|
|
10
10
|
constructor(obj: T, source: {
|
|
11
11
|
template?: string;
|
|
12
12
|
styles?: (string[]) | string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentBase } from '../ComponentBase';
|
|
2
|
-
import {
|
|
2
|
+
import { DomRenderRunConfig } from '../../DomRender';
|
|
3
3
|
import { RawSet } from '../../rawsets/RawSet';
|
|
4
4
|
import { OtherData } from '../../lifecycle/OnChangeAttrRender';
|
|
5
5
|
import { OnInitRender } from '../../lifecycle/OnInitRender';
|
|
@@ -17,7 +17,7 @@ export declare namespace Appender {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
declare const _default: {
|
|
20
|
-
appender: (config?:
|
|
20
|
+
appender: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
21
21
|
};
|
|
22
22
|
export default _default;
|
|
23
23
|
//# sourceMappingURL=Appender.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentBase } from '../ComponentBase';
|
|
2
|
-
import {
|
|
2
|
+
import { DomRenderRunConfig } from '../../DomRender';
|
|
3
3
|
import { OtherData } from '../../lifecycle/OnChangeAttrRender';
|
|
4
4
|
import { OnCreateRenderDataParams } from '../../lifecycle/OnCreateRenderData';
|
|
5
5
|
export declare namespace CheckBox {
|
|
@@ -39,9 +39,9 @@ export declare namespace CheckBox {
|
|
|
39
39
|
export {};
|
|
40
40
|
}
|
|
41
41
|
declare const _default: {
|
|
42
|
-
checkBoxChecked: (config?:
|
|
43
|
-
checkBoxUnchecked: (config?:
|
|
44
|
-
checkBox: (config?:
|
|
42
|
+
checkBoxChecked: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
43
|
+
checkBoxUnchecked: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
44
|
+
checkBox: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
45
45
|
};
|
|
46
46
|
export default _default;
|
|
47
47
|
//# sourceMappingURL=CheckBox.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentBase } from '../ComponentBase';
|
|
2
|
-
import {
|
|
2
|
+
import { DomRenderRunConfig } from '../../DomRender';
|
|
3
3
|
import { OtherData } from '../../lifecycle/OnChangeAttrRender';
|
|
4
4
|
import { OnCreateRenderDataParams } from '../../lifecycle/OnCreateRenderData';
|
|
5
5
|
export declare namespace Choose {
|
|
@@ -31,9 +31,9 @@ export declare namespace Choose {
|
|
|
31
31
|
export {};
|
|
32
32
|
}
|
|
33
33
|
declare const _default: {
|
|
34
|
-
chooseWhen: (config?:
|
|
35
|
-
chooseOtherWise: (config?:
|
|
36
|
-
choose: (config?:
|
|
34
|
+
chooseWhen: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
35
|
+
chooseOtherWise: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
36
|
+
choose: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
37
37
|
};
|
|
38
38
|
export default _default;
|
|
39
39
|
//# sourceMappingURL=Choose.d.ts.map
|
|
@@ -12,30 +12,18 @@ export var Choose;
|
|
|
12
12
|
}
|
|
13
13
|
class ChildBase extends ChildOtherWiseBase {
|
|
14
14
|
}
|
|
15
|
-
// @Component({
|
|
16
|
-
// template: '<div dr-if="!@this@.hidden" dr-strip="true" >#innerHTML#</div>',
|
|
17
|
-
// selector: `${selector}.When`
|
|
18
|
-
// })
|
|
19
15
|
class When extends ChildBase {
|
|
20
16
|
constructor() {
|
|
21
17
|
super({ onlyParentType: (Choose) });
|
|
22
18
|
}
|
|
23
19
|
}
|
|
24
20
|
Choose_1.When = When;
|
|
25
|
-
// @Component({
|
|
26
|
-
// template: '<div dr-if="!@this@.hidden" dr-strip="true" >#innerHTML#</div>',
|
|
27
|
-
// selector: `${selector}.OtherWise`
|
|
28
|
-
// })
|
|
29
21
|
class OtherWise extends ChildBase {
|
|
30
22
|
constructor() {
|
|
31
23
|
super({ onlyParentType: (Choose) });
|
|
32
24
|
}
|
|
33
25
|
}
|
|
34
26
|
Choose_1.OtherWise = OtherWise;
|
|
35
|
-
// @Component({
|
|
36
|
-
// template: '#innerHTML#',
|
|
37
|
-
// selector: `${selector}`
|
|
38
|
-
// })
|
|
39
27
|
class Choose extends ComponentBase {
|
|
40
28
|
onCreatedThisChild(child, data) {
|
|
41
29
|
super.onCreatedThisChild(child, data);
|
|
@@ -43,10 +31,6 @@ export var Choose;
|
|
|
43
31
|
}
|
|
44
32
|
onChangeAttrRender(name, value, other) {
|
|
45
33
|
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
34
|
if (this.equalsAttributeName(name, 'data')) {
|
|
51
35
|
this.choose = undefined;
|
|
52
36
|
const children = this.getChildren([When, OtherWise]).sort((a, b) => (a instanceof OtherWise ? 1 : 0) - (b instanceof OtherWise ? 1 : 0));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentBase } from '../ComponentBase';
|
|
2
|
-
import {
|
|
2
|
+
import { DomRenderRunConfig } from '../../DomRender';
|
|
3
3
|
import { RawSet } from '../../rawsets/RawSet';
|
|
4
4
|
import { OtherData } from '../../lifecycle/OnChangeAttrRender';
|
|
5
5
|
import { OnInitRender } from '../../lifecycle/OnInitRender';
|
|
@@ -48,10 +48,10 @@ export declare namespace Details {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
declare const _default: {
|
|
51
|
-
detailsSummary: (config?:
|
|
52
|
-
detailsBody: (config?:
|
|
53
|
-
detailsForm: (config?:
|
|
54
|
-
details: (config?:
|
|
51
|
+
detailsSummary: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
52
|
+
detailsBody: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
53
|
+
detailsForm: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
54
|
+
details: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
55
55
|
};
|
|
56
56
|
export default _default;
|
|
57
57
|
//# sourceMappingURL=Details.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentBase } from '../ComponentBase';
|
|
2
|
-
import {
|
|
2
|
+
import { DomRenderRunConfig } from '../../DomRender';
|
|
3
3
|
import { OtherData } from '../../lifecycle/OnChangeAttrRender';
|
|
4
4
|
export declare namespace ForOf {
|
|
5
5
|
const selector = "System:ForOf";
|
|
@@ -12,7 +12,7 @@ export declare namespace ForOf {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
declare const _default: {
|
|
15
|
-
forOf: (config?:
|
|
15
|
+
forOf: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
16
16
|
};
|
|
17
17
|
export default _default;
|
|
18
18
|
//# sourceMappingURL=ForOf.d.ts.map
|
package/components/if/If.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentBase } from '../ComponentBase';
|
|
2
2
|
import { OtherData } from '../../lifecycle/OnChangeAttrRender';
|
|
3
|
-
import {
|
|
3
|
+
import { DomRenderRunConfig } from '../../DomRender';
|
|
4
4
|
import { OnInitRender } from '../../lifecycle/OnInitRender';
|
|
5
5
|
import { RawSet } from '../../rawsets/RawSet';
|
|
6
6
|
export declare namespace If {
|
|
@@ -15,7 +15,7 @@ export declare namespace If {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
declare const _default: {
|
|
18
|
-
if: (config?:
|
|
18
|
+
if: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
19
19
|
};
|
|
20
20
|
export default _default;
|
|
21
21
|
//# sourceMappingURL=If.d.ts.map
|
package/components/index.d.ts
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
export declare const drComponent: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
2
|
+
match: (config?: import("..").Config) => import("../configs/TargetElement").TargetElement;
|
|
3
|
+
regexp: (config?: import("..").Config) => import("../configs/TargetElement").TargetElement;
|
|
4
|
+
input: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
5
|
+
detailsSummary: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
6
|
+
detailsBody: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
7
|
+
detailsForm: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
8
|
+
details: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
9
|
+
choose: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
10
|
+
selectOption: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
11
|
+
select: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
12
|
+
radioChecked: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
13
|
+
radioUnChecked: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
14
|
+
radio: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
15
|
+
checkBoxChecked: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
16
|
+
checkBoxUnchecked: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
17
|
+
checkBox: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
18
|
+
chooseWhen: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
19
|
+
chooseOtherWise: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
20
|
+
promiseDefault: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
21
|
+
promisePending: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
22
|
+
promiseFulfilled: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
23
|
+
promiseRejected: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
24
|
+
promiseSwitch: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
25
|
+
appender: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
26
|
+
this: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
27
|
+
if: (config?: import("..").DomRenderRunConfig) => import("../configs/TargetElement").TargetElement;
|
|
26
28
|
};
|
|
27
29
|
//# sourceMappingURL=index.d.ts.map
|
package/components/index.js
CHANGED
|
@@ -9,5 +9,6 @@ import Select from './select/Select';
|
|
|
9
9
|
import Timer from './timer/Timer';
|
|
10
10
|
import Details from './details/Details';
|
|
11
11
|
import Input from './input/Input';
|
|
12
|
-
|
|
12
|
+
import Route from './router/Route';
|
|
13
|
+
export const drComponent = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, If), This), Appender), PromiseSwitch), Choose), CheckBox), Radio), Select), Timer), Details), Input), Route);
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentBase } from '../ComponentBase';
|
|
2
|
-
import {
|
|
2
|
+
import { DomRenderRunConfig } from '../../DomRender';
|
|
3
3
|
import { RawSet } from '../../rawsets/RawSet';
|
|
4
4
|
import { OtherData } from '../../lifecycle/OnChangeAttrRender';
|
|
5
5
|
import { OnCreateRender } from '../../lifecycle/OnCreateRender';
|
|
@@ -28,7 +28,7 @@ export declare namespace Input {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
declare const _default: {
|
|
31
|
-
input: (config?:
|
|
31
|
+
input: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
32
32
|
};
|
|
33
33
|
export default _default;
|
|
34
34
|
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -22,37 +22,40 @@ export var Input;
|
|
|
22
22
|
}
|
|
23
23
|
onInitRender(param, rawSet) {
|
|
24
24
|
super.onInitRender(param, rawSet);
|
|
25
|
+
// console.log('dr-input, rawSet', rawSet)
|
|
25
26
|
const inputElement = this.element;
|
|
26
27
|
const debounceTimeAttribute = this.getAttribute('debounceTime');
|
|
27
28
|
const debounceTimeValue = ValidUtils.isNotNullUndefined(debounceTimeAttribute) ? Number(debounceTimeAttribute) : 0;
|
|
28
29
|
const distinct = ValidUtils.isNotNullUndefined(this.getAttribute('distinct'));
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// console.log('change?????????????', it);
|
|
43
|
-
(_a = this.getAttribute('input')) === null || _a === void 0 ? void 0 : _a(it, inputElement);
|
|
44
|
-
});
|
|
45
|
-
if (inputElement && inputElement.form) {
|
|
46
|
-
this.resetSubscripton = EventUtils.htmlElementEventObservable(inputElement.form, 'reset').subscribe(it => {
|
|
30
|
+
if (inputElement) {
|
|
31
|
+
const makeDeboundceDistinctUtilChanged = () => {
|
|
32
|
+
// let result$ = EventUtils.htmlElementEventObservable(inputElement,'input');
|
|
33
|
+
let result$ = EventUtils.htmlElementEventObservable(inputElement, 'input').pipe(map(event => event.target.value.trim()));
|
|
34
|
+
if (ValidUtils.isNotNullUndefined(debounceTimeValue) && debounceTimeValue > 0) {
|
|
35
|
+
result$ = result$.pipe(debounceTime(debounceTimeValue));
|
|
36
|
+
}
|
|
37
|
+
if (ValidUtils.isNotNullUndefined(distinct) && distinct === true) {
|
|
38
|
+
result$ = result$.pipe(distinctUntilChanged());
|
|
39
|
+
}
|
|
40
|
+
return result$;
|
|
41
|
+
};
|
|
42
|
+
this.inputSubscription = makeDeboundceDistinctUtilChanged().subscribe(it => {
|
|
47
43
|
var _a;
|
|
48
|
-
// console.log('
|
|
49
|
-
(_a = this.
|
|
50
|
-
|
|
44
|
+
// console.log('change?????????????', it);
|
|
45
|
+
(_a = this.getAttribute('input')) === null || _a === void 0 ? void 0 : _a(it, inputElement);
|
|
46
|
+
});
|
|
47
|
+
if (inputElement.form) {
|
|
48
|
+
this.resetSubscripton = EventUtils.htmlElementEventObservable(inputElement.form, 'reset').subscribe(it => {
|
|
51
49
|
var _a;
|
|
52
|
-
// console.log('
|
|
53
|
-
(_a = this.
|
|
50
|
+
// console.log('rrrraaa?,', this.inputSubscription, it)
|
|
51
|
+
(_a = this.inputSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
52
|
+
this.inputSubscription = makeDeboundceDistinctUtilChanged().subscribe(it => {
|
|
53
|
+
var _a;
|
|
54
|
+
// console.log('rrrr?')
|
|
55
|
+
(_a = this.getAttribute('input')) === null || _a === void 0 ? void 0 : _a(it, inputElement);
|
|
56
|
+
});
|
|
54
57
|
});
|
|
55
|
-
}
|
|
58
|
+
}
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
61
|
onChangeAttrRender(name, value, other) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentBase } from '../ComponentBase';
|
|
2
|
-
import {
|
|
2
|
+
import { DomRenderRunConfig } from '../../DomRender';
|
|
3
3
|
import { OtherData } from '../../lifecycle/OnChangeAttrRender';
|
|
4
4
|
import { OnCreateRenderDataParams } from '../../lifecycle/OnCreateRenderData';
|
|
5
5
|
export declare namespace PromiseSwitch {
|
|
@@ -45,11 +45,11 @@ export declare namespace PromiseSwitch {
|
|
|
45
45
|
export {};
|
|
46
46
|
}
|
|
47
47
|
declare const _default: {
|
|
48
|
-
promiseDefault: (config?:
|
|
49
|
-
promisePending: (config?:
|
|
50
|
-
promiseFulfilled: (config?:
|
|
51
|
-
promiseRejected: (config?:
|
|
52
|
-
promiseSwitch: (config?:
|
|
48
|
+
promiseDefault: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
49
|
+
promisePending: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
50
|
+
promiseFulfilled: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
51
|
+
promiseRejected: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
52
|
+
promiseSwitch: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
53
53
|
};
|
|
54
54
|
export default _default;
|
|
55
55
|
//# sourceMappingURL=PromiseSwitch.d.ts.map
|
|
@@ -47,6 +47,21 @@ export var PromiseSwitch;
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
PromiseSwitch_1.Rejected = Rejected;
|
|
50
|
+
/*
|
|
51
|
+
<dr-promise-switch data="${@this@.pickWorldPromise}$">
|
|
52
|
+
${@nearThis@.promiseState.status}$
|
|
53
|
+
<dr-promise-switch-default>
|
|
54
|
+
<button class="random-world-button" dr-event-click="@this@.pickWorld()">
|
|
55
|
+
<i class="fa-solid fa-dice"></i>
|
|
56
|
+
</button>
|
|
57
|
+
</dr-promise-switch-default>
|
|
58
|
+
<dr-promise-switch-pending>
|
|
59
|
+
<button class="random-world-button disabled spin" >
|
|
60
|
+
<i class="fa-solid fa-dice"></i>
|
|
61
|
+
</button>
|
|
62
|
+
</dr-promise-switch-pending>
|
|
63
|
+
</dr-promise-switch>
|
|
64
|
+
*/
|
|
50
65
|
// @Component({
|
|
51
66
|
// template: '#innerHTML#',
|
|
52
67
|
// selector: `${selector}`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentBase } from '../ComponentBase';
|
|
2
|
-
import {
|
|
2
|
+
import { DomRenderRunConfig } from '../../DomRender';
|
|
3
3
|
import { OtherData } from '../../lifecycle/OnChangeAttrRender';
|
|
4
4
|
import { OnCreateRenderDataParams } from '../../lifecycle/OnCreateRenderData';
|
|
5
5
|
export declare namespace Radio {
|
|
@@ -37,9 +37,9 @@ export declare namespace Radio {
|
|
|
37
37
|
export {};
|
|
38
38
|
}
|
|
39
39
|
declare const _default: {
|
|
40
|
-
radioChecked: (config?:
|
|
41
|
-
radioUnChecked: (config?:
|
|
42
|
-
radio: (config?:
|
|
40
|
+
radioChecked: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
41
|
+
radioUnChecked: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
42
|
+
radio: (config?: DomRenderRunConfig) => import("../../configs/TargetElement").TargetElement;
|
|
43
43
|
};
|
|
44
44
|
export default _default;
|
|
45
45
|
//# sourceMappingURL=Radio.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ComponentBase } from '../ComponentBase';
|
|
2
|
+
import { OnInitRender } from '../../lifecycle/OnInitRender';
|
|
3
|
+
import { RawSet } from '../../rawsets/RawSet';
|
|
4
|
+
import type { Config } from '../../configs/Config';
|
|
5
|
+
export declare namespace Route {
|
|
6
|
+
export const selector = "dr-route";
|
|
7
|
+
export type Attribute<D> = {
|
|
8
|
+
value?: null | string;
|
|
9
|
+
};
|
|
10
|
+
class CheckerBase<D> extends ComponentBase<Attribute<D>> implements OnInitRender {
|
|
11
|
+
protected sw: boolean;
|
|
12
|
+
}
|
|
13
|
+
export class Match<D> extends CheckerBase<D> {
|
|
14
|
+
value?: string;
|
|
15
|
+
private domRenderConfig;
|
|
16
|
+
constructor(domRenderConfig: Config);
|
|
17
|
+
onInitRender(param: any, rawSet: RawSet): void;
|
|
18
|
+
}
|
|
19
|
+
export class Regexp<D> extends CheckerBase<D> {
|
|
20
|
+
value?: string;
|
|
21
|
+
private domRenderConfig;
|
|
22
|
+
constructor(domRenderConfig: Config);
|
|
23
|
+
onInitRender(param: any, rawSet: RawSet): void;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
}
|
|
27
|
+
declare const _default: {
|
|
28
|
+
match: (config?: Config) => import("../../configs/TargetElement").TargetElement;
|
|
29
|
+
regexp: (config?: Config) => import("../../configs/TargetElement").TargetElement;
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|
|
32
|
+
//# sourceMappingURL=Route.d.ts.map
|