@golemui/gui-shared 1.0.2 → 1.1.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/index.d.ts +1 -0
  3. package/index.js +268 -198
  4. package/index.umd.cjs +1 -1
  5. package/internals.d.ts +4 -4
  6. package/internals.js +355 -314
  7. package/internals.umd.cjs +1 -1
  8. package/lib/dx/core/dx.domain.d.ts +6 -1
  9. package/lib/dx/core/withForm.d.ts +8 -0
  10. package/lib/dx/formDef.domain.d.ts +2 -1
  11. package/lib/dx/gui.d.ts +20 -0
  12. package/lib/dx/index.d.ts +30 -0
  13. package/lib/dx/resolveFormInput.d.ts +9 -1
  14. package/lib/dx/shortcuts/date-time-calendar/dateTimeCalendar.domain.d.ts +22 -0
  15. package/lib/dx/shortcuts/date-time-calendar/dateTimeCalendarSensibleDefaults.service.d.ts +6 -0
  16. package/lib/dx/shortcuts/date-time-calendar/guiDateTimeCalendar.impl.d.ts +6 -0
  17. package/lib/dx/shortcuts/date-time-calendar/register.d.ts +2 -0
  18. package/lib/dx/shortcuts/date-time-input/dateTimeInput.domain.d.ts +17 -0
  19. package/lib/dx/shortcuts/date-time-input/guiDateTimeInput.impl.d.ts +6 -0
  20. package/lib/dx/shortcuts/date-time-input/register.d.ts +2 -0
  21. package/lib/dx/shortcuts/date-time-picker/dateTimePicker.domain.d.ts +18 -0
  22. package/lib/dx/shortcuts/date-time-picker/guiDateTimePicker.impl.d.ts +7 -0
  23. package/lib/dx/shortcuts/date-time-picker/register.d.ts +2 -0
  24. package/lib/dx/shortcuts/range-date-time-calendar/guiRangeDateTimeCalendar.impl.d.ts +6 -0
  25. package/lib/dx/shortcuts/range-date-time-calendar/rangeDateTimeCalendar.domain.d.ts +17 -0
  26. package/lib/dx/shortcuts/range-date-time-calendar/register.d.ts +2 -0
  27. package/lib/dx/shortcuts/range-date-time-input/guiRangeDateTimeInput.impl.d.ts +6 -0
  28. package/lib/dx/shortcuts/range-date-time-input/rangeDateTimeInput.domain.d.ts +17 -0
  29. package/lib/dx/shortcuts/range-date-time-input/register.d.ts +2 -0
  30. package/lib/dx/shortcuts/range-date-time-picker/guiRangeDateTimePicker.impl.d.ts +6 -0
  31. package/lib/dx/shortcuts/range-date-time-picker/rangeDateTimePicker.domain.d.ts +17 -0
  32. package/lib/dx/shortcuts/range-date-time-picker/register.d.ts +2 -0
  33. package/lib/dx/shortcuts/range-time-input/guiRangeTimeInput.impl.d.ts +6 -0
  34. package/lib/dx/shortcuts/range-time-input/rangeTimeInput.domain.d.ts +17 -0
  35. package/lib/dx/shortcuts/range-time-input/register.d.ts +2 -0
  36. package/lib/dx/shortcuts/range-time-picker/guiRangeTimePicker.impl.d.ts +6 -0
  37. package/lib/dx/shortcuts/range-time-picker/rangeTimePicker.domain.d.ts +17 -0
  38. package/lib/dx/shortcuts/range-time-picker/register.d.ts +2 -0
  39. package/lib/dx/shortcuts/scopes/scopeChain.d.ts +30 -0
  40. package/lib/dx/shortcuts/time-input/guiTimeInput.impl.d.ts +6 -0
  41. package/lib/dx/shortcuts/time-input/register.d.ts +2 -0
  42. package/lib/dx/shortcuts/time-input/timeInput.domain.d.ts +17 -0
  43. package/lib/dx/shortcuts/time-picker/guiTimePicker.impl.d.ts +7 -0
  44. package/lib/dx/shortcuts/time-picker/register.d.ts +2 -0
  45. package/lib/dx/shortcuts/time-picker/timePicker.domain.d.ts +18 -0
  46. package/lib/golem-form.d.ts +32 -2
  47. package/lib/widget.props.d.ts +197 -26
  48. package/lib/widgets.d.ts +2 -2
  49. package/package.json +3 -3
  50. package/{register-BxVKv9Qh.js → register-C4dCzlrS.js} +756 -412
  51. package/register-KU4CGoTQ.cjs +1 -0
  52. package/register-dBzdQbWZ.cjs +0 -1
@@ -11,11 +11,21 @@ import { _gslCurrencies, _gslCurrencyByUid } from '../currency/register';
11
11
  import { _gslMarkdowns, _gslMarkdownByUid } from '../markdown/register';
12
12
  import { _gslLists, _gslListByUid } from '../list/register';
13
13
  import { _gslCalendars, _gslCalendarByUid } from '../calendar/register';
