@sillsdev/config-r 1.0.0-alpha.24 → 1.0.0-alpha.26

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/README.md CHANGED
@@ -41,7 +41,7 @@ Use [src/stories/bloom.stories.tsx](src/stories/bloom.stories.tsx) as the canoni
41
41
  - Override/locking behavior is standardized: most controls accept `overrideValue` + `overrideDescription`; `ConfigrBoolean` adds `locked` and `immediateEffect`.
42
42
  - Leaf controls support `required` and `validation`. `validation` receives the current field value and may return `true`, `false`, or a string. `false` renders a generic `Invalid value` message, while a string is shown inline in red.
43
43
  - Required fields show a `*` beside the control. The fallback `Required` message for empty required fields is controlled at the pane level with `showRequiredMessage` and defaults to `true`.
44
- - `ConfigrInput` covers standard text, number, and email fields. It also supports `charactersWide`, `allowNewLines`, and `maxLines` for compact multiline text entry.
44
+ - `ConfigrInput` covers standard text, number, and email fields. It also supports `charactersWide`, `allowNewLines`, `minLinesToShow`, and `maxLinesToShowBeforeScrolling` for compact multiline text entry.
45
45
  - `ConfigrPane` adds UI props like `showAppBar`, `showSearch`, `showJson`, `themeOverrides`, `initiallySelectedTopLevelPageKey`, and `localizations`.
46
46
 
47
47
  ## Localization
@@ -42,7 +42,8 @@ export declare const ConfigrInput: React.FunctionComponent<React.PropsWithChildr
42
42
  units?: string;
43
43
  charactersWide?: number;
44
44
  allowNewLines?: boolean;
45
- maxLines?: number;
45
+ minLinesToShow?: number;
46
+ maxLinesToShowBeforeScrolling?: number;
46
47
  getErrorMessage?: ConfigrErrorMessageGetter;
47
48
  }>>;
48
49
  interface ICustomStringInputProps extends IConfigrProps<string> {
@@ -291,7 +291,7 @@ PERFORMANCE OF THIS SOFTWARE.
291
291
  background-color: yellow;
292
292
  `,children:t.matchesLabel(l)})]})}return s}});return e.onClick?O.jsx(Ov,{onClick:e.onClick,disabled:e.disabled,children:n}):O.jsx(jc,{css:_e.css`
293
293
  height: ${e.height};
294
- `,children:n})};function mn(e){const{values:t}=Rn();if(e.overrideValue===void 0)return e;const n=e.path.replace(/[.[\]]/g,"_");let r=t[Xr];t[Xr]||(t[Xr]=r={}),r[n]=e.overrideValue;const o=`${e.description??""} (${e.overrideDescription??""})`.replace(" ()","").trim();return{...e,description:o,disabled:!0,path:Xr+"."+n}}const Xr="overrideValue$",yI=e=>{e=mn(e);const[t]=on(e.path),n=an(e,t.value),r=!!e.allowNewLines&&(!e.type||e.type==="text");return O.jsx(bn,{...e,validationMessage:n,control:O.jsx(pa,{component:Fg,variant:"standard",name:e.path,disabled:e.disabled,type:r?void 0:e.type??"text",multiline:r,minRows:r?1:void 0,maxRows:r?e.maxLines??1:void 0,inputProps:r&&e.charactersWide?{cols:e.charactersWide}:void 0,InputProps:e.units?{endAdornment:O.jsx(Sv,{position:"end",children:e.units})}:void 0,sx:e.charactersWide?{width:`${e.charactersWide}ch`}:void 0,css:_e.css`
294
+ `,children:n})};function mn(e){const{values:t}=Rn();if(e.overrideValue===void 0)return e;const n=e.path.replace(/[.[\]]/g,"_");let r=t[Xr];t[Xr]||(t[Xr]=r={}),r[n]=e.overrideValue;const o=`${e.description??""} (${e.overrideDescription??""})`.replace(" ()","").trim();return{...e,description:o,disabled:!0,path:Xr+"."+n}}const Xr="overrideValue$",yI=e=>{e=mn(e);const[t]=on(e.path),n=an(e,t.value),r=!!e.allowNewLines&&(!e.type||e.type==="text");return O.jsx(bn,{...e,validationMessage:n,control:O.jsx(pa,{component:Fg,variant:"standard",name:e.path,disabled:e.disabled,type:r?void 0:e.type??"text",multiline:r,minRows:r?e.minLinesToShow??1:void 0,maxRows:r?e.maxLinesToShowBeforeScrolling??1:void 0,inputProps:r&&e.charactersWide?{cols:e.charactersWide}:void 0,InputProps:e.units?{endAdornment:O.jsx(Sv,{position:"end",children:e.units})}:void 0,sx:e.charactersWide?{width:`${e.charactersWide}ch`}:void 0,css:_e.css`
295
295
  ${r?"":`
296
296
  input {
297
297
  text-align: end;
@@ -360,6 +360,7 @@ PERFORMANCE OF THIS SOFTWARE.
360
360
  display: flex;
361
361
  flex-direction: row;
362
362
  flex: 1;
363
+ height: 100%; // retain the height of the parent for possibly scrollable content (BL-16149)
363
364
  `,children:[O.jsx("div",{css:_e.css`
364
365
  flex: 1;
365
366
  `,children:O.jsx(na,{theme:n,children:O.jsx(fo.Provider,{value:t,children:O.jsx(hI,{children:O.jsx(Aa.Consumer,{children:({searchString:x,setSearchString:T})=>O.jsxs(h.Fragment,{children:[e.showAppBar&&O.jsx(IS,{label:e.label,showSearch:e.showSearch,searchValue:x,setSearchString:w=>{x!==w&&(T(w),c(void 0),s(w?void 0:f??0))}}),O.jsxs("div",{id:"configr-pane",css:_e.css`