@laser-ui/components 2.3.4 → 2.4.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/CHANGELOG.md +12 -0
- package/accordion/Accordion.d.ts +0 -1
- package/accordion/types.d.ts +0 -1
- package/affix/Affix.d.ts +0 -1
- package/affix/types.d.ts +0 -1
- package/alert/Alert.d.ts +0 -1
- package/alert/types.d.ts +0 -1
- package/anchor/Anchor.d.ts +0 -1
- package/anchor/types.d.ts +0 -1
- package/avatar/Avatar.d.ts +0 -1
- package/avatar/types.d.ts +0 -1
- package/badge/Badge.d.ts +0 -1
- package/badge/internal/BadgeNumber.d.ts +0 -1
- package/badge/types.d.ts +0 -1
- package/base-input/types.d.ts +0 -1
- package/breadcrumb/Breadcrumb.d.ts +0 -1
- package/breadcrumb/types.d.ts +0 -1
- package/button/types.d.ts +0 -1
- package/card/Card.d.ts +0 -1
- package/card/CardAction.d.ts +0 -1
- package/card/CardActions.d.ts +0 -1
- package/card/CardContent.d.ts +0 -1
- package/card/CardHeader.d.ts +0 -1
- package/card/types.d.ts +0 -1
- package/cascader/Cascader.d.ts +0 -1
- package/cascader/Cascader.js +5 -9
- package/cascader/internal/CascaderPanel.d.ts +0 -1
- package/cascader/internal/CascaderSearchPanel.d.ts +0 -1
- package/cascader/internal/types.d.ts +0 -1
- package/cascader/types.d.ts +0 -1
- package/checkbox/Checkbox.d.ts +0 -1
- package/checkbox/Checkbox.js +4 -1
- package/checkbox/CheckboxGroup.d.ts +0 -1
- package/checkbox/types.d.ts +0 -1
- package/circular-progress/CircularProgress.d.ts +0 -1
- package/compose/Compose.d.ts +0 -1
- package/compose/ComposeItem.d.ts +0 -1
- package/compose/types.d.ts +0 -1
- package/config-provider/ConfigProvider.d.ts +0 -1
- package/config-provider/types.d.ts +0 -1
- package/context/index.d.ts +0 -1
- package/date-picker/DatePicker.d.ts +0 -1
- package/date-picker/DatePicker.js +13 -5
- package/date-picker/internal/DatePickerPanel.d.ts +0 -1
- package/date-picker/types.d.ts +0 -1
- package/dialog-service.d.ts +0 -1
- package/drawer/Drawer.d.ts +0 -1
- package/drawer/DrawerFooter.d.ts +0 -1
- package/drawer/DrawerHeader.d.ts +0 -1
- package/drawer/types.d.ts +0 -1
- package/drawer/vars.d.ts +0 -1
- package/dropdown/Dropdown.d.ts +0 -1
- package/dropdown/internal/DropdownList.d.ts +0 -1
- package/dropdown/internal/DropdownList.js +6 -6
- package/dropdown/internal/DropdownSub.d.ts +0 -1
- package/dropdown/types.d.ts +0 -1
- package/dropdown/utils.d.ts +0 -1
- package/empty/Empty.d.ts +0 -1
- package/empty/types.d.ts +0 -1
- package/fab/Fab.d.ts +0 -1
- package/fab/FabBacktop.d.ts +0 -1
- package/fab/FabButton.d.ts +0 -1
- package/fab/types.d.ts +0 -1
- package/fab/vars.d.ts +0 -1
- package/form/Form.d.ts +0 -1
- package/form/FormItem.d.ts +0 -1
- package/form/internal/FormError.d.ts +0 -1
- package/form/types.d.ts +0 -1
- package/form/vars.d.ts +0 -1
- package/hooks/useContainerScrolling.d.ts +0 -1
- package/hooks/useFocusVisible.d.ts +0 -1
- package/hooks/useLayout.d.ts +0 -1
- package/hooks/useNestedPopup.d.ts +0 -1
- package/hooks/useStyled.d.ts +0 -1
- package/hooks/useStyled.js +0 -2
- package/hooks/useZIndex.js +5 -2
- package/icon/Icon.d.ts +0 -1
- package/icon/types.d.ts +0 -1
- package/image/Image.d.ts +0 -1
- package/image/ImageAction.d.ts +0 -1
- package/image/ImageLoader.d.ts +0 -1
- package/image/ImagePreview.d.ts +0 -1
- package/image/types.d.ts +0 -1
- package/input/Input.d.ts +0 -1
- package/input/Input.js +4 -1
- package/input/InputNumber.js +4 -1
- package/input/types.d.ts +0 -1
- package/internal/lazy-loading/LazyLoading.d.ts +0 -1
- package/internal/lazy-loading/types.d.ts +0 -1
- package/internal/popup/Popup.d.ts +0 -1
- package/internal/popup/types.d.ts +0 -1
- package/internal/portal/Portal.d.ts +0 -1
- package/internal/portal/types.d.ts +0 -1
- package/mask/Mask.d.ts +0 -1
- package/mask/types.d.ts +0 -1
- package/menu/Menu.d.ts +0 -1
- package/menu/Menu.js +6 -6
- package/menu/internal/MenuGroup.d.ts +0 -1
- package/menu/internal/MenuItem.d.ts +0 -1
- package/menu/internal/MenuSub.d.ts +0 -1
- package/menu/types.d.ts +0 -1
- package/menu/utils.d.ts +0 -1
- package/modal/Modal.d.ts +0 -1
- package/modal/ModalAlert.d.ts +0 -1
- package/modal/ModalFooter.d.ts +0 -1
- package/modal/ModalHeader.d.ts +0 -1
- package/modal/types.d.ts +0 -1
- package/modal/vars.d.ts +0 -1
- package/notification/Notification.d.ts +0 -1
- package/notification/types.d.ts +0 -1
- package/package.json +2 -2
- package/pagination/Pagination.d.ts +0 -1
- package/pagination/types.d.ts +0 -1
- package/pagination/utils.d.ts +1 -2
- package/popover/Popover.d.ts +0 -1
- package/popover/PopoverFooter.d.ts +0 -1
- package/popover/PopoverHeader.d.ts +0 -1
- package/popover/types.d.ts +0 -1
- package/popover/vars.d.ts +0 -1
- package/progress/Progress.d.ts +0 -1
- package/progress/types.d.ts +0 -1
- package/radio/Radio.d.ts +0 -1
- package/radio/Radio.js +4 -1
- package/radio/RadioGroup.d.ts +0 -1
- package/radio/types.d.ts +0 -1
- package/radio/vars.d.ts +1 -2
- package/rating/Rating.d.ts +0 -1
- package/rating/internal/RatingStar.d.ts +0 -1
- package/rating/types.d.ts +0 -1
- package/root/Dialogs.d.ts +0 -1
- package/root/Root.d.ts +0 -1
- package/root/types.d.ts +0 -1
- package/root/vars.d.ts +0 -1
- package/select/Select.d.ts +0 -1
- package/select/Select.js +4 -8
- package/select/types.d.ts +0 -1
- package/separator/Separator.d.ts +0 -1
- package/separator/types.d.ts +0 -1
- package/skeleton/Skeleton.d.ts +0 -1
- package/skeleton/types.d.ts +0 -1
- package/slider/Slider.d.ts +0 -1
- package/slider/Slider.js +45 -39
- package/slider/types.d.ts +0 -1
- package/slides/Slides.d.ts +0 -1
- package/slides/Slides.js +5 -5
- package/slides/types.d.ts +0 -1
- package/spinner/Spinner.d.ts +0 -1
- package/spinner/types.d.ts +0 -1
- package/stepper/Stepper.d.ts +0 -1
- package/stepper/types.d.ts +0 -1
- package/switch/Switch.js +4 -1
- package/switch/types.d.ts +0 -1
- package/table/Table.d.ts +0 -1
- package/table/TableEmpty.d.ts +0 -1
- package/table/TableExpand.d.ts +0 -1
- package/table/TableFilter.d.ts +0 -1
- package/table/TableTd.d.ts +0 -1
- package/table/TableTh.d.ts +0 -1
- package/table/TableThAction.d.ts +0 -1
- package/table/internal/TableCell.d.ts +0 -1
- package/table/types.d.ts +0 -1
- package/table/vars.d.ts +0 -1
- package/tabs/Tabs.d.ts +0 -1
- package/tabs/types.d.ts +0 -1
- package/tag/Tag.d.ts +0 -1
- package/tag/types.d.ts +0 -1
- package/textarea/Textarea.d.ts +0 -1
- package/textarea/types.d.ts +0 -1
- package/time-picker/TimePicker.d.ts +0 -1
- package/time-picker/TimePicker.js +5 -1
- package/time-picker/internal/TimePickerPanel.d.ts +0 -1
- package/time-picker/types.d.ts +0 -1
- package/timeline/Timeline.d.ts +0 -1
- package/timeline/types.d.ts +0 -1
- package/toast/Toast.d.ts +0 -1
- package/toast/types.d.ts +0 -1
- package/tooltip/Tooltip.d.ts +0 -1
- package/tooltip/types.d.ts +0 -1
- package/transfer/Transfer.d.ts +0 -1
- package/transfer/Transfer.js +4 -5
- package/transfer/internal/TransferPanel.d.ts +0 -1
- package/transfer/types.d.ts +0 -1
- package/transition/CollapseTransition.d.ts +0 -1
- package/transition/Transition.d.ts +0 -1
- package/transition/types.d.ts +0 -1
- package/tree/Tree.d.ts +0 -1
- package/tree/internal/TreePanel.d.ts +0 -1
- package/tree/node/abstract-node.d.ts +0 -1
- package/tree/node/multiple-node.d.ts +0 -1
- package/tree/node/single-node.d.ts +0 -1
- package/tree/types.d.ts +0 -1
- package/tree/utils.d.ts +0 -1
- package/tree-select/TreeSelect.d.ts +0 -1
- package/tree-select/TreeSelect.js +4 -8
- package/tree-select/internal/TreeSelectSearchPanel.d.ts +0 -1
- package/tree-select/internal/types.d.ts +0 -1
- package/tree-select/types.d.ts +0 -1
- package/types.d.ts +0 -1
- package/upload/Upload.d.ts +0 -1
- package/upload/Upload.js +4 -3
- package/upload/UploadAction.d.ts +0 -1
- package/upload/UploadButton.d.ts +0 -1
- package/upload/UploadList.d.ts +0 -1
- package/upload/UploadPicture.d.ts +0 -1
- package/upload/UploadPictureList.d.ts +0 -1
- package/upload/UploadPreviewAction.d.ts +0 -1
- package/upload/hooks.d.ts +0 -1
- package/upload/types.d.ts +0 -1
- package/upload/vars.d.ts +5 -6
- package/utils/handleModalKeyDown.d.ts +0 -1
- package/utils/mergeCS.d.ts +0 -1
- package/virtual-scroll/VirtualScroll.d.ts +0 -1
- package/virtual-scroll/types.d.ts +0 -1
- package/wave/Wave.d.ts +0 -1
- package/wave/types.d.ts +0 -1
package/image/ImagePreview.d.ts
CHANGED
package/image/types.d.ts
CHANGED
package/input/Input.d.ts
CHANGED
package/input/Input.js
CHANGED
|
@@ -42,7 +42,10 @@ export const Input = (props) => {
|
|
|
42
42
|
var _a, _b;
|
|
43
43
|
(_a = restProps.onClick) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
|
|
44
44
|
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus({ preventScroll: true });
|
|
45
|
-
}, children: [checkNodeExist(prefix) && _jsx("div", Object.assign({}, styled('input__prefix'), { children: prefix })), _jsx(BaseInput, Object.assign({}, inputProps, styled('input__input'),
|
|
45
|
+
}, children: [checkNodeExist(prefix) && _jsx("div", Object.assign({}, styled('input__prefix'), { children: prefix })), _jsx(BaseInput, Object.assign({}, inputProps, mergeCS(styled('input__input'), {
|
|
46
|
+
className: inputProps === null || inputProps === void 0 ? void 0 : inputProps.className,
|
|
47
|
+
style: inputProps === null || inputProps === void 0 ? void 0 : inputProps.style,
|
|
48
|
+
}), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: (instance) => {
|
|
46
49
|
inputRef.current = instance;
|
|
47
50
|
const ret = setRef(inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref, instance);
|
|
48
51
|
return () => {
|
package/input/InputNumber.js
CHANGED
|
@@ -85,7 +85,10 @@ export function InputNumber(props) {
|
|
|
85
85
|
var _a, _b;
|
|
86
86
|
(_a = restProps.onClick) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
|
|
87
87
|
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus({ preventScroll: true });
|
|
88
|
-
}, children: [checkNodeExist(prefix) && _jsx("div", Object.assign({}, styled('input__prefix'), { children: prefix })), _jsx(BaseInput, Object.assign({}, inputProps, styled('input__input'),
|
|
88
|
+
}, children: [checkNodeExist(prefix) && _jsx("div", Object.assign({}, styled('input__prefix'), { children: prefix })), _jsx(BaseInput, Object.assign({}, inputProps, mergeCS(styled('input__input'), {
|
|
89
|
+
className: inputProps === null || inputProps === void 0 ? void 0 : inputProps.className,
|
|
90
|
+
style: inputProps === null || inputProps === void 0 ? void 0 : inputProps.style,
|
|
91
|
+
}), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: (instance) => {
|
|
89
92
|
inputRef.current = instance;
|
|
90
93
|
const ret = setRef(inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref, instance);
|
|
91
94
|
return () => {
|
package/input/types.d.ts
CHANGED
package/mask/Mask.d.ts
CHANGED
package/mask/types.d.ts
CHANGED
package/menu/Menu.d.ts
CHANGED
package/menu/Menu.js
CHANGED
|
@@ -290,12 +290,12 @@ export function Menu(props) {
|
|
|
290
290
|
return (_jsx(Fragment, { children: itemType === 'item' ? (_jsx(MenuItemFC, { namespace: namespace, styled: styled, id: id, level: level, space: space, step: step, icon: itemIcon,
|
|
291
291
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
292
292
|
posinset: posinset.get(itemId), mode: mode, inNav: inNav, active: active === itemId, focus: focusVisible && isFocus, disabled: itemDisabled, onClick: handleItemClick, children: itemTitle })) : itemType === 'group' ? (_jsx(MenuGroup, { styled: styled, id: id, level: level, space: space, step: step, list: children && getNodes(children, level + 1, nextSubParents), empty: isEmpty, children: itemTitle })) : (_jsx(MenuSub, { ref: (instance) => {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}
|
|
293
|
+
if (instance) {
|
|
294
|
+
updateSubPosition.current.set(itemId, instance);
|
|
295
|
+
return () => {
|
|
296
|
+
updateSubPosition.current.delete(itemId);
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
299
|
}, namespace: namespace, styled: styled, id: id, level: level, space: space, step: step, icon: itemIcon, list: children && getNodes(children, mode === 'vertical' ? level + 1 : 0, nextSubParents), popupState: popupState === null || popupState === void 0 ? void 0 : popupState.visible, trigger: expandTrigger !== null && expandTrigger !== void 0 ? expandTrigger : (mode === 'vertical' ? 'click' : 'hover'),
|
|
300
300
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
301
301
|
posinset: posinset.get(itemId), mode: mode, inNav: inNav, active: (mode === 'vertical' ? !isExpand : isUndefined(popupState)) && actives.includes(itemId), includeActive: actives.includes(itemId), expand: isExpand, empty: isEmpty, focus: focusVisible && isFocus, disabled: itemDisabled, onVisibleChange: (visible) => {
|
package/menu/types.d.ts
CHANGED
package/menu/utils.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { MenuItem } from './types';
|
|
3
2
|
export declare function checkEnableItem<ID extends React.Key, T extends MenuItem<ID>>(item: T): boolean;
|
|
4
3
|
export declare function getSameLevelEnableItems<ID extends React.Key, T extends MenuItem<ID>>(arr: T[]): T[];
|
package/modal/Modal.d.ts
CHANGED
package/modal/ModalAlert.d.ts
CHANGED
package/modal/ModalFooter.d.ts
CHANGED
package/modal/ModalHeader.d.ts
CHANGED
package/modal/types.d.ts
CHANGED
package/modal/vars.d.ts
CHANGED
package/notification/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@laser-ui/components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "React components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"access": "public",
|
|
38
38
|
"directory": "../../dist/libs/components"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "6aa6cb81ee51849b66dddeab0de811cadcb65c60"
|
|
41
41
|
}
|
package/pagination/types.d.ts
CHANGED
package/pagination/utils.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function buttonProps(handleClick: () => void, disabled?: boolean): import("react").HTMLAttributes<HTMLElement>;
|
|
1
|
+
export declare function buttonProps(handleClick: () => void, disabled?: boolean): React.HTMLAttributes<HTMLElement>;
|
package/popover/Popover.d.ts
CHANGED
package/popover/types.d.ts
CHANGED
package/popover/vars.d.ts
CHANGED
package/progress/Progress.d.ts
CHANGED
package/progress/types.d.ts
CHANGED
package/radio/Radio.d.ts
CHANGED
package/radio/Radio.js
CHANGED
|
@@ -36,7 +36,10 @@ export const Radio = (props) => {
|
|
|
36
36
|
return () => {
|
|
37
37
|
waveRef.current = null;
|
|
38
38
|
};
|
|
39
|
-
}, color: `var(--${namespace}-color-primary)` }), _jsx("div", Object.assign({}, styled('radio__input-wrapper'), { children: _jsx("input", Object.assign({}, inputProps, styled('radio__input'),
|
|
39
|
+
}, color: `var(--${namespace}-color-primary)` }), _jsx("div", Object.assign({}, styled('radio__input-wrapper'), { children: _jsx("input", Object.assign({}, inputProps, mergeCS(styled('radio__input'), {
|
|
40
|
+
className: inputProps === null || inputProps === void 0 ? void 0 : inputProps.className,
|
|
41
|
+
style: inputProps === null || inputProps === void 0 ? void 0 : inputProps.style,
|
|
42
|
+
}), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { type: "radio", checked: checked, disabled: disabled, "aria-checked": checked, onChange: () => {
|
|
40
43
|
changeChecked(true);
|
|
41
44
|
} })) })), checkNodeExist(children) && _jsx("div", Object.assign({}, styled('radio__label'), { children: children }))] })));
|
|
42
45
|
};
|
package/radio/RadioGroup.d.ts
CHANGED
package/radio/types.d.ts
CHANGED
package/radio/vars.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { Size } from '../types';
|
|
3
2
|
export declare const CLASSES: {
|
|
4
3
|
radio: string;
|
|
@@ -15,6 +14,6 @@ export declare const CLASSES: {
|
|
|
15
14
|
radio__label: string;
|
|
16
15
|
};
|
|
17
16
|
export declare const RadioGroupContext: import("react").Context<{
|
|
18
|
-
pattern?: "
|
|
17
|
+
pattern?: "outline" | "fill";
|
|
19
18
|
size: Size;
|
|
20
19
|
} | undefined>;
|
package/rating/Rating.d.ts
CHANGED
package/rating/types.d.ts
CHANGED
package/root/Dialogs.d.ts
CHANGED
package/root/Root.d.ts
CHANGED
package/root/types.d.ts
CHANGED
package/root/vars.d.ts
CHANGED
package/select/Select.d.ts
CHANGED
package/select/Select.js
CHANGED
|
@@ -90,10 +90,8 @@ export function Select(props) {
|
|
|
90
90
|
if (!hasSearch) {
|
|
91
91
|
return [];
|
|
92
92
|
}
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
: // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
96
|
-
(item) => customSearch.filter(searchValue, item);
|
|
93
|
+
const customFilterFn = customSearch && customSearch.filter ? customSearch.filter : undefined;
|
|
94
|
+
const filterFn = customFilterFn ? (item) => customFilterFn(searchValue, item) : (item) => item.label.includes(searchValue);
|
|
97
95
|
const sortFn = customSearch === null || customSearch === void 0 ? void 0 : customSearch.sort;
|
|
98
96
|
let itemCreated = createItem === null || createItem === void 0 ? void 0 : createItem(searchValue);
|
|
99
97
|
if (itemCreated) {
|
|
@@ -290,10 +288,8 @@ export function Select(props) {
|
|
|
290
288
|
changeVisible((draft) => (searchable ? true : !draft));
|
|
291
289
|
}, children: [_jsxs("div", Object.assign({}, styled('select__container'), { title: selectedLabel, children: [(() => {
|
|
292
290
|
const nodeProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, inputProps), mergeCS(styled('select__search'), {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
zIndex: inputable ? undefined : -1,
|
|
296
|
-
},
|
|
291
|
+
className: inputProps === null || inputProps === void 0 ? void 0 : inputProps.className,
|
|
292
|
+
style: Object.assign(Object.assign({}, inputProps === null || inputProps === void 0 ? void 0 : inputProps.style), { opacity: inputable ? undefined : 0, zIndex: inputable ? undefined : -1 }),
|
|
297
293
|
})), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria), { ref: (instance) => {
|
|
298
294
|
inputRef.current = instance;
|
|
299
295
|
const ret = setRef(inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref, instance);
|
package/select/types.d.ts
CHANGED
package/separator/Separator.d.ts
CHANGED
package/separator/types.d.ts
CHANGED
package/skeleton/Skeleton.d.ts
CHANGED
package/skeleton/types.d.ts
CHANGED
package/slider/Slider.d.ts
CHANGED
package/slider/Slider.js
CHANGED
|
@@ -248,46 +248,52 @@ export function Slider(props) {
|
|
|
248
248
|
};
|
|
249
249
|
}, visible: isLeft ? visibleLeft : visibleRight, title: customTooltip ? customTooltip(value) : value, placement: vertical ? 'right' : 'top', onVisibleChange: (visible) => {
|
|
250
250
|
setDotVisible(visible ? (isLeft ? 'left' : 'right') : null);
|
|
251
|
-
}, children: (tooltipProps) =>
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
dotRef.current =
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
251
|
+
}, children: (tooltipProps) => {
|
|
252
|
+
var _a, _b;
|
|
253
|
+
return (_jsx("div", Object.assign({}, mergeCS(styled('slider__input-wrapper'), {
|
|
254
|
+
style: {
|
|
255
|
+
left: vertical ? undefined : `calc(${value} / ${max - min} * 100% - 7px)`,
|
|
256
|
+
bottom: vertical ? `calc(${value} / ${max - min} * 100% - 7px)` : undefined,
|
|
257
|
+
},
|
|
258
|
+
}), { ref: (instance) => {
|
|
259
|
+
const dotRef = isLeft ? dotLeftRef : dotRightRef;
|
|
260
|
+
dotRef.current = instance;
|
|
261
|
+
return () => {
|
|
262
|
+
dotRef.current = null;
|
|
263
|
+
};
|
|
264
|
+
} }, tooltipProps, { children: _jsx("input", Object.assign({}, inputProps === null || inputProps === void 0 ? void 0 : inputProps[index], mergeCS(styled('slider__input'), {
|
|
265
|
+
className: (_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps[index]) === null || _a === void 0 ? void 0 : _a.className,
|
|
266
|
+
style: (_b = inputProps === null || inputProps === void 0 ? void 0 : inputProps[index]) === null || _b === void 0 ? void 0 : _b.style,
|
|
267
|
+
}), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { type: "range", value: value, max: max, min: min, step: step !== null && step !== void 0 ? step : undefined, disabled: disabled, "aria-orientation": vertical ? 'vertical' : 'horizontal', onChange: (e) => {
|
|
268
|
+
const val = toNumber(e.currentTarget.value);
|
|
269
|
+
if (range) {
|
|
270
|
+
const index = isLeft ? 0 : 1;
|
|
271
|
+
changeValue((draft) => {
|
|
272
|
+
const offset = val - draft[index];
|
|
273
|
+
const isAdd = offset > 0;
|
|
274
|
+
draft[index] = val;
|
|
275
|
+
if (isNumber(rangeMinDistance) && draft[1] - draft[0] < rangeMinDistance) {
|
|
276
|
+
const _index = isLeft ? 1 : 0;
|
|
277
|
+
draft[_index] = getValue(draft[_index] + offset, isAdd ? 'ceil' : 'floor');
|
|
278
|
+
if (draft[1] - draft[0] < rangeMinDistance) {
|
|
279
|
+
draft[index] = getValue(draft[_index] + (isAdd ? -rangeMinDistance : rangeMinDistance), isAdd ? 'floor' : 'ceil');
|
|
280
|
+
}
|
|
275
281
|
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
changeValue(val);
|
|
286
|
+
}
|
|
287
|
+
}, onFocus: (e) => {
|
|
288
|
+
var _a, _b;
|
|
289
|
+
(_b = (_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps[index]) === null || _a === void 0 ? void 0 : _a.onFocus) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
290
|
+
setDotFocused(isLeft ? 'left' : 'right');
|
|
291
|
+
}, onBlur: (e) => {
|
|
292
|
+
var _a, _b;
|
|
293
|
+
(_b = (_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps[index]) === null || _a === void 0 ? void 0 : _a.onBlur) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
294
|
+
setDotFocused(null);
|
|
295
|
+
} })) })));
|
|
296
|
+
} }));
|
|
291
297
|
};
|
|
292
298
|
const preventBlur = (e) => {
|
|
293
299
|
if (e.button === 0) {
|
package/slider/types.d.ts
CHANGED
package/slides/Slides.d.ts
CHANGED
package/slides/Slides.js
CHANGED
|
@@ -152,20 +152,20 @@ export function Slides(props) {
|
|
|
152
152
|
setDragOpacity(undefined);
|
|
153
153
|
};
|
|
154
154
|
useIsomorphicLayoutEffect(() => {
|
|
155
|
-
|
|
155
|
+
const slidesEl = slidesRef.current;
|
|
156
|
+
if (slidesEl) {
|
|
156
157
|
let size = 0;
|
|
157
|
-
const slideEls =
|
|
158
|
+
const slideEls = slidesEl.querySelectorAll(`.${namespace}-slides__slide`);
|
|
158
159
|
slideEls.forEach((el) => {
|
|
159
160
|
const index = Number(el.dataset['index']);
|
|
160
161
|
if (index < activeIndex) {
|
|
161
162
|
size += el[vertical ? 'offsetHeight' : 'offsetWidth'];
|
|
162
163
|
}
|
|
163
164
|
else if (index === activeIndex) {
|
|
164
|
-
|
|
165
|
-
slidesRef.current.style.height = el.offsetHeight + 'px';
|
|
165
|
+
slidesEl.style.height = el.offsetHeight + 'px';
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
|
-
const containerEl =
|
|
168
|
+
const containerEl = slidesEl.querySelector(`.${namespace}-slides__container`);
|
|
169
169
|
containerEl.style.transform = effect === 'slide' ? `translate${vertical ? 'Y' : 'X'}(calc(-${size}px + ${dragDistance}px))` : '';
|
|
170
170
|
}
|
|
171
171
|
});
|
package/slides/types.d.ts
CHANGED
package/spinner/Spinner.d.ts
CHANGED
package/spinner/types.d.ts
CHANGED
package/stepper/Stepper.d.ts
CHANGED
package/stepper/types.d.ts
CHANGED