@oliasoft-open-source/react-ui-library 4.6.7-beta-1 → 4.6.7
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/global.css +50 -49
- package/dist/index.d.ts +0 -22
- package/dist/index.js +30 -179
- package/dist/index.js.map +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +1 -1
package/dist/404.html
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><head><title>React UI Library</title><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1" user-scalable="no"><meta name="apple-mobile-web-app-capable" content="yes"><script type="module" crossorigin src="/react-ui-library/assets/index-21EwET8E.js"></script><link rel="stylesheet" crossorigin href="/react-ui-library/assets/index-2LJjuVRB.css"></head><body><div id="content"></div></body>
|
package/dist/global.css
CHANGED
|
@@ -1720,17 +1720,17 @@ html[data-theme='dark'] {
|
|
|
1720
1720
|
._actionComponentContainer_1nid8_11._active_1nid8_33 {
|
|
1721
1721
|
color: var(--color-text-primary-active);
|
|
1722
1722
|
}
|
|
1723
|
-
.
|
|
1723
|
+
._wrapper_1iw97_1 {
|
|
1724
1724
|
display: inline-flex;
|
|
1725
1725
|
max-width: 100%;
|
|
1726
1726
|
}
|
|
1727
|
-
.
|
|
1727
|
+
._layer_1iw97_5 ._wrapper_1iw97_1 {
|
|
1728
1728
|
width: 100%;
|
|
1729
1729
|
}
|
|
1730
|
-
.
|
|
1730
|
+
._layerContainer_1iw97_8 {
|
|
1731
1731
|
z-index: var(--zindex-dropdown);
|
|
1732
1732
|
}
|
|
1733
|
-
.
|
|
1733
|
+
._layer_1iw97_5 {
|
|
1734
1734
|
border: 1px solid var(--color-border);
|
|
1735
1735
|
border-radius: var(--border-radius);
|
|
1736
1736
|
overflow: hidden;
|
|
@@ -1741,98 +1741,99 @@ html[data-theme='dark'] {
|
|
|
1741
1741
|
max-width: 30em;
|
|
1742
1742
|
position: relative;
|
|
1743
1743
|
overflow-y: auto;
|
|
1744
|
+
max-height: 40vh;
|
|
1744
1745
|
}
|
|
1745
|
-
.
|
|
1746
|
+
._layer_1iw97_5._nested_1iw97_24 {
|
|
1746
1747
|
margin: -1px 2px;
|
|
1747
1748
|
}
|
|
1748
|
-
.
|
|
1749
|
+
._layer_1iw97_5 ul {
|
|
1749
1750
|
margin: 0;
|
|
1750
1751
|
padding: 0;
|
|
1751
1752
|
list-style-type: none;
|
|
1752
1753
|
}
|
|
1753
|
-
.
|
|
1754
|
+
._layer_1iw97_5 ul li {
|
|
1754
1755
|
list-style: none;
|
|
1755
1756
|
display: block;
|
|
1756
1757
|
}
|
|
1757
|
-
.
|
|
1758
|
+
._fileInput_1iw97_36 {
|
|
1758
1759
|
opacity: 0;
|
|
1759
1760
|
position: absolute;
|
|
1760
1761
|
inset: 0;
|
|
1761
1762
|
}
|
|
1762
|
-
.
|
|
1763
|
+
._trigger_1iw97_41 {
|
|
1763
1764
|
display: inline-flex;
|
|
1764
1765
|
align-items: center;
|
|
1765
1766
|
cursor: pointer;
|
|
1766
1767
|
max-width: 100%;
|
|
1767
1768
|
}
|
|
1768
|
-
.
|
|
1769
|
+
._layer_1iw97_5 ._trigger_1iw97_41 {
|
|
1769
1770
|
width: 100%;
|
|
1770
1771
|
}
|
|
1771
|
-
.
|
|
1772
|
+
._middleAlignedInline_1iw97_50 {
|
|
1772
1773
|
display: flex;
|
|
1773
1774
|
align-items: center;
|
|
1774
1775
|
overflow: hidden;
|
|
1775
1776
|
width: 100%;
|
|
1776
1777
|
}
|
|
1777
|
-
.
|
|
1778
|
+
._heading_1iw97_56 {
|
|
1778
1779
|
color: var(--color-text-muted);
|
|
1779
1780
|
letter-spacing: var(--letter-spacing-wide);
|
|
1780
1781
|
text-transform: uppercase;
|
|
1781
1782
|
font-weight: bold;
|
|
1782
1783
|
}
|
|
1783
|
-
.
|
|
1784
|
+
._heading_1iw97_56 ._headingIcon_1iw97_62 {
|
|
1784
1785
|
float: right;
|
|
1785
1786
|
}
|
|
1786
|
-
.
|
|
1787
|
+
._heading_1iw97_56 ._headingIcon_1iw97_62 svg {
|
|
1787
1788
|
color: var(--color-text-faint);
|
|
1788
1789
|
}
|
|
1789
|
-
.
|
|
1790
|
+
._heading_1iw97_56 ._headingIcon_1iw97_62:hover {
|
|
1790
1791
|
cursor: pointer;
|
|
1791
1792
|
}
|
|
1792
|
-
.
|
|
1793
|
+
._heading_1iw97_56 ._headingIcon_1iw97_62:hover svg {
|
|
1793
1794
|
color: var(--color-text-primary-hover);
|
|
1794
1795
|
}
|
|
1795
|
-
.
|
|
1796
|
+
._option_1iw97_74 {
|
|
1796
1797
|
color: inherit;
|
|
1797
1798
|
display: block;
|
|
1798
1799
|
position: relative;
|
|
1799
1800
|
}
|
|
1800
|
-
.
|
|
1801
|
-
.
|
|
1802
|
-
.
|
|
1801
|
+
._heading_1iw97_56,
|
|
1802
|
+
._option_1iw97_74,
|
|
1803
|
+
._layer_1iw97_5 ._trigger_1iw97_41 {
|
|
1803
1804
|
padding: var(--padding-input);
|
|
1804
1805
|
border: 1px solid transparent;
|
|
1805
1806
|
}
|
|
1806
|
-
.
|
|
1807
|
-
.
|
|
1807
|
+
._option_1iw97_74,
|
|
1808
|
+
._layer_1iw97_5 ._trigger_1iw97_41 {
|
|
1808
1809
|
line-height: var(--line-height);
|
|
1809
1810
|
display: flex;
|
|
1810
1811
|
align-items: flex-start;
|
|
1811
1812
|
}
|
|
1812
|
-
.
|
|
1813
|
-
.
|
|
1814
|
-
.
|
|
1815
|
-
.
|
|
1813
|
+
._option_1iw97_74:hover,
|
|
1814
|
+
._layer_1iw97_5 ._trigger_1iw97_41:hover,
|
|
1815
|
+
._option_1iw97_74._active_1iw97_93,
|
|
1816
|
+
._layer_1iw97_5 ._trigger_1iw97_41._active_1iw97_93 {
|
|
1816
1817
|
background-color: var(--color-background-listitem-hover);
|
|
1817
1818
|
cursor: pointer;
|
|
1818
1819
|
}
|
|
1819
|
-
.
|
|
1820
|
+
._option_1iw97_74._selected_1iw97_98 {
|
|
1820
1821
|
background-color: var(--color-background-listitem-active);
|
|
1821
1822
|
}
|
|
1822
|
-
.
|
|
1823
|
+
._layer_1iw97_5 ._trigger_1iw97_41 {
|
|
1823
1824
|
align-items: center;
|
|
1824
1825
|
}
|
|
1825
|
-
.
|
|
1826
|
+
._optionContent_1iw97_104 {
|
|
1826
1827
|
flex-wrap: wrap;
|
|
1827
1828
|
margin-right: auto;
|
|
1828
1829
|
}
|
|
1829
|
-
.
|
|
1830
|
+
._inline_1iw97_108 ._optionContent_1iw97_104 {
|
|
1830
1831
|
display: flex;
|
|
1831
1832
|
justify-content: space-between;
|
|
1832
1833
|
flex-grow: 1;
|
|
1833
1834
|
}
|
|
1834
|
-
.
|
|
1835
|
-
.
|
|
1835
|
+
._icon_1iw97_113,
|
|
1836
|
+
._check_1iw97_114 {
|
|
1836
1837
|
display: flex;
|
|
1837
1838
|
flex-shrink: 1;
|
|
1838
1839
|
width: var(--size-xs);
|
|
@@ -1841,78 +1842,78 @@ html[data-theme='dark'] {
|
|
|
1841
1842
|
justify-content: center;
|
|
1842
1843
|
align-items: center;
|
|
1843
1844
|
}
|
|
1844
|
-
.
|
|
1845
|
+
._icon_1iw97_113 {
|
|
1845
1846
|
margin-right: var(--padding-xs);
|
|
1846
1847
|
color: var(--color-text-primary);
|
|
1847
1848
|
}
|
|
1848
|
-
.
|
|
1849
|
+
._icon_1iw97_113:empty {
|
|
1849
1850
|
display: none;
|
|
1850
1851
|
}
|
|
1851
|
-
.
|
|
1852
|
+
._icon_1iw97_113 img {
|
|
1852
1853
|
max-height: 16px;
|
|
1853
1854
|
max-width: 16px;
|
|
1854
1855
|
width: auto;
|
|
1855
1856
|
height: auto;
|
|
1856
1857
|
}
|
|
1857
|
-
.
|
|
1858
|
+
._text_1iw97_136 {
|
|
1858
1859
|
display: inline-flex;
|
|
1859
1860
|
align-items: center;
|
|
1860
1861
|
cursor: pointer;
|
|
1861
1862
|
}
|
|
1862
|
-
.
|
|
1863
|
+
._label_1iw97_141 {
|
|
1863
1864
|
margin-right: auto;
|
|
1864
1865
|
}
|
|
1865
|
-
.
|
|
1866
|
-
.
|
|
1866
|
+
._label_1iw97_141,
|
|
1867
|
+
._heading_1iw97_56 {
|
|
1867
1868
|
max-width: 100%;
|
|
1868
1869
|
display: block;
|
|
1869
1870
|
overflow: hidden;
|
|
1870
1871
|
text-overflow: ellipsis;
|
|
1871
1872
|
white-space: nowrap;
|
|
1872
1873
|
}
|
|
1873
|
-
.
|
|
1874
|
+
._description_1iw97_152 {
|
|
1874
1875
|
color: #999;
|
|
1875
1876
|
display: block;
|
|
1876
1877
|
}
|
|
1877
|
-
.
|
|
1878
|
+
._arrow_1iw97_156 {
|
|
1878
1879
|
margin-left: var(--padding-xxs);
|
|
1879
1880
|
display: flex;
|
|
1880
1881
|
}
|
|
1881
|
-
.
|
|
1882
|
+
._divider_1iw97_160 {
|
|
1882
1883
|
border: 0;
|
|
1883
1884
|
border-top: 1px solid var(--color-border);
|
|
1884
1885
|
}
|
|
1885
|
-
.
|
|
1886
|
+
._deprecatedSemanticIcon_1iw97_164 {
|
|
1886
1887
|
color: var(--color-text-primary) !important;
|
|
1887
1888
|
margin: -5px 0 0 !important;
|
|
1888
1889
|
}
|
|
1889
|
-
.
|
|
1890
|
+
._disabled_1iw97_168 {
|
|
1890
1891
|
color: var(--color-text-faint);
|
|
1891
1892
|
pointer-events: none;
|
|
1892
1893
|
cursor: not-allowed !important;
|
|
1893
1894
|
}
|
|
1894
|
-
.
|
|
1895
|
+
._buttonLabel_1iw97_173 {
|
|
1895
1896
|
overflow: hidden;
|
|
1896
1897
|
text-overflow: ellipsis;
|
|
1897
1898
|
display: block;
|
|
1898
1899
|
margin-right: auto;
|
|
1899
1900
|
}
|
|
1900
|
-
.
|
|
1901
|
+
._buttonCaret_1iw97_179 {
|
|
1901
1902
|
display: flex;
|
|
1902
1903
|
margin-left: var(--padding-xxs);
|
|
1903
1904
|
}
|
|
1904
|
-
.
|
|
1905
|
+
._component_1iw97_183 {
|
|
1905
1906
|
display: inline-flex;
|
|
1906
1907
|
align-items: center;
|
|
1907
1908
|
justify-content: center;
|
|
1908
1909
|
cursor: pointer;
|
|
1909
1910
|
}
|
|
1910
|
-
.
|
|
1911
|
+
._right_1iw97_189 {
|
|
1911
1912
|
margin-left: auto;
|
|
1912
1913
|
display: flex;
|
|
1913
1914
|
align-items: center;
|
|
1914
1915
|
}
|
|
1915
|
-
.
|
|
1916
|
+
._actions_1iw97_194 {
|
|
1916
1917
|
margin-left: var(--padding-xs);
|
|
1917
1918
|
display: flex;
|
|
1918
1919
|
align-items: center;
|
package/dist/index.d.ts
CHANGED
|
@@ -1666,8 +1666,6 @@ export declare const SideBar: React_2.MemoExoticComponent<({ options, startOpen,
|
|
|
1666
1666
|
|
|
1667
1667
|
export declare const Slider: ({ name, label, width, labelWidth, value, min, max, step, marks, showArrows, showTooltip, tooltipFormatter, disabled, range, small, vertical, onChange, }: ISliderProps) => JSX_2.Element;
|
|
1668
1668
|
|
|
1669
|
-
export declare const SmartUploadModal: ({ visible, prompt, onCloseModal, onUpload, onComplete, onFailed, onError, width, heading, dialogText, fileInputText, fileInputPlaceholder, uploadText, cancelText, testId, }: TSmartUploadModalProps) => JSX_2.Element;
|
|
1670
|
-
|
|
1671
1669
|
export declare const Spacer: ({ height, width, flex, }: ISpacerProps) => JSX_2.Element;
|
|
1672
1670
|
|
|
1673
1671
|
export declare const Spinner: ({ small, colored, dark, tiny, }: ISpinnerProps) => JSX_2.Element;
|
|
@@ -1803,26 +1801,6 @@ declare type TSliderMark = {
|
|
|
1803
1801
|
tooltip?: number | string | ReactNode;
|
|
1804
1802
|
};
|
|
1805
1803
|
|
|
1806
|
-
export declare type TSmartUploadModalProps = {
|
|
1807
|
-
visible: boolean;
|
|
1808
|
-
prompt: string;
|
|
1809
|
-
onCloseModal: () => void;
|
|
1810
|
-
onUpload: (prompt: string, file: File) => any;
|
|
1811
|
-
onComplete: (data: {
|
|
1812
|
-
[key: string]: string;
|
|
1813
|
-
}[]) => void;
|
|
1814
|
-
onFailed?: () => void;
|
|
1815
|
-
onError?: (error: any) => void;
|
|
1816
|
-
width?: number;
|
|
1817
|
-
heading?: string;
|
|
1818
|
-
dialogText?: string;
|
|
1819
|
-
fileInputText?: string;
|
|
1820
|
-
fileInputPlaceholder?: string;
|
|
1821
|
-
uploadText?: string;
|
|
1822
|
-
cancelText?: string;
|
|
1823
|
-
testId?: string;
|
|
1824
|
-
};
|
|
1825
|
-
|
|
1826
1804
|
declare type TStringNumberNull = string | number | null;
|
|
1827
1805
|
|
|
1828
1806
|
declare type TStringOrNumber = string | number;
|
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) {
|
|
@@ -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;
|
|
@@ -70856,154 +70856,6 @@ const UnitTable = ({
|
|
|
70856
70856
|
}
|
|
70857
70857
|
);
|
|
70858
70858
|
};
|
|
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
70859
|
export {
|
|
71008
70860
|
Accordion,
|
|
71009
70861
|
AccordionWithDefaultToggle,
|
|
@@ -71068,7 +70920,6 @@ export {
|
|
|
71068
70920
|
Select,
|
|
71069
70921
|
SideBar,
|
|
71070
70922
|
Slider,
|
|
71071
|
-
SmartUploadModal,
|
|
71072
70923
|
Spacer,
|
|
71073
70924
|
Spinner$1 as Spinner,
|
|
71074
70925
|
Table,
|