@yamada-ui/number-input 0.2.5 → 0.2.7
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/{chunk-BQMXCZW3.mjs → chunk-XXBH2BPE.mjs} +97 -66
- package/dist/index.js +97 -66
- package/dist/index.mjs +1 -1
- package/dist/number-input.js +97 -66
- package/dist/number-input.mjs +1 -1
- package/package.json +8 -8
|
@@ -42,7 +42,11 @@ var isValidNumericKeyboardEvent = ({ key, ctrlKey, altKey, metaKey }, isValid) =
|
|
|
42
42
|
return true;
|
|
43
43
|
return isValid(key);
|
|
44
44
|
};
|
|
45
|
-
var getStep = ({
|
|
45
|
+
var getStep = ({
|
|
46
|
+
ctrlKey,
|
|
47
|
+
shiftKey,
|
|
48
|
+
metaKey
|
|
49
|
+
}) => {
|
|
46
50
|
let ratio = 1;
|
|
47
51
|
if (metaKey || ctrlKey)
|
|
48
52
|
ratio = 0.1;
|
|
@@ -97,8 +101,20 @@ var useNumberInput = (props = {}) => {
|
|
|
97
101
|
})
|
|
98
102
|
);
|
|
99
103
|
const onInvalid = useCallbackRef(rest.onInvalid);
|
|
100
|
-
const isValidCharacter = useCallbackRef(
|
|
101
|
-
|
|
104
|
+
const isValidCharacter = useCallbackRef(
|
|
105
|
+
(_a = rest.isValidCharacter) != null ? _a : isDefaultValidCharacter
|
|
106
|
+
);
|
|
107
|
+
const {
|
|
108
|
+
isMin,
|
|
109
|
+
isMax,
|
|
110
|
+
isOut,
|
|
111
|
+
value,
|
|
112
|
+
valueAsNumber,
|
|
113
|
+
setValue,
|
|
114
|
+
update,
|
|
115
|
+
cast,
|
|
116
|
+
...counter
|
|
117
|
+
} = useCounter({
|
|
102
118
|
min,
|
|
103
119
|
max,
|
|
104
120
|
precision,
|
|
@@ -109,10 +125,13 @@ var useNumberInput = (props = {}) => {
|
|
|
109
125
|
(value2) => value2.split("").filter(isValidCharacter).join(""),
|
|
110
126
|
[isValidCharacter]
|
|
111
127
|
);
|
|
112
|
-
const parse = useCallback(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
128
|
+
const parse = useCallback(
|
|
129
|
+
(value2) => {
|
|
130
|
+
var _a2, _b;
|
|
131
|
+
return (_b = (_a2 = rest.parse) == null ? void 0 : _a2.call(rest, value2)) != null ? _b : value2;
|
|
132
|
+
},
|
|
133
|
+
[rest]
|
|
134
|
+
);
|
|
116
135
|
const format = useCallback(
|
|
117
136
|
(value2) => {
|
|
118
137
|
var _a2, _b;
|
|
@@ -411,41 +430,51 @@ var [NumberInputContextProvider, useNumberInputContext] = createContext({
|
|
|
411
430
|
strict: false,
|
|
412
431
|
name: "NumberInputContext"
|
|
413
432
|
});
|
|
414
|
-
var NumberInput = forwardRef(
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
433
|
+
var NumberInput = forwardRef(
|
|
434
|
+
(props, ref) => {
|
|
435
|
+
const [styles, mergedProps] = useMultiComponentStyle("NumberInput", props);
|
|
436
|
+
const {
|
|
437
|
+
className,
|
|
438
|
+
isStepper = true,
|
|
439
|
+
containerProps,
|
|
440
|
+
addonProps,
|
|
441
|
+
incrementProps,
|
|
442
|
+
decrementProps,
|
|
443
|
+
onChange,
|
|
444
|
+
...rest
|
|
445
|
+
} = omitThemeProps(mergedProps);
|
|
446
|
+
const { getInputProps, getIncrementProps, getDecrementProps } = useNumberInput({
|
|
447
|
+
onChange,
|
|
448
|
+
...rest
|
|
449
|
+
});
|
|
450
|
+
const css = {
|
|
451
|
+
position: "relative",
|
|
452
|
+
zIndex: 0,
|
|
453
|
+
...styles.container
|
|
454
|
+
};
|
|
455
|
+
return /* @__PURE__ */ jsx(
|
|
456
|
+
NumberInputContextProvider,
|
|
457
|
+
{
|
|
458
|
+
value: { getInputProps, getIncrementProps, getDecrementProps, styles },
|
|
459
|
+
children: /* @__PURE__ */ jsxs(
|
|
460
|
+
ui.div,
|
|
461
|
+
{
|
|
462
|
+
className: cx("ui-number-input", className),
|
|
463
|
+
__css: css,
|
|
464
|
+
...containerProps,
|
|
465
|
+
children: [
|
|
466
|
+
/* @__PURE__ */ jsx(NumberInputField, { ...getInputProps(rest, ref) }),
|
|
467
|
+
isStepper ? /* @__PURE__ */ jsxs(NumberInputAddon, { ...addonProps, children: [
|
|
468
|
+
/* @__PURE__ */ jsx(NumberIncrementStepper, { ...incrementProps }),
|
|
469
|
+
/* @__PURE__ */ jsx(NumberDecrementStepper, { ...decrementProps })
|
|
470
|
+
] }) : null
|
|
471
|
+
]
|
|
472
|
+
}
|
|
473
|
+
)
|
|
474
|
+
}
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
);
|
|
449
478
|
var NumberInputField = forwardRef(
|
|
450
479
|
({ className, ...rest }, ref) => {
|
|
451
480
|
const { styles } = useNumberInputContext();
|
|
@@ -464,30 +493,32 @@ var NumberInputField = forwardRef(
|
|
|
464
493
|
);
|
|
465
494
|
}
|
|
466
495
|
);
|
|
467
|
-
var NumberInputAddon = forwardRef(
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
496
|
+
var NumberInputAddon = forwardRef(
|
|
497
|
+
({ className, ...rest }, ref) => {
|
|
498
|
+
const { styles } = useNumberInputContext();
|
|
499
|
+
const css = {
|
|
500
|
+
display: "flex",
|
|
501
|
+
flexDirection: "column",
|
|
502
|
+
position: "absolute",
|
|
503
|
+
top: "0",
|
|
504
|
+
insetEnd: "0px",
|
|
505
|
+
margin: "1px",
|
|
506
|
+
height: "calc(100% - 2px)",
|
|
507
|
+
zIndex: 1,
|
|
508
|
+
...styles.addon
|
|
509
|
+
};
|
|
510
|
+
return /* @__PURE__ */ jsx(
|
|
511
|
+
ui.div,
|
|
512
|
+
{
|
|
513
|
+
ref,
|
|
514
|
+
className: cx("ui-number-input-addon", className),
|
|
515
|
+
"aria-hidden": true,
|
|
516
|
+
__css: css,
|
|
517
|
+
...rest
|
|
518
|
+
}
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
);
|
|
491
522
|
var Stepper = ui("div", {
|
|
492
523
|
baseStyle: {
|
|
493
524
|
display: "flex",
|
package/dist/index.js
CHANGED
|
@@ -45,7 +45,11 @@ var isValidNumericKeyboardEvent = ({ key, ctrlKey, altKey, metaKey }, isValid) =
|
|
|
45
45
|
return true;
|
|
46
46
|
return isValid(key);
|
|
47
47
|
};
|
|
48
|
-
var getStep = ({
|
|
48
|
+
var getStep = ({
|
|
49
|
+
ctrlKey,
|
|
50
|
+
shiftKey,
|
|
51
|
+
metaKey
|
|
52
|
+
}) => {
|
|
49
53
|
let ratio = 1;
|
|
50
54
|
if (metaKey || ctrlKey)
|
|
51
55
|
ratio = 0.1;
|
|
@@ -100,8 +104,20 @@ var useNumberInput = (props = {}) => {
|
|
|
100
104
|
})
|
|
101
105
|
);
|
|
102
106
|
const onInvalid = (0, import_utils.useCallbackRef)(rest.onInvalid);
|
|
103
|
-
const isValidCharacter = (0, import_utils.useCallbackRef)(
|
|
104
|
-
|
|
107
|
+
const isValidCharacter = (0, import_utils.useCallbackRef)(
|
|
108
|
+
(_a = rest.isValidCharacter) != null ? _a : isDefaultValidCharacter
|
|
109
|
+
);
|
|
110
|
+
const {
|
|
111
|
+
isMin,
|
|
112
|
+
isMax,
|
|
113
|
+
isOut,
|
|
114
|
+
value,
|
|
115
|
+
valueAsNumber,
|
|
116
|
+
setValue,
|
|
117
|
+
update,
|
|
118
|
+
cast,
|
|
119
|
+
...counter
|
|
120
|
+
} = (0, import_use_counter.useCounter)({
|
|
105
121
|
min,
|
|
106
122
|
max,
|
|
107
123
|
precision,
|
|
@@ -112,10 +128,13 @@ var useNumberInput = (props = {}) => {
|
|
|
112
128
|
(value2) => value2.split("").filter(isValidCharacter).join(""),
|
|
113
129
|
[isValidCharacter]
|
|
114
130
|
);
|
|
115
|
-
const parse = (0, import_react.useCallback)(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
131
|
+
const parse = (0, import_react.useCallback)(
|
|
132
|
+
(value2) => {
|
|
133
|
+
var _a2, _b;
|
|
134
|
+
return (_b = (_a2 = rest.parse) == null ? void 0 : _a2.call(rest, value2)) != null ? _b : value2;
|
|
135
|
+
},
|
|
136
|
+
[rest]
|
|
137
|
+
);
|
|
119
138
|
const format = (0, import_react.useCallback)(
|
|
120
139
|
(value2) => {
|
|
121
140
|
var _a2, _b;
|
|
@@ -414,41 +433,51 @@ var [NumberInputContextProvider, useNumberInputContext] = (0, import_utils.creat
|
|
|
414
433
|
strict: false,
|
|
415
434
|
name: "NumberInputContext"
|
|
416
435
|
});
|
|
417
|
-
var NumberInput = (0, import_core.forwardRef)(
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
436
|
+
var NumberInput = (0, import_core.forwardRef)(
|
|
437
|
+
(props, ref) => {
|
|
438
|
+
const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("NumberInput", props);
|
|
439
|
+
const {
|
|
440
|
+
className,
|
|
441
|
+
isStepper = true,
|
|
442
|
+
containerProps,
|
|
443
|
+
addonProps,
|
|
444
|
+
incrementProps,
|
|
445
|
+
decrementProps,
|
|
446
|
+
onChange,
|
|
447
|
+
...rest
|
|
448
|
+
} = (0, import_core.omitThemeProps)(mergedProps);
|
|
449
|
+
const { getInputProps, getIncrementProps, getDecrementProps } = useNumberInput({
|
|
450
|
+
onChange,
|
|
451
|
+
...rest
|
|
452
|
+
});
|
|
453
|
+
const css = {
|
|
454
|
+
position: "relative",
|
|
455
|
+
zIndex: 0,
|
|
456
|
+
...styles.container
|
|
457
|
+
};
|
|
458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
459
|
+
NumberInputContextProvider,
|
|
460
|
+
{
|
|
461
|
+
value: { getInputProps, getIncrementProps, getDecrementProps, styles },
|
|
462
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
463
|
+
import_core.ui.div,
|
|
464
|
+
{
|
|
465
|
+
className: (0, import_utils.cx)("ui-number-input", className),
|
|
466
|
+
__css: css,
|
|
467
|
+
...containerProps,
|
|
468
|
+
children: [
|
|
469
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(NumberInputField, { ...getInputProps(rest, ref) }),
|
|
470
|
+
isStepper ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(NumberInputAddon, { ...addonProps, children: [
|
|
471
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(NumberIncrementStepper, { ...incrementProps }),
|
|
472
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(NumberDecrementStepper, { ...decrementProps })
|
|
473
|
+
] }) : null
|
|
474
|
+
]
|
|
475
|
+
}
|
|
476
|
+
)
|
|
477
|
+
}
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
);
|
|
452
481
|
var NumberInputField = (0, import_core.forwardRef)(
|
|
453
482
|
({ className, ...rest }, ref) => {
|
|
454
483
|
const { styles } = useNumberInputContext();
|
|
@@ -467,30 +496,32 @@ var NumberInputField = (0, import_core.forwardRef)(
|
|
|
467
496
|
);
|
|
468
497
|
}
|
|
469
498
|
);
|
|
470
|
-
var NumberInputAddon = (0, import_core.forwardRef)(
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
499
|
+
var NumberInputAddon = (0, import_core.forwardRef)(
|
|
500
|
+
({ className, ...rest }, ref) => {
|
|
501
|
+
const { styles } = useNumberInputContext();
|
|
502
|
+
const css = {
|
|
503
|
+
display: "flex",
|
|
504
|
+
flexDirection: "column",
|
|
505
|
+
position: "absolute",
|
|
506
|
+
top: "0",
|
|
507
|
+
insetEnd: "0px",
|
|
508
|
+
margin: "1px",
|
|
509
|
+
height: "calc(100% - 2px)",
|
|
510
|
+
zIndex: 1,
|
|
511
|
+
...styles.addon
|
|
512
|
+
};
|
|
513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
514
|
+
import_core.ui.div,
|
|
515
|
+
{
|
|
516
|
+
ref,
|
|
517
|
+
className: (0, import_utils.cx)("ui-number-input-addon", className),
|
|
518
|
+
"aria-hidden": true,
|
|
519
|
+
__css: css,
|
|
520
|
+
...rest
|
|
521
|
+
}
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
);
|
|
494
525
|
var Stepper = (0, import_core.ui)("div", {
|
|
495
526
|
baseStyle: {
|
|
496
527
|
display: "flex",
|
package/dist/index.mjs
CHANGED
package/dist/number-input.js
CHANGED
|
@@ -43,7 +43,11 @@ var isValidNumericKeyboardEvent = ({ key, ctrlKey, altKey, metaKey }, isValid) =
|
|
|
43
43
|
return true;
|
|
44
44
|
return isValid(key);
|
|
45
45
|
};
|
|
46
|
-
var getStep = ({
|
|
46
|
+
var getStep = ({
|
|
47
|
+
ctrlKey,
|
|
48
|
+
shiftKey,
|
|
49
|
+
metaKey
|
|
50
|
+
}) => {
|
|
47
51
|
let ratio = 1;
|
|
48
52
|
if (metaKey || ctrlKey)
|
|
49
53
|
ratio = 0.1;
|
|
@@ -98,8 +102,20 @@ var useNumberInput = (props = {}) => {
|
|
|
98
102
|
})
|
|
99
103
|
);
|
|
100
104
|
const onInvalid = (0, import_utils.useCallbackRef)(rest.onInvalid);
|
|
101
|
-
const isValidCharacter = (0, import_utils.useCallbackRef)(
|
|
102
|
-
|
|
105
|
+
const isValidCharacter = (0, import_utils.useCallbackRef)(
|
|
106
|
+
(_a = rest.isValidCharacter) != null ? _a : isDefaultValidCharacter
|
|
107
|
+
);
|
|
108
|
+
const {
|
|
109
|
+
isMin,
|
|
110
|
+
isMax,
|
|
111
|
+
isOut,
|
|
112
|
+
value,
|
|
113
|
+
valueAsNumber,
|
|
114
|
+
setValue,
|
|
115
|
+
update,
|
|
116
|
+
cast,
|
|
117
|
+
...counter
|
|
118
|
+
} = (0, import_use_counter.useCounter)({
|
|
103
119
|
min,
|
|
104
120
|
max,
|
|
105
121
|
precision,
|
|
@@ -110,10 +126,13 @@ var useNumberInput = (props = {}) => {
|
|
|
110
126
|
(value2) => value2.split("").filter(isValidCharacter).join(""),
|
|
111
127
|
[isValidCharacter]
|
|
112
128
|
);
|
|
113
|
-
const parse = (0, import_react.useCallback)(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
129
|
+
const parse = (0, import_react.useCallback)(
|
|
130
|
+
(value2) => {
|
|
131
|
+
var _a2, _b;
|
|
132
|
+
return (_b = (_a2 = rest.parse) == null ? void 0 : _a2.call(rest, value2)) != null ? _b : value2;
|
|
133
|
+
},
|
|
134
|
+
[rest]
|
|
135
|
+
);
|
|
117
136
|
const format = (0, import_react.useCallback)(
|
|
118
137
|
(value2) => {
|
|
119
138
|
var _a2, _b;
|
|
@@ -412,41 +431,51 @@ var [NumberInputContextProvider, useNumberInputContext] = (0, import_utils.creat
|
|
|
412
431
|
strict: false,
|
|
413
432
|
name: "NumberInputContext"
|
|
414
433
|
});
|
|
415
|
-
var NumberInput = (0, import_core.forwardRef)(
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
434
|
+
var NumberInput = (0, import_core.forwardRef)(
|
|
435
|
+
(props, ref) => {
|
|
436
|
+
const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("NumberInput", props);
|
|
437
|
+
const {
|
|
438
|
+
className,
|
|
439
|
+
isStepper = true,
|
|
440
|
+
containerProps,
|
|
441
|
+
addonProps,
|
|
442
|
+
incrementProps,
|
|
443
|
+
decrementProps,
|
|
444
|
+
onChange,
|
|
445
|
+
...rest
|
|
446
|
+
} = (0, import_core.omitThemeProps)(mergedProps);
|
|
447
|
+
const { getInputProps, getIncrementProps, getDecrementProps } = useNumberInput({
|
|
448
|
+
onChange,
|
|
449
|
+
...rest
|
|
450
|
+
});
|
|
451
|
+
const css = {
|
|
452
|
+
position: "relative",
|
|
453
|
+
zIndex: 0,
|
|
454
|
+
...styles.container
|
|
455
|
+
};
|
|
456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
457
|
+
NumberInputContextProvider,
|
|
458
|
+
{
|
|
459
|
+
value: { getInputProps, getIncrementProps, getDecrementProps, styles },
|
|
460
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
461
|
+
import_core.ui.div,
|
|
462
|
+
{
|
|
463
|
+
className: (0, import_utils.cx)("ui-number-input", className),
|
|
464
|
+
__css: css,
|
|
465
|
+
...containerProps,
|
|
466
|
+
children: [
|
|
467
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(NumberInputField, { ...getInputProps(rest, ref) }),
|
|
468
|
+
isStepper ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(NumberInputAddon, { ...addonProps, children: [
|
|
469
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(NumberIncrementStepper, { ...incrementProps }),
|
|
470
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(NumberDecrementStepper, { ...decrementProps })
|
|
471
|
+
] }) : null
|
|
472
|
+
]
|
|
473
|
+
}
|
|
474
|
+
)
|
|
475
|
+
}
|
|
476
|
+
);
|
|
477
|
+
}
|
|
478
|
+
);
|
|
450
479
|
var NumberInputField = (0, import_core.forwardRef)(
|
|
451
480
|
({ className, ...rest }, ref) => {
|
|
452
481
|
const { styles } = useNumberInputContext();
|
|
@@ -465,30 +494,32 @@ var NumberInputField = (0, import_core.forwardRef)(
|
|
|
465
494
|
);
|
|
466
495
|
}
|
|
467
496
|
);
|
|
468
|
-
var NumberInputAddon = (0, import_core.forwardRef)(
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
497
|
+
var NumberInputAddon = (0, import_core.forwardRef)(
|
|
498
|
+
({ className, ...rest }, ref) => {
|
|
499
|
+
const { styles } = useNumberInputContext();
|
|
500
|
+
const css = {
|
|
501
|
+
display: "flex",
|
|
502
|
+
flexDirection: "column",
|
|
503
|
+
position: "absolute",
|
|
504
|
+
top: "0",
|
|
505
|
+
insetEnd: "0px",
|
|
506
|
+
margin: "1px",
|
|
507
|
+
height: "calc(100% - 2px)",
|
|
508
|
+
zIndex: 1,
|
|
509
|
+
...styles.addon
|
|
510
|
+
};
|
|
511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
512
|
+
import_core.ui.div,
|
|
513
|
+
{
|
|
514
|
+
ref,
|
|
515
|
+
className: (0, import_utils.cx)("ui-number-input-addon", className),
|
|
516
|
+
"aria-hidden": true,
|
|
517
|
+
__css: css,
|
|
518
|
+
...rest
|
|
519
|
+
}
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
);
|
|
492
523
|
var Stepper = (0, import_core.ui)("div", {
|
|
493
524
|
baseStyle: {
|
|
494
525
|
display: "flex",
|
package/dist/number-input.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/number-input",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Yamada UI number input component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yamada",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"url": "https://github.com/hirotomoyamada/yamada-ui/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@yamada-ui/core": "0.5.
|
|
39
|
-
"@yamada-ui/utils": "0.1.
|
|
40
|
-
"@yamada-ui/form-control": "0.2.
|
|
41
|
-
"@yamada-ui/icon": "0.2.
|
|
42
|
-
"@yamada-ui/use-counter": "0.2.
|
|
43
|
-
"@yamada-ui/use-interval": "0.1.
|
|
44
|
-
"@yamada-ui/use-event-listener": "0.1.
|
|
38
|
+
"@yamada-ui/core": "0.5.2",
|
|
39
|
+
"@yamada-ui/utils": "0.1.4",
|
|
40
|
+
"@yamada-ui/form-control": "0.2.7",
|
|
41
|
+
"@yamada-ui/icon": "0.2.7",
|
|
42
|
+
"@yamada-ui/use-counter": "0.2.3",
|
|
43
|
+
"@yamada-ui/use-interval": "0.1.5",
|
|
44
|
+
"@yamada-ui/use-event-listener": "0.1.4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"react": "^18.0.0",
|