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="M13 10h7l-9 13v-9H4l9-13z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/flashlight-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/flashlight-fill.svg", "repo_id": "owncloud", "token_count": 107 }
723
<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="M13 1l.001 3.062A8.004 8.004 0 0 1 19.938 11H23v2l-3.062.001a8.004 8.004 0 0 1-6.937 6.937L13 23h-2v-3.062a8.004 8.004 0 0 1-6.938-6.937L1 13v-2h3.062A8.004 8.004 0 0 1 11 4.062V1h2zm-1 5a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 4a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/focus-3-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/focus-3-line.svg", "repo_id": "owncloud", "token_count": 255 }
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="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414l2 2zM4 5v14h16V7h-8.414l-2-2H4zm4 4h8v4.904c0 .892-.446 1.724-1.187 2.219L12 17.998l-2.813-1.875A2.667 2.667 0 0 1 8 13.904V9zm2 4.904c0 .223.111.431.297.555L12 15.594l1.703-1.135a.667.667 0 0 0 .297-.555V11h-4v2.904z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/folder-shield-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/folder-shield-line.svg", "repo_id": "owncloud", "token_count": 289 }
725
<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="M17 4a6 6 0 0 1 6 6v4a6 6 0 0 1-6 6H7a6 6 0 0 1-6-6v-4a6 6 0 0 1 6-6h10zm0 2H7a4 4 0 0 0-3.995 3.8L3 10v4a4 4 0 0 0 3.8 3.995L7 18h10a4 4 0 0 0 3.995-3.8L21 14v-4a4 4 0 0 0-3.8-3.995L17 6zm-7 3v2h2v2H9.999L10 15H8l-.001-2H6v-2h2V9h2zm8 4v2h-2v-2h2zm-2-4v2h-2V9h2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/gamepad-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/gamepad-line.svg", "repo_id": "owncloud", "token_count": 286 }
726
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M7.132 20.737A9.997 9.997 0 0 1 2 12C2 6.477 6.477 2 12 2s10 4.477 10 10a9.997 9.997 0 0 1-5.132 8.737l-.896-1.791a8 8 0 1 0-7.945 0l-.895 1.791zm1.792-3.584a6 6 0 1 1 6.151 0l-.898-1.797a4 4 0 1 0-4.354 0l-.899 1.797zM12 16l3 6H9l3-6z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/gps-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/gps-line.svg", "repo_id": "owncloud", "token_count": 230 }
727
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0H24V24H0z"/> <path d="M21.097 8l-2.598 4.5c2.21 0 4.001 1.79 4.001 4s-1.79 4-4 4-4-1.79-4-4c0-.736.199-1.426.546-2.019L18.788 8h2.309zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 10.5c-1.105 0-2 .895-2 2s.895 2 2 2 2-.895 2-2-.895-2-2-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/h-6.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/h-6.svg", "repo_id": "owncloud", "token_count": 238 }
728
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M5 10.938A8.004 8.004 0 0 0 11.938 4H5v6.938zm0 2.013V20h14V4h-5.05A10.003 10.003 0 0 1 5 12.95zM4 2h16a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm11 14h2v2h-2v-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/hard-drive-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/hard-drive-line.svg", "repo_id": "owncloud", "token_count": 210 }
729
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0H24V24H0z"/> <path d="M16.5 3C19.538 3 22 5.5 22 9c0 7-7.5 11-10 12.5C9.5 20 2 16 2 9c0-3.5 2.5-6 5.5-6C9.36 3 11 4 12 5c1-1 2.64-2 4.5-2zm-3.566 15.604c.881-.556 1.676-1.109 2.42-1.701C18.335 14.533 20 11.943 20 9c0-2.36-1.537-4-3.5-4-1.076 0-2.24.57-3.086 1.414L12 7.828l-1.414-1.414C9.74 5.57 8.576 5 7.5 5 5.56 5 4 6.656 4 9c0 2.944 1.666 5.533 4.645 7.903.745.592 1.54 1.145 2.421 1.7.299.189.595.37.934.572.339-.202.635-.383.934-.571z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/heart-3-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/heart-3-line.svg", "repo_id": "owncloud", "token_count": 349 }
730
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M22 21H2v-2h1V4a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v5h2v10h1v2zm-5-2h2v-8h-6v8h2v-6h2v6zm0-10V5H5v14h6V9h6zM7 11h2v2H7v-2zm0 4h2v2H7v-2zm0-8h2v2H7V7z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/hotel-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/hotel-line.svg", "repo_id": "owncloud", "token_count": 211 }
731
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M4.828 21l-.02.02-.021-.02H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H4.828zM20 15V5H4v14L14 9l6 6zm0 2.828l-6-6L6.828 19H20v-1.172zM8 11a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/image-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/image-line.svg", "repo_id": "owncloud", "token_count": 230 }
732
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0H24V24H0z"/> <path d="M21 2v9h-3.001L18 12c0 2.21-1.79 4-4 4h-1.379l-.613 3.111.911 1.321c.314.455.2 1.078-.255 1.391-.167.115-.365.177-.568.177H3l2.313-10.024L3 11l4-9h14zm-2 2H8.3L5.655 9.95l1.985.837L5.514 20h4.678l-.309-.448L11.96 9H19V4zm-3.001 7h-2.394l-.591 3H14c1.105 0 2-.895 2-2l-.001-1z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/infrared-thermometer-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/infrared-thermometer-line.svg", "repo_id": "owncloud", "token_count": 259 }
733
<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="M4.342 1.408L22.373 19.44a1.5 1.5 0 0 1-2.121 2.122l-4.596-4.597L12.12 20.5l-7.778-7.778a8 8 0 0 1-.174-11.135l.174-.179zm.241 3.07l-.051.11a6.005 6.005 0 0 0 1.047 6.535l.177.185 6.363 6.363 2.829-2.828L4.583 4.478z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/knife-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/knife-line.svg", "repo_id": "owncloud", "token_count": 225 }
734
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0H24V24H0z"/> <path d="M5 3v16h16v2H3V3h2zm15.293 3.293l1.414 1.414L16 13.414l-3-2.999-4.293 4.292-1.414-1.414L13 7.586l3 2.999 4.293-4.292z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/line-chart-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/line-chart-line.svg", "repo_id": "owncloud", "token_count": 163 }
735
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M11 4h10v2H11V4zm0 4h6v2h-6V8zm0 6h10v2H11v-2zm0 4h6v2h-6v-2zM3 4h6v6H3V4zm2 2v2h2V6H5zm-2 8h6v6H3v-6zm2 2v2h2v-2H5z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/list-check-2.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/list-check-2.svg", "repo_id": "owncloud", "token_count": 191 }
736
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 2a1 1 0 0 1 1 1v3a1 1 0 0 1-2 0V3a1 1 0 0 1 1-1zm0 15a1 1 0 0 1 1 1v3a1 1 0 0 1-2 0v-3a1 1 0 0 1 1-1zm8.66-10a1 1 0 0 1-.366 1.366l-2.598 1.5a1 1 0 1 1-1-1.732l2.598-1.5A1 1 0 0 1 20.66 7zM7.67 14.5a1 1 0 0 1-.366 1.366l-2.598 1.5a1 1 0 1 1-1-1.732l2.598-1.5a1 1 0 0 1 1.366.366zM20.66 17a1 1 0 0 1-1.366.366l-2.598-1.5a1 1 0 0 1 1-1.732l2.598 1.5A1 1 0 0 1 20.66 17zM7.67 9.5a1 1 0 0 1-1.366.366l-2.598-1.5a1 1 0 1 1 1-1.732l2.598 1.5A1 1 0 0 1 7.67 9.5z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/loader-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/loader-fill.svg", "repo_id": "owncloud", "token_count": 389 }
737
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M5 22a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5zm10-6l5-4-5-4v3H9v2h6v3z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/logout-box-r-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/logout-box-r-fill.svg", "repo_id": "owncloud", "token_count": 159 }
738
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M14 18v2l2 1v1H8l-.004-.996L10 20v-2H2.992A.998.998 0 0 1 2 16.993V4.007C2 3.451 2.455 3 2.992 3h18.016c.548 0 .992.449.992 1.007v12.986c0 .556-.455 1.007-.992 1.007H14zM4 14v2h16v-2H4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/mac-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/mac-fill.svg", "repo_id": "owncloud", "token_count": 195 }
739
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M20 7.238l-7.928 7.1L4 7.216V19h7.07a6.95 6.95 0 0 0 .604 2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v8.255a6.972 6.972 0 0 0-2-.965V7.238zM19.501 5H4.511l7.55 6.662L19.502 5zm-2.794 15.708a3 3 0 0 0 4.001-4.001l-4.001 4zm-1.415-1.415l4.001-4a3 3 0 0 0-4.001 4.001zM18 23a5 5 0 1 1 0-10 5 5 0 0 1 0 10z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/mail-forbid-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/mail-forbid-line.svg", "repo_id": "owncloud", "token_count": 284 }
740
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M2 5l7-3 6 3 6.303-2.701a.5.5 0 0 1 .697.46V19l-7 3-6-3-6.303 2.701a.5.5 0 0 1-.697-.46V5zm13 14.764V7.176l-.065.028L9 4.236v12.588l.065-.028L15 19.764z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/map-2-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/map-2-fill.svg", "repo_id": "owncloud", "token_count": 186 }
741
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M11 17.938A8.001 8.001 0 0 1 12 2a8 8 0 0 1 1 15.938v2.074c3.946.092 7 .723 7 1.488 0 .828-3.582 1.5-8 1.5s-8-.672-8-1.5c0-.765 3.054-1.396 7-1.488v-2.074zM12 12a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/map-pin-range-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/map-pin-range-fill.svg", "repo_id": "owncloud", "token_count": 209 }
742
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 8.5l2.116 5.088 5.492.44-4.184 3.584 1.278 5.36L12 20.1l-4.702 2.872 1.278-5.36-4.184-3.584 5.492-.44L12 8.5zM8 2v9H6V2h2zm10 0v9h-2V2h2zm-5 0v5h-2V2h2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/medal-2-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/medal-2-fill.svg", "repo_id": "owncloud", "token_count": 197 }
743
<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="M18.5 2a4.5 4.5 0 0 1 .883 8.913l.011.027a8 8 0 0 1-7.145 11.056L12 22a8 8 0 0 1-7.382-11.088A4.499 4.499 0 0 1 5.5 2a4.5 4.5 0 0 1 4.493 4.254l.073-.019A8.018 8.018 0 0 1 12 6l.25.004a8 8 0 0 1 1.756.25A4.5 4.5 0 0 1 18.5 2zM12 8a6 6 0 1 0 0 12 6 6 0 0 0 0-12zM5.5 4a2.5 2.5 0 0 0 0 5l.164-.005.103-.01A8.044 8.044 0 0 1 7.594 7.32l.33-.206A2.5 2.5 0 0 0 5.5 4zm13 0a2.5 2.5 0 0 0-2.466 2.916l.043.2.028.016a8.04 8.04 0 0 1 2.128 1.852A2.5 2.5 0 1 0 18.5 4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/mickey-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/mickey-line.svg", "repo_id": "owncloud", "token_count": 374 }
744
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-3.5-8v2H11v2h2v-2h1a2.5 2.5 0 1 0 0-5h-4a.5.5 0 1 1 0-1h5.5V8H13V6h-2v2h-1a2.5 2.5 0 0 0 0 5h4a.5.5 0 1 1 0 1H8.5z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/money-dollar-circle-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/money-dollar-circle-fill.svg", "repo_id": "owncloud", "token_count": 219 }
745
<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="M16 20.334v-2.199a7.522 7.522 0 0 0 3.623-4.281 9 9 0 0 1-10.622-8.99A7.518 7.518 0 0 0 5.151 10H3.117a9.505 9.505 0 0 1 8.538-7.963 7 7 0 0 0 10.316 8.728A9.503 9.503 0 0 1 16 20.335zM7 20h7v2H7v-2zm-3-8h6v2H4v-2zm-2 4h10v2H2v-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/moon-foggy-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/moon-foggy-line.svg", "repo_id": "owncloud", "token_count": 240 }
746
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 13.535V3h8v3h-6v11a4 4 0 1 1-2-3.465z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/music-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/music-fill.svg", "repo_id": "owncloud", "token_count": 117 }
747
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M20 17h2v2H2v-2h2v-7a8 8 0 1 1 16 0v7zm-2 0v-7a6 6 0 1 0-12 0v7h12zm-9 4h6v2H9v-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/notification-3-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/notification-3-line.svg", "repo_id": "owncloud", "token_count": 151 }
748
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M18 2v2H9.3l-.677 6.445a6.5 6.5 0 1 1-2.93 7.133l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-4.5-4.5c-2.022 0-3.278.639-3.96 1.53l-1.575-1.182L7.5 2H18z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/number-5.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/number-5.svg", "repo_id": "owncloud", "token_count": 195 }
749
<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="M8.71 6.365c-1.108 1.305-1.823 3.236-1.873 5.4v.47c.051 2.165.766 4.093 1.872 5.4 1.434 1.862 3.566 3.044 5.95 3.044a7.208 7.208 0 0 0 4.005-1.226 9.94 9.94 0 0 1-7.139 2.535A9.998 9.998 0 0 1 2 12C2 6.476 6.478 2 12 2h.037a9.97 9.97 0 0 1 6.628 2.546 7.239 7.239 0 0 0-4.008-1.226c-2.382 0-4.514 1.183-5.95 3.045h.002zM22 12a9.969 9.969 0 0 1-3.335 7.454c-2.565 1.25-4.955.376-5.747-.17 2.52-.554 4.423-3.6 4.423-7.284 0-3.685-1.903-6.73-4.423-7.283.791-.545 3.182-1.42 5.747-.171A9.967 9.967 0 0 1 22 12z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/opera-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/opera-fill.svg", "repo_id": "owncloud", "token_count": 401 }
750
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 2c5.522 0 10 3.978 10 8.889a5.558 5.558 0 0 1-5.556 5.555h-1.966c-.922 0-1.667.745-1.667 1.667 0 .422.167.811.422 1.1.267.3.434.689.434 1.122C13.667 21.256 12.9 22 12 22 6.478 22 2 17.522 2 12S6.478 2 12 2zM7.5 12a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm9 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM12 9a1.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/palette-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/palette-fill.svg", "repo_id": "owncloud", "token_count": 288 }
751
<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="M15 17a7.5 7.5 0 1 1 0-15 7.5 7.5 0 0 1 0 15zm0-2a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11zM2 2h5v20H2V2zm2 2v16h1V4H4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/patreon-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/patreon-line.svg", "repo_id": "owncloud", "token_count": 176 }
752
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M5 8v12h4V8H5zM3 7l4-5 4 5v15H3V7zm16 9v-2h-3v-2h3v-2h-2V8h2V6h-4v14h4v-2h-2v-2h2zM14 4h6a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/pencil-ruler-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/pencil-ruler-line.svg", "repo_id": "owncloud", "token_count": 210 }
753
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M14 8.947L22 14v2l-8-2.526v5.36l3 1.666V22l-4.5-1L8 22v-1.5l3-1.667v-5.36L3 16v-2l8-5.053V3.5a1.5 1.5 0 0 1 3 0v5.447z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/plane-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/plane-fill.svg", "repo_id": "owncloud", "token_count": 177 }
754
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0H24V24H0z"/> <path d="M9 7.539L15 21.539 18.659 13 23 13 23 11 17.341 11 15 16.461 9 2.461 5.341 11 1 11 1 13 6.659 13z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/pulse-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/pulse-fill.svg", "repo_id": "owncloud", "token_count": 133 }
755
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-1-7v2h2v-2h-2zm2-1.645A3.502 3.502 0 0 0 12 6.5a3.501 3.501 0 0 0-3.433 2.813l1.962.393A1.5 1.5 0 1 1 12 11.5a1 1 0 0 0-1 1V14h2v-.645z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/question-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/question-fill.svg", "repo_id": "owncloud", "token_count": 217 }
756
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 4c6.075 0 11 4.925 11 11v5h-2v-5a9 9 0 0 0-8.735-8.996L12 6a9 9 0 0 0-8.996 8.735L3 15v5H1v-5C1 8.925 5.925 4 12 4zm0 4a7 7 0 0 1 7 7v5h-2v-5a5 5 0 0 0-4.783-4.995L12 10a5 5 0 0 0-4.995 4.783L7 15v5H5v-5a7 7 0 0 1 7-7zm0 4a3 3 0 0 1 3 3v5h-2v-5a1 1 0 0 0-.883-.993L12 14a1 1 0 0 0-.993.883L11 15v5H9v-5a3 3 0 0 1 3-3z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/rainbow-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/rainbow-line.svg", "repo_id": "owncloud", "token_count": 295 }
757
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M5.463 4.433A9.961 9.961 0 0 1 12 2c5.523 0 10 4.477 10 10 0 2.136-.67 4.116-1.81 5.74L17 12h3A8 8 0 0 0 6.46 6.228l-.997-1.795zm13.074 15.134A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12c0-2.136.67-4.116 1.81-5.74L7 12H4a8 8 0 0 0 13.54 5.772l.997 1.795z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/refresh-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/refresh-line.svg", "repo_id": "owncloud", "token_count": 237 }
758
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 520 550"> <!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"></path> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/resource-type-folder-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/resource-type-folder-fill.svg", "repo_id": "owncloud", "token_count": 225 }
759
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0H24V24H0z"/> <path d="M11 6v2c-3.314 0-6 2.686-6 6s2.686 6 6 6c3.238 0 5.878-2.566 5.996-5.775L17 14h2c0 4.418-3.582 8-8 8s-8-3.582-8-8c0-4.335 3.58-8 8-8zm10-4v2l-5.327 6H21v2h-8v-2l5.326-6H13V2h8z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/rest-time-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/rest-time-line.svg", "repo_id": "owncloud", "token_count": 214 }
760
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M4 6.143v12.824l5.065-2.17 6 3L20 17.68V4.857l1.303-.558a.5.5 0 0 1 .697.46V19l-7 3-6-3-6.303 2.701a.5.5 0 0 1-.697-.46V7l2-.857zm12.243 5.1L12 15.485l-4.243-4.242a6 6 0 1 1 8.486 0zM12 12.657l2.828-2.829a4 4 0 1 0-5.656 0L12 12.657z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/road-map-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/road-map-line.svg", "repo_id": "owncloud", "token_count": 238 }
761
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M3 3c9.941 0 18 8.059 18 18h-3c0-8.284-6.716-15-15-15V3zm0 7c6.075 0 11 4.925 11 11h-3a8 8 0 0 0-8-8v-3zm0 7a4 4 0 0 1 4 4H3v-4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/rss-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/rss-fill.svg", "repo_id": "owncloud", "token_count": 174 }
762
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M4 3h13l3.707 3.707a1 1 0 0 1 .293.707V20a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm8 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM5 5v4h10V5H5z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/save-2-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/save-2-fill.svg", "repo_id": "owncloud", "token_count": 177 }
763
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 14.121l-2.317 2.317a4 4 0 1 1-2.121-2.121L9.88 12 4.21 6.333a2 2 0 0 1 0-2.829l.708-.707L12 9.88l7.081-7.082.708.707a2 2 0 0 1 0 2.829L14.12 12l2.317 2.317a4 4 0 1 1-2.121 2.121L12 14.12zM6 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm12 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/scissors-2-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/scissors-2-fill.svg", "repo_id": "owncloud", "token_count": 244 }
764
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 1l9.5 5.5v11L12 23l-9.5-5.5v-11L12 1zm0 2.311L4.5 7.653v8.694l7.5 4.342 7.5-4.342V7.653L12 3.311zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm0-2a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/settings-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/settings-line.svg", "repo_id": "owncloud", "token_count": 200 }
765
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M13.12 17.023l-4.199-2.29a4 4 0 1 1 0-5.465l4.2-2.29a4 4 0 1 1 .959 1.755l-4.2 2.29a4.008 4.008 0 0 1 0 1.954l4.199 2.29a4 4 0 1 1-.959 1.755zM6 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm11-6a2 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 4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/share-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/share-line.svg", "repo_id": "owncloud", "token_count": 238 }
766
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M9 4h5.446a1 1 0 0 1 .848.47L18.75 10h4.408a.5.5 0 0 1 .439.74L19.637 18H19a6.01 6.01 0 0 1-1.535-.198L20.63 12H3.4l1.048 5.824A6.013 6.013 0 0 1 3 18h-.545l-1.24-6.821A1 1 0 0 1 2.197 10H3V5a1 1 0 0 1 1-1h1V1h4v3zm-4 6h11.392l-2.5-4H5v4zM3 20a5.978 5.978 0 0 0 4-1.528A5.978 5.978 0 0 0 11 20a5.978 5.978 0 0 0 4-1.528A5.978 5.978 0 0 0 19 20h2v2h-2a7.963 7.963 0 0 1-4-1.07A7.963 7.963 0 0 1 11 22a7.963 7.963 0 0 1-4-1.07A7.963 7.963 0 0 1 3 22H1v-2h2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/ship-2-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/ship-2-line.svg", "repo_id": "owncloud", "token_count": 381 }
767
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M14.417 6.679C15.447 7.773 16 9 16 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C9.591 12.322 8.17 10.841 8.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/single-quotes-r.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/single-quotes-r.svg", "repo_id": "owncloud", "token_count": 229 }
768
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M17.5 2.5L23 12l-5.5 9.5h-11L1 12l5.5-9.5h11zM11 15v2h2v-2h-2zm0-8v6h2V7h-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/spam-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/spam-fill.svg", "repo_id": "owncloud", "token_count": 151 }
769
<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="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.55 2 12 2zm3.75 14.65c-2.35-1.45-5.3-1.75-8.8-.95-.35.1-.65-.15-.75-.45-.1-.35.15-.65.45-.75 3.8-.85 7.1-.5 9.7 1.1.35.15.4.55.25.85-.2.3-.55.4-.85.2zm1-2.7c-2.7-1.65-6.8-2.15-9.95-1.15-.4.1-.85-.1-.95-.5-.1-.4.1-.85.5-.95 3.65-1.1 8.15-.55 11.25 1.35.3.15.45.65.2 1s-.7.5-1.05.25zM6.3 9.75c-.5.15-1-.15-1.15-.6-.15-.5.15-1 .6-1.15 3.55-1.05 9.4-.85 13.1 1.35.45.25.6.85.35 1.3-.25.35-.85.5-1.3.25C14.7 9 9.35 8.8 6.3 9.75z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/spotify-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/spotify-fill.svg", "repo_id": "owncloud", "token_count": 422 }
770
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 17l-5.878 3.59 1.598-6.7-5.23-4.48 6.865-.55L12 2.5l2.645 6.36 6.866.55-5.231 4.48 1.598 6.7z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/star-s-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/star-s-fill.svg", "repo_id": "owncloud", "token_count": 152 }
771
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M8 5h3v9H8v3H6v-3H3V5h3V2h2v3zm10 5h3v9h-3v3h-2v-3h-3v-9h3V7h2v3z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/stock-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/stock-fill.svg", "repo_id": "owncloud", "token_count": 150 }
772
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M11 6v13H9V6H3V4h14v2h-6zm8.55 10.58a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 14a2 2 0 0 1 1.373 3.454L18.744 19H21v1h-4v-1l2.55-2.42z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/subscript-2.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/subscript-2.svg", "repo_id": "owncloud", "token_count": 186 }
773
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.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.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/sun-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/sun-fill.svg", "repo_id": "owncloud", "token_count": 313 }
774
<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="M12 3v4H6.236l-2.001 4H22v10a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1v-1H5v1a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V11l2.447-4.894A2 2 0 0 1 6.237 5H9V3h3zm8 10H4v5h16v-5zM6.5 14a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm1-13a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9zm0 5.167c-.491 0-.94.177-1.289.47l-.125.115L18.5 8.167l1.413-1.416a1.994 1.994 0 0 0-1.413-.584zm0-2.667a4.65 4.65 0 0 0-3.128 1.203l-.173.165.944.942a3.323 3.323 0 0 1 2.357-.977 3.32 3.32 0 0 1 2.201.83l.156.147.943-.943A4.652 4.652 0 0 0 18.5 3.5z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/taxi-wifi-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/taxi-wifi-line.svg", "repo_id": "owncloud", "token_count": 440 }
775
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0H24V24H0z"/> <path d="M17 2v2h-1v14c0 2.21-1.79 4-4 4s-4-1.79-4-4V4H7V2h10zm-3 8h-4v8c0 1.105.895 2 2 2s2-.895 2-2v-8zm-1 5c.552 0 1 .448 1 1s-.448 1-1 1-1-.448-1-1 .448-1 1-1zm-2-3c.552 0 1 .448 1 1s-.448 1-1 1-1-.448-1-1 .448-1 1-1zm3-8h-4v4h4V4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/test-tube-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/test-tube-line.svg", "repo_id": "owncloud", "token_count": 250 }
776
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M2 3h20v2H2V3zm2 4h16v2H4V7zm4 4h14v2H8v-2zm2 4h8v2h-8v-2zm-2 4h6v2H8v-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/tornado-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/tornado-fill.svg", "repo_id": "owncloud", "token_count": 153 }
777
<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="M5.25 3h13.5A2.25 2.25 0 0 1 21 5.25v13.5A2.25 2.25 0 0 1 18.75 21H5.25A2.25 2.25 0 0 1 3 18.75V5.25A2.25 2.25 0 0 1 5.25 3zm7.92 3.42v5.76c0 .596.484 1.08 1.08 1.08h3.33a1.08 1.08 0 0 0 1.08-1.08V6.42a1.08 1.08 0 0 0-1.08-1.08h-3.33a1.08 1.08 0 0 0-1.08 1.08zm-7.83 0v10.26c0 .596.484 1.08 1.08 1.08h3.33a1.08 1.08 0 0 0 1.08-1.08V6.42a1.08 1.08 0 0 0-1.08-1.08H6.42a1.08 1.08 0 0 0-1.08 1.08z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/trello-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/trello-fill.svg", "repo_id": "owncloud", "token_count": 355 }
778
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M17.654 1.7l-2.782 2.533a9.137 9.137 0 0 1 3.49 1.973c3.512 3.2 3.512 8.388 0 11.588-2.592 2.36-6.598 3.862-12.016 4.506l2.782-2.533a9.137 9.137 0 0 1-3.49-1.973c-3.512-3.2-3.533-8.369 0-11.588C8.23 3.846 12.237 2.344 17.655 1.7zM12 8c-2.485 0-4.5 1.79-4.5 4s2.015 4 4.5 4 4.5-1.79 4.5-4-2.015-4-4.5-4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/typhoon-fill.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/typhoon-fill.svg", "repo_id": "owncloud", "token_count": 284 }
779
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M12 12.586l4.243 4.242-1.415 1.415L13 16.415V22h-2v-5.587l-1.828 1.83-1.415-1.415L12 12.586zM12 2a7.001 7.001 0 0 1 6.954 6.194 5.5 5.5 0 0 1-.953 10.784v-2.014a3.5 3.5 0 1 0-1.112-6.91 5 5 0 1 0-9.777 0 3.5 3.5 0 0 0-1.292 6.88l.18.03v2.014a5.5 5.5 0 0 1-.954-10.784A7 7 0 0 1 12 2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/upload-cloud-2-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/upload-cloud-2-line.svg", "repo_id": "owncloud", "token_count": 261 }
780
<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="M12 17c3.662 0 6.865 1.575 8.607 3.925l-1.842.871C17.347 20.116 14.847 19 12 19c-2.847 0-5.347 1.116-6.765 2.796l-1.841-.872C5.136 18.574 8.338 17 12 17zm0-15a5 5 0 0 1 5 5v3a5 5 0 0 1-4.783 4.995L12 15a5 5 0 0 1-5-5V7a5 5 0 0 1 4.783-4.995L12 2zm0 2a3 3 0 0 0-2.995 2.824L9 7v3a3 3 0 0 0 5.995.176L15 10V7a3 3 0 0 0-3-3z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/user-6-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/user-6-line.svg", "repo_id": "owncloud", "token_count": 291 }
781
<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 4zm9.446 9.032l1.504 1.504-1.414 1.414-1.504-1.504a4 4 0 1 1 1.414-1.414zM18 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/user-search-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/user-search-line.svg", "repo_id": "owncloud", "token_count": 264 }
782
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0H24V24H0z"/> <path d="M16 4c.552 0 1 .448 1 1v4.2l5.213-3.65c.226-.158.538-.103.697.124.058.084.09.184.09.286v12.08c0 .276-.224.5-.5.5-.103 0-.203-.032-.287-.09L17 14.8V19c0 .552-.448 1-1 1H2c-.552 0-1-.448-1-1V5c0-.552.448-1 1-1h14zm-1 2H3v12h12V6zM8 8h2v3h3v2H9.999L10 16H8l-.001-3H5v-2h3V8zm13 .841l-4 2.8v.718l4 2.8V8.84z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/video-add-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/video-add-line.svg", "repo_id": "owncloud", "token_count": 285 }
783
<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="M3.492 8.065L4.778 19h14.444l1.286-10.935-4.01 2.673L12 4.441l-4.498 6.297-4.01-2.673zM2.801 5.2L7 8l4.186-5.86a1 1 0 0 1 1.628 0L17 8l4.2-2.8a1 1 0 0 1 1.547.95l-1.643 13.967a1 1 0 0 1-.993.883H3.889a1 1 0 0 1-.993-.883L1.253 6.149A1 1 0 0 1 2.8 5.2zM12 15a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/vip-crown-2-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/vip-crown-2-line.svg", "repo_id": "owncloud", "token_count": 274 }
784
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M22 7h1v10h-1v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v3zm-2 10h-6a5 5 0 0 1 0-10h6V5H4v14h16v-2zm1-2V9h-7a3 3 0 0 0 0 6h7zm-7-4h3v2h-3v-2z"/> </g> </svg>
owncloud/web/packages/design-system/src/assets/icons/wallet-3-line.svg/0
{ "file_path": "owncloud/web/packages/design-system/src/assets/icons/wallet-3-line.svg", "repo_id": "owncloud", "token_count": 211 }
785
<template> <oc-avatar-item :width="width" :icon-size="iconSize" icon="link" :name="name" :accessible-label="accessibleLabel" /> </template> <script lang="ts"> import { defineComponent } from 'vue' import OcAvatarItem from '../OcAvatarItem/OcAvatarItem.vue' export default defineComponent({ name: 'OcAvatarLink', status: 'ready', release: '2.1.0', components: { OcAvatarItem }, props: { /** * Name of the public link used as an accessible label */ name: { type: String, required: true }, /** * Accessibility label used as alt. Use only in case the avatar is used alone. * In case the avatar is used next to username or display name leave empty. * If not specified, avatar will get `aria-hidden="true"`. **/ accessibleLabel: { type: String, required: false, default: '' }, /** * Describes the width of the avatar */ width: { type: Number, required: false, default: 30 }, /** * Describes the size of the avatar icon e.g.(small) */ iconSize: { type: String, required: false, default: 'small' } } }) </script> <docs> ```js <oc-avatar-link name="Public link" accessible-label="Public link" /> ``` </docs>
owncloud/web/packages/design-system/src/components/OcAvatarLink/OcAvatarLink.vue/0
{ "file_path": "owncloud/web/packages/design-system/src/components/OcAvatarLink/OcAvatarLink.vue", "repo_id": "owncloud", "token_count": 530 }
786
<template> <div :id="dropId" ref="drop" class="oc-drop oc-box-shadow-medium oc-rounded" @click="$_ocDrop_close" > <div v-if="$slots.default" :class="['oc-card oc-card-body oc-background-secondary', paddingClass]" > <slot /> </div> <slot v-else name="special" /> </div> </template> <script lang="ts"> import tippy, { hideAll } from 'tippy.js' import { detectOverflow } from '@popperjs/core' import { destroy, hideOnEsc } from '../../directives/OcTooltip' import { AVAILABLE_SIZES } from '../../helpers/constants' import uniqueId from '../../utils/uniqueId' import { getSizeClass } from '../../utils/sizeClasses' import { defineComponent } from 'vue' /** * Position any element in relation to another element. */ export default defineComponent({ name: 'OcDrop', status: 'ready', release: '1.0.0', props: { /** * Id of the drop. */ dropId: { type: String, required: false, default: () => uniqueId('oc-drop-') }, /** * Specifies custom Popper options */ popperOptions: { type: Object, required: false, default: () => ({}) }, /** * CSS selector for the element to be used as toggle. By default, the preceding element is used. **/ toggle: { type: String, default: '' }, /** * The position of the drop: `(top|right|bottom|left|auto)|(top|right|bottom|left|auto)-(start|end)`. **/ position: { type: String, default: 'bottom-start', validator: (value: string) => { return !!value.match( /((top|right|bottom|left|auto)|(top|right|bottom|left|auto)-(start|end))/ ) } }, /** * Events that cause the drop to show. Multiple event names are separated by spaces * * @values click, hover, manual **/ mode: { type: String, default: 'click', validator: (value: string) => { return !!value.match(/(click|hover|manual)/) } }, /** * Defines if the drop should be closed after clicking on it. Needs to have defined dropId to work. */ closeOnClick: { type: Boolean, required: false }, /** * Defines if the drop should be nested drop in another drop. */ isNested: { type: Boolean, required: false }, /** * Element selector used as a target of the drop */ target: { type: String, required: false, default: null }, /** * Defines the padding size around the drop content. Defaults to `medium`. * * @values xsmall, small, medium, large, xlarge, xxlarge, xxxlarge, remove */ paddingSize: { type: String, required: false, default: 'medium', validator: (value) => { return [...AVAILABLE_SIZES, 'remove'].some((e) => e === value) } }, /** * Determines the offset of the drop element. The value can work on both axes by using a string in the form "x, y", such as "50, 20". */ offset: { type: String, required: false, default: undefined } }, emits: ['hideDrop', 'showDrop'], data() { return { tippy: null } }, computed: { triggerMapping() { return ( { hover: 'mouseenter focus' }[this.mode] || this.mode ) }, paddingClass() { return `oc-p-${getSizeClass(this.paddingSize)}` } }, watch: { position() { this.tippy.setProps({ placement: this.position }) }, mode() { this.tippy.setProps({ trigger: this.triggerMapping }) } }, beforeUnmount() { destroy(this.tippy) }, mounted() { destroy(this.tippy) const to = this.target ? document.querySelector(this.target) : this.toggle ? document.querySelector(this.toggle) : this.$el.previousElementSibling const content = this.$refs.drop if (!to || !content) { return } const config: any = { trigger: this.triggerMapping, placement: this.position, arrow: false, hideOnClick: true, interactive: true, plugins: [hideOnEsc], theme: 'none', maxWidth: 416, offset: this.offset ?? 0, aria: { content: 'describedby' }, ...(!this.isNested && { onShow: (instance) => { this.$emit('showDrop') hideAll({ exclude: instance }) }, onHide: () => { this.$emit('hideDrop') } }), popperOptions: { ...this.popperOptions, modifiers: [ ...(this.popperOptions?.modifiers ? this.popperOptions.modifiers : []), { name: 'fixVerticalPosition', enabled: true, phase: 'beforeWrite', requiresIfExists: ['offset', 'preventOverflow', 'flip'], fn({ state }) { const overflow = detectOverflow(state) const dropHeight = state.modifiersData.fullHeight || state.elements.popper.offsetHeight const dropYPos = overflow.top * -1 - 10 const availableHeight = dropYPos + dropHeight + overflow.bottom * -1 const spaceBelow = availableHeight - dropYPos const spaceAbove = availableHeight - spaceBelow if (dropHeight > spaceBelow && dropHeight > spaceAbove) { // place drop on top of screen because of limited screen estate above and below state.styles.popper.top = `-${dropYPos}px` state.modifiersData.fullHeight = dropHeight } if (dropHeight > availableHeight) { // drop is bigger than total available height state.styles.popper.maxHeight = `${availableHeight - 10}px` state.styles.popper.overflowY = `auto` state.styles.popper.overflowX = `hidden` } } } ] }, content } if (this.target) { config.triggerTarget = this.toggle ? document.querySelector(this.toggle) : this.$el.previousElementSibling } this.tippy = tippy(to, config) }, methods: { $_ocDrop_close() { if (this.closeOnClick) { this.tippy.hide() } }, /** * Programatically show the drop * * @public */ show(duration?: number) { this.tippy.show(duration) }, /** * Programatically hide the drop * * @public */ hide(duration?: number) { this.tippy.hide(duration) } } }) </script> <style lang="scss"> .tippy-box[data-theme~='none'] { background-color: transparent; font-size: inherit; line-height: inherit; .tippy-content { // note: needed so that the box shadow from `oc-box-shadow-medium` doesn't get suppressed padding: 8px; } li.oc-menu-item-hover { a, .item-has-switch, button:not([role='switch']) { box-sizing: border-box; padding: var(--oc-space-small); color: var(--oc-color-swatch-passive-default); &:focus, &:hover { background-color: var(--oc-color-background-hover); text-decoration: none !important; border-radius: 5px; } &:hover span { color: var(--oc-color-swatch-brand-hover) !important; } span { text-decoration: none !important; } } } } .oc-drop { width: 300px; li a:focus { outline: auto 1px !important; } .oc-card { border-radius: var(--oc-space-small) !important; } } </style> <docs> ```js <template> <div class="oc-button-group oc-mt-s"> <oc-button id="my_menu" class="oc-mr-s">Menu</oc-button> <oc-drop toggle="#my_menu" mode="click"> <ul> <li icon="create_new_folder" autofocus>Item with icon</li> <li>Item without icon</li> <li>Active item</li> </ul> </oc-drop> <oc-button id="my_filter" class="oc-mr-s">Filter</oc-button> <oc-drop toggle="#my_filter" mode="hover"> <p> Lets filter: </p> <ul class="oc-list"> <li> <oc-checkbox label="" /> <span class="oc-text-muted">Show Files</span> </li> <li> <oc-checkbox label="" /> <span class="oc-text-muted">Show Folders</span> </li> <li> <oc-search-bar small placeholder="Filter by name" :button="false" label="" /> </li> </ul> </oc-drop> <oc-button id="my_advanced" class="oc-mr-s">Advanced</oc-button> <oc-drop dropId="oc-drop" toggle="#my_advanced" mode="click" closeOnClick> <div slot="special" class="oc-card"> <div class="oc-card-header"> <h3 class="oc-card-title"> Advanced </h3> </div> <div class="oc-card-body"> <p> I'm a slightly more advanced drop down and I'll be closed as soon as you click on me. </p> </div> </div> </oc-drop> <oc-button id="my_submenu_parent"> With submenu</oc-button> <oc-drop id="drop" ref="submenu_parent" drop-id="oc-drop" toggle="#my_submenu_parent" mode="click" style="max-width: 200px" > <oc-list class="user-menu-list"> <li> <oc-button appearance="raw"> Menu item 1</oc-button> </li> <li> <oc-button id="menu_with_submenu" appearance="raw"> Menu item 2<oc-icon name="arrow-drop-right" fill-type="line" class="oc-p-xs" /> </oc-button> <oc-drop id="submenu" toggle="#menu_with_submenu" mode="hover" position="right-start" isNested closeOnClick style="max-width: 200px" > <oc-list class="user-menu-list"> <li> <oc-button appearance="raw"> Submenu item 1 </oc-button> </li> <li> <oc-button appearance="raw"> Submenu item 2 </oc-button> </li> </oc-list> </oc-drop> </li> <li> <oc-button appearance="raw"> Menu item 3</oc-button> </li> </oc-list> </oc-drop> </div> </template> ``` ### Custom target ```js <div> <div> <p id="target">This is the target of the drop</p> </div> <oc-button id="custom-target-toggle">Trigger drop</oc-button> <oc-drop dropId="oc-drop-custom-target" toggle="#custom-target-toggle" target="#target" mode="click" closeOnClick> I am attached to a custom element </oc-drop> </div> ``` ### Open drop programatically ```js <template> <div> <oc-button id="manual-target" @click="open">Open</oc-button> <oc-drop ref="drop" mode="manual" target="#manual-target"> I am triggered manually </oc-drop> </div> </template> <script> export default { methods: { open() { this.$refs.drop.show() } } } </script> ``` </docs>
owncloud/web/packages/design-system/src/components/OcDrop/OcDrop.vue/0
{ "file_path": "owncloud/web/packages/design-system/src/components/OcDrop/OcDrop.vue", "repo_id": "owncloud", "token_count": 5140 }
787
import OcInfoDrop from './OcInfoDrop.vue' import { defaultPlugins, shallowMount } from 'web-test-helpers' describe('OcInfoDrop', () => { function getWrapperWithProps(props) { return shallowMount(OcInfoDrop, { props, global: { plugins: [...defaultPlugins()], renderStubDefaultSlot: true, stubs: { OcDrop: true } } }) } describe('should use props correctly', () => { it('should set title prop', () => { const wrapper = getWrapperWithProps({ title: 'test-my-title' }) expect(wrapper.find('.info-title').text()).toBe('test-my-title') }) it('should set text prop', () => { const wrapper = getWrapperWithProps({ text: 'test-my-text' }) expect(wrapper.find('.info-text').text()).toBe('test-my-text') }) it('should set list prop', () => { const listValues = [ { text: 'a-list-value' }, { text: 'b-list-value' }, { text: 'c-list-value' } ] const wrapper = getWrapperWithProps({ list: listValues }) const result = wrapper.find('.info-list').text() listValues.forEach((value) => { expect(result).toContain(value.text) }) }) it('should set a readMore link', () => { const wrapper = getWrapperWithProps({ readMoreLink: 'owncloud.design' }) const attributes = wrapper.find('.info-more-link').attributes() expect(attributes['href']).toBe('owncloud.design') expect(attributes['target']).toBe('_blank') }) it('should set end-text prop', () => { const wrapper = getWrapperWithProps({ endText: 'test-my-text' }) expect(wrapper.find('.info-text-end').text()).toBe('test-my-text') }) }) })
owncloud/web/packages/design-system/src/components/OcInfoDrop/OcInfoDrop.spec.ts/0
{ "file_path": "owncloud/web/packages/design-system/src/components/OcInfoDrop/OcInfoDrop.spec.ts", "repo_id": "owncloud", "token_count": 713 }
788
import { defaultPlugins, shallowMount } from 'web-test-helpers' import Pagination from './OcPagination.vue' const defaultProps = { pages: 5, currentPage: 3, currentRoute: { name: 'files' } } const selectors = { listItemPage: '.oc-pagination-list-item-page', listItemCurrent: '.oc-pagination-list-item-current', listItemPrevious: '.oc-pagination-list-item-prev', listItemNext: '.oc-pagination-list-item-next', listItemEllipsis: '.oc-pagination-list-item-ellipsis', listItemLink: '.oc-pagination-list-item-link' } describe('OcPagination', () => { it('displays all pages', () => { const wrapper = getWrapper() expect(wrapper.findAll(selectors.listItemPage).length).toBe(5) expect(wrapper.findAll(selectors.listItemCurrent).length).toBe(1) }) it('displays prev and next links', () => { const wrapper = getWrapper() expect(wrapper.find(selectors.listItemPrevious).exists()).toBeTruthy() expect(wrapper.find(selectors.listItemNext).exists()).toBeTruthy() }) it('hides prev link if the current page is the first page', () => { const wrapper = getWrapper({ currentPage: 1 }) expect(wrapper.find(selectors.listItemPrevious).exists()).toBeFalsy() expect(wrapper.find(selectors.listItemNext).exists()).toBeTruthy() }) it('hides next link if the current page is the last page', () => { const wrapper = getWrapper({ currentPage: 5 }) expect(wrapper.find(selectors.listItemPrevious).exists()).toBeTruthy() expect(wrapper.find(selectors.listItemNext).exists()).toBeFalsy() }) it('truncates pages if maxDisplayed prop is set', () => { const wrapper = getWrapper({ pages: 10, currentPage: 5, maxDisplayed: 3 }) expect(wrapper.findAll(selectors.listItemEllipsis).length).toBe(2) expect(wrapper.findAll(selectors.listItemLink).length).toBe(4) expect(wrapper.findAll(selectors.listItemCurrent).length).toBe(1) }) it('does not truncates pages if length of pages is the same as with ...', async () => { const wrapper = getWrapper({ pages: 4, currentPage: 1, maxDisplayed: 3 }) expect(wrapper.find(selectors.listItemEllipsis).exists()).toBeFalsy() expect(wrapper.find(selectors.listItemPrevious).exists()).toBeFalsy() expect(wrapper.find(selectors.listItemNext).exists()).toBeTruthy() await wrapper.setProps({ currentPage: 2 }) expect(wrapper.find(selectors.listItemEllipsis).exists()).toBeFalsy() expect(wrapper.find(selectors.listItemPrevious).exists()).toBeTruthy() expect(wrapper.find(selectors.listItemNext).exists()).toBeTruthy() await wrapper.setProps({ currentPage: 4 }) expect(wrapper.find(selectors.listItemEllipsis).exists()).toBeFalsy() expect(wrapper.find(selectors.listItemPrevious).exists()).toBeTruthy() expect(wrapper.find(selectors.listItemNext).exists()).toBeFalsy() await wrapper.setProps({ pages: 10 }) expect(wrapper.find(selectors.listItemEllipsis).exists()).toBeTruthy() }) it("doesn't show ellipsis if maxDisplayed prop is set but no pages are removed", () => { const wrapper = getWrapper({ maxDisplayed: 3 }) expect(wrapper.findAll(selectors.listItemEllipsis).length).toBe(0) expect(wrapper.findAll(selectors.listItemLink).length).toBe(4) expect(wrapper.findAll(selectors.listItemCurrent).length).toBe(1) }) it('logs error if maxDisplayed prop is not an even number', () => { console.error = vi.fn() expect(Pagination.props.maxDisplayed.validator(2)).toBeFalsy() }) it('builds correct prev and next links', () => { const localThis = { ...defaultProps, bindPageLink: Pagination.methods.bindPageLink, $_currentPage: 3 } expect(Pagination.computed.previousPageLink.call(localThis)).toMatchObject({ name: 'files', query: { page: 2 } }) expect(Pagination.computed.nextPageLink.call(localThis)).toMatchObject({ name: 'files', query: { page: 4 } }) }) }) function getWrapper(props = {}) { return shallowMount(Pagination, { props: { ...defaultProps, ...props }, global: { plugins: [...defaultPlugins()] } }) }
owncloud/web/packages/design-system/src/components/OcPagination/OcPagination.spec.ts/0
{ "file_path": "owncloud/web/packages/design-system/src/components/OcPagination/OcPagination.spec.ts", "repo_id": "owncloud", "token_count": 1530 }
789
import StatusIndicators from './OcStatusIndicators.vue' import { defaultPlugins, mount } from 'web-test-helpers' const fileResource = { name: 'forest.jpg', path: 'nature/forest.jpg', thumbnail: 'https://cdn.pixabay.com/photo/2015/09/09/16/05/forest-931706_960_720.jpg', indicators: [], type: 'file', isFolder: false, extension: 'jpg' } const indicator = { id: 'testid', label: 'testlabel', type: 'testtype', icon: 'icon', handler: vi.fn() } describe('OcStatusIndicators', () => { it('does call indicator handler on click', () => { const spyHandler = vi.spyOn(indicator, 'handler') const wrapper = mount(StatusIndicators, { props: { resource: fileResource, indicators: [indicator], target: 'test' }, global: { plugins: [...defaultPlugins()] } }) wrapper.find('.oc-status-indicators-indicator').trigger('click') expect(spyHandler).toHaveBeenCalled() }) it('does create indicator with id', () => { const wrapper = mount(StatusIndicators, { props: { resource: fileResource, indicators: [indicator], target: 'test' }, global: { plugins: [...defaultPlugins()] } }) expect(wrapper.find(`#${indicator.id}`).exists()).toBeTruthy() }) })
owncloud/web/packages/design-system/src/components/OcStatusIndicators/OcStatusIndicators.spec.ts/0
{ "file_path": "owncloud/web/packages/design-system/src/components/OcStatusIndicators/OcStatusIndicators.spec.ts", "repo_id": "owncloud", "token_count": 530 }
790
<template> <div> <label class="oc-label" :for="id" v-text="label" /> <textarea :id="id" v-bind="additionalAttributes" class="oc-textarea oc-rounded" :class="{ 'oc-textarea-warning': !!warningMessage, 'oc-textarea-danger': !!errorMessage }" :value="modelValue" :aria-invalid="ariaInvalid" @input="onInput(($event.target as HTMLInputElement).value)" @focus="onFocus(($event.target as HTMLInputElement).value)" @keydown="onKeyDown($event)" /> <div v-if="showMessageLine" class="oc-textarea-message"> <span :id="messageId" :class="{ 'oc-textarea-description': !!descriptionMessage, 'oc-textarea-warning': !!warningMessage, 'oc-textarea-danger': !!errorMessage }" v-text="messageText" /> </div> </div> </template> <script lang="ts"> import { defineComponent, HTMLAttributes } from 'vue' import uniqueId from '../../utils/uniqueId' /** * Textareas are used to allow users to provide text input when the expected * input is long. Textarea has a range of options. For shorter input, * use the `Input` element. * * ## Accessibility * The label is required and represents the name of the textarea. * * The description-message can be used additionally to give further information about the textarea . When a * description is given, it will be automatically referenced via the `aria-describedby` property. * An error or warning will replace the description as well as the `aria-describedby` property until the error * or warning is fixed. */ export default defineComponent({ name: 'OcTextarea', status: 'ready', release: '1.0.0', props: { /** * The ID of the element. */ id: { type: String, required: false, default: () => uniqueId('oc-textarea-') }, /** * Text value of the form textarea. */ modelValue: { type: String, default: null }, /** * Label of the textarea. **/ label: { type: String, required: true, default: null }, /** * A warning message which is shown below the textarea. */ warningMessage: { type: String, default: null }, /** * An error message which is shown below the textarea. */ errorMessage: { type: String, default: null }, /** * A description text which is shown below the textarea. */ descriptionMessage: { type: String, default: null }, /** * Whether or not vertical space below the textarea should be reserved for a one line message, * so that content actually appearing there doesn't shift the layout. */ fixMessageLine: { type: Boolean, default: false }, /** * Configure if the value should be emitted on 'enter' or if it should do a linebreak * if true: 'enter' emits value, ctrl + enter and shift + enter creates linebreak * if false: 'enter' creates linebreak */ submitOnEnter: { type: Boolean, required: false, default: true } }, emits: ['update:modelValue', 'focus', 'change', 'keydown'], computed: { showMessageLine() { return ( this.fixMessageLine || !!this.warningMessage || !!this.errorMessage || !!this.descriptionMessage ) }, messageId() { return `${this.id}-message` }, additionalAttributes() { const additionalAttrs = {} if (!!this.warningMessage || !!this.errorMessage || !!this.descriptionMessage) { additionalAttrs['aria-describedby'] = this.messageId } return { ...this.$attrs, ...additionalAttrs } }, ariaInvalid() { return (!!this.errorMessage).toString() as HTMLAttributes['aria-invalid'] }, messageText() { if (this.errorMessage) { return this.errorMessage } if (this.warningMessage) { return this.warningMessage } return this.descriptionMessage } }, methods: { /** * Puts focus on this input element * @public */ focus() { ;(this.$refs.input as HTMLInputElement).focus() }, onInput(value) { /** * Input event * @type {event} **/ this.$emit('update:modelValue', value) }, onFocus(value) { /** * Focus event - emitted as soon as the input field is focused * @type {event} **/ this.$emit('focus', value) }, onKeyDown(e) { const enterKey = e.key?.toLowerCase() === 'enter' if (this.submitOnEnter && enterKey && !e.ctrlKey && !e.shiftKey) { /** * Change event - emitted as soon as the user hits enter (without ctrl or shift) * Only applies if submitOnEnter is set to true * @type {string} */ this.$emit('change', e.target.value) } /** * KeyDown event - emitted as soon as the user hits a key * @type {event} */ this.$emit('keydown', e) } } }) </script> <style lang="scss"> .oc-textarea { padding-bottom: var(--oc-space-xsmall); padding-top: var(--oc-space-xsmall); box-sizing: border-box; background: var(--oc-color-background-muted); border: 0 none; margin: 0; color: var(--oc-color-text-default); max-width: 100%; width: 100%; overflow: auto; &:disabled { color: var(--oc-color-input-text-muted); } &:focus { border-color: var(--oc-color-input-text-default); background-color: var(--oc-color-background-muted); color: var(--oc-color-text-default); } &-warning, &-warning:focus { border-color: var(--oc-color-swatch-warning-default); color: var(--oc-color-swatch-warning-default); } &-danger, &-danger:focus { border-color: var(--oc-color-swatch-danger-default); color: var(--oc-color-swatch-danger-default); } &-description { color: var(--oc-color-text-muted); } &-message { display: flex; align-items: center; margin-top: var(--oc-space-xsmall); min-height: $oc-font-size-default * 1.5; } } </style> <docs> ```js <template> <div> <h3 class="oc-heading-divider"> Textarea fields </h3> <oc-textarea class="oc-mb-s" label="A simple textarea" /> <oc-textarea disabled value="I am disabled" label="Disabled Textarea" /> <h3 class="oc-heading-divider"> Messages </h3> <oc-textarea label="Textarea with description message below" class="oc-mb-s" description-message="This is a description message." :fix-message-line="true" /> <oc-textarea label="Textarea with error and warning messages with reserved space below" class="oc-mb-s" v-model="valueForMessages" :error-message="errorMessage" :warning-message="warningMessage" :fix-message-line="true" /> <oc-textarea label="Textarea with error and warning messages without reserved space below" class="oc-mb-s" v-model="valueForMessages" :error-message="errorMessage" :warning-message="warningMessage" /> </div> </template> <script> export default { data: () => { return { inputValue: 'initial', valueForMessages: '', } }, computed: { errorMessage() { return this.valueForMessages.length === 0 ? 'Value is required.' : '' }, warningMessage() { return this.valueForMessages.endsWith(' ') ? 'Trailing whitespace should be avoided.' : '' } }, methods: { _focus() { this.$refs.inputForFocus.focus() }, _focusAndSelect() { this.$refs.inputForFocusSelect.focus() } } } </script> ``` </docs>
owncloud/web/packages/design-system/src/components/OcTextarea/OcTextarea.vue/0
{ "file_path": "owncloud/web/packages/design-system/src/components/OcTextarea/OcTextarea.vue", "repo_id": "owncloud", "token_count": 3179 }
791
<template> <div class="oc-text-input-password-wrapper" :class="{ 'oc-text-input-password-wrapper-warning': hasWarning, 'oc-text-input-password-wrapper-danger': hasError }" > <input v-bind="$attrs" ref="passwordInput" v-model="password" :type="showPassword ? 'text' : 'password'" :disabled="disabled" @input="onPasswordEntered" /> <oc-button v-if="password && !disabled" v-oc-tooltip="$gettext('Show password')" class="oc-text-input-show-password-toggle oc-px-s oc-background-default" appearance="raw" size="small" @click="showPassword = !showPassword" > <oc-icon size="small" :name="showPassword ? 'eye-off' : 'eye'" /> </oc-button> <oc-button v-if="password && !disabled" v-oc-tooltip="$gettext('Copy password')" class="oc-text-input-copy-password-button oc-px-s oc-background-default" appearance="raw" size="small" @click="copyPasswordToClipboard" > <oc-icon size="small" :name="copyPasswordIcon" /> </oc-button> <oc-button v-if="generatePasswordMethod && !disabled" v-oc-tooltip="$gettext('Generate password')" class="oc-text-input-generate-password-button oc-px-s oc-background-default" appearance="raw" size="small" @click="generatePassword" > <oc-icon size="small" name="refresh" fill-type="line" /> </oc-button> </div> <portal v-if="showPasswordPolicyInformation" to="app.design-system.password-policy"> <div class="oc-text-small oc-flex oc-flex-column"> <span v-text="$gettext('Please enter a password that meets the following criteria:')" /> <div v-for="(testedRule, index) in testedPasswordPolicy.rules" :key="index" class="oc-flex oc-flex-middle" > <oc-icon size="small" :name="testedRule.verified ? 'check' : 'close'" :variation="testedRule.verified ? 'success' : 'danger'" /> <span :class="[ { 'oc-text-input-success': testedRule.verified }, { 'oc-text-input-danger': !testedRule.verified } ]" v-text="getPasswordPolicyRuleMessage(testedRule)" ></span> </div> </div> </portal> </template> <script lang="ts"> import { computed, defineComponent, PropType, ref, unref, watch } from 'vue' import OcIcon from '../OcIcon/OcIcon.vue' import OcButton from '../OcButton/OcButton.vue' import { useGettext } from 'vue3-gettext' import { PasswordPolicy } from '../../helpers' export default defineComponent({ name: 'OCTextInputPassword', components: { OcButton, OcIcon }, status: 'ready', release: '1.0.0', inheritAttrs: true, props: { value: { type: String, required: false, default: '' }, passwordPolicy: { type: Object as PropType<PasswordPolicy>, default: () => ({}) }, generatePasswordMethod: { type: Function as PropType<(...args: unknown[]) => string>, required: false, default: null }, hasWarning: { type: Boolean, required: false, default: false }, hasError: { type: Boolean, required: false, default: false }, disabled: { type: Boolean, required: false, default: false } }, emits: ['passwordChallengeCompleted', 'passwordChallengeFailed', 'passwordGenerated'], setup(props, { emit }) { const passwordInput = ref(null) const { $gettext } = useGettext() const password = ref(props.value) const showPassword = ref(false) const passwordEntered = ref(false) const copyPasswordIconInitial = 'file-copy' const copyPasswordIcon = ref(copyPasswordIconInitial) const showPasswordPolicyInformation = computed(() => { return !!(Object.keys(props.passwordPolicy?.rules || {}).length && unref(passwordEntered)) }) const testedPasswordPolicy = computed(() => { return props.passwordPolicy.missing(unref(password)) }) const getPasswordPolicyRuleMessage = (rule) => { const paramObj = {} for (let formatKey = 0; formatKey < rule.format.length; formatKey++) { paramObj[`param${formatKey + 1}`] = rule.format[formatKey] } return $gettext(rule.message, paramObj, true) } const copyPasswordToClipboard = () => { navigator.clipboard.writeText(unref(password)) copyPasswordIcon.value = 'check' setTimeout(() => (copyPasswordIcon.value = copyPasswordIconInitial), 500) } const generatePassword = () => { const generatedPassword = props.generatePasswordMethod() password.value = generatedPassword showPassword.value = true emit('passwordGenerated', password.value) } const onPasswordEntered = () => { passwordEntered.value = true } const focus = () => { unref(passwordInput).focus() } watch(password, (value) => { if (!Object.keys(props.passwordPolicy).length) { return } if (!props.passwordPolicy.check(value)) { return emit('passwordChallengeFailed') } emit('passwordChallengeCompleted') }) return { focus, $gettext, password, showPassword, passwordInput, copyPasswordIcon, showPasswordPolicyInformation, testedPasswordPolicy, onPasswordEntered, generatePassword, getPasswordPolicyRuleMessage, copyPasswordToClipboard } } }) </script> <style lang="scss"> .oc-text-input-password-wrapper { display: flex; flex-direction: row; padding: 0; border-radius: 5px; border: 1px solid var(--oc-color-input-border); background-color: var(--oc-color-background-highlight); input { flex-grow: 2; border: none; } input:focus { outline: none; } &-warning, &-warning:focus { border-color: var(--oc-color-swatch-warning-default) !important; color: var(--oc-color-swatch-warning-default) !important; } &-danger, &-danger:focus { border-color: var(--oc-color-swatch-danger-default) !important; color: var(--oc-color-swatch-danger-default) !important; } } .oc-text-input-password-wrapper:focus-within { border-color: var(--oc-color-swatch-passive-default); } </style>
owncloud/web/packages/design-system/src/components/_OcTextInputPassword/_OcTextInputPassword.vue/0
{ "file_path": "owncloud/web/packages/design-system/src/components/_OcTextInputPassword/_OcTextInputPassword.vue", "repo_id": "owncloud", "token_count": 2556 }
792
// We import "styles" automatically in every component // via css.preprocessorOptions.scss.additionalData but strip // it after the file has been processed. That's why we we need to // include it once more globally - to make global rules available. // If we try to just load "styles.scss" from index.html, Vite // complains that the file is already loaded. // Hence this wrapper file exists to workaround that behavior. @import "styles"
owncloud/web/packages/design-system/src/styles/stylesWrapper.scss/0
{ "file_path": "owncloud/web/packages/design-system/src/styles/stylesWrapper.scss", "repo_id": "owncloud", "token_count": 109 }
793
// Ported from UiKit until we change UI frameworks // Name: Width // Description: Utilities for widths // // Component: `oc-child-width-*` // `oc-width-*` // // ======================================================================== // Variables // ======================================================================== $width-small-width: 150px !default; $width-medium-width: 300px !default; $width-large-width: 450px !default; $width-xlarge-width: 600px !default; $width-2xlarge-width: 750px !default; /* ======================================================================== Component: Width ========================================================================== */ /* Equal child widths ========================================================================== */ [class*="oc-child-width"] > * { box-sizing: border-box; width: 100%; } .oc-child-width-1-2 > * { width: 50%; } .oc-child-width-1-3 > * { width: calc(100% * 1 / 3.001); } .oc-child-width-1-4 > * { width: 25%; } .oc-child-width-1-5 > * { width: 20%; } .oc-child-width-1-6 > * { width: calc(100% * 1 / 6.001); } .oc-child-width-auto > * { width: auto; } /* * 1. Reset the `min-width`, which is set to auto by default, because * flex items won't shrink below their minimum intrinsic content size. * Using `1px` instead of `0`, so items still wrap into the next line, * if they have zero width and padding and the predecessor is 100% wide. */ .oc-child-width-expand > :not([class*="oc-width"]) { flex: 1; /* 1 */ min-width: 1px; } /* Phone landscape and bigger */ @media (min-width: $oc-breakpoint-small-default) { .oc-child-width-1-1\@s > * { width: 100%; } .oc-child-width-1-2\@s > * { width: 50%; } .oc-child-width-1-3\@s > * { width: calc(100% * 1 / 3.001); } .oc-child-width-1-4\@s > * { width: 25%; } .oc-child-width-1-5\@s > * { width: 20%; } .oc-child-width-1-6\@s > * { width: calc(100% * 1 / 6.001); } .oc-child-width-auto\@s > * { width: auto; } .oc-child-width-expand\@s > :not([class*="oc-width"]) { flex: 1; min-width: 1px; } } /* Tablet landscape and bigger */ @media (min-width: $oc-breakpoint-medium-default) { .oc-child-width-1-1\@m > * { width: 100%; } .oc-child-width-1-2\@m > * { width: 50%; } .oc-child-width-1-3\@m > * { width: calc(100% * 1 / 3.001); } .oc-child-width-1-4\@m > * { width: 25%; } .oc-child-width-1-5\@m > * { width: 20%; } .oc-child-width-1-6\@m > * { width: calc(100% * 1 / 6.001); } .oc-child-width-auto\@m > * { width: auto; } .oc-child-width-expand\@m > :not([class*="oc-width"]) { flex: 1; min-width: 1px; } } /* Desktop and bigger */ @media (min-width: $oc-breakpoint-large-default) { .oc-child-width-1-1\@l > * { width: 100%; } .oc-child-width-1-2\@l > * { width: 50%; } .oc-child-width-1-3\@l > * { width: calc(100% * 1 / 3.001); } .oc-child-width-1-4\@l > * { width: 25%; } .oc-child-width-1-5\@l > * { width: 20%; } .oc-child-width-1-6\@l > * { width: calc(100% * 1 / 6.001); } .oc-child-width-auto\@l > * { width: auto; } .oc-child-width-expand\@l > :not([class*="oc-width"]) { flex: 1; min-width: 1px; } } /* Large screen and bigger */ @media (min-width: $oc-breakpoint-xlarge) { .oc-child-width-1-1\@xl > * { width: 100%; } .oc-child-width-1-2\@xl > * { width: 50%; } .oc-child-width-1-3\@xl > * { width: calc(100% * 1 / 3.001); } .oc-child-width-1-4\@xl > * { width: 25%; } .oc-child-width-1-5\@xl > * { width: 20%; } .oc-child-width-1-6\@xl > * { width: calc(100% * 1 / 6.001); } .oc-child-width-auto\@xl > * { width: auto; } .oc-child-width-expand\@xl > :not([class*="oc-width"]) { flex: 1; min-width: 1px; } } /* Single Widths ========================================================================== */ /* * 1. `max-width` is needed for the pixel-based classes */ [class*="oc-width"] { box-sizing: border-box; /* 1 */ max-width: 100%; width: 100%; } /* Halves */ .oc-width-1-2 { width: 50%; } /* Thirds */ .oc-width-1-3 { width: calc(100% * 1 / 3.001); } .oc-width-2-3 { width: calc(100% * 2 / 3.001); } /* Quarters */ .oc-width-1-4 { width: 25%; } .oc-width-3-4 { width: 75%; } /* Fifths */ .oc-width-1-5 { width: 20%; } .oc-width-2-5 { width: 40%; } .oc-width-3-5 { width: 60%; } .oc-width-4-5 { width: 80%; } /* Sixths */ .oc-width-1-6 { width: calc(100% * 1 / 6.001); } .oc-width-5-6 { width: calc(100% * 5 / 6.001); } /* Pixel */ .oc-width-small { width: $width-small-width; } .oc-width-medium { width: $width-medium-width; } .oc-width-large { width: $width-large-width; } .oc-width-xlarge { width: $width-xlarge-width; } .oc-width-2xlarge { width: $width-2xlarge-width; } /* Auto */ .oc-width-auto { width: auto !important; } /* Expand */ .oc-width-expand { flex: 1; min-width: 1px; } /* Phone landscape and bigger */ @media (min-width: $oc-breakpoint-small-default) { /* Whole */ .oc-width-1-1\@s { width: 100%; } /* Halves */ .oc-width-1-2\@s { width: 50%; } /* Thirds */ .oc-width-1-3\@s { width: calc(100% * 1 / 3.001); } .oc-width-2-3\@s { width: calc(100% * 2 / 3.001); } /* Quarters */ .oc-width-1-4\@s { width: 25%; } .oc-width-3-4\@s { width: 75%; } /* Fifths */ .oc-width-1-5\@s { width: 20%; } .oc-width-2-5\@s { width: 40%; } .oc-width-3-5\@s { width: 60%; } .oc-width-4-5\@s { width: 80%; } /* Sixths */ .oc-width-1-6\@s { width: calc(100% * 1 / 6.001); } .oc-width-5-6\@s { width: calc(100% * 5 / 6.001); } /* Pixel */ .oc-width-small\@s { width: $width-small-width; } .oc-width-medium\@s { width: $width-medium-width; } .oc-width-large\@s { width: $width-large-width; } .oc-width-xlarge\@s { width: $width-xlarge-width; } .oc-width-2xlarge\@s { width: $width-2xlarge-width; } /* Auto */ .oc-width-auto\@s { width: auto; } /* Expand */ .oc-width-expand\@s { flex: 1; min-width: 1px; } } /* Tablet landscape and bigger */ @media (min-width: $oc-breakpoint-medium-default) { /* Whole */ .oc-width-1-1\@m { width: 100%; } /* Halves */ .oc-width-1-2\@m { width: 50%; } /* Thirds */ .oc-width-1-3\@m { width: calc(100% * 1 / 3.001); } .oc-width-2-3\@m { width: calc(100% * 2 / 3.001); } /* Quarters */ .oc-width-1-4\@m { width: 25%; } .oc-width-3-4\@m { width: 75%; } /* Fifths */ .oc-width-1-5\@m { width: 20%; } .oc-width-2-5\@m { width: 40%; } .oc-width-3-5\@m { width: 60%; } .oc-width-4-5\@m { width: 80%; } /* Sixths */ .oc-width-1-6\@m { width: calc(100% * 1 / 6.001); } .oc-width-5-6\@m { width: calc(100% * 5 / 6.001); } /* Pixel */ .oc-width-small\@m { width: $width-small-width; } .oc-width-medium\@m { width: $width-medium-width; } .oc-width-large\@m { width: $width-large-width; } .oc-width-xlarge\@m { width: $width-xlarge-width; } .oc-width-2xlarge\@m { width: $width-2xlarge-width; } /* Auto */ .oc-width-auto\@m { width: auto; } /* Expand */ .oc-width-expand\@m { flex: 1; min-width: 1px; } } /* Desktop and bigger */ @media (min-width: $oc-breakpoint-large-default) { /* Whole */ .oc-width-1-1\@l { width: 100%; } /* Halves */ .oc-width-1-2\@l { width: 50%; } /* Thirds */ .oc-width-1-3\@l { width: calc(100% * 1 / 3.001); } .oc-width-2-3\@l { width: calc(100% * 2 / 3.001); } /* Quarters */ .oc-width-1-4\@l { width: 25%; } .oc-width-3-4\@l { width: 75%; } /* Fifths */ .oc-width-1-5\@l { width: 20%; } .oc-width-2-5\@l { width: 40%; } .oc-width-3-5\@l { width: 60%; } .oc-width-4-5\@l { width: 80%; } /* Sixths */ .oc-width-1-6\@l { width: calc(100% * 1 / 6.001); } .oc-width-5-6\@l { width: calc(100% * 5 / 6.001); } /* Pixel */ .oc-width-small\@l { width: $width-small-width; } .oc-width-medium\@l { width: $width-medium-width; } .oc-width-large\@l { width: $width-large-width; } .oc-width-xlarge\@l { width: $width-xlarge-width; } .oc-width-2xlarge\@l { width: $width-2xlarge-width; } /* Auto */ .oc-width-auto\@l { width: auto; } /* Expand */ .oc-width-expand\@l { flex: 1; min-width: 1px; } } /* Large screen and bigger */ @media (min-width: $oc-breakpoint-xlarge) { /* Whole */ .oc-width-1-1\@xl { width: 100%; } /* Halves */ .oc-width-1-2\@xl { width: 50%; } /* Thirds */ .oc-width-1-3\@xl { width: calc(100% * 1 / 3.001); } .oc-width-2-3\@xl { width: calc(100% * 2 / 3.001); } /* Quarters */ .oc-width-1-4\@xl { width: 25%; } .oc-width-3-4\@xl { width: 75%; } /* Fifths */ .oc-width-1-5\@xl { width: 20%; } .oc-width-2-5\@xl { width: 40%; } .oc-width-3-5\@xl { width: 60%; } .oc-width-4-5\@xl { width: 80%; } /* Sixths */ .oc-width-1-6\@xl { width: calc(100% * 1 / 6.001); } .oc-width-5-6\@xl { width: calc(100% * 5 / 6.001); } /* Pixel */ .oc-width-small\@xl { width: $width-small-width; } .oc-width-medium\@xl { width: $width-medium-width; } .oc-width-large\@xl { width: $width-large-width; } .oc-width-xlarge\@xl { width: $width-xlarge-width; } .oc-width-2xlarge\@xl { width: $width-2xlarge-width; } /* Auto */ .oc-width-auto\@xl { width: auto; } /* Expand */ .oc-width-expand\@xl { flex: 1; min-width: 1px; } }
owncloud/web/packages/design-system/src/styles/theme/oc-width.scss/0
{ "file_path": "owncloud/web/packages/design-system/src/styles/theme/oc-width.scss", "repo_id": "owncloud", "token_count": 4048 }
794
/** * Web Font Loader takes care of ownCloud Design System’s font loading. * For full documentation, see: https://github.com/typekit/webfontloader */ import WebFont from 'webfontloader' WebFont.load({ custom: { families: ['Inter'], urls: ['/fonts/inter.css'] } })
owncloud/web/packages/design-system/src/utils/webFontLoader.ts/0
{ "file_path": "owncloud/web/packages/design-system/src/utils/webFontLoader.ts", "repo_id": "owncloud", "token_count": 96 }
795
<template> <main class="oc-flex oc-height-1-1 app-content oc-width-1-1"> <app-loading-spinner v-if="loading" /> <template v-else> <div id="admin-settings-wrapper" class="oc-width-expand oc-height-1-1 oc-position-relative"> <div id="admin-settings-app-bar" ref="appBarRef" class="oc-app-bar oc-py-s"> <div class="admin-settings-app-bar-controls oc-flex oc-flex-between oc-flex-middle"> <oc-breadcrumb v-if="!isMobileWidth" id="admin-settings-breadcrumb" class="oc-flex oc-flex-middle" :items="breadcrumbs" /> <portal-target name="app.runtime.mobile.nav" /> <div class="oc-flex"> <view-options v-if="showViewOptions" :has-hidden-files="false" :has-file-extensions="false" :has-pagination="true" :pagination-options="paginationOptions" :per-page-default="perPageDefault" per-page-storage-prefix="admin-settings" /> </div> </div> <div v-if="showAppBar" class="admin-settings-app-bar-actions oc-flex oc-flex-middle oc-mt-xs" > <slot name="topbarActions" class="oc-flex-1 oc-flex oc-flex-start" /> <batch-actions v-if="showBatchActions" :actions="batchActions" :action-options="{ resources: batchActionItems }" :limited-screen-space="limitedScreenSpace" /> </div> </div> <slot name="mainContent" /> </div> <side-bar v-if="isSideBarOpen" :active-panel="sideBarActivePanel" :available-panels="sideBarAvailablePanels" :panel-context="sideBarPanelContext" :loading="sideBarLoading" :is-open="isSideBarOpen" @select-panel="selectPanel" @close="closeSideBar" > <template #header> <slot name="sideBarHeader" /> </template> </side-bar> </template> </main> </template> <script lang="ts"> import { perPageDefault, paginationOptions } from 'web-app-admin-settings/src/defaults' import { AppLoadingSpinner, SideBar, BatchActions, SideBarPanelContext } from '@ownclouders/web-pkg' import { defineComponent, inject, onBeforeUnmount, PropType, Ref, ref, unref, VNodeRef, watch } from 'vue' import { eventBus, useAppDefaults } from '@ownclouders/web-pkg' import { SideBarEventTopics } from '@ownclouders/web-pkg' import { SideBarPanel } from '@ownclouders/web-pkg' import { BreadcrumbItem } from 'design-system/src/components/OcBreadcrumb/types' import { ViewOptions } from '@ownclouders/web-pkg' export default defineComponent({ components: { SideBar, AppLoadingSpinner, BatchActions, ViewOptions }, props: { breadcrumbs: { required: true, type: Array as PropType<BreadcrumbItem[]> }, isSideBarOpen: { required: false, type: Boolean, default: false }, sideBarAvailablePanels: { required: false, type: Array as PropType<SideBarPanel<unknown, unknown, unknown>[]>, default: () => [] }, sideBarPanelContext: { required: false, type: Object as PropType<SideBarPanelContext<unknown, unknown, unknown>>, default: () => ({}) }, sideBarActivePanel: { required: false, type: [String, null], default: null }, loading: { required: false, type: Boolean, default: false }, sideBarLoading: { required: false, type: Boolean, default: false }, showViewOptions: { type: Boolean, required: false, default: false }, showBatchActions: { type: Boolean, required: false, default: false }, batchActionItems: { type: Array as PropType<any>, required: false, default: () => [] }, batchActions: { type: Array as PropType<any>, required: false, default: () => [] }, showAppBar: { type: Boolean, required: false, default: true } }, setup(props) { const appBarRef = ref<VNodeRef>() const limitedScreenSpace = ref(false) const onResize = () => { limitedScreenSpace.value = props.isSideBarOpen ? window.innerWidth <= 1600 : window.innerWidth <= 1200 } const resizeObserver = new ResizeObserver(onResize) const closeSideBar = () => { eventBus.publish(SideBarEventTopics.close) } const selectPanel = (panel) => { eventBus.publish(SideBarEventTopics.setActivePanel, panel) } watch( appBarRef, (ref) => { if (ref) { resizeObserver.observe(unref(appBarRef) as unknown as HTMLElement) } }, { immediate: true } ) onBeforeUnmount(() => { if (unref(appBarRef)) { resizeObserver.unobserve(unref(appBarRef) as unknown as HTMLElement) } }) return { isMobileWidth: inject<Ref<boolean>>('isMobileWidth'), appBarRef, limitedScreenSpace, closeSideBar, selectPanel, ...useAppDefaults({ applicationId: 'admin-settings' }), perPageDefault, paginationOptions } } }) </script> <style lang="scss"> #admin-settings-wrapper { overflow-y: auto; } #admin-settings-app-bar { background-color: var(--oc-color-background-default); border-top-right-radius: 15px; box-sizing: border-box; z-index: 2; position: sticky; padding: 0 var(--oc-space-medium); top: 0; } .admin-settings-app-bar-controls { height: 52px; @media (max-width: $oc-breakpoint-xsmall-max) { justify-content: space-between; } } .admin-settings-app-bar-actions { align-items: center; display: flex; min-height: 3rem; } #admin-settings-wrapper { overflow-y: auto; } </style>
owncloud/web/packages/web-app-admin-settings/src/components/AppTemplate.vue/0
{ "file_path": "owncloud/web/packages/web-app-admin-settings/src/components/AppTemplate.vue", "repo_id": "owncloud", "token_count": 2717 }
796
<template> <div id="space-list"> <div class="space-filters oc-flex oc-flex-right oc-flex-wrap oc-flex-bottom oc-mx-m oc-mb-m"> <oc-text-input id="spaces-filter" v-model="filterTerm" :label="$gettext('Search')" autocomplete="off" /> </div> <oc-table class="spaces-table" :sort-by="sortBy" :sort-dir="sortDir" :fields="fields" :data="paginatedItems" :highlighted="highlighted" :sticky="true" :header-position="fileListHeaderY" :hover="true" @sort="handleSort" @contextmenu-clicked="showContextMenuOnRightClick" @highlight="fileClicked" > <template #selectHeader> <oc-checkbox size="large" class="oc-ml-s" :label="$gettext('Select all spaces')" :model-value="allSpacesSelected" hide-label @update:model-value=" allSpacesSelected ? unselectAllSpaces() : selectSpaces(paginatedItems) " /> </template> <template #select="{ item }"> <oc-checkbox class="oc-ml-s" size="large" :model-value="isSpaceSelected(item)" :option="item" :label="getSelectSpaceLabel(item)" hide-label @update:model-value="selectSpace(item)" @click.stop="fileClicked([item, $event])" /> </template> <template #icon> <oc-icon name="layout-grid" /> </template> <template #name="{ item }"> <span class="spaces-table-space-name" :data-test-space-name="item.name" v-text="item.name" /> </template> <template #manager="{ item }"> {{ getManagerNames(item) }} </template> <template #members="{ item }"> {{ getMemberCount(item) }} </template> <template #totalQuota="{ item }"> {{ getTotalQuota(item) }}</template> <template #usedQuota="{ item }"> {{ getUsedQuota(item) }}</template> <template #remainingQuota="{ item }"> {{ getRemainingQuota(item) }}</template> <template #mdate="{ item }"> <span v-oc-tooltip="formatDate(item.mdate)" tabindex="0" v-text="formatDateRelative(item.mdate)" /> </template> <template #status="{ item }"> <span v-if="item.disabled" class="oc-flex oc-flex-middle"> <oc-icon name="stop-circle" fill-type="line" class="oc-mr-s" /><span v-text="$gettext('Disabled')" /> </span> <span v-else class="oc-flex oc-flex-middle"> <oc-icon name="play-circle" fill-type="line" class="oc-mr-s" /><span v-text="$gettext('Enabled')" /> </span> </template> <template #actions="{ item }"> <div class="spaces-list-actions"> <oc-button v-oc-tooltip="spaceDetailsLabel" :aria-label="spaceDetailsLabel" appearance="raw" class="spaces-table-btn-details" @click.stop.prevent="showDetailsForSpace(item)" > <oc-icon name="information" fill-type="line" /> </oc-button> <context-menu-quick-action ref="contextMenuButtonRef" :item="item" class="spaces-table-btn-action-dropdown" @quick-action-clicked="showContextMenuOnBtnClick($event, item)" > <template #contextMenu> <slot name="contextMenu" :space="item" /> </template> </context-menu-quick-action> </div> </template> <template #footer> <pagination :pages="totalPages" :current-page="currentPage" /> <div class="oc-text-nowrap oc-text-center oc-width-1-1 oc-my-s"> <p class="oc-text-muted">{{ footerTextTotal }}</p> <p v-if="filterTerm" class="oc-text-muted">{{ footerTextFilter }}</p> </div> </template> </oc-table> </div> </template> <script lang="ts"> import { formatDateFromJSDate, formatRelativeDateFromJSDate, displayPositionedDropdown, formatFileSize, defaultFuseOptions, useKeyboardActions } from '@ownclouders/web-pkg' import { computed, defineComponent, nextTick, onMounted, ref, unref, watch } from 'vue' import { SpaceResource } from '@ownclouders/web-client/src/helpers' import Mark from 'mark.js' import Fuse from 'fuse.js' import { useGettext } from 'vue3-gettext' import { eventBus, SortDir } from '@ownclouders/web-pkg' import { SideBarEventTopics } from '@ownclouders/web-pkg' import { ContextMenuQuickAction } from '@ownclouders/web-pkg' import { useFileListHeaderPosition, useRoute, useRouter, usePagination } from '@ownclouders/web-pkg' import { Pagination } from '@ownclouders/web-pkg' import { perPageDefault, perPageStoragePrefix } from 'web-app-admin-settings/src/defaults' import { findIndex } from 'lodash-es' import { useKeyboardTableMouseActions, useKeyboardTableNavigation } from '../../composables/keyboardActions' import { useSpaceSettingsStore } from '../../composables' import { storeToRefs } from 'pinia' export default defineComponent({ name: 'SpacesList', components: { ContextMenuQuickAction, Pagination }, setup() { const router = useRouter() const route = useRoute() const { $gettext, current: currentLanguage } = useGettext() const { y: fileListHeaderY } = useFileListHeaderPosition('#admin-settings-app-bar') const contextMenuButtonRef = ref(undefined) const sortBy = ref('name') const sortDir = ref(SortDir.Asc) const filterTerm = ref('') const markInstance = ref(undefined) const lastSelectedSpaceIndex = ref(0) const lastSelectedSpaceId = ref(null) const spaceSettingsStore = useSpaceSettingsStore() const { spaces, selectedSpaces } = storeToRefs(spaceSettingsStore) const highlighted = computed(() => unref(selectedSpaces).map((s) => s.id)) const footerTextTotal = computed(() => { return $gettext('%{spaceCount} spaces in total', { spaceCount: unref(spaces).length.toString() }) }) const footerTextFilter = computed(() => { return $gettext('%{spaceCount} matching spaces', { spaceCount: unref(items).length.toString() }) }) const orderBy = (list, prop, desc) => { return [...list].sort((s1, s2) => { let a, b const numeric = ['totalQuota', 'usedQuota', 'remainingQuota'].includes(prop) switch (prop) { case 'members': a = getMemberCount(s1).toString() b = getMemberCount(s2).toString() break case 'totalQuota': a = (s1.spaceQuota.total || 0).toString() b = (s2.spaceQuota.total || 0).toString() break case 'usedQuota': a = (s1.spaceQuota.used || 0).toString() b = (s2.spaceQuota.used || 0).toString() break case 'remainingQuota': a = (s1.spaceQuota.remaining || 0).toString() b = (s2.spaceQuota.remaining || 0).toString() break case 'status': a = s1.disabled.toString() b = s2.disabled.toString() break default: a = s1[prop] || '' b = s2[prop] || '' } return desc ? b.localeCompare(a, undefined, { numeric }) : a.localeCompare(b, undefined, { numeric }) }) } const items = computed(() => orderBy( filter(unref(spaces), unref(filterTerm)), unref(sortBy), unref(sortDir) === SortDir.Desc ) ) const { items: paginatedItems, page: currentPage, total: totalPages } = usePagination({ items, perPageDefault, perPageStoragePrefix }) const keyActions = useKeyboardActions() useKeyboardTableNavigation( keyActions, paginatedItems, selectedSpaces, lastSelectedSpaceIndex, lastSelectedSpaceId ) useKeyboardTableMouseActions( keyActions, paginatedItems, selectedSpaces, lastSelectedSpaceIndex, lastSelectedSpaceId ) watch(currentPage, () => { unselectAllSpaces() }) const allSpacesSelected = computed(() => { return unref(paginatedItems).length === unref(selectedSpaces).length }) const handleSort = (event) => { sortBy.value = event.sortBy sortDir.value = event.sortDir } const filter = (spaces, filterTerm) => { if (!(filterTerm || '').trim()) { return spaces } const searchEngine = new Fuse(spaces, { ...defaultFuseOptions, keys: ['name'] }) return searchEngine.search(filterTerm).map((r) => r.item) } const isSpaceSelected = (space: SpaceResource) => { return unref(selectedSpaces).some((s) => s.id === space.id) } const fields = computed(() => [ { name: 'select', title: '', type: 'slot', width: 'shrink', headerType: 'slot' }, { name: 'icon', title: '', type: 'slot', width: 'shrink' }, { name: 'name', title: $gettext('Name'), type: 'slot', sortable: true, tdClass: 'mark-element' }, { name: 'manager', title: $gettext('Manager'), type: 'slot' }, { name: 'members', title: $gettext('Members'), type: 'slot', sortable: true }, { name: 'totalQuota', title: $gettext('Total quota'), type: 'slot', sortable: true }, { name: 'usedQuota', title: $gettext('Used quota'), type: 'slot', sortable: true }, { name: 'remainingQuota', title: $gettext('Remaining quota'), type: 'slot', sortable: true }, { name: 'mdate', title: $gettext('Modified'), type: 'slot', sortable: true }, { name: 'status', title: $gettext('Status'), type: 'slot', sortable: true }, { name: 'actions', title: $gettext('Actions'), sortable: false, type: 'slot', alignH: 'right' } ]) const getManagerNames = (space: SpaceResource) => { const allManagers = space.spaceRoles.manager const managers = allManagers.length > 2 ? allManagers.slice(0, 2) : allManagers let managerStr = managers.map((m) => m.displayName).join(', ') if (allManagers.length > 2) { managerStr += `... +${allManagers.length - 2}` } return managerStr } const formatDate = (date) => { return formatDateFromJSDate(new Date(date), currentLanguage) } const formatDateRelative = (date) => { return formatRelativeDateFromJSDate(new Date(date), currentLanguage) } const getTotalQuota = (space: SpaceResource) => { if (space.spaceQuota.total === 0) { return $gettext('Unrestricted') } return formatFileSize(space.spaceQuota.total, currentLanguage) } const getUsedQuota = (space: SpaceResource) => { if (space.spaceQuota.used === undefined) { return '-' } return formatFileSize(space.spaceQuota.used, currentLanguage) } const getRemainingQuota = (space: SpaceResource) => { if (space.spaceQuota.remaining === undefined) { return '-' } return formatFileSize(space.spaceQuota.remaining, currentLanguage) } const getMemberCount = (space: SpaceResource) => { return ( space.spaceRoles.manager.length + space.spaceRoles.editor.length + space.spaceRoles.viewer.length ) } const getSelectSpaceLabel = (space: SpaceResource) => { return $gettext('Select %{ space }', { space: space.name }, true) } onMounted(() => { nextTick(() => { markInstance.value = new Mark('.mark-element') }) }) watch(filterTerm, async () => { await unref(router).push({ ...unref(route), query: { ...unref(route).query, page: '1' } }) }) watch([filterTerm, paginatedItems], () => { unref(markInstance)?.unmark() unref(markInstance)?.mark(unref(filterTerm), { element: 'span', className: 'mark-highlight' }) }) const fileClicked = (data) => { const resource = data[0] const eventData = data[1] const isCheckboxClicked = eventData?.target.getAttribute('type') === 'checkbox' const contextActionClicked = eventData?.target?.closest('div')?.id === 'oc-files-context-menu' if (contextActionClicked) { return } if (eventData?.metaKey) { return eventBus.publish('app.resources.list.clicked.meta', resource) } if (eventData?.shiftKey) { return eventBus.publish('app.resources.list.clicked.shift', { resource, skipTargetSelection: isCheckboxClicked }) } if (isCheckboxClicked) { return } unselectAllSpaces() selectSpace(resource) } const showContextMenuOnBtnClick = (data, space) => { const { dropdown, event } = data if (dropdown?.tippy === undefined) { return } if (!isSpaceSelected(space)) { selectSpace(space) } displayPositionedDropdown(dropdown.tippy, event, unref(contextMenuButtonRef)) } const showContextMenuOnRightClick = (row, event, space) => { event.preventDefault() const dropdown = row.$el.getElementsByClassName('spaces-table-btn-action-dropdown')[0] if (dropdown === undefined) { return } if (!isSpaceSelected(space)) { selectSpace(space) } displayPositionedDropdown(dropdown._tippy, event, unref(contextMenuButtonRef)) } const spaceDetailsLabel = computed(() => { return $gettext('Show details') }) const showDetailsForSpace = (space: SpaceResource) => { selectSpace(space) eventBus.publish(SideBarEventTopics.open) } const selectSpace = (selectedSpace: SpaceResource) => { lastSelectedSpaceIndex.value = findIndex(unref(spaces), (g) => g.id === selectedSpace.id) lastSelectedSpaceId.value = selectedSpace.id keyActions.resetSelectionCursor() const isSpaceSelected = unref(selectedSpaces).find((space) => space.id === selectedSpace.id) if (!isSpaceSelected) { return spaceSettingsStore.addSelectedSpace(selectedSpace) } spaceSettingsStore.setSelectedSpaces( unref(selectedSpaces).filter((space) => space.id !== selectedSpace.id) ) } const unselectAllSpaces = () => { spaceSettingsStore.setSelectedSpaces([]) } const selectSpaces = (spaces: SpaceResource[]) => { spaceSettingsStore.setSelectedSpaces(spaces) } return { allSpacesSelected, sortBy, sortDir, filterTerm, footerTextTotal, footerTextFilter, fields, highlighted, filter, getManagerNames, formatDate, formatDateRelative, getTotalQuota, getUsedQuota, getRemainingQuota, getMemberCount, getSelectSpaceLabel, handleSort, fileClicked, isSpaceSelected, contextMenuButtonRef, showContextMenuOnBtnClick, showContextMenuOnRightClick, spaceDetailsLabel, showDetailsForSpace, fileListHeaderY, items, paginatedItems, currentPage, totalPages, selectSpace, selectSpaces, unselectAllSpaces } } }) </script> <style lang="scss"> #spaces-filter { width: 16rem; } .spaces-table { .oc-table-header-cell-actions, .oc-table-data-cell-actions { white-space: nowrap; } .oc-table-header-cell-manager, .oc-table-data-cell-manager, .oc-table-header-cell-remainingQuota, .oc-table-data-cell-remainingQuota { display: none; @media only screen and (min-width: 1200px) { display: table-cell; } } .oc-table-header-cell-totalQuota, .oc-table-data-cell-totalQuota, .oc-table-header-cell-usedQuota, .oc-table-data-cell-usedQuota { display: none; @media only screen and (min-width: 1600px) { display: table-cell; } } &-squashed { .oc-table-header-cell-manager, .oc-table-data-cell-manager, .oc-table-header-cell-totalQuota, .oc-table-data-cell-totalQuota, .oc-table-header-cell-usedQuota, .oc-table-data-cell-usedQuota { display: none; } .oc-table-header-cell-remainingQuota, .oc-table-data-cell-remainingQuota, .oc-table-header-cell-mdate, .oc-table-data-cell-mdate { display: none; @media only screen and (min-width: 1400px) { display: table-cell; } } } } </style>
owncloud/web/packages/web-app-admin-settings/src/components/Spaces/SpacesList.vue/0
{ "file_path": "owncloud/web/packages/web-app-admin-settings/src/components/Spaces/SpacesList.vue", "repo_id": "owncloud", "token_count": 7570 }
797
import { computed, unref } from 'vue' import { queryItemAsString, useMessages, useModals, useRouteQuery } from '@ownclouders/web-pkg' import { useClientService } from '@ownclouders/web-pkg' import { GroupAction, GroupActionOptions } from '@ownclouders/web-pkg' import { useGettext } from 'vue3-gettext' import { Group } from '@ownclouders/web-client/src/generated' import { useGroupSettingsStore } from '../../stores' export const useGroupActionsDelete = () => { const { showMessage, showErrorMessage } = useMessages() const { $gettext, $ngettext } = useGettext() const clientService = useClientService() const { dispatchModal } = useModals() const groupSettingsStore = useGroupSettingsStore() const currentPageQuery = useRouteQuery('page', '1') const currentPage = computed(() => { return parseInt(queryItemAsString(unref(currentPageQuery))) }) const itemsPerPageQuery = useRouteQuery('items-per-page', '1') const itemsPerPage = computed(() => { return parseInt(queryItemAsString(unref(itemsPerPageQuery))) }) const deleteGroups = async (groups: Group[]) => { const graphClient = clientService.graphAuthenticated const promises = groups.map((group) => graphClient.groups.deleteGroup(group.id)) const results = await Promise.allSettled(promises) const succeeded = results.filter((r) => r.status === 'fulfilled') if (succeeded.length) { const title = succeeded.length === 1 && groups.length === 1 ? $gettext('Group "%{group}" was deleted successfully', { group: groups[0].displayName }) : $ngettext( '%{groupCount} group was deleted successfully', '%{groupCount} groups were deleted successfully', succeeded.length, { groupCount: succeeded.length.toString() }, true ) showMessage({ title }) } const failed = results.filter((r) => r.status === 'rejected') if (failed.length) { failed.forEach(console.error) const title = failed.length === 1 && groups.length === 1 ? $gettext('Failed to delete group "%{group}"', { group: groups[0].displayName }) : $ngettext( 'Failed to delete %{groupCount} group', 'Failed to delete %{groupCount} groups', failed.length, { groupCount: failed.length.toString() }, true ) showErrorMessage({ title, errors: (failed as PromiseRejectedResult[]).map((f) => f.reason) }) } groupSettingsStore.removeGroups(groups) groupSettingsStore.setSelectedGroups([]) const pageCount = Math.ceil(groupSettingsStore.groups.length / unref(itemsPerPage)) if (unref(currentPage) > 1 && unref(currentPage) > pageCount) { // reset pagination to avoid empty lists (happens when deleting all items on the last page) currentPageQuery.value = pageCount.toString() } } const handler = ({ resources }: GroupActionOptions) => { if (!resources.length) { return } dispatchModal({ variation: 'danger', title: $ngettext( 'Delete group "%{group}"?', 'Delete %{groupCount} groups?', resources.length, { group: resources[0].displayName, groupCount: resources.length.toString() } ), confirmText: $gettext('Delete'), message: $ngettext( 'Are you sure you want to delete this group?', 'Are you sure you want to delete the %{groupCount} selected groups?', resources.length, { groupCount: resources.length.toString() } ), hasInput: false, onConfirm: () => deleteGroups(resources) }) } const actions = computed((): GroupAction[] => [ { name: 'delete', icon: 'delete-bin', label: () => { return $gettext('Delete') }, handler, isVisible: ({ resources }) => { return !!resources.length && !resources.some((r) => r.groupTypes?.includes('ReadOnly')) }, componentType: 'button', class: 'oc-groups-actions-delete-trigger' } ]) return { actions, // HACK: exported for unit tests: deleteGroups } }
owncloud/web/packages/web-app-admin-settings/src/composables/actions/groups/useGroupActionsDelete.ts/0
{ "file_path": "owncloud/web/packages/web-app-admin-settings/src/composables/actions/groups/useGroupActionsDelete.ts", "repo_id": "owncloud", "token_count": 1657 }
798
export * from './groupSettings' export * from './spaceSettings'
owncloud/web/packages/web-app-admin-settings/src/composables/stores/index.ts/0
{ "file_path": "owncloud/web/packages/web-app-admin-settings/src/composables/stores/index.ts", "repo_id": "owncloud", "token_count": 18 }
799
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`EditPanel > renders all available inputs 1`] = ` "<div id="group-edit-panel" class="oc-mt-xl"> <div class="oc-flex group-info oc-mb-l"> <avatar-image-stub class="oc-mb-m" width="80" user-name="group"></avatar-image-stub> <span class="oc-text-muted group-info-display-name">group</span> <span class="oc-text-muted">0 members</span> </div> <form id="group-edit-form" class="oc-background-highlight oc-p-m" autocomplete="off"> <oc-text-input-stub id="displayName-input" modelvalue="group" class="oc-mb-s" label="Group name" error-message="" fix-message-line="true"></oc-text-input-stub> <div data-v-79550c21="" class="compare-save-dialog oc-width-1-1 oc-flex oc-flex-between oc-flex-middle edit-compare-save-dialog oc-mb-l"><span data-v-79550c21="" class="state-indicator">No changes</span> <div data-v-79550c21=""> <oc-button-stub data-v-79550c21="" disabled="true" class="compare-save-dialog-revert-btn"></oc-button-stub> <oc-button-stub data-v-79550c21="" appearance="filled" variation="primary" class="compare-save-dialog-confirm-btn" disabled="true"></oc-button-stub> </div> </div> </form> </div>" `;
owncloud/web/packages/web-app-admin-settings/tests/unit/components/Groups/SideBar/__snapshots__/EditPanel.spec.ts.snap/0
{ "file_path": "owncloud/web/packages/web-app-admin-settings/tests/unit/components/Groups/SideBar/__snapshots__/EditPanel.spec.ts.snap", "repo_id": "owncloud", "token_count": 494 }
800
import EditPanel from '../../../../../src/components/Users/SideBar/EditPanel.vue' import { defaultComponentMocks, defaultPlugins, mockAxiosReject, shallowMount } from 'web-test-helpers' import { mock } from 'vitest-mock-extended' import { Group } from '@ownclouders/web-client/src/generated' import { AxiosResponse } from 'axios' import { CapabilityStore } from '@ownclouders/web-pkg' import GroupSelect from '../../../../../src/components/Users/GroupSelect.vue' const availableGroupOptions = [ mock<Group>({ id: '1', displayName: 'group1', groupTypes: [] }), mock<Group>({ id: '2', displayName: 'group2', groupTypes: [] }) ] const selectors = { groupSelectStub: 'group-select-stub' } describe('EditPanel', () => { it('renders all available inputs', () => { const { wrapper } = getWrapper() expect(wrapper.html()).toMatchSnapshot() }) it('filters selected groups when passing the options to the GroupSelect component', () => { const { wrapper } = getWrapper({ selectedGroups: [availableGroupOptions[0]] }) const selectedGroups = wrapper .findComponent<typeof GroupSelect>(selectors.groupSelectStub) .props('selectedGroups') const groupOptions = wrapper .findComponent<typeof GroupSelect>(selectors.groupSelectStub) .props('groupOptions') expect(selectedGroups.length).toBe(1) expect(selectedGroups[0].id).toEqual(availableGroupOptions[0].id) expect(groupOptions.length).toBe(1) expect(groupOptions[0].id).toEqual(availableGroupOptions[1].id) }) describe('method "isInputFieldReadOnly"', () => { it('should be true if included in capability readOnlyUserAttributes list', () => { const { wrapper } = getWrapper({ readOnlyUserAttributes: ['user.displayName'] }) expect(wrapper.vm.isInputFieldReadOnly('user.displayName')).toBeTruthy() }) it('should be false if not included in capability readOnlyUserAttributes list', () => { const { wrapper } = getWrapper() expect(wrapper.vm.isInputFieldReadOnly('user.displayName')).toBeFalsy() }) }) describe('method "revertChanges"', () => { it('should revert changes on property editUser', () => { const { wrapper } = getWrapper() wrapper.vm.editUser.displayName = 'jana' wrapper.vm.editUser.mail = 'jana@owncloud.com' wrapper.vm.revertChanges() expect(wrapper.vm.editUser.displayName).toEqual('jan') expect(wrapper.vm.editUser.mail).toEqual('jan@owncloud.com') }) it('should revert changes on property formData', () => { const { wrapper } = getWrapper() wrapper.vm.formData.displayName.valid = false wrapper.vm.formData.displayName.errorMessage = 'error' wrapper.vm.revertChanges() expect(wrapper.vm.formData.displayName.valid).toBeTruthy() expect(wrapper.vm.formData.displayName.errorMessage).toEqual('') }) }) describe('method "validateUserName"', () => { it('should be false when userName is empty', async () => { const { wrapper } = getWrapper() wrapper.vm.editUser.onPremisesSamAccountName = '' expect(await wrapper.vm.validateUserName()).toBeFalsy() }) it('should be false if userName is longer than 255 characters', async () => { const { wrapper } = getWrapper() wrapper.vm.editUser.onPremisesSamAccountName = 'n'.repeat(256) expect(await wrapper.vm.validateUserName()).toBeFalsy() }) it('should be false when userName contains white spaces', async () => { const { wrapper } = getWrapper() wrapper.vm.editUser.onPremisesSamAccountName = 'jan owncCloud' expect(await wrapper.vm.validateUserName()).toBeFalsy() }) it('should be false when userName starts with a numeric value', async () => { const { wrapper } = getWrapper() wrapper.vm.editUser.onPremisesSamAccountName = '1moretry' expect(await wrapper.vm.validateUserName()).toBeFalsy() }) it('should be false when userName is already existing', async () => { const { wrapper, mocks } = getWrapper() const graphMock = mocks.$clientService.graphAuthenticated const getUserStub = graphMock.users.getUser.mockResolvedValue( mock<AxiosResponse>({ data: { onPremisesSamAccountName: 'jan' } }) ) wrapper.vm.editUser.onPremisesSamAccountName = 'jan' expect(await wrapper.vm.validateUserName()).toBeFalsy() expect(getUserStub).toHaveBeenCalled() }) it('should be true when userName is valid', async () => { const { wrapper, mocks } = getWrapper() const graphMock = mocks.$clientService.graphAuthenticated const getUserStub = graphMock.users.getUser.mockRejectedValue(() => mockAxiosReject()) wrapper.vm.editUser.onPremisesSamAccountName = 'jana' expect(await wrapper.vm.validateUserName()).toBeTruthy() expect(getUserStub).toHaveBeenCalled() }) }) describe('method "validateDisplayName"', () => { it('should return true if displayName is valid', () => { const { wrapper } = getWrapper() wrapper.vm.editUser.displayName = 'jan' expect(wrapper.vm.validateDisplayName()).toBeTruthy() expect(wrapper.vm.formData.displayName.valid).toBeTruthy() }) it('should be false if displayName is longer than 255 characters', async () => { const { wrapper } = getWrapper() wrapper.vm.editUser.displayName = 'n'.repeat(256) expect(await wrapper.vm.validateDisplayName()).toBeFalsy() }) it('should return false if displayName is not valid', () => { const { wrapper } = getWrapper() wrapper.vm.editUser.displayName = '' expect(wrapper.vm.validateDisplayName()).toBeFalsy() expect(wrapper.vm.formData.displayName.valid).toBeFalsy() }) }) describe('method "validateEmail"', () => { it('should return true if email is valid', () => { const { wrapper } = getWrapper() wrapper.vm.editUser.mail = 'jan@owncloud.com' expect(wrapper.vm.validateEmail()).toBeTruthy() expect(wrapper.vm.formData.email.valid).toBeTruthy() }) it('should return false if email is not valid', () => { const { wrapper } = getWrapper() wrapper.vm.editUser.mail = '' expect(wrapper.vm.validateEmail()).toBeFalsy() expect(wrapper.vm.formData.email.valid).toBeFalsy() }) }) describe('computed method "invalidFormData"', () => { it('should be false if formData is invalid', () => { const { wrapper } = getWrapper() wrapper.vm.formData.displayName.valid = true expect(wrapper.vm.invalidFormData).toBeFalsy() }) it('should be true if formData is valid', () => { const { wrapper } = getWrapper() wrapper.vm.formData.displayName.valid = false expect(wrapper.vm.invalidFormData).toBeTruthy() }) }) describe('group select', () => { it('takes all available groups', () => { const { wrapper } = getWrapper() expect( wrapper.findComponent<typeof GroupSelect>('group-select-stub').props('groupOptions').length ).toBe(availableGroupOptions.length) }) it('filters out read-only groups', () => { const { wrapper } = getWrapper({ groups: [mock<Group>({ id: '1', displayName: 'group1', groupTypes: ['ReadOnly'] })] }) expect( wrapper.findComponent<typeof GroupSelect>('group-select-stub').props('groupOptions').length ).toBe(0) }) }) }) function getWrapper({ readOnlyUserAttributes = [], selectedGroups = [], groups = availableGroupOptions } = {}) { const mocks = defaultComponentMocks() const capabilities = { graph: { users: { read_only_attributes: readOnlyUserAttributes } } } satisfies Partial<CapabilityStore['capabilities']> return { mocks, wrapper: shallowMount(EditPanel, { props: { user: { id: '2', displayName: 'jan', mail: 'jan@owncloud.com', passwordProfile: { password: '' }, drive: { quota: {} }, memberOf: selectedGroups }, roles: [{ id: '1', displayName: 'admin' }], groups, applicationId: '1' }, global: { mocks, provide: mocks, plugins: [...defaultPlugins({ piniaOptions: { capabilityState: { capabilities } } })] } }) } }
owncloud/web/packages/web-app-admin-settings/tests/unit/components/Users/SideBar/EditPanel.spec.ts/0
{ "file_path": "owncloud/web/packages/web-app-admin-settings/tests/unit/components/Users/SideBar/EditPanel.spec.ts", "repo_id": "owncloud", "token_count": 3097 }
801
{ "name": "epub-reader", "version": "0.0.0", "private": true, "description": "ownCloud Web epub-reader", "license": "AGPL-3.0", "dependencies": { "epubjs": "^0.3.93" }, "devDependencies": { "web-test-helpers": "workspace:*" }, "peerDependencies": { "@ownclouders/web-client": "workspace:*", "@ownclouders/web-pkg": "workspace:*", "vue3-gettext": "2.4.0" } }
owncloud/web/packages/web-app-epub-reader/package.json/0
{ "file_path": "owncloud/web/packages/web-app-epub-reader/package.json", "repo_id": "owncloud", "token_count": 187 }
802
<template> <main id="files" class="oc-flex oc-height-1-1"> <div v-if="dragareaEnabled" class="dragarea" /> <router-view tabindex="0" class="files-wrapper oc-width-expand oc-height-1-1 oc-flex-wrap" /> </main> </template> <script lang="ts"> import { defineComponent, onBeforeUnmount, watch, ref } from 'vue' import { useRoute, eventBus, useResourcesStore } from '@ownclouders/web-pkg' export default defineComponent({ setup() { const dragareaEnabled = ref(false) const { resetSelection } = useResourcesStore() watch(useRoute(), () => { resetSelection() }) const hideDropzone = () => { dragareaEnabled.value = false } const onDragOver = (event) => { dragareaEnabled.value = (event.dataTransfer.types || []).some((e) => e === 'Files') } const dragOver = eventBus.subscribe('drag-over', onDragOver) const dragOut = eventBus.subscribe('drag-out', hideDropzone) const drop = eventBus.subscribe('drop', hideDropzone) onBeforeUnmount(() => { eventBus.unsubscribe('drag-over', dragOver) eventBus.unsubscribe('drag-out', dragOut) eventBus.unsubscribe('drop', drop) }) return { dragareaEnabled } } }) </script> <style lang="scss" scoped> main { max-height: 100%; } .dragarea { background-color: rgba(60, 130, 225, 0.21); pointer-events: none; top: 0; left: 0; right: 0; bottom: 0; position: absolute; z-index: 9; border-radius: 14px; border: 2px dashed var(--oc-color-swatch-primary-muted); } #files { position: relative; } </style>
owncloud/web/packages/web-app-files/src/App.vue/0
{ "file_path": "owncloud/web/packages/web-app-files/src/App.vue", "repo_id": "owncloud", "token_count": 605 }
803
<template> <oc-list id="oc-files-actions-sidebar" class="oc-mt-s"> <action-menu-item v-for="(action, index) in actions" :key="`action-${index}`" :action="action" :action-options="{ space, resources }" class="oc-rounded" /> </oc-list> </template> <script lang="ts"> import { ActionMenuItem } from '@ownclouders/web-pkg' import { useFileActions } from '@ownclouders/web-pkg' import { computed, defineComponent, inject, Ref, unref } from 'vue' import { Resource, SpaceResource } from '@ownclouders/web-client' export default defineComponent({ name: 'FileActions', components: { ActionMenuItem }, setup() { const resource = inject<Ref<Resource>>('resource') const space = inject<Ref<SpaceResource>>('space') const resources = computed(() => { return [unref(resource)] }) const { getAllAvailableActions } = useFileActions() const actions = computed(() => { return getAllAvailableActions({ space: unref(space), resources: unref(resources) }) }) return { space, resources, actions } } }) </script> <style lang="scss"> #oc-files-actions-sidebar { > li a, > li a:hover { color: var(--oc-color-swatch-passive-default); display: inline-flex; gap: 10px; vertical-align: top; } > li:hover { text-decoration: none !important; background-color: var(--oc-color-background-hover); } } </style>
owncloud/web/packages/web-app-files/src/components/SideBar/Actions/FileActions.vue/0
{ "file_path": "owncloud/web/packages/web-app-files/src/components/SideBar/Actions/FileActions.vue", "repo_id": "owncloud", "token_count": 576 }
804
<template> <div class="oc-mb-s oc-width-1-1 oc-mb-l"> <h4 class="oc-text-truncate oc-text-normal oc-files-file-link-name oc-my-rm" v-text="$gettext('Link')" /> <div class="oc-flex oc-flex-middle oc-flex-between oc-width-1-1 oc-p-xs link-name-container"> <div class="oc-flex oc-flex-middle oc-text-truncate"> <oc-icon name="link" fill-type="line" /> <p class="oc-files-file-link-url oc-ml-s oc-text-truncate oc-my-rm" v-text="$gettext('No link')" /> </div> <oc-button v-oc-tooltip="$gettext('Create link')" class="oc-ml-s" size="small" :aria-label="$gettext('Create link')" @click="$emit('createPublicLink')" > <span v-text="$gettext('Create link')" /> </oc-button> </div> </div> </template> <script lang="ts"> import { defineComponent } from 'vue' export default defineComponent({ name: 'CreateQuickLink', emits: ['createPublicLink'] }) </script>
owncloud/web/packages/web-app-files/src/components/SideBar/Shares/Links/CreateQuickLink.vue/0
{ "file_path": "owncloud/web/packages/web-app-files/src/components/SideBar/Shares/Links/CreateQuickLink.vue", "repo_id": "owncloud", "token_count": 492 }
805
export * from './actions' export * from './resourcesViewDefaults'
owncloud/web/packages/web-app-files/src/composables/index.ts/0
{ "file_path": "owncloud/web/packages/web-app-files/src/composables/index.ts", "repo_id": "owncloud", "token_count": 19 }
806
import { cacheService, ClientService } from '@ownclouders/web-pkg' import { ImageDimension } from '@ownclouders/web-pkg' interface AvatarUrlOptions { clientService: ClientService server: string username: string size?: number } export const avatarUrl = async (options: AvatarUrlOptions, cached = false): Promise<string> => { const size = options.size || ImageDimension.Avatar if (cached) { return cacheFactory({ ...options, size }) } const url = [options.server, 'remote.php/dav/avatars/', options.username, `/${size}.png`].join('') const { status, statusText } = await options.clientService.httpAuthenticated.head(url) if (status !== 200) { throw new Error(statusText) } return options.clientService.ocsUserContext.signUrl(url) } const cacheFactory = async (options: AvatarUrlOptions): Promise<string> => { const hit = cacheService.avatarUrl.get(options.username) if (hit && hit.size === options.size) { return hit.src } try { const src = await avatarUrl(options) return cacheService.avatarUrl.set(options.username, { src, size: options.size }, 0).src } catch (ignored) {} }
owncloud/web/packages/web-app-files/src/helpers/user/avatarUrl.ts/0
{ "file_path": "owncloud/web/packages/web-app-files/src/helpers/user/avatarUrl.ts", "repo_id": "owncloud", "token_count": 361 }
807
export { default as Registry } from './registry'
owncloud/web/packages/web-app-files/src/services/index.ts/0
{ "file_path": "owncloud/web/packages/web-app-files/src/services/index.ts", "repo_id": "owncloud", "token_count": 13 }
808
import { useSort } from '@ownclouders/web-pkg' import { ref } from 'vue' export const useSortMock = ( options: Partial<ReturnType<typeof useSort>> = {} ): ReturnType<typeof useSort> => { return { items: ref([]), sortBy: ref('name'), sortDir: undefined, handleSort: vi.fn(), ...options } }
owncloud/web/packages/web-app-files/tests/mocks/useSortMock.ts/0
{ "file_path": "owncloud/web/packages/web-app-files/tests/mocks/useSortMock.ts", "repo_id": "owncloud", "token_count": 121 }
809
import { mock } from 'vitest-mock-extended' import SetLinkPasswordModal from '../../../../src/components/Modals/SetLinkPasswordModal.vue' import { defaultComponentMocks, defaultPlugins, shallowMount } from 'web-test-helpers' import { Modal, useMessages, useSharesStore } from '@ownclouders/web-pkg' import { Resource, LinkShare, SpaceResource } from '@ownclouders/web-client/src/helpers' describe('SetLinkPasswordModal', () => { it('should render a text input field for the password', () => { const { wrapper } = getWrapper() expect(wrapper.find('oc-text-input-stub').exists()).toBeTruthy() }) describe('method "onConfirm"', () => { it('updates the link', async () => { const { wrapper } = getWrapper() await wrapper.vm.onConfirm() const sharesStore = useSharesStore() expect(sharesStore.updateLink).toHaveBeenCalled() const { showMessage } = useMessages() expect(showMessage).toHaveBeenCalled() }) it('shows an error message on error', async () => { const { wrapper } = getWrapper() const sharesStore = useSharesStore() ;(sharesStore.updateLink as any).mockRejectedValue(new Error('')) await wrapper.vm.onConfirm() const { showErrorMessage } = useMessages() expect(showErrorMessage).toHaveBeenCalled() }) }) }) function getWrapper() { const mocks = { ...defaultComponentMocks() } return { mocks, wrapper: shallowMount(SetLinkPasswordModal, { props: { modal: mock<Modal>(), link: mock<LinkShare>(), space: mock<SpaceResource>(), resource: mock<Resource>() }, global: { plugins: [...defaultPlugins()], mocks, provide: mocks } }) } }
owncloud/web/packages/web-app-files/tests/unit/components/Modals/SetLinkPasswordModal.spec.ts/0
{ "file_path": "owncloud/web/packages/web-app-files/tests/unit/components/Modals/SetLinkPasswordModal.spec.ts", "repo_id": "owncloud", "token_count": 662 }
810
import DetailsAndEdit from 'web-app-files/src/components/SideBar/Shares/Links/DetailsAndEdit.vue' import { LinkShare, ShareRole } from '@ownclouders/web-client/src/helpers/share' import { defaultPlugins, shallowMount, defaultComponentMocks } from 'web-test-helpers' import { mock } from 'vitest-mock-extended' import { useLinkTypes } from '@ownclouders/web-pkg' import { SharingLinkType } from '@ownclouders/web-client/src/generated' vi.mock('@ownclouders/web-pkg', async (importOriginal) => ({ ...(await importOriginal<any>()), useLinkTypes: vi.fn() })) const exampleLink = { displayName: 'Example link', webUrl: 'https://some-url.com/abc', type: SharingLinkType.View } as LinkShare describe('DetailsAndEdit component', () => { describe('if user can not edit', () => { it('does not render dropdown or edit button', () => { const { wrapper } = getShallowMountedWrapper(exampleLink) expect(wrapper.find('link-role-dropdown-stub').exists()).toBeFalsy() expect(wrapper.find('.edit-drop-trigger').exists()).toBeFalsy() }) }) describe('if user can edit', () => { it('renders dropdown and edit button', () => { const { wrapper } = getShallowMountedWrapper(exampleLink, false, true) expect(wrapper.find('link-role-dropdown-stub').exists()).toBeTruthy() expect(wrapper.find('.edit-drop-trigger').exists()).toBeTruthy() }) it.todo('test edit options, button clicks and event handling/propagation') }) describe('editOptions computed property', () => { it('does not add "add-expiration" option if isAliasLink is true', () => { const exampleLinkInternal = { ...exampleLink } exampleLinkInternal.type = SharingLinkType.Internal const { wrapper } = getShallowMountedWrapper(exampleLinkInternal, false, true) expect(wrapper.vm.editOptions.some((option) => option.id === 'add-expiration')).toBe(false) }) it('adds "add-expiration" option if isAliasLink is false', () => { const { wrapper } = getShallowMountedWrapper(exampleLink, false, true) expect(wrapper.vm.editOptions.some((option) => option.id === 'add-expiration')).toBe(true) }) }) }) function getShallowMountedWrapper( linkShare: LinkShare, expireDateEnforced = false, isModifiable = false ) { vi.mocked(useLinkTypes).mockReturnValue( mock<ReturnType<typeof useLinkTypes>>({ getAvailableLinkTypes: () => [SharingLinkType.View], getLinkRoleByType: () => mock<ShareRole>({ displayName: '', description: '', label: '' }) }) ) const mocks = defaultComponentMocks() return { wrapper: shallowMount(DetailsAndEdit, { props: { canRename: true, expirationRules: { enforced: expireDateEnforced, default: null, min: 'Wed Apr 01 2020 00:00:00 GMT+0000 (Coordinated Universal Time)', max: null }, linkShare, isModifiable, isPasswordEnforced: false }, global: { mocks, renderStubDefaultSlot: true, stubs: { OcDatepicker: false, 'date-picker': true }, plugins: [...defaultPlugins()], provide: mocks } }) } }
owncloud/web/packages/web-app-files/tests/unit/components/SideBar/Shares/Links/DetailsAndEdit.spec.ts/0
{ "file_path": "owncloud/web/packages/web-app-files/tests/unit/components/SideBar/Shares/Links/DetailsAndEdit.spec.ts", "repo_id": "owncloud", "token_count": 1187 }
811
import { avatarUrl } from '../../../../src/helpers/user' import { ImageDimension } from '@ownclouders/web-pkg' import { ClientService } from '@ownclouders/web-pkg' import { mockDeep } from 'vitest-mock-extended' import { AxiosResponse } from 'axios' const getDefaultOptions = () => ({ clientService: mockDeep<ClientService>(), server: 'https://www.ocis.rules/', username: 'ocis', token: 'rules' }) describe('avatarUrl', () => { it('throws an error', async () => { const defaultOptions = getDefaultOptions() defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue({ status: 200 } as AxiosResponse) defaultOptions.clientService.ocsUserContext.signUrl.mockRejectedValue(new Error('error')) const avatarUrlPromise = avatarUrl(defaultOptions) await expect(avatarUrlPromise).rejects.toThrow(new Error('error')) expect(defaultOptions.clientService.httpAuthenticated.head).toHaveBeenCalledWith( buildUrl(defaultOptions) ) }) it('returns a signed url', async () => { const defaultOptions = getDefaultOptions() defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue({ status: 200 } as AxiosResponse) defaultOptions.clientService.ocsUserContext.signUrl.mockImplementation((url) => { return Promise.resolve(`${url}?signed=true`) }) const avatarUrlPromise = avatarUrl(defaultOptions) await expect(avatarUrlPromise).resolves.toBe(`${buildUrl(defaultOptions)}?signed=true`) }) it('handles caching', async () => { const defaultOptions = getDefaultOptions() defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue({ status: 200 } as AxiosResponse) defaultOptions.clientService.ocsUserContext.signUrl.mockImplementation((url) => Promise.resolve(url) ) const avatarUrlPromiseUncached = avatarUrl(defaultOptions, true) await expect(avatarUrlPromiseUncached).resolves.toBe(buildUrl(defaultOptions)) expect(defaultOptions.clientService.httpAuthenticated.head).toHaveBeenCalledTimes(1) const avatarUrlPromiseCached = avatarUrl(defaultOptions, true) await expect(avatarUrlPromiseCached).resolves.toBe(buildUrl(defaultOptions)) expect(defaultOptions.clientService.httpAuthenticated.head).toHaveBeenCalledTimes(1) const avatarUrlPromiseOtherSize = avatarUrl({ ...defaultOptions, size: 1 }, true) await expect(avatarUrlPromiseOtherSize).resolves.toBe(buildUrl({ ...defaultOptions, size: 1 })) expect(defaultOptions.clientService.httpAuthenticated.head).toHaveBeenCalledTimes(2) const avatarUrlPromiseSameUncached = avatarUrl(defaultOptions, false) await expect(avatarUrlPromiseSameUncached).resolves.toBe(buildUrl(defaultOptions)) expect(defaultOptions.clientService.httpAuthenticated.head).toHaveBeenCalledTimes(3) }) }) const buildUrl = ({ server, username, size }: { server: string username: string size?: number }) => [server, 'remote.php/dav/avatars/', username, `/${size || ImageDimension.Avatar}.png`].join('')
owncloud/web/packages/web-app-files/tests/unit/helpers/user/avatarUrl.spec.ts/0
{ "file_path": "owncloud/web/packages/web-app-files/tests/unit/helpers/user/avatarUrl.spec.ts", "repo_id": "owncloud", "token_count": 1015 }
812
[main] host = https://www.transifex.com [o:owncloud-org:p:owncloud-web:r:importer] file_filter = locale/<lang>/LC_MESSAGES/app.po minimum_perc = 0 source_file = template.pot source_lang = en type = PO
owncloud/web/packages/web-app-importer/l10n/.tx/config/0
{ "file_path": "owncloud/web/packages/web-app-importer/l10n/.tx/config", "repo_id": "owncloud", "token_count": 84 }
813
<template> <div class="sciencemesh-app"> <div> <div class="oc-flex oc-flex-middle oc-px-m oc-py-s"> <oc-icon name="user-shared" /> <h2 class="oc-px-s" v-text="$gettext('Invite users')"></h2> <oc-contextual-helper class="oc-pl-xs" v-bind="helperContent" /> </div> <div class="oc-flex oc-flex-middle oc-flex-center"> <oc-button v-oc-tooltip="$gettext('Generate new invitation')" :aria-label=" $gettext('Generate invitation link that can be shared with one or more invitees') " @click="openInviteModal" > <oc-icon name="add" /> <span v-text="$gettext('Generate invitation')" /> </oc-button> </div> <br /> <oc-modal v-if="showInviteModal" :title="$gettext('Generate new invitation')" :button-cancel-text="$gettext('Cancel')" :button-confirm-text="$gettext('Generate')" :button-confirm-disabled="!!descriptionErrorMessage" focus-trap-initial="#invite_token_description" @cancel="resetGenerateInviteToken" @confirm="generateToken" > <template #content> <form autocomplete="off" @submit.prevent="generateToken"> <oc-text-input id="invite_token_description" v-model="formInput.description" class="oc-mb-s" :error-message="descriptionErrorMessage" :label="$gettext('Add a description (optional)')" :clear-button-enabled="true" :description-message=" !descriptionErrorMessage && `${formInput.description.length}/${50}` " /> <br /> <oc-text-input id="invite_token_recipient" ref="inputForFocusEmail" v-model="formInput.recipient" class="oc-mb-s" type="email" :clear-button-enabled="true" :error-message="emailErrorMessage" :label="$gettext('Email to send the invitation (optional)')" /> <!-- <oc-text-input label="Add an recipient to sent the token (optional)"/> --> <input type="submit" class="oc-hidden" /> </form> </template ></oc-modal> <br /> <app-loading-spinner v-if="loading" /> <template v-else> <no-content-message v-if="!sortedTokens.length" id="invite-tokens-empty" class="files-empty" icon="user-shared" > <template #message> <span v-text="$gettext('You have no invitation links')" /> </template> </no-content-message> <oc-table v-else :fields="fields" :data="sortedTokens" :highlighted="lastCreatedToken"> <template #token="rowData"> <span>{{ rowData.item.token.slice(0, 5) + '...' }}</span> <oc-button id="oc-sciencemesh-copy-token" v-oc-tooltip="$gettext('Copy invite token')" :aria-label="$gettext('Copy invite token')" appearance="raw" @click="copyToken(rowData)" > <oc-icon name="file-copy" /> </oc-button> </template> <template #link="rowData"> <a :href="rowData.item.link" v-text="$gettext('Link')" /> <oc-button id="oc-sciencemesh-copy-token" v-oc-tooltip="$gettext('Copy invitation link')" :aria-label="$gettext('Copy invitation link')" appearance="raw" @click="copyLink(rowData)" > <oc-icon name="file-copy" /> </oc-button> </template> </oc-table> </template> </div> </div> </template> <script lang="ts"> import { computed, defineComponent, onMounted, ref, unref } from 'vue' import * as EmailValidator from 'email-validator' import { NoContentMessage, AppLoadingSpinner, useClientService, useMessages } from '@ownclouders/web-pkg' import { useGettext } from 'vue3-gettext' import { inviteListSchema, inviteSchema } from '../schemas' type Token = { id: string token: string link?: string expiration?: string expirationSeconds?: number description?: string } export default defineComponent({ components: { NoContentMessage, AppLoadingSpinner }, setup() { const { showMessage, showErrorMessage } = useMessages() const clientService = useClientService() const { $gettext } = useGettext() const lastCreatedToken = ref('') const showInviteModal = ref(false) const formInput = ref({ description: '', recipient: '' }) const tokens = ref<Token[]>([]) const loading = ref(true) const emailErrorMessage = ref(null) const descriptionErrorMessage = ref<string>() const inputForFocusEmail = ref<HTMLInputElement>() const fields = computed(() => { const haveLinks = unref(sortedTokens)[0]?.link return [ haveLinks && { name: 'link', title: $gettext('Invitation link'), alignH: 'left', type: 'slot' }, { name: 'token', title: $gettext('Invite code'), alignH: haveLinks ? 'right' : 'left', type: 'slot' }, { name: 'description', title: $gettext('Description'), alignH: 'right' }, { name: 'expiration', title: $gettext('Expires'), alignH: 'right' } ].filter(Boolean) }) const sortedTokens = computed(() => { return [...unref(tokens)].sort((a, b) => (a.expirationSeconds < b.expirationSeconds ? 1 : -1)) }) const helperContent = computed(() => { return { text: $gettext( 'Create an invitation link and send it to the person you want to share with.' ) } }) const generateToken = async () => { const { description, recipient } = unref(formInput) if (recipient.length > 0 && !EmailValidator.validate(recipient)) { emailErrorMessage.value = $gettext('Please enter a valid email address!') unref(inputForFocusEmail).focus() return } if (unref(descriptionErrorMessage)) { return } try { const { data: tokenInfo } = await clientService.httpAuthenticated.post( '/sciencemesh/generate-invite', { params: { ...(description && { description }), ...(recipient && { recipient }) } }, { schema: inviteSchema } ) if (tokenInfo.token) { tokens.value.push({ id: tokenInfo.token, link: tokenInfo.invite_link, token: tokenInfo.token, ...(tokenInfo.expiration && { expiration: toDateTime(tokenInfo.expiration) }), ...(tokenInfo.expiration && { expirationSeconds: tokenInfo.expiration }), ...(tokenInfo.description && { description: tokenInfo.description }) }) showMessage({ title: $gettext('Success'), status: 'success', desc: recipient ? $gettext('New invitation link has been created and sent to %{recipient}.', { recipient }) : $gettext( 'New invitation link has been created and copied to your clipboard. Send it to the invitee(s).' ) }) lastCreatedToken.value = tokenInfo.token if (!recipient) { navigator.clipboard.writeText(tokenInfo.invite_link) } } } catch (error) { lastCreatedToken.value = '' errorPopup(error) } finally { resetGenerateInviteToken() } } const listTokens = async () => { const url = '/sciencemesh/list-invite' try { const { data } = await clientService.httpAuthenticated.get(url, { schema: inviteListSchema }) data.forEach((t) => { tokens.value.push({ id: t.token, token: t.token, ...(t.expiration && { expiration: toDateTime(t.expiration) }), ...(t.expiration && { expirationSeconds: t.expiration }), ...(t.description && { description: t.description }) }) }) } catch (error) { console.log(error) } finally { loading.value = false } } const copyLink = (rowData) => { navigator.clipboard.writeText(rowData.item.link) showMessage({ title: $gettext('Invition link copied'), desc: $gettext('Invitation link has been copied to your clipboard.') }) } const copyToken = (rowData) => { navigator.clipboard.writeText(rowData.item.token) showMessage({ title: $gettext('Invite token copied'), desc: $gettext('Invite token has been copied to your clipboard.') }) } const errorPopup = (error: Error) => { console.error(error) showErrorMessage({ title: $gettext('Error'), desc: $gettext('An error occurred when generating the token'), errors: [error] }) } const openInviteModal = () => { showInviteModal.value = true } const resetGenerateInviteToken = () => { showInviteModal.value = false formInput.value = { description: '', recipient: '' } } const toDateTime = (secs: number) => { const d = new Date(Date.UTC(1970, 0, 1)) d.setUTCSeconds(secs) return ( ('0' + d.getDate()).slice(-2) + '-' + ('0' + (d.getMonth() + 1)).slice(-2) + '-' + d.getFullYear() + ' ' + ('0' + d.getHours()).slice(-2) + ':' + ('0' + d.getMinutes()).slice(-2) ) } onMounted(() => { listTokens() }) return { helperContent, openInviteModal, showInviteModal, descriptionErrorMessage, resetGenerateInviteToken, generateToken, formInput, emailErrorMessage, loading, sortedTokens, copyToken, copyLink, lastCreatedToken, fields, inputForFocusEmail } } }) </script> <style lang="scss" scoped> #invite-tokens-empty { height: 10vh; } </style>
owncloud/web/packages/web-app-ocm/src/views/OutgoingInvitations.vue/0
{ "file_path": "owncloud/web/packages/web-app-ocm/src/views/OutgoingInvitations.vue", "repo_id": "owncloud", "token_count": 5095 }
814
export const getMimeTypes = (extensionMimeTypes: string[] = []) => { return [ 'audio/flac', 'audio/mpeg', 'audio/ogg', 'audio/wav', 'audio/x-flac', 'audio/x-wav', 'image/gif', 'image/jpeg', 'image/png', 'video/mp4', 'video/webm', ...extensionMimeTypes ] }
owncloud/web/packages/web-app-preview/src/mimeTypes.ts/0
{ "file_path": "owncloud/web/packages/web-app-preview/src/mimeTypes.ts", "repo_id": "owncloud", "token_count": 149 }
815
{ "name": "text-editor", "version": "0.0.0", "private": true, "description": "ownCloud Web simple text editor", "license": "AGPL-3.0", "devDependencies": { "web-test-helpers": "workspace:*" }, "peerDependencies": { "@ownclouders/web-client": "workspace:*", "@ownclouders/web-pkg": "workspace:*", "vue-concurrency": "5.0.0", "vue3-gettext": "2.4.0" } }
owncloud/web/packages/web-app-text-editor/package.json/0
{ "file_path": "owncloud/web/packages/web-app-text-editor/package.json", "repo_id": "owncloud", "token_count": 176 }
816
export class HttpError extends Error { public response: Response public statusCode: number constructor(message: string, response: Response, statusCode = null) { super(message) this.response = response this.statusCode = statusCode } }
owncloud/web/packages/web-client/src/errors.ts/0
{ "file_path": "owncloud/web/packages/web-client/src/errors.ts", "repo_id": "owncloud", "token_count": 73 }
817
export function buildWebDavPublicPath(publicLinkToken, path = '') { return `/public-files/${publicLinkToken}/${path}`.split('/').filter(Boolean).join('/') } export function buildWebDavOcmPath(publicLinkToken, path = '') { return `/ocm/${publicLinkToken}/${path}`.split('/').filter(Boolean).join('/') }
owncloud/web/packages/web-client/src/helpers/publicLink/functions.ts/0
{ "file_path": "owncloud/web/packages/web-client/src/helpers/publicLink/functions.ts", "repo_id": "owncloud", "token_count": 107 }
818
/** @deprecated */ export interface User { id?: string uuid?: string name?: string username?: string displayName?: string avatar?: string shareType?: number additionalInfo?: any role?: any roles?: any[] }
owncloud/web/packages/web-client/src/helpers/user/types.ts/0
{ "file_path": "owncloud/web/packages/web-client/src/helpers/user/types.ts", "repo_id": "owncloud", "token_count": 68 }
819
import { urlJoin } from '../utils' import { SpaceResource } from '../helpers' import { DAV, buildAuthHeader } from './client' import { WebDavOptions } from './types' import { unref } from 'vue' export const CopyFilesFactory = (dav: DAV, { accessToken }: WebDavOptions) => { return { copyFiles( sourceSpace: SpaceResource, { path: sourcePath }, targetSpace: SpaceResource, { path: targetPath }, options?: { overwrite?: boolean } ) { const headers = buildAuthHeader(unref(accessToken), sourceSpace) return dav.copy( urlJoin(sourceSpace.webDavPath, sourcePath), urlJoin(targetSpace.webDavPath, targetPath), { overwrite: options?.overwrite || false, headers } ) } } }
owncloud/web/packages/web-client/src/webdav/copyFiles.ts/0
{ "file_path": "owncloud/web/packages/web-client/src/webdav/copyFiles.ts", "repo_id": "owncloud", "token_count": 281 }
820
import { SpaceResource } from '../helpers' import { WebDavOptions } from './types' import { urlJoin } from '../utils' import { Resource } from '../helpers' import { DAV, buildAuthHeader } from './client' import { unref } from 'vue' export const RestoreFileVersionFactory = (dav: DAV, { accessToken, user }: WebDavOptions) => { return { restoreFileVersion(space: SpaceResource, { id, path }: Resource, versionId: string) { const webDavPath = urlJoin(space.webDavPath, path) const headers = buildAuthHeader(unref(accessToken), space) const source = urlJoin('meta', id, 'v', versionId, { leadingSlash: true }) const target = urlJoin('files', unref(user).onPremisesSamAccountName, webDavPath, { leadingSlash: true }) return dav.copy(source, target, { headers }) } } }
owncloud/web/packages/web-client/src/webdav/restoreFileVersion.ts/0
{ "file_path": "owncloud/web/packages/web-client/src/webdav/restoreFileVersion.ts", "repo_id": "owncloud", "token_count": 287 }
821
export * from './types'
owncloud/web/packages/web-pkg/src/apps/index.ts/0
{ "file_path": "owncloud/web/packages/web-pkg/src/apps/index.ts", "repo_id": "owncloud", "token_count": 8 }
822