@golemui/gui-shared 1.1.1-rc.0 → 1.1.1-rc.2

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 (162) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/index.js +23 -366
  3. package/index.umd.cjs +1 -1
  4. package/internals.js +162 -757
  5. package/internals.umd.cjs +1 -1
  6. package/lib/dx/__tests__/helpers.d.ts +1 -1
  7. package/lib/dx/formDef.domain.d.ts +8 -33
  8. package/lib/dx/formDefs.d.ts +7 -0
  9. package/lib/dx/gui.d.ts +281 -52
  10. package/lib/dx/guiDependencyTypes.d.ts +14 -0
  11. package/lib/dx/index.d.ts +12 -11
  12. package/lib/dx/registry.d.ts +26 -0
  13. package/lib/dx/resolveFormInput.d.ts +7 -20
  14. package/lib/dx/shortcuts/accordion/accordion.domain.d.ts +1 -3
  15. package/lib/dx/shortcuts/accordion/guiAccordion.impl.d.ts +1 -1
  16. package/lib/dx/shortcuts/accordion/register.d.ts +4 -2
  17. package/lib/dx/shortcuts/actions/actions.domain.d.ts +1 -2
  18. package/lib/dx/shortcuts/actions/guiActions.impl.d.ts +1 -1
  19. package/lib/dx/shortcuts/actions/register.d.ts +3 -1
  20. package/lib/dx/shortcuts/alert/alert.domain.d.ts +1 -2
  21. package/lib/dx/shortcuts/alert/guiAlert.impl.d.ts +1 -1
  22. package/lib/dx/shortcuts/alert/register.d.ts +4 -2
  23. package/lib/dx/shortcuts/calendar/calendar.domain.d.ts +1 -3
  24. package/lib/dx/shortcuts/calendar/guiCalendar.impl.d.ts +1 -1
  25. package/lib/dx/shortcuts/calendar/register.d.ts +4 -2
  26. package/lib/dx/shortcuts/checkbox/checkbox.domain.d.ts +1 -3
  27. package/lib/dx/shortcuts/checkbox/guiCheckbox.impl.d.ts +1 -1
  28. package/lib/dx/shortcuts/checkbox/register.d.ts +4 -2
  29. package/lib/dx/shortcuts/currency/currency.domain.d.ts +1 -3
  30. package/lib/dx/shortcuts/currency/guiCurrency.impl.d.ts +1 -1
  31. package/lib/dx/shortcuts/currency/register.d.ts +4 -2
  32. package/lib/dx/shortcuts/custom-action/customAction.domain.d.ts +1 -2
  33. package/lib/dx/shortcuts/custom-action/guiCustomAction.impl.d.ts +1 -1
  34. package/lib/dx/shortcuts/custom-action/register.d.ts +4 -2
  35. package/lib/dx/shortcuts/custom-display/customDisplay.domain.d.ts +1 -2
  36. package/lib/dx/shortcuts/custom-display/guiCustomDisplay.impl.d.ts +1 -1
  37. package/lib/dx/shortcuts/custom-display/register.d.ts +4 -2
  38. package/lib/dx/shortcuts/custom-input/customInput.domain.d.ts +1 -2
  39. package/lib/dx/shortcuts/custom-input/guiCustomInput.impl.d.ts +1 -1
  40. package/lib/dx/shortcuts/custom-input/register.d.ts +4 -2
  41. package/lib/dx/shortcuts/custom-layout/customLayout.domain.d.ts +1 -3
  42. package/lib/dx/shortcuts/custom-layout/guiCustomLayout.impl.d.ts +1 -2
  43. package/lib/dx/shortcuts/custom-layout/register.d.ts +4 -2
  44. package/lib/dx/shortcuts/date-input/dateInput.domain.d.ts +1 -3
  45. package/lib/dx/shortcuts/date-input/guiDateInput.impl.d.ts +1 -1
  46. package/lib/dx/shortcuts/date-input/register.d.ts +4 -2
  47. package/lib/dx/shortcuts/date-picker/datePicker.domain.d.ts +1 -3
  48. package/lib/dx/shortcuts/date-picker/guiDatePicker.impl.d.ts +1 -1
  49. package/lib/dx/shortcuts/date-picker/register.d.ts +4 -2
  50. package/lib/dx/shortcuts/date-time-calendar/dateTimeCalendar.domain.d.ts +1 -3
  51. package/lib/dx/shortcuts/date-time-calendar/guiDateTimeCalendar.impl.d.ts +1 -1
  52. package/lib/dx/shortcuts/date-time-calendar/register.d.ts +4 -2
  53. package/lib/dx/shortcuts/date-time-input/dateTimeInput.domain.d.ts +1 -3
  54. package/lib/dx/shortcuts/date-time-input/guiDateTimeInput.impl.d.ts +1 -1
  55. package/lib/dx/shortcuts/date-time-input/register.d.ts +4 -2
  56. package/lib/dx/shortcuts/date-time-picker/dateTimePicker.domain.d.ts +1 -3
  57. package/lib/dx/shortcuts/date-time-picker/guiDateTimePicker.impl.d.ts +1 -1
  58. package/lib/dx/shortcuts/date-time-picker/register.d.ts +4 -2
  59. package/lib/dx/shortcuts/display/display.domain.d.ts +1 -2
  60. package/lib/dx/shortcuts/display/guiDisplay.impl.d.ts +1 -1
  61. package/lib/dx/shortcuts/display/register.d.ts +4 -2
  62. package/lib/dx/shortcuts/dropdown/dropdown.domain.d.ts +1 -2
  63. package/lib/dx/shortcuts/dropdown/guiDropdown.impl.d.ts +1 -1
  64. package/lib/dx/shortcuts/dropdown/register.d.ts +4 -2
  65. package/lib/dx/shortcuts/inputs/gslInputSubtypes.d.ts +3 -3
  66. package/lib/dx/shortcuts/inputs/guiBooleanInput.impl.d.ts +1 -1
  67. package/lib/dx/shortcuts/inputs/guiNumberInput.impl.d.ts +1 -1
  68. package/lib/dx/shortcuts/inputs/guiTextInput.impl.d.ts +1 -1
  69. package/lib/dx/shortcuts/inputs/inputSensibleDefaults.service.d.ts +1 -1
  70. package/lib/dx/shortcuts/inputs/inputs.domain.d.ts +1 -3
  71. package/lib/dx/shortcuts/inputs/register.d.ts +4 -2
  72. package/lib/dx/shortcuts/layouts/guiFlex.impl.d.ts +1 -1
  73. package/lib/dx/shortcuts/layouts/layouts.domain.d.ts +1 -3
  74. package/lib/dx/shortcuts/layouts/register.d.ts +4 -2
  75. package/lib/dx/shortcuts/list/guiList.impl.d.ts +1 -1
  76. package/lib/dx/shortcuts/list/list.domain.d.ts +1 -2
  77. package/lib/dx/shortcuts/list/register.d.ts +4 -2
  78. package/lib/dx/shortcuts/markdown/guiMarkdown.impl.d.ts +1 -1
  79. package/lib/dx/shortcuts/markdown/markdown.domain.d.ts +1 -3
  80. package/lib/dx/shortcuts/markdown/register.d.ts +4 -2
  81. package/lib/dx/shortcuts/markdown-text/guiMarkdownText.impl.d.ts +1 -1
  82. package/lib/dx/shortcuts/markdown-text/markdownText.domain.d.ts +1 -2
  83. package/lib/dx/shortcuts/markdown-text/register.d.ts +4 -2
  84. package/lib/dx/shortcuts/password/guiPassword.impl.d.ts +1 -1
  85. package/lib/dx/shortcuts/password/password.domain.d.ts +1 -3
  86. package/lib/dx/shortcuts/password/register.d.ts +4 -2
  87. package/lib/dx/shortcuts/radiogroup/guiRadiogroup.impl.d.ts +1 -1
  88. package/lib/dx/shortcuts/radiogroup/radiogroup.domain.d.ts +1 -2
  89. package/lib/dx/shortcuts/radiogroup/register.d.ts +4 -2
  90. package/lib/dx/shortcuts/range-calendar/guiRangeCalendar.impl.d.ts +1 -1
  91. package/lib/dx/shortcuts/range-calendar/rangeCalendar.domain.d.ts +1 -3
  92. package/lib/dx/shortcuts/range-calendar/register.d.ts +4 -2
  93. package/lib/dx/shortcuts/range-date-input/guiRangeDateInput.impl.d.ts +1 -1
  94. package/lib/dx/shortcuts/range-date-input/rangeDateInput.domain.d.ts +1 -3
  95. package/lib/dx/shortcuts/range-date-input/register.d.ts +4 -2
  96. package/lib/dx/shortcuts/range-date-picker/guiRangeDatePicker.impl.d.ts +1 -1
  97. package/lib/dx/shortcuts/range-date-picker/rangeDatePicker.domain.d.ts +1 -3
  98. package/lib/dx/shortcuts/range-date-picker/register.d.ts +4 -2
  99. package/lib/dx/shortcuts/range-date-time-calendar/guiRangeDateTimeCalendar.impl.d.ts +1 -1
  100. package/lib/dx/shortcuts/range-date-time-calendar/rangeDateTimeCalendar.domain.d.ts +1 -3
  101. package/lib/dx/shortcuts/range-date-time-calendar/register.d.ts +4 -2
  102. package/lib/dx/shortcuts/range-date-time-input/guiRangeDateTimeInput.impl.d.ts +1 -1
  103. package/lib/dx/shortcuts/range-date-time-input/rangeDateTimeInput.domain.d.ts +1 -3
  104. package/lib/dx/shortcuts/range-date-time-input/register.d.ts +4 -2
  105. package/lib/dx/shortcuts/range-date-time-picker/guiRangeDateTimePicker.impl.d.ts +1 -1
  106. package/lib/dx/shortcuts/range-date-time-picker/rangeDateTimePicker.domain.d.ts +1 -3
  107. package/lib/dx/shortcuts/range-date-time-picker/register.d.ts +4 -2
  108. package/lib/dx/shortcuts/range-time-input/guiRangeTimeInput.impl.d.ts +1 -1
  109. package/lib/dx/shortcuts/range-time-input/rangeTimeInput.domain.d.ts +1 -3
  110. package/lib/dx/shortcuts/range-time-input/register.d.ts +4 -2
  111. package/lib/dx/shortcuts/range-time-picker/guiRangeTimePicker.impl.d.ts +1 -1
  112. package/lib/dx/shortcuts/range-time-picker/rangeTimePicker.domain.d.ts +1 -3
  113. package/lib/dx/shortcuts/range-time-picker/register.d.ts +4 -2
  114. package/lib/dx/shortcuts/repeater/guiRepeater.impl.d.ts +1 -1
  115. package/lib/dx/shortcuts/repeater/register.d.ts +5 -3
  116. package/lib/dx/shortcuts/repeater/repeater.domain.d.ts +1 -4
  117. package/lib/dx/shortcuts/scopes/gslStates.impl.d.ts +1 -1
  118. package/lib/dx/shortcuts/scopes/gslTag.impl.d.ts +1 -1
  119. package/lib/dx/shortcuts/select/guiSelect.impl.d.ts +1 -1
  120. package/lib/dx/shortcuts/select/register.d.ts +4 -2
  121. package/lib/dx/shortcuts/select/select.domain.d.ts +1 -2
  122. package/lib/dx/shortcuts/tabs/guiTabs.impl.d.ts +1 -1
  123. package/lib/dx/shortcuts/tabs/register.d.ts +4 -2
  124. package/lib/dx/shortcuts/tabs/tabs.domain.d.ts +1 -3
  125. package/lib/dx/shortcuts/tags/guiTags.impl.d.ts +1 -1
  126. package/lib/dx/shortcuts/tags/register.d.ts +4 -2
  127. package/lib/dx/shortcuts/tags/tags.domain.d.ts +1 -3
  128. package/lib/dx/shortcuts/textarea/guiTextarea.impl.d.ts +1 -1
  129. package/lib/dx/shortcuts/textarea/register.d.ts +4 -2
  130. package/lib/dx/shortcuts/textarea/textarea.domain.d.ts +1 -3
  131. package/lib/dx/shortcuts/time-input/guiTimeInput.impl.d.ts +1 -1
  132. package/lib/dx/shortcuts/time-input/register.d.ts +4 -2
  133. package/lib/dx/shortcuts/time-input/timeInput.domain.d.ts +1 -3
  134. package/lib/dx/shortcuts/time-picker/guiTimePicker.impl.d.ts +1 -1
  135. package/lib/dx/shortcuts/time-picker/register.d.ts +4 -2
  136. package/lib/dx/shortcuts/time-picker/timePicker.domain.d.ts +1 -3
  137. package/lib/shared.d.ts +3 -0
  138. package/lib/widgets.d.ts +1 -1
  139. package/package.json +7 -3
  140. package/{register-De8Y1vW5.js → resolveFormInput-CsFeoGjz.js} +1402 -1387
  141. package/resolveFormInput-UcmQ-kme.cjs +1 -0
  142. package/lib/dx/core/defineShortcutType.d.ts +0 -39
  143. package/lib/dx/core/dx.domain.d.ts +0 -79
  144. package/lib/dx/core/dxBase.types.d.ts +0 -128
  145. package/lib/dx/core/dxPropsHelper.d.ts +0 -9
  146. package/lib/dx/core/dxUtilityTypes.d.ts +0 -40
  147. package/lib/dx/core/dxValidatorHelper.d.ts +0 -31
  148. package/lib/dx/core/eventWiring.service.d.ts +0 -34
  149. package/lib/dx/core/itemTypeRegistry.d.ts +0 -94
  150. package/lib/dx/core/itemWalker.service.d.ts +0 -31
  151. package/lib/dx/core/selectorNormalizer.service.d.ts +0 -15
  152. package/lib/dx/core/selectorResolver.service.d.ts +0 -11
  153. package/lib/dx/core/sharedSensibleDefaults.service.d.ts +0 -35
  154. package/lib/dx/core/stateExpansion.service.d.ts +0 -31
  155. package/lib/dx/core/widgetMapper.service.d.ts +0 -13
  156. package/lib/dx/core/widgetMerger.service.d.ts +0 -14
  157. package/lib/dx/core/withForm.d.ts +0 -8
  158. package/lib/dx/dx.service.d.ts +0 -36
  159. package/lib/dx/registerAll.d.ts +0 -0
  160. package/lib/dx/shortcuts/scopes/scopeChain.d.ts +0 -132
  161. package/lib/utils/objectUtils.service.d.ts +0 -11
  162. package/register-B3CJMfX9.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";const i=require("@golemui/dx");require("@golemui/core");function hi(e){switch(e.type){case"text":return Ei(e);case"number":return Pi(e);case"boolean":return ki(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function ki(e){const t=i.extractWidgetProps(e);return{uid:e.uid??"",kind:"input",type:"toggle",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"boolean")}:{},props:t}}function Ei(e){const t=i.extractWidgetProps(e);return{uid:e.uid??"",kind:"input",type:"textinput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:i.buildTypedValidator(e.validator,"string")}}function Pi(e){const t=i.extractWidgetProps(e);return{uid:e.uid??"",kind:"input",type:"number",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:i.buildTypedValidator(e.validator,"number")}}const _=i.createShortcutType({itemType:"INPUTS",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let s=i.processAutoLabel(e,t);return s=i.processAutoPlaceholder(s,t),s}},mapToWidget:hi}),d=_.gsl,ue=_.gslByUid;function Ui(e){const{uid:t,label:s,actionType:a,disabled:n,on:l,onClick:o,data:u,type:r,tags:p,size:c,include:Ai,exclude:Si,states:le,...g}=e;return{uid:t??"",kind:"action",type:"button",disabled:n,actionType:a,label:s,...l!=null?{on:l}:{},props:g}}const I=i.createShortcutType({itemType:"ACTIONS",kind:"action",entryShape:"bare",mapToWidget:Ui,afterMerge:(e,t)=>i.eventWiringService.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),pe=I.gsl,de=I.gslByUid;function Di(e){const{uid:t,widgetName:s,tags:a,size:n,onChange:l,include:o,exclude:u,...r}=e,{on:p,...c}=r;return{uid:t??"",kind:"layout",type:s??"flex",props:{direction:c.direction??"column",...c},children:[]}}function Bi(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:s};const a=e.fn;return(n=>{const l=a(n);return{...t.mapStaticDef(l,"LAYOUTS"),children:s}})}function Li(e){return e.children}const A=i.createShortcutType({itemType:"LAYOUTS",kind:"layout",entryShape:"compound",mapToWidget:Di,buildCustomWidget:Bi,getChildren:Li}),ce=A.gsl,ye=A.gslByUid;function Ri(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function Mi(e,t){if(e.kind==="static"){const a=e.def;return(n=>({uid:"",kind:"display",type:"renderer",...a.include!=null?{include:a.include}:{},...a.exclude!=null?{exclude:a.exclude}:{},props:{render:a.render(i.withForm(n))}}))}const s=e.fn;return(a=>{const n=s(a);return{uid:"",kind:"display",type:"renderer",...n.include!=null?{include:n.include}:{},...n.exclude!=null?{exclude:n.exclude}:{},props:{render:n.render(i.withForm(a))}}})}const S=i.createShortcutType({itemType:"DISPLAYS",kind:"display",entryShape:"bare",mapToWidget:Ri,buildCustomWidget:Mi}),me=S.gsl,Te=S.gslByUid,h=i.createShortcutType({itemType:"CALENDAR",kind:"input",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"calendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"string")}:{},props:i.extractWidgetProps(e)})}),ge=h.gsl,be=h.gslByUid,k=i.createShortcutType({itemType:"DATE_TIME_CALENDAR",kind:"input",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"string")}:{},props:i.extractWidgetProps(e)})}),_e=k.gsl,Ie=k.gslByUid,E=i.createShortcutType({itemType:"DATE_TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>i.processAutoPlaceholder(i.processAutoLabel(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"string")}:{},props:i.extractWidgetProps(e)})}),Ae=E.gsl,Se=E.gslByUid,P=i.createShortcutType({itemType:"TEXTAREA",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>i.processAutoPlaceholder(i.processAutoLabel(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"textarea",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"string")}:{},props:i.extractWidgetProps(e)})}),he=P.gsl,ke=P.gslByUid,U=i.createShortcutType({itemType:"PASSWORD",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>i.processAutoPlaceholder(i.processAutoLabel(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"password",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"string")}:{},props:i.extractWidgetProps(e)})}),Ee=U.gsl,Pe=U.gslByUid,D=i.createShortcutType({itemType:"CHECKBOX",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"checkbox",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"boolean")}:{},props:i.extractWidgetProps(e)})}),Ue=D.gsl,De=D.gslByUid,B=i.createShortcutType({itemType:"DATE_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"string")}:{},props:i.extractWidgetProps(e)})}),Be=B.gsl,Le=B.gslByUid,L=i.createShortcutType({itemType:"TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"timeInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"string")}:{},props:i.extractWidgetProps(e)})}),Re=L.gsl,Me=L.gslByUid,R=i.createShortcutType({itemType:"TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>i.processAutoPlaceholder(i.processAutoLabel(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"timePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"string")}:{},props:i.extractWidgetProps(e)})}),Ce=R.gsl,ve=R.gslByUid,M=i.createShortcutType({itemType:"DATE_TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimeInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"string")}:{},props:i.extractWidgetProps(e)})}),fe=M.gsl,We=M.gslByUid,C=i.createShortcutType({itemType:"CURRENCY",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>i.processAutoPlaceholder(i.processAutoLabel(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"currency",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"number")}:{},props:i.extractWidgetProps(e)})}),Ne=C.gsl,xe=C.gslByUid,v=i.createShortcutType({itemType:"RANGE_CALENDAR",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"array")}:{},props:i.extractWidgetProps(e)})}),we=v.gsl,Ge=v.gslByUid,f=i.createShortcutType({itemType:"SELECT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>i.processAutoPlaceholder(i.processAutoLabel(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"select",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:i.extractWidgetProps(e)})}),Ve=f.gsl,Ke=f.gslByUid,W=i.createShortcutType({itemType:"RADIOGROUP",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"radiogroup",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:i.extractWidgetProps(e)})}),Ye=W.gsl,$e=W.gslByUid;function Ci(e){return{uid:e.uid??"",kind:"layout",type:"tabs",props:{tabs:e.tabs,renderMode:e.renderMode??"all",...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function vi(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:s};const a=e.fn;return(n=>{const l=a(n);return{...t.mapStaticDef(l,"TABS"),children:s}})}function fi(e){return e.children}const N=i.createShortcutType({itemType:"TABS",kind:"layout",entryShape:"compound",mapToWidget:Ci,buildCustomWidget:vi,getChildren:fi}),Fe=N.gsl,ze=N.gslByUid,x=i.createShortcutType({itemType:"LIST",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"list",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:i.extractWidgetProps(e)})}),He=x.gsl,Oe=x.gslByUid,w=i.createShortcutType({itemType:"TAGS",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>i.processAutoPlaceholder(i.processAutoLabel(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"tags",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"array")}:{},props:i.extractWidgetProps(e)})}),Wi=w.gsl,Ni=w.gslByUid,G=i.createShortcutType({itemType:"ALERTS",kind:"display",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})}),Xe=G.gsl,qe=G.gslByUid,V=i.createShortcutType({itemType:"MARKDOWN_TEXTS",kind:"display",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"markdownText",props:{md:e.md}})}),je=V.gsl,Je=V.gslByUid,K=i.createShortcutType({itemType:"DATE_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>i.processAutoPlaceholder(i.processAutoLabel(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"datePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"string")}:{},props:i.extractWidgetProps(e)})}),Qe=K.gsl,Ze=K.gslByUid,Y=i.createShortcutType({itemType:"DROPDOWN",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>i.processAutoPlaceholder(i.processAutoLabel(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dropdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:i.extractWidgetProps(e)})}),et=Y.gsl,tt=Y.gslByUid;function xi(e){return{uid:e.uid??"",kind:"layout",type:"accordion",props:{sections:e.sections,renderMode:e.renderMode??"all",...e.singleOpen!=null?{singleOpen:e.singleOpen}:{},...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function wi(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:s};const a=e.fn;return(n=>{const l=a(n);return{...t.mapStaticDef(l,"ACCORDION"),children:s}})}function Gi(e){return e.children}const $=i.createShortcutType({itemType:"ACCORDION",kind:"layout",entryShape:"compound",mapToWidget:xi,buildCustomWidget:wi,getChildren:Gi}),it=$.gsl,st=$.gslByUid;function Vi(e){const t={};return e.addLabel!=null&&(t.addLabel=e.addLabel),e.removeLabel!=null&&(t.removeLabel=e.removeLabel),e.limit!=null&&(t.limit=e.limit),e.title!=null&&(t.title=e.title),e.addButtonIcon!=null&&(t.addButtonIcon=e.addButtonIcon),e.removeButtonIcon!=null&&(t.removeButtonIcon=e.removeButtonIcon),t}function Ki(e){return{uid:e.uid??"",kind:"input",type:"repeater",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"array")}:{},props:{...Vi(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function b(e,t){for(const s of e){if(typeof s=="function")continue;const a=s;typeof a.path=="string"&&a.path&&!a.path.startsWith(t)&&(a.path=t+a.path),"children"in a&&Array.isArray(a.children)&&b(a.children,t);const n=a.props;n?.template?.children&&Array.isArray(n.template.children)&&b(n.template.children,t)}}function Yi(e,t){const s=t.walkChildren(t.children??[]),a=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";a&&b(s,a+".items.");const n={kind:"layout",type:"flex",uid:"",children:s,props:{direction:"column"}};if(e.kind==="static"){const o=t.mapStaticDef(e.def,"REPEATER");return{...o,props:{...o.props,template:n}}}const l=e.fn;return(o=>{const u=l(o),r=t.mapStaticDef(u,"REPEATER");return{...r,props:{...r.props,template:n}}})}function $i(e){return{baseDef:e.def,path:e.key,children:e.children}}function Fi(e){return e.children}const zi={parseEntry:$i,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:Ki,buildCustomWidget:Yi,getChildren:Fi},y=i.createGslSelector("REPEATER"),F=(e,t)=>y(t,(s=>s.uid===e)),Hi={itemType:"REPEATER",kind:"input",handler:zi,gsl:y,gslByUid:F},z=i.createShortcutType({itemType:"MARKDOWN",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>i.processAutoPlaceholder(i.processAutoLabel(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"markdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"string")}:{},props:i.extractWidgetProps(e)})}),at=z.gsl,nt=z.gslByUid,H=i.createShortcutType({itemType:"RANGE_DATE_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"array")}:{},props:i.extractWidgetProps(e)})}),lt=H.gsl,ot=H.gslByUid,O=i.createShortcutType({itemType:"RANGE_TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeTimeInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"array")}:{},props:i.extractWidgetProps(e)})}),rt=O.gsl,ut=O.gslByUid,X=i.createShortcutType({itemType:"RANGE_DATE_TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimeInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"array")}:{},props:i.extractWidgetProps(e)})}),pt=X.gsl,dt=X.gslByUid,q=i.createShortcutType({itemType:"RANGE_DATE_TIME_CALENDAR",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"array")}:{},props:i.extractWidgetProps(e)})}),ct=q.gsl,yt=q.gslByUid,j=i.createShortcutType({itemType:"RANGE_DATE_TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"array")}:{},props:i.extractWidgetProps(e)})}),mt=j.gsl,Tt=j.gslByUid,J=i.createShortcutType({itemType:"RANGE_DATE_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>i.processAutoPlaceholder(i.processAutoLabel(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDatePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"array")}:{},props:i.extractWidgetProps(e)})}),gt=J.gsl,bt=J.gslByUid,Q=i.createShortcutType({itemType:"RANGE_TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeTimePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:i.buildTypedValidator(e.validator,"array")}:{},props:i.extractWidgetProps(e)})}),_t=Q.gsl,It=Q.gslByUid,Z=i.createShortcutType({itemType:"CUSTOM_DISPLAY",kind:"display",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})}),At=Z.gsl,St=Z.gslByUid,ee=i.createShortcutType({itemType:"CUSTOM_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>i.processAutoLabel(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:e.customType,path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.defaultValue!=null?{defaultValue:e.defaultValue}:{},...e.validator!=null?{validator:e.validator}:{},props:e.props??{}})}),ht=ee.gsl,kt=ee.gslByUid,te=i.createShortcutType({itemType:"CUSTOM_ACTION",kind:"action",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:s,disabled:a,on:n,onClick:l,data:o,customType:u,tags:r,size:p,include:c,exclude:Ai,states:Si,props:le,...g}=e;return{uid:t??"",kind:"action",type:e.customType,label:s,disabled:a,...n!=null?{on:n}:{},props:{...le,...g}}},afterMerge:(e,t)=>i.eventWiringService.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),Et=te.gsl,Pt=te.gslByUid;function Oi(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function Xi(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:s};const a=e.fn;return(n=>{const l=a(n);return{...t.mapStaticDef(l,"CUSTOM_LAYOUT"),children:s}})}function qi(e){return e.children}const ie=i.createShortcutType({itemType:"CUSTOM_LAYOUT",kind:"layout",entryShape:"compound",mapToWidget:Oi,buildCustomWidget:Xi,getChildren:qi}),Ut=ie.gsl,Dt=ie.gslByUid,ji=[_,I,A,S,h,k,E,P,U,D,B,L,R,M,C,v,f,W,N,x,w,G,V,K,Y,$,Hi,z,H,O,X,q,j,J,Q,Z,ee,te,ie],se=i.createItemTypeRegistry();for(const e of ji)i.registerShortcutType(se,e);function Ji(e){return i.defineShortcutType(se,e)}function Bt(e,t,s){if(typeof t=="function"){const n=t;return{items:[{key:e,def:o=>({type:"text",...n(o)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:s??[]}}const a={type:"text",...t};return{items:[{key:e,def:a}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:s??[]}}function Lt(e,t,s){if(typeof t=="function"){const n=t;return{items:[{key:e,def:o=>({type:"number",...n(o)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:s??[]}}const a={type:"number",...t};return{items:[{key:e,def:a}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:s??[]}}function Rt(e,t,s){if(typeof t=="function"){const n=t;return{items:[{key:e,def:o=>({type:"boolean",...n(o)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:s??[]}}const a={type:"boolean",...t};return{items:[{key:e,def:a}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:s??[]}}function Mt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"SELECT",items:[{key:e,def:r=>({type:"select",...l(r)})}],tags:s??[]}}const a={type:"select",...t};return{type:"ITEMS",itemType:"SELECT",items:[{key:e,def:a}],tags:s??[]}}function Ct(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:e,def:r=>({type:"dropdown",...l(r)})}],tags:s??[]}}const a={type:"dropdown",...t};return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:e,def:a}],tags:s??[]}}function vt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:e,def:r=>({type:"radiogroup",...l(r)})}],tags:s??[]}}const a={type:"radiogroup",...t};return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:e,def:a}],tags:s??[]}}function ft(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:e,def:r=>({type:"checkbox",...l(r)})}],tags:s??[]}}const a={type:"checkbox",...t};return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:e,def:a}],tags:s??[]}}function Wt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:e,def:r=>({type:"textarea",...l(r)})}],tags:s??[]}}const a={type:"textarea",...t};return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:e,def:a}],tags:s??[]}}function Nt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"PASSWORD",items:[{key:e,def:r=>({type:"password",...l(r)})}],tags:s??[]}}const a={type:"password",...t};return{type:"ITEMS",itemType:"PASSWORD",items:[{key:e,def:a}],tags:s??[]}}function xt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"CURRENCY",items:[{key:e,def:r=>({type:"currency",...l(r)})}],tags:s??[]}}const a={type:"currency",...t};return{type:"ITEMS",itemType:"CURRENCY",items:[{key:e,def:a}],tags:s??[]}}function wt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:e,def:r=>({type:"markdown",...l(r)})}],tags:s??[]}}const a={type:"markdown",...t};return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:e,def:a}],tags:s??[]}}function Gt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"LIST",items:[{key:e,def:r=>({type:"list",...l(r)})}],tags:s??[]}}const a={type:"list",...t};return{type:"ITEMS",itemType:"LIST",items:[{key:e,def:a}],tags:s??[]}}function Vt(e,t,s){if(typeof t=="function"){const n=t;return{items:[o=>({type:"calendar",path:e,...n(o)})],type:"ITEMS",itemType:"CALENDAR",tags:s??[]}}return{items:[{type:"calendar",path:e,...t}],type:"ITEMS",itemType:"CALENDAR",tags:s??[]}}function Kt(e,t,s){if(typeof t=="function"){const n=t;return{items:[o=>({type:"dateTimeCalendar",path:e,...n(o)})],type:"ITEMS",itemType:"DATE_TIME_CALENDAR",tags:s??[]}}return{items:[{type:"dateTimeCalendar",path:e,...t}],type:"ITEMS",itemType:"DATE_TIME_CALENDAR",tags:s??[]}}function Yt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:e,def:r=>({type:"dateInput",...l(r)})}],tags:s??[]}}const a={type:"dateInput",...t};return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:e,def:a}],tags:s??[]}}function $t(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:e,def:r=>({type:"datePicker",...l(r)})}],tags:s??[]}}const a={type:"datePicker",...t};return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:e,def:a}],tags:s??[]}}function Ft(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"DATE_TIME_PICKER",items:[{key:e,def:r=>({type:"dateTimePicker",...l(r)})}],tags:s??[]}}const a={type:"dateTimePicker",...t};return{type:"ITEMS",itemType:"DATE_TIME_PICKER",items:[{key:e,def:a}],tags:s??[]}}function zt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:e,def:r=>({type:"rangeCalendar",...l(r)})}],tags:s??[]}}const a={type:"rangeCalendar",...t};return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:e,def:a}],tags:s??[]}}function Ht(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:e,def:r=>({type:"rangeDateInput",...l(r)})}],tags:s??[]}}const a={type:"rangeDateInput",...t};return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:e,def:a}],tags:s??[]}}function Ot(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RANGE_DATE_TIME_INPUT",items:[{key:e,def:r=>({type:"rangeDateTimeInput",...l(r)})}],tags:s??[]}}const a={type:"rangeDateTimeInput",...t};return{type:"ITEMS",itemType:"RANGE_DATE_TIME_INPUT",items:[{key:e,def:a}],tags:s??[]}}function Xt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RANGE_DATE_TIME_CALENDAR",items:[{key:e,def:r=>({type:"rangeDateTimeCalendar",...l(r)})}],tags:s??[]}}const a={type:"rangeDateTimeCalendar",...t};return{type:"ITEMS",itemType:"RANGE_DATE_TIME_CALENDAR",items:[{key:e,def:a}],tags:s??[]}}function qt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RANGE_DATE_TIME_PICKER",items:[{key:e,def:r=>({type:"rangeDateTimePicker",...l(r)})}],tags:s??[]}}const a={type:"rangeDateTimePicker",...t};return{type:"ITEMS",itemType:"RANGE_DATE_TIME_PICKER",items:[{key:e,def:a}],tags:s??[]}}function jt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RANGE_TIME_INPUT",items:[{key:e,def:r=>({type:"rangeTimeInput",...l(r)})}],tags:s??[]}}const a={type:"rangeTimeInput",...t};return{type:"ITEMS",itemType:"RANGE_TIME_INPUT",items:[{key:e,def:a}],tags:s??[]}}function Jt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:e,def:r=>({type:"rangeDatePicker",...l(r)})}],tags:s??[]}}const a={type:"rangeDatePicker",...t};return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:e,def:a}],tags:s??[]}}function Qt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RANGE_TIME_PICKER",items:[{key:e,def:r=>({type:"rangeTimePicker",...l(r)})}],tags:s??[]}}const a={type:"rangeTimePicker",...t};return{type:"ITEMS",itemType:"RANGE_TIME_PICKER",items:[{key:e,def:a}],tags:s??[]}}function Zt(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"TIME_INPUT",items:[{key:e,def:r=>({type:"timeInput",...l(r)})}],tags:s??[]}}const a={type:"timeInput",...t};return{type:"ITEMS",itemType:"TIME_INPUT",items:[{key:e,def:a}],tags:s??[]}}function ei(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"TIME_PICKER",items:[{key:e,def:r=>({type:"timePicker",...l(r)})}],tags:s??[]}}const a={type:"timePicker",...t};return{type:"ITEMS",itemType:"TIME_PICKER",items:[{key:e,def:a}],tags:s??[]}}function ti(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"DATE_TIME_INPUT",items:[{key:e,def:r=>({type:"dateTimeInput",...l(r)})}],tags:s??[]}}const a={type:"dateTimeInput",...t};return{type:"ITEMS",itemType:"DATE_TIME_INPUT",items:[{key:e,def:a}],tags:s??[]}}function ii(e,t,s,a){if(typeof s=="function"){const o=s;return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:p=>({customType:e,...o(p)})}],tags:a??[]}}const n={customType:e,...s};return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:n}],tags:a??[]}}function si(e,t){return{items:[e],type:"ITEMS",itemType:i.GuiItemTypes.ACTIONS,tags:t??[]}}function ai(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[u=>({customType:e,...l(u)})],tags:s??[]}}return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[{customType:e,...t}],tags:s??[]}}const ae=(e,t)=>({type:"ITEMS",itemType:i.GuiItemTypes.DISPLAYS,items:[{render:e}],tags:t??[]});function ni(e,t){return{type:"ITEMS",itemType:"ALERTS",items:[e],tags:t??[]}}function li(e,t){return{type:"ITEMS",itemType:"MARKDOWN_TEXTS",items:[e],tags:t??[]}}function oi(e,t,s){if(typeof t=="function"){const u=t;return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[p=>({customType:e,...u(p)})],tags:s??[]}}const{uid:a,...n}=t??{};return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[{customType:e,...a!=null?{uid:a}:{},props:Object.keys(n).length>0?n:void 0}],tags:s??[]}}const m=(e,t,s)=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{widgetName:"flex",...t??{}},children:e}],tags:s??[]}),ri=(e,t,s)=>m(e,{direction:"row",...t??{}},s),ui=(e,t,s)=>m(e,{direction:"column",...t??{}},s),T=(e,t,s)=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{widgetName:"grid",direction:"row",autoFit:!0,...t??{}},children:e}],tags:s??[]}),pi=(e,t,s)=>T(e,{direction:"row",...t??{}},s),di=(e,t,s)=>T(e,{direction:"column",...t??{}},s);function oe(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function ci(e,t,s){const a=e.map(o=>({label:o.label,uid:o.uid??oe(o.label)})),n=e.map(o=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{uid:o.uid??oe(o.label),direction:"column",widgetName:"flex"},children:o.children}],tags:[]}));return{type:"ITEMS",itemType:"TABS",items:[{def:{tabs:a,...t},children:n}],tags:s??[]}}function re(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function yi(e,t,s){const a=e.map(o=>({label:o.label,uid:o.uid??re(o.label)})),n=e.map(o=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{uid:o.uid??re(o.label),direction:"column",widgetName:"flex"},children:o.children}],tags:[]}));return{type:"ITEMS",itemType:"ACCORDION",items:[{def:{sections:a,...t},children:n}],tags:s??[]}}function mi(e,t,s,a){if(typeof s=="function"){const o=s;return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:p=>({customType:e,...o(p)}),children:t}],tags:a??[]}}return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:{customType:e,...s},children:t}],tags:a??[]}}function Ti(e,t,s){const{template:a,...n}=t;return{type:"ITEMS",itemType:"REPEATER",items:[{key:e,def:n,children:a}],tags:s??[]}}function gi(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"TAGS",items:[{key:e,def:r=>({type:"tags",...l(r)})}],tags:s??[]}}const a={type:"tags",...t};return{type:"ITEMS",itemType:"TAGS",items:[{key:e,def:a}],tags:s??[]}}const bi=e=>d(e,t=>t.type==="text"),_i=e=>d(e,t=>t.type==="number"),Ii=e=>d(e,t=>t.type==="boolean"),Qi=i.createSelectors({inputs:d,inputByUid:ue,textInputs:bi,numberInputs:_i,booleanInputs:Ii,selects:Ve,selectByUid:Ke,dropdowns:et,dropdownByUid:tt,radiogroups:Ye,radiogroupByUid:$e,checkboxes:Ue,checkboxByUid:De,textareas:he,textareaByUid:ke,passwords:Ee,passwordByUid:Pe,currencies:Ne,currencyByUid:xe,markdowns:at,markdownByUid:nt,lists:He,listByUid:Oe,calendars:ge,calendarByUid:be,dateTimeCalendars:_e,dateTimeCalendarByUid:Ie,dateInputs:Be,dateInputByUid:Le,timeInputs:Re,timeInputByUid:Me,timePickers:Ce,timePickerByUid:ve,dateTimeInputs:fe,dateTimeInputByUid:We,datePickers:Qe,datePickerByUid:Ze,dateTimePickers:Ae,dateTimePickerByUid:Se,rangeCalendars:we,rangeCalendarByUid:Ge,rangeDateInputs:lt,rangeDateInputByUid:ot,rangeTimeInputs:rt,rangeTimeInputByUid:ut,rangeDateTimeInputs:pt,rangeDateTimeInputByUid:dt,rangeDateTimeCalendars:ct,rangeDateTimeCalendarByUid:yt,rangeDateTimePickers:mt,rangeDateTimePickerByUid:Tt,rangeDatePickers:gt,rangeDatePickerByUid:bt,rangeTimePickers:_t,rangeTimePickerByUid:It,repeaters:y,repeaterByUid:F,actions:pe,actionByUid:de,layouts:ce,layoutByUid:ye,displays:me,displayByUid:Te,alerts:Xe,alertByUid:qe,markdownTexts:je,markdownTextByUid:Je,tabs:Fe,tabsByUid:ze,accordions:it,accordionByUid:st,customInputs:ht,customInputByUid:kt,customActions:Et,customActionByUid:Pt,customDisplays:At,customDisplayByUid:St,customLayouts:Ut,customLayoutByUid:Dt}),Zi={bareItemToWidget:e=>ae(e),rootEntry:e=>{const t={def:{uid:"#root",direction:"column",widgetName:"flex"},children:e};return{type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[t],tags:[]}}},es={inputs:{textInput:Bt,numberInput:Lt,booleanInput:Rt,select:Mt,dropdown:Ct,radiogroup:vt,checkbox:ft,textarea:Wt,password:Nt,currency:xt,markdown:wt,list:Gt,calendar:Vt,dateTimeCalendar:Kt,dateInput:Yt,datePicker:$t,dateTimePicker:Ft,timeInput:Zt,timePicker:ei,dateTimeInput:ti,rangeCalendar:zt,rangeDateInput:Ht,rangeDateTimeInput:Ot,rangeDateTimeCalendar:Xt,rangeDateTimePicker:qt,rangeTimeInput:jt,rangeDatePicker:Jt,rangeTimePicker:Qt,repeater:Ti,tags:gi,custom:ii},actions:{button:si,custom:ai},displays:{display:ae,alert:ni,markdownText:li,custom:oi},layouts:{flex:m,horizontalFlex:ri,verticalFlex:ui,grid:T,horizontalGrid:pi,verticalGrid:di,tabs:ci,accordion:yi,custom:mi}},ne=i.createImplementation({name:"gui",registry:se,facade:es,selectors:Qi,adapter:Zi}),ts=ne.namespace,is=ne.formDefs,ss=ne.resolveFormInput;exports._gslAccordionByUid=st;exports._gslAccordions=it;exports._gslActionByUid=de;exports._gslActions=pe;exports._gslAlertByUid=qe;exports._gslAlerts=Xe;exports._gslBooleanInputs=Ii;exports._gslCalendarByUid=be;exports._gslCalendars=ge;exports._gslCheckboxByUid=De;exports._gslCheckboxes=Ue;exports._gslCurrencies=Ne;exports._gslCurrencyByUid=xe;exports._gslCustomActionByUid=Pt;exports._gslCustomActions=Et;exports._gslCustomDisplayByUid=St;exports._gslCustomDisplays=At;exports._gslCustomInputByUid=kt;exports._gslCustomInputs=ht;exports._gslCustomLayoutByUid=Dt;exports._gslCustomLayouts=Ut;exports._gslDateInputByUid=Le;exports._gslDateInputs=Be;exports._gslDatePickerByUid=Ze;exports._gslDatePickers=Qe;exports._gslDateTimeCalendarByUid=Ie;exports._gslDateTimeCalendars=_e;exports._gslDateTimeInputByUid=We;exports._gslDateTimeInputs=fe;exports._gslDateTimePickerByUid=Se;exports._gslDateTimePickers=Ae;exports._gslDisplayByUid=Te;exports._gslDisplays=me;exports._gslDropdownByUid=tt;exports._gslDropdowns=et;exports._gslInputByUid=ue;exports._gslInputs=d;exports._gslLayoutByUid=ye;exports._gslLayouts=ce;exports._gslListByUid=Oe;exports._gslLists=He;exports._gslMarkdownByUid=nt;exports._gslMarkdownTextByUid=Je;exports._gslMarkdownTexts=je;exports._gslMarkdowns=at;exports._gslNumberInputs=_i;exports._gslPasswordByUid=Pe;exports._gslPasswords=Ee;exports._gslRadiogroupByUid=$e;exports._gslRadiogroups=Ye;exports._gslRangeCalendarByUid=Ge;exports._gslRangeCalendars=we;exports._gslRangeDateInputByUid=ot;exports._gslRangeDateInputs=lt;exports._gslRangeDatePickerByUid=bt;exports._gslRangeDatePickers=gt;exports._gslRangeDateTimeCalendarByUid=yt;exports._gslRangeDateTimeCalendars=ct;exports._gslRangeDateTimeInputByUid=dt;exports._gslRangeDateTimeInputs=pt;exports._gslRangeDateTimePickerByUid=Tt;exports._gslRangeDateTimePickers=mt;exports._gslRangeTimeInputByUid=ut;exports._gslRangeTimeInputs=rt;exports._gslRangeTimePickerByUid=It;exports._gslRangeTimePickers=_t;exports._gslRepeaterByUid=F;exports._gslRepeaters=y;exports._gslSelectByUid=Ke;exports._gslSelects=Ve;exports._gslTabs=Fe;exports._gslTabsByUid=ze;exports._gslTags=Wi;exports._gslTagsByUid=Ni;exports._gslTextInputs=bi;exports._gslTextareaByUid=ke;exports._gslTextareas=he;exports._gslTimeInputByUid=Me;exports._gslTimeInputs=Re;exports._gslTimePickerByUid=ve;exports._gslTimePickers=Ce;exports._guiAccordion=yi;exports._guiAlert=ni;exports._guiBooleanInput=Rt;exports._guiButton=si;exports._guiCalendar=Vt;exports._guiCheckbox=ft;exports._guiCurrency=xt;exports._guiCustomAction=ai;exports._guiCustomDisplay=oi;exports._guiCustomInput=ii;exports._guiCustomLayout=mi;exports._guiDateInput=Yt;exports._guiDatePicker=$t;exports._guiDateTimeCalendar=Kt;exports._guiDateTimeInput=ti;exports._guiDateTimePicker=Ft;exports._guiDisplay=ae;exports._guiDropdown=Ct;exports._guiFlex=m;exports._guiGrid=T;exports._guiHorizontalFlex=ri;exports._guiHorizontalGrid=pi;exports._guiList=Gt;exports._guiMarkdown=wt;exports._guiMarkdownText=li;exports._guiNumberInput=Lt;exports._guiPassword=Nt;exports._guiRadiogroup=vt;exports._guiRangeCalendar=zt;exports._guiRangeDateInput=Ht;exports._guiRangeDatePicker=Jt;exports._guiRangeDateTimeCalendar=Xt;exports._guiRangeDateTimeInput=Ot;exports._guiRangeDateTimePicker=qt;exports._guiRangeTimeInput=jt;exports._guiRangeTimePicker=Qt;exports._guiRepeater=Ti;exports._guiSelect=Mt;exports._guiTabs=ci;exports._guiTags=gi;exports._guiTextInput=Bt;exports._guiTextarea=Wt;exports._guiTimeInput=Zt;exports._guiTimePicker=ei;exports._guiVerticalFlex=ui;exports._guiVerticalGrid=di;exports.defineShortcutType=Ji;exports.formDefs=is;exports.gui=ts;exports.resolveFormInput=ss;
