@digital-ai/dot-components 1.13.0 → 1.14.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/CHANGE_LOG.md +21 -2
- package/index.esm.js +106 -50
- package/index.umd.js +132 -58
- package/lib/components/file-upload/FileUpload.d.ts +2 -2
- package/lib/components/file-upload/index.d.ts +2 -0
- package/lib/components/file-upload/utils/helpers.d.ts +15 -0
- package/lib/components/file-upload/{uploadHelpers.d.ts → utils/models.d.ts} +9 -7
- package/lib/components/index.d.ts +2 -1
- package/lib/components/inline-edit/InlineEdit.d.ts +5 -3
- package/lib/components/inline-edit/InlineEdit.stories.styles.d.ts +2 -0
- package/lib/components/inline-edit/utils/helpers.d.ts +2 -0
- package/lib/components/inline-edit/utils/models.d.ts +8 -0
- package/package.json +1 -1
package/CHANGE_LOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.14.0](https://github.com/digital-ai/dot-components/tree/1.14.0) (04/01/2022)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/digital-ai/dot-components/compare/1.13.0...1.14.0)
|
|
6
|
+
|
|
7
|
+
**Features:**
|
|
8
|
+
|
|
9
|
+
- `InlineEdit` Support for different text in view/edit modes [\#1103](https://github.com/digital-ai/dot-components/issues/1103)
|
|
10
|
+
- S-83748: `InlineEdit`: Support for different text in view/edit modes [\#1105](https://github.com/digital-ai/dot-components/pull/1105) ([dmiletic85](https://github.com/dmiletic85))
|
|
11
|
+
|
|
12
|
+
**Fixed bugs:**
|
|
13
|
+
|
|
14
|
+
- DotFileUpload - Setting maxFile limit to 1 allows to upload more than 1 files [\#1096](https://github.com/digital-ai/dot-components/issues/1096)
|
|
15
|
+
- We lost scrollbar for sidenav nested drawers [\#1061](https://github.com/digital-ai/dot-components/issues/1061)
|
|
16
|
+
- D-20516: `DotFileUpload` - Setting maxFile limit to 1 allows to upload more than 1 files [\#1101](https://github.com/digital-ai/dot-components/pull/1101) ([dmiletic85](https://github.com/dmiletic85))
|
|
17
|
+
- D-20334: Add scroll to nested drawer [\#1062](https://github.com/digital-ai/dot-components/pull/1062) ([s-zimm](https://github.com/s-zimm))
|
|
18
|
+
|
|
3
19
|
## [1.13.0](https://github.com/digital-ai/dot-components/tree/1.13.0) (03/28/2022)
|
|
4
20
|
|
|
5
21
|
[Full Changelog](https://github.com/digital-ai/dot-components/compare/1.12.0...1.13.0)
|
|
@@ -33,7 +49,6 @@
|
|
|
33
49
|
- S-82899: `DotCheckbox`: Add more Storybook examples [\#1090](https://github.com/digital-ai/dot-components/pull/1090) ([dmiletic85](https://github.com/dmiletic85))
|
|
34
50
|
- S-82453: `TruncateWithTooltip`: Create new component [\#1072](https://github.com/digital-ai/dot-components/pull/1072) ([dmiletic85](https://github.com/dmiletic85))
|
|
35
51
|
- S-82519: `Snackbar` Allow positioning [\#1064](https://github.com/digital-ai/dot-components/pull/1064) ([dmiletic85](https://github.com/dmiletic85))
|
|
36
|
-
- S-82617: `DotInputText` Expose mouse up event [\#1063](https://github.com/digital-ai/dot-components/pull/1063) ([dmiletic85](https://github.com/dmiletic85))
|
|
37
52
|
- S-76904: `InlineEdit` improvements [\#1053](https://github.com/digital-ai/dot-components/pull/1053) ([dmiletic85](https://github.com/dmiletic85))
|
|
38
53
|
- S-82059: `DraggableList`: Create and export the component [\#1003](https://github.com/digital-ai/dot-components/pull/1003) ([dmiletic85](https://github.com/dmiletic85))
|
|
39
54
|
|
|
@@ -59,6 +74,10 @@
|
|
|
59
74
|
|
|
60
75
|
[Full Changelog](https://github.com/digital-ai/dot-components/compare/1.11.2...1.11.3)
|
|
61
76
|
|
|
77
|
+
**Features:**
|
|
78
|
+
|
|
79
|
+
- S-82617: `DotInputText` Expose mouse up event [\#1063](https://github.com/digital-ai/dot-components/pull/1063) ([dmiletic85](https://github.com/dmiletic85))
|
|
80
|
+
|
|
62
81
|
**Merged pull requests:**
|
|
63
82
|
|
|
64
83
|
- March 16 2022 Agility icons [\#1066](https://github.com/digital-ai/dot-components/pull/1066) ([BojanKocijan](https://github.com/BojanKocijan))
|
|
@@ -315,6 +334,7 @@
|
|
|
315
334
|
|
|
316
335
|
**Features:**
|
|
317
336
|
|
|
337
|
+
- S-80871: `Sidebar` Changes on back arrow [\#896](https://github.com/digital-ai/dot-components/pull/896) ([dmiletic85](https://github.com/dmiletic85))
|
|
318
338
|
- S-77210: Component - Drawer [\#893](https://github.com/digital-ai/dot-components/pull/893) ([monapatel91](https://github.com/monapatel91))
|
|
319
339
|
|
|
320
340
|
**Fixed bugs:**
|
|
@@ -347,7 +367,6 @@
|
|
|
347
367
|
- `sidebar` Changes on back arrow [\#890](https://github.com/digital-ai/dot-components/issues/890)
|
|
348
368
|
- `Breadcrumbs` Display tooltip on last item \(on hover\) when it is clipped with ellipsis [\#878](https://github.com/digital-ai/dot-components/issues/878)
|
|
349
369
|
- S-80939: `Menu`: Add option to customize item's height [\#902](https://github.com/digital-ai/dot-components/pull/902) ([dmiletic85](https://github.com/dmiletic85))
|
|
350
|
-
- S-80871: `Sidebar` Changes on back arrow [\#896](https://github.com/digital-ai/dot-components/pull/896) ([dmiletic85](https://github.com/dmiletic85))
|
|
351
370
|
- S-80855: Display tooltip on last breadcrumb item \(on hover\) when it is clipped with ellipsis [\#883](https://github.com/digital-ai/dot-components/pull/883) ([dmiletic85](https://github.com/dmiletic85))
|
|
352
371
|
|
|
353
372
|
**Fixed bugs:**
|
package/index.esm.js
CHANGED
|
@@ -2259,7 +2259,7 @@ const StyledSidebar = styled.aside.withConfig({
|
|
|
2259
2259
|
componentId: "l3atb4-0"
|
|
2260
2260
|
})(["", ""], ({
|
|
2261
2261
|
theme
|
|
2262
|
-
}) => css(["&.", "{align-items:stretch;background:", ";border-width:0 1px;border-style:solid;border-color:", ";box-shadow:", ";box-sizing:border-box;color:", ";display:flex;height:100%;flex-direction:column;justify-content:space-between;letter-spacing:0.01em;padding:", ";-o-transition:width cubic-bezier(0.4,0,0.6,1) 0.3s;-moz-transition:width cubic-bezier(0.4,0,0.6,1) 0.3s;-webkit-transition:width cubic-bezier(0.4,0,0.6,1) 0.3s;transition:width cubic-bezier(0.4,0,0.6,1) 0.3s;header{align-items:center;border-bottom:1px solid;border-bottom-color:", ";display:flex;height:40px;flex-shrink:0;overflow:hidden;margin-bottom:", ";padding:", ";white-space:nowrap;&.app-logo{box-sizing:border-box;.dot-app-logo{svg,img{max-width:100%;}}}.dot-avatar{margin-right:", "px;}}.go-back{align-items:center;border-bottom:1px solid;border-bottom-color:", ";display:flex;.go-back-button{margin:", ";background-color:", ";&:hover{background-color:", ";}&:focus-visible{box-shadow:0 0 0 2px ", ",0 0 0 4px ", ";}}}hr.MuiDivider-root{background-color:", ";margin:", ";}.MuiListSubheader-root{border-bottom:1px solid;border-bottom-color:", ";margin:", ";.dot-typography{margin:0;}}ul.side-nav{background:transparent;flex-grow:2;overflow-x:hidden;overflow-y:auto;padding:0;width:auto;.dot-nested-list{background:transparent;}.", "{.dot-drawer-paper{padding:", "px;border-right:1px solid ", ";box-shadow:0 0 5px 0 rgba(0,0,0,0.15);padding-top:", ";}.MuiTypography-root.MuiTypography-subtitle2{border:", ";color:", ";font-size:", ";line-height:40px;margin:", ";padding:", ";}.", "{margin:0;padding-left:", "px;}}.dot-list-item{height:", ";padding:0;margin-bottom:", ";&.MuiListItem-root.Mui-selected,&.MuiListItem-root.Mui-selected:hover,&:hover{background-color:", ";}&.Mui-focusVisible{box-shadow:inset 0 0 0 2px ", ";border:2px solid ", ";}&:hover,&:active,&:focus{.dot-typography,.dot-icon i.dot-i:before{color:", ";}}&.open{background-color:", ";border:", ";border-radius:", ";&:hover{background-color:", ";}}.MuiTouchRipple-root{display:", ";}.dot-list-item-link .dot-icon{margin-right:", "px;}.dot-icon{border-radius:50%;height:40px;margin:", ";width:40px;}.dot-typography{white-space:nowrap;}}}.toggle-nav{border-top:1px solid;border-top-color:", ";padding:", "px;text-align:right;.dot-icon{transform:rotate(0deg);-o-transition:all cubic-bezier(0.4,0,0.2,1) 0.3s;-moz-transition:all cubic-bezier(0.4,0,0.2,1) 0.3s;-webkit-transition:all cubic-bezier(0.4,0,0.2,1) 0.3s;transition:all cubic-bezier(0.4,0,0.2,1) 0.3s;}}.powered-by{border-top:1px solid;border-top-color:", ";color:", ";display:flex;flex-direction:column;flex-shrink:0;font-size:12px;overflow:hidden;padding:", "px;p.desc{white-space:nowrap;}.company-name{margin-top:", "px;}.d-icon{display:none;}}&.collapsed{overflow:hidden;padding:", ";width:58px;-o-transition:all cubic-bezier(0.4,0,0.6,1) 0.3s;-moz-transition:all cubic-bezier(0.4,0,0.6,1) 0.3s;-webkit-transition:all cubic-bezier(0.4,0,0.6,1) 0.3s;transition:all cubic-bezier(0.4,0,0.6,1) 0.3s;li.MuiListSubheader-root .dot-typography,.go-back .MuiTypography-root,.MuiListItem-divider .dot-list-item-link,.child,.powered-by .company-name,.powered-by p.desc{display:none;}.dot-nested-drawer li.MuiListSubheader-root .dot-typography,.powered-by .d-icon{display:block;}header .dot-app-logo{text-align:center;}ul.side-nav{width:56px;.dot-list-item{margin-left:0;}.toggle-nav{align-self:center;}}.powered-by{align-items:center;}}}"], rootClassName$I, theme.palette.product === 'agility' ? theme.palette.layer.n50 : theme.palette.grey[50], theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' && '0 0 5px rgba(0, 0, 0, 0.15)', theme.palette.product === 'agility' ? theme.palette.layer.n700 : theme.palette.grey[700], theme.palette.product === 'agility' && `${theme.spacing(2)}px`, theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' && `${theme.spacing(1)}px`, theme.palette.product === 'agililty' ? theme.spacing(0, 0, 1) : theme.spacing(1, 2), theme.spacing(1), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.spacing(0.5, 1), theme.palette.layer.n100, theme.palette.layer.n200, theme.palette.layer.n0, theme.palette.layer.n900, theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' ? theme.spacing(2, 0) : theme.spacing(1, 0), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.spacing(0, 0, 1), nestedDrawerClassName, theme.spacing(2), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' && '10px', theme.palette.product === 'agility' && 'none', theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavSubHeaderText, theme.palette.product === 'agility' && '11px', theme.palette.product === 'agility' && '10px 0 0', theme.palette.product === 'agility' && '0 8px', listItemRootClass, theme.spacing(2), theme.palette.product === 'agility' ? '40px' : '44px', theme.palette.product === 'agility' && `${theme.spacing(1)}px`, theme.palette.product === 'agility' && 'transparent', theme.palette.layer.n0, theme.palette.layer.n900, theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavHoverText, theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavHoverBg, theme.palette.product === 'agility' ? `1px solid ${theme.palette.agilityInterface.sideNavHoverBorder}` : 'none', theme.palette.product === 'agility' && '4px', theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavHoverBg, theme.palette.product === 'agility' && 'none', theme.spacing(1), theme.spacing(0, 1), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.spacing(1), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.grey[400], theme.spacing(1), theme.spacing(1), theme.palette.product === 'agility' && theme.spacing(2, 0)));
|
|
2262
|
+
}) => css(["&.", "{align-items:stretch;background:", ";border-width:0 1px;border-style:solid;border-color:", ";box-shadow:", ";box-sizing:border-box;color:", ";display:flex;height:100%;flex-direction:column;justify-content:space-between;letter-spacing:0.01em;padding:", ";-o-transition:width cubic-bezier(0.4,0,0.6,1) 0.3s;-moz-transition:width cubic-bezier(0.4,0,0.6,1) 0.3s;-webkit-transition:width cubic-bezier(0.4,0,0.6,1) 0.3s;transition:width cubic-bezier(0.4,0,0.6,1) 0.3s;header{align-items:center;border-bottom:1px solid;border-bottom-color:", ";display:flex;height:40px;flex-shrink:0;overflow:hidden;margin-bottom:", ";padding:", ";white-space:nowrap;&.app-logo{box-sizing:border-box;.dot-app-logo{svg,img{max-width:100%;}}}.dot-avatar{margin-right:", "px;}}.go-back{align-items:center;border-bottom:1px solid;border-bottom-color:", ";display:flex;.go-back-button{margin:", ";background-color:", ";&:hover{background-color:", ";}&:focus-visible{box-shadow:0 0 0 2px ", ",0 0 0 4px ", ";}}}hr.MuiDivider-root{background-color:", ";margin:", ";}.MuiListSubheader-root{border-bottom:1px solid;border-bottom-color:", ";margin:", ";.dot-typography{margin:0;}}ul.side-nav{background:transparent;flex-grow:2;overflow-x:hidden;overflow-y:auto;padding:0;width:auto;.dot-nested-list{background:transparent;}.", "{.dot-drawer-paper{padding:", "px;overflow-y:scroll;border-right:1px solid ", ";box-shadow:0 0 5px 0 rgba(0,0,0,0.15);padding-top:", ";}.MuiTypography-root.MuiTypography-subtitle2{border:", ";color:", ";font-size:", ";line-height:40px;margin:", ";padding:", ";}.", "{margin:0;padding-left:", "px;}}.dot-list-item{height:", ";padding:0;margin-bottom:", ";&.MuiListItem-root.Mui-selected,&.MuiListItem-root.Mui-selected:hover,&:hover{background-color:", ";}&.Mui-focusVisible{box-shadow:inset 0 0 0 2px ", ";border:2px solid ", ";}&:hover,&:active,&:focus{.dot-typography,.dot-icon i.dot-i:before{color:", ";}}&.open{background-color:", ";border:", ";border-radius:", ";&:hover{background-color:", ";}}.MuiTouchRipple-root{display:", ";}.dot-list-item-link .dot-icon{margin-right:", "px;}.dot-icon{border-radius:50%;height:40px;margin:", ";width:40px;}.dot-typography{white-space:nowrap;}}}.toggle-nav{border-top:1px solid;border-top-color:", ";padding:", "px;text-align:right;.dot-icon{transform:rotate(0deg);-o-transition:all cubic-bezier(0.4,0,0.2,1) 0.3s;-moz-transition:all cubic-bezier(0.4,0,0.2,1) 0.3s;-webkit-transition:all cubic-bezier(0.4,0,0.2,1) 0.3s;transition:all cubic-bezier(0.4,0,0.2,1) 0.3s;}}.powered-by{border-top:1px solid;border-top-color:", ";color:", ";display:flex;flex-direction:column;flex-shrink:0;font-size:12px;overflow:hidden;padding:", "px;p.desc{white-space:nowrap;}.company-name{margin-top:", "px;}.d-icon{display:none;}}&.collapsed{overflow:hidden;padding:", ";width:58px;-o-transition:all cubic-bezier(0.4,0,0.6,1) 0.3s;-moz-transition:all cubic-bezier(0.4,0,0.6,1) 0.3s;-webkit-transition:all cubic-bezier(0.4,0,0.6,1) 0.3s;transition:all cubic-bezier(0.4,0,0.6,1) 0.3s;li.MuiListSubheader-root .dot-typography,.go-back .MuiTypography-root,.MuiListItem-divider .dot-list-item-link,.child,.powered-by .company-name,.powered-by p.desc{display:none;}.dot-nested-drawer li.MuiListSubheader-root .dot-typography,.powered-by .d-icon{display:block;}header .dot-app-logo{text-align:center;}ul.side-nav{width:56px;.dot-list-item{margin-left:0;}.toggle-nav{align-self:center;}}.powered-by{align-items:center;}}}"], rootClassName$I, theme.palette.product === 'agility' ? theme.palette.layer.n50 : theme.palette.grey[50], theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' && '0 0 5px rgba(0, 0, 0, 0.15)', theme.palette.product === 'agility' ? theme.palette.layer.n700 : theme.palette.grey[700], theme.palette.product === 'agility' && `${theme.spacing(2)}px`, theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' && `${theme.spacing(1)}px`, theme.palette.product === 'agililty' ? theme.spacing(0, 0, 1) : theme.spacing(1, 2), theme.spacing(1), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.spacing(0.5, 1), theme.palette.layer.n100, theme.palette.layer.n200, theme.palette.layer.n0, theme.palette.layer.n900, theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' ? theme.spacing(2, 0) : theme.spacing(1, 0), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.spacing(0, 0, 1), nestedDrawerClassName, theme.spacing(2), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' && '10px', theme.palette.product === 'agility' && 'none', theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavSubHeaderText, theme.palette.product === 'agility' && '11px', theme.palette.product === 'agility' && '10px 0 0', theme.palette.product === 'agility' && '0 8px', listItemRootClass, theme.spacing(2), theme.palette.product === 'agility' ? '40px' : '44px', theme.palette.product === 'agility' && `${theme.spacing(1)}px`, theme.palette.product === 'agility' && 'transparent', theme.palette.layer.n0, theme.palette.layer.n900, theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavHoverText, theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavHoverBg, theme.palette.product === 'agility' ? `1px solid ${theme.palette.agilityInterface.sideNavHoverBorder}` : 'none', theme.palette.product === 'agility' && '4px', theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavHoverBg, theme.palette.product === 'agility' && 'none', theme.spacing(1), theme.spacing(0, 1), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.spacing(1), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.grey[400], theme.spacing(1), theme.spacing(1), theme.palette.product === 'agility' && theme.spacing(2, 0)));
|
|
2263
2263
|
|
|
2264
2264
|
const Brand = ({
|
|
2265
2265
|
brandDesc
|
|
@@ -5602,6 +5602,38 @@ const getWarningAdornment = () => {
|
|
|
5602
5602
|
iconId: "error-solid"
|
|
5603
5603
|
})));
|
|
5604
5604
|
};
|
|
5605
|
+
const applyBindings = (bindings, inlineEditText) => {
|
|
5606
|
+
if (!bindings || !bindings.length || !inlineEditText) return;
|
|
5607
|
+
let text = inlineEditText;
|
|
5608
|
+
let boundNode = [];
|
|
5609
|
+
bindings.forEach((binding, index) => {
|
|
5610
|
+
const {
|
|
5611
|
+
binding: stringBinding,
|
|
5612
|
+
className = null,
|
|
5613
|
+
value
|
|
5614
|
+
} = binding;
|
|
5615
|
+
let bindingStringIndex = text.indexOf(stringBinding);
|
|
5616
|
+
let key = 0;
|
|
5617
|
+
|
|
5618
|
+
while (bindingStringIndex >= 0) {
|
|
5619
|
+
// Since key is needed only for bindings with className,
|
|
5620
|
+
// increment key value only if className value is defined
|
|
5621
|
+
className && key++;
|
|
5622
|
+
const nextStartingIndex = bindingStringIndex + stringBinding.length;
|
|
5623
|
+
const previousText = text.substr(0, bindingStringIndex);
|
|
5624
|
+
text = text.substr(nextStartingIndex, text.length);
|
|
5625
|
+
bindingStringIndex = text.indexOf(stringBinding); // Add nodes to array
|
|
5626
|
+
|
|
5627
|
+
boundNode = [boundNode, previousText, className ? /*#__PURE__*/React__default.createElement("span", {
|
|
5628
|
+
className: className,
|
|
5629
|
+
key: `${index}-${key}`
|
|
5630
|
+
}, value) : value];
|
|
5631
|
+
}
|
|
5632
|
+
}); // Add remainder of the text to the node
|
|
5633
|
+
|
|
5634
|
+
boundNode = [boundNode, text];
|
|
5635
|
+
return boundNode;
|
|
5636
|
+
};
|
|
5605
5637
|
|
|
5606
5638
|
/**
|
|
5607
5639
|
* @experimental This component is still in development
|
|
@@ -5609,6 +5641,7 @@ const getWarningAdornment = () => {
|
|
|
5609
5641
|
|
|
5610
5642
|
const DotInlineEdit = ({
|
|
5611
5643
|
ariaLabel,
|
|
5644
|
+
bindings,
|
|
5612
5645
|
charactersLimit,
|
|
5613
5646
|
className,
|
|
5614
5647
|
'data-testid': dataTestId,
|
|
@@ -5642,11 +5675,14 @@ const DotInlineEdit = ({
|
|
|
5642
5675
|
var _a;
|
|
5643
5676
|
|
|
5644
5677
|
if (!inputValue) return;
|
|
5645
|
-
const isSuccess = yield onChange(inputValue);
|
|
5646
5678
|
|
|
5647
|
-
if (
|
|
5648
|
-
|
|
5649
|
-
|
|
5679
|
+
if (onChange) {
|
|
5680
|
+
const isSuccess = yield onChange(inputValue);
|
|
5681
|
+
|
|
5682
|
+
if (!isSuccess) {
|
|
5683
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
5684
|
+
return;
|
|
5685
|
+
}
|
|
5650
5686
|
}
|
|
5651
5687
|
|
|
5652
5688
|
setEditing(false);
|
|
@@ -5704,7 +5740,7 @@ const DotInlineEdit = ({
|
|
|
5704
5740
|
className: "dot-view-mode-typography",
|
|
5705
5741
|
"data-testid": dataTestId && `${dataTestId}-view-mode-typography`,
|
|
5706
5742
|
variant: _typography
|
|
5707
|
-
}, inputValue), /*#__PURE__*/React__default.createElement(DotIcon, {
|
|
5743
|
+
}, bindings ? applyBindings(bindings, inputValue) : inputValue), /*#__PURE__*/React__default.createElement(DotIcon, {
|
|
5708
5744
|
className: "dot-edit-icon",
|
|
5709
5745
|
"data-testid": dataTestId && `${dataTestId}-edit-icon`,
|
|
5710
5746
|
iconId: "edit"
|
|
@@ -7106,13 +7142,13 @@ const StyledFileUploadContainer = styled.div.withConfig({
|
|
|
7106
7142
|
componentId: "sc-1q8bcxy-0"
|
|
7107
7143
|
})(["", ""], ({
|
|
7108
7144
|
theme
|
|
7109
|
-
}) => css(["&.", "{.", "{border-bottom:1px solid ", ";&:hover{cursor:pointer;background:", ";}&.file-success:not(:hover){.", "-end-icon .dot-icon i:before{color:", ";}}&.file-error:not(:hover){.MuiListItemText-secondary,.", "-end-icon .dot-icon i:before{color:", ";}}.dot-typography,.file-item-text{flex-grow:2;padding-left:", "px;}.file-item-text{display:flex;flex-direction:column;.MuiTypography-body2{color:", ";}}}}"], containerClassName, listItemRootClass, theme.palette.layer.n100, theme.palette.layer.n50, listItemRootClass, theme.palette.secondary.main, listItemRootClass, theme.palette.error.main, theme.spacing(1), theme.palette.error.main));
|
|
7145
|
+
}) => css(["&.", "{.dot-max-files-message.dot-max-files-reached{color:", ";}.", "{border-bottom:1px solid ", ";&:hover{cursor:pointer;background:", ";}&.file-success:not(:hover){.", "-end-icon .dot-icon i:before{color:", ";}}&.file-error:not(:hover){.MuiListItemText-secondary,.", "-end-icon .dot-icon i:before{color:", ";}}.dot-typography,.file-item-text{flex-grow:2;padding-left:", "px;}.file-item-text{display:flex;flex-direction:column;.MuiTypography-body2{color:", ";}}}}"], containerClassName, theme.palette.error[500], listItemRootClass, theme.palette.layer.n100, theme.palette.layer.n50, listItemRootClass, theme.palette.secondary.main, listItemRootClass, theme.palette.error.main, theme.spacing(1), theme.palette.error.main));
|
|
7110
7146
|
const StyledFileUpload = styled.div.withConfig({
|
|
7111
7147
|
displayName: "FileUploadstyles__StyledFileUpload",
|
|
7112
7148
|
componentId: "sc-1q8bcxy-1"
|
|
7113
7149
|
})(["", ""], ({
|
|
7114
7150
|
theme
|
|
7115
|
-
}) => css(["&.", ".", "{align-items:center;background:", ";border:2px dashed ", ";border-radius:4px;color:", ";display:flex;flex-direction:column;flex-wrap:wrap;height:240px;justify-content:center;padding:", ";margin-bottom:", "px;&.disabled .dot-typography{color:", ";}.dot-icon{color:", ";font-size:100px;i.dot-i{height:100px;}}}"], rootClassName$4, dropZoneClassName, theme.palette.layer.n50, theme.palette.layer.n300, theme.palette.layer.n500, theme.spacing(3, 0), theme.spacing(1), theme.palette.layer.n300, theme.palette.layer.n100));
|
|
7151
|
+
}) => css(["&.", ".", "{align-items:center;background:", ";border:2px dashed ", ";border-radius:4px;color:", ";display:flex;flex-direction:column;flex-wrap:wrap;height:240px;justify-content:center;padding:", ";margin-bottom:", "px;text-align:center;&.disabled .dot-typography{color:", ";}.dot-icon{color:", ";font-size:100px;i.dot-i{height:100px;}}}"], rootClassName$4, dropZoneClassName, theme.palette.layer.n50, theme.palette.layer.n300, theme.palette.layer.n500, theme.spacing(3, 0), theme.spacing(1), theme.palette.layer.n300, theme.palette.layer.n100));
|
|
7116
7152
|
|
|
7117
7153
|
const DotFileListItem = ({
|
|
7118
7154
|
ariaLabel,
|
|
@@ -7147,6 +7183,40 @@ const DotFileListItem = ({
|
|
|
7147
7183
|
}));
|
|
7148
7184
|
};
|
|
7149
7185
|
|
|
7186
|
+
const renderMaxSizeMessage = maxSizeMB => /*#__PURE__*/React__default.createElement(DotTypography, {
|
|
7187
|
+
variant: "body2"
|
|
7188
|
+
}, "File size should not exceed ", maxSizeMB, "MB.");
|
|
7189
|
+
const renderMaxFilesMessage = (maxFiles, maxFilesClasses) => /*#__PURE__*/React__default.createElement(DotTypography, {
|
|
7190
|
+
className: maxFilesClasses,
|
|
7191
|
+
variant: "body2"
|
|
7192
|
+
}, maxFiles, " files are the maximum number of files you can upload.");
|
|
7193
|
+
const renderSelectFilesButton = (isUploadDisabled, onButtonClick) => /*#__PURE__*/React__default.createElement(DotButton, {
|
|
7194
|
+
disabled: isUploadDisabled,
|
|
7195
|
+
onClick: onButtonClick
|
|
7196
|
+
}, "Select file(s)");
|
|
7197
|
+
const renderActiveDragArea = () => /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(DotIcon, {
|
|
7198
|
+
iconId: "upload-file"
|
|
7199
|
+
}), /*#__PURE__*/React__default.createElement(DotTypography, {
|
|
7200
|
+
variant: "h3"
|
|
7201
|
+
}, "Drop the file(s) here ..."));
|
|
7202
|
+
const renderDragAndDropArea = (isUploadDisabled, onSelectButtonClick) => /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(DotIcon, {
|
|
7203
|
+
iconId: "upload-file"
|
|
7204
|
+
}), /*#__PURE__*/React__default.createElement(DotTypography, {
|
|
7205
|
+
variant: "h3"
|
|
7206
|
+
}, "Drag and drop your file(s) here ", /*#__PURE__*/React__default.createElement("br", null), " or"), renderSelectFilesButton(isUploadDisabled, onSelectButtonClick));
|
|
7207
|
+
const renderDropzoneContent = ({
|
|
7208
|
+
buttonOnly,
|
|
7209
|
+
isDragActive,
|
|
7210
|
+
isUploadDisabled,
|
|
7211
|
+
open
|
|
7212
|
+
}) => {
|
|
7213
|
+
if (buttonOnly) {
|
|
7214
|
+
return renderSelectFilesButton(isUploadDisabled, open);
|
|
7215
|
+
} else {
|
|
7216
|
+
return isDragActive ? renderActiveDragArea() : renderDragAndDropArea(isUploadDisabled, open);
|
|
7217
|
+
}
|
|
7218
|
+
};
|
|
7219
|
+
const getUploadedFilesList = (uploadedFiles, maxSize, onFileDelete) => uploadedFiles.map(file => parseListItem(onFileDelete, file, maxSize));
|
|
7150
7220
|
const parseListItem = (deleteFile, fileToBeParsed, maxSize) => {
|
|
7151
7221
|
const fileErrors = fileToBeParsed.errors;
|
|
7152
7222
|
const parsedFile = fileToBeParsed.file;
|
|
@@ -7160,8 +7230,6 @@ const parseListItem = (deleteFile, fileToBeParsed, maxSize) => {
|
|
|
7160
7230
|
return `File exceeds ${maxSize}MB`;
|
|
7161
7231
|
|
|
7162
7232
|
case 'file-invalid-type':
|
|
7163
|
-
return e.message;
|
|
7164
|
-
|
|
7165
7233
|
case 'too-many-files':
|
|
7166
7234
|
return e.message;
|
|
7167
7235
|
|
|
@@ -7177,8 +7245,7 @@ const parseListItem = (deleteFile, fileToBeParsed, maxSize) => {
|
|
|
7177
7245
|
deleteFile: deleteFile,
|
|
7178
7246
|
error: hasErrors,
|
|
7179
7247
|
errorText: errorText,
|
|
7180
|
-
file: parsedFile
|
|
7181
|
-
key: CreateUUID()
|
|
7248
|
+
file: parsedFile
|
|
7182
7249
|
})
|
|
7183
7250
|
};
|
|
7184
7251
|
};
|
|
@@ -7195,7 +7262,12 @@ const DotFileUpload = ({
|
|
|
7195
7262
|
onChange,
|
|
7196
7263
|
onDragEnter
|
|
7197
7264
|
}) => {
|
|
7198
|
-
const
|
|
7265
|
+
const [uploadedFiles, setUploadedFiles] = useState([]);
|
|
7266
|
+
const [hasMaxFilesError, setHasMaxFilesError] = useState(false);
|
|
7267
|
+
const isUploadDisabled = disabled || maxFiles && uploadedFiles.length >= maxFiles;
|
|
7268
|
+
const rootClasses = useStylesWithRootClass(rootClassName$4, className, !_buttonOnly ? dropZoneClassName : '', isUploadDisabled ? 'disabled' : '');
|
|
7269
|
+
const maxFilesClasses = useStylesWithRootClass('dot-max-files-message', hasMaxFilesError ? 'dot-max-files-reached' : '');
|
|
7270
|
+
const allowMultiple = maxFiles === undefined || maxFiles > 1;
|
|
7199
7271
|
const {
|
|
7200
7272
|
acceptedFiles,
|
|
7201
7273
|
fileRejections,
|
|
@@ -7205,13 +7277,12 @@ const DotFileUpload = ({
|
|
|
7205
7277
|
open
|
|
7206
7278
|
} = useDropzone({
|
|
7207
7279
|
accept,
|
|
7208
|
-
disabled,
|
|
7209
|
-
maxFiles,
|
|
7280
|
+
disabled: isUploadDisabled,
|
|
7210
7281
|
maxSize: maxSize * 1000000,
|
|
7282
|
+
multiple: allowMultiple,
|
|
7211
7283
|
noClick: true,
|
|
7212
7284
|
onDragEnter
|
|
7213
7285
|
});
|
|
7214
|
-
const [uploadedFiles, setUploadedFiles] = useState([]);
|
|
7215
7286
|
useEffect(() => {
|
|
7216
7287
|
onChange(uploadedFiles);
|
|
7217
7288
|
}, [uploadedFiles]);
|
|
@@ -7229,7 +7300,16 @@ const DotFileUpload = ({
|
|
|
7229
7300
|
};
|
|
7230
7301
|
|
|
7231
7302
|
const parseFiles = () => {
|
|
7232
|
-
|
|
7303
|
+
const totalFilesToUpload = uploadedFiles.length + acceptedFiles.length + fileRejections.length;
|
|
7304
|
+
const isMaxFilesReached = maxFiles && totalFilesToUpload > maxFiles;
|
|
7305
|
+
|
|
7306
|
+
if (isMaxFilesReached) {
|
|
7307
|
+
setHasMaxFilesError(true);
|
|
7308
|
+
return;
|
|
7309
|
+
}
|
|
7310
|
+
|
|
7311
|
+
setHasMaxFilesError(false); // map through accepted files and make them same shape as rejected files
|
|
7312
|
+
|
|
7233
7313
|
const mappedFiles = acceptedFiles.map(value => ({
|
|
7234
7314
|
file: value,
|
|
7235
7315
|
errors: []
|
|
@@ -7240,45 +7320,21 @@ const DotFileUpload = ({
|
|
|
7240
7320
|
useEffect(() => {
|
|
7241
7321
|
parseFiles();
|
|
7242
7322
|
}, [acceptedFiles, fileRejections]);
|
|
7243
|
-
const
|
|
7244
|
-
variant: "body2"
|
|
7245
|
-
}, maxFiles, " files are the maximum number of files you can upload at once.");
|
|
7246
|
-
const maxSizeMessage = /*#__PURE__*/React__default.createElement(DotTypography, {
|
|
7247
|
-
variant: "body2"
|
|
7248
|
-
}, "File size should not exceed ", maxSize, "MB.");
|
|
7249
|
-
|
|
7250
|
-
const dropzoneContent = () => {
|
|
7251
|
-
if (_buttonOnly) {
|
|
7252
|
-
return /*#__PURE__*/React__default.createElement(DotButton, {
|
|
7253
|
-
disabled: disabled,
|
|
7254
|
-
onClick: open
|
|
7255
|
-
}, "Select file(s)");
|
|
7256
|
-
} else {
|
|
7257
|
-
return isDragActive ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(DotIcon, {
|
|
7258
|
-
iconId: "upload-file"
|
|
7259
|
-
}), /*#__PURE__*/React__default.createElement(DotTypography, {
|
|
7260
|
-
variant: "h3"
|
|
7261
|
-
}, "Drop the file(s) here ...")) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(DotIcon, {
|
|
7262
|
-
iconId: "upload-file"
|
|
7263
|
-
}), /*#__PURE__*/React__default.createElement(DotTypography, {
|
|
7264
|
-
variant: "h3"
|
|
7265
|
-
}, "Drag and drop your file(s) here"), /*#__PURE__*/React__default.createElement(DotTypography, {
|
|
7266
|
-
variant: "h3"
|
|
7267
|
-
}, "or"), /*#__PURE__*/React__default.createElement(DotButton, {
|
|
7268
|
-
disabled: disabled,
|
|
7269
|
-
onClick: open
|
|
7270
|
-
}, "Select file(s)"));
|
|
7271
|
-
}
|
|
7272
|
-
};
|
|
7273
|
-
|
|
7323
|
+
const uploadedFilesList = getUploadedFilesList(uploadedFiles, maxSize, deleteFile);
|
|
7274
7324
|
return /*#__PURE__*/React__default.createElement(StyledFileUploadContainer, {
|
|
7275
7325
|
className: containerClassName
|
|
7276
7326
|
}, /*#__PURE__*/React__default.createElement(StyledFileUpload, Object.assign({}, getRootProps(), {
|
|
7277
7327
|
"aria-label": ariaLabel,
|
|
7278
7328
|
className: rootClasses,
|
|
7279
7329
|
"data-testid": dataTestId
|
|
7280
|
-
}), /*#__PURE__*/React__default.createElement("input", Object.assign({}, getInputProps())),
|
|
7281
|
-
|
|
7330
|
+
}), /*#__PURE__*/React__default.createElement("input", Object.assign({}, getInputProps())), renderDropzoneContent({
|
|
7331
|
+
buttonOnly: _buttonOnly,
|
|
7332
|
+
isDragActive,
|
|
7333
|
+
isUploadDisabled,
|
|
7334
|
+
open
|
|
7335
|
+
})), maxSize && renderMaxSizeMessage(maxSize), maxFiles && renderMaxFilesMessage(maxFiles, maxFilesClasses), /*#__PURE__*/React__default.createElement(DotList, {
|
|
7336
|
+
"data-testid": dataTestId && `${dataTestId}-file-list`,
|
|
7337
|
+
items: uploadedFilesList,
|
|
7282
7338
|
width: "100%"
|
|
7283
7339
|
}));
|
|
7284
7340
|
};
|
package/index.umd.js
CHANGED
|
@@ -2460,7 +2460,7 @@
|
|
|
2460
2460
|
componentId: "l3atb4-0"
|
|
2461
2461
|
})(templateObject_2$J || (templateObject_2$J = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
2462
2462
|
var theme = _a.theme;
|
|
2463
|
-
return styled.css(templateObject_1$L || (templateObject_1$L = __makeTemplateObject(["\n &.", " {\n align-items: stretch;\n background: ", ";\n border-width: 0 1px;\n border-style: solid;\n border-color: ", ";\n box-shadow: ", ";\n box-sizing: border-box;\n color: ", ";\n display: flex;\n height: 100%;\n flex-direction: column;\n justify-content: space-between;\n letter-spacing: 0.01em;\n padding: ", ";\n -o-transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -moz-transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -webkit-transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n\n header {\n align-items: center;\n border-bottom: 1px solid;\n border-bottom-color: ", ";\n display: flex;\n height: 40px;\n flex-shrink: 0;\n overflow: hidden;\n margin-bottom: ", ";\n padding: ", ";\n white-space: nowrap;\n\n &.app-logo {\n box-sizing: border-box;\n\n .dot-app-logo {\n svg,\n img {\n max-width: 100%;\n }\n }\n }\n\n .dot-avatar {\n margin-right: ", "px;\n }\n }\n\n .go-back {\n align-items: center;\n border-bottom: 1px solid;\n border-bottom-color: ", ";\n display: flex;\n\n .go-back-button {\n margin: ", ";\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n &:focus-visible {\n box-shadow: 0 0 0 2px ", ",\n 0 0 0 4px ", ";\n }\n }\n }\n\n hr.MuiDivider-root {\n background-color: ", ";\n margin: ", ";\n }\n\n .MuiListSubheader-root {\n border-bottom: 1px solid;\n border-bottom-color: ", ";\n margin: ", ";\n\n .dot-typography {\n margin: 0;\n }\n }\n\n ul.side-nav {\n background: transparent;\n flex-grow: 2;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 0;\n width: auto;\n\n .dot-nested-list {\n background: transparent;\n }\n\n .", " {\n .dot-drawer-paper {\n padding: ", "px;\n border-right: 1px solid\n ", ";\n box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.15);\n padding-top: ", ";\n }\n\n .MuiTypography-root.MuiTypography-subtitle2 {\n border: ", ";\n color: ", ";\n font-size: ", ";\n line-height: 40px;\n margin: ", ";\n padding: ", ";\n }\n\n .", " {\n margin: 0;\n padding-left: ", "px;\n }\n }\n\n .dot-list-item {\n height: ", ";\n padding: 0;\n margin-bottom: ", ";\n\n &.MuiListItem-root.Mui-selected,\n &.MuiListItem-root.Mui-selected:hover,\n &:hover {\n background-color: ", ";\n }\n\n &.Mui-focusVisible {\n box-shadow: inset 0 0 0 2px ", ";\n border: 2px solid ", ";\n }\n\n &:hover,\n &:active,\n &:focus {\n .dot-typography,\n .dot-icon i.dot-i:before {\n color: ", ";\n }\n }\n\n &.open {\n background-color: ", ";\n border: ", ";\n border-radius: ", ";\n\n &:hover {\n background-color: ", ";\n }\n }\n\n .MuiTouchRipple-root {\n display: ", ";\n }\n\n .dot-list-item-link .dot-icon {\n margin-right: ", "px;\n }\n\n .dot-icon {\n border-radius: 50%;\n height: 40px;\n margin: ", ";\n width: 40px;\n }\n\n .dot-typography {\n white-space: nowrap;\n }\n }\n }\n\n .toggle-nav {\n border-top: 1px solid;\n border-top-color: ", ";\n padding: ", "px;\n text-align: right;\n\n .dot-icon {\n transform: rotate(0deg);\n -o-transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n -moz-transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n -webkit-transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n }\n }\n\n .powered-by {\n border-top: 1px solid;\n border-top-color: ", ";\n color: ", ";\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n font-size: 12px;\n overflow: hidden;\n padding: ", "px;\n\n p.desc {\n white-space: nowrap;\n }\n\n .company-name {\n margin-top: ", "px;\n }\n\n .d-icon {\n display: none;\n }\n }\n\n &.collapsed {\n overflow: hidden;\n padding: ", ";\n width: 58px;\n -o-transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -moz-transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -webkit-transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n\n li.MuiListSubheader-root .dot-typography,\n .go-back .MuiTypography-root,\n .MuiListItem-divider .dot-list-item-link,\n .child,\n .powered-by .company-name,\n .powered-by p.desc {\n display: none;\n }\n\n .dot-nested-drawer li.MuiListSubheader-root .dot-typography,\n .powered-by .d-icon {\n display: block;\n }\n\n header .dot-app-logo {\n text-align: center;\n }\n\n ul.side-nav {\n width: 56px;\n .dot-list-item {\n margin-left: 0;\n }\n\n .toggle-nav {\n align-self: center;\n }\n }\n\n .powered-by {\n align-items: center;\n }\n }\n }\n "], ["\n &.", " {\n align-items: stretch;\n background: ", ";\n border-width: 0 1px;\n border-style: solid;\n border-color: ", ";\n box-shadow: ", ";\n box-sizing: border-box;\n color: ", ";\n display: flex;\n height: 100%;\n flex-direction: column;\n justify-content: space-between;\n letter-spacing: 0.01em;\n padding: ", ";\n -o-transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -moz-transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -webkit-transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n\n header {\n align-items: center;\n border-bottom: 1px solid;\n border-bottom-color: ", ";\n display: flex;\n height: 40px;\n flex-shrink: 0;\n overflow: hidden;\n margin-bottom: ", ";\n padding: ", ";\n white-space: nowrap;\n\n &.app-logo {\n box-sizing: border-box;\n\n .dot-app-logo {\n svg,\n img {\n max-width: 100%;\n }\n }\n }\n\n .dot-avatar {\n margin-right: ", "px;\n }\n }\n\n .go-back {\n align-items: center;\n border-bottom: 1px solid;\n border-bottom-color: ", ";\n display: flex;\n\n .go-back-button {\n margin: ", ";\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n &:focus-visible {\n box-shadow: 0 0 0 2px ", ",\n 0 0 0 4px ", ";\n }\n }\n }\n\n hr.MuiDivider-root {\n background-color: ", ";\n margin: ", ";\n }\n\n .MuiListSubheader-root {\n border-bottom: 1px solid;\n border-bottom-color: ", ";\n margin: ", ";\n\n .dot-typography {\n margin: 0;\n }\n }\n\n ul.side-nav {\n background: transparent;\n flex-grow: 2;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 0;\n width: auto;\n\n .dot-nested-list {\n background: transparent;\n }\n\n .", " {\n .dot-drawer-paper {\n padding: ", "px;\n border-right: 1px solid\n ", ";\n box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.15);\n padding-top: ", ";\n }\n\n .MuiTypography-root.MuiTypography-subtitle2 {\n border: ", ";\n color: ", ";\n font-size: ", ";\n line-height: 40px;\n margin: ", ";\n padding: ", ";\n }\n\n .", " {\n margin: 0;\n padding-left: ", "px;\n }\n }\n\n .dot-list-item {\n height: ", ";\n padding: 0;\n margin-bottom: ", ";\n\n &.MuiListItem-root.Mui-selected,\n &.MuiListItem-root.Mui-selected:hover,\n &:hover {\n background-color: ", ";\n }\n\n &.Mui-focusVisible {\n box-shadow: inset 0 0 0 2px ", ";\n border: 2px solid ", ";\n }\n\n &:hover,\n &:active,\n &:focus {\n .dot-typography,\n .dot-icon i.dot-i:before {\n color: ", ";\n }\n }\n\n &.open {\n background-color: ", ";\n border: ", ";\n border-radius: ", ";\n\n &:hover {\n background-color: ", ";\n }\n }\n\n .MuiTouchRipple-root {\n display: ", ";\n }\n\n .dot-list-item-link .dot-icon {\n margin-right: ", "px;\n }\n\n .dot-icon {\n border-radius: 50%;\n height: 40px;\n margin: ", ";\n width: 40px;\n }\n\n .dot-typography {\n white-space: nowrap;\n }\n }\n }\n\n .toggle-nav {\n border-top: 1px solid;\n border-top-color: ", ";\n padding: ", "px;\n text-align: right;\n\n .dot-icon {\n transform: rotate(0deg);\n -o-transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n -moz-transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n -webkit-transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n }\n }\n\n .powered-by {\n border-top: 1px solid;\n border-top-color: ", ";\n color: ", ";\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n font-size: 12px;\n overflow: hidden;\n padding: ", "px;\n\n p.desc {\n white-space: nowrap;\n }\n\n .company-name {\n margin-top: ", "px;\n }\n\n .d-icon {\n display: none;\n }\n }\n\n &.collapsed {\n overflow: hidden;\n padding: ", ";\n width: 58px;\n -o-transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -moz-transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -webkit-transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n\n li.MuiListSubheader-root .dot-typography,\n .go-back .MuiTypography-root,\n .MuiListItem-divider .dot-list-item-link,\n .child,\n .powered-by .company-name,\n .powered-by p.desc {\n display: none;\n }\n\n .dot-nested-drawer li.MuiListSubheader-root .dot-typography,\n .powered-by .d-icon {\n display: block;\n }\n\n header .dot-app-logo {\n text-align: center;\n }\n\n ul.side-nav {\n width: 56px;\n .dot-list-item {\n margin-left: 0;\n }\n\n .toggle-nav {\n align-self: center;\n }\n }\n\n .powered-by {\n align-items: center;\n }\n }\n }\n "])), rootClassName$I, theme.palette.product === 'agility' ? theme.palette.layer.n50 : theme.palette.grey[50], theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' && '0 0 5px rgba(0, 0, 0, 0.15)', theme.palette.product === 'agility' ? theme.palette.layer.n700 : theme.palette.grey[700], theme.palette.product === 'agility' && theme.spacing(2) + "px", theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' && theme.spacing(1) + "px", theme.palette.product === 'agililty' ? theme.spacing(0, 0, 1) : theme.spacing(1, 2), theme.spacing(1), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.spacing(0.5, 1), theme.palette.layer.n100, theme.palette.layer.n200, theme.palette.layer.n0, theme.palette.layer.n900, theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' ? theme.spacing(2, 0) : theme.spacing(1, 0), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.spacing(0, 0, 1), nestedDrawerClassName, theme.spacing(2), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' && '10px', theme.palette.product === 'agility' && 'none', theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavSubHeaderText, theme.palette.product === 'agility' && '11px', theme.palette.product === 'agility' && '10px 0 0', theme.palette.product === 'agility' && '0 8px', listItemRootClass, theme.spacing(2), theme.palette.product === 'agility' ? '40px' : '44px', theme.palette.product === 'agility' && theme.spacing(1) + "px", theme.palette.product === 'agility' && 'transparent', theme.palette.layer.n0, theme.palette.layer.n900, theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavHoverText, theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavHoverBg, theme.palette.product === 'agility' ? "1px solid " + theme.palette.agilityInterface.sideNavHoverBorder : 'none', theme.palette.product === 'agility' && '4px', theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavHoverBg, theme.palette.product === 'agility' && 'none', theme.spacing(1), theme.spacing(0, 1), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.spacing(1), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.grey[400], theme.spacing(1), theme.spacing(1), theme.palette.product === 'agility' && theme.spacing(2, 0));
|
|
2463
|
+
return styled.css(templateObject_1$L || (templateObject_1$L = __makeTemplateObject(["\n &.", " {\n align-items: stretch;\n background: ", ";\n border-width: 0 1px;\n border-style: solid;\n border-color: ", ";\n box-shadow: ", ";\n box-sizing: border-box;\n color: ", ";\n display: flex;\n height: 100%;\n flex-direction: column;\n justify-content: space-between;\n letter-spacing: 0.01em;\n padding: ", ";\n -o-transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -moz-transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -webkit-transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n\n header {\n align-items: center;\n border-bottom: 1px solid;\n border-bottom-color: ", ";\n display: flex;\n height: 40px;\n flex-shrink: 0;\n overflow: hidden;\n margin-bottom: ", ";\n padding: ", ";\n white-space: nowrap;\n\n &.app-logo {\n box-sizing: border-box;\n\n .dot-app-logo {\n svg,\n img {\n max-width: 100%;\n }\n }\n }\n\n .dot-avatar {\n margin-right: ", "px;\n }\n }\n\n .go-back {\n align-items: center;\n border-bottom: 1px solid;\n border-bottom-color: ", ";\n display: flex;\n\n .go-back-button {\n margin: ", ";\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n &:focus-visible {\n box-shadow: 0 0 0 2px ", ",\n 0 0 0 4px ", ";\n }\n }\n }\n\n hr.MuiDivider-root {\n background-color: ", ";\n margin: ", ";\n }\n\n .MuiListSubheader-root {\n border-bottom: 1px solid;\n border-bottom-color: ", ";\n margin: ", ";\n\n .dot-typography {\n margin: 0;\n }\n }\n\n ul.side-nav {\n background: transparent;\n flex-grow: 2;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 0;\n width: auto;\n\n .dot-nested-list {\n background: transparent;\n }\n\n .", " {\n .dot-drawer-paper {\n padding: ", "px;\n overflow-y: scroll;\n border-right: 1px solid\n ", ";\n box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.15);\n padding-top: ", ";\n }\n\n .MuiTypography-root.MuiTypography-subtitle2 {\n border: ", ";\n color: ", ";\n font-size: ", ";\n line-height: 40px;\n margin: ", ";\n padding: ", ";\n }\n\n .", " {\n margin: 0;\n padding-left: ", "px;\n }\n }\n\n .dot-list-item {\n height: ", ";\n padding: 0;\n margin-bottom: ", ";\n\n &.MuiListItem-root.Mui-selected,\n &.MuiListItem-root.Mui-selected:hover,\n &:hover {\n background-color: ", ";\n }\n\n &.Mui-focusVisible {\n box-shadow: inset 0 0 0 2px ", ";\n border: 2px solid ", ";\n }\n\n &:hover,\n &:active,\n &:focus {\n .dot-typography,\n .dot-icon i.dot-i:before {\n color: ", ";\n }\n }\n\n &.open {\n background-color: ", ";\n border: ", ";\n border-radius: ", ";\n\n &:hover {\n background-color: ", ";\n }\n }\n\n .MuiTouchRipple-root {\n display: ", ";\n }\n\n .dot-list-item-link .dot-icon {\n margin-right: ", "px;\n }\n\n .dot-icon {\n border-radius: 50%;\n height: 40px;\n margin: ", ";\n width: 40px;\n }\n\n .dot-typography {\n white-space: nowrap;\n }\n }\n }\n\n .toggle-nav {\n border-top: 1px solid;\n border-top-color: ", ";\n padding: ", "px;\n text-align: right;\n\n .dot-icon {\n transform: rotate(0deg);\n -o-transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n -moz-transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n -webkit-transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n }\n }\n\n .powered-by {\n border-top: 1px solid;\n border-top-color: ", ";\n color: ", ";\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n font-size: 12px;\n overflow: hidden;\n padding: ", "px;\n\n p.desc {\n white-space: nowrap;\n }\n\n .company-name {\n margin-top: ", "px;\n }\n\n .d-icon {\n display: none;\n }\n }\n\n &.collapsed {\n overflow: hidden;\n padding: ", ";\n width: 58px;\n -o-transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -moz-transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -webkit-transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n\n li.MuiListSubheader-root .dot-typography,\n .go-back .MuiTypography-root,\n .MuiListItem-divider .dot-list-item-link,\n .child,\n .powered-by .company-name,\n .powered-by p.desc {\n display: none;\n }\n\n .dot-nested-drawer li.MuiListSubheader-root .dot-typography,\n .powered-by .d-icon {\n display: block;\n }\n\n header .dot-app-logo {\n text-align: center;\n }\n\n ul.side-nav {\n width: 56px;\n .dot-list-item {\n margin-left: 0;\n }\n\n .toggle-nav {\n align-self: center;\n }\n }\n\n .powered-by {\n align-items: center;\n }\n }\n }\n "], ["\n &.", " {\n align-items: stretch;\n background: ", ";\n border-width: 0 1px;\n border-style: solid;\n border-color: ", ";\n box-shadow: ", ";\n box-sizing: border-box;\n color: ", ";\n display: flex;\n height: 100%;\n flex-direction: column;\n justify-content: space-between;\n letter-spacing: 0.01em;\n padding: ", ";\n -o-transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -moz-transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -webkit-transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n transition: width cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n\n header {\n align-items: center;\n border-bottom: 1px solid;\n border-bottom-color: ", ";\n display: flex;\n height: 40px;\n flex-shrink: 0;\n overflow: hidden;\n margin-bottom: ", ";\n padding: ", ";\n white-space: nowrap;\n\n &.app-logo {\n box-sizing: border-box;\n\n .dot-app-logo {\n svg,\n img {\n max-width: 100%;\n }\n }\n }\n\n .dot-avatar {\n margin-right: ", "px;\n }\n }\n\n .go-back {\n align-items: center;\n border-bottom: 1px solid;\n border-bottom-color: ", ";\n display: flex;\n\n .go-back-button {\n margin: ", ";\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n &:focus-visible {\n box-shadow: 0 0 0 2px ", ",\n 0 0 0 4px ", ";\n }\n }\n }\n\n hr.MuiDivider-root {\n background-color: ", ";\n margin: ", ";\n }\n\n .MuiListSubheader-root {\n border-bottom: 1px solid;\n border-bottom-color: ", ";\n margin: ", ";\n\n .dot-typography {\n margin: 0;\n }\n }\n\n ul.side-nav {\n background: transparent;\n flex-grow: 2;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 0;\n width: auto;\n\n .dot-nested-list {\n background: transparent;\n }\n\n .", " {\n .dot-drawer-paper {\n padding: ", "px;\n overflow-y: scroll;\n border-right: 1px solid\n ", ";\n box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.15);\n padding-top: ", ";\n }\n\n .MuiTypography-root.MuiTypography-subtitle2 {\n border: ", ";\n color: ", ";\n font-size: ", ";\n line-height: 40px;\n margin: ", ";\n padding: ", ";\n }\n\n .", " {\n margin: 0;\n padding-left: ", "px;\n }\n }\n\n .dot-list-item {\n height: ", ";\n padding: 0;\n margin-bottom: ", ";\n\n &.MuiListItem-root.Mui-selected,\n &.MuiListItem-root.Mui-selected:hover,\n &:hover {\n background-color: ", ";\n }\n\n &.Mui-focusVisible {\n box-shadow: inset 0 0 0 2px ", ";\n border: 2px solid ", ";\n }\n\n &:hover,\n &:active,\n &:focus {\n .dot-typography,\n .dot-icon i.dot-i:before {\n color: ", ";\n }\n }\n\n &.open {\n background-color: ", ";\n border: ", ";\n border-radius: ", ";\n\n &:hover {\n background-color: ", ";\n }\n }\n\n .MuiTouchRipple-root {\n display: ", ";\n }\n\n .dot-list-item-link .dot-icon {\n margin-right: ", "px;\n }\n\n .dot-icon {\n border-radius: 50%;\n height: 40px;\n margin: ", ";\n width: 40px;\n }\n\n .dot-typography {\n white-space: nowrap;\n }\n }\n }\n\n .toggle-nav {\n border-top: 1px solid;\n border-top-color: ", ";\n padding: ", "px;\n text-align: right;\n\n .dot-icon {\n transform: rotate(0deg);\n -o-transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n -moz-transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n -webkit-transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;\n }\n }\n\n .powered-by {\n border-top: 1px solid;\n border-top-color: ", ";\n color: ", ";\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n font-size: 12px;\n overflow: hidden;\n padding: ", "px;\n\n p.desc {\n white-space: nowrap;\n }\n\n .company-name {\n margin-top: ", "px;\n }\n\n .d-icon {\n display: none;\n }\n }\n\n &.collapsed {\n overflow: hidden;\n padding: ", ";\n width: 58px;\n -o-transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -moz-transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n -webkit-transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n transition: all cubic-bezier(0.4, 0, 0.6, 1) 0.3s;\n\n li.MuiListSubheader-root .dot-typography,\n .go-back .MuiTypography-root,\n .MuiListItem-divider .dot-list-item-link,\n .child,\n .powered-by .company-name,\n .powered-by p.desc {\n display: none;\n }\n\n .dot-nested-drawer li.MuiListSubheader-root .dot-typography,\n .powered-by .d-icon {\n display: block;\n }\n\n header .dot-app-logo {\n text-align: center;\n }\n\n ul.side-nav {\n width: 56px;\n .dot-list-item {\n margin-left: 0;\n }\n\n .toggle-nav {\n align-self: center;\n }\n }\n\n .powered-by {\n align-items: center;\n }\n }\n }\n "])), rootClassName$I, theme.palette.product === 'agility' ? theme.palette.layer.n50 : theme.palette.grey[50], theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' && '0 0 5px rgba(0, 0, 0, 0.15)', theme.palette.product === 'agility' ? theme.palette.layer.n700 : theme.palette.grey[700], theme.palette.product === 'agility' && theme.spacing(2) + "px", theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' && theme.spacing(1) + "px", theme.palette.product === 'agililty' ? theme.spacing(0, 0, 1) : theme.spacing(1, 2), theme.spacing(1), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.spacing(0.5, 1), theme.palette.layer.n100, theme.palette.layer.n200, theme.palette.layer.n0, theme.palette.layer.n900, theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' ? theme.spacing(2, 0) : theme.spacing(1, 0), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.spacing(0, 0, 1), nestedDrawerClassName, theme.spacing(2), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.product === 'agility' && '10px', theme.palette.product === 'agility' && 'none', theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavSubHeaderText, theme.palette.product === 'agility' && '11px', theme.palette.product === 'agility' && '10px 0 0', theme.palette.product === 'agility' && '0 8px', listItemRootClass, theme.spacing(2), theme.palette.product === 'agility' ? '40px' : '44px', theme.palette.product === 'agility' && theme.spacing(1) + "px", theme.palette.product === 'agility' && 'transparent', theme.palette.layer.n0, theme.palette.layer.n900, theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavHoverText, theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavHoverBg, theme.palette.product === 'agility' ? "1px solid " + theme.palette.agilityInterface.sideNavHoverBorder : 'none', theme.palette.product === 'agility' && '4px', theme.palette.product === 'agility' && theme.palette.agilityInterface.sideNavHoverBg, theme.palette.product === 'agility' && 'none', theme.spacing(1), theme.spacing(0, 1), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.spacing(1), theme.palette.product === 'agility' ? theme.palette.agilityInterface.sideNavBorder : theme.palette.grey[100], theme.palette.grey[400], theme.spacing(1), theme.spacing(1), theme.palette.product === 'agility' && theme.spacing(2, 0));
|
|
2464
2464
|
});
|
|
2465
2465
|
var templateObject_1$L, templateObject_2$J;
|
|
2466
2466
|
|
|
@@ -6000,6 +6000,37 @@
|
|
|
6000
6000
|
iconId: "error-solid"
|
|
6001
6001
|
})));
|
|
6002
6002
|
};
|
|
6003
|
+
var applyBindings = function applyBindings(bindings, inlineEditText) {
|
|
6004
|
+
if (!bindings || !bindings.length || !inlineEditText) return;
|
|
6005
|
+
var text = inlineEditText;
|
|
6006
|
+
var boundNode = [];
|
|
6007
|
+
bindings.forEach(function (binding, index) {
|
|
6008
|
+
var stringBinding = binding.binding,
|
|
6009
|
+
_a = binding.className,
|
|
6010
|
+
className = _a === void 0 ? null : _a,
|
|
6011
|
+
value = binding.value;
|
|
6012
|
+
var bindingStringIndex = text.indexOf(stringBinding);
|
|
6013
|
+
var key = 0;
|
|
6014
|
+
|
|
6015
|
+
while (bindingStringIndex >= 0) {
|
|
6016
|
+
// Since key is needed only for bindings with className,
|
|
6017
|
+
// increment key value only if className value is defined
|
|
6018
|
+
className && key++;
|
|
6019
|
+
var nextStartingIndex = bindingStringIndex + stringBinding.length;
|
|
6020
|
+
var previousText = text.substr(0, bindingStringIndex);
|
|
6021
|
+
text = text.substr(nextStartingIndex, text.length);
|
|
6022
|
+
bindingStringIndex = text.indexOf(stringBinding); // Add nodes to array
|
|
6023
|
+
|
|
6024
|
+
boundNode = [boundNode, previousText, className ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
6025
|
+
className: className,
|
|
6026
|
+
key: index + "-" + key
|
|
6027
|
+
}, value) : value];
|
|
6028
|
+
}
|
|
6029
|
+
}); // Add remainder of the text to the node
|
|
6030
|
+
|
|
6031
|
+
boundNode = [boundNode, text];
|
|
6032
|
+
return boundNode;
|
|
6033
|
+
};
|
|
6003
6034
|
|
|
6004
6035
|
/**
|
|
6005
6036
|
* @experimental This component is still in development
|
|
@@ -6007,6 +6038,7 @@
|
|
|
6007
6038
|
|
|
6008
6039
|
var DotInlineEdit = function DotInlineEdit(_a) {
|
|
6009
6040
|
var ariaLabel = _a.ariaLabel,
|
|
6041
|
+
bindings = _a.bindings,
|
|
6010
6042
|
charactersLimit = _a.charactersLimit,
|
|
6011
6043
|
className = _a.className,
|
|
6012
6044
|
dataTestId = _a["data-testid"],
|
|
@@ -6060,6 +6092,9 @@
|
|
|
6060
6092
|
if (!inputValue) return [2
|
|
6061
6093
|
/*return*/
|
|
6062
6094
|
];
|
|
6095
|
+
if (!onChange) return [3
|
|
6096
|
+
/*break*/
|
|
6097
|
+
, 2];
|
|
6063
6098
|
return [4
|
|
6064
6099
|
/*yield*/
|
|
6065
6100
|
, onChange(inputValue)];
|
|
@@ -6074,6 +6109,9 @@
|
|
|
6074
6109
|
];
|
|
6075
6110
|
}
|
|
6076
6111
|
|
|
6112
|
+
_b.label = 2;
|
|
6113
|
+
|
|
6114
|
+
case 2:
|
|
6077
6115
|
setEditing(false);
|
|
6078
6116
|
|
|
6079
6117
|
if (onEditStateChange) {
|
|
@@ -6198,7 +6236,7 @@
|
|
|
6198
6236
|
className: "dot-view-mode-typography",
|
|
6199
6237
|
"data-testid": dataTestId && dataTestId + "-view-mode-typography",
|
|
6200
6238
|
variant: typography
|
|
6201
|
-
}, inputValue), /*#__PURE__*/React__default["default"].createElement(DotIcon, {
|
|
6239
|
+
}, bindings ? applyBindings(bindings, inputValue) : inputValue), /*#__PURE__*/React__default["default"].createElement(DotIcon, {
|
|
6202
6240
|
className: "dot-edit-icon",
|
|
6203
6241
|
"data-testid": dataTestId && dataTestId + "-edit-icon",
|
|
6204
6242
|
iconId: "edit"
|
|
@@ -7741,14 +7779,14 @@
|
|
|
7741
7779
|
componentId: "sc-1q8bcxy-0"
|
|
7742
7780
|
})(templateObject_2$4 || (templateObject_2$4 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
7743
7781
|
var theme = _a.theme;
|
|
7744
|
-
return styled.css(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n &.", " {\n .", " {\n border-bottom: 1px solid ", ";\n &:hover {\n cursor: pointer;\n background: ", ";\n }\n\n &.file-success:not(:hover) {\n .", "-end-icon .dot-icon i:before {\n color: ", ";\n }\n }\n\n &.file-error:not(:hover) {\n .MuiListItemText-secondary,\n .", "-end-icon .dot-icon i:before {\n color: ", ";\n }\n }\n\n .dot-typography,\n .file-item-text {\n flex-grow: 2;\n padding-left: ", "px;\n }\n\n .file-item-text {\n display: flex;\n flex-direction: column;\n\n .MuiTypography-body2 {\n color: ", ";\n }\n }\n }\n }\n "], ["\n &.", " {\n .", " {\n border-bottom: 1px solid ", ";\n &:hover {\n cursor: pointer;\n background: ", ";\n }\n\n &.file-success:not(:hover) {\n .", "-end-icon .dot-icon i:before {\n color: ", ";\n }\n }\n\n &.file-error:not(:hover) {\n .MuiListItemText-secondary,\n .", "-end-icon .dot-icon i:before {\n color: ", ";\n }\n }\n\n .dot-typography,\n .file-item-text {\n flex-grow: 2;\n padding-left: ", "px;\n }\n\n .file-item-text {\n display: flex;\n flex-direction: column;\n\n .MuiTypography-body2 {\n color: ", ";\n }\n }\n }\n }\n "])), containerClassName, listItemRootClass, theme.palette.layer.n100, theme.palette.layer.n50, listItemRootClass, theme.palette.secondary.main, listItemRootClass, theme.palette.error.main, theme.spacing(1), theme.palette.error.main);
|
|
7782
|
+
return styled.css(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n &.", " {\n .dot-max-files-message.dot-max-files-reached {\n color: ", ";\n }\n\n .", " {\n border-bottom: 1px solid ", ";\n &:hover {\n cursor: pointer;\n background: ", ";\n }\n\n &.file-success:not(:hover) {\n .", "-end-icon .dot-icon i:before {\n color: ", ";\n }\n }\n\n &.file-error:not(:hover) {\n .MuiListItemText-secondary,\n .", "-end-icon .dot-icon i:before {\n color: ", ";\n }\n }\n\n .dot-typography,\n .file-item-text {\n flex-grow: 2;\n padding-left: ", "px;\n }\n\n .file-item-text {\n display: flex;\n flex-direction: column;\n\n .MuiTypography-body2 {\n color: ", ";\n }\n }\n }\n }\n "], ["\n &.", " {\n .dot-max-files-message.dot-max-files-reached {\n color: ", ";\n }\n\n .", " {\n border-bottom: 1px solid ", ";\n &:hover {\n cursor: pointer;\n background: ", ";\n }\n\n &.file-success:not(:hover) {\n .", "-end-icon .dot-icon i:before {\n color: ", ";\n }\n }\n\n &.file-error:not(:hover) {\n .MuiListItemText-secondary,\n .", "-end-icon .dot-icon i:before {\n color: ", ";\n }\n }\n\n .dot-typography,\n .file-item-text {\n flex-grow: 2;\n padding-left: ", "px;\n }\n\n .file-item-text {\n display: flex;\n flex-direction: column;\n\n .MuiTypography-body2 {\n color: ", ";\n }\n }\n }\n }\n "])), containerClassName, theme.palette.error[500], listItemRootClass, theme.palette.layer.n100, theme.palette.layer.n50, listItemRootClass, theme.palette.secondary.main, listItemRootClass, theme.palette.error.main, theme.spacing(1), theme.palette.error.main);
|
|
7745
7783
|
});
|
|
7746
7784
|
var StyledFileUpload = styled__default["default"].div.withConfig({
|
|
7747
7785
|
displayName: "FileUploadstyles__StyledFileUpload",
|
|
7748
7786
|
componentId: "sc-1q8bcxy-1"
|
|
7749
7787
|
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
7750
7788
|
var theme = _a.theme;
|
|
7751
|
-
return styled.css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &.", ".", " {\n align-items: center;\n background: ", ";\n border: 2px dashed ", ";\n border-radius: 4px;\n color: ", ";\n display: flex;\n flex-direction: column;\n flex-wrap: wrap;\n height: 240px;\n justify-content: center;\n padding: ", ";\n margin-bottom: ", "px;\n\n &.disabled .dot-typography {\n color: ", ";\n }\n\n .dot-icon {\n color: ", ";\n font-size: 100px;\n\n i.dot-i {\n height: 100px;\n }\n }\n }\n "], ["\n &.", ".", " {\n align-items: center;\n background: ", ";\n border: 2px dashed ", ";\n border-radius: 4px;\n color: ", ";\n display: flex;\n flex-direction: column;\n flex-wrap: wrap;\n height: 240px;\n justify-content: center;\n padding: ", ";\n margin-bottom: ", "px;\n\n &.disabled .dot-typography {\n color: ", ";\n }\n\n .dot-icon {\n color: ", ";\n font-size: 100px;\n\n i.dot-i {\n height: 100px;\n }\n }\n }\n "])), rootClassName$4, dropZoneClassName, theme.palette.layer.n50, theme.palette.layer.n300, theme.palette.layer.n500, theme.spacing(3, 0), theme.spacing(1), theme.palette.layer.n300, theme.palette.layer.n100);
|
|
7789
|
+
return styled.css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &.", ".", " {\n align-items: center;\n background: ", ";\n border: 2px dashed ", ";\n border-radius: 4px;\n color: ", ";\n display: flex;\n flex-direction: column;\n flex-wrap: wrap;\n height: 240px;\n justify-content: center;\n padding: ", ";\n margin-bottom: ", "px;\n text-align: center;\n\n &.disabled .dot-typography {\n color: ", ";\n }\n\n .dot-icon {\n color: ", ";\n font-size: 100px;\n\n i.dot-i {\n height: 100px;\n }\n }\n }\n "], ["\n &.", ".", " {\n align-items: center;\n background: ", ";\n border: 2px dashed ", ";\n border-radius: 4px;\n color: ", ";\n display: flex;\n flex-direction: column;\n flex-wrap: wrap;\n height: 240px;\n justify-content: center;\n padding: ", ";\n margin-bottom: ", "px;\n text-align: center;\n\n &.disabled .dot-typography {\n color: ", ";\n }\n\n .dot-icon {\n color: ", ";\n font-size: 100px;\n\n i.dot-i {\n height: 100px;\n }\n }\n }\n "])), rootClassName$4, dropZoneClassName, theme.palette.layer.n50, theme.palette.layer.n300, theme.palette.layer.n500, theme.spacing(3, 0), theme.spacing(1), theme.palette.layer.n300, theme.palette.layer.n100);
|
|
7752
7790
|
});
|
|
7753
7791
|
var templateObject_1$4, templateObject_2$4, templateObject_3, templateObject_4;
|
|
7754
7792
|
|
|
@@ -7795,6 +7833,54 @@
|
|
|
7795
7833
|
}));
|
|
7796
7834
|
};
|
|
7797
7835
|
|
|
7836
|
+
var renderMaxSizeMessage = function renderMaxSizeMessage(maxSizeMB) {
|
|
7837
|
+
return /*#__PURE__*/React__default["default"].createElement(DotTypography, {
|
|
7838
|
+
variant: "body2"
|
|
7839
|
+
}, "File size should not exceed ", maxSizeMB, "MB.");
|
|
7840
|
+
};
|
|
7841
|
+
var renderMaxFilesMessage = function renderMaxFilesMessage(maxFiles, maxFilesClasses) {
|
|
7842
|
+
return /*#__PURE__*/React__default["default"].createElement(DotTypography, {
|
|
7843
|
+
className: maxFilesClasses,
|
|
7844
|
+
variant: "body2"
|
|
7845
|
+
}, maxFiles, " files are the maximum number of files you can upload.");
|
|
7846
|
+
};
|
|
7847
|
+
var renderSelectFilesButton = function renderSelectFilesButton(isUploadDisabled, onButtonClick) {
|
|
7848
|
+
return /*#__PURE__*/React__default["default"].createElement(DotButton, {
|
|
7849
|
+
disabled: isUploadDisabled,
|
|
7850
|
+
onClick: onButtonClick
|
|
7851
|
+
}, "Select file(s)");
|
|
7852
|
+
};
|
|
7853
|
+
var renderActiveDragArea = function renderActiveDragArea() {
|
|
7854
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(DotIcon, {
|
|
7855
|
+
iconId: "upload-file"
|
|
7856
|
+
}), /*#__PURE__*/React__default["default"].createElement(DotTypography, {
|
|
7857
|
+
variant: "h3"
|
|
7858
|
+
}, "Drop the file(s) here ..."));
|
|
7859
|
+
};
|
|
7860
|
+
var renderDragAndDropArea = function renderDragAndDropArea(isUploadDisabled, onSelectButtonClick) {
|
|
7861
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(DotIcon, {
|
|
7862
|
+
iconId: "upload-file"
|
|
7863
|
+
}), /*#__PURE__*/React__default["default"].createElement(DotTypography, {
|
|
7864
|
+
variant: "h3"
|
|
7865
|
+
}, "Drag and drop your file(s) here ", /*#__PURE__*/React__default["default"].createElement("br", null), " or"), renderSelectFilesButton(isUploadDisabled, onSelectButtonClick));
|
|
7866
|
+
};
|
|
7867
|
+
var renderDropzoneContent = function renderDropzoneContent(_a) {
|
|
7868
|
+
var buttonOnly = _a.buttonOnly,
|
|
7869
|
+
isDragActive = _a.isDragActive,
|
|
7870
|
+
isUploadDisabled = _a.isUploadDisabled,
|
|
7871
|
+
open = _a.open;
|
|
7872
|
+
|
|
7873
|
+
if (buttonOnly) {
|
|
7874
|
+
return renderSelectFilesButton(isUploadDisabled, open);
|
|
7875
|
+
} else {
|
|
7876
|
+
return isDragActive ? renderActiveDragArea() : renderDragAndDropArea(isUploadDisabled, open);
|
|
7877
|
+
}
|
|
7878
|
+
};
|
|
7879
|
+
var getUploadedFilesList = function getUploadedFilesList(uploadedFiles, maxSize, onFileDelete) {
|
|
7880
|
+
return uploadedFiles.map(function (file) {
|
|
7881
|
+
return parseListItem(onFileDelete, file, maxSize);
|
|
7882
|
+
});
|
|
7883
|
+
};
|
|
7798
7884
|
var parseListItem = function parseListItem(deleteFile, fileToBeParsed, maxSize) {
|
|
7799
7885
|
var fileErrors = fileToBeParsed.errors;
|
|
7800
7886
|
var parsedFile = fileToBeParsed.file;
|
|
@@ -7808,8 +7894,6 @@
|
|
|
7808
7894
|
return "File exceeds " + maxSize + "MB";
|
|
7809
7895
|
|
|
7810
7896
|
case 'file-invalid-type':
|
|
7811
|
-
return e.message;
|
|
7812
|
-
|
|
7813
7897
|
case 'too-many-files':
|
|
7814
7898
|
return e.message;
|
|
7815
7899
|
|
|
@@ -7825,8 +7909,7 @@
|
|
|
7825
7909
|
deleteFile: deleteFile,
|
|
7826
7910
|
error: hasErrors,
|
|
7827
7911
|
errorText: errorText,
|
|
7828
|
-
file: parsedFile
|
|
7829
|
-
key: CreateUUID()
|
|
7912
|
+
file: parsedFile
|
|
7830
7913
|
})
|
|
7831
7914
|
};
|
|
7832
7915
|
};
|
|
@@ -7843,26 +7926,34 @@
|
|
|
7843
7926
|
maxSize = _a.maxSize,
|
|
7844
7927
|
onChange = _a.onChange,
|
|
7845
7928
|
onDragEnter = _a.onDragEnter;
|
|
7846
|
-
var rootClasses = useStylesWithRootClass(rootClassName$4, className, !buttonOnly ? dropZoneClassName : '', disabled ? 'disabled' : '');
|
|
7847
7929
|
|
|
7848
|
-
var _c =
|
|
7930
|
+
var _c = React.useState([]),
|
|
7931
|
+
uploadedFiles = _c[0],
|
|
7932
|
+
setUploadedFiles = _c[1];
|
|
7933
|
+
|
|
7934
|
+
var _d = React.useState(false),
|
|
7935
|
+
hasMaxFilesError = _d[0],
|
|
7936
|
+
setHasMaxFilesError = _d[1];
|
|
7937
|
+
|
|
7938
|
+
var isUploadDisabled = disabled || maxFiles && uploadedFiles.length >= maxFiles;
|
|
7939
|
+
var rootClasses = useStylesWithRootClass(rootClassName$4, className, !buttonOnly ? dropZoneClassName : '', isUploadDisabled ? 'disabled' : '');
|
|
7940
|
+
var maxFilesClasses = useStylesWithRootClass('dot-max-files-message', hasMaxFilesError ? 'dot-max-files-reached' : '');
|
|
7941
|
+
var allowMultiple = maxFiles === undefined || maxFiles > 1;
|
|
7942
|
+
|
|
7943
|
+
var _e = reactDropzone.useDropzone({
|
|
7849
7944
|
accept: accept,
|
|
7850
|
-
disabled:
|
|
7851
|
-
maxFiles: maxFiles,
|
|
7945
|
+
disabled: isUploadDisabled,
|
|
7852
7946
|
maxSize: maxSize * 1000000,
|
|
7947
|
+
multiple: allowMultiple,
|
|
7853
7948
|
noClick: true,
|
|
7854
7949
|
onDragEnter: onDragEnter
|
|
7855
7950
|
}),
|
|
7856
|
-
acceptedFiles =
|
|
7857
|
-
fileRejections =
|
|
7858
|
-
getRootProps =
|
|
7859
|
-
getInputProps =
|
|
7860
|
-
isDragActive =
|
|
7861
|
-
open =
|
|
7862
|
-
|
|
7863
|
-
var _d = React.useState([]),
|
|
7864
|
-
uploadedFiles = _d[0],
|
|
7865
|
-
setUploadedFiles = _d[1];
|
|
7951
|
+
acceptedFiles = _e.acceptedFiles,
|
|
7952
|
+
fileRejections = _e.fileRejections,
|
|
7953
|
+
getRootProps = _e.getRootProps,
|
|
7954
|
+
getInputProps = _e.getInputProps,
|
|
7955
|
+
isDragActive = _e.isDragActive,
|
|
7956
|
+
open = _e.open;
|
|
7866
7957
|
|
|
7867
7958
|
React.useEffect(function () {
|
|
7868
7959
|
onChange(uploadedFiles);
|
|
@@ -7881,7 +7972,16 @@
|
|
|
7881
7972
|
};
|
|
7882
7973
|
|
|
7883
7974
|
var parseFiles = function parseFiles() {
|
|
7884
|
-
|
|
7975
|
+
var totalFilesToUpload = uploadedFiles.length + acceptedFiles.length + fileRejections.length;
|
|
7976
|
+
var isMaxFilesReached = maxFiles && totalFilesToUpload > maxFiles;
|
|
7977
|
+
|
|
7978
|
+
if (isMaxFilesReached) {
|
|
7979
|
+
setHasMaxFilesError(true);
|
|
7980
|
+
return;
|
|
7981
|
+
}
|
|
7982
|
+
|
|
7983
|
+
setHasMaxFilesError(false); // map through accepted files and make them same shape as rejected files
|
|
7984
|
+
|
|
7885
7985
|
var mappedFiles = acceptedFiles.map(function (value) {
|
|
7886
7986
|
return {
|
|
7887
7987
|
file: value,
|
|
@@ -7894,47 +7994,21 @@
|
|
|
7894
7994
|
React.useEffect(function () {
|
|
7895
7995
|
parseFiles();
|
|
7896
7996
|
}, [acceptedFiles, fileRejections]);
|
|
7897
|
-
var
|
|
7898
|
-
variant: "body2"
|
|
7899
|
-
}, maxFiles, " files are the maximum number of files you can upload at once.");
|
|
7900
|
-
var maxSizeMessage = /*#__PURE__*/React__default["default"].createElement(DotTypography, {
|
|
7901
|
-
variant: "body2"
|
|
7902
|
-
}, "File size should not exceed ", maxSize, "MB.");
|
|
7903
|
-
|
|
7904
|
-
var dropzoneContent = function dropzoneContent() {
|
|
7905
|
-
if (buttonOnly) {
|
|
7906
|
-
return /*#__PURE__*/React__default["default"].createElement(DotButton, {
|
|
7907
|
-
disabled: disabled,
|
|
7908
|
-
onClick: open
|
|
7909
|
-
}, "Select file(s)");
|
|
7910
|
-
} else {
|
|
7911
|
-
return isDragActive ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(DotIcon, {
|
|
7912
|
-
iconId: "upload-file"
|
|
7913
|
-
}), /*#__PURE__*/React__default["default"].createElement(DotTypography, {
|
|
7914
|
-
variant: "h3"
|
|
7915
|
-
}, "Drop the file(s) here ...")) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(DotIcon, {
|
|
7916
|
-
iconId: "upload-file"
|
|
7917
|
-
}), /*#__PURE__*/React__default["default"].createElement(DotTypography, {
|
|
7918
|
-
variant: "h3"
|
|
7919
|
-
}, "Drag and drop your file(s) here"), /*#__PURE__*/React__default["default"].createElement(DotTypography, {
|
|
7920
|
-
variant: "h3"
|
|
7921
|
-
}, "or"), /*#__PURE__*/React__default["default"].createElement(DotButton, {
|
|
7922
|
-
disabled: disabled,
|
|
7923
|
-
onClick: open
|
|
7924
|
-
}, "Select file(s)"));
|
|
7925
|
-
}
|
|
7926
|
-
};
|
|
7927
|
-
|
|
7997
|
+
var uploadedFilesList = getUploadedFilesList(uploadedFiles, maxSize, deleteFile);
|
|
7928
7998
|
return /*#__PURE__*/React__default["default"].createElement(StyledFileUploadContainer, {
|
|
7929
7999
|
className: containerClassName
|
|
7930
8000
|
}, /*#__PURE__*/React__default["default"].createElement(StyledFileUpload, __assign({}, getRootProps(), {
|
|
7931
8001
|
"aria-label": ariaLabel,
|
|
7932
8002
|
className: rootClasses,
|
|
7933
8003
|
"data-testid": dataTestId
|
|
7934
|
-
}), /*#__PURE__*/React__default["default"].createElement("input", __assign({}, getInputProps())),
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
8004
|
+
}), /*#__PURE__*/React__default["default"].createElement("input", __assign({}, getInputProps())), renderDropzoneContent({
|
|
8005
|
+
buttonOnly: buttonOnly,
|
|
8006
|
+
isDragActive: isDragActive,
|
|
8007
|
+
isUploadDisabled: isUploadDisabled,
|
|
8008
|
+
open: open
|
|
8009
|
+
})), maxSize && renderMaxSizeMessage(maxSize), maxFiles && renderMaxFilesMessage(maxFiles, maxFilesClasses), /*#__PURE__*/React__default["default"].createElement(DotList, {
|
|
8010
|
+
"data-testid": dataTestId && dataTestId + "-file-list",
|
|
8011
|
+
items: uploadedFilesList,
|
|
7938
8012
|
width: "100%"
|
|
7939
8013
|
}));
|
|
7940
8014
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
|
-
import { MappedFile } from './
|
|
3
|
+
import { MappedFile } from './utils/models';
|
|
4
4
|
export interface FileUploadProps extends CommonProps {
|
|
5
5
|
/** Unique file type specifiers <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers" target="_blank">More Info</a> */
|
|
6
6
|
accept?: Array<string>;
|
|
@@ -8,7 +8,7 @@ export interface FileUploadProps extends CommonProps {
|
|
|
8
8
|
buttonOnly?: boolean;
|
|
9
9
|
/** If true, the upload zone will be disabled */
|
|
10
10
|
disabled?: boolean;
|
|
11
|
-
/** Defines the maximum number of files that can be uploaded
|
|
11
|
+
/** Defines the maximum number of files that can be uploaded */
|
|
12
12
|
maxFiles?: number;
|
|
13
13
|
/** Defines the maximum file size (in MB) */
|
|
14
14
|
maxSize: number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { FileWithPath } from 'react-dropzone';
|
|
3
|
+
import { DropzoneContentArgs, MappedFile } from './models';
|
|
4
|
+
export declare const renderMaxSizeMessage: (maxSizeMB: number) => ReactNode;
|
|
5
|
+
export declare const renderMaxFilesMessage: (maxFiles: number, maxFilesClasses: string) => ReactNode;
|
|
6
|
+
export declare const renderSelectFilesButton: (isUploadDisabled: boolean, onButtonClick: () => void) => ReactNode;
|
|
7
|
+
export declare const renderActiveDragArea: () => ReactNode;
|
|
8
|
+
export declare const renderDragAndDropArea: (isUploadDisabled: boolean, onSelectButtonClick: () => void) => ReactNode;
|
|
9
|
+
export declare const renderDropzoneContent: ({ buttonOnly, isDragActive, isUploadDisabled, open, }: DropzoneContentArgs) => React.ReactNode;
|
|
10
|
+
export declare const getUploadedFilesList: (uploadedFiles: MappedFile[], maxSize: number, onFileDelete: (fileToBeRemoved: FileWithPath) => void) => {
|
|
11
|
+
child: JSX.Element;
|
|
12
|
+
}[];
|
|
13
|
+
export declare const parseListItem: (deleteFile: (file: FileWithPath) => void, fileToBeParsed: MappedFile, maxSize: number) => {
|
|
14
|
+
child: JSX.Element;
|
|
15
|
+
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FileWithPath } from 'react-dropzone';
|
|
2
|
+
export interface FileUploadError {
|
|
3
|
+
code: string;
|
|
4
|
+
message: string;
|
|
5
|
+
}
|
|
3
6
|
export interface MappedFile {
|
|
4
7
|
errors: Array<FileUploadError>;
|
|
5
8
|
file: FileWithPath;
|
|
6
9
|
}
|
|
7
|
-
export interface
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
export interface DropzoneContentArgs {
|
|
11
|
+
buttonOnly: boolean;
|
|
12
|
+
isDragActive: boolean;
|
|
13
|
+
isUploadDisabled: boolean;
|
|
14
|
+
open: () => void;
|
|
10
15
|
}
|
|
11
|
-
export declare const parseListItem: (deleteFile: (file: FileWithPath) => void, fileToBeParsed: MappedFile, maxSize: number) => {
|
|
12
|
-
child: JSX.Element;
|
|
13
|
-
};
|
|
@@ -32,6 +32,7 @@ export type { DraggableItem, DraggableListChangeHandler, } from './draggable-lis
|
|
|
32
32
|
export type { SnackbarProps, SnackbarSeverity, SnackbarOrigin, } from './snackbar';
|
|
33
33
|
export type { CharactersLimit, InlineEditProps } from './inline-edit';
|
|
34
34
|
export type { progressColorOptions, progressVariantOptions, ProgressProps, } from './progress';
|
|
35
|
+
export type { FileUploadProps } from './file-upload';
|
|
35
36
|
export { DotAccordion } from './accordion/Accordion';
|
|
36
37
|
export { DotActionToolbar } from './action-toolbar/ActionToolbar';
|
|
37
38
|
export { DotAlertBanner } from './alert-banner/AlertBanner';
|
|
@@ -84,7 +85,7 @@ export { DotHeaderRow, DotTable, DotTablePagination } from './table';
|
|
|
84
85
|
export { DotTooltip } from './tooltip/Tooltip';
|
|
85
86
|
export { DotTabs } from './tabs/Tabs';
|
|
86
87
|
export { DotTypography } from './typography/Typography';
|
|
87
|
-
export { DotFileUpload } from './file-upload
|
|
88
|
+
export { DotFileUpload } from './file-upload';
|
|
88
89
|
export { DotDivider } from './divider';
|
|
89
90
|
export { DotPopper } from './popper';
|
|
90
91
|
export { DotTruncateWithTooltip } from './truncate-with-tooltip';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
3
|
import { TypographyVariant } from '../typography/Typography';
|
|
4
|
-
import { CharactersLimit } from './utils/models';
|
|
4
|
+
import { CharactersLimit, InlineEditBinding } from './utils/models';
|
|
5
5
|
export interface InlineEditProps extends CommonProps {
|
|
6
|
+
/** Optional array of bindings, used to replace targeted string in edit mode with the corresponding value in view mode */
|
|
7
|
+
bindings?: InlineEditBinding[];
|
|
6
8
|
/** Characters limit configuration object */
|
|
7
9
|
charactersLimit?: CharactersLimit;
|
|
8
10
|
/** If true, the input will take up the full width of its container */
|
|
@@ -12,7 +14,7 @@ export interface InlineEditProps extends CommonProps {
|
|
|
12
14
|
/** The name of input element */
|
|
13
15
|
name: string;
|
|
14
16
|
/** An async function which should be executed when the value of the input changes */
|
|
15
|
-
onChange
|
|
17
|
+
onChange?: (value: string) => Promise<boolean>;
|
|
16
18
|
/** A function that informs the parent of current editing state */
|
|
17
19
|
onEditStateChange?: (editing: boolean) => void;
|
|
18
20
|
/** If true, component will behave like a regular text (editing functionality will be disabled). */
|
|
@@ -25,4 +27,4 @@ export interface InlineEditProps extends CommonProps {
|
|
|
25
27
|
/**
|
|
26
28
|
* @experimental This component is still in development
|
|
27
29
|
*/
|
|
28
|
-
export declare const DotInlineEdit: ({ ariaLabel, charactersLimit, className, "data-testid": dataTestId, fullWidth, hideActionButtons, name, onChange, onEditStateChange, readOnly, typography, value, }: InlineEditProps) => JSX.Element;
|
|
30
|
+
export declare const DotInlineEdit: ({ ariaLabel, bindings, charactersLimit, className, "data-testid": dataTestId, fullWidth, hideActionButtons, name, onChange, onEditStateChange, readOnly, typography, value, }: InlineEditProps) => JSX.Element;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { InlineEditBinding } from './models';
|
|
2
3
|
export declare const getCounterAdornment: (currentLength: number, maxLength: number, dataTestId?: string) => ReactNode | undefined;
|
|
3
4
|
export declare const getWarningAdornment: () => JSX.Element;
|
|
5
|
+
export declare const applyBindings: (bindings: InlineEditBinding[], inlineEditText: string) => ReactNode;
|
|
@@ -3,3 +3,11 @@ export interface CharactersLimit {
|
|
|
3
3
|
hideCounter?: boolean;
|
|
4
4
|
maxLength: number;
|
|
5
5
|
}
|
|
6
|
+
export interface InlineEditBinding {
|
|
7
|
+
/** String, written in edit mode, which will be bound to the actual value in view mode */
|
|
8
|
+
binding: string;
|
|
9
|
+
/** Optional prop used to define custom CSS for the value when in view mode */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Value which will be displayed in view mode */
|
|
12
|
+
value: string;
|
|
13
|
+
}
|