@tempots/beatui 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ar-Wr6gMs-M.cjs +1 -0
- package/dist/{ar-C-kUt6f9.js → ar-fdUqbCvM.js} +154 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/auth-divider-DewHpITQ.cjs +1 -0
- package/dist/{auth-divider-D_3gKZ6g.js → auth-divider-qnJuYK-x.js} +7 -7
- package/dist/beatui.css +2107 -171
- package/dist/beatui.tailwind.css +2107 -171
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +5 -5
- package/dist/{modal-YKqlh4Dk.js → custom-validation-BetUqAEz.js} +186 -186
- package/dist/custom-validation-CLscGHY4.cjs +1 -0
- package/dist/{de-CP0kbElb.js → de-C5-k5Eov.js} +156 -3
- package/dist/de-DZqdSEta.cjs +1 -0
- package/dist/deep-merge-D90SW1Ci.cjs +1 -0
- package/dist/deep-merge-ZVigk5Qf.js +1765 -0
- package/dist/{duration-input-BrYLC1js.cjs → duration-input-4AQnQpyo.cjs} +1 -1
- package/dist/{duration-input-CFu6vq-y.js → duration-input-GMBmT1BE.js} +4 -4
- package/dist/{editor-toolbar-group-QVdBUbB8.cjs → editor-toolbar-group-C_ft_T8D.cjs} +1 -1
- package/dist/{editor-toolbar-group-DWUWUO-B.js → editor-toolbar-group-FpOHrmtx.js} +2 -2
- package/dist/es-CJgYfRap.cjs +1 -0
- package/dist/{es-BtIkcnsw.js → es-h6jmoF4X.js} +156 -3
- package/dist/fa-BQ5PzwNY.cjs +1 -0
- package/dist/{fa-11-rZmQ-.js → fa-BuxK837l.js} +154 -1
- package/dist/fr-Bv3TG44U.cjs +1 -0
- package/dist/{fr-C-L2F8w2.js → fr-BwILQ9G2.js} +165 -12
- package/dist/he-5LbvgMCC.cjs +1 -0
- package/dist/{he-Bu1xGoQ9.js → he-yC9Sc7JD.js} +154 -1
- package/dist/{hi-CewH-MAH.js → hi-Da7rcCpP.js} +154 -1
- package/dist/hi-YWhWcG_L.cjs +1 -0
- package/dist/{index-BGKz2Nol.js → index-DI8bf9oC.js} +175 -172
- package/dist/index-DeUj-5ph.cjs +1 -0
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +11806 -8105
- package/dist/{input-container-CO3DNqpp.js → input-container-8JFB11xN.js} +1 -1
- package/dist/{input-container-BkPcNDaZ.cjs → input-container-CyOgiiQD.cjs} +1 -1
- package/dist/it-BxOIJE45.cjs +1 -0
- package/dist/{it-5hiKQO_p.js → it-Yeklau78.js} +156 -3
- package/dist/ja-CNhjK06P.cjs +1 -0
- package/dist/{ja-CGfEmZrm.js → ja-Dxj9Q5Yd.js} +155 -2
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +110 -110
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +1 -1
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +5 -5
- package/dist/ko-DgkqcXTs.cjs +1 -0
- package/dist/{ko-DZthvREd.js → ko-gn_MsegK.js} +154 -1
- package/dist/lexical/index.cjs.js +1 -1
- package/dist/lexical/index.es.js +4 -4
- package/dist/nl-Dy9lmbBO.cjs +1 -0
- package/dist/{nl-CcKyHlQ7.js → nl-vHNFtXXb.js} +162 -9
- package/dist/{notice-Du3tWJTW.js → notice-B6ojfenv.js} +4 -4
- package/dist/{notice-Q0A1gIho.cjs → notice-p2IqXS5-.cjs} +1 -1
- package/dist/{oneof-branch-detection-DSzC0PkO.js → oneof-branch-detection-Q_jxvJIA.js} +1 -1
- package/dist/{oneof-branch-detection-BEkAezNi.cjs → oneof-branch-detection-xDDDdYRk.cjs} +1 -1
- package/dist/pl-BtYbtsmG.cjs +1 -0
- package/dist/{pl-Mwtjp4MV.js → pl-C0UdHla0.js} +184 -31
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +4 -4
- package/dist/pt-CtNmqQ1X.cjs +1 -0
- package/dist/{pt-BaTsY-8f.js → pt-DGKtfN0d.js} +156 -3
- package/dist/ru-BaL_NPRU.cjs +1 -0
- package/dist/{ru-CvbGmz5s.js → ru-CpXYLt-v.js} +154 -1
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +1 -1
- package/dist/tailwind/vite-plugin.cjs.js +1 -1
- package/dist/tailwind/vite-plugin.es.js +1 -1
- package/dist/{text-input-D_IxFd0M.cjs → text-input-DS5zlXb2.cjs} +1 -1
- package/dist/{text-input-BAn02BzO.js → text-input-NJypZSnE.js} +1 -1
- package/dist/{toolbar-CnecqhaU.cjs → toolbar-BBwfe8U9.cjs} +1 -1
- package/dist/{toolbar-BKan3NHw.js → toolbar-BF2L6WKC.js} +1 -1
- package/dist/{tr-YFqQdZjM.js → tr-DIFZDFW_.js} +156 -3
- package/dist/tr-DwOd87oB.cjs +1 -0
- package/dist/{translations-CxDUnbXn.js → translations-5cXBrENb.js} +1 -1
- package/dist/{translations-DT5QQ4WO.js → translations-BCMP-h52.js} +269 -115
- package/dist/{translations-C_-cObaF.cjs → translations-BqWc0ZHz.cjs} +1 -1
- package/dist/translations-EwEmHe3v.cjs +1 -0
- package/dist/types/beatui-i18n/default.d.ts +109 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +109 -0
- package/dist/types/beatui-i18n/translations.d.ts +109 -0
- package/dist/types/components/button/copy-button.d.ts +42 -0
- package/dist/types/components/button/index.d.ts +1 -0
- package/dist/types/components/button/toggle-button-group.d.ts +2 -2
- package/dist/types/components/button/toggle-button.d.ts +2 -2
- package/dist/types/components/data/data-table-context.d.ts +9 -1
- package/dist/types/components/data/data-table-row-details.d.ts +21 -0
- package/dist/types/components/data/data-table-types.d.ts +23 -0
- package/dist/types/components/data/date-picker-shared.d.ts +2 -5
- package/dist/types/components/data/date-picker.d.ts +1 -1
- package/dist/types/components/data/date-range-picker.d.ts +1 -1
- package/dist/types/components/data/index.d.ts +4 -0
- package/dist/types/components/data/stat-card.d.ts +108 -0
- package/dist/types/components/data/time-picker.d.ts +54 -0
- package/dist/types/components/data/virtual-scrolling/index.d.ts +1 -0
- package/dist/types/components/data/virtual-scrolling/virtual-list.d.ts +91 -0
- package/dist/types/components/form/control/control.d.ts +5 -5
- package/dist/types/components/form/control/list-control.d.ts +11 -11
- package/dist/types/components/form/fieldset/fieldset.d.ts +60 -0
- package/dist/types/components/form/fieldset/index.d.ts +1 -0
- package/dist/types/components/form/index.d.ts +1 -0
- package/dist/types/components/form/input/checkbox-input.d.ts +1 -1
- package/dist/types/components/form/input/color-input.d.ts +1 -1
- package/dist/types/components/form/input/color-picker/canvas-draw.d.ts +12 -0
- package/dist/types/components/form/input/color-picker/channel-picker.d.ts +71 -0
- package/dist/types/components/form/input/color-picker/hex-color-picker.d.ts +20 -0
- package/dist/types/components/form/input/color-picker/hsl-color-picker.d.ts +14 -0
- package/dist/types/components/form/input/color-picker/hwb-color-picker.d.ts +15 -0
- package/dist/types/components/form/input/color-picker/index.d.ts +7 -0
- package/dist/types/components/form/input/color-picker/oklch-color-picker.d.ts +15 -0
- package/dist/types/components/form/input/color-picker/rgb-color-picker.d.ts +17 -0
- package/dist/types/components/form/input/color-swatch-input.d.ts +1 -1
- package/dist/types/components/form/input/combobox-input.d.ts +3 -3
- package/dist/types/components/form/input/combobox-tags-input.d.ts +1 -1
- package/dist/types/components/form/input/date-input.d.ts +1 -1
- package/dist/types/components/form/input/date-range-select-base.d.ts +23 -0
- package/dist/types/components/form/input/date-range-select.d.ts +64 -0
- package/dist/types/components/form/input/date-select.d.ts +52 -0
- package/dist/types/components/form/input/date-time-input.d.ts +2 -2
- package/dist/types/components/form/input/date-time-select-base.d.ts +23 -0
- package/dist/types/components/form/input/date-time-select.d.ts +66 -0
- package/dist/types/components/form/input/dropdown-input.d.ts +3 -3
- package/dist/types/components/form/input/email-input.d.ts +1 -1
- package/dist/types/components/form/input/field-layout.d.ts +64 -0
- package/dist/types/components/form/input/{input-wrapper.d.ts → field.d.ts} +23 -14
- package/dist/types/components/form/input/index.d.ts +19 -1
- package/dist/types/components/form/input/multi-select.d.ts +2 -2
- package/dist/types/components/form/input/native-select.d.ts +1 -1
- package/dist/types/components/form/input/nullable-date-select.d.ts +55 -0
- package/dist/types/components/form/input/nullable-date-time-select.d.ts +68 -0
- package/dist/types/components/form/input/nullable-time-select.d.ts +64 -0
- package/dist/types/components/form/input/number-input.d.ts +5 -40
- package/dist/types/components/form/input/number-stepper.d.ts +53 -0
- package/dist/types/components/form/input/open-date-range-select.d.ts +75 -0
- package/dist/types/components/form/input/otp-input.d.ts +2 -2
- package/dist/types/components/form/input/password-input.d.ts +1 -1
- package/dist/types/components/form/input/radio-group.d.ts +1 -1
- package/dist/types/components/form/input/range-slider.d.ts +23 -6
- package/dist/types/components/form/input/rating-input.d.ts +1 -1
- package/dist/types/components/form/input/segmented-input.d.ts +6 -2
- package/dist/types/components/form/input/segmented-select.d.ts +84 -0
- package/dist/types/components/form/input/select-tags-input.d.ts +1 -1
- package/dist/types/components/form/input/slider-input.d.ts +2 -2
- package/dist/types/components/form/input/sortable-list.d.ts +68 -0
- package/dist/types/components/form/input/switch.d.ts +1 -1
- package/dist/types/components/form/input/text-area.d.ts +1 -1
- package/dist/types/components/form/input/text-input.d.ts +1 -1
- package/dist/types/components/form/input/time-format.d.ts +31 -0
- package/dist/types/components/form/input/time-select-base.d.ts +23 -0
- package/dist/types/components/form/input/time-select.d.ts +61 -0
- package/dist/types/components/form/input/transfer-list.d.ts +56 -0
- package/dist/types/components/form/input/tri-state-checkbox-input.d.ts +1 -1
- package/dist/types/components/form/input/url-input.d.ts +1 -1
- package/dist/types/components/format/format-bigint.d.ts +64 -0
- package/dist/types/components/format/format-date-time.d.ts +54 -0
- package/dist/types/components/format/format-date.d.ts +82 -0
- package/dist/types/components/format/format-display-name.d.ts +70 -0
- package/dist/types/components/format/format-file-size.d.ts +30 -0
- package/dist/types/components/format/format-list.d.ts +61 -0
- package/dist/types/components/format/format-number.d.ts +88 -0
- package/dist/types/components/format/format-plural.d.ts +96 -0
- package/dist/types/components/format/format-relative-time.d.ts +62 -0
- package/dist/types/components/format/format-time.d.ts +66 -0
- package/dist/types/components/format/index.d.ts +11 -0
- package/dist/types/components/i18n/locale-selector.d.ts +1 -1
- package/dist/types/components/json-schema/controls/composition-shared.d.ts +1 -1
- package/dist/types/components/json-schema/controls/shared-utils.d.ts +3 -3
- package/dist/types/components/json-schema/widgets/string-controls.d.ts +2 -2
- package/dist/types/components/json-schema-display/display-wrapper.d.ts +1 -1
- package/dist/types/components/layout/nine-slice-scroll-view.d.ts +1 -1
- package/dist/types/components/navigation/index.d.ts +1 -0
- package/dist/types/components/navigation/stepper.d.ts +102 -0
- package/dist/types/components/overlay/index.d.ts +1 -1
- package/dist/types/components/overlay/spotlight.d.ts +62 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/ur-D9nLchps.cjs +1 -0
- package/dist/{ur-CdnwwnG_.js → ur-DBst-TXc.js} +154 -1
- package/dist/use-form-Dcra7GeE.cjs +2 -0
- package/dist/{use-form-D_TJyZhP.js → use-form-NfobsGNl.js} +474 -434
- package/dist/{vi-Bwvz1d_n.js → vi-DQOJp32U.js} +183 -30
- package/dist/vi-Dg1aiMr5.cjs +1 -0
- package/dist/widget-customization-BtkexHgm.js +1458 -0
- package/dist/widget-customization-pqmtsraC.cjs +1 -0
- package/dist/{zh-hy7Uw6c5.js → zh-DPK4HXl2.js} +154 -1
- package/dist/zh-tbwSTbmn.cjs +1 -0
- package/package.json +9 -9
- package/dist/ar-Dc56zcjW.cjs +0 -1
- package/dist/auth-divider-itm5-j5G.cjs +0 -1
- package/dist/de-DboQlEC4.cjs +0 -1
- package/dist/deep-merge-Bydz6jLt.cjs +0 -1
- package/dist/deep-merge-CzZVsVF-.js +0 -1704
- package/dist/es-CAmE_0Ph.cjs +0 -1
- package/dist/fa-D9LrFZdW.cjs +0 -1
- package/dist/fr-DKogQyss.cjs +0 -1
- package/dist/he-CVx91Jdr.cjs +0 -1
- package/dist/hi-BgrHV72l.cjs +0 -1
- package/dist/index-DFF7Uahh.cjs +0 -1
- package/dist/it-B1rA1F9l.cjs +0 -1
- package/dist/ja-DZnjjqoi.cjs +0 -1
- package/dist/ko-CDnYKYWU.cjs +0 -1
- package/dist/modal-DCxNGrzk.cjs +0 -1
- package/dist/nl-Bj8QnDEY.cjs +0 -1
- package/dist/pl-BmuuxxVd.cjs +0 -1
- package/dist/pt-RiC0yeVA.cjs +0 -1
- package/dist/ru-pRqtOQHF.cjs +0 -1
- package/dist/tr-B9JhBJeL.cjs +0 -1
- package/dist/translations-qefRsdGi.cjs +0 -1
- package/dist/types/components/overlay/command-palette.d.ts +0 -17
- package/dist/types/utils/color.d.ts +0 -346
- package/dist/ur-BZakU0iv.cjs +0 -1
- package/dist/use-form-BvBkVEKi.cjs +0 -2
- package/dist/vi-D1nly0nb.cjs +0 -1
- package/dist/widget-customization-BAchyOUo.js +0 -1066
- package/dist/widget-customization-DELy3SMQ.cjs +0 -1
- package/dist/zh-DBk7sSD9.cjs +0 -1
|
@@ -54,7 +54,7 @@ export type ComboboxInputOptions<T> = Merge<InputOptions<T>, {
|
|
|
54
54
|
* const user = prop<User | null>(null)
|
|
55
55
|
* ComboboxInput({
|
|
56
56
|
* value: user,
|
|
57
|
-
* onChange: user.set,
|
|
57
|
+
* onChange: v => user.set(v),
|
|
58
58
|
* loadOptions: async (search) => {
|
|
59
59
|
* const users = await fetchUsers(search)
|
|
60
60
|
* return users.map(u => Option.value(u, u.name))
|
|
@@ -81,11 +81,11 @@ export declare const BaseComboboxControl: <T>(options: BaseControlOptions<T, Com
|
|
|
81
81
|
/**
|
|
82
82
|
* A complete combobox form control with label, description, error message, and validation.
|
|
83
83
|
*
|
|
84
|
-
* Combines {@link BaseComboboxControl} with
|
|
84
|
+
* Combines {@link BaseComboboxControl} with a {@link Field} to provide a
|
|
85
85
|
* full-featured form field with label, optional description, and validation error display.
|
|
86
86
|
*
|
|
87
87
|
* @template T - The type of the selectable option values
|
|
88
88
|
* @param options - Controller options including wrapper label/description and combobox configuration
|
|
89
89
|
* @returns A combobox input wrapped in a form field with label and error display
|
|
90
90
|
*/
|
|
91
|
-
export declare const ComboboxControl: <T>(options: ControlOptions<T, ComboboxInputOptions<T>>) => Renderable
|
|
91
|
+
export declare const ComboboxControl: <T>(options: ControlOptions<T, ComboboxInputOptions<T>>) => import("@tempots/core").Renderable<import("@tempots/dom").DOMContext, typeof import("@tempots/dom").DOM_RENDERABLE_TYPE>;
|
|
@@ -67,4 +67,4 @@ export declare function BaseComboboxTagsControl<T>(options: BaseControlOptions<T
|
|
|
67
67
|
* @param options - Controller options for the combobox tags control.
|
|
68
68
|
* @returns A renderable form control component with wrapper.
|
|
69
69
|
*/
|
|
70
|
-
export declare function ComboboxTagsControl<T>(options: ControlOptions<T[], ComboboxTagsInputOptions<T>>): Renderable
|
|
70
|
+
export declare function ComboboxTagsControl<T>(options: ControlOptions<T[], ComboboxTagsInputOptions<T>>): import("@tempots/core").Renderable<import("@tempots/dom").DOMContext, typeof import("@tempots/dom").DOM_RENDERABLE_TYPE>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
import { CommonInputOptions } from './input-options';
|
|
3
|
+
/**
|
|
4
|
+
* Internal base options for the date range select shell (trigger + flyout).
|
|
5
|
+
* The actual picker content is provided via `panelContent`.
|
|
6
|
+
*/
|
|
7
|
+
export interface DateRangeSelectShellOptions extends CommonInputOptions {
|
|
8
|
+
/** The display text shown in the trigger. */
|
|
9
|
+
displayText: Value<string>;
|
|
10
|
+
/** The content to render inside the flyout panel. */
|
|
11
|
+
panelContent: TNode;
|
|
12
|
+
/** Callback invoked on blur. */
|
|
13
|
+
onBlur?: () => void;
|
|
14
|
+
/** Content to render before the display text. */
|
|
15
|
+
before?: TNode;
|
|
16
|
+
/** Content to render after the display text. */
|
|
17
|
+
after?: TNode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Shared shell for date range selectors: trigger button + flyout panel.
|
|
21
|
+
* Used by both DateRangeSelect and OpenDateRangeSelect.
|
|
22
|
+
*/
|
|
23
|
+
export declare function DateRangeSelectShell(options: DateRangeSelectShellOptions): TNode;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type TNode, Value, type Merge } from '@tempots/dom';
|
|
2
|
+
import { CommonInputOptions } from './input-options';
|
|
3
|
+
import type { PlainDate } from '../../../temporal/types';
|
|
4
|
+
import { ThemeColorName } from '../../../tokens';
|
|
5
|
+
/**
|
|
6
|
+
* A date range as a `[start, end]` tuple where both dates are required.
|
|
7
|
+
*/
|
|
8
|
+
export type DateRange = [PlainDate, PlainDate];
|
|
9
|
+
/**
|
|
10
|
+
* Configuration options for the {@link DateRangeSelect} component.
|
|
11
|
+
*
|
|
12
|
+
* Both start and end dates are required. Use {@link OpenDateRangeSelect}
|
|
13
|
+
* if either end can be null/undefined.
|
|
14
|
+
*/
|
|
15
|
+
export type DateRangeSelectOptions = Merge<CommonInputOptions, {
|
|
16
|
+
/** The selected date range as `[start, end]`. */
|
|
17
|
+
value: Value<DateRange>;
|
|
18
|
+
/** Callback invoked when the range changes. */
|
|
19
|
+
onChange?: (range: DateRange) => void;
|
|
20
|
+
/** Callback invoked on blur. */
|
|
21
|
+
onBlur?: () => void;
|
|
22
|
+
/** Predicate returning true if a date should be disabled. */
|
|
23
|
+
isDateDisabled?: (date: PlainDate) => boolean;
|
|
24
|
+
/** Theme color. @default 'primary' */
|
|
25
|
+
color?: Value<ThemeColorName>;
|
|
26
|
+
/** The day the week starts on (0=Sun, 1=Mon). @default 0 */
|
|
27
|
+
weekStartsOn?: Value<number>;
|
|
28
|
+
/** Format a PlainDate for display. Defaults to ISO string. */
|
|
29
|
+
formatDate?: (date: PlainDate) => string;
|
|
30
|
+
/** Content to render before the display text. */
|
|
31
|
+
before?: TNode;
|
|
32
|
+
/** Content to render after the display text. */
|
|
33
|
+
after?: TNode;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* A date range selector using a single calendar with range highlighting.
|
|
37
|
+
*
|
|
38
|
+
* Displays the selected range in a styled trigger button. Clicking opens a
|
|
39
|
+
* flyout panel with a {@link DateRangePicker} — a single calendar where the
|
|
40
|
+
* user clicks to set the start date, then clicks again to set the end date,
|
|
41
|
+
* with a hover preview showing the prospective range.
|
|
42
|
+
*
|
|
43
|
+
* Use {@link OpenDateRangeSelect} if either date can be null/undefined.
|
|
44
|
+
*
|
|
45
|
+
* @param options - Configuration for the date range selector
|
|
46
|
+
* @returns A date range selector element
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* import { prop } from '@tempots/dom'
|
|
51
|
+
* import { DateRangeSelect } from '@tempots/beatui'
|
|
52
|
+
* import { Temporal } from '@js-temporal/polyfill'
|
|
53
|
+
*
|
|
54
|
+
* const range = prop<DateRange>([
|
|
55
|
+
* Temporal.PlainDate.from('2026-01-01'),
|
|
56
|
+
* Temporal.PlainDate.from('2026-01-31'),
|
|
57
|
+
* ])
|
|
58
|
+
* DateRangeSelect({
|
|
59
|
+
* value: range,
|
|
60
|
+
* onChange: v => range.set(v),
|
|
61
|
+
* })
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function DateRangeSelect(options: DateRangeSelectOptions): TNode;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type TNode, Value, type Merge } from '@tempots/dom';
|
|
2
|
+
import { CommonInputOptions } from './input-options';
|
|
3
|
+
import type { PlainDate } from '../../../temporal/types';
|
|
4
|
+
import { ThemeColorName } from '../../../tokens';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration options for the {@link DateSelect} component.
|
|
7
|
+
*/
|
|
8
|
+
export type DateSelectOptions = Merge<CommonInputOptions, {
|
|
9
|
+
/** The selected date. */
|
|
10
|
+
value: Value<PlainDate>;
|
|
11
|
+
/** Callback invoked when the date changes. */
|
|
12
|
+
onChange?: (date: PlainDate) => void;
|
|
13
|
+
/** Callback invoked on blur. */
|
|
14
|
+
onBlur?: () => void;
|
|
15
|
+
/** Predicate returning true if a date should be disabled. */
|
|
16
|
+
isDateDisabled?: (date: PlainDate) => boolean;
|
|
17
|
+
/** Theme color. @default 'primary' */
|
|
18
|
+
color?: Value<ThemeColorName>;
|
|
19
|
+
/** The day the week starts on (0=Sun, 1=Mon). @default 0 */
|
|
20
|
+
weekStartsOn?: Value<number>;
|
|
21
|
+
/** Format a PlainDate for display. Defaults to ISO string. */
|
|
22
|
+
formatDate?: (date: PlainDate) => string;
|
|
23
|
+
/** Content to render before the display text. */
|
|
24
|
+
before?: TNode;
|
|
25
|
+
/** Content to render after the display text. */
|
|
26
|
+
after?: TNode;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* A dropdown single-date selector.
|
|
30
|
+
*
|
|
31
|
+
* Displays the selected date in a styled trigger button. Clicking opens a
|
|
32
|
+
* flyout panel with a {@link DatePicker} for selecting a date.
|
|
33
|
+
*
|
|
34
|
+
* Use {@link NullableDateSelect} when the date can be null/unset.
|
|
35
|
+
*
|
|
36
|
+
* @param options - Configuration for the date selector
|
|
37
|
+
* @returns A date selector element
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* import { prop } from '@tempots/dom'
|
|
42
|
+
* import { DateSelect } from '@tempots/beatui'
|
|
43
|
+
* import { Temporal } from '@js-temporal/polyfill'
|
|
44
|
+
*
|
|
45
|
+
* const date = prop(Temporal.Now.plainDateISO())
|
|
46
|
+
* DateSelect({
|
|
47
|
+
* value: date,
|
|
48
|
+
* onChange: v => date.set(v),
|
|
49
|
+
* })
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function DateSelect(options: DateSelectOptions): TNode;
|
|
@@ -18,13 +18,13 @@ import { InputOptions } from './input-options';
|
|
|
18
18
|
* const appointment = prop(new Date())
|
|
19
19
|
* DateTimeInput({
|
|
20
20
|
* value: appointment,
|
|
21
|
-
* onChange: appointment.set,
|
|
21
|
+
* onChange: v => appointment.set(v),
|
|
22
22
|
* })
|
|
23
23
|
* ```
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* ```ts
|
|
27
|
-
* // With label via
|
|
27
|
+
* // With label via Field
|
|
28
28
|
* DateTimeInput({
|
|
29
29
|
* value: prop(new Date()),
|
|
30
30
|
* onChange: (d) => console.log('Selected:', d.toISOString()),
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
import { CommonInputOptions } from './input-options';
|
|
3
|
+
/**
|
|
4
|
+
* Internal base options for the date-time select shell (trigger + flyout).
|
|
5
|
+
* The actual picker content is provided via `panelContent`.
|
|
6
|
+
*/
|
|
7
|
+
export interface DateTimeSelectShellOptions extends CommonInputOptions {
|
|
8
|
+
/** The display text shown in the trigger. */
|
|
9
|
+
displayText: Value<string>;
|
|
10
|
+
/** The content to render inside the flyout panel. */
|
|
11
|
+
panelContent: TNode;
|
|
12
|
+
/** Callback invoked on blur. */
|
|
13
|
+
onBlur?: () => void;
|
|
14
|
+
/** Content to render before the display text. */
|
|
15
|
+
before?: TNode;
|
|
16
|
+
/** Content to render after the display text. */
|
|
17
|
+
after?: TNode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Shared shell for date-time selectors: trigger button + flyout panel.
|
|
21
|
+
* Used by both DateTimeSelect and NullableDateTimeSelect.
|
|
22
|
+
*/
|
|
23
|
+
export declare function DateTimeSelectShell(options: DateTimeSelectShellOptions): TNode;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type TNode, Value, type Merge } from '@tempots/dom';
|
|
2
|
+
import { CommonInputOptions } from './input-options';
|
|
3
|
+
import type { PlainDate, PlainDateTime } from '../../../temporal/types';
|
|
4
|
+
import { ThemeColorName } from '../../../tokens';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration options for the {@link DateTimeSelect} component.
|
|
7
|
+
*/
|
|
8
|
+
export type DateTimeSelectOptions = Merge<CommonInputOptions, {
|
|
9
|
+
/** The selected date-time. */
|
|
10
|
+
value: Value<PlainDateTime>;
|
|
11
|
+
/** Callback invoked when the date-time changes. */
|
|
12
|
+
onChange?: (dateTime: PlainDateTime) => void;
|
|
13
|
+
/** Callback invoked on blur. */
|
|
14
|
+
onBlur?: () => void;
|
|
15
|
+
/** Predicate returning true if a date should be disabled. */
|
|
16
|
+
isDateDisabled?: (date: PlainDate) => boolean;
|
|
17
|
+
/** Theme color. @default 'primary' */
|
|
18
|
+
color?: Value<ThemeColorName>;
|
|
19
|
+
/** The day the week starts on (0=Sun, 1=Mon). @default 0 */
|
|
20
|
+
weekStartsOn?: Value<number>;
|
|
21
|
+
/** Whether to show seconds in the time picker. @default false */
|
|
22
|
+
showSeconds?: Value<boolean>;
|
|
23
|
+
/** Whether to use 12-hour format. When omitted, auto-detected from locale. */
|
|
24
|
+
use12Hour?: Value<boolean>;
|
|
25
|
+
/** Step for minutes column. @default 1 */
|
|
26
|
+
minuteStep?: Value<number>;
|
|
27
|
+
/** Step for seconds column. @default 1 */
|
|
28
|
+
secondStep?: Value<number>;
|
|
29
|
+
/** Whether to show a "Now" button in the time picker. @default false */
|
|
30
|
+
showNow?: Value<boolean>;
|
|
31
|
+
/** Format a PlainDateTime for display. When omitted, uses locale-aware 12/24-hour format. */
|
|
32
|
+
formatDateTime?: (dt: PlainDateTime) => string;
|
|
33
|
+
/** Content to render before the display text. */
|
|
34
|
+
before?: TNode;
|
|
35
|
+
/** Content to render after the display text. */
|
|
36
|
+
after?: TNode;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* A dropdown date-time selector combining a date picker and time picker.
|
|
40
|
+
*
|
|
41
|
+
* Displays the selected date-time in a styled trigger button. Clicking opens a
|
|
42
|
+
* flyout panel with a {@link DatePicker} and {@link TimePicker} side by side,
|
|
43
|
+
* separated by a visual divider.
|
|
44
|
+
*
|
|
45
|
+
* When no custom `formatDateTime` is provided, the time portion adapts to the
|
|
46
|
+
* locale's 12/24-hour convention (or the explicit `use12Hour` prop).
|
|
47
|
+
*
|
|
48
|
+
* Use {@link NullableDateTimeSelect} when the date-time can be null/unset.
|
|
49
|
+
*
|
|
50
|
+
* @param options - Configuration for the date-time selector
|
|
51
|
+
* @returns A date-time selector element
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* import { prop } from '@tempots/dom'
|
|
56
|
+
* import { DateTimeSelect } from '@tempots/beatui'
|
|
57
|
+
* import { Temporal } from '@js-temporal/polyfill'
|
|
58
|
+
*
|
|
59
|
+
* const dt = prop(Temporal.Now.plainDateTimeISO())
|
|
60
|
+
* DateTimeSelect({
|
|
61
|
+
* value: dt,
|
|
62
|
+
* onChange: v => dt.set(v),
|
|
63
|
+
* })
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare function DateTimeSelect(options: DateTimeSelectOptions): TNode;
|
|
@@ -44,7 +44,7 @@ export type DropdownInputOptions<T> = Merge<InputOptions<T>, {
|
|
|
44
44
|
* const color = prop('red')
|
|
45
45
|
* DropdownInput({
|
|
46
46
|
* value: color,
|
|
47
|
-
* onChange: color.set,
|
|
47
|
+
* onChange: v => color.set(v),
|
|
48
48
|
* options: [
|
|
49
49
|
* Option.value('red', 'Red'),
|
|
50
50
|
* Option.value('green', 'Green'),
|
|
@@ -90,11 +90,11 @@ export declare const BaseDropdownControl: <T>(options: BaseControlOptions<T, Dro
|
|
|
90
90
|
/**
|
|
91
91
|
* A complete dropdown form control with label, description, error message, and validation.
|
|
92
92
|
*
|
|
93
|
-
* Combines {@link BaseDropdownControl} with
|
|
93
|
+
* Combines {@link BaseDropdownControl} with a {@link Field} to provide a
|
|
94
94
|
* full-featured form field with label, optional description, and validation error display.
|
|
95
95
|
*
|
|
96
96
|
* @template T - The type of the selectable option values
|
|
97
97
|
* @param options - Controller options including wrapper label/description and dropdown configuration
|
|
98
98
|
* @returns A dropdown input wrapped in a form field with label and error display
|
|
99
99
|
*/
|
|
100
|
-
export declare const DropdownControl: <T>(options: ControlOptions<T, DropdownInputOptions<T>>) => Renderable
|
|
100
|
+
export declare const DropdownControl: <T>(options: ControlOptions<T, DropdownInputOptions<T>>) => import("@tempots/core").Renderable<import("@tempots/dom").DOMContext, typeof import("@tempots/dom").DOM_RENDERABLE_TYPE>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Provider, Value } from '@tempots/dom';
|
|
2
|
+
import type { ControlSize } from '../../theme';
|
|
3
|
+
import type { FieldLabelLayout } from './field';
|
|
4
|
+
/**
|
|
5
|
+
* Layout configuration values cascaded by the {@link FieldLayout} provider.
|
|
6
|
+
*
|
|
7
|
+
* When a `Fieldset` provides this context, descendant `Field` components
|
|
8
|
+
* automatically inherit these defaults. Local options on individual Fields
|
|
9
|
+
* take precedence over provider values.
|
|
10
|
+
*/
|
|
11
|
+
export interface FieldLayoutValue {
|
|
12
|
+
/** Label position relative to input. @default 'vertical' */
|
|
13
|
+
layout: Value<FieldLabelLayout>;
|
|
14
|
+
/** Label column width for horizontal layouts. @default '7.5rem' */
|
|
15
|
+
labelWidth: Value<string>;
|
|
16
|
+
/** Control size cascaded to children. @default 'md' */
|
|
17
|
+
size: Value<ControlSize>;
|
|
18
|
+
/** Gap between fields in a Fieldset. @default 'md' */
|
|
19
|
+
gap: Value<ControlSize>;
|
|
20
|
+
/** Number of grid columns. @default 1 */
|
|
21
|
+
columns: Value<number>;
|
|
22
|
+
/** Minimum field width before columns auto-collapse. @default '15rem' */
|
|
23
|
+
minFieldWidth: Value<string>;
|
|
24
|
+
/** Reduced spacing mode for data-dense interfaces. @default false */
|
|
25
|
+
compact: Value<boolean>;
|
|
26
|
+
}
|
|
27
|
+
/** Default values for the FieldLayout provider. */
|
|
28
|
+
export declare const FIELD_LAYOUT_DEFAULTS: FieldLayoutValue;
|
|
29
|
+
/**
|
|
30
|
+
* Options accepted by the {@link FieldLayout} provider.
|
|
31
|
+
*
|
|
32
|
+
* All properties are optional — unspecified properties fall back to
|
|
33
|
+
* {@link FIELD_LAYOUT_DEFAULTS}.
|
|
34
|
+
*/
|
|
35
|
+
export interface FieldLayoutOptions {
|
|
36
|
+
/** Label position relative to input. @default 'vertical' */
|
|
37
|
+
layout?: Value<FieldLabelLayout>;
|
|
38
|
+
/** Label column width for horizontal layouts. @default '7.5rem' */
|
|
39
|
+
labelWidth?: Value<string>;
|
|
40
|
+
/** Control size cascaded to children. @default 'md' */
|
|
41
|
+
size?: Value<ControlSize>;
|
|
42
|
+
/** Gap between fields in a Fieldset. @default 'md' */
|
|
43
|
+
gap?: Value<ControlSize>;
|
|
44
|
+
/** Number of grid columns. @default 1 */
|
|
45
|
+
columns?: Value<number>;
|
|
46
|
+
/** Minimum field width before columns auto-collapse. @default '15rem' */
|
|
47
|
+
minFieldWidth?: Value<string>;
|
|
48
|
+
/** Reduced spacing mode. @default false */
|
|
49
|
+
compact?: Value<boolean>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Provider that cascades form layout configuration to descendant `Field` components.
|
|
53
|
+
*
|
|
54
|
+
* Typically provided by a `Fieldset`, but can also be used directly via `Provide`:
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* Provide(FieldLayout, { layout: 'horizontal-fixed', labelWidth: '160px' },
|
|
59
|
+
* Field({ label: 'Name', content: TextInput({ ... }) }),
|
|
60
|
+
* Field({ label: 'Email', content: TextInput({ ... }) }),
|
|
61
|
+
* )
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare const FieldLayout: Provider<FieldLayoutValue, any>;
|
|
@@ -2,26 +2,28 @@ import { TNode, Value } from '@tempots/dom';
|
|
|
2
2
|
/**
|
|
3
3
|
* A visual indicator (asterisk) appended to labels for required fields.
|
|
4
4
|
*
|
|
5
|
-
* Renders as a red asterisk (" *") with the `bc-
|
|
5
|
+
* Renders as a red asterisk (" *") with the `bc-field__required` class.
|
|
6
6
|
*/
|
|
7
7
|
export declare const RequiredSymbol: import("@tempots/dom").Renderable;
|
|
8
8
|
/**
|
|
9
|
-
* Layout modes for the
|
|
9
|
+
* Layout modes for the field structure.
|
|
10
10
|
*
|
|
11
11
|
* - `'vertical'` - Label above input (default)
|
|
12
12
|
* - `'horizontal'` - Label and input side-by-side with flexible label width
|
|
13
|
-
* - `'horizontal-
|
|
14
|
-
* - `'horizontal-
|
|
13
|
+
* - `'horizontal-fixed'` - Label on the left with fixed width, left-aligned
|
|
14
|
+
* - `'horizontal-end'` - Label on the left with fixed width, right-aligned (flush with input)
|
|
15
|
+
* - `'horizontal-label-right'` - Label on the right side of the input (for checkboxes, switches)
|
|
16
|
+
* - `'responsive'` - Horizontal-fixed above 480px, vertical below (container query)
|
|
15
17
|
*/
|
|
16
|
-
export type
|
|
18
|
+
export type FieldLabelLayout = 'vertical' | 'horizontal' | 'horizontal-fixed' | 'horizontal-end' | 'horizontal-label-right' | 'responsive';
|
|
17
19
|
/**
|
|
18
|
-
* Configuration options for the `
|
|
20
|
+
* Configuration options for the `Field` component.
|
|
19
21
|
*
|
|
20
22
|
* This type defines all the options for wrapping an input with label, description,
|
|
21
23
|
* error message, and contextual information. It's used by form controls and
|
|
22
24
|
* standalone inputs to provide consistent labeling and error display.
|
|
23
25
|
*/
|
|
24
|
-
export type
|
|
26
|
+
export type FieldOptions = {
|
|
25
27
|
/** Whether the wrapper should take full width of its container */
|
|
26
28
|
fullWidth?: Value<boolean>;
|
|
27
29
|
/** Label text or node to display above/beside the input */
|
|
@@ -45,9 +47,13 @@ export type InputWrapperOptions = {
|
|
|
45
47
|
/** Whether the input is disabled (applies disabled styling to label) */
|
|
46
48
|
disabled?: Value<boolean>;
|
|
47
49
|
/** Layout mode for label and input positioning */
|
|
48
|
-
layout?: Value<
|
|
49
|
-
/** CSS width value for label in
|
|
50
|
+
layout?: Value<FieldLabelLayout>;
|
|
51
|
+
/** CSS width value for label in horizontal layouts (e.g., '120px', '10rem') */
|
|
50
52
|
labelWidth?: Value<string>;
|
|
53
|
+
/** Reduced spacing mode for data-dense interfaces */
|
|
54
|
+
compact?: Value<boolean>;
|
|
55
|
+
/** Number of grid columns this field spans in a Fieldset grid */
|
|
56
|
+
span?: Value<number>;
|
|
51
57
|
};
|
|
52
58
|
/**
|
|
53
59
|
* Wraps an input element with label, description, error message, and accessibility attributes.
|
|
@@ -58,8 +64,9 @@ export type InputWrapperOptions = {
|
|
|
58
64
|
* - Description text for additional guidance
|
|
59
65
|
* - Error message display with ARIA live region announcements
|
|
60
66
|
* - Proper accessibility attributes (aria-describedby, aria-invalid, role="alert")
|
|
61
|
-
* - Multiple layout modes (vertical, horizontal, horizontal-label-right, horizontal-fixed)
|
|
67
|
+
* - Multiple layout modes (vertical, horizontal, horizontal-label-right, horizontal-fixed, responsive)
|
|
62
68
|
* - Automatic ID generation for linking label, description, and error to the input
|
|
69
|
+
* - FieldLayout provider integration: inherits layout settings from a parent Fieldset
|
|
63
70
|
*
|
|
64
71
|
* The component handles state styling (error, disabled) and ensures screen readers
|
|
65
72
|
* receive appropriate context through ARIA attributes.
|
|
@@ -73,17 +80,19 @@ export type InputWrapperOptions = {
|
|
|
73
80
|
* @param options.labelFor - ID of the input element
|
|
74
81
|
* @param options.hasError - Whether to apply error styling
|
|
75
82
|
* @param options.disabled - Whether to apply disabled styling
|
|
76
|
-
* @param options.layout - Layout mode (default: 'vertical')
|
|
83
|
+
* @param options.layout - Layout mode (default: inherited from FieldLayout or 'vertical')
|
|
77
84
|
* @param options.labelWidth - Fixed width for label in 'horizontal-fixed' layout
|
|
85
|
+
* @param options.compact - Reduced spacing mode
|
|
86
|
+
* @param options.span - Number of grid columns this field spans in a Fieldset grid
|
|
78
87
|
* @param options.context - Contextual info in the header (e.g., character count)
|
|
79
88
|
* @param options.labelChildren - Additional content after the label
|
|
80
89
|
* @param options.fullWidth - Whether to take full container width
|
|
81
90
|
* @param children - Additional nodes to append to the wrapper
|
|
82
|
-
* @returns A div element with the complete
|
|
91
|
+
* @returns A div element with the complete field structure
|
|
83
92
|
*
|
|
84
93
|
* @example
|
|
85
94
|
* ```ts
|
|
86
|
-
*
|
|
95
|
+
* Field({
|
|
87
96
|
* label: 'Email',
|
|
88
97
|
* description: 'We will never share your email',
|
|
89
98
|
* required: true,
|
|
@@ -94,4 +103,4 @@ export type InputWrapperOptions = {
|
|
|
94
103
|
* })
|
|
95
104
|
* ```
|
|
96
105
|
*/
|
|
97
|
-
export declare const
|
|
106
|
+
export declare const Field: (options: FieldOptions, ...children: TNode[]) => import("@tempots/core").Renderable<import("@tempots/dom").DOMContext, typeof import("@tempots/dom").DOM_RENDERABLE_TYPE>;
|
|
@@ -4,6 +4,7 @@ export * from './base64s-input';
|
|
|
4
4
|
export * from './checkbox-input';
|
|
5
5
|
export * from './tri-state-checkbox-input';
|
|
6
6
|
export * from './color-input';
|
|
7
|
+
export * from './color-picker/index';
|
|
7
8
|
export * from './color-swatch-input';
|
|
8
9
|
export * from './nullable-color-input';
|
|
9
10
|
export * from './nullable-color-swatch-input';
|
|
@@ -14,6 +15,11 @@ export * from './select-tags-input';
|
|
|
14
15
|
export * from './combobox-tags-input';
|
|
15
16
|
export * from './multi-select';
|
|
16
17
|
export * from './date-input';
|
|
18
|
+
export * from './date-range-select';
|
|
19
|
+
export * from './date-range-select-base';
|
|
20
|
+
export * from './open-date-range-select';
|
|
21
|
+
export * from './date-select';
|
|
22
|
+
export * from './nullable-date-select';
|
|
17
23
|
export * from './date-time-input';
|
|
18
24
|
export * from './editable-text';
|
|
19
25
|
export * from './email-input';
|
|
@@ -22,7 +28,8 @@ export * from './files-input';
|
|
|
22
28
|
export * from './input-adornment';
|
|
23
29
|
export * from './input-container';
|
|
24
30
|
export * from './input-options';
|
|
25
|
-
export * from './
|
|
31
|
+
export * from './field';
|
|
32
|
+
export * from './field-layout';
|
|
26
33
|
export * from './lazy-native-select';
|
|
27
34
|
export * from './list-input';
|
|
28
35
|
export * from './mask-input';
|
|
@@ -35,12 +42,16 @@ export * from './nullable-password-input';
|
|
|
35
42
|
export * from './nullable-text-area';
|
|
36
43
|
export * from './nullable-text-input';
|
|
37
44
|
export * from './number-input';
|
|
45
|
+
export * from './number-stepper';
|
|
46
|
+
export * from './sortable-list';
|
|
47
|
+
export * from './transfer-list';
|
|
38
48
|
export * from './nullable-number-input';
|
|
39
49
|
export * from './option';
|
|
40
50
|
export * from './bigint-input';
|
|
41
51
|
export * from './nullable-bigint-input';
|
|
42
52
|
export * from './password-input';
|
|
43
53
|
export * from './segmented-input';
|
|
54
|
+
export * from './segmented-select';
|
|
44
55
|
export * from './switch';
|
|
45
56
|
export * from './tag-input';
|
|
46
57
|
export * from './tags-input';
|
|
@@ -54,6 +65,13 @@ export * from './radio-group';
|
|
|
54
65
|
export * from './slider-input';
|
|
55
66
|
export * from './range-slider';
|
|
56
67
|
export * from './otp-input';
|
|
68
|
+
export * from './time-format';
|
|
69
|
+
export * from './time-select';
|
|
70
|
+
export * from './time-select-base';
|
|
71
|
+
export * from './nullable-time-select';
|
|
72
|
+
export * from './date-time-select';
|
|
73
|
+
export * from './date-time-select-base';
|
|
74
|
+
export * from './nullable-date-time-select';
|
|
57
75
|
export * from './plain-date-input';
|
|
58
76
|
export * from './nullable-plain-date-input';
|
|
59
77
|
export * from './plain-time-input';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
2
|
import { InputOptions } from './input-options';
|
|
3
3
|
import { DropdownOption } from './option';
|
|
4
4
|
import { BaseControlOptions, ControlOptions } from '../control';
|
|
@@ -95,4 +95,4 @@ export declare function BaseMultiSelectControl<T>(options: BaseControlOptions<T[
|
|
|
95
95
|
* @param options - Controller options for the multi-select control.
|
|
96
96
|
* @returns A renderable form control component with wrapper.
|
|
97
97
|
*/
|
|
98
|
-
export declare function MultiSelectControl<T>(options: ControlOptions<T[], MultiSelectOptions<T>>): Renderable
|
|
98
|
+
export declare function MultiSelectControl<T>(options: ControlOptions<T[], MultiSelectOptions<T>>): import("@tempots/core").Renderable<import("@tempots/dom").DOMContext, typeof import("@tempots/dom").DOM_RENDERABLE_TYPE>;
|
|
@@ -59,4 +59,4 @@ export declare function BaseNativeSelectControl<T>(options: BaseControlOptions<T
|
|
|
59
59
|
* @param options - Controller options for the native select control.
|
|
60
60
|
* @returns A renderable form control component with wrapper.
|
|
61
61
|
*/
|
|
62
|
-
export declare function NativeSelectControl<T>(options: ControlOptions<T, NativeSelectOptions<T>>): Renderable
|
|
62
|
+
export declare function NativeSelectControl<T>(options: ControlOptions<T, NativeSelectOptions<T>>): import("@tempots/core").Renderable<import("@tempots/dom").DOMContext, typeof import("@tempots/dom").DOM_RENDERABLE_TYPE>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type TNode, Value, type Merge } from '@tempots/dom';
|
|
2
|
+
import { CommonInputOptions } from './input-options';
|
|
3
|
+
import type { PlainDate } from '../../../temporal/types';
|
|
4
|
+
import { ThemeColorName } from '../../../tokens';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration options for the {@link NullableDateSelect} component.
|
|
7
|
+
*/
|
|
8
|
+
export type NullableDateSelectOptions = Merge<CommonInputOptions, {
|
|
9
|
+
/** The selected date, or null when unset. */
|
|
10
|
+
value: Value<PlainDate | null>;
|
|
11
|
+
/** Callback invoked when the date changes (receives null when cleared). */
|
|
12
|
+
onChange?: (date: PlainDate | null) => void;
|
|
13
|
+
/** Callback invoked on blur. */
|
|
14
|
+
onBlur?: () => void;
|
|
15
|
+
/** Predicate returning true if a date should be disabled. */
|
|
16
|
+
isDateDisabled?: (date: PlainDate) => boolean;
|
|
17
|
+
/** Theme color. @default 'primary' */
|
|
18
|
+
color?: Value<ThemeColorName>;
|
|
19
|
+
/** The day the week starts on (0=Sun, 1=Mon). @default 0 */
|
|
20
|
+
weekStartsOn?: Value<number>;
|
|
21
|
+
/** Format a PlainDate for display. Defaults to ISO string. */
|
|
22
|
+
formatDate?: (date: PlainDate) => string;
|
|
23
|
+
/** Placeholder shown when no date is selected. @default i18n dateRangeSelectDate */
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
/** Content to render before the display text. */
|
|
26
|
+
before?: TNode;
|
|
27
|
+
/** Content to render after the display text. */
|
|
28
|
+
after?: TNode;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* A dropdown single-date selector where the value may be null.
|
|
32
|
+
*
|
|
33
|
+
* Displays the selected date in a styled trigger button, or a placeholder when
|
|
34
|
+
* no date is selected. A reset (clear) button is shown in the trigger when a
|
|
35
|
+
* date is set, allowing the user to clear back to null.
|
|
36
|
+
*
|
|
37
|
+
* Use {@link DateSelect} when a date is always required.
|
|
38
|
+
*
|
|
39
|
+
* @param options - Configuration for the nullable date selector
|
|
40
|
+
* @returns A nullable date selector element
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* import { prop } from '@tempots/dom'
|
|
45
|
+
* import { NullableDateSelect } from '@tempots/beatui'
|
|
46
|
+
*
|
|
47
|
+
* const date = prop<PlainDate | null>(null)
|
|
48
|
+
* NullableDateSelect({
|
|
49
|
+
* value: date,
|
|
50
|
+
* onChange: v => date.set(v),
|
|
51
|
+
* placeholder: 'Select a date',
|
|
52
|
+
* })
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function NullableDateSelect(options: NullableDateSelectOptions): TNode;
|