@globalbrain/sefirot 0.70.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 -800
  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 +19 -35
  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 +23 -33
  24. package/lib/components/SInputRadios.vue +37 -47
  25. package/lib/components/SInputText.vue +59 -632
  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 +1 -3
  38. package/lib/components/SSheetMedium.vue +13 -25
  39. package/lib/components/SSnackbar.vue +18 -28
  40. package/lib/components/icons/SIconSend.vue +5 -0
  41. package/lib/composables/Dialog.ts +9 -17
  42. package/lib/composables/Dropdown.ts +1 -1
  43. package/lib/composables/{Menu.ts → Flyout.ts} +11 -4
  44. package/lib/composables/Form.ts +42 -44
  45. package/lib/composables/Modal.ts +9 -9
  46. package/lib/composables/Snackbar.ts +18 -0
  47. package/lib/composables/Validation.ts +28 -0
  48. package/lib/mixins/Sheet.ts +3 -3
  49. package/lib/store/Sefirot.ts +8 -13
  50. package/lib/store/dialog/index.ts +20 -10
  51. package/lib/store/modal/index.ts +11 -13
  52. package/lib/store/snackbars/index.ts +3 -4
  53. package/lib/support/{Util.ts → Utils.ts} +0 -2
  54. package/lib/types/Utils.ts +0 -7
  55. package/lib/types/vue-shims.d.ts +7 -0
  56. package/lib/validation/rules/checked.ts +6 -10
  57. package/lib/validation/rules/fileExtension.ts +9 -9
  58. package/lib/validation/rules/hms.ts +9 -9
  59. package/lib/validation/rules/index.ts +10 -74
  60. package/lib/validation/rules/maxLength.ts +10 -9
  61. package/lib/validation/rules/minLength.ts +12 -0
  62. package/lib/validation/rules/required.ts +2 -10
  63. package/lib/validation/rules/requiredHms.ts +11 -0
  64. package/lib/validation/rules/requiredIf.ts +3 -11
  65. package/lib/validation/rules/requiredYmd.ts +11 -0
  66. package/lib/validation/rules/ymd.ts +11 -0
  67. package/lib/validation/validators/checked.ts +1 -1
  68. package/lib/validation/validators/fileExtension.ts +1 -1
  69. package/lib/validation/validators/hms.ts +5 -5
  70. package/lib/validation/validators/requiredHms.ts +17 -0
  71. package/lib/validation/validators/requiredYmd.ts +7 -0
  72. package/lib/validation/validators/ymd.ts +41 -0
  73. package/package.json +45 -50
  74. package/lib/components/SAction.vue +0 -37
  75. package/lib/components/SActionAvatar.vue +0 -25
  76. package/lib/components/SActionButton.vue +0 -40
  77. package/lib/components/SActionPill.vue +0 -35
  78. package/lib/components/SActionSwitch.vue +0 -37
  79. package/lib/components/SAlert.vue +0 -145
  80. package/lib/components/SButtonGroup.vue +0 -160
  81. package/lib/components/SCard.vue +0 -111
  82. package/lib/components/SCardFooter.vue +0 -74
  83. package/lib/components/SCardHeader.vue +0 -213
  84. package/lib/components/SGrid.vue +0 -237
  85. package/lib/components/SGridActionLink.vue +0 -53
  86. package/lib/components/SGridActionMulti.vue +0 -139
  87. package/lib/components/SGridActionSingle.vue +0 -64
  88. package/lib/components/SHeader.vue +0 -180
  89. package/lib/components/SInputCheckboxes.vue +0 -83
  90. package/lib/components/SInputDate.vue +0 -192
  91. package/lib/components/SInputDay.vue +0 -87
  92. package/lib/components/SInputMonth.vue +0 -86
  93. package/lib/components/SInputSelect.vue +0 -282
  94. package/lib/components/SInputSwitch.vue +0 -212
  95. package/lib/components/SInputSwitches.vue +0 -108
  96. package/lib/components/SInputTime.vue +0 -255
  97. package/lib/components/SInputYear.vue +0 -60
  98. package/lib/components/SMarkdown.vue +0 -56
  99. package/lib/components/SPlaceholderBlank.vue +0 -113
  100. package/lib/components/SPlaceholderImage.vue +0 -83
  101. package/lib/components/SPortalScreens.vue +0 -62
  102. package/lib/components/SProgressBar.vue +0 -89
  103. package/lib/components/SResponsive.vue +0 -46
  104. package/lib/components/SScreen.vue +0 -81
  105. package/lib/components/SStep.vue +0 -107
  106. package/lib/components/SSteps.vue +0 -75
  107. package/lib/components/STag.vue +0 -67
  108. package/lib/components/STooltip.vue +0 -134
  109. package/lib/components/SWindow.vue +0 -158
  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,46 +0,0 @@
