@plesk/ui-library 3.43.2 → 3.44.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/cjs/components/Action/Action.js +10 -3
- package/cjs/components/Alert/Alert.js +1 -0
- package/cjs/components/AutoClosable/AutoClosable.js +47 -61
- package/cjs/components/AuxiliaryActions/AuxiliaryActions.js +13 -4
- package/cjs/components/Button/Button.js +1 -0
- package/cjs/components/Card/Card.js +10 -15
- package/cjs/components/CardList/CardList.js +6 -9
- package/cjs/components/CardList/CardListToolbar.js +12 -18
- package/cjs/components/ClosingConfirmation/useClosingConfirmation.js +7 -11
- package/cjs/components/CodeEditor/CodeEditor.js +1 -2
- package/cjs/components/Columns/Columns.js +1 -2
- package/cjs/components/ComboBox/ComboBox.js +1 -2
- package/cjs/components/ComboBoxDropdown/ComboBoxDropdown.js +4 -2
- package/cjs/components/ComboBoxDropdown/index.js +1 -2
- package/cjs/components/Cuttable/Cuttable.js +6 -8
- package/cjs/components/Dialog/Dialog.js +17 -13
- package/cjs/components/Drawer/Drawer.js +14 -7
- package/cjs/components/Drawer/DrawerProgress.js +4 -6
- package/cjs/components/Dropdown/Dropdown.js +12 -9
- package/cjs/components/Dropdown/index.js +1 -2
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessage.js +1 -0
- package/cjs/components/Figure/index.js +1 -2
- package/cjs/components/Form/Form.js +19 -20
- package/cjs/components/Form/index.js +1 -2
- package/cjs/components/FormField/FormField.js +77 -51
- package/cjs/components/FormField/index.js +1 -2
- package/cjs/components/FormFieldCheckbox/FormFieldCheckbox.js +6 -2
- package/cjs/components/FormFieldPassword/FormFieldPassword.js +18 -21
- package/cjs/components/FormFieldPassword/PasswordMeter.js +9 -15
- package/cjs/components/FormFieldPassword/estimatePassword.js +21 -33
- package/cjs/components/FormFieldRadioButtons/FormFieldRadioButtons.js +50 -44
- package/cjs/components/FormFieldSelect/FormFieldSelect.js +1 -1
- package/cjs/components/FormFieldText/FormFieldText.js +7 -1
- package/cjs/components/Heading/Heading.js +1 -2
- package/cjs/components/Hint/Hint.js +2 -1
- package/cjs/components/Icon/Icon.js +6 -0
- package/cjs/components/Icon/index.js +1 -2
- package/cjs/components/Icon/utils.js +17 -8
- package/cjs/components/InPlaceEdit/Editor.js +5 -8
- package/cjs/components/InPlaceEdit/InPlaceEdit.js +3 -5
- package/cjs/components/InputFile/InputFile.js +7 -9
- package/cjs/components/Item/Item.js +1 -2
- package/cjs/components/ItemList/ItemList.js +1 -2
- package/cjs/components/Layer/index.js +1 -2
- package/cjs/components/Layout/Layout.js +2 -2
- package/cjs/components/Link/Link.js +2 -0
- package/cjs/components/List/List.js +38 -45
- package/cjs/components/List/ListAction.js +1 -0
- package/cjs/components/List/ListActions.js +1 -0
- package/cjs/components/List/ListEmptyView.js +7 -10
- package/cjs/components/List/ListOperation.js +3 -12
- package/cjs/components/LocaleProvider/LocaleProvider.js +20 -12
- package/cjs/components/LocaleProvider/index.js +1 -2
- package/cjs/components/Media/Media.js +1 -2
- package/cjs/components/Menu/Menu.js +10 -8
- package/cjs/components/Menu/MenuBaseItem.js +1 -2
- package/cjs/components/Menu/MenuItem.js +2 -1
- package/cjs/components/Overlay/Overlay.js +2 -0
- package/cjs/components/Pagination/Pagination.js +6 -10
- package/cjs/components/Pagination/index.js +1 -2
- package/cjs/components/Popover/Popover.js +1 -1
- package/cjs/components/Popper/index.js +1 -2
- package/cjs/components/ProgressDialog/ProgressDialog.js +5 -7
- package/cjs/components/ProgressStep/ProgressStep.js +1 -2
- package/cjs/components/ProgressStep/index.js +1 -2
- package/cjs/components/Section/Section.js +87 -225
- package/cjs/components/{Dropdown/locale/en-US.js → Section/SectionContext.js} +4 -3
- package/cjs/components/Section/index.js +1 -2
- package/cjs/components/Section/useCollapsed.js +19 -0
- package/cjs/components/Section/useVertical.js +38 -0
- package/cjs/components/SegmentedControl/DropdownControl.js +1 -2
- package/cjs/components/SegmentedControl/SegmentedControl.js +1 -0
- package/cjs/components/SegmentedControl/index.js +1 -2
- package/cjs/components/Select/Select.js +10 -7
- package/cjs/components/Select/SelectControl.js +13 -3
- package/cjs/components/SplitButton/index.js +1 -2
- package/cjs/components/Spot/SpotPopup.js +3 -4
- package/cjs/components/Status/Status.js +1 -0
- package/cjs/components/Subnav/index.js +1 -2
- package/cjs/components/Tabs/SearchBar.js +1 -2
- package/cjs/components/Tabs/TabIcon.js +1 -2
- package/cjs/components/Tabs/TabList.js +30 -14
- package/cjs/components/Tabs/TabListItem.js +5 -1
- package/cjs/components/Tabs/Tabs.js +16 -12
- package/cjs/components/Tabs/useWidths.js +5 -5
- package/cjs/components/Toast/Toast.js +1 -0
- package/cjs/components/Toast/index.js +1 -2
- package/cjs/components/Toaster/GroupLabel.js +5 -3
- package/cjs/components/Toolbar/Toolbar.js +1 -2
- package/cjs/components/Toolbar/ToolbarGroup.js +1 -2
- package/cjs/components/Toolbar/ToolbarMenu.js +1 -2
- package/cjs/components/Tooltip/Tooltip.js +11 -4
- package/cjs/components/Translate/Translate.js +13 -3
- package/cjs/components/Translate/index.js +28 -3
- package/cjs/components/Translate/locale.js +25 -0
- package/cjs/components/VerticalContext/index.js +1 -2
- package/cjs/components/index.js +16 -3
- package/cjs/hooks/useResizeObserver.js +8 -2
- package/cjs/index.js +1 -1
- package/cjs/locales/ar.js +124 -0
- package/cjs/locales/ca-ES.js +124 -0
- package/cjs/locales/cs-CZ.js +124 -0
- package/cjs/locales/da-DK.js +124 -0
- package/cjs/locales/de-DE.js +124 -0
- package/cjs/locales/el-GR.js +124 -0
- package/cjs/locales/en-US.js +124 -0
- package/cjs/locales/es-ES.js +124 -0
- package/cjs/locales/fi-FI.js +124 -0
- package/cjs/locales/fr-FR.js +124 -0
- package/cjs/locales/he-IL.js +124 -0
- package/cjs/locales/hu-HU.js +124 -0
- package/cjs/locales/id-ID.js +124 -0
- package/cjs/locales/index.js +172 -0
- package/cjs/locales/it-IT.js +124 -0
- package/cjs/locales/ja-JP.js +124 -0
- package/cjs/locales/ko-KR.js +124 -0
- package/cjs/locales/ms-MY.js +124 -0
- package/cjs/locales/nb-NO.js +124 -0
- package/cjs/locales/nl-NL.js +124 -0
- package/cjs/locales/pl-PL.js +124 -0
- package/cjs/locales/pt-BR.js +124 -0
- package/cjs/locales/pt-PT.js +124 -0
- package/cjs/locales/ro-RO.js +124 -0
- package/cjs/locales/ru-RU.js +124 -0
- package/cjs/locales/sv-SE.js +124 -0
- package/cjs/locales/th-TH.js +124 -0
- package/cjs/locales/tl-PH.js +124 -0
- package/cjs/locales/tr-TR.js +124 -0
- package/cjs/locales/uk-UA.js +124 -0
- package/cjs/locales/vi-VN.js +124 -0
- package/cjs/locales/zh-CN.js +124 -0
- package/cjs/locales/zh-TW.js +124 -0
- package/cjs/utils.js +17 -2
- package/dist/plesk-ui-library-rtl.css +1 -1
- package/dist/plesk-ui-library-rtl.css.map +1 -1
- package/dist/plesk-ui-library.css +1 -1
- package/dist/plesk-ui-library.css.map +1 -1
- package/dist/plesk-ui-library.js +5517 -1054
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +6 -6
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/Action/Action.js +9 -1
- package/esm/components/Alert/Alert.js +1 -0
- package/esm/components/AutoClosable/AutoClosable.js +48 -62
- package/esm/components/AuxiliaryActions/AuxiliaryActions.js +13 -4
- package/esm/components/Button/Button.js +1 -0
- package/esm/components/Card/Card.js +9 -13
- package/esm/components/CardList/CardList.js +5 -7
- package/esm/components/CardList/CardListToolbar.js +11 -16
- package/esm/components/ClosingConfirmation/useClosingConfirmation.js +7 -11
- package/esm/components/ComboBoxDropdown/ComboBoxDropdown.js +3 -0
- package/esm/components/Cuttable/Cuttable.js +6 -8
- package/esm/components/Dialog/Dialog.js +18 -12
- package/esm/components/Drawer/Drawer.js +15 -8
- package/esm/components/Drawer/DrawerProgress.js +3 -4
- package/esm/components/Dropdown/Dropdown.js +11 -9
- package/esm/components/ExtendedStatusMessage/ExtendedStatusMessage.js +1 -0
- package/esm/components/Form/Form.js +18 -18
- package/esm/components/FormField/FormField.js +77 -51
- package/esm/components/FormFieldCheckbox/FormFieldCheckbox.js +6 -2
- package/esm/components/FormFieldPassword/FormFieldPassword.js +18 -21
- package/esm/components/FormFieldPassword/PasswordMeter.js +8 -13
- package/esm/components/FormFieldPassword/estimatePassword.js +21 -32
- package/esm/components/FormFieldRadioButtons/FormFieldRadioButtons.js +49 -42
- package/esm/components/FormFieldSelect/FormFieldSelect.js +1 -1
- package/esm/components/FormFieldText/FormFieldText.js +7 -1
- package/esm/components/Hint/Hint.js +2 -1
- package/esm/components/Icon/Icon.js +6 -0
- package/esm/components/Icon/utils.js +16 -6
- package/esm/components/InPlaceEdit/Editor.js +5 -8
- package/esm/components/InPlaceEdit/InPlaceEdit.js +3 -5
- package/esm/components/InputFile/InputFile.js +7 -9
- package/esm/components/Layout/Layout.js +2 -2
- package/esm/components/Link/Link.js +2 -0
- package/esm/components/List/List.js +37 -43
- package/esm/components/List/ListAction.js +1 -0
- package/esm/components/List/ListActions.js +1 -0
- package/esm/components/List/ListEmptyView.js +7 -10
- package/esm/components/List/ListOperation.js +3 -12
- package/esm/components/LocaleProvider/LocaleProvider.js +18 -11
- package/esm/components/Menu/Menu.js +10 -8
- package/esm/components/Menu/MenuItem.js +2 -1
- package/esm/components/Overlay/Overlay.js +2 -0
- package/esm/components/Pagination/Pagination.js +6 -10
- package/esm/components/Popover/Popover.js +1 -1
- package/esm/components/ProgressDialog/ProgressDialog.js +5 -7
- package/esm/components/Section/Section.js +88 -224
- package/esm/components/Section/SectionContext.js +5 -0
- package/esm/components/Section/useCollapsed.js +12 -0
- package/esm/components/Section/useVertical.js +30 -0
- package/esm/components/SegmentedControl/SegmentedControl.js +1 -0
- package/esm/components/Select/Select.js +10 -6
- package/esm/components/Select/SelectControl.js +14 -4
- package/esm/components/Spot/SpotPopup.js +3 -4
- package/esm/components/Status/Status.js +1 -0
- package/esm/components/Tabs/TabList.js +29 -12
- package/esm/components/Tabs/TabListItem.js +5 -1
- package/esm/components/Tabs/Tabs.js +17 -13
- package/esm/components/Tabs/useWidths.js +5 -5
- package/esm/components/Toast/Toast.js +1 -0
- package/esm/components/Toaster/GroupLabel.js +5 -3
- package/esm/components/Tooltip/Tooltip.js +11 -4
- package/esm/components/Translate/Translate.js +11 -2
- package/esm/components/Translate/index.js +3 -2
- package/esm/components/Translate/locale.js +15 -0
- package/esm/components/index.js +1 -1
- package/esm/hooks/useResizeObserver.js +8 -2
- package/esm/index.js +1 -1
- package/esm/locales/ar.js +119 -0
- package/esm/locales/ca-ES.js +119 -0
- package/esm/locales/cs-CZ.js +119 -0
- package/esm/locales/da-DK.js +119 -0
- package/esm/locales/de-DE.js +119 -0
- package/esm/locales/el-GR.js +119 -0
- package/esm/locales/en-US.js +119 -0
- package/esm/locales/es-ES.js +119 -0
- package/esm/locales/fi-FI.js +119 -0
- package/esm/locales/fr-FR.js +119 -0
- package/esm/locales/he-IL.js +119 -0
- package/esm/locales/hu-HU.js +119 -0
- package/esm/locales/id-ID.js +119 -0
- package/esm/locales/index.js +165 -0
- package/esm/locales/it-IT.js +119 -0
- package/esm/locales/ja-JP.js +119 -0
- package/esm/locales/ko-KR.js +119 -0
- package/esm/locales/ms-MY.js +119 -0
- package/esm/locales/nb-NO.js +119 -0
- package/esm/locales/nl-NL.js +119 -0
- package/esm/locales/pl-PL.js +119 -0
- package/esm/locales/pt-BR.js +119 -0
- package/esm/locales/pt-PT.js +119 -0
- package/esm/locales/ro-RO.js +119 -0
- package/esm/locales/ru-RU.js +119 -0
- package/esm/locales/sv-SE.js +119 -0
- package/esm/locales/th-TH.js +119 -0
- package/esm/locales/tl-PH.js +119 -0
- package/esm/locales/tr-TR.js +119 -0
- package/esm/locales/uk-UA.js +119 -0
- package/esm/locales/vi-VN.js +119 -0
- package/esm/locales/zh-CN.js +119 -0
- package/esm/locales/zh-TW.js +119 -0
- package/esm/utils.js +14 -0
- package/package.json +4 -4
- package/styleguide/build/bundle.cf3363eb.js +2 -0
- package/styleguide/index.html +2 -2
- package/types/components/AutoClosable/AutoClosable.d.ts +5 -37
- package/types/components/Button/Button.d.ts +2 -2
- package/types/components/ComboBoxDropdown/ComboBoxDropdown.d.ts +2 -1
- package/types/components/Form/types.d.ts +2 -0
- package/types/components/FormField/FormField.d.ts +6 -0
- package/types/components/FormFieldSelect/FormFieldSelect.d.ts +1 -1
- package/types/components/Hint/Hint.d.ts +11 -8
- package/types/components/Icon/Icon.d.ts +5 -0
- package/types/components/Input/Input.d.ts +2 -2
- package/types/components/LocaleProvider/LocaleProvider.d.ts +3 -2
- package/types/components/Menu/Menu.d.ts +5 -0
- package/types/components/Menu/MenuItem.d.ts +6 -1
- package/types/components/Overlay/Overlay.d.ts +4 -0
- package/types/components/Popover/Popover.d.ts +1 -1
- package/types/components/Section/Section.d.ts +3 -46
- package/types/components/Section/SectionContext.d.ts +5 -0
- package/types/components/Section/useCollapsed.d.ts +1 -0
- package/types/components/Section/useVertical.d.ts +2 -0
- package/types/components/Select/SelectControl.d.ts +2 -0
- package/types/components/Tabs/TabList.d.ts +3 -1
- package/types/components/Tabs/TabListItem.d.ts +4 -1
- package/types/components/Tabs/useWidths.d.ts +2 -2
- package/types/components/Tooltip/Tooltip.d.ts +1 -0
- package/types/components/Translate/Translate.d.ts +7 -1
- package/types/components/Translate/index.d.ts +2 -1
- package/types/components/Translate/locale.d.ts +4 -0
- package/types/components/index.d.ts +1 -1
- package/types/hooks/useResizeObserver.d.ts +2 -1
- package/types/locales/index.d.ts +10 -0
- package/types/utils.d.ts +3 -0
- package/cjs/components/ClosingConfirmation/locale/en-US.js +0 -12
- package/cjs/components/FormFieldPassword/locale/en-US.js +0 -33
- package/cjs/components/InPlaceEdit/locale/en-US.js +0 -12
- package/cjs/components/InputFile/locale/en-US.js +0 -10
- package/esm/components/ClosingConfirmation/locale/en-US.js +0 -7
- package/esm/components/Dropdown/locale/en-US.js +0 -5
- package/esm/components/FormFieldPassword/locale/en-US.js +0 -28
- package/esm/components/InPlaceEdit/locale/en-US.js +0 -7
- package/esm/components/InputFile/locale/en-US.js +0 -5
- package/styleguide/build/bundle.2360aa9e.js +0 -2
- package/types/components/InPlaceEdit/locale/en-US.d.ts +0 -6
- /package/styleguide/build/{bundle.2360aa9e.js.LICENSE.txt → bundle.cf3363eb.js.LICENSE.txt} +0 -0
|
@@ -28,50 +28,57 @@ const FormFieldRadioButtons = _ref => {
|
|
|
28
28
|
getName,
|
|
29
29
|
getValue,
|
|
30
30
|
setValue,
|
|
31
|
-
isDisabled
|
|
31
|
+
isDisabled,
|
|
32
|
+
getErrors,
|
|
33
|
+
getDescriptionLabelId
|
|
32
34
|
} = _ref2;
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
setValue(value);
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
disabled: isDisabled() || disabled,
|
|
52
|
-
inputProps: {
|
|
53
|
-
id: getId() ? `${getId()}-${value}` : undefined,
|
|
35
|
+
return /*#__PURE__*/_jsx("fieldset", {
|
|
36
|
+
"aria-invalid": !!Object.keys(getErrors() ?? {}).length,
|
|
37
|
+
"aria-describedby": getDescriptionLabelId(),
|
|
38
|
+
className: `${baseClassName}__fieldset`,
|
|
39
|
+
children: options.map((_ref3, index) => {
|
|
40
|
+
let {
|
|
41
|
+
value,
|
|
42
|
+
label,
|
|
43
|
+
description,
|
|
44
|
+
disabled,
|
|
45
|
+
indentFields = []
|
|
46
|
+
} = _ref3;
|
|
47
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
48
|
+
className: `${baseClassName}__radio`,
|
|
49
|
+
children: [/*#__PURE__*/_jsx(Radio, {
|
|
54
50
|
name: getName(),
|
|
55
|
-
value,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
51
|
+
checked: getValue() === value,
|
|
52
|
+
onChange: isChecked => {
|
|
53
|
+
if (isChecked) {
|
|
54
|
+
setValue(value);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
disabled: isDisabled() || disabled,
|
|
58
|
+
inputProps: {
|
|
59
|
+
id: getId() ? `${getId()}-${value}` : undefined,
|
|
60
|
+
name: getName(),
|
|
61
|
+
value,
|
|
62
|
+
autoFocus: index === 0 && autoFocus ? true : undefined
|
|
63
|
+
},
|
|
64
|
+
children: label || value
|
|
65
|
+
}), description || indentFields ? /*#__PURE__*/_jsxs("div", {
|
|
66
|
+
className: `${baseClassName}__content`,
|
|
67
|
+
children: [description && /*#__PURE__*/_jsx(Hint, {
|
|
68
|
+
component: "div",
|
|
69
|
+
className: `${BASE_FORM_FIELD_CLASS_NAME}__description`,
|
|
70
|
+
children: description
|
|
71
|
+
}), indentFields.map(field => {
|
|
72
|
+
if (isDisabled() || disabled || getValue() !== value) {
|
|
73
|
+
return /*#__PURE__*/cloneElement(field, {
|
|
74
|
+
disabled: true
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return field;
|
|
78
|
+
})]
|
|
79
|
+
}) : null]
|
|
80
|
+
}, value);
|
|
81
|
+
})
|
|
75
82
|
});
|
|
76
83
|
}
|
|
77
84
|
});
|
|
@@ -6,7 +6,7 @@ import FormField from '../FormField';
|
|
|
6
6
|
import Select from '../Select';
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
/**
|
|
9
|
-
* `FormFieldSelect`
|
|
9
|
+
* `FormFieldSelect` component is used for making a choice among a set of related options.
|
|
10
10
|
* See description of `Select` for [the full list of properties](#!/Select) of this component.
|
|
11
11
|
* @since 1.12.3
|
|
12
12
|
*/
|
|
@@ -36,7 +36,9 @@ const FormFieldText = props => {
|
|
|
36
36
|
getName,
|
|
37
37
|
getValue,
|
|
38
38
|
setValue,
|
|
39
|
-
|
|
39
|
+
getErrors,
|
|
40
|
+
isDisabled,
|
|
41
|
+
getDescriptionLabelId
|
|
40
42
|
} = _ref;
|
|
41
43
|
return props.multiline ? /*#__PURE__*/_jsx(TextArea, {
|
|
42
44
|
id: getId(),
|
|
@@ -50,6 +52,8 @@ const FormFieldText = props => {
|
|
|
50
52
|
autoFocus: autoFocus,
|
|
51
53
|
autoComplete: autoComplete,
|
|
52
54
|
autoheight: autoheight,
|
|
55
|
+
"aria-invalid": !!Object.keys(getErrors() ?? {}).length,
|
|
56
|
+
"aria-describedby": getDescriptionLabelId(),
|
|
53
57
|
...(props.inputProps ?? {})
|
|
54
58
|
}) : /*#__PURE__*/_jsx(Input, {
|
|
55
59
|
id: getId(),
|
|
@@ -62,6 +66,8 @@ const FormFieldText = props => {
|
|
|
62
66
|
placeholder: placeholder,
|
|
63
67
|
autoFocus: autoFocus,
|
|
64
68
|
autoComplete: autoComplete,
|
|
69
|
+
"aria-invalid": !!Object.keys(getErrors() ?? {}).length,
|
|
70
|
+
"aria-describedby": getDescriptionLabelId(),
|
|
65
71
|
...(props.inputProps ?? {})
|
|
66
72
|
});
|
|
67
73
|
}
|
|
@@ -12,9 +12,10 @@ const Hint = _ref => {
|
|
|
12
12
|
baseClassName = `${CLS_PREFIX}hint`,
|
|
13
13
|
className,
|
|
14
14
|
children,
|
|
15
|
-
component
|
|
15
|
+
component,
|
|
16
16
|
...props
|
|
17
17
|
} = _ref;
|
|
18
|
+
const Tag = component || 'span';
|
|
18
19
|
return /*#__PURE__*/_jsx(Tag, {
|
|
19
20
|
className: classNames(baseClassName, className),
|
|
20
21
|
...props,
|
|
@@ -43,6 +43,7 @@ const getHref = (name, size) => {
|
|
|
43
43
|
|
|
44
44
|
const Icon = _ref => {
|
|
45
45
|
let {
|
|
46
|
+
ariaLabel,
|
|
46
47
|
baseClassName = `${CLS_PREFIX}icon`,
|
|
47
48
|
className,
|
|
48
49
|
name,
|
|
@@ -69,6 +70,11 @@ const Icon = _ref => {
|
|
|
69
70
|
[`${baseClassName}--flip-vertical`]: flipVertical,
|
|
70
71
|
[`${baseClassName}--on-dark`]: useContext(OnDarkContext)
|
|
71
72
|
}, className),
|
|
73
|
+
...(ariaLabel || props['aria-label'] ? {
|
|
74
|
+
'aria-label': ariaLabel || props['aria-label']
|
|
75
|
+
} : {
|
|
76
|
+
'aria-hidden': 'true'
|
|
77
|
+
}),
|
|
72
78
|
...props,
|
|
73
79
|
children: newName ? /*#__PURE__*/_jsx("svg", {
|
|
74
80
|
focusable: "false",
|
|
@@ -9,21 +9,31 @@ export const create = function (icon) {
|
|
|
9
9
|
if (!icon) {
|
|
10
10
|
return icon;
|
|
11
11
|
}
|
|
12
|
+
const computedProps = {
|
|
13
|
+
...defaults
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/* Hide the icon from assistive technologies unless labeled explicitly */
|
|
17
|
+
if (!('aria-hidden' in defaults)) {
|
|
18
|
+
if (!('aria-label' in defaults) && !('ariaLabel' in defaults)) {
|
|
19
|
+
computedProps['aria-hidden'] = 'true';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
12
22
|
if (/*#__PURE__*/isValidElement(icon)) {
|
|
13
23
|
const {
|
|
14
24
|
className,
|
|
15
25
|
...props
|
|
16
26
|
} = icon.props;
|
|
17
27
|
const newProps = {
|
|
18
|
-
...
|
|
28
|
+
...computedProps
|
|
19
29
|
};
|
|
20
30
|
Object.keys(props).forEach(name => {
|
|
21
31
|
if (props[name] !== null && props[name] !== undefined) {
|
|
22
32
|
newProps[name] = props[name];
|
|
23
33
|
}
|
|
24
34
|
});
|
|
25
|
-
if (
|
|
26
|
-
newProps.className = classNames(
|
|
35
|
+
if (computedProps.className || className) {
|
|
36
|
+
newProps.className = classNames(computedProps.className, className);
|
|
27
37
|
}
|
|
28
38
|
return /*#__PURE__*/cloneElement(icon, newProps);
|
|
29
39
|
}
|
|
@@ -33,13 +43,13 @@ export const create = function (icon) {
|
|
|
33
43
|
...props
|
|
34
44
|
} = icon;
|
|
35
45
|
return /*#__PURE__*/_jsx(Icon, {
|
|
36
|
-
...
|
|
37
|
-
className:
|
|
46
|
+
...computedProps,
|
|
47
|
+
className: computedProps.className || className ? classNames(computedProps.className, className) : null,
|
|
38
48
|
...props
|
|
39
49
|
});
|
|
40
50
|
}
|
|
41
51
|
return /*#__PURE__*/_jsx(Icon, {
|
|
42
|
-
...
|
|
52
|
+
...computedProps,
|
|
43
53
|
name: icon
|
|
44
54
|
});
|
|
45
55
|
};
|
|
@@ -4,8 +4,7 @@ import { useState } from 'react';
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import Button from '../Button';
|
|
6
6
|
import Input from '../Input';
|
|
7
|
-
import
|
|
8
|
-
import locale from './locale/en-US';
|
|
7
|
+
import { InternalTranslate } from '../Translate';
|
|
9
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
9
|
const Editor = _ref => {
|
|
11
10
|
let {
|
|
@@ -41,18 +40,16 @@ const Editor = _ref => {
|
|
|
41
40
|
className: classNames(`${baseClassName}__control-button`, `${baseClassName}__control-button--ok`),
|
|
42
41
|
icon: "check-mark",
|
|
43
42
|
onClick: handleSave,
|
|
44
|
-
tooltip: /*#__PURE__*/_jsx(
|
|
45
|
-
content: "InPlaceEdit.okButtonHint"
|
|
46
|
-
fallback: locale.okButtonHint
|
|
43
|
+
tooltip: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
44
|
+
content: "InPlaceEdit.okButtonHint"
|
|
47
45
|
})
|
|
48
46
|
}), /*#__PURE__*/_jsx(Button, {
|
|
49
47
|
ghost: true,
|
|
50
48
|
className: classNames(`${baseClassName}__control-button`, `${baseClassName}__control-button--cancel`),
|
|
51
49
|
icon: "cross-mark",
|
|
52
50
|
onClick: onCancel,
|
|
53
|
-
tooltip: /*#__PURE__*/_jsx(
|
|
54
|
-
content: "InPlaceEdit.cancelButtonHint"
|
|
55
|
-
fallback: locale.cancelButtonHint
|
|
51
|
+
tooltip: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
52
|
+
content: "InPlaceEdit.cancelButtonHint"
|
|
56
53
|
})
|
|
57
54
|
})]
|
|
58
55
|
})]
|
|
@@ -4,9 +4,8 @@ import { useState } from 'react';
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { CLS_PREFIX } from '../../constants';
|
|
6
6
|
import Button from '../Button';
|
|
7
|
-
import
|
|
7
|
+
import { InternalTranslate } from '../Translate';
|
|
8
8
|
import Editor from './Editor';
|
|
9
|
-
import locale from './locale/en-US';
|
|
10
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
10
|
/**
|
|
12
11
|
* This component allows users to edit a short text "in place" — in other words, straight in the interface, without
|
|
@@ -39,9 +38,8 @@ const InPlaceEdit = _ref => {
|
|
|
39
38
|
name: 'pencil',
|
|
40
39
|
className: `${baseClassName}__control-button-icon`
|
|
41
40
|
},
|
|
42
|
-
tooltip: /*#__PURE__*/_jsx(
|
|
43
|
-
content: "InPlaceEdit.editButtonHint"
|
|
44
|
-
fallback: locale.editButtonHint
|
|
41
|
+
tooltip: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
42
|
+
content: "InPlaceEdit.editButtonHint"
|
|
45
43
|
})
|
|
46
44
|
}), isEditing && /*#__PURE__*/_jsx(Editor, {
|
|
47
45
|
baseClassName: baseClassName,
|
|
@@ -6,8 +6,7 @@ import { CLS_PREFIX } from '../../constants';
|
|
|
6
6
|
import { safeInvoke } from '../utils';
|
|
7
7
|
import Text from '../Text';
|
|
8
8
|
import Button from '../Button';
|
|
9
|
-
import
|
|
10
|
-
import localeFallback from './locale/en-US';
|
|
9
|
+
import { InternalTranslate } from '../Translate';
|
|
11
10
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
11
|
const generateId = () => Math.random().toString(36).slice(2);
|
|
13
12
|
|
|
@@ -63,7 +62,7 @@ const InputFile = _ref => {
|
|
|
63
62
|
...props,
|
|
64
63
|
children: [/*#__PURE__*/_jsxs(Button, {
|
|
65
64
|
className: `${baseClassName}__button`,
|
|
66
|
-
"data-
|
|
65
|
+
"data-testId": testId && `${testId}--browse-button`,
|
|
67
66
|
disabled: disabled,
|
|
68
67
|
component: "label",
|
|
69
68
|
state: hasFocus ? 'focused' : undefined,
|
|
@@ -74,29 +73,28 @@ const InputFile = _ref => {
|
|
|
74
73
|
onChange: handleChange,
|
|
75
74
|
className: `${baseClassName}__input`,
|
|
76
75
|
ref: inputRef,
|
|
77
|
-
"data-
|
|
76
|
+
"data-testId": testId && `${testId}--file-input`,
|
|
78
77
|
onFocus: handleFocus,
|
|
79
78
|
onBlur: handleBlur,
|
|
80
79
|
accept: accept
|
|
81
|
-
}, id), /*#__PURE__*/_jsx(
|
|
80
|
+
}, id), /*#__PURE__*/_jsx(InternalTranslate, {
|
|
82
81
|
namespace: "InputFile",
|
|
83
82
|
content: "browseButton",
|
|
84
|
-
translators: locale
|
|
85
|
-
fallback: localeFallback.browseButton
|
|
83
|
+
translators: locale
|
|
86
84
|
})]
|
|
87
85
|
}), file && /*#__PURE__*/_jsxs(_Fragment, {
|
|
88
86
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
89
87
|
truncate: true,
|
|
90
88
|
nowrap: true,
|
|
91
89
|
className: `${baseClassName}__name`,
|
|
92
|
-
"data-
|
|
90
|
+
"data-testId": testId && `${testId}--file-name`,
|
|
93
91
|
intent: disabled ? 'muted' : undefined,
|
|
94
92
|
children: file.name
|
|
95
93
|
}), /*#__PURE__*/_jsx(Button, {
|
|
96
94
|
icon: "cross-mark",
|
|
97
95
|
ghost: true,
|
|
98
96
|
onClick: handleReset,
|
|
99
|
-
"data-
|
|
97
|
+
"data-testId": testId && `${testId}--reset-button`,
|
|
100
98
|
disabled: disabled
|
|
101
99
|
})]
|
|
102
100
|
})]
|
|
@@ -44,6 +44,7 @@ const Link = _ref => {
|
|
|
44
44
|
if (disabled) {
|
|
45
45
|
props.onClick = e => e.preventDefault();
|
|
46
46
|
props.tabIndex = -1;
|
|
47
|
+
props['aria-disabled'] = true;
|
|
47
48
|
}
|
|
48
49
|
// accessibility
|
|
49
50
|
if (onClick) {
|
|
@@ -54,6 +55,7 @@ const Link = _ref => {
|
|
|
54
55
|
e.currentTarget.click();
|
|
55
56
|
}
|
|
56
57
|
});
|
|
58
|
+
props.role = 'button';
|
|
57
59
|
}
|
|
58
60
|
return /*#__PURE__*/_jsxs(Tag, {
|
|
59
61
|
...props,
|
|
@@ -11,7 +11,7 @@ import Checkbox from '../Checkbox';
|
|
|
11
11
|
import Icon from '../Icon';
|
|
12
12
|
import { safeInvoke, isClickable, scrollIntoView, wrapFunction } from '../utils';
|
|
13
13
|
import Button from '../Button';
|
|
14
|
-
import
|
|
14
|
+
import { InternalTranslate } from '../Translate';
|
|
15
15
|
import Text from '../Text';
|
|
16
16
|
import { ITEMS_PER_PAGE_OPTIONS } from '../Pagination';
|
|
17
17
|
import Spinner from '../Spinner';
|
|
@@ -74,20 +74,18 @@ const getHumanTotalRows = _ref2 => {
|
|
|
74
74
|
});
|
|
75
75
|
switch (mode) {
|
|
76
76
|
case 'totalRows':
|
|
77
|
-
return wrapToText(/*#__PURE__*/_jsx(
|
|
77
|
+
return wrapToText(/*#__PURE__*/_jsx(InternalTranslate, {
|
|
78
78
|
namespace: "List",
|
|
79
79
|
content: "totalRows",
|
|
80
|
-
fallback: "%%totalRows%% items total",
|
|
81
80
|
params: {
|
|
82
81
|
totalRows
|
|
83
82
|
},
|
|
84
83
|
translators: translators
|
|
85
84
|
}));
|
|
86
85
|
case 'selectedRows':
|
|
87
|
-
return wrapToText(/*#__PURE__*/_jsx(
|
|
86
|
+
return wrapToText(/*#__PURE__*/_jsx(InternalTranslate, {
|
|
88
87
|
namespace: "List",
|
|
89
88
|
content: "selectedRows",
|
|
90
|
-
fallback: "%%selectedRows%% of %%totalRows%% items selected",
|
|
91
89
|
params: {
|
|
92
90
|
selectedRows: /*#__PURE__*/_jsx(Text, {
|
|
93
91
|
bold: true,
|
|
@@ -98,17 +96,15 @@ const getHumanTotalRows = _ref2 => {
|
|
|
98
96
|
translators: translators
|
|
99
97
|
}));
|
|
100
98
|
case 'selectedAllRows':
|
|
101
|
-
return wrapToText(/*#__PURE__*/_jsx(
|
|
99
|
+
return wrapToText(/*#__PURE__*/_jsx(InternalTranslate, {
|
|
102
100
|
namespace: "List",
|
|
103
101
|
content: "selectedRows",
|
|
104
|
-
fallback: "%%selectedRows%% of %%totalRows%% items selected",
|
|
105
102
|
params: {
|
|
106
103
|
selectedRows: /*#__PURE__*/_jsx(Text, {
|
|
107
104
|
bold: true,
|
|
108
|
-
children: /*#__PURE__*/_jsx(
|
|
105
|
+
children: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
109
106
|
namespace: "List",
|
|
110
107
|
content: "all",
|
|
111
|
-
fallback: "All",
|
|
112
108
|
translators: translators
|
|
113
109
|
})
|
|
114
110
|
}),
|
|
@@ -585,10 +581,10 @@ class List extends Component {
|
|
|
585
581
|
vertical,
|
|
586
582
|
reorderableItemWidths
|
|
587
583
|
} = this.state;
|
|
588
|
-
const hasActions = realColumn.some(
|
|
584
|
+
const hasActions = realColumn.some(_ref0 => {
|
|
589
585
|
let {
|
|
590
586
|
type
|
|
591
|
-
} =
|
|
587
|
+
} = _ref0;
|
|
592
588
|
return type === 'actions';
|
|
593
589
|
});
|
|
594
590
|
const {
|
|
@@ -602,6 +598,7 @@ class List extends Component {
|
|
|
602
598
|
...(Wrapper === Tbody && !isDragged ? reorderableProps : undefined),
|
|
603
599
|
key: getRowKey(row, this.props)
|
|
604
600
|
}, /*#__PURE__*/_jsx("tr", {
|
|
601
|
+
role: "listitem",
|
|
605
602
|
className: classNames({
|
|
606
603
|
'is-selected': this.isRowSelected(row),
|
|
607
604
|
[`${baseClassName}__row--expanded`]: this.isRowExpanded(row),
|
|
@@ -614,7 +611,7 @@ class List extends Component {
|
|
|
614
611
|
}, className),
|
|
615
612
|
...rowProps,
|
|
616
613
|
onClick: renderRowBody ? this.createRowClickHandler(row) : undefined,
|
|
617
|
-
children: realColumn.map((
|
|
614
|
+
children: realColumn.map((_ref1, index) => {
|
|
618
615
|
let {
|
|
619
616
|
key,
|
|
620
617
|
title,
|
|
@@ -623,7 +620,7 @@ class List extends Component {
|
|
|
623
620
|
cellProps,
|
|
624
621
|
truncate,
|
|
625
622
|
type
|
|
626
|
-
} =
|
|
623
|
+
} = _ref1;
|
|
627
624
|
if (skipCells > 0) {
|
|
628
625
|
skipCells -= 1;
|
|
629
626
|
return null;
|
|
@@ -725,19 +722,20 @@ class List extends Component {
|
|
|
725
722
|
[`${baseClassName}--expandable`]: renderRowBody,
|
|
726
723
|
[`${baseClassName}__table--vertical`]: vertical
|
|
727
724
|
}),
|
|
725
|
+
role: "list",
|
|
728
726
|
children: element
|
|
729
727
|
})
|
|
730
728
|
});
|
|
731
729
|
}
|
|
732
730
|
return element;
|
|
733
731
|
}
|
|
734
|
-
renderRowBody(
|
|
732
|
+
renderRowBody(_ref10) {
|
|
735
733
|
let {
|
|
736
734
|
row,
|
|
737
735
|
index,
|
|
738
736
|
realColumn,
|
|
739
737
|
parent
|
|
740
|
-
} =
|
|
738
|
+
} = _ref10;
|
|
741
739
|
const {
|
|
742
740
|
baseClassName,
|
|
743
741
|
renderRowBody
|
|
@@ -748,16 +746,16 @@ class List extends Component {
|
|
|
748
746
|
if (!renderRowBody) {
|
|
749
747
|
return null;
|
|
750
748
|
}
|
|
751
|
-
const reorderable = realColumn.find(
|
|
749
|
+
const reorderable = realColumn.find(_ref11 => {
|
|
752
750
|
let {
|
|
753
751
|
key
|
|
754
|
-
} =
|
|
752
|
+
} = _ref11;
|
|
755
753
|
return key === 'reorderable';
|
|
756
754
|
});
|
|
757
|
-
const expander = realColumn.find(
|
|
755
|
+
const expander = realColumn.find(_ref12 => {
|
|
758
756
|
let {
|
|
759
757
|
key
|
|
760
|
-
} =
|
|
758
|
+
} = _ref12;
|
|
761
759
|
return key === 'expander';
|
|
762
760
|
});
|
|
763
761
|
const isRowExpanded = this.isRowExpanded(row);
|
|
@@ -772,6 +770,7 @@ class List extends Component {
|
|
|
772
770
|
classNames: `${baseClassName}__row-body-`,
|
|
773
771
|
nodeRef: trRef,
|
|
774
772
|
children: state => /*#__PURE__*/_jsxs("tr", {
|
|
773
|
+
role: "listitem",
|
|
775
774
|
className: `${baseClassName}__row-body`,
|
|
776
775
|
ref: trRef,
|
|
777
776
|
children: [reorderable ? /*#__PURE__*/_jsx("td", {
|
|
@@ -821,10 +820,9 @@ class List extends Component {
|
|
|
821
820
|
}
|
|
822
821
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
823
822
|
const context = {
|
|
824
|
-
selectedRows: allRowsSelected ? totalRows || /*#__PURE__*/_jsx(
|
|
823
|
+
selectedRows: allRowsSelected ? totalRows || /*#__PURE__*/_jsx(InternalTranslate, {
|
|
825
824
|
namespace: "List",
|
|
826
825
|
content: "all",
|
|
827
|
-
fallback: "all",
|
|
828
826
|
translators: locale
|
|
829
827
|
}) : selection.length,
|
|
830
828
|
selectedRowTitle
|
|
@@ -960,10 +958,9 @@ class List extends Component {
|
|
|
960
958
|
className: `${baseClassName}__select-all-menu`,
|
|
961
959
|
children: [isAllOnPageSelected && /*#__PURE__*/_jsxs(MenuItem, {
|
|
962
960
|
disabled: true,
|
|
963
|
-
children: [/*#__PURE__*/_jsx(
|
|
961
|
+
children: [/*#__PURE__*/_jsx(InternalTranslate, {
|
|
964
962
|
namespace: "List",
|
|
965
963
|
content: "allItemsOnPageSelected",
|
|
966
|
-
fallback: "All items on the page selected",
|
|
967
964
|
translators: locale
|
|
968
965
|
}), /*#__PURE__*/_jsx(Label, {
|
|
969
966
|
intent: "info",
|
|
@@ -971,10 +968,9 @@ class List extends Component {
|
|
|
971
968
|
})]
|
|
972
969
|
}), isAllSelected ? /*#__PURE__*/_jsxs(MenuItem, {
|
|
973
970
|
disabled: true,
|
|
974
|
-
children: [/*#__PURE__*/_jsx(
|
|
971
|
+
children: [/*#__PURE__*/_jsx(InternalTranslate, {
|
|
975
972
|
namespace: "List",
|
|
976
973
|
content: "allItemsSelected",
|
|
977
|
-
fallback: "All items selected",
|
|
978
974
|
translators: locale
|
|
979
975
|
}), /*#__PURE__*/_jsx(Label, {
|
|
980
976
|
intent: "info",
|
|
@@ -988,10 +984,9 @@ class List extends Component {
|
|
|
988
984
|
onSelectAll('SELECT_ALL');
|
|
989
985
|
}
|
|
990
986
|
},
|
|
991
|
-
children: [/*#__PURE__*/_jsx(
|
|
987
|
+
children: [/*#__PURE__*/_jsx(InternalTranslate, {
|
|
992
988
|
namespace: "List",
|
|
993
989
|
content: "selectAllItems",
|
|
994
|
-
fallback: "Select all items",
|
|
995
990
|
translators: locale
|
|
996
991
|
}), /*#__PURE__*/_jsx(Label, {
|
|
997
992
|
intent: "inactive",
|
|
@@ -1006,10 +1001,9 @@ class List extends Component {
|
|
|
1006
1001
|
onSelectAll('SELECT_ALL_ON_PAGE');
|
|
1007
1002
|
}
|
|
1008
1003
|
},
|
|
1009
|
-
children: [/*#__PURE__*/_jsx(
|
|
1004
|
+
children: [/*#__PURE__*/_jsx(InternalTranslate, {
|
|
1010
1005
|
namespace: "List",
|
|
1011
1006
|
content: "selectAllItemsOnPage",
|
|
1012
|
-
fallback: "Select all items on the page",
|
|
1013
1007
|
translators: locale
|
|
1014
1008
|
}), /*#__PURE__*/_jsx(Label, {
|
|
1015
1009
|
intent: isAllSelected ? 'info' : 'inactive',
|
|
@@ -1020,10 +1014,9 @@ class List extends Component {
|
|
|
1020
1014
|
this.handleDeselectAll();
|
|
1021
1015
|
this.toggleSelectionMenu();
|
|
1022
1016
|
},
|
|
1023
|
-
children: /*#__PURE__*/_jsx(
|
|
1017
|
+
children: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
1024
1018
|
namespace: "List",
|
|
1025
1019
|
content: "deselectAll",
|
|
1026
|
-
fallback: "Deselect",
|
|
1027
1020
|
translators: locale
|
|
1028
1021
|
})
|
|
1029
1022
|
})]
|
|
@@ -1234,11 +1227,11 @@ class List extends Component {
|
|
|
1234
1227
|
if (!(data && data.length > 0) && (filtered || emptyViewMode === 'items')) {
|
|
1235
1228
|
content = this.renderEmptyView();
|
|
1236
1229
|
} else {
|
|
1237
|
-
const renderList =
|
|
1230
|
+
const renderList = _ref13 => {
|
|
1238
1231
|
let {
|
|
1239
1232
|
children,
|
|
1240
1233
|
props: reorderableProps
|
|
1241
|
-
} =
|
|
1234
|
+
} = _ref13;
|
|
1242
1235
|
return /*#__PURE__*/_jsx(FocusVisibleManager, {
|
|
1243
1236
|
children: /*#__PURE__*/_jsxs("table", {
|
|
1244
1237
|
className: classNames(`${baseClassName}__table`, {
|
|
@@ -1246,13 +1239,14 @@ class List extends Component {
|
|
|
1246
1239
|
[`${baseClassName}__table--vertical`]: vertical,
|
|
1247
1240
|
[`${baseClassName}__table--reorderable`]: reorderable
|
|
1248
1241
|
}),
|
|
1242
|
+
role: "list",
|
|
1249
1243
|
...reorderableProps,
|
|
1250
1244
|
children: [hasTitle && /*#__PURE__*/_jsx("thead", {
|
|
1251
1245
|
children: /*#__PURE__*/_jsx("tr", {
|
|
1252
1246
|
className: classNames(`${baseClassName}__table-thead`, {
|
|
1253
1247
|
[`${baseClassName}__row--expanded`]: this.isAnyRowsExpanded(data, this.state.expandedRows)
|
|
1254
1248
|
}),
|
|
1255
|
-
children: realColumn.map(
|
|
1249
|
+
children: realColumn.map(_ref14 => {
|
|
1256
1250
|
let {
|
|
1257
1251
|
key,
|
|
1258
1252
|
title,
|
|
@@ -1264,7 +1258,7 @@ class List extends Component {
|
|
|
1264
1258
|
type,
|
|
1265
1259
|
cellProps,
|
|
1266
1260
|
...headerProps
|
|
1267
|
-
} =
|
|
1261
|
+
} = _ref14;
|
|
1268
1262
|
if (sortable) {
|
|
1269
1263
|
title = /*#__PURE__*/_jsx("div", {
|
|
1270
1264
|
className: "th__action",
|
|
@@ -1295,7 +1289,7 @@ class List extends Component {
|
|
|
1295
1289
|
})
|
|
1296
1290
|
});
|
|
1297
1291
|
};
|
|
1298
|
-
const renderItem =
|
|
1292
|
+
const renderItem = _ref15 => {
|
|
1299
1293
|
let {
|
|
1300
1294
|
value: {
|
|
1301
1295
|
row
|
|
@@ -1303,7 +1297,7 @@ class List extends Component {
|
|
|
1303
1297
|
index,
|
|
1304
1298
|
props: reorderableProps,
|
|
1305
1299
|
isDragged
|
|
1306
|
-
} =
|
|
1300
|
+
} = _ref15;
|
|
1307
1301
|
return this.renderRow({
|
|
1308
1302
|
row,
|
|
1309
1303
|
index,
|
|
@@ -1318,22 +1312,22 @@ class List extends Component {
|
|
|
1318
1312
|
ReorderableList
|
|
1319
1313
|
} = this.state;
|
|
1320
1314
|
content = /*#__PURE__*/_jsx(ReorderableList, {
|
|
1321
|
-
beforeDrag:
|
|
1315
|
+
beforeDrag: _ref16 => {
|
|
1322
1316
|
let {
|
|
1323
1317
|
elements,
|
|
1324
1318
|
index
|
|
1325
|
-
} =
|
|
1319
|
+
} = _ref16;
|
|
1326
1320
|
const cells = Array.from(elements[index].firstElementChild.children);
|
|
1327
1321
|
const reorderableItemWidths = cells.map(cell => window.getComputedStyle(cell).width);
|
|
1328
1322
|
this.setState({
|
|
1329
1323
|
reorderableItemWidths
|
|
1330
1324
|
});
|
|
1331
1325
|
},
|
|
1332
|
-
onChange:
|
|
1326
|
+
onChange: _ref17 => {
|
|
1333
1327
|
let {
|
|
1334
1328
|
oldIndex,
|
|
1335
1329
|
newIndex
|
|
1336
|
-
} =
|
|
1330
|
+
} = _ref17;
|
|
1337
1331
|
safeInvoke(onReorderEnd, {
|
|
1338
1332
|
oldIndex,
|
|
1339
1333
|
newIndex
|
|
@@ -1400,10 +1394,10 @@ class List extends Component {
|
|
|
1400
1394
|
return /*#__PURE__*/_jsx(Measure, {
|
|
1401
1395
|
bounds: true,
|
|
1402
1396
|
onResize: this.handleResize,
|
|
1403
|
-
children:
|
|
1397
|
+
children: _ref18 => {
|
|
1404
1398
|
let {
|
|
1405
1399
|
measureRef
|
|
1406
|
-
} =
|
|
1400
|
+
} = _ref18;
|
|
1407
1401
|
return createRoot(measureRef);
|
|
1408
1402
|
}
|
|
1409
1403
|
});
|