@dative-gpi/foundation-shared-components 0.0.7 → 0.0.9

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 (139) hide show
  1. package/{models/FSButtons.ts → aliases/FSButton.ts} +24 -21
  2. package/aliases/index.ts +1 -0
  3. package/components/FSAutocompleteField.vue +207 -0
  4. package/components/FSBadge.vue +38 -0
  5. package/components/FSBreadcrumbs.vue +49 -55
  6. package/components/FSButton.vue +116 -101
  7. package/components/FSCalendar.vue +184 -0
  8. package/components/FSCalendarTwin.vue +412 -0
  9. package/components/FSCard.vue +77 -0
  10. package/components/FSCarousel.vue +63 -0
  11. package/components/FSCheckbox.vue +111 -104
  12. package/components/FSChip.vue +140 -0
  13. package/components/FSClock.vue +172 -0
  14. package/components/FSCol.vue +104 -98
  15. package/components/FSColor.vue +61 -64
  16. package/components/FSColorIcon.vue +67 -0
  17. package/components/FSContainer.vue +64 -0
  18. package/components/FSDateField.vue +211 -0
  19. package/components/FSDateRangeField.vue +225 -0
  20. package/components/FSDateTimeField.vue +257 -0
  21. package/components/FSDateTimeRangeField.vue +286 -0
  22. package/components/FSDialog.vue +103 -0
  23. package/components/FSDivider.vue +39 -0
  24. package/components/FSFadeOut.vue +49 -59
  25. package/components/FSFileButton.vue +245 -0
  26. package/components/FSHeaderButton.vue +17 -0
  27. package/components/FSIcon.vue +23 -23
  28. package/components/FSIconField.vue +232 -0
  29. package/components/FSImage.vue +142 -0
  30. package/components/FSLoadTile.vue +93 -0
  31. package/components/FSNumberField.vue +51 -53
  32. package/components/FSPasswordField.vue +99 -99
  33. package/components/FSRadio.vue +107 -110
  34. package/components/FSRadioGroup.vue +55 -57
  35. package/components/FSRemoveDialog.vue +123 -0
  36. package/components/FSRichTextField.vue +551 -0
  37. package/components/FSRow.vue +110 -104
  38. package/components/FSSearchField.vue +114 -105
  39. package/components/FSSelectField.vue +188 -0
  40. package/components/FSSlideGroup.vue +45 -49
  41. package/components/FSSlider.vue +130 -0
  42. package/components/FSSpan.vue +53 -37
  43. package/components/FSSubmitDialog.vue +165 -0
  44. package/components/FSSwitch.vue +110 -109
  45. package/components/FSTab.vue +61 -61
  46. package/components/FSTabs.vue +53 -55
  47. package/components/FSTag.vue +88 -84
  48. package/components/FSTagField.vue +183 -128
  49. package/components/FSTagGroup.vue +38 -45
  50. package/components/FSText.vue +74 -64
  51. package/components/FSTextArea.vue +209 -0
  52. package/components/FSTextField.vue +152 -149
  53. package/components/FSTile.vue +90 -0
  54. package/components/FSToggleSet.vue +282 -0
  55. package/components/FSTooltip.vue +21 -0
  56. package/components/FSWindow.vue +26 -16
  57. package/components/FSWrapGroup.vue +44 -47
  58. package/components/deviceOrganisations/FSConnectivity.vue +114 -0
  59. package/components/deviceOrganisations/FSStatus.vue +117 -0
  60. package/components/deviceOrganisations/FSStatusesCarousel.vue +105 -0
  61. package/components/deviceOrganisations/FSStatusesRow.vue +66 -0
  62. package/components/deviceOrganisations/FSWorstAlert.vue +165 -0
  63. package/components/lists/FSDataIteratorGroup.vue +7 -0
  64. package/components/lists/FSDataIteratorItem.vue +103 -0
  65. package/components/lists/FSDataTable.vue +964 -0
  66. package/components/lists/FSFilterButton.vue +176 -0
  67. package/components/lists/FSHeaderButton.vue +99 -0
  68. package/components/lists/FSHiddenButton.vue +79 -0
  69. package/components/tiles/FSDeviceOrganisationTileUI.vue +232 -0
  70. package/components/tiles/FSGroupTileUI.vue +192 -0
  71. package/composables/index.ts +2 -1
  72. package/composables/useBreakpoints.ts +33 -0
  73. package/composables/useColors.ts +53 -23
  74. package/composables/useSlots.ts +43 -0
  75. package/index.ts +6 -0
  76. package/models/breadcrumbs.ts +8 -0
  77. package/models/colors.ts +17 -0
  78. package/models/deviceAlerts.ts +10 -0
  79. package/models/deviceConnectivities.ts +11 -0
  80. package/models/deviceStatuses.ts +16 -0
  81. package/models/dispositions.ts +33 -0
  82. package/models/index.ts +9 -0
  83. package/models/modelStatuses.ts +11 -0
  84. package/models/rules.ts +50 -0
  85. package/models/toggleSets.ts +7 -0
  86. package/package.json +13 -4
  87. package/plugins/colorPlugin.ts +2 -2
  88. package/shims-plugin.d.ts +1 -1
  89. package/styles/components/fs_autocomplete_field.scss +123 -0
  90. package/styles/components/fs_button.scss +4 -14
  91. package/styles/components/fs_calendar.scss +138 -0
  92. package/styles/components/fs_card.scss +4 -0
  93. package/styles/components/fs_carousel.scss +4 -0
  94. package/styles/components/fs_chip.scss +33 -0
  95. package/styles/components/fs_clock.scss +43 -0
  96. package/styles/components/fs_col.scss +2 -0
  97. package/styles/components/fs_color_icon.scss +37 -0
  98. package/styles/components/fs_container.scss +16 -0
  99. package/styles/components/fs_data_iterator_item.scss +19 -0
  100. package/styles/components/fs_data_table.scss +97 -0
  101. package/styles/components/fs_date_field.scss +8 -0
  102. package/styles/components/fs_dialog.scss +30 -0
  103. package/styles/components/fs_divider.scss +5 -0
  104. package/styles/components/fs_fade_out.scss +10 -2
  105. package/styles/components/fs_filter_button.scss +12 -0
  106. package/styles/components/fs_header_button.scss +4 -0
  107. package/styles/components/fs_icon.scss +14 -4
  108. package/styles/components/fs_icon_field.scss +12 -0
  109. package/styles/components/fs_image.scss +7 -0
  110. package/styles/components/fs_load_tile.scss +49 -0
  111. package/styles/components/fs_password_field.scss +2 -2
  112. package/styles/components/fs_rich_text_field.scss +67 -0
  113. package/styles/components/fs_row.scss +4 -1
  114. package/styles/components/fs_select_field.scss +71 -0
  115. package/styles/components/fs_slide_group.scss +6 -0
  116. package/styles/components/fs_slider.scss +40 -0
  117. package/styles/components/fs_span.scss +8 -0
  118. package/styles/components/fs_submit_dialog.scss +9 -0
  119. package/styles/components/fs_tabs.scss +4 -0
  120. package/styles/components/fs_tag_field.scss +6 -8
  121. package/styles/components/fs_text_area.scss +105 -0
  122. package/styles/components/fs_text_field.scss +23 -15
  123. package/styles/components/fs_tile.scss +33 -0
  124. package/styles/components/fs_tooltip.scss +5 -0
  125. package/styles/components/fs_wrap_group.scss +7 -8
  126. package/styles/components/index.scss +26 -0
  127. package/styles/globals/breakpoints.scss +7 -0
  128. package/styles/globals/overrides.scss +20 -7
  129. package/styles/globals/text_fonts.scss +8 -8
  130. package/themes/default.ts +1 -11
  131. package/utils/css.ts +11 -0
  132. package/utils/icons.ts +75416 -0
  133. package/utils/index.ts +5 -0
  134. package/utils/levenshtein.ts +97 -0
  135. package/utils/lexical.ts +27 -0
  136. package/utils/sort.ts +9 -0
  137. package/composables/useTouch.ts +0 -9
  138. package/models/FSTags.ts +0 -8
  139. package/models/FSTextFields.ts +0 -17
