@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,10 +0,0 @@
1
- import { Rule } from './'
2
-
3
- export default function not(rule: Rule, message?: string): Rule {
4
- return {
5
- name: `not-${rule.name}`,
6
- message: message ?? '',
7
- optional: true,
8
- validate: (value, data) => !rule.validate(value, data)
9
- }
10
- }
@@ -1,11 +0,0 @@
1
- import { regex as baseRegex } from '../validators'
2
- import { Rule } from './'
3
-
4
- export default function required(regExp: RegExp, message?: string): Rule {
5
- return {
6
- name: 'regex',
7
- message: message ?? 'The value is invalid.',
8
- optional: true,
9
- validate: value => baseRegex(value, regExp)
10
- }
11
- }
@@ -1,11 +0,0 @@
1
- import baseRequiredHMS, { HMSType } from '../validators/requiredHMS'
2
- import { Rule } from './'
3
-
4
- export default function requiredHMS(required?: HMSType[], message?: string): Rule {
5
- return {
6
- name: 'requiredHMS',
7
- message: message ?? 'The field is required.',
8
- optional: true,
9
- validate: v => baseRequiredHMS(v, required)
10
- }
11
- }
@@ -1,11 +0,0 @@
1
- import { requiredMonthDate as baseRequiredMonthDate } from '../validators'
2
- import { Rule } from './'
3
-
4
- export default function requiredMonthDate(message?: string): Rule {
5
- return {
6
- name: 'requiredMonthDate',
7
- message: message ?? 'The field is required.',
8
- optional: true,
9
- validate: baseRequiredMonthDate
10
- }
11
- }
@@ -1,11 +0,0 @@
1
- import { requiredYearMonth as baseRequiredYearMonth } from '../validators'
2
- import { Rule } from './'
3
-
4
- export default function requiredYearMonth(message?: string): Rule {
5
- return {
6
- name: 'requiredYearMonth',
7
- message: message ?? 'The field is required.',
8
- optional: true,
9
- validate: baseRequiredYearMonth
10
- }
11
- }
@@ -1,11 +0,0 @@
1
- import { requiredYearMonthDate as baseRequiredYearMonthDate } from '../validators'
2
- import { Rule } from './'
3
-
4
- export default function requiredYearMonthDate(message?: string): Rule {
5
- return {
6
- name: 'requiredYearMonthDate',
7
- message: message ?? 'The field is required.',
8
- optional: true,
9
- validate: baseRequiredYearMonthDate
10
- }
11
- }
@@ -1,5 +0,0 @@
1
- import { Rule } from './'
2
-
3
- export default function rule(options: Rule): Rule {
4
- return options
5
- }
@@ -1,11 +0,0 @@
1
- import { sameAs as baseSameAs } from '../validators'
2
- import { Rule } from './'
3
-
4
- export default function required(other: string, message?: string): Rule {
5
- return {
6
- name: 'sameAs',
7
- message: message ?? `The value must match ${other}.`,
8
- optional: true,
9
- validate: (value, data) => baseSameAs(value, data[other])
10
- }
11
- }
@@ -1,11 +0,0 @@
1
- import { url as baseUrl } from '../validators'
2
- import { Rule } from './'
3
-
4
- export default function url(message?: string): Rule {
5
- return {
6
- name: 'url',
7
- message: message ?? 'The URL is invalid.',
8
- optional: true,
9
- validate: baseUrl
10
- }
11
- }
@@ -1,27 +0,0 @@
1
- import { required } from '../validators'
2
- import { Rule, Locator, locate } from './'
3
-
4
- export default function validateIf(locator: Locator, rules: Rule[]): Rule {
5
- return {
6
- name: 'validateIf',
7
- message: 'Default message.',
8
- optional: false,
9
- validate(value, data) {
10
- if (!locate(data, locator)) {
11
- return true
12
- }
13
-
14
- return rules.every((rule) => {
15
- if (rule.optional && !required(value)) {
16
- return true
17
- }
18
-
19
- const result = rule.validate(value, data)
20
-
21
- this.message = rule.message
22
-
23
- return result
24
- })
25
- }
26
- }
27
- }
@@ -1,11 +0,0 @@
1
- import { year as baseYear } from '../validators'
2
- import { Rule } from './'
3
-
4
- export default function year(message?: string): Rule {
5
- return {
6
- name: 'year',
7
- message: message ?? 'The year is invalid.',
8
- optional: true,
9
- validate: baseYear
10
- }
11
- }
@@ -1,11 +0,0 @@
1
- import { yearMonth as baseYearMonth } from '../validators'
2
- import { Rule } from './'
3
-
4
- export default function yearMonth(message?: string): Rule {
5
- return {
6
- name: 'yearMonth',
7
- message: message ?? 'The date is invalid.',
8
- optional: true,
9
- validate: baseYearMonth
10
- }
11
- }
@@ -1,11 +0,0 @@
1
- import { yearMonthDate as baseYearMonthDate } from '../validators'
2
- import { Rule } from './'
3
-
4
- export default function year(message?: string): Rule {
5
- return {
6
- name: 'yearMonthDate',
7
- message: message ?? 'The date is invalid.',
8
- optional: true,
9
- validate: baseYearMonthDate
10
- }
11
- }
@@ -1,29 +0,0 @@
1
- import dayjs from 'dayjs'
2
-
3
- export default function day(value: number, year?: number, month?: number): boolean {
4
- if (year && !month) {
5
- return validateDateOnly(value)
6
- }
7
-
8
- if (!year && month) {
9
- return validateWithMonth(month, value)
10
- }
11
-
12
- if (year && month) {
13
- return validateWithYearMonth(year, month, value)
14
- }
15
-
16
- return validateDateOnly(value)
17
- }
18
-
19
- function validateDateOnly(date: number): boolean {
20
- return date > 0 && date < 32
21
- }
22
-
23
- function validateWithMonth(month: number, date: number): boolean {
24
- return dayjs().year(2020).month(month - 1).date(date).date() === date
25
- }
26
-
27
- function validateWithYearMonth(year: number, month: number, date: number): boolean {
28
- return dayjs().year(year).month(month - 1).date(date).date() === date
29
- }
@@ -1,5 +0,0 @@
1
- const regex = /(^$|^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$)/
2
-
3
- export default function email(value: any): boolean {
4
- return regex.test(value)
5
- }
@@ -1,5 +0,0 @@
1
- import { isEqual } from '../../support/Util'
2
-
3
- export default function include(value: any[], other: any): boolean {
4
- return value.some(v => isEqual(v, other))
5
- }
@@ -1,5 +0,0 @@
1
- import { isEqual } from '../../support/Util'
2
-
3
- export default function includeSome(value: any[], other: any[]): boolean {
4
- return value.some(v => other.some(o => isEqual(v, o)))
5
- }
@@ -1,51 +0,0 @@
1
- import checked from './checked'
2
- import day from './day'
3
- import email from './email'
4
- import fileExtension from './fileExtension'
5
- import hms from './hms'
6
- import include from './include'
7
- import includeSome from './includeSome'
8
- import integer from './integer'
9
- import maxLength from './maxLength'
10
- import maxValue from './maxValue'
11
- import minValue from './minValue'
12
- import month from './month'
13
- import monthDate from './monthDate'
14
- import regex from './regex'
15
- import required from './required'
16
- import requiredHMS from './requiredHMS'
17
- import requiredMonthDate from './requiredMonthDate'
18
- import requiredYearMonth from './requiredYearMonth'
19
- import requiredYearMonthDate from './requiredYearMonthDate'
20
- import sameAs from './sameAs'
21
- import url from './url'
22
- import year from './year'
23
- import yearMonthDate from './yearMonthDate'
24
- import yearMonth from './yearMonth'
25
-
26
- export {
27
- checked,
28
- day,
29
- email,
30
- fileExtension,
31
- hms,
32
- include,
33
- includeSome,
34
- integer,
35
- maxLength,
36
- maxValue,
37
- minValue,
38
- month,
39
- monthDate,
40
- regex,
41
- required,
42
- requiredHMS,
43
- requiredMonthDate,
44
- requiredYearMonth,
45
- requiredYearMonthDate,
46
- sameAs,
47
- url,
48
- year,
49
- yearMonthDate,
50
- yearMonth
51
- }
@@ -1,6 +0,0 @@
1
- export default function integer(value: number): boolean {
2
- // ^[0-9]*$ - for empty string and positive integer.
3
- // ^-[0-9]+$ - only for negative integer (minus sign without at least
4
- // 1 digit is not a number)
5
- return /(^[0-9]*$)|(^-[0-9]+$)/.test(String(value))
6
- }
@@ -1,3 +0,0 @@
1
- export default function maxLength(value: string | string[], max: number): boolean {
2
- return value.length <= max
3
- }
@@ -1,3 +0,0 @@
1
- export default function maxValue(value: number, max: number): boolean {
2
- return value <= max
3
- }
@@ -1,3 +0,0 @@
1
- export default function minValue(value: number, min: number): boolean {
2
- return min <= value
3
- }
@@ -1,3 +0,0 @@
1
- export default function month(value: number): boolean {
2
- return value > 0 && value < 13
3
- }
@@ -1,20 +0,0 @@
1
- import day from 'dayjs'
2
-
3
- export interface MonthDate {
4
- month?: number
5
- date?: number
6
- }
7
-
8
- export default function monthDate(value: MonthDate): boolean {
9
- if (value.month === undefined || value.date === undefined) {
10
- return true
11
- }
12
-
13
- const d = day(new Date(2020, value.month - 1, value.date))
14
-
15
- if (d.month() + 1 !== value.month) {
16
- return false
17
- }
18
-
19
- return d.isValid()
20
- }
@@ -1,3 +0,0 @@
1
- export default function regex(value: any, regExp: RegExp): boolean {
2
- return regExp.test(value)
3
- }
@@ -1,27 +0,0 @@
1
- export default function required(value: any): boolean {
2
- if (Array.isArray(value)) {
3
- return !!value.length
4
- }
5
-
6
- if (value === undefined || value === null) {
7
- return false
8
- }
9
-
10
- if (value === false) {
11
- return true
12
- }
13
-
14
- if (value instanceof Date) {
15
- return true
16
- }
17
-
18
- if (typeof value === 'object') {
19
- for (const _ in value) {
20
- return true
21
- }
22
-
23
- return false
24
- }
25
-
26
- return !!String(value).length
27
- }
@@ -1,17 +0,0 @@
1
- export interface HMS {
2
- hour?: string
3
- minute?: string
4
- second?: string
5
- }
6
-
7
- export type HMSType = 'h' | 'm' | 's'
8
-
9
- const HMSMap = {
10
- h: 'hour',
11
- m: 'minute',
12
- s: 'second'
13
- } as const
14
-
15
- export default function requiredHMS(hms: HMS, required: HMSType[] = ['h', 'm', 's']): boolean {
16
- return required.every(r => hms[HMSMap[r]] !== undefined)
17
- }
@@ -1,8 +0,0 @@
1
- export interface MonthDate {
2
- month?: number
3
- date?: number
4
- }
5
-
6
- export default function requiredMonthDate(value: MonthDate): boolean {
7
- return !(value.month === undefined || value.date === undefined)
8
- }
@@ -1,8 +0,0 @@
1
- export interface YearMonth {
2
- year?: number
3
- month?: number
4
- }
5
-
6
- export default function requiredYearMonth(value: YearMonth): boolean {
7
- return !(value.year === undefined || value.month === undefined)
8
- }
@@ -1,9 +0,0 @@
1
- export interface YearMonthDate {
2
- year?: number
3
- month?: number
4
- date?: number
5
- }
6
-
7
- export default function requiredYearMonthDate(value: YearMonthDate): boolean {
8
- return !(value.year === undefined || value.month === undefined || value.date === undefined)
9
- }
@@ -1,5 +0,0 @@
1
- import { isEqual } from '../../support/Util'
2
-
3
- export default function sameAs(value: any, other: any): boolean {
4
- return isEqual(value, other)
5
- }
@@ -1,5 +0,0 @@
1
- const regex = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00A1-\uFFFF0-9]-*)*[a-z\u00A1-\uFFFF0-9]+)(?:\.(?:[a-z\u00A1-\uFFFF0-9]-*)*[a-z\u00A1-\uFFFF0-9]+)*(?:\.(?:[a-z\u00A1-\uFFFF]{2,})))(?::\d{2,5})?(?:[/?#]\S*)?$/i
2
-
3
- export default function url(value: any): boolean {
4
- return regex.test(value)
5
- }
@@ -1,3 +0,0 @@
1
- export default function year(value: number): boolean {
2
- return value > 0
3
- }
@@ -1,20 +0,0 @@
1
- export interface YearMonth {
2
- year?: number
3
- month?: number
4
- }
5
-
6
- export default function yearMonth(value: YearMonth): boolean {
7
- if (value.year === undefined || value.month === undefined) {
8
- return true
9
- }
10
-
11
- if (value.year < 0 || value.year > 9999) {
12
- return false
13
- }
14
-
15
- if (value.month < 0 || value.month > 12) {
16
- return false
17
- }
18
-
19
- return true
20
- }
@@ -1,21 +0,0 @@
1
- import day from 'dayjs'
2
-
3
- export interface YearMonthDate {
4
- year?: number
5
- month?: number
6
- date?: number
7
- }
8
-
9
- export default function yearMonthDate(value: YearMonthDate): boolean {
10
- if (value.year === undefined || value.month === undefined || value.date === undefined) {
11
- return true
12
- }
13
-
14
- const d = day(new Date(value.year, value.month - 1, value.date))
15
-
16
- if (d.month() + 1 !== value.month) {
17
- return false
18
- }
19
-
20
- return d.isValid()
21
- }