@vuetify/v0 0.1.4 → 0.1.6
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/{adapter-D_0ptsPm.mjs → adapter-Bjs_Nx_J.mjs} +8 -10
- package/dist/{adapter-BN-h5JbD.d.mts → adapter-CLs-OrSN.d.mts} +4 -4
- package/dist/browser/index.js +2150 -277
- package/dist/components/index.d.mts +8 -8
- package/dist/components/index.mjs +28 -28
- package/dist/{components-CMuzTJdK.mjs → components-GiQh_RfQ.mjs} +1570 -114
- package/dist/composables/index.d.mts +7 -7
- package/dist/composables/index.mjs +27 -27
- package/dist/constants/index.mjs +1 -1
- package/dist/{createDataTable-BJnmvxfb.mjs → createDataTable-lSofI5rU.mjs} +5 -5
- package/dist/{createGroup-CPhp6FUh.mjs → createGroup-CCb7Zfyw.mjs} +6 -5
- package/dist/{createPagination-cyOWlpfH.mjs → createPagination-lagznd8i.mjs} +2 -2
- package/dist/{createSelection-uqEbFgha.mjs → createSelection-Zo4RQpYe.mjs} +217 -61
- package/dist/{createSingle-B59ya3aa.mjs → createSingle-BH9wNDrS.mjs} +2 -2
- package/dist/{createTokens-BlhLdHXE.mjs → createTokens-Cu1efg9Z.mjs} +21 -3
- package/dist/{createTrinity-EeHQSsb6.mjs → createTrinity-Cii8-B2r.mjs} +1 -1
- package/dist/data-table/adapters/client/index.d.mts +2 -2
- package/dist/data-table/adapters/client/index.mjs +7 -7
- package/dist/data-table/adapters/index.d.mts +4 -4
- package/dist/data-table/adapters/index.mjs +9 -9
- package/dist/data-table/adapters/server/index.d.mts +2 -2
- package/dist/data-table/adapters/server/index.mjs +5 -5
- package/dist/data-table/adapters/virtual/index.d.mts +2 -2
- package/dist/data-table/adapters/virtual/index.mjs +7 -7
- package/dist/data-table/index.d.mts +5 -5
- package/dist/data-table/index.mjs +19 -19
- package/dist/date/index.mjs +2 -2
- package/dist/features/adapters/posthog/index.mjs +2 -2
- package/dist/features/index.d.mts +6 -6
- package/dist/features/index.mjs +12 -12
- package/dist/{globals-B_GVfG06.mjs → globals-D6FBsWDI.mjs} +1 -1
- package/dist/{index-7mWYFHA6.d.mts → index-DIK84tM4.d.mts} +1 -1
- package/dist/{index-Dd0m0LIJ.d.mts → index-De0SQt1w.d.mts} +849 -56
- package/dist/{index-CQrDeqsK.d.mts → index-DlUIZN-F.d.mts} +1858 -500
- package/dist/index.d.mts +8 -8
- package/dist/index.mjs +28 -28
- package/dist/json/attributes.json +366 -10
- package/dist/json/importMap.json +68 -0
- package/dist/json/tags.json +159 -0
- package/dist/json/web-types.json +1107 -41
- package/dist/locale/adapters/index.mjs +3 -3
- package/dist/locale/adapters/v0/index.mjs +3 -3
- package/dist/locale/index.d.mts +6 -6
- package/dist/locale/index.mjs +12 -12
- package/dist/logger/adapters/index.mjs +4 -4
- package/dist/logger/adapters/pino/index.mjs +3 -3
- package/dist/logger/adapters/v0/index.mjs +3 -3
- package/dist/logger/index.d.mts +6 -6
- package/dist/logger/index.mjs +6 -6
- package/dist/permissions/adapters/index.d.mts +7 -7
- package/dist/permissions/adapters/index.mjs +3 -3
- package/dist/permissions/adapters/v0/index.d.mts +7 -7
- package/dist/permissions/adapters/v0/index.mjs +3 -3
- package/dist/permissions/index.d.mts +6 -6
- package/dist/permissions/index.mjs +10 -10
- package/dist/{pino-01x_NmWp.mjs → pino-BD5PCzAF.mjs} +1 -1
- package/dist/{posthog-BrGBPPir.mjs → posthog-BxaG8sYi.mjs} +1 -1
- package/dist/{server-6cs14bj1.d.mts → server-CGAeOGPC.d.mts} +1 -1
- package/dist/{server-ClCwiLMA.mjs → server-DgOdFYMU.mjs} +1 -1
- package/dist/storage/index.d.mts +6 -6
- package/dist/storage/index.mjs +26 -26
- package/dist/theme/adapters/index.d.mts +6 -6
- package/dist/theme/adapters/index.mjs +3 -3
- package/dist/theme/adapters/v0/index.d.mts +6 -6
- package/dist/theme/adapters/v0/index.mjs +3 -3
- package/dist/theme/index.d.mts +6 -6
- package/dist/theme/index.mjs +11 -11
- package/dist/{toArray-DIeXVX1C.mjs → toArray-BBZH-G2X.mjs} +1 -1
- package/dist/{useClickOutside-p8HP07At.mjs → useClickOutside-Bm_3mbcT.mjs} +348 -104
- package/dist/{useFeatures-C4JF3Hgr.mjs → useFeatures-BS4mit8z.mjs} +4 -4
- package/dist/{useLocale-DlbShzF-.mjs → useLocale-DJJmg-wv.mjs} +6 -6
- package/dist/{useLogger-CO9JwbSJ.mjs → useLogger-C8G5jgNk.mjs} +4 -4
- package/dist/{usePermissions-DQVT_4nD.mjs → usePermissions-C5Mkotol.mjs} +4 -4
- package/dist/{useTheme-Bcw1Ebyt.mjs → useTheme-BBnASLr3.mjs} +4 -4
- package/dist/utilities/index.mjs +2 -2
- package/dist/{utilities-BqS1sC1W.mjs → utilities-CcJtp9Gx.mjs} +1 -1
- package/dist/{v0-BtQCSBOG.mjs → v0-BWBSVkew.mjs} +2 -2
- package/dist/{v0-C-9dv_1S.d.mts → v0-Bh8d1j_p.d.mts} +1 -1
- package/dist/{v0-RepwEY1F.d.mts → v0-CVr15VcY.d.mts} +1 -1
- package/dist/{v0-BogbIzpM.mjs → v0-CWUF_HqP.mjs} +2 -2
- package/dist/{v0-B40YkIQ-.mjs → v0-DtO_ICXr.mjs} +1 -1
- package/dist/{v0-ONBWyQYQ.mjs → v0-DzvhDU1W.mjs} +2 -2
- package/dist/{v0-CtjuUUPl.mjs → v0-lua6ffdk.mjs} +2 -2
- package/dist/{virtual-BP9WXRzN.mjs → virtual-BEOqkQvm.mjs} +2 -2
- package/dist/{virtual-B3IPkHC0.d.mts → virtual-CVb9hRUU.d.mts} +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -85,7 +85,7 @@ const SUPPORTS_MATCH_MEDIA = IN_BROWSER && "matchMedia" in window && typeof wind
|
|
|
85
85
|
const SUPPORTS_OBSERVER = IN_BROWSER && "ResizeObserver" in window;
|
|
86
86
|
const SUPPORTS_INTERSECTION_OBSERVER = IN_BROWSER && "IntersectionObserver" in window;
|
|
87
87
|
const SUPPORTS_MUTATION_OBSERVER = IN_BROWSER && "MutationObserver" in window;
|
|
88
|
-
const version = "0.1.
|
|
88
|
+
const version = "0.1.6";
|
|
89
89
|
/* v8 ignore next -- build-time constant, __DEV__ short-circuits in tests */
|
|
90
90
|
const __LOGGER_ENABLED__ = false;
|
|
91
91
|
|
|
@@ -528,7 +528,7 @@ function debounce(fn, delay) {
|
|
|
528
528
|
* serving as the foundation for all other components that need polymorphic
|
|
529
529
|
* rendering capabilities.
|
|
530
530
|
*/
|
|
531
|
-
const _sfc_main$
|
|
531
|
+
const _sfc_main$68 = /* @__PURE__ */ defineComponent({
|
|
532
532
|
name: "Atom",
|
|
533
533
|
__name: "Atom",
|
|
534
534
|
props: {
|
|
@@ -559,7 +559,7 @@ const _sfc_main$54 = /* @__PURE__ */ defineComponent({
|
|
|
559
559
|
};
|
|
560
560
|
}
|
|
561
561
|
});
|
|
562
|
-
var Atom_default = _sfc_main$
|
|
562
|
+
var Atom_default = _sfc_main$68;
|
|
563
563
|
|
|
564
564
|
//#endregion
|
|
565
565
|
//#region src/composables/createContext/index.ts
|
|
@@ -1417,6 +1417,23 @@ function createRegistry(options) {
|
|
|
1417
1417
|
needsReindex = true;
|
|
1418
1418
|
});
|
|
1419
1419
|
}
|
|
1420
|
+
function move(id, toIndex) {
|
|
1421
|
+
if (needsReindex) reindex();
|
|
1422
|
+
const ticket = collection.get(id);
|
|
1423
|
+
if (!ticket) return void 0;
|
|
1424
|
+
const size = collection.size;
|
|
1425
|
+
const target = /* @__PURE__ */ clamp(toIndex, 0, size - 1);
|
|
1426
|
+
if (ticket.index === target) return ticket;
|
|
1427
|
+
const items = Array.from(collection.entries());
|
|
1428
|
+
const fromIndex = items.findIndex(([key]) => key === id);
|
|
1429
|
+
const [entry] = items.splice(fromIndex, 1);
|
|
1430
|
+
items.splice(target, 0, entry);
|
|
1431
|
+
collection.clear();
|
|
1432
|
+
for (const [key, value] of items) collection.set(key, value);
|
|
1433
|
+
minDirtyIndex = Math.min(ticket.index, target);
|
|
1434
|
+
reindex();
|
|
1435
|
+
return ticket;
|
|
1436
|
+
}
|
|
1420
1437
|
function seek(direction = "first", from, predicate) {
|
|
1421
1438
|
if (collection.size === 0) return void 0;
|
|
1422
1439
|
if (needsReindex) reindex();
|
|
@@ -1458,6 +1475,7 @@ function createRegistry(options) {
|
|
|
1458
1475
|
register,
|
|
1459
1476
|
unregister,
|
|
1460
1477
|
reindex,
|
|
1478
|
+
move,
|
|
1461
1479
|
seek,
|
|
1462
1480
|
batch,
|
|
1463
1481
|
onboard(registrations) {
|
|
@@ -1530,27 +1548,193 @@ function useRegistry(namespace = "v0:registry") {
|
|
|
1530
1548
|
return useContext(namespace);
|
|
1531
1549
|
}
|
|
1532
1550
|
|
|
1551
|
+
//#endregion
|
|
1552
|
+
//#region src/composables/createModel/index.ts
|
|
1553
|
+
/**
|
|
1554
|
+
* @module createModel
|
|
1555
|
+
*
|
|
1556
|
+
* @remarks
|
|
1557
|
+
* Value store layer that extends createRegistry with a reactive Set of
|
|
1558
|
+
* selected IDs, disabled guards, and an `apply` bridge for useProxyModel sync.
|
|
1559
|
+
*
|
|
1560
|
+
* Think of it as a creative way to store a single value — more like
|
|
1561
|
+
* `defineModel` than `createSelection`. Selection-specific concepts
|
|
1562
|
+
* (mandatory) belong in createSelection. The `multiple` option here
|
|
1563
|
+
* controls whether `select()` accumulates or replaces.
|
|
1564
|
+
*
|
|
1565
|
+
* Both Selection and Slider extend this layer:
|
|
1566
|
+
* - createRegistry → createModel → createSelection → createSingle/createGroup/createStep
|
|
1567
|
+
* - createRegistry → createModel → createSlider (values override)
|
|
1568
|
+
*/
|
|
1569
|
+
/**
|
|
1570
|
+
* Creates a new model instance for storing a single value.
|
|
1571
|
+
*
|
|
1572
|
+
* @param options The options for the model instance.
|
|
1573
|
+
* @template Z The input ticket type. Extend {@link ModelTicketInput} to add custom properties.
|
|
1574
|
+
* @template E The output ticket type. Automatically includes `disabled` and `isSelected`.
|
|
1575
|
+
* @template R The context type. Defaults to {@link ModelContext}<Z, E>.
|
|
1576
|
+
* @returns A new model instance with selection tracking and disabled guards.
|
|
1577
|
+
*
|
|
1578
|
+
* @remarks
|
|
1579
|
+
* Extends createRegistry with value tracking via a reactive Set of selected IDs.
|
|
1580
|
+
* Provides the shared model-value concept used by both Selection and Slider.
|
|
1581
|
+
*
|
|
1582
|
+
* **Enrollment**: Tickets are auto-selected on registration by default (`enroll: true`).
|
|
1583
|
+
* With single-value semantics, only the most recently registered ticket is active.
|
|
1584
|
+
* Pass `enroll: false` to opt out. `createSelection` overrides this to `false`.
|
|
1585
|
+
*
|
|
1586
|
+
* **Apply bridge**: `useProxyModel` calls `apply()` to sync a ref with the model.
|
|
1587
|
+
* When the active ticket's value is a ref, `apply` writes to it directly. Otherwise,
|
|
1588
|
+
* it resolves via `registry.browse()`.
|
|
1589
|
+
*
|
|
1590
|
+
* @see https://0.vuetifyjs.com/composables/selection/create-model
|
|
1591
|
+
*
|
|
1592
|
+
* @example
|
|
1593
|
+
* ```ts
|
|
1594
|
+
* import { shallowRef } from 'vue'
|
|
1595
|
+
* import { createModel, useProxyModel } from '@vuetify/v0'
|
|
1596
|
+
*
|
|
1597
|
+
* const value = shallowRef('Apple')
|
|
1598
|
+
* const model = createModel({ events: true })
|
|
1599
|
+
*
|
|
1600
|
+
* model.register({ id: 'fruit', value })
|
|
1601
|
+
* useProxyModel(model, value)
|
|
1602
|
+
*
|
|
1603
|
+
* // value and model stay in sync bidirectionally
|
|
1604
|
+
* ```
|
|
1605
|
+
*
|
|
1606
|
+
* @example
|
|
1607
|
+
* ```ts
|
|
1608
|
+
* // Disabled model — all selection operations are no-ops
|
|
1609
|
+
* const model = createModel({ disabled: true })
|
|
1610
|
+
* model.register({ id: 'a', value: shallowRef('Apple') })
|
|
1611
|
+
* model.select('a') // no-op
|
|
1612
|
+
* ```
|
|
1613
|
+
*/
|
|
1614
|
+
function createModel(_options = {}) {
|
|
1615
|
+
const { disabled = false, enroll = true, multiple = false, ...options } = _options;
|
|
1616
|
+
const registry = createRegistry(options);
|
|
1617
|
+
const selectedIds = shallowReactive(/* @__PURE__ */ new Set());
|
|
1618
|
+
const selectedItems = computed(() => {
|
|
1619
|
+
return new Set(Array.from(selectedIds).map((id) => registry.get(id)).filter((item) => !/* @__PURE__ */ isUndefined(item)));
|
|
1620
|
+
});
|
|
1621
|
+
const selectedValues = computed(() => {
|
|
1622
|
+
return new Set(Array.from(selectedItems.value).map((item) => toValue(item.value)));
|
|
1623
|
+
});
|
|
1624
|
+
function select(id) {
|
|
1625
|
+
if (toValue(disabled)) return;
|
|
1626
|
+
const item = registry.get(id);
|
|
1627
|
+
if (!item || toValue(item.disabled)) return;
|
|
1628
|
+
if (!toValue(multiple)) selectedIds.clear();
|
|
1629
|
+
selectedIds.add(id);
|
|
1630
|
+
}
|
|
1631
|
+
function unselect(id) {
|
|
1632
|
+
if (toValue(disabled)) return;
|
|
1633
|
+
selectedIds.delete(id);
|
|
1634
|
+
}
|
|
1635
|
+
function toggle(id) {
|
|
1636
|
+
if (toValue(disabled)) return;
|
|
1637
|
+
if (selected(id)) unselect(id);
|
|
1638
|
+
else select(id);
|
|
1639
|
+
}
|
|
1640
|
+
function selected(id) {
|
|
1641
|
+
return selectedIds.has(id);
|
|
1642
|
+
}
|
|
1643
|
+
function apply(values, _options$1) {
|
|
1644
|
+
const value = values[0];
|
|
1645
|
+
for (const id$1 of selectedIds) {
|
|
1646
|
+
const item = registry.get(id$1);
|
|
1647
|
+
if (!item || !isRef(item.value)) continue;
|
|
1648
|
+
item.value.value = value;
|
|
1649
|
+
}
|
|
1650
|
+
if (!toValue(multiple)) selectedIds.clear();
|
|
1651
|
+
if (/* @__PURE__ */ isUndefined(value)) return;
|
|
1652
|
+
const id = registry.browse(toRaw(value))?.values().next().value;
|
|
1653
|
+
if (!/* @__PURE__ */ isUndefined(id)) selectedIds.add(id);
|
|
1654
|
+
}
|
|
1655
|
+
function register(registration = {}) {
|
|
1656
|
+
const id = registration.id ?? /* @__PURE__ */ useId();
|
|
1657
|
+
const item = {
|
|
1658
|
+
disabled: false,
|
|
1659
|
+
...registration,
|
|
1660
|
+
isSelected: toRef(() => selected(id)),
|
|
1661
|
+
id
|
|
1662
|
+
};
|
|
1663
|
+
const ticket = registry.register(item);
|
|
1664
|
+
if (toValue(enroll) && !toValue(disabled) && !toValue(ticket.disabled)) select(id);
|
|
1665
|
+
return ticket;
|
|
1666
|
+
}
|
|
1667
|
+
function unregister(id) {
|
|
1668
|
+
selectedIds.delete(id);
|
|
1669
|
+
registry.unregister(id);
|
|
1670
|
+
}
|
|
1671
|
+
function onboard(registrations) {
|
|
1672
|
+
return registry.batch(() => registrations.map((r) => register(r)));
|
|
1673
|
+
}
|
|
1674
|
+
function offboard(ids) {
|
|
1675
|
+
for (const id of ids) selectedIds.delete(id);
|
|
1676
|
+
registry.offboard(ids);
|
|
1677
|
+
}
|
|
1678
|
+
function reset() {
|
|
1679
|
+
selectedIds.clear();
|
|
1680
|
+
}
|
|
1681
|
+
function clear() {
|
|
1682
|
+
reset();
|
|
1683
|
+
registry.clear();
|
|
1684
|
+
}
|
|
1685
|
+
function dispose() {
|
|
1686
|
+
reset();
|
|
1687
|
+
registry.dispose();
|
|
1688
|
+
}
|
|
1689
|
+
return {
|
|
1690
|
+
...registry,
|
|
1691
|
+
disabled,
|
|
1692
|
+
selectedIds,
|
|
1693
|
+
selectedItems,
|
|
1694
|
+
selectedValues,
|
|
1695
|
+
register,
|
|
1696
|
+
onboard,
|
|
1697
|
+
unregister,
|
|
1698
|
+
offboard,
|
|
1699
|
+
clear,
|
|
1700
|
+
dispose,
|
|
1701
|
+
reset,
|
|
1702
|
+
select,
|
|
1703
|
+
unselect,
|
|
1704
|
+
toggle,
|
|
1705
|
+
selected,
|
|
1706
|
+
apply,
|
|
1707
|
+
get size() {
|
|
1708
|
+
return registry.size;
|
|
1709
|
+
}
|
|
1710
|
+
};
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1533
1713
|
//#endregion
|
|
1534
1714
|
//#region src/composables/createSelection/index.ts
|
|
1535
1715
|
/**
|
|
1536
1716
|
* @module useSelection
|
|
1537
1717
|
*
|
|
1538
1718
|
* @remarks
|
|
1539
|
-
*
|
|
1719
|
+
* Selection composable that extends createModel with multi-select,
|
|
1720
|
+
* mandatory enforcement, auto-enrollment, and ticket self-methods.
|
|
1540
1721
|
*
|
|
1541
1722
|
* Key features:
|
|
1542
1723
|
* - Set-based selectedIds for O(1) selection checks
|
|
1724
|
+
* - Single or multi-select mode
|
|
1543
1725
|
* - Mandatory selection mode (prevents deselecting last item)
|
|
1544
1726
|
* - Auto-enrollment option (selects non-disabled items on register)
|
|
1545
1727
|
* - Disabled item filtering
|
|
1546
1728
|
* - Computed selectedItems and selectedValues Sets
|
|
1729
|
+
* - Ticket self-methods: select(), unselect(), toggle()
|
|
1547
1730
|
*
|
|
1548
|
-
* Extends
|
|
1731
|
+
* Extends createModel and serves as the base for useSingle, useGroup, useStep, and useFeatures.
|
|
1549
1732
|
*/
|
|
1550
1733
|
/**
|
|
1551
1734
|
* Creates a new selection instance for managing multiple selected items.
|
|
1552
1735
|
*
|
|
1553
|
-
* Extends `
|
|
1736
|
+
* Extends `createModel` with multi-select, mandatory enforcement,
|
|
1737
|
+
* auto-enrollment, and ticket self-methods.
|
|
1554
1738
|
* Supports disabled items, mandatory selection enforcement, and auto-enrollment.
|
|
1555
1739
|
*
|
|
1556
1740
|
* @param options The options for the selection instance.
|
|
@@ -1571,7 +1755,7 @@ function useRegistry(namespace = "v0:registry") {
|
|
|
1571
1755
|
* - Enroll option auto-selects all non-disabled items on registration
|
|
1572
1756
|
*
|
|
1573
1757
|
* **Inheritance Chain:**
|
|
1574
|
-
* `
|
|
1758
|
+
* `createRegistry` → `createModel` → `createSelection` → `createSingle`/`createGroup` → `createStep`
|
|
1575
1759
|
*
|
|
1576
1760
|
* @see https://0.vuetifyjs.com/composables/selection/use-selection
|
|
1577
1761
|
*
|
|
@@ -1613,96 +1797,86 @@ function useRegistry(namespace = "v0:registry") {
|
|
|
1613
1797
|
* ```
|
|
1614
1798
|
*/
|
|
1615
1799
|
function createSelection(_options = {}) {
|
|
1616
|
-
const {
|
|
1617
|
-
const
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
return new Set(Array.from(selectedIds).map((id) => registry.get(id)).filter((item) => !/* @__PURE__ */ isUndefined(item)));
|
|
1621
|
-
});
|
|
1622
|
-
const selectedValues = computed(() => {
|
|
1623
|
-
return new Set(Array.from(selectedItems.value).map((item) => item.value));
|
|
1800
|
+
const { enroll = false, mandatory = false, multiple = false, ...options } = _options;
|
|
1801
|
+
const model = createModel({
|
|
1802
|
+
...options,
|
|
1803
|
+
enroll: false
|
|
1624
1804
|
});
|
|
1625
1805
|
function seek(direction = "first", from) {
|
|
1626
|
-
return
|
|
1806
|
+
return model.seek(direction, from, (ticket) => !toValue(ticket.disabled));
|
|
1627
1807
|
}
|
|
1628
1808
|
function mandate() {
|
|
1629
|
-
if (!toValue(mandatory) ||
|
|
1809
|
+
if (!toValue(mandatory) || model.size === 0 || model.selectedIds.size > 0) return;
|
|
1630
1810
|
const ticket = seek("first");
|
|
1631
1811
|
if (ticket) select(ticket.id);
|
|
1632
1812
|
}
|
|
1633
1813
|
function select(id) {
|
|
1634
|
-
if (toValue(disabled)) return;
|
|
1635
|
-
const item =
|
|
1814
|
+
if (toValue(model.disabled)) return;
|
|
1815
|
+
const item = model.get(id);
|
|
1636
1816
|
if (!item || toValue(item.disabled)) return;
|
|
1637
|
-
if (!toValue(multiple)) selectedIds.clear();
|
|
1638
|
-
selectedIds.add(id);
|
|
1817
|
+
if (!toValue(multiple)) model.selectedIds.clear();
|
|
1818
|
+
model.selectedIds.add(id);
|
|
1639
1819
|
}
|
|
1640
1820
|
function unselect(id) {
|
|
1641
|
-
if (toValue(disabled)) return;
|
|
1642
|
-
if (toValue(mandatory) && selectedIds.size === 1) return;
|
|
1643
|
-
selectedIds.delete(id);
|
|
1821
|
+
if (toValue(model.disabled)) return;
|
|
1822
|
+
if (toValue(mandatory) && model.selectedIds.size === 1) return;
|
|
1823
|
+
model.selectedIds.delete(id);
|
|
1644
1824
|
}
|
|
1645
1825
|
function toggle(id) {
|
|
1646
|
-
if (toValue(disabled)) return;
|
|
1647
|
-
if (
|
|
1826
|
+
if (toValue(model.disabled)) return;
|
|
1827
|
+
if (model.selectedIds.has(id)) unselect(id);
|
|
1648
1828
|
else select(id);
|
|
1649
1829
|
}
|
|
1650
|
-
function
|
|
1651
|
-
|
|
1830
|
+
function apply(values, options$1) {
|
|
1831
|
+
const isMultiple = options$1?.multiple ?? toValue(multiple);
|
|
1832
|
+
const currentIds = new Set(model.selectedIds);
|
|
1833
|
+
const targetIds = /* @__PURE__ */ new Set();
|
|
1834
|
+
for (const value of values) {
|
|
1835
|
+
const ids = model.browse(toRaw(value));
|
|
1836
|
+
if (ids) for (const id of ids) targetIds.add(id);
|
|
1837
|
+
}
|
|
1838
|
+
if (isMultiple) {
|
|
1839
|
+
for (const id of currentIds.difference(targetIds)) model.selectedIds.delete(id);
|
|
1840
|
+
for (const id of targetIds.difference(currentIds)) model.selectedIds.add(id);
|
|
1841
|
+
} else {
|
|
1842
|
+
const next = targetIds.values().next().value;
|
|
1843
|
+
const last = currentIds.values().next().value;
|
|
1844
|
+
if (!/* @__PURE__ */ isUndefined(last)) unselect(last);
|
|
1845
|
+
if (!/* @__PURE__ */ isUndefined(next)) select(next);
|
|
1846
|
+
}
|
|
1652
1847
|
}
|
|
1653
1848
|
function register(registration = {}) {
|
|
1654
1849
|
const id = registration.id ?? /* @__PURE__ */ useId();
|
|
1655
|
-
const
|
|
1656
|
-
disabled: false,
|
|
1850
|
+
const decorated = {
|
|
1657
1851
|
select: () => select(id),
|
|
1658
1852
|
unselect: () => unselect(id),
|
|
1659
1853
|
toggle: () => toggle(id),
|
|
1660
|
-
isSelected: toRef(() => selected(id)),
|
|
1661
1854
|
...registration,
|
|
1662
1855
|
id
|
|
1663
1856
|
};
|
|
1664
|
-
const ticket =
|
|
1665
|
-
if (toValue(enroll) && !toValue(disabled) && !toValue(
|
|
1857
|
+
const ticket = model.register(decorated);
|
|
1858
|
+
if (toValue(enroll) && !toValue(model.disabled) && !toValue(ticket.disabled)) select(ticket.id);
|
|
1666
1859
|
if (toValue(mandatory) === "force") mandate();
|
|
1667
1860
|
return ticket;
|
|
1668
1861
|
}
|
|
1669
|
-
function unregister(id) {
|
|
1670
|
-
selectedIds.delete(id);
|
|
1671
|
-
registry.unregister(id);
|
|
1672
|
-
}
|
|
1673
|
-
function offboard(ids) {
|
|
1674
|
-
for (const id of ids) selectedIds.delete(id);
|
|
1675
|
-
registry.offboard(ids);
|
|
1676
|
-
}
|
|
1677
1862
|
function onboard(registrations) {
|
|
1678
|
-
const tickets =
|
|
1863
|
+
const tickets = model.batch(() => registrations.map((registration) => register(registration)));
|
|
1679
1864
|
if (toValue(mandatory) === "force") mandate();
|
|
1680
1865
|
return tickets;
|
|
1681
1866
|
}
|
|
1682
|
-
function reset() {
|
|
1683
|
-
registry.clear();
|
|
1684
|
-
selectedIds.clear();
|
|
1685
|
-
mandate();
|
|
1686
|
-
}
|
|
1687
1867
|
return {
|
|
1688
|
-
...
|
|
1689
|
-
|
|
1690
|
-
selectedIds,
|
|
1691
|
-
selectedItems,
|
|
1692
|
-
selectedValues,
|
|
1868
|
+
...model,
|
|
1869
|
+
multiple,
|
|
1693
1870
|
register,
|
|
1694
|
-
unregister,
|
|
1695
1871
|
onboard,
|
|
1696
|
-
offboard,
|
|
1697
|
-
reset,
|
|
1698
|
-
mandate,
|
|
1699
|
-
seek,
|
|
1700
1872
|
select,
|
|
1701
1873
|
unselect,
|
|
1702
1874
|
toggle,
|
|
1703
|
-
|
|
1875
|
+
apply,
|
|
1876
|
+
mandate,
|
|
1877
|
+
seek,
|
|
1704
1878
|
get size() {
|
|
1705
|
-
return
|
|
1879
|
+
return model.size;
|
|
1706
1880
|
}
|
|
1707
1881
|
};
|
|
1708
1882
|
}
|
|
@@ -1788,7 +1962,7 @@ function useSelection(namespace = "v0:selection") {
|
|
|
1788
1962
|
//#endregion
|
|
1789
1963
|
//#region src/components/Avatar/AvatarRoot.vue
|
|
1790
1964
|
const [useAvatarRoot, provideAvatarRoot] = createContext();
|
|
1791
|
-
const _sfc_main$
|
|
1965
|
+
const _sfc_main$67 = /* @__PURE__ */ defineComponent({
|
|
1792
1966
|
name: "AvatarRoot",
|
|
1793
1967
|
__name: "AvatarRoot",
|
|
1794
1968
|
props: {
|
|
@@ -1813,11 +1987,11 @@ const _sfc_main$53 = /* @__PURE__ */ defineComponent({
|
|
|
1813
1987
|
};
|
|
1814
1988
|
}
|
|
1815
1989
|
});
|
|
1816
|
-
var AvatarRoot_default = _sfc_main$
|
|
1990
|
+
var AvatarRoot_default = _sfc_main$67;
|
|
1817
1991
|
|
|
1818
1992
|
//#endregion
|
|
1819
1993
|
//#region src/components/Avatar/AvatarFallback.vue
|
|
1820
|
-
const _sfc_main$
|
|
1994
|
+
const _sfc_main$66 = /* @__PURE__ */ defineComponent({
|
|
1821
1995
|
name: "AvatarFallback",
|
|
1822
1996
|
__name: "AvatarFallback",
|
|
1823
1997
|
props: {
|
|
@@ -1842,11 +2016,11 @@ const _sfc_main$52 = /* @__PURE__ */ defineComponent({
|
|
|
1842
2016
|
};
|
|
1843
2017
|
}
|
|
1844
2018
|
});
|
|
1845
|
-
var AvatarFallback_default = _sfc_main$
|
|
2019
|
+
var AvatarFallback_default = _sfc_main$66;
|
|
1846
2020
|
|
|
1847
2021
|
//#endregion
|
|
1848
2022
|
//#region src/components/Avatar/AvatarImage.vue
|
|
1849
|
-
const _sfc_main$
|
|
2023
|
+
const _sfc_main$65 = /* @__PURE__ */ defineComponent({
|
|
1850
2024
|
name: "AvatarImage",
|
|
1851
2025
|
inheritAttrs: false,
|
|
1852
2026
|
__name: "AvatarImage",
|
|
@@ -1906,7 +2080,7 @@ const _sfc_main$51 = /* @__PURE__ */ defineComponent({
|
|
|
1906
2080
|
};
|
|
1907
2081
|
}
|
|
1908
2082
|
});
|
|
1909
|
-
var AvatarImage_default = _sfc_main$
|
|
2083
|
+
var AvatarImage_default = _sfc_main$65;
|
|
1910
2084
|
|
|
1911
2085
|
//#endregion
|
|
1912
2086
|
//#region src/components/Avatar/index.ts
|
|
@@ -2262,7 +2436,8 @@ function useBreadcrumbs(namespace = "v0:breadcrumbs") {
|
|
|
2262
2436
|
*
|
|
2263
2437
|
* @param registry The registry instance to proxy.
|
|
2264
2438
|
* @param options The options for the proxy registry.
|
|
2265
|
-
* @template Z The type
|
|
2439
|
+
* @template Z The input ticket type (what users provide to register).
|
|
2440
|
+
* @template E The output ticket type (what users receive from get/values).
|
|
2266
2441
|
* @returns A proxy registry with reactive objects.
|
|
2267
2442
|
*
|
|
2268
2443
|
* @see https://0.vuetifyjs.com/composables/registration/use-proxy-registry
|
|
@@ -2721,6 +2896,41 @@ const [createHydrationContext, createHydrationPlugin, useHydration] = createPlug
|
|
|
2721
2896
|
}
|
|
2722
2897
|
});
|
|
2723
2898
|
|
|
2899
|
+
//#endregion
|
|
2900
|
+
//#region src/composables/toElement/index.ts
|
|
2901
|
+
/**
|
|
2902
|
+
* Resolves a {@link MaybeElementRef} to a DOM Element or undefined.
|
|
2903
|
+
*
|
|
2904
|
+
* Handles:
|
|
2905
|
+
* - `Ref<Element>`, `ShallowRef<HTMLElement>`, getter functions
|
|
2906
|
+
* - Vue component instances (extracts `$el`)
|
|
2907
|
+
* - Raw DOM elements (pass-through)
|
|
2908
|
+
* - null/undefined (returns undefined)
|
|
2909
|
+
*
|
|
2910
|
+
* @param target The element ref, getter, or raw value to resolve
|
|
2911
|
+
* @returns The resolved DOM Element, or undefined if not available
|
|
2912
|
+
*
|
|
2913
|
+
* @see https://0.vuetifyjs.com/composables/transformers/to-element
|
|
2914
|
+
*
|
|
2915
|
+
* @example
|
|
2916
|
+
* ```ts
|
|
2917
|
+
* import { toElement } from '@vuetify/v0'
|
|
2918
|
+
*
|
|
2919
|
+
* const el = shallowRef<HTMLElement | null>(null)
|
|
2920
|
+
* toElement(el) // HTMLElement | undefined
|
|
2921
|
+
*
|
|
2922
|
+
* const component = ref<ComponentPublicInstance>()
|
|
2923
|
+
* toElement(component) // Element | undefined (from $el)
|
|
2924
|
+
* ```
|
|
2925
|
+
*/
|
|
2926
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2927
|
+
function toElement(target) {
|
|
2928
|
+
const raw = typeof target === "function" ? target() : target && typeof target === "object" && "value" in target ? target.value : target;
|
|
2929
|
+
if (!raw) return void 0;
|
|
2930
|
+
if (raw instanceof Element) return raw;
|
|
2931
|
+
if ("$el" in raw) return raw.$el;
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2724
2934
|
//#endregion
|
|
2725
2935
|
//#region src/composables/createObserver/index.ts
|
|
2726
2936
|
/**
|
|
@@ -2738,7 +2948,7 @@ const [createHydrationContext, createHydrationPlugin, useHydration] = createPlug
|
|
|
2738
2948
|
*/
|
|
2739
2949
|
function createObserver(target, userCallback, config) {
|
|
2740
2950
|
const { isHydrated } = useHydration();
|
|
2741
|
-
const
|
|
2951
|
+
const resolved = toRef(() => /* @__PURE__ */ toElement(target));
|
|
2742
2952
|
const observer = shallowRef(void 0);
|
|
2743
2953
|
const isPaused = shallowRef(false);
|
|
2744
2954
|
const isActive = toRef(() => !!observer.value);
|
|
@@ -2751,11 +2961,12 @@ function createObserver(target, userCallback, config) {
|
|
|
2751
2961
|
}
|
|
2752
2962
|
function setup() {
|
|
2753
2963
|
if (/* @__PURE__ */ isNull(observer.value)) return;
|
|
2754
|
-
|
|
2964
|
+
const el = resolved.value;
|
|
2965
|
+
if (!isHydrated.value || !config.supports || !/* @__PURE__ */ isElement(el) || isPaused.value) return;
|
|
2755
2966
|
observer.value = config.create(invoke);
|
|
2756
|
-
config.observe(observer.value,
|
|
2967
|
+
config.observe(observer.value, el);
|
|
2757
2968
|
if (config.immediate) {
|
|
2758
|
-
const entries = config.immediate(
|
|
2969
|
+
const entries = config.immediate(el);
|
|
2759
2970
|
if (config.onceIncludesImmediate) invoke(entries);
|
|
2760
2971
|
else {
|
|
2761
2972
|
config.onEntry?.(entries);
|
|
@@ -2763,13 +2974,13 @@ function createObserver(target, userCallback, config) {
|
|
|
2763
2974
|
}
|
|
2764
2975
|
}
|
|
2765
2976
|
}
|
|
2766
|
-
watch(
|
|
2977
|
+
watch(resolved, (el, oldEl) => {
|
|
2767
2978
|
if (oldEl || observer.value) cleanup();
|
|
2768
2979
|
if (isHydrated.value && /* @__PURE__ */ isElement(el)) setup();
|
|
2769
2980
|
}, { immediate: true });
|
|
2770
2981
|
let stopHydrationWatch;
|
|
2771
2982
|
if (!isHydrated.value) stopHydrationWatch = watch(() => isHydrated.value, (hydrated) => {
|
|
2772
|
-
if (hydrated && /* @__PURE__ */ isElement(
|
|
2983
|
+
if (hydrated && /* @__PURE__ */ isElement(resolved.value) && !observer.value) {
|
|
2773
2984
|
setup();
|
|
2774
2985
|
stopHydrationWatch?.();
|
|
2775
2986
|
stopHydrationWatch = void 0;
|
|
@@ -3523,7 +3734,7 @@ const [createLocaleContext, createLocalePlugin, useLocale] = createPluginContext
|
|
|
3523
3734
|
//#endregion
|
|
3524
3735
|
//#region src/components/Breadcrumbs/BreadcrumbsRoot.vue
|
|
3525
3736
|
const [useBreadcrumbsRoot, provideBreadcrumbsRoot] = createContext();
|
|
3526
|
-
const _sfc_main$
|
|
3737
|
+
const _sfc_main$64 = /* @__PURE__ */ defineComponent({
|
|
3527
3738
|
name: "BreadcrumbsRoot",
|
|
3528
3739
|
__name: "BreadcrumbsRoot",
|
|
3529
3740
|
props: {
|
|
@@ -3662,11 +3873,11 @@ const _sfc_main$50 = /* @__PURE__ */ defineComponent({
|
|
|
3662
3873
|
};
|
|
3663
3874
|
}
|
|
3664
3875
|
});
|
|
3665
|
-
var BreadcrumbsRoot_default = _sfc_main$
|
|
3876
|
+
var BreadcrumbsRoot_default = _sfc_main$64;
|
|
3666
3877
|
|
|
3667
3878
|
//#endregion
|
|
3668
3879
|
//#region src/components/Breadcrumbs/BreadcrumbsDivider.vue
|
|
3669
|
-
const _sfc_main$
|
|
3880
|
+
const _sfc_main$63 = /* @__PURE__ */ defineComponent({
|
|
3670
3881
|
name: "BreadcrumbsDivider",
|
|
3671
3882
|
__name: "BreadcrumbsDivider",
|
|
3672
3883
|
props: {
|
|
@@ -3713,11 +3924,11 @@ const _sfc_main$49 = /* @__PURE__ */ defineComponent({
|
|
|
3713
3924
|
};
|
|
3714
3925
|
}
|
|
3715
3926
|
});
|
|
3716
|
-
var BreadcrumbsDivider_default = _sfc_main$
|
|
3927
|
+
var BreadcrumbsDivider_default = _sfc_main$63;
|
|
3717
3928
|
|
|
3718
3929
|
//#endregion
|
|
3719
3930
|
//#region src/components/Breadcrumbs/BreadcrumbsEllipsis.vue
|
|
3720
|
-
const _sfc_main$
|
|
3931
|
+
const _sfc_main$62 = /* @__PURE__ */ defineComponent({
|
|
3721
3932
|
name: "BreadcrumbsEllipsis",
|
|
3722
3933
|
__name: "BreadcrumbsEllipsis",
|
|
3723
3934
|
props: {
|
|
@@ -3771,11 +3982,11 @@ const _sfc_main$48 = /* @__PURE__ */ defineComponent({
|
|
|
3771
3982
|
};
|
|
3772
3983
|
}
|
|
3773
3984
|
});
|
|
3774
|
-
var BreadcrumbsEllipsis_default = _sfc_main$
|
|
3985
|
+
var BreadcrumbsEllipsis_default = _sfc_main$62;
|
|
3775
3986
|
|
|
3776
3987
|
//#endregion
|
|
3777
3988
|
//#region src/components/Breadcrumbs/BreadcrumbsItem.vue
|
|
3778
|
-
const _sfc_main$
|
|
3989
|
+
const _sfc_main$61 = /* @__PURE__ */ defineComponent({
|
|
3779
3990
|
name: "BreadcrumbsItem",
|
|
3780
3991
|
__name: "BreadcrumbsItem",
|
|
3781
3992
|
props: {
|
|
@@ -3825,11 +4036,11 @@ const _sfc_main$47 = /* @__PURE__ */ defineComponent({
|
|
|
3825
4036
|
};
|
|
3826
4037
|
}
|
|
3827
4038
|
});
|
|
3828
|
-
var BreadcrumbsItem_default = _sfc_main$
|
|
4039
|
+
var BreadcrumbsItem_default = _sfc_main$61;
|
|
3829
4040
|
|
|
3830
4041
|
//#endregion
|
|
3831
4042
|
//#region src/components/Breadcrumbs/BreadcrumbsLink.vue
|
|
3832
|
-
const _sfc_main$
|
|
4043
|
+
const _sfc_main$60 = /* @__PURE__ */ defineComponent({
|
|
3833
4044
|
name: "BreadcrumbsLink",
|
|
3834
4045
|
__name: "BreadcrumbsLink",
|
|
3835
4046
|
props: {
|
|
@@ -3848,11 +4059,11 @@ const _sfc_main$46 = /* @__PURE__ */ defineComponent({
|
|
|
3848
4059
|
};
|
|
3849
4060
|
}
|
|
3850
4061
|
});
|
|
3851
|
-
var BreadcrumbsLink_default = _sfc_main$
|
|
4062
|
+
var BreadcrumbsLink_default = _sfc_main$60;
|
|
3852
4063
|
|
|
3853
4064
|
//#endregion
|
|
3854
4065
|
//#region src/components/Breadcrumbs/BreadcrumbsList.vue
|
|
3855
|
-
const _sfc_main$
|
|
4066
|
+
const _sfc_main$59 = /* @__PURE__ */ defineComponent({
|
|
3856
4067
|
name: "BreadcrumbsList",
|
|
3857
4068
|
__name: "BreadcrumbsList",
|
|
3858
4069
|
props: {
|
|
@@ -3872,11 +4083,11 @@ const _sfc_main$45 = /* @__PURE__ */ defineComponent({
|
|
|
3872
4083
|
};
|
|
3873
4084
|
}
|
|
3874
4085
|
});
|
|
3875
|
-
var BreadcrumbsList_default = _sfc_main$
|
|
4086
|
+
var BreadcrumbsList_default = _sfc_main$59;
|
|
3876
4087
|
|
|
3877
4088
|
//#endregion
|
|
3878
4089
|
//#region src/components/Breadcrumbs/BreadcrumbsPage.vue
|
|
3879
|
-
const _sfc_main$
|
|
4090
|
+
const _sfc_main$58 = /* @__PURE__ */ defineComponent({
|
|
3880
4091
|
name: "BreadcrumbsPage",
|
|
3881
4092
|
__name: "BreadcrumbsPage",
|
|
3882
4093
|
props: {
|
|
@@ -3896,7 +4107,7 @@ const _sfc_main$44 = /* @__PURE__ */ defineComponent({
|
|
|
3896
4107
|
};
|
|
3897
4108
|
}
|
|
3898
4109
|
});
|
|
3899
|
-
var BreadcrumbsPage_default = _sfc_main$
|
|
4110
|
+
var BreadcrumbsPage_default = _sfc_main$58;
|
|
3900
4111
|
|
|
3901
4112
|
//#endregion
|
|
3902
4113
|
//#region src/components/Breadcrumbs/index.ts
|
|
@@ -3921,23 +4132,22 @@ const Breadcrumbs = {
|
|
|
3921
4132
|
* @module useProxyModel
|
|
3922
4133
|
*
|
|
3923
4134
|
* @remarks
|
|
3924
|
-
* Proxy composable for bidirectional sync between
|
|
4135
|
+
* Proxy composable for bidirectional sync between a model context and v-model.
|
|
3925
4136
|
*
|
|
3926
4137
|
* Key features:
|
|
3927
4138
|
* - Bidirectional synchronization
|
|
3928
4139
|
* - Array and single-value modes
|
|
3929
4140
|
* - Automatic cleanup on scope disposal
|
|
3930
|
-
* -
|
|
4141
|
+
* - Works with any ModelContext (Selection, Slider, etc.)
|
|
3931
4142
|
*
|
|
3932
|
-
* Bridges the gap between
|
|
4143
|
+
* Bridges the gap between model composables and Vue's v-model.
|
|
3933
4144
|
*/
|
|
3934
4145
|
/**
|
|
3935
|
-
* Syncs a ref with a
|
|
4146
|
+
* Syncs a ref with a model context bidirectionally.
|
|
3936
4147
|
*
|
|
3937
|
-
* @param
|
|
4148
|
+
* @param context The model context to bind to.
|
|
3938
4149
|
* @param model The ref to sync.
|
|
3939
4150
|
* @param options The options for the proxy model.
|
|
3940
|
-
* @template Z The type of the selection ticket.
|
|
3941
4151
|
* @returns A function to stop the sync.
|
|
3942
4152
|
*
|
|
3943
4153
|
* @see https://0.vuetifyjs.com/composables/forms/use-proxy-model
|
|
@@ -3956,8 +4166,8 @@ const Breadcrumbs = {
|
|
|
3956
4166
|
* const stop = useProxyModel(registry, model)
|
|
3957
4167
|
* ```
|
|
3958
4168
|
*/
|
|
3959
|
-
function useProxyModel(
|
|
3960
|
-
const multiple = options?.multiple ?? false;
|
|
4169
|
+
function useProxyModel(context, model, options) {
|
|
4170
|
+
const multiple = options?.multiple ?? context.multiple ?? false;
|
|
3961
4171
|
const _transformIn = options?.transformIn;
|
|
3962
4172
|
const _transformOut = options?.transformOut;
|
|
3963
4173
|
function transformIn(val) {
|
|
@@ -3968,39 +4178,20 @@ function useProxyModel(registry, model, options) {
|
|
|
3968
4178
|
if (/* @__PURE__ */ isFunction(_transformOut)) return _transformOut(val);
|
|
3969
4179
|
return toValue(multiple) ? val : val[0];
|
|
3970
4180
|
}
|
|
4181
|
+
const applyOptions = toValue(multiple) === toValue(context.multiple ?? false) ? void 0 : { multiple: toValue(multiple) };
|
|
3971
4182
|
const modelAsArray = transformIn(model);
|
|
3972
4183
|
const pending = new Set(modelAsArray);
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
if (ids) {
|
|
3977
|
-
for (const id of ids) registry.select(id);
|
|
3978
|
-
pending.delete(value);
|
|
3979
|
-
}
|
|
3980
|
-
}
|
|
3981
|
-
const registryWatch = watch(registry.selectedValues, (val) => {
|
|
4184
|
+
context.apply(modelAsArray, applyOptions);
|
|
4185
|
+
for (const value of modelAsArray) if (Array.from(context.selectedValues.value).includes(value)) pending.delete(value);
|
|
4186
|
+
const contextWatch = watch(context.selectedValues, (val) => {
|
|
3982
4187
|
modelWatch.pause();
|
|
3983
4188
|
model.value = transformOut(Array.from(toValue(val)));
|
|
3984
4189
|
modelWatch.resume();
|
|
3985
4190
|
}, { flush: "sync" });
|
|
3986
4191
|
const modelWatch = watch(model, (val) => {
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
for (const value of transformIn(val)) {
|
|
3991
|
-
const ids = registry.browse(toRaw(value));
|
|
3992
|
-
if (ids) for (const id of ids) targetIds.add(id);
|
|
3993
|
-
}
|
|
3994
|
-
if (toValue(multiple)) {
|
|
3995
|
-
for (const id of currentIds.difference(targetIds)) registry.selectedIds.delete(id);
|
|
3996
|
-
for (const id of targetIds.difference(currentIds)) registry.selectedIds.add(id);
|
|
3997
|
-
} else {
|
|
3998
|
-
const next = targetIds.values().next().value;
|
|
3999
|
-
const last = currentIds.values().next().value;
|
|
4000
|
-
if (!/* @__PURE__ */ isUndefined(last)) registry.unselect(last);
|
|
4001
|
-
if (!/* @__PURE__ */ isUndefined(next)) registry.select(next);
|
|
4002
|
-
}
|
|
4003
|
-
registryWatch.resume();
|
|
4192
|
+
contextWatch.pause();
|
|
4193
|
+
context.apply(transformIn(val), applyOptions);
|
|
4194
|
+
contextWatch.resume();
|
|
4004
4195
|
}, {
|
|
4005
4196
|
flush: "sync",
|
|
4006
4197
|
deep: toValue(multiple)
|
|
@@ -4008,18 +4199,18 @@ function useProxyModel(registry, model, options) {
|
|
|
4008
4199
|
function onRegister(data) {
|
|
4009
4200
|
const ticket = data;
|
|
4010
4201
|
if (!pending.has(ticket.value) || toValue(ticket.disabled)) return;
|
|
4011
|
-
|
|
4202
|
+
contextWatch.pause();
|
|
4012
4203
|
modelWatch.pause();
|
|
4013
|
-
|
|
4204
|
+
context.select?.(ticket.id);
|
|
4014
4205
|
pending.delete(ticket.value);
|
|
4015
4206
|
modelWatch.resume();
|
|
4016
|
-
|
|
4207
|
+
contextWatch.resume();
|
|
4017
4208
|
}
|
|
4018
|
-
|
|
4209
|
+
context.on?.("register:ticket", onRegister);
|
|
4019
4210
|
function stop() {
|
|
4020
|
-
|
|
4211
|
+
contextWatch();
|
|
4021
4212
|
modelWatch();
|
|
4022
|
-
|
|
4213
|
+
context.off?.("register:ticket", onRegister);
|
|
4023
4214
|
}
|
|
4024
4215
|
onScopeDispose(stop, true);
|
|
4025
4216
|
return stop;
|
|
@@ -4028,7 +4219,7 @@ function useProxyModel(registry, model, options) {
|
|
|
4028
4219
|
//#endregion
|
|
4029
4220
|
//#region src/components/Checkbox/CheckboxGroup.vue
|
|
4030
4221
|
const [useCheckboxGroup, provideCheckboxGroup] = createContext();
|
|
4031
|
-
const _sfc_main$
|
|
4222
|
+
const _sfc_main$57 = /* @__PURE__ */ defineComponent({
|
|
4032
4223
|
name: "CheckboxGroup",
|
|
4033
4224
|
__name: "CheckboxGroup",
|
|
4034
4225
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -4094,12 +4285,12 @@ const _sfc_main$43 = /* @__PURE__ */ defineComponent({
|
|
|
4094
4285
|
};
|
|
4095
4286
|
}
|
|
4096
4287
|
});
|
|
4097
|
-
var CheckboxGroup_default = _sfc_main$
|
|
4288
|
+
var CheckboxGroup_default = _sfc_main$57;
|
|
4098
4289
|
|
|
4099
4290
|
//#endregion
|
|
4100
4291
|
//#region src/components/Checkbox/CheckboxRoot.vue
|
|
4101
4292
|
const [useCheckboxRoot, provideCheckboxRoot] = createContext();
|
|
4102
|
-
const _sfc_main$
|
|
4293
|
+
const _sfc_main$56 = /* @__PURE__ */ defineComponent({
|
|
4103
4294
|
name: "CheckboxRoot",
|
|
4104
4295
|
inheritAttrs: false,
|
|
4105
4296
|
__name: "CheckboxRoot",
|
|
@@ -4233,18 +4424,18 @@ const _sfc_main$42 = /* @__PURE__ */ defineComponent({
|
|
|
4233
4424
|
};
|
|
4234
4425
|
}
|
|
4235
4426
|
});
|
|
4236
|
-
var CheckboxRoot_default = _sfc_main$
|
|
4427
|
+
var CheckboxRoot_default = _sfc_main$56;
|
|
4237
4428
|
|
|
4238
4429
|
//#endregion
|
|
4239
4430
|
//#region src/components/Checkbox/CheckboxHiddenInput.vue
|
|
4240
|
-
const _hoisted_1$
|
|
4431
|
+
const _hoisted_1$3 = [
|
|
4241
4432
|
"checked",
|
|
4242
4433
|
"disabled",
|
|
4243
4434
|
"form",
|
|
4244
4435
|
"name",
|
|
4245
4436
|
"value"
|
|
4246
4437
|
];
|
|
4247
|
-
const visuallyHiddenStyle$
|
|
4438
|
+
const visuallyHiddenStyle$2 = {
|
|
4248
4439
|
position: "absolute",
|
|
4249
4440
|
width: "1px",
|
|
4250
4441
|
height: "1px",
|
|
@@ -4255,7 +4446,7 @@ const visuallyHiddenStyle$1 = {
|
|
|
4255
4446
|
whiteSpace: "nowrap",
|
|
4256
4447
|
border: "0"
|
|
4257
4448
|
};
|
|
4258
|
-
const _sfc_main$
|
|
4449
|
+
const _sfc_main$55 = /* @__PURE__ */ defineComponent({
|
|
4259
4450
|
name: "CheckboxHiddenInput",
|
|
4260
4451
|
__name: "CheckboxHiddenInput",
|
|
4261
4452
|
props: {
|
|
@@ -4283,19 +4474,19 @@ const _sfc_main$41 = /* @__PURE__ */ defineComponent({
|
|
|
4283
4474
|
form: form.value,
|
|
4284
4475
|
inert: "",
|
|
4285
4476
|
name: name.value,
|
|
4286
|
-
style: visuallyHiddenStyle$
|
|
4477
|
+
style: visuallyHiddenStyle$2,
|
|
4287
4478
|
tabindex: "-1",
|
|
4288
4479
|
type: "checkbox",
|
|
4289
4480
|
value: value.value
|
|
4290
|
-
}, null, 8, _hoisted_1$
|
|
4481
|
+
}, null, 8, _hoisted_1$3);
|
|
4291
4482
|
};
|
|
4292
4483
|
}
|
|
4293
4484
|
});
|
|
4294
|
-
var CheckboxHiddenInput_default = _sfc_main$
|
|
4485
|
+
var CheckboxHiddenInput_default = _sfc_main$55;
|
|
4295
4486
|
|
|
4296
4487
|
//#endregion
|
|
4297
4488
|
//#region src/components/Checkbox/CheckboxIndicator.vue
|
|
4298
|
-
const _sfc_main$
|
|
4489
|
+
const _sfc_main$54 = /* @__PURE__ */ defineComponent({
|
|
4299
4490
|
name: "CheckboxIndicator",
|
|
4300
4491
|
__name: "CheckboxIndicator",
|
|
4301
4492
|
props: {
|
|
@@ -4328,11 +4519,11 @@ const _sfc_main$40 = /* @__PURE__ */ defineComponent({
|
|
|
4328
4519
|
};
|
|
4329
4520
|
}
|
|
4330
4521
|
});
|
|
4331
|
-
var CheckboxIndicator_default = _sfc_main$
|
|
4522
|
+
var CheckboxIndicator_default = _sfc_main$54;
|
|
4332
4523
|
|
|
4333
4524
|
//#endregion
|
|
4334
4525
|
//#region src/components/Checkbox/CheckboxSelectAll.vue
|
|
4335
|
-
const _sfc_main$
|
|
4526
|
+
const _sfc_main$53 = /* @__PURE__ */ defineComponent({
|
|
4336
4527
|
name: "CheckboxSelectAll",
|
|
4337
4528
|
inheritAttrs: false,
|
|
4338
4529
|
__name: "CheckboxSelectAll",
|
|
@@ -4418,7 +4609,7 @@ const _sfc_main$39 = /* @__PURE__ */ defineComponent({
|
|
|
4418
4609
|
};
|
|
4419
4610
|
}
|
|
4420
4611
|
});
|
|
4421
|
-
var CheckboxSelectAll_default = _sfc_main$
|
|
4612
|
+
var CheckboxSelectAll_default = _sfc_main$53;
|
|
4422
4613
|
|
|
4423
4614
|
//#endregion
|
|
4424
4615
|
//#region src/components/Checkbox/index.ts
|
|
@@ -4454,7 +4645,7 @@ const Checkbox = {
|
|
|
4454
4645
|
//#endregion
|
|
4455
4646
|
//#region src/components/Dialog/DialogRoot.vue
|
|
4456
4647
|
const [useDialogContext, provideDialogContext] = createContext();
|
|
4457
|
-
const _sfc_main$
|
|
4648
|
+
const _sfc_main$52 = /* @__PURE__ */ defineComponent({
|
|
4458
4649
|
name: "DialogRoot",
|
|
4459
4650
|
__name: "DialogRoot",
|
|
4460
4651
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -4506,11 +4697,11 @@ const _sfc_main$38 = /* @__PURE__ */ defineComponent({
|
|
|
4506
4697
|
};
|
|
4507
4698
|
}
|
|
4508
4699
|
});
|
|
4509
|
-
var DialogRoot_default = _sfc_main$
|
|
4700
|
+
var DialogRoot_default = _sfc_main$52;
|
|
4510
4701
|
|
|
4511
4702
|
//#endregion
|
|
4512
4703
|
//#region src/components/Dialog/DialogClose.vue
|
|
4513
|
-
const _sfc_main$
|
|
4704
|
+
const _sfc_main$51 = /* @__PURE__ */ defineComponent({
|
|
4514
4705
|
name: "DialogClose",
|
|
4515
4706
|
__name: "DialogClose",
|
|
4516
4707
|
props: {
|
|
@@ -4538,7 +4729,7 @@ const _sfc_main$37 = /* @__PURE__ */ defineComponent({
|
|
|
4538
4729
|
};
|
|
4539
4730
|
}
|
|
4540
4731
|
});
|
|
4541
|
-
var DialogClose_default = _sfc_main$
|
|
4732
|
+
var DialogClose_default = _sfc_main$51;
|
|
4542
4733
|
|
|
4543
4734
|
//#endregion
|
|
4544
4735
|
//#region src/composables/createPagination/index.ts
|
|
@@ -4822,17 +5013,15 @@ function defaultFilter(query, item, keys, mode = "some") {
|
|
|
4822
5013
|
function createFilter(options = {}) {
|
|
4823
5014
|
const { customFilter, keys, mode = "some" } = options;
|
|
4824
5015
|
const filterFunction = customFilter ?? ((q, i) => defaultFilter(q, i, keys, mode));
|
|
4825
|
-
const query =
|
|
5016
|
+
const query = shallowRef("");
|
|
4826
5017
|
function apply(_query, items) {
|
|
4827
|
-
const itemsRef = isRef(items) ? items : toRef(() => items);
|
|
4828
|
-
const queryRef = toRef(_query);
|
|
4829
5018
|
return { items: computed(() => {
|
|
4830
|
-
const q = toValue(
|
|
5019
|
+
const q = toValue(_query);
|
|
4831
5020
|
query.value = q;
|
|
4832
5021
|
const queries = toArray(q).filter((q$1) => String(q$1).trim());
|
|
4833
|
-
if (queries.length === 0) return
|
|
5022
|
+
if (queries.length === 0) return toValue(items);
|
|
4834
5023
|
const queryParam = queries.length === 1 ? queries[0] : queries;
|
|
4835
|
-
return
|
|
5024
|
+
return toValue(items).filter((item) => filterFunction(queryParam, item));
|
|
4836
5025
|
}) };
|
|
4837
5026
|
}
|
|
4838
5027
|
return {
|
|
@@ -5688,30 +5877,42 @@ function createDefaultBreakpoints() {
|
|
|
5688
5877
|
* ```
|
|
5689
5878
|
*/
|
|
5690
5879
|
function createBreakpoints(_options = {}) {
|
|
5691
|
-
const {
|
|
5880
|
+
const { ssr, ...options } = _options;
|
|
5881
|
+
const { mobileBreakpoint, breakpoints } = /* @__PURE__ */ mergeDeep(createDefaultBreakpoints(), options);
|
|
5692
5882
|
const sorted = Object.entries(breakpoints).toSorted((a, b) => a[1] - b[1]);
|
|
5693
5883
|
const names = sorted.map(([n]) => n);
|
|
5694
5884
|
const mb = /* @__PURE__ */ isNumber(mobileBreakpoint) ? mobileBreakpoint : breakpoints[mobileBreakpoint] ?? breakpoints.md;
|
|
5695
|
-
const
|
|
5696
|
-
const
|
|
5697
|
-
const
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
const
|
|
5706
|
-
const
|
|
5707
|
-
const
|
|
5708
|
-
const
|
|
5709
|
-
const
|
|
5710
|
-
const
|
|
5711
|
-
const
|
|
5712
|
-
const
|
|
5713
|
-
const
|
|
5714
|
-
const
|
|
5885
|
+
const isSSR = !IN_BROWSER && !!ssr;
|
|
5886
|
+
const initialWidth = isSSR ? ssr.clientWidth : 0;
|
|
5887
|
+
const initialHeight = isSSR ? ssr.clientHeight ?? 0 : 0;
|
|
5888
|
+
let initialName = "xs";
|
|
5889
|
+
if (isSSR) {
|
|
5890
|
+
for (let i = sorted.length - 1; i >= 0; i--) if (initialWidth >= sorted[i][1]) {
|
|
5891
|
+
initialName = sorted[i][0];
|
|
5892
|
+
break;
|
|
5893
|
+
}
|
|
5894
|
+
}
|
|
5895
|
+
const initialIndex = names.indexOf(initialName);
|
|
5896
|
+
const name = shallowRef(initialName);
|
|
5897
|
+
const width = shallowRef(initialWidth);
|
|
5898
|
+
const height = shallowRef(initialHeight);
|
|
5899
|
+
const isMobile = shallowRef(isSSR ? initialWidth < mb : true);
|
|
5900
|
+
const xs = shallowRef(initialIndex === 0);
|
|
5901
|
+
const sm = shallowRef(initialIndex === 1);
|
|
5902
|
+
const md = shallowRef(initialIndex === 2);
|
|
5903
|
+
const lg = shallowRef(initialIndex === 3);
|
|
5904
|
+
const xl = shallowRef(initialIndex === 4);
|
|
5905
|
+
const xxl = shallowRef(initialIndex === 5);
|
|
5906
|
+
const smAndUp = shallowRef(initialIndex >= 1);
|
|
5907
|
+
const mdAndUp = shallowRef(initialIndex >= 2);
|
|
5908
|
+
const lgAndUp = shallowRef(initialIndex >= 3);
|
|
5909
|
+
const xlAndUp = shallowRef(initialIndex >= 4);
|
|
5910
|
+
const xxlAndUp = shallowRef(initialIndex >= 5);
|
|
5911
|
+
const smAndDown = shallowRef(initialIndex <= 1);
|
|
5912
|
+
const mdAndDown = shallowRef(initialIndex <= 2);
|
|
5913
|
+
const lgAndDown = shallowRef(initialIndex <= 3);
|
|
5914
|
+
const xlAndDown = shallowRef(initialIndex <= 4);
|
|
5915
|
+
const xxlAndDown = shallowRef(initialIndex <= 5);
|
|
5715
5916
|
function update() {
|
|
5716
5917
|
if (!IN_BROWSER) return;
|
|
5717
5918
|
width.value = window.innerWidth;
|
|
@@ -5763,10 +5964,12 @@ function createBreakpoints(_options = {}) {
|
|
|
5763
5964
|
lgAndDown: readonly(lgAndDown),
|
|
5764
5965
|
xlAndDown: readonly(xlAndDown),
|
|
5765
5966
|
xxlAndDown: readonly(xxlAndDown),
|
|
5967
|
+
ssr: isSSR,
|
|
5766
5968
|
update
|
|
5767
5969
|
};
|
|
5768
5970
|
}
|
|
5769
|
-
function createBreakpointsFallback() {
|
|
5971
|
+
function createBreakpointsFallback(options = {}) {
|
|
5972
|
+
if (options.ssr) return createBreakpoints(options);
|
|
5770
5973
|
return {
|
|
5771
5974
|
breakpoints: createDefaultBreakpoints().breakpoints,
|
|
5772
5975
|
name: readonly(shallowRef("xs")),
|
|
@@ -5789,12 +5992,14 @@ function createBreakpointsFallback() {
|
|
|
5789
5992
|
lgAndDown: readonly(shallowRef(false)),
|
|
5790
5993
|
xlAndDown: readonly(shallowRef(false)),
|
|
5791
5994
|
xxlAndDown: readonly(shallowRef(false)),
|
|
5995
|
+
ssr: false,
|
|
5792
5996
|
update: () => {}
|
|
5793
5997
|
};
|
|
5794
5998
|
}
|
|
5795
5999
|
const [createBreakpointsContext, createBreakpointsPlugin, useBreakpoints] = createPluginContext("v0:breakpoints", (options) => createBreakpoints(options), {
|
|
5796
6000
|
fallback: () => createBreakpointsFallback(),
|
|
5797
6001
|
setup: (context, app, _options) => {
|
|
6002
|
+
if (IN_BROWSER) context.update();
|
|
5798
6003
|
app.mixin({ mounted() {
|
|
5799
6004
|
if (!/* @__PURE__ */ isNull(this.$parent)) return;
|
|
5800
6005
|
const hydration = useHydration();
|
|
@@ -6387,6 +6592,9 @@ const keyAliasMap = {
|
|
|
6387
6592
|
space: " ",
|
|
6388
6593
|
return: "enter",
|
|
6389
6594
|
del: "delete",
|
|
6595
|
+
plus: "+",
|
|
6596
|
+
slash: "/",
|
|
6597
|
+
underscore: "_",
|
|
6390
6598
|
minus: "-",
|
|
6391
6599
|
hyphen: "-"
|
|
6392
6600
|
};
|
|
@@ -6432,7 +6640,7 @@ function splitKeyCombination(combination, isInternal = false) {
|
|
|
6432
6640
|
"++",
|
|
6433
6641
|
"//",
|
|
6434
6642
|
"__"
|
|
6435
|
-
].some((v) => combination.startsWith(v)) || combination.includes("++") || combination.includes("__") || combination === "+" || combination === "_" || combination.length > 1 && (combination.endsWith("+") || combination.endsWith("_")) && combination.at(-2) !== combination.at(-1) || combination === "++" || combination === "--" || combination === "__") {
|
|
6643
|
+
].some((v) => combination.startsWith(v)) || combination.includes("++") || combination.includes("//") || combination.includes("__") || combination === "+" || combination === "/" || combination === "_" || combination.length > 1 && (combination.endsWith("+") || combination.endsWith("/") || combination.endsWith("_")) && combination.at(-2) !== combination.at(-1) || combination === "++" || combination === "--" || combination === "__") {
|
|
6436
6644
|
if (!isInternal) logger.warn(`Invalid hotkey combination: "${combination}" has invalid structure`);
|
|
6437
6645
|
return emptyResult;
|
|
6438
6646
|
}
|
|
@@ -6498,7 +6706,11 @@ function splitKeySequence(str) {
|
|
|
6498
6706
|
logger.warn("Invalid hotkey sequence: empty string provided");
|
|
6499
6707
|
return [];
|
|
6500
6708
|
}
|
|
6501
|
-
const hasInvalidStart = str.startsWith("-") && ![
|
|
6709
|
+
const hasInvalidStart = str.startsWith("-") && ![
|
|
6710
|
+
"-",
|
|
6711
|
+
"---",
|
|
6712
|
+
"--+"
|
|
6713
|
+
].includes(str);
|
|
6502
6714
|
const hasInvalidEnd = str.endsWith("-") && !str.endsWith("+-") && !str.endsWith("_-") && str !== "-" && str !== "---";
|
|
6503
6715
|
if (hasInvalidStart || hasInvalidEnd) {
|
|
6504
6716
|
logger.warn(`Invalid hotkey sequence: "${str}" contains invalid combinations`);
|
|
@@ -7724,10 +7936,15 @@ function createNested(_options = {}) {
|
|
|
7724
7936
|
openedIds.clear();
|
|
7725
7937
|
activeIds.clear();
|
|
7726
7938
|
rootIds.clear();
|
|
7727
|
-
group.
|
|
7939
|
+
group.clear();
|
|
7728
7940
|
}
|
|
7729
7941
|
function reset() {
|
|
7730
|
-
clear();
|
|
7942
|
+
children.clear();
|
|
7943
|
+
parents.clear();
|
|
7944
|
+
openedIds.clear();
|
|
7945
|
+
activeIds.clear();
|
|
7946
|
+
rootIds.clear();
|
|
7947
|
+
group.reset();
|
|
7731
7948
|
}
|
|
7732
7949
|
const context = {
|
|
7733
7950
|
...group,
|
|
@@ -8153,37 +8370,222 @@ function useQueue(namespace = "v0:queue") {
|
|
|
8153
8370
|
}
|
|
8154
8371
|
|
|
8155
8372
|
//#endregion
|
|
8156
|
-
//#region src/composables/
|
|
8373
|
+
//#region src/composables/createSlider/index.ts
|
|
8157
8374
|
/**
|
|
8158
|
-
* @module
|
|
8375
|
+
* @module createSlider
|
|
8159
8376
|
*
|
|
8160
|
-
* @see https://0.vuetifyjs.com/composables/
|
|
8377
|
+
* @see https://0.vuetifyjs.com/composables/forms/create-slider
|
|
8161
8378
|
*
|
|
8162
8379
|
* @remarks
|
|
8163
|
-
*
|
|
8164
|
-
*
|
|
8165
|
-
* - Automatic z-index calculation based on selection order
|
|
8166
|
-
* - `globalTop` tracking - is this ticket topmost globally?
|
|
8167
|
-
* - Manual select/unselect for explicit control
|
|
8168
|
-
* - Auto-cleanup when registered within component setup
|
|
8380
|
+
* Composable for managing slider state: value math, step snapping,
|
|
8381
|
+
* percentage conversion, and multi-thumb value operations.
|
|
8169
8382
|
*
|
|
8170
|
-
*
|
|
8383
|
+
* Extends createModel for useProxyModel compatibility:
|
|
8384
|
+
* - createRegistry → createModel → createSlider (ticket-per-thumb)
|
|
8385
|
+
*
|
|
8386
|
+
* Each thumb is a model ticket with a `shallowRef<number>` value.
|
|
8387
|
+
* Values are derived from ordered tickets, not a standalone ref.
|
|
8388
|
+
*
|
|
8389
|
+
* Designed for single-thumb, range, and multi-thumb sliders.
|
|
8390
|
+
* Also reusable for color picker tracks, media scrubbers,
|
|
8391
|
+
* gradient editors, and other 1D value-on-track controls.
|
|
8171
8392
|
*/
|
|
8172
8393
|
/**
|
|
8173
|
-
* Creates
|
|
8394
|
+
* Creates slider state with value math, step snapping, and multi-thumb support.
|
|
8174
8395
|
*
|
|
8175
|
-
*
|
|
8176
|
-
*
|
|
8396
|
+
* Extends createModel for useProxyModel compatibility. Each thumb is a model
|
|
8397
|
+
* ticket with a shallowRef<number> value. Values are derived from the ordered
|
|
8398
|
+
* tickets, enabling proper registration/unregistration lifecycle.
|
|
8177
8399
|
*
|
|
8178
|
-
* @
|
|
8400
|
+
* @param options Slider configuration.
|
|
8401
|
+
* @returns Slider context with values, math functions, and thumb operations.
|
|
8179
8402
|
*
|
|
8180
|
-
* @
|
|
8403
|
+
* @see https://0.vuetifyjs.com/composables/forms/create-slider
|
|
8404
|
+
* @see {@link createModel} for the base model composable.
|
|
8405
|
+
*
|
|
8406
|
+
* @example Single thumb
|
|
8181
8407
|
* ```ts
|
|
8182
|
-
* import {
|
|
8408
|
+
* import { createSlider } from '@vuetify/v0'
|
|
8183
8409
|
*
|
|
8184
|
-
* const
|
|
8410
|
+
* const slider = createSlider({ min: 0, max: 100, step: 5 })
|
|
8411
|
+
* const ticket = slider.register({ value: 50 })
|
|
8412
|
+
* slider.up(0) // values: [55]
|
|
8413
|
+
* slider.fromValue(50) // 50
|
|
8414
|
+
* ```
|
|
8185
8415
|
*
|
|
8186
|
-
*
|
|
8416
|
+
* @example Range slider
|
|
8417
|
+
* ```ts
|
|
8418
|
+
* import { createSlider } from '@vuetify/v0'
|
|
8419
|
+
*
|
|
8420
|
+
* const slider = createSlider({ min: 0, max: 100, step: 1, range: true })
|
|
8421
|
+
* slider.register({ value: 25 })
|
|
8422
|
+
* slider.register({ value: 75 })
|
|
8423
|
+
* slider.set(0, 30) // values: [30, 75]
|
|
8424
|
+
* slider.set(1, 60) // values: [30, 60]
|
|
8425
|
+
* ```
|
|
8426
|
+
*
|
|
8427
|
+
* @example Custom pointer interaction (media scrubber)
|
|
8428
|
+
* ```ts
|
|
8429
|
+
* import { createSlider } from '@vuetify/v0'
|
|
8430
|
+
*
|
|
8431
|
+
* const slider = createSlider({ min: 0, max: 217, step: 0.1 })
|
|
8432
|
+
* slider.register({ value: 0 })
|
|
8433
|
+
*
|
|
8434
|
+
* // pointer → fromPercent → set → fromValue → UI
|
|
8435
|
+
* const percent = (clientX - rect.left) / rect.width * 100
|
|
8436
|
+
* slider.set(0, slider.fromPercent(percent))
|
|
8437
|
+
* const position = slider.fromValue(slider.values.value[0])
|
|
8438
|
+
* ```
|
|
8439
|
+
*/
|
|
8440
|
+
function createSlider(options = {}) {
|
|
8441
|
+
const { min = 0, max = 100, step = 1, disabled: disabledProp = false, readonly: readonlyProp = false, orientation: orientationProp = "horizontal", inverted: invertedProp = false, minStepsBetweenThumbs = 0, crossover = false, range: range$1 = false } = options;
|
|
8442
|
+
const model = createModel({
|
|
8443
|
+
disabled: disabledProp,
|
|
8444
|
+
multiple: true,
|
|
8445
|
+
events: true
|
|
8446
|
+
});
|
|
8447
|
+
const disabled = toRef(() => toValue(disabledProp));
|
|
8448
|
+
const readonly$1 = toRef(() => toValue(readonlyProp));
|
|
8449
|
+
const orientation = toRef(() => toValue(orientationProp));
|
|
8450
|
+
const inverted = toRef(() => toValue(invertedProp));
|
|
8451
|
+
const extent = max - min;
|
|
8452
|
+
let pending = null;
|
|
8453
|
+
const thumbs = computed(() => Array.from(model.selectedItems.value).toSorted((a, b) => a.index - b.index));
|
|
8454
|
+
const values = computed(() => thumbs.value.map((t) => toValue(t.value)));
|
|
8455
|
+
const selectedValues = computed(() => values.value);
|
|
8456
|
+
function snap(value) {
|
|
8457
|
+
if (step <= 0) return /* @__PURE__ */ clamp(value, min, max);
|
|
8458
|
+
const clamped = /* @__PURE__ */ clamp(value, min, max);
|
|
8459
|
+
return /* @__PURE__ */ clamp(min + Math.round((clamped - min) / step) * step, min, max);
|
|
8460
|
+
}
|
|
8461
|
+
function fromValue(value) {
|
|
8462
|
+
if (extent === 0) return 0;
|
|
8463
|
+
const p = (value - min) / extent * 100;
|
|
8464
|
+
return inverted.value ? 100 - p : p;
|
|
8465
|
+
}
|
|
8466
|
+
function fromPercent(p) {
|
|
8467
|
+
return snap(min + (inverted.value ? 100 - p : p) / 100 * extent);
|
|
8468
|
+
}
|
|
8469
|
+
function register(input) {
|
|
8470
|
+
const initialValue = /* @__PURE__ */ isObject(input) ? input.value : input;
|
|
8471
|
+
const thumbIndex = thumbs.value.length;
|
|
8472
|
+
const pendingValue = pending?.[thumbIndex];
|
|
8473
|
+
const val = /* @__PURE__ */ isUndefined(pendingValue) ? snap(initialValue ?? min) : snap(pendingValue);
|
|
8474
|
+
const ticket = model.register({ value: shallowRef(val) });
|
|
8475
|
+
if (!model.selectedIds.has(ticket.id)) model.selectedIds.add(ticket.id);
|
|
8476
|
+
if (pending && thumbs.value.length >= pending.length) pending = null;
|
|
8477
|
+
return ticket;
|
|
8478
|
+
}
|
|
8479
|
+
function apply(incoming, _options) {
|
|
8480
|
+
const snapped = incoming.map((v) => snap(Number(v)));
|
|
8481
|
+
if (thumbs.value.length === 0) {
|
|
8482
|
+
pending = snapped;
|
|
8483
|
+
return;
|
|
8484
|
+
}
|
|
8485
|
+
for (let index = 0; index < snapped.length; index++) {
|
|
8486
|
+
const ticket = thumbs.value[index];
|
|
8487
|
+
if (!ticket || !isRef(ticket.value)) continue;
|
|
8488
|
+
let constrained = snapped[index];
|
|
8489
|
+
if (!crossover) {
|
|
8490
|
+
const gap = minStepsBetweenThumbs * step;
|
|
8491
|
+
const prev = index > 0 ? snapped[index - 1] : void 0;
|
|
8492
|
+
const following = index < snapped.length - 1 ? snapped[index + 1] : void 0;
|
|
8493
|
+
if (!/* @__PURE__ */ isUndefined(prev)) constrained = Math.max(constrained, prev + gap);
|
|
8494
|
+
if (!/* @__PURE__ */ isUndefined(following)) constrained = Math.min(constrained, following - gap);
|
|
8495
|
+
}
|
|
8496
|
+
ticket.value.value = /* @__PURE__ */ clamp(constrained, min, max);
|
|
8497
|
+
}
|
|
8498
|
+
}
|
|
8499
|
+
function set(index, value) {
|
|
8500
|
+
if (readonly$1.value) return;
|
|
8501
|
+
const snapped = snap(value);
|
|
8502
|
+
const current = values.value;
|
|
8503
|
+
let constrained = snapped;
|
|
8504
|
+
if (!crossover) {
|
|
8505
|
+
const gap = minStepsBetweenThumbs * step;
|
|
8506
|
+
const prev = current[index - 1];
|
|
8507
|
+
const following = current[index + 1];
|
|
8508
|
+
if (index > 0 && !/* @__PURE__ */ isUndefined(prev)) constrained = Math.max(constrained, prev + gap);
|
|
8509
|
+
if (index < current.length - 1 && !/* @__PURE__ */ isUndefined(following)) constrained = Math.min(constrained, following - gap);
|
|
8510
|
+
}
|
|
8511
|
+
constrained = /* @__PURE__ */ clamp(constrained, min, max);
|
|
8512
|
+
const ticket = thumbs.value[index];
|
|
8513
|
+
if (ticket && isRef(ticket.value)) ticket.value.value = constrained;
|
|
8514
|
+
}
|
|
8515
|
+
function up(index, multiplier = 1) {
|
|
8516
|
+
set(index, (values.value[index] ?? min) + step * multiplier);
|
|
8517
|
+
}
|
|
8518
|
+
function down(index, multiplier = 1) {
|
|
8519
|
+
set(index, (values.value[index] ?? min) - step * multiplier);
|
|
8520
|
+
}
|
|
8521
|
+
function floor(index) {
|
|
8522
|
+
set(index, min);
|
|
8523
|
+
}
|
|
8524
|
+
function ceil(index) {
|
|
8525
|
+
set(index, max);
|
|
8526
|
+
}
|
|
8527
|
+
return {
|
|
8528
|
+
...model,
|
|
8529
|
+
values,
|
|
8530
|
+
selectedValues,
|
|
8531
|
+
apply,
|
|
8532
|
+
range: range$1,
|
|
8533
|
+
min,
|
|
8534
|
+
max,
|
|
8535
|
+
step,
|
|
8536
|
+
minStepsBetweenThumbs,
|
|
8537
|
+
crossover,
|
|
8538
|
+
disabled,
|
|
8539
|
+
readonly: readonly$1,
|
|
8540
|
+
orientation,
|
|
8541
|
+
inverted,
|
|
8542
|
+
register,
|
|
8543
|
+
snap,
|
|
8544
|
+
fromValue,
|
|
8545
|
+
fromPercent,
|
|
8546
|
+
set,
|
|
8547
|
+
up,
|
|
8548
|
+
down,
|
|
8549
|
+
floor,
|
|
8550
|
+
ceil,
|
|
8551
|
+
get size() {
|
|
8552
|
+
return model.size;
|
|
8553
|
+
}
|
|
8554
|
+
};
|
|
8555
|
+
}
|
|
8556
|
+
|
|
8557
|
+
//#endregion
|
|
8558
|
+
//#region src/composables/useStack/index.ts
|
|
8559
|
+
/**
|
|
8560
|
+
* @module useStack
|
|
8561
|
+
*
|
|
8562
|
+
* @see https://0.vuetifyjs.com/composables/plugins/use-stack
|
|
8563
|
+
*
|
|
8564
|
+
* @remarks
|
|
8565
|
+
* Overlay z-index stacking composable with:
|
|
8566
|
+
* - Global reactive registry of active overlays
|
|
8567
|
+
* - Automatic z-index calculation based on selection order
|
|
8568
|
+
* - `globalTop` tracking - is this ticket topmost globally?
|
|
8569
|
+
* - Manual select/unselect for explicit control
|
|
8570
|
+
* - Auto-cleanup when registered within component setup
|
|
8571
|
+
*
|
|
8572
|
+
* Built on createSelection for consistent ticket-based management.
|
|
8573
|
+
*/
|
|
8574
|
+
/**
|
|
8575
|
+
* Creates a new stack instance for managing overlay z-indexes.
|
|
8576
|
+
*
|
|
8577
|
+
* @param options Configuration options
|
|
8578
|
+
* @returns Stack context with registry methods and scrim helpers
|
|
8579
|
+
*
|
|
8580
|
+
* @see https://0.vuetifyjs.com/composables/plugins/use-stack
|
|
8581
|
+
*
|
|
8582
|
+
* @example
|
|
8583
|
+
* ```ts
|
|
8584
|
+
* import { createStack } from '@vuetify/v0'
|
|
8585
|
+
*
|
|
8586
|
+
* const stack = createStack({ baseZIndex: 1000 })
|
|
8587
|
+
*
|
|
8588
|
+
* const ticket = stack.register({
|
|
8187
8589
|
* onDismiss: () => console.log('dismissed'),
|
|
8188
8590
|
* blocking: false,
|
|
8189
8591
|
* })
|
|
@@ -8651,31 +9053,50 @@ function createStorage(options = {}) {
|
|
|
8651
9053
|
const { adapter = IN_BROWSER ? window.localStorage : new MemoryAdapter(), prefix = "v0:", serializer = {
|
|
8652
9054
|
read: JSON.parse,
|
|
8653
9055
|
write: JSON.stringify
|
|
8654
|
-
} } = options;
|
|
9056
|
+
}, ttl } = options;
|
|
8655
9057
|
const cache = /* @__PURE__ */ new Map();
|
|
8656
9058
|
const watchers = /* @__PURE__ */ new Map();
|
|
8657
9059
|
function has(key) {
|
|
8658
9060
|
const prefixedKey = `${prefix}${key}`;
|
|
8659
9061
|
return cache.has(prefixedKey);
|
|
8660
9062
|
}
|
|
8661
|
-
function
|
|
8662
|
-
const
|
|
8663
|
-
if (
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
9063
|
+
function readStored(prefixedKey) {
|
|
9064
|
+
const raw = adapter?.getItem(prefixedKey);
|
|
9065
|
+
if (!raw) return void 0;
|
|
9066
|
+
try {
|
|
9067
|
+
const parsed = serializer.read(raw);
|
|
9068
|
+
if (ttl && parsed && typeof parsed === "object" && "__ttl" in parsed && "__v" in parsed) {
|
|
9069
|
+
if (Date.now() - parsed.__t > ttl) {
|
|
9070
|
+
adapter?.removeItem(prefixedKey);
|
|
9071
|
+
return;
|
|
9072
|
+
}
|
|
9073
|
+
return parsed.__v;
|
|
9074
|
+
}
|
|
9075
|
+
return parsed;
|
|
8668
9076
|
} catch (error) {
|
|
8669
9077
|
console.error(`[v0:storage] Failed to parse stored value for key "${prefixedKey}":`, error);
|
|
9078
|
+
return;
|
|
9079
|
+
}
|
|
9080
|
+
}
|
|
9081
|
+
function writeStored(prefixedKey, value) {
|
|
9082
|
+
const wrapped = ttl ? {
|
|
9083
|
+
__ttl: 1,
|
|
9084
|
+
__v: value,
|
|
9085
|
+
__t: Date.now()
|
|
9086
|
+
} : value;
|
|
9087
|
+
try {
|
|
9088
|
+
adapter?.setItem(prefixedKey, serializer.write(wrapped));
|
|
9089
|
+
} catch (error) {
|
|
9090
|
+
console.error(`[v0:storage] Failed to write key "${prefixedKey}":`, error);
|
|
8670
9091
|
}
|
|
8671
|
-
|
|
9092
|
+
}
|
|
9093
|
+
function get(key, defaultValue) {
|
|
9094
|
+
const prefixedKey = `${prefix}${key}`;
|
|
9095
|
+
if (cache.has(prefixedKey)) return cache.get(prefixedKey);
|
|
9096
|
+
const valueRef = ref(readStored(prefixedKey) ?? defaultValue);
|
|
8672
9097
|
const stop = watch(valueRef, (newValue) => {
|
|
8673
9098
|
if (/* @__PURE__ */ isNullOrUndefined(newValue)) adapter?.removeItem(prefixedKey);
|
|
8674
|
-
else
|
|
8675
|
-
adapter?.setItem(prefixedKey, serializer.write(newValue));
|
|
8676
|
-
} catch (error) {
|
|
8677
|
-
console.error(`[v0:storage] Failed to write key "${prefixedKey}":`, error);
|
|
8678
|
-
}
|
|
9099
|
+
else writeStored(prefixedKey, newValue);
|
|
8679
9100
|
}, { deep: true });
|
|
8680
9101
|
watchers.set(prefixedKey, stop);
|
|
8681
9102
|
cache.set(prefixedKey, valueRef);
|
|
@@ -8709,14 +9130,10 @@ function createStorage(options = {}) {
|
|
|
8709
9130
|
const valueRef = cache.get(e.key);
|
|
8710
9131
|
if (!valueRef) return;
|
|
8711
9132
|
watchers.get(e.key)?.();
|
|
8712
|
-
valueRef.value = e.newValue == null ? void 0 :
|
|
9133
|
+
valueRef.value = e.newValue == null ? void 0 : readStored(e.key);
|
|
8713
9134
|
const stop = watch(valueRef, (newValue) => {
|
|
8714
9135
|
if (/* @__PURE__ */ isNullOrUndefined(newValue)) adapter?.removeItem(e.key);
|
|
8715
|
-
else
|
|
8716
|
-
adapter?.setItem(e.key, serializer.write(newValue));
|
|
8717
|
-
} catch (error) {
|
|
8718
|
-
console.error(`[v0:storage] Failed to write key "${e.key}":`, error);
|
|
8719
|
-
}
|
|
9136
|
+
else writeStored(e.key, newValue);
|
|
8720
9137
|
}, { deep: true });
|
|
8721
9138
|
watchers.set(e.key, stop);
|
|
8722
9139
|
});
|
|
@@ -9882,7 +10299,7 @@ function useClickOutside(target, handler, options = {}) {
|
|
|
9882
10299
|
|
|
9883
10300
|
//#endregion
|
|
9884
10301
|
//#region src/components/Dialog/DialogContent.vue
|
|
9885
|
-
const _sfc_main$
|
|
10302
|
+
const _sfc_main$50 = /* @__PURE__ */ defineComponent({
|
|
9886
10303
|
name: "DialogContent",
|
|
9887
10304
|
__name: "DialogContent",
|
|
9888
10305
|
props: {
|
|
@@ -9964,11 +10381,11 @@ const _sfc_main$36 = /* @__PURE__ */ defineComponent({
|
|
|
9964
10381
|
};
|
|
9965
10382
|
}
|
|
9966
10383
|
});
|
|
9967
|
-
var DialogContent_default = _sfc_main$
|
|
10384
|
+
var DialogContent_default = _sfc_main$50;
|
|
9968
10385
|
|
|
9969
10386
|
//#endregion
|
|
9970
10387
|
//#region src/components/Dialog/DialogDescription.vue
|
|
9971
|
-
const _sfc_main$
|
|
10388
|
+
const _sfc_main$49 = /* @__PURE__ */ defineComponent({
|
|
9972
10389
|
name: "DialogDescription",
|
|
9973
10390
|
__name: "DialogDescription",
|
|
9974
10391
|
props: {
|
|
@@ -9987,11 +10404,11 @@ const _sfc_main$35 = /* @__PURE__ */ defineComponent({
|
|
|
9987
10404
|
};
|
|
9988
10405
|
}
|
|
9989
10406
|
});
|
|
9990
|
-
var DialogDescription_default = _sfc_main$
|
|
10407
|
+
var DialogDescription_default = _sfc_main$49;
|
|
9991
10408
|
|
|
9992
10409
|
//#endregion
|
|
9993
10410
|
//#region src/components/Dialog/DialogTitle.vue
|
|
9994
|
-
const _sfc_main$
|
|
10411
|
+
const _sfc_main$48 = /* @__PURE__ */ defineComponent({
|
|
9995
10412
|
name: "DialogTitle",
|
|
9996
10413
|
__name: "DialogTitle",
|
|
9997
10414
|
props: {
|
|
@@ -10010,11 +10427,11 @@ const _sfc_main$34 = /* @__PURE__ */ defineComponent({
|
|
|
10010
10427
|
};
|
|
10011
10428
|
}
|
|
10012
10429
|
});
|
|
10013
|
-
var DialogTitle_default = _sfc_main$
|
|
10430
|
+
var DialogTitle_default = _sfc_main$48;
|
|
10014
10431
|
|
|
10015
10432
|
//#endregion
|
|
10016
10433
|
//#region src/components/Dialog/DialogActivator.vue
|
|
10017
|
-
const _sfc_main$
|
|
10434
|
+
const _sfc_main$47 = /* @__PURE__ */ defineComponent({
|
|
10018
10435
|
name: "DialogActivator",
|
|
10019
10436
|
__name: "DialogActivator",
|
|
10020
10437
|
props: {
|
|
@@ -10044,7 +10461,7 @@ const _sfc_main$33 = /* @__PURE__ */ defineComponent({
|
|
|
10044
10461
|
};
|
|
10045
10462
|
}
|
|
10046
10463
|
});
|
|
10047
|
-
var DialogActivator_default = _sfc_main$
|
|
10464
|
+
var DialogActivator_default = _sfc_main$47;
|
|
10048
10465
|
|
|
10049
10466
|
//#endregion
|
|
10050
10467
|
//#region src/components/Dialog/index.ts
|
|
@@ -10089,7 +10506,7 @@ const Dialog = {
|
|
|
10089
10506
|
//#endregion
|
|
10090
10507
|
//#region src/components/ExpansionPanel/ExpansionPanelRoot.vue
|
|
10091
10508
|
const [useExpansionPanelRoot, provideExpansionPanelRoot] = createContext();
|
|
10092
|
-
const _sfc_main$
|
|
10509
|
+
const _sfc_main$46 = /* @__PURE__ */ defineComponent({
|
|
10093
10510
|
name: "ExpansionPanelRoot",
|
|
10094
10511
|
__name: "ExpansionPanelRoot",
|
|
10095
10512
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -10146,12 +10563,12 @@ const _sfc_main$32 = /* @__PURE__ */ defineComponent({
|
|
|
10146
10563
|
};
|
|
10147
10564
|
}
|
|
10148
10565
|
});
|
|
10149
|
-
var ExpansionPanelRoot_default = _sfc_main$
|
|
10566
|
+
var ExpansionPanelRoot_default = _sfc_main$46;
|
|
10150
10567
|
|
|
10151
10568
|
//#endregion
|
|
10152
10569
|
//#region src/components/ExpansionPanel/ExpansionPanelItem.vue
|
|
10153
10570
|
const [useExpansionPanelItem, provideExpansionPanelItem] = createContext({ suffix: "item" });
|
|
10154
|
-
const _sfc_main$
|
|
10571
|
+
const _sfc_main$45 = /* @__PURE__ */ defineComponent({
|
|
10155
10572
|
name: "ExpansionPanelItem",
|
|
10156
10573
|
__name: "ExpansionPanelItem",
|
|
10157
10574
|
props: {
|
|
@@ -10195,11 +10612,11 @@ const _sfc_main$31 = /* @__PURE__ */ defineComponent({
|
|
|
10195
10612
|
};
|
|
10196
10613
|
}
|
|
10197
10614
|
});
|
|
10198
|
-
var ExpansionPanelItem_default = _sfc_main$
|
|
10615
|
+
var ExpansionPanelItem_default = _sfc_main$45;
|
|
10199
10616
|
|
|
10200
10617
|
//#endregion
|
|
10201
10618
|
//#region src/components/ExpansionPanel/ExpansionPanelActivator.vue
|
|
10202
|
-
const _sfc_main$
|
|
10619
|
+
const _sfc_main$44 = /* @__PURE__ */ defineComponent({
|
|
10203
10620
|
name: "ExpansionPanelActivator",
|
|
10204
10621
|
__name: "ExpansionPanelActivator",
|
|
10205
10622
|
props: {
|
|
@@ -10245,11 +10662,11 @@ const _sfc_main$30 = /* @__PURE__ */ defineComponent({
|
|
|
10245
10662
|
};
|
|
10246
10663
|
}
|
|
10247
10664
|
});
|
|
10248
|
-
var ExpansionPanelActivator_default = _sfc_main$
|
|
10665
|
+
var ExpansionPanelActivator_default = _sfc_main$44;
|
|
10249
10666
|
|
|
10250
10667
|
//#endregion
|
|
10251
10668
|
//#region src/components/ExpansionPanel/ExpansionPanelContent.vue
|
|
10252
|
-
const _sfc_main$
|
|
10669
|
+
const _sfc_main$43 = /* @__PURE__ */ defineComponent({
|
|
10253
10670
|
name: "ExpansionPanelContent",
|
|
10254
10671
|
__name: "ExpansionPanelContent",
|
|
10255
10672
|
props: {
|
|
@@ -10280,11 +10697,11 @@ const _sfc_main$29 = /* @__PURE__ */ defineComponent({
|
|
|
10280
10697
|
};
|
|
10281
10698
|
}
|
|
10282
10699
|
});
|
|
10283
|
-
var ExpansionPanelContent_default = _sfc_main$
|
|
10700
|
+
var ExpansionPanelContent_default = _sfc_main$43;
|
|
10284
10701
|
|
|
10285
10702
|
//#endregion
|
|
10286
10703
|
//#region src/components/ExpansionPanel/ExpansionPanelHeader.vue
|
|
10287
|
-
const _sfc_main$
|
|
10704
|
+
const _sfc_main$42 = /* @__PURE__ */ defineComponent({
|
|
10288
10705
|
name: "ExpansionPanelHeader",
|
|
10289
10706
|
__name: "ExpansionPanelHeader",
|
|
10290
10707
|
props: {
|
|
@@ -10309,7 +10726,7 @@ const _sfc_main$28 = /* @__PURE__ */ defineComponent({
|
|
|
10309
10726
|
};
|
|
10310
10727
|
}
|
|
10311
10728
|
});
|
|
10312
|
-
var ExpansionPanelHeader_default = _sfc_main$
|
|
10729
|
+
var ExpansionPanelHeader_default = _sfc_main$42;
|
|
10313
10730
|
|
|
10314
10731
|
//#endregion
|
|
10315
10732
|
//#region src/components/ExpansionPanel/index.ts
|
|
@@ -10329,7 +10746,7 @@ const ExpansionPanel = {
|
|
|
10329
10746
|
//#endregion
|
|
10330
10747
|
//#region src/components/Group/GroupRoot.vue
|
|
10331
10748
|
const [useGroupRoot, provideGroupRoot] = createContext();
|
|
10332
|
-
const _sfc_main$
|
|
10749
|
+
const _sfc_main$41 = /* @__PURE__ */ defineComponent({
|
|
10333
10750
|
name: "GroupRoot",
|
|
10334
10751
|
__name: "GroupRoot",
|
|
10335
10752
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -10379,11 +10796,11 @@ const _sfc_main$27 = /* @__PURE__ */ defineComponent({
|
|
|
10379
10796
|
};
|
|
10380
10797
|
}
|
|
10381
10798
|
});
|
|
10382
|
-
var GroupRoot_default = _sfc_main$
|
|
10799
|
+
var GroupRoot_default = _sfc_main$41;
|
|
10383
10800
|
|
|
10384
10801
|
//#endregion
|
|
10385
10802
|
//#region src/components/Group/GroupItem.vue
|
|
10386
|
-
const _sfc_main$
|
|
10803
|
+
const _sfc_main$40 = /* @__PURE__ */ defineComponent({
|
|
10387
10804
|
name: "GroupItem",
|
|
10388
10805
|
__name: "GroupItem",
|
|
10389
10806
|
props: {
|
|
@@ -10432,7 +10849,7 @@ const _sfc_main$26 = /* @__PURE__ */ defineComponent({
|
|
|
10432
10849
|
};
|
|
10433
10850
|
}
|
|
10434
10851
|
});
|
|
10435
|
-
var GroupItem_default = _sfc_main$
|
|
10852
|
+
var GroupItem_default = _sfc_main$40;
|
|
10436
10853
|
|
|
10437
10854
|
//#endregion
|
|
10438
10855
|
//#region src/components/Group/index.ts
|
|
@@ -10451,7 +10868,7 @@ const Group = {
|
|
|
10451
10868
|
const [usePaginationRoot, providePaginationRoot] = createContext();
|
|
10452
10869
|
const [usePaginationControls, providePaginationControls] = createContext({ suffix: "controls" });
|
|
10453
10870
|
const [usePaginationItems, providePaginationItems] = createContext({ suffix: "items" });
|
|
10454
|
-
const _sfc_main$
|
|
10871
|
+
const _sfc_main$39 = /* @__PURE__ */ defineComponent({
|
|
10455
10872
|
name: "PaginationRoot",
|
|
10456
10873
|
__name: "PaginationRoot",
|
|
10457
10874
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -10551,11 +10968,11 @@ const _sfc_main$25 = /* @__PURE__ */ defineComponent({
|
|
|
10551
10968
|
};
|
|
10552
10969
|
}
|
|
10553
10970
|
});
|
|
10554
|
-
var PaginationRoot_default = _sfc_main$
|
|
10971
|
+
var PaginationRoot_default = _sfc_main$39;
|
|
10555
10972
|
|
|
10556
10973
|
//#endregion
|
|
10557
10974
|
//#region src/components/Pagination/PaginationEllipsis.vue
|
|
10558
|
-
const _sfc_main$
|
|
10975
|
+
const _sfc_main$38 = /* @__PURE__ */ defineComponent({
|
|
10559
10976
|
name: "PaginationEllipsis",
|
|
10560
10977
|
__name: "PaginationEllipsis",
|
|
10561
10978
|
props: {
|
|
@@ -10596,11 +11013,11 @@ const _sfc_main$24 = /* @__PURE__ */ defineComponent({
|
|
|
10596
11013
|
};
|
|
10597
11014
|
}
|
|
10598
11015
|
});
|
|
10599
|
-
var PaginationEllipsis_default = _sfc_main$
|
|
11016
|
+
var PaginationEllipsis_default = _sfc_main$38;
|
|
10600
11017
|
|
|
10601
11018
|
//#endregion
|
|
10602
11019
|
//#region src/components/Pagination/PaginationFirst.vue
|
|
10603
|
-
const _sfc_main$
|
|
11020
|
+
const _sfc_main$37 = /* @__PURE__ */ defineComponent({
|
|
10604
11021
|
name: "PaginationFirst",
|
|
10605
11022
|
__name: "PaginationFirst",
|
|
10606
11023
|
props: {
|
|
@@ -10655,11 +11072,11 @@ const _sfc_main$23 = /* @__PURE__ */ defineComponent({
|
|
|
10655
11072
|
};
|
|
10656
11073
|
}
|
|
10657
11074
|
});
|
|
10658
|
-
var PaginationFirst_default = _sfc_main$
|
|
11075
|
+
var PaginationFirst_default = _sfc_main$37;
|
|
10659
11076
|
|
|
10660
11077
|
//#endregion
|
|
10661
11078
|
//#region src/components/Pagination/PaginationItem.vue
|
|
10662
|
-
const _sfc_main$
|
|
11079
|
+
const _sfc_main$36 = /* @__PURE__ */ defineComponent({
|
|
10663
11080
|
name: "PaginationItem",
|
|
10664
11081
|
__name: "PaginationItem",
|
|
10665
11082
|
props: {
|
|
@@ -10725,11 +11142,11 @@ const _sfc_main$22 = /* @__PURE__ */ defineComponent({
|
|
|
10725
11142
|
};
|
|
10726
11143
|
}
|
|
10727
11144
|
});
|
|
10728
|
-
var PaginationItem_default = _sfc_main$
|
|
11145
|
+
var PaginationItem_default = _sfc_main$36;
|
|
10729
11146
|
|
|
10730
11147
|
//#endregion
|
|
10731
11148
|
//#region src/components/Pagination/PaginationLast.vue
|
|
10732
|
-
const _sfc_main$
|
|
11149
|
+
const _sfc_main$35 = /* @__PURE__ */ defineComponent({
|
|
10733
11150
|
name: "PaginationLast",
|
|
10734
11151
|
__name: "PaginationLast",
|
|
10735
11152
|
props: {
|
|
@@ -10784,11 +11201,11 @@ const _sfc_main$21 = /* @__PURE__ */ defineComponent({
|
|
|
10784
11201
|
};
|
|
10785
11202
|
}
|
|
10786
11203
|
});
|
|
10787
|
-
var PaginationLast_default = _sfc_main$
|
|
11204
|
+
var PaginationLast_default = _sfc_main$35;
|
|
10788
11205
|
|
|
10789
11206
|
//#endregion
|
|
10790
11207
|
//#region src/components/Pagination/PaginationNext.vue
|
|
10791
|
-
const _sfc_main$
|
|
11208
|
+
const _sfc_main$34 = /* @__PURE__ */ defineComponent({
|
|
10792
11209
|
name: "PaginationNext",
|
|
10793
11210
|
__name: "PaginationNext",
|
|
10794
11211
|
props: {
|
|
@@ -10843,11 +11260,11 @@ const _sfc_main$20 = /* @__PURE__ */ defineComponent({
|
|
|
10843
11260
|
};
|
|
10844
11261
|
}
|
|
10845
11262
|
});
|
|
10846
|
-
var PaginationNext_default = _sfc_main$
|
|
11263
|
+
var PaginationNext_default = _sfc_main$34;
|
|
10847
11264
|
|
|
10848
11265
|
//#endregion
|
|
10849
11266
|
//#region src/components/Pagination/PaginationPrev.vue
|
|
10850
|
-
const _sfc_main$
|
|
11267
|
+
const _sfc_main$33 = /* @__PURE__ */ defineComponent({
|
|
10851
11268
|
name: "PaginationPrev",
|
|
10852
11269
|
__name: "PaginationPrev",
|
|
10853
11270
|
props: {
|
|
@@ -10902,11 +11319,11 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
10902
11319
|
};
|
|
10903
11320
|
}
|
|
10904
11321
|
});
|
|
10905
|
-
var PaginationPrev_default = _sfc_main$
|
|
11322
|
+
var PaginationPrev_default = _sfc_main$33;
|
|
10906
11323
|
|
|
10907
11324
|
//#endregion
|
|
10908
11325
|
//#region src/components/Pagination/PaginationStatus.vue
|
|
10909
|
-
const _sfc_main$
|
|
11326
|
+
const _sfc_main$32 = /* @__PURE__ */ defineComponent({
|
|
10910
11327
|
name: "PaginationStatus",
|
|
10911
11328
|
__name: "PaginationStatus",
|
|
10912
11329
|
props: {
|
|
@@ -10950,7 +11367,7 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
|
10950
11367
|
};
|
|
10951
11368
|
}
|
|
10952
11369
|
});
|
|
10953
|
-
var PaginationStatus_default = _sfc_main$
|
|
11370
|
+
var PaginationStatus_default = _sfc_main$32;
|
|
10954
11371
|
|
|
10955
11372
|
//#endregion
|
|
10956
11373
|
//#region src/components/Pagination/index.ts
|
|
@@ -10973,7 +11390,7 @@ const Pagination = {
|
|
|
10973
11390
|
//#endregion
|
|
10974
11391
|
//#region src/components/Popover/PopoverRoot.vue
|
|
10975
11392
|
const [usePopoverContext, providePopoverContext] = createContext("Popover");
|
|
10976
|
-
const _sfc_main$
|
|
11393
|
+
const _sfc_main$31 = /* @__PURE__ */ defineComponent({
|
|
10977
11394
|
name: "PopoverRoot",
|
|
10978
11395
|
__name: "PopoverRoot",
|
|
10979
11396
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -11015,11 +11432,11 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
|
11015
11432
|
};
|
|
11016
11433
|
}
|
|
11017
11434
|
});
|
|
11018
|
-
var PopoverRoot_default = _sfc_main$
|
|
11435
|
+
var PopoverRoot_default = _sfc_main$31;
|
|
11019
11436
|
|
|
11020
11437
|
//#endregion
|
|
11021
11438
|
//#region src/components/Popover/PopoverActivator.vue
|
|
11022
|
-
const _sfc_main$
|
|
11439
|
+
const _sfc_main$30 = /* @__PURE__ */ defineComponent({
|
|
11023
11440
|
name: "PopoverActivator",
|
|
11024
11441
|
__name: "PopoverActivator",
|
|
11025
11442
|
props: {
|
|
@@ -11051,11 +11468,11 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
|
11051
11468
|
};
|
|
11052
11469
|
}
|
|
11053
11470
|
});
|
|
11054
|
-
var PopoverActivator_default = _sfc_main$
|
|
11471
|
+
var PopoverActivator_default = _sfc_main$30;
|
|
11055
11472
|
|
|
11056
11473
|
//#endregion
|
|
11057
11474
|
//#region src/components/Popover/PopoverContent.vue
|
|
11058
|
-
const _sfc_main$
|
|
11475
|
+
const _sfc_main$29 = /* @__PURE__ */ defineComponent({
|
|
11059
11476
|
name: "PopoverContent",
|
|
11060
11477
|
__name: "PopoverContent",
|
|
11061
11478
|
props: {
|
|
@@ -11122,7 +11539,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
11122
11539
|
};
|
|
11123
11540
|
}
|
|
11124
11541
|
});
|
|
11125
|
-
var PopoverContent_default = _sfc_main$
|
|
11542
|
+
var PopoverContent_default = _sfc_main$29;
|
|
11126
11543
|
|
|
11127
11544
|
//#endregion
|
|
11128
11545
|
//#region src/components/Popover/index.ts
|
|
@@ -11140,7 +11557,7 @@ const Popover = {
|
|
|
11140
11557
|
//#endregion
|
|
11141
11558
|
//#region src/components/Radio/RadioGroup.vue
|
|
11142
11559
|
const [useRadioGroup, provideRadioGroup] = createContext();
|
|
11143
|
-
const _sfc_main$
|
|
11560
|
+
const _sfc_main$28 = /* @__PURE__ */ defineComponent({
|
|
11144
11561
|
name: "RadioGroup",
|
|
11145
11562
|
__name: "RadioGroup",
|
|
11146
11563
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -11202,12 +11619,12 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
11202
11619
|
};
|
|
11203
11620
|
}
|
|
11204
11621
|
});
|
|
11205
|
-
var RadioGroup_default = _sfc_main$
|
|
11622
|
+
var RadioGroup_default = _sfc_main$28;
|
|
11206
11623
|
|
|
11207
11624
|
//#endregion
|
|
11208
11625
|
//#region src/components/Radio/RadioRoot.vue
|
|
11209
11626
|
const [useRadioRoot, provideRadioRoot] = createContext();
|
|
11210
|
-
const _sfc_main$
|
|
11627
|
+
const _sfc_main$27 = /* @__PURE__ */ defineComponent({
|
|
11211
11628
|
name: "RadioRoot",
|
|
11212
11629
|
inheritAttrs: false,
|
|
11213
11630
|
__name: "RadioRoot",
|
|
@@ -11332,18 +11749,18 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
11332
11749
|
};
|
|
11333
11750
|
}
|
|
11334
11751
|
});
|
|
11335
|
-
var RadioRoot_default = _sfc_main$
|
|
11752
|
+
var RadioRoot_default = _sfc_main$27;
|
|
11336
11753
|
|
|
11337
11754
|
//#endregion
|
|
11338
11755
|
//#region src/components/Radio/RadioHiddenInput.vue
|
|
11339
|
-
const _hoisted_1 = [
|
|
11756
|
+
const _hoisted_1$2 = [
|
|
11340
11757
|
"checked",
|
|
11341
11758
|
"disabled",
|
|
11342
11759
|
"form",
|
|
11343
11760
|
"name",
|
|
11344
11761
|
"value"
|
|
11345
11762
|
];
|
|
11346
|
-
const visuallyHiddenStyle = {
|
|
11763
|
+
const visuallyHiddenStyle$1 = {
|
|
11347
11764
|
position: "absolute",
|
|
11348
11765
|
width: "1px",
|
|
11349
11766
|
height: "1px",
|
|
@@ -11354,7 +11771,7 @@ const visuallyHiddenStyle = {
|
|
|
11354
11771
|
whiteSpace: "nowrap",
|
|
11355
11772
|
border: "0"
|
|
11356
11773
|
};
|
|
11357
|
-
const _sfc_main$
|
|
11774
|
+
const _sfc_main$26 = /* @__PURE__ */ defineComponent({
|
|
11358
11775
|
name: "RadioHiddenInput",
|
|
11359
11776
|
__name: "RadioHiddenInput",
|
|
11360
11777
|
props: {
|
|
@@ -11381,19 +11798,19 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
|
11381
11798
|
form: form.value,
|
|
11382
11799
|
inert: "",
|
|
11383
11800
|
name: name.value,
|
|
11384
|
-
style: visuallyHiddenStyle,
|
|
11801
|
+
style: visuallyHiddenStyle$1,
|
|
11385
11802
|
tabindex: "-1",
|
|
11386
11803
|
type: "radio",
|
|
11387
11804
|
value: value.value
|
|
11388
|
-
}, null, 8, _hoisted_1);
|
|
11805
|
+
}, null, 8, _hoisted_1$2);
|
|
11389
11806
|
};
|
|
11390
11807
|
}
|
|
11391
11808
|
});
|
|
11392
|
-
var RadioHiddenInput_default = _sfc_main$
|
|
11809
|
+
var RadioHiddenInput_default = _sfc_main$26;
|
|
11393
11810
|
|
|
11394
11811
|
//#endregion
|
|
11395
11812
|
//#region src/components/Radio/RadioIndicator.vue
|
|
11396
|
-
const _sfc_main$
|
|
11813
|
+
const _sfc_main$25 = /* @__PURE__ */ defineComponent({
|
|
11397
11814
|
name: "RadioIndicator",
|
|
11398
11815
|
__name: "RadioIndicator",
|
|
11399
11816
|
props: {
|
|
@@ -11423,7 +11840,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
11423
11840
|
};
|
|
11424
11841
|
}
|
|
11425
11842
|
});
|
|
11426
|
-
var RadioIndicator_default = _sfc_main$
|
|
11843
|
+
var RadioIndicator_default = _sfc_main$25;
|
|
11427
11844
|
|
|
11428
11845
|
//#endregion
|
|
11429
11846
|
//#region src/components/Radio/index.ts
|
|
@@ -11468,7 +11885,7 @@ const Radio = {
|
|
|
11468
11885
|
|
|
11469
11886
|
//#endregion
|
|
11470
11887
|
//#region src/components/Scrim/Scrim.vue
|
|
11471
|
-
const _sfc_main$
|
|
11888
|
+
const _sfc_main$24 = /* @__PURE__ */ defineComponent({
|
|
11472
11889
|
name: "Scrim",
|
|
11473
11890
|
inheritAttrs: false,
|
|
11474
11891
|
__name: "Scrim",
|
|
@@ -11543,12 +11960,12 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
11543
11960
|
};
|
|
11544
11961
|
}
|
|
11545
11962
|
});
|
|
11546
|
-
var Scrim_default = _sfc_main$
|
|
11963
|
+
var Scrim_default = _sfc_main$24;
|
|
11547
11964
|
|
|
11548
11965
|
//#endregion
|
|
11549
11966
|
//#region src/components/Selection/SelectionRoot.vue
|
|
11550
11967
|
const [useSelectionRoot, provideSelectionRoot] = createContext();
|
|
11551
|
-
const _sfc_main$
|
|
11968
|
+
const _sfc_main$23 = /* @__PURE__ */ defineComponent({
|
|
11552
11969
|
name: "SelectionRoot",
|
|
11553
11970
|
__name: "SelectionRoot",
|
|
11554
11971
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -11598,11 +12015,11 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
11598
12015
|
};
|
|
11599
12016
|
}
|
|
11600
12017
|
});
|
|
11601
|
-
var SelectionRoot_default = _sfc_main$
|
|
12018
|
+
var SelectionRoot_default = _sfc_main$23;
|
|
11602
12019
|
|
|
11603
12020
|
//#endregion
|
|
11604
12021
|
//#region src/components/Selection/SelectionItem.vue
|
|
11605
|
-
const _sfc_main$
|
|
12022
|
+
const _sfc_main$22 = /* @__PURE__ */ defineComponent({
|
|
11606
12023
|
name: "SelectionItem",
|
|
11607
12024
|
__name: "SelectionItem",
|
|
11608
12025
|
props: {
|
|
@@ -11644,7 +12061,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
11644
12061
|
};
|
|
11645
12062
|
}
|
|
11646
12063
|
});
|
|
11647
|
-
var SelectionItem_default = _sfc_main$
|
|
12064
|
+
var SelectionItem_default = _sfc_main$22;
|
|
11648
12065
|
|
|
11649
12066
|
//#endregion
|
|
11650
12067
|
//#region src/components/Selection/index.ts
|
|
@@ -11658,6 +12075,1462 @@ const Selection = {
|
|
|
11658
12075
|
Item: SelectionItem_default
|
|
11659
12076
|
};
|
|
11660
12077
|
|
|
12078
|
+
//#endregion
|
|
12079
|
+
//#region src/components/Slider/SliderRoot.vue
|
|
12080
|
+
const [useSliderRoot, provideSliderRoot] = createContext();
|
|
12081
|
+
const _sfc_main$21 = /* @__PURE__ */ defineComponent({
|
|
12082
|
+
name: "SliderRoot",
|
|
12083
|
+
inheritAttrs: false,
|
|
12084
|
+
__name: "SliderRoot",
|
|
12085
|
+
props: /* @__PURE__ */ mergeModels({
|
|
12086
|
+
id: { default: () => useId$1() },
|
|
12087
|
+
min: { default: 0 },
|
|
12088
|
+
max: { default: 100 },
|
|
12089
|
+
step: { default: 1 },
|
|
12090
|
+
disabled: { default: false },
|
|
12091
|
+
readonly: { default: false },
|
|
12092
|
+
orientation: { default: "horizontal" },
|
|
12093
|
+
inverted: {
|
|
12094
|
+
type: Boolean,
|
|
12095
|
+
default: false
|
|
12096
|
+
},
|
|
12097
|
+
minStepsBetweenThumbs: { default: 0 },
|
|
12098
|
+
crossover: {
|
|
12099
|
+
type: Boolean,
|
|
12100
|
+
default: false
|
|
12101
|
+
},
|
|
12102
|
+
name: {},
|
|
12103
|
+
form: {},
|
|
12104
|
+
namespace: { default: "v0:slider:root" },
|
|
12105
|
+
as: { default: "div" },
|
|
12106
|
+
renderless: { type: Boolean }
|
|
12107
|
+
}, {
|
|
12108
|
+
"modelValue": { default: () => [] },
|
|
12109
|
+
"modelModifiers": {}
|
|
12110
|
+
}),
|
|
12111
|
+
emits: /* @__PURE__ */ mergeModels([
|
|
12112
|
+
"update:model-value",
|
|
12113
|
+
"start",
|
|
12114
|
+
"end"
|
|
12115
|
+
], ["update:modelValue"]),
|
|
12116
|
+
setup(__props, { emit: __emit }) {
|
|
12117
|
+
const attrs = useAttrs();
|
|
12118
|
+
const emit = __emit;
|
|
12119
|
+
const model = useModel(__props, "modelValue");
|
|
12120
|
+
const scalar = !/* @__PURE__ */ isArray(model.value) && !/* @__PURE__ */ isUndefined(model.value);
|
|
12121
|
+
const internal = computed({
|
|
12122
|
+
get: () => /* @__PURE__ */ isArray(model.value) ? model.value : [model.value],
|
|
12123
|
+
set: (arr) => {
|
|
12124
|
+
model.value = scalar ? arr[0] ?? 0 : arr;
|
|
12125
|
+
}
|
|
12126
|
+
});
|
|
12127
|
+
const slider = createSlider({
|
|
12128
|
+
min: __props.min,
|
|
12129
|
+
max: __props.max,
|
|
12130
|
+
step: __props.step,
|
|
12131
|
+
disabled: __props.disabled,
|
|
12132
|
+
readonly: __props.readonly,
|
|
12133
|
+
orientation: __props.orientation,
|
|
12134
|
+
inverted: __props.inverted,
|
|
12135
|
+
minStepsBetweenThumbs: __props.minStepsBetweenThumbs,
|
|
12136
|
+
crossover: __props.crossover
|
|
12137
|
+
});
|
|
12138
|
+
useProxyModel(slider, internal, { multiple: true });
|
|
12139
|
+
const dragging = shallowRef(null);
|
|
12140
|
+
const track = shallowRef(null);
|
|
12141
|
+
const dragOffset = shallowRef(0);
|
|
12142
|
+
function getPercent(e) {
|
|
12143
|
+
const el = track.value;
|
|
12144
|
+
if (!el) return 0;
|
|
12145
|
+
const rect = el.getBoundingClientRect();
|
|
12146
|
+
return toValue(slider.orientation) === "vertical" ? (rect.bottom - e.clientY - dragOffset.value) / rect.height * 100 : (e.clientX - rect.left - dragOffset.value) / rect.width * 100;
|
|
12147
|
+
}
|
|
12148
|
+
useToggleScope(() => !/* @__PURE__ */ isNull(dragging.value), () => {
|
|
12149
|
+
if (IN_BROWSER) document.documentElement.style.touchAction = "none";
|
|
12150
|
+
useDocumentEventListener("pointermove", (e) => {
|
|
12151
|
+
if (/* @__PURE__ */ isNull(dragging.value)) return;
|
|
12152
|
+
const percent = getPercent(e);
|
|
12153
|
+
slider.set(dragging.value, slider.fromPercent(percent));
|
|
12154
|
+
});
|
|
12155
|
+
useDocumentEventListener("pointerup", () => {
|
|
12156
|
+
if (IN_BROWSER) document.documentElement.style.touchAction = "";
|
|
12157
|
+
const values = [...slider.values.value];
|
|
12158
|
+
emit("end", scalar ? values[0] ?? 0 : values);
|
|
12159
|
+
dragging.value = null;
|
|
12160
|
+
dragOffset.value = 0;
|
|
12161
|
+
});
|
|
12162
|
+
});
|
|
12163
|
+
function onDrag(index, event, thumbEl) {
|
|
12164
|
+
if (toValue(__props.disabled)) return;
|
|
12165
|
+
if (toValue(__props.readonly)) return;
|
|
12166
|
+
if (event.button !== 0) return;
|
|
12167
|
+
event.preventDefault();
|
|
12168
|
+
if (thumbEl) {
|
|
12169
|
+
const rect = thumbEl.getBoundingClientRect();
|
|
12170
|
+
dragOffset.value = toValue(slider.orientation) === "vertical" ? event.clientY - (rect.top + rect.height / 2) : event.clientX - (rect.left + rect.width / 2);
|
|
12171
|
+
} else dragOffset.value = 0;
|
|
12172
|
+
dragging.value = index;
|
|
12173
|
+
const values = [...slider.values.value];
|
|
12174
|
+
emit("start", scalar ? values[0] ?? 0 : values);
|
|
12175
|
+
}
|
|
12176
|
+
const context = {
|
|
12177
|
+
...slider,
|
|
12178
|
+
id: __props.id,
|
|
12179
|
+
name: __props.name,
|
|
12180
|
+
form: __props.form,
|
|
12181
|
+
dragging,
|
|
12182
|
+
track,
|
|
12183
|
+
onDrag
|
|
12184
|
+
};
|
|
12185
|
+
provideSliderRoot(__props.namespace, context);
|
|
12186
|
+
const isDisabled = toRef(() => toValue(__props.disabled));
|
|
12187
|
+
const isReadonly = toRef(() => toValue(__props.readonly));
|
|
12188
|
+
const slotProps = toRef(() => ({
|
|
12189
|
+
id: __props.id,
|
|
12190
|
+
values: slider.values.value,
|
|
12191
|
+
min: __props.min,
|
|
12192
|
+
max: __props.max,
|
|
12193
|
+
isDisabled: isDisabled.value,
|
|
12194
|
+
isReadonly: isReadonly.value,
|
|
12195
|
+
orientation: toValue(slider.orientation),
|
|
12196
|
+
attrs: {
|
|
12197
|
+
"data-disabled": isDisabled.value ? true : void 0,
|
|
12198
|
+
"data-readonly": isReadonly.value ? true : void 0,
|
|
12199
|
+
"data-orientation": toValue(slider.orientation)
|
|
12200
|
+
}
|
|
12201
|
+
}));
|
|
12202
|
+
return (_ctx, _cache) => {
|
|
12203
|
+
return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(Atom_default), mergeProps({
|
|
12204
|
+
...unref(attrs),
|
|
12205
|
+
...slotProps.value.attrs
|
|
12206
|
+
}, {
|
|
12207
|
+
as: __props.as,
|
|
12208
|
+
renderless: __props.renderless
|
|
12209
|
+
}), {
|
|
12210
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
12211
|
+
_: 3
|
|
12212
|
+
}, 16, ["as", "renderless"]), __props.name ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(slider).values.value, (_, index) => {
|
|
12213
|
+
return openBlock(), createBlock(SliderHiddenInput_default, {
|
|
12214
|
+
key: index,
|
|
12215
|
+
index
|
|
12216
|
+
}, null, 8, ["index"]);
|
|
12217
|
+
}), 128)) : createCommentVNode("v-if", true)], 64);
|
|
12218
|
+
};
|
|
12219
|
+
}
|
|
12220
|
+
});
|
|
12221
|
+
var SliderRoot_default = _sfc_main$21;
|
|
12222
|
+
|
|
12223
|
+
//#endregion
|
|
12224
|
+
//#region src/components/Slider/SliderHiddenInput.vue
|
|
12225
|
+
const _hoisted_1$1 = [
|
|
12226
|
+
"disabled",
|
|
12227
|
+
"form",
|
|
12228
|
+
"name",
|
|
12229
|
+
"value"
|
|
12230
|
+
];
|
|
12231
|
+
const _sfc_main$20 = /* @__PURE__ */ defineComponent({
|
|
12232
|
+
name: "SliderHiddenInput",
|
|
12233
|
+
__name: "SliderHiddenInput",
|
|
12234
|
+
props: {
|
|
12235
|
+
namespace: { default: "v0:slider:root" },
|
|
12236
|
+
index: { default: 0 }
|
|
12237
|
+
},
|
|
12238
|
+
setup(__props) {
|
|
12239
|
+
const root = useSliderRoot(__props.namespace);
|
|
12240
|
+
const value = toRef(() => root.values.value[__props.index] ?? root.min);
|
|
12241
|
+
const isDisabled = toRef(() => toValue(root.disabled));
|
|
12242
|
+
return (_ctx, _cache) => {
|
|
12243
|
+
return openBlock(), createElementBlock("input", {
|
|
12244
|
+
disabled: isDisabled.value,
|
|
12245
|
+
form: unref(root).form,
|
|
12246
|
+
name: unref(root).name,
|
|
12247
|
+
tabindex: "-1",
|
|
12248
|
+
type: "hidden",
|
|
12249
|
+
value: value.value
|
|
12250
|
+
}, null, 8, _hoisted_1$1);
|
|
12251
|
+
};
|
|
12252
|
+
}
|
|
12253
|
+
});
|
|
12254
|
+
var SliderHiddenInput_default = _sfc_main$20;
|
|
12255
|
+
|
|
12256
|
+
//#endregion
|
|
12257
|
+
//#region src/components/Slider/SliderRange.vue
|
|
12258
|
+
const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
12259
|
+
name: "SliderRange",
|
|
12260
|
+
inheritAttrs: false,
|
|
12261
|
+
__name: "SliderRange",
|
|
12262
|
+
props: {
|
|
12263
|
+
namespace: { default: "v0:slider:root" },
|
|
12264
|
+
as: { default: "span" },
|
|
12265
|
+
renderless: { type: Boolean }
|
|
12266
|
+
},
|
|
12267
|
+
setup(__props) {
|
|
12268
|
+
const attrs = useAttrs();
|
|
12269
|
+
const root = useSliderRoot(__props.namespace);
|
|
12270
|
+
const rawStart = toRef(() => {
|
|
12271
|
+
const values = root.values.value;
|
|
12272
|
+
if (values.length === 0) return 0;
|
|
12273
|
+
if (values.length === 1) return root.fromValue(root.min);
|
|
12274
|
+
return root.fromValue(Math.min(...values));
|
|
12275
|
+
});
|
|
12276
|
+
const rawEnd = toRef(() => {
|
|
12277
|
+
const values = root.values.value;
|
|
12278
|
+
if (values.length === 0) return 0;
|
|
12279
|
+
if (values.length === 1) return root.fromValue(values[0]);
|
|
12280
|
+
return root.fromValue(Math.max(...values));
|
|
12281
|
+
});
|
|
12282
|
+
const start = toRef(() => Math.min(rawStart.value, rawEnd.value));
|
|
12283
|
+
const end = toRef(() => Math.max(rawStart.value, rawEnd.value));
|
|
12284
|
+
const isVertical = toRef(() => toValue(root.orientation) === "vertical");
|
|
12285
|
+
const slotProps = toRef(() => ({
|
|
12286
|
+
start: start.value,
|
|
12287
|
+
end: end.value,
|
|
12288
|
+
attrs: {
|
|
12289
|
+
"data-disabled": toValue(root.disabled) ? true : void 0,
|
|
12290
|
+
"data-readonly": toValue(root.readonly) ? true : void 0,
|
|
12291
|
+
"data-orientation": toValue(root.orientation),
|
|
12292
|
+
"style": {
|
|
12293
|
+
[isVertical.value ? "bottom" : "left"]: `${start.value}%`,
|
|
12294
|
+
[isVertical.value ? "height" : "width"]: `${end.value - start.value}%`
|
|
12295
|
+
}
|
|
12296
|
+
}
|
|
12297
|
+
}));
|
|
12298
|
+
return (_ctx, _cache) => {
|
|
12299
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps({
|
|
12300
|
+
...unref(attrs),
|
|
12301
|
+
...slotProps.value.attrs
|
|
12302
|
+
}, {
|
|
12303
|
+
as: __props.as,
|
|
12304
|
+
renderless: __props.renderless,
|
|
12305
|
+
style: [unref(attrs).style, slotProps.value.attrs.style]
|
|
12306
|
+
}), {
|
|
12307
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
12308
|
+
_: 3
|
|
12309
|
+
}, 16, [
|
|
12310
|
+
"as",
|
|
12311
|
+
"renderless",
|
|
12312
|
+
"style"
|
|
12313
|
+
]);
|
|
12314
|
+
};
|
|
12315
|
+
}
|
|
12316
|
+
});
|
|
12317
|
+
var SliderRange_default = _sfc_main$19;
|
|
12318
|
+
|
|
12319
|
+
//#endregion
|
|
12320
|
+
//#region src/components/Slider/SliderThumb.vue
|
|
12321
|
+
const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
12322
|
+
name: "SliderThumb",
|
|
12323
|
+
inheritAttrs: false,
|
|
12324
|
+
__name: "SliderThumb",
|
|
12325
|
+
props: {
|
|
12326
|
+
namespace: { default: "v0:slider:root" },
|
|
12327
|
+
ariaLabel: {},
|
|
12328
|
+
ariaLabelledby: {},
|
|
12329
|
+
ariaValuetext: {},
|
|
12330
|
+
as: { default: "span" },
|
|
12331
|
+
renderless: { type: Boolean }
|
|
12332
|
+
},
|
|
12333
|
+
setup(__props) {
|
|
12334
|
+
const attrs = useAttrs();
|
|
12335
|
+
const root = useSliderRoot(__props.namespace);
|
|
12336
|
+
const thumbRef = useTemplateRef("thumb");
|
|
12337
|
+
const ticket = root.register();
|
|
12338
|
+
onUnmounted(() => {
|
|
12339
|
+
root.unregister(ticket.id);
|
|
12340
|
+
});
|
|
12341
|
+
const index = toRef(() => ticket.index);
|
|
12342
|
+
const value = toRef(() => toValue(ticket.value));
|
|
12343
|
+
const pct = toRef(() => root.fromValue(value.value));
|
|
12344
|
+
const isDragging = toRef(() => root.dragging.value === index.value);
|
|
12345
|
+
const isDisabled = toRef(() => toValue(root.disabled));
|
|
12346
|
+
const isReadonly = toRef(() => toValue(root.readonly));
|
|
12347
|
+
const isVertical = toRef(() => toValue(root.orientation) === "vertical");
|
|
12348
|
+
const valueMin = toRef(() => {
|
|
12349
|
+
if (root.crossover) return root.min;
|
|
12350
|
+
const prev = root.values.value[index.value - 1];
|
|
12351
|
+
return /* @__PURE__ */ isUndefined(prev) ? root.min : prev;
|
|
12352
|
+
});
|
|
12353
|
+
const valueMax = toRef(() => {
|
|
12354
|
+
if (root.crossover) return root.max;
|
|
12355
|
+
const next = root.values.value[index.value + 1];
|
|
12356
|
+
return /* @__PURE__ */ isUndefined(next) ? root.max : next;
|
|
12357
|
+
});
|
|
12358
|
+
function onPointerdown(e) {
|
|
12359
|
+
root.onDrag(index.value, e, thumbRef.value?.element ?? void 0);
|
|
12360
|
+
}
|
|
12361
|
+
function onKeydown(e) {
|
|
12362
|
+
if (isDisabled.value || isReadonly.value) return;
|
|
12363
|
+
const isInverted = toValue(root.inverted);
|
|
12364
|
+
const actions = {
|
|
12365
|
+
ArrowRight: () => isInverted ? root.down(index.value) : root.up(index.value),
|
|
12366
|
+
ArrowUp: () => root.up(index.value),
|
|
12367
|
+
ArrowLeft: () => isInverted ? root.up(index.value) : root.down(index.value),
|
|
12368
|
+
ArrowDown: () => root.down(index.value),
|
|
12369
|
+
PageUp: () => root.up(index.value, 10),
|
|
12370
|
+
PageDown: () => root.down(index.value, 10),
|
|
12371
|
+
Home: () => root.floor(index.value),
|
|
12372
|
+
End: () => root.ceil(index.value)
|
|
12373
|
+
};
|
|
12374
|
+
if (e.shiftKey && e.key.startsWith("Arrow")) {
|
|
12375
|
+
e.preventDefault();
|
|
12376
|
+
const base = e.key === "ArrowRight" || e.key === "ArrowUp" ? "up" : "down";
|
|
12377
|
+
root[(e.key === "ArrowRight" || e.key === "ArrowLeft") && isInverted ? base === "up" ? "down" : "up" : base](index.value, 10);
|
|
12378
|
+
return;
|
|
12379
|
+
}
|
|
12380
|
+
const action = actions[e.key];
|
|
12381
|
+
if (!action) return;
|
|
12382
|
+
e.preventDefault();
|
|
12383
|
+
action();
|
|
12384
|
+
}
|
|
12385
|
+
const dataState = toRef(() => isDragging.value ? "dragging" : "idle");
|
|
12386
|
+
const slotProps = toRef(() => ({
|
|
12387
|
+
index: index.value,
|
|
12388
|
+
value: value.value,
|
|
12389
|
+
percent: pct.value,
|
|
12390
|
+
isDragging: isDragging.value,
|
|
12391
|
+
attrs: {
|
|
12392
|
+
"role": "slider",
|
|
12393
|
+
"tabindex": isDisabled.value ? -1 : 0,
|
|
12394
|
+
"aria-valuenow": value.value,
|
|
12395
|
+
"aria-valuemin": valueMin.value,
|
|
12396
|
+
"aria-valuemax": valueMax.value,
|
|
12397
|
+
"aria-valuetext": __props.ariaValuetext || void 0,
|
|
12398
|
+
"aria-orientation": toValue(root.orientation),
|
|
12399
|
+
"aria-disabled": isDisabled.value ? true : void 0,
|
|
12400
|
+
"aria-readonly": isReadonly.value ? true : void 0,
|
|
12401
|
+
"aria-label": __props.ariaLabel || void 0,
|
|
12402
|
+
"aria-labelledby": __props.ariaLabelledby || void 0,
|
|
12403
|
+
"data-state": dataState.value,
|
|
12404
|
+
"data-disabled": isDisabled.value ? true : void 0,
|
|
12405
|
+
"data-readonly": isReadonly.value ? true : void 0,
|
|
12406
|
+
"style": {
|
|
12407
|
+
[isVertical.value ? "bottom" : "left"]: `${pct.value}%`,
|
|
12408
|
+
"touch-action": "none"
|
|
12409
|
+
},
|
|
12410
|
+
"onKeydown": onKeydown,
|
|
12411
|
+
"onPointerdown": onPointerdown
|
|
12412
|
+
}
|
|
12413
|
+
}));
|
|
12414
|
+
return (_ctx, _cache) => {
|
|
12415
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps({ ref: "thumb" }, {
|
|
12416
|
+
...unref(attrs),
|
|
12417
|
+
...slotProps.value.attrs
|
|
12418
|
+
}, {
|
|
12419
|
+
as: __props.as,
|
|
12420
|
+
renderless: __props.renderless,
|
|
12421
|
+
style: [unref(attrs).style, slotProps.value.attrs.style]
|
|
12422
|
+
}), {
|
|
12423
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
12424
|
+
_: 3
|
|
12425
|
+
}, 16, [
|
|
12426
|
+
"as",
|
|
12427
|
+
"renderless",
|
|
12428
|
+
"style"
|
|
12429
|
+
]);
|
|
12430
|
+
};
|
|
12431
|
+
}
|
|
12432
|
+
});
|
|
12433
|
+
var SliderThumb_default = _sfc_main$18;
|
|
12434
|
+
|
|
12435
|
+
//#endregion
|
|
12436
|
+
//#region src/components/Slider/SliderTrack.vue
|
|
12437
|
+
const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
12438
|
+
name: "SliderTrack",
|
|
12439
|
+
inheritAttrs: false,
|
|
12440
|
+
__name: "SliderTrack",
|
|
12441
|
+
props: {
|
|
12442
|
+
namespace: { default: "v0:slider:root" },
|
|
12443
|
+
as: { default: "div" },
|
|
12444
|
+
renderless: { type: Boolean }
|
|
12445
|
+
},
|
|
12446
|
+
setup(__props) {
|
|
12447
|
+
const attrs = useAttrs();
|
|
12448
|
+
const root = useSliderRoot(__props.namespace);
|
|
12449
|
+
const trackRef = useTemplateRef("track");
|
|
12450
|
+
watchEffect(() => {
|
|
12451
|
+
root.track.value = trackRef.value?.element ?? null;
|
|
12452
|
+
});
|
|
12453
|
+
function nearest(value) {
|
|
12454
|
+
let closest = 0;
|
|
12455
|
+
let distance = Infinity;
|
|
12456
|
+
for (let index = 0; index < root.values.value.length; index++) {
|
|
12457
|
+
const d = Math.abs(root.values.value[index] - value);
|
|
12458
|
+
if (d < distance) {
|
|
12459
|
+
distance = d;
|
|
12460
|
+
closest = index;
|
|
12461
|
+
}
|
|
12462
|
+
}
|
|
12463
|
+
return closest;
|
|
12464
|
+
}
|
|
12465
|
+
function onPointerdown(e) {
|
|
12466
|
+
if (toValue(root.disabled)) return;
|
|
12467
|
+
if (toValue(root.readonly)) return;
|
|
12468
|
+
if (e.button !== 0) return;
|
|
12469
|
+
const el = trackRef.value?.element;
|
|
12470
|
+
if (!el) return;
|
|
12471
|
+
const rect = el.getBoundingClientRect();
|
|
12472
|
+
const percent = toValue(root.orientation) === "vertical" ? (rect.bottom - e.clientY) / rect.height * 100 : (e.clientX - rect.left) / rect.width * 100;
|
|
12473
|
+
const value = root.fromPercent(percent);
|
|
12474
|
+
const index = nearest(value);
|
|
12475
|
+
root.set(index, value);
|
|
12476
|
+
root.onDrag(index, e);
|
|
12477
|
+
}
|
|
12478
|
+
const slotProps = toRef(() => ({ attrs: {
|
|
12479
|
+
"data-disabled": toValue(root.disabled) ? true : void 0,
|
|
12480
|
+
"data-readonly": toValue(root.readonly) ? true : void 0,
|
|
12481
|
+
"data-orientation": toValue(root.orientation),
|
|
12482
|
+
"style": { "touch-action": "none" },
|
|
12483
|
+
"onPointerdown": onPointerdown
|
|
12484
|
+
} }));
|
|
12485
|
+
return (_ctx, _cache) => {
|
|
12486
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps({ ref: "track" }, {
|
|
12487
|
+
...unref(attrs),
|
|
12488
|
+
...slotProps.value.attrs
|
|
12489
|
+
}, {
|
|
12490
|
+
as: __props.as,
|
|
12491
|
+
renderless: __props.renderless,
|
|
12492
|
+
style: [unref(attrs).style, slotProps.value.attrs.style]
|
|
12493
|
+
}), {
|
|
12494
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
12495
|
+
_: 3
|
|
12496
|
+
}, 16, [
|
|
12497
|
+
"as",
|
|
12498
|
+
"renderless",
|
|
12499
|
+
"style"
|
|
12500
|
+
]);
|
|
12501
|
+
};
|
|
12502
|
+
}
|
|
12503
|
+
});
|
|
12504
|
+
var SliderTrack_default = _sfc_main$17;
|
|
12505
|
+
|
|
12506
|
+
//#endregion
|
|
12507
|
+
//#region src/components/Slider/index.ts
|
|
12508
|
+
/**
|
|
12509
|
+
* Slider component with sub-components for range input controls.
|
|
12510
|
+
*
|
|
12511
|
+
* @see https://0.vuetifyjs.com/components/slider
|
|
12512
|
+
*
|
|
12513
|
+
* @example
|
|
12514
|
+
* ```vue
|
|
12515
|
+
* <script setup lang="ts">
|
|
12516
|
+
* import { Slider } from '@vuetify/v0'
|
|
12517
|
+
* import { ref } from 'vue'
|
|
12518
|
+
*
|
|
12519
|
+
* const value = ref([50])
|
|
12520
|
+
* <\/script>
|
|
12521
|
+
*
|
|
12522
|
+
* <template>
|
|
12523
|
+
* <Slider.Root v-model="value" :min="0" :max="100">
|
|
12524
|
+
* <Slider.Track>
|
|
12525
|
+
* <Slider.Range />
|
|
12526
|
+
* </Slider.Track>
|
|
12527
|
+
* <Slider.Thumb />
|
|
12528
|
+
* </Slider.Root>
|
|
12529
|
+
* </template>
|
|
12530
|
+
* ```
|
|
12531
|
+
*/
|
|
12532
|
+
const Slider = {
|
|
12533
|
+
Root: SliderRoot_default,
|
|
12534
|
+
Track: SliderTrack_default,
|
|
12535
|
+
Range: SliderRange_default,
|
|
12536
|
+
Thumb: SliderThumb_default,
|
|
12537
|
+
HiddenInput: SliderHiddenInput_default
|
|
12538
|
+
};
|
|
12539
|
+
|
|
12540
|
+
//#endregion
|
|
12541
|
+
//#region src/components/Splitter/SplitterRoot.vue
|
|
12542
|
+
const [useSplitterRoot, provideSplitterRoot] = createContext("v0:splitter");
|
|
12543
|
+
const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
12544
|
+
name: "SplitterRoot",
|
|
12545
|
+
inheritAttrs: false,
|
|
12546
|
+
__name: "SplitterRoot",
|
|
12547
|
+
props: {
|
|
12548
|
+
orientation: { default: "horizontal" },
|
|
12549
|
+
disabled: {
|
|
12550
|
+
type: Boolean,
|
|
12551
|
+
default: false
|
|
12552
|
+
},
|
|
12553
|
+
as: { default: "div" },
|
|
12554
|
+
renderless: { type: Boolean }
|
|
12555
|
+
},
|
|
12556
|
+
emits: ["layout"],
|
|
12557
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
12558
|
+
const attrs = useAttrs();
|
|
12559
|
+
const emit = __emit;
|
|
12560
|
+
const rootAtom = useTemplateRef("root");
|
|
12561
|
+
const rootEl = toRef(() => rootAtom.value?.element ?? null);
|
|
12562
|
+
const draggingHandle = shallowRef(null);
|
|
12563
|
+
const dragging = toRef(() => !/* @__PURE__ */ isNull(draggingHandle.value));
|
|
12564
|
+
const panels = createSelection({
|
|
12565
|
+
multiple: true,
|
|
12566
|
+
enroll: true,
|
|
12567
|
+
reactive: true
|
|
12568
|
+
});
|
|
12569
|
+
const handles = createRegistry();
|
|
12570
|
+
watch(() => panels.collection.size, (size, prev) => {
|
|
12571
|
+
const values = panels.values();
|
|
12572
|
+
if (values.length === 0) return;
|
|
12573
|
+
const total = values.reduce((sum, t) => sum + t.size, 0);
|
|
12574
|
+
if (total === 0 || total === 100) return;
|
|
12575
|
+
distribute(!/* @__PURE__ */ isUndefined(prev) && size > prev ? values.map((t) => t.defaultSize) : values.map((t) => t.size));
|
|
12576
|
+
}, { flush: "post" });
|
|
12577
|
+
function panel(index) {
|
|
12578
|
+
const id = panels.lookup(index);
|
|
12579
|
+
return /* @__PURE__ */ isNullOrUndefined(id) ? void 0 : panels.get(id);
|
|
12580
|
+
}
|
|
12581
|
+
function effectiveMin(ticket) {
|
|
12582
|
+
return ticket.collapsible && !toValue(ticket.isSelected) ? ticket.collapsedSize : ticket.minSize;
|
|
12583
|
+
}
|
|
12584
|
+
function resize(index, delta, options) {
|
|
12585
|
+
const before = panel(index);
|
|
12586
|
+
const after = panel(index + 1);
|
|
12587
|
+
if (!before || !after) return;
|
|
12588
|
+
const total = before.size + after.size;
|
|
12589
|
+
const min1 = effectiveMin(before);
|
|
12590
|
+
const min2 = effectiveMin(after);
|
|
12591
|
+
const lower = Math.max(min1, total - after.maxSize);
|
|
12592
|
+
const upper = Math.min(before.maxSize, total - min2);
|
|
12593
|
+
const size = /* @__PURE__ */ clamp(before.size + delta, lower, upper);
|
|
12594
|
+
before.size = size;
|
|
12595
|
+
after.size = total - size;
|
|
12596
|
+
for (const p of [before, after]) {
|
|
12597
|
+
if (!p.collapsible) continue;
|
|
12598
|
+
const collapsed = !toValue(p.isSelected);
|
|
12599
|
+
if (!collapsed && p.size <= p.collapsedSize) p.unselect();
|
|
12600
|
+
else if (collapsed && p.size > p.collapsedSize) p.select();
|
|
12601
|
+
}
|
|
12602
|
+
if (options?.emit) emitLayout();
|
|
12603
|
+
}
|
|
12604
|
+
function collapse(index, neighborIndex) {
|
|
12605
|
+
const ticket = panel(index);
|
|
12606
|
+
if (!ticket?.collapsible || !toValue(ticket.isSelected)) return;
|
|
12607
|
+
const neighbor = panel(neighborIndex ?? (index > 0 ? index - 1 : index + 1));
|
|
12608
|
+
if (!neighbor) return;
|
|
12609
|
+
const diff = ticket.size - ticket.collapsedSize;
|
|
12610
|
+
const absorbed = Math.min(diff, neighbor.maxSize - neighbor.size);
|
|
12611
|
+
neighbor.size += absorbed;
|
|
12612
|
+
ticket.size = ticket.collapsedSize;
|
|
12613
|
+
let remaining = diff - absorbed;
|
|
12614
|
+
if (remaining > 0) for (const p of panels.values()) {
|
|
12615
|
+
if (p.id === ticket.id || p.id === neighbor.id || remaining <= 0) continue;
|
|
12616
|
+
const room = p.maxSize - p.size;
|
|
12617
|
+
const take = Math.min(remaining, room);
|
|
12618
|
+
p.size += take;
|
|
12619
|
+
remaining -= take;
|
|
12620
|
+
}
|
|
12621
|
+
if (remaining > 0) ticket.size += remaining;
|
|
12622
|
+
if (ticket.size <= ticket.collapsedSize) ticket.unselect();
|
|
12623
|
+
emitLayout();
|
|
12624
|
+
}
|
|
12625
|
+
function expand(index, neighborIndex) {
|
|
12626
|
+
const ticket = panel(index);
|
|
12627
|
+
if (!ticket?.collapsible || toValue(ticket.isSelected)) return;
|
|
12628
|
+
const neighbor = panel(neighborIndex ?? (index > 0 ? index - 1 : index + 1));
|
|
12629
|
+
if (!neighbor) return;
|
|
12630
|
+
const diff = Math.min(ticket.defaultSize, ticket.maxSize) - ticket.collapsedSize;
|
|
12631
|
+
const available = neighbor.size - neighbor.minSize;
|
|
12632
|
+
const take = Math.min(diff, available);
|
|
12633
|
+
if (ticket.collapsedSize + take < ticket.minSize) return;
|
|
12634
|
+
neighbor.size -= take;
|
|
12635
|
+
ticket.size = ticket.collapsedSize + take;
|
|
12636
|
+
ticket.select();
|
|
12637
|
+
emitLayout();
|
|
12638
|
+
}
|
|
12639
|
+
function distribute(incoming) {
|
|
12640
|
+
const values = panels.values();
|
|
12641
|
+
if (incoming.length !== values.length) return;
|
|
12642
|
+
for (const [index, ticket] of values.entries()) {
|
|
12643
|
+
const value = incoming[index];
|
|
12644
|
+
ticket.size = /* @__PURE__ */ clamp(value, ticket.collapsible && value <= ticket.collapsedSize ? ticket.collapsedSize : ticket.minSize, ticket.maxSize);
|
|
12645
|
+
}
|
|
12646
|
+
let remainder = 100 - values.reduce((sum, t) => sum + t.size, 0);
|
|
12647
|
+
for (const ticket of values) {
|
|
12648
|
+
if (remainder === 0) break;
|
|
12649
|
+
const min = ticket.collapsible && ticket.size <= ticket.collapsedSize ? ticket.collapsedSize : ticket.minSize;
|
|
12650
|
+
const room = remainder > 0 ? ticket.maxSize - ticket.size : ticket.size - min;
|
|
12651
|
+
const adjust = remainder > 0 ? Math.min(remainder, room) : Math.max(remainder, -room);
|
|
12652
|
+
ticket.size += adjust;
|
|
12653
|
+
remainder -= adjust;
|
|
12654
|
+
}
|
|
12655
|
+
for (const ticket of values) {
|
|
12656
|
+
if (!ticket.collapsible) continue;
|
|
12657
|
+
const collapsed = !toValue(ticket.isSelected);
|
|
12658
|
+
if (!collapsed && ticket.size <= ticket.collapsedSize) ticket.unselect();
|
|
12659
|
+
else if (collapsed && ticket.size > ticket.collapsedSize) ticket.select();
|
|
12660
|
+
}
|
|
12661
|
+
emit("layout", values.map((t) => t.size));
|
|
12662
|
+
}
|
|
12663
|
+
function onStartDrag(index) {
|
|
12664
|
+
draggingHandle.value = index;
|
|
12665
|
+
}
|
|
12666
|
+
function onEndDrag() {
|
|
12667
|
+
draggingHandle.value = null;
|
|
12668
|
+
emitLayout();
|
|
12669
|
+
}
|
|
12670
|
+
function emitLayout() {
|
|
12671
|
+
emit("layout", panels.values().map((t) => t.size));
|
|
12672
|
+
}
|
|
12673
|
+
provideSplitterRoot({
|
|
12674
|
+
orientation: toRef(() => __props.orientation),
|
|
12675
|
+
disabled: toRef(() => __props.disabled),
|
|
12676
|
+
panels,
|
|
12677
|
+
handles,
|
|
12678
|
+
dragging,
|
|
12679
|
+
draggingHandle,
|
|
12680
|
+
rootEl,
|
|
12681
|
+
panel,
|
|
12682
|
+
resize,
|
|
12683
|
+
onStartDrag,
|
|
12684
|
+
onEndDrag,
|
|
12685
|
+
collapse,
|
|
12686
|
+
expand,
|
|
12687
|
+
distribute
|
|
12688
|
+
});
|
|
12689
|
+
__expose({ distribute });
|
|
12690
|
+
const slotProps = toRef(() => ({
|
|
12691
|
+
orientation: __props.orientation,
|
|
12692
|
+
isDisabled: __props.disabled,
|
|
12693
|
+
sizes: panels.values().map((t) => t.size),
|
|
12694
|
+
isDragging: dragging.value,
|
|
12695
|
+
distribute,
|
|
12696
|
+
attrs: {
|
|
12697
|
+
"data-orientation": __props.orientation,
|
|
12698
|
+
"data-dragging": dragging.value || void 0
|
|
12699
|
+
}
|
|
12700
|
+
}));
|
|
12701
|
+
return (_ctx, _cache) => {
|
|
12702
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps({ ref: "root" }, {
|
|
12703
|
+
...unref(attrs),
|
|
12704
|
+
...slotProps.value.attrs
|
|
12705
|
+
}, {
|
|
12706
|
+
as: __props.as,
|
|
12707
|
+
renderless: __props.renderless,
|
|
12708
|
+
style: {
|
|
12709
|
+
display: "flex",
|
|
12710
|
+
flexDirection: __props.orientation === "horizontal" ? "row" : "column"
|
|
12711
|
+
}
|
|
12712
|
+
}), {
|
|
12713
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
12714
|
+
_: 3
|
|
12715
|
+
}, 16, [
|
|
12716
|
+
"as",
|
|
12717
|
+
"renderless",
|
|
12718
|
+
"style"
|
|
12719
|
+
]);
|
|
12720
|
+
};
|
|
12721
|
+
}
|
|
12722
|
+
});
|
|
12723
|
+
var SplitterRoot_default = _sfc_main$16;
|
|
12724
|
+
|
|
12725
|
+
//#endregion
|
|
12726
|
+
//#region src/components/Splitter/SplitterPanel.vue
|
|
12727
|
+
const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
12728
|
+
name: "SplitterPanel",
|
|
12729
|
+
inheritAttrs: false,
|
|
12730
|
+
__name: "SplitterPanel",
|
|
12731
|
+
props: /* @__PURE__ */ mergeModels({
|
|
12732
|
+
defaultSize: {},
|
|
12733
|
+
minSize: { default: 0 },
|
|
12734
|
+
maxSize: { default: 100 },
|
|
12735
|
+
collapsible: {
|
|
12736
|
+
type: Boolean,
|
|
12737
|
+
default: false
|
|
12738
|
+
},
|
|
12739
|
+
collapsedSize: { default: 0 },
|
|
12740
|
+
as: { default: "div" },
|
|
12741
|
+
renderless: { type: Boolean }
|
|
12742
|
+
}, {
|
|
12743
|
+
"collapsed": {
|
|
12744
|
+
type: Boolean,
|
|
12745
|
+
default: void 0
|
|
12746
|
+
},
|
|
12747
|
+
"collapsedModifiers": {}
|
|
12748
|
+
}),
|
|
12749
|
+
emits: /* @__PURE__ */ mergeModels(["update:collapsed", "resize"], ["update:collapsed"]),
|
|
12750
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
12751
|
+
const attrs = useAttrs();
|
|
12752
|
+
const collapsed = useModel(__props, "collapsed");
|
|
12753
|
+
const emit = __emit;
|
|
12754
|
+
const splitter = useSplitterRoot();
|
|
12755
|
+
const panelId = /* @__PURE__ */ useId();
|
|
12756
|
+
const ticket = splitter.panels.register({
|
|
12757
|
+
id: panelId,
|
|
12758
|
+
size: __props.defaultSize,
|
|
12759
|
+
minSize: __props.minSize,
|
|
12760
|
+
maxSize: __props.maxSize,
|
|
12761
|
+
collapsible: __props.collapsible,
|
|
12762
|
+
collapsedSize: __props.collapsedSize,
|
|
12763
|
+
defaultSize: __props.defaultSize
|
|
12764
|
+
});
|
|
12765
|
+
watchEffect(() => {
|
|
12766
|
+
ticket.minSize = __props.minSize;
|
|
12767
|
+
ticket.maxSize = __props.maxSize;
|
|
12768
|
+
ticket.collapsible = __props.collapsible;
|
|
12769
|
+
ticket.collapsedSize = __props.collapsedSize;
|
|
12770
|
+
ticket.defaultSize = __props.defaultSize;
|
|
12771
|
+
});
|
|
12772
|
+
onUnmounted(() => {
|
|
12773
|
+
splitter.panels.unregister(ticket.id);
|
|
12774
|
+
});
|
|
12775
|
+
const size = toRef(() => ticket.size);
|
|
12776
|
+
const isCollapsed = toRef(() => __props.collapsible && !toValue(ticket.isSelected));
|
|
12777
|
+
function collapse() {
|
|
12778
|
+
splitter.collapse(ticket.index);
|
|
12779
|
+
}
|
|
12780
|
+
function expand() {
|
|
12781
|
+
splitter.expand(ticket.index);
|
|
12782
|
+
}
|
|
12783
|
+
__expose({
|
|
12784
|
+
collapse,
|
|
12785
|
+
expand,
|
|
12786
|
+
size,
|
|
12787
|
+
isCollapsed
|
|
12788
|
+
});
|
|
12789
|
+
watch(collapsed, (val) => {
|
|
12790
|
+
if (val === void 0) return;
|
|
12791
|
+
if (val && !isCollapsed.value) collapse();
|
|
12792
|
+
else if (!val && isCollapsed.value) expand();
|
|
12793
|
+
}, {
|
|
12794
|
+
immediate: true,
|
|
12795
|
+
flush: "post"
|
|
12796
|
+
});
|
|
12797
|
+
watch(isCollapsed, (val) => {
|
|
12798
|
+
if (collapsed.value === void 0) return;
|
|
12799
|
+
collapsed.value = val;
|
|
12800
|
+
});
|
|
12801
|
+
watch(size, (val) => emit("resize", val));
|
|
12802
|
+
const slotProps = toRef(() => ({
|
|
12803
|
+
size: size.value,
|
|
12804
|
+
isCollapsed: isCollapsed.value,
|
|
12805
|
+
collapse,
|
|
12806
|
+
expand,
|
|
12807
|
+
attrs: {
|
|
12808
|
+
"id": panelId,
|
|
12809
|
+
"data-orientation": splitter.orientation.value,
|
|
12810
|
+
"data-panel-index": ticket.index,
|
|
12811
|
+
"data-collapsed": isCollapsed.value || void 0
|
|
12812
|
+
}
|
|
12813
|
+
}));
|
|
12814
|
+
return (_ctx, _cache) => {
|
|
12815
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps({
|
|
12816
|
+
...unref(attrs),
|
|
12817
|
+
...slotProps.value.attrs
|
|
12818
|
+
}, {
|
|
12819
|
+
as: __props.as,
|
|
12820
|
+
renderless: __props.renderless,
|
|
12821
|
+
style: {
|
|
12822
|
+
flexGrow: 0,
|
|
12823
|
+
flexShrink: 0,
|
|
12824
|
+
flexBasis: `${size.value}%`,
|
|
12825
|
+
overflow: "hidden"
|
|
12826
|
+
}
|
|
12827
|
+
}), {
|
|
12828
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
12829
|
+
_: 3
|
|
12830
|
+
}, 16, [
|
|
12831
|
+
"as",
|
|
12832
|
+
"renderless",
|
|
12833
|
+
"style"
|
|
12834
|
+
]);
|
|
12835
|
+
};
|
|
12836
|
+
}
|
|
12837
|
+
});
|
|
12838
|
+
var SplitterPanel_default = _sfc_main$15;
|
|
12839
|
+
|
|
12840
|
+
//#endregion
|
|
12841
|
+
//#region src/components/Splitter/SplitterHandle.vue
|
|
12842
|
+
const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
12843
|
+
name: "SplitterHandle",
|
|
12844
|
+
inheritAttrs: false,
|
|
12845
|
+
__name: "SplitterHandle",
|
|
12846
|
+
props: {
|
|
12847
|
+
disabled: {
|
|
12848
|
+
type: Boolean,
|
|
12849
|
+
default: false
|
|
12850
|
+
},
|
|
12851
|
+
label: {},
|
|
12852
|
+
as: { default: "div" },
|
|
12853
|
+
renderless: { type: Boolean }
|
|
12854
|
+
},
|
|
12855
|
+
setup(__props) {
|
|
12856
|
+
const attrs = useAttrs();
|
|
12857
|
+
const ARROW_STEP = 1;
|
|
12858
|
+
const PAGE_STEP = 10;
|
|
12859
|
+
const splitter = useSplitterRoot();
|
|
12860
|
+
const ticket = splitter.handles.register();
|
|
12861
|
+
onUnmounted(() => {
|
|
12862
|
+
splitter.handles.unregister(ticket.id);
|
|
12863
|
+
});
|
|
12864
|
+
const hovering = shallowRef(false);
|
|
12865
|
+
const startPosition = shallowRef(0);
|
|
12866
|
+
let rafId = 0;
|
|
12867
|
+
let latestPos = 0;
|
|
12868
|
+
const isDisabled = toRef(() => __props.disabled || splitter.disabled.value);
|
|
12869
|
+
const isHorizontal = toRef(() => splitter.orientation.value === "horizontal");
|
|
12870
|
+
const state = toRef(() => {
|
|
12871
|
+
if (splitter.draggingHandle.value === ticket.index) return "drag";
|
|
12872
|
+
if (hovering.value) return "hover";
|
|
12873
|
+
return "inactive";
|
|
12874
|
+
});
|
|
12875
|
+
const valuenow = toRef(() => Math.round(splitter.panel(ticket.index)?.size ?? 0));
|
|
12876
|
+
const valuemin = toRef(() => {
|
|
12877
|
+
const p = splitter.panel(ticket.index);
|
|
12878
|
+
if (!p) return 0;
|
|
12879
|
+
return p.collapsible ? p.collapsedSize : p.minSize;
|
|
12880
|
+
});
|
|
12881
|
+
const valuemax = toRef(() => {
|
|
12882
|
+
const p = splitter.panel(ticket.index);
|
|
12883
|
+
const adjacent = splitter.panel(ticket.index + 1);
|
|
12884
|
+
if (!p || !adjacent) return 100;
|
|
12885
|
+
const adjMin = adjacent.collapsible ? adjacent.collapsedSize : adjacent.minSize;
|
|
12886
|
+
return Math.min(p.maxSize, p.size + adjacent.size - adjMin);
|
|
12887
|
+
});
|
|
12888
|
+
function onPointerDown(e) {
|
|
12889
|
+
if (isDisabled.value) return;
|
|
12890
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
12891
|
+
startPosition.value = isHorizontal.value ? e.clientX : e.clientY;
|
|
12892
|
+
if (IN_BROWSER) {
|
|
12893
|
+
document.documentElement.style.userSelect = "none";
|
|
12894
|
+
document.documentElement.style.touchAction = "none";
|
|
12895
|
+
}
|
|
12896
|
+
splitter.onStartDrag(ticket.index);
|
|
12897
|
+
}
|
|
12898
|
+
useToggleScope(() => splitter.draggingHandle.value === ticket.index, () => {
|
|
12899
|
+
useDocumentEventListener("pointermove", (e) => {
|
|
12900
|
+
latestPos = isHorizontal.value ? e.clientX : e.clientY;
|
|
12901
|
+
if (rafId) return;
|
|
12902
|
+
rafId = requestAnimationFrame(() => {
|
|
12903
|
+
const root = splitter.rootEl.value;
|
|
12904
|
+
if (!root) return;
|
|
12905
|
+
const rootSize = isHorizontal.value ? root.offsetWidth : root.offsetHeight;
|
|
12906
|
+
if (!rootSize) return;
|
|
12907
|
+
const delta = (latestPos - startPosition.value) / rootSize * 100;
|
|
12908
|
+
startPosition.value = latestPos;
|
|
12909
|
+
splitter.resize(ticket.index, delta);
|
|
12910
|
+
rafId = 0;
|
|
12911
|
+
});
|
|
12912
|
+
});
|
|
12913
|
+
useDocumentEventListener("pointerup", () => {
|
|
12914
|
+
if (rafId) cancelAnimationFrame(rafId);
|
|
12915
|
+
rafId = 0;
|
|
12916
|
+
if (IN_BROWSER) {
|
|
12917
|
+
document.documentElement.style.userSelect = "";
|
|
12918
|
+
document.documentElement.style.touchAction = "";
|
|
12919
|
+
}
|
|
12920
|
+
splitter.onEndDrag();
|
|
12921
|
+
});
|
|
12922
|
+
onScopeDispose(() => {
|
|
12923
|
+
if (rafId) cancelAnimationFrame(rafId);
|
|
12924
|
+
rafId = 0;
|
|
12925
|
+
splitter.onEndDrag();
|
|
12926
|
+
if (IN_BROWSER) {
|
|
12927
|
+
document.documentElement.style.userSelect = "";
|
|
12928
|
+
document.documentElement.style.touchAction = "";
|
|
12929
|
+
}
|
|
12930
|
+
});
|
|
12931
|
+
});
|
|
12932
|
+
function onKeydown(e) {
|
|
12933
|
+
if (isDisabled.value) return;
|
|
12934
|
+
const forward = isHorizontal.value ? "ArrowRight" : "ArrowDown";
|
|
12935
|
+
const backward = isHorizontal.value ? "ArrowLeft" : "ArrowUp";
|
|
12936
|
+
switch (e.key) {
|
|
12937
|
+
case forward:
|
|
12938
|
+
e.preventDefault();
|
|
12939
|
+
splitter.resize(ticket.index, ARROW_STEP, { emit: true });
|
|
12940
|
+
break;
|
|
12941
|
+
case backward:
|
|
12942
|
+
e.preventDefault();
|
|
12943
|
+
splitter.resize(ticket.index, -ARROW_STEP, { emit: true });
|
|
12944
|
+
break;
|
|
12945
|
+
case "PageDown":
|
|
12946
|
+
e.preventDefault();
|
|
12947
|
+
splitter.resize(ticket.index, PAGE_STEP, { emit: true });
|
|
12948
|
+
break;
|
|
12949
|
+
case "PageUp":
|
|
12950
|
+
e.preventDefault();
|
|
12951
|
+
splitter.resize(ticket.index, -PAGE_STEP, { emit: true });
|
|
12952
|
+
break;
|
|
12953
|
+
case "Home": {
|
|
12954
|
+
e.preventDefault();
|
|
12955
|
+
const p = splitter.panel(ticket.index);
|
|
12956
|
+
if (p?.collapsible) splitter.collapse(ticket.index, ticket.index + 1);
|
|
12957
|
+
else {
|
|
12958
|
+
const current = p?.size ?? 0;
|
|
12959
|
+
splitter.resize(ticket.index, valuemin.value - current, { emit: true });
|
|
12960
|
+
}
|
|
12961
|
+
break;
|
|
12962
|
+
}
|
|
12963
|
+
case "End": {
|
|
12964
|
+
e.preventDefault();
|
|
12965
|
+
const p = splitter.panel(ticket.index);
|
|
12966
|
+
if (p?.collapsible && !toValue(p.isSelected)) splitter.expand(ticket.index, ticket.index + 1);
|
|
12967
|
+
else {
|
|
12968
|
+
const current = p?.size ?? 0;
|
|
12969
|
+
splitter.resize(ticket.index, valuemax.value - current, { emit: true });
|
|
12970
|
+
}
|
|
12971
|
+
break;
|
|
12972
|
+
}
|
|
12973
|
+
case "Enter": {
|
|
12974
|
+
e.preventDefault();
|
|
12975
|
+
const p = splitter.panel(ticket.index);
|
|
12976
|
+
if (!p?.collapsible) break;
|
|
12977
|
+
if (toValue(p.isSelected)) splitter.collapse(ticket.index, ticket.index + 1);
|
|
12978
|
+
else splitter.expand(ticket.index, ticket.index + 1);
|
|
12979
|
+
break;
|
|
12980
|
+
}
|
|
12981
|
+
}
|
|
12982
|
+
}
|
|
12983
|
+
function onPointerEnter() {
|
|
12984
|
+
hovering.value = true;
|
|
12985
|
+
}
|
|
12986
|
+
function onPointerLeave() {
|
|
12987
|
+
hovering.value = false;
|
|
12988
|
+
}
|
|
12989
|
+
const ariaOrientation = toRef(() => splitter.orientation.value === "horizontal" ? "vertical" : "horizontal");
|
|
12990
|
+
const ariaControls = toRef(() => {
|
|
12991
|
+
const p = splitter.panel(ticket.index);
|
|
12992
|
+
return /* @__PURE__ */ isNullOrUndefined(p) ? void 0 : String(p.id);
|
|
12993
|
+
});
|
|
12994
|
+
const slotProps = toRef(() => ({
|
|
12995
|
+
isDragging: splitter.draggingHandle.value === ticket.index,
|
|
12996
|
+
isDisabled: isDisabled.value,
|
|
12997
|
+
state: state.value,
|
|
12998
|
+
attrs: {
|
|
12999
|
+
"role": "separator",
|
|
13000
|
+
"tabindex": isDisabled.value ? -1 : 0,
|
|
13001
|
+
"aria-valuenow": valuenow.value,
|
|
13002
|
+
"aria-valuemin": valuemin.value,
|
|
13003
|
+
"aria-valuemax": valuemax.value,
|
|
13004
|
+
"aria-orientation": ariaOrientation.value,
|
|
13005
|
+
"aria-controls": ariaControls.value,
|
|
13006
|
+
"aria-label": __props.label || void 0,
|
|
13007
|
+
"aria-disabled": isDisabled.value || void 0,
|
|
13008
|
+
"data-state": state.value,
|
|
13009
|
+
"data-orientation": splitter.orientation.value,
|
|
13010
|
+
"data-disabled": isDisabled.value || void 0,
|
|
13011
|
+
"style": { "touch-action": "none" },
|
|
13012
|
+
"onPointerdown": onPointerDown,
|
|
13013
|
+
"onPointerenter": onPointerEnter,
|
|
13014
|
+
"onPointerleave": onPointerLeave,
|
|
13015
|
+
"onKeydown": onKeydown
|
|
13016
|
+
}
|
|
13017
|
+
}));
|
|
13018
|
+
return (_ctx, _cache) => {
|
|
13019
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps({
|
|
13020
|
+
...unref(attrs),
|
|
13021
|
+
...slotProps.value.attrs
|
|
13022
|
+
}, {
|
|
13023
|
+
as: __props.as,
|
|
13024
|
+
renderless: __props.renderless,
|
|
13025
|
+
style: { flexShrink: 0 }
|
|
13026
|
+
}), {
|
|
13027
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
13028
|
+
_: 3
|
|
13029
|
+
}, 16, ["as", "renderless"]);
|
|
13030
|
+
};
|
|
13031
|
+
}
|
|
13032
|
+
});
|
|
13033
|
+
var SplitterHandle_default = _sfc_main$14;
|
|
13034
|
+
|
|
13035
|
+
//#endregion
|
|
13036
|
+
//#region src/components/Splitter/index.ts
|
|
13037
|
+
/**
|
|
13038
|
+
* Splitter component with sub-components for building resizable panel layouts.
|
|
13039
|
+
*
|
|
13040
|
+
* @see https://0.vuetifyjs.com/components/splitter
|
|
13041
|
+
*
|
|
13042
|
+
* @example
|
|
13043
|
+
* ```vue
|
|
13044
|
+
* <script lang="ts" setup>
|
|
13045
|
+
* import { Splitter } from '@vuetify/v0'
|
|
13046
|
+
* <\/script>
|
|
13047
|
+
*
|
|
13048
|
+
* <template>
|
|
13049
|
+
* <Splitter.Root orientation="horizontal">
|
|
13050
|
+
* <Splitter.Panel :default-size="60" :min-size="20">
|
|
13051
|
+
* Left content
|
|
13052
|
+
* </Splitter.Panel>
|
|
13053
|
+
*
|
|
13054
|
+
* <Splitter.Handle />
|
|
13055
|
+
*
|
|
13056
|
+
* <Splitter.Panel :default-size="40" :min-size="20">
|
|
13057
|
+
* Right content
|
|
13058
|
+
* </Splitter.Panel>
|
|
13059
|
+
* </Splitter.Root>
|
|
13060
|
+
* </template>
|
|
13061
|
+
* ```
|
|
13062
|
+
*/
|
|
13063
|
+
const Splitter = {
|
|
13064
|
+
Root: SplitterRoot_default,
|
|
13065
|
+
Panel: SplitterPanel_default,
|
|
13066
|
+
Handle: SplitterHandle_default
|
|
13067
|
+
};
|
|
13068
|
+
|
|
13069
|
+
//#endregion
|
|
13070
|
+
//#region src/components/Switch/SwitchGroup.vue
|
|
13071
|
+
const [useSwitchGroup, provideSwitchGroup] = createContext();
|
|
13072
|
+
const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
13073
|
+
name: "SwitchGroup",
|
|
13074
|
+
__name: "SwitchGroup",
|
|
13075
|
+
props: /* @__PURE__ */ mergeModels({
|
|
13076
|
+
namespace: { default: "v0:switch:group" },
|
|
13077
|
+
disabled: {
|
|
13078
|
+
type: Boolean,
|
|
13079
|
+
default: false
|
|
13080
|
+
},
|
|
13081
|
+
enroll: {
|
|
13082
|
+
type: Boolean,
|
|
13083
|
+
default: false
|
|
13084
|
+
},
|
|
13085
|
+
mandatory: {
|
|
13086
|
+
type: [Boolean, String],
|
|
13087
|
+
default: false
|
|
13088
|
+
},
|
|
13089
|
+
label: {},
|
|
13090
|
+
ariaLabelledby: {},
|
|
13091
|
+
ariaDescribedby: {},
|
|
13092
|
+
as: { default: "div" },
|
|
13093
|
+
renderless: { type: Boolean }
|
|
13094
|
+
}, {
|
|
13095
|
+
"modelValue": {},
|
|
13096
|
+
"modelModifiers": {}
|
|
13097
|
+
}),
|
|
13098
|
+
emits: /* @__PURE__ */ mergeModels(["update:model-value"], ["update:modelValue"]),
|
|
13099
|
+
setup(__props) {
|
|
13100
|
+
const model = useModel(__props, "modelValue");
|
|
13101
|
+
const group = createGroup({
|
|
13102
|
+
disabled: toRef(() => __props.disabled),
|
|
13103
|
+
enroll: __props.enroll,
|
|
13104
|
+
mandatory: __props.mandatory,
|
|
13105
|
+
events: true
|
|
13106
|
+
});
|
|
13107
|
+
useProxyModel(group, model, { multiple: true });
|
|
13108
|
+
provideSwitchGroup(__props.namespace, group);
|
|
13109
|
+
const slotProps = toRef(() => ({
|
|
13110
|
+
isDisabled: toValue(group.disabled),
|
|
13111
|
+
isNoneSelected: group.isNoneSelected.value,
|
|
13112
|
+
isAllSelected: group.isAllSelected.value,
|
|
13113
|
+
isMixed: group.isMixed.value,
|
|
13114
|
+
select: group.select,
|
|
13115
|
+
unselect: group.unselect,
|
|
13116
|
+
toggle: group.toggle,
|
|
13117
|
+
selectAll: group.selectAll,
|
|
13118
|
+
unselectAll: group.unselectAll,
|
|
13119
|
+
toggleAll: group.toggleAll,
|
|
13120
|
+
attrs: {
|
|
13121
|
+
"role": "group",
|
|
13122
|
+
"aria-label": __props.label || void 0,
|
|
13123
|
+
"aria-labelledby": __props.ariaLabelledby || void 0,
|
|
13124
|
+
"aria-describedby": __props.ariaDescribedby || void 0
|
|
13125
|
+
}
|
|
13126
|
+
}));
|
|
13127
|
+
return (_ctx, _cache) => {
|
|
13128
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps(slotProps.value.attrs, {
|
|
13129
|
+
as: __props.as,
|
|
13130
|
+
renderless: __props.renderless
|
|
13131
|
+
}), {
|
|
13132
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
13133
|
+
_: 3
|
|
13134
|
+
}, 16, ["as", "renderless"]);
|
|
13135
|
+
};
|
|
13136
|
+
}
|
|
13137
|
+
});
|
|
13138
|
+
var SwitchGroup_default = _sfc_main$13;
|
|
13139
|
+
|
|
13140
|
+
//#endregion
|
|
13141
|
+
//#region src/components/Switch/SwitchRoot.vue
|
|
13142
|
+
const [useSwitchRoot, provideSwitchRoot] = createContext();
|
|
13143
|
+
const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
13144
|
+
name: "SwitchRoot",
|
|
13145
|
+
inheritAttrs: false,
|
|
13146
|
+
__name: "SwitchRoot",
|
|
13147
|
+
props: /* @__PURE__ */ mergeModels({
|
|
13148
|
+
id: { default: () => useId$1() },
|
|
13149
|
+
label: {},
|
|
13150
|
+
value: {},
|
|
13151
|
+
name: {},
|
|
13152
|
+
form: {},
|
|
13153
|
+
disabled: { default: false },
|
|
13154
|
+
indeterminate: { default: false },
|
|
13155
|
+
namespace: { default: "v0:switch:root" },
|
|
13156
|
+
groupNamespace: { default: "v0:switch:group" },
|
|
13157
|
+
ariaLabelledby: {},
|
|
13158
|
+
ariaDescribedby: {},
|
|
13159
|
+
ariaInvalid: { type: Boolean },
|
|
13160
|
+
as: { default: "button" },
|
|
13161
|
+
renderless: { type: Boolean }
|
|
13162
|
+
}, {
|
|
13163
|
+
"modelValue": { type: Boolean },
|
|
13164
|
+
"modelModifiers": {}
|
|
13165
|
+
}),
|
|
13166
|
+
emits: /* @__PURE__ */ mergeModels(["update:model-value"], ["update:modelValue"]),
|
|
13167
|
+
setup(__props) {
|
|
13168
|
+
const attrs = useAttrs();
|
|
13169
|
+
let group = null;
|
|
13170
|
+
try {
|
|
13171
|
+
group = useSwitchGroup(__props.groupNamespace);
|
|
13172
|
+
} catch {}
|
|
13173
|
+
const model = useModel(__props, "modelValue");
|
|
13174
|
+
const ticket = group?.register({
|
|
13175
|
+
id: __props.id,
|
|
13176
|
+
value: __props.value,
|
|
13177
|
+
disabled: __props.disabled,
|
|
13178
|
+
indeterminate: __props.indeterminate
|
|
13179
|
+
});
|
|
13180
|
+
const isChecked = toRef(() => ticket ? toValue(ticket.isSelected) : model.value ?? false);
|
|
13181
|
+
const isMixed = toRef(() => ticket ? toValue(ticket.isMixed) : toValue(__props.indeterminate) ?? false);
|
|
13182
|
+
const isDisabled = toRef(() => group && ticket ? toValue(ticket.disabled) || toValue(group.disabled) : toValue(__props.disabled) ?? false);
|
|
13183
|
+
const dataState = toRef(() => isMixed.value ? "indeterminate" : isChecked.value ? "checked" : "unchecked");
|
|
13184
|
+
function toggle() {
|
|
13185
|
+
if (isDisabled.value) return;
|
|
13186
|
+
if (ticket) ticket.toggle();
|
|
13187
|
+
else model.value = !model.value;
|
|
13188
|
+
}
|
|
13189
|
+
function select() {
|
|
13190
|
+
if (isDisabled.value) return;
|
|
13191
|
+
if (ticket) ticket.select();
|
|
13192
|
+
else model.value = true;
|
|
13193
|
+
}
|
|
13194
|
+
function unselect() {
|
|
13195
|
+
if (isDisabled.value) return;
|
|
13196
|
+
if (ticket) ticket.unselect();
|
|
13197
|
+
else model.value = false;
|
|
13198
|
+
}
|
|
13199
|
+
function mix() {
|
|
13200
|
+
if (isDisabled.value || !ticket) return;
|
|
13201
|
+
ticket.mix();
|
|
13202
|
+
}
|
|
13203
|
+
function unmix() {
|
|
13204
|
+
if (isDisabled.value || !ticket) return;
|
|
13205
|
+
ticket.unmix();
|
|
13206
|
+
}
|
|
13207
|
+
function onClick() {
|
|
13208
|
+
toggle();
|
|
13209
|
+
}
|
|
13210
|
+
function onKeydown(e) {
|
|
13211
|
+
if (e.key !== " ") return;
|
|
13212
|
+
e.preventDefault();
|
|
13213
|
+
toggle();
|
|
13214
|
+
}
|
|
13215
|
+
onUnmounted(() => {
|
|
13216
|
+
if (!ticket || !group) return;
|
|
13217
|
+
group.unregister(ticket.id);
|
|
13218
|
+
});
|
|
13219
|
+
const context = {
|
|
13220
|
+
id: __props.id,
|
|
13221
|
+
label: __props.label,
|
|
13222
|
+
value: __props.value,
|
|
13223
|
+
name: __props.name,
|
|
13224
|
+
form: __props.form,
|
|
13225
|
+
isChecked,
|
|
13226
|
+
isMixed,
|
|
13227
|
+
isDisabled,
|
|
13228
|
+
select,
|
|
13229
|
+
unselect,
|
|
13230
|
+
toggle,
|
|
13231
|
+
mix,
|
|
13232
|
+
unmix
|
|
13233
|
+
};
|
|
13234
|
+
provideSwitchRoot(__props.namespace, context);
|
|
13235
|
+
const slotProps = toRef(() => ({
|
|
13236
|
+
id: __props.id,
|
|
13237
|
+
label: __props.label,
|
|
13238
|
+
value: __props.value,
|
|
13239
|
+
isChecked: isChecked.value,
|
|
13240
|
+
isMixed: isMixed.value,
|
|
13241
|
+
isDisabled: isDisabled.value,
|
|
13242
|
+
select,
|
|
13243
|
+
unselect,
|
|
13244
|
+
toggle,
|
|
13245
|
+
mix,
|
|
13246
|
+
unmix,
|
|
13247
|
+
attrs: {
|
|
13248
|
+
"type": __props.as === "button" ? "button" : void 0,
|
|
13249
|
+
"role": "switch",
|
|
13250
|
+
"aria-checked": isMixed.value ? "mixed" : isChecked.value,
|
|
13251
|
+
"aria-disabled": isDisabled.value || void 0,
|
|
13252
|
+
"aria-label": __props.label || void 0,
|
|
13253
|
+
"aria-labelledby": __props.ariaLabelledby || void 0,
|
|
13254
|
+
"aria-describedby": __props.ariaDescribedby || void 0,
|
|
13255
|
+
"aria-invalid": __props.ariaInvalid || void 0,
|
|
13256
|
+
"tabindex": isDisabled.value ? void 0 : 0,
|
|
13257
|
+
"data-state": dataState.value,
|
|
13258
|
+
"data-disabled": isDisabled.value ? true : void 0
|
|
13259
|
+
}
|
|
13260
|
+
}));
|
|
13261
|
+
return (_ctx, _cache) => {
|
|
13262
|
+
return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(Atom_default), mergeProps({
|
|
13263
|
+
...unref(attrs),
|
|
13264
|
+
...slotProps.value.attrs
|
|
13265
|
+
}, {
|
|
13266
|
+
as: __props.as,
|
|
13267
|
+
renderless: __props.renderless,
|
|
13268
|
+
onClick,
|
|
13269
|
+
onKeydown
|
|
13270
|
+
}), {
|
|
13271
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
13272
|
+
_: 3
|
|
13273
|
+
}, 16, ["as", "renderless"]), __props.name ? (openBlock(), createBlock(SwitchHiddenInput_default, { key: 0 })) : createCommentVNode("v-if", true)], 64);
|
|
13274
|
+
};
|
|
13275
|
+
}
|
|
13276
|
+
});
|
|
13277
|
+
var SwitchRoot_default = _sfc_main$12;
|
|
13278
|
+
|
|
13279
|
+
//#endregion
|
|
13280
|
+
//#region src/components/Switch/SwitchHiddenInput.vue
|
|
13281
|
+
const _hoisted_1 = [
|
|
13282
|
+
"checked",
|
|
13283
|
+
"disabled",
|
|
13284
|
+
"form",
|
|
13285
|
+
"name",
|
|
13286
|
+
"value"
|
|
13287
|
+
];
|
|
13288
|
+
const visuallyHiddenStyle = {
|
|
13289
|
+
position: "absolute",
|
|
13290
|
+
width: "1px",
|
|
13291
|
+
height: "1px",
|
|
13292
|
+
padding: "0",
|
|
13293
|
+
margin: "-1px",
|
|
13294
|
+
overflow: "hidden",
|
|
13295
|
+
clip: "rect(0, 0, 0, 0)",
|
|
13296
|
+
whiteSpace: "nowrap",
|
|
13297
|
+
border: "0"
|
|
13298
|
+
};
|
|
13299
|
+
const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
13300
|
+
name: "SwitchHiddenInput",
|
|
13301
|
+
__name: "SwitchHiddenInput",
|
|
13302
|
+
props: {
|
|
13303
|
+
namespace: { default: "v0:switch:root" },
|
|
13304
|
+
name: {},
|
|
13305
|
+
value: {},
|
|
13306
|
+
form: {}
|
|
13307
|
+
},
|
|
13308
|
+
setup(__props) {
|
|
13309
|
+
const root = useSwitchRoot(__props.namespace);
|
|
13310
|
+
const name = toRef(() => __props.name ?? root.name);
|
|
13311
|
+
const form = toRef(() => __props.form ?? root.form);
|
|
13312
|
+
const value = toRef(() => {
|
|
13313
|
+
const v = __props.value ?? root.value ?? "on";
|
|
13314
|
+
if (/* @__PURE__ */ isNullOrUndefined(v)) return "on";
|
|
13315
|
+
if (/* @__PURE__ */ isObject(v)) return JSON.stringify(v);
|
|
13316
|
+
return String(v);
|
|
13317
|
+
});
|
|
13318
|
+
const isChecked = root.isChecked;
|
|
13319
|
+
const isDisabled = root.isDisabled;
|
|
13320
|
+
return (_ctx, _cache) => {
|
|
13321
|
+
return openBlock(), createElementBlock("input", {
|
|
13322
|
+
checked: unref(isChecked),
|
|
13323
|
+
disabled: unref(isDisabled),
|
|
13324
|
+
form: form.value,
|
|
13325
|
+
inert: "",
|
|
13326
|
+
name: name.value,
|
|
13327
|
+
style: visuallyHiddenStyle,
|
|
13328
|
+
tabindex: "-1",
|
|
13329
|
+
type: "checkbox",
|
|
13330
|
+
value: value.value
|
|
13331
|
+
}, null, 8, _hoisted_1);
|
|
13332
|
+
};
|
|
13333
|
+
}
|
|
13334
|
+
});
|
|
13335
|
+
var SwitchHiddenInput_default = _sfc_main$11;
|
|
13336
|
+
|
|
13337
|
+
//#endregion
|
|
13338
|
+
//#region src/components/Switch/SwitchSelectAll.vue
|
|
13339
|
+
const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
13340
|
+
name: "SwitchSelectAll",
|
|
13341
|
+
inheritAttrs: false,
|
|
13342
|
+
__name: "SwitchSelectAll",
|
|
13343
|
+
props: {
|
|
13344
|
+
label: {},
|
|
13345
|
+
disabled: { type: Boolean },
|
|
13346
|
+
namespace: {},
|
|
13347
|
+
groupNamespace: {},
|
|
13348
|
+
ariaLabelledby: {},
|
|
13349
|
+
ariaDescribedby: {},
|
|
13350
|
+
as: {},
|
|
13351
|
+
renderless: { type: Boolean }
|
|
13352
|
+
},
|
|
13353
|
+
setup(__props) {
|
|
13354
|
+
const attrs = useAttrs();
|
|
13355
|
+
const props = __props;
|
|
13356
|
+
const { as = "button", renderless, label, namespace = "v0:switch:root", groupNamespace = "v0:switch:group" } = props;
|
|
13357
|
+
const group = useSwitchGroup(groupNamespace);
|
|
13358
|
+
const id = useId$1();
|
|
13359
|
+
const isAllSelected = toRef(() => group.isAllSelected.value);
|
|
13360
|
+
const isMixed = toRef(() => group.isMixed.value);
|
|
13361
|
+
const isDisabled = toRef(() => toValue(props.disabled) || toValue(group.disabled));
|
|
13362
|
+
const dataState = toRef(() => isMixed.value ? "indeterminate" : isAllSelected.value ? "checked" : "unchecked");
|
|
13363
|
+
function onClick() {
|
|
13364
|
+
if (isDisabled.value) return;
|
|
13365
|
+
group.toggleAll();
|
|
13366
|
+
}
|
|
13367
|
+
function onKeydown(e) {
|
|
13368
|
+
if (e.key !== " ") return;
|
|
13369
|
+
e.preventDefault();
|
|
13370
|
+
if (isDisabled.value) return;
|
|
13371
|
+
group.toggleAll();
|
|
13372
|
+
}
|
|
13373
|
+
provideSwitchRoot(namespace, {
|
|
13374
|
+
id,
|
|
13375
|
+
label,
|
|
13376
|
+
value: void 0,
|
|
13377
|
+
name: void 0,
|
|
13378
|
+
form: void 0,
|
|
13379
|
+
isChecked: isAllSelected,
|
|
13380
|
+
isMixed,
|
|
13381
|
+
isDisabled,
|
|
13382
|
+
select: group.selectAll,
|
|
13383
|
+
unselect: group.unselectAll,
|
|
13384
|
+
toggle: group.toggleAll,
|
|
13385
|
+
mix: () => {},
|
|
13386
|
+
unmix: () => {}
|
|
13387
|
+
});
|
|
13388
|
+
const slotProps = toRef(() => ({
|
|
13389
|
+
label,
|
|
13390
|
+
isAllSelected: isAllSelected.value,
|
|
13391
|
+
isMixed: isMixed.value,
|
|
13392
|
+
isDisabled: isDisabled.value,
|
|
13393
|
+
selectAll: group.selectAll,
|
|
13394
|
+
unselectAll: group.unselectAll,
|
|
13395
|
+
toggleAll: group.toggleAll,
|
|
13396
|
+
attrs: {
|
|
13397
|
+
"type": as === "button" ? "button" : void 0,
|
|
13398
|
+
"role": "switch",
|
|
13399
|
+
"aria-checked": isMixed.value ? "mixed" : isAllSelected.value,
|
|
13400
|
+
"aria-disabled": isDisabled.value || void 0,
|
|
13401
|
+
"aria-label": label || void 0,
|
|
13402
|
+
"aria-labelledby": props.ariaLabelledby || void 0,
|
|
13403
|
+
"aria-describedby": props.ariaDescribedby || void 0,
|
|
13404
|
+
"tabindex": isDisabled.value ? void 0 : 0,
|
|
13405
|
+
"data-state": dataState.value,
|
|
13406
|
+
"data-disabled": isDisabled.value ? true : void 0
|
|
13407
|
+
}
|
|
13408
|
+
}));
|
|
13409
|
+
return (_ctx, _cache) => {
|
|
13410
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps({
|
|
13411
|
+
...unref(attrs),
|
|
13412
|
+
...slotProps.value.attrs
|
|
13413
|
+
}, {
|
|
13414
|
+
as: unref(as),
|
|
13415
|
+
renderless: unref(renderless),
|
|
13416
|
+
onClick,
|
|
13417
|
+
onKeydown
|
|
13418
|
+
}), {
|
|
13419
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
13420
|
+
_: 3
|
|
13421
|
+
}, 16, ["as", "renderless"]);
|
|
13422
|
+
};
|
|
13423
|
+
}
|
|
13424
|
+
});
|
|
13425
|
+
var SwitchSelectAll_default = _sfc_main$10;
|
|
13426
|
+
|
|
13427
|
+
//#endregion
|
|
13428
|
+
//#region src/components/Switch/SwitchThumb.vue
|
|
13429
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
13430
|
+
name: "SwitchThumb",
|
|
13431
|
+
__name: "SwitchThumb",
|
|
13432
|
+
props: {
|
|
13433
|
+
namespace: { default: "v0:switch:root" },
|
|
13434
|
+
as: { default: "span" },
|
|
13435
|
+
renderless: { type: Boolean }
|
|
13436
|
+
},
|
|
13437
|
+
setup(__props) {
|
|
13438
|
+
const root = useSwitchRoot(__props.namespace);
|
|
13439
|
+
const isChecked = toRef(() => toValue(root.isChecked));
|
|
13440
|
+
const isMixed = toRef(() => toValue(root.isMixed));
|
|
13441
|
+
const isVisible = toRef(() => isChecked.value || isMixed.value);
|
|
13442
|
+
const dataState = toRef(() => isMixed.value ? "indeterminate" : isChecked.value ? "checked" : "unchecked");
|
|
13443
|
+
const slotProps = toRef(() => ({
|
|
13444
|
+
isChecked: isChecked.value,
|
|
13445
|
+
isMixed: isMixed.value,
|
|
13446
|
+
attrs: {
|
|
13447
|
+
"data-state": dataState.value,
|
|
13448
|
+
"style": { visibility: isVisible.value ? "visible" : "hidden" }
|
|
13449
|
+
}
|
|
13450
|
+
}));
|
|
13451
|
+
return (_ctx, _cache) => {
|
|
13452
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps(slotProps.value.attrs, {
|
|
13453
|
+
as: __props.as,
|
|
13454
|
+
renderless: __props.renderless
|
|
13455
|
+
}), {
|
|
13456
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
13457
|
+
_: 3
|
|
13458
|
+
}, 16, ["as", "renderless"]);
|
|
13459
|
+
};
|
|
13460
|
+
}
|
|
13461
|
+
});
|
|
13462
|
+
var SwitchThumb_default = _sfc_main$9;
|
|
13463
|
+
|
|
13464
|
+
//#endregion
|
|
13465
|
+
//#region src/components/Switch/SwitchTrack.vue
|
|
13466
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
13467
|
+
name: "SwitchTrack",
|
|
13468
|
+
__name: "SwitchTrack",
|
|
13469
|
+
props: {
|
|
13470
|
+
namespace: { default: "v0:switch:root" },
|
|
13471
|
+
as: { default: "span" },
|
|
13472
|
+
renderless: { type: Boolean }
|
|
13473
|
+
},
|
|
13474
|
+
setup(__props) {
|
|
13475
|
+
const root = useSwitchRoot(__props.namespace);
|
|
13476
|
+
const isChecked = toRef(() => toValue(root.isChecked));
|
|
13477
|
+
const isMixed = toRef(() => toValue(root.isMixed));
|
|
13478
|
+
const dataState = toRef(() => isMixed.value ? "indeterminate" : isChecked.value ? "checked" : "unchecked");
|
|
13479
|
+
const slotProps = toRef(() => ({
|
|
13480
|
+
isChecked: isChecked.value,
|
|
13481
|
+
isMixed: isMixed.value,
|
|
13482
|
+
attrs: { "data-state": dataState.value }
|
|
13483
|
+
}));
|
|
13484
|
+
return (_ctx, _cache) => {
|
|
13485
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps(slotProps.value.attrs, {
|
|
13486
|
+
as: __props.as,
|
|
13487
|
+
renderless: __props.renderless
|
|
13488
|
+
}), {
|
|
13489
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
13490
|
+
_: 3
|
|
13491
|
+
}, 16, ["as", "renderless"]);
|
|
13492
|
+
};
|
|
13493
|
+
}
|
|
13494
|
+
});
|
|
13495
|
+
var SwitchTrack_default = _sfc_main$8;
|
|
13496
|
+
|
|
13497
|
+
//#endregion
|
|
13498
|
+
//#region src/components/Switch/index.ts
|
|
13499
|
+
/**
|
|
13500
|
+
* Switch component with sub-components for toggle controls.
|
|
13501
|
+
*
|
|
13502
|
+
* @see https://0.vuetifyjs.com/components/forms/switch
|
|
13503
|
+
*
|
|
13504
|
+
* @example
|
|
13505
|
+
* ```vue
|
|
13506
|
+
* <script lang="ts" setup>
|
|
13507
|
+
* import { Switch } from '@vuetify/v0'
|
|
13508
|
+
* import { ref } from 'vue'
|
|
13509
|
+
*
|
|
13510
|
+
* const enabled = ref(false)
|
|
13511
|
+
* <\/script>
|
|
13512
|
+
*
|
|
13513
|
+
* <template>
|
|
13514
|
+
* <label>
|
|
13515
|
+
* <Switch.Root v-model="enabled">
|
|
13516
|
+
* <Switch.Track>
|
|
13517
|
+
* <Switch.Thumb />
|
|
13518
|
+
* </Switch.Track>
|
|
13519
|
+
* </Switch.Root>
|
|
13520
|
+
* Enable notifications
|
|
13521
|
+
* </label>
|
|
13522
|
+
* </template>
|
|
13523
|
+
* ```
|
|
13524
|
+
*/
|
|
13525
|
+
const Switch = {
|
|
13526
|
+
Group: SwitchGroup_default,
|
|
13527
|
+
HiddenInput: SwitchHiddenInput_default,
|
|
13528
|
+
Root: SwitchRoot_default,
|
|
13529
|
+
SelectAll: SwitchSelectAll_default,
|
|
13530
|
+
Thumb: SwitchThumb_default,
|
|
13531
|
+
Track: SwitchTrack_default
|
|
13532
|
+
};
|
|
13533
|
+
|
|
11661
13534
|
//#endregion
|
|
11662
13535
|
//#region src/components/Single/SingleRoot.vue
|
|
11663
13536
|
const [useSingleRoot, provideSingleRoot] = createContext();
|
|
@@ -12200,4 +14073,4 @@ const Tabs = {
|
|
|
12200
14073
|
};
|
|
12201
14074
|
|
|
12202
14075
|
//#endregion
|
|
12203
|
-
export { Atom_default as Atom, Avatar, AvatarFallback_default as AvatarFallback, AvatarImage_default as AvatarImage, AvatarRoot_default as AvatarRoot, Breadcrumbs, BreadcrumbsDivider_default as BreadcrumbsDivider, BreadcrumbsEllipsis_default as BreadcrumbsEllipsis, BreadcrumbsItem_default as BreadcrumbsItem, BreadcrumbsLink_default as BreadcrumbsLink, BreadcrumbsList_default as BreadcrumbsList, BreadcrumbsPage_default as BreadcrumbsPage, BreadcrumbsRoot_default as BreadcrumbsRoot, COMMON_ELEMENTS, Checkbox, CheckboxGroup_default as CheckboxGroup, CheckboxHiddenInput_default as CheckboxHiddenInput, CheckboxIndicator_default as CheckboxIndicator, CheckboxRoot_default as CheckboxRoot, CheckboxSelectAll_default as CheckboxSelectAll, ClientAdapter, ConsolaLoggerAdapter, DataTableAdapter, Dialog, DialogActivator_default as DialogActivator, DialogClose_default as DialogClose, DialogContent_default as DialogContent, DialogDescription_default as DialogDescription, DialogRoot_default as DialogRoot, DialogTitle_default as DialogTitle, ExpansionPanel, ExpansionPanelActivator_default as ExpansionPanelActivator, ExpansionPanelContent_default as ExpansionPanelContent, ExpansionPanelHeader_default as ExpansionPanelHeader, ExpansionPanelItem_default as ExpansionPanelItem, ExpansionPanelRoot_default as ExpansionPanelRoot, FeaturesAdapter, Group, GroupItem_default as GroupItem, GroupRoot_default as GroupRoot, IN_BROWSER, MemoryAdapter, Pagination, PaginationEllipsis_default as PaginationEllipsis, PaginationFirst_default as PaginationFirst, PaginationItem_default as PaginationItem, PaginationLast_default as PaginationLast, PaginationNext_default as PaginationNext, PaginationPrev_default as PaginationPrev, PaginationRoot_default as PaginationRoot, PaginationStatus_default as PaginationStatus, PermissionAdapter, PinoLoggerAdapter, Popover, PopoverActivator_default as PopoverActivator, PopoverContent_default as PopoverContent, PopoverRoot_default as PopoverRoot, Radio, RadioGroup_default as RadioGroup, RadioHiddenInput_default as RadioHiddenInput, RadioIndicator_default as RadioIndicator, RadioRoot_default as RadioRoot, SELF_CLOSING_TAGS, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, Scrim_default as Scrim, Selection, SelectionItem_default as SelectionItem, SelectionRoot_default as SelectionRoot, ServerAdapter, Single, SingleItem_default as SingleItem, SingleRoot_default as SingleRoot, Step, StepItem_default as StepItem, StepRoot_default as StepRoot, Tabs, TabsItem_default as TabsItem, TabsList_default as TabsList, TabsPanel_default as TabsPanel, TabsRoot_default as TabsRoot, VirtualAdapter, Vuetify0LocaleAdapter, Vuetify0LoggerAdapter, Vuetify0ThemeAdapter, __LOGGER_ENABLED__, clamp, createBreadcrumbs, createBreadcrumbsContext, createBreakpoints, createBreakpointsContext, createBreakpointsPlugin, createContext, createDataTable, createDataTableContext, createDate, createDateContext, createDatePlugin, createFallbackHydration, createFeatures, createFeaturesContext, createFeaturesPlugin, createFilter, createFilterContext, createForm, createFormContext, createGroup, createGroupContext, createHydration, createHydrationContext, createHydrationPlugin, createLocale, createLocaleContext, createLocaleFallback, createLocalePlugin, createLogger, createLoggerContext, createLoggerPlugin, createNested, createNestedContext, createOverflow, createOverflowContext, createPagination, createPaginationContext, createPermissions, createPermissionsContext, createPermissionsPlugin, createPlugin, createPluginContext, createQueue, createQueueContext, createRegistry, createRegistryContext, createSelection, createSelectionContext, createSingle, createSingleContext, createStack, createStackContext, createStackPlugin, createStep, createStepContext, createStorage, createStorageContext, createStoragePlugin, createTheme, createThemeContext, createThemePlugin, createTimeline, createTimelineContext, createTokens, createTokensContext, createTrinity, createVirtual, createVirtualContext, debounce, instanceExists, instanceName, isArray, isBoolean, isElement, isFunction, isNaN, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isSelfClosingTag, isString, isSymbol, isUndefined, mergeDeep, multipleOpenStrategy, provideAvatarRoot, provideBreadcrumbsRoot, provideCheckboxGroup, provideCheckboxRoot, provideContext, provideDialogContext, provideExpansionPanelItem, provideExpansionPanelRoot, provideGroupRoot, providePaginationControls, providePaginationItems, providePaginationRoot, providePopoverContext, provideRadioGroup, provideRadioRoot, provideSelectionRoot, provideSingleRoot, provideStepRoot, provideTabsRoot, range, singleOpenStrategy, toArray, toReactive, useAvatarRoot, useBreadcrumbs, useBreadcrumbsRoot, useBreakpoints, useCheckboxGroup, useCheckboxRoot, useClickOutside, useContext, useDataTable, useDate, useDialogContext, useDocumentEventListener, useElementIntersection, useElementSize, useEventListener, useExpansionPanelItem, useExpansionPanelRoot, useFeatures, useFilter, useForm, useGroup, useGroupRoot, useHotkey, useHydration, useId, useIntersectionObserver, useLazy, useLocale, useLogger, useMediaQuery, useMutationObserver, useNested, useOverflow, usePagination, usePaginationControls, usePaginationItems, usePaginationRoot, usePermissions, usePopoverContext, usePrefersContrast, usePrefersDark, usePrefersReducedMotion, useProxyModel, useProxyRegistry, useQueue, useRadioGroup, useRadioRoot, useRegistry, useResizeObserver, useSelection, useSelectionRoot, useSingle, useSingleRoot, useStack, useStep, useStepRoot, useStorage, useTabsRoot, useTheme, useTimeline, useToggleScope, useTokens, useVirtual, useWindowEventListener, version };
|
|
14076
|
+
export { Atom_default as Atom, Avatar, AvatarFallback_default as AvatarFallback, AvatarImage_default as AvatarImage, AvatarRoot_default as AvatarRoot, Breadcrumbs, BreadcrumbsDivider_default as BreadcrumbsDivider, BreadcrumbsEllipsis_default as BreadcrumbsEllipsis, BreadcrumbsItem_default as BreadcrumbsItem, BreadcrumbsLink_default as BreadcrumbsLink, BreadcrumbsList_default as BreadcrumbsList, BreadcrumbsPage_default as BreadcrumbsPage, BreadcrumbsRoot_default as BreadcrumbsRoot, COMMON_ELEMENTS, Checkbox, CheckboxGroup_default as CheckboxGroup, CheckboxHiddenInput_default as CheckboxHiddenInput, CheckboxIndicator_default as CheckboxIndicator, CheckboxRoot_default as CheckboxRoot, CheckboxSelectAll_default as CheckboxSelectAll, ClientAdapter, ConsolaLoggerAdapter, DataTableAdapter, Dialog, DialogActivator_default as DialogActivator, DialogClose_default as DialogClose, DialogContent_default as DialogContent, DialogDescription_default as DialogDescription, DialogRoot_default as DialogRoot, DialogTitle_default as DialogTitle, ExpansionPanel, ExpansionPanelActivator_default as ExpansionPanelActivator, ExpansionPanelContent_default as ExpansionPanelContent, ExpansionPanelHeader_default as ExpansionPanelHeader, ExpansionPanelItem_default as ExpansionPanelItem, ExpansionPanelRoot_default as ExpansionPanelRoot, FeaturesAdapter, Group, GroupItem_default as GroupItem, GroupRoot_default as GroupRoot, IN_BROWSER, MemoryAdapter, Pagination, PaginationEllipsis_default as PaginationEllipsis, PaginationFirst_default as PaginationFirst, PaginationItem_default as PaginationItem, PaginationLast_default as PaginationLast, PaginationNext_default as PaginationNext, PaginationPrev_default as PaginationPrev, PaginationRoot_default as PaginationRoot, PaginationStatus_default as PaginationStatus, PermissionAdapter, PinoLoggerAdapter, Popover, PopoverActivator_default as PopoverActivator, PopoverContent_default as PopoverContent, PopoverRoot_default as PopoverRoot, Radio, RadioGroup_default as RadioGroup, RadioHiddenInput_default as RadioHiddenInput, RadioIndicator_default as RadioIndicator, RadioRoot_default as RadioRoot, SELF_CLOSING_TAGS, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, Scrim_default as Scrim, Selection, SelectionItem_default as SelectionItem, SelectionRoot_default as SelectionRoot, ServerAdapter, Single, SingleItem_default as SingleItem, SingleRoot_default as SingleRoot, Slider, SliderHiddenInput_default as SliderHiddenInput, SliderRange_default as SliderRange, SliderRoot_default as SliderRoot, SliderThumb_default as SliderThumb, SliderTrack_default as SliderTrack, Splitter, SplitterHandle_default as SplitterHandle, SplitterPanel_default as SplitterPanel, SplitterRoot_default as SplitterRoot, Step, StepItem_default as StepItem, StepRoot_default as StepRoot, Switch, SwitchGroup_default as SwitchGroup, SwitchHiddenInput_default as SwitchHiddenInput, SwitchRoot_default as SwitchRoot, SwitchSelectAll_default as SwitchSelectAll, SwitchThumb_default as SwitchThumb, SwitchTrack_default as SwitchTrack, Tabs, TabsItem_default as TabsItem, TabsList_default as TabsList, TabsPanel_default as TabsPanel, TabsRoot_default as TabsRoot, VirtualAdapter, Vuetify0LocaleAdapter, Vuetify0LoggerAdapter, Vuetify0ThemeAdapter, __LOGGER_ENABLED__, clamp, createBreadcrumbs, createBreadcrumbsContext, createBreakpoints, createBreakpointsContext, createBreakpointsPlugin, createContext, createDataTable, createDataTableContext, createDate, createDateContext, createDatePlugin, createFallbackHydration, createFeatures, createFeaturesContext, createFeaturesPlugin, createFilter, createFilterContext, createForm, createFormContext, createGroup, createGroupContext, createHydration, createHydrationContext, createHydrationPlugin, createLocale, createLocaleContext, createLocaleFallback, createLocalePlugin, createLogger, createLoggerContext, createLoggerPlugin, createModel, createNested, createNestedContext, createOverflow, createOverflowContext, createPagination, createPaginationContext, createPermissions, createPermissionsContext, createPermissionsPlugin, createPlugin, createPluginContext, createQueue, createQueueContext, createRegistry, createRegistryContext, createSelection, createSelectionContext, createSingle, createSingleContext, createSlider, createStack, createStackContext, createStackPlugin, createStep, createStepContext, createStorage, createStorageContext, createStoragePlugin, createTheme, createThemeContext, createThemePlugin, createTimeline, createTimelineContext, createTokens, createTokensContext, createTrinity, createVirtual, createVirtualContext, debounce, instanceExists, instanceName, isArray, isBoolean, isElement, isFunction, isNaN, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isSelfClosingTag, isString, isSymbol, isUndefined, mergeDeep, multipleOpenStrategy, provideAvatarRoot, provideBreadcrumbsRoot, provideCheckboxGroup, provideCheckboxRoot, provideContext, provideDialogContext, provideExpansionPanelItem, provideExpansionPanelRoot, provideGroupRoot, providePaginationControls, providePaginationItems, providePaginationRoot, providePopoverContext, provideRadioGroup, provideRadioRoot, provideSelectionRoot, provideSingleRoot, provideSliderRoot, provideSplitterRoot, provideStepRoot, provideSwitchGroup, provideSwitchRoot, provideTabsRoot, range, singleOpenStrategy, toArray, toElement, toReactive, useAvatarRoot, useBreadcrumbs, useBreadcrumbsRoot, useBreakpoints, useCheckboxGroup, useCheckboxRoot, useClickOutside, useContext, useDataTable, useDate, useDialogContext, useDocumentEventListener, useElementIntersection, useElementSize, useEventListener, useExpansionPanelItem, useExpansionPanelRoot, useFeatures, useFilter, useForm, useGroup, useGroupRoot, useHotkey, useHydration, useId, useIntersectionObserver, useLazy, useLocale, useLogger, useMediaQuery, useMutationObserver, useNested, useOverflow, usePagination, usePaginationControls, usePaginationItems, usePaginationRoot, usePermissions, usePopoverContext, usePrefersContrast, usePrefersDark, usePrefersReducedMotion, useProxyModel, useProxyRegistry, useQueue, useRadioGroup, useRadioRoot, useRegistry, useResizeObserver, useSelection, useSelectionRoot, useSingle, useSingleRoot, useSliderRoot, useSplitterRoot, useStack, useStep, useStepRoot, useStorage, useSwitchGroup, useSwitchRoot, useTabsRoot, useTheme, useTimeline, useToggleScope, useTokens, useVirtual, useWindowEventListener, version };
|