@@ -1,39 +0,0 @@
1
- import { NonFunctionWidget, FormWidget } from '@golemui/core';
2
- import { GslLeafSelector, MergeResult } from './dx.domain';
3
- import { GslConfigBase } from './dxUtilityTypes';
4
- import { AfterMergeContext, BuildWidgetContext, ShortcutItemKind } from './itemTypeRegistry';
5
- import { DxCommonFields } from './dxBase.types';
6
- type EntryShape = 'bare' | 'keyed' | 'compound';
7
- interface SensibleDefaultsSpec<TDecorator, TConfig> {
8
- base: TConfig;
9
- fields: (keyof TConfig)[];
10
- apply: (def: TDecorator, config: TConfig) => TDecorator;
11
- }
12
- interface ShortcutTypeConfig<TEntry, TDecorator, TConfig> {
13
- itemType: string;
14
- kind?: ShortcutItemKind;
15
- entryShape: EntryShape;
16
- mapToWidget: (def: TDecorator) => NonFunctionWidget;
17
- sensibleDefaults?: SensibleDefaultsSpec<TDecorator, TConfig>;
18
- afterMerge?: (mergeResult: MergeResult, context: AfterMergeContext) => MergeResult;
19
- buildCustomWidget?: (mergeResult: MergeResult, context: BuildWidgetContext) => FormWidget;
20
- getChildren?: (entry: TEntry) => any[] | undefined;
21
- }
22
- export interface ShortcutTypeSelectors<TDecorator, TConfig extends GslConfigBase<TDecorator>> {
23
- gsl: (config: TConfig, matcher?: (decorator: TDecorator) => boolean) => GslLeafSelector;
24
- gslByUid: (uid: string, config: TConfig) => GslLeafSelector;
25
- }
26
- /**
27
- * Convenience factory for registering a new widget type into the DX pipeline.
28
- *
29
- * Accepts a simple config object (entry shape, mapToWidget, optional hooks) and
30
- * assembles a full {@link ItemTypeHandler} from it — generating `parseEntry`,
31
- * `rollUpSensibleDefaults`, and `applySensibleDefaults` automatically.
32
- * The handler is registered in the global registry so the pipeline can look it up
33
- * by `itemType` at runtime.
34
- *
35
- * Returns GSL selector factories (`gsl`, `gslByUid`) for styling/configuring
36
- * widgets of this type.
37
- */
38
- export declare function defineShortcutType<TEntry, TDecorator extends DxCommonFields, TConfig extends GslConfigBase<TDecorator> = GslConfigBase<TDecorator>>(config: ShortcutTypeConfig<TEntry, TDecorator, TConfig>): ShortcutTypeSelectors<TDecorator, TConfig>;
39
- export {};
@@ -1,79 +0,0 @@
1
- import { ExpressionFunctions, FunctionWidgetParams, ValidateOn } from '@golemui/core';
2
- import { WidgetItemDecorator, GslItemType } from '../formDef.domain';
3
- import { Dependencies } from '../../shared';
4
- export type { GslItemType } from '../formDef.domain';
5
- export type RuntimeFunction = (params: FunctionWidgetParams<any>) => any;
6
- export type GuiItemType = string;
7
- export declare const GuiItemTypes: {
8
- readonly INPUTS: "INPUTS";
9
- readonly ACTIONS: "ACTIONS";
10
- readonly LAYOUTS: "LAYOUTS";
11
- readonly DISPLAYS: "DISPLAYS";
12
- readonly CUSTOM_DISPLAY: "CUSTOM_DISPLAY";
13
- readonly CUSTOM_INPUT: "CUSTOM_INPUT";
14
- readonly CUSTOM_ACTION: "CUSTOM_ACTION";
15
- readonly CUSTOM_LAYOUT: "CUSTOM_LAYOUT";
16
- };
17
- export interface GuiItemsShortcut {
18
- type: 'ITEMS';
19
- itemType: GuiItemType;
20
- items: unknown[];
21
- tags: string[];
22
- }
23
- export type ValidGuiShortcut = GuiItemsShortcut;
24
- export type GslMatcher = (decorator: WidgetItemDecorator) => boolean;
25
- export type GslLeafConfig = Record<string, any>;
26
- export interface GslLeafSelector {
27
- kind: 'leaf';
28
- selectorType: GslItemType;
29
- matcher: (decorator: any) => boolean;
30
- config: GslLeafConfig;
31
- /** When set by `_gslStates`, config is applied as state-suffixed overrides. */
32
- targetState?: string;
33
- }
34
- export interface FormConfig {
35
- suppressAutomaticStack?: boolean;
36
- dependencies?: Dependencies;
37
- /**
38
- * Pure functions callable from reactive expressions under the `$fn` namespace.
39
- * Functions passed in the wrapper's `config.functions` win on name collisions.
40
- */
41
- functions?: ExpressionFunctions;
42
- widgetLoaders?: Record<string, () => Promise<unknown>>;
43
- validateOn?: ValidateOn;
44
- states?: Record<string, string>;
45
- /**
46
- * Framework-specific item renderers (e.g. ReactItemRenderer / AngularItemRenderer / LitItemRenderer).
47
- * Forwarded to the unified <gui-form>; the type is intentionally framework-agnostic
48
- * here and gets narrowed at the framework wrapper boundary.
49
- */
50
- itemRenderers?: Record<string, unknown>;
51
- }
52
- /**
53
- * Public-facing form config type for `processDxFacade`'s third argument.
54
- * Generic over state keys — TypeScript enforces that every declared state name
55
- * has a corresponding expression.
56
- *
57
- * Usage: `processDxFacade<typeof states[number], FormData>(defs, selectors, formConfig)`
58
- */
59
- export type DxFormConfig<S extends string = string> = Omit<FormConfig, 'states'> & {
60
- states?: Record<S, string>;
61
- };
62
- export interface GslAggregatedSelector {
63
- kind: 'aggregated';
64
- matcher: GslMatcher;
65
- children: GslLeafSelector[];
66
- }
67
- export type GslSelector = GslAggregatedSelector | GslLeafSelector;
68
- export type GslSelectorsInput = GslSelector | GslSelector[];
69
- export interface ResolvedSelectors {
70
- leafSelectors: GslLeafSelector[];
71
- sensibleDefaults: Record<string, Record<string, any>>;
72
- }
73
- export type MergeResult = {
74
- kind: 'static';
75
- def: Record<string, any>;
76
- } | {
77
- kind: 'dynamic';
78
- fn: RuntimeFunction;
79
- };
@@ -1,128 +0,0 @@
1
- import { ActionWidget, FormEvent, Localizable, ReactiveExpression } from '@golemui/core';
2
- /**
3
- * DX-enriched FormEvent. Extends the core FormEvent with `update()` — the
4
- * recommended way for DX event handlers to push widget property changes.
5
- *
6
- * `update({ path: 'widget', options: [...] })` translates to OVERRIDE_WIDGET_PROP
7
- * dispatches under the hood. `callback` is also available for raw/backward-compat use.
8
- */
9
- export type DxFormEvent = FormEvent & {
10
- update: (arg: {
11
- path: string;
12
- [prop: string]: any;
13
- }) => void;
14
- };
15
- /**
16
- * Event handler type for DX event properties.
17
- *
18
- * Function-only, mirroring action `onClick`. Bare strings are NOT accepted — a stray
19
- * `onChange: 'something'` is a footgun (it looks like a value, not a handler), so the
20
- * type rejects it.
21
- *
22
- * - Return a string to wire a host-managed event name (e.g. `onChange: () => 'fieldChange'`
23
- * dispatches `fieldChange` to the host event bus). Only zero-arg handlers are probed for
24
- * this, so the `event` parameter is never touched at build time.
25
- * - Otherwise the handler runs on dispatch; use `event.update(...)` to push widget changes.
26
- *
27
- * @example
28
- * // Host-managed dispatch by name:
29
- * onChange: () => 'fieldChange'
30
- * @example
31
- * // Imperative handler:
32
- * onChange: (event) => event.update({ path: 'country', options: [] })
33
- */
34
- export type DxEventHandler = (event: DxFormEvent) => void | string;
35
- /**
36
- * INTERNAL decorator fields — used by the pipeline, NOT by form authors.
37
- * Contains fields that the pipeline needs but users should never set.
38
- */
39
- export interface DxInternalFields {
40
- itemType?: string;
41
- removeField?: boolean;
42
- /**
43
- * Sub-type discriminator on the decorator (e.g. `'text' | 'number' | 'boolean'`
44
- * for inputs that share the `INPUTS` itemType, `'password'`, `'dropdown'`, etc.
45
- * for top-level itemTypes). Carried into the matching phase so sub-type
46
- * matchers like `_gslTextInputs((d) => d.type === 'text')` work.
47
- */
48
- type?: string;
49
- }
50
- /**
51
- * Conditional inclusion: state-list or reactive expression form.
52
- * Mirrors core's `include` shape on `BaseWidget`.
53
- */
54
- export type DxIncludeCondition = {
55
- in: string[];
56
- } | {
57
- when: ReactiveExpression;
58
- };
59
- /**
60
- * Conditional exclusion: state-list or reactive expression form.
61
- * Mirrors core's `exclude` shape on `BaseWidget`.
62
- */
63
- export type DxExcludeCondition = {
64
- from: string[];
65
- } | {
66
- when: ReactiveExpression;
67
- };
68
- /**
69
- * User-settable common fields available on ALL decorator types.
70
- */
71
- export interface DxCommonFields {
72
- uid?: string;
73
- tags?: string[];
74
- size?: number;
75
- /**
76
- * Per-state property overrides. Keys are state names (use `:` for hierarchy).
77
- *
78
- * NOTE: the override values are an untyped escape hatch (`Record<string, any>`), so they
79
- * are NOT type-checked — e.g. `states: { editing: { onChange: 'foo' } }` compiles even
80
- * though a top-level `onChange: 'foo'` does not (events are function-only).
81
- */
82
- states?: Record<string, Record<string, any>>;
83
- /** Conditionally include the widget — by active state list or reactive expression. */
84
- include?: DxIncludeCondition;
85
- /** Conditionally exclude the widget — by active state list or reactive expression. */
86
- exclude?: DxExcludeCondition;
87
- }
88
- /**
89
- * PUBLIC base for input-like decorators.
90
- * Clean projection of InputWidget properties — no generics, no SomeSuffixable.
91
- */
92
- export interface DxInputBase {
93
- path?: string;
94
- label?: Localizable | null;
95
- disabled?: boolean | {
96
- when: ReactiveExpression;
97
- };
98
- readonly?: boolean | {
99
- when: ReactiveExpression;
100
- };
101
- defaultValue?: unknown;
102
- onLoad?: DxEventHandler;
103
- onChange?: DxEventHandler;
104
- onFilter?: DxEventHandler;
105
- onBlur?: DxEventHandler;
106
- }
107
- /**
108
- * PUBLIC base for action decorators.
109
- */
110
- export interface DxActionBase {
111
- label?: Localizable;
112
- disabled?: boolean | {
113
- when: ReactiveExpression;
114
- };
115
- actionType?: ActionWidget['actionType'];
116
- }
117
- /**
118
- * PUBLIC base for layout decorators.
119
- */
120
- export interface DxLayoutBase {
121
- onChange?: DxEventHandler;
122
- }
123
- /**
124
- * PUBLIC base for display decorators.
125
- * Displays are render-function-only — no shared properties beyond uid.
126
- */
127
- export interface DxDisplayBase {
128
- }
@@ -1,9 +0,0 @@
1
- import { DxCommonFields, DxInputBase } from './dxBase.types';
2
- type DxBaseKeys = keyof DxInputBase | keyof DxCommonFields | 'type';
3
- /**
4
- * Extract widget-specific props from a flattened decorator.
5
- * Strips DxInputBase + DxCommonFields fields, event properties,
6
- * and pipeline-internal `on` from the output.
7
- */
8
- export declare function extractWidgetProps<D extends DxInputBase & DxCommonFields>(def: D): Omit<D, DxBaseKeys>;
9
- export {};
@@ -1,40 +0,0 @@
1
- import { FunctionWidgetParams } from '@golemui/core';
2
- import { RuntimeFunction, GuiItemsShortcut, GslLeafSelector } from './dx.domain';
3
- export type DxRuntimeParams<FormData = any> = FunctionWidgetParams<FormData>;
4
- /**
5
- * Generic GSL decorator callback — same structure for every type.
6
- * Usage: replace per-type `GslCalendarDecoratorCallback`, `GslInputDecoratorCallback`, etc.
7
- */
8
- export type GslDecoratorCallback<D> = (current: D) => Partial<D> | RuntimeFunction;
9
- /**
10
- * A field definition can be a static decorator or a runtime callback.
11
- * Usage: replace per-type `CalendarDefOrCallback`, `ActionDefOrCallback`, etc.
12
- */
13
- export type DefOrCallback<D, TForm = any> = D | ((params: DxRuntimeParams<TForm>) => Partial<D>);
14
- /**
15
- * Standard GSL config shape — override + optional suppress flags.
16
- * Extend this for types that have additional GSL config fields.
17
- * Usage: replace per-type `GslCalendarConfig`, `GslInputConfig`, etc. base shape.
18
- */
19
- export interface GslConfigBase<D> {
20
- override?: Partial<D> | GslDecoratorCallback<D>;
21
- }
22
- /**
23
- * Typed GUI shortcut sub-interface.
24
- * Usage: replace per-type `GuiCalendarShortcut`, `GuiInputsShortcut`, etc.
25
- */
26
- export interface GuiShortcutOf<TItemType extends string, TEntry> extends GuiItemsShortcut {
27
- itemType: TItemType;
28
- items: TEntry[];
29
- }
30
- /**
31
- * Creates a GSL selector factory for a given shortcut type.
32
- * Eliminates the need for per-type gsl*.impl.ts files.
33
- *
34
- * @example
35
- * ```ts
36
- * export const _gslCalendars = createGslSelector<CalendarDecorator, GslCalendarConfig>('CALENDAR');
37
- * // Equivalent to the hand-written gslCalendar.impl.ts factory
38
- * ```
39
- */
40
- export declare function createGslSelector<D, TConfig extends GslConfigBase<D> = GslConfigBase<D>>(selectorType: string): (config: TConfig, matcher?: (decorator: D) => boolean) => GslLeafSelector;
@@ -1,31 +0,0 @@
1
- import { CustomValidator, Validator } from '@golemui/gui-validators';
2
- type ValidatorFn = (api: any) => Partial<Validator>;
3
- /**
4
- * Validator shape accepted by a DX widget whose value type is fixed (e.g.
5
- * a `textInput`'s value is always a string). The user may either:
6
- * - omit the `type` discriminator and write only the rules for that fixed
7
- * kind (`{ minLength: 5 }`), which `buildTypedValidator` will tag with the
8
- * correct `type` at form-def construction time, or
9
- * - opt out and supply a fully-typed `CustomValidator`
10
- * (`{ type: 'custom', <validatorName>: <config> }`), which the engine
11
- * resolves against `customValidators` at validation time.
12
- *
13
- * The two branches are discriminated by the presence of `type: 'custom'`.
14
- */
15
- export type DxValidator<T extends Validator> = Omit<T, 'type'> | CustomValidator;
16
- /**
17
- * Build a fixed-type validator from a user-supplied partial validator and a
18
- * known JSON-schema type. The DX layer uses this for widgets whose value
19
- * shape is fixed (e.g. password is always string, currency always number,
20
- * calendar always string-with-format, repeater always array).
21
- *
22
- * Runtime-function validators are passed through unchanged — the function's
23
- * return value is responsible for setting `type` itself. The function is
24
- * evaluated by the engine on every form-data change.
25
- *
26
- * When `validator` is `undefined`, returns a no-op typed validator
27
- * (`{ type }` with no rules). Callers can still gate the call with a null
28
- * check when they only want to emit `validator` if the user supplied one.
29
- */
30
- export declare function buildTypedValidator(validator: Record<string, unknown> | ValidatorFn | undefined, type: Validator['type']): Validator | ValidatorFn;
31
- export {};
@@ -1,34 +0,0 @@
1
- import { FormEvent } from '@golemui/core';
2
- import { MergeResult } from './dx.domain';
3
- import { EventIdGenerator } from './itemTypeRegistry';
4
- export type EventRegistry = Map<string, (event: FormEvent) => void>;
5
- /**
6
- * Probe a DX event handler for a host-managed event name.
7
- *
8
- * Mirrors the action `onClick` pattern: a handler that simply returns a string
9
- * (`() => 'fieldChange'`) declares a host-managed dispatch by name. Only **zero-arg**
10
- * handlers are probed — a handler that declares the `event` parameter
11
- * (`(event) => event.update(...)`) is an imperative handler and is never invoked here,
12
- * so its method-bearing `DxFormEvent` is never touched with `undefined`.
13
- *
14
- * @returns the returned event name, or `null` when the handler is not a declarative
15
- * zero-arg string-returning handler (i.e. it should be registered and run on dispatch).
16
- */
17
- export declare function probeForHostEventName(handler: (...args: any[]) => any): string | null;
18
- /**
19
- * Generalisation of ActionOnClickService.
20
- *
21
- * Two entry points:
22
- * - `extractOnClickFromMergeResult` — action-specific: handles onClick wiring.
23
- * Called from the actions afterMerge hook.
24
- * - `wireInputLayoutEvents` — universal: handles onLoad, onChange, onFilter on any widget.
25
- * Called from ItemWalker.processItem for every item.
26
- */
27
- export declare class EventWiringService {
28
- extractOnClickFromMergeResult(mergeResult: MergeResult, eventRegistry: EventRegistry, eventIdGenerator: EventIdGenerator): MergeResult;
29
- private wireOnClick;
30
- wireInputLayoutEvents(mergeResult: MergeResult, eventRegistry: EventRegistry, eventIdGenerator: EventIdGenerator): MergeResult;
31
- private wireEventProperties;
32
- }
33
- declare const eventWiringService: EventWiringService;
34
- export default eventWiringService;
@@ -1,94 +0,0 @@
1
- import { FormWidget, NonFunctionWidget, UiState, FormEvent } from '@golemui/core';
2
- import { DxRuntimeParams } from './dxUtilityTypes';
3
- import { GslLeafSelector, FormConfig, MergeResult, ValidGuiShortcut, GslItemType } from './dx.domain';
4
- import { DxCommonFields } from './dxBase.types';
5
- export interface ParsedEntry<TDecorator extends DxCommonFields = DxCommonFields> {
6
- baseDef: TDecorator | ((params: DxRuntimeParams) => Partial<TDecorator>);
7
- path?: string;
8
- children?: ValidGuiShortcut[];
9
- }
10
- export type EventRegistry = Map<string, (event: FormEvent) => void>;
11
- export interface EventIdGenerator {
12
- next(): string;
13
- }
14
- export interface AfterMergeContext {
15
- eventRegistry: EventRegistry;
16
- formConfig: FormConfig;
17
- eventIdGenerator: EventIdGenerator;
18
- }
19
- export interface BuildWidgetContext {
20
- children?: ValidGuiShortcut[];
21
- mapStaticDef: (def: Record<string, any>, itemType: GslItemType) => NonFunctionWidget;
22
- walkChildren: (children: ValidGuiShortcut[]) => FormWidget[];
23
- }
24
- /**
25
- * Strategy interface for a widget type (inputs, actions, layouts, calendars, etc.).
26
- *
27
- * The DX pipeline (`ItemWalker.processItem`) is generic — it walks the widget tree,
28
- * resolves selectors, merges definitions, and maps to framework widgets. But each
29
- * widget type has its own entry shape, its own sensible defaults, and sometimes
30
- * custom post-merge or widget-building logic. The handler provides these type-specific
31
- * behaviors at well-defined extension points in the pipeline:
32
- *
33
- * 1. `parseEntry` — parse raw entry into a normalized `ParsedEntry`
34
- * 2. `rollUpSensibleDefaults` — aggregate config from matching leaf selectors
35
- * 3. `applySensibleDefaults` — apply aggregated config to a merged decorator
36
- * 4. `mapToWidget` — map a decorator to a core `FormWidget`
37
- * 5. `afterMerge` (optional) — post-merge hook (e.g. actions use this to wire onClick)
38
- * 6. `buildCustomWidget` (optional) — custom widget building for compound types (e.g. layouts
39
- * that need to recursively walk children)
40
- *
41
- * Shortcut authors do NOT implement this interface directly. Instead, they call
42
- * {@link defineShortcutType} with a simple config object, and it assembles the full
43
- * handler and registers it in the global registry.
44
- *
45
- * Entry shape taxonomy:
46
- *
47
- * 1. Keyed entries — { key, def } — path derived from key
48
- * Used by: inputs, future select/radiogroup
49
- *
50
- * 2. Bare entries — decorator | callback directly
51
- * Used by: actions, calendar, displays
52
- *
53
- * 3. Compound entries — { def, children } — container with nested shortcuts
54
- * Used by: layouts, future tabs/accordion
55
- *
56
- * Each handler declares TEntry to match its shape.
57
- * There is no shared base type — the shapes are intentionally different.
58
- * parseEntry(entry: TEntry) is the type-safe boundary.
59
- */
60
- export interface ItemTypeHandler<TEntry = any, TDecorator extends DxCommonFields = DxCommonFields, TConfig = Record<string, any>> {
61
- rollUpSensibleDefaults(leafSelectors: GslLeafSelector[]): TConfig;
62
- applySensibleDefaults(def: TDecorator, config: TConfig): TDecorator;
63
- mapToWidget<StateKeys extends UiState = never, FormData extends Record<string, any> = any>(def: TDecorator): NonFunctionWidget<StateKeys, FormData>;
64
- parseEntry(entry: TEntry): ParsedEntry<TDecorator>;
65
- afterMerge?(mergeResult: MergeResult, context: AfterMergeContext): MergeResult;
66
- /**
67
- * Optional override for widget types that need custom construction beyond the
68
- * generic mapToWidget path. Two flavors:
69
- *
70
- * - Compound types (layouts, accordion, tabs, repeater): use `context.walkChildren`
71
- * to recursively process child widgets and attach them to the result.
72
- * - Custom rendering (displays): wrap a render function into a specialized widget
73
- * shape that the generic mapper can't produce.
74
- *
75
- * If not provided, the pipeline falls back to `mapToWidget` for simple leaf types.
76
- */
77
- buildCustomWidget?(mergeResult: MergeResult, context: BuildWidgetContext): FormWidget;
78
- getChildren?(entry: TEntry): ValidGuiShortcut[] | undefined;
79
- }
80
- /**
81
- * The widget kind an item type belongs to. Matches the `kind` discriminator of core widgets
82
- */
83
- export type ShortcutItemKind = NonFunctionWidget['kind'];
84
- export declare function registerItemType(itemType: string, handler: ItemTypeHandler<any, any, any>, kind?: ShortcutItemKind): void;
85
- /**
86
- * Returns the widget kind declared when the item type was registered, or undefined when it was registered without one
87
- */
88
- export declare function getItemTypeKind(itemType: string): ShortcutItemKind | undefined;
89
- /**
90
- * Returns the names of every registered item type
91
- */
92
- export declare function getRegisteredItemTypes(): string[];
93
- export declare function getItemTypeHandler(itemType: string): ItemTypeHandler<any, any, any>;
94
- export declare function hasItemTypeHandler(itemType: string): boolean;
@@ -1,31 +0,0 @@
1
- import { FormWidget, UiState } from '@golemui/core';
2
- import { FormConfig, GslSelector, ValidGuiShortcut } from './dx.domain';
3
- import { SelectorResolver } from './selectorResolver.service';
4
- import { WidgetMerger } from './widgetMerger.service';
5
- import { WidgetMapper } from './widgetMapper.service';
6
- import { EventRegistry } from './itemTypeRegistry';
7
- import { EventWiringService } from './eventWiring.service';
8
- import { StateExpansionService } from './stateExpansion.service';
9
- export interface WalkResult<StateKeys extends UiState = never, FormData extends Record<string, any> = any> {
10
- widgets: FormWidget<StateKeys, FormData>[];
11
- eventRegistry: EventRegistry;
12
- }
13
- export declare class ItemWalker {
14
- private readonly resolver;
15
- private readonly merger;
16
- private readonly mapper;
17
- private readonly eventWiring;
18
- private readonly stateExpansion;
19
- constructor(resolver: SelectorResolver, merger: WidgetMerger, mapper: WidgetMapper, eventWiring: EventWiringService, stateExpansion: StateExpansionService);
20
- walkAndMap<StateKeys extends UiState = never, FormData extends Record<string, any> = any>(guiShortcuts: ValidGuiShortcut[], gslSelectors: GslSelector[], formConfig: FormConfig): WalkResult<StateKeys, FormData>;
21
- private walkItems;
22
- private processItem;
23
- private buildCustomWidgetContext;
24
- private buildCustomWidget;
25
- /**
26
- * Resolves the base definition from a parsed entry, injecting the path for keyed entries.
27
- * For runtime (function) providers, wraps them to inject the path at evaluation time.
28
- */
29
- private buildBaseDef;
30
- private buildDecoratorForMatching;
31
- }
@@ -1,15 +0,0 @@
1
- import { FormConfig, GslSelector, GslSelectorsInput } from './dx.domain';
2
- export declare class SelectorNormalizer {
3
- /**
4
- * Ensures the output is always a uniform GslSelector[] of aggregated selectors.
5
- *
6
- * Callers can pass flat leaf selectors (single styling rules) or pre-grouped
7
- * aggregated selectors. This method separates them into two buckets, then wraps
8
- * any bare leaves into a catch-all aggregated selector so downstream code only
9
- * deals with one shape.
10
- */
11
- normalizeSelectors(input: GslSelectorsInput): GslSelector[];
12
- extractFormConfig(): FormConfig;
13
- }
14
- declare const selectorNormalizer: SelectorNormalizer;
15
- export default selectorNormalizer;
@@ -1,11 +0,0 @@
1
- import { GslSelector, ResolvedSelectors } from './dx.domain';
2
- import { DxCommonFields, DxInternalFields } from './dxBase.types';
3
- type DecoratorForMatching = DxInternalFields & DxCommonFields;
4
- export declare class SelectorResolver {
5
- resolve(decorator: DecoratorForMatching, allSelectors: GslSelector[]): ResolvedSelectors;
6
- private collectFromAggregated;
7
- private collectFromLeaf;
8
- private rollUpSensibleDefaults;
9
- }
10
- declare const selectorResolver: SelectorResolver;
11
- export default selectorResolver;