@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,70 +0,0 @@
|
|
|
1
|
-
import { ActionTree, ActionContext, MutationTree } from 'vuex'
|
|
2
|
-
|
|
3
|
-
let nextId: number = 0
|
|
4
|
-
|
|
5
|
-
const maxItemSize: number = 4
|
|
6
|
-
|
|
7
|
-
export interface State {
|
|
8
|
-
items: SnackbarWithId[]
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface Snackbar {
|
|
12
|
-
text: string
|
|
13
|
-
timeout?: number
|
|
14
|
-
actions?: Action[]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface SnackbarWithId extends Snackbar {
|
|
18
|
-
id: number
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface Action {
|
|
22
|
-
type: 'primary' | 'secondary' | 'tertiary' | 'text' | 'mute'
|
|
23
|
-
label: string
|
|
24
|
-
callback: Function
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function state(): State {
|
|
28
|
-
return {
|
|
29
|
-
items: []
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const actions: ActionTree<State, any> = {
|
|
34
|
-
push(context: ActionContext<State, any>, payload: Snackbar): void {
|
|
35
|
-
const id = nextId++
|
|
36
|
-
|
|
37
|
-
context.commit('push', {
|
|
38
|
-
id,
|
|
39
|
-
text: payload.text,
|
|
40
|
-
actions: payload.actions
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
setTimeout(() => { context.commit('pop', id) }, payload.timeout ?? 10000)
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
pop(context: ActionContext<State, any>, id: number): void {
|
|
47
|
-
context.commit('pop', id)
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export const mutations: MutationTree<State> = {
|
|
52
|
-
push(state: State, item: SnackbarWithId): void {
|
|
53
|
-
if (state.items.length > maxItemSize) {
|
|
54
|
-
state.items.shift()
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
state.items.push(item)
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
pop(state: State, id: number): void {
|
|
61
|
-
state.items = state.items.filter(item => item.id !== id)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export default {
|
|
66
|
-
namespaced: true,
|
|
67
|
-
state,
|
|
68
|
-
actions,
|
|
69
|
-
mutations
|
|
70
|
-
}
|