@golemui/gui-shared 0.0.2 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/CHANGELOG.md +2 -10
  2. package/README.md +15 -6
  3. package/index.d.ts +4 -3
  4. package/index.js +2363 -104
  5. package/index.umd.cjs +1 -1
  6. package/lib/dx/__tests__/helpers.d.ts +30 -0
  7. package/lib/dx/core/defineShortcutType.d.ts +38 -0
  8. package/lib/dx/core/dx.domain.d.ts +76 -0
  9. package/lib/dx/core/dxBase.types.d.ts +107 -0
  10. package/lib/dx/core/dxPropsHelper.d.ts +9 -0
  11. package/lib/dx/core/dxUtilityTypes.d.ts +40 -0
  12. package/lib/dx/core/dxValidatorHelper.d.ts +18 -0
  13. package/lib/dx/core/eventWiring.service.d.ts +22 -0
  14. package/lib/dx/core/itemTypeRegistry.d.ts +82 -0
  15. package/lib/dx/core/itemWalker.service.d.ts +31 -0
  16. package/lib/dx/core/selectorNormalizer.service.d.ts +15 -0
  17. package/lib/dx/core/selectorResolver.service.d.ts +11 -0
  18. package/lib/dx/core/sharedSensibleDefaults.service.d.ts +35 -0
  19. package/lib/dx/core/stateExpansion.service.d.ts +31 -0
  20. package/lib/dx/core/widgetMapper.service.d.ts +13 -0
  21. package/lib/dx/core/widgetMerger.service.d.ts +14 -0
  22. package/lib/dx/dx.service.d.ts +40 -0
  23. package/lib/dx/formDef.domain.d.ts +52 -0
  24. package/lib/dx/gui.d.ts +74 -0
  25. package/lib/dx/index.d.ts +100 -0
  26. package/lib/dx/registerAll.d.ts +0 -0
  27. package/lib/dx/resolveFormInput.d.ts +37 -0
  28. package/lib/dx/shortcuts/accordion/accordion.domain.d.ts +20 -0
  29. package/lib/dx/shortcuts/accordion/guiAccordion.impl.d.ts +12 -0
  30. package/lib/dx/shortcuts/accordion/register.d.ts +2 -0
  31. package/lib/dx/shortcuts/actions/actions.domain.d.ts +21 -0
  32. package/lib/dx/shortcuts/actions/guiActions.impl.d.ts +7 -0
  33. package/lib/dx/shortcuts/actions/register.d.ts +2 -0
  34. package/lib/dx/shortcuts/alert/alert.domain.d.ts +9 -0
  35. package/lib/dx/shortcuts/alert/guiAlert.impl.d.ts +6 -0
  36. package/lib/dx/shortcuts/alert/register.d.ts +2 -0
  37. package/lib/dx/shortcuts/calendar/calendar.domain.d.ts +21 -0
  38. package/lib/dx/shortcuts/calendar/calendarSensibleDefaults.service.d.ts +6 -0
  39. package/lib/dx/shortcuts/calendar/guiCalendar.impl.d.ts +6 -0
  40. package/lib/dx/shortcuts/calendar/register.d.ts +2 -0
  41. package/lib/dx/shortcuts/checkbox/checkbox.domain.d.ts +16 -0
  42. package/lib/dx/shortcuts/checkbox/guiCheckbox.impl.d.ts +6 -0
  43. package/lib/dx/shortcuts/checkbox/register.d.ts +2 -0
  44. package/lib/dx/shortcuts/currency/currency.domain.d.ts +17 -0
  45. package/lib/dx/shortcuts/currency/guiCurrency.impl.d.ts +6 -0
  46. package/lib/dx/shortcuts/currency/register.d.ts +2 -0
  47. package/lib/dx/shortcuts/custom-action/customAction.domain.d.ts +14 -0
  48. package/lib/dx/shortcuts/custom-action/guiCustomAction.impl.d.ts +6 -0
  49. package/lib/dx/shortcuts/custom-action/register.d.ts +2 -0
  50. package/lib/dx/shortcuts/custom-display/customDisplay.domain.d.ts +9 -0
  51. package/lib/dx/shortcuts/custom-display/guiCustomDisplay.impl.d.ts +8 -0
  52. package/lib/dx/shortcuts/custom-display/register.d.ts +2 -0
  53. package/lib/dx/shortcuts/custom-input/customInput.domain.d.ts +16 -0
  54. package/lib/dx/shortcuts/custom-input/guiCustomInput.impl.d.ts +6 -0
  55. package/lib/dx/shortcuts/custom-input/register.d.ts +2 -0
  56. package/lib/dx/shortcuts/custom-layout/customLayout.domain.d.ts +13 -0
  57. package/lib/dx/shortcuts/custom-layout/guiCustomLayout.impl.d.ts +7 -0
  58. package/lib/dx/shortcuts/custom-layout/register.d.ts +2 -0
  59. package/lib/dx/shortcuts/date-input/dateInput.domain.d.ts +16 -0
  60. package/lib/dx/shortcuts/date-input/guiDateInput.impl.d.ts +6 -0
  61. package/lib/dx/shortcuts/date-input/register.d.ts +2 -0
  62. package/lib/dx/shortcuts/date-picker/datePicker.domain.d.ts +17 -0
  63. package/lib/dx/shortcuts/date-picker/guiDatePicker.impl.d.ts +7 -0
  64. package/lib/dx/shortcuts/date-picker/register.d.ts +2 -0
  65. package/lib/dx/shortcuts/display/display.domain.d.ts +13 -0
  66. package/lib/dx/shortcuts/display/guiDisplay.impl.d.ts +3 -0
  67. package/lib/dx/shortcuts/display/register.d.ts +2 -0
  68. package/lib/dx/shortcuts/dropdown/dropdown.domain.d.ts +18 -0
  69. package/lib/dx/shortcuts/dropdown/guiDropdown.impl.d.ts +7 -0
  70. package/lib/dx/shortcuts/dropdown/register.d.ts +2 -0
  71. package/lib/dx/shortcuts/inputs/gslInputSubtypes.d.ts +4 -0
  72. package/lib/dx/shortcuts/inputs/guiBooleanInput.impl.d.ts +6 -0
  73. package/lib/dx/shortcuts/inputs/guiInputs.impl.d.ts +2 -0
  74. package/lib/dx/shortcuts/inputs/guiNumberInput.impl.d.ts +6 -0
  75. package/lib/dx/shortcuts/inputs/guiTextInput.impl.d.ts +6 -0
  76. package/lib/dx/shortcuts/inputs/inputDefsByKey.service.d.ts +11 -0
  77. package/lib/dx/shortcuts/inputs/inputSensibleDefaults.service.d.ts +9 -0
  78. package/lib/dx/shortcuts/inputs/inputTypeDefaults.service.d.ts +9 -0
  79. package/lib/dx/shortcuts/inputs/inputs.domain.d.ts +51 -0
  80. package/lib/dx/shortcuts/inputs/register.d.ts +2 -0
  81. package/lib/dx/shortcuts/layouts/guiFlex.impl.d.ts +8 -0
  82. package/lib/dx/shortcuts/layouts/layouts.domain.d.ts +31 -0
  83. package/lib/dx/shortcuts/layouts/register.d.ts +2 -0
  84. package/lib/dx/shortcuts/list/guiList.impl.d.ts +7 -0
  85. package/lib/dx/shortcuts/list/list.domain.d.ts +17 -0
  86. package/lib/dx/shortcuts/list/register.d.ts +2 -0
  87. package/lib/dx/shortcuts/markdown/guiMarkdown.impl.d.ts +6 -0
  88. package/lib/dx/shortcuts/markdown/markdown.domain.d.ts +17 -0
  89. package/lib/dx/shortcuts/markdown/register.d.ts +2 -0
  90. package/lib/dx/shortcuts/password/guiPassword.impl.d.ts +6 -0
  91. package/lib/dx/shortcuts/password/password.domain.d.ts +17 -0
  92. package/lib/dx/shortcuts/password/register.d.ts +2 -0
  93. package/lib/dx/shortcuts/radiogroup/guiRadiogroup.impl.d.ts +7 -0
  94. package/lib/dx/shortcuts/radiogroup/radiogroup.domain.d.ts +17 -0
  95. package/lib/dx/shortcuts/radiogroup/register.d.ts +2 -0
  96. package/lib/dx/shortcuts/range-calendar/guiRangeCalendar.impl.d.ts +6 -0
  97. package/lib/dx/shortcuts/range-calendar/rangeCalendar.domain.d.ts +16 -0
  98. package/lib/dx/shortcuts/range-calendar/register.d.ts +2 -0
  99. package/lib/dx/shortcuts/range-date-input/guiRangeDateInput.impl.d.ts +6 -0
  100. package/lib/dx/shortcuts/range-date-input/rangeDateInput.domain.d.ts +16 -0
  101. package/lib/dx/shortcuts/range-date-input/register.d.ts +2 -0
  102. package/lib/dx/shortcuts/range-date-picker/guiRangeDatePicker.impl.d.ts +6 -0
  103. package/lib/dx/shortcuts/range-date-picker/rangeDatePicker.domain.d.ts +17 -0
  104. package/lib/dx/shortcuts/range-date-picker/register.d.ts +2 -0
  105. package/lib/dx/shortcuts/repeater/guiRepeater.impl.d.ts +6 -0
  106. package/lib/dx/shortcuts/repeater/register.d.ts +3 -0
  107. package/lib/dx/shortcuts/repeater/repeater.domain.d.ts +21 -0
  108. package/lib/dx/shortcuts/scopes/gslStates.impl.d.ts +11 -0
  109. package/lib/dx/shortcuts/scopes/gslTag.impl.d.ts +2 -0
  110. package/lib/dx/shortcuts/scopes/scopeChain.d.ts +99 -0
  111. package/lib/dx/shortcuts/select/guiSelect.impl.d.ts +7 -0
  112. package/lib/dx/shortcuts/select/register.d.ts +2 -0
  113. package/lib/dx/shortcuts/select/select.domain.d.ts +18 -0
  114. package/lib/dx/shortcuts/tabs/guiTabs.impl.d.ts +12 -0
  115. package/lib/dx/shortcuts/tabs/register.d.ts +2 -0
  116. package/lib/dx/shortcuts/tabs/tabs.domain.d.ts +17 -0
  117. package/lib/dx/shortcuts/textarea/guiTextarea.impl.d.ts +6 -0
  118. package/lib/dx/shortcuts/textarea/register.d.ts +2 -0
  119. package/lib/dx/shortcuts/textarea/textarea.domain.d.ts +17 -0
  120. package/lib/golem-form.d.ts +18 -3
  121. package/lib/shared.d.ts +13 -0
  122. package/lib/utils/index.d.ts +2 -0
  123. package/lib/utils/objectUtils.service.d.ts +11 -0
  124. package/lib/utils/repeater.d.ts +9 -0
  125. package/lib/utils/schema.d.ts +14 -0
  126. package/lib/widget.factory.d.ts +4 -2
  127. package/lib/widget.props.d.ts +99 -7
  128. package/lib/widgets.d.ts +9 -9
  129. package/package.json +8 -3
  130. package/lib/middleware/json-schema-vanilla.d.ts +0 -2
