forstok-ui-lib 5.4.9 → 5.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forstok-ui-lib",
3
- "version": "5.4.9",
3
+ "version": "5.6.0",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
@@ -44,7 +44,6 @@
44
44
  "moment": "^2.30.1",
45
45
  "moment-range": "^4.0.2",
46
46
  "npm-force-resolutions": "^0.0.10",
47
- "rc-calendar": "^9.15.11",
48
47
  "react": "^19.0.0",
49
48
  "react-content-loader": "^7.0.2",
50
49
  "react-datepicker": "^8.0.0",
package/rollup.config.js CHANGED
@@ -65,7 +65,7 @@ export default [
65
65
  exclude: 'node_modules/**'
66
66
  })
67
67
  ],
68
- external: ['react', 'react-dom', 'styled-components', 'rc-calendar/src/RangeCalendar', 'rc-calendar/src/Picker'],
68
+ external: ['react', 'react-dom', 'styled-components'],
69
69
  },
70
70
  {
71
71
  input: 'src/index.ts',
@@ -26,7 +26,6 @@ export { default as RadioComponent } from './radio';
26
26
  export { default as SwitchComponent } from './switch';
27
27
  export { default as MasterTableComponent } from './masterTable';
28
28
  export { default as ListComponent } from './list';
29
- export { default as AntCalendarComponent } from './cascader/calendar';
30
29
 
31
30
  export * from './dropdown/typed';
32
31
  export * from './message/typed';
@@ -1,57 +0,0 @@
1
- import moment, { Moment } from 'moment';
2
- import Picker from 'rc-calendar/src/Picker';
3
- import RangeCalendar from 'rc-calendar/src/RangeCalendar';
4
- import './rc-calendar.css';
5
- import { useState } from 'react';
6
-
7
- const AntCalendarComponent = () => {
8
- const now = moment();
9
- const [value, setValue] = useState<any>();
10
-
11
- const onChange = (value: any) => {
12
- setValue(value);
13
- }
14
-
15
- const formatStr = 'YYYY-MM-DD HH:mm:ss';
16
- const format = (v: any) => {
17
- return v ? v.format(formatStr) : '';
18
- }
19
-
20
- const isValidRange = (v: any) => {
21
- return v && v[0] && v[1];
22
- }
23
-
24
- const calendar = (
25
- <RangeCalendar
26
- showWeekNumber={false}
27
- dateInputPlaceholder={['start', 'end']}
28
- defaultValue={[now, now.clone().add(1, 'months')]}
29
- disabledTime={true}
30
- />
31
- );
32
-
33
- return (
34
- <Picker
35
- value={value}
36
- onChange={onChange}
37
- animation="slide-up"
38
- calendar={calendar}
39
- >
40
- {
41
- ({ value }: { value: any }) => {
42
- return (<span>
43
- <input
44
- placeholder="please select"
45
- style={{ width: 350 }}
46
- readOnly
47
- className="ant-calendar-picker-input ant-input"
48
- value={isValidRange(value) && `${format(value[0])} - ${format(value[1])}` || ''}
49
- />
50
- </span>);
51
- }
52
- }
53
- </Picker>
54
- )
55
- }
56
-
57
- export default AntCalendarComponent;