@tempots/beatui 0.95.0 → 1.0.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-BVXPzVJB.cjs → ar-CuI1Jgt6.cjs} +1 -1
- package/dist/{ar-B4jDJwHQ.js → ar-DaKbK_t8.js} +87 -11
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/{auth-divider-BPwKk8MW.js → auth-divider-BQIhr3-R.js} +99 -98
- package/dist/auth-divider-DvnUModP.cjs +1 -0
- package/dist/beatui.css +1628 -541
- package/dist/beatui.tailwind.css +1629 -542
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +9 -9
- package/dist/codehighlight/index.cjs.js +22 -0
- package/dist/codehighlight/index.es.js +76 -0
- package/dist/colors-B-p6IzX9.cjs +1 -0
- package/dist/{colors-BY0Ja_bf.js → colors-DwufPN8S.js} +18 -18
- package/dist/{de-Dd33yWzb.js → de-3MTPDS1i.js} +82 -6
- package/dist/{de-BdfPZskW.cjs → de-DthHehbh.cjs} +1 -1
- package/dist/{deep-merge-C8dSqIXI.js → deep-merge-BzIheQtH.js} +511 -517
- package/dist/deep-merge-EkjEgK0N.cjs +1 -0
- package/dist/{duration-input-IuFWywO5.cjs → duration-input-ClgYjeBa.cjs} +1 -1
- package/dist/{duration-input-DFZwkg6M.js → duration-input-DGzmIImj.js} +5 -5
- package/dist/{editor-toolbar-group-DiJFgGcI.js → editor-toolbar-group-Crlu1QJw.js} +3 -3
- package/dist/{editor-toolbar-group-BCBfu8pG.cjs → editor-toolbar-group-mkL4QozO.cjs} +1 -1
- package/dist/es-B6GJLk9h.cjs +1 -0
- package/dist/{es-jHMT3_7O.js → es-DwMUvBeU.js} +94 -18
- package/dist/{fa-eX3_BAZR.js → fa-0rvQiKrJ.js} +87 -11
- package/dist/{fa-BXnP4pbN.cjs → fa-BwgP93iV.cjs} +1 -1
- package/dist/{fr-Bj-GjMJm.js → fr-B4i6NzLl.js} +86 -10
- package/dist/{fr-HJDhGjI2.cjs → fr-CQzk5zqY.cjs} +1 -1
- package/dist/{he-DYgmPPkG.js → he-C71n-hsn.js} +87 -11
- package/dist/{he-C6nEVZhN.cjs → he-DcxxvRfs.cjs} +1 -1
- package/dist/{hi-DMVSXAJt.cjs → hi-D-KHVWg4.cjs} +1 -1
- package/dist/{hi-CgYLonE9.js → hi-xmrXpeVU.js} +87 -11
- package/dist/index-B5MAsOC-.cjs +1 -0
- package/dist/{index-B8cqD9ny.js → index-C3o9GSH6.js} +106 -105
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +8055 -5285
- package/dist/input-container-BvEcp7FU.js +275 -0
- package/dist/input-container-Di1YvVB_.cjs +1 -0
- package/dist/{it-CO2BPqah.js → it-CDZTtOBC.js} +83 -7
- package/dist/{it-DhfVcjKb.cjs → it-D344Dutu.cjs} +1 -1
- package/dist/{ja-Bt6fGS_Q.cjs → ja-BNgnDZ27.cjs} +1 -1
- package/dist/{ja-BrzwjH8T.js → ja-Zz1LzidW.js} +91 -15
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +261 -257
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +2 -2
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +132 -133
- package/dist/{ko-D-lJ4wYQ.js → ko-9laUsZDL.js} +90 -14
- package/dist/{ko-DfAaBGrz.cjs → ko-D-WJ9NK7.cjs} +1 -1
- package/dist/lexical/index.cjs.js +2 -39
- package/dist/lexical/index.es.js +2056 -20626
- package/dist/markdown/index.cjs.js +1 -1
- package/dist/markdown/index.es.js +41 -4
- package/dist/{menu-CV85y3Xf.js → menu-B8yoDMRS.js} +23 -23
- package/dist/menu-B92oSDct.cjs +1 -0
- package/dist/modal-BT0jjDqX.cjs +1 -0
- package/dist/{modal-CwZuWiSK.js → modal-DBguyX-b.js} +9 -9
- package/dist/monaco/index.cjs.js +2 -2
- package/dist/monaco/index.es.js +7 -7
- package/dist/{nl-CNWBQjK5.cjs → nl-CrqUlFie.cjs} +1 -1
- package/dist/{nl-ClsworIe.js → nl-Dcll9fVA.js} +86 -10
- package/dist/{notice-D7hYFM5A.js → notice-E19wu9lA.js} +51 -51
- package/dist/notice-_9XhdrFw.cjs +1 -0
- package/dist/oneof-branch-detection-J_DYEEcD.js +1077 -0
- package/dist/oneof-branch-detection-ZUBZ6hqy.cjs +1 -0
- package/dist/{pl-CqHTeu3-.cjs → pl-9UksIrvX.cjs} +1 -1
- package/dist/{pl-WTwLAxnV.js → pl-Dm9N9Gbr.js} +83 -7
- package/dist/prosemirror/index.cjs.js +3 -1
- package/dist/prosemirror/index.es.js +636 -4
- package/dist/{pt-CgkjJnsG.js → pt-CFi5cn0k.js} +88 -12
- package/dist/{pt-BQmsiqbo.cjs → pt-_kfdzwqi.cjs} +1 -1
- package/dist/{ru-CtgH7OY9.js → ru-CEhZUw8R.js} +91 -15
- package/dist/{ru-CG56A2To.cjs → ru-CW1WNNlr.cjs} +1 -1
- package/dist/stack-BLMteGTn.js +15 -0
- package/dist/stack-dwLevGa2.cjs +1 -0
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +2 -2
- package/dist/tailwind/vite-plugin.cjs.js +1 -1
- package/dist/tailwind/vite-plugin.es.js +1 -1
- package/dist/text-input-DfqXolVe.js +55 -0
- package/dist/text-input-X_q01NsY.cjs +1 -0
- package/dist/toolbar-DY0ax2Qd.js +130 -0
- package/dist/toolbar-DoKdYXIL.cjs +1 -0
- package/dist/{tr-DE7_VtKu.cjs → tr-B6GIRegf.cjs} +1 -1
- package/dist/{tr-D1O1vEmr.js → tr-ZmnVDhLP.js} +81 -5
- package/dist/{translations-yu4gNqlP.js → translations-A4kR7CW8.js} +1 -1
- package/dist/{translations-DyCmyLE_.js → translations-B1_yyDUK.js} +207 -129
- package/dist/{translations-DBxIjvWR.cjs → translations-C81buKAw.cjs} +1 -1
- package/dist/translations-Dbx7L7Q1.cjs +1 -0
- package/dist/types/beatui-i18n/default.d.ts +71 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +71 -0
- package/dist/types/beatui-i18n/translations.d.ts +71 -0
- package/dist/types/codehighlight/code-highlight.d.ts +21 -0
- package/dist/types/codehighlight/index.d.ts +14 -0
- package/dist/types/components/button/toggle-button.d.ts +4 -4
- package/dist/types/components/data/avatar.d.ts +3 -1
- package/dist/types/components/data/badge.d.ts +10 -18
- package/dist/types/components/data/column-filter-panel.d.ts +31 -0
- package/dist/types/components/data/column-filter.d.ts +110 -0
- package/dist/types/components/data/column-header-menu.d.ts +42 -0
- package/dist/types/components/data/data-source.d.ts +190 -0
- package/dist/types/components/data/data-table-body.d.ts +12 -0
- package/dist/types/components/data/data-table-column-toggle.d.ts +4 -0
- package/dist/types/components/data/data-table-context.d.ts +53 -0
- package/dist/types/components/data/data-table-header.d.ts +6 -0
- package/dist/types/components/data/data-table-resolve.d.ts +26 -0
- package/dist/types/components/data/data-table-types.d.ts +201 -0
- package/dist/types/components/data/data-table.d.ts +38 -0
- package/dist/types/components/data/data-toolbar.d.ts +44 -0
- package/dist/types/components/data/date-picker-shared.d.ts +55 -0
- package/dist/types/components/data/date-picker.d.ts +58 -0
- package/dist/types/components/data/date-range-picker.d.ts +56 -0
- package/dist/types/components/data/filter.d.ts +268 -0
- package/dist/types/components/data/index.d.ts +13 -4
- package/dist/types/components/data/indicator.d.ts +41 -0
- package/dist/types/components/data/progress-bar.d.ts +2 -2
- package/dist/types/components/data/selection-checkbox.d.ts +63 -0
- package/dist/types/components/data/skeleton.d.ts +1 -1
- package/dist/types/components/data/sortable-header.d.ts +55 -0
- package/dist/types/components/data/unstyled-drop-zone.d.ts +2 -2
- package/dist/types/components/form/control/control.d.ts +9 -9
- package/dist/types/components/form/input/advanced-slider.d.ts +6 -6
- package/dist/types/components/form/input/appearance-selector.d.ts +9 -2
- package/dist/types/components/form/input/checkbox-input.d.ts +6 -7
- package/dist/types/components/form/input/color-input.d.ts +1 -1
- package/dist/types/components/form/input/color-swatch-input.d.ts +3 -3
- package/dist/types/components/form/input/combobox-input.d.ts +5 -5
- package/dist/types/components/form/input/combobox-tags-input.d.ts +5 -5
- package/dist/types/components/form/input/create-nullable-string-input.d.ts +2 -2
- package/dist/types/components/form/input/date-input.d.ts +4 -4
- package/dist/types/components/form/input/dropdown-input.d.ts +5 -5
- package/dist/types/components/form/input/editable-text.d.ts +2 -2
- package/dist/types/components/form/input/email-input.d.ts +4 -4
- package/dist/types/components/form/input/index.d.ts +1 -0
- package/dist/types/components/form/input/input-container.d.ts +1 -1
- package/dist/types/components/form/input/input-options.d.ts +28 -1
- package/dist/types/components/form/input/mask-input.d.ts +8 -2
- package/dist/types/components/form/input/native-select.d.ts +3 -3
- package/dist/types/components/form/input/nullable-date-input.d.ts +2 -2
- package/dist/types/components/form/input/nullable-email-input.d.ts +3 -3
- package/dist/types/components/form/input/nullable-rating-input.d.ts +8 -8
- package/dist/types/components/form/input/nullable-uuid-input.d.ts +4 -4
- package/dist/types/components/form/input/number-input.d.ts +3 -3
- package/dist/types/components/form/input/otp-input.d.ts +12 -12
- package/dist/types/components/form/input/rating-input.d.ts +7 -8
- package/dist/types/components/form/input/select-tags-input.d.ts +5 -5
- package/dist/types/components/form/input/switch.d.ts +2 -2
- package/dist/types/components/form/input/tri-state-checkbox-input.d.ts +82 -0
- package/dist/types/components/form/input/uuid-input.d.ts +2 -2
- package/dist/types/components/json-structure/controls/uuid-control.d.ts +1 -1
- package/dist/types/components/layout/card.d.ts +66 -0
- package/dist/types/components/layout/collapse.d.ts +2 -2
- package/dist/types/components/layout/flex.d.ts +26 -0
- package/dist/types/components/layout/index.d.ts +1 -0
- package/dist/types/components/lexical/floating/slash-command-palette.d.ts +2 -2
- package/dist/types/components/media/pdf-page-viewer.d.ts +8 -5
- package/dist/types/components/misc/index.d.ts +1 -0
- package/dist/types/components/misc/loading-overlay.d.ts +29 -0
- package/dist/types/components/misc/notice.d.ts +4 -4
- package/dist/types/components/misc/notification-provider.d.ts +9 -3
- package/dist/types/components/misc/notification.d.ts +9 -9
- package/dist/types/components/navigation/breadcrumbs.d.ts +1 -1
- package/dist/types/components/navigation/menu.d.ts +6 -6
- package/dist/types/components/navigation/pagination.d.ts +17 -4
- package/dist/types/components/navigation/sidebar/sidebar-link.d.ts +2 -2
- package/dist/types/components/navigation/tabs/tabs.d.ts +17 -8
- package/dist/types/components/navigation/toolbar/toolbar.d.ts +12 -6
- package/dist/types/components/overlay/announcement-bar.d.ts +12 -4
- package/dist/types/components/overlay/dialogs.d.ts +2 -2
- package/dist/types/components/overlay/modal.d.ts +9 -2
- package/dist/types/components/overlay/tooltip.d.ts +6 -6
- package/dist/types/components/theme/types.d.ts +15 -4
- package/dist/types/lexical/plugins/slash-commands.d.ts +1 -1
- package/dist/types/tokens/z-index.d.ts +18 -18
- package/dist/types/utils/use-animated-toggle.d.ts +12 -4
- package/dist/{ur-ZJgsSpG2.cjs → ur-CtFl_tz6.cjs} +1 -1
- package/dist/{ur-BcuB7IqE.js → ur-yYgj3NmT.js} +87 -11
- package/dist/use-animated-toggle-C3asw_Sg.js +207 -0
- package/dist/use-animated-toggle-cKcuItmz.cjs +1 -0
- package/dist/use-form-CaW192gw.cjs +2 -0
- package/dist/{use-form-CfxvyTfd.js → use-form-Dn6v2tEh.js} +153 -152
- package/dist/utils-DmEuG3Np.cjs +1 -0
- package/dist/utils-vUtP6iPG.js +165 -0
- package/dist/{vi-D0rQ3dIx.js → vi-D5u4CLQO.js} +88 -12
- package/dist/{vi-BOgLRkuK.cjs → vi-DyCZSpsk.cjs} +1 -1
- package/dist/widget-customization-DgW1SXN6.cjs +1 -0
- package/dist/{widget-customization-CLZNGavL.js → widget-customization-Dkx7kNSe.js} +413 -398
- package/dist/{zh-DoYqiZO1.js → zh-B0kwMMer.js} +90 -14
- package/dist/{zh-BTZ8OZ4H.cjs → zh-C3ZxMQKb.cjs} +1 -1
- package/package.json +208 -37
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/auth-divider-BgaQ8ifw.cjs +0 -1
- package/dist/colors-BI0YhONJ.cjs +0 -1
- package/dist/deep-merge-ChJQbUKq.cjs +0 -1
- package/dist/es-C8TpneCm.cjs +0 -1
- package/dist/hls.light.min-C6xKDzRR.cjs +0 -27
- package/dist/hls.light.min-hEMf_E8u.js +0 -8311
- package/dist/index-1JaBwDB-.js +0 -921
- package/dist/index-CN10Cyqr.cjs +0 -1
- package/dist/index-CTcbhnPw.cjs +0 -4
- package/dist/index-DF7RFzD9.cjs +0 -1
- package/dist/index-D_zOXmU5.cjs +0 -36
- package/dist/index-DfPkCwdC.js +0 -2709
- package/dist/index-vowHNIPH.js +0 -14308
- package/dist/index-yOU4Ceaq.js +0 -68
- package/dist/index-zQ3IYJFH.cjs +0 -1
- package/dist/input-container-BWYHj0Iq.cjs +0 -1
- package/dist/input-container-DMoVdH6E.js +0 -263
- package/dist/menu-De_-sGeb.cjs +0 -1
- package/dist/modal-CiGmgsOI.cjs +0 -1
- package/dist/notice-CPZQuxcA.cjs +0 -1
- package/dist/oneof-branch-detection-BFxukD63.cjs +0 -8
- package/dist/oneof-branch-detection-izpPjBCR.js +0 -6290
- package/dist/stack-4VUGISn6.cjs +0 -1
- package/dist/stack-Bm-UZosx.js +0 -879
- package/dist/string-B9vVyfq3.cjs +0 -1
- package/dist/string-DYyMxBl-.js +0 -19
- package/dist/text-input-BLupB3cU.js +0 -45
- package/dist/text-input-M6WBhhVj.cjs +0 -1
- package/dist/timer-BJHOsuS6.cjs +0 -1
- package/dist/timer-Rd2sKnvH.js +0 -65
- package/dist/toolbar-Be1eU0qU.js +0 -118
- package/dist/toolbar-WWv5kcYG.cjs +0 -1
- package/dist/translations-OOsMRpX9.cjs +0 -1
- package/dist/types/components/data/calendar-shared.d.ts +0 -59
- package/dist/types/components/data/calendar.d.ts +0 -107
- package/dist/types/components/data/icon-badge.d.ts +0 -14
- package/dist/types/components/data/range-calendar.d.ts +0 -104
- package/dist/types/components/data/tag.d.ts +0 -51
- package/dist/use-animated-toggle-C7PTmnZi.js +0 -195
- package/dist/use-animated-toggle-DrqK7nUS.cjs +0 -1
- package/dist/use-form-ClA0ZRco.cjs +0 -2
- package/dist/utils-DEbsp9Q9.js +0 -129
- package/dist/utils-DIUEhA-Z.cjs +0 -1
- package/dist/widget-customization-DtEEo35Y.cjs +0 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Value, type Renderable } from '@tempots/dom';
|
|
2
|
+
import { ControlSize } from '../theme';
|
|
3
|
+
import { ThemeColorName } from '../../tokens';
|
|
4
|
+
import type { PlainDate } from '../../temporal/types';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration options for the {@link DatePicker} component.
|
|
7
|
+
* Uses Temporal `PlainDate` for date values — no time or timezone concerns.
|
|
8
|
+
*/
|
|
9
|
+
export interface DatePickerOptions {
|
|
10
|
+
/** The currently selected date. */
|
|
11
|
+
value?: Value<PlainDate | null>;
|
|
12
|
+
/** Callback invoked when a date is selected. */
|
|
13
|
+
onSelect?: (date: PlainDate) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Predicate that returns `true` if the given date should be disabled (unselectable).
|
|
16
|
+
* Replaces min/max — use e.g. `d => PlainDate.compare(d, minDate) < 0` for range constraints.
|
|
17
|
+
*/
|
|
18
|
+
isDateDisabled?: (date: PlainDate) => boolean;
|
|
19
|
+
/** Theme color for selected and today highlights. @default 'primary' */
|
|
20
|
+
color?: Value<ThemeColorName>;
|
|
21
|
+
/** Visual size of the date picker. @default 'md' */
|
|
22
|
+
size?: Value<ControlSize>;
|
|
23
|
+
/** Whether the date picker is disabled. @default false */
|
|
24
|
+
disabled?: Value<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* The day the week starts on.
|
|
27
|
+
* 0 = Sunday, 1 = Monday, etc.
|
|
28
|
+
* @default 0
|
|
29
|
+
*/
|
|
30
|
+
weekStartsOn?: Value<number>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A date picker component for date selection with month/year navigation.
|
|
34
|
+
*
|
|
35
|
+
* Uses Temporal `PlainDate` internally — a date-only type with no time or
|
|
36
|
+
* timezone concerns, 1-based months, and proper date arithmetic.
|
|
37
|
+
*
|
|
38
|
+
* Renders a full month grid with day-of-week headers, previous/next month
|
|
39
|
+
* navigation, and a flexible `isDateDisabled` predicate for controlling which
|
|
40
|
+
* dates are selectable. The date picker highlights the currently selected date
|
|
41
|
+
* and today's date. Navigation buttons allow moving between months and years.
|
|
42
|
+
*
|
|
43
|
+
* @param options - Configuration for the date picker
|
|
44
|
+
* @returns A date picker element with date selection capability
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* import { prop } from '@tempots/dom'
|
|
49
|
+
* import { DatePicker, PlainDate } from '@tempots/beatui'
|
|
50
|
+
*
|
|
51
|
+
* const date = prop<PlainDate | null>(null)
|
|
52
|
+
* DatePicker({
|
|
53
|
+
* value: date,
|
|
54
|
+
* onSelect: date.set,
|
|
55
|
+
* })
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare function DatePicker(options?: DatePickerOptions): Renderable;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Value, type Renderable } from '@tempots/dom';
|
|
2
|
+
import { ControlSize } from '../theme';
|
|
3
|
+
import { ThemeColorName } from '../../tokens';
|
|
4
|
+
import type { PlainDate } from '../../temporal/types';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration options for the {@link DateRangePicker} component.
|
|
7
|
+
* Uses Temporal `PlainDate` for date values — no time or timezone concerns.
|
|
8
|
+
*/
|
|
9
|
+
export interface DateRangePickerOptions {
|
|
10
|
+
/** The currently selected date range as `[start, end]`. */
|
|
11
|
+
value?: Value<[PlainDate, PlainDate] | null>;
|
|
12
|
+
/** Callback invoked when a complete range is selected. */
|
|
13
|
+
onChange?: (range: [PlainDate, PlainDate]) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Predicate that returns `true` if the given date should be disabled (unselectable).
|
|
16
|
+
*/
|
|
17
|
+
isDateDisabled?: (date: PlainDate) => boolean;
|
|
18
|
+
/** Theme color for selected and today highlights. @default 'primary' */
|
|
19
|
+
color?: Value<ThemeColorName>;
|
|
20
|
+
/** Visual size of the date picker. @default 'md' */
|
|
21
|
+
size?: Value<ControlSize>;
|
|
22
|
+
/** Whether the date picker is disabled. @default false */
|
|
23
|
+
disabled?: Value<boolean>;
|
|
24
|
+
/**
|
|
25
|
+
* The day the week starts on.
|
|
26
|
+
* 0 = Sunday, 1 = Monday, etc.
|
|
27
|
+
* @default 0
|
|
28
|
+
*/
|
|
29
|
+
weekStartsOn?: Value<number>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A date picker component for date range selection with hover preview.
|
|
33
|
+
*
|
|
34
|
+
* Uses Temporal `PlainDate` internally — a date-only type with no time or
|
|
35
|
+
* timezone concerns, 1-based months, and proper date arithmetic.
|
|
36
|
+
*
|
|
37
|
+
* Users click twice to select a range: the first click sets the start date,
|
|
38
|
+
* hovering shows a preview, and the second click completes the range.
|
|
39
|
+
* The range is auto-sorted so start is always before end.
|
|
40
|
+
*
|
|
41
|
+
* @param options - Configuration for the range date picker
|
|
42
|
+
* @returns A date picker element with date range selection capability
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* import { prop } from '@tempots/dom'
|
|
47
|
+
* import { DateRangePicker, PlainDate } from '@tempots/beatui'
|
|
48
|
+
*
|
|
49
|
+
* const range = prop<[PlainDate, PlainDate] | null>(null)
|
|
50
|
+
* DateRangePicker({
|
|
51
|
+
* value: range,
|
|
52
|
+
* onChange: range.set,
|
|
53
|
+
* })
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function DateRangePicker(options?: DateRangePickerOptions): Renderable;
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A value annotated with its runtime type. Used by compare, range, and set
|
|
3
|
+
* filters so that the evaluator can handle each type correctly without
|
|
4
|
+
* function predicates.
|
|
5
|
+
*/
|
|
6
|
+
export type TypedValue = {
|
|
7
|
+
valueType: 'string';
|
|
8
|
+
value: string;
|
|
9
|
+
} | {
|
|
10
|
+
valueType: 'number';
|
|
11
|
+
value: number;
|
|
12
|
+
} | {
|
|
13
|
+
valueType: 'bigint';
|
|
14
|
+
value: bigint;
|
|
15
|
+
} | {
|
|
16
|
+
valueType: 'date';
|
|
17
|
+
value: Date;
|
|
18
|
+
} | {
|
|
19
|
+
valueType: 'boolean';
|
|
20
|
+
value: boolean;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A range bound annotated with its runtime type.
|
|
24
|
+
* At least one of `min` or `max` must be provided.
|
|
25
|
+
*/
|
|
26
|
+
export type TypedRange = {
|
|
27
|
+
valueType: 'string';
|
|
28
|
+
min?: string;
|
|
29
|
+
max?: string;
|
|
30
|
+
} | {
|
|
31
|
+
valueType: 'number';
|
|
32
|
+
min?: number;
|
|
33
|
+
max?: number;
|
|
34
|
+
} | {
|
|
35
|
+
valueType: 'bigint';
|
|
36
|
+
min?: bigint;
|
|
37
|
+
max?: bigint;
|
|
38
|
+
} | {
|
|
39
|
+
valueType: 'date';
|
|
40
|
+
min?: Date;
|
|
41
|
+
max?: Date;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* A set of values annotated with its runtime type.
|
|
45
|
+
*/
|
|
46
|
+
export type TypedSet = {
|
|
47
|
+
valueType: 'string';
|
|
48
|
+
values: string[];
|
|
49
|
+
} | {
|
|
50
|
+
valueType: 'number';
|
|
51
|
+
values: number[];
|
|
52
|
+
} | {
|
|
53
|
+
valueType: 'bigint';
|
|
54
|
+
values: bigint[];
|
|
55
|
+
} | {
|
|
56
|
+
valueType: 'date';
|
|
57
|
+
values: Date[];
|
|
58
|
+
} | {
|
|
59
|
+
valueType: 'boolean';
|
|
60
|
+
values: boolean[];
|
|
61
|
+
};
|
|
62
|
+
/** Operators for text (string-only) filters. */
|
|
63
|
+
export type TextOperator = 'contains' | 'notContains' | 'equals' | 'notEquals' | 'startsWith' | 'endsWith';
|
|
64
|
+
/** Operators for compare filters (any orderable type). */
|
|
65
|
+
export type CompareOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
66
|
+
/**
|
|
67
|
+
* Open base type for all filters.
|
|
68
|
+
*
|
|
69
|
+
* @typeParam C - Column identifier type
|
|
70
|
+
*/
|
|
71
|
+
export interface FilterBase<C extends string = string> {
|
|
72
|
+
kind: string;
|
|
73
|
+
column: C;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Text (string-only) filter with case-sensitivity option.
|
|
77
|
+
*/
|
|
78
|
+
export interface TextFilter<C extends string = string> extends FilterBase<C> {
|
|
79
|
+
kind: 'text';
|
|
80
|
+
operator: TextOperator;
|
|
81
|
+
value: string;
|
|
82
|
+
caseSensitive?: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Comparison filter for orderable types.
|
|
86
|
+
*/
|
|
87
|
+
export type CompareFilter<C extends string = string> = FilterBase<C> & {
|
|
88
|
+
kind: 'compare';
|
|
89
|
+
operator: CompareOperator;
|
|
90
|
+
} & TypedValue;
|
|
91
|
+
/**
|
|
92
|
+
* Range filter (between min and max).
|
|
93
|
+
*/
|
|
94
|
+
export type RangeFilter<C extends string = string> = FilterBase<C> & {
|
|
95
|
+
kind: 'range';
|
|
96
|
+
exclusive?: boolean;
|
|
97
|
+
} & TypedRange;
|
|
98
|
+
/**
|
|
99
|
+
* Set membership filter.
|
|
100
|
+
*/
|
|
101
|
+
export type SetFilter<C extends string = string> = FilterBase<C> & {
|
|
102
|
+
kind: 'set';
|
|
103
|
+
mode: 'include' | 'exclude';
|
|
104
|
+
} & TypedSet;
|
|
105
|
+
/**
|
|
106
|
+
* Boolean filter.
|
|
107
|
+
*/
|
|
108
|
+
export interface BooleanFilter<C extends string = string> extends FilterBase<C> {
|
|
109
|
+
kind: 'boolean';
|
|
110
|
+
value: boolean;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Null-check filter.
|
|
114
|
+
*/
|
|
115
|
+
export interface NullFilter<C extends string = string> extends FilterBase<C> {
|
|
116
|
+
kind: 'null';
|
|
117
|
+
operator: 'isNull' | 'isNotNull';
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* A composite per-column filter that combines multiple child filters
|
|
121
|
+
* using AND or OR logic. All children share the same column.
|
|
122
|
+
*/
|
|
123
|
+
export interface CompositeColumnFilter<C extends string = string> extends FilterBase<C> {
|
|
124
|
+
kind: 'composite';
|
|
125
|
+
mode: 'and' | 'or';
|
|
126
|
+
filters: BuiltinFilter<C>[];
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Closed union of all builtin filter kinds.
|
|
130
|
+
*/
|
|
131
|
+
export type BuiltinFilter<C extends string = string> = TextFilter<C> | CompareFilter<C> | RangeFilter<C> | SetFilter<C> | BooleanFilter<C> | NullFilter<C> | CompositeColumnFilter<C>;
|
|
132
|
+
export type FilterExpr<C extends string = string> = FilterBase<C> | {
|
|
133
|
+
kind: 'and';
|
|
134
|
+
filters: FilterExpr<C>[];
|
|
135
|
+
} | {
|
|
136
|
+
kind: 'or';
|
|
137
|
+
filters: FilterExpr<C>[];
|
|
138
|
+
} | {
|
|
139
|
+
kind: 'not';
|
|
140
|
+
filter: FilterExpr<C>;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Returns `true` if `f` is one of the builtin filter kinds.
|
|
144
|
+
*/
|
|
145
|
+
export declare function isBuiltinFilter<C extends string = string>(f: FilterBase<C>): f is BuiltinFilter<C>;
|
|
146
|
+
type InferableValue = string | number | bigint | Date | boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Infers the `valueType` discriminator from a runtime value.
|
|
149
|
+
*/
|
|
150
|
+
export declare function inferValueType(v: InferableValue): TypedValue['valueType'];
|
|
151
|
+
/**
|
|
152
|
+
* Evaluates a single builtin filter against a cell value.
|
|
153
|
+
*
|
|
154
|
+
* @param filter - The builtin filter descriptor
|
|
155
|
+
* @param value - The cell value to test
|
|
156
|
+
* @returns Whether the value passes the filter
|
|
157
|
+
*/
|
|
158
|
+
export declare function evaluateBuiltinFilter<C extends string = string>(filter: BuiltinFilter<C>, value: unknown): boolean;
|
|
159
|
+
export interface EvaluateFilterOptions<T, C extends string = string> {
|
|
160
|
+
/** Evaluate a custom (non-builtin) filter kind. Return `true` to include the row. */
|
|
161
|
+
evaluateFilter?: (filter: FilterBase<C>, row: T) => boolean;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Evaluates a filter expression tree against a row.
|
|
165
|
+
*
|
|
166
|
+
* @param expr - Filter expression (single filter, AND, OR, NOT)
|
|
167
|
+
* @param row - The data row
|
|
168
|
+
* @param accessor - Maps a column to its cell value
|
|
169
|
+
* @param opts - Optional callbacks for custom filter kinds
|
|
170
|
+
*/
|
|
171
|
+
export declare function evaluateFilterExpr<T, C extends string = string>(expr: FilterExpr<C>, row: T, accessor: (column: C, row: T) => unknown, opts?: EvaluateFilterOptions<T, C>): boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Returns a human-readable label for a builtin filter.
|
|
174
|
+
*/
|
|
175
|
+
export declare function describeBuiltinFilter<C extends string = string>(filter: BuiltinFilter<C>): string;
|
|
176
|
+
export interface DescribeFilterOptions<C extends string = string> {
|
|
177
|
+
/** Describe a custom (non-builtin) filter kind. */
|
|
178
|
+
describeFilter?: (filter: FilterBase<C>) => string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Localized message functions for describing filter conditions.
|
|
182
|
+
* Each function receives the column name and relevant values,
|
|
183
|
+
* returning a human-readable description.
|
|
184
|
+
*/
|
|
185
|
+
export interface FilterDescriptionMessages {
|
|
186
|
+
textContains: (column: string, value: string) => string;
|
|
187
|
+
textNotContains: (column: string, value: string) => string;
|
|
188
|
+
textEquals: (column: string, value: string) => string;
|
|
189
|
+
textNotEquals: (column: string, value: string) => string;
|
|
190
|
+
textStartsWith: (column: string, value: string) => string;
|
|
191
|
+
textEndsWith: (column: string, value: string) => string;
|
|
192
|
+
compareEq: (column: string, value: string) => string;
|
|
193
|
+
compareNeq: (column: string, value: string) => string;
|
|
194
|
+
compareGt: (column: string, value: string) => string;
|
|
195
|
+
compareGte: (column: string, value: string) => string;
|
|
196
|
+
compareLt: (column: string, value: string) => string;
|
|
197
|
+
compareLte: (column: string, value: string) => string;
|
|
198
|
+
rangeBetween: (column: string, min: string, max: string) => string;
|
|
199
|
+
rangeGte: (column: string, value: string) => string;
|
|
200
|
+
rangeLte: (column: string, value: string) => string;
|
|
201
|
+
setIn: (column: string, values: string) => string;
|
|
202
|
+
setNotIn: (column: string, values: string) => string;
|
|
203
|
+
booleanIs: (column: string, value: string) => string;
|
|
204
|
+
isNull: (column: string) => string;
|
|
205
|
+
isNotNull: (column: string) => string;
|
|
206
|
+
compositeAnd: (descriptions: string[]) => string;
|
|
207
|
+
compositeOr: (descriptions: string[]) => string;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Returns a human-readable label for any filter, delegating to a callback
|
|
211
|
+
* for custom kinds.
|
|
212
|
+
*/
|
|
213
|
+
export declare function describeFilter<C extends string = string>(filter: FilterBase<C>, opts?: DescribeFilterOptions<C>): string;
|
|
214
|
+
/**
|
|
215
|
+
* Returns a localized human-readable label for a builtin filter
|
|
216
|
+
* using the provided message functions.
|
|
217
|
+
*/
|
|
218
|
+
export declare function describeBuiltinFilterLocalized<C extends string = string>(filter: BuiltinFilter<C>, messages: FilterDescriptionMessages): string;
|
|
219
|
+
export interface DescribeFilterLocalizedOptions<C extends string = string> {
|
|
220
|
+
/** Describe a custom (non-builtin) filter kind. */
|
|
221
|
+
describeFilter?: (filter: FilterBase<C>) => string;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Returns a localized human-readable label for any filter, using
|
|
225
|
+
* the provided message functions for builtin kinds and delegating
|
|
226
|
+
* to a callback for custom kinds.
|
|
227
|
+
*/
|
|
228
|
+
export declare function describeFilterLocalized<C extends string = string>(filter: FilterBase<C>, messages: FilterDescriptionMessages, opts?: DescribeFilterLocalizedOptions<C>): string;
|
|
229
|
+
/**
|
|
230
|
+
* Ergonomic builder namespace for constructing filter descriptors.
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```ts
|
|
234
|
+
* Filter.contains('name', 'alice')
|
|
235
|
+
* Filter.gt('age', 30)
|
|
236
|
+
* Filter.between('salary', 50000, 150000)
|
|
237
|
+
* Filter.oneOf('role', ['admin', 'editor'])
|
|
238
|
+
* Filter.isNull('deletedAt')
|
|
239
|
+
* Filter.and(Filter.gt('age', 18), Filter.lt('age', 65))
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
export declare const Filter: {
|
|
243
|
+
text: <C extends string = string>(column: C, operator: TextOperator, value: string, caseSensitive?: boolean) => TextFilter<C>;
|
|
244
|
+
contains: <C extends string = string>(column: C, value: string, caseSensitive?: boolean) => TextFilter<C>;
|
|
245
|
+
notContains: <C extends string = string>(column: C, value: string, caseSensitive?: boolean) => TextFilter<C>;
|
|
246
|
+
equals: <C extends string = string>(column: C, value: string, caseSensitive?: boolean) => TextFilter<C>;
|
|
247
|
+
notEquals: <C extends string = string>(column: C, value: string, caseSensitive?: boolean) => TextFilter<C>;
|
|
248
|
+
startsWith: <C extends string = string>(column: C, value: string, caseSensitive?: boolean) => TextFilter<C>;
|
|
249
|
+
endsWith: <C extends string = string>(column: C, value: string, caseSensitive?: boolean) => TextFilter<C>;
|
|
250
|
+
eq: <C extends string = string>(column: C, value: InferableValue) => CompareFilter<C>;
|
|
251
|
+
neq: <C extends string = string>(column: C, value: InferableValue) => CompareFilter<C>;
|
|
252
|
+
gt: <C extends string = string>(column: C, value: InferableValue) => CompareFilter<C>;
|
|
253
|
+
gte: <C extends string = string>(column: C, value: InferableValue) => CompareFilter<C>;
|
|
254
|
+
lt: <C extends string = string>(column: C, value: InferableValue) => CompareFilter<C>;
|
|
255
|
+
lte: <C extends string = string>(column: C, value: InferableValue) => CompareFilter<C>;
|
|
256
|
+
between: <C extends string = string>(column: C, min: InferableValue | undefined, max: InferableValue | undefined, exclusive?: boolean) => RangeFilter<C>;
|
|
257
|
+
oneOf: <C extends string = string>(column: C, values: InferableValue[]) => SetFilter<C>;
|
|
258
|
+
noneOf: <C extends string = string>(column: C, values: InferableValue[]) => SetFilter<C>;
|
|
259
|
+
isTrue: <C extends string = string>(column: C) => BooleanFilter<C>;
|
|
260
|
+
isFalse: <C extends string = string>(column: C) => BooleanFilter<C>;
|
|
261
|
+
isNull: <C extends string = string>(column: C) => NullFilter<C>;
|
|
262
|
+
isNotNull: <C extends string = string>(column: C) => NullFilter<C>;
|
|
263
|
+
composite: <C extends string = string>(column: C, mode: "and" | "or", filters: BuiltinFilter<C>[]) => CompositeColumnFilter<C>;
|
|
264
|
+
and: <C extends string = string>(...filters: FilterExpr<C>[]) => FilterExpr<C>;
|
|
265
|
+
or: <C extends string = string>(...filters: FilterExpr<C>[]) => FilterExpr<C>;
|
|
266
|
+
not: <C extends string = string>(filter: FilterExpr<C>) => FilterExpr<C>;
|
|
267
|
+
};
|
|
268
|
+
export {};
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
export * from './avatar';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './range-
|
|
2
|
+
export * from './date-picker';
|
|
3
|
+
export * from './date-range-picker';
|
|
4
4
|
export * from './avatar-group';
|
|
5
5
|
export * from './badge';
|
|
6
6
|
export * from './history-timeline';
|
|
7
7
|
export * from './icon';
|
|
8
|
-
export * from './
|
|
8
|
+
export * from './indicator';
|
|
9
9
|
export * from './page-drop-zone';
|
|
10
10
|
export * from './presence-overlay';
|
|
11
11
|
export * from './progress-bar';
|
|
12
12
|
export * from './skeleton';
|
|
13
13
|
export * from './table';
|
|
14
|
-
export * from './tag';
|
|
15
14
|
export * from './unstyled-drop-zone';
|
|
15
|
+
export * from './data-source';
|
|
16
|
+
export * from './filter';
|
|
17
|
+
export * from './data-table-types';
|
|
18
|
+
export * from './data-table';
|
|
19
|
+
export * from './sortable-header';
|
|
20
|
+
export * from './column-filter';
|
|
21
|
+
export * from './column-filter-panel';
|
|
22
|
+
export * from './selection-checkbox';
|
|
23
|
+
export * from './data-toolbar';
|
|
24
|
+
export * from './column-header-menu';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
import { ControlSize } from '../theme';
|
|
3
|
+
import { ThemeColorName } from '../../tokens';
|
|
4
|
+
/** Placement of the indicator relative to its container. */
|
|
5
|
+
export type IndicatorPlacement = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
6
|
+
/** Configuration options for the {@link Indicator} component. */
|
|
7
|
+
export interface IndicatorOptions {
|
|
8
|
+
/** Whether to show the indicator. @default true */
|
|
9
|
+
show?: Value<boolean>;
|
|
10
|
+
/** Count to display. When > 0, shows a count badge instead of a dot. */
|
|
11
|
+
count?: Value<number>;
|
|
12
|
+
/** Maximum count before showing "N+". @default 9 */
|
|
13
|
+
maxCount?: Value<number>;
|
|
14
|
+
/** Theme color of the indicator. @default 'danger' */
|
|
15
|
+
color?: Value<ThemeColorName>;
|
|
16
|
+
/** Position of the indicator. @default 'top-right' */
|
|
17
|
+
placement?: Value<IndicatorPlacement>;
|
|
18
|
+
/** Size of the indicator. @default 'sm' */
|
|
19
|
+
size?: Value<ControlSize>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Overlays a small dot or count badge on any child content.
|
|
23
|
+
* Use for notification counts, status dots, or unread indicators.
|
|
24
|
+
*
|
|
25
|
+
* @param options - Configuration for visibility, count, color, placement, and size
|
|
26
|
+
* @param children - The content to overlay the indicator on (Icon, Avatar, Button, etc.)
|
|
27
|
+
* @returns A positioned container with the indicator badge
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* // Dot indicator on an icon
|
|
32
|
+
* Indicator({ show: hasNotifications }, Icon({ icon: 'mdi:bell' }))
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* // Count badge on an avatar
|
|
38
|
+
* Indicator({ count: unreadCount, color: 'primary' }, Avatar({ name: 'John' }))
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function Indicator({ show, count, maxCount, color, placement, size, }: IndicatorOptions, ...children: TNode[]): import("@tempots/dom").Renderable;
|
|
@@ -6,9 +6,9 @@ import { ExtendedColor } from '../theme/style-utils';
|
|
|
6
6
|
* Configuration options for the {@link ProgressBar} component.
|
|
7
7
|
*/
|
|
8
8
|
export interface ProgressBarOptions {
|
|
9
|
-
/** Current progress value (0 to max). @default 0 */
|
|
9
|
+
/** Current progress value (0 to max). @default 50 @min 0 @max 100 @step 1 */
|
|
10
10
|
value?: Value<number>;
|
|
11
|
-
/** Maximum value for the progress bar. @default 100 */
|
|
11
|
+
/** Maximum value for the progress bar. @default 100 @min 1 @step 1 */
|
|
12
12
|
max?: Value<number>;
|
|
13
13
|
/** Visual size variant. @default 'md' */
|
|
14
14
|
size?: Value<'sm' | 'md' | 'lg'>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Value } from '@tempots/dom';
|
|
2
|
+
import { DataSource } from './data-source';
|
|
3
|
+
import { ControlSize } from '../theme';
|
|
4
|
+
/**
|
|
5
|
+
* Options for the {@link SelectionCheckbox} component.
|
|
6
|
+
*
|
|
7
|
+
* @typeParam T - The type of data rows in the data source
|
|
8
|
+
*/
|
|
9
|
+
export interface SelectionCheckboxOptions<T, C extends string = string> {
|
|
10
|
+
/** The data source to wire selection into */
|
|
11
|
+
dataSource: DataSource<T, C>;
|
|
12
|
+
/** The unique row ID for this checkbox */
|
|
13
|
+
rowId: Value<string>;
|
|
14
|
+
isSelected: Value<boolean>;
|
|
15
|
+
/** Size variant. @default 'md' */
|
|
16
|
+
size?: Value<ControlSize>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A checkbox for selecting/deselecting a single row in a {@link DataSource}.
|
|
20
|
+
*
|
|
21
|
+
* @typeParam T - The type of data rows
|
|
22
|
+
* @param options - Checkbox configuration
|
|
23
|
+
* @returns An `<input type="checkbox">` element wired to the data source selection
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* html.td(
|
|
28
|
+
* SelectionCheckbox({ dataSource: ds, rowId: row.id })
|
|
29
|
+
* )
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function SelectionCheckbox<T, C extends string = string>({ dataSource, rowId, isSelected, size, }: SelectionCheckboxOptions<T, C>): import("@tempots/dom").Renderable;
|
|
33
|
+
/**
|
|
34
|
+
* Options for the {@link SelectAllCheckbox} component.
|
|
35
|
+
*
|
|
36
|
+
* @typeParam T - The type of data rows in the data source
|
|
37
|
+
*/
|
|
38
|
+
export interface SelectAllCheckboxOptions<T, C extends string = string> {
|
|
39
|
+
/** The data source to wire selection into */
|
|
40
|
+
dataSource: DataSource<T, C>;
|
|
41
|
+
/** Size variant. @default 'md' */
|
|
42
|
+
size?: Value<ControlSize>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A checkbox for selecting/deselecting all filtered rows in a {@link DataSource}.
|
|
46
|
+
*
|
|
47
|
+
* Shows three states:
|
|
48
|
+
* - Unchecked: no rows selected
|
|
49
|
+
* - Indeterminate: some rows selected
|
|
50
|
+
* - Checked: all rows selected
|
|
51
|
+
*
|
|
52
|
+
* @typeParam T - The type of data rows
|
|
53
|
+
* @param options - Checkbox configuration
|
|
54
|
+
* @returns An `<input type="checkbox">` element with indeterminate support
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* html.th(
|
|
59
|
+
* SelectAllCheckbox({ dataSource: ds })
|
|
60
|
+
* )
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function SelectAllCheckbox<T, C extends string = string>({ dataSource, size, }: SelectAllCheckboxOptions<T, C>): import("@tempots/dom").Renderable;
|
|
@@ -10,7 +10,7 @@ export interface SkeletonOptions {
|
|
|
10
10
|
width?: Value<string | undefined>;
|
|
11
11
|
/** CSS height value (e.g., '100px', '2rem'). Default varies by variant. */
|
|
12
12
|
height?: Value<string | undefined>;
|
|
13
|
-
/** Number of text lines to render (only applies to text variant). @default 1 */
|
|
13
|
+
/** Number of text lines to render (only applies to text variant). @default 1 @step 1 @min 1 */
|
|
14
14
|
lines?: Value<number>;
|
|
15
15
|
/** Whether to show the shimmer animation. @default true */
|
|
16
16
|
animate?: Value<boolean>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
import { DataSource } from './data-source';
|
|
3
|
+
import { ControlSize } from '../theme';
|
|
4
|
+
/**
|
|
5
|
+
* Options for the {@link SortableHeader} component.
|
|
6
|
+
*
|
|
7
|
+
* @typeParam T - The type of data rows in the data source
|
|
8
|
+
* @typeParam C - Column identifier type (defaults to `string`)
|
|
9
|
+
*/
|
|
10
|
+
export interface SortableHeaderOptions<T, C extends string = string> {
|
|
11
|
+
/** The data source to wire sorting into */
|
|
12
|
+
dataSource: DataSource<T, C>;
|
|
13
|
+
/** Column identifier matching the accessor key */
|
|
14
|
+
column: C;
|
|
15
|
+
/** Size variant. @default 'md' */
|
|
16
|
+
size?: Value<ControlSize>;
|
|
17
|
+
/** Extra actions (e.g. filter panel) rendered alongside the sort icon */
|
|
18
|
+
actions?: TNode;
|
|
19
|
+
/** Column menu (e.g. kebab ⋮ with sort/hide/columns actions) */
|
|
20
|
+
menu?: TNode;
|
|
21
|
+
/** Hide the sort icon when no sort is active. @default false */
|
|
22
|
+
hideInactiveIcon?: boolean;
|
|
23
|
+
/** Whether this header is draggable (for column reordering). @default false */
|
|
24
|
+
draggable?: boolean;
|
|
25
|
+
/** Drag start handler */
|
|
26
|
+
onDragStart?: (e: DragEvent) => void;
|
|
27
|
+
/** Drag over handler */
|
|
28
|
+
onDragOver?: (e: DragEvent) => void;
|
|
29
|
+
/** Drop handler */
|
|
30
|
+
onDrop?: (e: DragEvent) => void;
|
|
31
|
+
/** Drag end handler */
|
|
32
|
+
onDragEnd?: (e: DragEvent) => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A table header cell (`<th>`) that enables click-to-sort on a data source column.
|
|
36
|
+
*
|
|
37
|
+
* Clicking cycles through: none → ascending → descending → none.
|
|
38
|
+
* Displays an icon indicating the current sort direction.
|
|
39
|
+
*
|
|
40
|
+
* @typeParam T - The type of data rows
|
|
41
|
+
* @param options - Configuration for the sortable header
|
|
42
|
+
* @param children - Header label content
|
|
43
|
+
* @returns A `<th>` element with sort interaction
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* html.thead(
|
|
48
|
+
* html.tr(
|
|
49
|
+
* SortableHeader({ dataSource: ds, column: 'name' }, 'Name'),
|
|
50
|
+
* SortableHeader({ dataSource: ds, column: 'age' }, 'Age'),
|
|
51
|
+
* )
|
|
52
|
+
* )
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function SortableHeader<T, C extends string = string>({ dataSource, column, size, actions, menu, hideInactiveIcon, draggable: isDraggable, onDragStart, onDragOver, onDrop, onDragEnd, }: SortableHeaderOptions<T, C>, ...children: TNode[]): import("@tempots/dom").Renderable;
|
|
@@ -2,7 +2,7 @@ import { TNode, Value, Signal } from '@tempots/dom';
|
|
|
2
2
|
/**
|
|
3
3
|
* Configuration options for the {@link UnstyledDropZone} component.
|
|
4
4
|
*/
|
|
5
|
-
export type
|
|
5
|
+
export type UnstyledDropZoneOptions = {
|
|
6
6
|
/**
|
|
7
7
|
* Callback invoked when files are selected, either via drag-and-drop
|
|
8
8
|
* or the file picker dialog. The `via` parameter indicates the selection method.
|
|
@@ -85,4 +85,4 @@ export type DropZoneOptions = {
|
|
|
85
85
|
* })
|
|
86
86
|
* ```
|
|
87
87
|
*/
|
|
88
|
-
export declare function UnstyledDropZone({ onChange, value, accept, enableClick, content, disabled, allowMultiple, }:
|
|
88
|
+
export declare function UnstyledDropZone({ onChange, value, accept, enableClick, content, disabled, allowMultiple, }: UnstyledDropZoneOptions): import("@tempots/core").Renderable<import("@tempots/dom").DOMContext, typeof import("@tempots/dom").DOM_RENDERABLE_TYPE>;
|