@fastkit/vui 0.20.4 → 0.20.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastkit/vui",
3
- "version": "0.20.4",
3
+ "version": "0.20.6",
4
4
  "description": "A simple, extensible UI kit for Vue applications.",
5
5
  "keywords": [
6
6
  "fastkit",
@@ -44,31 +44,32 @@
44
44
  "src"
45
45
  ],
46
46
  "dependencies": {
47
- "@fastkit/color-scheme-gen": "^0.14.13",
48
47
  "@fastkit/color-scheme": "^2.0.10",
49
- "@fastkit/helpers": "^0.14.5",
50
48
  "@fastkit/dom": "^0.2.6",
51
- "@fastkit/media-match-gen": "^0.14.13",
52
- "@fastkit/media-match": "^2.0.7",
49
+ "@fastkit/color-scheme-gen": "^0.14.13",
53
50
  "@fastkit/icon-font": "^2.0.7",
51
+ "@fastkit/helpers": "^0.14.5",
52
+ "@fastkit/media-match": "^2.0.7",
54
53
  "@fastkit/rules": "^0.14.7",
55
- "@fastkit/vue-action": "^0.3.19",
56
- "@fastkit/tiny-logger": "^0.14.5",
57
54
  "@fastkit/stylebase": "^0.13.1",
58
- "@fastkit/vue-app-layout": "^0.16.2",
59
- "@fastkit/vue-click-outside": "^0.2.12",
60
- "@fastkit/vue-body-scroll-lock": "^0.2.13",
61
- "@fastkit/vue-color-scheme": "^0.15.15",
62
- "@fastkit/vue-form-control": "^0.21.0",
55
+ "@fastkit/tiny-logger": "^0.14.5",
56
+ "@fastkit/vue-action": "^0.3.20",
57
+ "@fastkit/vue-app-layout": "^0.16.3",
58
+ "@fastkit/vue-body-scroll-lock": "^0.2.14",
59
+ "@fastkit/vue-click-outside": "^0.2.13",
60
+ "@fastkit/vue-disabled-reason": "^0.0.1",
61
+ "@fastkit/vue-form-control": "^0.21.1",
62
+ "@fastkit/vue-color-scheme": "^0.15.16",
63
+ "@fastkit/vue-loading": "^0.15.16",
63
64
  "@fastkit/vue-keyboard": "^0.2.5",
65
+ "@fastkit/vue-location": "^0.4.3",
64
66
  "@fastkit/vue-media-match": "^0.14.10",
65
- "@fastkit/vue-location": "^0.4.2",
66
- "@fastkit/vue-loading": "^0.15.15",
67
- "@fastkit/vue-resize": "^0.2.12",
68
- "@fastkit/vue-transitions": "^0.2.13",
69
- "@fastkit/vue-scroller": "^0.15.12",
70
- "@fastkit/vue-stack": "^0.17.2",
71
- "@fastkit/vue-utils": "^0.15.12"
67
+ "@fastkit/vue-resize": "^0.2.13",
68
+ "@fastkit/vue-scroller": "^0.15.13",
69
+ "@fastkit/vue-stack": "^0.17.4",
70
+ "@fastkit/vue-transitions": "^0.2.14",
71
+ "@fastkit/vue-utils": "^0.15.13",
72
+ "@fastkit/media-match-gen": "^0.14.13"
72
73
  },
73
74
  "peerDependencies": {
74
75
  "vue": "^3.4.0",
@@ -0,0 +1,23 @@
1
+ @use '../../styles/core.scss';
2
+
3
+ @layer vui {
4
+ .v-disabled-reason {
5
+ @include core.remove-tap-highlight;
6
+
7
+ /* stylelint-disable-next-line no-duplicate-selectors */
8
+ & {
9
+ position: absolute;
10
+ inset: 0;
11
+ z-index: 10;
12
+ display: block;
13
+ pointer-events: none;
14
+ cursor: default;
15
+ border-radius: inherit;
16
+ }
17
+
18
+ // Match elements with tabindex 0 or greater
19
+ &[tabindex]:not([tabindex^='-']) {
20
+ pointer-events: auto;
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,54 @@
1
+ import './VDisabledReason.scss';
2
+ import { type PropType } from 'vue';
3
+ import { defineDisabledReasonComponent } from '@fastkit/vue-disabled-reason';
4
+ import { createMenuProps } from '@fastkit/vue-stack';
5
+ import { VTooltip } from '../VTooltip';
6
+
7
+ const menuProps = createMenuProps();
8
+
9
+ /**
10
+ * Display type
11
+ *
12
+ * Currently, only tooltip is supported
13
+ */
14
+ export type DisabledReasonType = 'tooltip';
15
+
16
+ export const VDisabledReason = defineDisabledReasonComponent({
17
+ name: 'VDisabledReason',
18
+ props: {
19
+ ...menuProps,
20
+ /**
21
+ * Display type
22
+ *
23
+ * Currently, only tooltip is supported
24
+ *
25
+ * @see {@link DisabledReasonType}
26
+ */
27
+ type: {
28
+ type: String as PropType<DisabledReasonType>,
29
+ default: 'tooltip' satisfies DisabledReasonType,
30
+ },
31
+ },
32
+ setup(api) {
33
+ return (reason) => {
34
+ const { type: _type, ...tooltipProps } = api.props;
35
+ return (
36
+ <VTooltip
37
+ {...tooltipProps}
38
+ disabled={!reason || !api.disabled}
39
+ v-slots={{
40
+ activator: ({ attrs }) => (
41
+ <span
42
+ class="v-disabled-reason"
43
+ // If tabindex is 0 or greater, enable pointer-events via CSS
44
+ tabindex={api.disabled ? 0 : -1}
45
+ {...attrs}
46
+ />
47
+ ),
48
+ default: () => reason,
49
+ }}
50
+ />
51
+ );
52
+ };
53
+ },
54
+ });
@@ -0,0 +1 @@
1
+ export * from './VDisabledReason';
@@ -5,6 +5,7 @@ export * from './VSnackbar';
5
5
  export * from './VTooltip';
6
6
  export * from './VSheetModal';
7
7
  export * from './VSkeltonLoader';
8
+ export * from './VDisabledReason';
8
9
  export * from './VBusyImage';
9
10
  export * from './VGrid';
10
11
  export * from './VPaper';
@@ -1,5 +1,5 @@
1
1
  @use 'sass:meta';
2
- @layer vui-normalize, vui-color-scheme, vue-loading, vue-app-layout, vui;
2
+ @layer vui-normalize, vui-color-scheme, vue-disabled-reason, vue-loading, vue-app-layout, vui;
3
3
 
4
4
  @layer vui-normalize {
5
5
  @include meta.load-css('@fastkit/stylebase/normalize.css');