@globalbrain/sefirot 2.0.0-draft.8 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/README.md +6 -6
  2. package/lib/components/SAvatar.vue +17 -17
  3. package/lib/components/SButton.vue +520 -276
  4. package/lib/components/SButtonGroup.vue +149 -0
  5. package/lib/components/SDropdown.vue +26 -150
  6. package/lib/components/SDropdownSection.vue +48 -0
  7. package/lib/components/SDropdownSectionFilter.vue +190 -0
  8. package/lib/components/SDropdownSectionFilterItem.vue +21 -0
  9. package/lib/components/SDropdownSectionFilterItemAvatar.vue +31 -0
  10. package/lib/components/SDropdownSectionFilterItemText.vue +20 -0
  11. package/lib/components/SDropdownSectionMenu.vue +39 -0
  12. package/lib/components/SIcon.vue +13 -0
  13. package/lib/components/SInputBase.vue +31 -31
  14. package/lib/components/SInputCheckbox.vue +4 -3
  15. package/lib/components/SInputCheckboxes.vue +74 -0
  16. package/lib/components/SInputDate.vue +182 -0
  17. package/lib/components/SInputDropdown.vue +159 -157
  18. package/lib/components/SInputDropdownItem.vue +46 -48
  19. package/lib/components/SInputDropdownItemAvatar.vue +99 -0
  20. package/lib/components/SInputDropdownItemText.vue +79 -16
  21. package/lib/components/SInputFile.vue +56 -60
  22. package/lib/components/SInputHMS.vue +120 -110
  23. package/lib/components/SInputNumber.vue +38 -9
  24. package/lib/components/SInputRadio.vue +39 -36
  25. package/lib/components/SInputRadios.vue +40 -53
  26. package/lib/components/SInputSelect.vue +7 -6
  27. package/lib/components/SInputSwitch.vue +193 -0
  28. package/lib/components/SInputSwitches.vue +88 -0
  29. package/lib/components/SInputText.vue +207 -62
  30. package/lib/components/SInputTextarea.vue +46 -32
  31. package/lib/components/SInputYMD.vue +123 -126
  32. package/lib/components/SMarkdown.vue +52 -0
  33. package/lib/components/SModal.vue +33 -57
  34. package/lib/components/SMount.vue +19 -0
  35. package/lib/components/SSheet.vue +50 -55
  36. package/lib/components/SSheetFooter.vue +1 -1
  37. package/lib/components/SSheetFooterAction.vue +24 -17
  38. package/lib/components/SSheetFooterActions.vue +1 -4
  39. package/lib/components/SSheetForm.vue +15 -0
  40. package/lib/components/SSheetMedium.vue +8 -10
  41. package/lib/components/SSheetTitle.vue +7 -14
  42. package/lib/components/SSnackbar.vue +58 -47
  43. package/lib/components/{SPortalSnackbars.vue → SSnackbars.vue} +17 -20
  44. package/lib/components/{icons/SIconPreloader.vue → SSpinner.vue} +5 -4
  45. package/lib/components/SStep.vue +107 -0
  46. package/lib/components/SSteps.vue +59 -0
  47. package/lib/components/STable.vue +242 -0
  48. package/lib/components/STableCell.vue +82 -0
  49. package/lib/components/STableCellAvatar.vue +69 -0
  50. package/lib/components/STableCellAvatars.vue +93 -0
  51. package/lib/components/STableCellDay.vue +40 -0
  52. package/lib/components/STableCellPill.vue +84 -0
  53. package/lib/components/STableCellText.vue +103 -0
  54. package/lib/components/STableColumn.vue +255 -0
  55. package/lib/components/STableFooter.vue +115 -0
  56. package/lib/components/STableHeader.vue +74 -0
  57. package/lib/components/STableItem.vue +38 -0
  58. package/lib/components/STooltip.vue +112 -0
  59. package/lib/composables/Dropdown.ts +40 -99
  60. package/lib/composables/Form.ts +21 -18
  61. package/lib/composables/Grid.ts +117 -0
  62. package/lib/composables/Markdown.ts +138 -0
  63. package/lib/composables/Step.ts +7 -0
  64. package/lib/composables/Table.ts +103 -0
  65. package/lib/composables/Tooltip.ts +91 -0
  66. package/lib/composables/Validation.ts +5 -9
  67. package/lib/composables/markdown/LinkPlugin.ts +45 -0
  68. package/lib/mixins/Sheet.ts +5 -3
  69. package/lib/stores/Snackbars.ts +48 -0
  70. package/lib/{assets/styles → styles}/base.css +0 -0
  71. package/lib/{assets/styles → styles}/bootstrap.css +1 -0
  72. package/lib/{assets/styles → styles}/variables.css +55 -48
  73. package/lib/support/Day.ts +8 -0
  74. package/lib/support/Num.ts +3 -0
  75. package/lib/support/Time.ts +5 -2
  76. package/lib/support/Utils.ts +4 -3
  77. package/lib/types/shims.d.ts +3 -0
  78. package/lib/validation/validators/requiredYmd.ts +1 -1
  79. package/lib/validation/validators/ymd.ts +4 -4
  80. package/package.json +59 -37
  81. package/CHANGELOG.md +0 -47
  82. package/lib/.DS_Store +0 -0
  83. package/lib/components/.DS_Store +0 -0
  84. package/lib/components/SDialog.vue +0 -140
  85. package/lib/components/SDropdownItem.vue +0 -78
  86. package/lib/components/SDropdownItemText.vue +0 -22
  87. package/lib/components/SDropdownItemUser.vue +0 -40
  88. package/lib/components/SInputDropdownItemTextTag.vue +0 -94
  89. package/lib/components/SInputDropdownItemUser.vue +0 -41
  90. package/lib/components/SInputDropdownItemUserTag.vue +0 -100
  91. package/lib/components/SPortalModals.vue +0 -74
  92. package/lib/components/icons/.DS_Store +0 -0
  93. package/lib/components/icons/SIconActivity.vue +0 -5
  94. package/lib/components/icons/SIconArrowDown.vue +0 -5
  95. package/lib/components/icons/SIconArrowLeft.vue +0 -5
  96. package/lib/components/icons/SIconArrowRight.vue +0 -5
  97. package/lib/components/icons/SIconArrowUp.vue +0 -5
  98. package/lib/components/icons/SIconBarChart.vue +0 -7
  99. package/lib/components/icons/SIconBriefcase.vue +0 -5
  100. package/lib/components/icons/SIconBuilding.vue +0 -5
  101. package/lib/components/icons/SIconCalendar.vue +0 -5
  102. package/lib/components/icons/SIconCheck.vue +0 -5
  103. package/lib/components/icons/SIconCheckCircle.vue +0 -6
  104. package/lib/components/icons/SIconCheckCircleThin.vue +0 -6
  105. package/lib/components/icons/SIconCheckSquare.vue +0 -6
  106. package/lib/components/icons/SIconChevronDown.vue +0 -5
  107. package/lib/components/icons/SIconChevronLeft.vue +0 -5
  108. package/lib/components/icons/SIconChevronRight.vue +0 -5
  109. package/lib/components/icons/SIconChevronUp.vue +0 -5
  110. package/lib/components/icons/SIconClock.vue +0 -6
  111. package/lib/components/icons/SIconCode.vue +0 -6
  112. package/lib/components/icons/SIconDatabase.vue +0 -5
  113. package/lib/components/icons/SIconDollarSign.vue +0 -5
  114. package/lib/components/icons/SIconDownload.vue +0 -6
  115. package/lib/components/icons/SIconDownloadCloud.vue +0 -6
  116. package/lib/components/icons/SIconEdit.vue +0 -6
  117. package/lib/components/icons/SIconEdit2.vue +0 -5
  118. package/lib/components/icons/SIconEdit3.vue +0 -6
  119. package/lib/components/icons/SIconEdit3Off.vue +0 -6
  120. package/lib/components/icons/SIconExternalLink.vue +0 -6
  121. package/lib/components/icons/SIconEye.vue +0 -6
  122. package/lib/components/icons/SIconFile.vue +0 -5
  123. package/lib/components/icons/SIconFilePlus.vue +0 -6
  124. package/lib/components/icons/SIconFileText.vue +0 -8
  125. package/lib/components/icons/SIconFlag.vue +0 -5
  126. package/lib/components/icons/SIconGitBranch.vue +0 -5
  127. package/lib/components/icons/SIconGitCommit.vue +0 -5
  128. package/lib/components/icons/SIconGitPullRequest.vue +0 -6
  129. package/lib/components/icons/SIconGlobe.vue +0 -5
  130. package/lib/components/icons/SIconGrab.vue +0 -10
  131. package/lib/components/icons/SIconGrid.vue +0 -8
  132. package/lib/components/icons/SIconHome.vue +0 -5
  133. package/lib/components/icons/SIconImage.vue +0 -6
  134. package/lib/components/icons/SIconInbox.vue +0 -5
  135. package/lib/components/icons/SIconInfo.vue +0 -7
  136. package/lib/components/icons/SIconLayout.vue +0 -5
  137. package/lib/components/icons/SIconList.vue +0 -10
  138. package/lib/components/icons/SIconLock.vue +0 -5
  139. package/lib/components/icons/SIconLogout.vue +0 -6
  140. package/lib/components/icons/SIconMail.vue +0 -6
  141. package/lib/components/icons/SIconMapPin.vue +0 -6
  142. package/lib/components/icons/SIconMoon.vue +0 -5
  143. package/lib/components/icons/SIconMoreHorizontal.vue +0 -7
  144. package/lib/components/icons/SIconMoreVertical.vue +0 -7
  145. package/lib/components/icons/SIconPauseFill.vue +0 -6
  146. package/lib/components/icons/SIconPlayCircle.vue +0 -6
  147. package/lib/components/icons/SIconPlayFill.vue +0 -5
  148. package/lib/components/icons/SIconPlus.vue +0 -5
  149. package/lib/components/icons/SIconPlusCircle.vue +0 -8
  150. package/lib/components/icons/SIconPlusOff.vue +0 -7
  151. package/lib/components/icons/SIconPreloaderDark.vue +0 -52
  152. package/lib/components/icons/SIconPreloaderLight.vue +0 -52
  153. package/lib/components/icons/SIconProgress.vue +0 -5
  154. package/lib/components/icons/SIconRadio.vue +0 -6
  155. package/lib/components/icons/SIconSave.vue +0 -5
  156. package/lib/components/icons/SIconSearch.vue +0 -5
  157. package/lib/components/icons/SIconSend.vue +0 -5
  158. package/lib/components/icons/SIconSettings.vue +0 -6
  159. package/lib/components/icons/SIconShare2.vue +0 -5
  160. package/lib/components/icons/SIconSkipBackFill.vue +0 -6
  161. package/lib/components/icons/SIconSliders.vue +0 -12
  162. package/lib/components/icons/SIconSun.vue +0 -13
  163. package/lib/components/icons/SIconTelescope.vue +0 -5
  164. package/lib/components/icons/SIconTrash.vue +0 -5
  165. package/lib/components/icons/SIconTrash2.vue +0 -7
  166. package/lib/components/icons/SIconTrash2Off.vue +0 -6
  167. package/lib/components/icons/SIconTrello.vue +0 -7
  168. package/lib/components/icons/SIconUser.vue +0 -6
  169. package/lib/components/icons/SIconUsers.vue +0 -8
  170. package/lib/components/icons/SIconWarning.vue +0 -7
  171. package/lib/components/icons/SIconX.vue +0 -5
  172. package/lib/components/icons/SIconXCircle.vue +0 -6
  173. package/lib/components/icons/SIconXCircleThin.vue +0 -6
  174. package/lib/components/icons/SIconXSquare.vue +0 -6
  175. package/lib/components/icons/SIconZap.vue +0 -5
  176. package/lib/composables/Dialog.ts +0 -38
  177. package/lib/composables/Modal.ts +0 -34
  178. package/lib/composables/Snackbar.ts +0 -18
  179. package/lib/store/Sefirot.ts +0 -17
  180. package/lib/store/dialog/index.ts +0 -42
  181. package/lib/store/modal/index.ts +0 -61
  182. package/lib/store/snackbars/index.ts +0 -70