14
+ import { _gslDateTimeCalendars, _gslDateTimeCalendarByUid } from '../date-time-calendar/register';
14
15
  import { _gslDateInputs, _gslDateInputByUid } from '../date-input/register';
15
16
  import { _gslDatePickers, _gslDatePickerByUid } from '../date-picker/register';
17
+ import { _gslDateTimePickers, _gslDateTimePickerByUid } from '../date-time-picker/register';
16
18
  import { _gslRangeCalendars, _gslRangeCalendarByUid } from '../range-calendar/register';
17
19
  import { _gslRangeDateInputs, _gslRangeDateInputByUid } from '../range-date-input/register';
20
+ import { _gslRangeDateTimeInputs, _gslRangeDateTimeInputByUid } from '../range-date-time-input/register';
21
+ import { _gslRangeDateTimeCalendars, _gslRangeDateTimeCalendarByUid } from '../range-date-time-calendar/register';
22
+ import { _gslRangeDateTimePickers, _gslRangeDateTimePickerByUid } from '../range-date-time-picker/register';
23
+ import { _gslRangeTimeInputs, _gslRangeTimeInputByUid } from '../range-time-input/register';
24
+ import { _gslTimeInputs, _gslTimeInputByUid } from '../time-input/register';
25
+ import { _gslTimePickers, _gslTimePickerByUid } from '../time-picker/register';
26
+ import { _gslDateTimeInputs, _gslDateTimeInputByUid } from '../date-time-input/register';
18
27
  import { _gslRangeDatePickers, _gslRangeDatePickerByUid } from '../range-date-picker/register';
28
+ import { _gslRangeTimePickers, _gslRangeTimePickerByUid } from '../range-time-picker/register';
19
29
  import { _gslRepeaters, _gslRepeaterByUid } from '../repeater/register';
20
30
  import { _gslActions, _gslActionByUid } from '../actions/register';
21
31
  import { _gslLayouts, _gslLayoutByUid } from '../layouts/register';
