@bigbinary/neetoui 6.0.0-beta → 6.0.1
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/formik.cjs.js +2363 -629
- package/formik.cjs.js.map +1 -1
- package/formik.js +2364 -630
- package/formik.js.map +1 -1
- package/index.cjs.js +2604 -750
- package/index.cjs.js.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +18 -0
- package/index.js +2605 -752
- package/index.js.map +1 -1
- package/layouts.cjs.js +4 -4
- package/layouts.cjs.js.map +1 -1
- package/layouts.js +4 -4
- package/layouts.js.map +1 -1
- package/package.json +5 -7
package/index.cjs.js
CHANGED
|
@@ -49,22 +49,22 @@ var _Table__default = /*#__PURE__*/_interopDefaultLegacy(_Table);
|
|
|
49
49
|
var _Tree__default = /*#__PURE__*/_interopDefaultLegacy(_Tree);
|
|
50
50
|
var _TreeSelect__default = /*#__PURE__*/_interopDefaultLegacy(_TreeSelect);
|
|
51
51
|
|
|
52
|
-
function _typeof$
|
|
52
|
+
function _typeof$7(obj) {
|
|
53
53
|
"@babel/helpers - typeof";
|
|
54
54
|
|
|
55
|
-
return _typeof$
|
|
55
|
+
return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
56
56
|
return typeof obj;
|
|
57
57
|
} : function (obj) {
|
|
58
58
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
59
|
-
}, _typeof$
|
|
59
|
+
}, _typeof$7(obj);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
function _toPrimitive$1(input, hint) {
|
|
63
|
-
if (_typeof$
|
|
63
|
+
if (_typeof$7(input) !== "object" || input === null) return input;
|
|
64
64
|
var prim = input[Symbol.toPrimitive];
|
|
65
65
|
if (prim !== undefined) {
|
|
66
66
|
var res = prim.call(input, hint || "default");
|
|
67
|
-
if (_typeof$
|
|
67
|
+
if (_typeof$7(res) !== "object") return res;
|
|
68
68
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
69
69
|
}
|
|
70
70
|
return (hint === "string" ? String : Number)(input);
|
|
@@ -72,7 +72,7 @@ function _toPrimitive$1(input, hint) {
|
|
|
72
72
|
|
|
73
73
|
function _toPropertyKey(arg) {
|
|
74
74
|
var key = _toPrimitive$1(arg, "string");
|
|
75
|
-
return _typeof$
|
|
75
|
+
return _typeof$7(key) === "symbol" ? key : String(key);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
function _defineProperty$7(obj, key, value) {
|
|
@@ -90,11 +90,11 @@ function _defineProperty$7(obj, key, value) {
|
|
|
90
90
|
return obj;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
function _arrayWithHoles$
|
|
93
|
+
function _arrayWithHoles$3(arr) {
|
|
94
94
|
if (Array.isArray(arr)) return arr;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
function _iterableToArrayLimit$
|
|
97
|
+
function _iterableToArrayLimit$3(arr, i) {
|
|
98
98
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
99
99
|
if (null != _i) {
|
|
100
100
|
var _s,
|
|
@@ -122,32 +122,32 @@ function _iterableToArrayLimit$2(arr, i) {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
function _arrayLikeToArray$
|
|
125
|
+
function _arrayLikeToArray$3(arr, len) {
|
|
126
126
|
if (len == null || len > arr.length) len = arr.length;
|
|
127
127
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
128
128
|
return arr2;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
function _unsupportedIterableToArray$
|
|
131
|
+
function _unsupportedIterableToArray$3(o, minLen) {
|
|
132
132
|
if (!o) return;
|
|
133
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
133
|
+
if (typeof o === "string") return _arrayLikeToArray$3(o, minLen);
|
|
134
134
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
135
135
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
136
136
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
137
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
137
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
function _nonIterableRest$
|
|
140
|
+
function _nonIterableRest$3() {
|
|
141
141
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
function _slicedToArray$
|
|
145
|
-
return _arrayWithHoles$
|
|
144
|
+
function _slicedToArray$3(arr, i) {
|
|
145
|
+
return _arrayWithHoles$3(arr) || _iterableToArrayLimit$3(arr, i) || _unsupportedIterableToArray$3(arr, i) || _nonIterableRest$3();
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
148
|
+
var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
149
149
|
|
|
150
|
-
function getDefaultExportFromCjs (x) {
|
|
150
|
+
function getDefaultExportFromCjs$1 (x) {
|
|
151
151
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
152
152
|
}
|
|
153
153
|
|
|
@@ -3736,7 +3736,7 @@ function applyDefaultFilter(v) {
|
|
|
3736
3736
|
return name + "(" + defaultValue + unit + ")";
|
|
3737
3737
|
}
|
|
3738
3738
|
const functionRegex = /([a-z-]*)\(.*?\)/g;
|
|
3739
|
-
const filter
|
|
3739
|
+
const filter = {
|
|
3740
3740
|
...complex,
|
|
3741
3741
|
getAnimatableNone: (v) => {
|
|
3742
3742
|
const functions = v.match(functionRegex);
|
|
@@ -3761,8 +3761,8 @@ const defaultValueTypes = {
|
|
|
3761
3761
|
borderRightColor: color,
|
|
3762
3762
|
borderBottomColor: color,
|
|
3763
3763
|
borderLeftColor: color,
|
|
3764
|
-
filter
|
|
3765
|
-
WebkitFilter: filter
|
|
3764
|
+
filter,
|
|
3765
|
+
WebkitFilter: filter,
|
|
3766
3766
|
};
|
|
3767
3767
|
/**
|
|
3768
3768
|
* Gets the default ValueType for the provided value key
|
|
@@ -3771,7 +3771,7 @@ const getDefaultValueType = (key) => defaultValueTypes[key];
|
|
|
3771
3771
|
|
|
3772
3772
|
function getAnimatableNone(key, value) {
|
|
3773
3773
|
let defaultValueType = getDefaultValueType(key);
|
|
3774
|
-
if (defaultValueType !== filter
|
|
3774
|
+
if (defaultValueType !== filter)
|
|
3775
3775
|
defaultValueType = complex;
|
|
3776
3776
|
// If value is not recognised as animatable, ie "none", create an animatable version origin based on the target
|
|
3777
3777
|
return defaultValueType.getAnimatableNone
|
|
@@ -9416,14 +9416,14 @@ function _objectWithoutProperties$1(source, excluded) {
|
|
|
9416
9416
|
return target;
|
|
9417
9417
|
}
|
|
9418
9418
|
|
|
9419
|
-
var _excluded$
|
|
9419
|
+
var _excluded$J = ["open", "children", "className"];
|
|
9420
9420
|
var Collapse = function Collapse(_ref) {
|
|
9421
9421
|
var _ref$open = _ref.open,
|
|
9422
9422
|
open = _ref$open === void 0 ? false : _ref$open,
|
|
9423
9423
|
children = _ref.children,
|
|
9424
9424
|
_ref$className = _ref.className,
|
|
9425
9425
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
9426
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
9426
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$J);
|
|
9427
9427
|
return /*#__PURE__*/React__default["default"].createElement(AnimatePresence, null, open && /*#__PURE__*/React__default["default"].createElement(motion.div, _extends$4({
|
|
9428
9428
|
animate: {
|
|
9429
9429
|
opacity: 1,
|
|
@@ -9461,9 +9461,19 @@ var Item$2 = function Item(_ref) {
|
|
|
9461
9461
|
titleProps = _ref$titleProps === void 0 ? {} : _ref$titleProps,
|
|
9462
9462
|
_ref$iconProps = _ref.iconProps,
|
|
9463
9463
|
iconProps = _ref$iconProps === void 0 ? {} : _ref$iconProps;
|
|
9464
|
+
var onKeyDown = function onKeyDown(e) {
|
|
9465
|
+
switch (e.key) {
|
|
9466
|
+
case " ":
|
|
9467
|
+
case "Enter":
|
|
9468
|
+
onClick();
|
|
9469
|
+
break;
|
|
9470
|
+
}
|
|
9471
|
+
};
|
|
9464
9472
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
9465
9473
|
className: classnames$1("neeto-ui-accordion__wrapper", _defineProperty$7({}, className, className))
|
|
9466
9474
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
9475
|
+
onClick: onClick,
|
|
9476
|
+
onKeyDown: onKeyDown,
|
|
9467
9477
|
"aria-controls": "neeto-ui-accordion-section-".concat(id),
|
|
9468
9478
|
"aria-disabled": isOpen,
|
|
9469
9479
|
"aria-expanded": isOpen,
|
|
@@ -9472,16 +9482,7 @@ var Item$2 = function Item(_ref) {
|
|
|
9472
9482
|
tabIndex: 0,
|
|
9473
9483
|
className: classnames$1("neeto-ui-accordion__item neeto-ui-flex neeto-ui-justify-between neeto-ui-items-center", {
|
|
9474
9484
|
"neeto-ui-accordion__item--open": isOpen
|
|
9475
|
-
})
|
|
9476
|
-
onClick: onClick,
|
|
9477
|
-
onKeyDown: function onKeyDown(e) {
|
|
9478
|
-
switch (e.key) {
|
|
9479
|
-
case " ":
|
|
9480
|
-
case "Enter":
|
|
9481
|
-
onClick();
|
|
9482
|
-
break;
|
|
9483
|
-
}
|
|
9484
|
-
}
|
|
9485
|
+
})
|
|
9485
9486
|
}, /*#__PURE__*/React__default["default"].createElement("div", _extends$4({}, titleProps, {
|
|
9486
9487
|
className: "neeto-ui-accordion__item-handle neeto-ui-flex neeto-ui-flex-grow neeto-ui-items-center neeto-ui-break-words"
|
|
9487
9488
|
}), title), /*#__PURE__*/React__default["default"].createElement(motion.div, {
|
|
@@ -9525,7 +9526,7 @@ var Accordion = function Accordion(_ref) {
|
|
|
9525
9526
|
_ref$className = _ref.className,
|
|
9526
9527
|
className = _ref$className === void 0 ? "" : _ref$className;
|
|
9527
9528
|
var _useState = React$3.useState(defaultActiveKey),
|
|
9528
|
-
_useState2 = _slicedToArray$
|
|
9529
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
9529
9530
|
openTab = _useState2[0],
|
|
9530
9531
|
setOpenTab = _useState2[1];
|
|
9531
9532
|
React$3.useEffect(function () {
|
|
@@ -9581,7 +9582,7 @@ function _createClass$2(Constructor, protoProps, staticProps) {
|
|
|
9581
9582
|
var dayjs_min = {exports: {}};
|
|
9582
9583
|
|
|
9583
9584
|
(function (module, exports) {
|
|
9584
|
-
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
|
|
9585
|
+
!function(t,e){module.exports=e();}(commonjsGlobal$1,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
|
|
9585
9586
|
} (dayjs_min));
|
|
9586
9587
|
|
|
9587
9588
|
var dayjs = dayjs_min.exports;
|
|
@@ -9589,7 +9590,7 @@ var dayjs = dayjs_min.exports;
|
|
|
9589
9590
|
var localeData$1 = {exports: {}};
|
|
9590
9591
|
|
|
9591
9592
|
(function (module, exports) {
|
|
9592
|
-
!function(n,e){module.exports=e();}(commonjsGlobal,(function(){return function(n,e,t){var r=e.prototype,o=function(n){return n&&(n.indexOf?n:n.s)},u=function(n,e,t,r,u){var i=n.name?n:n.$locale(),a=o(i[e]),s=o(i[t]),f=a||s.map((function(n){return n.slice(0,r)}));if(!u)return f;var d=i.weekStart;return f.map((function(n,e){return f[(e+(d||0))%7]}))},i=function(){return t.Ls[t.locale()]},a=function(n,e){return n.formats[e]||function(n){return n.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(n,e,t){return e||t.slice(1)}))}(n.formats[e.toUpperCase()])},s=function(){var n=this;return {months:function(e){return e?e.format("MMMM"):u(n,"months")},monthsShort:function(e){return e?e.format("MMM"):u(n,"monthsShort","months",3)},firstDayOfWeek:function(){return n.$locale().weekStart||0},weekdays:function(e){return e?e.format("dddd"):u(n,"weekdays")},weekdaysMin:function(e){return e?e.format("dd"):u(n,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):u(n,"weekdaysShort","weekdays",3)},longDateFormat:function(e){return a(n.$locale(),e)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return s.bind(this)()},t.localeData=function(){var n=i();return {firstDayOfWeek:function(){return n.weekStart||0},weekdays:function(){return t.weekdays()},weekdaysShort:function(){return t.weekdaysShort()},weekdaysMin:function(){return t.weekdaysMin()},months:function(){return t.months()},monthsShort:function(){return t.monthsShort()},longDateFormat:function(e){return a(n,e)},meridiem:n.meridiem,ordinal:n.ordinal}},t.months=function(){return u(i(),"months")},t.monthsShort=function(){return u(i(),"monthsShort","months",3)},t.weekdays=function(n){return u(i(),"weekdays",null,null,n)},t.weekdaysShort=function(n){return u(i(),"weekdaysShort","weekdays",3,n)},t.weekdaysMin=function(n){return u(i(),"weekdaysMin","weekdays",2,n)};}}));
|
|
9593
|
+
!function(n,e){module.exports=e();}(commonjsGlobal$1,(function(){return function(n,e,t){var r=e.prototype,o=function(n){return n&&(n.indexOf?n:n.s)},u=function(n,e,t,r,u){var i=n.name?n:n.$locale(),a=o(i[e]),s=o(i[t]),f=a||s.map((function(n){return n.slice(0,r)}));if(!u)return f;var d=i.weekStart;return f.map((function(n,e){return f[(e+(d||0))%7]}))},i=function(){return t.Ls[t.locale()]},a=function(n,e){return n.formats[e]||function(n){return n.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(n,e,t){return e||t.slice(1)}))}(n.formats[e.toUpperCase()])},s=function(){var n=this;return {months:function(e){return e?e.format("MMMM"):u(n,"months")},monthsShort:function(e){return e?e.format("MMM"):u(n,"monthsShort","months",3)},firstDayOfWeek:function(){return n.$locale().weekStart||0},weekdays:function(e){return e?e.format("dddd"):u(n,"weekdays")},weekdaysMin:function(e){return e?e.format("dd"):u(n,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):u(n,"weekdaysShort","weekdays",3)},longDateFormat:function(e){return a(n.$locale(),e)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return s.bind(this)()},t.localeData=function(){var n=i();return {firstDayOfWeek:function(){return n.weekStart||0},weekdays:function(){return t.weekdays()},weekdaysShort:function(){return t.weekdaysShort()},weekdaysMin:function(){return t.weekdaysMin()},months:function(){return t.months()},monthsShort:function(){return t.monthsShort()},longDateFormat:function(e){return a(n,e)},meridiem:n.meridiem,ordinal:n.ordinal}},t.months=function(){return u(i(),"months")},t.monthsShort=function(){return u(i(),"monthsShort","months",3)},t.weekdays=function(n){return u(i(),"weekdays",null,null,n)},t.weekdaysShort=function(n){return u(i(),"weekdaysShort","weekdays",3,n)},t.weekdaysMin=function(n){return u(i(),"weekdaysMin","weekdays",2,n)};}}));
|
|
9593
9594
|
} (localeData$1));
|
|
9594
9595
|
|
|
9595
9596
|
var localeData = localeData$1.exports;
|
|
@@ -9597,7 +9598,7 @@ var localeData = localeData$1.exports;
|
|
|
9597
9598
|
var utc$1 = {exports: {}};
|
|
9598
9599
|
|
|
9599
9600
|
(function (module, exports) {
|
|
9600
|
-
!function(t,i){module.exports=i();}(commonjsGlobal,(function(){var t="minute",i=/[+-]\d\d(?::?\d\d)?/g,e=/([+-]|\d\d)/g;return function(s,f,n){var u=f.prototype;n.utc=function(t){var i={date:t,utc:!0,args:arguments};return new f(i)},u.utc=function(i){var e=n(this.toDate(),{locale:this.$L,utc:!0});return i?e.add(this.utcOffset(),t):e},u.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var o=u.parse;u.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t);};var r=u.init;u.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds();}else r.call(this);};var a=u.utcOffset;u.utcOffset=function(s,f){var n=this.$utils().u;if(n(s))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(i);if(!s)return null;var f=(""+s[0]).match(e)||["-",0,0],n=f[0],u=60*+f[1]+ +f[2];return 0===u?0:"+"===n?u:-u}(s),null===s))return this;var u=Math.abs(s)<=16?60*s:s,o=this;if(f)return o.$offset=u,o.$u=0===s,o;if(0!==s){var r=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(u+r,t)).$offset=u,o.$x.$localOffset=r;}else o=this.utc();return o};var h=u.format;u.format=function(t){var i=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,i)},u.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},u.isUTC=function(){return !!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var l=u.toDate;u.toDate=function(t){return "s"===t&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var c=u.diff;u.diff=function(t,i,e){if(t&&this.$u===t.$u)return c.call(this,t,i,e);var s=this.local(),f=n(t).local();return c.call(s,f,i,e)};}}));
|
|
9601
|
+
!function(t,i){module.exports=i();}(commonjsGlobal$1,(function(){var t="minute",i=/[+-]\d\d(?::?\d\d)?/g,e=/([+-]|\d\d)/g;return function(s,f,n){var u=f.prototype;n.utc=function(t){var i={date:t,utc:!0,args:arguments};return new f(i)},u.utc=function(i){var e=n(this.toDate(),{locale:this.$L,utc:!0});return i?e.add(this.utcOffset(),t):e},u.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var o=u.parse;u.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t);};var r=u.init;u.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds();}else r.call(this);};var a=u.utcOffset;u.utcOffset=function(s,f){var n=this.$utils().u;if(n(s))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(i);if(!s)return null;var f=(""+s[0]).match(e)||["-",0,0],n=f[0],u=60*+f[1]+ +f[2];return 0===u?0:"+"===n?u:-u}(s),null===s))return this;var u=Math.abs(s)<=16?60*s:s,o=this;if(f)return o.$offset=u,o.$u=0===s,o;if(0!==s){var r=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(u+r,t)).$offset=u,o.$x.$localOffset=r;}else o=this.utc();return o};var h=u.format;u.format=function(t){var i=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,i)},u.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},u.isUTC=function(){return !!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var l=u.toDate;u.toDate=function(t){return "s"===t&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var c=u.diff;u.diff=function(t,i,e){if(t&&this.$u===t.$u)return c.call(this,t,i,e);var s=this.local(),f=n(t).local();return c.call(s,f,i,e)};}}));
|
|
9601
9602
|
} (utc$1));
|
|
9602
9603
|
|
|
9603
9604
|
var utc = utc$1.exports;
|
|
@@ -9605,7 +9606,7 @@ var utc = utc$1.exports;
|
|
|
9605
9606
|
var weekday$1 = {exports: {}};
|
|
9606
9607
|
|
|
9607
9608
|
(function (module, exports) {
|
|
9608
|
-
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){return function(e,t){t.prototype.weekday=function(e){var t=this.$locale().weekStart||0,i=this.$W,n=(i<t?i+7:i)-t;return this.$utils().u(e)?n:this.subtract(n,"day").add(e,"day")};}}));
|
|
9609
|
+
!function(e,t){module.exports=t();}(commonjsGlobal$1,(function(){return function(e,t){t.prototype.weekday=function(e){var t=this.$locale().weekStart||0,i=this.$W,n=(i<t?i+7:i)-t;return this.$utils().u(e)?n:this.subtract(n,"day").add(e,"day")};}}));
|
|
9609
9610
|
} (weekday$1));
|
|
9610
9611
|
|
|
9611
9612
|
var weekday = weekday$1.exports;
|
|
@@ -9613,7 +9614,7 @@ var weekday = weekday$1.exports;
|
|
|
9613
9614
|
var weekOfYear$1 = {exports: {}};
|
|
9614
9615
|
|
|
9615
9616
|
(function (module, exports) {
|
|
9616
|
-
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){var e="week",t="year";return function(i,n,r){var f=n.prototype;f.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,!0);return o<0?r(this).startOf("week").week():Math.ceil(o)},f.weeks=function(e){return void 0===e&&(e=null),this.week(e)};}}));
|
|
9617
|
+
!function(e,t){module.exports=t();}(commonjsGlobal$1,(function(){var e="week",t="year";return function(i,n,r){var f=n.prototype;f.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,!0);return o<0?r(this).startOf("week").week():Math.ceil(o)},f.weeks=function(e){return void 0===e&&(e=null),this.week(e)};}}));
|
|
9617
9618
|
} (weekOfYear$1));
|
|
9618
9619
|
|
|
9619
9620
|
var weekOfYear = weekOfYear$1.exports;
|
|
@@ -11750,7 +11751,7 @@ var ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES = {
|
|
|
11750
11751
|
var buildUrl = function buildUrl(route, params) {
|
|
11751
11752
|
var placeHolders = [];
|
|
11752
11753
|
ramda.toPairs(params).forEach(function (_ref) {
|
|
11753
|
-
var _ref2 = _slicedToArray$
|
|
11754
|
+
var _ref2 = _slicedToArray$3(_ref, 2),
|
|
11754
11755
|
key = _ref2[0],
|
|
11755
11756
|
value = _ref2[1];
|
|
11756
11757
|
if (!route.includes(":".concat(key))) return;
|
|
@@ -11761,10 +11762,10 @@ var buildUrl = function buildUrl(route, params) {
|
|
|
11761
11762
|
return ramda.isEmpty(queryParams) ? route : "".concat(route, "?").concat(queryParams);
|
|
11762
11763
|
};
|
|
11763
11764
|
|
|
11764
|
-
var _excluded$
|
|
11765
|
+
var _excluded$I = ["children"];
|
|
11765
11766
|
var Portal$1 = function Portal(_ref, ref) {
|
|
11766
11767
|
var children = _ref.children,
|
|
11767
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
11768
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$I);
|
|
11768
11769
|
return /*#__PURE__*/React__default["default"].createElement("div", _extends$4({
|
|
11769
11770
|
"data-cy": "neeto-backdrop",
|
|
11770
11771
|
"data-testid": "neeto-backdrop",
|
|
@@ -15718,7 +15719,7 @@ var index$1 = /*#__PURE__*/forwardRef( /*#__PURE__*/TippyGenerator(tippy));
|
|
|
15718
15719
|
|
|
15719
15720
|
var ARROW = "<svg width='12' height='6' viewBox='0 0 10 5' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M10 5H0.926697L3.95208 1.63847C4.74227 0.760478 6.11722 0.754951 6.91445 1.62656L10 5Z' /></svg>";
|
|
15720
15721
|
|
|
15721
|
-
var _excluded$
|
|
15722
|
+
var _excluded$H = ["content", "children", "theme", "disabled", "position", "interactive", "hideAfter", "hideOnTargetExit"];
|
|
15722
15723
|
var Tooltip = function Tooltip(_ref) {
|
|
15723
15724
|
var content = _ref.content,
|
|
15724
15725
|
children = _ref.children,
|
|
@@ -15734,9 +15735,9 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
15734
15735
|
hideAfter = _ref$hideAfter === void 0 ? -1 : _ref$hideAfter,
|
|
15735
15736
|
_ref$hideOnTargetExit = _ref.hideOnTargetExit,
|
|
15736
15737
|
hideOnTargetExit = _ref$hideOnTargetExit === void 0 ? false : _ref$hideOnTargetExit,
|
|
15737
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15738
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$H);
|
|
15738
15739
|
var _useState = React$3.useState(null),
|
|
15739
|
-
_useState2 = _slicedToArray$
|
|
15740
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
15740
15741
|
instance = _useState2[0],
|
|
15741
15742
|
setInstance = _useState2[1];
|
|
15742
15743
|
var localProps = {};
|
|
@@ -15781,7 +15782,9 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
15781
15782
|
}, localProps, otherProps), /*#__PURE__*/React__default["default"].isValidElement(children) ? children : /*#__PURE__*/React__default["default"].createElement("span", null, children));
|
|
15782
15783
|
};
|
|
15783
15784
|
|
|
15784
|
-
var _excluded$
|
|
15785
|
+
var _excluded$G = ["icon", "iconPosition", "iconSize", "label", "loading", "onClick", "to", "type", "style", "fullWidth", "className", "disabled", "size", "href", "tooltipProps", "children"];
|
|
15786
|
+
function ownKeys$n(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15787
|
+
function _objectSpread$m(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$n(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$n(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15785
15788
|
var BUTTON_STYLES = {
|
|
15786
15789
|
primary: "primary",
|
|
15787
15790
|
secondary: "secondary",
|
|
@@ -15836,7 +15839,7 @@ var Button = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, r
|
|
|
15836
15839
|
_ref$tooltipProps = _ref.tooltipProps,
|
|
15837
15840
|
tooltipProps = _ref$tooltipProps === void 0 ? null : _ref$tooltipProps,
|
|
15838
15841
|
children = _ref.children,
|
|
15839
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15842
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$G);
|
|
15840
15843
|
var Parent = motion.button;
|
|
15841
15844
|
var elementSpecificProps = {
|
|
15842
15845
|
type: type
|
|
@@ -15856,9 +15859,8 @@ var Button = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, r
|
|
|
15856
15859
|
}
|
|
15857
15860
|
}
|
|
15858
15861
|
var handleClick = function handleClick(e) {
|
|
15859
|
-
if (
|
|
15860
|
-
|
|
15861
|
-
}
|
|
15862
|
+
if (loading || disabled) return;
|
|
15863
|
+
onClick(e);
|
|
15862
15864
|
};
|
|
15863
15865
|
var Icon = typeof icon === "string" ? function () {
|
|
15864
15866
|
return /*#__PURE__*/React__default["default"].createElement("i", {
|
|
@@ -15869,8 +15871,6 @@ var Button = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, r
|
|
|
15869
15871
|
return /*#__PURE__*/React__default["default"].createElement(Tooltip, _extends$4({
|
|
15870
15872
|
disabled: !tooltipProps
|
|
15871
15873
|
}, tooltipProps), /*#__PURE__*/React__default["default"].createElement(Parent, _extends$4({
|
|
15872
|
-
disabled: disabled,
|
|
15873
|
-
ref: ref,
|
|
15874
15874
|
className: classnames$1("neeto-ui-btn", [className], {
|
|
15875
15875
|
"neeto-ui-btn--style-primary": style === BUTTON_STYLES.primary,
|
|
15876
15876
|
"neeto-ui-btn--style-secondary": style === BUTTON_STYLES.secondary,
|
|
@@ -15886,21 +15886,18 @@ var Button = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, r
|
|
|
15886
15886
|
disabled: disabled
|
|
15887
15887
|
}),
|
|
15888
15888
|
onClick: handleClick
|
|
15889
|
-
},
|
|
15890
|
-
|
|
15891
|
-
|
|
15892
|
-
loading ? /*#__PURE__*/React__default["default"].createElement(Spinner$1, {
|
|
15889
|
+
}, _objectSpread$m(_objectSpread$m({
|
|
15890
|
+
disabled: disabled,
|
|
15891
|
+
ref: ref
|
|
15892
|
+
}, elementSpecificProps), otherProps)), renderLabel && /*#__PURE__*/React__default["default"].createElement("span", null, renderLabel), icon ? loading ? /*#__PURE__*/React__default["default"].createElement(Spinner$1, {
|
|
15893
15893
|
"aria-hidden": "true",
|
|
15894
15894
|
className: "neeto-ui-btn__spinner",
|
|
15895
|
-
key: "1",
|
|
15896
15895
|
size: 16
|
|
15897
15896
|
}) : /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
15898
15897
|
"aria-hidden": "true",
|
|
15899
15898
|
className: "neeto-ui-btn__icon",
|
|
15900
|
-
key: "2",
|
|
15901
15899
|
size: iconSize
|
|
15902
|
-
}) :
|
|
15903
|
-
loading && /*#__PURE__*/React__default["default"].createElement(motion.div, {
|
|
15900
|
+
}) : /*#__PURE__*/React__default["default"].createElement(AnimatePresence, null, loading && /*#__PURE__*/React__default["default"].createElement(motion.div, {
|
|
15904
15901
|
animate: {
|
|
15905
15902
|
width: "auto",
|
|
15906
15903
|
scale: 1
|
|
@@ -15932,22 +15929,22 @@ var Divider$1 = function Divider(props) {
|
|
|
15932
15929
|
}, props));
|
|
15933
15930
|
};
|
|
15934
15931
|
|
|
15935
|
-
var _excluded$
|
|
15932
|
+
var _excluded$F = ["children", "className"];
|
|
15936
15933
|
var Menu$2 = function Menu(_ref) {
|
|
15937
15934
|
var children = _ref.children,
|
|
15938
15935
|
className = _ref.className,
|
|
15939
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15936
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$F);
|
|
15940
15937
|
return /*#__PURE__*/React__default["default"].createElement("ul", _extends$4({
|
|
15941
15938
|
className: classnames$1("neeto-ui-dropdown__popup-menu", className)
|
|
15942
15939
|
}, otherProps), children);
|
|
15943
15940
|
};
|
|
15944
15941
|
|
|
15945
|
-
var _excluded$
|
|
15942
|
+
var _excluded$E = ["children", "className", "tooltipProps"];
|
|
15946
15943
|
var MenuItem = function MenuItem(_ref) {
|
|
15947
15944
|
var children = _ref.children,
|
|
15948
15945
|
className = _ref.className,
|
|
15949
15946
|
tooltipProps = _ref.tooltipProps,
|
|
15950
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15947
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$E);
|
|
15951
15948
|
var renderMenuItem = function renderMenuItem() {
|
|
15952
15949
|
return /*#__PURE__*/React__default["default"].createElement("li", _extends$4({
|
|
15953
15950
|
className: classnames$1("neeto-ui-dropdown__popup-menu-item", className)
|
|
@@ -15959,7 +15956,7 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
15959
15956
|
return renderMenuItem();
|
|
15960
15957
|
};
|
|
15961
15958
|
|
|
15962
|
-
var _excluded$
|
|
15959
|
+
var _excluded$D = ["children", "className", "isActive", "isDisabled", "style", "prefix", "suffix", "type", "to", "href", "tooltipProps"];
|
|
15963
15960
|
var ITEM_BTN_STYLES = {
|
|
15964
15961
|
"default": "default",
|
|
15965
15962
|
danger: "danger"
|
|
@@ -15985,7 +15982,7 @@ var MenuItemButton = function MenuItemButton(_ref) {
|
|
|
15985
15982
|
_ref$href = _ref.href,
|
|
15986
15983
|
href = _ref$href === void 0 ? "" : _ref$href,
|
|
15987
15984
|
tooltipProps = _ref.tooltipProps,
|
|
15988
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15985
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$D);
|
|
15989
15986
|
var Parent, elementSpecificProps;
|
|
15990
15987
|
if (to) {
|
|
15991
15988
|
Parent = reactRouterDom.Link;
|
|
@@ -16021,7 +16018,7 @@ var MenuItemButton = function MenuItemButton(_ref) {
|
|
|
16021
16018
|
|
|
16022
16019
|
MenuItem.Button = MenuItemButton;
|
|
16023
16020
|
|
|
16024
|
-
var _excluded$
|
|
16021
|
+
var _excluded$C = ["style", "size"],
|
|
16025
16022
|
_excluded2$5 = ["icon", "label", "isOpen", "onClose", "dropdownProps", "position", "children", "className", "buttonStyle", "buttonSize", "buttonProps", "customTarget", "disabled", "closeOnEsc", "closeOnSelect", "closeOnOutsideClick", "dropdownModifiers", "trigger", "strategy", "onClick"],
|
|
16026
16023
|
_excluded3 = ["classNames"];
|
|
16027
16024
|
var BTN_STYLES$1 = {
|
|
@@ -16103,7 +16100,7 @@ var Dropdown = function Dropdown(_ref2) {
|
|
|
16103
16100
|
_ref2$buttonProps2 = _ref2$buttonProps === void 0 ? {} : _ref2$buttonProps,
|
|
16104
16101
|
style = _ref2$buttonProps2.style,
|
|
16105
16102
|
size = _ref2$buttonProps2.size,
|
|
16106
|
-
buttonProps = _objectWithoutProperties$1(_ref2$buttonProps2, _excluded$
|
|
16103
|
+
buttonProps = _objectWithoutProperties$1(_ref2$buttonProps2, _excluded$C),
|
|
16107
16104
|
customTarget = _ref2.customTarget,
|
|
16108
16105
|
_ref2$disabled = _ref2.disabled,
|
|
16109
16106
|
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
@@ -16122,11 +16119,11 @@ var Dropdown = function Dropdown(_ref2) {
|
|
|
16122
16119
|
onClick = _ref2.onClick,
|
|
16123
16120
|
otherProps = _objectWithoutProperties$1(_ref2, _excluded2$5);
|
|
16124
16121
|
var _useState = React$3.useState(null),
|
|
16125
|
-
_useState2 = _slicedToArray$
|
|
16122
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
16126
16123
|
instance = _useState2[0],
|
|
16127
16124
|
setInstance = _useState2[1];
|
|
16128
16125
|
var _useState3 = React$3.useState(false),
|
|
16129
|
-
_useState4 = _slicedToArray$
|
|
16126
|
+
_useState4 = _slicedToArray$3(_useState3, 2),
|
|
16130
16127
|
mounted = _useState4[0],
|
|
16131
16128
|
setMounted = _useState4[1];
|
|
16132
16129
|
var isControlled = !ramda.isNil(isOpen);
|
|
@@ -16196,7 +16193,7 @@ Dropdown.Menu = Menu$2;
|
|
|
16196
16193
|
Dropdown.MenuItem = MenuItem;
|
|
16197
16194
|
Dropdown.Divider = Divider$1;
|
|
16198
16195
|
|
|
16199
|
-
var _excluded$
|
|
16196
|
+
var _excluded$B = ["style", "size"];
|
|
16200
16197
|
var BTN_STYLES = {
|
|
16201
16198
|
primary: "primary",
|
|
16202
16199
|
secondary: "secondary"
|
|
@@ -16221,7 +16218,7 @@ var ActionDropdown = function ActionDropdown(_ref) {
|
|
|
16221
16218
|
_ref$buttonProps2 = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
16222
16219
|
style = _ref$buttonProps2.style,
|
|
16223
16220
|
size = _ref$buttonProps2.size,
|
|
16224
|
-
buttonProps = _objectWithoutProperties$1(_ref$buttonProps2, _excluded$
|
|
16221
|
+
buttonProps = _objectWithoutProperties$1(_ref$buttonProps2, _excluded$B),
|
|
16225
16222
|
_ref$dropdownProps = _ref.dropdownProps,
|
|
16226
16223
|
dropdownProps = _ref$dropdownProps === void 0 ? {} : _ref$dropdownProps,
|
|
16227
16224
|
_ref$className = _ref.className,
|
|
@@ -17793,647 +17790,2381 @@ var useOnClickOutside = function useOnClickOutside(insideRef, outsideRef, handle
|
|
|
17793
17790
|
}, [insideRef, outsideRef, handler]);
|
|
17794
17791
|
};
|
|
17795
17792
|
|
|
17796
|
-
|
|
17797
|
-
|
|
17798
|
-
|
|
17799
|
-
|
|
17800
|
-
|
|
17801
|
-
|
|
17802
|
-
|
|
17803
|
-
|
|
17804
|
-
|
|
17793
|
+
var MODES = {
|
|
17794
|
+
"default": "default",
|
|
17795
|
+
global: "global",
|
|
17796
|
+
scoped: "scoped"
|
|
17797
|
+
};
|
|
17798
|
+
var DEFAULT_CONFIG = {
|
|
17799
|
+
mode: MODES["default"],
|
|
17800
|
+
unbindOnUnmount: true,
|
|
17801
|
+
enabled: true
|
|
17802
|
+
};
|
|
17803
|
+
var MAC_TO_WINDOWS_KEYS_MAP = {
|
|
17804
|
+
option: "alt",
|
|
17805
|
+
command: "ctrl",
|
|
17806
|
+
"return": "enter",
|
|
17807
|
+
"delete": "backspace"
|
|
17808
|
+
};
|
|
17809
|
+
var OS = {
|
|
17810
|
+
mac: "OS X",
|
|
17811
|
+
windows: "Windows"
|
|
17812
|
+
};
|
|
17813
|
+
var KEY_NAMES = {
|
|
17814
|
+
"delete": "delete",
|
|
17815
|
+
backspace: "backspace"
|
|
17816
|
+
};
|
|
17805
17817
|
|
|
17806
|
-
|
|
17818
|
+
function _arrayWithHoles$2(arr) {
|
|
17819
|
+
if (Array.isArray(arr)) return arr;
|
|
17820
|
+
}
|
|
17807
17821
|
|
|
17808
|
-
function
|
|
17809
|
-
|
|
17810
|
-
|
|
17811
|
-
|
|
17812
|
-
|
|
17813
|
-
|
|
17814
|
-
|
|
17822
|
+
function _iterableToArrayLimit$2(r, l) {
|
|
17823
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
17824
|
+
if (null != t) {
|
|
17825
|
+
var e,
|
|
17826
|
+
n,
|
|
17827
|
+
i,
|
|
17828
|
+
u,
|
|
17829
|
+
a = [],
|
|
17830
|
+
f = !0,
|
|
17831
|
+
o = !1;
|
|
17832
|
+
try {
|
|
17833
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
17834
|
+
if (Object(t) !== t) return;
|
|
17835
|
+
f = !1;
|
|
17836
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
17837
|
+
} catch (r) {
|
|
17838
|
+
o = !0, n = r;
|
|
17839
|
+
} finally {
|
|
17840
|
+
try {
|
|
17841
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
17842
|
+
} finally {
|
|
17843
|
+
if (o) throw n;
|
|
17844
|
+
}
|
|
17845
|
+
}
|
|
17846
|
+
return a;
|
|
17815
17847
|
}
|
|
17816
|
-
}
|
|
17848
|
+
}
|
|
17817
17849
|
|
|
17850
|
+
function _arrayLikeToArray$2(arr, len) {
|
|
17851
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
17852
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
17853
|
+
return arr2;
|
|
17854
|
+
}
|
|
17818
17855
|
|
|
17819
|
-
function
|
|
17820
|
-
|
|
17856
|
+
function _unsupportedIterableToArray$2(o, minLen) {
|
|
17857
|
+
if (!o) return;
|
|
17858
|
+
if (typeof o === "string") return _arrayLikeToArray$2(o, minLen);
|
|
17859
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
17860
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
17861
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
17862
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen);
|
|
17863
|
+
}
|
|
17821
17864
|
|
|
17822
|
-
|
|
17823
|
-
|
|
17824
|
-
|
|
17865
|
+
function _nonIterableRest$2() {
|
|
17866
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
17867
|
+
}
|
|
17825
17868
|
|
|
17826
|
-
|
|
17827
|
-
|
|
17869
|
+
function _slicedToArray$2(arr, i) {
|
|
17870
|
+
return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i) || _unsupportedIterableToArray$2(arr, i) || _nonIterableRest$2();
|
|
17871
|
+
}
|
|
17828
17872
|
|
|
17873
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
17829
17874
|
|
|
17830
|
-
function
|
|
17831
|
-
|
|
17832
|
-
|
|
17875
|
+
function getDefaultExportFromCjs (x) {
|
|
17876
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
17877
|
+
}
|
|
17833
17878
|
|
|
17834
|
-
|
|
17879
|
+
var mousetrap = {exports: {}};
|
|
17835
17880
|
|
|
17836
|
-
|
|
17881
|
+
/*global define:false */
|
|
17882
|
+
mousetrap.exports;
|
|
17883
|
+
(function (module) {
|
|
17884
|
+
/**
|
|
17885
|
+
* Copyright 2012-2017 Craig Campbell
|
|
17886
|
+
*
|
|
17887
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
17888
|
+
* you may not use this file except in compliance with the License.
|
|
17889
|
+
* You may obtain a copy of the License at
|
|
17890
|
+
*
|
|
17891
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17892
|
+
*
|
|
17893
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
17894
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17895
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17896
|
+
* See the License for the specific language governing permissions and
|
|
17897
|
+
* limitations under the License.
|
|
17898
|
+
*
|
|
17899
|
+
* Mousetrap is a simple keyboard shortcut library for Javascript with
|
|
17900
|
+
* no external dependencies
|
|
17901
|
+
*
|
|
17902
|
+
* @version 1.6.5
|
|
17903
|
+
* @url craig.is/killing/mice
|
|
17904
|
+
*/
|
|
17905
|
+
(function (window, document, undefined$1) {
|
|
17906
|
+
// Check if mousetrap is used inside browser, if not, return
|
|
17907
|
+
if (!window) {
|
|
17908
|
+
return;
|
|
17909
|
+
}
|
|
17837
17910
|
|
|
17838
|
-
|
|
17839
|
-
|
|
17840
|
-
|
|
17841
|
-
|
|
17842
|
-
|
|
17911
|
+
/**
|
|
17912
|
+
* mapping of special keycodes to their corresponding keys
|
|
17913
|
+
*
|
|
17914
|
+
* everything in this dictionary cannot use keypress events
|
|
17915
|
+
* so it has to be here to map to the correct keycodes for
|
|
17916
|
+
* keyup/keydown events
|
|
17917
|
+
*
|
|
17918
|
+
* @type {Object}
|
|
17919
|
+
*/
|
|
17920
|
+
var _MAP = {
|
|
17921
|
+
8: 'backspace',
|
|
17922
|
+
9: 'tab',
|
|
17923
|
+
13: 'enter',
|
|
17924
|
+
16: 'shift',
|
|
17925
|
+
17: 'ctrl',
|
|
17926
|
+
18: 'alt',
|
|
17927
|
+
20: 'capslock',
|
|
17928
|
+
27: 'esc',
|
|
17929
|
+
32: 'space',
|
|
17930
|
+
33: 'pageup',
|
|
17931
|
+
34: 'pagedown',
|
|
17932
|
+
35: 'end',
|
|
17933
|
+
36: 'home',
|
|
17934
|
+
37: 'left',
|
|
17935
|
+
38: 'up',
|
|
17936
|
+
39: 'right',
|
|
17937
|
+
40: 'down',
|
|
17938
|
+
45: 'ins',
|
|
17939
|
+
46: 'del',
|
|
17940
|
+
91: 'meta',
|
|
17941
|
+
93: 'meta',
|
|
17942
|
+
224: 'meta'
|
|
17943
|
+
};
|
|
17843
17944
|
|
|
17844
|
-
|
|
17845
|
-
|
|
17846
|
-
|
|
17847
|
-
|
|
17848
|
-
|
|
17849
|
-
|
|
17850
|
-
|
|
17851
|
-
|
|
17852
|
-
|
|
17853
|
-
|
|
17854
|
-
|
|
17855
|
-
|
|
17856
|
-
|
|
17857
|
-
|
|
17858
|
-
|
|
17859
|
-
|
|
17860
|
-
|
|
17861
|
-
|
|
17862
|
-
|
|
17863
|
-
|
|
17864
|
-
|
|
17865
|
-
|
|
17866
|
-
|
|
17867
|
-
|
|
17868
|
-
|
|
17869
|
-
|
|
17870
|
-
up: 38,
|
|
17871
|
-
right: 39,
|
|
17872
|
-
down: 40,
|
|
17873
|
-
del: 46,
|
|
17874
|
-
delete: 46,
|
|
17875
|
-
ins: 45,
|
|
17876
|
-
insert: 45,
|
|
17877
|
-
home: 36,
|
|
17878
|
-
end: 35,
|
|
17879
|
-
pageup: 33,
|
|
17880
|
-
pagedown: 34,
|
|
17881
|
-
capslock: 20,
|
|
17882
|
-
num_0: 96,
|
|
17883
|
-
num_1: 97,
|
|
17884
|
-
num_2: 98,
|
|
17885
|
-
num_3: 99,
|
|
17886
|
-
num_4: 100,
|
|
17887
|
-
num_5: 101,
|
|
17888
|
-
num_6: 102,
|
|
17889
|
-
num_7: 103,
|
|
17890
|
-
num_8: 104,
|
|
17891
|
-
num_9: 105,
|
|
17892
|
-
num_multiply: 106,
|
|
17893
|
-
num_add: 107,
|
|
17894
|
-
num_enter: 108,
|
|
17895
|
-
num_subtract: 109,
|
|
17896
|
-
num_decimal: 110,
|
|
17897
|
-
num_divide: 111,
|
|
17898
|
-
'⇪': 20,
|
|
17899
|
-
',': 188,
|
|
17900
|
-
'.': 190,
|
|
17901
|
-
'/': 191,
|
|
17902
|
-
'`': 192,
|
|
17903
|
-
'-': isff ? 173 : 189,
|
|
17904
|
-
'=': isff ? 61 : 187,
|
|
17905
|
-
';': isff ? 59 : 186,
|
|
17906
|
-
'\'': 222,
|
|
17907
|
-
'[': 219,
|
|
17908
|
-
']': 221,
|
|
17909
|
-
'\\': 220
|
|
17910
|
-
}; // Modifier Keys
|
|
17911
|
-
|
|
17912
|
-
var _modifier = {
|
|
17913
|
-
// shiftKey
|
|
17914
|
-
'⇧': 16,
|
|
17915
|
-
shift: 16,
|
|
17916
|
-
// altKey
|
|
17917
|
-
'⌥': 18,
|
|
17918
|
-
alt: 18,
|
|
17919
|
-
option: 18,
|
|
17920
|
-
// ctrlKey
|
|
17921
|
-
'⌃': 17,
|
|
17922
|
-
ctrl: 17,
|
|
17923
|
-
control: 17,
|
|
17924
|
-
// metaKey
|
|
17925
|
-
'⌘': 91,
|
|
17926
|
-
cmd: 91,
|
|
17927
|
-
command: 91
|
|
17928
|
-
};
|
|
17929
|
-
var modifierMap = {
|
|
17930
|
-
16: 'shiftKey',
|
|
17931
|
-
18: 'altKey',
|
|
17932
|
-
17: 'ctrlKey',
|
|
17933
|
-
91: 'metaKey',
|
|
17934
|
-
shiftKey: 16,
|
|
17935
|
-
ctrlKey: 17,
|
|
17936
|
-
altKey: 18,
|
|
17937
|
-
metaKey: 91
|
|
17938
|
-
};
|
|
17939
|
-
var _mods = {
|
|
17940
|
-
16: false,
|
|
17941
|
-
18: false,
|
|
17942
|
-
17: false,
|
|
17943
|
-
91: false
|
|
17944
|
-
};
|
|
17945
|
-
var _handlers = {}; // F1~F12 special key
|
|
17945
|
+
/**
|
|
17946
|
+
* mapping for special characters so they can support
|
|
17947
|
+
*
|
|
17948
|
+
* this dictionary is only used incase you want to bind a
|
|
17949
|
+
* keyup or keydown event to one of these keys
|
|
17950
|
+
*
|
|
17951
|
+
* @type {Object}
|
|
17952
|
+
*/
|
|
17953
|
+
var _KEYCODE_MAP = {
|
|
17954
|
+
106: '*',
|
|
17955
|
+
107: '+',
|
|
17956
|
+
109: '-',
|
|
17957
|
+
110: '.',
|
|
17958
|
+
111: '/',
|
|
17959
|
+
186: ';',
|
|
17960
|
+
187: '=',
|
|
17961
|
+
188: ',',
|
|
17962
|
+
189: '-',
|
|
17963
|
+
190: '.',
|
|
17964
|
+
191: '/',
|
|
17965
|
+
192: '`',
|
|
17966
|
+
219: '[',
|
|
17967
|
+
220: '\\',
|
|
17968
|
+
221: ']',
|
|
17969
|
+
222: '\''
|
|
17970
|
+
};
|
|
17946
17971
|
|
|
17947
|
-
|
|
17948
|
-
|
|
17949
|
-
|
|
17972
|
+
/**
|
|
17973
|
+
* this is a mapping of keys that require shift on a US keypad
|
|
17974
|
+
* back to the non shift equivelents
|
|
17975
|
+
*
|
|
17976
|
+
* this is so you can use keyup events with these keys
|
|
17977
|
+
*
|
|
17978
|
+
* note that this will only work reliably on US keyboards
|
|
17979
|
+
*
|
|
17980
|
+
* @type {Object}
|
|
17981
|
+
*/
|
|
17982
|
+
var _SHIFT_MAP = {
|
|
17983
|
+
'~': '`',
|
|
17984
|
+
'!': '1',
|
|
17985
|
+
'@': '2',
|
|
17986
|
+
'#': '3',
|
|
17987
|
+
'$': '4',
|
|
17988
|
+
'%': '5',
|
|
17989
|
+
'^': '6',
|
|
17990
|
+
'&': '7',
|
|
17991
|
+
'*': '8',
|
|
17992
|
+
'(': '9',
|
|
17993
|
+
')': '0',
|
|
17994
|
+
'_': '-',
|
|
17995
|
+
'+': '=',
|
|
17996
|
+
':': ';',
|
|
17997
|
+
'\"': '\'',
|
|
17998
|
+
'<': ',',
|
|
17999
|
+
'>': '.',
|
|
18000
|
+
'?': '/',
|
|
18001
|
+
'|': '\\'
|
|
18002
|
+
};
|
|
17950
18003
|
|
|
17951
|
-
|
|
18004
|
+
/**
|
|
18005
|
+
* this is a list of special strings you can use to map
|
|
18006
|
+
* to modifier keys when you specify your keyboard shortcuts
|
|
18007
|
+
*
|
|
18008
|
+
* @type {Object}
|
|
18009
|
+
*/
|
|
18010
|
+
var _SPECIAL_ALIASES = {
|
|
18011
|
+
'option': 'alt',
|
|
18012
|
+
'command': 'meta',
|
|
18013
|
+
'return': 'enter',
|
|
18014
|
+
'escape': 'esc',
|
|
18015
|
+
'plus': '+',
|
|
18016
|
+
'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'
|
|
18017
|
+
};
|
|
17952
18018
|
|
|
17953
|
-
|
|
18019
|
+
/**
|
|
18020
|
+
* variable to store the flipped version of _MAP from above
|
|
18021
|
+
* needed to check if we should use keypress or not when no action
|
|
18022
|
+
* is specified
|
|
18023
|
+
*
|
|
18024
|
+
* @type {Object|undefined}
|
|
18025
|
+
*/
|
|
18026
|
+
var _REVERSE_MAP;
|
|
18027
|
+
|
|
18028
|
+
/**
|
|
18029
|
+
* loop through the f keys, f1 to f19 and add them to the map
|
|
18030
|
+
* programatically
|
|
18031
|
+
*/
|
|
18032
|
+
for (var i = 1; i < 20; ++i) {
|
|
18033
|
+
_MAP[111 + i] = 'f' + i;
|
|
18034
|
+
}
|
|
17954
18035
|
|
|
17955
|
-
|
|
17956
|
-
|
|
18036
|
+
/**
|
|
18037
|
+
* loop through to map numbers on the numeric keypad
|
|
18038
|
+
*/
|
|
18039
|
+
for (i = 0; i <= 9; ++i) {
|
|
18040
|
+
// This needs to use a string cause otherwise since 0 is falsey
|
|
18041
|
+
// mousetrap will never fire for numpad 0 pressed as part of a keydown
|
|
18042
|
+
// event.
|
|
18043
|
+
//
|
|
18044
|
+
// @see https://github.com/ccampbell/mousetrap/pull/258
|
|
18045
|
+
_MAP[i + 96] = i.toString();
|
|
18046
|
+
}
|
|
18047
|
+
|
|
18048
|
+
/**
|
|
18049
|
+
* cross browser add event method
|
|
18050
|
+
*
|
|
18051
|
+
* @param {Element|HTMLDocument} object
|
|
18052
|
+
* @param {string} type
|
|
18053
|
+
* @param {Function} callback
|
|
18054
|
+
* @returns void
|
|
18055
|
+
*/
|
|
18056
|
+
function _addEvent(object, type, callback) {
|
|
18057
|
+
if (object.addEventListener) {
|
|
18058
|
+
object.addEventListener(type, callback, false);
|
|
18059
|
+
return;
|
|
18060
|
+
}
|
|
18061
|
+
object.attachEvent('on' + type, callback);
|
|
18062
|
+
}
|
|
17957
18063
|
|
|
17958
|
-
|
|
17959
|
-
|
|
17960
|
-
|
|
18064
|
+
/**
|
|
18065
|
+
* takes the event and returns the key character
|
|
18066
|
+
*
|
|
18067
|
+
* @param {Event} e
|
|
18068
|
+
* @return {string}
|
|
18069
|
+
*/
|
|
18070
|
+
function _characterFromEvent(e) {
|
|
18071
|
+
// for keypress events we should return the character as is
|
|
18072
|
+
if (e.type == 'keypress') {
|
|
18073
|
+
var character = String.fromCharCode(e.which);
|
|
18074
|
+
|
|
18075
|
+
// if the shift key is not pressed then it is safe to assume
|
|
18076
|
+
// that we want the character to be lowercase. this means if
|
|
18077
|
+
// you accidentally have caps lock on then your key bindings
|
|
18078
|
+
// will continue to work
|
|
18079
|
+
//
|
|
18080
|
+
// the only side effect that might not be desired is if you
|
|
18081
|
+
// bind something like 'A' cause you want to trigger an
|
|
18082
|
+
// event when capital A is pressed caps lock will no longer
|
|
18083
|
+
// trigger the event. shift+a will though.
|
|
18084
|
+
if (!e.shiftKey) {
|
|
18085
|
+
character = character.toLowerCase();
|
|
18086
|
+
}
|
|
18087
|
+
return character;
|
|
18088
|
+
}
|
|
17961
18089
|
|
|
18090
|
+
// for non keypress events the special maps are needed
|
|
18091
|
+
if (_MAP[e.which]) {
|
|
18092
|
+
return _MAP[e.which];
|
|
18093
|
+
}
|
|
18094
|
+
if (_KEYCODE_MAP[e.which]) {
|
|
18095
|
+
return _KEYCODE_MAP[e.which];
|
|
18096
|
+
}
|
|
17962
18097
|
|
|
17963
|
-
|
|
17964
|
-
_scope = scope || 'all';
|
|
17965
|
-
} // 获取当前范围
|
|
18098
|
+
// if it is not in the special map
|
|
17966
18099
|
|
|
18100
|
+
// with keydown and keyup events the character seems to always
|
|
18101
|
+
// come in as an uppercase character whether you are pressing shift
|
|
18102
|
+
// or not. we should make sure it is always lowercase for comparisons
|
|
18103
|
+
return String.fromCharCode(e.which).toLowerCase();
|
|
18104
|
+
}
|
|
17967
18105
|
|
|
17968
|
-
|
|
17969
|
-
|
|
17970
|
-
|
|
18106
|
+
/**
|
|
18107
|
+
* checks if two arrays are equal
|
|
18108
|
+
*
|
|
18109
|
+
* @param {Array} modifiers1
|
|
18110
|
+
* @param {Array} modifiers2
|
|
18111
|
+
* @returns {boolean}
|
|
18112
|
+
*/
|
|
18113
|
+
function _modifiersMatch(modifiers1, modifiers2) {
|
|
18114
|
+
return modifiers1.sort().join(',') === modifiers2.sort().join(',');
|
|
18115
|
+
}
|
|
17971
18116
|
|
|
18117
|
+
/**
|
|
18118
|
+
* takes a key event and figures out what the modifiers are
|
|
18119
|
+
*
|
|
18120
|
+
* @param {Event} e
|
|
18121
|
+
* @returns {Array}
|
|
18122
|
+
*/
|
|
18123
|
+
function _eventModifiers(e) {
|
|
18124
|
+
var modifiers = [];
|
|
18125
|
+
if (e.shiftKey) {
|
|
18126
|
+
modifiers.push('shift');
|
|
18127
|
+
}
|
|
18128
|
+
if (e.altKey) {
|
|
18129
|
+
modifiers.push('alt');
|
|
18130
|
+
}
|
|
18131
|
+
if (e.ctrlKey) {
|
|
18132
|
+
modifiers.push('ctrl');
|
|
18133
|
+
}
|
|
18134
|
+
if (e.metaKey) {
|
|
18135
|
+
modifiers.push('meta');
|
|
18136
|
+
}
|
|
18137
|
+
return modifiers;
|
|
18138
|
+
}
|
|
17972
18139
|
|
|
17973
|
-
|
|
17974
|
-
|
|
17975
|
-
|
|
17976
|
-
|
|
18140
|
+
/**
|
|
18141
|
+
* prevents default for this event
|
|
18142
|
+
*
|
|
18143
|
+
* @param {Event} e
|
|
18144
|
+
* @returns void
|
|
18145
|
+
*/
|
|
18146
|
+
function _preventDefault(e) {
|
|
18147
|
+
if (e.preventDefault) {
|
|
18148
|
+
e.preventDefault();
|
|
18149
|
+
return;
|
|
18150
|
+
}
|
|
18151
|
+
e.returnValue = false;
|
|
18152
|
+
}
|
|
17977
18153
|
|
|
18154
|
+
/**
|
|
18155
|
+
* stops propogation for this event
|
|
18156
|
+
*
|
|
18157
|
+
* @param {Event} e
|
|
18158
|
+
* @returns void
|
|
18159
|
+
*/
|
|
18160
|
+
function _stopPropagation(e) {
|
|
18161
|
+
if (e.stopPropagation) {
|
|
18162
|
+
e.stopPropagation();
|
|
18163
|
+
return;
|
|
18164
|
+
}
|
|
18165
|
+
e.cancelBubble = true;
|
|
18166
|
+
}
|
|
17978
18167
|
|
|
17979
|
-
|
|
17980
|
-
|
|
17981
|
-
|
|
17982
|
-
|
|
18168
|
+
/**
|
|
18169
|
+
* determines if the keycode specified is a modifier key or not
|
|
18170
|
+
*
|
|
18171
|
+
* @param {string} key
|
|
18172
|
+
* @returns {boolean}
|
|
18173
|
+
*/
|
|
18174
|
+
function _isModifier(key) {
|
|
18175
|
+
return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';
|
|
18176
|
+
}
|
|
17983
18177
|
|
|
17984
|
-
|
|
17985
|
-
|
|
17986
|
-
|
|
18178
|
+
/**
|
|
18179
|
+
* reverses the map lookup so that we can look for specific keys
|
|
18180
|
+
* to see what can and can't use keypress
|
|
18181
|
+
*
|
|
18182
|
+
* @return {Object}
|
|
18183
|
+
*/
|
|
18184
|
+
function _getReverseMap() {
|
|
18185
|
+
if (!_REVERSE_MAP) {
|
|
18186
|
+
_REVERSE_MAP = {};
|
|
18187
|
+
for (var key in _MAP) {
|
|
18188
|
+
// pull out the numeric keypad from here cause keypress should
|
|
18189
|
+
// be able to detect the keys from the character
|
|
18190
|
+
if (key > 95 && key < 112) {
|
|
18191
|
+
continue;
|
|
18192
|
+
}
|
|
18193
|
+
if (_MAP.hasOwnProperty(key)) {
|
|
18194
|
+
_REVERSE_MAP[_MAP[key]] = key;
|
|
18195
|
+
}
|
|
18196
|
+
}
|
|
18197
|
+
}
|
|
18198
|
+
return _REVERSE_MAP;
|
|
18199
|
+
}
|
|
17987
18200
|
|
|
17988
|
-
|
|
17989
|
-
|
|
18201
|
+
/**
|
|
18202
|
+
* picks the best action based on the key combination
|
|
18203
|
+
*
|
|
18204
|
+
* @param {string} key - character for key
|
|
18205
|
+
* @param {Array} modifiers
|
|
18206
|
+
* @param {string=} action passed in
|
|
18207
|
+
*/
|
|
18208
|
+
function _pickBestAction(key, modifiers, action) {
|
|
18209
|
+
// if no action was picked in we should try to pick the one
|
|
18210
|
+
// that we think would work best for this key
|
|
18211
|
+
if (!action) {
|
|
18212
|
+
action = _getReverseMap()[key] ? 'keydown' : 'keypress';
|
|
18213
|
+
}
|
|
17990
18214
|
|
|
18215
|
+
// modifier keys don't work as expected with keypress,
|
|
18216
|
+
// switch to keydown
|
|
18217
|
+
if (action == 'keypress' && modifiers.length) {
|
|
18218
|
+
action = 'keydown';
|
|
18219
|
+
}
|
|
18220
|
+
return action;
|
|
18221
|
+
}
|
|
17991
18222
|
|
|
17992
|
-
|
|
17993
|
-
|
|
17994
|
-
|
|
17995
|
-
}
|
|
18223
|
+
/**
|
|
18224
|
+
* Converts from a string key combination to an array
|
|
18225
|
+
*
|
|
18226
|
+
* @param {string} combination like "command+shift+l"
|
|
18227
|
+
* @return {Array}
|
|
18228
|
+
*/
|
|
18229
|
+
function _keysFromString(combination) {
|
|
18230
|
+
if (combination === '+') {
|
|
18231
|
+
return ['+'];
|
|
18232
|
+
}
|
|
18233
|
+
combination = combination.replace(/\+{2}/g, '+plus');
|
|
18234
|
+
return combination.split('+');
|
|
18235
|
+
}
|
|
17996
18236
|
|
|
17997
|
-
|
|
17998
|
-
|
|
18237
|
+
/**
|
|
18238
|
+
* Gets info for a specific key combination
|
|
18239
|
+
*
|
|
18240
|
+
* @param {string} combination key combination ("command+s" or "a" or "*")
|
|
18241
|
+
* @param {string=} action
|
|
18242
|
+
* @returns {Object}
|
|
18243
|
+
*/
|
|
18244
|
+
function _getKeyInfo(combination, action) {
|
|
18245
|
+
var keys;
|
|
18246
|
+
var key;
|
|
18247
|
+
var i;
|
|
18248
|
+
var modifiers = [];
|
|
17999
18249
|
|
|
18250
|
+
// take the keys from this pattern and figure out what the actual
|
|
18251
|
+
// pattern is all about
|
|
18252
|
+
keys = _keysFromString(combination);
|
|
18253
|
+
for (i = 0; i < keys.length; ++i) {
|
|
18254
|
+
key = keys[i];
|
|
18000
18255
|
|
|
18001
|
-
|
|
18002
|
-
|
|
18003
|
-
|
|
18256
|
+
// normalize key names
|
|
18257
|
+
if (_SPECIAL_ALIASES[key]) {
|
|
18258
|
+
key = _SPECIAL_ALIASES[key];
|
|
18259
|
+
}
|
|
18004
18260
|
|
|
18005
|
-
|
|
18261
|
+
// if this is not a keypress event then we should
|
|
18262
|
+
// be smart about using shift keys
|
|
18263
|
+
// this will only work for US keyboards however
|
|
18264
|
+
if (action && action != 'keypress' && _SHIFT_MAP[key]) {
|
|
18265
|
+
key = _SHIFT_MAP[key];
|
|
18266
|
+
modifiers.push('shift');
|
|
18267
|
+
}
|
|
18006
18268
|
|
|
18007
|
-
|
|
18008
|
-
|
|
18009
|
-
|
|
18269
|
+
// if this key is a modifier then add it to the list of modifiers
|
|
18270
|
+
if (_isModifier(key)) {
|
|
18271
|
+
modifiers.push(key);
|
|
18272
|
+
}
|
|
18273
|
+
}
|
|
18010
18274
|
|
|
18011
|
-
|
|
18012
|
-
|
|
18275
|
+
// depending on what the key combination is
|
|
18276
|
+
// we will try to pick the best event for it
|
|
18277
|
+
action = _pickBestAction(key, modifiers, action);
|
|
18278
|
+
return {
|
|
18279
|
+
key: key,
|
|
18280
|
+
modifiers: modifiers,
|
|
18281
|
+
action: action
|
|
18282
|
+
};
|
|
18283
|
+
}
|
|
18284
|
+
function _belongsTo(element, ancestor) {
|
|
18285
|
+
if (element === null || element === document) {
|
|
18286
|
+
return false;
|
|
18287
|
+
}
|
|
18288
|
+
if (element === ancestor) {
|
|
18289
|
+
return true;
|
|
18013
18290
|
}
|
|
18291
|
+
return _belongsTo(element.parentNode, ancestor);
|
|
18014
18292
|
}
|
|
18015
|
-
|
|
18293
|
+
function Mousetrap(targetElement) {
|
|
18294
|
+
var self = this;
|
|
18295
|
+
targetElement = targetElement || document;
|
|
18296
|
+
if (!(self instanceof Mousetrap)) {
|
|
18297
|
+
return new Mousetrap(targetElement);
|
|
18298
|
+
}
|
|
18016
18299
|
|
|
18300
|
+
/**
|
|
18301
|
+
* element to attach key events to
|
|
18302
|
+
*
|
|
18303
|
+
* @type {Element}
|
|
18304
|
+
*/
|
|
18305
|
+
self.target = targetElement;
|
|
18017
18306
|
|
|
18018
|
-
|
|
18019
|
-
|
|
18307
|
+
/**
|
|
18308
|
+
* a list of all the callbacks setup via Mousetrap.bind()
|
|
18309
|
+
*
|
|
18310
|
+
* @type {Object}
|
|
18311
|
+
*/
|
|
18312
|
+
self._callbacks = {};
|
|
18020
18313
|
|
|
18314
|
+
/**
|
|
18315
|
+
* direct map of string combinations to callbacks used for trigger()
|
|
18316
|
+
*
|
|
18317
|
+
* @type {Object}
|
|
18318
|
+
*/
|
|
18319
|
+
self._directMap = {};
|
|
18021
18320
|
|
|
18022
|
-
|
|
18023
|
-
|
|
18321
|
+
/**
|
|
18322
|
+
* keeps track of what level each sequence is at since multiple
|
|
18323
|
+
* sequences can start out with the same sequence
|
|
18324
|
+
*
|
|
18325
|
+
* @type {Object}
|
|
18326
|
+
*/
|
|
18327
|
+
var _sequenceLevels = {};
|
|
18024
18328
|
|
|
18025
|
-
|
|
18329
|
+
/**
|
|
18330
|
+
* variable to store the setTimeout call
|
|
18331
|
+
*
|
|
18332
|
+
* @type {null|number}
|
|
18333
|
+
*/
|
|
18334
|
+
var _resetTimer;
|
|
18026
18335
|
|
|
18336
|
+
/**
|
|
18337
|
+
* temporary state where we will ignore the next keyup
|
|
18338
|
+
*
|
|
18339
|
+
* @type {boolean|string}
|
|
18340
|
+
*/
|
|
18341
|
+
var _ignoreNextKeyup = false;
|
|
18027
18342
|
|
|
18028
|
-
|
|
18029
|
-
|
|
18030
|
-
|
|
18343
|
+
/**
|
|
18344
|
+
* temporary state where we will ignore the next keypress
|
|
18345
|
+
*
|
|
18346
|
+
* @type {boolean}
|
|
18347
|
+
*/
|
|
18348
|
+
var _ignoreNextKeypress = false;
|
|
18031
18349
|
|
|
18350
|
+
/**
|
|
18351
|
+
* are we currently inside of a sequence?
|
|
18352
|
+
* type of action ("keyup" or "keydown" or "keypress") or false
|
|
18353
|
+
*
|
|
18354
|
+
* @type {boolean|string}
|
|
18355
|
+
*/
|
|
18356
|
+
var _nextExpectedAction = false;
|
|
18032
18357
|
|
|
18033
|
-
|
|
18034
|
-
|
|
18035
|
-
|
|
18358
|
+
/**
|
|
18359
|
+
* resets all sequence counters except for the ones passed in
|
|
18360
|
+
*
|
|
18361
|
+
* @param {Object} doNotReset
|
|
18362
|
+
* @returns void
|
|
18363
|
+
*/
|
|
18364
|
+
function _resetSequences(doNotReset) {
|
|
18365
|
+
doNotReset = doNotReset || {};
|
|
18366
|
+
var activeSequences = false,
|
|
18367
|
+
key;
|
|
18368
|
+
for (key in _sequenceLevels) {
|
|
18369
|
+
if (doNotReset[key]) {
|
|
18370
|
+
activeSequences = true;
|
|
18371
|
+
continue;
|
|
18372
|
+
}
|
|
18373
|
+
_sequenceLevels[key] = 0;
|
|
18374
|
+
}
|
|
18375
|
+
if (!activeSequences) {
|
|
18376
|
+
_nextExpectedAction = false;
|
|
18377
|
+
}
|
|
18378
|
+
}
|
|
18036
18379
|
|
|
18380
|
+
/**
|
|
18381
|
+
* finds all callbacks that match based on the keycode, modifiers,
|
|
18382
|
+
* and action
|
|
18383
|
+
*
|
|
18384
|
+
* @param {string} character
|
|
18385
|
+
* @param {Array} modifiers
|
|
18386
|
+
* @param {Event|Object} e
|
|
18387
|
+
* @param {string=} sequenceName - name of the sequence we are looking for
|
|
18388
|
+
* @param {string=} combination
|
|
18389
|
+
* @param {number=} level
|
|
18390
|
+
* @returns {Array}
|
|
18391
|
+
*/
|
|
18392
|
+
function _getMatches(character, modifiers, e, sequenceName, combination, level) {
|
|
18393
|
+
var i;
|
|
18394
|
+
var callback;
|
|
18395
|
+
var matches = [];
|
|
18396
|
+
var action = e.type;
|
|
18037
18397
|
|
|
18038
|
-
|
|
18398
|
+
// if there are no events related to this keycode
|
|
18399
|
+
if (!self._callbacks[character]) {
|
|
18400
|
+
return [];
|
|
18401
|
+
}
|
|
18039
18402
|
|
|
18040
|
-
|
|
18041
|
-
|
|
18403
|
+
// if a modifier key is coming up on its own we should allow it
|
|
18404
|
+
if (action == 'keyup' && _isModifier(character)) {
|
|
18405
|
+
modifiers = [character];
|
|
18406
|
+
}
|
|
18042
18407
|
|
|
18043
|
-
|
|
18044
|
-
|
|
18045
|
-
|
|
18046
|
-
|
|
18047
|
-
}
|
|
18408
|
+
// loop through all callbacks for the key that was pressed
|
|
18409
|
+
// and see if any of them match
|
|
18410
|
+
for (i = 0; i < self._callbacks[character].length; ++i) {
|
|
18411
|
+
callback = self._callbacks[character][i];
|
|
18048
18412
|
|
|
18049
|
-
|
|
18050
|
-
|
|
18051
|
-
|
|
18052
|
-
|
|
18053
|
-
|
|
18054
|
-
});
|
|
18055
|
-
} else if (Array.isArray(keysInfo)) {
|
|
18056
|
-
// support like : unbind([{key: 'ctrl+a', scope: 's1'}, {key: 'ctrl-a', scope: 's2', splitKey: '-'}])
|
|
18057
|
-
keysInfo.forEach(function (info) {
|
|
18058
|
-
if (info.key) eachUnbind(info);
|
|
18059
|
-
});
|
|
18060
|
-
} else if (typeof keysInfo === 'object') {
|
|
18061
|
-
// support like unbind({key: 'ctrl+a, ctrl+b', scope:'abc'})
|
|
18062
|
-
if (keysInfo.key) eachUnbind(keysInfo);
|
|
18063
|
-
} else if (typeof keysInfo === 'string') {
|
|
18064
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
18065
|
-
args[_key - 1] = arguments[_key];
|
|
18066
|
-
}
|
|
18413
|
+
// if a sequence name is not specified, but this is a sequence at
|
|
18414
|
+
// the wrong level then move onto the next match
|
|
18415
|
+
if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {
|
|
18416
|
+
continue;
|
|
18417
|
+
}
|
|
18067
18418
|
|
|
18068
|
-
|
|
18069
|
-
|
|
18070
|
-
|
|
18071
|
-
|
|
18419
|
+
// if the action we are looking for doesn't match the action we got
|
|
18420
|
+
// then we should keep going
|
|
18421
|
+
if (action != callback.action) {
|
|
18422
|
+
continue;
|
|
18423
|
+
}
|
|
18072
18424
|
|
|
18073
|
-
|
|
18074
|
-
|
|
18075
|
-
|
|
18076
|
-
|
|
18425
|
+
// if this is a keypress event and the meta key and control key
|
|
18426
|
+
// are not pressed that means that we need to only look at the
|
|
18427
|
+
// character, otherwise check the modifiers as well
|
|
18428
|
+
//
|
|
18429
|
+
// chrome will not fire a keypress if meta or control is down
|
|
18430
|
+
// safari will fire a keypress if meta or meta+shift is down
|
|
18431
|
+
// firefox will fire a keypress if meta or control is down
|
|
18432
|
+
if (action == 'keypress' && !e.metaKey && !e.ctrlKey || _modifiersMatch(modifiers, callback.modifiers)) {
|
|
18433
|
+
// when you bind a combination or sequence a second time it
|
|
18434
|
+
// should overwrite the first one. if a sequenceName or
|
|
18435
|
+
// combination is specified in this call it does just that
|
|
18436
|
+
//
|
|
18437
|
+
// @todo make deleting its own method?
|
|
18438
|
+
var deleteCombo = !sequenceName && callback.combo == combination;
|
|
18439
|
+
var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;
|
|
18440
|
+
if (deleteCombo || deleteSequence) {
|
|
18441
|
+
self._callbacks[character].splice(i, 1);
|
|
18442
|
+
}
|
|
18443
|
+
matches.push(callback);
|
|
18444
|
+
}
|
|
18445
|
+
}
|
|
18446
|
+
return matches;
|
|
18447
|
+
}
|
|
18077
18448
|
|
|
18078
|
-
|
|
18079
|
-
|
|
18080
|
-
|
|
18081
|
-
|
|
18082
|
-
|
|
18083
|
-
|
|
18084
|
-
|
|
18085
|
-
}
|
|
18086
|
-
|
|
18087
|
-
|
|
18088
|
-
|
|
18089
|
-
|
|
18090
|
-
|
|
18091
|
-
|
|
18092
|
-
|
|
18093
|
-
|
|
18094
|
-
|
|
18095
|
-
|
|
18096
|
-
|
|
18097
|
-
var len = unbindKeys.length;
|
|
18098
|
-
var lastKey = unbindKeys[len - 1];
|
|
18099
|
-
var keyCode = lastKey === '*' ? '*' : code(lastKey);
|
|
18100
|
-
if (!_handlers[keyCode]) return; // 判断是否传入范围,没有就获取范围
|
|
18101
|
-
|
|
18102
|
-
if (!scope) scope = getScope();
|
|
18103
|
-
var mods = len > 1 ? getMods(_modifier, unbindKeys) : [];
|
|
18104
|
-
_handlers[keyCode] = _handlers[keyCode].map(function (record) {
|
|
18105
|
-
// 通过函数判断,是否解除绑定,函数相等直接返回
|
|
18106
|
-
var isMatchingMethod = method ? record.method === method : true;
|
|
18107
|
-
|
|
18108
|
-
if (isMatchingMethod && record.scope === scope && compareArray(record.mods, mods)) {
|
|
18109
|
-
return {};
|
|
18449
|
+
/**
|
|
18450
|
+
* actually calls the callback function
|
|
18451
|
+
*
|
|
18452
|
+
* if your callback function returns false this will use the jquery
|
|
18453
|
+
* convention - prevent default and stop propogation on the event
|
|
18454
|
+
*
|
|
18455
|
+
* @param {Function} callback
|
|
18456
|
+
* @param {Event} e
|
|
18457
|
+
* @returns void
|
|
18458
|
+
*/
|
|
18459
|
+
function _fireCallback(callback, e, combo, sequence) {
|
|
18460
|
+
// if this event should not happen stop here
|
|
18461
|
+
if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {
|
|
18462
|
+
return;
|
|
18463
|
+
}
|
|
18464
|
+
if (callback(e, combo) === false) {
|
|
18465
|
+
_preventDefault(e);
|
|
18466
|
+
_stopPropagation(e);
|
|
18467
|
+
}
|
|
18110
18468
|
}
|
|
18111
18469
|
|
|
18112
|
-
|
|
18113
|
-
|
|
18114
|
-
|
|
18115
|
-
}
|
|
18470
|
+
/**
|
|
18471
|
+
* handles a character key event
|
|
18472
|
+
*
|
|
18473
|
+
* @param {string} character
|
|
18474
|
+
* @param {Array} modifiers
|
|
18475
|
+
* @param {Event} e
|
|
18476
|
+
* @returns void
|
|
18477
|
+
*/
|
|
18478
|
+
self._handleKey = function (character, modifiers, e) {
|
|
18479
|
+
var callbacks = _getMatches(character, modifiers, e);
|
|
18480
|
+
var i;
|
|
18481
|
+
var doNotReset = {};
|
|
18482
|
+
var maxLevel = 0;
|
|
18483
|
+
var processedSequenceCallback = false;
|
|
18484
|
+
|
|
18485
|
+
// Calculate the maxLevel for sequences so we can only execute the longest callback sequence
|
|
18486
|
+
for (i = 0; i < callbacks.length; ++i) {
|
|
18487
|
+
if (callbacks[i].seq) {
|
|
18488
|
+
maxLevel = Math.max(maxLevel, callbacks[i].level);
|
|
18489
|
+
}
|
|
18490
|
+
}
|
|
18116
18491
|
|
|
18492
|
+
// loop through matching callbacks for this key event
|
|
18493
|
+
for (i = 0; i < callbacks.length; ++i) {
|
|
18494
|
+
// fire for all sequence callbacks
|
|
18495
|
+
// this is because if for example you have multiple sequences
|
|
18496
|
+
// bound such as "g i" and "g t" they both need to fire the
|
|
18497
|
+
// callback for matching g cause otherwise you can only ever
|
|
18498
|
+
// match the first one
|
|
18499
|
+
if (callbacks[i].seq) {
|
|
18500
|
+
// only fire callbacks for the maxLevel to prevent
|
|
18501
|
+
// subsequences from also firing
|
|
18502
|
+
//
|
|
18503
|
+
// for example 'a option b' should not cause 'option b' to fire
|
|
18504
|
+
// even though 'option b' is part of the other sequence
|
|
18505
|
+
//
|
|
18506
|
+
// any sequences that do not match here will be discarded
|
|
18507
|
+
// below by the _resetSequences call
|
|
18508
|
+
if (callbacks[i].level != maxLevel) {
|
|
18509
|
+
continue;
|
|
18510
|
+
}
|
|
18511
|
+
processedSequenceCallback = true;
|
|
18117
18512
|
|
|
18118
|
-
|
|
18119
|
-
|
|
18513
|
+
// keep a list of which sequences were matches for later
|
|
18514
|
+
doNotReset[callbacks[i].seq] = 1;
|
|
18515
|
+
_fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);
|
|
18516
|
+
continue;
|
|
18517
|
+
}
|
|
18120
18518
|
|
|
18121
|
-
|
|
18122
|
-
|
|
18123
|
-
|
|
18519
|
+
// if there were no sequence matches but we are still here
|
|
18520
|
+
// that means this is a regular match so we should fire that
|
|
18521
|
+
if (!processedSequenceCallback) {
|
|
18522
|
+
_fireCallback(callbacks[i].callback, e, callbacks[i].combo);
|
|
18523
|
+
}
|
|
18524
|
+
}
|
|
18525
|
+
|
|
18526
|
+
// if the key you pressed matches the type of sequence without
|
|
18527
|
+
// being a modifier (ie "keyup" or "keypress") then we should
|
|
18528
|
+
// reset all sequences that were not matched by this event
|
|
18529
|
+
//
|
|
18530
|
+
// this is so, for example, if you have the sequence "h a t" and you
|
|
18531
|
+
// type "h e a r t" it does not match. in this case the "e" will
|
|
18532
|
+
// cause the sequence to reset
|
|
18533
|
+
//
|
|
18534
|
+
// modifier keys are ignored because you can have a sequence
|
|
18535
|
+
// that contains modifiers such as "enter ctrl+space" and in most
|
|
18536
|
+
// cases the modifier key will be pressed before the next key
|
|
18537
|
+
//
|
|
18538
|
+
// also if you have a sequence such as "ctrl+b a" then pressing the
|
|
18539
|
+
// "b" key will trigger a "keypress" and a "keydown"
|
|
18540
|
+
//
|
|
18541
|
+
// the "keydown" is expected when there is a modifier, but the
|
|
18542
|
+
// "keypress" ends up matching the _nextExpectedAction since it occurs
|
|
18543
|
+
// after and that causes the sequence to reset
|
|
18544
|
+
//
|
|
18545
|
+
// we ignore keypresses in a sequence that directly follow a keydown
|
|
18546
|
+
// for the same character
|
|
18547
|
+
var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;
|
|
18548
|
+
if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {
|
|
18549
|
+
_resetSequences(doNotReset);
|
|
18550
|
+
}
|
|
18551
|
+
_ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';
|
|
18552
|
+
};
|
|
18124
18553
|
|
|
18125
|
-
|
|
18126
|
-
|
|
18127
|
-
|
|
18128
|
-
|
|
18554
|
+
/**
|
|
18555
|
+
* handles a keydown event
|
|
18556
|
+
*
|
|
18557
|
+
* @param {Event} e
|
|
18558
|
+
* @returns void
|
|
18559
|
+
*/
|
|
18560
|
+
function _handleKeyEvent(e) {
|
|
18561
|
+
// normalize e.which for key events
|
|
18562
|
+
// @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion
|
|
18563
|
+
if (typeof e.which !== 'number') {
|
|
18564
|
+
e.which = e.keyCode;
|
|
18129
18565
|
}
|
|
18130
|
-
|
|
18131
|
-
} // 调用处理程序,如果是修饰键不做处理
|
|
18566
|
+
var character = _characterFromEvent(e);
|
|
18132
18567
|
|
|
18568
|
+
// no character found then stop
|
|
18569
|
+
if (!character) {
|
|
18570
|
+
return;
|
|
18571
|
+
}
|
|
18133
18572
|
|
|
18134
|
-
|
|
18135
|
-
|
|
18136
|
-
|
|
18137
|
-
|
|
18138
|
-
|
|
18573
|
+
// need to use === for the character check because the character can be 0
|
|
18574
|
+
if (e.type == 'keyup' && _ignoreNextKeyup === character) {
|
|
18575
|
+
_ignoreNextKeyup = false;
|
|
18576
|
+
return;
|
|
18577
|
+
}
|
|
18578
|
+
self.handleKey(character, _eventModifiers(e), e);
|
|
18139
18579
|
}
|
|
18140
|
-
}
|
|
18141
|
-
}
|
|
18142
|
-
} // 处理keydown事件
|
|
18143
|
-
|
|
18144
18580
|
|
|
18145
|
-
|
|
18146
|
-
|
|
18147
|
-
|
|
18581
|
+
/**
|
|
18582
|
+
* called to set a 1 second timeout on the specified sequence
|
|
18583
|
+
*
|
|
18584
|
+
* this is so after each key press in the sequence you have 1 second
|
|
18585
|
+
* to press the next key before you have to start over
|
|
18586
|
+
*
|
|
18587
|
+
* @returns void
|
|
18588
|
+
*/
|
|
18589
|
+
function _resetSequenceTimer() {
|
|
18590
|
+
clearTimeout(_resetTimer);
|
|
18591
|
+
_resetTimer = setTimeout(_resetSequences, 1000);
|
|
18592
|
+
}
|
|
18148
18593
|
|
|
18149
|
-
|
|
18150
|
-
|
|
18594
|
+
/**
|
|
18595
|
+
* binds a key sequence to an event
|
|
18596
|
+
*
|
|
18597
|
+
* @param {string} combo - combo specified in bind call
|
|
18598
|
+
* @param {Array} keys
|
|
18599
|
+
* @param {Function} callback
|
|
18600
|
+
* @param {string=} action
|
|
18601
|
+
* @returns void
|
|
18602
|
+
*/
|
|
18603
|
+
function _bindSequence(combo, keys, callback, action) {
|
|
18604
|
+
// start off by adding a sequence level record for this combination
|
|
18605
|
+
// and setting the level to 0
|
|
18606
|
+
_sequenceLevels[combo] = 0;
|
|
18151
18607
|
|
|
18152
|
-
|
|
18153
|
-
|
|
18154
|
-
|
|
18155
|
-
|
|
18156
|
-
|
|
18157
|
-
|
|
18158
|
-
|
|
18608
|
+
/**
|
|
18609
|
+
* callback to increase the sequence level for this sequence and reset
|
|
18610
|
+
* all other sequences that were active
|
|
18611
|
+
*
|
|
18612
|
+
* @param {string} nextAction
|
|
18613
|
+
* @returns {Function}
|
|
18614
|
+
*/
|
|
18615
|
+
function _increaseSequence(nextAction) {
|
|
18616
|
+
return function () {
|
|
18617
|
+
_nextExpectedAction = nextAction;
|
|
18618
|
+
++_sequenceLevels[combo];
|
|
18619
|
+
_resetSequenceTimer();
|
|
18620
|
+
};
|
|
18621
|
+
}
|
|
18159
18622
|
|
|
18160
|
-
|
|
18161
|
-
|
|
18162
|
-
|
|
18163
|
-
|
|
18164
|
-
|
|
18623
|
+
/**
|
|
18624
|
+
* wraps the specified callback inside of another function in order
|
|
18625
|
+
* to reset all sequence counters as soon as this sequence is done
|
|
18626
|
+
*
|
|
18627
|
+
* @param {Event} e
|
|
18628
|
+
* @returns void
|
|
18629
|
+
*/
|
|
18630
|
+
function _callbackAndReset(e) {
|
|
18631
|
+
_fireCallback(callback, e, combo);
|
|
18632
|
+
|
|
18633
|
+
// we should ignore the next key up if the action is key down
|
|
18634
|
+
// or keypress. this is so if you finish a sequence and
|
|
18635
|
+
// release the key the final key will not trigger a keyup
|
|
18636
|
+
if (action !== 'keyup') {
|
|
18637
|
+
_ignoreNextKeyup = _characterFromEvent(e);
|
|
18638
|
+
}
|
|
18165
18639
|
|
|
18166
|
-
|
|
18167
|
-
|
|
18640
|
+
// weird race condition if a sequence ends with the key
|
|
18641
|
+
// another sequence begins with
|
|
18642
|
+
setTimeout(_resetSequences, 10);
|
|
18643
|
+
}
|
|
18644
|
+
|
|
18645
|
+
// loop through keys one at a time and bind the appropriate callback
|
|
18646
|
+
// function. for any key leading up to the final one it should
|
|
18647
|
+
// increase the sequence. after the final, it should reset all sequences
|
|
18648
|
+
//
|
|
18649
|
+
// if an action is specified in the original bind call then that will
|
|
18650
|
+
// be used throughout. otherwise we will pass the action that the
|
|
18651
|
+
// next key in the sequence should match. this allows a sequence
|
|
18652
|
+
// to mix and match keypress and keydown events depending on which
|
|
18653
|
+
// ones are better suited to the key provided
|
|
18654
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
18655
|
+
var isFinal = i + 1 === keys.length;
|
|
18656
|
+
var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);
|
|
18657
|
+
_bindSingle(keys[i], wrappedCallback, action, combo, i);
|
|
18658
|
+
}
|
|
18659
|
+
}
|
|
18168
18660
|
|
|
18169
|
-
if (event[keyName] && _downKeys.indexOf(keyNum) === -1) {
|
|
18170
|
-
_downKeys.push(keyNum);
|
|
18171
|
-
} else if (!event[keyName] && _downKeys.indexOf(keyNum) > -1) {
|
|
18172
|
-
_downKeys.splice(_downKeys.indexOf(keyNum), 1);
|
|
18173
|
-
} else if (keyName === 'metaKey' && event[keyName] && _downKeys.length === 3) {
|
|
18174
18661
|
/**
|
|
18175
|
-
*
|
|
18176
|
-
*
|
|
18662
|
+
* binds a single keyboard combination
|
|
18663
|
+
*
|
|
18664
|
+
* @param {string} combination
|
|
18665
|
+
* @param {Function} callback
|
|
18666
|
+
* @param {string=} action
|
|
18667
|
+
* @param {string=} sequenceName - name of sequence if part of sequence
|
|
18668
|
+
* @param {number=} level - what part of the sequence the command is
|
|
18669
|
+
* @returns void
|
|
18177
18670
|
*/
|
|
18178
|
-
|
|
18179
|
-
|
|
18671
|
+
function _bindSingle(combination, callback, action, sequenceName, level) {
|
|
18672
|
+
// store a direct mapped reference for use with Mousetrap.trigger
|
|
18673
|
+
self._directMap[combination + ':' + action] = callback;
|
|
18674
|
+
|
|
18675
|
+
// make sure multiple spaces in a row become a single space
|
|
18676
|
+
combination = combination.replace(/\s+/g, ' ');
|
|
18677
|
+
var sequence = combination.split(' ');
|
|
18678
|
+
var info;
|
|
18679
|
+
|
|
18680
|
+
// if this pattern is a sequence of keys then run through this method
|
|
18681
|
+
// to reprocess each pattern one key at a time
|
|
18682
|
+
if (sequence.length > 1) {
|
|
18683
|
+
_bindSequence(combination, sequence, callback, action);
|
|
18684
|
+
return;
|
|
18685
|
+
}
|
|
18686
|
+
info = _getKeyInfo(combination, action);
|
|
18687
|
+
|
|
18688
|
+
// make sure to initialize array if this is the first time
|
|
18689
|
+
// a callback is added for this key
|
|
18690
|
+
self._callbacks[info.key] = self._callbacks[info.key] || [];
|
|
18691
|
+
|
|
18692
|
+
// remove an existing match if there is one
|
|
18693
|
+
_getMatches(info.key, info.modifiers, {
|
|
18694
|
+
type: info.action
|
|
18695
|
+
}, sequenceName, combination, level);
|
|
18696
|
+
|
|
18697
|
+
// add this call back to the array
|
|
18698
|
+
// if it is a sequence put it at the beginning
|
|
18699
|
+
// if not put it at the end
|
|
18700
|
+
//
|
|
18701
|
+
// this is important because the way these are processed expects
|
|
18702
|
+
// the sequence ones to come first
|
|
18703
|
+
self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({
|
|
18704
|
+
callback: callback,
|
|
18705
|
+
modifiers: info.modifiers,
|
|
18706
|
+
action: info.action,
|
|
18707
|
+
seq: sequenceName,
|
|
18708
|
+
level: level,
|
|
18709
|
+
combo: combination
|
|
18710
|
+
});
|
|
18180
18711
|
}
|
|
18181
|
-
}
|
|
18182
|
-
});
|
|
18183
|
-
/**
|
|
18184
|
-
* -------------------------------
|
|
18185
|
-
*/
|
|
18186
18712
|
|
|
18187
|
-
|
|
18188
|
-
|
|
18713
|
+
/**
|
|
18714
|
+
* binds multiple combinations to the same callback
|
|
18715
|
+
*
|
|
18716
|
+
* @param {Array} combinations
|
|
18717
|
+
* @param {Function} callback
|
|
18718
|
+
* @param {string|undefined} action
|
|
18719
|
+
* @returns void
|
|
18720
|
+
*/
|
|
18721
|
+
self._bindMultiple = function (combinations, callback, action) {
|
|
18722
|
+
for (var i = 0; i < combinations.length; ++i) {
|
|
18723
|
+
_bindSingle(combinations[i], callback, action);
|
|
18724
|
+
}
|
|
18725
|
+
};
|
|
18189
18726
|
|
|
18190
|
-
|
|
18191
|
-
|
|
18727
|
+
// start!
|
|
18728
|
+
_addEvent(targetElement, 'keypress', _handleKeyEvent);
|
|
18729
|
+
_addEvent(targetElement, 'keydown', _handleKeyEvent);
|
|
18730
|
+
_addEvent(targetElement, 'keyup', _handleKeyEvent);
|
|
18192
18731
|
}
|
|
18193
18732
|
|
|
18194
|
-
|
|
18195
|
-
|
|
18733
|
+
/**
|
|
18734
|
+
* binds an event to mousetrap
|
|
18735
|
+
*
|
|
18736
|
+
* can be a single key, a combination of keys separated with +,
|
|
18737
|
+
* an array of keys, or a sequence of keys separated by spaces
|
|
18738
|
+
*
|
|
18739
|
+
* be sure to list the modifier keys first to make sure that the
|
|
18740
|
+
* correct key ends up getting bound (the last key in the pattern)
|
|
18741
|
+
*
|
|
18742
|
+
* @param {string|Array} keys
|
|
18743
|
+
* @param {Function} callback
|
|
18744
|
+
* @param {string=} action - 'keypress', 'keydown', or 'keyup'
|
|
18745
|
+
* @returns void
|
|
18746
|
+
*/
|
|
18747
|
+
Mousetrap.prototype.bind = function (keys, callback, action) {
|
|
18748
|
+
var self = this;
|
|
18749
|
+
keys = keys instanceof Array ? keys : [keys];
|
|
18750
|
+
self._bindMultiple.call(self, keys, callback, action);
|
|
18751
|
+
return self;
|
|
18752
|
+
};
|
|
18196
18753
|
|
|
18754
|
+
/**
|
|
18755
|
+
* unbinds an event to mousetrap
|
|
18756
|
+
*
|
|
18757
|
+
* the unbinding sets the callback function of the specified key combo
|
|
18758
|
+
* to an empty function and deletes the corresponding key in the
|
|
18759
|
+
* _directMap dict.
|
|
18760
|
+
*
|
|
18761
|
+
* TODO: actually remove this from the _callbacks dictionary instead
|
|
18762
|
+
* of binding an empty function
|
|
18763
|
+
*
|
|
18764
|
+
* the keycombo+action has to be exactly the same as
|
|
18765
|
+
* it was defined in the bind method
|
|
18766
|
+
*
|
|
18767
|
+
* @param {string|Array} keys
|
|
18768
|
+
* @param {string} action
|
|
18769
|
+
* @returns void
|
|
18770
|
+
*/
|
|
18771
|
+
Mousetrap.prototype.unbind = function (keys, action) {
|
|
18772
|
+
var self = this;
|
|
18773
|
+
return self.bind.call(self, keys, function () {}, action);
|
|
18774
|
+
};
|
|
18197
18775
|
|
|
18198
|
-
|
|
18199
|
-
|
|
18200
|
-
|
|
18201
|
-
|
|
18202
|
-
|
|
18203
|
-
|
|
18204
|
-
|
|
18205
|
-
|
|
18206
|
-
|
|
18207
|
-
|
|
18208
|
-
|
|
18776
|
+
/**
|
|
18777
|
+
* triggers an event that has already been bound
|
|
18778
|
+
*
|
|
18779
|
+
* @param {string} keys
|
|
18780
|
+
* @param {string=} action
|
|
18781
|
+
* @returns void
|
|
18782
|
+
*/
|
|
18783
|
+
Mousetrap.prototype.trigger = function (keys, action) {
|
|
18784
|
+
var self = this;
|
|
18785
|
+
if (self._directMap[keys + ':' + action]) {
|
|
18786
|
+
self._directMap[keys + ':' + action]({}, keys);
|
|
18787
|
+
}
|
|
18788
|
+
return self;
|
|
18789
|
+
};
|
|
18790
|
+
|
|
18791
|
+
/**
|
|
18792
|
+
* resets the library back to its initial state. this is useful
|
|
18793
|
+
* if you want to clear out the current keyboard shortcuts and bind
|
|
18794
|
+
* new ones - for example if you switch to another page
|
|
18795
|
+
*
|
|
18796
|
+
* @returns void
|
|
18797
|
+
*/
|
|
18798
|
+
Mousetrap.prototype.reset = function () {
|
|
18799
|
+
var self = this;
|
|
18800
|
+
self._callbacks = {};
|
|
18801
|
+
self._directMap = {};
|
|
18802
|
+
return self;
|
|
18803
|
+
};
|
|
18804
|
+
|
|
18805
|
+
/**
|
|
18806
|
+
* should we stop this event before firing off callbacks
|
|
18807
|
+
*
|
|
18808
|
+
* @param {Event} e
|
|
18809
|
+
* @param {Element} element
|
|
18810
|
+
* @return {boolean}
|
|
18811
|
+
*/
|
|
18812
|
+
Mousetrap.prototype.stopCallback = function (e, element) {
|
|
18813
|
+
var self = this;
|
|
18814
|
+
|
|
18815
|
+
// if the element has the class "mousetrap" then no need to stop
|
|
18816
|
+
if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
|
|
18817
|
+
return false;
|
|
18818
|
+
}
|
|
18819
|
+
if (_belongsTo(element, self.target)) {
|
|
18820
|
+
return false;
|
|
18821
|
+
}
|
|
18822
|
+
|
|
18823
|
+
// Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,
|
|
18824
|
+
// not the initial event target in the shadow tree. Note that not all events cross the
|
|
18825
|
+
// shadow boundary.
|
|
18826
|
+
// For shadow trees with `mode: 'open'`, the initial event target is the first element in
|
|
18827
|
+
// the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event
|
|
18828
|
+
// target cannot be obtained.
|
|
18829
|
+
if ('composedPath' in e && typeof e.composedPath === 'function') {
|
|
18830
|
+
// For open shadow trees, update `element` so that the following check works.
|
|
18831
|
+
var initialEventTarget = e.composedPath()[0];
|
|
18832
|
+
if (initialEventTarget !== e.target) {
|
|
18833
|
+
element = initialEventTarget;
|
|
18834
|
+
}
|
|
18835
|
+
}
|
|
18836
|
+
|
|
18837
|
+
// stop for input, select, and textarea
|
|
18838
|
+
return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;
|
|
18839
|
+
};
|
|
18840
|
+
|
|
18841
|
+
/**
|
|
18842
|
+
* exposes _handleKey publicly so it can be overwritten by extensions
|
|
18843
|
+
*/
|
|
18844
|
+
Mousetrap.prototype.handleKey = function () {
|
|
18845
|
+
var self = this;
|
|
18846
|
+
return self._handleKey.apply(self, arguments);
|
|
18847
|
+
};
|
|
18209
18848
|
|
|
18849
|
+
/**
|
|
18850
|
+
* allow custom key mappings
|
|
18851
|
+
*/
|
|
18852
|
+
Mousetrap.addKeycodes = function (object) {
|
|
18853
|
+
for (var key in object) {
|
|
18854
|
+
if (object.hasOwnProperty(key)) {
|
|
18855
|
+
_MAP[key] = object[key];
|
|
18856
|
+
}
|
|
18857
|
+
}
|
|
18858
|
+
_REVERSE_MAP = null;
|
|
18859
|
+
};
|
|
18210
18860
|
|
|
18211
|
-
|
|
18212
|
-
|
|
18213
|
-
|
|
18861
|
+
/**
|
|
18862
|
+
* Init the global mousetrap functions
|
|
18863
|
+
*
|
|
18864
|
+
* This method is needed to allow the global mousetrap functions to work
|
|
18865
|
+
* now that mousetrap is a constructor function.
|
|
18866
|
+
*/
|
|
18867
|
+
Mousetrap.init = function () {
|
|
18868
|
+
var documentMousetrap = Mousetrap(document);
|
|
18869
|
+
for (var method in documentMousetrap) {
|
|
18870
|
+
if (method.charAt(0) !== '_') {
|
|
18871
|
+
Mousetrap[method] = function (method) {
|
|
18872
|
+
return function () {
|
|
18873
|
+
return documentMousetrap[method].apply(documentMousetrap, arguments);
|
|
18874
|
+
};
|
|
18875
|
+
}(method);
|
|
18876
|
+
}
|
|
18877
|
+
}
|
|
18878
|
+
};
|
|
18879
|
+
Mousetrap.init();
|
|
18880
|
+
|
|
18881
|
+
// expose mousetrap to the global object
|
|
18882
|
+
window.Mousetrap = Mousetrap;
|
|
18883
|
+
|
|
18884
|
+
// expose as a common js module
|
|
18885
|
+
if (module.exports) {
|
|
18886
|
+
module.exports = Mousetrap;
|
|
18214
18887
|
}
|
|
18215
18888
|
|
|
18216
|
-
|
|
18217
|
-
|
|
18889
|
+
// expose mousetrap as an AMD module
|
|
18890
|
+
if (typeof undefined$1 === 'function' && undefined$1.amd) {
|
|
18891
|
+
undefined$1(function () {
|
|
18892
|
+
return Mousetrap;
|
|
18893
|
+
});
|
|
18894
|
+
}
|
|
18895
|
+
})(typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);
|
|
18896
|
+
})(mousetrap);
|
|
18897
|
+
var mousetrapExports = mousetrap.exports;
|
|
18898
|
+
var Mousetrap$1 = /*@__PURE__*/getDefaultExportFromCjs(mousetrapExports);
|
|
18899
|
+
|
|
18900
|
+
/**
|
|
18901
|
+
* adds a bindGlobal method to Mousetrap that allows you to
|
|
18902
|
+
* bind specific keyboard shortcuts that will still work
|
|
18903
|
+
* inside a text input field
|
|
18904
|
+
*
|
|
18905
|
+
* usage:
|
|
18906
|
+
* Mousetrap.bindGlobal('ctrl+s', _saveChanges);
|
|
18907
|
+
*/
|
|
18908
|
+
/* global Mousetrap:true */
|
|
18909
|
+
(function (Mousetrap) {
|
|
18910
|
+
var _globalCallbacks = {};
|
|
18911
|
+
var _originalStopCallback = Mousetrap.prototype.stopCallback;
|
|
18912
|
+
Mousetrap.prototype.stopCallback = function (e, element, combo, sequence) {
|
|
18913
|
+
var self = this;
|
|
18914
|
+
if (self.paused) {
|
|
18915
|
+
return true;
|
|
18916
|
+
}
|
|
18917
|
+
if (_globalCallbacks[combo] || _globalCallbacks[sequence]) {
|
|
18918
|
+
return false;
|
|
18919
|
+
}
|
|
18920
|
+
return _originalStopCallback.call(self, e, element, combo);
|
|
18921
|
+
};
|
|
18922
|
+
Mousetrap.prototype.bindGlobal = function (keys, callback, action) {
|
|
18923
|
+
var self = this;
|
|
18924
|
+
self.bind(keys, callback, action);
|
|
18925
|
+
if (keys instanceof Array) {
|
|
18926
|
+
for (var i = 0; i < keys.length; i++) {
|
|
18927
|
+
_globalCallbacks[keys[i]] = true;
|
|
18928
|
+
}
|
|
18929
|
+
return;
|
|
18930
|
+
}
|
|
18931
|
+
_globalCallbacks[keys] = true;
|
|
18932
|
+
};
|
|
18933
|
+
Mousetrap.prototype.unbindGlobal = function (keys, action) {
|
|
18934
|
+
var self = this;
|
|
18935
|
+
self.unbind(keys, action);
|
|
18936
|
+
if (keys instanceof Array) {
|
|
18937
|
+
for (var i = 0; i < keys.length; i++) {
|
|
18938
|
+
_globalCallbacks[keys[i]] = false;
|
|
18939
|
+
}
|
|
18940
|
+
return;
|
|
18218
18941
|
}
|
|
18942
|
+
_globalCallbacks[keys] = false;
|
|
18943
|
+
};
|
|
18944
|
+
Mousetrap.init();
|
|
18945
|
+
})(Mousetrap);
|
|
18219
18946
|
|
|
18220
|
-
|
|
18221
|
-
|
|
18222
|
-
} // 获取范围 默认为 `all`
|
|
18947
|
+
function _typeof$6(o) {
|
|
18948
|
+
"@babel/helpers - typeof";
|
|
18223
18949
|
|
|
18950
|
+
return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
18951
|
+
return typeof o;
|
|
18952
|
+
} : function (o) {
|
|
18953
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
18954
|
+
}, _typeof$6(o);
|
|
18955
|
+
}
|
|
18224
18956
|
|
|
18225
|
-
|
|
18957
|
+
var platform$1 = {exports: {}};
|
|
18226
18958
|
|
|
18227
|
-
|
|
18228
|
-
|
|
18229
|
-
|
|
18230
|
-
|
|
18231
|
-
|
|
18959
|
+
platform$1.exports;
|
|
18960
|
+
(function (module, exports) {
|
|
18961
|
+
(function () {
|
|
18962
|
+
|
|
18963
|
+
/** Used to determine if values are of the language type `Object`. */
|
|
18964
|
+
var objectTypes = {
|
|
18965
|
+
'function': true,
|
|
18966
|
+
'object': true
|
|
18967
|
+
};
|
|
18968
|
+
|
|
18969
|
+
/** Used as a reference to the global object. */
|
|
18970
|
+
var root = objectTypes[typeof window === "undefined" ? "undefined" : _typeof$6(window)] && window || this;
|
|
18971
|
+
|
|
18972
|
+
/** Detect free variable `exports`. */
|
|
18973
|
+
var freeExports = exports;
|
|
18974
|
+
|
|
18975
|
+
/** Detect free variable `module`. */
|
|
18976
|
+
var freeModule = module && !module.nodeType && module;
|
|
18977
|
+
|
|
18978
|
+
/** Detect free variable `global` from Node.js or Browserified code and use it as `root`. */
|
|
18979
|
+
var freeGlobal = freeExports && freeModule && _typeof$6(commonjsGlobal) == 'object' && commonjsGlobal;
|
|
18980
|
+
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {
|
|
18981
|
+
root = freeGlobal;
|
|
18232
18982
|
}
|
|
18233
|
-
} // key 不在 _handlers 中返回
|
|
18234
18983
|
|
|
18984
|
+
/**
|
|
18985
|
+
* Used as the maximum length of an array-like object.
|
|
18986
|
+
* See the [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength)
|
|
18987
|
+
* for more details.
|
|
18988
|
+
*/
|
|
18989
|
+
var maxSafeInteger = Math.pow(2, 53) - 1;
|
|
18990
|
+
|
|
18991
|
+
/** Regular expression to detect Opera. */
|
|
18992
|
+
var reOpera = /\bOpera/;
|
|
18993
|
+
|
|
18994
|
+
/** Used for native method references. */
|
|
18995
|
+
var objectProto = Object.prototype;
|
|
18996
|
+
|
|
18997
|
+
/** Used to check for own properties of an object. */
|
|
18998
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
18999
|
+
|
|
19000
|
+
/** Used to resolve the internal `[[Class]]` of values. */
|
|
19001
|
+
var toString = objectProto.toString;
|
|
19002
|
+
|
|
19003
|
+
/*--------------------------------------------------------------------------*/
|
|
18235
19004
|
|
|
18236
|
-
|
|
19005
|
+
/**
|
|
19006
|
+
* Capitalizes a string value.
|
|
19007
|
+
*
|
|
19008
|
+
* @private
|
|
19009
|
+
* @param {string} string The string to capitalize.
|
|
19010
|
+
* @returns {string} The capitalized string.
|
|
19011
|
+
*/
|
|
19012
|
+
function capitalize(string) {
|
|
19013
|
+
string = String(string);
|
|
19014
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
19015
|
+
}
|
|
18237
19016
|
|
|
18238
|
-
|
|
18239
|
-
|
|
18240
|
-
|
|
18241
|
-
|
|
18242
|
-
|
|
18243
|
-
|
|
18244
|
-
|
|
19017
|
+
/**
|
|
19018
|
+
* A utility function to clean up the OS name.
|
|
19019
|
+
*
|
|
19020
|
+
* @private
|
|
19021
|
+
* @param {string} os The OS name to clean up.
|
|
19022
|
+
* @param {string} [pattern] A `RegExp` pattern matching the OS name.
|
|
19023
|
+
* @param {string} [label] A label for the OS.
|
|
19024
|
+
*/
|
|
19025
|
+
function cleanupOS(os, pattern, label) {
|
|
19026
|
+
// Platform tokens are defined at:
|
|
19027
|
+
// http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
|
|
19028
|
+
// http://web.archive.org/web/20081122053950/http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
|
|
19029
|
+
var data = {
|
|
19030
|
+
'10.0': '10',
|
|
19031
|
+
'6.4': '10 Technical Preview',
|
|
19032
|
+
'6.3': '8.1',
|
|
19033
|
+
'6.2': '8',
|
|
19034
|
+
'6.1': 'Server 2008 R2 / 7',
|
|
19035
|
+
'6.0': 'Server 2008 / Vista',
|
|
19036
|
+
'5.2': 'Server 2003 / XP 64-bit',
|
|
19037
|
+
'5.1': 'XP',
|
|
19038
|
+
'5.01': '2000 SP1',
|
|
19039
|
+
'5.0': '2000',
|
|
19040
|
+
'4.0': 'NT',
|
|
19041
|
+
'4.90': 'ME'
|
|
19042
|
+
};
|
|
19043
|
+
// Detect Windows version from platform tokens.
|
|
19044
|
+
if (pattern && label && /^Win/i.test(os) && !/^Windows Phone /i.test(os) && (data = data[/[\d.]+$/.exec(os)])) {
|
|
19045
|
+
os = 'Windows ' + data;
|
|
19046
|
+
}
|
|
19047
|
+
// Correct character case and cleanup string.
|
|
19048
|
+
os = String(os);
|
|
19049
|
+
if (pattern && label) {
|
|
19050
|
+
os = os.replace(RegExp(pattern, 'i'), label);
|
|
19051
|
+
}
|
|
19052
|
+
os = format(os.replace(/ ce$/i, ' CE').replace(/\bhpw/i, 'web').replace(/\bMacintosh\b/, 'Mac OS').replace(/_PowerPC\b/i, ' OS').replace(/\b(OS X) [^ \d]+/i, '$1').replace(/\bMac (OS X)\b/, '$1').replace(/\/(\d)/, ' $1').replace(/_/g, '.').replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, '').replace(/\bx86\.64\b/gi, 'x86_64').replace(/\b(Windows Phone) OS\b/, '$1').replace(/\b(Chrome OS \w+) [\d.]+\b/, '$1').split(' on ')[0]);
|
|
19053
|
+
return os;
|
|
19054
|
+
}
|
|
18245
19055
|
|
|
18246
|
-
|
|
18247
|
-
|
|
19056
|
+
/**
|
|
19057
|
+
* An iteration utility for arrays and objects.
|
|
19058
|
+
*
|
|
19059
|
+
* @private
|
|
19060
|
+
* @param {Array|Object} object The object to iterate over.
|
|
19061
|
+
* @param {Function} callback The function called per iteration.
|
|
19062
|
+
*/
|
|
19063
|
+
function each(object, callback) {
|
|
19064
|
+
var index = -1,
|
|
19065
|
+
length = object ? object.length : 0;
|
|
19066
|
+
if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
|
|
19067
|
+
while (++index < length) {
|
|
19068
|
+
callback(object[index], index, object);
|
|
18248
19069
|
}
|
|
19070
|
+
} else {
|
|
19071
|
+
forOwn(object, callback);
|
|
19072
|
+
}
|
|
19073
|
+
}
|
|
18249
19074
|
|
|
18250
|
-
|
|
18251
|
-
|
|
18252
|
-
|
|
19075
|
+
/**
|
|
19076
|
+
* Trim and conditionally capitalize string values.
|
|
19077
|
+
*
|
|
19078
|
+
* @private
|
|
19079
|
+
* @param {string} string The string to format.
|
|
19080
|
+
* @returns {string} The formatted string.
|
|
19081
|
+
*/
|
|
19082
|
+
function format(string) {
|
|
19083
|
+
string = trim(string);
|
|
19084
|
+
return /^(?:webOS|i(?:OS|P))/.test(string) ? string : capitalize(string);
|
|
19085
|
+
}
|
|
19086
|
+
|
|
19087
|
+
/**
|
|
19088
|
+
* Iterates over an object's own properties, executing the `callback` for each.
|
|
19089
|
+
*
|
|
19090
|
+
* @private
|
|
19091
|
+
* @param {Object} object The object to iterate over.
|
|
19092
|
+
* @param {Function} callback The function executed per own property.
|
|
19093
|
+
*/
|
|
19094
|
+
function forOwn(object, callback) {
|
|
19095
|
+
for (var key in object) {
|
|
19096
|
+
if (hasOwnProperty.call(object, key)) {
|
|
19097
|
+
callback(object[key], key, object);
|
|
18253
19098
|
}
|
|
18254
19099
|
}
|
|
18255
19100
|
}
|
|
18256
|
-
}
|
|
18257
|
-
} // 判断 element 是否已经绑定事件
|
|
18258
19101
|
|
|
19102
|
+
/**
|
|
19103
|
+
* Gets the internal `[[Class]]` of a value.
|
|
19104
|
+
*
|
|
19105
|
+
* @private
|
|
19106
|
+
* @param {*} value The value.
|
|
19107
|
+
* @returns {string} The `[[Class]]`.
|
|
19108
|
+
*/
|
|
19109
|
+
function getClassOf(value) {
|
|
19110
|
+
return value == null ? capitalize(value) : toString.call(value).slice(8, -1);
|
|
19111
|
+
}
|
|
19112
|
+
|
|
19113
|
+
/**
|
|
19114
|
+
* Host objects can return type values that are different from their actual
|
|
19115
|
+
* data type. The objects we are concerned with usually return non-primitive
|
|
19116
|
+
* types of "object", "function", or "unknown".
|
|
19117
|
+
*
|
|
19118
|
+
* @private
|
|
19119
|
+
* @param {*} object The owner of the property.
|
|
19120
|
+
* @param {string} property The property to check.
|
|
19121
|
+
* @returns {boolean} Returns `true` if the property value is a non-primitive, else `false`.
|
|
19122
|
+
*/
|
|
19123
|
+
function isHostType(object, property) {
|
|
19124
|
+
var type = object != null ? _typeof$6(object[property]) : 'number';
|
|
19125
|
+
return !/^(?:boolean|number|string|undefined)$/.test(type) && (type == 'object' ? !!object[property] : true);
|
|
19126
|
+
}
|
|
18259
19127
|
|
|
18260
|
-
|
|
18261
|
-
|
|
18262
|
-
|
|
19128
|
+
/**
|
|
19129
|
+
* Prepares a string for use in a `RegExp` by making hyphens and spaces optional.
|
|
19130
|
+
*
|
|
19131
|
+
* @private
|
|
19132
|
+
* @param {string} string The string to qualify.
|
|
19133
|
+
* @returns {string} The qualified string.
|
|
19134
|
+
*/
|
|
19135
|
+
function qualify(string) {
|
|
19136
|
+
return String(string).replace(/([ -])(?!$)/g, '$1?');
|
|
19137
|
+
}
|
|
18263
19138
|
|
|
18264
|
-
|
|
18265
|
-
|
|
18266
|
-
|
|
19139
|
+
/**
|
|
19140
|
+
* A bare-bones `Array#reduce` like utility function.
|
|
19141
|
+
*
|
|
19142
|
+
* @private
|
|
19143
|
+
* @param {Array} array The array to iterate over.
|
|
19144
|
+
* @param {Function} callback The function called per iteration.
|
|
19145
|
+
* @returns {*} The accumulated result.
|
|
19146
|
+
*/
|
|
19147
|
+
function reduce(array, callback) {
|
|
19148
|
+
var accumulator = null;
|
|
19149
|
+
each(array, function (value, index) {
|
|
19150
|
+
accumulator = callback(accumulator, value, index, array);
|
|
19151
|
+
});
|
|
19152
|
+
return accumulator;
|
|
19153
|
+
}
|
|
18267
19154
|
|
|
18268
|
-
|
|
18269
|
-
|
|
19155
|
+
/**
|
|
19156
|
+
* Removes leading and trailing whitespace from a string.
|
|
19157
|
+
*
|
|
19158
|
+
* @private
|
|
19159
|
+
* @param {string} string The string to trim.
|
|
19160
|
+
* @returns {string} The trimmed string.
|
|
19161
|
+
*/
|
|
19162
|
+
function trim(string) {
|
|
19163
|
+
return String(string).replace(/^ +| +$/g, '');
|
|
19164
|
+
}
|
|
18270
19165
|
|
|
18271
|
-
|
|
19166
|
+
/*--------------------------------------------------------------------------*/
|
|
18272
19167
|
|
|
18273
|
-
|
|
18274
|
-
|
|
18275
|
-
|
|
18276
|
-
|
|
19168
|
+
/**
|
|
19169
|
+
* Creates a new platform object.
|
|
19170
|
+
*
|
|
19171
|
+
* @memberOf platform
|
|
19172
|
+
* @param {Object|string} [ua=navigator.userAgent] The user agent string or
|
|
19173
|
+
* context object.
|
|
19174
|
+
* @returns {Object} A platform object.
|
|
19175
|
+
*/
|
|
19176
|
+
function parse(ua) {
|
|
19177
|
+
/** The environment context object. */
|
|
19178
|
+
var context = root;
|
|
18277
19179
|
|
|
18278
|
-
|
|
18279
|
-
|
|
18280
|
-
}
|
|
19180
|
+
/** Used to flag when a custom context is provided. */
|
|
19181
|
+
var isCustomContext = ua && _typeof$6(ua) == 'object' && getClassOf(ua) != 'String';
|
|
18281
19182
|
|
|
18282
|
-
|
|
18283
|
-
|
|
19183
|
+
// Juggle arguments.
|
|
19184
|
+
if (isCustomContext) {
|
|
19185
|
+
context = ua;
|
|
19186
|
+
ua = null;
|
|
19187
|
+
}
|
|
18284
19188
|
|
|
18285
|
-
|
|
19189
|
+
/** Browser navigator object. */
|
|
19190
|
+
var nav = context.navigator || {};
|
|
18286
19191
|
|
|
18287
|
-
|
|
19192
|
+
/** Browser user agent string. */
|
|
19193
|
+
var userAgent = nav.userAgent || '';
|
|
19194
|
+
ua || (ua = userAgent);
|
|
18288
19195
|
|
|
18289
|
-
|
|
19196
|
+
/** Used to detect if browser is like Chrome. */
|
|
19197
|
+
var likeChrome = isCustomContext ? !!nav.likeChrome : /\bChrome\b/.test(ua) && !/internal|\n/i.test(toString.toString());
|
|
18290
19198
|
|
|
18291
|
-
|
|
18292
|
-
|
|
19199
|
+
/** Internal `[[Class]]` value shortcuts. */
|
|
19200
|
+
var objectClass = 'Object',
|
|
19201
|
+
airRuntimeClass = isCustomContext ? objectClass : 'ScriptBridgingProxyObject',
|
|
19202
|
+
enviroClass = isCustomContext ? objectClass : 'Environment',
|
|
19203
|
+
javaClass = isCustomContext && context.java ? 'JavaPackage' : getClassOf(context.java),
|
|
19204
|
+
phantomClass = isCustomContext ? objectClass : 'RuntimeObject';
|
|
18293
19205
|
|
|
18294
|
-
|
|
19206
|
+
/** Detect Java environments. */
|
|
19207
|
+
var java = /\bJava/.test(javaClass) && context.java;
|
|
18295
19208
|
|
|
18296
|
-
|
|
18297
|
-
|
|
19209
|
+
/** Detect Rhino. */
|
|
19210
|
+
var rhino = java && getClassOf(context.environment) == enviroClass;
|
|
18298
19211
|
|
|
18299
|
-
|
|
19212
|
+
/** A character to represent alpha. */
|
|
19213
|
+
var alpha = java ? 'a' : "\u03B1";
|
|
18300
19214
|
|
|
18301
|
-
|
|
19215
|
+
/** A character to represent beta. */
|
|
19216
|
+
var beta = java ? 'b' : "\u03B2";
|
|
18302
19217
|
|
|
18303
|
-
|
|
18304
|
-
|
|
18305
|
-
// 判断key是否在_handlers中,不在就赋一个空数组
|
|
19218
|
+
/** Browser document object. */
|
|
19219
|
+
var doc = context.document || {};
|
|
18306
19220
|
|
|
18307
|
-
|
|
19221
|
+
/**
|
|
19222
|
+
* Detect Opera browser (Presto-based).
|
|
19223
|
+
* http://www.howtocreate.co.uk/operaStuff/operaObject.html
|
|
19224
|
+
* http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#operamini
|
|
19225
|
+
*/
|
|
19226
|
+
var opera = context.operamini || context.opera;
|
|
19227
|
+
|
|
19228
|
+
/** Opera `[[Class]]`. */
|
|
19229
|
+
var operaClass = reOpera.test(operaClass = isCustomContext && opera ? opera['[[Class]]'] : getClassOf(opera)) ? operaClass : opera = null;
|
|
19230
|
+
|
|
19231
|
+
/*------------------------------------------------------------------------*/
|
|
19232
|
+
|
|
19233
|
+
/** Temporary variable used over the script's lifetime. */
|
|
19234
|
+
var data;
|
|
19235
|
+
|
|
19236
|
+
/** The CPU architecture. */
|
|
19237
|
+
var arch = ua;
|
|
19238
|
+
|
|
19239
|
+
/** Platform description array. */
|
|
19240
|
+
var description = [];
|
|
19241
|
+
|
|
19242
|
+
/** Platform alpha/beta indicator. */
|
|
19243
|
+
var prerelease = null;
|
|
19244
|
+
|
|
19245
|
+
/** A flag to indicate that environment features should be used to resolve the platform. */
|
|
19246
|
+
var useFeatures = ua == userAgent;
|
|
19247
|
+
|
|
19248
|
+
/** The browser/environment version. */
|
|
19249
|
+
var version = useFeatures && opera && typeof opera.version == 'function' && opera.version();
|
|
19250
|
+
|
|
19251
|
+
/** A flag to indicate if the OS ends with "/ Version" */
|
|
19252
|
+
var isSpecialCasedOS;
|
|
19253
|
+
|
|
19254
|
+
/* Detectable layout engines (order is important). */
|
|
19255
|
+
var layout = getLayout([{
|
|
19256
|
+
'label': 'EdgeHTML',
|
|
19257
|
+
'pattern': 'Edge'
|
|
19258
|
+
}, 'Trident', {
|
|
19259
|
+
'label': 'WebKit',
|
|
19260
|
+
'pattern': 'AppleWebKit'
|
|
19261
|
+
}, 'iCab', 'Presto', 'NetFront', 'Tasman', 'KHTML', 'Gecko']);
|
|
19262
|
+
|
|
19263
|
+
/* Detectable browser names (order is important). */
|
|
19264
|
+
var name = getName(['Adobe AIR', 'Arora', 'Avant Browser', 'Breach', 'Camino', 'Electron', 'Epiphany', 'Fennec', 'Flock', 'Galeon', 'GreenBrowser', 'iCab', 'Iceweasel', 'K-Meleon', 'Konqueror', 'Lunascape', 'Maxthon', {
|
|
19265
|
+
'label': 'Microsoft Edge',
|
|
19266
|
+
'pattern': '(?:Edge|Edg|EdgA|EdgiOS)'
|
|
19267
|
+
}, 'Midori', 'Nook Browser', 'PaleMoon', 'PhantomJS', 'Raven', 'Rekonq', 'RockMelt', {
|
|
19268
|
+
'label': 'Samsung Internet',
|
|
19269
|
+
'pattern': 'SamsungBrowser'
|
|
19270
|
+
}, 'SeaMonkey', {
|
|
19271
|
+
'label': 'Silk',
|
|
19272
|
+
'pattern': '(?:Cloud9|Silk-Accelerated)'
|
|
19273
|
+
}, 'Sleipnir', 'SlimBrowser', {
|
|
19274
|
+
'label': 'SRWare Iron',
|
|
19275
|
+
'pattern': 'Iron'
|
|
19276
|
+
}, 'Sunrise', 'Swiftfox', 'Vivaldi', 'Waterfox', 'WebPositive', {
|
|
19277
|
+
'label': 'Yandex Browser',
|
|
19278
|
+
'pattern': 'YaBrowser'
|
|
19279
|
+
}, {
|
|
19280
|
+
'label': 'UC Browser',
|
|
19281
|
+
'pattern': 'UCBrowser'
|
|
19282
|
+
}, 'Opera Mini', {
|
|
19283
|
+
'label': 'Opera Mini',
|
|
19284
|
+
'pattern': 'OPiOS'
|
|
19285
|
+
}, 'Opera', {
|
|
19286
|
+
'label': 'Opera',
|
|
19287
|
+
'pattern': 'OPR'
|
|
19288
|
+
}, 'Chromium', 'Chrome', {
|
|
19289
|
+
'label': 'Chrome',
|
|
19290
|
+
'pattern': '(?:HeadlessChrome)'
|
|
19291
|
+
}, {
|
|
19292
|
+
'label': 'Chrome Mobile',
|
|
19293
|
+
'pattern': '(?:CriOS|CrMo)'
|
|
19294
|
+
}, {
|
|
19295
|
+
'label': 'Firefox',
|
|
19296
|
+
'pattern': '(?:Firefox|Minefield)'
|
|
19297
|
+
}, {
|
|
19298
|
+
'label': 'Firefox for iOS',
|
|
19299
|
+
'pattern': 'FxiOS'
|
|
19300
|
+
}, {
|
|
19301
|
+
'label': 'IE',
|
|
19302
|
+
'pattern': 'IEMobile'
|
|
19303
|
+
}, {
|
|
19304
|
+
'label': 'IE',
|
|
19305
|
+
'pattern': 'MSIE'
|
|
19306
|
+
}, 'Safari']);
|
|
19307
|
+
|
|
19308
|
+
/* Detectable products (order is important). */
|
|
19309
|
+
var product = getProduct([{
|
|
19310
|
+
'label': 'BlackBerry',
|
|
19311
|
+
'pattern': 'BB10'
|
|
19312
|
+
}, 'BlackBerry', {
|
|
19313
|
+
'label': 'Galaxy S',
|
|
19314
|
+
'pattern': 'GT-I9000'
|
|
19315
|
+
}, {
|
|
19316
|
+
'label': 'Galaxy S2',
|
|
19317
|
+
'pattern': 'GT-I9100'
|
|
19318
|
+
}, {
|
|
19319
|
+
'label': 'Galaxy S3',
|
|
19320
|
+
'pattern': 'GT-I9300'
|
|
19321
|
+
}, {
|
|
19322
|
+
'label': 'Galaxy S4',
|
|
19323
|
+
'pattern': 'GT-I9500'
|
|
19324
|
+
}, {
|
|
19325
|
+
'label': 'Galaxy S5',
|
|
19326
|
+
'pattern': 'SM-G900'
|
|
19327
|
+
}, {
|
|
19328
|
+
'label': 'Galaxy S6',
|
|
19329
|
+
'pattern': 'SM-G920'
|
|
19330
|
+
}, {
|
|
19331
|
+
'label': 'Galaxy S6 Edge',
|
|
19332
|
+
'pattern': 'SM-G925'
|
|
19333
|
+
}, {
|
|
19334
|
+
'label': 'Galaxy S7',
|
|
19335
|
+
'pattern': 'SM-G930'
|
|
19336
|
+
}, {
|
|
19337
|
+
'label': 'Galaxy S7 Edge',
|
|
19338
|
+
'pattern': 'SM-G935'
|
|
19339
|
+
}, 'Google TV', 'Lumia', 'iPad', 'iPod', 'iPhone', 'Kindle', {
|
|
19340
|
+
'label': 'Kindle Fire',
|
|
19341
|
+
'pattern': '(?:Cloud9|Silk-Accelerated)'
|
|
19342
|
+
}, 'Nexus', 'Nook', 'PlayBook', 'PlayStation Vita', 'PlayStation', 'TouchPad', 'Transformer', {
|
|
19343
|
+
'label': 'Wii U',
|
|
19344
|
+
'pattern': 'WiiU'
|
|
19345
|
+
}, 'Wii', 'Xbox One', {
|
|
19346
|
+
'label': 'Xbox 360',
|
|
19347
|
+
'pattern': 'Xbox'
|
|
19348
|
+
}, 'Xoom']);
|
|
19349
|
+
|
|
19350
|
+
/* Detectable manufacturers. */
|
|
19351
|
+
var manufacturer = getManufacturer({
|
|
19352
|
+
'Apple': {
|
|
19353
|
+
'iPad': 1,
|
|
19354
|
+
'iPhone': 1,
|
|
19355
|
+
'iPod': 1
|
|
19356
|
+
},
|
|
19357
|
+
'Alcatel': {},
|
|
19358
|
+
'Archos': {},
|
|
19359
|
+
'Amazon': {
|
|
19360
|
+
'Kindle': 1,
|
|
19361
|
+
'Kindle Fire': 1
|
|
19362
|
+
},
|
|
19363
|
+
'Asus': {
|
|
19364
|
+
'Transformer': 1
|
|
19365
|
+
},
|
|
19366
|
+
'Barnes & Noble': {
|
|
19367
|
+
'Nook': 1
|
|
19368
|
+
},
|
|
19369
|
+
'BlackBerry': {
|
|
19370
|
+
'PlayBook': 1
|
|
19371
|
+
},
|
|
19372
|
+
'Google': {
|
|
19373
|
+
'Google TV': 1,
|
|
19374
|
+
'Nexus': 1
|
|
19375
|
+
},
|
|
19376
|
+
'HP': {
|
|
19377
|
+
'TouchPad': 1
|
|
19378
|
+
},
|
|
19379
|
+
'HTC': {},
|
|
19380
|
+
'Huawei': {},
|
|
19381
|
+
'Lenovo': {},
|
|
19382
|
+
'LG': {},
|
|
19383
|
+
'Microsoft': {
|
|
19384
|
+
'Xbox': 1,
|
|
19385
|
+
'Xbox One': 1
|
|
19386
|
+
},
|
|
19387
|
+
'Motorola': {
|
|
19388
|
+
'Xoom': 1
|
|
19389
|
+
},
|
|
19390
|
+
'Nintendo': {
|
|
19391
|
+
'Wii U': 1,
|
|
19392
|
+
'Wii': 1
|
|
19393
|
+
},
|
|
19394
|
+
'Nokia': {
|
|
19395
|
+
'Lumia': 1
|
|
19396
|
+
},
|
|
19397
|
+
'Oppo': {},
|
|
19398
|
+
'Samsung': {
|
|
19399
|
+
'Galaxy S': 1,
|
|
19400
|
+
'Galaxy S2': 1,
|
|
19401
|
+
'Galaxy S3': 1,
|
|
19402
|
+
'Galaxy S4': 1
|
|
19403
|
+
},
|
|
19404
|
+
'Sony': {
|
|
19405
|
+
'PlayStation': 1,
|
|
19406
|
+
'PlayStation Vita': 1
|
|
19407
|
+
},
|
|
19408
|
+
'Xiaomi': {
|
|
19409
|
+
'Mi': 1,
|
|
19410
|
+
'Redmi': 1
|
|
19411
|
+
}
|
|
19412
|
+
});
|
|
18308
19413
|
|
|
18309
|
-
|
|
18310
|
-
|
|
18311
|
-
|
|
18312
|
-
|
|
18313
|
-
|
|
18314
|
-
|
|
18315
|
-
|
|
18316
|
-
|
|
18317
|
-
splitKey: splitKey
|
|
18318
|
-
});
|
|
18319
|
-
} // 在全局document上设置快捷键
|
|
19414
|
+
/* Detectable operating systems (order is important). */
|
|
19415
|
+
var os = getOS(['Windows Phone', 'KaiOS', 'Android', 'CentOS', {
|
|
19416
|
+
'label': 'Chrome OS',
|
|
19417
|
+
'pattern': 'CrOS'
|
|
19418
|
+
}, 'Debian', {
|
|
19419
|
+
'label': 'DragonFly BSD',
|
|
19420
|
+
'pattern': 'DragonFly'
|
|
19421
|
+
}, 'Fedora', 'FreeBSD', 'Gentoo', 'Haiku', 'Kubuntu', 'Linux Mint', 'OpenBSD', 'Red Hat', 'SuSE', 'Ubuntu', 'Xubuntu', 'Cygwin', 'Symbian OS', 'hpwOS', 'webOS ', 'webOS', 'Tablet OS', 'Tizen', 'Linux', 'Mac OS X', 'Macintosh', 'Mac', 'Windows 98;', 'Windows ']);
|
|
18320
19422
|
|
|
19423
|
+
/*------------------------------------------------------------------------*/
|
|
18321
19424
|
|
|
18322
|
-
|
|
18323
|
-
|
|
18324
|
-
|
|
18325
|
-
|
|
18326
|
-
|
|
18327
|
-
|
|
18328
|
-
|
|
18329
|
-
|
|
18330
|
-
|
|
18331
|
-
|
|
18332
|
-
|
|
18333
|
-
|
|
18334
|
-
}
|
|
18335
|
-
}
|
|
19425
|
+
/**
|
|
19426
|
+
* Picks the layout engine from an array of guesses.
|
|
19427
|
+
*
|
|
19428
|
+
* @private
|
|
19429
|
+
* @param {Array} guesses An array of guesses.
|
|
19430
|
+
* @returns {null|string} The detected layout engine.
|
|
19431
|
+
*/
|
|
19432
|
+
function getLayout(guesses) {
|
|
19433
|
+
return reduce(guesses, function (result, guess) {
|
|
19434
|
+
return result || RegExp('\\b' + (guess.pattern || qualify(guess)) + '\\b', 'i').exec(ua) && (guess.label || guess);
|
|
19435
|
+
});
|
|
19436
|
+
}
|
|
18336
19437
|
|
|
18337
|
-
|
|
18338
|
-
|
|
18339
|
-
|
|
18340
|
-
|
|
18341
|
-
|
|
18342
|
-
|
|
18343
|
-
|
|
18344
|
-
|
|
18345
|
-
|
|
19438
|
+
/**
|
|
19439
|
+
* Picks the manufacturer from an array of guesses.
|
|
19440
|
+
*
|
|
19441
|
+
* @private
|
|
19442
|
+
* @param {Array} guesses An object of guesses.
|
|
19443
|
+
* @returns {null|string} The detected manufacturer.
|
|
19444
|
+
*/
|
|
19445
|
+
function getManufacturer(guesses) {
|
|
19446
|
+
return reduce(guesses, function (result, value, key) {
|
|
19447
|
+
// Lookup the manufacturer by product or scan the UA for the manufacturer.
|
|
19448
|
+
return result || (value[product] || value[/^[a-z]+(?: +[a-z]+\b)*/i.exec(product)] || RegExp('\\b' + qualify(key) + '(?:\\b|\\w*\\d)', 'i').exec(ua)) && key;
|
|
19449
|
+
});
|
|
19450
|
+
}
|
|
18346
19451
|
|
|
18347
|
-
|
|
18348
|
-
|
|
18349
|
-
|
|
18350
|
-
|
|
18351
|
-
}
|
|
19452
|
+
/**
|
|
19453
|
+
* Picks the browser name from an array of guesses.
|
|
19454
|
+
*
|
|
19455
|
+
* @private
|
|
19456
|
+
* @param {Array} guesses An array of guesses.
|
|
19457
|
+
* @returns {null|string} The detected browser name.
|
|
19458
|
+
*/
|
|
19459
|
+
function getName(guesses) {
|
|
19460
|
+
return reduce(guesses, function (result, guess) {
|
|
19461
|
+
return result || RegExp('\\b' + (guess.pattern || qualify(guess)) + '\\b', 'i').exec(ua) && (guess.label || guess);
|
|
19462
|
+
});
|
|
19463
|
+
}
|
|
18352
19464
|
|
|
18353
|
-
|
|
18354
|
-
|
|
19465
|
+
/**
|
|
19466
|
+
* Picks the OS name from an array of guesses.
|
|
19467
|
+
*
|
|
19468
|
+
* @private
|
|
19469
|
+
* @param {Array} guesses An array of guesses.
|
|
19470
|
+
* @returns {null|string} The detected OS name.
|
|
19471
|
+
*/
|
|
19472
|
+
function getOS(guesses) {
|
|
19473
|
+
return reduce(guesses, function (result, guess) {
|
|
19474
|
+
var pattern = guess.pattern || qualify(guess);
|
|
19475
|
+
if (!result && (result = RegExp('\\b' + pattern + '(?:/[\\d.]+|[ \\w.]*)', 'i').exec(ua))) {
|
|
19476
|
+
result = cleanupOS(result, pattern, guess.label || guess);
|
|
19477
|
+
}
|
|
19478
|
+
return result;
|
|
19479
|
+
});
|
|
19480
|
+
}
|
|
18355
19481
|
|
|
18356
|
-
|
|
18357
|
-
|
|
18358
|
-
|
|
18359
|
-
|
|
19482
|
+
/**
|
|
19483
|
+
* Picks the product name from an array of guesses.
|
|
19484
|
+
*
|
|
19485
|
+
* @private
|
|
19486
|
+
* @param {Array} guesses An array of guesses.
|
|
19487
|
+
* @returns {null|string} The detected product name.
|
|
19488
|
+
*/
|
|
19489
|
+
function getProduct(guesses) {
|
|
19490
|
+
return reduce(guesses, function (result, guess) {
|
|
19491
|
+
var pattern = guess.pattern || qualify(guess);
|
|
19492
|
+
if (!result && (result = RegExp('\\b' + pattern + ' *\\d+[.\\w_]*', 'i').exec(ua) || RegExp('\\b' + pattern + ' *\\w+-[\\w]*', 'i').exec(ua) || RegExp('\\b' + pattern + '(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)', 'i').exec(ua))) {
|
|
19493
|
+
// Split by forward slash and append product version if needed.
|
|
19494
|
+
if ((result = String(guess.label && !RegExp(pattern, 'i').test(guess.label) ? guess.label : result).split('/'))[1] && !/[\d.]+/.test(result[0])) {
|
|
19495
|
+
result[0] += ' ' + result[1];
|
|
19496
|
+
}
|
|
19497
|
+
// Correct character case and cleanup string.
|
|
19498
|
+
guess = guess.label || guess;
|
|
19499
|
+
result = format(result[0].replace(RegExp(pattern, 'i'), guess).replace(RegExp('; *(?:' + guess + '[_-])?', 'i'), ' ').replace(RegExp('(' + guess + ')[-_.]?(\\w)', 'i'), '$1 $2'));
|
|
19500
|
+
}
|
|
19501
|
+
return result;
|
|
19502
|
+
});
|
|
19503
|
+
}
|
|
18360
19504
|
|
|
18361
|
-
|
|
18362
|
-
|
|
19505
|
+
/**
|
|
19506
|
+
* Resolves the version using an array of UA patterns.
|
|
19507
|
+
*
|
|
19508
|
+
* @private
|
|
19509
|
+
* @param {Array} patterns An array of UA patterns.
|
|
19510
|
+
* @returns {null|string} The detected version.
|
|
19511
|
+
*/
|
|
19512
|
+
function getVersion(patterns) {
|
|
19513
|
+
return reduce(patterns, function (result, pattern) {
|
|
19514
|
+
return result || (RegExp(pattern + '(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)', 'i').exec(ua) || 0)[1] || null;
|
|
19515
|
+
});
|
|
19516
|
+
}
|
|
18363
19517
|
|
|
18364
|
-
|
|
18365
|
-
|
|
19518
|
+
/**
|
|
19519
|
+
* Returns `platform.description` when the platform object is coerced to a string.
|
|
19520
|
+
*
|
|
19521
|
+
* @name toString
|
|
19522
|
+
* @memberOf platform
|
|
19523
|
+
* @returns {string} Returns `platform.description` if available, else an empty string.
|
|
19524
|
+
*/
|
|
19525
|
+
function toStringPlatform() {
|
|
19526
|
+
return this.description || '';
|
|
19527
|
+
}
|
|
18366
19528
|
|
|
18367
|
-
|
|
18368
|
-
|
|
18369
|
-
|
|
19529
|
+
/*------------------------------------------------------------------------*/
|
|
19530
|
+
|
|
19531
|
+
// Convert layout to an array so we can add extra details.
|
|
19532
|
+
layout && (layout = [layout]);
|
|
19533
|
+
|
|
19534
|
+
// Detect Android products.
|
|
19535
|
+
// Browsers on Android devices typically provide their product IDS after "Android;"
|
|
19536
|
+
// up to "Build" or ") AppleWebKit".
|
|
19537
|
+
// Example:
|
|
19538
|
+
// "Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5) Plus) AppleWebKit/537.36
|
|
19539
|
+
// (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36"
|
|
19540
|
+
if (/\bAndroid\b/.test(os) && !product && (data = /\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(ua))) {
|
|
19541
|
+
product = trim(data[1])
|
|
19542
|
+
// Replace any language codes (eg. "en-US").
|
|
19543
|
+
.replace(/^[a-z]{2}-[a-z]{2};\s*/i, '') || null;
|
|
19544
|
+
}
|
|
19545
|
+
// Detect product names that contain their manufacturer's name.
|
|
19546
|
+
if (manufacturer && !product) {
|
|
19547
|
+
product = getProduct([manufacturer]);
|
|
19548
|
+
} else if (manufacturer && product) {
|
|
19549
|
+
product = product.replace(RegExp('^(' + qualify(manufacturer) + ')[-_.\\s]', 'i'), manufacturer + ' ').replace(RegExp('^(' + qualify(manufacturer) + ')[-_.]?(\\w)', 'i'), manufacturer + ' $2');
|
|
19550
|
+
}
|
|
19551
|
+
// Clean up Google TV.
|
|
19552
|
+
if (data = /\bGoogle TV\b/.exec(product)) {
|
|
19553
|
+
product = data[0];
|
|
19554
|
+
}
|
|
19555
|
+
// Detect simulators.
|
|
19556
|
+
if (/\bSimulator\b/i.test(ua)) {
|
|
19557
|
+
product = (product ? product + ' ' : '') + 'Simulator';
|
|
19558
|
+
}
|
|
19559
|
+
// Detect Opera Mini 8+ running in Turbo/Uncompressed mode on iOS.
|
|
19560
|
+
if (name == 'Opera Mini' && /\bOPiOS\b/.test(ua)) {
|
|
19561
|
+
description.push('running in Turbo/Uncompressed mode');
|
|
19562
|
+
}
|
|
19563
|
+
// Detect IE Mobile 11.
|
|
19564
|
+
if (name == 'IE' && /\blike iPhone OS\b/.test(ua)) {
|
|
19565
|
+
data = parse(ua.replace(/like iPhone OS/, ''));
|
|
19566
|
+
manufacturer = data.manufacturer;
|
|
19567
|
+
product = data.product;
|
|
19568
|
+
}
|
|
19569
|
+
// Detect iOS.
|
|
19570
|
+
else if (/^iP/.test(product)) {
|
|
19571
|
+
name || (name = 'Safari');
|
|
19572
|
+
os = 'iOS' + ((data = / OS ([\d_]+)/i.exec(ua)) ? ' ' + data[1].replace(/_/g, '.') : '');
|
|
19573
|
+
}
|
|
19574
|
+
// Detect Kubuntu.
|
|
19575
|
+
else if (name == 'Konqueror' && /^Linux\b/i.test(os)) {
|
|
19576
|
+
os = 'Kubuntu';
|
|
19577
|
+
}
|
|
19578
|
+
// Detect Android browsers.
|
|
19579
|
+
else if (manufacturer && manufacturer != 'Google' && (/Chrome/.test(name) && !/\bMobile Safari\b/i.test(ua) || /\bVita\b/.test(product)) || /\bAndroid\b/.test(os) && /^Chrome/.test(name) && /\bVersion\//i.test(ua)) {
|
|
19580
|
+
name = 'Android Browser';
|
|
19581
|
+
os = /\bAndroid\b/.test(os) ? os : 'Android';
|
|
19582
|
+
}
|
|
19583
|
+
// Detect Silk desktop/accelerated modes.
|
|
19584
|
+
else if (name == 'Silk') {
|
|
19585
|
+
if (!/\bMobi/i.test(ua)) {
|
|
19586
|
+
os = 'Android';
|
|
19587
|
+
description.unshift('desktop mode');
|
|
19588
|
+
}
|
|
19589
|
+
if (/Accelerated *= *true/i.test(ua)) {
|
|
19590
|
+
description.unshift('accelerated');
|
|
19591
|
+
}
|
|
19592
|
+
}
|
|
19593
|
+
// Detect UC Browser speed mode.
|
|
19594
|
+
else if (name == 'UC Browser' && /\bUCWEB\b/.test(ua)) {
|
|
19595
|
+
description.push('speed mode');
|
|
19596
|
+
}
|
|
19597
|
+
// Detect PaleMoon identifying as Firefox.
|
|
19598
|
+
else if (name == 'PaleMoon' && (data = /\bFirefox\/([\d.]+)\b/.exec(ua))) {
|
|
19599
|
+
description.push('identifying as Firefox ' + data[1]);
|
|
19600
|
+
}
|
|
19601
|
+
// Detect Firefox OS and products running Firefox.
|
|
19602
|
+
else if (name == 'Firefox' && (data = /\b(Mobile|Tablet|TV)\b/i.exec(ua))) {
|
|
19603
|
+
os || (os = 'Firefox OS');
|
|
19604
|
+
product || (product = data[1]);
|
|
19605
|
+
}
|
|
19606
|
+
// Detect false positives for Firefox/Safari.
|
|
19607
|
+
else if (!name || (data = !/\bMinefield\b/i.test(ua) && /\b(?:Firefox|Safari)\b/.exec(name))) {
|
|
19608
|
+
// Escape the `/` for Firefox 1.
|
|
19609
|
+
if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + '/') + 8))) {
|
|
19610
|
+
// Clear name of false positives.
|
|
19611
|
+
name = null;
|
|
19612
|
+
}
|
|
19613
|
+
// Reassign a generic name.
|
|
19614
|
+
if ((data = product || manufacturer || os) && (product || manufacturer || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(os))) {
|
|
19615
|
+
name = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(os) ? os : data) + ' Browser';
|
|
19616
|
+
}
|
|
19617
|
+
}
|
|
19618
|
+
// Add Chrome version to description for Electron.
|
|
19619
|
+
else if (name == 'Electron' && (data = (/\bChrome\/([\d.]+)\b/.exec(ua) || 0)[1])) {
|
|
19620
|
+
description.push('Chromium ' + data);
|
|
19621
|
+
}
|
|
19622
|
+
// Detect non-Opera (Presto-based) versions (order is important).
|
|
19623
|
+
if (!version) {
|
|
19624
|
+
version = getVersion(['(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)', 'Version', qualify(name), '(?:Firefox|Minefield|NetFront)']);
|
|
19625
|
+
}
|
|
19626
|
+
// Detect stubborn layout engines.
|
|
19627
|
+
if (data = layout == 'iCab' && parseFloat(version) > 3 && 'WebKit' || /\bOpera\b/.test(name) && (/\bOPR\b/.test(ua) ? 'Blink' : 'Presto') || /\b(?:Midori|Nook|Safari)\b/i.test(ua) && !/^(?:Trident|EdgeHTML)$/.test(layout) && 'WebKit' || !layout && /\bMSIE\b/i.test(ua) && (os == 'Mac OS' ? 'Tasman' : 'Trident') || layout == 'WebKit' && /\bPlayStation\b(?! Vita\b)/i.test(name) && 'NetFront') {
|
|
19628
|
+
layout = [data];
|
|
19629
|
+
}
|
|
19630
|
+
// Detect Windows Phone 7 desktop mode.
|
|
19631
|
+
if (name == 'IE' && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) {
|
|
19632
|
+
name += ' Mobile';
|
|
19633
|
+
os = 'Windows Phone ' + (/\+$/.test(data) ? data : data + '.x');
|
|
19634
|
+
description.unshift('desktop mode');
|
|
19635
|
+
}
|
|
19636
|
+
// Detect Windows Phone 8.x desktop mode.
|
|
19637
|
+
else if (/\bWPDesktop\b/i.test(ua)) {
|
|
19638
|
+
name = 'IE Mobile';
|
|
19639
|
+
os = 'Windows Phone 8.x';
|
|
19640
|
+
description.unshift('desktop mode');
|
|
19641
|
+
version || (version = (/\brv:([\d.]+)/.exec(ua) || 0)[1]);
|
|
19642
|
+
}
|
|
19643
|
+
// Detect IE 11 identifying as other browsers.
|
|
19644
|
+
else if (name != 'IE' && layout == 'Trident' && (data = /\brv:([\d.]+)/.exec(ua))) {
|
|
19645
|
+
if (name) {
|
|
19646
|
+
description.push('identifying as ' + name + (version ? ' ' + version : ''));
|
|
19647
|
+
}
|
|
19648
|
+
name = 'IE';
|
|
19649
|
+
version = data[1];
|
|
19650
|
+
}
|
|
19651
|
+
// Leverage environment features.
|
|
19652
|
+
if (useFeatures) {
|
|
19653
|
+
// Detect server-side environments.
|
|
19654
|
+
// Rhino has a global function while others have a global object.
|
|
19655
|
+
if (isHostType(context, 'global')) {
|
|
19656
|
+
if (java) {
|
|
19657
|
+
data = java.lang.System;
|
|
19658
|
+
arch = data.getProperty('os.arch');
|
|
19659
|
+
os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version');
|
|
19660
|
+
}
|
|
19661
|
+
if (rhino) {
|
|
19662
|
+
try {
|
|
19663
|
+
version = context.require('ringo/engine').version.join('.');
|
|
19664
|
+
name = 'RingoJS';
|
|
19665
|
+
} catch (e) {
|
|
19666
|
+
if ((data = context.system) && data.global.system == context.system) {
|
|
19667
|
+
name = 'Narwhal';
|
|
19668
|
+
os || (os = data[0].os || null);
|
|
19669
|
+
}
|
|
19670
|
+
}
|
|
19671
|
+
if (!name) {
|
|
19672
|
+
name = 'Rhino';
|
|
19673
|
+
}
|
|
19674
|
+
} else if (_typeof$6(context.process) == 'object' && !context.process.browser && (data = context.process)) {
|
|
19675
|
+
if (_typeof$6(data.versions) == 'object') {
|
|
19676
|
+
if (typeof data.versions.electron == 'string') {
|
|
19677
|
+
description.push('Node ' + data.versions.node);
|
|
19678
|
+
name = 'Electron';
|
|
19679
|
+
version = data.versions.electron;
|
|
19680
|
+
} else if (typeof data.versions.nw == 'string') {
|
|
19681
|
+
description.push('Chromium ' + version, 'Node ' + data.versions.node);
|
|
19682
|
+
name = 'NW.js';
|
|
19683
|
+
version = data.versions.nw;
|
|
19684
|
+
}
|
|
19685
|
+
}
|
|
19686
|
+
if (!name) {
|
|
19687
|
+
name = 'Node.js';
|
|
19688
|
+
arch = data.arch;
|
|
19689
|
+
os = data.platform;
|
|
19690
|
+
version = /[\d.]+/.exec(data.version);
|
|
19691
|
+
version = version ? version[0] : null;
|
|
19692
|
+
}
|
|
19693
|
+
}
|
|
19694
|
+
}
|
|
19695
|
+
// Detect Adobe AIR.
|
|
19696
|
+
else if (getClassOf(data = context.runtime) == airRuntimeClass) {
|
|
19697
|
+
name = 'Adobe AIR';
|
|
19698
|
+
os = data.flash.system.Capabilities.os;
|
|
19699
|
+
}
|
|
19700
|
+
// Detect PhantomJS.
|
|
19701
|
+
else if (getClassOf(data = context.phantom) == phantomClass) {
|
|
19702
|
+
name = 'PhantomJS';
|
|
19703
|
+
version = (data = data.version || null) && data.major + '.' + data.minor + '.' + data.patch;
|
|
19704
|
+
}
|
|
19705
|
+
// Detect IE compatibility modes.
|
|
19706
|
+
else if (typeof doc.documentMode == 'number' && (data = /\bTrident\/(\d+)/i.exec(ua))) {
|
|
19707
|
+
// We're in compatibility mode when the Trident version + 4 doesn't
|
|
19708
|
+
// equal the document mode.
|
|
19709
|
+
version = [version, doc.documentMode];
|
|
19710
|
+
if ((data = +data[1] + 4) != version[1]) {
|
|
19711
|
+
description.push('IE ' + version[1] + ' mode');
|
|
19712
|
+
layout && (layout[1] = '');
|
|
19713
|
+
version[1] = data;
|
|
19714
|
+
}
|
|
19715
|
+
version = name == 'IE' ? String(version[1].toFixed(1)) : version[0];
|
|
19716
|
+
}
|
|
19717
|
+
// Detect IE 11 masking as other browsers.
|
|
19718
|
+
else if (typeof doc.documentMode == 'number' && /^(?:Chrome|Firefox)\b/.test(name)) {
|
|
19719
|
+
description.push('masking as ' + name + ' ' + version);
|
|
19720
|
+
name = 'IE';
|
|
19721
|
+
version = '11.0';
|
|
19722
|
+
layout = ['Trident'];
|
|
19723
|
+
os = 'Windows';
|
|
19724
|
+
}
|
|
19725
|
+
os = os && format(os);
|
|
19726
|
+
}
|
|
19727
|
+
// Detect prerelease phases.
|
|
19728
|
+
if (version && (data = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) || /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ';' + (useFeatures && nav.appMinorVersion)) || /\bMinefield\b/i.test(ua) && 'a')) {
|
|
19729
|
+
prerelease = /b/i.test(data) ? 'beta' : 'alpha';
|
|
19730
|
+
version = version.replace(RegExp(data + '\\+?$'), '') + (prerelease == 'beta' ? beta : alpha) + (/\d+\+?/.exec(data) || '');
|
|
19731
|
+
}
|
|
19732
|
+
// Detect Firefox Mobile.
|
|
19733
|
+
if (name == 'Fennec' || name == 'Firefox' && /\b(?:Android|Firefox OS|KaiOS)\b/.test(os)) {
|
|
19734
|
+
name = 'Firefox Mobile';
|
|
19735
|
+
}
|
|
19736
|
+
// Obscure Maxthon's unreliable version.
|
|
19737
|
+
else if (name == 'Maxthon' && version) {
|
|
19738
|
+
version = version.replace(/\.[\d.]+/, '.x');
|
|
19739
|
+
}
|
|
19740
|
+
// Detect Xbox 360 and Xbox One.
|
|
19741
|
+
else if (/\bXbox\b/i.test(product)) {
|
|
19742
|
+
if (product == 'Xbox 360') {
|
|
19743
|
+
os = null;
|
|
19744
|
+
}
|
|
19745
|
+
if (product == 'Xbox 360' && /\bIEMobile\b/.test(ua)) {
|
|
19746
|
+
description.unshift('mobile mode');
|
|
19747
|
+
}
|
|
19748
|
+
}
|
|
19749
|
+
// Add mobile postfix.
|
|
19750
|
+
else if ((/^(?:Chrome|IE|Opera)$/.test(name) || name && !product && !/Browser|Mobi/.test(name)) && (os == 'Windows CE' || /Mobi/i.test(ua))) {
|
|
19751
|
+
name += ' Mobile';
|
|
19752
|
+
}
|
|
19753
|
+
// Detect IE platform preview.
|
|
19754
|
+
else if (name == 'IE' && useFeatures) {
|
|
19755
|
+
try {
|
|
19756
|
+
if (context.external === null) {
|
|
19757
|
+
description.unshift('platform preview');
|
|
19758
|
+
}
|
|
19759
|
+
} catch (e) {
|
|
19760
|
+
description.unshift('embedded');
|
|
19761
|
+
}
|
|
19762
|
+
}
|
|
19763
|
+
// Detect BlackBerry OS version.
|
|
19764
|
+
// http://docs.blackberry.com/en/developers/deliverables/18169/HTTP_headers_sent_by_BB_Browser_1234911_11.jsp
|
|
19765
|
+
else if ((/\bBlackBerry\b/.test(product) || /\bBB10\b/.test(ua)) && (data = (RegExp(product.replace(/ +/g, ' *') + '/([.\\d]+)', 'i').exec(ua) || 0)[1] || version)) {
|
|
19766
|
+
data = [data, /BB10/.test(ua)];
|
|
19767
|
+
os = (data[1] ? (product = null, manufacturer = 'BlackBerry') : 'Device Software') + ' ' + data[0];
|
|
19768
|
+
version = null;
|
|
19769
|
+
}
|
|
19770
|
+
// Detect Opera identifying/masking itself as another browser.
|
|
19771
|
+
// http://www.opera.com/support/kb/view/843/
|
|
19772
|
+
else if (this != forOwn && product != 'Wii' && (useFeatures && opera || /Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua) || name == 'Firefox' && /\bOS X (?:\d+\.){2,}/.test(os) || name == 'IE' && (os && !/^Win/.test(os) && version > 5.5 || /\bWindows XP\b/.test(os) && version > 8 || version == 8 && !/\bTrident\b/.test(ua))) && !reOpera.test(data = parse.call(forOwn, ua.replace(reOpera, '') + ';')) && data.name) {
|
|
19773
|
+
// When "identifying", the UA contains both Opera and the other browser's name.
|
|
19774
|
+
data = 'ing as ' + data.name + ((data = data.version) ? ' ' + data : '');
|
|
19775
|
+
if (reOpera.test(name)) {
|
|
19776
|
+
if (/\bIE\b/.test(data) && os == 'Mac OS') {
|
|
19777
|
+
os = null;
|
|
19778
|
+
}
|
|
19779
|
+
data = 'identify' + data;
|
|
19780
|
+
}
|
|
19781
|
+
// When "masking", the UA contains only the other browser's name.
|
|
19782
|
+
else {
|
|
19783
|
+
data = 'mask' + data;
|
|
19784
|
+
if (operaClass) {
|
|
19785
|
+
name = format(operaClass.replace(/([a-z])([A-Z])/g, '$1 $2'));
|
|
19786
|
+
} else {
|
|
19787
|
+
name = 'Opera';
|
|
19788
|
+
}
|
|
19789
|
+
if (/\bIE\b/.test(data)) {
|
|
19790
|
+
os = null;
|
|
19791
|
+
}
|
|
19792
|
+
if (!useFeatures) {
|
|
19793
|
+
version = null;
|
|
19794
|
+
}
|
|
19795
|
+
}
|
|
19796
|
+
layout = ['Presto'];
|
|
19797
|
+
description.push(data);
|
|
19798
|
+
}
|
|
19799
|
+
// Detect WebKit Nightly and approximate Chrome/Safari versions.
|
|
19800
|
+
if (data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1]) {
|
|
19801
|
+
// Correct build number for numeric comparison.
|
|
19802
|
+
// (e.g. "532.5" becomes "532.05")
|
|
19803
|
+
data = [parseFloat(data.replace(/\.(\d)$/, '.0$1')), data];
|
|
19804
|
+
// Nightly builds are postfixed with a "+".
|
|
19805
|
+
if (name == 'Safari' && data[1].slice(-1) == '+') {
|
|
19806
|
+
name = 'WebKit Nightly';
|
|
19807
|
+
prerelease = 'alpha';
|
|
19808
|
+
version = data[1].slice(0, -1);
|
|
19809
|
+
}
|
|
19810
|
+
// Clear incorrect browser versions.
|
|
19811
|
+
else if (version == data[1] || version == (data[2] = (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1])) {
|
|
19812
|
+
version = null;
|
|
19813
|
+
}
|
|
19814
|
+
// Use the full Chrome version when available.
|
|
19815
|
+
data[1] = (/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(ua) || 0)[1];
|
|
19816
|
+
// Detect Blink layout engine.
|
|
19817
|
+
if (data[0] == 537.36 && data[2] == 537.36 && parseFloat(data[1]) >= 28 && layout == 'WebKit') {
|
|
19818
|
+
layout = ['Blink'];
|
|
19819
|
+
}
|
|
19820
|
+
// Detect JavaScriptCore.
|
|
19821
|
+
// http://stackoverflow.com/questions/6768474/how-can-i-detect-which-javascript-engine-v8-or-jsc-is-used-at-runtime-in-androi
|
|
19822
|
+
if (!useFeatures || !likeChrome && !data[1]) {
|
|
19823
|
+
layout && (layout[1] = 'like Safari');
|
|
19824
|
+
data = (data = data[0], data < 400 ? 1 : data < 500 ? 2 : data < 526 ? 3 : data < 533 ? 4 : data < 534 ? '4+' : data < 535 ? 5 : data < 537 ? 6 : data < 538 ? 7 : data < 601 ? 8 : data < 602 ? 9 : data < 604 ? 10 : data < 606 ? 11 : data < 608 ? 12 : '12');
|
|
19825
|
+
} else {
|
|
19826
|
+
layout && (layout[1] = 'like Chrome');
|
|
19827
|
+
data = data[1] || (data = data[0], data < 530 ? 1 : data < 532 ? 2 : data < 532.05 ? 3 : data < 533 ? 4 : data < 534.03 ? 5 : data < 534.07 ? 6 : data < 534.10 ? 7 : data < 534.13 ? 8 : data < 534.16 ? 9 : data < 534.24 ? 10 : data < 534.30 ? 11 : data < 535.01 ? 12 : data < 535.02 ? '13+' : data < 535.07 ? 15 : data < 535.11 ? 16 : data < 535.19 ? 17 : data < 536.05 ? 18 : data < 536.10 ? 19 : data < 537.01 ? 20 : data < 537.11 ? '21+' : data < 537.13 ? 23 : data < 537.18 ? 24 : data < 537.24 ? 25 : data < 537.36 ? 26 : layout != 'Blink' ? '27' : '28');
|
|
19828
|
+
}
|
|
19829
|
+
// Add the postfix of ".x" or "+" for approximate versions.
|
|
19830
|
+
layout && (layout[1] += ' ' + (data += typeof data == 'number' ? '.x' : /[.+]/.test(data) ? '' : '+'));
|
|
19831
|
+
// Obscure version for some Safari 1-2 releases.
|
|
19832
|
+
if (name == 'Safari' && (!version || parseInt(version) > 45)) {
|
|
19833
|
+
version = data;
|
|
19834
|
+
} else if (name == 'Chrome' && /\bHeadlessChrome/i.test(ua)) {
|
|
19835
|
+
description.unshift('headless');
|
|
19836
|
+
}
|
|
19837
|
+
}
|
|
19838
|
+
// Detect Opera desktop modes.
|
|
19839
|
+
if (name == 'Opera' && (data = /\bzbov|zvav$/.exec(os))) {
|
|
19840
|
+
name += ' ';
|
|
19841
|
+
description.unshift('desktop mode');
|
|
19842
|
+
if (data == 'zvav') {
|
|
19843
|
+
name += 'Mini';
|
|
19844
|
+
version = null;
|
|
19845
|
+
} else {
|
|
19846
|
+
name += 'Mobile';
|
|
19847
|
+
}
|
|
19848
|
+
os = os.replace(RegExp(' *' + data + '$'), '');
|
|
19849
|
+
}
|
|
19850
|
+
// Detect Chrome desktop mode.
|
|
19851
|
+
else if (name == 'Safari' && /\bChrome\b/.exec(layout && layout[1])) {
|
|
19852
|
+
description.unshift('desktop mode');
|
|
19853
|
+
name = 'Chrome Mobile';
|
|
19854
|
+
version = null;
|
|
19855
|
+
if (/\bOS X\b/.test(os)) {
|
|
19856
|
+
manufacturer = 'Apple';
|
|
19857
|
+
os = 'iOS 4.3+';
|
|
19858
|
+
} else {
|
|
19859
|
+
os = null;
|
|
19860
|
+
}
|
|
19861
|
+
}
|
|
19862
|
+
// Newer versions of SRWare Iron uses the Chrome tag to indicate its version number.
|
|
19863
|
+
else if (/\bSRWare Iron\b/.test(name) && !version) {
|
|
19864
|
+
version = getVersion('Chrome');
|
|
19865
|
+
}
|
|
19866
|
+
// Strip incorrect OS versions.
|
|
19867
|
+
if (version && version.indexOf(data = /[\d.]+$/.exec(os)) == 0 && ua.indexOf('/' + data + '-') > -1) {
|
|
19868
|
+
os = trim(os.replace(data, ''));
|
|
19869
|
+
}
|
|
19870
|
+
// Ensure OS does not include the browser name.
|
|
19871
|
+
if (os && os.indexOf(name) != -1 && !RegExp(name + ' OS').test(os)) {
|
|
19872
|
+
os = os.replace(RegExp(' *' + qualify(name) + ' *'), '');
|
|
19873
|
+
}
|
|
19874
|
+
// Add layout engine.
|
|
19875
|
+
if (layout && !/\b(?:Avant|Nook)\b/.test(name) && (/Browser|Lunascape|Maxthon/.test(name) || name != 'Safari' && /^iOS/.test(os) && /\bSafari\b/.test(layout[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(name) && layout[1])) {
|
|
19876
|
+
// Don't add layout details to description if they are falsey.
|
|
19877
|
+
(data = layout[layout.length - 1]) && description.push(data);
|
|
19878
|
+
}
|
|
19879
|
+
// Combine contextual information.
|
|
19880
|
+
if (description.length) {
|
|
19881
|
+
description = ['(' + description.join('; ') + ')'];
|
|
19882
|
+
}
|
|
19883
|
+
// Append manufacturer to description.
|
|
19884
|
+
if (manufacturer && product && product.indexOf(manufacturer) < 0) {
|
|
19885
|
+
description.push('on ' + manufacturer);
|
|
19886
|
+
}
|
|
19887
|
+
// Append product to description.
|
|
19888
|
+
if (product) {
|
|
19889
|
+
description.push((/^on /.test(description[description.length - 1]) ? '' : 'on ') + product);
|
|
19890
|
+
}
|
|
19891
|
+
// Parse the OS into an object.
|
|
19892
|
+
if (os) {
|
|
19893
|
+
data = / ([\d.+]+)$/.exec(os);
|
|
19894
|
+
isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == '/';
|
|
19895
|
+
os = {
|
|
19896
|
+
'architecture': 32,
|
|
19897
|
+
'family': data && !isSpecialCasedOS ? os.replace(data[0], '') : os,
|
|
19898
|
+
'version': data ? data[1] : null,
|
|
19899
|
+
'toString': function toString() {
|
|
19900
|
+
var version = this.version;
|
|
19901
|
+
return this.family + (version && !isSpecialCasedOS ? ' ' + version : '') + (this.architecture == 64 ? ' 64-bit' : '');
|
|
19902
|
+
}
|
|
19903
|
+
};
|
|
19904
|
+
}
|
|
19905
|
+
// Add browser/OS architecture.
|
|
19906
|
+
if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) {
|
|
19907
|
+
if (os) {
|
|
19908
|
+
os.architecture = 64;
|
|
19909
|
+
os.family = os.family.replace(RegExp(' *' + data), '');
|
|
19910
|
+
}
|
|
19911
|
+
if (name && (/\bWOW64\b/i.test(ua) || useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform) && !/\bWin64; x64\b/i.test(ua))) {
|
|
19912
|
+
description.unshift('32-bit');
|
|
19913
|
+
}
|
|
19914
|
+
}
|
|
19915
|
+
// Chrome 39 and above on OS X is always 64-bit.
|
|
19916
|
+
else if (os && /^OS X/.test(os.family) && name == 'Chrome' && parseFloat(version) >= 39) {
|
|
19917
|
+
os.architecture = 64;
|
|
19918
|
+
}
|
|
19919
|
+
ua || (ua = null);
|
|
18370
19920
|
|
|
18371
|
-
|
|
18372
|
-
var target = _ref.target;
|
|
18373
|
-
var targetTagName = target && target.tagName;
|
|
18374
|
-
return Boolean(targetTagName && enableOnTags && enableOnTags.includes(targetTagName));
|
|
18375
|
-
};
|
|
19921
|
+
/*------------------------------------------------------------------------*/
|
|
18376
19922
|
|
|
18377
|
-
|
|
18378
|
-
|
|
18379
|
-
|
|
19923
|
+
/**
|
|
19924
|
+
* The platform object.
|
|
19925
|
+
*
|
|
19926
|
+
* @name platform
|
|
19927
|
+
* @type Object
|
|
19928
|
+
*/
|
|
19929
|
+
var platform = {};
|
|
18380
19930
|
|
|
18381
|
-
|
|
18382
|
-
|
|
18383
|
-
|
|
18384
|
-
|
|
18385
|
-
|
|
19931
|
+
/**
|
|
19932
|
+
* The platform description.
|
|
19933
|
+
*
|
|
19934
|
+
* @memberOf platform
|
|
19935
|
+
* @type string|null
|
|
19936
|
+
*/
|
|
19937
|
+
platform.description = ua;
|
|
18386
19938
|
|
|
18387
|
-
|
|
18388
|
-
|
|
18389
|
-
|
|
18390
|
-
|
|
18391
|
-
|
|
18392
|
-
|
|
18393
|
-
|
|
18394
|
-
|
|
18395
|
-
|
|
18396
|
-
|
|
18397
|
-
enableOnContentEditable = _ref2$enableOnContent === void 0 ? false : _ref2$enableOnContent;
|
|
19939
|
+
/**
|
|
19940
|
+
* The name of the browser's layout engine.
|
|
19941
|
+
*
|
|
19942
|
+
* The list of common layout engines include:
|
|
19943
|
+
* "Blink", "EdgeHTML", "Gecko", "Trident" and "WebKit"
|
|
19944
|
+
*
|
|
19945
|
+
* @memberOf platform
|
|
19946
|
+
* @type string|null
|
|
19947
|
+
*/
|
|
19948
|
+
platform.layout = layout && layout[0];
|
|
18398
19949
|
|
|
18399
|
-
|
|
19950
|
+
/**
|
|
19951
|
+
* The name of the product's manufacturer.
|
|
19952
|
+
*
|
|
19953
|
+
* The list of manufacturers include:
|
|
19954
|
+
* "Apple", "Archos", "Amazon", "Asus", "Barnes & Noble", "BlackBerry",
|
|
19955
|
+
* "Google", "HP", "HTC", "LG", "Microsoft", "Motorola", "Nintendo",
|
|
19956
|
+
* "Nokia", "Samsung" and "Sony"
|
|
19957
|
+
*
|
|
19958
|
+
* @memberOf platform
|
|
19959
|
+
* @type string|null
|
|
19960
|
+
*/
|
|
19961
|
+
platform.manufacturer = manufacturer;
|
|
18400
19962
|
|
|
18401
|
-
|
|
18402
|
-
|
|
19963
|
+
/**
|
|
19964
|
+
* The name of the browser/environment.
|
|
19965
|
+
*
|
|
19966
|
+
* The list of common browser names include:
|
|
19967
|
+
* "Chrome", "Electron", "Firefox", "Firefox for iOS", "IE",
|
|
19968
|
+
* "Microsoft Edge", "PhantomJS", "Safari", "SeaMonkey", "Silk",
|
|
19969
|
+
* "Opera Mini" and "Opera"
|
|
19970
|
+
*
|
|
19971
|
+
* Mobile versions of some browsers have "Mobile" appended to their name:
|
|
19972
|
+
* eg. "Chrome Mobile", "Firefox Mobile", "IE Mobile" and "Opera Mobile"
|
|
19973
|
+
*
|
|
19974
|
+
* @memberOf platform
|
|
19975
|
+
* @type string|null
|
|
19976
|
+
*/
|
|
19977
|
+
platform.name = name;
|
|
18403
19978
|
|
|
18404
|
-
|
|
18405
|
-
|
|
18406
|
-
|
|
19979
|
+
/**
|
|
19980
|
+
* The alpha/beta release indicator.
|
|
19981
|
+
*
|
|
19982
|
+
* @memberOf platform
|
|
19983
|
+
* @type string|null
|
|
19984
|
+
*/
|
|
19985
|
+
platform.prerelease = prerelease;
|
|
18407
19986
|
|
|
19987
|
+
/**
|
|
19988
|
+
* The name of the product hosting the browser.
|
|
19989
|
+
*
|
|
19990
|
+
* The list of common products include:
|
|
19991
|
+
*
|
|
19992
|
+
* "BlackBerry", "Galaxy S4", "Lumia", "iPad", "iPod", "iPhone", "Kindle",
|
|
19993
|
+
* "Kindle Fire", "Nexus", "Nook", "PlayBook", "TouchPad" and "Transformer"
|
|
19994
|
+
*
|
|
19995
|
+
* @memberOf platform
|
|
19996
|
+
* @type string|null
|
|
19997
|
+
*/
|
|
19998
|
+
platform.product = product;
|
|
18408
19999
|
|
|
18409
|
-
|
|
18410
|
-
|
|
18411
|
-
|
|
20000
|
+
/**
|
|
20001
|
+
* The browser's user agent string.
|
|
20002
|
+
*
|
|
20003
|
+
* @memberOf platform
|
|
20004
|
+
* @type string|null
|
|
20005
|
+
*/
|
|
20006
|
+
platform.ua = ua;
|
|
18412
20007
|
|
|
18413
|
-
|
|
18414
|
-
|
|
18415
|
-
|
|
20008
|
+
/**
|
|
20009
|
+
* The browser/environment version.
|
|
20010
|
+
*
|
|
20011
|
+
* @memberOf platform
|
|
20012
|
+
* @type string|null
|
|
20013
|
+
*/
|
|
20014
|
+
platform.version = name && version;
|
|
20015
|
+
|
|
20016
|
+
/**
|
|
20017
|
+
* The name of the operating system.
|
|
20018
|
+
*
|
|
20019
|
+
* @memberOf platform
|
|
20020
|
+
* @type Object
|
|
20021
|
+
*/
|
|
20022
|
+
platform.os = os || {
|
|
20023
|
+
/**
|
|
20024
|
+
* The CPU architecture the OS is built for.
|
|
20025
|
+
*
|
|
20026
|
+
* @memberOf platform.os
|
|
20027
|
+
* @type number|null
|
|
20028
|
+
*/
|
|
20029
|
+
'architecture': null,
|
|
20030
|
+
/**
|
|
20031
|
+
* The family of the OS.
|
|
20032
|
+
*
|
|
20033
|
+
* Common values include:
|
|
20034
|
+
* "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista",
|
|
20035
|
+
* "Windows XP", "OS X", "Linux", "Ubuntu", "Debian", "Fedora", "Red Hat",
|
|
20036
|
+
* "SuSE", "Android", "iOS" and "Windows Phone"
|
|
20037
|
+
*
|
|
20038
|
+
* @memberOf platform.os
|
|
20039
|
+
* @type string|null
|
|
20040
|
+
*/
|
|
20041
|
+
'family': null,
|
|
20042
|
+
/**
|
|
20043
|
+
* The version of the OS.
|
|
20044
|
+
*
|
|
20045
|
+
* @memberOf platform.os
|
|
20046
|
+
* @type string|null
|
|
20047
|
+
*/
|
|
20048
|
+
'version': null,
|
|
20049
|
+
/**
|
|
20050
|
+
* Returns the OS string.
|
|
20051
|
+
*
|
|
20052
|
+
* @memberOf platform.os
|
|
20053
|
+
* @returns {string} The OS string.
|
|
20054
|
+
*/
|
|
20055
|
+
'toString': function toString() {
|
|
20056
|
+
return 'null';
|
|
20057
|
+
}
|
|
20058
|
+
};
|
|
20059
|
+
platform.parse = parse;
|
|
20060
|
+
platform.toString = toStringPlatform;
|
|
20061
|
+
if (platform.version) {
|
|
20062
|
+
description.unshift(version);
|
|
20063
|
+
}
|
|
20064
|
+
if (platform.name) {
|
|
20065
|
+
description.unshift(name);
|
|
20066
|
+
}
|
|
20067
|
+
if (os && name && !(os == String(os).split(' ')[0] && (os == name.split(' ')[0] || product))) {
|
|
20068
|
+
description.push(product ? '(' + os + ')' : 'on ' + os);
|
|
20069
|
+
}
|
|
20070
|
+
if (description.length) {
|
|
20071
|
+
platform.description = description.join(' ');
|
|
20072
|
+
}
|
|
20073
|
+
return platform;
|
|
18416
20074
|
}
|
|
18417
20075
|
|
|
18418
|
-
|
|
18419
|
-
}, deps ? [ref, enableOnTags, filter].concat(deps) : [ref, enableOnTags, filter]);
|
|
18420
|
-
React$3.useEffect(function () {
|
|
18421
|
-
if (!enabled) {
|
|
18422
|
-
return;
|
|
18423
|
-
} // In this case keydown is likely undefined, so we set it to false, since hotkeys needs the `keydown` key to have a value.
|
|
20076
|
+
/*--------------------------------------------------------------------------*/
|
|
18424
20077
|
|
|
20078
|
+
// Export platform.
|
|
20079
|
+
var platform = parse();
|
|
18425
20080
|
|
|
18426
|
-
|
|
18427
|
-
|
|
18428
|
-
|
|
20081
|
+
// Some AMD build optimizers, like r.js, check for condition patterns like the following:
|
|
20082
|
+
if (freeExports && freeModule) {
|
|
20083
|
+
// Export for CommonJS support.
|
|
20084
|
+
forOwn(platform, function (value, key) {
|
|
20085
|
+
freeExports[key] = value;
|
|
20086
|
+
});
|
|
20087
|
+
} else {
|
|
20088
|
+
// Export to the global object.
|
|
20089
|
+
root.platform = platform;
|
|
20090
|
+
}
|
|
20091
|
+
}).call(commonjsGlobal);
|
|
20092
|
+
})(platform$1, platform$1.exports);
|
|
20093
|
+
var platformExports = platform$1.exports;
|
|
20094
|
+
var platform = /*@__PURE__*/getDefaultExportFromCjs(platformExports);
|
|
20095
|
+
|
|
20096
|
+
var isMultipleHotkey = Array.isArray;
|
|
20097
|
+
var replaceKeys = function replaceKeys(hotkey, keyName, replaceWith) {
|
|
20098
|
+
return isMultipleHotkey(hotkey) ? hotkey.map(function (item) {
|
|
20099
|
+
return item.replaceAll(keyName, replaceWith);
|
|
20100
|
+
}) : hotkey.replaceAll(keyName, replaceWith);
|
|
20101
|
+
};
|
|
20102
|
+
var convertHotKeyToWindows = function convertHotKeyToWindows(hotkey) {
|
|
20103
|
+
ramda.toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(function (_ref) {
|
|
20104
|
+
var _ref2 = _slicedToArray$2(_ref, 2),
|
|
20105
|
+
macKey = _ref2[0],
|
|
20106
|
+
windowsKey = _ref2[1];
|
|
20107
|
+
hotkey = replaceKeys(hotkey, macKey, windowsKey);
|
|
20108
|
+
});
|
|
20109
|
+
return hotkey;
|
|
20110
|
+
};
|
|
20111
|
+
var convertHotkeyToUsersPlatform = function convertHotkeyToUsersPlatform(hotkey) {
|
|
20112
|
+
var _platformInfo$os;
|
|
20113
|
+
var platformInfo = platform.parse(navigator.userAgent);
|
|
20114
|
+
var isOSX = (_platformInfo$os = platformInfo.os) === null || _platformInfo$os === void 0 || (_platformInfo$os = _platformInfo$os.family) === null || _platformInfo$os === void 0 ? void 0 : _platformInfo$os.includes(OS.mac);
|
|
20115
|
+
if (isOSX) return replaceKeys(hotkey, KEY_NAMES["delete"], KEY_NAMES.backspace);
|
|
20116
|
+
return convertHotKeyToWindows(hotkey);
|
|
20117
|
+
};
|
|
20118
|
+
var bindHotKey = function bindHotKey(_ref3) {
|
|
20119
|
+
var mode = _ref3.mode,
|
|
20120
|
+
hotkey = _ref3.hotkey,
|
|
20121
|
+
handler = _ref3.handler,
|
|
20122
|
+
ref = _ref3.ref;
|
|
20123
|
+
var mousetrapInstance;
|
|
20124
|
+
switch (mode) {
|
|
20125
|
+
case MODES.global:
|
|
20126
|
+
Mousetrap$1.bindGlobal(hotkey, handler);
|
|
20127
|
+
break;
|
|
20128
|
+
case MODES.scoped:
|
|
20129
|
+
mousetrapInstance = Mousetrap$1(ref.current).bind(hotkey, handler);
|
|
20130
|
+
break;
|
|
20131
|
+
default:
|
|
20132
|
+
mousetrapInstance = Mousetrap$1.bind(hotkey, handler);
|
|
20133
|
+
}
|
|
20134
|
+
return mousetrapInstance;
|
|
20135
|
+
};
|
|
20136
|
+
var unBindHotKey = function unBindHotKey(_ref4) {
|
|
20137
|
+
var mousetrapInstance = _ref4.mousetrapInstance,
|
|
20138
|
+
mode = _ref4.mode,
|
|
20139
|
+
hotkey = _ref4.hotkey;
|
|
20140
|
+
return mode === MODES.global ? Mousetrap$1.unbindGlobal(hotkey) : mousetrapInstance === null || mousetrapInstance === void 0 ? void 0 : mousetrapInstance.unbind(hotkey);
|
|
20141
|
+
};
|
|
18429
20142
|
|
|
18430
|
-
|
|
20143
|
+
var useHotKeys = function useHotKeys(hotkey, handler, userConfig) {
|
|
20144
|
+
var ref = React$3.useRef(null);
|
|
20145
|
+
var convertedHotkey = convertHotkeyToUsersPlatform(hotkey);
|
|
20146
|
+
var config = ramda.mergeLeft(userConfig, DEFAULT_CONFIG);
|
|
20147
|
+
if (!handler) {
|
|
20148
|
+
throw new Error("You must provide a handler function to useHotKeys");
|
|
20149
|
+
}
|
|
20150
|
+
React$3.useEffect(function () {
|
|
20151
|
+
if (!config.enabled) return undefined;
|
|
20152
|
+
var mousetrapInstance = bindHotKey({
|
|
20153
|
+
mode: config.mode,
|
|
20154
|
+
hotkey: convertedHotkey,
|
|
20155
|
+
handler: handler,
|
|
20156
|
+
ref: ref
|
|
20157
|
+
});
|
|
18431
20158
|
return function () {
|
|
18432
|
-
|
|
20159
|
+
unBindHotKey({
|
|
20160
|
+
mousetrapInstance: mousetrapInstance,
|
|
20161
|
+
mode: config.mode,
|
|
20162
|
+
hotkey: convertedHotkey
|
|
20163
|
+
});
|
|
18433
20164
|
};
|
|
18434
|
-
}, [
|
|
18435
|
-
return ref;
|
|
18436
|
-
}
|
|
20165
|
+
}, [handler, config.mode, convertedHotkey, config]);
|
|
20166
|
+
return config.mode === MODES.scoped ? ref : null;
|
|
20167
|
+
};
|
|
18437
20168
|
|
|
18438
20169
|
var OverlayManager = /*#__PURE__*/function () {
|
|
18439
20170
|
function OverlayManager() {
|
|
@@ -18536,14 +20267,13 @@ var useOverlay = function useOverlay(_ref) {
|
|
|
18536
20267
|
}
|
|
18537
20268
|
};
|
|
18538
20269
|
var focusRequiredElementInOverlay = function focusRequiredElementInOverlay() {
|
|
18539
|
-
|
|
18540
|
-
|
|
18541
|
-
|
|
18542
|
-
|
|
18543
|
-
|
|
18544
|
-
|
|
18545
|
-
|
|
18546
|
-
}
|
|
20270
|
+
var _initialFocusRef;
|
|
20271
|
+
if (!hasTransitionCompleted) return;
|
|
20272
|
+
if ((_initialFocusRef = initialFocusRef) !== null && _initialFocusRef !== void 0 && _initialFocusRef.current) {
|
|
20273
|
+
var _initialFocusRef2;
|
|
20274
|
+
(_initialFocusRef2 = initialFocusRef) === null || _initialFocusRef2 === void 0 || (_initialFocusRef2 = _initialFocusRef2.current) === null || _initialFocusRef2 === void 0 || _initialFocusRef2.focus();
|
|
20275
|
+
} else {
|
|
20276
|
+
focusFirstFocusableElement(overlayWrapper);
|
|
18547
20277
|
}
|
|
18548
20278
|
};
|
|
18549
20279
|
var handleOverlayClose = React$3.useCallback(function () {
|
|
@@ -18555,9 +20285,9 @@ var useOverlay = function useOverlay(_ref) {
|
|
|
18555
20285
|
var isTopOverlay = React$3.useSyncExternalStore(manager.subscribe, function () {
|
|
18556
20286
|
return manager.isTopOverlay(overlayWrapper);
|
|
18557
20287
|
});
|
|
18558
|
-
|
|
18559
|
-
closeOnEsc
|
|
18560
|
-
}
|
|
20288
|
+
useHotKeys("escape", handleOverlayClose, {
|
|
20289
|
+
enabled: closeOnEsc
|
|
20290
|
+
});
|
|
18561
20291
|
React$3.useEffect(function () {
|
|
18562
20292
|
var cleanUp = noop$3;
|
|
18563
20293
|
if (isOpen) {
|
|
@@ -18598,12 +20328,12 @@ var useOverlayManager = function useOverlayManager(ref, isOpen) {
|
|
|
18598
20328
|
}, [isOpen, ref]);
|
|
18599
20329
|
};
|
|
18600
20330
|
|
|
18601
|
-
function ownKeys$
|
|
18602
|
-
function _objectSpread$
|
|
20331
|
+
function ownKeys$m(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20332
|
+
function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$m(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$m(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18603
20333
|
var useQueryParams = function useQueryParams() {
|
|
18604
20334
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18605
20335
|
var location = reactRouterDom.useLocation();
|
|
18606
|
-
return lib.parse(location.search, _objectSpread$
|
|
20336
|
+
return lib.parse(location.search, _objectSpread$l({
|
|
18607
20337
|
ignoreQueryPrefix: true
|
|
18608
20338
|
}, options));
|
|
18609
20339
|
};
|
|
@@ -18659,7 +20389,7 @@ var Footer$1 = function Footer(_ref) {
|
|
|
18659
20389
|
}, children);
|
|
18660
20390
|
};
|
|
18661
20391
|
|
|
18662
|
-
var _excluded$
|
|
20392
|
+
var _excluded$A = ["style", "weight", "lineHeight", "component", "children", "textTransform", "className"];
|
|
18663
20393
|
var FONT_WEIGHTS = {
|
|
18664
20394
|
thin: "thin",
|
|
18665
20395
|
extralight: "extralight",
|
|
@@ -18747,7 +20477,7 @@ var Typography = /*#__PURE__*/React__default["default"].forwardRef(function (_re
|
|
|
18747
20477
|
textTransform = _ref.textTransform,
|
|
18748
20478
|
_ref$className = _ref.className,
|
|
18749
20479
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
18750
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
20480
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$A);
|
|
18751
20481
|
var Component = component ? COMPONENTS[component] : style ? DEFAULT_COMPONENTS[style] : "p";
|
|
18752
20482
|
return /*#__PURE__*/React__default["default"].createElement(Component, _extends$4({
|
|
18753
20483
|
ref: ref,
|
|
@@ -18810,7 +20540,7 @@ var Header$1 = function Header(_ref) {
|
|
|
18810
20540
|
}, description)));
|
|
18811
20541
|
};
|
|
18812
20542
|
|
|
18813
|
-
var _excluded$
|
|
20543
|
+
var _excluded$z = ["size", "isOpen", "onClose", "children", "finalFocusRef", "initialFocusRef", "className", "closeOnEsc", "closeButton", "backdropClassName", "blockScrollOnMount", "closeOnOutsideClick"];
|
|
18814
20544
|
var SIZES$7 = {
|
|
18815
20545
|
small: "small",
|
|
18816
20546
|
medium: "medium",
|
|
@@ -18839,9 +20569,9 @@ var Modal = function Modal(_ref) {
|
|
|
18839
20569
|
blockScrollOnMount = _ref$blockScrollOnMou === void 0 ? true : _ref$blockScrollOnMou,
|
|
18840
20570
|
_ref$closeOnOutsideCl = _ref.closeOnOutsideClick,
|
|
18841
20571
|
closeOnOutsideClick = _ref$closeOnOutsideCl === void 0 ? true : _ref$closeOnOutsideCl,
|
|
18842
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
20572
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$z);
|
|
18843
20573
|
var _useState = React$3.useState(false),
|
|
18844
|
-
_useState2 = _slicedToArray$
|
|
20574
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
18845
20575
|
hasTransitionCompleted = _useState2[0],
|
|
18846
20576
|
setHasTransitionCompleted = _useState2[1];
|
|
18847
20577
|
var modalWrapper = React$3.useRef(null);
|
|
@@ -18997,15 +20727,15 @@ var Alert = function Alert(_ref) {
|
|
|
18997
20727
|
var build = {exports: {}};
|
|
18998
20728
|
|
|
18999
20729
|
(function (module, exports) {
|
|
19000
|
-
!function(e,t){module.exports=t(React__default["default"]);}(commonjsGlobal,(function(e){return function(e){var t={};function r(l){if(t[l])return t[l].exports;var i=t[l]={i:l,l:!1,exports:{}};return e[l].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,l){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l});},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(r.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(l,i,function(t){return e[t]}.bind(null,i));return l},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=1)}([function(t,r){t.exports=e;},function(e,t,r){e.exports=r(2);},function(e,t,r){function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,l);}return r}function a(e,t){if(null==e)return {};var r,l,i=function(e,t){if(null==e)return {};var r,l,i={},a=Object.keys(e);for(l=0;l<a.length;l++)r=a[l],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(l=0;l<a.length;l++)r=a[l],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);}return i}r.r(t);var n=r(0),c=r.n(n),h=function(e){for(var t=0,r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t&=t;}return Math.abs(t)},o=function(e,t){return Math.floor(e/Math.pow(10,t)%10)},s=function(e,t){return !(o(e,t)%2)},m=function(e,t,r){var l=e%t;return r&&o(e,r)%2===0?-l:l},f=function(e,t,r){return t[e%r]};var u=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:4},(function(e,i){return {color:f(r+i,t,l),translateX:m(r*(i+1),40-(i+17),1),translateY:m(r*(i+1),40-(i+17),2),rotate:m(r*(i+1),360),isSquare:s(r,2)}}))}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__bauhaus",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__bauhaus)"},n.createElement("rect",{width:80,height:80,fill:t[0].color}),n.createElement("rect",{x:10,y:30,width:80,height:t[1].isSquare?80:10,fill:t[1].color,transform:"translate("+t[1].translateX+" "+t[1].translateY+") rotate("+t[1].rotate+" 40 40)"}),n.createElement("circle",{cx:40,cy:40,fill:t[2].color,r:16,transform:"translate("+t[2].translateX+" "+t[2].translateY+")"}),n.createElement("line",{x1:0,y1:40,x2:80,y2:40,strokeWidth:2,stroke:t[3].color,transform:"translate("+t[3].translateX+" "+t[3].translateY+") rotate("+t[3].rotate+" 40 40)"})))};var d=function(e){var t=function(e,t){var r=h(t),l=e&&e.length,i=Array.from({length:5},(function(t,i){return f(r+i,e,l)})),a=[];return a[0]=i[0],a[1]=i[1],a[2]=i[1],a[3]=i[2],a[4]=i[2],a[5]=i[3],a[6]=i[3],a[7]=i[0],a[8]=i[4],a}(e.colors,e.name);return c.a.createElement("svg",{viewBox:"0 0 90 90",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&c.a.createElement("title",null,e.name),c.a.createElement("mask",{id:"mask__ring",maskUnits:"userSpaceOnUse",x:0,y:0,width:90,height:90},c.a.createElement("rect",{width:90,height:90,rx:e.square?void 0:180,fill:"#FFFFFF"})),c.a.createElement("g",{mask:"url(#mask__ring)"},c.a.createElement("path",{d:"M0 0h90v45H0z",fill:t[0]}),c.a.createElement("path",{d:"M0 45h90v45H0z",fill:t[1]}),c.a.createElement("path",{d:"M83 45a38 38 0 00-76 0h76z",fill:t[2]}),c.a.createElement("path",{d:"M83 45a38 38 0 01-76 0h76z",fill:t[3]}),c.a.createElement("path",{d:"M77 45a32 32 0 10-64 0h64z",fill:t[4]}),c.a.createElement("path",{d:"M77 45a32 32 0 11-64 0h64z",fill:t[5]}),c.a.createElement("path",{d:"M71 45a26 26 0 00-52 0h52z",fill:t[6]}),c.a.createElement("path",{d:"M71 45a26 26 0 01-52 0h52z",fill:t[7]}),c.a.createElement("circle",{cx:45,cy:45,r:23,fill:t[8]})))};var g=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:64},(function(e,i){return f(r%i,t,l)}))}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__pixel","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__pixel)"},n.createElement("rect",{width:10,height:10,fill:t[0]}),n.createElement("rect",{x:20,width:10,height:10,fill:t[1]}),n.createElement("rect",{x:40,width:10,height:10,fill:t[2]}),n.createElement("rect",{x:60,width:10,height:10,fill:t[3]}),n.createElement("rect",{x:10,width:10,height:10,fill:t[4]}),n.createElement("rect",{x:30,width:10,height:10,fill:t[5]}),n.createElement("rect",{x:50,width:10,height:10,fill:t[6]}),n.createElement("rect",{x:70,width:10,height:10,fill:t[7]}),n.createElement("rect",{y:10,width:10,height:10,fill:t[8]}),n.createElement("rect",{y:20,width:10,height:10,fill:t[9]}),n.createElement("rect",{y:30,width:10,height:10,fill:t[10]}),n.createElement("rect",{y:40,width:10,height:10,fill:t[11]}),n.createElement("rect",{y:50,width:10,height:10,fill:t[12]}),n.createElement("rect",{y:60,width:10,height:10,fill:t[13]}),n.createElement("rect",{y:70,width:10,height:10,fill:t[14]}),n.createElement("rect",{x:20,y:10,width:10,height:10,fill:t[15]}),n.createElement("rect",{x:20,y:20,width:10,height:10,fill:t[16]}),n.createElement("rect",{x:20,y:30,width:10,height:10,fill:t[17]}),n.createElement("rect",{x:20,y:40,width:10,height:10,fill:t[18]}),n.createElement("rect",{x:20,y:50,width:10,height:10,fill:t[19]}),n.createElement("rect",{x:20,y:60,width:10,height:10,fill:t[20]}),n.createElement("rect",{x:20,y:70,width:10,height:10,fill:t[21]}),n.createElement("rect",{x:40,y:10,width:10,height:10,fill:t[22]}),n.createElement("rect",{x:40,y:20,width:10,height:10,fill:t[23]}),n.createElement("rect",{x:40,y:30,width:10,height:10,fill:t[24]}),n.createElement("rect",{x:40,y:40,width:10,height:10,fill:t[25]}),n.createElement("rect",{x:40,y:50,width:10,height:10,fill:t[26]}),n.createElement("rect",{x:40,y:60,width:10,height:10,fill:t[27]}),n.createElement("rect",{x:40,y:70,width:10,height:10,fill:t[28]}),n.createElement("rect",{x:60,y:10,width:10,height:10,fill:t[29]}),n.createElement("rect",{x:60,y:20,width:10,height:10,fill:t[30]}),n.createElement("rect",{x:60,y:30,width:10,height:10,fill:t[31]}),n.createElement("rect",{x:60,y:40,width:10,height:10,fill:t[32]}),n.createElement("rect",{x:60,y:50,width:10,height:10,fill:t[33]}),n.createElement("rect",{x:60,y:60,width:10,height:10,fill:t[34]}),n.createElement("rect",{x:60,y:70,width:10,height:10,fill:t[35]}),n.createElement("rect",{x:10,y:10,width:10,height:10,fill:t[36]}),n.createElement("rect",{x:10,y:20,width:10,height:10,fill:t[37]}),n.createElement("rect",{x:10,y:30,width:10,height:10,fill:t[38]}),n.createElement("rect",{x:10,y:40,width:10,height:10,fill:t[39]}),n.createElement("rect",{x:10,y:50,width:10,height:10,fill:t[40]}),n.createElement("rect",{x:10,y:60,width:10,height:10,fill:t[41]}),n.createElement("rect",{x:10,y:70,width:10,height:10,fill:t[42]}),n.createElement("rect",{x:30,y:10,width:10,height:10,fill:t[43]}),n.createElement("rect",{x:30,y:20,width:10,height:10,fill:t[44]}),n.createElement("rect",{x:30,y:30,width:10,height:10,fill:t[45]}),n.createElement("rect",{x:30,y:40,width:10,height:10,fill:t[46]}),n.createElement("rect",{x:30,y:50,width:10,height:10,fill:t[47]}),n.createElement("rect",{x:30,y:60,width:10,height:10,fill:t[48]}),n.createElement("rect",{x:30,y:70,width:10,height:10,fill:t[49]}),n.createElement("rect",{x:50,y:10,width:10,height:10,fill:t[50]}),n.createElement("rect",{x:50,y:20,width:10,height:10,fill:t[51]}),n.createElement("rect",{x:50,y:30,width:10,height:10,fill:t[52]}),n.createElement("rect",{x:50,y:40,width:10,height:10,fill:t[53]}),n.createElement("rect",{x:50,y:50,width:10,height:10,fill:t[54]}),n.createElement("rect",{x:50,y:60,width:10,height:10,fill:t[55]}),n.createElement("rect",{x:50,y:70,width:10,height:10,fill:t[56]}),n.createElement("rect",{x:70,y:10,width:10,height:10,fill:t[57]}),n.createElement("rect",{x:70,y:20,width:10,height:10,fill:t[58]}),n.createElement("rect",{x:70,y:30,width:10,height:10,fill:t[59]}),n.createElement("rect",{x:70,y:40,width:10,height:10,fill:t[60]}),n.createElement("rect",{x:70,y:50,width:10,height:10,fill:t[61]}),n.createElement("rect",{x:70,y:60,width:10,height:10,fill:t[62]}),n.createElement("rect",{x:70,y:70,width:10,height:10,fill:t[63]})))};var w=function(e){var t=function(e,t){var r,l=h(e),i=t&&t.length,a=f(l,t,i),n=m(l,10,1),c=n<5?n+4:n,o=m(l,10,2),u=o<5?o+4:o;return {wrapperColor:a,faceColor:(r=a,"#"===r.slice(0,1)&&(r=r.slice(1)),(299*parseInt(r.substr(0,2),16)+587*parseInt(r.substr(2,2),16)+114*parseInt(r.substr(4,2),16))/1e3>=128?"#000000":"#FFFFFF"),backgroundColor:f(l+13,t,i),wrapperTranslateX:c,wrapperTranslateY:u,wrapperRotate:m(l,360),wrapperScale:1+m(l,3)/10,isMouthOpen:s(l,2),isCircle:s(l,1),eyeSpread:m(l,5),mouthSpread:m(l,3),faceRotate:m(l,10,3),faceTranslateX:c>6?c/2:m(l,8,1),faceTranslateY:u>6?u/2:m(l,7,2)}}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 36 36",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__beam",maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36},n.createElement("rect",{width:36,height:36,rx:e.square?void 0:72,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__beam)"},n.createElement("rect",{width:36,height:36,fill:t.backgroundColor}),n.createElement("rect",{x:"0",y:"0",width:36,height:36,transform:"translate("+t.wrapperTranslateX+" "+t.wrapperTranslateY+") rotate("+t.wrapperRotate+" 18 18) scale("+t.wrapperScale+")",fill:t.wrapperColor,rx:t.isCircle?36:6}),n.createElement("g",{transform:"translate("+t.faceTranslateX+" "+t.faceTranslateY+") rotate("+t.faceRotate+" 18 18)"},t.isMouthOpen?n.createElement("path",{d:"M15 "+(19+t.mouthSpread)+"c2 1 4 1 6 0",stroke:t.faceColor,fill:"none",strokeLinecap:"round"}):n.createElement("path",{d:"M13,"+(19+t.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:t.faceColor}),n.createElement("rect",{x:14-t.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:t.faceColor}),n.createElement("rect",{x:20+t.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:t.faceColor}))))};var E=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:4},(function(e,i){return f(r+i,t,l)}))}(e.name,e.colors),r=e.name.replace(/\s/g,"");return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__sunset",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__sunset)"},n.createElement("path",{fill:"url(#gradient_paint0_linear_"+r+")",d:"M0 0h80v40H0z"}),n.createElement("path",{fill:"url(#gradient_paint1_linear_"+r+")",d:"M0 40h80v40H0z"})),n.createElement("defs",null,n.createElement("linearGradient",{id:"gradient_paint0_linear_"+r,x1:40,y1:0,x2:40,y2:40,gradientUnits:"userSpaceOnUse"},n.createElement("stop",{stopColor:t[0]}),n.createElement("stop",{offset:1,stopColor:t[1]})),n.createElement("linearGradient",{id:"gradient_paint1_linear_"+r,x1:40,y1:40,x2:40,y2:80,gradientUnits:"userSpaceOnUse"},n.createElement("stop",{stopColor:t[2]}),n.createElement("stop",{offset:1,stopColor:t[3]}))))};var p=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:3},(function(e,i){return {color:f(r+i,t,l),translateX:m(r*(i+1),8,1),translateY:m(r*(i+1),8,2),scale:1.2+m(r*(i+1),4)/10,rotate:m(r*(i+1),360,1)}}))}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__marble",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__marble)"},n.createElement("rect",{width:80,height:80,fill:t[0].color}),n.createElement("path",{filter:"url(#prefix__filter0_f)",d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:t[1].color,transform:"translate("+t[1].translateX+" "+t[1].translateY+") rotate("+t[1].rotate+" 40 40) scale("+t[2].scale+")"}),n.createElement("path",{filter:"url(#prefix__filter0_f)",style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:t[2].color,transform:"translate("+t[2].translateX+" "+t[2].translateY+") rotate("+t[2].rotate+" 40 40) scale("+t[2].scale+")"})),n.createElement("defs",null,n.createElement("filter",{id:"prefix__filter0_f",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},n.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),n.createElement("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),n.createElement("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"}))))},y=["pixel","bauhaus","ring","beam","sunset","marble"],x={geometric:"beam",abstract:"bauhaus"},v=function(e){var t=e.variant,r=void 0===t?"marble":t,n=e.colors,h=void 0===n?["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"]:n,o=e.name,s=void 0===o?"Clara Barton":o,m=e.square,f=void 0!==m&&m,v=e.title,b=void 0!==v&&v,_=e.size,F=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){l(e,t,r[t]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t));}));}return e}({colors:h,name:s,title:b,size:void 0===_?40:_,square:f},a(e,["variant","colors","name","square","title","size"]));return {pixel:c.a.createElement(g,F),bauhaus:c.a.createElement(u,F),ring:c.a.createElement(d,F),beam:c.a.createElement(w,F),sunset:c.a.createElement(E,F),marble:c.a.createElement(p,F)}[Object.keys(x).includes(r)?x[r]:y.includes(r)?r:"marble"]};t.default=v;}])}));
|
|
20730
|
+
!function(e,t){module.exports=t(React__default["default"]);}(commonjsGlobal$1,(function(e){return function(e){var t={};function r(l){if(t[l])return t[l].exports;var i=t[l]={i:l,l:!1,exports:{}};return e[l].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,l){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l});},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(r.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(l,i,function(t){return e[t]}.bind(null,i));return l},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=1)}([function(t,r){t.exports=e;},function(e,t,r){e.exports=r(2);},function(e,t,r){function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,l);}return r}function a(e,t){if(null==e)return {};var r,l,i=function(e,t){if(null==e)return {};var r,l,i={},a=Object.keys(e);for(l=0;l<a.length;l++)r=a[l],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(l=0;l<a.length;l++)r=a[l],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);}return i}r.r(t);var n=r(0),c=r.n(n),h=function(e){for(var t=0,r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t&=t;}return Math.abs(t)},o=function(e,t){return Math.floor(e/Math.pow(10,t)%10)},s=function(e,t){return !(o(e,t)%2)},m=function(e,t,r){var l=e%t;return r&&o(e,r)%2===0?-l:l},f=function(e,t,r){return t[e%r]};var u=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:4},(function(e,i){return {color:f(r+i,t,l),translateX:m(r*(i+1),40-(i+17),1),translateY:m(r*(i+1),40-(i+17),2),rotate:m(r*(i+1),360),isSquare:s(r,2)}}))}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__bauhaus",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__bauhaus)"},n.createElement("rect",{width:80,height:80,fill:t[0].color}),n.createElement("rect",{x:10,y:30,width:80,height:t[1].isSquare?80:10,fill:t[1].color,transform:"translate("+t[1].translateX+" "+t[1].translateY+") rotate("+t[1].rotate+" 40 40)"}),n.createElement("circle",{cx:40,cy:40,fill:t[2].color,r:16,transform:"translate("+t[2].translateX+" "+t[2].translateY+")"}),n.createElement("line",{x1:0,y1:40,x2:80,y2:40,strokeWidth:2,stroke:t[3].color,transform:"translate("+t[3].translateX+" "+t[3].translateY+") rotate("+t[3].rotate+" 40 40)"})))};var d=function(e){var t=function(e,t){var r=h(t),l=e&&e.length,i=Array.from({length:5},(function(t,i){return f(r+i,e,l)})),a=[];return a[0]=i[0],a[1]=i[1],a[2]=i[1],a[3]=i[2],a[4]=i[2],a[5]=i[3],a[6]=i[3],a[7]=i[0],a[8]=i[4],a}(e.colors,e.name);return c.a.createElement("svg",{viewBox:"0 0 90 90",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&c.a.createElement("title",null,e.name),c.a.createElement("mask",{id:"mask__ring",maskUnits:"userSpaceOnUse",x:0,y:0,width:90,height:90},c.a.createElement("rect",{width:90,height:90,rx:e.square?void 0:180,fill:"#FFFFFF"})),c.a.createElement("g",{mask:"url(#mask__ring)"},c.a.createElement("path",{d:"M0 0h90v45H0z",fill:t[0]}),c.a.createElement("path",{d:"M0 45h90v45H0z",fill:t[1]}),c.a.createElement("path",{d:"M83 45a38 38 0 00-76 0h76z",fill:t[2]}),c.a.createElement("path",{d:"M83 45a38 38 0 01-76 0h76z",fill:t[3]}),c.a.createElement("path",{d:"M77 45a32 32 0 10-64 0h64z",fill:t[4]}),c.a.createElement("path",{d:"M77 45a32 32 0 11-64 0h64z",fill:t[5]}),c.a.createElement("path",{d:"M71 45a26 26 0 00-52 0h52z",fill:t[6]}),c.a.createElement("path",{d:"M71 45a26 26 0 01-52 0h52z",fill:t[7]}),c.a.createElement("circle",{cx:45,cy:45,r:23,fill:t[8]})))};var g=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:64},(function(e,i){return f(r%i,t,l)}))}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__pixel","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__pixel)"},n.createElement("rect",{width:10,height:10,fill:t[0]}),n.createElement("rect",{x:20,width:10,height:10,fill:t[1]}),n.createElement("rect",{x:40,width:10,height:10,fill:t[2]}),n.createElement("rect",{x:60,width:10,height:10,fill:t[3]}),n.createElement("rect",{x:10,width:10,height:10,fill:t[4]}),n.createElement("rect",{x:30,width:10,height:10,fill:t[5]}),n.createElement("rect",{x:50,width:10,height:10,fill:t[6]}),n.createElement("rect",{x:70,width:10,height:10,fill:t[7]}),n.createElement("rect",{y:10,width:10,height:10,fill:t[8]}),n.createElement("rect",{y:20,width:10,height:10,fill:t[9]}),n.createElement("rect",{y:30,width:10,height:10,fill:t[10]}),n.createElement("rect",{y:40,width:10,height:10,fill:t[11]}),n.createElement("rect",{y:50,width:10,height:10,fill:t[12]}),n.createElement("rect",{y:60,width:10,height:10,fill:t[13]}),n.createElement("rect",{y:70,width:10,height:10,fill:t[14]}),n.createElement("rect",{x:20,y:10,width:10,height:10,fill:t[15]}),n.createElement("rect",{x:20,y:20,width:10,height:10,fill:t[16]}),n.createElement("rect",{x:20,y:30,width:10,height:10,fill:t[17]}),n.createElement("rect",{x:20,y:40,width:10,height:10,fill:t[18]}),n.createElement("rect",{x:20,y:50,width:10,height:10,fill:t[19]}),n.createElement("rect",{x:20,y:60,width:10,height:10,fill:t[20]}),n.createElement("rect",{x:20,y:70,width:10,height:10,fill:t[21]}),n.createElement("rect",{x:40,y:10,width:10,height:10,fill:t[22]}),n.createElement("rect",{x:40,y:20,width:10,height:10,fill:t[23]}),n.createElement("rect",{x:40,y:30,width:10,height:10,fill:t[24]}),n.createElement("rect",{x:40,y:40,width:10,height:10,fill:t[25]}),n.createElement("rect",{x:40,y:50,width:10,height:10,fill:t[26]}),n.createElement("rect",{x:40,y:60,width:10,height:10,fill:t[27]}),n.createElement("rect",{x:40,y:70,width:10,height:10,fill:t[28]}),n.createElement("rect",{x:60,y:10,width:10,height:10,fill:t[29]}),n.createElement("rect",{x:60,y:20,width:10,height:10,fill:t[30]}),n.createElement("rect",{x:60,y:30,width:10,height:10,fill:t[31]}),n.createElement("rect",{x:60,y:40,width:10,height:10,fill:t[32]}),n.createElement("rect",{x:60,y:50,width:10,height:10,fill:t[33]}),n.createElement("rect",{x:60,y:60,width:10,height:10,fill:t[34]}),n.createElement("rect",{x:60,y:70,width:10,height:10,fill:t[35]}),n.createElement("rect",{x:10,y:10,width:10,height:10,fill:t[36]}),n.createElement("rect",{x:10,y:20,width:10,height:10,fill:t[37]}),n.createElement("rect",{x:10,y:30,width:10,height:10,fill:t[38]}),n.createElement("rect",{x:10,y:40,width:10,height:10,fill:t[39]}),n.createElement("rect",{x:10,y:50,width:10,height:10,fill:t[40]}),n.createElement("rect",{x:10,y:60,width:10,height:10,fill:t[41]}),n.createElement("rect",{x:10,y:70,width:10,height:10,fill:t[42]}),n.createElement("rect",{x:30,y:10,width:10,height:10,fill:t[43]}),n.createElement("rect",{x:30,y:20,width:10,height:10,fill:t[44]}),n.createElement("rect",{x:30,y:30,width:10,height:10,fill:t[45]}),n.createElement("rect",{x:30,y:40,width:10,height:10,fill:t[46]}),n.createElement("rect",{x:30,y:50,width:10,height:10,fill:t[47]}),n.createElement("rect",{x:30,y:60,width:10,height:10,fill:t[48]}),n.createElement("rect",{x:30,y:70,width:10,height:10,fill:t[49]}),n.createElement("rect",{x:50,y:10,width:10,height:10,fill:t[50]}),n.createElement("rect",{x:50,y:20,width:10,height:10,fill:t[51]}),n.createElement("rect",{x:50,y:30,width:10,height:10,fill:t[52]}),n.createElement("rect",{x:50,y:40,width:10,height:10,fill:t[53]}),n.createElement("rect",{x:50,y:50,width:10,height:10,fill:t[54]}),n.createElement("rect",{x:50,y:60,width:10,height:10,fill:t[55]}),n.createElement("rect",{x:50,y:70,width:10,height:10,fill:t[56]}),n.createElement("rect",{x:70,y:10,width:10,height:10,fill:t[57]}),n.createElement("rect",{x:70,y:20,width:10,height:10,fill:t[58]}),n.createElement("rect",{x:70,y:30,width:10,height:10,fill:t[59]}),n.createElement("rect",{x:70,y:40,width:10,height:10,fill:t[60]}),n.createElement("rect",{x:70,y:50,width:10,height:10,fill:t[61]}),n.createElement("rect",{x:70,y:60,width:10,height:10,fill:t[62]}),n.createElement("rect",{x:70,y:70,width:10,height:10,fill:t[63]})))};var w=function(e){var t=function(e,t){var r,l=h(e),i=t&&t.length,a=f(l,t,i),n=m(l,10,1),c=n<5?n+4:n,o=m(l,10,2),u=o<5?o+4:o;return {wrapperColor:a,faceColor:(r=a,"#"===r.slice(0,1)&&(r=r.slice(1)),(299*parseInt(r.substr(0,2),16)+587*parseInt(r.substr(2,2),16)+114*parseInt(r.substr(4,2),16))/1e3>=128?"#000000":"#FFFFFF"),backgroundColor:f(l+13,t,i),wrapperTranslateX:c,wrapperTranslateY:u,wrapperRotate:m(l,360),wrapperScale:1+m(l,3)/10,isMouthOpen:s(l,2),isCircle:s(l,1),eyeSpread:m(l,5),mouthSpread:m(l,3),faceRotate:m(l,10,3),faceTranslateX:c>6?c/2:m(l,8,1),faceTranslateY:u>6?u/2:m(l,7,2)}}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 36 36",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__beam",maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36},n.createElement("rect",{width:36,height:36,rx:e.square?void 0:72,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__beam)"},n.createElement("rect",{width:36,height:36,fill:t.backgroundColor}),n.createElement("rect",{x:"0",y:"0",width:36,height:36,transform:"translate("+t.wrapperTranslateX+" "+t.wrapperTranslateY+") rotate("+t.wrapperRotate+" 18 18) scale("+t.wrapperScale+")",fill:t.wrapperColor,rx:t.isCircle?36:6}),n.createElement("g",{transform:"translate("+t.faceTranslateX+" "+t.faceTranslateY+") rotate("+t.faceRotate+" 18 18)"},t.isMouthOpen?n.createElement("path",{d:"M15 "+(19+t.mouthSpread)+"c2 1 4 1 6 0",stroke:t.faceColor,fill:"none",strokeLinecap:"round"}):n.createElement("path",{d:"M13,"+(19+t.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:t.faceColor}),n.createElement("rect",{x:14-t.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:t.faceColor}),n.createElement("rect",{x:20+t.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:t.faceColor}))))};var E=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:4},(function(e,i){return f(r+i,t,l)}))}(e.name,e.colors),r=e.name.replace(/\s/g,"");return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__sunset",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__sunset)"},n.createElement("path",{fill:"url(#gradient_paint0_linear_"+r+")",d:"M0 0h80v40H0z"}),n.createElement("path",{fill:"url(#gradient_paint1_linear_"+r+")",d:"M0 40h80v40H0z"})),n.createElement("defs",null,n.createElement("linearGradient",{id:"gradient_paint0_linear_"+r,x1:40,y1:0,x2:40,y2:40,gradientUnits:"userSpaceOnUse"},n.createElement("stop",{stopColor:t[0]}),n.createElement("stop",{offset:1,stopColor:t[1]})),n.createElement("linearGradient",{id:"gradient_paint1_linear_"+r,x1:40,y1:40,x2:40,y2:80,gradientUnits:"userSpaceOnUse"},n.createElement("stop",{stopColor:t[2]}),n.createElement("stop",{offset:1,stopColor:t[3]}))))};var p=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:3},(function(e,i){return {color:f(r+i,t,l),translateX:m(r*(i+1),8,1),translateY:m(r*(i+1),8,2),scale:1.2+m(r*(i+1),4)/10,rotate:m(r*(i+1),360,1)}}))}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__marble",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__marble)"},n.createElement("rect",{width:80,height:80,fill:t[0].color}),n.createElement("path",{filter:"url(#prefix__filter0_f)",d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:t[1].color,transform:"translate("+t[1].translateX+" "+t[1].translateY+") rotate("+t[1].rotate+" 40 40) scale("+t[2].scale+")"}),n.createElement("path",{filter:"url(#prefix__filter0_f)",style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:t[2].color,transform:"translate("+t[2].translateX+" "+t[2].translateY+") rotate("+t[2].rotate+" 40 40) scale("+t[2].scale+")"})),n.createElement("defs",null,n.createElement("filter",{id:"prefix__filter0_f",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},n.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),n.createElement("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),n.createElement("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"}))))},y=["pixel","bauhaus","ring","beam","sunset","marble"],x={geometric:"beam",abstract:"bauhaus"},v=function(e){var t=e.variant,r=void 0===t?"marble":t,n=e.colors,h=void 0===n?["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"]:n,o=e.name,s=void 0===o?"Clara Barton":o,m=e.square,f=void 0!==m&&m,v=e.title,b=void 0!==v&&v,_=e.size,F=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){l(e,t,r[t]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t));}));}return e}({colors:h,name:s,title:b,size:void 0===_?40:_,square:f},a(e,["variant","colors","name","square","title","size"]));return {pixel:c.a.createElement(g,F),bauhaus:c.a.createElement(u,F),ring:c.a.createElement(d,F),beam:c.a.createElement(w,F),sunset:c.a.createElement(E,F),marble:c.a.createElement(p,F)}[Object.keys(x).includes(r)?x[r]:y.includes(r)?r:"marble"]};t.default=v;}])}));
|
|
19001
20731
|
} (build));
|
|
19002
20732
|
|
|
19003
|
-
var FallbackAvatar = /*@__PURE__*/getDefaultExportFromCjs(build.exports);
|
|
20733
|
+
var FallbackAvatar = /*@__PURE__*/getDefaultExportFromCjs$1(build.exports);
|
|
19004
20734
|
|
|
19005
20735
|
var COLOR_PALLETE = ["#ffb5a7", "#fcd5ce", "#f8edeb", "#f9dcc4", "#fec89a"];
|
|
19006
20736
|
var AVATAR_VARIANT = "beam";
|
|
19007
20737
|
|
|
19008
|
-
var _excluded$
|
|
20738
|
+
var _excluded$y = ["size", "user", "status", "onClick", "className", "showTooltip", "tooltipProps"];
|
|
19009
20739
|
var SIZE = {
|
|
19010
20740
|
small: 24,
|
|
19011
20741
|
medium: 32,
|
|
@@ -19027,9 +20757,9 @@ var Avatar = function Avatar(_ref) {
|
|
|
19027
20757
|
showTooltip = _ref$showTooltip === void 0 ? false : _ref$showTooltip,
|
|
19028
20758
|
_ref$tooltipProps = _ref.tooltipProps,
|
|
19029
20759
|
tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
|
|
19030
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
20760
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$y);
|
|
19031
20761
|
var _useState = React$3.useState(false),
|
|
19032
|
-
_useState2 = _slicedToArray$
|
|
20762
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
19033
20763
|
isLoadingFailed = _useState2[0],
|
|
19034
20764
|
setIsLoadingFailed = _useState2[1];
|
|
19035
20765
|
var _user$name = user.name,
|
|
@@ -19042,7 +20772,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
19042
20772
|
"neeto-ui-avatar__container--medium": isMedium,
|
|
19043
20773
|
"neeto-ui-avatar__container--large": isLarge,
|
|
19044
20774
|
"neeto-ui-avatar__container--xlarge": isExtraLarge
|
|
19045
|
-
},
|
|
20775
|
+
}, className);
|
|
19046
20776
|
var imageClasses = classnames$1("neeto-ui-avatar", {
|
|
19047
20777
|
"neeto-ui-avatar--medium": isMedium,
|
|
19048
20778
|
"neeto-ui-avatar--large": isLarge,
|
|
@@ -19067,13 +20797,13 @@ var Avatar = function Avatar(_ref) {
|
|
|
19067
20797
|
disabled: !showTooltip,
|
|
19068
20798
|
position: "bottom"
|
|
19069
20799
|
}, tooltipProps), /*#__PURE__*/React__default["default"].createElement("span", _extends$4({
|
|
20800
|
+
onClick: onClick,
|
|
19070
20801
|
className: containerClasses,
|
|
19071
|
-
"data-testid": "avatar"
|
|
19072
|
-
onClick: onClick
|
|
20802
|
+
"data-testid": "avatar"
|
|
19073
20803
|
}, otherProps), /*#__PURE__*/React__default["default"].createElement(Indicator, null), shouldDisplayFallbackAvatar ? /*#__PURE__*/React__default["default"].createElement(FallbackAvatar, {
|
|
20804
|
+
name: name,
|
|
19074
20805
|
className: "neeto-ui-avatar__svg",
|
|
19075
20806
|
colors: COLOR_PALLETE,
|
|
19076
|
-
name: name,
|
|
19077
20807
|
size: SIZE[size],
|
|
19078
20808
|
variant: AVATAR_VARIANT
|
|
19079
20809
|
}) : /*#__PURE__*/React__default["default"].createElement("img", {
|
|
@@ -19086,7 +20816,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
19086
20816
|
})));
|
|
19087
20817
|
};
|
|
19088
20818
|
|
|
19089
|
-
var _excluded$
|
|
20819
|
+
var _excluded$x = ["icon", "style", "className", "children"];
|
|
19090
20820
|
var STYLES$2 = {
|
|
19091
20821
|
info: "info",
|
|
19092
20822
|
warning: "warning",
|
|
@@ -19101,7 +20831,7 @@ var Callout = function Callout(_ref) {
|
|
|
19101
20831
|
_ref$className = _ref.className,
|
|
19102
20832
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
19103
20833
|
children = _ref.children,
|
|
19104
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
20834
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$x);
|
|
19105
20835
|
var Icon = icon;
|
|
19106
20836
|
return /*#__PURE__*/React__default["default"].createElement("div", _extends$4({
|
|
19107
20837
|
className: classnames$1("neeto-ui-callout", _defineProperty$7({
|
|
@@ -19116,7 +20846,7 @@ var Callout = function Callout(_ref) {
|
|
|
19116
20846
|
}, /*#__PURE__*/React__default["default"].createElement(Icon, null)), children);
|
|
19117
20847
|
};
|
|
19118
20848
|
|
|
19119
|
-
var _excluded$
|
|
20849
|
+
var _excluded$w = ["children", "className", "required", "helpIconProps"],
|
|
19120
20850
|
_excluded2$4 = ["onClick", "icon", "tooltipProps", "className"];
|
|
19121
20851
|
var Label = function Label(_ref) {
|
|
19122
20852
|
var children = _ref.children,
|
|
@@ -19126,7 +20856,7 @@ var Label = function Label(_ref) {
|
|
|
19126
20856
|
required = _ref$required === void 0 ? false : _ref$required,
|
|
19127
20857
|
_ref$helpIconProps = _ref.helpIconProps,
|
|
19128
20858
|
helpIconProps = _ref$helpIconProps === void 0 ? null : _ref$helpIconProps,
|
|
19129
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
20859
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$w);
|
|
19130
20860
|
var _ref2 = helpIconProps || {},
|
|
19131
20861
|
onClick = _ref2.onClick,
|
|
19132
20862
|
icon = _ref2.icon,
|
|
@@ -19148,7 +20878,7 @@ var Label = function Label(_ref) {
|
|
|
19148
20878
|
}, otherHelpIconProps)))));
|
|
19149
20879
|
};
|
|
19150
20880
|
|
|
19151
|
-
var _excluded$
|
|
20881
|
+
var _excluded$v = ["label", "error", "className", "required", "labelProps", "children"];
|
|
19152
20882
|
var Checkbox = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
19153
20883
|
var _ref$label = _ref.label,
|
|
19154
20884
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
@@ -19160,7 +20890,7 @@ var Checkbox = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
19160
20890
|
required = _ref$required === void 0 ? false : _ref$required,
|
|
19161
20891
|
labelProps = _ref.labelProps,
|
|
19162
20892
|
children = _ref.children,
|
|
19163
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
20893
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$v);
|
|
19164
20894
|
var id = useId(otherProps.id);
|
|
19165
20895
|
var errorId = "error_".concat(id);
|
|
19166
20896
|
var renderLabel = label || children;
|
|
@@ -20809,7 +22539,7 @@ var ColorPicker = function ColorPicker(_ref) {
|
|
|
20809
22539
|
_ref$showPicker = _ref.showPicker,
|
|
20810
22540
|
showPicker = _ref$showPicker === void 0 ? true : _ref$showPicker;
|
|
20811
22541
|
var _useState = React$3.useState(color),
|
|
20812
|
-
_useState2 = _slicedToArray$
|
|
22542
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
20813
22543
|
colorInternal = _useState2[0],
|
|
20814
22544
|
setColorInternal = _useState2[1];
|
|
20815
22545
|
var isInputChanged = React$3.useRef(false);
|
|
@@ -20948,9 +22678,9 @@ var ColorPicker = function ColorPicker(_ref) {
|
|
|
20948
22678
|
}, /*#__PURE__*/React__default["default"].createElement(Palette, colorPaletteProps))));
|
|
20949
22679
|
};
|
|
20950
22680
|
|
|
20951
|
-
var _excluded$
|
|
20952
|
-
function ownKeys$
|
|
20953
|
-
function _objectSpread$
|
|
22681
|
+
var _excluded$u = ["className", "label", "size", "dropdownClassName", "popupClassName", "dateFormat", "timeFormat", "onChange", "onOk", "picker", "showTime", "type", "nakedInput", "error", "defaultValue", "value", "labelProps", "required"];
|
|
22682
|
+
function ownKeys$l(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22683
|
+
function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$l(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$l(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20954
22684
|
var INPUT_SIZES$2 = {
|
|
20955
22685
|
small: "small",
|
|
20956
22686
|
medium: "medium",
|
|
@@ -21004,7 +22734,7 @@ var DatePicker = /*#__PURE__*/React$3.forwardRef(function (_ref2, ref) {
|
|
|
21004
22734
|
labelProps = _ref2.labelProps,
|
|
21005
22735
|
_ref2$required = _ref2.required,
|
|
21006
22736
|
required = _ref2$required === void 0 ? false : _ref2$required,
|
|
21007
|
-
otherProps = _objectWithoutProperties$1(_ref2, _excluded$
|
|
22737
|
+
otherProps = _objectWithoutProperties$1(_ref2, _excluded$u);
|
|
21008
22738
|
var id = useId(otherProps.id);
|
|
21009
22739
|
var datePickerRef = useSyncedRef(ref);
|
|
21010
22740
|
var Component = datePickerTypes[type === null || type === void 0 ? void 0 : type.toLowerCase()];
|
|
@@ -21015,7 +22745,7 @@ var DatePicker = /*#__PURE__*/React$3.forwardRef(function (_ref2, ref) {
|
|
|
21015
22745
|
};
|
|
21016
22746
|
return /*#__PURE__*/React__default["default"].createElement(_ConfigProvider__default["default"], {
|
|
21017
22747
|
theme: {
|
|
21018
|
-
token: _objectSpread$
|
|
22748
|
+
token: _objectSpread$k({}, ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES),
|
|
21019
22749
|
components: {
|
|
21020
22750
|
DatePicker: {
|
|
21021
22751
|
activeBg: "rgb(var(--neeto-ui-white))",
|
|
@@ -21066,7 +22796,7 @@ var DatePicker = /*#__PURE__*/React$3.forwardRef(function (_ref2, ref) {
|
|
|
21066
22796
|
}
|
|
21067
22797
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21068
22798
|
className: "neeto-ui-input__wrapper"
|
|
21069
|
-
}, label && /*#__PURE__*/React__default["default"].createElement(Label, _objectSpread$
|
|
22799
|
+
}, label && /*#__PURE__*/React__default["default"].createElement(Label, _objectSpread$k({
|
|
21070
22800
|
required: required
|
|
21071
22801
|
}, labelProps), label), /*#__PURE__*/React__default["default"].createElement(Component, _extends$4({
|
|
21072
22802
|
format: format,
|
|
@@ -21113,7 +22843,7 @@ var DatePicker = /*#__PURE__*/React$3.forwardRef(function (_ref2, ref) {
|
|
|
21113
22843
|
size: 16
|
|
21114
22844
|
})
|
|
21115
22845
|
}
|
|
21116
|
-
})), !!error && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
22846
|
+
})), !!error && typeof error === "string" && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
21117
22847
|
className: "neeto-ui-input__error",
|
|
21118
22848
|
"data-cy": "".concat(hyphenize(label), "-input-error"),
|
|
21119
22849
|
id: errorId
|
|
@@ -21121,6 +22851,106 @@ var DatePicker = /*#__PURE__*/React$3.forwardRef(function (_ref2, ref) {
|
|
|
21121
22851
|
});
|
|
21122
22852
|
DatePicker.displayName = "DatePicker";
|
|
21123
22853
|
|
|
22854
|
+
var customParseFormat$1 = {exports: {}};
|
|
22855
|
+
|
|
22856
|
+
(function (module, exports) {
|
|
22857
|
+
!function(e,t){module.exports=t();}(commonjsGlobal$1,(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return (e=+e)+(e>68?1900:2e3)};var a=function(e){return function(t){this[e]=+t;}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e);}],h=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},d={A:[i,function(e){this.afternoon=u(e,!1);}],a:[i,function(e){this.afternoon=u(e,!0);}],S:[/\d/,function(e){this.milliseconds=100*+e;}],SS:[n,function(e){this.milliseconds=10*+e;}],SSS:[/\d{3}/,function(e){this.milliseconds=+e;}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r);}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(e){var t=h("months"),n=(h("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n;}],MMMM:[i,function(e){var t=h("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t;}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e);}],YYYY:[/\d{4}/,a("year")],Z:f,ZZ:f};function c(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=s.length,f=0;f<a;f+=1){var h=s[f],u=d[h],c=u&&u[0],l=u&&u[1];s[f]=l?{regex:c,parser:l}:h.replace(/^\[|\]$/g,"");}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=s[n];if("string"==typeof i)r+=i.length;else {var o=i.regex,f=i.parser,h=e.slice(r),u=o.exec(h)[0];f.call(t,u),e=e.replace(u,"");}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon;}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,s=e.args;this.$u=r;var a=s[1];if("string"==typeof a){var f=!0===s[2],h=!0===s[3],u=f||h,d=s[2];h&&(d=s[2]),o=this.$locale(),!f&&d&&(o=n.Ls[d]),this.$d=function(e,t,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=c(t)(e),i=r.year,o=r.month,s=r.day,a=r.hours,f=r.minutes,h=r.seconds,u=r.milliseconds,d=r.zone,l=new Date,m=s||(i||o?1:l.getDate()),M=i||l.getFullYear(),Y=0;i&&!o||(Y=o>0?o-1:l.getMonth());var p=a||0,v=f||0,D=h||0,g=u||0;return d?new Date(Date.UTC(M,Y,m,p,v,D,g+60*d.offset*1e3)):n?new Date(Date.UTC(M,Y,m,p,v,D,g)):new Date(M,Y,m,p,v,D,g)}catch(e){return new Date("")}}(t,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),o={};}else if(a instanceof Array)for(var l=a.length,m=1;m<=l;m+=1){s[1]=a[m-1];var M=n.apply(this,s);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===l&&(this.$d=new Date(""));}else i.call(this,e);};}}));
|
|
22858
|
+
} (customParseFormat$1));
|
|
22859
|
+
|
|
22860
|
+
var customParseFormat = customParseFormat$1.exports;
|
|
22861
|
+
|
|
22862
|
+
var _excluded$t = ["className", "label", "size", "dropdownClassName", "popupClassName", "dateFormat", "onChange", "nakedInput", "error", "defaultValue", "value", "labelProps", "required"];
|
|
22863
|
+
function ownKeys$k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22864
|
+
function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$k(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22865
|
+
dayjs.extend(customParseFormat);
|
|
22866
|
+
var DateTimePicker = function DateTimePicker(_ref) {
|
|
22867
|
+
var _ref$className = _ref.className,
|
|
22868
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
22869
|
+
_ref$label = _ref.label,
|
|
22870
|
+
label = _ref$label === void 0 ? "" : _ref$label,
|
|
22871
|
+
size = _ref.size,
|
|
22872
|
+
dropdownClassName = _ref.dropdownClassName,
|
|
22873
|
+
popupClassName = _ref.popupClassName,
|
|
22874
|
+
dateFormat = _ref.dateFormat,
|
|
22875
|
+
_ref$onChange = _ref.onChange,
|
|
22876
|
+
onChange = _ref$onChange === void 0 ? noop$3 : _ref$onChange,
|
|
22877
|
+
_ref$nakedInput = _ref.nakedInput,
|
|
22878
|
+
nakedInput = _ref$nakedInput === void 0 ? false : _ref$nakedInput,
|
|
22879
|
+
_ref$error = _ref.error,
|
|
22880
|
+
error = _ref$error === void 0 ? "" : _ref$error,
|
|
22881
|
+
defaultValue = _ref.defaultValue,
|
|
22882
|
+
value = _ref.value,
|
|
22883
|
+
labelProps = _ref.labelProps,
|
|
22884
|
+
_ref$required = _ref.required,
|
|
22885
|
+
required = _ref$required === void 0 ? false : _ref$required,
|
|
22886
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$t);
|
|
22887
|
+
var _React$useState = React__default["default"].useState(false),
|
|
22888
|
+
_React$useState2 = _slicedToArray$3(_React$useState, 2),
|
|
22889
|
+
open = _React$useState2[0],
|
|
22890
|
+
setOpen = _React$useState2[1];
|
|
22891
|
+
var _useState = React$3.useState(),
|
|
22892
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
22893
|
+
date = _useState2[0],
|
|
22894
|
+
setDate = _useState2[1];
|
|
22895
|
+
var _useState3 = React$3.useState(),
|
|
22896
|
+
_useState4 = _slicedToArray$3(_useState3, 2),
|
|
22897
|
+
time = _useState4[0],
|
|
22898
|
+
setTime = _useState4[1];
|
|
22899
|
+
var timeRef = React__default["default"].useRef(null);
|
|
22900
|
+
var id = useId(otherProps.id);
|
|
22901
|
+
var errorId = "error_".concat(id);
|
|
22902
|
+
var handleDateChange = function handleDateChange(date) {
|
|
22903
|
+
var _timeRef$current;
|
|
22904
|
+
setDate(date);
|
|
22905
|
+
setTime(date);
|
|
22906
|
+
setOpen(false);
|
|
22907
|
+
onChange(date);
|
|
22908
|
+
(_timeRef$current = timeRef.current) === null || _timeRef$current === void 0 || _timeRef$current.querySelector(".react-time-picker__inputGroup__hour").focus();
|
|
22909
|
+
};
|
|
22910
|
+
var handleTimeChange = function handleTimeChange(_, value) {
|
|
22911
|
+
var currentTime = dayjs(value, "HH:mm");
|
|
22912
|
+
setTime(value ? currentTime : null);
|
|
22913
|
+
var dateTIme = dayjs("".concat(date === null || date === void 0 ? void 0 : date.format("YYYY-MM-DD"), " ").concat(value || ""));
|
|
22914
|
+
onChange(dateTIme);
|
|
22915
|
+
};
|
|
22916
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22917
|
+
className: "neeto-ui-input__wrapper"
|
|
22918
|
+
}, label && /*#__PURE__*/React__default["default"].createElement(Label, _objectSpread$j({
|
|
22919
|
+
required: required
|
|
22920
|
+
}, labelProps), label), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22921
|
+
className: classnames$1("neeto-ui-date-time-input", className)
|
|
22922
|
+
}, /*#__PURE__*/React__default["default"].createElement(DatePicker, {
|
|
22923
|
+
dateFormat: dateFormat,
|
|
22924
|
+
defaultValue: defaultValue,
|
|
22925
|
+
dropdownClassName: dropdownClassName,
|
|
22926
|
+
nakedInput: nakedInput,
|
|
22927
|
+
open: open,
|
|
22928
|
+
popupClassName: popupClassName,
|
|
22929
|
+
size: size,
|
|
22930
|
+
value: value,
|
|
22931
|
+
error: !!error,
|
|
22932
|
+
picker: "date",
|
|
22933
|
+
showTime: false,
|
|
22934
|
+
type: "date",
|
|
22935
|
+
onBlur: function onBlur() {
|
|
22936
|
+
return setOpen(false);
|
|
22937
|
+
},
|
|
22938
|
+
onChange: handleDateChange,
|
|
22939
|
+
onFocus: function onFocus() {
|
|
22940
|
+
return setOpen(true);
|
|
22941
|
+
}
|
|
22942
|
+
}), /*#__PURE__*/React__default["default"].createElement(TimePickerInput, _defineProperty$7(_defineProperty$7(_defineProperty$7(_defineProperty$7({
|
|
22943
|
+
error: error,
|
|
22944
|
+
nakedInput: nakedInput,
|
|
22945
|
+
size: size
|
|
22946
|
+
}, "error", !!error), "ref", timeRef), "value", time), "onChange", handleTimeChange))), !!error && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
22947
|
+
className: "neeto-ui-input__error",
|
|
22948
|
+
"data-cy": "".concat(hyphenize(label), "-input-error"),
|
|
22949
|
+
id: errorId
|
|
22950
|
+
}, error));
|
|
22951
|
+
};
|
|
22952
|
+
DateTimePicker.displayName = "DateTimePicker";
|
|
22953
|
+
|
|
21124
22954
|
var _excluded$s = ["size", "type", "label", "error", "suffix", "prefix", "disabled", "helpText", "className", "nakedInput", "contentSize", "required", "maxLength", "unlimitedChars", "labelProps", "rejectCharsRegex", "onBlur", "disableTrimOnBlur"];
|
|
21125
22955
|
function ownKeys$j(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21126
22956
|
function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$j(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -21165,7 +22995,7 @@ var Input$3 = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
21165
22995
|
disableTrimOnBlur = _ref$disableTrimOnBlu === void 0 ? false : _ref$disableTrimOnBlu,
|
|
21166
22996
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$s);
|
|
21167
22997
|
var _useState = React$3.useState(otherProps.value),
|
|
21168
|
-
_useState2 = _slicedToArray$
|
|
22998
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
21169
22999
|
valueInternal = _useState2[0],
|
|
21170
23000
|
setValueInternal = _useState2[1];
|
|
21171
23001
|
var id = useId(otherProps.id);
|
|
@@ -21189,11 +23019,15 @@ var Input$3 = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
21189
23019
|
onChange(e);
|
|
21190
23020
|
};
|
|
21191
23021
|
var handleChange = rejectCharsRegex ? handleRegexChange : onChange;
|
|
23022
|
+
var handleTrimmedChangeOnBlur = function handleTrimmedChangeOnBlur(e) {
|
|
23023
|
+
if (disableTrimOnBlur || typeof value !== "string") return;
|
|
23024
|
+
var trimmedValue = value.trim();
|
|
23025
|
+
if (value === trimmedValue) return;
|
|
23026
|
+
e.target.value = trimmedValue;
|
|
23027
|
+
handleChange(e);
|
|
23028
|
+
};
|
|
21192
23029
|
var handleOnBlur = function handleOnBlur(e) {
|
|
21193
|
-
|
|
21194
|
-
e.target.value = value.trim();
|
|
21195
|
-
handleChange(e);
|
|
21196
|
-
}
|
|
23030
|
+
handleTrimmedChangeOnBlur(e);
|
|
21197
23031
|
onBlur === null || onBlur === void 0 || onBlur(e);
|
|
21198
23032
|
};
|
|
21199
23033
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -21265,7 +23099,7 @@ var Kbd = function Kbd(_ref) {
|
|
|
21265
23099
|
};
|
|
21266
23100
|
|
|
21267
23101
|
function _arrayWithoutHoles$1(arr) {
|
|
21268
|
-
if (Array.isArray(arr)) return _arrayLikeToArray$
|
|
23102
|
+
if (Array.isArray(arr)) return _arrayLikeToArray$3(arr);
|
|
21269
23103
|
}
|
|
21270
23104
|
|
|
21271
23105
|
function _iterableToArray$1(iter) {
|
|
@@ -21277,7 +23111,7 @@ function _nonIterableSpread$1() {
|
|
|
21277
23111
|
}
|
|
21278
23112
|
|
|
21279
23113
|
function _toConsumableArray$1(arr) {
|
|
21280
|
-
return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$
|
|
23114
|
+
return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$3(arr) || _nonIterableSpread$1();
|
|
21281
23115
|
}
|
|
21282
23116
|
|
|
21283
23117
|
function _extends$2() {
|
|
@@ -27919,7 +29753,7 @@ var CreatableSelect = /*#__PURE__*/React$3.forwardRef(function (props, ref) {
|
|
|
27919
29753
|
});
|
|
27920
29754
|
|
|
27921
29755
|
function _toArray(arr) {
|
|
27922
|
-
return _arrayWithHoles$
|
|
29756
|
+
return _arrayWithHoles$3(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$3(arr) || _nonIterableRest$3();
|
|
27923
29757
|
}
|
|
27924
29758
|
|
|
27925
29759
|
var StateManagedSelect = /*#__PURE__*/React$3.forwardRef(function (props, ref) {
|
|
@@ -28161,11 +29995,11 @@ var MultiEmailInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
28161
29995
|
visibleEmailsCount = _ref$visibleEmailsCou === void 0 ? 3 : _ref$visibleEmailsCou,
|
|
28162
29996
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$k);
|
|
28163
29997
|
var _useState = React$3.useState(""),
|
|
28164
|
-
_useState2 = _slicedToArray$
|
|
29998
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
28165
29999
|
inputValue = _useState2[0],
|
|
28166
30000
|
setInputValue = _useState2[1];
|
|
28167
30001
|
var _useState3 = React$3.useState(false),
|
|
28168
|
-
_useState4 = _slicedToArray$
|
|
30002
|
+
_useState4 = _slicedToArray$3(_useState3, 2),
|
|
28169
30003
|
isFocused = _useState4[0],
|
|
28170
30004
|
setIsFocused = _useState4[1];
|
|
28171
30005
|
var isCounterVisible = !!counter && (!counter.startsFrom || getValidEmailsCount(value) >= counter.startsFrom);
|
|
@@ -28233,9 +30067,9 @@ var MultiEmailInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
28233
30067
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
28234
30068
|
className: "neeto-ui-email-input__label-wrapper"
|
|
28235
30069
|
}, label && /*#__PURE__*/React__default["default"].createElement(Label, _extends$4({
|
|
30070
|
+
required: required,
|
|
28236
30071
|
className: "neeto-ui-email-input__label",
|
|
28237
|
-
"data-cy": "".concat(hyphenize(label), "-input-label")
|
|
28238
|
-
required: required
|
|
30072
|
+
"data-cy": "".concat(hyphenize(label), "-input-label")
|
|
28239
30073
|
}, labelProps), label), isCounterVisible && /*#__PURE__*/React__default["default"].createElement(Typography, {
|
|
28240
30074
|
className: "neeto-ui-email-input__counter",
|
|
28241
30075
|
"data-cy": "".concat(hyphenize(label), "-email-counter"),
|
|
@@ -28245,13 +30079,7 @@ var MultiEmailInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
28245
30079
|
required: true,
|
|
28246
30080
|
classNamePrefix: "neeto-ui-react-select",
|
|
28247
30081
|
components: CUSTOM_COMPONENTS,
|
|
28248
|
-
inputValue: inputValue,
|
|
28249
30082
|
isDisabled: disabled,
|
|
28250
|
-
isFocused: isFocused,
|
|
28251
|
-
placeholder: placeholder,
|
|
28252
|
-
ref: ref,
|
|
28253
|
-
value: value,
|
|
28254
|
-
visibleEmailsCount: visibleEmailsCount,
|
|
28255
30083
|
className: classnames$1("neeto-ui-react-select__container neeto-ui-react-select__container--medium neeto-ui-email-input__select", {
|
|
28256
30084
|
"neeto-ui-react-select__container--error": !!error
|
|
28257
30085
|
}),
|
|
@@ -28262,7 +30090,6 @@ var MultiEmailInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
28262
30090
|
})
|
|
28263
30091
|
}),
|
|
28264
30092
|
onBlur: handleBlur,
|
|
28265
|
-
onChange: onChange,
|
|
28266
30093
|
onFocus: function onFocus() {
|
|
28267
30094
|
return setIsFocused(true);
|
|
28268
30095
|
},
|
|
@@ -28270,9 +30097,17 @@ var MultiEmailInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
28270
30097
|
return setInputValue(inputValue);
|
|
28271
30098
|
},
|
|
28272
30099
|
onKeyDown: handleKeyDown
|
|
30100
|
+
}, _objectSpread$g(_objectSpread$g(_objectSpread$g({
|
|
30101
|
+
inputValue: inputValue,
|
|
30102
|
+
isFocused: isFocused,
|
|
30103
|
+
onChange: onChange,
|
|
30104
|
+
placeholder: placeholder,
|
|
30105
|
+
ref: ref,
|
|
30106
|
+
value: value,
|
|
30107
|
+
visibleEmailsCount: visibleEmailsCount
|
|
28273
30108
|
}, !isOptionsPresent && {
|
|
28274
30109
|
menuIsOpen: false
|
|
28275
|
-
}, otherProps, overrideProps)), !!error && /*#__PURE__*/React__default["default"].createElement(Typography, {
|
|
30110
|
+
}), otherProps), overrideProps))), !!error && /*#__PURE__*/React__default["default"].createElement(Typography, {
|
|
28276
30111
|
className: "neeto-ui-input__error",
|
|
28277
30112
|
"data-cy": "".concat(hyphenize(label), "-input-error"),
|
|
28278
30113
|
style: "body3"
|
|
@@ -28576,7 +30411,7 @@ var Pane = function Pane(_ref) {
|
|
|
28576
30411
|
finalFocusRef = _ref.finalFocusRef,
|
|
28577
30412
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$i);
|
|
28578
30413
|
var _useState = React$3.useState(false),
|
|
28579
|
-
_useState2 = _slicedToArray$
|
|
30414
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
28580
30415
|
hasTransitionCompleted = _useState2[0],
|
|
28581
30416
|
setHasTransitionCompleted = _useState2[1];
|
|
28582
30417
|
var paneWrapper = React$3.useRef(null);
|
|
@@ -28666,11 +30501,11 @@ var Popover = function Popover(_ref) {
|
|
|
28666
30501
|
theme = _ref$theme === void 0 ? "light" : _ref$theme,
|
|
28667
30502
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$h);
|
|
28668
30503
|
return /*#__PURE__*/React__default["default"].createElement(Tooltip, _extends$4({
|
|
30504
|
+
theme: theme,
|
|
28669
30505
|
interactive: true,
|
|
28670
30506
|
arrow: false,
|
|
28671
30507
|
className: "neeto-ui-popover",
|
|
28672
|
-
content: children
|
|
28673
|
-
theme: theme
|
|
30508
|
+
content: children
|
|
28674
30509
|
}, otherProps));
|
|
28675
30510
|
};
|
|
28676
30511
|
Popover.Title = Title;
|
|
@@ -28719,7 +30554,7 @@ var Radio = function Radio(_ref) {
|
|
|
28719
30554
|
labelProps = _ref.labelProps,
|
|
28720
30555
|
props = _objectWithoutProperties$1(_ref, _excluded$f);
|
|
28721
30556
|
var _useState = React$3.useState(""),
|
|
28722
|
-
_useState2 = _slicedToArray$
|
|
30557
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
28723
30558
|
internalValue = _useState2[0],
|
|
28724
30559
|
setInternalValue = _useState2[1];
|
|
28725
30560
|
var id = useId(props.id);
|
|
@@ -33576,19 +35411,19 @@ var HeaderCell = function HeaderCell(props) {
|
|
|
33576
35411
|
}));
|
|
33577
35412
|
}
|
|
33578
35413
|
return /*#__PURE__*/React__default["default"].createElement(Resizable, {
|
|
35414
|
+
onResize: onResize,
|
|
35415
|
+
onResizeStop: onResizeStop,
|
|
33579
35416
|
width: width,
|
|
35417
|
+
draggableOpts: {
|
|
35418
|
+
enableUserSelectHack: false
|
|
35419
|
+
},
|
|
33580
35420
|
height: 0,
|
|
33581
35421
|
handle: /*#__PURE__*/React__default["default"].createElement("span", {
|
|
33582
35422
|
className: "react-resizable-handle",
|
|
33583
35423
|
onClick: function onClick(e) {
|
|
33584
35424
|
return e.stopPropagation();
|
|
33585
35425
|
}
|
|
33586
|
-
})
|
|
33587
|
-
onResize: onResize,
|
|
33588
|
-
onResizeStop: onResizeStop,
|
|
33589
|
-
draggableOpts: {
|
|
33590
|
-
enableUserSelectHack: false
|
|
33591
|
-
}
|
|
35426
|
+
})
|
|
33592
35427
|
}, /*#__PURE__*/React__default["default"].createElement("th", _extends$4({}, restProps, {
|
|
33593
35428
|
className: classnames$1(className, "drag-handler")
|
|
33594
35429
|
})));
|
|
@@ -33602,19 +35437,19 @@ var ResizableHeaderCell = function ResizableHeaderCell(props) {
|
|
|
33602
35437
|
return /*#__PURE__*/React__default["default"].createElement("th", restProps);
|
|
33603
35438
|
}
|
|
33604
35439
|
return /*#__PURE__*/React__default["default"].createElement(Resizable, {
|
|
35440
|
+
onResize: onResize,
|
|
35441
|
+
onResizeStop: onResizeStop,
|
|
33605
35442
|
width: width,
|
|
35443
|
+
draggableOpts: {
|
|
35444
|
+
enableUserSelectHack: false
|
|
35445
|
+
},
|
|
33606
35446
|
height: 0,
|
|
33607
35447
|
handle: /*#__PURE__*/React__default["default"].createElement("span", {
|
|
33608
35448
|
className: "react-resizable-handle",
|
|
33609
35449
|
onClick: function onClick(e) {
|
|
33610
35450
|
return e.stopPropagation();
|
|
33611
35451
|
}
|
|
33612
|
-
})
|
|
33613
|
-
onResize: onResize,
|
|
33614
|
-
onResizeStop: onResizeStop,
|
|
33615
|
-
draggableOpts: {
|
|
33616
|
-
enableUserSelectHack: false
|
|
33617
|
-
}
|
|
35452
|
+
})
|
|
33618
35453
|
}, /*#__PURE__*/React__default["default"].createElement("th", restProps));
|
|
33619
35454
|
};
|
|
33620
35455
|
var ReorderableHeaderCell = function ReorderableHeaderCell(props) {
|
|
@@ -33774,30 +35609,33 @@ var Table = function Table(_ref) {
|
|
|
33774
35609
|
components = _ref$components === void 0 ? {} : _ref$components,
|
|
33775
35610
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$5);
|
|
33776
35611
|
var _useState = React$3.useState(null),
|
|
33777
|
-
_useState2 = _slicedToArray$
|
|
35612
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
33778
35613
|
containerHeight = _useState2[0],
|
|
33779
35614
|
setContainerHeight = _useState2[1];
|
|
33780
35615
|
var _useState3 = React$3.useState(TABLE_DEFAULT_HEADER_HEIGHT),
|
|
33781
|
-
_useState4 = _slicedToArray$
|
|
35616
|
+
_useState4 = _slicedToArray$3(_useState3, 2),
|
|
33782
35617
|
headerHeight = _useState4[0],
|
|
33783
35618
|
setHeaderHeight = _useState4[1];
|
|
33784
35619
|
var _useState5 = React$3.useState(columnData),
|
|
33785
|
-
_useState6 = _slicedToArray$
|
|
35620
|
+
_useState6 = _slicedToArray$3(_useState5, 2),
|
|
33786
35621
|
columns = _useState6[0],
|
|
33787
35622
|
setColumns = _useState6[1];
|
|
33788
|
-
var
|
|
35623
|
+
var isDefaultPageChangeHandler = handlePageChange === noop$3;
|
|
35624
|
+
var history = reactRouterDom.useHistory();
|
|
33789
35625
|
var headerRef = React$3.useRef();
|
|
33790
35626
|
var resizeObserver = React$3.useRef(new ResizeObserver(function (_ref2) {
|
|
33791
|
-
var _ref3 = _slicedToArray$
|
|
33792
|
-
|
|
33793
|
-
return setContainerHeight(height);
|
|
35627
|
+
var _ref3 = _slicedToArray$3(_ref2, 1),
|
|
35628
|
+
entry = _ref3[0];
|
|
35629
|
+
return setContainerHeight(entry.contentRect.height);
|
|
33794
35630
|
}));
|
|
33795
35631
|
var tableRef = React$3.useCallback(function (table) {
|
|
33796
35632
|
if (!fixedHeight) return;
|
|
33797
35633
|
var observer = resizeObserver.current;
|
|
33798
35634
|
if (table !== null) {
|
|
33799
35635
|
observer.observe(table === null || table === void 0 ? void 0 : table.parentNode);
|
|
33800
|
-
} else if (observer)
|
|
35636
|
+
} else if (observer) {
|
|
35637
|
+
observer.disconnect();
|
|
35638
|
+
}
|
|
33801
35639
|
}, [resizeObserver.current, fixedHeight]);
|
|
33802
35640
|
useTimeout(function () {
|
|
33803
35641
|
var headerHeight = headerRef.current ? headerRef.current.offsetHeight : TABLE_DEFAULT_HEADER_HEIGHT;
|
|
@@ -33828,7 +35666,7 @@ var Table = function Table(_ref) {
|
|
|
33828
35666
|
dataIndex: neetoCist.snakeToCamelCase((_queryParams$sort_by = queryParams.sort_by) !== null && _queryParams$sort_by !== void 0 ? _queryParams$sort_by : "")
|
|
33829
35667
|
}, ramda.assoc("sortOrder", TABLE_SORT_ORDERS[queryParams.order_by]), columnData);
|
|
33830
35668
|
};
|
|
33831
|
-
var sortedColumns =
|
|
35669
|
+
var sortedColumns = isDefaultPageChangeHandler ? setSortFromURL(curatedColumnsData) : curatedColumnsData;
|
|
33832
35670
|
var locale = {
|
|
33833
35671
|
emptyText: /*#__PURE__*/React__default["default"].createElement(Typography, {
|
|
33834
35672
|
style: "body2"
|
|
@@ -33838,80 +35676,71 @@ var Table = function Table(_ref) {
|
|
|
33838
35676
|
return _objectSpread$6(_objectSpread$6({}, sortedColumn), {}, {
|
|
33839
35677
|
onHeaderCell: function onHeaderCell(column) {
|
|
33840
35678
|
var _sortedColumn$onHeade;
|
|
33841
|
-
|
|
33842
|
-
return _objectSpread$6(_objectSpread$6({}, col), {}, {
|
|
35679
|
+
return _objectSpread$6(_objectSpread$6({}, (_sortedColumn$onHeade = sortedColumn.onHeaderCell) === null || _sortedColumn$onHeade === void 0 ? void 0 : _sortedColumn$onHeade.call(sortedColumn, column)), {}, {
|
|
33843
35680
|
"data-text-align": column.align
|
|
33844
35681
|
});
|
|
33845
35682
|
}
|
|
33846
35683
|
});
|
|
33847
35684
|
});
|
|
33848
|
-
var
|
|
33849
|
-
|
|
33850
|
-
|
|
33851
|
-
|
|
33852
|
-
|
|
33853
|
-
},
|
|
33854
|
-
|
|
33855
|
-
|
|
33856
|
-
},
|
|
33857
|
-
selectedRowKeys: selectedRowKeys
|
|
33858
|
-
});
|
|
33859
|
-
}
|
|
35685
|
+
var rowSelectionProps = rowSelection ? _objectSpread$6(_objectSpread$6({
|
|
35686
|
+
type: "checkbox"
|
|
35687
|
+
}, rowSelection), {}, {
|
|
35688
|
+
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
35689
|
+
return onRowSelect && onRowSelect(selectedRowKeys, selectedRows);
|
|
35690
|
+
},
|
|
35691
|
+
selectedRowKeys: selectedRowKeys
|
|
35692
|
+
}) : false;
|
|
33860
35693
|
var reordableHeader = {
|
|
33861
35694
|
header: {
|
|
33862
35695
|
cell: enableColumnResize ? enableColumnReorder ? HeaderCell : ResizableHeaderCell : enableColumnReorder ? ReorderableHeaderCell : null
|
|
33863
35696
|
}
|
|
33864
35697
|
};
|
|
33865
|
-
var componentOverrides = _objectSpread$6(_objectSpread$6({}, components), reordableHeader);
|
|
33866
|
-
var calculateTableContainerHeight = function calculateTableContainerHeight() {
|
|
33867
|
-
return containerHeight - headerHeight - (isPaginationVisible ? TABLE_PAGINATION_HEIGHT : 0);
|
|
33868
|
-
};
|
|
33869
|
-
var itemRender = function itemRender(_, type, originalElement) {
|
|
33870
|
-
if (type === "prev") {
|
|
33871
|
-
return /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
33872
|
-
className: "",
|
|
33873
|
-
icon: neetoIcons.Left,
|
|
33874
|
-
size: "small",
|
|
33875
|
-
style: "text"
|
|
33876
|
-
});
|
|
33877
|
-
}
|
|
33878
|
-
if (type === "next") {
|
|
33879
|
-
return /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
33880
|
-
className: "",
|
|
33881
|
-
icon: neetoIcons.Right,
|
|
33882
|
-
size: "small",
|
|
33883
|
-
style: "text"
|
|
33884
|
-
});
|
|
33885
|
-
}
|
|
33886
|
-
if (type === "jump-prev") {
|
|
33887
|
-
return /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
33888
|
-
className: "",
|
|
33889
|
-
icon: neetoIcons.MenuHorizontal,
|
|
33890
|
-
size: "small",
|
|
33891
|
-
style: "text"
|
|
33892
|
-
});
|
|
33893
|
-
}
|
|
33894
|
-
if (type === "jump-next") {
|
|
33895
|
-
return /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
33896
|
-
className: "",
|
|
33897
|
-
icon: neetoIcons.MenuHorizontal,
|
|
33898
|
-
size: "small",
|
|
33899
|
-
style: "text"
|
|
33900
|
-
});
|
|
33901
|
-
}
|
|
33902
|
-
return originalElement;
|
|
33903
|
-
};
|
|
33904
35698
|
var calculateRowsPerPage = function calculateRowsPerPage() {
|
|
33905
35699
|
var viewportHeight = window.innerHeight;
|
|
33906
35700
|
var rowsPerPage = Math.floor((viewportHeight - TABLE_PAGINATION_HEIGHT) / TABLE_ROW_HEIGHT * 3);
|
|
33907
35701
|
return Math.ceil(rowsPerPage / 10) * 10;
|
|
33908
35702
|
};
|
|
35703
|
+
var pageSize = shouldDynamicallyRenderRowSize ? calculateRowsPerPage() : paginationProps.pageSize || defaultPageSize;
|
|
35704
|
+
var calculateTableContainerHeight = function calculateTableContainerHeight() {
|
|
35705
|
+
var isPaginationVisible = otherProps.pagination !== false && rowData.length > pageSize;
|
|
35706
|
+
return containerHeight - headerHeight - (isPaginationVisible ? TABLE_PAGINATION_HEIGHT : 0);
|
|
35707
|
+
};
|
|
33909
35708
|
var calculatePageSizeOptions = function calculatePageSizeOptions() {
|
|
33910
|
-
var rowsPerPage = shouldDynamicallyRenderRowSize ? calculateRowsPerPage() : defaultPageSize;
|
|
33911
35709
|
return neetoCist.dynamicArray(5, function (index) {
|
|
33912
|
-
return (index + 1) *
|
|
35710
|
+
return (index + 1) * pageSize;
|
|
33913
35711
|
});
|
|
33914
35712
|
};
|
|
35713
|
+
var itemRender = function itemRender(_, type, originalElement) {
|
|
35714
|
+
var commonProps = {
|
|
35715
|
+
size: "small",
|
|
35716
|
+
style: "text"
|
|
35717
|
+
};
|
|
35718
|
+
if (type === "prev") return /*#__PURE__*/React__default["default"].createElement(Button, _extends$4({
|
|
35719
|
+
icon: neetoIcons.Left
|
|
35720
|
+
}, commonProps));
|
|
35721
|
+
if (type === "next") return /*#__PURE__*/React__default["default"].createElement(Button, _extends$4({
|
|
35722
|
+
icon: neetoIcons.Right
|
|
35723
|
+
}, commonProps));
|
|
35724
|
+
if (type === "jump-prev" || type === "jump-next") {
|
|
35725
|
+
return /*#__PURE__*/React__default["default"].createElement(Button, _extends$4({
|
|
35726
|
+
icon: neetoIcons.MenuHorizontal
|
|
35727
|
+
}, commonProps));
|
|
35728
|
+
}
|
|
35729
|
+
return originalElement;
|
|
35730
|
+
};
|
|
35731
|
+
React$3.useEffect(function () {
|
|
35732
|
+
var shouldNavigateToLastPage = ramda.isEmpty(rowData) && !loading && currentPageNumber !== 1;
|
|
35733
|
+
if (!shouldNavigateToLastPage) return;
|
|
35734
|
+
var lastPage = Math.ceil(totalCount / pageSize);
|
|
35735
|
+
var page = Math.max(1, lastPage);
|
|
35736
|
+
var pathname = window.location.pathname;
|
|
35737
|
+
isDefaultPageChangeHandler ? history.push(buildUrl(pathname, ramda.mergeLeft({
|
|
35738
|
+
page: page
|
|
35739
|
+
}, queryParams))) : handlePageChange(page, pageSize);
|
|
35740
|
+
}, [rowData]);
|
|
35741
|
+
React$3.useEffect(function () {
|
|
35742
|
+
return setColumns(columnData);
|
|
35743
|
+
}, [columnData]);
|
|
33915
35744
|
var neetoUIFontBold = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--neeto-ui-font-bold"), 10);
|
|
33916
35745
|
var renderTable = function renderTable() {
|
|
33917
35746
|
return /*#__PURE__*/React__default["default"].createElement(_ConfigProvider__default["default"], {
|
|
@@ -33953,6 +35782,7 @@ var Table = function Table(_ref) {
|
|
|
33953
35782
|
rowSelectedBg: "rgb(var(--neeto-ui-primary-100))",
|
|
33954
35783
|
rowSelectedHoverBg: "rgb(var(--neeto-ui-pastel-purple))",
|
|
33955
35784
|
stickyScrollBarBg: "rgb(var(--neeto-ui-primary-100))",
|
|
35785
|
+
cellPaddingBlock: 10,
|
|
33956
35786
|
// Global overrides
|
|
33957
35787
|
colorPrimary: "rgb(var(--neeto-ui-primary-500))",
|
|
33958
35788
|
fontSize: 14,
|
|
@@ -33966,7 +35796,7 @@ var Table = function Table(_ref) {
|
|
|
33966
35796
|
loading: loading,
|
|
33967
35797
|
locale: locale,
|
|
33968
35798
|
columns: sortedColumnsWithAlignment,
|
|
33969
|
-
components:
|
|
35799
|
+
components: _objectSpread$6(_objectSpread$6({}, components), reordableHeader),
|
|
33970
35800
|
dataSource: rowData,
|
|
33971
35801
|
ref: tableRef,
|
|
33972
35802
|
rowKey: "id",
|
|
@@ -33978,7 +35808,7 @@ var Table = function Table(_ref) {
|
|
|
33978
35808
|
showSizeChanger: false,
|
|
33979
35809
|
total: totalCount !== null && totalCount !== void 0 ? totalCount : 0,
|
|
33980
35810
|
current: currentPageNumber,
|
|
33981
|
-
defaultPageSize:
|
|
35811
|
+
defaultPageSize: pageSize,
|
|
33982
35812
|
pageSizeOptions: calculatePageSizeOptions(),
|
|
33983
35813
|
onChange: handlePageChange,
|
|
33984
35814
|
itemRender: itemRender
|
|
@@ -33991,7 +35821,7 @@ var Table = function Table(_ref) {
|
|
|
33991
35821
|
y: calculateTableContainerHeight()
|
|
33992
35822
|
}, scroll),
|
|
33993
35823
|
onChange: function onChange(pagination, _, sorter) {
|
|
33994
|
-
|
|
35824
|
+
isDefaultPageChangeHandler && handleTableChange(pagination, sorter);
|
|
33995
35825
|
},
|
|
33996
35826
|
onHeaderRow: function onHeaderRow() {
|
|
33997
35827
|
return {
|
|
@@ -34011,13 +35841,7 @@ var Table = function Table(_ref) {
|
|
|
34011
35841
|
}
|
|
34012
35842
|
}, otherProps)));
|
|
34013
35843
|
};
|
|
34014
|
-
|
|
34015
|
-
setColumns(columnData);
|
|
34016
|
-
}, [columnData]);
|
|
34017
|
-
if (enableColumnReorder) {
|
|
34018
|
-
return /*#__PURE__*/React__default["default"].createElement(ReactDragListView.DragColumn, dragProps, renderTable());
|
|
34019
|
-
}
|
|
34020
|
-
return renderTable();
|
|
35844
|
+
return enableColumnReorder ? /*#__PURE__*/React__default["default"].createElement(ReactDragListView.DragColumn, dragProps, renderTable()) : renderTable();
|
|
34021
35845
|
};
|
|
34022
35846
|
|
|
34023
35847
|
var _excluded$4 = ["size", "rows", "disabled", "required", "nakedTextarea", "helpText", "error", "label", "className", "maxLength", "unlimitedChars", "labelProps"];
|
|
@@ -34054,7 +35878,7 @@ var Textarea = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
34054
35878
|
labelProps = _ref.labelProps,
|
|
34055
35879
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$4);
|
|
34056
35880
|
var _useState = React$3.useState(""),
|
|
34057
|
-
_useState2 = _slicedToArray$
|
|
35881
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
34058
35882
|
valueInternal = _useState2[0],
|
|
34059
35883
|
setValueInternal = _useState2[1];
|
|
34060
35884
|
var value = (_ref2 = (_otherProps$value = otherProps.value) !== null && _otherProps$value !== void 0 ? _otherProps$value : valueInternal) !== null && _ref2 !== void 0 ? _ref2 : "";
|
|
@@ -34266,14 +36090,6 @@ var TimePicker$1 = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
34266
36090
|
});
|
|
34267
36091
|
TimePicker$1.displayName = "TimePicker";
|
|
34268
36092
|
|
|
34269
|
-
var customParseFormat$1 = {exports: {}};
|
|
34270
|
-
|
|
34271
|
-
(function (module, exports) {
|
|
34272
|
-
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return (e=+e)+(e>68?1900:2e3)};var a=function(e){return function(t){this[e]=+t;}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e);}],h=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},d={A:[i,function(e){this.afternoon=u(e,!1);}],a:[i,function(e){this.afternoon=u(e,!0);}],S:[/\d/,function(e){this.milliseconds=100*+e;}],SS:[n,function(e){this.milliseconds=10*+e;}],SSS:[/\d{3}/,function(e){this.milliseconds=+e;}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r);}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(e){var t=h("months"),n=(h("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n;}],MMMM:[i,function(e){var t=h("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t;}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e);}],YYYY:[/\d{4}/,a("year")],Z:f,ZZ:f};function c(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=s.length,f=0;f<a;f+=1){var h=s[f],u=d[h],c=u&&u[0],l=u&&u[1];s[f]=l?{regex:c,parser:l}:h.replace(/^\[|\]$/g,"");}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=s[n];if("string"==typeof i)r+=i.length;else {var o=i.regex,f=i.parser,h=e.slice(r),u=o.exec(h)[0];f.call(t,u),e=e.replace(u,"");}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon;}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,s=e.args;this.$u=r;var a=s[1];if("string"==typeof a){var f=!0===s[2],h=!0===s[3],u=f||h,d=s[2];h&&(d=s[2]),o=this.$locale(),!f&&d&&(o=n.Ls[d]),this.$d=function(e,t,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=c(t)(e),i=r.year,o=r.month,s=r.day,a=r.hours,f=r.minutes,h=r.seconds,u=r.milliseconds,d=r.zone,l=new Date,m=s||(i||o?1:l.getDate()),M=i||l.getFullYear(),Y=0;i&&!o||(Y=o>0?o-1:l.getMonth());var p=a||0,v=f||0,D=h||0,g=u||0;return d?new Date(Date.UTC(M,Y,m,p,v,D,g+60*d.offset*1e3)):n?new Date(Date.UTC(M,Y,m,p,v,D,g)):new Date(M,Y,m,p,v,D,g)}catch(e){return new Date("")}}(t,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),o={};}else if(a instanceof Array)for(var l=a.length,m=1;m<=l;m+=1){s[1]=a[m-1];var M=n.apply(this,s);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===l&&(this.$d=new Date(""));}else i.call(this,e);};}}));
|
|
34273
|
-
} (customParseFormat$1));
|
|
34274
|
-
|
|
34275
|
-
var customParseFormat = customParseFormat$1.exports;
|
|
34276
|
-
|
|
34277
36093
|
var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
34278
36094
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
34279
36095
|
if (ar || !(i in from)) {
|
|
@@ -34593,7 +36409,7 @@ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
|
34593
36409
|
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
34594
36410
|
|
|
34595
36411
|
/** Detect free variable `global` from Node.js. */
|
|
34596
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
36412
|
+
var freeGlobal = typeof commonjsGlobal$1 == 'object' && commonjsGlobal$1 && commonjsGlobal$1.Object === Object && commonjsGlobal$1;
|
|
34597
36413
|
|
|
34598
36414
|
/** Detect free variable `self`. */
|
|
34599
36415
|
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
@@ -36840,6 +38656,27 @@ if (isBrowser) {
|
|
|
36840
38656
|
TimePicker.propTypes.portalContainer = propTypes$1.exports.instanceOf(HTMLElement);
|
|
36841
38657
|
}
|
|
36842
38658
|
|
|
38659
|
+
var HoverIcon = function HoverIcon(_ref) {
|
|
38660
|
+
var _ref$time = _ref.time,
|
|
38661
|
+
time = _ref$time === void 0 ? false : _ref$time;
|
|
38662
|
+
var _useState = React$3.useState(false),
|
|
38663
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
38664
|
+
hovered = _useState2[0],
|
|
38665
|
+
setHovered = _useState2[1];
|
|
38666
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
38667
|
+
onMouseLeave: function onMouseLeave() {
|
|
38668
|
+
return setHovered(false);
|
|
38669
|
+
},
|
|
38670
|
+
onMouseOver: function onMouseOver() {
|
|
38671
|
+
return setHovered(true);
|
|
38672
|
+
}
|
|
38673
|
+
}, hovered && time ? /*#__PURE__*/React__default["default"].createElement(neetoIcons.Close, {
|
|
38674
|
+
size: 16
|
|
38675
|
+
}) : /*#__PURE__*/React__default["default"].createElement(neetoIcons.Clock, {
|
|
38676
|
+
size: 16
|
|
38677
|
+
}));
|
|
38678
|
+
};
|
|
38679
|
+
|
|
36843
38680
|
var _excluded$2 = ["className", "label", "labelProps", "size", "nakedInput", "required", "value", "onChange", "error"];
|
|
36844
38681
|
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
36845
38682
|
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -36849,7 +38686,7 @@ var INPUT_SIZES = {
|
|
|
36849
38686
|
medium: "medium",
|
|
36850
38687
|
large: "large"
|
|
36851
38688
|
};
|
|
36852
|
-
var TimePickerInput = function
|
|
38689
|
+
var TimePickerInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
36853
38690
|
var _convertToDayjsObject;
|
|
36854
38691
|
var _ref$className = _ref.className,
|
|
36855
38692
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
@@ -36866,34 +38703,50 @@ var TimePickerInput = function TimePickerInput(_ref) {
|
|
|
36866
38703
|
_ref$error = _ref.error,
|
|
36867
38704
|
error = _ref$error === void 0 ? "" : _ref$error,
|
|
36868
38705
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$2);
|
|
38706
|
+
var _useState = React$3.useState(value),
|
|
38707
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
38708
|
+
time = _useState2[0],
|
|
38709
|
+
setTime = _useState2[1];
|
|
36869
38710
|
var id = useId(otherProps.id);
|
|
36870
38711
|
var errorId = "error_".concat(id);
|
|
38712
|
+
React$3.useEffect(function () {
|
|
38713
|
+
setTime(value);
|
|
38714
|
+
}, [value]);
|
|
36871
38715
|
var handleChange = function handleChange(value) {
|
|
36872
38716
|
var date = dayjs(value, "HH:mm:ss");
|
|
38717
|
+
setTime(value);
|
|
36873
38718
|
onChange(date, value);
|
|
36874
38719
|
};
|
|
36875
38720
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
38721
|
+
ref: ref,
|
|
36876
38722
|
className: "neeto-ui-input__wrapper"
|
|
36877
38723
|
}, label && /*#__PURE__*/React__default["default"].createElement(Label, _objectSpread$3({
|
|
36878
38724
|
required: required
|
|
36879
|
-
}, labelProps), label), /*#__PURE__*/React__default["default"].createElement(TimePicker, _extends$4(
|
|
38725
|
+
}, labelProps), label), /*#__PURE__*/React__default["default"].createElement(TimePicker, _extends$4({
|
|
36880
38726
|
id: id,
|
|
36881
|
-
value: value,
|
|
36882
38727
|
disableClock: true,
|
|
36883
|
-
clearIcon:
|
|
36884
|
-
|
|
36885
|
-
|
|
36886
|
-
|
|
36887
|
-
|
|
36888
|
-
"
|
|
36889
|
-
|
|
36890
|
-
"neeto-ui-time-picker
|
|
36891
|
-
|
|
38728
|
+
clearIcon: /*#__PURE__*/React__default["default"].createElement(HoverIcon, {
|
|
38729
|
+
time: time
|
|
38730
|
+
}),
|
|
38731
|
+
hourPlaceholder: "HH",
|
|
38732
|
+
minutePlaceholder: "mm",
|
|
38733
|
+
secondAriaLabel: "ss",
|
|
38734
|
+
value: (_convertToDayjsObject = convertToDayjsObjects(value)) === null || _convertToDayjsObject === void 0 ? void 0 : _convertToDayjsObject.toDate(),
|
|
38735
|
+
className: classnames$1("neeto-ui-time-picker", [className], {
|
|
38736
|
+
"neeto-ui-time-picker--small": size === "small",
|
|
38737
|
+
"neeto-ui-time-picker--medium": size === "medium",
|
|
38738
|
+
"neeto-ui-time-picker--large": size === "large",
|
|
38739
|
+
"neeto-ui-time-picker--disabled": otherProps.disabled,
|
|
38740
|
+
"neeto-ui-time-picker--naked": nakedInput,
|
|
38741
|
+
"neeto-ui-time-picker--error": !!error
|
|
38742
|
+
}),
|
|
38743
|
+
onChange: handleChange
|
|
38744
|
+
}, otherProps)), !!error && typeof error === "string" && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
36892
38745
|
className: "neeto-ui-input__error",
|
|
36893
38746
|
"data-cy": "".concat(hyphenize(label), "-input-error"),
|
|
36894
38747
|
id: errorId
|
|
36895
38748
|
}, error));
|
|
36896
|
-
};
|
|
38749
|
+
});
|
|
36897
38750
|
TimePickerInput.displayName = "TimePicker";
|
|
36898
38751
|
|
|
36899
38752
|
// THIS FILE IS AUTOMATICALLY GENERATED DO NOT EDIT DIRECTLY
|
|
@@ -38734,7 +40587,7 @@ var TOAST_ICON = {
|
|
|
38734
40587
|
};
|
|
38735
40588
|
var toastrList = new UniqueArray();
|
|
38736
40589
|
var parseToastrConfig = function parseToastrConfig(config) {
|
|
38737
|
-
if (_typeof$
|
|
40590
|
+
if (_typeof$7(config[0]) === "object") {
|
|
38738
40591
|
var _config$ = config[0],
|
|
38739
40592
|
_buttonLabel = _config$.buttonLabel,
|
|
38740
40593
|
_onClick = _config$.onClick,
|
|
@@ -38745,7 +40598,7 @@ var parseToastrConfig = function parseToastrConfig(config) {
|
|
|
38745
40598
|
customConfig: _customConfig
|
|
38746
40599
|
};
|
|
38747
40600
|
}
|
|
38748
|
-
var _config = _slicedToArray$
|
|
40601
|
+
var _config = _slicedToArray$3(config, 3),
|
|
38749
40602
|
buttonLabel = _config[0],
|
|
38750
40603
|
onClick = _config[1],
|
|
38751
40604
|
customConfig = _config[2];
|
|
@@ -38758,9 +40611,9 @@ var parseToastrConfig = function parseToastrConfig(config) {
|
|
|
38758
40611
|
var getToastrMessage = function getToastrMessage(message) {
|
|
38759
40612
|
if ((message === null || message === void 0 ? void 0 : message.noticeCode) === "custom_message" && "customMessage" in message) {
|
|
38760
40613
|
return message.customMessage;
|
|
38761
|
-
} else if (_typeof$
|
|
40614
|
+
} else if (_typeof$7(message) === "object" && message.noticeCode) {
|
|
38762
40615
|
return i18next.t(message.noticeCode, message);
|
|
38763
|
-
} else if (_typeof$
|
|
40616
|
+
} else if (_typeof$7(message) === "object" && message.notice) {
|
|
38764
40617
|
return message.notice;
|
|
38765
40618
|
}
|
|
38766
40619
|
return message;
|
|
@@ -38840,13 +40693,13 @@ var isError = function isError(e) {
|
|
|
38840
40693
|
return e && e.stack && e.message;
|
|
38841
40694
|
};
|
|
38842
40695
|
var isAxiosError = function isAxiosError(e) {
|
|
38843
|
-
return _typeof$
|
|
40696
|
+
return _typeof$7(e) === "object" && e.isAxiosError === true;
|
|
38844
40697
|
};
|
|
38845
40698
|
var isString = function isString(s) {
|
|
38846
40699
|
return typeof s === "string" || s instanceof String;
|
|
38847
40700
|
};
|
|
38848
40701
|
var isErrorCodeObject = function isErrorCodeObject(e) {
|
|
38849
|
-
return _typeof$
|
|
40702
|
+
return _typeof$7(e) === "object" && "key" in e && "context" in e;
|
|
38850
40703
|
};
|
|
38851
40704
|
var errorCodeTranslation = function errorCodeTranslation(errorCode) {
|
|
38852
40705
|
if (typeof errorCode === "string") {
|
|
@@ -39048,6 +40901,7 @@ exports.Callout = Callout;
|
|
|
39048
40901
|
exports.Checkbox = Checkbox;
|
|
39049
40902
|
exports.ColorPicker = ColorPicker;
|
|
39050
40903
|
exports.DatePicker = DatePicker;
|
|
40904
|
+
exports.DateTimePicker = DateTimePicker;
|
|
39051
40905
|
exports.Dropdown = Dropdown;
|
|
39052
40906
|
exports.Input = Input$3;
|
|
39053
40907
|
exports.Kbd = Kbd;
|