@wirecore/wirelayer-vue 0.14.0 → 0.15.1

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 (47) hide show
  1. package/dist/Field-xVx6PoU7.js +109 -0
  2. package/dist/{Input-CH-ntEjv.js → Input-DqFiLzOR.js} +1 -1
  3. package/dist/InputStatus-BdHg-ibH.js +123 -0
  4. package/dist/{RecipesProvider-DzlYvZ-I.js → RecipesProvider-z4RUE-Pk.js} +402 -359
  5. package/dist/{Tree-C8vsEA6K.js → Tree-BD13Var1.js} +9 -9
  6. package/dist/components/Confirm/confirm.d.ts +10 -2
  7. package/dist/components/Confirm/confirm.d.ts.map +1 -1
  8. package/dist/components/Countdown/Countdown.vue.d.ts +2 -0
  9. package/dist/components/Countdown/Countdown.vue.d.ts.map +1 -1
  10. package/dist/components/DatePicker/DatePickerBase.vue.d.ts.map +1 -1
  11. package/dist/components/DatePicker/DatePickerTimes.vue.d.ts.map +1 -1
  12. package/dist/components/DatePicker/announcements.d.ts +3 -0
  13. package/dist/components/DatePicker/announcements.d.ts.map +1 -0
  14. package/dist/components/Dialog/Dialog.vue.d.ts +4 -1
  15. package/dist/components/Dialog/Dialog.vue.d.ts.map +1 -1
  16. package/dist/components/DialogService/dialogs.d.ts +4 -1
  17. package/dist/components/DialogService/dialogs.d.ts.map +1 -1
  18. package/dist/components/Drawer/Drawer.vue.d.ts +4 -1
  19. package/dist/components/Drawer/Drawer.vue.d.ts.map +1 -1
  20. package/dist/components/LocaleProvider/LocaleProvider.vue.d.ts +1 -0
  21. package/dist/components/LocaleProvider/LocaleProvider.vue.d.ts.map +1 -1
  22. package/dist/components/Sortable/Sortable.vue.d.ts.map +1 -1
  23. package/dist/components/TagsInput/TagsInput.vue.d.ts +4 -0
  24. package/dist/components/TagsInput/TagsInput.vue.d.ts.map +1 -1
  25. package/dist/components/TimePicker/TimePicker.vue.d.ts.map +1 -1
  26. package/dist/components/TimeRangePicker/TimeRangePicker.vue.d.ts.map +1 -1
  27. package/dist/data-table/DataTable.vue.d.ts +10 -1
  28. package/dist/data-table/DataTable.vue.d.ts.map +1 -1
  29. package/dist/data-table/ValueInput.vue.d.ts +6 -4
  30. package/dist/data-table/ValueInput.vue.d.ts.map +1 -1
  31. package/dist/data-table/index.d.ts +1 -1
  32. package/dist/data-table/index.d.ts.map +1 -1
  33. package/dist/data-table/types.d.ts +43 -2
  34. package/dist/data-table/types.d.ts.map +1 -1
  35. package/dist/data-table.js +1859 -1785
  36. package/dist/form.js +2 -2
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +2896 -2850
  40. package/dist/pdf.js +2 -2
  41. package/dist/sources/DataTable.css +1 -0
  42. package/dist/sources/Dialog.css +1 -1
  43. package/dist/sources/Drawer.css +1 -1
  44. package/llms-full.txt +27 -10
  45. package/package.json +2 -2
  46. package/dist/Field-DuZfFNFT.js +0 -155
  47. package/dist/InputStatus-Cgarj-yu.js +0 -71
package/dist/pdf.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { a as e, n as t, o as n } from "./recipes-CD2Ibsv9.js";
2
2
  import { t as r } from "./Button-WA6BonwF.js";
3
- import { t as i } from "./Field-DuZfFNFT.js";
3
+ import { t as i } from "./Field-xVx6PoU7.js";
4
4
  import { i as a, t as o } from "./Select-B5c6Y3mf.js";
