@fastkit/vui 0.8.17 → 0.9.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/LICENSE +21 -0
- package/README.md +4 -1
- package/dist/vui.cjs.js +73 -31
- package/dist/vui.cjs.prod.js +73 -31
- package/dist/vui.css +6 -0
- package/dist/vui.d.ts +83 -49
- package/dist/vui.min.css +1 -1
- package/dist/vui.min.css.map +1 -1
- package/dist/vui.mjs +74 -34
- package/package.json +20 -9
- package/src/components/VBreadcrumbs/VBreadcrumbs.tsx +1 -1
- package/src/components/VBusyImage/VBusyImage.tsx +3 -3
- package/src/components/VButton/VButton.scss +8 -0
- package/src/components/VButton/VButton.tsx +9 -0
- package/src/components/VDataTable/VDataTable.tsx +9 -5
- package/src/components/VListTile/VListTile.tsx +4 -2
- package/src/components/VNavigation/VNavigation.tsx +13 -4
- package/src/components/VNavigation/VNavigationItem.tsx +25 -7
- package/src/components/VSelect/VSelect.tsx +20 -9
- package/src/service.tsx +7 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021-present, Ayumu Fujii (dadajam4) and Fastkit contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
package/dist/vui.cjs.js
CHANGED
|
@@ -528,7 +528,7 @@ const VBusyImage = vue.defineComponent({
|
|
|
528
528
|
},
|
|
529
529
|
|
|
530
530
|
setup(props, ctx) {
|
|
531
|
-
const loadStateRef = vue.ref(props.cover &&
|
|
531
|
+
const loadStateRef = vue.ref(props.cover && isAvailableSrc(ctx.attrs.src) ? 'loading' : 'pending');
|
|
532
532
|
const attrsRef = vue.computed(() => splitAttrs(ctx.attrs));
|
|
533
533
|
const isPendingRef = vue.computed(() => loadStateRef.value === 'pending');
|
|
534
534
|
const isLoadingRef = vue.computed(() => loadStateRef.value === 'loading');
|
|
@@ -598,7 +598,7 @@ const VBusyImage = vue.defineComponent({
|
|
|
598
598
|
vue.watch(() => ctx.attrs.src, value => {
|
|
599
599
|
coverImageRef.value = undefined;
|
|
600
600
|
|
|
601
|
-
if (
|
|
601
|
+
if (isAvailableSrc(value)) {
|
|
602
602
|
loadStateRef.value = 'loading';
|
|
603
603
|
|
|
604
604
|
if (props.cover) {
|
|
@@ -690,7 +690,7 @@ function imageIsReady(image) {
|
|
|
690
690
|
return image.naturalWidth + image.naturalHeight > 0 ? 'load' : 'error';
|
|
691
691
|
}
|
|
692
692
|
|
|
693
|
-
function
|
|
693
|
+
function isAvailableSrc(src) {
|
|
694
694
|
return typeof src === 'string' && src !== '';
|
|
695
695
|
}
|
|
696
696
|
|
|
@@ -1143,6 +1143,8 @@ const VCardActions = vue.defineComponent({
|
|
|
1143
1143
|
|
|
1144
1144
|
});
|
|
1145
1145
|
|
|
1146
|
+
const BUTTON_ALIGNS = ['left', 'center', 'right'];
|
|
1147
|
+
|
|
1146
1148
|
function resolveRawVButtonIcon(raw, type = 'main') {
|
|
1147
1149
|
if (!raw) return;
|
|
1148
1150
|
return typeof raw === 'function' ? raw : () => vue.createVNode(VIcon, {
|
|
@@ -1159,6 +1161,10 @@ const vueButtonProps = vueUtils.createPropsOptions({ ...vueUtils.htmlAttributesP
|
|
|
1159
1161
|
icon: [String, Function],
|
|
1160
1162
|
startIcon: [String, Function],
|
|
1161
1163
|
endIcon: [String, Function],
|
|
1164
|
+
align: {
|
|
1165
|
+
type: String,
|
|
1166
|
+
default: 'center'
|
|
1167
|
+
},
|
|
1162
1168
|
...createControlProps()
|
|
1163
1169
|
});
|
|
1164
1170
|
const LOADING_SIZE_MAP = {
|
|
@@ -1206,7 +1212,7 @@ const VButton = vue.defineComponent({
|
|
|
1206
1212
|
return _spacer === true ? 'left' : _spacer;
|
|
1207
1213
|
});
|
|
1208
1214
|
const classes = vue.computed(() => [color.colorClasses.value, // navigationable.value.classes,
|
|
1209
|
-
spacer.value ? `v-button--spacer-${spacer.value}` : undefined, `v-button--${control.size.value}`, {
|
|
1215
|
+
spacer.value ? `v-button--spacer-${spacer.value}` : undefined, `v-button--${control.size.value}`, `v-button--align-${props.align}`, {
|
|
1210
1216
|
'v-button--loading': isLoading.value,
|
|
1211
1217
|
'v-button--icon': !!icon.value,
|
|
1212
1218
|
'v-button--rounded': props.rounded,
|
|
@@ -1617,6 +1623,7 @@ const VListTile = vue.defineComponent({
|
|
|
1617
1623
|
},
|
|
1618
1624
|
|
|
1619
1625
|
setup(props, ctx) {
|
|
1626
|
+
const vui = useVui();
|
|
1620
1627
|
const startIcon = vue.computed(() => {
|
|
1621
1628
|
let icon = resolveRawIconProp(false, props.startIcon);
|
|
1622
1629
|
|
|
@@ -1628,7 +1635,7 @@ const VListTile = vue.defineComponent({
|
|
|
1628
1635
|
});
|
|
1629
1636
|
const endIcon = vue.computed(() => resolveRawIconProp(false, props.endIcon));
|
|
1630
1637
|
const hasTo = vue.computed(() => !!ctx.attrs.to);
|
|
1631
|
-
const link =
|
|
1638
|
+
const link = vui.useLink({
|
|
1632
1639
|
to: ctx.attrs.to || ''
|
|
1633
1640
|
});
|
|
1634
1641
|
const isActive = vue.computed(() => {
|
|
@@ -1756,7 +1763,7 @@ function _isSlot$c(s) {
|
|
|
1756
1763
|
|
|
1757
1764
|
function createNavigationItemProps() {
|
|
1758
1765
|
return { ...createListTileProps(),
|
|
1759
|
-
match: String,
|
|
1766
|
+
match: [String, Array],
|
|
1760
1767
|
depth: {
|
|
1761
1768
|
type: Number,
|
|
1762
1769
|
default: 0
|
|
@@ -1795,6 +1802,12 @@ function renderNavigationItemInput(input, extraProps) {
|
|
|
1795
1802
|
default: () => [label]
|
|
1796
1803
|
});
|
|
1797
1804
|
}
|
|
1805
|
+
const TRIM_END_SLASH_RE = /\/$/;
|
|
1806
|
+
|
|
1807
|
+
function trimEndSlash(sorce) {
|
|
1808
|
+
return sorce ? sorce.replace(TRIM_END_SLASH_RE, '') : sorce;
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1798
1811
|
const VNavigationItem = vue.defineComponent({
|
|
1799
1812
|
name: 'VNavigationItem',
|
|
1800
1813
|
inheritAttrs: false,
|
|
@@ -1819,10 +1832,15 @@ const VNavigationItem = vue.defineComponent({
|
|
|
1819
1832
|
const {
|
|
1820
1833
|
to
|
|
1821
1834
|
} = ctx.attrs;
|
|
1822
|
-
|
|
1835
|
+
|
|
1836
|
+
if (match) {
|
|
1837
|
+
return (Array.isArray(match) ? match : [match]).map(trimEndSlash);
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1823
1840
|
if (!to) return;
|
|
1824
|
-
|
|
1825
|
-
return
|
|
1841
|
+
const toPath = typeof to === 'string' ? to : to.path;
|
|
1842
|
+
if (!toPath) return;
|
|
1843
|
+
return [trimEndSlash(toPath)];
|
|
1826
1844
|
});
|
|
1827
1845
|
const classes = vue.computed(() => [{
|
|
1828
1846
|
'v-navigation-item--opened': opened.value,
|
|
@@ -1838,16 +1856,25 @@ const VNavigationItem = vue.defineComponent({
|
|
|
1838
1856
|
const c = children.value;
|
|
1839
1857
|
const m = match.value;
|
|
1840
1858
|
|
|
1841
|
-
if (!c || !m) {
|
|
1859
|
+
if (!c || !m || !m.length) {
|
|
1842
1860
|
// matched.value = false;
|
|
1843
1861
|
return;
|
|
1844
1862
|
}
|
|
1845
1863
|
|
|
1846
|
-
|
|
1864
|
+
const trimedNewPath = trimEndSlash(newPath);
|
|
1865
|
+
|
|
1866
|
+
if (m.some(_ => trimedNewPath.match(_))) {
|
|
1847
1867
|
open(); // matched.value = true;
|
|
1848
1868
|
} else {
|
|
1849
1869
|
close(); // matched.value = false;
|
|
1850
|
-
}
|
|
1870
|
+
} // if (trimEndSlash(newPath).match(m)) {
|
|
1871
|
+
// open();
|
|
1872
|
+
// // matched.value = true;
|
|
1873
|
+
// } else {
|
|
1874
|
+
// close();
|
|
1875
|
+
// // matched.value = false;
|
|
1876
|
+
// }
|
|
1877
|
+
|
|
1851
1878
|
}, {
|
|
1852
1879
|
immediate: true
|
|
1853
1880
|
}); // const iconPayload = () => opened.value;
|
|
@@ -1966,9 +1993,8 @@ const VNavigationItem = vue.defineComponent({
|
|
|
1966
1993
|
|
|
1967
1994
|
});
|
|
1968
1995
|
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
props: {
|
|
1996
|
+
function createNavigationProps() {
|
|
1997
|
+
return vueUtils.createPropsOptions({
|
|
1972
1998
|
items: {
|
|
1973
1999
|
type: Array,
|
|
1974
2000
|
required: true
|
|
@@ -1979,7 +2005,11 @@ const VNavigation = vue.defineComponent({
|
|
|
1979
2005
|
default: true
|
|
1980
2006
|
},
|
|
1981
2007
|
caption: [String, Function]
|
|
1982
|
-
}
|
|
2008
|
+
});
|
|
2009
|
+
}
|
|
2010
|
+
const VNavigation = vue.defineComponent({
|
|
2011
|
+
name: 'VNavigation',
|
|
2012
|
+
props: createNavigationProps(),
|
|
1983
2013
|
|
|
1984
2014
|
setup(props, ctx) {
|
|
1985
2015
|
const items = vue.computed(() => props.items);
|
|
@@ -2483,9 +2513,9 @@ function _isSlot$8(s) {
|
|
|
2483
2513
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
2484
2514
|
}
|
|
2485
2515
|
|
|
2486
|
-
const ARROW_KEY_TYPES = vueKit.
|
|
2487
|
-
const CHOICE_KEY_TYPES = vueKit.
|
|
2488
|
-
const KEYBORD_EVENT_TYPES = vueKit.
|
|
2516
|
+
const ARROW_KEY_TYPES = vueKit.useKeyboard.Key(['ArrowUp', 'ArrowDown']);
|
|
2517
|
+
const CHOICE_KEY_TYPES = vueKit.useKeyboard.Key(['Enter', ' ']);
|
|
2518
|
+
const KEYBORD_EVENT_TYPES = vueKit.useKeyboard.Key([...ARROW_KEY_TYPES, ...CHOICE_KEY_TYPES]);
|
|
2489
2519
|
const {
|
|
2490
2520
|
props: props$3,
|
|
2491
2521
|
emits: emits$3
|
|
@@ -2502,7 +2532,8 @@ const VSelect = vue.defineComponent({
|
|
|
2502
2532
|
placeholder: String,
|
|
2503
2533
|
loadingMessage: {},
|
|
2504
2534
|
failedToLoadItemsMessage: {}
|
|
2505
|
-
})
|
|
2535
|
+
}),
|
|
2536
|
+
closeOnNavigation: Boolean
|
|
2506
2537
|
},
|
|
2507
2538
|
emits: emits$3,
|
|
2508
2539
|
|
|
@@ -2543,6 +2574,7 @@ const VSelect = vue.defineComponent({
|
|
|
2543
2574
|
};
|
|
2544
2575
|
|
|
2545
2576
|
const renderSelections = selectedItems => {
|
|
2577
|
+
const selectionSlot = ctx.slots.selection;
|
|
2546
2578
|
const children = [];
|
|
2547
2579
|
|
|
2548
2580
|
if (inputControl.itemsLoadFailed) {
|
|
@@ -2559,7 +2591,11 @@ const VSelect = vue.defineComponent({
|
|
|
2559
2591
|
children.push(vui.selectionSeparator());
|
|
2560
2592
|
}
|
|
2561
2593
|
|
|
2562
|
-
|
|
2594
|
+
const child = selectionSlot ? selectionSlot({
|
|
2595
|
+
item,
|
|
2596
|
+
index
|
|
2597
|
+
}) : item.renderDefaultSlot();
|
|
2598
|
+
children.push(child);
|
|
2563
2599
|
});
|
|
2564
2600
|
} else if (props.placeholder != null) {
|
|
2565
2601
|
children.push(vue.createVNode("span", {
|
|
@@ -2660,14 +2696,14 @@ const VSelect = vue.defineComponent({
|
|
|
2660
2696
|
}
|
|
2661
2697
|
};
|
|
2662
2698
|
|
|
2663
|
-
const
|
|
2699
|
+
const keyboardEventHandler = ev => {
|
|
2664
2700
|
if (ARROW_KEY_TYPES.includes(ev.key)) return arrowKeyHandler(ev);
|
|
2665
2701
|
if (CHOICE_KEY_TYPES.includes(ev.key)) return choiceKeyHandler(ev);
|
|
2666
2702
|
};
|
|
2667
2703
|
|
|
2668
|
-
vueKit.
|
|
2704
|
+
vueKit.useKeyboard([{
|
|
2669
2705
|
key: KEYBORD_EVENT_TYPES,
|
|
2670
|
-
handler:
|
|
2706
|
+
handler: keyboardEventHandler
|
|
2671
2707
|
}], {
|
|
2672
2708
|
autorun: true
|
|
2673
2709
|
});
|
|
@@ -2728,6 +2764,7 @@ const VSelect = vue.defineComponent({
|
|
|
2728
2764
|
default: () => vue.createVNode(vueKit.VMenu, {
|
|
2729
2765
|
"width": "fit",
|
|
2730
2766
|
"maxWidth": "fit",
|
|
2767
|
+
"closeOnNavigation": this.closeOnNavigation,
|
|
2731
2768
|
"distance": 0,
|
|
2732
2769
|
"alwaysRender": true,
|
|
2733
2770
|
"modelValue": this.menuOpened,
|
|
@@ -4441,7 +4478,7 @@ const VBreadcrumbs = vue.defineComponent({
|
|
|
4441
4478
|
text
|
|
4442
4479
|
} = item;
|
|
4443
4480
|
const {
|
|
4444
|
-
disabled = vui.location.match(to) || !vui.location.
|
|
4481
|
+
disabled = vui.location.match(to) || !vui.location.isAvailable(to)
|
|
4445
4482
|
} = item;
|
|
4446
4483
|
return { ...item,
|
|
4447
4484
|
disabled,
|
|
@@ -4969,7 +5006,9 @@ const VDataTable = vue.defineComponent({
|
|
|
4969
5006
|
}
|
|
4970
5007
|
|
|
4971
5008
|
vui.location.pushQuery({ ...queries,
|
|
4972
|
-
|
|
5009
|
+
...(usePaigingRef.value ? {
|
|
5010
|
+
[props.pageQuery]: 1
|
|
5011
|
+
} : undefined)
|
|
4973
5012
|
});
|
|
4974
5013
|
}
|
|
4975
5014
|
|
|
@@ -5095,8 +5134,8 @@ const VDataTable = vue.defineComponent({
|
|
|
5095
5134
|
const {
|
|
5096
5135
|
defaultOrder,
|
|
5097
5136
|
ascQueryValue
|
|
5098
|
-
} = props;
|
|
5099
|
-
|
|
5137
|
+
} = props; // const usePaiging = usePaigingRef.value;
|
|
5138
|
+
|
|
5100
5139
|
const children = headersRef.value.map(header => {
|
|
5101
5140
|
const {
|
|
5102
5141
|
label,
|
|
@@ -5135,7 +5174,7 @@ const VDataTable = vue.defineComponent({
|
|
|
5135
5174
|
|
|
5136
5175
|
const sortActive = sortBy === sortQuery;
|
|
5137
5176
|
|
|
5138
|
-
if (sortQuery
|
|
5177
|
+
if (sortQuery) {
|
|
5139
5178
|
const isASC = sortActive ? isASCRef.value : defaultOrder === ascQueryValue;
|
|
5140
5179
|
headerChildren.unshift(vue.createVNode(VIcon, {
|
|
5141
5180
|
"class": "v-data-table__table__sort-icon v-data-table__table__sort-icon--empty",
|
|
@@ -5160,9 +5199,9 @@ const VDataTable = vue.defineComponent({
|
|
|
5160
5199
|
return vue.createVNode("th", {
|
|
5161
5200
|
"class": classes,
|
|
5162
5201
|
"key": header.key,
|
|
5163
|
-
"tabindex": sortQuery
|
|
5202
|
+
"tabindex": sortQuery ? 0 : undefined,
|
|
5164
5203
|
"onClick": ev => {
|
|
5165
|
-
if (!sortQuery
|
|
5204
|
+
if (!sortQuery) return;
|
|
5166
5205
|
handleClickSortHeader(header);
|
|
5167
5206
|
}
|
|
5168
5207
|
}, [vue.createVNode("div", {
|
|
@@ -5542,6 +5581,7 @@ class VuiService {
|
|
|
5542
5581
|
router: this.router
|
|
5543
5582
|
});
|
|
5544
5583
|
this.stack = stackService;
|
|
5584
|
+
this.useLink = options.useLink || vueRouter.useLink;
|
|
5545
5585
|
}
|
|
5546
5586
|
|
|
5547
5587
|
configure(options) {
|
|
@@ -5747,6 +5787,7 @@ exports.VTooltip = vueKit.VTooltip;
|
|
|
5747
5787
|
exports.ICON_NAMES = iconFont.ICON_NAMES;
|
|
5748
5788
|
exports.ARROW_KEY_TYPES = ARROW_KEY_TYPES;
|
|
5749
5789
|
exports.AVATAR_SIZES = AVATAR_SIZES;
|
|
5790
|
+
exports.BUTTON_ALIGNS = BUTTON_ALIGNS;
|
|
5750
5791
|
exports.CHIP_SIZES = CHIP_SIZES;
|
|
5751
5792
|
exports.CHOICE_KEY_TYPES = CHOICE_KEY_TYPES;
|
|
5752
5793
|
exports.CONTROL_FIELD_VARIANTS = CONTROL_FIELD_VARIANTS;
|
|
@@ -5838,6 +5879,7 @@ exports.createControlProps = createControlProps;
|
|
|
5838
5879
|
exports.createElevationProps = createElevationProps;
|
|
5839
5880
|
exports.createListTileProps = createListTileProps;
|
|
5840
5881
|
exports.createNavigationItemProps = createNavigationItemProps;
|
|
5882
|
+
exports.createNavigationProps = createNavigationProps;
|
|
5841
5883
|
exports.createPaperBaseProps = createPaperBaseProps;
|
|
5842
5884
|
exports.createPaperProps = createPaperProps;
|
|
5843
5885
|
exports.createRequiredChipRenderer = createRequiredChipRenderer;
|
package/dist/vui.cjs.prod.js
CHANGED
|
@@ -528,7 +528,7 @@ const VBusyImage = vue.defineComponent({
|
|
|
528
528
|
},
|
|
529
529
|
|
|
530
530
|
setup(props, ctx) {
|
|
531
|
-
const loadStateRef = vue.ref(props.cover &&
|
|
531
|
+
const loadStateRef = vue.ref(props.cover && isAvailableSrc(ctx.attrs.src) ? 'loading' : 'pending');
|
|
532
532
|
const attrsRef = vue.computed(() => splitAttrs(ctx.attrs));
|
|
533
533
|
const isPendingRef = vue.computed(() => loadStateRef.value === 'pending');
|
|
534
534
|
const isLoadingRef = vue.computed(() => loadStateRef.value === 'loading');
|
|
@@ -598,7 +598,7 @@ const VBusyImage = vue.defineComponent({
|
|
|
598
598
|
vue.watch(() => ctx.attrs.src, value => {
|
|
599
599
|
coverImageRef.value = undefined;
|
|
600
600
|
|
|
601
|
-
if (
|
|
601
|
+
if (isAvailableSrc(value)) {
|
|
602
602
|
loadStateRef.value = 'loading';
|
|
603
603
|
|
|
604
604
|
if (props.cover) {
|
|
@@ -690,7 +690,7 @@ function imageIsReady(image) {
|
|
|
690
690
|
return image.naturalWidth + image.naturalHeight > 0 ? 'load' : 'error';
|
|
691
691
|
}
|
|
692
692
|
|
|
693
|
-
function
|
|
693
|
+
function isAvailableSrc(src) {
|
|
694
694
|
return typeof src === 'string' && src !== '';
|
|
695
695
|
}
|
|
696
696
|
|
|
@@ -1143,6 +1143,8 @@ const VCardActions = vue.defineComponent({
|
|
|
1143
1143
|
|
|
1144
1144
|
});
|
|
1145
1145
|
|
|
1146
|
+
const BUTTON_ALIGNS = ['left', 'center', 'right'];
|
|
1147
|
+
|
|
1146
1148
|
function resolveRawVButtonIcon(raw, type = 'main') {
|
|
1147
1149
|
if (!raw) return;
|
|
1148
1150
|
return typeof raw === 'function' ? raw : () => vue.createVNode(VIcon, {
|
|
@@ -1159,6 +1161,10 @@ const vueButtonProps = vueUtils.createPropsOptions({ ...vueUtils.htmlAttributesP
|
|
|
1159
1161
|
icon: [String, Function],
|
|
1160
1162
|
startIcon: [String, Function],
|
|
1161
1163
|
endIcon: [String, Function],
|
|
1164
|
+
align: {
|
|
1165
|
+
type: String,
|
|
1166
|
+
default: 'center'
|
|
1167
|
+
},
|
|
1162
1168
|
...createControlProps()
|
|
1163
1169
|
});
|
|
1164
1170
|
const LOADING_SIZE_MAP = {
|
|
@@ -1206,7 +1212,7 @@ const VButton = vue.defineComponent({
|
|
|
1206
1212
|
return _spacer === true ? 'left' : _spacer;
|
|
1207
1213
|
});
|
|
1208
1214
|
const classes = vue.computed(() => [color.colorClasses.value, // navigationable.value.classes,
|
|
1209
|
-
spacer.value ? `v-button--spacer-${spacer.value}` : undefined, `v-button--${control.size.value}`, {
|
|
1215
|
+
spacer.value ? `v-button--spacer-${spacer.value}` : undefined, `v-button--${control.size.value}`, `v-button--align-${props.align}`, {
|
|
1210
1216
|
'v-button--loading': isLoading.value,
|
|
1211
1217
|
'v-button--icon': !!icon.value,
|
|
1212
1218
|
'v-button--rounded': props.rounded,
|
|
@@ -1617,6 +1623,7 @@ const VListTile = vue.defineComponent({
|
|
|
1617
1623
|
},
|
|
1618
1624
|
|
|
1619
1625
|
setup(props, ctx) {
|
|
1626
|
+
const vui = useVui();
|
|
1620
1627
|
const startIcon = vue.computed(() => {
|
|
1621
1628
|
let icon = resolveRawIconProp(false, props.startIcon);
|
|
1622
1629
|
|
|
@@ -1628,7 +1635,7 @@ const VListTile = vue.defineComponent({
|
|
|
1628
1635
|
});
|
|
1629
1636
|
const endIcon = vue.computed(() => resolveRawIconProp(false, props.endIcon));
|
|
1630
1637
|
const hasTo = vue.computed(() => !!ctx.attrs.to);
|
|
1631
|
-
const link =
|
|
1638
|
+
const link = vui.useLink({
|
|
1632
1639
|
to: ctx.attrs.to || ''
|
|
1633
1640
|
});
|
|
1634
1641
|
const isActive = vue.computed(() => {
|
|
@@ -1756,7 +1763,7 @@ function _isSlot$c(s) {
|
|
|
1756
1763
|
|
|
1757
1764
|
function createNavigationItemProps() {
|
|
1758
1765
|
return { ...createListTileProps(),
|
|
1759
|
-
match: String,
|
|
1766
|
+
match: [String, Array],
|
|
1760
1767
|
depth: {
|
|
1761
1768
|
type: Number,
|
|
1762
1769
|
default: 0
|
|
@@ -1795,6 +1802,12 @@ function renderNavigationItemInput(input, extraProps) {
|
|
|
1795
1802
|
default: () => [label]
|
|
1796
1803
|
});
|
|
1797
1804
|
}
|
|
1805
|
+
const TRIM_END_SLASH_RE = /\/$/;
|
|
1806
|
+
|
|
1807
|
+
function trimEndSlash(sorce) {
|
|
1808
|
+
return sorce ? sorce.replace(TRIM_END_SLASH_RE, '') : sorce;
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1798
1811
|
const VNavigationItem = vue.defineComponent({
|
|
1799
1812
|
name: 'VNavigationItem',
|
|
1800
1813
|
inheritAttrs: false,
|
|
@@ -1819,10 +1832,15 @@ const VNavigationItem = vue.defineComponent({
|
|
|
1819
1832
|
const {
|
|
1820
1833
|
to
|
|
1821
1834
|
} = ctx.attrs;
|
|
1822
|
-
|
|
1835
|
+
|
|
1836
|
+
if (match) {
|
|
1837
|
+
return (Array.isArray(match) ? match : [match]).map(trimEndSlash);
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1823
1840
|
if (!to) return;
|
|
1824
|
-
|
|
1825
|
-
return
|
|
1841
|
+
const toPath = typeof to === 'string' ? to : to.path;
|
|
1842
|
+
if (!toPath) return;
|
|
1843
|
+
return [trimEndSlash(toPath)];
|
|
1826
1844
|
});
|
|
1827
1845
|
const classes = vue.computed(() => [{
|
|
1828
1846
|
'v-navigation-item--opened': opened.value,
|
|
@@ -1838,16 +1856,25 @@ const VNavigationItem = vue.defineComponent({
|
|
|
1838
1856
|
const c = children.value;
|
|
1839
1857
|
const m = match.value;
|
|
1840
1858
|
|
|
1841
|
-
if (!c || !m) {
|
|
1859
|
+
if (!c || !m || !m.length) {
|
|
1842
1860
|
// matched.value = false;
|
|
1843
1861
|
return;
|
|
1844
1862
|
}
|
|
1845
1863
|
|
|
1846
|
-
|
|
1864
|
+
const trimedNewPath = trimEndSlash(newPath);
|
|
1865
|
+
|
|
1866
|
+
if (m.some(_ => trimedNewPath.match(_))) {
|
|
1847
1867
|
open(); // matched.value = true;
|
|
1848
1868
|
} else {
|
|
1849
1869
|
close(); // matched.value = false;
|
|
1850
|
-
}
|
|
1870
|
+
} // if (trimEndSlash(newPath).match(m)) {
|
|
1871
|
+
// open();
|
|
1872
|
+
// // matched.value = true;
|
|
1873
|
+
// } else {
|
|
1874
|
+
// close();
|
|
1875
|
+
// // matched.value = false;
|
|
1876
|
+
// }
|
|
1877
|
+
|
|
1851
1878
|
}, {
|
|
1852
1879
|
immediate: true
|
|
1853
1880
|
}); // const iconPayload = () => opened.value;
|
|
@@ -1966,9 +1993,8 @@ const VNavigationItem = vue.defineComponent({
|
|
|
1966
1993
|
|
|
1967
1994
|
});
|
|
1968
1995
|
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
props: {
|
|
1996
|
+
function createNavigationProps() {
|
|
1997
|
+
return vueUtils.createPropsOptions({
|
|
1972
1998
|
items: {
|
|
1973
1999
|
type: Array,
|
|
1974
2000
|
required: true
|
|
@@ -1979,7 +2005,11 @@ const VNavigation = vue.defineComponent({
|
|
|
1979
2005
|
default: true
|
|
1980
2006
|
},
|
|
1981
2007
|
caption: [String, Function]
|
|
1982
|
-
}
|
|
2008
|
+
});
|
|
2009
|
+
}
|
|
2010
|
+
const VNavigation = vue.defineComponent({
|
|
2011
|
+
name: 'VNavigation',
|
|
2012
|
+
props: createNavigationProps(),
|
|
1983
2013
|
|
|
1984
2014
|
setup(props, ctx) {
|
|
1985
2015
|
const items = vue.computed(() => props.items);
|
|
@@ -2483,9 +2513,9 @@ function _isSlot$8(s) {
|
|
|
2483
2513
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
2484
2514
|
}
|
|
2485
2515
|
|
|
2486
|
-
const ARROW_KEY_TYPES = vueKit.
|
|
2487
|
-
const CHOICE_KEY_TYPES = vueKit.
|
|
2488
|
-
const KEYBORD_EVENT_TYPES = vueKit.
|
|
2516
|
+
const ARROW_KEY_TYPES = vueKit.useKeyboard.Key(['ArrowUp', 'ArrowDown']);
|
|
2517
|
+
const CHOICE_KEY_TYPES = vueKit.useKeyboard.Key(['Enter', ' ']);
|
|
2518
|
+
const KEYBORD_EVENT_TYPES = vueKit.useKeyboard.Key([...ARROW_KEY_TYPES, ...CHOICE_KEY_TYPES]);
|
|
2489
2519
|
const {
|
|
2490
2520
|
props: props$3,
|
|
2491
2521
|
emits: emits$3
|
|
@@ -2502,7 +2532,8 @@ const VSelect = vue.defineComponent({
|
|
|
2502
2532
|
placeholder: String,
|
|
2503
2533
|
loadingMessage: {},
|
|
2504
2534
|
failedToLoadItemsMessage: {}
|
|
2505
|
-
})
|
|
2535
|
+
}),
|
|
2536
|
+
closeOnNavigation: Boolean
|
|
2506
2537
|
},
|
|
2507
2538
|
emits: emits$3,
|
|
2508
2539
|
|
|
@@ -2543,6 +2574,7 @@ const VSelect = vue.defineComponent({
|
|
|
2543
2574
|
};
|
|
2544
2575
|
|
|
2545
2576
|
const renderSelections = selectedItems => {
|
|
2577
|
+
const selectionSlot = ctx.slots.selection;
|
|
2546
2578
|
const children = [];
|
|
2547
2579
|
|
|
2548
2580
|
if (inputControl.itemsLoadFailed) {
|
|
@@ -2559,7 +2591,11 @@ const VSelect = vue.defineComponent({
|
|
|
2559
2591
|
children.push(vui.selectionSeparator());
|
|
2560
2592
|
}
|
|
2561
2593
|
|
|
2562
|
-
|
|
2594
|
+
const child = selectionSlot ? selectionSlot({
|
|
2595
|
+
item,
|
|
2596
|
+
index
|
|
2597
|
+
}) : item.renderDefaultSlot();
|
|
2598
|
+
children.push(child);
|
|
2563
2599
|
});
|
|
2564
2600
|
} else if (props.placeholder != null) {
|
|
2565
2601
|
children.push(vue.createVNode("span", {
|
|
@@ -2660,14 +2696,14 @@ const VSelect = vue.defineComponent({
|
|
|
2660
2696
|
}
|
|
2661
2697
|
};
|
|
2662
2698
|
|
|
2663
|
-
const
|
|
2699
|
+
const keyboardEventHandler = ev => {
|
|
2664
2700
|
if (ARROW_KEY_TYPES.includes(ev.key)) return arrowKeyHandler(ev);
|
|
2665
2701
|
if (CHOICE_KEY_TYPES.includes(ev.key)) return choiceKeyHandler(ev);
|
|
2666
2702
|
};
|
|
2667
2703
|
|
|
2668
|
-
vueKit.
|
|
2704
|
+
vueKit.useKeyboard([{
|
|
2669
2705
|
key: KEYBORD_EVENT_TYPES,
|
|
2670
|
-
handler:
|
|
2706
|
+
handler: keyboardEventHandler
|
|
2671
2707
|
}], {
|
|
2672
2708
|
autorun: true
|
|
2673
2709
|
});
|
|
@@ -2728,6 +2764,7 @@ const VSelect = vue.defineComponent({
|
|
|
2728
2764
|
default: () => vue.createVNode(vueKit.VMenu, {
|
|
2729
2765
|
"width": "fit",
|
|
2730
2766
|
"maxWidth": "fit",
|
|
2767
|
+
"closeOnNavigation": this.closeOnNavigation,
|
|
2731
2768
|
"distance": 0,
|
|
2732
2769
|
"alwaysRender": true,
|
|
2733
2770
|
"modelValue": this.menuOpened,
|
|
@@ -4441,7 +4478,7 @@ const VBreadcrumbs = vue.defineComponent({
|
|
|
4441
4478
|
text
|
|
4442
4479
|
} = item;
|
|
4443
4480
|
const {
|
|
4444
|
-
disabled = vui.location.match(to) || !vui.location.
|
|
4481
|
+
disabled = vui.location.match(to) || !vui.location.isAvailable(to)
|
|
4445
4482
|
} = item;
|
|
4446
4483
|
return { ...item,
|
|
4447
4484
|
disabled,
|
|
@@ -4969,7 +5006,9 @@ const VDataTable = vue.defineComponent({
|
|
|
4969
5006
|
}
|
|
4970
5007
|
|
|
4971
5008
|
vui.location.pushQuery({ ...queries,
|
|
4972
|
-
|
|
5009
|
+
...(usePaigingRef.value ? {
|
|
5010
|
+
[props.pageQuery]: 1
|
|
5011
|
+
} : undefined)
|
|
4973
5012
|
});
|
|
4974
5013
|
}
|
|
4975
5014
|
|
|
@@ -5095,8 +5134,8 @@ const VDataTable = vue.defineComponent({
|
|
|
5095
5134
|
const {
|
|
5096
5135
|
defaultOrder,
|
|
5097
5136
|
ascQueryValue
|
|
5098
|
-
} = props;
|
|
5099
|
-
|
|
5137
|
+
} = props; // const usePaiging = usePaigingRef.value;
|
|
5138
|
+
|
|
5100
5139
|
const children = headersRef.value.map(header => {
|
|
5101
5140
|
const {
|
|
5102
5141
|
label,
|
|
@@ -5135,7 +5174,7 @@ const VDataTable = vue.defineComponent({
|
|
|
5135
5174
|
|
|
5136
5175
|
const sortActive = sortBy === sortQuery;
|
|
5137
5176
|
|
|
5138
|
-
if (sortQuery
|
|
5177
|
+
if (sortQuery) {
|
|
5139
5178
|
const isASC = sortActive ? isASCRef.value : defaultOrder === ascQueryValue;
|
|
5140
5179
|
headerChildren.unshift(vue.createVNode(VIcon, {
|
|
5141
5180
|
"class": "v-data-table__table__sort-icon v-data-table__table__sort-icon--empty",
|
|
@@ -5160,9 +5199,9 @@ const VDataTable = vue.defineComponent({
|
|
|
5160
5199
|
return vue.createVNode("th", {
|
|
5161
5200
|
"class": classes,
|
|
5162
5201
|
"key": header.key,
|
|
5163
|
-
"tabindex": sortQuery
|
|
5202
|
+
"tabindex": sortQuery ? 0 : undefined,
|
|
5164
5203
|
"onClick": ev => {
|
|
5165
|
-
if (!sortQuery
|
|
5204
|
+
if (!sortQuery) return;
|
|
5166
5205
|
handleClickSortHeader(header);
|
|
5167
5206
|
}
|
|
5168
5207
|
}, [vue.createVNode("div", {
|
|
@@ -5542,6 +5581,7 @@ class VuiService {
|
|
|
5542
5581
|
router: this.router
|
|
5543
5582
|
});
|
|
5544
5583
|
this.stack = stackService;
|
|
5584
|
+
this.useLink = options.useLink || vueRouter.useLink;
|
|
5545
5585
|
}
|
|
5546
5586
|
|
|
5547
5587
|
configure(options) {
|
|
@@ -5747,6 +5787,7 @@ exports.VTooltip = vueKit.VTooltip;
|
|
|
5747
5787
|
exports.ICON_NAMES = iconFont.ICON_NAMES;
|
|
5748
5788
|
exports.ARROW_KEY_TYPES = ARROW_KEY_TYPES;
|
|
5749
5789
|
exports.AVATAR_SIZES = AVATAR_SIZES;
|
|
5790
|
+
exports.BUTTON_ALIGNS = BUTTON_ALIGNS;
|
|
5750
5791
|
exports.CHIP_SIZES = CHIP_SIZES;
|
|
5751
5792
|
exports.CHOICE_KEY_TYPES = CHOICE_KEY_TYPES;
|
|
5752
5793
|
exports.CONTROL_FIELD_VARIANTS = CONTROL_FIELD_VARIANTS;
|
|
@@ -5838,6 +5879,7 @@ exports.createControlProps = createControlProps;
|
|
|
5838
5879
|
exports.createElevationProps = createElevationProps;
|
|
5839
5880
|
exports.createListTileProps = createListTileProps;
|
|
5840
5881
|
exports.createNavigationItemProps = createNavigationItemProps;
|
|
5882
|
+
exports.createNavigationProps = createNavigationProps;
|
|
5841
5883
|
exports.createPaperBaseProps = createPaperBaseProps;
|
|
5842
5884
|
exports.createPaperProps = createPaperProps;
|
|
5843
5885
|
exports.createRequiredChipRenderer = createRequiredChipRenderer;
|
package/dist/vui.css
CHANGED
|
@@ -1288,6 +1288,12 @@ thead th {
|
|
|
1288
1288
|
transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1), color 1ms;
|
|
1289
1289
|
appearance: none;
|
|
1290
1290
|
}
|
|
1291
|
+
.v-button--align-left {
|
|
1292
|
+
justify-content: flex-start;
|
|
1293
|
+
}
|
|
1294
|
+
.v-button--align-right {
|
|
1295
|
+
justify-content: flex-end;
|
|
1296
|
+
}
|
|
1291
1297
|
.v-button--plain {
|
|
1292
1298
|
color: inherit !important;
|
|
1293
1299
|
}
|