@fastkit/vui 0.8.7 → 0.8.10

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/vui.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { createPropsOptions, createFormControlSettings, defineSlotsProps, useFormControl, VTooltip, renderSlotOrEmpty, createFormSelectorSettings, createFormControlProps, useFormSelectorControl, resolveVNodeChildOrSlots, createFormSelectorItemSettings, useFormSelectorItemControl, createFormSelectorItemGroupProps, useFormSelectorItemGroupControl, useParentFormNode, VMenu, createTextInputSettings, useTextInputControl, createTextareaSettings, useTextareaControl, createFormSettings, useForm, getDocumentScroller, useVScrollerRef, VScroller, useInjectTheme, VStackRoot, resolveVStackDynamicInput, VueColorSchemePlugin, installVueStackPlugin } from '@fastkit/vue-kit';
1
+ import { createPropsOptions, createFormControlSettings, defineSlotsProps, useFormControl, VTooltip, renderSlotOrEmpty, createFormSelectorSettings, createFormControlProps, useFormSelectorControl, resolveVNodeChildOrSlots, createFormSelectorItemSettings, useFormSelectorItemControl, createFormSelectorItemGroupProps, useFormSelectorItemGroupControl, useParentFormNode, useKeybord, VMenu, createTextInputSettings, useTextInputControl, createTextareaSettings, useTextareaControl, createFormSettings, useForm, getDocumentScroller, useVScrollerRef, VScroller, useInjectTheme, VStackRoot, resolveVStackDynamicInput, VueColorSchemePlugin, installVueStackPlugin } from '@fastkit/vue-kit';
2
2
  export * from '@fastkit/vue-kit';
3
3
  export { VDialog, VMenu, VSnackbar, VTooltip } from '@fastkit/vue-kit';
4
- import { inject, computed, provide, createVNode, mergeProps, defineComponent, isVNode, ref, watch, onMounted, onBeforeUnmount, cloneVNode, withDirectives, createTextVNode, Fragment, vShow, onBeforeUpdate, vModelSelect, Transition, reactive } from 'vue';
4
+ import { inject, computed, provide, createVNode, mergeProps, defineComponent, Fragment, isVNode, ref, watch, onMounted, onBeforeUnmount, cloneVNode, withDirectives, createTextVNode, vShow, onBeforeUpdate, vModelSelect, nextTick, Transition, reactive } from 'vue';
5
5
  import { useRouter, RouterLink, useLink, useRoute } from 'vue-router';
6
6
  import { createPropsOptions as createPropsOptions$1, renderSlotOrEmpty as renderSlotOrEmpty$1, defineSlotsProps as defineSlotsProps$1, htmlAttributesPropOptions, navigationableInheritProps, useNavigationable, VLink, isFragment, rawNumberPropType, resolveNumberish, resizeDirectiveArgument, VExpandTransition, LocationService, setDefaultRouterLink } from '@fastkit/vue-utils';
7
7
  import { getDocumentScroller as getDocumentScroller$1 } from '@fastkit/vue-scroller';
@@ -404,19 +404,24 @@ function defineFormSelectorComponent(opts) {
404
404
  "indeterminate": true,
405
405
  "class": "mr-1",
406
406
  "size": CONTROL_LOADING_SPINNER_SIZES[this.size || 'md']
407
- }, null), this.loadingMessageRef]), this.propItems.map(attrs => {
408
- const selected = selectorControl.isSelected(attrs.value);
409
- return itemRenderer({
410
- selected,
411
- control: selectorControl,
412
- attrs: { ...attrs,
413
- modelValue: selected,
414
- key: attrs.value
415
- },
416
- slots: {
417
- default: () => attrs.label(this.selectorControl)
418
- }
419
- });
407
+ }, null), this.loadingMessageRef]), this.propGroups.map(group => {
408
+ const {
409
+ items
410
+ } = group;
411
+ return createVNode(Fragment, null, [items.map(attrs => {
412
+ const selected = selectorControl.isSelected(attrs.value);
413
+ return itemRenderer({
414
+ selected,
415
+ control: selectorControl,
416
+ attrs: { ...attrs,
417
+ modelValue: selected,
418
+ key: attrs.value
419
+ },
420
+ slots: {
421
+ default: () => attrs.label(this.selectorControl)
422
+ }
423
+ });
424
+ })]);
420
425
  }), renderSlotOrEmpty(this.$slots, 'default')])
