@strapi/design-system 1.4.1 → 1.5.0-alpha.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/dist/Accordion/AccordionContent.cjs +1 -1
- package/dist/Accordion/AccordionContent.js +17 -37
- package/dist/Accordion/AccordionToggle.cjs +6 -6
- package/dist/Accordion/AccordionToggle.js +75 -96
- package/dist/Alert/Alert.cjs +12 -12
- package/dist/Alert/Alert.js +83 -102
- package/dist/Alert/utils.cjs +1 -1
- package/dist/Alert/utils.js +3 -3
- package/dist/Avatar/Avatar.cjs +4 -4
- package/dist/Avatar/Avatar.js +41 -35
- package/dist/Badge/Badge.cjs +4 -4
- package/dist/Badge/Badge.js +29 -49
- package/dist/BaseButton/BaseButton.cjs +3 -3
- package/dist/BaseButton/BaseButton.js +20 -42
- package/dist/BaseCheckbox/BaseCheckbox.cjs +6 -6
- package/dist/BaseCheckbox/BaseCheckbox.js +35 -55
- package/dist/BaseLink/BaseLink.cjs +2 -2
- package/dist/BaseLink/BaseLink.js +21 -43
- package/dist/BaseRadio/BaseRadio.cjs +8 -8
- package/dist/BaseRadio/BaseRadio.js +31 -51
- package/dist/BaseRadio/RadioGroup.cjs +1 -1
- package/dist/BaseRadio/RadioGroup.js +24 -44
- package/dist/Box/BoxProps.cjs +1 -1
- package/dist/Box/BoxProps.js +10 -19
- package/dist/Breadcrumbs/Breadcrumbs.cjs +4 -4
- package/dist/Breadcrumbs/Breadcrumbs.js +29 -50
- package/dist/Button/Button.cjs +14 -14
- package/dist/Button/Button.js +53 -73
- package/dist/Card/Card.cjs +1 -1
- package/dist/Card/Card.js +17 -37
- package/dist/Card/CardAsset.cjs +4 -4
- package/dist/Card/CardAsset.js +19 -42
- package/dist/Card/CardBadge.cjs +3 -3
- package/dist/Card/CardBadge.js +9 -18
- package/dist/Card/CardBody.cjs +1 -1
- package/dist/Card/CardBody.js +8 -19
- package/dist/Card/CardCheckbox.cjs +1 -1
- package/dist/Card/CardCheckbox.js +12 -22
- package/dist/Card/CardContent.cjs +2 -2
- package/dist/Card/CardContent.js +11 -32
- package/dist/Card/CardHeader.cjs +2 -2
- package/dist/Card/CardHeader.js +9 -19
- package/dist/Card/CardTimer.cjs +2 -2
- package/dist/Card/CardTimer.js +20 -42
- package/dist/Card/CardTitle.cjs +1 -1
- package/dist/Card/CardTitle.js +16 -27
- package/dist/CarouselInput/Carousel.cjs +6 -6
- package/dist/CarouselInput/Carousel.js +77 -107
- package/dist/CarouselInput/CarouselActions.cjs +1 -1
- package/dist/CarouselInput/CarouselActions.js +7 -17
- package/dist/CarouselInput/CarouselImage.cjs +3 -3
- package/dist/CarouselInput/CarouselImage.js +26 -38
- package/dist/CarouselInput/CarouselInput.cjs +1 -1
- package/dist/CarouselInput/CarouselInput.js +49 -83
- package/dist/CarouselInput/CarouselSlide.cjs +2 -2
- package/dist/CarouselInput/CarouselSlide.js +20 -42
- package/dist/Checkbox/Checkbox.cjs +2 -2
- package/dist/Checkbox/Checkbox.js +44 -63
- package/dist/Combobox/Combobox.cjs +1 -1
- package/dist/Combobox/Combobox.js +196 -246
- package/dist/Combobox/ComboboxOption.cjs +1 -1
- package/dist/Combobox/ComboboxOption.js +25 -47
- package/dist/Combobox/utils.cjs +1 -1
- package/dist/Combobox/utils.js +21 -21
- package/dist/DatePicker/DatePicker.cjs +1 -1
- package/dist/DatePicker/DatePicker.js +87 -109
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -1
- package/dist/DatePicker/DatePickerCalendar.js +1 -1
- package/dist/DatePicker/DatePickerTd.cjs +4 -4
- package/dist/DatePicker/DatePickerTd.js +23 -42
- package/dist/DatePicker/DatePickerTh.cjs +3 -3
- package/dist/DatePicker/DatePickerTh.js +23 -44
- package/dist/DatePicker/utils/getYears.cjs +1 -1
- package/dist/DatePicker/utils/getYears.js +6 -7
- package/dist/DateTimePicker/DateTimePicker.cjs +1 -1
- package/dist/DateTimePicker/DateTimePicker.js +92 -126
- package/dist/DateTimePicker/DateTimePickerProps.cjs +1 -1
- package/dist/DateTimePicker/DateTimePickerProps.js +10 -19
- package/dist/Dialog/Dialog.cjs +5 -5
- package/dist/Dialog/Dialog.js +39 -58
- package/dist/Divider/Divider.cjs +4 -2
- package/dist/Divider/Divider.js +17 -38
- package/dist/Field/Field.cjs +1 -1
- package/dist/Field/Field.js +20 -39
- package/dist/Field/FieldAction.cjs +2 -2
- package/dist/Field/FieldAction.js +13 -35
- package/dist/Field/FieldInput.cjs +6 -6
- package/dist/Field/FieldInput.js +47 -67
- package/dist/Field/FieldLabel.cjs +3 -3
- package/dist/Field/FieldLabel.js +26 -46
- package/dist/Flex/FlexProps.cjs +1 -1
- package/dist/Flex/FlexProps.js +10 -19
- package/dist/FocusTrap/FocusTrap.cjs +1 -1
- package/dist/FocusTrap/FocusTrap.js +32 -52
- package/dist/Grid/Grid.cjs +3 -3
- package/dist/Grid/Grid.js +20 -42
- package/dist/Grid/GridItem.cjs +2 -2
- package/dist/Grid/GridItem.js +22 -41
- package/dist/Icon/Icon.cjs +2 -2
- package/dist/Icon/Icon.js +17 -27
- package/dist/IconButton/IconButton.cjs +4 -4
- package/dist/IconButton/IconButton.js +44 -64
- package/dist/KeyboardNavigable/KeyboardNavigable.cjs +1 -1
- package/dist/KeyboardNavigable/KeyboardNavigable.js +38 -58
- package/dist/Layout/HeaderLayout.cjs +2 -2
- package/dist/Layout/HeaderLayout.js +78 -96
- package/dist/Link/Link.cjs +6 -6
- package/dist/Link/Link.js +34 -54
- package/dist/LinkButton/LinkButton.cjs +10 -10
- package/dist/LinkButton/LinkButton.js +47 -69
- package/dist/Loader/Loader.cjs +4 -4
- package/dist/Loader/Loader.js +25 -47
- package/dist/Main/Main.cjs +2 -2
- package/dist/Main/Main.js +15 -35
- package/dist/MainNav/MainNav.cjs +2 -2
- package/dist/MainNav/MainNav.js +19 -40
- package/dist/MainNav/NavCondense.cjs +3 -3
- package/dist/MainNav/NavCondense.js +20 -40
- package/dist/MainNav/NavFooter.cjs +3 -0
- package/dist/MainNav/NavFooter.js +14 -0
- package/dist/MainNav/NavLink.cjs +13 -13
- package/dist/MainNav/NavLink.js +57 -76
- package/dist/MainNav/NavSection.cjs +1 -1
- package/dist/MainNav/NavSection.js +46 -67
- package/dist/MainNav/NavSections.cjs +4 -1
- package/dist/MainNav/NavSections.js +23 -40
- package/dist/MainNav/NavUser.cjs +2 -6
- package/dist/MainNav/NavUser.js +31 -55
- package/dist/MainNav/index.cjs +1 -1
- package/dist/MainNav/index.js +14 -12
- package/dist/ModalLayout/ModalBody.cjs +2 -2
- package/dist/ModalLayout/ModalBody.js +9 -19
- package/dist/ModalLayout/ModalLayout.cjs +3 -3
- package/dist/ModalLayout/ModalLayout.js +30 -52
- package/dist/NumberInput/NumberInput.cjs +6 -6
- package/dist/NumberInput/NumberInput.js +123 -157
- package/dist/Pagination/components.cjs +7 -7
- package/dist/Pagination/components.js +65 -88
- package/dist/Popover/Popover.cjs +3 -3
- package/dist/Popover/Popover.js +65 -91
- package/dist/Portal/Portal.cjs +1 -1
- package/dist/Portal/Portal.js +11 -12
- package/dist/ProgressBar/ProgressBar.cjs +2 -2
- package/dist/ProgressBar/ProgressBar.js +27 -49
- package/dist/Radio/Radio.cjs +2 -2
- package/dist/Radio/Radio.js +19 -40
- package/dist/RawTable/RawCell.cjs +1 -1
- package/dist/RawTable/RawCell.js +69 -89
- package/dist/RawTable/RawTable.cjs +1 -1
- package/dist/RawTable/RawTable.js +46 -66
- package/dist/RawTable/RawTbody.cjs +1 -1
- package/dist/RawTable/RawTbody.js +11 -30
- package/dist/RawTable/RawThead.cjs +1 -1
- package/dist/RawTable/RawThead.js +10 -29
- package/dist/RawTable/RawTr.cjs +1 -1
- package/dist/RawTable/RawTr.js +14 -34
- package/dist/Searchbar/SearchForm.cjs +1 -1
- package/dist/Searchbar/SearchForm.js +5 -16
- package/dist/Searchbar/Searchbar.cjs +7 -7
- package/dist/Searchbar/Searchbar.js +45 -65
- package/dist/Select/MultiSelectNested.cjs +1 -1
- package/dist/Select/MultiSelectNested.js +23 -45
- package/dist/Select/OptGroup.cjs +1 -1
- package/dist/Select/OptGroup.js +15 -35
- package/dist/Select/Option.cjs +7 -7
- package/dist/Select/Option.js +37 -57
- package/dist/Select/Select.cjs +2 -2
- package/dist/Select/Select.js +145 -186
- package/dist/Select/SelectButton.cjs +2 -2
- package/dist/Select/SelectButton.js +33 -53
- package/dist/SimpleMenu/SimpleMenu.cjs +9 -9
- package/dist/SimpleMenu/SimpleMenu.js +137 -163
- package/dist/Stack/Stack.cjs +3 -3
- package/dist/Stack/Stack.js +29 -50
- package/dist/Status/Status.cjs +4 -4
- package/dist/Status/Status.js +30 -50
- package/dist/SubNav/SubNav.cjs +3 -3
- package/dist/SubNav/SubNav.js +15 -37
- package/dist/SubNav/SubNavHeader.cjs +2 -2
- package/dist/SubNav/SubNavHeader.js +38 -39
- package/dist/SubNav/SubNavLink.cjs +6 -6
- package/dist/SubNav/SubNavLink.js +39 -61
- package/dist/SubNav/SubNavSections.cjs +1 -1
- package/dist/SubNav/SubNavSections.js +17 -39
- package/dist/Switch/Switch.cjs +5 -5
- package/dist/Switch/Switch.js +35 -57
- package/dist/Table/Cell.cjs +3 -3
- package/dist/Table/Cell.js +20 -40
- package/dist/Table/TFooter.cjs +3 -3
- package/dist/Table/TFooter.js +28 -50
- package/dist/Table/Table.cjs +5 -5
- package/dist/Table/Table.js +35 -55
- package/dist/Table/Tbody.cjs +2 -2
- package/dist/Table/Tbody.js +8 -17
- package/dist/Table/Thead.cjs +2 -2
- package/dist/Table/Thead.js +8 -17
- package/dist/Table/Tr.cjs +2 -2
- package/dist/Table/Tr.js +8 -17
- package/dist/Tabs/TabGroup.cjs +1 -1
- package/dist/Tabs/TabGroup.js +26 -45
- package/dist/Tabs/TabPanels.cjs +1 -1
- package/dist/Tabs/TabPanels.js +24 -43
- package/dist/Tabs/Tabs.cjs +2 -2
- package/dist/Tabs/Tabs.js +94 -112
- package/dist/Tag/Tag.cjs +4 -4
- package/dist/Tag/Tag.js +27 -50
- package/dist/TextButton/TextButton.cjs +6 -6
- package/dist/TextButton/TextButton.js +39 -59
- package/dist/TextInput/TextInput.cjs +1 -1
- package/dist/TextInput/TextInput.js +49 -69
- package/dist/Textarea/Textarea.cjs +3 -3
- package/dist/Textarea/Textarea.js +43 -63
- package/dist/Textarea/TextareaInput.cjs +4 -4
- package/dist/Textarea/TextareaInput.js +30 -50
- package/dist/TimePicker/TimePicker.cjs +3 -3
- package/dist/TimePicker/TimePicker.js +62 -95
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +8 -8
- package/dist/ToggleCheckbox/ToggleCheckbox.js +56 -78
- package/dist/ToggleInput/ToggleInput.cjs +3 -3
- package/dist/ToggleInput/ToggleInput.js +65 -97
- package/dist/Tooltip/Tooltip.cjs +2 -2
- package/dist/Tooltip/Tooltip.js +38 -57
- package/dist/Typography/TypographyProps.cjs +1 -1
- package/dist/Typography/TypographyProps.js +13 -22
- package/dist/helpers/getDefaultLocale.cjs +1 -1
- package/dist/helpers/getDefaultLocale.js +1 -1
- package/dist/helpers/handleResponsiveValues.cjs +5 -5
- package/dist/helpers/handleResponsiveValues.js +14 -14
- package/dist/index.cjs +1 -1
- package/dist/index.js +150 -148
- package/dist/themes/darkTheme/index.cjs +1 -1
- package/dist/themes/darkTheme/index.js +8 -18
- package/dist/themes/extendTheme.cjs +4 -4
- package/dist/themes/extendTheme.js +18 -29
- package/dist/themes/lightTheme/index.cjs +1 -1
- package/dist/themes/lightTheme/index.js +8 -18
- package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
- package/dist/v2/Breadcrumbs/Breadcrumbs.js +23 -43
- package/dist/v2/Breadcrumbs/Crumb.cjs +1 -1
- package/dist/v2/Breadcrumbs/Crumb.js +22 -44
- package/dist/v2/Breadcrumbs/CrumbLink.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbLink.js +14 -35
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +19 -41
- package/dist/v2/Link/Link.cjs +5 -5
- package/dist/v2/Link/Link.js +42 -64
- package/dist/v2/LinkButton/LinkButton.cjs +10 -10
- package/dist/v2/LinkButton/LinkButton.js +51 -75
- package/dist/v2/MainNav/MainNav.cjs +2 -2
- package/dist/v2/MainNav/MainNav.js +19 -40
- package/dist/v2/MainNav/NavBrand.cjs +3 -3
- package/dist/v2/MainNav/NavBrand.js +57 -78
- package/dist/v2/MainNav/NavCondense.cjs +3 -3
- package/dist/v2/MainNav/NavCondense.js +20 -40
- package/dist/v2/MainNav/NavFooter.cjs +3 -0
- package/dist/v2/MainNav/NavFooter.js +14 -0
- package/dist/v2/MainNav/NavLink.cjs +13 -13
- package/dist/v2/MainNav/NavLink.js +60 -81
- package/dist/v2/MainNav/NavSection.cjs +1 -1
- package/dist/v2/MainNav/NavSection.js +46 -67
- package/dist/v2/MainNav/NavSections.cjs +4 -1
- package/dist/v2/MainNav/NavSections.js +23 -40
- package/dist/v2/MainNav/NavUser.cjs +2 -6
- package/dist/v2/MainNav/NavUser.js +31 -55
- package/dist/v2/MainNav/index.cjs +1 -1
- package/dist/v2/MainNav/index.js +14 -12
- package/dist/v2/Pagination/components.cjs +7 -7
- package/dist/v2/Pagination/components.js +65 -89
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +9 -9
- package/dist/v2/SimpleMenu/SimpleMenu.js +131 -156
- package/dist/v2/SubNav/SubNav.cjs +3 -3
- package/dist/v2/SubNav/SubNav.js +15 -37
- package/dist/v2/SubNav/SubNavHeader.cjs +2 -2
- package/dist/v2/SubNav/SubNavHeader.js +38 -39
- package/dist/v2/SubNav/SubNavLink.cjs +6 -6
- package/dist/v2/SubNav/SubNavLink.js +42 -64
- package/dist/v2/SubNav/SubNavSections.cjs +1 -1
- package/dist/v2/SubNav/SubNavSections.js +17 -39
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.js +37 -35
- package/package.json +4 -4
package/dist/Radio/Radio.js
CHANGED
|
@@ -1,45 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (var t of a(r))
|
|
9
|
-
l.call(r, t) && m(e, t, r[t]);
|
|
10
|
-
return e;
|
|
11
|
-
};
|
|
12
|
-
var d = (e, r) => {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var o in e)
|
|
15
|
-
p.call(e, o) && r.indexOf(o) < 0 && (t[o] = e[o]);
|
|
16
|
-
if (e != null && a)
|
|
17
|
-
for (var o of a(e))
|
|
18
|
-
r.indexOf(o) < 0 && l.call(e, o) && (t[o] = e[o]);
|
|
19
|
-
return t;
|
|
20
|
-
};
|
|
21
|
-
import i from "react";
|
|
22
|
-
import s from "prop-types";
|
|
23
|
-
import c from "styled-components";
|
|
24
|
-
import { BaseRadio as y } from "../BaseRadio/BaseRadio.js";
|
|
25
|
-
import { Typography as u } from "../Typography/Typography.js";
|
|
26
|
-
import { Box as x } from "../Box/Box.js";
|
|
27
|
-
const R = c(u)`
|
|
1
|
+
import e from "react";
|
|
2
|
+
import r from "prop-types";
|
|
3
|
+
import a from "styled-components";
|
|
4
|
+
import { BaseRadio as i } from "../BaseRadio/BaseRadio.js";
|
|
5
|
+
import { Typography as m } from "../Typography/Typography.js";
|
|
6
|
+
import { Box as p } from "../Box/Box.js";
|
|
7
|
+
const l = a(m)`
|
|
28
8
|
display: flex;
|
|
29
9
|
align-items: center;
|
|
30
|
-
`,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
value: s.any.isRequired
|
|
10
|
+
`, n = ({ children: t, ...o }) => /* @__PURE__ */ e.createElement(l, {
|
|
11
|
+
as: "label",
|
|
12
|
+
textColor: "neutral800"
|
|
13
|
+
}, /* @__PURE__ */ e.createElement(i, {
|
|
14
|
+
...o
|
|
15
|
+
}), /* @__PURE__ */ e.createElement(p, {
|
|
16
|
+
paddingLeft: 2
|
|
17
|
+
}, t));
|
|
18
|
+
n.propTypes = {
|
|
19
|
+
children: r.node.isRequired,
|
|
20
|
+
value: r.any.isRequired
|
|
42
21
|
};
|
|
43
22
|
export {
|
|
44
|
-
|
|
23
|
+
n as Radio
|
|
45
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react"),w=require("prop-types"),F=require("../Box/Box.cjs"),n=require("../helpers/getFocusableNodes.cjs"),f=require("../helpers/keyboardKeys.cjs"),R=require("./RawTableContext.cjs"),p=o=>o&&typeof o=="object"&&"default"in o?o:{default:o},T=p(d),s=p(w),h=o=>T.default.createElement(i,{...o,as:"th"}),i=({coords:o,as:x,...m})=>{const r=d.useRef(null),{rowIndex:E,colIndex:K,setTableValues:N}=R.useTable(),[u,b]=d.useState(!1),v=e=>{const t=n.getFocusableNodes(r.current,!0);if(t.length===0||t.length===1&&n.getFocusableNodesWithKeyboardNav(t).length===0)return;if(t.length>1&&!t.find(l=>l.tagName!=="BUTTON")){e.preventDefault();const l=t.findIndex(c=>c===document.activeElement);if(e.key===f.KeyboardKeys.RIGHT){const c=t[l+1];c&&(e.stopPropagation(),c.focus())}else if(e.key===f.KeyboardKeys.LEFT){const c=t[l-1];c&&(e.stopPropagation(),c.focus())}return}const a=e.key===f.KeyboardKeys.ENTER;if(a&&!u)b(!0);else if((e.key===f.KeyboardKeys.ESCAPE||a)&&u){if(a&&document.activeElement.tagName==="A")return;b(!1),r.current.focus()}else u&&e.stopPropagation()},y=E===o.row-1&&K===o.col-1;d.useLayoutEffect(()=>{const e=n.getFocusableNodes(r.current,!0);e.length===0||e.length===1&&n.getFocusableNodesWithKeyboardNav(e).length!==0||e.length>1&&Boolean(e.find(t=>t.tagName!=="BUTTON"))?(r.current.setAttribute("tabIndex",!u&&y?0:-1),e.forEach((t,a)=>{t.setAttribute("tabIndex",u?0:-1),u&&a===0&&t.focus()})):e.forEach(t=>{t.setAttribute("tabIndex",y?0:-1)})},[u,y]);const g=d.useCallback(()=>{const e=n.getFocusableNodes(r.current,!0);e.length>=1&&(n.getFocusableNodesWithKeyboardNav(e).length!==0||!e.find(t=>t.tagName!=="BUTTON"))&&b(!0),N({rowIndex:o.row-1,colIndex:o.col-1})},[o,N]);return d.useLayoutEffect(()=>{const e=r.current;return n.getFocusableNodes(e,!0).forEach(a=>{a.addEventListener("focus",g)}),()=>{n.getFocusableNodes(e,!0).forEach(l=>{l.removeEventListener("focus",g)})}},[g]),T.default.createElement(F.Box,{role:"gridcell",as:x,ref:r,onKeyDown:v,...m})};h.defaultProps={children:void 0,coords:{}};h.propTypes={"aria-colindex":s.default.number.isRequired,children:s.default.node,coords:s.default.shape({col:s.default.number,row:s.default.number})};i.defaultProps={as:"td",children:void 0,coords:{}};i.propTypes={"aria-colindex":s.default.number.isRequired,as:s.default.oneOf(["td","th"]),children:s.default.node,coords:s.default.shape({col:s.default.number,row:s.default.number})};exports.RawTd=i;exports.RawTh=h;
|
package/dist/RawTable/RawCell.js
CHANGED
|
@@ -1,115 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
for (var r of m(n))
|
|
10
|
-
w.call(n, r) && v(e, r, n[r]);
|
|
11
|
-
return e;
|
|
12
|
-
}, R = (e, n) => D(e, U(n));
|
|
13
|
-
var A = (e, n) => {
|
|
14
|
-
var r = {};
|
|
15
|
-
for (var c in e)
|
|
16
|
-
I.call(e, c) && n.indexOf(c) < 0 && (r[c] = e[c]);
|
|
17
|
-
if (e != null && m)
|
|
18
|
-
for (var c of m(e))
|
|
19
|
-
n.indexOf(c) < 0 && w.call(e, c) && (r[c] = e[c]);
|
|
20
|
-
return r;
|
|
21
|
-
};
|
|
22
|
-
import B, { useRef as q, useState as C, useLayoutEffect as P, useCallback as S } from "react";
|
|
23
|
-
import s from "prop-types";
|
|
24
|
-
import { Box as _ } from "../Box/Box.js";
|
|
25
|
-
import { getFocusableNodes as f, getFocusableNodesWithKeyboardNav as E } from "../helpers/getFocusableNodes.js";
|
|
26
|
-
import { KeyboardKeys as b } from "../helpers/keyboardKeys.js";
|
|
27
|
-
import { useTable as G } from "./RawTableContext.js";
|
|
28
|
-
const F = (e) => /* @__PURE__ */ B.createElement(T, R(g({}, e), {
|
|
1
|
+
import g, { useRef as w, useState as R, useLayoutEffect as N, useCallback as A } from "react";
|
|
2
|
+
import o from "prop-types";
|
|
3
|
+
import { Box as P } from "../Box/Box.js";
|
|
4
|
+
import { getFocusableNodes as l, getFocusableNodesWithKeyboardNav as b } from "../helpers/getFocusableNodes.js";
|
|
5
|
+
import { KeyboardKeys as d } from "../helpers/keyboardKeys.js";
|
|
6
|
+
import { useTable as B } from "./RawTableContext.js";
|
|
7
|
+
const E = (r) => /* @__PURE__ */ g.createElement(h, {
|
|
8
|
+
...r,
|
|
29
9
|
as: "th"
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (o.length === 0 || o.length === 1 && E(o).length === 0)
|
|
10
|
+
}), h = ({ coords: r, as: T, ...x }) => {
|
|
11
|
+
const s = w(null), { rowIndex: y, colIndex: v, setTableValues: p } = B(), [c, i] = R(!1), I = (e) => {
|
|
12
|
+
const t = l(s.current, !0);
|
|
13
|
+
if (t.length === 0 || t.length === 1 && b(t).length === 0)
|
|
35
14
|
return;
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
} else if (
|
|
43
|
-
const
|
|
44
|
-
|
|
15
|
+
if (t.length > 1 && !t.find((u) => u.tagName !== "BUTTON")) {
|
|
16
|
+
e.preventDefault();
|
|
17
|
+
const u = t.findIndex((a) => a === document.activeElement);
|
|
18
|
+
if (e.key === d.RIGHT) {
|
|
19
|
+
const a = t[u + 1];
|
|
20
|
+
a && (e.stopPropagation(), a.focus());
|
|
21
|
+
} else if (e.key === d.LEFT) {
|
|
22
|
+
const a = t[u - 1];
|
|
23
|
+
a && (e.stopPropagation(), a.focus());
|
|
45
24
|
}
|
|
46
25
|
return;
|
|
47
26
|
}
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
else if ((
|
|
52
|
-
if (
|
|
27
|
+
const n = e.key === d.ENTER;
|
|
28
|
+
if (n && !c)
|
|
29
|
+
i(!0);
|
|
30
|
+
else if ((e.key === d.ESCAPE || n) && c) {
|
|
31
|
+
if (n && document.activeElement.tagName === "A")
|
|
53
32
|
return;
|
|
54
|
-
|
|
33
|
+
i(!1), s.current.focus();
|
|
55
34
|
} else
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
})) :
|
|
63
|
-
|
|
35
|
+
c && e.stopPropagation();
|
|
36
|
+
}, f = y === r.row - 1 && v === r.col - 1;
|
|
37
|
+
N(() => {
|
|
38
|
+
const e = l(s.current, !0);
|
|
39
|
+
e.length === 0 || e.length === 1 && b(e).length !== 0 || e.length > 1 && Boolean(e.find((t) => t.tagName !== "BUTTON")) ? (s.current.setAttribute("tabIndex", !c && f ? 0 : -1), e.forEach((t, n) => {
|
|
40
|
+
t.setAttribute("tabIndex", c ? 0 : -1), c && n === 0 && t.focus();
|
|
41
|
+
})) : e.forEach((t) => {
|
|
42
|
+
t.setAttribute("tabIndex", f ? 0 : -1);
|
|
64
43
|
});
|
|
65
|
-
}, [
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
}, [
|
|
70
|
-
return
|
|
71
|
-
const
|
|
72
|
-
return
|
|
73
|
-
|
|
44
|
+
}, [c, f]);
|
|
45
|
+
const m = A(() => {
|
|
46
|
+
const e = l(s.current, !0);
|
|
47
|
+
e.length >= 1 && (b(e).length !== 0 || !e.find((t) => t.tagName !== "BUTTON")) && i(!0), p({ rowIndex: r.row - 1, colIndex: r.col - 1 });
|
|
48
|
+
}, [r, p]);
|
|
49
|
+
return N(() => {
|
|
50
|
+
const e = s.current;
|
|
51
|
+
return l(e, !0).forEach((n) => {
|
|
52
|
+
n.addEventListener("focus", m);
|
|
74
53
|
}), () => {
|
|
75
|
-
|
|
76
|
-
|
|
54
|
+
l(e, !0).forEach((u) => {
|
|
55
|
+
u.removeEventListener("focus", m);
|
|
77
56
|
});
|
|
78
57
|
};
|
|
79
|
-
}, [
|
|
58
|
+
}, [m]), /* @__PURE__ */ g.createElement(P, {
|
|
80
59
|
role: "gridcell",
|
|
81
|
-
as:
|
|
82
|
-
ref:
|
|
83
|
-
onKeyDown:
|
|
84
|
-
|
|
60
|
+
as: T,
|
|
61
|
+
ref: s,
|
|
62
|
+
onKeyDown: I,
|
|
63
|
+
...x
|
|
64
|
+
});
|
|
85
65
|
};
|
|
86
|
-
|
|
66
|
+
E.defaultProps = {
|
|
87
67
|
children: void 0,
|
|
88
68
|
coords: {}
|
|
89
69
|
};
|
|
90
|
-
|
|
91
|
-
"aria-colindex":
|
|
92
|
-
children:
|
|
93
|
-
coords:
|
|
94
|
-
col:
|
|
95
|
-
row:
|
|
70
|
+
E.propTypes = {
|
|
71
|
+
"aria-colindex": o.number.isRequired,
|
|
72
|
+
children: o.node,
|
|
73
|
+
coords: o.shape({
|
|
74
|
+
col: o.number,
|
|
75
|
+
row: o.number
|
|
96
76
|
})
|
|
97
77
|
};
|
|
98
|
-
|
|
78
|
+
h.defaultProps = {
|
|
99
79
|
as: "td",
|
|
100
80
|
children: void 0,
|
|
101
81
|
coords: {}
|
|
102
82
|
};
|
|
103
|
-
|
|
104
|
-
"aria-colindex":
|
|
105
|
-
as:
|
|
106
|
-
children:
|
|
107
|
-
coords:
|
|
108
|
-
col:
|
|
109
|
-
row:
|
|
83
|
+
h.propTypes = {
|
|
84
|
+
"aria-colindex": o.number.isRequired,
|
|
85
|
+
as: o.oneOf(["td", "th"]),
|
|
86
|
+
children: o.node,
|
|
87
|
+
coords: o.shape({
|
|
88
|
+
col: o.number,
|
|
89
|
+
row: o.number
|
|
110
90
|
})
|
|
111
91
|
};
|
|
112
92
|
export {
|
|
113
|
-
|
|
114
|
-
|
|
93
|
+
h as RawTd,
|
|
94
|
+
E as RawTh
|
|
115
95
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react"),_=require("prop-types"),m=require("./RawTableContext.cjs"),r=require("../helpers/keyboardKeys.cjs"),E=require("./focusFocusable.cjs"),D=a=>a&&typeof a=="object"&&"default"in a?a:{default:a},K=D(u),o=D(_),f=({colCount:a,rowCount:l,jumpStep:n,initialCol:k,initialRow:T,...p})=>{const i=u.useRef(null),b=u.useRef(!1),[y,s]=u.useState(T),[d,c]=u.useState(k),R=u.useCallback(({colIndex:t,rowIndex:e})=>{c(t),s(e)},[]);u.useEffect(()=>{b.current&&E.focusFocusable(i.current),b.current||(b.current=!0)},[d,y]);const P=t=>{switch(t.key){case r.KeyboardKeys.RIGHT:{t.preventDefault(),c(e=>e<a-1?e+1:e);break}case r.KeyboardKeys.LEFT:{t.preventDefault(),c(e=>e>0?e-1:e);break}case r.KeyboardKeys.UP:{t.preventDefault(),s(e=>e>0?e-1:e);break}case r.KeyboardKeys.DOWN:{t.preventDefault(),s(e=>e<l-1?e+1:e);break}case r.KeyboardKeys.HOME:{t.preventDefault(),t.ctrlKey&&s(0),c(0);break}case r.KeyboardKeys.END:{t.preventDefault(),t.ctrlKey&&s(l-1),c(a-1);break}case r.KeyboardKeys.PAGE_DOWN:{t.preventDefault(),s(e=>e+n<l?e+n:l-1);break}case r.KeyboardKeys.PAGE_UP:{t.preventDefault(),s(e=>e-n>0?e-n:0);break}}};return K.default.createElement(m.RawTableContext.Provider,{value:{rowIndex:y,colIndex:d,setTableValues:R}},K.default.createElement("table",{role:"grid",ref:i,"aria-rowcount":l,"aria-colcount":a,onKeyDown:P,...p}))};f.defaultProps={jumpStep:3,initialCol:0,initialRow:0};f.propTypes={colCount:o.default.number.isRequired,initialCol:o.default.number,initialRow:o.default.number,jumpStep:o.default.number,rowCount:o.default.number.isRequired};exports.RawTable=f;
|
|
@@ -1,94 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
E.call(a, r) && y(t, r, a[r]);
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
var T = (t, a) => {
|
|
13
|
-
var r = {};
|
|
14
|
-
for (var c in t)
|
|
15
|
-
p.call(t, c) && a.indexOf(c) < 0 && (r[c] = t[c]);
|
|
16
|
-
if (t != null && f)
|
|
17
|
-
for (var c of f(t))
|
|
18
|
-
a.indexOf(c) < 0 && E.call(t, c) && (r[c] = t[c]);
|
|
19
|
-
return r;
|
|
20
|
-
};
|
|
21
|
-
import K, { useRef as R, useState as d, useCallback as w, useEffect as A } from "react";
|
|
22
|
-
import u from "prop-types";
|
|
23
|
-
import { RawTableContext as F } from "./RawTableContext.js";
|
|
24
|
-
import { KeyboardKeys as s } from "../helpers/keyboardKeys.js";
|
|
25
|
-
import { focusFocusable as H } from "./focusFocusable.js";
|
|
26
|
-
const _ = (U) => {
|
|
27
|
-
var b = U, { colCount: t, rowCount: a, jumpStep: r, initialCol: c, initialRow: G } = b, N = T(b, ["colCount", "rowCount", "jumpStep", "initialCol", "initialRow"]);
|
|
28
|
-
const m = R(null), o = R(!1), [D, n] = d(G), [k, i] = d(c), O = w(({ colIndex: l, rowIndex: e }) => {
|
|
29
|
-
i(l), n(e);
|
|
1
|
+
import m, { useRef as D, useState as k, useCallback as R, useEffect as d } from "react";
|
|
2
|
+
import s from "prop-types";
|
|
3
|
+
import { RawTableContext as _ } from "./RawTableContext.js";
|
|
4
|
+
import { KeyboardKeys as a } from "../helpers/keyboardKeys.js";
|
|
5
|
+
import { focusFocusable as G } from "./focusFocusable.js";
|
|
6
|
+
const y = ({ colCount: i, rowCount: l, jumpStep: n, initialCol: p, initialRow: E, ...P }) => {
|
|
7
|
+
const f = D(null), u = D(!1), [o, r] = k(E), [b, c] = k(p), T = R(({ colIndex: t, rowIndex: e }) => {
|
|
8
|
+
c(t), r(e);
|
|
30
9
|
}, []);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, [
|
|
34
|
-
const
|
|
35
|
-
switch (
|
|
36
|
-
case
|
|
37
|
-
|
|
10
|
+
d(() => {
|
|
11
|
+
u.current && G(f.current), u.current || (u.current = !0);
|
|
12
|
+
}, [b, o]);
|
|
13
|
+
const K = (t) => {
|
|
14
|
+
switch (t.key) {
|
|
15
|
+
case a.RIGHT: {
|
|
16
|
+
t.preventDefault(), c((e) => e < i - 1 ? e + 1 : e);
|
|
38
17
|
break;
|
|
39
18
|
}
|
|
40
|
-
case
|
|
41
|
-
|
|
19
|
+
case a.LEFT: {
|
|
20
|
+
t.preventDefault(), c((e) => e > 0 ? e - 1 : e);
|
|
42
21
|
break;
|
|
43
22
|
}
|
|
44
|
-
case
|
|
45
|
-
|
|
23
|
+
case a.UP: {
|
|
24
|
+
t.preventDefault(), r((e) => e > 0 ? e - 1 : e);
|
|
46
25
|
break;
|
|
47
26
|
}
|
|
48
|
-
case
|
|
49
|
-
|
|
27
|
+
case a.DOWN: {
|
|
28
|
+
t.preventDefault(), r((e) => e < l - 1 ? e + 1 : e);
|
|
50
29
|
break;
|
|
51
30
|
}
|
|
52
|
-
case
|
|
53
|
-
|
|
31
|
+
case a.HOME: {
|
|
32
|
+
t.preventDefault(), t.ctrlKey && r(0), c(0);
|
|
54
33
|
break;
|
|
55
34
|
}
|
|
56
|
-
case
|
|
57
|
-
|
|
35
|
+
case a.END: {
|
|
36
|
+
t.preventDefault(), t.ctrlKey && r(l - 1), c(i - 1);
|
|
58
37
|
break;
|
|
59
38
|
}
|
|
60
|
-
case
|
|
61
|
-
|
|
39
|
+
case a.PAGE_DOWN: {
|
|
40
|
+
t.preventDefault(), r((e) => e + n < l ? e + n : l - 1);
|
|
62
41
|
break;
|
|
63
42
|
}
|
|
64
|
-
case
|
|
65
|
-
|
|
43
|
+
case a.PAGE_UP: {
|
|
44
|
+
t.preventDefault(), r((e) => e - n > 0 ? e - n : 0);
|
|
66
45
|
break;
|
|
67
46
|
}
|
|
68
47
|
}
|
|
69
48
|
};
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
value: { rowIndex:
|
|
72
|
-
}, /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ m.createElement(_.Provider, {
|
|
50
|
+
value: { rowIndex: o, colIndex: b, setTableValues: T }
|
|
51
|
+
}, /* @__PURE__ */ m.createElement("table", {
|
|
73
52
|
role: "grid",
|
|
74
|
-
ref:
|
|
75
|
-
"aria-rowcount":
|
|
76
|
-
"aria-colcount":
|
|
77
|
-
onKeyDown:
|
|
78
|
-
|
|
53
|
+
ref: f,
|
|
54
|
+
"aria-rowcount": l,
|
|
55
|
+
"aria-colcount": i,
|
|
56
|
+
onKeyDown: K,
|
|
57
|
+
...P
|
|
58
|
+
}));
|
|
79
59
|
};
|
|
80
|
-
|
|
60
|
+
y.defaultProps = {
|
|
81
61
|
jumpStep: 3,
|
|
82
62
|
initialCol: 0,
|
|
83
63
|
initialRow: 0
|
|
84
64
|
};
|
|
85
|
-
|
|
86
|
-
colCount:
|
|
87
|
-
initialCol:
|
|
88
|
-
initialRow:
|
|
89
|
-
jumpStep:
|
|
90
|
-
rowCount:
|
|
65
|
+
y.propTypes = {
|
|
66
|
+
colCount: s.number.isRequired,
|
|
67
|
+
initialCol: s.number,
|
|
68
|
+
initialRow: s.number,
|
|
69
|
+
jumpStep: s.number,
|
|
70
|
+
rowCount: s.number.isRequired
|
|
91
71
|
};
|
|
92
72
|
export {
|
|
93
|
-
|
|
73
|
+
y as RawTable
|
|
94
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react"),d=require("prop-types"),o=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},u=o(t),s=o(d),r=({children:e,...a})=>{const n=t.Children.toArray(e).map((l,c)=>t.cloneElement(l,{"aria-rowindex":c+2}));return u.default.createElement("tbody",{...a},n)};r.propTypes={children:s.default.node.isRequired};exports.RawTbody=r;
|
|
@@ -1,35 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
i.call(r, o) && d(e, o, r[o]);
|
|
7
|
-
if (n)
|
|
8
|
-
for (var o of n(r))
|
|
9
|
-
p.call(r, o) && d(e, o, r[o]);
|
|
10
|
-
return e;
|
|
11
|
-
};
|
|
12
|
-
var l = (e, r) => {
|
|
13
|
-
var o = {};
|
|
14
|
-
for (var t in e)
|
|
15
|
-
i.call(e, t) && r.indexOf(t) < 0 && (o[t] = e[t]);
|
|
16
|
-
if (e != null && n)
|
|
17
|
-
for (var t of n(e))
|
|
18
|
-
r.indexOf(t) < 0 && p.call(e, t) && (o[t] = e[t]);
|
|
19
|
-
return o;
|
|
20
|
-
};
|
|
21
|
-
import f, { Children as h, cloneElement as u } from "react";
|
|
22
|
-
import R from "prop-types";
|
|
23
|
-
const T = (o) => {
|
|
24
|
-
var t = o, { children: e } = t, r = l(t, ["children"]);
|
|
25
|
-
const c = h.toArray(e).map(
|
|
26
|
-
(m, s) => u(m, { "aria-rowindex": s + 2 })
|
|
1
|
+
import d, { Children as i, cloneElement as p } from "react";
|
|
2
|
+
import a from "prop-types";
|
|
3
|
+
const l = ({ children: e, ...r }) => {
|
|
4
|
+
const o = i.toArray(e).map(
|
|
5
|
+
(t, n) => p(t, { "aria-rowindex": n + 2 })
|
|
27
6
|
);
|
|
28
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ d.createElement("tbody", {
|
|
8
|
+
...r
|
|
9
|
+
}, o);
|
|
29
10
|
};
|
|
30
|
-
|
|
31
|
-
children:
|
|
11
|
+
l.propTypes = {
|
|
12
|
+
children: a.node.isRequired
|
|
32
13
|
};
|
|
33
14
|
export {
|
|
34
|
-
|
|
15
|
+
l as RawTbody
|
|
35
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react"),c=require("prop-types"),r=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},d=r(t),u=r(c),a=({children:e,...o})=>{const n=t.Children.toArray(e).map(l=>t.cloneElement(l,{"aria-rowindex":1}));return d.default.createElement("thead",{...o},n)};a.propTypes={children:u.default.node.isRequired};exports.RawThead=a;
|
|
@@ -1,33 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (var o of n(r))
|
|
9
|
-
i.call(r, o) && a(e, o, r[o]);
|
|
10
|
-
return e;
|
|
1
|
+
import n, { Children as a, cloneElement as d } from "react";
|
|
2
|
+
import i from "prop-types";
|
|
3
|
+
const p = ({ children: e, ...r }) => {
|
|
4
|
+
const o = a.toArray(e).map((t) => d(t, { "aria-rowindex": 1 }));
|
|
5
|
+
return /* @__PURE__ */ n.createElement("thead", {
|
|
6
|
+
...r
|
|
7
|
+
}, o);
|
|
11
8
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
for (var t in e)
|
|
15
|
-
d.call(e, t) && r.indexOf(t) < 0 && (o[t] = e[t]);
|
|
16
|
-
if (e != null && n)
|
|
17
|
-
for (var t of n(e))
|
|
18
|
-
r.indexOf(t) < 0 && i.call(e, t) && (o[t] = e[t]);
|
|
19
|
-
return o;
|
|
20
|
-
};
|
|
21
|
-
import s, { Children as f, cloneElement as u } from "react";
|
|
22
|
-
import y from "prop-types";
|
|
23
|
-
const R = (o) => {
|
|
24
|
-
var t = o, { children: e } = t, r = l(t, ["children"]);
|
|
25
|
-
const c = f.toArray(e).map((m) => u(m, { "aria-rowindex": 1 }));
|
|
26
|
-
return /* @__PURE__ */ s.createElement("thead", p({}, r), c);
|
|
27
|
-
};
|
|
28
|
-
R.propTypes = {
|
|
29
|
-
children: y.node.isRequired
|
|
9
|
+
p.propTypes = {
|
|
10
|
+
children: i.node.isRequired
|
|
30
11
|
};
|
|
31
12
|
export {
|
|
32
|
-
|
|
13
|
+
p as RawThead
|
|
33
14
|
};
|
package/dist/RawTable/RawTr.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react"),u=require("prop-types"),s=require("../Box/Box.cjs"),n=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},d=n(r),a=n(u),c=({children:e,...t})=>{const l=r.Children.toArray(e).map((i,o)=>r.cloneElement(i,{"aria-colindex":o+1,coords:{col:o+1,row:t["aria-rowindex"]}}));return d.default.createElement(s.Box,{as:"tr",...t},l)};c.propTypes={"aria-rowindex":a.default.number.isRequired,children:a.default.node.isRequired};exports.RawTr=c;
|
package/dist/RawTable/RawTr.js
CHANGED
|
@@ -1,39 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (n)
|
|
8
|
-
for (var o of n(e))
|
|
9
|
-
d.call(e, o) && a(r, o, e[o]);
|
|
10
|
-
return r;
|
|
11
|
-
};
|
|
12
|
-
var m = (r, e) => {
|
|
13
|
-
var o = {};
|
|
14
|
-
for (var i in r)
|
|
15
|
-
c.call(r, i) && e.indexOf(i) < 0 && (o[i] = r[i]);
|
|
16
|
-
if (r != null && n)
|
|
17
|
-
for (var i of n(r))
|
|
18
|
-
e.indexOf(i) < 0 && d.call(r, i) && (o[i] = r[i]);
|
|
19
|
-
return o;
|
|
20
|
-
};
|
|
21
|
-
import w, { Children as x, cloneElement as R } from "react";
|
|
22
|
-
import p from "prop-types";
|
|
23
|
-
import { Box as h } from "../Box/Box.js";
|
|
24
|
-
const y = (o) => {
|
|
25
|
-
var i = o, { children: r } = i, e = m(i, ["children"]);
|
|
26
|
-
const s = x.toArray(r).map(
|
|
27
|
-
(u, t) => R(u, { "aria-colindex": t + 1, coords: { col: t + 1, row: e["aria-rowindex"] } })
|
|
1
|
+
import a, { Children as c, cloneElement as d } from "react";
|
|
2
|
+
import o from "prop-types";
|
|
3
|
+
import { Box as l } from "../Box/Box.js";
|
|
4
|
+
const m = ({ children: i, ...r }) => {
|
|
5
|
+
const n = c.toArray(i).map(
|
|
6
|
+
(t, e) => d(t, { "aria-colindex": e + 1, coords: { col: e + 1, row: r["aria-rowindex"] } })
|
|
28
7
|
);
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
as: "tr"
|
|
31
|
-
|
|
8
|
+
return /* @__PURE__ */ a.createElement(l, {
|
|
9
|
+
as: "tr",
|
|
10
|
+
...r
|
|
11
|
+
}, n);
|
|
32
12
|
};
|
|
33
|
-
|
|
34
|
-
"aria-rowindex":
|
|
35
|
-
children:
|
|
13
|
+
m.propTypes = {
|
|
14
|
+
"aria-rowindex": o.number.isRequired,
|
|
15
|
+
children: o.node.isRequired
|
|
36
16
|
};
|
|
37
17
|
export {
|
|
38
|
-
|
|
18
|
+
m as RawTr
|
|
39
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react"),r=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},a=r(t),o=e=>a.default.createElement("form",{...e,role:"search"});exports.SearchForm=o;
|