funda-ui 1.0.522 → 1.0.530

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,96 @@
1
+ /* ======================================================
2
+ <!-- Calendar -->
3
+ /* ====================================================== */
4
+ .custom-calendar {
5
+ --custom-calendar-wrapper-min-width: 400px;
6
+ --custom-calendar-border-color: #ddd;
7
+ --custom-calendar-header-fs: 1.125rem;
8
+ --custom-calendar-header-bg: #f5f6fa;
9
+ --custom-calendar-default-border-color: #eee;
10
+ --custom-calendar-today-border-color: #ddd;
11
+ --custom-calendar-todayselected-bg: #eee;
12
+ --custom-calendar-year-month-btn-border-color: #ddd;
13
+ --custom-calendar-year-month-btn-hover-bg: rgba(0, 58, 166, .2);
14
+ --custom-calendar-year-month-btn-selected-bg: rgba(0, 58, 166, 1);
15
+ --custom-calendar-year-month-btn-selected-color: #fff;
16
+ }
17
+ .custom-calendar__wrapper {
18
+ min-width: var(--custom-calendar-wrapper-min-width);
19
+ border: 1px solid var(--custom-calendar-border-color);
20
+ }
21
+ .custom-calendar__header {
22
+ font-size: var(--custom-calendar-header-fs);
23
+ font-weight: bold;
24
+ padding: 10px 10px 5px 10px;
25
+ display: flex;
26
+ justify-content: space-between;
27
+ background-color: var(--custom-calendar-header-bg);
28
+ }
29
+ .custom-calendar__body {
30
+ width: 100%;
31
+ display: flex;
32
+ flex-wrap: wrap;
33
+ }
34
+ .custom-calendar__btn {
35
+ border: none;
36
+ outline: none;
37
+ background: none;
38
+ padding: 0;
39
+ margin: 0;
40
+ box-shadow: none;
41
+ cursor: pointer;
42
+ }
43
+ .custom-calendar__btn__btn--prev {
44
+ transform: rotate(90deg);
45
+ }
46
+ .custom-calendar__btn__btn--next {
47
+ transform: rotate(-90deg);
48
+ }
49
+ .custom-calendar__btn__btn--today {
50
+ margin: 1rem;
51
+ }
52
+ .custom-calendar__day {
53
+ width: 14.2%;
54
+ height: 40px;
55
+ display: flex;
56
+ align-items: center;
57
+ justify-content: center;
58
+ cursor: pointer;
59
+ border: 1px solid var(--custom-calendar-default-border-color);
60
+ }
61
+ .custom-calendar__day.today {
62
+ border: 1px solid var(--custom-calendar-today-border-color);
63
+ }
64
+ .custom-calendar__day.selected {
65
+ background-color: var(--custom-calendar-todayselected-bg);
66
+ }
67
+ .custom-calendar__month-container {
68
+ display: grid;
69
+ grid-template-columns: repeat(3, 1fr);
70
+ grid-template-rows: repeat(4, 2.5em);
71
+ margin-top: 45px;
72
+ grid-gap: 10px;
73
+ }
74
+ .custom-calendar__year-container {
75
+ display: grid;
76
+ grid-template-columns: repeat(4, 1fr);
77
+ grid-template-rows: repeat(5, 2.5em);
78
+ grid-gap: 5px;
79
+ }
80
+ .custom-calendar__year, .custom-calendar__month {
81
+ display: flex;
82
+ align-items: center;
83
+ justify-content: center;
84
+ padding: 5px;
85
+ font-size: 0.875em;
86
+ border: 1px solid var(--custom-calendar-year-month-btn-border-color);
87
+ border-radius: 5px;
88
+ cursor: pointer;
89
+ }
90
+ .custom-calendar__year:hover, .custom-calendar__year:hover, .custom-calendar__month:hover, .custom-calendar__month:hover {
91
+ background-color: var(--custom-calendar-year-month-btn-hover-bg);
92
+ }
93
+ .custom-calendar__year.selected, .custom-calendar__year.selected, .custom-calendar__month.selected, .custom-calendar__month.selected {
94
+ background-color: var(--custom-calendar-year-month-btn-selected-bg);
95
+ color: var(--custom-calendar-year-month-btn-selected-color);
96
+ }
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ declare type CalendarProps = {
3
+ tmpl?: (date: any) => void;
4
+ militaryTime?: boolean;
5
+ };
6
+ declare const Calendar: (props: CalendarProps) => JSX.Element;
7
+ export default Calendar;
@@ -0,0 +1,308 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("react"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["react"], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["RPB"] = factory(require("react"));
8
+ else
9
+ root["RPB"] = factory(root["React"]);
10
+ })(this, (__WEBPACK_EXTERNAL_MODULE__787__) => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ "use strict";
13
+ /******/ var __webpack_modules__ = ({
14
+
15
+ /***/ 787:
16
+ /***/ ((module) => {
17
+
18
+ module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
19
+
20
+ /***/ })
21
+
22
+ /******/ });
23
+ /************************************************************************/
24
+ /******/ // The module cache
25
+ /******/ var __webpack_module_cache__ = {};
26
+ /******/
27
+ /******/ // The require function
28
+ /******/ function __webpack_require__(moduleId) {
29
+ /******/ // Check if module is in cache
30
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
31
+ /******/ if (cachedModule !== undefined) {
32
+ /******/ return cachedModule.exports;
33
+ /******/ }
34
+ /******/ // Create a new module (and put it into the cache)
35
+ /******/ var module = __webpack_module_cache__[moduleId] = {
36
+ /******/ // no module.id needed
37
+ /******/ // no module.loaded needed
38
+ /******/ exports: {}
39
+ /******/ };
40
+ /******/
41
+ /******/ // Execute the module function
42
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
43
+ /******/
44
+ /******/ // Return the exports of the module
45
+ /******/ return module.exports;
46
+ /******/ }
47
+ /******/
48
+ /************************************************************************/
49
+ /******/ /* webpack/runtime/compat get default export */
50
+ /******/ (() => {
51
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
52
+ /******/ __webpack_require__.n = (module) => {
53
+ /******/ var getter = module && module.__esModule ?
54
+ /******/ () => (module['default']) :
55
+ /******/ () => (module);
56
+ /******/ __webpack_require__.d(getter, { a: getter });
57
+ /******/ return getter;
58
+ /******/ };
59
+ /******/ })();
60
+ /******/
61
+ /******/ /* webpack/runtime/define property getters */
62
+ /******/ (() => {
63
+ /******/ // define getter functions for harmony exports
64
+ /******/ __webpack_require__.d = (exports, definition) => {
65
+ /******/ for(var key in definition) {
66
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
67
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
68
+ /******/ }
69
+ /******/ }
70
+ /******/ };
71
+ /******/ })();
72
+ /******/
73
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
74
+ /******/ (() => {
75
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
76
+ /******/ })();
77
+ /******/
78
+ /******/ /* webpack/runtime/make namespace object */
79
+ /******/ (() => {
80
+ /******/ // define __esModule on exports
81
+ /******/ __webpack_require__.r = (exports) => {
82
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
83
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
84
+ /******/ }
85
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
86
+ /******/ };
87
+ /******/ })();
88
+ /******/
89
+ /************************************************************************/
90
+ var __webpack_exports__ = {};
91
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
92
+ (() => {
93
+ __webpack_require__.r(__webpack_exports__);
94
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
95
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
96
+ /* harmony export */ });
97
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(787);
98
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
99
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
100
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
101
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
102
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
103
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
104
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
105
+
106
+ var Calendar = function Calendar(props) {
107
+ var tmpl = props.tmpl,
108
+ militaryTime = props.militaryTime;
109
+ var DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
110
+ var DAYS_LEAP = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
111
+ var WEEK = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'];
112
+ var WEEK_FULL = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY'];
113
+ var MONTHS = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'];
114
+ var MONTHS_FULL = ['January', 'Febuary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
115
+ var now = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
116
+ return new Date();
117
+ }, []);
118
+ var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(now),
119
+ _useState2 = _slicedToArray(_useState, 2),
120
+ date = _useState2[0],
121
+ setDate = _useState2[1];
122
+ var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(date.getDate()),
123
+ _useState4 = _slicedToArray(_useState3, 2),
124
+ day = _useState4[0],
125
+ setDay = _useState4[1];
126
+ var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(date.getMonth()),
127
+ _useState6 = _slicedToArray(_useState5, 2),
128
+ month = _useState6[0],
129
+ setMonth = _useState6[1];
130
+ var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(date.getFullYear()),
131
+ _useState8 = _slicedToArray(_useState7, 2),
132
+ year = _useState8[0],
133
+ setYear = _useState8[1];
134
+ var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(getStartDayOfMonth(date)),
135
+ _useState10 = _slicedToArray(_useState9, 2),
136
+ startDay = _useState10[0],
137
+ setStartDay = _useState10[1];
138
+
139
+ // selection tab
140
+ // gets the today date time object
141
+ var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(now.getMonth()),
142
+ _useState12 = _slicedToArray(_useState11, 2),
143
+ selectedMonth = _useState12[0],
144
+ setSelectedMonth = _useState12[1];
145
+ var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(now.getFullYear()),
146
+ _useState14 = _slicedToArray(_useState13, 2),
147
+ selectedYear = _useState14[0],
148
+ setSelectedYear = _useState14[1];
149
+ var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
150
+ _useState16 = _slicedToArray(_useState15, 2),
151
+ yearsArray = _useState16[0],
152
+ setYearsCollection = _useState16[1];
153
+ function setTodayDate() {
154
+ setDay(now.getDate());
155
+ setMonth(now.getMonth());
156
+ setYear(now.getFullYear());
157
+ setStartDay(getStartDayOfMonth(now));
158
+ }
159
+ function getStartDayOfMonth(date) {
160
+ var startDate = new Date(date.getFullYear(), date.getMonth(), 1).getDay();
161
+ return startDate === 0 ? 7 : startDate;
162
+ }
163
+ function isLeapYear(year) {
164
+ return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
165
+ }
166
+ var days = isLeapYear(year) ? DAYS_LEAP : DAYS;
167
+ function handlePrevChange() {
168
+ setDate(function (prevState) {
169
+ var _date = new Date(year, month - 1, day);
170
+
171
+ // update
172
+ setSelectedMonth(_date.getMonth());
173
+ setSelectedYear(_date.getFullYear());
174
+ return _date;
175
+ });
176
+ }
177
+ function handleNextChange() {
178
+ setDate(function (prevState) {
179
+ var _date = new Date(year, month + 1, day);
180
+
181
+ // update
182
+ setSelectedMonth(_date.getMonth());
183
+ setSelectedYear(_date.getFullYear());
184
+ return _date;
185
+ });
186
+ }
187
+ function handleDayChange(e, currentDay) {
188
+ setDate(new Date(year, month, currentDay));
189
+ }
190
+ function handleYearChange(currentValue) {
191
+ setSelectedYear(currentValue);
192
+ setYear(currentValue);
193
+ setDate(new Date(currentValue, month, day));
194
+ }
195
+ function handleMonthChange(currentIndex) {
196
+ setSelectedMonth(currentIndex);
197
+ setMonth(currentIndex);
198
+ setDate(new Date(year, currentIndex, day));
199
+ }
200
+ function handleTodayChange() {
201
+ setSelectedMonth(now.getMonth());
202
+ setSelectedYear(now.getFullYear());
203
+ setTodayDate();
204
+ }
205
+
206
+ //if user change the selectedYear, then udate the years array that is displayed on year tab view
207
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
208
+ var years = [];
209
+ for (var y = selectedYear - 10; y < selectedYear + 10; y++) {
210
+ years.push(y);
211
+ }
212
+ setYearsCollection(years);
213
+ }, [selectedYear]);
214
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
215
+ setDay(date.getDate());
216
+ setMonth(date.getMonth());
217
+ setYear(date.getFullYear());
218
+ setStartDay(getStartDayOfMonth(date));
219
+ }, [date]);
220
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
221
+ className: "custom-calendar"
222
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
223
+ className: "custom-calendar__wrapper"
224
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
225
+ className: "custom-calendar__header"
226
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
227
+ type: "button",
228
+ className: "custom-calendar__btn custom-calendar__btn--prev",
229
+ onClick: handlePrevChange
230
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
231
+ width: "20px",
232
+ height: "20px",
233
+ viewBox: "0 0 29 29"
234
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
235
+ fill: "none",
236
+ stroke: "#000",
237
+ strokeLinecap: "round",
238
+ strokeLinejoin: "round",
239
+ strokeMiterlimit: "10",
240
+ strokeWidth: "2",
241
+ d: "m20.5 11.5-6 6-6-6"
242
+ }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, MONTHS[month], " ", year), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
243
+ type: "button",
244
+ className: "custom-calendar__btn custom-calendar__btn--next",
245
+ onClick: handleNextChange
246
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
247
+ width: "20px",
248
+ height: "20px",
249
+ viewBox: "0 0 29 29"
250
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
251
+ fill: "none",
252
+ stroke: "#000",
253
+ strokeLinecap: "round",
254
+ strokeLinejoin: "round",
255
+ strokeMiterlimit: "10",
256
+ strokeWidth: "2",
257
+ d: "m20.5 11.5-6 6-6-6"
258
+ })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
259
+ className: "custom-calendar__body"
260
+ }, WEEK.map(function (d) {
261
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
262
+ className: "custom-calendar__day",
263
+ key: d
264
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("strong", null, d));
265
+ }), Array(days[month] + (startDay - 1)).fill(null).map(function (_, index) {
266
+ var d = index - (startDay - 2);
267
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
268
+ className: "custom-calendar__day ".concat(d === now.getDate() ? 'today' : '', " ").concat(d === day ? 'selected' : ''),
269
+ key: index,
270
+ onClick: function onClick(e) {
271
+ handleDayChange(e, d);
272
+ }
273
+ }, d > 0 ? d : '');
274
+ })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
275
+ className: "custom-calendar__month-container"
276
+ }, MONTHS_FULL.map(function (month, index) {
277
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
278
+ className: "custom-calendar__month ".concat(selectedMonth === index ? ' selected' : ''),
279
+ key: month + index,
280
+ onClick: function onClick() {
281
+ handleMonthChange(index);
282
+ }
283
+ }, month);
284
+ })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("hr", null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
285
+ className: "custom-calendar__year-container"
286
+ }, yearsArray.map(function (year, index) {
287
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
288
+ className: "custom-calendar__year ".concat(selectedYear === year ? ' selected' : ''),
289
+ key: year + index,
290
+ onClick: function onClick() {
291
+ handleYearChange(year);
292
+ }
293
+ }, year);
294
+ })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
295
+ className: "custom-calendar__today-container"
296
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
297
+ type: "button",
298
+ className: "custom-calendar__btn custom-calendar__btn--today",
299
+ onClick: handleTodayChange
300
+ }, "Today")))));
301
+ };
302
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Calendar);
303
+ })();
304
+
305
+ /******/ return __webpack_exports__;
306
+ /******/ })()
307
+ ;
308
+ });
package/Input/index.d.ts CHANGED
@@ -34,6 +34,8 @@ declare type InputProps = {
34
34
  tabIndex?: number;
35
35
  [key: `data-${string}`]: string | undefined;
36
36
  onChangeCallback?: (e: any) => void;
37
+ onInputCallback?: (e: any) => void;
38
+ onKeyPressedCallback?: (e: any) => void;
37
39
  onChange?: (e: any, param: any) => void;
38
40
  onBlur?: (e: any, param: any) => void;
39
41
  onFocus?: (e: any, param: any) => void;
package/Input/index.js CHANGED
@@ -96,7 +96,7 @@ __webpack_require__.r(__webpack_exports__);
96
96
  /* harmony export */ });
