PageSourceSearch

https://www.tarentaise-environnement-sante.fr/tools/bazar/presentation/javascripts/components/EntryField.js

js tarentaise-environnement-sante.fr collected 2026-10-06 04:50:45 UTC 1,836 bytes, 58 lines download raw bytes

1export default {
2  props: ['entry', 'prop'],
3  data() {
4    return { isDateTime: false }
5  },
6  computed: {
7    value() {
8      const value = this.entry[this.prop] || ''
9      switch (this.type) {
10        case 'listedatedeb':
11          if (!value) return ''
12          if (value.includes('T')) this.isDateTime = true
13          return new Date(value)
14        case 'liste':
15        case 'listefiche':
16        case 'checkbox':
17        case 'checkboxfiche':
18        case 'radio':
19        case 'radiofiche':
20        case 'listefiches':
21        case 'listefichesliees':
22        case 'tags':
23          const values = value.split(',').map((v) => this.field.options[v])
24          return values.length <= 1 ? values[0] : values
25        case 'email':
26          return '' // security
27        default:
28          return value
29      }
30    },
31    field() {
32      return this.$root.fieldInfo(this.prop)
33    },
34    type() {
35      return this.field.type
36    }
37  },
38  template: `
39    <div v-bind="$attrs" v-if="value">
40      <div v-if="Array.isArray(value)" class="field field-array">
41        <span v-for="v in value" v-html="v"></span>
42      </div>
43      <div v-else-if="type == 'listedatedeb'" class="field field-date">
44        <span class="day">{{ value.toLocaleDateString([], { day: 'numeric' }) }}</span>
45        <span class="month">{{ value.toLocaleDateString([], { month: 'short' }).replace('.', '') }}</span>
46        <span class="default">
47          <template v-if="isDateTime">
48            {{ value.toLocaleString([], {dateStyle: 'medium', timeStyle: 'short'}) }}
49          </template>
50          <template v-else>
51            {{ value.toLocaleDateString([], {year: "numeric", month: "short", day: "
51numeric"}) }}
52          </template>
53        </span>
54      </div>
55      <div v-else v-html="value" class="field field-default"></div>
56    </div>
57  `
58}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.