linear-react-components-ui 2.1.0-beta.0 → 2.1.0-beta.2

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.
Files changed (85) hide show
  1. package/lib/assets/styles/datepicker2.css +77 -4
  2. package/lib/inputs/number/Currency.js +19 -17
  3. package/lib/inputs/number/Currency.js.map +1 -1
  4. package/lib/inputs/number/Decimal.js +19 -17
  5. package/lib/inputs/number/Decimal.js.map +1 -1
  6. package/lib/inputs/number/index.js +17 -15
  7. package/lib/inputs/number/index.js.map +1 -1
  8. package/lib/inputs2/date/calendarbox.d.ts +23 -0
  9. package/lib/inputs2/date/calendarbox.js +254 -0
  10. package/lib/inputs2/date/calendarbox.js.map +1 -0
  11. package/lib/inputs2/date/datefield/base.js +590 -214
  12. package/lib/inputs2/date/datefield/base.js.map +1 -1
  13. package/lib/inputs2/date/datefield/triggers.js +4 -4
  14. package/lib/inputs2/date/datefield/triggers.js.map +1 -1
  15. package/lib/inputs2/date/datefield/types.d.ts +5 -12
  16. package/lib/inputs2/date/dateperiodfield/base.js +543 -674
  17. package/lib/inputs2/date/dateperiodfield/base.js.map +1 -1
  18. package/lib/inputs2/date/dateperiodfield/triggers.js +21 -9
  19. package/lib/inputs2/date/dateperiodfield/triggers.js.map +1 -1
  20. package/lib/inputs2/date/dateperiodfield/types.d.ts +7 -23
  21. package/lib/inputs2/date/helpers.d.ts +21 -4
  22. package/lib/inputs2/date/helpers.js +64 -4
  23. package/lib/inputs2/date/helpers.js.map +1 -1
  24. package/lib/inputs2/date/{base/constants.d.ts → hooks/useCalendarPosition.d.ts} +1 -1
  25. package/lib/inputs2/date/hooks/useCalendarPosition.js +93 -0
  26. package/lib/inputs2/date/hooks/useCalendarPosition.js.map +1 -0
  27. package/lib/inputs2/date/hooks/useDateCalendarState.d.ts +14 -0
  28. package/lib/inputs2/date/hooks/useDateCalendarState.js +250 -0
  29. package/lib/inputs2/date/hooks/useDateCalendarState.js.map +1 -0
  30. package/lib/inputs2/date/hooks/useDateMask.d.ts +20 -0
  31. package/lib/inputs2/date/hooks/useDateMask.js +178 -0
  32. package/lib/inputs2/date/hooks/useDateMask.js.map +1 -0
  33. package/lib/inputs2/date/timeselector.d.ts +15 -0
  34. package/lib/inputs2/date/timeselector.js +228 -0
  35. package/lib/inputs2/date/timeselector.js.map +1 -0
  36. package/lib/inputs2/date/types.d.ts +16 -1
  37. package/lib/inputs2/date/types.js.map +1 -1
  38. package/lib/inputs2/selectfield/base.js +1 -1
  39. package/lib/inputs2/selectfield/base.js.map +1 -1
  40. package/lib/menus/float/SubMenuContainer.d.ts +10 -28
  41. package/lib/menus/float/SubMenuContainer.js +97 -83
  42. package/lib/menus/float/SubMenuContainer.js.map +1 -1
  43. package/lib/node_modules/moment/dist/locale/pt-br.js +54 -0
  44. package/lib/node_modules/moment/dist/locale/pt-br.js.map +1 -0
  45. package/lib/treetable/helpers.d.ts +0 -2
  46. package/lib/treetable/helpers.js.map +1 -1
  47. package/package.json +1 -1
  48. package/lib/_virtual/index.js +0 -8
  49. package/lib/_virtual/index.js.map +0 -1
  50. package/lib/_virtual/index2.js +0 -5
  51. package/lib/_virtual/index2.js.map +0 -1
  52. package/lib/_virtual/index3.js +0 -5
  53. package/lib/_virtual/index3.js.map +0 -1
  54. package/lib/_virtual/react-is.development.js +0 -5
  55. package/lib/_virtual/react-is.development.js.map +0 -1
  56. package/lib/_virtual/react-is.production.min.js +0 -5
  57. package/lib/_virtual/react-is.production.min.js.map +0 -1
  58. package/lib/inputs2/date/base/constants.js +0 -69
  59. package/lib/inputs2/date/base/constants.js.map +0 -1
  60. package/lib/inputs2/date/datefield/calendarbox.d.ts +0 -6
  61. package/lib/inputs2/date/datefield/calendarbox.js +0 -228
  62. package/lib/inputs2/date/datefield/calendarbox.js.map +0 -1
  63. package/lib/inputs2/date/dateperiodfield/calendarbox.d.ts +0 -6
  64. package/lib/inputs2/date/dateperiodfield/calendarbox.js +0 -282
  65. package/lib/inputs2/date/dateperiodfield/calendarbox.js.map +0 -1
  66. package/lib/node_modules/object-assign/index.js +0 -79
  67. package/lib/node_modules/object-assign/index.js.map +0 -1
  68. package/lib/node_modules/prop-types/checkPropTypes.js +0 -69
  69. package/lib/node_modules/prop-types/checkPropTypes.js.map +0 -1
  70. package/lib/node_modules/prop-types/factoryWithThrowingShims.js +0 -59
  71. package/lib/node_modules/prop-types/factoryWithThrowingShims.js.map +0 -1
  72. package/lib/node_modules/prop-types/factoryWithTypeCheckers.js +0 -452
  73. package/lib/node_modules/prop-types/factoryWithTypeCheckers.js.map +0 -1
  74. package/lib/node_modules/prop-types/index.js +0 -21
  75. package/lib/node_modules/prop-types/index.js.map +0 -1
  76. package/lib/node_modules/prop-types/lib/ReactPropTypesSecret.js +0 -13
  77. package/lib/node_modules/prop-types/lib/ReactPropTypesSecret.js.map +0 -1
  78. package/lib/node_modules/prop-types/lib/has.js +0 -12
  79. package/lib/node_modules/prop-types/lib/has.js.map +0 -1
  80. package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -166
  81. package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js.map +0 -1
  82. package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -107
  83. package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js.map +0 -1
  84. package/lib/node_modules/prop-types/node_modules/react-is/index.js +0 -18
  85. package/lib/node_modules/prop-types/node_modules/react-is/index.js.map +0 -1