@@ -0,0 +1,93 @@
1
+ <template>
2
+ <FSCard
3
+ class="fs-load-tile"
4
+ padding="11px"
5
+ :style="style"
6
+ :width="width"
7
+ :height="height"
8
+ >
9
+ <FSRow
10
+ align="center-center"
11
+ height="fill"
12
+ gap="24px"
13
+ >
14
+ <v-skeleton-loader
15
+ type="article"
16
+ />
17
+ <v-skeleton-loader
18
+ type="image"
19
+ />
20
+ </FSRow>
21
+ <FSContainer
22
+ v-if="$props.editable"
23
+ class="fs-tile-checkbox"
24
+ :border="false"
25
+ >
26
+ <FSCheckbox
27
+ :modelValue="$props.modelValue"
28
+ @update:modelValue="() => $emit('update:modelValue', !$props.modelValue)"
29
+ />
30
+ </FSContainer>
31
+ </FSCard>
32
+ </template>
33
+
34
+ <script lang="ts">
35
+ import { computed, defineComponent } from "vue";
36
+
37
+ import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
38
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
39
+
40
+ import FSContainer from "./FSContainer.vue";
41
+ import FSCheckbox from "./FSCheckbox.vue";
42
+ import FSCard from "./FSCard.vue";
43
+ import FSCol from "./FSCol.vue";
44
+ import FSRow from "./FSRow.vue";
45
+
46
+ export default defineComponent({
47
+ name: "FSTile",
48
+ components: {
49
+ FSContainer,
50
+ FSCheckbox,
51
+ FSCard,
52
+ FSCol,
53
+ FSRow
54
+ },
55
+ props: {
56
+ modelValue: {
57
+ type: Boolean,
58
+ required: false,
59
+ default: false
60
+ },
61
+ editable: {
62
+ type: Boolean,
63
+ required: false,
64
+ default: false
65
+ }
66
+ },
67
+ setup() {
68
+ const { isMobileSized } = useBreakpoints();
69
+
70
+ const backgroundColors = useColors().getColors(ColorEnum.Background);
71
+
72
+ const width = computed(() => {
73
+ return isMobileSized.value ? 336 : 352;
74
+ });
75
+
76
+ const height = computed(() => {
77
+ return isMobileSized.value ? 156 : 170;
78
+ });
79
+
80
+ const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
81
+ return {
82
+ "--fs-load-tile-background-color": backgroundColors.base
83
+ };
84
+ });
85
+
86
+ return {
87
+ width,
88
+ height,
89
+ style
90
+ };
91
+ }
92
+ });
93
+ </script>
@@ -1,65 +1,63 @@
1
1
  <template>
