@digigov/ui 0.32.1 → 0.33.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/CHANGELOG.md +19 -1
- package/admin/AccessibilityMenu/index.d.ts +6 -0
- package/admin/AccessibilityMenu/index.js +85 -30
- package/admin/Drawer/__stories__/Default.js +3 -0
- package/admin/Dropdown/index.d.ts +1 -1
- package/admin/Dropdown/index.js +14 -3
- package/core/Accordion/index.d.ts +5 -1
- package/core/Accordion/index.js +46 -13
- package/core/CaretContainer/index.d.ts +3 -0
- package/core/CaretContainer/index.js +30 -0
- package/core/Table/Table.stories.d.ts +1 -0
- package/core/Table/Table.stories.js +14 -0
- package/core/Table/Table.stories.playwright.json +16 -0
- package/core/Table/__stories__/WithSortFilters.d.ts +2 -0
- package/core/Table/__stories__/WithSortFilters.js +141 -0
- package/core/Table/index.d.ts +22 -1
- package/core/Table/index.js +210 -24
- package/core/index.d.ts +1 -0
- package/core/index.js +13 -0
- package/es/admin/AccessibilityMenu/index.js +49 -0
- package/es/admin/Drawer/__stories__/Default.js +3 -0
- package/es/admin/Dropdown/index.js +14 -3
- package/es/core/Accordion/index.js +40 -6
- package/es/core/CaretContainer/index.js +3 -0
- package/es/core/Table/Table.stories.js +1 -0
- package/es/core/Table/Table.stories.playwright.json +16 -0
- package/es/core/Table/__stories__/WithSortFilters.js +126 -0
- package/es/core/Table/index.js +170 -1
- package/es/core/index.js +1 -0
- package/es/registry.js +2 -0
- package/esm/admin/AccessibilityMenu/index.js +49 -0
- package/esm/admin/Drawer/__stories__/Default.js +3 -0
- package/esm/admin/Dropdown/index.js +14 -3
- package/esm/core/Accordion/index.js +40 -6
- package/esm/core/CaretContainer/index.js +3 -0
- package/esm/core/Table/Table.stories.js +1 -0
- package/esm/core/Table/Table.stories.playwright.json +16 -0
- package/esm/core/Table/__stories__/WithSortFilters.js +126 -0
- package/esm/core/Table/index.js +170 -1
- package/esm/core/index.js +1 -0
- package/esm/index.js +1 -1
- package/esm/registry.js +2 -0
- package/package.json +3 -3
- package/registry.d.ts +1 -0
- package/registry.js +3 -0
- package/src/admin/AccessibilityMenu/index.tsx +52 -0
- package/src/admin/Drawer/__stories__/Default.tsx +3 -1
- package/src/admin/Dropdown/index.tsx +16 -7
- package/src/core/Accordion/index.tsx +38 -4
- package/src/core/CaretContainer/index.tsx +3 -0
- package/src/core/Table/Table.stories.js +1 -0
- package/src/core/Table/Table.stories.playwright.json +16 -0
- package/src/core/Table/__stories__/WithSortFilters.tsx +189 -0
- package/src/core/Table/index.tsx +195 -2
- package/src/core/index.ts +1 -0
- package/src/registry.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Change Log - @digigov/ui
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 19 May 2023 13:15:06 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.33.0
|
|
6
|
+
Fri, 19 May 2023 13:15:06 GMT
|
|
7
|
+
|
|
8
|
+
### Minor changes
|
|
9
|
+
|
|
10
|
+
- Implement TableHeadCellSort logic for table, fix close Dropdown by clicking escape
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Fix default Drawer
|
|
15
|
+
|
|
16
|
+
## 0.32.2
|
|
17
|
+
Tue, 16 May 2023 13:42:28 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- fix functionality for AccessibilityMenuOptionButton and AccordionSectionSummaryHeading components
|
|
4
22
|
|
|
5
23
|
## 0.32.1
|
|
6
24
|
Thu, 11 May 2023 10:48:56 GMT
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { AccessibilityMenuOptionButtonProps as AccessibilityMenuOptionButtonBaseProps } from '@digigov/react-extensions/admin/AccessibilityMenuOptionButton';
|
|
2
|
+
export interface AccessibilityMenuOptionButtonProps extends AccessibilityMenuOptionButtonBaseProps {
|
|
3
|
+
steps?: 0 | 1 | 2 | 3 | 4;
|
|
4
|
+
}
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export declare const AccessibilityMenuOptionButton: React.ForwardRefExoticComponent<Pick<AccessibilityMenuOptionButtonProps, "form" | "slot" | "style" | "title" | "as" | "className" | "color" | "id" | "lang" | "name" | "type" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "selected" | "margin" | "marginTop" | "marginBottom" | "marginLeft" | "marginRight" | "padding" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "printHidden" | "xsUpHidden" | "smUpHidden" | "mdUpHidden" | "lgUpHidden" | "xlUpHidden" | "xsHidden" | "smHidden" | "mdHidden" | "lgHidden" | "xlHidden" | "steps"> & React.RefAttributes<HTMLButtonElement>>;
|
|
1
7
|
export * from '@digigov/react-extensions/admin/AccessibilityMenu';
|
|
2
8
|
export * from '@digigov/react-extensions/admin/AccessibilityMenuButton';
|
|
3
9
|
export * from '@digigov/react-extensions/admin/AccessibilityMenuContent';
|
|
@@ -1,12 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
|
-
var _exportNames = {
|
|
9
|
-
|
|
10
|
+
var _exportNames = {
|
|
11
|
+
AccessibilityMenuOptionButton: true
|
|
12
|
+
};
|
|
13
|
+
exports["default"] = exports.AccessibilityMenuOptionButton = void 0;
|
|
14
|
+
|
|
15
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
|
+
|
|
17
|
+
var _AccessibilityMenuOptionButton = _interopRequireWildcard(require("@digigov/react-extensions/admin/AccessibilityMenuOptionButton"));
|
|
18
|
+
|
|
19
|
+
Object.keys(_AccessibilityMenuOptionButton).forEach(function (key) {
|
|
20
|
+
if (key === "default" || key === "__esModule") return;
|
|
21
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
22
|
+
if (key in exports && exports[key] === _AccessibilityMenuOptionButton[key]) return;
|
|
23
|
+
Object.defineProperty(exports, key, {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function get() {
|
|
26
|
+
return _AccessibilityMenuOptionButton[key];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
var _AccessibilityMenuSteps = _interopRequireWildcard(require("@digigov/react-extensions/admin/AccessibilityMenuSteps"));
|
|
32
|
+
|
|
33
|
+
Object.keys(_AccessibilityMenuSteps).forEach(function (key) {
|
|
34
|
+
if (key === "default" || key === "__esModule") return;
|
|
35
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
36
|
+
if (key in exports && exports[key] === _AccessibilityMenuSteps[key]) return;
|
|
37
|
+
Object.defineProperty(exports, key, {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function get() {
|
|
40
|
+
return _AccessibilityMenuSteps[key];
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
46
|
|
|
11
47
|
var _AccessibilityMenu = _interopRequireWildcard(require("@digigov/react-extensions/admin/AccessibilityMenu"));
|
|
12
48
|
|
|
@@ -106,34 +142,6 @@ Object.keys(_AccessibilityMenuListItem).forEach(function (key) {
|
|
|
106
142
|
});
|
|
107
143
|
});
|
|
108
144
|
|
|
109
|
-
var _AccessibilityMenuOptionButton = require("@digigov/react-extensions/admin/AccessibilityMenuOptionButton");
|
|
110
|
-
|
|
111
|
-
Object.keys(_AccessibilityMenuOptionButton).forEach(function (key) {
|
|
112
|
-
if (key === "default" || key === "__esModule") return;
|
|
113
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
114
|
-
if (key in exports && exports[key] === _AccessibilityMenuOptionButton[key]) return;
|
|
115
|
-
Object.defineProperty(exports, key, {
|
|
116
|
-
enumerable: true,
|
|
117
|
-
get: function get() {
|
|
118
|
-
return _AccessibilityMenuOptionButton[key];
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
var _AccessibilityMenuSteps = require("@digigov/react-extensions/admin/AccessibilityMenuSteps");
|
|
124
|
-
|
|
125
|
-
Object.keys(_AccessibilityMenuSteps).forEach(function (key) {
|
|
126
|
-
if (key === "default" || key === "__esModule") return;
|
|
127
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
128
|
-
if (key in exports && exports[key] === _AccessibilityMenuSteps[key]) return;
|
|
129
|
-
Object.defineProperty(exports, key, {
|
|
130
|
-
enumerable: true,
|
|
131
|
-
get: function get() {
|
|
132
|
-
return _AccessibilityMenuSteps[key];
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
|
|
137
145
|
var _AccessibilityIcon = require("@digigov/react-core/AccessibilityIcon");
|
|
138
146
|
|
|
139
147
|
Object.keys(_AccessibilityIcon).forEach(function (key) {
|
|
@@ -166,5 +174,52 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
166
174
|
|
|
167
175
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
168
176
|
|
|
177
|
+
var AccessibilityMenuOptionButton = /*#__PURE__*/_react["default"].forwardRef(function AccessibilityMenuOptionButton(_ref, ref) {
|
|
178
|
+
var _ref$steps = _ref.steps,
|
|
179
|
+
steps = _ref$steps === void 0 ? 0 : _ref$steps,
|
|
180
|
+
children = _ref.children;
|
|
181
|
+
|
|
182
|
+
var _useState = (0, _react.useState)(false),
|
|
183
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
184
|
+
selected = _useState2[0],
|
|
185
|
+
setSelected = _useState2[1];
|
|
186
|
+
|
|
187
|
+
var _useState3 = (0, _react.useState)(0),
|
|
188
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
189
|
+
activeStep = _useState4[0],
|
|
190
|
+
setActiveStep = _useState4[1];
|
|
191
|
+
|
|
192
|
+
var handleClick = function handleClick() {
|
|
193
|
+
if (!selected) {
|
|
194
|
+
setSelected(true);
|
|
195
|
+
|
|
196
|
+
if (steps > 0) {
|
|
197
|
+
setActiveStep(activeStep + 1);
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
if (steps > 0) {
|
|
201
|
+
if (steps > activeStep) {
|
|
202
|
+
setActiveStep(activeStep + 1);
|
|
203
|
+
} else {
|
|
204
|
+
setActiveStep(0);
|
|
205
|
+
setSelected(false);
|
|
206
|
+
}
|
|
207
|
+
} else {
|
|
208
|
+
setSelected(false);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
return /*#__PURE__*/_react["default"].createElement(_AccessibilityMenuOptionButton["default"], {
|
|
214
|
+
onClick: handleClick,
|
|
215
|
+
ref: ref,
|
|
216
|
+
selected: selected
|
|
217
|
+
}, children, /*#__PURE__*/_react["default"].createElement(_AccessibilityMenuSteps["default"], {
|
|
218
|
+
steps: steps,
|
|
219
|
+
activeStep: activeStep
|
|
220
|
+
}));
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
exports.AccessibilityMenuOptionButton = AccessibilityMenuOptionButton;
|
|
169
224
|
var _default = _AccessibilityMenu["default"];
|
|
170
225
|
exports["default"] = _default;
|
|
@@ -98,7 +98,9 @@ var Default = function Default() {
|
|
|
98
98
|
|
|
99
99
|
var layout = 'vertical';
|
|
100
100
|
var border = false;
|
|
101
|
+
var fixed = false;
|
|
101
102
|
return /*#__PURE__*/_react["default"].createElement(_Drawer.Drawer, {
|
|
103
|
+
upRelative: "m",
|
|
102
104
|
direction: "left",
|
|
103
105
|
open: open
|
|
104
106
|
}, /*#__PURE__*/_react["default"].createElement(_Drawer.DrawerHeading, {
|
|
@@ -109,6 +111,7 @@ var Default = function Default() {
|
|
|
109
111
|
layout: layout,
|
|
110
112
|
links: links,
|
|
111
113
|
border: border,
|
|
114
|
+
fixed: fixed,
|
|
112
115
|
"aria-label": "Nav list"
|
|
113
116
|
}, links.map(function (item, key) {
|
|
114
117
|
var _item$subMenu;
|
|
@@ -17,6 +17,6 @@ export interface DropdownProps extends DropdownBaseProps {
|
|
|
17
17
|
/**
|
|
18
18
|
* Dropdown component is used for showing more options with a button.
|
|
19
19
|
*/
|
|
20
|
-
export declare const Dropdown:
|
|
20
|
+
export declare const Dropdown: React.ForwardRefExoticComponent<Pick<DropdownProps, "slot" | "style" | "title" | "as" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "disabled" | "open" | "onToggle" | "align" | "margin" | "marginTop" | "marginBottom" | "marginLeft" | "marginRight" | "padding" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "printHidden" | "xsUpHidden" | "smUpHidden" | "mdUpHidden" | "lgUpHidden" | "xlUpHidden" | "xsHidden" | "smHidden" | "mdHidden" | "lgHidden" | "xlHidden" | "placement" | "closeBehaviour" | "float"> & React.RefAttributes<HTMLDetailsElement>>;
|
|
21
21
|
export { DropdownBase };
|
|
22
22
|
export default Dropdown;
|
package/admin/Dropdown/index.js
CHANGED
|
@@ -64,15 +64,22 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
64
64
|
/**
|
|
65
65
|
* Dropdown component is used for showing more options with a button.
|
|
66
66
|
*/
|
|
67
|
-
var Dropdown = function Dropdown(_ref) {
|
|
67
|
+
var Dropdown = /*#__PURE__*/_react["default"].forwardRef(function Dropdown(_ref, ref) {
|
|
68
68
|
var _ref$closeBehaviour = _ref.closeBehaviour,
|
|
69
69
|
closeBehaviour = _ref$closeBehaviour === void 0 ? 'clickOutside' : _ref$closeBehaviour,
|
|
70
70
|
_ref$float = _ref["float"],
|
|
71
71
|
_float = _ref$float === void 0 ? false : _ref$float,
|
|
72
72
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
73
73
|
|
|
74
|
-
var innerRef = (0, _react.useRef)();
|
|
74
|
+
var innerRef = ref || (0, _react.useRef)();
|
|
75
75
|
(0, _react.useEffect)(function () {
|
|
76
|
+
var keyDownHandler = function keyDownHandler(event) {
|
|
77
|
+
if (event.key === 'Escape') {
|
|
78
|
+
innerRef.current.open = false;
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
76
83
|
var handleClickOutside = function handleClickOutside(event) {
|
|
77
84
|
if (innerRef.current && !innerRef.current.contains(event.target)) {
|
|
78
85
|
innerRef.current.open = false;
|
|
@@ -83,6 +90,8 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
83
90
|
document.addEventListener('click', handleClickOutside, true);
|
|
84
91
|
}
|
|
85
92
|
|
|
93
|
+
document.addEventListener('keydown', keyDownHandler);
|
|
94
|
+
|
|
86
95
|
var toggleFloat = function toggleFloat() {
|
|
87
96
|
var _innerRef$current;
|
|
88
97
|
|
|
@@ -130,6 +139,8 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
130
139
|
if (_float) {
|
|
131
140
|
innerRef.current.removeEventListener('toggle', toggleFloat);
|
|
132
141
|
}
|
|
142
|
+
|
|
143
|
+
document.removeEventListener('keydown', keyDownHandler);
|
|
133
144
|
};
|
|
134
145
|
}, []); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
135
146
|
// @ts-ignore
|
|
@@ -137,7 +148,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
137
148
|
return /*#__PURE__*/_react["default"].createElement(_DropdownBase["default"], (0, _extends2["default"])({
|
|
138
149
|
ref: innerRef
|
|
139
150
|
}, props));
|
|
140
|
-
};
|
|
151
|
+
});
|
|
141
152
|
|
|
142
153
|
exports.Dropdown = Dropdown;
|
|
143
154
|
var _default = Dropdown;
|
|
@@ -2,11 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import Accordion from '@digigov/react-core/Accordion';
|
|
3
3
|
import AccordionSection from '@digigov/react-core/AccordionSection';
|
|
4
4
|
import AccordionSectionContent from '@digigov/react-core/AccordionSectionContent';
|
|
5
|
-
import
|
|
5
|
+
import { AccordionSectionSummaryHeadingProps as AccordionSectionSummaryHeadingBaseProps } from '@digigov/react-core/AccordionSectionSummaryHeading';
|
|
6
6
|
import AccordionSectionSummary from '@digigov/react-core/AccordionSectionSummary';
|
|
7
7
|
import AccordionControls from '@digigov/react-core/AccordionControls';
|
|
8
8
|
import { UseTogglableTabReturn } from '@digigov/ui/hooks/useTogglableTab';
|
|
9
9
|
export declare const AccordionItemDetails: React.ForwardRefExoticComponent<Pick<import("@digigov/react-core/AccordionSectionContent").AccordionSectionContentProps, "slot" | "style" | "title" | "as" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "margin" | "marginTop" | "marginBottom" | "marginLeft" | "marginRight" | "padding" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "printHidden" | "xsUpHidden" | "smUpHidden" | "mdUpHidden" | "lgUpHidden" | "xlUpHidden" | "xsHidden" | "smHidden" | "mdHidden" | "lgHidden" | "xlHidden"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export interface AccordionSectionSummaryHeadingProps extends AccordionSectionSummaryHeadingBaseProps {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare const AccordionSectionSummaryHeading: React.ForwardRefExoticComponent<Pick<AccordionSectionSummaryHeadingProps, "slot" | "style" | "title" | "as" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "margin" | "marginTop" | "marginBottom" | "marginLeft" | "marginRight" | "padding" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "printHidden" | "xsUpHidden" | "smUpHidden" | "mdUpHidden" | "lgUpHidden" | "xlUpHidden" | "xsHidden" | "smHidden" | "mdHidden" | "lgHidden" | "xlHidden"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
10
14
|
export declare const AccordionItemSummary: ({ children, ...props }: {
|
|
11
15
|
[x: string]: any;
|
|
12
16
|
children: any;
|
package/core/Accordion/index.js
CHANGED
|
@@ -11,11 +11,11 @@ var _exportNames = {
|
|
|
11
11
|
AccordionItemDetails: true,
|
|
12
12
|
AccordionItemSummary: true,
|
|
13
13
|
AccordionItem: true,
|
|
14
|
+
AccordionSectionSummaryHeading: true,
|
|
14
15
|
useAccordion: true,
|
|
15
16
|
Accordion: true,
|
|
16
17
|
AccordionSection: true,
|
|
17
18
|
AccordionSectionContent: true,
|
|
18
|
-
AccordionSectionSummaryHeading: true,
|
|
19
19
|
AccordionSectionSummary: true,
|
|
20
20
|
AccordionControls: true
|
|
21
21
|
};
|
|
@@ -50,19 +50,15 @@ Object.defineProperty(exports, "AccordionSectionSummary", {
|
|
|
50
50
|
return _AccordionSectionSummary["default"];
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
|
-
|
|
54
|
-
enumerable: true,
|
|
55
|
-
get: function get() {
|
|
56
|
-
return _AccordionSectionSummaryHeading["default"];
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
exports.useAccordion = exports["default"] = void 0;
|
|
53
|
+
exports.useAccordion = exports["default"] = exports.AccordionSectionSummaryHeading = void 0;
|
|
60
54
|
|
|
61
55
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
62
56
|
|
|
57
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
58
|
+
|
|
63
59
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
64
60
|
|
|
65
|
-
var _react =
|
|
61
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
66
62
|
|
|
67
63
|
var _Accordion = _interopRequireWildcard(require("@digigov/react-core/Accordion"));
|
|
68
64
|
|
|
@@ -166,7 +162,8 @@ Object.keys(_AccordionSectionHeader).forEach(function (key) {
|
|
|
166
162
|
});
|
|
167
163
|
});
|
|
168
164
|
var _excluded = ["children"],
|
|
169
|
-
_excluded2 = ["
|
|
165
|
+
_excluded2 = ["children"],
|
|
166
|
+
_excluded3 = ["register", "setOpened", "opened", "registered"];
|
|
170
167
|
|
|
171
168
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
172
169
|
|
|
@@ -177,10 +174,46 @@ var AccordionItemDetails = (0, _withDeprecation["default"])(_AccordionSectionCon
|
|
|
177
174
|
rename: 'AccordionSectionContent'
|
|
178
175
|
});
|
|
179
176
|
exports.AccordionItemDetails = AccordionItemDetails;
|
|
180
|
-
|
|
177
|
+
|
|
178
|
+
var AccordionSectionSummaryHeading = /*#__PURE__*/_react["default"].forwardRef(function AccordionSectionSummaryHeading(_ref, ref) {
|
|
181
179
|
var children = _ref.children,
|
|
182
180
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
183
|
-
|
|
181
|
+
|
|
182
|
+
var toggleExpanded = function toggleExpanded() {
|
|
183
|
+
setExpanded(!isExpanded);
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
var _useState = (0, _react.useState)(false),
|
|
187
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
188
|
+
isExpanded = _useState2[0],
|
|
189
|
+
setExpanded = _useState2[1];
|
|
190
|
+
|
|
191
|
+
return /*#__PURE__*/_react["default"].createElement(_AccordionSectionSummaryHeading["default"], (0, _extends2["default"])({
|
|
192
|
+
ref: ref
|
|
193
|
+
}, props, {
|
|
194
|
+
onClick: toggleExpanded,
|
|
195
|
+
"aria-expanded": isExpanded
|
|
196
|
+
}), children);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
exports.AccordionSectionSummaryHeading = AccordionSectionSummaryHeading;
|
|
200
|
+
var AccordionItemSummary = (0, _withDeprecation["default"])(function (_ref2) {
|
|
201
|
+
var children = _ref2.children,
|
|
202
|
+
props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded2);
|
|
203
|
+
|
|
204
|
+
var toggleExpanded = function toggleExpanded() {
|
|
205
|
+
setExpanded(!isExpanded);
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
var _useState3 = (0, _react.useState)(false),
|
|
209
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
210
|
+
isExpanded = _useState4[0],
|
|
211
|
+
setExpanded = _useState4[1];
|
|
212
|
+
|
|
213
|
+
return /*#__PURE__*/_react["default"].createElement(_AccordionSectionSummary["default"], props, /*#__PURE__*/_react["default"].createElement(_AccordionSectionSummaryHeading["default"], {
|
|
214
|
+
onClick: toggleExpanded,
|
|
215
|
+
"aria-expanded": isExpanded
|
|
216
|
+
}, children));
|
|
184
217
|
}, {
|
|
185
218
|
name: 'AccordionItemSummary',
|
|
186
219
|
warning: 'There is no need to use AccordionSectionHeader components anymore. It will be removed in a later version and impelented using AccordionSectionSummary and AccordionSectionSummaryHeading'
|
|
@@ -204,7 +237,7 @@ var useAccordion = function useAccordion(props) {
|
|
|
204
237
|
setOpened = _useTogglableTab.setOpened,
|
|
205
238
|
opened = _useTogglableTab.opened,
|
|
206
239
|
registered = _useTogglableTab.registered,
|
|
207
|
-
rest = (0, _objectWithoutProperties2["default"])(_useTogglableTab,
|
|
240
|
+
rest = (0, _objectWithoutProperties2["default"])(_useTogglableTab, _excluded3);
|
|
208
241
|
|
|
209
242
|
return (0, _extends2["default"])({
|
|
210
243
|
register: register,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
var _exportNames = {};
|
|
9
|
+
exports["default"] = void 0;
|
|
10
|
+
|
|
11
|
+
var _CaretContainer = _interopRequireWildcard(require("@digigov/react-core/CaretContainer"));
|
|
12
|
+
|
|
13
|
+
Object.keys(_CaretContainer).forEach(function (key) {
|
|
14
|
+
if (key === "default" || key === "__esModule") return;
|
|
15
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
16
|
+
if (key in exports && exports[key] === _CaretContainer[key]) return;
|
|
17
|
+
Object.defineProperty(exports, key, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function get() {
|
|
20
|
+
return _CaretContainer[key];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
26
|
+
|
|
27
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
|
+
|
|
29
|
+
var _default = _CaretContainer["default"];
|
|
30
|
+
exports["default"] = _default;
|
|
@@ -19,6 +19,7 @@ export * from "./__stories__/WithLoader";
|
|
|
19
19
|
export * from "./__stories__/DefinedWidth";
|
|
20
20
|
export * from "./__stories__/Densed";
|
|
21
21
|
export * from "./__stories__/MultipleProps";
|
|
22
|
+
export * from "./__stories__/WithSortFilters";
|
|
22
23
|
export * from "./__stories__/WithFloatingScroll";
|
|
23
24
|
export * from "./__stories__/Full";
|
|
24
25
|
import Table from "@digigov/ui/core/Table";
|
|
@@ -192,6 +192,20 @@ Object.keys(_MultipleProps).forEach(function (key) {
|
|
|
192
192
|
});
|
|
193
193
|
});
|
|
194
194
|
|
|
195
|
+
var _WithSortFilters = require("./__stories__/WithSortFilters");
|
|
196
|
+
|
|
197
|
+
Object.keys(_WithSortFilters).forEach(function (key) {
|
|
198
|
+
if (key === "default" || key === "__esModule") return;
|
|
199
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
200
|
+
if (key in exports && exports[key] === _WithSortFilters[key]) return;
|
|
201
|
+
Object.defineProperty(exports, key, {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
get: function get() {
|
|
204
|
+
return _WithSortFilters[key];
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
|
|
195
209
|
var _WithFloatingScroll = require("./__stories__/WithFloatingScroll");
|
|
196
210
|
|
|
197
211
|
Object.keys(_WithFloatingScroll).forEach(function (key) {
|
|
@@ -16,6 +16,22 @@
|
|
|
16
16
|
"title": "Toggle Loading"
|
|
17
17
|
}
|
|
18
18
|
]
|
|
19
|
+
},
|
|
20
|
+
"digigov-ui-core-table--with-sort-filters": {
|
|
21
|
+
"actionSets": [
|
|
22
|
+
{
|
|
23
|
+
"actions": [
|
|
24
|
+
{
|
|
25
|
+
"name": "click",
|
|
26
|
+
"args": {
|
|
27
|
+
"selector": "html>body>div:nth-child(5)>div>div>table>thead>tr>th:nth-child(2)>details>summary"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"id": "Gdm_Fpollj7d",
|
|
32
|
+
"title": "Table with filter action"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
19
35
|
}
|
|
20
36
|
}
|
|
21
37
|
}
|