97
97
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(787);
98
98
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
99
- var _excluded = ["wrapperClassName", "controlClassName", "type", "disabled", "required", "placeholder", "pattern", "readOnly", "value", "label", "units", "name", "step", "min", "max", "src", "size", "minLength", "maxLength", "alt", "id", "iconLeft", "iconRight", "autoComplete", "style", "tabIndex", "onChangeCallback", "onChange", "onBlur", "onFocus"];
99
+ var _excluded = ["wrapperClassName", "controlClassName", "type", "disabled", "required", "placeholder", "pattern", "readOnly", "value", "label", "units", "name", "step", "min", "max", "src", "size", "minLength", "maxLength", "alt", "id", "iconLeft", "iconRight", "autoComplete", "style", "tabIndex", "onChangeCallback", "onInputCallback", "onKeyPressedCallback", "onChange", "onBlur", "onFocus"];
100
100
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
101
101
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
102
102
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -135,6 +135,8 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
135
135
  style = props.style,
136
136
  tabIndex = props.tabIndex,
137
137
  onChangeCallback = props.onChangeCallback,
138
+ onInputCallback = props.onInputCallback,
139
+ onKeyPressedCallback = props.onKeyPressedCallback,
138
140
  onChange = props.onChange,
139
141
  onBlur = props.onBlur,
