@sps-woodland/core 8.56.2 → 8.56.4
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/lib/action-bar/action-bar/ActionBar.js +44 -59
- package/lib/action-bar/action-bar/ActionBar.ve.js +4 -11
- package/lib/action-bar/action-bar-additional-content/ActionBarAdditionalContent.js +14 -22
- package/lib/action-bar/index.js +54 -74
- package/lib/action-bar/index.umd.cjs +1 -1
- package/lib/action-bar/style.css +2 -1
- package/lib/add-to-list/add-to-list/AddToList.js +220 -302
- package/lib/add-to-list/add-to-list/AddToList.ve.js +79 -24
- package/lib/add-to-list/add-to-list/ItemsList.js +42 -67
- package/lib/add-to-list/add-to-list/ListItem.js +24 -50
- package/lib/add-to-list/index.js +393 -453
- package/lib/add-to-list/index.umd.cjs +1 -1
- package/lib/add-to-list/style.css +2 -1
- package/lib/buttons/button/Button.js +95 -121
- package/lib/buttons/button/Button.ve.js +150 -9
- package/lib/buttons/index.js +281 -171
- package/lib/buttons/index.umd.cjs +1 -1
- package/lib/buttons/style.css +2 -1
- package/lib/cards/card/Card.js +19 -27
- package/lib/cards/card/Card.ve.js +4 -4
- package/lib/cards/card-footer/CardFooter.js +12 -13
- package/lib/cards/card-footer/CardFooter.ve.js +4 -4
- package/lib/cards/card-header/CardHeader.js +12 -13
- package/lib/cards/card-header/CardHeader.ve.js +4 -4
- package/lib/cards/card-title/CardTitle.js +11 -12
- package/lib/cards/card-title/CardTitle.ve.js +4 -4
- package/lib/cards/index.js +52 -52
- package/lib/cards/index.umd.cjs +1 -1
- package/lib/cards/style.css +2 -1
- package/lib/column-manager/column-manager/ColumnManager.js +95 -112
- package/lib/column-manager/column-manager/useColumnManager.js +59 -48
- package/lib/column-manager/index.js +2 -5
- package/lib/components/icon/Icon.ve.js +15 -5
- package/lib/components/icon/icons/sprite.svg.js +4 -4
- package/lib/content-row/content-row/ContentRow.js +146 -173
- package/lib/content-row/content-row/ContentRow.ve.js +105 -18
- package/lib/content-row/content-row-col/ContentRowCol.js +37 -48
- package/lib/content-row/content-row-col/ContentRowCol.ve.js +49 -6
- package/lib/content-row/content-row-expansion/ContentRowExpansion.js +16 -24
- package/lib/content-row/index.js +407 -318
- package/lib/content-row/index.umd.cjs +1 -1
- package/lib/content-row/row-list-auto-layout/RowListAutoLayout.js +24 -39
- package/lib/content-row/row-list-auto-layout/RowListAutoLayout.ve.js +13 -5
- package/lib/content-row/style.css +2 -1
- package/lib/content-tiles/content-tile/ContentTile.js +71 -60
- package/lib/content-tiles/content-tile/ContentTile.ve.js +36 -14
- package/lib/content-tiles/content-tile-list/ContentTileList.js +12 -13
- package/lib/content-tiles/content-tile-list/ContentTileList.ve.js +4 -5
- package/lib/content-tiles/index.js +156 -118
- package/lib/content-tiles/index.umd.cjs +1 -1
- package/lib/content-tiles/style.css +2 -1
- package/lib/core.css +2 -1
- package/lib/dropdowns/dropdown/Dropdown.js +56 -68
- package/lib/dropdowns/dropdown/Dropdown.ve.js +37 -8
- package/lib/dropdowns/index.js +171 -171
- package/lib/dropdowns/index.umd.cjs +1 -1
- package/lib/dropdowns/option-list/Option.js +14 -18
- package/lib/dropdowns/option-list/Option.ve.js +4 -5
- package/lib/dropdowns/option-list/OptionList.js +28 -44
- package/lib/dropdowns/option-list/OptionList.ve.js +4 -5
- package/lib/dropdowns/style.css +2 -1
- package/lib/editable-table/EditableTable.js +68 -85
- package/lib/editable-table/index.js +1 -4
- package/lib/feedback-block/FeedbackBlock.js +40 -35
- package/lib/feedback-block/FeedbackBlock.ve.js +56 -7
- package/lib/feedback-block/index.js +132 -85
- package/lib/feedback-block/index.umd.cjs +1 -1
- package/lib/feedback-block/style.css +2 -1
- package/lib/file-upload/file-upload/FileUpload.js +164 -202
- package/lib/file-upload/file-upload/FileUpload.ve.js +84 -18
- package/lib/file-upload/file-upload/mime-type.enum.js +106 -106
- package/lib/file-upload/index.js +390 -353
- package/lib/file-upload/index.umd.cjs +1 -1
- package/lib/file-upload/style.css +2 -1
- package/lib/filter-tiles/filter-tile/FilterTile.js +41 -46
- package/lib/filter-tiles/filter-tile/FilterTile.ve.js +51 -9
- package/lib/filter-tiles/filter-tile-set/FilterTileSet.js +12 -15
- package/lib/filter-tiles/filter-tile-set/FilterTileSet.ve.js +4 -4
- package/lib/filter-tiles/index.js +142 -107
- package/lib/filter-tiles/index.umd.cjs +1 -1
- package/lib/filter-tiles/style.css +2 -1
- package/lib/focused-task/focused-task/FocusedTask.js +52 -74
- package/lib/focused-task/focused-task/FocusedTask.ve.js +13 -12
- package/lib/focused-task/focused-task/useFocusedTask.js +20 -18
- package/lib/focused-task/focused-task-actions/FocusedTaskActions.js +12 -13
- package/lib/focused-task/index.js +127 -144
- package/lib/focused-task/index.umd.cjs +1 -1
- package/lib/focused-task/style.css +2 -1
- package/lib/growler/Growler.js +78 -90
- package/lib/growler/Growler.ve.js +23 -12
- package/lib/growler/GrowlerListProvider.js +38 -39
- package/lib/growler/Sonner.ve.js +17 -12
- package/lib/growler/index.js +249 -274
- package/lib/growler/index.umd.cjs +1 -1
- package/lib/growler/sonner.js +73 -102
- package/lib/growler/style.css +2 -1
- package/lib/index.js +520 -501
- package/lib/index.umd.cjs +4 -4
- package/lib/insight-card/InsightCard.js +90 -84
- package/lib/insight-card/InsightCard.ve.js +148 -15
- package/lib/insight-card/InsightCardSet.js +12 -12
- package/lib/insight-card/index.js +269 -141
- package/lib/insight-card/index.umd.cjs +1 -1
- package/lib/insight-card/style.css +2 -1
- package/lib/key-value-set/index.js +97 -87
- package/lib/key-value-set/index.umd.cjs +1 -1
- package/lib/key-value-set/key-value-set/KeyValueSet.js +17 -21
- package/lib/key-value-set/key-value-set/KeyValueSet.ve.js +10 -5
- package/lib/key-value-set/key-value-set-item/KeyValueSetItem.js +25 -21
- package/lib/key-value-set/key-value-set-item/KeyValueSetItem.ve.js +13 -6
- package/lib/key-value-set/style.css +2 -1
- package/lib/list-bar/advanced-search/AdvancedSearch.js +51 -54
- package/lib/list-bar/advanced-search/AdvancedSearch.ve.js +30 -8
- package/lib/list-bar/index.js +305 -301
- package/lib/list-bar/index.umd.cjs +1 -1
- package/lib/list-bar/list-bar/InputGroupWrapper.js +10 -19
- package/lib/list-bar/list-bar/ListBar.js +105 -121
- package/lib/list-bar/list-bar/ListBar.ve.js +13 -17
- package/lib/list-bar/list-bar/ListBarSearch.js +20 -21
- package/lib/list-bar/list-bar/ListBarSearchInfo.js +8 -12
- package/lib/list-bar/list-bar/ListBarSortBy.js +28 -38
- package/lib/list-bar/search-results-bar/SearchResultsBar.js +38 -28
- package/lib/list-bar/search-results-bar/SearchResultsBar.ve.js +4 -11
- package/lib/list-bar/style.css +2 -1
- package/lib/matrix/index.js +79 -87
- package/lib/matrix/index.umd.cjs +1 -1
- package/lib/matrix/matrix/Matrix.js +18 -26
- package/lib/matrix/matrix/Matrix.ve.js +4 -7
- package/lib/matrix/matrix-body/MatrixBody.js +10 -13
- package/lib/matrix/matrix-cell/MatrixCell.js +23 -18
- package/lib/matrix/matrix-head/MatrixHead.js +10 -13
- package/lib/matrix/matrix-header/MatrixHeader.js +20 -23
- package/lib/matrix/matrix-row/MatrixRow.js +10 -13
- package/lib/matrix/style.css +2 -1
- package/lib/modal/index.js +197 -187
- package/lib/modal/index.umd.cjs +1 -1
- package/lib/modal/modal/Modal.js +90 -108
- package/lib/modal/modal/Modal.ve.js +43 -13
- package/lib/modal/modal/useModal.js +19 -24
- package/lib/modal/modal-footer/ModalFooter.js +11 -12
- package/lib/modal/style.css +2 -1
- package/lib/node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.21.3/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js +49 -0
- package/lib/node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/index.browser.js +8 -10
- package/lib/node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/url-alphabet/index.js +4 -4
- package/lib/page-title/heading-level/HeadingLevel.js +8 -12
- package/lib/page-title/index.js +33 -40
- package/lib/page-title/index.umd.cjs +1 -1
- package/lib/page-title/page-subtitle/PageSubtitle.js +13 -18
- package/lib/page-title/page-subtitle/PageSubtitle.ve.js +4 -5
- package/lib/page-title/page-title/PageTitle.js +15 -19
- package/lib/page-title/page-title/PageTitle.ve.js +4 -7
- package/lib/page-title/style.css +2 -1
- package/lib/photo/index.js +174 -177
- package/lib/photo/index.umd.cjs +1 -1
- package/lib/photo/photo/Photo.js +72 -81
- package/lib/photo/photo/Photo.ve.js +21 -7
- package/lib/photo/photo-carousel/PhotoCarousel.js +36 -51
- package/lib/photo/photo-carousel/PhotoCarousel.ve.js +13 -9
- package/lib/photo/style.css +2 -1
- package/lib/product-bar/hooks/usePriorityPlus.js +88 -104
- package/lib/product-bar/index.js +372 -395
- package/lib/product-bar/index.umd.cjs +1 -1
- package/lib/product-bar/product-bar/ProductBar.js +77 -103
- package/lib/product-bar/product-bar/ProductBar.ve.js +46 -15
- package/lib/product-bar/product-bar-name/ProductBarName.js +37 -40
- package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.js +48 -70
- package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.ve.js +4 -8
- package/lib/product-bar/product-bar-tab/ProductBarTab.js +28 -26
- package/lib/product-bar/slack-link/SlackLink.js +26 -30
- package/lib/product-bar/slack-link/SlackLink.ve.js +4 -5
- package/lib/product-bar/style.css +2 -1
- package/lib/product-bar-vertical/index.js +240 -251
- package/lib/product-bar-vertical/index.umd.cjs +1 -1
- package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.js +42 -61
- package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.ve.js +53 -23
- package/lib/product-bar-vertical/product-bar-vertical-header/ProductBarVerticalHeader.js +30 -42
- package/lib/product-bar-vertical/product-bar-vertical-item/ProductBarVerticalItem.js +71 -89
- package/lib/product-bar-vertical/product-bar-vertical-section/ProductBarVerticalSection.js +22 -29
- package/lib/product-bar-vertical/style.css +2 -1
- package/lib/progress-indicators/index.js +372 -255
- package/lib/progress-indicators/index.umd.cjs +1 -1
- package/lib/progress-indicators/progress-bar/ProgressBar.js +66 -110
- package/lib/progress-indicators/progress-bar/ProgressBar.ve.js +66 -13
- package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.js +34 -54
- package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.ve.js +136 -8
- package/lib/progress-indicators/progress-ring/ProgressRing.js +45 -52
- package/lib/progress-indicators/style.css +2 -1
- package/lib/rich-text-editor/index.js +556 -582
- package/lib/rich-text-editor/index.umd.cjs +11 -11
- package/lib/rich-text-editor/rich-text-editor/RTELinkModal.js +29 -33
- package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.js +23 -37
- package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.ve.js +13 -6
- package/lib/rich-text-editor/rich-text-editor/RichTextEditor.js +68 -77
- package/lib/rich-text-editor/rich-text-editor/RichTextEditor.ve.js +21 -8
- package/lib/rich-text-editor/rich-text-editor/hooks/useHtmlToMd.js +14 -20
- package/lib/rich-text-editor/rich-text-editor/hooks/useMdToHtml.js +14 -20
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTEContent.js +33 -27
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTEObserver.js +79 -88
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTESelectionListener.js +28 -36
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTEToolbarButtons.js +195 -211
- package/lib/rich-text-editor/rich-text-editor/icons/BOLD.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/INDENT.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/ITALICS.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/LINK.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/ORDERED_LIST.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/OUTDENT.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/REDO.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/UNDO.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/UNLINK.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/UNORDERED_LIST.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/utils/flattenListItemParagraphs.js +12 -12
- package/lib/rich-text-editor/rich-text-editor/utils/removeUnrepresentableBreaks.js +20 -19
- package/lib/rich-text-editor/rich-text-editor/utils/utils.js +11 -15
- package/lib/rich-text-editor/style.css +2 -1
- package/lib/scrollable-container/ScrollableContainer.js +18 -27
- package/lib/scrollable-container/ScrollableContainer.ve.js +4 -4
- package/lib/scrollable-container/index.js +20 -27
- package/lib/scrollable-container/index.umd.cjs +1 -1
- package/lib/scrollable-container/style.css +2 -1
- package/lib/side-nav/index.js +190 -228
- package/lib/side-nav/index.umd.cjs +1 -1
- package/lib/side-nav/side-nav/SideNav.js +43 -60
- package/lib/side-nav/side-nav/SideNav.ve.js +22 -16
- package/lib/side-nav/side-nav/navContext.js +7 -7
- package/lib/side-nav/side-nav-header/SideNavHeader.js +14 -15
- package/lib/side-nav/side-nav-item/SideNavItem.js +68 -94
- package/lib/side-nav/side-nav-section/SideNavSection.js +16 -26
- package/lib/side-nav/style.css +2 -1
- package/lib/sorting-header/caret/caret.ve.js +13 -5
- package/lib/sorting-header/index.js +269 -251
- package/lib/sorting-header/index.umd.cjs +1 -1
- package/lib/sorting-header/sorting-header/SortingHeader.js +110 -124
- package/lib/sorting-header/sorting-header/SortingHeader.ve.js +30 -6
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.js +69 -83
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.ve.js +21 -7
- package/lib/sorting-header/style.css +2 -1
- package/lib/style.css +2 -1
- package/lib/tabs/index.js +255 -201
- package/lib/tabs/index.umd.cjs +1 -1
- package/lib/tabs/style.css +2 -1
- package/lib/tabs/tab/Tab.js +24 -27
- package/lib/tabs/tab/Tab.ve.js +76 -6
- package/lib/tabs/tab-panel/TabPanel.js +16 -25
- package/lib/tabs/tabs/Tabs.js +101 -112
- package/lib/tabs/tabs/Tabs.ve.js +13 -11
- package/lib/tags/clickable-tag/ClickableTag.js +86 -90
- package/lib/tags/clickable-tag/ClickableTag.ve.js +66 -9
- package/lib/tags/index.js +342 -199
- package/lib/tags/index.umd.cjs +1 -1
- package/lib/tags/split-tag/SplitTag.js +49 -30
- package/lib/tags/split-tag/SplitTag.ve.js +35 -9
- package/lib/tags/style.css +2 -1
- package/lib/tags/tag/Tag.js +42 -38
- package/lib/tags/tag/Tag.ve.js +41 -6
- package/lib/utils/cl.js +5 -5
- package/lib/zero-state/ZeroState.js +36 -29
- package/lib/zero-state/ZeroState.ve.js +29 -11
- package/lib/zero-state/index.js +103 -78
- package/lib/zero-state/index.umd.cjs +1 -1
- package/lib/zero-state/style.css +2 -1
- package/package.json +12 -12
- package/lib/node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.17.4/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js +0 -57
package/lib/file-upload/index.js
CHANGED
|
@@ -1,361 +1,398 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
|
-
import { Metadata as
|
|
3
|
-
import { parseFileSize as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { GENERAL_ERROR_LARGE as
|
|
6
|
-
import { useWoodlandLanguage as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
2
|
+
import { Metadata as t, Spinner as n, cl as r } from "@sps-woodland/core";
|
|
3
|
+
import { parseFileSize as i } from "@spscommerce/utils";
|
|
4
|
+
import { Button as a } from "@sps-woodland/core/button";
|
|
5
|
+
import { GENERAL_ERROR_LARGE as o, UPLOAD_LARGE as s } from "@sps-woodland/illustrations";
|
|
6
|
+
import { useWoodlandLanguage as c } from "@spscommerce/i18n";
|
|
7
|
+
//#region src/file-upload/file-upload/mime-type.enum.ts
|
|
8
|
+
var l = {
|
|
9
|
+
"7Z": ["application/x-7z-compressed"],
|
|
10
|
+
AAC: ["audio/aac"],
|
|
11
|
+
ABW: ["application/x-abiword"],
|
|
12
|
+
ARC: ["application/octet-stream"],
|
|
13
|
+
AVI: ["video/x-msvideo"],
|
|
14
|
+
AZW: ["application/vnd.amazon.ebook"],
|
|
15
|
+
BIN: ["application/octet-stream"],
|
|
16
|
+
BMP: ["image/bmp"],
|
|
17
|
+
BZ: ["application/x-bzip"],
|
|
18
|
+
BZ2: ["application/x-bzip2"],
|
|
19
|
+
CER: ["application/pkix-cert", "application/x-x509-ca-cert"],
|
|
20
|
+
CSH: ["application/x-csh"],
|
|
21
|
+
CSS: ["text/css"],
|
|
22
|
+
CSV: ["text/csv", "application/vnd.ms-excel"],
|
|
23
|
+
DOC: ["application/msword"],
|
|
24
|
+
DOT: ["application/msword"],
|
|
25
|
+
DOCX: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
|
|
26
|
+
DOTX: ["application/vnd.openxmlformats-officedocument.wordprocessingml.template"],
|
|
27
|
+
DOCM: ["application/vnd.ms-word.document.macroEnabled.12"],
|
|
28
|
+
DOTM: ["application/vnd.ms-word.template.macroEnabled.12"],
|
|
29
|
+
EDI: ["application/edi-x12", "application/edifact"],
|
|
30
|
+
EML: [
|
|
31
|
+
"application/octet-stream",
|
|
32
|
+
"message/rfc822",
|
|
33
|
+
"multipart/mixed",
|
|
34
|
+
"message/rfc5322",
|
|
35
|
+
"message/rfc6532"
|
|
36
|
+
],
|
|
37
|
+
EOT: ["application/vnd.ms-fontobject"],
|
|
38
|
+
EPUB: ["application/epub+zip"],
|
|
39
|
+
ES: ["application/ecmascript"],
|
|
40
|
+
FLV: ["video/x-flv"],
|
|
41
|
+
GIF: ["image/gif"],
|
|
42
|
+
GZ: ["application/x-gzip"],
|
|
43
|
+
HTM: ["text/html"],
|
|
44
|
+
HTML: ["text/html"],
|
|
45
|
+
ICO: ["image/x-icon"],
|
|
46
|
+
ICS: ["text/calendar"],
|
|
47
|
+
JAR: ["application/java-archive"],
|
|
48
|
+
JPEG: ["image/jpeg"],
|
|
49
|
+
JPG: ["image/jpeg"],
|
|
50
|
+
JS: ["application/javascript"],
|
|
51
|
+
JSON: ["application/json"],
|
|
52
|
+
M3U: ["audio/x-mpequrl"],
|
|
53
|
+
MID: ["audio/midi"],
|
|
54
|
+
MIDI: ["audio/midi"],
|
|
55
|
+
MOV: ["video/quicktime"],
|
|
56
|
+
MP3: ["audio/mpeg3"],
|
|
57
|
+
MP4: ["video/mp4"],
|
|
58
|
+
MPEG: ["video/mpeg"],
|
|
59
|
+
MPKG: ["application/vnd.apple.installer+xml"],
|
|
60
|
+
ODP: ["application/vnd.oasis.opendocument.presentation"],
|
|
61
|
+
ODS: ["application/vnd.oasis.opendocument.spreadsheet"],
|
|
62
|
+
ODT: ["application/vnd.oasis.opendocument.text"],
|
|
63
|
+
OGA: ["audio/ogg"],
|
|
64
|
+
OGV: ["video/ogg"],
|
|
65
|
+
OGX: ["application/ogg"],
|
|
66
|
+
OTF: ["font/otf"],
|
|
67
|
+
PNG: ["image/png"],
|
|
68
|
+
PDF: ["application/pdf"],
|
|
69
|
+
POT: ["application/vnd.ms-powerpoint"],
|
|
70
|
+
POTM: ["application/vnd.ms-powerpoint.template.macroEnabled.12"],
|
|
71
|
+
POTX: ["application/vnd.openxmlformats-officedocument.presentationml.template"],
|
|
72
|
+
PPA: ["application/vnd.ms-powerpoint"],
|
|
73
|
+
PPAM: ["application/vnd.ms-powerpoint.addin.macroEnabled.12"],
|
|
74
|
+
PPS: ["application/vnd.ms-powerpoint"],
|
|
75
|
+
PPSM: ["application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],
|
|
76
|
+
PPT: ["application/vnd.ms-powerpoint"],
|
|
77
|
+
PPTM: ["application/vnd.ms-powerpoint.presentation.macroEnabled.12"],
|
|
78
|
+
PPSX: ["application/vnd.openxmlformats-officedocument.presentationml.slideshow"],
|
|
79
|
+
PPTX: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
|
|
80
|
+
RAR: ["application/x-rar-compressed"],
|
|
81
|
+
RTF: ["application/rtf"],
|
|
82
|
+
SH: ["application/x-sh"],
|
|
83
|
+
SVG: ["image/svg+xml"],
|
|
84
|
+
SWF: ["application/x-shockwave-flash"],
|
|
85
|
+
TAR: ["application/x-tar"],
|
|
86
|
+
TIF: ["image/tiff"],
|
|
87
|
+
TIFF: ["image/tiff"],
|
|
88
|
+
TS: ["application/typescript"],
|
|
89
|
+
TTF: ["font/ttf"],
|
|
90
|
+
TXT: ["text/plain"],
|
|
91
|
+
VSD: ["application/vnd.visio"],
|
|
92
|
+
WAV: ["audio/wav"],
|
|
93
|
+
WEBA: ["audio/webm"],
|
|
94
|
+
WEBM: ["video/webm"],
|
|
95
|
+
WEBP: ["image/webp"],
|
|
96
|
+
WOFF: ["font/woff"],
|
|
97
|
+
WOFF2: ["font/woff2"],
|
|
98
|
+
XHTML: ["application/xhtml+xml"],
|
|
99
|
+
XLA: ["application/vnd.ms-excel"],
|
|
100
|
+
XLS: ["application/vnd.ms-excel"],
|
|
101
|
+
XLSB: ["application/vnd.ms-excel.sheet.binary.macroEnabled.12"],
|
|
102
|
+
XLT: ["application/vnd.ms-excel"],
|
|
103
|
+
XLAM: ["application/vnd.ms-excel.addin.macroEnabled.12"],
|
|
104
|
+
XLSM: ["application/vnd.ms-excel.sheet.macroEnabled.12"],
|
|
105
|
+
XLSX: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
|
|
106
|
+
XLTM: ["application/vnd.ms-excel.template.macroEnabled.12"],
|
|
107
|
+
XLTX: ["application/vnd.openxmlformats-officedocument.spreadsheetml.template"],
|
|
108
|
+
XML: ["application/xml"],
|
|
109
|
+
XUL: ["application/vnd.mozilla.xul+xml"],
|
|
110
|
+
ZIP: ["application/zip"]
|
|
110
111
|
};
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region ../../../node_modules/.pnpm/@vanilla-extract+recipes@0.2.5_@vanilla-extract+css@1.21.3/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js
|
|
114
|
+
function u(e, t, n) {
|
|
115
|
+
return t in e ? Object.defineProperty(e, t, {
|
|
116
|
+
value: n,
|
|
117
|
+
enumerable: !0,
|
|
118
|
+
configurable: !0,
|
|
119
|
+
writable: !0
|
|
120
|
+
}) : e[t] = n, e;
|
|
118
121
|
}
|
|
119
|
-
function
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
function d(e, t) {
|
|
123
|
+
var n = Object.keys(e);
|
|
124
|
+
if (Object.getOwnPropertySymbols) {
|
|
125
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
126
|
+
t && (r = r.filter(function(t) {
|
|
127
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
128
|
+
})), n.push.apply(n, r);
|
|
129
|
+
}
|
|
130
|
+
return n;
|
|
128
131
|
}
|
|
129
|
-
function
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
132
|
+
function f(e) {
|
|
133
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
134
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
135
|
+
t % 2 ? d(Object(n), !0).forEach(function(t) {
|
|
136
|
+
u(e, t, n[t]);
|
|
137
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : d(Object(n)).forEach(function(t) {
|
|
138
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
return e;
|
|
139
142
|
}
|
|
140
|
-
var
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
143
|
+
var p = (e, t, n) => {
|
|
144
|
+
for (var r of Object.keys(e)) if (e[r] !== (t[r] ?? n[r])) return !1;
|
|
145
|
+
return !0;
|
|
146
|
+
}, m = (e) => (t) => {
|
|
147
|
+
var n = e.defaultClassName, r = f(f({}, e.defaultVariants), t);
|
|
148
|
+
for (var i in r) {
|
|
149
|
+
var a = r[i] ?? e.defaultVariants[i];
|
|
150
|
+
if (a != null) {
|
|
151
|
+
var o = a;
|
|
152
|
+
typeof o == "boolean" && (o = o === !0 ? "true" : "false");
|
|
153
|
+
var s = e.variantClassNames[i][o];
|
|
154
|
+
s && (n += " " + s);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
for (var [c, l] of e.compoundVariants) p(c, r, e.defaultVariants) && (n += " " + l);
|
|
158
|
+
return n;
|
|
159
|
+
}, h = m({
|
|
160
|
+
defaultClassName: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zk0",
|
|
161
|
+
variantClassNames: {
|
|
162
|
+
active: {
|
|
163
|
+
true: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zk1",
|
|
164
|
+
false: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zk2"
|
|
165
|
+
},
|
|
166
|
+
mini: {
|
|
167
|
+
true: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zk3",
|
|
168
|
+
false: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zk4"
|
|
169
|
+
},
|
|
170
|
+
error: {
|
|
171
|
+
true: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zk5",
|
|
172
|
+
false: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zk6"
|
|
173
|
+
},
|
|
174
|
+
shown: {
|
|
175
|
+
true: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zk7",
|
|
176
|
+
false: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zk8"
|
|
177
|
+
},
|
|
178
|
+
disabled: {
|
|
179
|
+
true: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zk9",
|
|
180
|
+
false: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zka"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
defaultVariants: {
|
|
184
|
+
active: !1,
|
|
185
|
+
mini: !1,
|
|
186
|
+
error: !1,
|
|
187
|
+
shown: !0,
|
|
188
|
+
disabled: !1
|
|
189
|
+
},
|
|
190
|
+
compoundVariants: []
|
|
191
|
+
}), g = m({
|
|
192
|
+
defaultClassName: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkb",
|
|
193
|
+
variantClassNames: {
|
|
194
|
+
constrainContentWidth: {
|
|
195
|
+
true: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkc",
|
|
196
|
+
false: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkd"
|
|
197
|
+
},
|
|
198
|
+
disabled: {
|
|
199
|
+
true: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zke",
|
|
200
|
+
false: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkf"
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
defaultVariants: {
|
|
204
|
+
constrainContentWidth: !1,
|
|
205
|
+
disabled: !1
|
|
206
|
+
},
|
|
207
|
+
compoundVariants: []
|
|
208
|
+
}), _ = "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkg", ee = m({
|
|
209
|
+
defaultClassName: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkh",
|
|
210
|
+
variantClassNames: {
|
|
211
|
+
mini: {
|
|
212
|
+
true: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zki",
|
|
213
|
+
false: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkj"
|
|
214
|
+
},
|
|
215
|
+
error: {
|
|
216
|
+
true: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkk",
|
|
217
|
+
false: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkl"
|
|
218
|
+
},
|
|
219
|
+
disabled: {
|
|
220
|
+
true: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkm",
|
|
221
|
+
false: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkn"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
defaultVariants: {
|
|
225
|
+
mini: !1,
|
|
226
|
+
error: !1,
|
|
227
|
+
disabled: !1
|
|
228
|
+
},
|
|
229
|
+
compoundVariants: []
|
|
230
|
+
}), te = m({
|
|
231
|
+
defaultClassName: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zko",
|
|
232
|
+
variantClassNames: { mini: {
|
|
233
|
+
true: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkp",
|
|
234
|
+
false: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkq"
|
|
235
|
+
} },
|
|
236
|
+
defaultVariants: { mini: !1 },
|
|
237
|
+
compoundVariants: []
|
|
238
|
+
}), v = "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkr", y = "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zks", b = "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkt", x = "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkv", S = "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zky", ne = "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkz";
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region src/file-upload/file-upload/FileUpload.tsx
|
|
241
|
+
function C({ list: t }) {
|
|
242
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, t.map((n, r) => {
|
|
243
|
+
let i = Math.floor(n.length / 2);
|
|
244
|
+
return /* @__PURE__ */ e.createElement("div", {
|
|
245
|
+
className: y,
|
|
246
|
+
key: n
|
|
247
|
+
}, /* @__PURE__ */ e.createElement("span", { className: b }, n.substring(0, i)), /* @__PURE__ */ e.createElement("div", { className: b }, /* @__PURE__ */ e.createElement("span", null, n.substring(i))), r < t.length - 1 ? "," : "");
|
|
248
|
+
}));
|
|
170
249
|
}
|
|
171
|
-
function
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
))), v.length > 0 && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(J, { list: v }), /* @__PURE__ */ e.createElement("div", { className: H }, c(
|
|
298
|
-
v.length === 1 ? "fileUpload.error.wrongType.one" : "fileUpload.error.wrongType.other",
|
|
299
|
-
{
|
|
300
|
-
fileTypes: w,
|
|
301
|
-
defaultValue: v.length === 1 ? `Selected file is not an accepted file type: ${w}.` : `Selected files are not accepted file types: ${w}.`
|
|
302
|
-
}
|
|
303
|
-
)))) : /* @__PURE__ */ e.createElement("span", null), /* @__PURE__ */ e.createElement("div", { className: $ }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("span", null, b[0]), _ ? /* @__PURE__ */ e.createElement("u", null, b[1]) : /* @__PURE__ */ e.createElement("a", { href: "", onClick: pe }, b[1]), /* @__PURE__ */ e.createElement("span", null, b[2]))), /* @__PURE__ */ e.createElement("div", { className: Se }, p ? /* @__PURE__ */ e.createElement("span", null, "(", " ", c("fileUpload.acceptedTypes", {
|
|
304
|
-
fileTypes: w,
|
|
305
|
-
defaultValue: `${w} format accepted`
|
|
306
|
-
}), " ", ")") : "", r ? /* @__PURE__ */ e.createElement("span", null, "(", " ", c("fileUpload.maximumSize", {
|
|
307
|
-
size: r,
|
|
308
|
-
defaultValue: `${r} maximum`
|
|
309
|
-
}), " ", ")") : "", x ? /* @__PURE__ */ e.createElement("span", null, " ", x, " ") : ""), k && /* @__PURE__ */ e.createElement("div", { className: Ce }, /* @__PURE__ */ e.createElement(
|
|
310
|
-
B,
|
|
311
|
-
{
|
|
312
|
-
disabled: _,
|
|
313
|
-
kind: "link",
|
|
314
|
-
icon: "download-cloud",
|
|
315
|
-
onClick: _e
|
|
316
|
-
},
|
|
317
|
-
k
|
|
318
|
-
)))),
|
|
319
|
-
l && !s && /* @__PURE__ */ e.createElement("div", { className: De }, /* @__PURE__ */ e.createElement(
|
|
320
|
-
B,
|
|
321
|
-
{
|
|
322
|
-
disabled: _,
|
|
323
|
-
kind: "icon",
|
|
324
|
-
icon: "x",
|
|
325
|
-
title: c("fileUpload.close", { defaultValue: "Close" }),
|
|
326
|
-
onClick: ie
|
|
327
|
-
}
|
|
328
|
-
)),
|
|
329
|
-
/* @__PURE__ */ e.createElement("form", { className: Ue }, /* @__PURE__ */ e.createElement(
|
|
330
|
-
"input",
|
|
331
|
-
{
|
|
332
|
-
ref: d,
|
|
333
|
-
type: "file",
|
|
334
|
-
accept: ae || "*/*",
|
|
335
|
-
multiple: t || void 0,
|
|
336
|
-
onChange: ce
|
|
337
|
-
}
|
|
338
|
-
))
|
|
339
|
-
);
|
|
250
|
+
function w({ constrainContentWidth: t, description: u, multiple: d = !1, dismissable: f, processing: p, mini: m, downloadLabel: y, acceptExtensions: b, maxSize: w, customRequirement: T, onSelection: E, onDismiss: D, download: O, shown: k, className: A, disabled: j, children: re, ...ie }) {
|
|
251
|
+
let M = e.useRef(/* @__PURE__ */ new Set()), N = e.useRef(/* @__PURE__ */ new Set()), [ae, P] = e.useState(k), [oe, se] = e.useState([]), [ce, F] = e.useState(""), [I, L] = e.useState(), [R, z] = e.useState(!1), [B, V] = e.useState(!1), [H, U] = e.useState([]), [W, G] = e.useState([]), [K, le] = e.useState(""), q = e.useMemo(() => (/* @__PURE__ */ new Set([...H, ...W])).size, [H, W]), { t: J } = c(), Y = (d ? J("fileUpload.instructions.other", { defaultValue: "Drag and drop your files here or |browse for files| on your desktop." }) : J("fileUpload.instructions.one", { defaultValue: "Drag and drop your file here or |browse for a file| on your desktop." })).split("|"), X = u || (d ? "Files" : "File"), Z = e.useRef(null);
|
|
252
|
+
e.useEffect(() => {
|
|
253
|
+
k && P(k);
|
|
254
|
+
}, [k]), e.useEffect(() => {
|
|
255
|
+
w && de(w);
|
|
256
|
+
}, [w]), e.useEffect(() => {
|
|
257
|
+
b && fe(b);
|
|
258
|
+
}, [b]);
|
|
259
|
+
function ue() {
|
|
260
|
+
f && (P(!1), D && D());
|
|
261
|
+
}
|
|
262
|
+
function de(e) {
|
|
263
|
+
try {
|
|
264
|
+
L(i(e));
|
|
265
|
+
} catch {
|
|
266
|
+
throw Error(`Could not parse "${e}" as a file size.`);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function fe(e) {
|
|
270
|
+
let t = (Array.isArray(e) ? e : e.trim().split(/\s?,\s?/)).map((e) => e.replace(/^\./, "")), n = t.map((e) => `.${e}`.toLowerCase());
|
|
271
|
+
le(n.map((e, t) => t > 0 && t === n.length - 1 ? `or ${e}` : e).join(n.length > 2 ? ", " : " ")), M.current.clear(), N.current.clear();
|
|
272
|
+
for (let e of t) {
|
|
273
|
+
N.current.add(e.toLowerCase());
|
|
274
|
+
let t = Object.keys(l).includes(e.toUpperCase()) ? l[e.toUpperCase()] : [];
|
|
275
|
+
for (let e of t) M.current.add(e);
|
|
276
|
+
}
|
|
277
|
+
F(n.concat(Array.from(M.current)).join(","));
|
|
278
|
+
}
|
|
279
|
+
function Q(e) {
|
|
280
|
+
U([]), G([]);
|
|
281
|
+
let t = [], n = [], r = e ? Array.from(e) : [];
|
|
282
|
+
for (let e of r) {
|
|
283
|
+
let r = e.name.split(".").pop()?.toLowerCase() ?? "", i = e.type ? M.current.has(e.type) : N.current.has(r);
|
|
284
|
+
b && !i && n.push(e.name), w && I && e.size > I && t.push(e.name);
|
|
285
|
+
}
|
|
286
|
+
t.length || n.length ? (V(!0), Z.current && Z.current.value && (Z.current.value = "")) : (se(r), E(r)), U(t), G(n);
|
|
287
|
+
}
|
|
288
|
+
function pe(e) {
|
|
289
|
+
e.preventDefault(), V(!1), Z.current && Z.current.click();
|
|
290
|
+
}
|
|
291
|
+
function $() {
|
|
292
|
+
O && O();
|
|
293
|
+
}
|
|
294
|
+
function me(e) {
|
|
295
|
+
e.stopPropagation(), Q(e.target.files), Z.current && Z.current.value && (Z.current.value = "");
|
|
296
|
+
}
|
|
297
|
+
function he(e) {
|
|
298
|
+
e.preventDefault(), e.stopPropagation(), z(!0), V(!1);
|
|
299
|
+
}
|
|
300
|
+
function ge(e) {
|
|
301
|
+
e.preventDefault(), z(!0), V(!1);
|
|
302
|
+
}
|
|
303
|
+
function _e(e) {
|
|
304
|
+
e.preventDefault(), z(!1);
|
|
305
|
+
}
|
|
306
|
+
function ve(e) {
|
|
307
|
+
e.preventDefault(), e.stopPropagation(), z(!1), e.dataTransfer.files && Q(e.dataTransfer.files);
|
|
308
|
+
}
|
|
309
|
+
return /* @__PURE__ */ e.createElement("div", {
|
|
310
|
+
onDrop: j ? () => {} : ve,
|
|
311
|
+
onDragOver: j ? () => {} : he,
|
|
312
|
+
onDragLeave: j ? () => {} : _e,
|
|
313
|
+
onDragEnter: j ? () => {} : ge,
|
|
314
|
+
className: r(h({
|
|
315
|
+
active: R,
|
|
316
|
+
mini: m,
|
|
317
|
+
error: B,
|
|
318
|
+
shown: ae,
|
|
319
|
+
disabled: j
|
|
320
|
+
}), A),
|
|
321
|
+
...ie
|
|
322
|
+
}, /* @__PURE__ */ e.createElement("div", { className: r(g({
|
|
323
|
+
constrainContentWidth: t,
|
|
324
|
+
disabled: j
|
|
325
|
+
})) }, p ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(n, {
|
|
326
|
+
size: "md",
|
|
327
|
+
"aria-hidden": "true"
|
|
328
|
+
}), /* @__PURE__ */ e.createElement("div", { className: _ }, J("fileUpload.processing", { defaultValue: "Processing Upload..." }))) : /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("div", {
|
|
329
|
+
className: ee({
|
|
330
|
+
mini: m,
|
|
331
|
+
error: B,
|
|
332
|
+
disabled: j
|
|
333
|
+
}),
|
|
334
|
+
"aria-hidden": "true"
|
|
335
|
+
}, /* @__PURE__ */ e.createElement("img", {
|
|
336
|
+
className: ne,
|
|
337
|
+
src: B ? o : s,
|
|
338
|
+
alt: "Upload Icon"
|
|
339
|
+
})), /* @__PURE__ */ e.createElement("div", { className: te({ mini: m }) }, B ? /* @__PURE__ */ e.createElement("div", null, J(q > 1 ? "fileUpload.cancelled.other" : "fileUpload.cancelled.one", { defaultValue: q > 1 ? "File Upload(s) Failed" : "File Upload Failed" })) : /* @__PURE__ */ e.createElement("div", null, J("fileUpload.title", {
|
|
340
|
+
description: X,
|
|
341
|
+
defaultValue: `Upload your ${X}`
|
|
342
|
+
}))), B ? /* @__PURE__ */ e.createElement("div", { className: v }, H.length > 0 && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(C, { list: H }), /* @__PURE__ */ e.createElement("div", { className: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zku" }, J(H.length === 1 ? "fileUpload.error.tooLarge.one" : "fileUpload.error.tooLarge.other", {
|
|
343
|
+
size: w,
|
|
344
|
+
defaultValue: H.length === 1 ? `Selected file is larger than the size limit of ${w}.` : `Selected files are larger than the size limit of ${w}.`
|
|
345
|
+
}))), W.length > 0 && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(C, { list: W }), /* @__PURE__ */ e.createElement("div", { className: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zku" }, J(W.length === 1 ? "fileUpload.error.wrongType.one" : "fileUpload.error.wrongType.other", {
|
|
346
|
+
fileTypes: K,
|
|
347
|
+
defaultValue: W.length === 1 ? `Selected file is not an accepted file type: ${K}.` : `Selected files are not accepted file types: ${K}.`
|
|
348
|
+
})))) : /* @__PURE__ */ e.createElement("span", null), /* @__PURE__ */ e.createElement("div", { className: _ }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("span", null, Y[0]), j ? /* @__PURE__ */ e.createElement("u", null, Y[1]) : /* @__PURE__ */ e.createElement("a", {
|
|
349
|
+
href: "",
|
|
350
|
+
onClick: pe
|
|
351
|
+
}, Y[1]), /* @__PURE__ */ e.createElement("span", null, Y[2]))), /* @__PURE__ */ e.createElement("div", { className: x }, b ? /* @__PURE__ */ e.createElement("span", null, "(", " ", J("fileUpload.acceptedTypes", {
|
|
352
|
+
fileTypes: K,
|
|
353
|
+
defaultValue: `${K} format accepted`
|
|
354
|
+
}), " ", ")") : "", w ? /* @__PURE__ */ e.createElement("span", null, "(", " ", J("fileUpload.maximumSize", {
|
|
355
|
+
size: w,
|
|
356
|
+
defaultValue: `${w} maximum`
|
|
357
|
+
}), " ", ")") : "", T ? /* @__PURE__ */ e.createElement("span", null, " ", T, " ") : ""), y && /* @__PURE__ */ e.createElement("div", { className: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkw" }, /* @__PURE__ */ e.createElement(a, {
|
|
358
|
+
disabled: j,
|
|
359
|
+
kind: "link",
|
|
360
|
+
icon: "download-cloud",
|
|
361
|
+
onClick: $
|
|
362
|
+
}, y)))), f && !p && /* @__PURE__ */ e.createElement("div", { className: "pkg_sps-woodland_core__family_file-upload__version_8_56_4__hash_17kn1zkx" }, /* @__PURE__ */ e.createElement(a, {
|
|
363
|
+
disabled: j,
|
|
364
|
+
kind: "icon",
|
|
365
|
+
icon: "x",
|
|
366
|
+
title: J("fileUpload.close", { defaultValue: "Close" }),
|
|
367
|
+
onClick: ue
|
|
368
|
+
})), /* @__PURE__ */ e.createElement("form", { className: S }, /* @__PURE__ */ e.createElement("input", {
|
|
369
|
+
ref: Z,
|
|
370
|
+
type: "file",
|
|
371
|
+
accept: ce || "*/*",
|
|
372
|
+
multiple: d || void 0,
|
|
373
|
+
onChange: me
|
|
374
|
+
})));
|
|
340
375
|
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
376
|
+
t.set(w, {
|
|
377
|
+
name: "FileUpload",
|
|
378
|
+
props: {
|
|
379
|
+
constrainContentWidth: { type: "boolean" },
|
|
380
|
+
description: { type: "string" },
|
|
381
|
+
multiple: { type: "boolean" },
|
|
382
|
+
dismissable: { type: "boolean" },
|
|
383
|
+
mini: { type: "boolean" },
|
|
384
|
+
downloadLabel: { type: "string" },
|
|
385
|
+
acceptExtensions: { type: "string[] | string" },
|
|
386
|
+
maxSize: { type: "string" },
|
|
387
|
+
customRequirement: { type: "string" },
|
|
388
|
+
onSelection: {
|
|
389
|
+
type: "(files: File[]) => void",
|
|
390
|
+
required: !0
|
|
391
|
+
},
|
|
392
|
+
dismissal: { type: "() => void" },
|
|
393
|
+
download: { type: "() => void" },
|
|
394
|
+
disabled: { type: "boolean" }
|
|
395
|
+
}
|
|
358
396
|
});
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
};
|
|
397
|
+
//#endregion
|
|
398
|
+
export { w as FileUpload };
|