grep-components 2.12.0-GREPF-2676.2 → 2.12.0
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/components/GrepSelect/index.d.ts +1 -2
- package/dist/index.js +19 -21
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SelectProps, InputBaseComponentProps
|
|
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,
|
|
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
|
-
}
|
|
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: {
|
|
@@ -11024,8 +11024,7 @@ function SortableTableRow({ item, id, index, render, disabled, }) {
|
|
|
11024
11024
|
const renderRow = useCallback$1((isDragging) => cells.map(({ value, properties }, index) => (React__default.createElement(SortableTableCell, { key: `dragable-${id}-${index}`, locked: isDragging, ...properties }, value))), [cells, id]);
|
|
11025
11025
|
return (React__default.createElement(PublicDraggable, { draggableId: `dragable-${id}`, index: index, isDragDisabled: disabled }, (provided, { isDragging }) => {
|
|
11026
11026
|
const { classes } = useStyles$4({ isDragging: isDragging });
|
|
11027
|
-
return (React__default.createElement(TableRow, { className: classes.row, ref: provided.innerRef, ...provided.draggableProps
|
|
11028
|
-
, tabIndex: undefined },
|
|
11027
|
+
return (React__default.createElement(TableRow, { className: classes.row, ref: provided.innerRef, ...provided.draggableProps },
|
|
11029
11028
|
React__default.createElement(TableCell, { style: { width: '45px', padding: '5px 10px' }, ...provided.dragHandleProps },
|
|
11030
11029
|
React__default.createElement(DragIndicator, null)),
|
|
11031
11030
|
renderRow(isDragging)));
|
|
@@ -11100,7 +11099,7 @@ const SortableTable = ({ columns, items, identify, headerValue, cellValue, disab
|
|
|
11100
11099
|
*
|
|
11101
11100
|
*/
|
|
11102
11101
|
|
|
11103
|
-
function N
|
|
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()}
|
|
11104
11103
|
|
|
11105
11104
|
/**
|
|
11106
11105
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -11110,7 +11109,7 @@ function N$1(e,...t){const n=new URL("https://lexical.dev/docs/error"),o=new URL
|
|
|
11110
11109
|
*
|
|
11111
11110
|
*/
|
|
11112
11111
|
|
|
11113
|
-
const
|
|
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);}
|
|
11114
11113
|
|
|
11115
11114
|
/**
|
|
11116
11115
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -11120,7 +11119,7 @@ const N="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.do
|
|
|
11120
11119
|
*
|
|
11121
11120
|
*/
|
|
11122
11121
|
|
|
11123
|
-
function
|
|
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}
|
|
11124
11123
|
|
|
11125
11124
|
/**
|
|
11126
11125
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -11130,7 +11129,7 @@ function h(e,n){const t=n.body?n.body.childNodes:[];let o=[];const l=[];for(let
|
|
|
11130
11129
|
*
|
|
11131
11130
|
*/
|
|
11132
11131
|
|
|
11133
|
-
const
|
|
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))}
|
|
11134
11133
|
|
|
11135
11134
|
const useEditorStyles = makeStyles()((theme, { hasFocus, hasContent, readOnly, hasCustomToolbar }) => ({
|
|
11136
11135
|
root: {
|
|
@@ -11227,7 +11226,7 @@ function StyleWrapperPlugin({ showCharcount, helperText, readOnly, classes, labe
|
|
|
11227
11226
|
});
|
|
11228
11227
|
const [charCount, setCharCount] = useState(0);
|
|
11229
11228
|
useEffect(() => {
|
|
11230
|
-
return
|
|
11229
|
+
return j(editor.registerCommand(BLUR_COMMAND, () => {
|
|
11231
11230
|
setFocused(editor.getRootElement() === document.activeElement);
|
|
11232
11231
|
return false;
|
|
11233
11232
|
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(FOCUS_COMMAND, () => {
|
|
@@ -11309,7 +11308,7 @@ const htmlExportMap = new Map([
|
|
|
11309
11308
|
},
|
|
11310
11309
|
],
|
|
11311
11310
|
[
|
|
11312
|
-
|
|
11311
|
+
Et,
|
|
11313
11312
|
(editor, node) => {
|
|
11314
11313
|
const headingNode = node;
|
|
11315
11314
|
const element = headingNode.createDOM(editor._config);
|
|
@@ -11373,7 +11372,7 @@ function ModifyPastePlugin({ blockPasting, stripPastedStyles, }) {
|
|
|
11373
11372
|
function PreventNewlinesPlugin({ disableNewlines, }) {
|
|
11374
11373
|
const [editor] = useLexicalComposerContext();
|
|
11375
11374
|
if (disableNewlines) {
|
|
11376
|
-
|
|
11375
|
+
j(editor.registerNodeTransform(RootNode, (rootNode) => {
|
|
11377
11376
|
if (rootNode.getChildrenSize() <= 1)
|
|
11378
11377
|
return;
|
|
11379
11378
|
rootNode.getLastChild()?.remove();
|
|
@@ -11484,10 +11483,10 @@ function getSelectedNode(selection) {
|
|
|
11484
11483
|
}
|
|
11485
11484
|
const isBackward = selection.isBackward();
|
|
11486
11485
|
if (isBackward) {
|
|
11487
|
-
return
|
|
11486
|
+
return A(focus) ? anchorNode : focusNode;
|
|
11488
11487
|
}
|
|
11489
11488
|
else {
|
|
11490
|
-
return
|
|
11489
|
+
return A(anchor) ? anchorNode : focusNode;
|
|
11491
11490
|
}
|
|
11492
11491
|
}
|
|
11493
11492
|
|
|
@@ -11572,7 +11571,7 @@ function TextFormatFloatingToolbar({ editor, anchorElem, isBold, isItalic, butto
|
|
|
11572
11571
|
editor.getEditorState().read(() => {
|
|
11573
11572
|
updateTextFormatFloatingToolbar();
|
|
11574
11573
|
});
|
|
11575
|
-
return
|
|
11574
|
+
return j(editor.registerUpdateListener(({ editorState }) => {
|
|
11576
11575
|
editorState.read(() => {
|
|
11577
11576
|
updateTextFormatFloatingToolbar();
|
|
11578
11577
|
});
|
|
@@ -11638,7 +11637,7 @@ function useFloatingTextFormatToolbar(editor, anchorElem, buttons, CustomToolbar
|
|
|
11638
11637
|
};
|
|
11639
11638
|
}, [updatePopup]);
|
|
11640
11639
|
useEffect(() => {
|
|
11641
|
-
return
|
|
11640
|
+
return j(editor.registerUpdateListener(() => {
|
|
11642
11641
|
updatePopup();
|
|
11643
11642
|
}), editor.registerRootListener(() => {
|
|
11644
11643
|
if (editor.getRootElement() === null) {
|
|
@@ -11675,7 +11674,7 @@ function InsertDataPlugin({ html }) {
|
|
|
11675
11674
|
}
|
|
11676
11675
|
const dom = parser.parseFromString(html, 'text/html');
|
|
11677
11676
|
editor.update(() => {
|
|
11678
|
-
const nodes =
|
|
11677
|
+
const nodes = m(editor, dom);
|
|
11679
11678
|
$insertNodes(nodes);
|
|
11680
11679
|
});
|
|
11681
11680
|
}, []);
|
|
@@ -11698,12 +11697,12 @@ function HeadingPlugin({ html }) {
|
|
|
11698
11697
|
// Only replace if tag is heading.
|
|
11699
11698
|
if (tag) {
|
|
11700
11699
|
editor.registerNodeTransform(ParagraphNode, (node) => {
|
|
11701
|
-
node.replace(
|
|
11700
|
+
node.replace(At(`${tag}`));
|
|
11702
11701
|
});
|
|
11703
11702
|
}
|
|
11704
11703
|
else {
|
|
11705
11704
|
// Replace a heading with paragraph
|
|
11706
|
-
editor.registerNodeTransform(
|
|
11705
|
+
editor.registerNodeTransform(Et, (node) => {
|
|
11707
11706
|
node.replace($createParagraphNode(), true);
|
|
11708
11707
|
});
|
|
11709
11708
|
}
|
|
@@ -11745,8 +11744,7 @@ const allowBoldItalic = (node) => {
|
|
|
11745
11744
|
node.hasFormat('underline'))) {
|
|
11746
11745
|
node.setFormat('italic');
|
|
11747
11746
|
}
|
|
11748
|
-
else if (node.hasFormat('
|
|
11749
|
-
node.hasFormat('code') ||
|
|
11747
|
+
else if (node.hasFormat('code') ||
|
|
11750
11748
|
node.hasFormat('highlight') ||
|
|
11751
11749
|
node.hasFormat('strikethrough') ||
|
|
11752
11750
|
node.hasFormat('subscript') ||
|
|
@@ -11854,7 +11852,7 @@ function Editor({ html, label, classes, autoFocus, helperText, showCharCount, al
|
|
|
11854
11852
|
theme,
|
|
11855
11853
|
editable: !readOnly,
|
|
11856
11854
|
onError,
|
|
11857
|
-
nodes: [
|
|
11855
|
+
nodes: [Et],
|
|
11858
11856
|
html: {
|
|
11859
11857
|
export: htmlExportMap,
|
|
11860
11858
|
},
|