@decaf-ts/ui-decorators 0.17.8 → 0.17.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/ui-decorators.cjs +1 -1
  2. package/lib/cjs/graph/decorators.cjs +7 -2
  3. package/lib/cjs/graph/decorators.cjs.map +1 -1
  4. package/lib/cjs/graph/index.cjs +3 -0
  5. package/lib/cjs/graph/index.cjs.map +1 -1
  6. package/lib/cjs/graph/overrides/Metadata.cjs +23 -0
  7. package/lib/cjs/graph/overrides/Metadata.cjs.map +1 -0
  8. package/lib/cjs/graph/overrides/index.cjs +1 -0
  9. package/lib/cjs/graph/overrides/index.cjs.map +1 -1
  10. package/lib/cjs/graph/overrides/overrides.cjs +8 -0
  11. package/lib/cjs/graph/overrides/overrides.cjs.map +1 -1
  12. package/lib/cjs/graph/registry.cjs +67 -0
  13. package/lib/cjs/graph/registry.cjs.map +1 -0
  14. package/lib/cjs/index.cjs +3 -3
  15. package/lib/esm/graph/decorators.js +7 -2
  16. package/lib/esm/graph/decorators.js.map +1 -1
  17. package/lib/esm/graph/index.js +3 -0
  18. package/lib/esm/graph/index.js.map +1 -1
  19. package/lib/esm/graph/overrides/Metadata.js +20 -0
  20. package/lib/esm/graph/overrides/Metadata.js.map +1 -0
  21. package/lib/esm/graph/overrides/index.js +1 -0
  22. package/lib/esm/graph/overrides/index.js.map +1 -1
  23. package/lib/esm/graph/overrides/overrides.js +8 -0
  24. package/lib/esm/graph/overrides/overrides.js.map +1 -1
  25. package/lib/esm/graph/registry.js +59 -0
  26. package/lib/esm/graph/registry.js.map +1 -0
  27. package/lib/esm/index.js +3 -3
  28. package/lib/types/graph/index.d.cts +3 -0
  29. package/lib/types/graph/index.d.mts +3 -0
  30. package/lib/types/graph/overrides/Metadata.d.cts +43 -0
  31. package/lib/types/graph/overrides/Metadata.d.mts +43 -0
  32. package/lib/types/graph/overrides/index.d.cts +1 -0
  33. package/lib/types/graph/overrides/index.d.mts +1 -0
  34. package/lib/types/graph/registry.d.cts +40 -0
  35. package/lib/types/graph/registry.d.mts +40 -0
  36. package/lib/types/index.d.cts +3 -3
  37. package/lib/types/index.d.mts +3 -3
  38. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- var e,t;e=this,t=function(e,t,r,a,o){"use strict";var s;e.UIMediaBreakPoints=void 0,(s=e.UIMediaBreakPoints||(e.UIMediaBreakPoints={})).SMALL="small",s.MEDIUM="medium",s.LARGE="large",s.XLARGE="xlarge";const n={REFLECT:"ui",UIMODEL:"uimodel",RENDERED_BY:"rendered-by",ELEMENT:"uielement",PROP:"uiprop",CHILD:"uichild",NAME:"name",NAME_PREFIX:"input-",VALIDATION_MESSAGE:"validationMessage",UILISTMODEL:"uilistmodel",UILISTPROP:"uilistprop",UILAYOUT:"uilayout",UILAYOUTPROP:"uilayoutprop",HANDLERS:"handlers",TYPE:"type",SUB_TYPE:"subType",HIDDEN:"hidden",FORMAT:"format",ORDER:"order",PAGE:"page",EVENTS:"events",FIRST:"first",LAST:"last",READ_ONLY:"readonly",SEQUENCE:"sequence",REQUIRED:t.ValidationKeys.REQUIRED,MIN:t.ValidationKeys.MIN,MIN_LENGTH:t.ValidationKeys.MIN_LENGTH,MAX:t.ValidationKeys.MAX,MAX_LENGTH:t.ValidationKeys.MAX_LENGTH,PATTERN:t.ValidationKeys.PATTERN,URL:t.ValidationKeys.URL,STEP:t.ValidationKeys.STEP,DATE:t.ValidationKeys.DATE,EMAIL:t.ValidationKeys.EMAIL,PASSWORD:t.ValidationKeys.PASSWORD,EQUALS:t.ValidationKeys.EQUALS,DIFF:t.ValidationKeys.DIFF,LESS_THAN:t.ValidationKeys.LESS_THAN,LESS_THAN_OR_EQUAL:t.ValidationKeys.LESS_THAN_OR_EQUAL,GREATER_THAN:t.ValidationKeys.GREATER_THAN,GREATER_THAN_OR_EQUAL:t.ValidationKeys.GREATER_THAN_OR_EQUAL},i={[n.EMAIL]:t.EmailValidator,[n.URL]:t.URLValidator,[n.DATE]:t.DateValidator,[n.PASSWORD]:t.PasswordValidator},d={[n.REQUIRED]:t.RequiredValidator,[n.MIN]:t.MinValidator,[n.MAX]:t.MaxValidator,[n.STEP]:t.StepValidator,[n.MIN_LENGTH]:t.MinLengthValidator,[n.MAX_LENGTH]:t.MaxLengthValidator,[n.PATTERN]:t.PatternValidator,[n.EQUALS]:t.EqualsValidator,[n.DIFF]:t.DiffValidator,[n.LESS_THAN]:t.LessThanValidator,[n.LESS_THAN_OR_EQUAL]:t.LessThanOrEqualValidator,[n.GREATER_THAN]:t.GreaterThanValidator,[n.GREATER_THAN_OR_EQUAL]:t.GreaterThanOrEqualValidator},l="yyyy-MM-dd",c={BUTTON:"button",CHECKBOX:"checkbox",COLOR:"color",DATE:n.DATE,DATETIME_LOCAL:"datetime-local",EMAIL:n.EMAIL,FILE:"file",HIDDEN:"hidden",IMAGE:"image",MONTH:"month",NUMBER:"number",PASSWORD:n.PASSWORD,RADIO:"radio",RANGE:"range",RESET:"reset",SEARCH:"search",SUBMIT:"submit",TEL:"tel",TEXT:"text",TEXTAREA:"textarea",SELECT:"select",TIME:"time",URL:n.URL,WEEK:"week"},p=[c.CHECKBOX,c.RADIO],E={cancel:"cancel",confirm:"confirm",submit:"submit",clear:"clear",back:"back",[r.OperationKeys.CREATE]:r.OperationKeys.CREATE,[r.OperationKeys.READ]:r.OperationKeys.READ,[r.OperationKeys.UPDATE]:r.OperationKeys.UPDATE,[r.OperationKeys.DELETE]:r.OperationKeys.DELETE};class u extends r.InternalError{constructor(e){super(e,u.name)}}const f=e=>"function"==typeof e&&/^class\s/.test(e+"");function h(e,t){return a.Metadata.key(n.REFLECT,a.DecorationKeys.PROPERTIES,e,t)}function y(e,r,...a){if(e===n.DATE){if(!r)return"";const e=a.shift()||l;return t.formatDate(new Date(r),e)}return r}function M(e){if("number"==typeof e&&!isNaN(e))return e;const t=Number(e);return isNaN(t)?void 0:t}function T(e){if(!e)return e;const t={"&":"&amp;","<":"&lt;",">":"&gt;"};return(""+e).replace(/[&<>]/g,e=>t[e]||e)}function m(e){let r=Date.now();try{t.Model.pk(e.constructor)&&(r=e[t.Model.pk(e.constructor)])}catch(e){}return`${e.constructor.name}-${r}`}class R{static{this.cache={}}constructor(e){this.flavour=e,this.initialized=!1,R.register(this)}translate(e,r=!0){if(r)switch(e){case t.ReservedModels.STRING.name.toLowerCase():return c.TEXT;case t.ReservedModels.NUMBER.name.toLowerCase():case t.ReservedModels.BIGINT.name.toLowerCase():return c.NUMBER;case t.ReservedModels.BOOLEAN.name.toLowerCase():return c.CHECKBOX;case t.ReservedModels.DATE.name.toLowerCase():return c.DATE}else switch(e){case c.SELECT:case c.TEXT:case c.EMAIL:case c.COLOR:case c.PASSWORD:case c.TEL:case c.URL:case c.SEARCH:case c.HIDDEN:case c.TEXTAREA:case c.RADIO:return t.ReservedModels.STRING.name.toLowerCase();case c.NUMBER:return t.ReservedModels.NUMBER.name.toLowerCase();case c.CHECKBOX:return t.ReservedModels.BOOLEAN.name.toLowerCase();case c.DATE:case c.DATETIME_LOCAL:case c.TIME:return t.ReservedModels.DATE.name.toLowerCase()}return e}getClassDecoratorsMetadata(e){return[t.Model.uiModelOf(e.constructor),t.Model.uiListModelOf(e.constructor),t.Model.uiHandlersFor(e.constructor),t.Model.uiLayoutOf(e.constructor)].filter(Boolean)}sortChildrenByOrder(e=[]){return e.sort((r,a)=>{const o=r.props?.order??0,s=a.props?.order??0,i=r=>r===n.FIRST?0:typeof r===t.Primitives.NUMBER?1:r===n.LAST?e.length+e.indexOf(a):1,d=i(o),l=i(s);return d!==l?d-l:1===d&&typeof o===t.Primitives.NUMBER&&typeof s===t.Primitives.NUMBER?o-s:0})}isCustomValidator(e){return!Object.values(t.ValidationKeys).includes(e)&&!Object.values(n).includes(e)}isValidatableByType(e){return Object.keys(i).includes(e)}isValidatableByAttribute(e){return Object.keys(d).includes(e)}toAttributeValue(e,t){if(!Object.keys(d).includes(e))throw Error(`Invalid attribute key "${e}". Expected one of: ${Object.keys(d).join(", ")}.`);return e===n.REQUIRED||t[e]}toFieldDefinition(e,o={},s=!0){const{inheritProps:i,...d}=o;o=d;const p=this.getClassDecoratorsMetadata(e);if(!p.length)throw new u(`No ui definitions set for model ${e.constructor.name}. Did you use @uimodel?`);const E=Object.assign({},...p,i||{}),{tag:f,props:h,item:M,handlers:T}=E,R=t.Model.uiPropertiesOf(e.constructor);let O,L=M?.props||{},g={};const A=(e,t)=>e?[e,t].join("."):t;if(R){const s=a.Metadata.get(e.constructor,t.ValidationKeys.REFLECT)||{};for(const i of R){const d=t.Model.uiDecorationOf(e.constructor,i);let p;try{p=t.Model.uiTypeOf(e.constructor,i)}catch(e){if(!(e instanceof r.NotFoundError))throw e}if(t.Model.uiIsHidden(e.constructor,i)&&!t.Model.uiElementOf(e.constructor,i))throw new u(`@uielement no found in "${i}". It is required to use hiddenOn decorator.`);Object.entries(d).map(([e,t])=>({key:e,props:t})).sort(e=>[n.ELEMENT,n.CHILD].includes(e.key)?-1:1).forEach(r=>{if(!r)throw new u("No decorator found");switch(r.key){case n.PROP:L[i]=r.props;break;case n.CHILD:{const a=r.props?.props?.name||i;try{if(!t.Model.isModel(t.Model.build({},a))&&!t.Model.isPropertyModel(e,a))throw new u(`Child "${a}" must be a model.`)}catch(e){throw new u(`Child "${a}" must be a model.`)}let s;const n=e[i];if("object"!=typeof n||null===n||Array.isArray(n)){const e=r.props.props?.name;s=new(t.Model.get(e))}O=O||[];const d=Object.assign({},o||{},{model:s},{inheritProps:r.props,childOf:A(o?.childOf,i)}),l=this.toFieldDefinition(n||s,d,!1),{inheritProps:c}=d;c&&(l.props=Object.assign({},l.props,c.props||{})),O.push(l);break}case n.UILISTPROP:{g=g||{};const e=r.props;e.name&&(g[e.name]="object"==typeof e?.props&&n.SEQUENCE in e.props?e.props:i);const t=Object.assign({},E.props?.item||{},M?.props||{},e?.props||{},o);L={tag:M?.tag||t.render||"",props:Object.assign({},L?.props,{mapper:g},t)};break}case n.EVENTS:case n.HIDDEN:case n.PAGE:case n.ORDER:case n.UILAYOUTPROP:case n.ELEMENT:{O=O||[];const t=r.props,d=Object.assign({},L?.props,t.props||{},t?.props?.name?{path:A(o?.childOf,t.props.name),childOf:void 0}:{},o,{name:t.props?.name||i});if(r.key===n.ELEMENT){const r={tag:t.tag||L?.tag||f||"",props:d},o=s[i];if(o)for(const e of Object.entries(o).map(([e,t])=>({key:e,props:t})))this.isValidatableByAttribute(e.key)?r.props[this.translate(e.key)]=this.toAttributeValue(e.key,e.props):this.isValidatableByType(e.key)?(e.key===c.DATE&&(r.props[n.FORMAT]=e.props.format||l),r.props[n.TYPE]=e.key):this.isCustomValidator(e.key)&&(d[n.SUB_TYPE]=e.key,e.props?.message&&(d[n.VALIDATION_MESSAGE]=e.props.message));if(!r.props[n.TYPE]){const t=a.Metadata.type(e.constructor,i).name;r.props[n.TYPE]=this.translate(t.toLowerCase(),!0)}r.props.value=y(r.props[n.TYPE],e[i],r.props[n.FORMAT]),O.push(r)}else{const e=O.find(e=>e.props?.name===i||[n.UILAYOUTPROP,n.PAGE,n.EVENTS].includes(r.key)&&(e.props?.childOf===i||e.props?.childOf?.endsWith("."+i)));if(e)if(r.key!==n.UILAYOUTPROP)e.props=Object.assign({},e.props,{[r.key]:t});else{const{row:t,col:a,props:o}=r.props;e.props=Object.assign({},o||{},e.props,t,a)}}break}default:throw new u("Invalid key: "+r.key)}})}}o=Object.assign({},h,o,{handlers:T||{}});const D=o?.operation;O=this.sortChildrenByOrder(O).filter(e=>{const t=e?.props?.hidden||[];return t?.length&&t.includes(D)?void 0:e});const I={tag:f,item:L,props:o,children:O?.length?O:void 0};return s&&(I.rendererId=m(e)),I}static register(e){if(e.flavour in this.cache)throw new r.InternalError(`Rendering engine under ${e.flavour} already exists`);this.cache[e.flavour]=e,this.current=e}static getOrBoot(e){if(e instanceof R)return e;const t=new e;return t.initialize(),t}static get(e){if(!e)return this.getOrBoot(this.current);if(!(e in this.cache))throw new r.InternalError(`Rendering engine under ${e} does not exist`);return this.getOrBoot(this.cache[e])}static render(e,...a){if(!t.Model.get(e.constructor.name)&&!t.Model.fromObject(e))throw new r.InternalError("No model registered found");const o=t.Model.renderedBy(e.constructor);return R.get(o).render(e,...a)}}function O(...e){return(t,r)=>a.propMetadata(h(r,n.HIDDEN),e)(t,r)}function L(e,t){return(r,o)=>{a.propMetadata(h(o,n.EVENTS),{..."object"==typeof e?e:{[e]:t}})(r,o)}}class g extends t.Validator{getMessage(e,...t){return g.translateService?g.translateService.translate(e,...t):super.getMessage(e,...t)}}class A extends o.LoggedClass{constructor(){super(),this.enableDarkMode=!0,this.isDarkMode=!1,this.item={tag:""},this.props={},this.route="",this.borders=!1,this.OperationKeys=r.OperationKeys,this.initialized=!1,this.events={},this.handlers={}}get repository(){return this._repository}set repository(e){this._repository=e}async render(...e){this.log.for(this.render).info(`render for ${this.componentName} with ${JSON.stringify(e)}`)}async refresh(...e){this.log.for(this.refresh).info("Refresh called with args: "+e)}async initialize(...e){this.initialized=!0}async translate(...e){this.log.for(this.translate).info(`translate for ${this.componentName} with ${JSON.stringify(e)}`)}async preview(...e){this.log.for(this.preview).debug("Preview called with args: "+e)}async submit(...e){this.log.for(this.submit).info(`submit for ${this.componentName} with ${JSON.stringify(e)}`)}parseHandlers(e,t){const r={};return Object.entries(e).forEach(([e,a])=>{if(f(a)){const o=new a,s=e in o?o[e]:o.handle;r[e]=s,t.handlers[e]=s}else r[e]=a,t.handlers[e]=a}),r}parseEvents(e,t){const r={};return Object.entries(e).forEach(([e,a])=>{const o=e,s=a();if(f(s)){const a=(new s)[e];a&&(r[o]=a,t.events[o]=a)}else r[o]=a,t.events[o]=a}),r}}class D extends o.LoggedClass{translate(e,t){this.log.for(this.translate).info(`Must translate ${e} with params ${JSON.stringify(t||{})}`)}instant(e,t){this.log.for(this.instant).info(`Must translate ${e} with params ${JSON.stringify(t||{})}`)}}function I(e,t){return(r,o)=>{const s={tag:e||r.name,props:t};return a.metadata(a.Metadata.key(n.REFLECT,n.UIMODEL),s)(r)}}function N(e){return a.apply(a.metadata(a.Metadata.key(n.REFLECT,n.RENDERED_BY),e))}function C(e,t){return(r,o)=>{const s={item:{tag:e||r.name,props:t}};return a.metadata(a.Metadata.key(n.REFLECT,n.UILISTMODEL),s)(r)}}function b(e){return t=>{const r={handlers:e};return a.metadata(a.Metadata.key(n.REFLECT,n.HANDLERS),r)(t)}}function S(t,r=1,o=1,s={}){const i=Object.assign({..."boolean"==typeof r?{flexMode:r,cols:1}:{flexMode:!1,cols:r},rows:o,...Object.assign({breakpoint:e.UIMediaBreakPoints.LARGE},s)});return(e,r)=>(a.metadata(a.Metadata.key(n.REFLECT,n.UILAYOUT),i)(e),I(t,i)(e,r))}function P(e,t=1,r=!1,a={}){let o=[];return"object"==typeof t&&(o=t,t=o.length),I(e,{pages:t,paginated:r,pageTitles:o,props:a})}t.Model.prototype.render=function(...e){return R.render(this,...e)},t.Model.renderedBy=(e=>a.Metadata.get(e,a.Metadata.key(n.REFLECT,n.RENDERED_BY))).bind(t.Model),t.Model.uiPropertiesOf=(e=>{const t=a.Metadata.get(e,a.Metadata.key(n.REFLECT,a.DecorationKeys.PROPERTIES));if(t)return Object.keys(t)}).bind(t.Model),t.Model.uiDecorationOf=(e,t,r)=>{const o=a.Metadata.get(e,a.Metadata.key(n.REFLECT,a.DecorationKeys.PROPERTIES,t));if(o)return r?o[r]:o},t.Model.uiModelOf=e=>a.Metadata.get(e,a.Metadata.key(n.REFLECT,n.UIMODEL)),t.Model.uiElementOf=(e,t)=>a.Metadata.get(e,h(t,n.ELEMENT)),t.Model.uiListModelOf=e=>a.Metadata.get(e,a.Metadata.key(n.REFLECT,n.UILISTMODEL)),t.Model.uiHandlersFor=e=>a.Metadata.get(e,a.Metadata.key(n.REFLECT,n.HANDLERS)),t.Model.uiLayoutOf=e=>a.Metadata.get(e,a.Metadata.key(n.REFLECT,n.UILAYOUT)),t.Model.uiIsHidden=(e,t)=>!!a.Metadata.get(e,h(t,n.HIDDEN)),t.Model.uiIsHiddenOn=(e,t,r)=>{const o=a.Metadata.get(e,h(t,n.HIDDEN));return!!o&&(r?o.includes(r):o)},t.Model.uiTypeOf=(e,t)=>{const o=a.Metadata.get(e,a.Metadata.key(n.REFLECT,a.DecorationKeys.PROPERTIES,t));if(!o)throw new r.NotFoundError(`No metadata found for property '${t}' on model '${e.name}'`);const s=Object.keys(o).filter(e=>[n.PROP,n.ELEMENT,n.CHILD].includes(e));if(0===s.length)throw new r.NotFoundError(`No UI type metadata found for property '${t}' on model '${e.name}'`);if(s.length>1)throw new u("Only one type of decoration is allowed. Please choose between @uiprop, @uichild or @uielement");return o[s[0]]},t.Model.uiListItems=(e=>{const t=a.Metadata.get(e,a.Metadata.key(n.REFLECT,a.DecorationKeys.PROPERTIES));if(t)return Object.keys(t)}).bind(t.Model);const U=t.ModelBuilder.prototype;U.decorateClass||(U.decorateClass=function(e){return this._classDecorators||(this._classDecorators=[]),this._classDecorators.push(e),this}),U.uimodel=function(e,t){return this.decorateClass(I(e,t))},U.renderedBy=function(e){return this.decorateClass(N(e))},U.uilistmodel=function(e,t){return this.decorateClass(C(e,t))},U.uihandlers=function(e){return this.decorateClass(b(e))},U.uilayout=function(e,t,r,a){return this.decorateClass(S(e,t,r,a))},U.uisteppedmodel=function(e,t,r,a){return this.decorateClass(P(e,t,r,a))};const k="##VERSION##",w="##PACKAGE##";a.Metadata.registerLibrary(w,k),e.ActionRoles=E,e.COMMIT="8cc02d8",e.ComponentEventNames={Render:"render",BackButtonClickEvent:"backButtonNavigationEndEvent",Refresh:"RefreshEvent",Click:"ClickEvent",Change:"ChangeEvent",Submit:"SubmitEvent",ValidationError:"validationErrorEvent",ThemeChange:"themeChangeEvent",FormGroupLoaded:"formGroupLoadedEvent"},e.DecafComponent=A,e.DecafEventHandler=class extends A{constructor(){super()}handle(...e){this.log.for(this.handle).info(`component ${this.componentName} handling ${JSON.stringify(e)}`)}handleClick(...e){this.log.for(this.handleClick).info(`component ${this.componentName} handling click ${JSON.stringify(e)}`)}handleAction(...e){this.log.for(this.handleAction).info(`component ${this.componentName} handling action ${JSON.stringify(e)}`)}},e.DecafTranslateService=D,e.ElementPositions={left:"left",center:"center",right:"right",top:"top",bottom:"bottom"},e.ElementSizes={xsmall:"xsmall",small:"small",medium:"medium",default:"default",large:"large",xLarge:"xlarge","2xLarge":"2xlarge",auto:"auto",expand:"expand",block:"block",half:"half",full:"full"},e.FULL_VERSION="0.17.8-8cc02d8",e.HTML5CheckTypes=p,e.HTML5DateFormat=l,e.HTML5InputTypes=c,e.LayoutGridGaps={small:"small",medium:"medium",large:"large",collapse:"collapse",none:""},e.PACKAGE_NAME=w,e.RenderingEngine=R,e.RenderingError=u,e.TransactionHooks={BeforeRead:"beforeRead",AfterRead:"afterRead",BeforeCreate:"beforeCreate",AfterCreate:"afterCreate",BeforeUpdate:"beforeUpdate",AfterUpdate:"afterUpdate",BeforeDelete:"beforeDelete",AfterDelete:"afterDelete"},e.UIKeys=n,e.UIValidator=g,e.VERSION=k,e.ValidatableByAttribute=d,e.ValidatableByType=i,e.WindowColorSchemes={light:"light",dark:"dark",undefined:"undefined"},e.escapeHtml=T,e.formatByType=y,e.generateUIModelID=m,e.getUIAttributeKey=h,e.hidden=()=>O(r.OperationKeys.CREATE,r.OperationKeys.READ,r.OperationKeys.UPDATE,r.OperationKeys.DELETE),e.hideOn=O,e.isClassConstructor=f,e.parseToNumber=M,e.parseValueByType=function e(a,o,s){let n;switch(a){case Array.name:n=(Array.isArray(o)?o.map(r=>e(t.ReservedModels.STRING.name.toLowerCase(),r,s)):[o]).join(",");break;case c.NUMBER:n=M(o);break;case c.DATE:{const e=s.format;o&&(""+o).trim().length&&(n=typeof o===t.ReservedModels.NUMBER.name.toLowerCase()?new Date(o):o?e?t.parseDate(e,o):new Date(o):void 0);break}default:n=typeof o===t.ReservedModels.OBJECT.name.toLowerCase()?Array.isArray(o)?o.join(","):JSON.stringify(o):typeof o===t.ReservedModels.BOOLEAN.name.toLowerCase()?o:typeof o===t.ReservedModels.STRING.name.toLowerCase()?T(o):n}if(void 0===n)throw new r.InternalError(`Failed to parse value of type ${a} from ${typeof o} - ${o}`);return n},e.renderedBy=N,e.revertHtml=e=>{const t={"&amp;":"&","&lt;":"<","&gt;":">"};return(""+e).replace(/&lt;|&gt;|&amp;/g,e=>t[e]||e)},e.uichild=(e,t,r={},o=!1,s=!1)=>(i,d)=>{const l={tag:t,serialize:s,props:Object.assign({},r||{},{name:e||d},o?{customTypes:[Array.name],multiple:!0}:{multiple:r?.multiple||!1})};a.propMetadata(h(d,n.CHILD),l)(i,d)},e.uielement=(e,t,r=!1)=>(o,s)=>{"object"==typeof e&&(t=e,e="");const i={tag:e,serialize:r,props:Object.assign({},t||{},{name:s})};return a.propMetadata(h(s,n.ELEMENT),i)(o,s)},e.uihandlers=b,e.uilayout=S,e.uilayoutprop=(e=1,t=1)=>(r,o)=>{const s={name:o,props:Object.assign({},{row:t,col:e})};a.propMetadata(h(o,n.UILAYOUTPROP),s)(r,o)},e.uilistmodel=C,e.uilistprop=(e=void 0,t)=>(r,o)=>{const s={name:e||o,props:t||{}};a.propMetadata(h(o,n.UILISTPROP),s)(r,o)},e.uimodel=I,e.uion=L,e.uionclick=e=>L("handleClick",e),e.uionrender=e=>L("render",e),e.uiorder=(e=n.FIRST)=>(t,r)=>a.propMetadata(h(r,n.ORDER),e)(t,r),e.uipageprop=(e=1)=>(t,r)=>a.propMetadata(h(r,n.PAGE),e)(t,r),e.uiprop=(e=void 0,t=!1)=>(r,o)=>{const s={name:e||o,stringify:t};a.propMetadata(h(o,n.PROP),s)(r,o)},e.uisteppedmodel=P,e.uitablecol=(e=n.LAST,t)=>(r,o)=>{const s={name:o,props:{sequence:e,...t?{valueParserFn:t}:{}}};a.propMetadata(h(o,n.UILISTPROP),s)(r,o)}},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@decaf-ts/decorator-validation"),require("@decaf-ts/db-decorators"),require("@decaf-ts/decoration"),require("@decaf-ts/logging")):"function"==typeof define&&define.amd?define(["exports","@decaf-ts/decorator-validation","@decaf-ts/db-decorators","@decaf-ts/decoration","@decaf-ts/logging"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["ui-decorators"]={},e.decafTsDecoratorValidation,e.decafTsDbDecorators,e.decafTsDecoration,e.decafTsLogging);