2
- <FSTextField
3
- type="number"
4
- :label="$props.label"
5
- :description="$props.description"
6
- :color="$props.color"
7
- :required="$props.required"
8
- :editable="$props.editable"
9
- :value="$props.value?.toString()"
10
- @update:value="(value) => $emit('update:value', isNaN(parseFloat(value)) ? 0 : parseFloat(value))"
11
- v-bind="$attrs"
12
- >
13
- <template v-for="(_, name) in $slots" v-slot:[name]="slotData">
14
- <slot :name="name" v-bind="slotData" />
15
- </template>
16
- </FSTextField>
2
+ <FSTextField
3
+ type="number"
4
+ :label="$props.label"
5
+ :description="$props.description"
6
+ :hideHeader="$props.hideHeader"
7
+ :required="$props.required"
8
+ :editable="$props.editable"
9
+ :modelValue="$props.modelValue?.toString()"
10
+ @update:modelValue="(value) => $emit('update:modelValue', isNaN(parseFloat(value)) ? 0 : parseFloat(value))"
11
+ v-bind="$attrs"
12
+ >
13
+ <template v-for="(_, name) in $slots" v-slot:[name]="slotData">
14
+ <slot :name="name" v-bind="slotData" />
15
+ </template>
16
+ </FSTextField>
17
17
  </template>
