@globalbrain/sefirot 0.72.0 → 2.0.0-draft.1

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 (174) hide show
  1. package/CHANGELOG.md +2 -820
  2. package/README.md +1 -1
  3. package/lib/assets/styles/bootstrap.css +1 -2
  4. package/lib/assets/styles/variables.css +14 -47
  5. package/lib/components/SAvatar.vue +9 -18
  6. package/lib/components/SButton.vue +35 -48
  7. package/lib/components/SDialog.vue +16 -34
  8. package/lib/components/SDropdown.vue +36 -55
  9. package/lib/components/SDropdownItem.vue +27 -39
  10. package/lib/components/SDropdownItemText.vue +4 -9
  11. package/lib/components/SDropdownItemUser.vue +4 -12
  12. package/lib/components/SInputBase.vue +33 -45
  13. package/lib/components/SInputCheckbox.vue +17 -37
  14. package/lib/components/SInputDropdown.vue +109 -171
  15. package/lib/components/SInputDropdownItem.vue +26 -32
  16. package/lib/components/SInputDropdownItemText.vue +6 -11
  17. package/lib/components/SInputDropdownItemTextTag.vue +10 -17
  18. package/lib/components/SInputDropdownItemUser.vue +5 -13
  19. package/lib/components/SInputDropdownItemUserTag.vue +9 -16
  20. package/lib/components/SInputFile.vue +38 -53
  21. package/lib/components/SInputHMS.vue +91 -114
  22. package/lib/components/SInputNumber.vue +27 -106
  23. package/lib/components/SInputRadio.vue +21 -34
  24. package/lib/components/SInputRadios.vue +36 -46
  25. package/lib/components/SInputText.vue +59 -633
  26. package/lib/components/SInputTextarea.vue +54 -113
  27. package/lib/components/SInputYMD.vue +94 -105
  28. package/lib/components/SLink.vue +16 -52
  29. package/lib/components/SModal.vue +53 -90
  30. package/lib/components/SPortalModals.vue +37 -53
  31. package/lib/components/SPortalSnackbars.vue +9 -24
  32. package/lib/components/SSheet.vue +10 -23
  33. package/lib/components/SSheetFooter.vue +0 -2
  34. package/lib/components/SSheetFooterAction.vue +9 -14
  35. package/lib/components/SSheetFooterActions.vue +1 -3
  36. package/lib/components/SSheetHeader.vue +9 -24
  37. package/lib/components/SSheetHeaderTitle.vue +0 -2
  38. package/lib/components/SSheetMedium.vue +12 -14
  39. package/lib/components/SSnackbar.vue +18 -28
  40. package/lib/composables/Dialog.ts +9 -17
  41. package/lib/composables/Dropdown.ts +1 -1
  42. package/lib/composables/{Menu.ts → Flyout.ts} +11 -4
  43. package/lib/composables/Form.ts +42 -44
  44. package/lib/composables/Modal.ts +9 -9
  45. package/lib/composables/Snackbar.ts +18 -0
  46. package/lib/composables/Validation.ts +28 -0
  47. package/lib/mixins/Sheet.ts +3 -3
  48. package/lib/store/Sefirot.ts +8 -13
  49. package/lib/store/dialog/index.ts +20 -10
  50. package/lib/store/modal/index.ts +11 -13
  51. package/lib/store/snackbars/index.ts +3 -4
  52. package/lib/support/{Util.ts → Utils.ts} +0 -2
  53. package/lib/types/Utils.ts +0 -7
  54. package/lib/types/vue-shims.d.ts +7 -0
  55. package/lib/validation/rules/checked.ts +6 -10
  56. package/lib/validation/rules/fileExtension.ts +9 -9
  57. package/lib/validation/rules/hms.ts +9 -9
  58. package/lib/validation/rules/index.ts +10 -74
  59. package/lib/validation/rules/maxLength.ts +10 -9
  60. package/lib/validation/rules/minLength.ts +12 -0
  61. package/lib/validation/rules/required.ts +2 -10
  62. package/lib/validation/rules/requiredHms.ts +11 -0
  63. package/lib/validation/rules/requiredIf.ts +3 -11
  64. package/lib/validation/rules/requiredYmd.ts +11 -0
  65. package/lib/validation/rules/ymd.ts +11 -0
  66. package/lib/validation/validators/checked.ts +1 -1
  67. package/lib/validation/validators/fileExtension.ts +1 -1
  68. package/lib/validation/validators/hms.ts +5 -5
  69. package/lib/validation/validators/requiredHms.ts +17 -0
  70. package/lib/validation/validators/requiredYmd.ts +7 -0
  71. package/lib/validation/validators/ymd.ts +41 -0
  72. package/package.json +45 -50
  73. package/lib/components/SAction.vue +0 -37
  74. package/lib/components/SActionAvatar.vue +0 -25
  75. package/lib/components/SActionButton.vue +0 -40
  76. package/lib/components/SActionPill.vue +0 -35
  77. package/lib/components/SActionSwitch.vue +0 -37
  78. package/lib/components/SAlert.vue +0 -145
  79. package/lib/components/SButtonGroup.vue +0 -160
  80. package/lib/components/SCard.vue +0 -111
  81. package/lib/components/SCardFooter.vue +0 -74
  82. package/lib/components/SCardHeader.vue +0 -213
  83. package/lib/components/SGrid.vue +0 -237
  84. package/lib/components/SGridActionLink.vue +0 -53
  85. package/lib/components/SGridActionMulti.vue +0 -139
  86. package/lib/components/SGridActionSingle.vue +0 -64
  87. package/lib/components/SHeader.vue +0 -180
  88. package/lib/components/SInputCheckboxes.vue +0 -87
  89. package/lib/components/SInputDate.vue +0 -192
  90. package/lib/components/SInputDay.vue +0 -87
  91. package/lib/components/SInputMonth.vue +0 -86
  92. package/lib/components/SInputSelect.vue +0 -298
  93. package/lib/components/SInputSwitch.vue +0 -212
  94. package/lib/components/SInputSwitches.vue +0 -108
  95. package/lib/components/SInputTime.vue +0 -255
  96. package/lib/components/SInputYear.vue +0 -60
  97. package/lib/components/SMarkdown.vue +0 -56
  98. package/lib/components/SPlaceholderBlank.vue +0 -113
  99. package/lib/components/SPlaceholderImage.vue +0 -83
  100. package/lib/components/SPortalScreens.vue +0 -62
  101. package/lib/components/SProgressBar.vue +0 -89
  102. package/lib/components/SResponsive.vue +0 -46
  103. package/lib/components/SScreen.vue +0 -81
  104. package/lib/components/SStep.vue +0 -107
  105. package/lib/components/SSteps.vue +0 -75
  106. package/lib/components/STag.vue +0 -67
  107. package/lib/components/STooltip.vue +0 -134
  108. package/lib/components/SWindow.vue +0 -158
  109. package/lib/components/icons/SIconCopy.vue +0 -6
  110. package/lib/composables/Action.ts +0 -141
  111. package/lib/composables/Alert.ts +0 -50
  112. package/lib/composables/Card.ts +0 -46
  113. package/lib/composables/FormValidation.ts +0 -150
  114. package/lib/composables/Header.ts +0 -72
  115. package/lib/composables/InputDropdown.ts +0 -6
  116. package/lib/composables/Markdown.ts +0 -138
  117. package/lib/composables/Router.ts +0 -20
  118. package/lib/composables/Step.ts +0 -7
  119. package/lib/composables/Store.ts +0 -9
  120. package/lib/composables/Tag.ts +0 -32
  121. package/lib/composables/Tooltip.ts +0 -91
  122. package/lib/composables/Utils.ts +0 -115
  123. package/lib/composables/markdown/LinkPlugin.ts +0 -45
  124. package/lib/compositions/useForm.ts +0 -17
  125. package/lib/compositions/useResizeObserver.ts +0 -25
  126. package/lib/compositions/useTime.ts +0 -26
  127. package/lib/store/alert/index.ts +0 -32
  128. package/lib/store/screen/index.ts +0 -46
  129. package/lib/types/v-calendar.d.ts +0 -5
  130. package/lib/validation/Validation.ts +0 -151
  131. package/lib/validation/rules/day.ts +0 -11
  132. package/lib/validation/rules/email.ts +0 -11
  133. package/lib/validation/rules/every.ts +0 -38
  134. package/lib/validation/rules/include.ts +0 -11
  135. package/lib/validation/rules/includeSome.ts +0 -11
  136. package/lib/validation/rules/integer.ts +0 -11
  137. package/lib/validation/rules/maxValue.ts +0 -11
  138. package/lib/validation/rules/minValue.ts +0 -11
  139. package/lib/validation/rules/month.ts +0 -11
  140. package/lib/validation/rules/not.ts +0 -10
  141. package/lib/validation/rules/regex.ts +0 -11
  142. package/lib/validation/rules/requiredHMS.ts +0 -11
  143. package/lib/validation/rules/requiredMonthDate.ts +0 -11
  144. package/lib/validation/rules/requiredYearMonth.ts +0 -11
  145. package/lib/validation/rules/requiredYearMonthDate.ts +0 -11
  146. package/lib/validation/rules/rule.ts +0 -5
  147. package/lib/validation/rules/sameAs.ts +0 -11
  148. package/lib/validation/rules/url.ts +0 -11
  149. package/lib/validation/rules/validateIf.ts +0 -27
  150. package/lib/validation/rules/year.ts +0 -11
  151. package/lib/validation/rules/yearMonth.ts +0 -11
  152. package/lib/validation/rules/yearMonthDate.ts +0 -11
  153. package/lib/validation/validators/day.ts +0 -29
  154. package/lib/validation/validators/email.ts +0 -5
  155. package/lib/validation/validators/include.ts +0 -5
  156. package/lib/validation/validators/includeSome.ts +0 -5
  157. package/lib/validation/validators/index.ts +0 -51
  158. package/lib/validation/validators/integer.ts +0 -6
  159. package/lib/validation/validators/maxLength.ts +0 -3
  160. package/lib/validation/validators/maxValue.ts +0 -3
  161. package/lib/validation/validators/minValue.ts +0 -3
  162. package/lib/validation/validators/month.ts +0 -3
  163. package/lib/validation/validators/monthDate.ts +0 -20
  164. package/lib/validation/validators/regex.ts +0 -3
  165. package/lib/validation/validators/required.ts +0 -27
  166. package/lib/validation/validators/requiredHMS.ts +0 -17
  167. package/lib/validation/validators/requiredMonthDate.ts +0 -8
  168. package/lib/validation/validators/requiredYearMonth.ts +0 -8
  169. package/lib/validation/validators/requiredYearMonthDate.ts +0 -9
  170. package/lib/validation/validators/sameAs.ts +0 -5
  171. package/lib/validation/validators/url.ts +0 -5
  172. package/lib/validation/validators/year.ts +0 -3
  173. package/lib/validation/validators/yearMonth.ts +0 -20
  174. package/lib/validation/validators/yearMonthDate.ts +0 -21
