@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,87 +0,0 @@
1
- <template>
2
- <SInputBase
3
- class="SInputCheckboxes"
4
- :class="[size]"
5
- :name="name"
6
- :label="label"
7
- :note="note"
8
- :help="help"
9
- >
10
- <div class="container">
11
- <div class="row">
12
- <div v-for="option in options" :key="option.value" class="col">
13
- <SInputCheckbox
14
- :text="option.label"
15
- :value="isChecked(option.value)"
16
- @change="handleChange(option.value)"
17
- />
18
- </div>
19
- </div>
20
- </div>
21
- </SInputBase>
22
- </template>
23
-
24
- <script lang="ts">
25
- import { PropType, defineComponent } from '@vue/composition-api'
26
- import SInputBase from './SInputBase.vue'
27
- import SInputCheckbox from './SInputCheckbox.vue'
28
-
29
- type Size = 'mini' | 'small' | 'medium'
30
-
31
- export default defineComponent({
32
- components: {
33
- SInputBase,
34
- SInputCheckbox
35
- },
36
-
37
- model: {
38
- prop: 'value',
39
- event: 'change'
40
- },
41
-
42
- props: {
43
- size: { type: String as PropType<Size>, default: 'small' },
44
- name: { type: String, default: null },
45
- label: { type: String, default: null },
46
- note: { type: String, default: null },
47
- help: { type: String, default: null },
48
- options: { type: Array, required: true },
49
- value: { type: Array, required: true }
50
- },
51
-
52
- setup(props, { emit }) {
53
- function isChecked(value: unknown): boolean {
54
- return props.value.includes(value)
55
- }
56
-
57
- function handleChange(value: unknown): void {
58
- const distinct = props.value
59
- .filter(v => v !== value)
60
- .concat(props.value.includes(value) ? [] : [value])
61
-
62
- emit('change', distinct)
63
- }
64
-
65
- return {
66
- isChecked,
67
- handleChange
68
- }
69
- }
70
- })
71
- </script>
72
-
73
- <style lang="postcss" scoped>
74
- @import "@/assets/styles/variables";
75
-
76
- .container {
77
- display: flex;
78
- }
79
-
80
- .row {
81
- margin: -2px -8px;
82
- }
83
-
84
- .col {
85
- padding: 2px 8px;
86
- }
87
- </style>
@@ -1,192 +0,0 @@
1
- <template>
2
- <SInputBase
3
- class="SInputDate"
4
- :class="classes"
5
- :name="name"
6
- :label="label"
7
- :note="note"
8
- :help="help"
9
- :validation="validation"
10
- >
11
- <div class="container">
12
- <ClientOnly>
13
- <v-date-picker
14
- v-slot="{ inputValue, inputEvents }"
15
- :value="value"
16
- color="blue"
17
- is-dark
18
- :masks="{ input: 'YYYY-MM-DD' }"
19
- :model-config="{ type: 'string', mask: 'YYYY-MM-DD' }"
20
- :popover="{ placement: 'bottom', visibility: 'click' }"
21
- @input="emitInput"
22
- >
23
- <input
24
- :id="name"
25
- class="input"
26
- type="text"
27
- :placeholder="placeholder"
28
- :disabled="disabled"
29
- :value="inputValue"
30
- autocomplete="off"
31
- v-on="inputEvents"
32
- @blur="emitBlur"
33
- >
34
- </v-date-picker>
35
- </ClientOnly>
36
- </div>
37
- </SInputBase>
38
- </template>
39
-
40
- <script lang="ts">
41
- import { PropType, defineComponent, computed } from '@vue/composition-api'
42
- import { SyntheticInputEvent } from '../types/Utils'
43
- import { Validation } from '../validation/Validation'
44
- import SInputBase from './SInputBase.vue'
45
-
46
- type Size = 'medium' | 'mini'
47
- type Mode = 'filled' | 'outlined'
48
-
49
- export default defineComponent({
50
- components: {
51
- SInputBase
52
- },
53
-
54
- props: {
55
- size: { type: String as PropType<Size>, default: 'medium' },
56
- mode: { type: String as PropType<Mode>, default: 'filled' },
57
- name: { type: String, default: null },
58
- label: { type: String, default: null },
59
- note: { type: String, default: null },
60
- help: { type: String, default: null },
61
- placeholder: { type: String, default: 'YYYY-MM-DD' },
62
- disabled: { type: Boolean, default: false },
63
- value: { type: String, default: null },
64
- validation: { type: Object as PropType<Validation>, default: null }
65
- },
66
-
67
- setup(props, { emit }) {
68
- const classes = computed(() => [
69
- props.size,
70
- props.mode,
71
- {
72
- disabled: props.disabled
73
- }
74
- ])
75
-
76
- function emitInput(date: string | null) {
77
- emit('input', date)
78
- }
79
-
80
- function emitBlur(e: SyntheticInputEvent) {
81
- setTimeout(() => {
82
- props.validation && props.validation.$touch()
83
- emit('blur', e.target.value)
84
- }, 100)
85
- }
86
-
87
- return {
88
- classes,
89
- emitInput,
90
- emitBlur
91
- }
92
- }
93
- })
94
- </script>
95
-
96
- <style lang="postcss" scoped>
97
- @import "@/assets/styles/variables";
98
-
99
- .SInputDate.mini {
100
- .input {
101
- padding: 3px 12px;
102
- width: 100%;
103
- line-height: 24px;
104
- font-size: 14px;
105
- }
106
-
107
- .container {
108
- height: 32px;
109
- }
110
- }
111
-
112
- .SInputDate.medium {
113
- .input {
114
- padding: 11px 16px;
115
- width: 100%;
116
- line-height: 24px;
117
- font-size: 16px;
118
- }
119
-
120
- .container {
121
- height: 48px;
122
- }
123
- }
124
-
125
- .SInputDate.has-error {
126
- .input {
127
- border-color: var(--c-danger);
128
-
129
- &:focus {
130
- border-color: var(--c-danger);
131
- }
132
- }
133
- }
134
-
135
- .SInputDate.filled {
136
- .input {
137
- background-color: var(--input-filled-bg);
138
-
139
- &:focus {
140
- border-color: var(--input-focus-border);
141
- background-color: var(--input-focus-bg);
142
- }
143
- }
144
-
145
- &.disabled .input {
146
- background-color: var(--input-filled-bg-disabled);
147
- }
148
- }
149
-
150
- .SInputDate.outlined {
151
- .input {
152
- border-color: var(--input-outlined-border);
153
-
154
- &:focus {
155
- border-color: var(--input-focus-border);
156
- background-color: var(--input-focus-bg);
157
- }
158
- }
159
-
160
- &.disabled .input:hover {
161
- border-color: var(--input-outlined-border);
162
- }
163
-
164
- &.disabled .input {
165
- background-color: var(--input-outlined-bg-disabled);
166
- }
167
- }
168
-
169
- .SInputDate.disabled {
170
- .input:hover {
171
- cursor: not-allowed;
172
- border-color: transparent;
173
- }
174
- }
175
-
176
- .SInputDate >>> .vc-popover-content-wrapper {
177
- z-index: var(--z-index-dropdown);
178
- }
179
-
180
- .input {
181
- display: block;
182
- border: 1px solid transparent;
183
- border-radius: 4px;
184
- width: 100%;
185
- color: var(--input-text);
186
- transition: border-color .25s, background-color .25s;
187
-
188
- &::placeholder {
189
- color: var(--input-placeholder);
190
- }
191
- }
192
- </style>
@@ -1,87 +0,0 @@
1
- <template>
2
- <SInputDropdown
3
- class="SInputday"
4
- :size="size"
5
- :mode="mode"
6
- :name="name"
7
- :label="label"
8
- :note="note"
9
- :placeholder="placeholder"
10
- :help="help"
11
- :search="search"
12
- :nullable="nullable"
13
- :options="options"
14
- :close-on-click="closeOnClick"
15
- :validation="validation"
16
- :value="value"
17
- @change="v => $emit('change', v)"
18
- />
19
- </template>
20
-
21
- <script lang="ts">
22
- import day from 'dayjs'
23
- import { PropType, defineComponent, computed } from '@vue/composition-api'
24
- import { TextItem, useSearch, useTextOption } from '../composables/InputDropdown'
25
- import SInputDropdown from './SInputDropdown.vue'
26
-
27
- type Size = 'mini' | 'medium'
28
- type Mode = 'filled' | 'outlined'
29
-
30
- export default defineComponent({
31
- components: {
32
- SInputDropdown
33
- },
34
-
35
- model: {
36
- prop: 'value',
37
- event: 'change'
38
- },
39
-
40
- props: {
41
- size: { type: String as PropType<Size>, default: 'medium' },
42
- mode: { type: String as PropType<Mode>, default: 'filled' },
43
- name: { type: String, default: null },
44
- label: { type: String, default: null },
45
- note: { type: String, default: null },
46
- help: { type: String, default: null },
47
- placeholder: { type: String, default: null },
48
- nullable: { type: Boolean, default: true },
49
- closeOnClick: { type: Boolean, default: true },
50
- year: { type: Number, default: null },
51
- month: { type: Number, default: null },
52
- validation: { type: Object, default: null },
53
- value: { type: [String, Number, Boolean, Array, Object] as PropType<any>, default: null }
54
- },
55
-
56
- setup(props) {
57
- const search = useSearch({
58
- placeholder: 'Search dates',
59
- missing: 'No dates found.'
60
- })
61
-
62
- const options = computed(() => {
63
- const year = props.year ?? 2019
64
- const month = props.month ?? 1
65
-
66
- const range = day().year(year).month(month - 1).date(1).endOf('month').date()
67
-
68
- const dates: TextItem[] = []
69
-
70
- for (let i = 1; i <= range; i++) {
71
- dates.push(useTextOption({ value: i, text: String(i) }))
72
- }
73
-
74
- if (props.nullable) {
75
- dates.unshift(useTextOption({ value: null, text: 'Select date' }))
76
- }
77
-
78
- return dates
79
- })
80
-
81
- return {
82
- search,
83
- options
84
- }
85
- }
86
- })
87
- </script>
@@ -1,86 +0,0 @@
1
- <template>
2
- <SInputDropdown
3
- class="SInputMonth"
4
- :size="size"
5
- :mode="mode"
6
- :name="name"
7
- :label="label"
8
- :note="note"
9
- :placeholder="placeholder"
10
- :help="help"
11
- :search="search"
12
- :nullable="nullable"
13
- :disabled="disabled"
14
- :options="options"
15
- :close-on-click="closeOnClick"
16
- :validation="validation"
17
- :value="value"
18
- @change="v => $emit('change', v)"
19
- />
20
- </template>
21
-
22
- <script lang="ts">
23
- import { PropType, defineComponent } from '@vue/composition-api'
24
- import { useSearch, useTextOption } from '../composables/InputDropdown'
25
- import SInputDropdown from './SInputDropdown.vue'
26
-
27
- type Size = 'mini' | 'medium'
28
- type Mode = 'filled' | 'outlined'
29
-
30
- export default defineComponent({
31
- components: {
32
- SInputDropdown
33
- },
34
-
35
- model: {
36
- prop: 'value',
37
- event: 'change'
38
- },
39
-
40
- props: {
41
- size: { type: String as PropType<Size>, default: 'medium' },
42
- mode: { type: String as PropType<Mode>, default: 'filled' },
43
- name: { type: String, default: null },
44
- label: { type: String, default: null },
45
- note: { type: String, default: null },
46
- help: { type: String, default: null },
47
- placeholder: { type: String, default: null },
48
- nullable: { type: Boolean, default: true },
49
- closeOnClick: { type: Boolean, default: true },
50
- disabled: { type: Boolean, default: false },
51
- validation: { type: Object, default: null },
52
- value: { type: [String, Number, Boolean, Array, Object] as PropType<any>, default: null }
53
- },
54
-
55
- setup(props) {
56
- const search = useSearch({
57
- placeholder: 'Search months',
58
- missing: 'No months found.'
59
- })
60
-
61
- const options = [
62
- useTextOption({ value: 1, text: 'January' }),
63
- useTextOption({ value: 2, text: 'February' }),
64
- useTextOption({ value: 3, text: 'March' }),
65
- useTextOption({ value: 4, text: 'April' }),
66
- useTextOption({ value: 5, text: 'May' }),
67
- useTextOption({ value: 6, text: 'June' }),
68
- useTextOption({ value: 7, text: 'July' }),
69
- useTextOption({ value: 8, text: 'August' }),
70
- useTextOption({ value: 9, text: 'September' }),
71
- useTextOption({ value: 10, text: 'October' }),
72
- useTextOption({ value: 11, text: 'November' }),
73
- useTextOption({ value: 12, text: 'December' })
74
- ]
75
-
76
- if (props.nullable) {
77
- options.unshift(useTextOption({ value: null, text: 'Select month' }))
78
- }
79
-
80
- return {
81
- search,
82
- options
83
- }
84
- }
85
- })
86
- </script>