@dative-gpi/foundation-shared-components 0.1.120 → 1.0.0

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.
Files changed (196) hide show
  1. package/assets/images/map/imagery.png +0 -0
  2. package/assets/images/map/map.png +0 -0
  3. package/components/FSAccordion.vue +2 -1
  4. package/components/FSAccordionPanel.vue +20 -1
  5. package/components/FSBadge.vue +7 -3
  6. package/components/FSBreadcrumbs.vue +4 -2
  7. package/components/FSButton.vue +15 -8
  8. package/components/FSCalendar.vue +5 -2
  9. package/components/FSCalendarTwin.vue +6 -3
  10. package/components/FSCard.vue +4 -2
  11. package/components/FSCardPlaceholder.vue +80 -0
  12. package/components/FSCheckbox.vue +10 -7
  13. package/components/FSChip.vue +4 -2
  14. package/components/FSClickable.vue +5 -3
  15. package/components/FSClock.vue +18 -4
  16. package/components/FSCol.vue +12 -5
  17. package/components/FSColor.vue +4 -2
  18. package/components/FSColorIcon.vue +5 -3
  19. package/components/FSDialog.vue +28 -87
  20. package/components/FSDialogContent.vue +133 -0
  21. package/components/FSDialogForm.vue +25 -236
  22. package/components/FSDialogFormBody.vue +273 -0
  23. package/components/FSDialogMenu.vue +5 -2
  24. package/components/FSDialogMultiForm.vue +21 -197
  25. package/components/FSDialogMultiFormBody.vue +231 -0
  26. package/components/FSDialogSubmit.vue +4 -2
  27. package/components/FSDivider.vue +6 -4
  28. package/components/FSEditImage.vue +16 -9
  29. package/components/FSErrorToast.vue +2 -1
  30. package/components/FSFadeOut.vue +1 -1
  31. package/components/FSForm.vue +7 -7
  32. package/components/FSGrid.vue +4 -2
  33. package/components/FSGridMosaic.vue +3 -2
  34. package/components/FSIcon.vue +3 -2
  35. package/components/FSIconCard.vue +10 -3
  36. package/components/FSIconCheck.vue +2 -1
  37. package/components/FSIconFlag.vue +2 -1
  38. package/components/FSImage.vue +2 -1
  39. package/components/FSImageCard.vue +72 -0
  40. package/components/FSLabel.vue +4 -2
  41. package/components/FSLink.vue +5 -3
  42. package/components/FSLoader.vue +2 -1
  43. package/components/FSOptionGroup.vue +28 -20
  44. package/components/FSOptionItem.vue +8 -18
  45. package/components/FSPagination.vue +4 -2
  46. package/components/FSRadio.vue +23 -11
  47. package/components/FSRadioGroup.vue +23 -10
  48. package/components/FSRow.vue +8 -1
  49. package/components/FSSlideGroup.vue +27 -6
  50. package/components/FSSlider.vue +4 -2
  51. package/components/FSSpan.vue +2 -1
  52. package/components/FSSwitch.vue +13 -10
  53. package/components/FSTab.vue +4 -2
  54. package/components/FSTabs.vue +5 -14
  55. package/components/FSTag.vue +11 -4
  56. package/components/FSTagGroup.vue +4 -2
  57. package/components/FSText.vue +4 -2
  58. package/components/FSToggleSet.vue +30 -17
  59. package/components/FSTooltip.vue +15 -4
  60. package/components/FSWindow.vue +2 -2
  61. package/components/FSWrapGroup.vue +2 -1
  62. package/components/autocompletes/FSAutoCompleteAddress.vue +104 -0
  63. package/components/autocompletes/FSAutocompleteLanguage.vue +18 -26
  64. package/components/autocompletes/FSAutocompleteTag.vue +138 -0
  65. package/components/autocompletes/FSAutocompleteTimeZone.vue +19 -30
  66. package/components/buttons/FSButtonAdd.vue +28 -0
  67. package/components/buttons/FSButtonAddIcon.vue +28 -0
  68. package/components/buttons/FSButtonAddLabel.vue +27 -0
  69. package/components/buttons/FSButtonAddMini.vue +27 -0
  70. package/components/buttons/FSButtonFile.vue +4 -4
  71. package/components/buttons/FSButtonFileIcon.vue +4 -4
  72. package/components/buttons/FSButtonFileLabel.vue +4 -4
  73. package/components/buttons/FSButtonFileMini.vue +4 -4
  74. package/components/deviceOrganisations/FSConnectivity.vue +3 -2
  75. package/components/deviceOrganisations/FSConnectivityCard.vue +3 -2
  76. package/components/deviceOrganisations/FSStatus.vue +3 -2
  77. package/components/deviceOrganisations/FSStatusCard.vue +3 -2
  78. package/components/deviceOrganisations/FSStatusesCarousel.vue +3 -2
  79. package/components/deviceOrganisations/FSStatusesRow.vue +3 -2
  80. package/components/deviceOrganisations/FSWorstAlert.vue +5 -4
  81. package/components/deviceOrganisations/FSWorstAlertCard.vue +4 -2
  82. package/components/fields/FSAutocompleteField.vue +210 -97
  83. package/components/fields/FSBaseField.vue +2 -1
  84. package/components/fields/FSColorField.vue +65 -94
  85. package/components/fields/FSDateField.vue +12 -25
  86. package/components/fields/FSDateRangeField.vue +15 -27
  87. package/components/fields/FSDateTimeField.vue +22 -32
  88. package/components/fields/FSDateTimeRangeField.vue +43 -51
  89. package/components/fields/FSGradientField.vue +143 -0
  90. package/components/fields/FSIconField.vue +9 -6
  91. package/components/fields/FSMagicConfigField.vue +154 -0
  92. package/components/fields/FSMagicField.vue +185 -0
  93. package/components/fields/FSNumberField.vue +3 -1
  94. package/components/fields/FSPasswordField.vue +10 -10
  95. package/components/fields/FSRichTextField.vue +136 -50
  96. package/components/fields/FSSearchField.vue +41 -62
  97. package/components/fields/FSSelectField.vue +148 -53
  98. package/components/fields/FSTagField.vue +19 -16
  99. package/components/fields/FSTermField.vue +192 -186
  100. package/components/fields/FSTextArea.vue +4 -4
  101. package/components/fields/FSTextField.vue +29 -6
  102. package/components/fields/FSTimeField.vue +55 -20
  103. package/components/fields/FSTimeSlotField.vue +6 -5
  104. package/components/fields/FSTranslateField.vue +234 -0
  105. package/components/fields/FSTranslateRichTextField.vue +185 -0
  106. package/components/fields/FSTreeViewField.vue +520 -0
  107. package/components/lists/FSDataIteratorItem.vue +18 -3
  108. package/components/lists/FSDataTableUI.vue +138 -51
  109. package/components/lists/FSFilterButton.vue +4 -2
  110. package/components/lists/FSHiddenButton.vue +4 -2
  111. package/components/map/FSMap.vue +598 -0
  112. package/components/map/FSMapEditPointAddressOverlay.vue +164 -0
  113. package/components/map/FSMapLayerButton.vue +77 -0
  114. package/components/map/FSMapOverlay.vue +150 -0
  115. package/components/selects/FSSelectAutoRefresh.vue +62 -0
  116. package/components/selects/FSSelectDashboardVariableType.vue +47 -0
  117. package/components/selects/FSSelectDateSetting.vue +39 -37
  118. package/components/selects/FSSelectDays.vue +62 -0
  119. package/components/tiles/FSDashboardOrganisationTileUI.vue +7 -5
  120. package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +7 -5
  121. package/components/tiles/FSDashboardShallowTileUI.vue +7 -5
  122. package/components/tiles/FSDeviceOrganisationTileUI.vue +11 -12
  123. package/components/tiles/FSFolderTileUI.vue +8 -6
  124. package/components/tiles/FSGroupTileUI.vue +13 -15
  125. package/components/tiles/{FSSimpleIconTileUI.vue → FSSimpleTileUI.vue} +29 -15
  126. package/components/tiles/FSTile.vue +5 -11
  127. package/components/tiles/FSUserOrganisationTileUI.vue +2 -1
  128. package/components/toggleSets/FSToggleSetPosition.vue +61 -0
  129. package/composables/index.ts +5 -1
  130. package/composables/useAddress.ts +158 -0
  131. package/composables/useAutocomplete.ts +4 -3
  132. package/composables/useColors.ts +8 -25
  133. package/composables/useDebounce.ts +2 -1
  134. package/composables/useMagicFieldProvider.ts +22 -0
  135. package/composables/useRules.ts +4 -12
  136. package/composables/useSlots.ts +46 -26
  137. package/composables/useTables.ts +29 -0
  138. package/composables/useTreeView.ts +48 -0
  139. package/elements/FSFormElement.ts +2 -1
  140. package/icons/flags/France.vue +21 -5
  141. package/icons/flags/Germany.vue +16 -4
  142. package/icons/flags/GreatBritain.vue +25 -6
  143. package/icons/flags/Italy.vue +21 -5
  144. package/icons/flags/Portugal.vue +225 -51
  145. package/icons/flags/Spain.vue +2781 -543
  146. package/icons/flags/UnitedStates.vue +31 -7
  147. package/icons/widgetTemplates/DevicesWidget.vue +189 -189
  148. package/icons/widgetTemplates/ProfileWidget.vue +9 -9
  149. package/icons/widgetTemplates/TextWidget.vue +6 -6
  150. package/models/breadcrumbs.ts +1 -1
  151. package/models/deviceAlerts.ts +1 -1
  152. package/models/deviceConnectivities.ts +1 -1
  153. package/models/index.ts +2 -0
  154. package/models/magicFields.ts +9 -0
  155. package/models/map.ts +18 -0
  156. package/models/richTextVariable.ts +5 -0
  157. package/models/rules.ts +11 -2
  158. package/models/tables.ts +30 -21
  159. package/models/variableNode.ts +104 -0
  160. package/package.json +21 -18
  161. package/plugins/colorPlugin.ts +2 -2
  162. package/plugins/index.ts +2 -1
  163. package/plugins/mapsPlugin.ts +37 -0
  164. package/shims-plugin.d.ts +2 -2
  165. package/shims-window.d.ts +3 -0
  166. package/styles/components/fs_button.scss +5 -0
  167. package/styles/components/fs_card.scss +0 -1
  168. package/styles/components/fs_col.scss +1 -0
  169. package/styles/components/fs_color_field.scss +12 -2
  170. package/styles/components/fs_data_iterator_item.scss +19 -6
  171. package/styles/components/fs_dialog.scss +12 -22
  172. package/styles/components/fs_gradient_field.scss +16 -0
  173. package/styles/components/fs_image_card.scss +18 -0
  174. package/styles/components/fs_magic_config_field.scss +13 -0
  175. package/styles/components/fs_map.scss +129 -0
  176. package/styles/components/fs_map_overlay.scss +38 -0
  177. package/styles/components/fs_meta_field.scss +6 -0
  178. package/styles/components/fs_option_group.scss +1 -0
  179. package/styles/components/fs_radio.scss +1 -1
  180. package/styles/components/fs_rich_text_field.scss +17 -5
  181. package/styles/components/fs_row.scss +1 -1
  182. package/styles/components/fs_select_field.scss +9 -14
  183. package/styles/components/fs_text.scss +1 -1
  184. package/styles/components/fs_time_field.scss +0 -4
  185. package/styles/components/fs_translate_field.scss +3 -0
  186. package/styles/components/fs_tree_view_field.scss +53 -0
  187. package/styles/components/index.scss +8 -1
  188. package/styles/globals/overrides.scss +54 -8
  189. package/styles/globals/scrollbars.scss +2 -2
  190. package/themes/default.ts +1 -1
  191. package/utils/gradient.ts +1601 -0
  192. package/utils/index.ts +3 -1
  193. package/utils/leafletMarkers.ts +23 -0
  194. package/utils/lexical.ts +3 -1
  195. package/components/selects/FSSelectTimeZone.vue +0 -67
  196. package/styles/components/fs_date_field.scss +0 -8
