@cfx-dev/ui-components 0.0.22 → 0.0.24

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.
@@ -13,5 +13,5 @@ interface ITableProps {
13
13
  sortOrder?: 'asc' | 'desc';
14
14
  onSortChange?: (sortBy: string, sortOrder: 'asc' | 'desc') => void;
15
15
  }
16
- declare function Table({ headers, data, includeRadio, onSelectChange, dataContainer, useSort, sortBy: initialSortBy, sortOrder: initialSortOrder, onSortChange, }: ITableProps): import("react/jsx-runtime").JSX.Element;
17
- export default Table;
16
+ export declare function Table({ headers, data, includeRadio, onSelectChange, dataContainer, useSort, sortBy: initialSortBy, sortOrder: initialSortOrder, onSortChange, }: ITableProps): import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { jsx as t, jsxs as a } from "react/jsx-runtime";
2
- import o, { useState as i } from "react";
2
+ import d, { useState as i } from "react";
3
3
  import { F, a as A } from "../../index.esm-BkynlSN6.js";
4
4
  import '../../assets/Table.css';const E = "_selectedRow_1jg2j_23", _ = {
5
5
  "table-responsive": "_table-responsive_1jg2j_1",
@@ -14,12 +14,12 @@ function S({
14
14
  useSort: m = !1,
15
15
  sortBy: j,
16
16
  sortOrder: v = "asc",
17
- onSortChange: d
17
+ onSortChange: o
18
18
  }) {
19
19
  const [b, f] = i(null), [u, y] = i(j), [R, k] = i(v), O = (e) => {
20
20
  const l = u === e && R === "asc" ? "desc" : "asc";
21
- y(e), k(l), d == null || d(e, l);
22
- }, $ = o.useCallback((e) => {
21
+ y(e), k(l), o == null || o(e, l);
22
+ }, $ = d.useCallback((e) => {
23
23
  f(parseInt(e.target.value, 10)), c == null || c(parseInt(e.target.value, 10));
24
24
  }, [f, c]);
25
25
  return /* @__PURE__ */ t("div", { className: _.table, children: /* @__PURE__ */ a("table", { children: [
@@ -48,7 +48,7 @@ function S({
48
48
  ) }),
49
49
  e.map((l, B) => {
50
50
  let r;
51
- return o.isValidElement(l) ? r = l : p ? r = o.createElement(p, { item: l }) : r = String(l), /* @__PURE__ */ t("td", { children: r }, `item-${B}`);
51
+ return d.isValidElement(l) ? r = l : p ? r = d.createElement(p, { item: l }) : r = String(l), /* @__PURE__ */ t("td", { children: r }, `item-${B}`);
52
52
  })
53
53
  ]
54
54
  },
@@ -57,5 +57,5 @@ function S({
57
57
  ] }) });
58
58
  }
59
59
  export {
60
- S as default
60
+ S as Table
61
61
  };
package/dist/main.d.ts CHANGED
@@ -6,9 +6,11 @@ export { noop, returnTrue, returnFalse, identity, invoke, } from './utils/functi
6
6
  export { isExternalUrl, matchLinks, matchLinkNodes, defaultLinkReplacerx, defaultLinkReplacer, linkifyx, linkify, Linkify, } from './utils/links';
7
7
  export { clamp01, clamp, } from './utils/math';
8
8
  export { unicodeCharAt, splitByIndices, replaceRange, normalizeSlashes, isTrueString, isFalseString, } from './utils/string';
9
+ export { debounce, throttle, } from './utils/execution';
9
10
  export type { ValueOrGetter } from './utils/getValue';
10
11
  export type { ILinkSubstitute, ILinkMatch, LinkifyProps, } from './utils/links';
11
12
  export type { OutletPosition } from './utils/hooks';
13
+ export type { SetTimeoutReturn } from './utils/execution';
12
14
  export { Checkbox } from './components/Checkbox/Checkbox';
13
15
  export { Button } from './components/Button/Button';
14
16
  export { LinkButton } from './components/Button/LinkButton';
@@ -51,6 +53,7 @@ export { Spacer } from './components/Spacer/Spacer';
51
53
  export { Style, useContextualStyle } from './components/Style/Style';
52
54
  export { Switch } from './components/Switch/Switch';
53
55
  export { Tabular } from './components/Tabular/Tabular';
56
+ export { Table } from './components/Table/Table';
54
57
  export { Text, TextBlock } from './components/Text/Text';
55
58
  export { Textarea } from './components/Textarea/Textarea';
56
59
  export { Title, TITLE_OUTLET_ID } from './components/Title/Title';
package/dist/main.js CHANGED
@@ -1,146 +1,151 @@
1
1
  import { mergeRefs as e } from "./utils/mergeRefs.js";
2
2
  import { clsx as p } from "./utils/clsx.js";
3
3
  import { getValue as m } from "./utils/getValue.js";
4
- import { useDynamicRef as a, useGlobalKeyboardEvent as n, useInstance as l, useKeyboardClose as i, useOutlet as s, useWindowResize as u } from "./utils/hooks.js";
5
- import { identity as d, invoke as I, noop as T, returnFalse as L, returnTrue as S } from "./utils/functional.js";
6
- import { Linkify as B, defaultLinkReplacer as k, defaultLinkReplacerx as R, isExternalUrl as O, linkify as g, linkifyx as D, matchLinkNodes as b, matchLinks as h } from "./utils/links.js";
4
+ import { useDynamicRef as a, useGlobalKeyboardEvent as l, useInstance as n, useKeyboardClose as i, useOutlet as s, useWindowResize as u } from "./utils/hooks.js";
5
+ import { identity as d, invoke as T, noop as I, returnFalse as L, returnTrue as S } from "./utils/functional.js";
6
+ import { Linkify as B, defaultLinkReplacer as k, defaultLinkReplacerx as R, isExternalUrl as b, linkify as O, linkifyx as g, matchLinkNodes as h, matchLinks as D } from "./utils/links.js";
7
7
  import { clamp as E, clamp01 as P } from "./utils/math.js";
8
8
  import { isFalseString as v, isTrueString as F, normalizeSlashes as U, replaceRange as A, splitByIndices as z, unicodeCharAt as K } from "./utils/string.js";
9
- import { Checkbox as w } from "./components/Checkbox/Checkbox.js";
10
- import { Button as Y } from "./components/Button/Button.js";
11
- import { LinkButton as M } from "./components/Button/LinkButton.js";
12
- import { ButtonBar as j } from "./components/Button/ButtonBar.js";
13
- import { Avatar as H } from "./components/Avatar/Avatar.js";
14
- import { BACKDROP_OUTLET_ID as Q, BackdropPortal as X } from "./components/BackdropPortal/BackdropPortal.js";
15
- import { Badge as $ } from "./components/Badge/Badge.js";
16
- import { ControlBox as or } from "./components/ControlBox/ControlBox.js";
17
- import { CountryFlag as tr } from "./components/CountryFlag/CountryFlag.js";
18
- import { Decorate as xr } from "./components/Decorate/Decorate.js";
19
- import { Dot as fr } from "./components/Dot/Dot.js";
20
- import { FLYOUT_OUTLET_ID as nr, Flyout as lr } from "./components/Flyout/Flyout.js";
21
- import { Icon as sr } from "./components/Icon/Icon.js";
22
- import { Indicator as cr } from "./components/Indicator/Indicator.js";
23
- import { InfoPanel as Ir } from "./components/InfoPanel/InfoPanel.js";
24
- import { Input as Lr } from "./components/Input/Input.js";
25
- import { RichInput as yr } from "./components/Input/RichInput.js";
26
- import { Interactive as kr } from "./components/Interactive/Interactive.js";
27
- import { Island as Or } from "./components/Island/Island.js";
28
- import { Box as Dr } from "./components/Layout/Box/Box.js";
29
- import { Center as hr } from "./components/Layout/Center/Center.js";
30
- import { Flex as Er } from "./components/Layout/Flex/Flex.js";
31
- import { FlexRestricter as _r } from "./components/Layout/Flex/FlexRestricter.js";
32
- import { Pad as Fr } from "./components/Layout/Pad/Pad.js";
33
- import { Page as Ar } from "./components/Layout/Page/Page.js";
34
- import { Scrollable as Kr } from "./components/Layout/Scrollable/Scrollable.js";
35
- import { VirtualScrollable as wr } from "./components/Layout/Scrollable/VirtualScrollable.js";
36
- import { Loaf as Yr } from "./components/Loaf/Loaf.js";
37
- import { Modal as Mr } from "./components/Modal/Modal.js";
38
- import { NavList as jr } from "./components/NavList/NavList.js";
39
- import { OVERLAY_OUTLET_ID as Hr, Overlay as Jr } from "./components/Overlay/Overlay.js";
40
- import { Popover as Xr } from "./components/Popover/Popover.js";
41
- import { PremiumBadge as $r } from "./components/PremiumBadge/PremiumBadge.js";
42
- import { Prose as oo } from "./components/Prose/Prose.js";
43
- import { Radio as to } from "./components/Radio/Radio.js";
44
- import { Select as xo } from "./components/Select/Select.js";
45
- import { Separator as fo } from "./components/Separator/Separator.js";
46
- import { Shroud as no } from "./components/Shroud/Shroud.js";
47
- import { Spacer as io } from "./components/Spacer/Spacer.js";
48
- import { Style as uo, useContextualStyle as co } from "./components/Style/Style.js";
49
- import { Switch as To } from "./components/Switch/Switch.js";
50
- import { Tabular as So } from "./components/Tabular/Tabular.js";
51
- import { Text as Bo, TextBlock as ko } from "./components/Text/Text.js";
52
- import { Textarea as Oo } from "./components/Textarea/Textarea.js";
53
- import { TITLE_OUTLET_ID as Do, Title as bo } from "./components/Title/Title.js";
54
- import { InputDropzone as Co } from "./components/InputDropzone/InputDropzone.js";
55
- import { B as Po, I as _o } from "./Icons-BlBKvJD8.js";
56
- import { OnScreenSensor as Fo } from "./components/OnScreenSensor.js";
57
- import { ui as Ao } from "./components/ui.js";
58
- import { Symbols as Ko } from "./components/Symbols.js";
9
+ import { debounce as w, throttle as N } from "./utils/execution.js";
10
+ import { Checkbox as G } from "./components/Checkbox/Checkbox.js";
11
+ import { Button as W } from "./components/Button/Button.js";
12
+ import { LinkButton as q } from "./components/Button/LinkButton.js";
13
+ import { ButtonBar as J } from "./components/Button/ButtonBar.js";
14
+ import { Avatar as X } from "./components/Avatar/Avatar.js";
15
+ import { BACKDROP_OUTLET_ID as $, BackdropPortal as oo } from "./components/BackdropPortal/BackdropPortal.js";
16
+ import { Badge as eo } from "./components/Badge/Badge.js";
17
+ import { ControlBox as po } from "./components/ControlBox/ControlBox.js";
18
+ import { CountryFlag as mo } from "./components/CountryFlag/CountryFlag.js";
19
+ import { Decorate as ao } from "./components/Decorate/Decorate.js";
20
+ import { Dot as no } from "./components/Dot/Dot.js";
21
+ import { FLYOUT_OUTLET_ID as so, Flyout as uo } from "./components/Flyout/Flyout.js";
22
+ import { Icon as To } from "./components/Icon/Icon.js";
23
+ import { Indicator as Lo } from "./components/Indicator/Indicator.js";
24
+ import { InfoPanel as yo } from "./components/InfoPanel/InfoPanel.js";
25
+ import { Input as ko } from "./components/Input/Input.js";
26
+ import { RichInput as bo } from "./components/Input/RichInput.js";
27
+ import { Interactive as go } from "./components/Interactive/Interactive.js";
28
+ import { Island as Do } from "./components/Island/Island.js";
29
+ import { Box as Eo } from "./components/Layout/Box/Box.js";
30
+ import { Center as _o } from "./components/Layout/Center/Center.js";
31
+ import { Flex as Fo } from "./components/Layout/Flex/Flex.js";
32
+ import { FlexRestricter as Ao } from "./components/Layout/Flex/FlexRestricter.js";
33
+ import { Pad as Ko } from "./components/Layout/Pad/Pad.js";
34
+ import { Page as wo } from "./components/Layout/Page/Page.js";
35
+ import { Scrollable as Yo } from "./components/Layout/Scrollable/Scrollable.js";
36
+ import { VirtualScrollable as Mo } from "./components/Layout/Scrollable/VirtualScrollable.js";
37
+ import { Loaf as jo } from "./components/Loaf/Loaf.js";
38
+ import { Modal as Ho } from "./components/Modal/Modal.js";
39
+ import { NavList as Qo } from "./components/NavList/NavList.js";
40
+ import { OVERLAY_OUTLET_ID as Zo, Overlay as $o } from "./components/Overlay/Overlay.js";
41
+ import { Popover as rr } from "./components/Popover/Popover.js";
42
+ import { PremiumBadge as tr } from "./components/PremiumBadge/PremiumBadge.js";
43
+ import { Prose as xr } from "./components/Prose/Prose.js";
44
+ import { Radio as fr } from "./components/Radio/Radio.js";
45
+ import { Select as lr } from "./components/Select/Select.js";
46
+ import { Separator as ir } from "./components/Separator/Separator.js";
47
+ import { Shroud as ur } from "./components/Shroud/Shroud.js";
48
+ import { Spacer as dr } from "./components/Spacer/Spacer.js";
49
+ import { Style as Ir, useContextualStyle as Lr } from "./components/Style/Style.js";
50
+ import { Switch as yr } from "./components/Switch/Switch.js";
51
+ import { Tabular as kr } from "./components/Tabular/Tabular.js";
52
+ import { Table as br } from "./components/Table/Table.js";
53
+ import { Text as gr, TextBlock as hr } from "./components/Text/Text.js";
54
+ import { Textarea as Cr } from "./components/Textarea/Textarea.js";
55
+ import { TITLE_OUTLET_ID as Pr, Title as _r } from "./components/Title/Title.js";
56
+ import { InputDropzone as Fr } from "./components/InputDropzone/InputDropzone.js";
57
+ import { B as Ar, I as zr } from "./Icons-BlBKvJD8.js";
58
+ import { OnScreenSensor as Vr } from "./components/OnScreenSensor.js";
59
+ import { ui as Nr } from "./components/ui.js";
60
+ import { Symbols as Gr } from "./components/Symbols.js";
59
61
  export {
60
- H as Avatar,
61
- Q as BACKDROP_OUTLET_ID,
62
- X as BackdropPortal,
63
- $ as Badge,
64
- Dr as Box,
65
- Po as BrandIcon,
66
- Y as Button,
67
- j as ButtonBar,
68
- hr as Center,
69
- w as Checkbox,
70
- or as ControlBox,
71
- tr as CountryFlag,
72
- xr as Decorate,
73
- fr as Dot,
74
- nr as FLYOUT_OUTLET_ID,
75
- Er as Flex,
76
- _r as FlexRestricter,
77
- lr as Flyout,
78
- sr as Icon,
79
- _o as Icons,
80
- cr as Indicator,
81
- Ir as InfoPanel,
82
- Lr as Input,
83
- Co as InputDropzone,
84
- kr as Interactive,
85
- Or as Island,
86
- M as LinkButton,
62
+ X as Avatar,
63
+ $ as BACKDROP_OUTLET_ID,
64
+ oo as BackdropPortal,
65
+ eo as Badge,
66
+ Eo as Box,
67
+ Ar as BrandIcon,
68
+ W as Button,
69
+ J as ButtonBar,
70
+ _o as Center,
71
+ G as Checkbox,
72
+ po as ControlBox,
73
+ mo as CountryFlag,
74
+ ao as Decorate,
75
+ no as Dot,
76
+ so as FLYOUT_OUTLET_ID,
77
+ Fo as Flex,
78
+ Ao as FlexRestricter,
79
+ uo as Flyout,
80
+ To as Icon,
81
+ zr as Icons,
82
+ Lo as Indicator,
83
+ yo as InfoPanel,
84
+ ko as Input,
85
+ Fr as InputDropzone,
86
+ go as Interactive,
87
+ Do as Island,
88
+ q as LinkButton,
87
89
  B as Linkify,
88
- Yr as Loaf,
89
- Mr as Modal,
90
- jr as NavList,
91
- Hr as OVERLAY_OUTLET_ID,
92
- Fo as OnScreenSensor,
93
- Jr as Overlay,
94
- Fr as Pad,
95
- Ar as Page,
96
- Xr as Popover,
97
- $r as PremiumBadge,
98
- oo as Prose,
99
- to as Radio,
100
- yr as RichInput,
101
- Kr as Scrollable,
102
- xo as Select,
103
- fo as Separator,
104
- no as Shroud,
105
- io as Spacer,
106
- uo as Style,
107
- To as Switch,
108
- Ko as Symbols,
109
- Do as TITLE_OUTLET_ID,
110
- So as Tabular,
111
- Bo as Text,
112
- ko as TextBlock,
113
- Oo as Textarea,
114
- bo as Title,
115
- wr as VirtualScrollable,
90
+ jo as Loaf,
91
+ Ho as Modal,
92
+ Qo as NavList,
93
+ Zo as OVERLAY_OUTLET_ID,
94
+ Vr as OnScreenSensor,
95
+ $o as Overlay,
96
+ Ko as Pad,
97
+ wo as Page,
98
+ rr as Popover,
99
+ tr as PremiumBadge,
100
+ xr as Prose,
101
+ fr as Radio,
102
+ bo as RichInput,
103
+ Yo as Scrollable,
104
+ lr as Select,
105
+ ir as Separator,
106
+ ur as Shroud,
107
+ dr as Spacer,
108
+ Ir as Style,
109
+ yr as Switch,
110
+ Gr as Symbols,
111
+ Pr as TITLE_OUTLET_ID,
112
+ br as Table,
113
+ kr as Tabular,
114
+ gr as Text,
115
+ hr as TextBlock,
116
+ Cr as Textarea,
117
+ _r as Title,
118
+ Mo as VirtualScrollable,
116
119
  E as clamp,
117
120
  P as clamp01,
118
121
  p as clsx,
122
+ w as debounce,
119
123
  k as defaultLinkReplacer,
120
124
  R as defaultLinkReplacerx,
121
125
  m as getValue,
122
126
  d as identity,
123
- I as invoke,
124
- O as isExternalUrl,
127
+ T as invoke,
128
+ b as isExternalUrl,
125
129
  v as isFalseString,
126
130
  F as isTrueString,
127
- g as linkify,
128
- D as linkifyx,
129
- b as matchLinkNodes,
130
- h as matchLinks,
131
+ O as linkify,
132
+ g as linkifyx,
133
+ h as matchLinkNodes,
134
+ D as matchLinks,
131
135
  e as mergeRefs,
132
- T as noop,
136
+ I as noop,
133
137
  U as normalizeSlashes,
134
138
  A as replaceRange,
135
139
  L as returnFalse,
136
140
  S as returnTrue,
137
141
  z as splitByIndices,
138
- Ao as ui,
142
+ N as throttle,
143
+ Nr as ui,
139
144
  K as unicodeCharAt,
140
- co as useContextualStyle,
145
+ Lr as useContextualStyle,
141
146
  a as useDynamicRef,
142
- n as useGlobalKeyboardEvent,
143
- l as useInstance,
147
+ l as useGlobalKeyboardEvent,
148
+ n as useInstance,
144
149
  i as useKeyboardClose,
145
150
  s as useOutlet,
146
151
  u as useWindowResize
@@ -0,0 +1,3 @@
1
+ export type SetTimeoutReturn = ReturnType<typeof setTimeout>;
2
+ export declare function debounce<A extends unknown[]>(fn: (...args: A) => void, time: number): (...args: A) => void;
3
+ export declare function throttle<A extends unknown[]>(fn: (...args: A) => void, time: number): (...args: A) => void;
@@ -0,0 +1,20 @@
1
+ function n(e, l) {
2
+ let t = null;
3
+ return (...u) => {
4
+ t !== null && clearTimeout(t), t = setTimeout(() => {
5
+ t = null, e(...u);
6
+ }, l);
7
+ };
8
+ }
9
+ function r(e, l) {
10
+ let t = null;
11
+ return (...u) => {
12
+ t === null && (t = setTimeout(() => {
13
+ t = null;
14
+ }, l), e(...u));
15
+ };
16
+ }
17
+ export {
18
+ n as debounce,
19
+ r as throttle
20
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cfx-dev/ui-components",
3
3
  "private": false,
4
- "version": "0.0.22",
4
+ "version": "0.0.24",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",