5
- import { c as s, i as c, l, n as u, o as d, r as ee, s as te, t as ne } from "./Tree-C8vsEA6K.js";
5
+ import { c as s, i as c, l, n as u, o as d, r as ee, s as te, t as ne } from "./Tree-BD13Var1.js";
6
6
  import { Fragment as f, computed as p, createBlock as re, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createTextVNode as _, createVNode as v, defineComponent as y, mergeProps as ie, nextTick as ae, normalizeClass as b, normalizeStyle as oe, onBeforeUnmount as se, onMounted as ce, openBlock as x, reactive as le, ref as S, renderList as ue, resolveDynamicComponent as de, toDisplayString as C, unref as w, useAttrs as fe, useId as pe, useTemplateRef as T, vModelText as me, watch as E, withCtx as D, withDirectives as he, withModifiers as ge } from "vue";
7
7
  import { CaseSensitive as _e, ChevronDown as ve, ChevronUp as ye, Download as be, FileWarning as xe, Maximize as Se, Minimize as Ce, PanelLeft as we, Printer as Te, RotateCw as Ee, Search as De, X as Oe, ZoomIn as ke, ZoomOut as Ae } from "@lucide/vue";
8
8
  import { PDF_ZOOM_MAX as je, PDF_ZOOM_MIN as Me, clampPdfPage as Ne, clampPdfZoom as Pe, downloadBytes as Fe, input as Ie, normalizePdfRotation as O, parsePdfPage as Le, pdfFileName as Re, pdfKeyAction as ze, pdfPrintDocument as k, pdfSearchText as Be, pdfThumbnailSize as Ve, pdfTools as A, pdfViewer as He, pdfZoomFromKey as Ue, pdfZoomKey as We, pdfZoomStep as Ge, pdfZoomSteps as j, pdfZoomSteps as Ke, resolvePdfTools as qe, setupToolbar as Je } from "@wirecore/wirelayer-recipes";
@@ -14,3 +14,4 @@
14
14
  @import '@wirecore/wirelayer-recipes/sources/spinner.css';
15
15
  @import '@wirecore/wirelayer-recipes/sources/textarea.css';
16
16
  @import '@wirecore/wirelayer-recipes/sources/textareaParts.css';
17
+ @import '@wirecore/wirelayer-recipes/sources/toggletip.css';
@@ -1,2 +1,2 @@
1
1
  /* Classes of Dialog – generated by scripts/sources.ts, do not edit */
2
- /* Dialog renders no classes of its own */
2
+ @import '@wirecore/wirelayer-recipes/sources/dialog.css';
@@ -1,2 +1,2 @@
1
1
  /* Classes of Drawer – generated by scripts/sources.ts, do not edit */
2
- /* Drawer renders no classes of its own */
2
+ @import '@wirecore/wirelayer-recipes/sources/drawer.css';
package/llms-full.txt CHANGED
@@ -1616,6 +1616,7 @@ role="timer": screen readers read the current value on demand, without announcin
1616
1616
  | units? | `readonly CountdownUnit[]` | Shown units, largest first – the largest takes everything above it (e.g. 49 hours without days) |
1617
1617
  | variant? | `'boxed' \| 'plain'` | |
1618
1618
  | size? | `'sm' \| 'md' \| 'lg'` | |
