@dative-gpi/foundation-shared-components 0.0.8 → 0.0.10

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 (140) 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 +52 -39
  8. package/components/FSCalendarTwin.vue +120 -102
  9. package/components/FSCard.vue +35 -21
  10. package/components/FSCarousel.vue +63 -0
  11. package/components/FSCheckbox.vue +111 -103
  12. package/components/FSChip.vue +140 -0
  13. package/components/FSClock.vue +149 -15
  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 -101
  33. package/components/FSRadio.vue +107 -109
  34. package/components/FSRadioGroup.vue +55 -57
  35. package/components/FSRemoveDialog.vue +123 -0
  36. package/components/FSRichTextField.vue +26 -33
  37. package/components/FSRow.vue +110 -104
  38. package/components/FSSearchField.vue +35 -27
  39. package/components/FSSelectField.vue +188 -0
  40. package/components/FSSlideGroup.vue +45 -49
  41. package/components/FSSlider.vue +31 -33
  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 +32 -36
  49. package/components/FSTagGroup.vue +38 -45
  50. package/components/FSText.vue +74 -64
  51. package/components/FSTextArea.vue +187 -185
  52. package/components/FSTextField.vue +18 -20
  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/FSDataTableUI.vue +982 -0
  66. package/components/lists/FSFilterButton.vue +177 -0
  67. package/components/lists/FSHeaderButton.vue +99 -0
  68. package/components/lists/FSHiddenButton.vue +81 -0
  69. package/components/tiles/FSDeviceOrganisationTileUI.vue +232 -0
  70. package/components/tiles/FSGroupTileUI.vue +192 -0
  71. package/composables/index.ts +1 -1
  72. package/composables/useBreakpoints.ts +23 -4
  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/index.ts +9 -0
  82. package/models/modelStatuses.ts +11 -0
  83. package/models/rules.ts +50 -0
  84. package/models/tables.ts +33 -0
  85. package/models/toggleSets.ts +7 -0
  86. package/package.json +6 -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 -6
  91. package/styles/components/fs_calendar.scss +24 -1
  92. package/styles/components/fs_card.scss +2 -5
  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 +21 -0
  106. package/styles/components/fs_header_button.scss +4 -0
  107. package/styles/components/fs_hidden_button.scss +12 -0
  108. package/styles/components/fs_icon.scss +19 -3
  109. package/styles/components/fs_icon_field.scss +12 -0
  110. package/styles/components/fs_image.scss +7 -0
  111. package/styles/components/fs_load_tile.scss +49 -0
  112. package/styles/components/fs_password_field.scss +2 -2
  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 +29 -9
  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 +0 -11
  121. package/styles/components/fs_text_field.scss +23 -15
  122. package/styles/components/fs_tile.scss +33 -0
  123. package/styles/components/fs_tooltip.scss +5 -0
  124. package/styles/components/fs_wrap_group.scss +7 -8
  125. package/styles/components/index.scss +22 -1
  126. package/styles/globals/breakpoints.scss +7 -0
  127. package/styles/globals/overrides.scss +20 -7
  128. package/styles/globals/text_fonts.scss +8 -8
  129. package/themes/default.ts +1 -11
  130. package/utils/css.ts +11 -0
  131. package/utils/icons.ts +75416 -0
  132. package/utils/index.ts +5 -1
  133. package/utils/levenshtein.ts +97 -0
  134. package/utils/sort.ts +9 -0
  135. package/components/FSDatePicker.vue +0 -226
  136. package/composables/useDates.ts +0 -39
  137. package/models/FSTags.ts +0 -8
  138. package/models/FSTextFields.ts +0 -23
  139. package/styles/components/fs_date_picker.scss +0 -0
  140. /package/utils/{FSRichTextField.ts → lexical.ts} +0 -0
@@ -1,25 +1,37 @@
1
1
  <template>
2
2
  <v-btn
3
- v-if="!['icon'].includes($props.variant!)"
3
+ v-if="!['icon'].includes($props.variant)"
4
4
  :ripple="false"
5
5
  :style="style"
6
6
  :class="classes"
7
- @click="onClick"
7
+ :disabled="!$props.editable"
8
8
  v-bind="$attrs"
9
9
  >
