@golemui/gui-shared 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.umd.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./resolveFormInput-DevnNiv0.cjs");require("@golemui/core");require("@golemui/gui-validators");function f(s,t,e){if(typeof t=="function"){const u=t;return{items:[{key:s,def:r=>({type:"text",...u(r)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}const n={type:"text",...t};return{items:[{key:s,def:n}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}function T(s,t,e){if(typeof t=="function"){const u=t;return{items:[{key:s,def:r=>({type:"number",...u(r)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}const n={type:"number",...t};return{items:[{key:s,def:n}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}function I(s,t,e){if(typeof t=="function"){const u=t;return{items:[{key:s,def:r=>({type:"boolean",...u(r)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}const n={type:"boolean",...t};return{items:[{key:s,def:n}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}function U(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"SELECT",items:[{key:s,def:a=>({type:"select",...o(a)})}],tags:e??[]}}const n={type:"select",...t};return{type:"ITEMS",itemType:"SELECT",items:[{key:s,def:n}],tags:e??[]}}function B(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:s,def:a=>({type:"dropdown",...o(a)})}],tags:e??[]}}const n={type:"dropdown",...t};return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:s,def:n}],tags:e??[]}}function S(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:s,def:a=>({type:"radiogroup",...o(a)})}],tags:e??[]}}const n={type:"radiogroup",...t};return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:s,def:n}],tags:e??[]}}function D(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:s,def:a=>({type:"checkbox",...o(a)})}],tags:e??[]}}const n={type:"checkbox",...t};return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:s,def:n}],tags:e??[]}}function h(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:s,def:a=>({type:"textarea",...o(a)})}],tags:e??[]}}const n={type:"textarea",...t};return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:s,def:n}],tags:e??[]}}function A(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"PASSWORD",items:[{key:s,def:a=>({type:"password",...o(a)})}],tags:e??[]}}const n={type:"password",...t};return{type:"ITEMS",itemType:"PASSWORD",items:[{key:s,def:n}],tags:e??[]}}function E(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"CURRENCY",items:[{key:s,def:a=>({type:"currency",...o(a)})}],tags:e??[]}}const n={type:"currency",...t};return{type:"ITEMS",itemType:"CURRENCY",items:[{key:s,def:n}],tags:e??[]}}function k(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:s,def:a=>({type:"markdown",...o(a)})}],tags:e??[]}}const n={type:"markdown",...t};return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:s,def:n}],tags:e??[]}}function R(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"LIST",items:[{key:s,def:a=>({type:"list",...o(a)})}],tags:e??[]}}const n={type:"list",...t};return{type:"ITEMS",itemType:"LIST",items:[{key:s,def:n}],tags:e??[]}}function M(s,t,e){if(typeof t=="function"){const u=t;return{items:[r=>({type:"calendar",path:s,...u(r)})],type:"ITEMS",itemType:"CALENDAR",tags:e??[]}}return{items:[{type:"calendar",path:s,...t}],type:"ITEMS",itemType:"CALENDAR",tags:e??[]}}function P(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:s,def:a=>({type:"dateInput",...o(a)})}],tags:e??[]}}const n={type:"dateInput",...t};return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:s,def:n}],tags:e??[]}}function w(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:s,def:a=>({type:"datePicker",...o(a)})}],tags:e??[]}}const n={type:"datePicker",...t};return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:s,def:n}],tags:e??[]}}function C(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:s,def:a=>({type:"rangeCalendar",...o(a)})}],tags:e??[]}}const n={type:"rangeCalendar",...t};return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:s,def:n}],tags:e??[]}}function x(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:s,def:a=>({type:"rangeDateInput",...o(a)})}],tags:e??[]}}const n={type:"rangeDateInput",...t};return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:s,def:n}],tags:e??[]}}function b(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:s,def:a=>({type:"rangeDatePicker",...o(a)})}],tags:e??[]}}const n={type:"rangeDatePicker",...t};return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:s,def:n}],tags:e??[]}}function L(s,t,e,n){if(typeof e=="function"){const r=e;return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:c=>({customType:s,...r(c)})}],tags:n??[]}}const u={customType:s,...e};return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:u}],tags:n??[]}}function N(s,t){return{items:[s],type:"ITEMS",itemType:i.GuiItemTypes.ACTIONS,tags:t??[]}}function G(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[y=>({customType:s,...o(y)})],tags:e??[]}}return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[{customType:s,...t}],tags:e??[]}}function F(s,t){return{type:"ITEMS",itemType:"ALERTS",items:[s],tags:t??[]}}function v(s,t,e){if(typeof t=="function"){const y=t;return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[c=>({customType:s,...y(c)})],tags:e??[]}}const{uid:n,...u}=t??{};return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[{customType:s,...n!=null?{uid:n}:{},props:Object.keys(u).length>0?u:void 0}],tags:e??[]}}const d=(s,t,e)=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{widgetName:"flex",...t??{}},children:s}],tags:e??[]}),W=(s,t,e)=>d(s,{direction:"row",...t??{}},e),Y=(s,t,e)=>d(s,{direction:"column",...t??{}},e),g=(s,t,e)=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{widgetName:"grid",direction:"row",autoFit:!0,...t??{}},children:s}],tags:e??[]}),$=(s,t,e)=>g(s,{direction:"row",...t??{}},e),j=(s,t,e)=>g(s,{direction:"column",...t??{}},e);function m(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function z(s,t,e){const n=s.map(r=>({label:r.label,uid:r.uid??m(r.label)})),u=s.map(r=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{uid:r.uid??m(r.label),direction:"column",widgetName:"flex"},children:r.children}],tags:[]}));return{type:"ITEMS",itemType:"TABS",items:[{def:{tabs:n,...t},children:u}],tags:e??[]}}function _(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function H(s,t,e){const n=s.map(r=>({label:r.label,uid:r.uid??_(r.label)})),u=s.map(r=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{uid:r.uid??_(r.label),direction:"column",widgetName:"flex"},children:r.children}],tags:[]}));return{type:"ITEMS",itemType:"ACCORDION",items:[{def:{sections:n,...t},children:u}],tags:e??[]}}function K(s,t,e,n){if(typeof e=="function"){const r=e;return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:c=>({customType:s,...r(c)}),children:t}],tags:n??[]}}return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:{customType:s,...e},children:t}],tags:n??[]}}function V(s,t,e){const{template:n,...u}=t;return{type:"ITEMS",itemType:"REPEATER",items:[{key:s,def:u,children:n}],tags:e??[]}}function Z(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"TAGS",items:[{key:s,def:a=>({type:"tags",...o(a)})}],tags:e??[]}}const n={type:"tags",...t};return{type:"ITEMS",itemType:"TAGS",items:[{key:s,def:n}],tags:e??[]}}const X=s=>i._gslInputs(s,t=>t.type==="text"),q=s=>i._gslInputs(s,t=>t.type==="number"),Q=s=>i._gslInputs(s,t=>t.type==="boolean");class l{constructor(t){this.conditions=t}static root(){return new l([])}tag(t){return new l([...this.conditions,{kind:"tagsAnd",tags:[t]}])}state(t){return new l([...this.conditions,{kind:"state",name:t}])}tagsAnd(t){return new l([...this.conditions,{kind:"tagsAnd",tags:t}])}tagsOr(t){return new l([...this.conditions,{kind:"tagsOr",tags:t}])}apply(t){if(this.conditions.length===0)return t;const e=this.conditions.find(o=>o.kind==="state"),n=this.conditions.filter(o=>o.kind!=="state"),u=t.matcher;return{...t,matcher:o=>{if(!u(o))return!1;for(const r of n){const y=o.tags??[];if(r.kind==="tagsAnd"){for(const a of r.tags)if(!y.includes(a))return!1}else{if(r.tags.length===0)continue;if(!r.tags.some(a=>y.includes(a)))return!1}}return!0},...e?{targetState:e.name}:{}}}inputs(t){return this.apply(i._gslInputs(t))}inputByUid(t,e){return this.apply(i._gslInputByUid(t,e))}textInputs(t){return this.apply(X(t))}numberInputs(t){return this.apply(q(t))}booleanInputs(t){return this.apply(Q(t))}selects(t){return this.apply(i._gslSelects(t))}selectByUid(t,e){return this.apply(i._gslSelectByUid(t,e))}dropdowns(t){return this.apply(i._gslDropdowns(t))}dropdownByUid(t,e){return this.apply(i._gslDropdownByUid(t,e))}radiogroups(t){return this.apply(i._gslRadiogroups(t))}radiogroupByUid(t,e){return this.apply(i._gslRadiogroupByUid(t,e))}checkboxes(t){return this.apply(i._gslCheckboxes(t))}checkboxByUid(t,e){return this.apply(i._gslCheckboxByUid(t,e))}textareas(t){return this.apply(i._gslTextareas(t))}textareaByUid(t,e){return this.apply(i._gslTextareaByUid(t,e))}passwords(t){return this.apply(i._gslPasswords(t))}passwordByUid(t,e){return this.apply(i._gslPasswordByUid(t,e))}currencies(t){return this.apply(i._gslCurrencies(t))}currencyByUid(t,e){return this.apply(i._gslCurrencyByUid(t,e))}markdowns(t){return this.apply(i._gslMarkdowns(t))}markdownByUid(t,e){return this.apply(i._gslMarkdownByUid(t,e))}lists(t){return this.apply(i._gslLists(t))}listByUid(t,e){return this.apply(i._gslListByUid(t,e))}calendars(t){return this.apply(i._gslCalendars(t))}calendarByUid(t,e){return this.apply(i._gslCalendarByUid(t,e))}dateInputs(t){return this.apply(i._gslDateInputs(t))}dateInputByUid(t,e){return this.apply(i._gslDateInputByUid(t,e))}datePickers(t){return this.apply(i._gslDatePickers(t))}datePickerByUid(t,e){return this.apply(i._gslDatePickerByUid(t,e))}rangeCalendars(t){return this.apply(i._gslRangeCalendars(t))}rangeCalendarByUid(t,e){return this.apply(i._gslRangeCalendarByUid(t,e))}rangeDateInputs(t){return this.apply(i._gslRangeDateInputs(t))}rangeDateInputByUid(t,e){return this.apply(i._gslRangeDateInputByUid(t,e))}rangeDatePickers(t){return this.apply(i._gslRangeDatePickers(t))}rangeDatePickerByUid(t,e){return this.apply(i._gslRangeDatePickerByUid(t,e))}repeaters(t){return this.apply(i._gslRepeaters(t))}repeaterByUid(t,e){return this.apply(i._gslRepeaterByUid(t,e))}actions(t){return this.apply(i._gslActions(t))}actionByUid(t,e){return this.apply(i._gslActionByUid(t,e))}layouts(t){return this.apply(i._gslLayouts(t))}layoutByUid(t,e){return this.apply(i._gslLayoutByUid(t,e))}displays(t){return this.apply(i._gslDisplays(t))}displayByUid(t,e){return this.apply(i._gslDisplayByUid(t,e))}alerts(t){return this.apply(i._gslAlerts(t))}alertByUid(t,e){return this.apply(i._gslAlertByUid(t,e))}tabs(t){return this.apply(i._gslTabs(t))}tabsByUid(t,e){return this.apply(i._gslTabsByUid(t,e))}accordions(t){return this.apply(i._gslAccordions(t))}accordionByUid(t,e){return this.apply(i._gslAccordionByUid(t,e))}customInputs(t){return this.apply(i._gslCustomInputs(t))}customInputByUid(t,e){return this.apply(i._gslCustomInputByUid(t,e))}customActions(t){return this.apply(i._gslCustomActions(t))}customActionByUid(t,e){return this.apply(i._gslCustomActionByUid(t,e))}customDisplays(t){return this.apply(i._gslCustomDisplays(t))}customDisplayByUid(t,e){return this.apply(i._gslCustomDisplayByUid(t,e))}customLayouts(t){return this.apply(i._gslCustomLayouts(t))}customLayoutByUid(t,e){return this.apply(i._gslCustomLayoutByUid(t,e))}}const J={inputs:{textInput:f,numberInput:T,booleanInput:I,select:U,dropdown:B,radiogroup:S,checkbox:D,textarea:h,password:A,currency:E,markdown:k,list:R,calendar:M,dateInput:P,datePicker:w,rangeCalendar:C,rangeDateInput:x,rangeDatePicker:b,repeater:V,tags:Z,custom:L},actions:{button:N,custom:G},displays:{display:i._guiDisplay,alert:F,custom:v},layouts:{flex:d,horizontalFlex:W,verticalFlex:Y,grid:g,horizontalGrid:$,verticalGrid:j,tabs:z,accordion:H,custom:K},selectors:l.root()},{gsl:ut,gslByUid:at}=i.defineShortcutType({itemType:"TAGS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(s,t)=>i.processAutoPlaceholder(i.processAutoLabel(s,t),t)},mapToWidget:s=>({uid:s.uid??"",kind:"input",type:"tags",path:s.path??"",...s.label!=null?{label:s.label}:{},...s.disabled!=null?{disabled:s.disabled}:{},...s.readonly!=null?{readonly:s.readonly}:{},...s.validator!=null?{validator:i.buildTypedValidator(s.validator,"array")}:{},props:i.extractWidgetProps(s)})});function O(s,...t){return t.map(e=>({...e,targetState:s}))}function tt(s,...t){return{kind:"aggregated",matcher:e=>e.tags?.includes(s)??!1,children:t}}class et{create(t){return{states:t.states,form:{uid:"gui-root-uid",type:"flex",kind:"layout",children:t.form}}}}function st(){return new et}const it=s=>s!==null&&typeof s=="object"&&Object.prototype.hasOwnProperty.call(s,"label")&&Object.prototype.hasOwnProperty.call(s,"value");function nt(s){return typeof s=="object"&&s!==null&&"$ref"in s&&typeof s.$ref=="string"&&Object.keys(s).length===1}async function ot(s,t){const e=new URL(s,t).href,n=await fetch(e);if(!n.ok)throw new Error(`Failed to load form chunk ${e}: ${n.status}`);const{$schema:u,...o}=await n.json();return p(o,e)}async function p(s,t){if(nt(s))return ot(s.$ref,t);const e=s;if(Array.isArray(e.children)){const n=await Promise.all(e.children.map(u=>p(u,t)));return{...e,children:n}}return s}async function rt(s,t){const e=await Promise.all(s.form.map(n=>p(n,t)));return{...s,form:e}}exports._gslAccordionByUid=i._gslAccordionByUid;exports._gslAccordions=i._gslAccordions;exports._gslActionByUid=i._gslActionByUid;exports._gslActions=i._gslActions;exports._gslAlertByUid=i._gslAlertByUid;exports._gslAlerts=i._gslAlerts;exports._gslCalendarByUid=i._gslCalendarByUid;exports._gslCalendars=i._gslCalendars;exports._gslCheckboxByUid=i._gslCheckboxByUid;exports._gslCheckboxes=i._gslCheckboxes;exports._gslCurrencies=i._gslCurrencies;exports._gslCurrencyByUid=i._gslCurrencyByUid;exports._gslCustomActionByUid=i._gslCustomActionByUid;exports._gslCustomActions=i._gslCustomActions;exports._gslCustomDisplayByUid=i._gslCustomDisplayByUid;exports._gslCustomDisplays=i._gslCustomDisplays;exports._gslCustomInputByUid=i._gslCustomInputByUid;exports._gslCustomInputs=i._gslCustomInputs;exports._gslCustomLayoutByUid=i._gslCustomLayoutByUid;exports._gslCustomLayouts=i._gslCustomLayouts;exports._gslDateInputByUid=i._gslDateInputByUid;exports._gslDateInputs=i._gslDateInputs;exports._gslDatePickerByUid=i._gslDatePickerByUid;exports._gslDatePickers=i._gslDatePickers;exports._gslDisplayByUid=i._gslDisplayByUid;exports._gslDisplays=i._gslDisplays;exports._gslDropdownByUid=i._gslDropdownByUid;exports._gslDropdowns=i._gslDropdowns;exports._gslInputByUid=i._gslInputByUid;exports._gslInputs=i._gslInputs;exports._gslLayoutByUid=i._gslLayoutByUid;exports._gslLayouts=i._gslLayouts;exports._gslListByUid=i._gslListByUid;exports._gslLists=i._gslLists;exports._gslMarkdownByUid=i._gslMarkdownByUid;exports._gslMarkdowns=i._gslMarkdowns;exports._gslPasswordByUid=i._gslPasswordByUid;exports._gslPasswords=i._gslPasswords;exports._gslRadiogroupByUid=i._gslRadiogroupByUid;exports._gslRadiogroups=i._gslRadiogroups;exports._gslRangeCalendarByUid=i._gslRangeCalendarByUid;exports._gslRangeCalendars=i._gslRangeCalendars;exports._gslRangeDateInputByUid=i._gslRangeDateInputByUid;exports._gslRangeDateInputs=i._gslRangeDateInputs;exports._gslRangeDatePickerByUid=i._gslRangeDatePickerByUid;exports._gslRangeDatePickers=i._gslRangeDatePickers;exports._gslRepeaterByUid=i._gslRepeaterByUid;exports._gslRepeaters=i._gslRepeaters;exports._gslSelectByUid=i._gslSelectByUid;exports._gslSelects=i._gslSelects;exports._gslTabs=i._gslTabs;exports._gslTabsByUid=i._gslTabsByUid;exports._gslTextareaByUid=i._gslTextareaByUid;exports._gslTextareas=i._gslTextareas;exports._guiDisplay=i._guiDisplay;exports.createGslSelector=i.createGslSelector;exports.defineShortcutType=i.defineShortcutType;exports.extractWidgetProps=i.extractWidgetProps;exports.formDefs=i.formDefs;exports.isDxDefinitions=i.isDxDefinitions;exports.processAutoLabel=i.processAutoLabel;exports.processAutoPlaceholder=i.processAutoPlaceholder;exports.resolveFormInput=i.resolveFormInput;exports._gslBooleanInputs=Q;exports._gslNumberInputs=q;exports._gslStates=O;exports._gslTag=tt;exports._gslTextInputs=X;exports._guiAccordion=H;exports._guiAlert=F;exports._guiBooleanInput=I;exports._guiButton=N;exports._guiCalendar=M;exports._guiCheckbox=D;exports._guiCurrency=E;exports._guiCustomAction=G;exports._guiCustomDisplay=v;exports._guiCustomInput=L;exports._guiCustomLayout=K;exports._guiDateInput=P;exports._guiDatePicker=w;exports._guiDropdown=B;exports._guiFlex=d;exports._guiGrid=g;exports._guiHorizontalFlex=W;exports._guiHorizontalGrid=$;exports._guiList=R;exports._guiMarkdown=k;exports._guiNumberInput=T;exports._guiPassword=A;exports._guiRadiogroup=S;exports._guiRangeCalendar=C;exports._guiRangeDateInput=x;exports._guiRangeDatePicker=b;exports._guiRepeater=V;exports._guiSelect=U;exports._guiTabs=z;exports._guiTextInput=f;exports._guiTextarea=h;exports._guiVerticalFlex=Y;exports._guiVerticalGrid=j;exports.golemForm=st;exports.gui=J;exports.isOption=it;exports.resolveChunkRefs=rt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./resolveFormInput-BkRkdOqj.cjs");require("@golemui/core");require("@golemui/gui-validators");function f(s,t,e){if(typeof t=="function"){const u=t;return{items:[{key:s,def:r=>({type:"text",...u(r)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}const n={type:"text",...t};return{items:[{key:s,def:n}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}function T(s,t,e){if(typeof t=="function"){const u=t;return{items:[{key:s,def:r=>({type:"number",...u(r)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}const n={type:"number",...t};return{items:[{key:s,def:n}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}function I(s,t,e){if(typeof t=="function"){const u=t;return{items:[{key:s,def:r=>({type:"boolean",...u(r)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}const n={type:"boolean",...t};return{items:[{key:s,def:n}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}function U(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"SELECT",items:[{key:s,def:a=>({type:"select",...o(a)})}],tags:e??[]}}const n={type:"select",...t};return{type:"ITEMS",itemType:"SELECT",items:[{key:s,def:n}],tags:e??[]}}function B(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:s,def:a=>({type:"dropdown",...o(a)})}],tags:e??[]}}const n={type:"dropdown",...t};return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:s,def:n}],tags:e??[]}}function S(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:s,def:a=>({type:"radiogroup",...o(a)})}],tags:e??[]}}const n={type:"radiogroup",...t};return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:s,def:n}],tags:e??[]}}function D(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:s,def:a=>({type:"checkbox",...o(a)})}],tags:e??[]}}const n={type:"checkbox",...t};return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:s,def:n}],tags:e??[]}}function h(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:s,def:a=>({type:"textarea",...o(a)})}],tags:e??[]}}const n={type:"textarea",...t};return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:s,def:n}],tags:e??[]}}function A(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"PASSWORD",items:[{key:s,def:a=>({type:"password",...o(a)})}],tags:e??[]}}const n={type:"password",...t};return{type:"ITEMS",itemType:"PASSWORD",items:[{key:s,def:n}],tags:e??[]}}function E(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"CURRENCY",items:[{key:s,def:a=>({type:"currency",...o(a)})}],tags:e??[]}}const n={type:"currency",...t};return{type:"ITEMS",itemType:"CURRENCY",items:[{key:s,def:n}],tags:e??[]}}function k(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:s,def:a=>({type:"markdown",...o(a)})}],tags:e??[]}}const n={type:"markdown",...t};return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:s,def:n}],tags:e??[]}}function M(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"LIST",items:[{key:s,def:a=>({type:"list",...o(a)})}],tags:e??[]}}const n={type:"list",...t};return{type:"ITEMS",itemType:"LIST",items:[{key:s,def:n}],tags:e??[]}}function R(s,t,e){if(typeof t=="function"){const u=t;return{items:[r=>({type:"calendar",path:s,...u(r)})],type:"ITEMS",itemType:"CALENDAR",tags:e??[]}}return{items:[{type:"calendar",path:s,...t}],type:"ITEMS",itemType:"CALENDAR",tags:e??[]}}function P(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:s,def:a=>({type:"dateInput",...o(a)})}],tags:e??[]}}const n={type:"dateInput",...t};return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:s,def:n}],tags:e??[]}}function w(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:s,def:a=>({type:"datePicker",...o(a)})}],tags:e??[]}}const n={type:"datePicker",...t};return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:s,def:n}],tags:e??[]}}function x(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:s,def:a=>({type:"rangeCalendar",...o(a)})}],tags:e??[]}}const n={type:"rangeCalendar",...t};return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:s,def:n}],tags:e??[]}}function C(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:s,def:a=>({type:"rangeDateInput",...o(a)})}],tags:e??[]}}const n={type:"rangeDateInput",...t};return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:s,def:n}],tags:e??[]}}function b(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:s,def:a=>({type:"rangeDatePicker",...o(a)})}],tags:e??[]}}const n={type:"rangeDatePicker",...t};return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:s,def:n}],tags:e??[]}}function L(s,t,e,n){if(typeof e=="function"){const r=e;return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:c=>({customType:s,...r(c)})}],tags:n??[]}}const u={customType:s,...e};return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:u}],tags:n??[]}}function N(s,t){return{items:[s],type:"ITEMS",itemType:i.GuiItemTypes.ACTIONS,tags:t??[]}}function G(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[y=>({customType:s,...o(y)})],tags:e??[]}}return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[{customType:s,...t}],tags:e??[]}}function F(s,t){return{type:"ITEMS",itemType:"ALERTS",items:[s],tags:t??[]}}function Q(s,t){return{type:"ITEMS",itemType:"MARKDOWN_TEXTS",items:[s],tags:t??[]}}function v(s,t,e){if(typeof t=="function"){const y=t;return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[c=>({customType:s,...y(c)})],tags:e??[]}}const{uid:n,...u}=t??{};return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[{customType:s,...n!=null?{uid:n}:{},props:Object.keys(u).length>0?u:void 0}],tags:e??[]}}const d=(s,t,e)=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{widgetName:"flex",...t??{}},children:s}],tags:e??[]}),W=(s,t,e)=>d(s,{direction:"row",...t??{}},e),K=(s,t,e)=>d(s,{direction:"column",...t??{}},e),g=(s,t,e)=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{widgetName:"grid",direction:"row",autoFit:!0,...t??{}},children:s}],tags:e??[]}),Y=(s,t,e)=>g(s,{direction:"row",...t??{}},e),$=(s,t,e)=>g(s,{direction:"column",...t??{}},e);function m(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function j(s,t,e){const n=s.map(r=>({label:r.label,uid:r.uid??m(r.label)})),u=s.map(r=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{uid:r.uid??m(r.label),direction:"column",widgetName:"flex"},children:r.children}],tags:[]}));return{type:"ITEMS",itemType:"TABS",items:[{def:{tabs:n,...t},children:u}],tags:e??[]}}function _(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function z(s,t,e){const n=s.map(r=>({label:r.label,uid:r.uid??_(r.label)})),u=s.map(r=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{uid:r.uid??_(r.label),direction:"column",widgetName:"flex"},children:r.children}],tags:[]}));return{type:"ITEMS",itemType:"ACCORDION",items:[{def:{sections:n,...t},children:u}],tags:e??[]}}function H(s,t,e,n){if(typeof e=="function"){const r=e;return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:c=>({customType:s,...r(c)}),children:t}],tags:n??[]}}return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:{customType:s,...e},children:t}],tags:n??[]}}function X(s,t,e){const{template:n,...u}=t;return{type:"ITEMS",itemType:"REPEATER",items:[{key:s,def:u,children:n}],tags:e??[]}}function Z(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"TAGS",items:[{key:s,def:a=>({type:"tags",...o(a)})}],tags:e??[]}}const n={type:"tags",...t};return{type:"ITEMS",itemType:"TAGS",items:[{key:s,def:n}],tags:e??[]}}const V=s=>i._gslInputs(s,t=>t.type==="text"),q=s=>i._gslInputs(s,t=>t.type==="number"),O=s=>i._gslInputs(s,t=>t.type==="boolean"),{gsl:J,gslByUid:tt}=i.defineShortcutType({itemType:"MARKDOWN_TEXTS",entryShape:"bare",mapToWidget:s=>({uid:s.uid??"",kind:"display",type:"markdownText",props:{md:s.md}})});class l{constructor(t){this.conditions=t}static root(){return new l([])}tag(t){return new l([...this.conditions,{kind:"tagsAnd",tags:[t]}])}state(t){return new l([...this.conditions,{kind:"state",name:t}])}tagsAnd(t){return new l([...this.conditions,{kind:"tagsAnd",tags:t}])}tagsOr(t){return new l([...this.conditions,{kind:"tagsOr",tags:t}])}apply(t){if(this.conditions.length===0)return t;const e=this.conditions.find(o=>o.kind==="state"),n=this.conditions.filter(o=>o.kind!=="state"),u=t.matcher;return{...t,matcher:o=>{if(!u(o))return!1;for(const r of n){const y=o.tags??[];if(r.kind==="tagsAnd"){for(const a of r.tags)if(!y.includes(a))return!1}else{if(r.tags.length===0)continue;if(!r.tags.some(a=>y.includes(a)))return!1}}return!0},...e?{targetState:e.name}:{}}}inputs(t){return this.apply(i._gslInputs(t))}inputByUid(t,e){return this.apply(i._gslInputByUid(t,e))}textInputs(t){return this.apply(V(t))}numberInputs(t){return this.apply(q(t))}booleanInputs(t){return this.apply(O(t))}selects(t){return this.apply(i._gslSelects(t))}selectByUid(t,e){return this.apply(i._gslSelectByUid(t,e))}dropdowns(t){return this.apply(i._gslDropdowns(t))}dropdownByUid(t,e){return this.apply(i._gslDropdownByUid(t,e))}radiogroups(t){return this.apply(i._gslRadiogroups(t))}radiogroupByUid(t,e){return this.apply(i._gslRadiogroupByUid(t,e))}checkboxes(t){return this.apply(i._gslCheckboxes(t))}checkboxByUid(t,e){return this.apply(i._gslCheckboxByUid(t,e))}textareas(t){return this.apply(i._gslTextareas(t))}textareaByUid(t,e){return this.apply(i._gslTextareaByUid(t,e))}passwords(t){return this.apply(i._gslPasswords(t))}passwordByUid(t,e){return this.apply(i._gslPasswordByUid(t,e))}currencies(t){return this.apply(i._gslCurrencies(t))}currencyByUid(t,e){return this.apply(i._gslCurrencyByUid(t,e))}markdowns(t){return this.apply(i._gslMarkdowns(t))}markdownByUid(t,e){return this.apply(i._gslMarkdownByUid(t,e))}lists(t){return this.apply(i._gslLists(t))}listByUid(t,e){return this.apply(i._gslListByUid(t,e))}calendars(t){return this.apply(i._gslCalendars(t))}calendarByUid(t,e){return this.apply(i._gslCalendarByUid(t,e))}dateInputs(t){return this.apply(i._gslDateInputs(t))}dateInputByUid(t,e){return this.apply(i._gslDateInputByUid(t,e))}datePickers(t){return this.apply(i._gslDatePickers(t))}datePickerByUid(t,e){return this.apply(i._gslDatePickerByUid(t,e))}rangeCalendars(t){return this.apply(i._gslRangeCalendars(t))}rangeCalendarByUid(t,e){return this.apply(i._gslRangeCalendarByUid(t,e))}rangeDateInputs(t){return this.apply(i._gslRangeDateInputs(t))}rangeDateInputByUid(t,e){return this.apply(i._gslRangeDateInputByUid(t,e))}rangeDatePickers(t){return this.apply(i._gslRangeDatePickers(t))}rangeDatePickerByUid(t,e){return this.apply(i._gslRangeDatePickerByUid(t,e))}repeaters(t){return this.apply(i._gslRepeaters(t))}repeaterByUid(t,e){return this.apply(i._gslRepeaterByUid(t,e))}actions(t){return this.apply(i._gslActions(t))}actionByUid(t,e){return this.apply(i._gslActionByUid(t,e))}layouts(t){return this.apply(i._gslLayouts(t))}layoutByUid(t,e){return this.apply(i._gslLayoutByUid(t,e))}displays(t){return this.apply(i._gslDisplays(t))}displayByUid(t,e){return this.apply(i._gslDisplayByUid(t,e))}alerts(t){return this.apply(i._gslAlerts(t))}alertByUid(t,e){return this.apply(i._gslAlertByUid(t,e))}markdownTexts(t){return this.apply(J(t))}markdownTextByUid(t,e){return this.apply(tt(t,e))}tabs(t){return this.apply(i._gslTabs(t))}tabsByUid(t,e){return this.apply(i._gslTabsByUid(t,e))}accordions(t){return this.apply(i._gslAccordions(t))}accordionByUid(t,e){return this.apply(i._gslAccordionByUid(t,e))}customInputs(t){return this.apply(i._gslCustomInputs(t))}customInputByUid(t,e){return this.apply(i._gslCustomInputByUid(t,e))}customActions(t){return this.apply(i._gslCustomActions(t))}customActionByUid(t,e){return this.apply(i._gslCustomActionByUid(t,e))}customDisplays(t){return this.apply(i._gslCustomDisplays(t))}customDisplayByUid(t,e){return this.apply(i._gslCustomDisplayByUid(t,e))}customLayouts(t){return this.apply(i._gslCustomLayouts(t))}customLayoutByUid(t,e){return this.apply(i._gslCustomLayoutByUid(t,e))}}const et={inputs:{textInput:f,numberInput:T,booleanInput:I,select:U,dropdown:B,radiogroup:S,checkbox:D,textarea:h,password:A,currency:E,markdown:k,list:M,calendar:R,dateInput:P,datePicker:w,rangeCalendar:x,rangeDateInput:C,rangeDatePicker:b,repeater:X,tags:Z,custom:L},actions:{button:N,custom:G},displays:{display:i._guiDisplay,alert:F,markdownText:Q,custom:v},layouts:{flex:d,horizontalFlex:W,verticalFlex:K,grid:g,horizontalGrid:Y,verticalGrid:$,tabs:j,accordion:z,custom:H},selectors:l.root()},{gsl:lt,gslByUid:ct}=i.defineShortcutType({itemType:"TAGS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(s,t)=>i.processAutoPlaceholder(i.processAutoLabel(s,t),t)},mapToWidget:s=>({uid:s.uid??"",kind:"input",type:"tags",path:s.path??"",...s.label!=null?{label:s.label}:{},...s.disabled!=null?{disabled:s.disabled}:{},...s.readonly!=null?{readonly:s.readonly}:{},...s.validator!=null?{validator:i.buildTypedValidator(s.validator,"array")}:{},props:i.extractWidgetProps(s)})});function st(s,...t){return t.map(e=>({...e,targetState:s}))}function it(s,...t){return{kind:"aggregated",matcher:e=>e.tags?.includes(s)??!1,children:t}}class nt{create(t){return{states:t.states,form:{uid:"gui-root-uid",type:"flex",kind:"layout",children:t.form}}}}function ot(){return new nt}const rt=s=>s!==null&&typeof s=="object"&&Object.prototype.hasOwnProperty.call(s,"label")&&Object.prototype.hasOwnProperty.call(s,"value");function ut(s){return typeof s=="object"&&s!==null&&"$ref"in s&&typeof s.$ref=="string"&&Object.keys(s).length===1}async function at(s,t){const e=new URL(s,t).href,n=await fetch(e);if(!n.ok)throw new Error(`Failed to load form chunk ${e}: ${n.status}`);const{$schema:u,...o}=await n.json();return p(o,e)}async function p(s,t){if(ut(s))return at(s.$ref,t);const e=s;if(Array.isArray(e.children)){const n=await Promise.all(e.children.map(u=>p(u,t)));return{...e,children:n}}return s}async function yt(s,t){const e=await Promise.all(s.form.map(n=>p(n,t)));return{...s,form:e}}exports._gslAccordionByUid=i._gslAccordionByUid;exports._gslAccordions=i._gslAccordions;exports._gslActionByUid=i._gslActionByUid;exports._gslActions=i._gslActions;exports._gslAlertByUid=i._gslAlertByUid;exports._gslAlerts=i._gslAlerts;exports._gslCalendarByUid=i._gslCalendarByUid;exports._gslCalendars=i._gslCalendars;exports._gslCheckboxByUid=i._gslCheckboxByUid;exports._gslCheckboxes=i._gslCheckboxes;exports._gslCurrencies=i._gslCurrencies;exports._gslCurrencyByUid=i._gslCurrencyByUid;exports._gslCustomActionByUid=i._gslCustomActionByUid;exports._gslCustomActions=i._gslCustomActions;exports._gslCustomDisplayByUid=i._gslCustomDisplayByUid;exports._gslCustomDisplays=i._gslCustomDisplays;exports._gslCustomInputByUid=i._gslCustomInputByUid;exports._gslCustomInputs=i._gslCustomInputs;exports._gslCustomLayoutByUid=i._gslCustomLayoutByUid;exports._gslCustomLayouts=i._gslCustomLayouts;exports._gslDateInputByUid=i._gslDateInputByUid;exports._gslDateInputs=i._gslDateInputs;exports._gslDatePickerByUid=i._gslDatePickerByUid;exports._gslDatePickers=i._gslDatePickers;exports._gslDisplayByUid=i._gslDisplayByUid;exports._gslDisplays=i._gslDisplays;exports._gslDropdownByUid=i._gslDropdownByUid;exports._gslDropdowns=i._gslDropdowns;exports._gslInputByUid=i._gslInputByUid;exports._gslInputs=i._gslInputs;exports._gslLayoutByUid=i._gslLayoutByUid;exports._gslLayouts=i._gslLayouts;exports._gslListByUid=i._gslListByUid;exports._gslLists=i._gslLists;exports._gslMarkdownByUid=i._gslMarkdownByUid;exports._gslMarkdowns=i._gslMarkdowns;exports._gslPasswordByUid=i._gslPasswordByUid;exports._gslPasswords=i._gslPasswords;exports._gslRadiogroupByUid=i._gslRadiogroupByUid;exports._gslRadiogroups=i._gslRadiogroups;exports._gslRangeCalendarByUid=i._gslRangeCalendarByUid;exports._gslRangeCalendars=i._gslRangeCalendars;exports._gslRangeDateInputByUid=i._gslRangeDateInputByUid;exports._gslRangeDateInputs=i._gslRangeDateInputs;exports._gslRangeDatePickerByUid=i._gslRangeDatePickerByUid;exports._gslRangeDatePickers=i._gslRangeDatePickers;exports._gslRepeaterByUid=i._gslRepeaterByUid;exports._gslRepeaters=i._gslRepeaters;exports._gslSelectByUid=i._gslSelectByUid;exports._gslSelects=i._gslSelects;exports._gslTabs=i._gslTabs;exports._gslTabsByUid=i._gslTabsByUid;exports._gslTextareaByUid=i._gslTextareaByUid;exports._gslTextareas=i._gslTextareas;exports._guiDisplay=i._guiDisplay;exports.createGslSelector=i.createGslSelector;exports.defineShortcutType=i.defineShortcutType;exports.extractWidgetProps=i.extractWidgetProps;exports.formDefs=i.formDefs;exports.isDxDefinitions=i.isDxDefinitions;exports.processAutoLabel=i.processAutoLabel;exports.processAutoPlaceholder=i.processAutoPlaceholder;exports.resolveFormInput=i.resolveFormInput;exports._gslBooleanInputs=O;exports._gslNumberInputs=q;exports._gslStates=st;exports._gslTag=it;exports._gslTextInputs=V;exports._guiAccordion=z;exports._guiAlert=F;exports._guiBooleanInput=I;exports._guiButton=N;exports._guiCalendar=R;exports._guiCheckbox=D;exports._guiCurrency=E;exports._guiCustomAction=G;exports._guiCustomDisplay=v;exports._guiCustomInput=L;exports._guiCustomLayout=H;exports._guiDateInput=P;exports._guiDatePicker=w;exports._guiDropdown=B;exports._guiFlex=d;exports._guiGrid=g;exports._guiHorizontalFlex=W;exports._guiHorizontalGrid=Y;exports._guiList=M;exports._guiMarkdown=k;exports._guiNumberInput=T;exports._guiPassword=A;exports._guiRadiogroup=S;exports._guiRangeCalendar=x;exports._guiRangeDateInput=C;exports._guiRangeDatePicker=b;exports._guiRepeater=X;exports._guiSelect=U;exports._guiTabs=j;exports._guiTextInput=f;exports._guiTextarea=h;exports._guiVerticalFlex=K;exports._guiVerticalGrid=$;exports.golemForm=ot;exports.gui=et;exports.isOption=rt;exports.resolveChunkRefs=yt;
package/internals.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aa as f } from "./resolveFormInput-ZK1cOA9Y.js";
1
+ import { aa as f } from "./resolveFormInput-DoBisQ5Q.js";
2
2
  function o(e, n) {
3
3
  if (e != null && typeof e == "object" && "__rid" in e)
4
4
  return e.__rid;
package/internals.umd.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./resolveFormInput-DevnNiv0.cjs");function n(e,t){if(e!=null&&typeof e=="object"&&"__rid"in e)return e.__rid;const r=t();return Object.defineProperty(e,"__rid",{value:r,enumerable:!1,configurable:!1}),r}exports.resolveFormInput=o.resolveFormInput;exports.getItemKey=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./resolveFormInput-BkRkdOqj.cjs");function n(e,t){if(e!=null&&typeof e=="object"&&"__rid"in e)return e.__rid;const r=t();return Object.defineProperty(e,"__rid",{value:r,enumerable:!1,configurable:!1}),r}exports.resolveFormInput=o.resolveFormInput;exports.getItemKey=n;
package/lib/dx/gui.d.ts CHANGED
@@ -20,6 +20,7 @@ import { _guiCustomInput } from './shortcuts/custom-input/guiCustomInput.impl';
20
20
  import { _guiButton } from './shortcuts/actions/guiActions.impl';
