arengibook 3.2.3-main → 3.2.4-main
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 +124 -9
- package/dist/index.js +322 -136
- package/package.json +1 -1
- package/dist/arengibook.css +0 -1
- package/dist/arengibook.svg +0 -9
- package/dist/index.cjs.js +0 -2149
- package/dist/index.es.js +0 -34339
- package/dist/vite.svg +0 -1
package/dist/index.js
CHANGED
|
@@ -60506,7 +60506,7 @@ var TreeSelectMaquettePresets = {
|
|
|
60506
60506
|
}
|
|
60507
60507
|
};
|
|
60508
60508
|
|
|
60509
|
-
var css_248z$1 = ".expression-editor {\n width: 100%;\n}\n.expression-
|
|
60509
|
+
var css_248z$1 = ".expression-editor {\n width: 100%;\n font-family: \"Roboto\", Arial, sans-serif !important;\n}\n.expression-editor .tagify {\n width: 100%;\n min-height: 42px;\n margin-bottom: 10px;\n background-color: #ffffff !important;\n font-family: \"Roboto\", Arial, sans-serif !important;\n}\n.expression-editor .tagify .tagify__input {\n background-color: #ffffff !important;\n font-family: \"Roboto\", Arial, sans-serif !important;\n font-size: 14px !important;\n font-weight: 500 !important;\n}\n.expression-editor .tagify .tagify__tag {\n margin: 3px 6px 3px 0 !important;\n font-family: \"Roboto\", Arial, sans-serif !important;\n}\n.expression-editor__error {\n font-size: 12px;\n color: #9a3b3b;\n background: #fbeaea;\n border: 1px solid #e3b8b8;\n border-radius: 6px;\n padding: 6px 10px;\n margin-bottom: 8px;\n}\n.expression-editor__field-row {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n}\n.expression-editor__field-row .tagify {\n flex: 1 1 auto;\n}\n.expression-editor__add-btn {\n flex: 0 0 auto;\n width: 30px;\n height: 30px;\n margin-top: 1px;\n border: none;\n border-radius: 50%;\n background: #d8e6fb;\n color: #1c4f9e;\n font-size: 18px;\n font-weight: 700;\n line-height: 1;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n transition: background-color 0.13s ease-out, color 0.13s ease-out;\n}\n.expression-editor__add-btn:hover {\n background: #1c4f9e;\n color: #fff;\n}\n.expression-editor__hint {\n font-size: 12px;\n color: #5a6b85;\n font-style: italic;\n margin-bottom: 6px;\n}\n.expression-editor__palette {\n display: flex;\n justify-content: flex-start;\n gap: 12px;\n}\n\n.ee-palette-col {\n display: flex;\n flex-direction: column;\n}\n.ee-palette-col--refs {\n flex: 0 1 320px;\n}\n.ee-palette-col--ops {\n flex: 0 0 200px;\n}\n.ee-palette-col__title {\n font-family: \"Roboto\", Arial, sans-serif !important;\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n color: #5a6b85;\n margin-bottom: 4px;\n}\n\n.ee-list {\n width: 100%;\n max-height: 220px;\n overflow-y: auto;\n border: 1px solid #c6d4e8;\n border-radius: 6px;\n padding: 4px;\n background: #fff;\n box-sizing: border-box;\n}\n\n.ee-list-group__label {\n font-family: \"Roboto\", Arial, sans-serif !important;\n font-weight: 600;\n color: #344054;\n font-size: 12px;\n padding: 4px 8px 2px;\n}\n.ee-list-group__label--sub {\n padding-left: 16px;\n font-size: 11px;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n}\n\n.ee-list-item {\n display: flex;\n align-items: center;\n padding: 4px 6px 4px 8px;\n margin: 1px 0;\n border-radius: 4px;\n cursor: pointer;\n font-family: \"Roboto\", Arial, sans-serif !important;\n font-size: 13px;\n color: #344054 !important;\n user-select: none;\n}\n.ee-list-item:hover {\n background: #eef3fc !important;\n color: #344054 !important;\n}\n.ee-list-item__label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: inherit !important;\n}\n.ee-list-item__label--op {\n font-family: \"Roboto\", Arial, sans-serif !important;\n font-size: 14px !important;\n font-weight: 700 !important;\n}\n\n.ee-opt--field, .ee-opt--field:hover {\n color: #187a41 !important;\n}\n\n.ee-opt--echelle, .ee-opt--echelle:hover {\n color: #1c4f9e !important;\n}\n\n.ee-opt--evalglobal, .ee-opt--evalglobal:hover {\n color: #6b21a8 !important;\n}\n\n.tagify__tag.tag-field {\n --tag-bg: #d9f2e1;\n --tag-text-color: #187a41;\n --tag-hover: #c2eacf;\n}\n.tagify__tag.tag-echelle {\n --tag-bg: #d8e6fb;\n --tag-text-color: #1c4f9e;\n --tag-hover: #c3d9f7;\n}\n.tagify__tag.tag-echelle.tag-editing {\n --tag-bg: #9fc2f4;\n box-shadow: 0 0 0 2px #1c4f9e inset;\n}\n.tagify__tag.tag-evalglobal {\n --tag-bg: #ecdcfb;\n --tag-text-color: #6b21a8;\n --tag-hover: #e1c9f7;\n}\n\n.tagify__dropdown__item.ee-list-item {\n margin: 1px;\n}\n\n.expression-editor__menu {\n position: fixed;\n z-index: 99999;\n background: #fff;\n border: 1px solid #c6d4e8;\n border-radius: 8px;\n box-shadow: 0 6px 20px rgba(13, 59, 138, 0.18);\n padding: 8px;\n width: 300px;\n max-height: 360px;\n overflow-y: auto;\n font-family: \"Roboto\", Arial, sans-serif !important;\n}\n.expression-editor__menu .ee-list-group:not(:first-child) {\n margin-top: 6px;\n border-top: 1px solid #eef1f6;\n padding-top: 4px;\n}\n\n.ee-scores-popover {\n position: absolute;\n z-index: 99999;\n background: #fff;\n border: 1px solid #c6d4e8;\n border-radius: 8px;\n box-shadow: 0 6px 20px rgba(13, 59, 138, 0.18);\n padding: 12px 14px;\n min-width: 230px;\n font-family: \"Roboto\", Arial, sans-serif !important;\n}\n.ee-scores-popover__title {\n font-size: 13px;\n font-weight: 600;\n color: #1c4f9e;\n margin-bottom: 8px;\n}\n.ee-scores-popover__inputs {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n margin-bottom: 10px;\n}\n.ee-scores-popover__inputs label {\n display: flex;\n flex-direction: column;\n font-size: 11px;\n color: #5a6b85;\n}\n.ee-scores-popover__inputs input {\n width: 64px;\n padding: 3px 6px;\n border: 1px solid #c6d4e8;\n border-radius: 4px;\n}\n.ee-scores-popover__actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n.ee-scores-popover__actions button {\n padding: 4px 12px;\n border-radius: 4px;\n border: 1px solid #c6d4e8;\n background: #fff;\n cursor: pointer;\n}\n.ee-scores-popover__actions button.ee-ok {\n background: #1c4f9e;\n border-color: #1c4f9e;\n color: #fff;\n}";
|
|
60510
60510
|
styleInject(css_248z$1);
|
|
60511
60511
|
|
|
60512
60512
|
var css_248z = "@charset \"UTF-8\";:root{--tagify-dd-color-primary:rgb(53,149,246);--tagify-dd-text-color:black;--tagify-dd-bg-color:white;--tagify-dd-item-pad:.3em .5em;--tagify-dd-max-height:300px}.tagify{--tags-disabled-bg:#F1F1F1;--tags-border-color:#DDD;--tags-hover-border-color:#CCC;--tags-focus-border-color:#3595f6;--tag-border-radius:3px;--tag-bg:#E5E5E5;--tag-hover:#D3E2E2;--tag-text-color:black;--tag-text-color--edit:black;--tag-pad:0.3em 0.5em;--tag-inset-shadow-size:1.2em;--tag-invalid-color:#D39494;--tag-invalid-bg:rgba(211, 148, 148, 0.5);--tag--min-width:1ch;--tag--max-width:100%;--tag-hide-transition:0.3s;--tag-remove-bg:rgba(211, 148, 148, 0.3);--tag-remove-btn-color:black;--tag-remove-btn-bg:none;--tag-remove-btn-bg--hover:#c77777;--input-color:inherit;--placeholder-color:rgba(0, 0, 0, 0.4);--placeholder-color-focus:rgba(0, 0, 0, 0.25);--loader-size:.8em;--readonly-striped:1;display:inline-flex;align-items:flex-start;align-content:baseline;flex-wrap:wrap;border:1px solid var(--tags-border-color);padding:0;line-height:0;outline:0;position:relative;box-sizing:border-box;transition:.1s}@keyframes tags--bump{30%{transform:scale(1.2)}}@keyframes rotateLoader{to{transform:rotate(1turn)}}.tagify:has([contenteditable=true]){cursor:text}.tagify:hover:not(.tagify--focus):not(.tagify--invalid){--tags-border-color:var(--tags-hover-border-color)}.tagify[disabled]{background:var(--tags-disabled-bg);filter:saturate(0);opacity:.5;pointer-events:none}.tagify[disabled].tagify--empty>.tagify__input::before{position:relative}.tagify[disabled].tagify--select,.tagify[readonly].tagify--select{pointer-events:none}.tagify[disabled]:not(.tagify--mix):not(.tagify--select):not(.tagify--empty),.tagify[readonly]:not(.tagify--mix):not(.tagify--select):not(.tagify--empty){cursor:default}.tagify[disabled]:not(.tagify--mix):not(.tagify--select):not(.tagify--empty)>.tagify__input,.tagify[readonly]:not(.tagify--mix):not(.tagify--select):not(.tagify--empty)>.tagify__input{visibility:hidden;width:0;margin:5px 0}.tagify[disabled]:not(.tagify--mix):not(.tagify--select):not(.tagify--empty) .tagify__tag>div,.tagify[readonly]:not(.tagify--mix):not(.tagify--select):not(.tagify--empty) .tagify__tag>div{padding:var(--tag-pad)}.tagify[disabled]:not(.tagify--mix):not(.tagify--select):not(.tagify--empty) .tagify__tag>div::before,.tagify[readonly]:not(.tagify--mix):not(.tagify--select):not(.tagify--empty) .tagify__tag>div::before{animation:readonlyStyles 1s calc(-1s * (var(--readonly-striped) - 1)) paused}@keyframes readonlyStyles{0%{background:linear-gradient(45deg,var(--tag-bg) 25%,transparent 25%,transparent 50%,var(--tag-bg) 50%,var(--tag-bg) 75%,transparent 75%,transparent) 0/5px 5px;box-shadow:none;filter:brightness(.95)}}.tagify[disabled] .tagify__tag__removeBtn,.tagify[readonly] .tagify__tag__removeBtn{display:none}.tagify--loading .tagify__input>br:last-child{display:none}.tagify--loading .tagify__input::before{content:none}.tagify--loading .tagify__input::after{content:\"\";vertical-align:middle;opacity:1;width:.7em;height:.7em;width:var(--loader-size);height:var(--loader-size);min-width:0;border:3px solid;border-color:#eee #bbb #888 transparent;border-radius:50%;animation:rotateLoader .4s infinite linear;content:\"\"!important;margin:-2px 0 -2px .5em}.tagify--loading .tagify__input:empty::after{margin-left:0}.tagify+input,.tagify+textarea{position:absolute!important;left:-9999em!important;transform:scale(0)!important}.tagify__tag{display:inline-flex;align-items:center;max-width:var(--tag--max-width);margin-inline:5px 0;margin-block:5px;position:relative;z-index:1;outline:0;line-height:normal;cursor:default;transition:.13s ease-out}.tagify__tag:last-child{margin-right:5px}.tagify__tag>div{display:flex;flex:1;vertical-align:top;box-sizing:border-box;max-width:100%;padding:var(--tag-pad);color:var(--tag-text-color);line-height:inherit;border-radius:var(--tag-border-radius);white-space:nowrap;transition:.13s ease-out}.tagify__tag>div>*{white-space:pre-wrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;vertical-align:top;min-width:var(--tag--min-width);max-width:var(--tag--max-width);transition:.8s ease,.1s color}.tagify__tag>div>[contenteditable]{display:block;outline:0;-webkit-user-select:text;-moz-user-select:text;user-select:text;cursor:text;margin:-2px;padding:2px;max-width:350px}.tagify__tag>div>:only-child{width:100%}.tagify__tag>div::before{content:\"\";position:absolute;border-radius:inherit;inset:var(--tag-bg-inset,0);z-index:-1;pointer-events:none;transition:120ms ease;animation:tags--bump .3s ease-out 1;box-shadow:0 0 0 var(--tag-inset-shadow-size) var(--tag-bg) inset}.tagify__tag:focus div::before,.tagify__tag:hover:not([readonly]) div::before{--tag-bg-inset:-2.5px;--tag-bg:var(--tag-hover)}.tagify__tag--loading{pointer-events:none}.tagify__tag--loading .tagify__tag__removeBtn{display:none}.tagify__tag--loading::after{--loader-size:.4em;content:\"\";vertical-align:middle;opacity:1;width:.7em;height:.7em;width:var(--loader-size);height:var(--loader-size);min-width:0;border:3px solid;border-color:#eee #bbb #888 transparent;border-radius:50%;animation:rotateLoader .4s infinite linear;margin:0 .5em 0 -.1em}.tagify__tag--flash div::before{animation:none}.tagify__tag--hide{width:0!important;padding-left:0;padding-right:0;margin-left:0;margin-right:0;opacity:0;transform:scale(0);transition:var(--tag-hide-transition);pointer-events:none}.tagify__tag--hide>div>*{white-space:nowrap}.tagify__tag.tagify--noAnim>div::before{animation:none}.tagify__tag.tagify--notAllowed:not(.tagify__tag--editable) div>span{opacity:.5}.tagify__tag.tagify--notAllowed:not(.tagify__tag--editable) div::before{--tag-bg:var(--tag-invalid-bg);transition:.2s}.tagify__tag[readonly] .tagify__tag__removeBtn{display:none}.tagify__tag[readonly]>div::before{animation:readonlyStyles 1s calc(-1s * (var(--readonly-striped) - 1)) paused}@keyframes readonlyStyles{0%{background:linear-gradient(45deg,var(--tag-bg) 25%,transparent 25%,transparent 50%,var(--tag-bg) 50%,var(--tag-bg) 75%,transparent 75%,transparent) 0/5px 5px;box-shadow:none;filter:brightness(.95)}}.tagify__tag--editable>div{color:var(--tag-text-color--edit)}.tagify__tag--editable>div::before{box-shadow:0 0 0 2px var(--tag-hover) inset!important}.tagify__tag--editable>.tagify__tag__removeBtn{pointer-events:none;opacity:0;transform:translateX(100%) translateX(5px)}.tagify__tag--editable.tagify--invalid>div::before{box-shadow:0 0 0 2px var(--tag-invalid-color) inset!important}.tagify__tag__removeBtn{order:5;display:inline-flex;align-items:center;justify-content:center;border-radius:50px;cursor:pointer;font:14px/1 Arial;background:var(--tag-remove-btn-bg);color:var(--tag-remove-btn-color);width:14px;height:14px;margin-inline:auto 4.6666666667px;overflow:hidden;transition:.2s ease-out}.tagify__tag__removeBtn::after{content:\"×\";transition:.3s,color 0s}.tagify__tag__removeBtn:hover{color:#fff;background:var(--tag-remove-btn-bg--hover)}.tagify__tag__removeBtn:hover+div>span{opacity:.5}.tagify__tag__removeBtn:hover+div::before{box-shadow:0 0 0 var(--tag-inset-shadow-size) var(--tag-remove-bg,rgba(211,148,148,.3)) inset!important;transition:box-shadow .2s}.tagify:not(.tagify--mix) .tagify__input br{display:none}.tagify:not(.tagify--mix) .tagify__input *{display:inline;white-space:nowrap}.tagify__input{display:inline-block;margin:5px;padding:var(--tag-pad);line-height:normal;min-width:-moz-fit-content;min-width:fit-content;min-height:1.5lh;position:relative;white-space:pre-wrap;color:var(--input-color);box-sizing:inherit;overflow:hidden}.tagify__input:focus{outline:0}.tagify__input:last-child{flex-grow:1;min-width:110px}.tagify__input:last-child:focus::before{transition:.2s ease-out;opacity:0;transform:translateX(6px)}@supports (-ms-ime-align:auto){.tagify__input:last-child:focus::before{display:none}}.tagify__input:last-child:focus:empty::before{transition:.2s ease-out;opacity:1;transform:none;color:rgba(0,0,0,.25);color:var(--placeholder-color-focus)}@-moz-document url-prefix(){.tagify__input:last-child:focus:empty::after{display:none}}.tagify__input:last-child::before{content:attr(data-placeholder)}.tagify__input::before{width:100%;height:100%;margin:auto 0;z-index:1;color:var(--placeholder-color);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;pointer-events:none;opacity:0;position:absolute}.tagify__input::after{content:attr(data-suggest);display:inline-block;vertical-align:middle;position:absolute;min-width:calc(100% - 1.5em);text-overflow:ellipsis;overflow:hidden;white-space:pre;color:var(--tag-text-color);opacity:.3;pointer-events:none;max-width:100px}.tagify__input .tagify__tag{margin:0 1px}.tagify--mix{display:block}.tagify--mix .tagify__input{padding:5px;margin:0;width:100%;height:100%;line-height:1.5;display:block}.tagify--mix .tagify__input::before{height:auto;display:none;line-height:inherit}.tagify--mix .tagify__input::after{content:none}.tagify--select{cursor:default}.tagify--select::after{content:\">\";opacity:.5;position:absolute;top:50%;right:0;bottom:0;font:16px monospace;line-height:8px;height:8px;pointer-events:none;transform:translate(-150%,-50%) scaleX(1.2) rotate(90deg);transition:.2s ease-in-out}.tagify--select[aria-expanded=true]::after{transform:translate(-150%,-50%) rotate(270deg) scaleY(1.2)}.tagify--select[aria-expanded=true] .tagify__tag__removeBtn{pointer-events:none;opacity:0;transform:translateX(100%) translateX(5px)}.tagify--select .tagify__tag{flex:1;max-width:none;margin-inline-end:2em;margin-block:0;padding-block:5px;cursor:text}.tagify--select .tagify__tag div::before{display:none}.tagify--select .tagify__tag+.tagify__input{display:none}.tagify--empty .tagify__input::before{transition:.2s ease-out;opacity:1;transform:none;display:inline-block;width:auto}.tagify--mix .tagify--empty .tagify__input::before{display:inline-block}.tagify--focus{--tags-border-color:var(--tags-focus-border-color);transition:0s}.tagify--invalid{--tags-border-color:#D39494}.tagify__dropdown{position:absolute;z-index:9999;transform:translateY(-1px);border-top:1px solid var(--tagify-dd-color-primary);overflow:hidden}.tagify__dropdown[dir=rtl]{transform:translate(-100%,-1px)}.tagify__dropdown[placement=top]{margin-top:0;transform:translateY(-100%)}.tagify__dropdown[placement=top] .tagify__dropdown__wrapper{border-top-width:1.1px;border-bottom-width:0}.tagify__dropdown[position=text]{box-shadow:0 0 0 3px rgba(var(--tagify-dd-color-primary),.1);font-size:.9em}.tagify__dropdown[position=text] .tagify__dropdown__wrapper{border-width:1px}.tagify__dropdown__wrapper{scroll-behavior:auto;max-height:var(--tagify-dd-max-height);overflow:hidden;overflow-x:hidden;color:var(--tagify-dd-text-color);background:var(--tagify-dd-bg-color);border:1px solid;border-color:var(--tagify-dd-color-primary);border-bottom-width:1.5px;border-top-width:0;box-shadow:0 2px 4px -2px rgba(0,0,0,.2);transition:.3s cubic-bezier(.5,0,.3,1),transform .15s;animation:dd-wrapper-show 0s .3s forwards}@keyframes dd-wrapper-show{to{overflow-y:auto}}.tagify__dropdown__header:empty{display:none}.tagify__dropdown__footer{display:inline-block;margin-top:.5em;padding:var(--tagify-dd-item-pad);font-size:.7em;font-style:italic;opacity:.5}.tagify__dropdown__footer:empty{display:none}.tagify__dropdown--initial .tagify__dropdown__wrapper{max-height:20px;transform:translateY(-1em)}.tagify__dropdown--initial[placement=top] .tagify__dropdown__wrapper{transform:translateY(2em)}.tagify__dropdown__item{box-sizing:border-box;padding:var(--tagify-dd-item-pad);margin:1px;white-space:pre-wrap;cursor:pointer;border-radius:2px;position:relative;outline:0;max-height:60px;max-width:100%;line-height:normal;position:relative}.tagify__dropdown__item--active{background:var(--tagify-dd-color-primary);color:#fff}.tagify__dropdown__item:active{filter:brightness(105%)}.tagify__dropdown__item--hidden{padding-top:0;padding-bottom:0;margin:0 1px;pointer-events:none;overflow:hidden;max-height:0;transition:var(--tagify-dd-item--hidden-duration,.3s)!important}.tagify__dropdown__item--hidden>*{transform:translateY(-100%);opacity:0;transition:inherit}.tagify__dropdown__item--selected::before{content:\"✓\";font-family:monospace;position:absolute;inset-inline-start:6px;text-indent:0;line-height:1.1}.tagify__dropdown:has(.tagify__dropdown__item--selected) .tagify__dropdown__item{text-indent:1em}";
|
|
@@ -62799,19 +62799,6 @@ N.prototype = {
|
|
|
62799
62799
|
}
|
|
62800
62800
|
}, N.prototype.removeTag = N.prototype.removeTags;
|
|
62801
62801
|
|
|
62802
|
-
/**
|
|
62803
|
-
* Éditeur d'expression de calcul en mode mixte texte + tags (Tagify).
|
|
62804
|
-
*
|
|
62805
|
-
* Les références au modèle (échelles complémentaires « field » et grilles « echelle ») sont
|
|
62806
|
-
* des TAGS insécables ; le reste (opérateurs, fonctions, nombres) est du texte libre.
|
|
62807
|
-
*
|
|
62808
|
-
* Le composant ne connaît QUE le format moteur en entrée/sortie :
|
|
62809
|
-
* - value : "field(42) + echelle(main, 'abs', [1, 2, 3, 4])"
|
|
62810
|
-
* - onChange : rappelé avec l'expression au même format à chaque modification.
|
|
62811
|
-
* La conversion vers/depuis les tags Tagify ([[{json}]]) est interne.
|
|
62812
|
-
*/
|
|
62813
|
-
|
|
62814
|
-
// --- Sérialisation d'un tag -> fragment d'expression au format moteur ---
|
|
62815
62802
|
var serializeTagData = function serializeTagData(d) {
|
|
62816
62803
|
if (d.refType === 'field') {
|
|
62817
62804
|
return "field(".concat(d.refId, ")");
|
|
@@ -62824,9 +62811,6 @@ var serializeTagData = function serializeTagData(d) {
|
|
|
62824
62811
|
}
|
|
62825
62812
|
return d.value || '';
|
|
62826
62813
|
};
|
|
62827
|
-
|
|
62828
|
-
// --- Valeur mixte Tagify ([[{json}]] + texte) -> expression moteur ---
|
|
62829
|
-
// Parse incrémental : un JSON de tag peut contenir "]]", qui casserait un regex non-greedy.
|
|
62830
62814
|
var tagifyMixToExpression = function tagifyMixToExpression(mix) {
|
|
62831
62815
|
var out = '';
|
|
62832
62816
|
var i = 0;
|
|
@@ -62856,12 +62840,23 @@ var tagifyMixToExpression = function tagifyMixToExpression(mix) {
|
|
|
62856
62840
|
out += serializeTagData(parsed);
|
|
62857
62841
|
i = end + 2;
|
|
62858
62842
|
}
|
|
62859
|
-
|
|
62860
|
-
|
|
62861
|
-
|
|
62843
|
+
return out.replace(/ /g, ' ').replace(//g, '').trim();
|
|
62844
|
+
};
|
|
62845
|
+
var getCaretRangeAtVisualEnd = function getCaretRangeAtVisualEnd(tagify) {
|
|
62846
|
+
var input = tagify.DOM.input;
|
|
62847
|
+
var range = document.createRange();
|
|
62848
|
+
var last = input.lastChild;
|
|
62849
|
+
if (last && last.nodeName === 'BR') {
|
|
62850
|
+
last = last.previousSibling;
|
|
62851
|
+
}
|
|
62852
|
+
if (last) {
|
|
62853
|
+
range.setStartAfter(last);
|
|
62854
|
+
} else {
|
|
62855
|
+
range.setStart(input, 0);
|
|
62856
|
+
}
|
|
62857
|
+
range.collapse(true);
|
|
62858
|
+
return range;
|
|
62862
62859
|
};
|
|
62863
|
-
|
|
62864
|
-
// --- Expression moteur -> valeur mixte Tagify (les références deviennent des [[{json}]]) ---
|
|
62865
62860
|
var expressionToTagifyMix = function expressionToTagifyMix(expr, whitelist) {
|
|
62866
62861
|
expr = expr || '';
|
|
62867
62862
|
expr = expr.replace(/field\(\s*(\d+)\s*\)/g, function (m, id) {
|
|
@@ -62898,30 +62893,51 @@ var ExpressionEditor = function ExpressionEditor(_ref) {
|
|
|
62898
62893
|
var _ref$references = _ref.references,
|
|
62899
62894
|
references = _ref$references === void 0 ? [] : _ref$references,
|
|
62900
62895
|
_ref$operators = _ref.operators,
|
|
62901
|
-
operators = _ref$operators === void 0 ? ['+', '-', '*', '/', '%', 'min(
|
|
62896
|
+
operators = _ref$operators === void 0 ? ['+', '-', '*', '/', '%', 'min(a, b)', 'max(a, b)', 'avg(a, b)', 'sum(a, b)', 'round(x)', 'ceil(x)', 'floor(x)'] : _ref$operators,
|
|
62902
62897
|
_ref$value = _ref.value,
|
|
62903
62898
|
value = _ref$value === void 0 ? '' : _ref$value,
|
|
62904
62899
|
onChange = _ref.onChange,
|
|
62905
62900
|
_ref$targetInputId = _ref.targetInputId,
|
|
62906
62901
|
targetInputId = _ref$targetInputId === void 0 ? null : _ref$targetInputId,
|
|
62907
62902
|
_ref$placeholder = _ref.placeholder,
|
|
62908
|
-
placeholder = _ref$placeholder === void 0 ? "
|
|
62903
|
+
placeholder = _ref$placeholder === void 0 ? "Cliquez sur « + » ou tapez « @ » pour insérer une référence…" : _ref$placeholder;
|
|
62909
62904
|
var textareaRef = useRef(null);
|
|
62910
62905
|
var tagifyRef = useRef(null);
|
|
62906
|
+
var addBtnRef = useRef(null);
|
|
62907
|
+
var menuRef = useRef(null);
|
|
62911
62908
|
var onChangeRef = useRef(onChange);
|
|
62912
62909
|
onChangeRef.current = onChange;
|
|
62913
62910
|
var _useState = useState(null),
|
|
62914
62911
|
_useState2 = _slicedToArray$b(_useState, 2),
|
|
62915
62912
|
popover = _useState2[0],
|
|
62916
|
-
setPopover = _useState2[1];
|
|
62917
|
-
|
|
62918
|
-
|
|
62913
|
+
setPopover = _useState2[1];
|
|
62914
|
+
var _useState3 = useState(null),
|
|
62915
|
+
_useState4 = _slicedToArray$b(_useState3, 2),
|
|
62916
|
+
initError = _useState4[0],
|
|
62917
|
+
setInitError = _useState4[1];
|
|
62918
|
+
var _useState5 = useState(null),
|
|
62919
|
+
_useState6 = _slicedToArray$b(_useState5, 2),
|
|
62920
|
+
menuPos = _useState6[0],
|
|
62921
|
+
setMenuPos = _useState6[1];
|
|
62919
62922
|
var whitelist = useMemo(function () {
|
|
62920
62923
|
return references;
|
|
62921
62924
|
}, [references]);
|
|
62925
|
+
var tagifyWhitelist = useMemo(function () {
|
|
62926
|
+
return [].concat(_toConsumableArray$8(whitelist.map(function (ref) {
|
|
62927
|
+
return _objectSpread2(_objectSpread2({}, ref), {}, {
|
|
62928
|
+
section: 'refs'
|
|
62929
|
+
});
|
|
62930
|
+
})), _toConsumableArray$8(operators.map(function (op) {
|
|
62931
|
+
return {
|
|
62932
|
+
value: op,
|
|
62933
|
+
refType: 'operator',
|
|
62934
|
+
"class": 'tag-operator',
|
|
62935
|
+
section: 'ops'
|
|
62936
|
+
};
|
|
62937
|
+
})));
|
|
62938
|
+
}, [whitelist, operators]);
|
|
62922
62939
|
var emitChange = useCallback(function (mixValue) {
|
|
62923
62940
|
var expression = tagifyMixToExpression(mixValue);
|
|
62924
|
-
// Intégration Symfony : on alimente l'input caché du formulaire (champ réellement soumis)
|
|
62925
62941
|
if (targetInputId) {
|
|
62926
62942
|
var target = document.getElementById(targetInputId);
|
|
62927
62943
|
if (target) {
|
|
@@ -62932,85 +62948,163 @@ var ExpressionEditor = function ExpressionEditor(_ref) {
|
|
|
62932
62948
|
onChangeRef.current(expression);
|
|
62933
62949
|
}
|
|
62934
62950
|
}, [targetInputId]);
|
|
62935
|
-
|
|
62936
|
-
// Instanciation de Tagify core sur le textarea (le wrapper React officiel est cassé en v4.33)
|
|
62937
62951
|
useEffect(function () {
|
|
62938
62952
|
var el = textareaRef.current;
|
|
62939
62953
|
if (!el) {
|
|
62940
62954
|
return undefined;
|
|
62941
62955
|
}
|
|
62942
|
-
|
|
62943
|
-
|
|
62944
|
-
|
|
62945
|
-
|
|
62946
|
-
|
|
62947
|
-
|
|
62948
|
-
|
|
62949
|
-
|
|
62950
|
-
|
|
62951
|
-
|
|
62952
|
-
|
|
62953
|
-
|
|
62954
|
-
|
|
62955
|
-
|
|
62956
|
-
|
|
62957
|
-
|
|
62958
|
-
|
|
62959
|
-
|
|
62960
|
-
|
|
62961
|
-
|
|
62962
|
-
|
|
62963
|
-
|
|
62964
|
-
|
|
62956
|
+
var tagify;
|
|
62957
|
+
var operatorTagObserver;
|
|
62958
|
+
try {
|
|
62959
|
+
el.value = expressionToTagifyMix(value, whitelist);
|
|
62960
|
+
tagify = new N(el, {
|
|
62961
|
+
mode: 'mix',
|
|
62962
|
+
pattern: '@',
|
|
62963
|
+
duplicates: true,
|
|
62964
|
+
editTags: false,
|
|
62965
|
+
mixMode: {
|
|
62966
|
+
insertAfterTag: ' '
|
|
62967
|
+
},
|
|
62968
|
+
whitelist: tagifyWhitelist,
|
|
62969
|
+
dropdown: {
|
|
62970
|
+
enabled: 0,
|
|
62971
|
+
maxItems: 200,
|
|
62972
|
+
fuzzySearch: true,
|
|
62973
|
+
highlightFirst: true,
|
|
62974
|
+
searchKeys: ['value', 'groupe'],
|
|
62975
|
+
includeSelectedTags: true
|
|
62976
|
+
},
|
|
62977
|
+
templates: {
|
|
62978
|
+
dropdownItem: function dropdownItem(item) {
|
|
62979
|
+
var list = this.suggestedListItems || [];
|
|
62980
|
+
var itemKey = function itemKey(it) {
|
|
62981
|
+
return "".concat(it.section || '', "|").concat(it.groupe || '', "|").concat(it.value);
|
|
62982
|
+
};
|
|
62983
|
+
var idx = list.findIndex(function (it) {
|
|
62984
|
+
return itemKey(it) === itemKey(item);
|
|
62985
|
+
});
|
|
62986
|
+
var prev = idx > 0 ? list[idx - 1] : null;
|
|
62987
|
+
var headers = '';
|
|
62988
|
+
if (!prev || prev.section !== item.section) {
|
|
62989
|
+
headers += "<div class=\"ee-list-group__label\">".concat(item.section === 'ops' ? 'Opérateurs & fonctions' : 'Échelles & grilles', "</div>");
|
|
62990
|
+
}
|
|
62991
|
+
if (item.section === 'refs') {
|
|
62992
|
+
var groupe = item.groupe || '';
|
|
62993
|
+
var prevGroupe = prev && prev.section === 'refs' ? prev.groupe || '' : null;
|
|
62994
|
+
if (groupe && prevGroupe !== groupe) {
|
|
62995
|
+
headers += "<div class=\"ee-list-group__label ee-list-group__label--sub\">".concat(groupe, "</div>");
|
|
62996
|
+
}
|
|
62997
|
+
}
|
|
62998
|
+
var labelClass = item.refType === 'operator' ? 'ee-list-item__label ee-list-item__label--op' : 'ee-list-item__label';
|
|
62999
|
+
return "".concat(headers, "<div ").concat(this.getAttributes(item), " class=\"").concat(this.settings.classNames.dropdownItem, " ee-list-item ee-opt--").concat(item.refType, "\" tabindex=\"0\" role=\"option\">\n <span class=\"").concat(labelClass, "\">").concat(item.value, "</span>\n </div>");
|
|
63000
|
+
}
|
|
62965
63001
|
}
|
|
62966
|
-
}
|
|
62967
|
-
|
|
62968
|
-
|
|
62969
|
-
|
|
62970
|
-
|
|
62971
|
-
|
|
62972
|
-
|
|
62973
|
-
|
|
62974
|
-
|
|
62975
|
-
|
|
62976
|
-
|
|
62977
|
-
|
|
62978
|
-
|
|
62979
|
-
|
|
62980
|
-
|
|
62981
|
-
|
|
62982
|
-
|
|
62983
|
-
|
|
62984
|
-
|
|
62985
|
-
|
|
62986
|
-
|
|
62987
|
-
|
|
62988
|
-
|
|
62989
|
-
|
|
63002
|
+
});
|
|
63003
|
+
tagify.on('change', function (e) {
|
|
63004
|
+
return emitChange(e.detail.value);
|
|
63005
|
+
});
|
|
63006
|
+
operatorTagObserver = new MutationObserver(function (mutations) {
|
|
63007
|
+
var converted = false;
|
|
63008
|
+
mutations.forEach(function (m) {
|
|
63009
|
+
m.addedNodes.forEach(function (node) {
|
|
63010
|
+
if (node.nodeType !== 1) {
|
|
63011
|
+
return;
|
|
63012
|
+
}
|
|
63013
|
+
var tagElms = node.classList && node.classList.contains('tagify__tag') ? [node] : Array.from(node.querySelectorAll ? node.querySelectorAll('.tagify__tag') : []);
|
|
63014
|
+
tagElms.forEach(function (tagElm) {
|
|
63015
|
+
var data = tagElm.__tagifyTagData;
|
|
63016
|
+
if (!data || data.refType !== 'operator') {
|
|
63017
|
+
return;
|
|
63018
|
+
}
|
|
63019
|
+
var textNode = document.createTextNode("".concat(data.value, " "));
|
|
63020
|
+
tagElm.replaceWith(textNode);
|
|
63021
|
+
var range = document.createRange();
|
|
63022
|
+
range.setStartAfter(textNode);
|
|
63023
|
+
range.collapse(true);
|
|
63024
|
+
var sel = window.getSelection();
|
|
63025
|
+
sel.removeAllRanges();
|
|
63026
|
+
sel.addRange(range);
|
|
63027
|
+
converted = true;
|
|
63028
|
+
});
|
|
63029
|
+
});
|
|
63030
|
+
});
|
|
63031
|
+
if (converted) {
|
|
63032
|
+
tagify.updateValueByDOMTags();
|
|
63033
|
+
tagify.update();
|
|
62990
63034
|
}
|
|
62991
63035
|
});
|
|
62992
|
-
|
|
62993
|
-
|
|
63036
|
+
operatorTagObserver.observe(tagify.DOM.input, {
|
|
63037
|
+
childList: true,
|
|
63038
|
+
subtree: true
|
|
63039
|
+
});
|
|
63040
|
+
tagify.on('click', function (e) {
|
|
63041
|
+
var data = e.detail.data;
|
|
63042
|
+
if (!data || data.refType !== 'echelle') {
|
|
63043
|
+
return;
|
|
63044
|
+
}
|
|
63045
|
+
var rect = e.detail.tag.getBoundingClientRect();
|
|
63046
|
+
setPopover({
|
|
63047
|
+
tag: e.detail.tag,
|
|
63048
|
+
data: data,
|
|
63049
|
+
scores: (data.scores && data.scores.length ? data.scores : Array.from({
|
|
63050
|
+
length: data.niveaux
|
|
63051
|
+
}, function (_, k) {
|
|
63052
|
+
return k + 1;
|
|
63053
|
+
})).slice(),
|
|
63054
|
+
pos: {
|
|
63055
|
+
top: rect.bottom + 6,
|
|
63056
|
+
left: rect.left
|
|
63057
|
+
}
|
|
63058
|
+
});
|
|
63059
|
+
});
|
|
63060
|
+
tagifyRef.current = tagify;
|
|
63061
|
+
} catch (err) {
|
|
63062
|
+
// eslint-disable-next-line no-console
|
|
63063
|
+
console.error('[ExpressionEditor] échec d\'initialisation Tagify :', err);
|
|
63064
|
+
setInitError(err && err.message ? err.message : String(err));
|
|
63065
|
+
}
|
|
62994
63066
|
return function () {
|
|
62995
|
-
|
|
63067
|
+
if (operatorTagObserver) {
|
|
63068
|
+
operatorTagObserver.disconnect();
|
|
63069
|
+
}
|
|
63070
|
+
if (tagify) {
|
|
63071
|
+
tagify.destroy();
|
|
63072
|
+
}
|
|
62996
63073
|
tagifyRef.current = null;
|
|
62997
63074
|
};
|
|
62998
|
-
// Monté une seule fois : whitelist/valeur figées au montage (comme un champ de formulaire)
|
|
62999
63075
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
63000
63076
|
}, []);
|
|
63001
|
-
|
|
63002
|
-
// Insertion depuis la palette (références = tags ; opérateurs = texte libre)
|
|
63003
63077
|
var insertReference = useCallback(function (ref) {
|
|
63004
63078
|
var tagify = tagifyRef.current;
|
|
63005
|
-
if (tagify) {
|
|
63006
|
-
|
|
63079
|
+
if (!tagify) {
|
|
63080
|
+
return;
|
|
63007
63081
|
}
|
|
63082
|
+
tagify.state.tag = null;
|
|
63083
|
+
var range = getCaretRangeAtVisualEnd(tagify);
|
|
63084
|
+
tagify.state.selection = {
|
|
63085
|
+
anchorOffset: range.startOffset,
|
|
63086
|
+
anchorNode: range.startContainer,
|
|
63087
|
+
range: range
|
|
63088
|
+
};
|
|
63089
|
+
tagify.addMixTags([_objectSpread2({}, ref)]);
|
|
63090
|
+
tagify.state.selection = null;
|
|
63091
|
+
tagify.state.tag = null;
|
|
63008
63092
|
}, []);
|
|
63009
63093
|
var insertOperator = useCallback(function (op) {
|
|
63010
63094
|
var tagify = tagifyRef.current;
|
|
63011
|
-
if (tagify) {
|
|
63012
|
-
|
|
63095
|
+
if (!tagify) {
|
|
63096
|
+
return;
|
|
63013
63097
|
}
|
|
63098
|
+
tagify.state.tag = null;
|
|
63099
|
+
var range = getCaretRangeAtVisualEnd(tagify);
|
|
63100
|
+
tagify.state.selection = {
|
|
63101
|
+
anchorOffset: range.startOffset,
|
|
63102
|
+
anchorNode: range.startContainer,
|
|
63103
|
+
range: range
|
|
63104
|
+
};
|
|
63105
|
+
tagify.injectAtCaret("".concat(op, " "));
|
|
63106
|
+
tagify.state.selection = null;
|
|
63107
|
+
tagify.state.tag = null;
|
|
63014
63108
|
}, []);
|
|
63015
63109
|
var validatePopoverScores = useCallback(function () {
|
|
63016
63110
|
var tagify = tagifyRef.current;
|
|
@@ -63026,13 +63120,35 @@ var ExpressionEditor = function ExpressionEditor(_ref) {
|
|
|
63026
63120
|
scores: popover.scores
|
|
63027
63121
|
}));
|
|
63028
63122
|
setPopover(null);
|
|
63029
|
-
// Tagify ne déclenche pas toujours change sur replaceTag : on force la synchro
|
|
63030
63123
|
setTimeout(function () {
|
|
63031
63124
|
return emitChange(tagify.DOM.originalInput.value);
|
|
63032
63125
|
}, 0);
|
|
63033
63126
|
}, [popover, emitChange]);
|
|
63034
|
-
|
|
63035
|
-
|
|
63127
|
+
useEffect(function () {
|
|
63128
|
+
if (!menuPos) {
|
|
63129
|
+
return undefined;
|
|
63130
|
+
}
|
|
63131
|
+
var onDocMouseDown = function onDocMouseDown(e) {
|
|
63132
|
+
if (menuRef.current && menuRef.current.contains(e.target)) {
|
|
63133
|
+
return;
|
|
63134
|
+
}
|
|
63135
|
+
if (addBtnRef.current && addBtnRef.current.contains(e.target)) {
|
|
63136
|
+
return;
|
|
63137
|
+
}
|
|
63138
|
+
setMenuPos(null);
|
|
63139
|
+
};
|
|
63140
|
+
var onKeyDown = function onKeyDown(e) {
|
|
63141
|
+
if (e.key === 'Escape') {
|
|
63142
|
+
setMenuPos(null);
|
|
63143
|
+
}
|
|
63144
|
+
};
|
|
63145
|
+
document.addEventListener('mousedown', onDocMouseDown);
|
|
63146
|
+
document.addEventListener('keydown', onKeyDown);
|
|
63147
|
+
return function () {
|
|
63148
|
+
document.removeEventListener('mousedown', onDocMouseDown);
|
|
63149
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
63150
|
+
};
|
|
63151
|
+
}, [menuPos]);
|
|
63036
63152
|
var groupedReferences = useMemo(function () {
|
|
63037
63153
|
var groups = {};
|
|
63038
63154
|
whitelist.forEach(function (ref) {
|
|
@@ -63041,68 +63157,131 @@ var ExpressionEditor = function ExpressionEditor(_ref) {
|
|
|
63041
63157
|
});
|
|
63042
63158
|
return groups;
|
|
63043
63159
|
}, [whitelist]);
|
|
63044
|
-
|
|
63045
|
-
// Double-clic sur une option d'un <select> : on retrouve la référence via son index
|
|
63046
|
-
var handleReferenceDblClick = useCallback(function (e) {
|
|
63047
|
-
if (e.target.tagName !== 'OPTION') {
|
|
63048
|
-
return;
|
|
63049
|
-
}
|
|
63050
|
-
var ref = whitelist[Number(e.target.value)];
|
|
63051
|
-
if (ref) {
|
|
63052
|
-
insertReference(ref);
|
|
63053
|
-
}
|
|
63054
|
-
}, [whitelist, insertReference]);
|
|
63055
|
-
var handleOperatorDblClick = useCallback(function (e) {
|
|
63056
|
-
if (e.target.tagName !== 'OPTION') {
|
|
63057
|
-
return;
|
|
63058
|
-
}
|
|
63059
|
-
insertOperator(e.target.value);
|
|
63060
|
-
}, [insertOperator]);
|
|
63061
63160
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
63062
63161
|
className: "expression-editor"
|
|
63162
|
+
}, initError && /*#__PURE__*/React__default.createElement("div", {
|
|
63163
|
+
className: "expression-editor__error"
|
|
63164
|
+
}, "L'\xE9diteur d'expression n'a pas pu s'initialiser (", initError, "). Le champ texte brut reste utilisable."), /*#__PURE__*/React__default.createElement("div", {
|
|
63165
|
+
className: "expression-editor__field-row"
|
|
63063
63166
|
}, /*#__PURE__*/React__default.createElement("textarea", {
|
|
63064
63167
|
ref: textareaRef,
|
|
63065
63168
|
className: "expression-editor__field",
|
|
63066
63169
|
placeholder: placeholder
|
|
63067
|
-
}), /*#__PURE__*/React__default.createElement("
|
|
63170
|
+
}), /*#__PURE__*/React__default.createElement("button", {
|
|
63171
|
+
ref: addBtnRef,
|
|
63172
|
+
type: "button",
|
|
63173
|
+
className: "expression-editor__add-btn",
|
|
63174
|
+
title: "Ins\xE9rer une r\xE9f\xE9rence, un op\xE9rateur ou une fonction",
|
|
63175
|
+
onClick: function onClick() {
|
|
63176
|
+
if (!tagifyRef.current) {
|
|
63177
|
+
return;
|
|
63178
|
+
}
|
|
63179
|
+
if (menuPos) {
|
|
63180
|
+
setMenuPos(null);
|
|
63181
|
+
return;
|
|
63182
|
+
}
|
|
63183
|
+
var rect = addBtnRef.current.getBoundingClientRect();
|
|
63184
|
+
setMenuPos({
|
|
63185
|
+
top: rect.bottom + 6,
|
|
63186
|
+
left: Math.max(8, rect.right - 300)
|
|
63187
|
+
});
|
|
63188
|
+
}
|
|
63189
|
+
}, "+")), /*#__PURE__*/React__default.createElement("div", {
|
|
63068
63190
|
className: "expression-editor__hint"
|
|
63069
|
-
}, "
|
|
63191
|
+
}, "Cliquez sur \xAB + \xBB, double-cliquez un \xE9l\xE9ment des listes, ou tapez \xAB @ \xBB dans l'expression."), /*#__PURE__*/React__default.createElement("div", {
|
|
63070
63192
|
className: "expression-editor__palette"
|
|
63071
63193
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
63072
63194
|
className: "ee-palette-col ee-palette-col--refs"
|
|
63073
63195
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
63074
63196
|
className: "ee-palette-col__title"
|
|
63075
|
-
}, "\xC9chelles & grilles"), /*#__PURE__*/React__default.createElement("
|
|
63076
|
-
className: "ee-
|
|
63077
|
-
|
|
63078
|
-
size: 8,
|
|
63079
|
-
onDoubleClick: handleReferenceDblClick
|
|
63197
|
+
}, "\xC9chelles & grilles"), /*#__PURE__*/React__default.createElement("div", {
|
|
63198
|
+
className: "ee-list",
|
|
63199
|
+
role: "listbox"
|
|
63080
63200
|
}, Object.keys(groupedReferences).map(function (groupe) {
|
|
63081
|
-
return /*#__PURE__*/React__default.createElement("
|
|
63082
|
-
|
|
63201
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
63202
|
+
className: "ee-list-group",
|
|
63083
63203
|
key: groupe
|
|
63084
|
-
},
|
|
63085
|
-
|
|
63086
|
-
|
|
63087
|
-
|
|
63088
|
-
|
|
63089
|
-
|
|
63204
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
63205
|
+
className: "ee-list-group__label"
|
|
63206
|
+
}, groupe), groupedReferences[groupe].map(function (ref) {
|
|
63207
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
63208
|
+
key: "".concat(ref.refType, "-").concat(ref.value, "-").concat(ref.refId || '', "-").concat(ref.axe || ''),
|
|
63209
|
+
className: "ee-list-item ee-opt--".concat(ref.refType),
|
|
63210
|
+
onMouseDown: function onMouseDown(e) {
|
|
63211
|
+
return e.preventDefault();
|
|
63212
|
+
},
|
|
63213
|
+
onClick: function onClick() {
|
|
63214
|
+
return insertReference(ref);
|
|
63215
|
+
}
|
|
63216
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
63217
|
+
className: "ee-list-item__label"
|
|
63218
|
+
}, ref.value));
|
|
63090
63219
|
}));
|
|
63091
63220
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
63092
63221
|
className: "ee-palette-col ee-palette-col--ops"
|
|
63093
63222
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
63094
63223
|
className: "ee-palette-col__title"
|
|
63095
|
-
}, "Op\xE9rateurs & fonctions"), /*#__PURE__*/React__default.createElement("
|
|
63096
|
-
className: "ee-
|
|
63097
|
-
|
|
63098
|
-
size: 8,
|
|
63099
|
-
onDoubleClick: handleOperatorDblClick
|
|
63224
|
+
}, "Op\xE9rateurs & fonctions"), /*#__PURE__*/React__default.createElement("div", {
|
|
63225
|
+
className: "ee-list",
|
|
63226
|
+
role: "listbox"
|
|
63100
63227
|
}, operators.map(function (op) {
|
|
63101
|
-
return /*#__PURE__*/React__default.createElement("
|
|
63228
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
63102
63229
|
key: op,
|
|
63103
|
-
|
|
63104
|
-
|
|
63105
|
-
|
|
63230
|
+
className: "ee-list-item",
|
|
63231
|
+
onMouseDown: function onMouseDown(e) {
|
|
63232
|
+
return e.preventDefault();
|
|
63233
|
+
},
|
|
63234
|
+
onClick: function onClick() {
|
|
63235
|
+
return insertOperator(op);
|
|
63236
|
+
}
|
|
63237
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
63238
|
+
className: "ee-list-item__label ee-list-item__label--op"
|
|
63239
|
+
}, op));
|
|
63240
|
+
})))), menuPos && /*#__PURE__*/createPortal(/*#__PURE__*/React__default.createElement("div", {
|
|
63241
|
+
ref: menuRef,
|
|
63242
|
+
className: "expression-editor__menu",
|
|
63243
|
+
style: {
|
|
63244
|
+
top: menuPos.top,
|
|
63245
|
+
left: menuPos.left
|
|
63246
|
+
}
|
|
63247
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
63248
|
+
className: "ee-list-group"
|
|
63249
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
63250
|
+
className: "ee-list-group__label"
|
|
63251
|
+
}, "\xC9chelles & grilles"), Object.keys(groupedReferences).map(function (groupe) {
|
|
63252
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
63253
|
+
className: "ee-list-group",
|
|
63254
|
+
key: groupe
|
|
63255
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
63256
|
+
className: "ee-list-group__label ee-list-group__label--sub"
|
|
63257
|
+
}, groupe), groupedReferences[groupe].map(function (ref) {
|
|
63258
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
63259
|
+
key: "menu-".concat(ref.refType, "-").concat(ref.value, "-").concat(ref.refId || '', "-").concat(ref.axe || ''),
|
|
63260
|
+
className: "ee-list-item ee-opt--".concat(ref.refType),
|
|
63261
|
+
onClick: function onClick() {
|
|
63262
|
+
insertReference(ref);
|
|
63263
|
+
setMenuPos(null);
|
|
63264
|
+
}
|
|
63265
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
63266
|
+
className: "ee-list-item__label"
|
|
63267
|
+
}, ref.value));
|
|
63268
|
+
}));
|
|
63269
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
63270
|
+
className: "ee-list-group"
|
|
63271
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
63272
|
+
className: "ee-list-group__label"
|
|
63273
|
+
}, "Op\xE9rateurs & fonctions"), operators.map(function (op) {
|
|
63274
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
63275
|
+
key: "menu-".concat(op),
|
|
63276
|
+
className: "ee-list-item",
|
|
63277
|
+
onClick: function onClick() {
|
|
63278
|
+
insertOperator(op);
|
|
63279
|
+
setMenuPos(null);
|
|
63280
|
+
}
|
|
63281
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
63282
|
+
className: "ee-list-item__label ee-list-item__label--op"
|
|
63283
|
+
}, op));
|
|
63284
|
+
}))), document.body), popover && /*#__PURE__*/createPortal(/*#__PURE__*/React__default.createElement("div", {
|
|
63106
63285
|
className: "ee-scores-popover",
|
|
63107
63286
|
style: {
|
|
63108
63287
|
top: popover.pos.top,
|
|
@@ -63138,23 +63317,21 @@ var ExpressionEditor = function ExpressionEditor(_ref) {
|
|
|
63138
63317
|
type: "button",
|
|
63139
63318
|
className: "ee-ok",
|
|
63140
63319
|
onClick: validatePopoverScores
|
|
63141
|
-
}, "OK"))));
|
|
63320
|
+
}, "OK"))), document.body));
|
|
63142
63321
|
};
|
|
63143
63322
|
|
|
63144
|
-
// Références d'exemple (mockées) : reproduisent ce que le back Symfony injecte
|
|
63145
|
-
// (échelles complémentaires « field » + grilles « echelle » avec leurs métadonnées).
|
|
63146
63323
|
var REFERENCES_DEMO = [{
|
|
63147
63324
|
value: 'Chiffre d\'affaires',
|
|
63148
63325
|
refType: 'field',
|
|
63149
63326
|
refId: 42,
|
|
63150
63327
|
"class": 'tag-field',
|
|
63151
|
-
groupe: '
|
|
63328
|
+
groupe: 'Evaluation Complémentaire'
|
|
63152
63329
|
}, {
|
|
63153
63330
|
value: 'Exposition',
|
|
63154
63331
|
refType: 'field',
|
|
63155
63332
|
refId: 43,
|
|
63156
63333
|
"class": 'tag-field',
|
|
63157
|
-
groupe: '
|
|
63334
|
+
groupe: 'Evaluation Complémentaire'
|
|
63158
63335
|
}, {
|
|
63159
63336
|
value: 'Impact',
|
|
63160
63337
|
refType: 'echelle',
|
|
@@ -63182,6 +63359,15 @@ var REFERENCES_DEMO = [{
|
|
|
63182
63359
|
scores: [1, 2, 3, 4],
|
|
63183
63360
|
"class": 'tag-echelle',
|
|
63184
63361
|
groupe: 'Évaluation nette (main)'
|
|
63362
|
+
}, {
|
|
63363
|
+
value: 'Évaluation brute',
|
|
63364
|
+
refType: 'echelle',
|
|
63365
|
+
matrice: '24',
|
|
63366
|
+
axe: 'abs',
|
|
63367
|
+
niveaux: 4,
|
|
63368
|
+
scores: [1, 2, 3, 4],
|
|
63369
|
+
"class": 'tag-echelle',
|
|
63370
|
+
groupe: 'Évaluation brute'
|
|
63185
63371
|
}, {
|
|
63186
63372
|
value: 'Niveau de maîtrise calculé',
|
|
63187
63373
|
refType: 'evalglobal',
|