@golemui/gui-shared 0.16.2 → 1.0.0-rc.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/CHANGELOG.md +8 -0
- package/index.d.ts +1 -8
- package/index.js +209 -729
- package/index.umd.cjs +1 -1
- package/internals.d.ts +8 -1
- package/internals.js +721 -10
- package/internals.umd.cjs +1 -1
- package/package.json +3 -3
- package/register-BCL1xvhN.js +1399 -0
- package/register-CjTULX-4.cjs +1 -0
- package/resolveFormInput-BkRkdOqj.cjs +0 -1
- package/resolveFormInput-DoBisQ5Q.js +0 -1542
package/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./register-CjTULX-4.cjs");require("@golemui/core");class a{constructor(t){this.conditions=t}static root(){return new a([])}tag(t){return new a([...this.conditions,{kind:"tagsAnd",tags:[t]}])}state(t){return new a([...this.conditions,{kind:"state",name:t}])}tagsAnd(t){return new a([...this.conditions,{kind:"tagsAnd",tags:t}])}tagsOr(t){return new a([...this.conditions,{kind:"tagsOr",tags:t}])}apply(t){if(this.conditions.length===0)return t;const r=this.conditions.find(n=>n.kind==="state"),i=this.conditions.filter(n=>n.kind!=="state"),u=t.matcher;return{...t,matcher:n=>{if(!u(n))return!1;for(const l of i){const d=n.tags??[];if(l.kind==="tagsAnd"){for(const o of l.tags)if(!d.includes(o))return!1}else{if(l.tags.length===0)continue;if(!l.tags.some(o=>d.includes(o)))return!1}}return!0},...r?{targetState:r.name}:{}}}inputs(t){return this.apply(s._gslInputs(t))}inputByUid(t,r){return this.apply(s._gslInputByUid(t,r))}textInputs(t){return this.apply(s._gslTextInputs(t))}numberInputs(t){return this.apply(s._gslNumberInputs(t))}booleanInputs(t){return this.apply(s._gslBooleanInputs(t))}selects(t){return this.apply(s._gslSelects(t))}selectByUid(t,r){return this.apply(s._gslSelectByUid(t,r))}dropdowns(t){return this.apply(s._gslDropdowns(t))}dropdownByUid(t,r){return this.apply(s._gslDropdownByUid(t,r))}radiogroups(t){return this.apply(s._gslRadiogroups(t))}radiogroupByUid(t,r){return this.apply(s._gslRadiogroupByUid(t,r))}checkboxes(t){return this.apply(s._gslCheckboxes(t))}checkboxByUid(t,r){return this.apply(s._gslCheckboxByUid(t,r))}textareas(t){return this.apply(s._gslTextareas(t))}textareaByUid(t,r){return this.apply(s._gslTextareaByUid(t,r))}passwords(t){return this.apply(s._gslPasswords(t))}passwordByUid(t,r){return this.apply(s._gslPasswordByUid(t,r))}currencies(t){return this.apply(s._gslCurrencies(t))}currencyByUid(t,r){return this.apply(s._gslCurrencyByUid(t,r))}markdowns(t){return this.apply(s._gslMarkdowns(t))}markdownByUid(t,r){return this.apply(s._gslMarkdownByUid(t,r))}lists(t){return this.apply(s._gslLists(t))}listByUid(t,r){return this.apply(s._gslListByUid(t,r))}calendars(t){return this.apply(s._gslCalendars(t))}calendarByUid(t,r){return this.apply(s._gslCalendarByUid(t,r))}dateInputs(t){return this.apply(s._gslDateInputs(t))}dateInputByUid(t,r){return this.apply(s._gslDateInputByUid(t,r))}datePickers(t){return this.apply(s._gslDatePickers(t))}datePickerByUid(t,r){return this.apply(s._gslDatePickerByUid(t,r))}rangeCalendars(t){return this.apply(s._gslRangeCalendars(t))}rangeCalendarByUid(t,r){return this.apply(s._gslRangeCalendarByUid(t,r))}rangeDateInputs(t){return this.apply(s._gslRangeDateInputs(t))}rangeDateInputByUid(t,r){return this.apply(s._gslRangeDateInputByUid(t,r))}rangeDatePickers(t){return this.apply(s._gslRangeDatePickers(t))}rangeDatePickerByUid(t,r){return this.apply(s._gslRangeDatePickerByUid(t,r))}repeaters(t){return this.apply(s._gslRepeaters(t))}repeaterByUid(t,r){return this.apply(s._gslRepeaterByUid(t,r))}actions(t){return this.apply(s._gslActions(t))}actionByUid(t,r){return this.apply(s._gslActionByUid(t,r))}layouts(t){return this.apply(s._gslLayouts(t))}layoutByUid(t,r){return this.apply(s._gslLayoutByUid(t,r))}displays(t){return this.apply(s._gslDisplays(t))}displayByUid(t,r){return this.apply(s._gslDisplayByUid(t,r))}alerts(t){return this.apply(s._gslAlerts(t))}alertByUid(t,r){return this.apply(s._gslAlertByUid(t,r))}markdownTexts(t){return this.apply(s._gslMarkdownTexts(t))}markdownTextByUid(t,r){return this.apply(s._gslMarkdownTextByUid(t,r))}tabs(t){return this.apply(s._gslTabs(t))}tabsByUid(t,r){return this.apply(s._gslTabsByUid(t,r))}accordions(t){return this.apply(s._gslAccordions(t))}accordionByUid(t,r){return this.apply(s._gslAccordionByUid(t,r))}customInputs(t){return this.apply(s._gslCustomInputs(t))}customInputByUid(t,r){return this.apply(s._gslCustomInputByUid(t,r))}customActions(t){return this.apply(s._gslCustomActions(t))}customActionByUid(t,r){return this.apply(s._gslCustomActionByUid(t,r))}customDisplays(t){return this.apply(s._gslCustomDisplays(t))}customDisplayByUid(t,r){return this.apply(s._gslCustomDisplayByUid(t,r))}customLayouts(t){return this.apply(s._gslCustomLayouts(t))}customLayoutByUid(t,r){return this.apply(s._gslCustomLayoutByUid(t,r))}}const y={inputs:{textInput:s._guiTextInput,numberInput:s._guiNumberInput,booleanInput:s._guiBooleanInput,select:s._guiSelect,dropdown:s._guiDropdown,radiogroup:s._guiRadiogroup,checkbox:s._guiCheckbox,textarea:s._guiTextarea,password:s._guiPassword,currency:s._guiCurrency,markdown:s._guiMarkdown,list:s._guiList,calendar:s._guiCalendar,dateInput:s._guiDateInput,datePicker:s._guiDatePicker,rangeCalendar:s._guiRangeCalendar,rangeDateInput:s._guiRangeDateInput,rangeDatePicker:s._guiRangeDatePicker,repeater:s._guiRepeater,tags:s._guiTags,custom:s._guiCustomInput},actions:{button:s._guiButton,custom:s._guiCustomAction},displays:{display:s._guiDisplay,alert:s._guiAlert,markdownText:s._guiMarkdownText,custom:s._guiCustomDisplay},layouts:{flex:s._guiFlex,horizontalFlex:s._guiHorizontalFlex,verticalFlex:s._guiVerticalFlex,grid:s._guiGrid,horizontalGrid:s._guiHorizontalGrid,verticalGrid:s._guiVerticalGrid,tabs:s._guiTabs,accordion:s._guiAccordion,custom:s._guiCustomLayout},selectors:a.root()};function g(e){return typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string"&&Object.keys(e).length===1}async function c(e,t){const r=new URL(e,t).href,i=await fetch(r);if(!i.ok)throw new Error(`Failed to load form chunk ${r}: ${i.status}`);const{$schema:u,...n}=await i.json();return p(n,r)}async function p(e,t){if(g(e))return c(e.$ref,t);const r=e;if(Array.isArray(r.children)){const i=await Promise.all(r.children.map(u=>p(u,t)));return{...r,children:i}}return e}async function h(e,t){const r=await Promise.all(e.form.map(i=>p(i,t)));return{...e,form:r}}exports.gui=y;exports.resolveChunkRefs=h;
|
package/internals.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { _guiAccordion, _guiAlert, _guiBooleanInput, _guiButton, _guiCalendar, _guiCheckbox, _guiCurrency, _guiCustomAction, _guiCustomDisplay, _guiCustomInput, _guiCustomLayout, _guiDateInput, _guiDatePicker, _guiDisplay, _guiDropdown, _guiFlex, _guiGrid, _guiHorizontalFlex, _guiHorizontalGrid, _guiList, _guiMarkdown, _guiMarkdownText, _guiNumberInput, _guiPassword, _guiRadiogroup, _guiRangeCalendar, _guiRangeDateInput, _guiRangeDatePicker, _guiRepeater, _guiSelect, _guiTabs, _guiTags, _guiTextarea, _guiTextInput, _guiVerticalFlex, _guiVerticalGrid, } from './lib/dx';
|
|
2
|
+
export { _gslAccordionByUid, _gslAccordions, _gslActionByUid, _gslActions, _gslAlertByUid, _gslAlerts, _gslBooleanInputs, _gslCalendarByUid, _gslCalendars, _gslCheckboxByUid, _gslCheckboxes, _gslCurrencies, _gslCurrencyByUid, _gslCustomActionByUid, _gslCustomActions, _gslCustomDisplayByUid, _gslCustomDisplays, _gslCustomInputByUid, _gslCustomInputs, _gslCustomLayoutByUid, _gslCustomLayouts, _gslDateInputByUid, _gslDateInputs, _gslDatePickerByUid, _gslDatePickers, _gslDisplayByUid, _gslDisplays, _gslDropdownByUid, _gslDropdowns, _gslInputByUid, _gslInputs, _gslLayoutByUid, _gslLayouts, _gslListByUid, _gslLists, _gslMarkdownByUid, _gslMarkdowns, _gslMarkdownTextByUid, _gslMarkdownTexts, _gslNumberInputs, _gslPasswordByUid, _gslPasswords, _gslRadiogroupByUid, _gslRadiogroups, _gslRangeCalendarByUid, _gslRangeCalendars, _gslRangeDateInputByUid, _gslRangeDateInputs, _gslRangeDatePickerByUid, _gslRangeDatePickers, _gslRepeaterByUid, _gslRepeaters, _gslSelectByUid, _gslSelects, _gslStates, _gslTabs, _gslTabsByUid, _gslTag, _gslTags, _gslTagsByUid, _gslTextareaByUid, _gslTextareas, _gslTextInputs, } from './lib/dx';
|
|
3
|
+
export { createGslSelector, defineShortcutType, extractWidgetProps, formDefs, isDxDefinitions, processAutoLabel, processAutoPlaceholder, resolveFormInput, } from './lib/dx';
|
|
4
|
+
export type { AccordionDecorator, ActionDecorator, AlertDecorator, BooleanDataInputDecorator, CalendarDecorator, CheckboxDecorator, CurrencyDecorator, CustomActionDecorator, CustomDisplayDecorator, CustomInputDecorator, CustomLayoutDecorator, DateInputDecorator, DatePickerDecorator, DefOrCallback, DisplayDecorator, DropdownDecorator, DxActionBase, DxCommonFields, DxDisplayBase, DxDisplayRenderFn, DxFormEvent, DxInputBase, DxInternalFields, DxLayoutBase, DxResult, DxRuntimeParams, DxValidator, FormConfig, FormEvents, FormInput, GslAccordionConfig, GslActionsConfig, GslAlertsConfig, GslCalendarConfig, GslCheckboxConfig, GslConfigBase, GslCurrencyConfig, GslCustomActionConfig, GslCustomDisplayConfig, GslCustomInputConfig, GslCustomLayoutConfig, GslDateInputConfig, GslDatePickerConfig, GslDecoratorCallback, GslDisplaysConfig, GslDropdownConfig, GslInputsConfig, GslLayoutsConfig, GslListConfig, GslMarkdownConfig, GslPasswordConfig, GslRadiogroupConfig, GslRangeCalendarConfig, GslRangeDateInputConfig, GslRangeDatePickerConfig, GslRepeaterConfig, GslSelectConfig, GslTabsConfig, GslTagsConfig, GslTextareaConfig, GuiShortcutOf, InputDecorator, InputTags, LayoutDecorator, ListDecorator, MarkdownDecorator, NumberDataInputDecorator, PasswordDecorator, RadiogroupDecorator, RangeCalendarDecorator, RangeDateInputDecorator, RangeDatePickerDecorator, RepeaterDecorator, ResolvedFormInput, SelectDecorator, ShortcutTypeSelectors, SimpleFieldDef, TabsDecorator, TagsDecorator, TextareaDecorator, TextDataInputDecorator, ValidShortcutType, } from './lib/dx';
|
|
5
|
+
export type { AccordionProps, AlertProps, ButtonProps, CalendarProps, CheckboxProps, ComponentRendererProps, CurrencyProps, DateinputProps, DatePickerProps, DateRange, DropdownProps, FlexProps, GridProps, ListItem, ListProps, MarkdownProps, MarkdownTextProps, NumberinputProps, OneOfProps, Option, OptionValue, PasswordProps, RadiogroupProps, RangeCalendarProps, RangeDateInputProps, RangeDatePickerProps, RendererProps, RepeaterProps, SelectProps, TabsProps, TagsProps, TagsSeparator, TextareaProps, TextinputProps, ToggleProps, } from './lib/widget.props';
|
|
6
|
+
export type { GolemWidget } from './lib/widgets';
|
|
7
|
+
export { golemForm } from './lib/golem-form';
|
|
8
|
+
export { isOption } from './lib/utils/one-of';
|
|
2
9
|
export { getItemKey } from './lib/utils/repeater';
|