140
142
  onFocus = props.onFocus,
@@ -178,6 +180,12 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
178
180
 
179
181
  //
180
182
  onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition);
183
+
184
+ // It fires in real time as the user enters
185
+ if (typeof onInputCallback === 'function') {
186
+ var newData = onInputCallback(event);
187
+ setChangedVal(newData);
188
+ }
181
189
  }
182
190
  function handleBlur(event) {
183
191
  var el = event.target;
@@ -192,12 +200,18 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
192
200
  //
193
201
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event, onComposition);
194
202
 
195
- //
203
+ // It fires when focus is lost
196
204
  if (typeof onChangeCallback === 'function') {
197
205
  var newData = onChangeCallback(event);
198
206
  setChangedVal(newData);
199
207
  }
200
208
  }
209
+ function handleKeyPressed(event) {
210
+ if (typeof onKeyPressedCallback === 'function') {
211
+ var newData = onKeyPressedCallback(event);
212
+ setChangedVal(newData);
213
+ }
214
+ }
201
215
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
202
216
  // update default value
203
217
  //--------------
@@ -245,6 +259,7 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
245
259
  onFocus: handleFocus,
246
260
  onBlur: handleBlur,
247
261
  onChange: handleChange,
262
+ onKeyDown: handleKeyPressed,
248
263
  onCompositionStart: handleComposition,
