@corva/ui 0.57.0-3 → 0.57.0-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.
@@ -1 +1 @@
1
- "use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),a=require("react"),s=require("prop-types"),l=require("lodash"),r=require("@material-ui/core"),i=require("./AssetEditors.css.js"),u=require("./SingleAssetEditor.js"),n=require("./AssetEditorAutocomplete.js"),d=require("react/jsx-runtime");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=o(e),p=o(t),y=o(s),f="DC_AppSettingsAssetEditor",A=function(e){var t=e.appKey,s=e.appType,o=e.defaultValue,y=e.isNullable,A=e.label,b=e.onSettingsChange,g=e.settings,m=l.get(s,["primaryAsset","assetType","type"]),h=l.get(s,["primaryAsset","assetType","id"]),j=l.get(s,["primaryAsset","autocompleteSelect"]),C=l.get(s,["secondaryAsset","assetType","type"]),T=l.get(s,["secondaryAsset","assetType","id"]),q=l.get(s,["secondaryAsset","autocompleteSelect"]),v=l.get(g,h),x=a.useState(v||o),N=p.default(x,2),V=N[0],S=N[1],K=a.useState(l.get(g,T)),_=p.default(K,2),E=_[0],B=_[1],z=a.useState(!(!C||E)),R=p.default(z,2),k=R[0],D=R[1],I=a.useState(!(!C||!E)),P=p.default(I,2),U=P[0],W=P[1],w=function(e){B(e),b(c.default({},T,e))},F=function(e){S(e),B(null),W(!1),D(!!C);var t=c.default({},h,e);T&&(t[T]=null),b(t)};return d.jsxs("div",{className:i.main,children:[d.jsx("div",{className:i.title,children:"Active Asset"}),d.jsxs("div",{className:i.editor,children:[j?d.jsx(n,{appKey:t,assetType:m,currentValue:V,"data-testid":"".concat(f,"_primaryAssetEditorAutocomplete"),defaultValue:o,disableClearable:!1,isNullable:y,label:A,onChange:F}):d.jsx(u,{appKey:t,assetType:m,currentValue:V,"data-testid":"".concat(f,"_primaryAutoComplete"),defaultValue:o,isNullable:y,label:A,onChange:F}),k&&d.jsx(r.Button,{"data-testid":"".concat(f,"_changeWellButton"),color:"primary",onClick:function(){W(!0),D(!1)},disabled:!v,children:"Change ".concat(l.capitalize(C))}),!k&&U&&d.jsx(r.Button,{"data-testid":"".concat(f,"_useDefaultButton"),color:"secondary",onClick:function(){B(null),W(!1),D(!!C),b(c.default({},T,null))},children:"Use active asset"})]}),U&&d.jsx("div",{className:i.editor,children:q?d.jsx(n,{appKey:t,assetType:C,currentValue:E,"data-testid":"".concat(f,"_secondaryAssetEditorAutocomplete"),defaultValue:o,disableClearable:!1,isNullable:y,label:"Active ".concat(l.capitalize(C)),onChange:w,parentAssetId:V,parentAssetType:m}):d.jsx(u,{"data-testid":"".concat(f,"_secondaryAutoComplete"),onChange:w,defaultValue:o,currentValue:E,isNullable:y,label:"Active ".concat(l.capitalize(C)),assetType:C,parentAssetId:V,parentAssetType:m,appKey:t})})]})};A.defaultProps={label:"Choose An Asset",isNullable:!1,defaultValue:void 0,appKey:null},A.propTypes={settings:y.default.shape({}).isRequired,appType:y.default.shape({}).isRequired,defaultValue:y.default.any,onSettingsChange:y.default.func.isRequired,label:y.default.string,isNullable:y.default.bool,appKey:y.default.string},module.exports=A;
1
+ "use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),a=require("react"),s=require("prop-types"),l=require("lodash"),r=require("@material-ui/core"),i=require("./AssetEditors.css.js"),u=require("./SingleAssetEditor.js"),n=require("./AssetEditorAutocomplete.js"),d=require("react/jsx-runtime");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=o(e),p=o(t),y=o(s),f="DC_AppSettingsAssetEditor",A=function(e){var t=e.appKey,s=e.appType,o=e.defaultValue,y=e.isNullable,A=e.label,b=e.onSettingsChange,g=e.settings,m=l.get(s,["primaryAsset","assetType","type"]),h=l.get(s,["primaryAsset","assetType","id"]),j=l.get(s,["primaryAsset","autocompleteSelect"]),C=l.get(s,["secondaryAsset","assetType","type"]),T=l.get(s,["secondaryAsset","assetType","id"]),q=l.get(s,["secondaryAsset","autocompleteSelect"]),v=l.get(g,h),x=a.useState(v||o),N=p.default(x,2),V=N[0],S=N[1],K=a.useState(l.get(g,T)),_=p.default(K,2),E=_[0],B=_[1],z=a.useState(!(!C||E)),R=p.default(z,2),k=R[0],D=R[1],I=a.useState(!(!C||!E)),P=p.default(I,2),U=P[0],W=P[1],w=function(e){B(e),b(c.default({},T,e))},F=function(e){S(e),B(null),W(!1),D(!!C);var t=c.default({},h,e);T&&(t[T]=null),b(t)};return d.jsxs("div",{className:i.main,children:[d.jsx("div",{className:i.title,children:"Active Asset"}),d.jsxs("div",{className:i.editor,children:[j?d.jsx(n,{appKey:t,assetType:m,currentValue:V,"data-testid":"".concat(f,"_primaryAssetEditorAutocomplete"),defaultValue:o,disableClearable:!y,isNullable:y,label:A,onChange:F}):d.jsx(u,{appKey:t,assetType:m,currentValue:V,"data-testid":"".concat(f,"_primaryAutoComplete"),defaultValue:o,isNullable:y,label:A,onChange:F}),k&&d.jsx(r.Button,{"data-testid":"".concat(f,"_changeWellButton"),color:"primary",onClick:function(){W(!0),D(!1)},disabled:!v,children:"Change ".concat(l.capitalize(C))}),!k&&U&&d.jsx(r.Button,{"data-testid":"".concat(f,"_useDefaultButton"),color:"secondary",onClick:function(){B(null),W(!1),D(!!C),b(c.default({},T,null))},children:"Use active asset"})]}),U&&d.jsx("div",{className:i.editor,children:q?d.jsx(n,{appKey:t,assetType:C,currentValue:E,"data-testid":"".concat(f,"_secondaryAssetEditorAutocomplete"),defaultValue:o,disableClearable:!1,isNullable:y,label:"Active ".concat(l.capitalize(C)),onChange:w,parentAssetId:V,parentAssetType:m}):d.jsx(u,{"data-testid":"".concat(f,"_secondaryAutoComplete"),onChange:w,defaultValue:o,currentValue:E,isNullable:y,label:"Active ".concat(l.capitalize(C)),assetType:C,parentAssetId:V,parentAssetType:m,appKey:t})})]})};A.defaultProps={label:"Choose An Asset",isNullable:!1,defaultValue:void 0,appKey:null},A.propTypes={settings:y.default.shape({}).isRequired,appType:y.default.shape({}).isRequired,defaultValue:y.default.any,onSettingsChange:y.default.func.isRequired,label:y.default.string,isNullable:y.default.bool,appKey:y.default.string},module.exports=A;
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{useState as a}from"react";import s from"prop-types";import{get as l,capitalize as r}from"lodash";import{Button as o}from"@material-ui/core";import i from"./AssetEditors.css.js";import n from"./SingleAssetEditor.js";import p from"./AssetEditorAutocomplete.js";import{jsxs as c,jsx as u}from"react/jsx-runtime";var d="DC_AppSettingsAssetEditor",m=function(s){var m=s.appKey,y=s.appType,A=s.defaultValue,f=s.isNullable,b=s.label,h=s.onSettingsChange,g=s.settings,C=l(y,["primaryAsset","assetType","type"]),T=l(y,["primaryAsset","assetType","id"]),v=l(y,["primaryAsset","autocompleteSelect"]),N=l(y,["secondaryAsset","assetType","type"]),V=l(y,["secondaryAsset","assetType","id"]),K=l(y,["secondaryAsset","autocompleteSelect"]),_=l(g,T),E=a(_||A),S=t(E,2),j=S[0],q=S[1],R=a(l(g,V)),k=t(R,2),x=k[0],B=k[1],D=a(!(!N||x)),I=t(D,2),P=I[0],U=I[1],W=a(!(!N||!x)),w=t(W,2),z=w[0],F=w[1],G=function(t){B(t),h(e({},V,t))},H=function(t){q(t),B(null),F(!1),U(!!N);var a=e({},T,t);V&&(a[V]=null),h(a)};return c("div",{className:i.main,children:[u("div",{className:i.title,children:"Active Asset"}),c("div",{className:i.editor,children:[v?u(p,{appKey:m,assetType:C,currentValue:j,"data-testid":"".concat(d,"_primaryAssetEditorAutocomplete"),defaultValue:A,disableClearable:!1,isNullable:f,label:b,onChange:H}):u(n,{appKey:m,assetType:C,currentValue:j,"data-testid":"".concat(d,"_primaryAutoComplete"),defaultValue:A,isNullable:f,label:b,onChange:H}),P&&u(o,{"data-testid":"".concat(d,"_changeWellButton"),color:"primary",onClick:function(){F(!0),U(!1)},disabled:!_,children:"Change ".concat(r(N))}),!P&&z&&u(o,{"data-testid":"".concat(d,"_useDefaultButton"),color:"secondary",onClick:function(){B(null),F(!1),U(!!N),h(e({},V,null))},children:"Use active asset"})]}),z&&u("div",{className:i.editor,children:K?u(p,{appKey:m,assetType:N,currentValue:x,"data-testid":"".concat(d,"_secondaryAssetEditorAutocomplete"),defaultValue:A,disableClearable:!1,isNullable:f,label:"Active ".concat(r(N)),onChange:G,parentAssetId:j,parentAssetType:C}):u(n,{"data-testid":"".concat(d,"_secondaryAutoComplete"),onChange:G,defaultValue:A,currentValue:x,isNullable:f,label:"Active ".concat(r(N)),assetType:N,parentAssetId:j,parentAssetType:C,appKey:m})})]})};m.defaultProps={label:"Choose An Asset",isNullable:!1,defaultValue:void 0,appKey:null},m.propTypes={settings:s.shape({}).isRequired,appType:s.shape({}).isRequired,defaultValue:s.any,onSettingsChange:s.func.isRequired,label:s.string,isNullable:s.bool,appKey:s.string};export{m as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{useState as a}from"react";import s from"prop-types";import{get as l,capitalize as r}from"lodash";import{Button as o}from"@material-ui/core";import i from"./AssetEditors.css.js";import n from"./SingleAssetEditor.js";import p from"./AssetEditorAutocomplete.js";import{jsxs as c,jsx as u}from"react/jsx-runtime";var d="DC_AppSettingsAssetEditor",m=function(s){var m=s.appKey,y=s.appType,A=s.defaultValue,f=s.isNullable,b=s.label,h=s.onSettingsChange,g=s.settings,C=l(y,["primaryAsset","assetType","type"]),T=l(y,["primaryAsset","assetType","id"]),v=l(y,["primaryAsset","autocompleteSelect"]),N=l(y,["secondaryAsset","assetType","type"]),V=l(y,["secondaryAsset","assetType","id"]),K=l(y,["secondaryAsset","autocompleteSelect"]),_=l(g,T),E=a(_||A),S=t(E,2),j=S[0],q=S[1],R=a(l(g,V)),k=t(R,2),x=k[0],B=k[1],D=a(!(!N||x)),I=t(D,2),P=I[0],U=I[1],W=a(!(!N||!x)),w=t(W,2),z=w[0],F=w[1],G=function(t){B(t),h(e({},V,t))},H=function(t){q(t),B(null),F(!1),U(!!N);var a=e({},T,t);V&&(a[V]=null),h(a)};return c("div",{className:i.main,children:[u("div",{className:i.title,children:"Active Asset"}),c("div",{className:i.editor,children:[v?u(p,{appKey:m,assetType:C,currentValue:j,"data-testid":"".concat(d,"_primaryAssetEditorAutocomplete"),defaultValue:A,disableClearable:!f,isNullable:f,label:b,onChange:H}):u(n,{appKey:m,assetType:C,currentValue:j,"data-testid":"".concat(d,"_primaryAutoComplete"),defaultValue:A,isNullable:f,label:b,onChange:H}),P&&u(o,{"data-testid":"".concat(d,"_changeWellButton"),color:"primary",onClick:function(){F(!0),U(!1)},disabled:!_,children:"Change ".concat(r(N))}),!P&&z&&u(o,{"data-testid":"".concat(d,"_useDefaultButton"),color:"secondary",onClick:function(){B(null),F(!1),U(!!N),h(e({},V,null))},children:"Use active asset"})]}),z&&u("div",{className:i.editor,children:K?u(p,{appKey:m,assetType:N,currentValue:x,"data-testid":"".concat(d,"_secondaryAssetEditorAutocomplete"),defaultValue:A,disableClearable:!1,isNullable:f,label:"Active ".concat(r(N)),onChange:G,parentAssetId:j,parentAssetType:C}):u(n,{"data-testid":"".concat(d,"_secondaryAutoComplete"),onChange:G,defaultValue:A,currentValue:x,isNullable:f,label:"Active ".concat(r(N)),assetType:N,parentAssetId:j,parentAssetType:C,appKey:m})})]})};m.defaultProps={label:"Choose An Asset",isNullable:!1,defaultValue:void 0,appKey:null},m.propTypes={settings:s.shape({}).isRequired,appType:s.shape({}).isRequired,defaultValue:s.any,onSettingsChange:s.func.isRequired,label:s.string,isNullable:s.bool,appKey:s.string};export{m as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.57.0-3",
3
+ "version": "0.57.0-4",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"