@@ -1,80 +1,45 @@
1
1
  <template>
2
2
  <v-dialog
3
3
  transition="dialog-bottom-transition"
4
- class="fs-dialog"
5
- :style="style"
4
+ :class="classes"
6
5
  :modelValue="$props.modelValue"
7
6
  @update:modelValue="$emit('update:modelValue', $event)"
8
7
  v-bind="$attrs"
9
8
  >
10
- <FSCard
11
- padding="24px 8px 24px 24px"
12
- gap="24px"
13
- :color="$props.color"
14
- :class="classes"
15
- >
16
- <template
17
- #header
9
+ <slot>
10
+ <FSDialogContent
11
+ :title="$props.title"
12
+ :subtitle="$props.subtitle"
13
+ :width="$props.width"
14
+ :modelValue="$props.modelValue"
15
+ @update:modelValue="$emit('update:modelValue', $event)"
18
16
  >
19
- <FSCol
20
- padding="0 16px 0 0"
17
+ <template
18
+ v-for="(_, name) in $slots"
19
+ v-slot:[name]="slotData"
21
20
  >
22
- <FSRow
23
- align="center-left"
24
- :wrap="false"
25
- >
26
- <FSText
27
- font="text-h2"
28
- >
29
- {{ $props.title }}
30
- </FSText>
31
- <v-spacer />
32
- <FSButton
33
- icon="mdi-close"
34
- variant="icon"
35
- :color="ColorEnum.Dark"
36
- @click="$emit('update:modelValue', false)"
37
- />
38
- </FSRow>
39
- <FSText
40
- v-if="$props.subtitle"
41
- >
42
- {{ $props.subtitle }}
43
- </FSText>
44
- </FSCol>
45
- </template>
46
- <template
47
- v-for="(_, name) in $slots"
48
- v-slot:[name]="slotData"
49
- >
50
- <slot
51
- :name="name"
52
- v-bind="slotData"
53
- />
54
- </template>
55
- </FSCard>
21
+ <slot
22
+ :name="name"
23
+ v-bind="slotData"
24
+ />
25
+ </template>
26
+ </FSDialogContent>
27
+ </slot>
56
28
  </v-dialog>