249
264
  onCompositionUpdate: handleComposition,
250
265
  onCompositionEnd: handleComposition,
@@ -613,8 +613,6 @@ var ModalDialog = function ModalDialog(props) {
613
613
  };
614
614
  };
615
615
  onOpen === null || onOpen === void 0 ? void 0 : onOpen(null, _callback(null));
616
- } else {
617
- handleCloseWin(null);
618
616
  }
619
617
 
620
618
  // Pass the function to be called
@@ -867,11 +867,14 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
867
867
 
868
868
  //
869
869
  function fixContentHeight() {
870
- if (listContentRef.current === null) return;
871
870
  setTimeout(function () {
872
- var _displayedItems = listContentRef.current.querySelectorAll('.list-group-item');
873
- var _displayedHeight = _displayedItems[0].clientHeight * _displayedItems.length;
874
- listContentRef.current.style.height = _displayedHeight + 'px';
871
+ if (listContentRef.current !== null) {
872
+ var _displayedItems = listContentRef.current.querySelectorAll('.list-group-item');
873
+ if (typeof _displayedItems[0] !== 'undefined') {
874
+ var _displayedHeight = _displayedItems[0].clientHeight * _displayedItems.length;
875
+ listContentRef.current.style.height = _displayedHeight + 'px';
876
+ }
877
+ }
875
878
  }, 0);
876
879
  }
