Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
* isButton(document.querySelector("button")); // true
[51000] Fix | Delete
* isButton(document.querySelector("input[type='button']")); // true
[51001] Fix | Delete
* isButton(document.querySelector("div")); // false
[51002] Fix | Delete
* isButton(document.querySelector("input[type='text']")); // false
[51003] Fix | Delete
* isButton(document.querySelector("div[role='button']")); // false
[51004] Fix | Delete
*
[51005] Fix | Delete
* @returns {boolean}
[51006] Fix | Delete
*/
[51007] Fix | Delete
[51008] Fix | Delete
function isButton(element) {
[51009] Fix | Delete
if (element.tagName === "BUTTON") return true;
[51010] Fix | Delete
[51011] Fix | Delete
if (element.tagName === "INPUT") {
[51012] Fix | Delete
var input = element;
[51013] Fix | Delete
return buttonInputTypes.indexOf(input.type) !== -1;
[51014] Fix | Delete
}
[51015] Fix | Delete
[51016] Fix | Delete
return false;
[51017] Fix | Delete
}
[51018] Fix | Delete
[51019] Fix | Delete
[51020] Fix | Delete
[51021] Fix | Delete
[51022] Fix | Delete
/***/ }),
[51023] Fix | Delete
[51024] Fix | Delete
/***/ "h6xH":
[51025] Fix | Delete
/***/ (function(module, exports, __webpack_require__) {
[51026] Fix | Delete
[51027] Fix | Delete
"use strict";
[51028] Fix | Delete
[51029] Fix | Delete
[51030] Fix | Delete
Object.defineProperty(exports, "__esModule", {
[51031] Fix | Delete
value: true
[51032] Fix | Delete
});
[51033] Fix | Delete
exports['default'] = isBeforeDay;
[51034] Fix | Delete
[51035] Fix | Delete
var _moment = __webpack_require__("wy2R");
[51036] Fix | Delete
[51037] Fix | Delete
var _moment2 = _interopRequireDefault(_moment);
[51038] Fix | Delete
[51039] Fix | Delete
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
[51040] Fix | Delete
[51041] Fix | Delete
function isBeforeDay(a, b) {
[51042] Fix | Delete
if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
[51043] Fix | Delete
[51044] Fix | Delete
var aYear = a.year();
[51045] Fix | Delete
var aMonth = a.month();
[51046] Fix | Delete
[51047] Fix | Delete
var bYear = b.year();
[51048] Fix | Delete
var bMonth = b.month();
[51049] Fix | Delete
[51050] Fix | Delete
var isSameYear = aYear === bYear;
[51051] Fix | Delete
var isSameMonth = aMonth === bMonth;
[51052] Fix | Delete
[51053] Fix | Delete
if (isSameYear && isSameMonth) return a.date() < b.date();
[51054] Fix | Delete
if (isSameYear) return aMonth < bMonth;
[51055] Fix | Delete
return aYear < bYear;
[51056] Fix | Delete
}
[51057] Fix | Delete
[51058] Fix | Delete
/***/ }),
[51059] Fix | Delete
[51060] Fix | Delete
/***/ "hZ2/":
[51061] Fix | Delete
/***/ (function(module, exports, __webpack_require__) {
[51062] Fix | Delete
[51063] Fix | Delete
"use strict";
[51064] Fix | Delete
[51065] Fix | Delete
[51066] Fix | Delete
var bind = __webpack_require__("D3zA");
[51067] Fix | Delete
var GetIntrinsic = __webpack_require__("AM7I");
[51068] Fix | Delete
[51069] Fix | Delete
var $apply = GetIntrinsic('%Function.prototype.apply%');
[51070] Fix | Delete
var $call = GetIntrinsic('%Function.prototype.call%');
[51071] Fix | Delete
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
[51072] Fix | Delete
[51073] Fix | Delete
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
[51074] Fix | Delete
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
[51075] Fix | Delete
var $max = GetIntrinsic('%Math.max%');
[51076] Fix | Delete
[51077] Fix | Delete
if ($defineProperty) {
[51078] Fix | Delete
try {
[51079] Fix | Delete
$defineProperty({}, 'a', { value: 1 });
[51080] Fix | Delete
} catch (e) {
[51081] Fix | Delete
// IE 8 has a broken defineProperty
[51082] Fix | Delete
$defineProperty = null;
[51083] Fix | Delete
}
[51084] Fix | Delete
}
[51085] Fix | Delete
[51086] Fix | Delete
module.exports = function callBind(originalFunction) {
[51087] Fix | Delete
var func = $reflectApply(bind, $call, arguments);
[51088] Fix | Delete
if ($gOPD && $defineProperty) {
[51089] Fix | Delete
var desc = $gOPD(func, 'length');
[51090] Fix | Delete
if (desc.configurable) {
[51091] Fix | Delete
// original length, plus the receiver, minus any additional arguments (after the receiver)
[51092] Fix | Delete
$defineProperty(
[51093] Fix | Delete
func,
[51094] Fix | Delete
'length',
[51095] Fix | Delete
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
[51096] Fix | Delete
);
[51097] Fix | Delete
}
[51098] Fix | Delete
}
[51099] Fix | Delete
return func;
[51100] Fix | Delete
};
[51101] Fix | Delete
[51102] Fix | Delete
var applyBind = function applyBind() {
[51103] Fix | Delete
return $reflectApply(bind, $apply, arguments);
[51104] Fix | Delete
};
[51105] Fix | Delete
[51106] Fix | Delete
if ($defineProperty) {
[51107] Fix | Delete
$defineProperty(module.exports, 'apply', { value: applyBind });
[51108] Fix | Delete
} else {
[51109] Fix | Delete
module.exports.apply = applyBind;
[51110] Fix | Delete
}
[51111] Fix | Delete
[51112] Fix | Delete
[51113] Fix | Delete
/***/ }),
[51114] Fix | Delete
[51115] Fix | Delete
/***/ "i10q":
[51116] Fix | Delete
/***/ (function(module, exports, __webpack_require__) {
[51117] Fix | Delete
[51118] Fix | Delete
"use strict";
[51119] Fix | Delete
[51120] Fix | Delete
[51121] Fix | Delete
// https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey
[51122] Fix | Delete
[51123] Fix | Delete
module.exports = function IsPropertyKey(argument) {
[51124] Fix | Delete
return typeof argument === 'string' || typeof argument === 'symbol';
[51125] Fix | Delete
};
[51126] Fix | Delete
[51127] Fix | Delete
[51128] Fix | Delete
/***/ }),
[51129] Fix | Delete
[51130] Fix | Delete
/***/ "iB/h":
[51131] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[51132] Fix | Delete
[51133] Fix | Delete
"use strict";
[51134] Fix | Delete
/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
[51135] Fix | Delete
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
[51136] Fix | Delete
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("YLtl");
[51137] Fix | Delete
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
[51138] Fix | Delete
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TSYQ");
[51139] Fix | Delete
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
[51140] Fix | Delete
/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("gdqT");
[51141] Fix | Delete
/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__);
[51142] Fix | Delete
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("l3Sj");
[51143] Fix | Delete
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
[51144] Fix | Delete
/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("Z23Y");
[51145] Fix | Delete
/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_5__);
[51146] Fix | Delete
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("kA6J");
[51147] Fix | Delete
[51148] Fix | Delete
[51149] Fix | Delete
/**
[51150] Fix | Delete
* External dependencies
[51151] Fix | Delete
*/
[51152] Fix | Delete
[51153] Fix | Delete
[51154] Fix | Delete
/**
[51155] Fix | Delete
* WordPress dependencies
[51156] Fix | Delete
*/
[51157] Fix | Delete
[51158] Fix | Delete
[51159] Fix | Delete
[51160] Fix | Delete
[51161] Fix | Delete
[51162] Fix | Delete
/**
[51163] Fix | Delete
* Internal dependencies
[51164] Fix | Delete
*/
[51165] Fix | Delete
[51166] Fix | Delete
[51167] Fix | Delete
var NOTICE_TIMEOUT = 10000;
[51168] Fix | Delete
/** @typedef {import('@wordpress/element').WPElement} WPElement */
[51169] Fix | Delete
[51170] Fix | Delete
/**
[51171] Fix | Delete
* Custom hook which announces the message with the given politeness, if a
[51172] Fix | Delete
* valid message is provided.
[51173] Fix | Delete
*
[51174] Fix | Delete
* @param {string|WPElement} [message] Message to announce.
[51175] Fix | Delete
* @param {'polite'|'assertive'} politeness Politeness to announce.
[51176] Fix | Delete
*/
[51177] Fix | Delete
[51178] Fix | Delete
function useSpokenMessage(message, politeness) {
[51179] Fix | Delete
var spokenMessage = typeof message === 'string' ? message : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["renderToString"])(message);
[51180] Fix | Delete
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
[51181] Fix | Delete
if (spokenMessage) {
[51182] Fix | Delete
Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__["speak"])(spokenMessage, politeness);
[51183] Fix | Delete
}
[51184] Fix | Delete
}, [spokenMessage, politeness]);
[51185] Fix | Delete
}
[51186] Fix | Delete
[51187] Fix | Delete
function Snackbar(_ref, ref) {
[51188] Fix | Delete
var className = _ref.className,
[51189] Fix | Delete
children = _ref.children,
[51190] Fix | Delete
_ref$spokenMessage = _ref.spokenMessage,
[51191] Fix | Delete
spokenMessage = _ref$spokenMessage === void 0 ? children : _ref$spokenMessage,
[51192] Fix | Delete
_ref$politeness = _ref.politeness,
[51193] Fix | Delete
politeness = _ref$politeness === void 0 ? 'polite' : _ref$politeness,
[51194] Fix | Delete
_ref$actions = _ref.actions,
[51195] Fix | Delete
actions = _ref$actions === void 0 ? [] : _ref$actions,
[51196] Fix | Delete
_ref$onRemove = _ref.onRemove,
[51197] Fix | Delete
onRemove = _ref$onRemove === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref$onRemove,
[51198] Fix | Delete
_ref$icon = _ref.icon,
[51199] Fix | Delete
icon = _ref$icon === void 0 ? null : _ref$icon,
[51200] Fix | Delete
_ref$explicitDismiss = _ref.explicitDismiss,
[51201] Fix | Delete
explicitDismiss = _ref$explicitDismiss === void 0 ? false : _ref$explicitDismiss,
[51202] Fix | Delete
_ref$onDismiss = _ref.onDismiss,
[51203] Fix | Delete
onDismiss = _ref$onDismiss === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref$onDismiss;
[51204] Fix | Delete
onDismiss = onDismiss || lodash__WEBPACK_IMPORTED_MODULE_1__["noop"];
[51205] Fix | Delete
[51206] Fix | Delete
function dismissMe(event) {
[51207] Fix | Delete
if (event && event.preventDefault) {
[51208] Fix | Delete
event.preventDefault();
[51209] Fix | Delete
}
[51210] Fix | Delete
[51211] Fix | Delete
onDismiss();
[51212] Fix | Delete
onRemove();
[51213] Fix | Delete
}
[51214] Fix | Delete
[51215] Fix | Delete
function onActionClick(event, onClick) {
[51216] Fix | Delete
event.stopPropagation();
[51217] Fix | Delete
onRemove();
[51218] Fix | Delete
[51219] Fix | Delete
if (onClick) {
[51220] Fix | Delete
onClick(event);
[51221] Fix | Delete
}
[51222] Fix | Delete
}
[51223] Fix | Delete
[51224] Fix | Delete
useSpokenMessage(spokenMessage, politeness); // Only set up the timeout dismiss if we're not explicitly dismissing.
[51225] Fix | Delete
[51226] Fix | Delete
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
[51227] Fix | Delete
var timeoutHandle = setTimeout(function () {
[51228] Fix | Delete
if (!explicitDismiss) {
[51229] Fix | Delete
onDismiss();
[51230] Fix | Delete
onRemove();
[51231] Fix | Delete
}
[51232] Fix | Delete
}, NOTICE_TIMEOUT);
[51233] Fix | Delete
return function () {
[51234] Fix | Delete
return clearTimeout(timeoutHandle);
[51235] Fix | Delete
};
[51236] Fix | Delete
}, [onDismiss, onRemove]);
[51237] Fix | Delete
var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, 'components-snackbar', {
[51238] Fix | Delete
'components-snackbar-explicit-dismiss': !!explicitDismiss
[51239] Fix | Delete
});
[51240] Fix | Delete
[51241] Fix | Delete
if (actions && actions.length > 1) {
[51242] Fix | Delete
// we need to inform developers that snackbar only accepts 1 action
[51243] Fix | Delete
typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default()('Snackbar can only have 1 action, use Notice if your message require many messages') : void 0; // return first element only while keeping it inside an array
[51244] Fix | Delete
[51245] Fix | Delete
actions = [actions[0]];
[51246] Fix | Delete
}
[51247] Fix | Delete
[51248] Fix | Delete
var snackbarContentClassnames = classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-snackbar__content', {
[51249] Fix | Delete
'components-snackbar__content-with-icon': !!icon
[51250] Fix | Delete
});
[51251] Fix | Delete
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
[51252] Fix | Delete
ref: ref,
[51253] Fix | Delete
className: classes,
[51254] Fix | Delete
onClick: !explicitDismiss ? dismissMe : lodash__WEBPACK_IMPORTED_MODULE_1__["noop"],
[51255] Fix | Delete
tabIndex: "0",
[51256] Fix | Delete
role: !explicitDismiss ? 'button' : '',
[51257] Fix | Delete
onKeyPress: !explicitDismiss ? dismissMe : lodash__WEBPACK_IMPORTED_MODULE_1__["noop"],
[51258] Fix | Delete
"aria-label": !explicitDismiss ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Dismiss this notice') : ''
[51259] Fix | Delete
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
[51260] Fix | Delete
className: snackbarContentClassnames
[51261] Fix | Delete
}, icon && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
[51262] Fix | Delete
className: "components-snackbar__icon"
[51263] Fix | Delete
}, icon), children, actions.map(function (_ref2, index) {
[51264] Fix | Delete
var label = _ref2.label,
[51265] Fix | Delete
_onClick = _ref2.onClick,
[51266] Fix | Delete
url = _ref2.url;
[51267] Fix | Delete
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], {
[51268] Fix | Delete
key: index,
[51269] Fix | Delete
href: url,
[51270] Fix | Delete
isTertiary: true,
[51271] Fix | Delete
onClick: function onClick(event) {
[51272] Fix | Delete
return onActionClick(event, _onClick);
[51273] Fix | Delete
},
[51274] Fix | Delete
className: "components-snackbar__action"
[51275] Fix | Delete
}, label);
[51276] Fix | Delete
}), explicitDismiss && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
[51277] Fix | Delete
role: "button",
[51278] Fix | Delete
"aria-label": "Dismiss this notice",
[51279] Fix | Delete
tabIndex: "0",
[51280] Fix | Delete
className: "components-snackbar__dismiss-button",
[51281] Fix | Delete
onClick: dismissMe,
[51282] Fix | Delete
onKeyPress: dismissMe
[51283] Fix | Delete
}, "\u2715")));
[51284] Fix | Delete
}
[51285] Fix | Delete
[51286] Fix | Delete
/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(Snackbar));
[51287] Fix | Delete
[51288] Fix | Delete
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
[51289] Fix | Delete
[51290] Fix | Delete
/***/ }),
[51291] Fix | Delete
[51292] Fix | Delete
/***/ "iClF":
[51293] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[51294] Fix | Delete
[51295] Fix | Delete
"use strict";
[51296] Fix | Delete
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("rePB");
[51297] Fix | Delete
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Ff2n");
[51298] Fix | Delete
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("GRId");
[51299] Fix | Delete
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
[51300] Fix | Delete
[51301] Fix | Delete
[51302] Fix | Delete
[51303] Fix | Delete
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
[51304] Fix | Delete
[51305] Fix | Delete
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
[51306] Fix | Delete
[51307] Fix | Delete
/**
[51308] Fix | Delete
* WordPress dependencies
[51309] Fix | Delete
*/
[51310] Fix | Delete
[51311] Fix | Delete
/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
[51312] Fix | Delete
[51313] Fix | Delete
/**
[51314] Fix | Delete
* Return an SVG icon.
[51315] Fix | Delete
*
[51316] Fix | Delete
* @param {IconProps} props icon is the SVG component to render
[51317] Fix | Delete
* size is a number specifiying the icon size in pixels
[51318] Fix | Delete
* Other props will be passed to wrapped SVG component
[51319] Fix | Delete
*
[51320] Fix | Delete
* @return {JSX.Element} Icon component
[51321] Fix | Delete
*/
[51322] Fix | Delete
[51323] Fix | Delete
function Icon(_ref) {
[51324] Fix | Delete
var icon = _ref.icon,
[51325] Fix | Delete
_ref$size = _ref.size,
[51326] Fix | Delete
size = _ref$size === void 0 ? 24 : _ref$size,
[51327] Fix | Delete
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size"]);
[51328] Fix | Delete
[51329] Fix | Delete
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(icon, _objectSpread({
[51330] Fix | Delete
width: size,
[51331] Fix | Delete
height: size
[51332] Fix | Delete
}, props));
[51333] Fix | Delete
}
[51334] Fix | Delete
[51335] Fix | Delete
/* harmony default export */ __webpack_exports__["a"] = (Icon);
[51336] Fix | Delete
[51337] Fix | Delete
[51338] Fix | Delete
/***/ }),
[51339] Fix | Delete
[51340] Fix | Delete
/***/ "iNdV":
[51341] Fix | Delete
/***/ (function(module, exports) {
[51342] Fix | Delete
[51343] Fix | Delete
var messages = {
[51344] Fix | Delete
invalidPredicate: '`predicate` must be a function',
[51345] Fix | Delete
invalidPropValidator: '`propValidator` must be a function',
[51346] Fix | Delete
requiredCore: 'is marked as required',
[51347] Fix | Delete
invalidTypeCore: 'Invalid input type',
[51348] Fix | Delete
predicateFailureCore: 'Failed to succeed with predicate',
[51349] Fix | Delete
anonymousMessage: '<<anonymous>>',
[51350] Fix | Delete
baseInvalidMessage: 'Invalid ',
[51351] Fix | Delete
};
[51352] Fix | Delete
[51353] Fix | Delete
function constructPropValidatorVariations(propValidator) {
[51354] Fix | Delete
if (typeof propValidator !== 'function') {
[51355] Fix | Delete
throw new Error(messages.invalidPropValidator);
[51356] Fix | Delete
}
[51357] Fix | Delete
[51358] Fix | Delete
var requiredPropValidator = propValidator.bind(null, false, null);
[51359] Fix | Delete
requiredPropValidator.isRequired = propValidator.bind(null, true, null);
[51360] Fix | Delete
[51361] Fix | Delete
requiredPropValidator.withPredicate = function predicateApplication(predicate) {
[51362] Fix | Delete
if (typeof predicate !== 'function') {
[51363] Fix | Delete
throw new Error(messages.invalidPredicate);
[51364] Fix | Delete
}
[51365] Fix | Delete
var basePropValidator = propValidator.bind(null, false, predicate);
[51366] Fix | Delete
basePropValidator.isRequired = propValidator.bind(null, true, predicate);
[51367] Fix | Delete
return basePropValidator;
[51368] Fix | Delete
};
[51369] Fix | Delete
[51370] Fix | Delete
return requiredPropValidator;
[51371] Fix | Delete
}
[51372] Fix | Delete
[51373] Fix | Delete
function createInvalidRequiredErrorMessage(propName, componentName, value) {
[51374] Fix | Delete
return new Error(
[51375] Fix | Delete
'The prop `' + propName + '` ' + messages.requiredCore +
[51376] Fix | Delete
' in `' + componentName + '`, but its value is `' + value + '`.'
[51377] Fix | Delete
);
[51378] Fix | Delete
}
[51379] Fix | Delete
[51380] Fix | Delete
var independentGuardianValue = -1;
[51381] Fix | Delete
[51382] Fix | Delete
function preValidationRequireCheck(isRequired, componentName, propFullName, propValue) {
[51383] Fix | Delete
var isPropValueUndefined = typeof propValue === 'undefined';
[51384] Fix | Delete
var isPropValueNull = propValue === null;
[51385] Fix | Delete
[51386] Fix | Delete
if (isRequired) {
[51387] Fix | Delete
if (isPropValueUndefined) {
[51388] Fix | Delete
return createInvalidRequiredErrorMessage(propFullName, componentName, 'undefined');
[51389] Fix | Delete
} else if (isPropValueNull) {
[51390] Fix | Delete
return createInvalidRequiredErrorMessage(propFullName, componentName, 'null');
[51391] Fix | Delete
}
[51392] Fix | Delete
}
[51393] Fix | Delete
[51394] Fix | Delete
if (isPropValueUndefined || isPropValueNull) {
[51395] Fix | Delete
return null;
[51396] Fix | Delete
}
[51397] Fix | Delete
[51398] Fix | Delete
return independentGuardianValue;
[51399] Fix | Delete
}
[51400] Fix | Delete
[51401] Fix | Delete
function createMomentChecker(type, typeValidator, validator, momentType) {
[51402] Fix | Delete
[51403] Fix | Delete
function propValidator(
[51404] Fix | Delete
isRequired, // Bound parameter to indicate with the propType is required
[51405] Fix | Delete
predicate, // Bound parameter to allow user to add dynamic validation
[51406] Fix | Delete
props,
[51407] Fix | Delete
propName,
[51408] Fix | Delete
componentName,
[51409] Fix | Delete
location,
[51410] Fix | Delete
propFullName
[51411] Fix | Delete
) {
[51412] Fix | Delete
var propValue = props[ propName ];
[51413] Fix | Delete
var propType = typeof propValue;
[51414] Fix | Delete
[51415] Fix | Delete
componentName = componentName || messages.anonymousMessage;
[51416] Fix | Delete
propFullName = propFullName || propName;
[51417] Fix | Delete
[51418] Fix | Delete
var preValidationRequireCheckValue = preValidationRequireCheck(
[51419] Fix | Delete
isRequired, componentName, propFullName, propValue
[51420] Fix | Delete
);
[51421] Fix | Delete
[51422] Fix | Delete
if (preValidationRequireCheckValue !== independentGuardianValue) {
[51423] Fix | Delete
return preValidationRequireCheckValue;
[51424] Fix | Delete
}
[51425] Fix | Delete
[51426] Fix | Delete
if (typeValidator && !typeValidator(propValue)) {
[51427] Fix | Delete
return new Error(
[51428] Fix | Delete
messages.invalidTypeCore + ': `' + propName + '` of type `' + propType + '` ' +
[51429] Fix | Delete
'supplied to `' + componentName + '`, expected `' + type + '`.'
[51430] Fix | Delete
);
[51431] Fix | Delete
}
[51432] Fix | Delete
[51433] Fix | Delete
if (!validator(propValue)) {
[51434] Fix | Delete
return new Error(
[51435] Fix | Delete
messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' +
[51436] Fix | Delete
'supplied to `' + componentName + '`, expected `' + momentType + '`.'
[51437] Fix | Delete
);
[51438] Fix | Delete
}
[51439] Fix | Delete
[51440] Fix | Delete
if (predicate && !predicate(propValue)) {
[51441] Fix | Delete
var predicateName = predicate.name || messages.anonymousMessage;
[51442] Fix | Delete
return new Error(
[51443] Fix | Delete
messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' +
[51444] Fix | Delete
'supplied to `' + componentName + '`. ' + messages.predicateFailureCore + ' `' +
[51445] Fix | Delete
predicateName + '`.'
[51446] Fix | Delete
);
[51447] Fix | Delete
}
[51448] Fix | Delete
[51449] Fix | Delete
return null;
[51450] Fix | Delete
[51451] Fix | Delete
}
[51452] Fix | Delete
[51453] Fix | Delete
return constructPropValidatorVariations(propValidator);
[51454] Fix | Delete
[51455] Fix | Delete
}
[51456] Fix | Delete
[51457] Fix | Delete
module.exports = {
[51458] Fix | Delete
constructPropValidatorVariations: constructPropValidatorVariations,
[51459] Fix | Delete
createMomentChecker: createMomentChecker,
[51460] Fix | Delete
messages: messages,
[51461] Fix | Delete
};
[51462] Fix | Delete
[51463] Fix | Delete
[51464] Fix | Delete
/***/ }),
[51465] Fix | Delete
[51466] Fix | Delete
/***/ "iOKE":
[51467] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[51468] Fix | Delete
[51469] Fix | Delete
"use strict";
[51470] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return contains; });
[51471] Fix | Delete
/**
[51472] Fix | Delete
* Similar to `Element.prototype.contains`, but a little bit faster when
[51473] Fix | Delete
* `element` is the same as `child`.
[51474] Fix | Delete
*
[51475] Fix | Delete
* @example
[51476] Fix | Delete
* import { contains } from "reakit-utils";
[51477] Fix | Delete
*
[51478] Fix | Delete
* contains(document.getElementById("parent"), document.getElementById("child"));
[51479] Fix | Delete
*/
[51480] Fix | Delete
function contains(parent, child) {
[51481] Fix | Delete
return parent === child || parent.contains(child);
[51482] Fix | Delete
}
[51483] Fix | Delete
[51484] Fix | Delete
[51485] Fix | Delete
[51486] Fix | Delete
[51487] Fix | Delete
/***/ }),
[51488] Fix | Delete
[51489] Fix | Delete
/***/ "iYXd":
[51490] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[51491] Fix | Delete
[51492] Fix | Delete
"use strict";
[51493] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return findFirstEnabledItem; });
[51494] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCurrentId; });
[51495] Fix | Delete
function findFirstEnabledItem(items, excludeId) {
[51496] Fix | Delete
if (excludeId) {
[51497] Fix | Delete
return items.find(function (item) {
[51498] Fix | Delete
return !item.disabled && item.id !== excludeId;
[51499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function