text
stringlengths
1
2.83M
id
stringlengths
16
152
metadata
dict
__index_level_0__
int64
0
949
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M19 19V9.799l-7-5.522-7 5.522V19h14zm2 1a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9.314a1 1 0 0 1 .38-.785l8-6.311a1 1 0 0 1 1.24 0l8 6.31a1 1 0 0 1 .38.786V20zM7 12h2a3 3 0 0 0 6 0h2a5 5 0 0 1-10 0z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/home-smile-2-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/home-smile-2-line.svg", "repo_id": "owncloud", "token_count": 209 }
724
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path fill-rule="nonzero" d="M11 2v2H7v16h10v-9h2v10a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h5zm2 5a2 2 0 0 1 2 2h-2V7zm0-3a5 5 0 0 1 5 5h-2a3 3 0 0 0-3-3V4zm0-3a8 8 0 0 1 8 8h-2a6 6 0 0 0-6-6V1z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/hotspot-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/hotspot-line.svg", "repo_id": "owncloud", "token_count": 221 }
725
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M4 3h16l2 4v13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7.004L4 3zm16 6H4v10h16V9zm-.236-2l-1-2H5.237l-1 2h15.527zM13 14h3l-4 4-4-4h3v-4h2v4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/inbox-archive-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/inbox-archive-line.svg", "repo_id": "owncloud", "token_count": 186 }
726
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0H24V24H0z"/> <path d="M16 9l4.371 1.749c.38.151.629.52.629.928V21c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-9.323c0-.409.249-.777.629-.928L8 9h8zm-.385 2h-7.23L5 12.354V20h14v-1H8v-5h11v-1.646L15.615 11zM16 3c.552 0 1 .448 1 1v4H7V4c0-.552.448-1 1-1h8zm-1 2H9v1h6V5z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/ink-bottle-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/ink-bottle-line.svg", "repo_id": "owncloud", "token_count": 247 }
727
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M11.27 12.216L15 6l8 15H2L9 8l2.27 4.216zm1.12 2.022L14.987 19h4.68l-4.77-8.942-2.507 4.18zM5.348 19h7.304L9 12.219 5.348 19zM5.5 8a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/landscape-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/landscape-line.svg", "repo_id": "owncloud", "token_count": 197 }
728
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M8 4h13v2H8V4zM5 3v3h1v1H3V6h1V4H3V3h2zM3 14v-2.5h2V11H3v-1h3v2.5H4v.5h2v1H3zm2 5.5H3v-1h2V18H3v-1h3v4H3v-1h2v-.5zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/list-ordered.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/list-ordered.svg", "repo_id": "owncloud", "token_count": 219 }
729
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M18 8h2a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h2V7a6 6 0 1 1 12 0v1zm-7 7.732V18h2v-2.268a2 2 0 1 0-2 0zM16 8V7a4 4 0 1 0-8 0v1h8z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/lock-2-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/lock-2-fill.svg", "repo_id": "owncloud", "token_count": 195 }
730
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M2 4.007C2 3.45 2.455 3 2.992 3h18.016c.548 0 .992.45.992 1.007V17H2V4.007zM1 19h22v2H1v-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/macbook-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/macbook-fill.svg", "repo_id": "owncloud", "token_count": 145 }
731
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M22 12a5.002 5.002 0 0 0-7.9 3H13v6H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v8zm-9.94-.317L5.648 6.238 4.353 7.762l7.72 6.555 7.581-6.56-1.308-1.513-6.285 5.439zM22 17h1v5h-8v-5h1v-1a3 3 0 0 1 6 0v1zm-2 0v-1a1 1 0 0 0-2 0v1h2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/mail-lock-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/mail-lock-fill.svg", "repo_id": "owncloud", "token_count": 246 }
732
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M13 11V6h-2v7h6v-2h-4zm5.364 6.364L12 23.728l-6.364-6.364a9 9 0 1 1 12.728 0z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/map-pin-time-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/map-pin-time-fill.svg", "repo_id": "owncloud", "token_count": 139 }
733
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 7a8 8 0 1 1 0 16 8 8 0 0 1 0-16zm0 3.5l-1.323 2.68-2.957.43 2.14 2.085-.505 2.946L12 17.25l2.645 1.39-.505-2.945 2.14-2.086-2.957-.43L12 10.5zm1-8.501L18 2v3l-1.363 1.138A9.935 9.935 0 0 0 13 5.049L13 2zm-2 0v3.05a9.935 9.935 0 0 0-3.636 1.088L6 5V2l5-.001z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/medal-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/medal-fill.svg", "repo_id": "owncloud", "token_count": 259 }
734
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M18 18v2H6v-2h12zm3-7v2H3v-2h18zm-3-7v2H6V4h12z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/menu-5-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/menu-5-fill.svg", "repo_id": "owncloud", "token_count": 129 }
735
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M2 8.994A5.99 5.99 0 0 1 8 3h8c3.313 0 6 2.695 6 5.994V21H8c-3.313 0-6-2.695-6-5.994V8.994zM20 19V8.994A4.004 4.004 0 0 0 16 5H8a3.99 3.99 0 0 0-4 3.994v6.012A4.004 4.004 0 0 0 8 19h12zm-6-8h2v2h-2v-2zm-6 0h2v2H8v-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/message-3-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/message-3-line.svg", "repo_id": "owncloud", "token_count": 232 }
736
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm7.05 8a2.5 2.5 0 0 1 4.064-1.41l1.701-1.133A4.5 4.5 0 0 0 8.028 11H7v2h1.027a4.5 4.5 0 0 0 7.788 2.543l-1.701-1.134A2.5 2.5 0 0 1 10.05 13l4.95.001v-2h-4.95z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/money-euro-box-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/money-euro-box-fill.svg", "repo_id": "owncloud", "token_count": 245 }
737
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 3c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 14c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/more-2-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/more-2-fill.svg", "repo_id": "owncloud", "token_count": 200 }
738
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M2 3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992A.993.993 0 0 1 2 20.007V3.993zm10 8.178A3 3 0 1 0 14 15V7.999h3V6h-5v6.17z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/mv-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/mv-fill.svg", "repo_id": "owncloud", "token_count": 183 }
739
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M18 10a6 6 0 1 0-12 0v8h12v-8zm2 8.667l.4.533a.5.5 0 0 1-.4.8H4a.5.5 0 0 1-.4-.8l.4-.533V10a8 8 0 1 1 16 0v8.667zM9.5 21h5a2.5 2.5 0 1 1-5 0z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/notification-4-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/notification-4-line.svg", "repo_id": "owncloud", "token_count": 185 }
740
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M17 4V2.068a.5.5 0 0 1 .82-.385l4.12 3.433a.5.5 0 0 1-.321.884H2V4h15zM2 18h20v2H2v-2zm0-7h20v2H2v-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/order-play-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/order-play-fill.svg", "repo_id": "owncloud", "token_count": 161 }
741
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M4 18.922l-1.35-.545a1 1 0 0 1-.552-1.302L4 12.367v6.555zM8.86 21H7a1 1 0 0 1-1-1v-6.078L8.86 21zM6.022 5.968l9.272-3.746a1 1 0 0 1 1.301.552l5.62 13.908a1 1 0 0 1-.553 1.302L12.39 21.73a1 1 0 0 1-1.302-.553L5.47 7.27a1 1 0 0 1 .553-1.301zM9 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/pantone-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/pantone-fill.svg", "repo_id": "owncloud", "token_count": 257 }
742
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M17.5 21a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7zm0-2a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm-11-9a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7zm0-2a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm12.571-4.485l1.414 1.414L4.93 20.485l-1.414-1.414L19.07 3.515z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/percent-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/percent-line.svg", "repo_id": "owncloud", "token_count": 245 }
743
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M11 .543c.33-.029.663-.043 1-.043C18.351.5 23.5 5.649 23.5 12c0 .337-.014.67-.043 1h-1.506c-.502 5.053-4.766 9-9.951 9-5.523 0-10-4.477-10-10 0-5.185 3.947-9.449 9-9.95V.542zM11 13V4.062A8.001 8.001 0 0 0 12 20a8.001 8.001 0 0 0 7.938-7H11zm10.448-2A9.503 9.503 0 0 0 13 2.552V11h8.448z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/pie-chart-2-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/pie-chart-2-line.svg", "repo_id": "owncloud", "token_count": 259 }
744
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0H24V24H0z"/> <path d="M21 3v2c0 3.866-3.134 7-7 7h-1v1h5v7c0 1.105-.895 2-2 2H8c-1.105 0-2-.895-2-2v-7h5v-3c0-3.866 3.134-7 7-7h3zM5.5 2c2.529 0 4.765 1.251 6.124 3.169C10.604 6.51 10 8.185 10 10v1h-.5C5.358 11 2 7.642 2 3.5V2h3.5z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/plant-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/plant-fill.svg", "repo_id": "owncloud", "token_count": 229 }
745
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M13 18v2h6v2h-6a2 2 0 0 1-2-2v-2H8a4 4 0 0 1-4-4v-4h16v4a4 4 0 0 1-4 4h-3zm4-12h2a1 1 0 0 1 1 1v2H4V7a1 1 0 0 1 1-1h2V2h2v4h6V2h2v4zm-5 8.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2zM11 2h2v3h-2V2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/plug-2-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/plug-2-fill.svg", "repo_id": "owncloud", "token_count": 227 }
746
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M10.566 17A4.737 4.737 0 0 0 10 19.25c0 1.023.324 1.973.877 2.75H7v-5h3.566zm6.934-4a3.5 3.5 0 0 1 3.5 3.5l-.001.103a2.75 2.75 0 0 1-.581 5.392L20.25 22h-5.5l-.168-.005a2.75 2.75 0 0 1-.579-5.392L14 16.5a3.5 3.5 0 0 1 3.5-3.5zM21 8a1 1 0 0 1 1 1l.001 4.346A5.482 5.482 0 0 0 17.5 11l-.221.004A5.503 5.503 0 0 0 12.207 15H5v5H3a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h18zM8 10H5v2h3v-2zm9-8a1 1 0 0 1 1 1v3H6V3a1 1 0 0 1 1-1h10z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/printer-cloud-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/printer-cloud-fill.svg", "repo_id": "owncloud", "token_count": 357 }
747
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M18 3v2h-1v6l2 3v2h-6v7h-2v-7H5v-2l2-3V5H6V3z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/pushpin-2-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/pushpin-2-fill.svg", "repo_id": "owncloud", "token_count": 130 }
748
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0H24V24H0z"/> <path d="M12 19c.828 0 1.5.672 1.5 1.5S12.828 22 12 22s-1.5-.672-1.5-1.5.672-1.5 1.5-1.5zm0-17c3.314 0 6 2.686 6 6 0 2.165-.753 3.29-2.674 4.923C13.399 14.56 13 15.297 13 17h-2c0-2.474.787-3.695 3.031-5.601C15.548 10.11 16 9.434 16 8c0-2.21-1.79-4-4-4S8 5.79 8 8v1H6V8c0-3.314 2.686-6 6-6z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/question-mark.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/question-mark.svg", "repo_id": "owncloud", "token_count": 268 }
749
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M16 18v-2h1a4 4 0 1 0-2.157-7.37A6 6 0 1 0 8 15.917v2.022A8.001 8.001 0 0 1 9 2a7.998 7.998 0 0 1 6.98 4.087A6 6 0 1 1 17 18h-1zm-5.768.732L12 16.964l1.768 1.768a2.5 2.5 0 1 1-3.536 0z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/rainy-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/rainy-line.svg", "repo_id": "owncloud", "token_count": 203 }
750
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M5.671 4.257c3.928-3.219 9.733-2.995 13.4.672 3.905 3.905 3.905 10.237 0 14.142-3.905 3.905-10.237 3.905-14.142 0A9.993 9.993 0 0 1 2.25 9.767l.077-.313 1.934.51a8 8 0 1 0 3.053-4.45l-.221.166 1.017 1.017-4.596 1.06 1.06-4.596 1.096 1.096zM13 6v2h2.5v2H10a.5.5 0 0 0-.09.992L10 11h4a2.5 2.5 0 1 1 0 5h-1v2h-2v-2H8.5v-2H14a.5.5 0 0 0 .09-.992L14 13h-4a2.5 2.5 0 1 1 0-5h1V6h2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/refund-2-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/refund-2-line.svg", "repo_id": "owncloud", "token_count": 327 }
751
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/restart-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/restart-line.svg", "repo_id": "owncloud", "token_count": 177 }
752
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M19 20H5v1a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-7.5l-1.243-.31A1 1 0 0 1 0 12.22v-.72a.5.5 0 0 1 .5-.5H2l2.48-5.788A2 2 0 0 1 6.32 4H17.68a2 2 0 0 1 1.838 1.212L22 11h1.5a.5.5 0 0 1 .5.5v.72a1 1 0 0 1-.757.97L22 13.5V21a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1v-1zm1-2v-5H4v5h16zM5.477 11h13.046a1 1 0 0 0 .928-1.371L18 6H6L4.549 9.629A1 1 0 0 0 5.477 11zM5 14c2.317 0 3.879.755 4.686 2.264a.5.5 0 0 1-.441.736H6a1 1 0 0 1-1-1v-2zm14 0v2a1 1 0 0 1-1 1h-3.245a.5.5 0 0 1-.44-.736C15.12 14.754 16.682 14 19 14z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/roadster-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/roadster-line.svg", "repo_id": "owncloud", "token_count": 408 }
753
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M15 21h-2v-3h-2v3H9v-2H7v2H4a1 1 0 0 1-1-1v-3h2v-2H3v-2h3v-2H3V9h2V7H3V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v9h9a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-3v-2h-2v2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/ruler-2-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/ruler-2-fill.svg", "repo_id": "owncloud", "token_count": 207 }
754
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M4 3h14l2.707 2.707a1 1 0 0 1 .293.707V20a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm3 1v5h9V4H7zm-1 8v7h12v-7H6zm7-7h2v3h-2V5z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/save-3-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/save-3-fill.svg", "repo_id": "owncloud", "token_count": 185 }
755
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M9.879 12L7.562 9.683a4 4 0 1 1 2.121-2.121L12 9.88l6.374-6.375a2 2 0 0 1 2.829 0l.707.707L9.683 16.438a4 4 0 1 1-2.121-2.121L9.88 12zM6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 12a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm9.535-6.587l6.375 6.376-.707.707a2 2 0 0 1-2.829 0l-4.96-4.961 2.12-2.122zM16 11h2v2h-2v-2zm4 0h2v2h-2v-2zM6 11h2v2H6v-2zm-4 0h2v2H2v-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/scissors-cut-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/scissors-cut-fill.svg", "repo_id": "owncloud", "token_count": 314 }
756
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M5 11h14V5H5v6zm16-7v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1zm-2 9H5v6h14v-6zM7 15h3v2H7v-2zm0-8h3v2H7V7z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/server-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/server-line.svg", "repo_id": "owncloud", "token_count": 189 }
757
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M20 16h2v6h-6v-2H8v2H2v-6h2V8H2V2h6v2h8V2h6v6h-2v8zm-2 0V8h-2V6H8v2H6v8h2v2h8v-2h2zM4 4v2h2V4H4zm0 14v2h2v-2H4zM18 4v2h2V4h-2zm0 14v2h2v-2h-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/shape-2-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/shape-2-line.svg", "repo_id": "owncloud", "token_count": 219 }
758
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0H24V24H0z"/> <path d="M12 1l8.217 1.826c.457.102.783.507.783.976v9.987c0 2.006-1.003 3.88-2.672 4.992L12 23l-6.328-4.219C4.002 17.668 3 15.795 3 13.79V3.802c0-.469.326-.874.783-.976L12 1zm0 2.049L5 4.604v9.185c0 1.337.668 2.586 1.781 3.328L12 20.597l5.219-3.48C18.332 16.375 19 15.127 19 13.79V4.604L12 3.05zm4.452 5.173l1.415 1.414L11.503 16 7.26 11.757l1.414-1.414 2.828 2.828 4.95-4.95z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/shield-check-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/shield-check-line.svg", "repo_id": "owncloud", "token_count": 303 }
759
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M4 10.4V4a1 1 0 0 1 1-1h5V1h4v2h5a1 1 0 0 1 1 1v6.4l1.086.326a1 1 0 0 1 .682 1.2l-1.516 6.068a4.992 4.992 0 0 1-1.902-.272l1.25-5.352L12 10l-7.6 2.37 1.25 5.351a4.992 4.992 0 0 1-1.902.273l-1.516-6.068a1 1 0 0 1 .682-1.2L4 10.4zm2-.6L12 8l6 1.8V5H6v4.8zM4 20a5.978 5.978 0 0 0 4-1.528A5.978 5.978 0 0 0 12 20a5.978 5.978 0 0 0 4-1.528A5.978 5.978 0 0 0 20 20h2v2h-2a7.963 7.963 0 0 1-4-1.07A7.963 7.963 0 0 1 12 22a7.963 7.963 0 0 1-4-1.07A7.963 7.963 0 0 1 4 22H2v-2h2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/ship-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/ship-line.svg", "repo_id": "owncloud", "token_count": 397 }
760
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M4 16V4H2V2h3a1 1 0 0 1 1 1v12h12.438l2-8H8V5h13.72a1 1 0 0 1 .97 1.243l-2.5 10a1 1 0 0 1-.97.757H5a1 1 0 0 1-1-1zm2 7a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm12 0a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/shopping-cart-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/shopping-cart-line.svg", "repo_id": "owncloud", "token_count": 205 }
761
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0H24V24H0z"/> <path d="M12 3c4.284 0 8.22 1.497 11.31 3.996L12 21 .69 6.997C3.78 4.497 7.714 3 12 3zm0 9c-1.42 0-2.764.33-3.959.915L12 17.817l3.958-4.902C14.764 12.329 13.42 12 12 12zm0-7c-3.028 0-5.923.842-8.42 2.392l3.178 3.935C8.316 10.481 10.102 10 12 10c1.898 0 3.683.48 5.241 1.327L20.42 7.39C17.922 5.841 15.027 5 12 5z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/signal-wifi-2-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/signal-wifi-2-line.svg", "repo_id": "owncloud", "token_count": 270 }
762
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M6.457 18.957l8.564-8.564-1.414-1.414-8.564 8.564 1.414 1.414zm5.735-11.392l-1.414-1.414 1.414-1.414 1.768 1.767 2.829-2.828a1 1 0 0 1 1.414 0l2.121 2.121a1 1 0 0 1 0 1.414l-2.828 2.829 1.767 1.768-1.414 1.414-1.414-1.414L7.243 21H3v-4.243l9.192-9.192z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/sip-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/sip-line.svg", "repo_id": "owncloud", "token_count": 249 }
763
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M14.5 3A1.5 1.5 0 0 1 16 4.5v5a1.5 1.5 0 0 1-3 0v-5A1.5 1.5 0 0 1 14.5 3zm-10 10H6v1.5A1.5 1.5 0 1 1 4.5 13zm8.5 5h1.5a1.5 1.5 0 1 1-1.5 1.5V18zm1.5-5h5a1.5 1.5 0 0 1 0 3h-5a1.5 1.5 0 0 1 0-3zm5-5a1.5 1.5 0 0 1 0 3H18V9.5A1.5 1.5 0 0 1 19.5 8zm-15 0h5a1.5 1.5 0 0 1 0 3h-5a1.5 1.5 0 0 1 0-3zm5-5A1.5 1.5 0 0 1 11 4.5V6H9.5a1.5 1.5 0 0 1 0-3zm0 10a1.5 1.5 0 0 1 1.5 1.5v5a1.5 1.5 0 0 1-3 0v-5A1.5 1.5 0 0 1 9.5 13z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/slack-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/slack-line.svg", "repo_id": "owncloud", "token_count": 393 }
764
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M13 16.268l1.964-1.134 1 1.732L14 18l1.964 1.134-1 1.732L13 19.732V22h-2v-2.268l-1.964 1.134-1-1.732L10 18l-1.964-1.134 1-1.732L11 16.268V14h2v2.268zM17 18v-2h.5a3.5 3.5 0 1 0-2.5-5.95V10a6 6 0 1 0-8 5.659v2.089a8 8 0 1 1 9.458-10.65A5.5 5.5 0 1 1 17.5 18l-.5.001z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/snowy-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/snowy-line.svg", "repo_id": "owncloud", "token_count": 266 }
765
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm8 14a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0 2a7 7 0 1 0 0-14 7 7 0 0 0 0 14zm0-5a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/speaker-2-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/speaker-2-fill.svg", "repo_id": "owncloud", "token_count": 197 }
766
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M17 13a4 4 0 1 1 0 8c-2.142 0-4-1.79-4-4h-2a4 4 0 1 1-.535-2h3.07A3.998 3.998 0 0 1 17 13zM2 12v-2h2V7a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v3h2v2H2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/spy-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/spy-fill.svg", "repo_id": "owncloud", "token_count": 183 }
767
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 .5l4.226 6.183 7.187 2.109-4.575 5.93.215 7.486L12 19.69l-7.053 2.518.215-7.486-4.575-5.93 7.187-2.109L12 .5zM10 12H8a4 4 0 0 0 7.995.2L16 12h-2a2 2 0 0 1-3.995.15L10 12z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/star-smile-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/star-smile-fill.svg", "repo_id": "owncloud", "token_count": 195 }
768
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M5 11h14v2H5z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/subtract-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/subtract-fill.svg", "repo_id": "owncloud", "token_count": 98 }
769
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M8 12h2v2H4v-2h2a6 6 0 1 1 6 6v-2a4 4 0 1 0-4-4zm-2 8h9v2H6v-2zm-4-4h8v2H2v-2zm9-15h2v3h-2V1zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/sun-foggy-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/sun-foggy-line.svg", "repo_id": "owncloud", "token_count": 294 }
770
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path fill-rule="nonzero" d="M7.05 13.406l3.534 3.536-1.413 1.414 1.415 1.415-1.414 1.414-2.475-2.475-2.829 2.829-1.414-1.414 2.829-2.83-2.475-2.474 1.414-1.414 1.414 1.413 1.413-1.414zM3 3l3.546.003 11.817 11.818 1.415-1.414 1.414 1.414-2.474 2.475 2.828 2.829-1.414 1.414-2.829-2.829-2.475 2.475-1.414-1.414 1.414-1.415L3.003 6.531 3 3zm14.457 0L21 3.003l.002 3.523-4.053 4.052-3.536-3.535L17.457 3z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/sword-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/sword-fill.svg", "repo_id": "owncloud", "token_count": 325 }
771
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M4 8h16V5H4v3zm10 11v-9h-4v9h4zm2 0h4v-9h-4v9zm-8 0v-9H4v9h4zM3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/table-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/table-line.svg", "repo_id": "owncloud", "token_count": 190 }
772
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zM7 17h12v2H7v2.5L3 18l4-3.5V17z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/text-direction-r.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/text-direction-r.svg", "repo_id": "owncloud", "token_count": 164 }
773
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M10 6v2H6v10H4V8H0V6h10zm2 0h2.5l3 5.196L20.5 6H23v12h-2V9.133l-3.5 6.063L14 9.135V18h-2V6z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/trademark-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/trademark-fill.svg", "repo_id": "owncloud", "token_count": 158 }
774
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M13 16.938V19h5v2H6v-2h5v-2.062A8.001 8.001 0 0 1 4 9V3h16v6a8.001 8.001 0 0 1-7 7.938zM1 5h2v4H1V5zm20 0h2v4h-2V5z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/trophy-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/trophy-fill.svg", "repo_id": "owncloud", "token_count": 173 }
775
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M4 12h16a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1zM5 2h14v8H5V2zm4 3v2h2V5H9zm4 0v2h2V5h-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/u-disk-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/u-disk-fill.svg", "repo_id": "owncloud", "token_count": 174 }
776
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 14v2a6 6 0 0 0-6 6H4a8 8 0 0 1 8-8zm0-1c-3.315 0-6-2.685-6-6s2.685-6 6-6 6 2.685 6 6-2.685 6-6 6zm0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm2.595 7.812a3.51 3.51 0 0 1 0-1.623l-.992-.573 1-1.732.992.573A3.496 3.496 0 0 1 17 14.645V13.5h2v1.145c.532.158 1.012.44 1.405.812l.992-.573 1 1.732-.992.573a3.51 3.51 0 0 1 0 1.622l.992.573-1 1.732-.992-.573a3.496 3.496 0 0 1-1.405.812V22.5h-2v-1.145a3.496 3.496 0 0 1-1.405-.812l-.992.573-1-1.732.992-.572zM18 19.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/user-settings-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/user-settings-line.svg", "repo_id": "owncloud", "token_count": 417 }
777
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M14 10.25L17 8v6l-3-2.25V14H7V8h7v2.25zM5.763 17H20V5H4v13.385L5.763 17zm.692 2L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6.455z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/video-chat-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/video-chat-line.svg", "repo_id": "owncloud", "token_count": 185 }
778
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M2 19h20v2H2v-2zM2 5l5 3.5L12 2l5 6.5L22 5v12H2V5zm2 3.841V15h16V8.841l-3.42 2.394L12 5.28l-4.58 5.955L4 8.84z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/vip-crown-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/vip-crown-line.svg", "repo_id": "owncloud", "token_count": 170 }
779
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M18 7h3a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h15v4zM4 9v10h16V9H4zm0-4v2h12V5H4zm11 8h3v2h-3v-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/wallet-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/wallet-line.svg", "repo_id": "owncloud", "token_count": 179 }
780
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M11 15.934A7.501 7.501 0 0 1 12 1a7.5 7.5 0 0 1 1 14.934V18h5v2h-5v4h-2v-4H6v-2h5v-2.066zM12 14a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/women-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/women-line.svg", "repo_id": "owncloud", "token_count": 180 }
781
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0H24V24H0z"/> <path d="M11 11v2l-5.327 6H11v2H3v-2l5.326-6H3v-2h8zm10-8v2l-5.327 6H21v2h-8v-2l5.326-6H13V3h8z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/zzz-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/zzz-fill.svg", "repo_id": "owncloud", "token_count": 157 }
782
<template> <span> <span v-oc-tooltip="tooltip" class="oc-avatars" :class="{ 'oc-avatars-stacked': stacked }" aria-hidden="true" > <template v-if="avatars.length > 0"> <oc-avatar v-for="avatar in avatars" :key="avatar.username" :src="avatar.avatar" :user-name="avatar.displayName" :width="30" /> </template> <template v-if="otherItems.length > 0"> <component :is="getAvatarComponentForItem(item)" v-for="(item, index) in otherItems" :key="item.name + index" :name="item.name" /> </template> <oc-avatar-count v-if="isOverlapping" :count="items.length - maxDisplayed" /> </span> <span v-if="accessibleDescription" class="oc-invisible-sr" v-text="accessibleDescription" /> </span> </template> <script lang="ts"> import { shareType } from '../../utils/shareType' import OcAvatar from '../OcAvatar/OcAvatar.vue' import OcAvatarCount from '../OcAvatarCount/OcAvatarCount.vue' import OcAvatarLink from '../OcAvatarLink/OcAvatarLink.vue' import OcAvatarGroup from '../OcAvatarGroup/OcAvatarGroup.vue' import OcAvatarFederated from '../OcAvatarFederated/OcAvatarFederated.vue' import OcAvatarGuest from '../OcAvatarGuest/OcAvatarGuest.vue' import { defineComponent, PropType } from 'vue' /** * Display a group of avatars */ export default defineComponent({ name: 'OcAvatars', status: 'ready', release: '2.1.0', components: { OcAvatar, OcAvatarCount, OcAvatarLink, OcAvatarGroup, OcAvatarFederated, OcAvatarGuest }, props: { /** * Users, public links, groups, federated and guests to be displayed with avatars */ items: { type: Array as PropType<any[]>, required: true }, /** * Asserts whether avatars should be stacked on each other */ stacked: { type: Boolean, required: false, default: false }, /** * Asserts whether tooltip should be displayed on hover/focus */ isTooltipDisplayed: { type: Boolean, required: false, default: false }, /** * Limits the number of avatars which will be displayed */ maxDisplayed: { type: Number, required: false, default: null }, /** * A description of the avatar group for screen readers. This is required as the avatar group element * is hidden for screen readers. */ accessibleDescription: { type: String, required: false, default: null } }, computed: { isOverlapping() { return this.maxDisplayed && this.maxDisplayed < this.items.length }, tooltip() { if (this.isTooltipDisplayed) { const names = this.avatars.map((user) => user.displayName) if (this.otherItems.length > 0) { names.push(...this.otherItems.map((item) => item.name)) } let tooltip = names.join(', ') if (this.isOverlapping) { tooltip += ` +${this.items.length - this.maxDisplayed}` } return tooltip } return null }, avatars() { const a = this.items.filter((u) => u.shareType === shareType.user) if (!this.isOverlapping) { return a } return a.slice(0, this.maxDisplayed) }, otherItems() { const a = this.items.filter((u) => u.shareType !== shareType.user) if (!this.isOverlapping) { return a } if (this.maxDisplayed <= this.avatars.length) { return [] } return a.slice(0, this.maxDisplayed - this.avatars.length) } }, methods: { getAvatarComponentForItem(item) { switch (item.shareType) { case shareType.link: return OcAvatarLink case shareType.remote: return OcAvatarFederated case shareType.group: return OcAvatarGroup case shareType.guest: return OcAvatarGuest } } } }) </script> <style lang="scss"> .oc-avatars { display: inline-flex; box-sizing: border-box; flex-flow: row nowrap; gap: var(--oc-space-xsmall); width: fit-content; &-stacked { .oc-avatar + .oc-avatar, .oc-avatar-count, .oc-avatar + .oc-avatar-item, .oc-avatar-item + .oc-avatar-item { border: 1px solid var(--oc-color-text-inverse); margin-left: -25px; } } } </style> <docs> ```js <template> <div> <h3>Default configuration</h3> <p>No stacking, no tooltip, no <b>:maxDisplayed</b> configured</p> <oc-avatars :items="items" accessible-description="This resource is shared with many users." class="oc-mb" /> <h3>Stacked, tooltip, maxDisplayed</h3> <p>Using <b>:stacked="true"</b>, <b>:isTooltipDisplayed="true"</b> and <b>:maxDisplayed="5"</b></p> <oc-avatars :items="items" accessible-description="This resource is shared with many users." :stacked="true" :maxDisplayed="5" :isTooltipDisplayed="true" /> <h3>Unstacked, tooltip, maxDisplayed</h3> <p>Using <b>:isTooltipDisplayed="true"</b> and <b>:maxDisplayed="2"</b></p> <oc-avatars :items="items" accessible-description="This resource is shared with many users." :maxDisplayed="2" :isTooltipDisplayed="true" /> </div> </template> <script> import { shareType } from "../../utils/shareType" export default { data: () => ({ items: [ { name: "bob", shareType: shareType.remote }, { username: "marie", displayName: "Marie", avatar: "https://images.unsplash.com/photo-1584308972272-9e4e7685e80f?ixid=MXwxMjA3fDB8MHxzZWFyY2h8Mzh8fGZhY2V8ZW58MHwyfDB8&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60", shareType: shareType.user }, { username: "peter", displayName: "Peter", avatar: "https://images.unsplash.com/photo-1610216705422-caa3fcb6d158?ixid=MXwxMjA3fDB8MHxzZWFyY2h8MTB8fGZhY2V8ZW58MHwyfDB8&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60", shareType: shareType.user }, { username: "udo", displayName: "Udo", avatar: "https://images.unsplash.com/photo-1584308972272-9e4e7685e80f?ixid=MXwxMjA3fDB8MHxzZWFyY2h8Mzh8fGZhY2V8ZW58MHwyfDB8&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60", shareType: shareType.user }, { name: "john", shareType: shareType.guest }, { name: "Public link", shareType: shareType.link }, { name: "Test", shareType: shareType.group } ] }) } </script> ``` </docs>
owncloud/web/packages/design-system/src/components/OcAvatars/OcAvatars.vue/0
{ "file_path": "owncloud/web/packages/design-system/src/components/OcAvatars/OcAvatars.vue", "repo_id": "owncloud", "token_count": 3028 }
783
import OcDropzone from './OcDropzone.vue' import { mount } from 'web-test-helpers' describe('OcDropzone', () => { const selectors = { dropzone: '.oc-dropzone' } describe('when slot is provided', () => { it('should render slot html', () => { const wrapper = mount(OcDropzone, { slots: { default: "<p class='test-class'>Drag and drop to upload content into current folder</p>" } }) const slotElement = wrapper.find(`${selectors.dropzone} p`) expect(slotElement.exists()).toBeTruthy() expect(slotElement.attributes('class')).toBe('test-class') expect(slotElement.text()).toBe('Drag and drop to upload content into current folder') }) }) })
owncloud/web/packages/design-system/src/components/OcDropzone/OcDropzone.spec.ts/0
{ "file_path": "owncloud/web/packages/design-system/src/components/OcDropzone/OcDropzone.spec.ts", "repo_id": "owncloud", "token_count": 275 }
784
<template> <ul class="oc-list oc-my-rm oc-mx-rm" :class="{ 'oc-list-raw': raw }"> <slot /> </ul> </template> <script lang="ts"> import { defineComponent } from 'vue' export default defineComponent({ name: 'OcList', status: 'ready', release: '12.0.0', props: { raw: { type: Boolean, default: false, required: false } } }) </script> <style lang="scss"> .oc-list { list-style: none; margin: 0; padding: 0; &-divider > :nth-child(n + 2) { border-top: 1px solid var(--oc-color-border); margin-top: var(--oc-space-small); padding-top: var(--oc-space-small); } &-raw { list-style-type: none; a { text-decoration: none !important; &:hover { color: inherit; } } } } </style> <docs> ```js <h3>Example list</h3> <oc-list> <li> <oc-icon name="user" fill-type="line" /> <a href="https://google.de"> Profile </a> </li> <li> <oc-icon name="link" fill-type="line" /> <a href="https://google.de"> Links </a> </li> <li> <oc-icon name="file" fill-type="line" /> <a href="https://google.de"> Dateien </a> </li> </oc-list> ``` </docs>
owncloud/web/packages/design-system/src/components/OcList/OcList.vue/0
{ "file_path": "owncloud/web/packages/design-system/src/components/OcList/OcList.vue", "repo_id": "owncloud", "token_count": 591 }
785
import { shallowMount } from 'web-test-helpers' import Progress from './OcProgress.vue' describe('OcProgress', () => { it('sets correct classes', () => { const wrapper = shallowMount(Progress, { props: { value: 3, max: 10, variation: 'warning', size: 'small' } }) expect(wrapper.classes()).toContain('oc-progress-small') expect(wrapper.classes()).toContain('oc-progress-warning') expect(wrapper.html()).toMatchSnapshot() }) })
owncloud/web/packages/design-system/src/components/OcProgress/OcProgress.spec.ts/0
{ "file_path": "owncloud/web/packages/design-system/src/components/OcProgress/OcProgress.spec.ts", "repo_id": "owncloud", "token_count": 198 }
786
import { shallowMount } from 'web-test-helpers' import Switch from './OcSwitch.vue' const defaultProps = { label: 'Test label' } describe('OcSwitch', () => { it('can be toggled', async () => { const wrapper = shallowMount(Switch, { props: defaultProps }) await wrapper.find('[data-testid="oc-switch-btn"]').trigger('click') expect(wrapper.emitted('update:checked')[0][0]).toEqual(true) await wrapper.find('[data-testid="oc-switch-btn"]').trigger('click') expect(wrapper.emitted('update:checked')[0][0]).toEqual(true) }) })
owncloud/web/packages/design-system/src/components/OcSwitch/OcSwitch.spec.ts/0
{ "file_path": "owncloud/web/packages/design-system/src/components/OcSwitch/OcSwitch.spec.ts", "repo_id": "owncloud", "token_count": 211 }
787
<template> <div class="colors"> <div v-for="(prop, index) in tokens" :key="index" class="color" :class="prop.category"> <div class="swatch" :style="{ backgroundColor: prop.value }" /> <h4>{{ prop.name }}</h4> <span v-for="(v, k) in prop.info" :key="k"> <em>{{ k }}:</em> {{ v }} </span> <span> <em>scss:</em> ${{ prop.name }} </span> <span> <em>css:</em> var(--{{ prop.name }}) </span> </div> </div> </template> <script lang="ts"> import { defineComponent } from 'vue' import designTokens from '../../assets/tokens/ods.json' /** * The color palette comes with 5 different weights for each hue. These hues * should be used purposefully to communicate how things function in the * interface. Keep in mind that `vermilion` is only used in special cases * like destructive actions and error messages. To edit the colors, see * [/src/tokens/color.yml](https://github.com/owncloud/owncloud-design-system/blob/master/src/tokens/color.yml). */ export default defineComponent({ name: 'DocsColorTokens', computed: { tokens() { return Object.values(designTokens).filter((token) => token.name.startsWith('oc-color-')) } } }) </script> <style lang="scss" scoped> @import '../../../docs/docs.tokens'; /* STYLES --------------------------------------------- */ .colors { margin-top: $space-l; display: block; width: 100%; @supports (display: grid) { display: grid; max-width: 1200px; align-content: stretch; justify-content: left; grid-template-columns: calc(20% - #{$space-m}) calc(20% - #{$space-m}) calc(20% - #{$space-m}) calc(20% - #{$space-m}) calc(20% - #{$space-m}); grid-column-gap: $space-m; @media (max-width: 1300px) { grid-template-columns: calc(25% - #{$space-m}) calc(25% - #{$space-m}) calc(25% - #{$space-m}) calc(25% - #{$space-m}); } @media (max-width: 1100px) { grid-template-columns: calc(33.333% - #{$space-m}) calc(33.333% - #{$space-m}) calc(33.333% - #{$space-m}); } @media (max-width: 900px) { grid-template-columns: calc(50% - #{$space-m}) calc(50% - #{$space-m}); } @media (max-width: 400px) { grid-template-columns: 100%; } } } .swatch { @include stack-space($space-s); border-bottom: 1px solid rgba(0, 0, 0, 0.08); height: $space-xxl; margin-left: -#{$space-s}; margin-top: -#{$space-s}; width: calc(100% + #{$space-l}); float: left; } h3 { @include reset; @include stack-space($space-xs); text-transform: capitalize; line-height: 1.2; width: 100%; float: left; } .color { @include reset; @include inset-space($space-s); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; margin-bottom: $space-m; box-shadow: 0 0 0 1px rgba(63, 63, 68, 0.05), 0 1px 3px 0 rgba(63, 63, 68, 0.15); font-size: $size-s; font-family: $font-text; color: $color-rich-black; border-radius: $radius-default; overflow: hidden; text-align: left; @supports (display: grid) { width: 100%; float: left; } @media (max-width: 400px) { margin-bottom: $space-m; } &:hover { span { color: $color-rich-black; em { color: $color-silver; } } } span { margin-bottom: $space-xs; line-height: 1.3; color: $color-silver; font-size: $size-s; width: 100%; float: left; em { user-select: none; font-style: normal; } } } </style> <docs> ```jsx <docs-color-tokens /> ``` </docs>
owncloud/web/packages/design-system/src/components/_DocsColorTokens/_DocsColorTokens.vue/0
{ "file_path": "owncloud/web/packages/design-system/src/components/_DocsColorTokens/_DocsColorTokens.vue", "repo_id": "owncloud", "token_count": 1656 }
788
export { default as OcAvatar } from './OcAvatar/OcAvatar.vue' export { default as OcAvatarCount } from './OcAvatarCount/OcAvatarCount.vue' export { default as OcAvatarFederated } from './OcAvatarFederated/OcAvatarFederated.vue' export { default as OcAvatarGroup } from './OcAvatarGroup/OcAvatarGroup.vue' export { default as OcAvatarGuest } from './OcAvatarGuest/OcAvatarGuest.vue' export { default as OcAvatarItem } from './OcAvatarItem/OcAvatarItem.vue' export { default as OcAvatarLink } from './OcAvatarLink/OcAvatarLink.vue' export { default as OcAvatars } from './OcAvatars/OcAvatars.vue' export { default as OcBreadcrumb } from './OcBreadcrumb/OcBreadcrumb.vue' export { default as OcButton } from './OcButton/OcButton.vue' export { default as OcCheckbox } from './OcCheckbox/OcCheckbox.vue' export { default as OcContextualHelper } from './OcContextualHelper/OcContextualHelper.vue' export { default as OcDatepicker } from './OcDatepicker/OcDatepicker.vue' export { default as OcDrop } from './OcDrop/OcDrop.vue' export { default as OcDropzone } from './OcDropzone/OcDropzone.vue' export { default as OcFilterChip } from './OcFilterChip/OcFilterChip.vue' export { default as OcGrid } from './OcGrid/OcGrid.vue' export { default as OcHiddenAnnouncer } from './OcHiddenAnnouncer/OcHiddenAnnouncer.vue' export { default as OcIcon } from './OcIcon/OcIcon.vue' export { default as OcImage } from './OcImage/OcImage.vue' export { default as OcInfoDrop } from './OcInfoDrop/OcInfoDrop.vue' export { default as OcList } from './OcList/OcList.vue' export { default as OcLoader } from './OcLoader/OcLoader.vue' export { default as OcLogo } from './OcLogo/OcLogo.vue' export { default as OcModal } from './OcModal/OcModal.vue' export { default as OcNotificationMessage } from './OcNotificationMessage/OcNotificationMessage.vue' export { default as OcNotifications } from './OcNotifications/OcNotifications.vue' export { default as OcPageSize } from './OcPageSize/OcPageSize.vue' export { default as OcPagination } from './OcPagination/OcPagination.vue' export { default as OcProgress } from './OcProgress/OcProgress.vue' export { default as OcProgressPie } from './OcProgressPie/OcProgressPie.vue' export { default as OcRadio } from './OcRadio/OcRadio.vue' export { default as OcRecipient } from './OcRecipient/OcRecipient.vue' export { default as OcSearchBar } from './OcSearchBar/OcSearchBar.vue' export { default as OcSelect } from './OcSelect/OcSelect.vue' export { default as OcSpinner } from './OcSpinner/OcSpinner.vue' export { default as OcStatusIndicators } from './OcStatusIndicators/OcStatusIndicators.vue' export { default as OcSwitch } from './OcSwitch/OcSwitch.vue' export { default as OcTable } from './OcTable/OcTable.vue' export { default as OcTableBody } from './_OcTableBody/_OcTableBody.vue' export { default as OcTableCell } from './_OcTableCell/_OcTableCell.vue' export { default as OcTableCellData } from './_OcTableCellData/_OcTableCellData.vue' export { default as OcTableCellHead } from './_OcTableCellHead/_OcTableCellHead.vue' export { default as OcTableFooter } from './_OcTableFooter/_OcTableFooter.vue' export { default as OcTableHeader } from './_OcTableHeader/_OcTableHeader.vue' export { default as OcTableRow } from './_OcTableRow/_OcTableRow.vue' export { default as OcTableSimple } from './OcTableSimple/OcTableSimple.vue' export { default as OcTag } from './OcTag/OcTag.vue' export { default as OcTextarea } from './OcTextarea/OcTextarea.vue' export { default as OcTextInput } from './OcTextInput/OcTextInput.vue' export { default as OcErrorLog } from './OcErrorLog/OcErrorLog.vue' export { default as OcEmojiPicker } from './OcEmojiPicker/OcEmojiPicker.vue'
owncloud/web/packages/design-system/src/components/index.ts/0
{ "file_path": "owncloud/web/packages/design-system/src/components/index.ts", "repo_id": "owncloud", "token_count": 1389 }
789
@mixin oc-background-primary-gradient { background: linear-gradient( 90deg, var(--oc-color-swatch-primary-muted) 0%, var(--oc-color-swatch-primary-gradient) 100% ); &:focus:not([disabled]), &:hover:not([disabled]) { background: linear-gradient( 90deg, var(--oc-color-swatch-primary-muted-hover) 0%, var(--oc-color-swatch-primary-gradient-hover) 100% ); } } .oc-background-selected { background-color: var(--oc-color-background-highlight) !important; } .oc-background-brand { background-color: var(--oc-color-swatch-brand-default) !important; } .oc-background-default { background-color: var(--oc-color-background-default) !important; } /* stylelint-disable */ .oc-background-primary-gradient { @include oc-background-primary-gradient; } /* stylelint-enable */ .oc-background-secondary { background-color: var(--oc-color-background-secondary) !important; } .oc-background-muted { background-color: var(--oc-color-background-muted) !important; } .oc-background-highlight { background-color: var(--oc-color-background-highlight) !important; } .oc-background-contain { background-size: contain; } .oc-background-cover { background-size: cover; } .oc-background-contain, .oc-background-cover { background-position: 50% 50%; background-repeat: no-repeat; }
owncloud/web/packages/design-system/src/styles/theme/background.scss/0
{ "file_path": "owncloud/web/packages/design-system/src/styles/theme/background.scss", "repo_id": "owncloud", "token_count": 501 }
790
--- border: radius: default: value: 4px
owncloud/web/packages/design-system/src/tokens/docs/border.yaml/0
{ "file_path": "owncloud/web/packages/design-system/src/tokens/docs/border.yaml", "repo_id": "owncloud", "token_count": 25 }
791
import { test, expect } from '@playwright/test' const SELECTORS = Object.freeze({ previewWrapper: '[data-testid="preview-wrapper"]', codemirrorHtml: '[data-testid="codemirror-html"]', // We're using class here instead of data attribute because we cannot adjust the default preview component // The class is coming from the specified theme codemirrorVue: '.cm-s-night', tabHtml: '[data-testid="preview-tab-html"]' }) test('Components preview is displayed', async ({ page, baseURL }) => { await page.goto((baseURL || '') + '/#/' + encodeURIComponent('oC Components') + '/OcButton') await expect(page.locator(SELECTORS.previewWrapper)).toBeVisible() await expect(page.locator(SELECTORS.codemirrorVue)).toBeVisible() await page.locator(SELECTORS.tabHtml).click() await expect(page.locator(SELECTORS.codemirrorHtml)).toBeVisible() })
owncloud/web/packages/design-system/tests/e2e/specs/component-example.spec.ts/0
{ "file_path": "owncloud/web/packages/design-system/tests/e2e/specs/component-example.spec.ts", "repo_id": "owncloud", "token_count": 282 }
792
<template> <div> <h2 class="oc-py-s" v-text="$gettext('Info')" /> <table class="details-table"> <tr> <th scope="col" class="oc-pr-s" v-text="$gettext('ownCloud')" /> <td v-text="backendProductName" /> </tr> <tr> <th scope="col" class="oc-pr-s" v-text="$gettext('Edition')" /> <td v-text="backendEdition" /> </tr> <tr> <th scope="col" class="oc-pr-s" v-text="$gettext('Version')" /> <td v-text="backendVersion" /> </tr> <tr> <th scope="col" class="oc-pr-s" v-text="$gettext('Web client version')" /> <td v-text="webClientVersion" /> </tr> </table> </div> </template> <script lang="ts"> import { defineComponent } from 'vue' import { useCapabilityStore } from '@ownclouders/web-pkg' export default defineComponent({ name: 'InfoSection', setup() { const capabilityStore = useCapabilityStore() let backendProductName = '' let backendVersion = '' let backendEdition = '' let webClientVersion = '' const backendStatus = capabilityStore.status if (backendStatus && backendStatus.versionstring) { backendProductName = backendStatus.product || 'ownCloud' backendVersion = backendStatus.productversion || backendStatus.versionstring backendEdition = backendStatus.edition webClientVersion = process.env.PACKAGE_VERSION } return { webClientVersion, backendProductName, backendVersion, backendEdition } } }) </script>
owncloud/web/packages/web-app-admin-settings/src/components/General/InfoSection.vue/0
{ "file_path": "owncloud/web/packages/web-app-admin-settings/src/components/General/InfoSection.vue", "repo_id": "owncloud", "token_count": 628 }
793
<template> <div> <context-action-menu :menu-sections="menuSections" :action-options="{ resources: items }" /> </div> </template> <script lang="ts"> import { useUserActionsEdit, useUserActionsDelete, useUserActionsEditQuota } from '../../composables/actions/users' import { computed, defineComponent, PropType, unref } from 'vue' import { ContextActionMenu } from '@ownclouders/web-pkg' import { User } from '@ownclouders/web-client/src/generated' import { useActionsShowDetails } from '@ownclouders/web-pkg' export default defineComponent({ name: 'ContextActions', components: { ContextActionMenu }, props: { items: { type: Array as PropType<User[]>, required: true } }, setup(props) { const filterParams = computed(() => ({ resources: props.items })) const { actions: showDetailsActions } = useActionsShowDetails() const { actions: editQuotaActions } = useUserActionsEditQuota() const { actions: userEditActions } = useUserActionsEdit() const { actions: userDeleteActions } = useUserActionsDelete() const menuItemsPrimaryActions = computed(() => [...unref(userEditActions), ...unref(userDeleteActions)].filter((item) => item.isVisible(unref(filterParams)) ) ) const menuItemsSecondaryActions = computed(() => [...unref(editQuotaActions)].filter((item) => item.isVisible(unref(filterParams))) ) const menuItemsSidebar = computed(() => [...unref(showDetailsActions)].filter((item) => item.isVisible(unref(filterParams))) ) const menuSections = computed(() => { const sections = [] if (unref(menuItemsPrimaryActions).length) { sections.push({ name: 'primaryActions', items: unref(menuItemsPrimaryActions) }) } if (unref(menuItemsSecondaryActions).length) { sections.push({ name: 'secondaryActions', items: unref(menuItemsSecondaryActions) }) } if (unref(menuItemsSidebar).length) { sections.push({ name: 'sidebar', items: unref(menuItemsSidebar) }) } return sections }) return { menuSections } } }) </script>
owncloud/web/packages/web-app-admin-settings/src/components/Users/ContextActions.vue/0
{ "file_path": "owncloud/web/packages/web-app-admin-settings/src/components/Users/ContextActions.vue", "repo_id": "owncloud", "token_count": 871 }
794
export * from './general' export * from './groups' export * from './users'
owncloud/web/packages/web-app-admin-settings/src/composables/actions/index.ts/0
{ "file_path": "owncloud/web/packages/web-app-admin-settings/src/composables/actions/index.ts", "repo_id": "owncloud", "token_count": 24 }
795
import { defineStore } from 'pinia' import { ref, unref } from 'vue' import { User } from '@ownclouders/web-client/src/generated' export const useUserSettingsStore = defineStore('userSettings', () => { const users = ref<User[]>([]) const selectedUsers = ref<User[]>([]) const setUsers = (data: User[]) => { users.value = data } const upsertUser = (user: User) => { const existing = unref(users).some(({ id }) => id === user.id) if (existing) { Object.assign(existing, user) return } unref(users).push(user) } const removeUsers = (values: User[]) => { users.value = unref(users).filter((user) => !values.find(({ id }) => id === user.id)) } const setSelectedUsers = (data: User[]) => { selectedUsers.value = data } const addSelectedUser = (data: User) => { unref(selectedUsers).push(data) } const reset = () => { users.value = [] selectedUsers.value = [] } return { users, setUsers, upsertUser, removeUsers, reset, selectedUsers, addSelectedUser, setSelectedUsers } }) export type UserSettingsStore = ReturnType<typeof useUserSettingsStore>
owncloud/web/packages/web-app-admin-settings/src/composables/stores/userSettings.ts/0
{ "file_path": "owncloud/web/packages/web-app-admin-settings/src/composables/stores/userSettings.ts", "repo_id": "owncloud", "token_count": 429 }
796
import { defaultComponentMocks, defaultPlugins, defaultStubs, mount } from 'web-test-helpers' import { mock } from 'vitest-mock-extended' import { SpaceResource } from '@ownclouders/web-client/src/helpers' import ContextActions from '../../../../src/components/Spaces/ContextActions.vue' import { Action, useSpaceActionsDisable, useSpaceActionsEditDescription, useSpaceActionsEditQuota, useSpaceActionsRename } from '@ownclouders/web-pkg' import { computed } from 'vue' describe.skip('ContextActions', () => { describe('menu sections', () => { it('do not render when no action enabled', () => { const { wrapper } = getWrapper() expect(wrapper.findAll('action-menu-item-stub').length).toBe(0) }) it('render enabled actions', () => { const enabledComposables = [ useSpaceActionsRename, useSpaceActionsEditDescription, useSpaceActionsEditQuota, useSpaceActionsDisable ] for (const composable of enabledComposables) { vi.mocked(composable).mockImplementation(() => ({ actions: computed(() => [mock<Action>({ isVisible: () => true })]), checkName: null, renameSpace: null, editDescriptionSpace: null, selectedSpace: null, modalOpen: null, closeModal: null, spaceQuotaUpdated: null, disableSpaces: null })) } const { wrapper } = getWrapper() expect(wrapper.findAll('action-menu-item-stub').length).toBe(enabledComposables.length) }) }) }) function getWrapper() { const mocks = { ...defaultComponentMocks() } return { mocks, wrapper: mount(ContextActions, { props: { items: [mock<SpaceResource>()] }, global: { mocks, stubs: { ...defaultStubs, 'action-menu-item': true }, plugins: [...defaultPlugins()] } }) } }
owncloud/web/packages/web-app-admin-settings/tests/unit/components/Spaces/ContextActions.spec.ts/0
{ "file_path": "owncloud/web/packages/web-app-admin-settings/tests/unit/components/Spaces/ContextActions.spec.ts", "repo_id": "owncloud", "token_count": 783 }
797
import UsersList from '../../../../src/components/Users/UsersList.vue' import { defaultComponentMocks, defaultPlugins, mount, shallowMount } from 'web-test-helpers' import { displayPositionedDropdown, eventBus, queryItemAsString } from '@ownclouders/web-pkg' import { SideBarEventTopics } from '@ownclouders/web-pkg' import { useUserSettingsStore } from '../../../../src/composables/stores/userSettings' const getUserMocks = () => [{ id: '1', displayName: 'jan' }] vi.mock('@ownclouders/web-pkg', async (importOriginal) => ({ ...(await importOriginal<any>()), displayPositionedDropdown: vi.fn(), queryItemAsString: vi.fn() })) describe('UsersList', () => { describe('computed method "allUsersSelected"', () => { it('should be true if all users are selected', () => { const { wrapper } = getWrapper({ users: getUserMocks(), selectedUsers: getUserMocks() }) expect(wrapper.vm.allUsersSelected).toBeTruthy() }) it('should be false if not every user is selected', () => { const { wrapper } = getWrapper({ users: getUserMocks(), selectedUsers: [] }) expect(wrapper.vm.allUsersSelected).toBeFalsy() }) }) describe('method "orderBy"', () => { it('should return an ascending ordered list while desc is set to false', () => { const { wrapper } = getWrapper() expect( wrapper.vm.orderBy( [{ displayName: 'user' }, { displayName: 'admin' }], 'displayName', false ) ).toEqual([{ displayName: 'admin' }, { displayName: 'user' }]) }) it('should return an descending ordered list based on role while desc is set to true', () => { const { wrapper } = getWrapper() expect( wrapper.vm.orderBy([{ displayName: 'admin' }, { displayName: 'user' }], 'displayName', true) ).toEqual([{ displayName: 'user' }, { displayName: 'admin' }]) }) it('should return ascending ordered list based on role while desc is set to false', () => { const { wrapper } = getWrapper() expect( wrapper.vm.orderBy( [ { appRoleAssignments: [{ appRoleId: '1' }] }, { appRoleAssignments: [{ appRoleId: '2' }] } ], 'role', false ) ).toEqual([ { appRoleAssignments: [{ appRoleId: '1' }] }, { appRoleAssignments: [{ appRoleId: '2' }] } ]) }) it('should return an role based descending ordered list while desc is set to true', () => { const { wrapper } = getWrapper() expect( wrapper.vm.orderBy( [ { appRoleAssignments: [{ appRoleId: '1' }] }, { appRoleAssignments: [{ appRoleId: '2' }] } ], 'role', true ) ).toEqual([ { appRoleAssignments: [{ appRoleId: '2' }] }, { appRoleAssignments: [{ appRoleId: '1' }] } ]) }) }) it('should show the context menu on right click', async () => { const users = getUserMocks() const spyDisplayPositionedDropdown = vi.mocked(displayPositionedDropdown) const { wrapper } = getWrapper({ mountType: mount, users }) await wrapper.find(`[data-item-id="${users[0].id}"]`).trigger('contextmenu') expect(spyDisplayPositionedDropdown).toHaveBeenCalledTimes(1) }) it('should show the context menu on context menu button click', async () => { const users = getUserMocks() const spyDisplayPositionedDropdown = vi.mocked(displayPositionedDropdown) const { wrapper } = getWrapper({ mountType: mount, users }) await wrapper.find('.users-table-btn-action-dropdown').trigger('click') expect(spyDisplayPositionedDropdown).toHaveBeenCalledTimes(1) }) it('should show the user details on details button click', async () => { const users = getUserMocks() const eventBusSpy = vi.spyOn(eventBus, 'publish') const { wrapper } = getWrapper({ mountType: mount, users }) await wrapper.find('.users-table-btn-details').trigger('click') expect(eventBusSpy).toHaveBeenCalledWith(SideBarEventTopics.open) }) it('should show the user edit panel on edit button click', async () => { const users = getUserMocks() const eventBusSpy = vi.spyOn(eventBus, 'publish') const { wrapper } = getWrapper({ mountType: mount, users }) await wrapper.find('.users-table-btn-edit').trigger('click') expect(eventBusSpy).toHaveBeenCalledWith(SideBarEventTopics.openWithPanel, 'EditPanel') }) describe('toggle selection', () => { describe('selectUsers method', () => { it('selects all users', () => { const users = getUserMocks() const { wrapper } = getWrapper({ mountType: shallowMount, users }) wrapper.vm.selectUsers(users) const { setSelectedUsers } = useUserSettingsStore() expect(setSelectedUsers).toHaveBeenCalledWith(users) }) }) describe('selectUsers method', () => { it('selects a user', () => { const users = getUserMocks() const { wrapper } = getWrapper({ mountType: shallowMount, users: [users[0]] }) wrapper.vm.selectUser(users[0]) const { addSelectedUser } = useUserSettingsStore() expect(addSelectedUser).toHaveBeenCalledWith(users[0]) }) it('de-selects a selected user', () => { const users = getUserMocks() const { wrapper } = getWrapper({ mountType: shallowMount, users: [users[0]], selectedUsers: [users[0]] }) wrapper.vm.selectUser(users[0]) const { setSelectedUsers } = useUserSettingsStore() expect(setSelectedUsers).toHaveBeenCalledWith([]) }) }) describe('unselectAllUsers method', () => { it('de-selects all selected users', () => { const users = getUserMocks() const { wrapper } = getWrapper({ mountType: shallowMount, users: [users[0]], selectedUsers: [users[0]] }) wrapper.vm.unselectAllUsers() const { setSelectedUsers } = useUserSettingsStore() expect(setSelectedUsers).toHaveBeenCalledWith([]) }) }) }) }) function getWrapper({ mountType = shallowMount, users = [], selectedUsers = [] } = {}) { vi.mocked(queryItemAsString).mockImplementationOnce(() => '1') vi.mocked(queryItemAsString).mockImplementationOnce(() => '100') const mocks = defaultComponentMocks() return { wrapper: mountType(UsersList, { props: { roles: [ { displayName: 'Admin', id: '1' }, { displayName: 'Guest', id: '2' }, { displayName: 'Space Admin', id: '3' }, { displayName: 'User', id: '4' } ], headerPosition: 0 }, global: { plugins: [ ...defaultPlugins({ piniaOptions: { userSettingsStore: { users, selectedUsers } } }) ], mocks, provide: mocks, stubs: { OcCheckbox: true } } }) } }
owncloud/web/packages/web-app-admin-settings/tests/unit/components/Users/UsersList.spec.ts/0
{ "file_path": "owncloud/web/packages/web-app-admin-settings/tests/unit/components/Users/UsersList.spec.ts", "repo_id": "owncloud", "token_count": 3011 }
798
import General from '../../../src/views/General.vue' import { defaultPlugins, shallowMount } from 'web-test-helpers' describe('General view', () => { it('renders component', () => { const { wrapper } = getWrapper() expect(wrapper.html()).toMatchSnapshot() }) }) function getWrapper() { return { wrapper: shallowMount(General, { global: { plugins: [...defaultPlugins()] } }) } }
owncloud/web/packages/web-app-admin-settings/tests/unit/views/General.spec.ts/0
{ "file_path": "owncloud/web/packages/web-app-admin-settings/tests/unit/views/General.spec.ts", "repo_id": "owncloud", "token_count": 159 }
799
import { useGettext } from 'vue3-gettext' import translations from '../l10n/translations.json' import EpubReader from './App.vue' import { AppWrapperRoute, defineWebApplication } from '@ownclouders/web-pkg' export default defineWebApplication({ setup() { const { $gettext } = useGettext() const appId = 'epub-reader' const routes = [ { path: '/:driveAliasAndItem(.*)?', component: AppWrapperRoute(EpubReader, { applicationId: appId, fileContentOptions: { responseType: 'blob' } }), name: 'epub-reader', meta: { authContext: 'hybrid', title: $gettext('Epub Reader'), patchCleanPath: true } } ] return { appInfo: { name: $gettext('Epub Reader'), id: appId, icon: 'book-read', extensions: [ { extension: 'epub', routeName: 'epub-reader' } ] }, routes, translations } } })
owncloud/web/packages/web-app-epub-reader/src/index.ts/0
{ "file_path": "owncloud/web/packages/web-app-epub-reader/src/index.ts", "repo_id": "owncloud", "token_count": 510 }
800
<template> <div v-if="showActions" class="create-and-upload-actions oc-flex-inline oc-mr-s"> <template v-if="createFileActionsAvailable"> <span v-oc-tooltip="newButtonTooltip"> <oc-button id="new-file-menu-btn" key="new-file-menu-btn-enabled" v-oc-tooltip="hideButtonLabels ? $gettext('New') : ''" :aria-label="newButtonAriaLabel" appearance="filled" variation="primary" :disabled="uploadOrFileCreationBlocked" > <oc-icon name="add" /> <span v-if="!hideButtonLabels" v-text="$gettext('New')" /> </oc-button> </span> <oc-drop drop-id="new-file-menu-drop" toggle="#new-file-menu-btn" mode="click" close-on-click class="oc-width-auto" padding-size="small" > <oc-list id="create-list" :class="areFileExtensionsShown ? 'expanded-list' : null"> <li class="create-list-folder oc-menu-item-hover"> <oc-button id="new-folder-btn" appearance="raw" @click="createNewFolderAction"> <resource-icon :resource="folderIconResource" size="medium" /> <span v-text="$gettext('Folder')" /> </oc-button> </li> <template v-if="externalFileActions"> <li v-for="(fileAction, key) in externalFileActions" :key="`file-creation-item-external-${key}`" class="create-list-file oc-menu-item-hover" > <oc-button appearance="raw" @click="fileAction.handler"> <resource-icon :resource="getIconResource(fileAction)" size="medium" /> <span class="create-list-file-item-text" v-text="fileAction.label()" /> <span v-if="areFileExtensionsShown && fileAction.ext" class="create-list-file-item-extension" v-text="fileAction.ext" /> </oc-button> </li> </template> <li v-if="externalFileActions.length && appFileActions.length" class="bottom-seperator" /> <li v-for="(fileAction, key) in appFileActions" :key="`file-creation-item-${key}`" class="create-list-file oc-menu-item-hover" > <oc-button appearance="raw" :class="['new-file-btn-' + fileAction.ext]" @click="fileAction.handler" > <resource-icon :resource="getIconResource(fileAction)" size="medium" /> <span class="create-list-file-item-text">{{ fileAction.label() }}</span> <span v-if="areFileExtensionsShown && fileAction.ext" class="create-list-file-item-extension" >{{ fileAction.ext }}</span > </oc-button> </li> <li class="create-list-shortcut oc-menu-item-hover"> <oc-button id="new-shortcut-btn" appearance="raw" @click="createNewShortcutAction"> <oc-icon name="external-link" size="medium" /> <span v-text="$gettext('Shortcut')" /> <span v-if="areFileExtensionsShown" class="create-list-file-item-extension" v-text="'url'" /> </oc-button> </li> </oc-list> </oc-drop> </template> <template v-else> <span v-oc-tooltip="newButtonTooltip"> <oc-button id="new-folder-btn" v-oc-tooltip="hideButtonLabels ? $gettext('New Folder') : ''" appearance="filled" variation="primary" :aria-label="newButtonAriaLabel" :disabled="uploadOrFileCreationBlocked" @click="createNewFolderAction" > <oc-icon name="resource-type-folder" /> <span v-if="!hideButtonLabels" v-text="$gettext('New Folder')" /> </oc-button> </span> </template> <span v-oc-tooltip="uploadButtonTooltip"> <oc-button id="upload-menu-btn" key="upload-menu-btn-enabled" v-oc-tooltip="hideButtonLabels ? $gettext('Upload') : ''" :aria-label="uploadButtonAriaLabel" :disabled="uploadOrFileCreationBlocked" appearance="outline" variation="passive" > <oc-icon name="upload" fill-type="line" /> <span v-if="!hideButtonLabels" v-text="$gettext('Upload')" /> </oc-button> </span> <oc-drop drop-id="upload-menu-drop" toggle="#upload-menu-btn" mode="click" class="oc-width-auto" close-on-click padding-size="small" @show-drop="showDrop" > <oc-list id="upload-list" :class="{ 'oc-pb-s': extensionActions.length }"> <li class="oc-menu-item-hover"> <resource-upload ref="folder-upload" btn-class="oc-width-1-1" /> </li> <li class="oc-menu-item-hover"> <resource-upload ref="file-upload" btn-class="oc-width-1-1" :is-folder="true" /> </li> </oc-list> <oc-list v-if="extensionActions.length" id="extension-list" class="oc-pt-s"> <li v-for="(action, key) in extensionActions" :key="`${key}-${actionKeySuffix}`" v-oc-tooltip=" isActionDisabled(action) && action.disabledTooltip ? action.disabledTooltip() : null " class="oc-menu-item-hover" > <oc-button class="oc-width-1-1" :class="action.class" appearance="raw" justify-content="left" :disabled="isActionDisabled(action)" @click="action.handler" > <oc-icon :name="action.icon" fill-type="line" /> <span v-text="action.label()" /></oc-button> </li> </oc-list> </oc-drop> <div v-if="showPasteHereButton" id="clipboard-btns" v-oc-tooltip=" uploadOrFileCreationBlocked ? $gettext('You have no permission to paste files here!') : '' " class="oc-button-group" :class="{ disabled: uploadOrFileCreationBlocked }" > <oc-button :disabled="uploadOrFileCreationBlocked" class="paste-files-btn" @click="pasteFileAction({ space })" > <oc-icon fill-type="line" name="clipboard" /> <span v-text="$gettext('Paste here')" /> </oc-button> <oc-button :disabled="uploadOrFileCreationBlocked" class="clear-clipboard-btn" @click="clearClipboard" > <oc-icon fill-type="line" name="close" /> </oc-button> </div> </div> </template> <script lang="ts"> import { isLocationPublicActive, isLocationSpacesActive, useClipboardStore, useFileActions, useFileActionsCreateNewShortcut, useMessages, useResourcesStore, useSpacesStore, useUserStore } from '@ownclouders/web-pkg' import { useActiveLocation } from '@ownclouders/web-pkg' import { useFileActionsCreateNewFile, useFileActionsCreateNewFolder, useFileActionsPaste, useRequest, useClientService } from '@ownclouders/web-pkg' import ResourceUpload from './Upload/ResourceUpload.vue' import { computed, defineComponent, onMounted, onBeforeUnmount, PropType, unref, watch, ref } from 'vue' import { eventBus } from '@ownclouders/web-pkg' import { Resource, SpaceResource, isPublicSpaceResource, isShareSpaceResource } from '@ownclouders/web-client/src/helpers' import { useService, useUpload, UppyService, UppyResource } from '@ownclouders/web-pkg' import { HandleUpload } from 'web-app-files/src/HandleUpload' import { useRoute } from 'vue-router' import { useGettext } from 'vue3-gettext' import { ActionExtension, useExtensionRegistry } from '@ownclouders/web-pkg' import { Action, ResourceIcon } from '@ownclouders/web-pkg' import { v4 as uuidv4 } from 'uuid' import { storeToRefs } from 'pinia' export default defineComponent({ components: { ResourceIcon, ResourceUpload }, props: { space: { type: Object as PropType<SpaceResource>, required: true }, item: { type: String, required: false, default: null }, limitedScreenSpace: { type: Boolean, default: false, required: false }, itemId: { type: [String, Number], required: false, default: null } }, setup(props) { const uppyService = useService<UppyService>('$uppyService') const clientService = useClientService() const userStore = useUserStore() const spacesStore = useSpacesStore() const messageStore = useMessages() const route = useRoute() const language = useGettext() const clipboardStore = useClipboardStore() const { clearClipboard } = clipboardStore const { resources: clipboardResources } = storeToRefs(clipboardStore) const resourcesStore = useResourcesStore() const { currentFolder } = storeToRefs(resourcesStore) const areFileExtensionsShown = computed(() => unref(resourcesStore.areFileExtensionsShown)) useUpload({ uppyService }) if (!uppyService.getPlugin('HandleUpload')) { uppyService.addPlugin(HandleUpload, { clientService, language, route, space: props.space, userStore, spacesStore, messageStore, resourcesStore, uppyService }) } let uploadCompletedSub: string const { actions: pasteFileActions } = useFileActionsPaste() const pasteFileAction = unref(pasteFileActions)[0].handler const { actions: createNewFolder } = useFileActionsCreateNewFolder({ space: props.space }) const createNewFolderAction = computed(() => unref(createNewFolder)[0].handler) const { actions: createNewShortcut } = useFileActionsCreateNewShortcut({ space: props.space }) const createNewShortcutAction = computed(() => unref(createNewShortcut)[0].handler) const { actions: createNewFileActions } = useFileActionsCreateNewFile({ space: props.space }) const appFileActions = computed(() => unref(createNewFileActions).filter(({ isExternal }) => !isExternal) ) const externalFileActions = computed(() => unref(createNewFileActions).filter(({ isExternal }) => isExternal) ) const extensionRegistry = useExtensionRegistry() const extensionActions = computed(() => { return [ ...extensionRegistry .requestExtensions<ActionExtension>('action', ['upload-menu']) .map((e) => e.action) ].filter((e) => e.isVisible()) }) const canUpload = computed(() => { return unref(currentFolder)?.canUpload({ user: userStore.user }) }) const actionKeySuffix = ref(uuidv4()) const showDrop = () => { // force actions to be re-rendered when the drop is being opened actionKeySuffix.value = uuidv4() } const isActionDisabled = (action: Action) => { return action.isDisabled ? action.isDisabled() : false } const handlePasteFileEvent = (event) => { // Ignore file in clipboard if there are already files from owncloud in the clipboard if (unref(clipboardResources).length || !unref(canUpload)) { return } // Browsers only allow single files to be pasted for security reasons const items = (event.clipboardData || event.originalEvent.clipboardData).items const fileItem = [...items].find((i) => i.kind === 'file') if (!fileItem) { return } const file = fileItem.getAsFile() uppyService.addFiles([file]) event.preventDefault() } const onUploadComplete = async (result) => { if (result.successful) { const file = result.successful[0] as UppyResource if (!file) { return } const { spaceId, currentFolder, currentFolderId, driveType } = file.meta if (!isPublicSpaceResource(props.space)) { const isOwnSpace = spacesStore.spaces .find(({ id }) => id === spaceId) ?.isOwner(userStore.user) if (driveType === 'project' || isOwnSpace) { const client = clientService.graphAuthenticated const driveResponse = await client.drives.getDrive(spaceId) spacesStore.updateSpaceField({ id: driveResponse.data.id, field: 'spaceQuota', value: driveResponse.data.quota }) } } const sameFolder = props.itemId && !isShareSpaceResource(props.space) ? props.itemId.toString().startsWith(currentFolderId.toString()) : currentFolder === props.item const fileIsInCurrentPath = spaceId === props.space.id && sameFolder if (fileIsInCurrentPath) { eventBus.publish('app.files.list.load') } } } onMounted(() => { uploadCompletedSub = uppyService.subscribe('uploadCompleted', onUploadComplete) document.addEventListener('paste', handlePasteFileEvent) }) onBeforeUnmount(() => { uppyService.removePlugin(uppyService.getPlugin('HandleUpload')) uppyService.unsubscribe('uploadCompleted', uploadCompletedSub) uppyService.removeDropTarget() document.removeEventListener('paste', handlePasteFileEvent) }) watch( canUpload, () => { if (unref(canUpload)) { uppyService.useDropTarget({ targetSelector: '#files-view' }) } else { uppyService.removeDropTarget() } }, { immediate: true } ) return { ...useFileActions(), ...useRequest(), clientService, isPublicLocation: useActiveLocation(isLocationPublicActive, 'files-public-link'), isSpacesGenericLocation: useActiveLocation(isLocationSpacesActive, 'files-spaces-generic'), canUpload, currentFolder, createNewFolder, appFileActions, externalFileActions, createNewFolderAction, createNewShortcutAction, extensionActions, pasteFileAction, isActionDisabled, actionKeySuffix, showDrop, areFileExtensionsShown, clearClipboard, clipboardResources, // HACK: exported for unit tests: onUploadComplete } }, computed: { showPasteHereButton() { return this.clipboardResources && this.clipboardResources.length !== 0 }, hideButtonLabels() { return this.limitedScreenSpace && this.showPasteHereButton }, showActions() { return !(this.uploadOrFileCreationBlocked && this.isPublicLocation) }, createFileActionsAvailable() { return this.appFileActions.length > 0 || this.externalFileActions.length > 0 }, newButtonTooltip() { if (!this.canUpload) { return this.$gettext('You have no permission to create new files!') } return null }, newButtonAriaLabel() { const tooltip = this.newButtonTooltip if (tooltip) { return tooltip } if (!this.createFileActionsAvailable) { return this.$gettext('New folder') } return this.$gettext('Create new files or folders') }, uploadButtonTooltip() { if (!this.canUpload) { return this.$gettext('You have no permission to upload!') } return null }, uploadButtonAriaLabel() { const tooltip = this.uploadButtonTooltip if (tooltip) { return tooltip } return this.$gettext('Upload files or folders') }, uploadOrFileCreationBlocked() { return !this.canUpload }, loadIndicatorsForNewFile() { return this.isSpacesGenericLocation && this.space.driveType !== 'share' }, folderIconResource() { return { isFolder: true, extension: '' } as Resource } }, methods: { getIconResource(fileHandler) { return { type: 'file', extension: fileHandler.ext } as Resource } } }) </script> <style lang="scss"> #create-list { li { border: 1px solid transparent; button { display: inline-flex; gap: 10px; justify-content: left; width: 100%; } } .create-list-folder { border-bottom: 1px solid var(--oc-color-border); } .create-list-folder button { margin-bottom: 8px; } .create-list-file:nth-child(2) button { margin-top: 6px; } } .create-list { &-file-item { &-text { display: inline-flex; text-align: left; justify-content: flex-start; } &-extension { display: inline-flex; text-align: left; justify-content: right; flex: 1; font-weight: normal !important; font-size: var(--oc-font-size-small); opacity: 0.7; } } } #upload-list, #new-file-menu-drop { min-width: 230px; } .expanded-list { min-width: 280px !important; } #create-list, #upload-list, #new-file-menu-drop { .oc-icon-m svg { height: 100% !important; } } #extension-list { border-top: 1px solid var(--oc-color-border); } .bottom-seperator { border-bottom: 1px solid var(--oc-color-border) !important; margin-bottom: 8px; } #clipboard-btns { flex-flow: inherit; :nth-child(1) { border-right: 0px !important; white-space: nowrap; } :nth-child(2) { border-left: 0px !important; } } #clipboard-btns.disabled { opacity: 0.6; button { opacity: 1; } } .create-and-upload-actions { gap: var(--oc-space-small); } </style>
owncloud/web/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue/0
{ "file_path": "owncloud/web/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue", "repo_id": "owncloud", "token_count": 7662 }
801
<template> <div id="oc-file-details-sidebar"> <div v-if="hasContent"> <div v-if="isPreviewLoading || preview" key="file-thumbnail" :style="{ 'background-image': isPreviewLoading ? 'none' : `url(${preview})` }" class="details-preview oc-flex oc-flex-middle oc-flex-center oc-mb" data-testid="preview" > <oc-spinner v-if="isPreviewLoading" /> </div> <div v-else class="details-icon-wrapper oc-width-1-1 oc-flex oc-flex-middle oc-flex-center oc-mb" > <resource-icon class="details-icon" :resource="resource" size="xxxlarge" /> </div> <div v-if="!publicLinkContextReady && shareIndicators.length" key="file-shares" data-testid="sharingInfo" class="oc-flex oc-flex-middle oc-my-m" > <oc-status-indicators :resource="resource" :indicators="shareIndicators" /> <p class="oc-my-rm oc-mx-s" v-text="detailSharingInformation" /> </div> <table class="details-table oc-width-1-1" :aria-label="$gettext('Overview of the information about the selected file')" > <col class="oc-width-1-3" /> <col class="oc-width-2-3" /> <tr v-if="hasDeletionDate" data-testid="delete-timestamp"> <th scope="col" class="oc-pr-s oc-font-semibold" v-text="$gettext('Deleted at')" /> <td> <span v-text="capitalizedDeletionDate"></span> </td> </tr> <tr v-if="hasTimestamp" data-testid="timestamp"> <th scope="col" class="oc-pr-s oc-font-semibold" v-text="$gettext('Last modified')" /> <td> <oc-button v-if="showVersions" v-oc-tooltip="seeVersionsLabel" appearance="raw" :aria-label="seeVersionsLabel" @click="expandVersionsPanel" > {{ capitalizedTimestamp }} </oc-button> <span v-else v-text="capitalizedTimestamp" /> </td> </tr> <tr v-if="resource.locked" data-testid="locked-by"> <th scope="col" class="oc-pr-s oc-font-semibold" v-text="$gettext('Locked by')" /> <td> <span>{{ resource.lockOwnerName }} ({{ formatDateRelative(resource.lockTime) }})</span> </td> </tr> <tr v-if="showSharedVia" data-testid="shared-via"> <th scope="col" class="oc-pr-s oc-font-semibold" v-text="$gettext('Shared via')" /> <td> <router-link :to="sharedAncestorRoute"> <span v-oc-tooltip="sharedViaTooltip" v-text="sharedAncestor.path" /> </router-link> </td> </tr> <tr v-if="showSharedBy" data-testid="shared-by"> <th scope="col" class="oc-pr-s oc-font-semibold" v-text="$gettext('Shared by')" /> <td> <span v-text="sharedByDisplayNames" /> </td> </tr> <tr v-if="ownerDisplayName && ownerDisplayName !== sharedByDisplayNames" data-testid="ownerDisplayName" > <th scope="col" class="oc-pr-s oc-font-semibold" v-text="$gettext('Owner')" /> <td> <p class="oc-m-rm"> {{ ownerDisplayName }} <span v-if="ownedByCurrentUser" v-translate>(me)</span> </p> </td> </tr> <tr v-if="showSize" data-testid="sizeInfo"> <th scope="col" class="oc-pr-s oc-font-semibold" v-text="$gettext('Size')" /> <td v-text="resourceSize" /> </tr> <web-dav-details v-if="showWebDavDetails" :space="space" /> <tr v-if="showVersions" data-testid="versionsInfo"> <th scope="col" class="oc-pr-s oc-font-semibold" v-text="$gettext('Versions')" /> <td> <oc-button v-oc-tooltip="seeVersionsLabel" appearance="raw" :aria-label="seeVersionsLabel" @click="expandVersionsPanel" > {{ versions.length }} </oc-button> </td> </tr> <portal-target name="app.files.sidebar.file.details.table" :slot-props="{ space, resource }" :multiple="true" /> <tr v-if="hasTags" data-testid="tags"> <th scope="col" class="oc-pr-s oc-font-semibold"> {{ $gettext('Tags') }} <oc-contextual-helper v-if="contextualHelper?.isEnabled" v-bind="contextualHelper?.data" class="oc-pl-xs" ></oc-contextual-helper> </th> <td> <tags-select :resource="resource"></tags-select> </td> </tr> </table> </div> <p v-else data-testid="noContentText" v-text="$gettext('No information to display')" /> </div> </template> <script lang="ts"> import { storeToRefs } from 'pinia' import { computed, defineComponent, inject, Ref, ref, unref, watch } from 'vue' import { ImageDimension, useAuthStore, useUserStore, useCapabilityStore, useConfigStore, useClientService, useResourcesStore, formatDateFromJSDate } from '@ownclouders/web-pkg' import upperFirst from 'lodash-es/upperFirst' import { isShareResource, ShareTypes } from '@ownclouders/web-client/src/helpers/share' import { usePreviewService, useGetMatchingSpace } from '@ownclouders/web-pkg' import { getIndicators } from '@ownclouders/web-pkg' import { formatDateFromHTTP, formatFileSize, formatRelativeDateFromJSDate } from '@ownclouders/web-pkg' import { eventBus } from '@ownclouders/web-pkg' import { SideBarEventTopics } from '@ownclouders/web-pkg' import { Resource, SpaceResource } from '@ownclouders/web-client' import { useTask } from 'vue-concurrency' import { useGettext } from 'vue3-gettext' import { getSharedAncestorRoute } from '@ownclouders/web-pkg' import { ResourceIcon } from '@ownclouders/web-pkg' import { tagsHelper } from '../../../helpers/contextualHelpers' import { ContextualHelper } from '@ownclouders/design-system/src/helpers' import TagsSelect from './TagsSelect.vue' import { WebDavDetails } from '@ownclouders/web-pkg' export default defineComponent({ name: 'FileDetails', components: { ResourceIcon, TagsSelect, WebDavDetails }, props: { previewEnabled: { type: Boolean, required: false, default: true }, tagsEnabled: { type: Boolean, required: false, default: true }, versionsEnabled: { type: Boolean, required: false, default: true } }, setup(props) { const configStore = useConfigStore() const userStore = useUserStore() const capabilityStore = useCapabilityStore() const clientService = useClientService() const { getMatchingSpace } = useGetMatchingSpace() const language = useGettext() const resourcesStore = useResourcesStore() const { ancestorMetaData } = storeToRefs(resourcesStore) const { user } = storeToRefs(userStore) const resource = inject<Ref<Resource>>('resource') const space = inject<Ref<SpaceResource>>('space') const previewService = usePreviewService() const preview = ref(undefined) const authStore = useAuthStore() const { publicLinkContextReady } = storeToRefs(authStore) const versions = ref<Resource[]>([]) const loadVersions = async (fileId: Resource['fileId']) => { try { versions.value = await clientService.webdav.listFileVersions(fileId) } catch (e) { console.error(e) } } const isPreviewEnabled = computed(() => { if (unref(resource).isFolder) { return false } return props.previewEnabled }) const loadPreviewTask = useTask(function* (signal, resource) { if (!unref(isPreviewEnabled)) { preview.value = undefined return } preview.value = yield previewService.loadPreview({ space: unref(space), resource, dimensions: ImageDimension.Preview }) }).restartable() const isPreviewLoading = computed(() => { if (!unref(isPreviewEnabled)) { return false } return loadPreviewTask.isRunning || !loadPreviewTask.last }) const sharedAncestor = computed(() => { return Object.values(unref(ancestorMetaData)).find( (a) => a.path !== unref(resource).path && ShareTypes.containsAnyValue(ShareTypes.authenticated, a.shareTypes) ) }) const sharedAncestorRoute = computed(() => { return getSharedAncestorRoute({ sharedAncestor: unref(sharedAncestor), matchingSpace: unref(space) || getMatchingSpace(unref(resource)) }) }) const showWebDavDetails = computed(() => { /** * webDavPath might not be set when user is navigating on public link, * even if the user is authenticated and the file owner. */ return resourcesStore.areWebDavDetailsShown && unref(resource).webDavPath }) const formatDateRelative = (date) => { return formatRelativeDateFromJSDate(new Date(date), language.current) } watch( resource, () => { if (unref(resource)) { loadPreviewTask.perform(unref(resource)) if ( props.versionsEnabled && !unref(resource).isFolder && !unref(publicLinkContextReady) ) { loadVersions(unref(resource).fileId) } } }, { immediate: true } ) const contextualHelper = { isEnabled: configStore.options.contextHelpers, data: tagsHelper({ configStore }) } as ContextualHelper const hasTags = computed(() => { return props.tagsEnabled && capabilityStore.filesTags }) const hasDeletionDate = computed(() => { return unref(resource).ddate }) const capitalizedDeletionDate = computed(() => { const displayDate = formatDateFromJSDate(new Date(unref(resource).ddate), language.current) return upperFirst(displayDate) }) return { user, preview, publicLinkContextReady, space, resource, hasTags, hasDeletionDate, capitalizedDeletionDate, isPreviewLoading, ancestorMetaData, sharedAncestor, sharedAncestorRoute, formatDateRelative, contextualHelper, showWebDavDetails, versions } }, computed: { hasContent() { return ( this.hasTimestamp || this.ownerDisplayName || this.showSize || this.showShares || this.showVersions || this.hasDeletionDate ) }, sharedViaTooltip() { return this.$gettext( "Navigate to '%{folder}'", { folder: this.sharedAncestor.path || '' }, true ) }, showSharedBy() { return this.showShares && !this.ownedByCurrentUser && this.sharedByDisplayNames }, showSharedVia() { return this.showShares && this.sharedAncestor }, showShares() { if (this.publicLinkContextReady) { return false } return this.hasAnyShares }, detailSharingInformation() { if (this.resource.type === 'folder') { return this.$gettext('This folder has been shared.') } return this.$gettext('This file has been shared.') }, hasTimestamp() { return this.resource.mdate?.length > 0 }, ownerDisplayName() { return this.resource.owner?.displayName }, resourceSize() { return formatFileSize(this.resource.size, this.$language.current) }, showSize() { return this.resourceSize !== '?' }, showVersions() { if (this.resource.type === 'folder' || this.publicLinkContextReady) { return } return this.versions.length > 0 }, seeVersionsLabel() { return this.$gettext('See all versions') }, capitalizedTimestamp() { const displayDate = formatDateFromHTTP(this.resource.mdate, this.$language.current) return upperFirst(displayDate) }, hasAnyShares() { return ( this.resource.shareTypes?.length > 0 || this.resource.indicators?.length > 0 || this.sharedAncestor ) }, ownedByCurrentUser() { return this.resource.owner?.id === this.user?.id }, shareIndicators() { return getIndicators({ resource: this.resource, ancestorMetaData: this.ancestorMetaData }) }, sharedByDisplayNames() { if (!isShareResource(this.resource)) { return '' } return this.resource.sharedBy?.map(({ displayName }) => displayName).join(', ') } }, methods: { expandVersionsPanel() { eventBus.publish(SideBarEventTopics.setActivePanel, 'versions') } } }) </script> <style lang="scss" scoped> .details-table { text-align: left; table-layout: fixed; tr { height: 1.5rem; } } .details-preview, .details-icon-wrapper { background-color: var(--oc-color-background-muted); border: 10px solid var(--oc-color-background-muted); height: 230px; background-size: contain; background-repeat: no-repeat; background-position: center; } .details-icon > svg { height: 192px !important; max-height: 192px !important; max-width: 192px !important; width: 192px !important; } </style>
owncloud/web/packages/web-app-files/src/components/SideBar/Details/FileDetails.vue/0
{ "file_path": "owncloud/web/packages/web-app-files/src/components/SideBar/Details/FileDetails.vue", "repo_id": "owncloud", "token_count": 5876 }
802
<template> <div class="oc-mb-s oc-width-1-1"> <h4 class="oc-text-truncate oc-text-normal oc-files-file-link-name oc-m-rm" v-text="linkName" /> <div class="oc-flex oc-flex-middle oc-flex-between oc-width-1-1 oc-p-xs link-name-container"> <div v-if="copied" class="oc-flex oc-flex-middle oc-text-truncate"> <oc-icon variation="success" name="checkbox-circle" /> <p class="oc-files-file-link-url url-copied oc-ml-s oc-my-rm" v-text="copiedLabel" /> </div> <div v-else class="oc-flex oc-flex-middle oc-text-truncate"> <oc-icon name="link" fill-type="line" /> <p v-oc-tooltip="linkShare.webUrl" class="oc-files-file-link-url oc-ml-s oc-text-truncate oc-my-rm" v-text="linkShare.webUrl" /> </div> <oc-button v-if="isClipboardCopySupported" v-oc-tooltip="copyBtnHint" :aria-label="copyBtnHint" size="small" class="oc-files-public-link-copy-url oc-ml-xs" @click="copyLinkToClipboard" > {{ copyBtnLabel }} </oc-button> </div> </div> </template> <script lang="ts"> import { defineComponent, PropType } from 'vue' import { useMessages } from '@ownclouders/web-pkg' import { useClipboard } from '@vueuse/core' import { useGettext } from 'vue3-gettext' import { LinkShare } from '@ownclouders/web-client/src/helpers' export default defineComponent({ name: 'NameAndCopy', props: { linkShare: { type: Object as PropType<LinkShare>, required: true } }, setup(props) { const { $gettext } = useGettext() const { showMessage } = useMessages() const { copy, copied, isSupported: isClipboardCopySupported } = useClipboard({ legacy: true, copiedDuring: 550 }) const copyLinkToClipboard = () => { copy(props.linkShare.webUrl) showMessage({ title: props.linkShare.isQuickLink ? $gettext('The link has been copied to your clipboard.') : $gettext('The link "%{linkName}" has been copied to your clipboard.', { linkName: props.linkShare.displayName }) }) } return { copied, copyLinkToClipboard, isClipboardCopySupported } }, computed: { linkName() { return this.linkShare.displayName }, copyBtnLabel() { return this.$gettext('Copy') }, copyBtnHint() { return this.$gettext('Copy link to clipboard') }, copiedLabel() { return this.$gettext('Copied') } } }) </script> <style lang="scss" scoped> .url-copied { color: var(--oc-color-swatch-success-default); } </style>
owncloud/web/packages/web-app-files/src/components/SideBar/Shares/Links/NameAndCopy.vue/0
{ "file_path": "owncloud/web/packages/web-app-files/src/components/SideBar/Shares/Links/NameAndCopy.vue", "repo_id": "owncloud", "token_count": 1207 }
803
import { Key, KeyboardActions, ModifierKey, useClipboardStore, useResourcesStore } from '@ownclouders/web-pkg' export const useKeyboardTableActions = (keyActions: KeyboardActions) => { const resourcesStore = useResourcesStore() const { copyResources } = useClipboardStore() keyActions.bindKeyAction({ modifier: ModifierKey.Ctrl, primary: Key.C }, () => { copyResources(resourcesStore.selectedResources) }) }
owncloud/web/packages/web-app-files/src/composables/keyboardActions/useKeyboardTableActions.ts/0
{ "file_path": "owncloud/web/packages/web-app-files/src/composables/keyboardActions/useKeyboardTableActions.ts", "repo_id": "owncloud", "token_count": 136 }
804
import App from './App.vue' import Favorites from './views/Favorites.vue' import FilesDrop from './views/FilesDrop.vue' import SharedWithMe from './views/shares/SharedWithMe.vue' import SharedWithOthers from './views/shares/SharedWithOthers.vue' import SharedViaLink from './views/shares/SharedViaLink.vue' import SpaceDriveResolver from './views/spaces/DriveResolver.vue' import SpaceProjects from './views/spaces/Projects.vue' import TrashOverview from './views/trash/Overview.vue' import translations from '../l10n/translations.json' import { defineWebApplication, useCapabilityStore, useSpacesStore, useUserStore } from '@ownclouders/web-pkg' import { extensions } from './extensions' import { buildRoutes } from '@ownclouders/web-pkg' import { AppNavigationItem } from '@ownclouders/web-pkg' // dirty: importing view from other extension within project import SearchResults from '../../web-app-search/src/views/List.vue' import { isPersonalSpaceResource, isShareSpaceResource } from '@ownclouders/web-client/src/helpers' // just a dummy function to trick gettext tools function $gettext(msg) { return msg } const appInfo = { name: $gettext('Files'), id: 'files', icon: 'resource-type-folder', color: 'var(--oc-color-swatch-primary-muted)', isFileEditor: false, extensions: [] } export const navItems = (context): AppNavigationItem[] => { const spacesStores = useSpacesStore() const userStore = useUserStore() const capabilityStore = useCapabilityStore() return [ { name() { return $gettext('Personal') }, icon: appInfo.icon, route: { path: `/${appInfo.id}/spaces/personal` }, isActive: () => { return !spacesStores.currentSpace || spacesStores.currentSpace?.isOwner(userStore.user) }, isVisible() { if (!spacesStores.spacesInitialized) { return true } return !!spacesStores.spaces.find( (drive) => isPersonalSpaceResource(drive) && drive.isOwner(userStore.user) ) }, priority: 10 }, { name: $gettext('Favorites'), icon: 'star', route: { path: `/${appInfo.id}/favorites` }, isVisible() { return capabilityStore.filesFavorites && context.$ability.can('read', 'Favorite') }, priority: 20 }, { name: $gettext('Shares'), icon: 'share-forward', route: { path: `/${appInfo.id}/shares` }, isActive: () => { const space = spacesStores.currentSpace // last check is when fullShareOwnerPaths is enabled return !space || isShareSpaceResource(space) || !space?.isOwner(userStore.user) }, activeFor: [ { path: `/${appInfo.id}/spaces/share` }, { path: `/${appInfo.id}/spaces/personal` } ], isVisible() { return capabilityStore.sharingApiEnabled !== false }, priority: 30 }, { name: $gettext('Spaces'), icon: 'layout-grid', route: { path: `/${appInfo.id}/spaces/projects` }, activeFor: [{ path: `/${appInfo.id}/spaces/project` }], isVisible() { return capabilityStore.spacesProjects }, priority: 40 }, { name: $gettext('Deleted files'), icon: 'delete-bin-5', route: { path: `/${appInfo.id}/trash/overview` }, activeFor: [{ path: `/${appInfo.id}/trash` }], isVisible() { return capabilityStore.davTrashbin === '1.0' && capabilityStore.filesUndelete }, priority: 50 } ] } export default defineWebApplication({ setup() { const userStore = useUserStore() return { appInfo: { ...appInfo, applicationMenu: { enabled: () => { return !!userStore.user }, priority: 10 } }, routes: buildRoutes({ App, Favorites, FilesDrop, SearchResults, Shares: { SharedViaLink, SharedWithMe, SharedWithOthers }, Spaces: { DriveResolver: SpaceDriveResolver, Projects: SpaceProjects }, Trash: { Overview: TrashOverview } }), navItems, translations, extensions: extensions() } } })
owncloud/web/packages/web-app-files/src/index.ts/0
{ "file_path": "owncloud/web/packages/web-app-files/src/index.ts", "repo_id": "owncloud", "token_count": 1878 }
805
<template> <div class="oc-flex"> <files-view-wrapper> <app-bar ref="appBarRef" :view-modes="viewModes" :is-side-bar-open="isSideBarOpen" /> <app-loading-spinner v-if="areResourcesLoading" /> <template v-else> <no-content-message v-if="isEmpty" id="files-favorites-empty" class="files-empty" icon="star" > <template #message> <span v-translate>There are no resources marked as favorite</span> </template> </no-content-message> <component :is="folderView.component" v-else v-model:selectedIds="selectedResourcesIds" :is-side-bar-open="isSideBarOpen" :are-paths-displayed="true" :are-thumbnails-displayed="displayThumbnails" :resources="paginatedResources" :header-position="fileListHeaderY" :sort-by="sortBy" :sort-dir="sortDir" :style="folderViewStyle" v-bind="folderView.componentAttrs?.()" @file-click="triggerDefaultAction" @row-mounted="rowMounted" @sort="handleSort" > <template #quickActions="props"> <quick-actions class="oc-visible@s" :item="props.resource" /> </template> <template #contextMenu="{ resource }"> <context-actions v-if="isResourceInSelection(resource)" :action-options="{ space: getMatchingSpace(resource), resources: selectedResources }" /> </template> <template #footer> <pagination :pages="paginationPages" :current-page="paginationPage" /> <list-info v-if="paginatedResources.length > 0" class="oc-width-1-1 oc-my-s" :files="totalResourcesCount.files" :folders="totalResourcesCount.folders" :size="totalResourcesSize" /> </template> </component> </template> </files-view-wrapper> <file-side-bar :is-open="isSideBarOpen" :active-panel="sideBarActivePanel" :space="selectedResourceSpace" /> </div> </template> <script lang="ts"> import { computed, defineComponent, onBeforeUnmount, onMounted, ref } from 'vue' import { debounce } from 'lodash-es' import { Resource } from '@ownclouders/web-client' import { FolderViewExtension, VisibilityObserver, useExtensionRegistry, useConfigStore, useResourcesStore } from '@ownclouders/web-pkg' import { ImageDimension } from '@ownclouders/web-pkg' import { AppLoadingSpinner } from '@ownclouders/web-pkg' import { FileSideBar, NoContentMessage } from '@ownclouders/web-pkg' import { Pagination } from '@ownclouders/web-pkg' import { eventBus } from '@ownclouders/web-pkg' import { useGetMatchingSpace } from '@ownclouders/web-pkg' import { AppBar } from '@ownclouders/web-pkg' import QuickActions from '../components/FilesList/QuickActions.vue' import ListInfo from '../components/FilesList/ListInfo.vue' import { ContextActions } from '@ownclouders/web-pkg' import { ResourceTable } from '@ownclouders/web-pkg' import FilesViewWrapper from '../components/FilesViewWrapper.vue' import { useResourcesViewDefaults } from '../composables' import { useFileActions } from '@ownclouders/web-pkg' import { storeToRefs } from 'pinia' import { unref } from 'vue' import { ComponentPublicInstance } from 'vue' const visibilityObserver = new VisibilityObserver() export default defineComponent({ components: { FilesViewWrapper, AppBar, FileSideBar, ResourceTable, QuickActions, AppLoadingSpinner, Pagination, NoContentMessage, ListInfo, ContextActions }, setup() { const { getMatchingSpace } = useGetMatchingSpace() const configStore = useConfigStore() const { options: configOptions } = storeToRefs(configStore) const resourcesStore = useResourcesStore() const { updateResourceField } = resourcesStore const { totalResourcesCount, totalResourcesSize } = storeToRefs(resourcesStore) const resourcesViewDefaults = useResourcesViewDefaults<Resource, any, any[]>() const extensionRegistry = useExtensionRegistry() const viewModes = computed(() => { return [ ...extensionRegistry .requestExtensions<FolderViewExtension>('folderView', ['favorite']) .map((e) => e.folderView) ] }) const folderView = computed(() => { const viewMode = unref(resourcesViewDefaults.viewMode) return unref(viewModes).find((v) => v.name === viewMode) }) const appBarRef = ref<ComponentPublicInstance | null>() const folderViewStyle = computed(() => { return { ...(unref(folderView)?.isScrollable === false && { height: `calc(100% - ${unref(appBarRef)?.$el.getBoundingClientRect().height}px)` }) } }) const loadResourcesEventToken = ref(null) onMounted(() => { loadResourcesEventToken.value = eventBus.subscribe( 'app.files.list.removeFromFavorites', (resourceId: string) => { resourcesStore.removeResources([{ id: resourceId }] as Resource[]) } ) }) onBeforeUnmount(() => { visibilityObserver.disconnect() eventBus.unsubscribe('app.files.list.removeFromFavorites', unref(loadResourcesEventToken)) }) return { ...useFileActions(), ...resourcesViewDefaults, configOptions, getMatchingSpace, viewModes, updateResourceField, totalResourcesCount, totalResourcesSize, appBarRef, folderView, folderViewStyle } }, computed: { isEmpty() { return this.paginatedResources.length < 1 }, displayThumbnails() { return !this.configOptions.disablePreviews } }, async created() { await this.loadResourcesTask.perform() this.scrollToResourceFromRoute(this.paginatedResources, 'files-app-bar') }, methods: { rowMounted(resource: Resource, component) { if (!this.displayThumbnails) { return } const loadPreview = async () => { const preview = await this.$previewService.loadPreview( { space: this.getMatchingSpace(resource), resource, dimensions: ImageDimension.Thumbnail }, true ) if (preview) { this.updateResourceField({ id: resource.id, field: 'thumbnail', value: preview }) } } const debounced = debounce(({ unobserve }) => { unobserve() loadPreview() }, 250) visibilityObserver.observe(component.$el, { onEnter: debounced, onExit: debounced.cancel }) } } }) </script>
owncloud/web/packages/web-app-files/src/views/Favorites.vue/0
{ "file_path": "owncloud/web/packages/web-app-files/src/views/Favorites.vue", "repo_id": "owncloud", "token_count": 2804 }
806
import CreateAndUpload from 'web-app-files/src/components/AppBar/CreateAndUpload.vue' import { mock } from 'vitest-mock-extended' import { Resource, SpaceResource } from '@ownclouders/web-client/src/helpers' import { Drive } from '@ownclouders/web-client/src/generated' import { FileAction, useFileActionsCreateNewFile, useRequest, useSpacesStore, CapabilityStore, useClipboardStore, useFileActionsPaste } from '@ownclouders/web-pkg' import { eventBus, UppyResource } from '@ownclouders/web-pkg' import { defaultPlugins, shallowMount, defaultComponentMocks, mockAxiosResolve } from 'web-test-helpers' import { RouteLocation } from 'vue-router' import { useExtensionRegistry } from '@ownclouders/web-pkg' import { useExtensionRegistryMock } from 'web-test-helpers/src/mocks/useExtensionRegistryMock' import { ref } from 'vue' import { OcButton } from 'design-system/src/components' vi.mock('@ownclouders/web-pkg', async (importOriginal) => ({ ...(await importOriginal<any>()), useExtensionRegistry: vi.fn(), useRequest: vi.fn(), useFileActionsCreateNewFile: vi.fn(), useFileActions: vi.fn(), useFileActionsPaste: vi.fn() })) const elSelector = { component: '#create-and-upload-actions', newFileButton: '#new-file-menu-btn', uploadBtn: '#upload-menu-btn', resourceUpload: 'resource-upload-stub', newFolderBtn: '#new-folder-btn', clipboardBtns: '#clipboard-btns', pasteFilesBtn: '.paste-files-btn', clearClipboardBtn: '.clear-clipboard-btn' } describe('CreateAndUpload component', () => { describe('action buttons', () => { it('should show and be enabled if file creation is possible', () => { const { wrapper } = getWrapper() expect( wrapper.findComponent<typeof OcButton>(elSelector.uploadBtn).props().disabled ).toBeFalsy() expect( wrapper.findComponent<typeof OcButton>(elSelector.newFolderBtn).props().disabled ).toBeFalsy() expect(wrapper.html()).toMatchSnapshot() }) it('should be disabled if file creation is not possible', () => { const currentFolder = mock<Resource>({ canUpload: () => false }) const { wrapper } = getWrapper({ currentFolder, createActions: [] }) expect( wrapper.findComponent<typeof OcButton>(elSelector.uploadBtn).props().disabled ).toBeTruthy() expect( wrapper.findComponent<typeof OcButton>(elSelector.newFolderBtn).props().disabled ).toBeTruthy() }) it('should not be visible if file creation is not possible on a public page', () => { const currentFolder = mock<Resource>({ canUpload: () => false }) const { wrapper } = getWrapper({ currentFolder, currentRouteName: 'files-public-link' }) expect(wrapper.find(elSelector.component).exists()).toBeFalsy() }) }) describe('file handlers', () => { it('should always show for uploading files and folders', () => { const { wrapper } = getWrapper() expect(wrapper.findAll(elSelector.resourceUpload).length).toBe(2) }) it('should show entries for all new file handlers', () => { const { wrapper } = getWrapper() expect(wrapper.html()).toMatchSnapshot() }) }) describe('clipboard buttons', () => { it('should show if clipboard is empty', () => { const { wrapper } = getWrapper() expect( wrapper.findComponent<any>(`${elSelector.clipboardBtns} oc-button-stub`).exists() ).toBeFalsy() }) it('should show if clipboard is not empty', () => { const { wrapper } = getWrapper({ clipboardResources: [mock<Resource>()] }) expect(wrapper.findAll(`${elSelector.clipboardBtns} .oc-button`).length).toBe(2) }) it('call the "paste files"-action', async () => { const { wrapper, mocks } = getWrapper({ clipboardResources: [ mock<Resource>({ shareRoot: undefined }) ] }) await wrapper.find(elSelector.pasteFilesBtn).trigger('click') expect(mocks.pasteActionHandler).toHaveBeenCalled() }) it('call "clear clipboard"-action', async () => { const { wrapper } = getWrapper({ clipboardResources: [mock<Resource>()] }) await wrapper.find(elSelector.clearClipboardBtn).trigger('click') const clipboardStore = useClipboardStore() expect(clipboardStore.clearClipboard).toHaveBeenCalled() }) }) describe('method "onUploadComplete"', () => { it.each([ { driveType: 'personal', updated: 1 }, { driveType: 'project', updated: 1 }, { driveType: 'share', updated: 0 }, { driveType: 'public', updated: 0 } ])('updates the space quota for supported drive types: %s', async ({ driveType, updated }) => { const file = mock<UppyResource>({ meta: { driveType, spaceId: '1' } }) const spaces = [ mock<SpaceResource>({ id: file.meta.spaceId, isOwner: () => driveType === 'personal' }) ] const { wrapper, mocks } = getWrapper({ spaces }) const graphMock = mocks.$clientService.graphAuthenticated graphMock.drives.getDrive.mockResolvedValue(mockAxiosResolve<Drive>()) await wrapper.vm.onUploadComplete({ successful: [file] }) const spacesStore = useSpacesStore() expect(spacesStore.updateSpaceField).toHaveBeenCalledTimes(updated) }) it('reloads the file list if files were uploaded to the current path', async () => { const eventSpy = vi.spyOn(eventBus, 'publish') const itemId = 'itemId' const space = mock<SpaceResource>({ id: '1' }) const { wrapper, mocks } = getWrapper({ itemId, space }) const file = mock<UppyResource>({ meta: { driveType: 'project', spaceId: space.id, currentFolderId: itemId } }) const graphMock = mocks.$clientService.graphAuthenticated graphMock.drives.getDrive.mockResolvedValue(mockAxiosResolve<Drive>()) await wrapper.vm.onUploadComplete({ successful: [file] }) expect(eventSpy).toHaveBeenCalled() }) }) describe('drop target', () => { it('is being initialized when user can upload', () => { const { mocks } = getWrapper() expect(mocks.$uppyService.useDropTarget).toHaveBeenCalled() }) it('is not being initialized when user can not upload', () => { const currentFolder = mock<Resource>({ canUpload: () => false }) const { mocks } = getWrapper({ currentFolder }) expect(mocks.$uppyService.useDropTarget).not.toHaveBeenCalled() }) }) }) function getWrapper({ clipboardResources = [], files = [], currentFolder = mock<Resource>({ canUpload: () => true }), currentRouteName = 'files-spaces-generic', space = mock<SpaceResource>(), spaces = [], item = undefined, itemId = undefined, newFileAction = false, areFileExtensionsShown = false, createActions = [ mock<FileAction>({ label: () => 'Plain text file', ext: 'txt' }), mock<FileAction>({ label: () => 'Mark-down file', ext: 'md' }), mock<FileAction>({ label: () => 'Draw.io document', ext: 'drawio' }) ] } = {}) { vi.mocked(useRequest).mockImplementation(() => ({ makeRequest: vi.fn().mockResolvedValue({ status: 200 }) })) vi.mocked(useExtensionRegistry).mockImplementation(() => useExtensionRegistryMock()) vi.mocked(useFileActionsCreateNewFile).mockReturnValue( mock<ReturnType<typeof useFileActionsCreateNewFile>>({ actions: ref(createActions) }) ) const pasteActionHandler = vi.fn() vi.mocked(useFileActionsPaste).mockReturnValue( mock<ReturnType<typeof useFileActionsPaste>>({ actions: ref([mock<FileAction>({ handler: pasteActionHandler })]) }) ) const mocks = { ...defaultComponentMocks({ currentRoute: mock<RouteLocation>({ name: currentRouteName }) }), pasteActionHandler } const capabilities = { spaces: { enabled: true }, files: { app_providers: [{ new_url: '/' }] } } satisfies Partial<CapabilityStore['capabilities']> return { mocks, wrapper: shallowMount(CreateAndUpload, { data: () => ({ newFileAction }), props: { space: space, item, itemId }, global: { stubs: { OcButton: false }, renderStubDefaultSlot: true, mocks, provide: mocks, plugins: [ ...defaultPlugins({ piniaOptions: { spacesState: { spaces }, capabilityState: { capabilities }, clipboardState: { resources: clipboardResources }, resourcesStore: { areFileExtensionsShown, currentFolder, resources: files } } }) ] } }) } }
owncloud/web/packages/web-app-files/tests/unit/components/AppBar/CreateAndUpload.spec.ts/0
{ "file_path": "owncloud/web/packages/web-app-files/tests/unit/components/AppBar/CreateAndUpload.spec.ts", "repo_id": "owncloud", "token_count": 3204 }
807
import FileActions from 'web-app-files/src/components/SideBar/Actions/FileActions.vue' import { Resource, SpaceResource } from '@ownclouders/web-client/src/helpers' import { mock } from 'vitest-mock-extended' import { defaultPlugins, defaultStubs, mount, defaultComponentMocks, RouteLocation } from 'web-test-helpers' import { useFileActions } from '@ownclouders/web-pkg' import { Action } from '@ownclouders/web-pkg' vi.mock('@ownclouders/web-pkg', async (importOriginal) => ({ ...(await importOriginal<any>()), useFileActions: vi.fn() })) type ActionWithSelector = Action & { selector: string } const fileActions = { copy: mock<ActionWithSelector>({ handler: vi.fn(), label: () => 'Copy', componentType: 'button', class: 'oc-files-actions-copy-trigger', selector: '.oc-files-actions-copy-trigger' }), move: mock<ActionWithSelector>({ handler: vi.fn(), label: () => 'Move', componentType: 'button', class: 'oc-files-actions-move-trigger', selector: '.oc-files-actions-move-trigger' }), download: mock<ActionWithSelector>({ handler: vi.fn(), label: () => 'Download', componentType: 'button', class: 'oc-files-actions-download-file-trigger', selector: '.oc-files-actions-download-file-trigger' }), 'text-editor': mock<ActionWithSelector>({ handler: vi.fn(), label: () => 'Open in Text Editor', componentType: 'button', class: 'oc-files-actions-text-editor-trigger', selector: '.oc-files-actions-text-editor-trigger' }) } describe('FileActions', () => { describe('when user is on personal route', () => { describe('action handlers', () => { it('renders action handlers as clickable elements', async () => { vi.mocked(useFileActions).mockImplementation(() => mock<ReturnType<typeof useFileActions>>({ getAllAvailableActions: () => Object.values(fileActions) }) ) const actions = ['copy', 'move', 'download', 'text-editor'] const { wrapper } = getWrapper() for (const button of actions) { const action = fileActions[button] const buttonElement = wrapper.find(action.selector) expect(buttonElement.exists()).toBeTruthy() await buttonElement.trigger('click.stop') expect(action.handler).toHaveBeenCalledTimes(1) } }) }) describe('menu items', () => { it('renders a list of actions', () => { const { wrapper } = getWrapper() for (const action of ['copy', 'text-editor']) { expect(wrapper.find(fileActions[action].selector).exists()).toBeTruthy() } }) }) }) }) function getWrapper() { return { wrapper: mount(FileActions, { global: { plugins: [...defaultPlugins()], mocks: defaultComponentMocks({ currentRoute: mock<RouteLocation>({ name: 'files-spaces-generic', path: '/files/spaces/personal/admin' }) }), stubs: { ...defaultStubs, OcButton: false }, provide: { space: mock<SpaceResource>(), resource: mock<Resource>({ extension: 'md' }) } } }) } }
owncloud/web/packages/web-app-files/tests/unit/components/SideBar/Actions/FileActions.spec.ts/0
{ "file_path": "owncloud/web/packages/web-app-files/tests/unit/components/SideBar/Actions/FileActions.spec.ts", "repo_id": "owncloud", "token_count": 1311 }
808
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`NameAndCopy > should show link info component including a copy-to-clipboard button 1`] = ` "<div data-v-bc999e16="" class="oc-mb-s oc-width-1-1"> <h4 data-v-bc999e16="" class="oc-text-truncate oc-text-normal oc-files-file-link-name oc-m-rm">Example link</h4> <div data-v-bc999e16="" class="oc-flex oc-flex-middle oc-flex-between oc-width-1-1 oc-p-xs link-name-container"> <div data-v-bc999e16="" class="oc-flex oc-flex-middle oc-text-truncate"><span data-v-bc999e16="" class="oc-icon oc-icon-m oc-icon-passive"><!----></span> <p data-v-bc999e16="" class="oc-files-file-link-url oc-ml-s oc-text-truncate oc-my-rm">https://some-url.com/abc</p> </div> <button data-v-bc999e16="" type="button" aria-label="Copy link to clipboard" class="oc-button oc-rounded oc-button-s oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-outline oc-files-public-link-copy-url oc-ml-xs"> <!--v-if--> <!-- @slot Content of the button --> Copy </button> </div> </div>" `; exports[`NameAndCopy > upon clicking it should copy the private link to the clipboard button, render a success message and change icon for half a second 1`] = ` "<div data-v-bc999e16="" class="oc-mb-s oc-width-1-1"> <h4 data-v-bc999e16="" class="oc-text-truncate oc-text-normal oc-files-file-link-name oc-m-rm">Example link</h4> <div data-v-bc999e16="" class="oc-flex oc-flex-middle oc-flex-between oc-width-1-1 oc-p-xs link-name-container"> <div data-v-bc999e16="" class="oc-flex oc-flex-middle oc-text-truncate"><span data-v-bc999e16="" class="oc-icon oc-icon-m oc-icon-passive"><!----></span> <p data-v-bc999e16="" class="oc-files-file-link-url oc-ml-s oc-text-truncate oc-my-rm">https://some-url.com/abc</p> </div> <button data-v-bc999e16="" type="button" aria-label="Copy link to clipboard" class="oc-button oc-rounded oc-button-s oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-outline oc-files-public-link-copy-url oc-ml-xs"> <!--v-if--> <!-- @slot Content of the button --> Copy </button> </div> </div>" `; exports[`NameAndCopy > upon clicking it should copy the private link to the clipboard button, render a success message and change icon for half a second 2`] = ` "<div data-v-bc999e16="" class="oc-mb-s oc-width-1-1"> <h4 data-v-bc999e16="" class="oc-text-truncate oc-text-normal oc-files-file-link-name oc-m-rm">Example link</h4> <div data-v-bc999e16="" class="oc-flex oc-flex-middle oc-flex-between oc-width-1-1 oc-p-xs link-name-container"> <div data-v-bc999e16="" class="oc-flex oc-flex-middle oc-text-truncate"><span data-v-bc999e16="" class="oc-icon oc-icon-m oc-icon-passive"><!----></span> <p data-v-bc999e16="" class="oc-files-file-link-url oc-ml-s oc-text-truncate oc-my-rm">https://some-url.com/abc</p> </div> <button data-v-bc999e16="" type="button" aria-label="Copy link to clipboard" class="oc-button oc-rounded oc-button-s oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-outline oc-files-public-link-copy-url oc-ml-xs"> <!--v-if--> <!-- @slot Content of the button --> Copy </button> </div> </div>" `;
owncloud/web/packages/web-app-files/tests/unit/components/SideBar/Shares/Links/__snapshots__/NameAndCopy.spec.ts.snap/0
{ "file_path": "owncloud/web/packages/web-app-files/tests/unit/components/SideBar/Shares/Links/__snapshots__/NameAndCopy.spec.ts.snap", "repo_id": "owncloud", "token_count": 1354 }
809
import { SDKSearch } from '../../../src/search' import { RouteLocation, Router } from 'vue-router' import { mock } from 'vitest-mock-extended' import { ref } from 'vue' import { createTestingPinia } from 'web-test-helpers/src' import { useCapabilityStore } from '@ownclouders/web-pkg' const getStore = (reports = []) => { createTestingPinia({ initialState: { capabilities: { capabilities: { dav: { reports } } } } }) return useCapabilityStore() } describe('SDKProvider', () => { it('is only available if announced via capabilities', () => { const search = new SDKSearch(getStore(), mock<Router>(), vi.fn()) expect(search.available).toBe(false) }) describe('SDKProvider previewSearch', () => { it('is not available on certain routes', () => { ;[ { route: 'foo', available: true }, { route: 'search-provider-list' }, { route: 'bar', available: true } ].forEach((v) => { const search = new SDKSearch( getStore(['search-files']), mock<Router>({ currentRoute: ref(mock<RouteLocation>({ name: v.route })) }), vi.fn() ) expect(!!search.previewSearch.available).toBe(!!v.available) }) }) }) })
owncloud/web/packages/web-app-files/tests/unit/search/sdk.spec.ts/0
{ "file_path": "owncloud/web/packages/web-app-files/tests/unit/search/sdk.spec.ts", "repo_id": "owncloud", "token_count": 488 }
810
{ "name": "web-app-importer", "version": "0.0.0", "private": true, "description": "ownCloud Web Importer", "license": "AGPL-3.0", "devDependencies": { "web-test-helpers": "workspace:*" }, "dependencies": { "@uppy/dashboard": "^3.1.1", "@uppy/google-drive": "^3.1.1", "@uppy/onedrive": "^3.1.1", "@uppy/webdav": "^3.1.1" }, "peerDependencies": { "@ownclouders/design-system": "workspace:*", "@ownclouders/web-client": "workspace:*", "@ownclouders/web-pkg": "workspace:*", "pinia": "^2.1.7" } }
owncloud/web/packages/web-app-importer/package.json/0
{ "file_path": "owncloud/web/packages/web-app-importer/package.json", "repo_id": "owncloud", "token_count": 264 }
811
import { Resource } from '@ownclouders/web-client/src' import MediaControls from '../../../src/components/MediaControls.vue' import { defaultPlugins, shallowMount } from 'web-test-helpers' import { mock } from 'vitest-mock-extended' const selectors = { controlsPrevious: '.preview-controls-previous', controlsNext: '.preview-controls-next', controlsFullScreen: '.preview-controls-fullscreen', controlsImageShrink: '.preview-controls-image-shrink', controlsImageOriginalSize: '.preview-controls-image-original-size', controlsImageZoom: '.preview-controls-image-zoom', controlsRotateLeft: '.preview-controls-rotate-left', controlsRotateRight: '.preview-controls-rotate-right', controlsImageReset: '.preview-controls-image-reset' } describe('MediaControls component', () => { describe('previous button', () => { it('exists', () => { const { wrapper } = getWrapper() expect(wrapper.find(selectors.controlsPrevious).exists()).toBeTruthy() }) it('emits "togglePrevious"-event on click', async () => { const { wrapper } = getWrapper() await wrapper.find(selectors.controlsPrevious).trigger('click') expect(wrapper.emitted('togglePrevious').length).toBeDefined() }) }) describe('next button', () => { it('exists', () => { const { wrapper } = getWrapper() expect(wrapper.find(selectors.controlsNext).exists()).toBeTruthy() }) it('emits "toggleNext"-event on click', async () => { const { wrapper } = getWrapper() await wrapper.find(selectors.controlsNext).trigger('click') expect(wrapper.emitted('toggleNext').length).toBeDefined() }) }) describe('full screen toggle', () => { it('exists', () => { const { wrapper } = getWrapper() expect(wrapper.find(selectors.controlsFullScreen).exists()).toBeTruthy() }) it('emits "toggleFullScreen"-event on click', async () => { const { wrapper } = getWrapper() await wrapper.find(selectors.controlsFullScreen).trigger('click') expect(wrapper.emitted('toggleFullScreen').length).toBeDefined() }) }) describe('size', () => { describe('shrink button', () => { it('exists if file is an image', () => { const { wrapper } = getWrapper({ isImage: true }) expect(wrapper.find(selectors.controlsImageShrink).exists()).toBeTruthy() }) it('emits "setZoom"-event on click', async () => { const { wrapper } = getWrapper({ isImage: true }) await wrapper.find(selectors.controlsImageShrink).trigger('click') expect(wrapper.emitted('setZoom').length).toBeDefined() }) }) describe('zoom button', () => { it('exists if file is an image', () => { const { wrapper } = getWrapper({ isImage: true }) expect(wrapper.find(selectors.controlsImageZoom).exists()).toBeTruthy() }) it('emits "setZoom"-event on click', async () => { const { wrapper } = getWrapper({ isImage: true }) await wrapper.find(selectors.controlsImageZoom).trigger('click') expect(wrapper.emitted('setZoom').length).toBeDefined() }) }) describe('original size button', () => { it('exists if file is an image', () => { const { wrapper } = getWrapper({ isImage: true }) expect(wrapper.find(selectors.controlsImageOriginalSize).exists()).toBeTruthy() }) it('emits "setZoom"-event on click', async () => { const { wrapper } = getWrapper({ isImage: true }) await wrapper.find(selectors.controlsImageOriginalSize).trigger('click') expect(wrapper.emitted('setZoom').length).toBeDefined() }) }) }) describe('rotation', () => { describe('left button', () => { it('exists if file is an image', () => { const { wrapper } = getWrapper({ isImage: true }) expect(wrapper.find(selectors.controlsRotateLeft).exists()).toBeTruthy() }) it('emits "setRotation"-event on click', async () => { const { wrapper } = getWrapper({ isImage: true }) await wrapper.find(selectors.controlsRotateLeft).trigger('click') expect(wrapper.emitted('setRotation').length).toBeDefined() }) }) describe('right button', () => { it('exists if file is an image', () => { const { wrapper } = getWrapper({ isImage: true }) expect(wrapper.find(selectors.controlsRotateRight).exists()).toBeTruthy() }) it('emits "setRotation"-event on click', async () => { const { wrapper } = getWrapper({ isImage: true }) await wrapper.find(selectors.controlsRotateRight).trigger('click') expect(wrapper.emitted('setRotation').length).toBeDefined() }) }) }) describe('reset', () => { describe('reset button', () => { it('exists if file is an image', () => { const { wrapper } = getWrapper({ isImage: true }) expect(wrapper.find(selectors.controlsImageReset).exists()).toBeTruthy() }) it('emits "resetImage"-event on click', async () => { const { wrapper } = getWrapper({ isImage: true }) await wrapper.find(selectors.controlsImageReset).trigger('click') expect(wrapper.emitted('resetImage').length).toBeDefined() }) }) }) }) function getWrapper(props = {}) { return { wrapper: shallowMount(MediaControls, { props: { files: [mock<Resource>()], activeIndex: 0, ...props }, global: { plugins: [...defaultPlugins()] } }) } }
owncloud/web/packages/web-app-preview/tests/unit/components/MediaControls.spec.ts/0
{ "file_path": "owncloud/web/packages/web-app-preview/tests/unit/components/MediaControls.spec.ts", "repo_id": "owncloud", "token_count": 2118 }
812
import { useGettext } from 'vue3-gettext' import translations from '../l10n/translations.json' import TextEditor from './App.vue' import { AppWrapperRoute, ApplicationFileExtension, defineWebApplication, useUserStore } from '@ownclouders/web-pkg' export default defineWebApplication({ setup({ applicationConfig }) { const { $gettext } = useGettext() const userStore = useUserStore() const appId = 'text-editor' const fileExtensions = () => { const extensions: ApplicationFileExtension[] = [ { extension: 'txt', label: $gettext('Plain text file') }, { extension: 'md', label: $gettext('Markdown file') }, { extension: 'markdown', label: $gettext('Markdown file') }, { extension: 'js', label: $gettext('JavaScript file') }, { extension: 'json', label: $gettext('JSON file') }, { extension: 'xml', label: $gettext('XML file') }, { extension: 'py', label: $gettext('Python file') }, { extension: 'php', label: $gettext('PHP file') }, { extension: 'yaml', label: $gettext('YAML file') } ] const config = applicationConfig || {} extensions.push(...(config.extraExtensions || []).map((ext: string) => ({ extension: ext }))) let primaryExtensions: string[] = config.primaryExtensions || ['txt', 'md'] if (typeof primaryExtensions === 'string') { primaryExtensions = [primaryExtensions] } return extensions.reduce<ApplicationFileExtension[]>((acc, extensionItem) => { const isPrimary = primaryExtensions.includes(extensionItem.extension) if (isPrimary) { extensionItem.newFileMenu = { menuTitle() { return $gettext(extensionItem.label) } } } acc.push(extensionItem) return acc }, []) } const routes = [ { path: '/:driveAliasAndItem(.*)?', component: AppWrapperRoute(TextEditor, { applicationId: appId }), name: 'text-editor', meta: { authContext: 'hybrid', title: $gettext('Text Editor'), patchCleanPath: true } } ] return { appInfo: { name: $gettext('Text Editor'), id: appId, icon: 'file-text', color: '#0D856F', isFileEditor: true, applicationMenu: { enabled: () => { return !!userStore.user }, priority: 20, openAsEditor: true }, defaultExtension: 'txt', extensions: fileExtensions().map((extensionItem) => { return { extension: extensionItem.extension, ...(Object.prototype.hasOwnProperty.call(extensionItem, 'newFileMenu') && { newFileMenu: extensionItem.newFileMenu }) } }) }, routes, translations } } })
owncloud/web/packages/web-app-text-editor/src/index.ts/0
{ "file_path": "owncloud/web/packages/web-app-text-editor/src/index.ts", "repo_id": "owncloud", "token_count": 1522 }
813
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
owncloud/web/packages/web-client/src/generated/.npmignore/0
{ "file_path": "owncloud/web/packages/web-client/src/generated/.npmignore", "repo_id": "owncloud", "token_count": 23 }
814
import path, { basename, dirname } from 'path' import { urlJoin } from '../../utils' import { DavPermission, DavProperty } from '../../webdav/constants' import { Resource, WebDavResponseResource } from './types' import { isProjectSpaceResource } from '../space' const fileExtensions = { complex: ['tar.bz2', 'tar.gz', 'tar.xz'] } export const extractDomSelector = (str: string): string => { return str.replace(/[^A-Za-z0-9\-_]/g, '') } const extractIdSegment = (id: string, index: number): string => { if (!id || typeof id !== 'string') { return '' } return id.indexOf('!') >= 0 ? id.split('!')[index] : '' } export const extractStorageId = (id?: string): string => { return extractIdSegment(id, 0) } export const extractNodeId = (id?: string): string => { return extractIdSegment(id, 1) } export const getGraphItemId = (resource: Resource): string => { return isProjectSpaceResource(resource) ? `${resource.id}!${resource.id.split('$')[1]}` : resource.id } export const extractNameWithoutExtension = (resource?: Resource): string => { const extension = resource.extension || '' const name = resource.name || '' if (!extension.length) { return name } const extensionIndexInName = name.lastIndexOf(`.${extension}`) return name.substring(0, extensionIndexInName) } export const extractExtensionFromFile = (resource: Resource): string => { const name = resource.name if (resource.type === 'directory' || resource.isFolder) { return '' } const parts = name.split('.') if (parts.length > 2) { for (let i = 0; i < parts.length; i++) { const possibleExtension = parts.slice(i, parts.length).join('.') if (fileExtensions.complex.includes(possibleExtension)) { return possibleExtension } } } // Fallback if file extension is unknown or no extension if (parts.length < 2) { return '' } return parts[parts.length - 1] } export const extractParentFolderName = (resource: Resource): string | null => { return basename(dirname(resource.path)) || null } export const isShareRoot = (resource: Resource) => { // FIXME: does not work for OCS resources (re-shares), see workaround in useResourceRouteResolver return typeof resource.isShareRoot === 'function' && resource.isShareRoot() } export function buildResource(resource: WebDavResponseResource): Resource { const name = resource.props[DavProperty.Name]?.toString() || basename(resource.filename) const id = resource.props[DavProperty.FileId] const isFolder = resource.type === 'directory' let resourcePath: string if (resource.filename.startsWith('/files') || resource.filename.startsWith('/space')) { resourcePath = resource.filename.split('/').slice(3).join('/') } else { resourcePath = resource.filename } if (!resourcePath.startsWith('/')) { resourcePath = `/${resourcePath}` } const extension = extractExtensionFromFile({ ...resource, id, name, path: resourcePath }) const lock = resource.props[DavProperty.LockDiscovery] let activeLock: string, lockOwnerName: string, lockTime: string if (lock) { activeLock = lock[DavProperty.ActiveLock] lockOwnerName = activeLock[DavProperty.LockOwnerName] lockTime = activeLock[DavProperty.LockTime] } let shareTypes: number[] = [] if (resource.props[DavProperty.ShareTypes]) { shareTypes = resource.props[DavProperty.ShareTypes]['share-type'] if (!Array.isArray(shareTypes)) { shareTypes = [shareTypes] } } const r = { id, fileId: id, storageId: extractStorageId(id), parentFolderId: resource.props[DavProperty.FileParent], mimeType: resource.props[DavProperty.MimeType], name, extension: isFolder ? '' : extension, path: resourcePath, webDavPath: resource.filename, type: isFolder ? 'folder' : resource.type, isFolder, locked: activeLock ? true : false, lockOwnerName, lockTime, processing: resource.processing || false, mdate: resource.props[DavProperty.LastModifiedDate], size: isFolder ? resource.props[DavProperty.ContentSize]?.toString() || '0' : resource.props[DavProperty.ContentLength]?.toString() || '0', indicators: [], permissions: resource.props[DavProperty.Permissions] || '', starred: resource.props[DavProperty.IsFavorite] !== 0, etag: resource.props[DavProperty.ETag], shareTypes, privateLink: resource.props[DavProperty.PrivateLink], downloadURL: resource.props[DavProperty.DownloadURL], shareId: resource.props[DavProperty.ShareId], shareRoot: resource.props[DavProperty.ShareRoot], owner: { id: resource.props[DavProperty.OwnerId], displayName: resource.props[DavProperty.OwnerDisplayName] }, tags: (resource.props[DavProperty.Tags] || '').split(',').filter(Boolean), audio: resource.props[DavProperty.Audio], location: resource.props[DavProperty.Location], canUpload: function () { return this.permissions.indexOf(DavPermission.FolderCreateable) >= 0 }, canDownload: function () { return true }, canBeDeleted: function () { return this.permissions.indexOf(DavPermission.Deletable) >= 0 }, canRename: function () { return this.permissions.indexOf(DavPermission.Renameable) >= 0 }, canShare: function ({ ability }) { return ( ability.can('create-all', 'Share') && this.permissions.indexOf(DavPermission.Shareable) >= 0 ) }, canCreate: function () { return this.permissions.indexOf(DavPermission.FolderCreateable) >= 0 }, canEditTags: function () { return ( this.permissions.indexOf(DavPermission.Updateable) >= 0 || this.permissions.indexOf(DavPermission.FileUpdateable) >= 0 ) }, isMounted: function () { return this.permissions.indexOf(DavPermission.Mounted) >= 0 }, isReceivedShare: function () { return this.permissions.indexOf(DavPermission.Shared) >= 0 }, isShareRoot(): boolean { return resource.props[DavProperty.ShareRoot] ? resource.filename.split('/').length === 3 : false }, canDeny: function () { return this.permissions.indexOf(DavPermission.Deny) >= 0 }, getDomSelector: () => extractDomSelector(id) } satisfies Resource Object.defineProperty(r, 'nodeId', { get() { return extractNodeId(this.id) } }) return r } export function buildDeletedResource(resource: WebDavResponseResource): Resource { const isFolder = resource.type === 'directory' const fullName = resource.props[DavProperty.TrashbinOriginalFilename] const extension = extractExtensionFromFile({ name: fullName, type: resource.type } as Resource) const id = path.basename(resource.filename) return { type: isFolder ? 'folder' : resource.type, isFolder, ddate: resource.props[DavProperty.TrashbinDeletedDate], name: path.basename(fullName), extension, path: urlJoin(resource.props[DavProperty.TrashbinOriginalLocation], { leadingSlash: true }), id, parentFolderId: resource.props[DavProperty.FileParent], indicators: [], webDavPath: '', canUpload: () => false, canDownload: () => false, canBeDeleted: () => { /** FIXME: once https://github.com/owncloud/ocis/issues/3339 gets implemented, * we want to add a check if the permission is set. * We might to be careful and do an early return true if DavProperty.Permissions is not set * as oc10 does not support it. **/ return true }, canBeRestored: function () { /** FIXME: once https://github.com/owncloud/ocis/issues/3339 gets implemented, * we want to add a check if the permission is set. * We might to be careful and do an early return true if DavProperty.Permissions is not set * as oc10 does not support it. **/ return true }, canRename: () => false, canShare: () => false, canCreate: () => false, isMounted: () => false, isReceivedShare: () => false, getDomSelector: () => extractDomSelector(id) } }
owncloud/web/packages/web-client/src/helpers/resource/functions.ts/0
{ "file_path": "owncloud/web/packages/web-client/src/helpers/resource/functions.ts", "repo_id": "owncloud", "token_count": 2896 }
815
import { AxiosInstance } from 'axios' import get from 'lodash-es/get' /* eslint-disable camelcase */ export interface AppProviderCapability { apps_url?: string enabled?: boolean new_url?: string open_url?: string version?: string } export interface PasswordPolicyCapability { min_characters?: number max_characters?: number min_lowercase_characters?: number min_uppercase_characters?: number min_digits?: number min_special_characters?: number } export interface PasswordEnforcedForCapability { read_only?: boolean read_write?: boolean upload_only?: boolean read_write_delete?: boolean } export interface PublicExpirationCapability { days?: string enabled?: boolean enforced?: boolean } export interface SearchPropertyCapability { enabled?: boolean } export interface LastModifiedFilterCapability extends SearchPropertyCapability { keywords?: string[] } export interface MediaTypeCapability extends SearchPropertyCapability { keywords?: string[] } /** * Archiver struct within the capabilities as defined in reva * @see https://github.com/cs3org/reva/blob/41d5a6858c2200a61736d2c165e551b9785000d1/internal/http/services/owncloud/ocs/data/capabilities.go#L105 */ export interface ArchiverCapability { enabled?: boolean version?: string // version is just a major version, e.g. `v2` formats?: string[] // eslint-disable-next-line camelcase archiver_url?: string max_num_files?: string max_size?: string } export interface Capabilities { capabilities: { checksums?: { preferredUploadType?: string supportedTypes?: string[] } password_policy?: PasswordPolicyCapability search?: { property?: { content?: SearchPropertyCapability mediatype?: MediaTypeCapability mtime?: LastModifiedFilterCapability name?: MediaTypeCapability scope?: MediaTypeCapability size?: MediaTypeCapability tag?: MediaTypeCapability tags?: MediaTypeCapability type?: MediaTypeCapability } } notifications?: { 'ocs-endpoints'?: string[] } core: { pollinterval?: number status?: { edition?: string installed?: boolean maintenance?: boolean needsDbUpgrade?: boolean product?: string productname?: string productversion?: string version?: string versionstring?: string } 'support-sse'?: boolean 'support-url-signing'?: boolean 'webdav-root'?: string } dav: { chunking?: string chunkingParallelUploadDisabled?: boolean reports?: string[] trashbin?: string } files: { app_providers?: AppProviderCapability[] archivers?: ArchiverCapability[] favorites?: boolean full_text_search?: boolean permanent_deletion?: boolean privateLinks?: boolean tags?: boolean tus_support?: { extension?: string http_method_override?: boolean max_chunk_size?: number resumable?: string version?: string } undelete?: boolean versioning?: boolean thumbnail?: { enabled?: boolean version?: string supportedMimeTypes?: string[] } } files_sharing: { allow_custom?: boolean api_enabled?: boolean can_rename?: boolean default_permissions?: number deny_access?: boolean federation?: { incoming?: boolean outgoing?: boolean } group_sharing?: boolean public?: { alias?: boolean can_contribute?: boolean can_edit?: boolean default_permissions?: number enabled?: boolean expire_date?: PublicExpirationCapability multiple?: boolean password?: { enforced?: boolean enforced_for?: PasswordEnforcedForCapability } send_mail?: boolean supports_upload_only?: boolean upload?: boolean } resharing?: boolean resharing_default?: boolean search_min_length?: number group?: { expire_date?: { enabled?: boolean enforced?: boolean days?: string } } user?: { expire_date?: { enabled?: boolean enforced?: boolean days?: string } profile_picture?: boolean send_mail?: boolean settings?: { enabled?: boolean version?: string }[] } quick_link?: { default_role?: string } } spaces?: { enabled?: boolean max_quota?: number projects?: boolean version?: string } graph?: { 'personal-data-export'?: boolean users: { change_password_self_disabled?: boolean create_disabled?: boolean delete_disabled?: boolean read_only_attributes?: string[] } } } version: { edition?: string major?: string minor?: string micro?: string product?: string productversion?: string string?: string } } /* eslint-enable camelcase */ export const GetCapabilitiesFactory = (baseURI: string, axios: AxiosInstance) => { const url = new URL(baseURI) url.pathname = [...url.pathname.split('/'), 'cloud', 'capabilities'].filter(Boolean).join('/') url.searchParams.append('format', 'json') const endpoint = url.href return { async getCapabilities(): Promise<Capabilities> { const response = await axios.get(endpoint) return get(response, 'data.ocs.data', { capabilities: null, version: null }) } } }
owncloud/web/packages/web-client/src/ocs/capabilities.ts/0
{ "file_path": "owncloud/web/packages/web-client/src/ocs/capabilities.ts", "repo_id": "owncloud", "token_count": 2192 }
816
import { urlJoin } from '../utils' import { SpaceResource } from '../helpers' import { WebDavOptions } from './types' import { DAV, buildAuthHeader } from './client' import { unref } from 'vue' export const DeleteFileFactory = (dav: DAV, { accessToken }: WebDavOptions) => { return { deleteFile(space: SpaceResource, { path }: { path: string }) { const headers = buildAuthHeader(unref(accessToken), space) return dav.delete(urlJoin(space.webDavPath, path), { headers }) } } }
owncloud/web/packages/web-client/src/webdav/deleteFile.ts/0
{ "file_path": "owncloud/web/packages/web-client/src/webdav/deleteFile.ts", "repo_id": "owncloud", "token_count": 171 }
817
import { urlJoin } from '../utils' import { SpaceResource } from '../helpers' import { WebDavOptions } from './types' import { DAV, buildAuthHeader } from './client' import { unref } from 'vue' import { DavProperty } from './constants' export const SetFavoriteFactory = (dav: DAV, { accessToken }: WebDavOptions) => { return { setFavorite(space: SpaceResource, { path }: { path: string }, value: unknown) { const headers = buildAuthHeader(unref(accessToken), space) const properties = { [DavProperty.IsFavorite]: value ? 'true' : 'false' } return dav.propPatch(urlJoin(space.webDavPath, path), properties, { headers }) } } }
owncloud/web/packages/web-client/src/webdav/setFavorite.ts/0
{ "file_path": "owncloud/web/packages/web-client/src/webdav/setFavorite.ts", "repo_id": "owncloud", "token_count": 218 }
818
<template> <div> <div v-if="groupingAllowed && groupingSettings.showGroupingOptions" class="oc-pb-m"> <div class="oc-docs-width-small grouping-label"> <label class="oc-mx-s" v-text="$gettext('Group By:')"></label> </div> <div class="oc-docs-width-medium grouping-oc-select"> <oc-select v-model="selectedGroupingOption" :options="[ ...Object.keys(groupingSettings.groupingFunctions), ...(!Object.keys(groupingSettings.groupingFunctions).includes('None') ? ['None'] : []) ]" :clearable="false" :searchable="false" /> </div> </div> <table v-bind="extractTableProps()"> <oc-thead v-if="hasHeader"> <oc-tr class="oc-table-header-row"> <oc-th v-for="(field, index) in fields" :key="`oc-thead-${field.name}`" v-bind="extractThProps(field, index)" @click="handleTrClick(field)" > <span v-if="field.headerType === 'slot'" class="oc-table-thead-content"> <slot :name="field.name + 'Header'" /> </span> <!-- TODO: Vue warning "v-if/else branches must use unique keys." --> <span v-else class="oc-table-thead-content header-text" v-text="extractFieldTitle(field)" /> <oc-button v-if="field.sortable" :aria-label="getSortLabel(field.name)" :class="{ 'oc-invisible-sr': sortBy !== field.name }" class="oc-button-sort" variation="passive" appearance="raw" @click.stop="handleTrClick(field)" > <oc-icon :name="sortDir === 'asc' ? 'arrow-down' : 'arrow-up'" fill-type="line" size="small" variation="passive" /> </oc-button> </oc-th> </oc-tr> </oc-thead> <oc-tbody v-if="selectedGroupingOption === 'None' || !selectedGroupingOption" class="has-item-context-menu" > <oc-tr v-for="(item, trIndex) in data" :key="`oc-tbody-tr-${itemDomSelector(item) || trIndex}`" :ref="`row-${trIndex}`" v-bind="extractTbodyTrProps(item, trIndex)" :data-item-id="item[idKey]" :draggable="dragDrop" @click="$emit(constants.EVENT_TROW_CLICKED, [item, $event])" @contextmenu=" $emit(constants.EVENT_TROW_CONTEXTMENU, $refs[`row-${trIndex}`][0], $event, item) " @vue:mounted="$emit(constants.EVENT_TROW_MOUNTED, item, $refs[`row-${trIndex}`][0])" @dragstart="dragStart(item, $event)" @drop="dropRowEvent(itemDomSelector(item), $event)" @dragenter.prevent="dropRowStyling(itemDomSelector(item), false, $event)" @dragleave.prevent="dropRowStyling(itemDomSelector(item), true, $event)" @mouseleave="dropRowStyling(itemDomSelector(item), true, $event)" @dragover="dragOver($event)" > <oc-td v-for="(field, tdIndex) in fields" :key="'oc-tbody-td-' + cellKey(field, tdIndex, item)" v-bind="extractTdProps(field, tdIndex, item)" > <slot v-if="isFieldTypeSlot(field)" :name="field.name" :item="item" /> <template v-else-if="isFieldTypeCallback(field)"> {{ field.callback(item[field.name]) }} </template> <template v-else> {{ item[field.name] }} </template> </oc-td> </oc-tr> </oc-tbody> <!-- Collapsibles --> <oc-tbody v-for="(group, index) in groupedData" v-else-if="groupingAllowed && selectedGroupingOption !== 'None' && copyGroupedData.length" :key="`${group.name + index}`" class="has-item-context-menu" > <oc-tr :class="['oc-tbody-tr', 'oc-tbody-tr-accordion']" @click="toggleGroup(index)"> <oc-td :colspan="fields.length - 1" class="oc-pl-s"> {{ group.name }}</oc-td> <!-- Column with collapsible buttons --> <oc-td class="oc-table-cell-align-right"> <span class="oc-ml-xs oc-icon-l" :class="[!itemOpen(index) && 'oc-hidden']"> <oc-icon name="arrow-down-s" size="medium" /> </span> <span class="oc-ml-xs oc-icon-l" :class="[itemOpen(index) && 'oc-hidden']"> <oc-icon name="arrow-up-s" size="medium" /> </span ></oc-td> </oc-tr> <!-- Data for the group --> <template v-if="itemOpen(index)"> <oc-tr v-for="(item, trIndex) in group['data']" :key="`oc-tbody-tr-${itemDomSelector(item) || trIndex}`" :ref="`row-${trIndex}`" v-bind="extractTbodyTrProps(item, trIndex)" :data-item-id="item[idKey]" :draggable="dragDrop" @click="$emit(constants.EVENT_TROW_CLICKED, [item, $event])" @contextmenu=" $emit(constants.EVENT_TROW_CONTEXTMENU, $refs[`row-${trIndex}`][0], $event, item) " @vue:mounted="$emit(constants.EVENT_TROW_MOUNTED, item, $refs[`row-${trIndex}`][0])" @dragstart="dragStart(item, $event)" @drop="dropRowEvent(itemDomSelector(item), $event)" @dragenter.prevent="dropRowStyling(itemDomSelector(item), false, $event)" @dragleave.prevent="dropRowStyling(itemDomSelector(item), true, $event)" @mouseleave="dropRowStyling(itemDomSelector(item), true, $event)" @dragover="dragOver($event)" > <oc-td v-for="(field, tdIndex) in fields" :key="'oc-tbody-td-' + cellKey(field, tdIndex, item)" v-bind="extractTdProps(field, tdIndex, item)" > <slot v-if="isFieldTypeSlot(field)" :name="field.name" :item="item" /> <template v-else-if="isFieldTypeCallback(field)"> {{ field.callback(item[field.name]) }} </template> <template v-else>{{ item[field.name] }}</template> </oc-td> </oc-tr> </template> </oc-tbody> <tfoot v-if="$slots.footer" class="oc-table-footer"> <tr class="oc-table-footer-row"> <td :colspan="fullColspan" class="oc-table-footer-cell"> <!-- @slot Footer of the table --> <slot name="footer" /> </td> </tr> </tfoot> </table> </div> </template> <script lang="ts"> import { defineComponent, PropType, ref } from 'vue' import { getSizeClass } from 'design-system/src/utils/sizeClasses' import { EVENT_THEAD_CLICKED, EVENT_TROW_CLICKED, EVENT_TROW_MOUNTED, EVENT_TROW_CONTEXTMENU, EVENT_ITEM_DROPPED, EVENT_ITEM_DRAGGED, EVENT_SORT } from 'design-system/src/helpers/constants' const SORT_DIRECTION_ASC = 'asc' as const const SORT_DIRECTION_DESC = 'desc' as const export type FieldType = { name: string title?: string headerType?: string type?: string callback?: any alignH?: string alignV?: string width?: string wrap?: string thClass?: string tdClass?: string sortable?: boolean } /** * A collapsible table component with dynamic layout and data. */ export default defineComponent({ name: 'CollapsibleOcTable', status: 'prototype', release: 'unreleased', props: { /** * Grouping settings for the table. Following settings are possible:<br /> * -**groupingFunctions**: Object with keys as grouping options names and as values functions that get a table data row and return a group name for that row. The names of the functions are used as grouping options.<br /> * -**sortGroups**: Object with keys as grouping options names and as values functions that get an array of groups and return a sorted array of groups. * -**groupingBy**: must be either one of the keys in groupingFunctions or 'None'. If not set, default grouping will be 'None'.<br /> * -**ShowGroupingOptions**: boolean value for showing or hinding the select element with grouping options above the table. <br /> */ groupingSettings: { type: Object, required: false, default: null }, /** * The data for the table. Each array item will be rendered as one table row. Each array item needs to have a * unique identifier. By default we expect this to be an `id` field. If your field has a different name, please * specify it in the `id-key` property of oc-table. */ data: { type: Array, required: true }, /** * Name of the id property of your data items. See `data` for details on how to use it. The [idKey] is a required field * within your data items if you want to have working highlighting. For data representation it is not needed. */ idKey: { type: String, default: 'id' }, /** * Closure function to mutate the item id into a valid DOM selector */ itemDomSelector: { type: Function, required: false, default(item) { return item[(this as any).idKey] } }, /** * The column layout of the table. * * Each field can have the following data:<br /> * - **name**: values need to be keys of your data items. Required.<br /> * - **title**: title as displayed in the table header. Optional, falls back to the value of name.<br /> * - **headerType**: the header field type, can be `slot`, entirely absent or unknown. If absent or unknown, the data will be rendered into a plain table cell.<br /> * - **type**: the field type, can be `slot`, `callback`, entirely absent or unknown. If absent or unknown, the data will be rendered into a plain table cell.<br /> * - **callback**: if `type="callback"` the return value of field.callback will be rendered into a plain table cell.<br /> * - **alignH**: horizontal cell content alignment, can be `left`, `center` or `right`. Defaults to `left`.<br /> * - **alignV**: vertical cell content alignment, can be `top`, `middle` or `bottom`. Defaults to `middle`.<br /> * - **width**: horizontal size of a cell, can be `auto`, `shrink` or `expand`. Defaults to `auto`.<br /> * - **wrap**: text behaviour of a data cell, can be `truncate`, `overflow`, `nowrap`, `break`. Omitted if not set. Header cells are always fixed to `nowrap`.<br /> * - **thClass**:additional classes on header cells, provided as a string, classes separated by spaces. Optional, falls back to an empty string.<br /> * - **tdClass**: additional classes on data cells, provided as a string, classes separated by spaces. Optional, falls back to an empty string.<br /> * - **sortable**: defines if the column is sortable, can be `true` or `false`. */ fields: { type: Array as PropType<FieldType[]>, required: true }, /** * Asserts whether the table has a header. The header markup is defined in the `fields` array. */ hasHeader: { type: Boolean, default: true }, /** * Asserts whether the header of the table is sticky. */ sticky: { type: Boolean, required: false, default: false }, /** * Asserts whether table rows should be highlighted when hovered. */ hover: { type: Boolean, default: false }, /** * The ids of highlighted data items. Null or an empty string/array for no highlighting. */ highlighted: { type: [String, Array], default: null }, /** * The ids of disabled data items. Null or an empty string/array for no disabled items. */ disabled: { type: [String, Array], default: null }, /** * Top position of header used when the header is sticky in pixels */ headerPosition: { type: Number, required: false, default: 0 }, /** * Sets the padding size for x axis * @values xsmall, small, medium, large, xlarge */ paddingX: { type: String, required: false, default: 'small', validator: (size: string) => ['xsmall', 'small', 'medium', 'large', 'xlarge'].includes(size) }, /** * Enable Drag & Drop events */ dragDrop: { type: Boolean, required: false, default: false }, /** * Array of items that should be selected by default. */ selection: { type: Array as PropType<any[]>, required: false, default: () => [] }, /** * Determines if the table content should be loaded lazily. */ lazy: { type: Boolean, default: false }, /** * Show that the table is sorted ascendingly/descendingly (no actual sorting takes place) */ sortDir: { type: String, required: false, default: undefined, validator: (value: string) => { return value === undefined || ['asc', 'desc'].includes(value) } }, /** * Show that the table is sorted by this column (no actual sorting takes place) */ sortBy: { type: String, required: false, default: undefined } }, emits: [ EVENT_ITEM_DROPPED, EVENT_ITEM_DRAGGED, EVENT_THEAD_CLICKED, EVENT_TROW_CLICKED, EVENT_TROW_MOUNTED, EVENT_TROW_CONTEXTMENU, EVENT_SORT, 'dropRowStyling' ], setup() { const copyGroupedData = ref([]) const constants = { EVENT_THEAD_CLICKED, EVENT_TROW_CLICKED, EVENT_TROW_MOUNTED, EVENT_TROW_CONTEXTMENU } return { copyGroupedData, constants } }, data() { return { selectedGroupingOption: this.groupingSettings?.groupingBy || 'None' } }, computed: { isSortable() { return this.fields.some((f) => f.sortable) }, tableClasses() { const result = ['oc-table'] if (this.hover) { result.push('oc-table-hover') } if (this.sticky) { result.push('oc-table-sticky') } return result }, fullColspan() { return this.fields.length }, groupingAllowed() { return !!( this.groupingSettings?.groupingFunctions && Object.keys(this.groupingSettings.groupingFunctions).length > 0 ) }, groupedData() { let result = this.createGroupedData(this.selectedGroupingOption, this.data) if (!result.length) return [] // sort groups if there is a given sorting function in grouping settings if (this.groupingSettings?.sortGroups?.[this.selectedGroupingOption]) { result = this.groupingSettings.sortGroups[this.selectedGroupingOption](result) } return result } }, created() { // create copy of grouped data to manipulate toggling if (this.groupingAllowed) { this.copyGroupedData = [...this.groupedData] // callback for selection of None by enabled groupingSettings this.$watch('selectedGroupingOption', () => { if ( this.selectedGroupingOption === 'None' && this.groupingSettings?.groupingFunctions?.None ) this.groupingSettings.groupingFunctions.None() else { this.updateCopyGroupedData() } }) // update the copy of grouped data on data change this.$watch('data', this.updateCopyGroupedData, { deep: true }) } }, methods: { dragOver(event) { event.preventDefault() }, dragStart(item, event) { this.$emit(EVENT_ITEM_DRAGGED, item, event) }, dropRowEvent(selector, event) { this.$emit(EVENT_ITEM_DROPPED, selector, event) }, dropRowStyling(selector, leaving, event) { this.$emit('dropRowStyling', selector, leaving, event) }, isFieldTypeSlot(field) { return field.type === 'slot' }, isFieldTypeCallback(field) { return ['callback', 'function'].indexOf(field.type) >= 0 }, extractFieldTitle(field) { if (Object.prototype.hasOwnProperty.call(field, 'title')) { return field.title } return field.name }, extractTableProps() { return { class: this.tableClasses } }, extractThProps(field, index) { const props = this.extractCellProps(field) props.class = `oc-table-header-cell oc-table-header-cell-${field.name}` if (Object.prototype.hasOwnProperty.call(field, 'thClass')) { props.class += ` ${field.thClass}` } if (this.sticky) { props.style = `top: ${this.headerPosition}px;` } if (index === 0) { props.class += ` oc-pl-${getSizeClass(this.paddingX)} ` } if (index === this.fields.length - 1) { props.class += ` oc-pr-${getSizeClass(this.paddingX)}` } this.extractSortThProps(props, field) return props }, extractTbodyTrProps(item, index) { return { ...(this.lazy && { lazy: { colspan: this.fullColspan } }), class: [ 'oc-tbody-tr', `oc-tbody-tr-${this.itemDomSelector(item) || index}`, this.isHighlighted(item) ? 'oc-table-highlighted' : undefined, this.isDisabled(item) ? 'oc-table-disabled' : undefined ].filter(Boolean) } }, extractTdProps(field, index, item) { const props = this.extractCellProps(field) props.class = `oc-table-data-cell oc-table-data-cell-${field.name}` if (Object.prototype.hasOwnProperty.call(field, 'tdClass')) { props.class += ` ${field.tdClass}` } if (Object.prototype.hasOwnProperty.call(field, 'wrap')) { props.wrap = field.wrap } if (index === 0) { props.class += ` oc-pl-${getSizeClass(this.paddingX)} ` } if (index === this.fields.length - 1) { props.class += ` oc-pr-${getSizeClass(this.paddingX)}` } if (Object.prototype.hasOwnProperty.call(field, 'accessibleLabelCallback')) { props['aria-label'] = field.accessibleLabelCallback(item) } return props }, extractCellProps(field) { return { ...(field?.alignH && { alignH: field.alignH }), ...(field?.alignV && { alignV: field.alignV }), ...(field?.width && { width: field.width }), class: undefined, wrap: undefined, style: undefined } }, isHighlighted(item) { if (!this.highlighted) { return false } if (Array.isArray(this.highlighted)) { return this.highlighted.indexOf(item[this.idKey]) > -1 } return this.highlighted === item[this.idKey] }, isDisabled(item) { if (!this.disabled) { return false } if (Array.isArray(this.disabled)) { return this.disabled.indexOf(item[this.idKey]) > -1 } return this.disabled === item[this.idKey] }, cellKey(field, index, item) { const prefix = [item[this.idKey], index + 1].filter(Boolean) if (this.isFieldTypeSlot(field)) { return [...prefix, field.name].join('-') } if (this.isFieldTypeCallback(field)) { return [...prefix, field.callback(item[field.name])].join('-') } return [...prefix, item[field.name]].join('-') }, getSortLabel(name) { return this.$gettext('Sort by %{ name }', { name }) }, handleTrClick(field) { if (this.isSortable) { this.handleSort(field) } }, extractSortThProps(props, field) { if (!this.fieldIsSortable(field)) { return } let sort = 'none' if (this.sortBy === field.name) { sort = this.sortDir === SORT_DIRECTION_ASC ? 'ascending' : 'descending' } props['aria-sort'] = sort }, fieldIsSortable({ sortable }) { return !!sortable }, handleSort(field) { if (!this.fieldIsSortable(field)) { return } let sortDir = this.sortDir // toggle sortDir if already sorted by this column if (this.sortBy === field.name && this.sortDir !== undefined) { sortDir = this.sortDir === SORT_DIRECTION_DESC ? SORT_DIRECTION_ASC : SORT_DIRECTION_DESC } // set default sortDir of the field when sortDir not set or sortBy changed if (this.sortBy !== field.name || this.sortDir === undefined) { sortDir = field.sortDir || SORT_DIRECTION_DESC } /** * Triggers when table heads are clicked * * @property {string} sortBy requested column to sort by * @property {string} sortDir requested order to sort in (either asc or desc) */ this.$emit('sort', { sortBy: field.name, sortDir }) }, updateCopyGroupedData() { const tempData = [...this.groupedData] tempData.forEach((e) => { const group = this.copyGroupedData.find((el) => el.name === e.name) if (group && group.open) { e.open = group.open } this.copyGroupedData = [...tempData] }) }, createGroupedData(col, data) { const groups = {} const resultArray = [] if (Object.keys(this.groupingSettings?.groupingFunctions).includes(col)) { data.forEach((row) => { groups[this.groupingSettings.groupingFunctions[col](row)] ? groups[this.groupingSettings.groupingFunctions[col](row)].push(row) : (groups[this.groupingSettings.groupingFunctions[col](row)] = [row]) }) for (const [key, value] of Object.entries(groups)) { resultArray.push({ name: key.toUpperCase(), open: true, data: value }) } return resultArray } }, toggleGroup(index) { this.copyGroupedData[index].open = !this.copyGroupedData[index].open }, itemOpen(index) { return this.copyGroupedData[index]?.open }, clickedField(field) { this.$emit(this.constants.EVENT_THEAD_CLICKED, field) } } }) </script> <style lang="scss"> .condensed > .oc-table > tbody > tr { height: 0 !important; } .grouping-settings { display: flex; flex-direction: row; align-items: center; } .grouping-label { display: inline; } .grouping-oc-select { display: inline-block; width: 250px; } .oc-tbody-tr-accordion { cursor: pointer; background-color: var(--oc-color-input-bg); } .oc-table { border-collapse: collapse; border-spacing: 0; color: var(--oc-color-text-default); width: 100%; &-hover tr { transition: background-color $transition-duration-short ease-in-out; } &-hover tr:hover td:not(:last-child) span:not(.avatarInitials):not(button span) { color: var(--oc-color-swatch-brand-hover) !important; } tr { outline: none; height: var(--oc-size-height-table-row); } tr + tr { border-top: 1px solid var(--oc-color-border); } &-hover tr:not(&-footer-row):hover { background-color: var(--oc-color-background-hover); } &-highlighted { background-color: var(--oc-color-background-highlight) !important; } &-accentuated { background-color: var(--oc-color-background-accentuate); } &-disabled { background-color: var(--oc-color-background-muted); opacity: 0.8; pointer-events: none; } &-sticky { position: relative; .oc-table-header-cell { background-color: var(--oc-color-background-default); position: sticky; z-index: 1; } } .highlightedDropTarget { background-color: var(--oc-color-input-border); } &-thead-content { vertical-align: middle; display: inline-table; color: var(--oc-color-swatch-passive-default); &:hover { text-decoration: underline; } } &-footer { border-top: 1px solid var(--oc-color-border); &-cell { color: var(--oc-color-text-muted); font-size: 0.875rem; line-height: 1.4; padding: var(--oc-space-xsmall); } } } .oc-button-sort { display: inline-table; vertical-align: middle; .oc-icon { display: table-cell !important; vertical-align: middle !important; &:hover { background-color: var(--oc-color-background-hover); } } } </style>
owncloud/web/packages/web-pkg/src/cern/components/CollapsibleOcTable.vue/0
{ "file_path": "owncloud/web/packages/web-pkg/src/cern/components/CollapsibleOcTable.vue", "repo_id": "owncloud", "token_count": 10661 }
819
<template> <portal to="app.runtime.header.left"> <div class="oc-app-top-bar oc-flex"> <span class="oc-app-top-bar-inner oc-px-m oc-flex oc-flex-middle oc-flex-between"> <div class="open-file-bar oc-flex"> <resource-list-item v-if="resource" id="app-top-bar-resource" :is-thumbnail-displayed="false" :is-extension-displayed="areFileExtensionsShown" :path-prefix="pathPrefix" :resource="resource" :parent-folder-name="parentFolderName" :parent-folder-link-icon-additional-attributes=" parentFolderLinkIconAdditionalAttributes " :is-path-displayed="isPathDisplayed" /> </div> <div class="oc-flex main-actions"> <template v-if="mainActions.length && resource"> <context-action-menu :menu-sections="[ { name: 'main-actions', items: mainActions .filter((action) => action.isVisible()) .map((action) => { return { ...action, class: 'oc-p-xs', hideLabel: true } }) } ]" :action-options="{ resources: [resource] }" appearance="raw-inverse" variation="brand" /> </template> <template v-if="dropDownActions.length"> <oc-button id="oc-openfile-contextmenu-trigger" v-oc-tooltip="contextMenuLabel" :aria-label="contextMenuLabel" appearance="raw-inverse" class="oc-p-xs" variation="brand" > <oc-icon name="more-2" /> </oc-button> <oc-drop drop-id="oc-openfile-contextmenu" mode="click" padding-size="small" toggle="#oc-openfile-contextmenu-trigger" close-on-click @click.stop.prevent > <context-action-menu :menu-sections="[{ name: 'dropdown-actions', items: dropDownActions }]" :action-options="{ resources: [resource] }" /> </oc-drop> </template> <oc-button id="app-top-bar-close" v-oc-tooltip="closeButtonLabel" appearance="raw-inverse" variation="brand" :aria-label="closeButtonLabel" @click="$emit('close')" > <oc-icon name="close" size="small" /> </oc-button> </div> </span> </div> </portal> </template> <script lang="ts"> import { computed, defineComponent, PropType, unref } from 'vue' import ContextActionMenu from './ContextActions/ContextActionMenu.vue' import { useGettext } from 'vue3-gettext' import { Action, useFolderLink, useGetMatchingSpace, useResourcesStore } from '../composables' import ResourceListItem from './FilesList/ResourceListItem.vue' import { Resource, isPublicSpaceResource, isShareSpaceResource } from '@ownclouders/web-client/src/helpers' export default defineComponent({ name: 'AppTopBar', components: { ContextActionMenu, ResourceListItem }, props: { dropDownActions: { type: Array as PropType<Action[]>, default: () => [] }, mainActions: { type: Array as PropType<Action[]>, default: () => [] }, resource: { type: Object as PropType<Resource>, default: null } }, emits: ['close'], setup(props) { const { $gettext } = useGettext() const { getMatchingSpace } = useGetMatchingSpace() const resourcesStore = useResourcesStore() const areFileExtensionsShown = computed(() => resourcesStore.areFileExtensionsShown) const contextMenuLabel = computed(() => $gettext('Show context menu')) const closeButtonLabel = computed(() => $gettext('Close')) const { getParentFolderName, getParentFolderLinkIconAdditionalAttributes, getPathPrefix } = useFolderLink() const space = computed(() => getMatchingSpace(props.resource)) //FIXME: We currently have problems to display the parent folder name of a shared file, so we disabled it for now const isPathDisplayed = computed(() => { return !isShareSpaceResource(unref(space)) && !isPublicSpaceResource(unref(space)) }) const pathPrefix = computed(() => { return props.resource ? getPathPrefix(props.resource) : null }) const parentFolderName = computed(() => { return props.resource ? getParentFolderName(props.resource) : null }) const parentFolderLinkIconAdditionalAttributes = computed(() => { return props.resource ? getParentFolderLinkIconAdditionalAttributes(props.resource) : null }) return { pathPrefix, isPathDisplayed, contextMenuLabel, closeButtonLabel, parentFolderName, parentFolderLinkIconAdditionalAttributes, areFileExtensionsShown } } }) </script> <style lang="scss"> .oc-app-top-bar { align-self: center; grid-column: 1 / 4; grid-row: secondRow; @media (min-width: $oc-breakpoint-small-default) { grid-column: 2; grid-row: 1; } } .oc-app-top-bar-inner { align-self: center; background-color: var(--oc-color-components-apptopbar-background); border-radius: 10px; border: 1px solid var(--oc-color-components-apptopbar-border); display: inline-flex; gap: 25px; height: 40px; margin: 10px auto; width: 100%; @media (min-width: $oc-breakpoint-small-default) { flex-basis: 250px; margin: 0; } .oc-resource-indicators { .text { color: var(--oc-color-swatch-brand-contrast); } } } .open-file-bar { #app-top-bar-resource { max-width: 360px; @media (max-width: $oc-breakpoint-medium-default) { max-width: 240px; } @media (min-width: $oc-breakpoint-small-default) { widows: initial; } svg, .oc-resource-name span { fill: var(--oc-color-swatch-inverse-default) !important; color: var(--oc-color-swatch-inverse-default) !important; } } .oc-resource-icon:hover, .oc-resource-name:hover { cursor: default; text-decoration: none; } } </style>
owncloud/web/packages/web-pkg/src/components/AppTopBar.vue/0
{ "file_path": "owncloud/web/packages/web-pkg/src/components/AppTopBar.vue", "repo_id": "owncloud", "token_count": 2881 }
820
<template> <div class="oc-tile-card oc-card oc-card-default oc-rounded" :data-item-id="resource.id" :class="{ 'oc-tile-card-selected': isResourceSelected, 'oc-tile-card-disabled': resource.processing, 'state-trashed': resource.disabled }" @contextmenu="$emit('contextmenu', $event)" > <resource-link class="oc-card-media-top oc-flex oc-flex-center oc-flex-middle oc-m-rm" :resource="resource" :folder-link="resourceRoute" tabindex="-1" @click="$emit('click')" > <div class="oc-tile-card-selection"> <slot name="selection" :item="resource" /> </div> <oc-tag v-if="resource.disabled" class="resource-disabled-indicator oc-position-absolute" type="span" > <span v-text="$gettext('Disabled')" /> </oc-tag> <div v-oc-tooltip="tooltipLabelIcon" class="oc-tile-card-preview oc-flex oc-flex-middle oc-flex-center" :aria-label="tooltipLabelIcon" > <div class="oc-tile-card-hover"></div> <slot name="imageField" :item="resource"> <oc-img v-if="resource.thumbnail" class="tile-preview" :src="resource.thumbnail" /> <resource-icon v-else :resource="resource" :size="resourceIconSize" class="tile-default-image oc-pt-xs" > <template v-if="showStatusIcon" #status> <oc-icon v-bind="statusIconAttrs" size="xsmall" /> </template> </resource-icon> </slot> </div> </resource-link> <div class="oc-card-body oc-p-s"> <div class="oc-flex oc-flex-between oc-flex-middle"> <div class="oc-flex oc-flex-middle oc-text-truncate resource-name-wrapper"> <resource-list-item :resource="resource" :is-icon-displayed="false" :is-extension-displayed="isExtensionDisplayed" :folder-link="resourceRoute" @click="$emit('click')" /> </div> <div class="oc-flex oc-flex-middle"> <!-- Slot for indicators !--> <slot name="indicators" :item="resource" class="resource-indicators" /> <!-- Slot for individual actions --> <slot name="actions" :item="resource" /> <!-- Slot for contextmenu --> <slot name="contextMenu" :item="resource" /> </div> </div> <p v-if="resource.description" class="oc-text-left oc-my-rm oc-text-truncate"> <small v-text="resource.description" /> </p> </div> </div> </template> <script lang="ts"> import { computed, defineComponent, PropType } from 'vue' import ResourceIcon from './ResourceIcon.vue' import ResourceListItem from './ResourceListItem.vue' import ResourceLink from './ResourceLink.vue' import { Resource } from '@ownclouders/web-client' import { useGettext } from 'vue3-gettext' export default defineComponent({ name: 'ResourceTile', components: { ResourceListItem, ResourceIcon, ResourceLink }, props: { /** * Resource to be displayed within the tile */ resource: { type: Object as PropType<Resource>, default: () => ({}) }, resourceRoute: { type: Object, default: () => ({}) }, isResourceSelected: { type: Boolean, required: false, default: false }, isExtensionDisplayed: { type: Boolean, default: true }, resourceIconSize: { type: String, default: 'xlarge', validator: (value: string) => { return ['large', 'xlarge', 'xxlarge', 'xxxlarge'].includes(value) } } }, emits: ['click', 'contextmenu'], setup(props) { const { $gettext } = useGettext() const showStatusIcon = computed(() => { return props.resource.locked || props.resource.processing }) const statusIconAttrs = computed(() => { if (props.resource.locked) { return { name: 'lock', fillType: 'fill' } } if (props.resource.processing) { return { name: 'loop-right', fillType: 'line' } } return {} }) const tooltipLabelIcon = computed(() => { if (props.resource.locked) { return $gettext('This item is locked') } return null }) return { statusIconAttrs, showStatusIcon, tooltipLabelIcon } } }) </script> <style lang="scss"> .oc-tile-card { background-color: var(--oc-color-background-highlight) !important; box-shadow: none; height: 100%; display: flex; flex-flow: column; outline: 1px solid var(--oc-color-border); &-disabled { pointer-events: none; background-color: var(--oc-color-background-muted) !important; opacity: 0.7; filter: grayscale(0.6); // Show tooltip on status indicators without handler span.oc-status-indicators-indicator { pointer-events: all; } } &.state-trashed { cursor: pointer; .tile-image, .tile-default-image > svg { filter: grayscale(100%); opacity: 80%; } } .tile-default-image { position: relative; } .oc-card-media-top { position: relative; aspect-ratio: 16/9; justify-content: center; width: 100%; .oc-tag { color: var(--oc-color-text-default); &.resource-disabled-indicator { z-index: 1; } } .tile-preview { aspect-ratio: 16/9; height: 100%; object-fit: cover; width: 100%; border-top-left-radius: 5px; border-top-right-radius: 5px; } &:hover { .oc-tile-card-hover { opacity: 15%; } } } &-selected { outline: 2px solid var(--oc-color-swatch-primary-hover); .oc-tile-card-preview { width: calc(100% - var(--oc-space-medium)); height: calc(100% - var(--oc-space-medium)); .tile-preview, .oc-tile-card-hover { border-radius: 5px !important; } .oc-tile-card-hover { opacity: 10%; } } } &-selection { z-index: 1; position: absolute; top: 0; left: 0; input { background-color: var(--oc-color-background-muted); } input.oc-checkbox-checked { background-color: var(--oc-color-swatch-inverse-default); } } &-preview { position: absolute; height: 100%; width: 100%; text-align: center; } &-hover { position: absolute; width: 100%; height: 100%; background: #000; opacity: 0; border-top-left-radius: 5px; border-top-right-radius: 5px; } .resource-name-wrapper { color: var(--oc-color-text-default); max-width: 70%; overflow: hidden; } } </style>
owncloud/web/packages/web-pkg/src/components/FilesList/ResourceTile.vue/0
{ "file_path": "owncloud/web/packages/web-pkg/src/components/FilesList/ResourceTile.vue", "repo_id": "owncloud", "token_count": 3045 }
821
<template> <portal-target-vue v-bind="properties" /> </template> <script lang="ts"> import { computed, defineComponent, onMounted } from 'vue' import { eventBus } from '../services' import { PortalTargetEventTopics } from '../composables/portalTarget' import { PortalTarget as PortalTargetVue } from 'portal-vue' export default defineComponent({ name: 'PortalTarget', components: { PortalTargetVue }, props: { ...PortalTargetVue.props }, setup(props) { const properties = computed(() => props) onMounted(() => { eventBus.publish(PortalTargetEventTopics.mounted, props) }) return { properties } } }) </script>
owncloud/web/packages/web-pkg/src/components/PortalTarget.vue/0
{ "file_path": "owncloud/web/packages/web-pkg/src/components/PortalTarget.vue", "repo_id": "owncloud", "token_count": 222 }
822
export * from './Details' export { default as SpaceInfo } from './SpaceInfo.vue' export { default as SpaceNoSelection } from './SpaceNoSelection.vue'
owncloud/web/packages/web-pkg/src/components/SideBar/Spaces/index.ts/0
{ "file_path": "owncloud/web/packages/web-pkg/src/components/SideBar/Spaces/index.ts", "repo_id": "owncloud", "token_count": 47 }
823