@@ -1,237 +0,0 @@
1
- <template>
2
- <div class="SGrid">
3
- <div v-if="$slots.header" class="header">
4
- <slot name="header" />
5
- </div>
6
-
7
- <VueSimplebar class="body">
8
- <div v-if="$slots.columns" class="columns">
9
- <div class="columns-row">
10
- <slot name="columns" />
11
- </div>
12
- </div>
13
-
14
- <div v-if="records.length > 0" class="body-records" :class="{ loading }">
15
- <div
16
- v-for="record in records"
17
- :key="record[primaryKey]"
18
- class="row"
19
- :class="{ clickable }"
20
- role="button"
21
- @click="handleClick(record)"
22
- >
23
- <slot :record="record" />
24
-
25
- <div v-if="actions" class="actions">
26
- <component
27
- :is="actionComponent"
28
- :action="actions"
29
- :actions="actions"
30
- />
31
- </div>
32
- </div>
33
- </div>
34
-
35
- <div v-else class="body-empty">
36
- <slot name="empty" />
37
- </div>
38
- </VueSimplebar>
39
-
40
- <div v-if="$slots.footer" class="footer">
41
- <slot name="footer" />
42
- </div>
43
-
44
- <transition name="fade">
45
- <div v-if="loading" class="body-loading">
46
- <SIconPreloaderDark class="body-loading-icon" />
47
- </div>
48
- </transition>
49
- </div>
50
- </template>
51
-
52
- <script lang="ts">
53
- import { defineComponent, computed } from '@vue/composition-api'
54
- import VueSimplebar from 'simplebar-vue'
55
- import { isArray } from '../support/Util'
56
- import SIconPreloaderDark from './icons/SIconPreloaderDark.vue'
57
- import SGridActionLink from './SGridActionLink.vue'
58
- import SGridActionSingle from './SGridActionSingle.vue'
59
- import SGridActionMulti from './SGridActionMulti.vue'
60
-
61
- export default defineComponent({
62
- components: {
63
- VueSimplebar,
64
- SIconPreloaderDark
65
- },
66
-
67
- props: {
68
- primaryKey: { type: String, default: 'id' },
69
- records: { type: Array, required: true },
70
- actions: { type: [String, Object, Array], default: null },
71
- clickable: { type: Boolean, default: true },
72
- loading: { type: Boolean, default: false }
73
- },
74
-
75
- setup(props, { emit }) {
76
- const actionComponent = computed(() => {
77
- if (typeof props.actions === 'string') {
78
- return SGridActionLink
79
- }
80
-
81
- if (isArray(props.actions)) {
82
- return SGridActionMulti
83
- }
84
-
85
- return SGridActionSingle
86
- })
87
-
88
- function handleClick(record: object): void {
89
- props.clickable && emit('click', record)
90
- }
91
-
92
- return {
93
- actionComponent,
94
- handleClick
95
- }
96
- }
97
- })
98
- </script>
99
-
100
- <style lang="postcss" scoped>
101
- @import "@/assets/styles/variables";
102
-
103
- .SGrid {
104
- border-radius: 8px;
105
- background-color: var(--c-bg);
106
- box-shadow: var(--shadow-depth-1);
107
- }
108
-
109
- .columns {
110
- display: inline-flex;
111
- }
112
-
113
- .columns-row {
114
- display: inline-flex;
115
- padding: 0 12px;
116
-
117
- & >>> .cell {
118
- flex-grow: 1;
119
- flex-shrink: 0;
120
- padding: 16px 12px 12px;
121
- font-size: 12px;
122
- font-weight: 700;
123
- color: var(--c-text-light-2);
124
- }
125
- }
126
-
127
- .body {
128
- position: relative;
129
- overflow: hidden;
130
- overflow-x: auto;
131
- }
132
-
133
- .body-records {
134
- display: inline-flex;
135
- flex-direction: column;
136
- border-top: 1px solid var(--c-divider-lighter);
137
- min-width: 100%;
138
-
139
- & >>> .row {
140
- display: flex;
141
- border-top: 1px solid var(--c-divider-lighter);
142
- padding: 22px 12px 21px;
143
- transition: background-color .25s;
144
- cursor: default;
145
-
146
- &:first-child {
147
- border-top: 0;
148
- }
149
-
150
- &:hover {
151
- background-color: var(--c-white-soft);
152
- }
153
-
154
- &.clickable {
155
- cursor: pointer;
156
- }
157
- }
158
-
159
- & >>> .cell {
160
- flex-shrink: 0;
161
- margin: 0;
162
- padding: 0 12px;
163
- line-height: 20px;
164
- font-size: 14px;
165
- color: var(--c-text-light-1);
166
- white-space: nowrap;
167
- overflow: hidden;
168
- text-overflow: ellipsis;
169
-
170
- a {
171
- color: var(--c-info-light);
172
- transition: color .25s;
173
-
174
- &:hover {
175
- color: var(--c-info-dark);
176
- }
177
- }
178
- }
179
-
180
- & >>> .cell-main {
181
- margin: 0;
182
- width: 100%;
183
- white-space: nowrap;
184
- overflow: hidden;
185
- text-overflow: ellipsis;
186
- }
187
-
188
- & >>> .cell-sub {
189
- margin: 0;
190
- width: 100%;
191
- font-size: 12px;
192
- font-weight: 500;
193
- color: var(--c-text-light-2);
194
- white-space: nowrap;
195
- overflow: hidden;
196
- text-overflow: ellipsis;
197
- }
198
-
199
- & >>> .actions {
200
- flex-grow: 1;
201
- height: 100%;
202
- }
203
- }
204
-
205
- .body-empty {
206
- border-top: 1px solid var(--c-divider-lighter);
207
- min-width: 100%;
208
- }
209
-
210
- .footer {
211
- border-top: 1px solid var(--c-divider);
212
- }
213
-
214
- .body-loading {
215
- position: absolute;
216
- top: 0;
217
- right: 0;
218
- bottom: 0;
219
- left: 0;
220
- background-color: var(--c-bg);
221
- transition: opacity .25s, transform .25s;
222
- }
223
-
224
- .body-loading.fade-enter,
225
- .body-loading.fade-leave-to {
226
- opacity: 0;
227
- }
228
-
229
- .body-loading-icon {
230
- position: absolute;
231
- top: 24px;
232
- left: 50%;
233
- width: 48px;
234
- height: 48px;
235
- transform: translateX(-50%);
236
- }
237
- </style>
@@ -1,53 +0,0 @@
1
- <template>
2
- <div class="SGridActionLink">
3
- <div class="icon">
4
- <SIconChevronRight class="icon-svg" />
5
- </div>
6
- </div>
7
- </template>
8
-
9
- <script lang="ts">
10
- import { defineComponent } from '@vue/composition-api'
11
- import SIconChevronRight from './icons/SIconChevronRight.vue'
12
-
13
- export default defineComponent({
14
- components: {
15
- SIconChevronRight
16
- }
17
- })
18
- </script>
19
-
20
- <style lang="postcss" scoped>
21
- @import "@/assets/styles/variables";
22
-
23
- .SGridActionLink {
24
- display: flex;
25
- justify-content: flex-end;
26
- padding-right: 8px;
27
- }
28
-
29
- .icon {
30
- display: flex;
31
- justify-content: center;
32
- align-items: center;
33
- width: 20px;
34
- height: 20px;
35
- transition: transform .25s;
36
- }
37
-
38
- .SGrid .row:hover .icon {
39
- transform: translateX(4px);
40
-
41
- .icon-svg {
42
- fill: var(--c-gray);
43
- }
44
- }
45
-
46
- .icon-svg {
47
- display: block;
48
- width: 16px;
49
- height: 16px;
50
- fill: var(--c-gray-light-1);
51
- transition: fill .25s;
52
- }
53
- </style>
@@ -1,139 +0,0 @@
1
- <template>
2
- <div class="SGridActionMulti">
3
- <div class="menu">
4
- <SIconMoreHorizontal class="menu-icon" />
5
- </div>
6
-
7
- <div class="actions">
8
- <STooltip
9
- v-for="(action, index) in actions"
10
- :key="index"
11
- class="action"
12
- :style="actionStyles(index)"
13
- :text="action.name"
14
- position="top"
15
- >
16
- <div class="action-content">
17
- <component :is="action.icon" class="action-icon" />
18
- </div>
19
- </STooltip>
20
- </div>
21
- </div>
22
- </template>
23
-
24
- <script lang="ts">
25
- import { defineComponent } from '@vue/composition-api'
26
- import SIconMoreHorizontal from './icons/SIconMoreHorizontal.vue'
27
- import STooltip from './STooltip.vue'
28
-
29
- export default defineComponent({
30
- components: {
31
- SIconMoreHorizontal,
32
- STooltip
33
- },
34
-
35
- props: {
36
- actions: { type: Array, required: true }
37
- },
38
-
39
- setup(props) {
40
- function actionStyles(index: number): Partial<CSSStyleDeclaration> {
41
- const size = props.actions.length
42
- const sec = (size - (index + 1)) * 0.1
43
-
44
- return {
45
- transition: `background-color .25s, opacity .25s ${sec}s, transform .25s ${sec}s`
46
- }
47
- }
48
-
49
- return {
50
- actionStyles
51
- }
52
- }
53
- })
54
- </script>
55
-
56
- <style lang="postcss" scoped>
57
- @import "@/assets/styles/variables";
58
-
59
- .SGridActionMulti {
60
- position: relative;
61
- display: flex;
62
- justify-content: flex-end;
63
- margin: -6px 0;
64
- padding-right: 8px;
65
- }
66
-
67
- .SGrid .row:hover {
68
- .menu {
69
- opacity: 0;
70
- }
71
-
72
- .action {
73
- opacity: 1;
74
- transform: translateY(0);
75
- }
76
- }
77
-
78
- .menu {
79
- display: flex;
80
- justify-content: center;
81
- align-items: center;
82
- border-radius: 50%;
83
- width: 32px;
84
- height: 32px;
85
- transition: opacity .25s;
86
- }
87
-
88
- .menu-icon {
89
- display: block;
90
- width: 12px;
91
- height: 12px;
92
- fill: var(--c-gray);
93
- transition: fill .25s;
94
- }
95
-
96
- .actions {
97
- position: absolute;
98
- top: 0;
99
- right: 8px;
100
- display: flex;
101
- }
102
-
103
- .action {
104
- border-radius: 50%;
105
- opacity: 0;
106
- transform: translateY(-8px);
107
-
108
- & + & {
109
- margin-left: 4px;
110
- }
111
-
112
- &:hover {
113
- background-color: var(--c-gray-light-3);
114
-
115
- .action-icon {
116
- fill: var(--c-black);
117
- }
118
- }
119
-
120
- &:active {
121
- background-color: var(--c-gray-light-2);
122
- }
123
- }
124
-
125
- .action-content {
126
- display: flex;
127
- justify-content: center;
128
- align-items: center;
129
- width: 32px;
130
- height: 32px;
131
- }
132
-
133
- .action-icon {
134
- width: 14px;
135
- height: 14px;
136
- fill: var(--c-gray);
137
- transition: fill .25s;
138
- }
139
- </style>
@@ -1,64 +0,0 @@
1
- <template>
2
- <div class="SGridActionSingle">
3
- <button class="icon" @click.stop="action.callback">
4
- <component :is="action.icon" class="icon-svg" />
5
- </button>
6
- </div>
7
- </template>
8
-
9
- <script lang="ts">
10
- import { defineComponent } from '@vue/composition-api'
11
-
12
- export default defineComponent({
13
- props: {
14
- action: { type: Object, required: true }
15
- }
16
- })
17
- </script>
18
-
19
- <style lang="postcss" scoped>
20
- @import "@/assets/styles/variables";
21
-
22
- .SGridActionSingle {
23
- display: flex;
24
- justify-content: flex-end;
25
- margin: -6px 0;
26
- padding-right: 8px;
27
- }
28
-
29
- .icon {
30
- display: flex;
31
- justify-content: center;
32
- align-items: center;
33
- border-radius: 50%;
34
- width: 32px;
35
- height: 32px;
36
- transition: background-color .25s;
37
- }
38
-
39
- .SGrid .row:hover .icon {
40
- .icon-svg {
41
- fill: var(--c-gray);
42
- }
43
-
44
- &:hover {
45
- background-color: var(--c-gray-light-3);
46
- }
47
-
48
- &:hover .icon-svg {
49
- fill: var(--c-black);
50
- }
51
-
52
- &:active {
53
- background-color: var(--c-gray-light-2);
54
- }
55
- }
56
-
57
- .icon-svg {
58
- display: block;
59
- width: 12px;
60
- height: 12px;
61
- fill: var(--c-gray-light-1);
62
- transition: fill .25s;
63
- }
64
- </style>
@@ -1,180 +0,0 @@
1
- <template>
2
- <div class="SHeader" :class="[size, mode]">
3
- <div class="main">
4
- <div class="primary">
5
- <component :is="icon" v-if="icon" class="SHeader-icon" />
6
- <p v-if="title" class="title">{{ title }}</p>
7
- <slot />
8
- </div>
9
-
10
- <div class="actions">
11
- <div
12
- v-for="(action, index) in cActions"
13
- :key="index"
14
- class="action"
15
- :class="[`gap-${action.gap}`]"
16
- >
17
- <SAction :action="action" />
18
- </div>
19
-
20
- <slot name="after-actions" />
21
- </div>
22
- </div>
23
-
24
- <div v-if="cTags.length > 0" class="sub">
25
- <div class="tags">
26
- <div v-for="(tag, index) in cTags" :key="index" class="tag">
27
- <STag v-bind="tag" />
28
- </div>
29
- </div>
30
- </div>
31
- </div>
32
- </template>
33
-
34
- <script lang="ts">
35
- import { PropType, defineComponent, computed } from '@vue/composition-api'
36
- import { Size, Mode, Search, Action, Tag } from '../composables/Header'
37
- import SAction from './SAction.vue'
38
- import STag from './STag.vue'
39
-
40
- export default defineComponent({
41
- components: {
42
- SAction,
43
- STag
44
- },
45
-
46
- props: {
47
- size: { type: String as PropType<Size>, default: 'medium' },
48
- mode: { type: String as PropType<Mode>, default: 'neutral' },
49
- icon: { type: Object, default: null },
50
- title: { type: String, default: null },
51
- search: { type: Object as PropType<Search>, default: null },
52
- actions: { type: Array as PropType<Action[]>, default: () => [] },
53
- tags: { type: Array as PropType<Tag[]>, default: () => [] }
54
- },
55
-
56
- setup(props) {
57
- const cActions = computed(() => {
58
- return props.actions.map(action => ({
59
- size: 'small',
60
- ...action
61
- }))
62
- })
63
-
64
- const cTags = computed(() => {
65
- return props.tags.map(tag => ({
66
- size: 'small',
67
- ...tag
68
- }))
69
- })
70
-
71
- return {
72
- cActions,
73
- cTags
74
- }
75
- }
76
- })
77
- </script>
78
-
79
- <style lang="postcss" scoped>
80
- @import "@/assets/styles/variables";
81
-
82
- .SHeader {
83
- flex-shrink: 0;
84
- }
85
-
86
- .SHeader.small {
87
- .SHeader-icon {
88
- margin-right: 8px;
89
- width: 16px;
90
- height: 16px;
91
- }
92
-
93
- .title {
94
- line-height: 32px;
95
- font-size: 14px;
96
- }
97
-
98
- .tags { margin: 0 -8px; }
99
- .tag { padding: 0 8px; }
100
- }
101
-
102
- .SHeader.medium {
103
- .SHeader-icon {
104
- margin-right: 8px;
105
- width: 16px;
106
- height: 16px;
107
- }
108
-
109
- .title {
110
- line-height: 32px;
111
- font-size: 16px;
112
- }
113
-
114
- .tags { margin: 0 -8px; }
115
- .tag { padding: 0 8px; }
116
- }
117
-
118
- .SHeader.large {
119
- .SHeader-icon {
120
- margin-right: 8px;
121
- width: 16px;
122
- height: 16px;
123
- }
124
-
125
- .title {
126
- line-height: 32px;
127
- font-size: 20px;
128
- }
129
-
130
- .tags { margin: 0 -8px; }
131
- .tag { padding: 0 8px; }
132
- }
133
-
134
- .SHeader.neutral .title { color: var(--c-text-1); }
135
- .SHeader.info .title { color: var(--c-text-1); }
136
- .SHeader.success .title { color: var(--c-text-1); }
137
- .SHeader.warning .title { color: var(--c-text-1); }
138
- .SHeader.danger .title { color: var(--c-danger); }
139
-
140
- .SHeader.neutral .SHeader-icon { fill: var(--c-text-1); }
141
- .SHeader.info .SHeader-icon { fill: var(--c-info); }
142
- .SHeader.success .SHeader-icon { fill: var(--c-success); }
143
- .SHeader.warning .SHeader-icon { fill: var(--c-warning); }
144
- .SHeader.danger .SHeader-icon { fill: var(--c-danger); }
145
-
146
- .main {
147
- display: flex;
148
- }
149
-
150
- .primary {
151
- display: flex;
152
- align-items: center;
153
- flex-grow: 1;
154
- }
155
-
156
- .title {
157
- font-weight: 500;
158
- }
159
-
160
- .actions {
161
- display: flex;
162
- align-items: center;
163
- }
164
-
165
- .action { padding-left: 8px; }
166
- .action.gap-4 { padding-left: 4px; }
167
- .action.gap-8 { padding-left: 8px; }
168
- .action.gap-12 { padding-left: 12px; }
169
- .action.gap-16 { padding-left: 16px; }
170
- .action.gap-24 { padding-left: 24px; }
171
- .action.gap-32 { padding-left: 32px; }
172
-
173
- .sub {
174
- padding-top: 2px;
175
- }
176
-
177
- .tags {
178
- display: flex;
179
- }
180
- </style>