grep-components 2.12.0-GREPF-2676.1 → 2.12.0-GREPF-2736.1

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,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { SelectProps, InputBaseComponentProps, InputLabelProps } from '@mui/material';
2
+ import { SelectProps, InputBaseComponentProps } from '@mui/material';
3
3
  export interface SelectItem {
4
4
  value: string | number;
5
5
  label?: string;
@@ -14,7 +14,6 @@ export type GrepSelectProps = SelectProps & {
14
14
  selectItems: SelectItem[];
15
15
  unselectOption?: boolean;
16
16
  useCheckedSelect?: boolean;
17
- labelProps?: InputLabelProps;
18
17
  inputProps?: InputBaseComponentProps | undefined;
19
18
  };
20
19
  declare const _default: React.ComponentType<GrepSelectProps>;
package/dist/index.js CHANGED
@@ -2551,14 +2551,14 @@ const GrepSelect = (props) => {
2551
2551
  React.useEffect(() => {
2552
2552
  setLabelWidth(inputLabel.current.offsetWidth);
2553
2553
  }, []);
2554
- const { unselectOption = true, errorMessage, selectItems, helperText, fullWidth, outlined, disabled, required, label, labelProps, inputProps, value, size, id, useCheckedSelect, ...rest } = props;
2554
+ const { unselectOption = true, errorMessage, selectItems, helperText, fullWidth, outlined, disabled, required, label, inputProps, value, size, id, useCheckedSelect, ...rest } = props;
2555
2555
  const error = errorMessage ? errorMessage.length > 0 : false;
2556
2556
  const selected = value;
2557
2557
  return (React.createElement(FormControl, { variant: outlined ? 'outlined' : 'standard', className: props.className, fullWidth: fullWidth, required: required, style: props.style, error: error, size: size, disabled: disabled },
2558
2558
  React.createElement(InputLabel, { htmlFor: id, ref: inputLabel, style: {
2559
2559
  minWidth: 'max-content',
2560
2560
  overflow: 'visible',
2561
- }, ...labelProps }, label),
2561
+ } }, label),
2562
2562
  React.createElement(Select, { ...rest, inputProps: { id, ...inputProps }, disabled: !selectItems || disabled, value: value === null ? '' : value, style: { minWidth: labelWidth + (outlined ? 35 : 25) },
2563
2563
  // @todo: make input respect label length
2564
2564
  input: outlined ? React.createElement(OutlinedInput, { label: label }) : React.createElement(Input, null), MenuProps: {
@@ -11099,7 +11099,7 @@ const SortableTable = ({ columns, items, identify, headerValue, cellValue, disab
11099
11099
  *
11100
11100
  */
11101
11101
 
11102
- function N$1(e,...t){const n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(const e of t)o.append("v",e);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function b(e){if("text"===e.type)return e.offset===e.getNode().getTextContentSize();const t=e.getNode();return $isElementNode(t)||N$1(177),e.offset===t.getChildrenSize()}
11102
+ function N(e,...t){const n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(const e of t)o.append("v",e);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function A(e){if("text"===e.type)return e.offset===e.getNode().getTextContentSize();const t=e.getNode();return $isElementNode(t)||N(177),e.offset===t.getChildrenSize()}
11103
11103
 
11104
11104
  /**
11105
11105
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -11109,7 +11109,7 @@ function N$1(e,...t){const n=new URL("https://lexical.dev/docs/error"),o=new URL
11109
11109
  *
11110
11110
  */
11111
11111
 
11112
- const N="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,P=N&&"documentMode"in document?document.documentMode:null;!(!N||!("InputEvent"in window)||P)&&"getTargetRanges"in new window.InputEvent("input");function H(...t){const e=[];for(const n of t)if(n&&"string"==typeof n)for(const[t]of n.matchAll(/\S+/g))e.push(t);return e}function $(...t){return ()=>{for(let e=t.length-1;e>=0;e--)t[e]();t.length=0;}}function et(t,...e){const n=H(...e);n.length>0&&t.classList.add(...n);}
11112
+ const M="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,R=M&&"documentMode"in document?document.documentMode:null;!(!M||!("InputEvent"in window)||R)&&"getTargetRanges"in new window.InputEvent("input");function I(...t){const e=[];for(const n of t)if(n&&"string"==typeof n)for(const[t]of n.matchAll(/\S+/g))e.push(t);return e}function j(...t){return ()=>{for(let e=t.length-1;e>=0;e--)t[e]();t.length=0;}}function rt(t,...e){const n=I(...e);n.length>0&&t.classList.add(...n);}
11113
11113
 
11114
11114
  /**
11115
11115
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -11119,7 +11119,7 @@ const N="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.do
11119
11119
  *
11120
11120
  */
11121
11121
 
11122
- function h(e,n){const t=n.body?n.body.childNodes:[];let o=[];const l=[];for(let n=0;n<t.length;n++){const r=t[n];if(!x.has(r.nodeName)){const n=y(r,e,l,false);null!==n&&(o=o.concat(n));}}return function(e){for(const n of e)n.getNextSibling()instanceof ArtificialNode__DO_NOT_USE&&n.insertAfter($createLineBreakNode());for(const n of e){const e=n.getChildren();for(const t of e)n.insertBefore(t);n.remove();}}(l),o}const x=new Set(["STYLE","SCRIPT"]);function y(e,n,o,r,i=new Map,s){let h=[];if(x.has(e.nodeName))return h;let m=null;const g=function(e,n){const{nodeName:t}=e,o=n._htmlConversions.get(t.toLowerCase());let l=null;if(void 0!==o)for(const n of o){const t=n(e);null!==t&&(null===l||(l.priority||0)<=(t.priority||0))&&(l=t);}return null!==l?l.conversion:null}(e,n),b=g?g(e):null;let C=null;if(null!==b){C=b.after;const n=b.node;if(m=Array.isArray(n)?n[n.length-1]:n,null!==m){for(const[,e]of i)if(m=e(m,s),!m)break;m&&h.push(...Array.isArray(n)?n:[m]);}null!=b.forChild&&i.set(e.nodeName,b.forChild);}const S=e.childNodes;let v=[];const N=(null==m||!$isRootOrShadowRoot(m))&&(null!=m&&$isBlockElementNode(m)||r);for(let e=0;e<S.length;e++)v.push(...y(S[e],n,o,N,new Map(i),m));return null!=C&&(v=C(v)),isBlockDomNode(e)&&(v=w(e,v,N?()=>{const e=new ArtificialNode__DO_NOT_USE;return o.push(e),e}:$createParagraphNode)),null==m?v.length>0?h=h.concat(v):isBlockDomNode(e)&&function(e){if(null==e.nextSibling||null==e.previousSibling)return false;return isInlineDomNode(e.nextSibling)&&isInlineDomNode(e.previousSibling)}(e)&&(h=h.concat($createLineBreakNode())):$isElementNode(m)&&m.append(...v),h}function w(e,n,t){const o=e.style.textAlign,l=[];let r=[];for(let e=0;e<n.length;e++){const i=n[e];if($isBlockElementNode(i))o&&!i.getFormat()&&i.setFormat(o),l.push(i);else if(r.push(i),e===n.length-1||e<n.length-1&&$isBlockElementNode(n[e+1])){const e=t();e.setFormat(o),e.append(...r),l.push(e),r=[];}}return l}
11122
+ function m(e,n){const t=n.body?n.body.childNodes:[];let o=[];const l=[];for(let n=0;n<t.length;n++){const r=t[n];if(!y.has(r.nodeName)){const n=w(r,e,l,false);null!==n&&(o=o.concat(n));}}return function(e){for(const n of e)n.getNextSibling()instanceof ArtificialNode__DO_NOT_USE&&n.insertAfter($createLineBreakNode());for(const n of e){const e=n.getChildren();for(const t of e)n.insertBefore(t);n.remove();}}(l),o}const y=new Set(["STYLE","SCRIPT"]);function w(e,n,o,r,i=new Map,s){let c=[];if(y.has(e.nodeName))return c;let m=null;const g=function(e,n){const{nodeName:t}=e,o=n._htmlConversions.get(t.toLowerCase());let l=null;if(void 0!==o)for(const n of o){const t=n(e);null!==t&&(null===l||(l.priority||0)<=(t.priority||0))&&(l=t);}return null!==l?l.conversion:null}(e,n),x=g?g(e):null;let C=null;if(null!==x){C=x.after;const n=x.node;if(m=Array.isArray(n)?n[n.length-1]:n,null!==m){for(const[,e]of i)if(m=e(m,s),!m)break;m&&c.push(...Array.isArray(n)?n:[m]);}null!=x.forChild&&i.set(e.nodeName,x.forChild);}const S=e.childNodes;let v=[];const N=(null==m||!$isRootOrShadowRoot(m))&&(null!=m&&$isBlockElementNode(m)||r);for(let e=0;e<S.length;e++)v.push(...w(S[e],n,o,N,new Map(i),m));return null!=C&&(v=C(v)),isBlockDomNode(e)&&(v=b(e,v,N?()=>{const e=new ArtificialNode__DO_NOT_USE;return o.push(e),e}:$createParagraphNode)),null==m?v.length>0?c=c.concat(v):isBlockDomNode(e)&&function(e){if(null==e.nextSibling||null==e.previousSibling)return false;return isInlineDomNode(e.nextSibling)&&isInlineDomNode(e.previousSibling)}(e)&&(c=c.concat($createLineBreakNode())):$isElementNode(m)&&m.append(...v),c}function b(e,n,t){const o=e.style.textAlign,l=[];let r=[];for(let e=0;e<n.length;e++){const i=n[e];if($isBlockElementNode(i))o&&!i.getFormat()&&i.setFormat(o),l.push(i);else if(r.push(i),e===n.length-1||e<n.length-1&&$isBlockElementNode(n[e+1])){const e=t();e.setFormat(o),e.append(...r),l.push(e),r=[];}}return l}
11123
11123
 
11124
11124
  /**
11125
11125
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -11129,7 +11129,7 @@ function h(e,n){const t=n.body?n.body.childNodes:[];let o=[];const l=[];for(let
11129
11129
  *
11130
11130
  */
11131
11131
 
11132
- const dt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,mt=dt&&"documentMode"in document?document.documentMode:null;!(!dt||!("InputEvent"in window)||mt)&&"getTargetRanges"in new window.InputEvent("input");createCommand("DRAG_DROP_PASTE_FILE");class wt extends ElementNode{static getType(){return "heading"}static clone(t){return new wt(t.__tag,t.__key)}constructor(t,e){super(e),this.__tag=t;}getTag(){return this.__tag}setTag(t){const e=this.getWritable();return this.__tag=t,e}createDOM(t){const e=this.__tag,n=document.createElement(e),r=t.theme.heading;if(void 0!==r){const t=r[e];et(n,t);}return n}updateDOM(t,e,n){return t.__tag!==this.__tag}static importDOM(){return {h1:t=>({conversion:Et,priority:0}),h2:t=>({conversion:Et,priority:0}),h3:t=>({conversion:Et,priority:0}),h4:t=>({conversion:Et,priority:0}),h5:t=>({conversion:Et,priority:0}),h6:t=>({conversion:Et,priority:0}),p:t=>{const e=t.firstChild;return null!==e&&Nt(e)?{conversion:()=>({node:null}),priority:3}:null},span:t=>Nt(t)?{conversion:t=>({node:Tt("h1")}),priority:3}:null}}exportDOM(t){const{element:e}=super.exportDOM(t);if(isHTMLElement(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n);}return {element:e}}static importJSON(t){return Tt(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return {...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,e=true){const n=t?t.anchor.offset:0,r=this.getLastDescendant(),o=!r||t&&t.anchor.key===r.getKey()&&n===r.getTextContentSize()||!t?$createParagraphNode():Tt(this.getTag()),i=this.getDirection();if(o.setDirection(i),this.insertAfter(o,e),0===n&&!this.isEmpty()&&t){const t=$createParagraphNode();t.select(),this.replace(t,true);}return o}collapseAtStart(){const t=this.isEmpty()?$createParagraphNode():Tt(this.getTag());return this.getChildren().forEach((e=>t.append(e))),this.replace(t),true}extractWithChild(){return true}}function Nt(t){return "span"===t.nodeName.toLowerCase()&&"26pt"===t.style.fontSize}function Et(t){const e=t.nodeName.toLowerCase();let n=null;return "h1"!==e&&"h2"!==e&&"h3"!==e&&"h4"!==e&&"h5"!==e&&"h6"!==e||(n=Tt(e),null!==t.style&&(setNodeIndentFromDOM(t,n),n.setFormat(t.style.textAlign))),{node:n}}function Tt(t="h1"){return $applyNodeReplacement(new wt(t))}
11132
+ const ft="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,gt=ft&&"documentMode"in document?document.documentMode:null;!(!ft||!("InputEvent"in window)||gt)&&"getTargetRanges"in new window.InputEvent("input");createCommand("DRAG_DROP_PASTE_FILE");class Et extends ElementNode{static getType(){return "heading"}static clone(t){return new Et(t.__tag,t.__key)}constructor(t,e){super(e),this.__tag=t;}getTag(){return this.__tag}setTag(t){const e=this.getWritable();return this.__tag=t,e}createDOM(t){const e=this.__tag,n=document.createElement(e),r=t.theme.heading;if(void 0!==r){const t=r[e];rt(n,t);}return n}updateDOM(t,e,n){return t.__tag!==this.__tag}static importDOM(){return {h1:t=>({conversion:Tt,priority:0}),h2:t=>({conversion:Tt,priority:0}),h3:t=>({conversion:Tt,priority:0}),h4:t=>({conversion:Tt,priority:0}),h5:t=>({conversion:Tt,priority:0}),h6:t=>({conversion:Tt,priority:0}),p:t=>{const e=t.firstChild;return null!==e&&Ot(e)?{conversion:()=>({node:null}),priority:3}:null},span:t=>Ot(t)?{conversion:t=>({node:At("h1")}),priority:3}:null}}exportDOM(t){const{element:e}=super.exportDOM(t);if(isHTMLElement(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();t&&(e.style.textAlign=t);const n=this.getDirection();n&&(e.dir=n);}return {element:e}}static importJSON(t){return At(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return {...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,e=true){const n=t?t.anchor.offset:0,r=this.getLastDescendant(),o=!r||t&&t.anchor.key===r.getKey()&&n===r.getTextContentSize()||!t?$createParagraphNode():At(this.getTag()),i=this.getDirection();if(o.setDirection(i),this.insertAfter(o,e),0===n&&!this.isEmpty()&&t){const t=$createParagraphNode();t.select(),this.replace(t,true);}return o}collapseAtStart(){const t=this.isEmpty()?$createParagraphNode():At(this.getTag());return this.getChildren().forEach((e=>t.append(e))),this.replace(t),true}extractWithChild(){return true}}function Ot(t){return "span"===t.nodeName.toLowerCase()&&"26pt"===t.style.fontSize}function Tt(t){const e=t.nodeName.toLowerCase();let n=null;return "h1"!==e&&"h2"!==e&&"h3"!==e&&"h4"!==e&&"h5"!==e&&"h6"!==e||(n=At(e),null!==t.style&&(setNodeIndentFromDOM(t,n),n.setFormat(t.style.textAlign))),{node:n}}function At(t="h1"){return $applyNodeReplacement(new Et(t))}
11133
11133
 
11134
11134
  const useEditorStyles = makeStyles()((theme, { hasFocus, hasContent, readOnly, hasCustomToolbar }) => ({
11135
11135
  root: {
@@ -11226,7 +11226,7 @@ function StyleWrapperPlugin({ showCharcount, helperText, readOnly, classes, labe
11226
11226
  });
11227
11227
  const [charCount, setCharCount] = useState(0);
11228
11228
  useEffect(() => {
11229
- return $(editor.registerCommand(BLUR_COMMAND, () => {
11229
+ return j(editor.registerCommand(BLUR_COMMAND, () => {
11230
11230
  setFocused(editor.getRootElement() === document.activeElement);
11231
11231
  return false;
11232
11232
  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(FOCUS_COMMAND, () => {
@@ -11308,7 +11308,7 @@ const htmlExportMap = new Map([
11308
11308
  },
11309
11309
  ],
11310
11310
  [
11311
- wt,
11311
+ Et,
11312
11312
  (editor, node) => {
11313
11313
  const headingNode = node;
11314
11314
  const element = headingNode.createDOM(editor._config);
@@ -11372,7 +11372,7 @@ function ModifyPastePlugin({ blockPasting, stripPastedStyles, }) {
11372
11372
  function PreventNewlinesPlugin({ disableNewlines, }) {
11373
11373
  const [editor] = useLexicalComposerContext();
11374
11374
  if (disableNewlines) {
11375
- $(editor.registerNodeTransform(RootNode, (rootNode) => {
11375
+ j(editor.registerNodeTransform(RootNode, (rootNode) => {
11376
11376
  if (rootNode.getChildrenSize() <= 1)
11377
11377
  return;
11378
11378
  rootNode.getLastChild()?.remove();
@@ -11483,10 +11483,10 @@ function getSelectedNode(selection) {
11483
11483
  }
11484
11484
  const isBackward = selection.isBackward();
11485
11485
  if (isBackward) {
11486
- return b(focus) ? anchorNode : focusNode;
11486
+ return A(focus) ? anchorNode : focusNode;
11487
11487
  }
11488
11488
  else {
11489
- return b(anchor) ? anchorNode : focusNode;
11489
+ return A(anchor) ? anchorNode : focusNode;
11490
11490
  }
11491
11491
  }
11492
11492
 
@@ -11571,7 +11571,7 @@ function TextFormatFloatingToolbar({ editor, anchorElem, isBold, isItalic, butto
11571
11571
  editor.getEditorState().read(() => {
11572
11572
  updateTextFormatFloatingToolbar();
11573
11573
  });
11574
- return $(editor.registerUpdateListener(({ editorState }) => {
11574
+ return j(editor.registerUpdateListener(({ editorState }) => {
11575
11575
  editorState.read(() => {
11576
11576
  updateTextFormatFloatingToolbar();
11577
11577
  });
@@ -11637,7 +11637,7 @@ function useFloatingTextFormatToolbar(editor, anchorElem, buttons, CustomToolbar
11637
11637
  };
11638
11638
  }, [updatePopup]);
11639
11639
  useEffect(() => {
11640
- return $(editor.registerUpdateListener(() => {
11640
+ return j(editor.registerUpdateListener(() => {
11641
11641
  updatePopup();
11642
11642
  }), editor.registerRootListener(() => {
11643
11643
  if (editor.getRootElement() === null) {
@@ -11674,7 +11674,7 @@ function InsertDataPlugin({ html }) {
11674
11674
  }
11675
11675
  const dom = parser.parseFromString(html, 'text/html');
11676
11676
  editor.update(() => {
11677
- const nodes = h(editor, dom);
11677
+ const nodes = m(editor, dom);
11678
11678
  $insertNodes(nodes);
11679
11679
  });
11680
11680
  }, []);
@@ -11697,12 +11697,12 @@ function HeadingPlugin({ html }) {
11697
11697
  // Only replace if tag is heading.
11698
11698
  if (tag) {
11699
11699
  editor.registerNodeTransform(ParagraphNode, (node) => {
11700
- node.replace(Tt(`${tag}`));
11700
+ node.replace(At(`${tag}`));
11701
11701
  });
11702
11702
  }
11703
11703
  else {
11704
11704
  // Replace a heading with paragraph
11705
- editor.registerNodeTransform(wt, (node) => {
11705
+ editor.registerNodeTransform(Et, (node) => {
11706
11706
  node.replace($createParagraphNode(), true);
11707
11707
  });
11708
11708
  }
@@ -11744,8 +11744,7 @@ const allowBoldItalic = (node) => {
11744
11744
  node.hasFormat('underline'))) {
11745
11745
  node.setFormat('italic');
11746
11746
  }
11747
- else if (node.hasFormat('bold') ||
11748
- node.hasFormat('code') ||
11747
+ else if (node.hasFormat('code') ||
11749
11748
  node.hasFormat('highlight') ||
11750
11749
  node.hasFormat('strikethrough') ||
11751
11750
  node.hasFormat('subscript') ||
@@ -11853,7 +11852,7 @@ function Editor({ html, label, classes, autoFocus, helperText, showCharCount, al
11853
11852
  theme,
11854
11853
  editable: !readOnly,
11855
11854
  onError,
11856
- nodes: [wt],
11855
+ nodes: [Et],
11857
11856
  html: {
11858
11857
  export: htmlExportMap,
11859
11858
  },