eco-vue-js 0.26.19 → 0.26.21
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/dist/assets/icons/IconSpinner.js +1 -1
- package/dist/components/DatePicker/WDatePicker.vue.d.ts.map +1 -1
- package/dist/components/DatePicker/WDatePicker.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/DatePicker/components/CalendarValue.vue.d.ts +0 -1
- package/dist/components/DatePicker/components/CalendarValue.vue.d.ts.map +1 -1
- package/dist/components/DatePicker/components/CalendarValue.vue_vue_type_script_setup_true_lang.js +2 -6
- package/dist/components/Dismissable/WDismissable.vue.d.ts.map +1 -1
- package/dist/components/Dismissable/WDismissable.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/FilePicker/components/FilePickerSvg.vue.d.ts.map +1 -1
- package/dist/components/FilePicker/components/FilePickerSvg.vue_vue_type_script_setup_true_lang.js +4 -14
- package/dist/components/Input/WInputAsync.vue.d.ts.map +1 -1
- package/dist/components/Input/WInputAsync.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/Nav/WNavItem.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/Select/WSelect.vue.d.ts +3 -3
- package/dist/components/Select/WSelect.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelect.vue_vue_type_script_setup_true_lang.js +84 -362
- package/dist/components/Select/WSelectAsync.vue.d.ts +3 -3
- package/dist/components/Select/WSelectAsync.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsync.vue_vue_type_script_setup_true_lang.js +96 -237
- package/dist/components/Select/WSelectAsyncSingle.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsyncSingle.vue_vue_type_script_setup_true_lang.js +106 -10
- package/dist/components/Select/WSelectSingle.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectSingle.vue_vue_type_script_setup_true_lang.js +61 -8
- package/dist/components/Select/WSelectStringified.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/Select/components/SelectAsyncBase.vue.d.ts +54 -0
- package/dist/components/Select/components/SelectAsyncBase.vue.d.ts.map +1 -0
- package/dist/components/Select/components/SelectAsyncBase.vue.js +5 -0
- package/dist/components/Select/components/SelectAsyncBase.vue_vue_type_script_setup_true_lang.js +406 -0
- package/dist/components/Select/components/SelectBase.vue.d.ts +52 -0
- package/dist/components/Select/components/SelectBase.vue.d.ts.map +1 -0
- package/dist/components/Select/components/SelectBase.vue.js +5 -0
- package/dist/components/Select/components/SelectBase.vue_vue_type_script_setup_true_lang.js +495 -0
- package/dist/components/Select/components/SelectDeferred.vue.d.ts +29 -0
- package/dist/components/Select/components/SelectDeferred.vue.d.ts.map +1 -0
- package/dist/components/Select/components/SelectDeferred.vue.js +5 -0
- package/dist/components/Select/components/SelectDeferred.vue_vue_type_script_setup_true_lang.js +166 -0
- package/dist/components/Select/models/useDeferred.d.ts +22 -0
- package/dist/components/Select/models/useDeferred.d.ts.map +1 -0
- package/dist/components/Select/models/useDeferred.js +69 -0
- package/dist/components/Select/types.d.ts +21 -3
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/Shine/WShine.vue.d.ts.map +1 -1
- package/dist/components/Shine/WShine.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/Shine/WShineEffect.vue.d.ts.map +1 -1
- package/dist/components/Shine/WShineEffect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/Spinner/WSpinner.vue.d.ts.map +1 -1
- package/dist/components/Spinner/WSpinner.vue.js +1 -1
- package/dist/components/Tabs/WTabs.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/Uniform/use/useUniformModel.d.ts.map +1 -1
- package/dist/components/Uniform/use/useUniformModel.js +3 -2
- package/dist/components/Uniform/utils/utils.js +2 -2
- package/dist/main.js +2 -2
- package/dist/utils/useRouteTitle.d.ts +2 -2
- package/dist/utils/useRouteTitle.d.ts.map +1 -1
- package/dist/utils/useRouteTitle.js +3 -3
- package/dist/utils/utils.d.ts +3 -0
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +5 -2
- package/docs/components/select.md +67 -5
- package/docs/llms.txt +1 -1
- package/package.json +1 -1
- package/tailwind-base/base.css +1 -0
- package/tailwind-base/css/animations.css +10 -0
- package/tailwind-base/css/reduced-motion.css +15 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAc,cAAc,EAAE,cAAc,EAAE,UAAU,EAAC,MAAM,yBAAyB,CAAA;AACpG,OAAO,KAAK,EAAC,YAAY,EAAE,KAAK,EAAE,UAAU,EAAC,MAAM,KAAK,CAAA;AAgBxD,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,KAAG,OAAO,GAAG,IAK7C,CAAA;AAEV;;;;GAIG;AACH,eAAO,MAAM,cAAc,GACzB,SAAS,OAAO,EAChB,gCAAiD;IAAC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAM,KAC5I,IAmBF,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,IAAI,EAAE,YAAQ,KAAG,KAAK,CAAC,OAAO,CAaxE,CAAA;AAGD,KAAK,UAAU,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAA;AAE1C,wBAAgB,QAAQ,CAAC,CAAC,SAAS,UAAU,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,SAAM,GAAG,CAAC,CAWpE;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,UAAU,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,SAAM,GAAG,CAAC,CAYpE;AAED,eAAO,MA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MAAM,KAAK,GAAG,MAAM,EAAE,OAAO,KAAK,EAAE,KAAK,GAAG,KAAG,KAAK,CAAC,GAAG,CAA+D,CAAA;AAE1L,iHAAiH;AACjH,eAAO,MAAM,aAAa,GAAI,QAAQ,aAAa,KAAG,IAAI,GAAG,SAM5D,CAAA;AAED,0FAA0F;AAC1F,eAAO,MAAM,iBAAiB,GAAI,QAAQ,aAAa,KAAG,OAAqD,CAAA"}
|
package/dist/utils/utils.js
CHANGED
|
@@ -20,7 +20,7 @@ var scrollInParent = (element, { block = "nearest", behavior, ifNeeded = false }
|
|
|
20
20
|
const delta = block === "start" ? top : block === "center" ? top - (parent.clientHeight - height) / 2 : top < 0 ? top : top + height - parent.clientHeight;
|
|
21
21
|
parent.scrollTo({
|
|
22
22
|
top: parent.scrollTop + delta,
|
|
23
|
-
behavior
|
|
23
|
+
behavior: behavior === "smooth" ? getSmoothScrollBehavior() : behavior
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var getAllScrollParents = (node, max = 10) => {
|
|
@@ -111,6 +111,9 @@ var dateFormatterCsv = new Intl.DateTimeFormat("sv-SE", {
|
|
|
111
111
|
var numberFormatCsv = (value) => String(value).replace(".", ",");
|
|
112
112
|
var getIsClientSide = () => typeof window !== "undefined";
|
|
113
113
|
var isClientSide = getIsClientSide();
|
|
114
|
+
var getPrefersReducedMotion = () => getIsClientSide() && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
115
|
+
/** `smooth`, or `instant` when the user asks for reduced motion — a `behavior` passed to `scrollTo` is not affected by CSS `scroll-behavior`. */
|
|
116
|
+
var getSmoothScrollBehavior = () => getPrefersReducedMotion() ? "instant" : "smooth";
|
|
114
117
|
var iterator = 1;
|
|
115
118
|
var genId = () => {
|
|
116
119
|
return iterator++;
|
|
@@ -242,4 +245,4 @@ var getAnchorNode = (anchor) => {
|
|
|
242
245
|
/** Whether the anchor is still on the page. A detached anchor has nothing to stick to. */
|
|
243
246
|
var isAnchorConnected = (anchor) => getAnchorNode(anchor)?.isConnected ?? true;
|
|
244
247
|
//#endregion
|
|
245
|
-
export { BASE_ZINDEX_ACTIONS_BAR, BASE_ZINDEX_BOTTOM_SHEET, BASE_ZINDEX_DROPDOWN, BASE_ZINDEX_HEADER_BAR, BASE_ZINDEX_LIST_HEADER, BASE_ZINDEX_MODAL, BASE_ZINDEX_NAV_BAR, ListMode, Theme, WrapSelectionType, dateFormatterCsv, debounce, genId, get, getAllScrollParents, getAnchorNode, getDefaultFieldConfigMap, getHasScrollbar, getIsClientSide, getOffsetTop, getPropValue, getScrollParent, isAnchorConnected, isClientSide, isEqualArr, isEqualArrObj, isEqualObj, isId, isIdArray, isIndex, isPage, numberCompactFormatter, numberFormatCsv, numberFormatter, parseBoolean, parseId, parseIdList, parseIndex, parseInteger, parseIntegerList, parseJson, parseSliceIndexes, parseString, parseStringList, percentCompactFormatter, percentFormatter, scrollInParent, set, throttle, toKebabCase, unwrapSlots, wBaseZIndex };
|
|
248
|
+
export { BASE_ZINDEX_ACTIONS_BAR, BASE_ZINDEX_BOTTOM_SHEET, BASE_ZINDEX_DROPDOWN, BASE_ZINDEX_HEADER_BAR, BASE_ZINDEX_LIST_HEADER, BASE_ZINDEX_MODAL, BASE_ZINDEX_NAV_BAR, ListMode, Theme, WrapSelectionType, dateFormatterCsv, debounce, genId, get, getAllScrollParents, getAnchorNode, getDefaultFieldConfigMap, getHasScrollbar, getIsClientSide, getOffsetTop, getPrefersReducedMotion, getPropValue, getScrollParent, getSmoothScrollBehavior, isAnchorConnected, isClientSide, isEqualArr, isEqualArrObj, isEqualObj, isId, isIdArray, isIndex, isPage, numberCompactFormatter, numberFormatCsv, numberFormatter, parseBoolean, parseId, parseIdList, parseIndex, parseInteger, parseIntegerList, parseJson, parseSliceIndexes, parseString, parseStringList, percentCompactFormatter, percentFormatter, scrollInParent, set, throttle, toKebabCase, unwrapSlots, wBaseZIndex };
|
|
@@ -1083,6 +1083,60 @@ export const varietyModelApi = createRestModelApi({
|
|
|
1083
1083
|
})
|
|
1084
1084
|
```
|
|
1085
1085
|
|
|
1086
|
+
## In list cells
|
|
1087
|
+
|
|
1088
|
+
A select per row costs most of a list's first render: each one sets up its search, cursor, dropdown and input, and a query of its own when the options come from `useQueryFnOptions`. With `deferred`, a `seamless` select renders only its field and the selected options until it is pressed or focused — then it mounts the full select and opens it. Options from a query are not loaded before that, so give the selected ones in `previewData`, from data the row already has. The async selects load their chips on their own when `previewData` is not given, as they do when mounted.
|
|
1089
|
+
|
|
1090
|
+
```vue
|
|
1091
|
+
<template>
|
|
1092
|
+
<div class="grid max-w-md grid-cols-[1fr_10rem] items-center gap-x-4">
|
|
1093
|
+
<template
|
|
1094
|
+
v-for="plant in plants"
|
|
1095
|
+
:key="plant.id"
|
|
1096
|
+
>
|
|
1097
|
+
<div>{{ plant.name }}</div>
|
|
1098
|
+
|
|
1099
|
+
<WSelectSingle
|
|
1100
|
+
v-model="plant.soil"
|
|
1101
|
+
:options="soils"
|
|
1102
|
+
:value-getter="item => item.code"
|
|
1103
|
+
:search-fn="(item, search) => item.name.toLowerCase().includes(search.toLowerCase())"
|
|
1104
|
+
placeholder="Soil"
|
|
1105
|
+
seamless
|
|
1106
|
+
deferred
|
|
1107
|
+
no-margin
|
|
1108
|
+
>
|
|
1109
|
+
<template #option="{option, search}">
|
|
1110
|
+
<div class="w-option flex items-center">
|
|
1111
|
+
{{ option?.name ?? search }}
|
|
1112
|
+
</div>
|
|
1113
|
+
</template>
|
|
1114
|
+
</WSelectSingle>
|
|
1115
|
+
</template>
|
|
1116
|
+
</div>
|
|
1117
|
+
</template>
|
|
1118
|
+
|
|
1119
|
+
<script lang="ts" setup>
|
|
1120
|
+
import {ref} from 'vue'
|
|
1121
|
+
|
|
1122
|
+
import WSelectSingle from 'eco-vue-js/dist/components/Select/WSelectSingle.vue'
|
|
1123
|
+
|
|
1124
|
+
const soils = [
|
|
1125
|
+
{id: 1, code: 'loam', name: 'Loam'},
|
|
1126
|
+
{id: 2, code: 'sand', name: 'Sandy'},
|
|
1127
|
+
{id: 3, code: 'clay', name: 'Clay'},
|
|
1128
|
+
{id: 4, code: 'peat', name: 'Peat'},
|
|
1129
|
+
]
|
|
1130
|
+
|
|
1131
|
+
const plants = ref([
|
|
1132
|
+
{id: 1, name: 'Monstera', soil: 'peat' as string | null},
|
|
1133
|
+
{id: 2, name: 'Aloe', soil: 'sand' as string | null},
|
|
1134
|
+
{id: 3, name: 'Fern', soil: null as string | null},
|
|
1135
|
+
{id: 4, name: 'Basil', soil: 'loam' as string | null},
|
|
1136
|
+
])
|
|
1137
|
+
</script>
|
|
1138
|
+
```
|
|
1139
|
+
|
|
1086
1140
|
## Other forms
|
|
1087
1141
|
|
|
1088
1142
|
- **`WSelectStringified`** is a `WSelect` whose model is one string — the values joined by `divider`, such as `"high,critical"` for a query param, or a JSON array with `divider="json"`.
|
|
@@ -1104,6 +1158,7 @@ import WSelectSingle from 'eco-vue-js/dist/components/Select/WSelectSingle.vue'
|
|
|
1104
1158
|
| `allowClear` | `AllowClear` | — | Adds a button that clears the value, emitting `clearValue`. |
|
|
1105
1159
|
| `clearValue` | `ClearValue` | — | Value emitted when cleared. Defaults to `null`; set it explicitly to emit `undefined` or `''`. |
|
|
1106
1160
|
| `createdData` | `Data` | — | Option to add to the loaded ones — for a selected value the query does not return, such as one created elsewhere. |
|
|
1161
|
+
| `previewData` | `Data` | — | Selected option, shown in the field until the options load — and, with `deferred`, before the select mounts. |
|
|
1107
1162
|
| `useQueryFnOptions` | `UseQueryDefault<Data[], unknown> \| UseQueryDefault<Data[], QueryParamsOptions>` | — | Query that loads the options. Takes `queryParamsOptions` when the query has parameters. Use either this or `options`. |
|
|
1108
1163
|
| `queryParamsOptions` | `QueryParamsOptions` | — | Parameters for `useQueryFnOptions`. |
|
|
1109
1164
|
| `options` | `Data[]` | — | Static list of options, instead of loading them with `useQueryFnOptions`. |
|
|
@@ -1119,6 +1174,7 @@ import WSelectSingle from 'eco-vue-js/dist/components/Select/WSelectSingle.vue'
|
|
|
1119
1174
|
| `searchModel` | `boolean` | — | Commits the typed text when the menu closes — selects the option matching it exactly, or creates one with `createOption`. In a single select, the selected value is also put into the search text on focus, so it can be edited. For string values. |
|
|
1120
1175
|
| `lazy` | `boolean` | — | Waits until the menu is first opened before loading the options. |
|
|
1121
1176
|
| `placeholderEmpty` | `string` | — | Placeholder while nothing is selected and the field is not focused. Defaults to `placeholder`. |
|
|
1177
|
+
| `deferred` | `boolean` | — | Renders only the selected options until the field is first pressed or focused, then mounts the full select and opens it — for selects repeated in list cells. The options are not loaded before that, so pass `previewData` when they come from a query. With `seamless`, and not with `useQueryFnDefault` or `useFirstDefault`. |
|
|
1122
1178
|
| `optionComponent` | `OptionComponent` | — | Component that renders an option, in the menu and in the selected chips. Receives `option`, `selected`, `model` and `search`. The `option` slot replaces it. |
|
|
1123
1179
|
| `optionComponentProps` | `(OptionComponent extends Component<infer Props> ? Partial<Omit<Props, keyof SelectOptionProps<Option>>> : never)` | — | Extra props passed to every `optionComponent`. |
|
|
1124
1180
|
| `horizontalAlign` | `HorizontalAlign` | — | Horizontal placement relative to the parent. When it does not fit the viewport, the next placement in order is tried. |
|
|
@@ -1241,6 +1297,8 @@ import WSelect from 'eco-vue-js/dist/components/Select/WSelect.vue'
|
|
|
1241
1297
|
| `lazy` | `boolean` | — | Waits until the menu is first opened before loading the options. |
|
|
1242
1298
|
| `placeholderEmpty` | `string` | — | Placeholder while nothing is selected and the field is not focused. Defaults to `placeholder`. |
|
|
1243
1299
|
| `cursorSelected` | `boolean` | — | Puts the cursor on the first selected option when the menu opens, so Enter toggles it — by default the menu only scrolls to it. Always set in the single selects. |
|
|
1300
|
+
| `previewData` | `Data[]` | — | Selected options, shown in the chips until the options load — and, with `deferred`, before the select mounts. |
|
|
1301
|
+
| `deferred` | `boolean` | — | Renders only the selected options until the field is first pressed or focused, then mounts the full select and opens it — for selects repeated in list cells. The options are not loaded before that, so pass `previewData` when they come from a query. With `seamless`, and not with `useQueryFnDefault` or `useFirstDefault`. |
|
|
1244
1302
|
| `optionComponent` | `OptionComponent` | — | Component that renders an option, in the menu and in the selected chips. Receives `option`, `selected`, `model` and `search`. The `option` slot replaces it. |
|
|
1245
1303
|
| `optionComponentProps` | `(OptionComponent extends Component<infer Props> ? Partial<Omit<Props, keyof SelectOptionProps<Option>>> : never)` | — | Extra props passed to every `optionComponent`. |
|
|
1246
1304
|
| `useQueryFnOptions` | `UseQueryDefault<Data[], unknown> \| UseQueryDefault<Data[], QueryParamsOptions>` | — | Query that loads the options. Takes `queryParamsOptions` when the query has parameters. Use either this or `options`. |
|
|
@@ -1360,7 +1418,7 @@ import WSelectAsyncSingle from 'eco-vue-js/dist/components/Select/WSelectAsyncSi
|
|
|
1360
1418
|
| `optionComponentProps` | `(OptionComponent extends Component<infer Props> ? Partial<Omit<Props, keyof SelectOptionProps<Option>>> : never)` | — | Extra props passed to every `optionComponent`. |
|
|
1361
1419
|
| `useQueryFnOptions` | `UseQueryDefault<PaginatedResponse<Data>, QueryParams>` | **required** | Paginated query that loads the options, page by page as the menu scrolls. The search text is sent in `searchField`. |
|
|
1362
1420
|
| `queryParamsOptions` | `QueryParams` | **required** | Parameters for `useQueryFnOptions`. |
|
|
1363
|
-
| `valueGetter` | `(value: Data) => Model` |
|
|
1421
|
+
| `valueGetter` | `((value: Data) => Model)` | `(data as unknown as { id: Model; }).id` | Gets the value stored in the model from an option. Defaults to the option's `id`. |
|
|
1364
1422
|
| `useQueryFnDefault` | `UseQueryDefault<Data, undefined>` | — | Query that loads a default option. When it resolves while nothing is selected, the option is selected and `init-model` is emitted. |
|
|
1365
1423
|
| `emptyStub` | `string` | — | Shown in the menu instead of "Nothing to show" when there are no options and no search. |
|
|
1366
1424
|
| `hidePrefix` | `boolean` | — | Hides the selected chips while the menu is open, leaving room to type. |
|
|
@@ -1369,11 +1427,12 @@ import WSelectAsyncSingle from 'eco-vue-js/dist/components/Select/WSelectAsyncSi
|
|
|
1369
1427
|
| `searchModel` | `boolean` | — | Commits the typed text when the menu closes — selects the option matching it exactly, or creates one with `createOption`. In a single select, the selected value is also put into the search text on focus, so it can be edited. For string values. |
|
|
1370
1428
|
| `lazy` | `boolean` | — | Waits until the menu is first opened before loading the options. |
|
|
1371
1429
|
| `placeholderEmpty` | `string` | — | Placeholder while nothing is selected and the field is not focused. Defaults to `placeholder`. |
|
|
1430
|
+
| `deferred` | `boolean` | — | Renders only the selected options until the field is first pressed or focused, then mounts the full select and opens it — for selects repeated in list cells. The options are not loaded before that, so pass `previewData` when they come from a query. With `seamless`, and not with `useQueryFnDefault` or `useFirstDefault`. |
|
|
1372
1431
|
| `useQueryFnPrefix` | `UseQueryDefault<PaginatedResponse<Data>, QueryParams>` | — | Paginated query that loads the selected options for the chips. Defaults to `useQueryFnOptions`. |
|
|
1373
1432
|
| `searchField` | `keyof QueryParams` | — | Query parameter that receives the search text. Defaults to `search`. |
|
|
1374
|
-
| `valueQueryKey` | `string` |
|
|
1433
|
+
| `valueQueryKey` | `string` | `"id__in"` | Query parameter that receives the selected values, comma-separated, when loading the chips. |
|
|
1375
1434
|
| `prefixText` | `string` | — | Word after the count shown instead of chips when more than `prefixMax` values are selected. Defaults to "items". |
|
|
1376
|
-
| `prefixMax` | `number` |
|
|
1435
|
+
| `prefixMax` | `number` | `8` | Most selected values shown as chips; above it, a count with a clear-all button is shown instead. |
|
|
1377
1436
|
| `reverse` | `boolean` | — | Shows the check mark on options that are not selected instead of those that are — for a select that picks what to exclude. |
|
|
1378
1437
|
| `horizontalAlign` | `HorizontalAlign` | — | Horizontal placement relative to the parent. When it does not fit the viewport, the next placement in order is tried. |
|
|
1379
1438
|
| `dropdownClass` | `string` | — | Classes for the menu's content box. Defaults to `w-max`. |
|
|
@@ -1482,13 +1541,13 @@ import WSelectAsync from 'eco-vue-js/dist/components/Select/WSelectAsync.vue'
|
|
|
1482
1541
|
| `useQueryFnPrefix` | `UseQueryDefault<PaginatedResponse<Data>, QueryParams>` | — | Paginated query that loads the selected options for the chips. Defaults to `useQueryFnOptions`. |
|
|
1483
1542
|
| `queryParamsOptions` | `QueryParams` | **required** | Parameters for `useQueryFnOptions`. |
|
|
1484
1543
|
| `searchField` | `keyof QueryParams` | — | Query parameter that receives the search text. Defaults to `search`. |
|
|
1485
|
-
| `
|
|
1544
|
+
| `valueGetter` | `((value: Data) => Model)` | `(data as unknown as { id: Model; }).id` | Gets the value stored in the model from an option. Defaults to the option's `id`. |
|
|
1545
|
+
| `previewData` | `Data[]` | — | Selected options, used for the chips instead of loading them — also before the select mounts with `deferred`. |
|
|
1486
1546
|
| `valueQueryKey` | `string` | `"id__in"` | Query parameter that receives the selected values, comma-separated, when loading the chips. |
|
|
1487
1547
|
| `prefixText` | `string` | — | Word after the count shown instead of chips when more than `prefixMax` values are selected. Defaults to "items". |
|
|
1488
1548
|
| `prefixMax` | `number` | `8` | Most selected values shown as chips; above it, a count with a clear-all button is shown instead. |
|
|
1489
1549
|
| `reverse` | `boolean` | — | Shows the check mark on options that are not selected instead of those that are — for a select that picks what to exclude. |
|
|
1490
1550
|
| `modelValue` | `Model[] \| undefined` | **required** | Selected values. The component does not change it — update it from `select` and `unselect`. |
|
|
1491
|
-
| `valueGetter` | `(value: Data) => Model` | **required** | Gets the value stored in the model from an option. |
|
|
1492
1551
|
| `useQueryFnDefault` | `UseQueryDefault<Data, undefined>` | — | Query that loads a default option. When it resolves while nothing is selected, the option is selected and `init-model` is emitted. |
|
|
1493
1552
|
| `emptyStub` | `string` | `"No match"` | Shown in the menu instead of "Nothing to show" when there are no options and no search. |
|
|
1494
1553
|
| `disableClear` | `boolean` | — | Hides the remove button on the selected chips. |
|
|
@@ -1500,6 +1559,7 @@ import WSelectAsync from 'eco-vue-js/dist/components/Select/WSelectAsync.vue'
|
|
|
1500
1559
|
| `lazy` | `boolean` | — | Waits until the menu is first opened before loading the options. |
|
|
1501
1560
|
| `placeholderEmpty` | `string` | — | Placeholder while nothing is selected and the field is not focused. Defaults to `placeholder`. |
|
|
1502
1561
|
| `cursorSelected` | `boolean` | — | Puts the cursor on the first selected option when the menu opens, so Enter toggles it — by default the menu only scrolls to it. Always set in the single selects. |
|
|
1562
|
+
| `deferred` | `boolean` | — | Renders only the selected options until the field is first pressed or focused, then mounts the full select and opens it — for selects repeated in list cells. The options are not loaded before that, so pass `previewData` when they come from a query. With `seamless`, and not with `useQueryFnDefault` or `useFirstDefault`. |
|
|
1503
1563
|
| `optionComponent` | `OptionComponent` | — | Component that renders an option, in the menu and in the selected chips. Receives `option`, `selected`, `model` and `search`. The `option` slot replaces it. |
|
|
1504
1564
|
| `optionComponentProps` | `(OptionComponent extends Component<infer Props> ? Partial<Omit<Props, keyof SelectOptionProps<Option>>> : never)` | — | Extra props passed to every `optionComponent`. |
|
|
1505
1565
|
| `horizontalAlign` | `HorizontalAlign` | — | Horizontal placement relative to the parent. When it does not fit the viewport, the next placement in order is tried. |
|
|
@@ -1627,6 +1687,8 @@ import WSelectStringified from 'eco-vue-js/dist/components/Select/WSelectStringi
|
|
|
1627
1687
|
| `lazy` | `boolean` | — | Waits until the menu is first opened before loading the options. |
|
|
1628
1688
|
| `placeholderEmpty` | `string` | — | Placeholder while nothing is selected and the field is not focused. Defaults to `placeholder`. |
|
|
1629
1689
|
| `cursorSelected` | `boolean` | — | Puts the cursor on the first selected option when the menu opens, so Enter toggles it — by default the menu only scrolls to it. Always set in the single selects. |
|
|
1690
|
+
| `previewData` | `Data[]` | — | Selected options, shown in the chips until the options load — and, with `deferred`, before the select mounts. |
|
|
1691
|
+
| `deferred` | `boolean` | — | Renders only the selected options until the field is first pressed or focused, then mounts the full select and opens it — for selects repeated in list cells. The options are not loaded before that, so pass `previewData` when they come from a query. With `seamless`, and not with `useQueryFnDefault` or `useFirstDefault`. |
|
|
1630
1692
|
| `optionComponent` | `OptionComponent` | — | Component that renders an option, in the menu and in the selected chips. Receives `option`, `selected`, `model` and `search`. The `option` slot replaces it. |
|
|
1631
1693
|
| `optionComponentProps` | `(OptionComponent extends Component<infer Props> ? Partial<Omit<Props, keyof SelectOptionProps<Option>>> : never)` | — | Extra props passed to every `optionComponent`. |
|
|
1632
1694
|
| `horizontalAlign` | `HorizontalAlign` | — | Horizontal placement relative to the parent. When it does not fit the viewport, the next placement in order is tried. |
|
package/docs/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# eco-vue-js
|
|
2
2
|
|
|
3
|
-
> Vue 3 UI kit with Tailwind v4 — components, utilities, icons and recipes. These are the docs of version 0.26.
|
|
3
|
+
> Vue 3 UI kit with Tailwind v4 — components, utilities, icons and recipes. These are the docs of version 0.26.21, the one installed next to them. Start with Getting started and Conventions; each component page lists its props, events and slots with examples.
|
|
4
4
|
|
|
5
5
|
Release notes, for what changed between versions: https://github.com/rsmple/eco-vue-js/releases. The docs site, with live demos: https://rsmple.github.io/eco-vue-js/
|
|
6
6
|
|
package/package.json
CHANGED
package/tailwind-base/base.css
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
--animate-move-horizontal: move-horizontal var(--tiker-duration, 0.8s) linear infinite;
|
|
5
5
|
--animate-shake: shake .6s linear infinite;
|
|
6
6
|
--animate-border-rotate: border-rotate linear infinite 10s;
|
|
7
|
+
--animate-border-march: border-march 0.5s linear infinite;
|
|
7
8
|
--animate-dojo-logo-dashoffset: dojo-logo-dashoffset 1.6s linear 1;
|
|
8
9
|
--animate-spinner-dash: spinner-dash 1.6s linear infinite;
|
|
9
10
|
--animate-ping-fast: ping-big .5s cubic-bezier(0, 0, 0.2, 1);
|
|
@@ -63,6 +64,15 @@
|
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
@keyframes border-march {
|
|
68
|
+
from {
|
|
69
|
+
stroke-dashoffset: 0px;
|
|
70
|
+
}
|
|
71
|
+
to {
|
|
72
|
+
stroke-dashoffset: -12px;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
66
76
|
@keyframes dojo-logo-dashoffset {
|
|
67
77
|
from {
|
|
68
78
|
stroke-dashoffset: 0;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Turns off animations, transitions and smooth scrolling when the user asks the OS for reduced motion. Transitions still run for a moment so `transitionend` and Vue's `after-enter`/`after-leave` fire. */
|
|
2
|
+
@layer base {
|
|
3
|
+
@media (prefers-reduced-motion: reduce) {
|
|
4
|
+
*,
|
|
5
|
+
*::before,
|
|
6
|
+
*::after {
|
|
7
|
+
animation-delay: 0s !important;
|
|
8
|
+
animation-duration: 0.01ms !important;
|
|
9
|
+
animation-iteration-count: 1 !important;
|
|
10
|
+
transition-delay: 0s !important;
|
|
11
|
+
transition-duration: 0.01ms !important;
|
|
12
|
+
scroll-behavior: auto !important;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|