@nexdom/uimed-vue 2.0.0-beta.26 → 2.0.0-beta.28
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/AGENTS.md
CHANGED
|
@@ -216,7 +216,7 @@ Use an existing composable (e.g. `use-toast`) as the reference, and deliver in t
|
|
|
216
216
|
- Keep temporary files (scripts, specs, configs) outside the repo, e.g. in the system's temp folder. Vitest collects test files from every folder except the excluded ones in `vite.config.ts`, so a temporary spec in a gitignored folder such as `reports/` still runs, and fails, with the unit tests.
|
|
217
217
|
- Never run Stryker at the same time as another test command: they share build output and Stryker fails with `ENOENT`.
|
|
218
218
|
- Unit tests that mount several apps at once (e.g. nested dialogs) need a distinct `global.config.idPrefix` per mount, since `useId()` restarts in each app.
|
|
219
|
-
- In E2E, a paused `page.clock` also freezes transitions, so overlays never finish leaving. Use `page.
|
|
219
|
+
- In E2E, a paused `page.clock` also freezes transitions, so overlays never finish leaving. Use `pauseClock(page)` from `e2e/utils.ts` to hold time-based work (e.g. a demo action with `setTimeout`), `page.clock.fastForward` to complete it, then `page.clock.resume()` before expecting the overlay to be hidden (see `e2e/composables/use-confirm.spec.ts`). Don't call `page.clock.pauseAt` with the test runner's time (`new Date()`, `Date.now()`): the page clock can be ahead of it, and the pause then fails with "Cannot fast-forward to the past". `pauseClock` pauses from the page's own time instead.
|
|
220
220
|
|
|
221
221
|
## Public API design
|
|
222
222
|
|
package/dist/components.d.ts
CHANGED
package/dist/components.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as messages, n as owners$1, r as requests, s as useVuetifyColor } from "./use-dialog-Ck2_ZW7T.js";
|
|
2
2
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, inject, isRef, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, onScopeDispose, onUnmounted, openBlock, provide, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toValue, unref, useId, useModel, useSlots, useTemplateRef, watch, withCtx, withKeys, withModifiers } from "vue";
|
|
3
3
|
import { pt } from "vuetify/locale";
|
|
4
|
-
import { VApp, VAppBar, VAppBarNavIcon, VAppBarTitle, VAutocomplete, VAvatar, VBadge, VBtn, VCard, VCardActions, VCardText, VCheckboxBtn, VCol, VCombobox, VContainer, VDataIterator, VDatePicker, VDialog, VDivider, VEmptyState, VExpansionPanel, VExpansionPanelText, VExpansionPanelTitle, VExpansionPanels, VForm, VIcon, VIconBtn, VImg, VList, VListGroup, VListItem, VListItemAction, VListSubheader, VLocaleProvider, VMain, VMenu, VNavigationDrawer, VPagination, VProgressLinear, VRow, VSkeletonLoader, VSnackbarQueue, VTable, VTextField, VTimePicker } from "vuetify/components";
|
|
4
|
+
import { VApp, VAppBar, VAppBarNavIcon, VAppBarTitle, VAutocomplete, VAvatar, VBadge, VBtn, VCard, VCardActions, VCardText, VCheckboxBtn, VCol, VCombobox, VContainer, VDataIterator, VDatePicker, VDialog, VDivider, VEmptyState, VExpansionPanel, VExpansionPanelText, VExpansionPanelTitle, VExpansionPanels, VForm, VIcon, VIconBtn, VImg, VList, VListGroup, VListItem, VListItemAction, VListSubheader, VLocaleProvider, VMain, VMenu, VNavigationDrawer, VPagination, VProgressCircular, VProgressLinear, VRow, VSkeletonLoader, VSnackbarQueue, VTable, VTextField, VTimePicker } from "vuetify/components";
|
|
5
5
|
import { formatDateTime, isEmail, isEmpty, isPhone, isUrl } from "@nexdom/shared/utils";
|
|
6
6
|
//#region src/composables/navigation/use-route-props.ts
|
|
7
7
|
function useRouteProps(route) {
|
|
@@ -803,6 +803,11 @@ var button_default = /* @__PURE__ */ defineComponent({
|
|
|
803
803
|
form: unref(form),
|
|
804
804
|
onClick
|
|
805
805
|
}, {
|
|
806
|
+
loader: withCtx(() => [createVNode(unref(VProgressCircular), {
|
|
807
|
+
indeterminate: "",
|
|
808
|
+
width: "2",
|
|
809
|
+
"aria-hidden": "true"
|
|
810
|
+
})]),
|
|
806
811
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
807
812
|
_: 3
|
|
808
813
|
}, 8, [
|
|
@@ -1361,6 +1366,15 @@ var checkbox_default = /* @__PURE__ */ defineComponent({
|
|
|
1361
1366
|
//#endregion
|
|
1362
1367
|
//#region src/composables/inputs/date-time-field.ts
|
|
1363
1368
|
/**
|
|
1369
|
+
* The menu's content is a dialog with the pickers. `aria-owns` is removed since the input can't
|
|
1370
|
+
* own the content, and the menu still adds `aria-expanded` and `aria-controls`.
|
|
1371
|
+
*/
|
|
1372
|
+
const activatorProps = {
|
|
1373
|
+
role: "combobox",
|
|
1374
|
+
"aria-haspopup": "dialog",
|
|
1375
|
+
"aria-owns": void 0
|
|
1376
|
+
};
|
|
1377
|
+
/**
|
|
1364
1378
|
* Extracts the date part (`YYYY-MM-DD`) of a value, or an empty string when
|
|
1365
1379
|
* the type has no date.
|
|
1366
1380
|
*/
|
|
@@ -1418,6 +1432,31 @@ function useDateTimeFieldPickerBounds(props, selectedDate) {
|
|
|
1418
1432
|
};
|
|
1419
1433
|
});
|
|
1420
1434
|
}
|
|
1435
|
+
/**
|
|
1436
|
+
* Makes the field's input the activator of the pickers' menu, so the menu's attributes are on an
|
|
1437
|
+
* element whose role accepts them.
|
|
1438
|
+
* @param isOpen - Whether the menu is open.
|
|
1439
|
+
* @param isDisabled - Whether the menu can't open, as when the field is disabled or readonly.
|
|
1440
|
+
* @param hasLabel - Whether the field has a label, which names the menu's dialog.
|
|
1441
|
+
*/
|
|
1442
|
+
function useDateTimeFieldMenu(isOpen, isDisabled, hasLabel) {
|
|
1443
|
+
const inputId = useId();
|
|
1444
|
+
const activator = computed(() => toValue(isDisabled) ? void 0 : `#${inputId}`);
|
|
1445
|
+
const contentProps = computed(() => ({
|
|
1446
|
+
role: "dialog",
|
|
1447
|
+
"aria-labelledby": toValue(hasLabel) ? `${inputId}-label` : void 0
|
|
1448
|
+
}));
|
|
1449
|
+
function open() {
|
|
1450
|
+
if (!toValue(isDisabled)) isOpen.value = true;
|
|
1451
|
+
}
|
|
1452
|
+
return {
|
|
1453
|
+
inputId,
|
|
1454
|
+
activator,
|
|
1455
|
+
activatorProps,
|
|
1456
|
+
contentProps,
|
|
1457
|
+
open
|
|
1458
|
+
};
|
|
1459
|
+
}
|
|
1421
1460
|
function getTimeBound(bound, type, selectedDate) {
|
|
1422
1461
|
if (type === "datetime" && getDatePart(bound, type) !== selectedDate) return "";
|
|
1423
1462
|
return getTimePart(bound, type);
|
|
@@ -1513,6 +1552,7 @@ var date_time_field_default = /* @__PURE__ */ defineComponent({
|
|
|
1513
1552
|
const draftTime = computed(() => draft.value.time ?? getTimePart(modelValue.value, props.type));
|
|
1514
1553
|
const draftValue = computed(() => joinDateTime(props.type, draftDate.value, draftTime.value));
|
|
1515
1554
|
const bounds = useDateTimeFieldPickerBounds(props, draftDate);
|
|
1555
|
+
const { inputId, activator, activatorProps, contentProps, open: openMenu } = useDateTimeFieldMenu(isMenuOpen, isMenuDisabled, () => !!props.label);
|
|
1516
1556
|
watch(isMenuOpen, () => {
|
|
1517
1557
|
draft.value = {};
|
|
1518
1558
|
});
|
|
@@ -1536,6 +1576,7 @@ var date_time_field_default = /* @__PURE__ */ defineComponent({
|
|
|
1536
1576
|
}
|
|
1537
1577
|
return (_ctx, _cache) => {
|
|
1538
1578
|
return openBlock(), createBlock(unref(VTextField), {
|
|
1579
|
+
id: unref(inputId),
|
|
1539
1580
|
"model-value": displayValue.value,
|
|
1540
1581
|
"validation-value": modelValue.value,
|
|
1541
1582
|
variant: unref(vuetifyVariant),
|
|
@@ -1549,13 +1590,17 @@ var date_time_field_default = /* @__PURE__ */ defineComponent({
|
|
|
1549
1590
|
hint: props.hint,
|
|
1550
1591
|
clearable: isClearable.value,
|
|
1551
1592
|
readonly: "",
|
|
1552
|
-
"onClick:clear": clear
|
|
1593
|
+
"onClick:clear": clear,
|
|
1594
|
+
"onClick:control": unref(openMenu)
|
|
1553
1595
|
}, {
|
|
1554
1596
|
loader: withCtx((loader) => [createVNode(field_loader_default, normalizeProps(guardReactiveProps(loader)), null, 16)]),
|
|
1555
1597
|
default: withCtx(() => [createVNode(unref(VMenu), {
|
|
1556
1598
|
modelValue: isMenuOpen.value,
|
|
1557
1599
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isMenuOpen.value = $event),
|
|
1558
|
-
activator:
|
|
1600
|
+
activator: unref(activator),
|
|
1601
|
+
target: "parent",
|
|
1602
|
+
"activator-props": unref(activatorProps),
|
|
1603
|
+
"content-props": unref(contentProps),
|
|
1559
1604
|
location: "bottom start",
|
|
1560
1605
|
"min-width": "0",
|
|
1561
1606
|
disabled: isMenuDisabled.value,
|
|
@@ -1595,9 +1640,16 @@ var date_time_field_default = /* @__PURE__ */ defineComponent({
|
|
|
1595
1640
|
_: 1
|
|
1596
1641
|
})]),
|
|
1597
1642
|
_: 1
|
|
1598
|
-
}, 8, [
|
|
1643
|
+
}, 8, [
|
|
1644
|
+
"modelValue",
|
|
1645
|
+
"activator",
|
|
1646
|
+
"activator-props",
|
|
1647
|
+
"content-props",
|
|
1648
|
+
"disabled"
|
|
1649
|
+
])]),
|
|
1599
1650
|
_: 1
|
|
1600
1651
|
}, 8, [
|
|
1652
|
+
"id",
|
|
1601
1653
|
"model-value",
|
|
1602
1654
|
"validation-value",
|
|
1603
1655
|
"variant",
|
|
@@ -1609,7 +1661,8 @@ var date_time_field_default = /* @__PURE__ */ defineComponent({
|
|
|
1609
1661
|
"label",
|
|
1610
1662
|
"placeholder",
|
|
1611
1663
|
"hint",
|
|
1612
|
-
"clearable"
|
|
1664
|
+
"clearable",
|
|
1665
|
+
"onClick:control"
|
|
1613
1666
|
]);
|
|
1614
1667
|
};
|
|
1615
1668
|
}
|
package/dist/composables.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as FeedbackColorVariant, n as ButtonVariant, r as ColorVariant } from "./types-
|
|
1
|
+
import { i as FeedbackColorVariant, n as ButtonVariant, r as ColorVariant } from "./types-Zex9kf7C.js";
|
|
2
2
|
//#region src/composables/dialogs/types.d.ts
|
|
3
3
|
interface ToastOptions {
|
|
4
4
|
/**
|
|
@@ -33,6 +33,8 @@ type ButtonProps = {
|
|
|
33
33
|
disabled?: boolean;
|
|
34
34
|
/**
|
|
35
35
|
* Displays a loading indicator on the button, disabling interaction.
|
|
36
|
+
* The button keeps its text as accessible name and is marked as busy, and
|
|
37
|
+
* assistive technologies ignore the indicator.
|
|
36
38
|
* @default false
|
|
37
39
|
*/
|
|
38
40
|
loading?: boolean;
|