10
- <FSRow :wrap="false">
11
- <slot name="prepend" v-bind="{ color, colors }">
12
- <FSIcon v-if="$props.prependIcon" size="m">
10
+ <FSRow
11
+ align="center-center"
12
+ width="hug"
13
+ :wrap="false"
14
+ >
15
+ <slot name="prepend" v-bind="{ color: $props.color, colors }">
16
+ <FSIcon
17
+ v-if="$props.prependIcon"
18
+ size="l"
19
+ >
13
20
  {{ $props.prependIcon }}
14
21
  </FSIcon>
15
22
  </slot>
16
- <slot name="default" v-bind="{ color, colors }">
17
- <FSSpan v-if="$props.label" font="text-body">
23
+ <slot v-bind="{ color: $props.color, colors }">
24
+ <FSSpan
25
+ v-if="$props.label"
26
+ >
18
27
  {{ $props.label }}
19
28
  </FSSpan>
20
29
  </slot>
21
- <slot name="append" v-bind="{ color, colors }">
22
- <FSIcon v-if="$props.appendIcon" size="m">
30
+ <slot name="append" v-bind="{ color: $props.color, colors }">
31
+ <FSIcon
32
+ v-if="$props.appendIcon"
33
+ size="l"
34
+ >
23
35
  {{ $props.appendIcon }}
24
36
  </FSIcon>
25
37
  </slot>
@@ -27,23 +39,31 @@
27
39
  </v-btn>
28
40
  <FSRow
29
41
  v-else-if="$props.icon"
42
+ align="center-center"
30
43
  width="hug"
31
44
  :style="style"
32
45
  :class="classes"
33
- @click="onClick"
34
46
  v-bind="$attrs"
35
47
  >
36
- <FSIcon size="m">
48
+ <FSIcon
49
+ size="l"
50
+ >
37
51
  {{ $props.icon }}
38
52
  </FSIcon>
53
+ <FSSpan
54
+ v-if="$props.label"
55
+ font="text-overline"
56
+ >
57
+ {{ $props.label }}
58
+ </FSSpan>
39
59
  </FSRow>
40
60
  </template>
41
61
 
42
62
  <script lang="ts">
43
- import { computed, defineComponent, PropType, toRefs, useSlots } from "vue";
63
+ import { computed, defineComponent, PropType } from "vue";
44
64
 
45
- import { useColors } from "@dative-gpi/foundation-shared-components/composables";
46
- import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
65
+ import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
66
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
47
67
 
48
68
  import FSSpan from "./FSSpan.vue";
49
69
  import FSIcon from "./FSIcon.vue";
