@pisell/date-picker 1.0.75-7 → 1.0.75-8

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.
Files changed (150) hide show
  1. package/es/ActionBar/index.d.ts +2 -1
  2. package/es/ActionBar/index.js +11 -13
  3. package/es/DateRangeCalendar/DateRangeCalendar.js +11 -12
  4. package/es/DateRangeCalendar/useDragRange.js +6 -6
  5. package/es/DateRangePicker/DateRangePickerToolbar.d.ts +2 -1
  6. package/es/DateRangePicker/DateRangePickerToolbar.js +1 -1
  7. package/es/DateRangePicker/shared.js +5 -5
  8. package/es/DateRangePickerDay/DateRangePickerDay.js +8 -9
  9. package/es/DesktopDateRangePicker/DesktopDateRangePicker.js +5 -5
  10. package/es/MobileDateRangePicker/MobileDateRangePicker.js +5 -5
  11. package/es/MultiInputDateRangeField/MultiInputDateRangeField.js +5 -5
  12. package/es/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +5 -5
  13. package/es/MultiInputTimeRangeField/MultiInputTimeRangeField.js +5 -5
  14. package/es/PisellDateRangePicker/CloseCircle.d.ts +2 -1
  15. package/es/PisellDateRangePicker/LocaleContext.d.ts +7 -2
  16. package/es/PisellDateRangePicker/index.d.ts +1 -1
  17. package/es/PisellDateRangePicker/index.js +22 -45
  18. package/es/PisellDateRangePicker/useCssVariables.js +1 -1
  19. package/es/Shortcuts/index.d.ts +2 -1
  20. package/es/Shortcuts/index.js +1 -1
  21. package/es/SingleInputDateRangeField/SingleInputDateRangeField.js +5 -5
  22. package/es/SingleInputDateRangeField/useSingleInputDateRangeField.js +5 -5
  23. package/es/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +5 -5
  24. package/es/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +5 -5
  25. package/es/SingleInputTimeRangeField/SingleInputTimeRangeField.js +5 -5
  26. package/es/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +5 -5
  27. package/es/StaticDateRangePicker/StaticDateRangePicker.js +5 -5
  28. package/es/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +2 -1
  29. package/es/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +2 -1
  30. package/es/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +5 -5
  31. package/es/internals/hooks/useEnrichedRangePickerFieldProps.js +9 -9
  32. package/es/internals/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +2 -1
  33. package/es/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +6 -6
  34. package/es/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +5 -5
  35. package/es/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +5 -5
  36. package/es/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +5 -5
  37. package/es/internals/hooks/useRangePosition.js +2 -2
  38. package/es/internals/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +2 -1
  39. package/es/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +7 -7
  40. package/es/internals/utils/date-fields-utils.d.ts +1 -1
  41. package/es/internals/utils/date-fields-utils.js +5 -5
  42. package/es/internals/utils/date-range-manager.js +1 -1
  43. package/es/internals/utils/validation/validateDateRange.js +6 -6
  44. package/es/internals/utils/validation/validateDateTimeRange.js +6 -6
  45. package/es/internals/utils/validation/validateTimeRange.js +1 -1
  46. package/es/internals/utils/valueManagers.js +6 -6
  47. package/es/locales/index.js +11 -3
  48. package/es/locales/ja.d.ts +26 -0
  49. package/es/locales/ja.js +25 -0
  50. package/es/locales/pt.d.ts +26 -0
  51. package/es/locales/pt.js +25 -0
  52. package/es/utils/index.d.ts +1 -1
  53. package/lib/ActionBar/index.d.ts +2 -1
  54. package/lib/ActionBar/index.js +2 -4
  55. package/lib/DateRangePicker/DateRangePickerToolbar.d.ts +2 -1
  56. package/lib/PisellDateRangePicker/CloseCircle.d.ts +2 -1
  57. package/lib/PisellDateRangePicker/LocaleContext.d.ts +7 -2
  58. package/lib/PisellDateRangePicker/index.d.ts +1 -1
  59. package/lib/PisellDateRangePicker/index.js +2 -26
  60. package/lib/PisellDateRangePicker/useCssVariables.js +1 -2
  61. package/lib/Shortcuts/index.d.ts +2 -1
  62. package/lib/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +2 -1
  63. package/lib/index.d.ts +1 -5
  64. package/lib/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +2 -1
  65. package/lib/internals/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +2 -1
  66. package/lib/internals/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +2 -1
  67. package/lib/internals/utils/date-fields-utils.d.ts +1 -1
  68. package/lib/locales/index.js +11 -3
  69. package/lib/locales/ja.d.ts +26 -0
  70. package/lib/locales/ja.js +49 -0
  71. package/lib/locales/pt.d.ts +26 -0
  72. package/lib/locales/pt.js +49 -0
  73. package/lib/utils/index.d.ts +1 -1
  74. package/package.json +1 -1
  75. package/es/CustomCalendarHeader/index.d.ts +0 -2
  76. package/es/CustomCalendarHeader/index.js +0 -53
  77. package/es/Dialog/index.d.ts +0 -2
  78. package/es/Dialog/index.js +0 -25
  79. package/es/Drawer/index.d.ts +0 -11
  80. package/es/Drawer/index.js +0 -35
  81. package/es/Drawer/index.less +0 -40
  82. package/es/OldActionBar/index.d.ts +0 -19
  83. package/es/OldActionBar/index.js +0 -113
  84. package/es/OldActionBar/index.less +0 -18
  85. package/es/OldPisellDateRangePicker/index.d.ts +0 -79
  86. package/es/OldPisellDateRangePicker/index.js +0 -264
  87. package/es/OldPisellDateRangePicker/index.less +0 -102
  88. package/es/Toolbar/index.d.ts +0 -3
  89. package/es/Toolbar/index.js +0 -166
  90. package/es/Toolbar/index.less +0 -35
  91. package/es/browserSelect/chevron-down.png +0 -0
  92. package/es/browserSelect/index.d.ts +0 -15
  93. package/es/browserSelect/index.js +0 -36
  94. package/es/browserSelect/index.less +0 -18
  95. package/es/constants.d.ts +0 -58
  96. package/es/constants.js +0 -128
  97. package/es/hooks/useDocumentVisibility.d.ts +0 -2
  98. package/es/hooks/useDocumentVisibility.js +0 -27
  99. package/es/hooks/useNextDay.d.ts +0 -2
  100. package/es/hooks/useNextDay.js +0 -15
  101. package/es/hooks/useUpdateEffect.d.ts +0 -2
  102. package/es/hooks/useUpdateEffect.js +0 -11
  103. package/es/icon/ChevronLeft.d.ts +0 -5
  104. package/es/icon/ChevronLeft.js +0 -23
  105. package/es/icon/ChevronLeftDouble.d.ts +0 -5
  106. package/es/icon/ChevronLeftDouble.js +0 -23
  107. package/es/icon/ChevronRight.d.ts +0 -5
  108. package/es/icon/ChevronRight.js +0 -23
  109. package/es/icon/ChevronRightDouble.d.ts +0 -5
  110. package/es/icon/ChevronRightDouble.js +0 -23
  111. package/es/icon/CloseCircle.d.ts +0 -5
  112. package/es/icon/CloseCircle.js +0 -26
  113. package/lib/CustomCalendarHeader/index.d.ts +0 -2
  114. package/lib/CustomCalendarHeader/index.js +0 -58
  115. package/lib/Dialog/index.d.ts +0 -2
  116. package/lib/Dialog/index.js +0 -65
  117. package/lib/Drawer/index.d.ts +0 -11
  118. package/lib/Drawer/index.js +0 -62
  119. package/lib/Drawer/index.less +0 -40
  120. package/lib/OldActionBar/index.d.ts +0 -19
  121. package/lib/OldActionBar/index.js +0 -129
  122. package/lib/OldActionBar/index.less +0 -18
  123. package/lib/OldPisellDateRangePicker/index.d.ts +0 -79
  124. package/lib/OldPisellDateRangePicker/index.js +0 -281
  125. package/lib/OldPisellDateRangePicker/index.less +0 -102
  126. package/lib/Toolbar/index.d.ts +0 -3
  127. package/lib/Toolbar/index.js +0 -193
  128. package/lib/Toolbar/index.less +0 -35
  129. package/lib/browserSelect/chevron-down.png +0 -0
  130. package/lib/browserSelect/index.d.ts +0 -15
  131. package/lib/browserSelect/index.js +0 -59
  132. package/lib/browserSelect/index.less +0 -18
  133. package/lib/constants.d.ts +0 -58
  134. package/lib/constants.js +0 -217
  135. package/lib/hooks/useDocumentVisibility.d.ts +0 -2
  136. package/lib/hooks/useDocumentVisibility.js +0 -40
  137. package/lib/hooks/useNextDay.d.ts +0 -2
  138. package/lib/hooks/useNextDay.js +0 -49
  139. package/lib/hooks/useUpdateEffect.d.ts +0 -2
  140. package/lib/hooks/useUpdateEffect.js +0 -35
  141. package/lib/icon/ChevronLeft.d.ts +0 -5
  142. package/lib/icon/ChevronLeft.js +0 -60
  143. package/lib/icon/ChevronLeftDouble.d.ts +0 -5
  144. package/lib/icon/ChevronLeftDouble.js +0 -60
  145. package/lib/icon/ChevronRight.d.ts +0 -5
  146. package/lib/icon/ChevronRight.js +0 -60
  147. package/lib/icon/ChevronRightDouble.d.ts +0 -5
  148. package/lib/icon/ChevronRightDouble.js +0 -60
  149. package/lib/icon/CloseCircle.d.ts +0 -5
  150. package/lib/icon/CloseCircle.js +0 -67
