@decaf-ts/ui-decorators 0.18.0 → 0.19.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.
Files changed (48) hide show
  1. package/dist/ui-decorators.cjs +1 -1
  2. package/lib/cjs/graph/constants.cjs +28 -1
  3. package/lib/cjs/graph/constants.cjs.map +1 -1
  4. package/lib/cjs/index.cjs +3 -3
  5. package/lib/cjs/user-requests/UserRequestHandler.cjs +190 -0
  6. package/lib/cjs/user-requests/UserRequestHandler.cjs.map +1 -0
  7. package/lib/cjs/user-requests/constants.cjs +22 -0
  8. package/lib/cjs/user-requests/constants.cjs.map +1 -0
  9. package/lib/cjs/user-requests/decorators.cjs +41 -0
  10. package/lib/cjs/user-requests/decorators.cjs.map +1 -0
  11. package/lib/cjs/user-requests/errors.cjs +26 -0
  12. package/lib/cjs/user-requests/errors.cjs.map +1 -0
  13. package/lib/cjs/user-requests/index.cjs +33 -0
  14. package/lib/cjs/user-requests/index.cjs.map +1 -0
  15. package/lib/cjs/user-requests/types.cjs +4 -0
  16. package/lib/cjs/user-requests/types.cjs.map +1 -0
  17. package/lib/esm/graph/constants.js +26 -0
  18. package/lib/esm/graph/constants.js.map +1 -1
  19. package/lib/esm/index.js +3 -3
  20. package/lib/esm/user-requests/UserRequestHandler.js +185 -0
  21. package/lib/esm/user-requests/UserRequestHandler.js.map +1 -0
  22. package/lib/esm/user-requests/constants.js +18 -0
  23. package/lib/esm/user-requests/constants.js.map +1 -0
  24. package/lib/esm/user-requests/decorators.js +37 -0
  25. package/lib/esm/user-requests/decorators.js.map +1 -0
  26. package/lib/esm/user-requests/errors.js +21 -0
  27. package/lib/esm/user-requests/errors.js.map +1 -0
  28. package/lib/esm/user-requests/index.js +16 -0
  29. package/lib/esm/user-requests/index.js.map +1 -0
  30. package/lib/esm/user-requests/types.js +8 -0
  31. package/lib/esm/user-requests/types.js.map +1 -0
  32. package/lib/types/graph/constants.d.cts +66 -0
  33. package/lib/types/graph/constants.d.mts +66 -0
  34. package/lib/types/index.d.cts +3 -3
  35. package/lib/types/index.d.mts +3 -3
  36. package/lib/types/user-requests/UserRequestHandler.d.cts +117 -0
  37. package/lib/types/user-requests/UserRequestHandler.d.mts +117 -0
  38. package/lib/types/user-requests/constants.d.cts +17 -0
  39. package/lib/types/user-requests/constants.d.mts +17 -0
  40. package/lib/types/user-requests/decorators.d.cts +22 -0
  41. package/lib/types/user-requests/decorators.d.mts +22 -0
  42. package/lib/types/user-requests/errors.d.cts +18 -0
  43. package/lib/types/user-requests/errors.d.mts +18 -0
  44. package/lib/types/user-requests/index.d.cts +15 -0
  45. package/lib/types/user-requests/index.d.mts +15 -0
  46. package/lib/types/user-requests/types.d.cts +36 -0
  47. package/lib/types/user-requests/types.d.mts +36 -0
  48. package/package.json +22 -4