1
- <template>
2
- <div ref="target" class="SResponsive" :class="el.classes">
3
- <slot :el="el" />
4
- </div>
5
- </template>
6
-
7
- <script lang="ts">
8
- import { defineComponent, ref, reactive, computed, PropType } from '@vue/composition-api'
9
- import useResizeObserver, { EL as BaseEL } from '../compositions/useResizeObserver'
10
-
11
- export interface EL extends BaseEL {
12
- is: Record<string, boolean>
13
- }
14
-
15
- export interface BP {
16
- [name: string]: (el: EL) => boolean
17
- }
18
-
19
- export default defineComponent({
20
- props: {
21
- bp: { type: Object as PropType<BP>, default: () => ({}) }
22
- },
23
-
24
- setup(props) {
25
- const target = ref<HTMLElement | null>(null)
26
-
27
- const { el: baseEl } = useResizeObserver(target)
28
-
29
- const el = reactive({
30
- ...baseEl,
31
- is: computed(() => {
32
- const classes: Record<string, boolean> = {}
33
- for (const name in props.bp) {
34
- classes[name] = props.bp[name](el)
35
- }
36
- return classes
37
- })
38
- })
39
-
40
- return {
41
- target,
42
- el
43
- }
44
- }
45
- })
46
- </script>
@@ -1,81 +0,0 @@
1
- <template>
2
- <portal to="screen">
3
- <transition name="screen">
4
- <VueSimplebar v-if="show" :key="screenName" class="SScreen">
5
- <div v-if="title" class="header">
6
- <p class="header-title">{{ title }}</p>
7
- </div>
8
-
9
- <div class="content">
10
- <slot />
11
- </div>
12
- </VueSimplebar>
13
- </transition>
14
- </portal>
15
- </template>
16
-
17
- <script lang="ts">
18
- import { computed, defineComponent } from '@vue/composition-api'
19
- import VueSimplebar from 'simplebar-vue'
20
- import { useStore } from '../composables/Store'
21
-
22
- export default defineComponent({
23
- components: {
24
- VueSimplebar
25
- },
26
-
27
- props: {
28
- name: { type: String, required: true },
29
- title: { type: String, default: null }
30
- },
31
-
32
- setup(props) {
33
- const store = useStore()
34
-
35
- const screenName = computed(() => store.state.screen.name)
36
- const show = computed(() => props.name === screenName.value)
37
-
38
- return {
39
- screenName,
40
- show
41
- }
42
- }
43
- })
44
- </script>
45
-
46
- <style lang="postcss" scoped>
47
- @import "@/assets/styles/variables";
48
-
49
- .SScreen {
50
- position: fixed;
51
- top: 0;
52
- right: 0;
53
- bottom: 0;
54
- left: 0;
55
- z-index: var(--z-index-screen);
56
- width: 100%;
57
- height: 100%;
58
- background-color: rgba(255, 255, 255, .5);
59
- transition: opacity .25s;
60
- }
61
-
62
- .SScreen.screen-enter,
63
- .SScreen.screen-leave-to {
64
- opacity: 0;
65
-
66
- .header {
67
- opacity: 0;
68
- transform: translateY(8px);
69
- }
70
- }
71
-
72
- .header {
73
- padding: 64px 64px 0;
74
- transition: opacity .25s, transform .25s;
75
- }
76
-
77
- .header-title {
78
- text-align: center;
79
- font-size: 20px;
80
- }
81
- </style>
@@ -1,107 +0,0 @@
1
- <template>
2
- <div class="SStep" :class="[status]">
3
- <div class="indicator">
4
- <div class="bar" :class="[barLeft]" />
5
- <div class="point">
6
- <div v-if="status === 'active'" class="inner-dot" />
7
- <SIconCheck v-else-if="status === 'done'" class="icon" />
8
- <SIconX v-else-if="status === 'failed'" class="icon" />
9
- </div>
10
- <div class="bar" :class="[barRight]" />
11
- </div>
12
-
13
- <p v-if="text" class="text">{{ text }}</p>
14
- </div>
15
- </template>
16
-
17
- <script lang="ts">
18
- import { PropType, defineComponent } from '@vue/composition-api'
19
- import { StepStatus, BarMode } from '../composables/Step'
20
- import SIconCheck from './icons/SIconCheck.vue'
21
- import SIconX from './icons/SIconX.vue'
22
-
23
- export default defineComponent({
24
- components: {
25
- SIconCheck,
26
- SIconX
27
- },
28
-
29
- props: {
30
- status: { type: String as PropType<StepStatus>, required: true },
31
- barLeft: { type: String as PropType<BarMode>, default: null },
32
- barRight: { type: String as PropType<BarMode>, default: null },
33
- text: { type: String, default: null }
34
- }
35
- })
36
- </script>
37
-
38
- <style lang="postcss" scoped>
39
- @import "@/assets/styles/variables";
40
-
41
- .SStep.upcoming {
42
- .point { border-color: var(--c-divider); }
43
- .text { color: var(--c-text-2); }
44
- }
45
-
46
- .SStep.active {
47
- .point { border-color: var(--c-success); }
48
- .text { color: var(--c-success); }
49
- }
50
-
51
- .SStep.done {
52
- .point { border-color: var(--c-success); background-color: var(--c-success); }
53
- .text { color: var(--c-text-1); }
54
- }
55
-
56
- .SStep.failed {
57
- .point { border-color: var(--c-danger); background-color: var(--c-danger); }
58
- .text { color: var(--c-danger); }
59
- }
60
-
61
- .indicator {
62
- display: flex;
63
- align-items: center;
64
- width: 100%;
65
- }
66
-
67
- .point {
68
- display: flex;
69
- justify-content: center;
70
- align-items: center;
71
- border: 1px solid transparent;
72
- border-radius: 50%;
73
- width: 16px;
74
- height: 16px;
75
- }
76
-
77
- .inner-dot {
78
- border-radius: 50%;
79
- width: 6px;
80
- height: 6px;
81
- background-color: var(--c-success);
82
- }
83
-
84
- .icon {
85
- width: 10px;
86
- height: 10px;
87
- fill: var(--c-white);
88
- }
89
-
90
- .bar {
91
- width: calc(50% - 8px);
92
- height: 2px;
93
- }
94
-
95
- .bar.mute { background-color: var(--c-divider-light); }
96
- .bar.active { background-color: var(--c-success); }
97
- .bar.failed { background-color: var(--c-danger); }
98
-
99
- .text {
100
- margin: 0;
101
- padding: 8px 8px 0;
102
- text-align: center;
103
- line-height: 16px;
104
- font-size: 12px;
105
- font-weight: 500;
106
- }
107
- </style>
@@ -1,75 +0,0 @@
1
- <template>
2
- <div class="SSteps">
3
- <SStep
4
- v-for="(step, index) in steps"
5
- :key="index"
6
- class="item"
7
- :style="{ width }"
8
- :bar-left="getBarLeftMode(index)"
9
- :bar-right="getBarRightMode(index)"
10
- v-bind="step"
11
- />
12
- </div>
13
- </template>
14
-
15
- <script lang="ts">
16
- import { PropType, defineComponent, computed } from '@vue/composition-api'
17
- import { Step, BarMode } from '../composables/Step'
18
- import SStep from './SStep.vue'
19
-
20
- export default defineComponent({
21
- components: {
22
- SStep
23
- },
24
-
25
- props: {
26
- steps: { type: Array as PropType<Step[]>, required: true }
27
- },
28
-
29
- setup(props) {
30
- const width = computed(() => {
31
- return `calc(100% / ${props.steps.length})`
32
- })
33
-
34
- function getBarLeftMode(index: number): BarMode | null {
35
- if (index === 0) {
36
- return null
37
- }
38
-
39
- const current = props.steps[index]
40
- const prev = props.steps[index - 1]
41
-
42
- return isActive(prev) && isActive(current) ? 'active' : 'mute'
43
- }
44
-
45
- function getBarRightMode(index: number): BarMode | null {
46
- if (index === props.steps.length - 1) {
47
- return null
48
- }
49
-
50
- const current = props.steps[index]
51
- const next = props.steps[index + 1]
52
-
53
- return isActive(current) && isActive(next) ? 'active' : 'mute'
54
- }
55
-
56
- function isActive(step: Step): boolean {
57
- return step.status === 'active' || step.status === 'done'
58
- }
59
-
60
- return {
61
- width,
62
- getBarLeftMode,
63
- getBarRightMode
64
- }
65
- }
66
- })
67
- </script>
68
-
69
- <style lang="postcss" scoped>
70
- @import "@/assets/styles/variables";
71
-
72
- .SSteps {
73
- display: flex;
74
- }
75
- </style>
@@ -1,67 +0,0 @@
1
- <template>
2
- <div class="STag" :class="[size, mode]">
3
- <SLink class="text" :href="link">
4
- <component :is="icon" class="icon" /> {{ text }}
5
- </SLink>
6
- </div>
7
- </template>
8
-
9
- <script lang="ts">
10
- import { PropType, defineComponent } from '@vue/composition-api'
11
- import { Size, Mode } from '../composables/Tag'
12
- import SLink from './SLink.vue'
13
-
14
- export default defineComponent({
15
- components: {
16
- SLink
17
- },
18
-
19
- props: {
20
- size: { type: String as PropType<Size>, default: 'small' },
21
- mode: { type: String as PropType<Mode>, default: 'neutral' },
22
- icon: { type: Object, default: null },
23
- text: { type: String, default: null },
24
- link: { type: String, default: null }
25
- }
26
- })
27
- </script>
28
-
29
- <style lang="postcss" scoped>
30
- @import "@/assets/styles/variables";
31
-
32
- .STag.small {
33
- .text {
34
- line-height: 20px;
35
- font-size: 12px;
36
- font-weight: 500;
37
- }
38
-
39
- .icon {
40
- margin-right: 6px;
41
- width: 12px;
42
- height: 12px;
43
- }
44
- }
45
-
46
- .STag.info .text { color: var(--c-info); }
47
- .STag.success .text { color: var(--c-success); }
48
- .STag.warning .text { color: var(--c-warning); }
49
- .STag.danger .text { color: var(--c-danger); }
50
- .STag.mute .text { color: var(--c-text-2); }
51
-
52
- .STag.info .text.link:hover { color: var(--c-info-dark); }
53
- .STag.success .text.link:hover { color: var(--c-success-dark); }
54
- .STag.warning .text.link:hover { color: var(--c-warning-dark); }
55
- .STag.danger .text.link:hover { color: var(--c-danger-dark); }
56
- .STag.mute .text.link:hover { color: var(--c-info); }
57
-
58
- .text {
59
- display: flex;
60
- align-items: center;
61
- transition: color .25s;
62
- }
63
-
64
- .icon {
65
- fill: currentColor;
66
- }
67
- </style>
@@ -1,134 +0,0 @@
1
- <template>
2
- <component :is="tag" class="STooltip" @mouseenter="show" @mouseleave="hide">
3
- <template v-if="text">
4
- <span ref="content" class="STooltip-content">
5
- <slot />
6
- </span>
7
-
8
- <transition name="fade">
9
- <span v-show="on" ref="tip" class="STooltip-container" :class="classes">
10
- <SMarkdown class="STooltip-tip" :content="text" inline />
11
- </span>
12
- </transition>
13
- </template>
14
-
15
- <template v-else>
16
- <span class="STooltip-content">
17
- <slot />
18
- </span>
19
- </template>
20
- </component>
21
- </template>
22
-
23
- <script lang="ts">
24
- import { PropType, defineComponent, ref, computed } from '@vue/composition-api'
25
- import { Position, useTooltip } from '../composables/Tooltip'
26
- import SMarkdown from './SMarkdown.vue'
27
-
28
- export default defineComponent({
29
- components: {
30
- SMarkdown
31
- },
32
-
33
- props: {
34
- tag: { type: String, default: 'span' },
35
- text: { type: String, default: null },
36
- position: { type: String as PropType<Position>, default: 'top' }
37
- },
38
-
39
- setup(props) {
40
- const tip = ref<HTMLElement | null>(null)
41
- const content = ref<HTMLElement | null>(null)
42
-
43
- const classes = computed(() => [props.position])
44
-
45
- const { on, show, hide } = useTooltip(content, tip, props.position)
46
-
47
- return {
48
- tip,
49
- content,
50
- classes,
51
- on,
52
- show,
53
- hide
54
- }
55
- }
56
- })
57
- </script>
58
-
59
- <style lang="postcss" scoped>
60
- @import "@/assets/styles/variables";
61
-
62
- .STooltip {
63
- position: relative;
64
- }
65
-
66
- .STooltip-container {
67
- position: absolute;
68
- display: block;
69
- transition: opacity .25s;
70
- z-index: var(--z-index-tooltip);
71
- }
72
-
73
- .STooltip-container.fade-enter,
74
- .STooltip-container.fade-leave-to {
75
- opacity: 0;
76
-
77
- &.top .STooltip-tip { transform: translateY(8px); }
78
- &.right .STooltip-tip { transform: translateX(-8px); }
79
- &.bottom .STooltip-tip { transform: translateY(-8px); }
80
- &.left .STooltip-tip { transform: translateX(8px); }
81
- }
82
-
83
- .STooltip-container.top {
84
- top: 0;
85
- left: 50%;
86
- padding-bottom: 8px;
87
- transform: translate(-50%, -100%);
88
- }
89
-
90
- .STooltip-container.right {
91
- top: 50%;
92
- left: 100%;
93
- transform: translate(8px, -50%);
94
- }
95
-
96
- .STooltip-container.bottom {
97
- bottom: 0;
98
- left: 50%;
99
- padding-top: 8px;
100
- transform: translate(-50%, 100%);
101
- }
102
-
103
- .STooltip-container.left {
104
- top: 50%;
105
- right: 100%;
106
- transform: translate(-8px, -50%);
107
- }
108
-
109
- .STooltip-tip {
110
- display: block;
111
- border-radius: 4px;
112
- padding: 12px;
113
- width: max-content;
114
- max-width: 288px;
115
- line-height: 18px;
116
- font-size: 12px;
117
- font-weight: 500;
118
- color: var(--c-text-dark-1);
119
- background-color: rgba(0, 0, 0, .9);
120
- transition: transform .25s;
121
- }
122
-
123
- .STooltip-tip >>> a {
124
- color: var(--c-info);
125
-
126
- &:hover {
127
- color: var(--c-info-dark);
128
- }
129
- }
130
-
131
- .STooltip-content {
132
- white-space: nowrap;
133
- }
134
- </style>
@@ -1,158 +0,0 @@
1
- <template>
2
- <SModalBase :name="name" :closable="closable" @click.stop>
3
- <div class="SWindow" @click.stop>
4
- <button v-if="closable" class="close" @click="close">
5
- <SIconX class="close-icon" />
6
- </button>
7
-
8
- <div v-if="showHeader" class="header">
9
- <p class="title">{{ title }}</p>
10
- <p v-if="lead" class="lead">{{ lead }}</p>
11
- </div>
12
-
13
- <div class="content">
14
- <slot />
15
- </div>
16
-
17
- <div v-if="actions" class="actions">
18
- <div v-for="(action, index) in actions" :key="index" class="action">
19
- <SButton
20
- :label="action.label"
21
- :type="action.type"
22
- :mode="action.mode"
23
- size="large"
24
- @click="action.callback"
25
- />
26
- </div>
27
- </div>
28
- </div>
29
- </SModalBase>
30
- </template>
31
-
32
- <script lang="ts">
33
- import { PropType, computed, defineComponent } from '@vue/composition-api'
34
- import { ButtonAction } from '../composables/Action'
35
- import { useStore } from '../composables/Store'
36
- import SIconX from './icons/SIconX.vue'
37
- import SButton from './SButton.vue'
38
- import SModalBase from './SModalBase.vue'
39
-
40
- export default defineComponent({
41
- components: {
42
- SIconX,
43
- SButton,
44
- SModalBase
45
- },
46
-
47
- props: {
48
- name: { type: String, required: true },
49
- title: { type: String, default: null },
50
- lead: { type: String, default: null },
51
- actions: { type: Array as PropType<ButtonAction[]>, default: null },
52
- closable: { type: Boolean, default: false }
53
- },
54
-
55
- setup(props) {
56
- const store = useStore()
57
-
58
- const showHeader = computed(() => !!props.title)
59
-
60
- function close(): void {
61
- store.dispatch('window/close')
62
- }
63
-
64
- return {
65
- showHeader,
66
- close
67
- }
68
- }
69
- })
70
- </script>
71
-
72
- <style lang="postcss" scoped>
73
- @import "@/assets/styles/variables";
74
-
75
- .SWindow {
76
- position: relative;
77
- margin: 48px 24px;
78
- border-radius: 2px;
79
- max-width: 768px;
80
- background-color: var(--c-white);
81
- box-shadow: var(--shadow-depth-5);
82
- transition: opacity .25s, transform .25s;
83
- transition-delay: .05s;
84
-
85
- @media (min-width: 768px) {
86
- margin: 96px auto;
87
- }
88
- }
89
-
90
- .close {
91
- position: absolute;
92
- top: 0;
93
- right: 0;
94
- z-index: 10;
95
- display: flex;
96
- justify-content: center;
97
- align-items: center;
98
- width: 64px;
99
- height: 64px;
100
-
101
- &:hover .close-icon {
102
- fill: var(--c-black);
103
- }
104
- }
105
-
106
- .close-icon {
107
- width: 16px;
108
- height: 16px;
109
- fill: var(--c-gray);
110
- transition: fill .25s;
111
- }
112
-
113
- .header {
114
- border-radius: 2px 2px 0 0;
115
- padding: 32px;
116
- background-color: var(--c-white-soft);
117
-
118
- @media (min-width: 768px) {
119
- padding: 48px 64px 40px;
120
- }
121
- }
122
-
123
- .title {
124
- line-height: 32px;
125
- text-align: center;
126
- font-size: 24px;
127
- }
128
-
129
- .lead {
130
- padding-top: 8px;
131
- text-align: center;
132
- color: var(--c-gray);
133
- }
134
-
135
- .content {
136
- padding: 32px;
137
-
138
- @media (min-width: 768px) {
139
- padding: 48px 64px;
140
- }
141
- }
142
-
143
- .actions {
144
- display: flex;
145
- justify-content: center;
146
- padding: 32px;
147
-
148
- @media (min-width: 768px) {
149
- padding: 32px 64px 48px;
150
- }
151
- }
152
-
153
- .action {
154
- & + & {
155
- padding-left: 16px;
156
- }
157
- }
158
- </style>