@@ -1,102 +0,0 @@
1
- .pisell-date-range-picker {
2
- display: inline-block;
3
- width: 100%;
4
- //width: 350px;
5
- //.MuiInputBase-input {
6
- // padding: 10px;
7
- //}
8
- label {
9
- font-size: 14px;
10
- }
11
- .pisell-date-range-picker-clear {
12
- color: rgba(0, 0, 0, 0.25);
13
- cursor: pointer;
14
- display: none;
15
- line-height: 0;
16
- :hover {
17
- color: rgba(0, 0, 0, 0.45);
18
- }
19
- }
20
- :hover {
21
- .pisell-date-range-picker-clear {
22
- display: block;
23
- }
24
- }
25
- }
26
- .pisell-date-range-picker-no-border {
27
- .MuiOutlinedInput-notchedOutline {
28
- border: none;
29
- }
30
- }
31
- .MuiOutlinedInput-notchedOutline {
32
- legend {
33
- color: inherit !important;
34
- width: auto !important;
35
- margin-bottom: 0.5em !important;
36
- font-size: 1.5em !important;
37
- line-height: 11px !important;
38
- border: none !important;
39
- }
40
- }
41
-
42
- .MuiPickersPopper-root {
43
- .MuiPickersLayout-root {
44
- width: var(--pisell-date-range-picker-popup-width, 625px);
45
- .MuiDateRangeCalendar-root {
46
- width: 100%;
47
- flex: 1;
48
- .MuiDateRangeCalendar-monthContainer {
49
- width: 50%;
50
- .MuiDayCalendar-header {
51
- padding: 0 20px;
52
- .MuiDayCalendar-weekDayLabel {
53
- flex: 1;
54
- width: 100%;
55
- }
56
- }
57
- .MuiPickersSlideTransition-root {
58
- min-width: 200px;
59
- //min-height: auto;
60
- &::before {
61
- content: "";
62
- display: block;
63
- padding-top: 67%;
64
- }
65
- }
66
- .MuiDayCalendar-monthContainer {
67
- padding: 0 20px;
68
- }
69
- .MuiDayCalendar-weekContainer {
70
- .MuiDateRangePickerDay-root {
71
- flex: 1;
72
- .MuiDateRangePickerDay-day {
73
- width: 100%;
74
- height: auto;
75
- &::before {
76
- content: "";
77
- display: block;
78
- padding-top: 100%;
79
- }
80
- }
81
- }
82
- }
83
- }
84
- }
85
- }
86
- }
87
-
88
- .MuiDialog-root {
89
- .MuiPickersLayout-toolbar {
90
- display: none;
91
- }
92
- }
93
-
94
- .MuiPickersLayout-shortcuts {
95
- grid-column: 1 !important;
96
- grid-row: 1/3 !important;
97
- }
98
- .pisell-date-range-picker-popper-old {
99
- .MuiPickersLayout-root {
100
- display: grid !important;
101
- }
102
- }
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const Toolbar: (props: any) => JSX.Element;
3
- export default Toolbar;
@@ -1,193 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/Toolbar/index.tsx
30
- var Toolbar_exports = {};
31
- __export(Toolbar_exports, {
32
- default: () => Toolbar_default
33
- });
34
- module.exports = __toCommonJS(Toolbar_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_antd = require("antd");
37
- var import_dayjs = __toESM(require("dayjs"));
38
- var import_browserSelect = __toESM(require("../browserSelect"));
39
- var import_locales = require("../locales");
40
- var import_index = require("./index.less");
41
- var isValidDate = (dateString, format) => {
42
- const date = (0, import_dayjs.default)(dateString, format, true);
43
- return date.isValid();
44
- };
45
- var Toolbar = (props) => {
46
- const {
47
- presetItems,
48
- value = [],
49
- locale,
50
- onChange,
51
- currentShortcut,
52
- setCurrentShortcut,
53
- disabledDate
54
- } = props;
55
- const format = locale === "en" || locale === "en-US" ? "DD/MM/YYYY" : "YYYY/MM/DD";
56
- const [startStr, setStartStr] = (0, import_react.useState)("");
57
- const [endStr, setEndStr] = (0, import_react.useState)("");
58
- const [startError, setStartError] = (0, import_react.useState)(false);
59
- const [endError, setEndError] = (0, import_react.useState)(false);
60
- const valueRef = (0, import_react.useRef)(value);
61
- valueRef.current = value;
62
- (0, import_react.useEffect)(() => {
63
- if (value == null ? void 0 : value[0]) {
64
- setStartStr(value[0].format(format));
65
- setStartError(false);
66
- } else {
67
- setStartStr("");
68
- }
69
- if (value == null ? void 0 : value[1]) {
70
- setEndStr(value[1].format(format));
71
- setEndError(false);
72
- } else {
73
- setEndStr("");
74
- }
75
- }, [value]);
76
- const checkDateDisabled = (position) => {
77
- const val = valueRef.current;
78
- if (position === "start" && val[0] && (disabledDate == null ? void 0 : disabledDate(val[1], position, val))) {
79
- setStartError(true);
80
- onChange([null, val[1]], "write");
81
- }
82
- if (position === "end" && val[1] && (disabledDate == null ? void 0 : disabledDate(val[1], position, val))) {
83
- setEndError(true);
84
- onChange([val[0], null], "write");
85
- }
86
- };
87
- const handleStartChange = (e) => {
88
- var _a, _b;
89
- const val = e.target.value;
90
- setStartStr(val);
91
- const objValue = (0, import_dayjs.default)(val, format);
92
- if (isValidDate(val, format) && (value[1] ? objValue <= value[1] : true) && !(disabledDate == null ? void 0 : disabledDate(objValue, "start", value))) {
93
- setStartError(false);
94
- const valDate = (0, import_dayjs.default)(val, format);
95
- const newValue = [...value];
96
- const start = newValue[0] || (0, import_dayjs.default)();
97
- newValue[0] = ((_b = (_a = start == null ? void 0 : start.set("year", (valDate == null ? void 0 : valDate.get("year")) || 0)) == null ? void 0 : _a.set("month", (valDate == null ? void 0 : valDate.get("month")) || 0)) == null ? void 0 : _b.set("date", (valDate == null ? void 0 : valDate.get("date")) || 0)) || null;
98
- onChange(newValue, "write");
99
- } else {
100
- setStartError(true);
101
- }
102
- setTimeout(() => {
103
- checkDateDisabled("end");
104
- }, 200);
105
- };
106
- const handleEndChange = (e) => {
107
- var _a, _b;
108
- const val = e.target.value;
109
- setEndStr(val);
110
- const objValue = (0, import_dayjs.default)(val, format);
111
- if (isValidDate(val, format) && (value[0] ? objValue >= value[0] : true) && !(disabledDate == null ? void 0 : disabledDate(objValue, "end", value))) {
112
- setEndError(false);
113
- const valDate = (0, import_dayjs.default)(val, format);
114
- const newValue = [...value];
115
- const end = newValue[1] || (0, import_dayjs.default)();
116
- newValue[1] = ((_b = (_a = end == null ? void 0 : end.set("year", (valDate == null ? void 0 : valDate.get("year")) || 0)) == null ? void 0 : _a.set("month", (valDate == null ? void 0 : valDate.get("month")) || 0)) == null ? void 0 : _b.set("date", (valDate == null ? void 0 : valDate.get("date")) || 0)) || null;
117
- onChange(newValue, "write");
118
- } else {
119
- setEndError(true);
120
- }
121
- setTimeout(() => {
122
- checkDateDisabled("start");
123
- }, 200);
124
- };
125
- const handleSelectChange = (e) => {
126
- const val = e.target.value;
127
- const detail = presetItems.find(
128
- (item) => item.value === val || item.label === val
129
- );
130
- if (!detail)
131
- return;
132
- const dateVal = detail.getValue();
133
- onChange(dateVal, "shortcuts", val);
134
- };
135
- const customPresetItems = (0, import_react.useMemo)(() => {
136
- if (!currentShortcut) {
137
- return presetItems.concat([
138
- {
139
- label: (0, import_locales.getText)(
140
- "toolbar-date-range-shortcut-custom",
141
- import_locales.pLocaleMap[locale]
142
- ),
143
- value: (0, import_locales.getText)(
144
- "toolbar-date-range-shortcut-custom",
145
- import_locales.pLocaleMap[locale]
146
- )
147
- }
148
- ]);
149
- }
150
- return presetItems;
151
- }, [presetItems, currentShortcut]);
152
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "date-picker-toolbar" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "date-picker-content-top" }, /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_locales.getText)(
153
- "toolbar-date-range-shortcut-date-range",
154
- import_locales.pLocaleMap[locale]
155
- )), /* @__PURE__ */ import_react.default.createElement(
156
- import_browserSelect.default,
157
- {
158
- value: currentShortcut || (0, import_locales.getText)("toolbar-date-range-shortcut-custom", import_locales.pLocaleMap[locale]),
159
- className: "date-picker-toolbar-select",
160
- options: customPresetItems,
161
- size: "large",
162
- onChange: handleSelectChange
163
- }
164
- )), /* @__PURE__ */ import_react.default.createElement("div", { className: "date-picker-content-bottom" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "date-picker-toolbar-start-wrap" }, /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_locales.getText)(
165
- "toolbar-date-range-shortcut-starting",
166
- import_locales.pLocaleMap[locale]
167
- )), /* @__PURE__ */ import_react.default.createElement(
168
- import_antd.Input,
169
- {
170
- status: startError ? "error" : "",
171
- size: "large",
172
- value: startStr,
173
- onChange: handleStartChange,
174
- placeholder: (0, import_dayjs.default)().format(format)
175
- }
176
- ), startError && /* @__PURE__ */ import_react.default.createElement("span", { className: "date-picker-error" }, (0, import_locales.getText)(
177
- "toolbar-date-range-invalid-start-date",
178
- import_locales.pLocaleMap[locale]
179
- ))), /* @__PURE__ */ import_react.default.createElement("div", { className: "date-picker-toolbar-end-wrap" }, /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_locales.getText)("toolbar-date-range-shortcut-ending", import_locales.pLocaleMap[locale])), /* @__PURE__ */ import_react.default.createElement(
180
- import_antd.Input,
181
- {
182
- status: endError ? "error" : "",
183
- size: "large",
184
- value: endStr,
185
- onChange: handleEndChange,
186
- placeholder: (0, import_dayjs.default)().format(format)
187
- }
188
- ), endError && /* @__PURE__ */ import_react.default.createElement("span", { className: "date-picker-error" }, (0, import_locales.getText)(
189
- "toolbar-date-range-invalid-end-date",
190
- import_locales.pLocaleMap[locale]
191
- )))));
192
- };
193
- var Toolbar_default = Toolbar;
@@ -1,35 +0,0 @@
1
- .date-picker-toolbar {
2
- padding: 20px 20px 0;
3
- color: var(--Gray-700, #344054);
4
- font-size: 14px;
5
- font-style: normal;
6
- font-weight: 600;
7
- line-height: 20px; /* 142.857% */
8
- display: flex;
9
- flex-direction: column;
10
- gap: 12px;
11
- .date-picker-content-top {
12
- display: flex;
13
- flex-direction: column;
14
- gap: 8px;
15
- }
16
- .date-picker-content-bottom {
17
- display: flex;
18
- gap: 16px;
19
- }
20
- .date-picker-toolbar-start-wrap {
21
- display: flex;
22
- flex-direction: column;
23
- gap: 8px;
24
- flex: 1;
25
- }
26
- .date-picker-toolbar-end-wrap {
27
- display: flex;
28
- flex-direction: column;
29
- gap: 8px;
30
- flex: 1;
31
- }
32
- .date-picker-error {
33
- color: #d4163a;
34
- }
35
- }
Binary file
@@ -1,15 +0,0 @@
1
- import React from "react";
2
- import "./index.less";
3
- interface BrowserSelectProps extends React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement> {
4
- options: any[];
5
- }
6
- /**
7
- * @title: 系统级别的下拉框
8
- * @description:
9
- * @param {BrowserSelectProps} props
10
- * @return {*}
11
- * @Author: zhiwei.Wang
12
- * @Date: 2024-01-30 16:43
13
- */
14
- declare const BrowserSelect: (props: BrowserSelectProps) => JSX.Element;
15
- export default BrowserSelect;
@@ -1,59 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/browserSelect/index.tsx
30
- var browserSelect_exports = {};
31
- __export(browserSelect_exports, {
32
- default: () => browserSelect_default
33
- });
34
- module.exports = __toCommonJS(browserSelect_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_classnames = __toESM(require("classnames"));
37
- var import_index = require("./index.less");
38
- var BrowserSelect = (props) => {
39
- const { options, ...resetProps } = props;
40
- const _options = (0, import_react.useMemo)(() => {
41
- return (props.options || []).map((d) => {
42
- return /* @__PURE__ */ import_react.default.createElement("option", { value: d.value, key: d.value }, d.label);
43
- });
44
- }, [props.options]);
45
- return /* @__PURE__ */ import_react.default.createElement(
46
- "select",
47
- {
48
- ...resetProps,
49
- className: (0, import_classnames.default)("date-picker-pisell-browser-select", resetProps.className),
50
- onChange: (e) => {
51
- var _a;
52
- e.persist();
53
- (_a = resetProps.onChange) == null ? void 0 : _a.call(resetProps, e);
54
- }
55
- },
56
- _options
57
- );
58
- };
59
- var browserSelect_default = BrowserSelect;
@@ -1,18 +0,0 @@
1
- .date-picker-pisell-browser-select {
2
- padding: 9px 16px;
3
- border-radius: 8px;
4
- background-color: #fff;
5
- background-image: url('./chevron-down.png');
6
- color: var(--Gray-true-900, #141414);
7
- font-size: 16px;
8
- font-style: normal;
9
- font-weight: 600;
10
- border: 1px solid var(--Gray-300, #D0D5DD);
11
- cursor: pointer;
12
- appearance: none;
13
- -webkit-appearance: none;
14
- -moz-appearance: none;
15
- background-position: right 10px center;
16
- background-size: 12px;
17
- background-repeat: no-repeat;
18
- }
@@ -1,58 +0,0 @@
1
- import dayjs from 'dayjs';
2
- import { PresetType } from './Shortcuts';
3
- export declare const presetValueArr: string[];
4
- export declare const presetDetailMap: {
5
- today: {
6
- getValue: () => dayjs.Dayjs[];
7
- label: (locale?: string) => any;
8
- };
9
- yesterday: {
10
- getValue: () => dayjs.Dayjs[];
11
- label: (locale?: string) => any;
12
- };
13
- last_3_days: {
14
- getValue: () => dayjs.Dayjs[];
15
- label: (locale?: string) => any;
16
- };
17
- last_7_days: {
18
- getValue: () => dayjs.Dayjs[];
19
- label: (locale?: string) => any;
20
- };
21
- last_30_days: {
22
- getValue: () => dayjs.Dayjs[];
23
- label: (locale?: string) => any;
24
- };
25
- last_90_days: {
26
- getValue: () => dayjs.Dayjs[];
27
- label: (locale?: string) => any;
28
- };
29
- last_180_days: {
30
- getValue: () => dayjs.Dayjs[];
31
- label: (locale?: string) => any;
32
- };
33
- tomorrow: {
34
- getValue: () => dayjs.Dayjs[];
35
- label: (locale?: string) => any;
36
- };
37
- next_3_days: {
38
- getValue: () => dayjs.Dayjs[];
39
- label: (locale?: string) => any;
40
- };
41
- next_7_days: {
42
- getValue: () => dayjs.Dayjs[];
43
- label: (locale?: string) => any;
44
- };
45
- next_30_days: {
46
- getValue: () => dayjs.Dayjs[];
47
- label: (locale?: string) => any;
48
- };
49
- next_90_days: {
50
- getValue: () => dayjs.Dayjs[];
51
- label: (locale?: string) => any;
52
- };
53
- next_180_days: {
54
- getValue: () => dayjs.Dayjs[];
55
- label: (locale?: string) => any;
56
- };
57
- };
58
- export declare const defaultPresets: PresetType[];