@consta/uikit 3.24.5 → 3.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +45 -35
- 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/ProgressLine/es.js +1 -0
- package/ProgressLine/index.d.ts +1 -0
- package/ProgressLine/index.js +4 -0
- package/ProgressLine/package.json +9 -0
- 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/Card/Card.d.ts +1 -0
- package/__internal__/cjs-src/components/Card/Card.js +2 -2
- 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/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts +8 -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/ProgressLine/ProgressLine.css +67 -0
- package/__internal__/cjs-src/components/ProgressLine/ProgressLine.d.ts +3 -0
- package/__internal__/cjs-src/components/ProgressLine/ProgressLine.js +27 -0
- package/__internal__/cjs-src/components/ProgressLine/types.d.ts +10 -0
- package/__internal__/cjs-src/components/ProgressLine/types.js +5 -0
- package/__internal__/cjs-src/components/ProgressSpin/ProgressSpin.d.ts +1 -0
- package/__internal__/cjs-src/components/ProgressSpin/ProgressSpin.js +2 -1
- 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/SliderCanary/SliderCanary.js +19 -11
- package/__internal__/cjs-src/components/SliderCanary/SliderLine/SliderLine.css +2 -2
- package/__internal__/cjs-src/components/SliderCanary/SliderPoint/SliderPoint.css +2 -4
- package/__internal__/cjs-src/components/SliderCanary/useSlider/helper.d.ts +3 -2
- package/__internal__/cjs-src/components/SliderCanary/useSlider/helper.js +37 -14
- package/__internal__/cjs-src/components/SliderCanary/useSlider/useSlider.d.ts +1 -0
- package/__internal__/cjs-src/components/SliderCanary/useSlider/useSlider.js +32 -4
- package/__internal__/cjs-src/components/SliderCanary/useSliderStationing.d.ts +1 -1
- package/__internal__/cjs-src/components/SliderCanary/useSliderStationing.js +14 -3
- package/__internal__/cjs-src/components/TextField/TextField.js +13 -5
- package/__internal__/cjs-src/components/TextField/types.d.ts +7 -0
- package/__internal__/cjs-src/components/User/User.css +1 -0
- package/__internal__/cjs-src/components/UserSelect/UserSelect.js +3 -4
- package/__internal__/cjs-src/components/UserSelect/helpers.d.ts +2 -0
- package/__internal__/cjs-src/mixs/MixCard/MixCard.css +4 -0
- package/__internal__/cjs-src/mixs/MixCard/MixCard.d.ts +1 -0
- package/__internal__/src/components/Button/Button.d.ts +1 -1
- package/__internal__/src/components/Button/Button.js +17 -1
- package/__internal__/src/components/Card/Card.d.ts +1 -0
- package/__internal__/src/components/Card/Card.js +2 -2
- 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/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts +8 -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/ProgressLine/ProgressLine.css +67 -0
- package/__internal__/src/components/ProgressLine/ProgressLine.d.ts +3 -0
- package/__internal__/src/components/ProgressLine/ProgressLine.js +24 -0
- package/__internal__/src/components/ProgressLine/types.d.ts +10 -0
- package/__internal__/src/components/ProgressLine/types.js +2 -0
- package/__internal__/src/components/ProgressSpin/ProgressSpin.d.ts +1 -0
- package/__internal__/src/components/ProgressSpin/ProgressSpin.js +2 -1
- 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/SliderCanary/SliderCanary.js +19 -11
- package/__internal__/src/components/SliderCanary/SliderLine/SliderLine.css +2 -2
- package/__internal__/src/components/SliderCanary/SliderPoint/SliderPoint.css +2 -4
- package/__internal__/src/components/SliderCanary/useSlider/helper.d.ts +3 -2
- package/__internal__/src/components/SliderCanary/useSlider/helper.js +37 -14
- package/__internal__/src/components/SliderCanary/useSlider/useSlider.d.ts +1 -0
- package/__internal__/src/components/SliderCanary/useSlider/useSlider.js +32 -4
- package/__internal__/src/components/SliderCanary/useSliderStationing.d.ts +1 -1
- package/__internal__/src/components/SliderCanary/useSliderStationing.js +15 -4
- package/__internal__/src/components/TextField/TextField.js +13 -5
- package/__internal__/src/components/TextField/types.d.ts +7 -0
- package/__internal__/src/components/User/User.css +1 -0
- package/__internal__/src/components/UserSelect/UserSelect.js +4 -5
- package/__internal__/src/components/UserSelect/helpers.d.ts +2 -0
- package/__internal__/src/mixs/MixCard/MixCard.css +4 -0
- package/__internal__/src/mixs/MixCard/MixCard.d.ts +1 -0
- package/createIcon/package.json +1 -1
- package/createResponsesImage/package.json +1 -1
- package/package.json +3 -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
|
@@ -46,14 +46,22 @@ exports.detectActiveButton = function (position, buttons) {
|
|
|
46
46
|
};
|
|
47
47
|
exports.getValidValue = function (value, min, max, step) {
|
|
48
48
|
if (typeof value === 'number') {
|
|
49
|
-
if (value
|
|
49
|
+
if (value >= max)
|
|
50
50
|
return max;
|
|
51
|
-
if (value
|
|
51
|
+
if (value <= min)
|
|
52
52
|
return min;
|
|
53
53
|
if (!Array.isArray(step)) {
|
|
54
54
|
var division = step === null || step === void 0 ? void 0 : step.toString().split('.')[1];
|
|
55
55
|
var stepValue = step || 1;
|
|
56
|
-
|
|
56
|
+
if (Math.abs(value) < 1) {
|
|
57
|
+
return Number(value.toFixed(division ? division.length : 0));
|
|
58
|
+
}
|
|
59
|
+
var roundValue = Math.round(Number(value.toFixed(division ? division.length : 0)) / stepValue) * stepValue;
|
|
60
|
+
if (roundValue > max)
|
|
61
|
+
return max;
|
|
62
|
+
if (roundValue < min)
|
|
63
|
+
return min;
|
|
64
|
+
return Number(roundValue.toFixed(division ? division.length : 0));
|
|
57
65
|
}
|
|
58
66
|
var resultValue_1 = value;
|
|
59
67
|
step.forEach(function (stepPoint, index) {
|
|
@@ -86,12 +94,12 @@ exports.getValidValue = function (value, min, max, step) {
|
|
|
86
94
|
exports.isValidValue = function (value, min, max, step) {
|
|
87
95
|
return exports.getValidValue(value, min, max, step) === value;
|
|
88
96
|
};
|
|
89
|
-
exports.getValueByPosition = function (position, sliderRef, min, max) {
|
|
97
|
+
exports.getValueByPosition = function (position, sliderRef, min, max, step) {
|
|
90
98
|
if (sliderRef.current && position) {
|
|
91
99
|
var _a = sliderRef.current.getBoundingClientRect(), x = _a.x, width = _a.width;
|
|
92
100
|
var absoluteSize = Math.abs(max - min);
|
|
93
101
|
var value = min + ((position.x - x) * absoluteSize) / width;
|
|
94
|
-
return exports.getValidValue(value, min, max);
|
|
102
|
+
return exports.getValidValue(value, min, max, step);
|
|
95
103
|
}
|
|
96
104
|
return 0;
|
|
97
105
|
};
|
|
@@ -114,17 +122,32 @@ exports.getNewValue = function (changedValue, currentValue, step, min, max, acti
|
|
|
114
122
|
return analyzedValue;
|
|
115
123
|
};
|
|
116
124
|
exports.analyzeDivisionValue = function (value, step, min, max) {
|
|
117
|
-
var steps = useSliderStationing_1.getSteps(step, min, max);
|
|
118
125
|
var newValue = value;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
if (Array.isArray(step)) {
|
|
127
|
+
var steps = useSliderStationing_1.getSteps(step, min, max);
|
|
128
|
+
steps.forEach(function (stepSize) {
|
|
129
|
+
if (value && stepSize.min < value && stepSize.max >= value) {
|
|
130
|
+
if ((stepSize.max + stepSize.min) / 2 > value) {
|
|
131
|
+
newValue = stepSize.min;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
newValue = stepSize.max;
|
|
135
|
+
}
|
|
126
136
|
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
if (value >= max)
|
|
141
|
+
return max;
|
|
142
|
+
if (value <= min)
|
|
143
|
+
return min;
|
|
144
|
+
var nearStep = (value - min) % step;
|
|
145
|
+
if (nearStep > step / 2) {
|
|
146
|
+
newValue = step - nearStep + value;
|
|
127
147
|
}
|
|
128
|
-
|
|
148
|
+
else {
|
|
149
|
+
newValue = value - nearStep;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
129
152
|
return newValue;
|
|
130
153
|
};
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.useSlider = void 0;
|
|
3
|
+
exports.useSlider = exports.COUNT_STEPS = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var react_1 = require("react");
|
|
6
6
|
var useComponentSize_1 = require("../../../hooks/useComponentSize/useComponentSize");
|
|
7
7
|
var useMutableRef_1 = require("../../../hooks/useMutableRef/useMutableRef");
|
|
8
8
|
var helper_1 = require("./helper");
|
|
9
|
+
exports.COUNT_STEPS = 250;
|
|
9
10
|
function useSlider(props) {
|
|
10
11
|
var disabled = props.disabled, range = props.range, value = props.value, min = props.min, max = props.max, _a = props.step, step = _a === void 0 ? 1 : _a, onChange = props.onChange, onAfterChange = props.onAfterChange, sliderRef = props.sliderRef, buttonRefs = props.buttonRefs;
|
|
11
12
|
var minValue = max > min ? min : 0;
|
|
12
13
|
var maxValue = max > min ? max : 100;
|
|
14
|
+
var dragStepValue = react_1.useMemo(function () {
|
|
15
|
+
if (!Array.isArray(step)) {
|
|
16
|
+
if (step >= 1) {
|
|
17
|
+
var val = Math.abs((maxValue - minValue) / exports.COUNT_STEPS);
|
|
18
|
+
if (val > step) {
|
|
19
|
+
return val - (val % step);
|
|
20
|
+
}
|
|
21
|
+
return Math.max(val, step);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return step;
|
|
25
|
+
}, [max, min, step]);
|
|
13
26
|
var _b = tslib_1.__read(react_1.useState(value), 2), currentValue = _b[0], setCurrentValue = _b[1];
|
|
14
27
|
var _c = tslib_1.__read(react_1.useState(null), 2), leftPopover = _c[0], setLeftPopover = _c[1];
|
|
15
28
|
var _d = tslib_1.__read(react_1.useState(null), 2), rightPopover = _d[0], setRightPopover = _d[1];
|
|
@@ -74,6 +87,20 @@ function useSlider(props) {
|
|
|
74
87
|
}
|
|
75
88
|
}
|
|
76
89
|
}, []);
|
|
90
|
+
var onSliderClick = function (e) {
|
|
91
|
+
if (helper_1.isNotRangeParams(props)) {
|
|
92
|
+
var positionValue = helper_1.getValueByPosition({ x: e.pageX, y: e.pageY }, sliderRef, minValue, maxValue, step);
|
|
93
|
+
var newValue = helper_1.getNewValue(positionValue, currentValue, dragStepValue, min, max, activeButton.current);
|
|
94
|
+
if (newValue !== value) {
|
|
95
|
+
setCurrentValue(newValue);
|
|
96
|
+
setTooltipPosition(helper_1.getActiveValue(newValue, 0), 0);
|
|
97
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
98
|
+
e: e,
|
|
99
|
+
value: newValue
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
77
104
|
var onKeyPress = react_1.useCallback(function (event, typeButton) {
|
|
78
105
|
if (!disabled && typeof typeButton === 'number' && typeof currentValue !== 'undefined') {
|
|
79
106
|
var stepIncrement_1 = !Array.isArray(step) ? step || 1 : 1;
|
|
@@ -151,8 +178,8 @@ function useSlider(props) {
|
|
|
151
178
|
return value;
|
|
152
179
|
}
|
|
153
180
|
var position = helper_1.trackPosition(nativeEvent);
|
|
154
|
-
var positionValue = helper_1.getValueByPosition(position, sliderRef, minValue, maxValue);
|
|
155
|
-
return helper_1.getNewValue(positionValue, currentValue,
|
|
181
|
+
var positionValue = helper_1.getValueByPosition(position, sliderRef, minValue, maxValue, step);
|
|
182
|
+
return helper_1.getNewValue(positionValue, currentValue, dragStepValue, min, max, activeButton.current);
|
|
156
183
|
};
|
|
157
184
|
var onFocus = function (e, button) {
|
|
158
185
|
activeButton.current = button;
|
|
@@ -163,8 +190,8 @@ function useSlider(props) {
|
|
|
163
190
|
var position = changePosition(event);
|
|
164
191
|
var oldValue = helper_1.getActiveValue(currentValue, button);
|
|
165
192
|
var newValue = helper_1.getActiveValue(position, button);
|
|
193
|
+
setCurrentValue(position);
|
|
166
194
|
if (oldValue !== newValue) {
|
|
167
|
-
setCurrentValue(position);
|
|
168
195
|
onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange({ e: event, value: position });
|
|
169
196
|
}
|
|
170
197
|
}
|
|
@@ -202,6 +229,7 @@ function useSlider(props) {
|
|
|
202
229
|
onKeyPress: onKeyPress,
|
|
203
230
|
onFocus: onFocus,
|
|
204
231
|
handlePress: handlePress,
|
|
232
|
+
onSliderClick: onSliderClick,
|
|
205
233
|
activeButton: activeButton.current,
|
|
206
234
|
popoverPosition: [leftPopover, rightPopover],
|
|
207
235
|
currentValue: Array.isArray(currentValue) ? currentValue : [currentValue]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Line, PropView } from './helper';
|
|
3
|
-
declare type UseSliderStationing = (value: number | [number, number] | undefined, min: number, max: number, view: PropView, range: boolean | undefined, step: number | number[] | undefined, buttonRefs: [React.RefObject<HTMLButtonElement>, React.RefObject<HTMLButtonElement>], sliderLineRef: React.RefObject<HTMLDivElement>) => {
|
|
3
|
+
declare type UseSliderStationing = (value: number | [number, number] | undefined, min: number, max: number, view: PropView, range: boolean | undefined, step: number | number[] | undefined, buttonRefs: [React.RefObject<HTMLButtonElement>, React.RefObject<HTMLButtonElement>], sliderLineRef: React.RefObject<HTMLButtonElement | HTMLDivElement>) => {
|
|
4
4
|
lineSizes: Line[];
|
|
5
5
|
buttonPositions: number[];
|
|
6
6
|
};
|
|
@@ -3,6 +3,7 @@ exports.__esModule = true;
|
|
|
3
3
|
exports.useSliderStationing = exports.getSteps = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var react_1 = require("react");
|
|
6
|
+
var useSlider_1 = require("./useSlider/useSlider");
|
|
6
7
|
exports.getSteps = function (step, min, max) {
|
|
7
8
|
var stepsArray = [];
|
|
8
9
|
var size = min;
|
|
@@ -29,6 +30,16 @@ exports.useSliderStationing = function (value, min, max, view, range, step, butt
|
|
|
29
30
|
if (step === void 0) { step = 1; }
|
|
30
31
|
var _a = tslib_1.__read(react_1.useState([]), 2), lineSizes = _a[0], setLineSizes = _a[1];
|
|
31
32
|
var _b = tslib_1.__read(react_1.useState([]), 2), buttonPositions = _b[0], setButtonPositions = _b[1];
|
|
33
|
+
var calcualtedStep = react_1.useMemo(function () {
|
|
34
|
+
if (!Array.isArray(step)) {
|
|
35
|
+
var val = Math.abs((max - min) / useSlider_1.COUNT_STEPS);
|
|
36
|
+
if (val > step) {
|
|
37
|
+
return val - (val % step);
|
|
38
|
+
}
|
|
39
|
+
return Math.max(val, step);
|
|
40
|
+
}
|
|
41
|
+
return step;
|
|
42
|
+
}, [max, min, step]);
|
|
32
43
|
var calculateLines = function () {
|
|
33
44
|
var sizesArray = [];
|
|
34
45
|
var absoluteSize = Math.abs(max - min);
|
|
@@ -62,8 +73,8 @@ exports.useSliderStationing = function (value, min, max, view, range, step, butt
|
|
|
62
73
|
});
|
|
63
74
|
}
|
|
64
75
|
}
|
|
65
|
-
else if (typeof
|
|
66
|
-
exports.getSteps(
|
|
76
|
+
else if (typeof calcualtedStep !== 'undefined') {
|
|
77
|
+
exports.getSteps(calcualtedStep, min, max).forEach(function (stepSize) {
|
|
67
78
|
sizesArray.push({
|
|
68
79
|
width: (Math.abs(stepSize.max - stepSize.min) * 100) / absoluteSize,
|
|
69
80
|
active: (typeof value === 'number' || Array.isArray(value)) &&
|
|
@@ -114,7 +125,7 @@ exports.useSliderStationing = function (value, min, max, view, range, step, butt
|
|
|
114
125
|
react_1.useEffect(function () {
|
|
115
126
|
setLineSizes(calculateLines());
|
|
116
127
|
setButtonPositions(calculateButtonPositions());
|
|
117
|
-
}, [value, min, max, range,
|
|
128
|
+
}, [value, min, max, range, calcualtedStep, view]);
|
|
118
129
|
return {
|
|
119
130
|
lineSizes: lineSizes,
|
|
120
131
|
buttonPositions: buttonPositions
|
|
@@ -27,9 +27,11 @@ exports.cnTextField = bem_1.cn(exports.COMPONENT_NAME);
|
|
|
27
27
|
function TextFieldRender(props, ref) {
|
|
28
28
|
var textFieldRef = react_1["default"].useRef(null);
|
|
29
29
|
var inputRef = react_1["default"].useRef(null);
|
|
30
|
-
var _a = usePropsHandler_1.usePropsHandler(exports.COMPONENT_NAME, props, textFieldRef), className = _a.className, _b = _a.type, type = _b === void 0 ? 'text' : _b, value = _a.value, onChange = _a.onChange, id = _a.id, name = _a.name, rows = _a.rows, cols = _a.cols, minRows = _a.minRows, maxRows = _a.maxRows, inputRefProp = _a.inputRef, maxLength = _a.maxLength, disabled = _a.disabled, _c = _a.size, size = _c === void 0 ? types_1.textFieldPropSizeDefault : _c, _d = _a.view, view = _d === void 0 ? types_1.textFieldPropViewDefault : _d, _e = _a.form, form = _e === void 0 ? types_1.textFieldPropFormDefault : _e, state = _a.state, status = _a.status, _f = _a.width, width = _f === void 0 ? types_1.textFieldPropWidthDefault : _f, onBlur = _a.onBlur, onFocus = _a.onFocus, _g = _a.autoFocus, autoFocus = _g === void 0 ? false : _g, placeholder = _a.placeholder, leftSide = _a.leftSide, rightSide = _a.rightSide, autoComplete = _a.autoComplete, withClearButton = _a.withClearButton, max = _a.max, min = _a.min, readOnly = _a.readOnly, required = _a.required,
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
var _a = usePropsHandler_1.usePropsHandler(exports.COMPONENT_NAME, props, textFieldRef), className = _a.className, _b = _a.type, type = _b === void 0 ? 'text' : _b, value = _a.value, onChange = _a.onChange, id = _a.id, name = _a.name, rows = _a.rows, cols = _a.cols, minRows = _a.minRows, maxRows = _a.maxRows, inputRefProp = _a.inputRef, maxLength = _a.maxLength, disabled = _a.disabled, _c = _a.size, size = _c === void 0 ? types_1.textFieldPropSizeDefault : _c, _d = _a.view, view = _d === void 0 ? types_1.textFieldPropViewDefault : _d, _e = _a.form, form = _e === void 0 ? types_1.textFieldPropFormDefault : _e, state = _a.state, status = _a.status, _f = _a.width, width = _f === void 0 ? types_1.textFieldPropWidthDefault : _f, onBlur = _a.onBlur, onFocus = _a.onFocus, _g = _a.autoFocus, autoFocus = _g === void 0 ? false : _g, placeholder = _a.placeholder, leftSide = _a.leftSide, rightSide = _a.rightSide, autoComplete = _a.autoComplete, withClearButton = _a.withClearButton, _h = _a.incrementButtons, incrementButtons = _h === void 0 ? true : _h, max = _a.max, min = _a.min, readOnly = _a.readOnly, required = _a.required, _j = _a.step, step = _j === void 0 ? 1 : _j, tabIndex = _a.tabIndex, ariaLabel = _a.ariaLabel, label = _a.label, inputContainerRef = _a.inputContainerRef, _k = _a.labelPosition, labelPosition = _k === void 0 ? 'top' : _k, caption = _a.caption, iconSizeProp = _a.iconSize, focused = _a.focused, onClick = _a.onClick,
|
|
31
|
+
// onkey props
|
|
32
|
+
onKeyDownProp = _a.onKeyDown, onKeyDownCapture = _a.onKeyDownCapture, onKeyPress = _a.onKeyPress, onKeyPressCapture = _a.onKeyPressCapture, onKeyUp = _a.onKeyUp, onKeyUpCapture = _a.onKeyUpCapture, otherProps = tslib_1.__rest(_a, ["className", "type", "value", "onChange", "id", "name", "rows", "cols", "minRows", "maxRows", "inputRef", "maxLength", "disabled", "size", "view", "form", "state", "status", "width", "onBlur", "onFocus", "autoFocus", "placeholder", "leftSide", "rightSide", "autoComplete", "withClearButton", "incrementButtons", "max", "min", "readOnly", "required", "step", "tabIndex", "ariaLabel", "label", "inputContainerRef", "labelPosition", "caption", "iconSize", "focused", "onClick", "onKeyDown", "onKeyDownCapture", "onKeyPress", "onKeyPressCapture", "onKeyUp", "onKeyUpCapture"]);
|
|
33
|
+
var _l = tslib_1.__read(useFlag_1.useFlag(autoFocus), 2), focus = _l[0], setFocus = _l[1];
|
|
34
|
+
var _m = tslib_1.__read(useFlag_1.useFlag(false), 2), passwordVisible = _m[0], setPasswordVisuble = _m[1];
|
|
33
35
|
var valueRef = useMutableRef_1.useMutableRef(value);
|
|
34
36
|
var onClickRef = useMutableRef_1.useMutableRef(onClick);
|
|
35
37
|
var onChangeRef = useMutableRef_1.useMutableRef(onChange);
|
|
@@ -49,7 +51,7 @@ function TextFieldRender(props, ref) {
|
|
|
49
51
|
var handleChange = react_1.useCallback(function (e) {
|
|
50
52
|
var _a;
|
|
51
53
|
!disabled && ((_a = onChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onChangeRef, { e: e, id: id, name: name, value: e.target.value || null }));
|
|
52
|
-
}, [id, name]);
|
|
54
|
+
}, [id, name, disabled]);
|
|
53
55
|
var handleBlur = function (e) {
|
|
54
56
|
setFocus.off();
|
|
55
57
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
@@ -72,12 +74,18 @@ function TextFieldRender(props, ref) {
|
|
|
72
74
|
readOnly: readOnly,
|
|
73
75
|
tabIndex: tabIndex,
|
|
74
76
|
name: name,
|
|
77
|
+
onKeyDownCapture: onKeyDownCapture,
|
|
78
|
+
onKeyPress: onKeyPress,
|
|
79
|
+
onKeyPressCapture: onKeyPressCapture,
|
|
80
|
+
onKeyUp: onKeyUp,
|
|
81
|
+
onKeyUpCapture: onKeyUpCapture,
|
|
75
82
|
'id': id ? id.toString() : '',
|
|
76
83
|
'aria-label': ariaLabel
|
|
77
84
|
};
|
|
78
85
|
var Eye = passwordVisible ? IconEyeClose_1.IconEyeClose : IconEye_1.IconEye;
|
|
79
86
|
var onKeyDown = function (e) {
|
|
80
87
|
var flag = helpers_1.getIncrementFlag(e);
|
|
88
|
+
onKeyDownProp === null || onKeyDownProp === void 0 ? void 0 : onKeyDownProp(e);
|
|
81
89
|
if (type === 'number' && typeof flag === 'boolean' && !disabled) {
|
|
82
90
|
e.preventDefault();
|
|
83
91
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
@@ -146,7 +154,7 @@ function TextFieldRender(props, ref) {
|
|
|
146
154
|
type: leftSideIsString ? 'string' : 'icon'
|
|
147
155
|
}), title: typeof leftSide === 'string' ? leftSide : undefined }, leftSideIsString ? (leftSide) : (react_1["default"].createElement(LeftIcon, { className: exports.cnTextField('Icon'), size: iconSize })))),
|
|
148
156
|
textarea ? (react_1["default"].createElement(react_textarea_autosize_1["default"], tslib_1.__assign({}, commonProps, textareaProps))) : (react_1["default"].createElement("input", tslib_1.__assign({}, commonProps, inputProps))),
|
|
149
|
-
type === 'number' && (react_1["default"].createElement("div", { className: exports.cnTextField('Counter') },
|
|
157
|
+
type === 'number' && incrementButtons && (react_1["default"].createElement("div", { className: exports.cnTextField('Counter') },
|
|
150
158
|
react_1["default"].createElement("button", { onFocus: handleFocus, onClick: function (e) { return changeNumberValue(e, true); }, type: "button", className: exports.cnTextField('CounterButton') },
|
|
151
159
|
react_1["default"].createElement(IconSelectOpen_1.IconSelectOpen, { size: "xs" })),
|
|
152
160
|
react_1["default"].createElement("button", { onFocus: handleFocus, onClick: function (e) { return changeNumberValue(e, false); }, type: "button", className: exports.cnTextField('CounterButton') },
|
|
@@ -62,6 +62,7 @@ export declare type TextFieldProps<TYPE extends string> = PropsWithHTMLAttribute
|
|
|
62
62
|
width?: TextFieldPropWidth;
|
|
63
63
|
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
64
64
|
onBlur?: React.FocusEventHandler<HTMLElement>;
|
|
65
|
+
incrementButtons?: boolean;
|
|
65
66
|
autoFocus?: boolean;
|
|
66
67
|
placeholder?: string;
|
|
67
68
|
leftSide?: string | IconComponent;
|
|
@@ -83,5 +84,11 @@ export declare type TextFieldProps<TYPE extends string> = PropsWithHTMLAttribute
|
|
|
83
84
|
caption?: string;
|
|
84
85
|
labelPosition?: 'top' | 'left';
|
|
85
86
|
focused?: boolean;
|
|
87
|
+
onKeyDownCapture?: React.KeyboardEventHandler;
|
|
88
|
+
onKeyPress?: React.KeyboardEventHandler;
|
|
89
|
+
onKeyPressCapture?: React.KeyboardEventHandler;
|
|
90
|
+
onKeyUp?: React.KeyboardEventHandler;
|
|
91
|
+
onKeyUpCapture?: React.KeyboardEventHandler;
|
|
92
|
+
onKeyDown?: React.KeyboardEventHandler;
|
|
86
93
|
}, HTMLDivElement> & TextFieldPropsTextareaType<TYPE> & TextFieldPropRightSide<TYPE>;
|
|
87
94
|
export declare type TextFieldComponent = <TYPE extends string>(props: TextFieldProps<TYPE> & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
|
|
@@ -24,7 +24,7 @@ function UserSelectRender(props, ref) {
|
|
|
24
24
|
var controlInnerRef = react_1.useRef(null);
|
|
25
25
|
var helperInputFakeElement = react_1.useRef(null);
|
|
26
26
|
var controlRef = react_1.useRef(null);
|
|
27
|
-
var _a = usePropsHandler_1.usePropsHandler(exports.COMPONENT_NAME, helpers_2.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 ? types_1.defaultPropForm : _c, _d = _a.view, view = _d === void 0 ? types_1.defaultPropView : _d, _e = _a.size, size = _e === void 0 ? types_1.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 ? helpers_1.defaultlabelForNotFound : _g, _h = _a.labelForCreate, labelForCreate = _h === void 0 ? helpers_1.defaultlabelForCreate : _h, _j = _a.labelForEmptyItems, labelForEmptyItems = _j === void 0 ? helpers_1.defaultLabelForEmptyItems : _j, _k = _a.multiple, multiple = _k === void 0 ? false : _k, searchFunction = _a.searchFunction, style = _a.style, restProps = tslib_1.__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"]);
|
|
27
|
+
var _a = usePropsHandler_1.usePropsHandler(exports.COMPONENT_NAME, helpers_2.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 ? types_1.defaultPropForm : _c, _d = _a.view, view = _d === void 0 ? types_1.defaultPropView : _d, _e = _a.size, size = _e === void 0 ? types_1.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 ? helpers_1.defaultlabelForNotFound : _g, _h = _a.labelForCreate, labelForCreate = _h === void 0 ? helpers_1.defaultlabelForCreate : _h, _j = _a.labelForEmptyItems, labelForEmptyItems = _j === void 0 ? helpers_1.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 = tslib_1.__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"]);
|
|
28
28
|
var searchFunctionDefault = function (item, searchValue) {
|
|
29
29
|
var searchOfLabel = helpers_2.searchCompare(searchValue, getItemLabel(item));
|
|
30
30
|
if (searchOfLabel) {
|
|
@@ -32,7 +32,7 @@ function UserSelectRender(props, ref) {
|
|
|
32
32
|
}
|
|
33
33
|
return helpers_2.searchCompare(searchValue, getItemSubLabel(item));
|
|
34
34
|
};
|
|
35
|
-
var
|
|
35
|
+
var _m = useSelect_1.useSelect({
|
|
36
36
|
items: items,
|
|
37
37
|
groups: groups,
|
|
38
38
|
value: value,
|
|
@@ -50,8 +50,7 @@ function UserSelectRender(props, ref) {
|
|
|
50
50
|
onFocus: onFocus,
|
|
51
51
|
onCreate: onCreate,
|
|
52
52
|
searchFunction: searchFunction || searchFunctionDefault
|
|
53
|
-
}), getKeyProps =
|
|
54
|
-
var dropdownForm = helpers_1.getSelectDropdownForm(form);
|
|
53
|
+
}), 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;
|
|
55
54
|
var renderItemDefault = function (props) {
|
|
56
55
|
var item = props.item, active = props.active, hovered = props.hovered, onClick = props.onClick, onMouseEnter = props.onMouseEnter;
|
|
57
56
|
return (react_1["default"].createElement(UserSelectItem_1.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;
|
|
@@ -12,7 +12,7 @@ export declare type ButtonPropWidth = typeof buttonPropWidth[number];
|
|
|
12
12
|
export declare const buttonPropWidthDefault: ButtonPropWidth;
|
|
13
13
|
export declare const buttonPropForm: readonly ["default", "brick", "round", "brickRound", "roundBrick", "brickDefault", "defaultBrick"];
|
|
14
14
|
export declare type ButtonPropForm = typeof buttonPropForm[number];
|
|
15
|
-
export declare const buttonPropFormDefault:
|
|
15
|
+
export declare const buttonPropFormDefault: "default";
|
|
16
16
|
export declare type Props = {
|
|
17
17
|
size?: ButtonPropSize;
|
|
18
18
|
view?: ButtonPropView;
|
|
@@ -23,6 +23,22 @@ export var buttonPropForm = [
|
|
|
23
23
|
'brickDefault',
|
|
24
24
|
'defaultBrick',
|
|
25
25
|
];
|
|
26
|
+
var mapStableForm = {
|
|
27
|
+
"default": 'default',
|
|
28
|
+
defaultClear: 'defaultBrick',
|
|
29
|
+
defaultBrick: 'defaultBrick',
|
|
30
|
+
brick: 'brick',
|
|
31
|
+
brickDefault: 'brickDefault',
|
|
32
|
+
brickClear: 'brick',
|
|
33
|
+
brickRound: 'brickRound',
|
|
34
|
+
round: 'round',
|
|
35
|
+
roundClear: 'roundBrick',
|
|
36
|
+
roundBrick: 'roundBrick',
|
|
37
|
+
clearRound: 'brickRound',
|
|
38
|
+
clearDefault: 'brickDefault',
|
|
39
|
+
clearBrick: 'brick',
|
|
40
|
+
clearClear: 'brick'
|
|
41
|
+
};
|
|
26
42
|
export var buttonPropFormDefault = buttonPropForm[0];
|
|
27
43
|
export var COMPONENT_NAME = 'Button';
|
|
28
44
|
export var cnButton = cn(COMPONENT_NAME);
|
|
@@ -59,7 +75,7 @@ export var Button = forwardRefWithAs(function (props, ref) {
|
|
|
59
75
|
size: size,
|
|
60
76
|
view: view,
|
|
61
77
|
width: width,
|
|
62
|
-
form: form,
|
|
78
|
+
form: mapStableForm[form],
|
|
63
79
|
disabled: disabled,
|
|
64
80
|
loading: loading,
|
|
65
81
|
withIcon: withIcon,
|
|
@@ -13,10 +13,10 @@ export var COMPONENT_NAME = 'Card';
|
|
|
13
13
|
export var cnCard = cn('Card');
|
|
14
14
|
export var Card = forwardRefWithAs(function (props, ref) {
|
|
15
15
|
var cardRef = useRef(null);
|
|
16
|
-
var _a = usePropsHandler(COMPONENT_NAME, props, cardRef), verticalSpace = _a.verticalSpace, horizontalSpace = _a.horizontalSpace, status = _a.status, _b = _a.form, form = _b === void 0 ? cardPropFormDefault : _b, _c = _a.shadow, shadow = _c === void 0 ? true : _c, children = _a.children, tabIndex = _a.tabIndex, className = _a.className, _d = _a.as, as = _d === void 0 ? 'div' : _d, otherProps = __rest(_a, ["verticalSpace", "horizontalSpace", "status", "form", "shadow", "children", "tabIndex", "className", "as"]);
|
|
16
|
+
var _a = usePropsHandler(COMPONENT_NAME, props, cardRef), verticalSpace = _a.verticalSpace, horizontalSpace = _a.horizontalSpace, status = _a.status, _b = _a.form, form = _b === void 0 ? cardPropFormDefault : _b, _c = _a.shadow, shadow = _c === void 0 ? true : _c, children = _a.children, tabIndex = _a.tabIndex, border = _a.border, className = _a.className, _d = _a.as, as = _d === void 0 ? 'div' : _d, otherProps = __rest(_a, ["verticalSpace", "horizontalSpace", "status", "form", "shadow", "children", "tabIndex", "border", "className", "as"]);
|
|
17
17
|
var Tag = as;
|
|
18
18
|
return (React.createElement(Tag, __assign({ tabIndex: tabIndex, ref: useForkRef([cardRef, ref]), className: cnCard(null, [
|
|
19
|
-
cnMixCard({ verticalSpace: verticalSpace, horizontalSpace: horizontalSpace, shadow: shadow, form: form, status: status }),
|
|
19
|
+
cnMixCard({ verticalSpace: verticalSpace, horizontalSpace: horizontalSpace, shadow: shadow, form: form, status: status, border: border }),
|
|
20
20
|
className,
|
|
21
21
|
]) }, otherProps), children));
|
|
22
22
|
});
|
|
@@ -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 { SelectItem } from '../SelectComponents/SelectItem/SelectItem';
|
|
@@ -21,8 +21,8 @@ function ComboboxRender(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, 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, getItemLabel = _a.getItemLabel, getItemKey = _a.getItemKey, 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, onInputChange = _a.onInputChange, searchFunction = _a.searchFunction, isLoading = _a.isLoading, _k = _a.multiple, multiple = _k === void 0 ? false : _k, style = _a.style, otherProps = __rest(_a, ["placeholder", "onBlur", "onFocus", "items", "onChange", "value", "disabled", "ariaLabel", "id", "required", "dropdownRef", "form", "view", "size", "dropdownClassName", "name", "groups", "getItemLabel", "getItemKey", "getItemGroupKey", "getItemDisabled", "getGroupKey", "getGroupLabel", "renderItem", "renderValue", "onCreate", "inputRef", "labelForNotFound", "labelForCreate", "labelForEmptyItems", "onInputChange", "searchFunction", "isLoading", "multiple", "style"]);
|
|
25
|
-
var
|
|
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, 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, getItemLabel = _a.getItemLabel, getItemKey = _a.getItemKey, 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, onInputChange = _a.onInputChange, searchFunction = _a.searchFunction, isLoading = _a.isLoading, _k = _a.multiple, multiple = _k === void 0 ? false : _k, style = _a.style, _l = _a.dropdownForm, dropdownForm = _l === void 0 ? 'default' : _l, otherProps = __rest(_a, ["placeholder", "onBlur", "onFocus", "items", "onChange", "value", "disabled", "ariaLabel", "id", "required", "dropdownRef", "form", "view", "size", "dropdownClassName", "name", "groups", "getItemLabel", "getItemKey", "getItemGroupKey", "getItemDisabled", "getGroupKey", "getGroupLabel", "renderItem", "renderValue", "onCreate", "inputRef", "labelForNotFound", "labelForCreate", "labelForEmptyItems", "onInputChange", "searchFunction", "isLoading", "multiple", "style", "dropdownForm"]);
|
|
25
|
+
var _m = useSelect({
|
|
26
26
|
items: items,
|
|
27
27
|
groups: groups,
|
|
28
28
|
value: value,
|
|
@@ -40,8 +40,7 @@ function ComboboxRender(props, ref) {
|
|
|
40
40
|
onFocus: onFocus,
|
|
41
41
|
onCreate: onCreate,
|
|
42
42
|
searchFunction: searchFunction
|
|
43
|
-
}), getKeyProps =
|
|
44
|
-
var dropdownForm = getSelectDropdownForm(form);
|
|
43
|
+
}), 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;
|
|
45
44
|
var renderItemDefault = function (props) {
|
|
46
45
|
var item = props.item, active = props.active, hovered = props.hovered, onClick = props.onClick, onMouseEnter = props.onMouseEnter;
|
|
47
46
|
return (React.createElement(SelectItem, { label: getItemLabel(item), active: active, hovered: hovered, multiple: multiple, size: size, indent: dropdownForm === 'round' ? 'increased' : 'normal', onClick: onClick, onMouseEnter: onMouseEnter, disabled: getItemDisabled(item) }));
|
|
@@ -35,6 +35,7 @@ export declare type ComboboxProps<ITEM = DefaultItem, GROUP = DefaultGroup, MULT
|
|
|
35
35
|
onChange: PropOnChange<ITEM, MULTIPLE>;
|
|
36
36
|
disabled?: boolean;
|
|
37
37
|
form?: PropForm;
|
|
38
|
+
dropdownForm?: 'default' | 'brick' | 'round';
|
|
38
39
|
size?: Exclude<PropSize, 'xs'>;
|
|
39
40
|
view?: PropView;
|
|
40
41
|
placeholder?: string;
|
|
@@ -102,6 +103,7 @@ export declare function withDefaultGetters<ITEM = DefaultItem, GROUP = DefaultGr
|
|
|
102
103
|
onChange: PropOnChange<ITEM, MULTIPLE>;
|
|
103
104
|
disabled?: boolean | undefined;
|
|
104
105
|
form?: "default" | "round" | "brick" | "brickDefault" | "defaultBrick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "brickClear" | "clearBrick" | "clearClear" | undefined;
|
|
106
|
+
dropdownForm?: "default" | "round" | "brick" | undefined;
|
|
105
107
|
size?: "s" | "m" | "l" | undefined;
|
|
106
108
|
view?: "default" | "clear" | undefined;
|
|
107
109
|
placeholder?: string | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __read, __spread } from "tslib";
|
|
2
2
|
import { startOfToday } from 'date-fns';
|
|
3
3
|
import { range } from '../../utils/array';
|
|
4
|
-
import {
|
|
4
|
+
import { getForm } from '../FieldGroup/FieldGroup';
|
|
5
5
|
export var datePickerPropSeparatorDefault = '.';
|
|
6
6
|
export var datePickerPropFormatTypeDate = "dd" + datePickerPropSeparatorDefault + "MM" + datePickerPropSeparatorDefault + "yyyy";
|
|
7
7
|
export var datePickerPropPlaceholderTypeDate = "\u0414\u0414" + datePickerPropSeparatorDefault + "\u041C\u041C" + datePickerPropSeparatorDefault + "\u0413\u0413\u0413\u0413";
|
|
@@ -42,40 +42,8 @@ export var getTimeEnum = function (length, multiplicity, startOfUnits, addUnits,
|
|
|
42
42
|
return getItemLabel(addUnits(startDate, number * multiplicity));
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
defaultClear: 'defaultClear',
|
|
48
|
-
defaultBrick: 'defaultClear',
|
|
49
|
-
brick: 'brickClear',
|
|
50
|
-
brickDefault: 'brickClear',
|
|
51
|
-
brickClear: 'brickClear',
|
|
52
|
-
brickRound: 'brickClear',
|
|
53
|
-
round: 'roundClear',
|
|
54
|
-
roundClear: 'roundClear',
|
|
55
|
-
roundBrick: 'roundClear',
|
|
56
|
-
clearRound: 'clearClear',
|
|
57
|
-
clearDefault: 'clearClear',
|
|
58
|
-
clearBrick: 'clearClear',
|
|
59
|
-
clearClear: 'clearClear'
|
|
60
|
-
};
|
|
61
|
-
var mapFormForEnd = {
|
|
62
|
-
"default": 'brickDefault',
|
|
63
|
-
defaultClear: 'brickClear',
|
|
64
|
-
defaultBrick: 'brick',
|
|
65
|
-
brick: 'brick',
|
|
66
|
-
brickDefault: 'brickDefault',
|
|
67
|
-
brickClear: 'brickClear',
|
|
68
|
-
brickRound: 'brickRound',
|
|
69
|
-
round: 'brickRound',
|
|
70
|
-
roundClear: 'brickClear',
|
|
71
|
-
roundBrick: 'brick',
|
|
72
|
-
clearRound: 'brickRound',
|
|
73
|
-
clearDefault: 'brickDefault',
|
|
74
|
-
clearBrick: 'brick',
|
|
75
|
-
clearClear: 'brickClear'
|
|
76
|
-
};
|
|
77
|
-
export var getFormForStart = function (form) { return getByMap(mapFormForStart, form); };
|
|
78
|
-
export var getFormForEnd = function (form) { return getByMap(mapFormForEnd, form); };
|
|
45
|
+
export var getFormForStart = function (form) { return getForm(form, 0, 2); };
|
|
46
|
+
export var getFormForEnd = function (form) { return getForm(form, 1, 2); };
|
|
79
47
|
var getPartDate = function (formatArray, stringArray, marker) {
|
|
80
48
|
var index = formatArray.indexOf(marker);
|
|
81
49
|
if (index >= 0 && stringArray[index] && stringArray[index].length === marker.length) {
|
|
@@ -11,7 +11,7 @@ export var dateTimeTimePropLocaleDefault = {
|
|
|
11
11
|
};
|
|
12
12
|
var getItemData = function (length, multiplicity, startOfUnits, startOfUnit, endOfUnit, addUnits, getItemLabel, value, minDate, maxDate, onChangeRef) {
|
|
13
13
|
if (multiplicity === void 0) { multiplicity = 1; }
|
|
14
|
-
var numbers = range(multiplicity ? Math.
|
|
14
|
+
var numbers = range(multiplicity ? Math.ceil(length / multiplicity) : 0);
|
|
15
15
|
if (numbers.length === 0) {
|
|
16
16
|
return [];
|
|
17
17
|
}
|