musae 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/calendar/calendar.d.ts +1 -1
- package/dist/components/calendar/calendar.js +5 -1
- package/dist/components/calendar/hooks.d.ts +6 -2
- package/dist/components/calendar/hooks.js +19 -20
- package/dist/components/cascader/hooks.d.ts +1 -1
- package/dist/components/cascader/hooks.js +6 -6
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/checkbox/group.d.ts +1 -1
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/date-picker/hooks.d.ts +3 -3
- package/dist/components/date-range-picker/date-range-picker.js +2 -2
- package/dist/components/date-range-picker/hooks.d.ts +4 -5
- package/dist/components/date-range-picker/hooks.js +1 -1
- package/dist/components/dialog/popup.js +1 -1
- package/dist/components/drawer/popup.js +1 -1
- package/dist/components/input/input.js +2 -2
- package/dist/components/number-input/hooks.js +1 -5
- package/dist/components/radio/group.d.ts +1 -1
- package/dist/components/radio/group.js +3 -3
- package/dist/components/radio/radio.js +6 -6
- package/dist/components/rate/hooks.d.ts +1 -1
- package/dist/components/tabs/hooks.d.ts +2 -1
- package/dist/components/time-picker/hooks.d.ts +2 -2
- package/dist/components/transfer/hooks.js +2 -2
- package/dist/stylex.css +6 -0
- package/package.json +2 -2
- /package/dist/node_modules/.pnpm/{@aiszlab_relax@1.2.69_react-dom@18.3.1_react@18.3.1__react@18.3.1 → @aiszlab_relax@1.2.71_react-dom@18.3.1_react@18.3.1__react@18.3.1}/node_modules/@aiszlab/relax/dist/dom/contains.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { CalendarProps } from "./types";
|
|
3
|
-
declare const Calendar: ({ className, style, value, onClick: _onClick, focusedAt: _focusedAt }: CalendarProps) => React.JSX.Element;
|
|
3
|
+
declare const Calendar: ({ className, style, value, onClick: _onClick, focusedAt: _focusedAt, }: CalendarProps) => React.JSX.Element;
|
|
4
4
|
export default Calendar;
|
|
@@ -52,7 +52,11 @@ var Calendar = function Calendar(_ref) {
|
|
|
52
52
|
toPrevMonth = _useFocusedAt.toPrevMonth,
|
|
53
53
|
toNextYear = _useFocusedAt.toNextYear,
|
|
54
54
|
toNextMonth = _useFocusedAt.toNextMonth;
|
|
55
|
-
var dateCells = useDateCells(
|
|
55
|
+
var dateCells = useDateCells({
|
|
56
|
+
timespan: timespan,
|
|
57
|
+
focusedAt: focusedAt,
|
|
58
|
+
click: onClick
|
|
59
|
+
});
|
|
56
60
|
var headCells = useHeadCells();
|
|
57
61
|
var classNames = useClassNames(ComponentToken.Calendar);
|
|
58
62
|
var theme = useTheme();
|
|
@@ -11,7 +11,11 @@ export declare const useHeadCells: () => React.JSX.Element[] | undefined;
|
|
|
11
11
|
* @description
|
|
12
12
|
* dates
|
|
13
13
|
*/
|
|
14
|
-
export declare const useDateCells: (
|
|
14
|
+
export declare const useDateCells: ({ timespan, focusedAt, click, }: {
|
|
15
|
+
timespan: Timespan;
|
|
16
|
+
focusedAt: Dayjs;
|
|
17
|
+
click: Required<CalendarProps>["onClick"];
|
|
18
|
+
}) => React.JSX.Element[];
|
|
15
19
|
/**
|
|
16
20
|
* @description
|
|
17
21
|
* time span
|
|
@@ -27,7 +31,7 @@ export declare const useValue: ({ onClick: _click, value, }: {
|
|
|
27
31
|
* @description
|
|
28
32
|
* point at
|
|
29
33
|
*/
|
|
30
|
-
export declare const useFocusedAt: ({ focusedAt: _focusedAt }: {
|
|
34
|
+
export declare const useFocusedAt: ({ focusedAt: _focusedAt, }: {
|
|
31
35
|
focusedAt: CalendarProps["focusedAt"];
|
|
32
36
|
}) => {
|
|
33
37
|
focusedAt: dayjs.Dayjs;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
1
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
3
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
import React, { useMemo, useCallback } from 'react';
|
|
6
6
|
import { useClassNames } from '../../hooks/use-class-names.js';
|
|
@@ -103,10 +103,9 @@ var useHeadCells = function useHeadCells() {
|
|
|
103
103
|
* dates
|
|
104
104
|
*/
|
|
105
105
|
var useDateCells = function useDateCells(_ref) {
|
|
106
|
-
var
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
click = _ref2[2];
|
|
106
|
+
var timespan = _ref.timespan,
|
|
107
|
+
focusedAt = _ref.focusedAt,
|
|
108
|
+
click = _ref.click;
|
|
110
109
|
var classNames = useClassNames(ComponentToken.Calendar);
|
|
111
110
|
var theme = useTheme();
|
|
112
111
|
return useMemo(function () {
|
|
@@ -127,9 +126,9 @@ var useDateCells = function useDateCells(_ref) {
|
|
|
127
126
|
var styled = {
|
|
128
127
|
cell: props(styles.cell, styles.date({
|
|
129
128
|
backgroundColor: theme.colors[ColorToken.SecondaryContainer]
|
|
130
|
-
}),
|
|
129
|
+
}), isDisabled && styles.hidden, isBetween && styles.range, isFrom && timespan.isRange && styles.from, isTo && timespan.isRange && styles.to, typography.body.large),
|
|
131
130
|
trigger: {
|
|
132
|
-
className: "musae-1eddoca"
|
|
131
|
+
className: "musae-1eddoca musae-1lhwzte"
|
|
133
132
|
}
|
|
134
133
|
};
|
|
135
134
|
prev.at(prev.length - 1).push( /*#__PURE__*/React.createElement("td", {
|
|
@@ -162,9 +161,9 @@ var useDateCells = function useDateCells(_ref) {
|
|
|
162
161
|
* @description
|
|
163
162
|
* time span
|
|
164
163
|
*/
|
|
165
|
-
var useValue = function useValue(
|
|
166
|
-
var _click =
|
|
167
|
-
value =
|
|
164
|
+
var useValue = function useValue(_ref3) {
|
|
165
|
+
var _click = _ref3.onClick,
|
|
166
|
+
value = _ref3.value;
|
|
168
167
|
/// change handler
|
|
169
168
|
var onClick = useCallback(function (_value) {
|
|
170
169
|
_click === null || _click === void 0 || _click(_value);
|
|
@@ -189,8 +188,8 @@ var useValue = function useValue(_ref4) {
|
|
|
189
188
|
* @description
|
|
190
189
|
* point at
|
|
191
190
|
*/
|
|
192
|
-
var useFocusedAt = function useFocusedAt(
|
|
193
|
-
var _focusedAt =
|
|
191
|
+
var useFocusedAt = function useFocusedAt(_ref4) {
|
|
192
|
+
var _focusedAt = _ref4.focusedAt;
|
|
194
193
|
var _useControlledState = useControlledState(_focusedAt, {
|
|
195
194
|
defaultState: dayjs()
|
|
196
195
|
}),
|
|
@@ -199,26 +198,26 @@ var useFocusedAt = function useFocusedAt(_ref5) {
|
|
|
199
198
|
setFocusedAt = _useControlledState2[1];
|
|
200
199
|
/// next year
|
|
201
200
|
var toNextYear = useCallback(function () {
|
|
202
|
-
setFocusedAt(function (
|
|
203
|
-
return
|
|
201
|
+
setFocusedAt(function (prev) {
|
|
202
|
+
return prev.add(1, "year");
|
|
204
203
|
});
|
|
205
204
|
}, [setFocusedAt]);
|
|
206
205
|
/// prev year
|
|
207
206
|
var toPrevYear = useCallback(function () {
|
|
208
|
-
setFocusedAt(function (
|
|
209
|
-
return
|
|
207
|
+
setFocusedAt(function (prev) {
|
|
208
|
+
return prev.subtract(1, "year");
|
|
210
209
|
});
|
|
211
210
|
}, [setFocusedAt]);
|
|
212
211
|
/// next month
|
|
213
212
|
var toNextMonth = useCallback(function () {
|
|
214
|
-
setFocusedAt(function (
|
|
215
|
-
return
|
|
213
|
+
setFocusedAt(function (prev) {
|
|
214
|
+
return prev.add(1, "month");
|
|
216
215
|
});
|
|
217
216
|
}, [setFocusedAt]);
|
|
218
217
|
/// prev month
|
|
219
218
|
var toPrevMonth = useCallback(function () {
|
|
220
|
-
setFocusedAt(function (
|
|
221
|
-
return
|
|
219
|
+
setFocusedAt(function (prev) {
|
|
220
|
+
return prev.subtract(1, "month");
|
|
222
221
|
});
|
|
223
222
|
}, [setFocusedAt]);
|
|
224
223
|
return {
|
|
@@ -6,7 +6,7 @@ import type { Option } from "../../types/option";
|
|
|
6
6
|
* @description
|
|
7
7
|
* cascader value
|
|
8
8
|
*/
|
|
9
|
-
export declare const useValue: ([valueInProps, readableOptions, readablePaths, mode, close, setAdditionalMenusItems]: [CascaderProps["value"], ReadableOptions, ReadablePaths, CascaderProps["mode"], close: VoidFunction, Dispatch<SetStateAction<MenuItem[][]>>]) => {
|
|
9
|
+
export declare const useValue: ([valueInProps, readableOptions, readablePaths, mode, close, setAdditionalMenusItems,]: [CascaderProps["value"], ReadableOptions, ReadablePaths, CascaderProps["mode"], close: VoidFunction, Dispatch<SetStateAction<MenuItem[][]>>]) => {
|
|
10
10
|
values: Map<number, Required<Pick<Option, "value" | "label">>[]>;
|
|
11
11
|
onChange: (id: number) => void;
|
|
12
12
|
};
|
|
@@ -20,7 +20,7 @@ var useValue = function useValue(_ref) {
|
|
|
20
20
|
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
21
21
|
_value = _useControlledState2[0],
|
|
22
22
|
setValue = _useControlledState2[1];
|
|
23
|
-
|
|
23
|
+
// convert value
|
|
24
24
|
var values = useMemo(function () {
|
|
25
25
|
return toValues(_value).reduce(function (prev, keysOrOptions) {
|
|
26
26
|
/// read item id for menu
|
|
@@ -40,11 +40,11 @@ var useValue = function useValue(_ref) {
|
|
|
40
40
|
_keysOrOptions$reduce2 = _slicedToArray(_keysOrOptions$reduce, 2),
|
|
41
41
|
id = _keysOrOptions$reduce2[0],
|
|
42
42
|
options = _keysOrOptions$reduce2[1];
|
|
43
|
-
|
|
43
|
+
// set item
|
|
44
44
|
return id ? prev.set(id, options) : prev;
|
|
45
45
|
}, new Map());
|
|
46
46
|
}, [_value, readableOptions]);
|
|
47
|
-
|
|
47
|
+
// change handler
|
|
48
48
|
var onChange = useCallback(function (id) {
|
|
49
49
|
// on menu click, when menu has children, add submenu
|
|
50
50
|
// when menu has no children, just change value and close dropdown
|
|
@@ -79,9 +79,9 @@ var useValue = function useValue(_ref) {
|
|
|
79
79
|
close();
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
// in multiple mode
|
|
83
|
+
// click menu item twice mean cancel it
|
|
84
|
+
// else add current values
|
|
85
85
|
var isRemoved = values.has(id) && values["delete"](id);
|
|
86
86
|
setValue([].concat(_toConsumableArray(_toConsumableArray(values.values()).map(toKeys)), _toConsumableArray(isRemoved ? [] : [_values])));
|
|
87
87
|
}, [readablePaths, readableOptions, mode, values, setValue, setAdditionalMenusItems, close]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { CheckboxProps } from "./types";
|
|
3
|
-
declare const Checkbox: ({ value, className, style, children, onChange, disabled, checked }: CheckboxProps) => React.JSX.Element;
|
|
3
|
+
declare const Checkbox: ({ value, className, style, children, onChange, disabled, checked, }: CheckboxProps) => React.JSX.Element;
|
|
4
4
|
export default Checkbox;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { CheckboxGroupProps } from "./types";
|
|
3
|
-
declare const Group: ({ value: controlledValue, children, onChange, disabled }: CheckboxGroupProps) => React.JSX.Element;
|
|
3
|
+
declare const Group: ({ value: controlledValue, children, onChange, disabled, }: CheckboxGroupProps) => React.JSX.Element;
|
|
4
4
|
export default Group;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const Checkbox: (({ value, className, style, children, onChange, disabled, checked }: import("./types").CheckboxProps) => import("react").JSX.Element) & {
|
|
2
|
-
Group: ({ value: controlledValue, children, onChange, disabled }: import("./types").CheckboxGroupProps) => import("react").JSX.Element;
|
|
1
|
+
export declare const Checkbox: (({ value, className, style, children, onChange, disabled, checked, }: import("./types").CheckboxProps) => import("react").JSX.Element) & {
|
|
2
|
+
Group: ({ value: controlledValue, children, onChange, disabled, }: import("./types").CheckboxGroupProps) => import("react").JSX.Element;
|
|
3
3
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DatePickerProps } from "./types";
|
|
2
|
-
import { RefObject } from "react";
|
|
3
|
-
import { PickerRef } from "../picker";
|
|
1
|
+
import type { DatePickerProps } from "./types";
|
|
2
|
+
import { type RefObject } from "react";
|
|
3
|
+
import { type PickerRef } from "../picker";
|
|
4
4
|
/**
|
|
5
5
|
* @description
|
|
6
6
|
* value
|
|
@@ -14,7 +14,7 @@ var DateRangePicker = function DateRangePicker(props) {
|
|
|
14
14
|
onChange = _useValue.onChange,
|
|
15
15
|
value = _useValue.value;
|
|
16
16
|
var classNames = useClassNames(ComponentToken.DateRangePicker);
|
|
17
|
-
|
|
17
|
+
// picked date
|
|
18
18
|
var picked = useMemo(function () {
|
|
19
19
|
var _value = _slicedToArray(value, 2),
|
|
20
20
|
from = _value[0],
|
|
@@ -24,7 +24,7 @@ var DateRangePicker = function DateRangePicker(props) {
|
|
|
24
24
|
className: "musae-98rzlu musae-78zum5 musae-18jba3g musae-6s0dn4"
|
|
25
25
|
},
|
|
26
26
|
trigger: {
|
|
27
|
-
className: "musae-
|
|
27
|
+
className: "musae-1iyjqo2 musae-s83m0k musae-4y2jaj musae-uxw1ft musae-b3r6kr musae-lyipyv musae-1a7a393"
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { DateRangePickerProps } from "./types";
|
|
2
|
-
import { RefObject } from "react";
|
|
1
|
+
import type { DateRangePickerProps } from "./types";
|
|
2
|
+
import { type RefObject } from "react";
|
|
3
3
|
import { Dayjs } from "dayjs";
|
|
4
|
-
import {
|
|
5
|
-
import { PickerRef } from "../picker";
|
|
4
|
+
import { type PickerRef } from "../picker";
|
|
6
5
|
/**
|
|
7
6
|
* @description
|
|
8
7
|
* value
|
|
9
8
|
*/
|
|
10
9
|
export declare const useValue: ([_value, _change, ref]: [DateRangePickerProps["value"], DateRangePickerProps["onChange"], RefObject<PickerRef>]) => {
|
|
11
|
-
value: [Partialable<Dayjs>, Partialable<Dayjs>];
|
|
10
|
+
value: [import("@aiszlab/relax/types").Partialable<Dayjs>, import("@aiszlab/relax/types").Partialable<Dayjs>];
|
|
12
11
|
onChange: (_value: Dayjs) => void;
|
|
13
12
|
};
|
|
@@ -20,7 +20,7 @@ var useValue = function useValue(_ref) {
|
|
|
20
20
|
var onChange = useCallback(function (_value) {
|
|
21
21
|
var _value$filter$length, _value$filter, _ref$current;
|
|
22
22
|
// click first time
|
|
23
|
-
if ([0, 2].
|
|
23
|
+
if (new Set([0, 2]).has((_value$filter$length = (_value$filter = value.filter(function (_value) {
|
|
24
24
|
return !!_value;
|
|
25
25
|
})) === null || _value$filter === void 0 ? void 0 : _value$filter.length) !== null && _value$filter$length !== void 0 ? _value$filter$length : 0)) {
|
|
26
26
|
setValue([_value, void 0]);
|
|
@@ -14,7 +14,7 @@ import { ColorToken } from '../../utils/colors.js';
|
|
|
14
14
|
import { typography } from '../theme/theme.js';
|
|
15
15
|
import clsx from 'clsx';
|
|
16
16
|
import { useClosable } from '../../hooks/use-closable.js';
|
|
17
|
-
import { contains } from '../../node_modules/.pnpm/@aiszlab_relax@1.2.
|
|
17
|
+
import { contains } from '../../node_modules/.pnpm/@aiszlab_relax@1.2.71_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@aiszlab/relax/dist/dom/contains.js';
|
|
18
18
|
|
|
19
19
|
var _excluded = ["onClose", "open", "closable", "onClosed"];
|
|
20
20
|
var styles = {
|
|
@@ -14,7 +14,7 @@ import { ColorToken } from '../../utils/colors.js';
|
|
|
14
14
|
import clsx from 'clsx';
|
|
15
15
|
import { typography } from '../theme/theme.js';
|
|
16
16
|
import { useClosable } from '../../hooks/use-closable.js';
|
|
17
|
-
import { contains } from '../../node_modules/.pnpm/@aiszlab_relax@1.2.
|
|
17
|
+
import { contains } from '../../node_modules/.pnpm/@aiszlab_relax@1.2.71_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@aiszlab/relax/dist/dom/contains.js';
|
|
18
18
|
|
|
19
19
|
var _excluded = ["open", "onClose", "placement", "closable", "onClosed", "size"];
|
|
20
20
|
var styles = {
|
|
@@ -134,7 +134,7 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
134
134
|
invalid = _ref$invalid === void 0 ? false : _ref$invalid,
|
|
135
135
|
readOnly = _ref.readOnly,
|
|
136
136
|
maxLength = _ref.maxLength,
|
|
137
|
-
|
|
137
|
+
valueInProps = _ref.value,
|
|
138
138
|
onBlur = _ref.onBlur,
|
|
139
139
|
onChange = _ref.onChange,
|
|
140
140
|
onClick = _ref.onClick,
|
|
@@ -160,7 +160,7 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
160
160
|
};
|
|
161
161
|
}, []);
|
|
162
162
|
/// controlled value
|
|
163
|
-
var _useControlledState = useControlledState(
|
|
163
|
+
var _useControlledState = useControlledState(valueInProps, {
|
|
164
164
|
defaultState: ""
|
|
165
165
|
}),
|
|
166
166
|
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
2
|
import { useControlledState, useEvent, isUndefined } from '@aiszlab/relax';
|
|
3
|
-
import { useMemo } from 'react';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* @description
|
|
@@ -12,9 +11,6 @@ var useValue = function useValue(_ref) {
|
|
|
12
11
|
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
13
12
|
value = _useControlledState2[0],
|
|
14
13
|
setValue = _useControlledState2[1];
|
|
15
|
-
var __value = useMemo(function () {
|
|
16
|
-
return value;
|
|
17
|
-
}, [value]);
|
|
18
14
|
var change = useEvent(function (___value) {
|
|
19
15
|
// ignore invalid character
|
|
20
16
|
if (!/^-?(?:\d+)?(\.)?\d*$/.test(___value) && ___value !== "") {
|
|
@@ -27,7 +23,7 @@ var useValue = function useValue(_ref) {
|
|
|
27
23
|
}
|
|
28
24
|
});
|
|
29
25
|
return {
|
|
30
|
-
value:
|
|
26
|
+
value: value,
|
|
31
27
|
change: change
|
|
32
28
|
};
|
|
33
29
|
};
|
|
@@ -10,16 +10,16 @@ var Group = function Group(_ref) {
|
|
|
10
10
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
11
11
|
children = _ref.children,
|
|
12
12
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
-
|
|
13
|
+
// controlled value
|
|
14
14
|
var _useControlledState = useControlledState(props.value),
|
|
15
15
|
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
16
16
|
value = _useControlledState2[0],
|
|
17
17
|
setValue = _useControlledState2[1];
|
|
18
|
-
|
|
18
|
+
// value change handler
|
|
19
19
|
var change = useCallback(function (value) {
|
|
20
20
|
setValue(value);
|
|
21
21
|
}, [setValue]);
|
|
22
|
-
|
|
22
|
+
// context value
|
|
23
23
|
var contextValue = useMemo(function () {
|
|
24
24
|
return {
|
|
25
25
|
value: value,
|
|
@@ -185,18 +185,18 @@ var Radio = function Radio(_ref) {
|
|
|
185
185
|
var _contextValue$isDisab;
|
|
186
186
|
return (_contextValue$isDisab = contextValue === null || contextValue === void 0 ? void 0 : contextValue.isDisabled) !== null && _contextValue$isDisab !== void 0 ? _contextValue$isDisab : disabled;
|
|
187
187
|
}, [contextValue === null || contextValue === void 0 ? void 0 : contextValue.isDisabled, disabled]);
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
// check current radio is checked
|
|
189
|
+
// if current radio is in provider, use provider context value first
|
|
190
|
+
// or not, use isChecked property
|
|
191
|
+
// otherwise, it control itself
|
|
192
192
|
var isChecked = useMemo(function () {
|
|
193
193
|
if (contextValue) {
|
|
194
194
|
return value === contextValue.value;
|
|
195
195
|
}
|
|
196
196
|
return !!_isChecked;
|
|
197
197
|
}, [contextValue, _isChecked, value]);
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
// change handler for radio
|
|
199
|
+
// radio do not support cancel checked
|
|
200
200
|
var change = useCallback(function () {
|
|
201
201
|
// if chekced, ignore
|
|
202
202
|
if (isChecked) return;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Key, type RefObject } from "react";
|
|
2
2
|
import type { TabItem } from "./types";
|
|
3
|
+
import type { Partialable } from "@aiszlab/relax/types";
|
|
3
4
|
/**
|
|
4
5
|
* @description
|
|
5
6
|
* use tab context
|
|
@@ -14,7 +15,7 @@ export declare const useTabs: ({ activeKey: _activeKey, items, defaultActiveKey,
|
|
|
14
15
|
items: TabItem[];
|
|
15
16
|
defaultActiveKey?: Key;
|
|
16
17
|
}) => {
|
|
17
|
-
activeKey:
|
|
18
|
+
activeKey: Partialable<Key>;
|
|
18
19
|
activatedKeys: Set<Key>;
|
|
19
20
|
changeActiveKey: (key: Key) => void;
|
|
20
21
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TimePickerProps } from "./types";
|
|
2
2
|
import dayjs from "dayjs";
|
|
3
|
-
import { RefObject } from "react";
|
|
4
|
-
import { PickerRef } from "../picker";
|
|
3
|
+
import { type RefObject } from "react";
|
|
4
|
+
import type { PickerRef } from "../picker";
|
|
5
5
|
/**
|
|
6
6
|
* @description
|
|
7
7
|
* value
|
|
@@ -46,7 +46,7 @@ var useTransfer = function useTransfer(props) {
|
|
|
46
46
|
return [].concat(_toConsumableArray(prev), _toConsumableArray(transferKeys));
|
|
47
47
|
});
|
|
48
48
|
setTransferKeys([]);
|
|
49
|
-
}, [transferKeys]);
|
|
49
|
+
}, [transferKeys, setValue]);
|
|
50
50
|
var untransfer = useCallback(function () {
|
|
51
51
|
setValue(function () {
|
|
52
52
|
var prev = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -56,7 +56,7 @@ var useTransfer = function useTransfer(props) {
|
|
|
56
56
|
}, new Set(prev)));
|
|
57
57
|
});
|
|
58
58
|
setUntransferKeys([]);
|
|
59
|
-
}, [untransferKeys]);
|
|
59
|
+
}, [untransferKeys, setValue]);
|
|
60
60
|
return {
|
|
61
61
|
transferred: transferred,
|
|
62
62
|
untransferred: untransferred,
|
package/dist/stylex.css
CHANGED
|
@@ -140,9 +140,12 @@
|
|
|
140
140
|
.musae-3nfvp2:not(#\#):not(#\#):not(#\#){display:inline-flex}
|
|
141
141
|
.musae-1s85apg:not(#\#):not(#\#):not(#\#){display:none}
|
|
142
142
|
.musae-bh8q5q:not(#\#):not(#\#):not(#\#){fill:none}
|
|
143
|
+
.musae-4y2jaj:not(#\#):not(#\#):not(#\#){flex-basis:fit-content}
|
|
143
144
|
.musae-dt5ytf:not(#\#):not(#\#):not(#\#){flex-direction:column}
|
|
144
145
|
.musae-1q0g3np:not(#\#):not(#\#):not(#\#){flex-direction:row}
|
|
146
|
+
.musae-1iyjqo2:not(#\#):not(#\#):not(#\#){flex-grow:1}
|
|
145
147
|
.musae-2lah0s:not(#\#):not(#\#):not(#\#){flex-shrink:0}
|
|
148
|
+
.musae-s83m0k:not(#\#):not(#\#):not(#\#){flex-shrink:1}
|
|
146
149
|
.musae-1a02dak:not(#\#):not(#\#):not(#\#){flex-wrap:wrap}
|
|
147
150
|
.musae-1j6dyjg:not(#\#):not(#\#):not(#\#){font-size:11px}
|
|
148
151
|
.musae-fifm61:not(#\#):not(#\#):not(#\#){font-size:12px}
|
|
@@ -234,6 +237,7 @@ html:not([dir='rtl']) .musae-1yc453h:not(#\#):not(#\#):not(#\#){text-align:left}
|
|
|
234
237
|
html[dir='rtl'] .musae-1yc453h:not(#\#):not(#\#):not(#\#){text-align:right}
|
|
235
238
|
html:not([dir='rtl']) .musae-p4054r:not(#\#):not(#\#):not(#\#){text-align:right}
|
|
236
239
|
html[dir='rtl'] .musae-p4054r:not(#\#):not(#\#):not(#\#){text-align:left}
|
|
240
|
+
.musae-lyipyv:not(#\#):not(#\#):not(#\#){text-overflow:ellipsis}
|
|
237
241
|
.musae-1bndym7:not(#\#):not(#\#):not(#\#){transform-origin:50% 50%}
|
|
238
242
|
.musae-1g0ag68:not(#\#):not(#\#):not(#\#){transform-origin:center}
|
|
239
243
|
.musae-9tu13d:not(#\#):not(#\#):not(#\#){transform:rotate(-90deg)}
|
|
@@ -275,6 +279,7 @@ html[dir='rtl'] .musae-p4054r:not(#\#):not(#\#):not(#\#){text-align:left}
|
|
|
275
279
|
.musae-mn8nw1:not(#\#):not(#\#):not(#\#){z-index:var(--musae-80rspi)}
|
|
276
280
|
.musae-1tv1kli:not(#\#):not(#\#):not(#\#){z-index:var(--musae-9gpkaf)}
|
|
277
281
|
.musae-1q93749:not(#\#):not(#\#):not(#\#){z-index:var(--musae-ah5ngi)}
|
|
282
|
+
.musae-1lhwzte:not(#\#):not(#\#):not(#\#){z-index:var(--musae-dlxqgz)}
|
|
278
283
|
.musae-aefx0h:not(#\#):not(#\#):not(#\#){z-index:var(--musae-if0yew)}
|
|
279
284
|
.musae-1axsr4t:not(#\#):not(#\#):not(#\#){z-index:var(--musae-oqacdq)}
|
|
280
285
|
.musae-5w6sei:not(#\#):not(#\#):not(#\#){z-index:var(--musae-ymrixl)}
|
|
@@ -347,6 +352,7 @@ html[dir='rtl'] .musae-p4054r:not(#\#):not(#\#):not(#\#){text-align:left}
|
|
|
347
352
|
.musae-1jzhcrs:not(#\#):not(#\#):not(#\#):not(#\#){min-width:200px}
|
|
348
353
|
.musae-15cq3s0:not(#\#):not(#\#):not(#\#):not(#\#){min-width:480px}
|
|
349
354
|
.musae-13to73x:not(#\#):not(#\#):not(#\#):not(#\#){min-width:var(--minWidth,revert)}
|
|
355
|
+
.musae-1a7a393:not(#\#):not(#\#):not(#\#):not(#\#){min-width:var(--musae-16n5srz)}
|
|
350
356
|
.musae-yumy05:not(#\#):not(#\#):not(#\#):not(#\#){min-width:var(--musae-1aj7t22)}
|
|
351
357
|
.musae-70jws7:not(#\#):not(#\#):not(#\#):not(#\#){min-width:var(--musae-1l9c3uf)}
|
|
352
358
|
.musae-h2iun8:not(#\#):not(#\#):not(#\#):not(#\#){min-width:var(--musae-1spnrok)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "musae",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"description": "musae-ui",
|
|
5
5
|
"author": "tutu@fantufantu.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"pnpm": ">=9"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@aiszlab/relax": "^1.2.
|
|
30
|
+
"@aiszlab/relax": "^1.2.71",
|
|
31
31
|
"@babel/runtime": "^7.25.0",
|
|
32
32
|
"@dnd-kit/core": "^6.1.0",
|
|
33
33
|
"@dnd-kit/modifiers": "^7.0.0",
|