@threadlabs/looma 0.1.23 → 0.1.25
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-NB6DBRXQ.js +323 -0
- package/dist/{chunk-GDMQKT5F.js → chunk-UY423IKN.js} +33 -30
- package/dist/cjs/controlled-state-BFya8rAX.js +9 -0
- package/dist/cjs/icons-BAdjrnhS.js +680 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/looma.cjs.js +1 -1
- package/dist/cjs/ui-affordance-scope.cjs.entry.js +1 -1
- package/dist/cjs/ui-avatar-group.cjs.entry.js +9 -17
- package/dist/cjs/ui-avatar.cjs.entry.js +2 -2
- package/dist/cjs/ui-badge.cjs.entry.js +2 -2
- package/dist/cjs/ui-button.cjs.entry.js +1 -1
- package/dist/cjs/ui-callout.cjs.entry.js +27 -0
- package/dist/cjs/ui-checkbox.cjs.entry.js +13 -7
- package/dist/cjs/{ui-combobox.cjs.entry.js → ui-chip_2.cjs.entry.js} +29 -4
- package/dist/cjs/ui-context-menu.cjs.entry.js +1 -1
- package/dist/cjs/ui-dialog.cjs.entry.js +44 -8
- package/dist/cjs/ui-disclosure.cjs.entry.js +9 -6
- package/dist/cjs/ui-editable.cjs.entry.js +100 -0
- package/dist/cjs/ui-floating-action-button.cjs.entry.js +1 -1
- package/dist/cjs/ui-form-field.cjs.entry.js +59 -4
- package/dist/cjs/ui-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/ui-input.cjs.entry.js +1 -1
- package/dist/cjs/ui-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/ui-menu.cjs.entry.js +14 -9
- package/dist/cjs/ui-multi-combobox.cjs.entry.js +158 -0
- package/dist/cjs/ui-popover.cjs.entry.js +10 -7
- package/dist/cjs/ui-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/ui-radio.cjs.entry.js +16 -7
- package/dist/cjs/ui-search-result-row.cjs.entry.js +1 -1
- package/dist/cjs/ui-search-shell.cjs.entry.js +1 -1
- package/dist/cjs/ui-select.cjs.entry.js +1 -1
- package/dist/cjs/ui-switch.cjs.entry.js +19 -10
- package/dist/cjs/ui-tabs.cjs.entry.js +10 -9
- package/dist/cjs/ui-textarea.cjs.entry.js +1 -1
- package/dist/cjs/ui-toast-region.cjs.entry.js +30 -19
- package/dist/cjs/ui-tooltip.cjs.entry.js +12 -8
- package/dist/cjs/ui-top-bar.cjs.entry.js +1 -1
- package/dist/cjs/ui-tree-item.cjs.entry.js +54 -617
- package/dist/cjs/ui-tree.cjs.entry.js +123 -11
- package/dist/collection/collection-manifest.json +4 -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.js +1 -1
- 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 +47 -0
- package/dist/collection/components/ui-chip/ui-chip.js +67 -0
- package/dist/collection/components/ui-combobox/ui-combobox.js +49 -4
- 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-editable/ui-editable.css +2 -0
- package/dist/collection/components/ui-editable/ui-editable.js +196 -0
- 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.js +59 -4
- package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
- package/dist/collection/components/ui-input/ui-input.js +1 -1
- 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-multi-combobox/ui-multi-combobox.css +29 -0
- package/dist/collection/components/ui-multi-combobox/ui-multi-combobox.js +503 -0
- 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 +24 -11
- 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.js +1 -1
- 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.js +1 -1
- 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 +14 -11
- 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 +122 -10
- package/dist/collection/components/ui-tree-item/ui-tree-item.js +61 -44
- package/dist/collection/field/editable.js +1 -0
- package/dist/collection/field/multi-combobox.js +1 -0
- package/dist/collection/icons.js +6 -1
- package/dist/collection/utils/controlled-state.js +4 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-B9CzOHvE.js +1 -0
- package/dist/components/p-BMgIcOh-.js +1 -0
- package/dist/components/p-BVteuP_d.js +1 -0
- package/dist/components/p-BnGhGgTH.js +1 -0
- package/dist/components/p-C6p-ygxq.js +1 -0
- package/dist/components/p-CoFximGM.js +13 -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.js +1 -1
- 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-editable.d.ts +11 -0
- package/dist/components/ui-editable.js +1 -0
- 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-multi-combobox.d.ts +11 -0
- package/dist/components/ui-multi-combobox.js +1 -0
- 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/loader.js +1 -1
- package/dist/esm/looma.js +1 -1
- package/dist/esm/ui-affordance-scope.entry.js +1 -1
- package/dist/esm/ui-avatar-group.entry.js +9 -17
- package/dist/esm/ui-avatar.entry.js +2 -2
- package/dist/esm/ui-badge.entry.js +2 -2
- package/dist/esm/ui-button.entry.js +1 -1
- package/dist/esm/ui-callout.entry.js +25 -0
- package/dist/esm/ui-checkbox.entry.js +13 -7
- package/dist/esm/{ui-combobox.entry.js → ui-chip_2.entry.js} +30 -6
- package/dist/esm/ui-context-menu.entry.js +1 -1
- package/dist/esm/ui-dialog.entry.js +44 -8
- package/dist/esm/ui-disclosure.entry.js +9 -6
- package/dist/esm/ui-editable.entry.js +98 -0
- package/dist/esm/ui-floating-action-button.entry.js +1 -1
- package/dist/esm/ui-form-field.entry.js +59 -4
- package/dist/esm/ui-icon-button.entry.js +1 -1
- package/dist/esm/ui-input.entry.js +1 -1
- package/dist/esm/ui-menu-item.entry.js +2 -2
- package/dist/esm/ui-menu.entry.js +14 -9
- package/dist/esm/ui-multi-combobox.entry.js +156 -0
- package/dist/esm/ui-popover.entry.js +10 -7
- package/dist/esm/ui-radio-group.entry.js +1 -1
- package/dist/esm/ui-radio.entry.js +16 -7
- package/dist/esm/ui-search-result-row.entry.js +1 -1
- package/dist/esm/ui-search-shell.entry.js +1 -1
- package/dist/esm/ui-select.entry.js +1 -1
- package/dist/esm/ui-switch.entry.js +19 -10
- package/dist/esm/ui-tabs.entry.js +10 -9
- package/dist/esm/ui-textarea.entry.js +1 -1
- package/dist/esm/ui-toast-region.entry.js +30 -19
- package/dist/esm/ui-tooltip.entry.js +12 -8
- package/dist/esm/ui-top-bar.entry.js +1 -1
- package/dist/esm/ui-tree-item.entry.js +54 -617
- package/dist/esm/ui-tree.entry.js +123 -11
- package/dist/index.cjs +1552 -894
- package/dist/index.d.cts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +12 -2
- package/dist/looma/looma.esm.js +1 -1
- package/dist/looma/p-08f80207.entry.js +1 -0
- package/dist/looma/{p-ed368426.entry.js → p-0e1741cb.entry.js} +1 -1
- package/dist/looma/p-0ef4bf13.entry.js +1 -0
- package/dist/looma/{p-7e0bb7f6.entry.js → p-166f8593.entry.js} +1 -1
- package/dist/looma/p-262a542c.entry.js +1 -0
- package/dist/looma/{p-13347631.entry.js → p-26d357ae.entry.js} +1 -1
- package/dist/looma/p-30f01909.entry.js +1 -0
- package/dist/looma/p-393e3e02.entry.js +1 -0
- package/dist/looma/p-3a44b9f9.entry.js +1 -0
- package/dist/looma/p-558d4f5b.entry.js +1 -0
- package/dist/looma/{p-5a87b59d.entry.js → p-5780cefa.entry.js} +1 -1
- package/dist/looma/p-5a7261e1.entry.js +1 -0
- package/dist/looma/p-5fdcee1d.entry.js +1 -0
- package/dist/looma/{p-add36e74.entry.js → p-72338f53.entry.js} +1 -1
- package/dist/looma/p-7319c147.entry.js +1 -0
- package/dist/looma/p-78b7e466.entry.js +1 -0
- package/dist/looma/{p-a90d2821.entry.js → p-7ab661ec.entry.js} +1 -1
- package/dist/looma/p-7eb04f09.entry.js +1 -0
- package/dist/looma/{p-69a5557b.entry.js → p-81c533f5.entry.js} +1 -1
- package/dist/looma/p-87f501cf.entry.js +1 -0
- package/dist/looma/p-89e71bbb.entry.js +1 -0
- package/dist/looma/{p-8b8840b8.entry.js → p-92cd1841.entry.js} +1 -1
- package/dist/looma/{p-f0487ff3.entry.js → p-95eb3b58.entry.js} +1 -1
- package/dist/looma/p-96ec4d7a.entry.js +1 -0
- package/dist/looma/p-9d2662ca.entry.js +1 -0
- package/dist/looma/p-BnGhGgTH.js +1 -0
- package/dist/looma/p-CoFximGM.js +13 -0
- package/dist/looma/p-add67e4c.entry.js +1 -0
- package/dist/looma/p-b6c776fb.entry.js +1 -0
- package/dist/looma/p-bcb1b47b.entry.js +1 -0
- package/dist/looma/p-d56571a2.entry.js +1 -0
- package/dist/looma/{p-582973b5.entry.js → p-d62da01d.entry.js} +1 -1
- package/dist/looma/{p-f74e5546.entry.js → p-dbcb479c.entry.js} +1 -1
- package/dist/looma/p-e14024bf.entry.js +1 -0
- package/dist/looma/{p-5da09f47.entry.js → p-fc180770.entry.js} +1 -1
- 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 +8 -0
- package/dist/types/components/ui-combobox/ui-combobox.d.ts +4 -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-editable/ui-editable.d.ts +24 -0
- package/dist/types/components/ui-form-field/ui-form-field.d.ts +8 -0
- package/dist/types/components/ui-menu/ui-menu.d.ts +2 -1
- package/dist/types/components/ui-multi-combobox/ui-multi-combobox.d.ts +47 -0
- 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-switch/ui-switch.d.ts +2 -1
- package/dist/types/components/ui-tabs/ui-tabs.d.ts +2 -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 +2 -1
- package/dist/types/components/ui-tree/ui-tree.d.ts +12 -0
- package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +11 -7
- package/dist/types/components.d.ts +343 -46
- package/dist/types/field/editable.d.ts +5 -0
- package/dist/types/field/multi-combobox.d.ts +11 -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-VO4C2MZX.js → ui-affordance-scope.entry-VSSP52ZP.js} +2 -2
- package/dist/ui-avatar-group.entry-JMCLL6FW.js +51 -0
- package/dist/{ui-avatar.entry-T6FU6ZYM.js → ui-avatar.entry-X2YQ3QPG.js} +3 -3
- package/dist/ui-badge.entry-OJ6FJJKL.js +22 -0
- package/dist/{ui-button.entry-7UXMUGHN.js → ui-button.entry-ZN6JLND7.js} +2 -2
- package/dist/ui-callout.entry-7K6NXQ7U.js +32 -0
- package/dist/{ui-checkbox.entry-DMZJB3RE.js → ui-checkbox.entry-GUYRVU6O.js} +17 -8
- package/dist/{ui-combobox.entry-ZCTPXEES.js → ui-chip_2.entry-M2DOTIGY.js} +32 -7
- package/dist/{ui-context-menu.entry-2WMCBGCP.js → ui-context-menu.entry-BM7FHOUJ.js} +5 -5
- package/dist/{ui-dialog.entry-WO23XOSW.js → ui-dialog.entry-AZAD37CG.js} +50 -12
- package/dist/{ui-disclosure.entry-USX7OUEW.js → ui-disclosure.entry-XDPGKMBK.js} +13 -7
- package/dist/ui-editable.entry-S3TE6KFT.js +110 -0
- package/dist/{ui-floating-action-button.entry-MXDIN7MV.js → ui-floating-action-button.entry-U7HGA3CS.js} +2 -2
- package/dist/ui-form-field.entry-C2ZSP3TM.js +120 -0
- package/dist/{ui-icon-button.entry-MJUNXHBU.js → ui-icon-button.entry-P6H2LY7D.js} +2 -2
- package/dist/{ui-input.entry-AWG63YIG.js → ui-input.entry-GTNQJCQ2.js} +2 -2
- package/dist/ui-menu-item.entry-2HWOGUO5.js +22 -0
- package/dist/{ui-menu.entry-IT3GW5TL.js → ui-menu.entry-NZ7ER54K.js} +22 -14
- package/dist/ui-multi-combobox.entry-DZ5LLSVQ.js +167 -0
- package/dist/{ui-popover.entry-ZQQB4N6E.js → ui-popover.entry-ZOEQMUWG.js} +17 -11
- package/dist/{ui-radio-group.entry-V7PCTS7I.js → ui-radio-group.entry-QCQ46EK5.js} +2 -2
- package/dist/{ui-radio.entry-JYH6TQBI.js → ui-radio.entry-QAATWUYT.js} +20 -8
- package/dist/{ui-search-result-row.entry-JBNYXXUN.js → ui-search-result-row.entry-2I3DH2OT.js} +2 -2
- package/dist/{ui-search-shell.entry-TEAWE76O.js → ui-search-shell.entry-7RS55ORF.js} +2 -2
- package/dist/{ui-select.entry-F3A6TE2U.js → ui-select.entry-6O4KD4G7.js} +2 -2
- package/dist/{ui-switch.entry-MJIICMP2.js → ui-switch.entry-DY5PSHCQ.js} +23 -11
- package/dist/{ui-tabs.entry-6REFIUHV.js → ui-tabs.entry-6X56UOUE.js} +14 -10
- package/dist/{ui-textarea.entry-OJTXCED7.js → ui-textarea.entry-RDYP6O77.js} +2 -2
- package/dist/{ui-toast-region.entry-NOFXLKPS.js → ui-toast-region.entry-EBY42KS5.js} +32 -23
- package/dist/{ui-tooltip.entry-COWTWVHX.js → ui-tooltip.entry-PLXMPOKV.js} +19 -12
- package/dist/{ui-top-bar.entry-PIAWXJNV.js → ui-top-bar.entry-QKE2DLVD.js} +2 -2
- package/dist/ui-tree-item.entry-TC6YWIC6.js +145 -0
- package/dist/{ui-tree.entry-XYI3ZFAZ.js → ui-tree.entry-UL6UHCUT.js} +114 -12
- 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 +1 -1
- package/styles.css +10 -0
- package/tokens.css +3 -0
- package/vue/{chunk-JLW23USW.js → chunk-GXQY27K2.js} +112 -17
- package/vue/editor/index.d.ts +5 -15
- package/vue/editor/index.js +1 -1
- package/vue/index.d.ts +442 -116
- package/vue/index.js +9 -1
- package/dist/components/p-CaietZcq.js +0 -1
- package/dist/components/p-DHd18bK7.js +0 -1
- package/dist/looma/p-14c081cf.entry.js +0 -1
- package/dist/looma/p-25366205.entry.js +0 -1
- package/dist/looma/p-2e3aa869.entry.js +0 -1
- package/dist/looma/p-40fe7fee.entry.js +0 -1
- package/dist/looma/p-446cda76.entry.js +0 -1
- package/dist/looma/p-4fc1b005.entry.js +0 -13
- package/dist/looma/p-6a8a4736.entry.js +0 -1
- package/dist/looma/p-6bf4038b.entry.js +0 -1
- package/dist/looma/p-8204fee6.entry.js +0 -1
- package/dist/looma/p-8238e0dc.entry.js +0 -1
- package/dist/looma/p-99d88efb.entry.js +0 -1
- package/dist/looma/p-a27669b1.entry.js +0 -1
- package/dist/looma/p-a6ee76b7.entry.js +0 -1
- package/dist/looma/p-b6398a6b.entry.js +0 -1
- package/dist/looma/p-d50faaff.entry.js +0 -1
- package/dist/looma/p-d77278ce.entry.js +0 -1
- package/dist/looma/p-d9ec13b7.entry.js +0 -1
- package/dist/looma/p-ecf8005f.entry.js +0 -1
- package/dist/ui-avatar-group.entry-TAXJRIIU.js +0 -59
- package/dist/ui-badge.entry-MZFYNBMJ.js +0 -22
- package/dist/ui-form-field.entry-7ZCMEHPY.js +0 -67
- package/dist/ui-menu-item.entry-HFTWG62N.js +0 -22
- package/dist/ui-tree-item.entry-BSEWNL2O.js +0 -389
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { eventToTrigger } from "../../utils/events";
|
|
3
3
|
import { dispatchDetail } from "../../utils/events";
|
|
4
|
+
import { controlledOrDefault, isControlled } from "../../utils/controlled-state";
|
|
4
5
|
export class UIRadio {
|
|
5
6
|
host;
|
|
6
|
-
checked
|
|
7
|
+
/** Controlled checked state. Omit it to use defaultChecked and local interaction state. */
|
|
8
|
+
checked;
|
|
7
9
|
defaultChecked = false;
|
|
8
10
|
disabled = false;
|
|
9
11
|
name = '';
|
|
10
12
|
required = false;
|
|
11
13
|
value = 'on';
|
|
14
|
+
internalChecked = false;
|
|
12
15
|
slotRef;
|
|
16
|
+
syncFromProp() {
|
|
17
|
+
if (isControlled(this.checked))
|
|
18
|
+
this.internalChecked = this.checked;
|
|
19
|
+
}
|
|
13
20
|
syncToInput() {
|
|
14
21
|
const input = this.getInput();
|
|
15
22
|
if (!input)
|
|
16
23
|
return;
|
|
17
24
|
this.host.toggleAttribute('data-disabled', this.disabled);
|
|
18
|
-
input.checked = this.
|
|
25
|
+
input.checked = this.internalChecked;
|
|
19
26
|
input.disabled = this.disabled;
|
|
20
27
|
input.name = this.name;
|
|
21
28
|
input.required = this.required;
|
|
22
29
|
input.value = this.value;
|
|
23
30
|
}
|
|
24
31
|
componentDidLoad() {
|
|
25
|
-
|
|
26
|
-
this.checked = true;
|
|
27
|
-
}
|
|
32
|
+
this.internalChecked = controlledOrDefault(this.checked, this.defaultChecked);
|
|
28
33
|
this.slotRef?.addEventListener('slotchange', () => this.syncToInput());
|
|
29
34
|
this.syncToInput();
|
|
30
35
|
const input = this.getInput();
|
|
@@ -46,6 +51,10 @@ export class UIRadio {
|
|
|
46
51
|
const input = e.target;
|
|
47
52
|
if (!input || !input.checked)
|
|
48
53
|
return;
|
|
54
|
+
if (!isControlled(this.checked))
|
|
55
|
+
this.internalChecked = true;
|
|
56
|
+
else
|
|
57
|
+
this.syncToInput();
|
|
49
58
|
dispatchDetail(this.host, 'change', {
|
|
50
59
|
checked: true,
|
|
51
60
|
value: this.value,
|
|
@@ -53,7 +62,7 @@ export class UIRadio {
|
|
|
53
62
|
});
|
|
54
63
|
};
|
|
55
64
|
render() {
|
|
56
|
-
return (h(Host, { key: '
|
|
65
|
+
return (h(Host, { key: 'f4700b43790accd29a6bcc55fcc862072e29c335', role: "radio", "aria-checked": String(this.internalChecked), "aria-disabled": String(this.disabled), "data-disabled": this.disabled ? '' : undefined }, h("slot", { key: 'ed32c35f8f68c662a8b95e58b74c8c76c959ea49', ref: (el) => (this.slotRef = el) })));
|
|
57
66
|
}
|
|
58
67
|
static get is() { return "ui-radio"; }
|
|
59
68
|
static get encapsulation() { return "shadow"; }
|
|
@@ -78,16 +87,15 @@ export class UIRadio {
|
|
|
78
87
|
"references": {}
|
|
79
88
|
},
|
|
80
89
|
"required": false,
|
|
81
|
-
"optional":
|
|
90
|
+
"optional": true,
|
|
82
91
|
"docs": {
|
|
83
92
|
"tags": [],
|
|
84
|
-
"text": ""
|
|
93
|
+
"text": "Controlled checked state. Omit it to use defaultChecked and local interaction state."
|
|
85
94
|
},
|
|
86
95
|
"getter": false,
|
|
87
96
|
"setter": false,
|
|
88
97
|
"reflect": false,
|
|
89
|
-
"attribute": "checked"
|
|
90
|
-
"defaultValue": "false"
|
|
98
|
+
"attribute": "checked"
|
|
91
99
|
},
|
|
92
100
|
"defaultChecked": {
|
|
93
101
|
"type": "boolean",
|
|
@@ -191,11 +199,16 @@ export class UIRadio {
|
|
|
191
199
|
}
|
|
192
200
|
};
|
|
193
201
|
}
|
|
202
|
+
static get states() {
|
|
203
|
+
return {
|
|
204
|
+
"internalChecked": {}
|
|
205
|
+
};
|
|
206
|
+
}
|
|
194
207
|
static get elementRef() { return "host"; }
|
|
195
208
|
static get watchers() {
|
|
196
209
|
return [{
|
|
197
210
|
"propName": "checked",
|
|
198
|
-
"methodName": "
|
|
211
|
+
"methodName": "syncFromProp"
|
|
199
212
|
}, {
|
|
200
213
|
"propName": "disabled",
|
|
201
214
|
"methodName": "syncToInput"
|
|
@@ -102,7 +102,7 @@ export class UIRadioGroup {
|
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
render() {
|
|
105
|
-
return (h(Host, { key: '
|
|
105
|
+
return (h(Host, { key: '1882ad7c092c6a138eab2a52c19beb9a950a8d5a', role: "radiogroup", "aria-orientation": this.orientation, "data-orientation": this.orientation, "data-disabled": this.disabled ? '' : undefined }, h("slot", { key: 'd5abade3d23963410cfbac17e80aa16dd21ccc6e' })));
|
|
106
106
|
}
|
|
107
107
|
static get is() { return "ui-radio-group"; }
|
|
108
108
|
static get encapsulation() { return "shadow"; }
|
|
@@ -31,7 +31,7 @@ export class UISearchResultRow {
|
|
|
31
31
|
this.hasTrailing = slotHasContent(this.trailingSlot);
|
|
32
32
|
};
|
|
33
33
|
render() {
|
|
34
|
-
return (h(Host, { key: '
|
|
34
|
+
return (h(Host, { key: 'eeda041dbcf8841cd53be9c532df208eb3be3d3b' }, h("button", { key: '71d3db6d2eca4f8d7796429f68ef73bf2c7b62f7', class: "search-result-row", type: "button", disabled: this.disabled, part: "button" }, h("span", { key: 'f2260cab9f654e7f5e96a5e7e2a1cbbb5a55fde3', class: "search-result-row__leading", part: "leading", hidden: !this.hasLeading }, h("slot", { key: '824fffc19c2b5712dae0c000f12cc36a0043a370', name: "leading", ref: (el) => (this.leadingSlot = el), onSlotchange: this.syncSlots })), h("span", { key: '4e3728ea7d363f256f1b3283df6eb984cf3f570f', class: "search-result-row__content", part: "content" }, h("span", { key: '95009b1ce569fb4251df62334a5dd88f1de561af', class: "search-result-row__title", part: "title" }, h("slot", { key: '132beecf36471ae0db68d686829428225699c534', name: "title" })), h("span", { key: '0ad7c8d52aa40ccf62667d3ecca4d48b49917a9a', class: "search-result-row__meta", part: "meta", hidden: !this.hasMeta }, h("slot", { key: '4b97129504571a676839287bd87e68d803f8bc99', name: "meta", ref: (el) => (this.metaSlot = el), onSlotchange: this.syncSlots })), h("span", { key: 'e6c73e653fb7dc213866a15870281f3f6d95a86b', class: "search-result-row__excerpt", part: "excerpt", hidden: !this.hasExcerpt }, h("slot", { key: '49deae8194485304380b8b4b3d4fe96cd6623f4d', name: "excerpt", ref: (el) => (this.excerptSlot = el), onSlotchange: this.syncSlots }))), h("span", { key: 'c7c6f0b57668644a28d3c4c981b4db79a0e3c42a', class: "search-result-row__trailing", part: "trailing", hidden: !this.hasTrailing }, h("slot", { key: 'e6cbceeb41d23c9b7514f53663438069499d1a4d', name: "trailing", ref: (el) => (this.trailingSlot = el), onSlotchange: this.syncSlots })))));
|
|
35
35
|
}
|
|
36
36
|
static get is() { return "ui-search-result-row"; }
|
|
37
37
|
static get encapsulation() { return "shadow"; }
|
|
@@ -23,7 +23,7 @@ export class UISearchShell {
|
|
|
23
23
|
this.hasFooter = slotHasContent(this.footerSlot);
|
|
24
24
|
};
|
|
25
25
|
render() {
|
|
26
|
-
return (h("div", { key: '
|
|
26
|
+
return (h("div", { key: 'ae5baf1fae88f3c0ff8c98e68e1c31d7f19d7b6a', class: "search-shell", part: "base" }, h("slot", { key: '192d10867902bc4618762ab3ce1ca8a44229ec11', name: "backdrop" }), h("div", { key: '72bafd3ba7aadebcb011fb27f56793a9079bb2e1', class: "search-shell__panel", part: "panel" }, h("div", { key: 'c2d46c9099699cc1c2f357cb51d11ab0e6cf6c69', class: "search-shell__search", part: "search" }, h("slot", { key: '21f4ed690247fa794bd9322c75cee1721926087a', name: "search" })), h("div", { key: '84baba674456aa2a5878d5858d0e6531251440ce', class: "search-shell__status", part: "status", hidden: !this.hasStatus }, h("slot", { key: '6e7b6533a29231ebbcd41529d8120649ca4a1dd1', name: "status", ref: (el) => (this.statusSlot = el), onSlotchange: this.syncSlots })), h("div", { key: '710d51d450132ad0f528b2eb2cd6f0312dbced2f', class: "search-shell__body", part: "body" }, h("slot", { key: '2c380ff4ad33ead6ca8c2611ebc024f125f0da48', name: "body" })), h("div", { key: '6923984a31c7bc23bae3ecee08d7acad14703a02', class: "search-shell__footer", part: "footer", hidden: !this.hasFooter }, h("slot", { key: '57c2eab7a3f46558ada8d1aa70d64f434bb8cdd6', name: "footer", ref: (el) => (this.footerSlot = el), onSlotchange: this.syncSlots })))));
|
|
27
27
|
}
|
|
28
28
|
static get is() { return "ui-search-shell"; }
|
|
29
29
|
static get encapsulation() { return "shadow"; }
|
|
@@ -72,7 +72,7 @@ export class UISelect {
|
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
74
|
render() {
|
|
75
|
-
return (h(Host, { key: '
|
|
75
|
+
return (h(Host, { key: '74cbe4a76a23af415c202c61951ad513b0ed6cb8', "data-invalid": this.invalid ? '' : undefined }, h("slot", { key: 'e86eb0cfb0d379cb3f8b2ea5ce3c69639d0cdda4', ref: (el) => (this.slotRef = el) })));
|
|
76
76
|
}
|
|
77
77
|
static get is() { return "ui-select"; }
|
|
78
78
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { dispatchDetail } from "../../utils/events";
|
|
3
|
+
import { controlledOrDefault, isControlled } from "../../utils/controlled-state";
|
|
3
4
|
export class UISwitch {
|
|
4
5
|
host;
|
|
5
|
-
checked
|
|
6
|
+
/** Controlled checked state. Omit it to use defaultChecked and local interaction state. */
|
|
7
|
+
checked;
|
|
6
8
|
defaultChecked = false;
|
|
7
9
|
disabled = false;
|
|
8
10
|
required = false;
|
|
9
11
|
value = 'on';
|
|
10
12
|
internalChecked = false;
|
|
11
13
|
syncFromProp() {
|
|
12
|
-
|
|
14
|
+
if (isControlled(this.checked))
|
|
15
|
+
this.internalChecked = this.checked;
|
|
13
16
|
}
|
|
14
17
|
componentDidLoad() {
|
|
15
|
-
this.
|
|
16
|
-
this.internalChecked = this.internalChecked || this.defaultChecked;
|
|
18
|
+
this.internalChecked = controlledOrDefault(this.checked, this.defaultChecked);
|
|
17
19
|
}
|
|
18
20
|
toggle = (trigger) => {
|
|
19
21
|
if (this.disabled)
|
|
20
22
|
return;
|
|
21
|
-
|
|
23
|
+
const checked = !this.internalChecked;
|
|
24
|
+
if (!isControlled(this.checked))
|
|
25
|
+
this.internalChecked = checked;
|
|
22
26
|
dispatchDetail(this.host, 'change', {
|
|
23
|
-
checked
|
|
27
|
+
checked,
|
|
24
28
|
value: this.value,
|
|
25
29
|
trigger,
|
|
26
30
|
});
|
|
@@ -37,14 +41,19 @@ export class UISwitch {
|
|
|
37
41
|
this.toggle('pointer');
|
|
38
42
|
};
|
|
39
43
|
render() {
|
|
40
|
-
return (h(Host, { key: '
|
|
41
|
-
|
|
44
|
+
return (h(Host, { key: 'a37ded5259d71a57308cba6dd158ae4ae81e4e8b', role: "switch", "aria-checked": String(this.internalChecked), "aria-disabled": String(this.disabled), "data-disabled": this.disabled ? '' : undefined, tabIndex: this.disabled ? -1 : 0, onKeyDown: this.onKeydown, onClick: this.onClick }, h("input", { key: '882f81f39d752430f1de1554a5d83176416f4617', type: "checkbox", checked: this.internalChecked, disabled: this.disabled, required: this.required, value: this.value, "aria-hidden": "true", tabIndex: -1, onChange: (e) => {
|
|
45
|
+
const input = e.target;
|
|
46
|
+
const checked = input.checked;
|
|
47
|
+
if (!isControlled(this.checked))
|
|
48
|
+
this.internalChecked = checked;
|
|
42
49
|
dispatchDetail(this.host, 'change', {
|
|
43
|
-
checked
|
|
50
|
+
checked,
|
|
44
51
|
value: this.value,
|
|
45
52
|
trigger: 'pointer',
|
|
46
53
|
});
|
|
47
|
-
|
|
54
|
+
if (isControlled(this.checked))
|
|
55
|
+
input.checked = this.internalChecked;
|
|
56
|
+
} }), h("slot", { key: 'b3b2b5afae622d1ae79cadd84f60c6b6c2df55a4' })));
|
|
48
57
|
}
|
|
49
58
|
static get is() { return "ui-switch"; }
|
|
50
59
|
static get encapsulation() { return "shadow"; }
|
|
@@ -69,16 +78,15 @@ export class UISwitch {
|
|
|
69
78
|
"references": {}
|
|
70
79
|
},
|
|
71
80
|
"required": false,
|
|
72
|
-
"optional":
|
|
81
|
+
"optional": true,
|
|
73
82
|
"docs": {
|
|
74
83
|
"tags": [],
|
|
75
|
-
"text": ""
|
|
84
|
+
"text": "Controlled checked state. Omit it to use defaultChecked and local interaction state."
|
|
76
85
|
},
|
|
77
86
|
"getter": false,
|
|
78
87
|
"setter": false,
|
|
79
88
|
"reflect": false,
|
|
80
|
-
"attribute": "checked"
|
|
81
|
-
"defaultValue": "false"
|
|
89
|
+
"attribute": "checked"
|
|
82
90
|
},
|
|
83
91
|
"defaultChecked": {
|
|
84
92
|
"type": "boolean",
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { eventToTrigger } from "../../utils/events";
|
|
3
3
|
import { dispatchDetail } from "../../utils/events";
|
|
4
|
+
import { controlledOrDefault, isControlled } from "../../utils/controlled-state";
|
|
4
5
|
export class UITabs {
|
|
5
6
|
host;
|
|
6
|
-
value
|
|
7
|
+
/** Controlled selected tab value. Omit it to use defaultValue and local interaction state. */
|
|
8
|
+
value;
|
|
7
9
|
defaultValue = '';
|
|
8
10
|
orientation = 'horizontal';
|
|
9
11
|
internalValue = '';
|
|
10
12
|
syncFromProp() {
|
|
11
|
-
|
|
13
|
+
if (isControlled(this.value))
|
|
14
|
+
this.internalValue = this.value;
|
|
12
15
|
}
|
|
13
16
|
syncState() {
|
|
14
17
|
const tabs = this.getTabs();
|
|
@@ -29,11 +32,8 @@ export class UITabs {
|
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
34
|
componentDidLoad() {
|
|
32
|
-
this.
|
|
33
|
-
if (!this.
|
|
34
|
-
this.internalValue = this.defaultValue;
|
|
35
|
-
}
|
|
36
|
-
if (!this.internalValue) {
|
|
35
|
+
this.internalValue = controlledOrDefault(this.value, this.defaultValue);
|
|
36
|
+
if (!isControlled(this.value) && !this.internalValue) {
|
|
37
37
|
const tabs = this.getTabs();
|
|
38
38
|
if (tabs.length > 0) {
|
|
39
39
|
this.internalValue = tabs[0]?.id ?? tabs[0]?.getAttribute('aria-controls') ?? '';
|
|
@@ -58,7 +58,8 @@ export class UITabs {
|
|
|
58
58
|
if (!newValue)
|
|
59
59
|
return;
|
|
60
60
|
const prev = this.internalValue;
|
|
61
|
-
this.
|
|
61
|
+
if (!isControlled(this.value))
|
|
62
|
+
this.internalValue = newValue;
|
|
62
63
|
this.syncState();
|
|
63
64
|
dispatchDetail(this.host, 'select', { value: newValue, previousValue: prev || undefined, trigger });
|
|
64
65
|
}
|
|
@@ -91,7 +92,7 @@ export class UITabs {
|
|
|
91
92
|
}
|
|
92
93
|
};
|
|
93
94
|
render() {
|
|
94
|
-
return (h(Host, { key: '
|
|
95
|
+
return (h(Host, { key: '19207153c7b7a6ea5f5ffb50439e99af70984b44', orientation: this.orientation, "data-orientation": this.orientation }, h("slot", { key: '5045cd040eeccd028c00328206d47f7d17b622de' })));
|
|
95
96
|
}
|
|
96
97
|
static get is() { return "ui-tabs"; }
|
|
97
98
|
static get encapsulation() { return "shadow"; }
|
|
@@ -116,16 +117,15 @@ export class UITabs {
|
|
|
116
117
|
"references": {}
|
|
117
118
|
},
|
|
118
119
|
"required": false,
|
|
119
|
-
"optional":
|
|
120
|
+
"optional": true,
|
|
120
121
|
"docs": {
|
|
121
122
|
"tags": [],
|
|
122
|
-
"text": ""
|
|
123
|
+
"text": "Controlled selected tab value. Omit it to use defaultValue and local interaction state."
|
|
123
124
|
},
|
|
124
125
|
"getter": false,
|
|
125
126
|
"setter": false,
|
|
126
127
|
"reflect": false,
|
|
127
|
-
"attribute": "value"
|
|
128
|
-
"defaultValue": "''"
|
|
128
|
+
"attribute": "value"
|
|
129
129
|
},
|
|
130
130
|
"defaultValue": {
|
|
131
131
|
"type": "string",
|
|
@@ -71,7 +71,7 @@ export class UITextarea {
|
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
73
|
render() {
|
|
74
|
-
return (h(Host, { key: '
|
|
74
|
+
return (h(Host, { key: '020adfed4a177ef5d07852ff2e6ffb66b6f80742', "data-invalid": this.invalid ? '' : undefined }, h("slot", { key: '2e9bd0e071e24fcf248eadf38f16484321359503', ref: (el) => (this.slotRef = el) })));
|
|
75
75
|
}
|
|
76
76
|
static get is() { return "ui-textarea"; }
|
|
77
77
|
static get encapsulation() { return "shadow"; }
|
|
@@ -5,10 +5,12 @@ import { createViewportSurface } from "../../overlay/positioning";
|
|
|
5
5
|
export class UIToastRegion {
|
|
6
6
|
host;
|
|
7
7
|
open = true;
|
|
8
|
-
internalOpen =
|
|
8
|
+
internalOpen = false;
|
|
9
9
|
surface = null;
|
|
10
|
+
contentObserver = null;
|
|
11
|
+
pendingDismiss = null;
|
|
10
12
|
syncFromProp() {
|
|
11
|
-
this.
|
|
13
|
+
this.syncContents();
|
|
12
14
|
}
|
|
13
15
|
syncSurface() {
|
|
14
16
|
if (this.internalOpen)
|
|
@@ -18,22 +20,39 @@ export class UIToastRegion {
|
|
|
18
20
|
}
|
|
19
21
|
componentDidLoad() {
|
|
20
22
|
this.surface = createViewportSurface(this.host);
|
|
21
|
-
this.
|
|
23
|
+
this.contentObserver = new MutationObserver(this.syncContents);
|
|
24
|
+
this.contentObserver.observe(this.host, { childList: true, subtree: true });
|
|
25
|
+
this.syncContents();
|
|
22
26
|
this.syncSurface();
|
|
23
27
|
this.host.addEventListener('click', this.onClick);
|
|
24
28
|
}
|
|
25
29
|
disconnectedCallback() {
|
|
26
30
|
this.host.removeEventListener('click', this.onClick);
|
|
31
|
+
this.contentObserver?.disconnect();
|
|
32
|
+
this.contentObserver = null;
|
|
27
33
|
this.surface?.destroy();
|
|
28
34
|
this.surface = null;
|
|
29
35
|
}
|
|
30
36
|
getToasts() {
|
|
31
37
|
return Array.from(this.host.querySelectorAll('[data-ui-toast]'));
|
|
32
38
|
}
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
syncContents = () => {
|
|
40
|
+
const nextOpen = this.open && this.getToasts().length > 0;
|
|
41
|
+
const wasOpen = this.internalOpen;
|
|
42
|
+
const completedDismiss = this.pendingDismiss && !this.host.contains(this.pendingDismiss.toast)
|
|
43
|
+
? this.pendingDismiss
|
|
44
|
+
: null;
|
|
45
|
+
this.internalOpen = nextOpen;
|
|
46
|
+
if (wasOpen && !nextOpen && completedDismiss) {
|
|
47
|
+
dispatchDetail(this.host, 'close', {
|
|
48
|
+
open: false,
|
|
49
|
+
reason: 'action',
|
|
50
|
+
trigger: completedDismiss.trigger,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (completedDismiss || !this.open)
|
|
54
|
+
this.pendingDismiss = null;
|
|
55
|
+
};
|
|
37
56
|
onClick = (e) => {
|
|
38
57
|
const dismissBtn = e.target.closest?.('[data-ui-toast-dismiss]');
|
|
39
58
|
if (!dismissBtn)
|
|
@@ -42,24 +61,16 @@ export class UIToastRegion {
|
|
|
42
61
|
if (!toast)
|
|
43
62
|
return;
|
|
44
63
|
const id = toast.id ?? '';
|
|
45
|
-
|
|
46
|
-
toast
|
|
64
|
+
const trigger = eventToTrigger(e);
|
|
65
|
+
this.pendingDismiss = { toast: toast, trigger };
|
|
47
66
|
dispatchDetail(this.host, 'dismiss', {
|
|
48
67
|
id,
|
|
49
68
|
reason: 'action',
|
|
50
|
-
trigger
|
|
69
|
+
trigger,
|
|
51
70
|
});
|
|
52
|
-
this.updateOpenState();
|
|
53
|
-
if (this.getToasts().length === 0) {
|
|
54
|
-
dispatchDetail(this.host, 'close', {
|
|
55
|
-
open: false,
|
|
56
|
-
reason: 'action',
|
|
57
|
-
trigger: eventToTrigger(e),
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
71
|
};
|
|
61
72
|
render() {
|
|
62
|
-
return (h(Host, { key: '
|
|
73
|
+
return (h(Host, { key: '8a3546bcd59e12f21393ea55fa4d232d3907a34e', role: "region", "aria-label": "Notifications", "aria-live": "polite", "data-open": this.internalOpen ? '' : undefined }, h("slot", { key: 'a4a4525a1ca768d65ff36b3889a821b8dda8b6f7' })));
|
|
63
74
|
}
|
|
64
75
|
static get is() { return "ui-toast-region"; }
|
|
65
76
|
static get encapsulation() { return "shadow"; }
|
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
inset: auto;
|
|
4
4
|
margin: 0;
|
|
5
5
|
display: inline-block;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
font-size: var(--ui-font-size-sm);
|
|
12
|
-
box-shadow: var(--ui-shadow-md);
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
padding: 0;
|
|
8
|
+
border: 0;
|
|
9
|
+
border-radius: 0;
|
|
10
|
+
background: transparent;
|
|
13
11
|
opacity: 0;
|
|
14
12
|
transform: translateY(4px);
|
|
15
13
|
transition:
|
|
@@ -19,6 +17,17 @@
|
|
|
19
17
|
overlay var(--ui-motion-fast) allow-discrete;
|
|
20
18
|
}
|
|
21
19
|
|
|
20
|
+
.tooltip__surface {
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
border: 1px solid var(--ui-border-default);
|
|
23
|
+
border-radius: var(--ui-radius-2);
|
|
24
|
+
background: var(--ui-surface-elevated);
|
|
25
|
+
color: var(--ui-text-primary);
|
|
26
|
+
padding: var(--ui-space-2) var(--ui-space-3);
|
|
27
|
+
font-size: var(--ui-font-size-sm);
|
|
28
|
+
box-shadow: var(--ui-shadow-md);
|
|
29
|
+
}
|
|
30
|
+
|
|
22
31
|
:host(:popover-open) { opacity: 1; transform: translateY(0); }
|
|
23
32
|
|
|
24
33
|
@starting-style {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { openOverlay, closeOverlay } from "../../overlay/manager";
|
|
3
3
|
import { dispatchDetail } from "../../utils/events";
|
|
4
|
+
import { controlledOrDefault, isControlled } from "../../utils/controlled-state";
|
|
4
5
|
import { createAnchoredSurface, } from "../../overlay/positioning";
|
|
5
6
|
export class UITooltip {
|
|
6
7
|
host;
|
|
7
8
|
for = '';
|
|
8
|
-
open
|
|
9
|
+
/** Controlled open state. Omit it to use defaultOpen and local interaction state. */
|
|
10
|
+
open;
|
|
9
11
|
defaultOpen = false;
|
|
10
12
|
placement = 'top-start';
|
|
11
13
|
/** Pointer hover intent delay in milliseconds. Keyboard focus is immediate. */
|
|
@@ -26,7 +28,8 @@ export class UITooltip {
|
|
|
26
28
|
hideTimer = null;
|
|
27
29
|
syncFromProp() {
|
|
28
30
|
this.clearTimers();
|
|
29
|
-
|
|
31
|
+
if (isControlled(this.open))
|
|
32
|
+
this.internalOpen = this.open;
|
|
30
33
|
}
|
|
31
34
|
resetSurface() {
|
|
32
35
|
this.syncTrigger();
|
|
@@ -53,8 +56,7 @@ export class UITooltip {
|
|
|
53
56
|
componentDidLoad() {
|
|
54
57
|
if (!this.host.id)
|
|
55
58
|
this.host.id = this.overlayId;
|
|
56
|
-
this.
|
|
57
|
-
this.internalOpen = this.internalOpen || this.defaultOpen;
|
|
59
|
+
this.internalOpen = controlledOrDefault(this.open, this.defaultOpen);
|
|
58
60
|
this.syncTrigger();
|
|
59
61
|
this.setupSurface();
|
|
60
62
|
this.host.addEventListener('pointerenter', this.onSurfaceEnter);
|
|
@@ -139,7 +141,8 @@ export class UITooltip {
|
|
|
139
141
|
setInteractionOpen(nextOpen, trigger) {
|
|
140
142
|
if (this.internalOpen === nextOpen)
|
|
141
143
|
return;
|
|
142
|
-
this.
|
|
144
|
+
if (!isControlled(this.open))
|
|
145
|
+
this.internalOpen = nextOpen;
|
|
143
146
|
dispatchDetail(this.host, nextOpen ? 'open' : 'close', {
|
|
144
147
|
open: nextOpen,
|
|
145
148
|
reason: 'action',
|
|
@@ -196,7 +199,8 @@ export class UITooltip {
|
|
|
196
199
|
if (reason === 'escape' || (reason === 'light-dismiss' && this.toggleOnClick)) {
|
|
197
200
|
this.pinned = false;
|
|
198
201
|
this.clearTimers();
|
|
199
|
-
this.
|
|
202
|
+
if (!isControlled(this.open))
|
|
203
|
+
this.internalOpen = false;
|
|
200
204
|
dispatchDetail(this.host, 'close', {
|
|
201
205
|
open: false,
|
|
202
206
|
reason,
|
|
@@ -205,7 +209,7 @@ export class UITooltip {
|
|
|
205
209
|
}
|
|
206
210
|
}
|
|
207
211
|
render() {
|
|
208
|
-
return (h(Host, { key: '
|
|
212
|
+
return (h(Host, { key: '6c70f235889d6f1c425f0a51fcfc04e06a96dea4', role: "tooltip", hidden: !this.internalOpen, "data-open": this.internalOpen ? '' : undefined }, h("div", { key: '5c4f1d264e32d308f5b26af4e967e13369c4238a', class: "tooltip__surface" }, h("slot", { key: '52b5900d67ffa7590b0ff97511f99718d2e8c311' }))));
|
|
209
213
|
}
|
|
210
214
|
static get is() { return "ui-tooltip"; }
|
|
211
215
|
static get encapsulation() { return "shadow"; }
|
|
@@ -250,16 +254,15 @@ export class UITooltip {
|
|
|
250
254
|
"references": {}
|
|
251
255
|
},
|
|
252
256
|
"required": false,
|
|
253
|
-
"optional":
|
|
257
|
+
"optional": true,
|
|
254
258
|
"docs": {
|
|
255
259
|
"tags": [],
|
|
256
|
-
"text": ""
|
|
260
|
+
"text": "Controlled open state. Omit it to use defaultOpen and local interaction state."
|
|
257
261
|
},
|
|
258
262
|
"getter": false,
|
|
259
263
|
"setter": false,
|
|
260
264
|
"reflect": false,
|
|
261
|
-
"attribute": "open"
|
|
262
|
-
"defaultValue": "false"
|
|
265
|
+
"attribute": "open"
|
|
263
266
|
},
|
|
264
267
|
"defaultOpen": {
|
|
265
268
|
"type": "boolean",
|
|
@@ -27,7 +27,7 @@ export class UITopBar {
|
|
|
27
27
|
this.hasActions = slotHasContent(this.actionsSlot);
|
|
28
28
|
};
|
|
29
29
|
render() {
|
|
30
|
-
return (h(Host, { key: '
|
|
30
|
+
return (h(Host, { key: 'ef7cf644a8e8381d7d1f8d093bcfefcdc4620682' }, h("header", { key: '5055594a179d86efefd43529e070a582c51cb1d8', class: "top-bar", part: "base" }, h("div", { key: 'bd6ec069ae9d7820a6992250ba1aa997b4cc6754', class: "top-bar__leading", hidden: !this.hasLeading }, h("slot", { key: '3b9b1b73fb455ad720e1db46757555eb3713c0b8', name: "leading", ref: (el) => (this.leadingSlot = el), onSlotchange: this.syncSlots })), h("div", { key: 'e402cc0cb7ec4418460182f8f32cb161c6139221', class: "top-bar__title" }, h("slot", { key: 'fce0cfc11da269167853f591742b1369023864ae' })), h("div", { key: '6861bb04f399076378aa1fa9be24b35db277106a', class: "top-bar__search", hidden: !this.hasSearch }, h("slot", { key: '3857f37d53ec99b36a52cb7830e634afdee29d2e', name: "search", ref: (el) => (this.searchSlot = el), onSlotchange: this.syncSlots })), h("div", { key: '538f6297078b6d5aa85906e902066e8809f52540', class: "top-bar__actions", hidden: !this.hasActions }, h("slot", { key: '3c45ff59c4b48673e796c6e93842cb11fceb652f', name: "actions", ref: (el) => (this.actionsSlot = el), onSlotchange: this.syncSlots })))));
|
|
31
31
|
}
|
|
32
32
|
static get is() { return "ui-top-bar"; }
|
|
33
33
|
static get encapsulation() { return "shadow"; }
|