@docsvision/material-ui-pickers 3.2.0-beta.22 → 3.2.0-beta.24
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/.size-snapshot.json +26 -0
- package/{DatePicker → build/DatePicker}/DatePicker.d.ts +1 -1
- package/{DatePicker → build/DatePicker}/DatePicker.js +1 -1
- package/{DatePicker → build/DatePicker}/DatePickerToolbar.d.ts +0 -0
- package/{DatePicker → build/DatePicker}/DatePickerToolbar.js +0 -0
- package/{DatePicker → build/DatePicker}/index.d.ts +0 -0
- package/{DatePicker → build/DatePicker}/index.js +0 -0
- package/{DateTimePicker → build/DateTimePicker}/DateTimePicker.d.ts +0 -0
- package/{DateTimePicker → build/DateTimePicker}/DateTimePicker.js +1 -1
- package/{DateTimePicker → build/DateTimePicker}/DateTimePickerTabs.d.ts +0 -0
- package/{DateTimePicker → build/DateTimePicker}/DateTimePickerTabs.js +0 -0
- package/{DateTimePicker → build/DateTimePicker}/DateTimePickerToolbar.d.ts +0 -0
- package/{DateTimePicker → build/DateTimePicker}/DateTimePickerToolbar.js +0 -0
- package/{DateTimePicker → build/DateTimePicker}/index.d.ts +0 -0
- package/{DateTimePicker → build/DateTimePicker}/index.js +0 -0
- package/{MuiPickersUtilsProvider.d.ts → build/MuiPickersUtilsProvider.d.ts} +0 -0
- package/{MuiPickersUtilsProvider.js → build/MuiPickersUtilsProvider.js} +0 -0
- package/{Picker → build/Picker}/Picker.d.ts +0 -0
- package/{Picker → build/Picker}/Picker.js +1 -1
- package/{Picker → build/Picker}/WrappedKeyboardPicker.d.ts +0 -0
- package/{Picker → build/Picker}/WrappedKeyboardPicker.js +0 -0
- package/{Picker → build/Picker}/WrappedPurePicker.d.ts +0 -0
- package/{Picker → build/Picker}/WrappedPurePicker.js +0 -0
- package/{README.md → build/README.md} +1 -1
- package/{Rifm → build/Rifm}/Rifm.d.ts +0 -0
- package/{Rifm → build/Rifm}/Rifm.js +0 -0
- package/{TimePicker → build/TimePicker}/TimePicker.d.ts +0 -0
- package/{TimePicker → build/TimePicker}/TimePicker.js +1 -1
- package/{TimePicker → build/TimePicker}/TimePickerToolbar.d.ts +0 -0
- package/{TimePicker → build/TimePicker}/TimePickerToolbar.js +0 -0
- package/{TimePicker → build/TimePicker}/index.d.ts +0 -0
- package/{TimePicker → build/TimePicker}/index.js +0 -0
- package/{_helpers → build/_helpers}/date-utils.d.ts +0 -0
- package/{_helpers → build/_helpers}/date-utils.js +0 -0
- package/{_helpers → build/_helpers}/text-field-helper.d.ts +1 -1
- package/{_helpers → build/_helpers}/text-field-helper.js +0 -0
- package/{_helpers → build/_helpers}/time-utils.d.ts +0 -0
- package/{_helpers → build/_helpers}/time-utils.js +0 -0
- package/{_helpers → build/_helpers}/utils.d.ts +0 -0
- package/{_helpers → build/_helpers}/utils.js +0 -0
- package/{_shared → build/_shared}/KeyboardDateInput.d.ts +0 -0
- package/{_shared → build/_shared}/KeyboardDateInput.js +9 -5
- package/{_shared → build/_shared}/ModalDialog.d.ts +2 -2
- package/{_shared → build/_shared}/ModalDialog.js +0 -0
- package/{_shared → build/_shared}/PickerToolbar.d.ts +0 -0
- package/{_shared → build/_shared}/PickerToolbar.js +0 -0
- package/{_shared → build/_shared}/PureDateInput.d.ts +0 -0
- package/{_shared → build/_shared}/PureDateInput.js +1 -1
- package/{_shared → build/_shared}/ToolbarButton.d.ts +2 -2
- package/{_shared → build/_shared}/ToolbarButton.js +0 -0
- package/{_shared → build/_shared}/ToolbarText.d.ts +0 -0
- package/{_shared → build/_shared}/ToolbarText.js +0 -0
- package/{_shared → build/_shared}/WithUtils.d.ts +0 -0
- package/{_shared → build/_shared}/WithUtils.js +0 -0
- package/{_shared → build/_shared}/hooks/useIsLandscape.d.ts +0 -0
- package/{_shared → build/_shared}/hooks/useIsLandscape.js +0 -0
- package/{_shared → build/_shared}/hooks/useKeyDown.d.ts +0 -0
- package/{_shared → build/_shared}/hooks/useKeyDown.js +0 -0
- package/{_shared → build/_shared}/hooks/useKeyboardPickerState.d.ts +0 -0
- package/{_shared → build/_shared}/hooks/useKeyboardPickerState.js +2 -2
- package/{_shared → build/_shared}/hooks/useOpenState.d.ts +0 -0
- package/{_shared → build/_shared}/hooks/useOpenState.js +0 -0
- package/{_shared → build/_shared}/hooks/usePickerState.d.ts +0 -0
- package/{_shared → build/_shared}/hooks/usePickerState.js +0 -0
- package/{_shared → build/_shared}/hooks/useUtils.d.ts +0 -0
- package/{_shared → build/_shared}/hooks/useUtils.js +0 -0
- package/{_shared → build/_shared}/hooks/useViews.d.ts +0 -0
- package/{_shared → build/_shared}/hooks/useViews.js +0 -0
- package/{_shared → build/_shared}/icons/ArrowLeftIcon.d.ts +0 -0
- package/{_shared → build/_shared}/icons/ArrowLeftIcon.js +0 -0
- package/{_shared → build/_shared}/icons/ArrowRightIcon.d.ts +0 -0
- package/{_shared → build/_shared}/icons/ArrowRightIcon.js +0 -0
- package/{_shared → build/_shared}/icons/DateRangeIcon.d.ts +0 -0
- package/{_shared → build/_shared}/icons/DateRangeIcon.js +0 -0
- package/{_shared → build/_shared}/icons/KeyboardIcon.d.ts +0 -0
- package/{_shared → build/_shared}/icons/KeyboardIcon.js +0 -0
- package/{_shared → build/_shared}/icons/TimeIcon.d.ts +0 -0
- package/{_shared → build/_shared}/icons/TimeIcon.js +0 -0
- package/{constants → build/constants}/ClockType.d.ts +0 -0
- package/{constants → build/constants}/ClockType.js +0 -0
- package/{constants → build/constants}/dimensions.d.ts +0 -0
- package/{constants → build/constants}/dimensions.js +0 -0
- package/{constants → build/constants}/prop-types.d.ts +0 -0
- package/{constants → build/constants}/prop-types.js +1 -1
- package/{dist → build/dist}/material-ui-pickers.esm.js +22 -13
- package/build/dist/material-ui-pickers.esm.js.map +1 -0
- package/{dist → build/dist}/material-ui-pickers.js +71 -62
- package/build/dist/material-ui-pickers.js.map +1 -0
- package/{dist → build/dist}/material-ui-pickers.umd.js +4531 -5801
- package/build/dist/material-ui-pickers.umd.min.js +1 -0
- package/{index.d.ts → build/index.d.ts} +0 -0
- package/{index.js → build/index.js} +0 -0
- package/build/package.json +62 -0
- package/{typings → build/typings}/BasePicker.d.ts +0 -0
- package/{typings → build/typings}/BasePicker.js +0 -0
- package/{typings → build/typings}/date.d.ts +0 -0
- package/{typings → build/typings}/date.js +0 -0
- package/{typings → build/typings}/extendMui.d.ts +0 -0
- package/{typings → build/typings}/extendMui.js +0 -0
- package/{typings → build/typings}/overrides.d.ts +0 -0
- package/{typings → build/typings}/overrides.js +0 -0
- package/{views → build/views}/Calendar/Calendar.d.ts +0 -0
- package/{views → build/views}/Calendar/Calendar.js +2 -1
- package/{views → build/views}/Calendar/CalendarHeader.d.ts +0 -0
- package/{views → build/views}/Calendar/CalendarHeader.js +0 -0
- package/{views → build/views}/Calendar/Day.d.ts +0 -0
- package/{views → build/views}/Calendar/Day.js +0 -0
- package/{views → build/views}/Calendar/DayWrapper.d.ts +0 -0
- package/{views → build/views}/Calendar/DayWrapper.js +0 -0
- package/{views → build/views}/Calendar/SlideTransition.d.ts +0 -0
- package/{views → build/views}/Calendar/SlideTransition.js +0 -0
- package/{views → build/views}/Clock/Clock.d.ts +1 -1
- package/{views → build/views}/Clock/Clock.js +0 -0
- package/{views → build/views}/Clock/ClockNumber.d.ts +0 -0
- package/{views → build/views}/Clock/ClockNumber.js +0 -0
- package/{views → build/views}/Clock/ClockNumbers.d.ts +0 -0
- package/{views → build/views}/Clock/ClockNumbers.js +0 -0
- package/{views → build/views}/Clock/ClockPointer.d.ts +1 -1
- package/{views → build/views}/Clock/ClockPointer.js +0 -0
- package/{views → build/views}/Clock/ClockView.d.ts +0 -0
- package/{views → build/views}/Clock/ClockView.js +0 -0
- package/{views → build/views}/Month/Month.d.ts +0 -0
- package/{views → build/views}/Month/Month.js +0 -0
- package/{views → build/views}/Month/MonthView.d.ts +0 -0
- package/{views → build/views}/Month/MonthView.js +0 -0
- package/{views → build/views}/Year/Year.d.ts +0 -0
- package/{views → build/views}/Year/Year.js +0 -0
- package/{views → build/views}/Year/YearView.d.ts +0 -0
- package/{views → build/views}/Year/YearView.js +0 -0
- package/{wrappers → build/wrappers}/InlineWrapper.d.ts +0 -0
- package/{wrappers → build/wrappers}/InlineWrapper.js +0 -0
- package/{wrappers → build/wrappers}/ModalWrapper.d.ts +0 -0
- package/{wrappers → build/wrappers}/ModalWrapper.js +0 -0
- package/{wrappers → build/wrappers}/StaticWrapper.d.ts +0 -0
- package/{wrappers → build/wrappers}/StaticWrapper.js +0 -0
- package/{wrappers → build/wrappers}/Wrapper.d.ts +0 -0
- package/{wrappers → build/wrappers}/Wrapper.js +0 -0
- package/copy.js +58 -0
- package/coverage/clover.xml +601 -0
- package/coverage/coverage-final.json +22 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +79 -0
- package/coverage/lcov-report/index.html +201 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +170 -0
- package/coverage/lcov-report/src/MuiPickersUtilsProvider.tsx.html +186 -0
- package/coverage/lcov-report/src/_helpers/date-utils.ts.html +345 -0
- package/coverage/lcov-report/src/_helpers/index.html +123 -0
- package/coverage/lcov-report/src/_helpers/time-utils.ts.html +318 -0
- package/coverage/lcov-report/src/_helpers/utils.ts.html +93 -0
- package/coverage/lcov-report/src/_shared/ModalDialog.tsx.html +411 -0
- package/coverage/lcov-report/src/_shared/WithUtils.tsx.html +126 -0
- package/coverage/lcov-report/src/_shared/hooks/index.html +110 -0
- package/coverage/lcov-report/src/_shared/hooks/useKeyDown.ts.html +171 -0
- package/coverage/lcov-report/src/_shared/hooks/useUtils.ts.html +129 -0
- package/coverage/lcov-report/src/_shared/icons/ArrowLeftIcon.tsx.html +102 -0
- package/coverage/lcov-report/src/_shared/icons/ArrowRightIcon.tsx.html +102 -0
- package/coverage/lcov-report/src/_shared/icons/index.html +110 -0
- package/coverage/lcov-report/src/_shared/index.html +110 -0
- package/coverage/lcov-report/src/constants/ClockType.ts.html +102 -0
- package/coverage/lcov-report/src/constants/dimensions.ts.html +84 -0
- package/coverage/lcov-report/src/constants/index.html +110 -0
- package/coverage/lcov-report/src/index.html +97 -0
- package/coverage/lcov-report/src/views/Calendar/Calendar.tsx.html +1152 -0
- package/coverage/lcov-report/src/views/Calendar/CalendarHeader.tsx.html +492 -0
- package/coverage/lcov-report/src/views/Calendar/Day.tsx.html +360 -0
- package/coverage/lcov-report/src/views/Calendar/DayWrapper.tsx.html +168 -0
- package/coverage/lcov-report/src/views/Calendar/SlideTransition.tsx.html +369 -0
- package/coverage/lcov-report/src/views/Calendar/index.html +149 -0
- package/coverage/lcov-report/src/views/Clock/Clock.tsx.html +585 -0
- package/coverage/lcov-report/src/views/Clock/ClockPointer.tsx.html +381 -0
- package/coverage/lcov-report/src/views/Clock/index.html +110 -0
- package/coverage/lcov-report/src/views/Month/Month.tsx.html +297 -0
- package/coverage/lcov-report/src/views/Month/MonthView.tsx.html +351 -0
- package/coverage/lcov-report/src/views/Month/index.html +110 -0
- package/coverage/lcov.info +1094 -0
- package/package.json +135 -62
- package/remove-prop-types.js +37 -0
- package/rollup.config.js +145 -0
- package/tsconfig.json +21 -0
- package/typings.d.ts +6 -0
- package/dist/material-ui-pickers.esm.js.map +0 -1
- package/dist/material-ui-pickers.js.map +0 -1
- package/dist/material-ui-pickers.umd.min.js +0 -1
package/package.json
CHANGED
|
@@ -1,62 +1,135 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@docsvision/material-ui-pickers",
|
|
3
|
-
"version": "3.2.0-beta.
|
|
4
|
-
"description": "Fork @material-ui/pickers that implements advanced features required for DocsVision WebClient. Original repository https://github.com/mui-org/material-ui-pickers",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"test
|
|
47
|
-
"test:
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"build:
|
|
53
|
-
"build": "
|
|
54
|
-
"build:
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@docsvision/material-ui-pickers",
|
|
3
|
+
"version": "3.2.0-beta.24",
|
|
4
|
+
"description": "Fork @material-ui/pickers that implements advanced features required for DocsVision WebClient. Original repository https://github.com/mui-org/material-ui-pickers",
|
|
5
|
+
"main": "./src/index.ts",
|
|
6
|
+
"module": "./src/index.ts",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"material-ui",
|
|
9
|
+
"pickers",
|
|
10
|
+
"@material-ui/pickers",
|
|
11
|
+
"datepicker",
|
|
12
|
+
"timepicker",
|
|
13
|
+
"date-picker",
|
|
14
|
+
"time-picker",
|
|
15
|
+
"react",
|
|
16
|
+
"react-component",
|
|
17
|
+
"material design",
|
|
18
|
+
"Docsvision",
|
|
19
|
+
"WebClient"
|
|
20
|
+
],
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"author": {
|
|
24
|
+
"name": "Docsvision"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@date-io/core": "^1.3.6",
|
|
28
|
+
"@material-ui/core": "^4.0.0",
|
|
29
|
+
"prop-types": "^15.6.0",
|
|
30
|
+
"react": "^16.8.6",
|
|
31
|
+
"react-dom": "^16.8.6"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@types/styled-jsx": "^2.2.8",
|
|
35
|
+
"clsx": "^1.0.2",
|
|
36
|
+
"react-transition-group": "^4.0.0",
|
|
37
|
+
"tslib": "^1.9.3"
|
|
38
|
+
},
|
|
39
|
+
"size-limit": [
|
|
40
|
+
{
|
|
41
|
+
"path": "build/dist/@material-ui/pickers.esm.js",
|
|
42
|
+
"limit": "30 KB"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"scripts": {
|
|
46
|
+
"test": "jest",
|
|
47
|
+
"test:date-fns": "UTILS=date-fns npm run test",
|
|
48
|
+
"test:luxon": "UTILS=luxon npm run test",
|
|
49
|
+
"test:moment": "UTILS=moment npm run test",
|
|
50
|
+
"start": "rollup --config rollup.config.dev.js --watch & npx tsc --watch",
|
|
51
|
+
"prebuild": "rimraf build",
|
|
52
|
+
"build:copy": "node copy.js",
|
|
53
|
+
"build:bundle": "rollup --config",
|
|
54
|
+
"build:typescript": "tsc --project tsconfig.json",
|
|
55
|
+
"build": "npm run build:typescript && npm run build:bundle && npm run build:copy",
|
|
56
|
+
"build:analyze": "npm run build",
|
|
57
|
+
"release": "yarn test && yarn version && yarn build && yarn publish --non-interactive build",
|
|
58
|
+
"publish": "npm publish build"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@babel/core": "^7.2.2",
|
|
62
|
+
"@date-io/core": "^1.2.0",
|
|
63
|
+
"@date-io/date-fns": "^1.3.0",
|
|
64
|
+
"@date-io/luxon": "^1.3.0",
|
|
65
|
+
"@date-io/moment": "^1.3.0",
|
|
66
|
+
"@material-ui/core": "^4.0.0",
|
|
67
|
+
"@material-ui/icons": "^3.0.2",
|
|
68
|
+
"@material-ui/styles": "^4.0.0",
|
|
69
|
+
"@types/enzyme": "^3.1.17",
|
|
70
|
+
"@types/enzyme-adapter-react-16": "^1.0.3",
|
|
71
|
+
"@types/fs-extra": "^5.0.4",
|
|
72
|
+
"@types/glob": "^7.1.1",
|
|
73
|
+
"@types/jest": "^23.3.14",
|
|
74
|
+
"@types/jss": "^9.5.7",
|
|
75
|
+
"@types/luxon": "^1.11.0",
|
|
76
|
+
"@types/prettier": "^1.16.0",
|
|
77
|
+
"@types/prop-types": "^15.5.8",
|
|
78
|
+
"@types/react": "^16.8.2",
|
|
79
|
+
"@types/react-dom": "^16.8.0",
|
|
80
|
+
"@types/react-transition-group": "^2.0.15",
|
|
81
|
+
"codecov": "^3.1.0",
|
|
82
|
+
"cross-env": "^5.2.0",
|
|
83
|
+
"date-fns": "^2.0.0-alpha.27",
|
|
84
|
+
"enzyme": "^3.8.0",
|
|
85
|
+
"enzyme-adapter-react-16": "^1.9.1",
|
|
86
|
+
"fs-extra": "^7.0.1",
|
|
87
|
+
"full-icu": "^1.2.1",
|
|
88
|
+
"glob": "^7.1.3",
|
|
89
|
+
"jest": "^24.1.0",
|
|
90
|
+
"luxon": "^1.11.1",
|
|
91
|
+
"moment": "2.22.2",
|
|
92
|
+
"prop-types": "^15.6.2",
|
|
93
|
+
"react": "^16.8.6",
|
|
94
|
+
"react-dom": "^16.8.6",
|
|
95
|
+
"rollup": "^1.1.2",
|
|
96
|
+
"rollup-plugin-babel": "^4.3.2",
|
|
97
|
+
"rollup-plugin-commonjs": "^9.2.0",
|
|
98
|
+
"rollup-plugin-node-resolve": "^4.0.1",
|
|
99
|
+
"rollup-plugin-size-snapshot": "^0.8.0",
|
|
100
|
+
"rollup-plugin-terser": "^4.0.4",
|
|
101
|
+
"rollup-plugin-typescript": "^1.0.0",
|
|
102
|
+
"size-limit": "^0.21.1",
|
|
103
|
+
"ts-jest": "^24.0.1",
|
|
104
|
+
"ts-lib": "0.0.5",
|
|
105
|
+
"tslint-config-prettier": "^1.18.0",
|
|
106
|
+
"typescript": "^3.3.3"
|
|
107
|
+
},
|
|
108
|
+
"jest": {
|
|
109
|
+
"setupFilesAfterEnv": [
|
|
110
|
+
"<rootDir>/src/__tests__/setup.js"
|
|
111
|
+
],
|
|
112
|
+
"testRegex": "./src/__tests__/.*\\.test\\.(js|tsx)$",
|
|
113
|
+
"testURL": "http://localhost/",
|
|
114
|
+
"collectCoverage": true,
|
|
115
|
+
"transform": {
|
|
116
|
+
"^.+\\.tsx?$": "ts-jest"
|
|
117
|
+
},
|
|
118
|
+
"moduleFileExtensions": [
|
|
119
|
+
"ts",
|
|
120
|
+
"tsx",
|
|
121
|
+
"js",
|
|
122
|
+
"jsx",
|
|
123
|
+
"json",
|
|
124
|
+
"node"
|
|
125
|
+
],
|
|
126
|
+
"coveragePathIgnorePatterns": [
|
|
127
|
+
"<rootDir>/src/__tests__/"
|
|
128
|
+
],
|
|
129
|
+
"globals": {
|
|
130
|
+
"ts-jest": {
|
|
131
|
+
"tsConfig": "./src/__tests__/tsconfig.json"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const removePropTypes = api => {
|
|
2
|
+
const { types, template } = api;
|
|
3
|
+
const visitedKey = `remove-prop-types-${Date.now()}`;
|
|
4
|
+
return {
|
|
5
|
+
visitor: {
|
|
6
|
+
AssignmentExpression(path) {
|
|
7
|
+
if (
|
|
8
|
+
types.isMemberExpression(path.node.left) &&
|
|
9
|
+
types.isIdentifier(path.node.left.property) &&
|
|
10
|
+
path.node.left.property.name === 'propTypes'
|
|
11
|
+
) {
|
|
12
|
+
// Prevent infinity loop.
|
|
13
|
+
if (path.node[visitedKey]) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
path.node[visitedKey] = true;
|
|
17
|
+
|
|
18
|
+
const unsafeWrapTemplate = template(
|
|
19
|
+
`
|
|
20
|
+
if (process.env.NODE_ENV !== "production") {
|
|
21
|
+
NODE;
|
|
22
|
+
}
|
|
23
|
+
`,
|
|
24
|
+
{ placeholderPattern: /^NODE$/ }
|
|
25
|
+
);
|
|
26
|
+
path.replaceWith(
|
|
27
|
+
unsafeWrapTemplate({
|
|
28
|
+
NODE: path.node,
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
module.exports = removePropTypes;
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
import path from 'path';
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import pkg from './package.json';
|
|
5
|
+
import typescript from 'typescript';
|
|
6
|
+
import babel from 'rollup-plugin-babel';
|
|
7
|
+
import replace from 'rollup-plugin-replace';
|
|
8
|
+
import commonjs from 'rollup-plugin-commonjs';
|
|
9
|
+
import nodeResolve from 'rollup-plugin-node-resolve';
|
|
10
|
+
import typescriptPlugin from 'rollup-plugin-typescript';
|
|
11
|
+
import { terser } from 'rollup-plugin-terser';
|
|
12
|
+
import { sizeSnapshot } from 'rollup-plugin-size-snapshot';
|
|
13
|
+
|
|
14
|
+
const tsconfig = path.join(__dirname, 'tsconfig.json');
|
|
15
|
+
console.info(`Using tsconfig: ${tsconfig}`);
|
|
16
|
+
|
|
17
|
+
const currentSourceFolder = path.join(__dirname, 'src\\');
|
|
18
|
+
|
|
19
|
+
// treat as externals not relative and not absolute paths
|
|
20
|
+
const external = id => {
|
|
21
|
+
// console.log(id);
|
|
22
|
+
return !id.startsWith('.') && !id.startsWith('/') && !id.includes(currentSourceFolder);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const input = './src/index.ts';
|
|
26
|
+
const globals = {
|
|
27
|
+
react: 'React',
|
|
28
|
+
'react-dom': 'ReactDOM',
|
|
29
|
+
'prop-types': 'PropTypes',
|
|
30
|
+
'@material-ui/core/Icon': 'material-ui.Icon',
|
|
31
|
+
'@material-ui/core/Button/': 'material-ui/Button.',
|
|
32
|
+
'@material-ui/core/IconButton': 'material-ui.IconButton',
|
|
33
|
+
'@material-ui/core/InputAdornment': 'material-ui.InputAdornment',
|
|
34
|
+
'@material-ui/core/TextField': 'material-ui.TextField',
|
|
35
|
+
'@material-ui/core/Button': 'material-ui.Button',
|
|
36
|
+
'@material-ui/core/Dialog': 'material-ui.Dialog',
|
|
37
|
+
'@material-ui/core/DialogActions': 'material-ui.DialogActions',
|
|
38
|
+
'@material-ui/core/DialogContent': 'material-ui.DialogContent',
|
|
39
|
+
'@material-ui/styles/withStyles': 'material-ui.withStyles',
|
|
40
|
+
'@material-ui/styles/createStyles': 'material-ui.createStyles',
|
|
41
|
+
'@material-ui/core/Toolbar': 'material-ui.Toolbar',
|
|
42
|
+
'@material-ui/core/Typography': 'material-ui.Typography',
|
|
43
|
+
'@material-ui/core/Popover': 'material-ui.Popover',
|
|
44
|
+
'@material-ui/core/Paper': 'material-ui.Paper',
|
|
45
|
+
'@material-ui/styles/withTheme': 'material-ui.withTheme',
|
|
46
|
+
'@material-ui/core/Tab': 'material-ui.Tab',
|
|
47
|
+
'@material-ui/core/Tabs': 'material-ui.Tabs',
|
|
48
|
+
'@material-ui/styles': 'material-ui.styles',
|
|
49
|
+
'@material-ui/core/SvgIcon': 'material-ui.SvgIcon',
|
|
50
|
+
'@material-ui/core/styles/colorManipulator': 'material-ui.styles.colorManipulator',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const extensions = ['.ts', '.tsx'];
|
|
54
|
+
|
|
55
|
+
const babelOptions = {
|
|
56
|
+
babelrc: false,
|
|
57
|
+
extensions,
|
|
58
|
+
plugins: ['./remove-prop-types.js'],
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const commonjsOptions = {
|
|
62
|
+
include: /node_modules/,
|
|
63
|
+
namedExports: {
|
|
64
|
+
'react-is': ['ForwardRef'],
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default [
|
|
69
|
+
{
|
|
70
|
+
input,
|
|
71
|
+
external,
|
|
72
|
+
output: {
|
|
73
|
+
file: 'build/dist/material-ui-pickers.js',
|
|
74
|
+
format: 'cjs',
|
|
75
|
+
sourcemap: true,
|
|
76
|
+
},
|
|
77
|
+
plugins: [
|
|
78
|
+
nodeResolve({ extensions }),
|
|
79
|
+
typescriptPlugin({ typescript, tsconfig }),
|
|
80
|
+
babel(babelOptions),
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
{
|
|
85
|
+
input,
|
|
86
|
+
external,
|
|
87
|
+
output: {
|
|
88
|
+
file: 'build/dist/material-ui-pickers.esm.js',
|
|
89
|
+
format: 'esm',
|
|
90
|
+
sourcemap: true,
|
|
91
|
+
},
|
|
92
|
+
plugins: [
|
|
93
|
+
nodeResolve({ extensions }),
|
|
94
|
+
typescriptPlugin({ typescript, tsconfig }),
|
|
95
|
+
babel(babelOptions),
|
|
96
|
+
replace({
|
|
97
|
+
delimiters: ['', ''],
|
|
98
|
+
values: { '/** @class */': '/*@__PURE__*/' },
|
|
99
|
+
}),
|
|
100
|
+
sizeSnapshot(),
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
{
|
|
105
|
+
input,
|
|
106
|
+
external: Object.keys(globals),
|
|
107
|
+
output: {
|
|
108
|
+
globals,
|
|
109
|
+
format: 'umd',
|
|
110
|
+
name: pkg.name,
|
|
111
|
+
file: 'build/dist/material-ui-pickers.umd.js',
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
plugins: [
|
|
115
|
+
nodeResolve({ extensions }),
|
|
116
|
+
typescriptPlugin({ typescript, tsconfig }),
|
|
117
|
+
babel(babelOptions),
|
|
118
|
+
commonjs(commonjsOptions),
|
|
119
|
+
replace({ 'process.env.NODE_ENV': JSON.stringify('development') }),
|
|
120
|
+
sizeSnapshot(),
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
{
|
|
125
|
+
input,
|
|
126
|
+
external: Object.keys(globals),
|
|
127
|
+
output: {
|
|
128
|
+
globals,
|
|
129
|
+
format: 'umd',
|
|
130
|
+
name: pkg.name,
|
|
131
|
+
file: 'build/dist/material-ui-pickers.umd.min.js',
|
|
132
|
+
},
|
|
133
|
+
plugins: [
|
|
134
|
+
nodeResolve({ extensions }),
|
|
135
|
+
typescriptPlugin({ typescript, tsconfig }),
|
|
136
|
+
babel(babelOptions),
|
|
137
|
+
commonjs(commonjsOptions),
|
|
138
|
+
replace({ 'process.env.NODE_ENV': JSON.stringify('production') }),
|
|
139
|
+
sizeSnapshot(),
|
|
140
|
+
terser({
|
|
141
|
+
mangle: false,
|
|
142
|
+
}),
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
];
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"outDir": "build",
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"target": "es5",
|
|
7
|
+
"lib": ["dom", "es2016"],
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"jsx": "react",
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"noImplicitAny": true,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"allowSyntheticDefaultImports": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"esModuleInterop": true,
|
|
16
|
+
"suppressImplicitAnyIndexErrors": true,
|
|
17
|
+
"resolveJsonModule": true
|
|
18
|
+
},
|
|
19
|
+
"include": ["src/**/*.ts*", "typings.d.ts"],
|
|
20
|
+
"exclude": ["./src/__tests__/**/*", "build"]
|
|
21
|
+
}
|