421
426
  });
422
427
  }
@@ -441,7 +446,7 @@ function useElevation(props, opts = {}) {
441
446
  };
442
447
  }
443
448
 
444
- function _isSlot$e(s) {
449
+ function _isSlot$f(s) {
445
450
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
446
451
  }
447
452
 
@@ -462,7 +467,7 @@ const VSkeltonLoaderBone = defineComponent({
462
467
  const TagName = props.tag;
463
468
  return createVNode(TagName, mergeProps(ctx.attrs, {
464
469
  "class": "v-skelton-loader-bone"
465
- }), _isSlot$e(_slot = renderSlotOrEmpty$1(ctx.slots)) ? _slot : {
470
+ }), _isSlot$f(_slot = renderSlotOrEmpty$1(ctx.slots)) ? _slot : {
466
471
  default: () => [_slot]
467
472
  });
468
473
  };
@@ -1285,7 +1290,7 @@ const VButtonGroup = defineComponent({
1285
1290
 
1286
1291
  });
1287
1292
 
1288
- function _isSlot$d(s) {
1293
+ function _isSlot$e(s) {
1289
1294
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
1290
1295
  }
1291
1296
 
@@ -1534,7 +1539,7 @@ const VPagination = defineComponent({
1534
1539
  "class": classes,
1535
1540
  "to": to,
1536
1541
  "key": key
1537
- }, _isSlot$d(children) ? children : {
1542
+ }, _isSlot$e(children) ? children : {
1538
1543
  default: () => [children]
1539
1544
  });
1540
1545
  } else {
@@ -1690,7 +1695,7 @@ const VDrawerLayout = defineComponent({
1690
1695
 
1691
1696
  });
1692
1697
 
1693
- function _isSlot$c(s) {
1698
+ function _isSlot$d(s) {
1694
1699
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
1695
1700
  }
1696
1701
 
@@ -1727,7 +1732,7 @@ const VHero = defineComponent({
1727
1732
  }, {
1728
1733
  default: () => [createVNode(HTagName, {
1729
1734
  "class": "v-hero__title"
1730
- }, _isSlot$c(_slot = renderSlotOrEmpty$1(ctx.slots, 'default')) ? _slot : {
1735
+ }, _isSlot$d(_slot = renderSlotOrEmpty$1(ctx.slots, 'default')) ? _slot : {
1731
1736
  default: () => [_slot]
1732
1737
  }), adornment && createVNode("div", {
1733
1738
  "class": "v-hero__adornment"
@@ -1739,7 +1744,7 @@ const VHero = defineComponent({
1739
1744
 
1740
1745
  });
1741
1746
 
1742
- function _isSlot$b(s) {
1747
+ function _isSlot$c(s) {
1743
1748
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
1744
1749
  }
1745
1750
 
@@ -1780,7 +1785,7 @@ function renderNavigationItemInput(input, extraProps) {
1780
1785
  } = resolveNavigationItemInput(input);
1781
1786
  return createVNode(VNavigationItem, { ...props,
1782
1787
  ...extraProps
1783
- }, _isSlot$b(label) ? label : {
1788
+ }, _isSlot$c(label) ? label : {
1784
1789
  default: () => [label]
1785
1790
  });
1786
1791
  }
@@ -1935,7 +1940,7 @@ const VNavigationItem = defineComponent({
1935
1940
  "class": ['v-navigation-item', classes.value],
1936
1941
  "onClick": onClick,
1937
1942
  "onChangeActive": onChangeActive
1938
- }), _isSlot$b(_slot = renderSlotOrEmpty$1(ctx.slots, 'default')) ? _slot : {
1943
+ }), _isSlot$c(_slot = renderSlotOrEmpty$1(ctx.slots, 'default')) ? _slot : {
1939
1944
  default: () => [_slot]
1940
1945
  }), _children && createVNode(VExpandTransition, null, {
1941
1946
  default: () => [withDirectives(createVNode("div", {
@@ -2119,7 +2124,7 @@ const VCheckbox = defineComponent({
2119
2124
 
2120
2125
  });
2121
2126
 
2122
- function _isSlot$a(s) {
2127
+ function _isSlot$b(s) {
2123
2128
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
2124
2129
  }
2125
2130
 
@@ -2131,7 +2136,7 @@ const VCheckboxGroup = defineFormSelectorComponent({
2131
2136
  itemRenderer: ({
2132
2137
  attrs,
2133
2138
  slots
2134
- }) => createVNode(VCheckbox, attrs, _isSlot$a(slots) ? slots : {
2139
+ }) => createVNode(VCheckbox, attrs, _isSlot$b(slots) ? slots : {
2135
2140
  default: () => [slots]
2136
2141
  })
2137
2142
  });
@@ -2183,7 +2188,7 @@ const VRadio = defineComponent({
2183
2188
 
2184
2189
  });
2185
2190
 
2186
- function _isSlot$9(s) {
2191
+ function _isSlot$a(s) {
2187
2192
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
2188
2193
  }
2189
2194
 
@@ -2194,7 +2199,7 @@ const VRadioGroup = defineFormSelectorComponent({
2194
2199
  itemRenderer: ({
2195
2200
  attrs,
2196
2201
  slots
2197
- }) => createVNode(VRadio, attrs, _isSlot$9(slots) ? slots : {
2202
+ }) => createVNode(VRadio, attrs, _isSlot$a(slots) ? slots : {
2198
2203
  default: () => [slots]
2199
2204
  })
2200
2205
  });
@@ -2256,7 +2261,7 @@ const VSwitch = defineComponent({
2256
2261
 
2257
2262
  });
2258
2263
 
2259
- function _isSlot$8(s) {
2264
+ function _isSlot$9(s) {
2260
2265
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
2261
2266
  }
2262
2267
 
@@ -2268,7 +2273,7 @@ const VSwitchGroup = defineFormSelectorComponent({
2268
2273
  itemRenderer: ({
2269
2274
  attrs,
2270
2275
  slots
2271
- }) => createVNode(VSwitch, attrs, _isSlot$8(slots) ? slots : {
2276
+ }) => createVNode(VSwitch, attrs, _isSlot$9(slots) ? slots : {
2272
2277
  default: () => [slots]
2273
2278
  })
2274
2279
  });
@@ -2307,10 +2312,14 @@ const VOption = defineComponent({
2307
2312
  selectorItemControl,
2308
2313
  classes
2309
2314
  } = this;
2310
- return createVNode("label", {
2315
+ return createVNode("label", mergeProps({
2311
2316
  "class": classes,
2312
- "onClick": selectorItemControl.handleClickElement
2313
- }, [createVNode("span", {
2317
+ "onClick": selectorItemControl.handleClickElement,
2318
+ "tabindex": selectorItemControl.tabindex,
2319
+ "data-value": selectorItemControl.propValue
2320
+ }, {
2321
+ 'aria-disabled': selectorItemControl.isDisabled
2322
+ }), [createVNode("span", {
2314
2323
  "class": "v-option__label"
2315
2324
  }, [renderSlotOrEmpty(this.$slots, 'default')])]);
2316
2325
  }
@@ -2464,6 +2473,13 @@ const VControlField = defineComponent({
2464
2473
 
2465
2474
  });
2466
2475
 
2476
+ function _isSlot$8(s) {
2477
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
2478
+ }
2479
+
2480
+ const ARROW_KEY_TYPES = useKeybord.Key(['ArrowUp', 'ArrowDown']);
2481
+ const CHOICE_KEY_TYPES = useKeybord.Key(['Enter', ' ']);
2482
+ const KEYBORD_EVENT_TYPES = useKeybord.Key([...ARROW_KEY_TYPES, ...CHOICE_KEY_TYPES]);
2467
2483
  const {
2468
2484
  props: props$3,
2469
2485
  emits: emits$3
@@ -2485,6 +2501,7 @@ const VSelect = defineComponent({
2485
2501
  emits: emits$3,
2486
2502
 
2487
2503
  setup(props, ctx) {
2504
+ const menuRef = ref(null);
2488
2505
  const menuOpened = ref(false);
2489
2506
 
2490
2507
  const showMenu = () => {
@@ -2547,6 +2564,107 @@ const VSelect = defineComponent({
2547
2564
  return children;
2548
2565
  };
2549
2566
 
2567
+ const clearKeyFocused = () => {
2568
+ const menu = menuRef.value;
2569
+ if (!menu) return;
2570
+ const bodyEl = menu.stackMenuControl.bodyRef.value;
2571
+ if (!bodyEl) return;
2572
+ const els = Array.from(bodyEl.querySelectorAll('.v-option'));
2573
+ els.forEach(el => el.classList.remove('v-option--key-focused'));
2574
+ };
2575
+
2576
+ const getItemElements = () => {
2577
+ const menu = menuRef.value;
2578
+ if (!menu) return;
2579
+ const bodyEl = menu.stackMenuControl.bodyRef.value;
2580
+ if (!bodyEl) return;
2581
+ const els = Array.from(bodyEl.querySelectorAll('.v-option')).filter(el => {
2582
+ if (el.tabIndex === -1) return false;
2583
+ const disabled = el.getAttribute('disabled');
2584
+ const ariaDisabled = el.getAttribute('aria-disabled');
2585
+ if (ariaDisabled === 'true') return false;
2586
+ return disabled == null || disabled === '';
2587
+ });
2588
+ if (!els.length) return;
2589
+ return els;
2590
+ };
2591
+
2592
+ const arrowKeyHandler = ev => {
2593
+ const {
2594
+ key
2595
+ } = ev;
2596
+ if (!menuOpened.value || !ARROW_KEY_TYPES.includes(key)) return;
2597
+ const els = getItemElements();
2598
+ if (!els) return;
2599
+ const currentEl = els.find(el => el.classList.contains('v-option--key-focused'));
2600
+ const currentIndex = currentEl && els.indexOf(currentEl);
2601
+ let nextIndex;
2602
+ const {
2603
+ length
2604
+ } = els;
2605
+ const isUp = key === 'ArrowUp';
2606
+
2607
+ if (currentIndex == null) {
2608
+ nextIndex = isUp ? length - 1 : 0;
2609
+ } else {
2610
+ const shiftAmount = key === 'ArrowUp' ? -1 : 1;
2611
+ nextIndex = currentIndex + shiftAmount;
2612
+
2613
+ if (nextIndex < 0) {
2614
+ nextIndex = length - 1;
2615
+ } else if (nextIndex >= length) {
2616
+ nextIndex = 0;
2617
+ }
2618
+ }
2619
+
2620
+ const nextEl = els[nextIndex];
2621
+
2622
+ if (nextEl) {
2623
+ clearKeyFocused();
2624
+ nextEl.classList.add('v-option--key-focused');
2625
+ nextEl.scrollIntoView({
2626
+ block: 'nearest',
2627
+ inline: 'nearest',
2628
+ behavior: 'smooth'
2629
+ });
2630
+ ev.preventDefault();
2631
+ }
2632
+ };
2633
+
2634
+ const choiceKeyHandler = ev => {
2635
+ const {
2636
+ key
2637
+ } = ev;
2638
+ if (!menuOpened.value || !CHOICE_KEY_TYPES.includes(key)) return;
2639
+ const els = getItemElements();
2640
+ if (!els) return;
2641
+ const currentEl = els.find(el => el.classList.contains('v-option--key-focused'));
2642
+
2643
+ if (currentEl) {
2644
+ const ev = new MouseEvent('click', {
2645
+ view: window,
2646
+ bubbles: true,
2647
+ cancelable: true
2648
+ });
2649
+ currentEl.dispatchEvent(ev);
2650
+ ev.preventDefault();
2651
+ nextTick(() => {
2652
+ currentEl.classList.add('v-option--key-focused');
2653
+ });
2654
+ }
2655
+ };
2656
+
2657
+ const keybordEventHandler = ev => {
2658
+ if (ARROW_KEY_TYPES.includes(ev.key)) return arrowKeyHandler(ev);
2659
+ if (CHOICE_KEY_TYPES.includes(ev.key)) return choiceKeyHandler(ev);
2660
+ };
2661
+
2662
+ useKeybord([{
2663
+ key: KEYBORD_EVENT_TYPES,
2664
+ handler: keybordEventHandler
2665
+ }], {
2666
+ autorun: true
2667
+ });
2550
2668
  return { ...inputControl.expose(),
2551
2669
  ...control,
2552
2670
  iconName,
@@ -2555,7 +2673,9 @@ const VSelect = defineComponent({
2555
2673
  focus,
2556
2674
  showMenu,
2557
2675
  closeMenu,
2558
- renderSelections
2676
+ renderSelections,
2677
+ menuRef: () => menuRef,
2678
+ clearKeyFocused
2559
2679
  };
2560
2680
  },
2561
2681
 
@@ -2567,18 +2687,29 @@ const VSelect = defineComponent({
2567
2687
  selectedItems
2568
2688
  } = this;
2569
2689
  const children = this.$slots.default && this.$slots.default() || [];
2570
- const propOptions = this.propItems.map(item => {
2571
- return createVNode(VOption, {
2690
+ const propGroups = this.propGroups.map(group => {
2691
+ let _slot;
2692
+
2693
+ return createVNode(VOptionGroup, {
2694
+ "key": group.id,
2695
+ "groupId": group.id,
2696
+ "label": group.label(selectorControl),
2697
+ "disabled": group.disabled
2698
+ }, _isSlot$8(_slot = group.items.map(item => createVNode(VOption, {
2572
2699
  "disabled": item.disabled,
2573
2700
  "value": item.value,
2574
2701
  "key": item.value
2575
2702
  }, {
2576
2703
  default: () => item.label(selectorControl)
2704
+ }))) ? _slot : {
2705
+ default: () => [_slot]
2577
2706
  });
2578
2707
  });
2579
2708
  return createVNode(VFormControl, {
2580
2709
  "nodeControl": nodeControl,
2581
- "class": ['v-select', this.classes],
2710
+ "class": ['v-select', this.classes, {
2711
+ 'v-select--multiple': this.multiple
2712
+ }],
2582
2713
  "label": this.label,
2583
2714
  "hint": this.hint,
2584
2715
  "hinttip": this.hinttip,
@@ -2594,11 +2725,13 @@ const VSelect = defineComponent({
2594
2725
  "distance": 0,
2595
2726
  "alwaysRender": true,
2596
2727
  "modelValue": this.menuOpened,
2597
- "onUpdate:modelValue": $event => this.menuOpened = $event
2728
+ "onUpdate:modelValue": $event => this.menuOpened = $event,
2729
+ "ref": this.menuRef(),
2730
+ "onClose": this.clearKeyFocused
2598
2731
  }, {
2599
2732
  default: () => [createVNode("div", {
2600
2733
  "class": ['v-select__body', this.classes]
2601
- }, [children, propOptions])],
2734
+ }, [children, propGroups])],
2602
2735
  activator: ({
2603
2736
  attrs,
2604
2737
  control
@@ -2611,6 +2744,7 @@ const VSelect = defineComponent({
2611
2744
  "endAdornment": this.endAdornment,
2612
2745
  "size": this.size,
2613
2746
  "focused": this.menuOpened,
2747
+ "autoHeight": this.multiple,
2614
2748
  "onClick": ev => {
2615
2749
  if (this.canOperation && !control.isActive) {
2616
2750
  let t = ev.target;
@@ -5610,4 +5744,4 @@ function installVuiPlugin(app, opts) {
5610
5744
  return app.use(VuiPlugin, opts);
5611
5745
  }
5612
5746
 
5613
- export { AVATAR_SIZES, CHIP_SIZES, CONTROL_FIELD_VARIANTS, CONTROL_LOADING_SPINNER_SIZES, CONTROL_SIZES, PAGINATION_ALIGNS, VApp, VAvatar, VBreadcrumbs, VBusyImage, VButton, VButtonGroup, VCard, VCardActions, VCardContent, VCheckbox, VCheckboxGroup, VChip, VContentSwitcher, VDataTable, VDrawerLayout, VForm, VFormControl, VGridContainer, VGridItem, VHero, VIcon, VListTile, VNavigation, VNavigationItem, VNumberField, VOption, VOptionGroup, VPagination, VPaper, VRadio, VRadioGroup, VSelect, VSkeltonLoaderBone, VSwitch, VSwitchGroup, VTabs, VTextField, VTextarea, VToolbar, VToolbarEdge, VToolbarMenu, VToolbarTitle, VUI_CHECKBOX_GROUP_SYMBOL, VUI_CHECKBOX_SYMBOL, VUI_FORM_SYMBOL, VUI_OPTION_SYMBOL, VUI_RADIO_GROUP_SYMBOL, VUI_RADIO_SYMBOL, VUI_SELECT_SYMBOL, VUI_SWITCH_GROUP_SYMBOL, VUI_SWITCH_SYMBOL, VUI_TEXTAREA_SYMBOL, VUI_TEXT_FIELD_SYMBOL, VUI_WYSIWYG_EDITOR_SYMBOL, VWysiwygEditor, VuiColorProviderInjectionKey, VuiControlFieldInjectionKey, VuiControlInjectionKey, VuiInjectionKey, VuiPlugin, VuiService, WysiwygBulletListTool, WysiwygColorExtension, WysiwygEditorInitializeContext, WysiwygFormatBoldTool, WysiwygFormatItalicTool, WysiwygFormatUnderlineTool, WysiwygHistoryTool, WysiwygLinkTool, WysiwygLinter, WysiwygLinterBadWords, WysiwygLinterHeadingLevel, WysiwygLinterPlugin, WysiwygLinterPunctuation, WysiwygOrderedListTool, configureDataTableDefaults, createAvatarProps, createCardProps, createChipProps, createControlFieldProviderProps, createControlProps, createElevationProps, createListTileProps, createNavigationItemProps, createPaperBaseProps, createPaperProps, createRequiredChipRenderer, createVFormProps, createWysiwygColorTool, createWysiwygExtension, defineFormSelectorComponent, iconProps, installVuiPlugin, listTileEmits, mergeVuiPluginOptions, mergeVuiServiceIconSettings, mergeVuiServiceOptions, mergeVuiServiceUISettings, paginationProps, rawIconProp, renderNavigationItemInput, resolveNavigationItemInput, resolveRawIconProp, resolveRawWysiwygEditorTools, resolveRawWysiwygExtensions, splitAttrs, useControl, useControlField, useElevation, useVui, useVuiColorProvider, vueButtonProps };
5747
+ export { ARROW_KEY_TYPES, AVATAR_SIZES, CHIP_SIZES, CHOICE_KEY_TYPES, CONTROL_FIELD_VARIANTS, CONTROL_LOADING_SPINNER_SIZES, CONTROL_SIZES, KEYBORD_EVENT_TYPES, PAGINATION_ALIGNS, VApp, VAvatar, VBreadcrumbs, VBusyImage, VButton, VButtonGroup, VCard, VCardActions, VCardContent, VCheckbox, VCheckboxGroup, VChip, VContentSwitcher, VDataTable, VDrawerLayout, VForm, VFormControl, VGridContainer, VGridItem, VHero, VIcon, VListTile, VNavigation, VNavigationItem, VNumberField, VOption, VOptionGroup, VPagination, VPaper, VRadio, VRadioGroup, VSelect, VSkeltonLoaderBone, VSwitch, VSwitchGroup, VTabs, VTextField, VTextarea, VToolbar, VToolbarEdge, VToolbarMenu, VToolbarTitle, VUI_CHECKBOX_GROUP_SYMBOL, VUI_CHECKBOX_SYMBOL, VUI_FORM_SYMBOL, VUI_OPTION_SYMBOL, VUI_RADIO_GROUP_SYMBOL, VUI_RADIO_SYMBOL, VUI_SELECT_SYMBOL, VUI_SWITCH_GROUP_SYMBOL, VUI_SWITCH_SYMBOL, VUI_TEXTAREA_SYMBOL, VUI_TEXT_FIELD_SYMBOL, VUI_WYSIWYG_EDITOR_SYMBOL, VWysiwygEditor, VuiColorProviderInjectionKey, VuiControlFieldInjectionKey, VuiControlInjectionKey, VuiInjectionKey, VuiPlugin, VuiService, WysiwygBulletListTool, WysiwygColorExtension, WysiwygEditorInitializeContext, WysiwygFormatBoldTool, WysiwygFormatItalicTool, WysiwygFormatUnderlineTool, WysiwygHistoryTool, WysiwygLinkTool, WysiwygLinter, WysiwygLinterBadWords, WysiwygLinterHeadingLevel, WysiwygLinterPlugin, WysiwygLinterPunctuation, WysiwygOrderedListTool, configureDataTableDefaults, createAvatarProps, createCardProps, createChipProps, createControlFieldProviderProps, createControlProps, createElevationProps, createListTileProps, createNavigationItemProps, createPaperBaseProps, createPaperProps, createRequiredChipRenderer, createVFormProps, createWysiwygColorTool, createWysiwygExtension, defineFormSelectorComponent, iconProps, installVuiPlugin, listTileEmits, mergeVuiPluginOptions, mergeVuiServiceIconSettings, mergeVuiServiceOptions, mergeVuiServiceUISettings, paginationProps, rawIconProp, renderNavigationItemInput, resolveNavigationItemInput, resolveRawIconProp, resolveRawWysiwygEditorTools, resolveRawWysiwygExtensions, splitAttrs, useControl, useControlField, useElevation, useVui, useVuiColorProvider, vueButtonProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastkit/vui",
3
- "version": "0.8.7",
3
+ "version": "0.8.10",
4
4
  "description": "@fastkit/vui",
5
5
  "buildOptions": {
6
6
  "name": "Vui",
@@ -32,11 +32,11 @@
32
32
  "vue": "^3.2.26"
33
33
  },
34
34
  "dependencies": {
35
- "@fastkit/color-scheme": "0.8.7",
36
- "@fastkit/icon-font": "0.8.7",
37
- "@fastkit/tiny-logger": "0.8.7",
38
- "@fastkit/vite-kit": "0.8.7",
39
- "@fastkit/vue-kit": "0.8.7",
35
+ "@fastkit/color-scheme": "0.8.10",
36
+ "@fastkit/icon-font": "0.8.10",
37
+ "@fastkit/tiny-logger": "0.8.10",
38
+ "@fastkit/vite-kit": "0.8.10",
39
+ "@fastkit/vue-kit": "0.8.10",
40
40
  "@tiptap/extension-link": "^2.0.0-beta.36",
41
41
  "@tiptap/extension-underline": "^2.0.0-beta.23",
42
42
  "@tiptap/extension-text-style": "^2.0.0-beta.23",
@@ -1,12 +1,13 @@
1
1
  @use '../../styles/core.scss';
2
2
 
3
3
  .v-option {
4
+ @include core.button-reset();
5
+
4
6
  position: relative;
5
7
  display: flex;
6
8
  width: 100%;
7
- padding: 0.375em 1em;
8
- cursor: pointer;
9
- user-select: none;
9
+ padding: 0.75em 1em;
10
+ // font-size: 0.875em;
10
11
 
11
12
  input {
12
13
  @include core.hidden-input-element;
@@ -35,7 +36,8 @@
35
36
  }
36
37
 
37
38
  &:hover,
38
- &:focus-within {
39
+ &:focus-within,
40
+ &--key-focused {
39
41
  &::before {
40
42
  opacity: 0.12;
41
43
  }
@@ -58,4 +60,15 @@
58
60
  &--has-not-value &__label {
59
61
  font-style: italic;
60
62
  }
63
+
64
+ &[disabled],
65
+ &[tabindex='-1'] {
66
+ color: var(--palette-muted);
67
+ pointer-events: none;
68
+ opacity: 0.4;
69
+
70
+ &::before {
71
+ opacity: 0 !important;
72
+ }
73
+ }
61
74
  }
@@ -42,7 +42,14 @@ export const VOption = defineComponent({
42
42
  render() {
43
43
  const { selectorItemControl, classes } = this;
44
44
  return (
45
- <label class={classes} onClick={selectorItemControl.handleClickElement}>
45
+ <label
46
+ class={classes}
47
+ onClick={selectorItemControl.handleClickElement}
48
+ tabindex={selectorItemControl.tabindex}
49
+ data-value={selectorItemControl.propValue}
50
+ {...({
51
+ 'aria-disabled': selectorItemControl.isDisabled,
52
+ } as any)}>
46
53
  <span class="v-option__label">
47
54
  {renderSlotOrEmpty(this.$slots, 'default')}
48
55
  </span>
@@ -1,3 +1,16 @@
1
1
  .v-option-group {
2
2
  display: block;
3
+
4
+ &__label {
5
+ padding: 1em;
6
+ // padding: 0.875em 1em;
7
+ font-size: 0.875em;
8
+ color: var(--palette-caption);
9
+ opacity: 0.6;
10
+ }
11
+
12
+ &--disabled &__label {
13
+ color: var(--palette-muted);
14
+ opacity: 0.4;
15
+ }
3
16
  }
@@ -58,6 +58,20 @@
58
58
  white-space: nowrap;
59
59
  vertical-align: middle;
60
60
  }
61
+
62
+ .v-select--multiple & {
63
+ display: block;
64
+ }
65
+
66
+ .v-select--multiple &__inner {
67
+ display: block;
68
+ overflow: auto;
69
+ white-space: unset;
70
+ }
71
+ }
72
+
73
+ &--multiple .v-control-field__body {
74
+ padding: 0.2em 0;
61
75
  }
62
76
 
63
77
  &__placeholder {