origam 2.42.0 → 2.44.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 +108 -0
- package/dist/src/assets/css/main.css +1 -1
- package/dist/src/assets/css/tokens/dark-pinned.css +5 -1
- package/dist/src/assets/css/tokens/dark-system.css +5 -1
- package/dist/src/assets/css/tokens/dark.css +10 -2
- package/dist/src/assets/css/tokens/light.css +5 -1
- package/dist/src/assets/locales/en.json +3 -0
- package/dist/src/assets/locales/fr.json +3 -0
- package/dist/src/assets/scss/tokens/_dark.scss +10 -2
- package/dist/src/assets/scss/tokens/_light.scss +5 -1
- package/dist/src/components/Btn/OrigamBtn.vue +31 -10
- package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +3 -5
- package/dist/src/components/ConfirmWrapper/OrigamConfirmWrapper.vue +0 -1
- package/dist/src/components/DataTable/OrigamDataTableFooter.vue +3 -1
- package/dist/src/components/DataTable/OrigamDataTableHeaderCell.vue +20 -2
- package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +3 -5
- package/dist/src/components/Field/OrigamField.vue +17 -7
- package/dist/src/components/FileField/OrigamFileField.vue +3 -3
- package/dist/src/components/Form/OrigamForm.vue +0 -1
- package/dist/src/components/Input/OrigamInput.vue +0 -1
- package/dist/src/components/Messages/OrigamMessages.vue +1 -1
- package/dist/src/components/NumberField/OrigamNumberField.vue +26 -14
- package/dist/src/components/OtpInputField/OrigamOtpInputField.vue +8 -5
- package/dist/src/components/PasswordField/OrigamPasswordField.vue +3 -3
- package/dist/src/components/Select/OrigamSelect.vue +22 -5
- package/dist/src/components/Stepper/OrigamStepper.vue +22 -1
- package/dist/src/components/Stepper/OrigamStepperItem.vue +46 -21
- package/dist/src/components/Table/OrigamTable.vue +1 -1
- package/dist/src/components/TextField/OrigamTextField.vue +3 -3
- package/dist/src/components/TextareaField/OrigamTextareaField.vue +3 -3
- package/dist/src/components/Toolbar/OrigamToolbar.vue +1 -1
- package/dist/src/composables/Commons/adjacentInner.composable.cjs +17 -3
- package/dist/src/composables/Commons/adjacentInner.composable.d.ts +5 -3
- package/dist/src/composables/Commons/adjacentInner.composable.js +18 -4
- package/dist/src/composables/Commons/link.composable.cjs +6 -5
- package/dist/src/composables/Commons/link.composable.js +6 -5
- package/dist/src/composables/Commons/popup-dialog-aria.composable.cjs +26 -0
- package/dist/src/composables/Commons/popup-dialog-aria.composable.d.ts +23 -0
- package/dist/src/composables/Commons/popup-dialog-aria.composable.js +17 -0
- package/dist/src/composables/Commons/stack.composable.cjs +2 -19
- package/dist/src/composables/Commons/stack.composable.d.ts +1 -1
- package/dist/src/composables/Commons/stack.composable.js +3 -20
- package/dist/src/composables/index.cjs +12 -0
- package/dist/src/composables/index.d.ts +1 -0
- package/dist/src/composables/index.js +1 -0
- package/dist/src/directives/Contrast/contrast.directive.cjs +52 -15
- package/dist/src/directives/Contrast/contrast.directive.js +47 -10
- package/dist/src/interfaces/NumberField/number-field.interface.d.ts +8 -0
- package/dist/src/interfaces/Stepper/stepper-item.interface.d.ts +11 -2
- package/dist/src/interfaces/Stepper/stepper.interface.d.ts +7 -0
- package/dist/src/interfaces/Table/table.interface.d.ts +2 -2
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
:focused="(isFocused && focusAll) || focusIndex === i"
|
|
30
30
|
v-bind="{...fieldProps(i)}"
|
|
31
31
|
@click:clear="handleClear"
|
|
32
|
-
@click:append-inner="
|
|
33
|
-
@click:prepend-inner="
|
|
32
|
+
@click:append-inner="appendInnerRelay"
|
|
33
|
+
@click:prepend-inner="prependInnerRelay"
|
|
34
34
|
>
|
|
35
35
|
<template
|
|
36
36
|
v-if="slots.prependInner"
|
|
@@ -141,7 +141,6 @@
|
|
|
141
141
|
>
|
|
142
142
|
<origam-messages
|
|
143
143
|
:id="messagesId"
|
|
144
|
-
:active="hasMessages"
|
|
145
144
|
:messages="validationMessages"
|
|
146
145
|
/>
|
|
147
146
|
</div>
|
|
@@ -149,7 +148,7 @@
|
|
|
149
148
|
</template>
|
|
150
149
|
|
|
151
150
|
<script lang="ts" setup>
|
|
152
|
-
import { computed, nextTick, onBeforeUnmount, ref, StyleValue, useAttrs, useSlots, watch } from "vue";
|
|
151
|
+
import { computed, getCurrentInstance, nextTick, onBeforeUnmount, ref, StyleValue, useAttrs, useSlots, watch } from "vue";
|
|
153
152
|
import OrigamField from "../Field/OrigamField.vue";
|
|
154
153
|
import OrigamOverlay from "../Overlay/OrigamOverlay.vue";
|
|
155
154
|
import OrigamProgress from "../Progress/OrigamProgress.vue";
|
|
@@ -165,7 +164,7 @@ import { useStyle } from "../../composables/Commons/style.composable";
|
|
|
165
164
|
import { OTP_INPUT_FIELD_TYPE } from "../../enums/OtpInputField/otp-input-field.enum";
|
|
166
165
|
import { PROGRESS_TYPE } from "../../enums/Progress/progress.enum";
|
|
167
166
|
import { filterInputAttrs } from "../../utils/Input/input.util";
|
|
168
|
-
import { focusChild, wrapInArray } from "../../utils/Commons/commons.util";
|
|
167
|
+
import { focusChild, hasEvent, wrapInArray } from "../../utils/Commons/commons.util";
|
|
169
168
|
import { forwardRefs } from "../../utils/Commons/forwardRefs.util";
|
|
170
169
|
import { getUid } from "../../utils/Commons/getCurrentInstance.util";
|
|
171
170
|
/*********************************************************
|
|
@@ -1155,6 +1154,10 @@ const handleClear = (e) => {
|
|
|
1155
1154
|
* `handleClear` above: relay on THIS component's own instance whichever
|
|
1156
1155
|
* cell the click came from.
|
|
1157
1156
|
********************************************************/
|
|
1157
|
+
const vm = getCurrentInstance();
|
|
1158
|
+
const hasListener = (name) => hasEvent(vm?.vnode.props ?? {}, name);
|
|
1159
|
+
const appendInnerRelay = computed(() => hasListener("click:appendInner") ? handleClickAppendInner : undefined);
|
|
1160
|
+
const prependInnerRelay = computed(() => hasListener("click:prependInner") ? handleClickPrependInner : undefined);
|
|
1158
1161
|
const handleClickAppendInner = (e) => {
|
|
1159
1162
|
emits("click:appendInner", e);
|
|
1160
1163
|
};
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
@click="handleControlClick"
|
|
34
34
|
@mousedown="handleControlMousedown"
|
|
35
35
|
@click:clear="handleClear"
|
|
36
|
-
@click:prepend-inner="
|
|
37
|
-
@click:append-inner="
|
|
36
|
+
@click:prepend-inner="prependInnerRelay"
|
|
37
|
+
@click:append-inner="appendInnerRelay"
|
|
38
38
|
>
|
|
39
39
|
<template
|
|
40
40
|
v-if="slots.loader"
|
|
@@ -1213,7 +1213,7 @@ const model = useVModel(props, "modelValue");
|
|
|
1213
1213
|
/*********************************************************
|
|
1214
1214
|
* Composables
|
|
1215
1215
|
********************************************************/
|
|
1216
|
-
const {
|
|
1216
|
+
const { appendInnerRelay, prependInnerRelay } = useAdjacentInner(props);
|
|
1217
1217
|
/*********************************************************
|
|
1218
1218
|
* Icon
|
|
1219
1219
|
********************************************************/
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
@mousedown:control="handleMousedownControl"
|
|
23
23
|
@click:append="handleClickAppend"
|
|
24
24
|
@click:prepend="handleClickPrepend"
|
|
25
|
-
@click:append-inner="
|
|
26
|
-
@click:prepend-inner="
|
|
25
|
+
@click:append-inner="appendInnerRelay"
|
|
26
|
+
@click:prepend-inner="prependInnerRelay"
|
|
27
27
|
>
|
|
28
28
|
<template
|
|
29
29
|
v-if="slots.prepend"
|
|
@@ -68,6 +68,8 @@
|
|
|
68
68
|
</template>
|
|
69
69
|
|
|
70
70
|
<template #default>
|
|
71
|
+
<output class="origam-select__announcement">{{ menu && hasNoData ? t(noDataText) : '' }}</output>
|
|
72
|
+
|
|
71
73
|
<origam-menu
|
|
72
74
|
ref="origamMenuRef"
|
|
73
75
|
v-model="menu"
|
|
@@ -96,7 +98,6 @@
|
|
|
96
98
|
:selected="selectedValues"
|
|
97
99
|
:size="listSize"
|
|
98
100
|
:tabindex="-1"
|
|
99
|
-
aria-live="polite"
|
|
100
101
|
v-bind="{ ...listProps }"
|
|
101
102
|
@focusin="handleFocusin"
|
|
102
103
|
@focusout="handleFocusout"
|
|
@@ -123,10 +124,12 @@
|
|
|
123
124
|
<template #item.renderless="{item, index, itemRef}">
|
|
124
125
|
<origam-divider
|
|
125
126
|
v-if="isDivider(item)"
|
|
127
|
+
role="presentation"
|
|
126
128
|
v-bind="item.props"
|
|
127
129
|
/>
|
|
128
130
|
<origam-list-subheader
|
|
129
131
|
v-else-if="isSubheader(item)"
|
|
132
|
+
role="presentation"
|
|
130
133
|
v-bind="item.props"
|
|
131
134
|
/>
|
|
132
135
|
<slot
|
|
@@ -147,6 +150,8 @@
|
|
|
147
150
|
:model-value="isSelected"
|
|
148
151
|
:ripple="false"
|
|
149
152
|
:tabindex="-1"
|
|
153
|
+
aria-hidden="true"
|
|
154
|
+
inert
|
|
150
155
|
/>
|
|
151
156
|
|
|
152
157
|
<origam-avatar
|
|
@@ -312,7 +317,7 @@ import { LIST_ITEM_TYPE } from "../../enums/List/list-item.enum";
|
|
|
312
317
|
import { SELECT_STRATEGY } from "../../enums/Commons/nested.enum";
|
|
313
318
|
import { SIZES } from "../../enums/Commons/size.enum";
|
|
314
319
|
import { TEXT_FIELD_TYPE } from "../../enums/TextField/text-field.enum";
|
|
315
|
-
import { deepEqual, matchesSelector, wrapInArray } from "../../utils/Commons/commons.util";
|
|
320
|
+
import { deepEqual, hasEvent, matchesSelector, wrapInArray } from "../../utils/Commons/commons.util";
|
|
316
321
|
import { forwardRefs } from "../../utils/Commons/forwardRefs.util";
|
|
317
322
|
import { getUid } from "../../utils/Commons/getCurrentInstance.util";
|
|
318
323
|
/*********************************************************
|
|
@@ -1285,6 +1290,9 @@ const origamChipsRef = ref();
|
|
|
1285
1290
|
// expose certain props/methods (notably `$el`, which the proxy filters
|
|
1286
1291
|
// because of its `$` prefix).
|
|
1287
1292
|
const vm = getCurrentInstance();
|
|
1293
|
+
const hasListener = (name) => hasEvent(vm?.vnode.props ?? {}, name);
|
|
1294
|
+
const appendInnerRelay = computed(() => hasListener("click:appendInner") ? handleClickAppendInner : undefined);
|
|
1295
|
+
const prependInnerRelay = computed(() => hasListener("click:prependInner") ? handleClickPrependInner : undefined);
|
|
1288
1296
|
/*********************************************************
|
|
1289
1297
|
* WAI-ARIA combobox IDs
|
|
1290
1298
|
*
|
|
@@ -1433,6 +1441,7 @@ const menuProps = computed(() => {
|
|
|
1433
1441
|
const consumerContentProps = consumerProps.contentProps ?? {};
|
|
1434
1442
|
return {
|
|
1435
1443
|
...consumerProps,
|
|
1444
|
+
role: consumerProps.role ?? "presentation",
|
|
1436
1445
|
/*********************************************************
|
|
1437
1446
|
* Menu activator ARIA — #1247
|
|
1438
1447
|
*
|
|
@@ -1440,7 +1449,8 @@ const menuProps = computed(() => {
|
|
|
1440
1449
|
* `activator="parent"` is the role-less `.origam-field` wrapper: OrigamMenu's
|
|
1441
1450
|
* default aria-haspopup/expanded/owns are illegal there (aria-allowed-attr).
|
|
1442
1451
|
* The combobox ARIA lives on the <input> (`comboboxAriaAttrs`); `undefined`
|
|
1443
|
-
* suppresses the defaults.
|
|
1452
|
+
* suppresses the defaults. #1331: `role` below replaces the overlay's hardcoded
|
|
1453
|
+
* `role="menu"`, illegal around a listbox.
|
|
1444
1454
|
********************************************************/
|
|
1445
1455
|
activatorProps: {
|
|
1446
1456
|
...MENU_WRAPPER_ARIA_RESET,
|
|
@@ -1914,6 +1924,7 @@ const chipSlotProps = (item) => {
|
|
|
1914
1924
|
disabled: item.props?.disabled,
|
|
1915
1925
|
border: true,
|
|
1916
1926
|
rounded: true,
|
|
1927
|
+
closeLabel: t("origam.select.remove_item", { title: item.title }),
|
|
1917
1928
|
"onClick:close": (e) => handleChipClose(e, item),
|
|
1918
1929
|
onKeydown: (e) => handleChipKeydown(e, item),
|
|
1919
1930
|
onMousedown: (e) => handleChipMousedown(e),
|
|
@@ -2149,6 +2160,12 @@ defineExpose(forwardRefs({
|
|
|
2149
2160
|
</script>
|
|
2150
2161
|
|
|
2151
2162
|
<style lang="scss" scoped>
|
|
2163
|
+
@use '../../assets/scss/helpers' as ds;
|
|
2164
|
+
|
|
2165
|
+
.origam-select__announcement {
|
|
2166
|
+
@include ds.ds-visually-hidden;
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2152
2169
|
.origam-select {
|
|
2153
2170
|
$this: &;
|
|
2154
2171
|
|
|
@@ -23,7 +23,28 @@
|
|
|
23
23
|
:index="index"
|
|
24
24
|
:data-cy="`stepper-item-${index}`"
|
|
25
25
|
@click="handleItemClick"
|
|
26
|
-
|
|
26
|
+
>
|
|
27
|
+
<template
|
|
28
|
+
v-if="$slots['item-prepend']"
|
|
29
|
+
#prepend="slotProps"
|
|
30
|
+
>
|
|
31
|
+
<slot
|
|
32
|
+
name="item-prepend"
|
|
33
|
+
v-bind="slotProps"
|
|
34
|
+
:item="item"
|
|
35
|
+
/>
|
|
36
|
+
</template>
|
|
37
|
+
<template
|
|
38
|
+
v-if="$slots['item-append']"
|
|
39
|
+
#append="slotProps"
|
|
40
|
+
>
|
|
41
|
+
<slot
|
|
42
|
+
name="item-append"
|
|
43
|
+
v-bind="slotProps"
|
|
44
|
+
:item="item"
|
|
45
|
+
/>
|
|
46
|
+
</template>
|
|
47
|
+
</origam-stepper-item>
|
|
27
48
|
</template>
|
|
28
49
|
</template>
|
|
29
50
|
</slot>
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
:disabled="isClickable && resolvedStatus === STEPPER_ITEM_STATUS.ACTIVE ? true : undefined"
|
|
11
11
|
@click="handleClick"
|
|
12
12
|
>
|
|
13
|
+
<slot
|
|
14
|
+
name="prepend"
|
|
15
|
+
:index="index"
|
|
16
|
+
:status="resolvedStatus"
|
|
17
|
+
/>
|
|
18
|
+
|
|
13
19
|
<span
|
|
14
20
|
v-contrast
|
|
15
21
|
:class="indicatorClasses"
|
|
@@ -39,6 +45,12 @@
|
|
|
39
45
|
class="origam-stepper-item__subtitle"
|
|
40
46
|
>{{ subtitle }}</span>
|
|
41
47
|
</span>
|
|
48
|
+
|
|
49
|
+
<slot
|
|
50
|
+
name="append"
|
|
51
|
+
:index="index"
|
|
52
|
+
:status="resolvedStatus"
|
|
53
|
+
/>
|
|
42
54
|
</component>
|
|
43
55
|
</template>
|
|
44
56
|
|
|
@@ -159,7 +171,10 @@ const itemClasses = computed(() => [
|
|
|
159
171
|
"origam-stepper-item",
|
|
160
172
|
`origam-stepper-item--${resolvedStatus.value}`,
|
|
161
173
|
`origam-stepper-item--${orientation.value}`,
|
|
162
|
-
{
|
|
174
|
+
{
|
|
175
|
+
"origam-stepper-item--clickable": isClickable.value,
|
|
176
|
+
"origam-stepper-item--colored": !!stepper?.color.value
|
|
177
|
+
},
|
|
163
178
|
props.class
|
|
164
179
|
]);
|
|
165
180
|
const indicatorClasses = computed(() => ["origam-stepper-item__indicator", `origam-stepper-item__indicator--${resolvedStatus.value}`]);
|
|
@@ -226,24 +241,28 @@ defineExpose({
|
|
|
226
241
|
line-height: 1;
|
|
227
242
|
}
|
|
228
243
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
244
|
+
@each $status in (active, done) {
|
|
245
|
+
&--#{$status} {
|
|
246
|
+
$status-color: var(
|
|
247
|
+
--origam-stepper---color-#{$status},
|
|
248
|
+
var(--origam-stepper---color, var(--origam-color__action--primary---bg))
|
|
249
|
+
);
|
|
250
|
+
|
|
251
|
+
color: $status-color;
|
|
252
|
+
border-color: $status-color;
|
|
253
|
+
background-color: var(
|
|
254
|
+
--origam-stepper---background-color,
|
|
255
|
+
color-mix(in srgb, #{$status-color} 16%, transparent)
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// The stepper's own `color` prop wins over the per-status tokens: the item
|
|
261
|
+
// inherits the colour the stepper root already resolved (class or inline).
|
|
262
|
+
#{$this}--colored &--active,
|
|
263
|
+
#{$this}--colored &--done {
|
|
264
|
+
color: inherit;
|
|
265
|
+
border-color: currentColor;
|
|
247
266
|
}
|
|
248
267
|
|
|
249
268
|
&--error {
|
|
@@ -270,13 +289,19 @@ defineExpose({
|
|
|
270
289
|
align-items: flex-start;
|
|
271
290
|
text-align: start;
|
|
272
291
|
}
|
|
292
|
+
|
|
293
|
+
// Vertical: the subtitle wraps by default (own token, so a root-level
|
|
294
|
+
// `subtitle---white-space` override still reaches horizontal steppers).
|
|
295
|
+
#{$this}__subtitle {
|
|
296
|
+
white-space: var(--origam-stepper-item--vertical__subtitle---white-space, normal);
|
|
297
|
+
}
|
|
273
298
|
}
|
|
274
299
|
|
|
275
300
|
&__title {
|
|
276
301
|
font-size: var(--origam-stepper---title-font-size, 0.875rem);
|
|
277
302
|
font-weight: var(--origam-stepper---title-font-weight, 500);
|
|
278
303
|
color: var(--origam-stepper---title-color, var(--origam-color__text---primary));
|
|
279
|
-
white-space: nowrap;
|
|
304
|
+
white-space: var(--origam-stepper-item__title---white-space, nowrap);
|
|
280
305
|
overflow: hidden;
|
|
281
306
|
text-overflow: ellipsis;
|
|
282
307
|
max-width: 100%;
|
|
@@ -285,7 +310,7 @@ defineExpose({
|
|
|
285
310
|
&__subtitle {
|
|
286
311
|
font-size: var(--origam-stepper---subtitle-font-size, 0.75rem);
|
|
287
312
|
color: var(--origam-stepper---subtitle-color, var(--origam-color__text---secondary));
|
|
288
|
-
white-space: nowrap;
|
|
313
|
+
white-space: var(--origam-stepper-item__subtitle---white-space, nowrap);
|
|
289
314
|
overflow: hidden;
|
|
290
315
|
text-overflow: ellipsis;
|
|
291
316
|
max-width: 100%;
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
@click="handleControlClick"
|
|
34
34
|
@mousedown="handleControlMousedown"
|
|
35
35
|
@click:clear="handleClear"
|
|
36
|
-
@click:prepend-inner="
|
|
37
|
-
@click:append-inner="
|
|
36
|
+
@click:prepend-inner="prependInnerRelay"
|
|
37
|
+
@click:append-inner="appendInnerRelay"
|
|
38
38
|
>
|
|
39
39
|
<template
|
|
40
40
|
v-if="slots.loader"
|
|
@@ -1030,7 +1030,7 @@ const { isFocused, onFocus, onBlur: handleBlur } = useFocus(props);
|
|
|
1030
1030
|
/*********************************************************
|
|
1031
1031
|
* Composables
|
|
1032
1032
|
********************************************************/
|
|
1033
|
-
const {
|
|
1033
|
+
const { appendInnerRelay, prependInnerRelay } = useAdjacentInner(props);
|
|
1034
1034
|
/*********************************************************
|
|
1035
1035
|
* Icon
|
|
1036
1036
|
********************************************************/
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
@click="handleControlClick"
|
|
33
33
|
@mousedown="handleControlMousedown"
|
|
34
34
|
@click:clear="handleClear"
|
|
35
|
-
@click:prepend-inner="
|
|
36
|
-
@click:append-inner="
|
|
35
|
+
@click:prepend-inner="prependInnerRelay"
|
|
36
|
+
@click:append-inner="appendInnerRelay"
|
|
37
37
|
>
|
|
38
38
|
<template
|
|
39
39
|
v-if="slots.loader"
|
|
@@ -1182,7 +1182,7 @@ watch(() => model.value, (next) => {
|
|
|
1182
1182
|
/*********************************************************
|
|
1183
1183
|
* Composables
|
|
1184
1184
|
********************************************************/
|
|
1185
|
-
const {
|
|
1185
|
+
const { appendInnerRelay, prependInnerRelay } = useAdjacentInner(props);
|
|
1186
1186
|
/*********************************************************
|
|
1187
1187
|
* Icon
|
|
1188
1188
|
********************************************************/
|
|
@@ -683,7 +683,7 @@ const { isOn: isHover, config: hoverState } = useStateFlag(props, { state: "hove
|
|
|
683
683
|
* cablees a un comportement invente. Elles avertissent une fois, en
|
|
684
684
|
* dev, avec la raison exacte. Meme traitement que la famille Chart.
|
|
685
685
|
********************************************************/
|
|
686
|
-
useUnsupportedProp("OrigamToolbar", "modelValue", "the toolbar has no open/closed state to bind — nothing reads this value.", () => props.modelValue !==
|
|
686
|
+
useUnsupportedProp("OrigamToolbar", "modelValue", "the toolbar has no open/closed state to bind — nothing reads this value.", () => props.modelValue !== true);
|
|
687
687
|
const { isOn: isActive, config: activeState } = useStateFlag(props, { state: "active" });
|
|
688
688
|
// `colorClasses` / `colorStyles` MUST come from `useStateEffect` so the
|
|
689
689
|
// surface follows `hover` / `active` — e.g. a transparent sticky AppBar
|
|
@@ -12,20 +12,30 @@ var _getCurrentInstance = require("../../utils/Commons/getCurrentInstance.util.c
|
|
|
12
12
|
function useAdjacentInner(props) {
|
|
13
13
|
const vm = (0, _getCurrentInstance.getCurrentInstance)("OrigamAdjacentInner");
|
|
14
14
|
const slots = (0, _vue.useSlots)();
|
|
15
|
+
const slotsVersion = (0, _vue.shallowRef)(0);
|
|
16
|
+
(0, _vue.onBeforeUpdate)(() => {
|
|
17
|
+
slotsVersion.value++;
|
|
18
|
+
});
|
|
19
|
+
const slotPresence = (0, _vue.computed)(() => ({
|
|
20
|
+
version: slotsVersion.value,
|
|
21
|
+
prependInner: !!slots.prependInner,
|
|
22
|
+
appendInner: !!slots.appendInner,
|
|
23
|
+
clear: !!slots.clear
|
|
24
|
+
}));
|
|
15
25
|
const hasPrependInnerMedia = (0, _vue.computed)(() => {
|
|
16
26
|
return !!(props.prependInnerAvatar || props.prependInnerIcon);
|
|
17
27
|
});
|
|
18
28
|
const hasPrependInner = (0, _vue.computed)(() => {
|
|
19
|
-
return
|
|
29
|
+
return slotPresence.value.prependInner || hasPrependInnerMedia.value;
|
|
20
30
|
});
|
|
21
31
|
const hasAppendInnerMedia = (0, _vue.computed)(() => {
|
|
22
32
|
return !!(props.appendInnerAvatar || props.appendInnerIcon);
|
|
23
33
|
});
|
|
24
34
|
const hasAppendInner = (0, _vue.computed)(() => {
|
|
25
|
-
return
|
|
35
|
+
return slotPresence.value.appendInner || hasAppendInnerMedia.value;
|
|
26
36
|
});
|
|
27
37
|
const hasClear = (0, _vue.computed)(() => {
|
|
28
|
-
return props.clearable ||
|
|
38
|
+
return !!props.clearable || slotPresence.value.clear;
|
|
29
39
|
});
|
|
30
40
|
const onClickPrependInner = e => {
|
|
31
41
|
vm.emit("click:prependInner", e);
|
|
@@ -42,6 +52,8 @@ function useAdjacentInner(props) {
|
|
|
42
52
|
const isAppendInnerClickable = (0, _vue.computed)(() => {
|
|
43
53
|
return (0, _commons.hasEvent)(vm.attrs, "click:appendInner") || (0, _commons.hasEvent)(vm.vnode.props ?? {}, "click:appendInner");
|
|
44
54
|
});
|
|
55
|
+
const appendInnerRelay = (0, _vue.computed)(() => isAppendInnerClickable.value ? onClickAppendInner : void 0);
|
|
56
|
+
const prependInnerRelay = (0, _vue.computed)(() => isPrependInnerClickable.value ? onClickPrependInner : void 0);
|
|
45
57
|
const ownsKey = e => e.target === e.currentTarget;
|
|
46
58
|
const onKeydownPrependInner = e => {
|
|
47
59
|
if (!isPrependInnerClickable.value) return;
|
|
@@ -81,6 +93,8 @@ function useAdjacentInner(props) {
|
|
|
81
93
|
hasClear,
|
|
82
94
|
isPrependInnerClickable,
|
|
83
95
|
isAppendInnerClickable,
|
|
96
|
+
appendInnerRelay,
|
|
97
|
+
prependInnerRelay,
|
|
84
98
|
onClickPrependInner,
|
|
85
99
|
onClickAppendInner,
|
|
86
100
|
onKeydownPrependInner,
|
|
@@ -41,12 +41,14 @@ export declare function useAdjacentInner(props: IAdjacentInnerProps): {
|
|
|
41
41
|
prependInnerCommandAttrs: import("vue").ComputedRef<Record<string, unknown>>;
|
|
42
42
|
appendInnerCommandAttrs: import("vue").ComputedRef<Record<string, unknown>>;
|
|
43
43
|
hasPrependInnerMedia: import("vue").ComputedRef<boolean>;
|
|
44
|
-
hasPrependInner: import("vue").ComputedRef<boolean
|
|
44
|
+
hasPrependInner: import("vue").ComputedRef<boolean>;
|
|
45
45
|
hasAppendInnerMedia: import("vue").ComputedRef<boolean>;
|
|
46
|
-
hasAppendInner: import("vue").ComputedRef<boolean
|
|
47
|
-
hasClear: import("vue").ComputedRef<
|
|
46
|
+
hasAppendInner: import("vue").ComputedRef<boolean>;
|
|
47
|
+
hasClear: import("vue").ComputedRef<boolean>;
|
|
48
48
|
isPrependInnerClickable: import("vue").ComputedRef<boolean>;
|
|
49
49
|
isAppendInnerClickable: import("vue").ComputedRef<boolean>;
|
|
50
|
+
appendInnerRelay: import("vue").ComputedRef<((e: Event) => void) | undefined>;
|
|
51
|
+
prependInnerRelay: import("vue").ComputedRef<((e: Event) => void) | undefined>;
|
|
50
52
|
onClickPrependInner: (e: Event) => void;
|
|
51
53
|
onClickAppendInner: (e: Event) => void;
|
|
52
54
|
onKeydownPrependInner: (e: KeyboardEvent) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, useSlots } from "vue";
|
|
1
|
+
import { computed, onBeforeUpdate, shallowRef, useSlots } from "vue";
|
|
2
2
|
import { KEYBOARD_VALUES } from "../../enums/Commons/hotkey.enum.js";
|
|
3
3
|
import { hasEvent } from "../../utils/Commons/commons.util.js";
|
|
4
4
|
import { useAccessibleCommand } from "./accessibleCommand.composable.js";
|
|
@@ -6,20 +6,30 @@ import { getCurrentInstance } from "../../utils/Commons/getCurrentInstance.util.
|
|
|
6
6
|
export function useAdjacentInner(props) {
|
|
7
7
|
const vm = getCurrentInstance("OrigamAdjacentInner");
|
|
8
8
|
const slots = useSlots();
|
|
9
|
+
const slotsVersion = shallowRef(0);
|
|
10
|
+
onBeforeUpdate(() => {
|
|
11
|
+
slotsVersion.value++;
|
|
12
|
+
});
|
|
13
|
+
const slotPresence = computed(() => ({
|
|
14
|
+
version: slotsVersion.value,
|
|
15
|
+
prependInner: !!slots.prependInner,
|
|
16
|
+
appendInner: !!slots.appendInner,
|
|
17
|
+
clear: !!slots.clear
|
|
18
|
+
}));
|
|
9
19
|
const hasPrependInnerMedia = computed(() => {
|
|
10
20
|
return !!(props.prependInnerAvatar || props.prependInnerIcon);
|
|
11
21
|
});
|
|
12
22
|
const hasPrependInner = computed(() => {
|
|
13
|
-
return
|
|
23
|
+
return slotPresence.value.prependInner || hasPrependInnerMedia.value;
|
|
14
24
|
});
|
|
15
25
|
const hasAppendInnerMedia = computed(() => {
|
|
16
26
|
return !!(props.appendInnerAvatar || props.appendInnerIcon);
|
|
17
27
|
});
|
|
18
28
|
const hasAppendInner = computed(() => {
|
|
19
|
-
return
|
|
29
|
+
return slotPresence.value.appendInner || hasAppendInnerMedia.value;
|
|
20
30
|
});
|
|
21
31
|
const hasClear = computed(() => {
|
|
22
|
-
return props.clearable ||
|
|
32
|
+
return !!props.clearable || slotPresence.value.clear;
|
|
23
33
|
});
|
|
24
34
|
const onClickPrependInner = (e) => {
|
|
25
35
|
vm.emit("click:prependInner", e);
|
|
@@ -36,6 +46,8 @@ export function useAdjacentInner(props) {
|
|
|
36
46
|
const isAppendInnerClickable = computed(() => {
|
|
37
47
|
return hasEvent(vm.attrs, "click:appendInner") || hasEvent(vm.vnode.props ?? {}, "click:appendInner");
|
|
38
48
|
});
|
|
49
|
+
const appendInnerRelay = computed(() => isAppendInnerClickable.value ? onClickAppendInner : void 0);
|
|
50
|
+
const prependInnerRelay = computed(() => isPrependInnerClickable.value ? onClickPrependInner : void 0);
|
|
39
51
|
const ownsKey = (e) => e.target === e.currentTarget;
|
|
40
52
|
const onKeydownPrependInner = (e) => {
|
|
41
53
|
if (!isPrependInnerClickable.value) return;
|
|
@@ -75,6 +87,8 @@ export function useAdjacentInner(props) {
|
|
|
75
87
|
hasClear,
|
|
76
88
|
isPrependInnerClickable,
|
|
77
89
|
isAppendInnerClickable,
|
|
90
|
+
appendInnerRelay,
|
|
91
|
+
prependInnerRelay,
|
|
78
92
|
onClickPrependInner,
|
|
79
93
|
onClickAppendInner,
|
|
80
94
|
onKeydownPrependInner,
|
|
@@ -26,17 +26,18 @@ function useLink(props, attrs) {
|
|
|
26
26
|
}
|
|
27
27
|
const link = props.to ? RouterLink.useLink(props) : void 0;
|
|
28
28
|
const route = (0, _route.useRoute)();
|
|
29
|
+
const isExactActive = link && (0, _vue.computed)(() => {
|
|
30
|
+
if (!route.value) return link.isExactActive?.value;
|
|
31
|
+
return link.isExactActive?.value && (0, _commons.deepEqual)(link.route.value.query, route.value.query);
|
|
32
|
+
});
|
|
29
33
|
return {
|
|
30
34
|
tag,
|
|
31
35
|
isLink,
|
|
32
36
|
isClickable,
|
|
33
37
|
route: link?.route,
|
|
34
38
|
navigate: link?.navigate,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!route.value) return link.isExactActive?.value;
|
|
38
|
-
return link.isExactActive?.value && (0, _commons.deepEqual)(link.route.value.query, route.value.query);
|
|
39
|
-
}),
|
|
39
|
+
isExactActive,
|
|
40
|
+
isActive: link && (0, _vue.computed)(() => props.exact ? !!isExactActive?.value : link.isActive.value),
|
|
40
41
|
href: (0, _vue.computed)(() => props.to ? link?.route.value.href : props.href)
|
|
41
42
|
};
|
|
42
43
|
}
|
|
@@ -20,17 +20,18 @@ export function useLink(props, attrs) {
|
|
|
20
20
|
}
|
|
21
21
|
const link = props.to ? RouterLink.useLink(props) : void 0;
|
|
22
22
|
const route = useRoute();
|
|
23
|
+
const isExactActive = link && computed(() => {
|
|
24
|
+
if (!route.value) return link.isExactActive?.value;
|
|
25
|
+
return link.isExactActive?.value && deepEqual(link.route.value.query, route.value.query);
|
|
26
|
+
});
|
|
23
27
|
return {
|
|
24
28
|
tag,
|
|
25
29
|
isLink,
|
|
26
30
|
isClickable,
|
|
27
31
|
route: link?.route,
|
|
28
32
|
navigate: link?.navigate,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (!route.value) return link.isExactActive?.value;
|
|
32
|
-
return link.isExactActive?.value && deepEqual(link.route.value.query, route.value.query);
|
|
33
|
-
}),
|
|
33
|
+
isExactActive,
|
|
34
|
+
isActive: link && computed(() => props.exact ? !!isExactActive?.value : link.isActive.value),
|
|
34
35
|
href: computed(() => props.to ? link?.route.value.href : props.href)
|
|
35
36
|
};
|
|
36
37
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePopupDialogAria = usePopupDialogAria;
|
|
7
|
+
var _getCurrentInstance = require("../../utils/Commons/getCurrentInstance.util.cjs");
|
|
8
|
+
var _vue = require("vue");
|
|
9
|
+
function usePopupDialogAria(name, label, expanded) {
|
|
10
|
+
const menuId = `${name}-menu-${(0, _getCurrentInstance.getUid)()}`;
|
|
11
|
+
const comboboxAriaAttrs = (0, _vue.computed)(() => ({
|
|
12
|
+
role: "combobox",
|
|
13
|
+
"aria-haspopup": "dialog",
|
|
14
|
+
"aria-controls": menuId,
|
|
15
|
+
"aria-expanded": expanded.value ? "true" : "false"
|
|
16
|
+
}));
|
|
17
|
+
const menuAriaProps = (0, _vue.computed)(() => ({
|
|
18
|
+
id: menuId,
|
|
19
|
+
role: "dialog",
|
|
20
|
+
"aria-label": label()
|
|
21
|
+
}));
|
|
22
|
+
return {
|
|
23
|
+
comboboxAriaAttrs,
|
|
24
|
+
menuAriaProps
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
/*********************************************************
|
|
3
|
+
* usePopupDialogAria
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* ARIA d'un champ combobox dont le menu est un `dialog` (calendrier,
|
|
7
|
+
* color picker), pas une liste de `menuitem` : le menu recoit `id` +
|
|
8
|
+
* `role="dialog"` + `aria-label` (`menuAriaProps`), le combobox pointe
|
|
9
|
+
* dessus par `aria-controls` (`comboboxAriaAttrs`). #1382 / #1458
|
|
10
|
+
********************************************************/
|
|
11
|
+
export declare function usePopupDialogAria(name: string, label: () => string | undefined, expanded: Ref<boolean>): {
|
|
12
|
+
comboboxAriaAttrs: import("vue").ComputedRef<{
|
|
13
|
+
role: string;
|
|
14
|
+
'aria-haspopup': string;
|
|
15
|
+
'aria-controls': string;
|
|
16
|
+
'aria-expanded': string;
|
|
17
|
+
}>;
|
|
18
|
+
menuAriaProps: import("vue").ComputedRef<{
|
|
19
|
+
id: string;
|
|
20
|
+
role: string;
|
|
21
|
+
'aria-label': string | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getUid } from "../../utils/Commons/getCurrentInstance.util.js";
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
export function usePopupDialogAria(name, label, expanded) {
|
|
4
|
+
const menuId = `${name}-menu-${getUid()}`;
|
|
5
|
+
const comboboxAriaAttrs = computed(() => ({
|
|
6
|
+
role: "combobox",
|
|
7
|
+
"aria-haspopup": "dialog",
|
|
8
|
+
"aria-controls": menuId,
|
|
9
|
+
"aria-expanded": expanded.value ? "true" : "false"
|
|
10
|
+
}));
|
|
11
|
+
const menuAriaProps = computed(() => ({
|
|
12
|
+
id: menuId,
|
|
13
|
+
role: "dialog",
|
|
14
|
+
"aria-label": label()
|
|
15
|
+
}));
|
|
16
|
+
return { comboboxAriaAttrs, menuAriaProps };
|
|
17
|
+
}
|