@dative-gpi/foundation-shared-components 1.0.87 → 1.0.88
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/components/calendar/FSSimpleCalendar.vue +3 -18
- package/components/fields/FSRichTextField.vue +40 -27
- package/components/fields/FSSearchField.vue +7 -114
- package/components/fields/FSTimeRangeField.vue +104 -180
- package/components/fields/FSTranslateRichTextField.vue +7 -4
- package/components/lists/FSDataTableUI.vue +5 -1
- package/components/lists/FSFilterButton.vue +0 -1
- package/components/lists/FSSimpleList.vue +0 -1
- package/components/lists/FSSimpleListItem.vue +1 -0
- package/components/tiles/FSCommentTileUI.vue +26 -5
- package/models/variableNode.ts +8 -5
- package/package.json +4 -4
- package/styles/components/index.scss +0 -1
- package/tools/alertsTools.ts +15 -1
- package/tools/chartsTools.ts +145 -18
- package/tools/timeRangeTools.ts +99 -40
- package/components/fields/FSTimeSlotField.vue +0 -250
- package/styles/components/fs_timeslot_field.scss +0 -12
|
@@ -16,19 +16,16 @@
|
|
|
16
16
|
:editable="$props.editable"
|
|
17
17
|
:validateOn="validateOn"
|
|
18
18
|
:rules="$props.rules"
|
|
19
|
-
:items="
|
|
19
|
+
:items="daysItems"
|
|
20
20
|
:hideHeader="true"
|
|
21
21
|
:clearable="false"
|
|
22
|
-
:style="style"
|
|
23
22
|
:modelValue="realTime?.startDay ?? 0"
|
|
24
23
|
@update:modelValue="onChangeDayStart"
|
|
25
24
|
/>
|
|
26
25
|
<FSClock
|
|
27
|
-
class="fs-time-slot-field-number"
|
|
28
26
|
:editable="$props.editable"
|
|
29
27
|
:color="ColorEnum.Light"
|
|
30
28
|
:slider="false"
|
|
31
|
-
:style="style"
|
|
32
29
|
:modelValue="startTime"
|
|
33
30
|
@update:modelValue="onChangeHourStart"
|
|
34
31
|
/>
|
|
@@ -37,42 +34,50 @@
|
|
|
37
34
|
:wrap="false"
|
|
38
35
|
>
|
|
39
36
|
<FSSelectField
|
|
40
|
-
class="fs-time-slot-field-select"
|
|
41
37
|
:editable="$props.editable"
|
|
42
|
-
:items="
|
|
38
|
+
:items="daysItems"
|
|
43
39
|
:hideHeader="true"
|
|
44
40
|
:clearable="false"
|
|
45
|
-
:style="style"
|
|
46
41
|
:modelValue="realTime?.endDay ?? 0"
|
|
47
42
|
@update:modelValue="onChangeDayEnd"
|
|
48
43
|
/>
|
|
49
44
|
<FSClock
|
|
50
|
-
class="fs-time-slot-field-number"
|
|
51
45
|
:editable="$props.editable"
|
|
52
46
|
:color="ColorEnum.Light"
|
|
53
47
|
:slider="false"
|
|
54
|
-
:style="style"
|
|
55
48
|
:modelValue="endTime"
|
|
56
49
|
@update:modelValue="onChangeHourEnd"
|
|
57
50
|
/>
|
|
58
51
|
</FSRow>
|
|
52
|
+
<FSSelectField
|
|
53
|
+
v-if="$props.showVariant"
|
|
54
|
+
width="hug"
|
|
55
|
+
:label="$tr('ui.common.type', 'Type')"
|
|
56
|
+
:items="dateTypeItems"
|
|
57
|
+
:hideHeader="true"
|
|
58
|
+
:clearable="false"
|
|
59
|
+
:modelValue="modelValue?.variant ?? DateType.Local"
|
|
60
|
+
@update:modelValue="onUpdateVariant"
|
|
61
|
+
/>
|
|
59
62
|
</FSRow>
|
|
60
63
|
</FSBaseField>
|
|
61
64
|
</template>
|
|
62
65
|
|
|
63
66
|
<script lang="ts">
|
|
64
|
-
import { computed, defineComponent, type PropType
|
|
67
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
65
68
|
|
|
66
|
-
import {
|
|
69
|
+
import { useTranslations as useTranslationProvider } from "@dative-gpi/bones-ui/composables";
|
|
70
|
+
import { useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
67
71
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
68
|
-
import { Days } from "@dative-gpi/foundation-shared-domain/enums";
|
|
72
|
+
import { DateType, Days } from "@dative-gpi/foundation-shared-domain/enums";
|
|
73
|
+
import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
|
|
69
74
|
|
|
70
75
|
import FSSelectField from "./FSSelectField.vue";
|
|
71
76
|
import FSBaseField from "./FSBaseField.vue";
|
|
72
77
|
import FSClock from "../FSClock.vue";
|
|
73
78
|
import FSRow from "../FSRow.vue";
|
|
74
79
|
|
|
75
|
-
import { applyOffset, type DateTimeRange } from "../../tools";
|
|
80
|
+
import { applyOffset, dayLabel, type DateTimeRange } from "../../tools";
|
|
76
81
|
|
|
77
82
|
export default defineComponent({
|
|
78
83
|
name: "FSTimeRangeField",
|
|
@@ -94,7 +99,7 @@ export default defineComponent({
|
|
|
94
99
|
default: null
|
|
95
100
|
},
|
|
96
101
|
modelValue: {
|
|
97
|
-
type: Object as PropType<DateTimeRange
|
|
102
|
+
type: Object as PropType<DateTimeRange>,
|
|
98
103
|
required: true,
|
|
99
104
|
default: null
|
|
100
105
|
},
|
|
@@ -122,51 +127,40 @@ export default defineComponent({
|
|
|
122
127
|
type: Boolean,
|
|
123
128
|
required: false,
|
|
124
129
|
default: true
|
|
130
|
+
},
|
|
131
|
+
showVariant: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
required: false,
|
|
134
|
+
default: false
|
|
125
135
|
}
|
|
126
136
|
},
|
|
127
137
|
emits: ["update:modelValue"],
|
|
128
138
|
setup(props, { emit }) {
|
|
139
|
+
const { $tr } = useTranslationProvider();
|
|
129
140
|
const { validateOn, getMessages } = useRules();
|
|
130
|
-
const { getColors } = useColors();
|
|
131
141
|
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
label: key
|
|
141
|
-
});
|
|
142
|
+
const dateTypeItems = [
|
|
143
|
+
{
|
|
144
|
+
id: DateType.Local,
|
|
145
|
+
label: $tr('ui.common.local', 'Local')
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: DateType.UTC,
|
|
149
|
+
label: $tr('ui.common.utc', 'UTC')
|
|
142
150
|
}
|
|
143
|
-
|
|
144
|
-
}, [] as { id: number, label: string }[]);
|
|
151
|
+
];
|
|
145
152
|
|
|
146
|
-
const
|
|
147
|
-
|
|
153
|
+
const daysItems = computed(()=>{
|
|
154
|
+
return getEnumEntries(Days).map((f)=>{
|
|
148
155
|
return {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
return {
|
|
156
|
-
"--fs-time-slot-field-cursor" : "text",
|
|
157
|
-
"--fs-time-slot-field-border-color" : lights.dark,
|
|
158
|
-
"--fs-time-slot-field-color" : darks.base,
|
|
159
|
-
"--fs-time-slot-field-active-border-color": darks.dark,
|
|
160
|
-
"--fs-time-slot-field-error-color" : errors.base,
|
|
161
|
-
"--fs-time-slot-field-error-border-color" : errors.base
|
|
162
|
-
};
|
|
156
|
+
id: f.value as number,
|
|
157
|
+
label: dayLabel(f.value)
|
|
158
|
+
}
|
|
159
|
+
})
|
|
163
160
|
});
|
|
164
161
|
|
|
165
162
|
const realTime = computed(() => {
|
|
166
|
-
|
|
167
|
-
return applyOffset(props.modelValue, false);
|
|
168
|
-
}
|
|
169
|
-
return null;
|
|
163
|
+
return applyOffset(props.modelValue, false);
|
|
170
164
|
});
|
|
171
165
|
|
|
172
166
|
const startTime = computed((): number => {
|
|
@@ -186,152 +180,76 @@ export default defineComponent({
|
|
|
186
180
|
const messages = computed((): string[] => props.messages ?? getMessages(props.modelValue, props.rules));
|
|
187
181
|
|
|
188
182
|
const onChangeDayStart = (value: number) => {
|
|
189
|
-
if (value ===
|
|
190
|
-
if (props.modelValue) {
|
|
191
|
-
emit("update:modelValue",
|
|
192
|
-
{
|
|
193
|
-
startDay: 7,
|
|
194
|
-
startHour: props.modelValue.startHour,
|
|
195
|
-
startMinute: props.modelValue.startMinute,
|
|
196
|
-
endDay: 7,
|
|
197
|
-
endHour: props.modelValue.endHour,
|
|
198
|
-
endMinute: props.modelValue.endMinute
|
|
199
|
-
}
|
|
200
|
-
);
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
183
|
+
if (value === Days.AllDays) {
|
|
203
184
|
emit("update:modelValue",
|
|
204
185
|
{
|
|
205
|
-
startDay:
|
|
206
|
-
startHour:
|
|
207
|
-
startMinute:
|
|
208
|
-
endDay:
|
|
209
|
-
endHour:
|
|
210
|
-
endMinute:
|
|
186
|
+
startDay: value,
|
|
187
|
+
startHour: props.modelValue.startHour,
|
|
188
|
+
startMinute: props.modelValue.startMinute,
|
|
189
|
+
endDay: value,
|
|
190
|
+
endHour: props.modelValue.endHour,
|
|
191
|
+
endMinute: props.modelValue.endMinute,
|
|
192
|
+
variant: props.modelValue.variant
|
|
211
193
|
}
|
|
212
194
|
);
|
|
213
|
-
return;
|
|
214
195
|
}
|
|
215
|
-
|
|
216
|
-
if (props.modelValue.endDay === 7) {
|
|
217
|
-
emit("update:modelValue",
|
|
218
|
-
{
|
|
219
|
-
startDay: value,
|
|
220
|
-
startHour: props.modelValue.startHour,
|
|
221
|
-
startMinute: props.modelValue.startMinute,
|
|
222
|
-
endDay: value,
|
|
223
|
-
endHour: props.modelValue.endHour,
|
|
224
|
-
endMinute: props.modelValue.endMinute
|
|
225
|
-
}
|
|
226
|
-
);
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
196
|
+
else {
|
|
229
197
|
const t = applyOffset({
|
|
230
198
|
startDay: value,
|
|
231
|
-
startHour:
|
|
232
|
-
startMinute:
|
|
233
|
-
endDay: props.modelValue.endDay,
|
|
234
|
-
endHour:
|
|
235
|
-
endMinute:
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
199
|
+
startHour: realTime.value.startHour,
|
|
200
|
+
startMinute: realTime.value.startMinute,
|
|
201
|
+
endDay: props.modelValue.endDay == Days.AllDays ? value : realTime.value.endDay,
|
|
202
|
+
endHour: realTime.value.endHour,
|
|
203
|
+
endMinute: realTime.value.endMinute,
|
|
204
|
+
variant: realTime.value.variant
|
|
205
|
+
}, true);
|
|
206
|
+
emit("update:modelValue",t);
|
|
239
207
|
}
|
|
240
|
-
emit("update:modelValue",{
|
|
241
|
-
startDay: value,
|
|
242
|
-
startHour: 0,
|
|
243
|
-
startMinute: 0,
|
|
244
|
-
endDay: value,
|
|
245
|
-
endHour: 0,
|
|
246
|
-
endMinute: 0
|
|
247
|
-
});
|
|
248
208
|
};
|
|
249
209
|
|
|
250
210
|
|
|
251
211
|
const onChangeHourStart = (value: number) => {
|
|
252
212
|
const innerHours = value ? Math.floor(value / (60 * 60 * 1000)) : 0;
|
|
253
213
|
const innerMinutes = value ? Math.floor((value % (60 * 60 * 1000)) / (60 * 1000)) : 0;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
startDay: realTime.value.startDay,
|
|
257
|
-
startHour: innerHours,
|
|
258
|
-
startMinute: innerMinutes,
|
|
259
|
-
endDay: realTime.value.endDay,
|
|
260
|
-
endHour: realTime.value.endHour,
|
|
261
|
-
endMinute: realTime.value.endMinute
|
|
262
|
-
};
|
|
263
|
-
const newTime = applyOffset(t, true);
|
|
264
|
-
emit("update:modelValue", newTime);
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
emit("update:modelValue", {
|
|
268
|
-
startDay: 0,
|
|
214
|
+
const t = {
|
|
215
|
+
startDay: realTime.value.startDay,
|
|
269
216
|
startHour: innerHours,
|
|
270
217
|
startMinute: innerMinutes,
|
|
271
|
-
endDay:
|
|
272
|
-
endHour:
|
|
273
|
-
endMinute:
|
|
274
|
-
|
|
218
|
+
endDay: realTime.value.endDay,
|
|
219
|
+
endHour: realTime.value.endHour,
|
|
220
|
+
endMinute: realTime.value.endMinute,
|
|
221
|
+
variant: realTime.value.variant
|
|
222
|
+
};
|
|
223
|
+
const newTime = applyOffset(t, true);
|
|
224
|
+
emit("update:modelValue", newTime);
|
|
275
225
|
}
|
|
276
226
|
|
|
277
227
|
const onChangeDayEnd = (value: number) => {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
startDay: 7,
|
|
283
|
-
startHour: props.modelValue.startHour,
|
|
284
|
-
startMinute: props.modelValue.startMinute,
|
|
285
|
-
endDay: 7,
|
|
286
|
-
endHour: props.modelValue.endHour,
|
|
287
|
-
endMinute: props.modelValue.endMinute
|
|
288
|
-
}
|
|
289
|
-
);
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
emit("update:modelValue",
|
|
293
|
-
{
|
|
294
|
-
startDay: 7,
|
|
295
|
-
startHour: 0,
|
|
296
|
-
startMinute: 0,
|
|
297
|
-
endDay: 7,
|
|
298
|
-
endHour: 0,
|
|
299
|
-
endMinute: 0
|
|
300
|
-
}
|
|
301
|
-
);
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
if (props.modelValue) {
|
|
305
|
-
if (props.modelValue.startDay === 7) {
|
|
306
|
-
emit("update:modelValue",{
|
|
307
|
-
startDay: value,
|
|
308
|
-
startHour: props.modelValue.startHour,
|
|
309
|
-
startMinute: props.modelValue.startMinute,
|
|
310
|
-
endDay: value,
|
|
311
|
-
endHour: props.modelValue.endHour,
|
|
312
|
-
endMinute: props.modelValue.endMinute
|
|
313
|
-
});
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
const t = applyOffset({
|
|
317
|
-
startDay: props.modelValue.startDay,
|
|
228
|
+
|
|
229
|
+
if (value === Days.AllDays) {
|
|
230
|
+
emit("update:modelValue",{
|
|
231
|
+
startDay: value,
|
|
318
232
|
startHour: props.modelValue.startHour,
|
|
319
233
|
startMinute: props.modelValue.startMinute,
|
|
320
234
|
endDay: value,
|
|
321
235
|
endHour: props.modelValue.endHour,
|
|
322
|
-
endMinute: props.modelValue.endMinute
|
|
236
|
+
endMinute: props.modelValue.endMinute,
|
|
237
|
+
variant: props.modelValue.variant
|
|
238
|
+
});
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
const t = applyOffset({
|
|
243
|
+
startDay: props.modelValue.startDay == Days.AllDays ? value : realTime.value.startDay,
|
|
244
|
+
startHour: realTime.value.startHour,
|
|
245
|
+
startMinute: realTime.value.startMinute,
|
|
246
|
+
endDay: value,
|
|
247
|
+
endHour: realTime.value.endHour,
|
|
248
|
+
endMinute: realTime.value.endMinute,
|
|
249
|
+
variant: realTime.value.variant
|
|
323
250
|
}, true);
|
|
324
251
|
emit("update:modelValue", t);
|
|
325
|
-
return;
|
|
326
252
|
}
|
|
327
|
-
emit("update:modelValue",{
|
|
328
|
-
startDay: value,
|
|
329
|
-
startHour: 0,
|
|
330
|
-
startMinute: 0,
|
|
331
|
-
endDay: value,
|
|
332
|
-
endHour: 0,
|
|
333
|
-
endMinute: 0
|
|
334
|
-
});
|
|
335
253
|
};
|
|
336
254
|
|
|
337
255
|
const onChangeHourEnd = (value: number) => {
|
|
@@ -344,35 +262,41 @@ export default defineComponent({
|
|
|
344
262
|
startMinute: realTime.value.startMinute,
|
|
345
263
|
endDay: realTime.value.endDay,
|
|
346
264
|
endHour: innerHours,
|
|
347
|
-
endMinute: innerMinutes
|
|
265
|
+
endMinute: innerMinutes,
|
|
266
|
+
variant: realTime.value.variant
|
|
348
267
|
};
|
|
349
268
|
const newTime = applyOffset(t, true);
|
|
350
|
-
|
|
351
269
|
emit("update:modelValue", newTime);
|
|
352
|
-
return;
|
|
353
270
|
}
|
|
354
|
-
emit("update:modelValue",{
|
|
355
|
-
startDay: 0,
|
|
356
|
-
startHour: 0,
|
|
357
|
-
startMinute: 0,
|
|
358
|
-
endDay: 0,
|
|
359
|
-
endHour: innerHours,
|
|
360
|
-
endMinute: innerMinutes
|
|
361
|
-
});
|
|
362
271
|
}
|
|
363
272
|
|
|
273
|
+
const onUpdateVariant = (value: DateType) => {
|
|
274
|
+
const t = applyOffset({
|
|
275
|
+
startDay: realTime.value.startDay,
|
|
276
|
+
startHour: realTime.value.startHour,
|
|
277
|
+
startMinute: realTime.value.startMinute,
|
|
278
|
+
endDay: realTime.value.endDay,
|
|
279
|
+
endHour: realTime.value.endHour,
|
|
280
|
+
endMinute: realTime.value.endMinute,
|
|
281
|
+
variant: value
|
|
282
|
+
}, true);
|
|
283
|
+
emit("update:modelValue", t );
|
|
284
|
+
};
|
|
285
|
+
|
|
364
286
|
return {
|
|
365
|
-
|
|
287
|
+
dateTypeItems,
|
|
366
288
|
validateOn,
|
|
289
|
+
daysItems,
|
|
367
290
|
ColorEnum,
|
|
368
291
|
startTime,
|
|
369
292
|
realTime,
|
|
370
293
|
messages,
|
|
294
|
+
DateType,
|
|
371
295
|
endTime,
|
|
372
|
-
style,
|
|
373
296
|
onChangeHourStart,
|
|
374
297
|
onChangeDayStart,
|
|
375
298
|
onChangeHourEnd,
|
|
299
|
+
onUpdateVariant,
|
|
376
300
|
onChangeDayEnd
|
|
377
301
|
};
|
|
378
302
|
}
|
|
@@ -112,12 +112,15 @@ export default defineComponent({
|
|
|
112
112
|
default: true,
|
|
113
113
|
},
|
|
114
114
|
modelValue: {
|
|
115
|
-
type: String as PropType<string | null>,
|
|
115
|
+
type: [Object, String] as PropType<{ [key: string]: any } | string | null>,
|
|
116
116
|
required: false,
|
|
117
117
|
default: null
|
|
118
118
|
},
|
|
119
119
|
translations: {
|
|
120
|
-
type: Array as PropType<{
|
|
120
|
+
type: Array as PropType<{
|
|
121
|
+
languageCode: string;
|
|
122
|
+
[key: string]: string | object | null;
|
|
123
|
+
}[]>,
|
|
121
124
|
required: false,
|
|
122
125
|
default: () => []
|
|
123
126
|
},
|
|
@@ -133,7 +136,7 @@ export default defineComponent({
|
|
|
133
136
|
|
|
134
137
|
const innerTranslations = ref(props.translations);
|
|
135
138
|
|
|
136
|
-
const getTranslation = (languageCode: string): string => {
|
|
139
|
+
const getTranslation = (languageCode: string): string | object => {
|
|
137
140
|
if (!innerTranslations.value) {
|
|
138
141
|
return emptyLexicalState;
|
|
139
142
|
}
|
|
@@ -141,7 +144,7 @@ export default defineComponent({
|
|
|
141
144
|
if (!translation || !translation[props.property]) {
|
|
142
145
|
return emptyLexicalState;
|
|
143
146
|
}
|
|
144
|
-
return translation[props.property]
|
|
147
|
+
return translation[props.property]!;
|
|
145
148
|
};
|
|
146
149
|
|
|
147
150
|
const setTranslation = (languageCode: string, value: string): void => {
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
v-if="$props.showSearch"
|
|
16
16
|
>
|
|
17
17
|
<FSSearchField
|
|
18
|
-
prependInnerIcon="mdi-magnify"
|
|
19
18
|
:hideHeader="true"
|
|
20
19
|
v-model="innerSearch"
|
|
21
20
|
/>
|
|
@@ -1344,6 +1343,7 @@ export default defineComponent({
|
|
|
1344
1343
|
}, { threshold: [0.9] });
|
|
1345
1344
|
}
|
|
1346
1345
|
if (document.querySelector(`#${elementId}`)) {
|
|
1346
|
+
intersectionObserver.value.unobserve(document.querySelector(`#${elementId}`)!);
|
|
1347
1347
|
intersectionObserver.value.observe(document.querySelector(`#${elementId}`)!);
|
|
1348
1348
|
}
|
|
1349
1349
|
return;
|
|
@@ -1516,6 +1516,10 @@ export default defineComponent({
|
|
|
1516
1516
|
.some((key) => filters.value[key].some((filter) => filter.hidden));
|
|
1517
1517
|
}, { deep: true });
|
|
1518
1518
|
|
|
1519
|
+
watch(size, () => {
|
|
1520
|
+
observeIntersection();
|
|
1521
|
+
});
|
|
1522
|
+
|
|
1519
1523
|
watch(innerMode, () => {
|
|
1520
1524
|
emit("update:mode", innerMode.value);
|
|
1521
1525
|
size.value = props.sizeIterator;
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
/>
|
|
34
34
|
<FSButtonRemoveIcon
|
|
35
35
|
v-if="canEditRemove"
|
|
36
|
-
@click="
|
|
36
|
+
@click="removeDialog = true"
|
|
37
37
|
/>
|
|
38
38
|
</FSRow>
|
|
39
39
|
</template>
|
|
@@ -63,18 +63,25 @@
|
|
|
63
63
|
@submit="updateComment"
|
|
64
64
|
/>
|
|
65
65
|
</FSCol>
|
|
66
|
+
<FSDialogRemove
|
|
67
|
+
v-model="removeDialog"
|
|
68
|
+
:removeTotal="1"
|
|
69
|
+
:removing="removing"
|
|
70
|
+
@click:submitButton="$emit('remove')"
|
|
71
|
+
/>
|
|
66
72
|
</FSCol>
|
|
67
73
|
</template>
|
|
68
74
|
|
|
69
75
|
<script lang="ts">
|
|
70
76
|
import type { PropType} from "vue";
|
|
71
|
-
import { defineComponent, ref } from "vue";
|
|
77
|
+
import { defineComponent, ref, watch } from "vue";
|
|
72
78
|
|
|
73
79
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
74
80
|
|
|
75
81
|
import FSButtonRemoveIcon from "../buttons/FSButtonRemoveIcon.vue";
|
|
76
|
-
import FSCommentField from "../fields/FSCommentField.vue";
|
|
77
82
|
import FSButtonEditIcon from "../buttons/FSButtonEditIcon.vue";
|
|
83
|
+
import FSCommentField from "../fields/FSCommentField.vue";
|
|
84
|
+
import FSDialogRemove from "../FSDialogRemove.vue";
|
|
78
85
|
import FSImage from "../FSImage.vue";
|
|
79
86
|
import FSCard from "../FSCard.vue";
|
|
80
87
|
import FSText from "../FSText.vue";
|
|
@@ -85,8 +92,9 @@ export default defineComponent({
|
|
|
85
92
|
name: "FSCommentTileUI",
|
|
86
93
|
components: {
|
|
87
94
|
FSButtonRemoveIcon,
|
|
88
|
-
FSCommentField,
|
|
89
95
|
FSButtonEditIcon,
|
|
96
|
+
FSCommentField,
|
|
97
|
+
FSDialogRemove,
|
|
90
98
|
FSImage,
|
|
91
99
|
FSCard,
|
|
92
100
|
FSText,
|
|
@@ -128,20 +136,33 @@ export default defineComponent({
|
|
|
128
136
|
type: Boolean,
|
|
129
137
|
required: false,
|
|
130
138
|
default: false
|
|
139
|
+
},
|
|
140
|
+
removing: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
required: false,
|
|
143
|
+
default: false
|
|
131
144
|
}
|
|
132
145
|
},
|
|
133
146
|
emits: ["edit", "remove"],
|
|
134
147
|
setup(props, { emit }) {
|
|
135
148
|
const showEditComment = ref(false);
|
|
149
|
+
const removeDialog = ref(false);
|
|
136
150
|
|
|
137
151
|
const updateComment = (comment: string) => {
|
|
138
152
|
emit('edit',{commentId : props.id, comment : comment})
|
|
139
153
|
showEditComment.value = false;
|
|
140
154
|
};
|
|
141
155
|
|
|
156
|
+
watch(() => props.removing, () => {
|
|
157
|
+
if (!props.removing) {
|
|
158
|
+
removeDialog.value = false;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
|
|
142
162
|
return {
|
|
143
|
-
ColorEnum,
|
|
144
163
|
showEditComment,
|
|
164
|
+
removeDialog,
|
|
165
|
+
ColorEnum,
|
|
145
166
|
updateComment
|
|
146
167
|
};
|
|
147
168
|
}
|
package/models/variableNode.ts
CHANGED
|
@@ -51,14 +51,17 @@ export class VariableNode extends DecoratorNode<Element> {
|
|
|
51
51
|
content.classList.add("fs-rich-text-field-node-variable-value");
|
|
52
52
|
if (_editor._rootElement) {
|
|
53
53
|
content.textContent = this.getValue(_editor._rootElement);
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
|
|
55
|
+
const observer = new MutationObserver(() => {
|
|
56
|
+
content.textContent = this.getValue(_editor._rootElement!);
|
|
57
|
+
});
|
|
58
|
+
observer.observe(_editor._rootElement, { attributes: true, attributeFilter: ['data-variable-values'] });
|
|
59
|
+
} else {
|
|
56
60
|
content.textContent = this.__defaultValue;
|
|
57
61
|
}
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
62
|
+
} else {
|
|
60
63
|
content.classList.add("fs-rich-text-field-node-variable-code");
|
|
61
|
-
content.textContent = `{${this.__code}}
|
|
64
|
+
content.textContent = `{${this.__code}}`;
|
|
62
65
|
}
|
|
63
66
|
container.appendChild(content);
|
|
64
67
|
return container;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-shared-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.88",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-shared-domain": "1.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "1.0.88",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.88"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@dative-gpi/bones-ui": "^1.0.0",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"sass": "1.71.1",
|
|
36
36
|
"sass-loader": "13.3.2"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "ab11b2d34cc774a15549d7450ae6d06a6c6023ee"
|
|
39
39
|
}
|
package/tools/alertsTools.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
2
2
|
import { AlertStatus, Criticity } from "@dative-gpi/foundation-shared-domain/enums";
|
|
3
3
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models"
|
|
4
|
+
import { getTimeBestString } from "../utils";
|
|
4
5
|
|
|
5
6
|
const { $tr } = useTranslationsProvider();
|
|
6
7
|
|
|
@@ -51,4 +52,17 @@ export const AlertTools = {
|
|
|
51
52
|
default: return $tr("ui.alert.information", "Information");
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
|
-
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const prettyDuration = (n: number) => {
|
|
58
|
+
const day = Math.floor(n / 24 / 60 / 60);
|
|
59
|
+
const hours = Math.floor((n - day * 24 * 60 * 60) / 3600);
|
|
60
|
+
const minutes = Math.floor((n - day * 24 * 60 * 60 - hours * 60 * 60) / 60);
|
|
61
|
+
const seconds = Math.floor(n - day * 24 * 60 * 60 - hours * 60 * 60 - minutes * 60);
|
|
62
|
+
|
|
63
|
+
return day > 0 ?
|
|
64
|
+
`${getTimeBestString(day * 24 * 60 * 60)} ${getTimeBestString(hours * 60 * 60)} ${getTimeBestString(minutes * 60)} ${getTimeBestString(seconds)}`
|
|
65
|
+
: hours > 0
|
|
66
|
+
? `${getTimeBestString(hours * 60 * 60)} ${getTimeBestString(minutes * 60)} ${getTimeBestString(seconds)}`
|
|
67
|
+
: `${getTimeBestString(minutes * 60)} ${getTimeBestString(seconds)}`;
|
|
68
|
+
};
|