mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Merge branch 'master' into household_filiation
This commit is contained in:
@@ -68,7 +68,9 @@ export default {
|
||||
return this.$data.value !== null && typeof this.$data.value.text !== 'undefined';
|
||||
},
|
||||
cities() {
|
||||
return this.entity.loaded.cities;
|
||||
return this.entity.loaded.cities.sort(
|
||||
(a, b) => Number(a.code) - Number(b.code) || a.name > b.name
|
||||
)
|
||||
},
|
||||
name: {
|
||||
set(value) {
|
||||
@@ -92,7 +94,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
transName(value) {
|
||||
return (value.code && value.name) ? `${value.code}-${value.name}` : '';
|
||||
return (value.code && value.name) ? `${value.name} (${value.code})` : '';
|
||||
},
|
||||
selectCity(value) {
|
||||
console.log(value)
|
||||
@@ -103,7 +105,9 @@ export default {
|
||||
console.log('writeNew.postcode false, in selectCity');
|
||||
this.$emit('getReferenceAddresses', value);
|
||||
this.focusOnAddress();
|
||||
this.updateMapCenter(value.center);
|
||||
if (value.center) {
|
||||
this.updateMapCenter(value.center);
|
||||
}
|
||||
},
|
||||
listenInputSearch(query) {
|
||||
//console.log('listenInputSearch', query, this.isCitySelectorOpen);
|
||||
|
@@ -5,82 +5,89 @@ import App from './App.vue';
|
||||
|
||||
const i18n = _createI18n(addressMessages);
|
||||
|
||||
let inputs = document.querySelectorAll('input[type="hidden"][data-input-address]');
|
||||
const addAddressInput = (inputs) => {
|
||||
|
||||
const isNumeric = function(v) { return !isNaN(v); };
|
||||
inputs.forEach(el => {
|
||||
let
|
||||
addressId = el.value,
|
||||
uniqid = el.dataset.inputAddress,
|
||||
container = document.querySelector('div[data-input-address-container="' + uniqid + '"]'),
|
||||
isEdit = addressId !== '',
|
||||
addressIdInt = addressId !== '' ? parseInt(addressId) : null
|
||||
;
|
||||
|
||||
inputs.forEach(el => {
|
||||
let
|
||||
addressId = el.value,
|
||||
uniqid = el.dataset.inputAddress,
|
||||
container = document.querySelector('div[data-input-address-container="' + uniqid + '"]'),
|
||||
isEdit = addressId !== '',
|
||||
addressIdInt = addressId !== '' ? parseInt(addressId) : null
|
||||
;
|
||||
if (container === null) {
|
||||
throw Error("no container");
|
||||
}
|
||||
console.log('useValidFrom', el.dataset.useValidFrom === '1');
|
||||
|
||||
if (container === null) {
|
||||
throw Error("no container");
|
||||
}
|
||||
console.log('useValidFrom', el.dataset.useValidFrom === '1');
|
||||
|
||||
const app = createApp({
|
||||
template: `<app v-bind:addAddress="this.addAddress" @address-created="associateToInput"></app>`,
|
||||
data() {
|
||||
return {
|
||||
addAddress: {
|
||||
context: {
|
||||
// for legacy ? can be remove ?
|
||||
target: {
|
||||
name: 'input-address',
|
||||
id: addressIdInt,
|
||||
},
|
||||
edit: isEdit,
|
||||
addressId: addressIdInt,
|
||||
},
|
||||
options: {
|
||||
/// Options override default.
|
||||
/// null value take default component value defined in AddAddress data()
|
||||
button: {
|
||||
text: {
|
||||
create: el.dataset.buttonTextCreate || null,
|
||||
edit: el.dataset.buttonTextUpdate || null,
|
||||
const app = createApp({
|
||||
template: `<app v-bind:addAddress="this.addAddress" @address-created="associateToInput"></app>`,
|
||||
data() {
|
||||
return {
|
||||
addAddress: {
|
||||
context: {
|
||||
// for legacy ? can be remove ?
|
||||
target: {
|
||||
name: 'input-address',
|
||||
id: addressIdInt,
|
||||
},
|
||||
size: null,
|
||||
displayText: true
|
||||
edit: isEdit,
|
||||
addressId: addressIdInt,
|
||||
},
|
||||
options: {
|
||||
/// Options override default.
|
||||
/// null value take default component value defined in AddAddress data()
|
||||
button: {
|
||||
text: {
|
||||
create: el.dataset.buttonTextCreate || null,
|
||||
edit: el.dataset.buttonTextUpdate || null,
|
||||
},
|
||||
size: null,
|
||||
displayText: true
|
||||
},
|
||||
|
||||
/// Modal title text if create or edit address (trans chain, see i18n)
|
||||
title: {
|
||||
create: null,
|
||||
edit: null,
|
||||
},
|
||||
/// Modal title text if create or edit address (trans chain, see i18n)
|
||||
title: {
|
||||
create: null,
|
||||
edit: null,
|
||||
},
|
||||
|
||||
/// Display panes in Modal for step123
|
||||
openPanesInModal: true,
|
||||
/// Display panes in Modal for step123
|
||||
openPanesInModal: true,
|
||||
|
||||
/// Display actions buttons of panes in a sticky-form-button navbar
|
||||
stickyActions: false,
|
||||
showMessageWhenNoAddress: true,
|
||||
/// Display actions buttons of panes in a sticky-form-button navbar
|
||||
stickyActions: false,
|
||||
showMessageWhenNoAddress: true,
|
||||
|
||||
/// Use Date fields
|
||||
useDate: {
|
||||
validFrom: el.dataset.useValidFrom === '1' || false, //boolean, default: false
|
||||
validTo: el.dataset.useValidTo === '1' || false, //boolean, default: false
|
||||
},
|
||||
/// Use Date fields
|
||||
useDate: {
|
||||
validFrom: el.dataset.useValidFrom === '1' || false, //boolean, default: false
|
||||
validTo: el.dataset.useValidTo === '1' || false, //boolean, default: false
|
||||
},
|
||||
|
||||
/// Don't display show renderbox Address: showPane display only a button
|
||||
onlyButton: false,
|
||||
/// Don't display show renderbox Address: showPane display only a button
|
||||
onlyButton: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
associateToInput(payload) {
|
||||
el.value = payload.addressId;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
associateToInput(payload) {
|
||||
el.value = payload.addressId;
|
||||
}
|
||||
}
|
||||
})
|
||||
.use(i18n)
|
||||
.component('app', App)
|
||||
.mount(container);
|
||||
});
|
||||
})
|
||||
.use(i18n)
|
||||
.component('app', App)
|
||||
.mount(container);
|
||||
});
|
||||
};
|
||||
|
||||
document.addEventListener('DOMContentLoaded', (_e) =>
|
||||
addAddressInput(document.querySelectorAll('input[type="hidden"][data-input-address]'))
|
||||
);
|
||||
|
||||
window.addEventListener('collection-add-entry', (e) =>
|
||||
addAddressInput(e.detail.entry.querySelectorAll('input[type="hidden"][data-input-address]'))
|
||||
);
|
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<div class="confidential" v-on:click="toggleBlur">
|
||||
<div class="confidential-content blur">
|
||||
<slot name="confidential-content"></slot>
|
||||
</div>
|
||||
<i class="fa fa-eye toggle" aria-hidden="true"></i>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Confidential",
|
||||
methods : {
|
||||
toggleBlur: function(e){
|
||||
if(e.target.matches('.toggle')){
|
||||
console.log(e);
|
||||
e.target.previousElementSibling.classList.toggle("blur");
|
||||
e.target.classList.toggle("fa-eye");
|
||||
e.target.classList.toggle("fa-eye-slash");
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang='scss'>
|
||||
.confidential{
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
.toggle{
|
||||
margin-top: 28px;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
float: right;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.blur {
|
||||
-webkit-filter: blur(5px);
|
||||
-moz-filter: blur(5px);
|
||||
filter: blur(5px);
|
||||
}
|
||||
</style>
|
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<span class="chill-entity entity-user">
|
||||
{{ user.label }}
|
||||
<span class="user-job" v-if="user.user_job !== null">({{ user.user_job.label.fr }})</span>
|
||||
<span class="main-scope" v-if="user.main_scope !== null">({{ user.main_scope.name.fr }})</span>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "UserRenderBoxBadge",
|
||||
props: ['user'],
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user