ywana-core8 0.1.28 → 0.1.29
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/dist/index.cjs +2053 -1667
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +816 -799
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +2049 -1668
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +2053 -1667
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/widgets/login/dialogs.js +2 -2
package/dist/index.modern.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import 'material-design-icons-iconfont/dist/material-design-icons.css';
|
2
|
-
import React, { useContext, useState, useEffect, useCallback, Fragment,
|
2
|
+
import React, { useContext, useState, useEffect, useCallback, Fragment, Children, useMemo, useRef } from 'react';
|
3
3
|
import ResumableJS from 'resumablejs';
|
4
4
|
import { ReactNotifications, Store } from 'react-notifications-component';
|
5
5
|
import 'react-notifications-component/dist/theme.css';
|
@@ -40,7 +40,7 @@ function isEmpty(obj) {
|
|
40
40
|
return false;
|
41
41
|
}
|
42
42
|
|
43
|
-
function _catch$
|
43
|
+
function _catch$7(body, recover) {
|
44
44
|
try {
|
45
45
|
var result = body();
|
46
46
|
} catch (e) {
|
@@ -68,7 +68,7 @@ var fetchAsync = function fetchAsync(method, URL, body, token, headers) {
|
|
68
68
|
body: body
|
69
69
|
};
|
70
70
|
if (headers) request.headers = request.headers;
|
71
|
-
return Promise.resolve(_catch$
|
71
|
+
return Promise.resolve(_catch$7(function () {
|
72
72
|
return Promise.resolve(fetch(URL, request)).then(function (response) {
|
73
73
|
var _exit;
|
74
74
|
function _temp2(_result) {
|
@@ -203,7 +203,7 @@ var TEXTFORMATS = {
|
|
203
203
|
/**
|
204
204
|
* Text
|
205
205
|
*/
|
206
|
-
var Text = function Text(_ref) {
|
206
|
+
var Text$1 = function Text(_ref) {
|
207
207
|
var _ref$format = _ref.format,
|
208
208
|
format = _ref$format === void 0 ? TEXTFORMATS.HTML : _ref$format,
|
209
209
|
children = _ref.children,
|
@@ -262,7 +262,7 @@ var Tooltip = function Tooltip(props) {
|
|
262
262
|
}, /*#__PURE__*/React.createElement("span", {
|
263
263
|
className: "tooltip-text",
|
264
264
|
style: style
|
265
|
-
}, /*#__PURE__*/React.createElement(Text, null, text)), props.children);
|
265
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, text)), props.children);
|
266
266
|
};
|
267
267
|
|
268
268
|
/**
|
@@ -431,7 +431,7 @@ var Button = function Button(_ref) {
|
|
431
431
|
size: "small",
|
432
432
|
clickable: true,
|
433
433
|
action: click
|
434
|
-
}), /*#__PURE__*/React.createElement(Text, null, label));
|
434
|
+
}), /*#__PURE__*/React.createElement(Text$1, null, label));
|
435
435
|
};
|
436
436
|
|
437
437
|
/**
|
@@ -491,8 +491,8 @@ var CheckBox = function CheckBox(props) {
|
|
491
491
|
var value = event.target.checked;
|
492
492
|
if (onChange) onChange(id, value);
|
493
493
|
}
|
494
|
-
var labelTxt = /*#__PURE__*/React.createElement(Text, null, label);
|
495
|
-
var placeholderTxt = /*#__PURE__*/React.createElement(Text, null, placeholder);
|
494
|
+
var labelTxt = /*#__PURE__*/React.createElement(Text$1, null, label);
|
495
|
+
var placeholderTxt = /*#__PURE__*/React.createElement(Text$1, null, placeholder);
|
496
496
|
return value === true ? /*#__PURE__*/React.createElement("div", {
|
497
497
|
className: "checkbox",
|
498
498
|
key: id + "1"
|
@@ -549,7 +549,7 @@ var Chip = function Chip(props) {
|
|
549
549
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
550
550
|
icon: icon,
|
551
551
|
size: "small"
|
552
|
-
}) : null, /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement(Text, null, label)), action ? /*#__PURE__*/React.createElement("span", {
|
552
|
+
}) : null, /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement(Text$1, null, label)), action ? /*#__PURE__*/React.createElement("span", {
|
553
553
|
className: "meta"
|
554
554
|
}, action) : null)) : /*#__PURE__*/React.createElement("div", {
|
555
555
|
className: "chip " + className + " " + style,
|
@@ -557,7 +557,7 @@ var Chip = function Chip(props) {
|
|
557
557
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
558
558
|
icon: icon,
|
559
559
|
size: "small"
|
560
|
-
}) : null, /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement(Text, null, label)), action ? /*#__PURE__*/React.createElement("span", {
|
560
|
+
}) : null, /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement(Text$1, null, label)), action ? /*#__PURE__*/React.createElement("span", {
|
561
561
|
className: "meta"
|
562
562
|
}, action) : null);
|
563
563
|
};
|
@@ -660,7 +660,7 @@ var Form = function Form(_ref) {
|
|
660
660
|
};
|
661
661
|
return /*#__PURE__*/React.createElement(Fragment, null, title ? /*#__PURE__*/React.createElement("header", {
|
662
662
|
className: "form-header"
|
663
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
663
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
664
664
|
use: "headline6"
|
665
665
|
}, title)) : '', /*#__PURE__*/React.createElement("form", {
|
666
666
|
className: "form-grid",
|
@@ -701,7 +701,7 @@ var Header = function Header(props) {
|
|
701
701
|
var style = props.img ? {
|
702
702
|
backgroundImage: "url(" + props.img + ")"
|
703
703
|
} : {};
|
704
|
-
var title = /*#__PURE__*/React.createElement(Text, null, props.title);
|
704
|
+
var title = /*#__PURE__*/React.createElement(Text$1, null, props.title);
|
705
705
|
return /*#__PURE__*/React.createElement("header", {
|
706
706
|
className: "header " + caption + " " + prominent + " " + dense + " " + theme + " " + props.className,
|
707
707
|
style: style
|
@@ -765,7 +765,7 @@ var GroupedList = function GroupedList(props) {
|
|
765
765
|
return /*#__PURE__*/React.createElement("div", {
|
766
766
|
className: "list grouped"
|
767
767
|
}, groups.map(function (group) {
|
768
|
-
var groupTitle = groupRenderer ? groupRenderer(group) : /*#__PURE__*/React.createElement(Text, null, group.name);
|
768
|
+
var groupTitle = groupRenderer ? groupRenderer(group) : /*#__PURE__*/React.createElement(Text$1, null, group.name);
|
769
769
|
return /*#__PURE__*/React.createElement(Fragment, {
|
770
770
|
key: group.name
|
771
771
|
}, /*#__PURE__*/React.createElement("header", {
|
@@ -810,9 +810,9 @@ var ListItem = function ListItem(_ref) {
|
|
810
810
|
tooltip: iconTooltip
|
811
811
|
}) : null, /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement("div", {
|
812
812
|
className: "primary-line"
|
813
|
-
}, /*#__PURE__*/React.createElement(Text, null, line1)), line2 ? /*#__PURE__*/React.createElement("div", {
|
813
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, line1)), line2 ? /*#__PURE__*/React.createElement("div", {
|
814
814
|
className: "secondary-line"
|
815
|
-
}, /*#__PURE__*/React.createElement(Text, null, line2)) : null), meta ? /*#__PURE__*/React.createElement("div", {
|
815
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, line2)) : null), meta ? /*#__PURE__*/React.createElement("div", {
|
816
816
|
className: "meta"
|
817
817
|
}, meta) : null);
|
818
818
|
};
|
@@ -884,7 +884,7 @@ var MenuItem = function MenuItem(props) {
|
|
884
884
|
}
|
885
885
|
}
|
886
886
|
var style = disabled ? "disabled" : "";
|
887
|
-
var labelTxt = label ? /*#__PURE__*/React.createElement(Text, {
|
887
|
+
var labelTxt = label ? /*#__PURE__*/React.createElement(Text$1, {
|
888
888
|
format: TEXTFORMATS.STRING
|
889
889
|
}, label) : null;
|
890
890
|
return /*#__PURE__*/React.createElement("li", {
|
@@ -969,7 +969,7 @@ var Property = function Property(props) {
|
|
969
969
|
className: "property property-" + id + " " + className
|
970
970
|
}, /*#__PURE__*/React.createElement("div", {
|
971
971
|
className: "property-name"
|
972
|
-
}, /*#__PURE__*/React.createElement(Text, null, name || label)), /*#__PURE__*/React.createElement("div", {
|
972
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, name || label)), /*#__PURE__*/React.createElement("div", {
|
973
973
|
className: "property-value"
|
974
974
|
}, editable ? /*#__PURE__*/React.createElement("input", {
|
975
975
|
type: "text",
|
@@ -997,7 +997,7 @@ var RadioButton = function RadioButton(props) {
|
|
997
997
|
var value = event.target.value;
|
998
998
|
if (onChange) onChange(id, value);
|
999
999
|
}
|
1000
|
-
var labelTxt = /*#__PURE__*/React.createElement(Text, null, label);
|
1000
|
+
var labelTxt = /*#__PURE__*/React.createElement(Text$1, null, label);
|
1001
1001
|
return /*#__PURE__*/React.createElement("div", {
|
1002
1002
|
className: "radio"
|
1003
1003
|
}, /*#__PURE__*/React.createElement("input", {
|
@@ -1096,7 +1096,7 @@ var Tab = function Tab(props) {
|
|
1096
1096
|
if (onSelect) onSelect(id);
|
1097
1097
|
}
|
1098
1098
|
var style = selected ? "selected" : "";
|
1099
|
-
var labelTxt = label ? /*#__PURE__*/React.createElement(Text, {
|
1099
|
+
var labelTxt = label ? /*#__PURE__*/React.createElement(Text$1, {
|
1100
1100
|
format: TEXTFORMATS.STRING
|
1101
1101
|
}, label) : null;
|
1102
1102
|
return /*#__PURE__*/React.createElement("div", {
|
@@ -1401,7 +1401,7 @@ var TextField = function TextField(props) {
|
|
1401
1401
|
var labelStyle = label ? "" : "no-label";
|
1402
1402
|
var labelPositionStyle = labelPosition == 'left' ? "label-left" : "label-top";
|
1403
1403
|
var style = labelStyle + " " + labelPositionStyle + " " + borderStyle + " textfield-" + type;
|
1404
|
-
var labelTxt = /*#__PURE__*/React.createElement(Text, null, label);
|
1404
|
+
var labelTxt = /*#__PURE__*/React.createElement(Text$1, null, label);
|
1405
1405
|
var placeholderTxt = site.translate ? site.translate(placeholder) : placeholder;
|
1406
1406
|
return /*#__PURE__*/React.createElement("div", {
|
1407
1407
|
className: style + " " + id + " " + className,
|
@@ -1479,7 +1479,7 @@ var TextArea = function TextArea(props) {
|
|
1479
1479
|
}
|
1480
1480
|
var labelStyle = label ? "" : "no-label";
|
1481
1481
|
var style = "textarea " + labelStyle + " textarea-" + type;
|
1482
|
-
var labelTxt = /*#__PURE__*/React.createElement(Text, null, label);
|
1482
|
+
var labelTxt = /*#__PURE__*/React.createElement(Text$1, null, label);
|
1483
1483
|
var placeholderTxt = site.translate ? site.translate(placeholder) : placeholder;
|
1484
1484
|
return /*#__PURE__*/React.createElement("div", {
|
1485
1485
|
className: "" + style,
|
@@ -1596,7 +1596,7 @@ var DropDown = function DropDown(props) {
|
|
1596
1596
|
}, option.icon ? /*#__PURE__*/React.createElement(Icon, {
|
1597
1597
|
icon: option.icon,
|
1598
1598
|
size: "small"
|
1599
|
-
}) : '', /*#__PURE__*/React.createElement(Text, null, option.label));
|
1599
|
+
}) : '', /*#__PURE__*/React.createElement(Text$1, null, option.label));
|
1600
1600
|
});
|
1601
1601
|
return /*#__PURE__*/React.createElement("menu", {
|
1602
1602
|
className: position
|
@@ -1650,7 +1650,7 @@ var DateRange = function DateRange(props) {
|
|
1650
1650
|
var next = Object.assign({}, form, (_Object$assign = {}, _Object$assign[id] = value, _Object$assign));
|
1651
1651
|
setForm(next);
|
1652
1652
|
}
|
1653
|
-
var labelTxt = label ? /*#__PURE__*/React.createElement(Text, null, label) : null;
|
1653
|
+
var labelTxt = label ? /*#__PURE__*/React.createElement(Text$1, null, label) : null;
|
1654
1654
|
return /*#__PURE__*/React.createElement("div", {
|
1655
1655
|
className: "date-range"
|
1656
1656
|
}, label ? /*#__PURE__*/React.createElement("label", null, labelTxt) : null, /*#__PURE__*/React.createElement(TextField, {
|
@@ -1678,7 +1678,7 @@ var PasswordField = function PasswordField(props) {
|
|
1678
1678
|
function toggle() {
|
1679
1679
|
setShow(!show);
|
1680
1680
|
}
|
1681
|
-
var labelTxt = label ? /*#__PURE__*/React.createElement(Text, null, label) : null;
|
1681
|
+
var labelTxt = label ? /*#__PURE__*/React.createElement(Text$1, null, label) : null;
|
1682
1682
|
return /*#__PURE__*/React.createElement("div", {
|
1683
1683
|
className: "password-field"
|
1684
1684
|
}, /*#__PURE__*/React.createElement(TextField, {
|
@@ -1736,7 +1736,7 @@ var LoginBox = function LoginBox(_ref) {
|
|
1736
1736
|
if (onForgot) onForgot(user);
|
1737
1737
|
}
|
1738
1738
|
function tx(txt) {
|
1739
|
-
return /*#__PURE__*/React.createElement(Text, null, txt);
|
1739
|
+
return /*#__PURE__*/React.createElement(Text$1, null, txt);
|
1740
1740
|
}
|
1741
1741
|
function changeUser(id, value) {
|
1742
1742
|
setUser(value);
|
@@ -1750,7 +1750,7 @@ var LoginBox = function LoginBox(_ref) {
|
|
1750
1750
|
src: logo
|
1751
1751
|
}) : '', /*#__PURE__*/React.createElement("div", {
|
1752
1752
|
className: "title"
|
1753
|
-
}, /*#__PURE__*/React.createElement(Text, null, title))), /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement(TextField, {
|
1753
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, title))), /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement(TextField, {
|
1754
1754
|
label: tx(userLabel),
|
1755
1755
|
value: user,
|
1756
1756
|
onChange: changeUser,
|
@@ -1783,7 +1783,7 @@ var LoginBox = function LoginBox(_ref) {
|
|
1783
1783
|
className: "forgot-button"
|
1784
1784
|
}) : null, message ? /*#__PURE__*/React.createElement("div", {
|
1785
1785
|
className: "message"
|
1786
|
-
}, /*#__PURE__*/React.createElement(Text, null, message)) : null));
|
1786
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, message)) : null));
|
1787
1787
|
};
|
1788
1788
|
|
1789
1789
|
function validatePassword(contraseña) {
|
@@ -1936,20 +1936,19 @@ var ResetPasswordBox = function ResetPasswordBox(_ref) {
|
|
1936
1936
|
onOK(form);
|
1937
1937
|
}
|
1938
1938
|
}
|
1939
|
-
var userLabel = /*#__PURE__*/React.createElement(Text, null, "User");
|
1940
|
-
var passwordLabel = /*#__PURE__*/React.createElement(Text, null, "New Password");
|
1941
|
-
var password2Label = /*#__PURE__*/React.createElement(Text, null, "Confirm New Password");
|
1942
|
-
var okLabel = /*#__PURE__*/React.createElement(Text, null, "OK");
|
1939
|
+
var userLabel = /*#__PURE__*/React.createElement(Text$1, null, "User");
|
1940
|
+
var passwordLabel = /*#__PURE__*/React.createElement(Text$1, null, "New Password");
|
1941
|
+
var password2Label = /*#__PURE__*/React.createElement(Text$1, null, "Confirm New Password");
|
1942
|
+
var okLabel = /*#__PURE__*/React.createElement(Text$1, null, "OK");
|
1943
1943
|
var userStyle = errors.user ? "error" : "";
|
1944
1944
|
var oldPasswordStyle = errors.oldPassword ? "error" : "";
|
1945
1945
|
var password1Style = errors.password1 ? "error" : "";
|
1946
1946
|
var password2Style = errors.password2 ? "error" : "";
|
1947
|
-
console.log("ResetPasswordBox", errors);
|
1948
1947
|
return /*#__PURE__*/React.createElement("div", {
|
1949
1948
|
className: "reset-password-box"
|
1950
1949
|
}, /*#__PURE__*/React.createElement("header", null, title ? /*#__PURE__*/React.createElement("div", {
|
1951
1950
|
className: "title"
|
1952
|
-
}, /*#__PURE__*/React.createElement(Text, null, title)) : null), /*#__PURE__*/React.createElement("main", {
|
1951
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, title)) : null), /*#__PURE__*/React.createElement("main", {
|
1953
1952
|
className: "reset-password-form"
|
1954
1953
|
}, userRequired ? /*#__PURE__*/React.createElement(TextField, {
|
1955
1954
|
id: "user",
|
@@ -1962,19 +1961,19 @@ var ResetPasswordBox = function ResetPasswordBox(_ref) {
|
|
1962
1961
|
onEnter: ok
|
1963
1962
|
}) : null, userRequired ? errors.user ? /*#__PURE__*/React.createElement("div", {
|
1964
1963
|
className: "error-message"
|
1965
|
-
}, /*#__PURE__*/React.createElement(Text, null, errors.user)) : null : null, oldPwdRequired ? /*#__PURE__*/React.createElement(TextField, {
|
1964
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, errors.user)) : null : null, oldPwdRequired ? /*#__PURE__*/React.createElement(TextField, {
|
1966
1965
|
id: "oldPassword",
|
1967
1966
|
className: oldPasswordStyle,
|
1968
1967
|
outlined: true,
|
1969
1968
|
icon: "lock",
|
1970
1969
|
type: "password",
|
1971
|
-
label: "
|
1970
|
+
label: "Current Password",
|
1972
1971
|
lapse: 100,
|
1973
1972
|
onChange: changeField,
|
1974
1973
|
onEnter: ok
|
1975
1974
|
}) : null, oldPwdRequired ? errors.oldPassword ? /*#__PURE__*/React.createElement("div", {
|
1976
1975
|
className: "error-message"
|
1977
|
-
}, /*#__PURE__*/React.createElement(Text, null, errors.oldPassword)) : null : null, /*#__PURE__*/React.createElement(TextField, {
|
1976
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, errors.oldPassword)) : null : null, /*#__PURE__*/React.createElement(TextField, {
|
1978
1977
|
id: "password1",
|
1979
1978
|
className: password1Style,
|
1980
1979
|
outlined: true,
|
@@ -1986,7 +1985,7 @@ var ResetPasswordBox = function ResetPasswordBox(_ref) {
|
|
1986
1985
|
onEnter: ok
|
1987
1986
|
}), errors.password1 ? /*#__PURE__*/React.createElement("div", {
|
1988
1987
|
className: "error-message"
|
1989
|
-
}, /*#__PURE__*/React.createElement(Text, null, errors.password1)) : null, children, /*#__PURE__*/React.createElement(TextField, {
|
1988
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, errors.password1)) : null, children, /*#__PURE__*/React.createElement(TextField, {
|
1990
1989
|
id: "password2",
|
1991
1990
|
className: password2Style,
|
1992
1991
|
outlined: true,
|
@@ -1998,7 +1997,7 @@ var ResetPasswordBox = function ResetPasswordBox(_ref) {
|
|
1998
1997
|
onEnter: ok
|
1999
1998
|
}), errors.password2 ? /*#__PURE__*/React.createElement("div", {
|
2000
1999
|
className: "error-message"
|
2001
|
-
}, /*#__PURE__*/React.createElement(Text, null, errors.password2)) : null), /*#__PURE__*/React.createElement("footer", null, /*#__PURE__*/React.createElement(Button, {
|
2000
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, errors.password2)) : null), /*#__PURE__*/React.createElement("footer", null, /*#__PURE__*/React.createElement(Button, {
|
2002
2001
|
label: okLabel,
|
2003
2002
|
raised: true,
|
2004
2003
|
disabled: !isValid,
|
@@ -2006,1763 +2005,2146 @@ var ResetPasswordBox = function ResetPasswordBox(_ref) {
|
|
2006
2005
|
})));
|
2007
2006
|
};
|
2008
2007
|
|
2009
|
-
|
2010
|
-
|
2011
|
-
|
2012
|
-
var
|
2013
|
-
var image = _ref.image;
|
2014
|
-
var _useState = useState({
|
2015
|
-
x: 0,
|
2016
|
-
y: 0
|
2017
|
-
}),
|
2018
|
-
offset = _useState[0],
|
2019
|
-
setOffset = _useState[1];
|
2020
|
-
var _useState2 = useState(1),
|
2021
|
-
zoom = _useState2[0],
|
2022
|
-
setZoom = _useState2[1];
|
2023
|
-
var _useState3 = useState(false),
|
2024
|
-
draggind = _useState3[0],
|
2025
|
-
setDragging = _useState3[1];
|
2026
|
-
var touch = useRef({
|
2027
|
-
x: 0,
|
2028
|
-
y: 0
|
2029
|
-
});
|
2030
|
-
var canvasRef = useRef(null);
|
2031
|
-
var containerRef = useRef(null);
|
2032
|
-
var observer = useRef(null);
|
2033
|
-
var background = useMemo(function () {
|
2034
|
-
return new Image();
|
2035
|
-
}, [image]);
|
2036
|
-
var clamp = function clamp(num, min, max) {
|
2037
|
-
return Math.min(Math.max(num, min), max);
|
2038
|
-
};
|
2039
|
-
var handleWheel = function handleWheel(event) {
|
2040
|
-
var deltaY = event.deltaY;
|
2041
|
-
if (!draggind) {
|
2042
|
-
setZoom(function (zoom) {
|
2043
|
-
return clamp(zoom + deltaY * SCROLL_SENSITIVITY * -1, MIN_ZOOM, MAX_ZOOM);
|
2044
|
-
});
|
2045
|
-
}
|
2046
|
-
};
|
2047
|
-
var handleMouseMove = function handleMouseMove(event) {
|
2048
|
-
if (draggind) {
|
2049
|
-
var _touch$current = touch.current,
|
2050
|
-
x = _touch$current.x,
|
2051
|
-
y = _touch$current.y;
|
2052
|
-
var clientX = event.clientX,
|
2053
|
-
clientY = event.clientY;
|
2054
|
-
setOffset({
|
2055
|
-
x: offset.x + (x - clientX),
|
2056
|
-
y: offset.y + (y - clientY)
|
2057
|
-
});
|
2058
|
-
touch.current = {
|
2059
|
-
x: clientX,
|
2060
|
-
y: clientY
|
2061
|
-
};
|
2062
|
-
}
|
2063
|
-
};
|
2064
|
-
var handleMouseDown = function handleMouseDown(event) {
|
2065
|
-
var clientX = event.clientX,
|
2066
|
-
clientY = event.clientY;
|
2067
|
-
touch.current = {
|
2068
|
-
x: clientX,
|
2069
|
-
y: clientY
|
2070
|
-
};
|
2071
|
-
setDragging(true);
|
2072
|
-
};
|
2073
|
-
var handleMouseUp = function handleMouseUp() {
|
2074
|
-
return setDragging(false);
|
2075
|
-
};
|
2076
|
-
var draw = function draw() {
|
2077
|
-
if (canvasRef.current) {
|
2078
|
-
var _canvasRef$current = canvasRef.current,
|
2079
|
-
width = _canvasRef$current.width,
|
2080
|
-
height = _canvasRef$current.height;
|
2081
|
-
var context = canvasRef.current.getContext("2d");
|
2082
|
-
|
2083
|
-
// Set canvas dimensions
|
2084
|
-
canvasRef.current.width = width;
|
2085
|
-
canvasRef.current.height = height;
|
2086
|
-
|
2087
|
-
// Clear canvas and scale it
|
2088
|
-
context.translate(-offset.x, -offset.y);
|
2089
|
-
context.scale(zoom, zoom);
|
2090
|
-
context.clearRect(0, 0, width, height);
|
2091
|
-
|
2092
|
-
// Make sure we're zooming to the center
|
2093
|
-
var x = (context.canvas.width / zoom - background.width) / 2;
|
2094
|
-
var y = (context.canvas.height / zoom - background.height) / 2;
|
2095
|
-
|
2096
|
-
// Draw image
|
2097
|
-
context.drawImage(background, x, y);
|
2098
|
-
}
|
2099
|
-
};
|
2100
|
-
useEffect(function () {
|
2101
|
-
observer.current = new ResizeObserver(function (entries) {
|
2102
|
-
entries.forEach(function (_ref2) {
|
2103
|
-
var target = _ref2.target;
|
2104
|
-
var width = background.width,
|
2105
|
-
height = background.height;
|
2106
|
-
// If width of the container is smaller than image, scale image down
|
2107
|
-
if (target.clientWidth < width) {
|
2108
|
-
// Calculate scale
|
2109
|
-
var scale = target.clientWidth / width;
|
2110
|
-
|
2111
|
-
// Redraw image
|
2112
|
-
canvasRef.current.width = width * scale;
|
2113
|
-
canvasRef.current.height = height * scale;
|
2114
|
-
canvasRef.current.getContext("2d").drawImage(background, 0, 0, width * scale, height * scale);
|
2115
|
-
}
|
2116
|
-
});
|
2117
|
-
});
|
2118
|
-
observer.current.observe(containerRef.current);
|
2119
|
-
return function () {
|
2120
|
-
return observer.current.unobserve(containerRef.current);
|
2121
|
-
};
|
2122
|
-
}, []);
|
2123
|
-
useEffect(function () {
|
2124
|
-
background.src = image;
|
2125
|
-
if (canvasRef.current) {
|
2126
|
-
background.onload = function () {
|
2127
|
-
// Get the image dimensions
|
2128
|
-
var width = background.width,
|
2129
|
-
height = background.height;
|
2130
|
-
canvasRef.current.width = width;
|
2131
|
-
canvasRef.current.height = height;
|
2008
|
+
/**
|
2009
|
+
* Page Context
|
2010
|
+
*/
|
2011
|
+
var PageContext = React.createContext({});
|
2132
2012
|
|
2133
|
-
|
2134
|
-
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2138
|
-
|
2139
|
-
|
2140
|
-
|
2141
|
-
|
2142
|
-
|
2143
|
-
|
2144
|
-
|
2145
|
-
|
2146
|
-
onMouseUp: handleMouseUp,
|
2147
|
-
onWheel: handleWheel,
|
2148
|
-
onMouseMove: handleMouseMove,
|
2149
|
-
ref: canvasRef
|
2150
|
-
}));
|
2013
|
+
/**
|
2014
|
+
* Page Provider
|
2015
|
+
*/
|
2016
|
+
var PageProvider = function PageProvider(_ref) {
|
2017
|
+
var _ref$context = _ref.context,
|
2018
|
+
context = _ref$context === void 0 ? {} : _ref$context,
|
2019
|
+
children = _ref.children;
|
2020
|
+
var _useState = useState(context),
|
2021
|
+
pageCtx = _useState[0],
|
2022
|
+
setPageCtx = _useState[1];
|
2023
|
+
return /*#__PURE__*/React.createElement(PageContext.Provider, {
|
2024
|
+
value: [pageCtx, setPageCtx]
|
2025
|
+
}, children);
|
2151
2026
|
};
|
2152
2027
|
|
2153
2028
|
/**
|
2154
|
-
*
|
2029
|
+
* Page
|
2155
2030
|
*/
|
2156
|
-
var
|
2157
|
-
var
|
2158
|
-
|
2159
|
-
|
2160
|
-
|
2161
|
-
|
2162
|
-
|
2163
|
-
|
2164
|
-
|
2165
|
-
|
2166
|
-
|
2167
|
-
|
2168
|
-
function toggleDetails() {
|
2169
|
-
setShowDetails(!showDetails);
|
2170
|
-
}
|
2171
|
-
var headerTitle = /*#__PURE__*/React.createElement(Text, {
|
2172
|
-
use: "headline6"
|
2173
|
-
}, title);
|
2174
|
-
return /*#__PURE__*/React.createElement("div", {
|
2175
|
-
className: "viewer"
|
2176
|
-
}, /*#__PURE__*/React.createElement(Header, {
|
2177
|
-
icon: "view",
|
2178
|
-
title: headerTitle
|
2179
|
-
}, onClose ? /*#__PURE__*/React.createElement(Icon, {
|
2180
|
-
icon: "close",
|
2181
|
-
clickable: true,
|
2182
|
-
action: onClose
|
2183
|
-
}) : null, showDetails ? '' : /*#__PURE__*/React.createElement(Icon, {
|
2184
|
-
icon: "info",
|
2185
|
-
clickable: true,
|
2186
|
-
action: toggleDetails
|
2187
|
-
}), actions), /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement("div", {
|
2188
|
-
className: "resizer"
|
2189
|
-
}, /*#__PURE__*/React.createElement("picture", null, /*#__PURE__*/React.createElement(ImageViewer, {
|
2190
|
-
image: src
|
2191
|
-
})))), /*#__PURE__*/React.createElement("aside", {
|
2192
|
-
className: "" + (showDetails ? 'open' : '')
|
2193
|
-
}, /*#__PURE__*/React.createElement(Header, {
|
2194
|
-
title: "Detalles"
|
2195
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
2196
|
-
icon: "close",
|
2197
|
-
clickable: true,
|
2198
|
-
action: toggleDetails
|
2199
|
-
})), /*#__PURE__*/React.createElement("main", null, info)), tools ? /*#__PURE__*/React.createElement("footer", null, /*#__PURE__*/React.createElement(Icon, {
|
2200
|
-
clickable: true,
|
2201
|
-
icon: "zoom_out"
|
2202
|
-
}), /*#__PURE__*/React.createElement(Icon, {
|
2203
|
-
clickable: true,
|
2204
|
-
icon: "zoom_out_map"
|
2205
|
-
}), /*#__PURE__*/React.createElement(Icon, {
|
2206
|
-
clickable: true,
|
2207
|
-
icon: "zoom_in"
|
2208
|
-
})) : null);
|
2031
|
+
var Page = function Page(props) {
|
2032
|
+
var children = props.children,
|
2033
|
+
_props$layout = props.layout,
|
2034
|
+
layout = _props$layout === void 0 ? "simple" : _props$layout,
|
2035
|
+
_props$context = props.context,
|
2036
|
+
context = _props$context === void 0 ? {} : _props$context,
|
2037
|
+
className = props.className;
|
2038
|
+
return /*#__PURE__*/React.createElement(PageProvider, {
|
2039
|
+
context: context
|
2040
|
+
}, /*#__PURE__*/React.createElement("article", {
|
2041
|
+
className: "page6 " + layout + " " + className
|
2042
|
+
}, children));
|
2209
2043
|
};
|
2210
2044
|
|
2211
2045
|
/**
|
2212
|
-
*
|
2046
|
+
* Site Provider
|
2213
2047
|
*/
|
2214
|
-
var
|
2215
|
-
var children = _ref.children
|
2216
|
-
|
2217
|
-
|
2218
|
-
|
2219
|
-
|
2220
|
-
|
2221
|
-
|
2222
|
-
|
2223
|
-
|
2224
|
-
var
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
2228
|
-
|
2229
|
-
|
2230
|
-
var
|
2231
|
-
|
2232
|
-
|
2233
|
-
|
2234
|
-
|
2235
|
-
|
2236
|
-
|
2237
|
-
|
2238
|
-
|
2239
|
-
|
2240
|
-
|
2241
|
-
|
2242
|
-
|
2243
|
-
|
2244
|
-
|
2245
|
-
|
2246
|
-
|
2247
|
-
|
2248
|
-
|
2249
|
-
|
2250
|
-
|
2251
|
-
|
2252
|
-
|
2253
|
-
|
2048
|
+
var SiteProvider = function SiteProvider(_ref) {
|
2049
|
+
var children = _ref.children,
|
2050
|
+
siteLang = _ref.siteLang,
|
2051
|
+
siteDictionary = _ref.siteDictionary;
|
2052
|
+
var _useState = useState(siteLang),
|
2053
|
+
lang = _useState[0],
|
2054
|
+
setLang = _useState[1];
|
2055
|
+
var _useState2 = useState(siteDictionary),
|
2056
|
+
dictionary = _useState2[0],
|
2057
|
+
setDictionary = _useState2[1];
|
2058
|
+
var _useState3 = useState('max'),
|
2059
|
+
sideNav = _useState3[0],
|
2060
|
+
setSideNav = _useState3[1];
|
2061
|
+
var _useState4 = useState(false),
|
2062
|
+
showNav = _useState4[0],
|
2063
|
+
setShowNav = _useState4[1];
|
2064
|
+
var _useState5 = useState(null),
|
2065
|
+
info = _useState5[0],
|
2066
|
+
setInfo = _useState5[1];
|
2067
|
+
var _useState6 = useState(false),
|
2068
|
+
showConsole = _useState6[0],
|
2069
|
+
setShowConsole = _useState6[1];
|
2070
|
+
var _useState7 = useState([]),
|
2071
|
+
consoleLines = _useState7[0],
|
2072
|
+
setConsoleLines = _useState7[1];
|
2073
|
+
var _useState8 = useState(),
|
2074
|
+
page = _useState8[0],
|
2075
|
+
setPage = _useState8[1];
|
2076
|
+
var _useState9 = useState(),
|
2077
|
+
dialog = _useState9[0],
|
2078
|
+
setDialog = _useState9[1];
|
2079
|
+
var _useState10 = useState(),
|
2080
|
+
promptDialog = _useState10[0],
|
2081
|
+
setPromptDialog = _useState10[1];
|
2082
|
+
var _useState11 = useState(),
|
2083
|
+
preview = _useState11[0],
|
2084
|
+
setPreview = _useState11[1];
|
2085
|
+
var _useState12 = useState(),
|
2086
|
+
breadcrumb = _useState12[0],
|
2087
|
+
setBreadcrumb = _useState12[1];
|
2088
|
+
var value = {
|
2089
|
+
lang: lang,
|
2090
|
+
setLang: setLang,
|
2091
|
+
dictionary: dictionary,
|
2092
|
+
setDictionary: setDictionary,
|
2093
|
+
translate: function translate(key) {
|
2094
|
+
if (!key) return key;
|
2095
|
+
if (dictionary === undefined) return key;
|
2096
|
+
var term = dictionary[key];
|
2097
|
+
return term ? term[lang] : key;
|
2098
|
+
},
|
2099
|
+
sideNav: sideNav,
|
2100
|
+
setSideNav: setSideNav,
|
2101
|
+
showNav: showNav,
|
2102
|
+
setShowNav: setShowNav,
|
2103
|
+
info: info,
|
2104
|
+
openInfo: function openInfo(info) {
|
2105
|
+
setInfo(info);
|
2106
|
+
},
|
2107
|
+
closeInfo: function closeInfo() {
|
2108
|
+
setInfo(null);
|
2109
|
+
},
|
2110
|
+
consoleLines: consoleLines,
|
2111
|
+
showConsole: showConsole,
|
2112
|
+
toggleConsole: function toggleConsole() {
|
2113
|
+
setShowConsole(!showConsole);
|
2114
|
+
},
|
2115
|
+
writeLog: function writeLog(line) {
|
2116
|
+
var next = consoleLines.concat(line);
|
2117
|
+
setConsoleLines(next);
|
2118
|
+
},
|
2119
|
+
clearLog: function clearLog() {
|
2120
|
+
setConsoleLines([]);
|
2121
|
+
},
|
2122
|
+
breadcrumb: breadcrumb,
|
2123
|
+
setBreadcrumb: setBreadcrumb,
|
2124
|
+
page: page,
|
2125
|
+
"goto": function goto(id) {
|
2126
|
+
setPage(id);
|
2127
|
+
},
|
2128
|
+
dialog: dialog,
|
2129
|
+
openDialog: function openDialog(dialog) {
|
2130
|
+
setDialog(dialog);
|
2131
|
+
},
|
2132
|
+
closeDialog: function closeDialog() {
|
2133
|
+
setDialog(null);
|
2134
|
+
},
|
2135
|
+
preview: preview,
|
2136
|
+
openPreview: function openPreview(preview) {
|
2137
|
+
setPreview(preview);
|
2138
|
+
},
|
2139
|
+
closePreview: function closePreview() {
|
2140
|
+
setPreview(null);
|
2141
|
+
},
|
2142
|
+
confirm: function confirm(message) {
|
2143
|
+
return window.confirm(message);
|
2144
|
+
},
|
2145
|
+
prompt: function prompt(message) {
|
2146
|
+
return window.prompt(message);
|
2147
|
+
},
|
2148
|
+
promptDialog: promptDialog,
|
2149
|
+
openPromptDialog: function openPromptDialog(dialog) {
|
2150
|
+
setPromptDialog(dialog);
|
2151
|
+
},
|
2152
|
+
closePromptDialog: function closePromptDialog() {
|
2153
|
+
setPromptDialog(null);
|
2154
|
+
},
|
2155
|
+
notify: function notify(_ref2) {
|
2156
|
+
var title = _ref2.title,
|
2157
|
+
body = _ref2.body,
|
2158
|
+
_ref2$type = _ref2.type,
|
2159
|
+
type = _ref2$type === void 0 ? "success" : _ref2$type,
|
2160
|
+
_ref2$duration = _ref2.duration,
|
2161
|
+
duration = _ref2$duration === void 0 ? 3000 : _ref2$duration,
|
2162
|
+
onRemoval = _ref2.onRemoval;
|
2163
|
+
Store.addNotification({
|
2164
|
+
title: title,
|
2165
|
+
message: body,
|
2166
|
+
type: type,
|
2167
|
+
insert: "top",
|
2168
|
+
container: "top-right",
|
2169
|
+
animationIn: ["animate__animated", "animate__fadeIn"],
|
2170
|
+
animationOut: ["animate__animated", "animate__fadeOut"],
|
2171
|
+
dismiss: {
|
2172
|
+
duration: duration,
|
2173
|
+
onScreen: true
|
2174
|
+
},
|
2175
|
+
onRemoval: onRemoval
|
2176
|
+
});
|
2177
|
+
}
|
2178
|
+
};
|
2179
|
+
return /*#__PURE__*/React.createElement(SiteContext.Provider, {
|
2180
|
+
value: value
|
2181
|
+
}, children);
|
2254
2182
|
};
|
2255
|
-
var KanbanSwimlane = function KanbanSwimlane(_ref2) {
|
2256
|
-
var icon = _ref2.icon,
|
2257
|
-
title = _ref2.title,
|
2258
|
-
subtitle = _ref2.subtitle,
|
2259
|
-
badge = _ref2.badge,
|
2260
|
-
children = _ref2.children;
|
2261
|
-
var _useState = useState(true),
|
2262
|
-
unfold = _useState[0],
|
2263
|
-
setUnfold = _useState[1];
|
2264
2183
|
|
2265
|
-
|
2266
|
-
|
2267
|
-
|
2268
|
-
|
2269
|
-
|
2270
|
-
|
2271
|
-
|
2272
|
-
|
2273
|
-
|
2274
|
-
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2184
|
+
/**
|
2185
|
+
* Site
|
2186
|
+
*/
|
2187
|
+
var Site = function Site(_ref3) {
|
2188
|
+
var icon = _ref3.icon,
|
2189
|
+
iconSrc = _ref3.iconSrc,
|
2190
|
+
title = _ref3.title,
|
2191
|
+
toolbar = _ref3.toolbar,
|
2192
|
+
footer = _ref3.footer,
|
2193
|
+
children = _ref3.children,
|
2194
|
+
init = _ref3.init,
|
2195
|
+
min = _ref3.min,
|
2196
|
+
lang = _ref3.lang,
|
2197
|
+
dictionary = _ref3.dictionary;
|
2198
|
+
return /*#__PURE__*/React.createElement(SiteProvider, {
|
2199
|
+
siteLang: lang,
|
2200
|
+
siteDictionary: dictionary
|
2201
|
+
}, /*#__PURE__*/React.createElement("div", {
|
2202
|
+
className: "site6"
|
2203
|
+
}, /*#__PURE__*/React.createElement(SiteHeader, {
|
2204
|
+
icon: icon,
|
2205
|
+
iconSrc: iconSrc,
|
2206
|
+
title: title
|
2207
|
+
}), /*#__PURE__*/React.createElement(SiteToolBar, null, toolbar), /*#__PURE__*/React.createElement(SiteMenu, {
|
2208
|
+
iconSrc: iconSrc,
|
2209
|
+
title: title,
|
2210
|
+
min: min
|
2211
|
+
}, children), /*#__PURE__*/React.createElement(SitePage, {
|
2212
|
+
init: init
|
2213
|
+
}, children, /*#__PURE__*/React.createElement(Page, {
|
2214
|
+
id: "EMPTY"
|
2215
|
+
}, "EMPTY")), /*#__PURE__*/React.createElement(SiteAside, null), /*#__PURE__*/React.createElement(SiteConsole, null), /*#__PURE__*/React.createElement(SiteDialog, null), /*#__PURE__*/React.createElement(SitePromptDialog, null), /*#__PURE__*/React.createElement(SitePreview, null), /*#__PURE__*/React.createElement(SiteNotifications, null), /*#__PURE__*/React.createElement(SiteFooter, null, footer)));
|
2216
|
+
};
|
2217
|
+
var SiteNotifications = function SiteNotifications() {
|
2218
|
+
return /*#__PURE__*/React.createElement(ReactNotifications, null);
|
2219
|
+
};
|
2278
2220
|
|
2279
|
-
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2284
|
-
|
2285
|
-
|
2286
|
-
|
2287
|
-
|
2288
|
-
return /*#__PURE__*/React.createElement("div", {
|
2289
|
-
className: "kanban-swimlane"
|
2290
|
-
}, /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement(Icon, {
|
2221
|
+
/**
|
2222
|
+
* Site Header
|
2223
|
+
*/
|
2224
|
+
var SiteHeader = function SiteHeader(props) {
|
2225
|
+
var _props$icon = props.icon,
|
2226
|
+
icon = _props$icon === void 0 ? "equalizer" : _props$icon,
|
2227
|
+
iconSrc = props.iconSrc,
|
2228
|
+
title = props.title;
|
2229
|
+
return /*#__PURE__*/React.createElement(Header, {
|
2291
2230
|
icon: icon,
|
2292
|
-
|
2293
|
-
|
2294
|
-
|
2295
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
2296
|
-
use: "headline6"
|
2297
|
-
}, title, ":"), /*#__PURE__*/React.createElement(Text, {
|
2298
|
-
className: "secondary-text",
|
2299
|
-
use: "body2"
|
2300
|
-
}, subtitle)), /*#__PURE__*/React.createElement("div", {
|
2301
|
-
className: "badge"
|
2302
|
-
}, badge), /*#__PURE__*/React.createElement(Icon, {
|
2303
|
-
icon: toggleIcon,
|
2304
|
-
clickable: true,
|
2305
|
-
action: toggle
|
2306
|
-
})), /*#__PURE__*/React.createElement("main", {
|
2307
|
-
className: toggleStyle
|
2308
|
-
}, children));
|
2231
|
+
iconSrc: iconSrc,
|
2232
|
+
title: title
|
2233
|
+
});
|
2309
2234
|
};
|
2310
2235
|
|
2311
2236
|
/**
|
2312
|
-
*
|
2237
|
+
* Site ToolBar
|
2313
2238
|
*/
|
2314
|
-
var
|
2315
|
-
var
|
2316
|
-
|
2317
|
-
_ref3$headless = _ref3.headless,
|
2318
|
-
headless = _ref3$headless === void 0 ? false : _ref3$headless,
|
2319
|
-
icon = _ref3.icon,
|
2320
|
-
title = _ref3.title,
|
2321
|
-
subtitle = _ref3.subtitle,
|
2322
|
-
badge = _ref3.badge,
|
2323
|
-
children = _ref3.children,
|
2324
|
-
_ref3$minified = _ref3.minified,
|
2325
|
-
minified = _ref3$minified === void 0 ? false : _ref3$minified,
|
2326
|
-
_ref3$disabled = _ref3.disabled,
|
2327
|
-
disabled = _ref3$disabled === void 0 ? false : _ref3$disabled;
|
2328
|
-
var _useState2 = useState(minified),
|
2329
|
-
min = _useState2[0],
|
2330
|
-
setMin = _useState2[1];
|
2331
|
-
function toggle() {
|
2332
|
-
setMin(!min);
|
2333
|
-
}
|
2334
|
-
return min ? /*#__PURE__*/React.createElement("div", {
|
2335
|
-
className: "kanban-column " + id + " min"
|
2336
|
-
}, /*#__PURE__*/React.createElement("main", null, title), /*#__PURE__*/React.createElement("footer", null, /*#__PURE__*/React.createElement(Icon, {
|
2337
|
-
icon: "toggle_off",
|
2338
|
-
onIcon: "toggle_on",
|
2339
|
-
clickable: true,
|
2340
|
-
action: toggle
|
2341
|
-
}))) : /*#__PURE__*/React.createElement("div", {
|
2342
|
-
className: "kanban-column " + id + " " + (disabled ? 'disabled' : '')
|
2343
|
-
}, headless ? "" : /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement(Icon, {
|
2344
|
-
icon: icon
|
2345
|
-
}), /*#__PURE__*/React.createElement("div", {
|
2346
|
-
className: "title"
|
2347
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
2348
|
-
use: "headline6"
|
2349
|
-
}, title), /*#__PURE__*/React.createElement(Text, {
|
2350
|
-
className: "secondary-text",
|
2351
|
-
use: "body2"
|
2352
|
-
}, subtitle)), /*#__PURE__*/React.createElement("div", {
|
2353
|
-
className: "badge"
|
2354
|
-
}, badge)), /*#__PURE__*/React.createElement("main", null, children), /*#__PURE__*/React.createElement("footer", null, /*#__PURE__*/React.createElement(Icon, {
|
2355
|
-
icon: "toggle_off",
|
2356
|
-
onIcon: "toggle_on",
|
2357
|
-
clickable: true,
|
2358
|
-
action: toggle
|
2359
|
-
}), actions));
|
2239
|
+
var SiteToolBar = function SiteToolBar(_ref4) {
|
2240
|
+
var children = _ref4.children;
|
2241
|
+
return /*#__PURE__*/React.createElement("nav", null, children);
|
2360
2242
|
};
|
2361
2243
|
|
2362
2244
|
/**
|
2363
|
-
*
|
2245
|
+
* Site Footer
|
2364
2246
|
*/
|
2365
|
-
var
|
2366
|
-
var
|
2367
|
-
|
2368
|
-
children = _ref4.children;
|
2369
|
-
return /*#__PURE__*/React.createElement("div", {
|
2370
|
-
className: "kanban-card " + className + " " + color
|
2371
|
-
}, children);
|
2247
|
+
var SiteFooter = function SiteFooter(_ref5) {
|
2248
|
+
var children = _ref5.children;
|
2249
|
+
return /*#__PURE__*/React.createElement("footer", null, children);
|
2372
2250
|
};
|
2373
2251
|
|
2374
2252
|
/**
|
2375
|
-
*
|
2253
|
+
* Site Aside
|
2376
2254
|
*/
|
2377
|
-
var
|
2378
|
-
var
|
2379
|
-
|
2380
|
-
|
2381
|
-
|
2382
|
-
|
2383
|
-
|
2384
|
-
|
2385
|
-
|
2386
|
-
|
2387
|
-
|
2388
|
-
|
2389
|
-
|
2390
|
-
|
2255
|
+
var SiteAside = function SiteAside() {
|
2256
|
+
var context = useContext(SiteContext);
|
2257
|
+
return context.info ? /*#__PURE__*/React.createElement("aside", null, context.info) : '';
|
2258
|
+
};
|
2259
|
+
|
2260
|
+
/**
|
2261
|
+
* SiteMenu
|
2262
|
+
*/
|
2263
|
+
var SiteMenu = function SiteMenu(_ref6) {
|
2264
|
+
var iconSrc = _ref6.iconSrc,
|
2265
|
+
title = _ref6.title,
|
2266
|
+
children = _ref6.children,
|
2267
|
+
min = _ref6.min;
|
2268
|
+
var context = useContext(SiteContext);
|
2269
|
+
var page = context.page,
|
2270
|
+
sideNav = context.sideNav,
|
2271
|
+
setSideNav = context.setSideNav,
|
2272
|
+
showNav = context.showNav;
|
2273
|
+
useEffect(function () {
|
2274
|
+
if (min) context.setSideNav('min');
|
2275
|
+
}, []);
|
2276
|
+
function toggle() {
|
2277
|
+
var next = sideNav === 'max' ? 'min' : 'max';
|
2278
|
+
setSideNav(next);
|
2391
2279
|
}
|
2392
|
-
var
|
2393
|
-
|
2394
|
-
|
2395
|
-
|
2396
|
-
|
2397
|
-
|
2398
|
-
|
2399
|
-
|
2280
|
+
var _goto = function _goto(id) {
|
2281
|
+
context.setShowNav(false);
|
2282
|
+
context["goto"](id);
|
2283
|
+
};
|
2284
|
+
var sections = children ? Children.toArray(children).reduce(function (sections, page) {
|
2285
|
+
var section = page.props ? page.props.section : '...';
|
2286
|
+
if (!sections[section]) sections[section] = [];
|
2287
|
+
var _page$props = page.props,
|
2288
|
+
id = _page$props.id,
|
2289
|
+
icon = _page$props.icon,
|
2290
|
+
title = _page$props.title;
|
2291
|
+
if (title) sections[section].push({
|
2292
|
+
id: id,
|
2293
|
+
icon: icon,
|
2294
|
+
title: title
|
2295
|
+
});
|
2296
|
+
return sections;
|
2297
|
+
}, {}) : {};
|
2298
|
+
var style = sideNav === 'max' ? 'max' : 'min';
|
2299
|
+
var toggleIcon = sideNav === 'max' ? 'chevron_left' : 'chevron_right';
|
2300
|
+
var menutTitle = sideNav === 'max' ? title : '';
|
2301
|
+
return /*#__PURE__*/React.createElement("menu", {
|
2302
|
+
className: style + " " + (showNav ? 'show' : '')
|
2303
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
2304
|
+
title: menutTitle,
|
2305
|
+
iconSrc: iconSrc
|
2306
|
+
}), /*#__PURE__*/React.createElement("main", null, Object.keys(sections).map(function (title) {
|
2307
|
+
return /*#__PURE__*/React.createElement(Fragment, {
|
2308
|
+
key: title
|
2309
|
+
}, /*#__PURE__*/React.createElement("div", {
|
2310
|
+
className: "section-title " + style
|
2311
|
+
}, sideNav === "max" ? title : ''), sections[title].map(function (_ref7) {
|
2312
|
+
var id = _ref7.id,
|
2313
|
+
_ref7$icon = _ref7.icon,
|
2314
|
+
icon = _ref7$icon === void 0 ? 'info' : _ref7$icon,
|
2315
|
+
title = _ref7.title;
|
2316
|
+
var styleItem = id === page ? 'selected' : '';
|
2317
|
+
var titleTxt = context.translate(title);
|
2318
|
+
return /*#__PURE__*/React.createElement("div", {
|
2319
|
+
className: "site-menu-item " + styleItem,
|
2320
|
+
key: id,
|
2321
|
+
onClick: function onClick() {
|
2322
|
+
return _goto(id);
|
2323
|
+
}
|
2324
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
2325
|
+
text: title,
|
2326
|
+
top: ".5rem",
|
2327
|
+
left: "4.5rem"
|
2328
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
2329
|
+
key: id,
|
2330
|
+
icon: icon,
|
2331
|
+
clickable: true,
|
2332
|
+
action: function action() {
|
2333
|
+
return _goto(id);
|
2334
|
+
}
|
2335
|
+
})), sideNav === 'max' ? /*#__PURE__*/React.createElement("label", null, titleTxt) : null);
|
2336
|
+
}), /*#__PURE__*/React.createElement("div", {
|
2337
|
+
className: "section-divider"
|
2338
|
+
}));
|
2339
|
+
})), /*#__PURE__*/React.createElement("footer", null, /*#__PURE__*/React.createElement(Icon, {
|
2340
|
+
icon: toggleIcon,
|
2341
|
+
clickable: true,
|
2342
|
+
action: toggle
|
2343
|
+
})));
|
2400
2344
|
};
|
2401
2345
|
|
2402
|
-
|
2403
|
-
|
2404
|
-
|
2405
|
-
|
2406
|
-
|
2346
|
+
/**
|
2347
|
+
* SitePage
|
2348
|
+
*/
|
2349
|
+
var SitePage = function SitePage(_ref8) {
|
2350
|
+
var children = _ref8.children,
|
2351
|
+
init = _ref8.init;
|
2352
|
+
var context = useContext(SiteContext);
|
2353
|
+
var page = context.page;
|
2354
|
+
useEffect(function () {
|
2355
|
+
if (init) {
|
2356
|
+
context["goto"](init);
|
2357
|
+
} else {
|
2358
|
+
context["goto"]("EMPTY");
|
2359
|
+
}
|
2360
|
+
}, []);
|
2361
|
+
return /*#__PURE__*/React.createElement("main", null, React.Children.toArray(children).filter(function (child) {
|
2362
|
+
return child.props ? child.props.id === page : false;
|
2407
2363
|
}));
|
2408
2364
|
};
|
2409
2365
|
|
2410
|
-
|
2411
|
-
|
2366
|
+
/**
|
2367
|
+
* Site Dialog
|
2368
|
+
*/
|
2369
|
+
var SiteDialog = function SiteDialog() {
|
2370
|
+
var context = useContext(SiteContext);
|
2371
|
+
return context.dialog ? context.dialog : '';
|
2372
|
+
};
|
2412
2373
|
|
2413
2374
|
/**
|
2414
|
-
*
|
2375
|
+
* Site Promtp Dialog
|
2415
2376
|
*/
|
2416
|
-
var
|
2417
|
-
var
|
2418
|
-
|
2419
|
-
children = props.children,
|
2420
|
-
onChange = props.onChange,
|
2421
|
-
onRange = props.onRange;
|
2422
|
-
var _useState = useState(props.range || "year"),
|
2423
|
-
range = _useState[0],
|
2424
|
-
setRange = _useState[1];
|
2425
|
-
function onChangeRange(range) {
|
2426
|
-
setRange(range);
|
2427
|
-
if (onRange) onRange(range);
|
2428
|
-
}
|
2429
|
-
return /*#__PURE__*/React.createElement("div", {
|
2430
|
-
className: "calendar"
|
2431
|
-
}, /*#__PURE__*/React.createElement(CalendarRangeControl, {
|
2432
|
-
range: range,
|
2433
|
-
onChange: onChangeRange
|
2434
|
-
}), range === "year" && /*#__PURE__*/React.createElement(YearCalendar, {
|
2435
|
-
events: events,
|
2436
|
-
onChange: onChange
|
2437
|
-
}, children), range === "month" && /*#__PURE__*/React.createElement(MonthCalendar, {
|
2438
|
-
events: events,
|
2439
|
-
onChange: onChange,
|
2440
|
-
onRange: onChangeRange
|
2441
|
-
}, children));
|
2377
|
+
var SitePromptDialog = function SitePromptDialog() {
|
2378
|
+
var context = useContext(SiteContext);
|
2379
|
+
return context.promptDialog ? context.promptDialog : '';
|
2442
2380
|
};
|
2443
2381
|
|
2444
2382
|
/**
|
2445
|
-
*
|
2383
|
+
* Site Preview
|
2446
2384
|
*/
|
2447
|
-
var
|
2448
|
-
var
|
2449
|
-
|
2450
|
-
|
2451
|
-
|
2452
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
2453
|
-
label: "Year",
|
2454
|
-
outlined: range == "year",
|
2455
|
-
action: function action() {
|
2456
|
-
return onChange("year");
|
2457
|
-
}
|
2458
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
2459
|
-
label: "Month",
|
2460
|
-
outlined: range == "month",
|
2461
|
-
action: function action() {
|
2462
|
-
return onChange("month");
|
2463
|
-
}
|
2464
|
-
}));
|
2385
|
+
var SitePreview = function SitePreview() {
|
2386
|
+
var context = useContext(SiteContext);
|
2387
|
+
return context.preview ? /*#__PURE__*/React.createElement("div", {
|
2388
|
+
className: "site-preview"
|
2389
|
+
}, context.preview) : '';
|
2465
2390
|
};
|
2466
2391
|
|
2467
2392
|
/**
|
2468
|
-
*
|
2393
|
+
* Site Console
|
2469
2394
|
*/
|
2470
|
-
var
|
2471
|
-
var
|
2472
|
-
|
2473
|
-
|
2474
|
-
onChange = props.onChange;
|
2475
|
-
var _useState2 = useState(),
|
2476
|
-
position = _useState2[0],
|
2477
|
-
setPosition = _useState2[1];
|
2478
|
-
useEffect(function () {
|
2479
|
-
var today = moment();
|
2480
|
-
setPosition(today);
|
2481
|
-
}, []);
|
2482
|
-
useEffect(function () {
|
2483
|
-
if (position && onChange) {
|
2484
|
-
var _firstDayOfMonth = position.clone().startOf('month');
|
2485
|
-
var _firstDayOfRange = _firstDayOfMonth.clone().startOf('isoweek');
|
2486
|
-
var _lastDayOfMonth = position.clone().endOf('month');
|
2487
|
-
var _lastDayOfRange = _lastDayOfMonth.clone().endOf('isoweek');
|
2488
|
-
var _range = moment.range(_firstDayOfRange, _lastDayOfRange);
|
2489
|
-
onChange(position, _range);
|
2490
|
-
}
|
2491
|
-
}, [position]);
|
2492
|
-
function next() {
|
2493
|
-
var next = position.clone().add(1, 'month');
|
2494
|
-
setPosition(next);
|
2495
|
-
}
|
2496
|
-
function prev() {
|
2497
|
-
var prev = position.clone().subtract(1, 'month');
|
2498
|
-
setPosition(prev);
|
2499
|
-
}
|
2500
|
-
function today() {
|
2501
|
-
var today = moment();
|
2502
|
-
setPosition(today);
|
2395
|
+
var SiteConsole = function SiteConsole() {
|
2396
|
+
var context = useContext(SiteContext);
|
2397
|
+
function clear() {
|
2398
|
+
context.clearLog();
|
2503
2399
|
}
|
2504
|
-
|
2505
|
-
|
2506
|
-
|
2507
|
-
|
2508
|
-
|
2509
|
-
|
2510
|
-
|
2511
|
-
|
2512
|
-
|
2513
|
-
|
2514
|
-
var eventsOfDay = events.filter(function (event) {
|
2515
|
-
var eventDay = moment(event.date);
|
2516
|
-
return eventDay.isSame(day, 'day');
|
2517
|
-
});
|
2518
|
-
var sameMonthStyle = day.isSame(moment(position), 'month') ? '' : 'other-month';
|
2519
|
-
return {
|
2520
|
-
day: day,
|
2521
|
-
events: eventsOfDay,
|
2522
|
-
sameMonthStyle: sameMonthStyle
|
2523
|
-
};
|
2524
|
-
});
|
2525
|
-
return /*#__PURE__*/React.createElement("div", {
|
2526
|
-
className: "month-calendar"
|
2527
|
-
}, /*#__PURE__*/React.createElement("nav", null, /*#__PURE__*/React.createElement("label", null, " ", /*#__PURE__*/React.createElement(Text, null, monthName), " ", year), /*#__PURE__*/React.createElement(Button, {
|
2528
|
-
icon: "chevron_left",
|
2529
|
-
action: prev
|
2530
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
2531
|
-
label: "Today",
|
2532
|
-
outlined: true,
|
2533
|
-
action: today
|
2534
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
2535
|
-
icon: "chevron_right",
|
2536
|
-
action: next
|
2537
|
-
})), /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement("div", {
|
2538
|
-
className: "week-day-cell"
|
2539
|
-
}, /*#__PURE__*/React.createElement(Text, null, "Mon")), /*#__PURE__*/React.createElement("div", {
|
2540
|
-
className: "week-day-cell"
|
2541
|
-
}, /*#__PURE__*/React.createElement(Text, null, "Tue")), /*#__PURE__*/React.createElement("div", {
|
2542
|
-
className: "week-day-cell"
|
2543
|
-
}, /*#__PURE__*/React.createElement(Text, null, "Wed")), /*#__PURE__*/React.createElement("div", {
|
2544
|
-
className: "week-day-cell"
|
2545
|
-
}, /*#__PURE__*/React.createElement(Text, null, "Thu")), /*#__PURE__*/React.createElement("div", {
|
2546
|
-
className: "week-day-cell"
|
2547
|
-
}, /*#__PURE__*/React.createElement(Text, null, "Fri")), /*#__PURE__*/React.createElement("div", {
|
2548
|
-
className: "week-day-cell"
|
2549
|
-
}, /*#__PURE__*/React.createElement(Text, null, "Sat")), /*#__PURE__*/React.createElement("div", {
|
2550
|
-
className: "week-day-cell"
|
2551
|
-
}, /*#__PURE__*/React.createElement(Text, null, "Sun"))), /*#__PURE__*/React.createElement("main", null, cells.map(function (cell) {
|
2552
|
-
return /*#__PURE__*/React.createElement(DayCell, {
|
2553
|
-
key: cell.day,
|
2554
|
-
cell: cell
|
2555
|
-
}, children);
|
2556
|
-
})));
|
2557
|
-
};
|
2558
|
-
var DayCell = function DayCell(props) {
|
2559
|
-
var _props$cell = props.cell,
|
2560
|
-
cell = _props$cell === void 0 ? [] : _props$cell,
|
2561
|
-
children = props.children;
|
2562
|
-
var day = cell.day,
|
2563
|
-
events = cell.events,
|
2564
|
-
sameMonthStyle = cell.sameMonthStyle;
|
2565
|
-
var todayStyle = day.isSame(moment(), 'day') ? 'today' : '';
|
2566
|
-
return /*#__PURE__*/React.createElement("div", {
|
2567
|
-
className: "day-cell " + todayStyle + " " + sameMonthStyle
|
2568
|
-
}, /*#__PURE__*/React.createElement("header", null, day.format("DD")), /*#__PURE__*/React.createElement("main", null, events.map(function (event) {
|
2569
|
-
return /*#__PURE__*/React.createElement(Event, {
|
2570
|
-
key: event.id,
|
2571
|
-
event: event
|
2572
|
-
}, children);
|
2573
|
-
})));
|
2574
|
-
};
|
2575
|
-
|
2576
|
-
/**
|
2577
|
-
* Event
|
2578
|
-
*/
|
2579
|
-
var Event = function Event(props) {
|
2580
|
-
var event = props.event,
|
2581
|
-
children = props.children;
|
2582
|
-
if (children) {
|
2583
|
-
var element = React.Children.toArray(children)[0];
|
2584
|
-
return React.cloneElement(element, {
|
2585
|
-
event: event
|
2586
|
-
});
|
2587
|
-
} else {
|
2400
|
+
return context.showConsole ? /*#__PURE__*/React.createElement("div", {
|
2401
|
+
className: "site-console"
|
2402
|
+
}, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(Tabs, null, /*#__PURE__*/React.createElement(Tab, {
|
2403
|
+
label: "Console"
|
2404
|
+
}))), /*#__PURE__*/React.createElement("nav", null, /*#__PURE__*/React.createElement(Icon, {
|
2405
|
+
icon: "clear_all",
|
2406
|
+
size: "small",
|
2407
|
+
clickable: true,
|
2408
|
+
action: clear
|
2409
|
+
})), /*#__PURE__*/React.createElement("main", null, context.consoleLines.map(function (line, index) {
|
2588
2410
|
return /*#__PURE__*/React.createElement("div", {
|
2589
|
-
|
2590
|
-
},
|
2591
|
-
|
2592
|
-
}, event.title));
|
2593
|
-
}
|
2411
|
+
key: "log-" + index
|
2412
|
+
}, line);
|
2413
|
+
}))) : '';
|
2594
2414
|
};
|
2595
2415
|
|
2596
2416
|
/**
|
2597
|
-
*
|
2417
|
+
* Dialog
|
2418
|
+
*
|
2419
|
+
* <Dialog title={title} open={true} actions={actions}>
|
2598
2420
|
*/
|
2599
|
-
var
|
2600
|
-
var
|
2601
|
-
|
2421
|
+
var Dialog = function Dialog(props) {
|
2422
|
+
var site = useContext(SiteContext);
|
2423
|
+
var icon = props.icon,
|
2424
|
+
_props$title = props.title,
|
2425
|
+
title = _props$title === void 0 ? "Dialog" : _props$title,
|
2426
|
+
toolbar = props.toolbar,
|
2602
2427
|
children = props.children,
|
2603
|
-
|
2604
|
-
|
2605
|
-
|
2606
|
-
|
2607
|
-
|
2608
|
-
|
2609
|
-
|
2610
|
-
|
2611
|
-
useEffect(function () {
|
2612
|
-
if (position && onChange) {
|
2613
|
-
var _firstDayOfYear = position.clone().startOf('year');
|
2614
|
-
var firstDayOfRange = _firstDayOfYear.clone().startOf('isoweek');
|
2615
|
-
var _lastDayOfYear = position.clone().endOf('year');
|
2616
|
-
var lastDayOfRange = _lastDayOfYear.clone().endOf('isoweek');
|
2617
|
-
var range = moment.range(firstDayOfRange, lastDayOfRange);
|
2618
|
-
onChange(position, range);
|
2428
|
+
actions = props.actions,
|
2429
|
+
className = props.className,
|
2430
|
+
onClose = props.onClose,
|
2431
|
+
_props$overlayCanClos = props.overlayCanClose,
|
2432
|
+
overlayCanClose = _props$overlayCanClos === void 0 ? true : _props$overlayCanClos;
|
2433
|
+
function overlayClose() {
|
2434
|
+
if (overlayCanClose) {
|
2435
|
+
close();
|
2619
2436
|
}
|
2620
|
-
}, [position]);
|
2621
|
-
function next() {
|
2622
|
-
var next = position.clone().add(1, 'year');
|
2623
|
-
setPosition(next);
|
2624
|
-
}
|
2625
|
-
function prev() {
|
2626
|
-
var prev = position.clone().subtract(1, 'year');
|
2627
|
-
setPosition(prev);
|
2628
|
-
}
|
2629
|
-
function today() {
|
2630
|
-
var today = moment();
|
2631
|
-
setPosition(today);
|
2632
2437
|
}
|
2633
|
-
|
2634
|
-
|
2635
|
-
|
2636
|
-
|
2637
|
-
|
2638
|
-
|
2639
|
-
|
2438
|
+
function close() {
|
2439
|
+
if (onClose) onClose();
|
2440
|
+
if (className === "prompt") {
|
2441
|
+
site.closePromptDialog();
|
2442
|
+
} else {
|
2443
|
+
site.closeDialog();
|
2444
|
+
}
|
2640
2445
|
}
|
2641
|
-
|
2642
|
-
|
2643
|
-
|
2644
|
-
|
2645
|
-
|
2646
|
-
|
2647
|
-
|
2648
|
-
|
2649
|
-
var eventsOfDay = events.filter(function (event) {
|
2650
|
-
var eventDay = moment(event.date);
|
2651
|
-
return eventDay.isSame(day, 'day');
|
2652
|
-
});
|
2653
|
-
var sameMonthStyle = day.isSame(moment(month), 'month') ? '' : 'other-month';
|
2654
|
-
return {
|
2655
|
-
day: day,
|
2656
|
-
events: eventsOfDay,
|
2657
|
-
sameMonthStyle: sameMonthStyle
|
2658
|
-
};
|
2659
|
-
});
|
2660
|
-
return {
|
2661
|
-
month: month,
|
2662
|
-
cells: cells
|
2663
|
-
};
|
2664
|
-
});
|
2665
|
-
return /*#__PURE__*/React.createElement("div", {
|
2666
|
-
className: "year-calendar"
|
2667
|
-
}, /*#__PURE__*/React.createElement("nav", null, /*#__PURE__*/React.createElement("label", null, " ", /*#__PURE__*/React.createElement(Text, null, year)), /*#__PURE__*/React.createElement(Button, {
|
2668
|
-
icon: "chevron_left",
|
2669
|
-
action: prev
|
2670
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
2671
|
-
label: "Today",
|
2672
|
-
outlined: true,
|
2673
|
-
action: today
|
2674
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
2675
|
-
icon: "chevron_right",
|
2676
|
-
action: next
|
2677
|
-
})), /*#__PURE__*/React.createElement("main", null, cells.map(function (cell) {
|
2678
|
-
return /*#__PURE__*/React.createElement(MonthCell, {
|
2679
|
-
key: cell.month,
|
2680
|
-
cell: cell
|
2681
|
-
}, children);
|
2682
|
-
})));
|
2446
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
2447
|
+
className: "overlay " + className,
|
2448
|
+
onMouseDown: overlayClose
|
2449
|
+
}), /*#__PURE__*/React.createElement("dialog", {
|
2450
|
+
className: "dialog-panel " + className
|
2451
|
+
}, /*#__PURE__*/React.createElement("header", null, icon ? /*#__PURE__*/React.createElement(MenuIcon, {
|
2452
|
+
icon: icon
|
2453
|
+
}) : null, /*#__PURE__*/React.createElement(Text$1, null, title), toolbar), /*#__PURE__*/React.createElement("main", null, children), /*#__PURE__*/React.createElement("footer", null, actions)));
|
2683
2454
|
};
|
2684
2455
|
|
2685
2456
|
/**
|
2686
|
-
*
|
2457
|
+
* View
|
2687
2458
|
*/
|
2688
|
-
var
|
2689
|
-
var
|
2690
|
-
|
2459
|
+
var View = function View(props) {
|
2460
|
+
var id = props.id,
|
2461
|
+
className = props.className,
|
2462
|
+
icon = props.icon,
|
2463
|
+
title = props.title,
|
2464
|
+
toolbar = props.toolbar,
|
2465
|
+
menu = props.menu,
|
2466
|
+
info = props.info,
|
2467
|
+
onClose = props.onClose,
|
2468
|
+
_props$canCollapse = props.canCollapse,
|
2469
|
+
canCollapse = _props$canCollapse === void 0 ? false : _props$canCollapse,
|
2691
2470
|
children = props.children;
|
2692
|
-
var
|
2693
|
-
|
2694
|
-
|
2695
|
-
|
2696
|
-
|
2697
|
-
}
|
2698
|
-
|
2699
|
-
|
2700
|
-
|
2701
|
-
|
2702
|
-
|
2703
|
-
|
2704
|
-
|
2705
|
-
|
2706
|
-
|
2707
|
-
|
2708
|
-
|
2709
|
-
}
|
2710
|
-
|
2711
|
-
|
2712
|
-
|
2713
|
-
|
2714
|
-
|
2715
|
-
|
2716
|
-
|
2471
|
+
var _useState = useState(true),
|
2472
|
+
open = _useState[0],
|
2473
|
+
setOpen = _useState[1];
|
2474
|
+
function toggle() {
|
2475
|
+
setOpen(!open);
|
2476
|
+
}
|
2477
|
+
function close() {
|
2478
|
+
if (onClose) onClose();
|
2479
|
+
}
|
2480
|
+
return /*#__PURE__*/React.createElement("section", {
|
2481
|
+
id: id,
|
2482
|
+
className: "view " + className
|
2483
|
+
}, /*#__PURE__*/React.createElement("header", null, canCollapse ? /*#__PURE__*/React.createElement(Icon, {
|
2484
|
+
icon: "expand_more",
|
2485
|
+
size: "small",
|
2486
|
+
clickable: true,
|
2487
|
+
action: toggle
|
2488
|
+
}) : null, icon ? /*#__PURE__*/React.createElement(Icon, {
|
2489
|
+
icon: icon,
|
2490
|
+
size: "small"
|
2491
|
+
}) : null, title ? /*#__PURE__*/React.createElement("label", null, title) : null, menu ? /*#__PURE__*/React.createElement(MenuIcon, {
|
2492
|
+
align: "alignRight"
|
2493
|
+
}, menu) : null, onClose ? /*#__PURE__*/React.createElement(Icon, {
|
2494
|
+
icon: "close",
|
2495
|
+
size: "small",
|
2496
|
+
clickable: true,
|
2497
|
+
action: close
|
2498
|
+
}) : null), toolbar ? /*#__PURE__*/React.createElement("nav", null, toolbar) : null, open ? /*#__PURE__*/React.createElement("main", null, children) : null, info ? /*#__PURE__*/React.createElement("footer", null, info) : null);
|
2499
|
+
};
|
2500
|
+
var TabbedView = function TabbedView(props) {
|
2501
|
+
var title = props.title,
|
2502
|
+
className = props.className,
|
2503
|
+
selected = props.selected;
|
2504
|
+
var _useState2 = useState(0),
|
2505
|
+
tab = _useState2[0],
|
2506
|
+
setTab = _useState2[1];
|
2507
|
+
var children = React.Children.toArray(props.children);
|
2508
|
+
var tabs = children.map(function (child) {
|
2509
|
+
return /*#__PURE__*/React.createElement(Tab, {
|
2510
|
+
key: child.props.label,
|
2511
|
+
label: child.props.label
|
2512
|
+
});
|
2513
|
+
});
|
2514
|
+
useEffect(function () {
|
2515
|
+
if (selected && selected !== tab) setTab(selected);
|
2516
|
+
}, [selected]);
|
2517
|
+
var toolbar = /*#__PURE__*/React.createElement(Tabs, {
|
2518
|
+
selected: tab,
|
2519
|
+
onChange: function onChange(tab) {
|
2520
|
+
return setTab(tab);
|
2521
|
+
}
|
2522
|
+
}, tabs);
|
2523
|
+
return /*#__PURE__*/React.createElement(View, {
|
2524
|
+
title: title,
|
2525
|
+
toolbar: toolbar,
|
2526
|
+
className: className
|
2527
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
2528
|
+
selected: tab
|
2529
|
+
}, children));
|
2717
2530
|
};
|
2718
2531
|
|
2719
|
-
|
2720
|
-
|
2721
|
-
|
2722
|
-
|
2723
|
-
|
2724
|
-
|
2725
|
-
|
2726
|
-
|
2727
|
-
|
2728
|
-
|
2729
|
-
|
2532
|
+
/**
|
2533
|
+
* Admin Change User Password Dialog
|
2534
|
+
*/
|
2535
|
+
var ChangeUserPasswordDialog = function ChangeUserPasswordDialog(props) {
|
2536
|
+
var site = useContext(SiteContext);
|
2537
|
+
var error = props.error;
|
2538
|
+
var config = {
|
2539
|
+
userRequired: props.userRequired || false,
|
2540
|
+
oldPwdRequired: props.oldPwdRequired || false,
|
2541
|
+
onOK: function onOK(form) {
|
2542
|
+
props.onOK ? props.onOK(form) : site.closeDialog();
|
2543
|
+
},
|
2544
|
+
onClose: function onClose() {
|
2545
|
+
site.closeDialog();
|
2546
|
+
}
|
2547
|
+
};
|
2548
|
+
var Toolbar = function Toolbar() {
|
2549
|
+
return /*#__PURE__*/React.createElement("div", {
|
2550
|
+
className: "dialog-toolbar"
|
2551
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
2552
|
+
icon: "close",
|
2553
|
+
size: "small",
|
2554
|
+
clickable: true,
|
2555
|
+
action: site.closeDialog
|
2556
|
+
}));
|
2557
|
+
};
|
2558
|
+
var title = /*#__PURE__*/React.createElement("div", {
|
2559
|
+
className: "dialog-title"
|
2560
|
+
}, /*#__PURE__*/React.createElement(Text, null, "Change Password"), ">");
|
2561
|
+
return /*#__PURE__*/React.createElement(Dialog, {
|
2562
|
+
title: title,
|
2563
|
+
className: "change-password-dialog",
|
2564
|
+
toolbar: /*#__PURE__*/React.createElement(Toolbar, null)
|
2565
|
+
}, error && /*#__PURE__*/React.createElement("div", {
|
2566
|
+
className: "dialog-error-message"
|
2567
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
2568
|
+
icon: "warning"
|
2569
|
+
}), error), /*#__PURE__*/React.createElement(ResetPasswordBox, config, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", {
|
2570
|
+
className: "title"
|
2571
|
+
}, /*#__PURE__*/React.createElement(Text, null, "The new password must contain:")), /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Text, null, "At least 15 characters")), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Text, null, "At least one uppercase letter")), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Text, null, "At least one lowercase letter")), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Text, null, "At least one number")), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Text, null, "At least one special character")))));
|
2572
|
+
};
|
2730
2573
|
|
2731
2574
|
/**
|
2732
|
-
*
|
2575
|
+
* Forget User Password Action
|
2733
2576
|
*/
|
2734
|
-
|
2735
|
-
|
2736
|
-
|
2737
|
-
|
2738
|
-
|
2739
|
-
|
2740
|
-
_ref$navigation = _ref.navigation,
|
2741
|
-
navigation = _ref$navigation === void 0 ? true : _ref$navigation,
|
2742
|
-
onSelectCell = _ref.onSelectCell,
|
2743
|
-
focusEvent = _ref.focusEvent,
|
2744
|
-
_ref$config = _ref.config,
|
2745
|
-
config = _ref$config === void 0 ? {
|
2746
|
-
range: "year",
|
2747
|
-
from: "2022-01-01",
|
2748
|
-
to: "2022-12-30"
|
2749
|
-
} : _ref$config,
|
2750
|
-
onChange = _ref.onChange;
|
2751
|
-
var _useState = useState(config.range),
|
2752
|
-
dateRange = _useState[0],
|
2753
|
-
setDateRange = _useState[1];
|
2754
|
-
var _useState2 = useState(config.from),
|
2755
|
-
from = _useState2[0],
|
2756
|
-
setFrom = _useState2[1];
|
2757
|
-
var _useState3 = useState(config.to),
|
2758
|
-
to = _useState3[0],
|
2759
|
-
setTo = _useState3[1];
|
2760
|
-
var thisMondayElement = useRef(null);
|
2761
|
-
var gotoMonday = useCallback(function (node) {
|
2762
|
-
var element = node;
|
2763
|
-
if (element) element.scrollIntoView({
|
2764
|
-
behavior: 'smooth',
|
2765
|
-
block: 'start',
|
2766
|
-
inline: 'start'
|
2767
|
-
});
|
2768
|
-
}, []);
|
2769
|
-
useEffect(function () {
|
2770
|
-
var element = document.getElementById(focusEvent);
|
2771
|
-
if (element) element.scrollIntoView({
|
2772
|
-
behavior: 'smooth',
|
2773
|
-
block: 'center',
|
2774
|
-
inline: 'center'
|
2775
|
-
});
|
2776
|
-
}, [focusEvent]);
|
2777
|
-
useEffect(function () {
|
2778
|
-
var today = moment$1();
|
2779
|
-
var from_date = today.startOf(dateRange).format("YYYY-MM-DD");
|
2780
|
-
var to_date = today.endOf(dateRange).format("YYYY-MM-DD");
|
2781
|
-
setFrom(from_date);
|
2782
|
-
setTo(to_date);
|
2783
|
-
}, [dateRange]);
|
2784
|
-
function next() {
|
2785
|
-
var actual = moment$1(from);
|
2786
|
-
var next = actual.add(1, dateRange);
|
2787
|
-
var from_date = next.startOf(dateRange).format("YYYY-MM-DD");
|
2788
|
-
var to_date = next.endOf(dateRange).format("YYYY-MM-DD");
|
2789
|
-
setFrom(from_date);
|
2790
|
-
setTo(to_date);
|
2791
|
-
}
|
2792
|
-
function prev() {
|
2793
|
-
var actual = moment$1(from);
|
2794
|
-
var next = actual.subtract(1, dateRange);
|
2795
|
-
var from_date = next.startOf(dateRange).format("YYYY-MM-DD");
|
2796
|
-
var to_date = next.endOf(dateRange).format("YYYY-MM-DD");
|
2797
|
-
setFrom(from_date);
|
2798
|
-
setTo(to_date);
|
2799
|
-
}
|
2800
|
-
function selectCell(lane, date) {
|
2801
|
-
if (onSelectCell) onSelectCell(lane, date);
|
2577
|
+
|
2578
|
+
function _catch$6(body, recover) {
|
2579
|
+
try {
|
2580
|
+
var result = body();
|
2581
|
+
} catch (e) {
|
2582
|
+
return recover(e);
|
2802
2583
|
}
|
2803
|
-
|
2804
|
-
|
2805
|
-
//const element = document.querySelector(".thisMonday")
|
2806
|
-
console.log("Show this week", element);
|
2807
|
-
if (element) element.scrollIntoView({
|
2808
|
-
behavior: 'smooth',
|
2809
|
-
block: 'start',
|
2810
|
-
inline: 'start'
|
2811
|
-
});
|
2584
|
+
if (result && result.then) {
|
2585
|
+
return result.then(void 0, recover);
|
2812
2586
|
}
|
2813
|
-
|
2814
|
-
|
2815
|
-
|
2816
|
-
|
2817
|
-
|
2818
|
-
|
2819
|
-
|
2820
|
-
|
2821
|
-
|
2822
|
-
|
2823
|
-
|
2824
|
-
|
2825
|
-
|
2826
|
-
|
2827
|
-
|
2828
|
-
|
2829
|
-
|
2830
|
-
|
2831
|
-
|
2832
|
-
|
2833
|
-
|
2834
|
-
|
2835
|
-
|
2836
|
-
|
2837
|
-
|
2838
|
-
|
2839
|
-
|
2840
|
-
clickable: true,
|
2841
|
-
action: next
|
2842
|
-
}), /*#__PURE__*/React.createElement(TextField, {
|
2843
|
-
id: "to",
|
2844
|
-
type: "date",
|
2845
|
-
label: "Hasta",
|
2846
|
-
value: to,
|
2847
|
-
onChange: function onChange(id, value) {
|
2848
|
-
return setTo(value);
|
2587
|
+
return result;
|
2588
|
+
} /**
|
2589
|
+
* Unlock User Action
|
2590
|
+
*/
|
2591
|
+
var ForgetUserPasswordAction = function ForgetUserPasswordAction(props) {
|
2592
|
+
var execute = function execute() {
|
2593
|
+
try {
|
2594
|
+
var _temp = _catch$6(function () {
|
2595
|
+
return Promise.resolve(onOK(user.email)).then(function () {
|
2596
|
+
if (onSuccess) onSuccess();
|
2597
|
+
site.notify({
|
2598
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, "Forgot Password"),
|
2599
|
+
body: /*#__PURE__*/React.createElement(Text$1, null, "Check your email to reset your password"),
|
2600
|
+
icon: "mail_lock"
|
2601
|
+
});
|
2602
|
+
});
|
2603
|
+
}, function (error) {
|
2604
|
+
site.notify({
|
2605
|
+
title: "Error",
|
2606
|
+
body: error.message,
|
2607
|
+
type: "danger",
|
2608
|
+
icon: "error"
|
2609
|
+
});
|
2610
|
+
});
|
2611
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
2612
|
+
} catch (e) {
|
2613
|
+
return Promise.reject(e);
|
2849
2614
|
}
|
2850
|
-
}
|
2851
|
-
|
2852
|
-
|
2853
|
-
|
2854
|
-
|
2855
|
-
|
2856
|
-
|
2857
|
-
|
2858
|
-
|
2615
|
+
};
|
2616
|
+
var site = useContext(SiteContext);
|
2617
|
+
var user = props.user,
|
2618
|
+
_props$icon = props.icon,
|
2619
|
+
icon = _props$icon === void 0 ? true : _props$icon,
|
2620
|
+
onOK = props.onOK,
|
2621
|
+
onSuccess = props.onSuccess;
|
2622
|
+
var label = /*#__PURE__*/React.createElement(Text$1, null, "Forgot Password");
|
2623
|
+
return icon ? /*#__PURE__*/React.createElement(Icon, {
|
2624
|
+
icon: "mail_lock",
|
2625
|
+
clickable: true,
|
2626
|
+
action: execute,
|
2627
|
+
size: "small",
|
2628
|
+
tooltip: {
|
2629
|
+
text: label,
|
2630
|
+
top: "-.5rem",
|
2631
|
+
left: "-14rem"
|
2859
2632
|
}
|
2860
|
-
})
|
2861
|
-
|
2862
|
-
|
2863
|
-
|
2864
|
-
|
2865
|
-
|
2866
|
-
|
2867
|
-
|
2868
|
-
|
2633
|
+
}) : /*#__PURE__*/React.createElement(Button, {
|
2634
|
+
label: label,
|
2635
|
+
action: execute,
|
2636
|
+
outlined: true,
|
2637
|
+
className: ""
|
2638
|
+
});
|
2639
|
+
};
|
2640
|
+
var UnlockUserAction = function UnlockUserAction(props) {
|
2641
|
+
var execute = function execute() {
|
2642
|
+
try {
|
2643
|
+
var _temp2 = _catch$6(function () {
|
2644
|
+
return Promise.resolve(onOK(user)).then(function () {
|
2645
|
+
if (onSuccess) onSuccess();
|
2646
|
+
site.notify({
|
2647
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, "User Unlocked"),
|
2648
|
+
body: /*#__PURE__*/React.createElement(Text$1, null, "The user has been unlocked successfully"),
|
2649
|
+
icon: "key"
|
2650
|
+
});
|
2651
|
+
});
|
2652
|
+
}, function (error) {
|
2653
|
+
site.notify({
|
2654
|
+
title: "Error",
|
2655
|
+
body: error.message,
|
2656
|
+
type: "danger",
|
2657
|
+
icon: "error"
|
2658
|
+
});
|
2659
|
+
});
|
2660
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
2661
|
+
} catch (e) {
|
2662
|
+
return Promise.reject(e);
|
2869
2663
|
}
|
2870
|
-
}
|
2871
|
-
|
2664
|
+
};
|
2665
|
+
var site = useContext(SiteContext);
|
2666
|
+
var user = props.user,
|
2667
|
+
_props$icon2 = props.icon,
|
2668
|
+
icon = _props$icon2 === void 0 ? true : _props$icon2,
|
2669
|
+
onOK = props.onOK,
|
2670
|
+
onSuccess = props.onSuccess;
|
2671
|
+
var label = /*#__PURE__*/React.createElement(Text$1, null, "Unlock User");
|
2672
|
+
return icon ? /*#__PURE__*/React.createElement(Icon, {
|
2673
|
+
icon: "key_off",
|
2872
2674
|
clickable: true,
|
2873
|
-
action:
|
2874
|
-
|
2875
|
-
|
2876
|
-
|
2877
|
-
|
2878
|
-
|
2879
|
-
className: "
|
2880
|
-
})
|
2881
|
-
|
2882
|
-
|
2883
|
-
|
2884
|
-
|
2885
|
-
|
2886
|
-
|
2887
|
-
|
2888
|
-
|
2889
|
-
|
2890
|
-
|
2891
|
-
|
2892
|
-
|
2893
|
-
|
2894
|
-
|
2895
|
-
|
2896
|
-
|
2897
|
-
|
2898
|
-
|
2899
|
-
|
2900
|
-
|
2901
|
-
|
2902
|
-
|
2903
|
-
|
2904
|
-
|
2905
|
-
|
2906
|
-
|
2907
|
-
|
2908
|
-
|
2909
|
-
|
2910
|
-
|
2911
|
-
|
2912
|
-
|
2913
|
-
|
2914
|
-
|
2915
|
-
|
2916
|
-
|
2917
|
-
|
2918
|
-
|
2919
|
-
|
2920
|
-
|
2921
|
-
|
2922
|
-
|
2923
|
-
|
2924
|
-
|
2925
|
-
|
2926
|
-
|
2927
|
-
|
2928
|
-
|
2675
|
+
action: execute,
|
2676
|
+
size: "small"
|
2677
|
+
}) : /*#__PURE__*/React.createElement(Button, {
|
2678
|
+
label: label,
|
2679
|
+
action: execute,
|
2680
|
+
outlined: true,
|
2681
|
+
className: ""
|
2682
|
+
});
|
2683
|
+
};
|
2684
|
+
|
2685
|
+
/**
|
2686
|
+
* Change User Password Action
|
2687
|
+
*/
|
2688
|
+
var ChangeUserPasswordAction = function ChangeUserPasswordAction(props) {
|
2689
|
+
var site = useContext(SiteContext);
|
2690
|
+
var user = props.user,
|
2691
|
+
_props$icon3 = props.icon,
|
2692
|
+
icon = _props$icon3 === void 0 ? false : _props$icon3,
|
2693
|
+
_props$oldPwdRequired = props.oldPwdRequired,
|
2694
|
+
oldPwdRequired = _props$oldPwdRequired === void 0 ? true : _props$oldPwdRequired;
|
2695
|
+
var errorMessages = useMemo(function () {
|
2696
|
+
return {
|
2697
|
+
"ERROR OLD PASSWORD": {
|
2698
|
+
title: "Error",
|
2699
|
+
description: /*#__PURE__*/React.createElement(Text$1, null, "Incorrect old password")
|
2700
|
+
},
|
2701
|
+
"PASSWORD ALREADY USED": {
|
2702
|
+
title: "Error",
|
2703
|
+
description: /*#__PURE__*/React.createElement(Text$1, null, "The new password provided has already been used")
|
2704
|
+
}
|
2705
|
+
};
|
2706
|
+
}, []);
|
2707
|
+
function execute() {
|
2708
|
+
var onOK = function onOK(form) {
|
2709
|
+
try {
|
2710
|
+
var _temp3 = _catch$6(function () {
|
2711
|
+
return Promise.resolve(props.onOK(user, form.oldPassword, form.password1)).then(function () {
|
2712
|
+
site.notify({
|
2713
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, "Change Password"),
|
2714
|
+
body: /*#__PURE__*/React.createElement(Text$1, null, "The password has been changed successfully"),
|
2715
|
+
icon: "key"
|
2716
|
+
});
|
2717
|
+
site.closeDialog();
|
2718
|
+
});
|
2719
|
+
}, function (error) {
|
2720
|
+
var _errorMessages$key;
|
2721
|
+
var key = error.message.toUpperCase();
|
2722
|
+
var message = ((_errorMessages$key = errorMessages[key]) == null ? void 0 : _errorMessages$key.description) || error.message;
|
2723
|
+
site.notify({
|
2724
|
+
title: "Error",
|
2725
|
+
body: message,
|
2726
|
+
type: "danger",
|
2727
|
+
icon: "error"
|
2728
|
+
});
|
2729
|
+
site.openDialog(/*#__PURE__*/React.createElement(ChangeUserPasswordDialog, {
|
2730
|
+
oldPwdRequired: oldPwdRequired,
|
2731
|
+
onOK: onOK,
|
2732
|
+
error: message
|
2733
|
+
}));
|
2734
|
+
});
|
2735
|
+
return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(function () {}) : void 0);
|
2736
|
+
} catch (e) {
|
2737
|
+
return Promise.reject(e);
|
2738
|
+
}
|
2739
|
+
};
|
2740
|
+
site.openDialog(/*#__PURE__*/React.createElement(ChangeUserPasswordDialog, {
|
2741
|
+
oldPwdRequired: oldPwdRequired,
|
2742
|
+
onOK: onOK
|
2743
|
+
}));
|
2744
|
+
}
|
2745
|
+
var label = /*#__PURE__*/React.createElement(Text$1, null, "Change Password");
|
2746
|
+
return icon ? /*#__PURE__*/React.createElement(Icon, {
|
2747
|
+
icon: "key",
|
2748
|
+
clickable: true,
|
2749
|
+
action: execute,
|
2750
|
+
size: "small"
|
2751
|
+
}) : /*#__PURE__*/React.createElement(Button, {
|
2752
|
+
label: label,
|
2753
|
+
action: execute,
|
2754
|
+
outlined: true,
|
2755
|
+
className: ""
|
2756
|
+
});
|
2929
2757
|
};
|
2930
2758
|
|
2931
|
-
|
2932
|
-
|
2933
|
-
|
2934
|
-
|
2935
|
-
|
2936
|
-
|
2937
|
-
|
2938
|
-
|
2939
|
-
|
2940
|
-
|
2941
|
-
|
2942
|
-
|
2943
|
-
|
2944
|
-
|
2945
|
-
|
2946
|
-
|
2947
|
-
|
2948
|
-
|
2949
|
-
|
2950
|
-
|
2951
|
-
|
2952
|
-
|
2953
|
-
|
2954
|
-
|
2955
|
-
|
2956
|
-
|
2957
|
-
|
2958
|
-
|
2959
|
-
|
2960
|
-
|
2961
|
-
|
2962
|
-
|
2963
|
-
|
2964
|
-
|
2965
|
-
|
2966
|
-
|
2759
|
+
var _LOGIN_DICTIONARY;
|
2760
|
+
var LOGIN_DICTIONARY = (_LOGIN_DICTIONARY = {
|
2761
|
+
'Forgot Password': {
|
2762
|
+
en: 'Forgot Password',
|
2763
|
+
es: 'Olvidé mi contraseña',
|
2764
|
+
de: 'Passwort vergessen',
|
2765
|
+
pt: 'Esqueceu a senha',
|
2766
|
+
ca: 'He oblidat la contrasenya',
|
2767
|
+
it: 'Password dimenticata',
|
2768
|
+
fr: 'Mot de passe oublié'
|
2769
|
+
},
|
2770
|
+
'Check your email to reset your password': {
|
2771
|
+
en: 'Check your email to reset your password',
|
2772
|
+
es: 'Revise su correo electrónico para restablecer su contraseña',
|
2773
|
+
de: 'Überprüfen Sie Ihre E-Mails, um Ihr Passwort zurückzusetzen',
|
2774
|
+
pt: 'Verifique seu e-mail para redefinir sua senha',
|
2775
|
+
ca: 'Comproveu el correu electrònic per restablir la contrasenya',
|
2776
|
+
it: 'Controlla la tua email per reimpostare la password',
|
2777
|
+
fr: 'Vérifiez votre email pour réinitialiser votre mot de passe'
|
2778
|
+
},
|
2779
|
+
'Unlock User': {
|
2780
|
+
en: 'Unlock User',
|
2781
|
+
es: 'Desbloquear usuario',
|
2782
|
+
de: 'Benutzer entsperren',
|
2783
|
+
pt: 'Desbloquear usuário',
|
2784
|
+
ca: 'Desbloquejar usuari',
|
2785
|
+
it: 'Sblocca utente',
|
2786
|
+
fr: 'Débloquer l\'utilisateur'
|
2787
|
+
},
|
2788
|
+
'The user has been unlocked successfully': {
|
2789
|
+
en: 'The user has been unlocked successfully',
|
2790
|
+
es: 'El usuario ha sido desbloqueado con éxito',
|
2791
|
+
de: 'Der Benutzer wurde erfolgreich entsperrt',
|
2792
|
+
pt: 'O usuário foi desbloqueado com sucesso',
|
2793
|
+
ca: 'L\'usuari s\'ha desbloquejat correctament',
|
2794
|
+
it: 'L\'utente è stato sbloccato con successo',
|
2795
|
+
fr: 'L\'utilisateur a été débloqué avec succès'
|
2796
|
+
},
|
2797
|
+
'User Unlocked': {
|
2798
|
+
en: 'User Unlocked',
|
2799
|
+
es: 'Usuario desbloqueado',
|
2800
|
+
de: 'Benutzer entsperrt',
|
2801
|
+
pt: 'Usuário desbloqueado',
|
2802
|
+
ca: 'Usuari desbloquejat',
|
2803
|
+
it: 'Utente sbloccato',
|
2804
|
+
fr: 'Utilisateur débloqué'
|
2805
|
+
},
|
2806
|
+
'The password has been changed successfully': {
|
2807
|
+
en: 'The password has been changed successfully',
|
2808
|
+
es: 'La contraseña se ha cambiado con éxito',
|
2809
|
+
de: 'Das Passwort wurde erfolgreich geändert',
|
2810
|
+
pt: 'A senha foi alterada com sucesso',
|
2811
|
+
ca: 'La contrasenya s\'ha canviat correctament',
|
2812
|
+
it: 'La password è stata cambiata con successo',
|
2813
|
+
fr: 'Le mot de passe a été changé avec succès'
|
2814
|
+
},
|
2815
|
+
'Password Changed': {
|
2816
|
+
en: 'Password Changed',
|
2817
|
+
es: 'Contraseña cambiada',
|
2818
|
+
de: 'Passwort geändert',
|
2819
|
+
pt: 'Senha alterada',
|
2820
|
+
ca: 'Contrasenya canviada',
|
2821
|
+
it: 'Password cambiata',
|
2822
|
+
fr: 'Mot de passe changé'
|
2823
|
+
},
|
2824
|
+
'The new password must contain:': {
|
2825
|
+
en: 'The new password must contain:',
|
2826
|
+
es: 'La nueva contraseña debe contener:',
|
2827
|
+
de: 'Das neue Passwort muss enthalten:',
|
2828
|
+
pt: 'A nova senha deve conter:',
|
2829
|
+
ca: 'La nova contrasenya ha de contenir:',
|
2830
|
+
it: 'La nuova password deve contenere:',
|
2831
|
+
fr: 'Le nouveau mot de passe doit contenir:'
|
2832
|
+
},
|
2833
|
+
'At least 15 characters': {
|
2834
|
+
en: 'At least 15 characters',
|
2835
|
+
es: 'Al menos 15 caracteres',
|
2836
|
+
de: 'Mindestens 15 Zeichen',
|
2837
|
+
pt: 'Pelo menos 15 caracteres',
|
2838
|
+
ca: 'Almenys 15 caràcters',
|
2839
|
+
it: 'Almeno 15 caratteri',
|
2840
|
+
fr: 'Au moins 15 caractères'
|
2841
|
+
},
|
2842
|
+
'At least one uppercase letter': {
|
2843
|
+
en: 'At least one uppercase letter',
|
2844
|
+
es: 'Al menos una letra mayúscula',
|
2845
|
+
de: 'Mindestens ein Großbuchstabe',
|
2846
|
+
pt: 'Pelo menos uma letra maiúscula',
|
2847
|
+
ca: 'Almenys una lletra majúscula',
|
2848
|
+
it: 'Almeno una lettera maiuscola',
|
2849
|
+
fr: 'Au moins une lettre majuscule'
|
2850
|
+
},
|
2851
|
+
'At least one lowercase letter': {
|
2852
|
+
en: 'At least one lowercase letter',
|
2853
|
+
es: 'Al menos una letra minúscula',
|
2854
|
+
de: 'Mindestens ein Kleinbuchstabe',
|
2855
|
+
pt: 'Pelo menos uma letra minúscula',
|
2856
|
+
ca: 'Almenys una lletra minúscula',
|
2857
|
+
it: 'Almeno una lettera minuscola',
|
2858
|
+
fr: 'Au moins une lettre minuscule'
|
2859
|
+
},
|
2860
|
+
'At least one number': {
|
2861
|
+
en: 'At least one number',
|
2862
|
+
es: 'Al menos un número',
|
2863
|
+
de: 'Mindestens eine Zahl',
|
2864
|
+
pt: 'Pelo menos um número',
|
2865
|
+
ca: 'Almenys un número',
|
2866
|
+
it: 'Almeno un numero',
|
2867
|
+
fr: 'Au moins un numéro'
|
2868
|
+
},
|
2869
|
+
'At least one special character': {
|
2870
|
+
en: 'At least one special character',
|
2871
|
+
es: 'Al menos un carácter especial',
|
2872
|
+
de: 'Mindestens ein Sonderzeichen',
|
2873
|
+
pt: 'Pelo menos um caractere especial',
|
2874
|
+
ca: 'Almenys un caràcter especial',
|
2875
|
+
it: 'Almeno un carattere speciale',
|
2876
|
+
fr: 'Au moins un caractère spécial'
|
2877
|
+
},
|
2878
|
+
'Passwords do not match.': {
|
2879
|
+
en: 'Passwords do not match.',
|
2880
|
+
es: 'Las contraseñas no coinciden.',
|
2881
|
+
de: 'Passwörter stimmen nicht überein.',
|
2882
|
+
pt: 'As senhas não coincidem.',
|
2883
|
+
ca: 'Les contrasenyes no coincideixen.',
|
2884
|
+
it: 'Le password non corrispondono.',
|
2885
|
+
fr: 'Les mots de passe ne correspondent pas.'
|
2886
|
+
},
|
2887
|
+
'Password is required': {
|
2888
|
+
en: 'Password is required',
|
2889
|
+
es: 'Se requiere contraseña',
|
2890
|
+
de: 'Passwort ist erforderlich',
|
2891
|
+
pt: 'Senha é necessária',
|
2892
|
+
ca: 'Es requereix contrasenya',
|
2893
|
+
it: 'La password è obbligatoria',
|
2894
|
+
fr: 'Le mot de passe est requis'
|
2895
|
+
},
|
2896
|
+
'Old password is required.': {
|
2897
|
+
en: 'Old password is required.',
|
2898
|
+
es: 'Se requiere contraseña antigua.',
|
2899
|
+
de: 'Altes Passwort ist erforderlich.',
|
2900
|
+
pt: 'Senha antiga é necessária.',
|
2901
|
+
ca: 'Es requereix contrasenya antiga.',
|
2902
|
+
it: 'La vecchia password è obbligatoria.',
|
2903
|
+
fr: 'Ancien mot de passe requis.'
|
2904
|
+
}
|
2905
|
+
}, _LOGIN_DICTIONARY["Passwords do not match."] = {
|
2906
|
+
en: 'Passwords do not match.',
|
2907
|
+
es: 'Las contraseñas no coinciden.',
|
2908
|
+
de: 'Passwörter stimmen nicht überein.',
|
2909
|
+
pt: 'As senhas não coincidem.',
|
2910
|
+
ca: 'Les contrasenyes no coincideixen.',
|
2911
|
+
it: 'Le password non corrispondono.',
|
2912
|
+
fr: 'Les mots de passe ne correspondent pas.'
|
2913
|
+
}, _LOGIN_DICTIONARY);
|
2914
|
+
|
2915
|
+
var SCROLL_SENSITIVITY = 0.0005;
|
2916
|
+
var MAX_ZOOM = 5;
|
2917
|
+
var MIN_ZOOM = 0.1;
|
2918
|
+
var ImageViewer = function ImageViewer(_ref) {
|
2919
|
+
var image = _ref.image;
|
2920
|
+
var _useState = useState({
|
2921
|
+
x: 0,
|
2922
|
+
y: 0
|
2923
|
+
}),
|
2924
|
+
offset = _useState[0],
|
2925
|
+
setOffset = _useState[1];
|
2926
|
+
var _useState2 = useState(1),
|
2927
|
+
zoom = _useState2[0],
|
2928
|
+
setZoom = _useState2[1];
|
2929
|
+
var _useState3 = useState(false),
|
2930
|
+
draggind = _useState3[0],
|
2931
|
+
setDragging = _useState3[1];
|
2932
|
+
var touch = useRef({
|
2933
|
+
x: 0,
|
2934
|
+
y: 0
|
2935
|
+
});
|
2936
|
+
var canvasRef = useRef(null);
|
2937
|
+
var containerRef = useRef(null);
|
2938
|
+
var observer = useRef(null);
|
2939
|
+
var background = useMemo(function () {
|
2940
|
+
return new Image();
|
2941
|
+
}, [image]);
|
2942
|
+
var clamp = function clamp(num, min, max) {
|
2943
|
+
return Math.min(Math.max(num, min), max);
|
2944
|
+
};
|
2945
|
+
var handleWheel = function handleWheel(event) {
|
2946
|
+
var deltaY = event.deltaY;
|
2947
|
+
if (!draggind) {
|
2948
|
+
setZoom(function (zoom) {
|
2949
|
+
return clamp(zoom + deltaY * SCROLL_SENSITIVITY * -1, MIN_ZOOM, MAX_ZOOM);
|
2950
|
+
});
|
2951
|
+
}
|
2952
|
+
};
|
2953
|
+
var handleMouseMove = function handleMouseMove(event) {
|
2954
|
+
if (draggind) {
|
2955
|
+
var _touch$current = touch.current,
|
2956
|
+
x = _touch$current.x,
|
2957
|
+
y = _touch$current.y;
|
2958
|
+
var clientX = event.clientX,
|
2959
|
+
clientY = event.clientY;
|
2960
|
+
setOffset({
|
2961
|
+
x: offset.x + (x - clientX),
|
2962
|
+
y: offset.y + (y - clientY)
|
2963
|
+
});
|
2964
|
+
touch.current = {
|
2965
|
+
x: clientX,
|
2966
|
+
y: clientY
|
2967
|
+
};
|
2968
|
+
}
|
2969
|
+
};
|
2970
|
+
var handleMouseDown = function handleMouseDown(event) {
|
2971
|
+
var clientX = event.clientX,
|
2972
|
+
clientY = event.clientY;
|
2973
|
+
touch.current = {
|
2974
|
+
x: clientX,
|
2975
|
+
y: clientY
|
2976
|
+
};
|
2977
|
+
setDragging(true);
|
2978
|
+
};
|
2979
|
+
var handleMouseUp = function handleMouseUp() {
|
2980
|
+
return setDragging(false);
|
2981
|
+
};
|
2982
|
+
var draw = function draw() {
|
2983
|
+
if (canvasRef.current) {
|
2984
|
+
var _canvasRef$current = canvasRef.current,
|
2985
|
+
width = _canvasRef$current.width,
|
2986
|
+
height = _canvasRef$current.height;
|
2987
|
+
var context = canvasRef.current.getContext("2d");
|
2988
|
+
|
2989
|
+
// Set canvas dimensions
|
2990
|
+
canvasRef.current.width = width;
|
2991
|
+
canvasRef.current.height = height;
|
2967
2992
|
|
2968
|
-
|
2969
|
-
|
2970
|
-
|
2971
|
-
|
2972
|
-
|
2973
|
-
|
2974
|
-
|
2975
|
-
|
2976
|
-
|
2977
|
-
|
2978
|
-
|
2979
|
-
|
2980
|
-
|
2981
|
-
|
2982
|
-
|
2983
|
-
|
2984
|
-
|
2985
|
-
|
2986
|
-
|
2987
|
-
|
2988
|
-
|
2989
|
-
|
2990
|
-
|
2991
|
-
|
2992
|
-
|
2993
|
-
|
2994
|
-
|
2995
|
-
|
2996
|
-
|
2997
|
-
|
2998
|
-
id: id,
|
2999
|
-
lane: lane.id,
|
3000
|
-
date: date.moment.format("YYYY-MM-DD")
|
2993
|
+
// Clear canvas and scale it
|
2994
|
+
context.translate(-offset.x, -offset.y);
|
2995
|
+
context.scale(zoom, zoom);
|
2996
|
+
context.clearRect(0, 0, width, height);
|
2997
|
+
|
2998
|
+
// Make sure we're zooming to the center
|
2999
|
+
var x = (context.canvas.width / zoom - background.width) / 2;
|
3000
|
+
var y = (context.canvas.height / zoom - background.height) / 2;
|
3001
|
+
|
3002
|
+
// Draw image
|
3003
|
+
context.drawImage(background, x, y);
|
3004
|
+
}
|
3005
|
+
};
|
3006
|
+
useEffect(function () {
|
3007
|
+
observer.current = new ResizeObserver(function (entries) {
|
3008
|
+
entries.forEach(function (_ref2) {
|
3009
|
+
var target = _ref2.target;
|
3010
|
+
var width = background.width,
|
3011
|
+
height = background.height;
|
3012
|
+
// If width of the container is smaller than image, scale image down
|
3013
|
+
if (target.clientWidth < width) {
|
3014
|
+
// Calculate scale
|
3015
|
+
var scale = target.clientWidth / width;
|
3016
|
+
|
3017
|
+
// Redraw image
|
3018
|
+
canvasRef.current.width = width * scale;
|
3019
|
+
canvasRef.current.height = height * scale;
|
3020
|
+
canvasRef.current.getContext("2d").drawImage(background, 0, 0, width * scale, height * scale);
|
3021
|
+
}
|
3022
|
+
});
|
3001
3023
|
});
|
3002
|
-
|
3003
|
-
|
3004
|
-
|
3005
|
-
|
3006
|
-
|
3007
|
-
|
3008
|
-
|
3009
|
-
|
3024
|
+
observer.current.observe(containerRef.current);
|
3025
|
+
return function () {
|
3026
|
+
return observer.current.unobserve(containerRef.current);
|
3027
|
+
};
|
3028
|
+
}, []);
|
3029
|
+
useEffect(function () {
|
3030
|
+
background.src = image;
|
3031
|
+
if (canvasRef.current) {
|
3032
|
+
background.onload = function () {
|
3033
|
+
// Get the image dimensions
|
3034
|
+
var width = background.width,
|
3035
|
+
height = background.height;
|
3036
|
+
canvasRef.current.width = width;
|
3037
|
+
canvasRef.current.height = height;
|
3038
|
+
|
3039
|
+
// Set image as background
|
3040
|
+
canvasRef.current.getContext("2d").drawImage(background, 0, 0);
|
3041
|
+
};
|
3042
|
+
}
|
3043
|
+
}, [background]);
|
3044
|
+
useEffect(function () {
|
3045
|
+
draw();
|
3046
|
+
}, [zoom, offset]);
|
3010
3047
|
return /*#__PURE__*/React.createElement("div", {
|
3011
|
-
className: "
|
3012
|
-
|
3013
|
-
|
3014
|
-
|
3015
|
-
|
3016
|
-
|
3017
|
-
|
3018
|
-
|
3019
|
-
return /*#__PURE__*/React.createElement(Renderer, {
|
3020
|
-
key: event.id,
|
3021
|
-
event: event
|
3022
|
-
});
|
3048
|
+
className: "image-viewer",
|
3049
|
+
ref: containerRef
|
3050
|
+
}, /*#__PURE__*/React.createElement("canvas", {
|
3051
|
+
onMouseDown: handleMouseDown,
|
3052
|
+
onMouseUp: handleMouseUp,
|
3053
|
+
onWheel: handleWheel,
|
3054
|
+
onMouseMove: handleMouseMove,
|
3055
|
+
ref: canvasRef
|
3023
3056
|
}));
|
3024
3057
|
};
|
3025
|
-
var EventCard = function EventCard(props) {
|
3026
|
-
var event = props.event;
|
3027
|
-
var title = event.title,
|
3028
|
-
color = event.color;
|
3029
|
-
var style = {
|
3030
|
-
backgroundColor: color,
|
3031
|
-
color: "white"
|
3032
|
-
};
|
3033
|
-
return /*#__PURE__*/React.createElement("div", {
|
3034
|
-
draggable: "true",
|
3035
|
-
className: "event-card",
|
3036
|
-
style: style
|
3037
|
-
}, title);
|
3038
|
-
};
|
3039
3058
|
|
3040
3059
|
/**
|
3041
|
-
*
|
3060
|
+
* Viewer
|
3042
3061
|
*/
|
3043
|
-
var
|
3044
|
-
var
|
3045
|
-
|
3046
|
-
|
3062
|
+
var Viewer = function Viewer(_ref) {
|
3063
|
+
var title = _ref.title,
|
3064
|
+
src = _ref.src,
|
3065
|
+
info = _ref.info,
|
3066
|
+
_ref$actions = _ref.actions,
|
3067
|
+
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
3068
|
+
_ref$tools = _ref.tools,
|
3069
|
+
tools = _ref$tools === void 0 ? false : _ref$tools,
|
3070
|
+
onClose = _ref.onClose;
|
3047
3071
|
var _useState = useState(false),
|
3048
|
-
|
3049
|
-
|
3050
|
-
|
3051
|
-
|
3052
|
-
|
3053
|
-
|
3054
|
-
|
3055
|
-
},
|
3056
|
-
var onDragOver = function onDragOver() {
|
3057
|
-
setDrag(true);
|
3058
|
-
};
|
3059
|
-
var onDragLeave = function onDragLeave() {
|
3060
|
-
setDrag(false);
|
3061
|
-
};
|
3062
|
-
var dragging = drag === true ? 'drag-over' : '';
|
3072
|
+
showDetails = _useState[0],
|
3073
|
+
setShowDetails = _useState[1];
|
3074
|
+
function toggleDetails() {
|
3075
|
+
setShowDetails(!showDetails);
|
3076
|
+
}
|
3077
|
+
var headerTitle = /*#__PURE__*/React.createElement(Text$1, {
|
3078
|
+
use: "headline6"
|
3079
|
+
}, title);
|
3063
3080
|
return /*#__PURE__*/React.createElement("div", {
|
3064
|
-
className: "
|
3065
|
-
|
3066
|
-
|
3067
|
-
|
3068
|
-
}, /*#__PURE__*/React.createElement(
|
3069
|
-
|
3070
|
-
|
3081
|
+
className: "viewer"
|
3082
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
3083
|
+
icon: "view",
|
3084
|
+
title: headerTitle
|
3085
|
+
}, onClose ? /*#__PURE__*/React.createElement(Icon, {
|
3086
|
+
icon: "close",
|
3087
|
+
clickable: true,
|
3088
|
+
action: onClose
|
3089
|
+
}) : null, showDetails ? '' : /*#__PURE__*/React.createElement(Icon, {
|
3090
|
+
icon: "info",
|
3091
|
+
clickable: true,
|
3092
|
+
action: toggleDetails
|
3093
|
+
}), actions), /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement("div", {
|
3094
|
+
className: "resizer"
|
3095
|
+
}, /*#__PURE__*/React.createElement("picture", null, /*#__PURE__*/React.createElement(ImageViewer, {
|
3096
|
+
image: src
|
3097
|
+
})))), /*#__PURE__*/React.createElement("aside", {
|
3098
|
+
className: "" + (showDetails ? 'open' : '')
|
3099
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
3100
|
+
title: "Detalles"
|
3101
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
3102
|
+
icon: "close",
|
3103
|
+
clickable: true,
|
3104
|
+
action: toggleDetails
|
3105
|
+
})), /*#__PURE__*/React.createElement("main", null, info)), tools ? /*#__PURE__*/React.createElement("footer", null, /*#__PURE__*/React.createElement(Icon, {
|
3106
|
+
clickable: true,
|
3107
|
+
icon: "zoom_out"
|
3108
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
3109
|
+
clickable: true,
|
3110
|
+
icon: "zoom_out_map"
|
3111
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
3112
|
+
clickable: true,
|
3113
|
+
icon: "zoom_in"
|
3114
|
+
})) : null);
|
3071
3115
|
};
|
3072
3116
|
|
3073
3117
|
/**
|
3074
|
-
*
|
3118
|
+
* Kanban
|
3075
3119
|
*/
|
3076
|
-
var
|
3077
|
-
var
|
3078
|
-
|
3079
|
-
|
3080
|
-
|
3081
|
-
|
3082
|
-
|
3083
|
-
|
3084
|
-
|
3085
|
-
}
|
3120
|
+
var Kanban = function Kanban(_ref) {
|
3121
|
+
var children = _ref.children;
|
3122
|
+
var hasSwimlanes = useMemo(function () {
|
3123
|
+
var found = React.Children.map(children, function (child) {
|
3124
|
+
if (child.type.name === KanbanSwimlane.name) {
|
3125
|
+
return child;
|
3126
|
+
}
|
3127
|
+
});
|
3128
|
+
return found.length > 0;
|
3129
|
+
});
|
3130
|
+
var style = hasSwimlanes ? "with-swimlanes" : "";
|
3086
3131
|
return /*#__PURE__*/React.createElement("div", {
|
3087
|
-
className: "
|
3088
|
-
|
3089
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
3090
|
-
icon: icon,
|
3091
|
-
clickable: true
|
3092
|
-
}));
|
3093
|
-
};
|
3094
|
-
|
3095
|
-
var UPLOAD_STATES = {
|
3096
|
-
IDLE: 0,
|
3097
|
-
RUNNING: 1,
|
3098
|
-
SUCCESS: 2,
|
3099
|
-
ERROR: 3,
|
3100
|
-
COMPLETED: 4
|
3132
|
+
className: "kanban " + style
|
3133
|
+
}, children);
|
3101
3134
|
};
|
3102
|
-
|
3103
|
-
|
3104
|
-
|
3105
|
-
|
3106
|
-
|
3107
|
-
|
3108
|
-
|
3109
|
-
|
3110
|
-
|
3111
|
-
|
3112
|
-
|
3113
|
-
|
3114
|
-
|
3115
|
-
|
3116
|
-
|
3117
|
-
|
3118
|
-
|
3119
|
-
|
3120
|
-
|
3121
|
-
|
3122
|
-
|
3123
|
-
|
3124
|
-
|
3125
|
-
|
3126
|
-
}
|
3127
|
-
icon: "error"
|
3128
|
-
})) : ''));
|
3135
|
+
var KanbanHeader = function KanbanHeader(props) {
|
3136
|
+
var columns = props.columns;
|
3137
|
+
return /*#__PURE__*/React.createElement("div", {
|
3138
|
+
className: "kanban-header"
|
3139
|
+
}, columns.map(function (column, index) {
|
3140
|
+
var icon = column.icon,
|
3141
|
+
title = column.title,
|
3142
|
+
subtitle = column.subtitle,
|
3143
|
+
badge = column.badge;
|
3144
|
+
return /*#__PURE__*/React.createElement("div", {
|
3145
|
+
className: "kanban-column",
|
3146
|
+
key: index
|
3147
|
+
}, /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement(Icon, {
|
3148
|
+
icon: icon
|
3149
|
+
}), /*#__PURE__*/React.createElement("div", {
|
3150
|
+
className: "title"
|
3151
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
3152
|
+
use: "headline6"
|
3153
|
+
}, title), /*#__PURE__*/React.createElement(Text$1, {
|
3154
|
+
className: "secondary-text",
|
3155
|
+
use: "body2"
|
3156
|
+
}, subtitle)), /*#__PURE__*/React.createElement("div", {
|
3157
|
+
className: "badge"
|
3158
|
+
}, badge)));
|
3159
|
+
}));
|
3129
3160
|
};
|
3161
|
+
var KanbanSwimlane = function KanbanSwimlane(_ref2) {
|
3162
|
+
var icon = _ref2.icon,
|
3163
|
+
title = _ref2.title,
|
3164
|
+
subtitle = _ref2.subtitle,
|
3165
|
+
badge = _ref2.badge,
|
3166
|
+
children = _ref2.children;
|
3167
|
+
var _useState = useState(true),
|
3168
|
+
unfold = _useState[0],
|
3169
|
+
setUnfold = _useState[1];
|
3130
3170
|
|
3131
|
-
|
3132
|
-
|
3133
|
-
|
3134
|
-
|
3135
|
-
|
3136
|
-
icon: "description",
|
3137
|
-
name: file.fileName,
|
3138
|
-
progress: file.progress() * 100,
|
3139
|
-
state: file.uploadState,
|
3140
|
-
error: file.uploadError
|
3141
|
-
};
|
3142
|
-
return /*#__PURE__*/React.createElement(UploadFile$1, {
|
3143
|
-
key: f.name,
|
3144
|
-
file: f
|
3171
|
+
// cahnge all children headless prop to true
|
3172
|
+
// if there is only one child
|
3173
|
+
if (children.length === 1) {
|
3174
|
+
children = React.cloneElement(children, {
|
3175
|
+
headless: true
|
3145
3176
|
});
|
3146
|
-
}
|
3177
|
+
} else {
|
3178
|
+
children = React.Children.map(children, function (child) {
|
3179
|
+
return React.cloneElement(child, {
|
3180
|
+
headless: true
|
3181
|
+
});
|
3182
|
+
});
|
3183
|
+
}
|
3184
|
+
|
3185
|
+
// log al children headless prop
|
3186
|
+
children.forEach(function (child) {
|
3187
|
+
console.log(child.props.headless);
|
3188
|
+
});
|
3189
|
+
function toggle() {
|
3190
|
+
setUnfold(!unfold);
|
3191
|
+
}
|
3192
|
+
var toggleIcon = unfold ? "unfold_less" : "unfold_more";
|
3193
|
+
var toggleStyle = unfold ? "unfold" : "fold";
|
3194
|
+
return /*#__PURE__*/React.createElement("div", {
|
3195
|
+
className: "kanban-swimlane"
|
3196
|
+
}, /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement(Icon, {
|
3197
|
+
icon: icon,
|
3198
|
+
size: "small"
|
3199
|
+
}), /*#__PURE__*/React.createElement("div", {
|
3200
|
+
className: "title"
|
3201
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
3202
|
+
use: "headline6"
|
3203
|
+
}, title, ":"), /*#__PURE__*/React.createElement(Text$1, {
|
3204
|
+
className: "secondary-text",
|
3205
|
+
use: "body2"
|
3206
|
+
}, subtitle)), /*#__PURE__*/React.createElement("div", {
|
3207
|
+
className: "badge"
|
3208
|
+
}, badge), /*#__PURE__*/React.createElement(Icon, {
|
3209
|
+
icon: toggleIcon,
|
3210
|
+
clickable: true,
|
3211
|
+
action: toggle
|
3212
|
+
})), /*#__PURE__*/React.createElement("main", {
|
3213
|
+
className: toggleStyle
|
3214
|
+
}, children));
|
3147
3215
|
};
|
3148
3216
|
|
3149
3217
|
/**
|
3150
|
-
*
|
3218
|
+
* Kanban Column
|
3151
3219
|
*/
|
3152
|
-
var
|
3153
|
-
var
|
3154
|
-
|
3155
|
-
|
3156
|
-
|
3157
|
-
|
3158
|
-
|
3159
|
-
|
3160
|
-
|
3161
|
-
|
3162
|
-
|
3163
|
-
|
3164
|
-
|
3165
|
-
|
3166
|
-
var
|
3167
|
-
|
3168
|
-
|
3169
|
-
|
3170
|
-
|
3171
|
-
testChunks: false,
|
3172
|
-
throttleProgressCallbacks: 1,
|
3173
|
-
fileType: accept
|
3174
|
-
};
|
3175
|
-
var resumable = new ResumableJS(config);
|
3176
|
-
resumable.on('fileAdded', onFileAdded);
|
3177
|
-
resumable.on('fileProgress', onFileProgress);
|
3178
|
-
resumable.on('fileSuccess', onFileSuccess);
|
3179
|
-
resumable.on('fileError', onFileError);
|
3180
|
-
resumable.on('complete', onAllComplete);
|
3181
|
-
return resumable;
|
3182
|
-
}, []);
|
3183
|
-
var _useState = useState(0),
|
3184
|
-
setProgress = _useState[1];
|
3185
|
-
var _useState2 = useState(UPLOAD_STATES.IDLE),
|
3186
|
-
state = _useState2[0],
|
3187
|
-
setState = _useState2[1];
|
3188
|
-
var _useState3 = useState([]),
|
3189
|
-
files = _useState3[0],
|
3190
|
-
setFiles = _useState3[1];
|
3191
|
-
function onFileAdded(file) {
|
3192
|
-
files.push(file);
|
3193
|
-
setFiles(files);
|
3194
|
-
setState(UPLOAD_STATES.RUNNING);
|
3195
|
-
resumable.upload();
|
3196
|
-
}
|
3197
|
-
function onFileProgress(file) {
|
3198
|
-
file.uploadState = UPLOAD_STATES.RUNNING;
|
3199
|
-
var progress = file.progress();
|
3200
|
-
setProgress(progress);
|
3201
|
-
if (onProgress) onProgress(files);
|
3202
|
-
}
|
3203
|
-
function onFileSuccess(file, message) {
|
3204
|
-
file.uploadState = UPLOAD_STATES.SUCCESS;
|
3205
|
-
if (onSuccess) onSuccess(file, message);
|
3206
|
-
}
|
3207
|
-
function onFileError(file, message) {
|
3208
|
-
file.uploadState = UPLOAD_STATES.ERROR;
|
3209
|
-
file.uploadError = message;
|
3210
|
-
if (onError) onError(file, message);
|
3211
|
-
}
|
3212
|
-
function onAllComplete() {
|
3213
|
-
setState(UPLOAD_STATES.COMPLETED);
|
3214
|
-
if (onComplete) onComplete(files);
|
3215
|
-
}
|
3216
|
-
function renderView() {
|
3217
|
-
switch (view) {
|
3218
|
-
case "area":
|
3219
|
-
return /*#__PURE__*/React.createElement(UploadArea, {
|
3220
|
-
resumable: resumable,
|
3221
|
-
icon: icon,
|
3222
|
-
label: label
|
3223
|
-
});
|
3224
|
-
case "icon":
|
3225
|
-
return /*#__PURE__*/React.createElement(UploadIcon, {
|
3226
|
-
resumable: resumable,
|
3227
|
-
icon: icon
|
3228
|
-
});
|
3229
|
-
default:
|
3230
|
-
return /*#__PURE__*/React.createElement(UploadArea, {
|
3231
|
-
resumable: resumable,
|
3232
|
-
icon: icon,
|
3233
|
-
label: label
|
3234
|
-
});
|
3235
|
-
}
|
3220
|
+
var KanbanColumn = function KanbanColumn(_ref3) {
|
3221
|
+
var id = _ref3.id,
|
3222
|
+
actions = _ref3.actions,
|
3223
|
+
_ref3$headless = _ref3.headless,
|
3224
|
+
headless = _ref3$headless === void 0 ? false : _ref3$headless,
|
3225
|
+
icon = _ref3.icon,
|
3226
|
+
title = _ref3.title,
|
3227
|
+
subtitle = _ref3.subtitle,
|
3228
|
+
badge = _ref3.badge,
|
3229
|
+
children = _ref3.children,
|
3230
|
+
_ref3$minified = _ref3.minified,
|
3231
|
+
minified = _ref3$minified === void 0 ? false : _ref3$minified,
|
3232
|
+
_ref3$disabled = _ref3.disabled,
|
3233
|
+
disabled = _ref3$disabled === void 0 ? false : _ref3$disabled;
|
3234
|
+
var _useState2 = useState(minified),
|
3235
|
+
min = _useState2[0],
|
3236
|
+
setMin = _useState2[1];
|
3237
|
+
function toggle() {
|
3238
|
+
setMin(!min);
|
3236
3239
|
}
|
3237
|
-
return /*#__PURE__*/React.createElement("div", {
|
3238
|
-
className: "
|
3239
|
-
},
|
3240
|
-
|
3241
|
-
|
3240
|
+
return min ? /*#__PURE__*/React.createElement("div", {
|
3241
|
+
className: "kanban-column " + id + " min"
|
3242
|
+
}, /*#__PURE__*/React.createElement("main", null, title), /*#__PURE__*/React.createElement("footer", null, /*#__PURE__*/React.createElement(Icon, {
|
3243
|
+
icon: "toggle_off",
|
3244
|
+
onIcon: "toggle_on",
|
3245
|
+
clickable: true,
|
3246
|
+
action: toggle
|
3247
|
+
}))) : /*#__PURE__*/React.createElement("div", {
|
3248
|
+
className: "kanban-column " + id + " " + (disabled ? 'disabled' : '')
|
3249
|
+
}, headless ? "" : /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement(Icon, {
|
3250
|
+
icon: icon
|
3251
|
+
}), /*#__PURE__*/React.createElement("div", {
|
3252
|
+
className: "title"
|
3253
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
3254
|
+
use: "headline6"
|
3255
|
+
}, title), /*#__PURE__*/React.createElement(Text$1, {
|
3256
|
+
className: "secondary-text",
|
3257
|
+
use: "body2"
|
3258
|
+
}, subtitle)), /*#__PURE__*/React.createElement("div", {
|
3259
|
+
className: "badge"
|
3260
|
+
}, badge)), /*#__PURE__*/React.createElement("main", null, children), /*#__PURE__*/React.createElement("footer", null, /*#__PURE__*/React.createElement(Icon, {
|
3261
|
+
icon: "toggle_off",
|
3262
|
+
onIcon: "toggle_on",
|
3263
|
+
clickable: true,
|
3264
|
+
action: toggle
|
3265
|
+
}), actions));
|
3242
3266
|
};
|
3243
3267
|
|
3244
3268
|
/**
|
3245
|
-
*
|
3246
|
-
*/
|
3247
|
-
var PageContext = React.createContext({});
|
3248
|
-
|
3249
|
-
/**
|
3250
|
-
* Page Provider
|
3269
|
+
* Kanban Card
|
3251
3270
|
*/
|
3252
|
-
var
|
3253
|
-
var
|
3254
|
-
|
3255
|
-
children =
|
3256
|
-
|
3257
|
-
|
3258
|
-
setPageCtx = _useState[1];
|
3259
|
-
return /*#__PURE__*/React.createElement(PageContext.Provider, {
|
3260
|
-
value: [pageCtx, setPageCtx]
|
3271
|
+
var KanbanCard = function KanbanCard(_ref4) {
|
3272
|
+
var className = _ref4.className,
|
3273
|
+
color = _ref4.color,
|
3274
|
+
children = _ref4.children;
|
3275
|
+
return /*#__PURE__*/React.createElement("div", {
|
3276
|
+
className: "kanban-card " + className + " " + color
|
3261
3277
|
}, children);
|
3262
3278
|
};
|
3263
3279
|
|
3264
3280
|
/**
|
3265
|
-
*
|
3281
|
+
* Avatar
|
3266
3282
|
*/
|
3267
|
-
var
|
3268
|
-
var
|
3269
|
-
|
3270
|
-
|
3271
|
-
|
3272
|
-
|
3273
|
-
|
3274
|
-
|
3275
|
-
|
3276
|
-
|
3277
|
-
|
3278
|
-
|
3283
|
+
var Avatar = function Avatar(props) {
|
3284
|
+
var id = props.id,
|
3285
|
+
name = props.name,
|
3286
|
+
className = props.className,
|
3287
|
+
src = props.src,
|
3288
|
+
_props$size = props.size,
|
3289
|
+
size = _props$size === void 0 ? "small" : _props$size,
|
3290
|
+
_props$clickable = props.clickable,
|
3291
|
+
clickable = _props$clickable === void 0 ? false : _props$clickable,
|
3292
|
+
action = props.action;
|
3293
|
+
function click() {
|
3294
|
+
if (clickable) {
|
3295
|
+
action(id);
|
3296
|
+
}
|
3297
|
+
}
|
3298
|
+
var clickableStyle = clickable ? 'clickable' : '';
|
3299
|
+
var style = "avatar " + size + " " + clickableStyle + " " + className;
|
3300
|
+
return /*#__PURE__*/React.createElement("div", {
|
3301
|
+
className: style,
|
3302
|
+
onClick: click
|
3303
|
+
}, src ? /*#__PURE__*/React.createElement("img", {
|
3304
|
+
src: src
|
3305
|
+
}) : /*#__PURE__*/React.createElement("span", null, name));
|
3306
|
+
};
|
3307
|
+
|
3308
|
+
var WaitScreen = function WaitScreen() {
|
3309
|
+
return /*#__PURE__*/React.createElement("div", {
|
3310
|
+
className: "wait-screen"
|
3311
|
+
}, /*#__PURE__*/React.createElement(CircularProgress, {
|
3312
|
+
size: "large"
|
3313
|
+
}));
|
3279
3314
|
};
|
3280
3315
|
|
3316
|
+
moment$1.locale('es');
|
3317
|
+
var moment = extendMoment(moment$1);
|
3318
|
+
|
3281
3319
|
/**
|
3282
|
-
*
|
3320
|
+
* Calendar
|
3283
3321
|
*/
|
3284
|
-
var
|
3285
|
-
var
|
3286
|
-
|
3287
|
-
|
3288
|
-
|
3289
|
-
|
3290
|
-
|
3291
|
-
|
3292
|
-
|
3293
|
-
|
3294
|
-
|
3295
|
-
|
3296
|
-
|
3297
|
-
|
3298
|
-
|
3299
|
-
|
3300
|
-
|
3301
|
-
|
3302
|
-
|
3303
|
-
|
3304
|
-
|
3305
|
-
|
3306
|
-
|
3307
|
-
|
3308
|
-
|
3309
|
-
|
3310
|
-
|
3311
|
-
|
3312
|
-
|
3313
|
-
|
3314
|
-
|
3315
|
-
|
3316
|
-
|
3317
|
-
|
3318
|
-
|
3319
|
-
|
3320
|
-
|
3321
|
-
|
3322
|
-
|
3323
|
-
|
3324
|
-
|
3325
|
-
lang: lang,
|
3326
|
-
setLang: setLang,
|
3327
|
-
dictionary: dictionary,
|
3328
|
-
setDictionary: setDictionary,
|
3329
|
-
translate: function translate(key) {
|
3330
|
-
if (!key) return key;
|
3331
|
-
if (dictionary === undefined) return key;
|
3332
|
-
var term = dictionary[key];
|
3333
|
-
return term ? term[lang] : key;
|
3334
|
-
},
|
3335
|
-
sideNav: sideNav,
|
3336
|
-
setSideNav: setSideNav,
|
3337
|
-
showNav: showNav,
|
3338
|
-
setShowNav: setShowNav,
|
3339
|
-
info: info,
|
3340
|
-
openInfo: function openInfo(info) {
|
3341
|
-
setInfo(info);
|
3342
|
-
},
|
3343
|
-
closeInfo: function closeInfo() {
|
3344
|
-
setInfo(null);
|
3345
|
-
},
|
3346
|
-
consoleLines: consoleLines,
|
3347
|
-
showConsole: showConsole,
|
3348
|
-
toggleConsole: function toggleConsole() {
|
3349
|
-
setShowConsole(!showConsole);
|
3350
|
-
},
|
3351
|
-
writeLog: function writeLog(line) {
|
3352
|
-
var next = consoleLines.concat(line);
|
3353
|
-
setConsoleLines(next);
|
3354
|
-
},
|
3355
|
-
clearLog: function clearLog() {
|
3356
|
-
setConsoleLines([]);
|
3357
|
-
},
|
3358
|
-
breadcrumb: breadcrumb,
|
3359
|
-
setBreadcrumb: setBreadcrumb,
|
3360
|
-
page: page,
|
3361
|
-
"goto": function goto(id) {
|
3362
|
-
setPage(id);
|
3363
|
-
},
|
3364
|
-
dialog: dialog,
|
3365
|
-
openDialog: function openDialog(dialog) {
|
3366
|
-
setDialog(dialog);
|
3367
|
-
},
|
3368
|
-
closeDialog: function closeDialog() {
|
3369
|
-
setDialog(null);
|
3370
|
-
},
|
3371
|
-
preview: preview,
|
3372
|
-
openPreview: function openPreview(preview) {
|
3373
|
-
setPreview(preview);
|
3374
|
-
},
|
3375
|
-
closePreview: function closePreview() {
|
3376
|
-
setPreview(null);
|
3377
|
-
},
|
3378
|
-
confirm: function confirm(message) {
|
3379
|
-
return window.confirm(message);
|
3380
|
-
},
|
3381
|
-
prompt: function prompt(message) {
|
3382
|
-
return window.prompt(message);
|
3383
|
-
},
|
3384
|
-
promptDialog: promptDialog,
|
3385
|
-
openPromptDialog: function openPromptDialog(dialog) {
|
3386
|
-
setPromptDialog(dialog);
|
3387
|
-
},
|
3388
|
-
closePromptDialog: function closePromptDialog() {
|
3389
|
-
setPromptDialog(null);
|
3390
|
-
},
|
3391
|
-
notify: function notify(_ref2) {
|
3392
|
-
var title = _ref2.title,
|
3393
|
-
body = _ref2.body,
|
3394
|
-
_ref2$type = _ref2.type,
|
3395
|
-
type = _ref2$type === void 0 ? "success" : _ref2$type,
|
3396
|
-
_ref2$duration = _ref2.duration,
|
3397
|
-
duration = _ref2$duration === void 0 ? 3000 : _ref2$duration,
|
3398
|
-
onRemoval = _ref2.onRemoval;
|
3399
|
-
Store.addNotification({
|
3400
|
-
title: title,
|
3401
|
-
message: body,
|
3402
|
-
type: type,
|
3403
|
-
insert: "top",
|
3404
|
-
container: "top-right",
|
3405
|
-
animationIn: ["animate__animated", "animate__fadeIn"],
|
3406
|
-
animationOut: ["animate__animated", "animate__fadeOut"],
|
3407
|
-
dismiss: {
|
3408
|
-
duration: duration,
|
3409
|
-
onScreen: true
|
3410
|
-
},
|
3411
|
-
onRemoval: onRemoval
|
3412
|
-
});
|
3322
|
+
var Calendar = function Calendar(props) {
|
3323
|
+
var _props$events = props.events,
|
3324
|
+
events = _props$events === void 0 ? [] : _props$events,
|
3325
|
+
children = props.children,
|
3326
|
+
onChange = props.onChange,
|
3327
|
+
onRange = props.onRange;
|
3328
|
+
var _useState = useState(props.range || "year"),
|
3329
|
+
range = _useState[0],
|
3330
|
+
setRange = _useState[1];
|
3331
|
+
function onChangeRange(range) {
|
3332
|
+
setRange(range);
|
3333
|
+
if (onRange) onRange(range);
|
3334
|
+
}
|
3335
|
+
return /*#__PURE__*/React.createElement("div", {
|
3336
|
+
className: "calendar"
|
3337
|
+
}, /*#__PURE__*/React.createElement(CalendarRangeControl, {
|
3338
|
+
range: range,
|
3339
|
+
onChange: onChangeRange
|
3340
|
+
}), range === "year" && /*#__PURE__*/React.createElement(YearCalendar, {
|
3341
|
+
events: events,
|
3342
|
+
onChange: onChange
|
3343
|
+
}, children), range === "month" && /*#__PURE__*/React.createElement(MonthCalendar, {
|
3344
|
+
events: events,
|
3345
|
+
onChange: onChange,
|
3346
|
+
onRange: onChangeRange
|
3347
|
+
}, children));
|
3348
|
+
};
|
3349
|
+
|
3350
|
+
/**
|
3351
|
+
* CalendarRangeControl
|
3352
|
+
*/
|
3353
|
+
var CalendarRangeControl = function CalendarRangeControl(props) {
|
3354
|
+
var range = props.range,
|
3355
|
+
onChange = props.onChange;
|
3356
|
+
return /*#__PURE__*/React.createElement("div", {
|
3357
|
+
className: "calendar-range-control"
|
3358
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
3359
|
+
label: "Year",
|
3360
|
+
outlined: range == "year",
|
3361
|
+
action: function action() {
|
3362
|
+
return onChange("year");
|
3413
3363
|
}
|
3414
|
-
}
|
3415
|
-
|
3416
|
-
|
3417
|
-
|
3364
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
3365
|
+
label: "Month",
|
3366
|
+
outlined: range == "month",
|
3367
|
+
action: function action() {
|
3368
|
+
return onChange("month");
|
3369
|
+
}
|
3370
|
+
}));
|
3418
3371
|
};
|
3419
3372
|
|
3420
3373
|
/**
|
3421
|
-
*
|
3374
|
+
* MonthCalendar
|
3422
3375
|
*/
|
3423
|
-
var
|
3424
|
-
var
|
3425
|
-
|
3426
|
-
|
3427
|
-
|
3428
|
-
|
3429
|
-
|
3430
|
-
|
3431
|
-
|
3432
|
-
|
3433
|
-
|
3434
|
-
|
3435
|
-
|
3436
|
-
|
3437
|
-
|
3438
|
-
|
3439
|
-
|
3440
|
-
|
3441
|
-
|
3442
|
-
|
3443
|
-
|
3444
|
-
|
3445
|
-
|
3446
|
-
|
3447
|
-
|
3448
|
-
|
3449
|
-
|
3450
|
-
|
3451
|
-
|
3376
|
+
var MonthCalendar = function MonthCalendar(props) {
|
3377
|
+
var _props$events2 = props.events,
|
3378
|
+
events = _props$events2 === void 0 ? [] : _props$events2,
|
3379
|
+
children = props.children,
|
3380
|
+
onChange = props.onChange;
|
3381
|
+
var _useState2 = useState(),
|
3382
|
+
position = _useState2[0],
|
3383
|
+
setPosition = _useState2[1];
|
3384
|
+
useEffect(function () {
|
3385
|
+
var today = moment();
|
3386
|
+
setPosition(today);
|
3387
|
+
}, []);
|
3388
|
+
useEffect(function () {
|
3389
|
+
if (position && onChange) {
|
3390
|
+
var _firstDayOfMonth = position.clone().startOf('month');
|
3391
|
+
var _firstDayOfRange = _firstDayOfMonth.clone().startOf('isoweek');
|
3392
|
+
var _lastDayOfMonth = position.clone().endOf('month');
|
3393
|
+
var _lastDayOfRange = _lastDayOfMonth.clone().endOf('isoweek');
|
3394
|
+
var _range = moment.range(_firstDayOfRange, _lastDayOfRange);
|
3395
|
+
onChange(position, _range);
|
3396
|
+
}
|
3397
|
+
}, [position]);
|
3398
|
+
function next() {
|
3399
|
+
var next = position.clone().add(1, 'month');
|
3400
|
+
setPosition(next);
|
3401
|
+
}
|
3402
|
+
function prev() {
|
3403
|
+
var prev = position.clone().subtract(1, 'month');
|
3404
|
+
setPosition(prev);
|
3405
|
+
}
|
3406
|
+
function today() {
|
3407
|
+
var today = moment();
|
3408
|
+
setPosition(today);
|
3409
|
+
}
|
3410
|
+
if (!position) return "...";
|
3411
|
+
var monthName = position.format("MMMM");
|
3412
|
+
var year = position.format("YYYY");
|
3413
|
+
var firstDayOfMonth = position.clone().startOf('month');
|
3414
|
+
var firstDayOfRange = firstDayOfMonth.clone().startOf('isoweek');
|
3415
|
+
var lastDayOfMonth = position.clone().endOf('month');
|
3416
|
+
var lastDayOfRange = lastDayOfMonth.clone().endOf('isoweek');
|
3417
|
+
var range = moment.range(firstDayOfRange, lastDayOfRange);
|
3418
|
+
var days = Array.from(range.by('days'));
|
3419
|
+
var cells = days.map(function (day) {
|
3420
|
+
var eventsOfDay = events.filter(function (event) {
|
3421
|
+
var eventDay = moment(event.date);
|
3422
|
+
return eventDay.isSame(day, 'day');
|
3423
|
+
});
|
3424
|
+
var sameMonthStyle = day.isSame(moment(position), 'month') ? '' : 'other-month';
|
3425
|
+
return {
|
3426
|
+
day: day,
|
3427
|
+
events: eventsOfDay,
|
3428
|
+
sameMonthStyle: sameMonthStyle
|
3429
|
+
};
|
3430
|
+
});
|
3431
|
+
return /*#__PURE__*/React.createElement("div", {
|
3432
|
+
className: "month-calendar"
|
3433
|
+
}, /*#__PURE__*/React.createElement("nav", null, /*#__PURE__*/React.createElement("label", null, " ", /*#__PURE__*/React.createElement(Text$1, null, monthName), " ", year), /*#__PURE__*/React.createElement(Button, {
|
3434
|
+
icon: "chevron_left",
|
3435
|
+
action: prev
|
3436
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
3437
|
+
label: "Today",
|
3438
|
+
outlined: true,
|
3439
|
+
action: today
|
3440
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
3441
|
+
icon: "chevron_right",
|
3442
|
+
action: next
|
3443
|
+
})), /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement("div", {
|
3444
|
+
className: "week-day-cell"
|
3445
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, "Mon")), /*#__PURE__*/React.createElement("div", {
|
3446
|
+
className: "week-day-cell"
|
3447
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, "Tue")), /*#__PURE__*/React.createElement("div", {
|
3448
|
+
className: "week-day-cell"
|
3449
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, "Wed")), /*#__PURE__*/React.createElement("div", {
|
3450
|
+
className: "week-day-cell"
|
3451
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, "Thu")), /*#__PURE__*/React.createElement("div", {
|
3452
|
+
className: "week-day-cell"
|
3453
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, "Fri")), /*#__PURE__*/React.createElement("div", {
|
3454
|
+
className: "week-day-cell"
|
3455
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, "Sat")), /*#__PURE__*/React.createElement("div", {
|
3456
|
+
className: "week-day-cell"
|
3457
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, "Sun"))), /*#__PURE__*/React.createElement("main", null, cells.map(function (cell) {
|
3458
|
+
return /*#__PURE__*/React.createElement(DayCell, {
|
3459
|
+
key: cell.day,
|
3460
|
+
cell: cell
|
3461
|
+
}, children);
|
3462
|
+
})));
|
3452
3463
|
};
|
3453
|
-
var
|
3454
|
-
|
3464
|
+
var DayCell = function DayCell(props) {
|
3465
|
+
var _props$cell = props.cell,
|
3466
|
+
cell = _props$cell === void 0 ? [] : _props$cell,
|
3467
|
+
children = props.children;
|
3468
|
+
var day = cell.day,
|
3469
|
+
events = cell.events,
|
3470
|
+
sameMonthStyle = cell.sameMonthStyle;
|
3471
|
+
var todayStyle = day.isSame(moment(), 'day') ? 'today' : '';
|
3472
|
+
return /*#__PURE__*/React.createElement("div", {
|
3473
|
+
className: "day-cell " + todayStyle + " " + sameMonthStyle
|
3474
|
+
}, /*#__PURE__*/React.createElement("header", null, day.format("DD")), /*#__PURE__*/React.createElement("main", null, events.map(function (event) {
|
3475
|
+
return /*#__PURE__*/React.createElement(Event, {
|
3476
|
+
key: event.id,
|
3477
|
+
event: event
|
3478
|
+
}, children);
|
3479
|
+
})));
|
3455
3480
|
};
|
3456
3481
|
|
3457
3482
|
/**
|
3458
|
-
*
|
3483
|
+
* Event
|
3459
3484
|
*/
|
3460
|
-
var
|
3461
|
-
var
|
3462
|
-
|
3463
|
-
|
3464
|
-
|
3465
|
-
|
3466
|
-
|
3467
|
-
|
3468
|
-
|
3469
|
-
|
3485
|
+
var Event = function Event(props) {
|
3486
|
+
var event = props.event,
|
3487
|
+
children = props.children;
|
3488
|
+
if (children) {
|
3489
|
+
var element = React.Children.toArray(children)[0];
|
3490
|
+
return React.cloneElement(element, {
|
3491
|
+
event: event
|
3492
|
+
});
|
3493
|
+
} else {
|
3494
|
+
return /*#__PURE__*/React.createElement("div", {
|
3495
|
+
className: "event"
|
3496
|
+
}, /*#__PURE__*/React.createElement("div", {
|
3497
|
+
className: "event-name"
|
3498
|
+
}, event.title));
|
3499
|
+
}
|
3470
3500
|
};
|
3471
3501
|
|
3472
3502
|
/**
|
3473
|
-
*
|
3503
|
+
* YearCalendar
|
3474
3504
|
*/
|
3475
|
-
var
|
3476
|
-
var
|
3477
|
-
|
3505
|
+
var YearCalendar = function YearCalendar(props) {
|
3506
|
+
var _props$events3 = props.events,
|
3507
|
+
events = _props$events3 === void 0 ? [] : _props$events3,
|
3508
|
+
children = props.children,
|
3509
|
+
onChange = props.onChange;
|
3510
|
+
var _useState3 = useState(),
|
3511
|
+
position = _useState3[0],
|
3512
|
+
setPosition = _useState3[1];
|
3513
|
+
useEffect(function () {
|
3514
|
+
var today = moment();
|
3515
|
+
setPosition(today);
|
3516
|
+
}, []);
|
3517
|
+
useEffect(function () {
|
3518
|
+
if (position && onChange) {
|
3519
|
+
var _firstDayOfYear = position.clone().startOf('year');
|
3520
|
+
var firstDayOfRange = _firstDayOfYear.clone().startOf('isoweek');
|
3521
|
+
var _lastDayOfYear = position.clone().endOf('year');
|
3522
|
+
var lastDayOfRange = _lastDayOfYear.clone().endOf('isoweek');
|
3523
|
+
var range = moment.range(firstDayOfRange, lastDayOfRange);
|
3524
|
+
onChange(position, range);
|
3525
|
+
}
|
3526
|
+
}, [position]);
|
3527
|
+
function next() {
|
3528
|
+
var next = position.clone().add(1, 'year');
|
3529
|
+
setPosition(next);
|
3530
|
+
}
|
3531
|
+
function prev() {
|
3532
|
+
var prev = position.clone().subtract(1, 'year');
|
3533
|
+
setPosition(prev);
|
3534
|
+
}
|
3535
|
+
function today() {
|
3536
|
+
var today = moment();
|
3537
|
+
setPosition(today);
|
3538
|
+
}
|
3539
|
+
if (!position) return "...";
|
3540
|
+
var year = position.format("YYYY");
|
3541
|
+
var firstDayOfYear = moment(position).startOf('year');
|
3542
|
+
var lastDayOfYear = moment(position).endOf('year');
|
3543
|
+
var months = [];
|
3544
|
+
for (var currentMonth = moment(firstDayOfYear); currentMonth.isBefore(lastDayOfYear); currentMonth.add(1, 'month')) {
|
3545
|
+
months.push(moment(currentMonth));
|
3546
|
+
}
|
3547
|
+
var cells = months.map(function (month) {
|
3548
|
+
var firstDayOfMonth = month.clone().startOf('month');
|
3549
|
+
var firstDayOfRange = firstDayOfMonth.clone().startOf('isoweek');
|
3550
|
+
var lastDayOfMonth = month.clone().endOf('month');
|
3551
|
+
var lastDayOfRange = lastDayOfMonth.clone().endOf('isoweek');
|
3552
|
+
var range = moment.range(firstDayOfRange, lastDayOfRange);
|
3553
|
+
var days = Array.from(range.by('days'));
|
3554
|
+
var cells = days.map(function (day) {
|
3555
|
+
var eventsOfDay = events.filter(function (event) {
|
3556
|
+
var eventDay = moment(event.date);
|
3557
|
+
return eventDay.isSame(day, 'day');
|
3558
|
+
});
|
3559
|
+
var sameMonthStyle = day.isSame(moment(month), 'month') ? '' : 'other-month';
|
3560
|
+
return {
|
3561
|
+
day: day,
|
3562
|
+
events: eventsOfDay,
|
3563
|
+
sameMonthStyle: sameMonthStyle
|
3564
|
+
};
|
3565
|
+
});
|
3566
|
+
return {
|
3567
|
+
month: month,
|
3568
|
+
cells: cells
|
3569
|
+
};
|
3570
|
+
});
|
3571
|
+
return /*#__PURE__*/React.createElement("div", {
|
3572
|
+
className: "year-calendar"
|
3573
|
+
}, /*#__PURE__*/React.createElement("nav", null, /*#__PURE__*/React.createElement("label", null, " ", /*#__PURE__*/React.createElement(Text$1, null, year)), /*#__PURE__*/React.createElement(Button, {
|
3574
|
+
icon: "chevron_left",
|
3575
|
+
action: prev
|
3576
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
3577
|
+
label: "Today",
|
3578
|
+
outlined: true,
|
3579
|
+
action: today
|
3580
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
3581
|
+
icon: "chevron_right",
|
3582
|
+
action: next
|
3583
|
+
})), /*#__PURE__*/React.createElement("main", null, cells.map(function (cell) {
|
3584
|
+
return /*#__PURE__*/React.createElement(MonthCell, {
|
3585
|
+
key: cell.month,
|
3586
|
+
cell: cell
|
3587
|
+
}, children);
|
3588
|
+
})));
|
3478
3589
|
};
|
3479
3590
|
|
3480
3591
|
/**
|
3481
|
-
*
|
3592
|
+
* MonthCell
|
3482
3593
|
*/
|
3483
|
-
var
|
3484
|
-
var
|
3485
|
-
|
3594
|
+
var MonthCell = function MonthCell(props) {
|
3595
|
+
var _props$cell2 = props.cell,
|
3596
|
+
cell = _props$cell2 === void 0 ? [] : _props$cell2,
|
3597
|
+
children = props.children;
|
3598
|
+
var month = cell.month,
|
3599
|
+
cells = cell.cells;
|
3600
|
+
var monthName = month.format("MMMM");
|
3601
|
+
return /*#__PURE__*/React.createElement("div", {
|
3602
|
+
className: "month-cell"
|
3603
|
+
}, /*#__PURE__*/React.createElement("nav", null, monthName), /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement("div", {
|
3604
|
+
className: "week-day-cell"
|
3605
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, "Mon")), /*#__PURE__*/React.createElement("div", {
|
3606
|
+
className: "week-day-cell"
|
3607
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, "Tue")), /*#__PURE__*/React.createElement("div", {
|
3608
|
+
className: "week-day-cell"
|
3609
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, "Wed")), /*#__PURE__*/React.createElement("div", {
|
3610
|
+
className: "week-day-cell"
|
3611
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, "Thu")), /*#__PURE__*/React.createElement("div", {
|
3612
|
+
className: "week-day-cell"
|
3613
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, "Fri")), /*#__PURE__*/React.createElement("div", {
|
3614
|
+
className: "week-day-cell"
|
3615
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, "Sat")), /*#__PURE__*/React.createElement("div", {
|
3616
|
+
className: "week-day-cell"
|
3617
|
+
}, /*#__PURE__*/React.createElement(Text$1, null, "Sun"))), /*#__PURE__*/React.createElement("main", null, cells.map(function (cell) {
|
3618
|
+
return /*#__PURE__*/React.createElement(DayCell, {
|
3619
|
+
key: cell.day,
|
3620
|
+
cell: cell
|
3621
|
+
}, children);
|
3622
|
+
})));
|
3486
3623
|
};
|
3487
3624
|
|
3488
|
-
|
3489
|
-
|
3490
|
-
|
3491
|
-
|
3492
|
-
|
3493
|
-
|
3494
|
-
|
3625
|
+
var ranges = extendMoment(moment$1);
|
3626
|
+
var DATE_RANGE = [{
|
3627
|
+
label: "Week",
|
3628
|
+
value: "week"
|
3629
|
+
}, {
|
3630
|
+
label: "Month",
|
3631
|
+
value: "month"
|
3632
|
+
}, {
|
3633
|
+
label: "Year",
|
3634
|
+
value: "year"
|
3635
|
+
}];
|
3495
3636
|
|
3496
3637
|
/**
|
3497
|
-
*
|
3638
|
+
* Planner
|
3498
3639
|
*/
|
3499
|
-
var
|
3500
|
-
var
|
3501
|
-
|
3502
|
-
|
3503
|
-
|
3504
|
-
|
3505
|
-
|
3506
|
-
|
3507
|
-
|
3508
|
-
|
3509
|
-
|
3510
|
-
|
3640
|
+
var Planner = function Planner(_ref) {
|
3641
|
+
var title = _ref.title,
|
3642
|
+
_ref$events = _ref.events,
|
3643
|
+
events = _ref$events === void 0 ? [] : _ref$events,
|
3644
|
+
_ref$lanes = _ref.lanes,
|
3645
|
+
lanes = _ref$lanes === void 0 ? [] : _ref$lanes,
|
3646
|
+
_ref$navigation = _ref.navigation,
|
3647
|
+
navigation = _ref$navigation === void 0 ? true : _ref$navigation,
|
3648
|
+
onSelectCell = _ref.onSelectCell,
|
3649
|
+
focusEvent = _ref.focusEvent,
|
3650
|
+
_ref$config = _ref.config,
|
3651
|
+
config = _ref$config === void 0 ? {
|
3652
|
+
range: "year",
|
3653
|
+
from: "2022-01-01",
|
3654
|
+
to: "2022-12-30"
|
3655
|
+
} : _ref$config,
|
3656
|
+
onChange = _ref.onChange;
|
3657
|
+
var _useState = useState(config.range),
|
3658
|
+
dateRange = _useState[0],
|
3659
|
+
setDateRange = _useState[1];
|
3660
|
+
var _useState2 = useState(config.from),
|
3661
|
+
from = _useState2[0],
|
3662
|
+
setFrom = _useState2[1];
|
3663
|
+
var _useState3 = useState(config.to),
|
3664
|
+
to = _useState3[0],
|
3665
|
+
setTo = _useState3[1];
|
3666
|
+
var thisMondayElement = useRef(null);
|
3667
|
+
var gotoMonday = useCallback(function (node) {
|
3668
|
+
var element = node;
|
3669
|
+
if (element) element.scrollIntoView({
|
3670
|
+
behavior: 'smooth',
|
3671
|
+
block: 'start',
|
3672
|
+
inline: 'start'
|
3673
|
+
});
|
3511
3674
|
}, []);
|
3512
|
-
function
|
3513
|
-
var
|
3514
|
-
|
3675
|
+
useEffect(function () {
|
3676
|
+
var element = document.getElementById(focusEvent);
|
3677
|
+
if (element) element.scrollIntoView({
|
3678
|
+
behavior: 'smooth',
|
3679
|
+
block: 'center',
|
3680
|
+
inline: 'center'
|
3681
|
+
});
|
3682
|
+
}, [focusEvent]);
|
3683
|
+
useEffect(function () {
|
3684
|
+
var today = moment$1();
|
3685
|
+
var from_date = today.startOf(dateRange).format("YYYY-MM-DD");
|
3686
|
+
var to_date = today.endOf(dateRange).format("YYYY-MM-DD");
|
3687
|
+
setFrom(from_date);
|
3688
|
+
setTo(to_date);
|
3689
|
+
}, [dateRange]);
|
3690
|
+
function next() {
|
3691
|
+
var actual = moment$1(from);
|
3692
|
+
var next = actual.add(1, dateRange);
|
3693
|
+
var from_date = next.startOf(dateRange).format("YYYY-MM-DD");
|
3694
|
+
var to_date = next.endOf(dateRange).format("YYYY-MM-DD");
|
3695
|
+
setFrom(from_date);
|
3696
|
+
setTo(to_date);
|
3515
3697
|
}
|
3516
|
-
|
3517
|
-
|
3518
|
-
|
3519
|
-
|
3520
|
-
|
3521
|
-
|
3522
|
-
|
3523
|
-
|
3524
|
-
|
3525
|
-
|
3526
|
-
|
3527
|
-
|
3528
|
-
|
3529
|
-
|
3530
|
-
|
3698
|
+
function prev() {
|
3699
|
+
var actual = moment$1(from);
|
3700
|
+
var next = actual.subtract(1, dateRange);
|
3701
|
+
var from_date = next.startOf(dateRange).format("YYYY-MM-DD");
|
3702
|
+
var to_date = next.endOf(dateRange).format("YYYY-MM-DD");
|
3703
|
+
setFrom(from_date);
|
3704
|
+
setTo(to_date);
|
3705
|
+
}
|
3706
|
+
function selectCell(lane, date) {
|
3707
|
+
if (onSelectCell) onSelectCell(lane, date);
|
3708
|
+
}
|
3709
|
+
function showThisWeek() {
|
3710
|
+
var element = thisMondayElement.current;
|
3711
|
+
//const element = document.querySelector(".thisMonday")
|
3712
|
+
console.log("Show this week", element);
|
3713
|
+
if (element) element.scrollIntoView({
|
3714
|
+
behavior: 'smooth',
|
3715
|
+
block: 'start',
|
3716
|
+
inline: 'start'
|
3531
3717
|
});
|
3532
|
-
|
3533
|
-
|
3534
|
-
|
3535
|
-
|
3536
|
-
|
3537
|
-
|
3538
|
-
|
3539
|
-
|
3540
|
-
|
3541
|
-
|
3542
|
-
|
3543
|
-
|
3544
|
-
|
3545
|
-
|
3546
|
-
|
3547
|
-
|
3548
|
-
|
3549
|
-
|
3550
|
-
|
3551
|
-
|
3552
|
-
|
3553
|
-
|
3554
|
-
|
3555
|
-
|
3556
|
-
|
3557
|
-
|
3558
|
-
|
3559
|
-
|
3560
|
-
|
3561
|
-
|
3562
|
-
|
3563
|
-
|
3564
|
-
|
3565
|
-
|
3566
|
-
|
3567
|
-
|
3568
|
-
|
3569
|
-
|
3570
|
-
|
3571
|
-
|
3572
|
-
|
3573
|
-
|
3574
|
-
|
3575
|
-
|
3576
|
-
|
3718
|
+
}
|
3719
|
+
var period = useMemo(function () {
|
3720
|
+
var start = ranges(from, "YYYY-MM-DD");
|
3721
|
+
var end = ranges(to, "YYYY-MM-DD");
|
3722
|
+
var range = ranges.range(start, end);
|
3723
|
+
var period = Array.from(range.by("day")).map(function (m) {
|
3724
|
+
return {
|
3725
|
+
year: m.year(),
|
3726
|
+
month: m.month(),
|
3727
|
+
day: m.date(),
|
3728
|
+
moment: m
|
3729
|
+
};
|
3730
|
+
});
|
3731
|
+
return period;
|
3732
|
+
}, [from, to]);
|
3733
|
+
var label = /*#__PURE__*/React.createElement(Text$1, {
|
3734
|
+
use: "headline6"
|
3735
|
+
}, title);
|
3736
|
+
return /*#__PURE__*/React.createElement("div", {
|
3737
|
+
className: "planner-box"
|
3738
|
+
}, navigation ? /*#__PURE__*/React.createElement(Header, {
|
3739
|
+
title: label
|
3740
|
+
}, "\xA0\xA0", /*#__PURE__*/React.createElement(Button, {
|
3741
|
+
label: "Esta Semana",
|
3742
|
+
outlined: true,
|
3743
|
+
action: showThisWeek
|
3744
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
3745
|
+
icon: "chevron_right",
|
3746
|
+
clickable: true,
|
3747
|
+
action: next
|
3748
|
+
}), /*#__PURE__*/React.createElement(TextField, {
|
3749
|
+
id: "to",
|
3750
|
+
type: "date",
|
3751
|
+
label: "Hasta",
|
3752
|
+
value: to,
|
3753
|
+
onChange: function onChange(id, value) {
|
3754
|
+
return setTo(value);
|
3755
|
+
}
|
3756
|
+
}), /*#__PURE__*/React.createElement("div", {
|
3757
|
+
className: "expand"
|
3758
|
+
}), /*#__PURE__*/React.createElement(DropDown, {
|
3759
|
+
id: "ranges",
|
3760
|
+
label: "Rango",
|
3761
|
+
options: DATE_RANGE,
|
3762
|
+
value: dateRange,
|
3763
|
+
onChange: function onChange(id, value) {
|
3764
|
+
return setDateRange(value);
|
3765
|
+
}
|
3766
|
+
}), /*#__PURE__*/React.createElement("div", {
|
3767
|
+
className: "expand"
|
3768
|
+
}), /*#__PURE__*/React.createElement(TextField, {
|
3769
|
+
id: "from",
|
3770
|
+
type: "date",
|
3771
|
+
label: "Desde",
|
3772
|
+
value: from,
|
3773
|
+
onChange: function onChange(id, value) {
|
3774
|
+
return setFrom(value);
|
3775
|
+
}
|
3776
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
3777
|
+
icon: "chevron_left",
|
3577
3778
|
clickable: true,
|
3578
|
-
action:
|
3579
|
-
}))
|
3779
|
+
action: prev
|
3780
|
+
})) : null, /*#__PURE__*/React.createElement("main", {
|
3781
|
+
className: "planner"
|
3782
|
+
}, /*#__PURE__*/React.createElement("div", {
|
3783
|
+
className: "column0"
|
3784
|
+
}, /*#__PURE__*/React.createElement("div", {
|
3785
|
+
className: "column-header"
|
3786
|
+
}), lanes.map(function (lane) {
|
3787
|
+
return /*#__PURE__*/React.createElement("div", {
|
3788
|
+
className: "row-header"
|
3789
|
+
}, lane.label);
|
3790
|
+
})), /*#__PURE__*/React.createElement("div", {
|
3791
|
+
className: "rows"
|
3792
|
+
}, /*#__PURE__*/React.createElement("div", {
|
3793
|
+
className: "row row0"
|
3794
|
+
}, period.map(function (date, index) {
|
3795
|
+
var first = index === 0 || date.day === 1 ? "first" : "";
|
3796
|
+
return /*#__PURE__*/React.createElement("div", {
|
3797
|
+
className: "column-header"
|
3798
|
+
}, /*#__PURE__*/React.createElement("div", {
|
3799
|
+
className: "month-header " + first
|
3800
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
3801
|
+
use: "overline"
|
3802
|
+
}, date.moment.format("MMM"))));
|
3803
|
+
})), /*#__PURE__*/React.createElement("div", {
|
3804
|
+
className: "row row1"
|
3805
|
+
}, period.map(function (date) {
|
3806
|
+
var isWekend = [0, 6].includes(date.moment.day());
|
3807
|
+
var weekend = isWekend ? "weekend" : "";
|
3808
|
+
var thisWeek = moment$1().startOf('week').isSame(date.moment, "week") ? "thisWeek" : "";
|
3809
|
+
var today = moment$1();
|
3810
|
+
var weekStart = today.clone().startOf('week');
|
3811
|
+
var isThisMonday = date.moment.isSame(weekStart);
|
3812
|
+
return /*#__PURE__*/React.createElement("div", {
|
3813
|
+
key: "column-" + date.moment.dayOfYear(),
|
3814
|
+
id: isThisMonday ? "thisMonday" : "",
|
3815
|
+
className: "column-header",
|
3816
|
+
ref: isThisMonday ? thisMondayElement : null
|
3817
|
+
}, /*#__PURE__*/React.createElement("div", {
|
3818
|
+
className: "date-header " + weekend + " " + thisWeek,
|
3819
|
+
ref: isThisMonday ? gotoMonday : null
|
3820
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
3821
|
+
use: "headline6"
|
3822
|
+
}, date.moment.format("DD")), "\xA0", /*#__PURE__*/React.createElement(Text$1, {
|
3823
|
+
use: "caption"
|
3824
|
+
}, date.moment.format("ddd"))));
|
3825
|
+
})), lanes.map(function (lane) {
|
3826
|
+
return /*#__PURE__*/React.createElement(PlannerRow, {
|
3827
|
+
key: lane.id,
|
3828
|
+
lane: lane,
|
3829
|
+
events: events,
|
3830
|
+
period: period,
|
3831
|
+
onSelectCell: selectCell,
|
3832
|
+
onChange: onChange
|
3833
|
+
});
|
3834
|
+
}))));
|
3580
3835
|
};
|
3581
3836
|
|
3582
3837
|
/**
|
3583
|
-
*
|
3838
|
+
* Planner Row
|
3584
3839
|
*/
|
3585
|
-
var
|
3586
|
-
var
|
3587
|
-
|
3588
|
-
|
3589
|
-
|
3590
|
-
|
3591
|
-
|
3592
|
-
|
3593
|
-
|
3594
|
-
|
3595
|
-
|
3596
|
-
|
3597
|
-
|
3598
|
-
|
3840
|
+
var PlannerRow = function PlannerRow(props) {
|
3841
|
+
var lane = props.lane,
|
3842
|
+
_props$events = props.events,
|
3843
|
+
events = _props$events === void 0 ? [] : _props$events,
|
3844
|
+
period = props.period,
|
3845
|
+
onSelectCell = props.onSelectCell,
|
3846
|
+
onChange = props.onChange;
|
3847
|
+
var rowEvents = events.filter(function (event) {
|
3848
|
+
return event.lane === lane.id;
|
3849
|
+
});
|
3850
|
+
function change(data) {
|
3851
|
+
if (onChange) onChange(data);
|
3852
|
+
}
|
3853
|
+
return /*#__PURE__*/React.createElement("div", {
|
3854
|
+
className: "row"
|
3855
|
+
}, period.map(function (date) {
|
3856
|
+
var slotDate = new Date(date.year, date.month, date.day);
|
3857
|
+
slotDate.setHours(0, 0, 0);
|
3858
|
+
var cellEvents = rowEvents.filter(function (event) {
|
3859
|
+
var eventDate = new Date(event.date);
|
3860
|
+
eventDate.setHours(0, 0, 0);
|
3861
|
+
return eventDate.getTime() === slotDate.getTime();
|
3862
|
+
});
|
3863
|
+
return /*#__PURE__*/React.createElement(PlannerCell, {
|
3864
|
+
key: lane.id + "-" + slotDate.toString(),
|
3865
|
+
lane: lane,
|
3866
|
+
date: date,
|
3867
|
+
events: cellEvents,
|
3868
|
+
onSelect: onSelectCell,
|
3869
|
+
onDrop: change
|
3870
|
+
});
|
3599
3871
|
}));
|
3600
3872
|
};
|
3601
3873
|
|
3602
3874
|
/**
|
3603
|
-
*
|
3875
|
+
* Planner Cell
|
3604
3876
|
*/
|
3605
|
-
var
|
3606
|
-
var
|
3607
|
-
|
3877
|
+
var PlannerCell = function PlannerCell(_ref2) {
|
3878
|
+
var lane = _ref2.lane,
|
3879
|
+
events = _ref2.events,
|
3880
|
+
date = _ref2.date,
|
3881
|
+
onSelect = _ref2.onSelect,
|
3882
|
+
onDrop = _ref2.onDrop;
|
3883
|
+
var _useState4 = useState(false),
|
3884
|
+
dragOver = _useState4[0],
|
3885
|
+
setDragOver = _useState4[1];
|
3886
|
+
function select() {
|
3887
|
+
if (onSelect) onSelect(lane, date.moment.format("YYYY-MM-DD"));
|
3888
|
+
}
|
3889
|
+
function onDragOver(event) {
|
3890
|
+
if (!dragOver) setDragOver(true);
|
3891
|
+
event.stopPropagation();
|
3892
|
+
event.preventDefault();
|
3893
|
+
}
|
3894
|
+
function onDragLeave(event) {
|
3895
|
+
setDragOver(false);
|
3896
|
+
event.stopPropagation();
|
3897
|
+
event.preventDefault();
|
3898
|
+
}
|
3899
|
+
function drop(event) {
|
3900
|
+
event.stopPropagation();
|
3901
|
+
event.preventDefault();
|
3902
|
+
var id = event.dataTransfer.getData("text");
|
3903
|
+
if (onDrop) onDrop({
|
3904
|
+
id: id,
|
3905
|
+
lane: lane.id,
|
3906
|
+
date: date.moment.format("YYYY-MM-DD")
|
3907
|
+
});
|
3908
|
+
setDragOver(false);
|
3909
|
+
}
|
3910
|
+
var isWekend = [0, 6].includes(date.moment.day());
|
3911
|
+
var weekend = isWekend ? "weekend" : "";
|
3912
|
+
var today = moment$1();
|
3913
|
+
var weekStart = today.clone().startOf('week');
|
3914
|
+
var thisMonday = date.moment.isSame(weekStart) ? "thisMonday" : "";
|
3915
|
+
var dragOverStyle = dragOver ? "drag-over" : "";
|
3916
|
+
return /*#__PURE__*/React.createElement("div", {
|
3917
|
+
className: "cell " + thisMonday + " " + weekend + " " + dragOverStyle,
|
3918
|
+
onDragOver: onDragOver,
|
3919
|
+
onDragLeave: onDragLeave,
|
3920
|
+
onDrop: drop,
|
3921
|
+
onClick: select
|
3922
|
+
}, events.map(function (event) {
|
3923
|
+
var _event$Renderer = event.Renderer,
|
3924
|
+
Renderer = _event$Renderer === void 0 ? EventCard : _event$Renderer;
|
3925
|
+
return /*#__PURE__*/React.createElement(Renderer, {
|
3926
|
+
key: event.id,
|
3927
|
+
event: event
|
3928
|
+
});
|
3929
|
+
}));
|
3608
3930
|
};
|
3609
|
-
|
3610
|
-
|
3611
|
-
|
3612
|
-
|
3613
|
-
var
|
3614
|
-
|
3615
|
-
|
3931
|
+
var EventCard = function EventCard(props) {
|
3932
|
+
var event = props.event;
|
3933
|
+
var title = event.title,
|
3934
|
+
color = event.color;
|
3935
|
+
var style = {
|
3936
|
+
backgroundColor: color,
|
3937
|
+
color: "white"
|
3938
|
+
};
|
3939
|
+
return /*#__PURE__*/React.createElement("div", {
|
3940
|
+
draggable: "true",
|
3941
|
+
className: "event-card",
|
3942
|
+
style: style
|
3943
|
+
}, title);
|
3616
3944
|
};
|
3617
3945
|
|
3618
3946
|
/**
|
3619
|
-
*
|
3947
|
+
* Upload Area
|
3620
3948
|
*/
|
3621
|
-
var
|
3622
|
-
var
|
3623
|
-
|
3624
|
-
|
3625
|
-
|
3949
|
+
var UploadArea = function UploadArea(props) {
|
3950
|
+
var _props$label = props.label,
|
3951
|
+
label = _props$label === void 0 ? 'Add file or drop file here...' : _props$label;
|
3952
|
+
var areaElement = useRef();
|
3953
|
+
var _useState = useState(false),
|
3954
|
+
drag = _useState[0],
|
3955
|
+
setDrag = _useState[1];
|
3956
|
+
var resumable = props.resumable;
|
3957
|
+
useEffect(function () {
|
3958
|
+
if (resumable && areaElement) {
|
3959
|
+
resumable.assignDrop(areaElement.current);
|
3960
|
+
}
|
3961
|
+
}, []);
|
3962
|
+
var onDragOver = function onDragOver() {
|
3963
|
+
setDrag(true);
|
3964
|
+
};
|
3965
|
+
var onDragLeave = function onDragLeave() {
|
3966
|
+
setDrag(false);
|
3967
|
+
};
|
3968
|
+
var dragging = drag === true ? 'drag-over' : '';
|
3969
|
+
return /*#__PURE__*/React.createElement("div", {
|
3970
|
+
className: "upload-area6 " + dragging,
|
3971
|
+
onDragOver: onDragOver,
|
3972
|
+
onDragLeave: onDragLeave,
|
3973
|
+
ref: areaElement
|
3974
|
+
}, /*#__PURE__*/React.createElement(UploadIcon, {
|
3975
|
+
resumable: resumable
|
3976
|
+
}), /*#__PURE__*/React.createElement("label", null, label));
|
3626
3977
|
};
|
3627
3978
|
|
3628
3979
|
/**
|
3629
|
-
*
|
3630
|
-
*/
|
3631
|
-
var
|
3632
|
-
var
|
3633
|
-
|
3634
|
-
|
3635
|
-
|
3636
|
-
|
3637
|
-
|
3638
|
-
|
3639
|
-
|
3640
|
-
}
|
3641
|
-
|
3642
|
-
|
3643
|
-
|
3644
|
-
|
3645
|
-
|
3646
|
-
|
3647
|
-
|
3648
|
-
|
3649
|
-
|
3980
|
+
* Upload Icon
|
3981
|
+
*/
|
3982
|
+
var UploadIcon = function UploadIcon(_ref) {
|
3983
|
+
var _ref$icon = _ref.icon,
|
3984
|
+
icon = _ref$icon === void 0 ? "folder_open" : _ref$icon,
|
3985
|
+
resumable = _ref.resumable;
|
3986
|
+
var iconElement = useRef();
|
3987
|
+
useEffect(function () {
|
3988
|
+
if (resumable && iconElement.current) {
|
3989
|
+
resumable.assignBrowse(iconElement.current);
|
3990
|
+
}
|
3991
|
+
}, [iconElement]);
|
3992
|
+
return /*#__PURE__*/React.createElement("div", {
|
3993
|
+
className: "upload-icon",
|
3994
|
+
ref: iconElement
|
3995
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
3996
|
+
icon: icon,
|
3997
|
+
clickable: true
|
3998
|
+
}));
|
3999
|
+
};
|
4000
|
+
|
4001
|
+
var UPLOAD_STATES = {
|
4002
|
+
IDLE: 0,
|
4003
|
+
RUNNING: 1,
|
4004
|
+
SUCCESS: 2,
|
4005
|
+
ERROR: 3,
|
4006
|
+
COMPLETED: 4
|
3650
4007
|
};
|
3651
4008
|
|
3652
4009
|
/**
|
3653
|
-
*
|
3654
|
-
*
|
3655
|
-
* <Dialog title={title} open={true} actions={actions}>
|
4010
|
+
* Upload File
|
3656
4011
|
*/
|
3657
|
-
var
|
3658
|
-
var
|
3659
|
-
var icon =
|
3660
|
-
|
3661
|
-
|
3662
|
-
|
3663
|
-
|
3664
|
-
actions = props.actions,
|
3665
|
-
className = props.className,
|
3666
|
-
onClose = props.onClose,
|
3667
|
-
_props$overlayCanClos = props.overlayCanClose,
|
3668
|
-
overlayCanClose = _props$overlayCanClos === void 0 ? true : _props$overlayCanClos;
|
3669
|
-
function overlayClose() {
|
3670
|
-
if (overlayCanClose) {
|
3671
|
-
close();
|
3672
|
-
}
|
3673
|
-
}
|
3674
|
-
function close() {
|
3675
|
-
if (onClose) onClose();
|
3676
|
-
if (className === "prompt") {
|
3677
|
-
site.closePromptDialog();
|
3678
|
-
} else {
|
3679
|
-
site.closeDialog();
|
3680
|
-
}
|
3681
|
-
}
|
4012
|
+
var UploadFile$1 = function UploadFile(_ref) {
|
4013
|
+
var file = _ref.file;
|
4014
|
+
var icon = file.icon,
|
4015
|
+
name = file.name,
|
4016
|
+
state = file.state,
|
4017
|
+
progress = file.progress,
|
4018
|
+
error = file.error;
|
3682
4019
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
3683
|
-
className: "
|
3684
|
-
|
3685
|
-
}), /*#__PURE__*/React.createElement("dialog", {
|
3686
|
-
className: "dialog-panel " + className
|
3687
|
-
}, /*#__PURE__*/React.createElement("header", null, icon ? /*#__PURE__*/React.createElement(MenuIcon, {
|
4020
|
+
className: "upload-file"
|
4021
|
+
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
3688
4022
|
icon: icon
|
3689
|
-
}) : null, /*#__PURE__*/React.createElement(
|
4023
|
+
}) : null, /*#__PURE__*/React.createElement("label", null, name), state === UPLOAD_STATES.RUNNING ? /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement(LinearProgress, {
|
4024
|
+
progress: progress
|
4025
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
4026
|
+
icon: "close",
|
4027
|
+
clickable: true
|
4028
|
+
})) : '', state === UPLOAD_STATES.SUCCESS ? /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement(Icon, {
|
4029
|
+
icon: "done"
|
4030
|
+
})) : '', state === UPLOAD_STATES.ERROR ? /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement("div", {
|
4031
|
+
className: "error"
|
4032
|
+
}, error), /*#__PURE__*/React.createElement(Icon, {
|
4033
|
+
icon: "error"
|
4034
|
+
})) : ''));
|
4035
|
+
};
|
4036
|
+
|
4037
|
+
var UploadProgress = function UploadProgress(_ref) {
|
4038
|
+
var _ref$files = _ref.files,
|
4039
|
+
files = _ref$files === void 0 ? [] : _ref$files;
|
4040
|
+
return /*#__PURE__*/React.createElement("div", null, files.map(function (file) {
|
4041
|
+
var f = {
|
4042
|
+
icon: "description",
|
4043
|
+
name: file.fileName,
|
4044
|
+
progress: file.progress() * 100,
|
4045
|
+
state: file.uploadState,
|
4046
|
+
error: file.uploadError
|
4047
|
+
};
|
4048
|
+
return /*#__PURE__*/React.createElement(UploadFile$1, {
|
4049
|
+
key: f.name,
|
4050
|
+
file: f
|
4051
|
+
});
|
4052
|
+
}));
|
3690
4053
|
};
|
3691
4054
|
|
3692
4055
|
/**
|
3693
|
-
*
|
4056
|
+
* Uploader
|
3694
4057
|
*/
|
3695
|
-
var
|
3696
|
-
var
|
3697
|
-
|
3698
|
-
|
3699
|
-
|
3700
|
-
|
3701
|
-
|
3702
|
-
|
3703
|
-
|
3704
|
-
|
3705
|
-
|
3706
|
-
|
3707
|
-
|
3708
|
-
|
3709
|
-
|
3710
|
-
|
3711
|
-
|
4058
|
+
var Uploader = function Uploader(_ref) {
|
4059
|
+
var icon = _ref.icon,
|
4060
|
+
label = _ref.label,
|
4061
|
+
_ref$view = _ref.view,
|
4062
|
+
view = _ref$view === void 0 ? "area" : _ref$view,
|
4063
|
+
target = _ref.target,
|
4064
|
+
accept = _ref.accept,
|
4065
|
+
_ref$simultaneousUplo = _ref.simultaneousUploads,
|
4066
|
+
simultaneousUploads = _ref$simultaneousUplo === void 0 ? 1 : _ref$simultaneousUplo,
|
4067
|
+
className = _ref.className,
|
4068
|
+
onProgress = _ref.onProgress,
|
4069
|
+
onSuccess = _ref.onSuccess,
|
4070
|
+
onError = _ref.onError,
|
4071
|
+
onComplete = _ref.onComplete;
|
4072
|
+
var resumable = useMemo(function () {
|
4073
|
+
var config = {
|
4074
|
+
target: target,
|
4075
|
+
chunkSize: 1 * 1024 * 1024,
|
4076
|
+
simultaneousUploads: simultaneousUploads,
|
4077
|
+
testChunks: false,
|
4078
|
+
throttleProgressCallbacks: 1,
|
4079
|
+
fileType: accept
|
4080
|
+
};
|
4081
|
+
var resumable = new ResumableJS(config);
|
4082
|
+
resumable.on('fileAdded', onFileAdded);
|
4083
|
+
resumable.on('fileProgress', onFileProgress);
|
4084
|
+
resumable.on('fileSuccess', onFileSuccess);
|
4085
|
+
resumable.on('fileError', onFileError);
|
4086
|
+
resumable.on('complete', onAllComplete);
|
4087
|
+
return resumable;
|
4088
|
+
}, []);
|
4089
|
+
var _useState = useState(0),
|
4090
|
+
setProgress = _useState[1];
|
4091
|
+
var _useState2 = useState(UPLOAD_STATES.IDLE),
|
4092
|
+
state = _useState2[0],
|
4093
|
+
setState = _useState2[1];
|
4094
|
+
var _useState3 = useState([]),
|
4095
|
+
files = _useState3[0],
|
4096
|
+
setFiles = _useState3[1];
|
4097
|
+
function onFileAdded(file) {
|
4098
|
+
files.push(file);
|
4099
|
+
setFiles(files);
|
4100
|
+
setState(UPLOAD_STATES.RUNNING);
|
4101
|
+
resumable.upload();
|
3712
4102
|
}
|
3713
|
-
function
|
3714
|
-
|
4103
|
+
function onFileProgress(file) {
|
4104
|
+
file.uploadState = UPLOAD_STATES.RUNNING;
|
4105
|
+
var progress = file.progress();
|
4106
|
+
setProgress(progress);
|
4107
|
+
if (onProgress) onProgress(files);
|
3715
4108
|
}
|
3716
|
-
|
3717
|
-
|
3718
|
-
|
3719
|
-
}
|
3720
|
-
|
3721
|
-
|
3722
|
-
|
3723
|
-
|
3724
|
-
}
|
3725
|
-
|
3726
|
-
|
3727
|
-
|
3728
|
-
|
3729
|
-
|
3730
|
-
|
3731
|
-
|
3732
|
-
|
3733
|
-
|
3734
|
-
|
3735
|
-
|
3736
|
-
|
3737
|
-
|
3738
|
-
|
3739
|
-
|
3740
|
-
|
3741
|
-
|
3742
|
-
|
3743
|
-
|
3744
|
-
|
3745
|
-
|
3746
|
-
|
3747
|
-
|
3748
|
-
});
|
3749
|
-
});
|
3750
|
-
useEffect(function () {
|
3751
|
-
if (selected && selected !== tab) setTab(selected);
|
3752
|
-
}, [selected]);
|
3753
|
-
var toolbar = /*#__PURE__*/React.createElement(Tabs, {
|
3754
|
-
selected: tab,
|
3755
|
-
onChange: function onChange(tab) {
|
3756
|
-
return setTab(tab);
|
4109
|
+
function onFileSuccess(file, message) {
|
4110
|
+
file.uploadState = UPLOAD_STATES.SUCCESS;
|
4111
|
+
if (onSuccess) onSuccess(file, message);
|
4112
|
+
}
|
4113
|
+
function onFileError(file, message) {
|
4114
|
+
file.uploadState = UPLOAD_STATES.ERROR;
|
4115
|
+
file.uploadError = message;
|
4116
|
+
if (onError) onError(file, message);
|
4117
|
+
}
|
4118
|
+
function onAllComplete() {
|
4119
|
+
setState(UPLOAD_STATES.COMPLETED);
|
4120
|
+
if (onComplete) onComplete(files);
|
4121
|
+
}
|
4122
|
+
function renderView() {
|
4123
|
+
switch (view) {
|
4124
|
+
case "area":
|
4125
|
+
return /*#__PURE__*/React.createElement(UploadArea, {
|
4126
|
+
resumable: resumable,
|
4127
|
+
icon: icon,
|
4128
|
+
label: label
|
4129
|
+
});
|
4130
|
+
case "icon":
|
4131
|
+
return /*#__PURE__*/React.createElement(UploadIcon, {
|
4132
|
+
resumable: resumable,
|
4133
|
+
icon: icon
|
4134
|
+
});
|
4135
|
+
default:
|
4136
|
+
return /*#__PURE__*/React.createElement(UploadArea, {
|
4137
|
+
resumable: resumable,
|
4138
|
+
icon: icon,
|
4139
|
+
label: label
|
4140
|
+
});
|
3757
4141
|
}
|
3758
|
-
}
|
3759
|
-
return /*#__PURE__*/React.createElement(
|
3760
|
-
|
3761
|
-
|
3762
|
-
|
3763
|
-
}
|
3764
|
-
selected: tab
|
3765
|
-
}, children));
|
4142
|
+
}
|
4143
|
+
return /*#__PURE__*/React.createElement("div", {
|
4144
|
+
className: "uploader " + className
|
4145
|
+
}, state === UPLOAD_STATES.IDLE ? renderView() : /*#__PURE__*/React.createElement(UploadProgress, {
|
4146
|
+
files: files
|
4147
|
+
}));
|
3766
4148
|
};
|
3767
4149
|
|
3768
4150
|
/**
|
@@ -3804,7 +4186,7 @@ var UploadDialog = function UploadDialog(_ref) {
|
|
3804
4186
|
},
|
3805
4187
|
disabled: !canClose()
|
3806
4188
|
}));
|
3807
|
-
var title = /*#__PURE__*/React.createElement(Text, {
|
4189
|
+
var title = /*#__PURE__*/React.createElement(Text$1, {
|
3808
4190
|
use: "headline6"
|
3809
4191
|
}, label);
|
3810
4192
|
return /*#__PURE__*/React.createElement(Dialog, {
|
@@ -3921,7 +4303,7 @@ var FileExplorerView = function FileExplorerView(props) {
|
|
3921
4303
|
var folder = folders.find(function (folder) {
|
3922
4304
|
return folder.id === selectedFolder;
|
3923
4305
|
});
|
3924
|
-
var folderTitle = folder ? /*#__PURE__*/React.createElement(Text, null, folder.title) : '';
|
4306
|
+
var folderTitle = folder ? /*#__PURE__*/React.createElement(Text$1, null, folder.title) : '';
|
3925
4307
|
function switchView() {
|
3926
4308
|
setView(view === 'grid' ? 'list' : 'grid');
|
3927
4309
|
}
|
@@ -4129,7 +4511,7 @@ var EmptyMessage = function EmptyMessage(_ref) {
|
|
4129
4511
|
className: "empty"
|
4130
4512
|
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Icon, {
|
4131
4513
|
icon: icon
|
4132
|
-
})), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Text, {
|
4514
|
+
})), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Text$1, {
|
4133
4515
|
use: "subtitle2"
|
4134
4516
|
}, text));
|
4135
4517
|
};
|
@@ -4261,7 +4643,7 @@ var DataTable = function DataTable(props) {
|
|
4261
4643
|
}, /*#__PURE__*/React.createElement("div", null, id === "checked" && onCheckAll ? /*#__PURE__*/React.createElement(CheckBox, {
|
4262
4644
|
onChange: checkAll,
|
4263
4645
|
value: allChecked
|
4264
|
-
}) : /*#__PURE__*/React.createElement(Text, {
|
4646
|
+
}) : /*#__PURE__*/React.createElement(Text$1, {
|
4265
4647
|
key: "th_" + id
|
4266
4648
|
}, label), sortable ? /*#__PURE__*/React.createElement(SortIcon, {
|
4267
4649
|
sortDir: sortDir[id],
|
@@ -4988,7 +5370,7 @@ var Token = function Token(_ref2) {
|
|
4988
5370
|
onDelete = _ref2.onDelete;
|
4989
5371
|
return /*#__PURE__*/React.createElement("div", {
|
4990
5372
|
className: "token"
|
4991
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
5373
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
4992
5374
|
use: "caption",
|
4993
5375
|
tag: "div"
|
4994
5376
|
}, text), /*#__PURE__*/React.createElement(Icon, {
|
@@ -5024,7 +5406,7 @@ var TreeNode = function TreeNode(_ref2) {
|
|
5024
5406
|
children = _ref2.children,
|
5025
5407
|
actions = _ref2.actions,
|
5026
5408
|
onSelect = _ref2.onSelect;
|
5027
|
-
var labelTxt = label ? /*#__PURE__*/React.createElement(Text, {
|
5409
|
+
var labelTxt = label ? /*#__PURE__*/React.createElement(Text$1, {
|
5028
5410
|
format: TEXTFORMATS.STRING
|
5029
5411
|
}, label) : null;
|
5030
5412
|
function select() {
|
@@ -5064,7 +5446,7 @@ var TreeItem = function TreeItem(_ref3) {
|
|
5064
5446
|
if (onSelect) onSelect(id);
|
5065
5447
|
}
|
5066
5448
|
var style = selected ? "selected" : "";
|
5067
|
-
var labelTxt = label ? /*#__PURE__*/React.createElement(Text, {
|
5449
|
+
var labelTxt = label ? /*#__PURE__*/React.createElement(Text$1, {
|
5068
5450
|
format: TEXTFORMATS.STRING
|
5069
5451
|
}, label) : null;
|
5070
5452
|
return /*#__PURE__*/React.createElement("div", {
|
@@ -5847,7 +6229,7 @@ var TaskMonitor = function TaskMonitor(props) {
|
|
5847
6229
|
}).map(function (task) {
|
5848
6230
|
return {
|
5849
6231
|
id: task.id,
|
5850
|
-
state: /*#__PURE__*/React.createElement(Text, null, task.state),
|
6232
|
+
state: /*#__PURE__*/React.createElement(Text$1, null, task.state),
|
5851
6233
|
description: task.description,
|
5852
6234
|
message: task.message,
|
5853
6235
|
progress: /*#__PURE__*/React.createElement(LinearProgress, {
|
@@ -5949,7 +6331,6 @@ var UploadForm = function UploadForm(props) {
|
|
5949
6331
|
}
|
5950
6332
|
function handleFiles(files) {
|
5951
6333
|
var file = files[0];
|
5952
|
-
console.log("handleFiles", files, file);
|
5953
6334
|
setFile(file);
|
5954
6335
|
}
|
5955
6336
|
function handleFile(e) {
|
@@ -6484,7 +6865,7 @@ var TreededContentEditor = function TreededContentEditor(_ref4) {
|
|
6484
6865
|
}
|
6485
6866
|
return /*#__PURE__*/React.createElement("div", {
|
6486
6867
|
className: "content-editor treeded-editor"
|
6487
|
-
}, /*#__PURE__*/React.createElement("menu", null, /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement(Text, {
|
6868
|
+
}, /*#__PURE__*/React.createElement("menu", null, /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement(Text$1, {
|
6488
6869
|
use: "caption"
|
6489
6870
|
}, "Tree Editor")), /*#__PURE__*/React.createElement(Tree, null, nodes.map(function (node, index) {
|
6490
6871
|
return /*#__PURE__*/React.createElement(TreeNode, {
|
@@ -6636,7 +7017,7 @@ var EntityEditor = function EntityEditor(_ref6) {
|
|
6636
7017
|
var sections = content.sections();
|
6637
7018
|
return /*#__PURE__*/React.createElement("div", {
|
6638
7019
|
className: "entity-editor"
|
6639
|
-
}, /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement(Text, {
|
7020
|
+
}, /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement(Text$1, {
|
6640
7021
|
use: "caption"
|
6641
7022
|
}, label)), sections.map(function (section) {
|
6642
7023
|
var title = section.title,
|
@@ -6883,7 +7264,7 @@ var MultiSelectionEditor = function MultiSelectionEditor(_ref10) {
|
|
6883
7264
|
}
|
6884
7265
|
return /*#__PURE__*/React.createElement("div", {
|
6885
7266
|
className: "multiselection-editor"
|
6886
|
-
}, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement(Text, null, label)), buildOptions().map(function (option) {
|
7267
|
+
}, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement(Text$1, null, label)), buildOptions().map(function (option) {
|
6887
7268
|
var checked = value.includes(option.value);
|
6888
7269
|
switch (format) {
|
6889
7270
|
case FORMATS$1.CHECKBOX:
|
@@ -7087,7 +7468,7 @@ var TableEditor$3 = function TableEditor(props) {
|
|
7087
7468
|
className: "empty-message"
|
7088
7469
|
}, /*#__PURE__*/React.createElement(Icon, {
|
7089
7470
|
icon: "search_off"
|
7090
|
-
}), /*#__PURE__*/React.createElement(Text, null, "No Result Found"));
|
7471
|
+
}), /*#__PURE__*/React.createElement(Text$1, null, "No Result Found"));
|
7091
7472
|
var groups = items.reduce(function (groups, item) {
|
7092
7473
|
var groupName = item[groupBy];
|
7093
7474
|
if (!groupName) groupName = ("NO " + groupBy).toUpperCase();
|
@@ -7180,7 +7561,7 @@ var TableEditor$3 = function TableEditor(props) {
|
|
7180
7561
|
}
|
7181
7562
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
7182
7563
|
icon: icon,
|
7183
|
-
title: /*#__PURE__*/React.createElement(Text, null, title)
|
7564
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, title)
|
7184
7565
|
}, /*#__PURE__*/React.createElement(DropDown, {
|
7185
7566
|
id: "groupBy",
|
7186
7567
|
label: "Agrupar Por",
|
@@ -7449,7 +7830,7 @@ var CreateContentDialog = function CreateContentDialog(_ref) {
|
|
7449
7830
|
disabled: !isValid,
|
7450
7831
|
raised: true
|
7451
7832
|
}));
|
7452
|
-
var title = /*#__PURE__*/React.createElement(Text, {
|
7833
|
+
var title = /*#__PURE__*/React.createElement(Text$1, {
|
7453
7834
|
use: "headline6"
|
7454
7835
|
}, label);
|
7455
7836
|
var content = new Content(type, form);
|
@@ -7465,7 +7846,7 @@ var CreateContentDialog = function CreateContentDialog(_ref) {
|
|
7465
7846
|
className: className,
|
7466
7847
|
outlined: outlined
|
7467
7848
|
}), errors.map(function (error) {
|
7468
|
-
return /*#__PURE__*/React.createElement(Text, {
|
7849
|
+
return /*#__PURE__*/React.createElement(Text$1, {
|
7469
7850
|
use: "overline",
|
7470
7851
|
tag: "div",
|
7471
7852
|
className: "error"
|
@@ -7531,7 +7912,7 @@ var EditContentDialog = function EditContentDialog(_ref) {
|
|
7531
7912
|
disabled: !isValid,
|
7532
7913
|
raised: true
|
7533
7914
|
}));
|
7534
|
-
var title = /*#__PURE__*/React.createElement(Text, {
|
7915
|
+
var title = /*#__PURE__*/React.createElement(Text$1, {
|
7535
7916
|
use: "headline6"
|
7536
7917
|
}, label);
|
7537
7918
|
var content = new Content(type, form);
|
@@ -7546,7 +7927,7 @@ var EditContentDialog = function EditContentDialog(_ref) {
|
|
7546
7927
|
filter: filterForm,
|
7547
7928
|
className: className
|
7548
7929
|
}), errors.map(function (error) {
|
7549
|
-
return /*#__PURE__*/React.createElement(Text, {
|
7930
|
+
return /*#__PURE__*/React.createElement(Text$1, {
|
7550
7931
|
use: "overline",
|
7551
7932
|
tag: "div",
|
7552
7933
|
className: "error"
|
@@ -7773,7 +8154,7 @@ var CollectionPage$1 = function CollectionPage(props) {
|
|
7773
8154
|
var hiddenStyle = pageContext.selected ? "hidden" : "";
|
7774
8155
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
7775
8156
|
className: "collection-page " + className,
|
7776
|
-
title: /*#__PURE__*/React.createElement(Text, null, title2)
|
8157
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, title2)
|
7777
8158
|
}, canAdd ? /*#__PURE__*/React.createElement(Button, {
|
7778
8159
|
icon: "add",
|
7779
8160
|
label: "Add",
|
@@ -8253,7 +8634,7 @@ var CollectionEditor$1 = function CollectionEditor(props) {
|
|
8253
8634
|
}
|
8254
8635
|
}
|
8255
8636
|
var hasMenu = canDelete;
|
8256
|
-
var saveLabel = /*#__PURE__*/React.createElement(Text, null, "Guardar Cambios");
|
8637
|
+
var saveLabel = /*#__PURE__*/React.createElement(Text$1, null, "Guardar Cambios");
|
8257
8638
|
return selected && form ? /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
8258
8639
|
icon: icon,
|
8259
8640
|
title: renderTitle()
|
@@ -8696,7 +9077,7 @@ var TablePage = function TablePage(props) {
|
|
8696
9077
|
}, total), " ", title);
|
8697
9078
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
8698
9079
|
className: "table-page " + className,
|
8699
|
-
title: /*#__PURE__*/React.createElement(Text, null, title2)
|
9080
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, title2)
|
8700
9081
|
}, canAdd ? /*#__PURE__*/React.createElement(Button, {
|
8701
9082
|
icon: "add",
|
8702
9083
|
label: "A\xF1adir",
|
@@ -8853,7 +9234,7 @@ var TableQueries$2 = function TableQueries(props) {
|
|
8853
9234
|
}
|
8854
9235
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
8855
9236
|
className: "table-queries",
|
8856
|
-
title: /*#__PURE__*/React.createElement(Text, null, "Queries")
|
9237
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, "Queries")
|
8857
9238
|
}), /*#__PURE__*/React.createElement("main", {
|
8858
9239
|
className: "table-queries"
|
8859
9240
|
}, queries ? queries.filter(function (query) {
|
@@ -8951,7 +9332,7 @@ var TableFilters$2 = function TableFilters(props) {
|
|
8951
9332
|
var content = new Content(filterSchema, form);
|
8952
9333
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
8953
9334
|
className: "table-filters",
|
8954
|
-
title: /*#__PURE__*/React.createElement(Text, null, "Filters")
|
9335
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, "Filters")
|
8955
9336
|
}, /*#__PURE__*/React.createElement(Icon, {
|
8956
9337
|
icon: "filter_list_off",
|
8957
9338
|
size: "small",
|
@@ -9078,7 +9459,7 @@ var TableEditor$2 = function TableEditor(props) {
|
|
9078
9459
|
className: "empty-message"
|
9079
9460
|
}, /*#__PURE__*/React.createElement(Icon, {
|
9080
9461
|
icon: "search_off"
|
9081
|
-
}), /*#__PURE__*/React.createElement(Text, null, "No Result Found"));
|
9462
|
+
}), /*#__PURE__*/React.createElement(Text$1, null, "No Result Found"));
|
9082
9463
|
var groups = items.reduce(function (groups, item) {
|
9083
9464
|
var groupName = item[groupBy];
|
9084
9465
|
if (!groupName) groupName = ("NO " + groupBy).toUpperCase();
|
@@ -9175,7 +9556,7 @@ var TableEditor$2 = function TableEditor(props) {
|
|
9175
9556
|
}
|
9176
9557
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
9177
9558
|
icon: icon,
|
9178
|
-
title: /*#__PURE__*/React.createElement(Text, null, title)
|
9559
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, title)
|
9179
9560
|
}, groupBy ? /*#__PURE__*/React.createElement(DropDown, {
|
9180
9561
|
id: "groupBy",
|
9181
9562
|
label: "Agrupar Por",
|
@@ -9617,7 +9998,7 @@ var TablePage2 = function TablePage2(props) {
|
|
9617
9998
|
}
|
9618
9999
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
9619
10000
|
className: "table-page " + className,
|
9620
|
-
title: /*#__PURE__*/React.createElement(Text, null, title)
|
10001
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, title)
|
9621
10002
|
}, canAdd ? /*#__PURE__*/React.createElement(Button, {
|
9622
10003
|
icon: "add",
|
9623
10004
|
label: "A\xF1adir",
|
@@ -9769,7 +10150,7 @@ var TableQueries$1 = function TableQueries(props) {
|
|
9769
10150
|
}
|
9770
10151
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
9771
10152
|
className: "table-queries",
|
9772
|
-
title: /*#__PURE__*/React.createElement(Text, null, "Queries")
|
10153
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, "Queries")
|
9773
10154
|
}), /*#__PURE__*/React.createElement("main", {
|
9774
10155
|
className: "table-queries"
|
9775
10156
|
}, queries ? queries.filter(function (query) {
|
@@ -9854,7 +10235,7 @@ var TableFilters$1 = function TableFilters(props) {
|
|
9854
10235
|
var content = new Content(filterSchema, form);
|
9855
10236
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
9856
10237
|
className: "table-filters",
|
9857
|
-
title: /*#__PURE__*/React.createElement(Text, null, "Filters")
|
10238
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, "Filters")
|
9858
10239
|
}, /*#__PURE__*/React.createElement(Icon, {
|
9859
10240
|
icon: "filter_list_off",
|
9860
10241
|
size: "small",
|
@@ -10059,7 +10440,7 @@ var TableEditor$1 = function TableEditor(props) {
|
|
10059
10440
|
className: "empty-message"
|
10060
10441
|
}, /*#__PURE__*/React.createElement(Icon, {
|
10061
10442
|
icon: "search_off"
|
10062
|
-
}), /*#__PURE__*/React.createElement(Text, null, "No Result Found"));
|
10443
|
+
}), /*#__PURE__*/React.createElement(Text$1, null, "No Result Found"));
|
10063
10444
|
var groups = items.reduce(function (groups, item) {
|
10064
10445
|
var groupName = item[groupBy];
|
10065
10446
|
if (!groups[groupName]) groups[groupName] = [];
|
@@ -10122,10 +10503,10 @@ var TableEditor$1 = function TableEditor(props) {
|
|
10122
10503
|
});
|
10123
10504
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
10124
10505
|
icon: icon,
|
10125
|
-
title: /*#__PURE__*/React.createElement(Text, null, title)
|
10506
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, title)
|
10126
10507
|
}, groupBy ? /*#__PURE__*/React.createElement(DropDown, {
|
10127
10508
|
id: "groupBy",
|
10128
|
-
label: /*#__PURE__*/React.createElement(Text, null, "Group By"),
|
10509
|
+
label: /*#__PURE__*/React.createElement(Text$1, null, "Group By"),
|
10129
10510
|
value: groupBy,
|
10130
10511
|
options: buildGroupOptions(schema),
|
10131
10512
|
onChange: changeGroup
|
@@ -10649,7 +11030,7 @@ var TabbedTablePage = function TabbedTablePage(props) {
|
|
10649
11030
|
}
|
10650
11031
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
10651
11032
|
className: "table-page",
|
10652
|
-
title: /*#__PURE__*/React.createElement(Text, null, title)
|
11033
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, title)
|
10653
11034
|
}, canAdd ? /*#__PURE__*/React.createElement(Button, {
|
10654
11035
|
icon: "add",
|
10655
11036
|
label: "A\xF1adir",
|
@@ -10806,7 +11187,7 @@ var TableQueries = function TableQueries(props) {
|
|
10806
11187
|
}
|
10807
11188
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
10808
11189
|
className: "table-queries",
|
10809
|
-
title: /*#__PURE__*/React.createElement(Text, null, "Queries")
|
11190
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, "Queries")
|
10810
11191
|
}), /*#__PURE__*/React.createElement("main", {
|
10811
11192
|
className: "table-queries"
|
10812
11193
|
}, queries ? queries.filter(function (query) {
|
@@ -10904,7 +11285,7 @@ var TableFilters = function TableFilters(props) {
|
|
10904
11285
|
var content = new Content(filterSchema, form);
|
10905
11286
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
10906
11287
|
className: "table-filters",
|
10907
|
-
title: /*#__PURE__*/React.createElement(Text, null, "Filters")
|
11288
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, "Filters")
|
10908
11289
|
}, /*#__PURE__*/React.createElement(Icon, {
|
10909
11290
|
icon: "filter_list_off",
|
10910
11291
|
size: "small",
|
@@ -11032,7 +11413,7 @@ var TableEditor = function TableEditor(props) {
|
|
11032
11413
|
className: "empty-message"
|
11033
11414
|
}, /*#__PURE__*/React.createElement(Icon, {
|
11034
11415
|
icon: "search_off"
|
11035
|
-
}), /*#__PURE__*/React.createElement(Text, null, "No Result Found"));
|
11416
|
+
}), /*#__PURE__*/React.createElement(Text$1, null, "No Result Found"));
|
11036
11417
|
var groups = items.reduce(function (groups, item) {
|
11037
11418
|
var groupName = item[groupBy];
|
11038
11419
|
var group = groups[groupName];
|
@@ -11123,7 +11504,7 @@ var TableEditor = function TableEditor(props) {
|
|
11123
11504
|
}
|
11124
11505
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
11125
11506
|
icon: icon,
|
11126
|
-
title: /*#__PURE__*/React.createElement(Text, null, title)
|
11507
|
+
title: /*#__PURE__*/React.createElement(Text$1, null, title)
|
11127
11508
|
}, /*#__PURE__*/React.createElement(DropDown, {
|
11128
11509
|
id: "groupBy",
|
11129
11510
|
label: "Agrupar Por",
|
@@ -12100,5 +12481,5 @@ var isFunction = function isFunction(value) {
|
|
12100
12481
|
return value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
|
12101
12482
|
};
|
12102
12483
|
|
12103
|
-
export { Accordion, ActionButton, Avatar, Button, Calendar, CheckBox, Chip, Chips, CircularProgress, CollectionAPI$1 as CollectionAPI, CollectionAPI as CollectionAPI2, CollectionContext$1 as CollectionContext, CollectionContext as CollectionContext2, CollectionEditor$2 as CollectionEditor, CollectionFilters$1 as CollectionFilters, CollectionPage$1 as CollectionPage, CollectionPage as CollectionPage2, CollectionTree, ColorField, Content, ContentEditor, ContentForm, ContentViewer, CreateContentDialog, DataTable, DateRange, Dialog, DropDown, DynamicForm, EditContentDialog, EmptyMessage, FORMATS$1 as FORMATS, FieldEditor, FileExplorer, FileExplorerView, FileGridItem, FilesGridView, FilesSearchBox, FilesTableView, FoldersTreeView, Form, HTTPClient, Header, Icon, ImageViewer, Kanban, KanbanCard, KanbanColumn, KanbanHeader, KanbanSwimlane, LinearProgress, List, ListEditor, LoginBox, Menu, MenuIcon, MenuItem, MenuSeparator, MonthCalendar, MultiSelector, Page, PageContext, PageProvider, PasswordEditor, PasswordField, Planner, Planner2, Property, RadioButton, ResetPasswordBox, Section, Session, Site, SiteContext, SiteProvider, Stack, Switch, Switch2, TASK_STATES, TEXTFORMATS, TYPES$1 as TYPES, Tab, TabbedContentEditor, TabbedTablePage, TabbedView, TableEditor$2 as TableEditor, TablePage, TablePage2, Tabs, TaskContext, TaskContextProvider, TaskMonitor, TaskProgress, Text, TextArea, TextField, Thumbnail, ToggleButton, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UploadArea, UploadDialog, UploadFile$1 as UploadFile, UploadForm, UploadIcon, Uploader, View, Viewer, WaitScreen, Wizard, WizardContext, isEmpty, isFunction, validatePassword };
|
12484
|
+
export { Accordion, ActionButton, Avatar, Button, Calendar, ChangeUserPasswordAction, ChangeUserPasswordDialog, CheckBox, Chip, Chips, CircularProgress, CollectionAPI$1 as CollectionAPI, CollectionAPI as CollectionAPI2, CollectionContext$1 as CollectionContext, CollectionContext as CollectionContext2, CollectionEditor$2 as CollectionEditor, CollectionFilters$1 as CollectionFilters, CollectionPage$1 as CollectionPage, CollectionPage as CollectionPage2, CollectionTree, ColorField, Content, ContentEditor, ContentForm, ContentViewer, CreateContentDialog, DataTable, DateRange, Dialog, DropDown, DynamicForm, EditContentDialog, EmptyMessage, FORMATS$1 as FORMATS, FieldEditor, FileExplorer, FileExplorerView, FileGridItem, FilesGridView, FilesSearchBox, FilesTableView, FoldersTreeView, ForgetUserPasswordAction, Form, HTTPClient, Header, Icon, ImageViewer, Kanban, KanbanCard, KanbanColumn, KanbanHeader, KanbanSwimlane, LOGIN_DICTIONARY, LinearProgress, List, ListEditor, LoginBox, Menu, MenuIcon, MenuItem, MenuSeparator, MonthCalendar, MultiSelector, Page, PageContext, PageProvider, PasswordEditor, PasswordField, Planner, Planner2, Property, RadioButton, ResetPasswordBox, Section, Session, Site, SiteContext, SiteProvider, Stack, Switch, Switch2, TASK_STATES, TEXTFORMATS, TYPES$1 as TYPES, Tab, TabbedContentEditor, TabbedTablePage, TabbedView, TableEditor$2 as TableEditor, TablePage, TablePage2, Tabs, TaskContext, TaskContextProvider, TaskMonitor, TaskProgress, Text$1 as Text, TextArea, TextField, Thumbnail, ToggleButton, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UnlockUserAction, UploadArea, UploadDialog, UploadFile$1 as UploadFile, UploadForm, UploadIcon, Uploader, View, Viewer, WaitScreen, Wizard, WizardContext, isEmpty, isFunction, validatePassword };
|
12104
12485
|
//# sourceMappingURL=index.modern.js.map
|