18
18
 
19
19
  <script lang="ts">
20
- import { defineComponent, PropType } from "vue";
21
-
22
- import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
20
+ import { defineComponent } from "vue";
23
21
 
24
22
  import FSTextField from "./FSTextField.vue";
25
23
 
26
24
  export default defineComponent({
27
- name: "FSNumberField",
28
- components: {
29
- FSTextField
25
+ name: "FSNumberField",
26
+ components: {
27
+ FSTextField
28
+ },
29
+ props: {
30
+ label: {
31
+ type: String,
32
+ required: false,
33
+ default: null
34
+ },
35
+ description: {
36
+ type: String,
37
+ required: false,
38
+ default: null
39
+ },
40
+ modelValue: {
41
+ type: Number,
42
+ required: false,
43
+ default: null
44
+ },
45
+ hideHeader: {
46
+ type: Boolean,
47
+ required: false,
48
+ default: false
30
49
  },
31
- props: {
32
- label: {
33
- type: String,
34
- required: false,
35
- default: null
36
- },
37
- description: {
38
- type: String,
39
- required: false,
40
- default: null
41
- },
42
- value: {
43
- type: Number,
44
- required: false,
45
- default: null
46
- },
47
- color: {
48
- type: String as PropType<ColorBase>,
49
- required: false,
50
- default: ColorBase.Dark
51
- },
52
- required: {
53
- type: Boolean,
54
- required: false,
55
- default: false
56
- },
57
- editable: {
58
- type: Boolean,
59
- required: false,
60
- default: true
61
- }
50
+ required: {
51
+ type: Boolean,
52
+ required: false,
53
+ default: false
62
54
  },
63
- emits: ["update:value"]
55
+ editable: {
56
+ type: Boolean,
57
+ required: false,
58
+ default: true
59
+ }
60
+ },
61
+ emits: ["update:modelValue"]
64
62
  });
65
63
  </script>
@@ -1,119 +1,119 @@
1
1
  <template>
2
- <FSTextField
3
- :label="$props.label"
4
- :description="$props.description"
5
- :type="type"
6
- :color="$props.color"
7
- :required="$props.required"
8
- :editable="$props.editable"
9
- :value="$props.value"
10
- @update:value="(value) => $emit('update:value', value)"
11
- v-bind="$attrs"
12
- >
13
- <template #append-inner>
14
- <FSIcon
15
- class="fs-password-field-icon"
16
- size="m"
17
- :style="style"
18
- @click="onToggle"
19
- >
20
- {{ icon }}
21
- </FSIcon>
22
- </template>
23
- <template v-for="(_, name) in $slots" v-slot:[name]="slotData">
24
- <slot :name="name" v-bind="slotData" />
25
- </template>
26
- </FSTextField>
2
+ <FSTextField
3
+ :label="$props.label"
4
+ :description="$props.description"
5
+ :type="type"
6
+ :hideHeader="$props.hideHeader"
7
+ :required="$props.required"
8
+ :editable="$props.editable"
9
+ :modelValue="$props.modelValue"
10
+ @update:modelValue="(value) => $emit('update:modelValue', value)"
11
+ v-bind="$attrs"
12
+ >
13
+ <template #append-inner>
14
+ <slot name="append-inner">
15
+ <FSButton
16
+ variant="icon"
17
+ :icon="icon"
18
+ :editable="$props.editable"
19
+ :color="ColorEnum.Dark"
20
+ @click="onToggle"
21
+ />
22
+ </slot>
23
+ </template>
24
+ <template v-for="(_, name) in $slots" v-slot:[name]="slotData">
25
+ <slot :name="name" v-bind="slotData" />
26
+ </template>
27
+ </FSTextField>
27
28
  </template>
28
29
 
29
30
  <script lang="ts">
30
- import { computed, defineComponent, PropType, ref, toRefs } from "vue";
31
+ import { computed, defineComponent, ref } from "vue";
31
32
 
32
33
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
33
- import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
34
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
34
35
 
35
36
  import FSTextField from "./FSTextField.vue";
36
- import FSIcon from "./FSIcon.vue";
37
+ import FSButton from "./FSButton.vue";
37
38
 
38
39
  export default defineComponent({
39
- name: "FSPasswordField",
40
- components: {
41
- FSTextField,
42
- FSIcon
40
+ name: "FSPasswordField",
41
+ components: {
42
+ FSTextField,
43
+ FSButton
44
+ },
45
+ props: {
46
+ label: {
47
+ type: String,
48
+ required: false,
49
+ default: null
43
50
  },
44
- props: {
45
- label: {
46
- type: String,
47
- required: false,
48
- default: null
49
- },
50
- description: {
51
- type: String,
52
- required: false,
53
- default: null
54
- },
55
- value: {
56
- type: String,
57
- required: false,
58
- default: null
59
- },
60
- color: {
61
- type: String as PropType<ColorBase>,
62
- required: false,
63
- default: ColorBase.Dark
64
- },
65
- required: {
66
- type: Boolean,
67
- required: false,
68
- default: false
69
- },
70
- editable: {
71
- type: Boolean,
72
- required: false,
73
- default: true
74
- }
51
+ description: {
52
+ type: String,
53
+ required: false,
54
+ default: null
75
55
  },
76
- emits: ["update:value"],
77
- setup(props) {
78
- const { editable } = toRefs(props);
79
-
80
- const stars = ref(true);
56
+ modelValue: {
57
+ type: String,
58
+ required: false,
59
+ default: null
60
+ },
61
+ hideHeader: {
62
+ type: Boolean,
63
+ required: false,
64
+ default: false
65
+ },
66
+ required: {
67
+ type: Boolean,
68
+ required: false,
69
+ default: false
70
+ },
71
+ editable: {
72
+ type: Boolean,
73
+ required: false,
74
+ default: true
75
+ }
76
+ },
77
+ emits: ["update:modelValue"],
78
+ setup(props) {
79
+ const lights = useColors().getColors(ColorEnum.Light);
80
+ const darks = useColors().getColors(ColorEnum.Dark);
81
81
 
82
- const lights = useColors().getColors(ColorBase.Light);
83
- const darks = useColors().getColors(ColorBase.Dark);
82
+ const stars = ref(true);
84
83
 
85
- const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
86
- if (!editable.value) {
87
- return {
88
- "--fs-password-field-cursor" : "default",
89
- "--fs-password-field-base-text": lights.dark,
90
- "--fs-password-field-dark-text": lights.dark
91
- };
92
- }
93
- return {
94
- "--fs-password-field-cursor" : "pointer",
95
- "--fs-password-field-base-text": darks.base,
96
- "--fs-password-field-dark-text": darks.dark
97
- };
98
- });
84
+ const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
85
+ if (!props.editable) {
86
+ return {
87
+ "--fs-password-field-cursor" : "default",
88
+ "--fs-password-field-color": lights.dark,
89
+ "--fs-password-field-hover-color": lights.dark
90
+ };
91
+ }
92
+ return {
93
+ "--fs-password-field-cursor" : "pointer",
94
+ "--fs-password-field-color": darks.base,
95
+ "--fs-password-field-hover-color": darks.dark
96
+ };
97
+ });
99
98
 
100
- const type = computed((): string => stars.value ? "password" : "text");
99
+ const type = computed((): string => stars.value ? "password" : "text");
101
100
 
102
- const icon = computed((): string => stars.value ? "mdi-eye-off-outline" : "mdi-eye-outline");
101
+ const icon = computed((): string => stars.value ? "mdi-eye-off-outline" : "mdi-eye-outline");
103
102
 
104
- const onToggle = (): void => {
105
- if (!editable.value) {
106
- return;
107
- }
108
- stars.value = !stars.value;
109
- };
103
+ const onToggle = (): void => {
104
+ if (!props.editable) {
105
+ return;
106
+ }
107
+ stars.value = !stars.value;
108
+ };
110
109
 
111
- return {
112
- type,
113
- icon,
114
- style,
115
- onToggle
116
- };
117
- }
110
+ return {
111
+ ColorEnum,
112
+ type,
113
+ icon,
114
+ style,
115
+ onToggle
116
+ };
117
+ }
118
118
  });
