@globalbrain/sefirot 2.0.0-draft.7 → 2.0.0
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/LICENSE.md +1 -1
- package/README.md +6 -6
- package/lib/components/SAvatar.vue +17 -17
- package/lib/components/SButton.vue +512 -267
- package/lib/components/SButtonGroup.vue +149 -0
- package/lib/components/SDropdown.vue +26 -150
- package/lib/components/SDropdownSection.vue +48 -0
- package/lib/components/SDropdownSectionFilter.vue +189 -0
- package/lib/components/SDropdownSectionFilterItem.vue +21 -0
- package/lib/components/SDropdownSectionFilterItemAvatar.vue +31 -0
- package/lib/components/SDropdownSectionFilterItemText.vue +20 -0
- package/lib/components/SDropdownSectionMenu.vue +39 -0
- package/lib/components/SIcon.vue +13 -0
- package/lib/components/SInputBase.vue +31 -31
- package/lib/components/SInputCheckbox.vue +1 -1
- package/lib/components/SInputCheckboxes.vue +74 -0
- package/lib/components/SInputDate.vue +182 -0
- package/lib/components/SInputDropdown.vue +158 -157
- package/lib/components/SInputDropdownItem.vue +46 -48
- package/lib/components/{SInputDropdownItemUserTag.vue → SInputDropdownItemAvatar.vue} +43 -44
- package/lib/components/SInputDropdownItemText.vue +79 -16
- package/lib/components/SInputFile.vue +55 -60
- package/lib/components/SInputHMS.vue +120 -110
- package/lib/components/SInputNumber.vue +38 -9
- package/lib/components/SInputRadio.vue +39 -36
- package/lib/components/SInputRadios.vue +40 -53
- package/lib/components/SInputSelect.vue +3 -3
- package/lib/components/SInputSwitch.vue +193 -0
- package/lib/components/SInputSwitches.vue +88 -0
- package/lib/components/SInputText.vue +206 -62
- package/lib/components/SInputTextarea.vue +46 -32
- package/lib/components/SInputYMD.vue +123 -126
- package/lib/components/SMarkdown.vue +52 -0
- package/lib/components/SModal.vue +25 -63
- package/lib/components/SMount.vue +19 -0
- package/lib/components/SSheet.vue +49 -55
- package/lib/components/SSheetFooter.vue +1 -1
- package/lib/components/SSheetFooterAction.vue +24 -17
- package/lib/components/SSheetFooterActions.vue +1 -4
- package/lib/components/SSheetForm.vue +15 -0
- package/lib/components/SSheetMedium.vue +8 -10
- package/lib/components/SSheetTitle.vue +7 -14
- package/lib/components/SSnackbar.vue +55 -45
- package/lib/components/{SPortalSnackbars.vue → SSnackbars.vue} +17 -20
- package/lib/components/SStep.vue +106 -0
- package/lib/components/SSteps.vue +59 -0
- package/lib/components/STable.vue +241 -0
- package/lib/components/STableCell.vue +82 -0
- package/lib/components/STableCellAvatar.vue +69 -0
- package/lib/components/STableCellAvatars.vue +93 -0
- package/lib/components/STableCellDay.vue +40 -0
- package/lib/components/STableCellPill.vue +84 -0
- package/lib/components/STableCellText.vue +102 -0
- package/lib/components/STableColumn.vue +255 -0
- package/lib/components/STableFooter.vue +115 -0
- package/lib/components/STableHeader.vue +74 -0
- package/lib/components/STableItem.vue +38 -0
- package/lib/components/STooltip.vue +112 -0
- package/lib/composables/Dropdown.ts +40 -99
- package/lib/composables/Form.ts +21 -18
- package/lib/composables/Grid.ts +117 -0
- package/lib/composables/Markdown.ts +138 -0
- package/lib/composables/Step.ts +7 -0
- package/lib/composables/Table.ts +103 -0
- package/lib/composables/Tooltip.ts +91 -0
- package/lib/composables/Validation.ts +6 -7
- package/lib/composables/markdown/LinkPlugin.ts +45 -0
- package/lib/mixins/Sheet.ts +5 -3
- package/lib/stores/Snackbars.ts +48 -0
- package/lib/{assets/styles → styles}/base.css +0 -0
- package/lib/{assets/styles → styles}/bootstrap.css +1 -0
- package/lib/{assets/styles → styles}/variables.css +55 -48
- package/lib/support/Day.ts +8 -0
- package/lib/support/Num.ts +3 -0
- package/lib/support/Time.ts +5 -2
- package/lib/support/Utils.ts +4 -3
- package/lib/types/shims.d.ts +3 -0
- package/lib/validation/validators/requiredYmd.ts +1 -1
- package/lib/validation/validators/ymd.ts +4 -4
- package/package.json +62 -43
- package/CHANGELOG.md +0 -41
- package/lib/components/SDialog.vue +0 -140
- package/lib/components/SDropdownItem.vue +0 -78
- package/lib/components/SDropdownItemText.vue +0 -22
- package/lib/components/SDropdownItemUser.vue +0 -40
- package/lib/components/SInputDropdownItemTextTag.vue +0 -94
- package/lib/components/SInputDropdownItemUser.vue +0 -41
- package/lib/components/SPortalModals.vue +0 -74
- package/lib/composables/Dialog.ts +0 -38
- package/lib/composables/Modal.ts +0 -34
- package/lib/composables/Snackbar.ts +0 -18
- package/lib/store/Sefirot.ts +0 -17
- package/lib/store/dialog/index.ts +0 -42
- package/lib/store/modal/index.ts +0 -61
- package/lib/store/snackbars/index.ts +0 -70
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { Ref, ToRefs } from 'vue'
|
|
2
1
|
import {
|
|
3
2
|
Validation,
|
|
4
3
|
ValidationArgs,
|
|
5
4
|
GlobalConfig,
|
|
6
|
-
ExtractState,
|
|
7
5
|
ErrorObject,
|
|
8
6
|
useVuelidate
|
|
9
7
|
} from '@vuelidate/core'
|
|
8
|
+
import { Ref, ToRefs } from 'vue'
|
|
10
9
|
|
|
11
|
-
export type { Validation, ValidationArgs, GlobalConfig
|
|
10
|
+
export type { Validation, ValidationArgs, GlobalConfig }
|
|
12
11
|
|
|
13
12
|
export interface Validatable {
|
|
14
13
|
readonly $dirty: boolean
|
|
@@ -18,12 +17,12 @@ export interface Validatable {
|
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
export function useValidation<
|
|
21
|
-
T extends
|
|
22
|
-
|
|
20
|
+
T extends { [key in keyof R]: any },
|
|
21
|
+
R extends ValidationArgs = ValidationArgs
|
|
23
22
|
>(
|
|
24
23
|
state: T | Ref<T> | ToRefs<T>,
|
|
25
|
-
rules: Ref<
|
|
24
|
+
rules: Ref<R> | R,
|
|
26
25
|
config?: GlobalConfig
|
|
27
|
-
): Ref<Validation<
|
|
26
|
+
): Ref<Validation<R, T>> {
|
|
28
27
|
return useVuelidate(rules, state, config)
|
|
29
28
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import MarkdownIt from 'markdown-it'
|
|
2
|
+
|
|
3
|
+
export type LinkAttrs = Record<string, string>
|
|
4
|
+
|
|
5
|
+
const EXTERNAL_REGEX = /^https?:/
|
|
6
|
+
const CALLBACK_REGEX = /\{([\d}]+)\}/
|
|
7
|
+
const CALLBACK_HREF = '#callback'
|
|
8
|
+
|
|
9
|
+
export function linkPlugin(md: MarkdownIt, linkAttrs: LinkAttrs = {}): void {
|
|
10
|
+
md.renderer.rules.link_open = (tokens, idx, options, _env, self) => {
|
|
11
|
+
const token = tokens[idx]
|
|
12
|
+
const hrefIndex = token.attrIndex('href')
|
|
13
|
+
|
|
14
|
+
if (hrefIndex >= 0) {
|
|
15
|
+
const hrefAttr = token.attrs![hrefIndex]
|
|
16
|
+
const url = decodeURIComponent(hrefAttr[1])
|
|
17
|
+
|
|
18
|
+
if (isExternalUrl(url)) {
|
|
19
|
+
Object.entries(linkAttrs).forEach(([key, val]) => {
|
|
20
|
+
token.attrSet(key, val)
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (isCallbackUrl(url)) {
|
|
25
|
+
const matched = url.match(CALLBACK_REGEX)![1]
|
|
26
|
+
|
|
27
|
+
token.attrSet('data-callback-id', matched)
|
|
28
|
+
|
|
29
|
+
hrefAttr[1] = CALLBACK_HREF
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
token.attrSet('class', 'SMarkdown-link')
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return self.renderToken(tokens, idx, options)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function isExternalUrl(url: string): boolean {
|
|
40
|
+
return EXTERNAL_REGEX.test(url)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function isCallbackUrl(url: string): boolean {
|
|
44
|
+
return url === CALLBACK_HREF || CALLBACK_REGEX.test(decodeURIComponent(url))
|
|
45
|
+
}
|
package/lib/mixins/Sheet.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { App } from 'vue'
|
|
2
2
|
import SSheet from '../components/SSheet.vue'
|
|
3
|
-
import SSheetTitle from '../components/SSheetTitle.vue'
|
|
4
|
-
import SSheetMedium from '../components/SSheetMedium.vue'
|
|
5
3
|
import SSheetFooter from '../components/SSheetFooter.vue'
|
|
6
|
-
import SSheetFooterActions from '../components/SSheetFooterActions.vue'
|
|
7
4
|
import SSheetFooterAction from '../components/SSheetFooterAction.vue'
|
|
5
|
+
import SSheetFooterActions from '../components/SSheetFooterActions.vue'
|
|
6
|
+
import SSheetForm from '../components/SSheetForm.vue'
|
|
7
|
+
import SSheetMedium from '../components/SSheetMedium.vue'
|
|
8
|
+
import SSheetTitle from '../components/SSheetTitle.vue'
|
|
8
9
|
|
|
9
10
|
export function mixin(app: App): void {
|
|
10
11
|
app.mixin({
|
|
@@ -12,6 +13,7 @@ export function mixin(app: App): void {
|
|
|
12
13
|
SSheet,
|
|
13
14
|
SSheetTitle,
|
|
14
15
|
SSheetMedium,
|
|
16
|
+
SSheetForm,
|
|
15
17
|
SSheetFooter,
|
|
16
18
|
SSheetFooterActions,
|
|
17
19
|
SSheetFooterAction
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineStore } from 'pinia'
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
export interface Snackbar {
|
|
5
|
+
text: string
|
|
6
|
+
mode?: 'neutral' | 'info' | 'warning' | 'danger'
|
|
7
|
+
actions?: SnackbarAction[]
|
|
8
|
+
timeout?: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface SnackbarWithId extends Snackbar {
|
|
12
|
+
id: number
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface SnackbarAction {
|
|
16
|
+
label: string
|
|
17
|
+
onClick(): void
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const useSnackbars = defineStore('snackbars', () => {
|
|
21
|
+
const maxItemSize = 4
|
|
22
|
+
|
|
23
|
+
let nextId = 0
|
|
24
|
+
|
|
25
|
+
const items = ref<SnackbarWithId[]>([])
|
|
26
|
+
|
|
27
|
+
function push(snackbar: Snackbar): void {
|
|
28
|
+
if (items.value.length > maxItemSize) {
|
|
29
|
+
items.value.shift()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const id = nextId++
|
|
33
|
+
|
|
34
|
+
items.value.push({ id, ...snackbar })
|
|
35
|
+
|
|
36
|
+
setTimeout(() => { pop(id) }, snackbar.timeout ?? 10000)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function pop(id: number): void {
|
|
40
|
+
items.value = items.value.filter(item => item.id !== id)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
items,
|
|
45
|
+
push,
|
|
46
|
+
pop
|
|
47
|
+
}
|
|
48
|
+
})
|
|
File without changes
|
|
@@ -11,16 +11,19 @@
|
|
|
11
11
|
--c-white-soft: #fafafa;
|
|
12
12
|
--c-white-mute: #f2f2f2;
|
|
13
13
|
|
|
14
|
+
--c-white-elv: #fafafa;
|
|
15
|
+
--c-white-elv-up: #ffffff;
|
|
16
|
+
--c-white-elv-down: #f2f2f2;
|
|
17
|
+
|
|
14
18
|
--c-black: #000000;
|
|
15
|
-
--c-black-
|
|
16
|
-
--c-black-
|
|
17
|
-
--c-black-mute: #2c2c2e;
|
|
19
|
+
--c-black-soft: #171717;
|
|
20
|
+
--c-black-mute: #1c1c1e;
|
|
18
21
|
|
|
19
|
-
--c-black-
|
|
20
|
-
--c-black-
|
|
21
|
-
--c-black-
|
|
22
|
+
--c-black-elv: #171717;
|
|
23
|
+
--c-black-elv-up: #1c1c1e;
|
|
24
|
+
--c-black-elv-down: #000000;
|
|
22
25
|
|
|
23
|
-
--c-gray: #
|
|
26
|
+
--c-gray: #8e8e93;
|
|
24
27
|
|
|
25
28
|
--c-gray-dark-1: #636366;
|
|
26
29
|
--c-gray-dark-2: #48484a;
|
|
@@ -55,25 +58,28 @@
|
|
|
55
58
|
--c-info-lighter: #50a2ff;
|
|
56
59
|
--c-info-dark: #3468a3;
|
|
57
60
|
--c-info-darker: #255489;
|
|
61
|
+
--c-info-bg: rgba(59, 142, 237, 0.1);
|
|
58
62
|
|
|
59
63
|
--c-success: #00b489;
|
|
60
64
|
--c-success-light: #0fcea0;
|
|
61
65
|
--c-success-lighter: #27e8ba;
|
|
62
66
|
--c-success-dark: #068f6e;
|
|
63
67
|
--c-success-darker: #086b53;
|
|
68
|
+
--c-success-bg: rgba(0, 180, 137, 0.1);
|
|
64
69
|
|
|
65
|
-
--c-warning: #
|
|
70
|
+
--c-warning: #f0ba17;
|
|
66
71
|
--c-warning-light: #ffe417;
|
|
67
72
|
--c-warning-lighter: #ffff17;
|
|
68
73
|
--c-warning-dark: #e0ad15;
|
|
69
74
|
--c-warning-darker: #bc9112;
|
|
70
|
-
--c-warning-bg: rgba(255, 197, 23, .1);
|
|
75
|
+
--c-warning-bg: rgba(255, 197, 23, 0.1);
|
|
71
76
|
|
|
72
77
|
--c-danger: #ed3c50;
|
|
73
78
|
--c-danger-light: #f43771;
|
|
74
79
|
--c-danger-lighter: #fd1d7c;
|
|
75
80
|
--c-danger-dark: #cd2d3f;
|
|
76
81
|
--c-danger-darker: #ab2131;
|
|
82
|
+
--c-danger-bg: rgba(237, 60, 80, 0.1);
|
|
77
83
|
|
|
78
84
|
--c-alternative: #de41e0;
|
|
79
85
|
--c-alternative-light: #e936eb;
|
|
@@ -91,6 +97,10 @@
|
|
|
91
97
|
--c-bg-soft: var(--c-white-soft);
|
|
92
98
|
--c-bg-mute: var(--c-white-mute);
|
|
93
99
|
|
|
100
|
+
--c-bg-elv: var(--c-white-elv);
|
|
101
|
+
--c-bg-elv-up: var(--c-white-elv-up);
|
|
102
|
+
--c-bg-elv-down: var(--c-white-elv-down);
|
|
103
|
+
|
|
94
104
|
--c-divider: var(--c-divider-light-1);
|
|
95
105
|
--c-divider-light: var(--c-divider-light-2);
|
|
96
106
|
|
|
@@ -106,10 +116,14 @@
|
|
|
106
116
|
}
|
|
107
117
|
|
|
108
118
|
.dark {
|
|
109
|
-
--c-bg: var(--c-black
|
|
119
|
+
--c-bg: var(--c-black);
|
|
110
120
|
--c-bg-soft: var(--c-black-soft);
|
|
111
121
|
--c-bg-mute: var(--c-black-mute);
|
|
112
122
|
|
|
123
|
+
--c-bg-elv: var(--c-black-elv);
|
|
124
|
+
--c-bg-elv-up: var(--c-black-elv-up);
|
|
125
|
+
--c-bg-elv-down: var(--c-black-elv-down);
|
|
126
|
+
|
|
113
127
|
--c-divider: var(--c-divider-dark-1);
|
|
114
128
|
--c-divider-light: var(--c-divider-dark-2);
|
|
115
129
|
|
|
@@ -129,7 +143,8 @@
|
|
|
129
143
|
* -------------------------------------------------------------------------- */
|
|
130
144
|
|
|
131
145
|
:root {
|
|
132
|
-
--font-family-base: "
|
|
146
|
+
--font-family-base: "Inter", "Noto Sans JP", "-apple-system", "BlinkMacSystemFont", "Roboto", "Segoe UI", "Helvetica Neue", "Arial", "sans-serif";
|
|
147
|
+
--font-family-number: "Roboto", "Noto Sans JP", "-apple-system", "BlinkMacSystemFont", "Roboto", "Segoe UI", "Helvetica Neue", "Arial", "sans-serif";
|
|
133
148
|
--font-family-mono: "source-code-pro", "Menlo", "Monaco", "Consolas", "Courier New", monospace;
|
|
134
149
|
}
|
|
135
150
|
|
|
@@ -188,6 +203,21 @@
|
|
|
188
203
|
* -------------------------------------------------------------------------- */
|
|
189
204
|
|
|
190
205
|
:root {
|
|
206
|
+
--button-fill-text: var(--c-text-inverse-1);
|
|
207
|
+
--button-fill-bg: var(--c-black);
|
|
208
|
+
--button-fill-bg-hover: var(--c-gray-dark-4);
|
|
209
|
+
--button-fill-bg-focus: var(--c-gray-dark-3);
|
|
210
|
+
|
|
211
|
+
--button-outline-text: var(--c-text-1);
|
|
212
|
+
--button-outline-border: var(--c-black);
|
|
213
|
+
--button-outline-bg-hover: var(--c-white-mute);
|
|
214
|
+
--button-outline-bg-focus: var(--c-gray-light-4);
|
|
215
|
+
|
|
216
|
+
--button-text-text: var(--c-text-1);
|
|
217
|
+
--button-text-bg-hover: var(--c-white-mute);
|
|
218
|
+
--button-text-bg-focus: var(--c-gray-light-4);
|
|
219
|
+
|
|
220
|
+
/* Deprecated */
|
|
191
221
|
--button-primary-text: var(--c-text-inverse-1);
|
|
192
222
|
--button-primary-bg: var(--c-black);
|
|
193
223
|
--button-primary-bg-hover: var(--c-gray-dark-4);
|
|
@@ -234,6 +264,20 @@
|
|
|
234
264
|
}
|
|
235
265
|
|
|
236
266
|
.dark {
|
|
267
|
+
--button-fill-text: var(--c-text-inverse-1);
|
|
268
|
+
--button-fill-bg: var(--c-white);
|
|
269
|
+
--button-fill-bg-hover: var(--c-gray-light-3);
|
|
270
|
+
--button-fill-bg-focus: var(--c-gray-light-1);
|
|
271
|
+
|
|
272
|
+
--button-outline-border: var(--c-white);
|
|
273
|
+
--button-outline-bg-hover: var(--c-black-mute);
|
|
274
|
+
--button-outline-bg-focus: var(--c-gray-dark-3);
|
|
275
|
+
|
|
276
|
+
--button-text-text: var(--c-text-1);
|
|
277
|
+
--button-text-bg-hover: var(--c-gray-dark-4);
|
|
278
|
+
--button-text-bg-focus: var(--c-bg-soft);
|
|
279
|
+
|
|
280
|
+
/* Deprecated */
|
|
237
281
|
--button-primary-text: var(--c-text-inverse-1);
|
|
238
282
|
--button-primary-bg: var(--c-white);
|
|
239
283
|
--button-primary-bg-hover: var(--c-gray-light-3);
|
|
@@ -260,14 +304,6 @@
|
|
|
260
304
|
--button-tertiary-inverse-bg-hover: var(--c-gray-dark-3);
|
|
261
305
|
--button-tertiary-inverse-bg-focus: var(--c-gray-dark-2);
|
|
262
306
|
|
|
263
|
-
--button-text-text: var(--c-text-1);
|
|
264
|
-
--button-text-bg-hover: var(--c-black-mute);
|
|
265
|
-
--button-text-bg-focus: var(--c-gray-dark-3);
|
|
266
|
-
--button-text-inverse-text: var(--c-text-inverse-1);
|
|
267
|
-
--button-text-inverse-bg: var(--c-black-mute);
|
|
268
|
-
--button-text-inverse-bg-hover: var(--c-gray-dark-3);
|
|
269
|
-
--button-text-inverse-bg-focus: var(--c-gray-dark-2);
|
|
270
|
-
|
|
271
307
|
--button-mute-text: var(--c-text-2);
|
|
272
308
|
--button-mute-text-hover: var(--c-text-1);
|
|
273
309
|
--button-mute-bg-hover: var(--c-black-mute);
|
|
@@ -278,35 +314,6 @@
|
|
|
278
314
|
--button-mute-inverse-bg-focus: var(--c-gray-dark-2);
|
|
279
315
|
}
|
|
280
316
|
|
|
281
|
-
/**
|
|
282
|
-
* Component: Inputs
|
|
283
|
-
* -------------------------------------------------------------------------- */
|
|
284
|
-
|
|
285
|
-
:root {
|
|
286
|
-
--input-label: var(--c-text-1);
|
|
287
|
-
--input-note: var(--c-text-2);
|
|
288
|
-
--input-text: var(--c-text-1);
|
|
289
|
-
--input-placeholder: var(--c-text-3);
|
|
290
|
-
--input-help: var(--c-text-2);
|
|
291
|
-
|
|
292
|
-
--input-border: var(--c-divider);
|
|
293
|
-
|
|
294
|
-
--input-hover-border: var(--c-black);
|
|
295
|
-
|
|
296
|
-
--input-focus-border: var(--c-black);
|
|
297
|
-
--input-focus-bg: var(--c-white);
|
|
298
|
-
|
|
299
|
-
--input-disabled-bg: var(--c-white-mute);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.dark {
|
|
303
|
-
--input-hover-border: var(--c-gray);
|
|
304
|
-
|
|
305
|
-
--input-focus-border: var(--c-gray);
|
|
306
|
-
|
|
307
|
-
--input-disabled-bg: var(--c-black-mute);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
317
|
/**
|
|
311
318
|
* Component: Dropdown
|
|
312
319
|
* -------------------------------------------------------------------------- */
|
package/lib/support/Time.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
type Awaited<T> = T extends undefined ? T : T extends PromiseLike<infer U> ? U : T
|
|
2
2
|
|
|
3
|
-
export function sleep(ms
|
|
3
|
+
export function sleep(ms = 500): Promise<undefined> {
|
|
4
4
|
return new Promise<undefined>(resolve => setTimeout(resolve, ms))
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
export function delay<T extends any[]>(
|
|
7
|
+
export function delay<T extends any[]>(
|
|
8
|
+
iterable: T,
|
|
9
|
+
ms?: number
|
|
10
|
+
): Promise<{ [P in keyof T]: Awaited<T[P]> }> {
|
|
8
11
|
return Promise.all([...iterable, sleep(ms)]) as any
|
|
9
12
|
}
|
package/lib/support/Utils.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export { default as isEqual } from 'lodash-es/isEqual'
|
|
2
|
-
export { default as cloneDeep } from 'lodash-es/cloneDeep'
|
|
3
|
-
|
|
4
1
|
export function isNullish(value: unknown): value is undefined | null {
|
|
5
2
|
return value === null || value === undefined
|
|
6
3
|
}
|
|
@@ -9,6 +6,10 @@ export function isString(value: unknown): value is string {
|
|
|
9
6
|
return typeof value === 'string'
|
|
10
7
|
}
|
|
11
8
|
|
|
9
|
+
export function isNumber(value: unknown): value is number {
|
|
10
|
+
return typeof value === 'number'
|
|
11
|
+
}
|
|
12
|
+
|
|
12
13
|
export function isArray(value: unknown): value is unknown[] {
|
|
13
14
|
return Array.isArray(value)
|
|
14
15
|
}
|
|
@@ -3,5 +3,5 @@ import { Ymd, YmdType, YmdMap } from './ymd'
|
|
|
3
3
|
export type { Ymd, YmdType, YmdMap }
|
|
4
4
|
|
|
5
5
|
export function requiredYmd(ymd: Ymd, required: YmdType[] = ['y', 'm', 'd']): boolean {
|
|
6
|
-
return required.every(r => ymd[YmdMap[r]] !==
|
|
6
|
+
return required.every(r => ymd[YmdMap[r]] !== null)
|
|
7
7
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import day from 'dayjs'
|
|
2
2
|
|
|
3
3
|
export interface Ymd {
|
|
4
|
-
year
|
|
5
|
-
month
|
|
6
|
-
date
|
|
4
|
+
year: number | null
|
|
5
|
+
month: number | null
|
|
6
|
+
date: number | null
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export type YmdType = 'y' | 'm' | 'd'
|
|
@@ -18,7 +18,7 @@ export function ymd(ymd: Ymd, required: YmdType[] = ['y', 'm', 'd']): boolean {
|
|
|
18
18
|
return required.every((r) => {
|
|
19
19
|
const value = ymd[YmdMap[r]]
|
|
20
20
|
|
|
21
|
-
if (value ===
|
|
21
|
+
if (value === null) {
|
|
22
22
|
return true
|
|
23
23
|
}
|
|
24
24
|
|
package/package.json
CHANGED
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@globalbrain/sefirot",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Vue Components for Global Brain Design System.",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib"
|
|
7
7
|
],
|
|
8
|
-
"scripts": {
|
|
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}'",
|
|
12
|
-
"vitest": "vitest",
|
|
13
|
-
"coverage": "vitest run --coverage",
|
|
14
|
-
"test": "yarn type && yarn lint && yarn coverage",
|
|
15
|
-
"test:fail": "yarn type && yarn lint:fail && yarn coverage",
|
|
16
|
-
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
17
|
-
"release": "node scripts/release.js"
|
|
18
|
-
},
|
|
19
8
|
"repository": {
|
|
20
9
|
"type": "git",
|
|
21
10
|
"url": "git@github.com:globalbrain/sefirot.git"
|
|
@@ -31,53 +20,83 @@
|
|
|
31
20
|
"url": "https://github.com/globalbrain/sefirot/issues"
|
|
32
21
|
},
|
|
33
22
|
"peerDependencies": {
|
|
23
|
+
"@iconify/vue": "^4.0.0",
|
|
34
24
|
"@types/body-scroll-lock": "^3.1.0",
|
|
35
|
-
"@types/lodash-es": "^4.17.
|
|
36
|
-
"@vuelidate/core": "^2.0.0-alpha.
|
|
37
|
-
"@vuelidate/validators": "^2.0.0-alpha.
|
|
25
|
+
"@types/lodash-es": "^4.17.6",
|
|
26
|
+
"@vuelidate/core": "^2.0.0-alpha.38",
|
|
27
|
+
"@vuelidate/validators": "^2.0.0-alpha.28",
|
|
28
|
+
"@vueuse/core": "^9.1.0",
|
|
38
29
|
"body-scroll-lock": "^4.0.0-beta.0",
|
|
39
|
-
"dayjs": "^1.
|
|
30
|
+
"dayjs": "^1.11.0",
|
|
40
31
|
"fuse.js": "^6.5.3",
|
|
41
32
|
"lodash-es": "^4.17.21",
|
|
42
33
|
"normalize.css": "^8.0.1",
|
|
43
|
-
"
|
|
34
|
+
"pinia": "^2.0.22",
|
|
35
|
+
"postcss": "^8.4.12",
|
|
44
36
|
"postcss-nested": "^5.0.6",
|
|
45
|
-
"typescript": "^4.
|
|
37
|
+
"typescript": "^4.7.4",
|
|
38
|
+
"v-calendar": "^3.0.0-alpha.8",
|
|
46
39
|
"vue": "^3.2.31",
|
|
47
|
-
"vue-router": "^4.0.
|
|
48
|
-
"vue-tsc": "^0.31.4",
|
|
49
|
-
"vuex": "^4.0.2"
|
|
40
|
+
"vue-router": "^4.0.14"
|
|
50
41
|
},
|
|
51
42
|
"devDependencies": {
|
|
52
|
-
"@
|
|
43
|
+
"@histoire/plugin-vue": "^0.10.7",
|
|
44
|
+
"@iconify/vue": "^4.0.0",
|
|
53
45
|
"@types/body-scroll-lock": "^3.1.0",
|
|
54
46
|
"@types/lodash-es": "^4.17.6",
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
47
|
+
"@types/markdown-it": "^12.2.3",
|
|
48
|
+
"@types/node": "^18.7.18",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^5.38.0",
|
|
50
|
+
"@typescript-eslint/parser": "^5.38.0",
|
|
51
|
+
"@vitejs/plugin-vue": "^3.1.0",
|
|
52
|
+
"@vitest/coverage-c8": "^0.23.4",
|
|
53
|
+
"@vue/test-utils": "^2.0.2",
|
|
54
|
+
"@vuelidate/core": "^2.0.0-alpha.44",
|
|
55
|
+
"@vuelidate/validators": "^2.0.0-alpha.31",
|
|
56
|
+
"@vueuse/core": "^9.2.0",
|
|
60
57
|
"body-scroll-lock": "^4.0.0-beta.0",
|
|
61
|
-
"
|
|
62
|
-
"codecov": "^3.8.3",
|
|
58
|
+
"chalk": "^4.1.2",
|
|
63
59
|
"conventional-changelog-cli": "^2.2.2",
|
|
64
|
-
"dayjs": "^1.
|
|
60
|
+
"dayjs": "^1.11.5",
|
|
65
61
|
"enquirer": "^2.3.6",
|
|
66
|
-
"eslint": "^8.
|
|
67
|
-
"eslint-plugin-
|
|
62
|
+
"eslint": "^8.23.1",
|
|
63
|
+
"eslint-plugin-import": "^2.26.0",
|
|
64
|
+
"eslint-plugin-vue": "^9.5.1",
|
|
68
65
|
"execa": "^5.1.1",
|
|
69
|
-
"fuse.js": "^6.
|
|
70
|
-
"happy-dom": "^
|
|
66
|
+
"fuse.js": "^6.6.2",
|
|
67
|
+
"happy-dom": "^6.0.4",
|
|
68
|
+
"histoire": "^0.10.7",
|
|
71
69
|
"lodash-es": "^4.17.21",
|
|
70
|
+
"markdown-it": "^13.0.1",
|
|
72
71
|
"normalize.css": "^8.0.1",
|
|
73
|
-
"
|
|
72
|
+
"pinia": "^2.0.22",
|
|
73
|
+
"postcss": "^8.4.16",
|
|
74
74
|
"postcss-nested": "^5.0.6",
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
75
|
+
"semver": "^7.3.7",
|
|
76
|
+
"typescript": "^4.8.3",
|
|
77
|
+
"v-calendar": "3.0.0-alpha.8",
|
|
78
|
+
"vite": "^3.1.3",
|
|
79
|
+
"vitepress": "1.0.0-alpha.15",
|
|
80
|
+
"vitest": "^0.23.4",
|
|
81
|
+
"vue": "^3.2.39",
|
|
82
|
+
"vue-router": "^4.1.5",
|
|
83
|
+
"vue-tsc": "^0.40.13"
|
|
84
|
+
},
|
|
85
|
+
"scripts": {
|
|
86
|
+
"docs": "vitepress dev docs --port 3000",
|
|
87
|
+
"docs:build": "vitepress build docs",
|
|
88
|
+
"docs:preview": "vitepress serve docs --port 3000",
|
|
89
|
+
"story": "histoire dev --port 3000",
|
|
90
|
+
"story:build": "histoire build",
|
|
91
|
+
"story:preview": "histoire preview --port 3000",
|
|
92
|
+
"type": "vue-tsc --noEmit",
|
|
93
|
+
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix './{lib,tests}/**/*.{ts,vue}'",
|
|
94
|
+
"lint:fail": "eslint --ext .js,.vue --ignore-path .gitignore './{lib,tests}/**/*.{ts,vue}'",
|
|
95
|
+
"vitest": "vitest",
|
|
96
|
+
"coverage": "vitest run --coverage",
|
|
97
|
+
"test": "pnpm run type && pnpm run lint && pnpm run coverage",
|
|
98
|
+
"test:fail": "pnpm run type && pnpm run lint:fail && pnpm run coverage",
|
|
99
|
+
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
100
|
+
"release": "node scripts/release.js"
|
|
82
101
|
}
|
|
83
|
-
}
|
|
102
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# [2.0.0-draft.7](https://github.com/globalbrain/sefirot/compare/v2.0.0-draft.6...v2.0.0-draft.7) (2022-02-21)
|
|
2
|
-
|
|
3
|
-
### Bug Fixes
|
|
4
|
-
|
|
5
|
-
* **validation:** vuelidate import ([1c2e547](https://github.com/globalbrain/sefirot/commit/1c2e547d2ef5fa31ab36ba65882c54085cc4a991))
|
|
6
|
-
|
|
7
|
-
# [2.0.0-draft.6](https://github.com/globalbrain/sefirot/compare/v2.0.0-draft.5...v2.0.0-draft.6) (2022-02-21)
|
|
8
|
-
|
|
9
|
-
### Features
|
|
10
|
-
|
|
11
|
-
* **input-select:** add SInputSelect component ([1d0608e](https://github.com/globalbrain/sefirot/commit/1d0608e8aaa3f7007bb4aff18255ce2b528a7d76))
|
|
12
|
-
* **validation:** add custom error message support ([acb0894](https://github.com/globalbrain/sefirot/commit/acb0894ec5fdcc052100e3623525fbf030854a2f))
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
# [2.0.0-draft.5](https://github.com/globalbrain/sefirot/compare/v2.0.0-draft.4...v2.0.0-draft.5) (2022-02-16)
|
|
16
|
-
|
|
17
|
-
### Features
|
|
18
|
-
|
|
19
|
-
* **icon:** add a mail icon ([#115](https://github.com/globalbrain/sefirot/issues/115)) ([b3c24a7](https://github.com/globalbrain/sefirot/commit/b3c24a7602936fcba3fdc5ea51a8600adb15ec2c))
|
|
20
|
-
|
|
21
|
-
# [2.0.0-draft.4](https://github.com/globalbrain/sefirot/compare/v2.0.0-draft.3...v2.0.0-draft.4) (2021-12-22)
|
|
22
|
-
|
|
23
|
-
### Features
|
|
24
|
-
|
|
25
|
-
* refactor modals ([36d0d1e](https://github.com/globalbrain/sefirot/commit/36d0d1e7747935aff4d909d4023751002875d6c8))
|
|
26
|
-
|
|
27
|
-
# [2.0.0-draft.3](https://github.com/globalbrain/sefirot/compare/v2.0.0-draft.2...v2.0.0-draft.3) (2021-12-17)
|
|
28
|
-
|
|
29
|
-
### Features
|
|
30
|
-
|
|
31
|
-
* **input-text:** emit "enter" and "blur" event ([a7b2b38](https://github.com/globalbrain/sefirot/commit/a7b2b38dc5f4880e7b680601be6e607d9b180c68))
|
|
32
|
-
|
|
33
|
-
# [2.0.0-draft.2](https://github.com/globalbrain/sefirot/compare/v2.0.0-draft.1...v2.0.0-draft.2) (2021-12-14)
|
|
34
|
-
|
|
35
|
-
### Bug Fixes
|
|
36
|
-
|
|
37
|
-
* **input-number:** emit null when empty is input ([#111](https://github.com/globalbrain/sefirot/issues/111)) ([d417960](https://github.com/globalbrain/sefirot/commit/d417960884b5c3b09c793058b80fcbc17351ecd3))
|
|
38
|
-
|
|
39
|
-
# [2.0.0-draft.1](https://github.com/globalbrain/sefirot/compare/v0.71.0...v2.0.0-draft.1) (2021-12-13)
|
|
40
|
-
|
|
41
|
-
Initial release.
|