@companix/uikit 0.1.13 → 0.1.15
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/Scrollable/Scrollable.scss +0 -5
- package/dist/__hooks/use-local-storage.d.ts +13 -1
- package/dist/bundle.es.js +57 -56
- package/dist/bundle.es46.js +48 -9
- package/dist/bundle.es9.js +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { EventEmmiter } from '@companix/utils-js';
|
|
2
|
+
export declare class LocalStorageService<T> {
|
|
3
|
+
emmiter: EventEmmiter<T>;
|
|
4
|
+
constructor(emmiter: EventEmmiter<T>);
|
|
5
|
+
getStorageValue(token: string, defaultValue: T): any;
|
|
6
|
+
setValue(token: string, value: T): void;
|
|
7
|
+
}
|
|
8
|
+
export declare const useLocalStorage: <T>(token: string, defaultValue: T) => readonly [T, (value: T) => void];
|
|
9
|
+
interface LocalStorageProviderProps {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const LocalStorageProvider: ({ children }: LocalStorageProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
package/dist/bundle.es.js
CHANGED
|
@@ -6,14 +6,14 @@ import { ButtonGroup as l } from "./bundle.es6.js";
|
|
|
6
6
|
import { Spinner as S } from "./bundle.es7.js";
|
|
7
7
|
import { Scrollable as g } from "./bundle.es8.js";
|
|
8
8
|
import { ImitateScroll as d } from "./bundle.es9.js";
|
|
9
|
-
import { Segments as
|
|
9
|
+
import { Segments as P } from "./bundle.es10.js";
|
|
10
10
|
import { Popover as y } from "./bundle.es11.js";
|
|
11
11
|
import { Tooltip as T } from "./bundle.es12.js";
|
|
12
|
-
import { Select as
|
|
12
|
+
import { Select as v } from "./bundle.es13.js";
|
|
13
13
|
import { SelectTags as A } from "./bundle.es14.js";
|
|
14
14
|
import { Input as R } from "./bundle.es15.js";
|
|
15
|
-
import { OptionItem as
|
|
16
|
-
import { NumberInput as
|
|
15
|
+
import { OptionItem as L } from "./bundle.es16.js";
|
|
16
|
+
import { NumberInput as C } from "./bundle.es17.js";
|
|
17
17
|
import { OptionsList as F } from "./bundle.es18.js";
|
|
18
18
|
import { Checkbox as G } from "./bundle.es19.js";
|
|
19
19
|
import { Switch as E } from "./bundle.es20.js";
|
|
@@ -33,28 +33,28 @@ import { FormGroup as ce } from "./bundle.es33.js";
|
|
|
33
33
|
import { TimePicker as ue } from "./bundle.es34.js";
|
|
34
34
|
import { Icon as De } from "./bundle.es35.js";
|
|
35
35
|
import { ProgressBar as he } from "./bundle.es36.js";
|
|
36
|
-
import { Skeleton as
|
|
36
|
+
import { Skeleton as Be } from "./bundle.es37.js";
|
|
37
37
|
import { Blank as Ie } from "./bundle.es38.js";
|
|
38
38
|
import { ProgressRing as ke } from "./bundle.es39.js";
|
|
39
|
-
import { WriteBar as
|
|
39
|
+
import { WriteBar as be } from "./bundle.es40.js";
|
|
40
40
|
import { Editor as Oe } from "./bundle.es41.js";
|
|
41
|
-
import { DropArea as ze, DropAreaProvider as
|
|
41
|
+
import { DropArea as ze, DropAreaProvider as Le, useDragEnter as we } from "./bundle.es42.js";
|
|
42
42
|
import { Table as Me } from "./bundle.es43.js";
|
|
43
43
|
import { ThemeProvider as Ne, useTheme as Ge } from "./bundle.es44.js";
|
|
44
44
|
import { ColorSchemeScript as Ee, colorSchemeScript as Ye } from "./bundle.es45.js";
|
|
45
|
-
import {
|
|
46
|
-
import { useBooleanState as
|
|
47
|
-
import { useResizeTextarea as
|
|
48
|
-
import { useLoading as
|
|
49
|
-
import { NowContextProvider as
|
|
50
|
-
import { createAlertAgent as
|
|
51
|
-
import { createToaster as
|
|
52
|
-
import { Toast as
|
|
53
|
-
import { DialogShell as
|
|
54
|
-
import { createPopoversRegistry as
|
|
55
|
-
import { createScope as
|
|
56
|
-
import { RemoveListener as
|
|
57
|
-
import { MONDAY as
|
|
45
|
+
import { LocalStorageProvider as qe, useLocalStorage as He } from "./bundle.es46.js";
|
|
46
|
+
import { useBooleanState as Ke } from "./bundle.es47.js";
|
|
47
|
+
import { useResizeTextarea as Ue } from "./bundle.es48.js";
|
|
48
|
+
import { useLoading as Xe } from "./bundle.es49.js";
|
|
49
|
+
import { NowContextProvider as _e, useNow as $e } from "./bundle.es50.js";
|
|
50
|
+
import { createAlertAgent as rr } from "./bundle.es51.js";
|
|
51
|
+
import { createToaster as tr } from "./bundle.es52.js";
|
|
52
|
+
import { Toast as mr } from "./bundle.es53.js";
|
|
53
|
+
import { DialogShell as xr, DrawerShell as fr, createPopupRegistry as ir, usePopup as sr } from "./bundle.es54.js";
|
|
54
|
+
import { createPopoversRegistry as lr } from "./bundle.es55.js";
|
|
55
|
+
import { createScope as Sr, createStaticScope as ur } from "./bundle.es56.js";
|
|
56
|
+
import { RemoveListener as Dr } from "./bundle.es57.js";
|
|
57
|
+
import { MONDAY as hr, addMonths as Pr, createDayDisableChecker as Br, endOfDay as yr, endOfWeek as Ir, isDayMinMaxRestricted as Tr, isSameDate as kr, setMonth as vr, setYear as br, startOfDay as Ar, startOfWeek as Or, subMonths as Rr, useDayDisableCheker as zr } from "./bundle.es58.js";
|
|
58
58
|
export {
|
|
59
59
|
Z as AlertDialog,
|
|
60
60
|
o as Avatar,
|
|
@@ -67,11 +67,11 @@ export {
|
|
|
67
67
|
ie as DateInput,
|
|
68
68
|
xe as DatePicker,
|
|
69
69
|
Q as Dialog,
|
|
70
|
-
|
|
70
|
+
xr as DialogShell,
|
|
71
71
|
J as Drawer,
|
|
72
|
-
|
|
72
|
+
fr as DrawerShell,
|
|
73
73
|
ze as DropArea,
|
|
74
|
-
|
|
74
|
+
Le as DropAreaProvider,
|
|
75
75
|
Oe as Editor,
|
|
76
76
|
ne as FileOverlay,
|
|
77
77
|
ce as FormGroup,
|
|
@@ -79,10 +79,11 @@ export {
|
|
|
79
79
|
d as ImitateScroll,
|
|
80
80
|
R as Input,
|
|
81
81
|
$ as LoadingButton,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
qe as LocalStorageProvider,
|
|
83
|
+
hr as MONDAY,
|
|
84
|
+
_e as NowContextProvider,
|
|
85
|
+
C as NumberInput,
|
|
86
|
+
L as OptionItem,
|
|
86
87
|
F as OptionsList,
|
|
87
88
|
y as Popover,
|
|
88
89
|
V as PopupLayout,
|
|
@@ -90,12 +91,12 @@ export {
|
|
|
90
91
|
ke as ProgressRing,
|
|
91
92
|
j as Radio,
|
|
92
93
|
q as RadioGroup,
|
|
93
|
-
|
|
94
|
+
Dr as RemoveListener,
|
|
94
95
|
g as Scrollable,
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
P as Segments,
|
|
97
|
+
v as Select,
|
|
97
98
|
A as SelectTags,
|
|
98
|
-
|
|
99
|
+
Be as Skeleton,
|
|
99
100
|
S as Spinner,
|
|
100
101
|
E as Switch,
|
|
101
102
|
Me as Table,
|
|
@@ -103,38 +104,38 @@ export {
|
|
|
103
104
|
me as TextArea,
|
|
104
105
|
Ne as ThemeProvider,
|
|
105
106
|
ue as TimePicker,
|
|
106
|
-
|
|
107
|
+
mr as Toast,
|
|
107
108
|
T as Tooltip,
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
be as WriteBar,
|
|
110
|
+
Pr as addMonths,
|
|
110
111
|
p as avatarSizes,
|
|
111
112
|
Ye as colorSchemeScript,
|
|
112
|
-
|
|
113
|
+
rr as createAlertAgent,
|
|
113
114
|
Br as createDayDisableChecker,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
lr as createPopoversRegistry,
|
|
116
|
+
ir as createPopupRegistry,
|
|
117
|
+
Sr as createScope,
|
|
118
|
+
ur as createStaticScope,
|
|
119
|
+
tr as createToaster,
|
|
120
|
+
yr as endOfDay,
|
|
121
|
+
Ir as endOfWeek,
|
|
121
122
|
a as getBadgeIconSizeByImageBaseSize,
|
|
122
123
|
x as getFallbackIconSizeByImageBaseSize,
|
|
123
124
|
f as getInitialsFontSize,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
Tr as isDayMinMaxRestricted,
|
|
126
|
+
kr as isSameDate,
|
|
127
|
+
vr as setMonth,
|
|
127
128
|
br as setYear,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
Ar as startOfDay,
|
|
130
|
+
Or as startOfWeek,
|
|
131
|
+
Rr as subMonths,
|
|
132
|
+
Ke as useBooleanState,
|
|
133
|
+
zr as useDayDisableCheker,
|
|
134
|
+
we as useDragEnter,
|
|
135
|
+
Xe as useLoading,
|
|
136
|
+
He as useLocalStorage,
|
|
137
|
+
$e as useNow,
|
|
138
|
+
sr as usePopup,
|
|
139
|
+
Ue as useResizeTextarea,
|
|
139
140
|
Ge as useTheme
|
|
140
141
|
};
|
package/dist/bundle.es46.js
CHANGED
|
@@ -1,13 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { EventEmmiter as g } from "@companix/utils-js";
|
|
3
|
+
import { useContext as S, createContext as l, useState as f, useEffect as n, useRef as w } from "react";
|
|
4
|
+
const a = l({});
|
|
5
|
+
class d {
|
|
6
|
+
constructor(e) {
|
|
7
|
+
this.emmiter = e;
|
|
8
|
+
}
|
|
9
|
+
getStorageValue(e, t) {
|
|
10
|
+
if (typeof window > "u")
|
|
11
|
+
return t;
|
|
4
12
|
const r = localStorage.getItem(e);
|
|
5
|
-
return r ? JSON.parse(r) :
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
localStorage.setItem(e, JSON.stringify(t));
|
|
9
|
-
}
|
|
13
|
+
return r ? JSON.parse(r) : t;
|
|
14
|
+
}
|
|
15
|
+
setValue(e, t) {
|
|
16
|
+
localStorage.setItem(e, JSON.stringify(t)), this.emmiter.emit(e, t);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const x = (o, e) => {
|
|
20
|
+
const t = S(a), [r, i] = f(() => t.getStorageValue(o, e));
|
|
21
|
+
n(() => {
|
|
22
|
+
i(t.getStorageValue(o, e));
|
|
23
|
+
}, [o]);
|
|
24
|
+
const c = (s) => {
|
|
25
|
+
t.setValue(o, s);
|
|
26
|
+
};
|
|
27
|
+
return n(() => {
|
|
28
|
+
const s = t.emmiter.subscribe(o, (u) => {
|
|
29
|
+
i(u);
|
|
30
|
+
});
|
|
31
|
+
return () => {
|
|
32
|
+
s();
|
|
33
|
+
};
|
|
34
|
+
}, [o]), [r, c];
|
|
35
|
+
}, y = ({ children: o }) => {
|
|
36
|
+
const e = w(new d(new g()));
|
|
37
|
+
return n(() => {
|
|
38
|
+
if (!window || !e.current)
|
|
39
|
+
return;
|
|
40
|
+
const t = (r) => {
|
|
41
|
+
r.key && e.current.emmiter.store[r.key] && r.newValue && e.current.emmiter.emit(r.key, JSON.parse(r.newValue));
|
|
42
|
+
};
|
|
43
|
+
return window.addEventListener("storage", t), () => {
|
|
44
|
+
window.removeEventListener("storage", t);
|
|
45
|
+
};
|
|
46
|
+
}, []), /* @__PURE__ */ m(a.Provider, { value: e.current, children: o });
|
|
10
47
|
};
|
|
11
48
|
export {
|
|
12
|
-
|
|
49
|
+
y as LocalStorageProvider,
|
|
50
|
+
d as LocalStorageService,
|
|
51
|
+
x as useLocalStorage
|
|
13
52
|
};
|
package/dist/bundle.es9.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export { Table } from './Table';
|
|
|
81
81
|
export type { TableProps } from './Table';
|
|
82
82
|
export { ThemeProvider, useTheme } from './ThemeProvider';
|
|
83
83
|
export { ColorSchemeScript, colorSchemeScript } from './ThemeProvider/script';
|
|
84
|
-
export { useLocalStorage } from './__hooks/use-local-storage';
|
|
84
|
+
export { useLocalStorage, LocalStorageProvider } from './__hooks/use-local-storage';
|
|
85
85
|
export { useBooleanState } from './__hooks/use-boolean-state';
|
|
86
86
|
export { useResizeTextarea } from './__hooks/use-resize';
|
|
87
87
|
export { useLoading } from './__hooks/use-loading';
|