@dative-gpi/foundation-shared-components 0.0.49 → 0.0.51
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/FSAccordion.vue +3 -3
- package/components/FSAccordionPanel.vue +5 -5
- package/components/FSBadge.vue +1 -1
- package/components/FSBreadcrumbs.vue +1 -1
- package/components/FSButton.vue +5 -5
- package/components/FSCalendar.vue +22 -12
- package/components/FSCalendarTwin.vue +16 -12
- package/components/FSCard.vue +11 -2
- package/components/FSCarousel.vue +1 -1
- package/components/FSCheckbox.vue +4 -4
- package/components/FSChip.vue +4 -4
- package/components/FSClickable.vue +1 -1
- package/components/FSClock.vue +40 -48
- package/components/FSCol.vue +1 -1
- package/components/FSColor.vue +9 -7
- package/components/FSColorIcon.vue +1 -1
- package/components/FSDivider.vue +2 -2
- package/components/FSEditImage.vue +131 -0
- package/components/FSErrorToast.vue +1 -1
- package/components/FSFadeOut.vue +1 -1
- package/components/FSForm.vue +4 -4
- package/components/FSGrid.vue +1 -1
- package/components/FSImage.vue +50 -12
- package/components/FSLabel.vue +1 -1
- package/components/FSLink.vue +1 -1
- package/components/FSLoader.vue +1 -1
- package/components/FSOptionGroup.vue +3 -3
- package/components/FSOptionItem.vue +4 -4
- package/components/FSPagination.vue +1 -1
- package/components/FSRadio.vue +4 -4
- package/components/FSRadioGroup.vue +3 -3
- package/components/FSRow.vue +1 -1
- package/components/FSSlideGroup.vue +11 -11
- package/components/FSSlider.vue +4 -4
- package/components/FSSpan.vue +1 -1
- package/components/FSSubmitDialog.vue +8 -8
- package/components/FSSwitch.vue +4 -4
- package/components/FSTab.vue +4 -4
- package/components/FSTabs.vue +2 -2
- package/components/FSTag.vue +2 -2
- package/components/FSText.vue +1 -1
- package/components/FSToggleSet.vue +4 -4
- package/components/FSWindow.vue +1 -1
- package/components/FSWrapGroup.vue +2 -2
- package/components/buttons/FSButtonFile.vue +17 -10
- package/components/buttons/FSButtonFileIcon.vue +17 -10
- package/components/buttons/FSButtonFileLabel.vue +17 -10
- package/components/buttons/FSButtonFileMini.vue +17 -10
- package/components/deviceOrganisations/FSConnectivityCard.vue +2 -2
- package/components/deviceOrganisations/FSStatusCard.vue +2 -2
- package/components/deviceOrganisations/FSStatusesCarousel.vue +2 -3
- package/components/deviceOrganisations/FSStatusesRow.vue +2 -3
- package/components/deviceOrganisations/FSWorstAlertCard.vue +2 -2
- package/components/fields/FSAutocompleteField.vue +5 -5
- package/components/fields/FSColorField.vue +3 -3
- package/components/fields/FSDateField.vue +10 -9
- package/components/fields/FSDateRangeField.vue +8 -8
- package/components/fields/FSDateTimeField.vue +16 -14
- package/components/fields/FSDateTimeRangeField.vue +12 -14
- package/components/fields/FSIconField.vue +10 -10
- package/components/fields/FSNumberField.vue +2 -2
- package/components/fields/FSPasswordField.vue +4 -4
- package/components/fields/FSRichTextField.vue +82 -92
- package/components/fields/FSSearchField.vue +8 -8
- package/components/fields/FSSelectField.vue +6 -6
- package/components/fields/FSTagField.vue +4 -4
- package/components/fields/FSTextArea.vue +5 -5
- package/components/fields/FSTextField.vue +5 -5
- package/components/fields/FSTimeField.vue +15 -9
- package/components/fields/FSTimeSlotField.vue +49 -21
- package/components/lists/FSDataTableUI.vue +24 -12
- package/components/lists/FSDraggable.vue +12 -6
- package/components/lists/FSFilterButton.vue +11 -8
- package/components/lists/FSLoadDataTable.vue +1 -1
- package/components/selects/FSSelectTimeZone.vue +7 -11
- package/components/tiles/FSDeviceOrganisationTileUI.vue +3 -3
- package/components/tiles/FSGroupTileUI.vue +3 -3
- package/components/tiles/FSLoadTile.vue +1 -1
- package/components/tiles/FSTile.vue +1 -1
- package/composables/index.ts +1 -0
- package/composables/useFiles.ts +13 -0
- package/composables/useRules.ts +1 -1
- package/models/colors.ts +1 -1
- package/models/deviceStatuses.ts +1 -1
- package/models/images.ts +4 -0
- package/models/index.ts +1 -0
- package/models/rules.ts +2 -2
- package/package.json +4 -4
- package/styles/components/fs_clock.scss +3 -2
- package/styles/components/fs_edit_image.scss +3 -0
- package/styles/components/index.scss +1 -0
- package/styles/globals/overrides.scss +1 -1
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
:modelValue="tabs"
|
|
43
43
|
>
|
|
44
44
|
<FSCard
|
|
45
|
+
padding="8px"
|
|
45
46
|
width="346px"
|
|
46
47
|
:elevation="true"
|
|
47
48
|
:border="false"
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
v-model="innerDate"
|
|
54
55
|
/>
|
|
55
56
|
<FSButton
|
|
56
|
-
|
|
57
|
+
width="100%"
|
|
57
58
|
:color="$props.color"
|
|
58
59
|
:label="$tr('ui.date-menu.validate', 'Validate')"
|
|
59
60
|
@click="tabs++"
|
|
@@ -61,6 +62,7 @@
|
|
|
61
62
|
</FSCol>
|
|
62
63
|
</FSCard>
|
|
63
64
|
<FSCard
|
|
65
|
+
padding="8px"
|
|
64
66
|
width="394px"
|
|
65
67
|
:elevation="true"
|
|
66
68
|
:border="false"
|
|
@@ -72,7 +74,7 @@
|
|
|
72
74
|
v-model="innerTime"
|
|
73
75
|
/>
|
|
74
76
|
<FSButton
|
|
75
|
-
|
|
77
|
+
width="100%"
|
|
76
78
|
:color="$props.color"
|
|
77
79
|
:label="$tr('ui.date-menu.validate', 'Validate')"
|
|
78
80
|
@click="onSubmit"
|
|
@@ -88,7 +90,7 @@ import { computed, defineComponent, PropType, ref, watch } from "vue";
|
|
|
88
90
|
|
|
89
91
|
import { useColors, useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
90
92
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
91
|
-
import {
|
|
93
|
+
import { useAppTimeZone } from "@dative-gpi/foundation-shared-services/composables";
|
|
92
94
|
|
|
93
95
|
import FSTextField from "./FSTextField.vue";
|
|
94
96
|
import FSCalendar from "../FSCalendar.vue";
|
|
@@ -111,17 +113,17 @@ export default defineComponent({
|
|
|
111
113
|
},
|
|
112
114
|
props: {
|
|
113
115
|
label: {
|
|
114
|
-
type: String
|
|
116
|
+
type: String as PropType<string | null>,
|
|
115
117
|
required: false,
|
|
116
118
|
default: null
|
|
117
119
|
},
|
|
118
120
|
description: {
|
|
119
|
-
type: String
|
|
121
|
+
type: String as PropType<string | null>,
|
|
120
122
|
required: false,
|
|
121
123
|
default: null
|
|
122
124
|
},
|
|
123
125
|
modelValue: {
|
|
124
|
-
type: Number
|
|
126
|
+
type: Number as PropType<number | null>,
|
|
125
127
|
required: false,
|
|
126
128
|
default: null
|
|
127
129
|
},
|
|
@@ -141,7 +143,7 @@ export default defineComponent({
|
|
|
141
143
|
default: false
|
|
142
144
|
},
|
|
143
145
|
rules: {
|
|
144
|
-
type: Array as PropType<
|
|
146
|
+
type: Array as PropType<any[]>,
|
|
145
147
|
required: false,
|
|
146
148
|
default: () => []
|
|
147
149
|
},
|
|
@@ -153,7 +155,7 @@ export default defineComponent({
|
|
|
153
155
|
},
|
|
154
156
|
emits: ["update:modelValue"],
|
|
155
157
|
setup(props, { emit }) {
|
|
156
|
-
const { getUserOffsetMillis, epochToLongTimeFormat } =
|
|
158
|
+
const { getUserOffsetMillis, epochToLongTimeFormat } = useAppTimeZone();
|
|
157
159
|
const { validateOn, blurred, getMessages } = useRules();
|
|
158
160
|
const { getColors } = useColors();
|
|
159
161
|
|
|
@@ -163,17 +165,17 @@ export default defineComponent({
|
|
|
163
165
|
|
|
164
166
|
const menu = ref(false);
|
|
165
167
|
const tabs = ref(0);
|
|
166
|
-
|
|
167
|
-
// FSClock just gives two numbers without consideration for the time zone
|
|
168
|
-
// We must adjust the time to the user's time zone
|
|
168
|
+
const innerDate = ref<number | null>(null);
|
|
169
169
|
const innerTime = ref(0);
|
|
170
|
-
|
|
170
|
+
|
|
171
171
|
if (props.modelValue) {
|
|
172
|
+
// FSClock just gives two numbers without consideration for the time zone
|
|
173
|
+
// We must adjust the time to the user's time zone
|
|
172
174
|
innerTime.value = Math.floor((props.modelValue + getUserOffsetMillis()) % (24 * 60 * 60 * 1000));
|
|
173
175
|
innerDate.value = props.modelValue - innerTime.value;
|
|
174
176
|
}
|
|
175
177
|
|
|
176
|
-
const style = computed((): {[
|
|
178
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
177
179
|
if (!props.editable) {
|
|
178
180
|
return {
|
|
179
181
|
"--fs-date-field-color": lights.dark
|
|
@@ -194,7 +196,7 @@ export default defineComponent({
|
|
|
194
196
|
};
|
|
195
197
|
|
|
196
198
|
const onSubmit = (): void => {
|
|
197
|
-
emit("update:modelValue", innerDate.value + innerTime.value);
|
|
199
|
+
emit("update:modelValue", (innerDate.value ?? 0) + innerTime.value);
|
|
198
200
|
menu.value = false;
|
|
199
201
|
};
|
|
200
202
|
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
width="calc(50% - 4px)"
|
|
51
51
|
>
|
|
52
52
|
<FSClock
|
|
53
|
-
:reminder="true"
|
|
54
53
|
:color="$props.color"
|
|
55
54
|
:date="innerDateLeft"
|
|
56
55
|
v-model="innerTimeLeft"
|
|
@@ -60,7 +59,6 @@
|
|
|
60
59
|
width="calc(50% - 4px)"
|
|
61
60
|
>
|
|
62
61
|
<FSClock
|
|
63
|
-
:reminder="true"
|
|
64
62
|
:color="$props.color"
|
|
65
63
|
:date="innerDateRight"
|
|
66
64
|
v-model="innerTimeRight"
|
|
@@ -77,7 +75,7 @@ import { computed, defineComponent, PropType, ref } from "vue";
|
|
|
77
75
|
|
|
78
76
|
import { useColors, useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
79
77
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
80
|
-
import {
|
|
78
|
+
import { useAppTimeZone } from "@dative-gpi/foundation-shared-services/composables";
|
|
81
79
|
|
|
82
80
|
import FSSubmitDialog from "../FSSubmitDialog.vue";
|
|
83
81
|
import FSCalendarTwin from "../FSCalendarTwin.vue";
|
|
@@ -100,17 +98,17 @@ export default defineComponent({
|
|
|
100
98
|
},
|
|
101
99
|
props: {
|
|
102
100
|
label: {
|
|
103
|
-
type: String
|
|
101
|
+
type: String as PropType<string | null>,
|
|
104
102
|
required: false,
|
|
105
103
|
default: null
|
|
106
104
|
},
|
|
107
105
|
description: {
|
|
108
|
-
type: String
|
|
106
|
+
type: String as PropType<string | null>,
|
|
109
107
|
required: false,
|
|
110
108
|
default: null
|
|
111
109
|
},
|
|
112
110
|
modelValue: {
|
|
113
|
-
type: Array as PropType<number[]>,
|
|
111
|
+
type: Array as PropType<number[] | null>,
|
|
114
112
|
required: false,
|
|
115
113
|
default: null
|
|
116
114
|
},
|
|
@@ -130,7 +128,7 @@ export default defineComponent({
|
|
|
130
128
|
default: false
|
|
131
129
|
},
|
|
132
130
|
rules: {
|
|
133
|
-
type: Array as PropType<
|
|
131
|
+
type: Array as PropType<any[]>,
|
|
134
132
|
required: false,
|
|
135
133
|
default: () => []
|
|
136
134
|
},
|
|
@@ -142,7 +140,7 @@ export default defineComponent({
|
|
|
142
140
|
},
|
|
143
141
|
emits: ["update:modelValue"],
|
|
144
142
|
setup(props, { emit }) {
|
|
145
|
-
const { getUserOffsetMillis, epochToShortTimeFormat } =
|
|
143
|
+
const { getUserOffsetMillis, epochToShortTimeFormat } = useAppTimeZone();
|
|
146
144
|
const { validateOn, blurred, getMessages } = useRules();
|
|
147
145
|
const { getColors } = useColors();
|
|
148
146
|
|
|
@@ -151,13 +149,13 @@ export default defineComponent({
|
|
|
151
149
|
const darks = getColors(ColorEnum.Dark);
|
|
152
150
|
|
|
153
151
|
const dialog = ref(false);
|
|
154
|
-
|
|
155
|
-
// FSClock just gives two numbers without consideration for the time zone
|
|
156
|
-
// We must adjust the time to the user's time zone
|
|
157
|
-
const innerTimeLeft = ref(0);
|
|
152
|
+
const innerDateRange = ref<number[] | null>(null);
|
|
158
153
|
const innerTimeRight = ref(0);
|
|
159
|
-
const
|
|
154
|
+
const innerTimeLeft = ref(0);
|
|
155
|
+
|
|
160
156
|
if (props.modelValue && Array.isArray(props.modelValue)) {
|
|
157
|
+
// FSClock just gives two numbers without consideration for the time zone
|
|
158
|
+
// We must adjust the time to the user's time zone
|
|
161
159
|
switch (props.modelValue.length) {
|
|
162
160
|
case 0: {
|
|
163
161
|
break;
|
|
@@ -174,7 +172,7 @@ export default defineComponent({
|
|
|
174
172
|
}
|
|
175
173
|
}
|
|
176
174
|
|
|
177
|
-
const style = computed((): {[
|
|
175
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
178
176
|
if (!props.editable) {
|
|
179
177
|
return {
|
|
180
178
|
"--fs-date-field-color": lights.dark
|
|
@@ -61,12 +61,12 @@ export default defineComponent({
|
|
|
61
61
|
},
|
|
62
62
|
props: {
|
|
63
63
|
label: {
|
|
64
|
-
type: String
|
|
64
|
+
type: String as PropType<string | null>,
|
|
65
65
|
required: false,
|
|
66
66
|
default: null
|
|
67
67
|
},
|
|
68
68
|
description: {
|
|
69
|
-
type: String
|
|
69
|
+
type: String as PropType<string | null>,
|
|
70
70
|
required: false,
|
|
71
71
|
default: null
|
|
72
72
|
},
|
|
@@ -86,7 +86,7 @@ export default defineComponent({
|
|
|
86
86
|
default: "standard"
|
|
87
87
|
},
|
|
88
88
|
modelValue: {
|
|
89
|
-
type: String
|
|
89
|
+
type: String as PropType<string | null>,
|
|
90
90
|
required: false,
|
|
91
91
|
default: null
|
|
92
92
|
},
|
|
@@ -111,7 +111,7 @@ export default defineComponent({
|
|
|
111
111
|
default: false
|
|
112
112
|
},
|
|
113
113
|
rules: {
|
|
114
|
-
type: Array as PropType<
|
|
114
|
+
type: Array as PropType<any[]>,
|
|
115
115
|
required: false,
|
|
116
116
|
default: () => []
|
|
117
117
|
},
|
|
@@ -130,10 +130,10 @@ export default defineComponent({
|
|
|
130
130
|
const lights = getColors(ColorEnum.Light);
|
|
131
131
|
const darks = getColors(ColorEnum.Dark);
|
|
132
132
|
|
|
133
|
-
const toggleSetRef = ref(null);
|
|
134
|
-
const innerValue = ref(null);
|
|
133
|
+
const toggleSetRef = ref<HTMLElement | null>(null);
|
|
134
|
+
const innerValue = ref<string | null>(null);
|
|
135
135
|
|
|
136
|
-
const style = computed((): {[
|
|
136
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
137
137
|
if (!props.editable) {
|
|
138
138
|
return {
|
|
139
139
|
"--fs-icon-field-color": lights.dark
|
|
@@ -163,8 +163,8 @@ export default defineComponent({
|
|
|
163
163
|
}
|
|
164
164
|
else {
|
|
165
165
|
const matchingIcons = Icons.filter((icon) => {
|
|
166
|
-
return icon.fullText.toLowerCase().includes(innerValue.value
|
|
167
|
-
}).sort((a, b) => sortByLevenshteinDistance(a.name, b.name, innerValue.value));
|
|
166
|
+
return icon.fullText.toLowerCase().includes(innerValue.value!.toLowerCase());
|
|
167
|
+
}).sort((a, b) => sortByLevenshteinDistance(a.name, b.name, innerValue.value!));
|
|
168
168
|
innerIcons.push(...matchingIcons.slice(0, Math.min(32, matchingIcons.length)).map((icon) => ({
|
|
169
169
|
id: icon.name,
|
|
170
170
|
prependIcon: icon.name
|
|
@@ -190,7 +190,7 @@ export default defineComponent({
|
|
|
190
190
|
|
|
191
191
|
watch(() => props.modelValue, () => {
|
|
192
192
|
if (toggleSetRef.value) {
|
|
193
|
-
toggleSetRef.value.goToStart();
|
|
193
|
+
(toggleSetRef.value as any).goToStart();
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
196
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script lang="ts">
|
|
15
|
-
import { defineComponent } from "vue";
|
|
15
|
+
import { defineComponent, PropType } from "vue";
|
|
16
16
|
|
|
17
17
|
import FSTextField from "./FSTextField.vue";
|
|
18
18
|
|
|
@@ -23,7 +23,7 @@ export default defineComponent({
|
|
|
23
23
|
},
|
|
24
24
|
props: {
|
|
25
25
|
modelValue: {
|
|
26
|
-
type: Number
|
|
26
|
+
type: Number as PropType<number | null>,
|
|
27
27
|
required: false,
|
|
28
28
|
default: null
|
|
29
29
|
},
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<script lang="ts">
|
|
27
|
-
import { computed, defineComponent, ref } from "vue";
|
|
27
|
+
import { computed, defineComponent, PropType, ref } from "vue";
|
|
28
28
|
|
|
29
29
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
30
30
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
@@ -40,7 +40,7 @@ export default defineComponent({
|
|
|
40
40
|
},
|
|
41
41
|
props: {
|
|
42
42
|
modelValue: {
|
|
43
|
-
type: String
|
|
43
|
+
type: String as PropType<string | null>,
|
|
44
44
|
required: false,
|
|
45
45
|
default: null
|
|
46
46
|
},
|
|
@@ -59,7 +59,7 @@ export default defineComponent({
|
|
|
59
59
|
|
|
60
60
|
const stars = ref(true);
|
|
61
61
|
|
|
62
|
-
const style = computed((): {[
|
|
62
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
63
63
|
if (!props.editable) {
|
|
64
64
|
return {
|
|
65
65
|
"--fs-password-field-cursor" : "default",
|
|
@@ -74,7 +74,7 @@ export default defineComponent({
|
|
|
74
74
|
};
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
const type = computed(():
|
|
77
|
+
const type = computed((): "password" | "text" => stars.value ? "password" : "text");
|
|
78
78
|
|
|
79
79
|
const icon = computed((): string => stars.value ? "mdi-eye-off-outline" : "mdi-eye-outline");
|
|
80
80
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
class="fs-rich-text-field-icon"
|
|
30
30
|
:color="toolbarColors.undo"
|
|
31
31
|
:style="style"
|
|
32
|
-
@click="editor.dispatchCommand(UNDO_COMMAND)"
|
|
32
|
+
@click="editor.dispatchCommand(UNDO_COMMAND, undefined)"
|
|
33
33
|
>
|
|
34
34
|
mdi-undo-variant
|
|
35
35
|
</FSIcon>
|
|
@@ -186,17 +186,17 @@ export default defineComponent({
|
|
|
186
186
|
},
|
|
187
187
|
props: {
|
|
188
188
|
label: {
|
|
189
|
-
type: String
|
|
189
|
+
type: String as PropType<string | null>,
|
|
190
190
|
required: false,
|
|
191
191
|
default: null
|
|
192
192
|
},
|
|
193
193
|
description: {
|
|
194
|
-
type: String
|
|
194
|
+
type: String as PropType<string | null>,
|
|
195
195
|
required: false,
|
|
196
196
|
default: null
|
|
197
197
|
},
|
|
198
198
|
modelValue: {
|
|
199
|
-
type: String
|
|
199
|
+
type: String as PropType<string | null>,
|
|
200
200
|
required: false,
|
|
201
201
|
default: null
|
|
202
202
|
},
|
|
@@ -284,7 +284,7 @@ export default defineComponent({
|
|
|
284
284
|
|
|
285
285
|
if (props.modelValue != null) {
|
|
286
286
|
editor.update((): void => {
|
|
287
|
-
editor.setEditorState(editor.parseEditorState(props.modelValue));
|
|
287
|
+
editor.setEditorState(editor.parseEditorState(props.modelValue!));
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
290
|
else {
|
|
@@ -298,7 +298,7 @@ export default defineComponent({
|
|
|
298
298
|
return ["readonly"].includes(props.variant);
|
|
299
299
|
});
|
|
300
300
|
|
|
301
|
-
const style = computed((): {[
|
|
301
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
302
302
|
let minHeight: string | undefined = "auto";
|
|
303
303
|
if (!readonly.value) {
|
|
304
304
|
const base = isMobileSized.value ? 30 : 42;
|
|
@@ -440,106 +440,96 @@ export default defineComponent({
|
|
|
440
440
|
const selection = $getSelection();
|
|
441
441
|
$setSelection(null);
|
|
442
442
|
|
|
443
|
-
|
|
443
|
+
if (selection != null) {
|
|
444
|
+
const nodes = selection.extract();
|
|
444
445
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
parent.
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
parent.remove();
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
else {
|
|
462
|
-
if (nodes.length === 1) {
|
|
463
|
-
const firstNode = nodes[0];
|
|
464
|
-
const linkNode = getAncestor(firstNode, $isLinkNode);
|
|
465
|
-
|
|
466
|
-
if (linkNode !== null) {
|
|
467
|
-
linkNode.setURL(linkUrl.value);
|
|
468
|
-
if (target !== undefined) {
|
|
469
|
-
linkNode.setTarget(target);
|
|
470
|
-
}
|
|
471
|
-
if (rel !== null) {
|
|
472
|
-
linkNode.setRel(rel);
|
|
473
|
-
}
|
|
474
|
-
if (title !== undefined) {
|
|
475
|
-
linkNode.setTitle(title);
|
|
446
|
+
if (linkUrl.value === null) {
|
|
447
|
+
// Remove LinkNodes
|
|
448
|
+
nodes.forEach((node) => {
|
|
449
|
+
const parent = node.getParent();
|
|
450
|
+
if ($isLinkNode(parent)) {
|
|
451
|
+
const children = parent.getChildren();
|
|
452
|
+
for (let i = 0; i < children.length; i++) {
|
|
453
|
+
parent.insertBefore(children[i]);
|
|
454
|
+
}
|
|
455
|
+
parent.remove();
|
|
476
456
|
}
|
|
477
|
-
|
|
478
|
-
}
|
|
457
|
+
});
|
|
479
458
|
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}
|
|
497
|
-
if (rel !== null) {
|
|
498
|
-
linkNode.setRel(rel);
|
|
499
|
-
}
|
|
500
|
-
if (title !== undefined) {
|
|
501
|
-
linkNode.setTitle(title);
|
|
459
|
+
else {
|
|
460
|
+
if (nodes.length === 1) {
|
|
461
|
+
const firstNode = nodes[0];
|
|
462
|
+
const linkNode = getAncestor(firstNode, $isLinkNode);
|
|
463
|
+
if (linkNode !== null) {
|
|
464
|
+
linkNode.setURL(linkUrl.value);
|
|
465
|
+
if (target !== undefined) {
|
|
466
|
+
linkNode.setTarget(target);
|
|
467
|
+
}
|
|
468
|
+
if (rel !== null) {
|
|
469
|
+
linkNode.setRel(rel);
|
|
470
|
+
}
|
|
471
|
+
if (title !== undefined) {
|
|
472
|
+
linkNode.setTitle(title);
|
|
473
|
+
}
|
|
474
|
+
return;
|
|
502
475
|
}
|
|
503
|
-
return;
|
|
504
476
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
477
|
+
let prevParent: ElementNode | LinkNode | null = null;
|
|
478
|
+
let linkNode: LinkNode | null = null;
|
|
479
|
+
nodes.forEach((node) => {
|
|
480
|
+
const parent = node.getParent();
|
|
481
|
+
if ( parent === linkNode || parent === null || ($isElementNode(node) && !node.isInline())) {
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
510
484
|
if ($isLinkNode(parent)) {
|
|
511
|
-
|
|
512
|
-
|
|
485
|
+
linkNode = parent;
|
|
486
|
+
parent.setURL(linkUrl.value);
|
|
487
|
+
if (target !== undefined) {
|
|
488
|
+
parent.setTarget(target);
|
|
513
489
|
}
|
|
514
|
-
|
|
515
|
-
|
|
490
|
+
if (rel !== null) {
|
|
491
|
+
linkNode.setRel(rel);
|
|
492
|
+
}
|
|
493
|
+
if (title !== undefined) {
|
|
494
|
+
linkNode.setTitle(title);
|
|
516
495
|
}
|
|
496
|
+
return;
|
|
517
497
|
}
|
|
518
|
-
|
|
519
|
-
|
|
498
|
+
if (!parent.is(prevParent)) {
|
|
499
|
+
prevParent = parent;
|
|
500
|
+
linkNode = $createLinkNode(linkUrl.value, {rel, target, title});
|
|
501
|
+
|
|
502
|
+
if ($isLinkNode(parent)) {
|
|
503
|
+
if (node.getPreviousSibling() === null) {
|
|
504
|
+
parent.insertBefore(linkNode);
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
507
|
+
parent.insertAfter(linkNode);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
node.insertBefore(linkNode);
|
|
512
|
+
}
|
|
520
513
|
}
|
|
521
|
-
|
|
514
|
+
if ($isLinkNode(node)) {
|
|
515
|
+
if (node.is(linkNode)) {
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
if (linkNode !== null) {
|
|
519
|
+
const children = node.getChildren();
|
|
522
520
|
|
|
523
|
-
|
|
524
|
-
|
|
521
|
+
for (let i = 0; i < children.length; i++) {
|
|
522
|
+
linkNode.append(children[i]);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
node.remove();
|
|
525
526
|
return;
|
|
526
527
|
}
|
|
527
528
|
if (linkNode !== null) {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
for (let i = 0; i < children.length; i++) {
|
|
531
|
-
linkNode.append(children[i]);
|
|
532
|
-
}
|
|
529
|
+
linkNode.append(node);
|
|
533
530
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
return;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
if (linkNode !== null) {
|
|
540
|
-
linkNode.append(node);
|
|
541
|
-
}
|
|
542
|
-
});
|
|
531
|
+
});
|
|
532
|
+
}
|
|
543
533
|
}
|
|
544
534
|
});
|
|
545
535
|
isLink.value = false;
|
|
@@ -549,7 +539,7 @@ export default defineComponent({
|
|
|
549
539
|
if (JSON.stringify(editor.getEditorState().toJSON()) != props.modelValue) {
|
|
550
540
|
if (props.modelValue != null) {
|
|
551
541
|
editor.update(() => {
|
|
552
|
-
editor.setEditorState(editor.parseEditorState(props.modelValue));
|
|
542
|
+
editor.setEditorState(editor.parseEditorState(props.modelValue!));
|
|
553
543
|
});
|
|
554
544
|
}
|
|
555
545
|
else if (JSON.stringify(editor.getEditorState().toJSON()) !== emptyState) {
|
|
@@ -58,22 +58,22 @@ export default defineComponent({
|
|
|
58
58
|
},
|
|
59
59
|
props: {
|
|
60
60
|
label: {
|
|
61
|
-
type: String
|
|
61
|
+
type: String as PropType<string | null>,
|
|
62
62
|
required: false,
|
|
63
63
|
default: null
|
|
64
64
|
},
|
|
65
65
|
description: {
|
|
66
|
-
type: String
|
|
66
|
+
type: String as PropType<string | null>,
|
|
67
67
|
required: false,
|
|
68
68
|
default: null
|
|
69
69
|
},
|
|
70
70
|
placeholder: {
|
|
71
|
-
type: String
|
|
71
|
+
type: String as PropType<string | null>,
|
|
72
72
|
required: false,
|
|
73
73
|
default: null
|
|
74
74
|
},
|
|
75
75
|
prependInnerIcon: {
|
|
76
|
-
type: String
|
|
76
|
+
type: String as PropType<string | null>,
|
|
77
77
|
required: false,
|
|
78
78
|
default: "mdi-magnify"
|
|
79
79
|
},
|
|
@@ -83,17 +83,17 @@ export default defineComponent({
|
|
|
83
83
|
default: "instant"
|
|
84
84
|
},
|
|
85
85
|
buttonPrependIcon: {
|
|
86
|
-
type: String
|
|
86
|
+
type: String as PropType<string | null>,
|
|
87
87
|
required: false,
|
|
88
88
|
default: null
|
|
89
89
|
},
|
|
90
90
|
buttonLabel: {
|
|
91
|
-
type: String
|
|
91
|
+
type: String as PropType<string | null>,
|
|
92
92
|
required: false,
|
|
93
93
|
default: null
|
|
94
94
|
},
|
|
95
95
|
buttonAppendIcon: {
|
|
96
|
-
type: String
|
|
96
|
+
type: String as PropType<string | null>,
|
|
97
97
|
required: false,
|
|
98
98
|
default: null
|
|
99
99
|
},
|
|
@@ -103,7 +103,7 @@ export default defineComponent({
|
|
|
103
103
|
default: "standard"
|
|
104
104
|
},
|
|
105
105
|
modelValue: {
|
|
106
|
-
type: String
|
|
106
|
+
type: String as PropType<string | null>,
|
|
107
107
|
required: false,
|
|
108
108
|
default: null
|
|
109
109
|
},
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
:itemTitle="$props.itemTitle"
|
|
43
43
|
:itemValue="$props.itemValue"
|
|
44
44
|
:readonly="!$props.editable"
|
|
45
|
-
:clearable="$props.editable &&
|
|
45
|
+
:clearable="$props.editable && !!$props.modelValue"
|
|
46
46
|
:returnObject="$props.returnObject"
|
|
47
47
|
:rules="$props.rules"
|
|
48
48
|
:validateOn="validateOn"
|
|
@@ -87,12 +87,12 @@ export default defineComponent({
|
|
|
87
87
|
},
|
|
88
88
|
props: {
|
|
89
89
|
label: {
|
|
90
|
-
type: String
|
|
90
|
+
type: String as PropType<string | null>,
|
|
91
91
|
required: false,
|
|
92
92
|
default: null
|
|
93
93
|
},
|
|
94
94
|
description: {
|
|
95
|
-
type: String
|
|
95
|
+
type: String as PropType<string | null>,
|
|
96
96
|
required: false,
|
|
97
97
|
default: null
|
|
98
98
|
},
|
|
@@ -111,7 +111,7 @@ export default defineComponent({
|
|
|
111
111
|
default: "label"
|
|
112
112
|
},
|
|
113
113
|
modelValue: {
|
|
114
|
-
type: [Array, String, Number] as PropType<(string | number)[] | string | number>,
|
|
114
|
+
type: [Array, String, Number] as PropType<(string | number)[] | string | number | null>,
|
|
115
115
|
required: false,
|
|
116
116
|
default: null
|
|
117
117
|
},
|
|
@@ -131,7 +131,7 @@ export default defineComponent({
|
|
|
131
131
|
default: false
|
|
132
132
|
},
|
|
133
133
|
rules: {
|
|
134
|
-
type: Array as PropType<
|
|
134
|
+
type: Array as PropType<any[]>,
|
|
135
135
|
required: false,
|
|
136
136
|
default: () => []
|
|
137
137
|
},
|
|
@@ -159,7 +159,7 @@ export default defineComponent({
|
|
|
159
159
|
const lights = getColors(ColorEnum.Light);
|
|
160
160
|
const darks = getColors(ColorEnum.Dark);
|
|
161
161
|
|
|
162
|
-
const style = computed((): {[
|
|
162
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
163
163
|
if (!props.editable) {
|
|
164
164
|
return {
|
|
165
165
|
"--fs-select-field-cursor" : "default",
|