@@ -1,69 +0,0 @@
1
- import { __require as requireReactPropTypesSecret } from "./lib/ReactPropTypesSecret.js";
2
- import { __require as requireHas } from "./lib/has.js";
3
- var checkPropTypes_1;
4
- var hasRequiredCheckPropTypes;
5
- function requireCheckPropTypes() {
6
- if (hasRequiredCheckPropTypes) return checkPropTypes_1;
7
- hasRequiredCheckPropTypes = 1;
8
- var printWarning = function() {
9
- };
10
- if (process.env.NODE_ENV !== "production") {
11
- var ReactPropTypesSecret = /* @__PURE__ */ requireReactPropTypesSecret();
12
- var loggedTypeFailures = {};
13
- var has = /* @__PURE__ */ requireHas();
14
- printWarning = function(text) {
15
- var message = "Warning: " + text;
16
- if (typeof console !== "undefined") {
17
- console.error(message);
18
- }
19
- try {
20
- throw new Error(message);
21
- } catch (x) {
22
- }
23
- };
24
- }
25
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
26
- if (process.env.NODE_ENV !== "production") {
27
- for (var typeSpecName in typeSpecs) {
28
- if (has(typeSpecs, typeSpecName)) {
29
- var error;
30
- try {
31
- if (typeof typeSpecs[typeSpecName] !== "function") {
32
- var err = Error(
33
- (componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
34
- );
35
- err.name = "Invariant Violation";
36
- throw err;
37
- }
38
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
39
- } catch (ex) {
40
- error = ex;
41
- }
42
- if (error && !(error instanceof Error)) {
43
- printWarning(
44
- (componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
45
- );
46
- }
47
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
48
- loggedTypeFailures[error.message] = true;
49
- var stack = getStack ? getStack() : "";
50
- printWarning(
51
- "Failed " + location + " type: " + error.message + (stack != null ? stack : "")
52
- );
53
- }
54
- }
55
- }
56
- }
57
- }
58
- checkPropTypes.resetWarningCache = function() {
59
- if (process.env.NODE_ENV !== "production") {
60
- loggedTypeFailures = {};
61
- }
62
- };
63
- checkPropTypes_1 = checkPropTypes;
64
- return checkPropTypes_1;
65
- }
66
- export {
67
- requireCheckPropTypes as __require
68
- };
69
- //# sourceMappingURL=checkPropTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkPropTypes.js","sources":["../../../node_modules/prop-types/checkPropTypes.js"],"sourcesContent":["/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n var has = require('./lib/has');\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) { /**/ }\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +\n 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n );\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (process.env.NODE_ENV !== 'production') {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\n"],"names":["require$$0","require$$1"],"mappings":";;;;;;;AASA,MAAI,eAAe,WAAW;AAAA,EAAA;AAE9B,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,uBAAuBA,4CAAA;AAC3B,QAAI,qBAAqB,CAAA;AACzB,QAAI,MAAMC,2BAAA;AAEV,mBAAe,SAAS,MAAM;AAC5B,UAAI,UAAU,cAAc;AAC5B,UAAI,OAAO,YAAY,aAAa;AAClC,gBAAQ,MAAM,OAAO;AAAA,MAC3B;AACI,UAAI;AAIF,cAAM,IAAI,MAAM,OAAO;AAAA,MAC7B,SAAa,GAAG;AAAA,MAAA;AAAA,IAChB;AAAA,EACA;AAaA,WAAS,eAAe,WAAW,QAAQ,UAAU,eAAe,UAAU;AAC5E,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,eAAS,gBAAgB,WAAW;AAClC,YAAI,IAAI,WAAW,YAAY,GAAG;AAChC,cAAI;AAIJ,cAAI;AAGF,gBAAI,OAAO,UAAU,YAAY,MAAM,YAAY;AACjD,kBAAI,MAAM;AAAA,iBACP,iBAAiB,iBAAiB,OAAO,WAAW,YAAY,eAAe,+FACC,OAAO,UAAU,YAAY,IAAI;AAAA;AAGpH,kBAAI,OAAO;AACX,oBAAM;AAAA,YAClB;AACU,oBAAQ,UAAU,YAAY,EAAE,QAAQ,cAAc,eAAe,UAAU,MAAM,oBAAoB;AAAA,UACnH,SAAiB,IAAI;AACX,oBAAQ;AAAA,UAClB;AACQ,cAAI,SAAS,EAAE,iBAAiB,QAAQ;AACtC;AAAA,eACG,iBAAiB,iBAAiB,6BACnC,WAAW,OAAO,eAAe,6FAC6B,OAAO,QAAQ;AAAA;UAKzF;AACQ,cAAI,iBAAiB,SAAS,EAAE,MAAM,WAAW,qBAAqB;AAGpE,+BAAmB,MAAM,OAAO,IAAI;AAEpC,gBAAI,QAAQ,WAAW,SAAQ,IAAK;AAEpC;AAAA,cACE,YAAY,WAAW,YAAY,MAAM,WAAW,SAAS,OAAO,QAAQ;AAAA;UAExF;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAOA,iBAAe,oBAAoB,WAAW;AAC5C,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,2BAAqB,CAAA;AAAA,IACzB;AAAA,EACA;AAEA,qBAAiB;;;","x_google_ignoreList":[0]}
@@ -1,59 +0,0 @@
1
- import { __require as requireReactPropTypesSecret } from "./lib/ReactPropTypesSecret.js";
2
- var factoryWithThrowingShims;
3
- var hasRequiredFactoryWithThrowingShims;
4
- function requireFactoryWithThrowingShims() {
5
- if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
6
- hasRequiredFactoryWithThrowingShims = 1;
7
- var ReactPropTypesSecret = /* @__PURE__ */ requireReactPropTypesSecret();
8
- function emptyFunction() {
9
- }
10
- function emptyFunctionWithReset() {
11
- }
12
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
13
- factoryWithThrowingShims = function() {
14
- function shim(props, propName, componentName, location, propFullName, secret) {
15
- if (secret === ReactPropTypesSecret) {
16
- return;
17
- }
18
- var err = new Error(
19
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
20
- );
21
- err.name = "Invariant Violation";
22
- throw err;
23
- }
24
- shim.isRequired = shim;
25
- function getShim() {
26
- return shim;
27
- }
28
- var ReactPropTypes = {
29
- array: shim,
30
- bigint: shim,
31
- bool: shim,
32
- func: shim,
33
- number: shim,
34
- object: shim,
35
- string: shim,
36
- symbol: shim,
37
- any: shim,
38
- arrayOf: getShim,
39
- element: shim,
40
- elementType: shim,
41
- instanceOf: getShim,
42
- node: shim,
43
- objectOf: getShim,
44
- oneOf: getShim,
45
- oneOfType: getShim,
46
- shape: getShim,
47
- exact: getShim,
48
- checkPropTypes: emptyFunctionWithReset,
49
- resetWarningCache: emptyFunction
50
- };
51
- ReactPropTypes.PropTypes = ReactPropTypes;
52
- return ReactPropTypes;
53
- };
54
- return factoryWithThrowingShims;
55
- }
56
- export {
57
- requireFactoryWithThrowingShims as __require
58
- };
59
- //# sourceMappingURL=factoryWithThrowingShims.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"factoryWithThrowingShims.js","sources":["../../../node_modules/prop-types/factoryWithThrowingShims.js"],"sourcesContent":["/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n"],"names":["require$$0"],"mappings":";;;;;;AASA,MAAI,uBAAuBA,4CAAA;AAE3B,WAAS,gBAAgB;AAAA,EAAA;AACzB,WAAS,yBAAyB;AAAA,EAAA;AAClC,yBAAuB,oBAAoB;AAE3C,6BAAiB,WAAW;AAC1B,aAAS,KAAK,OAAO,UAAU,eAAe,UAAU,cAAc,QAAQ;AAC5E,UAAI,WAAW,sBAAsB;AAEnC;AAAA,MACN;AACI,UAAI,MAAM,IAAI;AAAA,QACZ;AAAA;AAIF,UAAI,OAAO;AACX,YAAM;AAAA,IACV;AACE,SAAK,aAAa;AAClB,aAAS,UAAU;AACjB,aAAO;AAAA,IACX;AAGE,QAAI,iBAAiB;AAAA,MACnB,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,QAAQ;AAAA,MAER,KAAK;AAAA,MACL,SAAS;AAAA,MACT,SAAS;AAAA,MACT,aAAa;AAAA,MACb,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,MACP,WAAW;AAAA,MACX,OAAO;AAAA,MACP,OAAO;AAAA,MAEP,gBAAgB;AAAA,MAChB,mBAAmB;AAAA;AAGrB,mBAAe,YAAY;AAE3B,WAAO;AAAA,EACT;;;","x_google_ignoreList":[0]}
@@ -1,452 +0,0 @@
1
- import { __require as requireReactIs } from "./node_modules/react-is/index.js";
2
- import { __require as requireObjectAssign } from "../object-assign/index.js";
3
- import { __require as requireReactPropTypesSecret } from "./lib/ReactPropTypesSecret.js";
4
- import { __require as requireHas } from "./lib/has.js";
5
- import { __require as requireCheckPropTypes } from "./checkPropTypes.js";
6
- var factoryWithTypeCheckers;
7
- var hasRequiredFactoryWithTypeCheckers;
8
- function requireFactoryWithTypeCheckers() {
9
- if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
10
- hasRequiredFactoryWithTypeCheckers = 1;
11
- var ReactIs = requireReactIs();
12
- var assign = requireObjectAssign();
13
- var ReactPropTypesSecret = /* @__PURE__ */ requireReactPropTypesSecret();
14
- var has = /* @__PURE__ */ requireHas();
15
- var checkPropTypes = /* @__PURE__ */ requireCheckPropTypes();
16
- var printWarning = function() {
17
- };
18
- if (process.env.NODE_ENV !== "production") {
19
- printWarning = function(text) {
20
- var message = "Warning: " + text;
21
- if (typeof console !== "undefined") {
22
- console.error(message);
23
- }
24
- try {
25
- throw new Error(message);
26
- } catch (x) {
27
- }
28
- };
29
- }
30
- function emptyFunctionThatReturnsNull() {
31
- return null;
32
- }
33
- factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
34
- var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
35
- var FAUX_ITERATOR_SYMBOL = "@@iterator";
36
- function getIteratorFn(maybeIterable) {
37
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
38
- if (typeof iteratorFn === "function") {
39
- return iteratorFn;
40
- }
41
- }
42
- var ANONYMOUS = "<<anonymous>>";
43
- var ReactPropTypes = {
44
- array: createPrimitiveTypeChecker("array"),
45
- bigint: createPrimitiveTypeChecker("bigint"),
46
- bool: createPrimitiveTypeChecker("boolean"),
47
- func: createPrimitiveTypeChecker("function"),
48
- number: createPrimitiveTypeChecker("number"),
49
- object: createPrimitiveTypeChecker("object"),
50
- string: createPrimitiveTypeChecker("string"),
51
- symbol: createPrimitiveTypeChecker("symbol"),
52
- any: createAnyTypeChecker(),
53
- arrayOf: createArrayOfTypeChecker,
54
- element: createElementTypeChecker(),
55
- elementType: createElementTypeTypeChecker(),
56
- instanceOf: createInstanceTypeChecker,
57
- node: createNodeChecker(),
58
- objectOf: createObjectOfTypeChecker,
59
- oneOf: createEnumTypeChecker,
60
- oneOfType: createUnionTypeChecker,
61
- shape: createShapeTypeChecker,
62
- exact: createStrictShapeTypeChecker
63
- };
64
- function is(x, y) {
65
- if (x === y) {
66
- return x !== 0 || 1 / x === 1 / y;
67
- } else {
68
- return x !== x && y !== y;
69
- }
70
- }
71
- function PropTypeError(message, data) {
72
- this.message = message;
73
- this.data = data && typeof data === "object" ? data : {};
74
- this.stack = "";
75
- }
76
- PropTypeError.prototype = Error.prototype;
77
- function createChainableTypeChecker(validate) {
78
- if (process.env.NODE_ENV !== "production") {
79
- var manualPropTypeCallCache = {};
80
- var manualPropTypeWarningCount = 0;
81
- }
82
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
83
- componentName = componentName || ANONYMOUS;
84
- propFullName = propFullName || propName;
85
- if (secret !== ReactPropTypesSecret) {
86
- if (throwOnDirectAccess) {
87
- var err = new Error(
88
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
89
- );
90
- err.name = "Invariant Violation";
91
- throw err;
92
- } else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
93
- var cacheKey = componentName + ":" + propName;
94
- if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
95
- manualPropTypeWarningCount < 3) {
96
- printWarning(
97
- "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
98
- );
99
- manualPropTypeCallCache[cacheKey] = true;
100
- manualPropTypeWarningCount++;
101
- }
102
- }
103
- }
104
- if (props[propName] == null) {
105
- if (isRequired) {
106
- if (props[propName] === null) {
107
- return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
108
- }
109
- return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
110
- }
111
- return null;
112
- } else {
113
- return validate(props, propName, componentName, location, propFullName);
114
- }
115
- }
116
- var chainedCheckType = checkType.bind(null, false);
117
- chainedCheckType.isRequired = checkType.bind(null, true);
118
- return chainedCheckType;
119
- }
120
- function createPrimitiveTypeChecker(expectedType) {
121
- function validate(props, propName, componentName, location, propFullName, secret) {
122
- var propValue = props[propName];
123
- var propType = getPropType(propValue);
124
- if (propType !== expectedType) {
125
- var preciseType = getPreciseType(propValue);
126
- return new PropTypeError(
127
- "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
128
- { expectedType }
129
- );
130
- }
131
- return null;
132
- }
133
- return createChainableTypeChecker(validate);
134
- }
135
- function createAnyTypeChecker() {
136
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
137
- }
138
- function createArrayOfTypeChecker(typeChecker) {
139
- function validate(props, propName, componentName, location, propFullName) {
140
- if (typeof typeChecker !== "function") {
141
- return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
142
- }
143
- var propValue = props[propName];
144
- if (!Array.isArray(propValue)) {
145
- var propType = getPropType(propValue);
146
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
147
- }
148
- for (var i = 0; i < propValue.length; i++) {
149
- var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
150
- if (error instanceof Error) {
151
- return error;
152
- }
153
- }
154
- return null;
155
- }
156
- return createChainableTypeChecker(validate);
157
- }
158
- function createElementTypeChecker() {
159
- function validate(props, propName, componentName, location, propFullName) {
160
- var propValue = props[propName];
161
- if (!isValidElement(propValue)) {
162
- var propType = getPropType(propValue);
163
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
164
- }
165
- return null;
166
- }
167
- return createChainableTypeChecker(validate);
168
- }
169
- function createElementTypeTypeChecker() {
170
- function validate(props, propName, componentName, location, propFullName) {
171
- var propValue = props[propName];
172
- if (!ReactIs.isValidElementType(propValue)) {
173
- var propType = getPropType(propValue);
174
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
175
- }
176
- return null;
177
- }
178
- return createChainableTypeChecker(validate);
179
- }
180
- function createInstanceTypeChecker(expectedClass) {
181
- function validate(props, propName, componentName, location, propFullName) {
182
- if (!(props[propName] instanceof expectedClass)) {
183
- var expectedClassName = expectedClass.name || ANONYMOUS;
184
- var actualClassName = getClassName(props[propName]);
185
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
186
- }
187
- return null;
188
- }
189
- return createChainableTypeChecker(validate);
190
- }
191
- function createEnumTypeChecker(expectedValues) {
192
- if (!Array.isArray(expectedValues)) {
193
- if (process.env.NODE_ENV !== "production") {
194
- if (arguments.length > 1) {
195
- printWarning(
196
- "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
197
- );
198
- } else {
199
- printWarning("Invalid argument supplied to oneOf, expected an array.");
200
- }
201
- }
202
- return emptyFunctionThatReturnsNull;
203
- }
204
- function validate(props, propName, componentName, location, propFullName) {
205
- var propValue = props[propName];
206
- for (var i = 0; i < expectedValues.length; i++) {
207
- if (is(propValue, expectedValues[i])) {
208
- return null;
209
- }
210
- }
211
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
212
- var type = getPreciseType(value);
213
- if (type === "symbol") {
214
- return String(value);
215
- }
216
- return value;
217
- });
218
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
219
- }
220
- return createChainableTypeChecker(validate);
221
- }
222
- function createObjectOfTypeChecker(typeChecker) {
223
- function validate(props, propName, componentName, location, propFullName) {
224
- if (typeof typeChecker !== "function") {
225
- return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
226
- }
227
- var propValue = props[propName];
228
- var propType = getPropType(propValue);
229
- if (propType !== "object") {
230
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
231
- }
232
- for (var key in propValue) {
233
- if (has(propValue, key)) {
234
- var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
235
- if (error instanceof Error) {
236
- return error;
237
- }
238
- }
239
- }
240
- return null;
241
- }
242
- return createChainableTypeChecker(validate);
243
- }
244
- function createUnionTypeChecker(arrayOfTypeCheckers) {
245
- if (!Array.isArray(arrayOfTypeCheckers)) {
246
- process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
247
- return emptyFunctionThatReturnsNull;
248
- }
249
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
250
- var checker = arrayOfTypeCheckers[i];
251
- if (typeof checker !== "function") {
252
- printWarning(
253
- "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
254
- );
255
- return emptyFunctionThatReturnsNull;
256
- }
257
- }
258
- function validate(props, propName, componentName, location, propFullName) {
259
- var expectedTypes = [];
260
- for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
261
- var checker2 = arrayOfTypeCheckers[i2];
262
- var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
263
- if (checkerResult == null) {
264
- return null;
265
- }
266
- if (checkerResult.data && has(checkerResult.data, "expectedType")) {
267
- expectedTypes.push(checkerResult.data.expectedType);
268
- }
269
- }
270
- var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
271
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
272
- }
273
- return createChainableTypeChecker(validate);
274
- }
275
- function createNodeChecker() {
276
- function validate(props, propName, componentName, location, propFullName) {
277
- if (!isNode(props[propName])) {
278
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
279
- }
280
- return null;
281
- }
282
- return createChainableTypeChecker(validate);
283
- }
284
- function invalidValidatorError(componentName, location, propFullName, key, type) {
285
- return new PropTypeError(
286
- (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
287
- );
288
- }
289
- function createShapeTypeChecker(shapeTypes) {
290
- function validate(props, propName, componentName, location, propFullName) {
291
- var propValue = props[propName];
292
- var propType = getPropType(propValue);
293
- if (propType !== "object") {
294
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
295
- }
296
- for (var key in shapeTypes) {
297
- var checker = shapeTypes[key];
298
- if (typeof checker !== "function") {
299
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
300
- }
301
- var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
302
- if (error) {
303
- return error;
304
- }
305
- }
306
- return null;
307
- }
308
- return createChainableTypeChecker(validate);
309
- }
310
- function createStrictShapeTypeChecker(shapeTypes) {
311
- function validate(props, propName, componentName, location, propFullName) {
312
- var propValue = props[propName];
313
- var propType = getPropType(propValue);
314
- if (propType !== "object") {
315
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
316
- }
317
- var allKeys = assign({}, props[propName], shapeTypes);
318
- for (var key in allKeys) {
319
- var checker = shapeTypes[key];
320
- if (has(shapeTypes, key) && typeof checker !== "function") {
321
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
322
- }
323
- if (!checker) {
324
- return new PropTypeError(
325
- "Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
326
- );
327
- }
328
- var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
329
- if (error) {
330
- return error;
331
- }
332
- }
333
- return null;
334
- }
335
- return createChainableTypeChecker(validate);
336
- }
337
- function isNode(propValue) {
338
- switch (typeof propValue) {
339
- case "number":
340
- case "string":
341
- case "undefined":
342
- return true;
343
- case "boolean":
344
- return !propValue;
345
- case "object":
346
- if (Array.isArray(propValue)) {
347
- return propValue.every(isNode);
348
- }
349
- if (propValue === null || isValidElement(propValue)) {
350
- return true;
351
- }
352
- var iteratorFn = getIteratorFn(propValue);
353
- if (iteratorFn) {
354
- var iterator = iteratorFn.call(propValue);
355
- var step;
356
- if (iteratorFn !== propValue.entries) {
357
- while (!(step = iterator.next()).done) {
358
- if (!isNode(step.value)) {
359
- return false;
360
- }
361
- }
362
- } else {
363
- while (!(step = iterator.next()).done) {
364
- var entry = step.value;
365
- if (entry) {
366
- if (!isNode(entry[1])) {
367
- return false;
368
- }
369
- }
370
- }
371
- }
372
- } else {
373
- return false;
374
- }
375
- return true;
376
- default:
377
- return false;
378
- }
379
- }
380
- function isSymbol(propType, propValue) {
381
- if (propType === "symbol") {
382
- return true;
383
- }
384
- if (!propValue) {
385
- return false;
386
- }
387
- if (propValue["@@toStringTag"] === "Symbol") {
388
- return true;
389
- }
390
- if (typeof Symbol === "function" && propValue instanceof Symbol) {
391
- return true;
392
- }
393
- return false;
394
- }
395
- function getPropType(propValue) {
396
- var propType = typeof propValue;
397
- if (Array.isArray(propValue)) {
398
- return "array";
399
- }
400
- if (propValue instanceof RegExp) {
401
- return "object";
402
- }
403
- if (isSymbol(propType, propValue)) {
404
- return "symbol";
405
- }
406
- return propType;
407
- }
408
- function getPreciseType(propValue) {
409
- if (typeof propValue === "undefined" || propValue === null) {
410
- return "" + propValue;
411
- }
412
- var propType = getPropType(propValue);
413
- if (propType === "object") {
414
- if (propValue instanceof Date) {
415
- return "date";
416
- } else if (propValue instanceof RegExp) {
417
- return "regexp";
418
- }
419
- }
420
- return propType;
421
- }
422
- function getPostfixForTypeWarning(value) {
423
- var type = getPreciseType(value);
424
- switch (type) {
425
- case "array":
426
- case "object":
427
- return "an " + type;
428
- case "boolean":
429
- case "date":
430
- case "regexp":
431
- return "a " + type;
432
- default:
433
- return type;
434
- }
435
- }
436
- function getClassName(propValue) {
437
- if (!propValue.constructor || !propValue.constructor.name) {
438
- return ANONYMOUS;
439
- }
440
- return propValue.constructor.name;
441
- }
442
- ReactPropTypes.checkPropTypes = checkPropTypes;
443
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
444
- ReactPropTypes.PropTypes = ReactPropTypes;
445
- return ReactPropTypes;
446
- };
447
- return factoryWithTypeCheckers;
448
- }
449
- export {
450
- requireFactoryWithTypeCheckers as __require
451
- };
452
- //# sourceMappingURL=factoryWithTypeCheckers.js.map