@carbonorm/carbonreact 2.0.1 → 2.0.2

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/index.esm.js CHANGED
@@ -2779,13 +2779,13 @@ var initialRequiredCarbonORMState = {
2779
2779
  websocketData: [],
2780
2780
  websocketEvents: [],
2781
2781
  };
2782
- var initialCarbonORMState = __assign(__assign({}, initialRequiredCarbonORMState), initialRestfulObjectsState);
2782
+ var initialCarbonReactState = __assign(__assign({}, initialRequiredCarbonORMState), initialRestfulObjectsState);
2783
2783
  var CarbonReact = /** @class */ (function (_super) {
2784
2784
  __extends(CarbonReact, _super);
2785
2785
  function CarbonReact(props) {
2786
2786
  var _this = _super.call(this, props) || this;
2787
2787
  _this.websocketTimeout = 5000;
2788
- _this.state = initialCarbonORMState;
2788
+ _this.state = initialCarbonReactState;
2789
2789
  CarbonReact.instance = _this;
2790
2790
  // This should only ever be done here, when the full state is being trashed.
2791
2791
  clearCache({
@@ -3524,10 +3524,16 @@ function uploadImage(uploadCallback) {
3524
3524
  return function () {
3525
3525
  var input = document.createElement('input');
3526
3526
  input.type = 'file';
3527
- input.accept = 'image/*';
3528
- input.onchange = function (e) {
3527
+ input.accept = 'image/*, .heic';
3528
+ input.style.display = 'none';
3529
+ // the element must be appended to the document to work on safari
3530
+ // @link https://stackoverflow.com/questions/47664777/javascript-file-input-onchange-not-working-ios-safari-only
3531
+ document.body.appendChild(input);
3532
+ // safari also requires addEventListener rather than .onChange
3533
+ input.addEventListener('change', function (e) {
3534
+ console.log('upload image event', e);
3529
3535
  uploadImageChange(e, uploadCallback);
3530
- };
3536
+ });
3531
3537
  input.click();
3532
3538
  };
3533
3539
  }
@@ -3551,5 +3557,5 @@ function useWindowDimensions() {
3551
3557
  return windowDimensions;
3552
3558
  }
3553
3559
 
3554
- export { AccessDenied, Alert, BackendThrowable, C6, COLUMNS, CarbonReact, ErrorHttpCode, GlobalHistory, HandleResponseCodes, Loading, Nest, PageNotFound, Popup, TABLES, addAlert, addValidSQL$1 as addValidSQL, axiosInstance, carbons, changed, comments, deleteRestfulObjectArrays, documentation, eUpdateInsertMethod, feature_group_references, features, getRootStyleValue, getStyles, globalNavigate, group_references, groups, hexToRgb, history_logs, initialCarbonORMState, initialRequiredCarbonORMState, initialRestfulObjectsState, isEdgeBrowser, isProduction, location_references, locations, parseMultipleJson, photos, range, reports, ScrollIntoViewDirective as scrollIntoView, setCookies, setUrl, toDataURL, updateRestfulObjectArray as updateRestfulObjectArrays, uploadImage, uploadImageChange, user_followers, user_groups, user_messages, user_sessions, user_tasks, users, useWindowDimensions as windowDimensions };
3560
+ export { AccessDenied, Alert, BackendThrowable, C6, COLUMNS, CarbonReact, ErrorHttpCode, GlobalHistory, HandleResponseCodes, Loading, Nest, PageNotFound, Popup, TABLES, addAlert, addValidSQL$1 as addValidSQL, axiosInstance, carbons, changed, comments, deleteRestfulObjectArrays, documentation, eUpdateInsertMethod, feature_group_references, features, getRootStyleValue, getStyles, globalNavigate, group_references, groups, hexToRgb, history_logs, initialCarbonReactState, initialRequiredCarbonORMState, initialRestfulObjectsState, isEdgeBrowser, isProduction, location_references, locations, parseMultipleJson, photos, range, reports, ScrollIntoViewDirective as scrollIntoView, setCookies, setUrl, toDataURL, updateRestfulObjectArray as updateRestfulObjectArrays, uploadImage, uploadImageChange, user_followers, user_groups, user_messages, user_sessions, user_tasks, users, useWindowDimensions as windowDimensions };
3555
3561
  //# sourceMappingURL=index.esm.js.map