1
+ var e,t;e=this,t=function(e,t,r,a,o){"use strict";var s;e.UIMediaBreakPoints=void 0,(s=e.UIMediaBreakPoints||(e.UIMediaBreakPoints={})).SMALL="small",s.MEDIUM="medium",s.LARGE="large",s.XLARGE="xlarge";const n={REFLECT:"ui",UIMODEL:"uimodel",RENDERED_BY:"rendered-by",ELEMENT:"uielement",PROP:"uiprop",CHILD:"uichild",NAME:"name",NAME_PREFIX:"input-",VALIDATION_MESSAGE:"validationMessage",UILISTMODEL:"uilistmodel",UILISTPROP:"uilistprop",UILAYOUT:"uilayout",UILAYOUTPROP:"uilayoutprop",HANDLERS:"handlers",TYPE:"type",SUB_TYPE:"subType",HIDDEN:"hidden",FORMAT:"format",ORDER:"order",PAGE:"page",EVENTS:"events",FIRST:"first",LAST:"last",READ_ONLY:"readonly",SEQUENCE:"sequence",REQUIRED:t.ValidationKeys.REQUIRED,MIN:t.ValidationKeys.MIN,MIN_LENGTH:t.ValidationKeys.MIN_LENGTH,MAX:t.ValidationKeys.MAX,MAX_LENGTH:t.ValidationKeys.MAX_LENGTH,PATTERN:t.ValidationKeys.PATTERN,URL:t.ValidationKeys.URL,STEP:t.ValidationKeys.STEP,DATE:t.ValidationKeys.DATE,EMAIL:t.ValidationKeys.EMAIL,PASSWORD:t.ValidationKeys.PASSWORD,EQUALS:t.ValidationKeys.EQUALS,DIFF:t.ValidationKeys.DIFF,LESS_THAN:t.ValidationKeys.LESS_THAN,LESS_THAN_OR_EQUAL:t.ValidationKeys.LESS_THAN_OR_EQUAL,GREATER_THAN:t.ValidationKeys.GREATER_THAN,GREATER_THAN_OR_EQUAL:t.ValidationKeys.GREATER_THAN_OR_EQUAL},i={[n.EMAIL]:t.EmailValidator,[n.URL]:t.URLValidator,[n.DATE]:t.DateValidator,[n.PASSWORD]:t.PasswordValidator},d={[n.REQUIRED]:t.RequiredValidator,[n.MIN]:t.MinValidator,[n.MAX]:t.MaxValidator,[n.STEP]:t.StepValidator,[n.MIN_LENGTH]:t.MinLengthValidator,[n.MAX_LENGTH]:t.MaxLengthValidator,[n.PATTERN]:t.PatternValidator,[n.EQUALS]:t.EqualsValidator,[n.DIFF]:t.DiffValidator,[n.LESS_THAN]:t.LessThanValidator,[n.LESS_THAN_OR_EQUAL]:t.LessThanOrEqualValidator,[n.GREATER_THAN]:t.GreaterThanValidator,[n.GREATER_THAN_OR_EQUAL]:t.GreaterThanOrEqualValidator},l="yyyy-MM-dd",c={BUTTON:"button",CHECKBOX:"checkbox",COLOR:"color",DATE:n.DATE,DATETIME_LOCAL:"datetime-local",EMAIL:n.EMAIL,FILE:"file",HIDDEN:"hidden",IMAGE:"image",MONTH:"month",NUMBER:"number",PASSWORD:n.PASSWORD,RADIO:"radio",RANGE:"range",RESET:"reset",SEARCH:"search",SUBMIT:"submit",TEL:"tel",TEXT:"text",TEXTAREA:"textarea",SELECT:"select",TIME:"time",URL:n.URL,WEEK:"week"},p=[c.CHECKBOX,c.RADIO],E={cancel:"cancel",confirm:"confirm",submit:"submit",clear:"clear",back:"back",[r.OperationKeys.CREATE]:r.OperationKeys.CREATE,[r.OperationKeys.READ]:r.OperationKeys.READ,[r.OperationKeys.UPDATE]:r.OperationKeys.UPDATE,[r.OperationKeys.DELETE]:r.OperationKeys.DELETE};class u extends r.InternalError{constructor(e){super(e,u.name)}}const f=e=>"function"==typeof e&&/^class\s/.test(e+"");function h(e,t){return a.Metadata.key(n.REFLECT,a.DecorationKeys.PROPERTIES,e,t)}function y(e,r,...a){if(e===n.DATE){if(!r)return"";const e=a.shift()||l;return t.formatDate(new Date(r),e)}return r}function M(e){if("number"==typeof e&&!isNaN(e))return e;const t=Number(e);return isNaN(t)?void 0:t}function T(e){if(!e)return e;const t={"&":"&amp;","<":"&lt;",">":"&gt;"};return(""+e).replace(/[&<>]/g,e=>t[e]||e)}function m(e){let r=Date.now();try{t.Model.pk(e.constructor)&&(r=e[t.Model.pk(e.constructor)])}catch(e){}return`${e.constructor.name}-${r}`}class R{static{this.cache={}}constructor(e){this.flavour=e,this.initialized=!1,R.register(this)}translate(e,r=!0){if(r)switch(e){case t.ReservedModels.STRING.name.toLowerCase():return c.TEXT;case t.ReservedModels.NUMBER.name.toLowerCase():case t.ReservedModels.BIGINT.name.toLowerCase():return c.NUMBER;case t.ReservedModels.BOOLEAN.name.toLowerCase():return c.CHECKBOX;case t.ReservedModels.DATE.name.toLowerCase():return c.DATE}else switch(e){case c.SELECT:case c.TEXT:case c.EMAIL:case c.COLOR:case c.PASSWORD:case c.TEL:case c.URL:case c.SEARCH:case c.HIDDEN:case c.TEXTAREA:case c.RADIO:return t.ReservedModels.STRING.name.toLowerCase();case c.NUMBER:return t.ReservedModels.NUMBER.name.toLowerCase();case c.CHECKBOX:return t.ReservedModels.BOOLEAN.name.toLowerCase();case c.DATE:case c.DATETIME_LOCAL:case c.TIME:return t.ReservedModels.DATE.name.toLowerCase()}return e}getClassDecoratorsMetadata(e){return[t.Model.uiModelOf(e.constructor),t.Model.uiListModelOf(e.constructor),t.Model.uiHandlersFor(e.constructor),t.Model.uiLayoutOf(e.constructor)].filter(Boolean)}sortChildrenByOrder(e=[]){return e.sort((r,a)=>{const o=r.props?.order??0,s=a.props?.order??0,i=r=>r===n.FIRST?0:typeof r===t.Primitives.NUMBER?1:r===n.LAST?e.length+e.indexOf(a):1,d=i(o),l=i(s);return d!==l?d-l:1===d&&typeof o===t.Primitives.NUMBER&&typeof s===t.Primitives.NUMBER?o-s:0})}isCustomValidator(e){return!Object.values(t.ValidationKeys).includes(e)&&!Object.values(n).includes(e)}isValidatableByType(e){return Object.keys(i).includes(e)}isValidatableByAttribute(e){return Object.keys(d).includes(e)}toAttributeValue(e,t){if(!Object.keys(d).includes(e))throw Error(`Invalid attribute key "${e}". Expected one of: ${Object.keys(d).join(", ")}.`);return e===n.REQUIRED||t[e]}toFieldDefinition(e,o={},s=!0){const{inheritProps:i,...d}=o;o=d;const p=this.getClassDecoratorsMetadata(e);if(!p.length)throw new u(`No ui definitions set for model ${e.constructor.name}. Did you use @uimodel?`);const E=Object.assign({},...p,i||{}),{tag:f,props:h,item:M,handlers:T}=E,R=t.Model.uiPropertiesOf(e.constructor);let O,L=M?.props||{},g={};const A=(e,t)=>e?[e,t].join("."):t;if(R){const s=a.Metadata.get(e.constructor,t.ValidationKeys.REFLECT)||{};for(const i of R){const d=t.Model.uiDecorationOf(e.constructor,i);let p;try{p=t.Model.uiTypeOf(e.constructor,i)}catch(e){if(!(e instanceof r.NotFoundError))throw e}if(t.Model.uiIsHidden(e.constructor,i)&&!t.Model.uiElementOf(e.constructor,i))throw new u(`@uielement no found in "${i}". It is required to use hiddenOn decorator.`);Object.entries(d).map(([e,t])=>({key:e,props:t})).sort(e=>[n.ELEMENT,n.CHILD].includes(e.key)?-1:1).forEach(r=>{if(!r)throw new u("No decorator found");switch(r.key){case n.PROP:L[i]=r.props;break;case n.CHILD:{const a=r.props?.props?.name||i;try{if(!t.Model.isModel(t.Model.build({},a))&&!t.Model.isPropertyModel(e,a))throw new u(`Child "${a}" must be a model.`)}catch(e){throw new u(`Child "${a}" must be a model.`)}let s;const n=e[i];if("object"!=typeof n||null===n||Array.isArray(n)){const e=r.props.props?.name;s=new(t.Model.get(e))}O=O||[];const d=Object.assign({},o||{},{model:s},{inheritProps:r.props,childOf:A(o?.childOf,i)}),l=this.toFieldDefinition(n||s,d,!1),{inheritProps:c}=d;c&&(l.props=Object.assign({},l.props,c.props||{})),O.push(l);break}case n.UILISTPROP:{g=g||{};const e=r.props;e.name&&(g[e.name]="object"==typeof e?.props&&n.SEQUENCE in e.props?e.props:i);const t=Object.assign({},E.props?.item||{},M?.props||{},e?.props||{},o);L={tag:M?.tag||t.render||"",props:Object.assign({},L?.props,{mapper:g},t)};break}case n.EVENTS:case n.HIDDEN:case n.PAGE:case n.ORDER:case n.UILAYOUTPROP:case n.ELEMENT:{O=O||[];const t=r.props,d=Object.assign({},L?.props,t.props||{},t?.props?.name?{path:A(o?.childOf,t.props.name),childOf:void 0}:{},o,{name:t.props?.name||i});if(r.key===n.ELEMENT){const r={tag:t.tag||L?.tag||f||"",props:d},o=s[i];if(o)for(const e of Object.entries(o).map(([e,t])=>({key:e,props:t})))this.isValidatableByAttribute(e.key)?r.props[this.translate(e.key)]=this.toAttributeValue(e.key,e.props):this.isValidatableByType(e.key)?(e.key===c.DATE&&(r.props[n.FORMAT]=e.props.format||l),r.props[n.TYPE]=e.key):this.isCustomValidator(e.key)&&(d[n.SUB_TYPE]=e.key,e.props?.message&&(d[n.VALIDATION_MESSAGE]=e.props.message));if(!r.props[n.TYPE]){const t=a.Metadata.type(e.constructor,i).name;r.props[n.TYPE]=this.translate(t.toLowerCase(),!0)}r.props.value=y(r.props[n.TYPE],e[i],r.props[n.FORMAT]),O.push(r)}else{const e=O.find(e=>e.props?.name===i||[n.UILAYOUTPROP,n.PAGE,n.EVENTS].includes(r.key)&&(e.props?.childOf===i||e.props?.childOf?.endsWith("."+i)));if(e)if(r.key!==n.UILAYOUTPROP)e.props=Object.assign({},e.props,{[r.key]:t});else{const{row:t,col:a,props:o}=r.props;e.props=Object.assign({},o||{},e.props,t,a)}}break}default:throw new u("Invalid key: "+r.key)}})}}o=Object.assign({},h,o,{handlers:T||{}});const D=o?.operation;O=this.sortChildrenByOrder(O).filter(e=>{const t=e?.props?.hidden||[];return t?.length&&t.includes(D)?void 0:e});const I={tag:f,item:L,props:o,children:O?.length?O:void 0};return s&&(I.rendererId=m(e)),I}static register(e){if(e.flavour in this.cache)throw new r.InternalError(`Rendering engine under ${e.flavour} already exists`);this.cache[e.flavour]=e,this.current=e}static getOrBoot(e){if(e instanceof R)return e;const t=new e;return t.initialize(),t}static get(e){if(!e)return this.getOrBoot(this.current);if(!(e in this.cache))throw new r.InternalError(`Rendering engine under ${e} does not exist`);return this.getOrBoot(this.cache[e])}static render(e,...a){if(!t.Model.get(e.constructor.name)&&!t.Model.fromObject(e))throw new r.InternalError("No model registered found");const o=t.Model.renderedBy(e.constructor);return R.get(o).render(e,...a)}}function O(...e){return(t,r)=>a.propMetadata(h(r,n.HIDDEN),e)(t,r)}function L(e,t){return(r,o)=>{a.propMetadata(h(o,n.EVENTS),{..."object"==typeof e?e:{[e]:t}})(r,o)}}class g extends t.Validator{getMessage(e,...t){return g.translateService?g.translateService.translate(e,...t):super.getMessage(e,...t)}}class A extends o.LoggedClass{constructor(){super(),this.enableDarkMode=!0,this.isDarkMode=!1,this.item={tag:""},this.props={},this.route="",this.borders=!1,this.OperationKeys=r.OperationKeys,this.initialized=!1,this.events={},this.handlers={}}get repository(){return this._repository}set repository(e){this._repository=e}async render(...e){this.log.for(this.render).info(`render for ${this.componentName} with ${JSON.stringify(e)}`)}async refresh(...e){this.log.for(this.refresh).info("Refresh called with args: "+e)}async initialize(...e){this.initialized=!0}async translate(...e){this.log.for(this.translate).info(`translate for ${this.componentName} with ${JSON.stringify(e)}`)}async preview(...e){this.log.for(this.preview).debug("Preview called with args: "+e)}async submit(...e){this.log.for(this.submit).info(`submit for ${this.componentName} with ${JSON.stringify(e)}`)}parseHandlers(e,t){const r={};return Object.entries(e).forEach(([e,a])=>{if(f(a)){const o=new a,s=e in o?o[e]:o.handle;r[e]=s,t.handlers[e]=s}else r[e]=a,t.handlers[e]=a}),r}parseEvents(e,t){const r={};return Object.entries(e).forEach(([e,a])=>{const o=e,s=a();if(f(s)){const a=(new s)[e];a&&(r[o]=a,t.events[o]=a)}else r[o]=a,t.events[o]=a}),r}}class D extends o.LoggedClass{translate(e,t){this.log.for(this.translate).info(`Must translate ${e} with params ${JSON.stringify(t||{})}`)}instant(e,t){this.log.for(this.instant).info(`Must translate ${e} with params ${JSON.stringify(t||{})}`)}}function I(e,t){return(r,o)=>{const s={tag:e||r.name,props:t};return a.metadata(a.Metadata.key(n.REFLECT,n.UIMODEL),s)(r)}}function N(e){return a.apply(a.metadata(a.Metadata.key(n.REFLECT,n.RENDERED_BY),e))}function C(e,t){return(r,o)=>{const s={item:{tag:e||r.name,props:t}};return a.metadata(a.Metadata.key(n.REFLECT,n.UILISTMODEL),s)(r)}}function b(e){return t=>{const r={handlers:e};return a.metadata(a.Metadata.key(n.REFLECT,n.HANDLERS),r)(t)}}function S(t,r=1,o=1,s={}){const i=Object.assign({..."boolean"==typeof r?{flexMode:r,cols:1}:{flexMode:!1,cols:r},rows:o,...Object.assign({breakpoint:e.UIMediaBreakPoints.LARGE},s)});return(e,r)=>(a.metadata(a.Metadata.key(n.REFLECT,n.UILAYOUT),i)(e),I(t,i)(e,r))}function P(e,t=1,r=!1,a={}){let o=[];return"object"==typeof t&&(o=t,t=o.length),I(e,{pages:t,paginated:r,pageTitles:o,props:a})}t.Model.prototype.render=function(...e){return R.render(this,...e)},t.Model.renderedBy=(e=>a.Metadata.get(e,a.Metadata.key(n.REFLECT,n.RENDERED_BY))).bind(t.Model),t.Model.uiPropertiesOf=(e=>{const t=a.Metadata.get(e,a.Metadata.key(n.REFLECT,a.DecorationKeys.PROPERTIES));if(t)return Object.keys(t)}).bind(t.Model),t.Model.uiDecorationOf=(e,t,r)=>{const o=a.Metadata.get(e,a.Metadata.key(n.REFLECT,a.DecorationKeys.PROPERTIES,t));if(o)return r?o[r]:o},t.Model.uiModelOf=e=>a.Metadata.get(e,a.Metadata.key(n.REFLECT,n.UIMODEL)),t.Model.uiElementOf=(e,t)=>a.Metadata.get(e,h(t,n.ELEMENT)),t.Model.uiListModelOf=e=>a.Metadata.get(e,a.Metadata.key(n.REFLECT,n.UILISTMODEL)),t.Model.uiHandlersFor=e=>a.Metadata.get(e,a.Metadata.key(n.REFLECT,n.HANDLERS)),t.Model.uiLayoutOf=e=>a.Metadata.get(e,a.Metadata.key(n.REFLECT,n.UILAYOUT)),t.Model.uiIsHidden=(e,t)=>!!a.Metadata.get(e,h(t,n.HIDDEN)),t.Model.uiIsHiddenOn=(e,t,r)=>{const o=a.Metadata.get(e,h(t,n.HIDDEN));return!!o&&(r?o.includes(r):o)},t.Model.uiTypeOf=(e,t)=>{const o=a.Metadata.get(e,a.Metadata.key(n.REFLECT,a.DecorationKeys.PROPERTIES,t));if(!o)throw new r.NotFoundError(`No metadata found for property '${t}' on model '${e.name}'`);const s=Object.keys(o).filter(e=>[n.PROP,n.ELEMENT,n.CHILD].includes(e));if(0===s.length)throw new r.NotFoundError(`No UI type metadata found for property '${t}' on model '${e.name}'`);if(s.length>1)throw new u("Only one type of decoration is allowed. Please choose between @uiprop, @uichild or @uielement");return o[s[0]]},t.Model.uiListItems=(e=>{const t=a.Metadata.get(e,a.Metadata.key(n.REFLECT,a.DecorationKeys.PROPERTIES));if(t)return Object.keys(t)}).bind(t.Model);const U=t.ModelBuilder.prototype;U.decorateClass||(U.decorateClass=function(e){return this._classDecorators||(this._classDecorators=[]),this._classDecorators.push(e),this}),U.uimodel=function(e,t){return this.decorateClass(I(e,t))},U.renderedBy=function(e){return this.decorateClass(N(e))},U.uilistmodel=function(e,t){return this.decorateClass(C(e,t))},U.uihandlers=function(e){return this.decorateClass(b(e))},U.uilayout=function(e,t,r,a){return this.decorateClass(S(e,t,r,a))},U.uisteppedmodel=function(e,t,r,a){return this.decorateClass(P(e,t,r,a))};const k="##VERSION##",w="##PACKAGE##";a.Metadata.registerLibrary(w,k),e.ActionRoles=E,e.COMMIT="091374c",e.ComponentEventNames={Render:"render",BackButtonClickEvent:"backButtonNavigationEndEvent",Refresh:"RefreshEvent",Click:"ClickEvent",Change:"ChangeEvent",Submit:"SubmitEvent",ValidationError:"validationErrorEvent",ThemeChange:"themeChangeEvent",FormGroupLoaded:"formGroupLoadedEvent"},e.DecafComponent=A,e.DecafEventHandler=class extends A{constructor(){super()}handle(...e){this.log.for(this.handle).info(`component ${this.componentName} handling ${JSON.stringify(e)}`)}handleClick(...e){this.log.for(this.handleClick).info(`component ${this.componentName} handling click ${JSON.stringify(e)}`)}handleAction(...e){this.log.for(this.handleAction).info(`component ${this.componentName} handling action ${JSON.stringify(e)}`)}},e.DecafTranslateService=D,e.ElementPositions={left:"left",center:"center",right:"right",top:"top",bottom:"bottom"},e.ElementSizes={xsmall:"xsmall",small:"small",medium:"medium",default:"default",large:"large",xLarge:"xlarge","2xLarge":"2xlarge",auto:"auto",expand:"expand",block:"block",half:"half",full:"full"},e.FULL_VERSION="0.17.9-091374c",e.HTML5CheckTypes=p,e.HTML5DateFormat=l,e.HTML5InputTypes=c,e.LayoutGridGaps={small:"small",medium:"medium",large:"large",collapse:"collapse",none:""},e.PACKAGE_NAME=w,e.RenderingEngine=R,e.RenderingError=u,e.TransactionHooks={BeforeRead:"beforeRead",AfterRead:"afterRead",BeforeCreate:"beforeCreate",AfterCreate:"afterCreate",BeforeUpdate:"beforeUpdate",AfterUpdate:"afterUpdate",BeforeDelete:"beforeDelete",AfterDelete:"afterDelete"},e.UIKeys=n,e.UIValidator=g,e.VERSION=k,e.ValidatableByAttribute=d,e.ValidatableByType=i,e.WindowColorSchemes={light:"light",dark:"dark",undefined:"undefined"},e.escapeHtml=T,e.formatByType=y,e.generateUIModelID=m,e.getUIAttributeKey=h,e.hidden=()=>O(r.OperationKeys.CREATE,r.OperationKeys.READ,r.OperationKeys.UPDATE,r.OperationKeys.DELETE),e.hideOn=O,e.isClassConstructor=f,e.parseToNumber=M,e.parseValueByType=function e(a,o,s){let n;switch(a){case Array.name:n=(Array.isArray(o)?o.map(r=>e(t.ReservedModels.STRING.name.toLowerCase(),r,s)):[o]).join(",");break;case c.NUMBER:n=M(o);break;case c.DATE:{const e=s.format;o&&(""+o).trim().length&&(n=typeof o===t.ReservedModels.NUMBER.name.toLowerCase()?new Date(o):o?e?t.parseDate(e,o):new Date(o):void 0);break}default:n=typeof o===t.ReservedModels.OBJECT.name.toLowerCase()?Array.isArray(o)?o.join(","):JSON.stringify(o):typeof o===t.ReservedModels.BOOLEAN.name.toLowerCase()?o:typeof o===t.ReservedModels.STRING.name.toLowerCase()?T(o):n}if(void 0===n)throw new r.InternalError(`Failed to parse value of type ${a} from ${typeof o} - ${o}`);return n},e.renderedBy=N,e.revertHtml=e=>{const t={"&amp;":"&","&lt;":"<","&gt;":">"};return(""+e).replace(/&lt;|&gt;|&amp;/g,e=>t[e]||e)},e.uichild=(e,t,r={},o=!1,s=!1)=>(i,d)=>{const l={tag:t,serialize:s,props:Object.assign({},r||{},{name:e||d},o?{customTypes:[Array.name],multiple:!0}:{multiple:r?.multiple||!1})};a.propMetadata(h(d,n.CHILD),l)(i,d)},e.uielement=(e,t,r=!1)=>(o,s)=>{"object"==typeof e&&(t=e,e="");const i={tag:e,serialize:r,props:Object.assign({},t||{},{name:s})};return a.propMetadata(h(s,n.ELEMENT),i)(o,s)},e.uihandlers=b,e.uilayout=S,e.uilayoutprop=(e=1,t=1)=>(r,o)=>{const s={name:o,props:Object.assign({},{row:t,col:e})};a.propMetadata(h(o,n.UILAYOUTPROP),s)(r,o)},e.uilistmodel=C,e.uilistprop=(e=void 0,t)=>(r,o)=>{const s={name:e||o,props:t||{}};a.propMetadata(h(o,n.UILISTPROP),s)(r,o)},e.uimodel=I,e.uion=L,e.uionclick=e=>L("handleClick",e),e.uionrender=e=>L("render",e),e.uiorder=(e=n.FIRST)=>(t,r)=>a.propMetadata(h(r,n.ORDER),e)(t,r),e.uipageprop=(e=1)=>(t,r)=>a.propMetadata(h(r,n.PAGE),e)(t,r),e.uiprop=(e=void 0,t=!1)=>(r,o)=>{const s={name:e||o,stringify:t};a.propMetadata(h(o,n.PROP),s)(r,o)},e.uisteppedmodel=P,e.uitablecol=(e=n.LAST,t)=>(r,o)=>{const s={name:o,props:{sequence:e,...t?{valueParserFn:t}:{}}};a.propMetadata(h(o,n.UILISTPROP),s)(r,o)}},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@decaf-ts/decorator-validation"),require("@decaf-ts/db-decorators"),require("@decaf-ts/decoration"),require("@decaf-ts/logging")):"function"==typeof define&&define.amd?define(["exports","@decaf-ts/decorator-validation","@decaf-ts/db-decorators","@decaf-ts/decoration","@decaf-ts/logging"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["ui-decorators"]={},e.decafTsDecoratorValidation,e.decafTsDbDecorators,e.decafTsDecoration,e.decafTsLogging);
2
2
  //# sourceMappingURL=ui-decorators.cjs.map
