@fastkit/vui 0.6.36 → 0.6.40
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/dist/tool/index.js +3 -0
- package/dist/tool/vite-plugin.d.ts.map +1 -1
- package/dist/vui.cjs.js +214 -19
- package/dist/vui.cjs.prod.js +214 -19
- package/dist/vui.css +69 -17
- package/dist/vui.d.ts +3609 -17
- package/dist/vui.esm-bundler.js +214 -21
- package/dist/vui.min.css +1 -1
- package/dist/vui.min.css.map +1 -1
- package/package.json +8 -7
- package/src/.DS_Store +0 -0
- package/src/assets/.DS_Store +0 -0
- package/src/assets/builtins/color-scheme.ts +9 -0
- package/src/assets/builtins/media-match.ts +3 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/VAccordion/VAccordion.scss +2 -0
- package/src/components/VAccordion/VAccordion.tsx +5 -0
- package/src/components/VAccordion/index.ts +1 -0
- package/src/components/VApp/VApp.tsx +17 -0
- package/src/components/VApp/index.ts +1 -0
- package/src/components/VBreadcrumbs/VBreadcrumbs.scss +61 -0
- package/src/components/VBreadcrumbs/VBreadcrumbs.tsx +137 -0
- package/src/components/VBreadcrumbs/index.ts +1 -0
- package/src/components/VButton/.DS_Store +0 -0
- package/src/components/VButton/VButton.scss +137 -0
- package/src/components/VButton/VButton.tsx +148 -0
- package/src/components/VButton/VButtonGroup.scss +23 -0
- package/src/components/VButton/VButtonGroup.tsx +81 -0
- package/src/components/VButton/index.ts +2 -0
- package/src/components/VCard/VCard.scss +3 -0
- package/src/components/VCard/VCard.tsx +20 -0
- package/src/components/VCard/VCardActions.scss +10 -0
- package/src/components/VCard/VCardActions.tsx +16 -0
- package/src/components/VCard/VCardContent.scss +3 -0
- package/src/components/VCard/VCardContent.tsx +16 -0
- package/src/components/VCard/index.ts +3 -0
- package/src/components/VCheckable/VCheckable.scss +103 -0
- package/src/components/VCheckable/VCheckable.tsx +60 -0
- package/src/components/VCheckable/index.ts +1 -0
- package/src/components/VCheckbox/VCheckbox.scss +56 -0
- package/src/components/VCheckbox/VCheckbox.tsx +63 -0
- package/src/components/VCheckbox/index.ts +1 -0
- package/src/components/VCheckboxGroup/.DS_Store +0 -0
- package/src/components/VCheckboxGroup/VCheckboxGroup.tsx +11 -0
- package/src/components/VCheckboxGroup/index.ts +1 -0
- package/src/components/VContentSwitcher/VContentSwitcher.scss +73 -0
- package/src/components/VContentSwitcher/VContentSwitcher.tsx +156 -0
- package/src/components/VContentSwitcher/index.ts +1 -0
- package/src/components/VControlField/VControlField.scss +183 -0
- package/src/components/VControlField/VControlField.tsx +152 -0
- package/src/components/VControlField/index.ts +1 -0
- package/src/components/VDataTable/VDataTable.scss +230 -0
- package/src/components/VDataTable/VDataTable.tsx +761 -0
- package/src/components/VDataTable/index.ts +1 -0
- package/src/components/VDrawerLayout/VDrawerLayout.scss +26 -0
- package/src/components/VDrawerLayout/VDrawerLayout.tsx +35 -0
- package/src/components/VDrawerLayout/index.ts +1 -0
- package/src/components/VForm/VForm.tsx +77 -0
- package/src/components/VForm/index.ts +1 -0
- package/src/components/VFormControl/VFormControl.scss +59 -0
- package/src/components/VFormControl/VFormControl.tsx +85 -0
- package/src/components/VFormControl/index.ts +1 -0
- package/src/components/VGrid/VGridContainer.scss +4 -0
- package/src/components/VGrid/VGridContainer.tsx +191 -0
- package/src/components/VGrid/VGridItem.scss +3 -0
- package/src/components/VGrid/VGridItem.tsx +110 -0
- package/src/components/VGrid/index.ts +2 -0
- package/src/components/VGrid/schemes.ts +28 -0
- package/src/components/VHero/.DS_Store +0 -0
- package/src/components/VHero/VHero.scss +26 -0
- package/src/components/VHero/VHero.tsx +52 -0
- package/src/components/VHero/index.ts +1 -0
- package/src/components/VIcon/VIcon.scss +22 -0
- package/src/components/VIcon/VIcon.tsx +110 -0
- package/src/components/VIcon/index.ts +1 -0
- package/src/components/VListTile/VListTile.scss +71 -0
- package/src/components/VListTile/VListTile.tsx +121 -0
- package/src/components/VListTile/index.ts +1 -0
- package/src/components/VNavigation/VNavigation.scss +12 -0
- package/src/components/VNavigation/VNavigation.tsx +79 -0
- package/src/components/VNavigation/VNavigationItem.scss +14 -0
- package/src/components/VNavigation/VNavigationItem.tsx +252 -0
- package/src/components/VNavigation/index.ts +2 -0
- package/src/components/VOption/VOption.scss +61 -0
- package/src/components/VOption/VOption.tsx +52 -0
- package/src/components/VOption/index.ts +1 -0
- package/src/components/VOptionGroup/VOptionGroup.scss +3 -0
- package/src/components/VOptionGroup/VOptionGroup.tsx +55 -0
- package/src/components/VOptionGroup/index.ts +1 -0
- package/src/components/VPagination/VPagination.scss +100 -0
- package/src/components/VPagination/VPagination.tsx +346 -0
- package/src/components/VPagination/index.ts +1 -0
- package/src/components/VPaper/VPaper.scss +37 -0
- package/src/components/VPaper/VPaper.tsx +78 -0
- package/src/components/VPaper/index.ts +1 -0
- package/src/components/VRadio/.DS_Store +0 -0
- package/src/components/VRadio/VRadio.scss +66 -0
- package/src/components/VRadio/VRadio.tsx +56 -0
- package/src/components/VRadio/index.ts +1 -0
- package/src/components/VRadioGroup/.DS_Store +0 -0
- package/src/components/VRadioGroup/VRadioGroup.tsx +10 -0
- package/src/components/VRadioGroup/index.ts +1 -0
- package/src/components/VSelect/VSelect.scss +78 -0
- package/src/components/VSelect/VSelect.tsx +204 -0
- package/src/components/VSelect/index.ts +1 -0
- package/src/components/VSwitch/VSwitch.scss +125 -0
- package/src/components/VSwitch/VSwitch.tsx +66 -0
- package/src/components/VSwitch/index.ts +1 -0
- package/src/components/VSwitchGroup/.DS_Store +0 -0
- package/src/components/VSwitchGroup/VSwitchGroup.tsx +11 -0
- package/src/components/VSwitchGroup/index.ts +1 -0
- package/src/components/VTabs/.DS_Store +0 -0
- package/src/components/VTabs/VTab.scss +73 -0
- package/src/components/VTabs/VTab.tsx +88 -0
- package/src/components/VTabs/VTabs.scss +49 -0
- package/src/components/VTabs/VTabs.tsx +315 -0
- package/src/components/VTabs/index.ts +1 -0
- package/src/components/VTextCounter/VTextCounter.scss +3 -0
- package/src/components/VTextCounter/VTextCounter.tsx +21 -0
- package/src/components/VTextCounter/index.ts +1 -0
- package/src/components/VTextField/VTextField.scss +45 -0
- package/src/components/VTextField/VTextField.tsx +96 -0
- package/src/components/VTextField/index.ts +1 -0
- package/src/components/VTextarea/VTextarea.scss +41 -0
- package/src/components/VTextarea/VTextarea.tsx +93 -0
- package/src/components/VTextarea/index.ts +1 -0
- package/src/components/VToolbar/.DS_Store +0 -0
- package/src/components/VToolbar/VToolbar.scss +26 -0
- package/src/components/VToolbar/VToolbar.tsx +44 -0
- package/src/components/VToolbar/VToolbarEdge.scss +27 -0
- package/src/components/VToolbar/VToolbarEdge.tsx +35 -0
- package/src/components/VToolbar/VToolbarMenu.scss +7 -0
- package/src/components/VToolbar/VToolbarMenu.tsx +26 -0
- package/src/components/VToolbar/VToolbarTitle.scss +22 -0
- package/src/components/VToolbar/VToolbarTitle.tsx +25 -0
- package/src/components/VToolbar/index.ts +4 -0
- package/src/components/VWysiwygEditor/.DS_Store +0 -0
- package/src/components/VWysiwygEditor/VWysiwygEditor.scss +60 -0
- package/src/components/VWysiwygEditor/VWysiwygEditor.tsx +293 -0
- package/src/components/VWysiwygEditor/index.ts +2 -0
- package/src/components/VWysiwygEditor/schemes.ts +65 -0
- package/src/components/VWysiwygEditor/tools/bullet-list.ts +18 -0
- package/src/components/VWysiwygEditor/tools/format-bold.ts +19 -0
- package/src/components/VWysiwygEditor/tools/format-italic.ts +18 -0
- package/src/components/VWysiwygEditor/tools/format-underline.ts +18 -0
- package/src/components/VWysiwygEditor/tools/history.ts +26 -0
- package/src/components/VWysiwygEditor/tools/index.ts +8 -0
- package/src/components/VWysiwygEditor/tools/link.ts +57 -0
- package/src/components/VWysiwygEditor/tools/ordered-list.ts +21 -0
- package/src/components/VWysiwygEditor/tools/text-color.ts +14 -0
- package/src/components/index.ts +32 -0
- package/src/components/kits.ts +1 -0
- package/src/components/loading.ts +1 -0
- package/src/composables/.DS_Store +0 -0
- package/src/composables/control.ts +118 -0
- package/src/composables/elevation.ts +34 -0
- package/src/composables/form-selector.scss +11 -0
- package/src/composables/form-selector.tsx +101 -0
- package/src/composables/index.ts +4 -0
- package/src/composables/vui.ts +9 -0
- package/src/index.ts +10 -0
- package/src/injections.ts +61 -0
- package/src/logger.ts +7 -0
- package/src/plugin.tsx +76 -0
- package/src/schemes/control.ts +7 -0
- package/src/schemes/elevation.ts +26 -0
- package/src/schemes/index.ts +2 -0
- package/src/service.tsx +242 -0
- package/src/styles/.DS_Store +0 -0
- package/src/styles/after-effects/display-flow.scss +346 -0
- package/src/styles/after-effects/spacing.scss +155 -0
- package/src/styles/after-effects/text.scss +90 -0
- package/src/styles/after-effects.scss +3 -0
- package/src/styles/base.scss +14 -0
- package/src/styles/control.scss +11 -0
- package/src/styles/core/functions.scss +62 -0
- package/src/styles/core/typo.scss +56 -0
- package/src/styles/core.scss +2 -0
- package/src/styles/elevation.scss +9 -0
- package/src/styles/group.scss +57 -0
- package/src/styles/index.scss +9 -0
- package/src/styles/transition.scss +11 -0
- package/src/styles/typo.scss +11 -0
- package/src/styles/variables.scss +320 -0
- package/src/styles/wysiwyg.scss +24 -0
- package/src/tool/.DS_Store +0 -0
- package/src/tool/index.ts +2 -0
- package/src/tool/vite-plugin.ts +281 -0
package/src/service.tsx
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
export { VuiInjectionKey } from './injections';
|
|
2
|
+
|
|
3
|
+
import { VNodeChild } from 'vue';
|
|
4
|
+
import { ScopeName, ColorVariant } from '@fastkit/color-scheme';
|
|
5
|
+
import type { IconName, RawIconProp } from './components/VIcon';
|
|
6
|
+
import {
|
|
7
|
+
type VueColorSchemePluginSettings,
|
|
8
|
+
type VueStackService,
|
|
9
|
+
type VDialogProps,
|
|
10
|
+
resolveVStackDynamicInput,
|
|
11
|
+
} from '@fastkit/vue-kit';
|
|
12
|
+
import type { Router } from 'vue-router';
|
|
13
|
+
import { RouterLink } from 'vue-router';
|
|
14
|
+
import { LocationService, setDefaultRouterLink } from '@fastkit/vue-utils';
|
|
15
|
+
import { VForm } from './components/VForm';
|
|
16
|
+
import { VTextField, TextFieldInput } from './components/VTextField';
|
|
17
|
+
import { VueForm } from '@fastkit/vue-form-control';
|
|
18
|
+
import { getDocumentScroller } from '@fastkit/vue-scroller';
|
|
19
|
+
|
|
20
|
+
export interface VuiPromptOptions extends Partial<VDialogProps> {
|
|
21
|
+
input?: Omit<TextFieldInput, 'modelValue'> & { initialValue?: string };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type RawVuiPromptOptions = string | VuiPromptOptions;
|
|
25
|
+
|
|
26
|
+
const DEFAULT_AUTO_SCROLL_TO_ELEMENT_OFFSET_TOP = -20;
|
|
27
|
+
const DEFAULT_TEXTAREA_ROWS = 3;
|
|
28
|
+
|
|
29
|
+
export interface VuiServiceUISettings {
|
|
30
|
+
primaryScope: ScopeName;
|
|
31
|
+
plainVariant: ColorVariant;
|
|
32
|
+
containedVariant: ColorVariant;
|
|
33
|
+
errorScope: ScopeName;
|
|
34
|
+
buttonDefault: {
|
|
35
|
+
color: ScopeName;
|
|
36
|
+
variant: ColorVariant;
|
|
37
|
+
};
|
|
38
|
+
tabDefault: {
|
|
39
|
+
color: ScopeName;
|
|
40
|
+
};
|
|
41
|
+
dialogOk?: {
|
|
42
|
+
color?: ScopeName;
|
|
43
|
+
variant?: ColorVariant;
|
|
44
|
+
};
|
|
45
|
+
dialogCancel?: {
|
|
46
|
+
color?: ScopeName;
|
|
47
|
+
variant?: ColorVariant;
|
|
48
|
+
};
|
|
49
|
+
dialogClose?: {
|
|
50
|
+
color?: ScopeName;
|
|
51
|
+
variant?: ColorVariant;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface VuiServiceIconSettings {
|
|
56
|
+
menuDown: IconName;
|
|
57
|
+
navigationExpand: RawIconProp;
|
|
58
|
+
prev: RawIconProp;
|
|
59
|
+
next: RawIconProp;
|
|
60
|
+
sort: RawIconProp;
|
|
61
|
+
editorTextColor: IconName;
|
|
62
|
+
editorformatBold: IconName;
|
|
63
|
+
editorformatUnderline: IconName;
|
|
64
|
+
editorformatItalic: IconName;
|
|
65
|
+
editorformatListBulleted: IconName;
|
|
66
|
+
editorformatListNumbered: IconName;
|
|
67
|
+
editorLink: IconName;
|
|
68
|
+
editorLinkOff: IconName;
|
|
69
|
+
editorUndo: IconName;
|
|
70
|
+
editorRedo: IconName;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type VuiVNodeResolver = () => VNodeChild;
|
|
74
|
+
|
|
75
|
+
export interface VuiServiceOptions {
|
|
76
|
+
router: Router;
|
|
77
|
+
RouterLink?: typeof RouterLink;
|
|
78
|
+
colorScheme: VueColorSchemePluginSettings;
|
|
79
|
+
uiSettings: VuiServiceUISettings;
|
|
80
|
+
icons: VuiServiceIconSettings;
|
|
81
|
+
selectionSeparator?: VuiVNodeResolver;
|
|
82
|
+
autoScrollToElementOffsetTop?: number | (() => number | undefined);
|
|
83
|
+
textareaRows?: number;
|
|
84
|
+
requiredChip?: VuiVNodeResolver;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export class VuiService {
|
|
88
|
+
readonly options: VuiServiceOptions;
|
|
89
|
+
|
|
90
|
+
readonly selectionSeparator: VuiVNodeResolver;
|
|
91
|
+
readonly autoScrollToElementOffsetTop?: number | (() => number | undefined);
|
|
92
|
+
readonly textareaRows?: number;
|
|
93
|
+
readonly requiredChip?: VuiVNodeResolver;
|
|
94
|
+
readonly router: Router;
|
|
95
|
+
readonly location: LocationService;
|
|
96
|
+
readonly stack: VueStackService;
|
|
97
|
+
|
|
98
|
+
get scroller() {
|
|
99
|
+
return getDocumentScroller();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
constructor(options: VuiServiceOptions, stackService: VueStackService) {
|
|
103
|
+
this.options = options;
|
|
104
|
+
this.configure();
|
|
105
|
+
|
|
106
|
+
const {
|
|
107
|
+
selectionSeparator = () => ', ',
|
|
108
|
+
autoScrollToElementOffsetTop = DEFAULT_AUTO_SCROLL_TO_ELEMENT_OFFSET_TOP,
|
|
109
|
+
textareaRows = DEFAULT_TEXTAREA_ROWS,
|
|
110
|
+
requiredChip = () => '*',
|
|
111
|
+
} = options;
|
|
112
|
+
this.selectionSeparator = selectionSeparator;
|
|
113
|
+
this.autoScrollToElementOffsetTop = autoScrollToElementOffsetTop;
|
|
114
|
+
this.textareaRows = textareaRows;
|
|
115
|
+
this.requiredChip = requiredChip;
|
|
116
|
+
this.router = options.router;
|
|
117
|
+
this.location = new LocationService({
|
|
118
|
+
router: this.router,
|
|
119
|
+
});
|
|
120
|
+
this.stack = stackService;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
configure(options?: Partial<VuiServiceOptions>) {
|
|
124
|
+
options && Object.assign(this.options, options);
|
|
125
|
+
setDefaultRouterLink(this.getRouterLink());
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
getRouterLink() {
|
|
129
|
+
return this.options.RouterLink || RouterLink;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
setting<K extends keyof VuiServiceUISettings>(
|
|
133
|
+
key: K,
|
|
134
|
+
): VuiServiceUISettings[K] {
|
|
135
|
+
return this.options.uiSettings[key] as VuiServiceUISettings[K];
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
icon<K extends keyof VuiServiceIconSettings>(
|
|
139
|
+
iconType: K,
|
|
140
|
+
): VuiServiceIconSettings[K] {
|
|
141
|
+
return this.options.icons[iconType] as VuiServiceIconSettings[K];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
getAutoScrollToElementOffsetTop() {
|
|
145
|
+
let { autoScrollToElementOffsetTop } = this;
|
|
146
|
+
if (typeof autoScrollToElementOffsetTop === 'function') {
|
|
147
|
+
autoScrollToElementOffsetTop = autoScrollToElementOffsetTop();
|
|
148
|
+
}
|
|
149
|
+
return autoScrollToElementOffsetTop || 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
getRequiredChip() {
|
|
153
|
+
const { requiredChip } = this;
|
|
154
|
+
return requiredChip && requiredChip();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
dialog(...args: Parameters<VueStackService['dialog']>) {
|
|
158
|
+
return this.stack.dialog(...args);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
alert(...args: Parameters<VueStackService['alert']>) {
|
|
162
|
+
return this.stack.alert(...args);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
confirm(...args: Parameters<VueStackService['confirm']>) {
|
|
166
|
+
return this.stack.confirm(...args);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
snackbar(...args: Parameters<VueStackService['snackbar']>) {
|
|
170
|
+
return this.stack.snackbar(...args);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
prompt(rawOptions: RawVuiPromptOptions = {}) {
|
|
174
|
+
const options: VuiPromptOptions =
|
|
175
|
+
typeof rawOptions === 'string'
|
|
176
|
+
? {
|
|
177
|
+
input: {
|
|
178
|
+
label: rawOptions,
|
|
179
|
+
},
|
|
180
|
+
}
|
|
181
|
+
: {
|
|
182
|
+
...rawOptions,
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
options.input = {
|
|
186
|
+
...options.input,
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
options.dense = true;
|
|
190
|
+
|
|
191
|
+
let { initialValue: value = '' } = options.input;
|
|
192
|
+
const { size } = options.input;
|
|
193
|
+
|
|
194
|
+
delete options.input.initialValue;
|
|
195
|
+
|
|
196
|
+
let form: VueForm | undefined;
|
|
197
|
+
|
|
198
|
+
options.actions = options.actions || [
|
|
199
|
+
this.stack.action('cancel', undefined, { size }),
|
|
200
|
+
this.stack.action('ok', undefined, {
|
|
201
|
+
size,
|
|
202
|
+
onClick: () => {
|
|
203
|
+
if (form) {
|
|
204
|
+
const ev = new Event('submit');
|
|
205
|
+
form.handleSubmit(ev);
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
}),
|
|
209
|
+
];
|
|
210
|
+
|
|
211
|
+
const resolved = resolveVStackDynamicInput({
|
|
212
|
+
...options,
|
|
213
|
+
content: (stack) => {
|
|
214
|
+
return (
|
|
215
|
+
<VForm
|
|
216
|
+
disableAutoScroll
|
|
217
|
+
size={size}
|
|
218
|
+
onVnodeMounted={(vnode) => {
|
|
219
|
+
form = (vnode.component as any).ctx.form as VueForm;
|
|
220
|
+
}}
|
|
221
|
+
onVnodeBeforeUnmount={() => {
|
|
222
|
+
form = undefined;
|
|
223
|
+
}}
|
|
224
|
+
onSubmit={(ev) => {
|
|
225
|
+
stack.resolve(value);
|
|
226
|
+
}}>
|
|
227
|
+
<VTextField
|
|
228
|
+
{...options.input}
|
|
229
|
+
modelValue={value}
|
|
230
|
+
onChange={(ev) => {
|
|
231
|
+
stack.value = ev;
|
|
232
|
+
value = ev;
|
|
233
|
+
}}
|
|
234
|
+
/>
|
|
235
|
+
</VForm>
|
|
236
|
+
);
|
|
237
|
+
},
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
return this.dialog(resolved);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
$props-map: (
|
|
2
|
+
(
|
|
3
|
+
prop: 'display',
|
|
4
|
+
values: (
|
|
5
|
+
(
|
|
6
|
+
selector: 'inline',
|
|
7
|
+
value: 'inline',
|
|
8
|
+
),
|
|
9
|
+
(
|
|
10
|
+
selector: 'inline-block',
|
|
11
|
+
value: 'inline-block',
|
|
12
|
+
),
|
|
13
|
+
(
|
|
14
|
+
selector: 'block',
|
|
15
|
+
value: 'block',
|
|
16
|
+
),
|
|
17
|
+
(
|
|
18
|
+
selector: 'flex',
|
|
19
|
+
value: 'flex',
|
|
20
|
+
),
|
|
21
|
+
(
|
|
22
|
+
selector: 'inline-flex',
|
|
23
|
+
value: 'inline-flex',
|
|
24
|
+
),
|
|
25
|
+
(
|
|
26
|
+
selector: 'fragment',
|
|
27
|
+
value: 'contents',
|
|
28
|
+
),
|
|
29
|
+
),
|
|
30
|
+
),
|
|
31
|
+
(
|
|
32
|
+
prop: 'flex-direction',
|
|
33
|
+
values: (
|
|
34
|
+
(
|
|
35
|
+
selector: 'direction-row',
|
|
36
|
+
value: 'row',
|
|
37
|
+
),
|
|
38
|
+
(
|
|
39
|
+
selector: 'direction-row-reverse',
|
|
40
|
+
value: 'row-reverse',
|
|
41
|
+
),
|
|
42
|
+
(
|
|
43
|
+
selector: 'direction-column',
|
|
44
|
+
value: 'column',
|
|
45
|
+
),
|
|
46
|
+
(
|
|
47
|
+
selector: 'direction-column-reverse',
|
|
48
|
+
value: 'column-reverse',
|
|
49
|
+
),
|
|
50
|
+
),
|
|
51
|
+
),
|
|
52
|
+
(
|
|
53
|
+
prop: 'flex-wrap',
|
|
54
|
+
values: (
|
|
55
|
+
(
|
|
56
|
+
selector: 'wrap',
|
|
57
|
+
value: 'wrap',
|
|
58
|
+
),
|
|
59
|
+
(
|
|
60
|
+
selector: 'nowrap',
|
|
61
|
+
value: 'nowrap',
|
|
62
|
+
),
|
|
63
|
+
(
|
|
64
|
+
selector: 'wrap-reverse',
|
|
65
|
+
value: 'wrap-reverse',
|
|
66
|
+
),
|
|
67
|
+
),
|
|
68
|
+
),
|
|
69
|
+
(
|
|
70
|
+
prop: 'align-items',
|
|
71
|
+
values: (
|
|
72
|
+
(
|
|
73
|
+
selector: 'align-flex-start',
|
|
74
|
+
value: 'flex-start',
|
|
75
|
+
),
|
|
76
|
+
(
|
|
77
|
+
selector: 'align-flex-end',
|
|
78
|
+
value: 'flex-end',
|
|
79
|
+
),
|
|
80
|
+
(
|
|
81
|
+
selector: 'align-start',
|
|
82
|
+
value: 'start',
|
|
83
|
+
),
|
|
84
|
+
(
|
|
85
|
+
selector: 'align-end',
|
|
86
|
+
value: 'end',
|
|
87
|
+
),
|
|
88
|
+
(
|
|
89
|
+
selector: 'align-stretch',
|
|
90
|
+
value: 'stretch',
|
|
91
|
+
),
|
|
92
|
+
(
|
|
93
|
+
selector: 'align-baseline',
|
|
94
|
+
value: 'baseline',
|
|
95
|
+
),
|
|
96
|
+
(
|
|
97
|
+
selector: 'align-center',
|
|
98
|
+
value: 'center',
|
|
99
|
+
),
|
|
100
|
+
(
|
|
101
|
+
selector: 'align-self-start',
|
|
102
|
+
value: 'self-start',
|
|
103
|
+
),
|
|
104
|
+
(
|
|
105
|
+
selector: 'align-self-end',
|
|
106
|
+
value: 'self-end',
|
|
107
|
+
),
|
|
108
|
+
),
|
|
109
|
+
),
|
|
110
|
+
(
|
|
111
|
+
prop: 'justify-content',
|
|
112
|
+
values: (
|
|
113
|
+
(
|
|
114
|
+
selector: 'justify-start',
|
|
115
|
+
value: 'start',
|
|
116
|
+
),
|
|
117
|
+
(
|
|
118
|
+
selector: 'justify-end',
|
|
119
|
+
value: 'end',
|
|
120
|
+
),
|
|
121
|
+
(
|
|
122
|
+
selector: 'justify-flex-start',
|
|
123
|
+
value: 'flex-start',
|
|
124
|
+
),
|
|
125
|
+
(
|
|
126
|
+
selector: 'justify-flex-end',
|
|
127
|
+
value: 'flex-end',
|
|
128
|
+
),
|
|
129
|
+
(
|
|
130
|
+
selector: 'justify-center',
|
|
131
|
+
value: 'center',
|
|
132
|
+
),
|
|
133
|
+
(
|
|
134
|
+
selector: 'justify-baseline',
|
|
135
|
+
value: 'baseline',
|
|
136
|
+
),
|
|
137
|
+
(
|
|
138
|
+
selector: 'justify-space-between',
|
|
139
|
+
value: 'space-between',
|
|
140
|
+
),
|
|
141
|
+
(
|
|
142
|
+
selector: 'justify-space-around',
|
|
143
|
+
value: 'space-around',
|
|
144
|
+
),
|
|
145
|
+
(
|
|
146
|
+
selector: 'justify-space-evenly',
|
|
147
|
+
value: 'space-evenly',
|
|
148
|
+
),
|
|
149
|
+
(
|
|
150
|
+
selector: 'justify-stretch',
|
|
151
|
+
value: 'stretch',
|
|
152
|
+
),
|
|
153
|
+
),
|
|
154
|
+
),
|
|
155
|
+
(
|
|
156
|
+
prop: 'align-self',
|
|
157
|
+
values: (
|
|
158
|
+
(
|
|
159
|
+
selector: 'self-align-flex-start',
|
|
160
|
+
value: 'flex-start',
|
|
161
|
+
),
|
|
162
|
+
(
|
|
163
|
+
selector: 'self-align-flex-end',
|
|
164
|
+
value: 'flex-end',
|
|
165
|
+
),
|
|
166
|
+
(
|
|
167
|
+
selector: 'self-align-start',
|
|
168
|
+
value: 'start',
|
|
169
|
+
),
|
|
170
|
+
(
|
|
171
|
+
selector: 'self-align-end',
|
|
172
|
+
value: 'end',
|
|
173
|
+
),
|
|
174
|
+
(
|
|
175
|
+
selector: 'self-align-stretch',
|
|
176
|
+
value: 'stretch',
|
|
177
|
+
),
|
|
178
|
+
(
|
|
179
|
+
selector: 'self-align-baseline',
|
|
180
|
+
value: 'baseline',
|
|
181
|
+
),
|
|
182
|
+
(
|
|
183
|
+
selector: 'self-align-center',
|
|
184
|
+
value: 'center',
|
|
185
|
+
),
|
|
186
|
+
(
|
|
187
|
+
selector: 'self-align-self-start',
|
|
188
|
+
value: 'self-start',
|
|
189
|
+
),
|
|
190
|
+
(
|
|
191
|
+
selector: 'self-align-self-end',
|
|
192
|
+
value: 'self-end',
|
|
193
|
+
),
|
|
194
|
+
),
|
|
195
|
+
),
|
|
196
|
+
(
|
|
197
|
+
prop: 'justify-self',
|
|
198
|
+
values: (
|
|
199
|
+
(
|
|
200
|
+
selector: 'self-justify-start',
|
|
201
|
+
value: 'start',
|
|
202
|
+
),
|
|
203
|
+
(
|
|
204
|
+
selector: 'self-justify-end',
|
|
205
|
+
value: 'end',
|
|
206
|
+
),
|
|
207
|
+
(
|
|
208
|
+
selector: 'self-justify-flex-start',
|
|
209
|
+
value: 'flex-start',
|
|
210
|
+
),
|
|
211
|
+
(
|
|
212
|
+
selector: 'self-justify-flex-end',
|
|
213
|
+
value: 'flex-end',
|
|
214
|
+
),
|
|
215
|
+
(
|
|
216
|
+
selector: 'self-justify-center',
|
|
217
|
+
value: 'center',
|
|
218
|
+
),
|
|
219
|
+
(
|
|
220
|
+
selector: 'self-justify-baseline',
|
|
221
|
+
value: 'baseline',
|
|
222
|
+
),
|
|
223
|
+
(
|
|
224
|
+
selector: 'self-justify-stretch',
|
|
225
|
+
value: 'stretch',
|
|
226
|
+
),
|
|
227
|
+
),
|
|
228
|
+
)
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
@mixin grid-spacing($breakpoint-suffix: '', $direction: 'all') {
|
|
232
|
+
$props: if(
|
|
233
|
+
$direction == 'all',
|
|
234
|
+
('top', 'left'),
|
|
235
|
+
if($direction == 'x', ('left'), ('top'))
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
$suffix: if($direction == 'all', '', '-' + $direction);
|
|
239
|
+
|
|
240
|
+
@for $i from 1 through 10 {
|
|
241
|
+
$base-value: if(
|
|
242
|
+
$i == 0,
|
|
243
|
+
0,
|
|
244
|
+
if($i == 1, var(--root-spacing), calc(var(--root-spacing) * #{$i}))
|
|
245
|
+
);
|
|
246
|
+
$half-value: calc(var(--root-spacing) * #{$i + 0.5});
|
|
247
|
+
$negative-base-value: if(
|
|
248
|
+
$i == 1,
|
|
249
|
+
calc(var(--root-spacing) * -1),
|
|
250
|
+
calc(var(--root-spacing) * -#{$i})
|
|
251
|
+
);
|
|
252
|
+
$negative-half-value: calc(var(--root-spacing) * -#{$i + 0.5});
|
|
253
|
+
$container-width: if(
|
|
254
|
+
$i == 0,
|
|
255
|
+
100%,
|
|
256
|
+
if(
|
|
257
|
+
$i == 1,
|
|
258
|
+
calc(100% + var(--root-spacing)),
|
|
259
|
+
calc(100% + (var(--root-spacing) * #{$i}))
|
|
260
|
+
)
|
|
261
|
+
);
|
|
262
|
+
$container-width-half: calc(100% + (var(--root-spacing) * #{$i + 0.5}));
|
|
263
|
+
|
|
264
|
+
.grid-spacing#{$suffix}-#{$i}#{$breakpoint-suffix} {
|
|
265
|
+
@if $direction != 'y' {
|
|
266
|
+
width: $container-width;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
@each $prop in $props {
|
|
270
|
+
margin-#{$prop}: $negative-base-value;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
& > .grid-item {
|
|
274
|
+
@each $prop in $props {
|
|
275
|
+
padding-#{$prop}: $base-value;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.grid-spacing#{$suffix}-#{$i}h#{$breakpoint-suffix} {
|
|
281
|
+
@if $direction != 'y' {
|
|
282
|
+
width: $container-width-half;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
@each $prop in $props {
|
|
286
|
+
margin-#{$prop}: $negative-half-value;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
& > .grid-item {
|
|
290
|
+
@each $prop in $props {
|
|
291
|
+
padding-#{$prop}: $half-value;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
@mixin display-flow($breakpoint-suffix: '') {
|
|
299
|
+
@each $prop-info in $props-map {
|
|
300
|
+
$prop: map-get($prop-info, prop);
|
|
301
|
+
$values: map-get($prop-info, values);
|
|
302
|
+
|
|
303
|
+
@each $value-info in $values {
|
|
304
|
+
$selector: map-get($value-info, selector);
|
|
305
|
+
$value: map-get($value-info, value);
|
|
306
|
+
|
|
307
|
+
.#{$selector}#{$breakpoint-suffix} {
|
|
308
|
+
#{$prop}: unquote($value);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
@for $i from 0 through 10 {
|
|
314
|
+
.order-#{$i}#{$breakpoint-suffix} {
|
|
315
|
+
order: $i;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
$columns-length: 12;
|
|
320
|
+
|
|
321
|
+
@for $i from 1 through $columns-length {
|
|
322
|
+
.grid-size-#{$i}#{$breakpoint-suffix} {
|
|
323
|
+
--basis: calc(#{$i} / #{$columns-length} * 100%);
|
|
324
|
+
|
|
325
|
+
flex-basis: var(--basis);
|
|
326
|
+
flex-grow: 0;
|
|
327
|
+
max-width: var(--basis);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.grid-size-auto#{$breakpoint-suffix} {
|
|
332
|
+
flex-basis: 0;
|
|
333
|
+
flex-grow: 1;
|
|
334
|
+
max-width: 100%;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
@include grid-spacing($breakpoint-suffix);
|
|
338
|
+
@include grid-spacing($breakpoint-suffix, 'x');
|
|
339
|
+
@include grid-spacing($breakpoint-suffix, 'y');
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
@include display-flow();
|
|
343
|
+
|
|
344
|
+
@include mq-each() {
|
|
345
|
+
@include display-flow($breakpoint-suffix: '--' + $mq-each-target);
|
|
346
|
+
}
|