grommet 2.46.1 → 2.47.0
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/components/Accordion/index.d.ts +7 -1
- package/components/AccordionPanel/index.d.ts +4 -1
- package/components/Anchor/index.d.ts +7 -1
- package/components/Avatar/Avatar.js +4 -3
- package/components/Avatar/index.d.ts +9 -1
- package/components/Avatar/propTypes.js +2 -1
- package/components/Box/StyledBox.js +9 -1
- package/components/Box/index.d.ts +9 -2
- package/components/Button/index.d.ts +14 -2
- package/components/Calendar/Calendar.js +43 -32
- package/components/Calendar/StyledCalendar.js +86 -32
- package/components/Calendar/index.d.ts +15 -2
- package/components/Calendar/propTypes.js +1 -0
- package/components/Cards/index.d.ts +7 -1
- package/components/Carousel/index.d.ts +4 -1
- package/components/Chart/index.d.ts +7 -1
- package/components/CheckBox/index.d.ts +7 -1
- package/components/CheckBoxGroup/index.d.ts +15 -2
- package/components/Clock/index.d.ts +14 -2
- package/components/Collapsible/index.d.ts +4 -1
- package/components/Data/index.d.ts +4 -1
- package/components/DataFilter/index.d.ts +4 -1
- package/components/DataFilters/index.d.ts +4 -1
- package/components/DataTable/Body.js +13 -7
- package/components/DataTable/DataTable.js +6 -1
- package/components/DataTable/index.d.ts +11 -2
- package/components/DataTable/propTypes.js +5 -1
- package/components/DataTable/stories/rowDetails.stories.js +174 -66
- package/components/DataTable/stories/typescript/OnSelect.stories.tsx +3 -3
- package/components/DataTableGroupBy/index.d.ts +4 -1
- package/components/DataView/index.d.ts +4 -1
- package/components/DateInput/index.d.ts +4 -1
- package/components/Diagram/index.d.ts +4 -1
- package/components/Distribution/index.d.ts +4 -1
- package/components/Drop/StyledDrop.js +3 -1
- package/components/Drop/index.d.ts +6 -2
- package/components/DropButton/index.d.ts +8 -1
- package/components/FileInput/index.d.ts +8 -2
- package/components/Form/index.d.ts +7 -1
- package/components/FormField/index.d.ts +4 -1
- package/components/Grid/index.d.ts +4 -1
- package/components/Grommet/index.d.ts +18 -1
- package/components/Grommet/propTypes.js +11 -0
- package/components/Header/stories/typescript/Ref.stories.tsx +1 -1
- package/components/Heading/index.d.ts +7 -7
- package/components/Image/index.d.ts +4 -1
- package/components/InfiniteScroll/index.d.ts +2 -2
- package/components/Layer/index.d.ts +4 -1
- package/components/List/index.d.ts +9 -3
- package/components/Markdown/index.d.ts +5 -1
- package/components/MaskedInput/MaskedInput.js +49 -4
- package/components/MaskedInput/index.d.ts +7 -1
- package/components/MaskedInput/stories/CustomBox.stories.js +1 -0
- package/components/MaskedInput/stories/Date.stories.js +1 -0
- package/components/MaskedInput/stories/DateRange.stories.js +1 -0
- package/components/MaskedInput/stories/DateTimeDrop.stories.js +1 -0
- package/components/MaskedInput/stories/Filtered.stories.js +1 -0
- package/components/MaskedInput/stories/SizeUnits.stories.js +1 -0
- package/components/MaskedInput/stories/Time.stories.js +1 -0
- package/components/NameValueList/index.d.ts +8 -1
- package/components/Notification/index.d.ts +1 -0
- package/components/PageHeader/index.d.ts +5 -1
- package/components/Pagination/PaginationStep.js +4 -0
- package/components/Pagination/index.d.ts +5 -0
- package/components/Pagination/propTypes.js +6 -1
- package/components/Paragraph/index.d.ts +7 -1
- package/components/RadioButton/index.d.ts +7 -1
- package/components/RadioButtonGroup/index.d.ts +7 -1
- package/components/RangeInput/index.d.ts +7 -1
- package/components/RangeSelector/index.d.ts +15 -2
- package/components/RoutedAnchor/index.d.ts +3 -2
- package/components/RoutedButton/index.d.ts +3 -2
- package/components/Select/Select.js +2 -4
- package/components/Select/index.d.ts +7 -1
- package/components/Select/utils.js +12 -3
- package/components/SelectMultiple/SelectMultiple.js +5 -10
- package/components/SelectMultiple/SelectMultipleContainer.js +2 -4
- package/components/SelectMultiple/SelectMultipleValue.js +1 -2
- package/components/SelectMultiple/index.d.ts +7 -1
- package/components/Sidebar/index.d.ts +4 -1
- package/components/Stack/index.d.ts +4 -1
- package/components/Tab/index.d.ts +7 -1
- package/components/Table/index.d.ts +4 -1
- package/components/TableBody/index.d.ts +4 -1
- package/components/TableCell/index.d.ts +10 -3
- package/components/TableFooter/index.d.ts +4 -1
- package/components/TableHeader/index.d.ts +4 -1
- package/components/TableRow/index.d.ts +4 -1
- package/components/Tabs/index.d.ts +4 -1
- package/components/Tag/Tag.js +15 -1
- package/components/Tag/index.d.ts +6 -0
- package/components/Tag/propTypes.js +6 -0
- package/components/Text/Text.js +3 -2
- package/components/Text/index.d.ts +7 -1
- package/components/TextArea/index.d.ts +7 -1
- package/components/TextInput/TextInput.js +6 -2
- package/components/TextInput/index.d.ts +6 -3
- package/components/TextInput/stories/CustomThemed/CustomSuggestions.stories.tsx +2 -1
- package/components/TextInput/stories/CustomThemed/Themed.stories.js +1 -0
- package/components/TextInput/stories/OnSelect.stories.js +1 -0
- package/components/TextInput/stories/WithTags.stories.js +1 -0
- package/components/Tip/Tip.js +16 -1
- package/components/ToggleGroup/index.d.ts +7 -1
- package/components/Toolbar/index.d.ts +5 -2
- package/components/Video/index.d.ts +7 -1
- package/components/WorldMap/index.d.ts +7 -1
- package/es6/components/Accordion/index.d.ts +7 -1
- package/es6/components/AccordionPanel/index.d.ts +4 -1
- package/es6/components/Anchor/index.d.ts +7 -1
- package/es6/components/Avatar/Avatar.js +4 -3
- package/es6/components/Avatar/index.d.ts +9 -1
- package/es6/components/Avatar/propTypes.js +2 -1
- package/es6/components/Box/StyledBox.js +8 -1
- package/es6/components/Box/index.d.ts +9 -2
- package/es6/components/Button/index.d.ts +14 -2
- package/es6/components/Calendar/Calendar.js +44 -32
- package/es6/components/Calendar/StyledCalendar.js +86 -32
- package/es6/components/Calendar/index.d.ts +15 -2
- package/es6/components/Calendar/propTypes.js +1 -0
- package/es6/components/Cards/index.d.ts +7 -1
- package/es6/components/Carousel/index.d.ts +4 -1
- package/es6/components/Chart/index.d.ts +7 -1
- package/es6/components/CheckBox/index.d.ts +7 -1
- package/es6/components/CheckBoxGroup/index.d.ts +15 -2
- package/es6/components/Clock/index.d.ts +14 -2
- package/es6/components/Collapsible/index.d.ts +4 -1
- package/es6/components/Data/index.d.ts +4 -1
- package/es6/components/DataFilter/index.d.ts +4 -1
- package/es6/components/DataFilters/index.d.ts +4 -1
- package/es6/components/DataTable/Body.js +13 -7
- package/es6/components/DataTable/DataTable.js +6 -1
- package/es6/components/DataTable/index.d.ts +11 -2
- package/es6/components/DataTable/propTypes.js +5 -1
- package/es6/components/DataTable/stories/rowDetails.stories.js +172 -66
- package/es6/components/DataTable/stories/typescript/OnSelect.stories.tsx +3 -3
- package/es6/components/DataTableGroupBy/index.d.ts +4 -1
- package/es6/components/DataView/index.d.ts +4 -1
- package/es6/components/DateInput/index.d.ts +4 -1
- package/es6/components/Diagram/index.d.ts +4 -1
- package/es6/components/Distribution/index.d.ts +4 -1
- package/es6/components/Drop/StyledDrop.js +3 -1
- package/es6/components/Drop/index.d.ts +6 -2
- package/es6/components/DropButton/index.d.ts +8 -1
- package/es6/components/FileInput/index.d.ts +8 -2
- package/es6/components/Form/index.d.ts +7 -1
- package/es6/components/FormField/index.d.ts +4 -1
- package/es6/components/Grid/index.d.ts +4 -1
- package/es6/components/Grommet/index.d.ts +18 -1
- package/es6/components/Grommet/propTypes.js +11 -0
- package/es6/components/Header/stories/typescript/Ref.stories.tsx +1 -1
- package/es6/components/Heading/index.d.ts +7 -7
- package/es6/components/Image/index.d.ts +4 -1
- package/es6/components/InfiniteScroll/index.d.ts +2 -2
- package/es6/components/Layer/index.d.ts +4 -1
- package/es6/components/List/index.d.ts +9 -3
- package/es6/components/Markdown/index.d.ts +5 -1
- package/es6/components/MaskedInput/MaskedInput.js +49 -4
- package/es6/components/MaskedInput/index.d.ts +7 -1
- package/es6/components/MaskedInput/stories/CustomBox.stories.js +1 -0
- package/es6/components/MaskedInput/stories/Date.stories.js +1 -0
- package/es6/components/MaskedInput/stories/DateRange.stories.js +1 -0
- package/es6/components/MaskedInput/stories/DateTimeDrop.stories.js +1 -0
- package/es6/components/MaskedInput/stories/Filtered.stories.js +1 -0
- package/es6/components/MaskedInput/stories/SizeUnits.stories.js +1 -0
- package/es6/components/MaskedInput/stories/Time.stories.js +1 -0
- package/es6/components/NameValueList/index.d.ts +8 -1
- package/es6/components/Notification/index.d.ts +1 -0
- package/es6/components/PageHeader/index.d.ts +5 -1
- package/es6/components/Pagination/PaginationStep.js +4 -0
- package/es6/components/Pagination/index.d.ts +5 -0
- package/es6/components/Pagination/propTypes.js +6 -1
- package/es6/components/Paragraph/index.d.ts +7 -1
- package/es6/components/RadioButton/index.d.ts +7 -1
- package/es6/components/RadioButtonGroup/index.d.ts +7 -1
- package/es6/components/RangeInput/index.d.ts +7 -1
- package/es6/components/RangeSelector/index.d.ts +15 -2
- package/es6/components/RoutedAnchor/index.d.ts +3 -2
- package/es6/components/RoutedButton/index.d.ts +3 -2
- package/es6/components/Select/Select.js +3 -5
- package/es6/components/Select/index.d.ts +7 -1
- package/es6/components/Select/utils.js +9 -2
- package/es6/components/SelectMultiple/SelectMultiple.js +6 -11
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +3 -5
- package/es6/components/SelectMultiple/SelectMultipleValue.js +2 -3
- package/es6/components/SelectMultiple/index.d.ts +7 -1
- package/es6/components/Sidebar/index.d.ts +4 -1
- package/es6/components/Stack/index.d.ts +4 -1
- package/es6/components/Tab/index.d.ts +7 -1
- package/es6/components/Table/index.d.ts +4 -1
- package/es6/components/TableBody/index.d.ts +4 -1
- package/es6/components/TableCell/index.d.ts +10 -3
- package/es6/components/TableFooter/index.d.ts +4 -1
- package/es6/components/TableHeader/index.d.ts +4 -1
- package/es6/components/TableRow/index.d.ts +4 -1
- package/es6/components/Tabs/index.d.ts +4 -1
- package/es6/components/Tag/Tag.js +16 -2
- package/es6/components/Tag/index.d.ts +6 -0
- package/es6/components/Tag/propTypes.js +6 -0
- package/es6/components/Text/Text.js +3 -2
- package/es6/components/Text/index.d.ts +7 -1
- package/es6/components/TextArea/index.d.ts +7 -1
- package/es6/components/TextInput/TextInput.js +6 -2
- package/es6/components/TextInput/index.d.ts +6 -3
- package/es6/components/TextInput/stories/CustomThemed/CustomSuggestions.stories.tsx +2 -1
- package/es6/components/TextInput/stories/CustomThemed/Themed.stories.js +1 -0
- package/es6/components/TextInput/stories/OnSelect.stories.js +1 -0
- package/es6/components/TextInput/stories/WithTags.stories.js +1 -0
- package/es6/components/Tip/Tip.js +17 -1
- package/es6/components/ToggleGroup/index.d.ts +7 -1
- package/es6/components/Toolbar/index.d.ts +5 -2
- package/es6/components/Video/index.d.ts +7 -1
- package/es6/components/WorldMap/index.d.ts +7 -1
- package/es6/languages/default.json +6 -0
- package/es6/utils/mixins.js +2 -1
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +6 -0
- package/package.json +9 -9
- package/utils/mixins.js +2 -1
- package/components/Drop/stories/TrapFocus.stories.js +0 -86
- package/es6/components/Drop/stories/TrapFocus.stories.js +0 -82
|
@@ -1,80 +1,186 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof e + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
2
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
3
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
4
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import { Box, Data, DataTable, NameValueList, NameValuePair, Pagination, Text } from 'grommet';
|
|
4
6
|
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
7
|
+
// Uses the StarWars API for starships, see https://swapi.dev
|
|
8
|
+
|
|
9
|
+
var step = 10; // default for https://swapi.dev
|
|
10
|
+
|
|
11
|
+
var fetchData = /*#__PURE__*/function () {
|
|
12
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(view, signal) {
|
|
13
|
+
var params, url;
|
|
14
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
15
|
+
while (1) switch (_context.prev = _context.next) {
|
|
16
|
+
case 0:
|
|
17
|
+
params = {};
|
|
18
|
+
if (view.search) params.search = view.search;
|
|
19
|
+
if (view.page) params.page = view.page;
|
|
20
|
+
url = "https://swapi.dev/api/starships?" + Object.keys(params).map(function (k) {
|
|
21
|
+
return k + "=" + params[k];
|
|
22
|
+
}).join('&');
|
|
23
|
+
return _context.abrupt("return", fetch(url, {
|
|
24
|
+
method: 'GET',
|
|
25
|
+
headers: {
|
|
26
|
+
'Content-Type': 'application/json'
|
|
27
|
+
},
|
|
28
|
+
signal: signal
|
|
29
|
+
}).then(function (response) {
|
|
30
|
+
return response.json();
|
|
31
|
+
})["catch"](function (err) {
|
|
32
|
+
if (err.name !== 'AbortError') throw err;
|
|
33
|
+
return {};
|
|
34
|
+
}));
|
|
35
|
+
case 5:
|
|
36
|
+
case "end":
|
|
37
|
+
return _context.stop();
|
|
38
|
+
}
|
|
39
|
+
}, _callee);
|
|
40
|
+
}));
|
|
41
|
+
return function fetchData(_x, _x2) {
|
|
42
|
+
return _ref.apply(this, arguments);
|
|
32
43
|
};
|
|
44
|
+
}();
|
|
45
|
+
var ShipProperties = function ShipProperties(_ref2) {
|
|
46
|
+
var ship = _ref2.ship;
|
|
47
|
+
return /*#__PURE__*/React.createElement(NameValueList, {
|
|
48
|
+
pairProps: {
|
|
49
|
+
direction: 'column'
|
|
50
|
+
},
|
|
51
|
+
valueProps: {
|
|
52
|
+
width: 'xsmall'
|
|
53
|
+
},
|
|
54
|
+
layout: "grid",
|
|
55
|
+
pad: {
|
|
56
|
+
left: 'large',
|
|
57
|
+
bottom: 'small'
|
|
58
|
+
},
|
|
59
|
+
gap: {
|
|
60
|
+
row: 'xsmall',
|
|
61
|
+
column: 'large'
|
|
62
|
+
}
|
|
63
|
+
}, /*#__PURE__*/React.createElement(NameValuePair, {
|
|
64
|
+
name: /*#__PURE__*/React.createElement(Text, {
|
|
65
|
+
size: "small",
|
|
66
|
+
weight: "bold"
|
|
67
|
+
}, "Name")
|
|
68
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
69
|
+
size: "xsmall"
|
|
70
|
+
}, ship.name)), /*#__PURE__*/React.createElement(NameValuePair, {
|
|
71
|
+
name: /*#__PURE__*/React.createElement(Text, {
|
|
72
|
+
size: "small",
|
|
73
|
+
weight: "bold"
|
|
74
|
+
}, "Model")
|
|
75
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
76
|
+
size: "xsmall"
|
|
77
|
+
}, ship.model)), /*#__PURE__*/React.createElement(NameValuePair, {
|
|
78
|
+
name: /*#__PURE__*/React.createElement(Text, {
|
|
79
|
+
size: "small",
|
|
80
|
+
weight: "bold"
|
|
81
|
+
}, "Manufacturer")
|
|
82
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
83
|
+
size: "xsmall"
|
|
84
|
+
}, ship.manufacturer)), /*#__PURE__*/React.createElement(NameValuePair, {
|
|
85
|
+
name: /*#__PURE__*/React.createElement(Text, {
|
|
86
|
+
size: "small",
|
|
87
|
+
weight: "bold"
|
|
88
|
+
}, "Passengers")
|
|
89
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
90
|
+
size: "xsmall"
|
|
91
|
+
}, ship.passengers)));
|
|
92
|
+
};
|
|
93
|
+
export var RowDetails = function RowDetails() {
|
|
94
|
+
var _useState = useState({}),
|
|
95
|
+
result = _useState[0],
|
|
96
|
+
setResult = _useState[1];
|
|
97
|
+
var _useState2 = useState(0),
|
|
98
|
+
total = _useState2[0],
|
|
99
|
+
setTotal = _useState2[1];
|
|
100
|
+
var _useState3 = useState({
|
|
101
|
+
search: '',
|
|
102
|
+
step: step
|
|
103
|
+
}),
|
|
104
|
+
view = _useState3[0],
|
|
105
|
+
setView = _useState3[1];
|
|
106
|
+
var abortRef = useRef();
|
|
107
|
+
var _useState4 = useState(['Y-wing']),
|
|
108
|
+
expand = _useState4[0],
|
|
109
|
+
setExpand = _useState4[1];
|
|
110
|
+
useEffect(function () {
|
|
111
|
+
var _abortRef$current;
|
|
112
|
+
// This API is a bit slow, abort any uncompleted requests.
|
|
113
|
+
abortRef == null || (_abortRef$current = abortRef.current) == null || _abortRef$current.abort();
|
|
114
|
+
abortRef.current = new AbortController();
|
|
115
|
+
fetchData(view, abortRef.current.signal).then(function (_ref3) {
|
|
116
|
+
var count = _ref3.count,
|
|
117
|
+
results = _ref3.results;
|
|
118
|
+
if (results) {
|
|
119
|
+
// The API doesn't provide a non-filtered total, so we rely on the
|
|
120
|
+
// first call having no filtering telling us the total.
|
|
121
|
+
setTotal(function (prevTotal) {
|
|
122
|
+
return Math.max(prevTotal, count);
|
|
123
|
+
});
|
|
124
|
+
setResult({
|
|
125
|
+
data: results,
|
|
126
|
+
filteredTotal: count
|
|
127
|
+
});
|
|
128
|
+
abortRef.current = undefined;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}, [view]);
|
|
132
|
+
var rowDetails = useMemo(function () {
|
|
133
|
+
return {
|
|
134
|
+
render: function render(row) {
|
|
135
|
+
return /*#__PURE__*/React.createElement(ShipProperties, {
|
|
136
|
+
ship: row
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
expand: expand,
|
|
140
|
+
onExpand: function onExpand(nextExpand /* , datum */) {
|
|
141
|
+
return setExpand(nextExpand);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
}, [expand]);
|
|
33
145
|
return (
|
|
34
146
|
/*#__PURE__*/
|
|
35
147
|
// Uncomment <Grommet> lines when using outside of storybook
|
|
36
|
-
// <Grommet theme={
|
|
148
|
+
// <Grommet theme={...}>
|
|
37
149
|
React.createElement(Box, {
|
|
38
|
-
|
|
39
|
-
|
|
150
|
+
skeleton: !result.data,
|
|
151
|
+
width: "large",
|
|
152
|
+
pad: "large"
|
|
153
|
+
}, /*#__PURE__*/React.createElement(Data, {
|
|
154
|
+
data: result.data,
|
|
155
|
+
total: total,
|
|
156
|
+
filteredTotal: result.filteredTotal,
|
|
157
|
+
view: view,
|
|
158
|
+
onView: setView,
|
|
159
|
+
toolbar: "search"
|
|
40
160
|
}, /*#__PURE__*/React.createElement(DataTable, {
|
|
41
161
|
columns: [{
|
|
42
|
-
property: '
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
header: /*#__PURE__*/React.createElement(CheckBox, {
|
|
55
|
-
checked: checked.length === DATA.length,
|
|
56
|
-
indeterminate: checked.length > 0 && checked.length < DATA.length,
|
|
57
|
-
onChange: onCheckAll,
|
|
58
|
-
"aria-label": "header checkbox"
|
|
59
|
-
}),
|
|
60
|
-
sortable: false
|
|
61
|
-
}].concat(controlledColumns).map(function (col) {
|
|
62
|
-
return _extends({}, col);
|
|
63
|
-
}),
|
|
64
|
-
data: DATA,
|
|
65
|
-
sortable: true,
|
|
66
|
-
rowDetails: function rowDetails(row) {
|
|
67
|
-
if (row.name === 'Alan') {
|
|
68
|
-
return /*#__PURE__*/React.createElement(Box, null, " ", row.name, " ");
|
|
69
|
-
}
|
|
70
|
-
return /*#__PURE__*/React.createElement(Box, null, "Blah ", row.name, " ");
|
|
71
|
-
},
|
|
72
|
-
size: "medium"
|
|
73
|
-
}))
|
|
162
|
+
property: 'name',
|
|
163
|
+
header: 'Name',
|
|
164
|
+
primary: true
|
|
165
|
+
}, {
|
|
166
|
+
property: 'starship_class',
|
|
167
|
+
header: 'Class'
|
|
168
|
+
}],
|
|
169
|
+
rowDetails: rowDetails
|
|
170
|
+
}), /*#__PURE__*/React.createElement(Pagination, null)))
|
|
171
|
+
|
|
74
172
|
// </Grommet>
|
|
75
173
|
);
|
|
76
174
|
};
|
|
77
|
-
|
|
175
|
+
RowDetails.storyName = 'rowDetails';
|
|
176
|
+
RowDetails.parameters = {
|
|
177
|
+
chromatic: {
|
|
178
|
+
disable: true
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
RowDetails.args = {
|
|
182
|
+
full: true
|
|
183
|
+
};
|
|
78
184
|
export default {
|
|
79
185
|
title: 'Visualizations/DataTable/rowDetails'
|
|
80
186
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { Box, DataTable, Meter, Text } from 'grommet';
|
|
4
4
|
|
|
@@ -148,8 +148,8 @@ const DATA: RowType[] = [
|
|
|
148
148
|
|
|
149
149
|
export const OnSelectDataTable = () => {
|
|
150
150
|
// Type arguments can only be used in TypeScript files.
|
|
151
|
-
// Remove <
|
|
152
|
-
const [select, setSelect] = useState<
|
|
151
|
+
// Remove <(number | string)[]> if you are not using Typescript.
|
|
152
|
+
const [select, setSelect] = useState<(number | string)[]>([]);
|
|
153
153
|
|
|
154
154
|
return (
|
|
155
155
|
// Uncomment <Grommet> lines when using outside of storybook
|
|
@@ -3,7 +3,10 @@ import { BoxProps } from '../Box/index';
|
|
|
3
3
|
|
|
4
4
|
export interface DataViewProps {}
|
|
5
5
|
|
|
6
|
-
type divProps = Omit<
|
|
6
|
+
type divProps = Omit<
|
|
7
|
+
React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
8
|
+
'onClick' | 'property'
|
|
9
|
+
>;
|
|
7
10
|
|
|
8
11
|
export interface DataViewExtendedProps
|
|
9
12
|
extends BoxProps,
|
|
@@ -41,7 +41,10 @@ export interface DateInputProps {
|
|
|
41
41
|
export interface DateInputExtendedProps
|
|
42
42
|
extends DateInputProps,
|
|
43
43
|
Omit<
|
|
44
|
-
|
|
44
|
+
React.DetailedHTMLProps<
|
|
45
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
46
|
+
HTMLInputElement
|
|
47
|
+
>,
|
|
45
48
|
'defaultValue' | 'onChange' | 'value' | 'size'
|
|
46
49
|
> {}
|
|
47
50
|
|
|
@@ -37,7 +37,10 @@ export interface DiagramProps {
|
|
|
37
37
|
}[];
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
type divProps =
|
|
40
|
+
type divProps = React.DetailedHTMLProps<
|
|
41
|
+
React.SVGAttributes<SVGSVGElement>,
|
|
42
|
+
SVGSVGElement
|
|
43
|
+
>;
|
|
41
44
|
|
|
42
45
|
export interface DiagramExtendedProps extends DiagramProps, divProps {}
|
|
43
46
|
|
|
@@ -23,7 +23,10 @@ export interface DistributionProps {
|
|
|
23
23
|
}[];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
type divProps = Omit<
|
|
26
|
+
type divProps = Omit<
|
|
27
|
+
React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
28
|
+
'children'
|
|
29
|
+
>;
|
|
27
30
|
|
|
28
31
|
export interface DistributionExtendedProps
|
|
29
32
|
extends DistributionProps,
|
|
@@ -17,6 +17,8 @@ var dropKeyFrames = keyframes(["0%{opacity:0.5;transform:scale(0.8);}100%{opacit
|
|
|
17
17
|
|
|
18
18
|
// The desired margin may be adjusted depending on drops alignment
|
|
19
19
|
var marginStyle = function marginStyle(theme, align, data, responsive, marginProp) {
|
|
20
|
+
// NOTE: If marginProp is passed, it overrides the alignment-aware
|
|
21
|
+
// margin logic and uses the provided value instead.
|
|
20
22
|
var margin = theme.global.edgeSize[data] || data;
|
|
21
23
|
var adjustedMargin = {};
|
|
22
24
|
// if user provides CSS string such as '50px 12px', apply that always
|
|
@@ -28,7 +30,7 @@ var marginStyle = function marginStyle(theme, align, data, responsive, marginPro
|
|
|
28
30
|
} else {
|
|
29
31
|
return edgeStyle('margin', marginProp || theme.global.drop.margin, responsive, theme.global.edgeSize.responsiveBreakpoint, theme);
|
|
30
32
|
}
|
|
31
|
-
return edgeStyle('margin', adjustedMargin, responsive, theme.global.edgeSize.responsiveBreakpoint, theme);
|
|
33
|
+
return edgeStyle('margin', marginProp || adjustedMargin, responsive, theme.global.edgeSize.responsiveBreakpoint, theme);
|
|
32
34
|
};
|
|
33
35
|
var StyledDrop = styled(Box).withConfig({
|
|
34
36
|
displayName: "StyledDrop",
|
|
@@ -19,12 +19,16 @@ export interface DropProps extends Omit<BoxProps, 'align'> {
|
|
|
19
19
|
plain?: boolean;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
type divProps = Omit<
|
|
22
|
+
type divProps = Omit<
|
|
23
|
+
React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
24
|
+
keyof DropProps
|
|
25
|
+
>;
|
|
23
26
|
|
|
24
27
|
export interface DropExtendedProps extends DropProps, divProps {}
|
|
25
28
|
|
|
26
29
|
// Keep type alias for backwards compatibility.
|
|
27
|
-
export type DropType = DropProps &
|
|
30
|
+
export type DropType = DropProps &
|
|
31
|
+
React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
28
32
|
|
|
29
33
|
declare const Drop: React.FC<DropExtendedProps>;
|
|
30
34
|
|
|
@@ -18,7 +18,14 @@ export interface DropButtonProps {
|
|
|
18
18
|
open?: boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
type buttonProps = ButtonProps &
|
|
21
|
+
type buttonProps = ButtonProps &
|
|
22
|
+
Omit<
|
|
23
|
+
React.DetailedHTMLProps<
|
|
24
|
+
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
25
|
+
HTMLButtonElement
|
|
26
|
+
>,
|
|
27
|
+
'color'
|
|
28
|
+
>;
|
|
22
29
|
|
|
23
30
|
export interface DropButtonExtendedProps extends DropButtonProps, buttonProps {}
|
|
24
31
|
|
|
@@ -7,7 +7,7 @@ export interface FileInputProps {
|
|
|
7
7
|
}: {
|
|
8
8
|
onConfirm: any;
|
|
9
9
|
onCancel: any;
|
|
10
|
-
}) => React.ReactElement
|
|
10
|
+
}) => React.ReactElement<any>;
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
id?: string;
|
|
13
13
|
maxSize?: number;
|
|
@@ -29,7 +29,13 @@ export interface FileInputProps {
|
|
|
29
29
|
renderFile?: (...args: any[]) => void;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
type inputProps = Omit<
|
|
32
|
+
type inputProps = Omit<
|
|
33
|
+
React.DetailedHTMLProps<
|
|
34
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
35
|
+
HTMLInputElement
|
|
36
|
+
>,
|
|
37
|
+
'multiple' | 'onChange'
|
|
38
|
+
>;
|
|
33
39
|
|
|
34
40
|
export interface FileInputExtendedProps extends FileInputProps, inputProps {}
|
|
35
41
|
|
|
@@ -24,7 +24,13 @@ export interface FormProps<T> {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
type TypedFormProps<T> = FormProps<T> &
|
|
27
|
-
Omit<
|
|
27
|
+
Omit<
|
|
28
|
+
React.DetailedHTMLProps<
|
|
29
|
+
React.FormHTMLAttributes<HTMLFormElement>,
|
|
30
|
+
HTMLFormElement
|
|
31
|
+
>,
|
|
32
|
+
'onChange' | 'onSubmit'
|
|
33
|
+
>;
|
|
28
34
|
|
|
29
35
|
declare const Form: <T = {}>(
|
|
30
36
|
p: TypedFormProps<T>,
|
|
@@ -70,7 +70,10 @@ export interface GridProps {
|
|
|
70
70
|
width?: WidthType;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
type divProps =
|
|
73
|
+
type divProps = React.DetailedHTMLProps<
|
|
74
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
75
|
+
HTMLDivElement
|
|
76
|
+
>;
|
|
74
77
|
|
|
75
78
|
export interface GridExtendedProps extends GridProps, divProps {}
|
|
76
79
|
|
|
@@ -142,10 +142,21 @@ export interface GrommetProps {
|
|
|
142
142
|
plural?: string;
|
|
143
143
|
};
|
|
144
144
|
};
|
|
145
|
+
pagination?: {
|
|
146
|
+
stepLabel?: string;
|
|
147
|
+
summary?: string;
|
|
148
|
+
summaryNoItems?: string;
|
|
149
|
+
};
|
|
145
150
|
rangeSelector?: {
|
|
146
151
|
lower?: string;
|
|
147
152
|
upper?: string;
|
|
148
153
|
};
|
|
154
|
+
tag?: {
|
|
155
|
+
removeLabel?: {
|
|
156
|
+
nameAndValue?: string;
|
|
157
|
+
valueOnly?: string;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
149
160
|
select?: {
|
|
150
161
|
multiple?: string;
|
|
151
162
|
selected?: string;
|
|
@@ -204,7 +215,13 @@ export interface GrommetProps {
|
|
|
204
215
|
|
|
205
216
|
export interface GrommetExtendedProps
|
|
206
217
|
extends GrommetProps,
|
|
207
|
-
Omit<
|
|
218
|
+
Omit<
|
|
219
|
+
React.DetailedHTMLProps<
|
|
220
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
221
|
+
HTMLDivElement
|
|
222
|
+
>,
|
|
223
|
+
'dir'
|
|
224
|
+
> {}
|
|
208
225
|
|
|
209
226
|
declare const Grommet: React.FC<GrommetExtendedProps>;
|
|
210
227
|
|
|
@@ -144,6 +144,11 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
144
144
|
plural: PropTypes.string
|
|
145
145
|
})
|
|
146
146
|
}),
|
|
147
|
+
pagination: PropTypes.shape({
|
|
148
|
+
stepLabel: PropTypes.string,
|
|
149
|
+
summary: PropTypes.string,
|
|
150
|
+
summaryNoItems: PropType.string
|
|
151
|
+
}),
|
|
147
152
|
rangeSelector: PropTypes.shape({
|
|
148
153
|
lower: PropTypes.string,
|
|
149
154
|
upper: PropTypes.string
|
|
@@ -174,6 +179,12 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
174
179
|
tabs: PropTypes.shape({
|
|
175
180
|
tabContents: PropTypes.string
|
|
176
181
|
}),
|
|
182
|
+
tag: PropTypes.shape({
|
|
183
|
+
removeLabel: PropTypes.shape({
|
|
184
|
+
nameAndValue: PropTypes.string,
|
|
185
|
+
valueOnly: PropTypes.string
|
|
186
|
+
})
|
|
187
|
+
}),
|
|
177
188
|
textInput: PropTypes.shape({
|
|
178
189
|
enterSelect: PropTypes.string,
|
|
179
190
|
suggestionsCount: PropTypes.string,
|
|
@@ -8,7 +8,7 @@ const gravatarLink =
|
|
|
8
8
|
const colors = ['red', 'orange', 'yellow', 'green', 'blue', 'purple', 'pink'];
|
|
9
9
|
|
|
10
10
|
export const Ref = () => {
|
|
11
|
-
const ref = React.useRef<HTMLDivElement>();
|
|
11
|
+
const ref = React.useRef<HTMLDivElement>(undefined);
|
|
12
12
|
const [colorIndex, setColorIndex] = React.useState(0);
|
|
13
13
|
|
|
14
14
|
const changeColor = () => {
|
|
@@ -27,13 +27,13 @@ export interface HeadingProps {
|
|
|
27
27
|
weight?: 'normal' | 'bold' | 'lighter' | 'bolder' | number | string;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
type hProps =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
type hProps = Omit<
|
|
31
|
+
React.DetailedHTMLProps<
|
|
32
|
+
React.HTMLAttributes<HTMLHeadingElement>,
|
|
33
|
+
HTMLHeadingElement
|
|
34
|
+
>,
|
|
35
|
+
'color'
|
|
36
|
+
>;
|
|
37
37
|
|
|
38
38
|
export interface HeadingExtendedProps extends HeadingProps, hProps {}
|
|
39
39
|
|
|
@@ -18,7 +18,10 @@ export interface ImageProps {
|
|
|
18
18
|
opacity?: 'weak' | 'medium' | 'strong' | string | boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
type imgProps =
|
|
21
|
+
type imgProps = React.DetailedHTMLProps<
|
|
22
|
+
React.ImgHTMLAttributes<HTMLImageElement>,
|
|
23
|
+
HTMLImageElement
|
|
24
|
+
>;
|
|
22
25
|
|
|
23
26
|
export interface ImageExtendedProps extends ImageProps, imgProps {}
|
|
24
27
|
|
|
@@ -2,9 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
export interface InfiniteScrollProps {
|
|
4
4
|
children?: React.ReactNode | Function;
|
|
5
|
-
items?: (string | number | React.ReactElement | Record<string, any>)[];
|
|
5
|
+
items?: (string | number | React.ReactElement<any> | Record<string, any>)[];
|
|
6
6
|
onMore?: () => void;
|
|
7
|
-
renderMarker?: (marker: React.ReactElement) => React.ReactElement
|
|
7
|
+
renderMarker?: (marker: React.ReactElement<any>) => React.ReactElement<any>;
|
|
8
8
|
replace?: boolean;
|
|
9
9
|
show?: number;
|
|
10
10
|
step?: number;
|
|
@@ -36,7 +36,10 @@ export interface LayerProps {
|
|
|
36
36
|
target?: object;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
type divProps =
|
|
39
|
+
type divProps = React.DetailedHTMLProps<
|
|
40
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
41
|
+
HTMLDivElement
|
|
42
|
+
>;
|
|
40
43
|
|
|
41
44
|
export interface LayerExtendedProps extends LayerProps, divProps {}
|
|
42
45
|
|
|
@@ -77,14 +77,20 @@ export interface ListProps<ListItemType> {
|
|
|
77
77
|
color?: ColorType;
|
|
78
78
|
icon?: JSX.Element;
|
|
79
79
|
};
|
|
80
|
-
primaryKey?: string | ((item: ListItemType) => React.ReactElement);
|
|
81
|
-
secondaryKey?: string | ((item: ListItemType) => React.ReactElement);
|
|
80
|
+
primaryKey?: string | ((item: ListItemType) => React.ReactElement<any>);
|
|
81
|
+
secondaryKey?: string | ((item: ListItemType) => React.ReactElement<any>);
|
|
82
82
|
show?: number | { page?: number };
|
|
83
83
|
step?: number;
|
|
84
84
|
action?: (item: ListItemType, index: number) => void;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
type ulProps = Omit<
|
|
87
|
+
type ulProps = Omit<
|
|
88
|
+
React.DetailedHTMLProps<
|
|
89
|
+
React.HTMLAttributes<HTMLUListElement>,
|
|
90
|
+
HTMLUListElement
|
|
91
|
+
>,
|
|
92
|
+
'children'
|
|
93
|
+
>;
|
|
88
94
|
|
|
89
95
|
export interface ListExtendedProps<ListItemType>
|
|
90
96
|
extends ListProps<ListItemType>,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
|
|
2
3
|
export interface MarkdownProps {
|
|
3
4
|
components?: {};
|
|
4
5
|
options?: {};
|
|
5
6
|
}
|
|
6
7
|
|
|
7
|
-
type divProps =
|
|
8
|
+
type divProps = React.DetailedHTMLProps<
|
|
9
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
10
|
+
HTMLDivElement
|
|
11
|
+
>;
|
|
8
12
|
|
|
9
13
|
export interface MarkdownExtendedProps extends MarkdownProps, divProps {}
|
|
10
14
|
|