@oliasoft-open-source/react-ui-library 4.6.7-beta-1 → 4.6.8
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/404.html +1 -0
- package/dist/assets/{index-2LJjuVRB.css → index-ChHypG1u.css} +50 -49
- package/dist/assets/{index-21EwET8E.js → index-KqPTwgKR.js} +29 -29
- package/dist/global.css +50 -49
- package/dist/index.d.ts +0 -22
- package/dist/index.html +1 -1
- package/dist/index.js +42 -217
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/{Color-6VNJS4EI-hQgbfk1_.js → Color-6VNJS4EI-_XHGQV47.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-NNNQARDV-qVZ0Szzp.js → DocsRenderer-NNNQARDV-cfGqinew.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-V3YHNWJZ-EVkXusH9.js → WithTooltip-V3YHNWJZ-ZTQBXxNR.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-Je6TgVbI.js → accordion.stories-HoJi9xXG.js} +1 -1
- package/dist/storybook/assets/{actions-mOcj9IlF.js → actions-Cy7Captj.js} +1 -1
- package/dist/storybook/assets/actions-ZOs51LZe.css +1 -0
- package/dist/storybook/assets/{actions.stories-ER0_rAT3.js → actions.stories-mmLprOrc.js} +1 -1
- package/dist/storybook/assets/{afe.stories-yjkRmCqu.js → afe.stories-nIkUZsMw.js} +1 -1
- package/dist/storybook/assets/{blowout.stories-fjMitjld.js → blowout.stories-K5R8kVct.js} +1 -1
- package/dist/storybook/assets/{buttons-and-links-Htqi06fE.js → buttons-and-links-Jylkt3nD.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-rv-r7qUR.js → casing-loads.stories-46CXI4aZ.js} +1 -1
- package/dist/storybook/assets/{cell.stories-ntUcZ9Z2.js → cell.stories-C1tveY5w.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-XUXGp0n7.js → chunk-HLWAVYOI-FrcsKrLW.js} +1 -1
- package/dist/storybook/assets/{color-l-jFB8qa.js → color-uzmk99ma.js} +1 -1
- package/dist/storybook/assets/{drawer.stories-XWMoCncm.js → drawer.stories-AeAkrCFI.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-lKF1ABXX.js → file-input.stories-8w1taUk6.js} +1 -1
- package/dist/storybook/assets/{footer.stories-txHcy_rz.js → footer.stories-DPV_HAIB.js} +1 -1
- package/dist/storybook/assets/{form.stories-AikCzsZc.js → form.stories-T72WR2v0.js} +1 -1
- package/dist/storybook/assets/{formation.stories-WYUKooZj.js → formation.stories-xkw070py.js} +1 -1
- package/dist/storybook/assets/{formatter-SWP5E3XI-2jpDZ32o.js → formatter-SWP5E3XI-3x_m0MHq.js} +1 -1
- package/dist/storybook/assets/{iframe-afwDQcyf.js → iframe-fXetAaxg.js} +2 -2
- package/dist/storybook/assets/{index-WQN43Pdc.js → index-_9baus51.js} +5 -5
- package/dist/storybook/assets/{input-group.stories-gJFYuvVb.js → input-group.stories-ZCPg9gHm.js} +1 -1
- package/dist/storybook/assets/{input-validation-1C25NF0D.js → input-validation-y9wnVCSF.js} +1 -1
- package/dist/storybook/assets/{inputs-dvl3Vxzi.js → inputs-32MVspNo.js} +1 -1
- package/dist/storybook/assets/{layout-forms-aQDJspiu.js → layout-forms-U3Za-S0I.js} +1 -1
- package/dist/storybook/assets/{layout-general-glx7j38t.js → layout-general-5TGR9rlf.js} +1 -1
- package/dist/storybook/assets/{list-PShi-3TE.js → list-eMd89hZr.js} +1 -1
- package/dist/storybook/assets/{list.stories-TLnvjaYU.js → list.stories-5vI2E33l.js} +1 -1
- package/dist/storybook/assets/{list.stories-data-Qc3oehAh.js → list.stories-data-gXsTw-L1.js} +1 -1
- package/dist/storybook/assets/{menu.stories-ppWN2JgO.js → menu.stories-KNXjeX3D.js} +1 -1
- package/dist/storybook/assets/{meta-content-lUynpOsR.js → meta-content-OgN1pVSn.js} +1 -1
- package/dist/storybook/assets/{modal.stories-DDey1uF7.js → modal.stories-ecMxj8hU.js} +1 -1
- package/dist/storybook/assets/{number-input.stories-AU1jlL6D.js → number-input.stories-xWiHlnuR.js} +1 -1
- package/dist/storybook/assets/{option-dropdown.stories-n7CDZevX.js → option-dropdown.stories-fgx84uaW.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-nDPUVOhE.js → padding-and-spacing-1V9JCfVv.js} +1 -1
- package/dist/storybook/assets/{page.stories-UQlnuZid.js → page.stories-hiXNhyVn.js} +1 -1
- package/dist/storybook/assets/{pagination-tnyyuMkB.js → pagination-tAcEoG5j.js} +1 -1
- package/dist/storybook/assets/{pagination.stories-c7jbEB_j.js → pagination.stories-BTlZGHei.js} +1 -1
- package/dist/storybook/assets/{popover.stories-1JvlWYFM.js → popover.stories-kWytlrCP.js} +1 -1
- package/dist/storybook/assets/{preview-8iAUReLe.js → preview-I81TAmqM.js} +1 -1
- package/dist/storybook/assets/{preview-NgqKh_bR.js → preview-u5AhJYxz.js} +2 -2
- package/dist/storybook/assets/{projects.stories-epAPUAg1.js → projects.stories-Um9RxRPP.js} +1 -1
- package/dist/storybook/assets/{reservoirs.stories-TKohSiCU.js → reservoirs.stories-NvfXEnD5.js} +1 -1
- package/dist/storybook/assets/{rich-text-input.stories-EbjoMb2s.js → rich-text-input.stories-C2MT1NxQ.js} +1 -1
- package/dist/storybook/assets/{row.stories-s3mq4p3b.js → row.stories-0vvHxyvF.js} +1 -1
- package/dist/storybook/assets/{select-DZdWUrCW.js → select-rLnO-bZV.js} +1 -1
- package/dist/storybook/assets/{select.stories-QOxuHSmz.js → select.stories-c55YtO23.js} +1 -1
- package/dist/storybook/assets/{site.stories-Qfujz1ST.js → site.stories-7D7SQQg5.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-B5GMVT5T-sSZfeghu.js → syntaxhighlighter-B5GMVT5T-NrCkP84H.js} +1 -1
- package/dist/storybook/assets/{table-5HZEOUW_.js → table--nqv8IDq.js} +1 -1
- package/dist/storybook/assets/{table.stories-wP0SdJzJ.js → table.stories-O7tV23uw.js} +1 -1
- package/dist/storybook/assets/{table.stories-data-NfE_v-gH.js → table.stories-data-yhSjAoox.js} +1 -1
- package/dist/storybook/assets/{textarea-TSoWqDT8.js → textarea-gwm6gdQO.js} +1 -1
- package/dist/storybook/assets/{textarea.stories-w6XYooLd.js → textarea.stories-eOTtHmL4.js} +1 -1
- package/dist/storybook/assets/{title.stories-CDtRZqWr.js → title.stories-qu_is7wC.js} +1 -1
- package/dist/storybook/assets/{tooltip.test-case.stories-g9fe1-Ut.js → tooltip.test-case.stories-omlRb7-I.js} +1 -1
- package/dist/storybook/assets/{top-bar-ywJJBf-H.js → top-bar-_mjkSOvn.js} +1 -1
- package/dist/storybook/assets/{top-bar.stories-KkBPu_h3.js → top-bar.stories-hLq3tLY-.js} +1 -1
- package/dist/storybook/assets/{top-bar.testcase.stories-RJkl6c8Z.js → top-bar.testcase.stories-CIYqVCVB.js} +1 -1
- package/dist/storybook/assets/{tree.stories-UiERA8eJ.js → tree.stories-piq-HVR4.js} +1 -1
- package/dist/storybook/assets/{unit-input.stories-NxlXJaPc.js → unit-input.stories-0xZHxkeM.js} +1 -1
- package/dist/storybook/assets/{unit-table.stories-M8TmG1IT.js → unit-table.stories-19SAMwbG.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +1 -1
- package/dist/storybook/assets/actions-W12osUP0.css +0 -1
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import * as PropTypes from "prop-types";
|
|
|
11
11
|
import PropTypes__default from "prop-types";
|
|
12
12
|
import ReactDOM, { createPortal, unstable_batchedUpdates, render } from "react-dom";
|
|
13
13
|
import _$1, { set, get as get$2, isString as isString$3, isNumber as isNumber$1, isBoolean as isBoolean$2, isFunction as isFunction$3, isEmpty, isArray as isArray$1, toNumber, debounce as debounce$2, isObject as isObject$5, isObjectLike, has as has$1, isEqual as isEqual$4 } from "lodash";
|
|
14
|
-
import { roundToFixed, validateNumber, cleanNumStr, unitFromQuantity, isValueWithUnit, withUnit, convertSamePrecision, getValue as getValue$1, getUnit, KNOWN_UNITS, split as split$1, checkAndCleanDecimalComma, label as label$b, altUnitsList, getUnitsForQuantity, convertAndGetValue, isScientificStringNum, roundToPrecision
|
|
14
|
+
import { roundToFixed, validateNumber, cleanNumStr, unitFromQuantity, isValueWithUnit, withUnit, convertSamePrecision, getValue as getValue$1, getUnit, KNOWN_UNITS, split as split$1, checkAndCleanDecimalComma, label as label$b, altUnitsList, getUnitsForQuantity, convertAndGetValue, isScientificStringNum, roundToPrecision } from "@oliasoft-open-source/units";
|
|
15
15
|
import { isValueWithUnit as isValueWithUnit$1 } from "@oliasoft-open-source/units/dist/units";
|
|
16
16
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
17
17
|
function getDefaultExportFromCjs(x2) {
|
|
@@ -3811,7 +3811,7 @@ const Tooltip = ({
|
|
|
3811
3811
|
flex = "none",
|
|
3812
3812
|
forceOpen = false
|
|
3813
3813
|
}) => {
|
|
3814
|
-
const visible = enabled && (isValidElement(text2) || typeof text2 === "string" && text2.length > 0);
|
|
3814
|
+
const visible = enabled && (isValidElement(text2) || typeof text2 === "string" && text2.length > 0 || typeof text2 === "number");
|
|
3815
3815
|
const [isOver, hoverProps, forceClose] = useHover({
|
|
3816
3816
|
delayEnter: 100,
|
|
3817
3817
|
delayLeave: 0
|
|
@@ -4219,34 +4219,34 @@ const styles$M = {
|
|
|
4219
4219
|
actionComponentContainer,
|
|
4220
4220
|
active: active$7
|
|
4221
4221
|
};
|
|
4222
|
-
const wrapper$4 = "
|
|
4223
|
-
const layer$1 = "
|
|
4224
|
-
const layerContainer$1 = "
|
|
4225
|
-
const nested = "
|
|
4226
|
-
const fileInput$1 = "
|
|
4227
|
-
const trigger$2 = "
|
|
4228
|
-
const middleAlignedInline = "
|
|
4229
|
-
const heading$5 = "
|
|
4230
|
-
const headingIcon = "
|
|
4231
|
-
const option$1 = "
|
|
4232
|
-
const active$6 = "
|
|
4233
|
-
const selected$1 = "
|
|
4234
|
-
const optionContent$1 = "
|
|
4235
|
-
const inline$4 = "
|
|
4236
|
-
const icon$4 = "
|
|
4237
|
-
const check$1 = "
|
|
4238
|
-
const text$3 = "
|
|
4239
|
-
const label$a = "
|
|
4240
|
-
const description = "
|
|
4241
|
-
const arrow$1 = "
|
|
4242
|
-
const divider$1 = "
|
|
4243
|
-
const deprecatedSemanticIcon = "
|
|
4244
|
-
const disabled$8 = "
|
|
4245
|
-
const buttonLabel = "
|
|
4246
|
-
const buttonCaret = "
|
|
4247
|
-
const component = "
|
|
4248
|
-
const right$7 = "
|
|
4249
|
-
const actions$1 = "
|
|
4222
|
+
const wrapper$4 = "_wrapper_1iw97_1";
|
|
4223
|
+
const layer$1 = "_layer_1iw97_5";
|
|
4224
|
+
const layerContainer$1 = "_layerContainer_1iw97_8";
|
|
4225
|
+
const nested = "_nested_1iw97_24";
|
|
4226
|
+
const fileInput$1 = "_fileInput_1iw97_36";
|
|
4227
|
+
const trigger$2 = "_trigger_1iw97_41";
|
|
4228
|
+
const middleAlignedInline = "_middleAlignedInline_1iw97_50";
|
|
4229
|
+
const heading$5 = "_heading_1iw97_56";
|
|
4230
|
+
const headingIcon = "_headingIcon_1iw97_62";
|
|
4231
|
+
const option$1 = "_option_1iw97_74";
|
|
4232
|
+
const active$6 = "_active_1iw97_93";
|
|
4233
|
+
const selected$1 = "_selected_1iw97_98";
|
|
4234
|
+
const optionContent$1 = "_optionContent_1iw97_104";
|
|
4235
|
+
const inline$4 = "_inline_1iw97_108";
|
|
4236
|
+
const icon$4 = "_icon_1iw97_113";
|
|
4237
|
+
const check$1 = "_check_1iw97_114";
|
|
4238
|
+
const text$3 = "_text_1iw97_136";
|
|
4239
|
+
const label$a = "_label_1iw97_141";
|
|
4240
|
+
const description = "_description_1iw97_152";
|
|
4241
|
+
const arrow$1 = "_arrow_1iw97_156";
|
|
4242
|
+
const divider$1 = "_divider_1iw97_160";
|
|
4243
|
+
const deprecatedSemanticIcon = "_deprecatedSemanticIcon_1iw97_164";
|
|
4244
|
+
const disabled$8 = "_disabled_1iw97_168";
|
|
4245
|
+
const buttonLabel = "_buttonLabel_1iw97_173";
|
|
4246
|
+
const buttonCaret = "_buttonCaret_1iw97_179";
|
|
4247
|
+
const component = "_component_1iw97_183";
|
|
4248
|
+
const right$7 = "_right_1iw97_189";
|
|
4249
|
+
const actions$1 = "_actions_1iw97_194";
|
|
4250
4250
|
const styles$L = {
|
|
4251
4251
|
wrapper: wrapper$4,
|
|
4252
4252
|
layer: layer$1,
|
|
@@ -4833,7 +4833,7 @@ const ContextMenu = ({
|
|
|
4833
4833
|
path,
|
|
4834
4834
|
groupOrder,
|
|
4835
4835
|
overflowContainer: true,
|
|
4836
|
-
maxHeight:
|
|
4836
|
+
maxHeight: void 0,
|
|
4837
4837
|
testId
|
|
4838
4838
|
});
|
|
4839
4839
|
const isDisabled = disabled2 || isMenuEmpty(menu2) || disabledContext;
|
|
@@ -55281,23 +55281,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
55281
55281
|
}
|
|
55282
55282
|
var _default = Handle;
|
|
55283
55283
|
default_1 = Handle$1.default = _default;
|
|
55284
|
-
const SliderTooltip = ({ text: text2 }) => {
|
|
55285
|
-
return /* @__PURE__ */ jsx(
|
|
55286
|
-
TooltipLayer,
|
|
55287
|
-
{
|
|
55288
|
-
text: text2,
|
|
55289
|
-
layerProps: {
|
|
55290
|
-
style: {
|
|
55291
|
-
whiteSpace: "nowrap",
|
|
55292
|
-
position: "fixed",
|
|
55293
|
-
transform: "translate(-50%, -100%)",
|
|
55294
|
-
marginTop: -15,
|
|
55295
|
-
marginLeft: 5
|
|
55296
|
-
}
|
|
55297
|
-
}
|
|
55298
|
-
}
|
|
55299
|
-
);
|
|
55300
|
-
};
|
|
55301
55284
|
const container = "_container_1a936_1";
|
|
55302
55285
|
const small$2 = "_small_1a936_7";
|
|
55303
55286
|
const hasMarks = "_hasMarks_1a936_10";
|
|
@@ -55379,6 +55362,14 @@ const Slider = ({
|
|
|
55379
55362
|
icon: IconType.FAST_FORWARD
|
|
55380
55363
|
}
|
|
55381
55364
|
) });
|
|
55365
|
+
const handleRender = (node2, handleProps) => {
|
|
55366
|
+
const isTooltipVisible = showTooltip && handleProps.dragging;
|
|
55367
|
+
return (
|
|
55368
|
+
// TODO: revisit - fix handle warning
|
|
55369
|
+
// @ts-ignore: revisit - fix handle warning
|
|
55370
|
+
/* @__PURE__ */ jsx(default_1, { ...node2.props, ...handleProps, children: isTooltipVisible && /* @__PURE__ */ jsx(Tooltip, { display: "block", text: tooltipFormatter(value), forceOpen: true, children: /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0 } }) }) })
|
|
55371
|
+
);
|
|
55372
|
+
};
|
|
55382
55373
|
return /* @__PURE__ */ jsxs(
|
|
55383
55374
|
"div",
|
|
55384
55375
|
{
|
|
@@ -55391,10 +55382,10 @@ const Slider = ({
|
|
|
55391
55382
|
style: vertical2.enabled ? { width: vertical2.width, height: vertical2.height } : { width: width2 },
|
|
55392
55383
|
children: [
|
|
55393
55384
|
showArrows && (vertical2.enabled ? /* @__PURE__ */ jsx(ButtonMax, {}) : /* @__PURE__ */ jsx(ButtonMin, {})),
|
|
55394
|
-
|
|
55385
|
+
/* @__PURE__ */ jsx(
|
|
55395
55386
|
Slider$1,
|
|
55396
55387
|
{
|
|
55397
|
-
range:
|
|
55388
|
+
range: range2,
|
|
55398
55389
|
allowCross: false,
|
|
55399
55390
|
className: cx$2(
|
|
55400
55391
|
(disabled2 || disabledContext) && styles$c.rcSliderDisabled,
|
|
@@ -55408,24 +55399,7 @@ const Slider = ({
|
|
|
55408
55399
|
onChange: (v2) => onChangeValue(v2),
|
|
55409
55400
|
disabled: disabled2 || disabledContext,
|
|
55410
55401
|
vertical: vertical2.enabled,
|
|
55411
|
-
|
|
55412
|
-
}
|
|
55413
|
-
) : /* @__PURE__ */ jsx(
|
|
55414
|
-
Slider$1,
|
|
55415
|
-
{
|
|
55416
|
-
className: cx$2(
|
|
55417
|
-
(disabled2 || disabledContext) && styles$c.rcSliderDisabled,
|
|
55418
|
-
showArrows && styles$c.hasArrows
|
|
55419
|
-
),
|
|
55420
|
-
value,
|
|
55421
|
-
max,
|
|
55422
|
-
min,
|
|
55423
|
-
step,
|
|
55424
|
-
marks: formattedMarks,
|
|
55425
|
-
onChange: (v2) => onChangeValue(v2),
|
|
55426
|
-
disabled: disabled2 || disabledContext,
|
|
55427
|
-
vertical: vertical2.enabled,
|
|
55428
|
-
handle: showTooltip ? ({ index: index2, value: value2, dragging, ...handleProps }) => /* @__PURE__ */ jsx(default_1, { value: value2, ...handleProps, children: dragging && /* @__PURE__ */ jsx(SliderTooltip, { text: tooltipFormatter(value2) }) }, index2) : void 0
|
|
55402
|
+
handleRender
|
|
55429
55403
|
}
|
|
55430
55404
|
),
|
|
55431
55405
|
showArrows && (vertical2.enabled ? /* @__PURE__ */ jsx(ButtonMin, {}) : /* @__PURE__ */ jsx(ButtonMax, {})),
|
|
@@ -70856,154 +70830,6 @@ const UnitTable = ({
|
|
|
70856
70830
|
}
|
|
70857
70831
|
);
|
|
70858
70832
|
};
|
|
70859
|
-
const INTERVAL_TIME = 250;
|
|
70860
|
-
const REQUEST_TIME = 4e4;
|
|
70861
|
-
const FINISH_INTERVALS = 20;
|
|
70862
|
-
const FINISH_TIME = 500;
|
|
70863
|
-
const SmartUploadModal = ({
|
|
70864
|
-
visible,
|
|
70865
|
-
prompt,
|
|
70866
|
-
onCloseModal,
|
|
70867
|
-
onUpload,
|
|
70868
|
-
onComplete,
|
|
70869
|
-
onFailed,
|
|
70870
|
-
onError: onError3,
|
|
70871
|
-
width: width2,
|
|
70872
|
-
heading: heading2,
|
|
70873
|
-
dialogText,
|
|
70874
|
-
fileInputText,
|
|
70875
|
-
fileInputPlaceholder,
|
|
70876
|
-
uploadText,
|
|
70877
|
-
cancelText,
|
|
70878
|
-
testId
|
|
70879
|
-
}) => {
|
|
70880
|
-
const [file, setFile] = useState(void 0);
|
|
70881
|
-
const [isFetching, setFetching] = useState(false);
|
|
70882
|
-
const [requestTimer, setRequestTimer] = useState(0);
|
|
70883
|
-
let timer = 0;
|
|
70884
|
-
const updateTimer = () => {
|
|
70885
|
-
const newTime = timer + INTERVAL_TIME;
|
|
70886
|
-
timer = newTime;
|
|
70887
|
-
setRequestTimer(timer);
|
|
70888
|
-
};
|
|
70889
|
-
const finishTimer = (deltaTime) => {
|
|
70890
|
-
let newTime = timer + deltaTime;
|
|
70891
|
-
if (newTime >= 0.99 * REQUEST_TIME) {
|
|
70892
|
-
newTime = REQUEST_TIME;
|
|
70893
|
-
}
|
|
70894
|
-
timer = newTime;
|
|
70895
|
-
setRequestTimer(timer);
|
|
70896
|
-
};
|
|
70897
|
-
useEffect(() => {
|
|
70898
|
-
setFile(void 0);
|
|
70899
|
-
}, [visible]);
|
|
70900
|
-
const handleFileChange = (event) => {
|
|
70901
|
-
if (!event.target.value)
|
|
70902
|
-
return;
|
|
70903
|
-
setFile(event.target.value);
|
|
70904
|
-
};
|
|
70905
|
-
const handleUpload = async () => {
|
|
70906
|
-
setRequestTimer(0);
|
|
70907
|
-
const id2 = setInterval(updateTimer, INTERVAL_TIME);
|
|
70908
|
-
try {
|
|
70909
|
-
if (!file)
|
|
70910
|
-
return;
|
|
70911
|
-
setFetching(true);
|
|
70912
|
-
const data = await onUpload(prompt, file);
|
|
70913
|
-
if (!visible)
|
|
70914
|
-
return;
|
|
70915
|
-
if (data) {
|
|
70916
|
-
clearInterval(id2);
|
|
70917
|
-
const id22 = setInterval(
|
|
70918
|
-
finishTimer,
|
|
70919
|
-
FINISH_TIME / FINISH_INTERVALS,
|
|
70920
|
-
(REQUEST_TIME - timer) / (FINISH_INTERVALS - 1)
|
|
70921
|
-
);
|
|
70922
|
-
setTimeout(() => {
|
|
70923
|
-
onComplete(data);
|
|
70924
|
-
clearInterval(id22);
|
|
70925
|
-
setFetching(false);
|
|
70926
|
-
}, FINISH_TIME);
|
|
70927
|
-
} else {
|
|
70928
|
-
onFailed == null ? void 0 : onFailed();
|
|
70929
|
-
setFetching(false);
|
|
70930
|
-
}
|
|
70931
|
-
} catch (error2) {
|
|
70932
|
-
onError3 == null ? void 0 : onError3(error2);
|
|
70933
|
-
setFetching(false);
|
|
70934
|
-
} finally {
|
|
70935
|
-
clearInterval(id2);
|
|
70936
|
-
}
|
|
70937
|
-
};
|
|
70938
|
-
const onConfirm = () => {
|
|
70939
|
-
handleUpload();
|
|
70940
|
-
};
|
|
70941
|
-
const onClose = () => {
|
|
70942
|
-
onCloseModal();
|
|
70943
|
-
};
|
|
70944
|
-
const content2 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
70945
|
-
/* @__PURE__ */ jsx(Text, { children: dialogText || "Upload file and extract data using a LLM" }),
|
|
70946
|
-
/* @__PURE__ */ jsx(Spacer, {}),
|
|
70947
|
-
/* @__PURE__ */ jsx(
|
|
70948
|
-
FileInput,
|
|
70949
|
-
{
|
|
70950
|
-
placeholder: fileInputPlaceholder || "No file",
|
|
70951
|
-
label: fileInputText || "Select",
|
|
70952
|
-
file: file || void 0,
|
|
70953
|
-
onChange: handleFileChange,
|
|
70954
|
-
testId: `${testId}-file-input`,
|
|
70955
|
-
accept: "image/*"
|
|
70956
|
-
}
|
|
70957
|
-
),
|
|
70958
|
-
isFetching && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
70959
|
-
/* @__PURE__ */ jsx(Spacer, {}),
|
|
70960
|
-
/* @__PURE__ */ jsx(
|
|
70961
|
-
ProgressBar$1,
|
|
70962
|
-
{
|
|
70963
|
-
percentage: roundByMagnitudeToFixed(
|
|
70964
|
-
100 * requestTimer / REQUEST_TIME,
|
|
70965
|
-
3
|
|
70966
|
-
)
|
|
70967
|
-
}
|
|
70968
|
-
)
|
|
70969
|
-
] })
|
|
70970
|
-
] });
|
|
70971
|
-
const footer2 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
70972
|
-
/* @__PURE__ */ jsx(
|
|
70973
|
-
Button$1,
|
|
70974
|
-
{
|
|
70975
|
-
label: uploadText || "Upload",
|
|
70976
|
-
colored: true,
|
|
70977
|
-
onClick: onConfirm,
|
|
70978
|
-
disabled: !file || isFetching,
|
|
70979
|
-
testId: `${testId}-button-upload`
|
|
70980
|
-
}
|
|
70981
|
-
),
|
|
70982
|
-
/* @__PURE__ */ jsx(
|
|
70983
|
-
Button$1,
|
|
70984
|
-
{
|
|
70985
|
-
label: cancelText || "Cancel",
|
|
70986
|
-
onClick: onClose,
|
|
70987
|
-
testId: `${testId}-button-cancel`
|
|
70988
|
-
}
|
|
70989
|
-
)
|
|
70990
|
-
] });
|
|
70991
|
-
useKeyboardEvent("Escape", () => onClose());
|
|
70992
|
-
return /* @__PURE__ */ jsx(Modal, { visible, centered: true, children: /* @__PURE__ */ jsx(
|
|
70993
|
-
Dialog,
|
|
70994
|
-
{
|
|
70995
|
-
dialog: {
|
|
70996
|
-
scroll: true,
|
|
70997
|
-
heading: heading2 || "Smart Upload",
|
|
70998
|
-
content: content2,
|
|
70999
|
-
footer: footer2,
|
|
71000
|
-
onClose,
|
|
71001
|
-
width: width2 || 350,
|
|
71002
|
-
testId
|
|
71003
|
-
}
|
|
71004
|
-
}
|
|
71005
|
-
) });
|
|
71006
|
-
};
|
|
71007
70833
|
export {
|
|
71008
70834
|
Accordion,
|
|
71009
70835
|
AccordionWithDefaultToggle,
|
|
@@ -71068,7 +70894,6 @@ export {
|
|
|
71068
70894
|
Select,
|
|
71069
70895
|
SideBar,
|
|
71070
70896
|
Slider,
|
|
71071
|
-
SmartUploadModal,
|
|
71072
70897
|
Spacer,
|
|
71073
70898
|
Spinner$1 as Spinner,
|
|
71074
70899
|
Table,
|