@globalbrain/sefirot 0.71.0 → 2.0.0-draft.3
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.
- package/CHANGELOG.md +6 -804
- package/README.md +1 -1
- package/lib/assets/styles/bootstrap.css +1 -2
- package/lib/assets/styles/variables.css +14 -47
- package/lib/components/SAvatar.vue +9 -18
- package/lib/components/SButton.vue +35 -48
- package/lib/components/SDialog.vue +16 -34
- package/lib/components/SDropdown.vue +36 -55
- package/lib/components/SDropdownItem.vue +27 -39
- package/lib/components/SDropdownItemText.vue +4 -9
- package/lib/components/SDropdownItemUser.vue +4 -12
- package/lib/components/SInputBase.vue +33 -45
- package/lib/components/SInputCheckbox.vue +19 -35
- package/lib/components/SInputDropdown.vue +109 -171
- package/lib/components/SInputDropdownItem.vue +26 -32
- package/lib/components/SInputDropdownItemText.vue +6 -11
- package/lib/components/SInputDropdownItemTextTag.vue +10 -17
- package/lib/components/SInputDropdownItemUser.vue +5 -13
- package/lib/components/SInputDropdownItemUserTag.vue +9 -16
- package/lib/components/SInputFile.vue +38 -53
- package/lib/components/SInputHMS.vue +91 -114
- package/lib/components/SInputNumber.vue +27 -106
- package/lib/components/SInputRadio.vue +23 -33
- package/lib/components/SInputRadios.vue +37 -47
- package/lib/components/SInputText.vue +72 -628
- package/lib/components/SInputTextarea.vue +54 -113
- package/lib/components/SInputYMD.vue +94 -105
- package/lib/components/SLink.vue +16 -52
- package/lib/components/SModal.vue +53 -90
- package/lib/components/SPortalModals.vue +37 -53
- package/lib/components/SPortalSnackbars.vue +9 -24
- package/lib/components/SSheet.vue +10 -23
- package/lib/components/SSheetFooter.vue +0 -2
- package/lib/components/SSheetFooterAction.vue +9 -14
- package/lib/components/SSheetFooterActions.vue +1 -3
- package/lib/components/SSheetHeader.vue +9 -24
- package/lib/components/SSheetHeaderTitle.vue +1 -3
- package/lib/components/SSheetMedium.vue +13 -25
- package/lib/components/SSnackbar.vue +18 -28
- package/lib/composables/Dialog.ts +9 -17
- package/lib/composables/Dropdown.ts +2 -2
- package/lib/composables/{Menu.ts → Flyout.ts} +11 -4
- package/lib/composables/Form.ts +42 -44
- package/lib/composables/Modal.ts +9 -9
- package/lib/composables/Snackbar.ts +18 -0
- package/lib/composables/Validation.ts +28 -0
- package/lib/mixins/Sheet.ts +3 -3
- package/lib/store/Sefirot.ts +8 -13
- package/lib/store/dialog/index.ts +20 -10
- package/lib/store/modal/index.ts +11 -13
- package/lib/store/snackbars/index.ts +3 -4
- package/lib/support/{Util.ts → Utils.ts} +0 -2
- package/lib/types/Utils.ts +0 -7
- package/lib/types/vue-shims.d.ts +7 -0
- package/lib/validation/rules/checked.ts +6 -10
- package/lib/validation/rules/fileExtension.ts +9 -9
- package/lib/validation/rules/hms.ts +9 -9
- package/lib/validation/rules/index.ts +10 -74
- package/lib/validation/rules/maxLength.ts +10 -9
- package/lib/validation/rules/minLength.ts +12 -0
- package/lib/validation/rules/required.ts +2 -10
- package/lib/validation/rules/requiredHms.ts +11 -0
- package/lib/validation/rules/requiredIf.ts +3 -11
- package/lib/validation/rules/requiredYmd.ts +11 -0
- package/lib/validation/rules/ymd.ts +11 -0
- package/lib/validation/validators/checked.ts +1 -1
- package/lib/validation/validators/fileExtension.ts +1 -1
- package/lib/validation/validators/hms.ts +5 -5
- package/lib/validation/validators/requiredHms.ts +17 -0
- package/lib/validation/validators/requiredYmd.ts +7 -0
- package/lib/validation/validators/ymd.ts +41 -0
- package/package.json +45 -50
- package/lib/components/SAction.vue +0 -37
- package/lib/components/SActionAvatar.vue +0 -25
- package/lib/components/SActionButton.vue +0 -40
- package/lib/components/SActionPill.vue +0 -35
- package/lib/components/SActionSwitch.vue +0 -37
- package/lib/components/SAlert.vue +0 -145
- package/lib/components/SButtonGroup.vue +0 -160
- package/lib/components/SCard.vue +0 -111
- package/lib/components/SCardFooter.vue +0 -74
- package/lib/components/SCardHeader.vue +0 -213
- package/lib/components/SGrid.vue +0 -237
- package/lib/components/SGridActionLink.vue +0 -53
- package/lib/components/SGridActionMulti.vue +0 -139
- package/lib/components/SGridActionSingle.vue +0 -64
- package/lib/components/SHeader.vue +0 -180
- package/lib/components/SInputCheckboxes.vue +0 -83
- package/lib/components/SInputDate.vue +0 -192
- package/lib/components/SInputDay.vue +0 -87
- package/lib/components/SInputMonth.vue +0 -86
- package/lib/components/SInputSelect.vue +0 -282
- package/lib/components/SInputSwitch.vue +0 -212
- package/lib/components/SInputSwitches.vue +0 -108
- package/lib/components/SInputTime.vue +0 -255
- package/lib/components/SInputYear.vue +0 -60
- package/lib/components/SMarkdown.vue +0 -56
- package/lib/components/SPlaceholderBlank.vue +0 -113
- package/lib/components/SPlaceholderImage.vue +0 -83
- package/lib/components/SPortalScreens.vue +0 -62
- package/lib/components/SProgressBar.vue +0 -89
- package/lib/components/SResponsive.vue +0 -46
- package/lib/components/SScreen.vue +0 -81
- package/lib/components/SStep.vue +0 -107
- package/lib/components/SSteps.vue +0 -75
- package/lib/components/STag.vue +0 -67
- package/lib/components/STooltip.vue +0 -134
- package/lib/components/SWindow.vue +0 -158
- package/lib/composables/Action.ts +0 -141
- package/lib/composables/Alert.ts +0 -50
- package/lib/composables/Card.ts +0 -46
- package/lib/composables/FormValidation.ts +0 -150
- package/lib/composables/Header.ts +0 -72
- package/lib/composables/InputDropdown.ts +0 -6
- package/lib/composables/Markdown.ts +0 -138
- package/lib/composables/Router.ts +0 -20
- package/lib/composables/Step.ts +0 -7
- package/lib/composables/Store.ts +0 -9
- package/lib/composables/Tag.ts +0 -32
- package/lib/composables/Tooltip.ts +0 -91
- package/lib/composables/Utils.ts +0 -115
- package/lib/composables/markdown/LinkPlugin.ts +0 -45
- package/lib/compositions/useForm.ts +0 -17
- package/lib/compositions/useResizeObserver.ts +0 -25
- package/lib/compositions/useTime.ts +0 -26
- package/lib/store/alert/index.ts +0 -32
- package/lib/store/screen/index.ts +0 -46
- package/lib/types/v-calendar.d.ts +0 -5
- package/lib/validation/Validation.ts +0 -151
- package/lib/validation/rules/day.ts +0 -11
- package/lib/validation/rules/email.ts +0 -11
- package/lib/validation/rules/every.ts +0 -38
- package/lib/validation/rules/include.ts +0 -11
- package/lib/validation/rules/includeSome.ts +0 -11
- package/lib/validation/rules/integer.ts +0 -11
- package/lib/validation/rules/maxValue.ts +0 -11
- package/lib/validation/rules/minValue.ts +0 -11
- package/lib/validation/rules/month.ts +0 -11
- package/lib/validation/rules/not.ts +0 -10
- package/lib/validation/rules/regex.ts +0 -11
- package/lib/validation/rules/requiredHMS.ts +0 -11
- package/lib/validation/rules/requiredMonthDate.ts +0 -11
- package/lib/validation/rules/requiredYearMonth.ts +0 -11
- package/lib/validation/rules/requiredYearMonthDate.ts +0 -11
- package/lib/validation/rules/rule.ts +0 -5
- package/lib/validation/rules/sameAs.ts +0 -11
- package/lib/validation/rules/url.ts +0 -11
- package/lib/validation/rules/validateIf.ts +0 -27
- package/lib/validation/rules/year.ts +0 -11
- package/lib/validation/rules/yearMonth.ts +0 -11
- package/lib/validation/rules/yearMonthDate.ts +0 -11
- package/lib/validation/validators/day.ts +0 -29
- package/lib/validation/validators/email.ts +0 -5
- package/lib/validation/validators/include.ts +0 -5
- package/lib/validation/validators/includeSome.ts +0 -5
- package/lib/validation/validators/index.ts +0 -51
- package/lib/validation/validators/integer.ts +0 -6
- package/lib/validation/validators/maxLength.ts +0 -3
- package/lib/validation/validators/maxValue.ts +0 -3
- package/lib/validation/validators/minValue.ts +0 -3
- package/lib/validation/validators/month.ts +0 -3
- package/lib/validation/validators/monthDate.ts +0 -20
- package/lib/validation/validators/regex.ts +0 -3
- package/lib/validation/validators/required.ts +0 -27
- package/lib/validation/validators/requiredHMS.ts +0 -17
- package/lib/validation/validators/requiredMonthDate.ts +0 -8
- package/lib/validation/validators/requiredYearMonth.ts +0 -8
- package/lib/validation/validators/requiredYearMonthDate.ts +0 -9
- package/lib/validation/validators/sameAs.ts +0 -5
- package/lib/validation/validators/url.ts +0 -5
- package/lib/validation/validators/year.ts +0 -3
- package/lib/validation/validators/yearMonth.ts +0 -20
- package/lib/validation/validators/yearMonthDate.ts +0 -21
|
@@ -1,74 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 '
|
|
2
|
-
import { Rule } from './'
|
|
1
|
+
import { helpers, maxLength as baseMaxLength } from '@vuelidate/validators'
|
|
3
2
|
|
|
4
|
-
export
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 '
|
|
2
|
-
import { Rule } from './'
|
|
1
|
+
import { helpers, required as baseRequired } from '@vuelidate/validators'
|
|
3
2
|
|
|
4
|
-
export
|
|
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 {
|
|
2
|
-
import { Rule, Locator, locate } from './'
|
|
1
|
+
import { helpers, requiredIf as baseRequiredIf } from '@vuelidate/validators'
|
|
3
2
|
|
|
4
|
-
export
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { getExtension } from '../../support/File'
|
|
2
2
|
|
|
3
|
-
export
|
|
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
|
|
1
|
+
export interface Hms {
|
|
2
2
|
hour?: string
|
|
3
3
|
minute?: string
|
|
4
4
|
second?: string
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
export type
|
|
7
|
+
export type HmsType = 'h' | 'm' | 's'
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
export const HmsMap = {
|
|
10
10
|
h: 'hour',
|
|
11
11
|
m: 'minute',
|
|
12
12
|
s: 'second'
|
|
13
13
|
} as const
|
|
14
14
|
|
|
15
|
-
export
|
|
15
|
+
export function hms(hms: Hms, required: HmsType[] = ['h', 'm', 's']): boolean {
|
|
16
16
|
return required.every((r) => {
|
|
17
|
-
const value = hms[
|
|
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,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.
|
|
3
|
+
"version": "2.0.0-draft.3",
|
|
4
4
|
"description": "Vue Components for Global Brain Design System.",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib"
|
|
7
7
|
],
|
|
8
8
|
"scripts": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
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
|
-
"@
|
|
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/
|
|
49
|
-
"@types/jest": "^27.0.2",
|
|
53
|
+
"@types/jest": "^27.0.3",
|
|
50
54
|
"@types/lodash-es": "^4.17.5",
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"
|
|
56
|
-
"
|
|
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
|
-
"
|
|
62
|
-
"eslint": "^
|
|
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": "^
|
|
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
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
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>
|