@@ -1,5 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
- <path d="M21,5h-4V4c0-1.7-1.3-3-3-3h-4C8.3,1,7,2.3,7,4v1H3C2.4,5,2,5.4,2,6s0.4,1,1,1h1v13c0,1.7,1.3,3,3,3h10c1.7,0,3-1.3,3-3V7h1c0.6,0,1-0.4,1-1S21.6,5,21,5zM9,4c0-0.6,0.4-1,1-1h4c0.6,0,1,0.4,1,1v1H9V4zM18,20c0,0.6-0.4,1-1,1H7c-0.6,0-1-0.4-1-1V7h12V20z" />
4
- </svg>
5
- </template>
@@ -1,7 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
- <path d="M21.2,4.7h-4v-1c0-1.7-1.3-3-3-3h-4c-1.7,0-3,1.3-3,3v1h-4c-0.6,0-1,0.4-1,1s0.4,1,1,1h1v13c0,1.7,1.3,3,3,3h10c1.7,0,3-1.3,3-3v-13h1c0.6,0,1-0.4,1-1S21.7,4.7,21.2,4.7zM9.2,3.7c0-0.6,0.4-1,1-1h4c0.6,0,1,0.4,1,1v1h-6V3.7z M18.2,19.7c0,0.6-0.4,1-1,1h-10c-0.6,0-1-0.4-1-1v-13h12V19.7z" />
4
- <path d="M10.2,9.7c-0.6,0-1,0.4-1,1v6c0,0.6,0.4,1,1,1s1-0.4,1-1v-6C11.2,10.2,10.7,9.7,10.2,9.7z" />
5
- <path d="M14.2,9.7c-0.6,0-1,0.4-1,1v6c0,0.6,0.4,1,1,1s1-0.4,1-1v-6C15.2,10.2,14.7,9.7,14.2,9.7z" />
6
- </svg>
7
- </template>
@@ -1,6 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
- <path d="M9,3h5a1,1,0,0,1,1,1V5H12a1,1,0,0,0,0,2h6v6a1,1,0,0,0,2,0V7h1a1,1,0,0,0,0-2H17V4a3,3,0,0,0-3-3H9A1,1,0,0,0,9,3Z" />
4
- <path d="M23.71,22.29l-22-22A1,1,0,0,0,.29,1.71L3.59,5H3A1,1,0,0,0,3,7H4V20a3,3,0,0,0,3,3H17a3,3,0,0,0,2.76-1.83l2.53,2.54a1,1,0,0,0,1.42,0A1,1,0,0,0,23.71,22.29ZM18,20a1,1,0,0,1-1,1H7a1,1,0,0,1-1-1V7.41l3,3V17a1,1,0,0,0,2,0V12.41l2,2V17a1,1,0,0,0,2,0v-.59l3,3Z" />
5
- </svg>
6
- </template>
@@ -1,7 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
- <path d="M19,22H5c-1.7,0-3-1.3-3-3V5c0-1.7,1.3-3,3-3h14c1.7,0,3,1.3,3,3v14C22,20.7,20.7,22,19,22zM5,4C4.4,4,4,4.4,4,5v14c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V5c0-0.6-0.4-1-1-1H5z" />
4
- <path d="M10,17H7c-0.6,0-1-0.4-1-1V7c0-0.6,0.4-1,1-1h3c0.6,0,1,0.4,1,1v9C11,16.6,10.6,17,10,17zM8,15h1V8H8V15z" />
5
- <path d="M17,13h-3c-0.6,0-1-0.4-1-1V7c0-0.6,0.4-1,1-1h3c0.6,0,1,0.4,1,1v5C18,12.6,17.6,13,17,13zM15,11h1V8h-1V11z" />
6
- </svg>
7
- </template>
@@ -1,6 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
- <path d="M20,22c-0.6,0-1-0.4-1-1v-2c0-1.7-1.3-3-3-3H8c-1.7,0-3,1.3-3,3v2c0,0.6-0.4,1-1,1s-1-0.4-1-1v-2c0-2.8,2.2-5,5-5h8c2.8,0,5,2.2,5,5v2C21,21.6,20.6,22,20,22z" />
4
- <path d="M12,12c-2.8,0-5-2.2-5-5s2.2-5,5-5s5,2.2,5,5S14.8,12,12,12zM12,4c-1.7,0-3,1.3-3,3s1.3,3,3,3s3-1.3,3-3S13.7,4,12,4z" />
5
- </svg>
6
- </template>
@@ -1,8 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
- <path d="M17,22c-0.6,0-1-0.4-1-1v-2c0-1.7-1.3-3-3-3H5c-1.7,0-3,1.3-3,3v2c0,0.6-0.4,1-1,1s-1-0.4-1-1v-2c0-2.8,2.2-5,5-5h8c2.8,0,5,2.2,5,5v2C18,21.6,17.6,22,17,22z" />
4
- <path d="M9,12c-2.8,0-5-2.2-5-5s2.2-5,5-5s5,2.2,5,5S11.8,12,9,12zM9,4C7.3,4,6,5.3,6,7s1.3,3,3,3s3-1.3,3-3S10.7,4,9,4z" />
5
- <path d="M23,22c-0.6,0-1-0.4-1-1v-2c0-1.4-0.9-2.6-2.2-2.9c-0.5-0.1-0.9-0.7-0.7-1.2c0.1-0.5,0.7-0.9,1.2-0.7c2.2,0.6,3.7,2.6,3.8,4.8v2C24,21.6,23.6,22,23,22z" />
6
- <path d="M16,11.9c-0.4,0-0.9-0.3-1-0.8c-0.1-0.5,0.2-1.1,0.7-1.2c1.1-0.3,1.9-1.1,2.2-2.2c0.4-1.6-0.6-3.2-2.2-3.7C15.2,4,14.9,3.4,15,2.9s0.7-0.9,1.2-0.7c2.7,0.7,4.3,3.4,3.6,6.1c-0.5,1.8-1.8,3.2-3.6,3.6C16.2,11.9,16.1,11.9,16,11.9z" />
7
- </svg>
8
- </template>
@@ -1,7 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
- <path d="M12,2.5a1.15,1.15,0,0,1,1.1.6l9.7,16.4a1.42,1.42,0,0,1,.2.6,1.32,1.32,0,0,1-1.3,1.3H2.3a1.42,1.42,0,0,1-.6-.2,1.11,1.11,0,0,1-.5-1.7L10.9,3.1l.4-.4a1.85,1.85,0,0,1,.7-.2m0-1a2.66,2.66,0,0,0-1.2.3,3,3,0,0,0-.8.8L.3,19a2.4,2.4,0,0,0,.8,3.2,2,2,0,0,0,1.1.3H21.7A2.33,2.33,0,0,0,24,20.2a2,2,0,0,0-.3-1.1L14,2.6a2.43,2.43,0,0,0-2-1.1Z" />
4
- <path d="M12,14a1,1,0,0,1-1-1V9a1,1,0,0,1,2,0v4A1,1,0,0,1,12,14Z" />
5
- <path d="M12,18a1,1,0,0,1-.92-1.38,1,1,0,0,1,.21-.33,1,1,0,0,1,1.42,0,1.16,1.16,0,0,1,.21.33.94.94,0,0,1,0,.76,1.17,1.17,0,0,1-.21.33A1,1,0,0,1,12,18Z" />
6
- </svg>
7
- </template>
@@ -1,5 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
- <path d="M13.4,12l5.3-5.3c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0L12,10.6L6.7,5.3c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l5.3,5.3l-5.3,5.3c-0.4,0.4-0.4,1,0,1.4C5.5,18.9,5.7,19,6,19s0.5-0.1,0.7-0.3l5.3-5.3l5.3,5.3c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L13.4,12z" />
4
- </svg>
5
- </template>
@@ -1,6 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
- <path d="M12,1C5.9,1,1,5.9,1,12s4.9,11,11,11s11-4.9,11-11S18.1,1,12,1zM12,21c-5,0-9-4-9-9c0-5,4-9,9-9c5,0,9,4,9,9C21,17,17,21,12,21z" />
4
- <path d="M15.7,8.3c-0.4-0.4-1-0.4-1.4,0L12,10.6L9.7,8.3c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l2.3,2.3l-2.3,2.3c-0.4,0.4-0.4,1,0,1.4C8.5,15.9,8.7,16,9,16s0.5-0.1,0.7-0.3l2.3-2.3l2.3,2.3c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L13.4,12l2.3-2.3C16.1,9.3,16.1,8.7,15.7,8.3z" />
5
- </svg>
6
- </template>
@@ -1,6 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
- <path d="M12,0A12,12,0,1,0,24,12,12,12,0,0,0,12,0Zm0,22.86A10.86,10.86,0,1,1,22.86,12,10.87,10.87,0,0,1,12,22.86Z" />
4
- <path d="M15.83,8.17a.57.57,0,0,0-.81,0l-3,3-3-3A.57.57,0,1,0,8.17,9l3,3-3,3a.57.57,0,1,0,.81.81l3-3,3,3a.57.57,0,0,0,.81-.81l-3-3,3-3A.57.57,0,0,0,15.83,8.17Z" />
5
- </svg>
6
- </template>
@@ -1,6 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
- <path d="M19,2H5C3.3,2,2,3.3,2,5v14c0,1.7,1.3,3,3,3h14c1.7,0,3-1.3,3-3V5C22,3.3,20.7,2,19,2z M20,19c0,0.6-0.4,1-1,1H5c-0.6,0-1-0.4-1-1V5c0-0.6,0.4-1,1-1h14c0.6,0,1,0.4,1,1V19z" />
4
- <path d="M15.7,8.3c-0.4-0.4-1-0.4-1.4,0L12,10.6L9.7,8.3c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l2.3,2.3l-2.3,2.3c-0.4,0.4-0.4,1,0,1.4C8.5,15.9,8.7,16,9,16s0.5-0.1,0.7-0.3l2.3-2.3l2.3,2.3c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L13.4,12l2.3-2.3C16.1,9.3,16.1,8.7,15.7,8.3z" />
5
- </svg>
6
- </template>
@@ -1,5 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
- <path d="M11,23c-0.1,0-0.3,0-0.4-0.1c-0.4-0.2-0.6-0.6-0.6-1l0.9-6.9H3c-0.4,0-0.7-0.2-0.9-0.6c-0.2-0.4-0.1-0.8,0.1-1.1l10-12C12.5,1,13,0.9,13.4,1.1c0.4,0.2,0.6,0.6,0.6,1L13.1,9H21c0.4,0,0.7,0.2,0.9,0.6c0.2,0.4,0.1,0.8-0.1,1.1l-10,12C11.6,22.9,11.3,23,11,23zM5.1,13H12c0.3,0,0.6,0.1,0.7,0.3c0.2,0.2,0.3,0.5,0.2,0.8l-0.6,4.6l6.4-7.7H12c-0.3,0-0.6-0.1-0.7-0.3c-0.2-0.2-0.3-0.5-0.2-0.8l0.6-4.6L5.1,13z" />
4
- </svg>
5
- </template>
@@ -1,38 +0,0 @@
1
- import { useStore } from 'vuex'
2
- import { useModalId } from './Modal'
3
-
4
- export interface Dialog {
5
- open(dialog?: Options): Promise<any>
6
- close(): Promise<any>
7
- }
8
-
9
- export interface Options {
10
- type?: 'confirm' | 'loading'
11
- title?: string
12
- text?: string
13
- actions?: Action[]
14
- }
15
-
16
- export interface Action {
17
- type?: 'primary' | 'mute'
18
- label: string
19
- callback(): void
20
- }
21
-
22
- export function useDialog(): Dialog {
23
- const store = useStore()
24
- const id = useModalId()
25
-
26
- function open(options?: Options) {
27
- return store.dispatch('dialog/open', { ...options, id })
28
- }
29
-
30
- function close() {
31
- return store.dispatch('dialog/close', id)
32
- }
33
-
34
- return {
35
- open,
36
- close
37
- }
38
- }
@@ -1,34 +0,0 @@
1
- import { useStore } from 'vuex'
2
-
3
- export interface Modal {
4
- open(data?: Record<string, any>): Promise<any>
5
- close(): Promise<any>
6
- }
7
-
8
- let modalId = 0
9
-
10
- export function useModal(component: any): Modal {
11
- const store = useStore()
12
- const id = useModalId()
13
-
14
- function open(data: Record<string, any> = {}): Promise<any> {
15
- return store.dispatch('modal/open', {
16
- id,
17
- component,
18
- data
19
- })
20
- }
21
-
22
- function close() {
23
- return store.dispatch('modal/close', id)
24
- }
25
-
26
- return {
27
- open,
28
- close
29
- }
30
- }
31
-
32
- export function useModalId(): number {
33
- return ++modalId
34
- }
@@ -1,18 +0,0 @@
1
- import { useStore } from 'vuex'
2
- import { Snackbar as SnackbarOptions } from '../store/snackbars'
3
-
4
- export interface Snackbar {
5
- push(options: SnackbarOptions): void
6
- }
7
-
8
- export function useSnackbar(): Snackbar {
9
- const store = useStore()
10
-
11
- function push(options: SnackbarOptions): void {
12
- store.dispatch('snackbars/push', options)
13
- }
14
-
15
- return {
16
- push
17
- }
18
- }
@@ -1,17 +0,0 @@
1
- import { Store, Plugin } from 'vuex'
2
- import modal, { State as ModalState } from './modal'
3
- import dialog from './dialog'
4
- import snackbars, { State as SnackbarsState } from './snackbars'
5
-
6
- export interface State {
7
- modal: ModalState
8
- snackbars: SnackbarsState
9
- }
10
-
11
- export function Sefirot<S = any>(): Plugin<S> {
12
- return (store) => {
13
- store.registerModule('modal', modal)
14
- store.registerModule('dialog', dialog)
15
- store.registerModule('snackbars', snackbars)
16
- }
17
- }
@@ -1,42 +0,0 @@
1
- import { ActionTree, ActionContext } from 'vuex'
2
- import SDialog from '../../components/SDialog.vue'
3
-
4
- export interface OpenPayload {
5
- id?: number
6
- type?: 'confirm' | 'loading'
7
- title?: string
8
- text?: string
9
- actions?: Action[]
10
- }
11
-
12
- export interface Action {
13
- type?: 'text' | 'mute'
14
- label: string
15
- callback(): void
16
- }
17
-
18
- export const actions: ActionTree<any, any> = {
19
- open(context: ActionContext<any, any>, payload: OpenPayload): void {
20
- const { id } = payload
21
-
22
- delete payload.id
23
-
24
- context.dispatch('modal/open', {
25
- id,
26
- component: SDialog,
27
- data: payload,
28
- options: {
29
- closable: false
30
- }
31
- }, { root: true })
32
- },
33
-
34
- close(context: ActionContext<any, any>, uid?: number): void {
35
- context.dispatch('modal/close', uid, { root: true })
36
- }
37
- }
38
-
39
- export default {
40
- namespaced: true,
41
- actions
42
- }
@@ -1,61 +0,0 @@
1
- import { shallowReactive, markRaw } from 'vue'
2
- import { ActionTree, ActionContext, MutationTree } from 'vuex'
3
-
4
- export interface State {
5
- items: Item[]
6
- }
7
-
8
- export interface Item {
9
- id?: number
10
- component: any
11
- data?: Record<string, any>
12
- }
13
-
14
- function state(): State {
15
- return {
16
- items: []
17
- }
18
- }
19
-
20
- const actions: ActionTree<State, any> = {
21
- open(context: ActionContext<State, any>, item: Item): void {
22
- context.commit('push', item)
23
- },
24
-
25
- close(context: ActionContext<State, any>, id?: number): void {
26
- id ? context.commit('drop', id) : context.commit('pop')
27
- },
28
-
29
- closeAll(context: ActionContext<State, any>): void {
30
- context.commit('flush')
31
- }
32
- }
33
-
34
- const mutations: MutationTree<State> = {
35
- push(state: State, item: Item): void {
36
- state.items.push({
37
- ...item,
38
- data: shallowReactive(item.data ?? {}),
39
- component: markRaw(item.component)
40
- })
41
- },
42
-
43
- pop(state: State): void {
44
- state.items.pop()
45
- },
46
-
47
- drop(state: State, id: number) {
48
- state.items = state.items.filter(item => item.id !== id)
49
- },
50
-
51
- flush(state: State): void {
52
- state.items = []
53
- }
54
- }
55
-
56
- export default {
57
- namespaced: true,
58
- state,
59
- actions,
60
- mutations
61
- }
@@ -1,70 +0,0 @@
1
- import { ActionTree, ActionContext, MutationTree } from 'vuex'
2
-
3
- let nextId: number = 0
4
-
5
- const maxItemSize: number = 4
6
-
7
- export interface State {
8
- items: SnackbarWithId[]
9
- }
10
-
11
- export interface Snackbar {
12
- text: string
13
- timeout?: number
14
- actions?: Action[]
15
- }
16
-
17
- export interface SnackbarWithId extends Snackbar {
18
- id: number
19
- }
20
-
21
- export interface Action {
22
- type: 'primary' | 'secondary' | 'tertiary' | 'text' | 'mute'
23
- label: string
24
- callback: Function
25
- }
26
-
27
- export function state(): State {
28
- return {
29
- items: []
30
- }
31
- }
32
-
33
- export const actions: ActionTree<State, any> = {
34
- push(context: ActionContext<State, any>, payload: Snackbar): void {
35
- const id = nextId++
36
-
37
- context.commit('push', {
38
- id,
39
- text: payload.text,
40
- actions: payload.actions
41
- })
42
-
43
- setTimeout(() => { context.commit('pop', id) }, payload.timeout ?? 10000)
44
- },
45
-
46
- pop(context: ActionContext<State, any>, id: number): void {
47
- context.commit('pop', id)
48
- }
49
- }
50
-
51
- export const mutations: MutationTree<State> = {
52
- push(state: State, item: SnackbarWithId): void {
53
- if (state.items.length > maxItemSize) {
54
- state.items.shift()
55
- }
56
-
57
- state.items.push(item)
58
- },
59
-
60
- pop(state: State, id: number): void {
61
- state.items = state.items.filter(item => item.id !== id)
62
- }
63
- }
64
-
65
- export default {
66
- namespaced: true,
67
- state,
68
- actions,
69
- mutations
70
- }