@varlet/ui 2.4.2 → 2.4.3-alpha.1671108240429

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.
@@ -1,8 +1,8 @@
1
1
  import '../../styles/common.css'
2
+ import '../SnackbarSfc.css'
2
3
  import '../../styles/elevation.css'
3
4
  import '../../loading/loading.css'
4
5
  import '../../button/button.css'
5
6
  import '../../icon/icon.css'
6
7
  import '../snackbar.css'
7
8
  import '../coreSfc.css'
8
- import '../SnackbarSfc.css'
package/es/space/Space.js CHANGED
@@ -6,16 +6,11 @@ import { isArray } from '@varlet/shared';
6
6
 
7
7
 
8
8
  import { call, createNamespace } from '../utils/components';
9
+ import { spacePluginOptions } from './context';
9
10
  var {
10
11
  n,
11
12
  classes
12
13
  } = createNamespace('space');
13
- var internalSizes = {
14
- mini: [4, 4],
15
- small: [6, 6],
16
- normal: [8, 12],
17
- large: [12, 20]
18
- };
19
14
  export default defineComponent({
20
15
  name: 'VarSpace',
21
16
  props,
@@ -24,6 +19,11 @@ export default defineComponent({
24
19
  var {
25
20
  slots
26
21
  } = _ref;
22
+ var internalSizes = {};
23
+ Object.keys(spacePluginOptions).forEach(key => {
24
+ var size = spacePluginOptions[key];
25
+ internalSizes[key] = isArray(size) ? size.map(toPxNum) : [toPxNum(size), toPxNum(size)];
26
+ });
27
27
 
28
28
  var getSize = (size, isInternalSize) => {
29
29
  return isInternalSize ? internalSizes[size] : isArray(size) ? size.map(toPxNum) : [toPxNum(size), toPxNum(size)];
@@ -0,0 +1,9 @@
1
+ export var spacePluginOptions = {
2
+ mini: [4, 4],
3
+ small: [6, 6],
4
+ normal: [8, 12],
5
+ large: [12, 20]
6
+ };
7
+ export var mergeSpacePluginOptions = options => {
8
+ Object.assign(spacePluginOptions, options);
9
+ };
package/es/space/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import Space from './Space';
2
+ import { mergeSpacePluginOptions } from './context';
2
3
 
3
- Space.install = function (app) {
4
+ Space.install = function (app, spacePluginOptions) {
5
+ mergeSpacePluginOptions(spacePluginOptions);
4
6
  app.component(Space.name, Space);
5
7
  };
6
8