@@ -11,6 +11,7 @@ const decoration_1 = require("@decaf-ts/decoration");
11
11
  const decorators_js_1 = require("./../model/decorators.cjs");
12
12
  const constants_js_1 = require("./constants.cjs");
13
13
  const reader_js_1 = require("./reader.cjs");
14
+ const registry_js_1 = require("./registry.cjs");
14
15
  function node(tag, graph, props) {
15
16
  function node(tag, graph, props) {
16
17
  const meta = {
@@ -18,7 +19,9 @@ function node(tag, graph, props) {
18
19
  ...graph,
19
20
  };
20
21
  return function innerNode(target) {
21
- return (0, decoration_1.apply)((0, decorators_js_1.uimodel)(tag, props), (0, decoration_1.metadata)(constants_js_1.GraphKeys.NODE, meta))(target);
22
+ const result = (0, decoration_1.apply)((0, decorators_js_1.uimodel)(tag, props), (0, decoration_1.metadata)(constants_js_1.GraphKeys.NODE, meta))(target);
23
+ (0, registry_js_1.registerNode)(target);
24
+ return result;
22
25
  };
23
26
  }
24
27
  return decoration_1.Decoration.for(constants_js_1.GraphKeys.NODE)
@@ -42,7 +45,9 @@ function graph(tag, graph, props) {
42
45
  connections: graph?.connections ||
43
46
  ports.filter((port) => port.direction === constants_js_1.PortDirection.CONNECTION),
44
47
  };
45
- return (0, decoration_1.apply)((0, decorators_js_1.uimodel)(tag, props), (0, decoration_1.metadata)(constants_js_1.GraphKeys.GRAPH, meta))(target);
48
+ const result = (0, decoration_1.apply)((0, decorators_js_1.uimodel)(tag, props), (0, decoration_1.metadata)(constants_js_1.GraphKeys.GRAPH, meta))(target);
49
+ (0, registry_js_1.registerWorkflow)(target);
50
+ return result;
46
51
  };
47
52
  }