21
21
  import { _guiCustomAction } from './shortcuts/custom-action/guiCustomAction.impl';
22
22
  import { _guiAlert } from './shortcuts/alert/guiAlert.impl';
23
+ import { _guiMarkdownText } from './shortcuts/markdown-text/guiMarkdownText.impl';
23
24
  import { _guiCustomDisplay } from './shortcuts/custom-display/guiCustomDisplay.impl';
24
25
  import { _guiTabs } from './shortcuts/tabs/guiTabs.impl';
25
26
  import { _guiAccordion } from './shortcuts/accordion/guiAccordion.impl';
@@ -58,6 +59,7 @@ export declare const gui: {
58
59
  readonly displays: {
59
60
  readonly display: (render: (params: import('./formDef.domain').DxRuntimeParams) => any, tags?: string[]) => import('./shortcuts/display/display.domain').GuiDisplayItemsShortcut;
60
61
  readonly alert: typeof _guiAlert;
62
+ readonly markdownText: typeof _guiMarkdownText;
61
63
  readonly custom: typeof _guiCustomDisplay;
62
64
  };
63
65
  readonly layouts: {
package/lib/dx/index.d.ts CHANGED
@@ -19,6 +19,7 @@ export { _guiTextInput } from './shortcuts/inputs/guiTextInput.impl';
19
19
  export { _guiFlex, _guiGrid, _guiHorizontalFlex, _guiHorizontalGrid, _guiVerticalFlex, _guiVerticalGrid, } from './shortcuts/layouts/guiFlex.impl';
20
20
  export { _guiList } from './shortcuts/list/guiList.impl';
21
21
  export { _guiMarkdown } from './shortcuts/markdown/guiMarkdown.impl';
22
+ export { _guiMarkdownText } from './shortcuts/markdown-text/guiMarkdownText.impl';
22
23
  export { _guiPassword } from './shortcuts/password/guiPassword.impl';
23
24
  export { _guiRadiogroup } from './shortcuts/radiogroup/guiRadiogroup.impl';
24
25
  export { _guiRangeCalendar } from './shortcuts/range-calendar/guiRangeCalendar.impl';
@@ -48,6 +49,7 @@ export { _gslInputByUid, _gslInputs } from './shortcuts/inputs/register';
48
49
  export { _gslLayoutByUid, _gslLayouts } from './shortcuts/layouts/register';
49
50
  export { _gslListByUid, _gslLists } from './shortcuts/list/register';
50
51
  export { _gslMarkdownByUid, _gslMarkdowns } from './shortcuts/markdown/register';
52
+ export { _gslMarkdownTextByUid, _gslMarkdownTexts } from './shortcuts/markdown-text/register';
51
53
  export { _gslPasswordByUid, _gslPasswords } from './shortcuts/password/register';
52
54
  export { _gslRadiogroupByUid, _gslRadiogroups } from './shortcuts/radiogroup/register';
53
55
  export { _gslRangeCalendarByUid, _gslRangeCalendars } from './shortcuts/range-calendar/register';
@@ -0,0 +1,6 @@
1
+ import { DxRuntimeParams } from '../../core/dxUtilityTypes';
2
+ import { GuiMarkdownTextShortcut, MarkdownTextDecorator } from './markdownText.domain';
3
+ type MarkdownTextFactoryProps = MarkdownTextDecorator;
4
+ export declare function _guiMarkdownText(props: MarkdownTextFactoryProps, tags?: string[]): GuiMarkdownTextShortcut;
5
+ export declare function _guiMarkdownText(callback: (params: DxRuntimeParams) => MarkdownTextFactoryProps, tags?: string[]): GuiMarkdownTextShortcut;
6
+ export {};
@@ -0,0 +1,9 @@
1
+ import { MarkdownTextProps } from '../../../widget.props';
2
+ import { DxCommonFields } from '../../core/dxBase.types';
3
+ import { DefOrCallback, GslConfigBase, GuiShortcutOf } from '../../core/dxUtilityTypes';
4
+ export interface MarkdownTextDecorator extends DxCommonFields, Partial<MarkdownTextProps> {
5
+ md: string;
6
+ }
7
+ export type GslMarkdownTextsConfig = GslConfigBase<MarkdownTextDecorator>;
8
+ export type MarkdownTextEntry = DefOrCallback<MarkdownTextDecorator>;
9
+ export type GuiMarkdownTextShortcut = GuiShortcutOf<'MARKDOWN_TEXTS', MarkdownTextEntry>;
@@ -0,0 +1,2 @@
1
+ import { GslMarkdownTextsConfig, MarkdownTextDecorator } from './markdownText.domain';
2
+ export declare const _gslMarkdownTexts: (config: GslMarkdownTextsConfig, matcher?: ((decorator: MarkdownTextDecorator) => boolean) | undefined) => import('../../core/dx.domain').GslLeafSelector, _gslMarkdownTextByUid: (uid: string, config: GslMarkdownTextsConfig) => import('../../core/dx.domain').GslLeafSelector;
@@ -21,6 +21,7 @@ import { _gslActions, _gslActionByUid } from '../actions/register';
21
21
  import { _gslLayouts, _gslLayoutByUid } from '../layouts/register';
22
22
  import { _gslDisplays, _gslDisplayByUid } from '../display/register';
23
23
  import { _gslAlerts, _gslAlertByUid } from '../alert/register';
24
+ import { _gslMarkdownTexts, _gslMarkdownTextByUid } from '../markdown-text/register';
24
25
  import { _gslTabs, _gslTabsByUid } from '../tabs/register';
25
26
  import { _gslAccordions, _gslAccordionByUid } from '../accordion/register';
26
27
  import { _gslCustomInputs, _gslCustomInputByUid } from '../custom-input/register';
@@ -83,6 +84,8 @@ export declare class ScopeChain {
83
84
  displayByUid(uid: string, config: CfgByUid<typeof _gslDisplayByUid>): GslLeafSelector;
84
85
  alerts(config: CfgGsl<typeof _gslAlerts>): GslLeafSelector;
85
86
  alertByUid(uid: string, config: CfgByUid<typeof _gslAlertByUid>): GslLeafSelector;
87
+ markdownTexts(config: CfgGsl<typeof _gslMarkdownTexts>): GslLeafSelector;
88
+ markdownTextByUid(uid: string, config: CfgByUid<typeof _gslMarkdownTextByUid>): GslLeafSelector;
86
89
  tabs(config: CfgGsl<typeof _gslTabs>): GslLeafSelector;
87
90
  tabsByUid(uid: string, config: CfgByUid<typeof _gslTabsByUid>): GslLeafSelector;
88
91
  accordions(config: CfgGsl<typeof _gslAccordions>): GslLeafSelector;
package/lib/widgets.d.ts CHANGED
@@ -2,7 +2,7 @@ export declare const inputWidgets: readonly ["calendar", "checkbox", "currency",
2
2
  export declare const layoutWidgets: readonly ["accordion", "flex", "grid", "tabs"];
3
3
  export declare const displayWidgets: readonly ["alert", "markdownText", "renderer"];
4
4
  export declare const actionWidgets: readonly ["button"];
5
- export declare const golemWidgets: ("number" | "button" | "repeater" | "flex" | "tags" | "password" | "checkbox" | "dateInput" | "currency" | "rangeCalendar" | "select" | "radiogroup" | "tabs" | "list" | "datePicker" | "dropdown" | "markdown" | "rangeDateInput" | "rangeDatePicker" | "textarea" | "calendar" | "grid" | "toggle" | "textinput" | "renderer" | "alert" | "accordion" | "markdownText")[];
5
+ export declare const golemWidgets: ("number" | "button" | "repeater" | "flex" | "tags" | "password" | "checkbox" | "dateInput" | "currency" | "rangeCalendar" | "select" | "radiogroup" | "tabs" | "list" | "datePicker" | "dropdown" | "markdown" | "rangeDateInput" | "rangeDatePicker" | "textarea" | "calendar" | "grid" | "toggle" | "textinput" | "renderer" | "alert" | "markdownText" | "accordion")[];
6
6
  export type GolemInputWidget = (typeof inputWidgets)[number];
7
7
  export type GolemLayoutWidget = (typeof layoutWidgets)[number];
8
8
  export type GolemDisplayWidget = (typeof displayWidgets)[number];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemui/gui-shared",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "type": "module",
5
5
  "main": "./index.umd.cjs",
6
6
  "module": "./index.js",
@@ -30,8 +30,8 @@
30
30
  "*.md"
31
31
  ],
32
32
  "dependencies": {
33
- "@golemui/core": "0.15.0",
34
- "@golemui/gui-validators": "0.15.0"
33
+ "@golemui/core": "0.16.0",
34
+ "@golemui/gui-validators": "0.16.0"
35
35
  },
36
36
  "repository": {
37
37
  "type": "git",
@@ -1 +1 @@
1
- "use strict";require("@golemui/core");const O={INPUTS:"INPUTS",ACTIONS:"ACTIONS",LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"};function B(e){return function(t,s=()=>!0){return{kind:"leaf",selectorType:e,matcher:s,config:t}}}function m(e,t){return typeof e=="function"?e:{type:t,...e??{}}}const x=(e,t)=>({type:"ITEMS",itemType:O.DISPLAYS,items:[{render:e}],tags:t??[]}),C=new Map;function F(e,t){if(C.has(e))throw new Error(`Item type "${e}" is already registered.`);C.set(e,t)}function f(e){const t=C.get(e);if(!t)throw new Error(`No handler registered for item type "${e}". Did you forget to import the registration module?`);return t}function j(e){return C.has(e)}function d(e){const t=o=>{if(!e.sensibleDefaults)return{};let r={...e.sensibleDefaults.base};for(const u of o){const p=u.config;for(const c of e.sensibleDefaults.fields){const b=c;p[b]!=null&&(r={...r,[b]:p[b]})}}return r},s=(o,r)=>e.sensibleDefaults?e.sensibleDefaults.apply(o,r):o,n=o=>{switch(e.entryShape){case"bare":return{baseDef:o};case"keyed":{const r=o;return{baseDef:r.def,path:r.key}}case"compound":{const r=o;return{baseDef:r.def,children:r.children}}}},l={rollUpSensibleDefaults:t,applySensibleDefaults:s,mapToWidget:e.mapToWidget,parseEntry:n,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}};F(e.itemType,l);const a=B(e.itemType);return{gsl:a,gslByUid:(o,r)=>a(r,(u=>u.uid===o))}}function y(e){const{uid:t,path:s,label:n,disabled:l,readonly:a,defaultValue:i,tags:o,type:r,size:u,onLoad:p,onChange:c,onFilter:b,on:A,states:U,include:k,exclude:P,validator:I,...S}=e;return S}function H(e){return e?e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()):""}function g(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:H(e.path)}}function T(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}function q(e){switch(e.type){case"text":return J(e);case"number":return Q(e);case"boolean":return Z(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function Z(e){const t=y(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:m(e.validator,"boolean")}:{},props:t}}function J(e){const t=y(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:m(e.validator,"string")}}function Q(e){const t=y(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:m(e.validator,"number")}}const{gsl:ee,gslByUid:te}=d({itemType:"INPUTS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let s=g(e,t);return s=T(s,t),s}},mapToWidget:q}),{gsl:se,gslByUid:le}=d({itemType:"SELECT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:y(e)})}),{gsl:ne,gslByUid:ae}=d({itemType:"DROPDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:y(e)})}),{gsl:ie,gslByUid:re}=d({itemType:"RADIOGROUP",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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:y(e)})}),{gsl:oe,gslByUid:ue}=d({itemType:"CHECKBOX",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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:m(e.validator,"boolean")}:{},props:y(e)})}),{gsl:pe,gslByUid:de}=d({itemType:"TEXTAREA",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:m(e.validator,"string")}:{},props:y(e)})}),{gsl:ce,gslByUid:ye}=d({itemType:"PASSWORD",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:m(e.validator,"string")}:{},props:y(e)})}),{gsl:be,gslByUid:ge}=d({itemType:"CURRENCY",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:m(e.validator,"number")}:{},props:y(e)})}),{gsl:me,gslByUid:he}=d({itemType:"MARKDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:m(e.validator,"string")}:{},props:y(e)})}),{gsl:_e,gslByUid:Te}=d({itemType:"LIST",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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:y(e)})}),{gsl:Ae,gslByUid:Se}=d({itemType:"CALENDAR",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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:m(e.validator,"string")}:{},props:y(e)})}),{gsl:Ue,gslByUid:ke}=d({itemType:"DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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:m(e.validator,"string")}:{},props:y(e)})}),{gsl:Ce,gslByUid:fe}=d({itemType:"DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:m(e.validator,"string")}:{},props:y(e)})}),{gsl:ve,gslByUid:De}=d({itemType:"RANGE_CALENDAR",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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:m(e.validator,"array")}:{},props:y(e)})}),{gsl:Le,gslByUid:Oe}=d({itemType:"RANGE_DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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:m(e.validator,"array")}:{},props:y(e)})}),{gsl:Be,gslByUid:Ee}=d({itemType:"RANGE_DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:m(e.validator,"array")}:{},props:y(e)})});function Pe(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 Ie(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:m(e.validator,"array")}:{},props:{...Pe(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function L(e,t){for(const s of e){if(typeof s=="function")continue;const n=s;typeof n.path=="string"&&n.path&&(n.path=t+n.path),"children"in n&&Array.isArray(n.children)&&L(n.children,t);const l=n.props;l?.template?.children&&Array.isArray(l.template.children)&&L(l.template.children,t)}}function we(e,t){const s=t.walkChildren(t.children??[]),n=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";n&&L(s,n+".items.");const l={kind:"layout",type:"flex",uid:"",children:s,props:{direction:"column"}};if(e.kind==="static"){const i=t.mapStaticDef(e.def,"REPEATER");return{...i,props:{...i.props,template:l}}}const a=e.fn;return(i=>{const o=a(i),r=t.mapStaticDef(o,"REPEATER");return{...r,props:{...r.props,template:l}}})}function We(e){return{baseDef:e.def,path:e.key,children:e.children}}function Re(e){return e.children}const Me={parseEntry:We,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:Ie,buildCustomWidget:we,getChildren:Re};F("REPEATER",Me);const $=B("REPEATER"),Ne=(e,t)=>$(t,(s=>s.uid===e)),Y={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},xe=Object.keys(Y);class Fe{extractOnClickFromMergeResult(t,s,n){if(t.kind==="dynamic"){const i=t.fn;return{kind:"dynamic",fn:r=>{const u=i(r);return this.wireOnClick(u,s,n)}}}const l=t.def;return{kind:"static",def:this.wireOnClick(l,s,n)}}wireOnClick(t,s,n){const l=n.next(),a=t.onClick;if(typeof a=="function"){const{onClick:i,...o}=t,r=a(void 0);return typeof r=="string"?{...o,uid:l,on:{click:r}}:(s.set(l,u=>a(u.data)),{...o,uid:l,on:{click:l}})}return{...t,uid:l}}wireInputLayoutEvents(t,s,n){if(t.kind==="dynamic"){const a=t.fn;return{kind:"dynamic",fn:o=>{const r=a(o);return this.wireEventProperties(r,s,n)}}}return{kind:"static",def:this.wireEventProperties(t.def,s,n)}}wireEventProperties(t,s,n){const l={...t.on||{}};let a=!1;const i={...t};for(const o of xe){const r=t[o];if(r==null)continue;const u=Y[o];if(typeof r=="function"){const p=n.next();s.set(p,r),l[u]=p,a=!0}else typeof r=="string"&&(l[u]=r,a=!0);delete i[o]}return a&&(i.on=l),i}}const E=new Fe;function je(e){const{uid:t,label:s,actionType:n,disabled:l,on:a,onClick:i,data:o,type:r,tags:u,size:p,include:c,exclude:b,states:A,...U}=e;return{uid:t??"",kind:"action",type:"button",disabled:l,actionType:n,label:s,...a!=null?{on:a}:{},props:U}}const{gsl:$e,gslByUid:Ye}=d({itemType:"ACTIONS",entryShape:"bare",mapToWidget:je,afterMerge:(e,t)=>E.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});function ze(e){const{uid:t,widgetName:s,tags:n,size:l,onChange:a,include:i,exclude:o,...r}=e,{on:u,...p}=r;return{uid:t??"",kind:"layout",type:s??"flex",props:{direction:p.direction??"column",...p},children:[]}}function Ve(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"LAYOUTS"),children:s}})}function Ke(e){return e.children}const{gsl:Ge,gslByUid:Xe}=d({itemType:"LAYOUTS",entryShape:"compound",mapToWidget:ze,buildCustomWidget:Ve,getChildren:Ke});function He(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function qe(e,t){if(e.kind==="static"){const n=e.def;return(l=>({uid:"",kind:"display",type:"renderer",...n.include!=null?{include:n.include}:{},...n.exclude!=null?{exclude:n.exclude}:{},props:{render:n.render(l??{})}}))}const s=e.fn;return(n=>{const l=s(n);return{uid:"",kind:"display",type:"renderer",...l.include!=null?{include:l.include}:{},...l.exclude!=null?{exclude:l.exclude}:{},props:{render:l.render(n??{})}}})}const{gsl:Ze,gslByUid:Je}=d({itemType:"DISPLAYS",entryShape:"bare",mapToWidget:He,buildCustomWidget:qe}),{gsl:Qe,gslByUid:et}=d({itemType:"ALERTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})});function tt(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 st(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"TABS"),children:s}})}function lt(e){return e.children}const{gsl:nt,gslByUid:at}=d({itemType:"TABS",entryShape:"compound",mapToWidget:tt,buildCustomWidget:st,getChildren:lt});function it(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 rt(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"ACCORDION"),children:s}})}function ot(e){return e.children}const{gsl:ut,gslByUid:pt}=d({itemType:"ACCORDION",entryShape:"compound",mapToWidget:it,buildCustomWidget:rt,getChildren:ot}),{gsl:dt,gslByUid:ct}=d({itemType:"CUSTOM_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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??{}})}),{gsl:yt,gslByUid:bt}=d({itemType:"CUSTOM_ACTION",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:s,disabled:n,on:l,onClick:a,data:i,customType:o,tags:r,size:u,include:p,exclude:c,states:b,props:A,...U}=e;return{uid:t??"",kind:"action",type:e.customType,label:s,disabled:n,...l!=null?{on:l}:{},props:{...A,...U}}},afterMerge:(e,t)=>E.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),{gsl:gt,gslByUid:mt}=d({itemType:"CUSTOM_DISPLAY",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})});function ht(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function _t(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"CUSTOM_LAYOUT"),children:s}})}function Tt(e){return e.children}const{gsl:At,gslByUid:St}=d({itemType:"CUSTOM_LAYOUT",entryShape:"compound",mapToWidget:ht,buildCustomWidget:_t,getChildren:Tt}),z={INPUTS:new Set(["INPUTS","TEXTAREA","PASSWORD","SELECT","DROPDOWN","RADIOGROUP","CHECKBOX","CALENDAR","DATE_INPUT","DATE_PICKER","RANGE_CALENDAR","RANGE_DATE_INPUT","RANGE_DATE_PICKER","CURRENCY","MARKDOWN","LIST","CUSTOM_INPUT","REPEATER","TAGS"]),ACTIONS:new Set(["ACTIONS","CUSTOM_ACTION"]),DISPLAYS:new Set(["DISPLAYS","ALERTS","CUSTOM_DISPLAY"]),LAYOUTS:new Set(["LAYOUTS","TABS","ACCORDION","CUSTOM_LAYOUT"])};function Ut(e,t){const s=z[e];return s?s.has(t):e===t}class kt{resolve(t,s){const n=[];for(const a of s)a.kind==="aggregated"?this.collectFromAggregated(a,t,n):this.collectFromLeaf(a,t,n);const l=this.rollUpSensibleDefaults(n);return{leafSelectors:n,sensibleDefaults:l}}collectFromAggregated(t,s,n){if(t.matcher(s))for(const l of t.children)this.collectFromLeaf(l,s,n)}collectFromLeaf(t,s,n){Ut(t.selectorType,s.itemType??"")&&t.matcher(s)&&n.push(t)}rollUpSensibleDefaults(t){const s=new Map,n=(a,i)=>{const o=s.get(a)??[];o.push(i),s.set(a,o)};for(const a of t){const i=z[a.selectorType];if(i)for(const o of i)n(o,a);else n(a.selectorType,a)}const l={};for(const[a,i]of s)j(a)&&(l[a]=f(a).rollUpSensibleDefaults(i));return l}}const Ct=new kt;class ft{deepMerge(t,s){if(s==null)return t;if(t==null||typeof t!="object"||typeof s!="object"||Array.isArray(t)||Array.isArray(s))return s;const n={...t};for(const l in s)Object.prototype.hasOwnProperty.call(s,l)&&(typeof s[l]=="object"&&!Array.isArray(s[l])&&s[l]!==null&&typeof t[l]=="object"&&!Array.isArray(t[l])&&t[l]!==null?n[l]=this.deepMerge(t[l],s[l]):n[l]=s[l]);return n}}const vt=new ft;class Dt{constructor(t){this.objectUtils=t}merge(t,s,n){let l={},a=null;typeof t=="function"&&(a=t);const i=this.collectDecorators(n);for(const u of i){if(a!=null){a=this.composeRuntimeFunctions(a,u);continue}if(typeof u=="function"){const p=u({...l,...typeof t=="function"?{}:t});if(typeof p=="function"){a=this.createPromotedFunction(l,t,p,s,n);continue}l=this.objectUtils.deepMerge(l,p)}else l=this.objectUtils.deepMerge(l,u)}if(a!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(a,l,s,n)};const o=this.objectUtils.deepMerge(t,l);return{kind:"static",def:this.applySensibleDefaults({...o},s,n)}}collectDecorators(t){const s=[];for(const n of t.leafSelectors){const l=n.config;l.override!=null&&s.push(l.override)}return s}applySensibleDefaults(t,s,n){if(!j(s))return t;const l=n.sensibleDefaults[s]??{};return f(s).applySensibleDefaults(t,l)}createPromotedFunction(t,s,n,l,a){return i=>{const o=n(i);let r=this.objectUtils.deepMerge(t,o);return r=this.objectUtils.deepMerge(r,s),this.applySensibleDefaults(r,l,a)}}wrapWithSensibleDefaults(t,s,n,l){return a=>{let i=t(a);return Object.keys(s).length>0&&(i=this.objectUtils.deepMerge(s,i)),this.applySensibleDefaults(i,n,l)}}composeRuntimeFunctions(t,s){return typeof s=="function"?n=>{const l=t(n),a=s(l);return typeof a=="function"?a(n):this.objectUtils.deepMerge(a,l)}:n=>{const l=t(n);return this.objectUtils.deepMerge(l,s)}}}const Lt=new Dt(vt);class Ot{mapToWidget(t,s){if(t.kind==="dynamic"){const n=t.fn;return(l=>{const a=n(l);return this.mapStaticDef(a,s)})}return this.mapStaticDef(t.def,s)}mapStaticDef(t,s){const n=f(s).mapToWidget(t);return this.applyBaseWidgetFields(n,t)}applyBaseWidgetFields(t,s){return s.size!=null&&(t.size=s.size),s.defaultValue!=null&&t.kind==="input"&&(t.defaultValue=s.defaultValue),s.on!=null&&(t.on=s.on),s.include!=null&&(t.include=s.include),s.exclude!=null&&(t.exclude=s.exclude),t}}const Bt=new Ot;class Et{normalizeSelectors(t){const s=Array.isArray(t)?t:[t],n=[],l=[];for(const a of s)a.kind==="leaf"?l.push(a):n.push(a);return l.length>0&&n.unshift({kind:"aggregated",matcher:()=>!0,children:l}),n}extractFormConfig(){return{suppressAutomaticStack:!1}}}const Pt=new Et,It={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},W={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class wt{extractFromMergeResult(t,s){const n={};for(const o of s){const r=o.targetState,u=o.config,p=u.override&&typeof u.override!="function"?u.override:u;n[r]={...n[r]||{},...p}}if(t.kind==="dynamic"){const o=t.fn;return{cleanedResult:{kind:"dynamic",fn:u=>{const p=o(u),{states:c,...b}=p;return b}},stateData:{stateOverrides:n}}}const{states:l,...a}=t.def,i={};for(const[o,r]of Object.entries(n))i[o]={...r};if(l)for(const[o,r]of Object.entries(l))i[o]={...i[o]||{},...r};return{cleanedResult:{kind:"static",def:a},stateData:{stateOverrides:i}}}applyToWidget(t,s,n,l){const{stateOverrides:a}=s;if(Object.keys(a).length===0)return t;const i={...t},o=t.kind,r=It[o]||new Set;t.props&&(i.props={...t.props}),t.on&&(i.on={...t.on});for(const[u,p]of Object.entries(a))for(const[c,b]of Object.entries(p))c==="visible"?this.applyVisibility(i,u,b):W[c]?this.applyStateEvent(i,u,c,b,n,l):r.has(c)?i[`${c}.${u}`]=b:(i.props||(i.props={}),i.props[`${c}.${u}`]=b);return i}hasStateData(t){return Object.keys(t.stateOverrides).length>0}applyVisibility(t,s,n){if(n){const l=t.include?.in||[];t.include={...t.include||{},in:[...l,s]}}else{const l=t.exclude?.from||[];t.exclude={...t.exclude||{},from:[...l,s]}}}applyStateEvent(t,s,n,l,a,i){const o=W[n];if(t.on||(t.on={}),typeof l=="function"){const r=i.next();a.set(r,l),t.on[`${o}.${s}`]=r}else typeof l=="string"&&(t.on[`${o}.${s}`]=l)}}const Wt=new wt;function Rt(){let e=0;return{next:()=>`event_${e++}`}}class Mt{constructor(t,s,n,l,a){this.resolver=t,this.merger=s,this.mapper=n,this.eventWiring=l,this.stateExpansion=a}walkAndMap(t,s,n){const l=new Map,a=Rt(),i={value:0},o=new Set;return{widgets:this.walkItems(t,s,l,n,a,i,o),eventRegistry:l}}walkItems(t,s,n,l,a,i,o){return t.flatMap(r=>{if(r.type!=="ITEMS")throw new Error("Unexpected gui shortcut type");return r.items.map(u=>this.processItem(u,r.itemType,r.tags,s,n,l,a,i,o))})}processItem(t,s,n,l,a,i,o,r,u){const p=s,c=f(s),b=c.parseEntry(t),A=this.buildBaseDef(b),U=this.buildDecoratorForMatching(A,p,n),k=this.resolver.resolve(U,l),P=k.leafSelectors.filter(h=>h.targetState!=null),I={leafSelectors:k.leafSelectors.filter(h=>h.targetState==null),sensibleDefaults:k.sensibleDefaults};let S=this.merger.merge(A,p,I);c.afterMerge&&(S=c.afterMerge(S,{eventRegistry:a,formConfig:i,eventIdGenerator:o})),S=this.eventWiring.wireInputLayoutEvents(S,a,o);const{cleanedResult:w,stateData:v}=this.stateExpansion.extractFromMergeResult(S,P);let _;if(c.buildCustomWidget){const h=this.buildCustomWidgetContext(b.children,l,a,i,o,r,u);_=this.buildCustomWidget(c,w,h)}else _=this.mapper.mapToWidget(w,p);if(typeof _!="function"){const h=_;h.uid||(h.path&&!u.has(h.path)?(h.uid=h.path,u.add(h.path)):h.uid=`dx_${r.value++}`)}if(this.stateExpansion.hasStateData(v))if(typeof _=="function"){const h=_;_=(G=>{const X=h(G);return this.stateExpansion.applyToWidget(X,v,a,o)})}else _=this.stateExpansion.applyToWidget(_,v,a,o);return _}buildCustomWidgetContext(t,s,n,l,a,i,o){return{children:t,mapStaticDef:(r,u)=>this.mapper.mapStaticDef(r,u),walkChildren:r=>this.walkItems(r,s,n,l,a,i,o)}}buildCustomWidget(t,s,n){return t.buildCustomWidget(s,n)}buildBaseDef(t){const s=t.baseDef;return typeof s=="function"?n=>{const a=s(n??{});return t.path!=null?{...a,path:t.path}:a}:t.path!=null?{...s,path:t.path}:s}buildDecoratorForMatching(t,s,n){if(typeof t=="function")return{itemType:s,tags:[...n]};const l=[...n,..."tags"in t&&t.tags?t.tags:[]],a="uid"in t?t.uid:void 0,i="type"in t?t.type:void 0;return{itemType:s,tags:l,uid:a,type:i}}}class Nt{constructor(t,s){this.selectorNormalizer=t,this.walker=s}processDxFacade(t,s=[],n){const{defs:l,gslSelectors:a,formConfig:i}=this.prepareForm(t,s,n),{widgets:o,eventRegistry:r}=this.walker.walkAndMap(l,a,i),u=o[0];return this.buildResult({form:u},r,i)}prepareForm(t,s,n){const a=(Array.isArray(t)?[...t]:[t]).map(r=>typeof r=="function"?x(r):r),i=this.selectorNormalizer.normalizeSelectors(s),o={...this.selectorNormalizer.extractFormConfig(),...n};if(!o.suppressAutomaticStack){const r={def:{uid:"#root",direction:"column",widgetName:"flex"},children:a};return{defs:[{type:"ITEMS",itemType:O.LAYOUTS,items:[r],tags:[]}],gslSelectors:i,formConfig:o}}return{defs:a,gslSelectors:i,formConfig:o}}convertStateNames(t){const s={};for(const[n,l]of Object.entries(t))s[n.replace(/\$/g,":")]=l;return s}buildResult(t,s,n){n.states&&Object.keys(n.states).length>0&&(t={...t,states:this.convertStateNames(n.states)});const l={form:t};return s.size>0&&(l.events=a=>{const i=s.get(a.name);if(i){const o=u=>{if(u&&typeof u=="object"&&"path"in u&&!("type"in u)){const{path:p,...c}=u;for(const[b,A]of Object.entries(c))a.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:p,prop:b,value:A}})}else a.callback(u)},r={...a,callback:o,update:o};i(r)}}),n.dependencies&&(l.dependencies=n.dependencies),n.widgetLoaders&&(l.widgetLoaders=n.widgetLoaders),n.validateOn&&(l.validateOn=n.validateOn),n.itemRenderers&&(l.itemRenderers=n.itemRenderers),l}}const xt=new Mt(Ct,Lt,Bt,E,Wt),V=new Nt(Pt,xt);function K(e){return typeof e=="function"?!0:Array.isArray(e)?e.length===0||e.every(R):R(e)}function R(e){if(typeof e=="function")return!0;if(e===null||typeof e!="object")return!1;const t=e;return t.type==="ITEMS"&&typeof t.itemType=="string"}const M=Object.freeze({}),Ft=Object.freeze({}),N=new WeakMap;function D(e,t){return e==null?t:typeof e=="object"?e:{}}function jt(e,t,s){if(!K(e))return{formDef:e};const n=D(e,M),l=D(t,M),a=D(s,Ft);let i=N.get(n);i||(i=new WeakMap,N.set(n,i));let o=i.get(l);o||(o=new WeakMap,i.set(l,o));const r=o.get(a);if(r)return r;const u=V.processDxFacade(e,t,s),p={formDef:u.form,formEvent:u.events,dependencies:u.dependencies,widgetLoaders:u.widgetLoaders,validateOn:u.validateOn,itemRenderers:u.itemRenderers};return o.set(a,p),p}exports.GuiItemTypes=O;exports._gslAccordionByUid=pt;exports._gslAccordions=ut;exports._gslActionByUid=Ye;exports._gslActions=$e;exports._gslAlertByUid=et;exports._gslAlerts=Qe;exports._gslCalendarByUid=Se;exports._gslCalendars=Ae;exports._gslCheckboxByUid=ue;exports._gslCheckboxes=oe;exports._gslCurrencies=be;exports._gslCurrencyByUid=ge;exports._gslCustomActionByUid=bt;exports._gslCustomActions=yt;exports._gslCustomDisplayByUid=mt;exports._gslCustomDisplays=gt;exports._gslCustomInputByUid=ct;exports._gslCustomInputs=dt;exports._gslCustomLayoutByUid=St;exports._gslCustomLayouts=At;exports._gslDateInputByUid=ke;exports._gslDateInputs=Ue;exports._gslDatePickerByUid=fe;exports._gslDatePickers=Ce;exports._gslDisplayByUid=Je;exports._gslDisplays=Ze;exports._gslDropdownByUid=ae;exports._gslDropdowns=ne;exports._gslInputByUid=te;exports._gslInputs=ee;exports._gslLayoutByUid=Xe;exports._gslLayouts=Ge;exports._gslListByUid=Te;exports._gslLists=_e;exports._gslMarkdownByUid=he;exports._gslMarkdowns=me;exports._gslPasswordByUid=ye;exports._gslPasswords=ce;exports._gslRadiogroupByUid=re;exports._gslRadiogroups=ie;exports._gslRangeCalendarByUid=De;exports._gslRangeCalendars=ve;exports._gslRangeDateInputByUid=Oe;exports._gslRangeDateInputs=Le;exports._gslRangeDatePickerByUid=Ee;exports._gslRangeDatePickers=Be;exports._gslRepeaterByUid=Ne;exports._gslRepeaters=$;exports._gslSelectByUid=le;exports._gslSelects=se;exports._gslTabs=nt;exports._gslTabsByUid=at;exports._gslTextareaByUid=de;exports._gslTextareas=pe;exports._guiDisplay=x;exports.buildTypedValidator=m;exports.createGslSelector=B;exports.defineShortcutType=d;exports.extractWidgetProps=y;exports.formDefs=V;exports.isDxDefinitions=K;exports.processAutoLabel=g;exports.processAutoPlaceholder=T;exports.resolveFormInput=jt;
1
+ "use strict";require("@golemui/core");const O={INPUTS:"INPUTS",ACTIONS:"ACTIONS",LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"};function B(e){return function(t,s=()=>!0){return{kind:"leaf",selectorType:e,matcher:s,config:t}}}function m(e,t){return typeof e=="function"?e:{type:t,...e??{}}}const x=(e,t)=>({type:"ITEMS",itemType:O.DISPLAYS,items:[{render:e}],tags:t??[]}),C=new Map;function F(e,t){if(C.has(e))throw new Error(`Item type "${e}" is already registered.`);C.set(e,t)}function f(e){const t=C.get(e);if(!t)throw new Error(`No handler registered for item type "${e}". Did you forget to import the registration module?`);return t}function j(e){return C.has(e)}function d(e){const t=o=>{if(!e.sensibleDefaults)return{};let r={...e.sensibleDefaults.base};for(const u of o){const p=u.config;for(const c of e.sensibleDefaults.fields){const b=c;p[b]!=null&&(r={...r,[b]:p[b]})}}return r},s=(o,r)=>e.sensibleDefaults?e.sensibleDefaults.apply(o,r):o,n=o=>{switch(e.entryShape){case"bare":return{baseDef:o};case"keyed":{const r=o;return{baseDef:r.def,path:r.key}}case"compound":{const r=o;return{baseDef:r.def,children:r.children}}}},l={rollUpSensibleDefaults:t,applySensibleDefaults:s,mapToWidget:e.mapToWidget,parseEntry:n,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}};F(e.itemType,l);const a=B(e.itemType);return{gsl:a,gslByUid:(o,r)=>a(r,(u=>u.uid===o))}}function y(e){const{uid:t,path:s,label:n,disabled:l,readonly:a,defaultValue:i,tags:o,type:r,size:u,onLoad:p,onChange:c,onFilter:b,on:A,states:U,include:k,exclude:P,validator:I,...S}=e;return S}function H(e){return e?e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()):""}function g(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:H(e.path)}}function T(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}function q(e){switch(e.type){case"text":return J(e);case"number":return Q(e);case"boolean":return Z(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function Z(e){const t=y(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:m(e.validator,"boolean")}:{},props:t}}function J(e){const t=y(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:m(e.validator,"string")}}function Q(e){const t=y(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:m(e.validator,"number")}}const{gsl:ee,gslByUid:te}=d({itemType:"INPUTS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let s=g(e,t);return s=T(s,t),s}},mapToWidget:q}),{gsl:se,gslByUid:le}=d({itemType:"SELECT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:y(e)})}),{gsl:ne,gslByUid:ae}=d({itemType:"DROPDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:y(e)})}),{gsl:ie,gslByUid:re}=d({itemType:"RADIOGROUP",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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:y(e)})}),{gsl:oe,gslByUid:ue}=d({itemType:"CHECKBOX",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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:m(e.validator,"boolean")}:{},props:y(e)})}),{gsl:pe,gslByUid:de}=d({itemType:"TEXTAREA",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:m(e.validator,"string")}:{},props:y(e)})}),{gsl:ce,gslByUid:ye}=d({itemType:"PASSWORD",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:m(e.validator,"string")}:{},props:y(e)})}),{gsl:be,gslByUid:ge}=d({itemType:"CURRENCY",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:m(e.validator,"number")}:{},props:y(e)})}),{gsl:me,gslByUid:he}=d({itemType:"MARKDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:m(e.validator,"string")}:{},props:y(e)})}),{gsl:_e,gslByUid:Te}=d({itemType:"LIST",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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:y(e)})}),{gsl:Ae,gslByUid:Se}=d({itemType:"CALENDAR",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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:m(e.validator,"string")}:{},props:y(e)})}),{gsl:Ue,gslByUid:ke}=d({itemType:"DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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:m(e.validator,"string")}:{},props:y(e)})}),{gsl:Ce,gslByUid:fe}=d({itemType:"DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:m(e.validator,"string")}:{},props:y(e)})}),{gsl:ve,gslByUid:De}=d({itemType:"RANGE_CALENDAR",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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:m(e.validator,"array")}:{},props:y(e)})}),{gsl:Le,gslByUid:Oe}=d({itemType:"RANGE_DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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:m(e.validator,"array")}:{},props:y(e)})}),{gsl:Be,gslByUid:Ee}=d({itemType:"RANGE_DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(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:m(e.validator,"array")}:{},props:y(e)})});function Pe(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 Ie(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:m(e.validator,"array")}:{},props:{...Pe(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function L(e,t){for(const s of e){if(typeof s=="function")continue;const n=s;typeof n.path=="string"&&n.path&&(n.path=t+n.path),"children"in n&&Array.isArray(n.children)&&L(n.children,t);const l=n.props;l?.template?.children&&Array.isArray(l.template.children)&&L(l.template.children,t)}}function we(e,t){const s=t.walkChildren(t.children??[]),n=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";n&&L(s,n+".items.");const l={kind:"layout",type:"flex",uid:"",children:s,props:{direction:"column"}};if(e.kind==="static"){const i=t.mapStaticDef(e.def,"REPEATER");return{...i,props:{...i.props,template:l}}}const a=e.fn;return(i=>{const o=a(i),r=t.mapStaticDef(o,"REPEATER");return{...r,props:{...r.props,template:l}}})}function We(e){return{baseDef:e.def,path:e.key,children:e.children}}function Re(e){return e.children}const Me={parseEntry:We,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:Ie,buildCustomWidget:we,getChildren:Re};F("REPEATER",Me);const $=B("REPEATER"),Ne=(e,t)=>$(t,(s=>s.uid===e)),Y={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},xe=Object.keys(Y);class Fe{extractOnClickFromMergeResult(t,s,n){if(t.kind==="dynamic"){const i=t.fn;return{kind:"dynamic",fn:r=>{const u=i(r);return this.wireOnClick(u,s,n)}}}const l=t.def;return{kind:"static",def:this.wireOnClick(l,s,n)}}wireOnClick(t,s,n){const l=n.next(),a=t.onClick;if(typeof a=="function"){const{onClick:i,...o}=t,r=a(void 0);return typeof r=="string"?{...o,uid:l,on:{click:r}}:(s.set(l,u=>a(u.data)),{...o,uid:l,on:{click:l}})}return{...t,uid:l}}wireInputLayoutEvents(t,s,n){if(t.kind==="dynamic"){const a=t.fn;return{kind:"dynamic",fn:o=>{const r=a(o);return this.wireEventProperties(r,s,n)}}}return{kind:"static",def:this.wireEventProperties(t.def,s,n)}}wireEventProperties(t,s,n){const l={...t.on||{}};let a=!1;const i={...t};for(const o of xe){const r=t[o];if(r==null)continue;const u=Y[o];if(typeof r=="function"){const p=n.next();s.set(p,r),l[u]=p,a=!0}else typeof r=="string"&&(l[u]=r,a=!0);delete i[o]}return a&&(i.on=l),i}}const E=new Fe;function je(e){const{uid:t,label:s,actionType:n,disabled:l,on:a,onClick:i,data:o,type:r,tags:u,size:p,include:c,exclude:b,states:A,...U}=e;return{uid:t??"",kind:"action",type:"button",disabled:l,actionType:n,label:s,...a!=null?{on:a}:{},props:U}}const{gsl:$e,gslByUid:Ye}=d({itemType:"ACTIONS",entryShape:"bare",mapToWidget:je,afterMerge:(e,t)=>E.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});function ze(e){const{uid:t,widgetName:s,tags:n,size:l,onChange:a,include:i,exclude:o,...r}=e,{on:u,...p}=r;return{uid:t??"",kind:"layout",type:s??"flex",props:{direction:p.direction??"column",...p},children:[]}}function Ke(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"LAYOUTS"),children:s}})}function Ve(e){return e.children}const{gsl:Ge,gslByUid:Xe}=d({itemType:"LAYOUTS",entryShape:"compound",mapToWidget:ze,buildCustomWidget:Ke,getChildren:Ve});function He(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function qe(e,t){if(e.kind==="static"){const n=e.def;return(l=>({uid:"",kind:"display",type:"renderer",...n.include!=null?{include:n.include}:{},...n.exclude!=null?{exclude:n.exclude}:{},props:{render:n.render(l??{})}}))}const s=e.fn;return(n=>{const l=s(n);return{uid:"",kind:"display",type:"renderer",...l.include!=null?{include:l.include}:{},...l.exclude!=null?{exclude:l.exclude}:{},props:{render:l.render(n??{})}}})}const{gsl:Ze,gslByUid:Je}=d({itemType:"DISPLAYS",entryShape:"bare",mapToWidget:He,buildCustomWidget:qe}),{gsl:Qe,gslByUid:et}=d({itemType:"ALERTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})});function tt(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 st(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"TABS"),children:s}})}function lt(e){return e.children}const{gsl:nt,gslByUid:at}=d({itemType:"TABS",entryShape:"compound",mapToWidget:tt,buildCustomWidget:st,getChildren:lt});function it(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 rt(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"ACCORDION"),children:s}})}function ot(e){return e.children}const{gsl:ut,gslByUid:pt}=d({itemType:"ACCORDION",entryShape:"compound",mapToWidget:it,buildCustomWidget:rt,getChildren:ot}),{gsl:dt,gslByUid:ct}=d({itemType:"CUSTOM_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(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??{}})}),{gsl:yt,gslByUid:bt}=d({itemType:"CUSTOM_ACTION",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:s,disabled:n,on:l,onClick:a,data:i,customType:o,tags:r,size:u,include:p,exclude:c,states:b,props:A,...U}=e;return{uid:t??"",kind:"action",type:e.customType,label:s,disabled:n,...l!=null?{on:l}:{},props:{...A,...U}}},afterMerge:(e,t)=>E.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),{gsl:gt,gslByUid:mt}=d({itemType:"CUSTOM_DISPLAY",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})});function ht(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function _t(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"CUSTOM_LAYOUT"),children:s}})}function Tt(e){return e.children}const{gsl:At,gslByUid:St}=d({itemType:"CUSTOM_LAYOUT",entryShape:"compound",mapToWidget:ht,buildCustomWidget:_t,getChildren:Tt}),z={INPUTS:new Set(["INPUTS","TEXTAREA","PASSWORD","SELECT","DROPDOWN","RADIOGROUP","CHECKBOX","CALENDAR","DATE_INPUT","DATE_PICKER","RANGE_CALENDAR","RANGE_DATE_INPUT","RANGE_DATE_PICKER","CURRENCY","MARKDOWN","LIST","CUSTOM_INPUT","REPEATER","TAGS"]),ACTIONS:new Set(["ACTIONS","CUSTOM_ACTION"]),DISPLAYS:new Set(["DISPLAYS","ALERTS","MARKDOWN_TEXTS","CUSTOM_DISPLAY"]),LAYOUTS:new Set(["LAYOUTS","TABS","ACCORDION","CUSTOM_LAYOUT"])};function Ut(e,t){const s=z[e];return s?s.has(t):e===t}class kt{resolve(t,s){const n=[];for(const a of s)a.kind==="aggregated"?this.collectFromAggregated(a,t,n):this.collectFromLeaf(a,t,n);const l=this.rollUpSensibleDefaults(n);return{leafSelectors:n,sensibleDefaults:l}}collectFromAggregated(t,s,n){if(t.matcher(s))for(const l of t.children)this.collectFromLeaf(l,s,n)}collectFromLeaf(t,s,n){Ut(t.selectorType,s.itemType??"")&&t.matcher(s)&&n.push(t)}rollUpSensibleDefaults(t){const s=new Map,n=(a,i)=>{const o=s.get(a)??[];o.push(i),s.set(a,o)};for(const a of t){const i=z[a.selectorType];if(i)for(const o of i)n(o,a);else n(a.selectorType,a)}const l={};for(const[a,i]of s)j(a)&&(l[a]=f(a).rollUpSensibleDefaults(i));return l}}const Ct=new kt;class ft{deepMerge(t,s){if(s==null)return t;if(t==null||typeof t!="object"||typeof s!="object"||Array.isArray(t)||Array.isArray(s))return s;const n={...t};for(const l in s)Object.prototype.hasOwnProperty.call(s,l)&&(typeof s[l]=="object"&&!Array.isArray(s[l])&&s[l]!==null&&typeof t[l]=="object"&&!Array.isArray(t[l])&&t[l]!==null?n[l]=this.deepMerge(t[l],s[l]):n[l]=s[l]);return n}}const vt=new ft;class Dt{constructor(t){this.objectUtils=t}merge(t,s,n){let l={},a=null;typeof t=="function"&&(a=t);const i=this.collectDecorators(n);for(const u of i){if(a!=null){a=this.composeRuntimeFunctions(a,u);continue}if(typeof u=="function"){const p=u({...l,...typeof t=="function"?{}:t});if(typeof p=="function"){a=this.createPromotedFunction(l,t,p,s,n);continue}l=this.objectUtils.deepMerge(l,p)}else l=this.objectUtils.deepMerge(l,u)}if(a!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(a,l,s,n)};const o=this.objectUtils.deepMerge(t,l);return{kind:"static",def:this.applySensibleDefaults({...o},s,n)}}collectDecorators(t){const s=[];for(const n of t.leafSelectors){const l=n.config;l.override!=null&&s.push(l.override)}return s}applySensibleDefaults(t,s,n){if(!j(s))return t;const l=n.sensibleDefaults[s]??{};return f(s).applySensibleDefaults(t,l)}createPromotedFunction(t,s,n,l,a){return i=>{const o=n(i);let r=this.objectUtils.deepMerge(t,o);return r=this.objectUtils.deepMerge(r,s),this.applySensibleDefaults(r,l,a)}}wrapWithSensibleDefaults(t,s,n,l){return a=>{let i=t(a);return Object.keys(s).length>0&&(i=this.objectUtils.deepMerge(s,i)),this.applySensibleDefaults(i,n,l)}}composeRuntimeFunctions(t,s){return typeof s=="function"?n=>{const l=t(n),a=s(l);return typeof a=="function"?a(n):this.objectUtils.deepMerge(a,l)}:n=>{const l=t(n);return this.objectUtils.deepMerge(l,s)}}}const Lt=new Dt(vt);class Ot{mapToWidget(t,s){if(t.kind==="dynamic"){const n=t.fn;return(l=>{const a=n(l);return this.mapStaticDef(a,s)})}return this.mapStaticDef(t.def,s)}mapStaticDef(t,s){const n=f(s).mapToWidget(t);return this.applyBaseWidgetFields(n,t)}applyBaseWidgetFields(t,s){return s.size!=null&&(t.size=s.size),s.defaultValue!=null&&t.kind==="input"&&(t.defaultValue=s.defaultValue),s.on!=null&&(t.on=s.on),s.include!=null&&(t.include=s.include),s.exclude!=null&&(t.exclude=s.exclude),t}}const Bt=new Ot;class Et{normalizeSelectors(t){const s=Array.isArray(t)?t:[t],n=[],l=[];for(const a of s)a.kind==="leaf"?l.push(a):n.push(a);return l.length>0&&n.unshift({kind:"aggregated",matcher:()=>!0,children:l}),n}extractFormConfig(){return{suppressAutomaticStack:!1}}}const Pt=new Et,It={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},W={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class wt{extractFromMergeResult(t,s){const n={};for(const o of s){const r=o.targetState,u=o.config,p=u.override&&typeof u.override!="function"?u.override:u;n[r]={...n[r]||{},...p}}if(t.kind==="dynamic"){const o=t.fn;return{cleanedResult:{kind:"dynamic",fn:u=>{const p=o(u),{states:c,...b}=p;return b}},stateData:{stateOverrides:n}}}const{states:l,...a}=t.def,i={};for(const[o,r]of Object.entries(n))i[o]={...r};if(l)for(const[o,r]of Object.entries(l))i[o]={...i[o]||{},...r};return{cleanedResult:{kind:"static",def:a},stateData:{stateOverrides:i}}}applyToWidget(t,s,n,l){const{stateOverrides:a}=s;if(Object.keys(a).length===0)return t;const i={...t},o=t.kind,r=It[o]||new Set;t.props&&(i.props={...t.props}),t.on&&(i.on={...t.on});for(const[u,p]of Object.entries(a))for(const[c,b]of Object.entries(p))c==="visible"?this.applyVisibility(i,u,b):W[c]?this.applyStateEvent(i,u,c,b,n,l):r.has(c)?i[`${c}.${u}`]=b:(i.props||(i.props={}),i.props[`${c}.${u}`]=b);return i}hasStateData(t){return Object.keys(t.stateOverrides).length>0}applyVisibility(t,s,n){if(n){const l=t.include?.in||[];t.include={...t.include||{},in:[...l,s]}}else{const l=t.exclude?.from||[];t.exclude={...t.exclude||{},from:[...l,s]}}}applyStateEvent(t,s,n,l,a,i){const o=W[n];if(t.on||(t.on={}),typeof l=="function"){const r=i.next();a.set(r,l),t.on[`${o}.${s}`]=r}else typeof l=="string"&&(t.on[`${o}.${s}`]=l)}}const Wt=new wt;function Rt(){let e=0;return{next:()=>`event_${e++}`}}class Mt{constructor(t,s,n,l,a){this.resolver=t,this.merger=s,this.mapper=n,this.eventWiring=l,this.stateExpansion=a}walkAndMap(t,s,n){const l=new Map,a=Rt(),i={value:0},o=new Set;return{widgets:this.walkItems(t,s,l,n,a,i,o),eventRegistry:l}}walkItems(t,s,n,l,a,i,o){return t.flatMap(r=>{if(r.type!=="ITEMS")throw new Error("Unexpected gui shortcut type");return r.items.map(u=>this.processItem(u,r.itemType,r.tags,s,n,l,a,i,o))})}processItem(t,s,n,l,a,i,o,r,u){const p=s,c=f(s),b=c.parseEntry(t),A=this.buildBaseDef(b),U=this.buildDecoratorForMatching(A,p,n),k=this.resolver.resolve(U,l),P=k.leafSelectors.filter(h=>h.targetState!=null),I={leafSelectors:k.leafSelectors.filter(h=>h.targetState==null),sensibleDefaults:k.sensibleDefaults};let S=this.merger.merge(A,p,I);c.afterMerge&&(S=c.afterMerge(S,{eventRegistry:a,formConfig:i,eventIdGenerator:o})),S=this.eventWiring.wireInputLayoutEvents(S,a,o);const{cleanedResult:w,stateData:v}=this.stateExpansion.extractFromMergeResult(S,P);let _;if(c.buildCustomWidget){const h=this.buildCustomWidgetContext(b.children,l,a,i,o,r,u);_=this.buildCustomWidget(c,w,h)}else _=this.mapper.mapToWidget(w,p);if(typeof _!="function"){const h=_;h.uid||(h.path&&!u.has(h.path)?(h.uid=h.path,u.add(h.path)):h.uid=`dx_${r.value++}`)}if(this.stateExpansion.hasStateData(v))if(typeof _=="function"){const h=_;_=(G=>{const X=h(G);return this.stateExpansion.applyToWidget(X,v,a,o)})}else _=this.stateExpansion.applyToWidget(_,v,a,o);return _}buildCustomWidgetContext(t,s,n,l,a,i,o){return{children:t,mapStaticDef:(r,u)=>this.mapper.mapStaticDef(r,u),walkChildren:r=>this.walkItems(r,s,n,l,a,i,o)}}buildCustomWidget(t,s,n){return t.buildCustomWidget(s,n)}buildBaseDef(t){const s=t.baseDef;return typeof s=="function"?n=>{const a=s(n??{});return t.path!=null?{...a,path:t.path}:a}:t.path!=null?{...s,path:t.path}:s}buildDecoratorForMatching(t,s,n){if(typeof t=="function")return{itemType:s,tags:[...n]};const l=[...n,..."tags"in t&&t.tags?t.tags:[]],a="uid"in t?t.uid:void 0,i="type"in t?t.type:void 0;return{itemType:s,tags:l,uid:a,type:i}}}class Nt{constructor(t,s){this.selectorNormalizer=t,this.walker=s}processDxFacade(t,s=[],n){const{defs:l,gslSelectors:a,formConfig:i}=this.prepareForm(t,s,n),{widgets:o,eventRegistry:r}=this.walker.walkAndMap(l,a,i),u=o[0];return this.buildResult({form:u},r,i)}prepareForm(t,s,n){const a=(Array.isArray(t)?[...t]:[t]).map(r=>typeof r=="function"?x(r):r),i=this.selectorNormalizer.normalizeSelectors(s),o={...this.selectorNormalizer.extractFormConfig(),...n};if(!o.suppressAutomaticStack){const r={def:{uid:"#root",direction:"column",widgetName:"flex"},children:a};return{defs:[{type:"ITEMS",itemType:O.LAYOUTS,items:[r],tags:[]}],gslSelectors:i,formConfig:o}}return{defs:a,gslSelectors:i,formConfig:o}}convertStateNames(t){const s={};for(const[n,l]of Object.entries(t))s[n.replace(/\$/g,":")]=l;return s}buildResult(t,s,n){n.states&&Object.keys(n.states).length>0&&(t={...t,states:this.convertStateNames(n.states)});const l={form:t};return s.size>0&&(l.events=a=>{const i=s.get(a.name);if(i){const o=u=>{if(u&&typeof u=="object"&&"path"in u&&!("type"in u)){const{path:p,...c}=u;for(const[b,A]of Object.entries(c))a.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:p,prop:b,value:A}})}else a.callback(u)},r={...a,callback:o,update:o};i(r)}}),n.dependencies&&(l.dependencies=n.dependencies),n.widgetLoaders&&(l.widgetLoaders=n.widgetLoaders),n.validateOn&&(l.validateOn=n.validateOn),n.itemRenderers&&(l.itemRenderers=n.itemRenderers),l}}const xt=new Mt(Ct,Lt,Bt,E,Wt),K=new Nt(Pt,xt);function V(e){return typeof e=="function"?!0:Array.isArray(e)?e.length===0||e.every(R):R(e)}function R(e){if(typeof e=="function")return!0;if(e===null||typeof e!="object")return!1;const t=e;return t.type==="ITEMS"&&typeof t.itemType=="string"}const M=Object.freeze({}),Ft=Object.freeze({}),N=new WeakMap;function D(e,t){return e==null?t:typeof e=="object"?e:{}}function jt(e,t,s){if(!V(e))return{formDef:e};const n=D(e,M),l=D(t,M),a=D(s,Ft);let i=N.get(n);i||(i=new WeakMap,N.set(n,i));let o=i.get(l);o||(o=new WeakMap,i.set(l,o));const r=o.get(a);if(r)return r;const u=K.processDxFacade(e,t,s),p={formDef:u.form,formEvent:u.events,dependencies:u.dependencies,widgetLoaders:u.widgetLoaders,validateOn:u.validateOn,itemRenderers:u.itemRenderers};return o.set(a,p),p}exports.GuiItemTypes=O;exports._gslAccordionByUid=pt;exports._gslAccordions=ut;exports._gslActionByUid=Ye;exports._gslActions=$e;exports._gslAlertByUid=et;exports._gslAlerts=Qe;exports._gslCalendarByUid=Se;exports._gslCalendars=Ae;exports._gslCheckboxByUid=ue;exports._gslCheckboxes=oe;exports._gslCurrencies=be;exports._gslCurrencyByUid=ge;exports._gslCustomActionByUid=bt;exports._gslCustomActions=yt;exports._gslCustomDisplayByUid=mt;exports._gslCustomDisplays=gt;exports._gslCustomInputByUid=ct;exports._gslCustomInputs=dt;exports._gslCustomLayoutByUid=St;exports._gslCustomLayouts=At;exports._gslDateInputByUid=ke;exports._gslDateInputs=Ue;exports._gslDatePickerByUid=fe;exports._gslDatePickers=Ce;exports._gslDisplayByUid=Je;exports._gslDisplays=Ze;exports._gslDropdownByUid=ae;exports._gslDropdowns=ne;exports._gslInputByUid=te;exports._gslInputs=ee;exports._gslLayoutByUid=Xe;exports._gslLayouts=Ge;exports._gslListByUid=Te;exports._gslLists=_e;exports._gslMarkdownByUid=he;exports._gslMarkdowns=me;exports._gslPasswordByUid=ye;exports._gslPasswords=ce;exports._gslRadiogroupByUid=re;exports._gslRadiogroups=ie;exports._gslRangeCalendarByUid=De;exports._gslRangeCalendars=ve;exports._gslRangeDateInputByUid=Oe;exports._gslRangeDateInputs=Le;exports._gslRangeDatePickerByUid=Ee;exports._gslRangeDatePickers=Be;exports._gslRepeaterByUid=Ne;exports._gslRepeaters=$;exports._gslSelectByUid=le;exports._gslSelects=se;exports._gslTabs=nt;exports._gslTabsByUid=at;exports._gslTextareaByUid=de;exports._gslTextareas=pe;exports._guiDisplay=x;exports.buildTypedValidator=m;exports.createGslSelector=B;exports.defineShortcutType=d;exports.extractWidgetProps=y;exports.formDefs=K;exports.isDxDefinitions=V;exports.processAutoLabel=g;exports.processAutoPlaceholder=T;exports.resolveFormInput=jt;
@@ -926,7 +926,7 @@ const { gsl: Ft, gslByUid: jt } = c({
926
926
  "TAGS"
927
927
  ]),