1619
+ | format? | `'units' \| 'clock'` | `units` (default): each value above its unit; `clock`: "05:12:33", the units for screen readers only |
1619
1620
  | classes? | `RecipeClasses<typeof countdownRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
1620
1621
 
1621
1622
  | Event | Payload | Description |
@@ -1696,11 +1697,12 @@ Data table on TanStack Table: sorting (also by several columns), search, filter
1696
1697
  | v-model:page? | `number` | Current page (1-based) – use with v-model:page |
1697
1698
  | v-model:first? | `number` | Index of the first row of the current page (0-based) – instead of `page`, use with v-model:first |
1698
1699
  | paginator-position? | `'top' \| 'bottom'` | Pagination below (default) or above the table |
1700
+ | footer-position? | `'top' \| 'bottom'` | The totals row (`aggregate`, `footer`) below the rows (default) or right below the headers, sticky with them |
1699
1701
  | paginator-edges? | `boolean` | Buttons to the first and the last page in the pagination |
1700
1702
  | paginator-align? | `DataTablePaginatorAlign` | Pagination row: rows per page at the start, pages at the end (`between`, default) – or both together |
1701
1703
  | v-model:sorting? | `DataTableSort \| DataTableSort[] \| null` | Current sorting – use with v-model:sorting; an array in the multiple mode |
1702
1704
  | default-sorting? | `DataTableSort \| DataTableSort[] \| null` | Sorting at the start, without v-model |
1703
- | sort-mode? | `'single' \| 'multiple'` | `multiple`: Shift+click (or the column menu) sorts by further columns |
1705
+ | sort-mode? | `'single' \| 'multiple'` | `multiple`: Shift+click (or the column menu) sorts by further columns. Default `single`; app-wide `dataTable: { defaultVariants: { multiSort: true } }` – the sorting is then an array as well |
1704
1706
  | manual? | `boolean` | Server mode: `data` is the current page, already sorted and filtered; requires `rowCount` |
1705
1707
  | row-count? | `number` | |
1706
1708
  | selectable? | `boolean` | Selection column – selected row ids via v-model:selection |
@@ -1728,6 +1730,8 @@ Data table on TanStack Table: sorting (also by several columns), search, filter
1728
1730
  | v-model:advanced-filter-value? | `ConditionGroup` | The condition tree of the advanced filter (controlled together with onAdvancedFilterValueChange) |
1729
1731
  | sortable? | `boolean` | Every column with a value can be sorted, unless the column sets `sortable: false`; columns without a value (only a slot, e.g. actions) stay out. App-wide: `dataTable: { defaultVariants: { sortable: true } }` |
1730
1732
  | search? | `boolean` | Search field above the table: filters over all columns (v-model:global-filter) |
1733
+ | search-placeholder? | `string` | Text of the empty search field and its name for screen readers (default "Search …" and "Search <caption>") |
1734
+ | search-input-attrs? | `Record<string, unknown>` | More attributes of the search input, e.g. `{ 'data-tour': 'search' }` as the target of a Tour step |
1731
1735
  | search-align? | `'start' \| 'center'` | Place of the search field: `start` (default) after the controls of the toolbar start, `center` in the middle of the toolbar – also when there are no controls at the start; own `toolbar` controls then join the end group. App-wide: `dataTable: { defaultVariants: { searchCentered: true } }` |
1732
1736
  | v-model:global-filter? | `string` | |
1733
1737
  | row-keywords? | `(row: T) => string \| readonly string[] \| null \| undefined` | More text the search finds a row by, besides its columns – e.g. fields without a column of their own (not in server mode: there the server searches) |
@@ -2018,7 +2022,7 @@ Ark handles focus trap, aria-modal, Escape, scroll lock and returning focus to t
2018
2022
  | role? | `'dialog' \| 'alertdialog'` | "alertdialog" for confirmations that interrupt the user |
2019
2023
  | modal? | `boolean` | `false`: non-modal – no backdrop, no focus trap, no scroll lock; the page stays usable next to the dialog (role="dialog" with aria-modal="false") |
2020
2024
  | close-on-escape? | `boolean` | Escape closes the dialog |
2021
- | close-on-interact-outside? | `boolean` | A click outside closes the dialog – by default for modal dialogs, not for alertdialogs and non-modal ones |
2025
+ | close-on-interact-outside? | `boolean` | A click outside closes the dialog – by default for modal dialogs, not for alertdialogs and non-modal ones. App-wide default: `closeOnInteractOutside` in the `defaultVariants` of the `dialog` recipe; the prop wins |
2022
2026
 
2023
2027
  | Event | Payload | Description |
2024
2028
  | --- | --- | --- |
@@ -2164,7 +2168,7 @@ Modal panel at the edge of the screen – a dialog: focus trap, Escape, scroll l
2164
2168
  | default-open? | `boolean` | |
2165
2169
  | modal? | `boolean` | `false`: non-modal – no backdrop, no focus trap, the page stays usable next to the panel |
2166
2170
  | close-on-escape? | `boolean` | Escape closes the drawer |
2167
- | close-on-interact-outside? | `boolean` | A click outside closes the drawer – by default for modal drawers |
2171
+ | close-on-interact-outside? | `boolean` | A click outside closes the drawer – by default for modal drawers. App-wide default: `closeOnInteractOutside` in the `defaultVariants` of the `drawer` recipe; the prop wins |
2168
2172
 
2169
2173
  | Event | Payload | Description |
2170
2174
  | --- | --- | --- |
@@ -5716,6 +5720,8 @@ Free entries: Enter or "," adds, Backspace on the empty field selects the last e
5716
5720
  | invalid? | `boolean` | |
5717
5721
  | name? | `string` | |
5718
5722
  | suggestions? | `readonly string[]` | Suggestions while typing (entries already added are left out); arrow keys pick one, Enter adds it |
5723
+ | open-on-focus? | `boolean` | Opens the suggestions when the field gets the focus or is clicked – the existing tags without typing |
5724
+ | trigger? | `boolean` | A button at the end of the field opens all suggestions (not a tab stop: Arrow down does the same) |
5719
5725
  | filter? | `boolean` | Filters the suggestions by the typed text, ignoring case and accents (default true) |
5720
5726
  | manual-filter? | `boolean` | The suggestions are filtered elsewhere (server): no local filtering, listen to filterChange |
5721
5727
  | loading? | `boolean` | Shows "Loading" in the suggestions (aria-busy) |
@@ -6470,6 +6476,7 @@ Year field ("2026"): type the digits, or pick from the year grid; range: start
6470
6476
  - `bindCheckbox` (`@wirecore/wirelayer-vue/form`): v-bind for Checkbox and Switch
6471
6477
  - `bindInput` (`@wirecore/wirelayer-vue/form`): v-bind for the components with a string v-model: Input, Textarea, PasswordInput, SearchField, MaskInput, PhoneInput, ColorInput, JsonInput, PinInput, Mentions and Autocomplete – `<Input v-bind="bindInput(field)" />`
6472
6478
  - `bindValue` (`@wirecore/wirelayer-vue/form`): v-bind for Select, RadioGroup, ChipGroup and SegmentedControl
6479
+ - `choose` (`@wirecore/wirelayer-vue`): Like confirm(), but tells the buttons from closing: resolves with `'confirm'`, `'cancel'` (the cancel button) or `'dismiss'` (Escape, the close button, a newer request). For dialogs whose second button is an action of its own ("No, assign by hand", "Discard"), where closing should do nothing.
6473
6480
  - `closeAllDialogs` (`@wirecore/wirelayer-vue`): Closes all dialogs of the <DialogHost />; their promises resolve with undefined
6474
6481
  - `codeLanguages` (`@wirecore/wirelayer-vue/code`): –
6475
6482
  - `combineValidators` (`@wirecore/wirelayer-vue/form`): –
@@ -6832,13 +6839,15 @@ const recipes: RecipeConfig = {
6832
6839
  Some defaults change more than classes – where the title of a dialog sits, for example. They are variants of the recipe
6833
6840
  as well, so the same `defaultVariants` set them once for the whole app; a prop on the single component still wins:
6834
6841
 
6835
- | Recipe default | Instead of on every component |
6836
- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
6837
- | `dialog: { defaultVariants: { titleInHeader: true } }` | `DialogContent title-position="header"`, also `confirm()`, `prompt()` and `openDialog()` (option `titlePosition`) |
6838
- | `dataTable: { defaultVariants: { showFilters: false } }` | `DataTable :show-filters="false"` – filters closed at the start (a saved `stateKey` state still wins) |
6839
- | `dataTable: { defaultVariants: { searchCentered: true } }` | `DataTable search-align="center"` – the search between the actions at the start and the tools at the end |
6840
- | `dataTable: { defaultVariants: { sortable: true } }` | `DataTable sortable` – every column with a value sorts (not `sortable: false`, not a slot-only column) |
6841
- | `dataTable: { defaultVariants: { striped: true } }` | `DataTable striped` – the same for `gridlines`, `bordered`, `wrapHeaders`, `verticalHeaders` |
6842
+ | Recipe default | Instead of on every component |
6843
+ | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
6844
+ | `dialog: { defaultVariants: { titleInHeader: true } }` | `DialogContent title-position="header"`, also `confirm()`, `prompt()` and `openDialog()` (option `titlePosition`) |
6845
+ | `dialog: { defaultVariants: { closeOnInteractOutside: false } }` | `Dialog :close-on-interact-outside="false"`, also `openDialog()` (option `closeOnInteractOutside`); `drawer` the same for `Drawer` |
6846
+ | `dataTable: { defaultVariants: { showFilters: false } }` | `DataTable :show-filters="false"` – filters closed at the start (a saved `stateKey` state still wins) |
6847
+ | `dataTable: { defaultVariants: { searchCentered: true } }` | `DataTable search-align="center"` – the search between the actions at the start and the tools at the end |
6848
+ | `dataTable: { defaultVariants: { sortable: true } }` | `DataTable sortable` – every column with a value sorts (not `sortable: false`, not a slot-only column) |
6849
+ | `dataTable: { defaultVariants: { multiSort: true } }` | `DataTable sort-mode="multiple"` – Shift+click sorts by further columns; `sorting` is then an array on every table |
6850
+ | `dataTable: { defaultVariants: { striped: true } }` | `DataTable striped` – the same for `gridlines`, `bordered`, `wrapHeaders`, `verticalHeaders` |
6842
6851
 
6843
6852
  Own buttons, fields and menus in the toolbar slots of a DataTable (`#toolbar`, `#toolbarStart`, `#toolbarEnd`) default
