@consta/uikit 3.24.3 → 3.25.0
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/Attach/package.json +1 -1
- package/Attachment/package.json +1 -1
- package/Avatar/package.json +1 -1
- package/Badge/package.json +1 -1
- package/BasicSelectDeprecated/package.json +1 -1
- package/Breadcrumbs/package.json +1 -1
- package/BreadcrumbsCanary/package.json +1 -1
- package/Button/package.json +1 -1
- package/CHANGELOG.md +32 -52
- package/Calendar/package.json +1 -1
- package/Card/package.json +1 -1
- package/Checkbox/package.json +1 -1
- package/CheckboxGroup/package.json +1 -1
- package/CheckboxGroupCanary/package.json +1 -1
- package/ChoiceGroup/package.json +1 -1
- package/ChoiceGroupCanary/package.json +1 -1
- package/Collapse/package.json +1 -1
- package/CollapseGroup/package.json +1 -1
- package/Combobox/package.json +1 -1
- package/ComboboxDeprecated/package.json +1 -1
- package/ContextMenu/package.json +1 -1
- package/ContextMenuCanary/package.json +1 -1
- package/DatePickerCanary/package.json +1 -1
- package/DateTimeCanary/package.json +1 -1
- package/DragNDropField/package.json +1 -1
- package/EventInterceptor/package.json +1 -1
- package/FieldCaption/package.json +1 -1
- package/FieldGroup/es.js +1 -0
- package/FieldGroup/index.d.ts +1 -0
- package/FieldGroup/index.js +4 -0
- package/FieldGroup/package.json +9 -0
- package/FieldLabel/package.json +1 -1
- package/File/package.json +1 -1
- package/FileField/package.json +1 -1
- package/FileIcon/package.json +1 -1
- package/FileIconAvi/package.json +1 -1
- package/FileIconBmp/package.json +1 -1
- package/FileIconCsv/package.json +1 -1
- package/FileIconDoc/package.json +1 -1
- package/FileIconExe/package.json +1 -1
- package/FileIconGif/package.json +1 -1
- package/FileIconJpg/package.json +1 -1
- package/FileIconJson/package.json +1 -1
- package/FileIconLoading/package.json +1 -1
- package/FileIconMov/package.json +1 -1
- package/FileIconMp3/package.json +1 -1
- package/FileIconMp4/package.json +1 -1
- package/FileIconPdf/package.json +1 -1
- package/FileIconPng/package.json +1 -1
- package/FileIconPpt/package.json +1 -1
- package/FileIconRar/package.json +1 -1
- package/FileIconRtf/package.json +1 -1
- package/FileIconTiff/package.json +1 -1
- package/FileIconTxt/package.json +1 -1
- package/FileIconUndefined/package.json +1 -1
- package/FileIconWav/package.json +1 -1
- package/FileIconXls/package.json +1 -1
- package/FileIconZip/package.json +1 -1
- package/Grid/package.json +1 -1
- package/Header/package.json +1 -1
- package/Icon/package.json +1 -1
- package/IconAdd/package.json +1 -1
- package/IconAddToComparison/package.json +1 -1
- package/IconAlert/package.json +1 -1
- package/IconAlignBlocksLeft/package.json +1 -1
- package/IconAlignBlocksRight/package.json +1 -1
- package/IconAlignCenter/package.json +1 -1
- package/IconAlignJustify/package.json +1 -1
- package/IconAlignLeft/package.json +1 -1
- package/IconAlignRight/package.json +1 -1
- package/IconAllDone/package.json +1 -1
- package/IconArrowDown/package.json +1 -1
- package/IconArrowLeft/package.json +1 -1
- package/IconArrowRight/package.json +1 -1
- package/IconArrowUp/package.json +1 -1
- package/IconArtBrush/package.json +1 -1
- package/IconAttach/package.json +1 -1
- package/IconBackward/package.json +1 -1
- package/IconBag/package.json +1 -1
- package/IconBarrier/package.json +1 -1
- package/IconBento/package.json +1 -1
- package/IconBold/package.json +1 -1
- package/IconBook/package.json +1 -1
- package/IconBookmarkFilled/package.json +1 -1
- package/IconBookmarkStroked/package.json +1 -1
- package/IconCalculator/package.json +1 -1
- package/IconCalendar/package.json +1 -1
- package/IconCamera/package.json +1 -1
- package/IconCancel/package.json +1 -1
- package/IconCards/package.json +1 -1
- package/IconChat/package.json +1 -1
- package/IconCheck/package.json +1 -1
- package/IconClose/package.json +1 -1
- package/IconCollapse/package.json +1 -1
- package/IconColorFill/package.json +1 -1
- package/IconColorText/package.json +1 -1
- package/IconColumns/package.json +1 -1
- package/IconComment/package.json +1 -1
- package/IconConnection/package.json +1 -1
- package/IconCopy/package.json +1 -1
- package/IconCrown/package.json +1 -1
- package/IconCursorMouse/package.json +1 -1
- package/IconDataNull/package.json +1 -1
- package/IconDiamond/package.json +1 -1
- package/IconDinosaur/package.json +1 -1
- package/IconDisconnection/package.json +1 -1
- package/IconDocAdd/package.json +1 -1
- package/IconDocBlank/package.json +1 -1
- package/IconDocDelete/package.json +1 -1
- package/IconDocExport/package.json +1 -1
- package/IconDocFilled/package.json +1 -1
- package/IconDown/package.json +1 -1
- package/IconDownload/package.json +1 -1
- package/IconDrag/package.json +1 -1
- package/IconDraggable/package.json +1 -1
- package/IconDrillingRig/package.json +1 -1
- package/IconDrop/package.json +1 -1
- package/IconEdit/package.json +1 -1
- package/IconExit/package.json +1 -1
- package/IconExpand/package.json +1 -1
- package/IconEye/package.json +1 -1
- package/IconEyeClose/package.json +1 -1
- package/IconFacebook/package.json +1 -1
- package/IconFavorite/package.json +1 -1
- package/IconFilter/package.json +1 -1
- package/IconFitToDefault/package.json +1 -1
- package/IconFlagFilled/package.json +1 -1
- package/IconFlagStroked/package.json +1 -1
- package/IconFolders/package.json +1 -1
- package/IconForward/package.json +1 -1
- package/IconFunnel/package.json +1 -1
- package/IconGas/package.json +1 -1
- package/IconGeo/package.json +1 -1
- package/IconGrouping/package.json +1 -1
- package/IconHamburger/package.json +1 -1
- package/IconHand/package.json +1 -1
- package/IconHealth/package.json +1 -1
- package/IconHome/package.json +1 -1
- package/IconInComparison/package.json +1 -1
- package/IconInfo/package.json +1 -1
- package/IconInstagram/package.json +1 -1
- package/IconIntroduction/package.json +1 -1
- package/IconIpad/package.json +1 -1
- package/IconItalic/package.json +1 -1
- package/IconKebab/package.json +1 -1
- package/IconLaptop/package.json +1 -1
- package/IconLayers/package.json +1 -1
- package/IconLeaf/package.json +1 -1
- package/IconLightningBolt/package.json +1 -1
- package/IconLineAndBarChart/package.json +1 -1
- package/IconLink/package.json +1 -1
- package/IconList/package.json +1 -1
- package/IconListNumbered/package.json +1 -1
- package/IconLock/package.json +1 -1
- package/IconLogicalElement/package.json +1 -1
- package/IconMBU/package.json +1 -1
- package/IconMGRP/package.json +1 -1
- package/IconMLSP/package.json +1 -1
- package/IconMMP/package.json +1 -1
- package/IconMail/package.json +1 -1
- package/IconMap/package.json +1 -1
- package/IconMaxHeight/package.json +1 -1
- package/IconMaxWidth/package.json +1 -1
- package/IconMeatball/package.json +1 -1
- package/IconMic/package.json +1 -1
- package/IconMolecules/package.json +1 -1
- package/IconMoon/package.json +1 -1
- package/IconNodeEnd/package.json +1 -1
- package/IconNodeStart/package.json +1 -1
- package/IconNodeStep/package.json +1 -1
- package/IconNodes/package.json +1 -1
- package/IconOpenInNew/package.json +1 -1
- package/IconOperators/package.json +1 -1
- package/IconPanelBottom/package.json +1 -1
- package/IconPanelLeft/package.json +1 -1
- package/IconPanelRight/package.json +1 -1
- package/IconPanelTop/package.json +1 -1
- package/IconPaste/package.json +1 -1
- package/IconPause/package.json +1 -1
- package/IconPhone/package.json +1 -1
- package/IconPhoto/package.json +1 -1
- package/IconPicture/package.json +1 -1
- package/IconPlay/package.json +1 -1
- package/IconPressure/package.json +1 -1
- package/IconPriceLabel/package.json +1 -1
- package/IconProcessing/package.json +1 -1
- package/IconQuestion/package.json +1 -1
- package/IconQuote/package.json +1 -1
- package/IconRUO/package.json +1 -1
- package/IconRUS/package.json +1 -1
- package/IconRecord/package.json +1 -1
- package/IconRemove/package.json +1 -1
- package/IconRemoveFromComparison/package.json +1 -1
- package/IconReply/package.json +1 -1
- package/IconResize/package.json +1 -1
- package/IconRestart/package.json +1 -1
- package/IconRevert/package.json +1 -1
- package/IconRing/package.json +1 -1
- package/IconRouble/package.json +1 -1
- package/IconRuler/package.json +1 -1
- package/IconSave/package.json +1 -1
- package/IconScreen/package.json +1 -1
- package/IconSearch/package.json +1 -1
- package/IconSelect/package.json +1 -1
- package/IconSelectOpen/package.json +1 -1
- package/IconSendMessage/package.json +1 -1
- package/IconSettings/package.json +1 -1
- package/IconShape/package.json +1 -1
- package/IconShuffle/package.json +1 -1
- package/IconSmile/package.json +1 -1
- package/IconSortDown/package.json +1 -1
- package/IconSortDownCenter/package.json +1 -1
- package/IconSortUp/package.json +1 -1
- package/IconSortUpCenter/package.json +1 -1
- package/IconStop/package.json +1 -1
- package/IconStorage/package.json +1 -1
- package/IconStrikethrough/package.json +1 -1
- package/IconSun/package.json +1 -1
- package/IconTable/package.json +1 -1
- package/IconTable2/package.json +1 -1
- package/IconTarget/package.json +1 -1
- package/IconTeam/package.json +1 -1
- package/IconTechResponse/package.json +1 -1
- package/IconTest/package.json +1 -1
- package/IconThumbUp/package.json +1 -1
- package/IconTie/package.json +1 -1
- package/IconTop/package.json +1 -1
- package/IconTrash/package.json +1 -1
- package/IconType/package.json +1 -1
- package/IconUnderline/package.json +1 -1
- package/IconUnlock/package.json +1 -1
- package/IconUnsort/package.json +1 -1
- package/IconUnsortCenter/package.json +1 -1
- package/IconUpload/package.json +1 -1
- package/IconUser/package.json +1 -1
- package/IconVZD/package.json +1 -1
- package/IconVideo/package.json +1 -1
- package/IconVkontakte/package.json +1 -1
- package/IconWarning/package.json +1 -1
- package/IconWatch/package.json +1 -1
- package/IconWideScreen/package.json +1 -1
- package/IconWorld/package.json +1 -1
- package/IconWrench/package.json +1 -1
- package/IconYandexDzen/package.json +1 -1
- package/IconYoutube/package.json +1 -1
- package/Informer/package.json +1 -1
- package/LayoutCanary/package.json +1 -1
- package/Loader/package.json +1 -1
- package/MixCard/package.json +1 -1
- package/MixFocus/package.json +1 -1
- package/MixPopoverAnimate/package.json +1 -1
- package/MixPopoverArrow/package.json +1 -1
- package/MixSpace/package.json +1 -1
- package/MixVisuallyHidden/package.json +1 -1
- package/Modal/package.json +1 -1
- package/MultiComboboxDeprecated/package.json +1 -1
- package/Pagination/package.json +1 -1
- package/Popover/package.json +1 -1
- package/PortalWithTheme/package.json +1 -1
- package/ProgressSpin/package.json +1 -1
- package/ProgressStepBarCanary/package.json +1 -1
- package/Radio/package.json +1 -1
- package/RadioGroup/package.json +1 -1
- package/Responses/package.json +1 -1
- package/Responses403/package.json +1 -1
- package/Responses404/package.json +1 -1
- package/Responses500/package.json +1 -1
- package/Responses503/package.json +1 -1
- package/ResponsesConnectionError/package.json +1 -1
- package/ResponsesDeleted/package.json +1 -1
- package/ResponsesEmptyBox/package.json +1 -1
- package/ResponsesEmptyPockets/package.json +1 -1
- package/ResponsesExit/package.json +1 -1
- package/ResponsesImage/package.json +1 -1
- package/ResponsesImage403/package.json +1 -1
- package/ResponsesImage404/package.json +1 -1
- package/ResponsesImage500/package.json +1 -1
- package/ResponsesImage503/package.json +1 -1
- package/ResponsesImageConnectionError/package.json +1 -1
- package/ResponsesImageDeleted/package.json +1 -1
- package/ResponsesImageEmptyBox/package.json +1 -1
- package/ResponsesImageEmptyPockets/package.json +1 -1
- package/ResponsesImageNothingFound/package.json +1 -1
- package/ResponsesImageSuccess/package.json +1 -1
- package/ResponsesNothingFound/package.json +1 -1
- package/ResponsesSuccess/package.json +1 -1
- package/Select/package.json +1 -1
- package/Sidebar/package.json +1 -1
- package/Skeleton/package.json +1 -1
- package/SliderCanary/package.json +1 -1
- package/SnackBar/package.json +1 -1
- package/Steps/package.json +1 -1
- package/StepsCanary/package.json +1 -1
- package/Switch/package.json +1 -1
- package/SwitchGroup/package.json +1 -1
- package/SwitchGroupCanary/package.json +1 -1
- package/Table/package.json +1 -1
- package/Tabs/package.json +1 -1
- package/TabsCanary/package.json +1 -1
- package/Tag/package.json +1 -1
- package/TagBase/package.json +1 -1
- package/Text/package.json +1 -1
- package/TextField/package.json +1 -1
- package/Theme/package.json +1 -1
- package/ThemeToggler/package.json +1 -1
- package/Timer/package.json +1 -1
- package/Tooltip/package.json +1 -1
- package/User/package.json +1 -1
- package/UserSelect/package.json +1 -1
- package/UserSelectDeprecated/package.json +1 -1
- package/__internal__/cjs-src/components/Button/Button.d.ts +1 -1
- package/__internal__/cjs-src/components/Button/Button.js +17 -1
- package/__internal__/cjs-src/components/Combobox/Combobox.js +3 -4
- package/__internal__/cjs-src/components/Combobox/helpers.d.ts +2 -0
- package/__internal__/cjs-src/components/DatePickerCanary/helpers.js +3 -35
- package/__internal__/cjs-src/components/DateTimeCanary/DateTimeTypeTime/helpers.js +1 -1
- package/__internal__/cjs-src/components/DragNDropField/DragNDropField.d.ts +1 -0
- package/__internal__/cjs-src/components/DragNDropField/DragNDropField.js +4 -3
- package/__internal__/cjs-src/components/DragNDropField/DragNDropFieldContent/DragNDropFieldContent.js +2 -2
- package/__internal__/cjs-src/components/DragNDropField/DragNDropFieldContent/formatFileRequirements.d.ts +1 -1
- package/__internal__/cjs-src/components/DragNDropField/DragNDropFieldContent/formatFileRequirements.js +15 -14
- package/__internal__/cjs-src/components/DragNDropField/getErrorsList.js +1 -1
- package/__internal__/cjs-src/components/DragNDropField/locale.d.ts +1 -1
- package/__internal__/cjs-src/components/DragNDropField/locale.js +10 -4
- package/__internal__/cjs-src/components/DragNDropField/types.d.ts +2 -1
- package/__internal__/cjs-src/components/FieldGroup/FieldGroup.css +5 -0
- package/__internal__/cjs-src/components/FieldGroup/FieldGroup.d.ts +10 -0
- package/__internal__/cjs-src/components/FieldGroup/FieldGroup.js +27 -0
- package/__internal__/cjs-src/components/FieldGroup/getForm.d.ts +2 -0
- package/__internal__/cjs-src/components/FieldGroup/getForm.js +29 -0
- package/__internal__/cjs-src/components/FieldGroup/types.d.ts +14 -0
- package/__internal__/cjs-src/components/FieldGroup/types.js +2 -0
- package/__internal__/cjs-src/components/Select/Select.js +3 -4
- package/__internal__/cjs-src/components/Select/helpers.d.ts +2 -0
- package/__internal__/cjs-src/components/SelectComponents/helpers.d.ts +0 -3
- package/__internal__/cjs-src/components/SelectComponents/helpers.js +1 -20
- package/__internal__/cjs-src/components/Sidebar/Sidebar.js +2 -2
- package/__internal__/cjs-src/components/UserSelect/UserSelect.js +3 -4
- package/__internal__/cjs-src/components/UserSelect/helpers.d.ts +2 -0
- package/__internal__/src/components/Button/Button.d.ts +1 -1
- package/__internal__/src/components/Button/Button.js +17 -1
- package/__internal__/src/components/Combobox/Combobox.js +4 -5
- package/__internal__/src/components/Combobox/helpers.d.ts +2 -0
- package/__internal__/src/components/DatePickerCanary/helpers.js +3 -35
- package/__internal__/src/components/DateTimeCanary/DateTimeTypeTime/helpers.js +1 -1
- package/__internal__/src/components/DragNDropField/DragNDropField.d.ts +1 -0
- package/__internal__/src/components/DragNDropField/DragNDropField.js +4 -3
- package/__internal__/src/components/DragNDropField/DragNDropFieldContent/DragNDropFieldContent.js +2 -2
- package/__internal__/src/components/DragNDropField/DragNDropFieldContent/formatFileRequirements.d.ts +1 -1
- package/__internal__/src/components/DragNDropField/DragNDropFieldContent/formatFileRequirements.js +15 -14
- package/__internal__/src/components/DragNDropField/getErrorsList.js +1 -1
- package/__internal__/src/components/DragNDropField/locale.d.ts +1 -1
- package/__internal__/src/components/DragNDropField/locale.js +10 -4
- package/__internal__/src/components/DragNDropField/types.d.ts +2 -1
- package/__internal__/src/components/FieldGroup/FieldGroup.css +5 -0
- package/__internal__/src/components/FieldGroup/FieldGroup.d.ts +10 -0
- package/__internal__/src/components/FieldGroup/FieldGroup.js +24 -0
- package/__internal__/src/components/FieldGroup/getForm.d.ts +2 -0
- package/__internal__/src/components/FieldGroup/getForm.js +26 -0
- package/__internal__/src/components/FieldGroup/types.d.ts +14 -0
- package/__internal__/src/components/FieldGroup/types.js +0 -0
- package/__internal__/src/components/Select/Select.js +4 -5
- package/__internal__/src/components/Select/helpers.d.ts +2 -0
- package/__internal__/src/components/SelectComponents/helpers.d.ts +0 -3
- package/__internal__/src/components/SelectComponents/helpers.js +0 -18
- package/__internal__/src/components/Sidebar/Sidebar.js +2 -2
- package/__internal__/src/components/UserSelect/UserSelect.js +4 -5
- package/__internal__/src/components/UserSelect/helpers.d.ts +2 -0
- package/createIcon/package.json +1 -1
- package/createResponsesImage/package.json +1 -1
- package/package.json +2 -1
- package/useBreakpoints/package.json +1 -1
- package/useChoiceGroup/package.json +1 -1
- package/useChoiceGroupIndexed/package.json +1 -1
- package/useClickOutside/package.json +1 -1
- package/useComponentSize/package.json +1 -1
- package/useDebounce/package.json +1 -1
- package/useFlag/package.json +1 -1
- package/useForkRef/package.json +1 -1
- package/useGlobalKeys/package.json +1 -1
- package/useHideElementsInLine/package.json +1 -1
- package/useKeys/package.json +1 -1
- package/useMutableRef/package.json +1 -1
- package/useOverflow/package.json +1 -1
- package/usePrevious/package.json +1 -1
- package/useRefs/package.json +1 -1
- package/useResizeObserved/package.json +1 -1
- package/useScrollElements/package.json +1 -1
- package/useScrollPosition/package.json +1 -1
- package/useSelect/package.json +1 -1
- package/useSortSteps/package.json +1 -1
- package/useThemeVars/package.json +1 -1
- package/useTimer/package.json +1 -1
- package/withTooltip/package.json +1 -1
|
@@ -15,13 +15,14 @@ var cnDragNDropField = cn('DragNDropField');
|
|
|
15
15
|
export var COMPONENT_NAME = 'DragNDropField';
|
|
16
16
|
export var DragNDropField = forwardRef(function (props, ref) {
|
|
17
17
|
var dragNDropFieldRef = useRef(null);
|
|
18
|
-
var _a = usePropsHandler(COMPONENT_NAME, props, dragNDropFieldRef), accept = _a.accept, maxSize = _a.maxSize, _b = _a.multiple, multiple = _b === void 0 ? false : _b, onDropFiles = _a.onDropFiles, _c = _a.children, children = _c === void 0 ? DragNDropFieldContent : _c, localeProp = _a.locale, disabled = _a.disabled, onClick = _a.onClick, otherProps = __rest(_a, ["accept", "maxSize", "multiple", "onDropFiles", "children", "locale", "disabled", "onClick"]);
|
|
18
|
+
var _a = usePropsHandler(COMPONENT_NAME, props, dragNDropFieldRef), accept = _a.accept, maxSize = _a.maxSize, minSize = _a.minSize, _b = _a.multiple, multiple = _b === void 0 ? false : _b, onDropFiles = _a.onDropFiles, _c = _a.children, children = _c === void 0 ? DragNDropFieldContent : _c, localeProp = _a.locale, disabled = _a.disabled, onClick = _a.onClick, otherProps = __rest(_a, ["accept", "maxSize", "minSize", "multiple", "onDropFiles", "children", "locale", "disabled", "onClick"]);
|
|
19
19
|
var onClickRef = useMutableRef(onClick);
|
|
20
20
|
var locale = withdefaultLocale(localeProp);
|
|
21
21
|
var handleDrop = React.useCallback(function (acceptedFiles) { return acceptedFiles.length > 0 && onDropFiles(acceptedFiles); }, [onDropFiles]);
|
|
22
22
|
var _d = useDropzone({
|
|
23
23
|
accept: (accept === null || accept === void 0 ? void 0 : accept.length) ? accept : undefined,
|
|
24
24
|
maxSize: maxSize || undefined,
|
|
25
|
+
minSize: minSize || undefined,
|
|
25
26
|
onDrop: handleDrop,
|
|
26
27
|
multiple: multiple,
|
|
27
28
|
disabled: disabled
|
|
@@ -36,9 +37,9 @@ export var DragNDropField = forwardRef(function (props, ref) {
|
|
|
36
37
|
}, []);
|
|
37
38
|
var rootProps = getRootProps(__assign(__assign({}, otherProps), { className: cnDragNDropField({ active: isDragActive, disabled: disabled }), onClick: handleRootClick }));
|
|
38
39
|
var content = isRenderProp(children)
|
|
39
|
-
? children({ accept: accept, maxSize: maxSize, multiple: multiple, openFileDialog: open, locale: locale, disabled: disabled })
|
|
40
|
+
? children({ accept: accept, maxSize: maxSize, minSize: minSize, multiple: multiple, openFileDialog: open, locale: locale, disabled: disabled })
|
|
40
41
|
: children;
|
|
41
|
-
var errors = React.useMemo(function () { return getErrorsList(fileRejections, { maxSize: maxSize }, locale); }, [
|
|
42
|
+
var errors = React.useMemo(function () { return getErrorsList(fileRejections, { maxSize: maxSize, minSize: minSize }, locale); }, [
|
|
42
43
|
fileRejections,
|
|
43
44
|
]);
|
|
44
45
|
return (React.createElement(React.Fragment, null,
|
package/__internal__/src/components/DragNDropField/DragNDropFieldContent/DragNDropFieldContent.js
CHANGED
|
@@ -8,8 +8,8 @@ import { getText } from '../locale';
|
|
|
8
8
|
import { formatFileRequirements } from './formatFileRequirements';
|
|
9
9
|
var cnDragNDropFieldContent = cn('DragNDropFieldContent');
|
|
10
10
|
export var DragNDropFieldContent = function (_a) {
|
|
11
|
-
var accept = _a.accept, maxSize = _a.maxSize, multiple = _a.multiple, openFileDialog = _a.openFileDialog, locale = _a.locale, disabled = _a.disabled;
|
|
12
|
-
var requirements = formatFileRequirements(accept, maxSize);
|
|
11
|
+
var accept = _a.accept, maxSize = _a.maxSize, minSize = _a.minSize, multiple = _a.multiple, openFileDialog = _a.openFileDialog, locale = _a.locale, disabled = _a.disabled;
|
|
12
|
+
var requirements = formatFileRequirements(accept, maxSize, minSize, locale);
|
|
13
13
|
var fileText = multiple ? locale.files : locale.file;
|
|
14
14
|
return (React.createElement(React.Fragment, null,
|
|
15
15
|
React.createElement(Text, { className: cnDragNDropFieldContent('Text', { disabled: disabled }), view: "secondary", size: "s", lineHeight: "s", align: "center" },
|
package/__internal__/src/components/DragNDropField/DragNDropFieldContent/formatFileRequirements.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DragNDropFieldProps } from '../DragNDropField';
|
|
2
2
|
import { Locale } from '../locale';
|
|
3
|
-
export declare const formatFileRequirements: (accept: DragNDropFieldProps['accept'], maxSize: DragNDropFieldProps['maxSize'], locale?: Required<Locale>) => string
|
|
3
|
+
export declare const formatFileRequirements: (accept: DragNDropFieldProps['accept'], maxSize: DragNDropFieldProps['maxSize'], minSize: DragNDropFieldProps['minSize'], locale?: Required<Locale>) => string;
|
package/__internal__/src/components/DragNDropField/DragNDropFieldContent/formatFileRequirements.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { isNotNil } from '../../../utils/type-guards';
|
|
2
2
|
import { formatFileSize } from '../formatFileSize';
|
|
3
3
|
import { defaultLocale } from '../locale';
|
|
4
|
-
|
|
4
|
+
var formatAccept = function (strs) {
|
|
5
|
+
return Array.isArray(strs) ? strs.join(', ') : strs;
|
|
6
|
+
};
|
|
7
|
+
var formatSize = function (prefix, size, locale) {
|
|
8
|
+
return size ? prefix + " " + formatFileSize(size, locale) : undefined;
|
|
9
|
+
};
|
|
10
|
+
export var formatFileRequirements = function (accept, maxSize, minSize, locale) {
|
|
5
11
|
if (locale === void 0) { locale = defaultLocale; }
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
if (maxSize) {
|
|
16
|
-
return locale.max + " " + formatFileSize(maxSize, locale);
|
|
17
|
-
}
|
|
18
|
-
return undefined;
|
|
12
|
+
return [
|
|
13
|
+
locale['fit-files'],
|
|
14
|
+
formatAccept(accept),
|
|
15
|
+
formatSize(locale.from, minSize, locale),
|
|
16
|
+
formatSize(locale.before, maxSize, locale),
|
|
17
|
+
]
|
|
18
|
+
.filter(isNotNil)
|
|
19
|
+
.join(' ');
|
|
19
20
|
};
|
|
@@ -12,7 +12,7 @@ var getErrorMessage = function (error, file, sizes, locale) {
|
|
|
12
12
|
return file ? file.name + ": " + locale['general-error'] : NO_MESSAGE;
|
|
13
13
|
}
|
|
14
14
|
if (file) {
|
|
15
|
-
return
|
|
15
|
+
return isString(message) ? message : message({ file: file, sizes: sizes });
|
|
16
16
|
}
|
|
17
17
|
return isString(message) ? message : NO_MESSAGE;
|
|
18
18
|
};
|
|
@@ -16,11 +16,11 @@ export declare type Locale = {
|
|
|
16
16
|
'file'?: string;
|
|
17
17
|
'files'?: string;
|
|
18
18
|
'before'?: string;
|
|
19
|
+
'from'?: string;
|
|
19
20
|
'gigabyte'?: string;
|
|
20
21
|
'megabyte'?: string;
|
|
21
22
|
'kilobyte'?: string;
|
|
22
23
|
'byte'?: string;
|
|
23
|
-
'max'?: string;
|
|
24
24
|
'call-to-action'?: LocaleLabel;
|
|
25
25
|
'action-button'?: LocaleLabel;
|
|
26
26
|
};
|
|
@@ -3,19 +3,25 @@ import { isDefined, isNotNil, isString } from '../../utils/type-guards';
|
|
|
3
3
|
import { formatFileSize } from './formatFileSize';
|
|
4
4
|
export var defaultLocale = {
|
|
5
5
|
'file-invalid-type': function (props) {
|
|
6
|
-
return [
|
|
6
|
+
return [props.file.name + ": \u0444\u043E\u0440\u043C\u0430\u0442 \u0444\u0430\u0439\u043B\u0430 \u043D\u0435 \u043F\u043E\u0434\u0445\u043E\u0434\u0438\u0442", props.file.type && "(" + props.file.type + ")"]
|
|
7
7
|
.filter(isNotNil)
|
|
8
8
|
.join(' ');
|
|
9
9
|
},
|
|
10
|
-
'file-too-large': function (props) {
|
|
11
|
-
|
|
10
|
+
'file-too-large': function (props) {
|
|
11
|
+
var _a;
|
|
12
|
+
return props.file.name + ": \u0444\u0430\u0439\u043B \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0439 (\u043C\u0430\u043A\u0441\u0438\u043C\u0443\u043C " + formatFileSize((_a = props.sizes.maxSize) !== null && _a !== void 0 ? _a : 0, defaultLocale) + ")";
|
|
13
|
+
},
|
|
14
|
+
'file-too-small': function (props) {
|
|
15
|
+
var _a;
|
|
16
|
+
return props.file.name + ": \u0444\u0430\u0439\u043B \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0438\u0439 (\u043C\u0438\u043D\u0438\u043C\u0443\u043C " + formatFileSize((_a = props.sizes.minSize) !== null && _a !== void 0 ? _a : 0, defaultLocale) + ")";
|
|
17
|
+
},
|
|
12
18
|
'too-many-files': 'Вы перетащили несколько файлов. Выберите один, пожалуйста',
|
|
13
19
|
'general-error': 'не получилось добавить файл',
|
|
14
20
|
'fit-files': 'Подходят файлы',
|
|
15
21
|
'file': 'файл',
|
|
16
22
|
'files': 'файлы',
|
|
17
23
|
'before': 'до',
|
|
18
|
-
'
|
|
24
|
+
'from': 'от',
|
|
19
25
|
'gigabyte': 'Гб',
|
|
20
26
|
'megabyte': 'Мб',
|
|
21
27
|
'kilobyte': 'Кб',
|
|
@@ -14,7 +14,7 @@ export declare type DragNDropFieldPropErrorMessages = Partial<Record<FileError['
|
|
|
14
14
|
export declare type DragNDropFieldChildrenRenderProp = (props: {
|
|
15
15
|
openFileDialog: () => void;
|
|
16
16
|
locale: Required<DragNDropFieldPropLocale>;
|
|
17
|
-
} & Pick<DragNDropFieldProps, 'accept' | 'maxSize' | 'multiple' | 'disabled'>) => React.ReactNode;
|
|
17
|
+
} & Pick<DragNDropFieldProps, 'accept' | 'maxSize' | 'multiple' | 'disabled' | 'minSize'>) => React.ReactNode;
|
|
18
18
|
export declare type FileSizes = {
|
|
19
19
|
minSize?: number;
|
|
20
20
|
maxSize?: number;
|
|
@@ -22,6 +22,7 @@ export declare type FileSizes = {
|
|
|
22
22
|
export declare type DragNDropFieldProps = PropsWithHTMLAttributes<{
|
|
23
23
|
accept?: string | string[];
|
|
24
24
|
maxSize?: number;
|
|
25
|
+
minSize?: number;
|
|
25
26
|
multiple?: boolean;
|
|
26
27
|
onDropFiles: (files: File[]) => void;
|
|
27
28
|
children?: React.ReactNode | DragNDropFieldChildrenRenderProp;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import './FieldGroup.css';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FieldGroupPropChildren } from './types';
|
|
4
|
+
export declare const FieldGroup: React.ForwardRefExoticComponent<{
|
|
5
|
+
children: FieldGroupPropChildren;
|
|
6
|
+
form?: "default" | "round" | "brick" | "brickRound" | "roundBrick" | "brickDefault" | "defaultBrick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "brickClear" | "clearBrick" | "clearClear" | undefined;
|
|
7
|
+
size?: "xs" | "s" | "m" | "l" | undefined;
|
|
8
|
+
} & Pick<React.HTMLAttributes<HTMLDivElement>, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export * from './types';
|
|
10
|
+
export * from './getForm';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
|
+
import './FieldGroup.css';
|
|
3
|
+
import React, { cloneElement, forwardRef } from 'react';
|
|
4
|
+
import { cn } from '../../utils/bem';
|
|
5
|
+
import { isNotNil } from '../../utils/type-guards';
|
|
6
|
+
import { getForm } from './getForm';
|
|
7
|
+
var cnFieldGroup = cn('FieldGroup');
|
|
8
|
+
var renderChildren = function (children, form, size) {
|
|
9
|
+
if (Array.isArray(children) && children.length) {
|
|
10
|
+
return children.map(function (el, index) {
|
|
11
|
+
if (isNotNil(el)) {
|
|
12
|
+
return cloneElement(el, __assign(__assign({}, el.props), { form: getForm(form, index, children.length), size: size, key: el.key || index }));
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
};
|
|
19
|
+
export var FieldGroup = forwardRef(function (props, ref) {
|
|
20
|
+
var children = props.children, className = props.className, size = props.size, form = props.form, otherProps = __rest(props, ["children", "className", "size", "form"]);
|
|
21
|
+
return (React.createElement("div", __assign({}, otherProps, { className: cnFieldGroup(null, [className]), ref: ref }), renderChildren(children, form, size)));
|
|
22
|
+
});
|
|
23
|
+
export * from './types';
|
|
24
|
+
export * from './getForm';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { FieldGroupPropForm } from './types';
|
|
2
|
+
export declare const getForm: (form: "default" | "round" | "brick" | "brickRound" | "roundBrick" | "brickDefault" | "defaultBrick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "brickClear" | "clearBrick" | "clearClear" | undefined, index: number, length: number) => FieldGroupPropForm;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var mapForm = {
|
|
2
|
+
"default": ['defaultClear', 'brickDefault'],
|
|
3
|
+
defaultClear: ['defaultClear', 'brickClear'],
|
|
4
|
+
defaultBrick: ['defaultClear', 'brick'],
|
|
5
|
+
brick: ['brickClear', 'brick'],
|
|
6
|
+
brickDefault: ['brickClear', 'brickDefault'],
|
|
7
|
+
brickClear: ['brickClear', 'brickClear'],
|
|
8
|
+
brickRound: ['brickClear', 'brickRound'],
|
|
9
|
+
round: ['roundClear', 'brickRound'],
|
|
10
|
+
roundClear: ['roundClear', 'brickClear'],
|
|
11
|
+
roundBrick: ['roundClear', 'brick'],
|
|
12
|
+
clearRound: ['clearClear', 'brickRound'],
|
|
13
|
+
clearDefault: ['clearClear', 'brickDefault'],
|
|
14
|
+
clearBrick: ['clearClear', 'brick'],
|
|
15
|
+
clearClear: ['clearClear', 'brickClear']
|
|
16
|
+
};
|
|
17
|
+
export var getForm = function (form, index, length) {
|
|
18
|
+
if (form === void 0) { form = 'default'; }
|
|
19
|
+
if (index === 0) {
|
|
20
|
+
return mapForm[form][0];
|
|
21
|
+
}
|
|
22
|
+
if (index === length - 1) {
|
|
23
|
+
return mapForm[form][1];
|
|
24
|
+
}
|
|
25
|
+
return 'brickClear';
|
|
26
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';
|
|
3
|
+
export declare type FieldGroupPropForm = 'default' | 'brick' | 'round' | 'brickRound' | 'roundBrick' | 'brickDefault' | 'defaultBrick' | 'defaultClear' | 'brickClear' | 'roundClear' | 'clearRound' | 'clearDefault' | 'clearBrick' | 'clearClear';
|
|
4
|
+
export declare type FieldGroupPropSize = 'm' | 'xs' | 's' | 'l';
|
|
5
|
+
export declare type FieldGroupPropChildren = React.ReactElement<{
|
|
6
|
+
form?: FieldGroupPropForm;
|
|
7
|
+
size?: FieldGroupPropSize;
|
|
8
|
+
className?: string;
|
|
9
|
+
}>[];
|
|
10
|
+
export declare type FieldGroupProps = PropsWithHTMLAttributes<{
|
|
11
|
+
children: FieldGroupPropChildren;
|
|
12
|
+
form?: FieldGroupPropForm;
|
|
13
|
+
size?: FieldGroupPropSize;
|
|
14
|
+
}, HTMLDivElement>;
|
|
File without changes
|
|
@@ -6,7 +6,7 @@ import { useSelect } from '../../hooks/useSelect/useSelect';
|
|
|
6
6
|
import { IconSelect } from '../../icons/IconSelect/IconSelect';
|
|
7
7
|
import { usePropsHandler } from '../EventInterceptor/usePropsHandler';
|
|
8
8
|
import { cnSelect, COMPONENT_NAME } from '../SelectComponents/cnSelect';
|
|
9
|
-
import { defaultLabelForEmptyItems
|
|
9
|
+
import { defaultLabelForEmptyItems } from '../SelectComponents/helpers';
|
|
10
10
|
import { SelectContainer } from '../SelectComponents/SelectContainer/SelectContainer';
|
|
11
11
|
import { SelectDropdown } from '../SelectComponents/SelectDropdown/SelectDropdown';
|
|
12
12
|
import { SelectItem } from '../SelectComponents/SelectItem/SelectItem';
|
|
@@ -15,8 +15,8 @@ import { withDefaultGetters, } from './helpers';
|
|
|
15
15
|
function SelectRender(props, ref) {
|
|
16
16
|
var defaultDropdownRef = useRef(null);
|
|
17
17
|
var controlRef = useRef(null);
|
|
18
|
-
var _a = usePropsHandler(COMPONENT_NAME, withDefaultGetters(props), controlRef), placeholder = _a.placeholder, onBlur = _a.onBlur, onFocus = _a.onFocus, items = _a.items, onChange = _a.onChange, value = _a.value, required = _a.required, disabled = _a.disabled, ariaLabel = _a.ariaLabel, id = _a.id, _b = _a.dropdownRef, dropdownRef = _b === void 0 ? defaultDropdownRef : _b, _c = _a.form, form = _c === void 0 ? defaultPropForm : _c, _d = _a.view, view = _d === void 0 ? defaultPropView : _d, _e = _a.size, size = _e === void 0 ? defaultPropSize : _e, dropdownClassName = _a.dropdownClassName, name = _a.name, _f = _a.groups, groups = _f === void 0 ? [] : _f, getItemLabel = _a.getItemLabel, _g = _a.labelForEmptyItems, labelForEmptyItems = _g === void 0 ? defaultLabelForEmptyItems : _g, getItemKey = _a.getItemKey, getItemGroupKey = _a.getItemGroupKey, getItemDisabled = _a.getItemDisabled, getGroupKey = _a.getGroupKey, getGroupLabel = _a.getGroupLabel, renderItem = _a.renderItem, isLoading = _a.isLoading, renderValueProp = _a.renderValue, inputRefProp = _a.inputRef, style = _a.style, restProps = __rest(_a, ["placeholder", "onBlur", "onFocus", "items", "onChange", "value", "required", "disabled", "ariaLabel", "id", "dropdownRef", "form", "view", "size", "dropdownClassName", "name", "groups", "getItemLabel", "labelForEmptyItems", "getItemKey", "getItemGroupKey", "getItemDisabled", "getGroupKey", "getGroupLabel", "renderItem", "isLoading", "renderValue", "inputRef", "style"]);
|
|
19
|
-
var
|
|
18
|
+
var _a = usePropsHandler(COMPONENT_NAME, withDefaultGetters(props), controlRef), placeholder = _a.placeholder, onBlur = _a.onBlur, onFocus = _a.onFocus, items = _a.items, onChange = _a.onChange, value = _a.value, required = _a.required, disabled = _a.disabled, ariaLabel = _a.ariaLabel, id = _a.id, _b = _a.dropdownRef, dropdownRef = _b === void 0 ? defaultDropdownRef : _b, _c = _a.form, form = _c === void 0 ? defaultPropForm : _c, _d = _a.view, view = _d === void 0 ? defaultPropView : _d, _e = _a.size, size = _e === void 0 ? defaultPropSize : _e, dropdownClassName = _a.dropdownClassName, name = _a.name, _f = _a.groups, groups = _f === void 0 ? [] : _f, getItemLabel = _a.getItemLabel, _g = _a.labelForEmptyItems, labelForEmptyItems = _g === void 0 ? defaultLabelForEmptyItems : _g, getItemKey = _a.getItemKey, getItemGroupKey = _a.getItemGroupKey, getItemDisabled = _a.getItemDisabled, getGroupKey = _a.getGroupKey, getGroupLabel = _a.getGroupLabel, renderItem = _a.renderItem, isLoading = _a.isLoading, renderValueProp = _a.renderValue, inputRefProp = _a.inputRef, style = _a.style, _h = _a.dropdownForm, dropdownForm = _h === void 0 ? 'default' : _h, restProps = __rest(_a, ["placeholder", "onBlur", "onFocus", "items", "onChange", "value", "required", "disabled", "ariaLabel", "id", "dropdownRef", "form", "view", "size", "dropdownClassName", "name", "groups", "getItemLabel", "labelForEmptyItems", "getItemKey", "getItemGroupKey", "getItemDisabled", "getGroupKey", "getGroupLabel", "renderItem", "isLoading", "renderValue", "inputRef", "style", "dropdownForm"]);
|
|
19
|
+
var _j = useSelect({
|
|
20
20
|
items: items,
|
|
21
21
|
groups: groups,
|
|
22
22
|
value: value,
|
|
@@ -32,8 +32,7 @@ function SelectRender(props, ref) {
|
|
|
32
32
|
multiple: false,
|
|
33
33
|
onBlur: onBlur,
|
|
34
34
|
onFocus: onFocus
|
|
35
|
-
}), getKeyProps =
|
|
36
|
-
var dropdownForm = getSelectDropdownForm(form);
|
|
35
|
+
}), getKeyProps = _j.getKeyProps, getOptionProps = _j.getOptionProps, isOpen = _j.isOpen, visibleItems = _j.visibleItems, isFocused = _j.isFocused, handleInputFocus = _j.handleInputFocus, handleInputBlur = _j.handleInputBlur, handleToggleDropdown = _j.handleToggleDropdown, inputRef = _j.inputRef, handleInputClick = _j.handleInputClick, notFound = _j.notFound, hasItems = _j.hasItems;
|
|
37
36
|
var renderItemDefault = function (props) {
|
|
38
37
|
var item = props.item, active = props.active, hovered = props.hovered, onClick = props.onClick, onMouseEnter = props.onMouseEnter;
|
|
39
38
|
return (React.createElement(SelectItem, { label: getItemLabel(item), active: active, hovered: hovered, multiple: false, size: size, indent: dropdownForm === 'round' ? 'increased' : 'normal', onClick: onClick, onMouseEnter: onMouseEnter, disabled: getItemDisabled(item) }));
|
|
@@ -31,6 +31,7 @@ export declare type SelectProps<ITEM = DefaultItem, GROUP = DefaultGroup> = Prop
|
|
|
31
31
|
}) => void;
|
|
32
32
|
disabled?: boolean;
|
|
33
33
|
form?: PropForm;
|
|
34
|
+
dropdownForm?: 'default' | 'brick' | 'round';
|
|
34
35
|
size?: PropSize;
|
|
35
36
|
view?: PropView;
|
|
36
37
|
status?: PropStatus;
|
|
@@ -92,6 +93,7 @@ export declare function withDefaultGetters<ITEM, GROUP>(props: SelectProps<ITEM,
|
|
|
92
93
|
}) => void;
|
|
93
94
|
disabled?: boolean | undefined;
|
|
94
95
|
form?: "default" | "round" | "brick" | "brickDefault" | "defaultBrick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "brickClear" | "clearBrick" | "clearClear" | undefined;
|
|
96
|
+
dropdownForm?: "default" | "round" | "brick" | undefined;
|
|
95
97
|
size?: "xs" | "s" | "m" | "l" | undefined;
|
|
96
98
|
view?: "default" | "clear" | undefined;
|
|
97
99
|
status?: "alert" | "success" | "warning" | undefined;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { SelectDropdownPropForm } from './SelectDropdown/SelectDropdown';
|
|
2
|
-
import { PropForm } from './types';
|
|
3
|
-
export declare function getSelectDropdownForm(form: PropForm): SelectDropdownPropForm;
|
|
4
1
|
export declare const defaultlabelForNotFound = "\u041D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E";
|
|
5
2
|
export declare const defaultlabelForCreate = "+";
|
|
6
3
|
export declare const defaultLabelForEmptyItems = "\u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0443\u0441\u0442";
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
import { selectDropdownform } from './SelectDropdown/SelectDropdown';
|
|
2
|
-
var mapDropdownForms = {
|
|
3
|
-
"default": selectDropdownform[0],
|
|
4
|
-
brick: selectDropdownform[1],
|
|
5
|
-
round: selectDropdownform[2],
|
|
6
|
-
clearRound: selectDropdownform[2],
|
|
7
|
-
roundClear: selectDropdownform[2],
|
|
8
|
-
clearDefault: selectDropdownform[0],
|
|
9
|
-
defaultClear: selectDropdownform[0],
|
|
10
|
-
defaultBrick: selectDropdownform[0],
|
|
11
|
-
brickDefault: selectDropdownform[1],
|
|
12
|
-
brickClear: selectDropdownform[1],
|
|
13
|
-
clearBrick: selectDropdownform[1],
|
|
14
|
-
clearClear: selectDropdownform[0]
|
|
15
|
-
};
|
|
16
|
-
export function getSelectDropdownForm(form) {
|
|
17
|
-
return mapDropdownForms[form];
|
|
18
|
-
}
|
|
19
1
|
export var defaultlabelForNotFound = 'Не найдено';
|
|
20
2
|
export var defaultlabelForCreate = '+';
|
|
21
3
|
export var defaultLabelForEmptyItems = 'Список пуст';
|
|
@@ -47,8 +47,8 @@ export var Sidebar = function (props) {
|
|
|
47
47
|
useGlobalKeys({
|
|
48
48
|
Escape: function (e) { return isOpen && onEsc && onEsc(e); }
|
|
49
49
|
});
|
|
50
|
-
return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, className: cnSidebar({ position: position, hasOverlay: hasOverlay }), classNames: cnForCssTransition(cnSidebar), timeout: 240, nodeRef: portalRef },
|
|
51
|
-
React.createElement(PortalWithTheme, { preset: theme, ref: portalRef, container: container,
|
|
50
|
+
return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, className: cnSidebar({ position: position, hasOverlay: hasOverlay }, [rootClassName]), classNames: cnForCssTransition(cnSidebar), timeout: 240, nodeRef: portalRef },
|
|
51
|
+
React.createElement(PortalWithTheme, { preset: theme, ref: portalRef, container: container, style: typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' ? { zIndex: style.zIndex } : undefined },
|
|
52
52
|
hasOverlay && React.createElement("div", { className: cnSidebar('Overlay'), "aria-label": "Overlay" }),
|
|
53
53
|
React.createElement("div", __assign({}, otherProps, { style: __assign(__assign({}, style), { zIndex: undefined }), className: cnSidebar('Window', { size: size, position: position }, [className]), ref: ref }),
|
|
54
54
|
React.createElement(ContextConsumer, { onClickOutside: onClickOutside || onOverlayClick, ignoreClicksInsideRefs: [ref] }, children)))));
|
|
@@ -8,7 +8,7 @@ import { IconSelect } from '../../icons/IconSelect/IconSelect';
|
|
|
8
8
|
import { cnMixFocus } from '../../mixs/MixFocus/MixFocus';
|
|
9
9
|
import { usePropsHandler } from '../EventInterceptor/usePropsHandler';
|
|
10
10
|
import { cnSelect } from '../SelectComponents/cnSelect';
|
|
11
|
-
import { defaultlabelForCreate, defaultLabelForEmptyItems, defaultlabelForNotFound, getInputWidth,
|
|
11
|
+
import { defaultlabelForCreate, defaultLabelForEmptyItems, defaultlabelForNotFound, getInputWidth, } from '../SelectComponents/helpers';
|
|
12
12
|
import { SelectContainer } from '../SelectComponents/SelectContainer/SelectContainer';
|
|
13
13
|
import { SelectDropdown } from '../SelectComponents/SelectDropdown/SelectDropdown';
|
|
14
14
|
import { defaultPropForm, defaultPropSize, defaultPropView } from '../SelectComponents/types';
|
|
@@ -21,7 +21,7 @@ function UserSelectRender(props, ref) {
|
|
|
21
21
|
var controlInnerRef = useRef(null);
|
|
22
22
|
var helperInputFakeElement = useRef(null);
|
|
23
23
|
var controlRef = useRef(null);
|
|
24
|
-
var _a = usePropsHandler(COMPONENT_NAME, withDefaultGetters(props), controlRef), placeholder = _a.placeholder, onBlur = _a.onBlur, onFocus = _a.onFocus, items = _a.items, onChange = _a.onChange, value = _a.value, disabled = _a.disabled, ariaLabel = _a.ariaLabel, id = _a.id, isLoading = _a.isLoading, required = _a.required, _b = _a.dropdownRef, dropdownRef = _b === void 0 ? defaultDropdownRef : _b, _c = _a.form, form = _c === void 0 ? defaultPropForm : _c, _d = _a.view, view = _d === void 0 ? defaultPropView : _d, _e = _a.size, size = _e === void 0 ? defaultPropSize : _e, dropdownClassName = _a.dropdownClassName, name = _a.name, _f = _a.groups, groups = _f === void 0 ? [] : _f, getItemKey = _a.getItemKey, getItemLabel = _a.getItemLabel, getItemSubLabel = _a.getItemSubLabel, getItemAvatarUrl = _a.getItemAvatarUrl, getItemGroupKey = _a.getItemGroupKey, getItemDisabled = _a.getItemDisabled, getGroupKey = _a.getGroupKey, getGroupLabel = _a.getGroupLabel, renderItem = _a.renderItem, renderValueProp = _a.renderValue, onCreate = _a.onCreate, inputRefProp = _a.inputRef, _g = _a.labelForNotFound, labelForNotFound = _g === void 0 ? defaultlabelForNotFound : _g, _h = _a.labelForCreate, labelForCreate = _h === void 0 ? defaultlabelForCreate : _h, _j = _a.labelForEmptyItems, labelForEmptyItems = _j === void 0 ? defaultLabelForEmptyItems : _j, _k = _a.multiple, multiple = _k === void 0 ? false : _k, searchFunction = _a.searchFunction, style = _a.style, restProps = __rest(_a, ["placeholder", "onBlur", "onFocus", "items", "onChange", "value", "disabled", "ariaLabel", "id", "isLoading", "required", "dropdownRef", "form", "view", "size", "dropdownClassName", "name", "groups", "getItemKey", "getItemLabel", "getItemSubLabel", "getItemAvatarUrl", "getItemGroupKey", "getItemDisabled", "getGroupKey", "getGroupLabel", "renderItem", "renderValue", "onCreate", "inputRef", "labelForNotFound", "labelForCreate", "labelForEmptyItems", "multiple", "searchFunction", "style"]);
|
|
24
|
+
var _a = usePropsHandler(COMPONENT_NAME, withDefaultGetters(props), controlRef), placeholder = _a.placeholder, onBlur = _a.onBlur, onFocus = _a.onFocus, items = _a.items, onChange = _a.onChange, value = _a.value, disabled = _a.disabled, ariaLabel = _a.ariaLabel, id = _a.id, isLoading = _a.isLoading, required = _a.required, _b = _a.dropdownRef, dropdownRef = _b === void 0 ? defaultDropdownRef : _b, _c = _a.form, form = _c === void 0 ? defaultPropForm : _c, _d = _a.view, view = _d === void 0 ? defaultPropView : _d, _e = _a.size, size = _e === void 0 ? defaultPropSize : _e, dropdownClassName = _a.dropdownClassName, name = _a.name, _f = _a.groups, groups = _f === void 0 ? [] : _f, getItemKey = _a.getItemKey, getItemLabel = _a.getItemLabel, getItemSubLabel = _a.getItemSubLabel, getItemAvatarUrl = _a.getItemAvatarUrl, getItemGroupKey = _a.getItemGroupKey, getItemDisabled = _a.getItemDisabled, getGroupKey = _a.getGroupKey, getGroupLabel = _a.getGroupLabel, renderItem = _a.renderItem, renderValueProp = _a.renderValue, onCreate = _a.onCreate, inputRefProp = _a.inputRef, _g = _a.labelForNotFound, labelForNotFound = _g === void 0 ? defaultlabelForNotFound : _g, _h = _a.labelForCreate, labelForCreate = _h === void 0 ? defaultlabelForCreate : _h, _j = _a.labelForEmptyItems, labelForEmptyItems = _j === void 0 ? defaultLabelForEmptyItems : _j, _k = _a.multiple, multiple = _k === void 0 ? false : _k, searchFunction = _a.searchFunction, style = _a.style, _l = _a.dropdownForm, dropdownForm = _l === void 0 ? 'default' : _l, restProps = __rest(_a, ["placeholder", "onBlur", "onFocus", "items", "onChange", "value", "disabled", "ariaLabel", "id", "isLoading", "required", "dropdownRef", "form", "view", "size", "dropdownClassName", "name", "groups", "getItemKey", "getItemLabel", "getItemSubLabel", "getItemAvatarUrl", "getItemGroupKey", "getItemDisabled", "getGroupKey", "getGroupLabel", "renderItem", "renderValue", "onCreate", "inputRef", "labelForNotFound", "labelForCreate", "labelForEmptyItems", "multiple", "searchFunction", "style", "dropdownForm"]);
|
|
25
25
|
var searchFunctionDefault = function (item, searchValue) {
|
|
26
26
|
var searchOfLabel = searchCompare(searchValue, getItemLabel(item));
|
|
27
27
|
if (searchOfLabel) {
|
|
@@ -29,7 +29,7 @@ function UserSelectRender(props, ref) {
|
|
|
29
29
|
}
|
|
30
30
|
return searchCompare(searchValue, getItemSubLabel(item));
|
|
31
31
|
};
|
|
32
|
-
var
|
|
32
|
+
var _m = useSelect({
|
|
33
33
|
items: items,
|
|
34
34
|
groups: groups,
|
|
35
35
|
value: value,
|
|
@@ -47,8 +47,7 @@ function UserSelectRender(props, ref) {
|
|
|
47
47
|
onFocus: onFocus,
|
|
48
48
|
onCreate: onCreate,
|
|
49
49
|
searchFunction: searchFunction || searchFunctionDefault
|
|
50
|
-
}), getKeyProps =
|
|
51
|
-
var dropdownForm = getSelectDropdownForm(form);
|
|
50
|
+
}), getKeyProps = _m.getKeyProps, getOptionProps = _m.getOptionProps, isOpen = _m.isOpen, visibleItems = _m.visibleItems, isFocused = _m.isFocused, handleInputFocus = _m.handleInputFocus, handleInputBlur = _m.handleInputBlur, handleToggleDropdown = _m.handleToggleDropdown, inputRef = _m.inputRef, handleInputClick = _m.handleInputClick, handleInputChange = _m.handleInputChange, searchValue = _m.searchValue, clearValue = _m.clearValue, getHandleRemoveValue = _m.getHandleRemoveValue, notFound = _m.notFound, hasItems = _m.hasItems;
|
|
52
51
|
var renderItemDefault = function (props) {
|
|
53
52
|
var item = props.item, active = props.active, hovered = props.hovered, onClick = props.onClick, onMouseEnter = props.onMouseEnter;
|
|
54
53
|
return (React.createElement(UserSelectItem, { label: getItemLabel(item), subLabel: getItemSubLabel(item), avatarUrl: getItemAvatarUrl(item), active: active, hovered: hovered, size: size, indent: dropdownForm === 'round' ? 'increased' : 'normal', onClick: onClick, onMouseEnter: onMouseEnter, disable: getItemDisabled(item), multiple: multiple }));
|
|
@@ -38,6 +38,7 @@ export declare type UserSelectProps<ITEM = DefaultItem, GROUP = DefaultGroup, MU
|
|
|
38
38
|
form?: PropForm;
|
|
39
39
|
size?: Exclude<PropSize, 'xs'>;
|
|
40
40
|
view?: PropView;
|
|
41
|
+
dropdownForm?: 'default' | 'brick' | 'round';
|
|
41
42
|
placeholder?: string;
|
|
42
43
|
ariaLabel?: string;
|
|
43
44
|
dropdownClassName?: string;
|
|
@@ -108,6 +109,7 @@ export declare function withDefaultGetters<ITEM = DefaultItem, GROUP = DefaultGr
|
|
|
108
109
|
form?: "default" | "round" | "brick" | "brickDefault" | "defaultBrick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "brickClear" | "clearBrick" | "clearClear" | undefined;
|
|
109
110
|
size?: "s" | "m" | "l" | undefined;
|
|
110
111
|
view?: "default" | "clear" | undefined;
|
|
112
|
+
dropdownForm?: "default" | "round" | "brick" | undefined;
|
|
111
113
|
placeholder?: string | undefined;
|
|
112
114
|
ariaLabel?: string | undefined;
|
|
113
115
|
dropdownClassName?: string | undefined;
|
package/createIcon/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@consta/uikit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.25.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"ui-kit",
|
|
6
6
|
"design-system",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"DragNDropField",
|
|
51
51
|
"EventInterceptor",
|
|
52
52
|
"FieldCaption",
|
|
53
|
+
"FieldGroup",
|
|
53
54
|
"FieldLabel",
|
|
54
55
|
"File",
|
|
55
56
|
"FileField",
|
package/useDebounce/package.json
CHANGED
package/useFlag/package.json
CHANGED
package/useForkRef/package.json
CHANGED
package/useKeys/package.json
CHANGED
package/useOverflow/package.json
CHANGED
package/usePrevious/package.json
CHANGED
package/useRefs/package.json
CHANGED