project_note
Clone
https://git.tahinli.com/Tahinli/project_note.git
0 watching0 forksRust3.6 MiBc49f5e7Tahinli1 month ago2 commits
| 1 | use ; |
| 2 | |
| 3 | /// Where a floating panel appears relative to the element it follows. |
| 4 | /// |
| 5 | /// The default is [`Bottom`](Self::Bottom). |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | /// Which edge or center of the anchor a floating panel lines up with. |
| 45 | /// |
| 46 | /// The default is [`Center`](Self::Center). |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | /// The element a floating panel follows. |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | /// Add these classes to the element that [`FloatingAnchor::Scope`] panels should follow. |
| 109 | /// |
| 110 | /// Place the panels inside this element. Each copy of the element positions its own |
| 111 | /// panels independently. |
| 112 | pub const FLOATING_SCOPE: StaticClass = |
| 113 | class!; |
| 114 | |
| 115 | /// Returns CSS classes that position a panel next to its anchor. |
| 116 | /// |
| 117 | /// `anchor` chooses the element to follow, `side` chooses where the panel appears, |
| 118 | /// and `align` chooses how they line up. The browser tries other positions if the |
| 119 | /// panel does not fit in the window. For a panel opened by a button: |
| 120 | /// |
| 121 | /// ```ignore |
| 122 | /// view! { |
| 123 | /// let filters = element_id(cx); |
| 124 | /// <button type="button" popovertarget=(&filters)>"Filters"</button> |
| 125 | /// <div |
| 126 | /// id=(&filters) |
| 127 | /// popover="auto" |
| 128 | /// class=(floating_variants( |
| 129 | /// FloatingAnchor::Invoker, |
| 130 | /// FloatingSide::Right, |
| 131 | /// FloatingAlign::Start, |
| 132 | /// )) |
| 133 | /// > |
| 134 | /// (filter_form) |
| 135 | /// </div> |
| 136 | /// } |
| 137 | /// ``` |
| 138 | /// |
| 139 | /// To show a hint when its parent is hovered, make that parent the anchor: |
| 140 | /// |
| 141 | /// ```ignore |
| 142 | /// view! { |
| 143 | /// <span class=(class!("group inline-flex", FLOATING_SCOPE))> |
| 144 | /// (trigger) |
| 145 | /// <span |
| 146 | /// class=(class!( |
| 147 | /// floating_variants( |
| 148 | /// FloatingAnchor::Scope, |
| 149 | /// FloatingSide::Top, |
| 150 | /// FloatingAlign::Center, |
| 151 | /// ), |
| 152 | /// "hidden group-hover:block", |
| 153 | /// )) |
| 154 | /// > |
| 155 | /// (hint) |
| 156 | /// </span> |
| 157 | /// </span> |
| 158 | /// } |
| 159 | /// ``` |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 |