awing-library 2.1.199-dev → 2.1.201-dev

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.
@@ -219,7 +219,7 @@ var BasicDataForm = function (props) {
219
219
  } }, fieldDef.DateProps), fieldName));
220
220
  break;
221
221
  case 'date-range':
222
- currentField = ((0, jsx_runtime_1.jsx)(DateRangePicker_1.default, __assign({ variant: "outlined", textFieldProps: {
222
+ currentField = ((0, jsx_runtime_1.jsx)(DateRangePicker_1.default, __assign({ required: fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.required, variant: "outlined", textFieldProps: {
223
223
  fullWidth: true,
224
224
  }, value: {
225
225
  startDate: (fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue[0]) || null,
@@ -144,7 +144,7 @@ var defaultProps = {
144
144
  };
145
145
  var DateRangePickerWrapper = function (props) {
146
146
  var classes = useStyles();
147
- var value = props.value, error = props.error, helperText = props.helperText, _a = props.autoFocus, autoFocus = _a === void 0 ? false : _a, _b = props.autoFocusEndDate, autoFocusEndDate = _b === void 0 ? false : _b, _c = props.initialStartDate, initialStartDate = _c === void 0 ? null : _c, _d = props.initialEndDate, initialEndDate = _d === void 0 ? null : _d, _e = props.callback, callback = _e === void 0 ? function () { } : _e, _f = props.label, label = _f === void 0 ? null : _f, _g = props.isShowCalendarInfo, isShowCalendarInfo = _g === void 0 ? false : _g, variant = props.variant, openDirection = props.openDirection, _h = props.isDayBlocked, isDayBlocked = _h === void 0 ? function (day) { return false; } : _h, _j = props.handleValid, handleValid = _j === void 0 ? function () { } : _j, _k = props.handleDateRangePopover, handleDateRangePopover = _k === void 0 ? function () { } : _k, disableHelperText = props.disableHelperText, _l = props.isFutureDate, isFutureDate = _l === void 0 ? false : _l;
147
+ var value = props.value, error = props.error, helperText = props.helperText, _a = props.autoFocus, autoFocus = _a === void 0 ? false : _a, _b = props.autoFocusEndDate, autoFocusEndDate = _b === void 0 ? false : _b, _c = props.initialStartDate, initialStartDate = _c === void 0 ? null : _c, _d = props.initialEndDate, initialEndDate = _d === void 0 ? null : _d, _e = props.callback, callback = _e === void 0 ? function () { } : _e, _f = props.label, label = _f === void 0 ? null : _f, _g = props.isShowCalendarInfo, isShowCalendarInfo = _g === void 0 ? false : _g, variant = props.variant, openDirection = props.openDirection, _h = props.isDayBlocked, isDayBlocked = _h === void 0 ? function (day) { return false; } : _h, _j = props.handleValid, handleValid = _j === void 0 ? function () { } : _j, _k = props.handleDateRangePopover, handleDateRangePopover = _k === void 0 ? function () { } : _k, disableHelperText = props.disableHelperText, _l = props.isFutureDate, isFutureDate = _l === void 0 ? false : _l, _m = props.required, required = _m === void 0 ? false : _m;
148
148
  var initialFocusedInput = null;
149
149
  if (autoFocus) {
150
150
  initialFocusedInput = constants_1.START_DATE;
@@ -152,12 +152,12 @@ var DateRangePickerWrapper = function (props) {
152
152
  else if (autoFocusEndDate) {
153
153
  initialFocusedInput = constants_1.END_DATE;
154
154
  }
155
- var _m = (0, react_1.useState)(initialFocusedInput), focusedInput = _m[0], setFocusedInput = _m[1];
156
- var _o = (0, react_1.useState)(initialStartDate), startDate = _o[0], setStartDate = _o[1];
157
- var _p = (0, react_1.useState)(initialEndDate), endDate = _p[0], setEndDate = _p[1];
158
- var _q = (0, react_1.useState)(true), isValid = _q[0], setIsValid = _q[1];
159
- var _r = (0, react_1.useState)("".concat(moment(value ? value === null || value === void 0 ? void 0 : value.startDate : startDate).format('DD/MM/YYYY'), " - ").concat(moment(value ? value === null || value === void 0 ? void 0 : value.endDate : endDate).format('DD/MM/YYYY'))), inputValue = _r[0], setInputValue = _r[1];
160
- var _s = (0, react_i18next_1.useTranslation)(), i18n = _s.i18n, t = _s.t;
155
+ var _o = (0, react_1.useState)(initialFocusedInput), focusedInput = _o[0], setFocusedInput = _o[1];
156
+ var _p = (0, react_1.useState)(initialStartDate), startDate = _p[0], setStartDate = _p[1];
157
+ var _q = (0, react_1.useState)(initialEndDate), endDate = _q[0], setEndDate = _q[1];
158
+ var _r = (0, react_1.useState)(true), isValid = _r[0], setIsValid = _r[1];
159
+ var _s = (0, react_1.useState)("".concat(moment(value ? value === null || value === void 0 ? void 0 : value.startDate : startDate).format('DD/MM/YYYY'), " - ").concat(moment(value ? value === null || value === void 0 ? void 0 : value.endDate : endDate).format('DD/MM/YYYY'))), inputValue = _s[0], setInputValue = _s[1];
160
+ var _t = (0, react_i18next_1.useTranslation)(), i18n = _t.i18n, t = _t.t;
161
161
  var momentLanguage = (0, react_1.useMemo)(function () { var _a, _b; return ((_b = (_a = i18n === null || i18n === void 0 ? void 0 : i18n.language) === null || _a === void 0 ? void 0 : _a.split('-')) === null || _b === void 0 ? void 0 : _b[0]) || 'en'; }, [i18n.language]);
162
162
  (0, react_1.useEffect)(function () {
163
163
  if (value !== undefined) {
@@ -331,7 +331,7 @@ var DateRangePickerWrapper = function (props) {
331
331
  'handleValid',
332
332
  'handleDateRangePopover',
333
333
  ]);
334
- var _t = react_1.default.useState(null), anchorElPopover = _t[0], setAnchorElPopover = _t[1];
334
+ var _u = react_1.default.useState(null), anchorElPopover = _u[0], setAnchorElPopover = _u[1];
335
335
  var openPopper = Boolean(anchorElPopover);
336
336
  var id = openPopper ? 'datePicker-popper' : undefined;
337
337
  var popperRef = react_1.default.useRef();
@@ -352,7 +352,7 @@ var DateRangePickerWrapper = function (props) {
352
352
  };
353
353
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_input_mask_1.default, { mask: "99/99/9999 - 99/99/9999", maskplaceholder: "dd/mm/yyyy - dd/mm/yyyy", value: inputValue, onChange: handleChangeInput, disabled: props.disabled, children: function () {
354
354
  var _a;
355
- return ((0, jsx_runtime_1.jsx)(material_1.TextField, __assign({ "aria-describedby": id, variant: variant, label: label, error: !isValid || error, helperText: !disableHelperText
355
+ return ((0, jsx_runtime_1.jsx)(material_1.TextField, __assign({ required: required, "aria-describedby": id, variant: variant, label: label, error: !isValid || error, helperText: !disableHelperText
356
356
  ? error
357
357
  ? helperText || t('Common.InvalidData')
358
358
  : !isValid
@@ -1,5 +1,6 @@
1
1
  import { MomentInput, Moment } from "moment";
2
2
  export interface DateRangePickerProps {
3
+ required?: boolean;
3
4
  disabled?: boolean;
4
5
  autoFocus?: boolean;
5
6
  autoFocusEndDate?: boolean;
@@ -1,8 +1,4 @@
1
1
  "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
3
  if (k2 === undefined) k2 = k;
8
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -41,7 +37,6 @@ var mapContainerStyle = {
41
37
  height: '320px',
42
38
  width: '100%',
43
39
  };
44
- var myEffectExit = (0, material_1.keyframes)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 0% {\n transform: scale(1);\n border: 0px solid #fff;\n opacity: 1;\n }\n 25% {\n transform: scale(1.1);\n border: 10px solid #1a78fc;\n opacity: 0.8;\n }\n 50% {\n transform: scale(1.12);\n\tborder: 8px solid #1a78fc;\n opacity: 0.5;\n }\n 75% {\n transform: scale(1.14);\n\tborder: 6px solid #1a78fc;\n opacity: 0.3;\n }\n 100% {\n transform: scale(1.16);\n\tborder: 4px solid #1a78fc;\n opacity: 0.2;\n }\n"], ["\n 0% {\n transform: scale(1);\n border: 0px solid #fff;\n opacity: 1;\n }\n 25% {\n transform: scale(1.1);\n border: 10px solid #1a78fc;\n opacity: 0.8;\n }\n 50% {\n transform: scale(1.12);\n\tborder: 8px solid #1a78fc;\n opacity: 0.5;\n }\n 75% {\n transform: scale(1.14);\n\tborder: 6px solid #1a78fc;\n opacity: 0.3;\n }\n 100% {\n transform: scale(1.16);\n\tborder: 4px solid #1a78fc;\n opacity: 0.2;\n }\n"])));
45
40
  var libraries = ['places'];
46
41
  var stylesDefault = {
47
42
  position: 'relative',
@@ -77,7 +72,7 @@ var GGMap = function (_a) {
77
72
  }, {})) !== null && _a !== void 0 ? _a : {};
78
73
  return Object.values(coordMap).map(function (item, index, arr) {
79
74
  var _a;
80
- item.radius = ((_a = item.count) !== null && _a !== void 0 ? _a : 0) / arr.reduce(function (acc, item) { var _a; return acc + ((_a = item === null || item === void 0 ? void 0 : item.count) !== null && _a !== void 0 ? _a : 0); }, 0) * (Math.pow(2, 10 - (zoom))) * 10000;
75
+ item.radius = ((_a = item.count) !== null && _a !== void 0 ? _a : 0) / arr.reduce(function (acc, item) { var _a; return acc + ((_a = item === null || item === void 0 ? void 0 : item.count) !== null && _a !== void 0 ? _a : 0); }, 0) * (Math.pow(2, 10 - Math.max(zoom, 4))) * 8000;
81
76
  return item;
82
77
  });
83
78
  // Convert the object to an array
@@ -201,7 +196,7 @@ exports.default = GGMap;
201
196
  var Maprender = react_1.default.memo(function (_a) {
202
197
  var onLoadMap = _a.onLoadMap, onMapClick = _a.onMapClick, onZoomChanged = _a.onZoomChanged;
203
198
  var mapInstance = (0, react_1.useRef)(null);
204
- return (0, jsx_runtime_1.jsx)(api_1.GoogleMap, { id: "map", mapContainerStyle: { width: "100%", height: "".concat(521, "px") }, zoom: 2, center: {
199
+ return (0, jsx_runtime_1.jsx)(api_1.GoogleMap, { id: "map", mapContainerStyle: { width: "100%", height: "".concat(521, "px") }, zoom: 3, center: {
205
200
  lat: 21.0063107,
206
201
  lng: 105.8279467
207
202
  }, onZoomChanged: function () {
@@ -238,4 +233,3 @@ var MaprenderWithoutTracking = react_1.default.memo(function (_a) {
238
233
  strokeWeight: 2,
239
234
  } })] }) });
240
235
  });
241
- var templateObject_1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.199-dev",
3
+ "version": "2.1.201-dev",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",