@skygraph/react 0.5.2 → 0.5.3

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 (49) hide show
  1. package/README.md +70 -70
  2. package/dist/{Table-BmesoMje.d.ts → Table-CAay8MmA.d.ts} +8 -1
  3. package/dist/{Table-CpKMOH2x.d.cts → Table-CMKo6Pc3.d.cts} +8 -1
  4. package/dist/{chunk-ZJF6SJLP.js → chunk-45YW5VSP.js} +44 -10
  5. package/dist/chunk-45YW5VSP.js.map +1 -0
  6. package/dist/{chunk-Z5UGF7EO.js → chunk-EFDB2ENB.js} +87 -25
  7. package/dist/chunk-EFDB2ENB.js.map +1 -0
  8. package/dist/{chunk-UO6VJC3C.js → chunk-KGFFQGCM.js} +3 -3
  9. package/dist/{chunk-NXB3VAVF.js → chunk-P4J4PFBG.js} +54 -7
  10. package/dist/chunk-P4J4PFBG.js.map +1 -0
  11. package/dist/{chunk-FSV73JI4.js → chunk-PEX2UTNG.js} +2 -2
  12. package/dist/chunk-VLRLCHEL.js +184 -0
  13. package/dist/chunk-VLRLCHEL.js.map +1 -0
  14. package/dist/{chunk-MLEBVELO.js → chunk-YTPUWPWA.js} +51 -46
  15. package/dist/chunk-YTPUWPWA.js.map +1 -0
  16. package/dist/{chunk-GJDDPZH7.js → chunk-ZJC2QUWA.js} +12 -12
  17. package/dist/chunk-ZJC2QUWA.js.map +1 -0
  18. package/dist/datagrid.cjs +76 -21
  19. package/dist/datagrid.cjs.map +1 -1
  20. package/dist/datagrid.js +3 -3
  21. package/dist/devtools.cjs +11 -11
  22. package/dist/devtools.cjs.map +1 -1
  23. package/dist/devtools.js +1 -1
  24. package/dist/form.cjs +127 -86
  25. package/dist/form.cjs.map +1 -1
  26. package/dist/form.js +3 -3
  27. package/dist/index.cjs +1293 -935
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +153 -7
  30. package/dist/index.d.ts +153 -7
  31. package/dist/index.js +255 -131
  32. package/dist/index.js.map +1 -1
  33. package/dist/table.cjs +252 -169
  34. package/dist/table.cjs.map +1 -1
  35. package/dist/table.d.cts +1 -1
  36. package/dist/table.d.ts +1 -1
  37. package/dist/table.js +4 -4
  38. package/dist/tree.cjs.map +1 -1
  39. package/dist/tree.js +3 -3
  40. package/package.json +2 -2
  41. package/dist/chunk-2OCEO636.js +0 -91
  42. package/dist/chunk-2OCEO636.js.map +0 -1
  43. package/dist/chunk-GJDDPZH7.js.map +0 -1
  44. package/dist/chunk-MLEBVELO.js.map +0 -1
  45. package/dist/chunk-NXB3VAVF.js.map +0 -1
  46. package/dist/chunk-Z5UGF7EO.js.map +0 -1
  47. package/dist/chunk-ZJF6SJLP.js.map +0 -1
  48. /package/dist/{chunk-UO6VJC3C.js.map → chunk-KGFFQGCM.js.map} +0 -0
  49. /package/dist/{chunk-FSV73JI4.js.map → chunk-PEX2UTNG.js.map} +0 -0
