@fastkit/vui 1.0.0-next.0 → 1.1.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/vui.mjs CHANGED
@@ -26,7 +26,7 @@ import { VScroller, getDocumentScroller } from '@fastkit/vue-scroller';
26
26
  export * from '@fastkit/vue-scroller';
27
27
  import { defineMenuComponent, defineDialogComponent, createStackActionProps, useStackAction, defineSnackbarComponent, createStackableDefine, useStackControl, createMenuProps, VDynamicStacks, BUILTIN_ACTION_HANDLERS, installVueStackPlugin } from '@fastkit/vue-stack';
28
28
  export * from '@fastkit/vue-stack';
29
- import { useActionable, VAction, actionableInheritProps, setDefaultActionableClassName, setDefaultRouterLink } from '@fastkit/vue-action';
29
+ import { registerActionableAttrsResolver, registerActionableRenderWrapper, useActionable, VAction, actionableInheritProps, setDefaultActionableClassName, setDefaultRouterLink } from '@fastkit/vue-action';
30
30
  export * from '@fastkit/vue-action';
31
31
  export { VAction as VLink } from '@fastkit/vue-action';
32
32
  import { createPropsOptions, typedSlotWithCtx, defineSlots, typedSlotsWithCtx, renderSlotOrEmpty, withCtx, isFragment, resolveNumberish, resolveVNodeChildOrSlots, withCtxForSlots, rawNumberPropType, onAppUnmount } from '@fastkit/vue-utils';
@@ -34,7 +34,7 @@ export * from '@fastkit/vue-utils';
34
34
  import * as vue_loading_star from '@fastkit/vue-loading';
35
35
  export * from '@fastkit/vue-loading';
36
36
  import { defineComponent, computed, createVNode, mergeProps, ref, watch, onMounted, onBeforeUnmount, Fragment, isVNode, cloneVNode, withDirectives, vShow, onBeforeUpdate, Transition, inject, provide, createTextVNode, nextTick, vModelSelect, reactive } from 'vue';
37
- import { defineDisabledReasonComponent } from '@fastkit/vue-disabled-reason';
37
+ import { defineDisabledReasonComponent, DISABLED_REASON_CONTAINER_BIND } from '@fastkit/vue-disabled-reason';
38
38
  import { loadImage } from '@fastkit/dom';
39
39
  import { useRouter, useRoute, RouterLink, useLink } from 'vue-router';
40
40
  import { resizeDirectiveArgument, installResizeDirective } from '@fastkit/vue-resize';
