@apia/components 4.0.30 → 4.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +29 -6
- package/dist/index.js +214 -146
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import React__default, { createContext, useContext, useEffect, useMemo, useState, useCallback, useRef, forwardRef, Fragment as Fragment$1, useDeferredValue, lazy, Suspense, useTransition, Children, memo, isValidElement, cloneElement, createRef } from 'react';
|
|
4
4
|
import parse, { domToReact, Element } from 'html-react-parser';
|
|
5
5
|
import { Spinner as Spinner$1, Box as Box$1 } from 'theme-ui';
|
|
6
|
-
import { uniqueId as uniqueId$3,
|
|
6
|
+
import { uniqueId as uniqueId$3, cloneDeep, isFunction } from 'lodash-es';
|
|
7
7
|
import { Box, getVariant, useBreakpointIndex, Close, responsive, spacing, Heading, Link, Button, Spinner, createElement, Select, Input, Flex, IconButton as IconButton$1, Image, injectStyles, Progress, Label as Label$1, Paragraph, Container, Form, focusOutline, makeStyledComponent, useThemeUI, Grid, Textarea } from '@apia/theme';
|
|
8
8
|
import { BarLoader } from 'react-spinners';
|
|
9
9
|
import uniqueId$2 from 'lodash-es/uniqueId';
|
|
@@ -3146,7 +3146,7 @@ var __privateSet$5 = (obj, member, value, setter) => {
|
|
|
3146
3146
|
member.set(obj, value);
|
|
3147
3147
|
return value;
|
|
3148
3148
|
};
|
|
3149
|
-
var _timeout, _tooltipTimeout, _unsuscribe, _tooltip;
|
|
3149
|
+
var _timeout$1, _tooltipTimeout, _unsuscribe, _tooltip;
|
|
3150
3150
|
let y$1 = 0, x$1 = 0;
|
|
3151
3151
|
document?.addEventListener("mousemove", (ev) => {
|
|
3152
3152
|
x$1 = ev.clientX;
|
|
@@ -3155,7 +3155,7 @@ document?.addEventListener("mousemove", (ev) => {
|
|
|
3155
3155
|
class AutomaticTooltip {
|
|
3156
3156
|
constructor(tooltip = null, handler) {
|
|
3157
3157
|
this.handler = handler;
|
|
3158
|
-
__privateAdd$8(this, _timeout, 500);
|
|
3158
|
+
__privateAdd$8(this, _timeout$1, 500);
|
|
3159
3159
|
__privateAdd$8(this, _tooltipTimeout, 0);
|
|
3160
3160
|
__privateAdd$8(this, _unsuscribe, null);
|
|
3161
3161
|
__publicField$l(this, "ref", (el) => {
|
|
@@ -3172,7 +3172,7 @@ class AutomaticTooltip {
|
|
|
3172
3172
|
...__privateGet$7(this, _tooltip),
|
|
3173
3173
|
anchorPoint: { left: x$1 + 3, top: y$1 + 3 }
|
|
3174
3174
|
});
|
|
3175
|
-
}, __privateGet$7(this, _timeout)));
|
|
3175
|
+
}, __privateGet$7(this, _timeout$1)));
|
|
3176
3176
|
};
|
|
3177
3177
|
const reset = () => {
|
|
3178
3178
|
clearTimeout(__privateGet$7(this, _tooltipTimeout));
|
|
@@ -3195,11 +3195,11 @@ class AutomaticTooltip {
|
|
|
3195
3195
|
});
|
|
3196
3196
|
__privateSet$5(this, _tooltip, tooltip);
|
|
3197
3197
|
if (tooltip?.timeout !== void 0) {
|
|
3198
|
-
__privateSet$5(this, _timeout, tooltip?.timeout);
|
|
3198
|
+
__privateSet$5(this, _timeout$1, tooltip?.timeout);
|
|
3199
3199
|
}
|
|
3200
3200
|
}
|
|
3201
3201
|
}
|
|
3202
|
-
_timeout = new WeakMap();
|
|
3202
|
+
_timeout$1 = new WeakMap();
|
|
3203
3203
|
_tooltipTimeout = new WeakMap();
|
|
3204
3204
|
_unsuscribe = new WeakMap();
|
|
3205
3205
|
_tooltip = new WeakMap();
|
|
@@ -4008,7 +4008,7 @@ var __privateSet$2 = (obj, member, value, setter) => {
|
|
|
4008
4008
|
member.set(obj, value);
|
|
4009
4009
|
return value;
|
|
4010
4010
|
};
|
|
4011
|
-
var _actualSearch,
|
|
4011
|
+
var _actualSearch, _timeout;
|
|
4012
4012
|
class AutocompleteController {
|
|
4013
4013
|
constructor(properties) {
|
|
4014
4014
|
__publicField$f(this, "state", {
|
|
@@ -4022,22 +4022,28 @@ class AutocompleteController {
|
|
|
4022
4022
|
value: "",
|
|
4023
4023
|
width: 55
|
|
4024
4024
|
});
|
|
4025
|
-
__privateAdd$4(this, _actualSearch, (str) => {
|
|
4026
|
-
this.state.
|
|
4027
|
-
if (
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4025
|
+
__privateAdd$4(this, _actualSearch, async (str) => {
|
|
4026
|
+
if (this.state.onSearch) {
|
|
4027
|
+
if (str === "")
|
|
4028
|
+
this.state.value = "";
|
|
4029
|
+
const newOptions = await this.state.onSearch(str, this);
|
|
4030
|
+
this.state.options = newOptions;
|
|
4031
|
+
} else {
|
|
4032
|
+
this.state.options.forEach((c) => {
|
|
4033
|
+
if (this.state.caseInsensitive) {
|
|
4034
|
+
c.filtered = (c.searchLabel ?? c.label?.toString?.() ?? c.value).toLowerCase().indexOf(str.toLowerCase()) === -1;
|
|
4035
|
+
} else {
|
|
4036
|
+
c.filtered = (c.searchLabel ?? c.label?.toString?.() ?? c.value)?.indexOf(
|
|
4037
|
+
str
|
|
4038
|
+
) === -1;
|
|
4039
|
+
}
|
|
4040
|
+
if (this.getOptionByValue(this.state.focusedValue)?.filtered) {
|
|
4041
|
+
this.state.focusedValue = this.state.options.find((c2) => !c2.filtered)?.value || null;
|
|
4042
|
+
}
|
|
4043
|
+
});
|
|
4044
|
+
}
|
|
4039
4045
|
});
|
|
4040
|
-
__privateAdd$4(this,
|
|
4046
|
+
__privateAdd$4(this, _timeout, 0);
|
|
4041
4047
|
__publicField$f(this, "tooltipRef", null);
|
|
4042
4048
|
Object.assign(this.state, properties);
|
|
4043
4049
|
if (properties.value) {
|
|
@@ -4050,12 +4056,6 @@ class AutocompleteController {
|
|
|
4050
4056
|
getAutocompleteBox: false,
|
|
4051
4057
|
getOptionByValue: false
|
|
4052
4058
|
});
|
|
4053
|
-
reaction(
|
|
4054
|
-
() => this.state.searchDebounce,
|
|
4055
|
-
() => {
|
|
4056
|
-
__privateSet$2(this, _search, __privateGet$3(this, _makeSearch).call(this));
|
|
4057
|
-
}
|
|
4058
|
-
);
|
|
4059
4059
|
reaction(
|
|
4060
4060
|
() => this.state.focusedValue,
|
|
4061
4061
|
() => {
|
|
@@ -4083,7 +4083,8 @@ class AutocompleteController {
|
|
|
4083
4083
|
close(selectValue = true) {
|
|
4084
4084
|
this.tooltipRef?.close();
|
|
4085
4085
|
this.tooltipRef = null;
|
|
4086
|
-
|
|
4086
|
+
if (!this.state.showValue)
|
|
4087
|
+
__privateGet$3(this, _actualSearch).call(this, "");
|
|
4087
4088
|
if (selectValue) {
|
|
4088
4089
|
let currentValue = this.state.options.find(
|
|
4089
4090
|
(c) => c.value === this.state.focusedValue
|
|
@@ -4210,7 +4211,10 @@ class AutocompleteController {
|
|
|
4210
4211
|
return;
|
|
4211
4212
|
}
|
|
4212
4213
|
this.state.showValue = str;
|
|
4213
|
-
__privateGet$3(this,
|
|
4214
|
+
clearTimeout(__privateGet$3(this, _timeout));
|
|
4215
|
+
__privateSet$2(this, _timeout, setTimeout(() => {
|
|
4216
|
+
__privateGet$3(this, _actualSearch).call(this, str);
|
|
4217
|
+
}, 100));
|
|
4214
4218
|
}
|
|
4215
4219
|
selectFocused() {
|
|
4216
4220
|
this.close();
|
|
@@ -4239,8 +4243,7 @@ class AutocompleteController {
|
|
|
4239
4243
|
}
|
|
4240
4244
|
}
|
|
4241
4245
|
_actualSearch = new WeakMap();
|
|
4242
|
-
|
|
4243
|
-
_search = new WeakMap();
|
|
4246
|
+
_timeout = new WeakMap();
|
|
4244
4247
|
|
|
4245
4248
|
const SearchBox = observer((props) => {
|
|
4246
4249
|
const handler = useAutocompleteContext();
|
|
@@ -4271,7 +4274,7 @@ const SearchBox = observer((props) => {
|
|
|
4271
4274
|
...props,
|
|
4272
4275
|
ref: inputRef,
|
|
4273
4276
|
className: `autocomplete__search ${handler.state.disabled ? "disabled" : ""} ${handler.state.readOnly ? "readOnly" : ""}`,
|
|
4274
|
-
onChange: (ev) => {
|
|
4277
|
+
onChange: async (ev) => {
|
|
4275
4278
|
handler.search(ev.target.value);
|
|
4276
4279
|
},
|
|
4277
4280
|
onMouseDown: () => {
|
|
@@ -4293,7 +4296,7 @@ const SearchBox = observer((props) => {
|
|
|
4293
4296
|
Icon$1,
|
|
4294
4297
|
{
|
|
4295
4298
|
title: "",
|
|
4296
|
-
name: "ArrowDown",
|
|
4299
|
+
name: handler.state?.icon || "ArrowDown",
|
|
4297
4300
|
className: "autocomplete__downArrow"
|
|
4298
4301
|
}
|
|
4299
4302
|
)
|
|
@@ -4821,8 +4824,6 @@ const IconInput = ({
|
|
|
4821
4824
|
const { sx: inputSx, ...actualInputProps } = inputProps ?? {};
|
|
4822
4825
|
const innerButtonRef = React__default.useRef(null);
|
|
4823
4826
|
const assignButtonRef = useCombinedRefs(buttonRef, innerButtonRef);
|
|
4824
|
-
const innerInputRef = React__default.useRef(null);
|
|
4825
|
-
const assignInputRef = useCombinedRefs(inputRef, innerInputRef);
|
|
4826
4827
|
const parentRef = React__default.useRef(null);
|
|
4827
4828
|
const handleBlur = React__default.useCallback(
|
|
4828
4829
|
(ev) => {
|
|
@@ -4830,7 +4831,9 @@ const IconInput = ({
|
|
|
4830
4831
|
ev.relatedTarget,
|
|
4831
4832
|
(current) => current === parentRef.current
|
|
4832
4833
|
))) {
|
|
4833
|
-
Object.assign(ev.target, {
|
|
4834
|
+
Object.assign(ev.target, {
|
|
4835
|
+
value: ev.target.closest(".iconInput").querySelector("input").value
|
|
4836
|
+
});
|
|
4834
4837
|
onBlur(ev);
|
|
4835
4838
|
}
|
|
4836
4839
|
},
|
|
@@ -4840,17 +4843,16 @@ const IconInput = ({
|
|
|
4840
4843
|
Box,
|
|
4841
4844
|
{
|
|
4842
4845
|
...getVariant("forms.iconInput"),
|
|
4843
|
-
className: `${className ?? ""} iconInput`,
|
|
4844
4846
|
ref: parentRef,
|
|
4845
4847
|
onBlur: handleBlur,
|
|
4848
|
+
className: `${className ?? ""} iconInput`,
|
|
4846
4849
|
children: [
|
|
4847
4850
|
/* @__PURE__ */ jsx(
|
|
4848
4851
|
ReactInputMask,
|
|
4849
4852
|
{
|
|
4850
4853
|
mask: mask ?? "",
|
|
4851
|
-
onBlur: handleBlur,
|
|
4852
4854
|
disabled: isLoading || disabled,
|
|
4853
|
-
ref:
|
|
4855
|
+
ref: inputRef,
|
|
4854
4856
|
readOnly,
|
|
4855
4857
|
sx: { variant: "forms.input", ...inputSx },
|
|
4856
4858
|
"data-variant": "forms.input",
|
|
@@ -4901,6 +4903,7 @@ const DateInput = React__default.forwardRef(
|
|
|
4901
4903
|
onError,
|
|
4902
4904
|
renderLabel,
|
|
4903
4905
|
value: outerValue,
|
|
4906
|
+
avoidErrorMessage,
|
|
4904
4907
|
...props
|
|
4905
4908
|
}, ref) => {
|
|
4906
4909
|
const id = React__default.useMemo(uniqueId$3, []);
|
|
@@ -4910,6 +4913,7 @@ const DateInput = React__default.forwardRef(
|
|
|
4910
4913
|
const { deleteFiltersTimestamp, ...otherProps } = props;
|
|
4911
4914
|
const hasBlured = useRef(false);
|
|
4912
4915
|
const [stateError, setError] = React__default.useState(error ?? null);
|
|
4916
|
+
const [isFocused, setIsFocused] = React__default.useState(false);
|
|
4913
4917
|
const lastEmittedValue = React__default.useRef(outerValue ?? "");
|
|
4914
4918
|
useUpdateEffect$1(() => {
|
|
4915
4919
|
setInputValue(outerValue ?? "");
|
|
@@ -4998,13 +5002,13 @@ const DateInput = React__default.forwardRef(
|
|
|
4998
5002
|
[setCalendarValue]
|
|
4999
5003
|
);
|
|
5000
5004
|
useEffect(() => {
|
|
5001
|
-
if (stateError !== "" && stateError !== null) {
|
|
5005
|
+
if (stateError !== "" && stateError !== null && !avoidErrorMessage) {
|
|
5002
5006
|
ApiaUtil.instance.notifications.notify({
|
|
5003
5007
|
message: stateError,
|
|
5004
5008
|
type: "warning"
|
|
5005
5009
|
});
|
|
5006
5010
|
}
|
|
5007
|
-
}, [stateError]);
|
|
5011
|
+
}, [avoidErrorMessage, stateError]);
|
|
5008
5012
|
const handleBlur = React__default.useCallback(
|
|
5009
5013
|
(ev) => {
|
|
5010
5014
|
hasBlured.current = true;
|
|
@@ -5044,6 +5048,9 @@ const DateInput = React__default.forwardRef(
|
|
|
5044
5048
|
value: stateError ? "" : renderLabel ? renderLabel(inputValue) : inputValue,
|
|
5045
5049
|
ref,
|
|
5046
5050
|
onChange: (ev) => {
|
|
5051
|
+
if (props.readOnly) {
|
|
5052
|
+
return;
|
|
5053
|
+
}
|
|
5047
5054
|
setInputValue(ev.target.value);
|
|
5048
5055
|
if (getMaskForDateFormat().replaceAll("9", DEFAULT_MASK_PLACEHOLDER) !== ev.target.value && ev.target.value !== "") {
|
|
5049
5056
|
setError(null);
|
|
@@ -5053,6 +5060,7 @@ const DateInput = React__default.forwardRef(
|
|
|
5053
5060
|
}
|
|
5054
5061
|
},
|
|
5055
5062
|
onBlur: (ev) => {
|
|
5063
|
+
setIsFocused(false);
|
|
5056
5064
|
if (!(props.readOnly || getCustomMask || document.querySelector(".overlay.screenLock")))
|
|
5057
5065
|
setCalendarValue(ev.target.value, false, true);
|
|
5058
5066
|
if (hasBlured.current) {
|
|
@@ -5061,6 +5069,9 @@ const DateInput = React__default.forwardRef(
|
|
|
5061
5069
|
handleBlur(ev);
|
|
5062
5070
|
}
|
|
5063
5071
|
},
|
|
5072
|
+
onFocus: () => {
|
|
5073
|
+
setIsFocused(true);
|
|
5074
|
+
},
|
|
5064
5075
|
onKeyDown: (ev) => {
|
|
5065
5076
|
if (ev.key === "Enter")
|
|
5066
5077
|
setCalendarValue(inputValue);
|
|
@@ -5088,25 +5099,38 @@ const DateInput = React__default.forwardRef(
|
|
|
5088
5099
|
}),
|
|
5089
5100
|
[outerButtonProps, props.disabled, props.readOnly]
|
|
5090
5101
|
);
|
|
5091
|
-
const additionalButtons = React__default.useMemo(
|
|
5092
|
-
() =>
|
|
5093
|
-
|
|
5102
|
+
const additionalButtons = React__default.useMemo(() => {
|
|
5103
|
+
const doDelete = (e) => {
|
|
5104
|
+
e?.stopPropagation();
|
|
5105
|
+
setCalendarValue("");
|
|
5106
|
+
onDelete?.();
|
|
5107
|
+
document.querySelector(`#DateInput${id} input`)?.focus();
|
|
5108
|
+
};
|
|
5109
|
+
return /* @__PURE__ */ jsx(
|
|
5110
|
+
"span",
|
|
5094
5111
|
{
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5112
|
+
role: "button",
|
|
5113
|
+
tabIndex: 0,
|
|
5114
|
+
onMouseDown: (e) => {
|
|
5115
|
+
e.preventDefault();
|
|
5116
|
+
e.stopPropagation();
|
|
5117
|
+
},
|
|
5118
|
+
onClick: (e) => {
|
|
5119
|
+
e.stopPropagation();
|
|
5120
|
+
doDelete(e);
|
|
5121
|
+
},
|
|
5122
|
+
onKeyDown: (e) => {
|
|
5123
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
5124
|
+
e.preventDefault();
|
|
5125
|
+
doDelete(e);
|
|
5126
|
+
}
|
|
5102
5127
|
},
|
|
5103
|
-
title: getLabel("btnAiDelete").text,
|
|
5104
5128
|
"aria-label": getLabel("btnAiDelete").text,
|
|
5105
|
-
|
|
5129
|
+
title: getLabel("btnAiDelete").text,
|
|
5130
|
+
children: /* @__PURE__ */ jsx(Close, { type: "button", className: "delete_date_button" })
|
|
5106
5131
|
}
|
|
5107
|
-
)
|
|
5108
|
-
|
|
5109
|
-
);
|
|
5132
|
+
);
|
|
5133
|
+
}, [id, onDelete, setCalendarValue]);
|
|
5110
5134
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
5111
5135
|
Box,
|
|
5112
5136
|
{
|
|
@@ -5115,6 +5139,7 @@ const DateInput = React__default.forwardRef(
|
|
|
5115
5139
|
id: `DateInput${id}`,
|
|
5116
5140
|
ref: boxRef,
|
|
5117
5141
|
onBlur: (e) => {
|
|
5142
|
+
setIsFocused(false);
|
|
5118
5143
|
if (hasBlured.current) {
|
|
5119
5144
|
hasBlured.current = false;
|
|
5120
5145
|
} else if (!document.querySelector(".overlay.screenLock")) {
|
|
@@ -5124,10 +5149,14 @@ const DateInput = React__default.forwardRef(
|
|
|
5124
5149
|
children: /* @__PURE__ */ jsx(
|
|
5125
5150
|
IconInput,
|
|
5126
5151
|
{
|
|
5127
|
-
additionalButtons:
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5152
|
+
additionalButtons: (
|
|
5153
|
+
// mostrar sólo si el campo tiene valor, no está en modo placeholder,
|
|
5154
|
+
// no es readOnly/disabled Y el input está enfocado
|
|
5155
|
+
inputValue && inputValue !== getMaskForDateFormat().replaceAll(
|
|
5156
|
+
"9",
|
|
5157
|
+
DEFAULT_MASK_PLACEHOLDER
|
|
5158
|
+
) && !props.readOnly && !props.disabled && isFocused ? additionalButtons : void 0
|
|
5159
|
+
),
|
|
5131
5160
|
buttonProps,
|
|
5132
5161
|
className: `${stateError !== null ? "field__withError" : ""}`,
|
|
5133
5162
|
icon: FaCalendarAlt,
|
|
@@ -6132,7 +6161,7 @@ const AutoscrollContainer = ({ children, threshold = 150, className }) => {
|
|
|
6132
6161
|
mo.disconnect();
|
|
6133
6162
|
};
|
|
6134
6163
|
}, [threshold]);
|
|
6135
|
-
return /* @__PURE__ */ jsx("div", { ref: wrapperRef, className
|
|
6164
|
+
return /* @__PURE__ */ jsx("div", { ref: wrapperRef, className: `${className || ""} autoscrollContainer`, children });
|
|
6136
6165
|
};
|
|
6137
6166
|
|
|
6138
6167
|
const FileCard = forwardRef(
|
|
@@ -9022,6 +9051,31 @@ const SkeletonItem = () => /* @__PURE__ */ jsx(
|
|
|
9022
9051
|
);
|
|
9023
9052
|
const ListSkeletonLoader = ({ items = 5 }) => /* @__PURE__ */ jsx(Box, { sx: { display: "flex", flexDirection: "column", gap: 3 }, children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ jsx(SkeletonItem, {}, index)) });
|
|
9024
9053
|
|
|
9054
|
+
const LinearSpinnerLock = ({ isLocked }) => isLocked ? /* @__PURE__ */ jsx(
|
|
9055
|
+
Box,
|
|
9056
|
+
{
|
|
9057
|
+
className: "locker",
|
|
9058
|
+
style: {
|
|
9059
|
+
backgroundColor: "rgb(128 128 128 / 0%)",
|
|
9060
|
+
inset: 0,
|
|
9061
|
+
position: "fixed",
|
|
9062
|
+
display: "flex",
|
|
9063
|
+
alignItems: "center",
|
|
9064
|
+
justifyContent: "center",
|
|
9065
|
+
zIndex: "modal",
|
|
9066
|
+
transition: "background-color 2s"
|
|
9067
|
+
},
|
|
9068
|
+
ref: (el) => {
|
|
9069
|
+
if (el instanceof HTMLElement) {
|
|
9070
|
+
window.requestAnimationFrame(() => {
|
|
9071
|
+
el.style.backgroundColor = "rgb(200 200 200 / 60%)";
|
|
9072
|
+
});
|
|
9073
|
+
}
|
|
9074
|
+
},
|
|
9075
|
+
children: /* @__PURE__ */ jsx(LinearLoader, {})
|
|
9076
|
+
}
|
|
9077
|
+
) : null;
|
|
9078
|
+
|
|
9025
9079
|
const distinctors = {
|
|
9026
9080
|
grid: [
|
|
9027
9081
|
(distinctors2, state) => {
|
|
@@ -9570,21 +9624,28 @@ const DefaultIconRendererNoMemo = (props) => {
|
|
|
9570
9624
|
console.error({ props });
|
|
9571
9625
|
console.error("The icon has no imageUrl nor icon defined");
|
|
9572
9626
|
}
|
|
9573
|
-
return /* @__PURE__ */ jsxs(
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
|
|
9627
|
+
return /* @__PURE__ */ jsxs(
|
|
9628
|
+
Box,
|
|
9629
|
+
{
|
|
9630
|
+
title: props.title || props.label,
|
|
9631
|
+
className: "iconsList__icon__wrapper",
|
|
9632
|
+
children: [
|
|
9633
|
+
/* @__PURE__ */ jsxs(Box, { className: "iconsList__icon__image__wrapper", children: [
|
|
9634
|
+
props.imageUrl && /* @__PURE__ */ jsx(
|
|
9635
|
+
Image,
|
|
9636
|
+
{
|
|
9637
|
+
className: "iconsList__icon__image",
|
|
9638
|
+
src: props.imageUrl,
|
|
9639
|
+
role: "none",
|
|
9640
|
+
alt: ""
|
|
9641
|
+
}
|
|
9642
|
+
),
|
|
9643
|
+
props.icon && /* @__PURE__ */ jsx(Icon$1, { icon: props.icon, title: props.ariaLabel })
|
|
9644
|
+
] }),
|
|
9645
|
+
/* @__PURE__ */ jsx(Box, { className: "iconsList__icon__label", children: props.label })
|
|
9646
|
+
]
|
|
9647
|
+
}
|
|
9648
|
+
);
|
|
9588
9649
|
};
|
|
9589
9650
|
const DefaultIconRenderer = memo(DefaultIconRendererNoMemo);
|
|
9590
9651
|
|
|
@@ -10133,6 +10194,22 @@ const SortableList = makeStyledComponent(
|
|
|
10133
10194
|
UnstyledSortableList
|
|
10134
10195
|
);
|
|
10135
10196
|
|
|
10197
|
+
const defaultLabels = Object.freeze({
|
|
10198
|
+
totalRecords: window.GNR_TOT_RECORDS,
|
|
10199
|
+
totalRecordsReached: window.GNR_TOT_RECORDS_REACHED,
|
|
10200
|
+
maximize: window.LBL_MAXIMIZE,
|
|
10201
|
+
minimize: window.LBL_MINIMIZE,
|
|
10202
|
+
information: window.BTN_FILE_INFO_TOOLTIP,
|
|
10203
|
+
deleteFilters: window.BTN_DELETE_FILTERS,
|
|
10204
|
+
refresh: window.NAV_REFRESH,
|
|
10205
|
+
firstPage: window.NAV_FIRST_PAGE,
|
|
10206
|
+
previousPage: window.NAV_PREVIOUS_PAGE,
|
|
10207
|
+
lastPage: window.NAV_LAST_PAGE,
|
|
10208
|
+
nextPage: window.NAV_NEXT_PAGE,
|
|
10209
|
+
pageInputInstructions: window.NAV_INPUT_LABEL,
|
|
10210
|
+
page: window.PAGE,
|
|
10211
|
+
moreData: window.QUERY_MORE_DATA
|
|
10212
|
+
});
|
|
10136
10213
|
const NoMemoPagination = ({
|
|
10137
10214
|
appliedFilters,
|
|
10138
10215
|
areAllFiltersApplied,
|
|
@@ -10155,30 +10232,15 @@ const NoMemoPagination = ({
|
|
|
10155
10232
|
showMaximizeOnSmallBreakpoints,
|
|
10156
10233
|
variant = "primary",
|
|
10157
10234
|
isMaximized,
|
|
10158
|
-
onMaximize
|
|
10235
|
+
onMaximize,
|
|
10236
|
+
labels
|
|
10159
10237
|
}) => {
|
|
10160
10238
|
const numberPageCount = Number(pageCount);
|
|
10161
|
-
const breakPoint = useBreakpointIndex();
|
|
10162
10239
|
const numberCurrentPage = Number(currentPage);
|
|
10240
|
+
const breakPoint = useBreakpointIndex();
|
|
10163
10241
|
const recordsCount = outerRecordsCount;
|
|
10164
|
-
const
|
|
10165
|
-
numberCurrentPage ?? 1
|
|
10166
|
-
);
|
|
10167
|
-
const [lastEmittedPage, setLastEmittedPage] = useState(
|
|
10168
|
-
numberCurrentPage ?? 1
|
|
10169
|
-
);
|
|
10242
|
+
const definedLabels = Object.assign({}, defaultLabels, labels);
|
|
10170
10243
|
const [hasNoValue, setHasNoValue] = useState(false);
|
|
10171
|
-
useEffect(() => {
|
|
10172
|
-
setCurrentPage(numberCurrentPage);
|
|
10173
|
-
}, [numberCurrentPage]);
|
|
10174
|
-
const setCurrentAndDispatch = useCallback(
|
|
10175
|
-
(page) => {
|
|
10176
|
-
setCurrentPage(page);
|
|
10177
|
-
onPageChange(page);
|
|
10178
|
-
setLastEmittedPage(page);
|
|
10179
|
-
},
|
|
10180
|
-
[onPageChange]
|
|
10181
|
-
);
|
|
10182
10244
|
const InputRef = createRef();
|
|
10183
10245
|
const options = [];
|
|
10184
10246
|
for (let i = 1; i <= numberPageCount; i++) {
|
|
@@ -10187,19 +10249,22 @@ const NoMemoPagination = ({
|
|
|
10187
10249
|
const [infoButtonRef, setInfoButtonRef] = React__default.useState(
|
|
10188
10250
|
null
|
|
10189
10251
|
);
|
|
10190
|
-
const recordsCountLabel = `${
|
|
10252
|
+
const recordsCountLabel = `${definedLabels.totalRecords}: ${recordsCount}`;
|
|
10191
10253
|
const tooltipProps = React__default.useMemo(
|
|
10192
10254
|
() => ({
|
|
10193
|
-
text: breakPoint <= 3 ? `${recordsCountLabel}.${!reachedMax && !hasMore ? "" : reachedMax &&
|
|
10255
|
+
text: breakPoint <= 3 ? `${recordsCountLabel}.${!reachedMax && !hasMore ? "" : reachedMax && definedLabels.totalRecordsReached || hasMore && definedLabels.moreData}` : `${!reachedMax && !hasMore ? "" : reachedMax && definedLabels.totalRecordsReached || hasMore && definedLabels.moreData}`,
|
|
10194
10256
|
attachToElement: { current: infoButtonRef },
|
|
10195
10257
|
closeOnClickOut: true
|
|
10196
|
-
// closeOnClickOutChecker(element) {
|
|
10197
|
-
// return !getSpecificParent(element, (current) =>
|
|
10198
|
-
// current.classList.contains('pagination__information'),
|
|
10199
|
-
// );
|
|
10200
|
-
// },
|
|
10201
10258
|
}),
|
|
10202
|
-
[
|
|
10259
|
+
[
|
|
10260
|
+
breakPoint,
|
|
10261
|
+
definedLabels.moreData,
|
|
10262
|
+
definedLabels.totalRecordsReached,
|
|
10263
|
+
hasMore,
|
|
10264
|
+
infoButtonRef,
|
|
10265
|
+
reachedMax,
|
|
10266
|
+
recordsCountLabel
|
|
10267
|
+
]
|
|
10203
10268
|
);
|
|
10204
10269
|
return /* @__PURE__ */ jsxs(
|
|
10205
10270
|
Box,
|
|
@@ -10217,8 +10282,8 @@ const NoMemoPagination = ({
|
|
|
10217
10282
|
className: "pagination__fullScreenButton",
|
|
10218
10283
|
onClick: onMaximize,
|
|
10219
10284
|
icon: !isMaximized ? "Maximize" : "Minimize",
|
|
10220
|
-
title: !isMaximized ?
|
|
10221
|
-
"aria-label": !isMaximized ?
|
|
10285
|
+
title: !isMaximized ? definedLabels.maximize : definedLabels.minimize,
|
|
10286
|
+
"aria-label": !isMaximized ? definedLabels.maximize : definedLabels.minimize,
|
|
10222
10287
|
iconSize: "Md"
|
|
10223
10288
|
}
|
|
10224
10289
|
),
|
|
@@ -10232,8 +10297,8 @@ const NoMemoPagination = ({
|
|
|
10232
10297
|
onClick: () => ApiaUtil.instance.tooltips.open(tooltipProps),
|
|
10233
10298
|
ref: setInfoButtonRef,
|
|
10234
10299
|
iconSize: "Md",
|
|
10235
|
-
"aria-label":
|
|
10236
|
-
title:
|
|
10300
|
+
"aria-label": definedLabels.information,
|
|
10301
|
+
title: definedLabels.information
|
|
10237
10302
|
}
|
|
10238
10303
|
) : "",
|
|
10239
10304
|
breakPoint > 3 && /* @__PURE__ */ jsx(
|
|
@@ -10242,7 +10307,7 @@ const NoMemoPagination = ({
|
|
|
10242
10307
|
as: "span",
|
|
10243
10308
|
className: "recordsCounter pagination__deleteLabels",
|
|
10244
10309
|
title: recordsCountLabel,
|
|
10245
|
-
children: recordsCount !== -1 && `${
|
|
10310
|
+
children: recordsCount !== -1 && `${definedLabels.totalRecords}: ${recordsCount} `
|
|
10246
10311
|
}
|
|
10247
10312
|
)
|
|
10248
10313
|
] })
|
|
@@ -10252,11 +10317,12 @@ const NoMemoPagination = ({
|
|
|
10252
10317
|
IconButton,
|
|
10253
10318
|
{
|
|
10254
10319
|
variant: "icon-primary",
|
|
10255
|
-
disabled: disabled ||
|
|
10256
|
-
|
|
10320
|
+
disabled: disabled || numberCurrentPage === 1 || isLoading || isPerforming,
|
|
10321
|
+
title: definedLabels.firstPage,
|
|
10322
|
+
"aria-label": definedLabels.firstPage,
|
|
10257
10323
|
type: "button",
|
|
10258
10324
|
onClick: () => {
|
|
10259
|
-
|
|
10325
|
+
onPageChange(1);
|
|
10260
10326
|
},
|
|
10261
10327
|
icon: "First",
|
|
10262
10328
|
iconSize: "Sm"
|
|
@@ -10266,11 +10332,12 @@ const NoMemoPagination = ({
|
|
|
10266
10332
|
IconButton,
|
|
10267
10333
|
{
|
|
10268
10334
|
variant: "icon-primary",
|
|
10269
|
-
disabled: disabled ||
|
|
10270
|
-
|
|
10335
|
+
disabled: disabled || numberCurrentPage <= 1 || isLoading || isPerforming,
|
|
10336
|
+
title: definedLabels.previousPage,
|
|
10337
|
+
"aria-label": definedLabels.previousPage,
|
|
10271
10338
|
type: "button",
|
|
10272
10339
|
onClick: () => {
|
|
10273
|
-
|
|
10340
|
+
onPageChange(numberCurrentPage - 1);
|
|
10274
10341
|
},
|
|
10275
10342
|
icon: "Previous",
|
|
10276
10343
|
iconSize: "Sm"
|
|
@@ -10281,10 +10348,10 @@ const NoMemoPagination = ({
|
|
|
10281
10348
|
Input,
|
|
10282
10349
|
{
|
|
10283
10350
|
className: "pagination__controls__input",
|
|
10284
|
-
"aria-label":
|
|
10285
|
-
title: `${
|
|
10351
|
+
"aria-label": definedLabels.pageInputInstructions,
|
|
10352
|
+
title: `${definedLabels.page}: ${numberCurrentPage} `,
|
|
10286
10353
|
ref: InputRef,
|
|
10287
|
-
value: hasNoValue ? "" :
|
|
10354
|
+
value: hasNoValue ? "" : numberCurrentPage,
|
|
10288
10355
|
onKeyDown: (ev) => {
|
|
10289
10356
|
const regex = /([0-9])|(Backspace)|(Tab)/;
|
|
10290
10357
|
if (!ev.key.match(regex)) {
|
|
@@ -10294,28 +10361,28 @@ const NoMemoPagination = ({
|
|
|
10294
10361
|
if (ev.key === "Enter") {
|
|
10295
10362
|
ev.stopPropagation();
|
|
10296
10363
|
ev.preventDefault();
|
|
10297
|
-
|
|
10364
|
+
onPageChange(numberCurrentPage);
|
|
10298
10365
|
}
|
|
10299
10366
|
},
|
|
10300
10367
|
onBlur: () => {
|
|
10301
|
-
|
|
10302
|
-
setCurrentAndDispatch(internCurrentPage);
|
|
10303
|
-
}
|
|
10368
|
+
onPageChange(numberCurrentPage);
|
|
10304
10369
|
},
|
|
10305
10370
|
onFocus: (ev) => {
|
|
10306
10371
|
ev.currentTarget.select();
|
|
10307
10372
|
},
|
|
10308
10373
|
onChange: (ev) => {
|
|
10309
10374
|
setHasNoValue(ev.target.value === "");
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10375
|
+
if (ev.target.value !== "") {
|
|
10376
|
+
onPageChange(
|
|
10377
|
+
Math.max(
|
|
10378
|
+
1,
|
|
10379
|
+
Math.min(
|
|
10380
|
+
noNaN(Number(ev.currentTarget.value)),
|
|
10381
|
+
pageCount
|
|
10382
|
+
)
|
|
10316
10383
|
)
|
|
10317
|
-
)
|
|
10318
|
-
|
|
10384
|
+
);
|
|
10385
|
+
}
|
|
10319
10386
|
},
|
|
10320
10387
|
disabled: disabled || isLoading || isPerforming
|
|
10321
10388
|
}
|
|
@@ -10327,7 +10394,7 @@ const NoMemoPagination = ({
|
|
|
10327
10394
|
Box,
|
|
10328
10395
|
{
|
|
10329
10396
|
as: "span",
|
|
10330
|
-
title: recordsCount !== -1 ? `${
|
|
10397
|
+
title: recordsCount !== -1 ? `${definedLabels.totalRecords} ${recordsCount}` : definedLabels.pageInputInstructions,
|
|
10331
10398
|
children: pageCount
|
|
10332
10399
|
}
|
|
10333
10400
|
)
|
|
@@ -10336,9 +10403,9 @@ const NoMemoPagination = ({
|
|
|
10336
10403
|
Select,
|
|
10337
10404
|
{
|
|
10338
10405
|
className: "pagination__selectPage",
|
|
10339
|
-
value:
|
|
10406
|
+
value: numberCurrentPage,
|
|
10340
10407
|
onChange: (e) => {
|
|
10341
|
-
|
|
10408
|
+
onPageChange(Number(e.target.value));
|
|
10342
10409
|
},
|
|
10343
10410
|
children: [
|
|
10344
10411
|
/* @__PURE__ */ jsxs("option", { disabled: true, children: [
|
|
@@ -10355,11 +10422,12 @@ const NoMemoPagination = ({
|
|
|
10355
10422
|
IconButton,
|
|
10356
10423
|
{
|
|
10357
10424
|
variant: "icon-primary",
|
|
10358
|
-
disabled: disabled ||
|
|
10359
|
-
|
|
10425
|
+
disabled: disabled || numberCurrentPage >= numberPageCount || isLoading || isPerforming,
|
|
10426
|
+
title: definedLabels.nextPage,
|
|
10427
|
+
"aria-label": definedLabels.nextPage,
|
|
10360
10428
|
type: "button",
|
|
10361
10429
|
onClick: () => {
|
|
10362
|
-
|
|
10430
|
+
onPageChange(numberCurrentPage + 1);
|
|
10363
10431
|
},
|
|
10364
10432
|
icon: "Next",
|
|
10365
10433
|
iconSize: "Sm"
|
|
@@ -10370,10 +10438,11 @@ const NoMemoPagination = ({
|
|
|
10370
10438
|
{
|
|
10371
10439
|
variant: "icon-primary",
|
|
10372
10440
|
type: "button",
|
|
10373
|
-
|
|
10374
|
-
|
|
10441
|
+
title: definedLabels.lastPage,
|
|
10442
|
+
"aria-label": definedLabels.lastPage,
|
|
10443
|
+
disabled: disabled || numberCurrentPage >= numberPageCount || isLoading || isPerforming,
|
|
10375
10444
|
onClick: () => {
|
|
10376
|
-
|
|
10445
|
+
onPageChange(numberPageCount);
|
|
10377
10446
|
},
|
|
10378
10447
|
icon: "Last",
|
|
10379
10448
|
iconSize: "Sm"
|
|
@@ -10388,7 +10457,7 @@ const NoMemoPagination = ({
|
|
|
10388
10457
|
className: "pagination__deleteFiltersButton",
|
|
10389
10458
|
onClick: onDeleteFilters,
|
|
10390
10459
|
children: [
|
|
10391
|
-
breakPoint > 3 && /* @__PURE__ */ jsx(Box, { as: "span", className: "pagination__deleteLabels", children:
|
|
10460
|
+
breakPoint > 3 && /* @__PURE__ */ jsx(Box, { as: "span", className: "pagination__deleteLabels", children: definedLabels.deleteFilters }),
|
|
10392
10461
|
/* @__PURE__ */ jsx(
|
|
10393
10462
|
Box,
|
|
10394
10463
|
{
|
|
@@ -10403,7 +10472,8 @@ const NoMemoPagination = ({
|
|
|
10403
10472
|
!hideRefreshButton && /* @__PURE__ */ jsx(
|
|
10404
10473
|
IconButton,
|
|
10405
10474
|
{
|
|
10406
|
-
|
|
10475
|
+
title: definedLabels.refresh,
|
|
10476
|
+
"aria-label": definedLabels.refresh,
|
|
10407
10477
|
onClick: () => onRefresh(numberCurrentPage),
|
|
10408
10478
|
icon: "Refresh",
|
|
10409
10479
|
iconSize: "Md",
|
|
@@ -10678,9 +10748,7 @@ const HamburguerMenu = ({
|
|
|
10678
10748
|
const bounding = document.querySelector(container).getBoundingClientRect();
|
|
10679
10749
|
if (!hamburguerRef || bounding.height === 0)
|
|
10680
10750
|
return;
|
|
10681
|
-
const hamburguerHeight =
|
|
10682
|
-
hamburguerRef.querySelector(".hamburguerIcon").clientHeight
|
|
10683
|
-
);
|
|
10751
|
+
const hamburguerHeight = 40;
|
|
10684
10752
|
const hamburguerTop = bounding.top + bounding.height / 2 - hamburguerHeight / 2 + window.scrollY;
|
|
10685
10753
|
const shouldOpenBelow = bounding.top <= window.innerHeight / 3;
|
|
10686
10754
|
const menuTop = shouldOpenBelow ? hamburguerTop + hamburguerHeight + 10 : 10;
|
|
@@ -10728,7 +10796,7 @@ const HamburguerMenu = ({
|
|
|
10728
10796
|
Box,
|
|
10729
10797
|
{
|
|
10730
10798
|
id: "HamburguerIconWrapper",
|
|
10731
|
-
className:
|
|
10799
|
+
className: `HamburguerIconWrapper ${forceVisibility ? "forced" : ""}`,
|
|
10732
10800
|
ref: setHamburguerRef,
|
|
10733
10801
|
as: "aside",
|
|
10734
10802
|
"aria-label": window.LBL_OPTIONS_VAR,
|
|
@@ -11915,5 +11983,5 @@ const _FiltersStore = class _FiltersStore {
|
|
|
11915
11983
|
__publicField(_FiltersStore, "instance", new _FiltersStore());
|
|
11916
11984
|
let FiltersStore = _FiltersStore;
|
|
11917
11985
|
|
|
11918
|
-
export { Accordion, AccordionAside, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, Aside, AsideLoader, AsidePanel, AutoEllipsis, Autocomplete, AutocompleteController, AutogrowTextarea, AutoscrollContainer, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, ChatController, ChatMessage, Checkbox$1 as Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FloatingChatController, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, IconButton, IconInput, IconsList, Label, LabelBox, LinearLoader, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, Modal, NumberInput, Overlay, Pagination, Parameter, ParameterRender, Parameters, ParametersGroup, ParametersStore, ParametersTable, ProgressBar, RequiredMark, ScreenLocker, ShowResponsive, SimpleButton, SortableList, SortableListItem, Tab, Tabs, TabsContent, TabsController, TabsList, Templater, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, UploadHandler, Uploader, WaiTypeAhead, getBase64FromBlob, getBase64FromFile, getFieldErrorStyles, getFieldTouchedStyles, getFileExtension, importComponent, isFavoriteIcon, isImage, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
|
|
11986
|
+
export { Accordion, AccordionAside, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, Aside, AsideLoader, AsidePanel, AutoEllipsis, Autocomplete, AutocompleteController, AutogrowTextarea, AutoscrollContainer, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, ChatController, ChatMessage, Checkbox$1 as Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FloatingChatController, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, IconButton, IconInput, IconsList, Label, LabelBox, LinearLoader, LinearSpinnerLock, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, Modal, NumberInput, Overlay, Pagination, Parameter, ParameterRender, Parameters, ParametersGroup, ParametersStore, ParametersTable, ProgressBar, RequiredMark, ScreenLocker, ShowResponsive, SimpleButton, SortableList, SortableListItem, Tab, Tabs, TabsContent, TabsController, TabsList, Templater, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, UploadHandler, Uploader, WaiTypeAhead, getBase64FromBlob, getBase64FromFile, getFieldErrorStyles, getFieldTouchedStyles, getFileExtension, importComponent, isFavoriteIcon, isImage, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
|
|
11919
11987
|
//# sourceMappingURL=index.js.map
|