6844
6853
  to the size of the built-in toolbar controls (`sm`); a `size` on them still wins. A text filter shows the placeholder
@@ -7307,6 +7316,14 @@ as `pdfjs-dist` (Apache-2.0), Chart.js, Tiptap and Shiki are installed by the ap
7307
7316
  switches between the text and the editor. In React Native the view props (`testID`, `nativeID`, accessibility props)
7308
7317
  go to the outermost view; pickers that open a sheet (`Select`, `CascadeSelect`, `TreeSelect`, `ColorPicker`,
7309
7318
  `NavigationMenu`, `NotificationCenter`) take none – they render a trigger and a sheet, no outer view.
7319
+ - **A click outside closes modal dialogs and drawers.** PrimeVue's `dismissableMask` is off by default, WireLayer's
7320
+ `closeOnInteractOutside` is on for modal ones – unsaved input in a form dialog is lost on a stray click. Turn it off
7321
+ once for the whole app: `{ dialog: { defaultVariants: { closeOnInteractOutside: false } }, drawer: { … } }` in the
7322
+ `RecipesProvider`/`ConfigProvider` (also for `openDialog()`); `:close-on-interact-outside` on a single dialog still
7323
+ wins. `confirm()` and `prompt()` are alertdialogs and never close on a click outside.
7324
+ - **Escape is not "no".** `confirm()` resolves with `false` for the cancel button, Escape, the close button and a
7325
+ newer request alike – PrimeVue's `reject` and `onHide` tell them apart. When the second button is an action of its own
7326
+ ("No, assign by hand", "Discard"), use `choose()`: it resolves with `'confirm'`, `'cancel'` or `'dismiss'`.
7310
7327
  - **Brand colours:** `checkTheme` lists the pairs below WCAG AA, `suggestThemeFixes` the nearest colours (and `on-*`
7311
7328
  colours) that meet them – an orange `primary` with white text, common in PrimeVue themes, does not.