@@ -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",HIDE_FOR:"hide-for",SHOW_FOR:"show-for",RENDER_IF:"render-if",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 R(e){if(!e)return e;const t={"&":"&amp;","<":"&lt;",">":"&gt;"};return(""+e).replace(/[&<>]/g,e=>t[e]||e)}function T(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 m{static{this.cache={}}constructor(e){this.flavour=e,this.initialized=!1,m.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:R}=E,m=t.Model.uiPropertiesOf(e.constructor);let O,g=M?.props||{},L={};const A=(e,t)=>e?[e,t].join("."):t;if(m){const s=a.Metadata.get(e.constructor,t.ValidationKeys.REFLECT)||{};for(const i of m){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:g[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:{L=L||{};const e=r.props;e.name&&(L[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);g={tag:M?.tag||t.render||"",props:Object.assign({},g?.props,{mapper:L},t)};break}case n.EVENTS:case n.HIDDEN:case n.HIDE_FOR:case n.SHOW_FOR:case n.PAGE:case n.ORDER:case n.UILAYOUTPROP:case n.ELEMENT:{O=O||[];const t=r.props,d=r.key===n.HIDE_FOR?{hideFor:r.props}:r.key===n.SHOW_FOR?{showFor:r.props}:{},p=Object.assign({},g?.props,t.props||{},d,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||g?.tag||f||"",props:p},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)&&(p[n.SUB_TYPE]=e.key,e.props?.message&&(p[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.HIDE_FOR||r.key===n.SHOW_FOR)e.props=Object.assign({},e.props,d);else 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:R||{}});const D=new Set([...Array.isArray(o?.namespaces)?o.namespaces:[],..."string"==typeof o?.namespace?[o.namespace]:[]].filter(Boolean)),I=o?.operation;O=this.sortChildrenByOrder(O).filter(e=>{const t=e?.props?.hidden||[];if(t.length>0&&t.includes(I))return!1;const r=e?.props?.hideFor||[],a=e?.props?.showFor||[];return!(r.length>0&&[...D].some(e=>r.includes(e))||a.length>0&&![...D].some(e=>a.includes(e)))});const N={tag:f,item:g,props:o,children:O?.length?O:void 0};return s&&(N.rendererId=T(e)),N}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 m)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 m.get(o).render(e,...a)}}function O(...e){return(t,r)=>a.propMetadata(h(r,n.HIDDEN),e)(t,r)}function g(...e){return(t,r)=>a.propMetadata(h(r,n.SHOW_FOR),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 A extends t.Validator{getMessage(e,...t){return A.translateService?A.translateService.translate(e,...t):super.getMessage(e,...t)}}class D 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 I 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 N(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 b(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 S(e){return t=>{const r={handlers:e};return a.metadata(a.Metadata.key(n.REFLECT,n.HANDLERS),r)(t)}}function P(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),N(t,i)(e,r))}function k(e,t=1,r=!1,a={}){let o=[];return"object"==typeof t&&(o=t,t=o.length),N(e,{pages:t,paginated:r,pageTitles:o,props:a})}t.Model.prototype.render=function(...e){return m.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(N(e,t))},U.renderedBy=function(e){return this.decorateClass(b(e))},U.uilistmodel=function(e,t){return this.decorateClass(C(e,t))},U.uihandlers=function(e){return this.decorateClass(S(e))},U.uilayout=function(e,t,r,a){return this.decorateClass(P(e,t,r,a))},U.uisteppedmodel=function(e,t,r,a){return this.decorateClass(k(e,t,r,a))};const w="##VERSION##",v="##PACKAGE##";a.Metadata.registerLibrary(v,w),e.ActionRoles=E,e.COMMIT="bcc23e4",e.ComponentEventNames={Render:"render",BackButtonClickEvent:"backButtonNavigationEndEvent",Refresh:"RefreshEvent",Click:"ClickEvent",Change:"ChangeEvent",Submit:"SubmitEvent",ValidationError:"validationErrorEvent",ThemeChange:"themeChangeEvent",FormGroupLoaded:"formGroupLoadedEvent"},e.DecafComponent=D,e.DecafEventHandler=class extends D{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=I,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.11-bcc23e4",e.HTML5CheckTypes=p,e.HTML5DateFormat=l,e.HTML5InputTypes=c,e.LayoutGridGaps={small:"small",medium:"medium",large:"large",collapse:"collapse",none:""},e.PACKAGE_NAME=v,e.RenderingEngine=m,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=A,e.VERSION=w,e.ValidatableByAttribute=d,e.ValidatableByType=i,e.WindowColorSchemes={light:"light",dark:"dark",undefined:"undefined"},e.escapeHtml=R,e.formatByType=y,e.generateUIModelID=T,e.getUIAttributeKey=h,e.hidden=()=>O(r.OperationKeys.CREATE,r.OperationKeys.READ,r.OperationKeys.UPDATE,r.OperationKeys.DELETE),e.hideFor=(...e)=>(t,r)=>a.propMetadata(h(r,n.HIDE_FOR),e)(t,r),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()?R(o):n}if(void 0===n)throw new r.InternalError(`Failed to parse value of type ${a} from ${typeof o} - ${o}`);return n},e.renderIf=(...e)=>g(...e),e.renderedBy=b,e.revertHtml=e=>{const t={"&amp;":"&","&lt;":"<","&gt;":">"};return(""+e).replace(/&lt;|&gt;|&amp;/g,e=>t[e]||e)},e.showFor=g,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=S,e.uilayout=P,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=N,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=k,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",HIDE_FOR:"hide-for",SHOW_FOR:"show-for",RENDER_IF:"render-if",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 R(e){if(!e)return e;const t={"&":"&amp;","<":"&lt;",">":"&gt;"};return(""+e).replace(/[&<>]/g,e=>t[e]||e)}function T(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 m{static{this.cache={}}constructor(e){this.flavour=e,this.initialized=!1,m.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:R}=E,m=t.Model.uiPropertiesOf(e.constructor);let O,g=M?.props||{},L={};const A=(e,t)=>e?[e,t].join("."):t;if(m){const s=a.Metadata.get(e.constructor,t.ValidationKeys.REFLECT)||{};for(const i of m){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:g[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:{L=L||{};const e=r.props;e.name&&(L[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);g={tag:M?.tag||t.render||"",props:Object.assign({},g?.props,{mapper:L},t)};break}case n.EVENTS:case n.HIDDEN:case n.HIDE_FOR:case n.SHOW_FOR:case n.PAGE:case n.ORDER:case n.UILAYOUTPROP:case n.ELEMENT:{O=O||[];const t=r.props,d=r.key===n.HIDE_FOR?{hideFor:r.props}:r.key===n.SHOW_FOR?{showFor:r.props}:{},p=Object.assign({},g?.props,t.props||{},d,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||g?.tag||f||"",props:p},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)&&(p[n.SUB_TYPE]=e.key,e.props?.message&&(p[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.HIDE_FOR||r.key===n.SHOW_FOR)e.props=Object.assign({},e.props,d);else 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:R||{}});const D=new Set([...Array.isArray(o?.namespaces)?o.namespaces:[],..."string"==typeof o?.namespace?[o.namespace]:[]].filter(Boolean)),I=o?.operation;O=this.sortChildrenByOrder(O).filter(e=>{const t=e?.props?.hidden||[];if(t.length>0&&t.includes(I))return!1;const r=e?.props?.hideFor||[],a=e?.props?.showFor||[];return!(r.length>0&&[...D].some(e=>r.includes(e))||a.length>0&&![...D].some(e=>a.includes(e)))});const N={tag:f,item:g,props:o,children:O?.length?O:void 0};return s&&(N.rendererId=T(e)),N}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 m)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 m.get(o).render(e,...a)}}function O(...e){return(t,r)=>a.propMetadata(h(r,n.HIDDEN),e)(t,r)}function g(...e){return(t,r)=>a.propMetadata(h(r,n.SHOW_FOR),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 A extends t.Validator{getMessage(e,...t){return A.translateService?A.translateService.translate(e,...t):super.getMessage(e,...t)}}class D 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 I 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 N(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 b(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 S(e){return t=>{const r={handlers:e};return a.metadata(a.Metadata.key(n.REFLECT,n.HANDLERS),r)(t)}}function P(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),N(t,i)(e,r))}function k(e,t=1,r=!1,a={}){let o=[];return"object"==typeof t&&(o=t,t=o.length),N(e,{pages:t,paginated:r,pageTitles:o,props:a})}t.Model.prototype.render=function(...e){return m.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(N(e,t))},U.renderedBy=function(e){return this.decorateClass(b(e))},U.uilistmodel=function(e,t){return this.decorateClass(C(e,t))},U.uihandlers=function(e){return this.decorateClass(S(e))},U.uilayout=function(e,t,r,a){return this.decorateClass(P(e,t,r,a))},U.uisteppedmodel=function(e,t,r,a){return this.decorateClass(k(e,t,r,a))};const w="##VERSION##",v="##PACKAGE##";a.Metadata.registerLibrary(v,w),e.ActionRoles=E,e.COMMIT="23dcb33",e.ComponentEventNames={Render:"render",BackButtonClickEvent:"backButtonNavigationEndEvent",Refresh:"RefreshEvent",Click:"ClickEvent",Change:"ChangeEvent",Submit:"SubmitEvent",ValidationError:"validationErrorEvent",ThemeChange:"themeChangeEvent",FormGroupLoaded:"formGroupLoadedEvent"},e.DecafComponent=D,e.DecafEventHandler=class extends D{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=I,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.18.0-23dcb33",e.HTML5CheckTypes=p,e.HTML5DateFormat=l,e.HTML5InputTypes=c,e.LayoutGridGaps={small:"small",medium:"medium",large:"large",collapse:"collapse",none:""},e.PACKAGE_NAME=v,e.RenderingEngine=m,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=A,e.VERSION=w,e.ValidatableByAttribute=d,e.ValidatableByType=i,e.WindowColorSchemes={light:"light",dark:"dark",undefined:"undefined"},e.escapeHtml=R,e.formatByType=y,e.generateUIModelID=T,e.getUIAttributeKey=h,e.hidden=()=>O(r.OperationKeys.CREATE,r.OperationKeys.READ,r.OperationKeys.UPDATE,r.OperationKeys.DELETE),e.hideFor=(...e)=>(t,r)=>a.propMetadata(h(r,n.HIDE_FOR),e)(t,r),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()?R(o):n}if(void 0===n)throw new r.InternalError(`Failed to parse value of type ${a} from ${typeof o} - ${o}`);return n},e.renderIf=(...e)=>g(...e),e.renderedBy=b,e.revertHtml=e=>{const t={"&amp;":"&","&lt;":"<","&gt;":">"};return(""+e).replace(/&lt;|&gt;|&amp;/g,e=>t[e]||e)},e.showFor=g,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=S,e.uilayout=P,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=N,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=k,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
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GRAPH_DEFAULT_CATEGORY_STYLE = exports.PortDirection = exports.GraphKeys = void 0;
3
+ exports.GRAPH_DEFAULT_CATEGORY_STYLE = exports.GRAPH_VISUAL_STATE_STYLES = exports.PortDirection = exports.GraphKeys = void 0;
4
+ exports.graphVisualStyleOf = graphVisualStyleOf;
4
5
  exports.registerGraphCategoryStyle = registerGraphCategoryStyle;