@@ -68,6 +68,7 @@ __export(src_exports, {
68
68
  CONTROL_FIELD_VARIANTS: () => CONTROL_FIELD_VARIANTS,
69
69
  CONTROL_LOADING_SPINNER_SIZES: () => CONTROL_LOADING_SPINNER_SIZES,
70
70
  CONTROL_SIZES: () => CONTROL_SIZES,
71
+ DISABLED_REASON_PROPS: () => DISABLED_REASON_PROPS,
71
72
  ICON_NAMES: () => ICON_NAMES,
72
73
  KEYBOARD_EVENT_TYPES: () => KEYBOARD_EVENT_TYPES,
73
74
  PAGINATION_ALIGNS: () => PAGINATION_ALIGNS,
@@ -644,6 +645,7 @@ __export(components_exports, {
644
645
  BUTTON_ALIGNS: () => BUTTON_ALIGNS,
645
646
  CHIP_SIZES: () => CHIP_SIZES,
646
647
  CHOICE_KEY_TYPES: () => CHOICE_KEY_TYPES,
648
+ DISABLED_REASON_PROPS: () => DISABLED_REASON_PROPS,
647
649
  ICON_NAMES: () => ICON_NAMES,
648
650
  KEYBOARD_EVENT_TYPES: () => KEYBOARD_EVENT_TYPES,
649
651
  PAGINATION_ALIGNS: () => PAGINATION_ALIGNS,
@@ -877,11 +879,13 @@ var VSkeltonLoaderBone = defineComponent({
877
879
  };
878
880
  }
879
881
  });
882
+ function _isSlot(s) {
883
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
884
+ }
880
885
  var menuProps = createMenuProps();
881
- var VDisabledReason = defineDisabledReasonComponent({
882
- name: "VDisabledReason",
883
- props: {
884
- ...menuProps,
886
+ var DISABLED_REASON_PROPS = {
887
+ ...menuProps,
888
+ ...createPropsOptions({
885
889
  /**
886
890
  * Display type
887
891
  *
@@ -893,7 +897,11 @@ var VDisabledReason = defineDisabledReasonComponent({
893
897
  type: String,
894
898
  default: "tooltip"
895
899
  }
896
- },
900
+ })
901
+ };
902
+ var VDisabledReason = defineDisabledReasonComponent({
903
+ name: "VDisabledReason",
904
+ props: DISABLED_REASON_PROPS,
897
905
  setup(api) {
898
906
  return (reason) => {
899
907
  const {
@@ -914,6 +922,29 @@ var VDisabledReason = defineDisabledReasonComponent({
914
922
  };
915
923
  }
916
924
  });
925
+ registerActionableAttrsResolver((attrs, ctx) => {
926
+ const disabledReason = ctx.getAttr("disabledReason");
927
+ if (disabledReason) {
928
+ delete attrs.disabledReason;
929
+ return [void 0, {
930
+ disabledReason
931
+ }];
932
+ }
933
+ });
934
+ registerActionableRenderWrapper((customProps, currentNode) => {
935
+ const {
936
+ disabledReason
937
+ } = customProps;
938
+ const disabledReasonInput = typeof disabledReason === "string" || typeof disabledReason === "function" ? {
939
+ reason: disabledReason
940
+ } : disabledReason;
941
+ if (disabledReasonInput) {
942
+ return createVNode(VDisabledReason, disabledReasonInput, _isSlot(currentNode) ? currentNode : {
943
+ default: () => [currentNode]
944
+ });
945
+ }
946
+ return currentNode;
947
+ });
917
948
  var IMAGE_ATTRS = ["alt", "crossorigin", "decoding", "sizes", "src", "srcset", "usemap"];
918
949
  function splitAttrs(attrs) {
919
950
  const el = {
@@ -1635,7 +1666,7 @@ var VButtonGroup = defineComponent({
1635
1666
  };
1636
1667
  }
1637
1668
  });
1638
- function _isSlot(s) {
1669
+ function _isSlot2(s) {
1639
1670
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
1640
1671
  }
1641
1672
  var PAGINATION_ALIGNS = ["left", "center", "right"];
@@ -1858,7 +1889,7 @@ var VPagination = defineComponent({
1858
1889
  "class": classes2,
1859
1890
  "to": to,
1860
1891
  "key": key
1861
- }, _isSlot(children) ? children : {
1892
+ }, _isSlot2(children) ? children : {
1862
1893
  default: () => [children]
1863
1894
  });
1864
1895
  }
@@ -2052,7 +2083,7 @@ var VHero = defineComponent({
2052
2083
  };
2053
2084
  }
2054
2085
  });
2055
- function _isSlot2(s) {
2086
+ function _isSlot3(s) {
2056
2087
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
2057
2088
  }
2058
2089
  function createNavigationItemProps() {
@@ -2091,7 +2122,7 @@ function renderNavigationItemInput(input, extraProps) {
2091
2122
  return createVNode(VNavigationItem, {
2092
2123
  ...props12,
2093
2124
  ...extraProps
2094
- }, _isSlot2(label) ? label : {
2125
+ }, _isSlot3(label) ? label : {
2095
2126
  default: () => [label]
2096
2127
  });
2097
2128
  }
@@ -2365,11 +2396,11 @@ var VControlField = defineComponent({
2365
2396
  }, [child]);
2366
2397
  };
2367
2398
  const handleClick = (ev) => ctx.emit("click", ev);
2368
- return () => createVNode("div", {
2399
+ return () => createVNode("div", mergeProps({
2369
2400
  "class": classes.value,
2370
2401
  "onClick": handleClick,
2371
2402
  "ref": hostElRef
2372
- }, [renderAdornment("start"), createVNode("div", {
2403
+ }, DISABLED_REASON_CONTAINER_BIND), [renderAdornment("start"), createVNode("div", {
2373
2404
  "class": "v-control-field__body"
2374
2405
  }, [ctx.slots.default?.()]), renderAdornment("end")]);
2375
2406
  }
@@ -2418,9 +2449,9 @@ var VCheckable = defineComponent({
2418
2449
  "v-checkable--custom-icon": !!ctx.slots.icon,
2419
2450
  disabled: disabled.value
2420
2451
  }, colorProvider.className(invalid.value ? "error" : "primary")]);
2421
- return () => createVNode("label", {
2452
+ return () => createVNode("label", mergeProps({
2422
2453
  "class": ["v-checkable", classes.value]
2423
- }, [createVNode("span", {
2454
+ }, DISABLED_REASON_CONTAINER_BIND), [createVNode("span", {
2424
2455
  "class": "v-checkable__faux"
2425
2456
  }, [ctx.slots.input?.(), ctx.slots.icon ? ctx.slots.icon() : createVNode("span", {
2426
2457
  "class": "v-checkable__faux__icon"
@@ -2481,7 +2512,7 @@ var VCheckbox = defineComponent({
2481
2512
  }, withCtxForSlots(slots12));
2482
2513
  }
2483
2514
  });
2484
- function _isSlot3(s) {
2515
+ function _isSlot4(s) {
2485
2516
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
2486
2517
  }
2487
2518
  var VCheckboxGroup = defineFormSelectorComponent({
@@ -2492,7 +2523,7 @@ var VCheckboxGroup = defineFormSelectorComponent({
2492
2523
  itemRenderer: ({
2493
2524
  attrs,
2494
2525
  slots: slots12
2495
- }) => createVNode(VCheckbox, attrs, _isSlot3(slots12) ? slots12 : {
2526
+ }) => createVNode(VCheckbox, attrs, _isSlot4(slots12) ? slots12 : {
2496
2527
  default: () => [slots12]
2497
2528
  })
2498
2529
  });
@@ -2535,7 +2566,7 @@ var VRadio = defineComponent({
2535
2566
  }, withCtxForSlots(slots12));
2536
2567
  }
2537
2568
  });
2538
- function _isSlot4(s) {
2569
+ function _isSlot5(s) {
2539
2570
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
2540
2571
  }
2541
2572
  var VRadioGroup = defineFormSelectorComponent({
@@ -2545,7 +2576,7 @@ var VRadioGroup = defineFormSelectorComponent({
2545
2576
  itemRenderer: ({
2546
2577
  attrs,
2547
2578
  slots: slots12
2548
- }) => createVNode(VRadio, attrs, _isSlot4(slots12) ? slots12 : {
2579
+ }) => createVNode(VRadio, attrs, _isSlot5(slots12) ? slots12 : {
2549
2580
  default: () => [slots12]
2550
2581
  })
2551
2582
  });
@@ -2598,7 +2629,7 @@ var VSwitch = defineComponent({
2598
2629
  }, withCtxForSlots(slots12));
2599
2630
  }
2600
2631
  });
2601
- function _isSlot5(s) {
2632
+ function _isSlot6(s) {
2602
2633
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
2603
2634
  }
2604
2635
  var VSwitchGroup = defineFormSelectorComponent({
@@ -2609,7 +2640,7 @@ var VSwitchGroup = defineFormSelectorComponent({
2609
2640
  itemRenderer: ({
2610
2641
  attrs,
2611
2642
  slots: slots12
2612
- }) => createVNode(VSwitch, attrs, _isSlot5(slots12) ? slots12 : {
2643
+ }) => createVNode(VSwitch, attrs, _isSlot6(slots12) ? slots12 : {
2613
2644
  default: () => [slots12]
2614
2645
  })
2615
2646
  });
@@ -2678,7 +2709,7 @@ var VOptionGroup = defineComponent({
2678
2709
  };
2679
2710
  }
2680
2711
  });
2681
- function _isSlot6(s) {
2712
+ function _isSlot7(s) {
2682
2713
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
2683
2714
  }
2684
2715
  var ARROW_KEY_TYPES = useKeyboard.Key(["ArrowUp", "ArrowDown"]);
@@ -2879,13 +2910,13 @@ var VSelect = defineComponent({
2879
2910
  "groupId": group.id,
2880
2911
  "label": group.label(inputControl),
2881
2912
  "disabled": group.disabled
2882
- }, _isSlot6(_slot2 = group.items.map((item) => {
2913
+ }, _isSlot7(_slot2 = group.items.map((item) => {
2883
2914
  let _slot;
2884
2915
  return createVNode(VOption, {
2885
2916
  "disabled": item.disabled,
2886
2917
  "value": item.value,
2887
2918
  "key": item.value
2888
- }, _isSlot6(_slot = item.label(inputControl)) ? _slot : {
2919
+ }, _isSlot7(_slot = item.label(inputControl)) ? _slot : {
2889
2920
  default: () => [_slot]
2890
2921
  });
2891
2922
  })) ? _slot2 : {
@@ -3264,7 +3295,7 @@ var VForm = defineComponent({
3264
3295
  }, nodeControl.formAttrs), [ctx.slots.default?.(nodeControl)]);
3265
3296
  }
3266
3297
  });
3267
- function _isSlot7(s) {
3298
+ function _isSlot8(s) {
3268
3299
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
3269
3300
  }
3270
3301
  var VTab = defineComponent({
@@ -3309,7 +3340,7 @@ var VTab = defineComponent({
3309
3340
  "class": classes,
3310
3341
  "to": to,
3311
3342
  "replace": replace
3312
- }, _isSlot7(children) ? children : {
3343
+ }, _isSlot8(children) ? children : {
3313
3344
  default: () => [children]
3314
3345
  });
3315
3346
  }
@@ -3326,7 +3357,7 @@ var VTab = defineComponent({
3326
3357
  });
3327
3358
 
3328
3359
  // src/components/VTabs/VTabs.tsx
3329
- function _isSlot8(s) {
3360
+ function _isSlot9(s) {
3330
3361
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
3331
3362
  }
3332
3363
  var slots10 = defineSlots();
@@ -3571,7 +3602,7 @@ var VTabs = defineComponent({
3571
3602
  to(value);
3572
3603
  }
3573
3604
  }
3574
- }, _isSlot8(children2) ? children2 : {
3605
+ }, _isSlot9(children2) ? children2 : {
3575
3606
  default: () => [children2]
3576
3607
  });
3577
3608
  });
@@ -3590,7 +3621,7 @@ var VTabs = defineComponent({
3590
3621
  };
3591
3622
  }
3592
3623
  });
3593
- function _isSlot9(s) {
3624
+ function _isSlot10(s) {
3594
3625
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
3595
3626
  }
3596
3627
  var VBreadcrumbs = defineComponent({
@@ -3667,7 +3698,7 @@ var VBreadcrumbs = defineComponent({
3667
3698
  "class": "v-breadcrumbs__link",
3668
3699
  "to": to,
3669
3700
  "exactActiveClass": "v-breadcrumbs__link--active"
3670
- }, _isSlot9(myChildren) ? myChildren : {
3701
+ }, _isSlot10(myChildren) ? myChildren : {
3671
3702
  default: () => [myChildren]
3672
3703
  }) : myChildren;
3673
3704
  children.push(createVNode("li", {
@@ -3685,7 +3716,7 @@ var VBreadcrumbs = defineComponent({
3685
3716
  };
3686
3717
  }
3687
3718
  });
3688
- function _isSlot10(s) {
3719
+ function _isSlot11(s) {
3689
3720
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
3690
3721
  }
3691
3722
  var VContentSwitcher = defineComponent({
@@ -3797,7 +3828,7 @@ var VContentSwitcher = defineComponent({
3797
3828
  "onLeaveCancelled": () => {
3798
3829
  getEl().style.height = "";
3799
3830
  }
3800
- }, _isSlot10(children) ? children : {
3831
+ }, _isSlot11(children) ? children : {
3801
3832
  default: () => [children]
3802
3833
  })]);
3803
3834
  };
@@ -4823,6 +4854,6 @@ function installVuiPlugin(app, opts) {
4823
4854
  return app.use(VuiPlugin, opts);
4824
4855
  }
4825
4856
 
4826
- export { ARROW_KEY_TYPES, AVATAR_SIZES, BUTTON_ALIGNS, CHIP_SIZES, CHOICE_KEY_TYPES, CONTROL_FIELD_VARIANTS, CONTROL_LOADING_SPINNER_SIZES, CONTROL_SIZES, KEYBOARD_EVENT_TYPES, PAGINATION_ALIGNS, VApp, VAvatar, VBreadcrumbs, VBusyImage, VButton, VButtonGroup, VCard, VCardActions, VCardContent, VCheckbox, VCheckboxGroup, VChip, VContentSwitcher, VControlField, VDataTable, VDialog, VDisabledReason, VDrawerLayout, VForm, VFormControl, VFormGroup, VGridContainer, VGridItem, VHero, VIcon, VListTile, VMenu, VNavigation, VNavigationItem, VNumberField, VOption, VOptionGroup, VPagination, VPaper, VRadio, VRadioGroup, VSelect, VSheetModal, VSkeltonLoaderBone, VSnackbar, VSwitch, VSwitchGroup, VTabs, VTextCounter, VTextField, VTextarea, VToolbar, VToolbarEdge, VToolbarMenu, VToolbarTitle, VTooltip, VUI_CHECKBOX_GROUP_SYMBOL, VUI_CHECKBOX_SYMBOL, VUI_FORM_GROUP_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, VuiColorProviderInjectionKey, VuiControlFieldInjectionKey, VuiControlInjectionKey, VuiInjectionKey, VuiPlugin, VuiService, configureDataTableDefaults, createAvatarProps, createCardProps, createChipProps, createControlFieldProps, createControlFieldProviderProps, createControlProps, createElevationProps, createListTileProps, createNavigationItemProps, createNavigationProps, createPaperBaseProps, createPaperProps, createRequiredChipRenderer, createVFormGroupProps, createVFormProps, defineFormSelectorComponent, formGroupSlots, formSlots, iconProps, installVuiPlugin, listTileEmits, mergeVuiPluginOptions, mergeVuiServiceIconSettings, mergeVuiServiceOptions, mergeVuiServiceUISettings, paginationProps, paperBaseSlots, rawIconProp, renderNavigationItemInput, resolveNavigationItemInput, resolveRawIconProp, sheetModalProps, splitAttrs, useControl, useControlField, useElevation, useVui, useVuiColorProvider, vueButtonProps };
4857
+ export { ARROW_KEY_TYPES, AVATAR_SIZES, BUTTON_ALIGNS, CHIP_SIZES, CHOICE_KEY_TYPES, CONTROL_FIELD_VARIANTS, CONTROL_LOADING_SPINNER_SIZES, CONTROL_SIZES, DISABLED_REASON_PROPS, KEYBOARD_EVENT_TYPES, PAGINATION_ALIGNS, VApp, VAvatar, VBreadcrumbs, VBusyImage, VButton, VButtonGroup, VCard, VCardActions, VCardContent, VCheckbox, VCheckboxGroup, VChip, VContentSwitcher, VControlField, VDataTable, VDialog, VDisabledReason, VDrawerLayout, VForm, VFormControl, VFormGroup, VGridContainer, VGridItem, VHero, VIcon, VListTile, VMenu, VNavigation, VNavigationItem, VNumberField, VOption, VOptionGroup, VPagination, VPaper, VRadio, VRadioGroup, VSelect, VSheetModal, VSkeltonLoaderBone, VSnackbar, VSwitch, VSwitchGroup, VTabs, VTextCounter, VTextField, VTextarea, VToolbar, VToolbarEdge, VToolbarMenu, VToolbarTitle, VTooltip, VUI_CHECKBOX_GROUP_SYMBOL, VUI_CHECKBOX_SYMBOL, VUI_FORM_GROUP_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, VuiColorProviderInjectionKey, VuiControlFieldInjectionKey, VuiControlInjectionKey, VuiInjectionKey, VuiPlugin, VuiService, configureDataTableDefaults, createAvatarProps, createCardProps, createChipProps, createControlFieldProps, createControlFieldProviderProps, createControlProps, createElevationProps, createListTileProps, createNavigationItemProps, createNavigationProps, createPaperBaseProps, createPaperProps, createRequiredChipRenderer, createVFormGroupProps, createVFormProps, defineFormSelectorComponent, formGroupSlots, formSlots, iconProps, installVuiPlugin, listTileEmits, mergeVuiPluginOptions, mergeVuiServiceIconSettings, mergeVuiServiceOptions, mergeVuiServiceUISettings, paginationProps, paperBaseSlots, rawIconProp, renderNavigationItemInput, resolveNavigationItemInput, resolveRawIconProp, sheetModalProps, splitAttrs, useControl, useControlField, useElevation, useVui, useVuiColorProvider, vueButtonProps };
4827
4858
  //# sourceMappingURL=vui.mjs.map
4828
4859
  //# sourceMappingURL=vui.mjs.map