7312
7329
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecore/wirelayer-vue",
3
- "version": "0.14.0",
3
+ "version": "0.15.1",
4
4
  "description": "WireLayer components for Vue 3",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -166,7 +166,7 @@
166
166
  "@ark-ui/vue": "^5.39.3",
167
167
  "@internationalized/date": "^3.12.4",
168
168
  "@lucide/vue": "^1.59.0",
169
- "@wirecore/wirelayer-recipes": "^0.13.0",
169
+ "@wirecore/wirelayer-recipes": "^0.14.1",
170
170
  "@wirecore/wirelayer-tokens": "^0.9.0"
171
171
  },
172
172
  "devDependencies": {
@@ -1,155 +0,0 @@
1
- import { n as e, o as t } from "./recipes-CD2Ibsv9.js";
2
- import { r as n } from "./InputStatus-Cgarj-yu.js";
3
- import { computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, mergeProps as d, normalizeClass as f, onBeforeUnmount as p, openBlock as m, provide as h, ref as g, renderSlot as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, useAttrs as x, useSlots as S, useTemplateRef as C, watch as w, withCtx as T } from "vue";
4
- import { CircleCheck as E, Info as D } from "@lucide/vue";
5
- import { field as O, toggletip as k } from "@wirecore/wirelayer-recipes";
6
- import { Field as A } from "@ark-ui/vue/field";
7
- //#region src/components/Toggletip/Toggletip.vue?vue&type=script&setup=true&lang.ts
8
- var j = ["aria-label", "aria-expanded"], M = { role: "status" }, N = /* @__PURE__ */ u({
9
- inheritAttrs: !1,
10
- __name: "Toggletip",
11
- props: {
12
- content: {},
13
- label: {},
14
- triggerLabel: {},
15
- open: {
16
- type: Boolean,
17
- default: void 0
18
- },
19
- icon: {},
20
- classes: {}
21
- },
22
- emits: ["update:open"],
23
- setup(n, { emit: l }) {
24
- let u = n, h = e("toggletip", k, () => u.classes), S = l, T = x(), E = t(), O = h(), A = g(!1), N = r(() => u.open ?? A.value), P = C("root"), F = r(() => u.triggerLabel ?? (u.label ? E.toggletip.labelFor(u.label) : E.toggletip.label));
25
- function I(e) {
26
- A.value = e, S("update:open", e);
27
- }
28
- let L = (e) => {
29
- e.key === "Escape" && (e.stopPropagation(), I(!1));
30
- }, R = (e) => {
31
- P.value?.contains(e.target) || I(!1);
32
- }, z = (e) => {
33
- typeof document < "u" && (e ? (document.addEventListener("keydown", L), document.addEventListener("pointerdown", R)) : (document.removeEventListener("keydown", L), document.removeEventListener("pointerdown", R)));
34
- };
35
- return w(N, z), p(() => z(!1)), (e, t) => (m(), o("span", d({
36
- ref_key: "root",
37
- ref: P
38
- }, {
39
- ...b(T),
40
- class: b(O).base({ class: f(b(T).class) })
41
- }), [s("button", {
42
- type: "button",
43
- class: f(b(O).trigger()),
44
- "aria-label": F.value,
45
- "aria-expanded": N.value,
46
- onClick: t[0] ||= (e) => I(!N.value)
47
- }, [(m(), i(v(n.icon ?? b(D)), {
48
- class: f(b(O).icon()),
49
- "aria-hidden": "true"
50
- }, null, 8, ["class"]))], 10, j), s("span", M, [N.value ? (m(), o("span", {
51
- key: 0,
52
- class: f(b(O).bubble())
53
- }, [_(e.$slots, "default", {}, () => [c(y(n.content), 1)])], 2)) : a("", !0)])], 16));
54
- }
55
- }), P = /* @__PURE__ */ u({
56
- inheritAttrs: !1,
57
- __name: "Field",
58
- props: {
59
- label: {},
60
- helperText: {},
61
- error: {},
62
- invalid: { type: Boolean },
63
- success: {},
64
- required: { type: Boolean },
65
- optional: { type: Boolean },
66
- optionalText: {},
67
- disabled: { type: Boolean },
68
- readOnly: { type: Boolean },
69
- labelHelp: {},
70
- classes: {}
71
- },
72
- setup(s) {
73
- let u = s, p = S(), g = e("field", O, () => u.classes), v = t(), C = x(), w = g(), D = () => !!u.label || !!p.label, k = () => !!u.error || !!p.error, j = r(() => u.invalid || k()), M = r(() => (!!u.success || !!p.success) && !j.value);
74
- return h(n, r(() => ({
75
- success: M.value,
76
- labelled: D()
77
- }))), (e, t) => (m(), i(b(A).Root, d({
78
- ...b(C),
79
- class: b(w).base({ class: f(b(C).class) })
80
- }, {
81
- invalid: j.value,
82
- required: s.required,
83
- disabled: s.disabled,
84
- "read-only": s.readOnly
85
- }), {
86
- default: T(() => [
87
- D() && (s.labelHelp || p["label-help"]) ? (m(), o("div", {
88
- key: 0,
89
- class: f(b(w).labelRow())
90
- }, [l(b(A).Label, { class: f(b(w).label()) }, {
91
- default: T(() => [
92
- _(e.$slots, "label", {}, () => [c(y(s.label), 1)]),
93
- s.required ? (m(), i(b(A).RequiredIndicator, {
94
- key: 0,
95
- class: f(b(w).requiredIndicator())
96
- }, null, 8, ["class"])) : a("", !0),
97
- s.optional && !s.required ? (m(), o("span", {
98
- key: 1,
99
- class: f(b(w).optionalIndicator())
100
- }, y(` (${s.optionalText ?? b(v).field.optional})`), 3)) : a("", !0)
101
- ]),
102
- _: 3
103
- }, 8, ["class"]), l(N, { label: s.label }, {
104
- default: T(() => [_(e.$slots, "label-help", {}, () => [c(y(s.labelHelp), 1)])]),
105
- _: 3
106
- }, 8, ["label"])], 2)) : D() ? (m(), i(b(A).Label, {
107
- key: 1,
108
- class: f(b(w).label())
109
- }, {
110
- default: T(() => [
111
- _(e.$slots, "label", {}, () => [c(y(s.label), 1)]),
112
- s.required ? (m(), i(b(A).RequiredIndicator, {
113
- key: 0,
114
- class: f(b(w).requiredIndicator())
115
- }, null, 8, ["class"])) : a("", !0),
116
- s.optional && !s.required ? (m(), o("span", {
117
- key: 1,
118
- class: f(b(w).optionalIndicator())
119
- }, y(` (${s.optionalText ?? b(v).field.optional})`), 3)) : a("", !0)
120
- ]),
121
- _: 3
122
- }, 8, ["class"])) : a("", !0),
123
- _(e.$slots, "default"),
124
- s.helperText || p["helper-text"] || M.value ? (m(), i(b(A).HelperText, {
125
- key: 2,
126
- class: f(b(w).helperText())
127
- }, {
128
- default: T(() => [_(e.$slots, "helper-text", {}, () => [c(y(s.helperText), 1)]), M.value ? (m(), o("span", {
129
- key: 0,
130
- class: f(b(w).successText())
131
- }, [l(b(E), {
132
- class: f(b(w).successIcon()),
133
- "aria-hidden": "true"
134
- }, null, 8, ["class"]), _(e.$slots, "success", {}, () => [c(y(s.success), 1)])], 2)) : a("", !0)]),
135
- _: 3
136
- }, 8, ["class"])) : a("", !0),
137
- k() ? (m(), i(b(A).ErrorText, {
138
- key: 3,
139
- class: f(b(w).errorText())
140
- }, {
141
- default: T(() => [_(e.$slots, "error", {}, () => [c(y(s.error), 1)])]),
142
- _: 3
143
- }, 8, ["class"])) : a("", !0)
144
- ]),
145
- _: 3
146
- }, 16, [
147
- "invalid",
148
- "required",
149
- "disabled",
150
- "read-only"
151
- ]));
152
- }
153
- });
154
- //#endregion
155
- export { N as n, P as t };
@@ -1,71 +0,0 @@
1
- import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createVNode as a, defineComponent as o, inject as s, normalizeClass as c, openBlock as l, unref as u } from "vue";
2
- import { CircleAlert as d, CircleCheck as f, LoaderCircle as p, X as m } from "@lucide/vue";
3
- //#region src/components/Field/context.ts
4
- var h = Symbol("FieldStatus");
5
- function g() {
6
- let e = s(h, null);
7
- return t(() => e?.value ?? {
8
- success: !1,
9
- labelled: !1
10
- });
11
- }
12
- //#endregion
13
- //#region src/utils/text-field.ts
14
- function _(e) {
15
- return {
16
- get element() {
17
- return e() ?? null;
18
- },
19
- focus: (t) => e()?.focus(t),
20
- blur: () => e()?.blur(),
21
- select: () => e()?.select(),
22
- setSelectionRange: (t, n, r) => e()?.setSelectionRange(t, n, r)
23
- };
24
- }
25
- //#endregion
26
- //#region src/components/Input/InputStatus.vue?vue&type=script&setup=true&lang.ts
27
- var v = ["aria-label"], y = /* @__PURE__ */ o({
28
- __name: "InputStatus",
29
- props: {
30
- loading: { type: Boolean },
31
- clear: { type: Boolean },
32
- clearLabel: {},
33
- invalid: { type: Boolean },
34
- success: { type: Boolean },
35
- invalidIcon: { type: Boolean },
36
- classes: {}
37
- },
38
- emits: ["clear"],
39
- setup(t, { emit: o }) {
40
- let s = o;
41
- return (o, h) => (l(), i(e, null, [
42
- t.loading ? (l(), n(u(p), {
43
- key: 0,
44
- class: c(t.classes.spinner),
45
- "aria-hidden": "true"
46
- }, null, 8, ["class"])) : r("", !0),
47
- t.clear ? (l(), i("button", {
48
- key: 1,
49
- type: "button",
50
- tabindex: "-1",
51
- class: c(t.classes.clear),
52
- "aria-label": t.clearLabel,
53
- onClick: h[0] ||= (e) => s("clear")
54
- }, [a(u(m), {
55
- class: c(t.classes.clearIcon),
56
- "aria-hidden": "true"
57
- }, null, 8, ["class"])], 10, v)) : r("", !0),
58
- t.invalid && t.invalidIcon ? (l(), n(u(d), {
59
- key: 2,
60
- class: c(t.classes.statusIcon),
61
- "aria-hidden": "true"
62
- }, null, 8, ["class"])) : t.success && !t.invalid ? (l(), n(u(f), {
63
- key: 3,
64
- class: c(t.classes.statusIcon),
65
- "aria-hidden": "true"
66
- }, null, 8, ["class"])) : r("", !0)
67
- ], 64));
68
- }
69
- });
70
- //#endregion
71
- export { g as i, _ as n, h as r, y as t };