@fastkit/vui 0.7.11 → 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/dist/tool/index.js +1 -0
- package/dist/tool/vite-plugin.d.ts.map +1 -1
- package/dist/vui.cjs.js +97 -72
- package/dist/vui.cjs.prod.js +97 -72
- package/dist/vui.css +45 -17
- package/dist/vui.d.ts +122 -0
- package/dist/vui.min.css +1 -1
- package/dist/vui.min.css.map +1 -1
- package/dist/vui.mjs +99 -76
- package/package.json +6 -6
- package/src/components/VFormControl/VFormControl.scss +42 -0
- package/src/components/VFormControl/VFormControl.tsx +34 -2
- package/src/components/VNavigation/VNavigationItem.tsx +2 -1
- package/src/components/VSelect/VSelect.tsx +1 -0
- package/src/components/VTextField/VTextField.tsx +1 -0
- package/src/components/VTextarea/VTextarea.tsx +1 -0
- package/src/components/VWysiwygEditor/VWysiwygEditor.tsx +1 -0
- package/src/components/index.ts +1 -0
- package/src/components/kits.ts +1 -1
- package/src/composables/form-selector.tsx +1 -0
- package/src/service.tsx +1 -0
- package/src/tool/vite-plugin.ts +1 -0
package/dist/vui.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createPropsOptions, createFormControlSettings, defineSlotsProps, useFormControl, renderSlotOrEmpty, createFormSelectorSettings, createFormControlProps, useFormSelectorControl, createFormSelectorItemSettings, useFormSelectorItemControl, createFormSelectorItemGroupProps, useFormSelectorItemGroupControl, resolveVNodeChildOrSlots, 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, createFormSelectorItemSettings, useFormSelectorItemControl, createFormSelectorItemGroupProps, useFormSelectorItemGroupControl, resolveVNodeChildOrSlots, useParentFormNode, 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
|
-
export { VDialog, VMenu, VSnackbar } from '@fastkit/vue-kit';
|
|
4
|
-
import { inject, computed, provide,
|
|
3
|
+
export { VDialog, VMenu, VSnackbar, VTooltip } from '@fastkit/vue-kit';
|
|
4
|
+
import { inject, computed, provide, createVNode, mergeProps, defineComponent, isVNode, cloneVNode, ref, watch, withDirectives, createTextVNode, Fragment, vShow, onBeforeUpdate, vModelSelect, onMounted, onBeforeUnmount, Transition } from 'vue';
|
|
5
5
|
import { useRouter, RouterLink, useLink, useRoute } from 'vue-router';
|
|
6
6
|
import { createPropsOptions as createPropsOptions$1, htmlAttributesPropOptions, defineSlotsProps as defineSlotsProps$1, renderSlotOrEmpty as renderSlotOrEmpty$1, navigationableInheritProps, VLink, isFragment, rawNumberPropType, resolveNumberish, resizeDirectiveArgument, VExpandTransition, LocationService, setDefaultRouterLink } from '@fastkit/vue-utils';
|
|
7
7
|
import { getDocumentScroller as getDocumentScroller$1 } from '@fastkit/vue-scroller';
|
|
@@ -134,6 +134,71 @@ function useControlField(props, opts = {}) {
|
|
|
134
134
|
return provider;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
// prop: RawIconProp<T>,
|
|
138
|
+
// payload: () => T,
|
|
139
|
+
// ): RawIconProp {
|
|
140
|
+
// if (!prop || typeof prop !== 'function') {
|
|
141
|
+
// return prop;
|
|
142
|
+
// }
|
|
143
|
+
// const fn = (gen: IconGenerator): VNodeChild => {
|
|
144
|
+
// const t = payload();
|
|
145
|
+
// return prop(gen, t);
|
|
146
|
+
// };
|
|
147
|
+
// return fn;
|
|
148
|
+
// }
|
|
149
|
+
// export const rawRawIconProp = [String, Function] as PropType<RawIconProp>;
|
|
150
|
+
|
|
151
|
+
const _rawIconProp = [String, Function];
|
|
152
|
+
function rawIconProp() {
|
|
153
|
+
return _rawIconProp;
|
|
154
|
+
}
|
|
155
|
+
function resolveRawIconProp(payload, prop, extraProps) {
|
|
156
|
+
if (!prop) return;
|
|
157
|
+
return typeof prop === 'function' ? prop(input => createVNode(VIcon, mergeProps(input, extraProps), null), payload) : createVNode(VIcon, mergeProps(extraProps, {
|
|
158
|
+
"name": prop
|
|
159
|
+
}), null);
|
|
160
|
+
}
|
|
161
|
+
const iconProps = createPropsOptions$1({
|
|
162
|
+
name: {
|
|
163
|
+
type: String,
|
|
164
|
+
required: true
|
|
165
|
+
},
|
|
166
|
+
rotate: {
|
|
167
|
+
type: Number
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
const VIcon = defineComponent({
|
|
171
|
+
name: 'VIcon',
|
|
172
|
+
props: { ...iconProps
|
|
173
|
+
},
|
|
174
|
+
emits: {},
|
|
175
|
+
|
|
176
|
+
setup(props, ctx) {
|
|
177
|
+
const iconName = computed(() => props.name);
|
|
178
|
+
const clickable = computed(() => typeof ctx.attrs.onClick !== 'undefined');
|
|
179
|
+
const classes = computed(() => [{
|
|
180
|
+
'v-icon--clickable': clickable.value
|
|
181
|
+
}]);
|
|
182
|
+
const bodyClasses = computed(() => `icon-${iconName.value}`);
|
|
183
|
+
const bodyStyles = computed(() => {
|
|
184
|
+
const {
|
|
185
|
+
rotate
|
|
186
|
+
} = props;
|
|
187
|
+
if (!rotate) return;
|
|
188
|
+
return {
|
|
189
|
+
transform: `rotate(${rotate}deg)`
|
|
190
|
+
};
|
|
191
|
+
});
|
|
192
|
+
return () => createVNode("span", {
|
|
193
|
+
"class": [`v-icon notranslate`, classes.value]
|
|
194
|
+
}, [createVNode("i", {
|
|
195
|
+
"class": ['v-icon__body icon', bodyClasses.value],
|
|
196
|
+
"style": bodyStyles.value
|
|
197
|
+
}, null)]);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
});
|
|
201
|
+
|
|
137
202
|
const {
|
|
138
203
|
props: props$8,
|
|
139
204
|
emits: emits$8
|
|
@@ -146,9 +211,14 @@ const VFormControl = defineComponent({
|
|
|
146
211
|
emits: emits$8,
|
|
147
212
|
|
|
148
213
|
setup(props, ctx) {
|
|
149
|
-
const control = useFormControl(props, ctx);
|
|
150
|
-
ctx.expose(control.expose());
|
|
151
214
|
const vui = useVui();
|
|
215
|
+
const control = useFormControl(props, ctx, {
|
|
216
|
+
hinttipPrepend: () => createVNode(VIcon, {
|
|
217
|
+
"class": "v-form-control__label__hinttip__icon",
|
|
218
|
+
"name": vui.icon('hinttip')
|
|
219
|
+
}, null)
|
|
220
|
+
});
|
|
221
|
+
ctx.expose(control.expose());
|
|
152
222
|
const colorProvider = useVuiColorProvider();
|
|
153
223
|
const classes = computed(() => [{
|
|
154
224
|
'v-form-control--validating': control.validating,
|
|
@@ -167,6 +237,7 @@ const VFormControl = defineComponent({
|
|
|
167
237
|
const label = control.renderLabel();
|
|
168
238
|
const message = control.renderMessage();
|
|
169
239
|
const appends = control.renderInfoAppends();
|
|
240
|
+
const hinttip = control.renderHinttip();
|
|
170
241
|
return createVNode("div", {
|
|
171
242
|
"class": ['v-form-control', classes.value]
|
|
172
243
|
}, [label && createVNode("label", {
|
|
@@ -174,7 +245,18 @@ const VFormControl = defineComponent({
|
|
|
174
245
|
"onClick": ev => {
|
|
175
246
|
ctx.emit('clickLabel', ev, control);
|
|
176
247
|
}
|
|
177
|
-
}, [label, control.required && vui.getRequiredChip()
|
|
248
|
+
}, [label, control.required && vui.getRequiredChip(), hinttip && createVNode(VTooltip, {
|
|
249
|
+
"top": true,
|
|
250
|
+
"openOnHover": false
|
|
251
|
+
}, {
|
|
252
|
+
default: () => [createVNode("div", {
|
|
253
|
+
"class": "v-form-control__label__hinttip__hint"
|
|
254
|
+
}, [hinttip.hint])],
|
|
255
|
+
activator: ctx => createVNode("a", mergeProps({
|
|
256
|
+
"class": "v-form-control__label__hinttip",
|
|
257
|
+
"href": "javascript:void(0)"
|
|
258
|
+
}, ctx.attrs), [hinttip.tip])
|
|
259
|
+
})]), createVNode("div", {
|
|
178
260
|
"class": "v-form-control__body"
|
|
179
261
|
}, [renderSlotOrEmpty(ctx.slots, 'default', control), !props.hiddenInfo && createVNode("div", {
|
|
180
262
|
"class": "v-form-control__info"
|
|
@@ -234,7 +316,8 @@ function defineFormSelectorComponent(opts) {
|
|
|
234
316
|
'v-form-selector--stacked': this.stacked
|
|
235
317
|
}],
|
|
236
318
|
"label": this.label,
|
|
237
|
-
"hint": this.hint
|
|
319
|
+
"hint": this.hint,
|
|
320
|
+
"hinttip": this.hinttip
|
|
238
321
|
}, { ...this.$slots,
|
|
239
322
|
default: () => createVNode("div", {
|
|
240
323
|
"class": "v-form-selector__body"
|
|
@@ -562,71 +645,6 @@ const VCardActions = defineComponent({
|
|
|
562
645
|
|
|
563
646
|
});
|
|
564
647
|
|
|
565
|
-
// prop: RawIconProp<T>,
|
|
566
|
-
// payload: () => T,
|
|
567
|
-
// ): RawIconProp {
|
|
568
|
-
// if (!prop || typeof prop !== 'function') {
|
|
569
|
-
// return prop;
|
|
570
|
-
// }
|
|
571
|
-
// const fn = (gen: IconGenerator): VNodeChild => {
|
|
572
|
-
// const t = payload();
|
|
573
|
-
// return prop(gen, t);
|
|
574
|
-
// };
|
|
575
|
-
// return fn;
|
|
576
|
-
// }
|
|
577
|
-
// export const rawRawIconProp = [String, Function] as PropType<RawIconProp>;
|
|
578
|
-
|
|
579
|
-
const _rawIconProp = [String, Function];
|
|
580
|
-
function rawIconProp() {
|
|
581
|
-
return _rawIconProp;
|
|
582
|
-
}
|
|
583
|
-
function resolveRawIconProp(payload, prop, extraProps) {
|
|
584
|
-
if (!prop) return;
|
|
585
|
-
return typeof prop === 'function' ? prop(input => createVNode(VIcon, mergeProps(input, extraProps), null), payload) : createVNode(VIcon, mergeProps(extraProps, {
|
|
586
|
-
"name": prop
|
|
587
|
-
}), null);
|
|
588
|
-
}
|
|
589
|
-
const iconProps = createPropsOptions$1({
|
|
590
|
-
name: {
|
|
591
|
-
type: String,
|
|
592
|
-
required: true
|
|
593
|
-
},
|
|
594
|
-
rotate: {
|
|
595
|
-
type: Number
|
|
596
|
-
}
|
|
597
|
-
});
|
|
598
|
-
const VIcon = defineComponent({
|
|
599
|
-
name: 'VIcon',
|
|
600
|
-
props: { ...iconProps
|
|
601
|
-
},
|
|
602
|
-
emits: {},
|
|
603
|
-
|
|
604
|
-
setup(props, ctx) {
|
|
605
|
-
const iconName = computed(() => props.name);
|
|
606
|
-
const clickable = computed(() => typeof ctx.attrs.onClick !== 'undefined');
|
|
607
|
-
const classes = computed(() => [{
|
|
608
|
-
'v-icon--clickable': clickable.value
|
|
609
|
-
}]);
|
|
610
|
-
const bodyClasses = computed(() => `icon-${iconName.value}`);
|
|
611
|
-
const bodyStyles = computed(() => {
|
|
612
|
-
const {
|
|
613
|
-
rotate
|
|
614
|
-
} = props;
|
|
615
|
-
if (!rotate) return;
|
|
616
|
-
return {
|
|
617
|
-
transform: `rotate(${rotate}deg)`
|
|
618
|
-
};
|
|
619
|
-
});
|
|
620
|
-
return () => createVNode("span", {
|
|
621
|
-
"class": [`v-icon notranslate`, classes.value]
|
|
622
|
-
}, [createVNode("i", {
|
|
623
|
-
"class": ['v-icon__body icon', bodyClasses.value],
|
|
624
|
-
"style": bodyStyles.value
|
|
625
|
-
}, null)]);
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
});
|
|
629
|
-
|
|
630
648
|
function resolveRawVButtonIcon(raw, type = 'main') {
|
|
631
649
|
if (!raw) return;
|
|
632
650
|
return typeof raw === 'function' ? raw : () => createVNode(VIcon, {
|
|
@@ -1379,12 +1397,13 @@ const VNavigationItem = defineComponent({
|
|
|
1379
1397
|
const onClick = ev => {
|
|
1380
1398
|
if (!to.value) {
|
|
1381
1399
|
return toggle();
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
|
|
1400
|
+
} // console.log('★');
|
|
1401
|
+
// open();
|
|
1402
|
+
// if (!to.value) {
|
|
1385
1403
|
// toggle();
|
|
1386
1404
|
// }
|
|
1387
1405
|
// ctx.emit('click', ev);
|
|
1406
|
+
|
|
1388
1407
|
};
|
|
1389
1408
|
|
|
1390
1409
|
const onChangeActive = isActive => {
|
|
@@ -2034,6 +2053,7 @@ const VSelect = defineComponent({
|
|
|
2034
2053
|
"class": ['v-select', this.classes],
|
|
2035
2054
|
"label": this.label,
|
|
2036
2055
|
"hint": this.hint,
|
|
2056
|
+
"hinttip": this.hinttip,
|
|
2037
2057
|
"hiddenInfo": this.hiddenInfo,
|
|
2038
2058
|
"onClickLabel": ev => {
|
|
2039
2059
|
this.focus();
|
|
@@ -2168,6 +2188,7 @@ const VTextField = defineComponent({
|
|
|
2168
2188
|
"class": ['v-text-field', this.classes],
|
|
2169
2189
|
"label": this.label,
|
|
2170
2190
|
"hint": this.hint,
|
|
2191
|
+
"hinttip": this.hinttip,
|
|
2171
2192
|
"onClickLabel": ev => {
|
|
2172
2193
|
this.focus();
|
|
2173
2194
|
}
|
|
@@ -2228,6 +2249,7 @@ const VTextarea = defineComponent({
|
|
|
2228
2249
|
"class": ['v-textarea', this.classes],
|
|
2229
2250
|
"label": this.label,
|
|
2230
2251
|
"hint": this.hint,
|
|
2252
|
+
"hinttip": this.hinttip,
|
|
2231
2253
|
"hiddenInfo": this.hiddenInfo,
|
|
2232
2254
|
"onClickLabel": ev => {
|
|
2233
2255
|
this.focus();
|
|
@@ -2450,6 +2472,7 @@ const VWysiwygEditor = defineComponent({
|
|
|
2450
2472
|
}],
|
|
2451
2473
|
"label": this.label,
|
|
2452
2474
|
"hint": this.hint,
|
|
2475
|
+
"hinttip": this.hinttip,
|
|
2453
2476
|
"hiddenInfo": this.hiddenInfo,
|
|
2454
2477
|
"onClickLabel": ev => {
|
|
2455
2478
|
this.focus('start', {
|
|
@@ -4262,4 +4285,4 @@ function installVuiPlugin(app, opts) {
|
|
|
4262
4285
|
return app.use(VuiPlugin, opts);
|
|
4263
4286
|
}
|
|
4264
4287
|
|
|
4265
|
-
export { CONTROL_FIELD_VARIANTS, CONTROL_SIZES, PAGINATION_ALIGNS, VApp, VBreadcrumbs, VButton, VButtonGroup, VCard, VCardActions, VCardContent, VCheckbox, VCheckboxGroup, VContentSwitcher, VDataTable, VDrawerLayout, VForm, VGridContainer, VGridItem, VHero, VIcon, VListTile, VNavigation, VNavigationItem, VOption, VOptionGroup, VPagination, VPaper, VRadio, VRadioGroup, VSelect, 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, WysiwygFormatBoldTool, WysiwygFormatItalicTool, WysiwygFormatUnderlineTool, WysiwygHistoryTool, WysiwygLinkTool, WysiwygOrderedListTool, WysiwygTextColorTool, configureDataTableDefaults, createCardProps, createControlFieldProviderProps, createControlProps, createElevationProps, createListTileProps, createNavigationItemProps, createPaperBaseProps, createPaperProps, defineFormSelectorComponent, iconProps, installVuiPlugin, listTileEmits, paginationProps, rawIconProp, renderNavigationItemInput, resolveNavigationItemInput, resolveRawIconProp, useControl, useControlField, useElevation, useVui, useVuiColorProvider, vueButtonProps };
|
|
4288
|
+
export { CONTROL_FIELD_VARIANTS, CONTROL_SIZES, PAGINATION_ALIGNS, VApp, VBreadcrumbs, VButton, VButtonGroup, VCard, VCardActions, VCardContent, VCheckbox, VCheckboxGroup, VContentSwitcher, VDataTable, VDrawerLayout, VForm, VFormControl, VGridContainer, VGridItem, VHero, VIcon, VListTile, VNavigation, VNavigationItem, VOption, VOptionGroup, VPagination, VPaper, VRadio, VRadioGroup, VSelect, 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, WysiwygFormatBoldTool, WysiwygFormatItalicTool, WysiwygFormatUnderlineTool, WysiwygHistoryTool, WysiwygLinkTool, WysiwygOrderedListTool, WysiwygTextColorTool, configureDataTableDefaults, createCardProps, createControlFieldProviderProps, createControlProps, createElevationProps, createListTileProps, createNavigationItemProps, createPaperBaseProps, createPaperProps, defineFormSelectorComponent, iconProps, installVuiPlugin, listTileEmits, paginationProps, rawIconProp, renderNavigationItemInput, resolveNavigationItemInput, resolveRawIconProp, useControl, useControlField, useElevation, useVui, useVuiColorProvider, vueButtonProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastkit/vui",
|
|
3
|
-
"version": "0.7.
|
|
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.
|
|
36
|
-
"@fastkit/icon-font": "0.7.
|
|
37
|
-
"@fastkit/tiny-logger": "0.7.
|
|
38
|
-
"@fastkit/vite-kit": "0.7.
|
|
39
|
-
"@fastkit/vue-kit": "0.7.
|
|
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
|
|
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">
|
package/src/components/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './VDrawerLayout';
|
|
|
11
11
|
export * from './VHero';
|
|
12
12
|
// export * from './VAccordion';
|
|
13
13
|
export * from './VNavigation';
|
|
14
|
+
export * from './VFormControl';
|
|
14
15
|
export * from './VCheckbox';
|
|
15
16
|
export * from './VCheckboxGroup';
|
|
16
17
|
export * from './VRadio';
|
package/src/components/kits.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { VDialog, VMenu, VSnackbar } from '@fastkit/vue-kit';
|
|
1
|
+
export { VDialog, VMenu, VSnackbar, VTooltip } from '@fastkit/vue-kit';
|
package/src/service.tsx
CHANGED
package/src/tool/vite-plugin.ts
CHANGED
|
@@ -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,
|