test-stpr-ui-kit 0.6.15 → 1.0.0
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/README.md +52 -9
- package/dist/components/Accordion/Accordion.css +1 -0
- package/dist/components/Accordion/Accordion.d.ts +3 -0
- package/dist/components/Accordion/Accordion.js +78 -0
- package/dist/components/Accordion/Accordion.module.scss.js +37 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Accordion/types/index.d.ts +22 -0
- package/dist/components/ApplyButtons/ApplyButtons.css +1 -0
- package/dist/components/ApplyButtons/ApplyButtons.d.ts +3 -0
- package/dist/components/ApplyButtons/ApplyButtons.js +67 -0
- package/dist/components/ApplyButtons/ApplyButtons.module.scss.js +16 -0
- package/dist/components/ApplyButtons/index.d.ts +2 -0
- package/dist/components/ApplyButtons/types/index.d.ts +24 -0
- package/dist/components/AuthProtected/AuthProtected.d.ts +3 -0
- package/dist/components/AuthProtected/AuthProtected.js +37 -0
- package/dist/components/AuthProtected/index.d.ts +2 -0
- package/dist/components/AuthProtected/types/index.d.ts +11 -0
- package/dist/components/BaseTooltip/BaseTooltip.css +1 -0
- package/dist/components/BaseTooltip/BaseTooltip.d.ts +3 -0
- package/dist/components/BaseTooltip/BaseTooltip.js +25 -0
- package/dist/components/BaseTooltip/BaseTooltip.module.scss.js +11 -0
- package/dist/components/BaseTooltip/index.d.ts +2 -0
- package/dist/components/BaseTooltip/types/index.d.ts +8 -0
- package/dist/components/Breadcrumb/Breadcrumb.css +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +3 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +42 -0
- package/dist/components/Breadcrumb/Breadcrumb.module.scss.js +17 -0
- package/dist/components/Breadcrumb/index.d.ts +2 -0
- package/dist/components/Breadcrumb/types/index.d.ts +11 -0
- package/dist/components/Button/Button.css +1 -0
- package/dist/components/Button/Button.d.ts +3 -0
- package/dist/components/Button/Button.js +74 -0
- package/dist/components/Button/Button.module.scss.js +33 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/types/index.d.ts +24 -0
- package/dist/components/Checkbox/Checkbox.css +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -0
- package/dist/components/Checkbox/Checkbox.js +72 -0
- package/dist/components/Checkbox/Checkbox.module.scss.js +33 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/types/index.d.ts +24 -0
- package/dist/components/Confirm/Confirm.d.ts +3 -0
- package/dist/components/Confirm/Confirm.js +85 -0
- package/dist/components/Confirm/index.d.ts +2 -0
- package/dist/components/Confirm/types/index.d.ts +7 -0
- package/dist/components/ContextMenu/ContextMenu.css +1 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +3 -0
- package/dist/components/ContextMenu/ContextMenu.js +39 -0
- package/dist/components/ContextMenu/ContextMenu.module.scss.js +13 -0
- package/dist/components/ContextMenu/index.d.ts +2 -0
- package/dist/components/ContextMenu/types/index.d.ts +12 -0
- package/dist/components/DatePicker/DatePicker.css +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +4 -0
- package/dist/components/DatePicker/DatePicker.js +198 -0
- package/dist/components/DatePicker/DatePicker.module.scss.js +31 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/types/index.d.ts +33 -0
- package/dist/components/DatePickerInput/DatePickerInput.css +1 -0
- package/dist/components/DatePickerInput/DatePickerInput.d.ts +3 -0
- package/dist/components/DatePickerInput/DatePickerInput.js +101 -0
- package/dist/components/DatePickerInput/DatePickerInput.module.scss.js +25 -0
- package/dist/components/DatePickerInput/index.d.ts +2 -0
- package/dist/components/DatePickerInput/types/index.d.ts +32 -0
- package/dist/components/DefaultDropzone/DefaultDropzone.d.ts +3 -0
- package/dist/components/DefaultDropzone/DefaultDropzone.js +11 -0
- package/dist/components/DefaultDropzone/hooks/useDefaultDropzone.d.ts +2 -0
- package/dist/components/DefaultDropzone/hooks/useDefaultDropzone.js +5 -0
- package/dist/components/DefaultDropzone/index.d.ts +2 -0
- package/dist/components/DefaultDropzone/types/index.d.ts +10 -0
- package/dist/components/Dropdown/Dropdown.css +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +3 -0
- package/dist/components/Dropdown/Dropdown.js +68 -0
- package/dist/components/Dropdown/Dropdown.module.scss.js +21 -0
- package/dist/components/Dropdown/index.d.ts +2 -0
- package/dist/components/Dropdown/types/index.d.ts +14 -0
- package/dist/components/EllipsisTextWithTooltip/EllipsisTextWithTooltip.css +1 -0
- package/dist/components/EllipsisTextWithTooltip/EllipsisTextWithTooltip.d.ts +3 -0
- package/dist/components/EllipsisTextWithTooltip/EllipsisTextWithTooltip.js +75 -0
- package/dist/components/EllipsisTextWithTooltip/EllipsisTextWithTooltip.module.scss.js +11 -0
- package/dist/components/EllipsisTextWithTooltip/index.d.ts +2 -0
- package/dist/components/EllipsisTextWithTooltip/types/index.d.ts +13 -0
- package/dist/components/EllipsisTextWithTooltip/utils/index.d.ts +2 -0
- package/dist/components/EllipsisTextWithTooltip/utils/index.js +5 -0
- package/dist/components/Form/Form.css +1 -0
- package/dist/components/Form/Form.d.ts +3 -0
- package/dist/components/Form/Form.js +28 -0
- package/dist/components/Form/Form.module.scss.js +15 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/Form/types/index.d.ts +13 -0
- package/dist/components/Icons/Icon.css +1 -0
- package/dist/components/Icons/Icon.d.ts +43 -0
- package/dist/components/Icons/Icon.js +136 -0
- package/dist/components/Icons/Icon.module.scss.js +7 -0
- package/dist/components/Icons/index.d.ts +3 -0
- package/dist/components/Icons/types/index.d.ts +47 -0
- package/dist/components/Icons/types/index.js +4 -0
- package/dist/components/IfcPreview/IfcPreview.css +1 -0
- package/dist/components/IfcPreview/IfcPreview.d.ts +3 -0
- package/dist/components/IfcPreview/IfcPreview.js +104 -0
- package/dist/components/IfcPreview/IfcPreview.module.scss.js +37 -0
- package/dist/components/IfcPreview/components/IfcPreviewCard/IfcPreviewCard.d.ts +14 -0
- package/dist/components/IfcPreview/components/IfcPreviewCard/IfcPreviewCard.js +79 -0
- package/dist/components/IfcPreview/components/IfcPreviewCard/index.d.ts +1 -0
- package/dist/components/IfcPreview/components/IfcPreviewViewerLayer/IfcPreviewViewerLayer.d.ts +18 -0
- package/dist/components/IfcPreview/components/IfcPreviewViewerLayer/IfcPreviewViewerLayer.js +59 -0
- package/dist/components/IfcPreview/components/IfcPreviewViewerLayer/index.d.ts +1 -0
- package/dist/components/IfcPreview/constants/index.d.ts +3 -0
- package/dist/components/IfcPreview/constants/index.js +6 -0
- package/dist/components/IfcPreview/hooks/useIfcPreviewModel.d.ts +20 -0
- package/dist/components/IfcPreview/hooks/useIfcPreviewModel.js +34 -0
- package/dist/components/IfcPreview/hooks/useIfcPreviewViewer.d.ts +30 -0
- package/dist/components/IfcPreview/hooks/useIfcPreviewViewer.js +73 -0
- package/dist/components/IfcPreview/index.d.ts +2 -0
- package/dist/components/IfcPreview/types/index.d.ts +52 -0
- package/dist/components/IfcPreview/utils/file-hellper.d.ts +2 -0
- package/dist/components/IfcPreview/utils/file-hellper.js +7 -0
- package/dist/components/IfcPreview/utils/fileSizeLimit.d.ts +7 -0
- package/dist/components/IfcPreview/utils/fileSizeLimit.js +8 -0
- package/dist/components/IfcPreview/utils/modelSource.d.ts +7 -0
- package/dist/components/IfcPreview/utils/modelSource.js +35 -0
- package/dist/components/IfcViewer/IfcViewer.css +1 -0
- package/dist/components/IfcViewer/IfcViewer.d.ts +3 -0
- package/dist/components/IfcViewer/IfcViewer.js +71 -0
- package/dist/components/IfcViewer/IfcViewer.module.scss.js +13 -0
- package/dist/components/IfcViewer/index.d.ts +2 -0
- package/dist/components/IfcViewer/types/index.d.ts +12 -0
- package/dist/components/IfcViewer/utils/fetchIfc.d.ts +1 -0
- package/dist/components/IfcViewer/utils/fetchIfc.js +9 -0
- package/dist/components/IfcViewer/utils/formatMeshProgress.d.ts +1 -0
- package/dist/components/IfcViewer/utils/formatMeshProgress.js +4 -0
- package/dist/components/IfcViewer/utils/ifcWebViewer.d.ts +14 -0
- package/dist/components/IfcViewer/utils/ifcWebViewer.js +120 -0
- package/dist/components/Input/Input.css +1 -0
- package/dist/components/Input/Input.d.ts +3 -0
- package/dist/components/Input/Input.js +121 -0
- package/dist/components/Input/Input.module.scss.js +33 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/types/index.d.ts +40 -0
- package/dist/components/Label/Label.css +1 -0
- package/dist/components/Label/Label.d.ts +3 -0
- package/dist/components/Label/Label.js +36 -0
- package/dist/components/Label/Label.module.scss.js +9 -0
- package/dist/components/Label/index.d.ts +2 -0
- package/dist/components/Label/types/index.d.ts +9 -0
- package/dist/components/Layer/Layer.css +1 -0
- package/dist/components/Layer/Layer.d.ts +3 -0
- package/dist/components/Layer/Layer.js +26 -0
- package/dist/components/Layer/Layer.module.scss.js +9 -0
- package/dist/components/Layer/index.d.ts +2 -0
- package/dist/components/Layer/types/index.d.ts +7 -0
- package/dist/components/MediaContextProvider/MediaContextProvider.d.ts +3 -0
- package/dist/components/MediaContextProvider/MediaContextProvider.js +25 -0
- package/dist/components/MediaContextProvider/constants/index.d.ts +3 -0
- package/dist/components/MediaContextProvider/constants/index.js +11 -0
- package/dist/components/MediaContextProvider/hooks/index.d.ts +8 -0
- package/dist/components/MediaContextProvider/hooks/index.js +14 -0
- package/dist/components/MediaContextProvider/index.d.ts +4 -0
- package/dist/components/MediaContextProvider/types/index.d.ts +23 -0
- package/dist/components/Modal/Modal.css +1 -0
- package/dist/components/Modal/Modal.d.ts +3 -0
- package/dist/components/Modal/Modal.js +89 -0
- package/dist/components/Modal/Modal.module.scss.js +56 -0
- package/dist/components/Modal/hooks/index.d.ts +17 -0
- package/dist/components/Modal/hooks/index.js +25 -0
- package/dist/components/Modal/index.d.ts +3 -0
- package/dist/components/Modal/types/index.d.ts +24 -0
- package/dist/components/Portal/Potral.d.ts +3 -0
- package/dist/components/Portal/Potral.js +18 -0
- package/dist/components/Portal/index.d.ts +2 -0
- package/dist/components/Portal/types/index.d.ts +5 -0
- package/dist/components/ProgressWrapper/ProgressWrapper.css +1 -0
- package/dist/components/ProgressWrapper/ProgressWrapper.d.ts +3 -0
- package/dist/components/ProgressWrapper/ProgressWrapper.js +50 -0
- package/dist/components/ProgressWrapper/ProgressWrapper.module.scss.js +17 -0
- package/dist/components/ProgressWrapper/constants/index.d.ts +1 -0
- package/dist/components/ProgressWrapper/constants/index.js +4 -0
- package/dist/components/ProgressWrapper/hooks/index.d.ts +5 -0
- package/dist/components/ProgressWrapper/hooks/index.js +41 -0
- package/dist/components/ProgressWrapper/index.d.ts +3 -0
- package/dist/components/ProgressWrapper/types/index.d.ts +17 -0
- package/dist/components/Select/Select.css +1 -0
- package/dist/components/Select/Select.d.ts +3 -0
- package/dist/components/Select/Select.js +195 -0
- package/dist/components/Select/Select.module.scss.js +69 -0
- package/dist/components/Select/constants/index.d.ts +3 -0
- package/dist/components/Select/constants/index.js +5 -0
- package/dist/components/Select/hooks/useSelect.d.ts +28 -0
- package/dist/components/Select/hooks/useSelect.js +73 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/types/index.d.ts +50 -0
- package/dist/components/Skeleton/Skeleton.css +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +3 -0
- package/dist/components/Skeleton/Skeleton.js +38 -0
- package/dist/components/Skeleton/Skeleton.module.scss.js +13 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Skeleton/typs/index.d.ts +10 -0
- package/dist/components/Spinner/Spinner.css +1 -0
- package/dist/components/Spinner/Spinner.d.ts +3 -0
- package/dist/components/Spinner/Spinner.js +46 -0
- package/dist/components/Spinner/Spinner.module.scss.js +28 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Spinner/types/index.d.ts +9 -0
- package/dist/components/Table/Table.css +1 -0
- package/dist/components/Table/Table.d.ts +2 -0
- package/dist/components/Table/Table.js +219 -0
- package/dist/components/Table/Table.module.scss.js +41 -0
- package/dist/components/Table/hooks/index.d.ts +12 -0
- package/dist/components/Table/hooks/index.js +28 -0
- package/dist/components/Table/index.d.ts +3 -0
- package/dist/components/Table/types/index.d.ts +39 -0
- package/dist/components/Table/utils/index.d.ts +2 -0
- package/dist/components/Table/utils/index.js +5 -0
- package/dist/components/Tabs/Tabs.css +1 -0
- package/dist/components/Tabs/Tabs.d.ts +3 -0
- package/dist/components/Tabs/Tabs.js +73 -0
- package/dist/components/Tabs/Tabs.module.scss.js +26 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/types/index.d.ts +25 -0
- package/dist/components/Text/Text.css +1 -0
- package/dist/components/Text/Text.d.ts +3 -0
- package/dist/components/Text/Text.js +39 -0
- package/dist/components/Text/Text.module.scss.js +17 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/Text/types/index.d.ts +15 -0
- package/dist/components/TextWithLabel/TextWithLabel.css +1 -0
- package/dist/components/TextWithLabel/TextWithLabel.d.ts +3 -0
- package/dist/components/TextWithLabel/TextWithLabel.js +39 -0
- package/dist/components/TextWithLabel/TextWithLabel.module.scss.js +9 -0
- package/dist/components/TextWithLabel/index.d.ts +2 -0
- package/dist/components/TextWithLabel/types/index.d.ts +6 -0
- package/dist/components/Textarea/Textarea.css +1 -0
- package/dist/components/Textarea/Textarea.d.ts +3 -0
- package/dist/components/Textarea/Textarea.js +132 -0
- package/dist/components/Textarea/Textarea.module.scss.js +35 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Textarea/types/index.d.ts +45 -0
- package/dist/components/Tooltip/Tooltip.css +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +4 -0
- package/dist/components/Tooltip/Tooltip.js +191 -0
- package/dist/components/Tooltip/Tooltip.module.scss.js +13 -0
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/Tooltip/types/index.d.ts +36 -0
- package/dist/components/Tooltip/types/index.js +4 -0
- package/dist/components/UploadFiles/UploadFiles.css +1 -0
- package/dist/components/UploadFiles/UploadFiles.d.ts +3 -0
- package/dist/components/UploadFiles/UploadFiles.js +238 -0
- package/dist/components/UploadFiles/UploadFiles.module.scss.js +73 -0
- package/dist/components/UploadFiles/index.d.ts +2 -0
- package/dist/components/UploadFiles/types/index.d.ts +33 -0
- package/dist/components/UploadFiles/utils/index.d.ts +12 -0
- package/dist/components/UploadFiles/utils/index.js +67 -0
- package/dist/components/ViewImageModal/ViewImageModal.css +1 -0
- package/dist/components/ViewImageModal/ViewImageModal.d.ts +3 -0
- package/dist/components/ViewImageModal/ViewImageModal.js +71 -0
- package/dist/components/ViewImageModal/ViewImageModal.module.scss.js +19 -0
- package/dist/components/ViewImageModal/index.d.ts +2 -0
- package/dist/components/ViewImageModal/types/index.d.ts +13 -0
- package/dist/components-assets/IfcPreview/web-ifc/web-ifc.wasm +0 -0
- package/dist/hooks/useClickOutside.d.ts +14 -0
- package/dist/hooks/useClickOutside.js +15 -0
- package/dist/images/add_file.svg.js +5 -0
- package/dist/images/add_user.svg.js +5 -0
- package/dist/images/arrow-bottom.svg.js +5 -0
- package/dist/images/calendar.svg.js +5 -0
- package/dist/images/check.svg.js +5 -0
- package/dist/images/chevron_down.svg.js +5 -0
- package/dist/images/close.svg.js +5 -0
- package/dist/images/copy.svg.js +5 -0
- package/dist/images/dots.svg.js +5 -0
- package/dist/images/download.svg.js +5 -0
- package/dist/images/edit.svg.js +5 -0
- package/dist/images/eye.svg.js +5 -0
- package/dist/images/file.svg.js +5 -0
- package/dist/images/file_not_filled.svg.js +5 -0
- package/dist/images/filter.svg.js +5 -0
- package/dist/images/folder.svg.js +5 -0
- package/dist/images/history_clock.svg.js +5 -0
- package/dist/images/info.svg.js +5 -0
- package/dist/images/info_error.svg.js +5 -0
- package/dist/images/layers-three.svg.js +5 -0
- package/dist/images/link-angled.svg.js +5 -0
- package/dist/images/logout.svg.js +5 -0
- package/dist/images/minus.svg.js +5 -0
- package/dist/images/pause-circle.svg.js +5 -0
- package/dist/images/play-circle.svg.js +5 -0
- package/dist/images/plus.svg.js +5 -0
- package/dist/images/plus_circle.svg.js +5 -0
- package/dist/images/plus_square.svg.js +5 -0
- package/dist/images/refresh.svg.js +5 -0
- package/dist/images/save.svg.js +5 -0
- package/dist/images/search.svg.js +5 -0
- package/dist/images/select_chevron_down.svg.js +5 -0
- package/dist/images/terminal_square.svg.js +5 -0
- package/dist/images/trash.svg.js +5 -0
- package/dist/images/update.svg.js +5 -0
- package/dist/images/upload-top.svg.js +5 -0
- package/dist/images/upload.svg.js +5 -0
- package/dist/images/user-right.svg.js +5 -0
- package/dist/images/warning_color.svg.js +5 -0
- package/dist/styles/tokens.css +250 -0
- package/dist/test-stpr-ui-kit.d.ts +36 -0
- package/dist/test-stpr-ui-kit.js +43 -15043
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/sleep.d.ts +1 -0
- package/dist/utils/stringHelper.d.ts +13 -0
- package/dist/utils/stringHelper.js +4 -0
- package/package.json +34 -30
- package/dist/images/icon.svg +0 -8
- package/dist/images/viewImageExample.jpg +0 -0
- package/dist/test-stpr-ui-kit.css +0 -1
- package/dist/test-stpr-ui-kit.es.d.ts +0 -829
- package/dist/test-stpr-ui-kit.umd.cjs +0 -9
- /package/dist/{images → components-assets/ViewImageModal}/fallBackSrc.jpeg +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { useRef as F, useState as o, useEffect as L } from "react";
|
|
2
|
+
import { revokeBlobUrlIfNeeded as I } from "../utils/file-hellper.js";
|
|
3
|
+
import { isIfcPreviewFileSizeExceeded as R, formatIfcPreviewFileSizeLimitMessage as b, IFC_FILE_SIZE_EXCEEDED as B } from "../utils/fileSizeLimit.js";
|
|
4
|
+
import { fetchKnownModelByteSize as O, resolveViewerUrl as x } from "../utils/modelSource.js";
|
|
5
|
+
const C = "Подготовка просмотра", j = (S) => {
|
|
6
|
+
const {
|
|
7
|
+
readonly: d,
|
|
8
|
+
effectiveFile: u,
|
|
9
|
+
effectiveUrl: E,
|
|
10
|
+
wasmPublicPath: V,
|
|
11
|
+
maxFileSizeMb: h,
|
|
12
|
+
disableFileSizeLimit: P,
|
|
13
|
+
onModelLoaded: g,
|
|
14
|
+
onError: c,
|
|
15
|
+
onOpenViewer: M,
|
|
16
|
+
onCloseViewer: v
|
|
17
|
+
} = S, l = F(null), [U, r] = o(!1), [s, f] = o(!1), [p, n] = o(null), [y, w] = o(!1), [t, i] = o(null);
|
|
18
|
+
L(() => () => {
|
|
19
|
+
I(l.current);
|
|
20
|
+
}, []);
|
|
21
|
+
const m = () => {
|
|
22
|
+
I(l.current), l.current = null;
|
|
23
|
+
}, z = (e) => {
|
|
24
|
+
i(b(e)), n(null), r(!0), f(!1), c?.(new Error(B));
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
wasmPublicPath: V,
|
|
28
|
+
isOpen: U,
|
|
29
|
+
isPreparing: s,
|
|
30
|
+
viewerUrl: p,
|
|
31
|
+
isModelReady: y,
|
|
32
|
+
errorMessage: t,
|
|
33
|
+
preparingText: C,
|
|
34
|
+
showViewer: !s && !!p && !t,
|
|
35
|
+
showPreparingSpinner: s && !t,
|
|
36
|
+
showError: !s && !!t,
|
|
37
|
+
handleOpen: async () => {
|
|
38
|
+
i(null), w(!1), f(!0), r(!0);
|
|
39
|
+
try {
|
|
40
|
+
if (!P) {
|
|
41
|
+
const a = await O(d, u, E);
|
|
42
|
+
if (a !== null && R(a, h, !1)) {
|
|
43
|
+
z(h);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const e = x(d, u, E, l);
|
|
48
|
+
if (!e) {
|
|
49
|
+
n(null), r(!1);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
n(e), M?.();
|
|
53
|
+
} catch (e) {
|
|
54
|
+
const a = e instanceof Error ? e : new Error(String(e));
|
|
55
|
+
c?.(a), r(!1), n(null), m();
|
|
56
|
+
} finally {
|
|
57
|
+
f(!1);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
handleClose: () => {
|
|
61
|
+
r(!1), n(null), w(!1), i(null), m(), v?.();
|
|
62
|
+
},
|
|
63
|
+
handleViewerError: (e) => {
|
|
64
|
+
i(e.message), c?.(e);
|
|
65
|
+
},
|
|
66
|
+
handleViewerModelLoaded: () => {
|
|
67
|
+
w(!0), g?.();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
j as useIfcPreviewViewer
|
|
73
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { TIfcPreviewMaxFileSizeMb } from "../utils/fileSizeLimit";
|
|
3
|
+
export type { TIfcPreviewMaxFileSizeMb } from "../utils/fileSizeLimit";
|
|
4
|
+
/**
|
|
5
|
+
* Предпросмотр IFC: карточка и полноэкранный просмотр в Layer (`IfcViewer`).
|
|
6
|
+
* Источник модели: `url` и/или локальный `file` (см. приоритет в `readonly`).
|
|
7
|
+
*/
|
|
8
|
+
export type IIfcPreviewProps = {
|
|
9
|
+
/**
|
|
10
|
+
* `true` — только просмотр по `url`, без загрузки и удаления с диска.
|
|
11
|
+
* `false` — просмотр, загрузка файла (Upload) и удаление (Trash) при наличии модели.
|
|
12
|
+
*/
|
|
13
|
+
readonly?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* URL IFC-модели (HTTP(S) или `blob:`). Передаётся в `IfcViewer` при открытии просмотра.
|
|
16
|
+
* При `readonly={false}` — fallback после локального `file`.
|
|
17
|
+
*/
|
|
18
|
+
url?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Локальный файл при `readonly={false}` (приоритет над `url`).
|
|
21
|
+
* Если проп передан — компонент controlled; иначе файл хранится во внутреннем состоянии.
|
|
22
|
+
*/
|
|
23
|
+
file?: File | null;
|
|
24
|
+
/**
|
|
25
|
+
* Колбэк при смене или сбросе файла (`readonly={false}`).
|
|
26
|
+
*/
|
|
27
|
+
onFileChange?: (file: File | null) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Вызывается при нажатии «Удалить»: сброс локального `file` и скрытие `url` в UI.
|
|
30
|
+
* В controlled-режиме обнулите у родителя `file` и `url` в этом колбэке.
|
|
31
|
+
*/
|
|
32
|
+
onClear?: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Базовый URL каталога со статикой `web-ifc.wasm`.
|
|
35
|
+
* @default "/components-assets/IfcPreview/web-ifc/"
|
|
36
|
+
*/
|
|
37
|
+
wasmPublicPath?: string;
|
|
38
|
+
onModelLoaded?: () => void;
|
|
39
|
+
onError?: (error: Error) => void;
|
|
40
|
+
onOpenViewer?: () => void;
|
|
41
|
+
onCloseViewer?: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* Максимальный размер IFC для просмотра (МБ).
|
|
44
|
+
* @default 50
|
|
45
|
+
*/
|
|
46
|
+
maxFileSizeMb?: TIfcPreviewMaxFileSizeMb;
|
|
47
|
+
/** @default false */
|
|
48
|
+
disableFileSizeLimit?: boolean;
|
|
49
|
+
classNameRoot?: string;
|
|
50
|
+
/** Контент в панели просмотра под канвасом (после загрузки модели). */
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Допустимые лимиты размера IFC для просмотра в браузере (МБ). */
|
|
2
|
+
export type TIfcPreviewMaxFileSizeMb = 50 | 100 | 150;
|
|
3
|
+
export declare const DEFAULT_IFC_PREVIEW_MAX_FILE_SIZE_MB: TIfcPreviewMaxFileSizeMb;
|
|
4
|
+
export declare const IFC_FILE_SIZE_EXCEEDED = "IFC_FILE_SIZE_EXCEEDED";
|
|
5
|
+
export declare const getIfcPreviewMaxFileSizeBytes: (maxFileSizeMb: TIfcPreviewMaxFileSizeMb) => number;
|
|
6
|
+
export declare const formatIfcPreviewFileSizeLimitMessage: (maxFileSizeMb: TIfcPreviewMaxFileSizeMb) => string;
|
|
7
|
+
export declare const isIfcPreviewFileSizeExceeded: (byteSize: number, maxFileSizeMb: TIfcPreviewMaxFileSizeMb, disableFileSizeLimit: boolean) => boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const _ = 50, t = "IFC_FILE_SIZE_EXCEEDED", i = (e) => e * 1024 * 1024, F = (e) => `Загрузите файл размером до ${e} МБ`, s = (e, E, I) => e > i(E);
|
|
2
|
+
export {
|
|
3
|
+
_ as DEFAULT_IFC_PREVIEW_MAX_FILE_SIZE_MB,
|
|
4
|
+
t as IFC_FILE_SIZE_EXCEEDED,
|
|
5
|
+
F as formatIfcPreviewFileSizeLimitMessage,
|
|
6
|
+
i as getIfcPreviewMaxFileSizeBytes,
|
|
7
|
+
s as isIfcPreviewFileSizeExceeded
|
|
8
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const trimModelUrl: (url?: string) => string | undefined;
|
|
2
|
+
export declare const getUrlFileName: (url?: string) => string | undefined;
|
|
3
|
+
export declare const getCardCaption: (file: File | null, url: string | undefined, emptyTitle: string) => string;
|
|
4
|
+
export declare const resolveViewerUrl: (readonly: boolean, file: File | null, url: string | undefined, ownedBlobUrlRef: {
|
|
5
|
+
current: string | null;
|
|
6
|
+
}) => string | null;
|
|
7
|
+
export declare const fetchKnownModelByteSize: (readonly: boolean, file: File | null, url: string | undefined) => Promise<number | null>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { revokeBlobUrlIfNeeded as l } from "./file-hellper.js";
|
|
2
|
+
const u = (t) => t?.trim() || void 0, s = (t) => u(t)?.split("/").filter(Boolean).pop(), a = (t, e, n) => t?.name ?? s(e) ?? n, d = (t, e, n, r) => {
|
|
3
|
+
if (!t && e) {
|
|
4
|
+
l(r.current);
|
|
5
|
+
const o = URL.createObjectURL(e);
|
|
6
|
+
return r.current = o, o;
|
|
7
|
+
}
|
|
8
|
+
const c = u(n);
|
|
9
|
+
return c ? (l(r.current), r.current = null, c) : null;
|
|
10
|
+
}, p = async (t, e, n) => {
|
|
11
|
+
if (!t && e)
|
|
12
|
+
return e.size;
|
|
13
|
+
const r = u(n);
|
|
14
|
+
if (!r)
|
|
15
|
+
return null;
|
|
16
|
+
try {
|
|
17
|
+
const c = await fetch(r, { method: "HEAD" });
|
|
18
|
+
if (!c.ok)
|
|
19
|
+
return null;
|
|
20
|
+
const o = c.headers.get("content-length");
|
|
21
|
+
if (!o)
|
|
22
|
+
return null;
|
|
23
|
+
const i = Number.parseInt(o, 10);
|
|
24
|
+
return Number.isFinite(i) && i > 0 ? i : null;
|
|
25
|
+
} catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
p as fetchKnownModelByteSize,
|
|
31
|
+
a as getCardCaption,
|
|
32
|
+
s as getUrlFileName,
|
|
33
|
+
d as resolveViewerUrl,
|
|
34
|
+
u as trimModelUrl
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._ifcViewer_1jvoc_1{position:relative;width:100%;height:100%}._viewerHost_1jvoc_7{position:absolute;inset:0;overflow:hidden}._viewerSpinner_1jvoc_13{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:1}._viewerErrorBanner_1jvoc_22{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--spui-spacing-4x);z-index:1}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs as A, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import H from "clsx";
|
|
3
|
+
import { useRef as i, useState as f, useEffect as V } from "react";
|
|
4
|
+
import c from "./IfcViewer.module.scss.js";
|
|
5
|
+
import { fetchIfcFromUrl as b } from "./utils/fetchIfc.js";
|
|
6
|
+
import { formatMeshProgressText as F } from "./utils/formatMeshProgress.js";
|
|
7
|
+
import { Spinner as U } from "../Spinner/Spinner.js";
|
|
8
|
+
import { Text as W } from "../Text/Text.js";
|
|
9
|
+
const j = "/components-assets/IfcPreview/web-ifc/", O = (R) => {
|
|
10
|
+
const {
|
|
11
|
+
url: m,
|
|
12
|
+
wasmPublicPath: d = j,
|
|
13
|
+
onError: u,
|
|
14
|
+
onModelLoaded: p,
|
|
15
|
+
classNameRoot: I
|
|
16
|
+
} = R, h = i(null), w = i(0), E = i(u), g = i(p), [N, r] = f("Загрузка модели"), [M, a] = f(!0), [l, v] = f(null);
|
|
17
|
+
E.current = u, g.current = p, V(() => {
|
|
18
|
+
const s = h.current;
|
|
19
|
+
if (!s)
|
|
20
|
+
return;
|
|
21
|
+
const S = ++w.current;
|
|
22
|
+
let x = !1, C;
|
|
23
|
+
a(!0), v(null), r("Загрузка модели");
|
|
24
|
+
const e = () => x || w.current !== S, T = () => {
|
|
25
|
+
for (; s.firstChild; )
|
|
26
|
+
s.removeChild(s.firstChild);
|
|
27
|
+
};
|
|
28
|
+
return (async () => {
|
|
29
|
+
try {
|
|
30
|
+
r("Загрузка модели");
|
|
31
|
+
const t = await b(m);
|
|
32
|
+
if (e())
|
|
33
|
+
return;
|
|
34
|
+
r("Инициализация просмотра");
|
|
35
|
+
const { createIfcWebViewer: o } = await import("./utils/ifcWebViewer.js");
|
|
36
|
+
if (e())
|
|
37
|
+
return;
|
|
38
|
+
r("Открытие модели");
|
|
39
|
+
const L = await o(s, t, d, {
|
|
40
|
+
isCancelled: e,
|
|
41
|
+
onMeshProgress: (_, y) => {
|
|
42
|
+
e() || r(F(_, y));
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
if (e()) {
|
|
46
|
+
L.dispose();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
C = L.dispose, a(!1), g.current?.();
|
|
50
|
+
} catch (t) {
|
|
51
|
+
if (e())
|
|
52
|
+
return;
|
|
53
|
+
const o = t instanceof Error ? t : new Error(String(t));
|
|
54
|
+
if (o.message === "IFC_VIEWER_CANCELLED")
|
|
55
|
+
return;
|
|
56
|
+
a(!1), v(o.message), E.current?.(o);
|
|
57
|
+
}
|
|
58
|
+
})(), () => {
|
|
59
|
+
x = !0, C?.(), T();
|
|
60
|
+
};
|
|
61
|
+
}, [m, d]);
|
|
62
|
+
const P = H(c.ifcViewer, I);
|
|
63
|
+
return /* @__PURE__ */ A("div", { className: P, children: [
|
|
64
|
+
/* @__PURE__ */ n("div", { className: c.viewerHost, ref: h }),
|
|
65
|
+
M && !l && /* @__PURE__ */ n("div", { className: c.viewerSpinner, children: /* @__PURE__ */ n(U, { loadingText: N, size: "xl" }) }),
|
|
66
|
+
l && /* @__PURE__ */ n("div", { className: c.viewerErrorBanner, children: /* @__PURE__ */ n(W, { type: "p2", children: l }) })
|
|
67
|
+
] });
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
O as IfcViewer
|
|
71
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './IfcViewer.css';const e = "_ifcViewer_1jvoc_1", r = "_viewerHost_1jvoc_7", i = "_viewerSpinner_1jvoc_13", n = "_viewerErrorBanner_1jvoc_22", o = {
|
|
2
|
+
ifcViewer: e,
|
|
3
|
+
viewerHost: r,
|
|
4
|
+
viewerSpinner: i,
|
|
5
|
+
viewerErrorBanner: n
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
o as default,
|
|
9
|
+
e as ifcViewer,
|
|
10
|
+
n as viewerErrorBanner,
|
|
11
|
+
r as viewerHost,
|
|
12
|
+
i as viewerSpinner
|
|
13
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type IIfcViewerProps = {
|
|
2
|
+
/** URL IFC-модели (HTTP(S) или blob:). */
|
|
3
|
+
url: string;
|
|
4
|
+
/**
|
|
5
|
+
* Базовый URL каталога со статикой `web-ifc.wasm`.
|
|
6
|
+
* @default "/components-assets/IfcPreview/web-ifc/"
|
|
7
|
+
*/
|
|
8
|
+
wasmPublicPath?: string;
|
|
9
|
+
onError?: (error: Error) => void;
|
|
10
|
+
onModelLoaded?: () => void;
|
|
11
|
+
classNameRoot?: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fetchIfcFromUrl: (modelUrl: string) => Promise<Uint8Array>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatMeshProgressText: (loaded: number, total: number) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type IfcWebViewerHandle = {
|
|
2
|
+
dispose: () => void;
|
|
3
|
+
};
|
|
4
|
+
export type CreateIfcWebViewerOptions = {
|
|
5
|
+
/** Вызывается при стриминге мешей: `loaded` от 1 до `total`. */
|
|
6
|
+
onMeshProgress?: (loaded: number, total: number) => void;
|
|
7
|
+
/** When true, abort before attaching a WebGL context (e.g. effect cleanup / remount). */
|
|
8
|
+
isCancelled?: () => boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Mounts a Three.js + web-ifc viewer into `mountEl`.
|
|
12
|
+
* Caller must install peer deps `three` and `web-ifc`, and serve `web-ifc.wasm` under `wasmPublicPath` (package default: `components-assets/IfcPreview/web-ifc/` in `dist`).
|
|
13
|
+
*/
|
|
14
|
+
export declare const createIfcWebViewer: (mountEl: HTMLElement, data: Uint8Array, wasmPublicPath: string, options?: CreateIfcWebViewerOptions) => Promise<IfcWebViewerHandle>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import * as o from "three";
|
|
2
|
+
import { OrbitControls as J } from "three/examples/jsm/controls/OrbitControls.js";
|
|
3
|
+
import { IfcAPI as K, LogLevel as Q } from "web-ifc";
|
|
4
|
+
o.ColorManagement.enabled = !0;
|
|
5
|
+
const X = (t) => {
|
|
6
|
+
for (const A of t.querySelectorAll("canvas"))
|
|
7
|
+
A.remove();
|
|
8
|
+
}, Z = (t) => t.byteOffset === 0 && t.byteLength === t.buffer.byteLength ? t : new Uint8Array(t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength)), E = (t) => {
|
|
9
|
+
t && typeof t.delete == "function" && t.delete();
|
|
10
|
+
}, te = async (t, A, M, N) => {
|
|
11
|
+
const { onMeshProgress: T, isCancelled: G } = N ?? {}, a = new K(), P = M.endsWith("/") ? M : `${M}/`;
|
|
12
|
+
a.SetWasmPath(P, !1), await a.Init(void 0, !0), a.SetLogLevel(Q.LOG_LEVEL_OFF);
|
|
13
|
+
const v = Z(A), h = a.OpenModel(v, { COORDINATE_TO_ORIGIN: !0 });
|
|
14
|
+
if (h < 0)
|
|
15
|
+
throw a.Dispose(), new Error("IFC_OPEN_FAILED");
|
|
16
|
+
const H = () => {
|
|
17
|
+
if (G?.())
|
|
18
|
+
throw a.CloseModel(h), a.Dispose(), new Error("IFC_VIEWER_CANCELLED");
|
|
19
|
+
}, w = new o.Scene();
|
|
20
|
+
w.background = new o.Color(15922423);
|
|
21
|
+
const u = new o.Group();
|
|
22
|
+
w.add(u);
|
|
23
|
+
const k = (e) => {
|
|
24
|
+
const n = e.length;
|
|
25
|
+
if (n === 0)
|
|
26
|
+
return { positions: e, normals: null };
|
|
27
|
+
if (n % 6 === 0) {
|
|
28
|
+
const r = n / 6, s = new Float32Array(r * 3), l = new Float32Array(r * 3);
|
|
29
|
+
for (let i = 0; i < n; i += 6) {
|
|
30
|
+
const d = i / 6;
|
|
31
|
+
s[d * 3] = e[i], s[d * 3 + 1] = e[i + 1], s[d * 3 + 2] = e[i + 2], l[d * 3] = e[i + 3], l[d * 3 + 1] = e[i + 4], l[d * 3 + 2] = e[i + 5];
|
|
32
|
+
}
|
|
33
|
+
return { positions: s, normals: l };
|
|
34
|
+
}
|
|
35
|
+
if (n % 9 === 0) {
|
|
36
|
+
const r = n / 9, s = new Float32Array(r * 3);
|
|
37
|
+
for (let l = 0; l < r; l++) {
|
|
38
|
+
const i = l * 9;
|
|
39
|
+
s[l * 3] = e[i], s[l * 3 + 1] = e[i + 1], s[l * 3 + 2] = e[i + 2];
|
|
40
|
+
}
|
|
41
|
+
return { positions: s, normals: null };
|
|
42
|
+
}
|
|
43
|
+
if (n % 3 === 0)
|
|
44
|
+
return { positions: e, normals: null };
|
|
45
|
+
const m = Math.floor(n / 3), f = new Float32Array(m * 3);
|
|
46
|
+
for (let r = 0; r < m; r++) {
|
|
47
|
+
const s = r * 3;
|
|
48
|
+
f[r * 3] = e[s], f[r * 3 + 1] = e[s + 1], f[r * 3 + 2] = e[s + 2];
|
|
49
|
+
}
|
|
50
|
+
return { positions: f, normals: null };
|
|
51
|
+
};
|
|
52
|
+
if (a.StreamAllMeshes(h, (e, n, m) => {
|
|
53
|
+
if (!G?.()) {
|
|
54
|
+
m > 0 && T?.(n + 1, m);
|
|
55
|
+
for (let f = 0; f < e.geometries.size(); f++) {
|
|
56
|
+
const r = e.geometries.get(f), s = a.GetGeometry(h, r.geometryExpressID), l = a.GetVertexArray(s.GetVertexData(), s.GetVertexDataSize()), i = a.GetIndexArray(s.GetIndexData(), s.GetIndexDataSize()), { positions: d, normals: C } = k(l);
|
|
57
|
+
if (d.length < 9) {
|
|
58
|
+
E(s);
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const y = new o.BufferGeometry();
|
|
62
|
+
y.setAttribute("position", new o.BufferAttribute(d, 3)), C && y.setAttribute("normal", new o.BufferAttribute(C, 3)), i.length > 0 && y.setIndex(new o.BufferAttribute(i, 1)), C || y.computeVertexNormals();
|
|
63
|
+
const D = r.color?.x ?? 0.75, I = r.color?.y ?? 0.75, L = r.color?.z ?? 0.75, g = r.color?.w ?? 1, Y = new o.Color(D > 1 ? D / 255 : D, I > 1 ? I / 255 : I, L > 1 ? L / 255 : L), $ = new o.MeshStandardMaterial({
|
|
64
|
+
color: Y,
|
|
65
|
+
metalness: 0.05,
|
|
66
|
+
roughness: 0.75,
|
|
67
|
+
side: o.DoubleSide,
|
|
68
|
+
transparent: g !== 1,
|
|
69
|
+
opacity: g !== 1 ? Math.min(1, Math.max(0.1, g)) : 1,
|
|
70
|
+
depthWrite: g === 1
|
|
71
|
+
}), B = new o.Mesh(y, $);
|
|
72
|
+
r.flatTransformation.length === 16 && B.applyMatrix4(new o.Matrix4().fromArray(r.flatTransformation)), u.add(B), E(s);
|
|
73
|
+
}
|
|
74
|
+
E(e);
|
|
75
|
+
}
|
|
76
|
+
}), u.children.length === 0)
|
|
77
|
+
throw a.CloseModel(h), a.Dispose(), new Error("IFC_NO_GEOMETRY");
|
|
78
|
+
H(), X(t);
|
|
79
|
+
const O = Math.max(1, t.clientWidth), S = Math.max(1, t.clientHeight), p = new o.PerspectiveCamera(50, O / S, 0.1, 5e5), c = new o.WebGLRenderer({ antialias: !0, alpha: !0 });
|
|
80
|
+
c.setPixelRatio(Math.min(window.devicePixelRatio, 2)), c.setSize(O, S), c.outputColorSpace = o.SRGBColorSpace, c.toneMapping = o.ACESFilmicToneMapping, c.toneMappingExposure = 1, t.appendChild(c.domElement);
|
|
81
|
+
const q = new o.AmbientLight(16777215, 1.1);
|
|
82
|
+
w.add(q);
|
|
83
|
+
const F = new o.DirectionalLight(16777215, 1);
|
|
84
|
+
F.position.set(40, 80, 60), w.add(F);
|
|
85
|
+
const z = new o.DirectionalLight(16777215, 0.35);
|
|
86
|
+
z.position.set(-60, 30, -40), w.add(z);
|
|
87
|
+
const x = new J(p, c.domElement);
|
|
88
|
+
x.enableDamping = !0, u.updateMatrixWorld(!0);
|
|
89
|
+
const b = new o.Box3().setFromObject(u);
|
|
90
|
+
if (b.isEmpty())
|
|
91
|
+
p.position.set(8, 8, 8), p.lookAt(0, 0, 0);
|
|
92
|
+
else {
|
|
93
|
+
const e = b.getSize(new o.Vector3()), n = b.getCenter(new o.Vector3()), m = Math.max(e.x, e.y, e.z, 1), f = m * 2.2;
|
|
94
|
+
p.position.set(n.x + f, n.y + f * 0.6, n.z + f), p.near = m / 1e3, p.far = m * 1e3, p.updateProjectionMatrix(), x.target.copy(n), x.update();
|
|
95
|
+
}
|
|
96
|
+
let W = 0;
|
|
97
|
+
const R = () => {
|
|
98
|
+
W = requestAnimationFrame(R), x.update(), c.render(w, p);
|
|
99
|
+
};
|
|
100
|
+
R();
|
|
101
|
+
const V = () => {
|
|
102
|
+
const e = Math.max(1, t.clientWidth), n = Math.max(1, t.clientHeight);
|
|
103
|
+
p.aspect = e / n, p.updateProjectionMatrix(), c.setSize(e, n);
|
|
104
|
+
}, _ = new ResizeObserver(V);
|
|
105
|
+
_.observe(t);
|
|
106
|
+
const U = () => {
|
|
107
|
+
cancelAnimationFrame(W), _.disconnect(), x.dispose(), c.dispose(), c.forceContextLoss(), c.domElement.parentElement === t && t.removeChild(c.domElement), u.traverse((e) => {
|
|
108
|
+
if (e instanceof o.Mesh) {
|
|
109
|
+
e.geometry.dispose();
|
|
110
|
+
const n = Array.isArray(e.material) ? e.material : [e.material];
|
|
111
|
+
for (const m of n)
|
|
112
|
+
m.dispose();
|
|
113
|
+
}
|
|
114
|
+
}), a.CloseModel(h), a.Dispose();
|
|
115
|
+
};
|
|
116
|
+
return V(), { dispose: U };
|
|
117
|
+
};
|
|
118
|
+
export {
|
|
119
|
+
te as createIfcWebViewer
|
|
120
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._spInput_8l55v_1{display:inline-flex;flex-direction:column;width:100%}._spInput_8l55v_1{opacity:1;visibility:visible}._spInput_8l55v_1{transition:all .3s ease-in-out}@starting-style{._spInput_8l55v_1{opacity:0;visibility:hidden}}._spInput_size-md_8l55v_19{--spui-input-control-font-size: 16px;--spui-input-error-font-size: 12px;--spui-input-control-height: var(--spui-control-height-md)}._spInput_size-xl_8l55v_24{--spui-input-control-font-size: 18px;--spui-input-error-font-size: 14px;--spui-input-control-height: var(--spui-control-height-xl)}._spInput_error_8l55v_29 ._spInput__control_8l55v_29{border-color:var(--spui-color-border-error);color:var(--spui-color-text-error)}._spInput_error_8l55v_29 ._spInput__control_8l55v_29:hover::placeholder{color:var(--spui-color-text-error)}._spInput_absolutePositionError_8l55v_36{position:relative}._spInput__container_8l55v_39{position:relative;width:100%}._spInput__control_8l55v_29{display:flex;height:var(--spui-input-control-height);padding:var(--spui-spacing-none) var(--spui-spacing-4x);align-items:center;align-self:stretch;width:100%;font-family:var(--spui-font-family-main),serif;font-weight:var(--spui-font-weight-regular);font-size:var(--spui-input-control-font-size);color:var(--spui-color-text-primary);text-overflow:ellipsis;white-space:nowrap;border-width:2px;border-style:solid}._spInput__control_filled_8l55v_59{border-color:var(--spui-color-border-secondary);background-color:var(--spui-color-surface-page)}._spInput__control_outlined_8l55v_63{background-color:var(--spui-color-surface-transparent);border-color:var(--spui-color-border-primary)}._spInput__control_disabled_8l55v_67{pointer-events:none;color:var(--spui-color-text-disabled)}._spInput__control_clearable_8l55v_71{padding-right:var(--spui-spacing-12x)}._spInput__control_8l55v_29::placeholder,._spInput__control_disabled_8l55v_67:hover::placeholder{color:var(--spui-color-text-secondary)}._spInput__control_8l55v_29:hover::placeholder{color:var(--spui-color-text-primary)}._spInput__control_8l55v_29:focus,._spInput__control_8l55v_29:focus-visible{outline:none;border-style:solid;border-color:var(--spui-color-border-action);background-color:var(--spui-color-surface-transparent)}._spInput__control_8l55v_29:focus:hover::placeholder,._spInput__control_8l55v_29:focus-visible:hover::placeholder{color:var(--spui-color-text-secondary)}._spInput__clearControl_8l55v_89{color:var(--spui-color-text-secondary);cursor:pointer;position:absolute;right:16px;top:0;bottom:0;margin:auto}._spInput__label_8l55v_98{margin-bottom:var(--spui-spacing-2x)}._spInput__error_8l55v_101{padding-top:var(--spui-spacing-2x);font-family:var(--spui-font-family-main),serif;font-weight:var(--spui-font-weight-regular);font-size:var(--spui-input-error-font-size);color:var(--spui-color-text-error)}._spInput__error_absolutePosition_8l55v_108{position:absolute;top:100%}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsxs as k, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import H from "@mona-health/react-input-mask";
|
|
3
|
+
import a from "clsx";
|
|
4
|
+
import J from "react";
|
|
5
|
+
import o from "./Input.module.scss.js";
|
|
6
|
+
import { Label as K } from "../Label/Label.js";
|
|
7
|
+
import { Icon as O } from "../Icons/Icon.js";
|
|
8
|
+
import { EIconName as Q } from "../Icons/types/index.js";
|
|
9
|
+
const U = J.forwardRef((P, i) => {
|
|
10
|
+
const {
|
|
11
|
+
value: s,
|
|
12
|
+
size: m = "xl",
|
|
13
|
+
onChange: c,
|
|
14
|
+
onBlur: w,
|
|
15
|
+
label: _,
|
|
16
|
+
variant: N = "outlined",
|
|
17
|
+
disabled: l = !1,
|
|
18
|
+
isAbsolutePositionError: d = !1,
|
|
19
|
+
error: n,
|
|
20
|
+
required: L,
|
|
21
|
+
name: p,
|
|
22
|
+
isClearable: I,
|
|
23
|
+
pattern: f,
|
|
24
|
+
onMouseEnter: y,
|
|
25
|
+
infoTooltipText: M,
|
|
26
|
+
tooltipPosition: j,
|
|
27
|
+
isVisibleDefaultTitle: C = !0,
|
|
28
|
+
placeholder: b = "Введите...",
|
|
29
|
+
classNameRoot: h,
|
|
30
|
+
classNameError: v,
|
|
31
|
+
classNameLabel: R,
|
|
32
|
+
classNameBaseTooltipRoot: z,
|
|
33
|
+
alwaysShowMask: $ = !1,
|
|
34
|
+
mask: g,
|
|
35
|
+
maskChar: q = "_",
|
|
36
|
+
...B
|
|
37
|
+
} = P, A = a({
|
|
38
|
+
[o.spInput]: !0,
|
|
39
|
+
[o[`spInput_size-${m}`]]: m,
|
|
40
|
+
[o.spInput_error]: !!n,
|
|
41
|
+
[o.spInput_absolutePositionError]: d,
|
|
42
|
+
...h && { [h]: !0 }
|
|
43
|
+
}), D = a({
|
|
44
|
+
[o.spInput__container]: !0
|
|
45
|
+
}), E = a({
|
|
46
|
+
[o.spInput__control]: !0,
|
|
47
|
+
[o.spInput__control_disabled]: l,
|
|
48
|
+
[o[`spInput__control_${N}`]]: N,
|
|
49
|
+
[o.spInput__control_clearable]: I
|
|
50
|
+
}), S = a({
|
|
51
|
+
[o.spInput__clearControl]: !0
|
|
52
|
+
}), V = a({
|
|
53
|
+
[o.spInput__error]: !0,
|
|
54
|
+
[o.spInput__error_absolutePosition]: d,
|
|
55
|
+
...v && { [v]: !0 }
|
|
56
|
+
}), F = a({
|
|
57
|
+
[o.spInput__label]: !0,
|
|
58
|
+
...R && { [R]: !0 }
|
|
59
|
+
}), G = (e) => {
|
|
60
|
+
c?.(e, { name: p, value: "" });
|
|
61
|
+
}, x = (e) => {
|
|
62
|
+
const { value: t, name: u } = e.target;
|
|
63
|
+
f && t && !new RegExp(f).test(t) || c?.(e, { value: t, name: u });
|
|
64
|
+
}, T = (e) => {
|
|
65
|
+
const { value: t, name: u } = e.target;
|
|
66
|
+
w?.(e, { name: u, value: t });
|
|
67
|
+
};
|
|
68
|
+
return /* @__PURE__ */ k("div", { className: A, children: [
|
|
69
|
+
_ && /* @__PURE__ */ r(
|
|
70
|
+
K,
|
|
71
|
+
{
|
|
72
|
+
classNameRoot: F,
|
|
73
|
+
tooltipPosition: j,
|
|
74
|
+
required: L,
|
|
75
|
+
label: _,
|
|
76
|
+
infoTooltipText: M,
|
|
77
|
+
classNameBaseTooltipRoot: z
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ k("div", { className: D, onMouseEnter: y, children: [
|
|
81
|
+
g ? /* @__PURE__ */ r(
|
|
82
|
+
H,
|
|
83
|
+
{
|
|
84
|
+
...B,
|
|
85
|
+
placeholder: b,
|
|
86
|
+
disabled: l,
|
|
87
|
+
onChange: x,
|
|
88
|
+
onBlur: T,
|
|
89
|
+
title: C ? s : void 0,
|
|
90
|
+
value: s,
|
|
91
|
+
name: p,
|
|
92
|
+
className: E,
|
|
93
|
+
ref: i,
|
|
94
|
+
alwaysShowMask: $,
|
|
95
|
+
mask: g,
|
|
96
|
+
maskPlaceholder: q
|
|
97
|
+
}
|
|
98
|
+
) : /* @__PURE__ */ r(
|
|
99
|
+
"input",
|
|
100
|
+
{
|
|
101
|
+
...B,
|
|
102
|
+
placeholder: b,
|
|
103
|
+
disabled: l,
|
|
104
|
+
onChange: x,
|
|
105
|
+
onBlur: T,
|
|
106
|
+
title: C ? s : void 0,
|
|
107
|
+
value: s,
|
|
108
|
+
name: p,
|
|
109
|
+
className: E,
|
|
110
|
+
ref: i
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
I && s && !l && /* @__PURE__ */ r(O, { onClick: G, className: S, name: Q.Trash })
|
|
114
|
+
] }),
|
|
115
|
+
n && /* @__PURE__ */ r("div", { className: V, children: n })
|
|
116
|
+
] });
|
|
117
|
+
});
|
|
118
|
+
U.displayName = "Input";
|
|
119
|
+
export {
|
|
120
|
+
U as Input
|
|
121
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import './Input.css';const _ = "_spInput_8l55v_1", t = "_spInput_error_8l55v_29", n = "_spInput__control_8l55v_29", o = "_spInput_absolutePositionError_8l55v_36", p = "_spInput__container_8l55v_39", s = "_spInput__control_filled_8l55v_59", l = "_spInput__control_outlined_8l55v_63", r = "_spInput__control_disabled_8l55v_67", u = "_spInput__control_clearable_8l55v_71", e = "_spInput__clearControl_8l55v_89", I = "_spInput__label_8l55v_98", c = "_spInput__error_8l55v_101", i = "_spInput__error_absolutePosition_8l55v_108", a = {
|
|
2
|
+
spInput: _,
|
|
3
|
+
"spInput_size-md": "_spInput_size-md_8l55v_19",
|
|
4
|
+
"spInput_size-xl": "_spInput_size-xl_8l55v_24",
|
|
5
|
+
spInput_error: t,
|
|
6
|
+
spInput__control: n,
|
|
7
|
+
spInput_absolutePositionError: o,
|
|
8
|
+
spInput__container: p,
|
|
9
|
+
spInput__control_filled: s,
|
|
10
|
+
spInput__control_outlined: l,
|
|
11
|
+
spInput__control_disabled: r,
|
|
12
|
+
spInput__control_clearable: u,
|
|
13
|
+
spInput__clearControl: e,
|
|
14
|
+
spInput__label: I,
|
|
15
|
+
spInput__error: c,
|
|
16
|
+
spInput__error_absolutePosition: i
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
a as default,
|
|
20
|
+
_ as spInput,
|
|
21
|
+
e as spInput__clearControl,
|
|
22
|
+
p as spInput__container,
|
|
23
|
+
n as spInput__control,
|
|
24
|
+
u as spInput__control_clearable,
|
|
25
|
+
r as spInput__control_disabled,
|
|
26
|
+
s as spInput__control_filled,
|
|
27
|
+
l as spInput__control_outlined,
|
|
28
|
+
c as spInput__error,
|
|
29
|
+
i as spInput__error_absolutePosition,
|
|
30
|
+
I as spInput__label,
|
|
31
|
+
o as spInput_absolutePositionError,
|
|
32
|
+
t as spInput_error
|
|
33
|
+
};
|