928
928
  ACTIONS: /* @__PURE__ */ new Set(["ACTIONS", "CUSTOM_ACTION"]),
929
- DISPLAYS: /* @__PURE__ */ new Set(["DISPLAYS", "ALERTS", "CUSTOM_DISPLAY"]),
929
+ DISPLAYS: /* @__PURE__ */ new Set(["DISPLAYS", "ALERTS", "MARKDOWN_TEXTS", "CUSTOM_DISPLAY"]),
930
930
  LAYOUTS: /* @__PURE__ */ new Set(["LAYOUTS", "TABS", "ACCORDION", "CUSTOM_LAYOUT"])
931
931
  };
932
932
  function _e(e, t) {
@@ -1474,38 +1474,38 @@ function $t(e, t, s) {
1474
1474
  return o.set(n, p), p;
1475
1475
  }
1476
1476
  export {
1477
- Ft as $,
1478
- ht as A,
1479
- gt as B,
1480
- Tt as C,
1481
- St as D,
1482
- At as E,
1483
- le as F,
1477
+ xt as $,
1478
+ mt as A,
1479
+ ht as B,
1480
+ gt as C,
1481
+ Tt as D,
1482
+ St as E,
1483
+ At as F,
1484
1484
  R as G,
1485
- _t as H,
1486
- kt as I,
1487
- vt as J,
1488
- ft as K,
1489
- Ct as L,
1490
- Ut as M,
1491
- Ot as N,
1492
- Lt as O,
1493
- Dt as P,
1494
- Et as Q,
1495
- Pt as R,
1496
- It as S,
1497
- Wt as T,
1498
- wt as U,
1499
- Bt as V,
1500
- Mt as W,
1501
- Rt as X,
1502
- Nt as Y,
1503
- xt as Z,
1485
+ le as H,
1486
+ _t as I,
1487
+ kt as J,
1488
+ vt as K,
1489
+ ft as L,
1490
+ Ct as M,
1491
+ Ut as N,
1492
+ Ot as O,
1493
+ Lt as P,
1494
+ Dt as Q,
1495
+ Et as R,
1496
+ Pt as S,
1497
+ It as T,
1498
+ Wt as U,
1499
+ wt as V,
1500
+ Bt as W,
1501
+ Mt as X,
1502
+ Rt as Y,
1503
+ Nt as Z,
1504
1504
  Ye as _,
1505
1505
  ze as a,
1506
- jt as a0,
1507
- K as a1,
1508
- c as a2,
1506
+ Ft as a0,
1507
+ jt as a1,
1508
+ K as a2,
1509
1509
  b as a3,
1510
1510
  g as a4,
1511
1511
  S as a5,
@@ -1516,27 +1516,27 @@ export {
1516
1516
  $t as aa,
1517
1517
  Ke as b,
1518
1518
  Ve as c,
1519
- Ge as d,
1520
- Xe as e,
1521
- He as f,
1522
- Ze as g,
1523
- qe as h,
1524
- Je as i,
1525
- Qe as j,
1526
- et as k,
1527
- tt as l,
1528
- st as m,
1529
- lt as n,
1530
- at as o,
1531
- nt as p,
1532
- it as q,
1533
- rt as r,
1534
- ot as s,
1535
- ut as t,
1536
- pt as u,
1537
- ct as v,
1538
- dt as w,
1539
- yt as x,
1540
- bt as y,
1541
- mt as z
1519
+ c as d,
1520
+ Ge as e,
1521
+ Xe as f,
1522
+ He as g,
1523
+ Ze as h,
1524
+ qe as i,
1525
+ Je as j,
1526
+ Qe as k,
1527
+ et as l,
1528
+ tt as m,
1529
+ st as n,
1530
+ lt as o,
1531
+ at as p,
1532
+ nt as q,
1533
+ it as r,
1534
+ rt as s,
1535
+ ot as t,
1536
+ ut as u,
1537
+ pt as v,
1538
+ ct as w,
1539
+ dt as x,
1540
+ yt as y,
1541
+ bt as z
1542
1542
  };