origam 2.17.1 → 2.18.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/CHANGELOG.md +690 -1
- package/dist/src/assets/css/main.css +1 -1
- package/dist/src/assets/css/tokens/dark.css +119 -20
- package/dist/src/assets/css/tokens/light.css +46 -10
- package/dist/src/assets/locales/en.json +21 -6
- package/dist/src/assets/locales/fr.json +21 -6
- package/dist/src/assets/scss/main.scss +10 -2
- package/dist/src/assets/scss/tokens/_dark.scss +2843 -10
- package/dist/src/assets/scss/tokens/_light.scss +46 -10
- package/dist/src/components/Alert/OrigamAlert.vue +6 -6
- package/dist/src/components/Avatar/OrigamAvatar.vue +15 -2
- package/dist/src/components/Badge/OrigamBadge.vue +7 -7
- package/dist/src/components/Breadcrumb/OrigamBreadcrumbItem.vue +23 -4
- package/dist/src/components/Btn/OrigamBtn.vue +21 -3
- package/dist/src/components/Btn/OrigamBtnGroup.vue +1 -1
- package/dist/src/components/Calendar/OrigamCalendar.vue +1 -1
- package/dist/src/components/Card/OrigamCard.vue +2 -0
- package/dist/src/components/Card/OrigamCardHeader.vue +7 -7
- package/dist/src/components/Carousel/OrigamCarousel.vue +14 -1
- package/dist/src/components/Chart/OrigamChartBoxPlot.vue +1 -1
- package/dist/src/components/Chart/OrigamChartBullet.vue +3 -2
- package/dist/src/components/Chart/OrigamChartCandlestick.vue +2 -2
- package/dist/src/components/Chart/OrigamChartCartesian.vue +49 -4
- package/dist/src/components/Chart/OrigamChartLegend.vue +39 -18
- package/dist/src/components/Chart/OrigamChartPareto.vue +7 -1
- package/dist/src/components/Chart/OrigamChartPictorial.vue +2 -2
- package/dist/src/components/Chart/OrigamChartRadar.vue +3 -1
- package/dist/src/components/Chart/OrigamChartSparkline.vue +3 -1
- package/dist/src/components/Chart/OrigamChartStreamgraph.vue +2 -1
- package/dist/src/components/Checkbox/OrigamCheckbox.vue +2 -0
- package/dist/src/components/Checkbox/OrigamCheckboxGroup.vue +36 -11
- package/dist/src/components/Chip/OrigamChip.vue +19 -4
- package/dist/src/components/Code/OrigamCode.vue +20 -3
- package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +30 -5
- package/dist/src/components/CommandPalette/OrigamCommandPalette.vue +3 -3
- package/dist/src/components/ConfirmWrapper/OrigamConfirmWrapper.vue +6 -6
- package/dist/src/components/ContextualMenu/OrigamContextualMenu.vue +0 -4
- package/dist/src/components/DataList/OrigamDataList.vue +2 -0
- package/dist/src/components/DataList/OrigamDataText.vue +6 -6
- package/dist/src/components/DataList/OrigamDataTitle.vue +6 -6
- package/dist/src/components/DataTable/OrigamDataTableHeaderCell.vue +1 -1
- package/dist/src/components/DataTable/OrigamDataTableHeadersCell.vue +4 -1
- package/dist/src/components/DatePicker/OrigamDatePicker.vue +2 -0
- package/dist/src/components/DatePicker/OrigamDatePickerHeader.vue +6 -6
- package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +21 -1
- package/dist/src/components/Dialog/OrigamDialog.vue +25 -0
- package/dist/src/components/Dialog/OrigamDialogConfirmation.vue +6 -0
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanel.vue +2 -0
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanelHeader.vue +6 -6
- package/dist/src/components/Field/OrigamField.vue +47 -15
- package/dist/src/components/FileField/OrigamFileField.vue +5 -1
- package/dist/src/components/Icon/OrigamSvgIcon.vue +3 -1
- package/dist/src/components/Img/OrigamImg.vue +9 -2
- package/dist/src/components/InfiniteScroll/OrigamInfiniteScroll.vue +34 -18
- package/dist/src/components/InlineEdit/OrigamInlineEdit.vue +46 -5
- package/dist/src/components/Input/OrigamInput.vue +6 -6
- package/dist/src/components/List/OrigamListGroup.vue +4 -0
- package/dist/src/components/List/OrigamListItem.vue +68 -4
- package/dist/src/components/Masonry/OrigamMasonry.vue +18 -2
- package/dist/src/components/Menu/OrigamMenu.vue +79 -9
- package/dist/src/components/NumberField/OrigamNumberField.vue +13 -3
- package/dist/src/components/OtpInputField/OrigamOtpInputField.vue +35 -11
- package/dist/src/components/PasswordField/OrigamPasswordField.vue +5 -1
- package/dist/src/components/Radio/OrigamRadio.vue +2 -0
- package/dist/src/components/Radio/OrigamRadioGroup.vue +36 -11
- package/dist/src/components/RatingField/OrigamRatingField.vue +58 -7
- package/dist/src/components/RatingField/OrigamRatingFieldItem.vue +78 -30
- package/dist/src/components/Select/OrigamSelect.vue +44 -21
- package/dist/src/components/SliderField/OrigamSliderField.vue +20 -10
- package/dist/src/components/Snackbar/OrigamSnackbarGroup.vue +1 -1
- package/dist/src/components/Switch/OrigamSwitch.vue +2 -0
- package/dist/src/components/Tabs/OrigamTab.vue +7 -4
- package/dist/src/components/Tabs/OrigamTabPanel.vue +4 -2
- package/dist/src/components/Tabs/OrigamTabs.vue +7 -5
- package/dist/src/components/TextField/OrigamTextField.vue +5 -1
- package/dist/src/components/TextareaField/OrigamTextareaField.vue +5 -1
- package/dist/src/components/Transition/OrigamExpandX.vue +19 -3
- package/dist/src/components/Transition/OrigamExpandY.vue +19 -3
- package/dist/src/components/Transition/OrigamTranslateScale.vue +26 -4
- package/dist/src/components/Video/OrigamVideo.vue +3 -2
- package/dist/src/components/Window/OrigamWindow.vue +20 -3
- package/dist/src/composables/Commons/accessibleCommand.composable.cjs +26 -0
- package/dist/src/composables/Commons/accessibleCommand.composable.d.ts +78 -0
- package/dist/src/composables/Commons/accessibleCommand.composable.js +20 -0
- package/dist/src/composables/Commons/activator.composable.cjs +10 -1
- package/dist/src/composables/Commons/activator.composable.js +11 -2
- package/dist/src/composables/Commons/adjacent.composable.cjs +17 -0
- package/dist/src/composables/Commons/adjacent.composable.d.ts +12 -0
- package/dist/src/composables/Commons/adjacent.composable.js +17 -0
- package/dist/src/composables/Commons/adjacentInner.composable.cjs +20 -0
- package/dist/src/composables/Commons/adjacentInner.composable.d.ts +24 -5
- package/dist/src/composables/Commons/adjacentInner.composable.js +20 -0
- package/dist/src/composables/Commons/audio.composable.cjs +14 -1
- package/dist/src/composables/Commons/audio.composable.js +14 -1
- package/dist/src/composables/Commons/backButton.composable.cjs +3 -1
- package/dist/src/composables/Commons/backButton.composable.js +3 -1
- package/dist/src/composables/Commons/border.composable.d.ts +13 -0
- package/dist/src/composables/Commons/colorEffect.composable.cjs +58 -46
- package/dist/src/composables/Commons/colorEffect.composable.d.ts +10 -5
- package/dist/src/composables/Commons/colorEffect.composable.js +70 -46
- package/dist/src/composables/Commons/createLayout.composable.cjs +21 -12
- package/dist/src/composables/Commons/createLayout.composable.js +21 -12
- package/dist/src/composables/Commons/delay.composable.d.ts +16 -0
- package/dist/src/composables/Commons/dimension.composable.d.ts +11 -0
- package/dist/src/composables/Commons/elevation.composable.cjs +6 -2
- package/dist/src/composables/Commons/elevation.composable.d.ts +37 -1
- package/dist/src/composables/Commons/elevation.composable.js +7 -2
- package/dist/src/composables/Commons/goTo.composable.cjs +4 -2
- package/dist/src/composables/Commons/goTo.composable.js +5 -3
- package/dist/src/composables/Commons/group.composable.cjs +14 -14
- package/dist/src/composables/Commons/group.composable.js +14 -14
- package/dist/src/composables/Commons/hotkey.composable.d.ts +18 -7
- package/dist/src/composables/Commons/hydration.composable.d.ts +8 -0
- package/dist/src/composables/Commons/link.composable.d.ts +20 -0
- package/dist/src/composables/Commons/locationStrategies.composable.d.ts +17 -0
- package/dist/src/composables/Commons/message.composable.d.ts +19 -5
- package/dist/src/composables/Commons/position.composable.d.ts +17 -6
- package/dist/src/composables/Commons/refs.composable.d.ts +11 -5
- package/dist/src/composables/Commons/rounded.composable.d.ts +11 -1
- package/dist/src/composables/Commons/scrolling.composable.cjs +15 -12
- package/dist/src/composables/Commons/scrolling.composable.js +15 -12
- package/dist/src/composables/Commons/size.composable.d.ts +15 -0
- package/dist/src/composables/Commons/ssrBoot.composable.cjs +9 -1
- package/dist/src/composables/Commons/ssrBoot.composable.js +10 -2
- package/dist/src/composables/Commons/stack.composable.cjs +13 -1
- package/dist/src/composables/Commons/stack.composable.js +13 -1
- package/dist/src/composables/Commons/theme-props-resolver.composable.cjs +41 -32
- package/dist/src/composables/Commons/theme-props-resolver.composable.js +41 -32
- package/dist/src/composables/Commons/validation.composable.cjs +3 -3
- package/dist/src/composables/Commons/validation.composable.js +3 -3
- package/dist/src/composables/Commons/virtual.composable.cjs +24 -8
- package/dist/src/composables/Commons/virtual.composable.js +24 -8
- package/dist/src/composables/Masonry/masonry.composable.cjs +18 -11
- package/dist/src/composables/Masonry/masonry.composable.js +18 -11
- package/dist/src/composables/Parallax/parallax.composable.cjs +1 -1
- package/dist/src/composables/Parallax/parallax.composable.js +1 -1
- package/dist/src/composables/index.cjs +36 -0
- package/dist/src/composables/index.d.ts +3 -0
- package/dist/src/composables/index.js +3 -0
- package/dist/src/consts/Chart/chart-cartesian.const.cjs +5 -2
- package/dist/src/consts/Chart/chart-cartesian.const.d.ts +42 -0
- package/dist/src/consts/Chart/chart-cartesian.const.js +3 -0
- package/dist/src/consts/Commons/elevation.const.cjs +5 -1
- package/dist/src/consts/Commons/elevation.const.d.ts +52 -2
- package/dist/src/consts/Commons/elevation.const.js +4 -0
- package/dist/src/consts/Commons/ripple.const.cjs +13 -3
- package/dist/src/consts/Commons/ripple.const.js +13 -3
- package/dist/src/consts/RatingField/rating-field.const.cjs +10 -0
- package/dist/src/consts/RatingField/rating-field.const.d.ts +36 -0
- package/dist/src/consts/RatingField/rating-field.const.js +12 -0
- package/dist/src/consts/index.cjs +11 -0
- package/dist/src/consts/index.d.ts +1 -0
- package/dist/src/consts/index.js +1 -0
- package/dist/src/directives/ClickOutside/clickOutside.directive.cjs +2 -0
- package/dist/src/directives/ClickOutside/clickOutside.directive.js +2 -0
- package/dist/src/directives/Ripple/ripple.directive.cjs +2 -0
- package/dist/src/directives/Ripple/ripple.directive.js +2 -0
- package/dist/src/enums/Commons/color.enum.cjs +0 -1
- package/dist/src/enums/Commons/color.enum.d.ts +14 -5
- package/dist/src/enums/Commons/color.enum.js +0 -1
- package/dist/src/enums/Sheet/sheet.enum.d.ts +1 -1
- package/dist/src/interfaces/Chart/chart-cartesian.interface.d.ts +6 -2
- package/dist/src/interfaces/Commons/activator.interface.d.ts +3 -2
- package/dist/src/interfaces/Commons/adjacent.interface.d.ts +29 -0
- package/dist/src/interfaces/Commons/group.interface.d.ts +13 -2
- package/dist/src/interfaces/Commons/ripple.interface.d.ts +16 -0
- package/dist/src/interfaces/Commons/scroll.interface.d.ts +3 -2
- package/dist/src/interfaces/DataTable/data-table-header.interface.d.ts +2 -2
- package/dist/src/interfaces/DatePicker/date-picker-month.interface.d.ts +2 -1
- package/dist/src/interfaces/Menu/menu.interface.d.ts +28 -1
- package/dist/src/interfaces/OtpInputField/otp-input-field.interface.d.ts +21 -1
- package/dist/src/interfaces/RatingField/rating-field-item.interface.d.ts +16 -1
- package/dist/src/interfaces/index.cjs +11 -0
- package/dist/src/interfaces/index.d.ts +1 -0
- package/dist/src/interfaces/index.js +1 -0
- package/dist/src/themes/origam.theme.cjs +8 -14
- package/dist/src/themes/origam.theme.js +6 -8
- package/dist/src/types/Commons/color.type.d.ts +4 -3
- package/dist/src/types/Commons/commons.type.d.ts +33 -0
- package/dist/src/types/Commons/theme.type.d.ts +2 -1
- package/dist/src/types/Sheet/sheet.type.d.ts +2 -1
- package/dist/src/types/index.cjs +22 -0
- package/dist/src/types/index.d.ts +2 -0
- package/dist/src/types/index.js +2 -0
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/dist/src/utils/Commons/a11y.util.cjs +35 -0
- package/dist/src/utils/Commons/a11y.util.d.ts +63 -0
- package/dist/src/utils/Commons/a11y.util.js +33 -0
- package/dist/src/utils/Commons/clickOutside.util.cjs +5 -1
- package/dist/src/utils/Commons/clickOutside.util.js +5 -1
- package/dist/src/utils/Commons/color.util.cjs +10 -5
- package/dist/src/utils/Commons/color.util.d.ts +34 -5
- package/dist/src/utils/Commons/color.util.js +9 -5
- package/dist/src/utils/Commons/goTo.util.cjs +31 -14
- package/dist/src/utils/Commons/goTo.util.d.ts +1 -1
- package/dist/src/utils/Commons/goTo.util.js +31 -16
- package/dist/src/utils/Commons/location.util.cjs +18 -3
- package/dist/src/utils/Commons/location.util.js +18 -3
- package/dist/src/utils/Commons/ripple.util.cjs +5 -1
- package/dist/src/utils/Commons/ripple.util.js +5 -1
- package/dist/src/utils/index.cjs +11 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.js +1 -0
- package/package.json +13 -2
- package/dist/src/types/Commons/locale.type.cjs +0 -1
- package/dist/src/types/Commons/locale.type.d.ts +0 -0
- package/dist/src/types/Commons/locale.type.js +0 -0
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
@blur="handleBlur"
|
|
17
17
|
@change="handleChange"
|
|
18
18
|
@click:clear="handleClear"
|
|
19
|
+
@input="handleInput"
|
|
19
20
|
@mousedown:control="handleMousedownControl"
|
|
20
21
|
>
|
|
21
22
|
<template
|
|
@@ -244,6 +245,8 @@ const props = defineProps({
|
|
|
244
245
|
prependInnerIcon: { type: null, required: false },
|
|
245
246
|
clearIcon: { type: null, required: false },
|
|
246
247
|
clearable: { type: Boolean, required: false },
|
|
248
|
+
prependInnerAriaLabel: { type: String, required: false },
|
|
249
|
+
appendInnerAriaLabel: { type: String, required: false },
|
|
247
250
|
border: { type: [Boolean, Number, String, Array], required: false, skipCheck: true, default: true },
|
|
248
251
|
borderTop: { type: [Boolean, Number, String], required: false },
|
|
249
252
|
borderLeft: { type: [Boolean, Number, String], required: false },
|
|
@@ -312,6 +315,8 @@ const props = defineProps({
|
|
|
312
315
|
appendIcon: { type: null, required: false },
|
|
313
316
|
prependAvatar: { type: String, required: false },
|
|
314
317
|
prependIcon: { type: null, required: false },
|
|
318
|
+
prependAriaLabel: { type: String, required: false },
|
|
319
|
+
appendAriaLabel: { type: String, required: false },
|
|
315
320
|
transition: { type: [Boolean, String, Object], required: false, default: () => ({ component: OrigamTranslateScale }) }
|
|
316
321
|
});
|
|
317
322
|
defineEmits(["update:menu", "update:modelValue"]);
|
|
@@ -373,6 +378,17 @@ const isMultiple = computed(() => {
|
|
|
373
378
|
const isRange = computed(() => {
|
|
374
379
|
return props.range && model.value.length > 1;
|
|
375
380
|
});
|
|
381
|
+
const commitTypedDate = (raw) => {
|
|
382
|
+
if (props.multiple || props.range) return;
|
|
383
|
+
if (raw === "") {
|
|
384
|
+
model.value = [];
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
const parsed = adapter.date(raw);
|
|
388
|
+
if (!parsed || !adapter.isValid(parsed)) return;
|
|
389
|
+
if (adapter.format(parsed, "keyboardDate") !== raw) return;
|
|
390
|
+
model.value = [adapter.toISO(parsed)];
|
|
391
|
+
};
|
|
376
392
|
const isFocused = shallowRef(false);
|
|
377
393
|
const form = inject(ORIGAM_FORM_KEY, null);
|
|
378
394
|
const menuDisabled = computed(() => {
|
|
@@ -419,8 +435,12 @@ const handleBlur = (e) => {
|
|
|
419
435
|
isFocused.value = true;
|
|
420
436
|
}
|
|
421
437
|
};
|
|
422
|
-
const
|
|
438
|
+
const handleInput = (e) => {
|
|
439
|
+
commitTypedDate(e.target?.value ?? "");
|
|
440
|
+
};
|
|
441
|
+
const handleChange = (e) => {
|
|
423
442
|
if (matchesSelector(origamTextFieldRef.value, ":autofill") || matchesSelector(origamTextFieldRef.value, ":-webkit-autofill")) {
|
|
443
|
+
commitTypedDate(e.target?.value ?? "");
|
|
424
444
|
}
|
|
425
445
|
};
|
|
426
446
|
const handleAfterLeave = () => {
|
|
@@ -266,6 +266,8 @@ const props = defineProps({
|
|
|
266
266
|
appendIcon: { type: null, required: false },
|
|
267
267
|
prependAvatar: { type: String, required: false },
|
|
268
268
|
prependIcon: { type: null, required: false },
|
|
269
|
+
prependAriaLabel: { type: String, required: false },
|
|
270
|
+
appendAriaLabel: { type: String, required: false },
|
|
269
271
|
active: { type: [Boolean, Object], required: false },
|
|
270
272
|
activeClass: { type: String, required: false },
|
|
271
273
|
status: { type: null, required: false },
|
|
@@ -398,6 +400,29 @@ defineExpose(forwardRefs({
|
|
|
398
400
|
border-radius: var(--origam-dialog---border-radius, 12px);
|
|
399
401
|
box-shadow: var(--origam-dialog---box-shadow);
|
|
400
402
|
|
|
403
|
+
// #563 — la boite qui porte le PLAFOND doit porter le DEFILEMENT.
|
|
404
|
+
//
|
|
405
|
+
// `.origam-overlay__content` est `position: absolute` et de hauteur
|
|
406
|
+
// AUTO : le `max-height: 100%` pose plus bas sur `.origam-card` se
|
|
407
|
+
// resout donc en `none` (pourcentage contre un parent sans hauteur
|
|
408
|
+
// definie). La carte grandit sans plafond, et cette boite la laissait
|
|
409
|
+
// deborder en `overflow: visible`. Mesure Chromium sur `develop`,
|
|
410
|
+
// dialogue Design + 900px injectes dans `#footer` :
|
|
411
|
+
//
|
|
412
|
+
// .origam-card overflow hidden clientH 1047 scrollH 1047 -> ne defile pas
|
|
413
|
+
// .origam-overlay__content visible -> ne rogne pas
|
|
414
|
+
// document -> bloque (scrollStrategy 'block')
|
|
415
|
+
// => pied du dialogue 459px SOUS le viewport, aucun recours.
|
|
416
|
+
//
|
|
417
|
+
// Contrairement a ce que decrit le ticket, `.origam-card__content`
|
|
418
|
+
// ne defilait pas davantage : sans hauteur definie en amont il
|
|
419
|
+
// grandit lui aussi (clientH 1647 === scrollH 1647). AUCUNE boite du
|
|
420
|
+
// dialogue ne defilait.
|
|
421
|
+
//
|
|
422
|
+
// La branche `&--fullscreen` ci-dessous pose deja exactement cette
|
|
423
|
+
// declaration : ceci aligne le mode par defaut sur elle.
|
|
424
|
+
overflow-y: auto;
|
|
425
|
+
|
|
401
426
|
&,
|
|
402
427
|
> form {
|
|
403
428
|
> .origam-card {
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
:id="id"
|
|
4
4
|
ref="origamDialogRef"
|
|
5
5
|
v-model="isActive"
|
|
6
|
+
:class="rootClasses"
|
|
7
|
+
:style="rootStyles"
|
|
6
8
|
v-bind="dialogProps"
|
|
7
9
|
@is-read="handleIsRead"
|
|
8
10
|
>
|
|
@@ -240,6 +242,8 @@ const props = defineProps({
|
|
|
240
242
|
appendIcon: { type: null, required: false },
|
|
241
243
|
prependAvatar: { type: String, required: false },
|
|
242
244
|
prependIcon: { type: null, required: false },
|
|
245
|
+
prependAriaLabel: { type: String, required: false },
|
|
246
|
+
appendAriaLabel: { type: String, required: false },
|
|
243
247
|
active: { type: [Boolean, Object], required: false },
|
|
244
248
|
activeClass: { type: String, required: false },
|
|
245
249
|
status: { type: null, required: false },
|
|
@@ -256,6 +260,8 @@ const origamDialogRef = ref();
|
|
|
256
260
|
const slots = useSlots();
|
|
257
261
|
const isActive = useVModel(props, "modelValue");
|
|
258
262
|
const validatable = ref(false);
|
|
263
|
+
const rootClasses = computed(() => [props.class]);
|
|
264
|
+
const rootStyles = computed(() => props.style);
|
|
259
265
|
const dialogProps = computed(() => {
|
|
260
266
|
return origamDialogRef.value?.filterProps(props, ["class", "style", "id", "modelValue"]);
|
|
261
267
|
});
|
|
@@ -175,6 +175,8 @@ const props = defineProps({
|
|
|
175
175
|
appendIcon: { type: null, required: false },
|
|
176
176
|
prependAvatar: { type: String, required: false },
|
|
177
177
|
prependIcon: { type: null, required: false },
|
|
178
|
+
prependAriaLabel: { type: String, required: false },
|
|
179
|
+
appendAriaLabel: { type: String, required: false },
|
|
178
180
|
ripple: { type: [Boolean, Object], required: false },
|
|
179
181
|
active: { type: [Boolean, Object], required: false },
|
|
180
182
|
activeClass: { type: String, required: false },
|
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
v-if="hasPrepend"
|
|
21
21
|
key="prepend"
|
|
22
22
|
class="origam-expansion-panel-header__prepend"
|
|
23
|
-
|
|
24
|
-
:tabindex="isPrependClickable ? 0 : undefined"
|
|
23
|
+
v-bind="prependCommandAttrs"
|
|
25
24
|
@click="handleClickPrepend"
|
|
26
25
|
@keydown="handleKeydownPrepend"
|
|
27
26
|
>
|
|
@@ -65,8 +64,7 @@
|
|
|
65
64
|
v-if="hasAppend || !hideActions"
|
|
66
65
|
key="append"
|
|
67
66
|
class="origam-expansion-panel-header__append"
|
|
68
|
-
|
|
69
|
-
:tabindex="isAppendClickable ? 0 : undefined"
|
|
67
|
+
v-bind="appendCommandAttrs"
|
|
70
68
|
@click="handleClickAppend"
|
|
71
69
|
@keydown="handleKeydownAppend"
|
|
72
70
|
>
|
|
@@ -163,6 +161,8 @@ const props = defineProps({
|
|
|
163
161
|
appendIcon: { type: null, required: false },
|
|
164
162
|
prependAvatar: { type: String, required: false },
|
|
165
163
|
prependIcon: { type: null, required: false },
|
|
164
|
+
prependAriaLabel: { type: String, required: false },
|
|
165
|
+
appendAriaLabel: { type: String, required: false },
|
|
166
166
|
ripple: { type: [Boolean, Object], required: false },
|
|
167
167
|
active: { type: [Boolean, Object], required: false },
|
|
168
168
|
activeClass: { type: String, required: false },
|
|
@@ -207,8 +207,8 @@ const hasTitle = computed(() => {
|
|
|
207
207
|
const {
|
|
208
208
|
hasAppend,
|
|
209
209
|
hasPrepend,
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
prependCommandAttrs,
|
|
211
|
+
appendCommandAttrs,
|
|
212
212
|
onClickPrepend: handleClickPrepend,
|
|
213
213
|
onClickAppend: handleClickAppend,
|
|
214
214
|
onKeydownPrepend: handleKeydownPrepend,
|
|
@@ -40,8 +40,7 @@
|
|
|
40
40
|
v-if="hasPrependInner"
|
|
41
41
|
key="prependInner"
|
|
42
42
|
class="origam-field__prepend-inner"
|
|
43
|
-
|
|
44
|
-
:tabindex="isPrependInnerClickable ? 0 : undefined"
|
|
43
|
+
v-bind="prependInnerCommandAttrs"
|
|
45
44
|
@click="handleClickPrependInner"
|
|
46
45
|
@keydown="handleKeydownPrependInner"
|
|
47
46
|
>
|
|
@@ -129,8 +128,7 @@
|
|
|
129
128
|
v-if="hasAppendInner"
|
|
130
129
|
key="appendInner"
|
|
131
130
|
class="origam-field__append-inner"
|
|
132
|
-
|
|
133
|
-
:tabindex="isAppendInnerClickable ? 0 : undefined"
|
|
131
|
+
v-bind="appendInnerCommandAttrs"
|
|
134
132
|
@click="handleClickAppendInner"
|
|
135
133
|
@keydown="handleKeydownAppendInner"
|
|
136
134
|
>
|
|
@@ -174,7 +172,7 @@
|
|
|
174
172
|
</template>
|
|
175
173
|
|
|
176
174
|
<script lang="ts" setup>
|
|
177
|
-
import { computed, onMounted, ref, StyleValue, useAttrs, useSlots, watch } from "vue";
|
|
175
|
+
import { computed, onBeforeUnmount, onMounted, ref, StyleValue, useAttrs, useSlots, watch } from "vue";
|
|
178
176
|
import OrigamAvatar from "../Avatar/OrigamAvatar.vue";
|
|
179
177
|
import OrigamExpandX from "../Transition/OrigamExpandX.vue";
|
|
180
178
|
import OrigamIcon from "../Icon/OrigamIcon.vue";
|
|
@@ -196,6 +194,7 @@ import { useStateFlag } from "../../composables/Commons/stateFlag.composable";
|
|
|
196
194
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
197
195
|
import { useTypography } from "../../composables/Commons/typography.composable";
|
|
198
196
|
import { useVariant } from "../../composables/Commons/variant.composable";
|
|
197
|
+
import { IN_BROWSER } from "../../consts/Commons/commons.const";
|
|
199
198
|
import vContrast from "../../directives/Contrast/contrast.directive";
|
|
200
199
|
import { DENSITY } from "../../enums/Commons/density.enum";
|
|
201
200
|
import { EASING } from "../../enums/Transition/transition.enum";
|
|
@@ -233,6 +232,8 @@ const props = defineProps({
|
|
|
233
232
|
prependInnerIcon: { type: null, required: false },
|
|
234
233
|
clearIcon: { type: null, required: false, default: MDI_ICONS.CLOSE_CIRCLE_OUTLINE },
|
|
235
234
|
clearable: { type: Boolean, required: false },
|
|
235
|
+
prependInnerAriaLabel: { type: String, required: false },
|
|
236
|
+
appendInnerAriaLabel: { type: String, required: false },
|
|
236
237
|
border: { type: [Boolean, Number, String, Array], required: false, skipCheck: true },
|
|
237
238
|
borderTop: { type: [Boolean, Number, String], required: false },
|
|
238
239
|
borderLeft: { type: [Boolean, Number, String], required: false },
|
|
@@ -286,13 +287,13 @@ const slots = useSlots();
|
|
|
286
287
|
const attrs = useAttrs();
|
|
287
288
|
const { t } = useLocale();
|
|
288
289
|
const {
|
|
290
|
+
prependInnerCommandAttrs,
|
|
291
|
+
appendInnerCommandAttrs,
|
|
289
292
|
hasAppendInner,
|
|
290
293
|
onClickAppendInner: handleClickAppendInner,
|
|
291
294
|
onClickPrependInner: handleClickPrependInner,
|
|
292
295
|
onKeydownAppendInner: handleKeydownAppendInner,
|
|
293
296
|
onKeydownPrependInner: handleKeydownPrependInner,
|
|
294
|
-
isAppendInnerClickable,
|
|
295
|
-
isPrependInnerClickable,
|
|
296
297
|
clickClear: handleClickClear,
|
|
297
298
|
hasPrependInner,
|
|
298
299
|
hasClear
|
|
@@ -401,6 +402,21 @@ const { isOn: active, config: activeState, toggle: handleActive } = useStateFlag
|
|
|
401
402
|
const isActive = computed(() => {
|
|
402
403
|
return props.dirty || active.value || hasPrefix.value || hasSuffix.value;
|
|
403
404
|
});
|
|
405
|
+
const labelFrames = /* @__PURE__ */ new Set();
|
|
406
|
+
let disposed = false;
|
|
407
|
+
const scheduleLabelFrame = (cb) => {
|
|
408
|
+
if (disposed || !IN_BROWSER) return;
|
|
409
|
+
const id2 = requestAnimationFrame(() => {
|
|
410
|
+
labelFrames.delete(id2);
|
|
411
|
+
cb();
|
|
412
|
+
});
|
|
413
|
+
labelFrames.add(id2);
|
|
414
|
+
};
|
|
415
|
+
onBeforeUnmount(() => {
|
|
416
|
+
disposed = true;
|
|
417
|
+
for (const id2 of labelFrames) cancelAnimationFrame(id2);
|
|
418
|
+
labelFrames.clear();
|
|
419
|
+
});
|
|
404
420
|
onMounted(() => {
|
|
405
421
|
watch(isFocused, (newVal, oldVal) => {
|
|
406
422
|
if (newVal !== oldVal) {
|
|
@@ -411,7 +427,7 @@ onMounted(() => {
|
|
|
411
427
|
if (hasLabel.value && newVal !== oldVal) {
|
|
412
428
|
const el = origamLabelRef.value.$el;
|
|
413
429
|
const targetEl = origamFloatingLabelRef.value.$el;
|
|
414
|
-
|
|
430
|
+
scheduleLabelFrame(() => {
|
|
415
431
|
const rect = nullifyTransforms(el);
|
|
416
432
|
const targetRect = targetEl.getBoundingClientRect();
|
|
417
433
|
const x = targetRect.x - rect.x;
|
|
@@ -569,8 +585,23 @@ defineExpose({
|
|
|
569
585
|
// Floor the inline padding at the effective radius (capped at the control
|
|
570
586
|
// height for pills). Prepended fields opt out below — their prepend icon
|
|
571
587
|
// already fills the corner.
|
|
588
|
+
//
|
|
589
|
+
// ⛔ LE PLANCHER EST UN CANAL, PAS UNE EXPRESSION FIGEE (#800).
|
|
590
|
+
// Un champ dont le contenu est CENTRE et sans etiquette (OtpInputField)
|
|
591
|
+
// n'a aucun risque de collision avec le coin : le plancher n'y a pas
|
|
592
|
+
// lieu d'etre, et l'appliquer decentre le chiffre. Ce cas s'exprimait
|
|
593
|
+
// jusqu'ici par un `--origam-field---padding-start: 0` SANS UNITE, qui
|
|
594
|
+
// melange `<number>` et `<length>` dans le `max()` et fait JETER la
|
|
595
|
+
// declaration entiere au computed-value time. Le rendu voulu etait donc
|
|
596
|
+
// obtenu par une erreur CSS — mesure Chromium : mettre l'unite donne
|
|
597
|
+
// `padding-inline-start: 4px` avec `padding-inline-end: 0px`, soit un
|
|
598
|
+
// chiffre decentre de 2px. Un consommateur qui veut vraiment zero met
|
|
599
|
+
// desormais `--origam-field---corner-clearance: 0px` : c'est explicite,
|
|
600
|
+
// ca survit a un refactor du `max()`, et ca ne repose sur rien d'invalide.
|
|
601
|
+
--origam-field---corner-clearance:
|
|
602
|
+
min(var(--origam-field---border-radius, 8px), var(--origam-input__control---height, 36px));
|
|
572
603
|
padding-inline:
|
|
573
|
-
max(var(--origam-field---padding-start),
|
|
604
|
+
max(var(--origam-field---padding-start), var(--origam-field---corner-clearance))
|
|
574
605
|
var(--origam-field---padding-end);
|
|
575
606
|
backdrop-filter: var(--origam-field---backdrop-filter, none);
|
|
576
607
|
-webkit-backdrop-filter: var(--origam-field---backdrop-filter, none);
|
|
@@ -614,7 +645,7 @@ defineExpose({
|
|
|
614
645
|
padding-bottom: var(--origam-field__input---padding-bottom);
|
|
615
646
|
position: relative;
|
|
616
647
|
width: 100%;
|
|
617
|
-
row-gap: calc(8px - var(--origam-input---density,
|
|
648
|
+
row-gap: calc(8px - var(--origam-input---density, 0px));
|
|
618
649
|
border: none;
|
|
619
650
|
background: transparent;
|
|
620
651
|
|
|
@@ -746,9 +777,9 @@ defineExpose({
|
|
|
746
777
|
&__label {
|
|
747
778
|
contain: layout paint;
|
|
748
779
|
display: block;
|
|
749
|
-
margin-inline-start: var(--origam-field__input---padding-start,
|
|
750
|
-
margin-inline-end: var(--origam-field__input---padding-end,
|
|
751
|
-
max-width: calc(100% - var(--origam-field__input---padding-start,
|
|
780
|
+
margin-inline-start: var(--origam-field__input---padding-start, 0px);
|
|
781
|
+
margin-inline-end: var(--origam-field__input---padding-end, 0px);
|
|
782
|
+
max-width: calc(100% - var(--origam-field__input---padding-start, 0px) - var(--origam-field__input---padding-end, 0px));
|
|
752
783
|
pointer-events: none;
|
|
753
784
|
position: absolute;
|
|
754
785
|
top: calc(var(--origam-input---padding-top, 16px) + var(--origam-input---density, 0px) - 8px);
|
|
@@ -778,7 +809,8 @@ defineExpose({
|
|
|
778
809
|
|
|
779
810
|
#{$this}__outline {
|
|
780
811
|
&--start {
|
|
781
|
-
|
|
812
|
+
// Meme plancher que le padding, meme canal — cf. #800.
|
|
813
|
+
flex: 0 0 max(var(--origam-field---padding-start), var(--origam-field---corner-clearance));
|
|
782
814
|
}
|
|
783
815
|
|
|
784
816
|
&--end {
|
|
@@ -1083,7 +1115,7 @@ defineExpose({
|
|
|
1083
1115
|
// label"). Keep the 4px on the inline-end for notch
|
|
1084
1116
|
// breathing room.
|
|
1085
1117
|
margin-block: 0;
|
|
1086
|
-
margin-inline: var(--origam-field__input---padding-start,
|
|
1118
|
+
margin-inline: var(--origam-field__input---padding-start, 0px) 4px;
|
|
1087
1119
|
}
|
|
1088
1120
|
}
|
|
1089
1121
|
|
|
@@ -454,6 +454,8 @@ const props = defineProps({
|
|
|
454
454
|
prependInnerIcon: { type: null, required: false, default: MDI_ICONS.PAPERCLIP },
|
|
455
455
|
clearIcon: { type: null, required: false },
|
|
456
456
|
clearable: { type: Boolean, required: false, default: true },
|
|
457
|
+
prependInnerAriaLabel: { type: String, required: false },
|
|
458
|
+
appendInnerAriaLabel: { type: String, required: false },
|
|
457
459
|
border: { type: [Boolean, Number, String, Array], required: false, skipCheck: true, default: true },
|
|
458
460
|
borderTop: { type: [Boolean, Number, String], required: false },
|
|
459
461
|
borderLeft: { type: [Boolean, Number, String], required: false },
|
|
@@ -520,7 +522,9 @@ const props = defineProps({
|
|
|
520
522
|
appendAvatar: { type: String, required: false },
|
|
521
523
|
appendIcon: { type: null, required: false },
|
|
522
524
|
prependAvatar: { type: String, required: false },
|
|
523
|
-
prependIcon: { type: null, required: false }
|
|
525
|
+
prependIcon: { type: null, required: false },
|
|
526
|
+
prependAriaLabel: { type: String, required: false },
|
|
527
|
+
appendAriaLabel: { type: String, required: false }
|
|
524
528
|
});
|
|
525
529
|
const isDropzoneMode = computed(() => Boolean(props.dropzone || props.dragndrop));
|
|
526
530
|
const displayMode = computed(() => {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
:style="iconStyles"
|
|
7
7
|
>
|
|
8
8
|
<svg
|
|
9
|
-
aria-hidden="
|
|
9
|
+
:aria-hidden="ariaHidden"
|
|
10
10
|
class="origam-icon__svg"
|
|
11
11
|
focusable="false"
|
|
12
12
|
viewBox="0 0 24 24"
|
|
@@ -40,6 +40,7 @@ import { computed, StyleValue, toRef } from "vue";
|
|
|
40
40
|
import { useBorder } from "../../composables/Commons/border.composable";
|
|
41
41
|
import { useBothColor } from "../../composables/Commons/bothColor.composable";
|
|
42
42
|
import { useDimension } from "../../composables/Commons/dimension.composable";
|
|
43
|
+
import { useIconAccessibility } from "../../composables/Icon/iconAccessibility.composable";
|
|
43
44
|
import { useMargin } from "../../composables/Commons/margin.composable";
|
|
44
45
|
import { usePadding } from "../../composables/Commons/padding.composable";
|
|
45
46
|
import { useProps } from "../../composables/Commons/props.composable";
|
|
@@ -101,6 +102,7 @@ defineSlots();
|
|
|
101
102
|
const isArray = (data) => {
|
|
102
103
|
return Array.isArray(data);
|
|
103
104
|
};
|
|
105
|
+
const { ariaHidden } = useIconAccessibility();
|
|
104
106
|
const { colorClasses, colorStyles } = useBothColor(toRef(props, "bgColor"), toRef(props, "color"));
|
|
105
107
|
const { borderClasses, borderStyles } = useBorder(props);
|
|
106
108
|
const { paddingClasses, paddingStyles } = usePadding(props);
|
|
@@ -260,8 +260,11 @@ const getSrc = () => {
|
|
|
260
260
|
if (img) currentSrc.value = img.currentSrc || img.src;
|
|
261
261
|
};
|
|
262
262
|
let timer = -1;
|
|
263
|
+
const bootFrames = /* @__PURE__ */ new Set();
|
|
263
264
|
onBeforeUnmount(() => {
|
|
264
265
|
clearTimeout(timer);
|
|
266
|
+
for (const id2 of bootFrames) cancelAnimationFrame(id2);
|
|
267
|
+
bootFrames.clear();
|
|
265
268
|
});
|
|
266
269
|
const pollForSize = (img, timeout = 100) => {
|
|
267
270
|
const poll = () => {
|
|
@@ -285,11 +288,15 @@ let stop = null;
|
|
|
285
288
|
const markBooted = (val) => {
|
|
286
289
|
if (val) {
|
|
287
290
|
if (IN_BROWSER) {
|
|
288
|
-
requestAnimationFrame(() => {
|
|
289
|
-
|
|
291
|
+
const outer = requestAnimationFrame(() => {
|
|
292
|
+
bootFrames.delete(outer);
|
|
293
|
+
const inner = requestAnimationFrame(() => {
|
|
294
|
+
bootFrames.delete(inner);
|
|
290
295
|
isBooted.value = true;
|
|
291
296
|
});
|
|
297
|
+
bootFrames.add(inner);
|
|
292
298
|
});
|
|
299
|
+
bootFrames.add(outer);
|
|
293
300
|
}
|
|
294
301
|
stop?.();
|
|
295
302
|
}
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
</template>
|
|
116
116
|
|
|
117
117
|
<script lang="ts" setup>
|
|
118
|
-
import { computed, nextTick, onMounted, ref, shallowRef, StyleValue, toRef } from "vue";
|
|
118
|
+
import { computed, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, StyleValue, toRef } from "vue";
|
|
119
119
|
import OrigamBtn from "../Btn/OrigamBtn.vue";
|
|
120
120
|
import OrigamInfiniteScrollIntersect from "./OrigamInfiniteScrollIntersect.vue";
|
|
121
121
|
import OrigamProgress from "../Progress/OrigamProgress.vue";
|
|
@@ -125,6 +125,7 @@ import { useLocale } from "../../composables/Commons/locale.composable";
|
|
|
125
125
|
import { useProps } from "../../composables/Commons/props.composable";
|
|
126
126
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
127
127
|
import { useTypography } from "../../composables/Commons/typography.composable";
|
|
128
|
+
import { IN_BROWSER } from "../../consts/Commons/commons.const";
|
|
128
129
|
import { DIRECTION } from "../../enums/Commons/direction.enum";
|
|
129
130
|
import { INFINITE_SCROLL_MODE, INFINITE_SCROLL_SIDE, INFINITE_SCROLL_STATUS } from "../../enums/InfiniteScroll/infinite-scroll.enum";
|
|
130
131
|
import { PROGRESS_TYPE } from "../../enums/Progress/progress.enum";
|
|
@@ -213,25 +214,40 @@ const handleIntersect = ({ side, isIntersecting: _isIntersecting }) => {
|
|
|
213
214
|
intersecting(side);
|
|
214
215
|
}
|
|
215
216
|
};
|
|
217
|
+
const frames = /* @__PURE__ */ new Set();
|
|
218
|
+
let disposed = false;
|
|
219
|
+
const scheduleFrame = (cb) => {
|
|
220
|
+
if (disposed || !IN_BROWSER) return;
|
|
221
|
+
const id2 = window.requestAnimationFrame(() => {
|
|
222
|
+
frames.delete(id2);
|
|
223
|
+
cb();
|
|
224
|
+
});
|
|
225
|
+
frames.add(id2);
|
|
226
|
+
};
|
|
227
|
+
onBeforeUnmount(() => {
|
|
228
|
+
disposed = true;
|
|
229
|
+
for (const id2 of frames) window.cancelAnimationFrame(id2);
|
|
230
|
+
frames.clear();
|
|
231
|
+
});
|
|
232
|
+
const scheduleFrames = (count, cb) => {
|
|
233
|
+
scheduleFrame(count <= 1 ? cb : () => scheduleFrames(count - 1, cb));
|
|
234
|
+
};
|
|
235
|
+
const rearmIntersect = () => {
|
|
236
|
+
intersecting(currentSide.value);
|
|
237
|
+
};
|
|
238
|
+
const afterDoneTick = () => {
|
|
239
|
+
if (disposed) return;
|
|
240
|
+
if (status.value === INFINITE_SCROLL_STATUS.EMPTY || status.value === INFINITE_SCROLL_STATUS.ERROR) return;
|
|
241
|
+
if (status.value === INFINITE_SCROLL_STATUS.OK && currentSide.value === INFINITE_SCROLL_SIDE.START) {
|
|
242
|
+
setScrollAmount(getScrollSize() - previousScrollSize + getScrollAmount());
|
|
243
|
+
}
|
|
244
|
+
if (props.mode !== INFINITE_SCROLL_MODE.MANUAL) {
|
|
245
|
+
nextTick(() => scheduleFrames(3, rearmIntersect));
|
|
246
|
+
}
|
|
247
|
+
};
|
|
216
248
|
const done = (_status) => {
|
|
217
249
|
status.value = _status;
|
|
218
|
-
nextTick(
|
|
219
|
-
if (status.value === INFINITE_SCROLL_STATUS.EMPTY || status.value === INFINITE_SCROLL_STATUS.ERROR) return;
|
|
220
|
-
if (status.value === INFINITE_SCROLL_STATUS.OK && currentSide.value === INFINITE_SCROLL_SIDE.START) {
|
|
221
|
-
setScrollAmount(getScrollSize() - previousScrollSize + getScrollAmount());
|
|
222
|
-
}
|
|
223
|
-
if (props.mode !== INFINITE_SCROLL_MODE.MANUAL) {
|
|
224
|
-
nextTick(() => {
|
|
225
|
-
window.requestAnimationFrame(() => {
|
|
226
|
-
window.requestAnimationFrame(() => {
|
|
227
|
-
window.requestAnimationFrame(() => {
|
|
228
|
-
intersecting(currentSide.value);
|
|
229
|
-
});
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
});
|
|
250
|
+
nextTick(afterDoneTick);
|
|
235
251
|
};
|
|
236
252
|
const intersecting = (side) => {
|
|
237
253
|
if (props.mode !== "manual" && !isIntersecting.value) return;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<component
|
|
3
3
|
:is="tag"
|
|
4
4
|
:id="id"
|
|
5
|
+
ref="rootRef"
|
|
5
6
|
class="origam-inline-edit"
|
|
6
7
|
:class="rootClasses"
|
|
7
8
|
:style="rootStyles"
|
|
@@ -76,8 +77,8 @@
|
|
|
76
77
|
data-cy="origam-inline-edit-input"
|
|
77
78
|
hide-details
|
|
78
79
|
@update:model-value="handleInput"
|
|
80
|
+
@focusout="handleFocusOut"
|
|
79
81
|
@keydown="handleKeyDown"
|
|
80
|
-
@blur="handleBlur"
|
|
81
82
|
>
|
|
82
83
|
<template
|
|
83
84
|
v-if="showActions"
|
|
@@ -131,8 +132,8 @@
|
|
|
131
132
|
data-cy="origam-inline-edit-input"
|
|
132
133
|
hide-details
|
|
133
134
|
@update:model-value="handleInput"
|
|
135
|
+
@focusout="handleFocusOut"
|
|
134
136
|
@keydown="handleKeyDown"
|
|
135
|
-
@blur="handleBlur"
|
|
136
137
|
>
|
|
137
138
|
<template
|
|
138
139
|
v-if="showActions"
|
|
@@ -260,6 +261,13 @@ const {
|
|
|
260
261
|
}));
|
|
261
262
|
const inputRef = ref(null);
|
|
262
263
|
const errorId = `origam-inline-edit-error-${useId()}`;
|
|
264
|
+
const rootRef = ref(null);
|
|
265
|
+
const rootEl = () => {
|
|
266
|
+
const r = rootRef.value;
|
|
267
|
+
if (!r) return null;
|
|
268
|
+
const el = r instanceof Element ? r : r.$el;
|
|
269
|
+
return el instanceof HTMLElement ? el : null;
|
|
270
|
+
};
|
|
263
271
|
const displayValue = computed(() => {
|
|
264
272
|
const v = props.modelValue;
|
|
265
273
|
if (v === null || v === void 0) return "";
|
|
@@ -280,16 +288,34 @@ const handleEnterEdit = () => {
|
|
|
280
288
|
edit();
|
|
281
289
|
emit("edit");
|
|
282
290
|
};
|
|
291
|
+
let restoreFocusOnLeave = false;
|
|
292
|
+
const noteTransition = (fromFocusOut) => {
|
|
293
|
+
if (fromFocusOut) {
|
|
294
|
+
restoreFocusOnLeave = false;
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
if (typeof document === "undefined") {
|
|
298
|
+
restoreFocusOnLeave = false;
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
const root = rootEl();
|
|
302
|
+
const active = document.activeElement;
|
|
303
|
+
restoreFocusOnLeave = !!root && !!active && root.contains(active);
|
|
304
|
+
};
|
|
283
305
|
const handleConfirm = () => {
|
|
306
|
+
noteTransition(false);
|
|
284
307
|
void confirm();
|
|
285
308
|
};
|
|
286
309
|
const handleCancel = () => {
|
|
310
|
+
noteTransition(false);
|
|
287
311
|
cancel();
|
|
288
312
|
};
|
|
289
313
|
const handleInput = (value) => {
|
|
290
314
|
setValue(value ?? "");
|
|
291
315
|
};
|
|
292
316
|
const handleKeyDown = (event) => {
|
|
317
|
+
const target = event.target;
|
|
318
|
+
if (!(target instanceof HTMLInputElement) && !(target instanceof HTMLTextAreaElement)) return;
|
|
293
319
|
if (event.key === "Enter" && props.confirmOnEnter && !props.multiline) {
|
|
294
320
|
event.preventDefault();
|
|
295
321
|
handleConfirm();
|
|
@@ -305,13 +331,28 @@ const handleKeyDown = (event) => {
|
|
|
305
331
|
handleCancel();
|
|
306
332
|
}
|
|
307
333
|
};
|
|
308
|
-
const
|
|
334
|
+
const handleFocusOut = (event) => {
|
|
309
335
|
if (!props.confirmOnBlur) return;
|
|
336
|
+
if (!isEditing.value) return;
|
|
310
337
|
if (isPending.value) return;
|
|
311
|
-
|
|
338
|
+
const root = rootEl();
|
|
339
|
+
const next = event.relatedTarget;
|
|
340
|
+
if (root && next instanceof Node && root.contains(next)) return;
|
|
341
|
+
noteTransition(true);
|
|
342
|
+
void confirm();
|
|
343
|
+
};
|
|
344
|
+
const restoreFocusAfterEdit = async () => {
|
|
345
|
+
if (!restoreFocusOnLeave) return;
|
|
346
|
+
restoreFocusOnLeave = false;
|
|
347
|
+
await nextTick();
|
|
348
|
+
const target = rootEl()?.querySelector('[data-cy="origam-inline-edit-display"]');
|
|
349
|
+
if (target && typeof target.focus === "function") target.focus();
|
|
312
350
|
};
|
|
313
351
|
watch(isEditing, async (next) => {
|
|
314
|
-
if (!next)
|
|
352
|
+
if (!next) {
|
|
353
|
+
void restoreFocusAfterEdit();
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
315
356
|
if (!props.autoFocus) return;
|
|
316
357
|
await nextTick();
|
|
317
358
|
const el = inputRef.value;
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
v-if="hasPrepend"
|
|
10
10
|
key="prepend"
|
|
11
11
|
class="origam-input__prepend"
|
|
12
|
-
|
|
13
|
-
:tabindex="isPrependClickable ? 0 : undefined"
|
|
12
|
+
v-bind="prependCommandAttrs"
|
|
14
13
|
@click="handleClickPrepend"
|
|
15
14
|
@keydown="handleKeydownPrepend"
|
|
16
15
|
>
|
|
@@ -44,8 +43,7 @@
|
|
|
44
43
|
v-if="hasAppend"
|
|
45
44
|
key="append"
|
|
46
45
|
class="origam-input__append"
|
|
47
|
-
|
|
48
|
-
:tabindex="isAppendClickable ? 0 : undefined"
|
|
46
|
+
v-bind="appendCommandAttrs"
|
|
49
47
|
@click="handleClickAppend"
|
|
50
48
|
@keydown="handleKeydownAppend"
|
|
51
49
|
>
|
|
@@ -191,6 +189,8 @@ const props = defineProps({
|
|
|
191
189
|
appendIcon: { type: null, required: false },
|
|
192
190
|
prependAvatar: { type: String, required: false },
|
|
193
191
|
prependIcon: { type: null, required: false },
|
|
192
|
+
prependAriaLabel: { type: String, required: false },
|
|
193
|
+
appendAriaLabel: { type: String, required: false },
|
|
194
194
|
size: { type: null, required: false },
|
|
195
195
|
fontSize: { type: null, required: false },
|
|
196
196
|
fontWeight: { type: null, required: false },
|
|
@@ -226,8 +226,8 @@ const {
|
|
|
226
226
|
onClickAppend: handleClickAppend,
|
|
227
227
|
onKeydownPrepend: handleKeydownPrepend,
|
|
228
228
|
onKeydownAppend: handleKeydownAppend,
|
|
229
|
-
|
|
230
|
-
|
|
229
|
+
prependCommandAttrs,
|
|
230
|
+
appendCommandAttrs
|
|
231
231
|
} = useAdjacent(props, toRef(props, "prependIcon"), toRef(props, "appendIcon"));
|
|
232
232
|
const messages = computed(() => {
|
|
233
233
|
if (props.errorMessages?.length || !isPristine.value && errorMessages.value.length) {
|
|
@@ -16,8 +16,10 @@
|
|
|
16
16
|
<origam-list-item
|
|
17
17
|
:active="isOpen"
|
|
18
18
|
:append-avatar="appendAvatar"
|
|
19
|
+
:append-aria-label="appendAriaLabel"
|
|
19
20
|
:append-icon="appendActivatorIcon"
|
|
20
21
|
:prepend-avatar="prependAvatar"
|
|
22
|
+
:prepend-aria-label="prependAriaLabel"
|
|
21
23
|
:prepend-icon="prependActivatorIcon"
|
|
22
24
|
:title="title"
|
|
23
25
|
:value="value"
|
|
@@ -112,6 +114,8 @@ const props = defineProps({
|
|
|
112
114
|
appendIcon: { type: null, required: false },
|
|
113
115
|
prependAvatar: { type: String, required: false },
|
|
114
116
|
prependIcon: { type: null, required: false },
|
|
117
|
+
prependAriaLabel: { type: String, required: false },
|
|
118
|
+
appendAriaLabel: { type: String, required: false },
|
|
115
119
|
activeClass: { type: String, required: false },
|
|
116
120
|
hover: { type: [Boolean, Object], required: false },
|
|
117
121
|
hoverClass: { type: String, required: false }
|