5
6
  exports.graphCategoryStyleOf = graphCategoryStyleOf;
6
7
  exports.resolveEffectiveColor = resolveEffectiveColor;
@@ -16,6 +17,32 @@ exports.resolveEffectiveIcon = resolveEffectiveIcon;
16
17
  PortDirection["OUTPUT"] = "output";
17
18
  PortDirection["CONNECTION"] = "connection";
18
19
  })(exports.PortDirection || (exports.PortDirection = {}));
20
+ /**
21
+ * The default visual-state → overlay mapping contract (DECAF-48 §4.4):
22
+ * running=faded green, blocked=yellow, errored=red; succeeded keeps the
23
+ * node's own accent; unexecuted-after-failure fades/disabled. This is the
24
+ * shared, framework-neutral source of truth that supersedes the DECAF-32
25
+ * §21.9 running colour for the live run-feedback overlay (§4.5).
26
+ */
27
+ exports.GRAPH_VISUAL_STATE_STYLES = {
28
+ idle: { opacity: 1 },
29
+ running: { glow: "#22c55e", opacity: 0.85 },
30
+ blocked: { glow: "#eab308", opacity: 0.85 },
31
+ succeeded: { opacity: 1 },
32
+ failed: { glow: "#ef4444", opacity: 1 },
33
+ skipped: { opacity: 0.35 },
34
+ };
35
+ /**
36
+ * Resolves the visual style overlay for a node/edge execution state, falling
37
+ * back to a neutral default when the state is unknown or unregistered.
38
+ *
39
+ * @param state - The visual state string (as defined by the shared
40
+ * `GraphVisualState` values, e.g. `"running"`, `"blocked"`).
41
+ * @returns The style overlay for the given state.
42
+ */
43
+ function graphVisualStyleOf(state) {
44
+ return exports.GRAPH_VISUAL_STATE_STYLES[state] ?? exports.GRAPH_VISUAL_STATE_STYLES.idle;
45
+ }
19
46
  /**
20
47
  * Registry mapping category names to their default style (color + icon).
21
48
  * Consumers register categories via {@link registerGraphCategoryStyle}.
@@ -1 +1 @@
1
- {"version":3,"file":"graph/constants.cjs","sourceRoot":"","sources":["graph/constants.js"],"names":[],"mappings":";;;AAmCA,gEAEC;AAID,oDAKC;AAKD,sDAIC;AAKD,oDAIC;AA/DD,CAAC,UAAU,SAAS;IAChB,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAC7B,SAAS,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC;IACjC,SAAS,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC;IACjC,SAAS,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC;AACrC,CAAC,CAAC,CAAC,iBAAS,IAAI,CAAC,iBAAS,GAAG,EAAE,CAAC,CAAC,CAAC;AAElC,CAAC,UAAU,aAAa;IACpB,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACjC,aAAa,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IACnC,aAAa,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;AAC/C,CAAC,CAAC,CAAC,qBAAa,IAAI,CAAC,qBAAa,GAAG,EAAE,CAAC,CAAC,CAAC;AAC1C;;;;;;;GAOG;AACH,MAAM,6BAA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CAAC;QACtD,OAAO,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,oCAA4B,CAAC;AACxC,CAAC;AACD;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,aAAa,EAAE,QAAQ;IACzD,IAAI,aAAa;QACb,OAAO,aAAa,CAAC;IACzB,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;AAChD,CAAC;AACD;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,YAAY,EAAE,QAAQ;IACvD,IAAI,YAAY;QACZ,OAAO,YAAY,CAAC;IACxB,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC,IAAI,IAAI,oCAA4B,CAAC,IAAI,CAAC;AACpF,CAAC;AACD,qCAAqC"}
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.11";
36
+ exports.VERSION = "0.18.0";
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 = "bcc23e4";
43
+ exports.COMMIT = "23dcb33";
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.11-bcc23e4";
50
+ exports.FULL_VERSION = "0.18.0-23dcb33";
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
@@ -0,0 +1,190 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserRequestHandler = void 0;
4
+ /**
5
+ * @module ui-decorators/user-requests/UserRequestHandler
6
+ * @summary Service-based base class for user request handlers.
7
+ * @description No Angular or DOM imports — safe for pure-Node (backend) bundles.
8
+ *
9
+ * Handlers extend `Service`, receive a rendering-engine facade as a
10
+ * `protected readonly` property and implement `handle`, either returning the
11
+ * resolved value or throwing (a `CancelledError` when the user cancels
12
+ * mid-request). Lookup and dispatch are static: `@userRequest(reference)`
13
+ * records the class as metadata and `UserRequestHandler.getHandler(reference)`
14
+ * / `UserRequestHandler.handle(request, renderingEngine)` resolve and run it,
15
+ * so no process-wide registry instance is needed.
16
+ */
17
+ const core_1 = require("@decaf-ts/core");
18
+ const decoration_1 = require("@decaf-ts/decoration");
19
+ const db_decorators_1 = require("@decaf-ts/db-decorators");
20
+ const constants_js_1 = require("./constants.cjs");
21
+ const errors_js_1 = require("./errors.cjs");
22
+ /**
23
+ * @description Abstract base class for user request handlers.
24
+ *
25
+ * Handler methods follow the core `Service` golden rules: `handle` (and the
26
+ * lifecycle helpers `getInput`/`cancel`) accept rest contextual args
27
+ * (`...args: ContextualArgs<C>`) and obtain their `{ log, ctx, ctxArgs }` via
28
+ * `this.logCtx([request, ...args], this.handle, true)` — entry and resolution
29
+ * via `log.info`, transitions via `log.verbose`, payload details via
30
+ * `log.debug` and failures/cancellations via `log.error`. A `CancelledError`
31
+ * is thrown when the user cancels mid-request. `handle` is the one async
32
+ * method handlers override, returning the resolved value or throwing.
33
+ * @summary Service-based base class implementing the user request lifecycle.
34
+ * @template T The resolved payload type the handler returns.
35
+ * @template C The decaf context the service runs under.
36
+ */
37
+ class UserRequestHandler extends core_1.Service {
38
+ /**
39
+ * @description Creates a handler bound to the given rendering-engine facade.
40
+ * The facade is the only external dependency: no context/resolver
41
+ * indirection.
42
+ * @param {RenderingFacade} renderingEngine The rendering-engine surface the
43
+ * handler drives (modal, toast, spinner and router).
44
+ */
45
+ constructor(renderingEngine) {
46
+ super();
47
+ this.renderingEngine = renderingEngine;
48
+ this.cancelled = false;
49
+ }
50
+ /**
51
+ * @description Resolves the handler class registered for the given request
52
+ * reference via `Metadata`. Handlers are recorded by the `@userRequest`
53
+ * decorator under `USER_REQUEST_KEY`.
54
+ * @param {string} reference The request id/type the handler is registered
55
+ * for.
56
+ * @return {.Constructor<UserRequestHandler> | undefined}
57
+ * The registered handler constructor, or `undefined` when unknown.
58
+ */
59
+ static getHandler(reference) {
60
+ return decoration_1.Metadata.get(constants_js_1.USER_REQUEST_KEY, reference);
61
+ }
62
+ /**
63
+ * @description Reads the `@userRequest` metadata recorded on a handler class
64
+ * via `Metadata`.
65
+ * @param {object} target The handler class to inspect.
66
+ * @return {UserRequestHandlerMetadata | undefined} The recorded metadata
67
+ * `{ reference }`, or `undefined` when the class is not decorated.
68
+ */
69
+ static getMetadata(target) {
70
+ return decoration_1.Metadata.get(target, constants_js_1.USER_REQUEST_KEY);
71
+ }
72
+ static async handle(request, renderingEngine) {
73
+ const id = request.type || request.id;
74
+ const Handler = UserRequestHandler.getHandler(id);
75
+ if (!Handler)
76
+ throw new db_decorators_1.InternalError(`No user request handler registered for "${id}"`);
77
+ const instance = new Handler(renderingEngine);
78
+ const ctx = await instance.context("user-request", {});
79
+ return instance.handle(request, ctx);
80
+ }
81
+ async getInput(request, ...args) {
82
+ const { log } = await this.logCtx([request, ...args], this.getInput, true);
83
+ const component = { props: { request } };
84
+ log.info(`Requesting input for user request "${request.type || request.id}"`);
85
+ const modal = await this.renderingEngine.getModal(component);
86
+ this.currentModal = modal;
87
+ if (this.cancelled) {
88
+ this.currentModal = undefined;
89
+ await modal.cancel();
90
+ log.error(`User request "${request.type || request.id}" was cancelled`);
91
+ throw new errors_js_1.CancelledError(`User request "${request.type || request.id}" was cancelled`);
92
+ }
93
+ return this.awaitDismissal(request, modal);
94
+ }
95
+ awaitDismissal(request, modal) {
96
+ return new Promise((resolve, reject) => {
97
+ this.submitted = resolve;
98
+ this.dismissed = reject;
99
+ const confirm = modal.confirm.bind(modal);
100
+ const cancel = modal.cancel.bind(modal);
101
+ modal.confirm = async (event) => {
102
+ try {
103
+ await confirm(event);
104
+ this.currentModal = undefined;
105
+ const data = (event?.data ?? event);
106
+ resolve(data);
107
+ }
108
+ catch (error) {
109
+ // A facade confirms with an error payload (e.g. a `ValidationError`
110
+ // from an invalid form submission) by throwing it out of `confirm`;
111
+ // reject the pending request with that decaf error instead of
112
+ // leaving it hanging.
113
+ this.currentModal = undefined;
114
+ reject(error);
115
+ }
116
+ };
117
+ modal.cancel = async () => {
118
+ await cancel();
119
+ this.currentModal = undefined;
120
+ reject(new errors_js_1.CancelledError(`User request "${request.type || request.id}" was cancelled`));
121
+ };
122
+ });
123
+ }
124
+ async cancel(...args) {
125
+ const { log } = await this.logCtx(args, this.cancel, true);
126
+ log.info("Cancelling active user request");
127
+ this.cancelled = true;
128
+ const modal = this.currentModal;
129
+ this.currentModal = undefined;
130
+ if (this.dismissed) {
131
+ log.verbose("Rejecting pending user request with CancelledError");
132
+ this.dismissed(new errors_js_1.CancelledError("User request was cancelled"));
133
+ this.dismissed = undefined;
134
+ this.submitted = undefined;
135
+ }
136
+ if (modal) {
137
+ log.debug("Dismissing the active user request modal");
138
+ await modal.cancel();
139
+ }
140
+ log.error("User request cancelled");
141
+ }
142
+ logCtx(args, operation, allowCreate = false, overrides) {
143
+ const base = super.logCtx(args, operation, allowCreate, overrides);
144
+ if (base instanceof Promise) {
145
+ return (async () => this.wrapLogContext(await base))();
146
+ }
147
+ return this.wrapLogContext(base);
148
+ }
149
+ /**
150
+ * @description Decorates the base contextual surface with the rendering
151
+ * engine methods exposed as `modal`/`toast`/`spinner`/`router` bound getters.
152
+ * @return {UserRequestLogContext<C, ARGS>} The decorated contextual surface.
153
+ * @template C The decaf context the service runs under.
154
+ * @template ARGS The contextual argument tuple passed to the call.
155
+ */
156
+ wrapLogContext(base) {
157
+ const engine = this.renderingEngine;
158
+ const result = {
159
+ log: base.log,
160
+ ctx: base.ctx,
161
+ ctxArgs: base.ctxArgs,
162
+ };
163
+ Object.defineProperties(result, {
164
+ modal: {
165
+ get: () => engine.getModal.bind(engine),
166
+ enumerable: true,
167
+ configurable: true,
168
+ },
169
+ toast: {
170
+ get: () => engine.getToast.bind(engine),
171
+ enumerable: true,
172
+ configurable: true,
173
+ },
174
+ spinner: {
175
+ get: () => engine.getSpinner.bind(engine),
176
+ enumerable: true,
177
+ configurable: true,
178
+ },
179
+ router: {
180
+ get: () => engine.router.bind(engine),
181
+ enumerable: true,
182
+ configurable: true,
183
+ },
184
+ });
185
+ return result;
186
+ }
187
+ }
188
+ exports.UserRequestHandler = UserRequestHandler;
189
+ //# sourceMappingURL=UserRequestHandler.js.map
190
+ //# sourceMappingURL=UserRequestHandler.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-requests/UserRequestHandler.cjs","sourceRoot":"","sources":["user-requests/UserRequestHandler.js"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,yCAA0C;AAC1C,qDAAgD;AAChD,2DAAwD;AACxD,iDAAkD;AAClD,2CAA6C;AAC7C;;;;;;;;;;;;;;GAcG;AACH,MAAa,kBAAmB,SAAQ,cAAO;IAC3C;;;;;;OAMG;IACH,YAAY,eAAe;QACvB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IACD;;;;;;;;OAQG;IACH,MAAM,CAAC,UAAU,CAAC,SAAS;QACvB,OAAO,qBAAQ,CAAC,GAAG,CAAC,+BAAgB,EAAE,SAAS,CAAC,CAAC;IACrD,CAAC;IACD;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,MAAM;QACrB,OAAO,qBAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,+BAAgB,CAAC,CAAC;IAClD,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,eAAe;QACxC,MAAM,EAAE,GAAG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AC;IACD;;;;;;OAMG;IACH,cAAc,CAAC,IAAI;QACf,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;QACpC,MAAM,MAAM,GAAG;YACX,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,OAAO,EAAE,IAAI,CAAC,OAAO;SACxB,CAAC;QACF,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE;YAC5B,KAAK,EAAE;gBACH,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;gBACvC,UAAU,EAAE,IAAI;gBAChB,YAAY,EAAE,IAAI;aACrB;YACD,KAAK,EAAE;gBACH,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;gBACvC,UAAU,EAAE,IAAI;gBAChB,YAAY,EAAE,IAAI;aACrB;YACD,OAAO,EAAE;gBACL,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;gBACzC,UAAU,EAAE,IAAI;gBAChB,YAAY,EAAE,IAAI;aACrB;YACD,MAAM,EAAE;gBACJ,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;gBACrC,UAAU,EAAE,IAAI;gBAChB,YAAY,EAAE,IAAI;aACrB;SACJ,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAtJD,gDAsJC;AACD,8CAA8C"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USER_REQUEST_KEY = void 0;
4
+ /**
5
+ * @module ui-decorators/user-requests/constants
6
+ * @summary Metadata keys for the User Request Resolution Engine.
7
+ */
8
+ /**
9
+ * @description Metadata key under which user request handlers are registered
10
+ * and resolved.
11
+ * @summary The `@userRequest(reference)` decorator stores both the handler
12
+ * reference and the decorating metadata under this key, and
13
+ * `UserRequestHandler.getHandler` / `UserRequestHandler.getMetadata` read it
14
+ * back. The key is scoped to the User Request Resolution Engine to avoid
15
+ * colliding with other reflection metadata.
16
+ * @const USER_REQUEST_KEY
17
+ * @type {string}
18
+ * @readonly
19
+ */
20
+ exports.USER_REQUEST_KEY = "user-requests.handler";
21
+ //# sourceMappingURL=constants.js.map
22
+ //# sourceMappingURL=constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-requests/constants.cjs","sourceRoot":"","sources":["user-requests/constants.js"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH;;;;;;;;;;;GAWG;AACU,QAAA,gBAAgB,GAAG,uBAAuB,CAAC;AACxD,qCAAqC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.userRequest = userRequest;
4
+ /**
5
+ * @module ui-decorators/user-requests/decorators
6
+ * @summary `@userRequest(reference)` class decorator.
7
+ * @description No Angular or DOM imports — safe for pure-Node (backend)
8
+ * bundles. Registration is metadata-based: the decorator records the handler
9
+ * class under `USER_REQUEST_KEY` and the static `UserRequestHandler` methods
10
+ * resolve and dispatch it, so no process-wide registry is involved.
11
+ */
12
+ const decoration_1 = require("@decaf-ts/decoration");
13
+ const constants_js_1 = require("./constants.cjs");
14
+ /**
15
+ * @description Registers a handler class for the given request id/type.
16
+ *
17
+ * Mirrors `core/src/migrations/decorators.ts`:
18
+ * `Decoration.for(KEY).define({ decorator, args }).apply()` plus
19
+ * `Metadata.set(USER_REQUEST_KEY, reference, original)` so the class is
20
+ * retrievable by id via metadata — `UserRequestHandler.getHandler(reference)`
21
+ * reads it back and `UserRequestHandler.handle(request, renderingEngine)`
22
+ * dispatches it — and a class-level `metadata(...)` payload for
23
+ * introspection (`UserRequestHandler.getMetadata(target)`).
24
+ * @param {string} reference The request id/type the handler is registered for.
25
+ * @return {ClassDecorator} The class decorator to apply.
26
+ */
27
+ function userRequest(reference) {
28
+ function innerUserRequest(ref) {
29
+ return function userRequestDecorator(target) {
30
+ const constructor = target;
31
+ const meta = { reference: ref };
32
+ decoration_1.Metadata.set(constants_js_1.USER_REQUEST_KEY, ref, constructor);
33
+ return (0, decoration_1.metadata)(constants_js_1.USER_REQUEST_KEY, meta)(constructor);
34
+ };
35
+ }
36
+ return decoration_1.Decoration.for(constants_js_1.USER_REQUEST_KEY)
37
+ .define({ decorator: innerUserRequest, args: [reference] })
38
+ .apply();
39
+ }
40
+ //# sourceMappingURL=decorators.js.map
41
+ //# sourceMappingURL=decorators.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-requests/decorators.cjs","sourceRoot":"","sources":["user-requests/decorators.js"],"names":[],"mappings":";;AAuBA,kCAYC;AAnCD;;;;;;;GAOG;AACH,qDAAuE;AACvE,iDAAkD;AAClD;;;;;;;;;;;;GAYG;AACH,SAAgB,WAAW,CAAC,SAAS;IACjC,SAAS,gBAAgB,CAAC,GAAG;QACzB,OAAO,SAAS,oBAAoB,CAAC,MAAM;YACvC,MAAM,WAAW,GAAG,MAAM,CAAC;YAC3B,MAAM,IAAI,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;YAChC,qBAAQ,CAAC,GAAG,CAAC,+BAAgB,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC;YACjD,OAAO,IAAA,qBAAQ,EAAC,+BAAgB,EAAE,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC;QACzD,CAAC,CAAC;IACN,CAAC;IACD,OAAO,uBAAU,CAAC,GAAG,CAAC,+BAAgB,CAAC;SAClC,MAAM,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;SAC1D,KAAK,EAAE,CAAC;AACjB,CAAC;AACD,sCAAsC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CancelledError = void 0;
4
+ /**
5
+ * @module ui-decorators/user-requests/errors
6
+ * @summary Decaf error hierarchy for the User Request Resolution Engine.
7
+ */
8
+ const db_decorators_1 = require("@decaf-ts/db-decorators");
9
+ /**
10
+ * @description Error thrown when the user cancels a user request mid-resolution.
11
+ * Follows the decaf error hierarchy: never a raw `Error`. Compatible with the
12
+ * validation error signaling used by `@devcerts/decaf` UI facades.
13
+ * @summary Error thrown when a user request is cancelled.
14
+ */
15
+ class CancelledError extends db_decorators_1.InternalError {
16
+ /**
17
+ * @param {string | Error | unknown} msg The cancellation message.
18
+ * @return {CancelledError} A new `CancelledError`.
19
+ */
20
+ constructor(msg = "User request cancelled") {
21
+ super(msg, CancelledError.name, 400);
22
+ }
23
+ }
24
+ exports.CancelledError = CancelledError;
25
+ //# sourceMappingURL=errors.js.map
26
+ //# sourceMappingURL=errors.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-requests/errors.cjs","sourceRoot":"","sources":["user-requests/errors.js"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2DAAwD;AACxD;;;;;GAKG;AACH,MAAa,cAAe,SAAQ,6BAAa;IAC7C;;;OAGG;IACH,YAAY,GAAG,GAAG,wBAAwB;QACtC,KAAK,CAAC,GAAG,EAAE,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;CACJ;AARD,wCAQC;AACD,kCAAkC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * @module ui-decorators/user-requests
19
+ * @summary Backend binding surface for the User Request Resolution Engine.
20
+ * @description Framework-agnostic core of the engine: no Angular or DOM
21
+ * imports, safe for pure-Node (backend) bundles. Handlers are registered via
22
+ * `@userRequest(reference)` (metadata) and resolved/dispatched through the
23
+ * static `UserRequestHandler` methods; example handlers and rendering-engine
24
+ * mocks live only in the test tree, never under `src`. Frontend bindings live
25
+ * in `for-angular`.
26
+ */
27
+ __exportStar(require("./constants.cjs"), exports);
28
+ __exportStar(require("./errors.cjs"), exports);
29
+ __exportStar(require("./types.cjs"), exports);
30
+ __exportStar(require("./UserRequestHandler.cjs"), exports);
31
+ __exportStar(require("./decorators.cjs"), exports);
32
+ //# sourceMappingURL=index.js.map
33
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-requests/index.cjs","sourceRoot":"","sources":["user-requests/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;GASG;AACH,iDAA+B;AAC/B,8CAA4B;AAC5B,6CAA2B;AAC3B,0DAAwC;AACxC,kDAAgC;AAChC,iCAAiC"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
4
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-requests/types.cjs","sourceRoot":"","sources":["user-requests/types.js"],"names":[],"mappings":";;AAOA,iCAAiC"}
@@ -11,6 +11,32 @@ export var PortDirection;
11
11
  PortDirection["OUTPUT"] = "output";
