@dartcom/ui-kit 10.3.8 → 10.3.11
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/README.md +0 -2
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/list/list.d.ts.map +1 -1
- package/dist/components/list/list.stories.d.ts +1 -0
- package/dist/components/list/list.stories.d.ts.map +1 -1
- package/dist/index.cjs +78 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +6 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/lib/hooks/useSignIn.d.ts.map +1 -1
- package/dist/lib/utils.d.ts +1 -4
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/providers/mobx/stores/auth.d.ts.map +1 -1
- package/dist/services/api/api.d.ts.map +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/local-state/index.d.ts +2 -0
- package/dist/services/local-state/index.d.ts.map +1 -0
- package/dist/services/local-state/local-state.d.ts +11 -0
- package/dist/services/local-state/local-state.d.ts.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAmCxD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/components/list/list.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,iBAAS,UAAU,CAAC,CAAC,EAAE,EACrB,KAAK,EACL,YAAgB,EAChB,UAAU,EACV,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,EAAE,EAEF,YAAmB,GACpB,EAAE,SAAS,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/components/list/list.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,iBAAS,UAAU,CAAC,CAAC,EAAE,EACrB,KAAK,EACL,YAAgB,EAChB,UAAU,EACV,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,EAAE,EAEF,YAAmB,GACpB,EAAE,SAAS,CAAC,CAAC,CAAC,2CA0Gd;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.stories.d.ts","sourceRoot":"","sources":["../../../src/components/list/list.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAEzB,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CAQ3B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAWnB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAY3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAYzB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAYvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"list.stories.d.ts","sourceRoot":"","sources":["../../../src/components/list/list.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAEzB,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CAQ3B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAWnB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAY3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAYzB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAYvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAwBvB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAwB5B,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -16541,27 +16541,6 @@ const getImageSrc = (path) => {
|
|
|
16541
16541
|
const imageSrc = `${"https://dalganmap.ru/api-image/images"}/${path}`;
|
|
16542
16542
|
return imageSrc;
|
|
16543
16543
|
};
|
|
16544
|
-
const loadState = (name) => {
|
|
16545
|
-
try {
|
|
16546
|
-
const serializedState = localStorage.getItem(name);
|
|
16547
|
-
return serializedState ? JSON.parse(serializedState) : null;
|
|
16548
|
-
}
|
|
16549
|
-
catch {
|
|
16550
|
-
return null;
|
|
16551
|
-
}
|
|
16552
|
-
};
|
|
16553
|
-
const saveState = (name, state) => {
|
|
16554
|
-
try {
|
|
16555
|
-
const serializedState = JSON.stringify(state);
|
|
16556
|
-
localStorage.setItem(name, serializedState);
|
|
16557
|
-
}
|
|
16558
|
-
catch {
|
|
16559
|
-
return;
|
|
16560
|
-
}
|
|
16561
|
-
};
|
|
16562
|
-
const removeState = (name) => {
|
|
16563
|
-
localStorage.removeItem(name);
|
|
16564
|
-
};
|
|
16565
16544
|
|
|
16566
16545
|
var niceErrors = {
|
|
16567
16546
|
0: "Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",
|
|
@@ -22087,13 +22066,62 @@ class AlertStore {
|
|
|
22087
22066
|
}
|
|
22088
22067
|
const alertStore = new AlertStore();
|
|
22089
22068
|
|
|
22069
|
+
class LocalStateService {
|
|
22070
|
+
constructor() { }
|
|
22071
|
+
load(name) {
|
|
22072
|
+
try {
|
|
22073
|
+
const serializedState = localStorage.getItem(name);
|
|
22074
|
+
if (serializedState) {
|
|
22075
|
+
const item = JSON.parse(serializedState);
|
|
22076
|
+
return item;
|
|
22077
|
+
}
|
|
22078
|
+
return null;
|
|
22079
|
+
}
|
|
22080
|
+
catch {
|
|
22081
|
+
return null;
|
|
22082
|
+
}
|
|
22083
|
+
}
|
|
22084
|
+
save(name, value) {
|
|
22085
|
+
try {
|
|
22086
|
+
const serializedState = JSON.stringify(value);
|
|
22087
|
+
localStorage.setItem(name, serializedState);
|
|
22088
|
+
return true;
|
|
22089
|
+
}
|
|
22090
|
+
catch {
|
|
22091
|
+
return false;
|
|
22092
|
+
}
|
|
22093
|
+
}
|
|
22094
|
+
remove(name) {
|
|
22095
|
+
localStorage.removeItem(name);
|
|
22096
|
+
}
|
|
22097
|
+
clear() {
|
|
22098
|
+
localStorage.clear();
|
|
22099
|
+
}
|
|
22100
|
+
}
|
|
22101
|
+
const localStateService = new LocalStateService();
|
|
22102
|
+
|
|
22103
|
+
/* eslint-disable no-console */
|
|
22104
|
+
class LoggerService {
|
|
22105
|
+
constructor() { }
|
|
22106
|
+
log({ message, context, meta, }) {
|
|
22107
|
+
console.log(context, message, meta);
|
|
22108
|
+
}
|
|
22109
|
+
warn({ message, context, meta, }) {
|
|
22110
|
+
console.warn(context, message, meta);
|
|
22111
|
+
}
|
|
22112
|
+
error({ message, context, meta, }) {
|
|
22113
|
+
console.error(context, message, meta);
|
|
22114
|
+
}
|
|
22115
|
+
}
|
|
22116
|
+
const loggerService = new LoggerService();
|
|
22117
|
+
|
|
22090
22118
|
class AuthStore {
|
|
22091
22119
|
constructor() {
|
|
22092
22120
|
makeAutoObservable(this);
|
|
22093
22121
|
reaction(() => this.isUnauthorized, (value) => {
|
|
22094
22122
|
if (value) {
|
|
22095
|
-
|
|
22096
|
-
|
|
22123
|
+
localStateService.remove('access_token');
|
|
22124
|
+
localStateService.remove('token_type');
|
|
22097
22125
|
}
|
|
22098
22126
|
});
|
|
22099
22127
|
}
|
|
@@ -22162,8 +22190,8 @@ class ApiService {
|
|
|
22162
22190
|
this.client.interceptors.request.use((config) => {
|
|
22163
22191
|
rootStore.authStore.isUnauthorized = false;
|
|
22164
22192
|
const headers = this.config?.getHeaders?.();
|
|
22165
|
-
const access_token =
|
|
22166
|
-
const token_type =
|
|
22193
|
+
const access_token = localStateService.load('access_token');
|
|
22194
|
+
const token_type = localStateService.load('token_type');
|
|
22167
22195
|
if (access_token && token_type) {
|
|
22168
22196
|
config.headers['Authorization'] = `${token_type} ${access_token}`;
|
|
22169
22197
|
}
|
|
@@ -25154,8 +25182,8 @@ const useSignIn = () => {
|
|
|
25154
25182
|
return response;
|
|
25155
25183
|
},
|
|
25156
25184
|
onSuccess: ({ access_token, token_type }) => {
|
|
25157
|
-
|
|
25158
|
-
|
|
25185
|
+
localStateService.save('access_token', access_token);
|
|
25186
|
+
localStateService.save('token_type', token_type);
|
|
25159
25187
|
},
|
|
25160
25188
|
});
|
|
25161
25189
|
return mutation;
|
|
@@ -29650,13 +29678,19 @@ var alertDialog = observer(AlertDialog);
|
|
|
29650
29678
|
|
|
29651
29679
|
const CustomCard = ({ children, sx, ...props }) => {
|
|
29652
29680
|
return (jsxRuntime.jsx(material.Box, { ...props, sx: (theme) => {
|
|
29653
|
-
const { spacing
|
|
29681
|
+
const { spacing } = theme;
|
|
29654
29682
|
return {
|
|
29655
29683
|
p: spacing(2),
|
|
29656
29684
|
borderRadius: '12px',
|
|
29657
|
-
boxShadow:
|
|
29658
|
-
|
|
29659
|
-
|
|
29685
|
+
boxShadow: `
|
|
29686
|
+
0 1px 2px rgba(0, 0, 0, 0.08),
|
|
29687
|
+
0 2px 4px rgba(0, 0, 0, 0.08),
|
|
29688
|
+
0 4px 8px rgba(0, 0, 0, 0.08),
|
|
29689
|
+
0 8px 16px rgba(0, 0, 0, 0.08),
|
|
29690
|
+
0 16px 32px rgba(0, 0, 0, 0.08)
|
|
29691
|
+
`,
|
|
29692
|
+
maxHeight: '80vh',
|
|
29693
|
+
maxWidth: '80vw',
|
|
29660
29694
|
overflowX: 'auto',
|
|
29661
29695
|
...sx?.(theme),
|
|
29662
29696
|
};
|
|
@@ -32277,7 +32311,14 @@ const NoData = ({ text = 'Нет данных' }) => {
|
|
|
32277
32311
|
};
|
|
32278
32312
|
|
|
32279
32313
|
function CustomList({ items, columnsCount = 1, getContent, title, getKey, onClick, onClear, sx, isShowNoData = true, }) {
|
|
32280
|
-
const
|
|
32314
|
+
const isData = React__namespace.useMemo(() => {
|
|
32315
|
+
const isData = items.length > 0;
|
|
32316
|
+
return isData;
|
|
32317
|
+
}, [items.length]);
|
|
32318
|
+
const isShowClear = React__namespace.useMemo(() => {
|
|
32319
|
+
const isShowClear = Boolean(onClear) && isData;
|
|
32320
|
+
return isShowClear;
|
|
32321
|
+
}, [onClear, isData]);
|
|
32281
32322
|
return (jsxRuntime.jsxs(material.Box, { sx: ({ spacing, breakpoints }) => {
|
|
32282
32323
|
return {
|
|
32283
32324
|
display: 'grid',
|
|
@@ -32292,16 +32333,17 @@ function CustomList({ items, columnsCount = 1, getContent, title, getKey, onClic
|
|
|
32292
32333
|
return {
|
|
32293
32334
|
display: 'flex',
|
|
32294
32335
|
alignItems: 'center',
|
|
32336
|
+
justifyContent: 'center',
|
|
32295
32337
|
gap: spacing(1),
|
|
32296
32338
|
};
|
|
32297
32339
|
}, children: [title ? (jsxRuntime.jsx(material.Typography, { variant: "h6", noWrap: true, sx: {
|
|
32298
32340
|
textAlign: 'center',
|
|
32299
32341
|
fontWeight: 700,
|
|
32300
32342
|
...sx?.title,
|
|
32301
|
-
}, children: title })) : null,
|
|
32343
|
+
}, children: title })) : null, isShowClear ? (jsxRuntime.jsx(IconButton, { iconProps: {
|
|
32302
32344
|
name: 'clear',
|
|
32303
32345
|
color: 'warning',
|
|
32304
|
-
}, onClick: onClear })) : null] })) : null,
|
|
32346
|
+
}, onClick: onClear })) : null] })) : null, isData ? (jsxRuntime.jsx(material.List, { sx: ({ spacing, breakpoints }) => {
|
|
32305
32347
|
return {
|
|
32306
32348
|
display: 'grid',
|
|
32307
32349
|
gridTemplateColumns: `repeat(${columnsCount}, 1fr)`,
|
|
@@ -32315,7 +32357,7 @@ function CustomList({ items, columnsCount = 1, getContent, title, getKey, onClic
|
|
|
32315
32357
|
return {
|
|
32316
32358
|
...sx?.item,
|
|
32317
32359
|
};
|
|
32318
|
-
}, disablePadding: true, children: getContent(item, index) }, getKey(item, index)))) }))] }));
|
|
32360
|
+
}, disablePadding: true, children: getContent(item, index) }, getKey(item, index)))) })) : (jsxRuntime.jsx(React__namespace.Fragment, { children: isShowNoData ? jsxRuntime.jsx(NoData, {}) : null }))] }));
|
|
32319
32361
|
}
|
|
32320
32362
|
|
|
32321
32363
|
function useCombinedRefs() {
|
|
@@ -46721,21 +46763,6 @@ const AuthPage = ({ onSuccess, onError }) => {
|
|
|
46721
46763
|
}, children: [jsxRuntime.jsx(material.Typography, { variant: "h4", children: "\u0410\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u044F" }), jsxRuntime.jsx(CustomInput, { ...register('username'), label: "\u041B\u043E\u0433\u0438\u043D", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043B\u043E\u0433\u0438\u043D" }), jsxRuntime.jsx(CustomInput, { ...register('password'), label: "\u041F\u0430\u0440\u043E\u043B\u044C", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043F\u0430\u0440\u043E\u043B\u044C", type: "password" }), jsxRuntime.jsx(Button, { type: "submit", disabled: !isValid, children: "\u0412\u043E\u0439\u0442\u0438" })] }) }));
|
|
46722
46764
|
};
|
|
46723
46765
|
|
|
46724
|
-
/* eslint-disable no-console */
|
|
46725
|
-
class LoggerService {
|
|
46726
|
-
constructor() { }
|
|
46727
|
-
log({ message, context, meta, }) {
|
|
46728
|
-
console.log(context, message, meta);
|
|
46729
|
-
}
|
|
46730
|
-
warn({ message, context, meta, }) {
|
|
46731
|
-
console.warn(context, message, meta);
|
|
46732
|
-
}
|
|
46733
|
-
error({ message, context, meta, }) {
|
|
46734
|
-
console.error(context, message, meta);
|
|
46735
|
-
}
|
|
46736
|
-
}
|
|
46737
|
-
const loggerService = new LoggerService();
|
|
46738
|
-
|
|
46739
46766
|
// define() gets called for each chunk generated by the first Rollup pass.
|
|
46740
46767
|
// The order the chunks are called in is controlled by the imports in bundle.js:
|
|
46741
46768
|
//
|
|
@@ -47909,7 +47936,7 @@ exports.getUrlencodedBody = getUrlencodedBody;
|
|
|
47909
47936
|
exports.getValidLayer = getValidLayer;
|
|
47910
47937
|
exports.getWaterAreaLayers = getWaterAreaLayers;
|
|
47911
47938
|
exports.getWaterLinkLayers = getWaterLinkLayers;
|
|
47912
|
-
exports.
|
|
47939
|
+
exports.localStateService = localStateService;
|
|
47913
47940
|
exports.loggerService = loggerService;
|
|
47914
47941
|
exports.modalStore = modalStore;
|
|
47915
47942
|
exports.modalStyle = modalStyle;
|
|
@@ -47918,9 +47945,7 @@ exports.numberSchema = numberSchema;
|
|
|
47918
47945
|
exports.parseTrafficSignCSVFile = parseTrafficSignCSVFile;
|
|
47919
47946
|
exports.pillarConfig = pillarConfig;
|
|
47920
47947
|
exports.queryClient = queryClient;
|
|
47921
|
-
exports.removeState = removeState;
|
|
47922
47948
|
exports.rootStore = rootStore;
|
|
47923
|
-
exports.saveState = saveState;
|
|
47924
47949
|
exports.showSnackbar = showSnackbar;
|
|
47925
47950
|
exports.sourceUrl = sourceUrl;
|
|
47926
47951
|
exports.text_source = text_source;
|