@fastkit/vui 0.7.14 → 0.7.17

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.7.14",
3
+ "version": "0.7.17",
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.7.14",
36
- "@fastkit/icon-font": "0.7.14",
37
- "@fastkit/tiny-logger": "0.7.14",
38
- "@fastkit/vite-kit": "0.7.14",
39
- "@fastkit/vue-kit": "0.7.14",
35
+ "@fastkit/color-scheme": "0.7.17",
36
+ "@fastkit/icon-font": "0.7.17",
37
+ "@fastkit/tiny-logger": "0.7.17",
38
+ "@fastkit/vite-kit": "0.7.17",
39
+ "@fastkit/vue-kit": "0.7.17",
40
40
  "@tiptap/extension-link": "^2.0.0-beta.35",
41
41
  "@tiptap/extension-underline": "^2.0.0-beta.22",
42
42
  "@tiptap/starter-kit": "^2.0.0-beta.168",
@@ -19,12 +19,54 @@
19
19
  }
20
20
 
21
21
  &__label {
22
+ display: flex;
23
+ align-items: center;
22
24
  align-self: flex-start;
23
25
  font-size: var(--control-label-font-size);
24
26
  font-weight: var(--control-label-font-weight);
25
27
  line-height: var(--control-label-height);
26
28
  color: var(--my-label-color);
27
29
  letter-spacing: 0.00938em;
30
+
31
+ &__hinttip {
32
+ display: inline-flex;
33
+ align-items: center;
34
+ margin-top: -0.2em;
35
+ margin-left: 0.6em;
36
+ // font-size: calc(var(--root-em) * 0.5);
37
+ font-size: 80%;
38
+ line-height: 1;
39
+ color: inherit;
40
+ // color: var(--palette-muted);
41
+ text-decoration: none;
42
+ letter-spacing: normal;
43
+ cursor: pointer;
44
+
45
+ // &:hover,
46
+ // &:focus {
47
+ // text-decoration: underline;
48
+ // }
49
+
50
+ &__icon {
51
+ position: relative;
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ font-size: 120%;
56
+ text-decoration: none !important;
57
+ }
58
+
59
+ &:hover &__icon,
60
+ &:focus &__icon {
61
+ &::before {
62
+ opacity: 0.1;
63
+ }
64
+ }
65
+
66
+ &__hint {
67
+ font-size: calc(var(--root-em) * 0.75);
68
+ }
69
+ }
28
70
  }
29
71
 
30
72
  // &--disabled &__body {
@@ -9,6 +9,8 @@ import {
9
9
  renderSlotOrEmpty,
10
10
  } from '@fastkit/vue-kit';
11
11
  import { useVuiColorProvider, useVui } from '../../injections';
12
+ import { VIcon } from '../VIcon';
13
+ import { VTooltip } from '../kits';
12
14
 
13
15
  const { props, emits } = createFormControlSettings();
14
16
 
@@ -24,10 +26,19 @@ export const VFormControl = defineComponent({
24
26
  },
25
27
  emits,
26
28
  setup(props, ctx) {
27
- const control = useFormControl(props, ctx);
29
+ const vui = useVui();
30
+
31
+ const control = useFormControl(props, ctx, {
32
+ hinttipPrepend: () => (
33
+ <VIcon
34
+ class="v-form-control__label__hinttip__icon"
35
+ name={vui.icon('hinttip')}
36
+ />
37
+ ),
38
+ });
39
+
28
40
  ctx.expose(control.expose());
29
41
 
30
- const vui = useVui();
31
42
  const colorProvider = useVuiColorProvider();
32
43
 
33
44
  const classes = computed(() => [
@@ -53,6 +64,8 @@ export const VFormControl = defineComponent({
53
64
  const label = control.renderLabel();
54
65
  const message = control.renderMessage();
55
66
  const appends = control.renderInfoAppends();
67
+ const hinttip = control.renderHinttip();
68
+
56
69
  return (
57
70
  <div class={['v-form-control', classes.value]}>
58
71
  {label && (
@@ -63,6 +76,25 @@ export const VFormControl = defineComponent({
63
76
  }}>
64
77
  {label}
65
78
  {control.required && vui.getRequiredChip()}
79
+ {hinttip && (
80
+ <VTooltip
81
+ top
82
+ openOnHover={false}
83
+ v-slots={{
84
+ activator: (ctx) => (
85
+ <a
86
+ class="v-form-control__label__hinttip"
87
+ href="javascript:void(0)"
88
+ {...ctx.attrs}>
89
+ {hinttip.tip}
90
+ </a>
91
+ ),
92
+ }}>
93
+ <div class="v-form-control__label__hinttip__hint">
94
+ {hinttip.hint}
95
+ </div>
96
+ </VTooltip>
97
+ )}
66
98
  </label>
67
99
  )}
68
100
  <div class="v-form-control__body">
@@ -115,6 +115,7 @@ export const VSelect = defineComponent({
115
115
  class={['v-select', this.classes]}
116
116
  label={this.label}
117
117
  hint={this.hint}
118
+ hinttip={this.hinttip}
118
119
  hiddenInfo={this.hiddenInfo}
119
120
  onClickLabel={(ev) => {
120
121
  this.focus();
@@ -65,6 +65,7 @@ export const VTextField = defineComponent({
65
65
  class={['v-text-field', this.classes]}
66
66
  label={this.label}
67
67
  hint={this.hint}
68
+ hinttip={this.hinttip}
68
69
  onClickLabel={(ev) => {
69
70
  this.focus();
70
71
  }}
@@ -57,6 +57,7 @@ export const VTextarea = defineComponent({
57
57
  class={['v-textarea', this.classes]}
58
58
  label={this.label}
59
59
  hint={this.hint}
60
+ hinttip={this.hinttip}
60
61
  hiddenInfo={this.hiddenInfo}
61
62
  onClickLabel={(ev) => {
62
63
  this.focus();
@@ -235,6 +235,7 @@ export const VWysiwygEditor = defineComponent({
235
235
  ]}
236
236
  label={this.label}
237
237
  hint={this.hint}
238
+ hinttip={this.hinttip}
238
239
  hiddenInfo={this.hiddenInfo}
239
240
  onClickLabel={(ev) => {
240
241
  this.focus('start', { scrollIntoView: true });
@@ -1 +1 @@
1
- export { VDialog, VMenu, VSnackbar } from '@fastkit/vue-kit';
1
+ export { VDialog, VMenu, VSnackbar, VTooltip } from '@fastkit/vue-kit';
@@ -75,6 +75,7 @@ export function defineFormSelectorComponent(
75
75
  ]}
76
76
  label={this.label}
77
77
  hint={this.hint}
78
+ hinttip={this.hinttip}
78
79
  v-slots={{
79
80
  ...this.$slots,
80
81
  default: () => (
package/src/service.tsx CHANGED
@@ -68,6 +68,7 @@ export interface VuiServiceIconSettings {
68
68
  editorLinkOff: IconName;
69
69
  editorUndo: IconName;
70
70
  editorRedo: IconName;
71
+ hinttip: IconName;
71
72
  }
72
73
 
73
74
  export type VuiVNodeResolver = () => VNodeChild;
@@ -170,6 +170,7 @@ export function viteVuiPlugin(
170
170
  editorLinkOff: 'mdi-link-off' as any,
171
171
  editorUndo: 'mdi-undo-variant' as any,
172
172
  editorRedo: 'mdi-redo-variant' as any,
173
+ hinttip: 'mdi-help-circle-outline' as any,
173
174
  // navigationExpand: (gen, active) => {
174
175
  // return gen({
175
176
  // name: 'mdi-menu-down' as any,