@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/tool/index.js
CHANGED
|
@@ -122,6 +122,7 @@ function viteVuiPlugin(options = {}) {
|
|
|
122
122
|
editorLinkOff: 'mdi-link-off',
|
|
123
123
|
editorUndo: 'mdi-undo-variant',
|
|
124
124
|
editorRedo: 'mdi-redo-variant',
|
|
125
|
+
hinttip: 'mdi-help-circle-outline',
|
|
125
126
|
// navigationExpand: (gen, active) => {
|
|
126
127
|
// return gen({
|
|
127
128
|
// name: 'mdi-menu-down' as any,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../../../../../../packages/vui/src/tool/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAK9B,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC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+
// prop: RawIconProp<T>,
|
|
143
|
+
// payload: () => T,
|
|
144
|
+
// ): RawIconProp {
|
|
145
|
+
// if (!prop || typeof prop !== 'function') {
|
|
146
|
+
// return prop;
|
|
147
|
+
// }
|
|
148
|
+
// const fn = (gen: IconGenerator): VNodeChild => {
|
|
149
|
+
// const t = payload();
|
|
150
|
+
// return prop(gen, t);
|
|
151
|
+
// };
|
|
152
|
+
// return fn;
|
|
153
|
+
// }
|
|
154
|
+
// export const rawRawIconProp = [String, Function] as PropType<RawIconProp>;
|
|
155
|
+
|
|
156
|
+
const _rawIconProp = [String, Function];
|
|
157
|
+
function rawIconProp() {
|
|
158
|
+
return _rawIconProp;
|
|
159
|
+
}
|
|
160
|
+
function resolveRawIconProp(payload, prop, extraProps) {
|
|
161
|
+
if (!prop) return;
|
|
162
|
+
return typeof prop === 'function' ? prop(input => vue.createVNode(VIcon, vue.mergeProps(input, extraProps), null), payload) : vue.createVNode(VIcon, vue.mergeProps(extraProps, {
|
|
163
|
+
"name": prop
|
|
164
|
+
}), null);
|
|
165
|
+
}
|
|
166
|
+
const iconProps = vueUtils.createPropsOptions({
|
|
167
|
+
name: {
|
|
168
|
+
type: String,
|
|
169
|
+
required: true
|
|
170
|
+
},
|
|
171
|
+
rotate: {
|
|
172
|
+
type: Number
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
const VIcon = vue.defineComponent({
|
|
176
|
+
name: 'VIcon',
|
|
177
|
+
props: { ...iconProps
|
|
178
|
+
},
|
|
179
|
+
emits: {},
|
|
180
|
+
|
|
181
|
+
setup(props, ctx) {
|
|
182
|
+
const iconName = vue.computed(() => props.name);
|
|
183
|
+
const clickable = vue.computed(() => typeof ctx.attrs.onClick !== 'undefined');
|
|
184
|
+
const classes = vue.computed(() => [{
|
|
185
|
+
'v-icon--clickable': clickable.value
|
|
186
|
+
}]);
|
|
187
|
+
const bodyClasses = vue.computed(() => `icon-${iconName.value}`);
|
|
188
|
+
const bodyStyles = vue.computed(() => {
|
|
189
|
+
const {
|
|
190
|
+
rotate
|
|
191
|
+
} = props;
|
|
192
|
+
if (!rotate) return;
|
|
193
|
+
return {
|
|
194
|
+
transform: `rotate(${rotate}deg)`
|
|
195
|
+
};
|
|
196
|
+
});
|
|
197
|
+
return () => vue.createVNode("span", {
|
|
198
|
+
"class": [`v-icon notranslate`, classes.value]
|
|
199
|
+
}, [vue.createVNode("i", {
|
|
200
|
+
"class": ['v-icon__body icon', bodyClasses.value],
|
|
201
|
+
"style": bodyStyles.value
|
|
202
|
+
}, null)]);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
});
|
|
206
|
+
|
|
142
207
|
const {
|
|
143
208
|
props: props$8,
|
|
144
209
|
emits: emits$8
|
|
@@ -151,9 +216,14 @@ const VFormControl = vue.defineComponent({
|
|
|
151
216
|
emits: emits$8,
|
|
152
217
|
|
|
153
218
|
setup(props, ctx) {
|
|
154
|
-
const control = vueKit.useFormControl(props, ctx);
|
|
155
|
-
ctx.expose(control.expose());
|
|
156
219
|
const vui = useVui();
|
|
220
|
+
const control = vueKit.useFormControl(props, ctx, {
|
|
221
|
+
hinttipPrepend: () => vue.createVNode(VIcon, {
|
|
222
|
+
"class": "v-form-control__label__hinttip__icon",
|
|
223
|
+
"name": vui.icon('hinttip')
|
|
224
|
+
}, null)
|
|
225
|
+
});
|
|
226
|
+
ctx.expose(control.expose());
|
|
157
227
|
const colorProvider = useVuiColorProvider();
|
|
158
228
|
const classes = vue.computed(() => [{
|
|
159
229
|
'v-form-control--validating': control.validating,
|
|
@@ -172,6 +242,7 @@ const VFormControl = vue.defineComponent({
|
|
|
172
242
|
const label = control.renderLabel();
|
|
173
243
|
const message = control.renderMessage();
|
|
174
244
|
const appends = control.renderInfoAppends();
|
|
245
|
+
const hinttip = control.renderHinttip();
|
|
175
246
|
return vue.createVNode("div", {
|
|
176
247
|
"class": ['v-form-control', classes.value]
|
|
177
248
|
}, [label && vue.createVNode("label", {
|
|
@@ -179,7 +250,18 @@ const VFormControl = vue.defineComponent({
|
|
|
179
250
|
"onClick": ev => {
|
|
180
251
|
ctx.emit('clickLabel', ev, control);
|
|
181
252
|
}
|
|
182
|
-
}, [label, control.required && vui.getRequiredChip()
|
|
253
|
+
}, [label, control.required && vui.getRequiredChip(), hinttip && vue.createVNode(vueKit.VTooltip, {
|
|
254
|
+
"top": true,
|
|
255
|
+
"openOnHover": false
|
|
256
|
+
}, {
|
|
257
|
+
default: () => [vue.createVNode("div", {
|
|
258
|
+
"class": "v-form-control__label__hinttip__hint"
|
|
259
|
+
}, [hinttip.hint])],
|
|
260
|
+
activator: ctx => vue.createVNode("a", vue.mergeProps({
|
|
261
|
+
"class": "v-form-control__label__hinttip",
|
|
262
|
+
"href": "javascript:void(0)"
|
|
263
|
+
}, ctx.attrs), [hinttip.tip])
|
|
264
|
+
})]), vue.createVNode("div", {
|
|
183
265
|
"class": "v-form-control__body"
|
|
184
266
|
}, [vueKit.renderSlotOrEmpty(ctx.slots, 'default', control), !props.hiddenInfo && vue.createVNode("div", {
|
|
185
267
|
"class": "v-form-control__info"
|
|
@@ -239,7 +321,8 @@ function defineFormSelectorComponent(opts) {
|
|
|
239
321
|
'v-form-selector--stacked': this.stacked
|
|
240
322
|
}],
|
|
241
323
|
"label": this.label,
|
|
242
|
-
"hint": this.hint
|
|
324
|
+
"hint": this.hint,
|
|
325
|
+
"hinttip": this.hinttip
|
|
243
326
|
}, { ...this.$slots,
|
|
244
327
|
default: () => vue.createVNode("div", {
|
|
245
328
|
"class": "v-form-selector__body"
|
|
@@ -567,71 +650,6 @@ const VCardActions = vue.defineComponent({
|
|
|
567
650
|
|
|
568
651
|
});
|
|
569
652
|
|
|
570
|
-
// prop: RawIconProp<T>,
|
|
571
|
-
// payload: () => T,
|
|
572
|
-
// ): RawIconProp {
|
|
573
|
-
// if (!prop || typeof prop !== 'function') {
|
|
574
|
-
// return prop;
|
|
575
|
-
// }
|
|
576
|
-
// const fn = (gen: IconGenerator): VNodeChild => {
|
|
577
|
-
// const t = payload();
|
|
578
|
-
// return prop(gen, t);
|
|
579
|
-
// };
|
|
580
|
-
// return fn;
|
|
581
|
-
// }
|
|
582
|
-
// export const rawRawIconProp = [String, Function] as PropType<RawIconProp>;
|
|
583
|
-
|
|
584
|
-
const _rawIconProp = [String, Function];
|
|
585
|
-
function rawIconProp() {
|
|
586
|
-
return _rawIconProp;
|
|
587
|
-
}
|
|
588
|
-
function resolveRawIconProp(payload, prop, extraProps) {
|
|
589
|
-
if (!prop) return;
|
|
590
|
-
return typeof prop === 'function' ? prop(input => vue.createVNode(VIcon, vue.mergeProps(input, extraProps), null), payload) : vue.createVNode(VIcon, vue.mergeProps(extraProps, {
|
|
591
|
-
"name": prop
|
|
592
|
-
}), null);
|
|
593
|
-
}
|
|
594
|
-
const iconProps = vueUtils.createPropsOptions({
|
|
595
|
-
name: {
|
|
596
|
-
type: String,
|
|
597
|
-
required: true
|
|
598
|
-
},
|
|
599
|
-
rotate: {
|
|
600
|
-
type: Number
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
|
-
const VIcon = vue.defineComponent({
|
|
604
|
-
name: 'VIcon',
|
|
605
|
-
props: { ...iconProps
|
|
606
|
-
},
|
|
607
|
-
emits: {},
|
|
608
|
-
|
|
609
|
-
setup(props, ctx) {
|
|
610
|
-
const iconName = vue.computed(() => props.name);
|
|
611
|
-
const clickable = vue.computed(() => typeof ctx.attrs.onClick !== 'undefined');
|
|
612
|
-
const classes = vue.computed(() => [{
|
|
613
|
-
'v-icon--clickable': clickable.value
|
|
614
|
-
}]);
|
|
615
|
-
const bodyClasses = vue.computed(() => `icon-${iconName.value}`);
|
|
616
|
-
const bodyStyles = vue.computed(() => {
|
|
617
|
-
const {
|
|
618
|
-
rotate
|
|
619
|
-
} = props;
|
|
620
|
-
if (!rotate) return;
|
|
621
|
-
return {
|
|
622
|
-
transform: `rotate(${rotate}deg)`
|
|
623
|
-
};
|
|
624
|
-
});
|
|
625
|
-
return () => vue.createVNode("span", {
|
|
626
|
-
"class": [`v-icon notranslate`, classes.value]
|
|
627
|
-
}, [vue.createVNode("i", {
|
|
628
|
-
"class": ['v-icon__body icon', bodyClasses.value],
|
|
629
|
-
"style": bodyStyles.value
|
|
630
|
-
}, null)]);
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
});
|
|
634
|
-
|
|
635
653
|
function resolveRawVButtonIcon(raw, type = 'main') {
|
|
636
654
|
if (!raw) return;
|
|
637
655
|
return typeof raw === 'function' ? raw : () => vue.createVNode(VIcon, {
|
|
@@ -1384,12 +1402,13 @@ const VNavigationItem = vue.defineComponent({
|
|
|
1384
1402
|
const onClick = ev => {
|
|
1385
1403
|
if (!to.value) {
|
|
1386
1404
|
return toggle();
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
|
|
1405
|
+
} // console.log('★');
|
|
1406
|
+
// open();
|
|
1407
|
+
// if (!to.value) {
|
|
1390
1408
|
// toggle();
|
|
1391
1409
|
// }
|
|
1392
1410
|
// ctx.emit('click', ev);
|
|
1411
|
+
|
|
1393
1412
|
};
|
|
1394
1413
|
|
|
1395
1414
|
const onChangeActive = isActive => {
|
|
@@ -2039,6 +2058,7 @@ const VSelect = vue.defineComponent({
|
|
|
2039
2058
|
"class": ['v-select', this.classes],
|
|
2040
2059
|
"label": this.label,
|
|
2041
2060
|
"hint": this.hint,
|
|
2061
|
+
"hinttip": this.hinttip,
|
|
2042
2062
|
"hiddenInfo": this.hiddenInfo,
|
|
2043
2063
|
"onClickLabel": ev => {
|
|
2044
2064
|
this.focus();
|
|
@@ -2173,6 +2193,7 @@ const VTextField = vue.defineComponent({
|
|
|
2173
2193
|
"class": ['v-text-field', this.classes],
|
|
2174
2194
|
"label": this.label,
|
|
2175
2195
|
"hint": this.hint,
|
|
2196
|
+
"hinttip": this.hinttip,
|
|
2176
2197
|
"onClickLabel": ev => {
|
|
2177
2198
|
this.focus();
|
|
2178
2199
|
}
|
|
@@ -2233,6 +2254,7 @@ const VTextarea = vue.defineComponent({
|
|
|
2233
2254
|
"class": ['v-textarea', this.classes],
|
|
2234
2255
|
"label": this.label,
|
|
2235
2256
|
"hint": this.hint,
|
|
2257
|
+
"hinttip": this.hinttip,
|
|
2236
2258
|
"hiddenInfo": this.hiddenInfo,
|
|
2237
2259
|
"onClickLabel": ev => {
|
|
2238
2260
|
this.focus();
|
|
@@ -2455,6 +2477,7 @@ const VWysiwygEditor = vue.defineComponent({
|
|
|
2455
2477
|
}],
|
|
2456
2478
|
"label": this.label,
|
|
2457
2479
|
"hint": this.hint,
|
|
2480
|
+
"hinttip": this.hinttip,
|
|
2458
2481
|
"hiddenInfo": this.hiddenInfo,
|
|
2459
2482
|
"onClickLabel": ev => {
|
|
2460
2483
|
this.focus('start', {
|
|
@@ -4270,6 +4293,7 @@ function installVuiPlugin(app, opts) {
|
|
|
4270
4293
|
exports.VDialog = vueKit.VDialog;
|
|
4271
4294
|
exports.VMenu = vueKit.VMenu;
|
|
4272
4295
|
exports.VSnackbar = vueKit.VSnackbar;
|
|
4296
|
+
exports.VTooltip = vueKit.VTooltip;
|
|
4273
4297
|
exports.ICON_NAMES = iconFont.ICON_NAMES;
|
|
4274
4298
|
exports.CONTROL_FIELD_VARIANTS = CONTROL_FIELD_VARIANTS;
|
|
4275
4299
|
exports.CONTROL_SIZES = CONTROL_SIZES;
|
|
@@ -4287,6 +4311,7 @@ exports.VContentSwitcher = VContentSwitcher;
|
|
|
4287
4311
|
exports.VDataTable = VDataTable;
|
|
4288
4312
|
exports.VDrawerLayout = VDrawerLayout;
|
|
4289
4313
|
exports.VForm = VForm;
|
|
4314
|
+
exports.VFormControl = VFormControl;
|
|
4290
4315
|
exports.VGridContainer = VGridContainer;
|
|
4291
4316
|
exports.VGridItem = VGridItem;
|
|
4292
4317
|
exports.VHero = VHero;
|
package/dist/vui.cjs.prod.js
CHANGED
|
@@ -139,6 +139,71 @@ function useControlField(props, opts = {}) {
|
|
|
139
139
|
return provider;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
// prop: RawIconProp<T>,
|
|
143
|
+
// payload: () => T,
|
|
144
|
+
// ): RawIconProp {
|
|
145
|
+
// if (!prop || typeof prop !== 'function') {
|
|
146
|
+
// return prop;
|
|
147
|
+
// }
|
|
148
|
+
// const fn = (gen: IconGenerator): VNodeChild => {
|
|
149
|
+
// const t = payload();
|
|
150
|
+
// return prop(gen, t);
|
|
151
|
+
// };
|
|
152
|
+
// return fn;
|
|
153
|
+
// }
|
|
154
|
+
// export const rawRawIconProp = [String, Function] as PropType<RawIconProp>;
|
|
155
|
+
|
|
156
|
+
const _rawIconProp = [String, Function];
|
|
157
|
+
function rawIconProp() {
|
|
158
|
+
return _rawIconProp;
|
|
159
|
+
}
|
|
160
|
+
function resolveRawIconProp(payload, prop, extraProps) {
|
|
161
|
+
if (!prop) return;
|
|
162
|
+
return typeof prop === 'function' ? prop(input => vue.createVNode(VIcon, vue.mergeProps(input, extraProps), null), payload) : vue.createVNode(VIcon, vue.mergeProps(extraProps, {
|
|
163
|
+
"name": prop
|
|
164
|
+
}), null);
|
|
165
|
+
}
|
|
166
|
+
const iconProps = vueUtils.createPropsOptions({
|
|
167
|
+
name: {
|
|
168
|
+
type: String,
|
|
169
|
+
required: true
|
|
170
|
+
},
|
|
171
|
+
rotate: {
|
|
172
|
+
type: Number
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
const VIcon = vue.defineComponent({
|
|
176
|
+
name: 'VIcon',
|
|
177
|
+
props: { ...iconProps
|
|
178
|
+
},
|
|
179
|
+
emits: {},
|
|
180
|
+
|
|
181
|
+
setup(props, ctx) {
|
|
182
|
+
const iconName = vue.computed(() => props.name);
|
|
183
|
+
const clickable = vue.computed(() => typeof ctx.attrs.onClick !== 'undefined');
|
|
184
|
+
const classes = vue.computed(() => [{
|
|
185
|
+
'v-icon--clickable': clickable.value
|
|
186
|
+
}]);
|
|
187
|
+
const bodyClasses = vue.computed(() => `icon-${iconName.value}`);
|
|
188
|
+
const bodyStyles = vue.computed(() => {
|
|
189
|
+
const {
|
|
190
|
+
rotate
|
|
191
|
+
} = props;
|
|
192
|
+
if (!rotate) return;
|
|
193
|
+
return {
|
|
194
|
+
transform: `rotate(${rotate}deg)`
|
|
195
|
+
};
|
|
196
|
+
});
|
|
197
|
+
return () => vue.createVNode("span", {
|
|
198
|
+
"class": [`v-icon notranslate`, classes.value]
|
|
199
|
+
}, [vue.createVNode("i", {
|
|
200
|
+
"class": ['v-icon__body icon', bodyClasses.value],
|
|
201
|
+
"style": bodyStyles.value
|
|
202
|
+
}, null)]);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
});
|
|
206
|
+
|
|
142
207
|
const {
|
|
143
208
|
props: props$8,
|
|
144
209
|
emits: emits$8
|
|
@@ -151,9 +216,14 @@ const VFormControl = vue.defineComponent({
|
|
|
151
216
|
emits: emits$8,
|
|
152
217
|
|
|
153
218
|
setup(props, ctx) {
|
|
154
|
-
const control = vueKit.useFormControl(props, ctx);
|
|
155
|
-
ctx.expose(control.expose());
|
|
156
219
|
const vui = useVui();
|
|
220
|
+
const control = vueKit.useFormControl(props, ctx, {
|
|
221
|
+
hinttipPrepend: () => vue.createVNode(VIcon, {
|
|
222
|
+
"class": "v-form-control__label__hinttip__icon",
|
|
223
|
+
"name": vui.icon('hinttip')
|
|
224
|
+
}, null)
|
|
225
|
+
});
|
|
226
|
+
ctx.expose(control.expose());
|
|
157
227
|
const colorProvider = useVuiColorProvider();
|
|
158
228
|
const classes = vue.computed(() => [{
|
|
159
229
|
'v-form-control--validating': control.validating,
|
|
@@ -172,6 +242,7 @@ const VFormControl = vue.defineComponent({
|
|
|
172
242
|
const label = control.renderLabel();
|
|
173
243
|
const message = control.renderMessage();
|
|
174
244
|
const appends = control.renderInfoAppends();
|
|
245
|
+
const hinttip = control.renderHinttip();
|
|
175
246
|
return vue.createVNode("div", {
|
|
176
247
|
"class": ['v-form-control', classes.value]
|
|
177
248
|
}, [label && vue.createVNode("label", {
|
|
@@ -179,7 +250,18 @@ const VFormControl = vue.defineComponent({
|
|
|
179
250
|
"onClick": ev => {
|
|
180
251
|
ctx.emit('clickLabel', ev, control);
|
|
181
252
|
}
|
|
182
|
-
}, [label, control.required && vui.getRequiredChip()
|
|
253
|
+
}, [label, control.required && vui.getRequiredChip(), hinttip && vue.createVNode(vueKit.VTooltip, {
|
|
254
|
+
"top": true,
|
|
255
|
+
"openOnHover": false
|
|
256
|
+
}, {
|
|
257
|
+
default: () => [vue.createVNode("div", {
|
|
258
|
+
"class": "v-form-control__label__hinttip__hint"
|
|
259
|
+
}, [hinttip.hint])],
|
|
260
|
+
activator: ctx => vue.createVNode("a", vue.mergeProps({
|
|
261
|
+
"class": "v-form-control__label__hinttip",
|
|
262
|
+
"href": "javascript:void(0)"
|
|
263
|
+
}, ctx.attrs), [hinttip.tip])
|
|
264
|
+
})]), vue.createVNode("div", {
|
|
183
265
|
"class": "v-form-control__body"
|
|
184
266
|
}, [vueKit.renderSlotOrEmpty(ctx.slots, 'default', control), !props.hiddenInfo && vue.createVNode("div", {
|
|
185
267
|
"class": "v-form-control__info"
|
|
@@ -239,7 +321,8 @@ function defineFormSelectorComponent(opts) {
|
|
|
239
321
|
'v-form-selector--stacked': this.stacked
|
|
240
322
|
}],
|
|
241
323
|
"label": this.label,
|
|
242
|
-
"hint": this.hint
|
|
324
|
+
"hint": this.hint,
|
|
325
|
+
"hinttip": this.hinttip
|
|
243
326
|
}, { ...this.$slots,
|
|
244
327
|
default: () => vue.createVNode("div", {
|
|
245
328
|
"class": "v-form-selector__body"
|
|
@@ -567,71 +650,6 @@ const VCardActions = vue.defineComponent({
|
|
|
567
650
|
|
|
568
651
|
});
|
|
569
652
|
|
|
570
|
-
// prop: RawIconProp<T>,
|
|
571
|
-
// payload: () => T,
|
|
572
|
-
// ): RawIconProp {
|
|
573
|
-
// if (!prop || typeof prop !== 'function') {
|
|
574
|
-
// return prop;
|
|
575
|
-
// }
|
|
576
|
-
// const fn = (gen: IconGenerator): VNodeChild => {
|
|
577
|
-
// const t = payload();
|
|
578
|
-
// return prop(gen, t);
|
|
579
|
-
// };
|
|
580
|
-
// return fn;
|
|
581
|
-
// }
|
|
582
|
-
// export const rawRawIconProp = [String, Function] as PropType<RawIconProp>;
|
|
583
|
-
|
|
584
|
-
const _rawIconProp = [String, Function];
|
|
585
|
-
function rawIconProp() {
|
|
586
|
-
return _rawIconProp;
|
|
587
|
-
}
|
|
588
|
-
function resolveRawIconProp(payload, prop, extraProps) {
|
|
589
|
-
if (!prop) return;
|
|
590
|
-
return typeof prop === 'function' ? prop(input => vue.createVNode(VIcon, vue.mergeProps(input, extraProps), null), payload) : vue.createVNode(VIcon, vue.mergeProps(extraProps, {
|
|
591
|
-
"name": prop
|
|
592
|
-
}), null);
|
|
593
|
-
}
|
|
594
|
-
const iconProps = vueUtils.createPropsOptions({
|
|
595
|
-
name: {
|
|
596
|
-
type: String,
|
|
597
|
-
required: true
|
|
598
|
-
},
|
|
599
|
-
rotate: {
|
|
600
|
-
type: Number
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
|
-
const VIcon = vue.defineComponent({
|
|
604
|
-
name: 'VIcon',
|
|
605
|
-
props: { ...iconProps
|
|
606
|
-
},
|
|
607
|
-
emits: {},
|
|
608
|
-
|
|
609
|
-
setup(props, ctx) {
|
|
610
|
-
const iconName = vue.computed(() => props.name);
|
|
611
|
-
const clickable = vue.computed(() => typeof ctx.attrs.onClick !== 'undefined');
|
|
612
|
-
const classes = vue.computed(() => [{
|
|
613
|
-
'v-icon--clickable': clickable.value
|
|
614
|
-
}]);
|
|
615
|
-
const bodyClasses = vue.computed(() => `icon-${iconName.value}`);
|
|
616
|
-
const bodyStyles = vue.computed(() => {
|
|
617
|
-
const {
|
|
618
|
-
rotate
|
|
619
|
-
} = props;
|
|
620
|
-
if (!rotate) return;
|
|
621
|
-
return {
|
|
622
|
-
transform: `rotate(${rotate}deg)`
|
|
623
|
-
};
|
|
624
|
-
});
|
|
625
|
-
return () => vue.createVNode("span", {
|
|
626
|
-
"class": [`v-icon notranslate`, classes.value]
|
|
627
|
-
}, [vue.createVNode("i", {
|
|
628
|
-
"class": ['v-icon__body icon', bodyClasses.value],
|
|
629
|
-
"style": bodyStyles.value
|
|
630
|
-
}, null)]);
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
});
|
|
634
|
-
|
|
635
653
|
function resolveRawVButtonIcon(raw, type = 'main') {
|
|
636
654
|
if (!raw) return;
|
|
637
655
|
return typeof raw === 'function' ? raw : () => vue.createVNode(VIcon, {
|
|
@@ -1384,12 +1402,13 @@ const VNavigationItem = vue.defineComponent({
|
|
|
1384
1402
|
const onClick = ev => {
|
|
1385
1403
|
if (!to.value) {
|
|
1386
1404
|
return toggle();
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
|
|
1405
|
+
} // console.log('★');
|
|
1406
|
+
// open();
|
|
1407
|
+
// if (!to.value) {
|
|
1390
1408
|
// toggle();
|
|
1391
1409
|
// }
|
|
1392
1410
|
// ctx.emit('click', ev);
|
|
1411
|
+
|
|
1393
1412
|
};
|
|
1394
1413
|
|
|
1395
1414
|
const onChangeActive = isActive => {
|
|
@@ -2039,6 +2058,7 @@ const VSelect = vue.defineComponent({
|
|
|
2039
2058
|
"class": ['v-select', this.classes],
|
|
2040
2059
|
"label": this.label,
|
|
2041
2060
|
"hint": this.hint,
|
|
2061
|
+
"hinttip": this.hinttip,
|
|
2042
2062
|
"hiddenInfo": this.hiddenInfo,
|
|
2043
2063
|
"onClickLabel": ev => {
|
|
2044
2064
|
this.focus();
|
|
@@ -2173,6 +2193,7 @@ const VTextField = vue.defineComponent({
|
|
|
2173
2193
|
"class": ['v-text-field', this.classes],
|
|
2174
2194
|
"label": this.label,
|
|
2175
2195
|
"hint": this.hint,
|
|
2196
|
+
"hinttip": this.hinttip,
|
|
2176
2197
|
"onClickLabel": ev => {
|
|
2177
2198
|
this.focus();
|
|
2178
2199
|
}
|
|
@@ -2233,6 +2254,7 @@ const VTextarea = vue.defineComponent({
|
|
|
2233
2254
|
"class": ['v-textarea', this.classes],
|
|
2234
2255
|
"label": this.label,
|
|
2235
2256
|
"hint": this.hint,
|
|
2257
|
+
"hinttip": this.hinttip,
|
|
2236
2258
|
"hiddenInfo": this.hiddenInfo,
|
|
2237
2259
|
"onClickLabel": ev => {
|
|
2238
2260
|
this.focus();
|
|
@@ -2455,6 +2477,7 @@ const VWysiwygEditor = vue.defineComponent({
|
|
|
2455
2477
|
}],
|
|
2456
2478
|
"label": this.label,
|
|
2457
2479
|
"hint": this.hint,
|
|
2480
|
+
"hinttip": this.hinttip,
|
|
2458
2481
|
"hiddenInfo": this.hiddenInfo,
|
|
2459
2482
|
"onClickLabel": ev => {
|
|
2460
2483
|
this.focus('start', {
|
|
@@ -4270,6 +4293,7 @@ function installVuiPlugin(app, opts) {
|
|
|
4270
4293
|
exports.VDialog = vueKit.VDialog;
|
|
4271
4294
|
exports.VMenu = vueKit.VMenu;
|
|
4272
4295
|
exports.VSnackbar = vueKit.VSnackbar;
|
|
4296
|
+
exports.VTooltip = vueKit.VTooltip;
|
|
4273
4297
|
exports.ICON_NAMES = iconFont.ICON_NAMES;
|
|
4274
4298
|
exports.CONTROL_FIELD_VARIANTS = CONTROL_FIELD_VARIANTS;
|
|
4275
4299
|
exports.CONTROL_SIZES = CONTROL_SIZES;
|
|
@@ -4287,6 +4311,7 @@ exports.VContentSwitcher = VContentSwitcher;
|
|
|
4287
4311
|
exports.VDataTable = VDataTable;
|
|
4288
4312
|
exports.VDrawerLayout = VDrawerLayout;
|
|
4289
4313
|
exports.VForm = VForm;
|
|
4314
|
+
exports.VFormControl = VFormControl;
|
|
4290
4315
|
exports.VGridContainer = VGridContainer;
|
|
4291
4316
|
exports.VGridItem = VGridItem;
|
|
4292
4317
|
exports.VHero = VHero;
|
package/dist/vui.css
CHANGED
|
@@ -866,6 +866,8 @@ thead th {
|
|
|
866
866
|
--my-message-color: var(--control-disabled-color);
|
|
867
867
|
}
|
|
868
868
|
.v-form-control__label {
|
|
869
|
+
display: flex;
|
|
870
|
+
align-items: center;
|
|
869
871
|
align-self: flex-start;
|
|
870
872
|
font-size: var(--control-label-font-size);
|
|
871
873
|
font-weight: var(--control-label-font-weight);
|
|
@@ -873,6 +875,32 @@ thead th {
|
|
|
873
875
|
color: var(--my-label-color);
|
|
874
876
|
letter-spacing: 0.00938em;
|
|
875
877
|
}
|
|
878
|
+
.v-form-control__label__hinttip {
|
|
879
|
+
display: inline-flex;
|
|
880
|
+
align-items: center;
|
|
881
|
+
margin-top: -0.2em;
|
|
882
|
+
margin-left: 0.6em;
|
|
883
|
+
font-size: 80%;
|
|
884
|
+
line-height: 1;
|
|
885
|
+
color: inherit;
|
|
886
|
+
text-decoration: none;
|
|
887
|
+
letter-spacing: normal;
|
|
888
|
+
cursor: pointer;
|
|
889
|
+
}
|
|
890
|
+
.v-form-control__label__hinttip__icon {
|
|
891
|
+
position: relative;
|
|
892
|
+
display: flex;
|
|
893
|
+
align-items: center;
|
|
894
|
+
justify-content: center;
|
|
895
|
+
font-size: 120%;
|
|
896
|
+
text-decoration: none !important;
|
|
897
|
+
}
|
|
898
|
+
.v-form-control__label__hinttip:hover .v-form-control__label__hinttip__icon::before, .v-form-control__label__hinttip:focus .v-form-control__label__hinttip__icon::before {
|
|
899
|
+
opacity: 0.1;
|
|
900
|
+
}
|
|
901
|
+
.v-form-control__label__hinttip__hint {
|
|
902
|
+
font-size: calc(var(--root-em) * 0.75);
|
|
903
|
+
}
|
|
876
904
|
.v-form-control__info {
|
|
877
905
|
display: flex;
|
|
878
906
|
padding-top: 3px;
|
|
@@ -890,6 +918,23 @@ thead th {
|
|
|
890
918
|
flex: 0 1;
|
|
891
919
|
margin-left: auto;
|
|
892
920
|
}
|
|
921
|
+
.v-icon {
|
|
922
|
+
display: inline-flex;
|
|
923
|
+
align-items: center;
|
|
924
|
+
justify-content: center;
|
|
925
|
+
width: 1.25em;
|
|
926
|
+
user-select: none;
|
|
927
|
+
aspect-ratio: 1/1;
|
|
928
|
+
}
|
|
929
|
+
.v-icon--clickable {
|
|
930
|
+
cursor: pointer;
|
|
931
|
+
}
|
|
932
|
+
.v-icon__body {
|
|
933
|
+
display: inline-flex;
|
|
934
|
+
align-items: center;
|
|
935
|
+
justify-content: center;
|
|
936
|
+
transition: transform 150ms linear;
|
|
937
|
+
}
|
|
893
938
|
.v-grid-item {
|
|
894
939
|
display: block;
|
|
895
940
|
}
|
|
@@ -983,23 +1028,6 @@ thead th {
|
|
|
983
1028
|
margin-top: 0;
|
|
984
1029
|
margin-bottom: 0;
|
|
985
1030
|
}
|
|
986
|
-
.v-icon {
|
|
987
|
-
display: inline-flex;
|
|
988
|
-
align-items: center;
|
|
989
|
-
justify-content: center;
|
|
990
|
-
width: 1.25em;
|
|
991
|
-
user-select: none;
|
|
992
|
-
aspect-ratio: 1/1;
|
|
993
|
-
}
|
|
994
|
-
.v-icon--clickable {
|
|
995
|
-
cursor: pointer;
|
|
996
|
-
}
|
|
997
|
-
.v-icon__body {
|
|
998
|
-
display: inline-flex;
|
|
999
|
-
align-items: center;
|
|
1000
|
-
justify-content: center;
|
|
1001
|
-
transition: transform 150ms linear;
|
|
1002
|
-
}
|
|
1003
1031
|
.v-button {
|
|
1004
1032
|
--padding: 1em;
|
|
1005
1033
|
--height: 2.5714285714em;
|