fui-material 1.17.0 → 1.17.1
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/f-ui-kit.es.js
CHANGED
|
@@ -646,44 +646,49 @@ const Un = ({
|
|
|
646
646
|
fullWidth: l,
|
|
647
647
|
id: u,
|
|
648
648
|
type: m = "button"
|
|
649
|
-
}) =>
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
} :
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
649
|
+
}) => {
|
|
650
|
+
let v = a !== void 0 ? { ...a } : void 0;
|
|
651
|
+
return l ? v === void 0 ? v = {
|
|
652
|
+
width: "100%"
|
|
653
|
+
} : v.width = "100%" : v === void 0 ? v = {
|
|
654
|
+
width: "fit-content"
|
|
655
|
+
} : v.width = "fit-content", /* @__PURE__ */ x.jsx(
|
|
656
|
+
"button",
|
|
657
|
+
{
|
|
658
|
+
disabled: n,
|
|
659
|
+
type: m,
|
|
660
|
+
className: `btn ${e === "contained" ? "btn" : "btn-default"}-${t} ${r} ${o !== void 0 ? o : ""}`,
|
|
661
|
+
onClick: s,
|
|
662
|
+
style: a,
|
|
663
|
+
id: u,
|
|
664
|
+
children: i
|
|
665
|
+
}
|
|
666
|
+
);
|
|
667
|
+
}, Re = ({
|
|
665
668
|
children: i,
|
|
666
669
|
alignItems: e,
|
|
667
670
|
justifyContent: t,
|
|
668
671
|
direction: r = "column",
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
672
|
+
wrap: n,
|
|
673
|
+
spacing: s = 0,
|
|
674
|
+
className: a,
|
|
675
|
+
st: o,
|
|
676
|
+
id: l
|
|
673
677
|
}) => {
|
|
674
|
-
let
|
|
675
|
-
gap: `${+
|
|
678
|
+
let u = {
|
|
679
|
+
gap: `${+s * 8}px`,
|
|
676
680
|
display: "flex",
|
|
677
681
|
flexDirection: r,
|
|
678
682
|
justifyContent: t,
|
|
679
|
-
alignItems: e
|
|
683
|
+
alignItems: e,
|
|
684
|
+
flexWrap: n
|
|
680
685
|
};
|
|
681
|
-
return
|
|
686
|
+
return o !== void 0 && (u = Object.assign(u, o)), /* @__PURE__ */ x.jsx(
|
|
682
687
|
"div",
|
|
683
688
|
{
|
|
684
|
-
className:
|
|
685
|
-
style:
|
|
686
|
-
id:
|
|
689
|
+
className: a,
|
|
690
|
+
style: u,
|
|
691
|
+
id: l,
|
|
687
692
|
children: i
|
|
688
693
|
}
|
|
689
694
|
);
|
|
@@ -9071,29 +9076,29 @@ ke.formToJSON = (i) => or(H.isHTMLForm(i) ? new FormData(i) : i);
|
|
|
9071
9076
|
ke.getAdapter = mr.getAdapter;
|
|
9072
9077
|
ke.HttpStatusCode = nn;
|
|
9073
9078
|
ke.default = ke;
|
|
9074
|
-
const Ma = () => {
|
|
9075
|
-
const [
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
r(!0), s(null);
|
|
9079
|
+
const Ma = ({ doNotUseState: i = !1, defaultState: e = null }) => {
|
|
9080
|
+
const [t, r] = ze(e), [n, s] = ze(!1), [a, o] = ze(null), l = async (m) => {
|
|
9081
|
+
var v, b, d;
|
|
9082
|
+
s(!0), o(null);
|
|
9079
9083
|
try {
|
|
9080
|
-
const
|
|
9081
|
-
return
|
|
9082
|
-
} catch (
|
|
9083
|
-
const
|
|
9084
|
+
const p = await ke(m);
|
|
9085
|
+
return i || r(p.data), p.data;
|
|
9086
|
+
} catch (p) {
|
|
9087
|
+
const f = p, h = ((b = (v = f.response) == null ? void 0 : v.data) == null ? void 0 : b.message) || f.message || "Unknown error";
|
|
9084
9088
|
return li({
|
|
9085
9089
|
variant: "error",
|
|
9086
9090
|
title: "Ошибка",
|
|
9087
|
-
body: `- При отправке данных произошла ошибка ${(
|
|
9088
|
-
- ${
|
|
9091
|
+
body: `- При отправке данных произошла ошибка ${(d = f.response) == null ? void 0 : d.status}
|
|
9092
|
+
- ${h}`,
|
|
9089
9093
|
timeSecClose: 5
|
|
9090
|
-
}),
|
|
9094
|
+
}), o(h), null;
|
|
9091
9095
|
} finally {
|
|
9092
|
-
|
|
9096
|
+
s(!1);
|
|
9093
9097
|
}
|
|
9094
|
-
},
|
|
9095
|
-
|
|
9096
|
-
}
|
|
9098
|
+
}, u = (m) => {
|
|
9099
|
+
r(m);
|
|
9100
|
+
};
|
|
9101
|
+
return i ? { loading: n, error: a, execute: l } : { data: t, loading: n, error: a, execute: l, reset: u };
|
|
9097
9102
|
};
|
|
9098
9103
|
export {
|
|
9099
9104
|
aa as FAccordion,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
2
|
export type IUseFApi<T> = {
|
|
3
|
-
data
|
|
3
|
+
data?: T | null;
|
|
4
4
|
loading: boolean;
|
|
5
5
|
error: string | null;
|
|
6
6
|
execute: (config: AxiosRequestConfig) => Promise<T | null>;
|
|
7
|
-
reset
|
|
7
|
+
reset?: (newData: T | null) => void;
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
type IProps<T> = {
|
|
10
|
+
doNotUseState?: boolean;
|
|
11
|
+
defaultState?: T | null;
|
|
12
|
+
};
|
|
13
|
+
declare const useFApi: <T>({ doNotUseState, defaultState }: IProps<T>) => IUseFApi<T>;
|
|
10
14
|
export default useFApi;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fui-material",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dev": "vite",
|
|
13
13
|
"build:types": "tsc --project tsconfig.build.json",
|
|
14
14
|
"build": "vite build && npm run build:types",
|
|
15
|
-
"publish": "npm run build",
|
|
15
|
+
"build-publish": "vite build && npm run build:types && npm publish",
|
|
16
16
|
"lint": "eslint .",
|
|
17
17
|
"preview": "vite preview"
|
|
18
18
|
},
|
|
@@ -46,4 +46,4 @@
|
|
|
46
46
|
"dist",
|
|
47
47
|
"dist/types"
|
|
48
48
|
]
|
|
49
|
-
}
|
|
49
|
+
}
|