@dartcom/ui-kit 10.0.6 → 10.0.8
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/components/date-field/date-field.d.ts +4 -0
- package/dist/components/date-field/date-field.d.ts.map +1 -0
- package/dist/components/date-field/date-field.stories.d.ts +7 -0
- package/dist/components/date-field/date-field.stories.d.ts.map +1 -0
- package/dist/components/date-field/index.d.ts +2 -0
- package/dist/components/date-field/index.d.ts.map +1 -0
- package/dist/components/date-field/types.d.ts +6 -0
- package/dist/components/date-field/types.d.ts.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/layers/leaflet/layers/traffic-sign/constants.d.ts +23 -0
- package/dist/components/layers/leaflet/layers/traffic-sign/constants.d.ts.map +1 -1
- package/dist/components/layers/leaflet/layers/traffic-sign/types.d.ts +8 -11
- package/dist/components/layers/leaflet/layers/traffic-sign/types.d.ts.map +1 -1
- package/dist/components/layers/leaflet/layers/traffic-sign/utils.d.ts +4 -0
- package/dist/components/layers/leaflet/layers/traffic-sign/utils.d.ts.map +1 -1
- package/dist/components/select/types.d.ts +1 -1
- package/dist/components/select/types.d.ts.map +1 -1
- package/dist/components/text-field/text-field.d.ts +2 -2
- package/dist/components/text-field/text-field.d.ts.map +1 -1
- package/dist/index.cjs +280 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -16,6 +16,7 @@ var Box = require('@mui/material/Box');
|
|
|
16
16
|
var Modal = require('@mui/material/Modal');
|
|
17
17
|
var xDatePickers = require('@mui/x-date-pickers');
|
|
18
18
|
var AdapterDateFns = require('@mui/x-date-pickers/AdapterDateFns');
|
|
19
|
+
var DateField$1 = require('@mui/x-date-pickers/DateField');
|
|
19
20
|
|
|
20
21
|
function _interopNamespaceDefault(e) {
|
|
21
22
|
var n = Object.create(null);
|
|
@@ -145,29 +146,23 @@ var isWeb = typeof window !== 'undefined' &&
|
|
|
145
146
|
typeof document !== 'undefined';
|
|
146
147
|
|
|
147
148
|
function cloneObject(data) {
|
|
148
|
-
let copy;
|
|
149
|
-
const isArray = Array.isArray(data);
|
|
150
|
-
const isFileListInstance = typeof FileList !== 'undefined' ? data instanceof FileList : false;
|
|
151
149
|
if (data instanceof Date) {
|
|
152
|
-
|
|
150
|
+
return new Date(data);
|
|
153
151
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
if (!isArray && !isPlainObject$3(data)) {
|
|
158
|
-
copy = data;
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
for (const key in data) {
|
|
162
|
-
if (data.hasOwnProperty(key)) {
|
|
163
|
-
copy[key] = cloneObject(data[key]);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
152
|
+
const isFileListInstance = typeof FileList !== 'undefined' && data instanceof FileList;
|
|
153
|
+
if (isWeb && (data instanceof Blob || isFileListInstance)) {
|
|
154
|
+
return data;
|
|
167
155
|
}
|
|
168
|
-
|
|
156
|
+
const isArray = Array.isArray(data);
|
|
157
|
+
if (!isArray && !(isObject$3(data) && isPlainObject$3(data))) {
|
|
169
158
|
return data;
|
|
170
159
|
}
|
|
160
|
+
const copy = isArray ? [] : Object.create(Object.getPrototypeOf(data));
|
|
161
|
+
for (const key in data) {
|
|
162
|
+
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
163
|
+
copy[key] = cloneObject(data[key]);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
171
166
|
return copy;
|
|
172
167
|
}
|
|
173
168
|
|
|
@@ -193,6 +188,8 @@ var get = (object, path, defaultValue) => {
|
|
|
193
188
|
|
|
194
189
|
var isBoolean$1 = (value) => typeof value === 'boolean';
|
|
195
190
|
|
|
191
|
+
var isFunction$3 = (value) => typeof value === 'function';
|
|
192
|
+
|
|
196
193
|
var set = (object, path, value) => {
|
|
197
194
|
let index = -1;
|
|
198
195
|
const tempPath = isKey(path) ? [path] : stringToPath(path);
|
|
@@ -616,12 +613,12 @@ function useController(props) {
|
|
|
616
613
|
}), [name, control._formValues]);
|
|
617
614
|
const ref = React.useCallback((elm) => {
|
|
618
615
|
const field = get(control._fields, name);
|
|
619
|
-
if (field && elm) {
|
|
616
|
+
if (field && field._f && elm) {
|
|
620
617
|
field._f.ref = {
|
|
621
|
-
focus: () => elm.focus && elm.focus(),
|
|
622
|
-
select: () => elm.select && elm.select(),
|
|
623
|
-
setCustomValidity: (message) => elm.setCustomValidity(message),
|
|
624
|
-
reportValidity: () => elm.reportValidity(),
|
|
618
|
+
focus: () => isFunction$3(elm.focus) && elm.focus(),
|
|
619
|
+
select: () => isFunction$3(elm.select) && elm.select(),
|
|
620
|
+
setCustomValidity: (message) => isFunction$3(elm.setCustomValidity) && elm.setCustomValidity(message),
|
|
621
|
+
reportValidity: () => isFunction$3(elm.reportValidity) && elm.reportValidity(),
|
|
625
622
|
};
|
|
626
623
|
}
|
|
627
624
|
}, [control._fields, name]);
|
|
@@ -792,8 +789,6 @@ var isEmptyObject$1 = (value) => isObject$3(value) && !Object.keys(value).length
|
|
|
792
789
|
|
|
793
790
|
var isFileInput = (element) => element.type === 'file';
|
|
794
791
|
|
|
795
|
-
var isFunction$3 = (value) => typeof value === 'function';
|
|
796
|
-
|
|
797
792
|
var isHTMLElement$1 = (value) => {
|
|
798
793
|
if (!isWeb) {
|
|
799
794
|
return false;
|
|
@@ -1361,6 +1356,7 @@ function createFormControl(props = {}) {
|
|
|
1361
1356
|
action: false,
|
|
1362
1357
|
mount: false,
|
|
1363
1358
|
watch: false,
|
|
1359
|
+
keepIsValid: false,
|
|
1364
1360
|
};
|
|
1365
1361
|
let _names = {
|
|
1366
1362
|
mount: new Set(),
|
|
@@ -1371,7 +1367,7 @@ function createFormControl(props = {}) {
|
|
|
1371
1367
|
};
|
|
1372
1368
|
let delayErrorCallback;
|
|
1373
1369
|
let timer = 0;
|
|
1374
|
-
const
|
|
1370
|
+
const defaultProxyFormState = {
|
|
1375
1371
|
isDirty: false,
|
|
1376
1372
|
dirtyFields: false,
|
|
1377
1373
|
validatingFields: false,
|
|
@@ -1380,6 +1376,9 @@ function createFormControl(props = {}) {
|
|
|
1380
1376
|
isValid: false,
|
|
1381
1377
|
errors: false,
|
|
1382
1378
|
};
|
|
1379
|
+
const _proxyFormState = {
|
|
1380
|
+
...defaultProxyFormState,
|
|
1381
|
+
};
|
|
1383
1382
|
let _proxySubscribeFormState = {
|
|
1384
1383
|
..._proxyFormState,
|
|
1385
1384
|
};
|
|
@@ -1393,13 +1392,21 @@ function createFormControl(props = {}) {
|
|
|
1393
1392
|
timer = setTimeout(callback, wait);
|
|
1394
1393
|
};
|
|
1395
1394
|
const _setValid = async (shouldUpdateValid) => {
|
|
1395
|
+
if (_state.keepIsValid) {
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1396
1398
|
if (!_options.disabled &&
|
|
1397
1399
|
(_proxyFormState.isValid ||
|
|
1398
1400
|
_proxySubscribeFormState.isValid ||
|
|
1399
1401
|
shouldUpdateValid)) {
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1402
|
+
let isValid;
|
|
1403
|
+
if (_options.resolver) {
|
|
1404
|
+
isValid = isEmptyObject$1((await _runSchema()).errors);
|
|
1405
|
+
_updateIsValidating();
|
|
1406
|
+
}
|
|
1407
|
+
else {
|
|
1408
|
+
isValid = await executeBuiltInValidation(_fields, true);
|
|
1409
|
+
}
|
|
1403
1410
|
if (isValid !== _formState.isValid) {
|
|
1404
1411
|
_subjects.state.next({
|
|
1405
1412
|
isValid,
|
|
@@ -1562,11 +1569,11 @@ function createFormControl(props = {}) {
|
|
|
1562
1569
|
const _runSchema = async (name) => {
|
|
1563
1570
|
_updateIsValidating(name, true);
|
|
1564
1571
|
const result = await _options.resolver(_formValues, _options.context, getResolverOptions(name || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));
|
|
1565
|
-
_updateIsValidating(name);
|
|
1566
1572
|
return result;
|
|
1567
1573
|
};
|
|
1568
1574
|
const executeSchemaAndUpdateState = async (names) => {
|
|
1569
1575
|
const { errors } = await _runSchema(names);
|
|
1576
|
+
_updateIsValidating(names);
|
|
1570
1577
|
if (names) {
|
|
1571
1578
|
for (const name of names) {
|
|
1572
1579
|
const error = get(errors, name);
|
|
@@ -1802,6 +1809,7 @@ function createFormControl(props = {}) {
|
|
|
1802
1809
|
!isBlurEvent && watched && _subjects.state.next({ ..._formState });
|
|
1803
1810
|
if (_options.resolver) {
|
|
1804
1811
|
const { errors } = await _runSchema([name]);
|
|
1812
|
+
_updateIsValidating([name]);
|
|
1805
1813
|
_updateIsFieldValueUpdated(fieldValue);
|
|
1806
1814
|
if (isFieldValueUpdated) {
|
|
1807
1815
|
const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);
|
|
@@ -1947,7 +1955,10 @@ function createFormControl(props = {}) {
|
|
|
1947
1955
|
};
|
|
1948
1956
|
return _subscribe({
|
|
1949
1957
|
...props,
|
|
1950
|
-
formState:
|
|
1958
|
+
formState: {
|
|
1959
|
+
...defaultProxyFormState,
|
|
1960
|
+
...props.formState,
|
|
1961
|
+
},
|
|
1951
1962
|
});
|
|
1952
1963
|
};
|
|
1953
1964
|
const unregister = (name, options = {}) => {
|
|
@@ -2100,6 +2111,7 @@ function createFormControl(props = {}) {
|
|
|
2100
2111
|
});
|
|
2101
2112
|
if (_options.resolver) {
|
|
2102
2113
|
const { errors, values } = await _runSchema();
|
|
2114
|
+
_updateIsValidating();
|
|
2103
2115
|
_formState.errors = errors;
|
|
2104
2116
|
fieldValues = cloneObject(values);
|
|
2105
2117
|
}
|
|
@@ -2240,6 +2252,7 @@ function createFormControl(props = {}) {
|
|
|
2240
2252
|
!!keepStateOptions.keepDirtyValues ||
|
|
2241
2253
|
(!_options.shouldUnregister && !isEmptyObject$1(values));
|
|
2242
2254
|
_state.watch = !!_options.shouldUnregister;
|
|
2255
|
+
_state.keepIsValid = !!keepStateOptions.keepIsValid;
|
|
2243
2256
|
_state.action = false;
|
|
2244
2257
|
// Clear errors synchronously to prevent validation errors on subsequent submissions
|
|
2245
2258
|
// This fixes the issue where form.reset() causes validation errors on subsequent
|
|
@@ -2284,7 +2297,7 @@ function createFormControl(props = {}) {
|
|
|
2284
2297
|
};
|
|
2285
2298
|
const reset = (formValues, keepStateOptions) => _reset(isFunction$3(formValues)
|
|
2286
2299
|
? formValues(_formValues)
|
|
2287
|
-
: formValues, keepStateOptions);
|
|
2300
|
+
: formValues, { ..._options.resetOptions, ...keepStateOptions });
|
|
2288
2301
|
const setFocus = (name, options = {}) => {
|
|
2289
2302
|
const field = get(_fields, name);
|
|
2290
2303
|
const fieldReference = field && field._f;
|
|
@@ -2293,10 +2306,14 @@ function createFormControl(props = {}) {
|
|
|
2293
2306
|
? fieldReference.refs[0]
|
|
2294
2307
|
: fieldReference.ref;
|
|
2295
2308
|
if (fieldRef.focus) {
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
fieldRef.
|
|
2309
|
+
// Use setTimeout to ensure focus happens after any pending state updates
|
|
2310
|
+
// This fixes the issue where setFocus doesn't work immediately after setError
|
|
2311
|
+
setTimeout(() => {
|
|
2312
|
+
fieldRef.focus();
|
|
2313
|
+
options.shouldSelect &&
|
|
2314
|
+
isFunction$3(fieldRef.select) &&
|
|
2315
|
+
fieldRef.select();
|
|
2316
|
+
});
|
|
2300
2317
|
}
|
|
2301
2318
|
}
|
|
2302
2319
|
};
|
|
@@ -2322,6 +2339,7 @@ function createFormControl(props = {}) {
|
|
|
2322
2339
|
setError,
|
|
2323
2340
|
_subscribe,
|
|
2324
2341
|
_runSchema,
|
|
2342
|
+
_updateIsValidating,
|
|
2325
2343
|
_focusError,
|
|
2326
2344
|
_getWatch,
|
|
2327
2345
|
_getDirty,
|
|
@@ -2608,7 +2626,7 @@ const useFormContext = () => {
|
|
|
2608
2626
|
return formContext;
|
|
2609
2627
|
};
|
|
2610
2628
|
|
|
2611
|
-
const
|
|
2629
|
+
const TextField = (props) => {
|
|
2612
2630
|
return jsxRuntime.jsx(material.TextField, { size: "small", ...props });
|
|
2613
2631
|
};
|
|
2614
2632
|
|
|
@@ -2624,14 +2642,14 @@ function CustomSelect({ name, items, label, sx, getLabel, getValue, getKey, }) {
|
|
|
2624
2642
|
else {
|
|
2625
2643
|
resetField(name);
|
|
2626
2644
|
}
|
|
2627
|
-
}, renderInput: (params) => jsxRuntime.jsx(
|
|
2645
|
+
}, renderInput: (params) => jsxRuntime.jsx(TextField, { ...params, label: label }) }));
|
|
2628
2646
|
}
|
|
2629
2647
|
|
|
2630
2648
|
function CustomInput(props) {
|
|
2631
2649
|
const { name, type } = props;
|
|
2632
2650
|
const textFieldId = React__namespace.useId();
|
|
2633
2651
|
const { control } = useFormContext$1();
|
|
2634
|
-
return (jsxRuntime.jsx(Controller, { name: name, control: control, render: ({ field }) => (jsxRuntime.jsx(
|
|
2652
|
+
return (jsxRuntime.jsx(Controller, { name: name, control: control, render: ({ field }) => (jsxRuntime.jsx(TextField, { id: textFieldId, size: "small", ...props, ...field, onChange: (event) => {
|
|
2635
2653
|
const { target } = event;
|
|
2636
2654
|
const { value } = target;
|
|
2637
2655
|
switch (type) {
|
|
@@ -18604,21 +18622,119 @@ const getNatureForestLayers = () => {
|
|
|
18604
18622
|
return layers;
|
|
18605
18623
|
};
|
|
18606
18624
|
|
|
18625
|
+
exports.TrafficSignStatus = void 0;
|
|
18626
|
+
(function (TrafficSignStatus) {
|
|
18627
|
+
TrafficSignStatus["ACTIVE"] = "\u0414\u0435\u0439\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0439";
|
|
18628
|
+
TrafficSignStatus["INACTIVE"] = "\u041D\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0439";
|
|
18629
|
+
TrafficSignStatus["TEMPORARY"] = "\u0412\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0439";
|
|
18630
|
+
})(exports.TrafficSignStatus || (exports.TrafficSignStatus = {}));
|
|
18631
|
+
|
|
18632
|
+
const trafficSignNumbersInformation = {
|
|
18633
|
+
'1.1': {
|
|
18634
|
+
title: 'Железнодорожный переезд со шлагбаумом',
|
|
18635
|
+
height: 20,
|
|
18636
|
+
},
|
|
18637
|
+
'1.2': {
|
|
18638
|
+
title: 'Железнодорожный переезд без шлагбаума',
|
|
18639
|
+
height: 20,
|
|
18640
|
+
},
|
|
18641
|
+
'1.3.1': {
|
|
18642
|
+
title: 'Однопутная железная дорога',
|
|
18643
|
+
height: 20,
|
|
18644
|
+
},
|
|
18645
|
+
'1.3.2': {
|
|
18646
|
+
title: 'Многопутная железная дорога',
|
|
18647
|
+
height: 20,
|
|
18648
|
+
},
|
|
18649
|
+
'1.4.1': {
|
|
18650
|
+
title: 'Приближение к железнодорожному переезду',
|
|
18651
|
+
height: 40,
|
|
18652
|
+
},
|
|
18653
|
+
'1.4.2': {
|
|
18654
|
+
title: 'Приближение к железнодорожному переезду',
|
|
18655
|
+
height: 40,
|
|
18656
|
+
},
|
|
18657
|
+
'1.4.3': {
|
|
18658
|
+
title: 'Приближение к железнодорожному переезду',
|
|
18659
|
+
height: 40,
|
|
18660
|
+
},
|
|
18661
|
+
'1.4.4': {
|
|
18662
|
+
title: 'Приближение к железнодорожному переезду',
|
|
18663
|
+
height: 40,
|
|
18664
|
+
},
|
|
18665
|
+
'1.4.5': {
|
|
18666
|
+
title: 'Приближение к железнодорожному переезду',
|
|
18667
|
+
height: 40,
|
|
18668
|
+
},
|
|
18669
|
+
'1.4.6': {
|
|
18670
|
+
title: 'Приближение к железнодорожному переезду',
|
|
18671
|
+
height: 40,
|
|
18672
|
+
},
|
|
18673
|
+
'1.5': {
|
|
18674
|
+
title: 'Пересечение с трамвайной линией',
|
|
18675
|
+
height: 20,
|
|
18676
|
+
},
|
|
18677
|
+
'1.6': {
|
|
18678
|
+
title: 'Пересечение равнозначных дорог',
|
|
18679
|
+
height: 20,
|
|
18680
|
+
},
|
|
18681
|
+
'1.7': {
|
|
18682
|
+
title: 'Пересечение с круговым движением',
|
|
18683
|
+
height: 20,
|
|
18684
|
+
},
|
|
18685
|
+
'1.8': {
|
|
18686
|
+
title: 'Светофорное регулирование',
|
|
18687
|
+
height: 20,
|
|
18688
|
+
},
|
|
18689
|
+
'1.9': {
|
|
18690
|
+
title: 'Разводной мост',
|
|
18691
|
+
height: 20,
|
|
18692
|
+
},
|
|
18693
|
+
'1.10': {
|
|
18694
|
+
title: 'Выезд на набережную',
|
|
18695
|
+
height: 20,
|
|
18696
|
+
},
|
|
18697
|
+
'1.11.1': {
|
|
18698
|
+
title: 'Опасный поворот (правый)',
|
|
18699
|
+
height: 20,
|
|
18700
|
+
},
|
|
18701
|
+
'1.11.2': {
|
|
18702
|
+
title: 'Опасный поворот (левый)',
|
|
18703
|
+
height: 20,
|
|
18704
|
+
},
|
|
18705
|
+
'1.12.1': {
|
|
18706
|
+
title: 'Опасные повороты',
|
|
18707
|
+
height: 20,
|
|
18708
|
+
},
|
|
18709
|
+
'1.12.2': {
|
|
18710
|
+
title: 'Опасные повороты',
|
|
18711
|
+
height: 20,
|
|
18712
|
+
},
|
|
18713
|
+
'1.13': {
|
|
18714
|
+
title: 'Крутой спуск',
|
|
18715
|
+
height: 20,
|
|
18716
|
+
},
|
|
18717
|
+
'1.14': {
|
|
18718
|
+
title: 'Крутой подъём',
|
|
18719
|
+
height: 20,
|
|
18720
|
+
},
|
|
18721
|
+
'1.15': {
|
|
18722
|
+
title: 'Скользская дорога',
|
|
18723
|
+
height: 20,
|
|
18724
|
+
},
|
|
18725
|
+
'1.16': {
|
|
18726
|
+
title: 'Неровная дорога',
|
|
18727
|
+
height: 20,
|
|
18728
|
+
},
|
|
18729
|
+
'1.17': {
|
|
18730
|
+
title: 'Искусственная неровность',
|
|
18731
|
+
height: 20,
|
|
18732
|
+
},
|
|
18733
|
+
};
|
|
18607
18734
|
const trafficSignNumbers = [
|
|
18608
|
-
|
|
18609
|
-
'1.10',
|
|
18610
|
-
'1.11.1',
|
|
18611
|
-
'1.11.2',
|
|
18612
|
-
'1.12.1',
|
|
18613
|
-
'1.12.2',
|
|
18614
|
-
'1.13',
|
|
18615
|
-
'1.14',
|
|
18616
|
-
'1.15',
|
|
18617
|
-
'1.16',
|
|
18618
|
-
'1.17',
|
|
18735
|
+
...Object.keys(trafficSignNumbersInformation),
|
|
18619
18736
|
'1.18',
|
|
18620
18737
|
'1.19',
|
|
18621
|
-
'1.2',
|
|
18622
18738
|
'1.20.1',
|
|
18623
18739
|
'1.20.2',
|
|
18624
18740
|
'1.20.3',
|
|
@@ -18631,8 +18747,6 @@ const trafficSignNumbers = [
|
|
|
18631
18747
|
'1.27',
|
|
18632
18748
|
'1.28',
|
|
18633
18749
|
'1.29',
|
|
18634
|
-
'1.3.1',
|
|
18635
|
-
'1.3.2',
|
|
18636
18750
|
'1.30',
|
|
18637
18751
|
'1.31',
|
|
18638
18752
|
'1.32',
|
|
@@ -18646,17 +18760,6 @@ const trafficSignNumbers = [
|
|
|
18646
18760
|
'1.34.3 A',
|
|
18647
18761
|
'1.34.3 B',
|
|
18648
18762
|
'1.35',
|
|
18649
|
-
'1.4.1',
|
|
18650
|
-
'1.4.2',
|
|
18651
|
-
'1.4.3',
|
|
18652
|
-
'1.4.4',
|
|
18653
|
-
'1.4.5',
|
|
18654
|
-
'1.4.6',
|
|
18655
|
-
'1.5',
|
|
18656
|
-
'1.6',
|
|
18657
|
-
'1.7',
|
|
18658
|
-
'1.8',
|
|
18659
|
-
'1.9',
|
|
18660
18763
|
'2.1',
|
|
18661
18764
|
'2.2',
|
|
18662
18765
|
'2.3.1',
|
|
@@ -19355,6 +19458,55 @@ Object.entries(trafficSignHeights).forEach(([height, trafficSignNumbers]) => {
|
|
|
19355
19458
|
});
|
|
19356
19459
|
});
|
|
19357
19460
|
});
|
|
19461
|
+
const trafficSignTypes = trafficSignNumbers.reduce((trafficSignTypes, number) => {
|
|
19462
|
+
const type = getTrafficSignTypeByNumber(number);
|
|
19463
|
+
if (!type)
|
|
19464
|
+
return trafficSignTypes;
|
|
19465
|
+
return {
|
|
19466
|
+
...trafficSignTypes,
|
|
19467
|
+
[type]: [...trafficSignTypes[type], number],
|
|
19468
|
+
};
|
|
19469
|
+
}, {
|
|
19470
|
+
'Предупреждающие знаки': [],
|
|
19471
|
+
'Знаки приоритета': [],
|
|
19472
|
+
'Запрещающие знаки': [],
|
|
19473
|
+
'Предписывающие знаки': [],
|
|
19474
|
+
'Знаки особых предписаний': [],
|
|
19475
|
+
'Информационные знаки': [],
|
|
19476
|
+
'Знаки сервиса': [],
|
|
19477
|
+
'Знаки дополнительной информации': [],
|
|
19478
|
+
});
|
|
19479
|
+
const trafficSignTypesOptions = Object.keys(trafficSignTypes)
|
|
19480
|
+
.map((trafficSignType) => ({
|
|
19481
|
+
label: trafficSignType,
|
|
19482
|
+
value: trafficSignType,
|
|
19483
|
+
}))
|
|
19484
|
+
.filter(({ label }) => label !== 'Знаки дополнительной информации');
|
|
19485
|
+
const trafficSignStatusOptions = Object.values(exports.TrafficSignStatus).map((status) => ({
|
|
19486
|
+
label: status,
|
|
19487
|
+
value: status,
|
|
19488
|
+
}));
|
|
19489
|
+
const trafficSignFieldsTitles = {
|
|
19490
|
+
traffic_sign_id: '',
|
|
19491
|
+
dit_id: '',
|
|
19492
|
+
tsodd_id: '',
|
|
19493
|
+
pillar_id: '',
|
|
19494
|
+
dops: '',
|
|
19495
|
+
comment: 'Комментарий',
|
|
19496
|
+
direction: 'Направление',
|
|
19497
|
+
traffic_sign_number: 'Номер знака',
|
|
19498
|
+
traffic_sign_title: 'Название знака',
|
|
19499
|
+
traffic_sign_value: 'Название знака',
|
|
19500
|
+
traffic_sign_type: 'Тип знака',
|
|
19501
|
+
lat: 'Широта',
|
|
19502
|
+
lon: 'Долгота',
|
|
19503
|
+
future_maintanance_date: 'Дата следующего обслуживания',
|
|
19504
|
+
placement_date: 'Дата установки',
|
|
19505
|
+
rapair_performed_date: 'Дата последнего ремонта',
|
|
19506
|
+
verification_date: 'Дата поверки',
|
|
19507
|
+
warranty_expr_date: 'Дата окончания гарантии',
|
|
19508
|
+
status: 'Статус',
|
|
19509
|
+
};
|
|
19358
19510
|
|
|
19359
19511
|
const getTrafficSignLayers = (source) => {
|
|
19360
19512
|
const layers = [];
|
|
@@ -19414,6 +19566,52 @@ const getTrafficSignImgSrc = ({ type, number, }) => {
|
|
|
19414
19566
|
const textureUrl = `${imagesPath}/msk/${trafficSignLayerName}_${width}/${number}.${trafficSignExtension}`;
|
|
19415
19567
|
return textureUrl;
|
|
19416
19568
|
};
|
|
19569
|
+
const getTrafficSignTypeByNumber = (number) => {
|
|
19570
|
+
const firstNumber = Number(number[0]);
|
|
19571
|
+
switch (firstNumber) {
|
|
19572
|
+
case 1: {
|
|
19573
|
+
return 'Предупреждающие знаки';
|
|
19574
|
+
}
|
|
19575
|
+
case 2: {
|
|
19576
|
+
return 'Знаки приоритета';
|
|
19577
|
+
}
|
|
19578
|
+
case 3: {
|
|
19579
|
+
return 'Запрещающие знаки';
|
|
19580
|
+
}
|
|
19581
|
+
case 4: {
|
|
19582
|
+
return 'Предписывающие знаки';
|
|
19583
|
+
}
|
|
19584
|
+
case 5: {
|
|
19585
|
+
return 'Знаки особых предписаний';
|
|
19586
|
+
}
|
|
19587
|
+
case 6: {
|
|
19588
|
+
return 'Информационные знаки';
|
|
19589
|
+
}
|
|
19590
|
+
case 7: {
|
|
19591
|
+
return 'Знаки сервиса';
|
|
19592
|
+
}
|
|
19593
|
+
case 8: {
|
|
19594
|
+
return 'Знаки дополнительной информации';
|
|
19595
|
+
}
|
|
19596
|
+
default: {
|
|
19597
|
+
return null;
|
|
19598
|
+
}
|
|
19599
|
+
}
|
|
19600
|
+
};
|
|
19601
|
+
const getTrafficSignTitlesOptions = () => {
|
|
19602
|
+
const titles = new Set();
|
|
19603
|
+
const options = [];
|
|
19604
|
+
Object.values(trafficSignNumbersInformation).forEach(({ title }) => {
|
|
19605
|
+
titles.add(title);
|
|
19606
|
+
});
|
|
19607
|
+
titles.forEach((title) => {
|
|
19608
|
+
options.push({
|
|
19609
|
+
label: title,
|
|
19610
|
+
value: title,
|
|
19611
|
+
});
|
|
19612
|
+
});
|
|
19613
|
+
return options;
|
|
19614
|
+
};
|
|
19417
19615
|
|
|
19418
19616
|
const size$2 = 20;
|
|
19419
19617
|
const extension$2 = 'svg';
|
|
@@ -26357,6 +26555,16 @@ const CustomModal = ({ name, children, onClose, onOpen, }) => {
|
|
|
26357
26555
|
};
|
|
26358
26556
|
var modal = observer(CustomModal);
|
|
26359
26557
|
|
|
26558
|
+
function DateField({ name, label }) {
|
|
26559
|
+
const { control } = useFormContext$1();
|
|
26560
|
+
const id = React__namespace.useId();
|
|
26561
|
+
return (jsxRuntime.jsx(Controller, { control: control, name: name, render: ({ field }) => {
|
|
26562
|
+
return (jsxRuntime.jsx(DateField$1.DateField, { ...field, id: id, label: label, slots: {
|
|
26563
|
+
field: TextField,
|
|
26564
|
+
} }));
|
|
26565
|
+
} }));
|
|
26566
|
+
}
|
|
26567
|
+
|
|
26360
26568
|
const useShowSnackbar = () => {
|
|
26361
26569
|
const { enqueueSnackbar } = useSnackbar();
|
|
26362
26570
|
const showSnackbar = ({ variant, message, }) => {
|
|
@@ -28881,6 +29089,7 @@ exports.Checkbox = CustomCheckbox;
|
|
|
28881
29089
|
exports.DartcomAuthProvider = auth;
|
|
28882
29090
|
exports.DartcomMobxProvider = DartcomMobxProvider;
|
|
28883
29091
|
exports.DartcomProviders = DartcomProviders;
|
|
29092
|
+
exports.DateField = DateField;
|
|
28884
29093
|
exports.DeleteButton = DeleteButton;
|
|
28885
29094
|
exports.DragList = DragList;
|
|
28886
29095
|
exports.EditButton = EditButton;
|
|
@@ -28933,6 +29142,8 @@ exports.getRailroadLayers = getRailroadLayers;
|
|
|
28933
29142
|
exports.getRoadPolyLayers = getRoadPolyLayers;
|
|
28934
29143
|
exports.getTrafficSignImgSrc = getTrafficSignImgSrc;
|
|
28935
29144
|
exports.getTrafficSignLayers = getTrafficSignLayers;
|
|
29145
|
+
exports.getTrafficSignTitlesOptions = getTrafficSignTitlesOptions;
|
|
29146
|
+
exports.getTrafficSignTypeByNumber = getTrafficSignTypeByNumber;
|
|
28936
29147
|
exports.getTrafficSignalLayers = getTrafficSignalLayers;
|
|
28937
29148
|
exports.getUrlencodedBody = getUrlencodedBody;
|
|
28938
29149
|
exports.getValidLayer = getValidLayer;
|
|
@@ -28946,10 +29157,15 @@ exports.sourceUrl = sourceUrl;
|
|
|
28946
29157
|
exports.text_source = text_source;
|
|
28947
29158
|
exports.tile_size = tile_size;
|
|
28948
29159
|
exports.trafficSignExtension = trafficSignExtension;
|
|
29160
|
+
exports.trafficSignFieldsTitles = trafficSignFieldsTitles;
|
|
28949
29161
|
exports.trafficSignHeights = trafficSignHeights;
|
|
28950
29162
|
exports.trafficSignLayerName = trafficSignLayerName;
|
|
28951
29163
|
exports.trafficSignNumbers = trafficSignNumbers;
|
|
29164
|
+
exports.trafficSignNumbersInformation = trafficSignNumbersInformation;
|
|
28952
29165
|
exports.trafficSignNumbersSizes = trafficSignNumbersSizes;
|
|
29166
|
+
exports.trafficSignStatusOptions = trafficSignStatusOptions;
|
|
29167
|
+
exports.trafficSignTypes = trafficSignTypes;
|
|
29168
|
+
exports.trafficSignTypesOptions = trafficSignTypesOptions;
|
|
28953
29169
|
exports.trafficSignWidths = trafficSignWidths;
|
|
28954
29170
|
exports.useFormContext = useFormContext;
|
|
28955
29171
|
exports.useGetLeafletLayer = useGetLeafletLayer;
|