@bbl-digital/snorre 2.2.36 → 2.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -25372,9 +25372,10 @@
25372
25372
  label,
25373
25373
  invalidMessage,
25374
25374
  text = 'Last opp fil',
25375
+ initialFiles = [],
25375
25376
  onChange
25376
25377
  }) => {
25377
- const [files, setFiles] = React.useState([]);
25378
+ const [files, setFiles] = React.useState(initialFiles);
25378
25379
  const theme = react.useTheme();
25379
25380
  const hiddenFileInput = React.useRef(null);
25380
25381
 
@@ -25423,7 +25424,7 @@
25423
25424
  }), /*#__PURE__*/jsxRuntime.jsxs(FileWrapper, {
25424
25425
  children: [files.length > 0 && /*#__PURE__*/jsxRuntime.jsx(DocumentList, {
25425
25426
  children: files.map((item, index) => /*#__PURE__*/jsxRuntime.jsxs(DocumentWrapper, {
25426
- children: [/*#__PURE__*/jsxRuntime.jsx(Document, {
25427
+ children: ["+", /*#__PURE__*/jsxRuntime.jsx(Document, {
25427
25428
  theme: theme,
25428
25429
  title: item.name,
25429
25430
  children: /*#__PURE__*/jsxRuntime.jsx(Text, {
@@ -12,9 +12,10 @@ const FileInput = ({
12
12
  label,
13
13
  invalidMessage,
14
14
  text = 'Last opp fil',
15
+ initialFiles = [],
15
16
  onChange
16
17
  }) => {
17
- const [files, setFiles] = useState([]);
18
+ const [files, setFiles] = useState(initialFiles);
18
19
  const theme = useTheme();
19
20
  const hiddenFileInput = useRef(null);
20
21
 
@@ -63,7 +64,7 @@ const FileInput = ({
63
64
  }), /*#__PURE__*/_jsxs(FileWrapper, {
64
65
  children: [files.length > 0 && /*#__PURE__*/_jsx(DocumentList, {
65
66
  children: files.map((item, index) => /*#__PURE__*/_jsxs(DocumentWrapper, {
66
- children: [/*#__PURE__*/_jsx(Document, {
67
+ children: ["+", /*#__PURE__*/_jsx(Document, {
67
68
  theme: theme,
68
69
  title: item.name,
69
70
  children: /*#__PURE__*/_jsx(Text, {
@@ -10,6 +10,8 @@ interface IProps {
10
10
  invalidMessage?: string;
11
11
  /** Custom button text */
12
12
  text?: string;
13
+ /** Initial files */
14
+ initialFiles?: any[];
13
15
  /** Event CB on change, returns object if not multiple is set */
14
16
  onChange: (files: any) => void;
15
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/FileInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAA;AAmB/C,UAAU,MAAM;IACd,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,iEAAiE;IACjE,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;CAC/B;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAgG/B,CAAA;AAED,eAAe,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/FileInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAA;AAmB/C,UAAU,MAAM;IACd,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oBAAoB;IACpB,YAAY,CAAC,EAAE,GAAG,EAAE,CAAA;IACpB,iEAAiE;IACjE,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;CAC/B;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAkG/B,CAAA;AAED,eAAe,SAAS,CAAA"}
@@ -12,9 +12,10 @@ const FileInput = ({
12
12
  label,
13
13
  invalidMessage,
14
14
  text = 'Last opp fil',
15
+ initialFiles = [],
15
16
  onChange
16
17
  }) => {
17
- const [files, setFiles] = useState([]);
18
+ const [files, setFiles] = useState(initialFiles);
18
19
  const theme = useTheme();
19
20
  const hiddenFileInput = useRef(null);
20
21
 
@@ -63,7 +64,7 @@ const FileInput = ({
63
64
  }), /*#__PURE__*/_jsxs(FileWrapper, {
64
65
  children: [files.length > 0 && /*#__PURE__*/_jsx(DocumentList, {
65
66
  children: files.map((item, index) => /*#__PURE__*/_jsxs(DocumentWrapper, {
66
- children: [/*#__PURE__*/_jsx(Document, {
67
+ children: ["+", /*#__PURE__*/_jsx(Document, {
67
68
  theme: theme,
68
69
  title: item.name,
69
70
  children: /*#__PURE__*/_jsx(Text, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbl-digital/snorre",
3
- "version": "2.2.36",
3
+ "version": "2.2.37",
4
4
  "description": "Design library for BBL Digital",
5
5
  "license": "MIT",
6
6
  "main": "./lib/index.js",