free-fe-core-modules 0.1.11 → 0.1.13

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.
@@ -60,6 +60,19 @@
60
60
  </template>
61
61
  </q-select>
62
62
  <slot name="warning"></slot>
63
+ <div v-if="selectedOptionsExtra.length">
64
+ <free-field
65
+ @click.stop
66
+ @keydown.stop
67
+ @keypress.stop
68
+ @keyup.stop
69
+ @input="innerExtraFieldInput(fld)"
70
+ v-for="(fld, idx) in selectedOptionsExtra" :key="idx"
71
+ :Field="{...fld, ReadOnly: Field.ReadOnly || fld?.ReadOnly}"
72
+ :values="values"
73
+ ref="fieldToValid">
74
+ </free-field>
75
+ </div>
63
76
  </span>
64
77
  <span v-else class="free-field-select-ascheck row items-start no-wrap">
65
78
  <span :class="`field-label ${(Field.Label && Field.Label.trim().length)
@@ -83,41 +96,42 @@
83
96
  :class="{
84
97
  padding: option.opt?.PaddingLeft,
85
98
  }"
86
- v-for="(option, index) in Field.Options"
99
+ v-for="(option, index) in Field.Options"
87
100
  :key="index" >
88
101
 
89
- <div
102
+ <div
90
103
  class="just-a-label"
91
104
  v-if="option.opt?.asLabel">{{ option.Label }}</div>
92
105
 
93
- <q-checkbox
106
+ <q-checkbox
94
107
  v-else
95
108
  :class="{
96
109
  checked: checked.includes(option.Value),
97
110
  'with-inner-extra': option.InnerExtra?.length,
98
- }"
99
- hide-bottom-space
100
- :label="option.Label || ''"
101
- v-model="checked"
111
+ }"
112
+ hide-bottom-space
113
+ :label="option.Label || ''"
114
+ v-model="checked"
102
115
  :val="option.Value"
103
- :disable="Field.ReadOnly"
116
+ :disable="Field.ReadOnly"
104
117
  @update:modelValue="checkChanged(option.Value)"
105
118
  :checked-icon="checkedIcon(option)">
106
119
  <q-tooltip v-if="option.opt?.Tooltip" anchor="bottom middle">
107
120
  {{ $t(option.opt.Tooltip) || '' }}
108
121
  </q-tooltip>
109
- <div class="option-inner-extra"
110
- v-if="(fieldData === option.Value || (fieldData && fieldData.indexOf && (fieldData.indexOf(option.Value) >= 0))) && option.InnerExtra?.length">
111
- <free-field
122
+ <div class="option-inner-extra"
123
+ v-if="(fieldData === option?.Value || (fieldData && fieldData.indexOf && (fieldData.indexOf(option?.Value) >= 0))) && option.InnerExtra?.length">
124
+ <free-field
112
125
  @click.stop
113
126
  @keydown.stop
114
127
  @keypress.stop
115
128
  @keyup.stop
116
129
  @input="innerExtraFieldInput(fld)"
117
- v-for="(fld, idx) in option.InnerExtra || []" :key="idx"
118
- :Field="{...fld, ReadOnly: Field.ReadOnly || fld.ReadOnly}"
119
- :values="data"
120
- ref="fieldToValid"></free-field>
130
+ v-for="(fld, idx) in option.InnerExtra || []" :key="idx"
131
+ :Field="{...fld, ReadOnly: Field.ReadOnly || fld?.ReadOnly}"
132
+ :values="values"
133
+ ref="fieldToValid">
134
+ </free-field>
121
135
  </div>
122
136
  </q-checkbox>
123
137
  </div>
@@ -445,10 +459,26 @@ export default defineComponent({
445
459
 
446
460
  const localOptions = ref(props.Field.Options || []);
447
461
 
462
+ const selectedOptionsExtra = computed(() => {
463
+ let opts = [];
464
+ if (fieldData.value) {
465
+ if (props.Field.Multiple) {
466
+ const vals = Array.isArray(fieldData.value) ? fieldData.value : (`${fieldData.value}`).split(',');
467
+ opts = (localOptions.value || []).filter((opt) => vals.indexOf(opt.Value) >= 0);
468
+ }
469
+
470
+ opts = (localOptions.value || []).filter((opt) => opt.Value === fieldData.value);
471
+ }
472
+
473
+ return opts.map((opt) => opt.Extra).flat().filter((f) => f?.Name || f?.Label);
474
+ });
475
+
476
+
448
477
  return {
449
478
  fieldData,
450
479
  setFieldData,
451
480
  localOptions,
481
+ selectedOptionsExtra,
452
482
 
453
483
  hasError,
454
484
  checked,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-fe-core-modules",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/freeeis/free-fe-core-modules.git",
6
6
  "author": "zhiquan",