package/README.md CHANGED
@@ -1,70 +1,70 @@
1
- # @skygraph/react
2
-
3
- React adapter for [SkyGraph](https://skygraph.ruslansinkevich.ru/) — 78+ components, hooks and `ConfigProvider` built on the framework-agnostic [`@skygraph/core`](../core) engine. Shares the `.sg-*` CSS contract with the Vue and Angular adapters via [`@skygraph/styles`](../styles).
4
-
5
- > **Easier path — the meta-package:**
6
- >
7
- > ```bash
8
- > npm install skygraph-react
9
- > ```
10
- >
11
- > The meta-package re-exports everything below and auto-loads the CSS as a side effect. No separate `@skygraph/core` install, no manual `import '@skygraph/styles'`. Use this package directly only when you need fine-grained control over the install set.
12
-
13
- ## Install (direct)
14
-
15
- ```bash
16
- npm install @skygraph/react @skygraph/core
17
- ```
18
-
19
- ```ts
20
- import '@skygraph/styles'
21
- import { Form, Field, SubmitButton } from '@skygraph/react'
22
-
23
- export function App() {
24
- return (
25
- <Form
26
- defaultValues={{ email: '' }}
27
- onSubmit={(values) => console.log(values)}
28
- >
29
- <Field name="email" label="Email" rules={[{ type: 'email' }]} />
30
- <SubmitButton>Submit</SubmitButton>
31
- </Form>
32
- )
33
- }
34
- ```
35
-
36
- ## Components (78+)
37
-
38
- **Data entry:** Button, Input, InputNumber, Textarea, Select, Checkbox, Radio, Switch, Slider, DatePicker, TimePicker, AutoComplete, Rate, Upload, ColorPicker, Cascader, TreeSelect, Mentions
39
-
40
- **Data display:** Table, DataGrid, Tree, List, Tabs, Collapse, Descriptions, Badge, Tag, Avatar, Calendar, Carousel, Timeline, Steps, Segmented, Skeleton, Diagram
41
-
42
- **Visualization:** LineChart, BarChart, AreaChart, PieChart, Dashboard, DashboardEditor, Gantt, EventTimeline, ResourceCalendar
43
-
44
- **Feedback:** Modal, Drawer, Notification, Popconfirm, Tooltip, Progress, Spin, Result, Empty
45
-
46
- **Navigation:** Menu, Breadcrumb, Dropdown, Pagination, Transfer
47
-
48
- **Form:** Form, Field, FormList, FormProvider, SchemaForm, SchemaFormEditor, AutoField, SubmitButton
49
-
50
- **Utility:** Transition (CSS-class-based animations)
51
-
52
- ## Subpath exports
53
-
54
- | Subpath | Use |
55
- |---|---|
56
- | `@skygraph/react` | Full bundle |
57
- | `@skygraph/react/form` | Form primitives only |
58
- | `@skygraph/react/table` | Table primitives only |
59
- | `@skygraph/react/tree` | Tree primitives only |
60
- | `@skygraph/react/virtual` | Virtual-scroll helpers |
61
- | `@skygraph/react/datagrid` | DataGrid |
62
- | `@skygraph/react/devtools` | Optional devtools panel |
63
-
64
- ## Repository
65
-
66
- [github.com/RuslanSinkevich/skygraph-public](https://github.com/RuslanSinkevich/skygraph-public)
67
-
68
- ## License
69
-
70
- MIT
1
+ # @skygraph/react
2
+
3
+ React adapter for [SkyGraph](https://skygraph.ruslansinkevich.ru/) — 50+ components, hooks and `ConfigProvider` built on the framework-agnostic [`@skygraph/core`](../core) engine. Shares the `.sg-*` CSS contract with the Vue and Angular adapters via [`@skygraph/styles`](../styles).
4
+
5
+ > **Easier path — the meta-package:**
6
+ >
7
+ > ```bash
8
+ > npm install skygraph-react
9
+ > ```
10
+ >
11
+ > The meta-package re-exports everything below and auto-loads the CSS as a side effect. No separate `@skygraph/core` install, no manual `import '@skygraph/styles'`. Use this package directly only when you need fine-grained control over the install set.
12
+
13
+ ## Install (direct)
14
+
15
+ ```bash
16
+ npm install @skygraph/react @skygraph/core
17
+ ```
18
+
19
+ ```ts
20
+ import '@skygraph/styles'
21
+ import { Form, Field, SubmitButton } from '@skygraph/react'
22
+
23
+ export function App() {
24
+ return (
25
+ <Form
26
+ defaultValues={{ email: '' }}
27
+ onSubmit={(values) => console.log(values)}
28
+ >
29
+ <Field name="email" label="Email" rules={[{ type: 'email' }]} />
30
+ <SubmitButton>Submit</SubmitButton>
31
+ </Form>
32
+ )
33
+ }
34
+ ```
35
+
36
+ ## Components (53 documented)
37
+
38
+ **Data entry:** Button, Input, InputNumber, Textarea, Select, Checkbox, Radio, Switch, Slider, DatePicker, TimePicker, AutoComplete, Rate, Upload, ColorPicker, Cascader, TreeSelect, Mentions
39
+
40
+ **Data display:** Table, DataGrid, Tree, List, Tabs, Collapse, Descriptions, Badge, Tag, Avatar, Calendar, Carousel, Timeline, Steps, Segmented, Skeleton, Diagram
41
+
42
+ **Visualization:** LineChart, BarChart, AreaChart, PieChart, Dashboard, DashboardEditor, Gantt, EventTimeline, ResourceCalendar
43
+
44
+ **Feedback:** Modal, Drawer, Notification, Popconfirm, Tooltip, Progress, Spin, Result, Empty
45
+
46
+ **Navigation:** Menu, Breadcrumb, Dropdown, Pagination, Transfer
47
+
48
+ **Form:** Form, Field, FormList, FormProvider, SchemaForm, SchemaFormEditor, AutoField, SubmitButton
49
+
50
+ **Utility:** Transition (CSS-class-based animations)
51
+
52
+ ## Subpath exports
53
+
54
+ | Subpath | Use |
55
+ |---|---|
56
+ | `@skygraph/react` | Full bundle |
57
+ | `@skygraph/react/form` | Form primitives only |
58
+ | `@skygraph/react/table` | Table primitives only |
59
+ | `@skygraph/react/tree` | Tree primitives only |
60
+ | `@skygraph/react/virtual` | Virtual-scroll helpers |
61
+ | `@skygraph/react/datagrid` | DataGrid |
62
+ | `@skygraph/react/devtools` | Optional devtools panel |
63
+
64
+ ## Repository
65
+
66
+ [github.com/RuslanSinkevich/skygraph-public](https://github.com/RuslanSinkevich/skygraph-public)
67
+
68
+ ## License
69
+
70
+ MIT
@@ -224,6 +224,11 @@ interface CalendarLocale {
224
224
  /** Tooltip on the "next month" navigation button. */
225
225
  nextMonth?: string;
226
226
  }
227
+ /** Locale strings shared by Input-family `clear` (×) buttons. */
228
+ interface InputLocale {
229
+ /** Accessible label for the clear (×) button. */
230
+ clear?: string;
231
+ }
227
232
  /** Locale strings for the InputPassword component. */
228
233
  interface InputPasswordLocale {
229
234
  /** Accessible label for the visibility toggle when password is hidden. */
@@ -416,6 +421,8 @@ interface SgLocale {
416
421
  transfer?: TransferLocale;
417
422
  /** Calendar locale overrides. */
418
423
  calendar?: CalendarLocale;
424
+ /** Input locale overrides (clear button label). */
425
+ input?: InputLocale;
419
426
  /** InputPassword locale overrides. */
420
427
  inputPassword?: InputPasswordLocale;
421
428
  /** SearchInput locale overrides. */
@@ -1014,4 +1021,4 @@ interface TableRef {
1014
1021
  */
1015
1022
  declare const Table: React__default.ForwardRefExoticComponent<TableProps & React__default.RefAttributes<TableRef>>;
1016
1023
 
1017
- export { type TreeSelectLocale as $, type AggregateType as A, type BreadcrumbLocale as B, type CellSpan as C, type DashboardLocale as D, type ExpandableConfig as E, type FilterDropdownProps as F, type GroupRow as G, type HeaderCell as H, type InlineEditLocale as I, type RateLocale as J, type ResourceCalendarLocale as K, type SchemaFormEditorLocale as L, type ModalLocale as M, type NotificationLocale as N, type SearchInputLocale as O, type PinnedRowsConfig as P, type SkeletonLocale as Q, type RowNumberConfig as R, type SelectionSummaryAction as S, Table as T, type UseTableOptions as U, type SpinLocale as V, type TableRef as W, type TagInputLocale as X, type TagLocale as Y, type TimelineLocale as Z, type TransferLocale as _, type FlatRow as a, type UploadLocale as a0, type RowSelectionConfig as b, type SummaryCell as c, type TableColumn as d, type TableLocale as e, type TableProps as f, type TreeConfig as g, type UseTableReturn as h, type SgLocale as i, type PrintOptions as j, type CalendarLocale as k, type PrintableProp as l, type SlotClassNames as m, type SlotStyles as n, type CarouselLocale as o, type CascaderLocale as p, type ChartsLocale as q, type DatePickerLocale as r, type DrawerLocale as s, type EmptyLocale as t, useTable as u, type FormLocale as v, type GanttLocale as w, type InputPasswordLocale as x, type PaginationLocale as y, type PopconfirmLocale as z };
1024
+ export { type TransferLocale as $, type AggregateType as A, type BreadcrumbLocale as B, type CellSpan as C, type DashboardLocale as D, type ExpandableConfig as E, type FilterDropdownProps as F, type GroupRow as G, type HeaderCell as H, type InlineEditLocale as I, type PopconfirmLocale as J, type RateLocale as K, type ResourceCalendarLocale as L, type ModalLocale as M, type NotificationLocale as N, type SchemaFormEditorLocale as O, type PinnedRowsConfig as P, type SearchInputLocale as Q, type RowNumberConfig as R, type SelectionSummaryAction as S, Table as T, type UseTableOptions as U, type SkeletonLocale as V, type SpinLocale as W, type TableRef as X, type TagInputLocale as Y, type TagLocale as Z, type TimelineLocale as _, type FlatRow as a, type TreeSelectLocale as a0, type UploadLocale as a1, type RowSelectionConfig as b, type SummaryCell as c, type TableColumn as d, type TableLocale as e, type TableProps as f, type TreeConfig as g, type UseTableReturn as h, type SgLocale as i, type PrintOptions as j, type CalendarLocale as k, type PrintableProp as l, type SlotClassNames as m, type SlotStyles as n, type CarouselLocale as o, type CascaderLocale as p, type ChartsLocale as q, type DatePickerLocale as r, type DrawerLocale as s, type EmptyLocale as t, useTable as u, type FormLocale as v, type GanttLocale as w, type InputLocale as x, type InputPasswordLocale as y, type PaginationLocale as z };
@@ -224,6 +224,11 @@ interface CalendarLocale {
224
224
  /** Tooltip on the "next month" navigation button. */
225
225
  nextMonth?: string;
226
226
  }
227
+ /** Locale strings shared by Input-family `clear` (×) buttons. */
228
+ interface InputLocale {
229
+ /** Accessible label for the clear (×) button. */
230
+ clear?: string;
231
+ }
227
232
  /** Locale strings for the InputPassword component. */
228
233
  interface InputPasswordLocale {
229
234
  /** Accessible label for the visibility toggle when password is hidden. */
@@ -416,6 +421,8 @@ interface SgLocale {
416
421
  transfer?: TransferLocale;
417
422
  /** Calendar locale overrides. */
418
423
  calendar?: CalendarLocale;
424
+ /** Input locale overrides (clear button label). */
425
+ input?: InputLocale;
419
426
  /** InputPassword locale overrides. */
420
427
  inputPassword?: InputPasswordLocale;
421
428
  /** SearchInput locale overrides. */
@@ -1014,4 +1021,4 @@ interface TableRef {
1014
1021
  */
1015
1022
  declare const Table: React__default.ForwardRefExoticComponent<TableProps & React__default.RefAttributes<TableRef>>;
1016
1023
 
1017
- export { type TreeSelectLocale as $, type AggregateType as A, type BreadcrumbLocale as B, type CellSpan as C, type DashboardLocale as D, type ExpandableConfig as E, type FilterDropdownProps as F, type GroupRow as G, type HeaderCell as H, type InlineEditLocale as I, type RateLocale as J, type ResourceCalendarLocale as K, type SchemaFormEditorLocale as L, type ModalLocale as M, type NotificationLocale as N, type SearchInputLocale as O, type PinnedRowsConfig as P, type SkeletonLocale as Q, type RowNumberConfig as R, type SelectionSummaryAction as S, Table as T, type UseTableOptions as U, type SpinLocale as V, type TableRef as W, type TagInputLocale as X, type TagLocale as Y, type TimelineLocale as Z, type TransferLocale as _, type FlatRow as a, type UploadLocale as a0, type RowSelectionConfig as b, type SummaryCell as c, type TableColumn as d, type TableLocale as e, type TableProps as f, type TreeConfig as g, type UseTableReturn as h, type SgLocale as i, type PrintOptions as j, type CalendarLocale as k, type PrintableProp as l, type SlotClassNames as m, type SlotStyles as n, type CarouselLocale as o, type CascaderLocale as p, type ChartsLocale as q, type DatePickerLocale as r, type DrawerLocale as s, type EmptyLocale as t, useTable as u, type FormLocale as v, type GanttLocale as w, type InputPasswordLocale as x, type PaginationLocale as y, type PopconfirmLocale as z };
1024
+ export { type TransferLocale as $, type AggregateType as A, type BreadcrumbLocale as B, type CellSpan as C, type DashboardLocale as D, type ExpandableConfig as E, type FilterDropdownProps as F, type GroupRow as G, type HeaderCell as H, type InlineEditLocale as I, type PopconfirmLocale as J, type RateLocale as K, type ResourceCalendarLocale as L, type ModalLocale as M, type NotificationLocale as N, type SchemaFormEditorLocale as O, type PinnedRowsConfig as P, type SearchInputLocale as Q, type RowNumberConfig as R, type SelectionSummaryAction as S, Table as T, type UseTableOptions as U, type SkeletonLocale as V, type SpinLocale as W, type TableRef as X, type TagInputLocale as Y, type TagLocale as Z, type TimelineLocale as _, type FlatRow as a, type TreeSelectLocale as a0, type UploadLocale as a1, type RowSelectionConfig as b, type SummaryCell as c, type TableColumn as d, type TableLocale as e, type TableProps as f, type TreeConfig as g, type UseTableReturn as h, type SgLocale as i, type PrintOptions as j, type CalendarLocale as k, type PrintableProp as l, type SlotClassNames as m, type SlotStyles as n, type CarouselLocale as o, type CascaderLocale as p, type ChartsLocale as q, type DatePickerLocale as r, type DrawerLocale as s, type EmptyLocale as t, useTable as u, type FormLocale as v, type GanttLocale as w, type InputLocale as x, type InputPasswordLocale as y, type PaginationLocale as z };
@@ -1,9 +1,10 @@
1
1
  import {
2
2
  Spin,
3
3
  useConfig
4
- } from "./chunk-2OCEO636.js";
4
+ } from "./chunk-VLRLCHEL.js";
5
5
 
6
6
  // src/components/ui/Input.tsx
7
+ import React from "react";
7
8
  import { jsx, jsxs } from "react/jsx-runtime";
8
9
  function Input({
9
10
  value,
@@ -14,9 +15,14 @@ function Input({
14
15
  size: sizeProp,
15
16
  disabled: disabledProp,
16
17
  loading,
18
+ allowClear = false,
19
+ status,
20
+ prefix,
21
+ suffix,
17
22
  onChange,
18
23
  onBlur,
19
24
  onFocus,
25
+ onClear,
20
26
  "aria-invalid": ariaInvalid,
21
27
  "aria-required": ariaRequired,
22
28
  "aria-describedby": ariaDescribedBy,
@@ -28,45 +34,73 @@ function Input({
28
34
  const config = useConfig();
29
35
  const size = sizeProp ?? config.size ?? "middle";
30
36
  const disabled = disabledProp ?? config.disabled ?? false;
37
+ const [internalValue, setInternalValue] = React.useState(defaultValue ?? "");
38
+ const currentValue = value ?? internalValue;
39
+ const isControlled = value !== void 0;
31
40
  const wrapperClasses = unstyled ? className ?? "" : [
32
41
  "sg-input-wrapper",
33
42
  `sg-input-wrapper-${size}`,
34
43
  loading ? "sg-input-wrapper-loading" : "",
35
44
  readOnly ? "sg-input-wrapper-readonly" : "",
45
+ status ? `sg-input-wrapper-status-${status}` : "",
36
46
  className
37
47
  ].filter(Boolean).join(" ");
38
48
  const inputClasses = unstyled ? "" : [
39
49
  "sg-input",
40
50
  `sg-input-${size}`,
41
- readOnly ? "sg-input-readonly" : ""
51
+ readOnly ? "sg-input-readonly" : "",
52
+ status ? `sg-input-status-${status}` : ""
42
53
  ].filter(Boolean).join(" ");
54
+ const clearLabel = config.locale?.input?.clear ?? "Clear";
55
+ const showClear = allowClear && !disabled && !readOnly && !loading && currentValue !== "";
56
+ const handleChange = (e) => {
57
+ if (!isControlled) setInternalValue(e.target.value);
58
+ onChange?.(e.target.value);
59
+ };
60
+ const handleClear = () => {
61
+ if (!isControlled) setInternalValue("");
62
+ onChange?.("");
63
+ onClear?.();
64
+ };
65
+ const resolvedAriaInvalid = ariaInvalid ?? (status === "error" ? true : void 0);
43
66
  return /* @__PURE__ */ jsxs("span", { className: wrapperClasses, style, children: [
67
+ prefix && /* @__PURE__ */ jsx("span", { className: "sg-input-prefix", children: prefix }),
44
68
  /* @__PURE__ */ jsx(
45
69
  "input",
46
70
  {
47
71
  id,
48
72
  type,
49
73
  className: inputClasses,
50
- value,
51
- defaultValue,
74
+ value: currentValue,
52
75
  placeholder,
53
76
  disabled: disabled || loading,
54
77
  readOnly,
55
- "aria-invalid": ariaInvalid,
78
+ "aria-invalid": resolvedAriaInvalid,
56
79
  "aria-required": ariaRequired,
57
80
  "aria-readonly": readOnly || void 0,
58
81
  "aria-describedby": ariaDescribedBy,
59
- onChange: (e) => onChange?.(e.target.value),
82
+ onChange: handleChange,
60
83
  onBlur,
61
84
  onFocus
62
85
  }
63
86
  ),
64
- loading && /* @__PURE__ */ jsx(Spin, { size: "small", unstyled })
87
+ showClear && /* @__PURE__ */ jsx(
88
+ "button",
89
+ {
90
+ type: "button",
91
+ className: "sg-input-clear",
92
+ "aria-label": clearLabel,
93
+ onClick: handleClear,
94
+ children: "\xD7"
95
+ }
96
+ ),
97
+ loading && /* @__PURE__ */ jsx(Spin, { size: "small", unstyled }),
98
+ suffix && /* @__PURE__ */ jsx("span", { className: "sg-input-suffix", children: suffix })
65
99
  ] });
66
100
  }
67
101
 
68
102
  // src/components/ui/Transition.tsx
69
- import React, { useState, useEffect, useRef, useCallback } from "react";
103
+ import React2, { useState, useEffect, useRef, useCallback } from "react";
70
104
  function Transition({
71
105
  visible,
72
106
  name = "sg-fade",
@@ -140,7 +174,7 @@ function Transition({
140
174
  transitionClass = `${leaveC.to} ${leaveC.active}`;
141
175
  break;
142
176
  }
143
- return React.cloneElement(children, {
177
+ return React2.cloneElement(children, {
144
178
  ref: nodeRef,
145
179
  className: [children.props.className, transitionClass].filter(Boolean).join(" ")
146
180
  });
@@ -197,4 +231,4 @@ export {
197
231
  Transition,
198
232
  Button
199
233
  };
200
- //# sourceMappingURL=chunk-ZJF6SJLP.js.map
234
+ //# sourceMappingURL=chunk-45YW5VSP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/Input.tsx","../src/components/ui/Transition.tsx","../src/components/ui/Button.tsx"],"sourcesContent":["import React from 'react'\nimport { useConfig } from '../ConfigProvider'\nimport type { BaseComponentProps, InteractiveProps, SizableProps } from '../../types'\nimport { Spin } from './Spin'\n\n/** Props for the Input component. */\nexport interface InputProps extends BaseComponentProps, InteractiveProps, SizableProps {\n /** Controlled input value. */\n value?: string\n /** Uncontrolled initial value. */\n defaultValue?: string\n /** Placeholder text when the field is empty. */\n placeholder?: string\n /** Native HTML input type. @default 'text' */\n type?: 'text' | 'email' | 'password' | 'number'\n /**\n * Marks the field as read-only. The value is selectable and submitted\n * but cannot be edited. Sets the HTML `readonly` attribute,\n * `aria-readonly=\"true\"`, and adds the `sg-input-readonly` modifier class.\n * @default false\n */\n readOnly?: boolean\n /** DOM id forwarded to the underlying `<input>`. */\n id?: string\n /**\n * When true, renders a clear (×) button while the field has a value.\n * Disabled and read-only fields hide the button. @default false\n */\n allowClear?: boolean\n /**\n * Validation status badge. Adds `sg-input-wrapper-status-{status}` and\n * `sg-input-status-{status}` modifier classes and sets `aria-invalid` when\n * `error`.\n */\n status?: 'error' | 'warning'\n /** Optional content rendered before the `<input>` (e.g. icon). */\n prefix?: React.ReactNode\n /** Optional content rendered after the `<input>` (e.g. icon, unit). */\n suffix?: React.ReactNode\n /** Exposes invalid state to assistive technologies. */\n 'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling'\n /** Marks the field as required for assistive technologies. */\n 'aria-required'?: boolean | 'false' | 'true'\n /** Connects the input to description / error nodes for assistive technologies. */\n 'aria-describedby'?: string\n /** Called when the text value changes. */\n onChange?: (value: string) => void\n /** Called when the input loses focus. */\n onBlur?: () => void\n /** Called when the input gains focus. */\n onFocus?: () => void\n /** Called when the user activates the built-in clear button. */\n onClear?: () => void\n}\n\n/** Single-line text input with optional loading indicator and configurable HTML type. */\nexport function Input({\n value,\n defaultValue,\n placeholder,\n type = 'text',\n readOnly = false,\n size: sizeProp,\n disabled: disabledProp,\n loading,\n allowClear = false,\n status,\n prefix,\n suffix,\n onChange,\n onBlur,\n onFocus,\n onClear,\n 'aria-invalid': ariaInvalid,\n 'aria-required': ariaRequired,\n 'aria-describedby': ariaDescribedBy,\n id,\n className,\n style,\n unstyled,\n}: InputProps) {\n const config = useConfig()\n const size = sizeProp ?? config.size ?? 'middle'\n const disabled = disabledProp ?? config.disabled ?? false\n\n const [internalValue, setInternalValue] = React.useState<string>(defaultValue ?? '')\n const currentValue = value ?? internalValue\n const isControlled = value !== undefined\n\n const wrapperClasses = unstyled\n ? (className ?? '')\n : [\n 'sg-input-wrapper',\n `sg-input-wrapper-${size}`,\n loading ? 'sg-input-wrapper-loading' : '',\n readOnly ? 'sg-input-wrapper-readonly' : '',\n status ? `sg-input-wrapper-status-${status}` : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const inputClasses = unstyled\n ? ''\n : [\n 'sg-input',\n `sg-input-${size}`,\n readOnly ? 'sg-input-readonly' : '',\n status ? `sg-input-status-${status}` : '',\n ]\n .filter(Boolean)\n .join(' ')\n\n const clearLabel = config.locale?.input?.clear ?? 'Clear'\n const showClear = allowClear && !disabled && !readOnly && !loading && currentValue !== ''\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (!isControlled) setInternalValue(e.target.value)\n onChange?.(e.target.value)\n }\n\n const handleClear = () => {\n if (!isControlled) setInternalValue('')\n onChange?.('')\n onClear?.()\n }\n\n const resolvedAriaInvalid = ariaInvalid ?? (status === 'error' ? true : undefined)\n\n return (\n <span className={wrapperClasses} style={style}>\n {prefix && <span className=\"sg-input-prefix\">{prefix}</span>}\n <input\n id={id}\n type={type}\n className={inputClasses}\n value={currentValue}\n placeholder={placeholder}\n disabled={disabled || loading}\n readOnly={readOnly}\n aria-invalid={resolvedAriaInvalid}\n aria-required={ariaRequired}\n aria-readonly={readOnly || undefined}\n aria-describedby={ariaDescribedBy}\n onChange={handleChange}\n onBlur={onBlur}\n onFocus={onFocus}\n />\n {showClear && (\n <button\n type=\"button\"\n className=\"sg-input-clear\"\n aria-label={clearLabel}\n onClick={handleClear}\n >\n ×\n </button>\n )}\n {loading && <Spin size=\"small\" unstyled={unstyled} />}\n {suffix && <span className=\"sg-input-suffix\">{suffix}</span>}\n </span>\n )\n}\n","import React, { useState, useEffect, useRef, useCallback } from 'react'\n\n/** Props for class-based enter/leave animation on a single child element. */\nexport interface TransitionProps {\n /** When `true`, runs enter; when `false`, runs leave (and may unmount). */\n visible: boolean\n /** Base class name prefix for default enter/leave classes (e.g. `sg-fade-enter-from`). @default 'sg-fade' */\n name?: string\n /** Animation length in ms before idle phase and after callbacks. @default 200 */\n duration?: number\n /** Custom initial class for the enter frame (with `-enter-active`). */\n enterFrom?: string\n /** Custom final class for the enter-active frame. */\n enterTo?: string\n /** Custom initial class for the leave frame (with `-leave-active`). */\n leaveFrom?: string\n /** Custom final class for the leave-active frame. */\n leaveTo?: string\n /** Fires once the enter transition timer completes. */\n onAfterEnter?: () => void\n /** Fires once the leave transition timer completes. */\n onAfterLeave?: () => void\n /** Single React element whose `className` will be merged with transition classes. */\n children: React.ReactElement<{ className?: string; ref?: React.Ref<HTMLElement> }>\n /** When `true`, removes the child from the tree after leave; when `false`, keeps it mounted. @default true */\n unmountOnExit?: boolean\n}\n\ntype Phase = 'idle' | 'enter' | 'enter-active' | 'leave' | 'leave-active'\n\n/**\n * Clones a single child and toggles CSS classes over `duration` when `visible` changes, optionally unmounting after leave.\n */\nexport function Transition({\n visible,\n name = 'sg-fade',\n duration = 200,\n enterFrom,\n enterTo,\n leaveFrom,\n leaveTo,\n onAfterEnter,\n onAfterLeave,\n children,\n unmountOnExit = true,\n}: TransitionProps) {\n const [mounted, setMounted] = useState(visible)\n const [phase, setPhase] = useState<Phase>(visible ? 'idle' : 'idle')\n const nodeRef = useRef<HTMLElement | null>(null)\n const timerRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)\n const prevVisible = useRef(visible)\n\n const getEnterClasses = useCallback(() => {\n if (enterFrom && enterTo) return { from: enterFrom, active: `${name}-enter-active`, to: enterTo }\n return { from: `${name}-enter-from`, active: `${name}-enter-active`, to: `${name}-enter-to` }\n }, [name, enterFrom, enterTo])\n\n const getLeaveClasses = useCallback(() => {\n if (leaveFrom && leaveTo) return { from: leaveFrom, active: `${name}-leave-active`, to: leaveTo }\n return { from: `${name}-leave-from`, active: `${name}-leave-active`, to: `${name}-leave-to` }\n }, [name, leaveFrom, leaveTo])\n\n useEffect(() => {\n if (visible === prevVisible.current) return\n prevVisible.current = visible\n clearTimeout(timerRef.current)\n\n if (visible) {\n setMounted(true)\n setPhase('enter')\n requestAnimationFrame(() => {\n requestAnimationFrame(() => setPhase('enter-active'))\n })\n timerRef.current = setTimeout(() => {\n setPhase('idle')\n onAfterEnter?.()\n }, duration)\n } else {\n setPhase('leave')\n requestAnimationFrame(() => {\n requestAnimationFrame(() => setPhase('leave-active'))\n })\n timerRef.current = setTimeout(() => {\n setPhase('idle')\n if (unmountOnExit) setMounted(false)\n onAfterLeave?.()\n }, duration)\n }\n }, [visible, duration, unmountOnExit, onAfterEnter, onAfterLeave])\n\n useEffect(() => {\n return () => clearTimeout(timerRef.current)\n }, [])\n\n if (!mounted && unmountOnExit) return null\n\n const enterC = getEnterClasses()\n const leaveC = getLeaveClasses()\n\n let transitionClass = ''\n switch (phase) {\n case 'enter':\n transitionClass = `${enterC.from} ${enterC.active}`\n break\n case 'enter-active':\n transitionClass = `${enterC.to} ${enterC.active}`\n break\n case 'leave':\n transitionClass = `${leaveC.from} ${leaveC.active}`\n break\n case 'leave-active':\n transitionClass = `${leaveC.to} ${leaveC.active}`\n break\n }\n\n return React.cloneElement(children, {\n ref: nodeRef,\n className: [children.props.className, transitionClass].filter(Boolean).join(' '),\n })\n}\n","import React from 'react'\nimport { Spin } from './Spin'\nimport { useConfig } from '../ConfigProvider'\nimport type { BaseComponentProps, InteractiveProps, SizableProps } from '../../types'\n\n/** Props for the Button component. */\nexport interface ButtonProps extends BaseComponentProps, InteractiveProps, SizableProps {\n /** Visual style variant. @default 'default' */\n type?: 'default' | 'primary' | 'dashed' | 'text' | 'link'\n /** Native HTML button type attribute. @default 'button' */\n htmlType?: 'button' | 'submit' | 'reset'\n /**\n * Visually flags a destructive action. Combines with `type` (e.g. a\n * `danger` `primary` button is solid red, a `danger` `text` is red text).\n * Adds the `sg-button-danger` modifier class.\n * @default false\n */\n danger?: boolean\n /** Stretches the button to fill its parent container. @default false */\n block?: boolean\n /** Click event handler. */\n onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void\n /** Button content. */\n children?: React.ReactNode\n}\n\n/** General-purpose button with multiple visual variants, sizes, and loading state. */\nexport function Button({\n type = 'default',\n size: sizeProp,\n disabled: disabledProp,\n loading,\n htmlType = 'button',\n danger = false,\n block = false,\n onClick,\n children,\n className,\n style,\n unstyled,\n}: ButtonProps) {\n const config = useConfig()\n const size = sizeProp ?? config.size ?? 'middle'\n const disabled = disabledProp ?? config.disabled ?? false\n\n const classes = unstyled\n ? className ?? ''\n : [\n 'sg-button',\n `sg-button-${type}`,\n `sg-button-${size}`,\n danger ? 'sg-button-danger' : '',\n block ? 'sg-button-block' : '',\n loading ? 'sg-button-loading' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <button\n type={htmlType}\n className={classes}\n style={style}\n disabled={disabled || loading}\n aria-disabled={disabled || loading}\n aria-busy={loading}\n onClick={onClick}\n >\n {loading && <Spin size=\"small\" unstyled={unstyled} />}\n {children}\n </button>\n )\n}\n"],"mappings":";;;;;;AAAA,OAAO,WAAW;AAkId,SACa,KADb;AA1EG,SAAS,MAAM;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,WAAW;AAAA,EACX,MAAM;AAAA,EACN,UAAU;AAAA,EACV;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAe;AACb,QAAM,SAAS,UAAU;AACzB,QAAM,OAAO,YAAY,OAAO,QAAQ;AACxC,QAAM,WAAW,gBAAgB,OAAO,YAAY;AAEpD,QAAM,CAAC,eAAe,gBAAgB,IAAI,MAAM,SAAiB,gBAAgB,EAAE;AACnF,QAAM,eAAe,SAAS;AAC9B,QAAM,eAAe,UAAU;AAE/B,QAAM,iBAAiB,WAClB,aAAa,KACd;AAAA,IACE;AAAA,IACA,oBAAoB,IAAI;AAAA,IACxB,UAAU,6BAA6B;AAAA,IACvC,WAAW,8BAA8B;AAAA,IACzC,SAAS,2BAA2B,MAAM,KAAK;AAA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AA,EACA;AACF,GAAgB;AACd,QAAM,SAAS,UAAU;AACzB,QAAM,OAAO,YAAY,OAAO,QAAQ;AACxC,QAAM,WAAW,gBAAgB,OAAO,YAAY;AAEpD,QAAM,UAAU,WACZ,aAAa,KACb;AAAA,IACE;AAAA,IACA,aAAa,IAAI;AAAA,IACjB,aAAa,IAAI;AAAA,IACjB,SAAS,qBAAqB;AAAA,IAC9B,QAAQ,oBAAoB;AAAA,IAC5B,UAAU,sBAAsB;AAAA,IAChC;AAAA,EACF,EACG,OAAO,OAAO,EACd,KAAK,GAAG;AAEf,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,WAAW;AAAA,MACX;AAAA,MACA,UAAU,YAAY;AAAA,MACtB,iBAAe,YAAY;AAAA,MAC3B,aAAW;AAAA,MACX;AAAA,MAEC;AAAA,mBAAW,gBAAAD,KAAC,QAAK,MAAK,SAAQ,UAAoB;AAAA,QAClD;AAAA;AAAA;AAAA,EACH;AAEJ;","names":["React","jsx","jsxs"]}
@@ -1,15 +1,22 @@
1
1
  import {
2
2
  Checkbox
3
- } from "./chunk-FSV73JI4.js";
3
+ } from "./chunk-PEX2UTNG.js";
4
4
  import {
5
5
  Spin
6
- } from "./chunk-2OCEO636.js";
6
+ } from "./chunk-VLRLCHEL.js";
7
7
  import {
8
8
  useVirtualScroll
9
9
  } from "./chunk-SEQI65CF.js";
10
10
 
11
11
  // src/components/complex/DataGrid/DataGrid.tsx
12
- import React, { forwardRef, useImperativeHandle, useCallback as useCallback2, useRef as useRef2, useMemo, useState as useState2 } from "react";
12
+ import React, {
13
+ forwardRef,
14
+ useImperativeHandle,
15
+ useCallback as useCallback2,
16
+ useRef as useRef2,
17
+ useMemo,
18
+ useState as useState2
19
+ } from "react";
13
20
 
14
21
  // src/components/complex/DataGrid/useDataGridState.ts
15
22
  import { useState, useCallback, useRef } from "react";
@@ -289,7 +296,11 @@ function DataGridInner(props, ref) {
289
296
  } = state;
290
297
  const [ctxMenu, setCtxMenu] = useState2(null);
291
298
  const [dragOverCol, setDragOverCol] = useState2(null);
292
- const { range, containerRef: scrollRef, scrollToIndex } = useVirtualScroll({
299
+ const {
300
+ range,
301
+ containerRef: scrollRef,
302
+ scrollToIndex
303
+ } = useVirtualScroll({
293
304
  itemCount: data.length,
294
305
  itemHeight: rowHeight,
295
306
  overscan
@@ -301,18 +312,9 @@ function DataGridInner(props, ref) {
301
312
  },
302
313
  [rowKey]
303
314
  );
304
- const frozenLeft = useMemo(
305
- () => columns.filter((c) => c.frozen === "left"),
306
- [columns]
307
- );
308
- const frozenRight = useMemo(
309
- () => columns.filter((c) => c.frozen === "right"),
310
- [columns]
311
- );
312
- const scrollable = useMemo(
313
- () => columns.filter((c) => !c.frozen),
314
- [columns]
315
- );
315
+ const frozenLeft = useMemo(() => columns.filter((c) => c.frozen === "left"), [columns]);
316
+ const frozenRight = useMemo(() => columns.filter((c) => c.frozen === "right"), [columns]);
317
+ const scrollable = useMemo(() => columns.filter((c) => !c.frozen), [columns]);
316
318
  const orderedColumns = useMemo(() => {
317
319
  const base = [...frozenLeft, ...scrollable, ...frozenRight];
318
320
  if (!columnOrder) return base;
@@ -624,7 +626,14 @@ function DataGridInner(props, ref) {
624
626
  {
625
627
  ref: containerRef,
626
628
  className: rootCls,
627
- style: { width, height, display: "flex", flexDirection: "column", position: "relative", ...style },
629
+ style: {
630
+ width,
631
+ height,
632
+ display: "flex",
633
+ flexDirection: "column",
634
+ position: "relative",
635
+ ...style
636
+ },
628
637
  onKeyDown: handleKeyDown,
629
638
  tabIndex: 0,
630
639
  role: "grid",
@@ -647,7 +656,13 @@ function DataGridInner(props, ref) {
647
656
  "div",
648
657
  {
649
658
  className: `${cls.headerCell} ${cls.selectionCell}`,
650
- style: { width: SELECTION_COL_WIDTH, minWidth: SELECTION_COL_WIDTH, display: "flex", alignItems: "center", justifyContent: "center" },
659
+ style: {
660
+ width: SELECTION_COL_WIDTH,
661
+ minWidth: SELECTION_COL_WIDTH,
662
+ display: "flex",
663
+ alignItems: "center",
664
+ justifyContent: "center"
665
+ },
651
666
  role: "columnheader",
652
667
  children: /* @__PURE__ */ jsx(
653
668
  Checkbox,
@@ -663,7 +678,14 @@ function DataGridInner(props, ref) {
663
678
  "div",
664
679
  {
665
680
  className: `${cls.headerCell} ${cls.rowNumberCell}`,
666
- style: { width: ROW_NUMBER_COL_WIDTH, minWidth: ROW_NUMBER_COL_WIDTH, display: "flex", alignItems: "center", justifyContent: "center", userSelect: "none" },
681
+ style: {
682
+ width: ROW_NUMBER_COL_WIDTH,
683
+ minWidth: ROW_NUMBER_COL_WIDTH,
684
+ display: "flex",
685
+ alignItems: "center",
686
+ justifyContent: "center",
687
+ userSelect: "none"
688
+ },
667
689
  role: "columnheader",
668
690
  children: "#"
669
691
  }
@@ -774,7 +796,13 @@ function DataGridInner(props, ref) {
774
796
  "div",
775
797
  {
776
798
  className: `${cls.cell} ${cls.selectionCell}`,
777
- style: { width: SELECTION_COL_WIDTH, minWidth: SELECTION_COL_WIDTH, display: "flex", alignItems: "center", justifyContent: "center" },
799
+ style: {
800
+ width: SELECTION_COL_WIDTH,
801
+ minWidth: SELECTION_COL_WIDTH,
802
+ display: "flex",
803
+ alignItems: "center",
804
+ justifyContent: "center"
805
+ },
778
806
  onClick: (e) => e.stopPropagation(),
779
807
  children: /* @__PURE__ */ jsx(
780
808
  Checkbox,
@@ -789,7 +817,14 @@ function DataGridInner(props, ref) {
789
817
  "div",
790
818
  {
791
819
  className: `${cls.cell} ${cls.rowNumberCell}`,
792
- style: { width: ROW_NUMBER_COL_WIDTH, minWidth: ROW_NUMBER_COL_WIDTH, display: "flex", alignItems: "center", justifyContent: "center", color: "var(--sg-text-tertiary, #999)" },
820
+ style: {
821
+ width: ROW_NUMBER_COL_WIDTH,
822
+ minWidth: ROW_NUMBER_COL_WIDTH,
823
+ display: "flex",
824
+ alignItems: "center",
825
+ justifyContent: "center",
826
+ color: "var(--sg-color-text-tertiary, #999)"
827
+ },
793
828
  children: vi.index + 1
794
829
  }
795
830
  ),
@@ -807,8 +842,20 @@ function DataGridInner(props, ref) {
807
842
  className: `${cls.summaryRow} ${sr.className ?? ""}`,
808
843
  style: { display: "flex", height: rowHeight },
809
844
  children: [
810
- rowSelection && /* @__PURE__ */ jsx("div", { className: `${cls.summaryCell}`, style: { width: SELECTION_COL_WIDTH, minWidth: SELECTION_COL_WIDTH } }),
811
- showRowNumber && /* @__PURE__ */ jsx("div", { className: `${cls.summaryCell}`, style: { width: ROW_NUMBER_COL_WIDTH, minWidth: ROW_NUMBER_COL_WIDTH } }),
845
+ rowSelection && /* @__PURE__ */ jsx(
846
+ "div",
847
+ {
848
+ className: `${cls.summaryCell}`,
849
+ style: { width: SELECTION_COL_WIDTH, minWidth: SELECTION_COL_WIDTH }
850
+ }
851
+ ),
852
+ showRowNumber && /* @__PURE__ */ jsx(
853
+ "div",
854
+ {
855
+ className: `${cls.summaryCell}`,
856
+ style: { width: ROW_NUMBER_COL_WIDTH, minWidth: ROW_NUMBER_COL_WIDTH }
857
+ }
858
+ ),
812
859
  orderedColumns.map((col) => /* @__PURE__ */ jsx(
813
860
  "div",
814
861
  {
@@ -834,7 +881,22 @@ function DataGridInner(props, ref) {
834
881
  onClose: () => setCtxMenu(null)
835
882
  }
836
883
  ),
837
- loading && /* @__PURE__ */ jsx("div", { className: cls.loading, style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", background: "rgba(255,255,255,0.6)", zIndex: 10 }, children: /* @__PURE__ */ jsx(Spin, { size: "large" }) })
884
+ loading && /* @__PURE__ */ jsx(
885
+ "div",
886
+ {
887
+ className: cls.loading,
888
+ style: {
889
+ position: "absolute",
890
+ inset: 0,
891
+ display: "flex",
892
+ alignItems: "center",
893
+ justifyContent: "center",
894
+ background: "rgba(255,255,255,0.6)",
895
+ zIndex: 10
896
+ },
897
+ children: /* @__PURE__ */ jsx(Spin, { size: "large" })
898
+ }
899
+ )
838
900
  ]
839
901
  }
840
902
  );
@@ -844,4 +906,4 @@ var DataGrid = forwardRef(DataGridInner);
844
906
  export {
845
907
  DataGrid
846
908
  };
847
- //# sourceMappingURL=chunk-Z5UGF7EO.js.map
909
+ //# sourceMappingURL=chunk-EFDB2ENB.js.map