@digigov/ui 0.13.0 → 0.13.1
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 +8 -1
- package/core/Accordion/index.d.ts +1 -4
- package/core/Accordion/index.js +5 -30
- package/es/core/Accordion/index.js +2 -19
- package/esm/core/Accordion/index.js +2 -19
- package/esm/index.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Change Log - @digigov/ui
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 03 Mar 2022 09:55:59 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.13.1
|
|
6
|
+
Thu, 03 Mar 2022 09:55:59 GMT
|
|
7
|
+
|
|
8
|
+
### Patches
|
|
9
|
+
|
|
10
|
+
- Fix useAccordion toggle functionality
|
|
4
11
|
|
|
5
12
|
## 0.13.0
|
|
6
13
|
Tue, 01 Mar 2022 10:56:06 GMT
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import Accordion from '@digigov/react-core/Accordion';
|
|
2
3
|
import AccordionSection from '@digigov/react-core/AccordionSection';
|
|
3
4
|
import AccordionSectionContent from '@digigov/react-core/AccordionSectionContent';
|
|
4
5
|
import AccordionSectionHeader from '@digigov/react-core/AccordionSectionHeader';
|
|
5
6
|
import AccordionControls from '@digigov/react-core/AccordionControls';
|
|
6
7
|
import { UseTogglableSectionsReturn } from '@digigov/ui/hooks/useTogglableSections';
|
|
7
|
-
import React from 'react';
|
|
8
8
|
export declare const AccordionItemDetails: React.ForwardRefExoticComponent<Pick<import("@digigov/react-core/AccordionSectionContent").AccordionSectionContentProps, "color" | "className" | "children" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "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" | "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"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export declare const AccordionItemSummary: React.ForwardRefExoticComponent<Pick<import("@digigov/react-core/AccordionSectionHeader").AccordionSectionHeaderProps, "color" | "className" | "children" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "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" | "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"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
export declare const AccordionItem: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<import("@digigov/react-core/AccordionSection").AccordionSectionProps, "color" | "className" | "children" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "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" | "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" | "open"> & React.RefAttributes<HTMLDivElement>>>;
|
|
@@ -12,9 +12,6 @@ export interface UseAccordionProps {
|
|
|
12
12
|
singleOpen?: boolean;
|
|
13
13
|
}
|
|
14
14
|
export interface UseAccordionReturn extends UseTogglableSectionsReturn {
|
|
15
|
-
isOpenAll: boolean;
|
|
16
|
-
openAll: () => void;
|
|
17
|
-
closeAll: () => void;
|
|
18
15
|
}
|
|
19
16
|
declare const useAccordion: (props: UseAccordionProps) => UseAccordionReturn;
|
|
20
17
|
export { Accordion, AccordionControls, AccordionSection, AccordionSectionContent, AccordionSectionHeader, useAccordion, };
|
package/core/Accordion/index.js
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -40,12 +38,12 @@ Object.defineProperty(exports, "AccordionSectionHeader", {
|
|
|
40
38
|
});
|
|
41
39
|
exports.useAccordion = exports["default"] = void 0;
|
|
42
40
|
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
var _extends3 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
41
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
46
42
|
|
|
47
43
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
48
44
|
|
|
45
|
+
var _react = _interopRequireDefault(require("react"));
|
|
46
|
+
|
|
49
47
|
var _Accordion = _interopRequireDefault(require("@digigov/react-core/Accordion"));
|
|
50
48
|
|
|
51
49
|
var _AccordionSection = _interopRequireDefault(require("@digigov/react-core/AccordionSection"));
|
|
@@ -60,14 +58,7 @@ var _withDeprecation = _interopRequireDefault(require("@digigov/ui/utils/withDep
|
|
|
60
58
|
|
|
61
59
|
var _useTogglableSections2 = require("@digigov/ui/hooks/useTogglableSections");
|
|
62
60
|
|
|
63
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
64
|
-
|
|
65
61
|
var _excluded = ["register", "setOpened", "opened", "registered"];
|
|
66
|
-
|
|
67
|
-
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); }
|
|
68
|
-
|
|
69
|
-
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; }
|
|
70
|
-
|
|
71
62
|
var AccordionItemDetails = (0, _withDeprecation["default"])(_AccordionSectionContent["default"], {
|
|
72
63
|
name: 'AccordionItemDetails',
|
|
73
64
|
rename: 'AccordionSectionContent'
|
|
@@ -89,7 +80,7 @@ exports.AccordionItem = AccordionItem;
|
|
|
89
80
|
var useAccordion = function useAccordion(props) {
|
|
90
81
|
var _useTogglableSections = (0, _useTogglableSections2.useTogglableSections)({
|
|
91
82
|
toggleProperty: 'open',
|
|
92
|
-
onToggleProperty: '
|
|
83
|
+
onToggleProperty: 'onToggle',
|
|
93
84
|
singleOpen: props && !!props.singleOpen
|
|
94
85
|
}),
|
|
95
86
|
register = _useTogglableSections.register,
|
|
@@ -98,24 +89,8 @@ var useAccordion = function useAccordion(props) {
|
|
|
98
89
|
registered = _useTogglableSections.registered,
|
|
99
90
|
rest = (0, _objectWithoutProperties2["default"])(_useTogglableSections, _excluded);
|
|
100
91
|
|
|
101
|
-
|
|
102
|
-
return Object.keys(registered.current);
|
|
103
|
-
}, [registered.current.length]);
|
|
104
|
-
var openAll = (0, _react.useCallback)(function () {
|
|
105
|
-
setOpened(keys.reduce(function (newOpened, key) {
|
|
106
|
-
return (0, _extends3["default"])({}, newOpened, (0, _defineProperty2["default"])({}, key, true));
|
|
107
|
-
}, {}));
|
|
108
|
-
}, [keys]);
|
|
109
|
-
var closeAll = (0, _react.useCallback)(function () {
|
|
110
|
-
return setOpened({});
|
|
111
|
-
}, []);
|
|
112
|
-
return (0, _extends3["default"])({
|
|
92
|
+
return (0, _extends2["default"])({
|
|
113
93
|
register: register,
|
|
114
|
-
openAll: openAll,
|
|
115
|
-
closeAll: closeAll,
|
|
116
|
-
isOpenAll: keys.length ? keys.every(function (v) {
|
|
117
|
-
return opened[v];
|
|
118
|
-
}) : false,
|
|
119
94
|
setOpened: setOpened,
|
|
120
95
|
opened: opened,
|
|
121
96
|
registered: registered
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
3
|
var _excluded = ["register", "setOpened", "opened", "registered"];
|
|
5
4
|
|
|
6
5
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
6
|
+
import React from 'react';
|
|
7
7
|
import Accordion from '@digigov/react-core/Accordion';
|
|
8
8
|
import AccordionSection from '@digigov/react-core/AccordionSection';
|
|
9
9
|
import AccordionSectionContent from '@digigov/react-core/AccordionSectionContent';
|
|
@@ -11,7 +11,6 @@ import AccordionSectionHeader from '@digigov/react-core/AccordionSectionHeader';
|
|
|
11
11
|
import AccordionControls from '@digigov/react-core/AccordionControls';
|
|
12
12
|
import withDeprecation from '@digigov/ui/utils/withDeprecation';
|
|
13
13
|
import { useTogglableSections } from '@digigov/ui/hooks/useTogglableSections';
|
|
14
|
-
import React, { useCallback, useMemo } from 'react';
|
|
15
14
|
export var AccordionItemDetails = withDeprecation(AccordionSectionContent, {
|
|
16
15
|
name: 'AccordionItemDetails',
|
|
17
16
|
rename: 'AccordionSectionContent'
|
|
@@ -30,7 +29,7 @@ export var AccordionItem = withDeprecation( /*#__PURE__*/React.memo(AccordionSec
|
|
|
30
29
|
var useAccordion = function useAccordion(props) {
|
|
31
30
|
var _useTogglableSections = useTogglableSections({
|
|
32
31
|
toggleProperty: 'open',
|
|
33
|
-
onToggleProperty: '
|
|
32
|
+
onToggleProperty: 'onToggle',
|
|
34
33
|
singleOpen: props && !!props.singleOpen
|
|
35
34
|
}),
|
|
36
35
|
register = _useTogglableSections.register,
|
|
@@ -39,24 +38,8 @@ var useAccordion = function useAccordion(props) {
|
|
|
39
38
|
registered = _useTogglableSections.registered,
|
|
40
39
|
rest = _objectWithoutProperties(_useTogglableSections, _excluded);
|
|
41
40
|
|
|
42
|
-
var keys = useMemo(function () {
|
|
43
|
-
return Object.keys(registered.current);
|
|
44
|
-
}, [registered.current.length]);
|
|
45
|
-
var openAll = useCallback(function () {
|
|
46
|
-
setOpened(keys.reduce(function (newOpened, key) {
|
|
47
|
-
return _extends({}, newOpened, _defineProperty({}, key, true));
|
|
48
|
-
}, {}));
|
|
49
|
-
}, [keys]);
|
|
50
|
-
var closeAll = useCallback(function () {
|
|
51
|
-
return setOpened({});
|
|
52
|
-
}, []);
|
|
53
41
|
return _extends({
|
|
54
42
|
register: register,
|
|
55
|
-
openAll: openAll,
|
|
56
|
-
closeAll: closeAll,
|
|
57
|
-
isOpenAll: keys.length ? keys.every(function (v) {
|
|
58
|
-
return opened[v];
|
|
59
|
-
}) : false,
|
|
60
43
|
setOpened: setOpened,
|
|
61
44
|
opened: opened,
|
|
62
45
|
registered: registered
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
3
|
var _excluded = ["register", "setOpened", "opened", "registered"];
|
|
5
4
|
|
|
6
5
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
6
|
+
import React from 'react';
|
|
7
7
|
import Accordion from '@digigov/react-core/Accordion';
|
|
8
8
|
import AccordionSection from '@digigov/react-core/AccordionSection';
|
|
9
9
|
import AccordionSectionContent from '@digigov/react-core/AccordionSectionContent';
|
|
@@ -11,7 +11,6 @@ import AccordionSectionHeader from '@digigov/react-core/AccordionSectionHeader';
|
|
|
11
11
|
import AccordionControls from '@digigov/react-core/AccordionControls';
|
|
12
12
|
import withDeprecation from '@digigov/ui/utils/withDeprecation';
|
|
13
13
|
import { useTogglableSections } from '@digigov/ui/hooks/useTogglableSections';
|
|
14
|
-
import React, { useCallback, useMemo } from 'react';
|
|
15
14
|
export var AccordionItemDetails = withDeprecation(AccordionSectionContent, {
|
|
16
15
|
name: 'AccordionItemDetails',
|
|
17
16
|
rename: 'AccordionSectionContent'
|
|
@@ -30,7 +29,7 @@ export var AccordionItem = withDeprecation( /*#__PURE__*/React.memo(AccordionSec
|
|
|
30
29
|
var useAccordion = function useAccordion(props) {
|
|
31
30
|
var _useTogglableSections = useTogglableSections({
|
|
32
31
|
toggleProperty: 'open',
|
|
33
|
-
onToggleProperty: '
|
|
32
|
+
onToggleProperty: 'onToggle',
|
|
34
33
|
singleOpen: props && !!props.singleOpen
|
|
35
34
|
}),
|
|
36
35
|
register = _useTogglableSections.register,
|
|
@@ -39,24 +38,8 @@ var useAccordion = function useAccordion(props) {
|
|
|
39
38
|
registered = _useTogglableSections.registered,
|
|
40
39
|
rest = _objectWithoutProperties(_useTogglableSections, _excluded);
|
|
41
40
|
|
|
42
|
-
var keys = useMemo(function () {
|
|
43
|
-
return Object.keys(registered.current);
|
|
44
|
-
}, [registered.current.length]);
|
|
45
|
-
var openAll = useCallback(function () {
|
|
46
|
-
setOpened(keys.reduce(function (newOpened, key) {
|
|
47
|
-
return _extends({}, newOpened, _defineProperty({}, key, true));
|
|
48
|
-
}, {}));
|
|
49
|
-
}, [keys]);
|
|
50
|
-
var closeAll = useCallback(function () {
|
|
51
|
-
return setOpened({});
|
|
52
|
-
}, []);
|
|
53
41
|
return _extends({
|
|
54
42
|
register: register,
|
|
55
|
-
openAll: openAll,
|
|
56
|
-
closeAll: closeAll,
|
|
57
|
-
isOpenAll: keys.length ? keys.every(function (v) {
|
|
58
|
-
return opened[v];
|
|
59
|
-
}) : false,
|
|
60
43
|
setOpened: setOpened,
|
|
61
44
|
opened: opened,
|
|
62
45
|
registered: registered
|
package/esm/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/ui",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "@digigov reusable components toolkit",
|
|
5
5
|
"module": "./esm/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"clsx": "1.1.1",
|
|
19
19
|
"react": "16.14.0",
|
|
20
20
|
"react-dom": "16.14.0",
|
|
21
|
-
"@digigov/react-core": "0.6.
|
|
21
|
+
"@digigov/react-core": "0.6.3"
|
|
22
22
|
},
|
|
23
23
|
"gitHead": "c903a46306f77f55ad7fc4d2e274006f39a6c871",
|
|
24
24
|
"private": false,
|