@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
@@ -15,17 +15,22 @@ export type AccordionProps = {
15
15
  }[];
16
16
  };
17
17
  export type ButtonProps = {
18
- variant?: 'filled' | 'outlined';
18
+ variant?: 'filled' | 'outlined' | 'link';
19
+ icon?: string;
20
+ iconPosition?: 'left' | 'right';
19
21
  };
22
+ export type Autocomplete = 'on' | 'off' | (string & {});
20
23
  export type TextinputProps = {
21
24
  hint?: string;
22
25
  placeholder?: string;
23
26
  icon?: string;
27
+ autocomplete?: Autocomplete;
24
28
  };
25
29
  export type PasswordProps = {
26
30
  hint?: string;
27
31
  placeholder?: string;
28
32
  icon?: string;
33
+ autocomplete?: Autocomplete;
29
34
  showPasswordIcon?: string;
30
35
  hidePasswordIcon?: string;
31
36
  showPasswordLabel?: string;
@@ -39,16 +44,49 @@ export type CurrencyProps = {
39
44
  hint?: string;
40
45
  placeholder?: string;
41
46
  icon?: string;
47
+ autocomplete?: Autocomplete;
42
48
  };
43
49
  export type TextareaProps = {
44
50
  hint?: string;
45
51
  placeholder?: string;
46
- icon?: string;
52
+ autocomplete?: Autocomplete;
47
53
  counterMode?: 'remaining' | 'current';
48
54
  minimumHeight?: number;
49
55
  autoGrow?: boolean;
50
56
  maxLength?: number;
51
57
  };
58
+ type MarkdownButtons = 'H' | 'B' | 'I' | 'S' | 'Q' | 'L' | 'OL' | 'UL' | '|';
59
+ export type MarkdownProps = {
60
+ /**
61
+ * A collection of markdown-style formatting tokens.
62
+ * * @remarks
63
+ * Each token corresponds to a specific text decoration:
64
+ * - **H**: Heading -> `### Title`
65
+ * - **B**: Bold -> `**some text**`
66
+ * - **I**: Italic -> `_some text_`
67
+ * - **S**: Strikethrough -> `~~strikethrough~~`
68
+ * - **Q**: Quote -> `> some text`
69
+ * - **L**: Link -> `[some text](url)`
70
+ * - **NL**: Ordered list -> `1. some text`
71
+ * - **UL**: Unordered list -> `- some text`
72
+ * - **|**: Separator -> `|`
73
+ * * @example
74
+ * ```ts
75
+ * const toolbar = ['H', 'B', 'I', 'S', 'Q', 'L', '|', 'OL', 'UL'];
76
+ * ```
77
+ */
78
+ tools?: MarkdownButtons[];
79
+ headingTitle?: string;
80
+ boldTitle?: string;
81
+ italicTitle?: string;
82
+ strikethroughTitle?: string;
83
+ quoteTitle?: string;
84
+ linkTitle?: string;
85
+ orderedListTitle?: string;
86
+ unorderedListTitle?: string;
87
+ splitViewTitle?: string;
88
+ defaultOpenPreview?: boolean;
89
+ } & TextareaProps;
52
90
  export type CalendarProps = {
53
91
  /**
54
92
  * An optional descriptive text providing guidance or information about the associated field or functionality.
@@ -212,14 +250,25 @@ export type RangeCalendarProps = {
212
250
  * Default is 1.
213
251
  */
214
252
  numberOfMonths?: number;
253
+ /**
254
+ * An optional string used as the ARIA label prefix for the remove button on each date range pill.
255
+ */
256
+ removePillAriaLabel?: string;
215
257
  };
216
258
  export type DateinputProps = {
217
259
  hint?: string;
218
260
  icon?: string;
219
261
  };
262
+ export type RangeDateInputProps = {
263
+ hint?: string;
264
+ icon?: string;
265
+ separator?: string;
266
+ removePillAriaLabel?: string;
267
+ startDateAriaLabel?: string;
268
+ endDateAriaLabel?: string;
269
+ };
220
270
  export type DatePickerProps = {
221
271
  hint?: string;
222
- placeholder?: string;
223
272
  icon?: string;
224
273
  prevMonthIcon?: string;
225
274
  nextMonthIcon?: string;
@@ -228,10 +277,34 @@ export type DatePickerProps = {
228
277
  dayFormat?: 'numeric' | '2-digit';
229
278
  weekdayFormat?: 'short' | 'long' | 'narrow';
230
279
  monthFormat?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow';
280
+ minDate?: string;
281
+ maxDate?: string;
282
+ disabledRanges?: DateRange[];
283
+ numberOfMonths?: number;
284
+ };
285
+ export type RangeDatePickerProps = {
286
+ hint?: string;
287
+ icon?: string;
288
+ separator?: string;
289
+ removePillAriaLabel?: string;
290
+ startDateAriaLabel?: string;
291
+ endDateAriaLabel?: string;
292
+ prevMonthIcon?: string;
293
+ nextMonthIcon?: string;
294
+ prevMonthAriaLabel?: string;
295
+ nextMonthAriaLabel?: string;
296
+ dayFormat?: 'numeric' | '2-digit';
297
+ weekdayFormat?: 'short' | 'long' | 'narrow';
298
+ monthFormat?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow';
299
+ minDate?: string;
300
+ maxDate?: string;
301
+ disabledRanges?: DateRange[];
302
+ numberOfMonths?: number;
231
303
  };
232
304
  export type NumberinputProps = {
233
305
  placeholder?: string;
234
306
  hint?: string;
307
+ autocomplete?: Autocomplete;
235
308
  step?: number;
236
309
  minimum?: number;
237
310
  maximum?: number;
@@ -249,6 +322,9 @@ export type AlertProps = {
249
322
  text: string;
250
323
  level?: 'default' | 'info' | 'success' | 'warning' | 'error';
251
324
  };
325
+ export type MarkdownTextProps = {
326
+ md: string;
327
+ };
252
328
  /**
253
329
  * Non-serializable component props. Used to render the provided component.
254
330
  * @template ComponentType Framework-dependent type for the component. e.g. ReactNode, Type<any>
@@ -271,6 +347,9 @@ export type RepeaterProps<Template> = {
271
347
  removeLabel?: string;
272
348
  limit?: number;
273
349
  template: Template;
350
+ title?: string;
351
+ addButtonIcon?: string;
352
+ removeButtonIcon?: string;
274
353
  };
275
354
  export type OptionValue = string | number;
276
355
  export type Option = {
@@ -280,6 +359,7 @@ export type Option = {
280
359
  export type SelectProps = {
281
360
  hint?: string;
282
361
  icon?: string;
362
+ autocomplete?: Autocomplete;
283
363
  options: Option[];
284
364
  placeholder?: string;
285
365
  labelField?: string;
@@ -293,6 +373,7 @@ type ItemKeys<T> = T extends Record<string, any> ? keyof T : string;
293
373
  export type DropdownProps<T> = {
294
374
  placeholder?: string;
295
375
  hint?: string;
376
+ autocomplete?: Autocomplete;
296
377
  items: ListItem<T>[];
297
378
  /**
298
379
  * Property widget used to display in the input when an item option is selected
@@ -314,7 +395,8 @@ export type DropdownProps<T> = {
314
395
  export type ListProps<T> = {
315
396
  hint?: string;
316
397
  items: ListItem<T>[];
317
- valueField?: string;
398
+ labelField?: ItemKeys<T>;
399
+ valueField?: ItemKeys<T>;
318
400
  height?: number;
319
401
  itemHeight?: number;
320
402
  /**
@@ -327,19 +409,29 @@ export type RadiogroupProps = {
327
409
  options: Option[];
328
410
  labelField?: string;
329
411
  valueField?: string;
412
+ direction?: 'row' | 'column';
330
413
  };
331
414
  export type OneOfProps = {
332
415
  labelField?: string;
333
416
  valueField?: string;
334
417
  };
335
418
  export type FlexProps = {
336
- direction?: 'horizontal' | 'vertical';
337
- align?: 'center' | 'start' | 'end' | 'space-between' | 'space-around';
419
+ direction?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
420
+ justify?: 'center' | 'start' | 'end' | 'stretch';
421
+ align?: 'center' | 'start' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
338
422
  gap?: number;
339
423
  };
424
+ export type GridProps = {
425
+ direction?: 'row' | 'column';
426
+ columnGap?: number;
427
+ rowGap?: number;
428
+ autoFit?: boolean;
429
+ align?: 'center' | 'start' | 'end' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch';
430
+ justify?: 'center' | 'start' | 'end' | 'stretch';
431
+ };
340
432
  export type TabsProps = {
341
433
  defaultOpen?: string;
342
- renderMode: 'all' | 'activeOnly';
434
+ renderMode?: 'all' | 'activeOnly';
343
435
  tabs: {
344
436
  label: string;
345
437
  uid: string;
package/lib/widgets.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export declare const inputWidgets: readonly ["calendar", "checkbox", "currency", "dateInput", "datePicker", "dropdown", "list", "number", "password", "radiogroup", "rangeCalendar", "repeater", "select", "textarea", "textinput", "toggle"];
2
- export declare const layoutWidgets: readonly ["accordion", "flex", "tabs"];
3
- export declare const displayWidgets: readonly ["alert", "renderer"];
1
+ export declare const inputWidgets: readonly ["calendar", "checkbox", "currency", "dateInput", "datePicker", "dropdown", "list", "markdown", "number", "password", "radiogroup", "rangeCalendar", "rangeDateInput", "rangeDatePicker", "repeater", "select", "textarea", "textinput", "toggle"];
2
+ export declare const layoutWidgets: readonly ["accordion", "flex", "grid", "tabs"];
3
+ export declare const displayWidgets: readonly ["alert", "markdownText", "renderer"];
4
4
  export declare const actionWidgets: readonly ["button"];
5
- export declare const vanillaWidgets: ("number" | "flex" | "repeater" | "accordion" | "alert" | "button" | "calendar" | "checkbox" | "currency" | "dateInput" | "datePicker" | "dropdown" | "list" | "password" | "radiogroup" | "rangeCalendar" | "select" | "tabs" | "textarea" | "textinput" | "toggle" | "renderer")[];
6
- export type VanillaInputWidget = (typeof inputWidgets)[number];
7
- export type VanillaLayoutWidget = (typeof layoutWidgets)[number];
8
- export type VanillaDisplayWidget = (typeof displayWidgets)[number];
9
- export type VanillaActionWidget = (typeof actionWidgets)[number];
10
- export type VanillaWidget = (typeof vanillaWidgets)[number];
5
+ export declare const golemWidgets: ("number" | "flex" | "repeater" | "button" | "password" | "checkbox" | "dateInput" | "currency" | "rangeCalendar" | "select" | "radiogroup" | "tabs" | "list" | "datePicker" | "dropdown" | "markdown" | "rangeDateInput" | "rangeDatePicker" | "textarea" | "calendar" | "grid" | "toggle" | "textinput" | "renderer" | "alert" | "accordion" | "markdownText")[];
6
+ export type GolemInputWidget = (typeof inputWidgets)[number];
7
+ export type GolemLayoutWidget = (typeof layoutWidgets)[number];
8
+ export type GolemDisplayWidget = (typeof displayWidgets)[number];
9
+ export type GolemActionWidget = (typeof actionWidgets)[number];
10
+ export type GolemWidget = (typeof golemWidgets)[number];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemui/gui-shared",
3
- "version": "0.0.2",
3
+ "version": "0.12.1",
4
4
  "type": "module",
5
5
  "main": "./index.umd.cjs",
6
6
  "module": "./index.js",
@@ -20,7 +20,12 @@
20
20
  "*.md"
21
21
  ],
22
22
  "dependencies": {
23
- "@golemui/core": "*",
24
- "@golemui/gui-validators": "*"
23
+ "@golemui/core": "0.12.1",
24
+ "@golemui/gui-validators": "0.12.1"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/golemui/golemui.git",
29
+ "directory": "libs/gui/shared"
25
30
  }
26
31
  }
@@ -1,2 +0,0 @@
1
- import * as Core from '@golemui/core';
2
- export declare const vanillaSchemaToFieldMap: <V>(validators: Core.JsonSchemaValidators<V>) => Core.SchemaToWidgetMap;