877
880
  function getPlacement(el) {
package/README.md CHANGED
@@ -49,6 +49,7 @@ Here is a table of the components and their status.
49
49
  | [Tooltip ✅](packages/Tooltip/README.md) | | | |
50
50
  | [Digital Clock ✅](packages/DigitalClock/README.md) | | | |
51
51
  | [Tree ✅🔥](packages/Tree/README.md) | | | |
52
+ | [Calendar ✅](packages/Calendar/README.md) | | | |
52
53
 
53
54
 
54
55
 
package/Radio/index.d.ts CHANGED
@@ -7,7 +7,7 @@ declare module 'react' {
7
7
  interface OptionConfig {
8
8
  [propName: string]: string | number;
9
9
  }
10
- declare type RadioOptionChangeFnType = (arg1: any, arg2: any) => void;
10
+ declare type RadioOptionChangeFnType = (arg1: any, arg2: any, arg3?: any) => void;
11
11
  declare type RadioProps = {
12
12
  wrapperClassName?: string;
13
13
  value?: string;
package/Radio/index.js CHANGED
@@ -257,6 +257,7 @@ var Radio = function Radio(props) {
257
257
  }
258
258
  function handleChange(event) {
259
259
  var val = event.target.value;
260
+ var currentIndex = event.target.dataset.index;
260
261
 
261
262
  //----
262
263
  // update value
@@ -268,8 +269,10 @@ var Radio = function Radio(props) {
268
269
 
269
270
  //
270
271
  if (typeof onChange === 'function') {
271
- onChange(event, dataInit[event.target.selectedIndex]);
272
- event.target.blur();
272
+ onChange(event, val, dataInit[currentIndex]);
273
+ }
274
+ if (typeof onClick === 'function') {
275
+ onClick(event, val, dataInit[currentIndex]);
273
276
  }
274
277
  }
275
278
  function handleBlur(event) {
@@ -293,6 +296,7 @@ var Radio = function Radio(props) {
293
296
  className: "form-check-input",
294
297
  id: "field-".concat(uniqueID, "-").concat(index),
295
298
  name: name,
299
+ "data-index": index,
296
300
  value: "".concat(item.value),
297
301
  required: requiredVal,
298
302
  disabled: disabled || null,
@@ -158,7 +158,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
158
158
  var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1465__(787);
159
159
  /* harmony import */
160
160
  var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1465__.n(react__WEBPACK_IMPORTED_MODULE_0__);
161
- var _excluded = ["wrapperClassName", "controlClassName", "type", "disabled", "required", "placeholder", "pattern", "readOnly", "value", "label", "units", "name", "step", "min", "max", "src", "size", "minLength", "maxLength", "alt", "id", "iconLeft", "iconRight", "autoComplete", "style", "tabIndex", "onChangeCallback", "onChange", "onBlur", "onFocus"];
161
+ var _excluded = ["wrapperClassName", "controlClassName", "type", "disabled", "required", "placeholder", "pattern", "readOnly", "value", "label", "units", "name", "step", "min", "max", "src", "size", "minLength", "maxLength", "alt", "id", "iconLeft", "iconRight", "autoComplete", "style", "tabIndex", "onChangeCallback", "onInputCallback", "onKeyPressedCallback", "onChange", "onBlur", "onFocus"];
162
162
  function _extends() {
163
163
  _extends = Object.assign ? Object.assign.bind() : function (target) {
164
164
  for (var i = 1; i < arguments.length; i++) {
@@ -277,6 +277,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
277
277
  style = props.style,
278
278
  tabIndex = props.tabIndex,
279
279
  onChangeCallback = props.onChangeCallback,
280
+ onInputCallback = props.onInputCallback,
281
+ onKeyPressedCallback = props.onKeyPressedCallback,
280
282
  onChange = props.onChange,
281
283
  onBlur = props.onBlur,
282
284
  onFocus = props.onFocus,
@@ -320,6 +322,12 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
320
322
 
321
323
  //
322
324
  onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition);
325
+
326
+ // It fires in real time as the user enters
327
+ if (typeof onInputCallback === 'function') {
328
+ var newData = onInputCallback(event);
329
+ setChangedVal(newData);
330
+ }
323
331
  }
324
332
  function handleBlur(event) {
325
333
  var el = event.target;
@@ -334,12 +342,18 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
334
342
  //
335
343
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event, onComposition);
336
344
 
337
- //
345
+ // It fires when focus is lost
338
346
  if (typeof onChangeCallback === 'function') {
339
347
  var newData = onChangeCallback(event);
340
348
  setChangedVal(newData);
341
349
  }
342
350
  }
351
+ function handleKeyPressed(event) {
352
+ if (typeof onKeyPressedCallback === 'function') {
353
+ var newData = onKeyPressedCallback(event);
354
+ setChangedVal(newData);
355
+ }
356
+ }
343
357
  (0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
344
358
  // update default value
345
359
  //--------------
@@ -387,6 +401,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
387
401
  onFocus: handleFocus,
388
402
  onBlur: handleBlur,
389
403
  onChange: handleChange,
404
+ onKeyDown: handleKeyPressed,
390
405
  onCompositionStart: handleComposition,
391
406
  onCompositionUpdate: handleComposition,
392
407
  onCompositionEnd: handleComposition,
package/Table/index.js CHANGED
@@ -1164,6 +1164,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1164
1164
  }
1165
1165
  function handleChange(event) {
1166
1166
  var val = event.target.value;
1167
+ var currentIndex = event.target.dataset.index;
1167
1168
 
1168
1169
  //----
1169
1170
  // update value
@@ -1175,8 +1176,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1175
1176
 
1176
1177
  //
1177
1178
  if (typeof onChange === 'function') {
1178
- onChange(event, dataInit[event.target.selectedIndex]);
1179
- event.target.blur();
1179
+ onChange(event, val, dataInit[currentIndex]);
1180
+ }
1181
+ if (typeof onClick === 'function') {
1182
+ onClick(event, val, dataInit[currentIndex]);
1180
1183
  }
1181
1184
  }
1182
1185
  function handleBlur(event) {
@@ -1200,6 +1203,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1200
1203
  className: "form-check-input",
1201
1204
  id: "field-".concat(uniqueID, "-").concat(index),
1202
1205
  name: name,
1206
+ "data-index": index,
1203
1207
  value: "".concat(item.value),
1204
1208
  required: requiredVal,
1205
1209
  disabled: disabled || null,
@@ -24,6 +24,8 @@ interface TextareaProps extends React.ComponentPropsWithoutRef<"textarea"> {
24
24
  tabIndex?: number;
25
25
  [key: `data-${string}`]: string | undefined;
26
26
  onChangeCallback?: (e: any) => void;
27
+ onInputCallback?: (e: any) => void;
28
+ onKeyPressedCallback?: (e: any) => void;
27
29
  onChange?: (e: any) => void;
28
30
  onBlur?: (e: any) => void;
29
31
  onFocus?: (e: any) => void;