@fastkit/vui 0.9.0 → 0.10.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/tool/index.js +16 -23
- package/dist/vui.cjs.js +358 -718
- package/dist/vui.cjs.prod.js +358 -718
- package/dist/vui.d.ts +25 -26
- package/dist/vui.min.css +1 -1
- package/dist/vui.min.css.map +1 -1
- package/dist/vui.mjs +356 -709
- package/package.json +24 -14
- package/src/components/VWysiwygEditor/VWysiwygEditor.tsx +1 -1
- package/src/plugin.tsx +1 -1
- package/src/styles/core/functions.scss +1 -1
package/dist/vui.mjs
CHANGED
|
@@ -13,7 +13,7 @@ export { ICON_NAMES } from '@fastkit/icon-font';
|
|
|
13
13
|
import { VAppContainer, VAppLayoutControl } from '@fastkit/vue-app-layout';
|
|
14
14
|
import { createTextableProps, createTextableEmits, TextableControl } from '@fastkit/vue-form-control';
|
|
15
15
|
import { useEditor, EditorContent, BubbleMenu } from '@tiptap/vue-3';
|
|
16
|
-
import StarterKit from '@tiptap/starter-kit';
|
|
16
|
+
import { StarterKit } from '@tiptap/starter-kit';
|
|
17
17
|
import { Extension } from '@tiptap/core';
|
|
18
18
|
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
19
19
|
import { Plugin, PluginKey, TextSelection } from 'prosemirror-state';
|
|
@@ -144,6 +144,7 @@ function useControlField(props, opts = {}) {
|
|
|
144
144
|
return provider;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
// export function toRawIconProp<T = void>(
|
|
147
148
|
// prop: RawIconProp<T>,
|
|
148
149
|
// payload: () => T,
|
|
149
150
|
// ): RawIconProp {
|
|
@@ -157,7 +158,6 @@ function useControlField(props, opts = {}) {
|
|
|
157
158
|
// return fn;
|
|
158
159
|
// }
|
|
159
160
|
// export const rawRawIconProp = [String, Function] as PropType<RawIconProp>;
|
|
160
|
-
|
|
161
161
|
const _rawIconProp = [String, Function];
|
|
162
162
|
function rawIconProp() {
|
|
163
163
|
return _rawIconProp;
|
|
@@ -177,12 +177,12 @@ const iconProps = createPropsOptions$1({
|
|
|
177
177
|
type: Number
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
|
-
const VIcon = defineComponent({
|
|
180
|
+
const VIcon = /* @__PURE__ */ defineComponent({
|
|
181
181
|
name: 'VIcon',
|
|
182
|
-
props: {
|
|
182
|
+
props: {
|
|
183
|
+
...iconProps
|
|
183
184
|
},
|
|
184
185
|
emits: {},
|
|
185
|
-
|
|
186
186
|
setup(props, ctx) {
|
|
187
187
|
const iconName = computed(() => props.name);
|
|
188
188
|
const clickable = computed(() => typeof ctx.attrs.onClick !== 'undefined');
|
|
@@ -206,7 +206,6 @@ const VIcon = defineComponent({
|
|
|
206
206
|
"style": bodyStyles.value
|
|
207
207
|
}, null)]);
|
|
208
208
|
}
|
|
209
|
-
|
|
210
209
|
});
|
|
211
210
|
|
|
212
211
|
const {
|
|
@@ -221,7 +220,6 @@ function createRequiredChipRenderer(required, props, vui = useVui()) {
|
|
|
221
220
|
requiredChip
|
|
222
221
|
} = props;
|
|
223
222
|
if (requiredChip === false) return;
|
|
224
|
-
|
|
225
223
|
if (requiredChip) {
|
|
226
224
|
if (typeof requiredChip === 'string') {
|
|
227
225
|
chip = requiredChip;
|
|
@@ -229,22 +227,20 @@ function createRequiredChipRenderer(required, props, vui = useVui()) {
|
|
|
229
227
|
chip = requiredChip();
|
|
230
228
|
}
|
|
231
229
|
}
|
|
232
|
-
|
|
233
230
|
if (chip === undefined) {
|
|
234
231
|
chip = vui.getRequiredChip();
|
|
235
232
|
}
|
|
236
|
-
|
|
237
233
|
return chip;
|
|
238
234
|
};
|
|
239
235
|
}
|
|
240
|
-
const VFormControl = defineComponent({
|
|
236
|
+
const VFormControl = /* @__PURE__ */ defineComponent({
|
|
241
237
|
name: 'VFormControl',
|
|
242
|
-
props: {
|
|
238
|
+
props: {
|
|
239
|
+
...props$8,
|
|
243
240
|
...defineSlotsProps(),
|
|
244
241
|
error: Boolean
|
|
245
242
|
},
|
|
246
243
|
emits: emits$8,
|
|
247
|
-
|
|
248
244
|
setup(props, ctx) {
|
|
249
245
|
const vui = useVui();
|
|
250
246
|
const control = useFormControl(props, ctx, {
|
|
@@ -257,15 +253,12 @@ const VFormControl = defineComponent({
|
|
|
257
253
|
let {
|
|
258
254
|
hinttipDelay
|
|
259
255
|
} = control;
|
|
260
|
-
|
|
261
256
|
if (hinttipDelay == null) {
|
|
262
257
|
hinttipDelay = vui.setting('hinttipDelay');
|
|
263
258
|
}
|
|
264
|
-
|
|
265
259
|
if (hinttipDelay == null) {
|
|
266
260
|
hinttipDelay = 500;
|
|
267
261
|
}
|
|
268
|
-
|
|
269
262
|
return hinttipDelay;
|
|
270
263
|
});
|
|
271
264
|
ctx.expose(control.expose());
|
|
@@ -320,7 +313,6 @@ const VFormControl = defineComponent({
|
|
|
320
313
|
}, [appends])])])]);
|
|
321
314
|
};
|
|
322
315
|
}
|
|
323
|
-
|
|
324
316
|
});
|
|
325
317
|
|
|
326
318
|
function defineFormSelectorComponent(opts) {
|
|
@@ -336,97 +328,100 @@ function defineFormSelectorComponent(opts) {
|
|
|
336
328
|
} = createFormSelectorSettings({
|
|
337
329
|
defaultMultiple
|
|
338
330
|
});
|
|
339
|
-
return defineComponent({
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
331
|
+
return (/* @__PURE__ */ defineComponent({
|
|
332
|
+
name: opts.name,
|
|
333
|
+
props: {
|
|
334
|
+
...props,
|
|
335
|
+
...createFormControlProps(),
|
|
336
|
+
...createControlProps(),
|
|
337
|
+
stacked: {
|
|
338
|
+
type: Boolean,
|
|
339
|
+
default: true
|
|
340
|
+
},
|
|
341
|
+
// eslint-disable-next-line vue/require-prop-types
|
|
342
|
+
loadingMessage: {},
|
|
343
|
+
// eslint-disable-next-line vue/require-prop-types
|
|
344
|
+
failedToLoadItemsMessage: {},
|
|
345
|
+
...defineSlotsProps()
|
|
347
346
|
},
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
});
|
|
347
|
+
emits,
|
|
348
|
+
setup(props, ctx) {
|
|
349
|
+
const selectorControl = useFormSelectorControl(props, ctx, {
|
|
350
|
+
nodeType,
|
|
351
|
+
defaultMultiple
|
|
352
|
+
});
|
|
353
|
+
const control = useControl(props);
|
|
354
|
+
const vui = useVui();
|
|
355
|
+
const loadingMessageRef = computed(() => {
|
|
356
|
+
const slot = resolveVNodeChildOrSlots(props.loadingMessage, vui.setting('loadingMessage'), 'Loading...');
|
|
357
|
+
return slot && slot(vui);
|
|
358
|
+
});
|
|
359
|
+
const failedToLoadItemsMessageRef = computed(() => {
|
|
360
|
+
const slot = resolveVNodeChildOrSlots(props.failedToLoadItemsMessage, vui.setting('failedToLoadDataMessage'), 'Failed to load data.');
|
|
361
|
+
return slot && slot(vui);
|
|
362
|
+
});
|
|
363
|
+
return {
|
|
364
|
+
...selectorControl.expose(),
|
|
365
|
+
...control,
|
|
366
|
+
loadingMessageRef,
|
|
367
|
+
failedToLoadItemsMessageRef
|
|
368
|
+
};
|
|
369
|
+
},
|
|
370
|
+
render() {
|
|
371
|
+
const {
|
|
372
|
+
selectorControl
|
|
373
|
+
} = this;
|
|
374
|
+
return createVNode(VFormControl, {
|
|
375
|
+
"nodeControl": this.nodeControl,
|
|
376
|
+
"focused": this.nodeControl.focused,
|
|
377
|
+
"hiddenInfo": this.hiddenInfo,
|
|
378
|
+
"class": ['v-form-selector', className, {
|
|
379
|
+
...this.classes,
|
|
380
|
+
'v-form-selector--stacked': this.stacked
|
|
381
|
+
}],
|
|
382
|
+
"label": this.label,
|
|
383
|
+
"hint": this.hint,
|
|
384
|
+
"hinttip": this.hinttip,
|
|
385
|
+
"requiredChip": this.requiredChip,
|
|
386
|
+
"error": selectorControl.itemsLoadFailed
|
|
387
|
+
}, {
|
|
388
|
+
...this.$slots,
|
|
389
|
+
default: () => createVNode("div", {
|
|
390
|
+
"class": "v-form-selector__body"
|
|
391
|
+
}, [selectorControl.itemsLoadFailed && createVNode("div", {
|
|
392
|
+
"key": "failed",
|
|
393
|
+
"class": "v-form-selector__placeholder v-form-selector__placeholder--error"
|
|
394
|
+
}, [this.failedToLoadItemsMessageRef]), selectorControl.itemsLoading && createVNode("div", {
|
|
395
|
+
"key": "loading",
|
|
396
|
+
"class": "v-form-selector__placeholder"
|
|
397
|
+
}, [createVNode(VProgressCircular, {
|
|
398
|
+
"indeterminate": true,
|
|
399
|
+
"class": "mr-1",
|
|
400
|
+
"size": CONTROL_LOADING_SPINNER_SIZES[this.size || 'md']
|
|
401
|
+
}, null), this.loadingMessageRef]), this.propGroups.map(group => {
|
|
402
|
+
const {
|
|
403
|
+
items
|
|
404
|
+
} = group;
|
|
405
|
+
return createVNode(Fragment, null, [items.map(attrs => {
|
|
406
|
+
const selected = selectorControl.isSelected(attrs.value);
|
|
407
|
+
return itemRenderer({
|
|
408
|
+
selected,
|
|
409
|
+
control: selectorControl,
|
|
410
|
+
attrs: {
|
|
411
|
+
...attrs,
|
|
412
|
+
modelValue: selected,
|
|
413
|
+
key: attrs.value
|
|
414
|
+
},
|
|
415
|
+
slots: {
|
|
416
|
+
default: () => attrs.label(this.selectorControl)
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
})]);
|
|
420
|
+
}), renderSlotOrEmpty(this.$slots, 'default')])
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
})
|
|
424
|
+
);
|
|
430
425
|
}
|
|
431
426
|
|
|
432
427
|
function createElevationProps() {
|
|
@@ -449,8 +444,7 @@ function useElevation(props, opts = {}) {
|
|
|
449
444
|
function _isSlot$f(s) {
|
|
450
445
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
451
446
|
}
|
|
452
|
-
|
|
453
|
-
const VSkeltonLoaderBone = defineComponent({
|
|
447
|
+
const VSkeltonLoaderBone = /* @__PURE__ */ defineComponent({
|
|
454
448
|
name: 'VSkeltonLoaderBone',
|
|
455
449
|
inheritAttrs: false,
|
|
456
450
|
props: {
|
|
@@ -459,11 +453,9 @@ const VSkeltonLoaderBone = defineComponent({
|
|
|
459
453
|
default: 'div'
|
|
460
454
|
}
|
|
461
455
|
},
|
|
462
|
-
|
|
463
456
|
setup(props, ctx) {
|
|
464
457
|
return () => {
|
|
465
458
|
let _slot;
|
|
466
|
-
|
|
467
459
|
const TagName = props.tag;
|
|
468
460
|
return createVNode(TagName, mergeProps(ctx.attrs, {
|
|
469
461
|
"class": "v-skelton-loader-bone"
|
|
@@ -472,23 +464,20 @@ const VSkeltonLoaderBone = defineComponent({
|
|
|
472
464
|
});
|
|
473
465
|
};
|
|
474
466
|
}
|
|
475
|
-
|
|
476
467
|
});
|
|
477
468
|
|
|
478
469
|
const IMAGE_ATTRS = ['alt', 'crossorigin', 'decoding', 'sizes', 'src', 'srcset', 'usemap'];
|
|
479
470
|
function splitAttrs(attrs) {
|
|
480
|
-
const el = {
|
|
471
|
+
const el = {
|
|
472
|
+
...attrs
|
|
481
473
|
};
|
|
482
474
|
const img = {};
|
|
483
|
-
|
|
484
475
|
for (const ATTR of IMAGE_ATTRS) {
|
|
485
476
|
const value = attrs[ATTR];
|
|
486
|
-
|
|
487
477
|
if (value != null) {
|
|
488
478
|
img[ATTR] = value;
|
|
489
479
|
}
|
|
490
480
|
}
|
|
491
|
-
|
|
492
481
|
return {
|
|
493
482
|
el,
|
|
494
483
|
img
|
|
@@ -496,7 +485,6 @@ function splitAttrs(attrs) {
|
|
|
496
485
|
}
|
|
497
486
|
const NUMBERISH_PROP = [Number, String];
|
|
498
487
|
const DEFAULT_HEIGHT = 150;
|
|
499
|
-
|
|
500
488
|
const resolveBusyImageSizeValue = source => {
|
|
501
489
|
if (source == null) return;
|
|
502
490
|
return isNaN(source) ? String(source) : `${source}px`;
|
|
@@ -505,11 +493,10 @@ const resolveBusyImageSizeValue = source => {
|
|
|
505
493
|
* 画像表示用コンポーネント
|
|
506
494
|
* <img /> タグのように振る舞うが、ローディング表示や、表示サイズの調整など、ちょっといい感じにやるためのコンポーネント
|
|
507
495
|
*/
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
const VBusyImage = defineComponent({
|
|
496
|
+
const VBusyImage = /* @__PURE__ */ defineComponent({
|
|
511
497
|
name: 'VBusyImage',
|
|
512
|
-
props: {
|
|
498
|
+
props: {
|
|
499
|
+
...undefined,
|
|
513
500
|
aspectRatio: String,
|
|
514
501
|
width: NUMBERISH_PROP,
|
|
515
502
|
height: NUMBERISH_PROP,
|
|
@@ -520,7 +507,6 @@ const VBusyImage = defineComponent({
|
|
|
520
507
|
load: ev => true,
|
|
521
508
|
error: ev => true
|
|
522
509
|
},
|
|
523
|
-
|
|
524
510
|
setup(props, ctx) {
|
|
525
511
|
const loadStateRef = ref(props.cover && isAvailableSrc(ctx.attrs.src) ? 'loading' : 'pending');
|
|
526
512
|
const attrsRef = computed(() => splitAttrs(ctx.attrs));
|
|
@@ -544,30 +530,24 @@ const VBusyImage = defineComponent({
|
|
|
544
530
|
width,
|
|
545
531
|
height
|
|
546
532
|
} = props;
|
|
547
|
-
|
|
548
533
|
if (height == null && cover) {
|
|
549
534
|
height = DEFAULT_HEIGHT;
|
|
550
535
|
}
|
|
551
|
-
|
|
552
536
|
if (width == null && cover) {
|
|
553
537
|
width = height;
|
|
554
538
|
}
|
|
555
|
-
|
|
556
539
|
width = resolveBusyImageSizeValue(width);
|
|
557
540
|
height = resolveBusyImageSizeValue(height);
|
|
558
541
|
main.width = width;
|
|
559
542
|
main.height = height;
|
|
560
543
|
placeholder.width = width;
|
|
561
544
|
placeholder.height = height;
|
|
562
|
-
|
|
563
545
|
if (placeholder.height == null) {
|
|
564
546
|
placeholder.height = resolveBusyImageSizeValue(DEFAULT_HEIGHT);
|
|
565
547
|
}
|
|
566
|
-
|
|
567
548
|
if (placeholder.width == null) {
|
|
568
549
|
placeholder.width = placeholder.height;
|
|
569
550
|
}
|
|
570
|
-
|
|
571
551
|
return {
|
|
572
552
|
placeholder,
|
|
573
553
|
main
|
|
@@ -579,22 +559,19 @@ const VBusyImage = defineComponent({
|
|
|
579
559
|
value: coverImage
|
|
580
560
|
} = coverImageRef;
|
|
581
561
|
const coverSrc = coverImage && coverImage.src;
|
|
582
|
-
const styles = {
|
|
562
|
+
const styles = {
|
|
563
|
+
...currentRectRef.value
|
|
583
564
|
};
|
|
584
|
-
|
|
585
565
|
if (coverSrc) {
|
|
586
566
|
styles.backgroundImage = `url(${coverSrc})`;
|
|
587
567
|
}
|
|
588
|
-
|
|
589
568
|
return styles;
|
|
590
569
|
});
|
|
591
570
|
let booted = false;
|
|
592
571
|
watch(() => ctx.attrs.src, value => {
|
|
593
572
|
coverImageRef.value = undefined;
|
|
594
|
-
|
|
595
573
|
if (isAvailableSrc(value)) {
|
|
596
574
|
loadStateRef.value = 'loading';
|
|
597
|
-
|
|
598
575
|
if (props.cover) {
|
|
599
576
|
loadImage(value).then(image => {
|
|
600
577
|
coverImageRef.value = image;
|
|
@@ -609,7 +586,6 @@ const VBusyImage = defineComponent({
|
|
|
609
586
|
}, {
|
|
610
587
|
immediate: IN_WINDOW
|
|
611
588
|
});
|
|
612
|
-
|
|
613
589
|
const setManualState = loadType => {
|
|
614
590
|
loadStateRef.value = loadType === 'load' ? 'loaded' : 'error';
|
|
615
591
|
const ev = new Event(loadType, {
|
|
@@ -619,13 +595,11 @@ const VBusyImage = defineComponent({
|
|
|
619
595
|
});
|
|
620
596
|
ctx.emit(loadType, ev);
|
|
621
597
|
};
|
|
622
|
-
|
|
623
598
|
onMounted(() => {
|
|
624
599
|
if (booted || props.cover) return;
|
|
625
600
|
const image = nodeRef.value;
|
|
626
601
|
if (!image) return;
|
|
627
602
|
const loadType = imageIsReady(image);
|
|
628
|
-
|
|
629
603
|
if (loadType) {
|
|
630
604
|
setManualState(loadType);
|
|
631
605
|
}
|
|
@@ -633,19 +607,16 @@ const VBusyImage = defineComponent({
|
|
|
633
607
|
onBeforeUnmount(() => {
|
|
634
608
|
coverImageRef.value = undefined;
|
|
635
609
|
});
|
|
636
|
-
|
|
637
610
|
const handleLoad = ev => {
|
|
638
611
|
booted = true;
|
|
639
612
|
loadStateRef.value = 'loaded';
|
|
640
613
|
ctx.emit('load', ev);
|
|
641
614
|
};
|
|
642
|
-
|
|
643
615
|
const handleError = ev => {
|
|
644
616
|
booted = true;
|
|
645
617
|
loadStateRef.value = 'error';
|
|
646
618
|
ctx.emit('error', ev);
|
|
647
619
|
};
|
|
648
|
-
|
|
649
620
|
ctx.expose({
|
|
650
621
|
state: loadStateRef,
|
|
651
622
|
isPending: isPendingRef,
|
|
@@ -676,14 +647,11 @@ const VBusyImage = defineComponent({
|
|
|
676
647
|
}, [children])]);
|
|
677
648
|
};
|
|
678
649
|
}
|
|
679
|
-
|
|
680
650
|
});
|
|
681
|
-
|
|
682
651
|
function imageIsReady(image) {
|
|
683
652
|
if (!image.complete) return false;
|
|
684
653
|
return image.naturalWidth + image.naturalHeight > 0 ? 'load' : 'error';
|
|
685
654
|
}
|
|
686
|
-
|
|
687
655
|
function isAvailableSrc(src) {
|
|
688
656
|
return typeof src === 'string' && src !== '';
|
|
689
657
|
}
|
|
@@ -697,10 +665,11 @@ function extractRawGridValueClasses(value, prefix, getter) {
|
|
|
697
665
|
}
|
|
698
666
|
// export const DEFAULT_MEDIA_MATCH_KEY = MEDIA_MATCH_CONDITIONS[0].key;
|
|
699
667
|
|
|
700
|
-
const VGridItem = defineComponent({
|
|
668
|
+
const VGridItem = /* @__PURE__ */ defineComponent({
|
|
701
669
|
name: 'VGridItem',
|
|
702
670
|
inheritAttrs: false,
|
|
703
|
-
props: {
|
|
671
|
+
props: {
|
|
672
|
+
...htmlAttributesPropOptions,
|
|
704
673
|
tag: {
|
|
705
674
|
type: String,
|
|
706
675
|
default: 'div'
|
|
@@ -711,11 +680,11 @@ const VGridItem = defineComponent({
|
|
|
711
680
|
justify: undefined,
|
|
712
681
|
order: undefined
|
|
713
682
|
},
|
|
714
|
-
|
|
715
683
|
setup(props, ctx) {
|
|
716
684
|
const data = computed(() => {
|
|
717
685
|
const classes = [];
|
|
718
|
-
const attrs = {
|
|
686
|
+
const attrs = {
|
|
687
|
+
...ctx.attrs
|
|
719
688
|
};
|
|
720
689
|
const {
|
|
721
690
|
size,
|
|
@@ -730,14 +699,14 @@ const VGridItem = defineComponent({
|
|
|
730
699
|
size != null && classes.push(extractRawGridValueClasses(size, 'grid-size-'));
|
|
731
700
|
align && classes.push(extractRawGridValueClasses(align, 'self-align-'));
|
|
732
701
|
justify && classes.push(extractRawGridValueClasses(justify, 'self-justify-'));
|
|
733
|
-
order != null && classes.push(extractRawGridValueClasses(order, 'order-'));
|
|
702
|
+
order != null && classes.push(extractRawGridValueClasses(order, 'order-'));
|
|
703
|
+
// MEDIA_MATCH_CONDITIONS.forEach(({ key }) => {
|
|
734
704
|
// const v = attrs[key];
|
|
735
705
|
// delete attrs[key];
|
|
736
706
|
// if (v != null) {
|
|
737
707
|
// classes.push(`grid-size-${v}--${key}`);
|
|
738
708
|
// }
|
|
739
709
|
// });
|
|
740
|
-
|
|
741
710
|
return {
|
|
742
711
|
classes,
|
|
743
712
|
attrs
|
|
@@ -754,17 +723,16 @@ const VGridItem = defineComponent({
|
|
|
754
723
|
}, attrs), ctx.slots);
|
|
755
724
|
};
|
|
756
725
|
}
|
|
757
|
-
|
|
758
726
|
});
|
|
759
727
|
|
|
760
728
|
function spacingValueToString(value) {
|
|
761
729
|
return Number.isInteger(value) ? String(value) : `${value}h`;
|
|
762
730
|
}
|
|
763
|
-
|
|
764
|
-
const VGridContainer = defineComponent({
|
|
731
|
+
const VGridContainer = /* @__PURE__ */ defineComponent({
|
|
765
732
|
name: 'VGridContainer',
|
|
766
733
|
inheritAttrs: false,
|
|
767
|
-
props: {
|
|
734
|
+
props: {
|
|
735
|
+
...htmlAttributesPropOptions,
|
|
768
736
|
wrapperTag: {
|
|
769
737
|
type: String,
|
|
770
738
|
default: 'div'
|
|
@@ -781,11 +749,11 @@ const VGridContainer = defineComponent({
|
|
|
781
749
|
alignContent: undefined,
|
|
782
750
|
justifyContent: undefined
|
|
783
751
|
},
|
|
784
|
-
|
|
785
752
|
setup(props, ctx) {
|
|
786
753
|
const data = computed(() => {
|
|
787
754
|
const classes = [];
|
|
788
|
-
const attrs = {
|
|
755
|
+
const attrs = {
|
|
756
|
+
...ctx.attrs
|
|
789
757
|
};
|
|
790
758
|
const {
|
|
791
759
|
spacing,
|
|
@@ -806,7 +774,8 @@ const VGridContainer = defineComponent({
|
|
|
806
774
|
delete attrs.direction;
|
|
807
775
|
delete attrs.wrap;
|
|
808
776
|
delete attrs.alignContent;
|
|
809
|
-
delete attrs.justifyContent;
|
|
777
|
+
delete attrs.justifyContent;
|
|
778
|
+
// spacingX = mergeSpacing(spacing, spacingX);
|
|
810
779
|
// spacingY = mergeSpacing(spacing, spacingY);
|
|
811
780
|
// if (!spacingX) {
|
|
812
781
|
// spacingX = spacing;
|
|
@@ -815,7 +784,6 @@ const VGridContainer = defineComponent({
|
|
|
815
784
|
// classes.push(extractRawGridItemValueClasses(align, 'self-align-'));
|
|
816
785
|
// justify &&
|
|
817
786
|
// classes.push(extractRawGridItemValueClasses(justify, 'self-justify-'));
|
|
818
|
-
|
|
819
787
|
spacing != null && classes.push(extractRawGridValueClasses(spacing, 'grid-spacing-', spacingValueToString));
|
|
820
788
|
spacingX != null && classes.push(extractRawGridValueClasses(spacingX, 'grid-spacing-x-', spacingValueToString));
|
|
821
789
|
spacingY != null && classes.push(extractRawGridValueClasses(spacingY, 'grid-spacing-y-', spacingValueToString));
|
|
@@ -849,11 +817,11 @@ const VGridContainer = defineComponent({
|
|
|
849
817
|
});
|
|
850
818
|
};
|
|
851
819
|
}
|
|
852
|
-
|
|
853
820
|
});
|
|
854
821
|
|
|
855
822
|
function createPaperBaseProps() {
|
|
856
|
-
return {
|
|
823
|
+
return {
|
|
824
|
+
...htmlAttributesPropOptions,
|
|
857
825
|
color: String,
|
|
858
826
|
tag: {
|
|
859
827
|
type: [String, Object],
|
|
@@ -863,7 +831,8 @@ function createPaperBaseProps() {
|
|
|
863
831
|
};
|
|
864
832
|
}
|
|
865
833
|
function createPaperProps() {
|
|
866
|
-
return {
|
|
834
|
+
return {
|
|
835
|
+
...createElevationProps(),
|
|
867
836
|
...createPaperBaseProps(),
|
|
868
837
|
square: Boolean,
|
|
869
838
|
headerProps: Object,
|
|
@@ -872,11 +841,10 @@ function createPaperProps() {
|
|
|
872
841
|
innerClass: [String, Array, Object]
|
|
873
842
|
};
|
|
874
843
|
}
|
|
875
|
-
const VPaper = defineComponent({
|
|
844
|
+
const VPaper = /* @__PURE__ */ defineComponent({
|
|
876
845
|
name: 'VPaper',
|
|
877
846
|
inheritAttrs: false,
|
|
878
847
|
props: createPaperProps(),
|
|
879
|
-
|
|
880
848
|
setup(props, ctx) {
|
|
881
849
|
const tag = computed(() => props.tag);
|
|
882
850
|
const elevation = useElevation(props, {
|
|
@@ -910,12 +878,12 @@ const VPaper = defineComponent({
|
|
|
910
878
|
});
|
|
911
879
|
};
|
|
912
880
|
}
|
|
913
|
-
|
|
914
881
|
});
|
|
915
882
|
|
|
916
883
|
const AVATAR_SIZES = ['sm', 'md', 'lg'];
|
|
917
884
|
function createAvatarProps() {
|
|
918
|
-
return {
|
|
885
|
+
return {
|
|
886
|
+
...colorSchemeProps(),
|
|
919
887
|
...navigationableInheritProps,
|
|
920
888
|
size: {
|
|
921
889
|
type: [String, Number],
|
|
@@ -927,11 +895,10 @@ function createAvatarProps() {
|
|
|
927
895
|
src: String
|
|
928
896
|
};
|
|
929
897
|
}
|
|
930
|
-
const VAvatar = defineComponent({
|
|
898
|
+
const VAvatar = /* @__PURE__ */ defineComponent({
|
|
931
899
|
name: 'VAvatar',
|
|
932
900
|
inheritAttrs: false,
|
|
933
901
|
props: createAvatarProps(),
|
|
934
|
-
|
|
935
902
|
setup(props, ctx) {
|
|
936
903
|
const vui = useVui();
|
|
937
904
|
const defaults = vui.setting('buttonDefault');
|
|
@@ -981,12 +948,12 @@ const VAvatar = defineComponent({
|
|
|
981
948
|
});
|
|
982
949
|
};
|
|
983
950
|
}
|
|
984
|
-
|
|
985
951
|
});
|
|
986
952
|
|
|
987
953
|
const CHIP_SIZES = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
988
954
|
function createChipProps() {
|
|
989
|
-
return {
|
|
955
|
+
return {
|
|
956
|
+
...colorSchemeProps(),
|
|
990
957
|
...navigationableInheritProps,
|
|
991
958
|
size: {
|
|
992
959
|
type: String,
|
|
@@ -998,10 +965,8 @@ function createChipProps() {
|
|
|
998
965
|
disabled: Boolean
|
|
999
966
|
};
|
|
1000
967
|
}
|
|
1001
|
-
|
|
1002
968
|
function resolveRawVChipIcon(raw, type) {
|
|
1003
969
|
if (!raw) return;
|
|
1004
|
-
|
|
1005
970
|
if (typeof raw === 'function') {
|
|
1006
971
|
return () => {
|
|
1007
972
|
const child = raw();
|
|
@@ -1011,18 +976,15 @@ function resolveRawVChipIcon(raw, type) {
|
|
|
1011
976
|
}, [child]);
|
|
1012
977
|
};
|
|
1013
978
|
}
|
|
1014
|
-
|
|
1015
979
|
return () => createVNode(VIcon, {
|
|
1016
980
|
"class": ['v-chip__icon', `v-chip__icon--${type}`],
|
|
1017
981
|
"name": raw
|
|
1018
982
|
}, null);
|
|
1019
983
|
}
|
|
1020
|
-
|
|
1021
|
-
const VChip = defineComponent({
|
|
984
|
+
const VChip = /* @__PURE__ */ defineComponent({
|
|
1022
985
|
name: 'VChip',
|
|
1023
986
|
inheritAttrs: false,
|
|
1024
987
|
props: createChipProps(),
|
|
1025
|
-
|
|
1026
988
|
setup(props, ctx) {
|
|
1027
989
|
const vui = useVui();
|
|
1028
990
|
const defaults = vui.setting('buttonDefault');
|
|
@@ -1032,12 +994,10 @@ const VChip = defineComponent({
|
|
|
1032
994
|
});
|
|
1033
995
|
const startIcon = computed(() => {
|
|
1034
996
|
const _icon = resolveRawVChipIcon(props.startIcon, 'start');
|
|
1035
|
-
|
|
1036
997
|
return _icon && _icon();
|
|
1037
998
|
});
|
|
1038
999
|
const endIcon = computed(() => {
|
|
1039
1000
|
const _icon = resolveRawVChipIcon(props.endIcon, 'end');
|
|
1040
|
-
|
|
1041
1001
|
return _icon && _icon();
|
|
1042
1002
|
});
|
|
1043
1003
|
const navigationable = useNavigationable(ctx, {
|
|
@@ -1066,31 +1026,29 @@ const VChip = defineComponent({
|
|
|
1066
1026
|
});
|
|
1067
1027
|
};
|
|
1068
1028
|
}
|
|
1069
|
-
|
|
1070
1029
|
});
|
|
1071
1030
|
|
|
1072
1031
|
function createCardProps() {
|
|
1073
|
-
return {
|
|
1032
|
+
return {
|
|
1033
|
+
...createPaperProps(),
|
|
1074
1034
|
...navigationableInheritProps,
|
|
1075
1035
|
disabled: Boolean
|
|
1076
1036
|
};
|
|
1077
1037
|
}
|
|
1078
|
-
const VCard = defineComponent({
|
|
1038
|
+
const VCard = /* @__PURE__ */ defineComponent({
|
|
1079
1039
|
name: 'VCard',
|
|
1080
1040
|
inheritAttrs: false,
|
|
1081
1041
|
props: createCardProps(),
|
|
1082
|
-
|
|
1083
1042
|
setup(props, ctx) {
|
|
1084
1043
|
const _props = computed(() => props);
|
|
1085
|
-
|
|
1086
1044
|
const data = computed(() => {
|
|
1087
1045
|
const hasLink = !!ctx.attrs.href || !!ctx.attrs.to;
|
|
1088
|
-
const attrs = {
|
|
1046
|
+
const attrs = {
|
|
1047
|
+
..._props.value,
|
|
1089
1048
|
...ctx.attrs,
|
|
1090
1049
|
class: ['v-card', ctx.attrs.class, typeof ctx.attrs.onClick === 'function' && 'clickable'],
|
|
1091
1050
|
tag: hasLink ? VLink : 'div'
|
|
1092
1051
|
};
|
|
1093
|
-
|
|
1094
1052
|
if (props.disabled) {
|
|
1095
1053
|
attrs.disabled = 'disabled';
|
|
1096
1054
|
delete attrs.onClick;
|
|
@@ -1099,7 +1057,6 @@ const VCard = defineComponent({
|
|
|
1099
1057
|
} else {
|
|
1100
1058
|
delete attrs.disabled;
|
|
1101
1059
|
}
|
|
1102
|
-
|
|
1103
1060
|
return {
|
|
1104
1061
|
attrs
|
|
1105
1062
|
};
|
|
@@ -1108,12 +1065,10 @@ const VCard = defineComponent({
|
|
|
1108
1065
|
return createVNode(VPaper, data.value.attrs, ctx.slots);
|
|
1109
1066
|
};
|
|
1110
1067
|
}
|
|
1111
|
-
|
|
1112
1068
|
});
|
|
1113
1069
|
|
|
1114
|
-
const VCardContent = defineComponent({
|
|
1070
|
+
const VCardContent = /* @__PURE__ */ defineComponent({
|
|
1115
1071
|
name: 'VCardContent',
|
|
1116
|
-
|
|
1117
1072
|
setup(props, ctx) {
|
|
1118
1073
|
return () => {
|
|
1119
1074
|
return createVNode("div", {
|
|
@@ -1121,12 +1076,10 @@ const VCardContent = defineComponent({
|
|
|
1121
1076
|
}, [renderSlotOrEmpty$1(ctx.slots, 'default')]);
|
|
1122
1077
|
};
|
|
1123
1078
|
}
|
|
1124
|
-
|
|
1125
1079
|
});
|
|
1126
1080
|
|
|
1127
|
-
const VCardActions = defineComponent({
|
|
1081
|
+
const VCardActions = /* @__PURE__ */ defineComponent({
|
|
1128
1082
|
name: 'VCardActions',
|
|
1129
|
-
|
|
1130
1083
|
setup(props, ctx) {
|
|
1131
1084
|
return () => {
|
|
1132
1085
|
return createVNode("div", {
|
|
@@ -1134,11 +1087,9 @@ const VCardActions = defineComponent({
|
|
|
1134
1087
|
}, [renderSlotOrEmpty$1(ctx.slots, 'default')]);
|
|
1135
1088
|
};
|
|
1136
1089
|
}
|
|
1137
|
-
|
|
1138
1090
|
});
|
|
1139
1091
|
|
|
1140
1092
|
const BUTTON_ALIGNS = ['left', 'center', 'right'];
|
|
1141
|
-
|
|
1142
1093
|
function resolveRawVButtonIcon(raw, type = 'main') {
|
|
1143
1094
|
if (!raw) return;
|
|
1144
1095
|
return typeof raw === 'function' ? raw : () => createVNode(VIcon, {
|
|
@@ -1146,8 +1097,8 @@ function resolveRawVButtonIcon(raw, type = 'main') {
|
|
|
1146
1097
|
"name": raw
|
|
1147
1098
|
}, null);
|
|
1148
1099
|
}
|
|
1149
|
-
|
|
1150
|
-
|
|
1100
|
+
const vueButtonProps = createPropsOptions$1({
|
|
1101
|
+
...htmlAttributesPropOptions,
|
|
1151
1102
|
...colorSchemeProps(),
|
|
1152
1103
|
...navigationableInheritProps,
|
|
1153
1104
|
spacer: [Boolean, String],
|
|
@@ -1166,28 +1117,24 @@ const LOADING_SIZE_MAP = {
|
|
|
1166
1117
|
md: 20,
|
|
1167
1118
|
lg: 28
|
|
1168
1119
|
};
|
|
1169
|
-
const VButton = defineComponent({
|
|
1120
|
+
const VButton = /* @__PURE__ */ defineComponent({
|
|
1170
1121
|
name: 'VButton',
|
|
1171
1122
|
inheritAttrs: false,
|
|
1172
1123
|
props: vueButtonProps,
|
|
1173
|
-
|
|
1174
1124
|
setup(props, ctx) {
|
|
1175
1125
|
const vui = useVui();
|
|
1176
1126
|
const control = useControl(props);
|
|
1177
1127
|
const defaults = vui.setting('buttonDefault');
|
|
1178
1128
|
const icon = computed(() => {
|
|
1179
1129
|
const _icon = resolveRawVButtonIcon(props.icon);
|
|
1180
|
-
|
|
1181
1130
|
return _icon && _icon();
|
|
1182
1131
|
});
|
|
1183
1132
|
const startIcon = computed(() => {
|
|
1184
1133
|
const _icon = resolveRawVButtonIcon(props.startIcon, 'start');
|
|
1185
|
-
|
|
1186
1134
|
return _icon && _icon();
|
|
1187
1135
|
});
|
|
1188
1136
|
const endIcon = computed(() => {
|
|
1189
1137
|
const _icon = resolveRawVButtonIcon(props.endIcon, 'end');
|
|
1190
|
-
|
|
1191
1138
|
return _icon && _icon();
|
|
1192
1139
|
});
|
|
1193
1140
|
const color = useColorClasses({
|
|
@@ -1195,17 +1142,18 @@ const VButton = defineComponent({
|
|
|
1195
1142
|
variant: () => props.variant || (icon.value ? vui.setting('plainVariant') : defaults.variant)
|
|
1196
1143
|
});
|
|
1197
1144
|
const isPlain = computed(() => color.variant.value.value === vui.setting('plainVariant') && color.color.value.value === defaults.color);
|
|
1198
|
-
const isLoading = computed(() => props.loading);
|
|
1145
|
+
const isLoading = computed(() => props.loading);
|
|
1146
|
+
// const isDisabled = computed(() => props.disabled);
|
|
1199
1147
|
// const isRounded = computed(() =>
|
|
1200
1148
|
// props.rounded != null ? props.rounded : !!icon.value,
|
|
1201
1149
|
// );
|
|
1202
|
-
|
|
1203
1150
|
const spacer = computed(() => {
|
|
1204
1151
|
const _spacer = props.spacer;
|
|
1205
1152
|
if (!_spacer) return;
|
|
1206
1153
|
return _spacer === true ? 'left' : _spacer;
|
|
1207
1154
|
});
|
|
1208
|
-
const classes = computed(() => [color.colorClasses.value,
|
|
1155
|
+
const classes = computed(() => [color.colorClasses.value,
|
|
1156
|
+
// navigationable.value.classes,
|
|
1209
1157
|
spacer.value ? `v-button--spacer-${spacer.value}` : undefined, `v-button--${control.size.value}`, `v-button--align-${props.align}`, {
|
|
1210
1158
|
'v-button--loading': isLoading.value,
|
|
1211
1159
|
'v-button--icon': !!icon.value,
|
|
@@ -1227,26 +1175,23 @@ const VButton = defineComponent({
|
|
|
1227
1175
|
});
|
|
1228
1176
|
};
|
|
1229
1177
|
}
|
|
1230
|
-
|
|
1231
1178
|
});
|
|
1232
1179
|
|
|
1233
|
-
const VButtonGroup = defineComponent({
|
|
1180
|
+
const VButtonGroup = /* @__PURE__ */ defineComponent({
|
|
1234
1181
|
name: 'VButtonGroup',
|
|
1235
|
-
props: {
|
|
1182
|
+
props: {
|
|
1183
|
+
...colorSchemeProps(),
|
|
1236
1184
|
...createControlProps(),
|
|
1237
1185
|
disabled: Boolean
|
|
1238
1186
|
},
|
|
1239
|
-
|
|
1240
1187
|
setup(props, ctx) {
|
|
1241
1188
|
return () => {
|
|
1242
1189
|
let hasIcon = false;
|
|
1243
1190
|
let buttonLength = 0;
|
|
1244
1191
|
let tmp = renderSlotOrEmpty$1(ctx.slots) || [];
|
|
1245
|
-
|
|
1246
1192
|
if (tmp.length === 1 && isFragment(tmp[0])) {
|
|
1247
1193
|
tmp = tmp[0].children;
|
|
1248
1194
|
}
|
|
1249
|
-
|
|
1250
1195
|
const children = tmp.map(node => {
|
|
1251
1196
|
if (!isVNode(node) || node.type !== VButton) {
|
|
1252
1197
|
return {
|
|
@@ -1254,13 +1199,10 @@ const VButtonGroup = defineComponent({
|
|
|
1254
1199
|
node
|
|
1255
1200
|
};
|
|
1256
1201
|
}
|
|
1257
|
-
|
|
1258
1202
|
buttonLength++;
|
|
1259
|
-
|
|
1260
1203
|
if (!hasIcon && node.props && !!node.props.icon) {
|
|
1261
1204
|
hasIcon = true;
|
|
1262
1205
|
}
|
|
1263
|
-
|
|
1264
1206
|
return {
|
|
1265
1207
|
isButton: true,
|
|
1266
1208
|
node
|
|
@@ -1273,7 +1215,8 @@ const VButtonGroup = defineComponent({
|
|
|
1273
1215
|
const hasLeft = buttonIndex > 1;
|
|
1274
1216
|
const hasRight = buttonIndex < buttonLength;
|
|
1275
1217
|
const childProps = child.node.props;
|
|
1276
|
-
return cloneVNode(child.node, {
|
|
1218
|
+
return cloneVNode(child.node, {
|
|
1219
|
+
...props,
|
|
1277
1220
|
...childProps,
|
|
1278
1221
|
rouded: false,
|
|
1279
1222
|
class: ['v-button-group__item', {
|
|
@@ -1283,7 +1226,6 @@ const VButtonGroup = defineComponent({
|
|
|
1283
1226
|
}]
|
|
1284
1227
|
});
|
|
1285
1228
|
}
|
|
1286
|
-
|
|
1287
1229
|
return child.node;
|
|
1288
1230
|
});
|
|
1289
1231
|
return createVNode("div", {
|
|
@@ -1293,13 +1235,11 @@ const VButtonGroup = defineComponent({
|
|
|
1293
1235
|
}, [$children]);
|
|
1294
1236
|
};
|
|
1295
1237
|
}
|
|
1296
|
-
|
|
1297
1238
|
});
|
|
1298
1239
|
|
|
1299
1240
|
function _isSlot$e(s) {
|
|
1300
1241
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
1301
1242
|
}
|
|
1302
|
-
|
|
1303
1243
|
const PAGINATION_ALIGNS = ['left', 'center', 'right'];
|
|
1304
1244
|
function paginationProps() {
|
|
1305
1245
|
return createPropsOptions$1({
|
|
@@ -1310,7 +1250,6 @@ function paginationProps() {
|
|
|
1310
1250
|
type: rawNumberPropType,
|
|
1311
1251
|
default: 1
|
|
1312
1252
|
},
|
|
1313
|
-
|
|
1314
1253
|
/**
|
|
1315
1254
|
* Total number of pages
|
|
1316
1255
|
*/
|
|
@@ -1318,12 +1257,10 @@ function paginationProps() {
|
|
|
1318
1257
|
type: rawNumberPropType,
|
|
1319
1258
|
default: 0
|
|
1320
1259
|
},
|
|
1321
|
-
|
|
1322
1260
|
/**
|
|
1323
1261
|
* Maximum number of links to display.
|
|
1324
1262
|
*/
|
|
1325
1263
|
totalVisible: rawNumberPropType,
|
|
1326
|
-
|
|
1327
1264
|
/**
|
|
1328
1265
|
* true when narrowing
|
|
1329
1266
|
*/
|
|
@@ -1333,7 +1270,6 @@ function paginationProps() {
|
|
|
1333
1270
|
type: String,
|
|
1334
1271
|
default: 'center'
|
|
1335
1272
|
},
|
|
1336
|
-
|
|
1337
1273
|
/**
|
|
1338
1274
|
* To synchronize with a query, use the query name
|
|
1339
1275
|
*/
|
|
@@ -1342,14 +1278,13 @@ function paginationProps() {
|
|
|
1342
1278
|
color: String
|
|
1343
1279
|
});
|
|
1344
1280
|
}
|
|
1345
|
-
const VPagination = defineComponent({
|
|
1281
|
+
const VPagination = /* @__PURE__ */ defineComponent({
|
|
1346
1282
|
name: 'VPagination',
|
|
1347
1283
|
props: paginationProps(),
|
|
1348
1284
|
emits: {
|
|
1349
1285
|
change: page => true,
|
|
1350
1286
|
'update:modelValue': page => true
|
|
1351
1287
|
},
|
|
1352
|
-
|
|
1353
1288
|
setup(props, ctx) {
|
|
1354
1289
|
const vui = useVui();
|
|
1355
1290
|
const elRef = ref(null);
|
|
@@ -1372,40 +1307,31 @@ const VPagination = defineComponent({
|
|
|
1372
1307
|
const {
|
|
1373
1308
|
routeQuery
|
|
1374
1309
|
} = props;
|
|
1375
|
-
|
|
1376
1310
|
if (routeQuery) {
|
|
1377
1311
|
return vui.location.getQuery(routeQuery, Number, 1);
|
|
1378
1312
|
}
|
|
1379
|
-
|
|
1380
1313
|
return internalValue.value;
|
|
1381
1314
|
});
|
|
1382
|
-
|
|
1383
1315
|
const _range = (from, to) => {
|
|
1384
1316
|
const range = [];
|
|
1385
1317
|
from = from > 0 ? from : 1;
|
|
1386
|
-
|
|
1387
1318
|
for (let i = from; i <= to; i++) {
|
|
1388
1319
|
range.push(i);
|
|
1389
1320
|
}
|
|
1390
|
-
|
|
1391
1321
|
return range;
|
|
1392
1322
|
};
|
|
1393
|
-
|
|
1394
1323
|
const computedItems = computed(() => {
|
|
1395
1324
|
const maxButtons = computedNumbersLength.value;
|
|
1396
1325
|
const totalVisible = computedTotalVisible.value;
|
|
1397
1326
|
const length = computedLength.value;
|
|
1398
1327
|
const pageValue = computedPage.value;
|
|
1399
1328
|
const maxLength = Math.min(Math.max(0, totalVisible || 0) || length, Math.max(0, maxButtons) || length, length);
|
|
1400
|
-
|
|
1401
1329
|
if (length <= maxLength) {
|
|
1402
1330
|
return _range(1, length);
|
|
1403
1331
|
}
|
|
1404
|
-
|
|
1405
1332
|
const even = maxLength % 2 === 0 ? 1 : 0;
|
|
1406
1333
|
const left = Math.floor(maxLength / 2);
|
|
1407
1334
|
const right = length - left + 1 + even;
|
|
1408
|
-
|
|
1409
1335
|
if (pageValue > left && pageValue < right) {
|
|
1410
1336
|
const start = pageValue - left + 2;
|
|
1411
1337
|
const end = pageValue + left - 2 - even;
|
|
@@ -1433,7 +1359,6 @@ const VPagination = defineComponent({
|
|
|
1433
1359
|
'v-pagination--dense': props.dense,
|
|
1434
1360
|
[`v-pagination--${props.align}`]: true
|
|
1435
1361
|
}, colorScope.value.className]);
|
|
1436
|
-
|
|
1437
1362
|
async function setPage(value) {
|
|
1438
1363
|
if (isDisabled.value) return;
|
|
1439
1364
|
const {
|
|
@@ -1442,7 +1367,6 @@ const VPagination = defineComponent({
|
|
|
1442
1367
|
} = props;
|
|
1443
1368
|
const newPage = resolveNumberish(value);
|
|
1444
1369
|
if (computedPage.value === newPage) return;
|
|
1445
|
-
|
|
1446
1370
|
if (beforeChange) {
|
|
1447
1371
|
try {
|
|
1448
1372
|
let result = beforeChange(newPage);
|
|
@@ -1450,7 +1374,6 @@ const VPagination = defineComponent({
|
|
|
1450
1374
|
if (result === false) return;
|
|
1451
1375
|
} catch (e) {}
|
|
1452
1376
|
}
|
|
1453
|
-
|
|
1454
1377
|
if (routeQuery) {
|
|
1455
1378
|
const to = createRoutableLocationByPage(newPage, routeQuery);
|
|
1456
1379
|
return router.push(to).then(failure => {
|
|
@@ -1462,7 +1385,6 @@ const VPagination = defineComponent({
|
|
|
1462
1385
|
ctx.emit('change', newPage);
|
|
1463
1386
|
}
|
|
1464
1387
|
}
|
|
1465
|
-
|
|
1466
1388
|
function createPageInfo(source) {
|
|
1467
1389
|
const currentPage = computedPage.value;
|
|
1468
1390
|
const length = computedLength.value;
|
|
@@ -1470,7 +1392,6 @@ const VPagination = defineComponent({
|
|
|
1470
1392
|
let page;
|
|
1471
1393
|
let active;
|
|
1472
1394
|
let disabled;
|
|
1473
|
-
|
|
1474
1395
|
if (typeof source === 'number') {
|
|
1475
1396
|
number = true;
|
|
1476
1397
|
page = source;
|
|
@@ -1488,7 +1409,6 @@ const VPagination = defineComponent({
|
|
|
1488
1409
|
active = false;
|
|
1489
1410
|
disabled = page < 1 || page > length;
|
|
1490
1411
|
}
|
|
1491
|
-
|
|
1492
1412
|
return {
|
|
1493
1413
|
number,
|
|
1494
1414
|
page,
|
|
@@ -1496,13 +1416,11 @@ const VPagination = defineComponent({
|
|
|
1496
1416
|
disabled
|
|
1497
1417
|
};
|
|
1498
1418
|
}
|
|
1499
|
-
|
|
1500
1419
|
function createRoutableLocationByPage(page, routeQuery) {
|
|
1501
1420
|
return vui.location.getQueryMergedLocation({
|
|
1502
1421
|
[routeQuery]: page
|
|
1503
1422
|
});
|
|
1504
1423
|
}
|
|
1505
|
-
|
|
1506
1424
|
function genItem(source, index) {
|
|
1507
1425
|
const {
|
|
1508
1426
|
number,
|
|
@@ -1520,25 +1438,21 @@ const VPagination = defineComponent({
|
|
|
1520
1438
|
if (type === 'truncate') {
|
|
1521
1439
|
return createVNode("span", null, [createTextVNode("...")]);
|
|
1522
1440
|
}
|
|
1523
|
-
|
|
1524
1441
|
const isPrev = type === 'prev';
|
|
1525
1442
|
const icon = isPrev ? vui.icon('prev') : vui.icon('next');
|
|
1526
1443
|
return resolveRawIconProp(false, icon, {
|
|
1527
1444
|
class: 'v-pagination__item__icon'
|
|
1528
1445
|
});
|
|
1529
1446
|
})();
|
|
1530
|
-
|
|
1531
1447
|
const onClick = ev => {
|
|
1532
1448
|
ev.preventDefault();
|
|
1533
1449
|
if (page === undefined || active || disabled) return;
|
|
1534
1450
|
setPage(page);
|
|
1535
1451
|
};
|
|
1536
|
-
|
|
1537
1452
|
const key = `${source}-${index}`;
|
|
1538
1453
|
const {
|
|
1539
1454
|
routeQuery
|
|
1540
1455
|
} = props;
|
|
1541
|
-
|
|
1542
1456
|
if (page !== undefined && routeQuery) {
|
|
1543
1457
|
const to = createRoutableLocationByPage(page, routeQuery);
|
|
1544
1458
|
return createVNode(RouterLink, {
|
|
@@ -1558,7 +1472,6 @@ const VPagination = defineComponent({
|
|
|
1558
1472
|
}, [children]);
|
|
1559
1473
|
}
|
|
1560
1474
|
}
|
|
1561
|
-
|
|
1562
1475
|
watch(() => props.modelValue, modelValue => {
|
|
1563
1476
|
internalValue.value = resolveNumberish(modelValue);
|
|
1564
1477
|
}, {
|
|
@@ -1574,7 +1487,6 @@ const VPagination = defineComponent({
|
|
|
1574
1487
|
width
|
|
1575
1488
|
}) => {
|
|
1576
1489
|
const el = elRef.value;
|
|
1577
|
-
|
|
1578
1490
|
if (el) {
|
|
1579
1491
|
const style = window.getComputedStyle(el, 'before');
|
|
1580
1492
|
const width = style.getPropertyValue('width');
|
|
@@ -1582,17 +1494,16 @@ const VPagination = defineComponent({
|
|
|
1582
1494
|
const size = parseFloat(width) + parseFloat(margin) * 0.5;
|
|
1583
1495
|
itemSize.value = size;
|
|
1584
1496
|
}
|
|
1585
|
-
|
|
1586
1497
|
containerWidth.value = width;
|
|
1587
1498
|
})]);
|
|
1588
1499
|
};
|
|
1589
1500
|
}
|
|
1590
|
-
|
|
1591
1501
|
});
|
|
1592
1502
|
|
|
1593
1503
|
function createListTileProps() {
|
|
1594
1504
|
const icon = rawIconProp();
|
|
1595
|
-
return {
|
|
1505
|
+
return {
|
|
1506
|
+
...navigationableInheritProps,
|
|
1596
1507
|
...createPropsOptions$1({
|
|
1597
1508
|
startIcon: icon,
|
|
1598
1509
|
endIcon: icon,
|
|
@@ -1609,22 +1520,20 @@ function createListTileProps() {
|
|
|
1609
1520
|
const listTileEmits = {
|
|
1610
1521
|
changeActive: isActive => true
|
|
1611
1522
|
};
|
|
1612
|
-
const VListTile = defineComponent({
|
|
1523
|
+
const VListTile = /* @__PURE__ */ defineComponent({
|
|
1613
1524
|
name: 'VListTile',
|
|
1614
1525
|
inheritAttrs: false,
|
|
1615
1526
|
props: createListTileProps(),
|
|
1616
|
-
emits: {
|
|
1527
|
+
emits: {
|
|
1528
|
+
...listTileEmits
|
|
1617
1529
|
},
|
|
1618
|
-
|
|
1619
1530
|
setup(props, ctx) {
|
|
1620
1531
|
const vui = useVui();
|
|
1621
1532
|
const startIcon = computed(() => {
|
|
1622
1533
|
let icon = resolveRawIconProp(false, props.startIcon);
|
|
1623
|
-
|
|
1624
1534
|
if (!icon && props.startIconEmptySpace) {
|
|
1625
1535
|
icon = resolveRawIconProp(false, '$empty');
|
|
1626
1536
|
}
|
|
1627
|
-
|
|
1628
1537
|
return icon;
|
|
1629
1538
|
});
|
|
1630
1539
|
const endIcon = computed(() => resolveRawIconProp(false, props.endIcon));
|
|
@@ -1668,14 +1577,13 @@ const VListTile = defineComponent({
|
|
|
1668
1577
|
});
|
|
1669
1578
|
};
|
|
1670
1579
|
}
|
|
1671
|
-
|
|
1672
1580
|
});
|
|
1673
1581
|
|
|
1674
|
-
const VDrawerLayout = defineComponent({
|
|
1582
|
+
const VDrawerLayout = /* @__PURE__ */ defineComponent({
|
|
1675
1583
|
name: 'VDrawerLayout',
|
|
1676
|
-
props: {
|
|
1584
|
+
props: {
|
|
1585
|
+
...createPaperBaseProps()
|
|
1677
1586
|
},
|
|
1678
|
-
|
|
1679
1587
|
setup(props, ctx) {
|
|
1680
1588
|
return () => {
|
|
1681
1589
|
const paperProps = computed(() => ({
|
|
@@ -1699,16 +1607,16 @@ const VDrawerLayout = defineComponent({
|
|
|
1699
1607
|
}), ctx.slots);
|
|
1700
1608
|
};
|
|
1701
1609
|
}
|
|
1702
|
-
|
|
1703
1610
|
});
|
|
1704
1611
|
|
|
1612
|
+
// Adornment
|
|
1705
1613
|
function _isSlot$d(s) {
|
|
1706
1614
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
1707
1615
|
}
|
|
1708
|
-
|
|
1709
|
-
const VHero = defineComponent({
|
|
1616
|
+
const VHero = /* @__PURE__ */ defineComponent({
|
|
1710
1617
|
name: 'VHero',
|
|
1711
|
-
props: {
|
|
1618
|
+
props: {
|
|
1619
|
+
...htmlAttributesPropOptions,
|
|
1712
1620
|
color: {
|
|
1713
1621
|
type: String,
|
|
1714
1622
|
default: 'primary'
|
|
@@ -1723,11 +1631,9 @@ const VHero = defineComponent({
|
|
|
1723
1631
|
},
|
|
1724
1632
|
...defineSlotsProps$1()
|
|
1725
1633
|
},
|
|
1726
|
-
|
|
1727
1634
|
setup(props, ctx) {
|
|
1728
1635
|
return () => {
|
|
1729
1636
|
let _slot;
|
|
1730
|
-
|
|
1731
1637
|
const TagName = props.tag;
|
|
1732
1638
|
const HTagName = props.hTag;
|
|
1733
1639
|
const adornment = renderSlotOrEmpty$1(ctx.slots, 'adornment');
|
|
@@ -1748,37 +1654,36 @@ const VHero = defineComponent({
|
|
|
1748
1654
|
});
|
|
1749
1655
|
};
|
|
1750
1656
|
}
|
|
1751
|
-
|
|
1752
1657
|
});
|
|
1753
1658
|
|
|
1754
1659
|
function _isSlot$c(s) {
|
|
1755
1660
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
1756
1661
|
}
|
|
1757
|
-
|
|
1758
1662
|
function createNavigationItemProps() {
|
|
1759
|
-
return {
|
|
1663
|
+
return {
|
|
1664
|
+
...createListTileProps(),
|
|
1760
1665
|
match: [String, Array],
|
|
1761
1666
|
depth: {
|
|
1762
1667
|
type: Number,
|
|
1763
1668
|
default: 0
|
|
1764
1669
|
},
|
|
1765
1670
|
nested: Boolean,
|
|
1766
|
-
color: String
|
|
1671
|
+
color: String
|
|
1672
|
+
// key: {
|
|
1767
1673
|
// type: [String, Number],
|
|
1768
1674
|
// required: true,
|
|
1769
1675
|
// },
|
|
1770
|
-
|
|
1771
1676
|
};
|
|
1772
1677
|
}
|
|
1678
|
+
|
|
1773
1679
|
function resolveNavigationItemInput(input) {
|
|
1774
1680
|
let label = input.label;
|
|
1775
|
-
const props = {
|
|
1681
|
+
const props = {
|
|
1682
|
+
...input
|
|
1776
1683
|
};
|
|
1777
|
-
|
|
1778
1684
|
if (typeof label === 'function') {
|
|
1779
1685
|
label = label();
|
|
1780
1686
|
}
|
|
1781
|
-
|
|
1782
1687
|
delete props.label;
|
|
1783
1688
|
return {
|
|
1784
1689
|
label,
|
|
@@ -1790,27 +1695,27 @@ function renderNavigationItemInput(input, extraProps) {
|
|
|
1790
1695
|
label,
|
|
1791
1696
|
props
|
|
1792
1697
|
} = resolveNavigationItemInput(input);
|
|
1793
|
-
return createVNode(VNavigationItem, {
|
|
1698
|
+
return createVNode(VNavigationItem, {
|
|
1699
|
+
...props,
|
|
1794
1700
|
...extraProps
|
|
1795
1701
|
}, _isSlot$c(label) ? label : {
|
|
1796
1702
|
default: () => [label]
|
|
1797
1703
|
});
|
|
1798
1704
|
}
|
|
1799
1705
|
const TRIM_END_SLASH_RE = /\/$/;
|
|
1800
|
-
|
|
1801
1706
|
function trimEndSlash(sorce) {
|
|
1802
1707
|
return sorce ? sorce.replace(TRIM_END_SLASH_RE, '') : sorce;
|
|
1803
1708
|
}
|
|
1804
|
-
|
|
1805
|
-
const VNavigationItem = defineComponent({
|
|
1709
|
+
const VNavigationItem = /* @__PURE__ */ defineComponent({
|
|
1806
1710
|
name: 'VNavigationItem',
|
|
1807
1711
|
inheritAttrs: false,
|
|
1808
|
-
props: {
|
|
1712
|
+
props: {
|
|
1713
|
+
...createNavigationItemProps(),
|
|
1809
1714
|
children: Array
|
|
1810
1715
|
},
|
|
1811
|
-
emits: {
|
|
1716
|
+
emits: {
|
|
1717
|
+
...listTileEmits
|
|
1812
1718
|
},
|
|
1813
|
-
|
|
1814
1719
|
setup(props, ctx) {
|
|
1815
1720
|
const vui = useVui();
|
|
1816
1721
|
const opened = ref(false);
|
|
@@ -1826,11 +1731,9 @@ const VNavigationItem = defineComponent({
|
|
|
1826
1731
|
const {
|
|
1827
1732
|
to
|
|
1828
1733
|
} = ctx.attrs;
|
|
1829
|
-
|
|
1830
1734
|
if (match) {
|
|
1831
1735
|
return (Array.isArray(match) ? match : [match]).map(trimEndSlash);
|
|
1832
1736
|
}
|
|
1833
|
-
|
|
1834
1737
|
if (!to) return;
|
|
1835
1738
|
const toPath = typeof to === 'string' ? to : to.path;
|
|
1836
1739
|
if (!toPath) return;
|
|
@@ -1840,51 +1743,47 @@ const VNavigationItem = defineComponent({
|
|
|
1840
1743
|
'v-navigation-item--opened': opened.value,
|
|
1841
1744
|
[`v-navigation-item--depth-${props.depth}`]: props.depth > 0
|
|
1842
1745
|
}]);
|
|
1843
|
-
const route = useRoute();
|
|
1746
|
+
const route = useRoute();
|
|
1747
|
+
// const classes = computed(() => [
|
|
1844
1748
|
// // {
|
|
1845
1749
|
// // 'v-navigation-item--matched': matched.value,
|
|
1846
1750
|
// // },
|
|
1847
1751
|
// ]);
|
|
1848
|
-
|
|
1849
1752
|
watch(() => route.path, newPath => {
|
|
1850
1753
|
const c = children.value;
|
|
1851
1754
|
const m = match.value;
|
|
1852
|
-
|
|
1853
1755
|
if (!c || !m || !m.length) {
|
|
1854
1756
|
// matched.value = false;
|
|
1855
1757
|
return;
|
|
1856
1758
|
}
|
|
1857
|
-
|
|
1858
1759
|
const trimedNewPath = trimEndSlash(newPath);
|
|
1859
|
-
|
|
1860
1760
|
if (m.some(_ => trimedNewPath.match(_))) {
|
|
1861
|
-
open();
|
|
1761
|
+
open();
|
|
1762
|
+
// matched.value = true;
|
|
1862
1763
|
} else {
|
|
1863
|
-
close();
|
|
1864
|
-
|
|
1764
|
+
close();
|
|
1765
|
+
// matched.value = false;
|
|
1766
|
+
}
|
|
1767
|
+
// if (trimEndSlash(newPath).match(m)) {
|
|
1865
1768
|
// open();
|
|
1866
1769
|
// // matched.value = true;
|
|
1867
1770
|
// } else {
|
|
1868
1771
|
// close();
|
|
1869
1772
|
// // matched.value = false;
|
|
1870
1773
|
// }
|
|
1871
|
-
|
|
1872
1774
|
}, {
|
|
1873
1775
|
immediate: true
|
|
1874
|
-
});
|
|
1875
|
-
|
|
1776
|
+
});
|
|
1777
|
+
// const iconPayload = () => opened.value;
|
|
1876
1778
|
const _props = computed(() => {
|
|
1877
1779
|
const c = children.value;
|
|
1878
1780
|
let {
|
|
1879
1781
|
endIcon
|
|
1880
1782
|
} = props;
|
|
1881
|
-
|
|
1882
1783
|
if (c && !endIcon) {
|
|
1883
1784
|
endIcon = vui.icon('navigationExpand');
|
|
1884
|
-
|
|
1885
1785
|
if (typeof endIcon === 'string') {
|
|
1886
1786
|
const name = endIcon;
|
|
1887
|
-
|
|
1888
1787
|
endIcon = gen => {
|
|
1889
1788
|
return gen({
|
|
1890
1789
|
name,
|
|
@@ -1893,19 +1792,20 @@ const VNavigationItem = defineComponent({
|
|
|
1893
1792
|
};
|
|
1894
1793
|
}
|
|
1895
1794
|
}
|
|
1896
|
-
|
|
1897
|
-
|
|
1795
|
+
const __props = {
|
|
1796
|
+
...props,
|
|
1898
1797
|
endIcon
|
|
1899
1798
|
};
|
|
1900
|
-
delete __props.children;
|
|
1799
|
+
delete __props.children;
|
|
1800
|
+
// const _activeClass = props.activeClass;
|
|
1901
1801
|
// const activeClass = `v-navigation-item--active${
|
|
1902
1802
|
// _activeClass ? ` ${_activeClass}` : ''
|
|
1903
1803
|
// }`;
|
|
1904
|
-
|
|
1905
|
-
|
|
1804
|
+
return {
|
|
1805
|
+
...__props
|
|
1806
|
+
// activeClass,
|
|
1906
1807
|
// startIcon: toRawIconProp(__props.startIcon, iconPayload),
|
|
1907
1808
|
// endIcon: toRawIconProp(__props.endIcon, iconPayload),
|
|
1908
|
-
|
|
1909
1809
|
};
|
|
1910
1810
|
});
|
|
1911
1811
|
|
|
@@ -1913,25 +1813,22 @@ const VNavigationItem = defineComponent({
|
|
|
1913
1813
|
if (!children.value) return;
|
|
1914
1814
|
opened.value = true;
|
|
1915
1815
|
}
|
|
1916
|
-
|
|
1917
1816
|
function close() {
|
|
1918
1817
|
opened.value = false;
|
|
1919
1818
|
}
|
|
1920
|
-
|
|
1921
1819
|
function toggle() {
|
|
1922
1820
|
return opened.value ? close() : open();
|
|
1923
1821
|
}
|
|
1924
|
-
|
|
1925
1822
|
const onClick = ev => {
|
|
1926
1823
|
if (!to.value) {
|
|
1927
1824
|
return toggle();
|
|
1928
|
-
}
|
|
1825
|
+
}
|
|
1826
|
+
// console.log('★');
|
|
1929
1827
|
// open();
|
|
1930
1828
|
// if (!to.value) {
|
|
1931
1829
|
// toggle();
|
|
1932
1830
|
// }
|
|
1933
1831
|
// ctx.emit('click', ev);
|
|
1934
|
-
|
|
1935
1832
|
};
|
|
1936
1833
|
|
|
1937
1834
|
const onChangeActive = isActive => {
|
|
@@ -1952,13 +1849,11 @@ const VNavigationItem = defineComponent({
|
|
|
1952
1849
|
// }
|
|
1953
1850
|
ctx.emit('changeActive', isActive);
|
|
1954
1851
|
};
|
|
1955
|
-
|
|
1956
1852
|
ctx.expose({
|
|
1957
1853
|
close
|
|
1958
1854
|
});
|
|
1959
1855
|
return () => {
|
|
1960
1856
|
let _slot;
|
|
1961
|
-
|
|
1962
1857
|
const _children = children.value;
|
|
1963
1858
|
const fallbackTag = _children ? 'button' : undefined;
|
|
1964
1859
|
return createVNode(Fragment, null, [createVNode(VListTile, mergeProps(ctx.attrs, _props.value, {
|
|
@@ -1977,14 +1872,13 @@ const VNavigationItem = defineComponent({
|
|
|
1977
1872
|
...child
|
|
1978
1873
|
}, {
|
|
1979
1874
|
startIconEmptySpace: _props.value.startIconEmptySpace,
|
|
1980
|
-
depth: props.nested ? props.depth + 1 : props.depth
|
|
1875
|
+
depth: props.nested ? props.depth + 1 : props.depth
|
|
1876
|
+
// onClick,
|
|
1981
1877
|
// onChangeActive,
|
|
1982
|
-
|
|
1983
1878
|
}))]), [[vShow, opened.value]])]
|
|
1984
1879
|
})]);
|
|
1985
1880
|
};
|
|
1986
1881
|
}
|
|
1987
|
-
|
|
1988
1882
|
});
|
|
1989
1883
|
|
|
1990
1884
|
function createNavigationProps() {
|
|
@@ -2001,10 +1895,9 @@ function createNavigationProps() {
|
|
|
2001
1895
|
caption: [String, Function]
|
|
2002
1896
|
});
|
|
2003
1897
|
}
|
|
2004
|
-
const VNavigation = defineComponent({
|
|
1898
|
+
const VNavigation = /* @__PURE__ */ defineComponent({
|
|
2005
1899
|
name: 'VNavigation',
|
|
2006
1900
|
props: createNavigationProps(),
|
|
2007
|
-
|
|
2008
1901
|
setup(props, ctx) {
|
|
2009
1902
|
const items = computed(() => props.items);
|
|
2010
1903
|
const color = useScopeColorClass(props);
|
|
@@ -2018,14 +1911,12 @@ const VNavigation = defineComponent({
|
|
|
2018
1911
|
onBeforeUpdate(() => {
|
|
2019
1912
|
itemsRef.value = [];
|
|
2020
1913
|
});
|
|
2021
|
-
|
|
2022
1914
|
function setItemRef(item, itemRef) {
|
|
2023
1915
|
itemsRef.value.push({
|
|
2024
1916
|
key: item.key,
|
|
2025
1917
|
ref: itemRef
|
|
2026
1918
|
});
|
|
2027
1919
|
}
|
|
2028
|
-
|
|
2029
1920
|
function onItemActivated(item) {
|
|
2030
1921
|
itemsRef.value.forEach(({
|
|
2031
1922
|
key,
|
|
@@ -2035,7 +1926,6 @@ const VNavigation = defineComponent({
|
|
|
2035
1926
|
ref.close();
|
|
2036
1927
|
});
|
|
2037
1928
|
}
|
|
2038
|
-
|
|
2039
1929
|
return () => {
|
|
2040
1930
|
const $caption = caption.value;
|
|
2041
1931
|
return createVNode("nav", {
|
|
@@ -2049,27 +1939,24 @@ const VNavigation = defineComponent({
|
|
|
2049
1939
|
setItemRef(item, ref);
|
|
2050
1940
|
},
|
|
2051
1941
|
onChangeActive: isActive => {
|
|
2052
|
-
if (isActive
|
|
2053
|
-
/* && item.children && item.children.length*/
|
|
2054
|
-
) {
|
|
1942
|
+
if (isActive /* && item.children && item.children.length*/) {
|
|
2055
1943
|
onItemActivated(item);
|
|
2056
1944
|
}
|
|
2057
1945
|
}
|
|
2058
1946
|
}))]);
|
|
2059
1947
|
};
|
|
2060
1948
|
}
|
|
2061
|
-
|
|
2062
1949
|
});
|
|
2063
1950
|
|
|
2064
|
-
const VCheckable = defineComponent({
|
|
1951
|
+
const VCheckable = /* @__PURE__ */ defineComponent({
|
|
2065
1952
|
name: 'VCheckable',
|
|
2066
1953
|
props: {
|
|
2067
1954
|
invalid: Boolean,
|
|
2068
1955
|
disabled: Boolean,
|
|
2069
1956
|
readonly: Boolean,
|
|
2070
1957
|
checked: Boolean,
|
|
2071
|
-
...defineSlotsProps()
|
|
2072
|
-
|
|
1958
|
+
...defineSlotsProps()
|
|
1959
|
+
// autoWidth: Boolean,
|
|
2073
1960
|
},
|
|
2074
1961
|
|
|
2075
1962
|
setup(props, ctx) {
|
|
@@ -2077,8 +1964,8 @@ const VCheckable = defineComponent({
|
|
|
2077
1964
|
const invalid = computed(() => props.invalid);
|
|
2078
1965
|
const disabled = computed(() => props.disabled);
|
|
2079
1966
|
const readonly = computed(() => props.readonly);
|
|
2080
|
-
const checked = computed(() => props.checked);
|
|
2081
|
-
|
|
1967
|
+
const checked = computed(() => props.checked);
|
|
1968
|
+
// const autoWidth = computed(() => props.autoWidth);
|
|
2082
1969
|
const classes = computed(() => {
|
|
2083
1970
|
return [{
|
|
2084
1971
|
'v-checkable--invalid': invalid.value,
|
|
@@ -2099,21 +1986,20 @@ const VCheckable = defineComponent({
|
|
|
2099
1986
|
"class": "v-checkable__label"
|
|
2100
1987
|
}, [renderSlotOrEmpty(ctx.slots, 'label')])]);
|
|
2101
1988
|
}
|
|
2102
|
-
|
|
2103
1989
|
});
|
|
2104
1990
|
|
|
2105
1991
|
const {
|
|
2106
1992
|
props: props$7,
|
|
2107
1993
|
emits: emits$7
|
|
2108
1994
|
} = createFormSelectorItemSettings();
|
|
2109
|
-
const VCheckbox = defineComponent({
|
|
1995
|
+
const VCheckbox = /* @__PURE__ */ defineComponent({
|
|
2110
1996
|
name: 'VCheckbox',
|
|
2111
|
-
props: {
|
|
1997
|
+
props: {
|
|
1998
|
+
...props$7,
|
|
2112
1999
|
...createControlProps(),
|
|
2113
2000
|
indeterminate: Boolean
|
|
2114
2001
|
},
|
|
2115
2002
|
emits: emits$7,
|
|
2116
|
-
|
|
2117
2003
|
setup(props, ctx) {
|
|
2118
2004
|
const nodeControl = useFormSelectorItemControl(props, ctx, {
|
|
2119
2005
|
nodeType: VUI_CHECKBOX_SYMBOL,
|
|
@@ -2121,12 +2007,12 @@ const VCheckbox = defineComponent({
|
|
|
2121
2007
|
});
|
|
2122
2008
|
const control = useControl(props);
|
|
2123
2009
|
const isIndeterminate = computed(() => props.indeterminate);
|
|
2124
|
-
return {
|
|
2010
|
+
return {
|
|
2011
|
+
...nodeControl.expose(),
|
|
2125
2012
|
...control,
|
|
2126
2013
|
isIndeterminate
|
|
2127
2014
|
};
|
|
2128
2015
|
},
|
|
2129
|
-
|
|
2130
2016
|
render() {
|
|
2131
2017
|
const {
|
|
2132
2018
|
selectorItemControl,
|
|
@@ -2151,13 +2037,11 @@ const VCheckbox = defineComponent({
|
|
|
2151
2037
|
label: () => renderSlotOrEmpty(this.$slots, 'default')
|
|
2152
2038
|
});
|
|
2153
2039
|
}
|
|
2154
|
-
|
|
2155
2040
|
});
|
|
2156
2041
|
|
|
2157
2042
|
function _isSlot$b(s) {
|
|
2158
2043
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
2159
2044
|
}
|
|
2160
|
-
|
|
2161
2045
|
const VCheckboxGroup = defineFormSelectorComponent({
|
|
2162
2046
|
name: 'VCheckboxGroup',
|
|
2163
2047
|
defaultMultiple: true,
|
|
@@ -2175,24 +2059,24 @@ const {
|
|
|
2175
2059
|
props: props$6,
|
|
2176
2060
|
emits: emits$6
|
|
2177
2061
|
} = createFormSelectorItemSettings();
|
|
2178
|
-
const VRadio = defineComponent({
|
|
2062
|
+
const VRadio = /* @__PURE__ */ defineComponent({
|
|
2179
2063
|
name: 'VRadio',
|
|
2180
|
-
props: {
|
|
2064
|
+
props: {
|
|
2065
|
+
...props$6,
|
|
2181
2066
|
...createControlProps()
|
|
2182
2067
|
},
|
|
2183
2068
|
emits: emits$6,
|
|
2184
|
-
|
|
2185
2069
|
setup(props, ctx) {
|
|
2186
2070
|
const nodeControl = useFormSelectorItemControl(props, ctx, {
|
|
2187
2071
|
nodeType: VUI_RADIO_SYMBOL,
|
|
2188
2072
|
parentNodeType: VUI_RADIO_GROUP_SYMBOL
|
|
2189
2073
|
});
|
|
2190
2074
|
const control = useControl(props);
|
|
2191
|
-
return {
|
|
2075
|
+
return {
|
|
2076
|
+
...nodeControl.expose(),
|
|
2192
2077
|
...control
|
|
2193
2078
|
};
|
|
2194
2079
|
},
|
|
2195
|
-
|
|
2196
2080
|
render() {
|
|
2197
2081
|
const {
|
|
2198
2082
|
selectorItemControl
|
|
@@ -2215,13 +2099,11 @@ const VRadio = defineComponent({
|
|
|
2215
2099
|
label: () => renderSlotOrEmpty(this.$slots, 'default')
|
|
2216
2100
|
});
|
|
2217
2101
|
}
|
|
2218
|
-
|
|
2219
2102
|
});
|
|
2220
2103
|
|
|
2221
2104
|
function _isSlot$a(s) {
|
|
2222
2105
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
2223
2106
|
}
|
|
2224
|
-
|
|
2225
2107
|
const VRadioGroup = defineFormSelectorComponent({
|
|
2226
2108
|
name: 'VRadioGroup',
|
|
2227
2109
|
nodeType: VUI_RADIO_GROUP_SYMBOL,
|
|
@@ -2238,30 +2120,28 @@ const {
|
|
|
2238
2120
|
props: props$5,
|
|
2239
2121
|
emits: emits$5
|
|
2240
2122
|
} = createFormSelectorItemSettings();
|
|
2241
|
-
const VSwitch = defineComponent({
|
|
2123
|
+
const VSwitch = /* @__PURE__ */ defineComponent({
|
|
2242
2124
|
name: 'VSwitch',
|
|
2243
|
-
props: {
|
|
2125
|
+
props: {
|
|
2126
|
+
...props$5,
|
|
2244
2127
|
...createControlProps()
|
|
2245
2128
|
},
|
|
2246
2129
|
emits: emits$5,
|
|
2247
|
-
|
|
2248
2130
|
setup(props, ctx) {
|
|
2249
2131
|
const nodeControl = useFormSelectorItemControl(props, ctx, {
|
|
2250
2132
|
nodeType: VUI_SWITCH_SYMBOL,
|
|
2251
2133
|
parentNodeType: VUI_SWITCH_GROUP_SYMBOL
|
|
2252
2134
|
});
|
|
2253
2135
|
const control = useControl(props);
|
|
2254
|
-
|
|
2255
2136
|
if (typeof window !== 'undefined') {
|
|
2256
2137
|
window.yy = {};
|
|
2257
2138
|
window.yy[String(Date.now())] = nodeControl;
|
|
2258
2139
|
}
|
|
2259
|
-
|
|
2260
|
-
|
|
2140
|
+
return {
|
|
2141
|
+
...nodeControl.expose(),
|
|
2261
2142
|
...control
|
|
2262
2143
|
};
|
|
2263
2144
|
},
|
|
2264
|
-
|
|
2265
2145
|
render() {
|
|
2266
2146
|
const {
|
|
2267
2147
|
selectorItemControl
|
|
@@ -2288,13 +2168,11 @@ const VSwitch = defineComponent({
|
|
|
2288
2168
|
label: () => renderSlotOrEmpty(this.$slots, 'default')
|
|
2289
2169
|
});
|
|
2290
2170
|
}
|
|
2291
|
-
|
|
2292
2171
|
});
|
|
2293
2172
|
|
|
2294
2173
|
function _isSlot$9(s) {
|
|
2295
2174
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
2296
2175
|
}
|
|
2297
|
-
|
|
2298
2176
|
const VSwitchGroup = defineFormSelectorComponent({
|
|
2299
2177
|
name: 'VSwitchGroup',
|
|
2300
2178
|
defaultMultiple: true,
|
|
@@ -2312,13 +2190,13 @@ const {
|
|
|
2312
2190
|
props: props$4,
|
|
2313
2191
|
emits: emits$4
|
|
2314
2192
|
} = createFormSelectorItemSettings();
|
|
2315
|
-
const VOption = defineComponent({
|
|
2193
|
+
const VOption = /* @__PURE__ */ defineComponent({
|
|
2316
2194
|
name: 'VOption',
|
|
2317
|
-
props: {
|
|
2195
|
+
props: {
|
|
2196
|
+
...props$4,
|
|
2318
2197
|
...createControlProps()
|
|
2319
2198
|
},
|
|
2320
2199
|
emits: emits$4,
|
|
2321
|
-
|
|
2322
2200
|
setup(props, ctx) {
|
|
2323
2201
|
const nodeControl = useFormSelectorItemControl(props, ctx, {
|
|
2324
2202
|
nodeType: VUI_OPTION_SYMBOL,
|
|
@@ -2332,11 +2210,11 @@ const VOption = defineComponent({
|
|
|
2332
2210
|
'v-option--disabled': nodeControl.isDisabled
|
|
2333
2211
|
}, control.classes.value];
|
|
2334
2212
|
});
|
|
2335
|
-
return {
|
|
2213
|
+
return {
|
|
2214
|
+
...nodeControl.expose(),
|
|
2336
2215
|
classes
|
|
2337
2216
|
};
|
|
2338
2217
|
},
|
|
2339
|
-
|
|
2340
2218
|
render() {
|
|
2341
2219
|
const {
|
|
2342
2220
|
selectorItemControl,
|
|
@@ -2353,17 +2231,16 @@ const VOption = defineComponent({
|
|
|
2353
2231
|
"class": "v-option__label"
|
|
2354
2232
|
}, [renderSlotOrEmpty(this.$slots, 'default')])]);
|
|
2355
2233
|
}
|
|
2356
|
-
|
|
2357
2234
|
});
|
|
2358
2235
|
|
|
2359
|
-
const VOptionGroup = defineComponent({
|
|
2236
|
+
const VOptionGroup = /* @__PURE__ */ defineComponent({
|
|
2360
2237
|
name: 'VOptionGroup',
|
|
2361
|
-
props: {
|
|
2238
|
+
props: {
|
|
2239
|
+
...createFormSelectorItemGroupProps(),
|
|
2362
2240
|
// eslint-disable-next-line vue/require-prop-types
|
|
2363
2241
|
label: {},
|
|
2364
2242
|
...defineSlotsProps()
|
|
2365
2243
|
},
|
|
2366
|
-
|
|
2367
2244
|
setup(props, ctx) {
|
|
2368
2245
|
const groupControl = useFormSelectorItemGroupControl(props, ctx, {
|
|
2369
2246
|
parentNodeType: VUI_SELECT_SYMBOL
|
|
@@ -2376,12 +2253,12 @@ const VOptionGroup = defineComponent({
|
|
|
2376
2253
|
'v-option-group--disabled': groupControl.isDisabled
|
|
2377
2254
|
}];
|
|
2378
2255
|
});
|
|
2379
|
-
return {
|
|
2256
|
+
return {
|
|
2257
|
+
...groupControl.expose(),
|
|
2380
2258
|
classes,
|
|
2381
2259
|
labelSlot
|
|
2382
2260
|
};
|
|
2383
2261
|
},
|
|
2384
|
-
|
|
2385
2262
|
render() {
|
|
2386
2263
|
const {
|
|
2387
2264
|
labelSlot,
|
|
@@ -2395,12 +2272,12 @@ const VOptionGroup = defineComponent({
|
|
|
2395
2272
|
"class": "v-option-group__label"
|
|
2396
2273
|
}, [label]), renderSlotOrEmpty(this.$slots, 'default')]);
|
|
2397
2274
|
}
|
|
2398
|
-
|
|
2399
2275
|
});
|
|
2400
2276
|
|
|
2401
2277
|
const ADORNMENT_POSITIONS = ['start', 'end'];
|
|
2402
2278
|
function createControlFieldProps() {
|
|
2403
|
-
return {
|
|
2279
|
+
return {
|
|
2280
|
+
...createPropsOptions({
|
|
2404
2281
|
startAdornment: {},
|
|
2405
2282
|
endAdornment: {},
|
|
2406
2283
|
tabindex: {
|
|
@@ -2412,9 +2289,10 @@ function createControlFieldProps() {
|
|
|
2412
2289
|
...createControlProps()
|
|
2413
2290
|
};
|
|
2414
2291
|
}
|
|
2415
|
-
const VControlField = defineComponent({
|
|
2292
|
+
const VControlField = /* @__PURE__ */ defineComponent({
|
|
2416
2293
|
name: 'VControlField',
|
|
2417
|
-
props: {
|
|
2294
|
+
props: {
|
|
2295
|
+
...createControlFieldProps(),
|
|
2418
2296
|
focused: Boolean,
|
|
2419
2297
|
autoHeight: Boolean,
|
|
2420
2298
|
...defineSlotsProps(),
|
|
@@ -2424,7 +2302,6 @@ const VControlField = defineComponent({
|
|
|
2424
2302
|
emits: {
|
|
2425
2303
|
click: ev => true
|
|
2426
2304
|
},
|
|
2427
|
-
|
|
2428
2305
|
setup(props, ctx) {
|
|
2429
2306
|
const parentNode = useParentFormNode();
|
|
2430
2307
|
const control = useControl(props);
|
|
@@ -2433,11 +2310,11 @@ const VControlField = defineComponent({
|
|
|
2433
2310
|
const disabled = computed(() => !!parentNode && parentNode.isDisabled);
|
|
2434
2311
|
const invalid = computed(() => !!parentNode && parentNode.invalid);
|
|
2435
2312
|
const autoHeight = computed(() => props.autoHeight);
|
|
2436
|
-
const readonly = computed(() => !!parentNode && parentNode.isReadonly);
|
|
2313
|
+
const readonly = computed(() => !!parentNode && parentNode.isReadonly);
|
|
2314
|
+
// const computedTabindex = computed(() =>
|
|
2437
2315
|
// disabled.value ? -1 : props.tabindex,
|
|
2438
2316
|
// );
|
|
2439
2317
|
// const isOutlined = computed(() => inputBox.variant.value === 'outlined');
|
|
2440
|
-
|
|
2441
2318
|
const colorProvider = useVuiColorProvider();
|
|
2442
2319
|
const classes = computed(() => {
|
|
2443
2320
|
const classes = ['v-control-field', `v-control-field--${inputBox.variant.value}`, {
|
|
@@ -2457,10 +2334,8 @@ const VControlField = defineComponent({
|
|
|
2457
2334
|
});
|
|
2458
2335
|
return slots;
|
|
2459
2336
|
});
|
|
2460
|
-
|
|
2461
2337
|
const renderAdornment = position => {
|
|
2462
2338
|
let child;
|
|
2463
|
-
|
|
2464
2339
|
if (position === 'end' && props.loading) {
|
|
2465
2340
|
child = createVNode(VProgressCircular, {
|
|
2466
2341
|
"indeterminate": true,
|
|
@@ -2469,15 +2344,14 @@ const VControlField = defineComponent({
|
|
|
2469
2344
|
} else {
|
|
2470
2345
|
child = renderSlotOrEmpty(resolvedSlots.value, position);
|
|
2471
2346
|
}
|
|
2472
|
-
|
|
2473
2347
|
if (!child) return;
|
|
2474
2348
|
return createVNode("div", {
|
|
2475
2349
|
"class": ['v-control-field__adornment', `v-control-field__adornment--${position}`]
|
|
2476
2350
|
}, [child]);
|
|
2477
2351
|
};
|
|
2478
|
-
|
|
2479
2352
|
const handleClick = ev => {
|
|
2480
|
-
ctx.emit('click', ev);
|
|
2353
|
+
ctx.emit('click', ev);
|
|
2354
|
+
// if (ev.target === hostElRef.value) {
|
|
2481
2355
|
// ctx.emit('clickHost', ev);
|
|
2482
2356
|
// }
|
|
2483
2357
|
};
|
|
@@ -2486,8 +2360,8 @@ const VControlField = defineComponent({
|
|
|
2486
2360
|
classes,
|
|
2487
2361
|
renderAdornment,
|
|
2488
2362
|
hostElRef: () => hostElRef,
|
|
2489
|
-
handleClick
|
|
2490
|
-
|
|
2363
|
+
handleClick
|
|
2364
|
+
// computedTabindex,
|
|
2491
2365
|
};
|
|
2492
2366
|
},
|
|
2493
2367
|
|
|
@@ -2500,13 +2374,11 @@ const VControlField = defineComponent({
|
|
|
2500
2374
|
"class": "v-control-field__body"
|
|
2501
2375
|
}, [renderSlotOrEmpty(this.$slots, 'default')]), this.renderAdornment('end')]);
|
|
2502
2376
|
}
|
|
2503
|
-
|
|
2504
2377
|
});
|
|
2505
2378
|
|
|
2506
2379
|
function _isSlot$8(s) {
|
|
2507
2380
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
2508
2381
|
}
|
|
2509
|
-
|
|
2510
2382
|
const ARROW_KEY_TYPES = useKeyboard.Key(['ArrowUp', 'ArrowDown']);
|
|
2511
2383
|
const CHOICE_KEY_TYPES = useKeyboard.Key(['Enter', ' ']);
|
|
2512
2384
|
const KEYBORD_EVENT_TYPES = useKeyboard.Key([...ARROW_KEY_TYPES, ...CHOICE_KEY_TYPES]);
|
|
@@ -2514,9 +2386,10 @@ const {
|
|
|
2514
2386
|
props: props$3,
|
|
2515
2387
|
emits: emits$3
|
|
2516
2388
|
} = createFormSelectorSettings();
|
|
2517
|
-
const VSelect = defineComponent({
|
|
2389
|
+
const VSelect = /* @__PURE__ */ defineComponent({
|
|
2518
2390
|
name: 'VSelect',
|
|
2519
|
-
props: {
|
|
2391
|
+
props: {
|
|
2392
|
+
...props$3,
|
|
2520
2393
|
...createFormControlProps(),
|
|
2521
2394
|
...createControlFieldProps(),
|
|
2522
2395
|
...createControlFieldProviderProps(),
|
|
@@ -2530,19 +2403,15 @@ const VSelect = defineComponent({
|
|
|
2530
2403
|
closeOnNavigation: Boolean
|
|
2531
2404
|
},
|
|
2532
2405
|
emits: emits$3,
|
|
2533
|
-
|
|
2534
2406
|
setup(props, ctx) {
|
|
2535
2407
|
const menuRef = ref(null);
|
|
2536
2408
|
const menuOpened = ref(false);
|
|
2537
|
-
|
|
2538
2409
|
const showMenu = () => {
|
|
2539
2410
|
menuOpened.value = true;
|
|
2540
2411
|
};
|
|
2541
|
-
|
|
2542
2412
|
const closeMenu = () => {
|
|
2543
2413
|
menuOpened.value = false;
|
|
2544
2414
|
};
|
|
2545
|
-
|
|
2546
2415
|
const inputControl = useFormSelectorControl(props, ctx, {
|
|
2547
2416
|
nodeType: VUI_SELECT_SYMBOL,
|
|
2548
2417
|
onSelectItem: item => {
|
|
@@ -2562,15 +2431,12 @@ const VSelect = defineComponent({
|
|
|
2562
2431
|
const slot = resolveVNodeChildOrSlots(props.failedToLoadItemsMessage, vui.setting('failedToLoadDataMessage'), 'Failed to load data.');
|
|
2563
2432
|
return slot && slot(vui);
|
|
2564
2433
|
});
|
|
2565
|
-
|
|
2566
2434
|
const focus = opts => {
|
|
2567
2435
|
fieldRef.value && fieldRef.value.focus(opts);
|
|
2568
2436
|
};
|
|
2569
|
-
|
|
2570
2437
|
const renderSelections = selectedItems => {
|
|
2571
2438
|
const selectionSlot = ctx.slots.selection;
|
|
2572
2439
|
const children = [];
|
|
2573
|
-
|
|
2574
2440
|
if (inputControl.itemsLoadFailed) {
|
|
2575
2441
|
children.push(createVNode("span", {
|
|
2576
2442
|
"class": "v-select__placeholder"
|
|
@@ -2584,7 +2450,6 @@ const VSelect = defineComponent({
|
|
|
2584
2450
|
if (index > 0) {
|
|
2585
2451
|
children.push(vui.selectionSeparator());
|
|
2586
2452
|
}
|
|
2587
|
-
|
|
2588
2453
|
const child = selectionSlot ? selectionSlot({
|
|
2589
2454
|
item,
|
|
2590
2455
|
index
|
|
@@ -2596,10 +2461,8 @@ const VSelect = defineComponent({
|
|
|
2596
2461
|
"class": "v-select__placeholder"
|
|
2597
2462
|
}, [props.placeholder]));
|
|
2598
2463
|
}
|
|
2599
|
-
|
|
2600
2464
|
return children;
|
|
2601
2465
|
};
|
|
2602
|
-
|
|
2603
2466
|
const clearKeyFocused = () => {
|
|
2604
2467
|
const menu = menuRef.value;
|
|
2605
2468
|
if (!menu) return;
|
|
@@ -2608,7 +2471,6 @@ const VSelect = defineComponent({
|
|
|
2608
2471
|
const els = Array.from(bodyEl.querySelectorAll('.v-option'));
|
|
2609
2472
|
els.forEach(el => el.classList.remove('v-option--key-focused'));
|
|
2610
2473
|
};
|
|
2611
|
-
|
|
2612
2474
|
const getItemElements = () => {
|
|
2613
2475
|
const menu = menuRef.value;
|
|
2614
2476
|
if (!menu) return;
|
|
@@ -2624,7 +2486,6 @@ const VSelect = defineComponent({
|
|
|
2624
2486
|
if (!els.length) return;
|
|
2625
2487
|
return els;
|
|
2626
2488
|
};
|
|
2627
|
-
|
|
2628
2489
|
const arrowKeyHandler = ev => {
|
|
2629
2490
|
const {
|
|
2630
2491
|
key
|
|
@@ -2639,22 +2500,18 @@ const VSelect = defineComponent({
|
|
|
2639
2500
|
length
|
|
2640
2501
|
} = els;
|
|
2641
2502
|
const isUp = key === 'ArrowUp';
|
|
2642
|
-
|
|
2643
2503
|
if (currentIndex == null) {
|
|
2644
2504
|
nextIndex = isUp ? length - 1 : 0;
|
|
2645
2505
|
} else {
|
|
2646
2506
|
const shiftAmount = key === 'ArrowUp' ? -1 : 1;
|
|
2647
2507
|
nextIndex = currentIndex + shiftAmount;
|
|
2648
|
-
|
|
2649
2508
|
if (nextIndex < 0) {
|
|
2650
2509
|
nextIndex = length - 1;
|
|
2651
2510
|
} else if (nextIndex >= length) {
|
|
2652
2511
|
nextIndex = 0;
|
|
2653
2512
|
}
|
|
2654
2513
|
}
|
|
2655
|
-
|
|
2656
2514
|
const nextEl = els[nextIndex];
|
|
2657
|
-
|
|
2658
2515
|
if (nextEl) {
|
|
2659
2516
|
clearKeyFocused();
|
|
2660
2517
|
nextEl.classList.add('v-option--key-focused');
|
|
@@ -2666,7 +2523,6 @@ const VSelect = defineComponent({
|
|
|
2666
2523
|
ev.preventDefault();
|
|
2667
2524
|
}
|
|
2668
2525
|
};
|
|
2669
|
-
|
|
2670
2526
|
const choiceKeyHandler = ev => {
|
|
2671
2527
|
const {
|
|
2672
2528
|
key
|
|
@@ -2675,7 +2531,6 @@ const VSelect = defineComponent({
|
|
|
2675
2531
|
const els = getItemElements();
|
|
2676
2532
|
if (!els) return;
|
|
2677
2533
|
const currentEl = els.find(el => el.classList.contains('v-option--key-focused'));
|
|
2678
|
-
|
|
2679
2534
|
if (currentEl) {
|
|
2680
2535
|
const ev = new MouseEvent('click', {
|
|
2681
2536
|
view: window,
|
|
@@ -2689,19 +2544,18 @@ const VSelect = defineComponent({
|
|
|
2689
2544
|
});
|
|
2690
2545
|
}
|
|
2691
2546
|
};
|
|
2692
|
-
|
|
2693
2547
|
const keyboardEventHandler = ev => {
|
|
2694
2548
|
if (ARROW_KEY_TYPES.includes(ev.key)) return arrowKeyHandler(ev);
|
|
2695
2549
|
if (CHOICE_KEY_TYPES.includes(ev.key)) return choiceKeyHandler(ev);
|
|
2696
2550
|
};
|
|
2697
|
-
|
|
2698
2551
|
useKeyboard([{
|
|
2699
2552
|
key: KEYBORD_EVENT_TYPES,
|
|
2700
2553
|
handler: keyboardEventHandler
|
|
2701
2554
|
}], {
|
|
2702
2555
|
autorun: true
|
|
2703
2556
|
});
|
|
2704
|
-
return {
|
|
2557
|
+
return {
|
|
2558
|
+
...inputControl.expose(),
|
|
2705
2559
|
...control,
|
|
2706
2560
|
iconName,
|
|
2707
2561
|
menuOpened,
|
|
@@ -2714,7 +2568,6 @@ const VSelect = defineComponent({
|
|
|
2714
2568
|
clearKeyFocused
|
|
2715
2569
|
};
|
|
2716
2570
|
},
|
|
2717
|
-
|
|
2718
2571
|
render() {
|
|
2719
2572
|
const {
|
|
2720
2573
|
nodeControl,
|
|
@@ -2725,7 +2578,6 @@ const VSelect = defineComponent({
|
|
|
2725
2578
|
const children = this.$slots.default && this.$slots.default() || [];
|
|
2726
2579
|
const propGroups = this.propGroups.map(group => {
|
|
2727
2580
|
let _slot;
|
|
2728
|
-
|
|
2729
2581
|
return createVNode(VOptionGroup, {
|
|
2730
2582
|
"key": group.id,
|
|
2731
2583
|
"groupId": group.id,
|
|
@@ -2754,7 +2606,8 @@ const VSelect = defineComponent({
|
|
|
2754
2606
|
"onClickLabel": ev => {
|
|
2755
2607
|
this.focus();
|
|
2756
2608
|
}
|
|
2757
|
-
}, {
|
|
2609
|
+
}, {
|
|
2610
|
+
...this.$slots,
|
|
2758
2611
|
default: () => createVNode(VMenu, {
|
|
2759
2612
|
"width": "fit",
|
|
2760
2613
|
"maxWidth": "fit",
|
|
@@ -2787,20 +2640,18 @@ const VSelect = defineComponent({
|
|
|
2787
2640
|
let t = ev.target;
|
|
2788
2641
|
const count = 0;
|
|
2789
2642
|
let hit = false;
|
|
2790
|
-
|
|
2791
2643
|
while (count < 5) {
|
|
2792
2644
|
if (t.classList.contains('v-select__input')) {
|
|
2793
2645
|
hit = true;
|
|
2794
2646
|
break;
|
|
2795
2647
|
}
|
|
2796
|
-
|
|
2797
2648
|
t = t.parentElement;
|
|
2798
2649
|
}
|
|
2799
|
-
|
|
2800
2650
|
control.show(hit ? t : ev);
|
|
2801
2651
|
}
|
|
2802
2652
|
}
|
|
2803
|
-
}, {
|
|
2653
|
+
}, {
|
|
2654
|
+
...this.$slots,
|
|
2804
2655
|
default: () => [withDirectives(createVNode("select", {
|
|
2805
2656
|
"class": "v-select__input__element",
|
|
2806
2657
|
"name": this.name,
|
|
@@ -2832,7 +2683,6 @@ const VSelect = defineComponent({
|
|
|
2832
2683
|
}
|
|
2833
2684
|
}, null);
|
|
2834
2685
|
}
|
|
2835
|
-
|
|
2836
2686
|
if (this.clearable && this.nodeControl.value != null) {
|
|
2837
2687
|
return createVNode(VButton, {
|
|
2838
2688
|
"key": "clear",
|
|
@@ -2844,7 +2694,6 @@ const VSelect = defineComponent({
|
|
|
2844
2694
|
}
|
|
2845
2695
|
}, null);
|
|
2846
2696
|
}
|
|
2847
|
-
|
|
2848
2697
|
return createVNode(VIcon, {
|
|
2849
2698
|
"key": "icon",
|
|
2850
2699
|
"name": this.iconName,
|
|
@@ -2855,10 +2704,9 @@ const VSelect = defineComponent({
|
|
|
2855
2704
|
})
|
|
2856
2705
|
});
|
|
2857
2706
|
}
|
|
2858
|
-
|
|
2859
2707
|
});
|
|
2860
2708
|
|
|
2861
|
-
const VTextCounter = defineComponent({
|
|
2709
|
+
const VTextCounter = /* @__PURE__ */ defineComponent({
|
|
2862
2710
|
name: 'VTextCounter',
|
|
2863
2711
|
props: {
|
|
2864
2712
|
length: {
|
|
@@ -2870,22 +2718,20 @@ const VTextCounter = defineComponent({
|
|
|
2870
2718
|
required: true
|
|
2871
2719
|
}
|
|
2872
2720
|
},
|
|
2873
|
-
|
|
2874
2721
|
render() {
|
|
2875
2722
|
return createVNode("span", {
|
|
2876
2723
|
"class": "v-text-counter"
|
|
2877
2724
|
}, [`${this.length} / ${this.maxlength}`]);
|
|
2878
2725
|
}
|
|
2879
|
-
|
|
2880
2726
|
});
|
|
2881
2727
|
|
|
2882
2728
|
const {
|
|
2883
2729
|
props: props$2,
|
|
2884
2730
|
emits: emits$2
|
|
2885
2731
|
} = createTextInputSettings();
|
|
2886
|
-
|
|
2887
2732
|
function createTextFieldProps() {
|
|
2888
|
-
return {
|
|
2733
|
+
return {
|
|
2734
|
+
...props$2,
|
|
2889
2735
|
...createFormControlProps(),
|
|
2890
2736
|
...createControlFieldProps(),
|
|
2891
2737
|
...createControlFieldProviderProps(),
|
|
@@ -2893,23 +2739,21 @@ function createTextFieldProps() {
|
|
|
2893
2739
|
...defineSlotsProps()
|
|
2894
2740
|
};
|
|
2895
2741
|
}
|
|
2896
|
-
|
|
2897
|
-
const VTextField = defineComponent({
|
|
2742
|
+
const VTextField = /* @__PURE__ */ defineComponent({
|
|
2898
2743
|
name: 'VTextField',
|
|
2899
2744
|
props: createTextFieldProps(),
|
|
2900
2745
|
emits: emits$2,
|
|
2901
|
-
|
|
2902
2746
|
setup(props, ctx) {
|
|
2903
2747
|
const inputControl = useTextInputControl(props, ctx, {
|
|
2904
2748
|
nodeType: VUI_TEXT_FIELD_SYMBOL
|
|
2905
2749
|
});
|
|
2906
2750
|
const control = useControl(props);
|
|
2907
2751
|
useControlField(props);
|
|
2908
|
-
return {
|
|
2752
|
+
return {
|
|
2753
|
+
...inputControl.expose(),
|
|
2909
2754
|
...control
|
|
2910
2755
|
};
|
|
2911
2756
|
},
|
|
2912
|
-
|
|
2913
2757
|
render() {
|
|
2914
2758
|
return createVNode(VFormControl, {
|
|
2915
2759
|
"nodeControl": this.nodeControl,
|
|
@@ -2923,13 +2767,15 @@ const VTextField = defineComponent({
|
|
|
2923
2767
|
"onClickLabel": ev => {
|
|
2924
2768
|
this.focus();
|
|
2925
2769
|
}
|
|
2926
|
-
}, {
|
|
2770
|
+
}, {
|
|
2771
|
+
...this.$slots,
|
|
2927
2772
|
default: () => createVNode(VControlField, {
|
|
2928
2773
|
"class": "v-text-field__input",
|
|
2929
2774
|
"startAdornment": this.startAdornment,
|
|
2930
2775
|
"endAdornment": this.endAdornment,
|
|
2931
2776
|
"size": this.size
|
|
2932
|
-
}, {
|
|
2777
|
+
}, {
|
|
2778
|
+
...this.$slots,
|
|
2933
2779
|
default: () => this.textInputControl.createInputElement({
|
|
2934
2780
|
class: 'v-text-field__input__element'
|
|
2935
2781
|
})
|
|
@@ -2943,35 +2789,33 @@ const VTextField = defineComponent({
|
|
|
2943
2789
|
}
|
|
2944
2790
|
});
|
|
2945
2791
|
}
|
|
2946
|
-
|
|
2947
2792
|
});
|
|
2948
2793
|
|
|
2949
|
-
const VNumberField = defineComponent({
|
|
2794
|
+
const VNumberField = /* @__PURE__ */ defineComponent({
|
|
2950
2795
|
name: 'VNumberField',
|
|
2951
|
-
props: {
|
|
2796
|
+
props: {
|
|
2797
|
+
...undefined,
|
|
2952
2798
|
modelValue: {
|
|
2953
2799
|
type: Number,
|
|
2954
2800
|
default: null
|
|
2955
2801
|
}
|
|
2956
2802
|
},
|
|
2957
|
-
emits: {
|
|
2803
|
+
emits: {
|
|
2804
|
+
...undefined,
|
|
2958
2805
|
'update:modelValue': value => true,
|
|
2959
2806
|
change: value => true
|
|
2960
2807
|
},
|
|
2961
|
-
|
|
2962
2808
|
setup(props, ctx) {
|
|
2963
2809
|
const toString = value => {
|
|
2964
2810
|
if (value == null) return '';
|
|
2965
2811
|
return String(value);
|
|
2966
2812
|
};
|
|
2967
|
-
|
|
2968
2813
|
const toNumber = value => {
|
|
2969
2814
|
if (value == null) return null;
|
|
2970
2815
|
if (typeof value === 'number') return value;
|
|
2971
2816
|
if (value.trim() === '') return null;
|
|
2972
2817
|
return Number(value);
|
|
2973
2818
|
};
|
|
2974
|
-
|
|
2975
2819
|
return () => {
|
|
2976
2820
|
return createVNode(VTextField, mergeProps(ctx.attrs, {
|
|
2977
2821
|
"type": "number",
|
|
@@ -2985,16 +2829,16 @@ const VNumberField = defineComponent({
|
|
|
2985
2829
|
}), ctx.slots);
|
|
2986
2830
|
};
|
|
2987
2831
|
}
|
|
2988
|
-
|
|
2989
2832
|
});
|
|
2990
2833
|
|
|
2991
2834
|
const {
|
|
2992
2835
|
props: props$1,
|
|
2993
2836
|
emits: emits$1
|
|
2994
2837
|
} = createTextareaSettings();
|
|
2995
|
-
const VTextarea = defineComponent({
|
|
2838
|
+
const VTextarea = /* @__PURE__ */ defineComponent({
|
|
2996
2839
|
name: 'VTextarea',
|
|
2997
|
-
props: {
|
|
2840
|
+
props: {
|
|
2841
|
+
...props$1,
|
|
2998
2842
|
...createFormControlProps(),
|
|
2999
2843
|
...createControlFieldProps(),
|
|
3000
2844
|
...createControlFieldProviderProps(),
|
|
@@ -3002,7 +2846,6 @@ const VTextarea = defineComponent({
|
|
|
3002
2846
|
...defineSlotsProps()
|
|
3003
2847
|
},
|
|
3004
2848
|
emits: emits$1,
|
|
3005
|
-
|
|
3006
2849
|
setup(props, ctx) {
|
|
3007
2850
|
const vui = useVui();
|
|
3008
2851
|
const inputControl = useTextareaControl(props, ctx, {
|
|
@@ -3011,11 +2854,11 @@ const VTextarea = defineComponent({
|
|
|
3011
2854
|
});
|
|
3012
2855
|
const control = useControl(props);
|
|
3013
2856
|
useControlField(props);
|
|
3014
|
-
return {
|
|
2857
|
+
return {
|
|
2858
|
+
...inputControl.expose(),
|
|
3015
2859
|
...control
|
|
3016
2860
|
};
|
|
3017
2861
|
},
|
|
3018
|
-
|
|
3019
2862
|
render() {
|
|
3020
2863
|
return createVNode(VFormControl, {
|
|
3021
2864
|
"nodeControl": this.nodeControl,
|
|
@@ -3029,14 +2872,16 @@ const VTextarea = defineComponent({
|
|
|
3029
2872
|
"onClickLabel": ev => {
|
|
3030
2873
|
this.focus();
|
|
3031
2874
|
}
|
|
3032
|
-
}, {
|
|
2875
|
+
}, {
|
|
2876
|
+
...this.$slots,
|
|
3033
2877
|
default: () => createVNode(VControlField, {
|
|
3034
2878
|
"class": "v-textarea__input",
|
|
3035
2879
|
"size": this.size,
|
|
3036
2880
|
"autoHeight": true,
|
|
3037
2881
|
"startAdornment": this.startAdornment,
|
|
3038
2882
|
"endAdornment": this.endAdornment
|
|
3039
|
-
}, {
|
|
2883
|
+
}, {
|
|
2884
|
+
...this.$slots,
|
|
3040
2885
|
default: () => this.textareaControl.createInputElement({
|
|
3041
2886
|
class: 'v-textarea__input__element'
|
|
3042
2887
|
})
|
|
@@ -3050,7 +2895,6 @@ const VTextarea = defineComponent({
|
|
|
3050
2895
|
}
|
|
3051
2896
|
});
|
|
3052
2897
|
}
|
|
3053
|
-
|
|
3054
2898
|
});
|
|
3055
2899
|
|
|
3056
2900
|
const EDITOR_EVENTS = [
|
|
@@ -3172,10 +3016,10 @@ function resolveRawWysiwygEditorTools(rawTools, vui) {
|
|
|
3172
3016
|
function _isSlot$7(s) {
|
|
3173
3017
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
3174
3018
|
}
|
|
3175
|
-
|
|
3176
|
-
const VWysiwygEditor = defineComponent({
|
|
3019
|
+
const VWysiwygEditor = /* @__PURE__ */ defineComponent({
|
|
3177
3020
|
name: 'VWysiwygEditor',
|
|
3178
|
-
props: {
|
|
3021
|
+
props: {
|
|
3022
|
+
// ...props,
|
|
3179
3023
|
...createTextableProps(),
|
|
3180
3024
|
...createFormControlProps(),
|
|
3181
3025
|
...createControlFieldProps(),
|
|
@@ -3194,9 +3038,9 @@ const VWysiwygEditor = defineComponent({
|
|
|
3194
3038
|
disabledMinHeight: Boolean,
|
|
3195
3039
|
disabledMaxHeight: Boolean
|
|
3196
3040
|
},
|
|
3197
|
-
emits: {
|
|
3041
|
+
emits: {
|
|
3042
|
+
...createTextableEmits()
|
|
3198
3043
|
},
|
|
3199
|
-
|
|
3200
3044
|
setup(props, ctx) {
|
|
3201
3045
|
const vui = useVui();
|
|
3202
3046
|
const textRef = ref('');
|
|
@@ -3238,16 +3082,15 @@ const VWysiwygEditor = defineComponent({
|
|
|
3238
3082
|
orderedList: false,
|
|
3239
3083
|
history: false,
|
|
3240
3084
|
italic: false
|
|
3241
|
-
}),
|
|
3085
|
+
}),
|
|
3086
|
+
// Linter.configure({
|
|
3242
3087
|
// plugins: [BadWords(['abc', 'evidently']), Punctuation, HeadingLevel],
|
|
3243
3088
|
// }),
|
|
3244
3089
|
...resolveRawWysiwygExtensions(props.extensions, initializeCtx), ...wysiwygSettings.value.extensions];
|
|
3245
|
-
|
|
3246
3090
|
const updateEditable = () => {
|
|
3247
3091
|
if (!editor.value) return;
|
|
3248
3092
|
editor.value.setEditable(inputControl.canOperation);
|
|
3249
3093
|
};
|
|
3250
|
-
|
|
3251
3094
|
watch(() => inputControl.canOperation, updateEditable);
|
|
3252
3095
|
watch(() => props.modelValue, modelValue => {
|
|
3253
3096
|
const $editor = editor.value;
|
|
@@ -3261,7 +3104,8 @@ const VWysiwygEditor = defineComponent({
|
|
|
3261
3104
|
textRef.value = editor.getText();
|
|
3262
3105
|
updateEditable();
|
|
3263
3106
|
});
|
|
3264
|
-
const editor = useEditor({
|
|
3107
|
+
const editor = useEditor({
|
|
3108
|
+
...initializeCtx.editorOptions(),
|
|
3265
3109
|
autofocus: props.autofocus,
|
|
3266
3110
|
content: props.modelValue,
|
|
3267
3111
|
extensions,
|
|
@@ -3270,33 +3114,29 @@ const VWysiwygEditor = defineComponent({
|
|
|
3270
3114
|
class: 'v-wysiwyg-editor__input__prose'
|
|
3271
3115
|
}
|
|
3272
3116
|
}
|
|
3273
|
-
});
|
|
3274
|
-
|
|
3117
|
+
});
|
|
3118
|
+
// editor.value.state.doc.content
|
|
3275
3119
|
const focus = (position, options) => {
|
|
3276
3120
|
if (!editor.value) return;
|
|
3277
3121
|
return editor.value.chain().focus(position, options);
|
|
3278
3122
|
};
|
|
3279
|
-
|
|
3280
3123
|
const blur = () => {
|
|
3281
3124
|
if (!editor.value) return;
|
|
3282
3125
|
return editor.value.chain().blur();
|
|
3283
3126
|
};
|
|
3284
|
-
|
|
3285
3127
|
const wysiwygContext = computed(() => {
|
|
3286
3128
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3287
|
-
const _editor = editor.value;
|
|
3129
|
+
const _editor = editor.value;
|
|
3130
|
+
// if (!_editor) {
|
|
3288
3131
|
// throw new Error('missing editor value');
|
|
3289
3132
|
// }
|
|
3290
|
-
|
|
3291
3133
|
return {
|
|
3292
3134
|
vui,
|
|
3293
3135
|
editor: _editor
|
|
3294
3136
|
};
|
|
3295
3137
|
});
|
|
3296
|
-
|
|
3297
3138
|
const createTools = (bubbleMenu = false) => {
|
|
3298
3139
|
let _slot;
|
|
3299
|
-
|
|
3300
3140
|
const {
|
|
3301
3141
|
value: settings
|
|
3302
3142
|
} = wysiwygSettings;
|
|
@@ -3322,11 +3162,9 @@ const VWysiwygEditor = defineComponent({
|
|
|
3322
3162
|
const isDisabled = !inputControl.canOperation || !!_editor && resolveContextableValue(context, disabled);
|
|
3323
3163
|
let iconName;
|
|
3324
3164
|
let child;
|
|
3325
|
-
|
|
3326
3165
|
if (typeof icon === 'function') {
|
|
3327
3166
|
if (_editor) {
|
|
3328
3167
|
const _child = icon(context);
|
|
3329
|
-
|
|
3330
3168
|
if (typeof _child === 'function') {
|
|
3331
3169
|
child = _child();
|
|
3332
3170
|
} else {
|
|
@@ -3336,7 +3174,6 @@ const VWysiwygEditor = defineComponent({
|
|
|
3336
3174
|
} else {
|
|
3337
3175
|
iconName = icon;
|
|
3338
3176
|
}
|
|
3339
|
-
|
|
3340
3177
|
if (!iconName && child == null) return;
|
|
3341
3178
|
return createVNode(VButton, {
|
|
3342
3179
|
"tabindex": -1,
|
|
@@ -3352,7 +3189,6 @@ const VWysiwygEditor = defineComponent({
|
|
|
3352
3189
|
default: () => [_slot]
|
|
3353
3190
|
});
|
|
3354
3191
|
};
|
|
3355
|
-
|
|
3356
3192
|
onBeforeUnmount(() => {
|
|
3357
3193
|
editor.value && editor.value.destroy();
|
|
3358
3194
|
});
|
|
@@ -3365,7 +3201,6 @@ const VWysiwygEditor = defineComponent({
|
|
|
3365
3201
|
createTools
|
|
3366
3202
|
};
|
|
3367
3203
|
},
|
|
3368
|
-
|
|
3369
3204
|
render() {
|
|
3370
3205
|
return createVNode(VFormControl, {
|
|
3371
3206
|
"nodeControl": this.nodeControl,
|
|
@@ -3384,7 +3219,8 @@ const VWysiwygEditor = defineComponent({
|
|
|
3384
3219
|
scrollIntoView: true
|
|
3385
3220
|
});
|
|
3386
3221
|
}
|
|
3387
|
-
}, {
|
|
3222
|
+
}, {
|
|
3223
|
+
...this.$slots,
|
|
3388
3224
|
default: () => {
|
|
3389
3225
|
const {
|
|
3390
3226
|
editor
|
|
@@ -3397,10 +3233,10 @@ const VWysiwygEditor = defineComponent({
|
|
|
3397
3233
|
"startAdornment": this.startAdornment,
|
|
3398
3234
|
"endAdornment": this.endAdornment,
|
|
3399
3235
|
"size": this.size
|
|
3400
|
-
}, {
|
|
3236
|
+
}, {
|
|
3237
|
+
...this.$slots,
|
|
3401
3238
|
default: () => {
|
|
3402
3239
|
let _slot2;
|
|
3403
|
-
|
|
3404
3240
|
return createVNode("div", {
|
|
3405
3241
|
"class": "v-wysiwyg-editor__body"
|
|
3406
3242
|
}, [createVNode(EditorContent, mergeProps({
|
|
@@ -3426,9 +3262,7 @@ const VWysiwygEditor = defineComponent({
|
|
|
3426
3262
|
}
|
|
3427
3263
|
});
|
|
3428
3264
|
}
|
|
3429
|
-
|
|
3430
3265
|
});
|
|
3431
|
-
|
|
3432
3266
|
function resolveContextableValue(ctx, source) {
|
|
3433
3267
|
return typeof source === 'function' ? source(ctx) : source;
|
|
3434
3268
|
}
|
|
@@ -3436,11 +3270,9 @@ function resolveContextableValue(ctx, source) {
|
|
|
3436
3270
|
const PROBLEM_CLASS_NAME = 'v-linter__problem';
|
|
3437
3271
|
const ISSUE_ICON_CLASS_NAME = 'v-linter__issue-icon';
|
|
3438
3272
|
const ISSUE_DATASET_NAME = 'data-issue-id';
|
|
3439
|
-
|
|
3440
3273
|
function resolveWysiwygLinterFixMessage(message) {
|
|
3441
3274
|
return typeof message === 'function' ? message() : message;
|
|
3442
3275
|
}
|
|
3443
|
-
|
|
3444
3276
|
function renderIcon(view, issue) {
|
|
3445
3277
|
const {
|
|
3446
3278
|
level = 'warning'
|
|
@@ -3449,14 +3281,11 @@ function renderIcon(view, issue) {
|
|
|
3449
3281
|
const message = resolveWysiwygLinterFixMessage(issue.message);
|
|
3450
3282
|
icon.className = `${ISSUE_ICON_CLASS_NAME} ${level}-scope`;
|
|
3451
3283
|
icon.setAttribute(ISSUE_DATASET_NAME, issue.id);
|
|
3452
|
-
|
|
3453
3284
|
if (typeof message === 'string') {
|
|
3454
3285
|
icon.title = message;
|
|
3455
3286
|
}
|
|
3456
|
-
|
|
3457
3287
|
return icon;
|
|
3458
3288
|
}
|
|
3459
|
-
|
|
3460
3289
|
function runAllLinterPlugins(doc, plugins) {
|
|
3461
3290
|
const decorations = [];
|
|
3462
3291
|
const issues = plugins.map(RegisteredLinterPlugin => {
|
|
@@ -3473,7 +3302,6 @@ function runAllLinterPlugins(doc, plugins) {
|
|
|
3473
3302
|
'data-issue-id': issue.id,
|
|
3474
3303
|
title: typeof message === 'string' ? message : undefined
|
|
3475
3304
|
}));
|
|
3476
|
-
|
|
3477
3305
|
if (icon) {
|
|
3478
3306
|
decorations.push(Decoration.widget(issue.from, view => renderIcon(view, issue)));
|
|
3479
3307
|
}
|
|
@@ -3484,7 +3312,6 @@ function runAllLinterPlugins(doc, plugins) {
|
|
|
3484
3312
|
decorationSet
|
|
3485
3313
|
};
|
|
3486
3314
|
}
|
|
3487
|
-
|
|
3488
3315
|
const WysiwygLinter = createWysiwygExtension(ctx => {
|
|
3489
3316
|
function showMenu(view, issue, event) {
|
|
3490
3317
|
const message = resolveWysiwygLinterFixMessage(issue.message);
|
|
@@ -3513,22 +3340,18 @@ const WysiwygLinter = createWysiwygExtension(ctx => {
|
|
|
3513
3340
|
}, [resolveWysiwygLinterFixMessage(fixer.message)])])]))])])
|
|
3514
3341
|
});
|
|
3515
3342
|
}
|
|
3516
|
-
|
|
3517
3343
|
return Extension.create({
|
|
3518
3344
|
name: 'linter',
|
|
3519
|
-
|
|
3520
3345
|
addOptions() {
|
|
3521
3346
|
return {
|
|
3522
3347
|
plugins: []
|
|
3523
3348
|
};
|
|
3524
3349
|
},
|
|
3525
|
-
|
|
3526
3350
|
addStorage() {
|
|
3527
3351
|
return {
|
|
3528
3352
|
issues: []
|
|
3529
3353
|
};
|
|
3530
3354
|
},
|
|
3531
|
-
|
|
3532
3355
|
addProseMirrorPlugins() {
|
|
3533
3356
|
const {
|
|
3534
3357
|
plugins
|
|
@@ -3536,7 +3359,6 @@ const WysiwygLinter = createWysiwygExtension(ctx => {
|
|
|
3536
3359
|
const {
|
|
3537
3360
|
storage
|
|
3538
3361
|
} = this;
|
|
3539
|
-
|
|
3540
3362
|
const runAll = doc => {
|
|
3541
3363
|
const {
|
|
3542
3364
|
issues,
|
|
@@ -3545,14 +3367,11 @@ const WysiwygLinter = createWysiwygExtension(ctx => {
|
|
|
3545
3367
|
storage.issues = issues;
|
|
3546
3368
|
return decorationSet;
|
|
3547
3369
|
};
|
|
3548
|
-
|
|
3549
3370
|
const getIssue = id => storage.issues.find(issue => issue.id === id);
|
|
3550
|
-
|
|
3551
3371
|
const getIssueElementByEvent = source => {
|
|
3552
3372
|
if (!source || !(source instanceof HTMLElement)) {
|
|
3553
3373
|
return;
|
|
3554
3374
|
}
|
|
3555
|
-
|
|
3556
3375
|
const issueId = source.getAttribute(ISSUE_DATASET_NAME);
|
|
3557
3376
|
const issue = issueId && getIssue(issueId);
|
|
3558
3377
|
if (!issue) return;
|
|
@@ -3560,7 +3379,6 @@ const WysiwygLinter = createWysiwygExtension(ctx => {
|
|
|
3560
3379
|
issue
|
|
3561
3380
|
};
|
|
3562
3381
|
};
|
|
3563
|
-
|
|
3564
3382
|
const linterPlugin = new Plugin({
|
|
3565
3383
|
key: new PluginKey('linter'),
|
|
3566
3384
|
state: {
|
|
@@ -3569,24 +3387,19 @@ const WysiwygLinter = createWysiwygExtension(ctx => {
|
|
|
3569
3387
|
}) {
|
|
3570
3388
|
return runAll(doc);
|
|
3571
3389
|
},
|
|
3572
|
-
|
|
3573
3390
|
apply(transaction, oldState) {
|
|
3574
3391
|
return transaction.docChanged ? runAll(transaction.doc) : oldState;
|
|
3575
3392
|
}
|
|
3576
|
-
|
|
3577
3393
|
},
|
|
3578
3394
|
props: {
|
|
3579
3395
|
decorations(state) {
|
|
3580
3396
|
return linterPlugin.getState(state);
|
|
3581
3397
|
},
|
|
3582
|
-
|
|
3583
3398
|
handleClick(view, _, event) {
|
|
3584
3399
|
const info = getIssueElementByEvent(event.target);
|
|
3585
|
-
|
|
3586
3400
|
if (!info) {
|
|
3587
3401
|
return false;
|
|
3588
3402
|
}
|
|
3589
|
-
|
|
3590
3403
|
const {
|
|
3591
3404
|
issue
|
|
3592
3405
|
} = info;
|
|
@@ -3594,19 +3407,15 @@ const WysiwygLinter = createWysiwygExtension(ctx => {
|
|
|
3594
3407
|
from,
|
|
3595
3408
|
to
|
|
3596
3409
|
} = issue;
|
|
3597
|
-
|
|
3598
3410
|
const focus = () => view.dispatch(view.state.tr.setSelection(TextSelection.create(view.state.doc, from, to)).scrollIntoView());
|
|
3599
|
-
|
|
3600
3411
|
focus();
|
|
3601
3412
|
showMenu(view, issue, event);
|
|
3602
3413
|
return true;
|
|
3603
3414
|
}
|
|
3604
|
-
|
|
3605
3415
|
}
|
|
3606
3416
|
});
|
|
3607
3417
|
return [linterPlugin];
|
|
3608
3418
|
}
|
|
3609
|
-
|
|
3610
3419
|
});
|
|
3611
3420
|
});
|
|
3612
3421
|
|
|
@@ -3669,9 +3478,7 @@ function WysiwygLinterBadWords(words) {
|
|
|
3669
3478
|
if (!node.isText) {
|
|
3670
3479
|
return;
|
|
3671
3480
|
}
|
|
3672
|
-
|
|
3673
3481
|
const matches = regex.exec(node.text);
|
|
3674
|
-
|
|
3675
3482
|
if (matches) {
|
|
3676
3483
|
const fixValue = matches[0] + '!!!!!';
|
|
3677
3484
|
this.record({
|
|
@@ -3695,7 +3502,6 @@ function WysiwygLinterBadWords(words) {
|
|
|
3695
3502
|
});
|
|
3696
3503
|
return this;
|
|
3697
3504
|
}
|
|
3698
|
-
|
|
3699
3505
|
};
|
|
3700
3506
|
}
|
|
3701
3507
|
|
|
@@ -3983,13 +3789,11 @@ function createWysiwygColorTool(opts) {
|
|
|
3983
3789
|
color
|
|
3984
3790
|
} = item;
|
|
3985
3791
|
let command = ctx.editor.chain().focus();
|
|
3986
|
-
|
|
3987
3792
|
if (color) {
|
|
3988
3793
|
command = command.setColor(color);
|
|
3989
3794
|
} else {
|
|
3990
3795
|
command = command.unsetColor();
|
|
3991
3796
|
}
|
|
3992
|
-
|
|
3993
3797
|
command.run();
|
|
3994
3798
|
stack.close();
|
|
3995
3799
|
}
|
|
@@ -4008,7 +3812,6 @@ function createWysiwygColorTool(opts) {
|
|
|
4008
3812
|
};
|
|
4009
3813
|
return tool;
|
|
4010
3814
|
};
|
|
4011
|
-
|
|
4012
3815
|
return WysiwygColorTool;
|
|
4013
3816
|
}
|
|
4014
3817
|
|
|
@@ -4019,17 +3822,18 @@ const {
|
|
|
4019
3822
|
nodeType: VUI_FORM_SYMBOL
|
|
4020
3823
|
});
|
|
4021
3824
|
function createVFormProps() {
|
|
4022
|
-
return {
|
|
3825
|
+
return {
|
|
3826
|
+
...props,
|
|
4023
3827
|
...createControlProps(),
|
|
4024
|
-
...defineSlotsProps()
|
|
4025
|
-
|
|
3828
|
+
...defineSlotsProps()
|
|
3829
|
+
// disableAutoScroll: Boolean,
|
|
4026
3830
|
};
|
|
4027
3831
|
}
|
|
4028
|
-
|
|
3832
|
+
|
|
3833
|
+
const VForm = /* @__PURE__ */ defineComponent({
|
|
4029
3834
|
name: 'VForm',
|
|
4030
3835
|
props: createVFormProps(),
|
|
4031
3836
|
emits,
|
|
4032
|
-
|
|
4033
3837
|
setup(props, ctx) {
|
|
4034
3838
|
const vui = useVui();
|
|
4035
3839
|
const nodeControl = useForm(props, ctx, {
|
|
@@ -4052,11 +3856,11 @@ const VForm = defineComponent({
|
|
|
4052
3856
|
}];
|
|
4053
3857
|
});
|
|
4054
3858
|
useControl(props);
|
|
4055
|
-
return {
|
|
3859
|
+
return {
|
|
3860
|
+
...nodeControl.expose(),
|
|
4056
3861
|
classes
|
|
4057
3862
|
};
|
|
4058
3863
|
},
|
|
4059
|
-
|
|
4060
3864
|
render() {
|
|
4061
3865
|
const {
|
|
4062
3866
|
form
|
|
@@ -4069,14 +3873,12 @@ const VForm = defineComponent({
|
|
|
4069
3873
|
"onSubmit": form.handleSubmit
|
|
4070
3874
|
}, [renderSlotOrEmpty(this.$slots, 'default', form)]);
|
|
4071
3875
|
}
|
|
4072
|
-
|
|
4073
3876
|
});
|
|
4074
3877
|
|
|
4075
3878
|
function _isSlot$6(s) {
|
|
4076
3879
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
4077
3880
|
}
|
|
4078
|
-
|
|
4079
|
-
const VTab = defineComponent({
|
|
3881
|
+
const VTab = /* @__PURE__ */ defineComponent({
|
|
4080
3882
|
name: 'VTab',
|
|
4081
3883
|
props: {
|
|
4082
3884
|
value: {
|
|
@@ -4090,7 +3892,6 @@ const VTab = defineComponent({
|
|
|
4090
3892
|
emits: {
|
|
4091
3893
|
click: ev => true
|
|
4092
3894
|
},
|
|
4093
|
-
|
|
4094
3895
|
setup(props, ctx) {
|
|
4095
3896
|
const classesRef = computed(() => ({
|
|
4096
3897
|
'v-tab--active': props.active
|
|
@@ -4108,13 +3909,11 @@ const VTab = defineComponent({
|
|
|
4108
3909
|
active
|
|
4109
3910
|
} = props;
|
|
4110
3911
|
const classes = ['v-tab', classesRef.value];
|
|
4111
|
-
|
|
4112
3912
|
const children = createVNode("span", {
|
|
4113
3913
|
"class": "v-tab__content"
|
|
4114
3914
|
}, [icon && resolveRawIconProp(active, icon, {
|
|
4115
3915
|
class: 'v-tab__icon'
|
|
4116
3916
|
}), renderSlotOrEmpty$1(ctx.slots)]);
|
|
4117
|
-
|
|
4118
3917
|
if (to) {
|
|
4119
3918
|
const replace = typeof to === 'string' ? undefined : to.replace;
|
|
4120
3919
|
return createVNode(RouterLink, {
|
|
@@ -4136,23 +3935,21 @@ const VTab = defineComponent({
|
|
|
4136
3935
|
}
|
|
4137
3936
|
};
|
|
4138
3937
|
}
|
|
4139
|
-
|
|
4140
3938
|
});
|
|
4141
3939
|
|
|
4142
3940
|
function _isSlot$5(s) {
|
|
4143
3941
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
4144
3942
|
}
|
|
4145
|
-
|
|
4146
|
-
const VTabs = defineComponent({
|
|
3943
|
+
const VTabs = /* @__PURE__ */ defineComponent({
|
|
4147
3944
|
name: 'VTabs',
|
|
4148
3945
|
props: {
|
|
4149
3946
|
modelValue: String,
|
|
4150
3947
|
items: {
|
|
4151
3948
|
type: Array,
|
|
4152
|
-
required: true
|
|
3949
|
+
required: true
|
|
3950
|
+
// validator: (value: VTabsItem[]) => {
|
|
4153
3951
|
// return Array.isArray(value) && value.length > 0;
|
|
4154
3952
|
// },
|
|
4155
|
-
|
|
4156
3953
|
},
|
|
4157
3954
|
|
|
4158
3955
|
/**
|
|
@@ -4162,12 +3959,10 @@ const VTabs = defineComponent({
|
|
|
4162
3959
|
type: Number,
|
|
4163
3960
|
default: 20
|
|
4164
3961
|
},
|
|
4165
|
-
|
|
4166
3962
|
/**
|
|
4167
3963
|
* ルーター同期する場合設定する
|
|
4168
3964
|
*/
|
|
4169
3965
|
router: Function,
|
|
4170
|
-
|
|
4171
3966
|
/**
|
|
4172
3967
|
* ルーティング連携を行う際に、クエリベースのURLマッチングを行う
|
|
4173
3968
|
* タブのURLが /page1?tab=xxx のようになる時に設定する
|
|
@@ -4181,7 +3976,6 @@ const VTabs = defineComponent({
|
|
|
4181
3976
|
'update:modelValue': newValue => true,
|
|
4182
3977
|
change: newValue => true
|
|
4183
3978
|
},
|
|
4184
|
-
|
|
4185
3979
|
setup(props, ctx) {
|
|
4186
3980
|
const vui = useVui();
|
|
4187
3981
|
const internalValueRef = ref(null);
|
|
@@ -4214,7 +4008,6 @@ const VTabs = defineComponent({
|
|
|
4214
4008
|
} = item;
|
|
4215
4009
|
const active = current === value;
|
|
4216
4010
|
let location;
|
|
4217
|
-
|
|
4218
4011
|
if (router) {
|
|
4219
4012
|
const to = router(value);
|
|
4220
4013
|
const route = vui.router.resolve(to);
|
|
@@ -4223,31 +4016,26 @@ const VTabs = defineComponent({
|
|
|
4223
4016
|
route
|
|
4224
4017
|
};
|
|
4225
4018
|
}
|
|
4226
|
-
|
|
4227
|
-
|
|
4019
|
+
return {
|
|
4020
|
+
...item,
|
|
4228
4021
|
active,
|
|
4229
4022
|
location
|
|
4230
4023
|
};
|
|
4231
4024
|
});
|
|
4232
4025
|
});
|
|
4233
|
-
|
|
4234
4026
|
const setTabRef = ref => {
|
|
4235
4027
|
tabRefs.value.push(ref);
|
|
4236
|
-
};
|
|
4237
|
-
|
|
4238
|
-
|
|
4028
|
+
};
|
|
4029
|
+
// const isMountedRef = ref(false);
|
|
4239
4030
|
function setupInternalValue(routable) {
|
|
4240
4031
|
let value = props.modelValue;
|
|
4241
|
-
|
|
4242
4032
|
if (value == null || value === '') {
|
|
4243
4033
|
const firstItem = props.items[0];
|
|
4244
4034
|
if (!firstItem) return;
|
|
4245
4035
|
value = firstItem.value;
|
|
4246
4036
|
}
|
|
4247
|
-
|
|
4248
4037
|
if (internalValueRef.value !== value) {
|
|
4249
4038
|
internalValueRef.value = value;
|
|
4250
|
-
|
|
4251
4039
|
if (routable) {
|
|
4252
4040
|
const {
|
|
4253
4041
|
router
|
|
@@ -4271,48 +4059,37 @@ const VTabs = defineComponent({
|
|
|
4271
4059
|
}
|
|
4272
4060
|
}
|
|
4273
4061
|
}
|
|
4274
|
-
|
|
4275
4062
|
async function to(value) {
|
|
4276
4063
|
const {
|
|
4277
4064
|
value: currentValue
|
|
4278
4065
|
} = currentRef;
|
|
4279
|
-
|
|
4280
4066
|
if (currentValue === value) {
|
|
4281
4067
|
return;
|
|
4282
4068
|
}
|
|
4283
|
-
|
|
4284
4069
|
const {
|
|
4285
4070
|
onBeforeChange
|
|
4286
4071
|
} = props;
|
|
4287
|
-
|
|
4288
4072
|
if (onBeforeChange) {
|
|
4289
4073
|
let result = onBeforeChange(value, currentRef.value);
|
|
4290
|
-
|
|
4291
4074
|
if (isPromise(result)) {
|
|
4292
4075
|
result = await result;
|
|
4293
4076
|
}
|
|
4294
|
-
|
|
4295
4077
|
console.log(result);
|
|
4296
|
-
|
|
4297
4078
|
if (result === false) {
|
|
4298
4079
|
return;
|
|
4299
4080
|
}
|
|
4300
4081
|
}
|
|
4301
|
-
|
|
4302
4082
|
currentRef.value = value;
|
|
4303
4083
|
}
|
|
4304
|
-
|
|
4305
4084
|
function cancelScroll() {
|
|
4306
4085
|
if (scrollResult) {
|
|
4307
4086
|
scrollResult.cancel();
|
|
4308
4087
|
scrollResult = undefined;
|
|
4309
4088
|
}
|
|
4310
4089
|
}
|
|
4311
|
-
|
|
4312
4090
|
const findTab = tab => {
|
|
4313
4091
|
return tabRefs.value.find(t => t.value === tab);
|
|
4314
4092
|
};
|
|
4315
|
-
|
|
4316
4093
|
function scrollToTab(tabValue) {
|
|
4317
4094
|
const tab = findTab(tabValue);
|
|
4318
4095
|
if (!tab) return;
|
|
@@ -4339,15 +4116,12 @@ const VTabs = defineComponent({
|
|
|
4339
4116
|
if (hiddenLeft > 0) hiddenLeft += autoScrollOffset;
|
|
4340
4117
|
if (hiddenRight > 0) hiddenRight += autoScrollOffset;
|
|
4341
4118
|
let scrollAmmount = 0;
|
|
4342
|
-
|
|
4343
4119
|
if (hiddenRight > 0) {
|
|
4344
4120
|
scrollAmmount = hiddenRight;
|
|
4345
4121
|
}
|
|
4346
|
-
|
|
4347
4122
|
if (hiddenLeft > 0) {
|
|
4348
4123
|
scrollAmmount = -hiddenLeft;
|
|
4349
4124
|
}
|
|
4350
|
-
|
|
4351
4125
|
if (Math.abs(scrollAmmount) > 0) {
|
|
4352
4126
|
cancelScroll();
|
|
4353
4127
|
scrollResult = scroller.scroller.by(scrollAmmount, 0, {
|
|
@@ -4355,7 +4129,6 @@ const VTabs = defineComponent({
|
|
|
4355
4129
|
});
|
|
4356
4130
|
}
|
|
4357
4131
|
}
|
|
4358
|
-
|
|
4359
4132
|
watch(() => props.modelValue, () => setupInternalValue(true));
|
|
4360
4133
|
watch(() => props.items, () => setupInternalValue(), {
|
|
4361
4134
|
deep: true
|
|
@@ -4371,7 +4144,6 @@ const VTabs = defineComponent({
|
|
|
4371
4144
|
}) => {
|
|
4372
4145
|
return location && location.route.fullPath === path;
|
|
4373
4146
|
});
|
|
4374
|
-
|
|
4375
4147
|
if (hit) {
|
|
4376
4148
|
currentRef.value = hit.value;
|
|
4377
4149
|
}
|
|
@@ -4401,15 +4173,12 @@ const VTabs = defineComponent({
|
|
|
4401
4173
|
if (!label) {
|
|
4402
4174
|
label = itemSlot;
|
|
4403
4175
|
}
|
|
4404
|
-
|
|
4405
4176
|
const children = typeof label === 'function' ? label({
|
|
4406
4177
|
value,
|
|
4407
4178
|
active,
|
|
4408
4179
|
vui
|
|
4409
4180
|
}) : label;
|
|
4410
|
-
|
|
4411
4181
|
const _to = location && location.to || undefined;
|
|
4412
|
-
|
|
4413
4182
|
return createVNode(VTab, {
|
|
4414
4183
|
"value": value,
|
|
4415
4184
|
"to": _to,
|
|
@@ -4440,22 +4209,20 @@ const VTabs = defineComponent({
|
|
|
4440
4209
|
})]);
|
|
4441
4210
|
};
|
|
4442
4211
|
}
|
|
4443
|
-
|
|
4444
4212
|
});
|
|
4445
4213
|
|
|
4446
4214
|
function _isSlot$4(s) {
|
|
4447
4215
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
4448
4216
|
}
|
|
4449
|
-
|
|
4450
|
-
const VBreadcrumbs = defineComponent({
|
|
4217
|
+
const VBreadcrumbs = /* @__PURE__ */ defineComponent({
|
|
4451
4218
|
name: 'VBreadcrumbs',
|
|
4452
4219
|
props: {
|
|
4453
4220
|
items: {
|
|
4454
4221
|
type: Array,
|
|
4455
4222
|
default: () => []
|
|
4456
4223
|
},
|
|
4457
|
-
divider: [String, Function]
|
|
4458
|
-
|
|
4224
|
+
divider: [String, Function]
|
|
4225
|
+
// ...defineSlotsProps<{}>(),
|
|
4459
4226
|
},
|
|
4460
4227
|
|
|
4461
4228
|
setup(props, ctx) {
|
|
@@ -4474,31 +4241,28 @@ const VBreadcrumbs = defineComponent({
|
|
|
4474
4241
|
const {
|
|
4475
4242
|
disabled = vui.location.match(to) || !vui.location.isAvailable(to)
|
|
4476
4243
|
} = item;
|
|
4477
|
-
return {
|
|
4244
|
+
return {
|
|
4245
|
+
...item,
|
|
4478
4246
|
disabled,
|
|
4479
4247
|
text: typeof text === 'function' ? text(vui) : text
|
|
4480
4248
|
};
|
|
4481
4249
|
});
|
|
4482
4250
|
});
|
|
4483
4251
|
const lengthRef = computed(() => computedItemsRef.value.length);
|
|
4484
|
-
|
|
4485
4252
|
const defaultDividerSlot = () => {
|
|
4486
4253
|
return [createVNode("i", {
|
|
4487
4254
|
"class": "v-breadcrumbs__divider__icon"
|
|
4488
4255
|
}, null)];
|
|
4489
4256
|
};
|
|
4490
|
-
|
|
4491
4257
|
return () => {
|
|
4492
4258
|
if (lengthRef.value < 1) return;
|
|
4493
4259
|
let dividerSlot;
|
|
4494
4260
|
const propDivider = props.divider;
|
|
4495
|
-
|
|
4496
4261
|
if (propDivider) {
|
|
4497
4262
|
dividerSlot = typeof propDivider === 'function' ? propDivider : () => propDivider;
|
|
4498
4263
|
} else {
|
|
4499
4264
|
dividerSlot = defaultDividerSlot;
|
|
4500
4265
|
}
|
|
4501
|
-
|
|
4502
4266
|
const children = [];
|
|
4503
4267
|
computedItemsRef.value.forEach((item, index) => {
|
|
4504
4268
|
const {
|
|
@@ -4507,10 +4271,8 @@ const VBreadcrumbs = defineComponent({
|
|
|
4507
4271
|
disabled,
|
|
4508
4272
|
to
|
|
4509
4273
|
} = item;
|
|
4510
|
-
|
|
4511
4274
|
if (index > 0) {
|
|
4512
4275
|
const divider = dividerSlot(vui);
|
|
4513
|
-
|
|
4514
4276
|
if (divider) {
|
|
4515
4277
|
children.push(createVNode("li", {
|
|
4516
4278
|
"class": "v-breadcrumbs__divider",
|
|
@@ -4518,19 +4280,15 @@ const VBreadcrumbs = defineComponent({
|
|
|
4518
4280
|
}, [divider]));
|
|
4519
4281
|
}
|
|
4520
4282
|
}
|
|
4521
|
-
|
|
4522
4283
|
const myChildren = [];
|
|
4523
|
-
|
|
4524
4284
|
if (icon) {
|
|
4525
4285
|
const $icon = resolveRawIconProp(false, icon, {
|
|
4526
4286
|
class: 'v-breadcrumbs__icon'
|
|
4527
4287
|
});
|
|
4528
|
-
|
|
4529
4288
|
if ($icon) {
|
|
4530
4289
|
myChildren.push($icon);
|
|
4531
4290
|
}
|
|
4532
4291
|
}
|
|
4533
|
-
|
|
4534
4292
|
if (text) myChildren.push(text);
|
|
4535
4293
|
const itemChild = to ? createVNode(VLink, {
|
|
4536
4294
|
"class": "v-breadcrumbs__link",
|
|
@@ -4553,14 +4311,12 @@ const VBreadcrumbs = defineComponent({
|
|
|
4553
4311
|
}, [children])]);
|
|
4554
4312
|
};
|
|
4555
4313
|
}
|
|
4556
|
-
|
|
4557
4314
|
});
|
|
4558
4315
|
|
|
4559
4316
|
function _isSlot$3(s) {
|
|
4560
4317
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
4561
4318
|
}
|
|
4562
|
-
|
|
4563
|
-
const VContentSwitcher = defineComponent({
|
|
4319
|
+
const VContentSwitcher = /* @__PURE__ */ defineComponent({
|
|
4564
4320
|
name: 'VContentSwitcher',
|
|
4565
4321
|
props: {
|
|
4566
4322
|
modelValue: String,
|
|
@@ -4573,7 +4329,6 @@ const VContentSwitcher = defineComponent({
|
|
|
4573
4329
|
emits: {
|
|
4574
4330
|
'update:modelValue': modelValue => true
|
|
4575
4331
|
},
|
|
4576
|
-
|
|
4577
4332
|
setup(props, ctx) {
|
|
4578
4333
|
const internalValueRef = ref('');
|
|
4579
4334
|
const transitionRef = ref('');
|
|
@@ -4597,31 +4352,26 @@ const VContentSwitcher = defineComponent({
|
|
|
4597
4352
|
} = props;
|
|
4598
4353
|
if (settings === true) settings = {};
|
|
4599
4354
|
if (!settings) return;
|
|
4600
|
-
return {
|
|
4355
|
+
return {
|
|
4356
|
+
...settings
|
|
4601
4357
|
};
|
|
4602
4358
|
});
|
|
4603
|
-
|
|
4604
4359
|
function seeTop(options) {
|
|
4605
4360
|
const scoller = getDocumentScroller$1();
|
|
4606
4361
|
const {
|
|
4607
4362
|
value: anchor
|
|
4608
4363
|
} = anchorRef;
|
|
4609
|
-
|
|
4610
4364
|
if (anchor) {
|
|
4611
4365
|
scoller.toElement(anchor, options);
|
|
4612
4366
|
}
|
|
4613
4367
|
}
|
|
4614
|
-
|
|
4615
4368
|
function getEl() {
|
|
4616
4369
|
const el = elRef.value;
|
|
4617
|
-
|
|
4618
4370
|
if (!el) {
|
|
4619
4371
|
throw new Error('missing element');
|
|
4620
4372
|
}
|
|
4621
|
-
|
|
4622
4373
|
return el;
|
|
4623
4374
|
}
|
|
4624
|
-
|
|
4625
4375
|
watch(() => props.modelValue, (value, beforeValue) => {
|
|
4626
4376
|
if (value == null) return;
|
|
4627
4377
|
internalValueRef.value = value;
|
|
@@ -4630,19 +4380,16 @@ const VContentSwitcher = defineComponent({
|
|
|
4630
4380
|
const index = order.indexOf(value);
|
|
4631
4381
|
const beforeIndex = order.indexOf(beforeValue);
|
|
4632
4382
|
let transition = 'fade';
|
|
4633
|
-
|
|
4634
4383
|
if (index !== -1 && beforeIndex !== -1) {
|
|
4635
4384
|
if (index > beforeIndex) transition = 'v-content-switcher-next';
|
|
4636
4385
|
if (index < beforeIndex) transition = 'v-content-switcher-prev';
|
|
4637
4386
|
}
|
|
4638
|
-
|
|
4639
4387
|
transitionRef.value = transition;
|
|
4640
4388
|
}, {
|
|
4641
4389
|
immediate: true
|
|
4642
4390
|
});
|
|
4643
4391
|
watch(currentRef, () => {
|
|
4644
4392
|
const autotopSettings = autotopSettingsRef.value;
|
|
4645
|
-
|
|
4646
4393
|
if (autotopSettings && props.modelValue != null) {
|
|
4647
4394
|
seeTop(autotopSettings);
|
|
4648
4395
|
}
|
|
@@ -4651,14 +4398,12 @@ const VContentSwitcher = defineComponent({
|
|
|
4651
4398
|
const current = currentRef.value;
|
|
4652
4399
|
const children = renderSlotOrEmpty$1(ctx.slots) || [];
|
|
4653
4400
|
const currentSlot = ctx.slots[current];
|
|
4654
|
-
|
|
4655
4401
|
if (currentSlot) {
|
|
4656
4402
|
children.push(createVNode("div", {
|
|
4657
4403
|
"class": "v-content-switcher__content",
|
|
4658
4404
|
"key": current
|
|
4659
4405
|
}, [currentSlot(this)]));
|
|
4660
4406
|
}
|
|
4661
|
-
|
|
4662
4407
|
return createVNode("div", {
|
|
4663
4408
|
"class": "v-content-switcher",
|
|
4664
4409
|
"ref": elRef
|
|
@@ -4687,7 +4432,6 @@ const VContentSwitcher = defineComponent({
|
|
|
4687
4432
|
})]);
|
|
4688
4433
|
};
|
|
4689
4434
|
}
|
|
4690
|
-
|
|
4691
4435
|
});
|
|
4692
4436
|
|
|
4693
4437
|
const DATA_TABLE_DEFAULTS = {
|
|
@@ -4706,13 +4450,12 @@ const DATA_TABLE_DEFAULTS = {
|
|
|
4706
4450
|
};
|
|
4707
4451
|
function configureDataTableDefaults(defaults) {
|
|
4708
4452
|
Object.assign(DATA_TABLE_DEFAULTS, defaults);
|
|
4709
|
-
|
|
4710
4453
|
if (!defaults.defaultOrder && defaults.ascQueryValue) {
|
|
4711
4454
|
DATA_TABLE_DEFAULTS.defaultOrder = defaults.ascQueryValue;
|
|
4712
4455
|
}
|
|
4713
4456
|
}
|
|
4714
4457
|
const SELECTABLE_HEADER_SYMBOL = '__selectable_header__';
|
|
4715
|
-
const VDataTable = defineComponent({
|
|
4458
|
+
const VDataTable = /* @__PURE__ */ defineComponent({
|
|
4716
4459
|
name: 'VDataTable',
|
|
4717
4460
|
props: {
|
|
4718
4461
|
/** 選択中のkeyの配列 */
|
|
@@ -4724,7 +4467,6 @@ const VDataTable = defineComponent({
|
|
|
4724
4467
|
type: String,
|
|
4725
4468
|
default: () => DATA_TABLE_DEFAULTS.itemKey
|
|
4726
4469
|
},
|
|
4727
|
-
|
|
4728
4470
|
/**
|
|
4729
4471
|
* ページネーションクエリ名
|
|
4730
4472
|
*/
|
|
@@ -4732,7 +4474,6 @@ const VDataTable = defineComponent({
|
|
|
4732
4474
|
type: String,
|
|
4733
4475
|
default: () => DATA_TABLE_DEFAULTS.pageQuery
|
|
4734
4476
|
},
|
|
4735
|
-
|
|
4736
4477
|
/**
|
|
4737
4478
|
* ソートクエリ名
|
|
4738
4479
|
*/
|
|
@@ -4740,7 +4481,6 @@ const VDataTable = defineComponent({
|
|
|
4740
4481
|
type: String,
|
|
4741
4482
|
default: () => DATA_TABLE_DEFAULTS.sortQuery
|
|
4742
4483
|
},
|
|
4743
|
-
|
|
4744
4484
|
/**
|
|
4745
4485
|
* 表示順クエリ名
|
|
4746
4486
|
*/
|
|
@@ -4748,7 +4488,6 @@ const VDataTable = defineComponent({
|
|
|
4748
4488
|
type: String,
|
|
4749
4489
|
default: () => DATA_TABLE_DEFAULTS.orderQuery
|
|
4750
4490
|
},
|
|
4751
|
-
|
|
4752
4491
|
/**
|
|
4753
4492
|
* 検索クエリ名
|
|
4754
4493
|
*/
|
|
@@ -4756,7 +4495,6 @@ const VDataTable = defineComponent({
|
|
|
4756
4495
|
type: [String, Array],
|
|
4757
4496
|
default: () => DATA_TABLE_DEFAULTS.searchQuery
|
|
4758
4497
|
},
|
|
4759
|
-
|
|
4760
4498
|
/**
|
|
4761
4499
|
* リミット件数クエリ名
|
|
4762
4500
|
*/
|
|
@@ -4811,7 +4549,6 @@ const VDataTable = defineComponent({
|
|
|
4811
4549
|
emits: {
|
|
4812
4550
|
input: selecteds => true
|
|
4813
4551
|
},
|
|
4814
|
-
|
|
4815
4552
|
setup(props, ctx) {
|
|
4816
4553
|
const vui = useVui();
|
|
4817
4554
|
const bootedRef = ref(false);
|
|
@@ -4825,13 +4562,11 @@ const VDataTable = defineComponent({
|
|
|
4825
4562
|
selectable
|
|
4826
4563
|
} = props;
|
|
4827
4564
|
const ret = [];
|
|
4828
|
-
|
|
4829
4565
|
if (selectable) {
|
|
4830
4566
|
ret.push({
|
|
4831
4567
|
key: SELECTABLE_HEADER_SYMBOL
|
|
4832
4568
|
});
|
|
4833
4569
|
}
|
|
4834
|
-
|
|
4835
4570
|
ret.push(...headers.filter(h => !h.hidden));
|
|
4836
4571
|
return ret;
|
|
4837
4572
|
});
|
|
@@ -4839,34 +4574,27 @@ const VDataTable = defineComponent({
|
|
|
4839
4574
|
let {
|
|
4840
4575
|
searchQuery
|
|
4841
4576
|
} = props;
|
|
4842
|
-
|
|
4843
4577
|
if (!searchQuery) {
|
|
4844
4578
|
return [];
|
|
4845
4579
|
}
|
|
4846
|
-
|
|
4847
4580
|
if (!Array.isArray(searchQuery)) {
|
|
4848
4581
|
searchQuery = [searchQuery];
|
|
4849
4582
|
}
|
|
4850
|
-
|
|
4851
4583
|
const values = [];
|
|
4852
4584
|
searchQuery.forEach(query => {
|
|
4853
4585
|
const value = vui.location.getQuery(query);
|
|
4854
|
-
|
|
4855
4586
|
if (value == null || value === '') {
|
|
4856
4587
|
return;
|
|
4857
4588
|
}
|
|
4858
|
-
|
|
4859
4589
|
if (typeof value === 'object' && !Object.keys(value).length) {
|
|
4860
4590
|
return;
|
|
4861
4591
|
}
|
|
4862
|
-
|
|
4863
4592
|
values.push(value);
|
|
4864
4593
|
});
|
|
4865
4594
|
return values;
|
|
4866
4595
|
});
|
|
4867
4596
|
const emptyMessage = computed(() => {
|
|
4868
4597
|
let message;
|
|
4869
|
-
|
|
4870
4598
|
if (searchQueryValues.value.length) {
|
|
4871
4599
|
message = props.noResultsMessage || vui.setting('noResultsMessage') || 'No search results found.'; // 検索結果が見つかりませんでした。
|
|
4872
4600
|
} else {
|
|
@@ -4886,13 +4614,10 @@ const VDataTable = defineComponent({
|
|
|
4886
4614
|
maxHeight
|
|
4887
4615
|
} = props;
|
|
4888
4616
|
const footerHeight = footerHeightRef.value;
|
|
4889
|
-
|
|
4890
4617
|
const _maxHeight = maxHeight || (fixedHeader ? '100%' : maxHeight);
|
|
4891
|
-
|
|
4892
4618
|
if (!_maxHeight) {
|
|
4893
4619
|
return;
|
|
4894
4620
|
}
|
|
4895
|
-
|
|
4896
4621
|
return {
|
|
4897
4622
|
maxHeight: layout.calicurateViewHeight(_maxHeight, -footerHeight - 100, 200)
|
|
4898
4623
|
};
|
|
@@ -4907,35 +4632,29 @@ const VDataTable = defineComponent({
|
|
|
4907
4632
|
get: () => {
|
|
4908
4633
|
return vui.location.getQuery(props.sortQuery);
|
|
4909
4634
|
},
|
|
4910
|
-
|
|
4911
4635
|
set(value) {
|
|
4912
4636
|
vui.location.pushQuery({
|
|
4913
4637
|
[props.sortQuery]: value || null,
|
|
4914
4638
|
[props.pageQuery]: 1
|
|
4915
4639
|
});
|
|
4916
4640
|
}
|
|
4917
|
-
|
|
4918
4641
|
});
|
|
4919
4642
|
const ordersRef = computed(() => [props.ascQueryValue, props.descQueryValue]);
|
|
4920
4643
|
const usePaigingRef = computed(() => props.limits.length > 0);
|
|
4921
4644
|
const orderByRef = computed({
|
|
4922
4645
|
get: () => {
|
|
4923
4646
|
const value = vui.location.getQuery(props.orderQuery);
|
|
4924
|
-
|
|
4925
4647
|
if (typeof value !== 'string' || !ordersRef.value.includes(value)) {
|
|
4926
4648
|
return;
|
|
4927
4649
|
}
|
|
4928
|
-
|
|
4929
4650
|
return value;
|
|
4930
4651
|
},
|
|
4931
|
-
|
|
4932
4652
|
set(value) {
|
|
4933
4653
|
vui.location.pushQuery({
|
|
4934
4654
|
[props.orderQuery]: value || null,
|
|
4935
4655
|
[props.pageQuery]: 1
|
|
4936
4656
|
});
|
|
4937
4657
|
}
|
|
4938
|
-
|
|
4939
4658
|
});
|
|
4940
4659
|
const offsetRef = computed(() => (pageRef.value - 1) * limitRef.value);
|
|
4941
4660
|
const limitRef = computed({
|
|
@@ -4957,14 +4676,12 @@ const VDataTable = defineComponent({
|
|
|
4957
4676
|
return Math.ceil(total / _limit);
|
|
4958
4677
|
});
|
|
4959
4678
|
const lengthRef = computed(() => props.items.length);
|
|
4960
|
-
const isASCRef = computed(() => orderByRef.value === props.ascQueryValue);
|
|
4961
|
-
|
|
4679
|
+
const isASCRef = computed(() => orderByRef.value === props.ascQueryValue);
|
|
4680
|
+
// const isDESCRef = computed(() => orderByRef.value === props.descQueryValue);
|
|
4962
4681
|
const sortIconRef = computed(() => {
|
|
4963
4682
|
let icon = vui.icon('sort');
|
|
4964
|
-
|
|
4965
4683
|
if (typeof icon === 'string') {
|
|
4966
4684
|
const name = icon;
|
|
4967
|
-
|
|
4968
4685
|
icon = gen => {
|
|
4969
4686
|
return gen({
|
|
4970
4687
|
name,
|
|
@@ -4972,7 +4689,6 @@ const VDataTable = defineComponent({
|
|
|
4972
4689
|
});
|
|
4973
4690
|
};
|
|
4974
4691
|
}
|
|
4975
|
-
|
|
4976
4692
|
return icon;
|
|
4977
4693
|
});
|
|
4978
4694
|
const isIndeterminateRef = computed(() => {
|
|
@@ -4982,7 +4698,6 @@ const VDataTable = defineComponent({
|
|
|
4982
4698
|
return length > 0 && length < sortedItemKeysRef.value.length;
|
|
4983
4699
|
});
|
|
4984
4700
|
const isAllSelectedRef = computed(() => internalValues.value.length === sortedItemKeysRef.value.length);
|
|
4985
|
-
|
|
4986
4701
|
function setSort(settings) {
|
|
4987
4702
|
const {
|
|
4988
4703
|
sort,
|
|
@@ -4990,32 +4705,27 @@ const VDataTable = defineComponent({
|
|
|
4990
4705
|
} = settings;
|
|
4991
4706
|
if ((sort === undefined || sortByRef.value === sort) && (order === undefined || orderByRef.value === order)) return;
|
|
4992
4707
|
const queries = {};
|
|
4993
|
-
|
|
4994
4708
|
if (sort) {
|
|
4995
4709
|
queries[props.sortQuery] = sort;
|
|
4996
4710
|
}
|
|
4997
|
-
|
|
4998
4711
|
if (order) {
|
|
4999
4712
|
queries[props.orderQuery] = order;
|
|
5000
4713
|
}
|
|
5001
|
-
|
|
5002
|
-
|
|
4714
|
+
vui.location.pushQuery({
|
|
4715
|
+
...queries,
|
|
5003
4716
|
...(usePaigingRef.value ? {
|
|
5004
4717
|
[props.pageQuery]: 1
|
|
5005
4718
|
} : undefined)
|
|
5006
4719
|
});
|
|
5007
4720
|
}
|
|
5008
|
-
|
|
5009
4721
|
function toggleOrderBy() {
|
|
5010
4722
|
return setSort({
|
|
5011
4723
|
order: orderByRef.value === props.ascQueryValue ? props.descQueryValue : props.ascQueryValue
|
|
5012
4724
|
});
|
|
5013
4725
|
}
|
|
5014
|
-
|
|
5015
4726
|
function isSelected(key) {
|
|
5016
4727
|
return internalValues.value.includes(key);
|
|
5017
4728
|
}
|
|
5018
|
-
|
|
5019
4729
|
function select(key) {
|
|
5020
4730
|
if (!internalValues.value.includes(key)) {
|
|
5021
4731
|
const values = internalValues.value.slice();
|
|
@@ -5032,7 +4742,6 @@ const VDataTable = defineComponent({
|
|
|
5032
4742
|
ctx.emit('input', values);
|
|
5033
4743
|
}
|
|
5034
4744
|
}
|
|
5035
|
-
|
|
5036
4745
|
function selectAll() {
|
|
5037
4746
|
if (!isAllSelectedRef.value) {
|
|
5038
4747
|
const values = sortedItemKeysRef.value.slice();
|
|
@@ -5040,7 +4749,6 @@ const VDataTable = defineComponent({
|
|
|
5040
4749
|
ctx.emit('input', values);
|
|
5041
4750
|
}
|
|
5042
4751
|
}
|
|
5043
|
-
|
|
5044
4752
|
function deselectAll() {
|
|
5045
4753
|
if (internalValues.value.length) {
|
|
5046
4754
|
const values = [];
|
|
@@ -5048,34 +4756,28 @@ const VDataTable = defineComponent({
|
|
|
5048
4756
|
ctx.emit('input', values);
|
|
5049
4757
|
}
|
|
5050
4758
|
}
|
|
5051
|
-
|
|
5052
4759
|
function deselect(key) {
|
|
5053
4760
|
const values = internalValues.value.slice();
|
|
5054
4761
|
const index = values.indexOf(key);
|
|
5055
|
-
|
|
5056
4762
|
if (index !== -1) {
|
|
5057
4763
|
values.splice(index, 1);
|
|
5058
4764
|
internalValues.value = values;
|
|
5059
4765
|
ctx.emit('input', values);
|
|
5060
4766
|
}
|
|
5061
4767
|
}
|
|
5062
|
-
|
|
5063
4768
|
function handleClickSortHeader(header, ev) {
|
|
5064
4769
|
const {
|
|
5065
4770
|
sortQuery
|
|
5066
4771
|
} = header;
|
|
5067
4772
|
if (!sortQuery) return;
|
|
5068
|
-
|
|
5069
4773
|
if (sortByRef.value === sortQuery) {
|
|
5070
4774
|
return toggleOrderBy();
|
|
5071
4775
|
}
|
|
5072
|
-
|
|
5073
4776
|
return setSort({
|
|
5074
4777
|
sort: sortQuery,
|
|
5075
4778
|
order: defaultOrderQueryRef.value
|
|
5076
4779
|
});
|
|
5077
4780
|
}
|
|
5078
|
-
|
|
5079
4781
|
function genPagination() {
|
|
5080
4782
|
return createVNode(VPagination, {
|
|
5081
4783
|
"class": "v-data-table__pagination",
|
|
@@ -5086,7 +4788,6 @@ const VDataTable = defineComponent({
|
|
|
5086
4788
|
"length": pageLengthRef.value
|
|
5087
4789
|
}, null);
|
|
5088
4790
|
}
|
|
5089
|
-
|
|
5090
4791
|
function genControls() {
|
|
5091
4792
|
const {
|
|
5092
4793
|
total
|
|
@@ -5120,7 +4821,6 @@ const VDataTable = defineComponent({
|
|
|
5120
4821
|
"class": "v-data-table__controls__pagination"
|
|
5121
4822
|
}, [genPagination()])]);
|
|
5122
4823
|
}
|
|
5123
|
-
|
|
5124
4824
|
function genTableHeader() {
|
|
5125
4825
|
const sortBy = sortByRef.value;
|
|
5126
4826
|
const isIndeterminate = isIndeterminateRef.value;
|
|
@@ -5128,8 +4828,8 @@ const VDataTable = defineComponent({
|
|
|
5128
4828
|
const {
|
|
5129
4829
|
defaultOrder,
|
|
5130
4830
|
ascQueryValue
|
|
5131
|
-
} = props;
|
|
5132
|
-
|
|
4831
|
+
} = props;
|
|
4832
|
+
// const usePaiging = usePaigingRef.value;
|
|
5133
4833
|
const children = headersRef.value.map(header => {
|
|
5134
4834
|
const {
|
|
5135
4835
|
label,
|
|
@@ -5138,17 +4838,13 @@ const VDataTable = defineComponent({
|
|
|
5138
4838
|
key
|
|
5139
4839
|
} = header;
|
|
5140
4840
|
const headerChildren = [];
|
|
5141
|
-
|
|
5142
4841
|
if (label != null && typeof label !== 'boolean') {
|
|
5143
4842
|
let _children = typeof label === 'function' ? label(vui) : label;
|
|
5144
|
-
|
|
5145
4843
|
if (_children && !Array.isArray(_children) && typeof _children === 'object') {
|
|
5146
4844
|
_children = JSON.stringify(_children);
|
|
5147
4845
|
}
|
|
5148
|
-
|
|
5149
4846
|
headerChildren.push(_children);
|
|
5150
4847
|
}
|
|
5151
|
-
|
|
5152
4848
|
if (key === SELECTABLE_HEADER_SYMBOL) {
|
|
5153
4849
|
headerChildren.push(createVNode(VCheckbox, {
|
|
5154
4850
|
"modelValue": isAllSelected,
|
|
@@ -5161,13 +4857,11 @@ const VDataTable = defineComponent({
|
|
|
5161
4857
|
}
|
|
5162
4858
|
}
|
|
5163
4859
|
}, null));
|
|
5164
|
-
}
|
|
4860
|
+
}
|
|
4861
|
+
// if (key === DELETOR_HEADER_SYMBOL) {
|
|
5165
4862
|
// headerChildren.push('削除');
|
|
5166
4863
|
// }
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
4864
|
const sortActive = sortBy === sortQuery;
|
|
5170
|
-
|
|
5171
4865
|
if (sortQuery) {
|
|
5172
4866
|
const isASC = sortActive ? isASCRef.value : defaultOrder === ascQueryValue;
|
|
5173
4867
|
headerChildren.unshift(createVNode(VIcon, {
|
|
@@ -5181,15 +4875,12 @@ const VDataTable = defineComponent({
|
|
|
5181
4875
|
}]
|
|
5182
4876
|
}));
|
|
5183
4877
|
}
|
|
5184
|
-
|
|
5185
4878
|
const classes = ['v-data-table__table__cell', {
|
|
5186
4879
|
'v-data-table__table__cell--active': sortActive
|
|
5187
4880
|
}];
|
|
5188
|
-
|
|
5189
4881
|
if (align) {
|
|
5190
4882
|
classes.push(`v-data-table__table__cell--${align}`);
|
|
5191
4883
|
}
|
|
5192
|
-
|
|
5193
4884
|
return createVNode("th", {
|
|
5194
4885
|
"class": classes,
|
|
5195
4886
|
"key": header.key,
|
|
@@ -5206,19 +4897,17 @@ const VDataTable = defineComponent({
|
|
|
5206
4897
|
"class": "v-data-table__table__header"
|
|
5207
4898
|
}, [createVNode("tr", null, [children])]);
|
|
5208
4899
|
}
|
|
5209
|
-
|
|
5210
4900
|
function toggleSelect(key) {
|
|
5211
4901
|
return isSelected(key) ? deselect(key) : select(key);
|
|
5212
4902
|
}
|
|
5213
|
-
|
|
5214
4903
|
function defaultItemSlot(payload) {
|
|
5215
4904
|
const {
|
|
5216
4905
|
key,
|
|
5217
4906
|
item,
|
|
5218
4907
|
selected
|
|
5219
4908
|
} = payload;
|
|
5220
|
-
const headers = headersRef.value;
|
|
5221
|
-
|
|
4909
|
+
const headers = headersRef.value;
|
|
4910
|
+
// const { $scopedSlots, $createElement, deletor } = this;
|
|
5222
4911
|
const children = headers.map(header => {
|
|
5223
4912
|
const {
|
|
5224
4913
|
cell,
|
|
@@ -5227,23 +4916,18 @@ const VDataTable = defineComponent({
|
|
|
5227
4916
|
} = header;
|
|
5228
4917
|
const cellSlot = cell || ctx.slots.cell;
|
|
5229
4918
|
let cellChildren;
|
|
5230
|
-
|
|
5231
4919
|
if (cellSlot) {
|
|
5232
4920
|
const cellPayload = {
|
|
5233
4921
|
vui,
|
|
5234
4922
|
item,
|
|
5235
4923
|
selected
|
|
5236
4924
|
};
|
|
5237
|
-
|
|
5238
4925
|
let _children = cellSlot(cellPayload);
|
|
5239
|
-
|
|
5240
4926
|
if (_children && !Array.isArray(_children) && typeof _children === 'object') {
|
|
5241
4927
|
_children = JSON.stringify(_children);
|
|
5242
4928
|
}
|
|
5243
|
-
|
|
5244
4929
|
cellChildren = _children;
|
|
5245
4930
|
}
|
|
5246
|
-
|
|
5247
4931
|
if (!cellChildren) {
|
|
5248
4932
|
switch (headerKey) {
|
|
5249
4933
|
case SELECTABLE_HEADER_SYMBOL:
|
|
@@ -5298,7 +4982,6 @@ const VDataTable = defineComponent({
|
|
|
5298
4982
|
"key": key
|
|
5299
4983
|
}, [children]);
|
|
5300
4984
|
}
|
|
5301
|
-
|
|
5302
4985
|
function genBody() {
|
|
5303
4986
|
const {
|
|
5304
4987
|
items,
|
|
@@ -5320,7 +5003,6 @@ const VDataTable = defineComponent({
|
|
|
5320
5003
|
"class": "v-data-table__table__body"
|
|
5321
5004
|
}, [children]);
|
|
5322
5005
|
}
|
|
5323
|
-
|
|
5324
5006
|
watch(() => props.modelValue, modelValue => {
|
|
5325
5007
|
internalValues.value = modelValue.slice();
|
|
5326
5008
|
});
|
|
@@ -5369,36 +5051,31 @@ const VDataTable = defineComponent({
|
|
|
5369
5051
|
})])]);
|
|
5370
5052
|
};
|
|
5371
5053
|
}
|
|
5372
|
-
|
|
5373
5054
|
});
|
|
5374
5055
|
|
|
5375
5056
|
function _isSlot$2(s) {
|
|
5376
5057
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
5377
5058
|
}
|
|
5378
|
-
|
|
5379
|
-
const VApp = defineComponent({
|
|
5059
|
+
const VApp = /* @__PURE__ */ defineComponent({
|
|
5380
5060
|
name: 'VApp',
|
|
5381
|
-
|
|
5382
5061
|
setup(props, ctx) {
|
|
5383
5062
|
useInjectTheme();
|
|
5384
5063
|
return () => {
|
|
5385
5064
|
let _slot;
|
|
5386
|
-
|
|
5387
5065
|
return createVNode(VStackRoot, null, _isSlot$2(_slot = renderSlotOrEmpty(ctx.slots, 'default')) ? _slot : {
|
|
5388
5066
|
default: () => [_slot]
|
|
5389
5067
|
});
|
|
5390
5068
|
};
|
|
5391
5069
|
}
|
|
5392
|
-
|
|
5393
5070
|
});
|
|
5394
5071
|
|
|
5395
|
-
const VToolbar = defineComponent({
|
|
5072
|
+
const VToolbar = /* @__PURE__ */ defineComponent({
|
|
5396
5073
|
name: 'VToolbar',
|
|
5397
|
-
props: {
|
|
5074
|
+
props: {
|
|
5075
|
+
...createElevationProps(),
|
|
5398
5076
|
...colorSchemeProps(),
|
|
5399
5077
|
dense: Boolean
|
|
5400
5078
|
},
|
|
5401
|
-
|
|
5402
5079
|
setup(props, ctx) {
|
|
5403
5080
|
const vui = useVui();
|
|
5404
5081
|
const elevation = useElevation(props, {
|
|
@@ -5421,24 +5098,20 @@ const VToolbar = defineComponent({
|
|
|
5421
5098
|
}, [renderSlotOrEmpty$1(ctx.slots, 'default')]);
|
|
5422
5099
|
};
|
|
5423
5100
|
}
|
|
5424
|
-
|
|
5425
5101
|
});
|
|
5426
5102
|
|
|
5427
5103
|
function _isSlot$1(s) {
|
|
5428
5104
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
5429
5105
|
}
|
|
5430
|
-
|
|
5431
|
-
const VToolbarMenu = defineComponent({
|
|
5106
|
+
const VToolbarMenu = /* @__PURE__ */ defineComponent({
|
|
5432
5107
|
name: 'VToolbarMenu',
|
|
5433
5108
|
inheritAttrs: false,
|
|
5434
5109
|
props: {},
|
|
5435
|
-
|
|
5436
5110
|
setup(props, ctx) {
|
|
5437
5111
|
const vui = useVui();
|
|
5438
5112
|
const plain = vui.setting('plainVariant');
|
|
5439
5113
|
return () => {
|
|
5440
5114
|
let _slot;
|
|
5441
|
-
|
|
5442
5115
|
const variant = props.variant || plain;
|
|
5443
5116
|
return createVNode(VButton, mergeProps(ctx.attrs, {
|
|
5444
5117
|
"variant": variant,
|
|
@@ -5448,10 +5121,9 @@ const VToolbarMenu = defineComponent({
|
|
|
5448
5121
|
});
|
|
5449
5122
|
};
|
|
5450
5123
|
}
|
|
5451
|
-
|
|
5452
5124
|
});
|
|
5453
5125
|
|
|
5454
|
-
const VToolbarEdge = defineComponent({
|
|
5126
|
+
const VToolbarEdge = /* @__PURE__ */ defineComponent({
|
|
5455
5127
|
name: 'VToolbarEdge',
|
|
5456
5128
|
props: {
|
|
5457
5129
|
edge: {
|
|
@@ -5459,7 +5131,6 @@ const VToolbarEdge = defineComponent({
|
|
|
5459
5131
|
required: true
|
|
5460
5132
|
}
|
|
5461
5133
|
},
|
|
5462
|
-
|
|
5463
5134
|
setup(props, ctx) {
|
|
5464
5135
|
const edge = computed(() => props.edge);
|
|
5465
5136
|
return () => {
|
|
@@ -5472,14 +5143,12 @@ const VToolbarEdge = defineComponent({
|
|
|
5472
5143
|
}, [children]);
|
|
5473
5144
|
};
|
|
5474
5145
|
}
|
|
5475
|
-
|
|
5476
5146
|
});
|
|
5477
5147
|
|
|
5478
5148
|
function _isSlot(s) {
|
|
5479
5149
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
5480
5150
|
}
|
|
5481
|
-
|
|
5482
|
-
const VToolbarTitle = defineComponent({
|
|
5151
|
+
const VToolbarTitle = /* @__PURE__ */ defineComponent({
|
|
5483
5152
|
name: 'VToolbarTitle',
|
|
5484
5153
|
props: {
|
|
5485
5154
|
tag: {
|
|
@@ -5487,13 +5156,10 @@ const VToolbarTitle = defineComponent({
|
|
|
5487
5156
|
default: 'span'
|
|
5488
5157
|
}
|
|
5489
5158
|
},
|
|
5490
|
-
|
|
5491
5159
|
setup(props, ctx) {
|
|
5492
5160
|
const _TagName = computed(() => props.tag);
|
|
5493
|
-
|
|
5494
5161
|
return () => {
|
|
5495
5162
|
let _slot;
|
|
5496
|
-
|
|
5497
5163
|
const TagName = _TagName.value;
|
|
5498
5164
|
return createVNode(TagName, {
|
|
5499
5165
|
"class": "v-toolbar-title"
|
|
@@ -5502,7 +5168,6 @@ const VToolbarTitle = defineComponent({
|
|
|
5502
5168
|
});
|
|
5503
5169
|
};
|
|
5504
5170
|
}
|
|
5505
|
-
|
|
5506
5171
|
});
|
|
5507
5172
|
|
|
5508
5173
|
const DEFAULT_AUTO_SCROLL_TO_ELEMENT_OFFSET_TOP = -20;
|
|
@@ -5511,8 +5176,8 @@ function mergeVuiServiceUISettings(base, overrides) {
|
|
|
5511
5176
|
if (!overrides) {
|
|
5512
5177
|
return base;
|
|
5513
5178
|
}
|
|
5514
|
-
|
|
5515
|
-
|
|
5179
|
+
const merged = {
|
|
5180
|
+
...base
|
|
5516
5181
|
};
|
|
5517
5182
|
Object.entries(overrides).forEach(([key, value]) => {
|
|
5518
5183
|
if (value) {
|
|
@@ -5525,8 +5190,8 @@ function mergeVuiServiceIconSettings(base, overrides) {
|
|
|
5525
5190
|
if (!overrides) {
|
|
5526
5191
|
return base;
|
|
5527
5192
|
}
|
|
5528
|
-
|
|
5529
|
-
|
|
5193
|
+
const merged = {
|
|
5194
|
+
...base
|
|
5530
5195
|
};
|
|
5531
5196
|
Object.entries(overrides).forEach(([key, value]) => {
|
|
5532
5197
|
if (value) {
|
|
@@ -5539,8 +5204,8 @@ function mergeVuiServiceOptions(base, overrides) {
|
|
|
5539
5204
|
if (!overrides) {
|
|
5540
5205
|
return base;
|
|
5541
5206
|
}
|
|
5542
|
-
|
|
5543
|
-
|
|
5207
|
+
const merged = {
|
|
5208
|
+
...base,
|
|
5544
5209
|
uiSettings: mergeVuiServiceUISettings(base.uiSettings, overrides.uiSettings),
|
|
5545
5210
|
icons: mergeVuiServiceIconSettings(base.icons, overrides.icons)
|
|
5546
5211
|
};
|
|
@@ -5556,7 +5221,6 @@ class VuiService {
|
|
|
5556
5221
|
get scroller() {
|
|
5557
5222
|
return getDocumentScroller$1();
|
|
5558
5223
|
}
|
|
5559
|
-
|
|
5560
5224
|
constructor(options, stackService) {
|
|
5561
5225
|
this.options = options;
|
|
5562
5226
|
this.configure();
|
|
@@ -5577,63 +5241,49 @@ class VuiService {
|
|
|
5577
5241
|
this.stack = stackService;
|
|
5578
5242
|
this.useLink = options.useLink || useLink;
|
|
5579
5243
|
}
|
|
5580
|
-
|
|
5581
5244
|
configure(options) {
|
|
5582
5245
|
options && Object.assign(this.options, options);
|
|
5583
5246
|
setDefaultRouterLink(this.getRouterLink());
|
|
5584
5247
|
}
|
|
5585
|
-
|
|
5586
5248
|
getRouterLink() {
|
|
5587
5249
|
return this.options.RouterLink || RouterLink;
|
|
5588
5250
|
}
|
|
5589
|
-
|
|
5590
5251
|
setting(key) {
|
|
5591
5252
|
return this.options.uiSettings[key];
|
|
5592
5253
|
}
|
|
5593
|
-
|
|
5594
5254
|
icon(iconType) {
|
|
5595
5255
|
return this.options.icons[iconType];
|
|
5596
5256
|
}
|
|
5597
|
-
|
|
5598
5257
|
getAutoScrollToElementOffsetTop() {
|
|
5599
5258
|
let {
|
|
5600
5259
|
autoScrollToElementOffsetTop
|
|
5601
5260
|
} = this;
|
|
5602
|
-
|
|
5603
5261
|
if (typeof autoScrollToElementOffsetTop === 'function') {
|
|
5604
5262
|
autoScrollToElementOffsetTop = autoScrollToElementOffsetTop();
|
|
5605
5263
|
}
|
|
5606
|
-
|
|
5607
5264
|
return autoScrollToElementOffsetTop || 0;
|
|
5608
5265
|
}
|
|
5609
|
-
|
|
5610
5266
|
getRequiredChip() {
|
|
5611
5267
|
const {
|
|
5612
5268
|
requiredChip
|
|
5613
5269
|
} = this;
|
|
5614
5270
|
return requiredChip && requiredChip();
|
|
5615
5271
|
}
|
|
5616
|
-
|
|
5617
5272
|
dialog(...args) {
|
|
5618
5273
|
return this.stack.dialog(...args);
|
|
5619
5274
|
}
|
|
5620
|
-
|
|
5621
5275
|
alert(...args) {
|
|
5622
5276
|
return this.stack.alert(...args);
|
|
5623
5277
|
}
|
|
5624
|
-
|
|
5625
5278
|
confirm(...args) {
|
|
5626
5279
|
return this.stack.confirm(...args);
|
|
5627
5280
|
}
|
|
5628
|
-
|
|
5629
5281
|
snackbar(...args) {
|
|
5630
5282
|
return this.stack.snackbar(...args);
|
|
5631
5283
|
}
|
|
5632
|
-
|
|
5633
5284
|
menu(...args) {
|
|
5634
5285
|
return this.stack.menu(...args);
|
|
5635
5286
|
}
|
|
5636
|
-
|
|
5637
5287
|
formPrompt(settings, slot) {
|
|
5638
5288
|
let form;
|
|
5639
5289
|
const options = {
|
|
@@ -5644,9 +5294,7 @@ class VuiService {
|
|
|
5644
5294
|
size,
|
|
5645
5295
|
state
|
|
5646
5296
|
} = options;
|
|
5647
|
-
|
|
5648
5297
|
const _state = reactive(state);
|
|
5649
|
-
|
|
5650
5298
|
options.actions = options.actions || [this.stack.action('cancel', undefined, {
|
|
5651
5299
|
size
|
|
5652
5300
|
}), this.stack.action('ok', undefined, {
|
|
@@ -5658,7 +5306,8 @@ class VuiService {
|
|
|
5658
5306
|
}
|
|
5659
5307
|
}
|
|
5660
5308
|
})];
|
|
5661
|
-
const resolved = resolveVStackDynamicInput({
|
|
5309
|
+
const resolved = resolveVStackDynamicInput({
|
|
5310
|
+
...options,
|
|
5662
5311
|
content: stack => {
|
|
5663
5312
|
return createVNode(VForm, {
|
|
5664
5313
|
"disableAutoScroll": true,
|
|
@@ -5682,15 +5331,16 @@ class VuiService {
|
|
|
5682
5331
|
});
|
|
5683
5332
|
return this.dialog(resolved);
|
|
5684
5333
|
}
|
|
5685
|
-
|
|
5686
5334
|
prompt(rawOptions = {}) {
|
|
5687
5335
|
const options = typeof rawOptions === 'string' ? {
|
|
5688
5336
|
input: {
|
|
5689
5337
|
label: rawOptions
|
|
5690
5338
|
}
|
|
5691
|
-
} : {
|
|
5339
|
+
} : {
|
|
5340
|
+
...rawOptions
|
|
5692
5341
|
};
|
|
5693
|
-
options.input = {
|
|
5342
|
+
options.input = {
|
|
5343
|
+
...options.input
|
|
5694
5344
|
};
|
|
5695
5345
|
options.dense = true;
|
|
5696
5346
|
const {
|
|
@@ -5713,19 +5363,17 @@ class VuiService {
|
|
|
5713
5363
|
return result ? result.input : result;
|
|
5714
5364
|
});
|
|
5715
5365
|
}
|
|
5716
|
-
|
|
5717
5366
|
}
|
|
5718
5367
|
|
|
5719
5368
|
function mergeVuiPluginOptions(base, override) {
|
|
5720
5369
|
if (!override) return base;
|
|
5721
5370
|
const merged = mergeVuiServiceOptions(base, override);
|
|
5722
|
-
|
|
5723
5371
|
if (override.stack) {
|
|
5724
|
-
merged.stack = {
|
|
5372
|
+
merged.stack = {
|
|
5373
|
+
...merged.stack,
|
|
5725
5374
|
...override.stack
|
|
5726
5375
|
};
|
|
5727
5376
|
}
|
|
5728
|
-
|
|
5729
5377
|
return merged;
|
|
5730
5378
|
}
|
|
5731
5379
|
class VuiPlugin {
|
|
@@ -5734,11 +5382,11 @@ class VuiPlugin {
|
|
|
5734
5382
|
colorScheme,
|
|
5735
5383
|
stack,
|
|
5736
5384
|
uiSettings
|
|
5737
|
-
} = opts;
|
|
5738
|
-
|
|
5385
|
+
} = opts;
|
|
5386
|
+
// ColorScheme
|
|
5739
5387
|
const vueColorSchemePlugin = new VueColorSchemePlugin(colorScheme);
|
|
5740
|
-
app.use(vueColorSchemePlugin);
|
|
5741
|
-
|
|
5388
|
+
app.use(vueColorSchemePlugin);
|
|
5389
|
+
// Stack
|
|
5742
5390
|
installVueStackPlugin(app, {
|
|
5743
5391
|
actions: {
|
|
5744
5392
|
ok: ({
|
|
@@ -5759,8 +5407,8 @@ class VuiPlugin {
|
|
|
5759
5407
|
...(stack ? stack.actions : {})
|
|
5760
5408
|
},
|
|
5761
5409
|
...stack
|
|
5762
|
-
});
|
|
5763
|
-
|
|
5410
|
+
});
|
|
5411
|
+
// Vui
|
|
5764
5412
|
const $vui = new VuiService(opts, app.config.globalProperties.$vstack);
|
|
5765
5413
|
app.provide(VuiInjectionKey, $vui);
|
|
5766
5414
|
app.config.globalProperties.$vui = $vui;
|
|
@@ -5768,7 +5416,6 @@ class VuiPlugin {
|
|
|
5768
5416
|
delete app.config.globalProperties.$vui;
|
|
5769
5417
|
});
|
|
5770
5418
|
}
|
|
5771
|
-
|
|
5772
5419
|
}
|
|
5773
5420
|
function installVuiPlugin(app, opts) {
|
|
5774
5421
|
return app.use(VuiPlugin, opts);
|