@sillsdev/config-r 1.0.0-alpha.12 → 1.0.0-alpha.13
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/ContentPane.d.ts +1 -0
- package/dist/configr.es.js +5 -4
- package/dist/configr.umd.js +1 -1
- package/package.json +1 -1
package/dist/ContentPane.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ export declare const ConfigrForEach: React.FunctionComponent<React.PropsWithChil
|
|
|
96
96
|
}>>;
|
|
97
97
|
export declare const ConfigrBoolean: React.FunctionComponent<React.PropsWithChildren<IConfigrProps<boolean> & {
|
|
98
98
|
immediateEffect?: boolean;
|
|
99
|
+
locked?: boolean;
|
|
99
100
|
}>>;
|
|
100
101
|
interface IRadioGroupProps extends IConfigrProps<string> {
|
|
101
102
|
row?: boolean;
|
package/dist/configr.es.js
CHANGED
|
@@ -3526,12 +3526,12 @@ const CP = (e) => {
|
|
|
3526
3526
|
e = it(e);
|
|
3527
3527
|
const [t, r, n] = At(e.path);
|
|
3528
3528
|
(t.value === void 0 || t.value === null) && window.setTimeout(() => n.setValue(!1), 0);
|
|
3529
|
-
const a = e.immediateEffect ? /* @__PURE__ */ x(Ar, { component: iu, type: "checkbox", name: e.path, label: e.label }) : /* @__PURE__ */ x(
|
|
3529
|
+
const a = e.immediateEffect ? /* @__PURE__ */ x(Ar, { component: iu, type: "checkbox", name: e.path, label: e.label, disabled: e.disabled || e.locked }) : /* @__PURE__ */ x(
|
|
3530
3530
|
Ar,
|
|
3531
3531
|
{
|
|
3532
3532
|
component: nu,
|
|
3533
3533
|
type: "checkbox",
|
|
3534
|
-
disabled: e.disabled,
|
|
3534
|
+
disabled: e.disabled || e.locked,
|
|
3535
3535
|
name: e.path,
|
|
3536
3536
|
label: e.label
|
|
3537
3537
|
}
|
|
@@ -3540,10 +3540,11 @@ const CP = (e) => {
|
|
|
3540
3540
|
at,
|
|
3541
3541
|
{
|
|
3542
3542
|
onClick: () => {
|
|
3543
|
-
n.setValue(!t.value);
|
|
3543
|
+
e.locked || n.setValue(!t.value);
|
|
3544
3544
|
},
|
|
3545
3545
|
control: a,
|
|
3546
|
-
...e
|
|
3546
|
+
...e,
|
|
3547
|
+
disabled: e.disabled && !e.locked
|
|
3547
3548
|
}
|
|
3548
3549
|
);
|
|
3549
3550
|
}, PP = (e) => (e = it(e), // I could imagine wanting the radio buttons in the right column. There aren't any examples of this in chrome:settings.
|
package/dist/configr.umd.js
CHANGED
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
margin-left: 20px;
|
|
101
101
|
//margin-right: 20px;
|
|
102
102
|
}
|
|
103
|
-
`,children:y.jsx(bs,{children:e.children})})]}):y.jsx(Ye,{onClick:()=>r(e.path),control:y.jsx(sc,{}),...e})}),Jb=e=>{const{values:t}=it(),r=ms(t,e.path);return y.jsx(Y.Fragment,{children:r.map((n,a)=>e.render(`${e.path}[${a}]`,a))})},Zb=e=>{e=Xe(e);const[t,r,n]=mt(e.path);(t.value===void 0||t.value===null)&&window.setTimeout(()=>n.setValue(!1),0);const a=e.immediateEffect?y.jsx(_r,{component:ns,type:"checkbox",name:e.path,label:e.label}):y.jsx(_r,{component:ts,type:"checkbox",disabled:e.disabled,name:e.path,label:e.label});return y.jsx(Ye,{onClick:()=>{n.setValue(!t.value)},control:a,...e})},Qb=e=>(e=Xe(e),y.jsx(Vb,{...e,control:y.jsx(ey,{...e})})),ey=e=>{const[t]=mt(e.path);return y.jsx(F.RadioGroup,{row:e.row,...t,...e,children:e.children})},ty=e=>{const t=F.useRadioGroup();return console.log("useRadioGroup "+JSON.stringify(t)),e.label?y.jsx(F.FormControlLabel,{value:e.value,control:y.jsx(F.Radio,{}),label:e.label}):y.jsx(Y.Fragment,{children:e.children})},ry=e=>(e=Xe(e),y.jsx(Ye,{...e,control:y.jsx(ny,{...e})})),ny=e=>y.jsx(_r,{component:is,name:e.path,type:"checkbox",exclusive:!0,children:e.children});function ay(e,t){return y.jsx(F.ToggleButton,{value:e,children:t})}const iy=e=>{e=Xe(e);const{setFieldValue:t}=it(),[r]=mt(e.path);return y.jsx(Ye,{...e,height:"50px",control:y.jsxs("div",{css:le.css`
|
|
103
|
+
`,children:y.jsx(bs,{children:e.children})})]}):y.jsx(Ye,{onClick:()=>r(e.path),control:y.jsx(sc,{}),...e})}),Jb=e=>{const{values:t}=it(),r=ms(t,e.path);return y.jsx(Y.Fragment,{children:r.map((n,a)=>e.render(`${e.path}[${a}]`,a))})},Zb=e=>{e=Xe(e);const[t,r,n]=mt(e.path);(t.value===void 0||t.value===null)&&window.setTimeout(()=>n.setValue(!1),0);const a=e.immediateEffect?y.jsx(_r,{component:ns,type:"checkbox",name:e.path,label:e.label,disabled:e.disabled||e.locked}):y.jsx(_r,{component:ts,type:"checkbox",disabled:e.disabled||e.locked,name:e.path,label:e.label});return y.jsx(Ye,{onClick:()=>{e.locked||n.setValue(!t.value)},control:a,...e,disabled:e.disabled&&!e.locked})},Qb=e=>(e=Xe(e),y.jsx(Vb,{...e,control:y.jsx(ey,{...e})})),ey=e=>{const[t]=mt(e.path);return y.jsx(F.RadioGroup,{row:e.row,...t,...e,children:e.children})},ty=e=>{const t=F.useRadioGroup();return console.log("useRadioGroup "+JSON.stringify(t)),e.label?y.jsx(F.FormControlLabel,{value:e.value,control:y.jsx(F.Radio,{}),label:e.label}):y.jsx(Y.Fragment,{children:e.children})},ry=e=>(e=Xe(e),y.jsx(Ye,{...e,control:y.jsx(ny,{...e})})),ny=e=>y.jsx(_r,{component:is,name:e.path,type:"checkbox",exclusive:!0,children:e.children});function ay(e,t){return y.jsx(F.ToggleButton,{value:e,children:t})}const iy=e=>{e=Xe(e);const{setFieldValue:t}=it(),[r]=mt(e.path);return y.jsx(Ye,{...e,height:"50px",control:y.jsxs("div",{css:le.css`
|
|
104
104
|
height: 56px; // leave room to show the path below the button
|
|
105
105
|
`,children:[y.jsx(F.Button,{disabled:e.disabled,variant:"outlined",onClick:()=>{const n=e.chooseAction(r.value);t(e.path,n)},children:e.buttonLabel}),y.jsx("div",{css:le.css`
|
|
106
106
|
color: ${Lb};
|