@@ -0,0 +1,6 @@
1
+ import { DxRuntimeParams } from '../../core/dxUtilityTypes';
2
+ import { GuiRangeDatePickerShortcut, RangeDatePickerDecorator } from './rangeDatePicker.domain';
3
+ export declare function _guiRangeDatePicker(path: string): GuiRangeDatePickerShortcut;
4
+ export declare function _guiRangeDatePicker(path: string, props: Partial<Omit<RangeDatePickerDecorator, 'type'>>): GuiRangeDatePickerShortcut;
5
+ export declare function _guiRangeDatePicker(path: string, props: Partial<Omit<RangeDatePickerDecorator, 'type'>>, tags: string[]): GuiRangeDatePickerShortcut;
6
+ export declare function _guiRangeDatePicker(path: string, callback: (params: DxRuntimeParams) => Partial<Omit<RangeDatePickerDecorator, 'type'>>, tags?: string[]): GuiRangeDatePickerShortcut;
@@ -0,0 +1,17 @@
1
+ import { ArrayValidator } from '@golemui/gui-validators';
2
+ import { RangeDatePickerProps } from '../../../widget.props';
3
+ import { DxCommonFields, DxInputBase } from '../../core/dxBase.types';
4
+ import { DefOrCallback, GslConfigBase, GuiShortcutOf } from '../../core/dxUtilityTypes';
5
+ export interface RangeDatePickerDecorator extends DxInputBase, DxCommonFields, Partial<RangeDatePickerProps> {
6
+ type: 'rangeDatePicker';
7
+ validator?: Omit<ArrayValidator, 'type'>;
8
+ }
9
+ export interface GslRangeDatePickerConfig extends GslConfigBase<RangeDatePickerDecorator> {
10
+ suppressAutomaticLabels?: boolean;
11
+ suppressAutomaticPlaceholders?: boolean;
12
+ }
13
+ export type RangeDatePickerEntry = {
14
+ key: string;
15
+ def: DefOrCallback<RangeDatePickerDecorator>;
16
+ };
17
+ export type GuiRangeDatePickerShortcut = GuiShortcutOf<'RANGE_DATE_PICKER', RangeDatePickerEntry>;
@@ -0,0 +1,2 @@
1
+ import { GslRangeDatePickerConfig, RangeDatePickerDecorator } from './rangeDatePicker.domain';
2
+ export declare const _gslRangeDatePickers: (config: GslRangeDatePickerConfig, matcher?: ((decorator: RangeDatePickerDecorator) => boolean) | undefined) => import('../../core/dx.domain').GslLeafSelector, _gslRangeDatePickerByUid: (uid: string, config: GslRangeDatePickerConfig) => import('../../core/dx.domain').GslLeafSelector;
@@ -0,0 +1,6 @@
1
+ import { ValidGuiShortcut } from '../../core/dx.domain';
2
+ import { RepeaterDecorator, GuiRepeaterShortcut } from './repeater.domain';
3
+ export interface RepeaterProps extends Omit<Partial<RepeaterDecorator>, 'template'> {
4
+ template: ValidGuiShortcut[];
5
+ }
6
+ export declare function _guiRepeater(path: string, props: RepeaterProps, tags?: string[]): GuiRepeaterShortcut;
@@ -0,0 +1,3 @@
1
+ import { RepeaterDecorator, GslRepeaterConfig } from './repeater.domain';
2
+ export declare const _gslRepeaters: (config: GslRepeaterConfig, matcher?: (decorator: RepeaterDecorator) => boolean) => import('../../core/dx.domain').GslLeafSelector;
3
+ export declare const _gslRepeaterByUid: (id: string, config: GslRepeaterConfig) => import('../../core/dx.domain').GslLeafSelector;
@@ -0,0 +1,21 @@
1
+ import { ArrayValidator } from '@golemui/gui-validators';
2
+ import { DxCommonFields } from '../../core/dxBase.types';
3
+ import { DefOrCallback, GslConfigBase, GuiShortcutOf } from '../../core/dxUtilityTypes';
4
+ import { ValidGuiShortcut } from '../../core/dx.domain';
5
+ export interface RepeaterDecorator extends DxCommonFields {
6
+ label?: string;
7
+ addLabel?: string;
8
+ removeLabel?: string;
9
+ limit?: number;
10
+ title?: string;
11
+ addButtonIcon?: string;
12
+ removeButtonIcon?: string;
13
+ validator?: Omit<ArrayValidator, 'type'>;
14
+ }
15
+ export type GslRepeaterConfig = GslConfigBase<RepeaterDecorator>;
16
+ export type RepeaterEntry = {
17
+ key: string;
18
+ def: DefOrCallback<RepeaterDecorator>;
19
+ children: ValidGuiShortcut[];
20
+ };
21
+ export type GuiRepeaterShortcut = GuiShortcutOf<'REPEATER', RepeaterEntry>;
@@ -0,0 +1,11 @@
1
+ import { GslLeafSelector } from '../../core/dx.domain';
2
+ /**
3
+ * Internal underscore-era state-targeting primitive. Pending focus-closeout
4
+ * removal — the spec entrance is `gui.selectors.state(name).<typeSelector>(config)`.
5
+ *
6
+ * Wraps leaf selectors and marks them as targeting a specific state name.
7
+ * When resolved, matching configs are applied as state-suffixed overrides
8
+ * rather than base property overrides. Returns an array of leaves; spread
9
+ * into the `formSelectors` array since `_gslRoot` is gone.
10
+ */
11
+ export declare function _gslStates(stateName: string, ...children: GslLeafSelector[]): GslLeafSelector[];
@@ -0,0 +1,2 @@
1
+ import { GslAggregatedSelector, GslLeafSelector } from '../../core/dx.domain';
2
+ export declare function _gslTag(tag: string, ...children: GslLeafSelector[]): GslAggregatedSelector;
@@ -0,0 +1,99 @@
1
+ import { GslLeafSelector } from '../../core/dx.domain';
2
+ import { _gslInputs, _gslInputByUid } from '../inputs/register';
3
+ import { _gslTextInputs, _gslNumberInputs, _gslBooleanInputs } from '../inputs/gslInputSubtypes';
4
+ import { _gslSelects, _gslSelectByUid } from '../select/register';
5
+ import { _gslDropdowns, _gslDropdownByUid } from '../dropdown/register';
6
+ import { _gslRadiogroups, _gslRadiogroupByUid } from '../radiogroup/register';
7
+ import { _gslCheckboxes, _gslCheckboxByUid } from '../checkbox/register';
8
+ import { _gslTextareas, _gslTextareaByUid } from '../textarea/register';
9
+ import { _gslPasswords, _gslPasswordByUid } from '../password/register';
10
+ import { _gslCurrencies, _gslCurrencyByUid } from '../currency/register';
11
+ import { _gslMarkdowns, _gslMarkdownByUid } from '../markdown/register';
12
+ import { _gslLists, _gslListByUid } from '../list/register';
13
+ import { _gslCalendars, _gslCalendarByUid } from '../calendar/register';
14
+ import { _gslDateInputs, _gslDateInputByUid } from '../date-input/register';
15
+ import { _gslDatePickers, _gslDatePickerByUid } from '../date-picker/register';
16
+ import { _gslRangeCalendars, _gslRangeCalendarByUid } from '../range-calendar/register';
17
+ import { _gslRangeDateInputs, _gslRangeDateInputByUid } from '../range-date-input/register';
18
+ import { _gslRangeDatePickers, _gslRangeDatePickerByUid } from '../range-date-picker/register';
19
+ import { _gslRepeaters, _gslRepeaterByUid } from '../repeater/register';
20
+ import { _gslActions, _gslActionByUid } from '../actions/register';
21
+ import { _gslLayouts, _gslLayoutByUid } from '../layouts/register';
22
+ import { _gslDisplays, _gslDisplayByUid } from '../display/register';
23
+ import { _gslAlerts, _gslAlertByUid } from '../alert/register';
24
+ import { _gslTabs, _gslTabsByUid } from '../tabs/register';
25
+ import { _gslAccordions, _gslAccordionByUid } from '../accordion/register';
26
+ import { _gslCustomInputs, _gslCustomInputByUid } from '../custom-input/register';
27
+ import { _gslCustomActions, _gslCustomActionByUid } from '../custom-action/register';
28
+ import { _gslCustomDisplays, _gslCustomDisplayByUid } from '../custom-display/register';
29
+ import { _gslCustomLayouts, _gslCustomLayoutByUid } from '../custom-layout/register';
30
+ type CfgGsl<F> = F extends (config: infer C, matcher?: any) => GslLeafSelector ? C : never;
31
+ type CfgByUid<F> = F extends (uid: string, config: infer C) => GslLeafSelector ? C : never;
32
+ export declare class ScopeChain {
33
+ private readonly conditions;
34
+ private constructor();
35
+ static root(): ScopeChain;
36
+ tag(name: string): ScopeChain;
37
+ state(name: string): ScopeChain;
38
+ tagsAnd(names: string[]): ScopeChain;
39
+ tagsOr(names: string[]): ScopeChain;
40
+ private apply;
41
+ inputs(config: CfgGsl<typeof _gslInputs>): GslLeafSelector;
42
+ inputByUid(uid: string, config: CfgByUid<typeof _gslInputByUid>): GslLeafSelector;
43
+ textInputs(config: Parameters<typeof _gslTextInputs>[0]): GslLeafSelector;
44
+ numberInputs(config: Parameters<typeof _gslNumberInputs>[0]): GslLeafSelector;
45
+ booleanInputs(config: Parameters<typeof _gslBooleanInputs>[0]): GslLeafSelector;
46
+ selects(config: CfgGsl<typeof _gslSelects>): GslLeafSelector;
47
+ selectByUid(uid: string, config: CfgByUid<typeof _gslSelectByUid>): GslLeafSelector;
48
+ dropdowns(config: CfgGsl<typeof _gslDropdowns>): GslLeafSelector;
49
+ dropdownByUid(uid: string, config: CfgByUid<typeof _gslDropdownByUid>): GslLeafSelector;
50
+ radiogroups(config: CfgGsl<typeof _gslRadiogroups>): GslLeafSelector;
51
+ radiogroupByUid(uid: string, config: CfgByUid<typeof _gslRadiogroupByUid>): GslLeafSelector;
52
+ checkboxes(config: CfgGsl<typeof _gslCheckboxes>): GslLeafSelector;
53
+ checkboxByUid(uid: string, config: CfgByUid<typeof _gslCheckboxByUid>): GslLeafSelector;
54
+ textareas(config: CfgGsl<typeof _gslTextareas>): GslLeafSelector;
55
+ textareaByUid(uid: string, config: CfgByUid<typeof _gslTextareaByUid>): GslLeafSelector;
56
+ passwords(config: CfgGsl<typeof _gslPasswords>): GslLeafSelector;
57
+ passwordByUid(uid: string, config: CfgByUid<typeof _gslPasswordByUid>): GslLeafSelector;
58
+ currencies(config: CfgGsl<typeof _gslCurrencies>): GslLeafSelector;
59
+ currencyByUid(uid: string, config: CfgByUid<typeof _gslCurrencyByUid>): GslLeafSelector;
60
+ markdowns(config: CfgGsl<typeof _gslMarkdowns>): GslLeafSelector;
61
+ markdownByUid(uid: string, config: CfgByUid<typeof _gslMarkdownByUid>): GslLeafSelector;
62
+ lists(config: CfgGsl<typeof _gslLists>): GslLeafSelector;
63
+ listByUid(uid: string, config: CfgByUid<typeof _gslListByUid>): GslLeafSelector;
64
+ calendars(config: CfgGsl<typeof _gslCalendars>): GslLeafSelector;
65
+ calendarByUid(uid: string, config: CfgByUid<typeof _gslCalendarByUid>): GslLeafSelector;
66
+ dateInputs(config: CfgGsl<typeof _gslDateInputs>): GslLeafSelector;
67
+ dateInputByUid(uid: string, config: CfgByUid<typeof _gslDateInputByUid>): GslLeafSelector;
68
+ datePickers(config: CfgGsl<typeof _gslDatePickers>): GslLeafSelector;
69
+ datePickerByUid(uid: string, config: CfgByUid<typeof _gslDatePickerByUid>): GslLeafSelector;
70
+ rangeCalendars(config: CfgGsl<typeof _gslRangeCalendars>): GslLeafSelector;
71
+ rangeCalendarByUid(uid: string, config: CfgByUid<typeof _gslRangeCalendarByUid>): GslLeafSelector;
72
+ rangeDateInputs(config: CfgGsl<typeof _gslRangeDateInputs>): GslLeafSelector;
73
+ rangeDateInputByUid(uid: string, config: CfgByUid<typeof _gslRangeDateInputByUid>): GslLeafSelector;
74
+ rangeDatePickers(config: CfgGsl<typeof _gslRangeDatePickers>): GslLeafSelector;
75
+ rangeDatePickerByUid(uid: string, config: CfgByUid<typeof _gslRangeDatePickerByUid>): GslLeafSelector;
76
+ repeaters(config: CfgGsl<typeof _gslRepeaters>): GslLeafSelector;
77
+ repeaterByUid(uid: string, config: CfgByUid<typeof _gslRepeaterByUid>): GslLeafSelector;
78
+ actions(config: CfgGsl<typeof _gslActions>): GslLeafSelector;
79
+ actionByUid(uid: string, config: CfgByUid<typeof _gslActionByUid>): GslLeafSelector;
80
+ layouts(config: CfgGsl<typeof _gslLayouts>): GslLeafSelector;
81
+ layoutByUid(uid: string, config: CfgByUid<typeof _gslLayoutByUid>): GslLeafSelector;
82
+ displays(config: CfgGsl<typeof _gslDisplays>): GslLeafSelector;
83
+ displayByUid(uid: string, config: CfgByUid<typeof _gslDisplayByUid>): GslLeafSelector;
84
+ alerts(config: CfgGsl<typeof _gslAlerts>): GslLeafSelector;
85
+ alertByUid(uid: string, config: CfgByUid<typeof _gslAlertByUid>): GslLeafSelector;
86
+ tabs(config: CfgGsl<typeof _gslTabs>): GslLeafSelector;
87
+ tabsByUid(uid: string, config: CfgByUid<typeof _gslTabsByUid>): GslLeafSelector;
88
+ accordions(config: CfgGsl<typeof _gslAccordions>): GslLeafSelector;
89
+ accordionByUid(uid: string, config: CfgByUid<typeof _gslAccordionByUid>): GslLeafSelector;
90
+ customInputs(config: CfgGsl<typeof _gslCustomInputs>): GslLeafSelector;
91
+ customInputByUid(uid: string, config: CfgByUid<typeof _gslCustomInputByUid>): GslLeafSelector;
92
+ customActions(config: CfgGsl<typeof _gslCustomActions>): GslLeafSelector;
93
+ customActionByUid(uid: string, config: CfgByUid<typeof _gslCustomActionByUid>): GslLeafSelector;
94
+ customDisplays(config: CfgGsl<typeof _gslCustomDisplays>): GslLeafSelector;
95
+ customDisplayByUid(uid: string, config: CfgByUid<typeof _gslCustomDisplayByUid>): GslLeafSelector;
96
+ customLayouts(config: CfgGsl<typeof _gslCustomLayouts>): GslLeafSelector;
97
+ customLayoutByUid(uid: string, config: CfgByUid<typeof _gslCustomLayoutByUid>): GslLeafSelector;
98
+ }
99
+ export {};
@@ -0,0 +1,7 @@
1
+ import { DxRuntimeParams } from '../../core/dxUtilityTypes';
2
+ import { GuiSelectShortcut, SelectDecorator } from './select.domain';
3
+ type SelectFactoryProps = Omit<SelectDecorator, 'type'>;
4
+ export declare function _guiSelect(path: string, props: SelectFactoryProps): GuiSelectShortcut;
5
+ export declare function _guiSelect(path: string, props: SelectFactoryProps, tags: string[]): GuiSelectShortcut;
6
+ export declare function _guiSelect(path: string, callback: (params: DxRuntimeParams) => SelectFactoryProps, tags?: string[]): GuiSelectShortcut;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { GslSelectConfig, SelectDecorator } from './select.domain';
2
+ export declare const _gslSelects: (config: GslSelectConfig, matcher?: ((decorator: SelectDecorator) => boolean) | undefined) => import('../../core/dx.domain').GslLeafSelector, _gslSelectByUid: (uid: string, config: GslSelectConfig) => import('../../core/dx.domain').GslLeafSelector;
@@ -0,0 +1,18 @@
1
+ import { Validator } from '@golemui/gui-validators';
2
+ import { Option, OptionValue, SelectProps } from '../../../widget.props';
3
+ import { DxCommonFields, DxInputBase } from '../../core/dxBase.types';
4
+ import { DefOrCallback, GslConfigBase, GuiShortcutOf } from '../../core/dxUtilityTypes';
5
+ export interface SelectDecorator extends DxInputBase, DxCommonFields, Partial<Omit<SelectProps, 'options'>> {
6
+ type: 'select';
7
+ options?: Option[] | OptionValue[] | Record<string, unknown>[];
8
+ validator?: Validator;
9
+ }
10
+ export interface GslSelectConfig extends GslConfigBase<SelectDecorator> {
11
+ suppressAutomaticLabels?: boolean;
12
+ suppressAutomaticPlaceholders?: boolean;
13
+ }
14
+ export type SelectEntry = {
15
+ key: string;
16
+ def: DefOrCallback<SelectDecorator>;
17
+ };
18
+ export type GuiSelectShortcut = GuiShortcutOf<'SELECT', SelectEntry>;
@@ -0,0 +1,12 @@
1
+ import { ValidGuiShortcut } from '../../core/dx.domain';
2
+ import { GuiTabsShortcut, TabsDecorator } from './tabs.domain';
3
+ type TabsFactoryProps = Omit<TabsDecorator, 'tabs'>;
4
+ export interface TabSection {
5
+ label: string;
6
+ children: ValidGuiShortcut[];
7
+ uid?: string;
8
+ }
9
+ export declare function _guiTabs(sections: TabSection[]): GuiTabsShortcut;
10
+ export declare function _guiTabs(sections: TabSection[], props: TabsFactoryProps): GuiTabsShortcut;
11
+ export declare function _guiTabs(sections: TabSection[], props: TabsFactoryProps, tags: string[]): GuiTabsShortcut;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ import { GslTabsConfig, TabsDecorator } from './tabs.domain';
2
+ export declare const _gslTabs: (config: GslTabsConfig, matcher?: ((decorator: TabsDecorator) => boolean) | undefined) => import('../../core/dx.domain').GslLeafSelector, _gslTabsByUid: (uid: string, config: GslTabsConfig) => import('../../core/dx.domain').GslLeafSelector;
@@ -0,0 +1,17 @@
1
+ import { DxCommonFields, DxLayoutBase } from '../../core/dxBase.types';
2
+ import { DefOrCallback, GslConfigBase, GuiShortcutOf } from '../../core/dxUtilityTypes';
3
+ import { ValidGuiShortcut } from '../../core/dx.domain';
4
+ export interface TabsDecorator extends DxLayoutBase, DxCommonFields {
5
+ tabs: {
6
+ label: string;
7
+ uid: string;
8
+ }[];
9
+ renderMode?: 'all' | 'activeOnly';
10
+ defaultOpen?: string;
11
+ }
12
+ export type GslTabsConfig = GslConfigBase<TabsDecorator>;
13
+ export type TabsEntry = {
14
+ def: DefOrCallback<TabsDecorator>;
15
+ children: ValidGuiShortcut[];
16
+ };
17
+ export type GuiTabsShortcut = GuiShortcutOf<'TABS', TabsEntry>;
@@ -0,0 +1,6 @@
1
+ import { DxRuntimeParams } from '../../core/dxUtilityTypes';
2
+ import { GuiTextareaShortcut, TextareaDecorator } from './textarea.domain';
3
+ export declare function _guiTextarea(path: string): GuiTextareaShortcut;
4
+ export declare function _guiTextarea(path: string, props: Partial<Omit<TextareaDecorator, 'type'>>): GuiTextareaShortcut;
5
+ export declare function _guiTextarea(path: string, props: Partial<Omit<TextareaDecorator, 'type'>>, tags: string[]): GuiTextareaShortcut;
6
+ export declare function _guiTextarea(path: string, callback: (params: DxRuntimeParams) => Partial<Omit<TextareaDecorator, 'type'>>, tags?: string[]): GuiTextareaShortcut;
@@ -0,0 +1,2 @@
1
+ import { GslTextareaConfig, TextareaDecorator } from './textarea.domain';
2
+ export declare const _gslTextareas: (config: GslTextareaConfig, matcher?: ((decorator: TextareaDecorator) => boolean) | undefined) => import('../../core/dx.domain').GslLeafSelector, _gslTextareaByUid: (uid: string, config: GslTextareaConfig) => import('../../core/dx.domain').GslLeafSelector;
@@ -0,0 +1,17 @@
1
+ import { StringValidator } from '@golemui/gui-validators';
2
+ import { TextareaProps } from '../../../widget.props';
3
+ import { DxCommonFields, DxInputBase } from '../../core/dxBase.types';
4
+ import { DefOrCallback, GslConfigBase, GuiShortcutOf } from '../../core/dxUtilityTypes';
5
+ export interface TextareaDecorator extends DxInputBase, DxCommonFields, Partial<TextareaProps> {
6
+ type: 'textarea';
7
+ validator?: Omit<StringValidator, 'type'>;
8
+ }
9
+ export interface GslTextareaConfig extends GslConfigBase<TextareaDecorator> {
10
+ suppressAutomaticLabels?: boolean;
11
+ suppressAutomaticPlaceholders?: boolean;
12
+ }
13
+ export type TextareaEntry = {
14
+ key: string;
15
+ def: DefOrCallback<TextareaDecorator>;
16
+ };
17
+ export type GuiTextareaShortcut = GuiShortcutOf<'TEXTAREA', TextareaEntry>;
@@ -71,7 +71,7 @@ declare class GolemFormBuilder<FormType extends Record<string, any>, CustomWidge
71
71
  * {
72
72
  * kind: 'layout',
73
73
  * type: 'flex',
74
- * props: { direction: 'horizontal' },
74
+ * props: { direction: 'row' },
75
75
  * children: [
76
76
  * {
77
77
  * kind: 'input',
@@ -92,14 +92,14 @@ declare class GolemFormBuilder<FormType extends Record<string, any>, CustomWidge
92
92
  * ```
93
93
  */
94
94
  export declare function golemForm<FormType extends Record<string, any>, CustomWidget extends Core.FormWidget<any, FormType> = never>(): GolemFormBuilder<FormType, CustomWidget>;
95
- type GolemWidget<FormType extends Record<string, any>, States extends string, V, CustomWidget extends Core.FormWidget<any, FormType> = never> = GuiAccordion<FormType, States, V, CustomWidget> | GuiAlert<FormType, States> | GuiButton<FormType, States> | GuiCalendar<FormType, States, V> | GuiCheckbox<FormType, States, V> | GuiCurrency<FormType, States, V> | GuiDateinput<FormType, States, V> | GuiDatePicker<FormType, States, V> | GuiDropdown<FormType, States, V> | GuiFunctionWidget<FormType, States, V, CustomWidget> | GuiList<FormType, States, V> | GuiNumberinput<FormType, States, V> | GuiPassword<FormType, States, V> | GuiRadiogroup<FormType, States, V> | GuiRangeCalendar<FormType, States, V> | GuiRepeater<FormType, States, V, CustomWidget> | GuiSelect<FormType, States, V> | GuiFlex<FormType, States, V, CustomWidget> | GuiTabs<FormType, States, V, CustomWidget> | GuiTextarea<FormType, States, V> | GuiTextInput<FormType, States, V> | GuiToggle<FormType, States, V> | CustomWidget;
95
+ type GolemWidget<FormType extends Record<string, any>, States extends string, V, CustomWidget extends Core.FormWidget<any, FormType> = never> = GuiAccordion<FormType, States, V, CustomWidget> | GuiAlert<FormType, States> | GuiButton<FormType, States> | GuiCalendar<FormType, States, V> | GuiCheckbox<FormType, States, V> | GuiCurrency<FormType, States, V> | GuiDateinput<FormType, States, V> | GuiDatePicker<FormType, States, V> | GuiDropdown<FormType, States, V> | GuiFunctionWidget<FormType, States, V, CustomWidget> | GuiList<FormType, States, V> | GuiMarkdown<FormType, States, V> | GuiMarkdownText<FormType, States> | GuiNumberinput<FormType, States, V> | GuiPassword<FormType, States, V> | GuiRadiogroup<FormType, States, V> | GuiRangeCalendar<FormType, States, V> | GuiRangeDateInput<FormType, States, V> | GuiRangeDatePicker<FormType, States, V> | GuiRepeater<FormType, States, V, CustomWidget> | GuiSelect<FormType, States, V> | GuiFlex<FormType, States, V, CustomWidget> | GuiGrid<FormType, States, V, CustomWidget> | GuiTabs<FormType, States, V, CustomWidget> | GuiTextarea<FormType, States, V> | GuiTextInput<FormType, States, V> | GuiToggle<FormType, States, V> | CustomWidget;
96
96
  type GuiAccordion<FormType extends Record<string, any>, States extends string, V, CustomWidget extends Core.FormWidget<any, FormType>> = Core.LayoutWidget<States, FormType, Props.AccordionProps, GolemWidget<FormType, States, V, CustomWidget>[]> & {
97
97
  type: 'accordion';
98
98
  };
99
99
  type GuiAlert<FormType extends Record<string, any>, States extends string> = Core.DisplayWidget<States, FormType, Props.AlertProps> & {
100
100
  type: 'alert';
101
101
  };
102
- type GuiButton<FormType extends Record<string, any>, States extends string> = Core.ActionWidget<States, FormType, never> & {
102
+ type GuiButton<FormType extends Record<string, any>, States extends string> = Core.ActionWidget<States, FormType, Props.ButtonProps> & {
103
103
  type: 'button';
104
104
  };
105
105
  type GuiCalendar<FormType extends Record<string, any>, States extends string, V> = Core.InputWidget<string, States, FormType, Props.CalendarProps, V> & {
@@ -124,6 +124,12 @@ type GuiFunctionWidget<FormType extends Record<string, any>, States extends stri
124
124
  type GuiList<FormType extends Record<string, any>, States extends string, V> = Core.InputWidget<Props.OptionValue, States, FormType, Props.ListProps<unknown>, V> & {
125
125
  type: 'list';
126
126
  };
127
+ type GuiMarkdown<FormType extends Record<string, any>, States extends string, V> = Core.InputWidget<number, States, FormType, Props.MarkdownProps, V> & {
128
+ type: 'markdown';
129
+ };
130
+ type GuiMarkdownText<FormType extends Record<string, any>, States extends string> = Core.DisplayWidget<States, FormType, Props.MarkdownTextProps> & {
131
+ type: 'markdownText';
132
+ };
127
133
  type GuiNumberinput<FormType extends Record<string, any>, States extends string, V> = Core.InputWidget<number, States, FormType, Props.NumberinputProps, V> & {
128
134
  type: 'number';
129
135
  };
@@ -133,6 +139,12 @@ type GuiRadiogroup<FormType extends Record<string, any>, States extends string,
133
139
  type GuiRangeCalendar<FormType extends Record<string, any>, States extends string, V> = Core.InputWidget<string, States, FormType, Props.RangeCalendarProps, V> & {
134
140
  type: 'rangeCalendar';
135
141
  };
142
+ type GuiRangeDateInput<FormType extends Record<string, any>, States extends string, V> = Core.InputWidget<Props.DateRange[], States, FormType, Props.RangeDateInputProps, V> & {
143
+ type: 'rangeDateInput';
144
+ };
145
+ type GuiRangeDatePicker<FormType extends Record<string, any>, States extends string, V> = Core.InputWidget<Props.DateRange[], States, FormType, Props.RangeDatePickerProps, V> & {
146
+ type: 'rangeDatePicker';
147
+ };
136
148
  type GuiRepeater<FormType extends Record<string, any>, States extends string, V, CustomWidget extends Core.FormWidget<any, FormType>> = Core.InputWidget<Record<string, unknown>[], States, FormType, Props.RepeaterProps<Core.LayoutWidget<States, FormType, Props.AccordionProps, GolemWidget<FormType, States, V, CustomWidget>[]>>, V> & {
137
149
  type: 'repeater';
138
150
  };
@@ -142,6 +154,9 @@ type GuiSelect<FormType extends Record<string, any>, States extends string, V> =
142
154
  type GuiFlex<FormType extends Record<string, any>, States extends string, V, CustomWidget extends Core.FormWidget<any, FormType>> = Core.LayoutWidget<States, FormType, Props.FlexProps, GolemWidget<FormType, States, V, CustomWidget>[]> & {
143
155
  type: 'flex';
144
156
  };
157
+ type GuiGrid<FormType extends Record<string, any>, States extends string, V, CustomWidget extends Core.FormWidget<any, FormType>> = Core.LayoutWidget<States, FormType, Props.GridProps, GolemWidget<FormType, States, V, CustomWidget>[]> & {
158
+ type: 'grid';
159
+ };
145
160
  type GuiTabs<FormType extends Record<string, any>, States extends string, V, CustomWidget extends Core.FormWidget<any, FormType>> = Core.LayoutWidget<States, FormType, Props.TabsProps, GolemWidget<FormType, States, V, CustomWidget>[]> & {
146
161
  type: 'tabs';
147
162
  };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Dependencies are any 3rd party service components may need internally.
3
+ * e.g. a markdown parser for the Markdown component
4
+ */
5
+ export type Dependencies = {
6
+ /**
7
+ * The markdown parser used by the markdown component
8
+ * Popular options are Snarkdown, Micromark and Marked.
9
+ */
10
+ markdown?: {
11
+ parse: (markdown: string) => string;
12
+ };
13
+ };
@@ -1 +1,3 @@
1
1
  export * from './one-of';
2
+ export * from './repeater';
3
+ export * from './schema';
@@ -0,0 +1,11 @@
1
+ export declare class ObjectUtils {
2
+ /**
3
+ * Deep merges two objects, with right taking precedence over left when properties conflict.
4
+ * Arrays are replaced, not merged.
5
+ * @param left - The base object
6
+ * @param right - The object whose properties take precedence
7
+ * @returns A new merged object
8
+ */
9
+ deepMerge<T = any>(left: any, right?: any): T;
10
+ }
11
+ export declare const objectUtils: ObjectUtils;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns a stable unique key for a repeater data item.
3
+ * Assigns a non-enumerable `__rid` property on first access so the ID
4
+ * survives array operations (splice, filter, spread) without polluting
5
+ * serialised output (JSON.stringify, Object.keys).
6
+ *
7
+ * @param idIncrementer function that increments the lexically-scoped id.
8
+ */
9
+ export declare function getItemKey(item: Record<string, unknown>, idIncrementer: () => number): number;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Traverses a raw form JSON object and replaces every `{ "$ref": "path" }` widget
3
+ * with the content of the referenced `.form-chunk.json` file, fetched asynchronously.
4
+ *
5
+ * Refs are resolved relative to `baseUrl`, so nested chunks resolve their own refs
6
+ * relative to their own URL. The `$schema` key is stripped from loaded chunks as it
7
+ * is editor-only metadata not expected by the form decoder.
8
+ *
9
+ * @param formJson - The parsed form JSON (top-level `{ states?, form: [...] }` object).
10
+ * @param baseUrl - Base URL used to resolve relative `$ref` paths — typically the URL
11
+ * of the form JSON file itself (e.g. `import.meta.resolve('./my-form.form.json')`).
12
+ * @returns A new object with all chunk refs inlined. The input is not mutated.
13
+ */
14
+ export declare function resolveChunkRefs(formJson: Record<string, unknown>, baseUrl: string): Promise<Record<string, unknown>>;
@@ -4,9 +4,9 @@ type InputWidgetConfig<T> = Omit<Core.InputWidget<T>, 'kind' | 'type' | 'uid' |
4
4
  type LayoutWidgetConfig = Omit<Core.LayoutWidget, 'kind' | 'type' | 'uid' | 'props'>;
5
5
  type DisplayWidgetConfig = Omit<Core.BaseWidget, 'kind' | 'type' | 'uid' | 'props'>;
6
6
  /**
7
- * Vanilla widget factory
7
+ * Golem widget factory
8
8
  */
9
- export declare const Vanilla: {
9
+ export declare const GolemWidgets: {
10
10
  textinput: <StateKeys extends Core.UiState = string, V = any>({ config, props, validator, }: {
11
11
  config: InputWidgetConfig<string>;
12
12
  props?: Props.TextinputProps;
@@ -33,7 +33,9 @@ export declare const Vanilla: {
33
33
  validator?: V;
34
34
  }) => Core.InputWidget<string, StateKeys>;
35
35
  flex: <StateKeys extends Core.UiState = string>(config: LayoutWidgetConfig, props?: Props.FlexProps) => Core.LayoutWidget<StateKeys>;
36
+ grid: <StateKeys extends Core.UiState = string>(config: LayoutWidgetConfig, props?: Props.GridProps) => Core.LayoutWidget<StateKeys>;
36
37
  tabs: <StateKeys extends Core.UiState = string>(config: LayoutWidgetConfig, props?: Props.TabsProps) => Core.LayoutWidget<StateKeys>;
37
38
  alert: <StateKeys extends Core.UiState = string>(config: DisplayWidgetConfig, props?: Props.AlertProps) => Core.DisplayWidget<StateKeys>;
39
+ markdownText: <StateKeys extends Core.UiState = string>(config: DisplayWidgetConfig, props?: Props.MarkdownTextProps) => Core.DisplayWidget<StateKeys>;
38
40
  };
39
41
  export {};