@rock555/frontend-core 2.0.2 → 3.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 (66) hide show
  1. package/README.md +95 -95
  2. package/package.json +98 -98
  3. package/src/components/GlobalPendingBar.vue +85 -85
  4. package/src/components/SearchPicker.vue +84 -84
  5. package/src/components/filters/DateRangeField.vue +692 -692
  6. package/src/components/filters/{ExportCsvButton.vue → ExportButton.vue} +62 -60
  7. package/src/components/filters/FiltersBar.vue +150 -150
  8. package/src/components/filters/MonthField.vue +309 -309
  9. package/src/components/filters/SortControl.vue +162 -162
  10. package/src/components/filters/SortControlPanel.vue +242 -242
  11. package/src/components/filters/sortControl.types.ts +25 -25
  12. package/src/components/modals/ConfirmModal.vue +58 -58
  13. package/src/components/modals/ImageViewerModal.vue +200 -200
  14. package/src/components/tables/MultiSortHeader.vue +126 -126
  15. package/src/components/tables/TableBodyRow.vue +62 -62
  16. package/src/components/tables/TableFooterRow.vue +54 -54
  17. package/src/components/tables/TableHeaderRow.vue +75 -75
  18. package/src/components/tables/TableLoadedCount.vue +61 -61
  19. package/src/components/tables/TableLoadedFooter.vue +44 -44
  20. package/src/components/tables/TableSkeletonRows.vue +40 -40
  21. package/src/components/tables/TableVirtualPad.vue +16 -16
  22. package/src/components/tables/cells/BoolBadgeCell.vue +32 -32
  23. package/src/components/tables/multiSortHeader.types.ts +16 -16
  24. package/src/components/ui/FilterCheckbox.vue +1 -1
  25. package/src/components/ui/FilterSelect.vue +2 -0
  26. package/src/components/ui/UiActionTiles.vue +92 -92
  27. package/src/components/ui/UiBackLink.vue +39 -39
  28. package/src/components/ui/UiBadge.vue +60 -60
  29. package/src/components/ui/UiButton.vue +126 -126
  30. package/src/components/ui/UiCard.vue +88 -88
  31. package/src/components/ui/UiCount.vue +35 -35
  32. package/src/components/ui/UiKpiGrid.vue +144 -142
  33. package/src/components/ui/UiPopover.vue +62 -62
  34. package/src/components/ui/UiSearchInput.vue +102 -102
  35. package/src/components/ui/UiSegmented.vue +145 -145
  36. package/src/components/ui/UiTableCard.vue +116 -116
  37. package/src/components/ui/inputs/DateFormInput.vue +2 -2
  38. package/src/components/ui/inputs/FileInput.vue +5 -0
  39. package/src/components/ui/inputs/RadioSegmentFormInput.vue +0 -1
  40. package/src/components/ui/inputs/SelectFormInput.vue +1 -2
  41. package/src/components/ui/inputs/SmartField.vue +15 -13
  42. package/src/components/ui/inputs/TextareaFormInput.vue +2 -2
  43. package/src/components/ui/uiActionTiles.types.ts +10 -10
  44. package/src/components/ui/uiBadge.types.ts +11 -11
  45. package/src/components/ui/uiKpi.types.ts +19 -17
  46. package/src/composables/useAppForm.ts +67 -67
  47. package/src/composables/useConfirm.ts +21 -21
  48. package/src/composables/useFilterState.ts +70 -70
  49. package/src/composables/useServerList.ts +348 -348
  50. package/src/composables/useServerTable.ts +117 -117
  51. package/src/composables/useSharedAsync.ts +51 -51
  52. package/src/composables/useVirtualTable.ts +77 -77
  53. package/src/config.ts +156 -155
  54. package/src/errors/actionCancelled.ts +9 -9
  55. package/src/errors/apiError.helper.ts +161 -161
  56. package/src/errors/useHandleError.ts +33 -33
  57. package/src/helpers/calendarRange.helper.ts +74 -74
  58. package/src/helpers/month.helper.ts +63 -63
  59. package/src/helpers/periodLabel.helper.ts +70 -70
  60. package/src/helpers/periodPresets.helper.ts +76 -76
  61. package/src/helpers/sort.helper.ts +57 -57
  62. package/src/helpers/tableFields.helper.ts +205 -205
  63. package/src/helpers/urlParams.helper.ts +99 -99
  64. package/src/helpers/urlSchema.helper.ts +296 -296
  65. package/src/plugins/modals.plugin.ts +253 -253
  66. package/src/plugins/table.plugin.ts +173 -173