119
119
  </script>
@@ -1,44 +1,44 @@
1
1
  <template>
2
- <FSCol width="hug">
3
- <FSRow width="hug" align="center-left">
4
- <FSIcon
5
- class="fs-radio"
6
- size="checkbox"
7
- :style="style"
8
- @click="onToggle"
9
- >
10
- {{ icon }}
11
- </FSIcon>
12
- <slot name="default">
13
- <FSSpan
14
- v-if="$props.label"
15
- class="fs-radio-label"
16
- :style="style"
17
- :font="font"
18
- @click="onToggle"
19
- >
20
- {{ $props.label }}
21
- </FSSpan>
22
- </slot>
23
- </FSRow>
24
- <slot name="description">
25
- <FSSpan
26
- v-if="$props.description"
27
- class="fs-radio-description"
28
- font="text-underline"
29
- :style="style"
30
- >
31
- {{ $props.description }}
32
- </FSSpan>
33
- </slot>
34
- </FSCol>
2
+ <FSCol width="hug">
3
+ <FSRow width="hug" align="center-left">
4
+ <FSIcon
5
+ class="fs-radio"
6
+ size="l"
7
+ :style="style"
8
+ @click.stop="onToggle"
9
+ >
10
+ {{ icon }}
11
+ </FSIcon>
12
+ <slot>
13
+ <FSSpan
14
+ v-if="$props.label"
15
+ class="fs-radio-label"
16
+ :style="style"
17
+ :font="font"
18
+ @click.stop="onToggle"
19
+ >
20
+ {{ $props.label }}
21
+ </FSSpan>
22
+ </slot>
23
+ </FSRow>
24
+ <slot name="description">
25
+ <FSSpan
26
+ v-if="$props.description"
27
+ class="fs-radio-description"
28
+ font="text-underline"
29
+ :style="style"
30
+ >
31
+ {{ $props.description }}
32
+ </FSSpan>
33
+ </slot>
34
+ </FSCol>
35
35
  </template>
