@threadlabs/looma 0.1.22 → 0.1.24
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/chunk-HNFCGIBP.js +8 -0
- package/dist/{chunk-NIPNHZ5W.js → chunk-IMHSPETJ.js} +65 -31
- package/dist/chunk-NB6DBRXQ.js +323 -0
- package/dist/{chunk-SZJQ3NPX.js → chunk-TL4FIE7X.js} +4 -8
- package/dist/cjs/controlled-state-BFya8rAX.js +9 -0
- package/dist/cjs/icons-BAdjrnhS.js +680 -0
- package/dist/cjs/{index-D07f6BOw.js → index-BHG9Rpil.js} +33 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/looma.cjs.js +2 -2
- package/dist/cjs/{manager-C9j3HZay.js → manager-Ce25WRtl.js} +6 -7
- package/dist/cjs/ui-affordance-scope.cjs.entry.js +2 -2
- package/dist/cjs/ui-avatar-group.cjs.entry.js +10 -18
- package/dist/cjs/ui-avatar.cjs.entry.js +3 -3
- package/dist/cjs/ui-badge.cjs.entry.js +3 -3
- package/dist/cjs/ui-button.cjs.entry.js +16 -5
- package/dist/cjs/ui-callout.cjs.entry.js +27 -0
- package/dist/cjs/ui-checkbox.cjs.entry.js +14 -8
- package/dist/cjs/ui-chip.cjs.entry.js +19 -0
- package/dist/cjs/ui-combobox.cjs.entry.js +541 -0
- package/dist/cjs/ui-context-menu.cjs.entry.js +3 -3
- package/dist/cjs/ui-dialog.cjs.entry.js +46 -10
- package/dist/cjs/ui-disclosure.cjs.entry.js +10 -7
- package/dist/cjs/ui-floating-action-button.cjs.entry.js +2 -2
- package/dist/cjs/ui-form-field.cjs.entry.js +61 -6
- package/dist/cjs/ui-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/ui-input.cjs.entry.js +11 -6
- package/dist/cjs/ui-menu-item.cjs.entry.js +3 -3
- package/dist/cjs/ui-menu.cjs.entry.js +16 -11
- package/dist/cjs/ui-popover.cjs.entry.js +12 -9
- package/dist/cjs/ui-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/ui-radio.cjs.entry.js +18 -9
- package/dist/cjs/ui-search-result-row.cjs.entry.js +2 -2
- package/dist/cjs/ui-search-shell.cjs.entry.js +2 -2
- package/dist/cjs/ui-select.cjs.entry.js +15 -7
- package/dist/cjs/ui-switch.cjs.entry.js +20 -11
- package/dist/cjs/ui-tabs.cjs.entry.js +11 -10
- package/dist/cjs/ui-textarea.cjs.entry.js +10 -6
- package/dist/cjs/ui-toast-region.cjs.entry.js +31 -20
- package/dist/cjs/ui-tooltip.cjs.entry.js +63 -23
- package/dist/cjs/ui-top-bar.cjs.entry.js +2 -2
- package/dist/cjs/ui-tree-item.cjs.entry.js +57 -616
- package/dist/cjs/ui-tree.cjs.entry.js +198 -14
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.js +1 -1
- package/dist/collection/components/ui-avatar/ui-avatar.css +4 -4
- package/dist/collection/components/ui-avatar/ui-avatar.js +1 -1
- package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +2 -2
- package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +8 -16
- package/dist/collection/components/ui-badge/ui-badge.css +64 -48
- package/dist/collection/components/ui-badge/ui-badge.js +1 -1
- package/dist/collection/components/ui-button/ui-button.css +36 -26
- package/dist/collection/components/ui-button/ui-button.js +14 -3
- package/dist/collection/components/ui-callout/ui-callout.css +74 -0
- package/dist/collection/components/ui-callout/ui-callout.js +59 -0
- package/dist/collection/components/ui-checkbox/ui-checkbox.js +16 -11
- package/dist/collection/components/ui-chip/ui-chip.css +43 -0
- package/dist/collection/components/ui-chip/ui-chip.js +45 -0
- package/dist/collection/components/ui-combobox/ui-combobox.css +24 -0
- package/dist/collection/components/ui-combobox/ui-combobox.js +973 -0
- package/dist/collection/components/ui-context-menu/ui-context-menu.js +1 -1
- package/dist/collection/components/ui-dialog/ui-dialog.js +49 -13
- package/dist/collection/components/ui-disclosure/ui-disclosure.js +12 -10
- package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +1 -1
- package/dist/collection/components/ui-form-field/ui-form-field.css +4 -0
- package/dist/collection/components/ui-form-field/ui-form-field.js +59 -4
- package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
- package/dist/collection/components/ui-input/ui-input.css +8 -6
- package/dist/collection/components/ui-input/ui-input.js +11 -7
- package/dist/collection/components/ui-menu/ui-menu.css +12 -23
- package/dist/collection/components/ui-menu/ui-menu.js +16 -12
- package/dist/collection/components/ui-menu-item/ui-menu-item.css +9 -3
- package/dist/collection/components/ui-menu-item/ui-menu-item.js +1 -1
- package/dist/collection/components/ui-popover/ui-popover.css +14 -5
- package/dist/collection/components/ui-popover/ui-popover.js +12 -10
- package/dist/collection/components/ui-radio/ui-radio.js +25 -12
- package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
- package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +1 -1
- package/dist/collection/components/ui-search-shell/ui-search-shell.js +1 -1
- package/dist/collection/components/ui-select/ui-select.css +8 -6
- package/dist/collection/components/ui-select/ui-select.js +17 -11
- package/dist/collection/components/ui-switch/ui-switch.js +22 -14
- package/dist/collection/components/ui-tabs/ui-tabs.js +13 -13
- package/dist/collection/components/ui-textarea/ui-textarea.css +7 -6
- package/dist/collection/components/ui-textarea/ui-textarea.js +10 -7
- package/dist/collection/components/ui-toast-region/ui-toast-region.js +30 -19
- package/dist/collection/components/ui-tooltip/ui-tooltip.css +16 -7
- package/dist/collection/components/ui-tooltip/ui-tooltip.js +115 -25
- package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
- package/dist/collection/components/ui-tree/ui-tree.css +2 -1
- package/dist/collection/components/ui-tree/ui-tree.js +216 -12
- package/dist/collection/components/ui-tree-item/ui-tree-item.js +84 -25
- package/dist/collection/field/combobox.js +4 -0
- package/dist/collection/field/valibot.js +5 -0
- package/dist/collection/field/validation.js +62 -0
- package/dist/collection/icons.js +6 -1
- package/dist/collection/overlay/manager.js +6 -7
- package/dist/collection/utils/controlled-state.js +4 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-Bh_1GxOD.js +1 -0
- package/dist/components/p-Bk55QiUK.js +1 -0
- package/dist/components/p-BnGhGgTH.js +1 -0
- package/dist/components/p-C-0syqXZ.js +1 -0
- package/dist/components/p-CoFximGM.js +13 -0
- package/dist/components/p-DIGcRYAW.js +1 -0
- package/dist/components/ui-affordance-scope.js +1 -1
- package/dist/components/ui-avatar-group.js +1 -1
- package/dist/components/ui-avatar.js +1 -1
- package/dist/components/ui-badge.js +1 -1
- package/dist/components/ui-button.js +1 -1
- package/dist/components/ui-callout.d.ts +11 -0
- package/dist/components/ui-callout.js +1 -0
- package/dist/components/ui-checkbox.js +1 -1
- package/dist/components/ui-chip.d.ts +11 -0
- package/dist/components/ui-chip.js +1 -0
- package/dist/components/ui-combobox.d.ts +11 -0
- package/dist/components/ui-combobox.js +1 -0
- package/dist/components/ui-context-menu.js +1 -1
- package/dist/components/ui-dialog.js +1 -1
- package/dist/components/ui-disclosure.js +1 -1
- package/dist/components/ui-floating-action-button.js +1 -1
- package/dist/components/ui-form-field.js +1 -1
- package/dist/components/ui-icon-button.js +1 -1
- package/dist/components/ui-input.js +1 -1
- package/dist/components/ui-menu-item.js +1 -1
- package/dist/components/ui-menu.js +1 -1
- package/dist/components/ui-popover.js +1 -1
- package/dist/components/ui-radio-group.js +1 -1
- package/dist/components/ui-radio.js +1 -1
- package/dist/components/ui-search-result-row.js +1 -1
- package/dist/components/ui-search-shell.js +1 -1
- package/dist/components/ui-select.js +1 -1
- package/dist/components/ui-switch.js +1 -1
- package/dist/components/ui-tabs.js +1 -1
- package/dist/components/ui-textarea.js +1 -1
- package/dist/components/ui-toast-region.js +1 -1
- package/dist/components/ui-tooltip.js +1 -1
- package/dist/components/ui-top-bar.js +1 -1
- package/dist/components/ui-tree-item.js +1 -13
- package/dist/components/ui-tree.js +1 -1
- package/dist/esm/controlled-state-BnGhGgTH.js +6 -0
- package/dist/esm/icons-CoFximGM.js +678 -0
- package/dist/esm/{index-CEeiinfk.js → index-8BGiMGQ0.js} +33 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/looma.js +3 -3
- package/dist/esm/{manager-PM9a74r7.js → manager-C-0syqXZ.js} +6 -7
- package/dist/esm/ui-affordance-scope.entry.js +2 -2
- package/dist/esm/ui-avatar-group.entry.js +10 -18
- package/dist/esm/ui-avatar.entry.js +3 -3
- package/dist/esm/ui-badge.entry.js +3 -3
- package/dist/esm/ui-button.entry.js +16 -5
- package/dist/esm/ui-callout.entry.js +25 -0
- package/dist/esm/ui-checkbox.entry.js +14 -8
- package/dist/esm/ui-chip.entry.js +17 -0
- package/dist/esm/ui-combobox.entry.js +539 -0
- package/dist/esm/ui-context-menu.entry.js +3 -3
- package/dist/esm/ui-dialog.entry.js +46 -10
- package/dist/esm/ui-disclosure.entry.js +10 -7
- package/dist/esm/ui-floating-action-button.entry.js +2 -2
- package/dist/esm/ui-form-field.entry.js +61 -6
- package/dist/esm/ui-icon-button.entry.js +2 -2
- package/dist/esm/ui-input.entry.js +11 -6
- package/dist/esm/ui-menu-item.entry.js +3 -3
- package/dist/esm/ui-menu.entry.js +16 -11
- package/dist/esm/ui-popover.entry.js +12 -9
- package/dist/esm/ui-radio-group.entry.js +2 -2
- package/dist/esm/ui-radio.entry.js +18 -9
- package/dist/esm/ui-search-result-row.entry.js +2 -2
- package/dist/esm/ui-search-shell.entry.js +2 -2
- package/dist/esm/ui-select.entry.js +15 -7
- package/dist/esm/ui-switch.entry.js +20 -11
- package/dist/esm/ui-tabs.entry.js +11 -10
- package/dist/esm/ui-textarea.entry.js +10 -6
- package/dist/esm/ui-toast-region.entry.js +31 -20
- package/dist/esm/ui-tooltip.entry.js +63 -23
- package/dist/esm/ui-top-bar.entry.js +2 -2
- package/dist/esm/ui-tree-item.entry.js +57 -616
- package/dist/esm/ui-tree.entry.js +198 -14
- package/dist/index.cjs +2012 -870
- package/dist/index.d.cts +109 -1
- package/dist/index.d.ts +109 -1
- package/dist/index.js +72 -8
- package/dist/looma/looma.esm.js +1 -1
- package/dist/looma/p-03f44c45.entry.js +1 -0
- package/dist/looma/p-08f80207.entry.js +1 -0
- package/dist/looma/p-13f8195a.entry.js +1 -0
- package/dist/looma/{p-d273b857.entry.js → p-25e18ad6.entry.js} +1 -1
- package/dist/looma/p-2c03fa73.entry.js +1 -0
- package/dist/looma/p-314d5c7c.entry.js +1 -0
- package/dist/looma/{p-2ed7e241.entry.js → p-3ef2a21b.entry.js} +1 -1
- package/dist/looma/{p-063f5a89.entry.js → p-5a900d89.entry.js} +1 -1
- package/dist/looma/p-5fdcee1d.entry.js +1 -0
- package/dist/looma/{p-0198bb21.entry.js → p-672e3d16.entry.js} +1 -1
- package/dist/looma/p-68430534.entry.js +1 -0
- package/dist/looma/{p-2e6f791e.entry.js → p-72338f53.entry.js} +1 -1
- package/dist/looma/p-7ab661ec.entry.js +1 -0
- package/dist/looma/p-7c4a225f.entry.js +1 -0
- package/dist/looma/p-82f2fa3d.entry.js +1 -0
- package/dist/looma/p-839faf55.entry.js +1 -0
- package/dist/looma/p-8BGiMGQ0.js +2 -0
- package/dist/looma/p-8e254bc4.entry.js +1 -0
- package/dist/looma/p-8e6b1001.entry.js +1 -0
- package/dist/looma/p-920656cf.entry.js +1 -0
- package/dist/looma/p-97e8cb0e.entry.js +1 -0
- package/dist/looma/p-9d2662ca.entry.js +1 -0
- package/dist/looma/p-9e1c4020.entry.js +1 -0
- package/dist/looma/p-BnGhGgTH.js +1 -0
- package/dist/looma/p-C-0syqXZ.js +1 -0
- package/dist/looma/p-CoFximGM.js +13 -0
- package/dist/looma/{p-051f578c.entry.js → p-a63e2561.entry.js} +1 -1
- package/dist/looma/p-add67e4c.entry.js +1 -0
- package/dist/looma/p-b63f6d4f.entry.js +1 -0
- package/dist/looma/p-bd00d4e8.entry.js +1 -0
- package/dist/looma/p-cc915913.entry.js +1 -0
- package/dist/looma/p-cfba8f7c.entry.js +1 -0
- package/dist/looma/p-d56571a2.entry.js +1 -0
- package/dist/looma/{p-7e94d90d.entry.js → p-e0f241ab.entry.js} +1 -1
- package/dist/looma/p-f1750fd7.entry.js +1 -0
- package/dist/looma/p-fd1e4d22.entry.js +1 -0
- package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +1 -2
- package/dist/types/components/ui-callout/ui-callout.d.ts +6 -0
- package/dist/types/components/ui-checkbox/ui-checkbox.d.ts +2 -1
- package/dist/types/components/ui-chip/ui-chip.d.ts +6 -0
- package/dist/types/components/ui-combobox/ui-combobox.d.ts +93 -0
- package/dist/types/components/ui-dialog/ui-dialog.d.ts +7 -1
- package/dist/types/components/ui-disclosure/ui-disclosure.d.ts +2 -1
- package/dist/types/components/ui-form-field/ui-form-field.d.ts +8 -0
- package/dist/types/components/ui-input/ui-input.d.ts +1 -1
- package/dist/types/components/ui-menu/ui-menu.d.ts +2 -1
- package/dist/types/components/ui-popover/ui-popover.d.ts +2 -1
- package/dist/types/components/ui-radio/ui-radio.d.ts +4 -1
- package/dist/types/components/ui-select/ui-select.d.ts +3 -2
- package/dist/types/components/ui-switch/ui-switch.d.ts +2 -1
- package/dist/types/components/ui-tabs/ui-tabs.d.ts +2 -1
- package/dist/types/components/ui-textarea/ui-textarea.d.ts +1 -1
- package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +3 -1
- package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +20 -2
- package/dist/types/components/ui-tree/ui-tree.d.ts +21 -1
- package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +13 -5
- package/dist/types/components.d.ts +366 -71
- package/dist/types/field/combobox.d.ts +46 -0
- package/dist/types/field/valibot.d.ts +7 -0
- package/dist/types/field/validation.d.ts +56 -0
- package/dist/types/icons.d.ts +5 -0
- package/dist/types/utils/controlled-state.d.ts +4 -0
- package/dist/{ui-affordance-scope.entry-L533MECG.js → ui-affordance-scope.entry-3TUZ6GLW.js} +2 -2
- package/dist/ui-avatar-group.entry-XGJKN25W.js +51 -0
- package/dist/{ui-avatar.entry-3INAY3XP.js → ui-avatar.entry-SN3G44HW.js} +3 -3
- package/dist/ui-badge.entry-B6WDCWJX.js +22 -0
- package/dist/ui-button.entry-AZYUELLV.js +80 -0
- package/dist/ui-callout.entry-QRPWRMPC.js +32 -0
- package/dist/{ui-checkbox.entry-2PTBHSCQ.js → ui-checkbox.entry-OB6GFC4M.js} +17 -8
- package/dist/ui-chip.entry-XSNPJXX3.js +22 -0
- package/dist/ui-combobox.entry-IIMMUJF7.js +553 -0
- package/dist/{ui-context-menu.entry-AYDDCIZS.js → ui-context-menu.entry-AIULIE5Y.js} +3 -3
- package/dist/{ui-dialog.entry-I2XI3ZTZ.js → ui-dialog.entry-QSYWYHLY.js} +48 -10
- package/dist/{ui-disclosure.entry-5LY2BT7B.js → ui-disclosure.entry-3BJEYU3U.js} +13 -7
- package/dist/{ui-floating-action-button.entry-EJAMR5AM.js → ui-floating-action-button.entry-JEVNV6FI.js} +2 -2
- package/dist/ui-form-field.entry-PKSY7UU4.js +120 -0
- package/dist/{ui-icon-button.entry-7SD2LVXE.js → ui-icon-button.entry-TPX7BE7R.js} +2 -2
- package/dist/{ui-input.entry-7MM7GEQW.js → ui-input.entry-6NCLNW4E.js} +8 -6
- package/dist/ui-menu-item.entry-KA2K3PKV.js +22 -0
- package/dist/{ui-menu.entry-R4WK5QSX.js → ui-menu.entry-7GDO5L2T.js} +19 -11
- package/dist/{ui-popover.entry-ZRJRTXA7.js → ui-popover.entry-FR6YRNK6.js} +15 -9
- package/dist/{ui-radio-group.entry-S6RXHFSN.js → ui-radio-group.entry-7QHXQSNO.js} +2 -2
- package/dist/{ui-radio.entry-B73QZK2M.js → ui-radio.entry-YNMXKLDW.js} +21 -9
- package/dist/{ui-search-result-row.entry-DR2Y5S7P.js → ui-search-result-row.entry-AHVVAAIO.js} +2 -2
- package/dist/{ui-search-shell.entry-ST5IKJBC.js → ui-search-shell.entry-CNBEAMEZ.js} +2 -2
- package/dist/{ui-select.entry-7GPRFV67.js → ui-select.entry-TUY6TCTC.js} +13 -7
- package/dist/{ui-switch.entry-XQ5IRJRH.js → ui-switch.entry-26LFI7B5.js} +23 -11
- package/dist/{ui-tabs.entry-HPW5L5CY.js → ui-tabs.entry-LXB62RJJ.js} +14 -10
- package/dist/{ui-textarea.entry-W2PSRYVS.js → ui-textarea.entry-JYGMGPX2.js} +8 -6
- package/dist/{ui-toast-region.entry-FJUHFXKZ.js → ui-toast-region.entry-TOW4KZLZ.js} +29 -20
- package/dist/{ui-tooltip.entry-G5WHQW7K.js → ui-tooltip.entry-SKFNYXPH.js} +68 -25
- package/dist/{ui-top-bar.entry-3NCHFC4Y.js → ui-top-bar.entry-S3YP52EA.js} +2 -2
- package/dist/ui-tree-item.entry-LWYIPYLC.js +145 -0
- package/dist/{ui-tree.entry-SZW4Q5PY.js → ui-tree.entry-LXKUQFRU.js} +184 -13
- package/dist/valibot.d.ts +52 -0
- package/dist/valibot.js +7 -0
- package/editor/{chunk-QCOYOVQL.js → chunk-B5WVJOPV.js} +113 -97
- package/editor/extensions/index.d.ts +14 -6
- package/editor/extensions/index.js +1 -1
- package/editor/index.js +1 -1
- package/editor.css +37 -20
- package/package.json +11 -3
- package/styles.css +46 -20
- package/theme-high-contrast.css +12 -0
- package/tokens.css +26 -0
- package/vue/{chunk-5KWCMTXB.js → chunk-D4AJULDE.js} +116 -17
- package/vue/editor/index.d.ts +5 -15
- package/vue/editor/index.js +1 -1
- package/vue/index.d.ts +447 -115
- package/vue/index.js +7 -1
- package/dist/components/p-CEYIKqYc.js +0 -1
- package/dist/components/p-CIA4RyEp.js +0 -1
- package/dist/components/p-PM9a74r7.js +0 -1
- package/dist/looma/p-0584a051.entry.js +0 -1
- package/dist/looma/p-078f9fb8.entry.js +0 -1
- package/dist/looma/p-0f45c5f0.entry.js +0 -1
- package/dist/looma/p-11083743.entry.js +0 -1
- package/dist/looma/p-1674cda4.entry.js +0 -1
- package/dist/looma/p-1681b218.entry.js +0 -1
- package/dist/looma/p-34417499.entry.js +0 -1
- package/dist/looma/p-4b422d40.entry.js +0 -1
- package/dist/looma/p-54722713.entry.js +0 -13
- package/dist/looma/p-54c41576.entry.js +0 -1
- package/dist/looma/p-5ba9d496.entry.js +0 -1
- package/dist/looma/p-5d4713a6.entry.js +0 -1
- package/dist/looma/p-624ba086.entry.js +0 -1
- package/dist/looma/p-8d5adb17.entry.js +0 -1
- package/dist/looma/p-9194a99d.entry.js +0 -1
- package/dist/looma/p-CEeiinfk.js +0 -2
- package/dist/looma/p-PM9a74r7.js +0 -1
- package/dist/looma/p-a33522a2.entry.js +0 -1
- package/dist/looma/p-a5127c7d.entry.js +0 -1
- package/dist/looma/p-a9f46811.entry.js +0 -1
- package/dist/looma/p-b7aa4488.entry.js +0 -1
- package/dist/looma/p-caa8fc7b.entry.js +0 -1
- package/dist/looma/p-e3f99a24.entry.js +0 -1
- package/dist/looma/p-ed5abf6d.entry.js +0 -1
- package/dist/ui-avatar-group.entry-BWS7E2CM.js +0 -59
- package/dist/ui-badge.entry-2WOBVOYP.js +0 -22
- package/dist/ui-button.entry-VCGSEONK.js +0 -71
- package/dist/ui-form-field.entry-SJ6NNFXB.js +0 -67
- package/dist/ui-menu-item.entry-V3HIMR75.js +0 -22
- package/dist/ui-tree-item.entry-45RR3CMP.js +0 -385
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BHG9Rpil.js');
|
|
4
4
|
var events = require('./events-TcQIzpNv.js');
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -55,7 +55,7 @@ function createHoverIntent(delay, onIntent) {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
const uiTreeCss = () => `:host{--ui-tree-indent:16px;display:block;min-inline-size:0;padding-inline-start:var(--ui-tree-gutter
|
|
58
|
+
const uiTreeCss = () => `:host{--ui-tree-indent:16px;--ui-tree-gutter:0px;display:block;min-inline-size:0;padding-inline-start:var(--ui-tree-gutter)}::slotted(ui-tree-item){--ui-tree-indent:inherit}`;
|
|
59
59
|
|
|
60
60
|
const UITree = class {
|
|
61
61
|
constructor(hostRef) {
|
|
@@ -64,10 +64,17 @@ const UITree = class {
|
|
|
64
64
|
get host() { return index.getElement(this); }
|
|
65
65
|
label = 'Tree';
|
|
66
66
|
hoverExpandDelay = 700;
|
|
67
|
+
/** Maximum resulting item depth accepted by pointer reordering. Zero is unlimited. */
|
|
68
|
+
maxDepth = 0;
|
|
67
69
|
source = null;
|
|
68
70
|
target = null;
|
|
69
71
|
position = null;
|
|
72
|
+
rejectedTarget = null;
|
|
73
|
+
rejectedPosition = null;
|
|
74
|
+
rejection = null;
|
|
70
75
|
hoverIntent = null;
|
|
76
|
+
structureObserver = null;
|
|
77
|
+
tabStop = null;
|
|
71
78
|
componentDidLoad() {
|
|
72
79
|
this.hoverIntent = createHoverIntent(this.hoverExpandDelay, this.expandTarget);
|
|
73
80
|
this.host.addEventListener('dragstart', this.onDragStart);
|
|
@@ -78,6 +85,11 @@ const UITree = class {
|
|
|
78
85
|
this.host.addEventListener('drop', this.onDrop);
|
|
79
86
|
this.host.addEventListener('dragend', this.onDragEnd);
|
|
80
87
|
this.host.addEventListener('keydown', this.onKeyDown);
|
|
88
|
+
this.host.addEventListener('focusin', this.onFocusIn);
|
|
89
|
+
this.host.addEventListener('ui-tree-expansion-change', this.onExpansionChange);
|
|
90
|
+
this.syncStructuralLevels();
|
|
91
|
+
this.structureObserver = new MutationObserver(this.syncStructuralLevels);
|
|
92
|
+
this.structureObserver.observe(this.host, { childList: true, subtree: true });
|
|
81
93
|
}
|
|
82
94
|
disconnectedCallback() {
|
|
83
95
|
this.hoverIntent?.destroy();
|
|
@@ -89,10 +101,44 @@ const UITree = class {
|
|
|
89
101
|
this.host.removeEventListener('drop', this.onDrop);
|
|
90
102
|
this.host.removeEventListener('dragend', this.onDragEnd);
|
|
91
103
|
this.host.removeEventListener('keydown', this.onKeyDown);
|
|
104
|
+
this.host.removeEventListener('focusin', this.onFocusIn);
|
|
105
|
+
this.host.removeEventListener('ui-tree-expansion-change', this.onExpansionChange);
|
|
106
|
+
this.structureObserver?.disconnect();
|
|
107
|
+
this.structureObserver = null;
|
|
108
|
+
}
|
|
109
|
+
syncStructuralLevels = () => {
|
|
110
|
+
for (const item of Array.from(this.host.querySelectorAll('ui-tree-item'))) {
|
|
111
|
+
item.dispatchEvent(new CustomEvent('ui-tree-structure-sync'));
|
|
112
|
+
}
|
|
113
|
+
this.syncTabStop();
|
|
114
|
+
};
|
|
115
|
+
syncTabStop(preferred) {
|
|
116
|
+
const items = this.visibleItems();
|
|
117
|
+
const next = preferred && items.includes(preferred)
|
|
118
|
+
? preferred
|
|
119
|
+
: this.tabStop && items.includes(this.tabStop)
|
|
120
|
+
? this.tabStop
|
|
121
|
+
: items[0] ?? null;
|
|
122
|
+
this.tabStop = next;
|
|
123
|
+
for (const item of items) {
|
|
124
|
+
item.dispatchEvent(new CustomEvent('ui-tree-roving-tab-stop', {
|
|
125
|
+
detail: { active: item === next },
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
92
128
|
}
|
|
93
129
|
itemFromEvent(event) {
|
|
94
130
|
return event.composedPath().find(node => (node instanceof HTMLElement && node.localName === 'ui-tree-item')) ?? null;
|
|
95
131
|
}
|
|
132
|
+
eventTargetsInteractiveContent(event) {
|
|
133
|
+
for (const node of event.composedPath()) {
|
|
134
|
+
if (node instanceof HTMLElement && node.localName === 'ui-tree-item')
|
|
135
|
+
break;
|
|
136
|
+
if (node instanceof HTMLElement && node.matches('a, button, input, select, textarea, [role="button"], [role="link"]')) {
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
96
142
|
itemId(item) {
|
|
97
143
|
return item.itemId || item.getAttribute('item-id') || '';
|
|
98
144
|
}
|
|
@@ -134,19 +180,56 @@ const UITree = class {
|
|
|
134
180
|
.filter(Boolean),
|
|
135
181
|
};
|
|
136
182
|
}
|
|
137
|
-
|
|
183
|
+
constraintDepth(item) {
|
|
184
|
+
if (item.dropDepth !== undefined)
|
|
185
|
+
return item.dropDepth;
|
|
186
|
+
const dropDepth = item.getAttribute('drop-depth');
|
|
187
|
+
if (dropDepth !== null)
|
|
188
|
+
return Number(dropDepth);
|
|
189
|
+
return Number(item.getAttribute('aria-level')) || 1;
|
|
190
|
+
}
|
|
191
|
+
subtreeDepth(item) {
|
|
192
|
+
if (item.subtreeDepth !== undefined)
|
|
193
|
+
return Math.max(0, Math.floor(item.subtreeDepth));
|
|
194
|
+
const override = item.getAttribute('subtree-depth');
|
|
195
|
+
if (override !== null)
|
|
196
|
+
return Math.max(0, Math.floor(Number(override)));
|
|
197
|
+
return Array.from(item.querySelectorAll('ui-tree-item')).reduce((deepest, descendant) => {
|
|
198
|
+
let nesting = 0;
|
|
199
|
+
let ancestor = descendant.parentElement?.closest('ui-tree-item') ?? null;
|
|
200
|
+
while (ancestor && ancestor !== item) {
|
|
201
|
+
nesting += 1;
|
|
202
|
+
ancestor = ancestor.parentElement?.closest('ui-tree-item') ?? null;
|
|
203
|
+
}
|
|
204
|
+
return ancestor === item ? Math.max(deepest, nesting + 1) : deepest;
|
|
205
|
+
}, 0);
|
|
206
|
+
}
|
|
207
|
+
dropRejection(source, target, position) {
|
|
138
208
|
// A tree item can never move into (or beside) one of its own descendants.
|
|
139
209
|
// Reject the target before showing any insertion affordance so the preview
|
|
140
210
|
// stays truthful instead of promising a move the consumer must undo.
|
|
141
211
|
if (source.contains(target))
|
|
142
|
-
return
|
|
212
|
+
return { reason: 'descendant' };
|
|
143
213
|
const sourceMeta = this.itemMetadata(source);
|
|
144
214
|
const targetMeta = this.itemMetadata(target);
|
|
145
215
|
if (position === 'inside') {
|
|
146
|
-
|
|
147
|
-
|
|
216
|
+
if (!this.acceptsChildren(target)
|
|
217
|
+
|| (targetMeta.accepts.length > 0 && !targetMeta.accepts.includes(sourceMeta.type))) {
|
|
218
|
+
return { reason: 'incompatible' };
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
else if (sourceMeta.type !== targetMeta.type) {
|
|
222
|
+
return { reason: 'incompatible' };
|
|
148
223
|
}
|
|
149
|
-
|
|
224
|
+
const maxDepth = Math.max(0, Math.floor(this.maxDepth));
|
|
225
|
+
if (maxDepth > 0) {
|
|
226
|
+
const targetDepth = Math.max(0, Math.floor(this.constraintDepth(target)));
|
|
227
|
+
const subtreeDepth = this.subtreeDepth(source);
|
|
228
|
+
const resultingDepth = targetDepth + (position === 'inside' ? 1 : 0) + subtreeDepth;
|
|
229
|
+
if (resultingDepth > maxDepth)
|
|
230
|
+
return { reason: 'max-depth', maxDepth, resultingDepth };
|
|
231
|
+
}
|
|
232
|
+
return null;
|
|
150
233
|
}
|
|
151
234
|
clearTarget() {
|
|
152
235
|
this.target?.removeAttribute('data-drop-position');
|
|
@@ -154,10 +237,16 @@ const UITree = class {
|
|
|
154
237
|
this.position = null;
|
|
155
238
|
this.hoverIntent?.cancel();
|
|
156
239
|
}
|
|
240
|
+
clearRejection() {
|
|
241
|
+
this.rejectedTarget = null;
|
|
242
|
+
this.rejectedPosition = null;
|
|
243
|
+
this.rejection = null;
|
|
244
|
+
}
|
|
157
245
|
finishDrag() {
|
|
158
246
|
this.source?.removeAttribute('data-dragging');
|
|
159
247
|
this.source = null;
|
|
160
248
|
this.clearTarget();
|
|
249
|
+
this.clearRejection();
|
|
161
250
|
}
|
|
162
251
|
expandTarget = (itemId) => {
|
|
163
252
|
const item = Array.from(this.host.querySelectorAll('ui-tree-item'))
|
|
@@ -195,18 +284,29 @@ const UITree = class {
|
|
|
195
284
|
return false;
|
|
196
285
|
if (!target || target === this.source) {
|
|
197
286
|
this.clearTarget();
|
|
287
|
+
this.clearRejection();
|
|
198
288
|
return false;
|
|
199
289
|
}
|
|
200
290
|
const row = this.rowFor(target);
|
|
201
291
|
if (!row)
|
|
202
292
|
return false;
|
|
203
293
|
const position = classifyDropPosition(row.getBoundingClientRect(), clientY, this.acceptsChildren(target));
|
|
204
|
-
|
|
294
|
+
const rejection = this.dropRejection(this.source, target, position);
|
|
295
|
+
if (rejection) {
|
|
205
296
|
if (dataTransfer)
|
|
206
297
|
dataTransfer.dropEffect = 'none';
|
|
207
298
|
this.clearTarget();
|
|
299
|
+
if (rejection.reason === 'max-depth') {
|
|
300
|
+
this.rejectedTarget = target;
|
|
301
|
+
this.rejectedPosition = position;
|
|
302
|
+
this.rejection = rejection;
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
this.clearRejection();
|
|
306
|
+
}
|
|
208
307
|
return false;
|
|
209
308
|
}
|
|
309
|
+
this.clearRejection();
|
|
210
310
|
if (dataTransfer)
|
|
211
311
|
dataTransfer.dropEffect = 'move';
|
|
212
312
|
if (this.target !== target || this.position !== position) {
|
|
@@ -248,12 +348,15 @@ const UITree = class {
|
|
|
248
348
|
if (this.itemAtPoint(event.clientX, event.clientY))
|
|
249
349
|
return;
|
|
250
350
|
this.clearTarget();
|
|
351
|
+
this.clearRejection();
|
|
251
352
|
};
|
|
252
353
|
dispatchReorder(source, target, position) {
|
|
253
354
|
const sourceId = this.itemId(source);
|
|
254
355
|
const targetId = this.itemId(target);
|
|
255
356
|
if (!sourceId || !targetId)
|
|
256
357
|
return;
|
|
358
|
+
if (position === 'inside')
|
|
359
|
+
this.expandTarget(targetId);
|
|
257
360
|
const sourceMeta = this.itemMetadata(source);
|
|
258
361
|
const targetMeta = this.itemMetadata(target);
|
|
259
362
|
events.dispatchDetail(this.host, 'reorder', {
|
|
@@ -267,6 +370,21 @@ const UITree = class {
|
|
|
267
370
|
trigger: 'pointer',
|
|
268
371
|
});
|
|
269
372
|
}
|
|
373
|
+
dispatchReorderRejected(source, target, position, rejection) {
|
|
374
|
+
const sourceId = this.itemId(source);
|
|
375
|
+
const targetId = this.itemId(target);
|
|
376
|
+
if (!sourceId || !targetId)
|
|
377
|
+
return;
|
|
378
|
+
events.dispatchDetail(this.host, 'reorder-rejected', {
|
|
379
|
+
sourceId,
|
|
380
|
+
targetId,
|
|
381
|
+
position,
|
|
382
|
+
reason: 'max-depth',
|
|
383
|
+
maxDepth: rejection.maxDepth,
|
|
384
|
+
resultingDepth: rejection.resultingDepth,
|
|
385
|
+
trigger: 'pointer',
|
|
386
|
+
});
|
|
387
|
+
}
|
|
270
388
|
onDrop = (event) => {
|
|
271
389
|
if (!this.source || !this.target || !this.position)
|
|
272
390
|
return;
|
|
@@ -276,14 +394,23 @@ const UITree = class {
|
|
|
276
394
|
};
|
|
277
395
|
onDragEnd = (event) => {
|
|
278
396
|
if (this.source) {
|
|
397
|
+
if (this.rejectedTarget && this.rejectedPosition && this.rejection) {
|
|
398
|
+
this.dispatchReorderRejected(this.source, this.rejectedTarget, this.rejectedPosition, this.rejection);
|
|
399
|
+
this.finishDrag();
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
279
402
|
const target = this.itemAtPoint(event.clientX, event.clientY);
|
|
280
403
|
if (target && target !== this.source) {
|
|
281
404
|
const row = this.rowFor(target);
|
|
282
405
|
if (row) {
|
|
283
406
|
const position = classifyDropPosition(row.getBoundingClientRect(), event.clientY, this.acceptsChildren(target));
|
|
284
|
-
|
|
407
|
+
const rejection = this.dropRejection(this.source, target, position);
|
|
408
|
+
if (!rejection) {
|
|
285
409
|
this.dispatchReorder(this.source, target, position);
|
|
286
410
|
}
|
|
411
|
+
else if (rejection.reason === 'max-depth') {
|
|
412
|
+
this.dispatchReorderRejected(this.source, target, position, rejection);
|
|
413
|
+
}
|
|
287
414
|
}
|
|
288
415
|
}
|
|
289
416
|
}
|
|
@@ -293,7 +420,35 @@ const UITree = class {
|
|
|
293
420
|
return Array.from(this.host.querySelectorAll('ui-tree-item'))
|
|
294
421
|
.filter(item => item.getClientRects().length > 0 && !item.hasAttribute('disabled'));
|
|
295
422
|
}
|
|
423
|
+
parentItem(item) {
|
|
424
|
+
const parent = item.parentElement?.closest('ui-tree-item') ?? null;
|
|
425
|
+
return parent && this.host.contains(parent) ? parent : null;
|
|
426
|
+
}
|
|
427
|
+
firstVisibleChild(item, items) {
|
|
428
|
+
return items.find(candidate => this.parentItem(candidate) === item) ?? null;
|
|
429
|
+
}
|
|
430
|
+
focusItem(item) {
|
|
431
|
+
this.syncTabStop(item);
|
|
432
|
+
item.focus();
|
|
433
|
+
}
|
|
434
|
+
requestExpansion(item, expanded) {
|
|
435
|
+
item.dispatchEvent(new CustomEvent('ui-tree-request-expanded', {
|
|
436
|
+
detail: { expanded, trigger: 'keyboard' },
|
|
437
|
+
}));
|
|
438
|
+
}
|
|
439
|
+
onFocusIn = (event) => {
|
|
440
|
+
if (this.eventTargetsInteractiveContent(event))
|
|
441
|
+
return;
|
|
442
|
+
const item = this.itemFromEvent(event);
|
|
443
|
+
if (item)
|
|
444
|
+
this.syncTabStop(item);
|
|
445
|
+
};
|
|
446
|
+
onExpansionChange = () => {
|
|
447
|
+
requestAnimationFrame(() => this.syncTabStop());
|
|
448
|
+
};
|
|
296
449
|
onKeyDown = (event) => {
|
|
450
|
+
if (this.eventTargetsInteractiveContent(event))
|
|
451
|
+
return;
|
|
297
452
|
const current = this.itemFromEvent(event);
|
|
298
453
|
if (!current)
|
|
299
454
|
return;
|
|
@@ -301,14 +456,43 @@ const UITree = class {
|
|
|
301
456
|
const index = items.indexOf(current);
|
|
302
457
|
if (index < 0)
|
|
303
458
|
return;
|
|
304
|
-
const next = event.key === 'ArrowDown' ? items[index + 1]
|
|
305
|
-
|
|
459
|
+
const next = event.key === 'ArrowDown' ? items[index + 1]
|
|
460
|
+
: event.key === 'ArrowUp' ? items[index - 1]
|
|
461
|
+
: event.key === 'Home' ? items[0]
|
|
462
|
+
: event.key === 'End' ? items.at(-1)
|
|
463
|
+
: null;
|
|
464
|
+
if (next) {
|
|
465
|
+
event.preventDefault();
|
|
466
|
+
this.focusItem(next);
|
|
306
467
|
return;
|
|
307
|
-
|
|
308
|
-
|
|
468
|
+
}
|
|
469
|
+
if (event.key === 'ArrowLeft') {
|
|
470
|
+
if (current.getAttribute('aria-expanded') === 'true') {
|
|
471
|
+
event.preventDefault();
|
|
472
|
+
this.requestExpansion(current, false);
|
|
473
|
+
}
|
|
474
|
+
else if (this.parentItem(current)) {
|
|
475
|
+
event.preventDefault();
|
|
476
|
+
this.focusItem(this.parentItem(current));
|
|
477
|
+
}
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
if (event.key === 'ArrowRight') {
|
|
481
|
+
if (current.getAttribute('aria-expanded') === 'false') {
|
|
482
|
+
event.preventDefault();
|
|
483
|
+
this.requestExpansion(current, true);
|
|
484
|
+
}
|
|
485
|
+
else if (current.getAttribute('aria-expanded') === 'true') {
|
|
486
|
+
const child = this.firstVisibleChild(current, items);
|
|
487
|
+
if (child) {
|
|
488
|
+
event.preventDefault();
|
|
489
|
+
this.focusItem(child);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
309
493
|
};
|
|
310
494
|
render() {
|
|
311
|
-
return (index.h(index.Host, { key: '
|
|
495
|
+
return (index.h(index.Host, { key: '549c09abc67dc60b16bf2d6b7d6346f214e9d6ae', role: "tree", "aria-label": this.label || 'Tree' }, index.h("slot", { key: 'fea59bde97611bf384e32ce4fb2b3eec9aca784f' })));
|
|
312
496
|
}
|
|
313
497
|
};
|
|
314
498
|
UITree.style = uiTreeCss();
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
+
"components/ui-callout/ui-callout.js",
|
|
3
4
|
"components/ui-affordance-scope/ui-affordance-scope.js",
|
|
4
5
|
"components/ui-avatar/ui-avatar.js",
|
|
5
6
|
"components/ui-avatar-group/ui-avatar-group.js",
|
|
6
7
|
"components/ui-badge/ui-badge.js",
|
|
7
8
|
"components/ui-button/ui-button.js",
|
|
8
9
|
"components/ui-checkbox/ui-checkbox.js",
|
|
10
|
+
"components/ui-chip/ui-chip.js",
|
|
11
|
+
"components/ui-combobox/ui-combobox.js",
|
|
9
12
|
"components/ui-context-menu/ui-context-menu.js",
|
|
10
13
|
"components/ui-dialog/ui-dialog.js",
|
|
11
14
|
"components/ui-disclosure/ui-disclosure.js",
|
|
@@ -22,7 +22,7 @@ export class UIAffordanceScope {
|
|
|
22
22
|
this.coordinator?.refresh();
|
|
23
23
|
};
|
|
24
24
|
render() {
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: 'f500fa48554ed6224efd2dbe9632880bf0a15a19' }, h("slot", { key: '37c5c5b7925b260ff8f9edd411ee6c90a12a4909', onSlotchange: this.onSlotChange })));
|
|
26
26
|
}
|
|
27
27
|
static get is() { return "ui-affordance-scope"; }
|
|
28
28
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.avatar {
|
|
2
6
|
display: inline-grid;
|
|
3
7
|
place-items: center;
|
|
4
8
|
overflow: hidden;
|
|
@@ -14,10 +18,6 @@
|
|
|
14
18
|
text-transform: uppercase;
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
.avatar {
|
|
18
|
-
display: contents;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
21
|
.avatar img {
|
|
22
22
|
grid-area: 1 / 1;
|
|
23
23
|
inline-size: 100%;
|
|
@@ -18,7 +18,7 @@ export class UIAvatar {
|
|
|
18
18
|
render() {
|
|
19
19
|
const fallbackText = this.fallback || toInitials(this.name || this.alt);
|
|
20
20
|
const label = this.alt || this.name || 'Avatar';
|
|
21
|
-
return (h(Host, { key: '
|
|
21
|
+
return (h(Host, { key: 'bbe6c3a775702022a19d819a6cc9d81d798cb3e1', role: "img", "aria-label": label, "data-has-image": this.hasImage ? '' : undefined }, h("div", { key: '63402327ba5bde122bf5deaea09baf965ee9b047', class: "avatar" }, h("img", { key: 'e52b86773684b80d76efa459cb03ae40881f959b', src: this.src, alt: label, onLoad: this.onImageLoad, onError: this.onImageError, hidden: !this.hasImage, "aria-hidden": this.hasImage ? 'false' : 'true' }), h("span", { key: '82a6d8f0d0c69ca52f81d092a2292fc80238265b', class: "fallback", hidden: this.hasImage, "aria-hidden": this.hasImage ? 'true' : 'false' }, fallbackText))));
|
|
22
22
|
}
|
|
23
23
|
static get is() { return "ui-avatar"; }
|
|
24
24
|
static get encapsulation() { return "shadow"; }
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
gap: 0;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
::slotted(
|
|
8
|
+
::slotted(*) {
|
|
9
9
|
margin-inline-end: -0.5rem;
|
|
10
10
|
flex-shrink: 0;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
::slotted(*:last-of-type
|
|
13
|
+
::slotted(*:last-of-type) {
|
|
14
14
|
margin-inline-end: 0;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -1,36 +1,28 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
const OVERFLOW_ATTR = 'data-ui-avatar-group-overflow';
|
|
3
2
|
export class UIAvatarGroup {
|
|
4
3
|
host;
|
|
5
4
|
max = 5;
|
|
6
5
|
label = 'People';
|
|
7
6
|
overflowCount = 0;
|
|
8
|
-
slotRef;
|
|
9
7
|
syncOverflow() {
|
|
10
8
|
this.updateOverflow();
|
|
11
9
|
}
|
|
12
10
|
componentDidLoad() {
|
|
13
|
-
this.slotRef?.addEventListener('slotchange', () => this.updateOverflow());
|
|
14
11
|
this.updateOverflow();
|
|
15
12
|
}
|
|
16
|
-
|
|
17
|
-
this.
|
|
13
|
+
visibleLimit() {
|
|
14
|
+
return Number.isFinite(this.max) ? Math.max(0, Math.floor(this.max)) : 0;
|
|
18
15
|
}
|
|
19
16
|
updateOverflow() {
|
|
20
|
-
const
|
|
21
|
-
const nodes = slot?.assignedElements() ?? Array.from(this.host.children);
|
|
22
|
-
const children = nodes.filter((el) => !el.hasAttribute(OVERFLOW_ATTR));
|
|
17
|
+
const children = Array.from(this.host.children);
|
|
23
18
|
const total = children.length;
|
|
24
|
-
const
|
|
25
|
-
const overflowCount = total >
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
el.setAttribute('aria-hidden', String(i >= visibleCount));
|
|
29
|
-
});
|
|
30
|
-
this.overflowCount = overflowCount;
|
|
19
|
+
const visibleLimit = this.visibleLimit();
|
|
20
|
+
const overflowCount = total > visibleLimit ? total - visibleLimit : 0;
|
|
21
|
+
if (this.overflowCount !== overflowCount)
|
|
22
|
+
this.overflowCount = overflowCount;
|
|
31
23
|
}
|
|
32
24
|
render() {
|
|
33
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: '9ba6693cabc379bbbe6f5698160481f27fe02f31', role: "group", "aria-label": this.label || undefined }, h("style", { key: 'ed231fe96c16a3cdd5a66d4828664c75c6959a9e' }, `::slotted(:nth-child(n + ${this.visibleLimit() + 1})) { display: none !important; }`), h("slot", { key: '463005a7f3c498c80c768151ab32c873ff1abf86', onSlotchange: () => this.updateOverflow() }), this.overflowCount > 0 && (h("span", { key: 'dc1ba88fd97ca461e6518d223f00a93416e6d0f0', class: "overflow", role: "img", "aria-label": `${this.overflowCount} more ${this.overflowCount === 1 ? 'person' : 'people'}`, "data-ui-avatar-group-overflow": true }, "+", this.overflowCount))));
|
|
34
26
|
}
|
|
35
27
|
static get is() { return "ui-avatar-group"; }
|
|
36
28
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,74 +1,90 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
--ui-badge-surface: var(--ui-surface-muted);
|
|
3
|
+
--ui-badge-text: var(--ui-text-secondary);
|
|
4
|
+
--ui-badge-border: var(--ui-border-default);
|
|
5
|
+
--ui-badge-font-size: var(--ui-font-size-xs);
|
|
6
|
+
--ui-badge-font-weight: var(--ui-font-normal);
|
|
7
|
+
--ui-badge-line-height: var(--ui-line-height-tight);
|
|
8
|
+
--ui-badge-padding-block: var(--ui-space-0-5);
|
|
9
|
+
--ui-badge-padding-inline: var(--ui-space-2);
|
|
10
|
+
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
max-width: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.badge__surface {
|
|
2
16
|
display: inline-flex;
|
|
3
17
|
align-items: center;
|
|
4
18
|
justify-content: center;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
19
|
+
max-width: 100%;
|
|
20
|
+
padding: var(--ui-badge-padding-block) var(--ui-badge-padding-inline);
|
|
21
|
+
border: 1px solid var(--ui-badge-border);
|
|
22
|
+
border-radius: var(--ui-radius-round);
|
|
23
|
+
background: var(--ui-badge-surface);
|
|
24
|
+
color: var(--ui-badge-text);
|
|
25
|
+
font-family: var(--ui-font-family-sans);
|
|
26
|
+
font-size: var(--ui-badge-font-size);
|
|
27
|
+
font-weight: var(--ui-badge-font-weight);
|
|
28
|
+
line-height: var(--ui-badge-line-height);
|
|
13
29
|
white-space: nowrap;
|
|
14
30
|
}
|
|
15
31
|
|
|
16
|
-
:host([data-tone='accent']) {
|
|
17
|
-
|
|
18
|
-
border
|
|
19
|
-
|
|
32
|
+
:host([data-tone='accent']) .badge__surface {
|
|
33
|
+
--ui-badge-surface: var(--ui-accent-solid);
|
|
34
|
+
--ui-badge-border: var(--ui-accent-solid);
|
|
35
|
+
--ui-badge-text: var(--ui-text-on-accent);
|
|
20
36
|
}
|
|
21
37
|
|
|
22
|
-
:host([data-tone='danger']) {
|
|
23
|
-
|
|
24
|
-
border
|
|
25
|
-
|
|
38
|
+
:host([data-tone='danger']) .badge__surface {
|
|
39
|
+
--ui-badge-surface: var(--ui-danger-solid);
|
|
40
|
+
--ui-badge-border: var(--ui-danger-solid);
|
|
41
|
+
--ui-badge-text: var(--ui-text-on-accent);
|
|
26
42
|
}
|
|
27
43
|
|
|
28
|
-
:host([data-tone='success']) {
|
|
29
|
-
|
|
30
|
-
border
|
|
31
|
-
|
|
44
|
+
:host([data-tone='success']) .badge__surface {
|
|
45
|
+
--ui-badge-surface: var(--ui-success-solid);
|
|
46
|
+
--ui-badge-border: var(--ui-success-solid);
|
|
47
|
+
--ui-badge-text: var(--ui-text-on-accent);
|
|
32
48
|
}
|
|
33
49
|
|
|
34
|
-
:host([data-tone='warning']) {
|
|
35
|
-
|
|
36
|
-
border
|
|
37
|
-
|
|
50
|
+
:host([data-tone='warning']) .badge__surface {
|
|
51
|
+
--ui-badge-surface: var(--ui-warning-solid);
|
|
52
|
+
--ui-badge-border: var(--ui-warning-solid);
|
|
53
|
+
--ui-badge-text: var(--ui-text-primary);
|
|
38
54
|
}
|
|
39
55
|
|
|
40
|
-
:host([data-tone='info']) {
|
|
41
|
-
|
|
42
|
-
border
|
|
43
|
-
|
|
56
|
+
:host([data-tone='info']) .badge__surface {
|
|
57
|
+
--ui-badge-surface: var(--ui-info-solid);
|
|
58
|
+
--ui-badge-border: var(--ui-info-solid);
|
|
59
|
+
--ui-badge-text: var(--ui-text-on-accent);
|
|
44
60
|
}
|
|
45
61
|
|
|
46
|
-
:host([data-variant='subtle'][data-tone='accent']) {
|
|
47
|
-
|
|
48
|
-
border
|
|
49
|
-
|
|
62
|
+
:host([data-variant='subtle'][data-tone='accent']) .badge__surface {
|
|
63
|
+
--ui-badge-surface: var(--ui-accent-soft);
|
|
64
|
+
--ui-badge-border: var(--ui-accent-soft);
|
|
65
|
+
--ui-badge-text: var(--ui-accent-solid);
|
|
50
66
|
}
|
|
51
67
|
|
|
52
|
-
:host([data-variant='subtle'][data-tone='danger']) {
|
|
53
|
-
|
|
54
|
-
border
|
|
55
|
-
|
|
68
|
+
:host([data-variant='subtle'][data-tone='danger']) .badge__surface {
|
|
69
|
+
--ui-badge-surface: var(--ui-danger-soft);
|
|
70
|
+
--ui-badge-border: var(--ui-danger-soft);
|
|
71
|
+
--ui-badge-text: var(--ui-danger-solid);
|
|
56
72
|
}
|
|
57
73
|
|
|
58
|
-
:host([data-variant='subtle'][data-tone='success']) {
|
|
59
|
-
|
|
60
|
-
border
|
|
61
|
-
|
|
74
|
+
:host([data-variant='subtle'][data-tone='success']) .badge__surface {
|
|
75
|
+
--ui-badge-surface: var(--ui-success-soft);
|
|
76
|
+
--ui-badge-border: var(--ui-success-soft);
|
|
77
|
+
--ui-badge-text: var(--ui-success-solid);
|
|
62
78
|
}
|
|
63
79
|
|
|
64
|
-
:host([data-variant='subtle'][data-tone='warning']) {
|
|
65
|
-
|
|
66
|
-
border
|
|
67
|
-
|
|
80
|
+
:host([data-variant='subtle'][data-tone='warning']) .badge__surface {
|
|
81
|
+
--ui-badge-surface: var(--ui-warning-soft);
|
|
82
|
+
--ui-badge-border: var(--ui-warning-soft);
|
|
83
|
+
--ui-badge-text: var(--ui-warning-solid);
|
|
68
84
|
}
|
|
69
85
|
|
|
70
|
-
:host([data-variant='subtle'][data-tone='info']) {
|
|
71
|
-
|
|
72
|
-
border
|
|
73
|
-
|
|
86
|
+
:host([data-variant='subtle'][data-tone='info']) .badge__surface {
|
|
87
|
+
--ui-badge-surface: var(--ui-info-soft);
|
|
88
|
+
--ui-badge-border: var(--ui-info-soft);
|
|
89
|
+
--ui-badge-text: var(--ui-info-solid);
|
|
74
90
|
}
|
|
@@ -3,7 +3,7 @@ export class UIBadge {
|
|
|
3
3
|
variant;
|
|
4
4
|
tone;
|
|
5
5
|
render() {
|
|
6
|
-
return (h(Host, { key: '
|
|
6
|
+
return (h(Host, { key: 'ba96ade6d037a7ed9958e7eed540e62782f846f0', "data-variant": this.variant || undefined, "data-tone": this.tone || undefined }, h("span", { key: 'a1e9587f59de479c19b9ea7aec8c8e932b998369', class: "badge__surface" }, h("slot", { key: '5835ddcea5cda472e700557528fd3cbc9d572616' }))));
|
|
7
7
|
}
|
|
8
8
|
static get is() { return "ui-badge"; }
|
|
9
9
|
static get encapsulation() { return "shadow"; }
|