@globalbrain/sefirot 0.72.0 → 2.0.0-draft.4

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 (175) hide show
  1. package/CHANGELOG.md +8 -808
  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 +72 -628
  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 +39 -98
  30. package/lib/components/SPortalModals.vue +37 -54
  31. package/lib/components/SPortalSnackbars.vue +9 -24
  32. package/lib/components/SSheet.vue +73 -28
  33. package/lib/components/SSheetFooter.vue +5 -3
  34. package/lib/components/SSheetFooterAction.vue +10 -15
  35. package/lib/components/SSheetFooterActions.vue +2 -4
  36. package/lib/components/SSheetMedium.vue +14 -22
  37. package/lib/components/SSheetTitle.vue +20 -0
  38. package/lib/components/SSnackbar.vue +18 -28
  39. package/lib/composables/Dialog.ts +9 -17
  40. package/lib/composables/Dropdown.ts +2 -2
  41. package/lib/composables/{Menu.ts → Flyout.ts} +11 -4
  42. package/lib/composables/Form.ts +42 -44
  43. package/lib/composables/Modal.ts +11 -19
  44. package/lib/composables/Snackbar.ts +18 -0
  45. package/lib/composables/Validation.ts +28 -0
  46. package/lib/mixins/Sheet.ts +5 -7
  47. package/lib/store/Sefirot.ts +8 -13
  48. package/lib/store/dialog/index.ts +20 -10
  49. package/lib/store/modal/index.ts +11 -18
  50. package/lib/store/snackbars/index.ts +3 -4
  51. package/lib/support/{Util.ts → Utils.ts} +0 -2
  52. package/lib/types/Utils.ts +0 -7
  53. package/lib/types/vue-shims.d.ts +7 -0
  54. package/lib/validation/rules/checked.ts +6 -10
  55. package/lib/validation/rules/fileExtension.ts +9 -9
  56. package/lib/validation/rules/hms.ts +9 -9
  57. package/lib/validation/rules/index.ts +10 -74
  58. package/lib/validation/rules/maxLength.ts +10 -9
  59. package/lib/validation/rules/minLength.ts +12 -0
  60. package/lib/validation/rules/required.ts +2 -10
  61. package/lib/validation/rules/requiredHms.ts +11 -0
  62. package/lib/validation/rules/requiredIf.ts +3 -11
  63. package/lib/validation/rules/requiredYmd.ts +11 -0
  64. package/lib/validation/rules/ymd.ts +11 -0
  65. package/lib/validation/validators/checked.ts +1 -1
  66. package/lib/validation/validators/fileExtension.ts +1 -1
  67. package/lib/validation/validators/hms.ts +5 -5
  68. package/lib/validation/validators/requiredHms.ts +17 -0
  69. package/lib/validation/validators/requiredYmd.ts +7 -0
  70. package/lib/validation/validators/ymd.ts +41 -0
  71. package/package.json +45 -50
  72. package/lib/components/SAction.vue +0 -37
  73. package/lib/components/SActionAvatar.vue +0 -25
  74. package/lib/components/SActionButton.vue +0 -40
  75. package/lib/components/SActionPill.vue +0 -35
  76. package/lib/components/SActionSwitch.vue +0 -37
  77. package/lib/components/SAlert.vue +0 -145
  78. package/lib/components/SButtonGroup.vue +0 -160
  79. package/lib/components/SCard.vue +0 -111
  80. package/lib/components/SCardFooter.vue +0 -74
  81. package/lib/components/SCardHeader.vue +0 -213
  82. package/lib/components/SGrid.vue +0 -237
  83. package/lib/components/SGridActionLink.vue +0 -53
  84. package/lib/components/SGridActionMulti.vue +0 -139
  85. package/lib/components/SGridActionSingle.vue +0 -64
  86. package/lib/components/SHeader.vue +0 -180
  87. package/lib/components/SInputCheckboxes.vue +0 -87
  88. package/lib/components/SInputDate.vue +0 -192
  89. package/lib/components/SInputDay.vue +0 -87
  90. package/lib/components/SInputMonth.vue +0 -86
  91. package/lib/components/SInputSelect.vue +0 -298
  92. package/lib/components/SInputSwitch.vue +0 -212
  93. package/lib/components/SInputSwitches.vue +0 -108
  94. package/lib/components/SInputTime.vue +0 -255
  95. package/lib/components/SInputYear.vue +0 -60
  96. package/lib/components/SMarkdown.vue +0 -56
  97. package/lib/components/SPlaceholderBlank.vue +0 -113
  98. package/lib/components/SPlaceholderImage.vue +0 -83
  99. package/lib/components/SPortalScreens.vue +0 -62
  100. package/lib/components/SProgressBar.vue +0 -89
  101. package/lib/components/SResponsive.vue +0 -46
  102. package/lib/components/SScreen.vue +0 -81
  103. package/lib/components/SSheetHeader.vue +0 -75
  104. package/lib/components/SSheetHeaderTitle.vue +0 -17
  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/components/icons/SIconCopy.vue +0 -6
  111. package/lib/composables/Action.ts +0 -141
  112. package/lib/composables/Alert.ts +0 -50
  113. package/lib/composables/Card.ts +0 -46
  114. package/lib/composables/FormValidation.ts +0 -150
  115. package/lib/composables/Header.ts +0 -72
  116. package/lib/composables/InputDropdown.ts +0 -6
  117. package/lib/composables/Markdown.ts +0 -138
  118. package/lib/composables/Router.ts +0 -20
  119. package/lib/composables/Step.ts +0 -7
  120. package/lib/composables/Store.ts +0 -9
  121. package/lib/composables/Tag.ts +0 -32
  122. package/lib/composables/Tooltip.ts +0 -91
  123. package/lib/composables/Utils.ts +0 -115
  124. package/lib/composables/markdown/LinkPlugin.ts +0 -45
  125. package/lib/compositions/useForm.ts +0 -17
  126. package/lib/compositions/useResizeObserver.ts +0 -25
  127. package/lib/compositions/useTime.ts +0 -26
  128. package/lib/store/alert/index.ts +0 -32
  129. package/lib/store/screen/index.ts +0 -46
  130. package/lib/types/v-calendar.d.ts +0 -5
  131. package/lib/validation/Validation.ts +0 -151
  132. package/lib/validation/rules/day.ts +0 -11
  133. package/lib/validation/rules/email.ts +0 -11
  134. package/lib/validation/rules/every.ts +0 -38
  135. package/lib/validation/rules/include.ts +0 -11
  136. package/lib/validation/rules/includeSome.ts +0 -11
  137. package/lib/validation/rules/integer.ts +0 -11
  138. package/lib/validation/rules/maxValue.ts +0 -11
  139. package/lib/validation/rules/minValue.ts +0 -11
  140. package/lib/validation/rules/month.ts +0 -11
  141. package/lib/validation/rules/not.ts +0 -10
  142. package/lib/validation/rules/regex.ts +0 -11
  143. package/lib/validation/rules/requiredHMS.ts +0 -11
  144. package/lib/validation/rules/requiredMonthDate.ts +0 -11
  145. package/lib/validation/rules/requiredYearMonth.ts +0 -11
  146. package/lib/validation/rules/requiredYearMonthDate.ts +0 -11
  147. package/lib/validation/rules/rule.ts +0 -5
  148. package/lib/validation/rules/sameAs.ts +0 -11
  149. package/lib/validation/rules/url.ts +0 -11
  150. package/lib/validation/rules/validateIf.ts +0 -27
  151. package/lib/validation/rules/year.ts +0 -11
  152. package/lib/validation/rules/yearMonth.ts +0 -11
  153. package/lib/validation/rules/yearMonthDate.ts +0 -11
  154. package/lib/validation/validators/day.ts +0 -29
  155. package/lib/validation/validators/email.ts +0 -5
  156. package/lib/validation/validators/include.ts +0 -5
  157. package/lib/validation/validators/includeSome.ts +0 -5
  158. package/lib/validation/validators/index.ts +0 -51
  159. package/lib/validation/validators/integer.ts +0 -6
  160. package/lib/validation/validators/maxLength.ts +0 -3
  161. package/lib/validation/validators/maxValue.ts +0 -3
  162. package/lib/validation/validators/minValue.ts +0 -3
  163. package/lib/validation/validators/month.ts +0 -3
  164. package/lib/validation/validators/monthDate.ts +0 -20
  165. package/lib/validation/validators/regex.ts +0 -3
  166. package/lib/validation/validators/required.ts +0 -27
  167. package/lib/validation/validators/requiredHMS.ts +0 -17
  168. package/lib/validation/validators/requiredMonthDate.ts +0 -8
  169. package/lib/validation/validators/requiredYearMonth.ts +0 -8
  170. package/lib/validation/validators/requiredYearMonthDate.ts +0 -9
  171. package/lib/validation/validators/sameAs.ts +0 -5
  172. package/lib/validation/validators/url.ts +0 -5
  173. package/lib/validation/validators/year.ts +0 -3
  174. package/lib/validation/validators/yearMonth.ts +0 -20
  175. package/lib/validation/validators/yearMonthDate.ts +0 -21