@@ -54,143 +74,138 @@ export default defineComponent({
54
74
  components: {
55
75
  FSSpan,
56
76
  FSIcon,
57
- FSRow,
77
+ FSRow
58
78
  },
59
79
  props: {
60
80
  prependIcon: {
61
81
  type: String,
62
82
  required: false,
63
- default: null,
83
+ default: null
64
84
  },
65
85
  label: {
66
86
  type: String,
67
87
  required: false,
68
- default: null,
88
+ default: null
69
89
  },
70
90
  appendIcon: {
71
91
  type: String,
72
92
  required: false,
73
- default: null,
93
+ default: null
74
94
  },
75
95
  icon: {
76
96
  type: String,
77
97
  required: false,
78
- default: null,
98
+ default: null
79
99
  },
80
100
  variant: {
81
101
  type: String as PropType<"standard" | "full" | "icon">,
82
102
  required: false,
83
- default: "standard",
103
+ default: "standard"
84
104
  },
85
105
  color: {
86
106
  type: String as PropType<ColorBase>,
87
107
  required: false,
88
- default: ColorBase.Dark,
108
+ default: ColorEnum.Primary
89
109
  },
90
- editable: {
110
+ fullWidth: {
91
111
  type: Boolean,
92
112
  required: false,
93
- default: true,
113
+ default: false
94
114
  },
115
+ editable: {
116
+ type: Boolean,
117
+ required: false,
118
+ default: true
119
+ }
95
120
  },
96
- emits: ["click"],
97
- setup(props, { emit }) {
98
- const { label, variant, color, editable } = toRefs(props);
121
+ setup(props) {
122
+ const textColors = computed(() => useColors().getContrasts(props.color));
123
+ const colors = computed(() => useColors().getColors(props.color));
124
+ const lights = useColors().getColors(ColorEnum.Light);
99
125
 
100
- const textColors = useColors().getContrasts(color.value);
101
- const colors = useColors().getColors(color.value);
102
- const slots = useSlots();
103
-
104
- const lights = useColors().getColors(ColorBase.Light);
126
+ const { slots } = useSlots();
105
127
 
106
128
  const isEmpty = computed(() => {
107
- return !slots.default && !label.value;
129
+ return !slots.default && !props.label;
108
130
  });
109
131
 
110
- const style = computed(
111
- (): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
112
- if (!editable.value) {
113
- switch (variant.value) {
114
- case "standard":
115
- case "full":
116
- return {
117
- "--fs-button-padding": !isEmpty.value ? "0 16px" : "0",
118
- "--fs-button-background-color": lights.base,
119
- "--fs-button-border-color": lights.dark,
120
- "--fs-button-color": lights.dark,
121
- };
122
- case "icon":
123
- return {
124
- "--fs-button-color": lights.dark,
125
- };
126
- }
127
- }
128
- switch (variant.value) {
132
+ const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
133
+ if (!props.editable) {
134
+ switch (props.variant) {
129
135
  case "standard":
130
- return {
131
- "--fs-button-padding": !isEmpty.value ? "0 16px" : "0",
132
- "--fs-button-background-color": colors.light,
133
- "--fs-button-border-color": colors.base,
134
- "--fs-button-color": textColors.base,
135
- "--fs-button-hover-background-color": colors.base,
136
- "--fs-button-hover-border-color": colors.base,
137
- "--fs-button-hover-color": textColors.light,
138
- "--fs-button-active-background-color": colors.dark,
139
- "--fs-button-active-border-color": colors.dark,
140
- "--fs-button-active-color": textColors.light,
141
- };
142
- case "full":
143
- return {
144
- "--fs-button-padding": !isEmpty.value ? "0 16px" : "0",
145
- "--fs-button-background-color": colors.base,
146
- "--fs-button-border-color": colors.base,
147
- "--fs-button-color": textColors.light,
148
- "--fs-button-hover-background-color": colors.base,
149
- "--fs-button-hover-border-color": colors.base,
150
- "--fs-button-hover-color": textColors.light,
151
- "--fs-button-active-background-color": colors.dark,
152
- "--fs-button-active-border-color": colors.dark,
153
- "--fs-button-active-color": textColors.light,
154
- };
155
- case "icon":
156
- return {
157
- "--fs-button-color": textColors.base,
158
- "--fs-button-hover-color": textColors.dark,
159
- };
136
+ case "full": return {
137
+ "--fs-button-padding" : !isEmpty.value ? "0 16px" : "0",
138
+ "--fs-button-background-color": lights.base,
139
+ "--fs-button-border-color" : lights.dark,
140
+ "--fs-button-color" : lights.dark,
141
+ };
142
+ case "icon": return {
143
+ "--fs-button-color": lights.dark,
144
+ };
145
+ }
146
+ }
147
+ switch (props.variant) {
148
+ case "standard": return {
149
+ "--fs-button-padding" : !isEmpty.value ? "0 16px" : "0",
150
+ "--fs-button-background-color" : colors.value.light,
151
+ "--fs-button-border-color" : colors.value.base,
152
+ "--fs-button-color" : textColors.value.base,
153
+ "--fs-button-hover-background-color" : colors.value.base,
154
+ "--fs-button-hover-border-color" : colors.value.base,
155
+ "--fs-button-hover-color" : textColors.value.light,
156
+ "--fs-button-active-background-color": colors.value.dark,
157
+ "--fs-button-active-border-color" : colors.value.dark,
158
+ "--fs-button-active-color" : textColors.value.light,
159
+ };
160
+ case "full": return {
161
+ "--fs-button-padding" : !isEmpty.value ? "0 16px" : "0",
162
+ "--fs-button-background-color" : colors.value.base,
163
+ "--fs-button-border-color" : colors.value.base,
164
+ "--fs-button-color" : textColors.value.light,
165
+ "--fs-button-hover-background-color" : colors.value.base,
166
+ "--fs-button-hover-border-color" : colors.value.base,
167
+ "--fs-button-hover-color" : textColors.value.light,
168
+ "--fs-button-active-background-color": colors.value.dark,
169
+ "--fs-button-active-border-color" : colors.value.dark,
170
+ "--fs-button-active-color" : textColors.value.light,
171
+ };
172
+ case "icon": switch (props.color) {
173
+ case ColorEnum.Dark: return {
174
+ "--fs-button-color" : colors.value.light,
175
+ "--fs-button-hover-color": colors.value.dark,
176
+ };
177
+ default: return {
178
+ "--fs-button-color" : colors.value.base,
179
+ "--fs-button-hover-color": colors.value.dark,
180
+ };
160
181
  }
161
182
  }
162
- );
183
+ });
163
184
 
164
185
  const classes = computed((): string[] => {
165
- const classes: string[] = [];
166
- if (!editable.value) {
167
- classes.push("fs-button--disabled");
186
+ const classNames: string[] = [];
187
+ if (!props.editable) {
188
+ classNames.push("fs-button--disabled");
168
189
  }
169
- switch (variant.value) {
190
+ if (props.fullWidth) {
191
+ classNames.push("fs-button-full-width");
192
+ }
193
+ switch (props.variant) {
170
194
  case "icon":
171
- classes.push("fs-button-icon");
195
+ classNames.push("fs-button-icon");
172
196
  break;
173
197
  default:
174
- classes.push("fs-button");
198
+ classNames.push("fs-button");
175
199
  break;
176
200
  }
177
- return classes;
201
+ return classNames;
178
202
  });
179
203
 
180
- const onClick = () => {
181
- if (!editable.value) {
182
- return;
183
- }
184
- emit("click");
185
- };
186
-
187
204
  return {
188
205
  colors,
189
- color,
190
206
  style,
191
- classes,
192
- onClick,
207
+ classes
193
208
  };
194
- },
209
+ }
195
210
  });
196
- </script>
211
+ </script>
@@ -21,6 +21,7 @@
21
21
  size="l"
22
22
  variant="icon"
23
23
  icon="mdi-chevron-left"
24
+ :color="ColorEnum.Dark"
24
25
  @click="onClickPrevious"
25
26
  />
26
27
  <FSSpan
@@ -33,6 +34,7 @@
33
34
  size="l"
34
35
  variant="icon"
35
36
  icon="mdi-chevron-right"
37
+ :color="ColorEnum.Dark"
36
38
  @click="onClickNext"
37
39
  />
38
40
  </FSRow>
@@ -46,8 +48,9 @@
46
48
  :year="innerYear"
47
49
  :multiple="false"
48
50
  :showAdjacentMonths="true"
49
- :modelValue="datesTools.epochToPicker($props.modelValue)"
50
- @update:modelValue="(value) => $emit('update:modelValue', datesTools.pickerToEpoch(value))"
51
+ :allowedDates="allowedDates"
52
+ :modelValue="epochToPicker($props.modelValue)"
53
+ @update:modelValue="(value) => $emit('update:modelValue', pickerToEpoch(value[0]))"
51
54
  @update:month="null"
52
55
  @update:year="null"
53
56
  />
@@ -57,12 +60,11 @@
57
60
  </template>
58
61
 
59
62
  <script lang="ts">
60
- import { computed, defineComponent, PropType, ref, toRefs } from "vue";
61
- import { useDate as useAdapter } from "vuetify/lib/composables/date/index.mjs";
63
+ import { computed, defineComponent, PropType, ref } from "vue";
62
64
 
63
- import { useColors, useDates } from "@dative-gpi/foundation-shared-components/composables";
64
- import { useLanguageCode } from "@dative-gpi/foundation-shared-services/composables";
65
- import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
65
+ import { useTimeZone, useLanguageCode } from "@dative-gpi/foundation-shared-services/composables";
66
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
67
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
66
68
 
67
69
  import FSButton from "./FSButton.vue";
68
70
  import FSSpan from "./FSSpan.vue";
@@ -84,56 +86,52 @@ export default defineComponent({
84
86
  default: null
85
87
  },
86
88
  modelValue: {
87
- type: Array as PropType<Array<number>>,
89
+ type: Number,
88
90
  required: false,
89
91
  default: null
90
92
  },
91
93
  color: {
92
94
  type: String as PropType<ColorBase>,
93
95
  required: false,
94
- default: ColorBase.Dark
96
+ default: ColorEnum.Primary
95
97
  },
96
- buttonColor: {
97
- type: String as PropType<ColorBase>,
98
+ limit: {
99
+ type: String as PropType<"none" | "past" | "future">,
98
100
  required: false,
99
- default: ColorBase.Primary
101
+ default: "none"
100
102
  }
101
103
  },
104
+ emits: ["update:modelValue"],
102
105
  setup(props) {
103
- const { modelValue, color, buttonColor } = toRefs(props);
104
-
105
- const languageCode = useLanguageCode().languageCode;
106
- const datesTools = useDates();
107
- const adapter = useAdapter();
108
-
109
- const colors = useColors().getColors(color.value);
110
- const buttonColors = useColors().getColors(buttonColor.value);
106
+ const { epochToPicker, pickerToEpoch, todayToEpoch } = useTimeZone();
107
+ const { languageCode } = useLanguageCode();
111
108
 
112
- const backgrounds = useColors().getColors(ColorBase.Background);
109
+ const colors = computed(() => useColors().getColors(props.color));
110
+ const backgrounds = useColors().getColors(ColorEnum.Background);
111
+ const darks = useColors().getColors(ColorEnum.Dark);
113
112
 
114
- const innerMonth = ref(modelValue.value.length ? datesTools.epochToPicker(modelValue.value)[0].getMonth() : new Date().getMonth());
115
- const innerYear = ref(modelValue.value.length ? datesTools.epochToPicker(modelValue.value)[0].getFullYear() : new Date().getFullYear());
113
+ const innerMonth = ref(props.modelValue ? epochToPicker(props.modelValue).getMonth() : new Date().getMonth());
114
+ const innerYear = ref(props.modelValue ? epochToPicker(props.modelValue).getFullYear() : new Date().getFullYear());
116
115
 
117
116
  const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
118
117
  return {
119
118
  "--fs-calendar-background-color" : backgrounds.base,
120
- "--fs-calendar-hover-background-color" : buttonColors.light,
121
- "--fs-calendar-active-background-color": buttonColors.base,
122
- "--fs-calendar-border-color" : colors.base,
123
- "--fs-calendar-hover-border-color" : buttonColors.base,
124
- "--fs-calendar-active-border-color" : buttonColors.base,
125
- "--fs-calendar-color" : colors.base,
126
- "--fs-calendar-hover-color" : buttonColors.base,
127
- "--fs-calendar-active-color" : buttonColors.light
119
+ "--fs-calendar-hover-background-color" : colors.value.light,
120
+ "--fs-calendar-active-background-color": colors.value.base,
121
+ "--fs-calendar-border-color" : darks.base,
122
+ "--fs-calendar-hover-border-color" : colors.value.base,
123
+ "--fs-calendar-active-border-color" : colors.value.base,
124
+ "--fs-calendar-color" : darks.base,
125
+ "--fs-calendar-hover-color" : colors.value.base,
126
+ "--fs-calendar-active-color" : colors.value.light
128
127
  };
129
128
  });
130
129
 
131
- const text = computed(() => {
132
- adapter.locale = languageCode;
133
- return adapter.format(
134
- adapter.setYear(adapter.setMonth(adapter.date(), innerMonth.value), innerYear.value),
135
- 'monthAndYear',
136
- );
130
+ const text = computed((): string => {
131
+ const date = new Date(0);
132
+ date.setMonth(innerMonth.value);
133
+ date.setFullYear(innerYear.value);
134
+ return new Intl.DateTimeFormat(languageCode.value, { month: "long", year: "numeric" }).format(date);
137
135
  });
138
136
 
139
137
  const onClickPrevious = (): void => {
@@ -156,15 +154,30 @@ export default defineComponent({
156
154
  }
157
155
  };
158
156
 
157
+ const allowedDates = (value: Date): boolean => {
158
+ const valueEpoch = pickerToEpoch(value);
159
+ switch (props.limit) {
160
+ case "past":
161
+ return valueEpoch <= todayToEpoch(true);
162
+ case "future":
163
+ return valueEpoch >= todayToEpoch(true);
164
+ default:
165
+ return true;
166
+ }
167
+ };
168
+
159
169
  return {
170
+ ColorEnum,
160
171
  languageCode,
161
172
  style,
162
173
  text,
163
174
  innerMonth,
164
175
  innerYear,
165
- datesTools,
176
+ epochToPicker,
177
+ pickerToEpoch,
166
178
  onClickPrevious,
167
- onClickNext
179
+ onClickNext,
180
+ allowedDates
168
181
  };
169
182
  }
170
183
  });