57
29
  </template>
58
30
 
59
31
  <script lang="ts">
60
- import { computed, defineComponent, PropType } from "vue";
32
+ import type { PropType } from "vue";
33
+ import { computed, defineComponent } from "vue";
61
34
 
62
- import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
63
35
  import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
64
- import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
65
36
 
66
- import FSButton from "./FSButton.vue";
67
- import FSCard from "./FSCard.vue";
68
- import FSText from "./FSText.vue";
69
- import FSRow from "./FSRow.vue";
37
+ import FSDialogContent from "./FSDialogContent.vue";
70
38
 
71
39
  export default defineComponent({
72
40
  name: "FSDialog",
73
41
  components: {
74
- FSButton,
75
- FSCard,
76
- FSText,
77
- FSRow
42
+ FSDialogContent
78
43
  },
79
44
  props: {
80
45
  title: {
@@ -101,49 +66,25 @@ export default defineComponent({
101
66
  type: Boolean,
102
67
  required: false,
103
68
  default: false
104
- },
105
- color: {
106
- type: String as PropType<ColorBase>,
107
- required: false,
108
- default: ColorEnum.Dark
109
69
  }
110
70
  },
111
71
  emits: ["update:modelValue"],
112
- setup(props) {
72
+ setup() {
113
73
  const { isExtraSmall } = useBreakpoints();
114
74
 
115
75
  const classes = computed((): string[] => {
116
- const classNames = ["fs-dialog"];
117
- if (props.cardClasses) {
118
- if (Array.isArray(props.cardClasses)) {
119
- classNames.push(...props.cardClasses);
120
- }
121
- else {
122
- classNames.push(props.cardClasses);
123
- }
124
- }
76
+ const classNames: string[] = [];
125
77
  if (isExtraSmall.value) {
126
78
  classNames.push("fs-dialog-mobile");
127
79
  }
128
- return classNames;
129
- });
130
-
131
- const style = computed((): { [key: string] : string | null | undefined } => {
132
- if (isExtraSmall.value) {
133
- return {
134
- "--fs-dialog-width": "100%"
135
- };
80
+ else {
81
+ classNames.push("fs-dialog");
136
82
  }
137
- return {
138
- "--fs-dialog-width": sizeToVar(props.width)
139
- };
83
+ return classNames;
140
84
  });
141
85
 
142
86
  return {
143
- isExtraSmall,
144
- ColorEnum,
145
- classes,
146
- style
87
+ classes
147
88
  };
148
89
  }
149
90
  });
@@ -0,0 +1,133 @@
1
+ <template>
2
+ <FSCard
3
+ padding="24px 8px 24px 24px"
4
+ gap="24px"
5
+ :class="$props.cardClasses"
6
+ :color="$props.color"
7
+ :width="cardWidth"
8
+ >
9
+ <template
10
+ #header
11
+ >
12
+ <FSCol
13
+ padding="0 16px 0 0"
14
+ >
15
+ <FSRow
16
+ align="center-left"
17
+ :wrap="false"
18
+ >
19
+ <FSText
20
+ font="text-h2"
21
+ >
22
+ {{ $props.title }}
23
+ </FSText>
24
+ <v-spacer />
25
+ <FSButton
26
+ icon="mdi-close"
27
+ variant="icon"
28
+ :color="ColorEnum.Dark"
29
+ @click="$emit('update:modelValue', false)"
30
+ />
31
+ </FSRow>
32
+ <FSText
33
+ v-if="$props.subtitle"
34
+ >
35
+ {{ $props.subtitle }}
36
+ </FSText>
37
+ </FSCol>
38
+ </template>
39
+ <template
40
+ v-for="(_, name) in $slots"
41
+ v-slot:[name]="slotData"
42
+ >
43
+ <slot
44
+ :name="name"
45
+ v-bind="slotData"
46
+ />
47
+ </template>
48
+ </FSCard>
49
+ </template>
50
+
51
+ <script lang="ts">
52
+ import { computed, defineComponent, type PropType } from "vue";
53
+
54
+ import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
55
+ import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
56
+ import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
57
+
58
+ import FSButton from "./FSButton.vue";
59
+ import FSCard from "./FSCard.vue";
60
+ import FSText from "./FSText.vue";
61
+ import FSRow from "./FSRow.vue";
62
+
63
+ export default defineComponent({
64
+ name: "FSDialogContent",
65
+ components: {
66
+ FSButton,
67
+ FSCard,
68
+ FSText,
69
+ FSRow
70
+ },
71
+ props: {
72
+ title: {
73
+ type: String as PropType<string | null>,
74
+ required: false,
75
+ default: null
76
+ },
77
+ subtitle: {
78
+ type: String as PropType<string | null>,
79
+ required: false,
80
+ default: null
81
+ },
82
+ width: {
83
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
84
+ required: false,
85
+ default: "fit-content"
86
+ },
87
+ cardClasses: {
88
+ type: [Array, String] as PropType<string[] | string | null>,
89
+ required: false,
90
+ default: null
91
+ },
92
+ modelValue: {
93
+ type: Boolean,
94
+ required: false,
95
+ default: false
96
+ },
97
+ color: {
98
+ type: String as PropType<ColorBase>,
99
+ required: false,
100
+ default: ColorEnum.Dark
101
+ }
102
+ },
103
+ emits: ["update:modelValue"],
104
+ setup(props) {
105
+ const { isExtraSmall } = useBreakpoints();
106
+
107
+ const classes = computed((): string[] => {
108
+ const classNames: string[] = [];
109
+ if (isExtraSmall.value) {
110
+ classNames.push("fs-dialog-mobile");
111
+ }
112
+ else {
113
+ classNames.push("fs-dialog");
114
+ }
115
+ return classNames;
116
+ });
117
+
118
+ const cardWidth = computed((): string => {
119
+ if (isExtraSmall.value) {
120
+ return "100%";
121
+ }
122
+ return sizeToVar(props.width);
123
+ });
124
+
125
+ return {
126
+ isExtraSmall,
127
+ cardWidth,
128
+ ColorEnum,
129
+ classes
130
+ };
131
+ }
132
+ });
133
+ </script>
@@ -10,122 +10,40 @@
10
10
  <template
11
11
  #body
12
12
  >
13
- <template
14
- v-if="!$props.validation"
13
+ <FSDialogFormBody
14
+ v-bind="$attrs"
15
+ :subtitle="$props.subtitle"
16
+ :validation="$props.validation"
17
+ @click:cancelButton="$emit('update:modelValue', false)"
18
+ @click:submitButton="$emit('click:submitButton')"
19
+ @click:validateButton="onValidate"
15
20
  >
16
- <FSForm
17
- ref="formRef"
18
- :variant="$props.variant"
19
- @submit="onSubmit"
20
- v-model="valid"
21
+ <template
22
+ v-for="(_, name) in $slots"
23
+ v-slot:[name]="slotData"
21
24
  >
22
- <FSCol
23
- gap="24px"
24
- >
25
- <FSFadeOut
26
- :height="height"
27
- padding="0 8px 0 0"
28
- >
29
- <slot
30
- name="body"
31
- />
32
- </FSFadeOut>
33
- <FSRow
34
- padding="0 16px 0 0"
35
- >
36
- <slot
37
- name="left-footer"
38
- />
39
- <FSRow
40
- class="fs-dialog-actions"
41
- align="top-right"
42
- :wrap="false"
43
- >
44
- <FSButton
45
- :prependIcon="$props.cancelButtonPrependIcon"
46
- :appendIcon="$props.cancelButtonAppendIcon"
47
- :variant="$props.cancelButtonVariant"
48
- :color="$props.cancelButtonColor"
49
- :label="cancelLabel"
50
- @click="() => $emit('update:modelValue', false)"
51
- />
52
- <FSButton
53
- type="submit"
54
- :prependIcon="$props.submitButtonPrependIcon"
55
- :appendIcon="$props.submitButtonAppendIcon"
56
- :variant="$props.submitButtonVariant"
57
- :color="$props.submitButtonColor"
58
- :editable="$props.editable"
59
- :label="submitLabel"
60
- :load="$props.load"
61
- />
62
- </FSRow>
63
- </FSRow>
64
- </FSCol>
65
- </FSForm>
66
- </template>
67
- <template
68
- v-else
69
- >
70
- <FSCol
71
- gap="24px"
72
- >
73
- <FSFadeOut
74
- :height="height"
75
- padding="0 8px 0 0"
76
- >
77
- <slot
78
- name="validation"
79
- />
80
- </FSFadeOut>
81
- <FSRow
82
- padding="0 16px 0 0"
83
- >
84
- <slot
85
- name="left-footer"
86
- />
87
- <FSRow
88
- class="fs-dialog-actions"
89
- align="top-right"
90
- :wrap="false"
91
- >
92
- <FSButton
93
- :prependIcon="$props.validateButtonPrependIcon"
94
- :appendIcon="$props.validateButtonAppendIcon"
95
- :variant="$props.validateButtonVariant"
96
- :color="$props.validateButtonColor"
97
- :label="validateLabel"
98
- @click="onValidate"
99
- />
100
- </FSRow>
101
- </FSRow>
102
- </FSCol>
103
- </template>
25
+ <slot
26
+ :name="name"
27
+ v-bind="slotData"
28
+ />
29
+ </template>
30
+ </FSDialogFormBody>
104
31
  </template>
105
32
  </FSDialog>
106
33
  </template>
107
34
 
108
35
  <script lang="ts">
109
- import { computed, defineComponent, PropType, ref } from "vue";
110
-
111
- import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
112
- import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
113
- import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
36
+ import type { PropType} from "vue";
37
+ import { defineComponent } from "vue";
114
38
 
115
- import FSFadeOut from "./FSFadeOut.vue";
116
- import FSButton from "./FSButton.vue";
39
+ import FSDialogFormBody from "./FSDialogFormBody.vue";
117
40
  import FSDialog from "./FSDialog.vue";
118
- import FSForm from "./FSForm.vue";
119
- import FSRow from "./FSRow.vue";
120
41
 
121
42
  export default defineComponent({
122
43
  name: "FSDialogForm",
123
44
  components: {
124
- FSFadeOut,
125
- FSButton,
126
- FSDialog,
127
- FSForm,
128
- FSRow
45
+ FSDialogFormBody,
46
+ FSDialog
129
47
  },
130
48
  props: {
131
49
  title: {
@@ -138,139 +56,24 @@ export default defineComponent({
138
56
  required: false,
139
57
  default: null
140
58
  },
141
- width: {
142
- type: [Array, String, Number] as PropType<"hug" | "fill" | string[] | number[] | string | number | null>,
143
- required: false,
144
- default: "auto"
145
- },
146
- variant: {
147
- type: String as PropType<"standard" | "lazy" | "submit">,
148
- required: false,
149
- default: "submit"
150
- },
151
59
  modelValue: {
152
60
  type: Boolean,
153
61
  required: false,
154
62
  default: false
155
63
  },
156
- cancelButtonPrependIcon: {
157
- type: String as PropType<string | null>,
158
- required: false,
159
- default: null
160
- },
161
- cancelButtonLabel: {
162
- type: String as PropType<string | null>,
163
- required: false,
164
- default: null
165
- },
166
- cancelButtonAppendIcon: {
167
- type: String as PropType<string | null>,
168
- required: false,
169
- default: null
170
- },
171
- cancelButtonVariant: {
172
- type: String as PropType<"standard" | "full" | "icon">,
173
- required: false,
174
- default: "standard"
175
- },
176
- cancelButtonColor: {
177
- type: String as PropType<ColorBase>,
178
- required: false,
179
- default: ColorEnum.Light
180
- },
181
- submitButtonPrependIcon: {
182
- type: String as PropType<string | null>,
183
- required: false,
184
- default: null
185
- },
186
- submitButtonLabel: {
187
- type: String as PropType<string | null>,
188
- required: false,
189
- default: null
190
- },
191
- submitButtonAppendIcon: {
192
- type: String as PropType<string | null>,
193
- required: false,
194
- default: null
195
- },
196
- submitButtonVariant: {
197
- type: String as PropType<"standard" | "full" | "icon">,
198
- required: false,
199
- default: "full"
200
- },
201
- submitButtonColor: {
202
- type: String as PropType<ColorBase>,
203
- required: false,
204
- default: ColorEnum.Primary
205
- },
206
- validateButtonPrependIcon: {
207
- type: String as PropType<string | null>,
208
- required: false,
209
- default: null
210
- },
211
- validateButtonLabel: {
212
- type: String as PropType<string | null>,
213
- required: false,
214
- default: null
215
- },
216
- validateButtonAppendIcon: {
217
- type: String as PropType<string | null>,
218
- required: false,
219
- default: null
220
- },
221
- validateButtonVariant: {
222
- type: String as PropType<"standard" | "full" | "icon">,
223
- required: false,
224
- default: "standard"
225
- },
226
- validateButtonColor: {
227
- type: String as PropType<ColorBase>,
228
- required: false,
229
- default: ColorEnum.Light
230
- },
231
64
  validation: {
232
65
  type: Boolean,
233
66
  required: false,
234
67
  default: false
235
68
  },
236
- load: {
237
- type: Boolean,
238
- required: false,
239
- default: false
240
- },
241
- editable: {
242
- type: Boolean,
69
+ width: {
70
+ type: [Array, String, Number] as PropType<"hug" | "fill" | string[] | number[] | string | number | null>,
243
71
  required: false,
244
- default: true
72
+ default: "auto"
245
73
  }
246
74
  },
247
- emits: ["update:modelValue", "click:submitButton", "click:validateButton"],
75
+ emits: ["update:modelValue", "click:validateButton", "click:submitButton"],
248
76
  setup(props, { emit }) {
249
- const { isMobileSized } = useBreakpoints();
250
- const { $tr } = useTranslationsProvider();
251
-
252
- const formRef = ref<HTMLElement | null>(null);
253
- const valid = ref(false);
254
-
255
- const height = computed(() => {
256
- const other = 24 + 24 // Paddings
257
- + (isMobileSized.value ? 24 : 32) + 24 // Title
258
- + (props.subtitle ? (isMobileSized.value ? 14 : 16) + 8 : 0) // Subtitle
259
- + (isMobileSized.value ? 36 : 40) + 24; // Footer
260
- return `calc(100vh - 40px - ${other}px)`;
261
- });
262
-
263
- const cancelLabel = computed(() => {
264
- return props.cancelButtonLabel ?? $tr("ui.button.cancel", "Cancel");
265
- });
266
-
267
- const submitLabel = computed(() => {
268
- return props.submitButtonLabel ?? $tr("ui.button.submit", "Submit");
269
- });
270
-
271
- const validateLabel = computed(() => {
272
- return props.validateButtonLabel ?? $tr("ui.button.validate", "Done");
273
- });
274
77
 
275
78
  const onClose = () => {
276
79
  if (props.validation) {
@@ -279,27 +82,13 @@ export default defineComponent({
279
82
  emit("update:modelValue", false);
280
83
  };
281
84
 
282
- const onSubmit = () => {
283
- if (valid.value) {
284
- emit("click:submitButton");
285
- }
286
- };
287
-
288
85
  const onValidate = () => {
289
86
  emit("click:validateButton");
290
87
  emit("update:modelValue", false);
291
88
  };
292
89
 
293
90
  return {
294
- validateLabel,
295
- cancelLabel,
296
- submitLabel,
297
- ColorEnum,
298
- formRef,
299
- height,
300
- valid,
301
91
  onValidate,
302
- onSubmit,
303
92
  onClose
304
93
  };
305
94
  }