@knime/kds-components 0.17.2 → 0.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/dist/buttons/KdsMenuButton/KdsMenuButton.vue.d.ts.map +1 -1
- package/dist/forms/_helper/List/ListContainer/KdsListContainer.vue.d.ts +3 -2
- package/dist/forms/_helper/List/ListContainer/KdsListContainer.vue.d.ts.map +1 -1
- package/dist/forms/_helper/List/ListContainer/types.d.ts +2 -0
- package/dist/forms/_helper/List/ListContainer/types.d.ts.map +1 -1
- package/dist/forms/inputs/BaseInput.vue.d.ts +17 -0
- package/dist/forms/inputs/BaseInput.vue.d.ts.map +1 -1
- package/dist/forms/inputs/DateInput/KdsDateInput.vue.d.ts +16 -1
- package/dist/forms/inputs/DateInput/KdsDateInput.vue.d.ts.map +1 -1
- package/dist/forms/inputs/NumberInput/KdsNumberInput.vue.d.ts.map +1 -1
- package/dist/forms/inputs/SearchInput/KdsSearchInput.vue.d.ts.map +1 -1
- package/dist/forms/selects/Dropdown/DropdownContainer.vue.d.ts +21 -4
- package/dist/forms/selects/Dropdown/DropdownContainer.vue.d.ts.map +1 -1
- package/dist/forms/selects/Dropdown/MultiSelectDropdownContainer.vue.d.ts +21 -4
- package/dist/forms/selects/Dropdown/MultiSelectDropdownContainer.vue.d.ts.map +1 -1
- package/dist/index.css +43 -43
- package/dist/index.js +115 -48
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.css
CHANGED
|
@@ -953,7 +953,7 @@ html.kds-legacy {
|
|
|
953
953
|
}
|
|
954
954
|
|
|
955
955
|
.kds-list-container {
|
|
956
|
-
&[data-v-
|
|
956
|
+
&[data-v-9b505d0b] {
|
|
957
957
|
position: relative;
|
|
958
958
|
display: flex;
|
|
959
959
|
flex-direction: column;
|
|
@@ -962,17 +962,17 @@ html.kds-legacy {
|
|
|
962
962
|
padding: var(--kds-spacing-container-0-25x);
|
|
963
963
|
overflow-y: auto;
|
|
964
964
|
}
|
|
965
|
-
&.standalone[data-v-
|
|
965
|
+
&.standalone[data-v-9b505d0b] {
|
|
966
966
|
border: var(--kds-border-base-subtle);
|
|
967
967
|
border-radius: var(--kds-border-radius-container-0-31x);
|
|
968
968
|
}
|
|
969
|
-
&[data-v-
|
|
969
|
+
&[data-v-9b505d0b]:focus-visible {
|
|
970
970
|
outline: var(--kds-border-action-focused);
|
|
971
971
|
outline-offset: var(--kds-spacing-offset-focus);
|
|
972
972
|
border-radius: var(--kds-border-radius-container-0-31x);
|
|
973
973
|
}
|
|
974
974
|
}
|
|
975
|
-
.kds-list-container-empty[data-v-
|
|
975
|
+
.kds-list-container-empty[data-v-9b505d0b] {
|
|
976
976
|
display: flex;
|
|
977
977
|
flex: 1;
|
|
978
978
|
align-items: center;
|
|
@@ -1074,7 +1074,7 @@ html.kds-legacy {
|
|
|
1074
1074
|
box-shadow: var(--kds-elevation-level-3);
|
|
1075
1075
|
}
|
|
1076
1076
|
|
|
1077
|
-
.kds-menu-container[data-v-
|
|
1077
|
+
.kds-menu-container[data-v-be36bcd4] {
|
|
1078
1078
|
max-width: var(--kds-dimension-component-width-20x);
|
|
1079
1079
|
background-color: var(--kds-color-surface-default);
|
|
1080
1080
|
border-radius: var(--kds-border-radius-container-0-50x);
|
|
@@ -1465,7 +1465,7 @@ html.kds-legacy {
|
|
|
1465
1465
|
}
|
|
1466
1466
|
|
|
1467
1467
|
.container {
|
|
1468
|
-
&[data-v-
|
|
1468
|
+
&[data-v-d8e771c0] {
|
|
1469
1469
|
display: flex;
|
|
1470
1470
|
align-items: center;
|
|
1471
1471
|
width: 100%;
|
|
@@ -1477,46 +1477,46 @@ html.kds-legacy {
|
|
|
1477
1477
|
border: var(--kds-border-action-input);
|
|
1478
1478
|
border-radius: var(--kds-border-radius-container-0-37x);
|
|
1479
1479
|
}
|
|
1480
|
-
&[data-v-
|
|
1480
|
+
&[data-v-d8e771c0]:has(input:focus:not(:disabled)) {
|
|
1481
1481
|
outline: var(--kds-border-action-focused);
|
|
1482
1482
|
outline-offset: var(--kds-spacing-offset-focus);
|
|
1483
1483
|
}
|
|
1484
|
-
&[data-v-
|
|
1484
|
+
&[data-v-d8e771c0]:has(.input-field:hover:not(:disabled, :focus)) {
|
|
1485
1485
|
background: var(--kds-color-background-input-hover);
|
|
1486
1486
|
}
|
|
1487
|
-
&.error[data-v-
|
|
1487
|
+
&.error[data-v-d8e771c0] {
|
|
1488
1488
|
border: var(--kds-border-action-error);
|
|
1489
1489
|
}
|
|
1490
|
-
&.disabled[data-v-
|
|
1490
|
+
&.disabled[data-v-d8e771c0] {
|
|
1491
1491
|
cursor: default;
|
|
1492
1492
|
border: var(--kds-border-action-disabled);
|
|
1493
1493
|
border-color: var(--kds-color-border-disabled);
|
|
1494
1494
|
}
|
|
1495
1495
|
}
|
|
1496
1496
|
.icon-wrapper {
|
|
1497
|
-
&[data-v-
|
|
1497
|
+
&[data-v-d8e771c0] {
|
|
1498
1498
|
display: flex;
|
|
1499
1499
|
flex-shrink: 0;
|
|
1500
1500
|
align-items: center;
|
|
1501
1501
|
color: var(--kds-color-text-and-icon-subtle);
|
|
1502
1502
|
}
|
|
1503
|
-
&.leading[data-v-
|
|
1503
|
+
&.leading[data-v-d8e771c0] {
|
|
1504
1504
|
padding-left: var(--kds-spacing-container-0-12x);
|
|
1505
1505
|
}
|
|
1506
|
-
&.trailing[data-v-
|
|
1506
|
+
&.trailing[data-v-d8e771c0] {
|
|
1507
1507
|
padding-right: var(--kds-spacing-container-0-12x);
|
|
1508
1508
|
}
|
|
1509
|
-
.container.disabled &[data-v-
|
|
1509
|
+
.container.disabled &[data-v-d8e771c0] {
|
|
1510
1510
|
color: var(--kds-color-text-and-icon-disabled);
|
|
1511
1511
|
cursor: default;
|
|
1512
1512
|
}
|
|
1513
|
-
.container:focus-within &[data-v-
|
|
1514
|
-
.container:has(.input-field.has-value) &[data-v-
|
|
1513
|
+
.container:focus-within &[data-v-d8e771c0],
|
|
1514
|
+
.container:has(.input-field.has-value) &[data-v-d8e771c0] {
|
|
1515
1515
|
color: var(--kds-color-text-and-icon-neutral);
|
|
1516
1516
|
}
|
|
1517
1517
|
}
|
|
1518
1518
|
.input-field {
|
|
1519
|
-
&[data-v-
|
|
1519
|
+
&[data-v-d8e771c0] {
|
|
1520
1520
|
flex: 1 0 0;
|
|
1521
1521
|
min-width: 0;
|
|
1522
1522
|
height: var(--kds-dimension-component-height-1-75x);
|
|
@@ -1535,33 +1535,33 @@ html.kds-legacy {
|
|
|
1535
1535
|
/* hide native search cancel button on Safari/WebKit, we provide our own clearable button */
|
|
1536
1536
|
}
|
|
1537
1537
|
&[type="number"] {
|
|
1538
|
-
&[data-v-
|
|
1538
|
+
&[data-v-d8e771c0] {
|
|
1539
1539
|
appearance: textfield;
|
|
1540
1540
|
}
|
|
1541
|
-
&[data-v-
|
|
1542
|
-
&[data-v-
|
|
1541
|
+
&[data-v-d8e771c0]::-webkit-outer-spin-button,
|
|
1542
|
+
&[data-v-d8e771c0]::-webkit-inner-spin-button {
|
|
1543
1543
|
margin: 0;
|
|
1544
1544
|
appearance: none;
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
|
-
&[type="search"][data-v-
|
|
1547
|
+
&[type="search"][data-v-d8e771c0]::-webkit-search-cancel-button {
|
|
1548
1548
|
appearance: none;
|
|
1549
1549
|
}
|
|
1550
|
-
&[data-v-
|
|
1550
|
+
&[data-v-d8e771c0]::placeholder {
|
|
1551
1551
|
color: var(--kds-color-text-and-icon-subtle);
|
|
1552
1552
|
}
|
|
1553
1553
|
&:disabled {
|
|
1554
|
-
&[data-v-
|
|
1554
|
+
&[data-v-d8e771c0] {
|
|
1555
1555
|
color: var(--kds-color-text-and-icon-disabled);
|
|
1556
1556
|
cursor: default;
|
|
1557
1557
|
}
|
|
1558
|
-
&[data-v-
|
|
1558
|
+
&[data-v-d8e771c0]::placeholder {
|
|
1559
1559
|
color: var(--kds-color-text-and-icon-disabled);
|
|
1560
1560
|
}
|
|
1561
1561
|
}
|
|
1562
1562
|
}
|
|
1563
1563
|
.unit {
|
|
1564
|
-
&[data-v-
|
|
1564
|
+
&[data-v-d8e771c0] {
|
|
1565
1565
|
flex-shrink: 0;
|
|
1566
1566
|
min-width: 0;
|
|
1567
1567
|
margin: 0 var(--kds-spacing-container-0-12x);
|
|
@@ -1571,26 +1571,26 @@ html.kds-legacy {
|
|
|
1571
1571
|
color: var(--kds-color-text-and-icon-neutral);
|
|
1572
1572
|
white-space: nowrap;
|
|
1573
1573
|
}
|
|
1574
|
-
&.placeholder[data-v-
|
|
1574
|
+
&.placeholder[data-v-d8e771c0] {
|
|
1575
1575
|
color: var(--kds-color-text-and-icon-subtle);
|
|
1576
1576
|
}
|
|
1577
|
-
&.disabled[data-v-
|
|
1577
|
+
&.disabled[data-v-d8e771c0] {
|
|
1578
1578
|
color: var(--kds-color-text-and-icon-disabled);
|
|
1579
1579
|
}
|
|
1580
|
-
.container:focus-within &[data-v-
|
|
1580
|
+
.container:focus-within &[data-v-d8e771c0] {
|
|
1581
1581
|
color: var(--kds-color-text-and-icon-neutral);
|
|
1582
1582
|
}
|
|
1583
1583
|
}
|
|
1584
|
-
.clear-button[data-v-
|
|
1584
|
+
.clear-button[data-v-d8e771c0] {
|
|
1585
1585
|
margin-left: var(--kds-spacing-container-0-12x);
|
|
1586
1586
|
}
|
|
1587
|
-
.leading-slot[data-v-
|
|
1587
|
+
.leading-slot[data-v-d8e771c0] {
|
|
1588
1588
|
display: flex;
|
|
1589
1589
|
flex-shrink: 0;
|
|
1590
1590
|
gap: var(--kds-spacing-container-0-12x);
|
|
1591
1591
|
align-items: center;
|
|
1592
1592
|
}
|
|
1593
|
-
.trailing-slot[data-v-
|
|
1593
|
+
.trailing-slot[data-v-d8e771c0] {
|
|
1594
1594
|
display: flex;
|
|
1595
1595
|
flex-shrink: 0;
|
|
1596
1596
|
gap: var(--kds-spacing-container-0-12x);
|
|
@@ -3093,7 +3093,7 @@ html.kds-legacy {
|
|
|
3093
3093
|
}
|
|
3094
3094
|
}
|
|
3095
3095
|
|
|
3096
|
-
.kds-date-time-format-popover[data-v-
|
|
3096
|
+
.kds-date-time-format-popover[data-v-f75ebe1b] {
|
|
3097
3097
|
display: flex;
|
|
3098
3098
|
flex-direction: column;
|
|
3099
3099
|
gap: var(--kds-spacing-container-0-5x);
|
|
@@ -3104,14 +3104,14 @@ html.kds-legacy {
|
|
|
3104
3104
|
border-radius: var(--kds-border-radius-container-0-50x);
|
|
3105
3105
|
box-shadow: var(--kds-elevation-level-3);
|
|
3106
3106
|
}
|
|
3107
|
-
.kds-date-time-format-popover-list[data-v-
|
|
3107
|
+
.kds-date-time-format-popover-list[data-v-f75ebe1b] {
|
|
3108
3108
|
width: var(--kds-dimension-component-width-16x);
|
|
3109
3109
|
min-width: 100%;
|
|
3110
3110
|
max-width: 100%;
|
|
3111
3111
|
height: var(--kds-dimension-component-height-12x);
|
|
3112
3112
|
}
|
|
3113
3113
|
|
|
3114
|
-
.kds-search-results-container[data-v-
|
|
3114
|
+
.kds-search-results-container[data-v-df327342] {
|
|
3115
3115
|
background-color: var(--kds-color-surface-default);
|
|
3116
3116
|
border-radius: var(--kds-border-radius-container-0-50x);
|
|
3117
3117
|
box-shadow: var(--kds-elevation-level-3);
|
|
@@ -3231,23 +3231,23 @@ textarea[data-v-7a6592b5]::-webkit-scrollbar {
|
|
|
3231
3231
|
);
|
|
3232
3232
|
}
|
|
3233
3233
|
|
|
3234
|
-
.kds-dropdown-container[data-v-
|
|
3234
|
+
.kds-dropdown-container[data-v-ceeaf8b9] {
|
|
3235
3235
|
display: flex;
|
|
3236
3236
|
flex-direction: column;
|
|
3237
3237
|
background-color: var(--kds-color-surface-default);
|
|
3238
3238
|
border-radius: var(--kds-border-radius-container-0-50x);
|
|
3239
3239
|
box-shadow: var(--kds-elevation-level-3);
|
|
3240
3240
|
}
|
|
3241
|
-
.kds-dropdown-container-sticky-top[data-v-
|
|
3241
|
+
.kds-dropdown-container-sticky-top[data-v-ceeaf8b9] {
|
|
3242
3242
|
padding: var(--kds-spacing-container-0-25x);
|
|
3243
3243
|
background-color: var(--kds-color-surface-default);
|
|
3244
3244
|
border-bottom: var(--kds-border-base-subtle);
|
|
3245
3245
|
}
|
|
3246
3246
|
.kds-dropdown-container-list {
|
|
3247
|
-
&[data-v-
|
|
3247
|
+
&[data-v-ceeaf8b9] {
|
|
3248
3248
|
max-height: var(--kds-dimension-component-height-12x);
|
|
3249
3249
|
}
|
|
3250
|
-
&.multiline[data-v-
|
|
3250
|
+
&.multiline[data-v-ceeaf8b9] {
|
|
3251
3251
|
max-height: var(--kds-dimension-component-height-20x);
|
|
3252
3252
|
}
|
|
3253
3253
|
}
|
|
@@ -3294,7 +3294,7 @@ textarea[data-v-7a6592b5]::-webkit-scrollbar {
|
|
|
3294
3294
|
}
|
|
3295
3295
|
}
|
|
3296
3296
|
|
|
3297
|
-
.kds-multi-select-dropdown-options[data-v-
|
|
3297
|
+
.kds-multi-select-dropdown-options[data-v-bb63f252] {
|
|
3298
3298
|
display: flex;
|
|
3299
3299
|
flex-direction: column;
|
|
3300
3300
|
min-width: var(--kds-dimension-component-width-12x);
|
|
@@ -3302,19 +3302,19 @@ textarea[data-v-7a6592b5]::-webkit-scrollbar {
|
|
|
3302
3302
|
border-radius: var(--kds-border-radius-container-0-50x);
|
|
3303
3303
|
box-shadow: var(--kds-elevation-level-3);
|
|
3304
3304
|
}
|
|
3305
|
-
.kds-multi-select-dropdown-search[data-v-
|
|
3305
|
+
.kds-multi-select-dropdown-search[data-v-bb63f252] {
|
|
3306
3306
|
padding: var(--kds-spacing-container-0-25x);
|
|
3307
3307
|
border-bottom: var(--kds-border-base-subtle);
|
|
3308
3308
|
}
|
|
3309
3309
|
.kds-multi-select-dropdown-list {
|
|
3310
|
-
&[data-v-
|
|
3310
|
+
&[data-v-bb63f252] {
|
|
3311
3311
|
max-height: var(--kds-dimension-component-height-12x);
|
|
3312
3312
|
}
|
|
3313
|
-
&.multiline[data-v-
|
|
3313
|
+
&.multiline[data-v-bb63f252] {
|
|
3314
3314
|
max-height: var(--kds-dimension-component-height-20x);
|
|
3315
3315
|
}
|
|
3316
3316
|
}
|
|
3317
|
-
.kds-multi-select-dropdown-footer[data-v-
|
|
3317
|
+
.kds-multi-select-dropdown-footer[data-v-bb63f252] {
|
|
3318
3318
|
padding: var(--kds-spacing-container-0-25x);
|
|
3319
3319
|
border-top: var(--kds-border-base-subtle);
|
|
3320
3320
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, shallowRef, toRef, unref, createBlock, resolveDynamicComponent, createCommentVNode, normalizeStyle, useTemplateRef, createVNode, withCtx, renderSlot, mergeProps, h, useSlots, getCurrentInstance, useModel, mergeModels, useId, nextTick, Fragment, renderList, watchEffect, useAttrs, defineAsyncComponent, onBeforeUpdate, withModifiers, normalizeProps, guardReactiveProps, reactive, onMounted, onUnmounted, toRefs, inject, withKeys, withDirectives, provide, createTextVNode, isRef, resolveComponent, Transition, resolveDirective, toHandlers, vModelText, useCssVars, mergeDefaults, createSlots } from 'vue';
|
|
1
|
+
import { defineComponent, ref, watch, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, shallowRef, toRef, unref, createBlock, resolveDynamicComponent, createCommentVNode, normalizeStyle, useTemplateRef, createVNode, withCtx, renderSlot, mergeProps, h, useSlots, getCurrentInstance, useModel, mergeModels, useId, nextTick, Fragment, renderList, watchEffect, useAttrs, defineAsyncComponent, onBeforeUpdate, withModifiers, normalizeProps, guardReactiveProps, reactive, onMounted, onUnmounted, toRefs, inject, withKeys, withDirectives, provide, createTextVNode, isRef, resolveComponent, Transition, resolveDirective, toHandlers, onBeforeUnmount, vModelText, useCssVars, mergeDefaults, createSlots } from 'vue';
|
|
2
2
|
import { useLocalStorage, useDark, usePreferredDark, useResizeObserver, useMutationObserver, useElementSize } from '@vueuse/core';
|
|
3
3
|
|
|
4
4
|
import './index.css';const kdsAvatarSize = {
|
|
@@ -1468,6 +1468,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
1468
1468
|
loading: { type: Boolean, default: false },
|
|
1469
1469
|
ariaLabel: {},
|
|
1470
1470
|
controlledExternally: { type: Boolean },
|
|
1471
|
+
allowNoSelection: { type: Boolean, default: false },
|
|
1471
1472
|
role: { default: "listbox" }
|
|
1472
1473
|
},
|
|
1473
1474
|
emits: ["itemClick"],
|
|
@@ -1475,8 +1476,13 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
1475
1476
|
const props = __props;
|
|
1476
1477
|
const emit = __emit;
|
|
1477
1478
|
const idPrefix = useId();
|
|
1478
|
-
const toOptionId = (elementId) => elementId.slice(idPrefix.length + 1);
|
|
1479
1479
|
const emptyOptionId = `${idPrefix}-empty`;
|
|
1480
|
+
function toOptionId(elementId) {
|
|
1481
|
+
if (elementId === emptyOptionId) {
|
|
1482
|
+
return void 0;
|
|
1483
|
+
}
|
|
1484
|
+
return elementId?.slice(idPrefix.length + 1);
|
|
1485
|
+
}
|
|
1480
1486
|
const prefixedValues = computed(
|
|
1481
1487
|
() => (props.loading ? [] : props.possibleValues).map((o) => ({
|
|
1482
1488
|
...o,
|
|
@@ -1548,7 +1554,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
1548
1554
|
const findEnabledIndex = (id) => id === void 0 ? -1 : enabledValues.value.findIndex((o) => o.id === id);
|
|
1549
1555
|
const handleFocus = () => {
|
|
1550
1556
|
isFocused.value = true;
|
|
1551
|
-
if (activeId.value === void 0) {
|
|
1557
|
+
if (activeId.value === void 0 && !props.allowNoSelection) {
|
|
1552
1558
|
activeId.value = lastActiveId.value ?? enabledValues.value[0]?.id;
|
|
1553
1559
|
}
|
|
1554
1560
|
};
|
|
@@ -1557,46 +1563,52 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
1557
1563
|
lastActiveId.value = activeId.value;
|
|
1558
1564
|
activeId.value = void 0;
|
|
1559
1565
|
};
|
|
1566
|
+
const moveDown = (currentIndex) => {
|
|
1567
|
+
if (currentIndex < 0) {
|
|
1568
|
+
return enabledValues.value[0].id;
|
|
1569
|
+
}
|
|
1570
|
+
if (currentIndex >= enabledValues.value.length - 1) {
|
|
1571
|
+
return props.allowNoSelection ? void 0 : enabledValues.value[0].id;
|
|
1572
|
+
}
|
|
1573
|
+
return enabledValues.value[currentIndex + 1].id;
|
|
1574
|
+
};
|
|
1575
|
+
const moveUp = (currentIndex) => {
|
|
1576
|
+
if (props.allowNoSelection && currentIndex === 0) {
|
|
1577
|
+
return void 0;
|
|
1578
|
+
}
|
|
1579
|
+
if (currentIndex <= 0) {
|
|
1580
|
+
return enabledValues.value[enabledValues.value.length - 1].id;
|
|
1581
|
+
}
|
|
1582
|
+
return enabledValues.value[currentIndex - 1].id;
|
|
1583
|
+
};
|
|
1584
|
+
const isTextInput = (target) => target instanceof HTMLElement && ["INPUT", "TEXTAREA", "SELECT"].includes(target.tagName);
|
|
1560
1585
|
const handleKeydown = (event) => {
|
|
1561
1586
|
if (enabledValues.value.length === 0) {
|
|
1587
|
+
activeId.value = selectableValues.value.length === 0 ? emptyOptionId : void 0;
|
|
1562
1588
|
return;
|
|
1563
1589
|
}
|
|
1564
1590
|
const currentIndex = findEnabledIndex(activeId.value);
|
|
1565
1591
|
switch (event.key) {
|
|
1566
|
-
case "ArrowDown":
|
|
1567
|
-
|
|
1568
|
-
activeId.value = enabledValues.value[nextIndex].id;
|
|
1592
|
+
case "ArrowDown":
|
|
1593
|
+
activeId.value = moveDown(currentIndex);
|
|
1569
1594
|
scrollToView();
|
|
1570
1595
|
event.preventDefault();
|
|
1571
1596
|
break;
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
const nextIndex = currentIndex <= 0 ? enabledValues.value.length - 1 : currentIndex - 1;
|
|
1575
|
-
activeId.value = enabledValues.value[nextIndex].id;
|
|
1597
|
+
case "ArrowUp":
|
|
1598
|
+
activeId.value = moveUp(currentIndex);
|
|
1576
1599
|
scrollToView();
|
|
1577
1600
|
event.preventDefault();
|
|
1578
1601
|
break;
|
|
1579
|
-
}
|
|
1580
1602
|
case "Enter":
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
}
|
|
1584
|
-
if (activeId.value) {
|
|
1585
|
-
emit("itemClick", toOptionId(activeId.value));
|
|
1586
|
-
event.preventDefault();
|
|
1587
|
-
}
|
|
1603
|
+
emit("itemClick", toOptionId(activeId.value));
|
|
1604
|
+
event.preventDefault();
|
|
1588
1605
|
break;
|
|
1589
1606
|
case " ":
|
|
1590
|
-
if (
|
|
1591
|
-
break;
|
|
1592
|
-
}
|
|
1593
|
-
if (event.target instanceof HTMLElement && ["BUTTON"].includes(event.target.tagName) && event.target.ariaExpanded === "false") {
|
|
1607
|
+
if (isTextInput(event.target)) {
|
|
1594
1608
|
break;
|
|
1595
1609
|
}
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
event.preventDefault();
|
|
1599
|
-
}
|
|
1610
|
+
emit("itemClick", toOptionId(activeId.value));
|
|
1611
|
+
event.preventDefault();
|
|
1600
1612
|
break;
|
|
1601
1613
|
case "Home":
|
|
1602
1614
|
activeId.value = enabledValues.value[0].id;
|
|
@@ -1687,7 +1699,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
1687
1699
|
}
|
|
1688
1700
|
});
|
|
1689
1701
|
|
|
1690
|
-
const KdsListContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$C, [["__scopeId", "data-v-
|
|
1702
|
+
const KdsListContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$C, [["__scopeId", "data-v-9b505d0b"]]);
|
|
1691
1703
|
|
|
1692
1704
|
const KdsListContainer$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
1693
1705
|
__proto__: null,
|
|
@@ -1803,6 +1815,9 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
1803
1815
|
};
|
|
1804
1816
|
});
|
|
1805
1817
|
const onItemClick = (itemId) => {
|
|
1818
|
+
if (!itemId) {
|
|
1819
|
+
return;
|
|
1820
|
+
}
|
|
1806
1821
|
isMenuOpen.value = false;
|
|
1807
1822
|
emit("itemClick", itemId);
|
|
1808
1823
|
};
|
|
@@ -1817,14 +1832,14 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
1817
1832
|
"aria-controls": unref(menuId),
|
|
1818
1833
|
style: popoverEl.value?.anchorStyle,
|
|
1819
1834
|
onFocus: listContainerEl.value?.handleFocus,
|
|
1820
|
-
onKeydown: listContainerEl.value?.handleKeydown,
|
|
1821
|
-
onBlur: _cache[
|
|
1822
|
-
}), null, 16, ["modelValue", "aria-expanded", "aria-controls", "style", "onFocus"
|
|
1835
|
+
onKeydown: _cache[1] || (_cache[1] = ($event) => isMenuOpen.value && listContainerEl.value?.handleKeydown),
|
|
1836
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => isMenuOpen.value = false)
|
|
1837
|
+
}), null, 16, ["modelValue", "aria-expanded", "aria-controls", "style", "onFocus"]),
|
|
1823
1838
|
createVNode(KdsPopover, {
|
|
1824
1839
|
ref_key: "popoverEl",
|
|
1825
1840
|
ref: popoverEl,
|
|
1826
1841
|
modelValue: isMenuOpen.value,
|
|
1827
|
-
"onUpdate:modelValue": _cache[
|
|
1842
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isMenuOpen.value = $event),
|
|
1828
1843
|
placement: "bottom-left",
|
|
1829
1844
|
"popover-aria-label": "Menu"
|
|
1830
1845
|
}, {
|
|
@@ -1853,7 +1868,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
1853
1868
|
}
|
|
1854
1869
|
});
|
|
1855
1870
|
|
|
1856
|
-
const KdsMenuButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$A, [["__scopeId", "data-v-
|
|
1871
|
+
const KdsMenuButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$A, [["__scopeId", "data-v-be36bcd4"]]);
|
|
1857
1872
|
|
|
1858
1873
|
const kdsButtonSize = {
|
|
1859
1874
|
XSMALL: "xsmall",
|
|
@@ -2776,7 +2791,7 @@ const _hoisted_2$a = {
|
|
|
2776
2791
|
key: 1,
|
|
2777
2792
|
class: "leading-slot"
|
|
2778
2793
|
};
|
|
2779
|
-
const _hoisted_3$8 = ["id", "value", "type", "inputmode", "placeholder", "disabled", "autocomplete", "min", "max", "step", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid", "role", "pattern", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext", "aria-activedescendant"];
|
|
2794
|
+
const _hoisted_3$8 = ["id", "value", "type", "inputmode", "placeholder", "disabled", "autocomplete", "min", "max", "step", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid", "role", "pattern", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext", "aria-activedescendant", "aria-haspopup", "aria-controls", "aria-expanded"];
|
|
2780
2795
|
const _hoisted_4$5 = ["aria-disabled"];
|
|
2781
2796
|
const _hoisted_5$3 = {
|
|
2782
2797
|
key: 4,
|
|
@@ -2793,6 +2808,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
2793
2808
|
type: { default: "text" },
|
|
2794
2809
|
min: { default: void 0 },
|
|
2795
2810
|
max: { default: void 0 },
|
|
2811
|
+
ariaExpanded: { type: Boolean, default: void 0 },
|
|
2796
2812
|
step: { default: void 0 },
|
|
2797
2813
|
placeholder: { default: void 0 },
|
|
2798
2814
|
disabled: { type: Boolean, default: false },
|
|
@@ -2810,6 +2826,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
2810
2826
|
ariaValuemax: { default: void 0 },
|
|
2811
2827
|
ariaValuetext: { default: void 0 },
|
|
2812
2828
|
ariaActivedescendant: { default: void 0 },
|
|
2829
|
+
ariaHaspopup: { default: void 0 },
|
|
2830
|
+
ariaControls: { default: void 0 },
|
|
2813
2831
|
unit: { default: void 0 },
|
|
2814
2832
|
inputmode: { default: void 0 },
|
|
2815
2833
|
clearable: { type: Boolean, default: false },
|
|
@@ -2893,6 +2911,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
2893
2911
|
"aria-valuemax": props.ariaValuemax,
|
|
2894
2912
|
"aria-valuetext": props.ariaValuetext,
|
|
2895
2913
|
"aria-activedescendant": props.ariaActivedescendant,
|
|
2914
|
+
"aria-haspopup": props.ariaHaspopup,
|
|
2915
|
+
"aria-controls": props.ariaControls,
|
|
2916
|
+
"aria-expanded": props.ariaExpanded,
|
|
2896
2917
|
class: normalizeClass({ "input-field": true, "has-value": hasValue.value }),
|
|
2897
2918
|
onInput: handleInput,
|
|
2898
2919
|
onFocus: _cache[0] || (_cache[0] = ($event) => emit("focus", $event)),
|
|
@@ -2933,7 +2954,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
2933
2954
|
}
|
|
2934
2955
|
});
|
|
2935
2956
|
|
|
2936
|
-
const BaseInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$p, [["__scopeId", "data-v-
|
|
2957
|
+
const BaseInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$p, [["__scopeId", "data-v-d8e771c0"]]);
|
|
2937
2958
|
|
|
2938
2959
|
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
2939
2960
|
__name: "KdsTextInput",
|
|
@@ -13880,14 +13901,14 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
13880
13901
|
variant: "large",
|
|
13881
13902
|
"possible-values": possibleFormats.value,
|
|
13882
13903
|
"empty-text": "No recently used formats",
|
|
13883
|
-
onItemClick: _cache[2] || (_cache[2] = ($event) => selection.value = decodeURIComponent($event))
|
|
13904
|
+
onItemClick: _cache[2] || (_cache[2] = ($event) => $event && (selection.value = decodeURIComponent($event)))
|
|
13884
13905
|
}, null, 8, ["possible-values"])
|
|
13885
13906
|
]);
|
|
13886
13907
|
};
|
|
13887
13908
|
}
|
|
13888
13909
|
});
|
|
13889
13910
|
|
|
13890
|
-
const DateTimeFormatPopover = /* @__PURE__ */ _export_sfc$1(_sfc_main$j, [["__scopeId", "data-v-
|
|
13911
|
+
const DateTimeFormatPopover = /* @__PURE__ */ _export_sfc$1(_sfc_main$j, [["__scopeId", "data-v-f75ebe1b"]]);
|
|
13891
13912
|
|
|
13892
13913
|
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
13893
13914
|
__name: "KdsDateTimeFormatInput",
|
|
@@ -14123,6 +14144,8 @@ const createKdsNumberParser = (params) => {
|
|
|
14123
14144
|
};
|
|
14124
14145
|
};
|
|
14125
14146
|
|
|
14147
|
+
const REPEAT_INITIAL_DELAY_MS = 400;
|
|
14148
|
+
const REPEAT_INTERVAL_MS = 100;
|
|
14126
14149
|
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
14127
14150
|
__name: "KdsNumberInput",
|
|
14128
14151
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -14239,14 +14262,43 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
14239
14262
|
localValue.value = value;
|
|
14240
14263
|
modelValue.value = numberParser.value.parseFromInput(value);
|
|
14241
14264
|
};
|
|
14265
|
+
const baseInput = useTemplateRef("baseInput");
|
|
14266
|
+
let repeatTimer = null;
|
|
14267
|
+
let isStepping = false;
|
|
14242
14268
|
const handleBlur = () => {
|
|
14269
|
+
if (isStepping) {
|
|
14270
|
+
baseInput.value?.focus();
|
|
14271
|
+
return;
|
|
14272
|
+
}
|
|
14243
14273
|
isFocused.value = false;
|
|
14244
14274
|
const parsed = numberParser.value.parseFromInput(localValue.value);
|
|
14245
14275
|
const normalized = clamp(parsed);
|
|
14246
14276
|
modelValue.value = normalized;
|
|
14247
14277
|
localValue.value = numberParser.value.formatForDisplay(normalized);
|
|
14248
14278
|
};
|
|
14249
|
-
const
|
|
14279
|
+
const stopRepeating = () => {
|
|
14280
|
+
if (repeatTimer !== null) {
|
|
14281
|
+
clearTimeout(repeatTimer);
|
|
14282
|
+
repeatTimer = null;
|
|
14283
|
+
}
|
|
14284
|
+
isStepping = false;
|
|
14285
|
+
};
|
|
14286
|
+
const startRepeating = (direction) => {
|
|
14287
|
+
stopRepeating();
|
|
14288
|
+
isStepping = true;
|
|
14289
|
+
adjustByStep(direction);
|
|
14290
|
+
repeatTimer = setTimeout(function tick() {
|
|
14291
|
+
adjustByStep(direction);
|
|
14292
|
+
repeatTimer = setTimeout(tick, REPEAT_INTERVAL_MS);
|
|
14293
|
+
}, REPEAT_INITIAL_DELAY_MS);
|
|
14294
|
+
};
|
|
14295
|
+
onBeforeUnmount(stopRepeating);
|
|
14296
|
+
const handleButtonClick = (direction, event) => {
|
|
14297
|
+
if (event.detail !== 0) {
|
|
14298
|
+
return;
|
|
14299
|
+
}
|
|
14300
|
+
adjustByStep(direction);
|
|
14301
|
+
};
|
|
14250
14302
|
__expose({
|
|
14251
14303
|
focus: () => baseInput.value?.focus()
|
|
14252
14304
|
});
|
|
@@ -14259,7 +14311,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
14259
14311
|
}, slotProps, {
|
|
14260
14312
|
"model-value": localValue.value,
|
|
14261
14313
|
type: "text",
|
|
14262
|
-
inputmode: props.step
|
|
14314
|
+
inputmode: Number.isInteger(props.step) ? "numeric" : "decimal",
|
|
14263
14315
|
placeholder: props.placeholder,
|
|
14264
14316
|
disabled: props.disabled,
|
|
14265
14317
|
error: props.error,
|
|
@@ -14272,7 +14324,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
14272
14324
|
"aria-valuetext": ariaValuetext.value,
|
|
14273
14325
|
"onUpdate:modelValue": handleUpdateModelValue,
|
|
14274
14326
|
onKeydown: handleKeydown,
|
|
14275
|
-
onFocus: _cache[
|
|
14327
|
+
onFocus: _cache[4] || (_cache[4] = ($event) => isFocused.value = true),
|
|
14276
14328
|
onBlur: handleBlur
|
|
14277
14329
|
}), {
|
|
14278
14330
|
trailing: withCtx(() => [
|
|
@@ -14283,7 +14335,11 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
14283
14335
|
"leading-icon": "minus",
|
|
14284
14336
|
"aria-label": `Decrease ${props.label ?? props.ariaLabel}`,
|
|
14285
14337
|
disabled: !canDecrease.value,
|
|
14286
|
-
onClick: _cache[0] || (_cache[0] = ($event) =>
|
|
14338
|
+
onClick: _cache[0] || (_cache[0] = ($event) => handleButtonClick(-1, $event)),
|
|
14339
|
+
onPointerdown: _cache[1] || (_cache[1] = ($event) => startRepeating(-1)),
|
|
14340
|
+
onPointerup: stopRepeating,
|
|
14341
|
+
onPointerleave: stopRepeating,
|
|
14342
|
+
onPointercancel: stopRepeating
|
|
14287
14343
|
}, null, 8, ["aria-label", "disabled"]),
|
|
14288
14344
|
createVNode(_sfc_main$L, {
|
|
14289
14345
|
type: "button",
|
|
@@ -14292,7 +14348,11 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
14292
14348
|
"leading-icon": "plus",
|
|
14293
14349
|
"aria-label": `Increase ${props.label ?? props.ariaLabel}`,
|
|
14294
14350
|
disabled: !canIncrease.value,
|
|
14295
|
-
onClick: _cache[
|
|
14351
|
+
onClick: _cache[2] || (_cache[2] = ($event) => handleButtonClick(1, $event)),
|
|
14352
|
+
onPointerdown: _cache[3] || (_cache[3] = ($event) => startRepeating(1)),
|
|
14353
|
+
onPointerup: stopRepeating,
|
|
14354
|
+
onPointerleave: stopRepeating,
|
|
14355
|
+
onPointercancel: stopRepeating
|
|
14296
14356
|
}, null, 8, ["aria-label", "disabled"])
|
|
14297
14357
|
]),
|
|
14298
14358
|
_: 1
|
|
@@ -14553,6 +14613,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
14553
14613
|
const popoverEl = useTemplateRef("popover");
|
|
14554
14614
|
const listContainerEl = useTemplateRef("listContainer");
|
|
14555
14615
|
const resultsOpen = ref(false);
|
|
14616
|
+
const resultsId = useId();
|
|
14556
14617
|
const onKeyDown = (event) => {
|
|
14557
14618
|
if (resultsOpen.value) {
|
|
14558
14619
|
listContainerEl.value?.handleKeydown(event);
|
|
@@ -14622,12 +14683,16 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
14622
14683
|
"leading-icon": "search",
|
|
14623
14684
|
clearable: true,
|
|
14624
14685
|
style: popoverEl.value?.anchorStyle,
|
|
14686
|
+
role: __props.results ? "combobox" : void 0,
|
|
14625
14687
|
"aria-activedescendant": resultsOpen.value ? listContainerEl.value?.activeDescendant : void 0,
|
|
14688
|
+
"aria-haspopup": __props.results ? "listbox" : void 0,
|
|
14689
|
+
"aria-controls": __props.results ? unref(resultsId) : void 0,
|
|
14690
|
+
"aria-expanded": __props.results ? resultsOpen.value : void 0,
|
|
14626
14691
|
onKeydown: onKeyDown,
|
|
14627
14692
|
onFocus,
|
|
14628
14693
|
onBlur,
|
|
14629
14694
|
onClick
|
|
14630
|
-
}), null, 16, ["modelValue", "placeholder", "disabled", "error", "autocomplete", "style", "aria-activedescendant"]),
|
|
14695
|
+
}), null, 16, ["modelValue", "placeholder", "disabled", "error", "autocomplete", "style", "role", "aria-activedescendant", "aria-haspopup", "aria-controls", "aria-expanded"]),
|
|
14631
14696
|
__props.results ? (openBlock(), createBlock(unref(KdsPopover), {
|
|
14632
14697
|
key: 0,
|
|
14633
14698
|
ref: "popover",
|
|
@@ -14643,14 +14708,16 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
14643
14708
|
style: normalizeStyle(maxHeightStyle.value)
|
|
14644
14709
|
}, [
|
|
14645
14710
|
createVNode(unref(KdsListContainer), {
|
|
14711
|
+
id: unref(resultsId),
|
|
14646
14712
|
ref: "listContainer",
|
|
14647
14713
|
variant: "large",
|
|
14648
14714
|
"possible-values": __props.results,
|
|
14649
14715
|
"controlled-externally": "",
|
|
14716
|
+
"allow-no-selection": "",
|
|
14650
14717
|
"empty-text": "No search results",
|
|
14651
14718
|
"aria-label": "Search results list",
|
|
14652
14719
|
onItemClick: onResultClick
|
|
14653
|
-
}, null, 8, ["possible-values"])
|
|
14720
|
+
}, null, 8, ["id", "possible-values"])
|
|
14654
14721
|
], 4)
|
|
14655
14722
|
]),
|
|
14656
14723
|
_: 1
|
|
@@ -14662,7 +14729,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
14662
14729
|
}
|
|
14663
14730
|
});
|
|
14664
14731
|
|
|
14665
|
-
const KdsSearchInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$f, [["__scopeId", "data-v-
|
|
14732
|
+
const KdsSearchInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$f, [["__scopeId", "data-v-df327342"]]);
|
|
14666
14733
|
|
|
14667
14734
|
const _hoisted_1$c = ["rows", "placeholder", "disabled", "autocomplete"];
|
|
14668
14735
|
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
@@ -14938,14 +15005,14 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
14938
15005
|
"empty-text": props.emptyText,
|
|
14939
15006
|
"controlled-externally": "",
|
|
14940
15007
|
"aria-label": "Dropdown options",
|
|
14941
|
-
onItemClick: _cache[4] || (_cache[4] = ($event) => modelValue.value = $event)
|
|
15008
|
+
onItemClick: _cache[4] || (_cache[4] = ($event) => $event && (modelValue.value = $event))
|
|
14942
15009
|
}, null, 8, ["class", "possible-values", "loading", "empty-text"])
|
|
14943
15010
|
]);
|
|
14944
15011
|
};
|
|
14945
15012
|
}
|
|
14946
15013
|
});
|
|
14947
15014
|
|
|
14948
|
-
const DropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["__scopeId", "data-v-
|
|
15015
|
+
const DropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["__scopeId", "data-v-ceeaf8b9"]]);
|
|
14949
15016
|
|
|
14950
15017
|
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
14951
15018
|
__name: "KdsDropdown",
|
|
@@ -15231,7 +15298,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
15231
15298
|
"empty-text": props.emptyText,
|
|
15232
15299
|
"controlled-externally": "",
|
|
15233
15300
|
"aria-label": "Dropdown options",
|
|
15234
|
-
onItemClick
|
|
15301
|
+
onItemClick: _cache[4] || (_cache[4] = ($event) => $event && onItemClick($event))
|
|
15235
15302
|
}, null, 8, ["class", "possible-values", "loading", "empty-text"]),
|
|
15236
15303
|
!props.loading && visibleEnabledIds.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
|
|
15237
15304
|
createVNode(unref(KdsListItemButton), {
|
|
@@ -15246,7 +15313,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
15246
15313
|
}
|
|
15247
15314
|
});
|
|
15248
15315
|
|
|
15249
|
-
const MultiSelectDropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["__scopeId", "data-v-
|
|
15316
|
+
const MultiSelectDropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["__scopeId", "data-v-bb63f252"]]);
|
|
15250
15317
|
|
|
15251
15318
|
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
15252
15319
|
__name: "KdsMultiSelectDropdown",
|