48
53
  return decoration_1.Decoration.for(constants_js_1.GraphKeys.GRA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QAAQ,CAAC,OAAO,GAAG,EAAE;IACjC,SAAS,QAAQ,CAAC,MAAM;QACpB,MAAM,YAAY,GAAG,qBAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,wBAAS,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,IAAI,GAAG,YAAY,IAAI,EAAE,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG;YACZ,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;YACxB,QAAQ,EAAE;gBACN,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,IAAI;gBAChC,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,QAAQ;gBACtC,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,IAAI,IAAI;gBACxD,QAAQ,EAAE,OAAO,CAAC,QAAQ;aAC7B;SACJ,CAAC;QACF,qBAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,wBAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3C,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,OAAO,uBAAU,CAAC,GAAG,CAAC,gBAAgB,CAAC;SAClC,MAAM,CAAC;QACR,SAAS,EAAE,QAAQ;QACnB,IAAI,EAAE,CAAC,OAAO,CAAC;KAClB,CAAC;SACG,KAAK,EAAE,CAAC;AACjB,CAAC;AACD,sCAAsC"}
@@ -14,9 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ require("./../overrides/index.cjs");
17
18
  require("./overrides/index.cjs");
18
19
  __exportStar(require("./constants.cjs"), exports);
19
20
  __exportStar(require("./decorators.cjs"), exports);
21
+ __exportStar(require("./registry.cjs"), exports);
22
+ __exportStar(require("./overrides/index.cjs"), exports);
20
23
  __exportStar(require("./snapshot.cjs"), exports);
21
24
  __exportStar(require("./reader.cjs"), exports);
22
25
  __exportStar(require("./types.cjs"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"graph/index.cjs","sourceRoot":"","sources":["graph/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gCAA8B;AAC9B,iDAA+B;AAC/B,kDAAgC;AAChC,gDAA8B;AAC9B,8CAA4B;AAC5B,6CAA2B;AAC3B,uDAAqC;AACrC,iCAAiC"}
1
+ {"version":3,"file":"graph/index.cjs","sourceRoot":"","sources":["graph/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mCAAiC;AACjC,gCAA8B;AAC9B,iDAA+B;AAC/B,kDAAgC;AAChC,gDAA8B;AAC9B,uDAAqC;AACrC,gDAA8B;AAC9B,8CAA4B;AAC5B,6CAA2B;AAC3B,uDAAqC;AACrC,iCAAiC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * @module ui-decorators/graph/overrides/Metadata
5
+ * @summary Metadata namespace augmentation for graph nodes and workflows.
6
+ * @description Extends the `Metadata` class from `@decaf-ts/decoration` with
7
+ * `Metadata.nodes()` and `Metadata.workflows()` accessors that return all
8
+ * `@node`-decorated and `@graph`-decorated constructors respectively.
9
+ *
10
+ * This follows the existing override pattern used by `core` (`core/src/overrides/`)
11
+ * and `decorator-validation` (`decorator-validation/src/overrides/`):
12
+ * 1. This file declares the new static methods on the `Metadata` namespace via
13
+ * `declare module` (TypeScript declaration merging).
14
+ * 2. The companion `overrides.ts` attaches the implementations to the
15
+ * `Metadata` class at runtime via `(Metadata as any).fn = ...`.
16
+ * 3. The `index.ts` of this folder side-effect-imports `overrides.ts` so the
17
+ * attachments run whenever the graph module is loaded.
18
+ * 4. The package's `sideEffects` array in `package.json` includes the compiled
19
+ * overrides entry points so bundlers preserve the side-effect imports.
20
+ */
21
+ require("@decaf-ts/decoration");
22
+ //# sourceMappingURL=Metadata.js.map
23
+ //# sourceMappingURL=Metadata.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph/overrides/Metadata.cjs","sourceRoot":"","sources":["graph/overrides/Metadata.js"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,gCAA8B;AAC9B,oCAAoC"}
@@ -16,5 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  require("./Rendering.cjs");
18
18
  __exportStar(require("./overrides.cjs"), exports);
19
+ __exportStar(require("./Metadata.cjs"), exports);
19
20
  //# sourceMappingURL=index.js.map
20
21
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph/overrides/index.cjs","sourceRoot":"","sources":["graph/overrides/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0BAAwB;AACxB,iDAA+B;AAC/B,iCAAiC"}
1
+ {"version":3,"file":"graph/overrides/index.cjs","sourceRoot":"","sources":["graph/overrides/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0BAAwB;AACxB,iDAA+B;AAC/B,gDAA8B;AAC9B,iCAAiC"}
@@ -1,12 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  require("./Rendering.cjs");
4
+ const decoration_1 = require("@decaf-ts/decoration");
4
5
  const index_js_1 = require("./../../ui/index.cjs");
5
6
  const reader_js_1 = require("./../reader.cjs");
7
+ const registry_js_1 = require("./../registry.cjs");
6
8
  index_js_1.RenderingEngine.prototype.renderAsNode = function renderAsNode(model, globalProps, ...args) {
7
9
  void globalProps;
8
10
  void args;
9
11
  return (0, reader_js_1.graphDefinitionOf)(model);
10
12
  };
13
+ decoration_1.Metadata.nodes = function nodes() {
14
+ return (0, registry_js_1.graphNodes)();
15
+ }.bind(decoration_1.Metadata);
16
+ decoration_1.Metadata.workflows = function workflows() {
17
+ return (0, registry_js_1.graphWorkflows)();
18
+ }.bind(decoration_1.Metadata);
11
19
  //# sourceMappingURL=overrides.js.map
12
20
  //# sourceMappingURL=overrides.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph/overrides/overrides.cjs","sourceRoot":"","sources":["graph/overrides/overrides.js"],"names":[],"mappings":";;AAAA,0BAAwB;AACxB,kDAAsD;AACtD,8CAAmD;AACnD,0BAAe,CAAC,SAAS,CAAC,YAAY,GAAG,SAAS,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI;IACtF,KAAK,WAAW,CAAC;IACjB,KAAK,IAAI,CAAC;IACV,OAAO,IAAA,6BAAiB,EAAC,KAAK,CAAC,CAAC;AACpC,CAAC,CAAC;AACF,qCAAqC"}
1
+ {"version":3,"file":"graph/overrides/overrides.cjs","sourceRoot":"","sources":["graph/overrides/overrides.js"],"names":[],"mappings":";;AAAA,0BAAwB;AACxB,qDAAgD;AAChD,kDAAsD;AACtD,8CAAmD;AACnD,kDAA8D;AAC9D,0BAAe,CAAC,SAAS,CAAC,YAAY,GAAG,SAAS,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI;IACtF,KAAK,WAAW,CAAC;IACjB,KAAK,IAAI,CAAC;IACV,OAAO,IAAA,6BAAiB,EAAC,KAAK,CAAC,CAAC;AACpC,CAAC,CAAC;AACF,qBAAQ,CAAC,KAAK,GAAG,SAAS,KAAK;IAC3B,OAAO,IAAA,wBAAU,GAAE,CAAC;AACxB,CAAC,CAAC,IAAI,CAAC,qBAAQ,CAAC,CAAC;AACjB,qBAAQ,CAAC,SAAS,GAAG,SAAS,SAAS;IACnC,OAAO,IAAA,4BAAc,GAAE,CAAC;AAC5B,CAAC,CAAC,IAAI,CAAC,qBAAQ,CAAC,CAAC;AACjB,qCAAqC"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerNode = registerNode;
4
+ exports.registerWorkflow = registerWorkflow;
5
+ exports.graphNodes = graphNodes;
6
+ exports.graphWorkflows = graphWorkflows;
7
+ exports.resetGraphRegistries = resetGraphRegistries;
8
+ /**
9
+ * @module ui-decorators/graph/registry
10
+ * @summary Node and workflow class registries.
11
+ * @description Module-level registries that track every `@node`-decorated and
12
+ * `@graph`-decorated constructor. The `@node` and `@graph` decorators call
13
+ * {@link registerNode} / {@link registerWorkflow} as a side-effect; consumers
14
+ * discover all decorated classes via {@link graphNodes} / {@link graphWorkflows}
15
+ * or the `Metadata.nodes()` / `Metadata.workflows()` accessors.
16
+ *
17
+ * This follows the same pattern as `Injectables` (`injectable-decorators`)
18
+ * which maintains its own `InjectablesRegistry` rather than using the private
19
+ * `Metadata.innerGet`/`innerSet` helpers.
20
+ */
21
+ /**
22
+ * Internal registry of all `@node`-decorated constructors.
23
+ */
24
+ const NODE_REGISTRY = new Set();
25
+ /**
26
+ * Internal registry of all `@graph`-decorated constructors.
27
+ */
28
+ const WORKFLOW_REGISTRY = new Set();
29
+ /**
30
+ * Appends a constructor to the node registry. Called by the `@node` decorator.
31
+ * Idempotent — re-decorating the same class does not duplicate the entry.
32
+ * @param ctor The `@node`-decorated constructor.
33
+ */
34
+ function registerNode(ctor) {
35
+ NODE_REGISTRY.add(ctor);
36
+ }
37
+ /**
38
+ * Appends a constructor to the workflow registry. Called by the `@graph`
39
+ * decorator. Idempotent.
40
+ * @param ctor The `@graph`-decorated constructor.
41
+ */
42
+ function registerWorkflow(ctor) {
43
+ WORKFLOW_REGISTRY.add(ctor);
44
+ }
45
+ /**
46
+ * Returns all `@node`-decorated constructors.
47
+ * @returns A fresh array of constructors (mutable; does not expose the internal set).
48
+ */
49
+ function graphNodes() {
50
+ return [...NODE_REGISTRY];
51
+ }
52
+ /**
53
+ * Returns all `@graph`-decorated constructors.
54
+ * @returns A fresh array of constructors.
55
+ */
56
+ function graphWorkflows() {
57
+ return [...WORKFLOW_REGISTRY];
58
+ }
59
+ /**
60
+ * Clears both registries. Intended for tests only.
61
+ */
62
+ function resetGraphRegistries() {
63
+ NODE_REGISTRY.clear();
64
+ WORKFLOW_REGISTRY.clear();
65
+ }
66
+ //# sourceMappingURL=registry.js.map
67
+ //# sourceMappingURL=registry.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph/registry.cjs","sourceRoot":"","sources":["graph/registry.js"],"names":[],"mappings":";;AA0BA,oCAEC;AAMD,4CAEC;AAKD,gCAEC;AAKD,wCAEC;AAID,oDAGC;AAzDD;;;;;;;;;;;;GAYG;AACH;;GAEG;AACH,MAAM,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;AAChC;;GAEG;AACH,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAE,CAAC;AACpC;;;;GAIG;AACH,SAAgB,YAAY,CAAC,IAAI;IAC7B,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AACD;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,IAAI;IACjC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AACD;;;GAGG;AACH,SAAgB,UAAU;IACtB,OAAO,CAAC,GAAG,aAAa,CAAC,CAAC;AAC9B,CAAC;AACD;;;GAGG;AACH,SAAgB,cAAc;IAC1B,OAAO,CAAC,GAAG,iBAAiB,CAAC,CAAC;AAClC,CAAC;AACD;;GAEG;AACH,SAAgB,oBAAoB;IAChC,aAAa,CAAC,KAAK,EAAE,CAAC;IACtB,iBAAiB,CAAC,KAAK,EAAE,CAAC;AAC9B,CAAC;AACD,oCAAoC"}
package/lib/cjs/index.cjs CHANGED
@@ -33,21 +33,21 @@ __exportStar(require("./ui/index.cjs"), exports);
33
33
  * @const VERSION
34
34
  * @memberOf module:ui-decorators
35
35
  */
36
- exports.VERSION = "0.17.8";
36
+ exports.VERSION = "0.17.9";
37
37
  /**
38
38
  * @description Represents the current commit hash of the module build.
39
39
  * @summary Stores the current git commit hash for the package. The build replaces
40
40
  * the placeholder with the actual commit hash at publish time.
41
41
  * @const COMMIT
42
42
  */
43
- exports.COMMIT = "8cc02d8";
43
+ exports.COMMIT = "091374c";
44
44
  /**
45
45
  * @description Represents the full version string of the module.
46
46
  * @summary Stores the semver version and commit hash for the package.
47
47
  * The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
48
48
  * @const FULL_VERSION
49
49
  */
50
- exports.FULL_VERSION = "0.17.8-8cc02d8";
50
+ exports.FULL_VERSION = "0.17.9-091374c";
51
51
  exports.PACKAGE_NAME = "@decaf-ts/ui-decorators";
52
52
  decoration_1.Metadata.registerLibrary(exports.PACKAGE_NAME, exports.VERSION);
53
53
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,7 @@ import { apply, Decoration, Metadata, metadata, propMetadata, } from "@decaf-ts/
2
2
  import { uimodel } from "./../model/decorators.js";
3
3
  import { GraphKeys, PortDirection } from "./constants.js";
4
4
  import { graphPortsOf } from "./reader.js";
5
+ import { registerNode, registerWorkflow } from "./registry.js";
5
6
  export function node(tag, graph, props) {
6
7
  function node(tag, graph, props) {
7
8
  const meta = {
@@ -9,7 +10,9 @@ export function node(tag, graph, props) {
9
10
  ...graph,
10
11
  };
11
12
  return function innerNode(target) {
12
- return apply(uimodel(tag, props), metadata(GraphKeys.NODE, meta))(target);
13
+ const result = apply(uimodel(tag, props), metadata(GraphKeys.NODE, meta))(target);
14
+ registerNode(target);
15
+ return result;
13
16
  };
14
17
  }
15
18
  return Decoration.for(GraphKeys.NODE)
@@ -33,7 +36,9 @@ export function graph(tag, graph, props) {
33
36
  connections: graph?.connections ||
34
37
  ports.filter((port) => port.direction === PortDirection.CONNECTION),
35
38
  };
36
- return apply(uimodel(tag, props), metadata(GraphKeys.GRAPH, meta))(target);
39
+ const result = apply(uimodel(tag, props), metadata(GraphKeys.GRAPH, meta))(target);
40
+ registerWorkflow(target);
41
+ return result;
37
42
  };
38
43
  }
39
44
  return Decoration.for(GraphKeys.GRAPH)
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.js","sourceRoot":"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wBD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,QAAQ,CAAC,UAAgC,EAAE;IACzD,SAAS,QAAQ,CAAC,MAAc;QAC9B,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAC/B,MAAa,EACb,SAAS,CAAC,IAAI,CACkB,CAAC;QACnC,MAAM,IAAI,GAAsB,YAAY,IAAI,EAAE,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG;YACd,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;YACxB,QAAQ,EAAE;gBACR,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,IAAI;gBAChC,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,QAAQ;gBACtC,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,IAAI,IAAI;gBACxD,QAAQ,EAAE,OAAO,CAAC,QAAQ;aACH;SAC1B,CAAC;QACF,QAAQ,CAAC,GAAG,CAAC,MAAa,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAClD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,UAAU,CAAC,GAAG,CAAC,gBAAgB,CAAC;SACpC,MAAM,CAAC;QACN,SAAS,EAAE,QAAe;QAC1B,IAAI,EAAE,CAAC,OAAO,CAAC;KAChB,CAAC;SACD,KAAK,EAAE,CAAC;AACb,CAAC"}
@@ -1,6 +1,9 @@
1
+ import "./../overrides/index.js";
1
2
  import "./overrides/index.js";
2
3
  export * from "./constants.js";
3
4
  export * from "./decorators.js";
5
+ export * from "./registry.js";
6
+ export * from "./overrides/index.js";
4
7
  export * from "./snapshot.js";
5
8
  export * from "./reader.js";
6
9
  export * from "./types.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/graph/index.ts"],"names":[],"mappings":"AAAA,8BAAqB;AAErB,+BAA4B;AAC5B,gCAA6B;AAC7B,8BAA2B;AAC3B,4BAAyB;AACzB,2BAAwB;AACxB,qCAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/graph/index.ts"],"names":[],"mappings":"AAAA,iCAAsB;AACtB,8BAAqB;AAErB,+BAA4B;AAC5B,gCAA6B;AAC7B,8BAA2B;AAC3B,qCAA4B;AAC5B,8BAA2B;AAC3B,4BAAyB;AACzB,2BAAwB;AACxB,qCAA4B"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @module ui-decorators/graph/overrides/Metadata
3
+ * @summary Metadata namespace augmentation for graph nodes and workflows.
4
+ * @description Extends the `Metadata` class from `@decaf-ts/decoration` with
5
+ * `Metadata.nodes()` and `Metadata.workflows()` accessors that return all
6
+ * `@node`-decorated and `@graph`-decorated constructors respectively.
7
+ *
8
+ * This follows the existing override pattern used by `core` (`core/src/overrides/`)
9
+ * and `decorator-validation` (`decorator-validation/src/overrides/`):
10
+ * 1. This file declares the new static methods on the `Metadata` namespace via
11
+ * `declare module` (TypeScript declaration merging).
12
+ * 2. The companion `overrides.ts` attaches the implementations to the
13
+ * `Metadata` class at runtime via `(Metadata as any).fn = ...`.
14
+ * 3. The `index.ts` of this folder side-effect-imports `overrides.ts` so the
15
+ * attachments run whenever the graph module is loaded.
16
+ * 4. The package's `sideEffects` array in `package.json` includes the compiled
17
+ * overrides entry points so bundlers preserve the side-effect imports.
18
+ */
19
+ import "@decaf-ts/decoration";
20
+ //# sourceMappingURL=Metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Metadata.js","sourceRoot":"","sources":["../../../../src/graph/overrides/Metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,sBAAsB,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import "./Rendering.js";
2
2
  export * from "./overrides.js";
3
+ export * from "./Metadata.js";
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/graph/overrides/index.ts"],"names":[],"mappings":"AAAA,wBAAqB;AAErB,+BAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/graph/overrides/index.ts"],"names":[],"mappings":"AAAA,wBAAqB;AAErB,+BAA4B;AAC5B,8BAA2B"}
@@ -1,9 +1,17 @@
1
1
  import "./Rendering.js";
2
+ import { Metadata } from "@decaf-ts/decoration";
2
3
  import { RenderingEngine } from "./../../ui/index.js";
3
4
  import { graphDefinitionOf } from "./../reader.js";
5
+ import { graphNodes, graphWorkflows } from "./../registry.js";
4
6
  RenderingEngine.prototype.renderAsNode = function renderAsNode(model, globalProps, ...args) {
5
7
  void globalProps;
6
8
  void args;
7
9
  return graphDefinitionOf(model);
8
10
  };
11
+ Metadata.nodes = function nodes() {
12
+ return graphNodes();
13
+ }.bind(Metadata);
14
+ Metadata.workflows = function workflows() {
15
+ return graphWorkflows();
16
+ }.bind(Metadata);
9
17
  //# sourceMappingURL=overrides.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../../../src/graph/overrides/overrides.ts"],"names":[],"mappings":"AAAA,wBAAqB;AACrB,OAAO,EAAwB,eAAe,EAAE,4BAAuB;AAEvE,OAAO,EAAE,iBAAiB,EAAE,uBAAkB;AAE7C,eAAe,CAAC,SAAiB,CAAC,YAAY,GAAG,SAAS,YAAY,CAIrE,KAAQ,EAAE,WAAoC,EAAE,GAAG,IAAW;IAC9D,KAAK,WAAW,CAAC;IACjB,KAAK,IAAI,CAAC;IACV,OAAO,iBAAiB,CAAC,KAAK,CAAiB,CAAC;AAClD,CAAC,CAAC"}
1
+ {"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../../../src/graph/overrides/overrides.ts"],"names":[],"mappings":"AAAA,wBAAqB;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAwB,eAAe,EAAE,4BAAuB;AAEvE,OAAO,EAAE,iBAAiB,EAAE,uBAAkB;AAC9C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,yBAAoB;AAExD,eAAe,CAAC,SAAiB,CAAC,YAAY,GAAG,SAAS,YAAY,CAIrE,KAAQ,EAAE,WAAoC,EAAE,GAAG,IAAW;IAC9D,KAAK,WAAW,CAAC;IACjB,KAAK,IAAI,CAAC;IACV,OAAO,iBAAiB,CAAC,KAAK,CAAiB,CAAC;AAClD,CAAC,CAAC;AAED,QAAgB,CAAC,KAAK,GAAG,SAAS,KAAK;IACtC,OAAO,UAAU,EAAE,CAAC;AACtB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAEhB,QAAgB,CAAC,SAAS,GAAG,SAAS,SAAS;IAC9C,OAAO,cAAc,EAAE,CAAC;AAC1B,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * @module ui-decorators/graph/registry
3
+ * @summary Node and workflow class registries.
4
+ * @description Module-level registries that track every `@node`-decorated and
5
+ * `@graph`-decorated constructor. The `@node` and `@graph` decorators call
6
+ * {@link registerNode} / {@link registerWorkflow} as a side-effect; consumers
7
+ * discover all decorated classes via {@link graphNodes} / {@link graphWorkflows}
8
+ * or the `Metadata.nodes()` / `Metadata.workflows()` accessors.
9
+ *
10
+ * This follows the same pattern as `Injectables` (`injectable-decorators`)
11
+ * which maintains its own `InjectablesRegistry` rather than using the private
12
+ * `Metadata.innerGet`/`innerSet` helpers.
13
+ */
14
+ /**
15
+ * Internal registry of all `@node`-decorated constructors.
16
+ */
17
+ const NODE_REGISTRY = new Set();
18
+ /**
19
+ * Internal registry of all `@graph`-decorated constructors.
20
+ */
21
+ const WORKFLOW_REGISTRY = new Set();
22
+ /**
23
+ * Appends a constructor to the node registry. Called by the `@node` decorator.
24
+ * Idempotent — re-decorating the same class does not duplicate the entry.
25
+ * @param ctor The `@node`-decorated constructor.
26
+ */
27
+ export function registerNode(ctor) {
28
+ NODE_REGISTRY.add(ctor);
29
+ }
30
+ /**
31
+ * Appends a constructor to the workflow registry. Called by the `@graph`
32
+ * decorator. Idempotent.
33
+ * @param ctor The `@graph`-decorated constructor.
34
+ */
35
+ export function registerWorkflow(ctor) {
36
+ WORKFLOW_REGISTRY.add(ctor);
37
+ }
38
+ /**
39
+ * Returns all `@node`-decorated constructors.
40
+ * @returns A fresh array of constructors (mutable; does not expose the internal set).
41
+ */
42
+ export function graphNodes() {
43
+ return [...NODE_REGISTRY];
44
+ }
45
+ /**
46
+ * Returns all `@graph`-decorated constructors.
47
+ * @returns A fresh array of constructors.
48
+ */
49
+ export function graphWorkflows() {
50
+ return [...WORKFLOW_REGISTRY];
51
+ }
52
+ /**
53
+ * Clears both registries. Intended for tests only.
54
+ */
55
+ export function resetGraphRegistries() {
56
+ NODE_REGISTRY.clear();
57
+ WORKFLOW_REGISTRY.clear();
58
+ }
59
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/graph/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH;;GAEG;AACH,MAAM,aAAa,GAAG,IAAI,GAAG,EAAe,CAAC;AAE7C;;GAEG;AACH,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAe,CAAC;AAEjD;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAiB;IAC5C,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAiB;IAChD,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,CAAC,GAAG,aAAa,CAAC,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,CAAC,GAAG,iBAAiB,CAAC,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,aAAa,CAAC,KAAK,EAAE,CAAC;IACtB,iBAAiB,CAAC,KAAK,EAAE,CAAC;AAC5B,CAAC"}
package/lib/esm/index.js CHANGED
@@ -16,21 +16,21 @@ export * from "./ui/index.js";
16
16
  * @const VERSION
17
17
  * @memberOf module:ui-decorators
18
18
  */
19
- export const VERSION = "0.17.8";
19
+ export const VERSION = "0.17.9";
20
20
  /**
21
21
  * @description Represents the current commit hash of the module build.
22
22
  * @summary Stores the current git commit hash for the package. The build replaces
23
23
  * the placeholder with the actual commit hash at publish time.
24
24
  * @const COMMIT
25
25
  */
26
- export const COMMIT = "8cc02d8";
26
+ export const COMMIT = "091374c";
27
27
  /**
28
28
  * @description Represents the full version string of the module.
29
29
  * @summary Stores the semver version and commit hash for the package.
30
30
  * The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
31
31
  * @const FULL_VERSION
32
32
  */
33
- export const FULL_VERSION = "0.17.8-8cc02d8";
33
+ export const FULL_VERSION = "0.17.9-091374c";
34
34
  export const PACKAGE_NAME = "@decaf-ts/ui-decorators";
35
35
  Metadata.registerLibrary(PACKAGE_NAME, VERSION);
36
36
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,9 @@
1
+ import "../overrides";
1
2
  import "./overrides";
2
3
  export * from "./constants.d.cts";
3
4
  export * from "./decorators.d.cts";
5
+ export * from "./registry.d.cts";
6
+ export * from "./overrides/index.d.cts";
4
7
  export * from "./snapshot.d.cts";
5
8
  export * from "./reader.d.cts";
6
9
  export * from "./types.d.cts";
@@ -1,6 +1,9 @@
1
+ import "../overrides";
1
2
  import "./overrides";
2
3
  export * from "./constants.d.mts";
3
4
  export * from "./decorators.d.mts";
5
+ export * from "./registry.d.mts";
6
+ export * from "./overrides/index.d.mts";
4
7
  export * from "./snapshot.d.mts";
5
8
  export * from "./reader.d.mts";
6
9
  export * from "./types.d.mts";
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @module ui-decorators/graph/overrides/Metadata
3
+ * @summary Metadata namespace augmentation for graph nodes and workflows.
4
+ * @description Extends the `Metadata` class from `@decaf-ts/decoration` with
5
+ * `Metadata.nodes()` and `Metadata.workflows()` accessors that return all
6
+ * `@node`-decorated and `@graph`-decorated constructors respectively.
7
+ *
8
+ * This follows the existing override pattern used by `core` (`core/src/overrides/`)
9
+ * and `decorator-validation` (`decorator-validation/src/overrides/`):
10
+ * 1. This file declares the new static methods on the `Metadata` namespace via
11
+ * `declare module` (TypeScript declaration merging).
12
+ * 2. The companion `overrides.ts` attaches the implementations to the
13
+ * `Metadata` class at runtime via `(Metadata as any).fn = ...`.
14
+ * 3. The `index.ts` of this folder side-effect-imports `overrides.ts` so the
15
+ * attachments run whenever the graph module is loaded.
16
+ * 4. The package's `sideEffects` array in `package.json` includes the compiled
17
+ * overrides entry points so bundlers preserve the side-effect imports.
18
+ */
19
+ import "@decaf-ts/decoration";
20
+ import type { Constructor } from "@decaf-ts/decoration";
21
+ declare module "@decaf-ts/decoration" {
22
+ namespace Metadata {
23
+ /**
24
+ * Returns all `@node`-decorated constructors.
25
+ *
26
+ * The list is populated as a side-effect of the `@node` decorator — every
27
+ * class decorated with `@node(...)` is appended to the node registry at
28
+ * decoration time. Consumers (e.g. the for-angular graph palette, CRUD form
29
+ * builders, executor registries) call this to discover all available node
30
+ * kinds without a hand-maintained array.
31
+ * @returns A fresh array of `@node`-decorated constructors.
32
+ */
33
+ function nodes(): Constructor[];
34
+ /**
35
+ * Returns all `@graph`-decorated constructors (workflow roots).
36
+ *
37
+ * Analogous to {@link nodes} but for `@graph`-decorated workflow-root
38
+ * classes. Populated as a side-effect of the `@graph` decorator.
39
+ * @returns A fresh array of `@graph`-decorated constructors.
40
+ */
41
+ function workflows(): Constructor[];
42
+ }
43
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @module ui-decorators/graph/overrides/Metadata
3
+ * @summary Metadata namespace augmentation for graph nodes and workflows.
4
+ * @description Extends the `Metadata` class from `@decaf-ts/decoration` with
5
+ * `Metadata.nodes()` and `Metadata.workflows()` accessors that return all
6
+ * `@node`-decorated and `@graph`-decorated constructors respectively.
7
+ *
8
+ * This follows the existing override pattern used by `core` (`core/src/overrides/`)
9
+ * and `decorator-validation` (`decorator-validation/src/overrides/`):
10
+ * 1. This file declares the new static methods on the `Metadata` namespace via
11
+ * `declare module` (TypeScript declaration merging).
12
+ * 2. The companion `overrides.ts` attaches the implementations to the
13
+ * `Metadata` class at runtime via `(Metadata as any).fn = ...`.
14
+ * 3. The `index.ts` of this folder side-effect-imports `overrides.ts` so the
15
+ * attachments run whenever the graph module is loaded.
16
+ * 4. The package's `sideEffects` array in `package.json` includes the compiled
17
+ * overrides entry points so bundlers preserve the side-effect imports.
18
+ */
19
+ import "@decaf-ts/decoration";
20
+ import type { Constructor } from "@decaf-ts/decoration";
21
+ declare module "@decaf-ts/decoration" {
22
+ namespace Metadata {
23
+ /**
24
+ * Returns all `@node`-decorated constructors.
25
+ *
26
+ * The list is populated as a side-effect of the `@node` decorator — every
27
+ * class decorated with `@node(...)` is appended to the node registry at
28
+ * decoration time. Consumers (e.g. the for-angular graph palette, CRUD form
29
+ * builders, executor registries) call this to discover all available node
30
+ * kinds without a hand-maintained array.
31
+ * @returns A fresh array of `@node`-decorated constructors.
32
+ */
33
+ function nodes(): Constructor[];
34
+ /**
35
+ * Returns all `@graph`-decorated constructors (workflow roots).
36
+ *
37
+ * Analogous to {@link nodes} but for `@graph`-decorated workflow-root
38
+ * classes. Populated as a side-effect of the `@graph` decorator.
39
+ * @returns A fresh array of `@graph`-decorated constructors.
40
+ */
41
+ function workflows(): Constructor[];
42
+ }
43
+ }
@@ -1,2 +1,3 @@
1
1
  import "./Rendering";
2
2
  export * from "./overrides.d.cts";
3
+ export * from "./Metadata.d.cts";
@@ -1,2 +1,3 @@
1
1
  import "./Rendering";
2
2
  export * from "./overrides.d.mts";
3
+ export * from "./Metadata.d.mts";
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @module ui-decorators/graph/registry
3
+ * @summary Node and workflow class registries.
4
+ * @description Module-level registries that track every `@node`-decorated and
5
+ * `@graph`-decorated constructor. The `@node` and `@graph` decorators call
6
+ * {@link registerNode} / {@link registerWorkflow} as a side-effect; consumers
7
+ * discover all decorated classes via {@link graphNodes} / {@link graphWorkflows}
8
+ * or the `Metadata.nodes()` / `Metadata.workflows()` accessors.
9
+ *
10
+ * This follows the same pattern as `Injectables` (`injectable-decorators`)
11
+ * which maintains its own `InjectablesRegistry` rather than using the private
12
+ * `Metadata.innerGet`/`innerSet` helpers.
13
+ */
14
+ import type { Constructor } from "@decaf-ts/decoration";
15
+ /**
16
+ * Appends a constructor to the node registry. Called by the `@node` decorator.
17
+ * Idempotent — re-decorating the same class does not duplicate the entry.
18
+ * @param ctor The `@node`-decorated constructor.
19
+ */
20
+ export declare function registerNode(ctor: Constructor): void;
21
+ /**
22
+ * Appends a constructor to the workflow registry. Called by the `@graph`
23
+ * decorator. Idempotent.
24
+ * @param ctor The `@graph`-decorated constructor.
25
+ */
26
+ export declare function registerWorkflow(ctor: Constructor): void;
27
+ /**
28
+ * Returns all `@node`-decorated constructors.
29
+ * @returns A fresh array of constructors (mutable; does not expose the internal set).
30
+ */
31
+ export declare function graphNodes(): Constructor[];
32
+ /**
33
+ * Returns all `@graph`-decorated constructors.
34
+ * @returns A fresh array of constructors.
35
+ */
36
+ export declare function graphWorkflows(): Constructor[];
37
+ /**
38
+ * Clears both registries. Intended for tests only.
39
+ */
40
+ export declare function resetGraphRegistries(): void;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @module ui-decorators/graph/registry
3
+ * @summary Node and workflow class registries.
4
+ * @description Module-level registries that track every `@node`-decorated and
5
+ * `@graph`-decorated constructor. The `@node` and `@graph` decorators call
6
+ * {@link registerNode} / {@link registerWorkflow} as a side-effect; consumers
7
+ * discover all decorated classes via {@link graphNodes} / {@link graphWorkflows}
8
+ * or the `Metadata.nodes()` / `Metadata.workflows()` accessors.
9
+ *
10
+ * This follows the same pattern as `Injectables` (`injectable-decorators`)
11
+ * which maintains its own `InjectablesRegistry` rather than using the private
12
+ * `Metadata.innerGet`/`innerSet` helpers.
13
+ */
14
+ import type { Constructor } from "@decaf-ts/decoration";
15
+ /**
16
+ * Appends a constructor to the node registry. Called by the `@node` decorator.
17
+ * Idempotent — re-decorating the same class does not duplicate the entry.
18
+ * @param ctor The `@node`-decorated constructor.
19
+ */
20
+ export declare function registerNode(ctor: Constructor): void;
21
+ /**
22
+ * Appends a constructor to the workflow registry. Called by the `@graph`
23
+ * decorator. Idempotent.
24
+ * @param ctor The `@graph`-decorated constructor.
25
+ */
26
+ export declare function registerWorkflow(ctor: Constructor): void;
27
+ /**
28
+ * Returns all `@node`-decorated constructors.
29
+ * @returns A fresh array of constructors (mutable; does not expose the internal set).
30
+ */
31
+ export declare function graphNodes(): Constructor[];
32
+ /**
33
+ * Returns all `@graph`-decorated constructors.
34
+ * @returns A fresh array of constructors.
35
+ */
36
+ export declare function graphWorkflows(): Constructor[];
37
+ /**
38
+ * Clears both registries. Intended for tests only.
39
+ */
40
+ export declare function resetGraphRegistries(): void;
@@ -15,19 +15,19 @@ export * from "./ui/index.d.cts";
15
15
  * @const VERSION
16
16
  * @memberOf module:ui-decorators
17
17
  */
18
- export declare const VERSION = "0.17.8";
18
+ export declare const VERSION = "0.17.9";
19
19
  /**
20
20
  * @description Represents the current commit hash of the module build.
21
21
  * @summary Stores the current git commit hash for the package. The build replaces
22
22
  * the placeholder with the actual commit hash at publish time.
23
23
  * @const COMMIT
24
24
  */
25
- export declare const COMMIT = "8cc02d8";
25
+ export declare const COMMIT = "091374c";
26
26
  /**
27
27
  * @description Represents the full version string of the module.
28
28
  * @summary Stores the semver version and commit hash for the package.
29
29
  * The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
30
30
  * @const FULL_VERSION
31
31
  */
32
- export declare const FULL_VERSION = "0.17.8-8cc02d8";
32
+ export declare const FULL_VERSION = "0.17.9-091374c";
33
33
  export declare const PACKAGE_NAME = "@decaf-ts/ui-decorators";
@@ -15,19 +15,19 @@ export * from "./ui/index.d.mts";
15
15
  * @const VERSION
16
16
  * @memberOf module:ui-decorators
17
17
  */
18
- export declare const VERSION = "0.17.8";
18
+ export declare const VERSION = "0.17.9";
19
19
  /**
20
20
  * @description Represents the current commit hash of the module build.
21
21
  * @summary Stores the current git commit hash for the package. The build replaces
22
22
  * the placeholder with the actual commit hash at publish time.
23
23
  * @const COMMIT
24
24
  */
25
- export declare const COMMIT = "8cc02d8";
25
+ export declare const COMMIT = "091374c";
26
26
  /**
27
27
  * @description Represents the full version string of the module.
28
28
  * @summary Stores the semver version and commit hash for the package.
29
29
  * The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
30
30
  * @const FULL_VERSION
31
31
  */
32
- export declare const FULL_VERSION = "0.17.8-8cc02d8";
32
+ export declare const FULL_VERSION = "0.17.9-091374c";
33
33
  export declare const PACKAGE_NAME = "@decaf-ts/ui-decorators";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/ui-decorators",
3
- "version": "0.17.8",
3
+ "version": "0.17.10",
4
4
  "description": "Extension of decorator validation to ui elements to allow for web integration",
5
5
  "type": "module",
6
6
  "exports": {