@@ -1,11 +1,11 @@
1
- import baseHMS, { HMSType } from '../validators/hms'
2
- import { Rule } from './'
1
+ import { helpers } from '@vuelidate/validators'
2
+ import { hms as baseHms, Hms, HmsType } from '../validators/hms'
3
3
 
4
- export default function hms(required?: HMSType[], message?: string): Rule {
5
- return {
6
- name: 'hms',
7
- message: message ?? 'The time format is invalid',
8
- optional: true,
9
- validate: v => baseHMS(v, required)
10
- }
4
+ export function hms(required?: HmsType[]) {
5
+ return helpers.withMessage(
6
+ 'The time is invalid.',
7
+ (value: Hms) => {
8
+ return !helpers.req(value) || baseHms(value, required)
9
+ }
10
+ )
11
11
  }
@@ -1,74 +1,10 @@
1
- import { isString } from '../../support/Util'
2
- import checked from './checked'
3
- import day from './day'
4
- import every from './every'
5
- import email from './email'
6
- import fileExtension from './fileExtension'
7
- import hms from './hms'
8
- import include from './include'
9
- import includeSome from './includeSome'
10
- import integer from './integer'
11
- import maxLength from './maxLength'
12
- import maxValue from './maxValue'
13
- import minValue from './minValue'
14
- import month from './month'
15
- import not from './not'
16
- import regex from './regex'
17
- import required from './required'
18
- import requiredHMS from './requiredHMS'
19
- import requiredIf from './requiredIf'
20
- import requiredMonthDate from './requiredMonthDate'
21
- import requiredYearMonth from './requiredYearMonth'
22
- import requiredYearMonthDate from './requiredYearMonthDate'
23
- import rule from './rule'
24
- import sameAs from './sameAs'
25
- import url from './url'
26
- import validateIf from './validateIf'
27
- import year from './year'
28
- import yearMonth from './yearMonth'
29
- import yearMonthDate from './yearMonthDate'
30
-
31
- export interface Rule {
32
- name: string
33
- message: string
34
- optional: boolean
35
- validate (value: any, data: Record<string, any>): boolean
36
- }
37
-
38
- export type Locator = string | LocatorFunction
39
- export type LocatorFunction = (data: Record<string, any>) => any
40
-
41
- export function locate(data: Record<string, any>, locator: Locator): any {
42
- return isString(locator) ? data[locator] : locator(data)
43
- }
44
-
45
- export {
46
- checked,
47
- day,
48
- every,
49
- email,
50
- fileExtension,
51
- hms,
52
- include,
53
- includeSome,
54
- integer,
55
- maxLength,
56
- maxValue,
57
- minValue,
58
- month,
59
- not,
60
- regex,
61
- required,
62
- requiredHMS,
63
- requiredIf,
64
- requiredMonthDate,
65
- requiredYearMonth,
66
- requiredYearMonthDate,
67
- rule,
68
- sameAs,
69
- url,
70
- validateIf,
71
- year,
72
- yearMonth,
73
- yearMonthDate
74
- }
1
+ export * from './checked'
2
+ export * from './fileExtension'
3
+ export * from './hms'
4
+ export * from './maxLength'
5
+ export * from './minLength'
6
+ export * from './required'
7
+ export * from './requiredHms'
8
+ export * from './requiredIf'
9
+ export * from './requiredYmd'
10
+ export * from './ymd'
@@ -1,11 +1,12 @@
1
- import { maxLength as baseMaxLength } from '../validators'
2
- import { Rule } from './'
1
+ import { helpers, maxLength as baseMaxLength } from '@vuelidate/validators'
3
2
 
4
- export default function maxLength(max: number, message?: string): Rule {
5
- return {
6
- name: 'maxLength',
7
- message: message ?? `The value must be less than ${max} characters.`,
8
- optional: true,
9
- validate: value => baseMaxLength(value, max)
10
- }
3
+ export function maxLength(length: number) {
4
+ return helpers.withMessage(
5
+ ({ $params }) => {
6
+ return `
7
+ The value must be less or equal to ${($params as any).max} characters.
8
+ `
9
+ },
10
+ baseMaxLength(length)
11
+ )
11
12
  }
@@ -0,0 +1,12 @@
1
+ import { helpers, minLength as baseMinLength } from '@vuelidate/validators'
2
+
3
+ export function minLength(length: number) {
4
+ return helpers.withMessage(
5
+ ({ $params }) => {
6
+ return `
7
+ The value must be greater or equal to ${($params as any).min} characters.
8
+ `
9
+ },
10
+ baseMinLength(length)
11
+ )
12
+ }
@@ -1,11 +1,3 @@
1
- import { required as baseRequired } from '../validators'
2
- import { Rule } from './'
1
+ import { helpers, required as baseRequired } from '@vuelidate/validators'
3
2
 
4
- export default function required(message?: string): Rule {
5
- return {
6
- name: 'required',
7
- message: message ?? 'The field is required.',
8
- optional: false,
9
- validate: baseRequired
10
- }
11
- }
3
+ export const required = helpers.withMessage('The field is required.', baseRequired)
@@ -0,0 +1,11 @@
1
+ import { helpers } from '@vuelidate/validators'
2
+ import { requiredHms as baseRequiredHms, Hms, HmsType } from '../validators/requiredHms'
3
+
4
+ export function requiredHms(required?: HmsType[]) {
5
+ return helpers.withMessage(
6
+ 'The field is required.',
7
+ (value: Hms) => {
8
+ return !helpers.req(value) || baseRequiredHms(value, required)
9
+ }
10
+ )
11
+ }
@@ -1,13 +1,5 @@
1
- import { required } from '../validators'
2
- import { Rule, Locator, locate } from './'
1
+ import { helpers, requiredIf as baseRequiredIf } from '@vuelidate/validators'
3
2
 
4
- export default function requiredIf(locator: Locator, message?: string): Rule {
5
- return {
6
- name: 'requiredIf',
7
- message: message ?? 'The field is required.',
8
- optional: false,
9
- validate(value, data) {
10
- return locate(data, locator) ? required(value) : true
11
- }
12
- }
3
+ export function requiredIf(prop: boolean | string | (() => boolean | Promise<boolean>)) {
4
+ return helpers.withMessage('The field is required.', baseRequiredIf(prop))
13
5
  }
@@ -0,0 +1,11 @@
1
+ import { helpers } from '@vuelidate/validators'
2
+ import { requiredYmd as baseRequiredYmd, Ymd, YmdType } from '../validators/requiredYmd'
3
+
4
+ export function requiredYmd(required?: YmdType[]) {
5
+ return helpers.withMessage(
6
+ 'The field is required.',
7
+ (value: Ymd) => {
8
+ return !helpers.req(value) || baseRequiredYmd(value, required)
9
+ }
10
+ )
11
+ }
@@ -0,0 +1,11 @@
1
+ import { helpers } from '@vuelidate/validators'
2
+ import { ymd as baseYmd, Ymd, YmdType } from '../validators/ymd'
3
+
4
+ export function ymd(required?: YmdType[]) {
5
+ return helpers.withMessage(
6
+ 'The date is invalid.',
7
+ (value: Ymd) => {
8
+ return !helpers.req(value) || baseYmd(value, required)
9
+ }
10
+ )
11
+ }
@@ -1,3 +1,3 @@
1
- export default function checked(value: boolean): boolean {
1
+ export function checked(value: boolean): boolean {
2
2
  return value === true
3
3
  }
@@ -1,6 +1,6 @@
1
1
  import { getExtension } from '../../support/File'
2
2
 
3
- export default function fileExtension(file: File, extensions: string[]): boolean {
3
+ export function fileExtension(file: File, extensions: string[]): boolean {
4
4
  const fileExtension = getExtension(file)
5
5
 
6
6
  return extensions.some((extension) => {
@@ -1,20 +1,20 @@
1
- export interface HMS {
1
+ export interface Hms {
2
2
  hour?: string
3
3
  minute?: string
4
4
  second?: string
5
5
  }
6
6
 
7
- export type HMSType = 'h' | 'm' | 's'
7
+ export type HmsType = 'h' | 'm' | 's'
8
8
 
9
- const HMSMap = {
9
+ export const HmsMap = {
10
10
  h: 'hour',
11
11
  m: 'minute',
12
12
  s: 'second'
13
13
  } as const
14
14
 
15
- export default function hms(hms: HMS, required: HMSType[] = ['h', 'm', 's']): boolean {
15
+ export function hms(hms: Hms, required: HmsType[] = ['h', 'm', 's']): boolean {
16
16
  return required.every((r) => {
17
- const value = hms[HMSMap[r]]
17
+ const value = hms[HmsMap[r]]
18
18
 
19
19
  if (value === undefined) {
20
20
  return true
@@ -0,0 +1,17 @@
1
+ export interface Hms {
2
+ hour?: string
3
+ minute?: string
4
+ second?: string
5
+ }
6
+
7
+ export type HmsType = 'h' | 'm' | 's'
8
+
9
+ export const HmsMap = {
10
+ h: 'hour',
11
+ m: 'minute',
12
+ s: 'second'
13
+ } as const
14
+
15
+ export function requiredHms(hms: Hms, required: HmsType[] = ['h', 'm', 's']): boolean {
16
+ return required.every(r => hms[HmsMap[r]] !== undefined)
17
+ }
@@ -0,0 +1,7 @@
1
+ import { Ymd, YmdType, YmdMap } from './ymd'
2
+
3
+ export type { Ymd, YmdType, YmdMap }
4
+
5
+ export function requiredYmd(ymd: Ymd, required: YmdType[] = ['y', 'm', 'd']): boolean {
6
+ return required.every(r => ymd[YmdMap[r]] !== undefined)
7
+ }
@@ -0,0 +1,41 @@
1
+ import day from 'dayjs'
2
+
3
+ export interface Ymd {
4
+ year?: number
5
+ month?: number
6
+ date?: number
7
+ }
8
+
9
+ export type YmdType = 'y' | 'm' | 'd'
10
+
11
+ export const YmdMap = {
12
+ y: 'year',
13
+ m: 'month',
14
+ d: 'date'
15
+ } as const
16
+
17
+ export function ymd(ymd: Ymd, required: YmdType[] = ['y', 'm', 'd']): boolean {
18
+ return required.every((r) => {
19
+ const value = ymd[YmdMap[r]]
20
+
21
+ if (value === undefined) {
22
+ return true
23
+ }
24
+
25
+ if (r === 'y') {
26
+ return value > 0 && value <= 9999
27
+ }
28
+
29
+ if (r === 'm') {
30
+ return value > 0 && value <= 12
31
+ }
32
+
33
+ const d = day(new Date(2020, ymd.month ? ymd.month - 1 : 1, value))
34
+
35
+ if (d.month() + 1 !== (ymd.month ?? 1)) {
36
+ return false
37
+ }
38
+
39
+ return d.isValid()
40
+ })
41
+ }
package/package.json CHANGED
@@ -1,24 +1,20 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
- "version": "0.72.0",
3
+ "version": "2.0.0-draft.4",
4
4
  "description": "Vue Components for Global Brain Design System.",
5
5
  "files": [
6
6
  "lib"
7
7
  ],
8
8
  "scripts": {
9
- "serve": "HOST=0.0.0.0 nuxt",
10
- "start": "HOST=0.0.0.0 nuxt start",
11
- "build": "nuxt build",
12
- "generate": "nuxt generate",
13
- "lint": "eslint --fix --ignore-path .gitignore './{lib,docs,test}/**/*.{ts,vue}'",
14
- "lint:fail": "eslint --ignore-path .gitignore './{lib,docs,test}/**/*.{ts,vue}'",
9
+ "type": "vue-tsc --noEmit",
10
+ "lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix './{lib,tests}/**/*.{ts,vue}'",
11
+ "lint:fail": "eslint --ext .js,.vue --ignore-path .gitignore './{lib,tests}/**/*.{ts,vue}'",
15
12
  "jest": "jest",
16
- "test": "yarn lint && yarn coverage",
17
13
  "coverage": "jest --collect-coverage",
14
+ "test": "yarn type && yarn lint && yarn coverage",
15
+ "test:fail": "yarn type && yarn lint:fail && yarn coverage",
18
16
  "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
19
- "release": "node scripts/release.js",
20
- "docs:deploy": "yarn generate && push-dir --dir=dist --branch=gh-pages --cleanup",
21
- "clean": "rm -rf {.nuxt,node_modules,coverage,yarn-error.log}"
17
+ "release": "node scripts/release.js"
22
18
  },
23
19
  "repository": {
24
20
  "type": "git",
@@ -34,54 +30,53 @@
34
30
  "bugs": {
35
31
  "url": "https://github.com/globalbrain/sefirot/issues"
36
32
  },
33
+ "peerDependencies": {
34
+ "@types/body-scroll-lock": "^3.1.0",
35
+ "@types/lodash-es": "^4.17.5",
36
+ "@vuelidate/core": "^2.0.0-alpha.32",
37
+ "@vuelidate/validators": "^2.0.0-alpha.25",
38
+ "body-scroll-lock": "^4.0.0-beta.0",
39
+ "fuse.js": "^6.4.6",
40
+ "lodash-es": "^4.17.21",
41
+ "normalize.css": "^8.0.1",
42
+ "postcss": "^8.4.4",
43
+ "postcss-nested": "^5.0.6",
44
+ "typescript": "^4.4.0",
45
+ "vue": "^3.2.0",
46
+ "vue-router": "^4.0.12",
47
+ "vue-tsc": "^0.3.0",
48
+ "vuex": "^4.0.2"
49
+ },
37
50
  "devDependencies": {
38
- "@juggle/resize-observer": "^3.3.1",
39
- "@nuxt/types": "^2.15.8",
40
- "@nuxt/typescript-build": "^2.1.0",
41
- "@nuxtjs/color-mode": "^2.1.1",
42
- "@nuxtjs/composition-api": "^0.29.3",
43
- "@nuxtjs/dotenv": "^1.4.1",
44
- "@nuxtjs/eslint-config-typescript": "^6.0.1",
45
- "@nuxtjs/google-analytics": "^2.4.0",
46
- "@nuxtjs/markdownit": "^1.2.10",
51
+ "@babel/core": "^7.16.0",
47
52
  "@types/body-scroll-lock": "^3.1.0",
48
- "@types/escape-html": "^1.0.1",
49
- "@types/jest": "^27.0.2",
53
+ "@types/jest": "^27.0.3",
50
54
  "@types/lodash-es": "^4.17.5",
51
- "@types/markdown-it": "^12.2.3",
52
- "@types/prismjs": "^1.16.6",
53
- "@vue/composition-api": "^1.2.4",
54
- "@vue/test-utils": "^1.2.2",
55
- "@vue/vue2-jest": "^27.0.0-alpha.2",
56
- "babel-core": "^7.0.0-bridge.0",
57
- "body-scroll-lock": "^3.1.5",
55
+ "@typescript-eslint/parser": "^5.2.0",
56
+ "@vue/test-utils": "^2.0.0-rc.17",
57
+ "@vuelidate/core": "^2.0.0-alpha.32",
58
+ "@vuelidate/validators": "^2.0.0-alpha.25",
59
+ "babel-jest": "^26.0.0",
60
+ "body-scroll-lock": "^4.0.0-beta.0",
58
61
  "codecov": "^3.8.3",
59
62
  "conventional-changelog-cli": "^2.1.1",
60
63
  "dayjs": "^1.10.7",
61
- "escape-html": "^1.0.3",
62
- "eslint": "^7.32.0",
64
+ "eslint": "^8.3.0",
65
+ "eslint-plugin-jest": "^25.3.0",
66
+ "eslint-plugin-vue": "^8.0.1",
63
67
  "fuse.js": "^6.4.6",
64
- "jest": "^27.3.1",
65
- "jest-serializer-vue": "^2.0.2",
68
+ "jest": "^26.0.0",
66
69
  "lodash": "^4.17.21",
67
70
  "lodash-es": "^4.17.21",
68
- "markdown-it": "^12.2.0",
69
- "markdown-it-anchor": "^8.4.1",
70
71
  "normalize.css": "^8.0.1",
71
- "nuxt": "^2.15.8",
72
- "portal-vue": "^2.1.7",
73
- "postcss-custom-properties": "^10.0.0",
74
- "postcss-nested": "^4.2.3",
75
- "prismjs": "^1.25.0",
76
- "push-dir": "^0.4.1",
77
- "simplebar-vue": "^1.6.8",
78
- "ts-jest": "^27.0.7",
79
- "ts-loader": "^8.3.0",
80
- "typescript": "^4.4.4",
81
- "v-calendar": "^2.3.4",
82
- "vue": "^2.6.14",
83
- "vue-router": "^3.5.2",
84
- "vue-server-renderer": "^2.6.14",
85
- "vue-template-compiler": "^2.6.14"
72
+ "postcss": "^8.4.4",
73
+ "postcss-nested": "^5.0.6",
74
+ "ts-jest": "^26.0.0",
75
+ "typescript": "^4.4.0",
76
+ "vue": "^3.2.0",
77
+ "vue-jest": "^5.0.0-alpha.10",
78
+ "vue-router": "^4.0.12",
79
+ "vue-tsc": "^0.3.0",
80
+ "vuex": "^4.0.2"
86
81
  }
87
82
  }
@@ -1,37 +0,0 @@
1
- <template>
2
- <component :is="component" :action="action" />
3
- </template>
4
-
5
- <script lang="ts">
6
- import { PropType, defineComponent, computed } from '@vue/composition-api'
7
- import { Action, Types } from '../composables/Action'
8
- import SActionButton from './SActionButton.vue'
9
- import SActionPill from './SActionPill.vue'
10
- import SActionAvatar from './SActionAvatar.vue'
11
- import SActionSwitch from './SActionSwitch.vue'
12
-
13
- export default defineComponent({
14
- props: {
15
- action: { type: Object as PropType<Action>, required: true }
16
- },
17
-
18
- setup(props) {
19
- const component = computed(() => {
20
- switch (props.action.type) {
21
- case Types.Button:
22
- return SActionButton
23
- case Types.Pill:
24
- return SActionPill
25
- case Types.Avatar:
26
- return SActionAvatar
27
- case Types.Switch:
28
- return SActionSwitch
29
- }
30
- })
31
-
32
- return {
33
- component
34
- }
35
- }
36
- })
37
- </script>
@@ -1,25 +0,0 @@
1
- <template>
2
- <div class="SActionAvatar">
3
- <div v-for="(avatar, index) in action.avatars" :key="index" class="avatars">
4
- <div class="avatar">
5
- <SAvatar :avatar="avatar.avatar" :name="avatar.name" />
6
- </div>
7
- </div>
8
- </div>
9
- </template>
10
-
11
- <script lang="ts">
12
- import { PropType, defineComponent } from '@vue/composition-api'
13
- import { AvatarAction } from '../composables/Action'
14
- import SAvatar from './SAvatar.vue'
15
-
16
- export default defineComponent({
17
- components: {
18
- SAvatar
19
- },
20
-
21
- props: {
22
- action: { type: Object as PropType<AvatarAction>, required: true }
23
- }
24
- })
25
- </script>
@@ -1,40 +0,0 @@
1
- <template>
2
- <SButton
3
- class="SActionButton"
4
- :tag="action.link ? 'nuxt-link' : 'button'"
5
- :size="action.size"
6
- :type="action.kind"
7
- :mode="action.mode"
8
- :icon="action.icon"
9
- :label="action.label"
10
- :to="action.link"
11
- block
12
- @click="emitCallback"
13
- />
14
- </template>
15
-
16
- <script lang="ts">
17
- import { PropType, defineComponent } from '@vue/composition-api'
18
- import { ButtonAction } from '../composables/Action'
19
- import SButton from './SButton.vue'
20
-
21
- export default defineComponent({
22
- components: {
23
- SButton
24
- },
25
-
26
- props: {
27
- action: { type: Object as PropType<ButtonAction>, required: true }
28
- },
29
-
30
- setup(props) {
31
- function emitCallback() {
32
- props.action.callback && props.action.callback()
33
- }
34
-
35
- return {
36
- emitCallback
37
- }
38
- }
39
- })
40
- </script>
@@ -1,35 +0,0 @@
1
- <template>
2
- <div class="SActionPill" :class="[action.mode]">
3
- {{ action.label }}
4
- </div>
5
- </template>
6
-
7
- <script lang="ts">
8
- import { PropType, defineComponent } from '@vue/composition-api'
9
- import { PillAction } from '../composables/Action'
10
-
11
- export default defineComponent({
12
- props: {
13
- action: { type: Object as PropType<PillAction>, required: true }
14
- }
15
- })
16
- </script>
17
-
18
- <style lang="postcss" scoped>
19
- @import "@/assets/styles/variables";
20
-
21
- .SActionPill {
22
- border-radius: 12px;
23
- padding: 0 12px;
24
- line-height: 24px;
25
- font-size: 12px;
26
- font-weight: 500;
27
- color: var(--c-text-dark-1);
28
- }
29
-
30
- .SActionPill.neutral { background-color: var(--c-black); }
31
- .SActionPill.info { background-color: var(--c-info); }
32
- .SActionPill.success { background-color: var(--c-success); }
33
- .SActionPill.warning { background-color: var(--c-warning); }
34
- .SActionPill.danger { background-color: var(--c-danger); }
35
- </style>
@@ -1,37 +0,0 @@
1
- <template>
2
- <div class="SActionSwitch">
3
- <SInputSwitch
4
- :value="action.value"
5
- :mode="action.mode"
6
- :text="action.text"
7
- :text-mode="action.textMode"
8
- @change="emitCallback"
9
- />
10
- </div>
11
- </template>
12
-
13
- <script lang="ts">
14
- import { PropType, defineComponent } from '@vue/composition-api'
15
- import { SwitchAction } from '../composables/Action'
16
- import SInputSwitch from './SInputSwitch.vue'
17
-
18
- export default defineComponent({
19
- components: {
20
- SInputSwitch
21
- },
22
-
23
- props: {
24
- action: { type: Object as PropType<SwitchAction>, required: true }
25
- },
26
-
27
- setup(props) {
28
- function emitCallback() {
29
- props.action.callback && props.action.callback()
30
- }
31
-
32
- return {
33
- emitCallback
34
- }
35
- }
36
- })
37
- </script>