36
36
 
37
37
  <script lang="ts">
38
- import { computed, defineComponent, PropType, toRefs } from "vue";
38
+ import { computed, defineComponent, PropType } from "vue";
39
39
 
40
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
40
41
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
41
- import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
42
42
 
43
43
  import FSIcon from "./FSIcon.vue";
44
44
  import FSSpan from "./FSSpan.vue";
@@ -46,87 +46,84 @@ import FSRow from "./FSRow.vue";
46
46
  import FSCol from "./FSCol.vue";
47
47
 
48
48
  export default defineComponent({
49
- name: "FSRadio",
50
- components: {
51
- FSIcon,
52
- FSSpan,
53
- FSRow,
54
- FSCol
49
+ name: "FSRadio",
50
+ components: {
51
+ FSIcon,
52
+ FSSpan,
53
+ FSRow,
54
+ FSCol
55
+ },
56
+ props: {
57
+ label: {
58
+ type: String,
59
+ required: false,
60
+ default: null
55
61
  },
56
- props: {
57
- label: {
58
- type: String,
59
- required: false,
60
- default: null
61
- },
62
- description: {
63
- type: String,
64
- required: false,
65
- default: null
66
- },
67
- value: {
68
- type: [String, Boolean, Number],
69
- required: true
70
- },
71
- selected: {
72
- type: Boolean,
73
- required: false,
74
- default: false
75
- },
76
- color: {
77
- type: String as PropType<ColorBase>,
78
- required: false,
79
- default: ColorBase.Primary
80
- },
81
- editable: {
82
- type: Boolean,
83
- required: false,
84
- default: true
85
- }
62
+ description: {
63
+ type: String,
64
+ required: false,
65
+ default: null
86
66
  },
87
- emits: ["update:value"],
88
- setup(props, { emit }) {
89
- const { value, selected, color, editable } = toRefs(props);
90
-
91
- const colors = useColors().getColors(color.value);
92
-
93
- const lights = useColors().getColors(ColorBase.Light);
94
- const darks = useColors().getColors(ColorBase.Dark);
67
+ modelValue: {
68
+ type: [String, Boolean, Number],
69
+ required: true
70
+ },
71
+ selected: {
72
+ type: Boolean,
73
+ required: false,
74
+ default: false
75
+ },
76
+ color: {
77
+ type: String as PropType<ColorBase>,
78
+ required: false,
79
+ default: ColorEnum.Primary
80
+ },
81
+ editable: {
82
+ type: Boolean,
83
+ required: false,
84
+ default: true
85
+ }
86
+ },
87
+ emits: ["update:modelValue"],
88
+ setup(props, { emit }) {
89
+ const colors = computed(() => useColors().getColors(props.color));
90
+ const lights = useColors().getColors(ColorEnum.Light);
91
+ const darks = useColors().getColors(ColorEnum.Dark);
95
92
 
96
- const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
97
- if (!editable.value) {
98
- return {
99
- "--fs-radio-cursor": "default",
100
- "--fs-radio-radio-color": lights.dark,
101
- "--fs-radio-color": lights.dark
102
- };
103
- }
104
- return {
105
- "--fs-radio-cursor": selected.value ? "default" : "pointer",
106
- "--fs-radio-radio-color": selected.value ? colors.base : darks.base,
107
- "--fs-radio-color" : darks.base
108
- };
109
- });
93
+ const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
94
+ if (!props.editable) {
95
+ return {
96
+ "--fs-radio-cursor" : "default",
97
+ "--fs-radio-radio-color": lights.dark,
98
+ "--fs-radio-color" : lights.dark
99
+ };
100
+ }
101
+ return {
102
+ "--fs-radio-cursor" : props.selected ? "default" : "pointer",
103
+ "--fs-radio-radio-color": props.selected ? colors.value.base : darks.base,
104
+ "--fs-radio-color" : darks.base
105
+ };
106
+ });
110
107
 
111
- const icon = computed((): string => selected.value ? "mdi-radiobox-marked" : "mdi-radiobox-blank");
108
+ const icon = computed((): string => props.selected ? "mdi-radiobox-marked" : "mdi-radiobox-blank");
112
109
 
113
- const font = computed((): string => selected.value ? "text-button" : "text-body");
110
+ const font = computed((): string => props.selected ? "text-button" : "text-body");
114
111
 
115
- const onToggle = (): void => {
116
- if (!editable.value) {
117
- return;
118
- }
119
- if (!selected.value) {
120
- emit("update:value", value.value);
121
- }
122
- };
112
+ const onToggle = (): void => {
113
+ if (!props.editable) {
114
+ return;
115
+ }
116
+ if (!props.selected) {
117
+ emit("update:modelValue", props.modelValue);
118
+ }
119
+ };
123
120
 
124
- return {
125
- style,
126
- icon,
127
- font,
128
- onToggle
129
- };
130
- }
121
+ return {
122
+ style,
123
+ icon,
124
+ font,
125
+ onToggle
126
+ };
127
+ }
131
128
  });
132
129
  </script>