@ibyar/core 1.2.1 → 2.0.0
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/LICENSE +1 -1
- package/annotation/decorators.d.ts.map +1 -1
- package/annotation/options.d.ts +6 -4
- package/annotation/options.d.ts.map +1 -1
- package/annotation/options.js.map +1 -1
- package/component/component.d.ts.map +1 -1
- package/component/component.js +1 -0
- package/component/component.js.map +1 -1
- package/component/reflect.d.ts.map +1 -1
- package/di/inject.d.ts +3 -0
- package/di/inject.d.ts.map +1 -0
- package/di/inject.js +10 -0
- package/di/inject.js.map +1 -0
- package/directive/directive.d.ts +2 -1
- package/directive/directive.d.ts.map +1 -1
- package/directive/directive.js +3 -1
- package/directive/directive.js.map +1 -1
- package/directive/parser.d.ts +2 -1
- package/directive/parser.d.ts.map +1 -1
- package/directive/parser.js +26 -19
- package/directive/parser.js.map +1 -1
- package/html/expression.d.ts.map +1 -1
- package/html/expression.js +4 -1
- package/html/expression.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/linker/template-ref.d.ts.map +1 -1
- package/linker/view-ref.d.ts.map +1 -1
- package/package.json +9 -8
- package/signals/proposal-signals.d.ts +4 -0
- package/signals/proposal-signals.d.ts.map +1 -0
- package/signals/proposal-signals.js +11 -0
- package/signals/proposal-signals.js.map +1 -0
- package/signals/proposal-sugnal.d.ts +1 -0
- package/signals/proposal-sugnal.d.ts.map +1 -0
- package/signals/proposal-sugnal.js +2 -0
- package/signals/proposal-sugnal.js.map +1 -0
- package/signals/signals.js +8 -8
- package/signals/signals.js.map +1 -1
- package/typedoc.json +8 -0
- package/view/base-view.js.map +1 -1
- package/view/render.d.ts.map +1 -1
- package/view/render.js +7 -3
- package/view/render.js.map +1 -1
- package/zone/task.d.ts +0 -61
- package/zone/task.d.ts.map +1 -1
- package/zone/task.js +127 -116
- package/zone/task.js.map +1 -1
package/view/render.js.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eSubscription, Stack, ReadOnlyScope } from '@ibyar/expressions';\nimport {\n\tCommentNode, DomStructuralDirectiveNode,\n\tDomElementNode, DomFragmentNode, DomNode, isLiveTextContent,\n\tisTagNameNative, isValidCustomElementName, LiveTextContent,\n\tTextContent, DomAttributeDirectiveNode, isFormAssociatedCustomElementByTag\n} from '@ibyar/elements';\nimport type { DomStructuralDirectiveNodeUpgrade } from '@ibyar/elements/node.js';\nimport { ComponentRef } from '../component/component.js';\nimport { HTMLComponent, isHTMLComponent } from '../component/custom-element.js';\nimport { documentStack } from '../context/stack.js';\nimport { ClassRegistryProvider } from '../providers/provider.js';\nimport { isOnDestroy, isOnInit } from '../component/lifecycle.js';\nimport { hasAttr } from '../utils/elements-util.js';\nimport { AttributeDirective, AttributeOnStructuralDirective, StructuralDirective } from '../directive/directive.js';\nimport { TemplateRef, TemplateRefImpl } from '../linker/template-ref.js';\nimport { ViewContainerRefImpl } from '../linker/view-container-ref.js';\nimport { createDestroySubscription } from '../context/subscription.js';\nimport { EventEmitter } from '../component/events.js';\n\ntype ViewContext = { [element: string]: HTMLElement };\n\nfunction getChangeEventName(tagName: string): 'input' | 'change' | undefined {\n\tswitch (true) {\n\t\tcase tagName === 'input':\n\t\t\treturn 'input';\n\t\tcase tagName === 'textarea':\n\t\tcase tagName === 'select':\n\t\tcase isFormAssociatedCustomElementByTag(tagName):\n\t\t\treturn 'change';\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\nexport class ComponentRender<T extends object> {\n\tprivate componentRef: ComponentRef<T>;\n\tprivate template: DomNode;\n\tprivate contextStack: Stack;\n\tprivate templateNameScope: ReactiveScope<{ [templateName: string]: TemplateRef }>;\n\tprivate exportAsScope: ReactiveScope<Record<string, any>>;\n\tprivate viewScope: ReactiveScope<ViewContext> = new ReactiveScope({});\n\n\tconstructor(public view: HTMLComponent<T>, private subscriptions: ScopeSubscription<Context>[]) {\n\t\tthis.componentRef = this.view.getComponentRef();\n\t\tthis.contextStack = documentStack.copyStack();\n\t\tthis.contextStack.pushScope<Context>(this.view._modelScope);\n\t\tthis.exportAsScope = this.contextStack.pushReactiveScope();\n\t\tthis.templateNameScope = this.contextStack.pushReactiveScope();\n\t}\n\tinitView(): void {\n\t\tif (!this.componentRef.template) {\n\t\t\treturn;\n\t\t}\n\t\tif (typeof this.componentRef.template === 'function') {\n\t\t\tthis.template = this.componentRef.template(this.view._model);\n\t\t} else {\n\t\t\tthis.template = this.componentRef.template;\n\t\t}\n\n\t\tlet rootRef: HTMLElement | ShadowRoot;\n\t\tif (this.componentRef.isShadowDom) {\n\t\t\trootRef = Reflect.get(this.view, '_shadowRoot') as ShadowRoot;\n\t\t\tReflect.deleteProperty(this.view, '_shadowRoot');\n\t\t} else {\n\t\t\trootRef = this.view;\n\t\t}\n\t\tthis.initTemplateRefMap(this.template);\n\t\tlet rootFragment: DocumentFragment;\n\t\tif (this.template instanceof DomFragmentNode) {\n\t\t\trootFragment = this.createDocumentFragment(this.template, this.contextStack, rootRef, this.subscriptions, this.view);\n\t\t} else {\n\t\t\trootFragment = document.createDocumentFragment();\n\t\t\tthis.appendChildToParent(rootFragment, this.template, this.contextStack, rootRef, this.subscriptions, this.view);\n\t\t}\n\t\trootRef.append(rootFragment);\n\t}\n\tisTemplateRefName(template: DomNode): template is DomElementNode {\n\t\tif (template instanceof DomElementNode) {\n\t\t\tif (template.tagName === 'template' && template.templateRefName) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\tinitTemplateRefMap(domNode: DomNode) {\n\t\tif (!(domNode instanceof DomElementNode || domNode instanceof DomFragmentNode) || !domNode.children) {\n\t\t\treturn;\n\t\t}\n\t\tfor (let index = 0; index < domNode.children.length; index++) {\n\t\t\tconst child = domNode.children[index];\n\t\t\tif (this.isTemplateRefName(child)) {\n\t\t\t\tthis.templateNameScope.set(child.templateRefName!.name, undefined);\n\t\t\t} else {\n\t\t\t\tthis.initTemplateRefMap(child);\n\t\t\t}\n\t\t}\n\t}\n\tinitViewBinding() {\n\t\tif (this.componentRef.viewBindings) {\n\t\t\tthis.initHtmlElement(this.view, this.componentRef.viewBindings, this.contextStack, this.subscriptions);\n\t\t}\n\t\tif (this.componentRef.windowBindings) {\n\t\t\tthis.subscriptions.push(...this.initAttribute(window as any, this.componentRef.windowBindings, this.contextStack));\n\t\t}\n\t}\n\tgetElementByName(name: string) {\n\t\treturn Reflect.get(this.view, name);\n\t}\n\tcreateStructuralDirective(directive: DomStructuralDirectiveNode, comment: Comment, directiveStack: Stack, subscriptions: ScopeSubscription<Context>[], parentNode: Node, host: HTMLComponent<any> | StructuralDirective): void {\n\t\tconst directiveRef = ClassRegistryProvider.getDirectiveRef<T>(directive.name);\n\t\tif (!directiveRef) {\n\t\t\t// didn't find directive or it is not define yet.\n\t\t\t// class registry should have 'when defined' callback\n\t\t\treturn;\n\t\t}\n\t\tconst stack = directiveStack.copyStack();\n\t\tconst templateRef = new TemplateRefImpl(\n\t\t\tthis,\n\t\t\tdirective.node,\n\t\t\tstack,\n\t\t\t(directive as DomStructuralDirectiveNodeUpgrade).templateExpressions ?? [],\n\t\t);\n\t\tconst directiveZone = this.view._zone.fork(directiveRef.zone);\n\t\tconst viewContainerRef = new ViewContainerRefImpl(parentNode as Element, comment);\n\n\t\tdirectiveZone.onEmpty.subscribe(() => {\n\t\t\tconst length = viewContainerRef.length;\n\t\t\tfor (let index = 0; index < length; index++) {\n\t\t\t\tviewContainerRef.get(index)?.detectChanges();\n\t\t\t}\n\t\t});\n\n\t\tconst StructuralDirectiveClass = directiveRef.modelClass as typeof StructuralDirective;\n\t\tconst structural = directiveZone.run(() => new StructuralDirectiveClass(\n\t\t\ttemplateRef,\n\t\t\tviewContainerRef,\n\t\t\thost,\n\t\t\tdirectiveZone,\n\t\t));\n\t\ttemplateRef.host = structural;\n\t\tconst scope = ReactiveScope.readOnlyScopeForThis(structural);\n\t\tscope.getInnerScope('this')!.getContextProxy = () => structural;\n\t\tstack.pushScope(scope);\n\t\tif (directiveRef.exportAs) {\n\t\t\tstack.pushBlockScopeFor({ [directiveRef.exportAs]: structural });\n\t\t}\n\t\tsubscriptions.push(...this.initDirective(structural, directive, stack));\n\t\tif (isOnInit(structural)) {\n\t\t\tdirectiveZone.run(structural.onInit, structural);\n\t\t}\n\t\tif (directive.attributeDirectives?.length) {\n\t\t\tthis.initAttributeDirectives(directive.attributeDirectives, structural, stack, subscriptions);\n\t\t}\n\t\tif (isOnDestroy(structural)) {\n\t\t\tsubscriptions.push(createDestroySubscription(() => structural.onDestroy()));\n\t\t}\n\n\t}\n\tcreateComment(node: CommentNode): Comment {\n\t\treturn document.createComment(`${node.comment}`);\n\t}\n\tcreateText(node: TextContent): Text {\n\t\treturn new Text(node.value);\n\t}\n\tcreateLiveText(textNode: LiveTextContent, contextStack: Stack, subscriptions: ScopeSubscription<Context>[]): Text {\n\t\tconst liveText = new Text('');\n\t\tcontextStack = contextStack.copyStack();\n\t\tcontextStack.pushBlockScopeFor({ this: liveText });\n\t\tconst textSubscriptions = textNode.expression.subscribe(contextStack, textNode.pipelineNames);\n\t\tsubscriptions.push(...textSubscriptions);\n\t\ttextNode.expression.get(contextStack);\n\t\treturn liveText;\n\t}\n\tcreateDocumentFragment(node: DomFragmentNode, contextStack: Stack, parentNode: Node, subscriptions: ScopeSubscription<Context>[], host: HTMLComponent<any> | StructuralDirective): DocumentFragment {\n\t\tconst fragment = document.createDocumentFragment();\n\t\tnode.children?.forEach(child => this.appendChildToParent(fragment, child, contextStack, parentNode, subscriptions, host));\n\t\treturn fragment;\n\t}\n\tappendChildToParent(fragmentParent: HTMLElement | DocumentFragment, child: DomNode, contextStack: Stack, parentNode: Node, subscriptions: ScopeSubscription<Context>[], host: HTMLComponent<any> | StructuralDirective) {\n\t\tif (child instanceof DomElementNode) {\n\t\t\tif (this.isTemplateRefName(child)) {\n\t\t\t\tconst templateRefName = child.templateRefName!;\n\t\t\t\t// const oldRef = this.templateNameScope.get(templateRefName.name);\n\t\t\t\t// if (oldRef) {\n\t\t\t\t// \treturn;\n\t\t\t\t// }\n\t\t\t\t// TODO: extract template expression\n\t\t\t\tconst templateRef = new TemplateRefImpl(\n\t\t\t\t\tthis,\n\t\t\t\t\tnew DomFragmentNode(child.children),\n\t\t\t\t\tcontextStack.copyStack(),\n\t\t\t\t\t[]\n\t\t\t\t);\n\t\t\t\tthis.templateNameScope.set(templateRefName.name, templateRef);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfragmentParent.append(this.createElement(child, contextStack, subscriptions, host));\n\t\t} else if (child instanceof DomStructuralDirectiveNode) {\n\t\t\tconst commentText = child.name + (typeof child.value == 'string' ? (' = ' + child.value) : '');\n\t\t\tconst comment = document.createComment(`start ${commentText}`);\n\t\t\tfragmentParent.append(comment);\n\t\t\tconst lastComment = document.createComment(`end ${commentText}`);\n\t\t\tcomment.after(lastComment);\n\t\t\tthis.createStructuralDirective(child, comment, contextStack, subscriptions, parentNode, host);\n\t\t} else if (isLiveTextContent(child)) {\n\t\t\tfragmentParent.append(this.createLiveText(child, contextStack, subscriptions));\n\t\t} else if (child instanceof TextContent) {\n\t\t\tfragmentParent.append(this.createText(child));\n\t\t} else if (child instanceof CommentNode) {\n\t\t\tfragmentParent.append(this.createComment(child));\n\t\t} else if (child instanceof DomFragmentNode) {\n\t\t\tfragmentParent.append(this.createDocumentFragment(child, contextStack, parentNode, subscriptions, host));\n\t\t}\n\t}\n\tcreateElementByTagName(node: { tagName: string, is?: string }): HTMLElement {\n\t\tlet element: HTMLElement;\n\t\tif (isValidCustomElementName(node.tagName)) {\n\t\t\tconst ViewClass = customElements.get(node.tagName) as ((new () => HTMLElement) | undefined);\n\t\t\tif (ViewClass) {\n\t\t\t\telement = new ViewClass();\n\t\t\t} else {\n\t\t\t\telement = document.createElement(node.tagName);\n\t\t\t\tif (element.constructor.name === 'HTMLElement') {\n\t\t\t\t\tcustomElements.whenDefined(node.tagName).then(() => customElements.upgrade(element));\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isTagNameNative(node.tagName)) {\n\t\t\t// native tags // and custom tags can be used her\n\t\t\telement = document.createElement(node.tagName, node.is ? { is: node.is } : undefined);\n\t\t} else {\n\t\t\t// html unknown element\n\t\t\telement = document.createElement(node.tagName);\n\t\t}\n\t\treturn element;\n\t}\n\tcreateElement(node: DomElementNode, contextStack: Stack, subscriptions: ScopeSubscription<Context>[], host: HTMLComponent<any> | StructuralDirective): HTMLElement {\n\t\tconst element = this.createElementByTagName(node);\n\t\tthis.initHtmlElement(element, node, contextStack, subscriptions, host);\n\t\treturn element;\n\t}\n\n\tprivate createReadOnlyWithReactiveInnerScope<T extends Context>(ctx: T, aliasName?: string, propertyKeys?: (keyof T)[]) {\n\t\tif (!aliasName) {\n\t\t\treturn ReactiveScope.readOnlyScopeForThis(ctx, propertyKeys);\n\t\t}\n\t\tconst reactiveScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst context: Record<string, any> = {\n\t\t\t'this': ctx,\n\t\t\t[aliasName]: ctx,\n\t\t};\n\t\tconst rootScope = ReadOnlyScope.for(context, ['this', aliasName]);\n\t\trootScope.setInnerScope('this', reactiveScope);\n\t\trootScope.setInnerScope(aliasName as 'this', reactiveScope);\n\t\treturn rootScope;\n\t}\n\n\t/**\n\t * use for init host bindings\n\t * @param element \n\t * @param node \n\t * @param contextStack \n\t * @param subscriptions \n\t */\n\tinitHtmlElement(element: HTMLElement, node: DomElementNode, contextStack: Stack, subscriptions: ScopeSubscription<Context>[]): void;\n\n\t/**\n\t * use to init a new create html element\n\t * @param element \n\t * @param node \n\t * @param contextStack \n\t * @param subscriptions \n\t * @param host is the direct html element `this.view` or a sub `structural directive` like `*if` or `*for`, etc...\n\t */\n\tinitHtmlElement(element: HTMLElement, node: DomElementNode, contextStack: Stack, subscriptions: ScopeSubscription<Context>[], host: HTMLComponent<any> | StructuralDirective): void;\n\tinitHtmlElement(element: HTMLElement, node: DomElementNode, contextStack: Stack, subscriptions: ScopeSubscription<Context>[], host?: HTMLComponent<any> | StructuralDirective): void {\n\t\tconst elementStack = contextStack.copyStack();\n\t\tconst elementScope = isHTMLComponent(element)\n\t\t\t? element._viewScope\n\t\t\t: this.createReadOnlyWithReactiveInnerScope(element, node.templateRefName?.name);\n\t\telementStack.pushScope<Context>(elementScope);\n\t\tconst attributesSubscriptions = this.initAttribute(element, node, elementStack);\n\t\tsubscriptions.push(...attributesSubscriptions);\n\t\tconst changeEventName = getChangeEventName(node.tagName);\n\t\tif (changeEventName) {\n\t\t\tconst inputScope = elementScope.getInnerScope<ReactiveScope<HTMLInputElement>>('this')!;\n\t\t\tconst listener = (event: HTMLElementEventMap['input' | 'change']) => inputScope.emit('value', (element as HTMLInputElement).value);\n\t\t\telement.addEventListener(changeEventName, listener);\n\t\t\tsubscriptions.push(createDestroySubscription(\n\t\t\t\t() => element.removeEventListener(changeEventName, listener),\n\t\t\t));\n\t\t}\n\n\t\tconst templateRefName = node.templateRefName;\n\t\tif (templateRefName) {\n\t\t\tReflect.set(this.view, templateRefName.name, element);\n\t\t\tthis.viewScope.set(templateRefName.name, element);\n\t\t\tconst view = this.componentRef.viewChild.find(child => child.selector === templateRefName.name);\n\t\t\tif (view) {\n\t\t\t\tReflect.set(this.view._model, view.modelName, element);\n\t\t\t}\n\t\t}\n\t\tif (node.children) {\n\t\t\tfor (const child of node.children) {\n\t\t\t\tthis.appendChildToParent(element, child, elementStack, element, subscriptions, host!);\n\t\t\t}\n\t\t}\n\t\tif (node.attributeDirectives?.length) {\n\t\t\tthis.initAttributeDirectives(node.attributeDirectives, element, contextStack, subscriptions);\n\t\t}\n\t}\n\tprivate initAttributeDirectives(\n\t\tattributeDirectives: DomAttributeDirectiveNode[],\n\t\telement: HTMLElement | StructuralDirective,\n\t\tcontextStack: Stack,\n\t\tsubscriptions: ScopeSubscription<Context>[]) {\n\t\tattributeDirectives?.forEach(directiveNode => {\n\t\t\tconst directiveRef = ClassRegistryProvider.getDirectiveRef<any>(directiveNode.name);\n\t\t\tif (!directiveRef\n\t\t\t\t|| !((directiveRef.modelClass.prototype instanceof AttributeDirective)\n\t\t\t\t\t|| (directiveRef.modelClass.prototype instanceof AttributeOnStructuralDirective))) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst directiveZone = this.view._zone.fork(directiveRef.zone);\n\t\t\tconst directive = directiveZone.run(() => new directiveRef.modelClass(element, directiveZone) as AttributeDirective | AttributeOnStructuralDirective);\n\t\t\tif (directiveRef.exportAs) {\n\t\t\t\tthis.exportAsScope.set(directiveRef.exportAs, directive);\n\t\t\t}\n\n\t\t\tconst stack = contextStack.copyStack();\n\t\t\tconst scope = ReactiveScope.readOnlyScopeForThis(directive);\n\t\t\tconst directiveScope = scope.getInnerScope('this')!;\n\t\t\tdirectiveScope.getContextProxy = () => directive;\n\t\t\tstack.pushScope(scope);\n\n\t\t\tconst directiveSubscriptions = this.initDirective(directive, directiveNode, stack);\n\t\t\tsubscriptions.push(...directiveSubscriptions);\n\t\t\tif (isOnInit(directive)) {\n\t\t\t\tdirectiveZone.run(directive.onInit, directive);\n\t\t\t}\n\t\t\tif (isOnDestroy(directive)) {\n\t\t\t\tsubscriptions.push(createDestroySubscription(() => directive.onDestroy()));\n\t\t\t}\n\t\t\tif (!(element instanceof HTMLElement)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst attributeName = directiveRef.selector.replace(/[A-Z]/g, m => '-' + m.toLowerCase());\n\t\t\tif (!element.hasAttribute(attributeName)) {\n\t\t\t\telement.setAttribute(attributeName, '');\n\t\t\t}\n\t\t\tif (directiveRef.viewBindings) {\n\t\t\t\tconst directiveStack = stack.copyStack();\n\t\t\t\tdirectiveStack.pushScope(directiveScope);\n\t\t\t\tthis.initHtmlElement(element, directiveRef.viewBindings, directiveStack, subscriptions);\n\t\t\t}\n\t\t});\n\t}\n\n\tinitAttribute(element: HTMLElement, node: DomElementNode, contextStack: Stack): ScopeSubscription<Context>[] {\n\t\tconst subscriptions: ScopeSubscription<Context>[] = [];\n\t\tif (node.attributes?.length) {\n\t\t\tnode.attributes.forEach(attr => {\n\t\t\t\t/**\n\t\t\t\t * <input id=\"23\" name=\"person-name\" data-id=\"1234567890\" data-user=\"carinaanand\" data-date-of-birth />\n\t\t\t\t */\n\t\t\t\tconst isAttr = hasAttr(element, attr.name);\n\t\t\t\tif (isAttr) {\n\t\t\t\t\tif (attr.value === false) {\n\t\t\t\t\t\telement.removeAttribute(attr.name);\n\t\t\t\t\t} else if (attr.value === true) {\n\t\t\t\t\t\telement.setAttribute(attr.name, '');\n\t\t\t\t\t} else {\n\t\t\t\t\t\telement.setAttribute(attr.name, attr.value as string);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tReflect.set(element, attr.name, attr.value);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (node.twoWayBinding?.length) {\n\t\t\tnode.twoWayBinding.forEach(attr => {\n\t\t\t\tconst sub = attr.expression.subscribe(contextStack);\n\t\t\t\tsubscriptions.push(...sub);\n\t\t\t\tattr.expression.get(contextStack);\n\t\t\t});\n\t\t}\n\t\tif (node.inputs?.length) {\n\t\t\tnode.inputs.forEach(attr => {\n\t\t\t\tconst sub = attr.expression.subscribe(contextStack, attr.pipelineNames);\n\t\t\t\tsubscriptions.push(...sub);\n\t\t\t\tattr.expression.get(contextStack);\n\t\t\t});\n\t\t}\n\t\tif (node.outputs?.length) {\n\t\t\tnode.outputs.forEach(event => {\n\t\t\t\tlet listener: Function;\n\t\t\t\t/**\n\t\t\t\t * <a (click)=\"onLinkClick($event)\"></a>\n\t\t\t\t * <a @click=\"onLinkClick($event)\"></a>\n\t\t\t\t * <input [(value)]=\"person.name\" />\n\t\t\t\t * <input (value)=\"person.name\" />\n\t\t\t\t * <!-- <input (value)=\"person.name = $event\" /> -->\n\t\t\t\t * \n\t\t\t\t * TODO: diff of event listener and back-way data binding\n\t\t\t\t */\n\t\t\t\tif (typeof event.value === 'string') {\n\t\t\t\t\tlistener = ($event: Event) => {\n\t\t\t\t\t\tconst stack = contextStack.copyStack();\n\t\t\t\t\t\tstack.pushBlockScopeFor({ $event });\n\t\t\t\t\t\tthis.view._zone.run(event.expression.get, event.expression, [stack]);\n\t\t\t\t\t};\n\t\t\t\t} else /* if (typeof event.sourceHandler === 'function')*/ {\n\t\t\t\t\t// let eventName: keyof HTMLElementEventMap = event.eventName;\n\t\t\t\t\tlistener = event.value;\n\t\t\t\t}\n\t\t\t\telement.addEventListener(event.name as any, listener as any);\n\t\t\t\tsubscriptions.push(createDestroySubscription(\n\t\t\t\t\t() => element.removeEventListener(event.name as any, listener as any),\n\t\t\t\t));\n\t\t\t});\n\t\t}\n\t\tif (node.templateAttrs?.length) {\n\t\t\tnode.templateAttrs.forEach(attr => {\n\t\t\t\tconst sub = attr.expression.subscribe(contextStack);\n\t\t\t\tsubscriptions.push(...sub);\n\t\t\t\tattr.expression.get(contextStack);\n\t\t\t});\n\t\t}\n\t\treturn subscriptions;\n\t}\n\tinitDirective(\n\t\tdirective: StructuralDirective | AttributeDirective | AttributeOnStructuralDirective,\n\t\tnode: DomStructuralDirectiveNode | DomAttributeDirectiveNode,\n\t\tcontextStack: Stack): ScopeSubscription<Context>[] {\n\t\tconst subscriptions: ScopeSubscription<Context>[] = [];\n\n\t\tif (node.attributes?.length) {\n\t\t\tnode.attributes.forEach(attr => Reflect.set(directive, attr.name, attr.value));\n\t\t}\n\t\tif (node.twoWayBinding?.length) {\n\t\t\tnode.twoWayBinding.forEach(attr => {\n\t\t\t\tconst sub = attr.expression.subscribe(contextStack);\n\t\t\t\tsubscriptions.push(...sub);\n\t\t\t\tattr.expression.get(contextStack);\n\t\t\t});\n\t\t}\n\t\tif (node.inputs?.length) {\n\t\t\tnode.inputs.forEach(attr => {\n\t\t\t\tconst sub = attr.expression.subscribe(contextStack, attr.pipelineNames);\n\t\t\t\tsubscriptions.push(...sub);\n\t\t\t\tattr.expression.get(contextStack);\n\t\t\t});\n\t\t}\n\t\tif (node.outputs?.length) {\n\t\t\tnode.outputs.forEach(event => {\n\t\t\t\tconst listener = ($event: Event) => {\n\t\t\t\t\tconst stack = contextStack.copyStack();\n\t\t\t\t\tstack.pushBlockScopeFor({ $event });\n\t\t\t\t\tthis.view._zone.run(event.expression.get, event.expression, [stack]);\n\t\t\t\t};\n\t\t\t\tconst subscription = ((directive as any)[event.name] as EventEmitter<T>).subscribe(listener);\n\t\t\t\tsubscriptions.push(createDestroySubscription(\n\t\t\t\t\t() => ((directive as any)[event.name] as EventEmitter<T>).remove(subscription),\n\t\t\t\t));\n\t\t\t});\n\t\t}\n\t\tif (node.templateAttrs?.length) {\n\t\t\tnode.templateAttrs.forEach(attr => {\n\t\t\t\tconst sub = attr.expression.subscribe(contextStack);\n\t\t\t\tsubscriptions.push(...sub);\n\t\t\t\tattr.expression.get(contextStack);\n\t\t\t});\n\t\t}\n\t\t// TODO: \n\t\t// check host binding\n\t\treturn subscriptions;\n\t}\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../../src/core/view/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAqC,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACrG,OAAO,EACN,WAAW,EAAE,0BAA0B,EACvC,cAAc,EAAE,eAAe,EAAW,iBAAiB,EAC3D,eAAe,EAAE,wBAAwB,EACzC,WAAW,EAA6B,kCAAkC,EAC1E,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,8BAA8B,EAAuB,MAAM,2BAA2B,CAAC;AACpH,OAAO,EAAe,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAA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CAAC,KAAK,CAAC,IAAI,CAAqB,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;gBAC7F,aAAa,CAAC,IAAI,CAAC,yBAAyB,CAC3C,GAAG,EAAE,CAAG,SAAiB,CAAC,KAAK,CAAC,IAAI,CAAqB,CAAC,MAAM,CAAC,YAAY,CAAC,CAC9E,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;QACJ,CAAC;QACD,IAAI,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC;YAChC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACjC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;gBACpD,aAAa,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;gBAC3B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;QACJ,CAAC;QACD,SAAS;QACT,qBAAqB;QACrB,OAAO,aAAa,CAAC;IACtB,CAAC;CAED","sourcesContent":["import { ReactiveScope, Context, ScopeSubscription, Stack, ReadOnlyScope } from '@ibyar/expressions';\nimport {\n\tCommentNode, DomStructuralDirectiveNode,\n\tDomElementNode, DomFragmentNode, DomNode, isLiveTextContent,\n\tisTagNameNative, isValidCustomElementName, LiveTextContent,\n\tTextContent, DomAttributeDirectiveNode, isFormAssociatedCustomElementByTag\n} from '@ibyar/elements';\nimport type { DomStructuralDirectiveNodeUpgrade } from '@ibyar/elements/node.js';\nimport { ComponentRef } from '../component/component.js';\nimport { HTMLComponent, isHTMLComponent } from '../component/custom-element.js';\nimport { documentStack } from '../context/stack.js';\nimport { ClassRegistryProvider } from '../providers/provider.js';\nimport { isOnDestroy, isOnInit } from '../component/lifecycle.js';\nimport { hasAttr } from '../utils/elements-util.js';\nimport { AttributeDirective, AttributeOnStructuralDirective, StructuralDirective } from '../directive/directive.js';\nimport { TemplateRef, TemplateRefImpl } from '../linker/template-ref.js';\nimport { ViewContainerRefImpl } from '../linker/view-container-ref.js';\nimport { createDestroySubscription } from '../context/subscription.js';\nimport { EventEmitter } from '../component/events.js';\n\ntype ViewContext = { [element: string]: HTMLElement };\n\nfunction getChangeEventName(tagName: string): 'input' | 'change' | undefined {\n\tswitch (true) {\n\t\tcase tagName === 'input':\n\t\t\treturn 'input';\n\t\tcase tagName === 'textarea':\n\t\tcase tagName === 'select':\n\t\tcase isFormAssociatedCustomElementByTag(tagName):\n\t\t\treturn 'change';\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\nexport class ComponentRender<T extends object> {\n\tprivate componentRef: ComponentRef<T>;\n\tprivate template: DomNode;\n\tprivate contextStack: Stack;\n\tprivate templateNameScope: ReactiveScope<{ [templateName: string]: TemplateRef }>;\n\tprivate exportAsScope: ReactiveScope<Record<string, any>>;\n\tprivate viewScope: ReactiveScope<ViewContext> = new ReactiveScope({});\n\n\tconstructor(public view: HTMLComponent<T>, private subscriptions: ScopeSubscription<Context>[]) {\n\t\tthis.componentRef = this.view.getComponentRef();\n\t\tthis.contextStack = documentStack.copyStack();\n\t\tthis.contextStack.pushScope<Context>(this.view._modelScope);\n\t\tthis.exportAsScope = this.contextStack.pushReactiveScope();\n\t\tthis.templateNameScope = this.contextStack.pushReactiveScope();\n\t}\n\tinitView(): void {\n\t\tif (!this.componentRef.template) {\n\t\t\treturn;\n\t\t}\n\t\tif (typeof this.componentRef.template === 'function') {\n\t\t\tthis.template = this.componentRef.template(this.view._model);\n\t\t} else {\n\t\t\tthis.template = this.componentRef.template;\n\t\t}\n\n\t\tlet rootRef: HTMLElement | ShadowRoot;\n\t\tif (this.componentRef.isShadowDom) {\n\t\t\trootRef = Reflect.get(this.view, '_shadowRoot') as ShadowRoot;\n\t\t\tReflect.deleteProperty(this.view, '_shadowRoot');\n\t\t} else {\n\t\t\trootRef = this.view;\n\t\t}\n\t\tthis.initTemplateRefMap(this.template);\n\t\tlet rootFragment: DocumentFragment;\n\t\tif (this.template instanceof DomFragmentNode) {\n\t\t\trootFragment = this.createDocumentFragment(this.template, this.contextStack, rootRef, this.subscriptions, this.view);\n\t\t} else {\n\t\t\trootFragment = document.createDocumentFragment();\n\t\t\tthis.appendChildToParent(rootFragment, this.template, this.contextStack, rootRef, this.subscriptions, this.view);\n\t\t}\n\t\trootRef.append(rootFragment);\n\t}\n\tisTemplateRefName(template: DomNode): template is DomElementNode {\n\t\tif (template instanceof DomElementNode) {\n\t\t\tif (template.tagName === 'template' && template.templateRefName) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\tinitTemplateRefMap(domNode: DomNode) {\n\t\tif (!(domNode instanceof DomElementNode || domNode instanceof DomFragmentNode) || !domNode.children) {\n\t\t\treturn;\n\t\t}\n\t\tfor (let index = 0; index < domNode.children.length; index++) {\n\t\t\tconst child = domNode.children[index];\n\t\t\tif (this.isTemplateRefName(child)) {\n\t\t\t\tthis.templateNameScope.set(child.templateRefName!.name, undefined);\n\t\t\t} else {\n\t\t\t\tthis.initTemplateRefMap(child);\n\t\t\t}\n\t\t}\n\t}\n\tinitViewBinding() {\n\t\tif (this.componentRef.viewBindings) {\n\t\t\tthis.initHtmlElement(this.view, this.componentRef.viewBindings, this.contextStack, this.subscriptions);\n\t\t}\n\t\tif (this.componentRef.windowBindings) {\n\t\t\tthis.subscriptions.push(...this.initAttribute(window as any, this.componentRef.windowBindings, this.contextStack));\n\t\t}\n\t}\n\tgetElementByName(name: string) {\n\t\treturn Reflect.get(this.view, name);\n\t}\n\tcreateStructuralDirective(directive: DomStructuralDirectiveNode, comment: Comment, directiveStack: Stack, subscriptions: ScopeSubscription<Context>[], parentNode: Node, host: HTMLComponent<any> | StructuralDirective): void {\n\t\tconst directiveRef = ClassRegistryProvider.getDirectiveRef<T>(directive.name);\n\t\tif (!directiveRef) {\n\t\t\t// didn't find directive or it is not define yet.\n\t\t\t// class registry should have 'when defined' callback\n\t\t\treturn;\n\t\t}\n\t\tconst stack = directiveStack.copyStack();\n\t\tconst templateRef = new TemplateRefImpl(\n\t\t\tthis,\n\t\t\tdirective.node,\n\t\t\tstack,\n\t\t\t(directive as DomStructuralDirectiveNodeUpgrade).templateExpressions ?? [],\n\t\t);\n\t\tlet successorTemplateRef: TemplateRef | undefined;\n\t\tif (directive.successor) {\n\t\t\tsuccessorTemplateRef = new TemplateRefImpl(\n\t\t\t\tthis,\n\t\t\t\tdirective.successor,\n\t\t\t\tstack,\n\t\t\t\t[]\n\t\t\t);\n\t\t}\n\n\t\tconst directiveZone = this.view._zone.fork(directiveRef.zone);\n\t\tconst viewContainerRef = new ViewContainerRefImpl(parentNode as Element, comment);\n\n\t\tdirectiveZone.onEmpty.subscribe(() => {\n\t\t\tconst length = viewContainerRef.length;\n\t\t\tfor (let index = 0; index < length; index++) {\n\t\t\t\tviewContainerRef.get(index)?.detectChanges();\n\t\t\t}\n\t\t});\n\n\t\tconst StructuralDirectiveClass = directiveRef.modelClass as typeof StructuralDirective;\n\t\tconst structural = directiveZone.run(() => new StructuralDirectiveClass(\n\t\t\ttemplateRef,\n\t\t\tviewContainerRef,\n\t\t\thost,\n\t\t\tdirectiveZone,\n\t\t\tsuccessorTemplateRef,\n\t\t));\n\n\t\ttemplateRef.host = structural;\n\t\tconst scope = ReactiveScope.readOnlyScopeForThis(structural);\n\t\tscope.getInnerScope('this')!.getContextProxy = () => structural;\n\t\tstack.pushScope(scope);\n\t\tif (directiveRef.exportAs) {\n\t\t\tstack.pushBlockScopeFor({ [directiveRef.exportAs]: structural });\n\t\t}\n\t\tsubscriptions.push(...this.initDirective(structural, directive, stack));\n\t\tif (isOnInit(structural)) {\n\t\t\tdirectiveZone.run(structural.onInit, structural);\n\t\t}\n\t\tif (directive.attributeDirectives?.length) {\n\t\t\tthis.initAttributeDirectives(directive.attributeDirectives, structural, stack, subscriptions);\n\t\t}\n\t\tif (isOnDestroy(structural)) {\n\t\t\tsubscriptions.push(createDestroySubscription(() => structural.onDestroy()));\n\t\t}\n\t}\n\tcreateComment(node: CommentNode): Comment {\n\t\treturn document.createComment(`${node.comment}`);\n\t}\n\tcreateText(node: TextContent): Text {\n\t\treturn new Text(node.value);\n\t}\n\tcreateLiveText(textNode: LiveTextContent, contextStack: Stack, subscriptions: ScopeSubscription<Context>[]): Text {\n\t\tconst liveText = new Text('');\n\t\tcontextStack = contextStack.copyStack();\n\t\tcontextStack.pushBlockScopeFor({ this: liveText });\n\t\tconst textSubscriptions = textNode.expression.subscribe(contextStack, textNode.pipelineNames);\n\t\tsubscriptions.push(...textSubscriptions);\n\t\ttextNode.expression.get(contextStack);\n\t\treturn liveText;\n\t}\n\tcreateDocumentFragment(node: DomFragmentNode, contextStack: Stack, parentNode: Node, subscriptions: ScopeSubscription<Context>[], host: HTMLComponent<any> | StructuralDirective): DocumentFragment {\n\t\tconst fragment = document.createDocumentFragment();\n\t\tnode.children?.forEach(child => this.appendChildToParent(fragment, child, contextStack, parentNode, subscriptions, host));\n\t\treturn fragment;\n\t}\n\tappendChildToParent(fragmentParent: HTMLElement | DocumentFragment, child: DomNode, contextStack: Stack, parentNode: Node, subscriptions: ScopeSubscription<Context>[], host: HTMLComponent<any> | StructuralDirective) {\n\t\tif (child instanceof DomElementNode) {\n\t\t\tif (this.isTemplateRefName(child)) {\n\t\t\t\tconst templateRefName = child.templateRefName!;\n\t\t\t\t// const oldRef = this.templateNameScope.get(templateRefName.name);\n\t\t\t\t// if (oldRef) {\n\t\t\t\t// \treturn;\n\t\t\t\t// }\n\t\t\t\t// TODO: extract template expression\n\t\t\t\tconst templateRef = new TemplateRefImpl(\n\t\t\t\t\tthis,\n\t\t\t\t\tnew DomFragmentNode(child.children),\n\t\t\t\t\tcontextStack.copyStack(),\n\t\t\t\t\t[]\n\t\t\t\t);\n\t\t\t\tthis.templateNameScope.set(templateRefName.name, templateRef);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfragmentParent.append(this.createElement(child, contextStack, subscriptions, host));\n\t\t} else if (child instanceof DomStructuralDirectiveNode) {\n\t\t\tconst commentText = child.name + (typeof child.value == 'string' ? (' = ' + child.value) : '');\n\t\t\tconst comment = document.createComment(`start-- ${commentText}`);\n\t\t\tfragmentParent.append(comment);\n\t\t\tconst lastComment = document.createComment(`-end--- ${commentText}`);\n\t\t\tcomment.after(lastComment);\n\t\t\tthis.createStructuralDirective(child, comment, contextStack, subscriptions, parentNode, host);\n\t\t} else if (isLiveTextContent(child)) {\n\t\t\tfragmentParent.append(this.createLiveText(child, contextStack, subscriptions));\n\t\t} else if (child instanceof TextContent) {\n\t\t\tfragmentParent.append(this.createText(child));\n\t\t} else if (child instanceof CommentNode) {\n\t\t\tfragmentParent.append(this.createComment(child));\n\t\t} else if (child instanceof DomFragmentNode) {\n\t\t\tfragmentParent.append(this.createDocumentFragment(child, contextStack, parentNode, subscriptions, host));\n\t\t}\n\t}\n\tcreateElementByTagName(node: { tagName: string, is?: string }): HTMLElement {\n\t\tlet element: HTMLElement;\n\t\tif (isValidCustomElementName(node.tagName)) {\n\t\t\tconst ViewClass = customElements.get(node.tagName) as ((new () => HTMLElement) | undefined);\n\t\t\tif (ViewClass) {\n\t\t\t\telement = new ViewClass();\n\t\t\t} else {\n\t\t\t\telement = document.createElement(node.tagName);\n\t\t\t\tif (element.constructor.name === 'HTMLElement') {\n\t\t\t\t\tcustomElements.whenDefined(node.tagName).then(() => customElements.upgrade(element));\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isTagNameNative(node.tagName)) {\n\t\t\t// native tags // and custom tags can be used her\n\t\t\telement = document.createElement(node.tagName, node.is ? { is: node.is } : undefined);\n\t\t} else {\n\t\t\t// html unknown element\n\t\t\telement = document.createElement(node.tagName);\n\t\t}\n\t\treturn element;\n\t}\n\tcreateElement(node: DomElementNode, contextStack: Stack, subscriptions: ScopeSubscription<Context>[], host: HTMLComponent<any> | StructuralDirective): HTMLElement {\n\t\tconst element = this.createElementByTagName(node);\n\t\tthis.initHtmlElement(element, node, contextStack, subscriptions, host);\n\t\treturn element;\n\t}\n\n\tprivate createReadOnlyWithReactiveInnerScope<T extends Context>(ctx: T, aliasName?: string, propertyKeys?: (keyof T)[]) {\n\t\tif (!aliasName) {\n\t\t\treturn ReactiveScope.readOnlyScopeForThis(ctx, propertyKeys);\n\t\t}\n\t\tconst reactiveScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst context: Record<string, any> = {\n\t\t\t'this': ctx,\n\t\t\t[aliasName]: ctx,\n\t\t};\n\t\tconst rootScope = ReadOnlyScope.for(context, ['this', aliasName]);\n\t\trootScope.setInnerScope('this', reactiveScope);\n\t\trootScope.setInnerScope(aliasName as 'this', reactiveScope);\n\t\treturn rootScope;\n\t}\n\n\t/**\n\t * use for init host bindings\n\t * @param element \n\t * @param node \n\t * @param contextStack \n\t * @param subscriptions \n\t */\n\tinitHtmlElement(element: HTMLElement, node: DomElementNode, contextStack: Stack, subscriptions: ScopeSubscription<Context>[]): void;\n\n\t/**\n\t * use to init a new create html element\n\t * @param element \n\t * @param node \n\t * @param contextStack \n\t * @param subscriptions \n\t * @param host is the direct html element `this.view` or a sub `structural directive` like `*if` or `*for`, etc...\n\t */\n\tinitHtmlElement(element: HTMLElement, node: DomElementNode, contextStack: Stack, subscriptions: ScopeSubscription<Context>[], host: HTMLComponent<any> | StructuralDirective): void;\n\tinitHtmlElement(element: HTMLElement, node: DomElementNode, contextStack: Stack, subscriptions: ScopeSubscription<Context>[], host?: HTMLComponent<any> | StructuralDirective): void {\n\t\tconst elementStack = contextStack.copyStack();\n\t\tconst elementScope = isHTMLComponent(element)\n\t\t\t? element._viewScope\n\t\t\t: this.createReadOnlyWithReactiveInnerScope(element, node.templateRefName?.name);\n\t\telementStack.pushScope<Context>(elementScope);\n\t\tconst attributesSubscriptions = this.initAttribute(element, node, elementStack);\n\t\tsubscriptions.push(...attributesSubscriptions);\n\t\tconst changeEventName = getChangeEventName(node.tagName);\n\t\tif (changeEventName) {\n\t\t\tconst inputScope = elementScope.getInnerScope<ReactiveScope<HTMLInputElement>>('this')!;\n\t\t\tconst listener = (event: HTMLElementEventMap['input' | 'change']) => inputScope.emit('value', (element as HTMLInputElement).value);\n\t\t\telement.addEventListener(changeEventName, listener);\n\t\t\tsubscriptions.push(createDestroySubscription(\n\t\t\t\t() => element.removeEventListener(changeEventName, listener),\n\t\t\t));\n\t\t}\n\n\t\tconst templateRefName = node.templateRefName;\n\t\tif (templateRefName) {\n\t\t\tReflect.set(this.view, templateRefName.name, element);\n\t\t\tthis.viewScope.set(templateRefName.name, element);\n\t\t\tconst view = this.componentRef.viewChild.find(child => child.selector === templateRefName.name);\n\t\t\tif (view) {\n\t\t\t\tReflect.set(this.view._model, view.modelName, element);\n\t\t\t}\n\t\t}\n\t\tif (node.children) {\n\t\t\tfor (const child of node.children) {\n\t\t\t\tthis.appendChildToParent(element, child, elementStack, element, subscriptions, host!);\n\t\t\t}\n\t\t}\n\t\tif (node.attributeDirectives?.length) {\n\t\t\tthis.initAttributeDirectives(node.attributeDirectives, element, contextStack, subscriptions);\n\t\t}\n\t}\n\tprivate initAttributeDirectives(\n\t\tattributeDirectives: DomAttributeDirectiveNode[],\n\t\telement: HTMLElement | StructuralDirective,\n\t\tcontextStack: Stack,\n\t\tsubscriptions: ScopeSubscription<Context>[]) {\n\t\tattributeDirectives?.forEach(directiveNode => {\n\t\t\tconst directiveRef = ClassRegistryProvider.getDirectiveRef<any>(directiveNode.name);\n\t\t\tif (!directiveRef\n\t\t\t\t|| !((directiveRef.modelClass.prototype instanceof AttributeDirective)\n\t\t\t\t\t|| (directiveRef.modelClass.prototype instanceof AttributeOnStructuralDirective))) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst directiveZone = this.view._zone.fork(directiveRef.zone);\n\t\t\tconst directive = directiveZone.run(() => new directiveRef.modelClass(element, directiveZone) as AttributeDirective | AttributeOnStructuralDirective);\n\t\t\tif (directiveRef.exportAs) {\n\t\t\t\tthis.exportAsScope.set(directiveRef.exportAs, directive);\n\t\t\t}\n\n\t\t\tconst stack = contextStack.copyStack();\n\t\t\tconst scope = ReactiveScope.readOnlyScopeForThis(directive);\n\t\t\tconst directiveScope = scope.getInnerScope('this')!;\n\t\t\tdirectiveScope.getContextProxy = () => directive;\n\t\t\tstack.pushScope(scope);\n\n\t\t\tconst directiveSubscriptions = this.initDirective(directive, directiveNode, stack);\n\t\t\tsubscriptions.push(...directiveSubscriptions);\n\t\t\tif (isOnInit(directive)) {\n\t\t\t\tdirectiveZone.run(directive.onInit, directive);\n\t\t\t}\n\t\t\tif (isOnDestroy(directive)) {\n\t\t\t\tsubscriptions.push(createDestroySubscription(() => directive.onDestroy()));\n\t\t\t}\n\t\t\tif (!(element instanceof HTMLElement)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst attributeName = directiveRef.selector.replace(/[A-Z]/g, m => '-' + m.toLowerCase());\n\t\t\tif (!element.hasAttribute(attributeName)) {\n\t\t\t\telement.setAttribute(attributeName, '');\n\t\t\t}\n\t\t\tif (directiveRef.viewBindings) {\n\t\t\t\tconst directiveStack = stack.copyStack();\n\t\t\t\tdirectiveStack.pushScope(directiveScope);\n\t\t\t\tthis.initHtmlElement(element, directiveRef.viewBindings, directiveStack, subscriptions);\n\t\t\t}\n\t\t});\n\t}\n\n\tinitAttribute(element: HTMLElement, node: DomElementNode, contextStack: Stack): ScopeSubscription<Context>[] {\n\t\tconst subscriptions: ScopeSubscription<Context>[] = [];\n\t\tif (node.attributes?.length) {\n\t\t\tnode.attributes.forEach(attr => {\n\t\t\t\t/**\n\t\t\t\t * <input id=\"23\" name=\"person-name\" data-id=\"1234567890\" data-user=\"carinaanand\" data-date-of-birth />\n\t\t\t\t */\n\t\t\t\tconst isAttr = hasAttr(element, attr.name);\n\t\t\t\tif (isAttr) {\n\t\t\t\t\tif (attr.value === false) {\n\t\t\t\t\t\telement.removeAttribute(attr.name);\n\t\t\t\t\t} else if (attr.value === true) {\n\t\t\t\t\t\telement.setAttribute(attr.name, '');\n\t\t\t\t\t} else {\n\t\t\t\t\t\telement.setAttribute(attr.name, attr.value as string);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tReflect.set(element, attr.name, attr.value);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (node.twoWayBinding?.length) {\n\t\t\tnode.twoWayBinding.forEach(attr => {\n\t\t\t\tconst sub = attr.expression.subscribe(contextStack);\n\t\t\t\tsubscriptions.push(...sub);\n\t\t\t\tattr.expression.get(contextStack);\n\t\t\t});\n\t\t}\n\t\tif (node.inputs?.length) {\n\t\t\tnode.inputs.forEach(attr => {\n\t\t\t\tconst sub = attr.expression.subscribe(contextStack, attr.pipelineNames);\n\t\t\t\tsubscriptions.push(...sub);\n\t\t\t\tattr.expression.get(contextStack);\n\t\t\t});\n\t\t}\n\t\tif (node.outputs?.length) {\n\t\t\tnode.outputs.forEach(event => {\n\t\t\t\tlet listener: Function;\n\t\t\t\t/**\n\t\t\t\t * <a (click)=\"onLinkClick($event)\"></a>\n\t\t\t\t * <a @click=\"onLinkClick($event)\"></a>\n\t\t\t\t * <input [(value)]=\"person.name\" />\n\t\t\t\t * <input (value)=\"person.name\" />\n\t\t\t\t * <!-- <input (value)=\"person.name = $event\" /> -->\n\t\t\t\t * \n\t\t\t\t * TODO: diff of event listener and back-way data binding\n\t\t\t\t */\n\t\t\t\tif (typeof event.value === 'string') {\n\t\t\t\t\tlistener = ($event: Event) => {\n\t\t\t\t\t\tconst stack = contextStack.copyStack();\n\t\t\t\t\t\tstack.pushBlockScopeFor({ $event });\n\t\t\t\t\t\tthis.view._zone.run(event.expression.get, event.expression, [stack]);\n\t\t\t\t\t};\n\t\t\t\t} else /* if (typeof event.sourceHandler === 'function')*/ {\n\t\t\t\t\t// let eventName: keyof HTMLElementEventMap = event.eventName;\n\t\t\t\t\tlistener = event.value;\n\t\t\t\t}\n\t\t\t\telement.addEventListener(event.name as any, listener as any);\n\t\t\t\tsubscriptions.push(createDestroySubscription(\n\t\t\t\t\t() => element.removeEventListener(event.name as any, listener as any),\n\t\t\t\t));\n\t\t\t});\n\t\t}\n\t\tif (node.templateAttrs?.length) {\n\t\t\tnode.templateAttrs.forEach(attr => {\n\t\t\t\tconst sub = attr.expression.subscribe(contextStack);\n\t\t\t\tsubscriptions.push(...sub);\n\t\t\t\tattr.expression.get(contextStack);\n\t\t\t});\n\t\t}\n\t\treturn subscriptions;\n\t}\n\tinitDirective(\n\t\tdirective: StructuralDirective | AttributeDirective | AttributeOnStructuralDirective,\n\t\tnode: DomStructuralDirectiveNode | DomAttributeDirectiveNode,\n\t\tcontextStack: Stack): ScopeSubscription<Context>[] {\n\t\tconst subscriptions: ScopeSubscription<Context>[] = [];\n\n\t\tif (node.attributes?.length) {\n\t\t\tnode.attributes.forEach(attr => Reflect.set(directive, attr.name, attr.value));\n\t\t}\n\t\tif (node.twoWayBinding?.length) {\n\t\t\tnode.twoWayBinding.forEach(attr => {\n\t\t\t\tconst sub = attr.expression.subscribe(contextStack);\n\t\t\t\tsubscriptions.push(...sub);\n\t\t\t\tattr.expression.get(contextStack);\n\t\t\t});\n\t\t}\n\t\tif (node.inputs?.length) {\n\t\t\tnode.inputs.forEach(attr => {\n\t\t\t\tconst sub = attr.expression.subscribe(contextStack, attr.pipelineNames);\n\t\t\t\tsubscriptions.push(...sub);\n\t\t\t\tattr.expression.get(contextStack);\n\t\t\t});\n\t\t}\n\t\tif (node.outputs?.length) {\n\t\t\tnode.outputs.forEach(event => {\n\t\t\t\tconst listener = ($event: Event) => {\n\t\t\t\t\tconst stack = contextStack.copyStack();\n\t\t\t\t\tstack.pushBlockScopeFor({ $event });\n\t\t\t\t\tthis.view._zone.run(event.expression.get, event.expression, [stack]);\n\t\t\t\t};\n\t\t\t\tconst subscription = ((directive as any)[event.name] as EventEmitter<T>).subscribe(listener);\n\t\t\t\tsubscriptions.push(createDestroySubscription(\n\t\t\t\t\t() => ((directive as any)[event.name] as EventEmitter<T>).remove(subscription),\n\t\t\t\t));\n\t\t\t});\n\t\t}\n\t\tif (node.templateAttrs?.length) {\n\t\t\tnode.templateAttrs.forEach(attr => {\n\t\t\t\tconst sub = attr.expression.subscribe(contextStack);\n\t\t\t\tsubscriptions.push(...sub);\n\t\t\t\tattr.expression.get(contextStack);\n\t\t\t});\n\t\t}\n\t\t// TODO: \n\t\t// check host binding\n\t\treturn subscriptions;\n\t}\n\n}\n"]}
|
package/zone/task.d.ts
CHANGED
|
@@ -1,62 +1 @@
|
|
|
1
|
-
/// <reference types="zone.js" />
|
|
2
|
-
import { ReactiveScopeControl, Stack } from '@ibyar/expressions';
|
|
3
|
-
export declare abstract class AbstractTask<T extends TaskType> implements Task {
|
|
4
|
-
type: T;
|
|
5
|
-
source: string;
|
|
6
|
-
callback: Function;
|
|
7
|
-
data?: TaskData | undefined;
|
|
8
|
-
scheduleFn?: ((task: Task) => void) | undefined;
|
|
9
|
-
cancelFn?: ((task: Task) => void) | undefined;
|
|
10
|
-
runCount: number;
|
|
11
|
-
_zone: Zone | null;
|
|
12
|
-
_state: TaskState;
|
|
13
|
-
constructor(type: T, source: string, callback: Function, data?: TaskData | undefined, scheduleFn?: ((task: Task) => void) | undefined, cancelFn?: ((task: Task) => void) | undefined);
|
|
14
|
-
get zone(): Zone;
|
|
15
|
-
get state(): TaskState;
|
|
16
|
-
cancelScheduleRequest(): void;
|
|
17
|
-
_transitionTo(toState: TaskState, fromState1: TaskState, fromState2?: TaskState): void;
|
|
18
|
-
toString(): string;
|
|
19
|
-
toJSON(): {
|
|
20
|
-
type: T;
|
|
21
|
-
state: TaskState;
|
|
22
|
-
source: string;
|
|
23
|
-
zone: string;
|
|
24
|
-
runCount: number;
|
|
25
|
-
};
|
|
26
|
-
abstract invoke(task: any, target: any, args: any): any;
|
|
27
|
-
}
|
|
28
|
-
export declare class ScopeTask<T extends TaskType> extends AbstractTask<T> {
|
|
29
|
-
scope: ReactiveScopeControl<any>;
|
|
30
|
-
static microTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void): ScopeTask<"microTask">;
|
|
31
|
-
static macroTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void): ScopeTask<"macroTask">;
|
|
32
|
-
static eventTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void): ScopeTask<"eventTask">;
|
|
33
|
-
constructor(scope: ReactiveScopeControl<any>, type: T, source: string, callback: Function, data?: TaskData, scheduleFn?: (task: Task) => void, cancelFn?: (task: Task) => void);
|
|
34
|
-
invoke(task: any, target: any, args: any): unknown;
|
|
35
|
-
toJSON(): {
|
|
36
|
-
type: T;
|
|
37
|
-
state: TaskState;
|
|
38
|
-
source: string;
|
|
39
|
-
zone: string;
|
|
40
|
-
runCount: number;
|
|
41
|
-
} & {
|
|
42
|
-
scope: ReactiveScopeControl<any>;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
export declare class StackTask<T extends TaskType> extends AbstractTask<T> {
|
|
46
|
-
stack: Stack;
|
|
47
|
-
static microTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void): StackTask<"microTask">;
|
|
48
|
-
static macroTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void): StackTask<"macroTask">;
|
|
49
|
-
static eventTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void): StackTask<"eventTask">;
|
|
50
|
-
constructor(stack: Stack, type: T, source: string, callback: Function, data: TaskData | undefined, scheduleFn: ((task: Task) => void) | undefined, cancelFn: ((task: Task) => void) | undefined);
|
|
51
|
-
invoke(task: any, target: any, args: any): unknown;
|
|
52
|
-
toJSON(): {
|
|
53
|
-
type: T;
|
|
54
|
-
state: TaskState;
|
|
55
|
-
source: string;
|
|
56
|
-
zone: string;
|
|
57
|
-
runCount: number;
|
|
58
|
-
} & {
|
|
59
|
-
stack: Stack;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
1
|
//# sourceMappingURL=task.d.ts.map
|
package/zone/task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../../src/core/zone/task.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../../src/core/zone/task.ts"],"names":[],"mappings":""}
|
package/zone/task.js
CHANGED
|
@@ -1,117 +1,128 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
// /// <reference types='zone.js' />
|
|
3
|
+
// import { ReactiveScopeControl, Context, Stack } from '@ibyar/expressions';
|
|
4
|
+
// const notScheduled: 'notScheduled' = 'notScheduled',
|
|
5
|
+
// scheduling: 'scheduling' = 'scheduling',
|
|
6
|
+
// scheduled: 'scheduled' = 'scheduled',
|
|
7
|
+
// running: 'running' = 'running',
|
|
8
|
+
// canceling: 'canceling' = 'canceling',
|
|
9
|
+
// unknown: 'unknown' = 'unknown';
|
|
10
|
+
// const microTask: 'microTask' = 'microTask',
|
|
11
|
+
// macroTask: 'macroTask' = 'macroTask',
|
|
12
|
+
// eventTask: 'eventTask' = 'eventTask';
|
|
13
|
+
// export abstract class AbstractTask<T extends TaskType> implements Task {
|
|
14
|
+
// public runCount: number = 0;
|
|
15
|
+
// _zone: Zone | null = null;
|
|
16
|
+
// _state: TaskState = 'notScheduled';
|
|
17
|
+
// constructor(
|
|
18
|
+
// public type: T,
|
|
19
|
+
// public source: string,
|
|
20
|
+
// public callback: Function,
|
|
21
|
+
// public data?: TaskData,
|
|
22
|
+
// public scheduleFn?: (task: Task) => void,
|
|
23
|
+
// public cancelFn?: (task: Task) => void) {
|
|
24
|
+
// if (!callback) {
|
|
25
|
+
// throw new Error('callback is not defined');
|
|
26
|
+
// }
|
|
27
|
+
// }
|
|
28
|
+
// get zone(): Zone {
|
|
29
|
+
// return this._zone!;
|
|
30
|
+
// }
|
|
31
|
+
// get state(): TaskState {
|
|
32
|
+
// return this._state;
|
|
33
|
+
// }
|
|
34
|
+
// public cancelScheduleRequest() {
|
|
35
|
+
// this._transitionTo(notScheduled, scheduling);
|
|
36
|
+
// }
|
|
37
|
+
// _transitionTo(toState: TaskState, fromState1: TaskState, fromState2?: TaskState) {
|
|
38
|
+
// if (this._state === fromState1 || this._state === fromState2) {
|
|
39
|
+
// this._state = toState;
|
|
40
|
+
// } else {
|
|
41
|
+
// throw new Error(`${this.type} '${this.source}': can not transition to '${toState}', expecting state '${fromState1}'${fromState2 ? ' or \'' + fromState2 + '\'' : ''}, was '${this._state}'.`);
|
|
42
|
+
// }
|
|
43
|
+
// }
|
|
44
|
+
// public toString() {
|
|
45
|
+
// if (this.data && typeof this.data.handleId !== 'undefined') {
|
|
46
|
+
// return this.data.handleId.toString();
|
|
47
|
+
// } else {
|
|
48
|
+
// return Object.prototype.toString.call(this);
|
|
49
|
+
// }
|
|
50
|
+
// }
|
|
51
|
+
// public toJSON() {
|
|
52
|
+
// return {
|
|
53
|
+
// type: this.type,
|
|
54
|
+
// state: this.state,
|
|
55
|
+
// source: this.source,
|
|
56
|
+
// zone: this.zone.name,
|
|
57
|
+
// runCount: this.runCount
|
|
58
|
+
// };
|
|
59
|
+
// }
|
|
60
|
+
// abstract invoke(task: any, target: any, args: any): any;
|
|
61
|
+
// }
|
|
62
|
+
// export class ScopeTask<T extends TaskType> extends AbstractTask<T> {
|
|
63
|
+
// static microTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void) {
|
|
64
|
+
// return new ScopeTask(scope, microTask, source, callback, data, customSchedule, undefined);
|
|
65
|
+
// }
|
|
66
|
+
// static macroTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {
|
|
67
|
+
// return new ScopeTask(scope, macroTask, source, callback, data, customSchedule, customCancel);
|
|
68
|
+
// }
|
|
69
|
+
// static eventTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {
|
|
70
|
+
// return new ScopeTask(scope, eventTask, source, callback, data, customSchedule, customCancel);
|
|
71
|
+
// }
|
|
72
|
+
// constructor(
|
|
73
|
+
// public scope: ReactiveScopeControl<any>,
|
|
74
|
+
// type: T,
|
|
75
|
+
// source: string,
|
|
76
|
+
// callback: Function,
|
|
77
|
+
// data?: TaskData,
|
|
78
|
+
// scheduleFn?: (task: Task) => void,
|
|
79
|
+
// cancelFn?: (task: Task) => void) {
|
|
80
|
+
// super(type, source, callback, data, scheduleFn, cancelFn);
|
|
81
|
+
// }
|
|
82
|
+
// invoke(task: any, target: any, args: any) {
|
|
83
|
+
// try {
|
|
84
|
+
// this.runCount++;
|
|
85
|
+
// this.scope.detach();
|
|
86
|
+
// return this.zone.runTask(task, target, args);
|
|
87
|
+
// } finally {
|
|
88
|
+
// this.scope.reattach();
|
|
89
|
+
// }
|
|
90
|
+
// }
|
|
91
|
+
// public toJSON() {
|
|
92
|
+
// return Object.assign(super.toJSON(), { scope: this.scope });
|
|
93
|
+
// }
|
|
94
|
+
// }
|
|
95
|
+
// export class StackTask<T extends TaskType> extends AbstractTask<T> {
|
|
96
|
+
// static microTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void) {
|
|
97
|
+
// return new StackTask(stack, microTask, source, callback, data, customSchedule, undefined);
|
|
98
|
+
// }
|
|
99
|
+
// static macroTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {
|
|
100
|
+
// return new StackTask(stack, macroTask, source, callback, data, customSchedule, customCancel);
|
|
101
|
+
// }
|
|
102
|
+
// static eventTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {
|
|
103
|
+
// return new StackTask(stack, eventTask, source, callback, data, customSchedule, customCancel);
|
|
104
|
+
// }
|
|
105
|
+
// constructor(
|
|
106
|
+
// public stack: Stack,
|
|
107
|
+
// type: T,
|
|
108
|
+
// source: string,
|
|
109
|
+
// callback: Function,
|
|
110
|
+
// data: TaskData | undefined,
|
|
111
|
+
// scheduleFn: ((task: Task) => void) | undefined,
|
|
112
|
+
// cancelFn: ((task: Task) => void) | undefined) {
|
|
113
|
+
// super(type, source, callback, data, scheduleFn, cancelFn);
|
|
114
|
+
// }
|
|
115
|
+
// invoke(task: any, target: any, args: any) {
|
|
116
|
+
// try {
|
|
117
|
+
// this.runCount++;
|
|
118
|
+
// this.stack.detach();
|
|
119
|
+
// return this.zone.runTask(task, target, args);
|
|
120
|
+
// } finally {
|
|
121
|
+
// this.stack.reattach();
|
|
122
|
+
// }
|
|
123
|
+
// }
|
|
124
|
+
// public toJSON() {
|
|
125
|
+
// return Object.assign(super.toJSON(), { stack: this.stack });
|
|
126
|
+
// }
|
|
127
|
+
// }
|
|
117
128
|
//# sourceMappingURL=task.js.map
|
package/zone/task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.js","sourceRoot":"","sources":["../../../src/core/zone/task.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"task.js","sourceRoot":"","sources":["../../../src/core/zone/task.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,6EAA6E;AAE7E,uDAAuD;AACvD,4CAA4C;AAC5C,yCAAyC;AACzC,mCAAmC;AACnC,yCAAyC;AACzC,mCAAmC;AAEnC,8CAA8C;AAC9C,yCAAyC;AACzC,yCAAyC;AAEzC,2EAA2E;AAE3E,gCAAgC;AAChC,8BAA8B;AAC9B,uCAAuC;AAEvC,gBAAgB;AAChB,oBA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oBAAoB;AACpB,wBAAwB;AACxB,gCAAgC;AAChC,oDAAoD;AACpD,oDAAoD;AACpD,+DAA+D;AAC/D,KAAK;AACL,+CAA+C;AAC/C,UAAU;AACV,sBAAsB;AACtB,0BAA0B;AAC1B,mDAAmD;AACnD,gBAAgB;AAChB,4BAA4B;AAC5B,MAAM;AACN,KAAK;AACL,qBAAqB;AACrB,iEAAiE;AACjE,KAAK;AACL,IAAI","sourcesContent":["// /// <reference types='zone.js' />\n// import { ReactiveScopeControl, Context, Stack } from '@ibyar/expressions';\n\n// const notScheduled: 'notScheduled' = 'notScheduled',\n// \tscheduling: 'scheduling' = 'scheduling',\n// \tscheduled: 'scheduled' = 'scheduled',\n// \trunning: 'running' = 'running',\n// \tcanceling: 'canceling' = 'canceling',\n// \tunknown: 'unknown' = 'unknown';\n\n// const microTask: 'microTask' = 'microTask',\n// \tmacroTask: 'macroTask' = 'macroTask',\n// \teventTask: 'eventTask' = 'eventTask';\n\n// export abstract class AbstractTask<T extends TaskType> implements Task {\n\n// \tpublic runCount: number = 0;\n// \t_zone: Zone | null = null;\n// \t_state: TaskState = 'notScheduled';\n\n// \tconstructor(\n// \t\tpublic type: T,\n// \t\tpublic source: string,\n// \t\tpublic callback: Function,\n// \t\tpublic data?: TaskData,\n// \t\tpublic scheduleFn?: (task: Task) => void,\n// \t\tpublic cancelFn?: (task: Task) => void) {\n// \t\tif (!callback) {\n// \t\t\tthrow new Error('callback is not defined');\n// \t\t}\n// \t}\n\n// \tget zone(): Zone {\n// \t\treturn this._zone!;\n// \t}\n\n// \tget state(): TaskState {\n// \t\treturn this._state;\n// \t}\n\n// \tpublic cancelScheduleRequest() {\n// \t\tthis._transitionTo(notScheduled, scheduling);\n// \t}\n\n// \t_transitionTo(toState: TaskState, fromState1: TaskState, fromState2?: TaskState) {\n// \t\tif (this._state === fromState1 || this._state === fromState2) {\n// \t\t\tthis._state = toState;\n// \t\t} else {\n// \t\t\tthrow new Error(`${this.type} '${this.source}': can not transition to '${toState}', expecting state '${fromState1}'${fromState2 ? ' or \\'' + fromState2 + '\\'' : ''}, was '${this._state}'.`);\n// \t\t}\n// \t}\n\n// \tpublic toString() {\n// \t\tif (this.data && typeof this.data.handleId !== 'undefined') {\n// \t\t\treturn this.data.handleId.toString();\n// \t\t} else {\n// \t\t\treturn Object.prototype.toString.call(this);\n// \t\t}\n// \t}\n// \tpublic toJSON() {\n// \t\treturn {\n// \t\t\ttype: this.type,\n// \t\t\tstate: this.state,\n// \t\t\tsource: this.source,\n// \t\t\tzone: this.zone.name,\n// \t\t\trunCount: this.runCount\n// \t\t};\n// \t}\n\n// \tabstract invoke(task: any, target: any, args: any): any;\n// }\n\n// export class ScopeTask<T extends TaskType> extends AbstractTask<T> {\n// \tstatic microTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void) {\n// \t\treturn new ScopeTask(scope, microTask, source, callback, data, customSchedule, undefined);\n// \t}\n// \tstatic macroTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {\n// \t\treturn new ScopeTask(scope, macroTask, source, callback, data, customSchedule, customCancel);\n// \t}\n// \tstatic eventTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {\n// \t\treturn new ScopeTask(scope, eventTask, source, callback, data, customSchedule, customCancel);\n// \t}\n\n// \tconstructor(\n// \t\tpublic scope: ReactiveScopeControl<any>,\n// \t\ttype: T,\n// \t\tsource: string,\n// \t\tcallback: Function,\n// \t\tdata?: TaskData,\n// \t\tscheduleFn?: (task: Task) => void,\n// \t\tcancelFn?: (task: Task) => void) {\n// \t\tsuper(type, source, callback, data, scheduleFn, cancelFn);\n// \t}\n// \tinvoke(task: any, target: any, args: any) {\n// \t\ttry {\n// \t\t\tthis.runCount++;\n// \t\t\tthis.scope.detach();\n// \t\t\treturn this.zone.runTask(task, target, args);\n// \t\t} finally {\n// \t\t\tthis.scope.reattach();\n// \t\t}\n// \t}\n// \tpublic toJSON() {\n// \t\treturn Object.assign(super.toJSON(), { scope: this.scope });\n// \t}\n// }\n\n// export class StackTask<T extends TaskType> extends AbstractTask<T> {\n\n// \tstatic microTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void) {\n// \t\treturn new StackTask(stack, microTask, source, callback, data, customSchedule, undefined);\n// \t}\n// \tstatic macroTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {\n// \t\treturn new StackTask(stack, macroTask, source, callback, data, customSchedule, customCancel);\n// \t}\n// \tstatic eventTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {\n// \t\treturn new StackTask(stack, eventTask, source, callback, data, customSchedule, customCancel);\n// \t}\n\n// \tconstructor(\n// \t\tpublic stack: Stack,\n// \t\ttype: T,\n// \t\tsource: string,\n// \t\tcallback: Function,\n// \t\tdata: TaskData | undefined,\n// \t\tscheduleFn: ((task: Task) => void) | undefined,\n// \t\tcancelFn: ((task: Task) => void) | undefined) {\n// \t\tsuper(type, source, callback, data, scheduleFn, cancelFn);\n// \t}\n// \tinvoke(task: any, target: any, args: any) {\n// \t\ttry {\n// \t\t\tthis.runCount++;\n// \t\t\tthis.stack.detach();\n// \t\t\treturn this.zone.runTask(task, target, args);\n// \t\t} finally {\n// \t\t\tthis.stack.reattach();\n// \t\t}\n// \t}\n// \tpublic toJSON() {\n// \t\treturn Object.assign(super.toJSON(), { stack: this.stack });\n// \t}\n// }\n"]}
|