@edifice.io/react 2.5.5-develop-b2school.20260115101051 → 2.5.5-develop-b2school.20260115105541
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.
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DatePicker component props
|
|
3
|
+
*
|
|
4
|
+
* Minimal interface that only exposes what is necessary.
|
|
5
|
+
* Ant Design implementation is hidden and no Ant Design-specific props are exposed.
|
|
6
|
+
* Standard HTML div attributes are supported (passed through to the underlying DOM element).
|
|
7
|
+
*/
|
|
8
|
+
export interface DatePickerProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'value' | 'defaultValue'> {
|
|
9
|
+
/**
|
|
10
|
+
* Selected date values
|
|
11
|
+
* @default today's date is setted by ant design if no value is provided
|
|
12
|
+
*/
|
|
13
|
+
value?: Date;
|
|
14
|
+
/**
|
|
15
|
+
* Callback called when date changes
|
|
16
|
+
*/
|
|
17
|
+
onChange?: (date?: Date) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Date format to display in the picker
|
|
20
|
+
* @default 'DD / MM / YYYY'
|
|
21
|
+
*/
|
|
22
|
+
dateFormat?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Minimum selectable date
|
|
25
|
+
*/
|
|
26
|
+
minDate?: Date;
|
|
27
|
+
/**
|
|
28
|
+
* Maximum selectable date
|
|
29
|
+
*/
|
|
30
|
+
maxDate?: Date;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Type for DatePicker ref
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* DatePicker component
|
|
37
|
+
*
|
|
38
|
+
* Date picker component for selecting a date.
|
|
39
|
+
*
|
|
40
|
+
* **Note:** This component uses Ant Design's DatePicker component internally.
|
|
41
|
+
* Only the props defined in DatePickerProps are allowed to prevent
|
|
42
|
+
* dependency on Ant Design-specific features. To replace the implementation,
|
|
43
|
+
* modify the component body below.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <DatePicker
|
|
48
|
+
* value={date}
|
|
49
|
+
* onChange={(date) => setDate(date)}
|
|
50
|
+
* dateFormat="YYYY-MM-DD"
|
|
51
|
+
* minDate={new Date(today.setDate(today.getDate() - 2))}
|
|
52
|
+
* maxDate={new Date(today.setDate(today.getDate() + 3))}
|
|
53
|
+
* />
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
declare const DatePicker: import('react').ForwardRefExoticComponent<DatePickerProps & import('react').RefAttributes<HTMLElement>>;
|
|
57
|
+
export default DatePicker;
|
|
@@ -28,6 +28,7 @@ const DatePicker = /* @__PURE__ */ forwardRef(({
|
|
|
28
28
|
minDate: minDate ? dayjs(minDate) : void 0,
|
|
29
29
|
maxDate: maxDate ? dayjs(maxDate) : void 0,
|
|
30
30
|
ref,
|
|
31
|
+
// Cast necessary because AntDatePicker expects a specific type, but our API exposes only HTMLElement to avoid dependency on Ant Design-specific features.
|
|
31
32
|
...htmlProps
|
|
32
33
|
};
|
|
33
34
|
return /* @__PURE__ */ jsx(DatePicker$1, { ...antProps, getPopupContainer: (triggerNode) => triggerNode.parentElement || document.body });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.5.5-develop-b2school.
|
|
3
|
+
"version": "2.5.5-develop-b2school.20260115105541",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -134,9 +134,9 @@
|
|
|
134
134
|
"react-slugify": "^3.0.3",
|
|
135
135
|
"swiper": "^10.1.0",
|
|
136
136
|
"ua-parser-js": "^1.0.36",
|
|
137
|
-
"@edifice.io/bootstrap": "2.5.5-develop-b2school.
|
|
138
|
-
"@edifice.io/tiptap-extensions": "2.5.5-develop-b2school.
|
|
139
|
-
"@edifice.io/utilities": "2.5.5-develop-b2school.
|
|
137
|
+
"@edifice.io/bootstrap": "2.5.5-develop-b2school.20260115105541",
|
|
138
|
+
"@edifice.io/tiptap-extensions": "2.5.5-develop-b2school.20260115105541",
|
|
139
|
+
"@edifice.io/utilities": "2.5.5-develop-b2school.20260115105541"
|
|
140
140
|
},
|
|
141
141
|
"devDependencies": {
|
|
142
142
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -167,8 +167,8 @@
|
|
|
167
167
|
"vite": "^5.4.11",
|
|
168
168
|
"vite-plugin-dts": "^4.1.0",
|
|
169
169
|
"vite-tsconfig-paths": "^5.0.1",
|
|
170
|
-
"@edifice.io/
|
|
171
|
-
"@edifice.io/
|
|
170
|
+
"@edifice.io/config": "2.5.5-develop-b2school.20260115105541",
|
|
171
|
+
"@edifice.io/client": "2.5.5-develop-b2school.20260115105541"
|
|
172
172
|
},
|
|
173
173
|
"peerDependencies": {
|
|
174
174
|
"@react-spring/web": "^9.7.5",
|