@officesdk/design 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/components/cjs/index.d.ts +124 -83
- package/dist/components/cjs/index.js +478 -293
- package/dist/components/cjs/index.js.map +1 -1
- package/dist/components/esm/index.d.ts +124 -83
- package/dist/components/esm/index.js +478 -287
- package/dist/components/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -73,6 +73,125 @@ interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
73
73
|
*/
|
|
74
74
|
declare const Button: React$1.FC<ButtonProps>;
|
|
75
75
|
|
|
76
|
+
type LineType$1 = 'outlined' | 'underlined' | 'borderless';
|
|
77
|
+
interface NumberInputProps {
|
|
78
|
+
/**
|
|
79
|
+
* Current value
|
|
80
|
+
*/
|
|
81
|
+
value?: number;
|
|
82
|
+
/**
|
|
83
|
+
* Default value
|
|
84
|
+
*/
|
|
85
|
+
defaultValue?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Minimum value
|
|
88
|
+
*/
|
|
89
|
+
min?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Maximum value
|
|
92
|
+
*/
|
|
93
|
+
max?: number;
|
|
94
|
+
/**
|
|
95
|
+
* Step increment/decrement
|
|
96
|
+
*/
|
|
97
|
+
step?: number;
|
|
98
|
+
/**
|
|
99
|
+
* Size variant
|
|
100
|
+
*/
|
|
101
|
+
size?: 'small' | 'large';
|
|
102
|
+
/**
|
|
103
|
+
* Whether the input is disabled
|
|
104
|
+
*/
|
|
105
|
+
disabled?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Whether to show alert state (red border)
|
|
108
|
+
*/
|
|
109
|
+
alert?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Number of decimal places
|
|
112
|
+
*/
|
|
113
|
+
precision?: number;
|
|
114
|
+
/**
|
|
115
|
+
* Format the display value
|
|
116
|
+
*/
|
|
117
|
+
formatter?: (value: number) => string;
|
|
118
|
+
/**
|
|
119
|
+
* Parse the input value
|
|
120
|
+
*/
|
|
121
|
+
parser?: (displayValue: string) => number;
|
|
122
|
+
/**
|
|
123
|
+
* Unit text to display after the input
|
|
124
|
+
*/
|
|
125
|
+
unit?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Placeholder text
|
|
128
|
+
*/
|
|
129
|
+
placeholder?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Whether to show step buttons (increment/decrement)
|
|
132
|
+
* @default true
|
|
133
|
+
*/
|
|
134
|
+
showStepButtons?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Trigger mode for showing step buttons
|
|
137
|
+
* - 'normal': always show (default)
|
|
138
|
+
* - 'hover': show only on hover
|
|
139
|
+
* @default 'normal'
|
|
140
|
+
*/
|
|
141
|
+
showStepButtonsTrigger?: 'hover' | 'normal';
|
|
142
|
+
/**
|
|
143
|
+
* Input line type
|
|
144
|
+
* - 'outlined': with full border (default)
|
|
145
|
+
* - 'underlined': with bottom border only
|
|
146
|
+
* - 'borderless': no border
|
|
147
|
+
* @default 'outlined'
|
|
148
|
+
*/
|
|
149
|
+
lineType?: LineType$1;
|
|
150
|
+
/**
|
|
151
|
+
* Whether to use thousands separator in display
|
|
152
|
+
* @default false
|
|
153
|
+
*/
|
|
154
|
+
useThousandsSeparator?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Callback when value changes
|
|
157
|
+
* @param fixedValue - The clamped value within min/max range (can be undefined if empty)
|
|
158
|
+
* @param rawValue - The original input value before clamping (can be undefined if empty)
|
|
159
|
+
*/
|
|
160
|
+
onChange?: (fixedValue: number | undefined, rawValue: number | undefined) => void;
|
|
161
|
+
/**
|
|
162
|
+
* Custom className
|
|
163
|
+
*/
|
|
164
|
+
className?: string;
|
|
165
|
+
/**
|
|
166
|
+
* Custom style
|
|
167
|
+
*/
|
|
168
|
+
style?: React$1.CSSProperties;
|
|
169
|
+
/**
|
|
170
|
+
* Callback when input receives focus
|
|
171
|
+
*/
|
|
172
|
+
onFocus?: (e: React$1.FocusEvent<HTMLInputElement>) => void;
|
|
173
|
+
/**
|
|
174
|
+
* Callback when input loses focus
|
|
175
|
+
*/
|
|
176
|
+
onBlur?: (e: React$1.FocusEvent<HTMLInputElement>) => void;
|
|
177
|
+
/**
|
|
178
|
+
* Callback when input value changes during typing
|
|
179
|
+
* Useful for real-time validation (e.g., check if value is multiple of 3)
|
|
180
|
+
* @param inputValue - The raw input string
|
|
181
|
+
* @param parsedValue - The parsed number value (undefined if invalid)
|
|
182
|
+
*/
|
|
183
|
+
onInputChange?: (inputValue: string, parsedValue: number | undefined) => void;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* NumberInput Component
|
|
187
|
+
*
|
|
188
|
+
* A numeric input with increment/decrement buttons
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* <NumberInput value={35} onChange={(val) => console.log(val)} />
|
|
192
|
+
*/
|
|
193
|
+
declare const NumberInput: React$1.FC<NumberInputProps>;
|
|
194
|
+
|
|
76
195
|
interface SpinButtonProps {
|
|
77
196
|
/**
|
|
78
197
|
* Current value
|
|
@@ -134,6 +253,11 @@ interface SpinButtonProps {
|
|
|
134
253
|
* Custom style
|
|
135
254
|
*/
|
|
136
255
|
style?: React$1.CSSProperties;
|
|
256
|
+
/**
|
|
257
|
+
* Additional props passed to the internal NumberInput component
|
|
258
|
+
* Allows customizing unit, placeholder, lineType, showStepButtons, etc.
|
|
259
|
+
*/
|
|
260
|
+
inputProps?: Partial<Omit<NumberInputProps, 'value' | 'defaultValue' | 'min' | 'max' | 'step' | 'size' | 'disabled' | 'alert' | 'precision' | 'formatter' | 'parser' | 'onChange' | 'className' | 'style'>>;
|
|
137
261
|
}
|
|
138
262
|
/**
|
|
139
263
|
* SpinButton Component - Spin Button
|
|
@@ -530,89 +654,6 @@ declare const SearchInput: React$1.ForwardRefExoticComponent<SearchInputProps &
|
|
|
530
654
|
*/
|
|
531
655
|
declare const UnderlinedInput: React$1.ForwardRefExoticComponent<Omit<InputProps, "lineType"> & React$1.RefAttributes<HTMLInputElement>>;
|
|
532
656
|
|
|
533
|
-
interface NumberInputProps {
|
|
534
|
-
/**
|
|
535
|
-
* Current value
|
|
536
|
-
*/
|
|
537
|
-
value?: number;
|
|
538
|
-
/**
|
|
539
|
-
* Default value
|
|
540
|
-
*/
|
|
541
|
-
defaultValue?: number;
|
|
542
|
-
/**
|
|
543
|
-
* Minimum value
|
|
544
|
-
*/
|
|
545
|
-
min?: number;
|
|
546
|
-
/**
|
|
547
|
-
* Maximum value
|
|
548
|
-
*/
|
|
549
|
-
max?: number;
|
|
550
|
-
/**
|
|
551
|
-
* Step increment/decrement
|
|
552
|
-
*/
|
|
553
|
-
step?: number;
|
|
554
|
-
/**
|
|
555
|
-
* Size variant
|
|
556
|
-
*/
|
|
557
|
-
size?: 'small' | 'large';
|
|
558
|
-
/**
|
|
559
|
-
* Whether the input is disabled
|
|
560
|
-
*/
|
|
561
|
-
disabled?: boolean;
|
|
562
|
-
/**
|
|
563
|
-
* Whether to show alert state (red border)
|
|
564
|
-
*/
|
|
565
|
-
alert?: boolean;
|
|
566
|
-
/**
|
|
567
|
-
* Number of decimal places
|
|
568
|
-
*/
|
|
569
|
-
precision?: number;
|
|
570
|
-
/**
|
|
571
|
-
* Format the display value
|
|
572
|
-
*/
|
|
573
|
-
formatter?: (value: number) => string;
|
|
574
|
-
/**
|
|
575
|
-
* Parse the input value
|
|
576
|
-
*/
|
|
577
|
-
parser?: (displayValue: string) => number;
|
|
578
|
-
/**
|
|
579
|
-
* Unit text to display after the input
|
|
580
|
-
*/
|
|
581
|
-
unit?: string;
|
|
582
|
-
/**
|
|
583
|
-
* Placeholder text
|
|
584
|
-
*/
|
|
585
|
-
placeholder?: string;
|
|
586
|
-
/**
|
|
587
|
-
* Whether to show step buttons (increment/decrement)
|
|
588
|
-
* @default true
|
|
589
|
-
*/
|
|
590
|
-
showStepButtons?: boolean;
|
|
591
|
-
/**
|
|
592
|
-
* Callback when value changes
|
|
593
|
-
* @param fixedValue - The clamped value within min/max range (can be undefined if empty)
|
|
594
|
-
* @param rawValue - The original input value before clamping (can be undefined if empty)
|
|
595
|
-
*/
|
|
596
|
-
onChange?: (fixedValue: number | undefined, rawValue: number | undefined) => void;
|
|
597
|
-
/**
|
|
598
|
-
* Custom className
|
|
599
|
-
*/
|
|
600
|
-
className?: string;
|
|
601
|
-
/**
|
|
602
|
-
* Custom style
|
|
603
|
-
*/
|
|
604
|
-
style?: React$1.CSSProperties;
|
|
605
|
-
}
|
|
606
|
-
/**
|
|
607
|
-
* NumberInput Component
|
|
608
|
-
*
|
|
609
|
-
* A numeric input with increment/decrement buttons
|
|
610
|
-
*
|
|
611
|
-
* @example
|
|
612
|
-
* <NumberInput value={35} onChange={(val) => console.log(val)} />
|
|
613
|
-
*/
|
|
614
|
-
declare const NumberInput: React$1.FC<NumberInputProps>;
|
|
615
|
-
|
|
616
657
|
interface IconSize {
|
|
617
658
|
width: string;
|
|
618
659
|
height: string;
|