12
12
  PortDirection["CONNECTION"] = "connection";
13
13
  })(PortDirection || (PortDirection = {}));
14
+ /**
15
+ * The default visual-state → overlay mapping contract (DECAF-48 §4.4):
16
+ * running=faded green, blocked=yellow, errored=red; succeeded keeps the
17
+ * node's own accent; unexecuted-after-failure fades/disabled. This is the
18
+ * shared, framework-neutral source of truth that supersedes the DECAF-32
19
+ * §21.9 running colour for the live run-feedback overlay (§4.5).
20
+ */
21
+ export const GRAPH_VISUAL_STATE_STYLES = {
22
+ idle: { opacity: 1 },
23
+ running: { glow: "#22c55e", opacity: 0.85 },
24
+ blocked: { glow: "#eab308", opacity: 0.85 },
25
+ succeeded: { opacity: 1 },
26
+ failed: { glow: "#ef4444", opacity: 1 },
27
+ skipped: { opacity: 0.35 },
28
+ };
29
+ /**
30
+ * Resolves the visual style overlay for a node/edge execution state, falling
31
+ * back to a neutral default when the state is unknown or unregistered.
32
+ *
33
+ * @param state - The visual state string (as defined by the shared
34
+ * `GraphVisualState` values, e.g. `"running"`, `"blocked"`).
35
+ * @returns The style overlay for the given state.
36
+ */
37
+ export function graphVisualStyleOf(state) {
38
+ return GRAPH_VISUAL_STATE_STYLES[state] ?? GRAPH_VISUAL_STATE_STYLES.idle;
39
+ }
14
40
  /**
15
41
  * Registry mapping category names to their default style (color + icon).
16
42
  * Consumers register categories via {@link registerGraphCategoryStyle}.
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/graph/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,gCAAgC,CAAA;IAChC,gCAAgC,CAAA;IAChC,gCAAgC,CAAA;AAClC,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAED,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,kCAAiB,CAAA;IACjB,0CAAyB,CAAA;AAC3B,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAoMD;;;;;;;GAOG;AACH,MAAM,6BAA6B,GAAuC,EAAE,CAAC;AAE7E;;;GAGG;AACH,MAAM,CAAC,MA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AC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,YAAqB,EACrB,QAAiB;IAEjB,IAAI,YAAY;QAAE,OAAO,YAAY,CAAC;IACtC,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC,IAAI,IAAI,4BAA4B,CAAC,IAAK,CAAC;AACnF,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.11";
19
+ export const VERSION = "0.18.0";
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 = "bcc23e4";
26
+ export const COMMIT = "23dcb33";
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.11-bcc23e4";
33
+ export const FULL_VERSION = "0.18.0-23dcb33";
34
34
  export const PACKAGE_NAME = "@decaf-ts/ui-decorators";
35
35
  Metadata.registerLibrary(PACKAGE_NAME, VERSION);
36
36
  //# sourceMappingURL=index.js.map