@oneblink/apps-react 2.0.0-beta.1 → 2.0.0-beta.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/dist/components/Lists.d.ts +1 -1
- package/dist/components/pickers/V4CompatibleDatePicker.d.ts +9 -7
- package/dist/components/pickers/V4CompatibleDatePicker.js +23 -10
- package/dist/components/pickers/V4CompatibleDatePicker.js.map +1 -1
- package/dist/components/pickers/V4CompatibleDateTimePicker.d.ts +10 -7
- package/dist/components/pickers/V4CompatibleDateTimePicker.js +23 -10
- package/dist/components/pickers/V4CompatibleDateTimePicker.js.map +1 -1
- package/dist/components/pickers/V4CompatibleTimePicker.d.ts +9 -7
- package/dist/components/pickers/V4CompatibleTimePicker.js +23 -10
- package/dist/components/pickers/V4CompatibleTimePicker.js.map +1 -1
- package/dist/components/renderer/AnnotationModal.js +1 -3
- package/dist/components/renderer/AnnotationModal.js.map +1 -1
- package/dist/form-elements/FormElementABN.js +3 -1
- package/dist/form-elements/FormElementABN.js.map +1 -1
- package/dist/form-elements/FormElementBSB.js +3 -1
- package/dist/form-elements/FormElementBSB.js.map +1 -1
- package/dist/form-elements/FormElementFiles.js +27 -7
- package/dist/form-elements/FormElementFiles.js.map +1 -1
- package/dist/form-elements/FormElementSignature.js +2 -2
- package/dist/form-elements/FormElementSignature.js.map +1 -1
- package/dist/hooks/useContrastColor.d.ts +1 -1
- package/dist/hooks/useInfiniteScrollDataLoad.d.ts +1 -1
- package/dist/hooks/useLookups.d.ts +1 -1
- package/dist/services/blob-utils.js +0 -1
- package/dist/services/blob-utils.js.map +1 -1
- package/dist/services/generate-default-data.js +6 -4
- package/dist/services/generate-default-data.js.map +1 -1
- package/package.json +34 -35
- package/dist/components/renderer/attachments/Files.d.ts +0 -14
- package/dist/components/renderer/attachments/Files.js +0 -27
- package/dist/components/renderer/attachments/Files.js.map +0 -1
package/package.json
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
{
|
2
2
|
"name": "@oneblink/apps-react",
|
3
3
|
"description": "Helper functions for OneBlink apps in ReactJS.",
|
4
|
-
"version": "2.0.0-beta.
|
4
|
+
"version": "2.0.0-beta.4",
|
5
5
|
"author": "OneBlink <developers@oneblink.io> (https://oneblink.io)",
|
6
6
|
"bugs": {
|
7
7
|
"url": "https://github.com/oneblink/apps-react/issues"
|
8
8
|
},
|
9
9
|
"dependencies": {
|
10
10
|
"@blinkmobile/geolocation": "^2.0.3",
|
11
|
-
"@emotion/react": "^11.
|
12
|
-
"@emotion/styled": "^11.
|
13
|
-
"@mui/icons-material": "^5.
|
14
|
-
"@oneblink/sdk-core": "^0.4.2
|
15
|
-
"@react-google-maps/api": "2.
|
11
|
+
"@emotion/react": "^11.10.0",
|
12
|
+
"@emotion/styled": "^11.10.0",
|
13
|
+
"@mui/icons-material": "^5.8.4",
|
14
|
+
"@oneblink/sdk-core": "^0.4.2",
|
15
|
+
"@react-google-maps/api": "2.12.1",
|
16
16
|
"blueimp-load-image": "^5.16.0",
|
17
17
|
"bulma": "^0.9.3",
|
18
18
|
"bulma-slider": "2.0.4",
|
19
19
|
"bulma-steps": "^2.2.1",
|
20
20
|
"bulma-toast": "^2.4.1",
|
21
|
-
"clsx": "^1.
|
22
|
-
"color": "^
|
23
|
-
"copy-to-clipboard": "^3.3.
|
24
|
-
"date-fns": "^2.
|
21
|
+
"clsx": "^1.2.1",
|
22
|
+
"color": "^4.2.3",
|
23
|
+
"copy-to-clipboard": "^3.3.2",
|
24
|
+
"date-fns": "^2.29.2",
|
25
25
|
"escape-string-regexp": "^5.0.0",
|
26
26
|
"file-saver": "^2.0.5",
|
27
|
-
"flatpickr": "^4.6.
|
27
|
+
"flatpickr": "^4.6.13",
|
28
28
|
"jsqr": "^1.4.0",
|
29
29
|
"lodash.clonedeep": "^4.5.0",
|
30
30
|
"lodash.debounce": "^4.0.8",
|
@@ -34,57 +34,56 @@
|
|
34
34
|
"query-string": "^7.1.1",
|
35
35
|
"react-google-recaptcha": "^2.1.0",
|
36
36
|
"react-input-mask": "^2.0.4",
|
37
|
-
"react-signature-canvas": "^1.0.
|
38
|
-
"react-table": "^7.
|
39
|
-
"sanitize-html": "^2.7.
|
40
|
-
"signature_pad": "^3.0.0-beta.4",
|
37
|
+
"react-signature-canvas": "^1.0.6",
|
38
|
+
"react-table": "^7.8.0",
|
39
|
+
"sanitize-html": "^2.7.1",
|
41
40
|
"uuid": "^8.3.2",
|
42
41
|
"validate.js": "^0.13.1",
|
43
42
|
"xml2js": "^0.4.23"
|
44
43
|
},
|
45
44
|
"devDependencies": {
|
46
|
-
"@babel/preset-env": "^7.
|
47
|
-
"@mui/lab": "^5.0.0-alpha.
|
48
|
-
"@mui/material": "^5.
|
49
|
-
"@mui/x-date-pickers": "^5.0.0-
|
45
|
+
"@babel/preset-env": "^7.18.10",
|
46
|
+
"@mui/lab": "^5.0.0-alpha.95",
|
47
|
+
"@mui/material": "^5.10.1",
|
48
|
+
"@mui/x-date-pickers": "^5.0.0-beta.6",
|
50
49
|
"@oneblink/apps": "^2.0.0-beta.1",
|
51
50
|
"@oneblink/release-cli": "^1.0.0",
|
52
51
|
"@oneblink/types": "github:oneblink/types",
|
53
|
-
"@types/blueimp-load-image": "^5.
|
52
|
+
"@types/blueimp-load-image": "^5.16.0",
|
54
53
|
"@types/color": "^3.0.3",
|
55
54
|
"@types/file-saver": "^2.0.5",
|
56
55
|
"@types/filesystem": "^0.0.32",
|
57
56
|
"@types/jest": "^27.4.1",
|
58
|
-
"@types/lodash.clonedeep": "^4.5.
|
59
|
-
"@types/lodash.debounce": "^4.0.
|
60
|
-
"@types/lodash.throttle": "^4.1.
|
57
|
+
"@types/lodash.clonedeep": "^4.5.7",
|
58
|
+
"@types/lodash.debounce": "^4.0.7",
|
59
|
+
"@types/lodash.throttle": "^4.1.7",
|
61
60
|
"@types/react": "^17.0.43",
|
62
61
|
"@types/react-google-recaptcha": "^2.1.5",
|
63
|
-
"@types/react-input-mask": "^
|
62
|
+
"@types/react-input-mask": "^3.0.1",
|
64
63
|
"@types/react-router-dom": "^5.3.3",
|
65
64
|
"@types/react-signature-canvas": "^1.0.2",
|
66
|
-
"@types/react-table": "^7.7.
|
65
|
+
"@types/react-table": "^7.7.12",
|
67
66
|
"@types/sanitize-html": "^2.6.2",
|
68
67
|
"@types/uuid": "^8.3.4",
|
69
|
-
"@types/xml2js": "^0.4.
|
70
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
71
|
-
"@typescript-eslint/parser": "^5.
|
68
|
+
"@types/xml2js": "^0.4.11",
|
69
|
+
"@typescript-eslint/eslint-plugin": "^5.33.1",
|
70
|
+
"@typescript-eslint/parser": "^5.33.1",
|
72
71
|
"copyfiles": "^2.4.1",
|
73
|
-
"eslint": "^8.
|
72
|
+
"eslint": "^8.22.0",
|
74
73
|
"eslint-config-prettier": "^8.5.0",
|
75
|
-
"eslint-plugin-prettier": "^4.
|
76
|
-
"eslint-plugin-react": "^7.
|
77
|
-
"eslint-plugin-react-hooks": "^4.
|
74
|
+
"eslint-plugin-prettier": "^4.2.1",
|
75
|
+
"eslint-plugin-react": "^7.30.1",
|
76
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
78
77
|
"fixpack": "^4.0.0",
|
79
78
|
"jest": "^27.5.1",
|
80
|
-
"prettier": "^2.
|
79
|
+
"prettier": "^2.7.1",
|
81
80
|
"react": "^17.0.2",
|
82
81
|
"react-dom": "^17.0.2",
|
83
82
|
"react-router-dom": "^5.3.0",
|
84
83
|
"sass": "^1.50.0",
|
85
84
|
"ts-jest": "^27.1.4",
|
86
85
|
"tsc-watch": "^5.0.3",
|
87
|
-
"typescript": "^4.
|
86
|
+
"typescript": "^4.7.4"
|
88
87
|
},
|
89
88
|
"engines": {
|
90
89
|
"node": ">=16",
|
@@ -100,7 +99,7 @@
|
|
100
99
|
"peerDependencies": {
|
101
100
|
"@mui/lab": "^5.0.0 || ^5.0.0-alpha.79",
|
102
101
|
"@mui/material": "^5.6.1",
|
103
|
-
"@mui/x-date-pickers": "^5.0.0 || ^5.0.0-alpha.
|
102
|
+
"@mui/x-date-pickers": "^5.0.0 || ^5.0.0-alpha.6",
|
104
103
|
"@oneblink/apps": "*",
|
105
104
|
"react": "^17.0.0",
|
106
105
|
"react-dom": "^17.0.0",
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { FormTypes } from '@oneblink/types';
|
3
|
-
declare function Files<T>({ id, element, isDirty, attachments, validationMessage, displayValidationMessage, onAddFiles, onRenderAttachment, }: {
|
4
|
-
id: string;
|
5
|
-
element: FormTypes.FilesElement;
|
6
|
-
isDirty: boolean;
|
7
|
-
attachments: T[];
|
8
|
-
displayValidationMessage: boolean;
|
9
|
-
validationMessage: string | undefined;
|
10
|
-
onAddFiles: (files: File[]) => void;
|
11
|
-
onRenderAttachment: (attachment: T, index: number) => React.ReactNode;
|
12
|
-
}): JSX.Element;
|
13
|
-
declare const _default: React.MemoExoticComponent<typeof Files>;
|
14
|
-
export default _default;
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import FormElementLabelContainer from '../FormElementLabelContainer';
|
3
|
-
function Files({ id, element, isDirty, attachments, validationMessage, displayValidationMessage, onAddFiles, onRenderAttachment, }) {
|
4
|
-
const inputRef = React.useRef(null);
|
5
|
-
const handleAdd = React.useCallback(() => {
|
6
|
-
if (!inputRef.current)
|
7
|
-
return;
|
8
|
-
// RESET HTML FILE INPUT VALUE SO FILES PREVIOUSLY ADDED AND REMOVED ARE RECOGNISED
|
9
|
-
inputRef.current.value = '';
|
10
|
-
inputRef.current.click();
|
11
|
-
}, []);
|
12
|
-
return (React.createElement("div", { className: "cypress-files-element" },
|
13
|
-
React.createElement(FormElementLabelContainer, { className: "ob-files", element: element, id: id, required: !!element.minEntries },
|
14
|
-
React.createElement("input", { ref: inputRef, type: "file", name: element.name, id: id, className: "file-input ob-input", multiple: element.maxEntries !== 1, disabled: element.readOnly, onChange: (event) => onAddFiles(event.target.files ? Array.from(event.target.files) : []) }),
|
15
|
-
React.createElement("div", { className: "control cypress-files-control" },
|
16
|
-
React.createElement("div", { className: "columns is-multiline" },
|
17
|
-
attachments.map(onRenderAttachment),
|
18
|
-
!element.readOnly &&
|
19
|
-
(!element.maxEntries ||
|
20
|
-
attachments.length < element.maxEntries) && (React.createElement("div", { className: "column is-one-quarter" },
|
21
|
-
React.createElement("button", { type: "button", className: "button ob-files__add-new-button", onClick: handleAdd },
|
22
|
-
React.createElement("i", { className: "material-icons icon-x-large" }, "add")))))),
|
23
|
-
(isDirty || displayValidationMessage) && !!validationMessage && (React.createElement("div", { role: "alert", className: "has-margin-top-8" },
|
24
|
-
React.createElement("div", { className: "has-text-danger ob-error__text cypress-validation-message" }, validationMessage))))));
|
25
|
-
}
|
26
|
-
export default React.memo(Files);
|
27
|
-
//# sourceMappingURL=Files.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Files.js","sourceRoot":"","sources":["../../../../src/components/renderer/attachments/Files.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,yBAAyB,MAAM,8BAA8B,CAAA;AAEpE,SAAS,KAAK,CAAI,EAChB,EAAE,EACF,OAAO,EACP,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,wBAAwB,EACxB,UAAU,EACV,kBAAkB,GAUnB;IACC,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAmB,IAAI,CAAC,CAAA;IAErD,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACvC,IAAI,CAAC,QAAQ,CAAC,OAAO;YAAE,OAAM;QAC7B,mFAAmF;QACnF,QAAQ,CAAC,OAAO,CAAC,KAAK,GAAG,EAAE,CAAA;QAC3B,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,CAAA;IAC1B,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,CACL,6BAAK,SAAS,EAAC,uBAAuB;Q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CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA","sourcesContent":["import * as React from 'react'\n\nimport { FormTypes } from '@oneblink/types'\nimport FormElementLabelContainer from '../FormElementLabelContainer'\n\nfunction Files<T>({\n id,\n element,\n isDirty,\n attachments,\n validationMessage,\n displayValidationMessage,\n onAddFiles,\n onRenderAttachment,\n}: {\n id: string\n element: FormTypes.FilesElement\n isDirty: boolean\n attachments: T[]\n displayValidationMessage: boolean\n validationMessage: string | undefined\n onAddFiles: (files: File[]) => void\n onRenderAttachment: (attachment: T, index: number) => React.ReactNode\n}) {\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n const handleAdd = React.useCallback(() => {\n if (!inputRef.current) return\n // RESET HTML FILE INPUT VALUE SO FILES PREVIOUSLY ADDED AND REMOVED ARE RECOGNISED\n inputRef.current.value = ''\n inputRef.current.click()\n }, [])\n\n return (\n <div className=\"cypress-files-element\">\n <FormElementLabelContainer\n className=\"ob-files\"\n element={element}\n id={id}\n required={!!element.minEntries}\n >\n <input\n ref={inputRef}\n type=\"file\"\n name={element.name}\n id={id}\n className=\"file-input ob-input\"\n multiple={element.maxEntries !== 1}\n disabled={element.readOnly}\n onChange={(event) =>\n onAddFiles(event.target.files ? Array.from(event.target.files) : [])\n }\n />\n <div className=\"control cypress-files-control\">\n <div className=\"columns is-multiline\">\n {attachments.map(onRenderAttachment)}\n {!element.readOnly &&\n (!element.maxEntries ||\n attachments.length < element.maxEntries) && (\n <div className=\"column is-one-quarter\">\n <button\n type=\"button\"\n className=\"button ob-files__add-new-button\"\n onClick={handleAdd}\n >\n <i className=\"material-icons icon-x-large\">add</i>\n </button>\n </div>\n )}\n </div>\n </div>\n\n {(isDirty || displayValidationMessage) && !!validationMessage && (\n <div role=\"alert\" className=\"has-margin-top-8\">\n <div className=\"has-text-danger ob-error__text cypress-validation-message\">\n {validationMessage}\n </div>\n </div>\n )}\n </FormElementLabelContainer>\n </div>\n )\n}\n\nexport default React.memo(Files)\n"]}
|