@reykjavik/hanna-react 0.10.103 → 0.10.104
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/AccordionList.js +2 -2
- package/Alert.d.ts +2 -2
- package/Alert.js +1 -0
- package/AutosuggestSearch.d.ts +40 -0
- package/AutosuggestSearch.js +70 -0
- package/BasicTable.d.ts +24 -4
- package/BasicTable.js +20 -19
- package/BreadCrumbs.d.ts +2 -2
- package/CHANGELOG.md +34 -0
- package/ContactBubble.d.ts +4 -3
- package/ContactBubble.js +7 -4
- package/Datepicker.d.ts +8 -3
- package/Datepicker.js +36 -14
- package/FileInput.d.ts +2 -1
- package/FileInput.js +2 -2
- package/FormField.js +2 -2
- package/Gallery.d.ts +2 -1
- package/Gallery.js +5 -0
- package/Layout.d.ts +4 -3
- package/Layout.js +0 -3
- package/MainMenu/_PrimaryPanel.d.ts +3 -4
- package/MainMenu/_PrimaryPanel.js +1 -1
- package/MainMenu.d.ts +6 -4
- package/MainMenu.js +8 -16
- package/Multiselect.d.ts +2 -1
- package/Multiselect.js +4 -3
- package/NameCard.d.ts +2 -1
- package/NameCard.js +7 -0
- package/Pagination.d.ts +2 -2
- package/ReadSpeakerPlayer.js +13 -5
- package/SearchInput.d.ts +24 -2
- package/SearchInput.js +13 -3
- package/SearchResults.d.ts +2 -1
- package/SearchResults.js +10 -2
- package/ShareButtons.d.ts +3 -2
- package/SiteSearchAutocomplete.d.ts +11 -11
- package/SiteSearchAutocomplete.js +21 -7
- package/SiteSearchCurtain.js +2 -2
- package/SiteSearchInput.d.ts +19 -10
- package/SiteSearchInput.js +9 -6
- package/Tooltip.js +4 -3
- package/VerticalTabsTOC.js +2 -2
- package/_abstract/_ScrollWrapper.d.ts +10 -0
- package/_abstract/_ScrollWrapper.js +21 -0
- package/_abstract/_Table.d.ts +71 -0
- package/_abstract/_Table.js +55 -0
- package/_abstract/_TogglerGroup.js +2 -2
- package/_abstract/_TogglerInput.js +2 -2
- package/_mixed_export_resolution_/ReactDatepicker.d.ts +3 -0
- package/esm/AccordionList.js +1 -1
- package/esm/Alert.d.ts +2 -2
- package/esm/Alert.js +1 -0
- package/esm/AutosuggestSearch.d.ts +40 -0
- package/esm/AutosuggestSearch.js +66 -0
- package/esm/BasicTable.d.ts +24 -4
- package/esm/BasicTable.js +19 -18
- package/esm/BreadCrumbs.d.ts +2 -2
- package/esm/ContactBubble.d.ts +4 -3
- package/esm/ContactBubble.js +6 -3
- package/esm/Datepicker.d.ts +8 -3
- package/esm/Datepicker.js +35 -13
- package/esm/FileInput.d.ts +2 -1
- package/esm/FileInput.js +1 -1
- package/esm/FormField.js +1 -1
- package/esm/Gallery.d.ts +2 -1
- package/esm/Gallery.js +5 -0
- package/esm/Layout.d.ts +4 -3
- package/esm/Layout.js +0 -3
- package/esm/MainMenu/_PrimaryPanel.d.ts +3 -4
- package/esm/MainMenu/_PrimaryPanel.js +1 -1
- package/esm/MainMenu.d.ts +6 -4
- package/esm/MainMenu.js +8 -16
- package/esm/Multiselect.d.ts +2 -1
- package/esm/Multiselect.js +2 -1
- package/esm/NameCard.d.ts +2 -1
- package/esm/NameCard.js +7 -0
- package/esm/Pagination.d.ts +2 -2
- package/esm/ReadSpeakerPlayer.js +13 -5
- package/esm/SearchInput.d.ts +24 -2
- package/esm/SearchInput.js +13 -3
- package/esm/SearchResults.d.ts +2 -1
- package/esm/SearchResults.js +9 -1
- package/esm/ShareButtons.d.ts +3 -2
- package/esm/SiteSearchAutocomplete.d.ts +11 -11
- package/esm/SiteSearchAutocomplete.js +21 -7
- package/esm/SiteSearchCurtain.js +1 -1
- package/esm/SiteSearchInput.d.ts +19 -10
- package/esm/SiteSearchInput.js +8 -6
- package/esm/Tooltip.js +2 -1
- package/esm/VerticalTabsTOC.js +1 -1
- package/esm/_abstract/_ScrollWrapper.d.ts +10 -0
- package/esm/_abstract/_ScrollWrapper.js +16 -0
- package/esm/_abstract/_Table.d.ts +71 -0
- package/esm/_abstract/_Table.js +51 -0
- package/esm/_abstract/_TogglerGroup.js +1 -1
- package/esm/_abstract/_TogglerInput.js +1 -1
- package/esm/_mixed_export_resolution_/ReactDatepicker.d.ts +3 -0
- package/esm/index.d.ts +1 -0
- package/esm/utils/browserSide.d.ts +119 -1
- package/esm/utils/browserSide.js +152 -1
- package/esm/utils/config.d.ts +1 -14
- package/esm/utils/config.js +0 -2
- package/esm/utils/useCallbackOnEsc.d.ts +6 -0
- package/esm/utils/useCallbackOnEsc.js +25 -0
- package/esm/utils/useDomid.d.ts +8 -0
- package/esm/utils/useDomid.js +17 -0
- package/esm/utils/useLaggedState.d.ts +18 -0
- package/esm/utils/useLaggedState.js +84 -0
- package/esm/utils/useOnClickOutside.d.ts +9 -0
- package/esm/utils/useOnClickOutside.js +32 -0
- package/esm/utils/useScrollEdgeDetect.d.ts +15 -0
- package/esm/utils/useScrollEdgeDetect.js +45 -0
- package/esm/utils/useShortState.d.ts +2 -0
- package/esm/utils/useShortState.js +34 -0
- package/esm/utils.d.ts +1 -0
- package/esm/utils.js +1 -0
- package/index.d.ts +1 -0
- package/package.json +6 -2
- package/utils/browserSide.d.ts +119 -1
- package/utils/browserSide.js +156 -4
- package/utils/config.d.ts +1 -14
- package/utils/config.js +1 -4
- package/utils/useCallbackOnEsc.d.ts +6 -0
- package/utils/useCallbackOnEsc.js +29 -0
- package/utils/useDomid.d.ts +8 -0
- package/utils/useDomid.js +21 -0
- package/utils/useLaggedState.d.ts +18 -0
- package/utils/useLaggedState.js +88 -0
- package/utils/useOnClickOutside.d.ts +9 -0
- package/utils/useOnClickOutside.js +35 -0
- package/utils/useScrollEdgeDetect.d.ts +15 -0
- package/utils/useScrollEdgeDetect.js +50 -0
- package/utils/useShortState.d.ts +2 -0
- package/utils/useShortState.js +38 -0
- package/utils.d.ts +1 -0
- package/utils.js +1 -0
package/SiteSearchInput.js
CHANGED
|
@@ -5,9 +5,9 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const FormField_js_1 = tslib_1.__importStar(require("./FormField.js"));
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
|
-
|
|
8
|
+
const SiteSearchInput = (props) => {
|
|
9
9
|
var _a;
|
|
10
|
-
const _b = (0, FormField_js_1.groupFormFieldWrapperProps)(props), { onChange, buttonText = 'Leita', onSubmit, onButtonClick = props.onSubmit, onKeyDown, placeholder = typeof props.label === 'string' ? props.label : undefined, fieldWrapperProps } = _b, inputElementProps = tslib_1.__rest(_b, ["onChange", "buttonText", "onSubmit", "onButtonClick", "onKeyDown", "placeholder", "fieldWrapperProps"]);
|
|
10
|
+
const _b = (0, FormField_js_1.groupFormFieldWrapperProps)(props), { onChange, buttonText = 'Leita', onSubmit, onButtonClick = props.onSubmit, button, onKeyDown, placeholder = typeof props.label === 'string' ? props.label : undefined, fieldWrapperProps } = _b, inputElementProps = tslib_1.__rest(_b, ["onChange", "buttonText", "onSubmit", "onButtonClick", "button", "onKeyDown", "placeholder", "fieldWrapperProps"]);
|
|
11
11
|
const { value, defaultValue } = inputElementProps;
|
|
12
12
|
const [hasValue, setHasValue] = (0, react_1.useState)(undefined);
|
|
13
13
|
const filled = !!((_a = value !== null && value !== void 0 ? value : hasValue) !== null && _a !== void 0 ? _a : !!defaultValue);
|
|
@@ -18,16 +18,19 @@ exports.SiteSearchInput = react_1.default.forwardRef((props, ref) => {
|
|
|
18
18
|
setHasValue(!!e.target.value);
|
|
19
19
|
onChange && onChange(e);
|
|
20
20
|
};
|
|
21
|
+
const showButton = button !== false;
|
|
21
22
|
return (react_1.default.createElement(FormField_js_1.default, Object.assign({ extraClassName: "SiteSearchInput", empty: empty, filled: filled }, fieldWrapperProps, { renderInput: (className, inputProps, addFocusProps) => (react_1.default.createElement("div", Object.assign({ className: className.input }, addFocusProps()),
|
|
22
23
|
react_1.default.createElement("input", Object.assign({ className: "SiteSearchInput__input", onChange: _onChange }, inputProps, { placeholder: placeholder, onKeyDown: onSubmit
|
|
23
24
|
? (e) => {
|
|
24
|
-
if (e.key === 'Enter' && onSubmit() !== true) {
|
|
25
|
+
if (e.key === 'Enter' && onSubmit(e.currentTarget.value) !== true) {
|
|
25
26
|
e.preventDefault();
|
|
26
27
|
}
|
|
27
28
|
onKeyDown && onKeyDown(e);
|
|
28
29
|
}
|
|
29
|
-
: onKeyDown }, inputElementProps
|
|
30
|
+
: onKeyDown }, inputElementProps)),
|
|
30
31
|
' ',
|
|
31
|
-
react_1.default.createElement("button", { className: "SiteSearchInput__button", type: "submit", onClick: onButtonClick &&
|
|
32
|
-
});
|
|
32
|
+
showButton && (react_1.default.createElement("button", { className: "SiteSearchInput__button", type: "submit", onClick: onButtonClick &&
|
|
33
|
+
((e) => onButtonClick(e.currentTarget.value) !== true && e.preventDefault()), title: buttonText }, buttonText)))) })));
|
|
34
|
+
};
|
|
35
|
+
exports.SiteSearchInput = SiteSearchInput;
|
|
33
36
|
exports.default = exports.SiteSearchInput;
|
package/Tooltip.js
CHANGED
|
@@ -5,12 +5,13 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_2 = require("@floating-ui/react");
|
|
7
7
|
const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
8
|
-
const
|
|
8
|
+
const useCallbackOnEsc_js_1 = require("./utils/useCallbackOnEsc.js");
|
|
9
|
+
const useLaggedState_js_1 = require("./utils/useLaggedState.js");
|
|
9
10
|
const getSide = (placement) => placement.split('-')[0];
|
|
10
11
|
const Tooltip = (props) => {
|
|
11
12
|
const { text, label, iconOnly, wrapperProps = {} } = props;
|
|
12
13
|
const arrowRef = (0, react_1.useRef)(null);
|
|
13
|
-
const [isOpen, setIsOpen] = (0,
|
|
14
|
+
const [isOpen, setIsOpen] = (0, useLaggedState_js_1.useLaggedState)(false, 300);
|
|
14
15
|
const { x, y, refs, middlewareData, placement } = (0, react_2.useFloating)({
|
|
15
16
|
placement: 'top',
|
|
16
17
|
middleware: [(0, react_2.offset)(10), (0, react_2.flip)(), (0, react_2.shift)(), (0, react_2.arrow)({ element: arrowRef })],
|
|
@@ -19,7 +20,7 @@ const Tooltip = (props) => {
|
|
|
19
20
|
const { arrow } = middlewareData;
|
|
20
21
|
const arrowX = arrow === null || arrow === void 0 ? void 0 : arrow.x;
|
|
21
22
|
const arrowY = arrow === null || arrow === void 0 ? void 0 : arrow.y;
|
|
22
|
-
(0,
|
|
23
|
+
(0, useCallbackOnEsc_js_1.useCallbackOnEsc)(() => {
|
|
23
24
|
setIsOpen(false);
|
|
24
25
|
});
|
|
25
26
|
return (react_1.default.createElement("details", Object.assign({}, props.wrapperProps, { className: (0, classUtils_1.modifiedClass)('Tooltip', getSide(placement), wrapperProps.className), open: isOpen, onMouseEnter: (e) => {
|
package/VerticalTabsTOC.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.VerticalTabsTOC = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const frag_1 = require("@hugsmidjan/qj/frag");
|
|
7
|
-
const
|
|
7
|
+
const useDomid_js_1 = require("./utils/useDomid.js");
|
|
8
8
|
const Tabs_js_1 = tslib_1.__importDefault(require("./Tabs.js"));
|
|
9
9
|
const getId = (url) => (url && decodeURIComponent(url.split('#')[1] || '')) || '';
|
|
10
10
|
const getItemId = (item) => getId(item && item.href);
|
|
@@ -43,7 +43,7 @@ const mapToItemsById = (items, domid) => {
|
|
|
43
43
|
};
|
|
44
44
|
const VerticalTabsTOC = (props) => {
|
|
45
45
|
const { onItemSelect, items } = props;
|
|
46
|
-
const _domid = (0,
|
|
46
|
+
const _domid = (0, useDomid_js_1.useDomid)();
|
|
47
47
|
const domid = props.id || _domid;
|
|
48
48
|
const { itemsById, updatedItems } = (0, react_1.useMemo)(() => mapToItemsById(items, domid), [items, domid]);
|
|
49
49
|
const [state, setState] = (0, react_1.useState)(() => {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WrapperElmProps } from '../utils.js';
|
|
3
|
+
import { BemProps } from '../utils/types.js';
|
|
4
|
+
type ScrollWrapperProps = {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
} & BemProps & WrapperElmProps;
|
|
7
|
+
export declare const ScrollWrapper: (props: ScrollWrapperProps & {
|
|
8
|
+
innerWrap?: true;
|
|
9
|
+
}) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScrollWrapper = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
7
|
+
const utils_js_1 = require("../utils.js");
|
|
8
|
+
const useScrollEdgeDetect_js_1 = require("../utils/useScrollEdgeDetect.js");
|
|
9
|
+
const scrollOptions = {
|
|
10
|
+
axis: 'horizontal',
|
|
11
|
+
};
|
|
12
|
+
const ScrollWrapper = (props) => {
|
|
13
|
+
const { innerWrap, children, modifier, bem = 'ScrollWrapper', wrapperProps = {}, } = props;
|
|
14
|
+
const isBrowser = (0, utils_js_1.useIsBrowserSide)();
|
|
15
|
+
const [scrollerRef, scrollAt] = (0, useScrollEdgeDetect_js_1.useScrollEdgeDetect)(scrollOptions, wrapperProps.ref);
|
|
16
|
+
const modifiers = isBrowser
|
|
17
|
+
? [modifier, 'at', scrollAt.start && 'at--start', scrollAt.end && 'at--end']
|
|
18
|
+
: modifier;
|
|
19
|
+
return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)(bem, modifiers, wrapperProps.className), ref: !innerWrap ? scrollerRef : undefined }), isBrowser && innerWrap ? (react_1.default.createElement("div", { className: `${bem}__scroller`, ref: scrollerRef }, children)) : (children)));
|
|
20
|
+
};
|
|
21
|
+
exports.ScrollWrapper = ScrollWrapper;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { HTMLProps, WrapperElmProps } from '../utils.js';
|
|
3
|
+
type SectionTag = 'thead' | 'tfoot' | 'tbody';
|
|
4
|
+
type RowPropsFunction = (rowIdx: number, section: SectionTag) => HTMLProps<'tr'> | undefined;
|
|
5
|
+
export type TableCellMeta = {
|
|
6
|
+
className?: string;
|
|
7
|
+
number?: false;
|
|
8
|
+
tel?: false;
|
|
9
|
+
text?: false;
|
|
10
|
+
} | {
|
|
11
|
+
className?: string;
|
|
12
|
+
number: true | 'pos' | 'neg';
|
|
13
|
+
tel?: false;
|
|
14
|
+
text?: false;
|
|
15
|
+
} | {
|
|
16
|
+
className?: string;
|
|
17
|
+
tel: true;
|
|
18
|
+
number?: false;
|
|
19
|
+
text?: false;
|
|
20
|
+
} | {
|
|
21
|
+
className?: string;
|
|
22
|
+
text: true | 'right' | 'center';
|
|
23
|
+
number?: false;
|
|
24
|
+
tel?: false;
|
|
25
|
+
};
|
|
26
|
+
export type TableCellData = {
|
|
27
|
+
value: ReactNode | ((rowIdx: number) => ReactNode);
|
|
28
|
+
colSpan?: number;
|
|
29
|
+
key?: string | number;
|
|
30
|
+
} & TableCellMeta;
|
|
31
|
+
type RowData = {
|
|
32
|
+
cells: Array<TableCellData>;
|
|
33
|
+
key: string | number | undefined;
|
|
34
|
+
};
|
|
35
|
+
export type TableCols = Array<TableCellMeta | null>;
|
|
36
|
+
export type TableCell = string | TableCellData;
|
|
37
|
+
export type TableRow = Array<TableCell> | {
|
|
38
|
+
cells: Array<TableCell>;
|
|
39
|
+
/** Manual `key` prop for stable re-renders */
|
|
40
|
+
key?: string | number;
|
|
41
|
+
};
|
|
42
|
+
type TableSection = Array<TableRow>;
|
|
43
|
+
export type TableBody = TableSection;
|
|
44
|
+
export type TableHead = TableSection;
|
|
45
|
+
export type TableFoot = TableSection;
|
|
46
|
+
export type TableData = {
|
|
47
|
+
caption?: ReactNode;
|
|
48
|
+
thead: TableHead;
|
|
49
|
+
tfoot?: TableFoot;
|
|
50
|
+
} & ({
|
|
51
|
+
tbody: TableBody;
|
|
52
|
+
tbodies?: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
tbody?: undefined;
|
|
55
|
+
tbodies: Array<TableBody>;
|
|
56
|
+
});
|
|
57
|
+
type TableSectionProps = {
|
|
58
|
+
section: Array<RowData>;
|
|
59
|
+
cols?: TableCols;
|
|
60
|
+
Tag: SectionTag;
|
|
61
|
+
getRowProps: RowPropsFunction;
|
|
62
|
+
};
|
|
63
|
+
declare const TableSection: ({ section, cols, Tag, getRowProps }: TableSectionProps) => JSX.Element | null;
|
|
64
|
+
export type TableProps = TableData & {
|
|
65
|
+
cols?: TableCols;
|
|
66
|
+
rowProps?: HTMLProps<'tr'> | RowPropsFunction;
|
|
67
|
+
} & WrapperElmProps<'table'>;
|
|
68
|
+
export declare const Table: React.MemoExoticComponent<(props: TableProps & {
|
|
69
|
+
className?: string;
|
|
70
|
+
}) => JSX.Element>;
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Table = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
7
|
+
const hanna_utils_1 = require("@reykjavik/hanna-utils");
|
|
8
|
+
const TableCell = (props) => {
|
|
9
|
+
const { data, meta = {}, rowIdx, rowScope } = props;
|
|
10
|
+
const Tag = props.th ? 'th' : 'td';
|
|
11
|
+
const { className = meta.className || '', number = meta.number, text = meta.text, tel = meta.tel, value, colSpan, } = data;
|
|
12
|
+
const numberClass = !number
|
|
13
|
+
? ''
|
|
14
|
+
: number === true
|
|
15
|
+
? 'Cell--number'
|
|
16
|
+
: 'Cell--number Cell--number--' + number;
|
|
17
|
+
const textClass = !text
|
|
18
|
+
? ''
|
|
19
|
+
: text === true
|
|
20
|
+
? 'Cell--text'
|
|
21
|
+
: 'Cell--text Cell--text--' + text;
|
|
22
|
+
const telClass = tel ? 'Cell--tel' : '';
|
|
23
|
+
return (react_1.default.createElement(Tag, { className: (0, classUtils_1.classes)(numberClass || telClass || textClass, className), colSpan: colSpan && colSpan > 1 ? colSpan : undefined, scope: rowScope ? 'row' : undefined }, typeof value === 'function' ? value(rowIdx) : value));
|
|
24
|
+
};
|
|
25
|
+
const TableSection = ({ section, cols = [], Tag, getRowProps }) => section.length ? (react_1.default.createElement(Tag, null, section.map(({ key, cells }, rowIdx) => {
|
|
26
|
+
let colIdx = 0;
|
|
27
|
+
return (react_1.default.createElement("tr", Object.assign({}, getRowProps(rowIdx, Tag), { key: key != null ? key : rowIdx }), cells.map((cell, i) => {
|
|
28
|
+
const rowScope = i === 0;
|
|
29
|
+
const meta = cols[colIdx];
|
|
30
|
+
colIdx += cell.colSpan || 1;
|
|
31
|
+
return (react_1.default.createElement(TableCell, { key: cell.key || i, th: Tag === 'thead' || rowScope, data: cell, meta: meta || undefined, rowIdx: rowIdx, rowScope: rowScope }));
|
|
32
|
+
})));
|
|
33
|
+
}))) : null;
|
|
34
|
+
// ===========================================================================
|
|
35
|
+
const normalizeTableSectData = (rows) => !rows.length
|
|
36
|
+
? undefined
|
|
37
|
+
: rows.map((row) => {
|
|
38
|
+
const cells = 'cells' in row ? row.cells : row;
|
|
39
|
+
return {
|
|
40
|
+
cells: cells.map((data) => (typeof data === 'string' ? { value: data } : data)),
|
|
41
|
+
key: 'key' in row ? row.key : undefined,
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
exports.Table = (0, react_1.memo)((props) => {
|
|
45
|
+
const { caption, cols, className, rowProps, wrapperProps } = props;
|
|
46
|
+
const getRowProps = typeof rowProps === 'function' ? rowProps : () => rowProps;
|
|
47
|
+
const thead = (0, react_1.useMemo)(() => normalizeTableSectData(props.thead), [props.thead]);
|
|
48
|
+
const tfoot = (0, react_1.useMemo)(() => props.tfoot && normalizeTableSectData(props.tfoot), [props.tfoot]);
|
|
49
|
+
const tbodies = (0, react_1.useMemo)(() => (props.tbodies || [props.tbody]).map(normalizeTableSectData).filter(hanna_utils_1.notNully), [props.tbody, props.tbodies]);
|
|
50
|
+
return (react_1.default.createElement("table", Object.assign({}, wrapperProps, { className: (0, classUtils_1.classes)(className, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.className) }),
|
|
51
|
+
caption && react_1.default.createElement("caption", null, caption),
|
|
52
|
+
thead && (react_1.default.createElement(TableSection, { section: thead, cols: cols, Tag: "thead", getRowProps: getRowProps })),
|
|
53
|
+
tfoot && (react_1.default.createElement(TableSection, { section: tfoot, cols: cols, Tag: "tfoot", getRowProps: getRowProps })),
|
|
54
|
+
tbodies.map((section, i) => (react_1.default.createElement(TableSection, { key: i, section: section, cols: cols, Tag: "tbody", getRowProps: getRowProps })))));
|
|
55
|
+
});
|
|
@@ -4,14 +4,14 @@ exports.TogglerGroup = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
7
|
-
const hooks_1 = require("@hugsmidjan/react/hooks");
|
|
8
7
|
const utils_js_1 = require("../utils.js");
|
|
8
|
+
const useDomid_js_1 = require("../utils/useDomid.js");
|
|
9
9
|
const TogglerGroup = (props) => {
|
|
10
10
|
const {
|
|
11
11
|
// id,
|
|
12
12
|
className, bem, disabled, readOnly, Toggler, onSelected, isRadio, inputProps = {}, } = props;
|
|
13
13
|
const [values, setValues] = (0, utils_js_1.useMixedControlState)(props, 'value', []);
|
|
14
|
-
const name = (0,
|
|
14
|
+
const name = (0, useDomid_js_1.useDomid)(props.name);
|
|
15
15
|
const options = (0, react_1.useMemo)(() => {
|
|
16
16
|
const _options = props.options;
|
|
17
17
|
return typeof _options[0] === 'string'
|
|
@@ -4,10 +4,10 @@ exports.TogglerInput = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
7
|
-
const
|
|
7
|
+
const useDomid_js_1 = require("../utils/useDomid.js");
|
|
8
8
|
const TogglerInput = (props) => {
|
|
9
9
|
const { bem, modifier, className, label, invalid, errorMessage, Wrapper = 'div', required, reqText, type, id, innerWrap, wrapperProps, inputProps } = props, restInputProps = tslib_1.__rest(props, ["bem", "modifier", "className", "label", "invalid", "errorMessage", "Wrapper", "required", "reqText", "type", "id", "innerWrap", "wrapperProps", "inputProps"]);
|
|
10
|
-
const domid = (0,
|
|
10
|
+
const domid = (0, useDomid_js_1.useDomid)(id);
|
|
11
11
|
const errorId = errorMessage && 'error' + domid;
|
|
12
12
|
const reqStar = required && reqText !== false && (react_1.default.createElement("abbr", { className: bem + '__label__reqstar',
|
|
13
13
|
// FIXME: add mo-better i18n thinking
|
|
@@ -4,3 +4,6 @@ export declare const registerLocale: typeof reactDropzonePkg.registerLocale;
|
|
|
4
4
|
export declare const setDefaultLocale: typeof reactDropzonePkg.setDefaultLocale;
|
|
5
5
|
export declare const getDefaultLocale: typeof reactDropzonePkg.getDefaultLocale;
|
|
6
6
|
export declare const CalendarContainer: typeof reactDropzonePkg.CalendarContainer;
|
|
7
|
+
export type CalendarContainerProps = reactDropzonePkg.CalendarContainerProps;
|
|
8
|
+
export type ReactDatePickerCustomHeaderProps = reactDropzonePkg.ReactDatePickerCustomHeaderProps;
|
|
9
|
+
export type ReactDatePickerProps = reactDropzonePkg.ReactDatePickerProps;
|
package/esm/AccordionList.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
2
|
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
3
|
-
import { useDomid } from '
|
|
3
|
+
import { useDomid } from './utils/useDomid.js';
|
|
4
4
|
import { useIsBrowserSide, useMixedControlState, } from './utils.js';
|
|
5
5
|
const AccordionListItem = (props) => {
|
|
6
6
|
const { title, content, id, disabled = false, ssr, open, onToggle } = props;
|
package/esm/Alert.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
3
|
-
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
3
|
+
import { DefaultTexts, HannaLang } from '@reykjavik/hanna-utils/i18n';
|
|
4
4
|
import { SSRSupportProps, WrapperElmProps } from './utils.js';
|
|
5
5
|
export type AlertI18n = {
|
|
6
6
|
closeLabel: string;
|
|
@@ -23,7 +23,7 @@ export type AlertProps = {
|
|
|
23
23
|
/** server-side anchor href */
|
|
24
24
|
closeUrl?: string;
|
|
25
25
|
texts?: AlertI18n;
|
|
26
|
-
lang?:
|
|
26
|
+
lang?: HannaLang;
|
|
27
27
|
} & SSRSupportProps & EitherObj<{
|
|
28
28
|
/** Seconds until the Alert auto-closes.
|
|
29
29
|
*
|
package/esm/Alert.js
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { RenderInputComponentProps } from 'react-autosuggest';
|
|
2
|
+
import { DefaultTexts, HannaLang } from '@reykjavik/hanna-utils/i18n';
|
|
3
|
+
import { SearchInputProps } from './SearchInput.js';
|
|
4
|
+
import { SiteSearchInputProps } from './SiteSearchInput.js';
|
|
5
|
+
import { WrapperElmProps } from './utils.js';
|
|
6
|
+
export type AutosuggestSearchI18n = {
|
|
7
|
+
/** Label for the autocomplete's combobox container div */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Label for the text input */
|
|
10
|
+
inputLabel: string;
|
|
11
|
+
/** Label for the search button */
|
|
12
|
+
buttonText: string;
|
|
13
|
+
/** Placeholder text for the text input */
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
/** Label for the suggestions item list container */
|
|
16
|
+
suggestionsLabel: string;
|
|
17
|
+
/** @deprecated Not used (Will be removed in v0.11) */
|
|
18
|
+
lang?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const defaultAutosuggestSearchTexts: DefaultTexts<AutosuggestSearchI18n>;
|
|
21
|
+
export type AutosuggestSearchProps<T extends string | object> = {
|
|
22
|
+
options: Array<T>;
|
|
23
|
+
onInput: (value: string) => void;
|
|
24
|
+
onSelected: (payload: {
|
|
25
|
+
value: string;
|
|
26
|
+
option: T;
|
|
27
|
+
}) => void;
|
|
28
|
+
onClearOptions: () => void;
|
|
29
|
+
getOptionValue?: (option: T) => string;
|
|
30
|
+
renderSuggestion?: (option: T, context: {
|
|
31
|
+
query: string;
|
|
32
|
+
isHighlighted: boolean;
|
|
33
|
+
}) => JSX.Element | string;
|
|
34
|
+
itemActionIcon?: 'search' | 'go';
|
|
35
|
+
InputComponent?: (props: SiteSearchInputProps & SearchInputProps) => JSX.Element;
|
|
36
|
+
renderInputField?: (inputProps: RenderInputComponentProps, texts: AutosuggestSearchI18n) => JSX.Element;
|
|
37
|
+
texts?: AutosuggestSearchI18n;
|
|
38
|
+
lang?: HannaLang;
|
|
39
|
+
} & Pick<SearchInputProps, 'onSubmit' | 'onButtonClick' | 'button'> & WrapperElmProps;
|
|
40
|
+
export declare const AutosuggestSearch: <T extends string | object>(props: AutosuggestSearchProps<T>) => JSX.Element;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React, { createRef, useState } from 'react';
|
|
3
|
+
import Autosuggest from 'react-autosuggest';
|
|
4
|
+
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
5
|
+
import { getTexts } from '@reykjavik/hanna-utils/i18n';
|
|
6
|
+
import SearchInput from './SearchInput.js';
|
|
7
|
+
export const defaultAutosuggestSearchTexts = {
|
|
8
|
+
is: {
|
|
9
|
+
label: 'Leit á vefnum',
|
|
10
|
+
inputLabel: 'Leitarorð',
|
|
11
|
+
buttonText: 'Leita',
|
|
12
|
+
placeholder: 'Sláðu inn leitarorð',
|
|
13
|
+
suggestionsLabel: 'Tillögur',
|
|
14
|
+
},
|
|
15
|
+
en: {
|
|
16
|
+
label: 'Site search',
|
|
17
|
+
inputLabel: 'Search terms',
|
|
18
|
+
buttonText: 'Search',
|
|
19
|
+
placeholder: 'Enter search terms',
|
|
20
|
+
suggestionsLabel: 'Suggestions',
|
|
21
|
+
},
|
|
22
|
+
pl: {
|
|
23
|
+
label: 'Wyszukiwanie na stronie',
|
|
24
|
+
inputLabel: 'Wyszukaj frazę',
|
|
25
|
+
buttonText: 'Szukaj',
|
|
26
|
+
placeholder: 'Wpisz frazę',
|
|
27
|
+
suggestionsLabel: 'Sugestie',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export const AutosuggestSearch = (props) => {
|
|
31
|
+
const { options, itemActionIcon, onInput, onSelected, onClearOptions, onSubmit, onButtonClick = onSubmit, button, getOptionValue = (opt) => typeof opt !== 'object' || !('value' in opt)
|
|
32
|
+
? opt.toString()
|
|
33
|
+
: opt.value != null
|
|
34
|
+
? opt.value.toString()
|
|
35
|
+
: '', renderSuggestion = (opt) => typeof opt === 'object' && 'label' in opt && opt.label != null
|
|
36
|
+
? opt.label.toString()
|
|
37
|
+
: getOptionValue(opt), InputComponent = SearchInput, renderInputField, wrapperProps, } = props;
|
|
38
|
+
const [value, setValue] = useState('');
|
|
39
|
+
const inputRef = createRef();
|
|
40
|
+
const txt = getTexts(props, defaultAutosuggestSearchTexts);
|
|
41
|
+
return (React.createElement(Autosuggest, { theme: {
|
|
42
|
+
container: 'AutosuggestSearch',
|
|
43
|
+
containerOpen: 'AutosuggestSearch--open',
|
|
44
|
+
suggestionsContainer: 'AutosuggestSearch__container',
|
|
45
|
+
suggestionsContainerOpen: 'AutosuggestSearch__container--open',
|
|
46
|
+
suggestionsList: modifiedClass('AutosuggestSearch__list', itemActionIcon && `action--${itemActionIcon}`),
|
|
47
|
+
suggestion: 'AutosuggestSearch__item',
|
|
48
|
+
suggestionHighlighted: 'AutosuggestSearch__item--highlighted',
|
|
49
|
+
}, focusInputOnSuggestionClick: true, suggestions: options, onSuggestionsClearRequested: onClearOptions, onSuggestionsFetchRequested: ({ value }) => onInput(value), getSuggestionValue: getOptionValue, onSuggestionSelected: (_event, data) => {
|
|
50
|
+
onSelected({ value: data.suggestionValue, option: data.suggestion });
|
|
51
|
+
},
|
|
52
|
+
// onSuggestionHighlighted={onSuggestionHighlighted}
|
|
53
|
+
renderSuggestion: renderSuggestion, containerProps: Object.assign(Object.assign({}, wrapperProps), { 'aria-label': txt.label }), renderSuggestionsContainer: ({ containerProps, children }) => (React.createElement("div", Object.assign({}, containerProps, { "aria-label": options.length ? txt.suggestionsLabel : undefined }), children)), inputProps: {
|
|
54
|
+
ref: inputRef,
|
|
55
|
+
value: value,
|
|
56
|
+
onChange: (_, { newValue }) => {
|
|
57
|
+
setValue(newValue);
|
|
58
|
+
},
|
|
59
|
+
}, renderInputComponent: renderInputField
|
|
60
|
+
? (inputProps) => renderInputField(inputProps, txt)
|
|
61
|
+
: (inputProps) => {
|
|
62
|
+
/* prettier-ignore */
|
|
63
|
+
const { className, type, disabled, readOnly, required, children } = inputProps, siteSearchProps = __rest(inputProps, ["className", "type", "disabled", "readOnly", "required", "children"]);
|
|
64
|
+
return (React.createElement(InputComponent, Object.assign({ lang: props.lang }, siteSearchProps, { button: button, label: txt.inputLabel, placeholder: txt.placeholder, buttonText: txt.buttonText, onSubmit: onSubmit && (() => onSubmit(value)), onButtonClick: onButtonClick && (() => onButtonClick(value)) })));
|
|
65
|
+
} }));
|
|
66
|
+
};
|
package/esm/BasicTable.d.ts
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
|
-
import { TableProps } from '@hugsmidjan/react/Table';
|
|
2
1
|
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
2
|
+
import { TableProps } from './_abstract/_Table.js';
|
|
3
3
|
import { DeprecatedSeenProp } from './utils/seenEffect.js';
|
|
4
|
-
import {
|
|
4
|
+
import { HTMLProps, WrapperElmProps } from './utils.js';
|
|
5
|
+
type TableType = 'text' | 'number';
|
|
6
|
+
export type { TableBody, TableCell, TableCellData, TableCellMeta, TableCols, TableFoot, TableHead, TableRow, } from './_abstract/_Table.js';
|
|
5
7
|
export type BasicTableProps = {
|
|
6
8
|
compact?: boolean;
|
|
7
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The main/default cell-data type of the table
|
|
11
|
+
*
|
|
12
|
+
* Defaults to 'text'
|
|
13
|
+
*/
|
|
14
|
+
type?: TableType;
|
|
15
|
+
/**
|
|
16
|
+
* Custom HTML attributes for the component's `<table/>` element.
|
|
17
|
+
*
|
|
18
|
+
* Note, however, that some props may be intentionally
|
|
19
|
+
* excluded from the list.
|
|
20
|
+
*
|
|
21
|
+
* __WARNING:__
|
|
22
|
+
* In some cases props added this way can break the component, og hurt its
|
|
23
|
+
* accessibility. Also, some props may get ignored, or over-ridden by the
|
|
24
|
+
* component. User discretion is advised.
|
|
25
|
+
*/
|
|
26
|
+
tableProps?: HTMLProps<'table'>;
|
|
27
|
+
/** @deprecated Use `wrapperProps={{ className }}` and `tableProps={{ className }}` instead (Will be removed in v0.11) */
|
|
8
28
|
modifier?: string;
|
|
9
29
|
} & EitherObj<{
|
|
10
30
|
fullWidth?: boolean;
|
|
11
31
|
}, {
|
|
12
32
|
align?: 'right';
|
|
13
|
-
}> &
|
|
33
|
+
}> & WrapperElmProps & DeprecatedSeenProp & TableProps;
|
|
14
34
|
export declare const BasicTable: (props: BasicTableProps) => JSX.Element;
|
|
15
35
|
export default BasicTable;
|
package/esm/BasicTable.js
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { ScrollWrapper } from './_abstract/_ScrollWrapper.js';
|
|
4
|
+
import { Table } from './_abstract/_Table.js';
|
|
5
|
+
const tableTypes = {
|
|
6
|
+
text: '',
|
|
7
|
+
number: 'data--number',
|
|
8
|
+
};
|
|
5
9
|
export const BasicTable = (props) => {
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
: { tbody: props.tbody || [] };
|
|
10
|
-
const modifier = props.modifier;
|
|
11
|
-
return (React.createElement(TableWrapper, { modifier: [
|
|
10
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
11
|
+
const { align, fullWidth, type, tbody, tbodies, modifier } = props;
|
|
12
|
+
return (React.createElement(ScrollWrapper, { bem: "TableWrapper", modifier: [
|
|
12
13
|
'BasicTable',
|
|
13
14
|
modifier && 'BasicTable--' + modifier,
|
|
14
|
-
fullWidth
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
fullWidth
|
|
16
|
+
? 'BasicTable--fullwidth'
|
|
17
|
+
: align === 'right'
|
|
18
|
+
? 'BasicTable--align--' + align
|
|
19
|
+
: undefined,
|
|
20
|
+
], wrapperProps: props.wrapperProps, innerWrap // TODO: Remove this once the CSS style-server has been updated
|
|
21
|
+
: true },
|
|
17
22
|
React.createElement(Table, Object.assign({ className: modifiedClass('BasicTable', [
|
|
18
23
|
props.compact && 'compact',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
cols,
|
|
22
|
-
caption,
|
|
23
|
-
thead,
|
|
24
|
-
tfoot,
|
|
25
|
-
}, tbodyProps))));
|
|
24
|
+
type && tableTypes[type],
|
|
25
|
+
modifier,
|
|
26
|
+
]), cols: props.cols, caption: props.caption, thead: props.thead, tfoot: props.tfoot }, (tbody ? { tbody } : { tbodies }), { wrapperProps: props.tableProps }))));
|
|
26
27
|
};
|
|
27
28
|
export default BasicTable;
|
package/esm/BreadCrumbs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
1
|
+
import { DefaultTexts, HannaLang } from '@reykjavik/hanna-utils/i18n';
|
|
2
2
|
import { WrapperElmProps } from './utils.js';
|
|
3
3
|
export type BreadCrumb = {
|
|
4
4
|
href?: string;
|
|
@@ -10,7 +10,7 @@ export declare const defaultBreadCrumbsTexts: DefaultTexts<{
|
|
|
10
10
|
}>;
|
|
11
11
|
export type BreadCrumbsProps = {
|
|
12
12
|
title?: string;
|
|
13
|
-
lang?:
|
|
13
|
+
lang?: HannaLang;
|
|
14
14
|
trail: BreadCrumbTrail;
|
|
15
15
|
} & WrapperElmProps<null, 'aria-label'>;
|
|
16
16
|
export declare const BreadCrumbs: (props: BreadCrumbsProps) => JSX.Element | null;
|
package/esm/ContactBubble.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
2
|
+
import { DefaultTexts, HannaLang } from '@reykjavik/hanna-utils/i18n';
|
|
3
3
|
import { SSRSupportProps, WrapperElmProps } from './utils.js';
|
|
4
4
|
export type ContactBubbleI18n = {
|
|
5
|
-
lang?: string;
|
|
6
5
|
openBtn: string;
|
|
7
6
|
openBtnLong?: string;
|
|
8
7
|
closeBtn: string;
|
|
9
8
|
closeBtnLong?: string;
|
|
9
|
+
/** @deprecated Not used (Will be removed in v0.11) */
|
|
10
|
+
lang?: string;
|
|
10
11
|
};
|
|
11
12
|
export declare const defaultTexts: DefaultTexts<ContactBubbleI18n>;
|
|
12
13
|
declare const icons: {
|
|
@@ -46,7 +47,7 @@ export type ContactBubbleProps = {
|
|
|
46
47
|
*/
|
|
47
48
|
alwaysShow?: boolean;
|
|
48
49
|
texts?: ContactBubbleI18n;
|
|
49
|
-
lang?:
|
|
50
|
+
lang?: HannaLang;
|
|
50
51
|
} & SSRSupportProps & WrapperElmProps & ({
|
|
51
52
|
open?: boolean;
|
|
52
53
|
onToggle: (isOpen: boolean) => void;
|
package/esm/ContactBubble.js
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
3
3
|
import { focusElm } from '@hugsmidjan/qj/focusElm';
|
|
4
|
-
import { useDomid } from '@hugsmidjan/react/hooks';
|
|
5
4
|
import { getTexts } from '@reykjavik/hanna-utils/i18n';
|
|
6
5
|
import { Link } from './_abstract/_Link.js';
|
|
7
6
|
import { breakOnNL } from './_abstract/breakOnNL.js';
|
|
7
|
+
import { useDomid } from './utils/useDomid.js';
|
|
8
8
|
import { useIsBrowserSide } from './utils.js';
|
|
9
9
|
export const defaultTexts = {
|
|
10
10
|
is: {
|
|
11
|
-
lang: 'is',
|
|
12
11
|
openBtn: 'Hafa samband',
|
|
13
12
|
closeBtn: 'Loka',
|
|
14
13
|
closeBtnLong: 'Loka valmynd',
|
|
15
14
|
},
|
|
16
15
|
en: {
|
|
17
|
-
lang: 'en',
|
|
18
16
|
openBtn: 'Contact us',
|
|
19
17
|
closeBtn: 'Close',
|
|
20
18
|
closeBtnLong: 'Close bubble',
|
|
21
19
|
},
|
|
20
|
+
pl: {
|
|
21
|
+
openBtn: 'Skontaktuj się z nami',
|
|
22
|
+
closeBtn: 'Zamknąć',
|
|
23
|
+
closeBtnLong: 'Zamknąć pęcherzyk',
|
|
24
|
+
},
|
|
22
25
|
};
|
|
23
26
|
// ---------------------------------------------------------------------------
|
|
24
27
|
const icons = {
|
package/esm/Datepicker.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
+
import { HannaLang } from '@reykjavik/hanna-utils/i18n';
|
|
2
3
|
import { FormFieldWrappingProps } from './FormField.js';
|
|
3
4
|
export type DatepickerProps = {
|
|
4
5
|
small?: boolean;
|
|
@@ -28,14 +29,17 @@ export type DatepickerProps = {
|
|
|
28
29
|
* NOTE: This will be the default mode in v0.11.
|
|
29
30
|
*/
|
|
30
31
|
isoMode?: boolean;
|
|
31
|
-
|
|
32
|
+
texts?: DatepickerLocaleProps;
|
|
33
|
+
lang?: HannaLang;
|
|
32
34
|
dateFormat?: string | Array<string>;
|
|
33
35
|
isStartDate?: boolean;
|
|
34
36
|
isEndDate?: boolean;
|
|
35
37
|
inputRef?: RefObject<HTMLInputElement>;
|
|
36
38
|
onChange?: (date?: Date) => void;
|
|
37
39
|
datepickerExtraProps?: Record<string, unknown>;
|
|
38
|
-
/** @deprecated
|
|
40
|
+
/** @deprecated Use `lang` instead (Will be removed in v0.11) */
|
|
41
|
+
localeCode?: HannaLang;
|
|
42
|
+
/** @deprecated Use `value` or `defaultValue` instead. (Will be removed in v0.11) */
|
|
39
43
|
initialDate?: Date;
|
|
40
44
|
} & FormFieldWrappingProps;
|
|
41
45
|
/**
|
|
@@ -44,6 +48,7 @@ export type DatepickerProps = {
|
|
|
44
48
|
*/
|
|
45
49
|
export declare const getDateDiff: (refDate: Date, dayOffset: number) => Date;
|
|
46
50
|
export type DatepickerLocaleProps = {
|
|
51
|
+
ariaLabelClose: string;
|
|
47
52
|
nextMonthAriaLabel: string;
|
|
48
53
|
nextMonthButtonLabel: string;
|
|
49
54
|
nextYearAriaLabel: string;
|
|
@@ -54,8 +59,8 @@ export type DatepickerLocaleProps = {
|
|
|
54
59
|
previousYearButtonLabel: string;
|
|
55
60
|
timeInputLabel: string;
|
|
56
61
|
weekAriaLabelPrefix: string;
|
|
62
|
+
monthAriaLabelPrefix: string;
|
|
57
63
|
weekLabel: string;
|
|
58
|
-
ariaLabelPrefix: string;
|
|
59
64
|
chooseDayAriaLabelPrefix: string;
|
|
60
65
|
disabledDayAriaLabelPrefix: string;
|
|
61
66
|
};
|