@dartcom/ui-kit 10.3.9 → 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 CHANGED
@@ -30,8 +30,6 @@ npm run build
30
30
  // Проверьте содержимое пакета
31
31
  npm pack
32
32
 
33
- git push origin v3.8.16
34
-
35
33
  Основные ссылки
36
34
 
37
35
  ```javascript
@@ -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,CA4BxD,CAAC;AAEF,eAAe,UAAU,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"}
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
- removeState('access_token');
22096
- removeState('token_type');
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 = loadState('access_token');
22166
- const token_type = loadState('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
- saveState('access_token', access_token);
25158
- saveState('token_type', token_type);
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, shadows } = theme;
29681
+ const { spacing } = theme;
29654
29682
  return {
29655
29683
  p: spacing(2),
29656
29684
  borderRadius: '12px',
29657
- boxShadow: shadows,
29658
- maxHeight: '85vh',
29659
- maxWidth: '85vw',
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
  };
@@ -46729,21 +46763,6 @@ const AuthPage = ({ onSuccess, onError }) => {
46729
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" })] }) }));
46730
46764
  };
46731
46765
 
46732
- /* eslint-disable no-console */
46733
- class LoggerService {
46734
- constructor() { }
46735
- log({ message, context, meta, }) {
46736
- console.log(context, message, meta);
46737
- }
46738
- warn({ message, context, meta, }) {
46739
- console.warn(context, message, meta);
46740
- }
46741
- error({ message, context, meta, }) {
46742
- console.error(context, message, meta);
46743
- }
46744
- }
46745
- const loggerService = new LoggerService();
46746
-
46747
46766
  // define() gets called for each chunk generated by the first Rollup pass.
46748
46767
  // The order the chunks are called in is controlled by the imports in bundle.js:
46749
46768
  //
@@ -47917,7 +47936,7 @@ exports.getUrlencodedBody = getUrlencodedBody;
47917
47936
  exports.getValidLayer = getValidLayer;
47918
47937
  exports.getWaterAreaLayers = getWaterAreaLayers;
47919
47938
  exports.getWaterLinkLayers = getWaterLinkLayers;
47920
- exports.loadState = loadState;
47939
+ exports.localStateService = localStateService;
47921
47940
  exports.loggerService = loggerService;
47922
47941
  exports.modalStore = modalStore;
47923
47942
  exports.modalStyle = modalStyle;
@@ -47926,9 +47945,7 @@ exports.numberSchema = numberSchema;
47926
47945
  exports.parseTrafficSignCSVFile = parseTrafficSignCSVFile;
47927
47946
  exports.pillarConfig = pillarConfig;
47928
47947
  exports.queryClient = queryClient;
47929
- exports.removeState = removeState;
47930
47948
  exports.rootStore = rootStore;
47931
- exports.saveState = saveState;
47932
47949
  exports.showSnackbar = showSnackbar;
47933
47950
  exports.sourceUrl = sourceUrl;
47934
47951
  exports.text_source = text_source;