@skyservice-developers/vue-dev-kit 2.13.3 → 2.14.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.
package/README.md CHANGED
@@ -33,10 +33,11 @@ import {
33
33
  SkyTableRoot, SkyTableHeader, SkyTableHead, SkyTableBody, SkyTableRow, SkyTableCell,
34
34
  useTableSort, useTableSelection, useColumnVisibility,
35
35
  FunctionalCalendar, SkyDateRangePicker,
36
+ SkyFilterDropdown,
36
37
  // widgets
37
38
  SkyTileCard,
38
39
  // features
39
- SkyCheckboxFilter,
40
+ SkyCheckboxFilter, SkySelectFilter,
40
41
  TableMassActions, TableColumnSettings, TableVirtualBody,
41
42
  // sdk
42
43
  navigate, SkyserviceAPI, isInsideIframe,
@@ -1110,7 +1111,7 @@ const range = reactive({ start: '', end: '' }) // { start, end } у формат
1110
1111
 
1111
1112
  ### SkyCheckboxFilter
1112
1113
 
1113
- Кнопка-фільтр з дропдауном, пошуком і мульти-вибором (через `SkyCheckbox`). Лочить скрол сторінки, поки відкритий. Стилі повторюють адмінку Skymarket 1:1.
1114
+ Кнопка-фільтр з дропдауном, пошуком і мульти-вибором (через `SkyCheckbox`). Оболонку — тригер, панель, позиціювання, закриття — тримає `SkyFilterDropdown`. Стилі повторюють адмінку Skymarket 1:1.
1114
1115
 
1115
1116
  ```vue
1116
1117
  <SkyCheckboxFilter
@@ -1136,6 +1137,77 @@ const range = reactive({ start: '', end: '' }) // { start, end } у формат
1136
1137
  | `searchPlaceholder` | `String` | `'Пошук'` | Placeholder пошуку |
1137
1138
  | `disabled` | `Boolean` | `false` | Вимкнений стан |
1138
1139
 
1140
+ ### SkySelectFilter
1141
+
1142
+ Той самий фільтр-чіп, але з **одиничним** вибором — для випадків, коли бекенд приймає рівно
1143
+ одне значення. Після вибору дропдаун закривається.
1144
+
1145
+ ```vue
1146
+ <SkySelectFilter
1147
+ v-model="categoryId"
1148
+ title="Категорія"
1149
+ all-label="Усі категорії"
1150
+ :options="[
1151
+ { value: 10, name: 'Напої', depth: 0 },
1152
+ { value: 11, name: 'Кава', depth: 1 },
1153
+ ]"
1154
+ />
1155
+ ```
1156
+
1157
+ #### Props
1158
+
1159
+ | Prop | Тип | За замовчуванням | Опис |
1160
+ |------|-----|------------------|------|
1161
+ | `title` | `String` | — | Заголовок фільтра (показується у тригері) |
1162
+ | `options` | `Array<{ value, name, depth? }>` | — | Опції; `depth` лише відступає рядок |
1163
+ | `modelValue` | `String\|Number\|null` | `null` | Обране значення (v-model); `null` — фільтр вимкнено |
1164
+ | `allLabel` | `String` | `''` | Лейбл рядка «без фільтра»; порожній — рядка немає |
1165
+ | `searchPlaceholder` | `String` | `'Пошук'` | Placeholder пошуку |
1166
+ | `emptyLabel` | `String` | `'Нічого не знайдено'` | Текст порожнього результату пошуку |
1167
+ | `searchable` | `Boolean` | `true` | Показувати поле пошуку |
1168
+ | `disabled` | `Boolean` | `false` | Вимкнений стан |
1169
+
1170
+ ---
1171
+
1172
+ ## SkyFilterDropdown
1173
+
1174
+ Оболонка фільтра: тригер-чіп + панель. Бере на себе тільки спільне — стан відкриття,
1175
+ позиціювання, закриття і доступність; вміст панелі за викликачем. На ній побудовані
1176
+ `SkyCheckboxFilter` і `SkySelectFilter`; бери її напряму для фільтра з власним вмістом.
1177
+
1178
+ Панель телепортується у `<body>` (щоб `transform` у предка не ламав `position: fixed`),
1179
+ перепозиціюється на скрол і resize, притискається до країв екрана й розкривається вгору,
1180
+ коли знизу тісно. Скрол сторінки **не** локиться. Закриття — клік поза межами, `Esc`.
1181
+
1182
+ ```vue
1183
+ <SkyFilterDropdown title="Період" summary="Цей тиждень">
1184
+ <template #default="{ close }">
1185
+ <button @click="close">Готово</button>
1186
+ </template>
1187
+ </SkyFilterDropdown>
1188
+ ```
1189
+
1190
+ #### Props
1191
+
1192
+ | Prop | Тип | За замовчуванням | Опис |
1193
+ |------|-----|------------------|------|
1194
+ | `title` | `String` | — | Лейбл чіпа |
1195
+ | `summary` | `String` | `''` | Заміняє `title`, коли обрано рівно одне |
1196
+ | `badge` | `String\|Number` | `''` | Показується поруч із `title` (напр. лічильник) |
1197
+ | `align` | `'start'\|'end'` | `'start'` | До якого краю тригера притискається панель |
1198
+ | `width` | `Number` | `280` | Ширина панелі в px |
1199
+ | `disabled` | `Boolean` | `false` | Вимкнений стан |
1200
+
1201
+ #### Slots / Events / Expose
1202
+
1203
+ | | |
1204
+ |---|---|
1205
+ | slot `default` | `{ close }` — вміст панелі |
1206
+ | events | `open`, `close` |
1207
+ | expose | `open()`, `close()`, `toggle()`, `isOpen` |
1208
+
1209
+ CSS-змінні (`--sky-filter-*`) — див. [доки](https://74cfe434-a2b3-4d49-8fa7-db7343e399dc.apps.platform365.online/components/sky-filter-dropdown).
1210
+
1139
1211
  ---
1140
1212
 
1141
1213
  ## sky-service-ui-components
@@ -1287,6 +1359,7 @@ src/
1287
1359
  │ ├── table/ # примітиви композиційної таблиці (Root/Header/Head/Body/Row/Cell/Empty)
1288
1360
  │ ├── SkyTable/ # готова віртуал-скрол таблиця (Header/Row/Footer/DynamicScroller/items/*)
1289
1361
  │ ├── SkyTileCard/
1362
+ │ ├── SkyFilterDropdown/ # оболонка фільтра (тригер + панель) + FilterSearch
1290
1363
  │ ├── functional-calendar/ # форк vue-functional-calendar, перенесений зі SkyMarket 1:1
1291
1364
  │ ├── SkyDateRangePicker/ # DatePickerRange зі SkyMarket, store/langs → props/локальний стан
1292
1365
  │ └── <Component>/
@@ -1296,7 +1369,8 @@ src/
1296
1369
  │ └── table/ # skyTableFeatures + useTableSort / useTableSelection / useColumnVisibility
1297
1370
  ├── features/ # фічові блоки (orchestration shared/ui)
1298
1371
  │ ├── index.ts
1299
- │ ├── SkyCheckboxFilter/
1372
+ │ ├── SkyCheckboxFilter/ # мульти-вибір на SkyFilterDropdown
1373
+ │ ├── SkySelectFilter/ # одиничний вибір на SkyFilterDropdown
1300
1374
  │ ├── table/ # TableMassActions / TableColumnSettings / TableVirtualBody
1301
1375
  │ └── data-table/ # SkyDataTable на TanStack v9 + перемикач колонок
1302
1376
  ├── sdk/ # TypeScript SDK (без Vue залежностей)
@@ -0,0 +1,73 @@
1
+ type OptionValue = string | number;
2
+ interface Option {
3
+ value: OptionValue;
4
+ name: string;
5
+ /** Nesting level for tree-shaped lists; indents the row, nothing more. */
6
+ depth?: number;
7
+ }
8
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
9
+ title: string;
10
+ options: Option[];
11
+ /** `null` — nothing picked, i.e. the filter is off. */
12
+ modelValue?: OptionValue | null;
13
+ /** Label of the leading "no filter" row; omit to hide that row. */
14
+ allLabel?: string;
15
+ searchPlaceholder?: string;
16
+ emptyLabel?: string;
17
+ searchable?: boolean;
18
+ disabled?: boolean;
19
+ }>, {
20
+ modelValue: null;
21
+ allLabel: string;
22
+ searchPlaceholder: string;
23
+ emptyLabel: string;
24
+ searchable: boolean;
25
+ disabled: boolean;
26
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
27
+ "update:modelValue": (args_0: OptionValue | null) => void;
28
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
29
+ title: string;
30
+ options: Option[];
31
+ /** `null` — nothing picked, i.e. the filter is off. */
32
+ modelValue?: OptionValue | null;
33
+ /** Label of the leading "no filter" row; omit to hide that row. */
34
+ allLabel?: string;
35
+ searchPlaceholder?: string;
36
+ emptyLabel?: string;
37
+ searchable?: boolean;
38
+ disabled?: boolean;
39
+ }>, {
40
+ modelValue: null;
41
+ allLabel: string;
42
+ searchPlaceholder: string;
43
+ emptyLabel: string;
44
+ searchable: boolean;
45
+ disabled: boolean;
46
+ }>>> & Readonly<{
47
+ "onUpdate:modelValue"?: ((args_0: OptionValue | null) => any) | undefined;
48
+ }>, {
49
+ modelValue: OptionValue | null;
50
+ disabled: boolean;
51
+ searchPlaceholder: string;
52
+ allLabel: string;
53
+ emptyLabel: string;
54
+ searchable: boolean;
55
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
56
+ export default _default;
57
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
58
+ type __VLS_TypePropsToRuntimeProps<T> = {
59
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
60
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
61
+ } : {
62
+ type: import('vue').PropType<T[K]>;
63
+ required: true;
64
+ };
65
+ };
66
+ type __VLS_WithDefaults<P, D> = {
67
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
68
+ default: D[K];
69
+ }> : P[K];
70
+ };
71
+ type __VLS_Prettify<T> = {
72
+ [K in keyof T]: T[K];
73
+ } & {};
@@ -0,0 +1 @@
1
+ export { default } from './SkySelectFilter.vue';
@@ -1,3 +1,4 @@
1
1
  export { default as SkyCheckboxFilter } from './SkyCheckboxFilter';
2
+ export { default as SkySelectFilter } from './SkySelectFilter';
2
3
  export * from './table';
3
4
  export * from './data-table';
@@ -0,0 +1,25 @@
1
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
2
+ modelValue: string;
3
+ placeholder?: string;
4
+ /** Rendered as the field's accessible name (the row has no visible label). */
5
+ label?: string;
6
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ "update:modelValue": (args_0: string) => void;
8
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
9
+ modelValue: string;
10
+ placeholder?: string;
11
+ /** Rendered as the field's accessible name (the row has no visible label). */
12
+ label?: string;
13
+ }>>> & Readonly<{
14
+ "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
16
+ export default _default;
17
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
18
+ type __VLS_TypePropsToRuntimeProps<T> = {
19
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
20
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
21
+ } : {
22
+ type: import('vue').PropType<T[K]>;
23
+ required: true;
24
+ };
25
+ };
@@ -0,0 +1,86 @@
1
+ declare function open(): void;
2
+ declare function close(): void;
3
+ declare function toggle(): void;
4
+ declare function __VLS_template(): {
5
+ default?(_: {
6
+ close: typeof close;
7
+ }): any;
8
+ };
9
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
10
+ /** Chip label, always visible. */
11
+ title: string;
12
+ /** Replaces the title when exactly one thing is picked (e.g. the option name). */
13
+ summary?: string;
14
+ /** Shown next to the title when several things are picked (e.g. the count). */
15
+ badge?: string | number;
16
+ disabled?: boolean;
17
+ /** Which trigger edge the panel lines up with when it fits. */
18
+ align?: "start" | "end";
19
+ /** Panel width in px; the panel never grows past the viewport. */
20
+ width?: number;
21
+ }>, {
22
+ summary: string;
23
+ badge: string;
24
+ disabled: boolean;
25
+ align: string;
26
+ width: number;
27
+ }>>, {
28
+ open: typeof open;
29
+ close: typeof close;
30
+ toggle: typeof toggle;
31
+ isOpen: import('vue').Ref<boolean, boolean>;
32
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
33
+ open: () => void;
34
+ close: () => void;
35
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
36
+ /** Chip label, always visible. */
37
+ title: string;
38
+ /** Replaces the title when exactly one thing is picked (e.g. the option name). */
39
+ summary?: string;
40
+ /** Shown next to the title when several things are picked (e.g. the count). */
41
+ badge?: string | number;
42
+ disabled?: boolean;
43
+ /** Which trigger edge the panel lines up with when it fits. */
44
+ align?: "start" | "end";
45
+ /** Panel width in px; the panel never grows past the viewport. */
46
+ width?: number;
47
+ }>, {
48
+ summary: string;
49
+ badge: string;
50
+ disabled: boolean;
51
+ align: string;
52
+ width: number;
53
+ }>>> & Readonly<{
54
+ onOpen?: (() => any) | undefined;
55
+ onClose?: (() => any) | undefined;
56
+ }>, {
57
+ disabled: boolean;
58
+ summary: string;
59
+ badge: string | number;
60
+ align: "start" | "end";
61
+ width: number;
62
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
63
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
64
+ export default _default;
65
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
66
+ type __VLS_TypePropsToRuntimeProps<T> = {
67
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
68
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
69
+ } : {
70
+ type: import('vue').PropType<T[K]>;
71
+ required: true;
72
+ };
73
+ };
74
+ type __VLS_WithDefaults<P, D> = {
75
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
76
+ default: D[K];
77
+ }> : P[K];
78
+ };
79
+ type __VLS_Prettify<T> = {
80
+ [K in keyof T]: T[K];
81
+ } & {};
82
+ type __VLS_WithTemplateSlots<T, S> = T & {
83
+ new (): {
84
+ $slots: S;
85
+ };
86
+ };
@@ -0,0 +1 @@
1
+ export { default } from './SkyFilterDropdown.vue';
@@ -13,6 +13,7 @@ export { default as SkyCardHeader } from './SkyCardHeader';
13
13
  export { default as SkyCardRow } from './SkyCardRow';
14
14
  export { default as SkyCheckbox } from './SkyCheckbox';
15
15
  export { default as SkyDateRangePicker } from './SkyDateRangePicker';
16
+ export { default as SkyFilterDropdown } from './SkyFilterDropdown';
16
17
  export { default as SkyInput } from './SkyInput';
17
18
  export { default as SkyLoader } from './SkyLoader';
18
19
  export { default as SkySelect } from './SkySelect';