@dative-gpi/foundation-shared-components 1.0.41 → 1.0.43
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/FSCalendar.vue +2 -2
- package/components/FSCalendarTwin.vue +2 -2
- package/components/FSClock.vue +2 -2
- package/components/deviceOrganisations/FSConnectivityCard.vue +2 -2
- package/components/deviceOrganisations/FSStatusCard.vue +2 -2
- package/components/deviceOrganisations/FSWorstAlertCard.vue +2 -2
- package/components/fields/FSAutocompleteField.vue +421 -432
- package/components/fields/FSDateField.vue +2 -2
- package/components/fields/FSDateRangeField.vue +2 -2
- package/components/fields/FSDateTimeField.vue +4 -3
- package/components/fields/FSDateTimeRangeField.vue +7 -6
- package/components/fields/FSGradientField.vue +27 -33
- package/components/fields/FSMagicField.vue +2 -2
- package/components/fields/FSSelectField.vue +389 -400
- package/components/fields/FSTermField.vue +17 -8
- package/components/selects/FSSelectDateSetting.vue +1 -0
- package/models/rules.ts +2 -2
- package/package.json +4 -4
- package/styles/components/fs_gradient_field.scss +11 -11
- package/styles/components/fs_select_date_settings.scss +3 -0
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
:rules="[DateRules.required()]"
|
|
69
69
|
:editable="$props.editable"
|
|
70
70
|
:hideHeader="true"
|
|
71
|
-
:modelValue="
|
|
71
|
+
:modelValue="actualValue"
|
|
72
72
|
@update:modelValue="onPickDates"
|
|
73
73
|
/>
|
|
74
74
|
</FSRow>
|
|
@@ -81,7 +81,7 @@ import { computed, defineComponent, type PropType, ref, watch } from "vue";
|
|
|
81
81
|
import _ from "lodash";
|
|
82
82
|
|
|
83
83
|
import { DateRules, NumberRules, TextRules } from "@dative-gpi/foundation-shared-components/models";
|
|
84
|
-
import {
|
|
84
|
+
import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
|
|
85
85
|
import { useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
86
86
|
import { DateSetting } from "@dative-gpi/foundation-shared-domain/models";
|
|
87
87
|
|
|
@@ -163,7 +163,7 @@ export default defineComponent({
|
|
|
163
163
|
},
|
|
164
164
|
emits: ["update:startDate", "update:endDate"],
|
|
165
165
|
setup(props, { emit }) {
|
|
166
|
-
const { parseForPicker,
|
|
166
|
+
const { parseForPicker, epochToISO, todayToPicker, yesterdayToPicker } = useDateFormat();
|
|
167
167
|
const { getMessages } = useRules();
|
|
168
168
|
|
|
169
169
|
const innerDateSetting = ref<DateSetting>(DateSetting.PastDays);
|
|
@@ -181,6 +181,14 @@ export default defineComponent({
|
|
|
181
181
|
];
|
|
182
182
|
});
|
|
183
183
|
|
|
184
|
+
const actualValue = computed(() => {
|
|
185
|
+
const dates = [parseForPicker(innerStartDate.value), parseForPicker(innerEndDate.value)]
|
|
186
|
+
if(dates.some(d => d == null)) {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
return dates as [number, number];
|
|
190
|
+
})
|
|
191
|
+
|
|
184
192
|
const messages = computed((): string[] => {
|
|
185
193
|
return props.messages ??
|
|
186
194
|
getMessages(props.startDate, props.rules).concat(getMessages(props.endDate, props.rules));
|
|
@@ -418,14 +426,14 @@ export default defineComponent({
|
|
|
418
426
|
}
|
|
419
427
|
else {
|
|
420
428
|
console.log(value[0], value[1]);
|
|
421
|
-
if (value && value[0] != null &&
|
|
422
|
-
innerStartDate.value =
|
|
429
|
+
if (value && value[0] != null && epochToISO(value[0]) !== innerStartDate.value) {
|
|
430
|
+
innerStartDate.value = epochToISO(value[0]);
|
|
423
431
|
if (valid.value) {
|
|
424
432
|
emit("update:startDate", innerStartDate.value);
|
|
425
433
|
}
|
|
426
434
|
}
|
|
427
|
-
if (value && value[1] != null &&
|
|
428
|
-
innerEndDate.value =
|
|
435
|
+
if (value && value[1] != null && epochToISO(value[1]) !== innerEndDate.value) {
|
|
436
|
+
innerEndDate.value = epochToISO(value[1]);
|
|
429
437
|
if (valid.value) {
|
|
430
438
|
emit("update:endDate", innerEndDate.value);
|
|
431
439
|
}
|
|
@@ -619,7 +627,7 @@ export default defineComponent({
|
|
|
619
627
|
}
|
|
620
628
|
}
|
|
621
629
|
|
|
622
|
-
if (parseForPicker(props.endDate) != null && parseForPicker(props.startDate) != null) {
|
|
630
|
+
if (props.endDate && parseForPicker(props.endDate) != null && props.startDate && parseForPicker(props.startDate) != null) {
|
|
623
631
|
innerDateSetting.value = DateSetting.Pick;
|
|
624
632
|
innerDateValue.value = 1;
|
|
625
633
|
return;
|
|
@@ -643,6 +651,7 @@ export default defineComponent({
|
|
|
643
651
|
innerDateValue,
|
|
644
652
|
innerStartDate,
|
|
645
653
|
innerEndDate,
|
|
654
|
+
actualValue,
|
|
646
655
|
pastSettings,
|
|
647
656
|
DateSetting,
|
|
648
657
|
NumberRules,
|
package/models/rules.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
2
|
-
import {
|
|
2
|
+
import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
|
|
3
3
|
import { validateExpression } from "@dative-gpi/foundation-shared-domain/tools";
|
|
4
4
|
|
|
5
5
|
import { getTimeBestString } from "../utils";
|
|
6
6
|
import type { TimeUnit } from "@/shared/foundation-shared-domain";
|
|
7
7
|
|
|
8
|
-
const { epochToLongDateFormat } =
|
|
8
|
+
const { epochToLongDateFormat } = useDateFormat()!;
|
|
9
9
|
const { $tr } = useTranslationsProvider();
|
|
10
10
|
|
|
11
11
|
export const TextRules = {
|
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.43",
|
|
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.43",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.43"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@dative-gpi/bones-ui": "^0.0.75",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"sass": "1.71.1",
|
|
36
36
|
"sass-loader": "13.3.2"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "30a450a1f1843ffd8d38d5ff3f86c4349480ed74"
|
|
39
39
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
.fs-gradient-field-select > .v-input__control > .v-field {
|
|
2
|
+
display: flex;
|
|
1
3
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
& > .v-field__prepend-inner {
|
|
5
|
+
flex: 1;
|
|
6
|
+
}
|
|
7
7
|
|
|
8
|
-
.
|
|
9
|
-
|
|
10
|
-
> span {
|
|
11
|
-
height: 12px;
|
|
12
|
-
background: var(--fs-gradient-field-background) !important;
|
|
13
|
-
width: 100%;
|
|
8
|
+
& > .v-field__field {
|
|
9
|
+
flex: 0;
|
|
14
10
|
}
|
|
15
11
|
}
|
|
16
12
|
|
|
13
|
+
.fs-gradient-field-preview {
|
|
14
|
+
background: var(--fs-gradient-field-background) !important;
|
|
15
|
+
min-width: 100%;
|
|
16
|
+
}
|