@gip-recia/evaluator
Advanced tools
Comparing version 0.0.15 to 0.0.16
{ | ||
"root": true, | ||
"extends": ["eslint:recommended"], | ||
"parser": "@babel/eslint-parser", | ||
"parser": "babel-eslint", | ||
"globals": { | ||
@@ -9,4 +9,3 @@ "chai": "readonly" | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"requireConfigFile": false | ||
"sourceType": "module" | ||
}, | ||
@@ -13,0 +12,0 @@ "env": { |
@@ -0,0 +0,0 @@ { |
{ | ||
"name": "@gip-recia/evaluator", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "Evaluator", | ||
@@ -34,35 +34,34 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"@gip-recia/esup-publisher-webcomponents-utils": "0.0.3", | ||
"@gip-recia/subject-infos": "0.0.11", | ||
"@gip-recia/subject-search-button": "0.0.15", | ||
"lit": "2.2.4" | ||
"@gip-recia/esup-publisher-webcomponents-utils": "^0.0.3", | ||
"@gip-recia/subject-infos": "^0.0.12", | ||
"@gip-recia/subject-search-button": "^0.0.16", | ||
"lit": "^2.2.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.17.12", | ||
"@babel/eslint-parser": "7.17.0", | ||
"@custom-elements-manifest/analyzer": "0.5.7", | ||
"@esm-bundle/chai": "4.3.4-fix.0", | ||
"@fortawesome/fontawesome-free": "6.1.1", | ||
"@open-wc/testing": "3.1.5", | ||
"@open-wc/testing-karma": "4.0.9", | ||
"@rollup/plugin-node-resolve": "13.3.0", | ||
"@types/mocha": "9.1.1", | ||
"@web/dev-server": "0.1.31", | ||
"@web/dev-server-legacy": "1.0.0", | ||
"@web/test-runner": "0.13.27", | ||
"@web/test-runner-mocha": "0.7.5", | ||
"@web/test-runner-playwright": "0.8.8", | ||
"@webcomponents/webcomponentsjs": "2.6.0", | ||
"deepmerge": "4.2.2", | ||
"eslint": "8.15.0", | ||
"lit-analyzer": "1.2.1", | ||
"mocha": "10.0.0", | ||
"prettier": "2.6.2", | ||
"rollup": "2.73.0", | ||
"rollup-plugin-minify-html-literals": "1.2.6", | ||
"rollup-plugin-summary": "1.4.3", | ||
"rollup-plugin-terser": "7.0.2", | ||
"rollup-plugin-visualizer": "5.6.0" | ||
"@custom-elements-manifest/analyzer": "^0.5.3", | ||
"@esm-bundle/chai": "^4.1.5", | ||
"@fortawesome/fontawesome-free": "^6.4.0", | ||
"@open-wc/testing": "^3.0.0-next.1", | ||
"@open-wc/testing-karma": "^4.0.9", | ||
"@rollup/plugin-node-resolve": "^13.1.3", | ||
"@types/mocha": "^9.0.0", | ||
"@web/dev-server": "^0.1.22", | ||
"@web/dev-server-legacy": "^0.1.4", | ||
"@web/test-runner": "^0.13.16", | ||
"@web/test-runner-mocha": "^0.7.4", | ||
"@web/test-runner-playwright": "^0.8.4", | ||
"@webcomponents/webcomponentsjs": "^2.6.0", | ||
"babel-eslint": "^10.1.0", | ||
"deepmerge": "^4.2.2", | ||
"eslint": "^7.32.0", | ||
"lit-analyzer": "^1.2.1", | ||
"mocha": "^9.1.1", | ||
"prettier": "^2.3.2", | ||
"rollup": "^2.70.1", | ||
"rollup-plugin-minify-html-literals": "^1.2.6", | ||
"rollup-plugin-summary": "^1.3.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-visualizer": "^5.6.0" | ||
}, | ||
"customElements": "custom-elements.json" | ||
} |
@@ -88,4 +88,2 @@ # **Esup Evaluator et Edit-Evaluator** | ||
- `onSubjectClicked` - Fonction appelée lors du clic sur une personne/un groupe. | ||
### **Variables CSS** | ||
@@ -138,4 +136,2 @@ | ||
- `onSubjectClicked` - Fonction appelée lors du clic sur une personne/un groupe. | ||
### **Fonctions** | ||
@@ -142,0 +138,0 @@ |
@@ -0,0 +0,0 @@ // Import rollup plugins |
@@ -0,0 +0,0 @@ import { css } from 'lit' |
@@ -0,0 +0,0 @@ export const editEvaluatorLabel = { |
@@ -0,0 +0,0 @@ import { css } from 'lit' |
@@ -5,3 +5,8 @@ import { LitElement, html, css } from 'lit' | ||
import { bootstrapStyle } from './bootstrap-style.js' | ||
import { Localization, ToolTip, Utils, bootstrapToolTipStyle } from '@gip-recia/esup-publisher-webcomponents-utils' | ||
import { | ||
Localization, | ||
ToolTip, | ||
Utils, | ||
bootstrapToolTipStyle | ||
} from '@gip-recia/esup-publisher-webcomponents-utils' | ||
@@ -49,9 +54,3 @@ /** | ||
*/ | ||
onModification: { attribute: false }, | ||
/** | ||
* Fonction appelée au clic sur un subject-infos. | ||
* @type {Function} | ||
*/ | ||
onSubjectClicked: { attribute: false } | ||
onModification: { attribute: false } | ||
} | ||
@@ -104,4 +103,3 @@ } | ||
@childDeletion="${(e) => this._onChildDeletionEvent(e)}" | ||
@childUpdate="${(e) => this._onChildUpdateEvent(e)}" | ||
@subjectClick="${(e) => this._onSubjectClickedEvent(e, e.detail.subject)}"> | ||
@childUpdate="${(e) => this._onChildUpdateEvent(e)}"> | ||
</esup-edit-evaluators> | ||
@@ -128,4 +126,3 @@ ` | ||
@childDeletion="${(e) => this._onChildDeletionEvent(e)}" | ||
@childUpdate="${(e) => this._onChildUpdateEvent(e)}" | ||
@subjectClick="${(e) => this._onSubjectClickedEvent(e, e.detail.subject)}"> | ||
@childUpdate="${(e) => this._onChildUpdateEvent(e)}"> | ||
</esup-edit-evaluators> | ||
@@ -164,3 +161,3 @@ </li> | ||
userRendering = html` | ||
<esup-subject-infos .subject="${userModelId}" .config="${this.config}" .onSubjectClicked="${() => this._onSubjectClickedEvent(null, userModelId)}"> | ||
<esup-subject-infos .subject="${userModelId}" .config="${this.config}"> | ||
<span>${this._localization.getLabel('userAttribute.subjetIs')}</span> | ||
@@ -224,3 +221,3 @@ </esup-subject-infos> | ||
groupRendering = html` | ||
<esup-subject-infos .subject="${userModelId}" .config="${this.config}" .onSubjectClicked="${() => this._onSubjectClickedEvent(null, userModelId)}"> | ||
<esup-subject-infos .subject="${userModelId}" .config="${this.config}"> | ||
<span>${this._localization.getLabel('userGroup.memberOf')}</span> | ||
@@ -273,3 +270,4 @@ </esup-subject-infos> | ||
if (changedProperties) { | ||
initDatas = changedProperties.has('evaluator') || changedProperties.has('config') | ||
initDatas = | ||
changedProperties.has('evaluator') || changedProperties.has('config') | ||
} | ||
@@ -282,3 +280,6 @@ if (initDatas) { | ||
this._localization.labels = editEvaluatorLabel | ||
this._localization.lang = this.config && this.config.lang ? this.config.lang : this._localization.lang | ||
this._localization.lang = | ||
this.config && this.config.lang | ||
? this.config.lang | ||
: this._localization.lang | ||
// Surcharge des labels | ||
@@ -734,34 +735,17 @@ if (this.config && this.config.labels) { | ||
/** | ||
* Méthode appelée au clic sur un subject-infos. | ||
* Envoi un évènement au composant parrent. | ||
* | ||
* @param {Object} event Evènement | ||
* @param {Object} subject Subject-infos cliqué | ||
*/ | ||
_onSubjectClickedEvent(event, subject) { | ||
if (event) { | ||
event.stopPropagation() | ||
} | ||
this._sendEvent('subjectClick', {subject: subject}) | ||
} | ||
/** | ||
* Envoi un évènement au composant parent. | ||
* | ||
* @param {String} eventName Nom de l'évènement | ||
* @param {Object} detail Détail envoyé avec l'évènement | ||
*/ | ||
_sendEvent(eventName, detail) { | ||
_sendEvent(eventName) { | ||
if (!this.isChild && eventName === 'childUpdate') { | ||
// Si on est sur l'évaluateur racine et qu'il s'agit d'une mise à jour, appel à la méthode callBack | ||
// Si on est sur l'évaluateur racine et qu'il s'ait d'une mise à jour, appel à la méthode callBack | ||
if (this.onModification) { | ||
this.onModification(this._evaluator) | ||
} | ||
} else if (!this.isChild && eventName === 'subjectClick') { | ||
// Si on est sur l'évaluateur racine et qu'il s'agit d'une mise à jour, appel à la méthode callBack | ||
if (this.onSubjectClicked && detail.subject) { | ||
this.onSubjectClicked(detail.subject) | ||
} | ||
} else { | ||
const options = { | ||
detail: Object.assign(detail || {}, { evaluator: this._evaluator }), | ||
detail: { | ||
evaluator: this._evaluator | ||
}, | ||
bubbles: true, | ||
@@ -768,0 +752,0 @@ composed: true |
@@ -0,0 +0,0 @@ import { LitElement, html } from 'lit' |
@@ -0,0 +0,0 @@ export const evaluatorLabel = { |
@@ -0,0 +0,0 @@ import { css } from 'lit' |
@@ -46,9 +46,3 @@ import { LitElement, html, css } from 'lit' | ||
*/ | ||
config: { attribute: false }, | ||
/** | ||
* Fonction appelée au clic sur un subject-infos. | ||
* @type {Function} | ||
*/ | ||
onSubjectClicked: { attribute: false } | ||
config: { attribute: false } | ||
} | ||
@@ -69,3 +63,3 @@ } | ||
// prettier-ignore | ||
rendering = html`<esup-simple-evaluators .collection="${this.evaluator.evaluators}" .config="${this.config}" @subjectClick="${(e) => this._onSubjectClickedEvent(e, e.detail.subject)}"></esup-simple-evaluators>` | ||
rendering = html`<esup-simple-evaluators .collection="${this.evaluator.evaluators}" .config="${this.config}"></esup-simple-evaluators>` | ||
if (this.isChild || this.evaluator.type !== 'OR') { | ||
@@ -77,3 +71,3 @@ // prettier-ignore | ||
// prettier-ignore | ||
rendering = html`<span>${this.evaluator.type}</span><esup-evaluators .collection="${this.evaluator.evaluators}" .config="${this.config}" @subjectClick="${(e) => this._onSubjectClickedEvent(e, e.detail.subject)}"></esup-evaluators>` | ||
rendering = html`<span>${this.evaluator.type}</span><esup-evaluators .collection="${this.evaluator.evaluators}" .config="${this.config}"></esup-evaluators>` | ||
} | ||
@@ -106,6 +100,6 @@ if (!(this.isChild || this.simple)) { | ||
// prettier-ignore | ||
rendering = html`<esup-subject-infos .subject="${userModelId}" .config="${this.config}" .onSubjectClicked="${() => this._onSubjectClickedEvent(null, userModelId)}"><span>${this._localization.getLabel('userAttribute.subjetIs')}</span></esup-subject-infos>` | ||
rendering = html`<esup-subject-infos .subject="${userModelId}" .config="${this.config}"><span>${this._localization.getLabel('userAttribute.subjetIs')}</span></esup-subject-infos>` | ||
} else { | ||
// prettier-ignore | ||
rendering = html`<esup-subject-infos .subject="${userModelId}" .config="${this.config}" .onSubjectClicked="${() => this._onSubjectClickedEvent(null, userModelId)}"></esup-subject-infos>` | ||
rendering = html`<esup-subject-infos .subject="${userModelId}" .config="${this.config}"></esup-subject-infos>` | ||
} | ||
@@ -130,6 +124,6 @@ } else { | ||
// prettier-ignore | ||
rendering = html`<esup-subject-infos .subject="${groupModelId}" .config="${this.config}" .onSubjectClicked="${() => this._onSubjectClickedEvent(null, groupModelId)}"><span>${this._localization.getLabel('userGroup.memberOf')}</span></esup-subject-infos>` | ||
rendering = html`<esup-subject-infos .subject="${groupModelId}" .config="${this.config}"><span>${this._localization.getLabel('userGroup.memberOf')}</span></esup-subject-infos>` | ||
} else { | ||
// prettier-ignore | ||
rendering = html`<esup-subject-infos .subject="${groupModelId}" .config="${this.config}" .onSubjectClicked="${() => this._onSubjectClickedEvent(null, groupModelId)}"></esup-subject-infos>` | ||
rendering = html`<esup-subject-infos .subject="${groupModelId}" .config="${this.config}"></esup-subject-infos>` | ||
} | ||
@@ -157,3 +151,6 @@ break | ||
this._localization.labels = evaluatorLabel | ||
this._localization.lang = this.config && this.config.lang ? this.config.lang : this._localization.lang | ||
this._localization.lang = | ||
this.config && this.config.lang | ||
? this.config.lang | ||
: this._localization.lang | ||
// Surcharge des labels | ||
@@ -165,37 +162,2 @@ if (this.config && this.config.labels) { | ||
} | ||
/** | ||
* Méthode appelée au clic sur un subject-infos. | ||
* | ||
* @param {Object} event Evènement | ||
* @param {Object} subject Subject-infos cliqué | ||
*/ | ||
_onSubjectClickedEvent(event, subject) { | ||
if (event) { | ||
event.stopPropagation() | ||
} | ||
this._sendEvent('subjectClick', {subject: subject}) | ||
} | ||
/** | ||
* Envoi un évènement au composant parent. | ||
* | ||
* @param {String} eventName Nom de l'évènement | ||
* @param {Object} detail Détail envoyé avec l'évènement | ||
*/ | ||
_sendEvent(eventName, detail) { | ||
if (!this.isChild && eventName === 'subjectClick') { | ||
// Si on est sur l'évaluateur racine et qu'il s'agit d'un clic sur un subject-infos, appel à la méthode callBack | ||
if (this.onSubjectClicked && detail.subject) { | ||
this.onSubjectClicked(detail.subject) | ||
} | ||
} else { | ||
const options = { | ||
detail: detail, | ||
bubbles: true, | ||
composed: true | ||
} | ||
this.dispatchEvent(new CustomEvent(eventName, options)) | ||
} | ||
} | ||
} | ||
@@ -202,0 +164,0 @@ |
@@ -0,0 +0,0 @@ import { LitElement, html } from 'lit' |
@@ -0,0 +0,0 @@ import '@gip-recia/subject-infos' |
@@ -0,0 +0,0 @@ import { LitElement, html, css } from 'lit' |
@@ -0,0 +0,0 @@ import { EditEvaluator } from '../src/edit-evaluator.js' |
@@ -0,0 +0,0 @@ import { Evaluator } from '../src/evaluator.js' |
@@ -0,0 +0,0 @@ import { legacyPlugin } from '@web/dev-server-legacy' |
@@ -0,0 +0,0 @@ import { legacyPlugin } from '@web/dev-server-legacy' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
24
97101
1757
176
1
+ Added@gip-recia/js-tree@0.0.14(transitive)
+ Added@gip-recia/subject-infos@0.0.12(transitive)
+ Added@gip-recia/subject-search-button@0.0.16(transitive)
+ Addedlit@2.8.0(transitive)
- Removed@gip-recia/js-tree@0.0.13(transitive)
- Removed@gip-recia/subject-infos@0.0.11(transitive)
- Removed@gip-recia/subject-search-button@0.0.15(transitive)
Updatedlit@^2.2.0