@@ -1,309 +1,309 @@
1
- <script setup lang="ts">
2
- // Вибір календарного місяця — сітка років і місяців, а не дропдаун.
3
- //
4
- // Дропдаун зі списком «Липень 2026, Червень 2026, …» тут програвав по суті:
5
- // місяць — це точка календаря, у нього є рік і дванадцять клітинок, і людина
6
- // шукає його саме так. Списком же доводилось гортати десятки однакових рядків,
7
- // а рік читався лише в кінці підпису.
8
- //
9
- // Доступні місяці задає той, хто кличе (`months`): у виплатах це проміжок від
10
- // початку обліку до поточного місяця. Недоступні клітинки лишаються на місці
11
- // вимкненими — так видно межі періоду, а не порожнечу без пояснення. Без
12
- // `months` можна обрати будь-який місяць будь-якого року.
13
-
14
- import { SharedConfig } from '../../config'
15
- import { CalendarDays, ChevronLeft, ChevronRight, X } from '@lucide/vue'
16
- import { PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger } from 'reka-ui'
17
- import { computed, ref, watch } from 'vue'
18
- import { MonthHelper } from '../../helpers/month.helper'
19
-
20
- const props = withDefaults(defineProps<{
21
- /** `YYYY-MM`; `null` — нічого не обрано. */
22
- modelValue: string | null
23
- /** Місяці, які можна обрати. Порядок неважливий — сітку будує сам компонент. Не задано — будь-які. */
24
- months?: ReadonlyArray<{ value: string; label: string }>
25
- /** Найпізніший доступний місяць `YYYY-MM` — коли межа лише зверху (не майбутнє). */
26
- max?: string
27
- placeholder?: string
28
- disabled?: boolean
29
- /** Чи можна повернутись до «нічого не обрано». */
30
- clearable?: boolean
31
- }>(), {
32
- placeholder: () => SharedConfig.get().labels.monthPlaceholder,
33
- clearable: true,
34
- })
35
-
36
- const emit = defineEmits<{ 'update:modelValue': [value: string | null] }>()
37
-
38
- const isOpen = ref(false)
39
-
40
- const currentYear = new Date().getFullYear()
41
-
42
- /** null — обмежень немає. */
43
- const allowed = computed(() => props.months ? new Set(props.months.map(item => item.value)) : null)
44
-
45
- const years = computed(() => {
46
- const list = [...new Set(
47
- (props.months ?? []).flatMap(item => MonthHelper.parse(item.value)?.year ?? []),
48
- )]
49
-
50
- return list.sort((a, b) => a - b)
51
- })
52
-
53
- const minYear = computed(() => props.months ? years.value[0] ?? currentYear : -Infinity)
54
- const maxYear = computed(() => Math.min(
55
- props.months ? years.value[years.value.length - 1] ?? currentYear : Infinity,
56
- props.max ? MonthHelper.parse(props.max)?.year ?? Infinity : Infinity,
57
- ))
58
-
59
- /**
60
- * Рік, з якого відкривається сітка без вибору: найновіший доступний (свіжий
61
- * місяць потрібен частіше за давній), а без обмежень — поточний.
62
- */
63
- const defaultYear = computed(() => props.months || props.max ? maxYear.value : currentYear)
64
-
65
- /** Рік, який показує сітка. Відкриваємо на році обраного місяця. */
66
- const viewYear = ref(defaultYear.value)
67
-
68
- watch(isOpen, (open) => {
69
- if (!open) return
70
-
71
- viewYear.value = (props.modelValue === null ? null : MonthHelper.parse(props.modelValue)?.year)
72
- ?? defaultYear.value
73
- })
74
-
75
- const cells = computed(() => MonthHelper.names().map((name, index) => {
76
- const value = MonthHelper.key(viewYear.value, index + 1)
77
-
78
- return {
79
- value,
80
- name,
81
- // `YYYY-MM` порівнюється рядком так само, як датою.
82
- isAvailable: (allowed.value === null || allowed.value.has(value)) && (!props.max || value <= props.max),
83
- isSelected: props.modelValue === value,
84
- }
85
- }))
86
-
87
- const triggerLabel = computed(() =>
88
- props.modelValue === null ? props.placeholder : MonthHelper.label(props.modelValue),
89
- )
90
-
91
- function shiftYear(step: 1 | -1): void {
92
- viewYear.value = Math.min(maxYear.value, Math.max(minYear.value, viewYear.value + step))
93
- }
94
-
95
- function pick(value: string): void {
96
- emit('update:modelValue', value)
97
- isOpen.value = false
98
- }
99
-
100
- // Скидання не закриває поповер: услід за «усі місяці» часто одразу обирають
101
- // інший, і повторне відкриття було б зайвим кроком.
102
- function clear(): void {
103
- emit('update:modelValue', null)
104
- }
105
- </script>
106
-
107
- <template>
108
- <PopoverRoot v-model:open="isOpen">
109
- <PopoverTrigger
110
- class="mf-trigger"
111
- :class="{ 'mf-trigger--open': isOpen, 'mf-trigger--empty': modelValue === null }"
112
- :disabled="disabled || months?.length === 0"
113
- >
114
- <CalendarDays :size="14" />
115
- <span class="mf-trigger__label">{{ triggerLabel }}</span>
116
-
117
- <!-- Хрестик прямо в тригері: скидання — найчастіша дія після вибору, і
118
- заради неї відкривати поповер не варто. -->
119
- <span
120
- v-if="clearable && modelValue !== null"
121
- class="mf-trigger__clear"
122
- role="button"
123
- tabindex="-1"
124
- :title="SharedConfig.get().labels.allMonths"
125
- @click.stop="clear"
126
- >
127
- <X :size="13" />
128
- </span>
129
- </PopoverTrigger>
130
-
131
- <PopoverPortal>
132
- <PopoverContent align="start" :side-offset="6" class="mf-pop">
133
- <div class="mf-head">
134
- <button
135
- type="button"
136
- class="mf-head__nav"
137
- :disabled="viewYear <= minYear"
138
- @click="shiftYear(-1)"
139
- >
140
- <ChevronLeft :size="16" />
141
- </button>
142
-
143
- <span class="mf-head__year">{{ viewYear }}</span>
144
-
145
- <button
146
- type="button"
147
- class="mf-head__nav"
148
- :disabled="viewYear >= maxYear"
149
- @click="shiftYear(1)"
150
- >
151
- <ChevronRight :size="16" />
152
- </button>
153
- </div>
154
-
155
- <div class="mf-grid">
156
- <button
157
- v-for="cell in cells"
158
- :key="cell.value"
159
- type="button"
160
- class="mf-grid__cell"
161
- :class="{ 'mf-grid__cell--on': cell.isSelected }"
162
- :disabled="!cell.isAvailable"
163
- @click="pick(cell.value)"
164
- >
165
- {{ cell.name }}
166
- </button>
167
- </div>
168
-
169
- <button
170
- v-if="clearable && modelValue !== null"
171
- type="button"
172
- class="mf-reset"
173
- @click="clear"
174
- >
175
- {{ SharedConfig.get().labels.allMonths }}
176
- </button>
177
- </PopoverContent>
178
- </PopoverPortal>
179
- </PopoverRoot>
180
- </template>
181
-
182
- <style scoped lang="scss">
183
- .mf-trigger {
184
- display: inline-flex;
185
- align-items: center;
186
- gap: 8px;
187
- height: 32px;
188
- padding: 0 10px;
189
-
190
- background: $color-page-bg;
191
- border: 1px solid $color-border;
192
- border-radius: 8px;
193
- color: $color-text;
194
- font-size: 13px;
195
- transition: border-color 0.15s ease, box-shadow 0.15s ease;
196
-
197
- &:hover { border-color: rgba(0, 0, 0, 0.2); }
198
- &:disabled { opacity: 0.6; }
199
-
200
- &--open {
201
- border-color: $color-accent;
202
- box-shadow: 0 0 0 2px $color-accent-dim;
203
- }
204
-
205
- &--empty .mf-trigger__label { color: $color-muted; }
206
-
207
- svg { color: $color-muted; flex-shrink: 0; }
208
-
209
- &__label { white-space: nowrap; }
210
-
211
- &__clear {
212
- display: inline-flex;
213
- margin-right: -3px;
214
- border-radius: 4px;
215
- cursor: pointer;
216
-
217
- &:hover svg { color: $color-text; }
218
- }
219
- }
220
-
221
- .mf-head {
222
- display: flex;
223
- align-items: center;
224
- justify-content: space-between;
225
- gap: 8px;
226
- padding: 8px 10px;
227
- border-bottom: 1px solid $color-border;
228
-
229
- &__year {
230
- font-size: 13px;
231
- font-weight: 600;
232
- font-variant-numeric: tabular-nums;
233
- }
234
-
235
- &__nav {
236
- display: inline-flex;
237
- align-items: center;
238
- justify-content: center;
239
- width: 26px;
240
- height: 26px;
241
-
242
- border: 0;
243
- border-radius: 6px;
244
- background: none;
245
- color: $color-text;
246
-
247
- &:hover:not(:disabled) { background: $color-page-bg; }
248
- &:disabled { color: $color-border; }
249
- }
250
- }
251
-
252
- .mf-grid {
253
- display: grid;
254
- grid-template-columns: repeat(3, 1fr);
255
- gap: 4px;
256
- padding: 8px;
257
-
258
- &__cell {
259
- padding: 7px 8px;
260
-
261
- border: 0;
262
- border-radius: 6px;
263
- background: none;
264
- color: $color-text;
265
- font-size: 12px;
266
-
267
- &:hover:not(:disabled) { background: $color-page-bg; }
268
-
269
- // Недоступний місяць лишається на місці: так видно межі обліку. Прибрати
270
- // його зовсім — і сітка стрибала б від року до року.
271
- &:disabled { color: $color-border; }
272
-
273
- &--on {
274
- background: $color-selected;
275
- color: $color-on-selected;
276
-
277
- &:hover:not(:disabled) { background: $color-accent-ink; }
278
- }
279
- }
280
- }
281
-
282
- .mf-reset {
283
- width: 100%;
284
- padding: 7px 10px;
285
-
286
- border: 0;
287
- border-top: 1px solid $color-border;
288
- background: none;
289
- color: $color-muted;
290
- font-size: 12px;
291
-
292
- &:hover { color: $color-text; background: $color-page-bg; }
293
- }
294
- </style>
295
-
296
- <!-- Корінь телепортованого PopoverContent scope-атрибута не отримує, тому
297
- заливка/тінь/z-index — у нескоупленому блоці (як у DateRangeField). -->
298
- <style lang="scss">
299
- .mf-pop {
300
- z-index: 1000;
301
- width: 260px;
302
-
303
- background: $color-surface;
304
- border: 1px solid $color-border;
305
- border-radius: 12px;
306
- box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
307
- overflow: hidden;
308
- }
309
- </style>
1
+ <script setup lang="ts">
2
+ // Вибір календарного місяця — сітка років і місяців, а не дропдаун.
3
+ //
4
+ // Дропдаун зі списком «Липень 2026, Червень 2026, …» тут програвав по суті:
5
+ // місяць — це точка календаря, у нього є рік і дванадцять клітинок, і людина
6
+ // шукає його саме так. Списком же доводилось гортати десятки однакових рядків,
7
+ // а рік читався лише в кінці підпису.
8
+ //
9
+ // Доступні місяці задає той, хто кличе (`months`): у виплатах це проміжок від
10
+ // початку обліку до поточного місяця. Недоступні клітинки лишаються на місці
11
+ // вимкненими — так видно межі періоду, а не порожнечу без пояснення. Без
12
+ // `months` можна обрати будь-який місяць будь-якого року.
13
+
14
+ import { SharedConfig } from '../../config'
15
+ import { CalendarDays, ChevronLeft, ChevronRight, X } from '@lucide/vue'
16
+ import { PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger } from 'reka-ui'
17
+ import { computed, ref, watch } from 'vue'
18
+ import { MonthHelper } from '../../helpers/month.helper'
19
+
20
+ const props = withDefaults(defineProps<{
21
+ /** `YYYY-MM`; `null` — нічого не обрано. */
22
+ modelValue: string | null
23
+ /** Місяці, які можна обрати. Порядок неважливий — сітку будує сам компонент. Не задано — будь-які. */
24
+ months?: ReadonlyArray<{ value: string; label: string }>
25
+ /** Найпізніший доступний місяць `YYYY-MM` — коли межа лише зверху (не майбутнє). */
26
+ max?: string
27
+ placeholder?: string
28
+ disabled?: boolean
29
+ /** Чи можна повернутись до «нічого не обрано». */
30
+ clearable?: boolean
31
+ }>(), {
32
+ placeholder: () => SharedConfig.get().labels.monthPlaceholder,
33
+ clearable: true,
34
+ })
35
+
36
+ const emit = defineEmits<{ 'update:modelValue': [value: string | null] }>()
37
+
38
+ const isOpen = ref(false)
39
+
40
+ const currentYear = new Date().getFullYear()
41
+
42
+ /** null — обмежень немає. */
43
+ const allowed = computed(() => props.months ? new Set(props.months.map(item => item.value)) : null)
44
+
45
+ const years = computed(() => {
46
+ const list = [...new Set(
47
+ (props.months ?? []).flatMap(item => MonthHelper.parse(item.value)?.year ?? []),
48
+ )]
49
+
50
+ return list.sort((a, b) => a - b)
51
+ })
52
+
53
+ const minYear = computed(() => props.months ? years.value[0] ?? currentYear : -Infinity)
54
+ const maxYear = computed(() => Math.min(
55
+ props.months ? years.value[years.value.length - 1] ?? currentYear : Infinity,
56
+ props.max ? MonthHelper.parse(props.max)?.year ?? Infinity : Infinity,
57
+ ))
58
+
59
+ /**
60
+ * Рік, з якого відкривається сітка без вибору: найновіший доступний (свіжий
61
+ * місяць потрібен частіше за давній), а без обмежень — поточний.
62
+ */
63
+ const defaultYear = computed(() => props.months || props.max ? maxYear.value : currentYear)
64
+
65
+ /** Рік, який показує сітка. Відкриваємо на році обраного місяця. */
66
+ const viewYear = ref(defaultYear.value)
67
+
68
+ watch(isOpen, (open) => {
69
+ if (!open) return
70
+
71
+ viewYear.value = (props.modelValue === null ? null : MonthHelper.parse(props.modelValue)?.year)
72
+ ?? defaultYear.value
73
+ })
74
+
75
+ const cells = computed(() => MonthHelper.names().map((name, index) => {
76
+ const value = MonthHelper.key(viewYear.value, index + 1)
77
+
78
+ return {
79
+ value,
80
+ name,
81
+ // `YYYY-MM` порівнюється рядком так само, як датою.
82
+ isAvailable: (allowed.value === null || allowed.value.has(value)) && (!props.max || value <= props.max),
83
+ isSelected: props.modelValue === value,
84
+ }
85
+ }))
86
+
87
+ const triggerLabel = computed(() =>
88
+ props.modelValue === null ? props.placeholder : MonthHelper.label(props.modelValue),
89
+ )
90
+
91
+ function shiftYear(step: 1 | -1): void {
92
+ viewYear.value = Math.min(maxYear.value, Math.max(minYear.value, viewYear.value + step))
93
+ }
94
+
95
+ function pick(value: string): void {
96
+ emit('update:modelValue', value)
97
+ isOpen.value = false
98
+ }
99
+
100
+ // Скидання не закриває поповер: услід за «усі місяці» часто одразу обирають
101
+ // інший, і повторне відкриття було б зайвим кроком.
102
+ function clear(): void {
103
+ emit('update:modelValue', null)
104
+ }
105
+ </script>
106
+
107
+ <template>
108
+ <PopoverRoot v-model:open="isOpen">
109
+ <PopoverTrigger
110
+ class="mf-trigger"
111
+ :class="{ 'mf-trigger--open': isOpen, 'mf-trigger--empty': modelValue === null }"
112
+ :disabled="disabled || months?.length === 0"
113
+ >
114
+ <CalendarDays :size="14" />
115
+ <span class="mf-trigger__label">{{ triggerLabel }}</span>
116
+
117
+ <!-- Хрестик прямо в тригері: скидання — найчастіша дія після вибору, і
118
+ заради неї відкривати поповер не варто. -->
119
+ <span
120
+ v-if="clearable && modelValue !== null"
121
+ class="mf-trigger__clear"
122
+ role="button"
123
+ tabindex="-1"
124
+ :title="SharedConfig.get().labels.allMonths"
125
+ @click.stop="clear"
126
+ >
127
+ <X :size="13" />
128
+ </span>
129
+ </PopoverTrigger>
130
+
131
+ <PopoverPortal>
132
+ <PopoverContent align="start" :side-offset="6" class="mf-pop">
133
+ <div class="mf-head">
134
+ <button
135
+ type="button"
136
+ class="mf-head__nav"
137
+ :disabled="viewYear <= minYear"
138
+ @click="shiftYear(-1)"
139
+ >
140
+ <ChevronLeft :size="16" />
141
+ </button>
142
+
143
+ <span class="mf-head__year">{{ viewYear }}</span>
144
+
145
+ <button
146
+ type="button"
147
+ class="mf-head__nav"
148
+ :disabled="viewYear >= maxYear"
149
+ @click="shiftYear(1)"
150
+ >
151
+ <ChevronRight :size="16" />
152
+ </button>
153
+ </div>
154
+
155
+ <div class="mf-grid">
156
+ <button
157
+ v-for="cell in cells"
158
+ :key="cell.value"
159
+ type="button"
160
+ class="mf-grid__cell"
161
+ :class="{ 'mf-grid__cell--on': cell.isSelected }"
162
+ :disabled="!cell.isAvailable"
163
+ @click="pick(cell.value)"
164
+ >
165
+ {{ cell.name }}
166
+ </button>
167
+ </div>
168
+
169
+ <button
170
+ v-if="clearable && modelValue !== null"
171
+ type="button"
172
+ class="mf-reset"
173
+ @click="clear"
174
+ >
175
+ {{ SharedConfig.get().labels.allMonths }}
176
+ </button>
177
+ </PopoverContent>
178
+ </PopoverPortal>
179
+ </PopoverRoot>
180
+ </template>
181
+
182
+ <style scoped lang="scss">
183
+ .mf-trigger {
184
+ display: inline-flex;
185
+ align-items: center;
186
+ gap: 8px;
187
+ height: 32px;
188
+ padding: 0 10px;
189
+
190
+ background: $color-page-bg;
191
+ border: 1px solid $color-border;
192
+ border-radius: 8px;
193
+ color: $color-text;
194
+ font-size: 13px;
195
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
196
+
197
+ &:hover { border-color: rgba(0, 0, 0, 0.2); }
198
+ &:disabled { opacity: 0.6; }
199
+
200
+ &--open {
201
+ border-color: $color-accent;
202
+ box-shadow: 0 0 0 2px $color-accent-dim;
203
+ }
204
+
205
+ &--empty .mf-trigger__label { color: $color-muted; }
206
+
207
+ svg { color: $color-muted; flex-shrink: 0; }
208
+
209
+ &__label { white-space: nowrap; }
210
+
211
+ &__clear {
212
+ display: inline-flex;
213
+ margin-right: -3px;
214
+ border-radius: 4px;
215
+ cursor: pointer;
216
+
217
+ &:hover svg { color: $color-text; }
218
+ }
219
+ }
220
+
221
+ .mf-head {
222
+ display: flex;
223
+ align-items: center;
224
+ justify-content: space-between;
225
+ gap: 8px;
226
+ padding: 8px 10px;
227
+ border-bottom: 1px solid $color-border;
228
+
229
+ &__year {
230
+ font-size: 13px;
231
+ font-weight: 600;
232
+ font-variant-numeric: tabular-nums;
233
+ }
234
+
235
+ &__nav {
236
+ display: inline-flex;
237
+ align-items: center;
238
+ justify-content: center;
239
+ width: 26px;
240
+ height: 26px;
241
+
242
+ border: 0;
243
+ border-radius: 6px;
244
+ background: none;
245
+ color: $color-text;
246
+
247
+ &:hover:not(:disabled) { background: $color-page-bg; }
248
+ &:disabled { color: $color-border; }
249
+ }
250
+ }
251
+
252
+ .mf-grid {
253
+ display: grid;
254
+ grid-template-columns: repeat(3, 1fr);
255
+ gap: 4px;
256
+ padding: 8px;
257
+
258
+ &__cell {
259
+ padding: 7px 8px;
260
+
261
+ border: 0;
262
+ border-radius: 6px;
263
+ background: none;
264
+ color: $color-text;
265
+ font-size: 12px;
266
+
267
+ &:hover:not(:disabled) { background: $color-page-bg; }
268
+
269
+ // Недоступний місяць лишається на місці: так видно межі обліку. Прибрати
270
+ // його зовсім — і сітка стрибала б від року до року.
271
+ &:disabled { color: $color-border; }
272
+
273
+ &--on {
274
+ background: $color-selected;
275
+ color: $color-on-selected;
276
+
277
+ &:hover:not(:disabled) { background: $color-accent-ink; }
278
+ }
279
+ }
280
+ }
281
+
282
+ .mf-reset {
283
+ width: 100%;
284
+ padding: 7px 10px;
285
+
286
+ border: 0;
287
+ border-top: 1px solid $color-border;
288
+ background: none;
289
+ color: $color-muted;
290
+ font-size: 12px;
291
+
292
+ &:hover { color: $color-text; background: $color-page-bg; }
293
+ }
294
+ </style>
295
+
296
+ <!-- Корінь телепортованого PopoverContent scope-атрибута не отримує, тому
297
+ заливка/тінь/z-index — у нескоупленому блоці (як у DateRangeField). -->
298
+ <style lang="scss">
299
+ .mf-pop {
300
+ z-index: 1000;
301
+ width: 260px;
302
+
303
+ background: $color-surface;
304
+ border: 1px solid $color-border;
305
+ border-radius: 12px;
306
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
307
+ overflow: hidden;
308
+ }
309
+ </style>