@@ -64,16 +74,36 @@ export declare class ScopeChain {
64
74
  listByUid(uid: string, config: CfgByUid<typeof _gslListByUid>): GslLeafSelector;
65
75
  calendars(config: CfgGsl<typeof _gslCalendars>): GslLeafSelector;
66
76
  calendarByUid(uid: string, config: CfgByUid<typeof _gslCalendarByUid>): GslLeafSelector;
77
+ dateTimeCalendars(config: CfgGsl<typeof _gslDateTimeCalendars>): GslLeafSelector;
78
+ dateTimeCalendarByUid(uid: string, config: CfgByUid<typeof _gslDateTimeCalendarByUid>): GslLeafSelector;
67
79
  dateInputs(config: CfgGsl<typeof _gslDateInputs>): GslLeafSelector;
68
80
  dateInputByUid(uid: string, config: CfgByUid<typeof _gslDateInputByUid>): GslLeafSelector;
81
+ timeInputs(config: CfgGsl<typeof _gslTimeInputs>): GslLeafSelector;
82
+ timeInputByUid(uid: string, config: CfgByUid<typeof _gslTimeInputByUid>): GslLeafSelector;
83
+ timePickers(config: CfgGsl<typeof _gslTimePickers>): GslLeafSelector;
84
+ timePickerByUid(uid: string, config: CfgByUid<typeof _gslTimePickerByUid>): GslLeafSelector;
85
+ dateTimeInputs(config: CfgGsl<typeof _gslDateTimeInputs>): GslLeafSelector;
86
+ dateTimeInputByUid(uid: string, config: CfgByUid<typeof _gslDateTimeInputByUid>): GslLeafSelector;
69
87
  datePickers(config: CfgGsl<typeof _gslDatePickers>): GslLeafSelector;
70
88
  datePickerByUid(uid: string, config: CfgByUid<typeof _gslDatePickerByUid>): GslLeafSelector;
89
+ dateTimePickers(config: CfgGsl<typeof _gslDateTimePickers>): GslLeafSelector;
90
+ dateTimePickerByUid(uid: string, config: CfgByUid<typeof _gslDateTimePickerByUid>): GslLeafSelector;
71
91
  rangeCalendars(config: CfgGsl<typeof _gslRangeCalendars>): GslLeafSelector;
72
92
  rangeCalendarByUid(uid: string, config: CfgByUid<typeof _gslRangeCalendarByUid>): GslLeafSelector;
73
93
  rangeDateInputs(config: CfgGsl<typeof _gslRangeDateInputs>): GslLeafSelector;
74
94
  rangeDateInputByUid(uid: string, config: CfgByUid<typeof _gslRangeDateInputByUid>): GslLeafSelector;
95
+ rangeTimeInputs(config: CfgGsl<typeof _gslRangeTimeInputs>): GslLeafSelector;
96
+ rangeTimeInputByUid(uid: string, config: CfgByUid<typeof _gslRangeTimeInputByUid>): GslLeafSelector;
97
+ rangeDateTimeInputs(config: CfgGsl<typeof _gslRangeDateTimeInputs>): GslLeafSelector;
98
+ rangeDateTimeInputByUid(uid: string, config: CfgByUid<typeof _gslRangeDateTimeInputByUid>): GslLeafSelector;
99
+ rangeDateTimeCalendars(config: CfgGsl<typeof _gslRangeDateTimeCalendars>): GslLeafSelector;
100
+ rangeDateTimeCalendarByUid(uid: string, config: CfgByUid<typeof _gslRangeDateTimeCalendarByUid>): GslLeafSelector;
101
+ rangeDateTimePickers(config: CfgGsl<typeof _gslRangeDateTimePickers>): GslLeafSelector;
102
+ rangeDateTimePickerByUid(uid: string, config: CfgByUid<typeof _gslRangeDateTimePickerByUid>): GslLeafSelector;
75
103
  rangeDatePickers(config: CfgGsl<typeof _gslRangeDatePickers>): GslLeafSelector;
76
104
  rangeDatePickerByUid(uid: string, config: CfgByUid<typeof _gslRangeDatePickerByUid>): GslLeafSelector;
105
+ rangeTimePickers(config: CfgGsl<typeof _gslRangeTimePickers>): GslLeafSelector;
106
+ rangeTimePickerByUid(uid: string, config: CfgByUid<typeof _gslRangeTimePickerByUid>): GslLeafSelector;
77
107
  repeaters(config: CfgGsl<typeof _gslRepeaters>): GslLeafSelector;
78
108
  repeaterByUid(uid: string, config: CfgByUid<typeof _gslRepeaterByUid>): GslLeafSelector;
79
109
  actions(config: CfgGsl<typeof _gslActions>): GslLeafSelector;
@@ -0,0 +1,6 @@
1
+ import { DxRuntimeParams } from '../../core/dxUtilityTypes';
2
+ import { TimeInputDecorator, GuiTimeInputShortcut } from './timeInput.domain';
3
+ export declare function _guiTimeInput(path: string): GuiTimeInputShortcut;
4
+ export declare function _guiTimeInput(path: string, props: Partial<Omit<TimeInputDecorator, 'type'>>): GuiTimeInputShortcut;
5
+ export declare function _guiTimeInput(path: string, props: Partial<Omit<TimeInputDecorator, 'type'>>, tags: string[]): GuiTimeInputShortcut;
6
+ export declare function _guiTimeInput(path: string, callback: (params: DxRuntimeParams) => Partial<Omit<TimeInputDecorator, 'type'>>, tags?: string[]): GuiTimeInputShortcut;
@@ -0,0 +1,2 @@
1
+ import { TimeInputDecorator, GslTimeInputConfig } from './timeInput.domain';
2
+ export declare const _gslTimeInputs: (config: GslTimeInputConfig, matcher?: ((decorator: TimeInputDecorator) => boolean) | undefined) => import('../../core/dx.domain').GslLeafSelector, _gslTimeInputByUid: (uid: string, config: GslTimeInputConfig) => import('../../core/dx.domain').GslLeafSelector;
@@ -0,0 +1,17 @@
1
+ import { StringValidator } from '@golemui/gui-validators';
2
+ import { TimeInputProps } from '../../../widget.props';
3
+ import { DxCommonFields, DxInputBase } from '../../core/dxBase.types';
4
+ import { DefOrCallback, GslConfigBase, GuiShortcutOf } from '../../core/dxUtilityTypes';
5
+ import { DxValidator } from '../../core/dxValidatorHelper';
6
+ export interface TimeInputDecorator extends DxInputBase, DxCommonFields, Partial<TimeInputProps> {
7
+ type: 'timeInput';
8
+ validator?: DxValidator<StringValidator>;
9
+ }
10
+ export interface GslTimeInputConfig extends GslConfigBase<TimeInputDecorator> {
11
+ suppressAutomaticLabels?: boolean;
12
+ }
13
+ export type TimeInputEntry = {
14
+ key: string;
15
+ def: DefOrCallback<TimeInputDecorator>;
16
+ };
17
+ export type GuiTimeInputShortcut = GuiShortcutOf<'TIME_INPUT', TimeInputEntry>;
@@ -0,0 +1,7 @@
1
+ import { DxRuntimeParams } from '../../core/dxUtilityTypes';
2
+ import { TimePickerDecorator, GuiTimePickerShortcut } from './timePicker.domain';
3
+ type TimePickerFactoryProps = Omit<TimePickerDecorator, 'type'>;
4
+ export declare function _guiTimePicker(path: string, props: TimePickerFactoryProps): GuiTimePickerShortcut;
5
+ export declare function _guiTimePicker(path: string, props: TimePickerFactoryProps, tags: string[]): GuiTimePickerShortcut;
6
+ export declare function _guiTimePicker(path: string, callback: (params: DxRuntimeParams) => TimePickerFactoryProps, tags?: string[]): GuiTimePickerShortcut;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { TimePickerDecorator, GslTimePickerConfig } from './timePicker.domain';
2
+ export declare const _gslTimePickers: (config: GslTimePickerConfig, matcher?: ((decorator: TimePickerDecorator) => boolean) | undefined) => import('../../core/dx.domain').GslLeafSelector, _gslTimePickerByUid: (uid: string, config: GslTimePickerConfig) => import('../../core/dx.domain').GslLeafSelector;
@@ -0,0 +1,18 @@
1
+ import { StringValidator } from '@golemui/gui-validators';
2
+ import { TimePickerProps } from '../../../widget.props';
3
+ import { DxCommonFields, DxInputBase } from '../../core/dxBase.types';
4
+ import { DefOrCallback, GslConfigBase, GuiShortcutOf } from '../../core/dxUtilityTypes';
5
+ import { DxValidator } from '../../core/dxValidatorHelper';
6
+ export interface TimePickerDecorator extends DxInputBase, DxCommonFields, Partial<TimePickerProps> {
7
+ type: 'timePicker';
8
+ validator?: DxValidator<StringValidator>;
9
+ }
10
+ export interface GslTimePickerConfig extends GslConfigBase<TimePickerDecorator> {
11
+ suppressAutomaticLabels?: boolean;
12
+ suppressAutomaticPlaceholders?: boolean;
13
+ }
14
+ export type TimePickerEntry = {
15
+ key: string;
16
+ def: DefOrCallback<TimePickerDecorator>;
17
+ };
18
+ export type GuiTimePickerShortcut = GuiShortcutOf<'TIME_PICKER', TimePickerEntry>;
@@ -1,6 +1,6 @@
1
1
  import { ActionWidget, DisplayWidget, Form, FormWidget, FunctionWidgetParams, InputWidget, LayoutWidget, ReactiveExpression } from '@golemui/core';
2
2
  import { Validator } from '@golemui/gui-validators';
3
- import { AccordionProps, AlertProps, ButtonProps, CalendarProps, CheckboxProps, CurrencyProps, DatePickerProps, DateRange, DateinputProps, DropdownProps, FlexProps, GridProps, ListProps, MarkdownProps, MarkdownTextProps, NumberinputProps, OptionValue, PasswordProps, RadiogroupProps, RangeCalendarProps, RangeDateInputProps, RangeDatePickerProps, RepeaterProps, SelectProps, TabsProps, TextareaProps, TextinputProps, ToggleProps } from './widget.props';
3
+ import { AccordionProps, AlertProps, ButtonProps, CalendarProps, CheckboxProps, CurrencyProps, DatePickerProps, DateTimeCalendarProps, DateTimePickerProps, DateRange, DateinputProps, DropdownProps, FlexProps, GridProps, ListProps, MarkdownProps, MarkdownTextProps, NumberinputProps, OptionValue, PasswordProps, RadiogroupProps, RangeCalendarProps, RangeDateInputProps, RangeDatePickerProps, RangeDateTimeInputProps, RangeDateTimeCalendarProps, RangeDateTimePickerProps, RangeTimeInputProps, RangeTimePickerProps, DateTimeRange, TimeRange, RepeaterProps, SelectProps, TabsProps, DateTimeInputProps, TextareaProps, TextinputProps, TimeInputProps, TimePickerProps, ToggleProps } from './widget.props';
4
4
  type ExtractStates<S> = S extends Record<string, ReactiveExpression> ? keyof S : never;
5
5
  /**
6
6
  * Make the uid propery optional on all widgets
@@ -92,7 +92,7 @@ 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 FormWidget<any, FormType> = never>(): GolemFormBuilder<FormType, CustomWidget>;
95
- type GolemWidget<FormType extends Record<string, any>, States extends string, V, CustomWidget extends 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;
95
+ type GolemWidget<FormType extends Record<string, any>, States extends string, V, CustomWidget extends FormWidget<any, FormType> = never> = GuiAccordion<FormType, States, V, CustomWidget> | GuiAlert<FormType, States> | GuiButton<FormType, States> | GuiCalendar<FormType, States, V> | GuiCheckbox<FormType, States, V> | GuiDateTimeCalendar<FormType, States, V> | GuiCurrency<FormType, States, V> | GuiDateinput<FormType, States, V> | GuiDatePicker<FormType, States, V> | GuiDateTimeInput<FormType, States, V> | GuiDateTimePicker<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> | GuiRangeDateTimeInput<FormType, States, V> | GuiRangeDateTimeCalendar<FormType, States, V> | GuiRangeDateTimePicker<FormType, States, V> | GuiRangeTimeInput<FormType, States, V> | GuiRangeTimePicker<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> | GuiTimeInput<FormType, States, V> | GuiTimePicker<FormType, States, V> | GuiToggle<FormType, States, V> | CustomWidget;
96
96
  type GuiAccordion<FormType extends Record<string, any>, States extends string, V, CustomWidget extends FormWidget<any, FormType>> = LayoutWidget<States, FormType, AccordionProps, GolemWidget<FormType, States, V, CustomWidget>[]> & {
97
97
  type: 'accordion';
98
98
  };
@@ -105,6 +105,9 @@ type GuiButton<FormType extends Record<string, any>, States extends string> = Ac
105
105
  type GuiCalendar<FormType extends Record<string, any>, States extends string, V> = InputWidget<string, States, FormType, CalendarProps, V> & {
106
106
  type: 'calendar';
107
107
  };
108
+ type GuiDateTimeCalendar<FormType extends Record<string, any>, States extends string, V> = InputWidget<string, States, FormType, DateTimeCalendarProps, V> & {
109
+ type: 'dateTimeCalendar';
110
+ };
108
111
  type GuiCheckbox<FormType extends Record<string, any>, States extends string, V> = InputWidget<boolean, States, FormType, CheckboxProps, V> & {
109
112
  type: 'checkbox';
110
113
  };
@@ -117,6 +120,9 @@ type GuiDateinput<FormType extends Record<string, any>, States extends string, V
117
120
  type GuiDatePicker<FormType extends Record<string, any>, States extends string, V> = InputWidget<string, States, FormType, DatePickerProps, V> & {
118
121
  type: 'datePicker';
119
122
  };
123
+ type GuiDateTimePicker<FormType extends Record<string, any>, States extends string, V> = InputWidget<string, States, FormType, DateTimePickerProps, V> & {
124
+ type: 'dateTimePicker';
125
+ };
120
126
  type GuiDropdown<FormType extends Record<string, any>, States extends string, V> = InputWidget<OptionValue, States, FormType, DropdownProps<unknown>, V> & {
121
127
  type: 'dropdown';
122
128
  };
@@ -142,9 +148,24 @@ type GuiRangeCalendar<FormType extends Record<string, any>, States extends strin
142
148
  type GuiRangeDateInput<FormType extends Record<string, any>, States extends string, V> = InputWidget<DateRange[], States, FormType, RangeDateInputProps, V> & {
143
149
  type: 'rangeDateInput';
144
150
  };
151
+ type GuiRangeTimeInput<FormType extends Record<string, any>, States extends string, V> = InputWidget<TimeRange[], States, FormType, RangeTimeInputProps, V> & {
152
+ type: 'rangeTimeInput';
153
+ };
154
+ type GuiRangeDateTimeInput<FormType extends Record<string, any>, States extends string, V> = InputWidget<DateTimeRange[], States, FormType, RangeDateTimeInputProps, V> & {
155
+ type: 'rangeDateTimeInput';
156
+ };
157
+ type GuiRangeDateTimeCalendar<FormType extends Record<string, any>, States extends string, V> = InputWidget<DateTimeRange[], States, FormType, RangeDateTimeCalendarProps, V> & {
158
+ type: 'rangeDateTimeCalendar';
159
+ };
160
+ type GuiRangeDateTimePicker<FormType extends Record<string, any>, States extends string, V> = InputWidget<DateTimeRange[], States, FormType, RangeDateTimePickerProps, V> & {
161
+ type: 'rangeDateTimePicker';
162
+ };
145
163
  type GuiRangeDatePicker<FormType extends Record<string, any>, States extends string, V> = InputWidget<DateRange[], States, FormType, RangeDatePickerProps, V> & {
146
164
  type: 'rangeDatePicker';
147
165
  };
166
+ type GuiRangeTimePicker<FormType extends Record<string, any>, States extends string, V> = InputWidget<TimeRange[], States, FormType, RangeTimePickerProps, V> & {
167
+ type: 'rangeTimePicker';
168
+ };
148
169
  type GuiRepeater<FormType extends Record<string, any>, States extends string, V, CustomWidget extends FormWidget<any, FormType>> = InputWidget<Record<string, unknown>[], States, FormType, RepeaterProps<LayoutWidget<States, FormType, AccordionProps, GolemWidget<FormType, States, V, CustomWidget>[]>>, V> & {
149
170
  type: 'repeater';
150
171
  };
@@ -169,6 +190,15 @@ type GuiTextInput<FormType extends Record<string, any>, States extends string, V
169
190
  type GuiPassword<FormType extends Record<string, any>, States extends string, V> = InputWidget<string, States, FormType, PasswordProps, V> & {
170
191
  type: 'password';
171
192
  };
193
+ type GuiTimeInput<FormType extends Record<string, any>, States extends string, V> = InputWidget<string, States, FormType, TimeInputProps, V> & {
194
+ type: 'timeInput';
195
+ };
196
+ type GuiTimePicker<FormType extends Record<string, any>, States extends string, V> = InputWidget<string, States, FormType, TimePickerProps, V> & {
197
+ type: 'timePicker';
198
+ };
199
+ type GuiDateTimeInput<FormType extends Record<string, any>, States extends string, V> = InputWidget<string, States, FormType, DateTimeInputProps, V> & {
200
+ type: 'dateTimeInput';
201
+ };
172
202
  type GuiToggle<FormType extends Record<string, any>, States extends string, V> = InputWidget<boolean, States, FormType, ToggleProps, V> & {
173
203
  type: 'toggle';
174
204
  };
@@ -3,6 +3,14 @@ export interface DateRange {
3
3
  start: string;
4
4
  end?: string;
5
5
  }
6
+ /**
7
+ * A selected date-time range value. Both ends are local ISO date-time strings
8
+ * (`YYYY-MM-DDTHH:mm:ss`).
9
+ */
10
+ export interface DateTimeRange {
11
+ start: string;
12
+ end: string;
13
+ }
6
14
  export type AccordionProps = {
7
15
  singleOpen?: boolean;
8
16
  defaultOpen?: {
@@ -181,6 +189,31 @@ export type CalendarProps = {
181
189
  */
182
190
  numberOfMonths?: number;
183
191
  };
192
+ /**
193
+ * Calendar with an embedded time picker. The value is a local ISO date-time
194
+ * (YYYY-MM-DDTHH:mm:ss), emitted only when both the day and the time are
195
+ * selected; picking a different day clears the time and emits null. With
196
+ * numberOfMonths > 1 the time row and grid render on the first panel only.
197
+ */
198
+ export type DateTimeCalendarProps = CalendarProps & {
199
+ /** '12' or '24'. Defaults to the locale's hour cycle. */
200
+ hourFormat?: '12' | '24';
201
+ /** Minutes between selectable slots. Defaults to 30. */
202
+ minuteStep?: number;
203
+ /** First selectable time (ISO time, inclusive). Defaults to '00:00:00'. */
204
+ minTime?: string;
205
+ /** Last selectable time (ISO time, inclusive). Defaults to '23:59:59'. */
206
+ maxTime?: string;
207
+ /** Times inside these ranges render disabled; entries can scope per day. */
208
+ disabledTimeRanges?: DisabledTimeRange[];
209
+ /** Allows typing a time in the input; when false (default) times come only from the grid. */
210
+ allowCustomTime?: boolean;
211
+ minTimeMessage?: Localizable;
212
+ maxTimeMessage?: Localizable;
213
+ disabledTimeRangeMessage?: Localizable;
214
+ /** Shown in the time grid when the bounds yield no slots. Defaults to 'No available times'. */
215
+ noAvailableTimesMessage?: Localizable;
216
+ };
184
217
  export type RangeCalendarProps = {
185
218
  /**
186
219
  * An optional descriptive text providing guidance or information about the associated widget or functionality.
@@ -257,6 +290,13 @@ export type RangeCalendarProps = {
257
290
  * @type {DateRange[] | undefined}
258
291
  */
259
292
  disabledRanges?: DateRange[];
293
+ /**
294
+ * Error surfaced when a selected range spans one or more disabled days. The
295
+ * whole range is rejected (no pill added), rather than split around the
296
+ * disabled days — consistent with the time pickers. Defaults to
297
+ * "Invalid date: date is within a disabled range."
298
+ */
299
+ disabledDateRangeMessage?: Localizable;
260
300
  /**
261
301
  * Specifies the number of months to be displayed in the calendar.
262
302
  * Default is 1.
@@ -270,6 +310,67 @@ export type RangeCalendarProps = {
270
310
  export type DateinputProps = {
271
311
  hint?: string;
272
312
  icon?: string;
313
+ invalidDateMessage?: Localizable;
314
+ /** Earliest allowed date (ISO date, inclusive). */
315
+ minDate?: string;
316
+ /** Latest allowed date (ISO date, inclusive). */
317
+ maxDate?: string;
318
+ minDateMessage?: Localizable;
319
+ maxDateMessage?: Localizable;
320
+ };
321
+ export type DateTimeInputProps = {
322
+ hint?: string;
323
+ icon?: string;
324
+ hourFormat?: '12' | '24';
325
+ minuteStep?: number;
326
+ invalidDateMessage?: Localizable;
327
+ /** Earliest allowed date (ISO date, inclusive). */
328
+ minDate?: string;
329
+ /** Latest allowed date (ISO date, inclusive). */
330
+ maxDate?: string;
331
+ /** First allowed time (ISO time, inclusive). */
332
+ minTime?: string;
333
+ /** Last allowed time (ISO time, inclusive). */
334
+ maxTime?: string;
335
+ minDateMessage?: Localizable;
336
+ maxDateMessage?: Localizable;
337
+ minTimeMessage?: Localizable;
338
+ maxTimeMessage?: Localizable;
339
+ };
340
+ export type TimeInputProps = {
341
+ hint?: string;
342
+ icon?: string;
343
+ hourFormat?: '12' | '24';
344
+ minuteStep?: number;
345
+ /** First allowed time (ISO time, inclusive). */
346
+ minTime?: string;
347
+ /** Last allowed time (ISO time, inclusive). */
348
+ maxTime?: string;
349
+ minTimeMessage?: Localizable;
350
+ maxTimeMessage?: Localizable;
351
+ };
352
+ /**
353
+ * A time range value (also the base of {@link DisabledTimeRange}).
354
+ */
355
+ export type TimeRange = {
356
+ start: string;
357
+ end: string;
358
+ };
359
+ export type DisabledTimeRange = TimeRange & {
360
+ /** ISO date (YYYY-MM-DD): the range only applies on that date. */
361
+ date?: string;
362
+ /** Weekday numbers as returned by Date.prototype.getDay(): 0=Sunday … 6=Saturday. */
363
+ weekdays?: number[];
364
+ };
365
+ export type TimePickerProps = TimeInputProps & {
366
+ /** Times inside these ranges (both ends inclusive) render disabled. */
367
+ disabledRanges?: TimeRange[];
368
+ /** Allows typing a time in the input; when false (default) values come only from the list. */
369
+ allowCustomTime?: boolean;
370
+ height?: number;
371
+ itemHeight?: number;
372
+ disabledRangeMessage?: Localizable;
373
+ noAvailableTimesMessage?: Localizable;
273
374
  };
274
375
  export type RangeDateInputProps = {
275
376
  hint?: string;
@@ -278,40 +379,107 @@ export type RangeDateInputProps = {
278
379
  removePillAriaLabel?: string;
279
380
  startDateAriaLabel?: string;
280
381
  endDateAriaLabel?: string;
382
+ invalidDateMessage?: Localizable;
383
+ };
384
+ export type DateBoundsMessageProps = {
385
+ minDateMessage?: Localizable;
386
+ maxDateMessage?: Localizable;
387
+ disabledDateRangeMessage?: Localizable;
388
+ };
389
+ export type DatePickerProps = CalendarProps & DateinputProps & DateBoundsMessageProps;
390
+ export type DateTimePickerProps = DateTimeCalendarProps & DateTimeInputProps & DateBoundsMessageProps;
391
+ export type RangeDatePickerProps = RangeCalendarProps & RangeDateInputProps & DateBoundsMessageProps;
392
+ export type RangeDateTimeCalendarProps = Omit<RangeCalendarProps, 'minDate' | 'maxDate' | 'disabledRanges' | 'disabledDateRangeMessage'> & {
393
+ hourFormat?: '12' | '24';
394
+ minuteStep?: number;
395
+ /** Allows typing a time in each picker; when false (default) times come only from the grid. */
396
+ allowCustomTime?: boolean;
397
+ /** Visible heading on the start time picker. Defaults to "Start time". */
398
+ startTimeLabel?: Localizable;
399
+ /** Visible heading on the end time picker. Defaults to "End time". */
400
+ endTimeLabel?: Localizable;
401
+ /** Earliest allowed instant (ISO date-time, inclusive). */
402
+ minDateTime?: string;
403
+ /** Latest allowed instant (ISO date-time, inclusive). */
404
+ maxDateTime?: string;
405
+ minDateTimeMessage?: Localizable;
406
+ maxDateTimeMessage?: Localizable;
407
+ /** Disabled instant spans. Blocking a whole day is a span of 00:00:00–23:59:59. */
408
+ disabledRanges?: DateTimeRange[];
409
+ /** Error surfaced when a selected range steps over, or overlaps, a disabled span. */
410
+ disabledRangeMessage?: Localizable;
411
+ /** Shown in a time grid when the bounds yield no slots. Defaults to 'No available times'. */
412
+ noAvailableTimesMessage?: Localizable;
413
+ /**
414
+ * ARIA label template for the per-day count badge; a `{count}` token is
415
+ * substituted with the number of ranges on that day. Defaults to '{count} ranges'.
416
+ */
417
+ dayCountAriaLabel?: Localizable;
418
+ /**
419
+ * ARIA label template for the grey per-day disabled-spans badge shown on
420
+ * partially-blocked days; a `{count}` token is substituted with the number of
421
+ * disabled spans on that day. Defaults to '{count} disabled ranges'.
422
+ */
423
+ disabledDayCountAriaLabel?: Localizable;
281
424
  };
282
- export type DatePickerProps = {
425
+ export type RangeTimeInputProps = {
283
426
  hint?: string;
284
427
  icon?: string;
285
- prevMonthIcon?: string;
286
- nextMonthIcon?: string;
287
- prevMonthAriaLabel?: string;
288
- nextMonthAriaLabel?: string;
289
- dayFormat?: 'numeric' | '2-digit';
290
- weekdayFormat?: 'short' | 'long' | 'narrow';
291
- monthFormat?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow';
292
- minDate?: string;
293
- maxDate?: string;
294
- disabledRanges?: DateRange[];
295
- numberOfMonths?: number;
428
+ separator?: string;
429
+ removePillAriaLabel?: string;
430
+ startTimeAriaLabel?: string;
431
+ endTimeAriaLabel?: string;
432
+ hourFormat?: '12' | '24';
433
+ minuteStep?: number;
434
+ /** First allowed time (ISO time, inclusive). */
435
+ minTime?: string;
436
+ /** Last allowed time (ISO time, inclusive). */
437
+ maxTime?: string;
438
+ minTimeMessage?: Localizable;
439
+ maxTimeMessage?: Localizable;
440
+ /** Shown when the entered "time out" is not strictly after "time in". */
441
+ rangeOrderMessage?: Localizable;
296
442
  };
297
- export type RangeDatePickerProps = {
443
+ export type RangeDateTimeInputProps = {
298
444
  hint?: string;
299
445
  icon?: string;
300
446
  separator?: string;
301
447
  removePillAriaLabel?: string;
302
- startDateAriaLabel?: string;
303
- endDateAriaLabel?: string;
304
- prevMonthIcon?: string;
305
- nextMonthIcon?: string;
306
- prevMonthAriaLabel?: string;
307
- nextMonthAriaLabel?: string;
308
- dayFormat?: 'numeric' | '2-digit';
309
- weekdayFormat?: 'short' | 'long' | 'narrow';
310
- monthFormat?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow';
311
- minDate?: string;
312
- maxDate?: string;
313
- disabledRanges?: DateRange[];
314
- numberOfMonths?: number;
448
+ startDateTimeAriaLabel?: string;
449
+ endDateTimeAriaLabel?: string;
450
+ hourFormat?: '12' | '24';
451
+ minuteStep?: number;
452
+ invalidDateMessage?: Localizable;
453
+ /**
454
+ * Earliest allowed date-time (ISO date-time, inclusive). Each endpoint of the
455
+ * value is an instant, so the bound is an instant too: a date-only bound
456
+ * cannot say whether its last day is allowed until 00:00 or 23:59.
457
+ */
458
+ minDateTime?: string;
459
+ /** Latest allowed date-time (ISO date-time, inclusive). */
460
+ maxDateTime?: string;
461
+ minDateTimeMessage?: Localizable;
462
+ maxDateTimeMessage?: Localizable;
463
+ };
464
+ /**
465
+ * The date-time range picker is the calendar (instant-space bounds, disabled
466
+ * spans, two time pickers, per-day count badge) with the typed range input as
467
+ * its trigger.
468
+ */
469
+ export type RangeDateTimePickerProps = RangeDateTimeCalendarProps & RangeDateTimeInputProps;
470
+ export type RangeTimePickerProps = RangeTimeInputProps & {
471
+ /** Times inside these ranges (both ends inclusive) render disabled. */
472
+ disabledRanges?: TimeRange[];
473
+ /** Allows typing a time in the input; when false (default) values come only from the lists. */
474
+ allowCustomTime?: boolean;
475
+ height?: number;
476
+ itemHeight?: number;
477
+ /** Visible heading above the "time in" list in the popover. Defaults to "Start time". */
478
+ startTimeLabel?: Localizable;
479
+ /** Visible heading above the "time out" list in the popover. Defaults to "End time". */
480
+ endTimeLabel?: Localizable;
481
+ disabledRangeMessage?: Localizable;
482
+ noAvailableTimesMessage?: Localizable;
315
483
  };
316
484
  export type NumberinputProps = {
317
485
  placeholder?: string;
@@ -376,10 +544,13 @@ export type SelectProps = {
376
544
  placeholder?: string;
377
545
  labelField?: string;
378
546
  valueField?: string;
547
+ invalidOptionMessage?: Localizable;
379
548
  };
380
549
  export type ListItem<T> = {
381
550
  template: T;
382
551
  value: OptionValue;
552
+ /** Disabled items render greyed out, are skipped by keyboard navigation and cannot be selected */
553
+ disabled?: boolean;
383
554
  };
384
555
  type ItemKeys<T> = T extends Record<string, any> ? keyof T : string;
385
556
  export type DropdownProps<T> = {
package/lib/widgets.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export declare const inputWidgets: readonly ["calendar", "checkbox", "currency", "dateInput", "datePicker", "dropdown", "list", "markdown", "number", "password", "radiogroup", "rangeCalendar", "rangeDateInput", "rangeDatePicker", "repeater", "select", "tags", "textarea", "textinput", "toggle"];
1
+ export declare const inputWidgets: readonly ["calendar", "dateTimeCalendar", "checkbox", "currency", "dateInput", "datePicker", "dateTimeInput", "dateTimePicker", "dropdown", "list", "markdown", "number", "password", "radiogroup", "rangeCalendar", "rangeDateInput", "rangeDatePicker", "rangeDateTimeInput", "rangeDateTimeCalendar", "rangeDateTimePicker", "rangeTimeInput", "rangeTimePicker", "repeater", "select", "tags", "textarea", "textinput", "timeInput", "timePicker", "toggle"];
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" | "markdownText" | "accordion")[];
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" | "dateTimeCalendar" | "dateTimePicker" | "rangeDateTimeInput" | "rangeDateTimeCalendar" | "rangeDateTimePicker" | "rangeTimeInput" | "rangeTimePicker" | "timeInput" | "timePicker" | "dateTimeInput" | "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": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./index.umd.cjs",
@@ -31,8 +31,8 @@
31
31
  "*.md"
32
32
  ],
33
33
  "dependencies": {
34
- "@golemui/core": "1.0.2",
35
- "@golemui/gui-validators": "1.0.2"
34
+ "@golemui/core": "1.1.0",
35
+ "@golemui/gui-validators": "1.1.0"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",