@varlet/ui 3.2.11-alpha.1716133168406 → 3.2.11

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.
@@ -3,5 +3,5 @@ import '../../icon/icon.css'
3
3
  import '../../ripple/ripple.css'
4
4
  import '../../popup/popup.css'
5
5
  import '../actionSheet.css'
6
- import '../ActionSheetSfc.css'
7
6
  import '../ActionItemSfc.css'
7
+ import '../ActionSheetSfc.css'
@@ -19,7 +19,7 @@ import { defineComponent, ref, computed, onUpdated, watch } from "vue";
19
19
  import { props } from "./props.mjs";
20
20
  import { useBottomNavigationItems } from "./provide.mjs";
21
21
  import { createNamespace } from "../utils/components.mjs";
22
- import { isNumber, normalizeToArray, call } from "@varlet/shared";
22
+ import { isNumber, normalizeToArray, call, getRect } from "@varlet/shared";
23
23
  import { onSmartMounted } from "@varlet/use";
24
24
  const { name, n, classes } = createNamespace("bottom-navigation");
25
25
  const { n: nItem } = createNamespace("bottom-navigation-item");
@@ -29,42 +29,59 @@ const RIGHT_SPACE_CLASS = nItem("--right-space");
29
29
  const defaultFabProps = {
30
30
  type: "primary"
31
31
  };
32
- import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from "vue";
32
+ import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock, Fragment as _Fragment } from "vue";
33
33
  function __render__(_ctx, _cache) {
34
34
  const _component_var_button = _resolveComponent("var-button");
35
35
  return _openBlock(), _createElementBlock(
36
- "div",
37
- {
38
- class: _normalizeClass(
39
- _ctx.classes(
40
- _ctx.n(),
41
- _ctx.n("$--box"),
42
- [_ctx.fixed, _ctx.n("--fixed")],
43
- [_ctx.border, _ctx.n("--border")],
44
- [_ctx.safeArea, _ctx.n("--safe-area")],
45
- [_ctx.variant, _ctx.n("--variant")]
46
- )
47
- ),
48
- ref: "bottomNavigationDom",
49
- style: _normalizeStyle(`z-index:${_ctx.zIndex}`)
50
- },
36
+ _Fragment,
37
+ null,
51
38
  [
52
- _renderSlot(_ctx.$slots, "default"),
53
- _ctx.$slots.fab ? (_openBlock(), _createBlock(_component_var_button, _mergeProps({
54
- key: 0,
55
- class: _ctx.classes(_ctx.n("fab"), [_ctx.length % 2, _ctx.n("--fab-right"), _ctx.n("--fab-center")]),
56
- "var-bottom-navigation__fab": "",
57
- onClick: _ctx.handleFabClick
58
- }, _ctx.fabProps), {
59
- default: _withCtx(() => [
60
- _renderSlot(_ctx.$slots, "fab")
61
- ]),
62
- _: 3
63
- /* FORWARDED */
64
- }, 16, ["class", "onClick"])) : _createCommentVNode("v-if", true)
39
+ _createElementVNode(
40
+ "div",
41
+ _mergeProps({
42
+ class: _ctx.classes(
43
+ _ctx.n(),
44
+ _ctx.n("$--box"),
45
+ [_ctx.fixed, _ctx.n("--fixed")],
46
+ [_ctx.border, _ctx.n("--border")],
47
+ [_ctx.safeArea, _ctx.n("--safe-area")],
48
+ [_ctx.variant, _ctx.n("--variant")]
49
+ ),
50
+ ref: "bottomNavigationDom",
51
+ style: `z-index:${_ctx.zIndex}`
52
+ }, _ctx.$attrs),
53
+ [
54
+ _renderSlot(_ctx.$slots, "default"),
55
+ _ctx.$slots.fab ? (_openBlock(), _createBlock(_component_var_button, _mergeProps({
56
+ key: 0,
57
+ class: _ctx.classes(_ctx.n("fab"), [_ctx.length % 2, _ctx.n("--fab-right"), _ctx.n("--fab-center")]),
58
+ "var-bottom-navigation__fab": "",
59
+ onClick: _ctx.handleFabClick
60
+ }, _ctx.fabProps), {
61
+ default: _withCtx(() => [
62
+ _renderSlot(_ctx.$slots, "fab")
63
+ ]),
64
+ _: 3
65
+ /* FORWARDED */
66
+ }, 16, ["class", "onClick"])) : _createCommentVNode("v-if", true)
67
+ ],
68
+ 16
69
+ /* FULL_PROPS */
70
+ ),
71
+ _ctx.fixed && _ctx.placeholder ? (_openBlock(), _createElementBlock(
72
+ "div",
73
+ {
74
+ key: 0,
75
+ class: _normalizeClass(_ctx.n("placeholder")),
76
+ style: _normalizeStyle({ height: _ctx.placeholderHeight })
77
+ },
78
+ null,
79
+ 6
80
+ /* CLASS, STYLE */
81
+ )) : _createCommentVNode("v-if", true)
65
82
  ],
66
- 6
67
- /* CLASS, STYLE */
83
+ 64
84
+ /* STABLE_FRAGMENT */
68
85
  );
69
86
  }
70
87
  const __sfc__ = defineComponent({
@@ -77,6 +94,7 @@ const __sfc__ = defineComponent({
77
94
  const activeColor = computed(() => props2.activeColor);
78
95
  const inactiveColor = computed(() => props2.inactiveColor);
79
96
  const variant = computed(() => props2.variant);
97
+ const placeholderHeight = ref();
80
98
  const fabProps = ref({});
81
99
  const { length, bottomNavigationItems, bindBottomNavigationItem } = useBottomNavigationItems();
82
100
  const bottomNavigationProvider = {
@@ -96,6 +114,7 @@ const __sfc__ = defineComponent({
96
114
  { immediate: true, deep: true }
97
115
  );
98
116
  onSmartMounted(() => {
117
+ resizePlaceholder();
99
118
  if (!slots.fab) {
100
119
  return;
101
120
  }
@@ -182,10 +201,18 @@ const __sfc__ = defineComponent({
182
201
  function handleFabClick() {
183
202
  call(props2.onFabClick);
184
203
  }
204
+ function resizePlaceholder() {
205
+ if (!props2.fixed || !props2.placeholder) {
206
+ return;
207
+ }
208
+ const { height } = getRect(bottomNavigationDom.value);
209
+ placeholderHeight.value = `${height}px`;
210
+ }
185
211
  return {
186
212
  length,
187
213
  bottomNavigationDom,
188
214
  fabProps,
215
+ placeholderHeight,
189
216
  n,
190
217
  classes,
191
218
  handleFabClick
@@ -14,6 +14,7 @@ const props = {
14
14
  safeArea: Boolean,
15
15
  activeColor: String,
16
16
  inactiveColor: String,
17
+ placeholder: Boolean,
17
18
  fabProps: Object,
18
19
  onChange: defineListenerProp(),
19
20
  onBeforeChange: defineListenerProp(),
@@ -1,13 +1,15 @@
1
1
  import VarFormDetails from "../form-details/index.mjs";
2
+ import CheckboxGroupOption from "./CheckboxGroupOption.mjs";
2
3
  import { defineComponent, computed, watch, nextTick } from "vue";
3
4
  import { props } from "./props.mjs";
4
5
  import { useValidation, createNamespace } from "../utils/components.mjs";
5
6
  import { useCheckboxes } from "./provide.mjs";
6
7
  import { useForm } from "../form/provide.mjs";
7
- import { uniq, call } from "@varlet/shared";
8
+ import { uniq, call, isArray } from "@varlet/shared";
8
9
  const { name, n, classes } = createNamespace("checkbox-group");
9
- import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
10
+ import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, createVNode as _createVNode } from "vue";
10
11
  function __render__(_ctx, _cache) {
12
+ const _component_checkbox_group_option = _resolveComponent("checkbox-group-option");
11
13
  const _component_var_form_details = _resolveComponent("var-form-details");
12
14
  return _openBlock(), _createElementBlock(
13
15
  "div",
@@ -21,6 +23,19 @@ function __render__(_ctx, _cache) {
21
23
  class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n(`--${_ctx.direction}`)))
22
24
  },
23
25
  [
26
+ _ctx.checkboxGroupOptions.length ? (_openBlock(true), _createElementBlock(
27
+ _Fragment,
28
+ { key: 0 },
29
+ _renderList(_ctx.checkboxGroupOptions, (option) => {
30
+ return _openBlock(), _createBlock(_component_checkbox_group_option, {
31
+ key: option.value.toString(),
32
+ checked: _ctx.modelValue.includes(option.value),
33
+ option
34
+ }, null, 8, ["checked", "option"]);
35
+ }),
36
+ 128
37
+ /* KEYED_FRAGMENT */
38
+ )) : _createCommentVNode("v-if", true),
24
39
  _renderSlot(_ctx.$slots, "default")
25
40
  ],
26
41
  2
@@ -34,11 +49,12 @@ function __render__(_ctx, _cache) {
34
49
  }
35
50
  const __sfc__ = defineComponent({
36
51
  name,
37
- components: { VarFormDetails },
52
+ components: { VarFormDetails, CheckboxGroupOption },
38
53
  props,
39
54
  setup(props2) {
40
55
  const max = computed(() => props2.max);
41
56
  const checkedCount = computed(() => props2.modelValue.length);
57
+ const checkboxGroupOptions = computed(() => isArray(props2.options) ? props2.options : []);
42
58
  const { length, checkboxes, bindCheckboxes } = useCheckboxes();
43
59
  const { bindForm } = useForm();
44
60
  const {
@@ -88,7 +104,7 @@ const __sfc__ = defineComponent({
88
104
  change(modelValue.filter((value) => value !== changedValue));
89
105
  }
90
106
  function syncCheckboxes() {
91
- return checkboxes.forEach(({ sync }) => sync(props2.modelValue));
107
+ checkboxes.forEach(({ sync }) => sync(props2.modelValue));
92
108
  }
93
109
  function resetWithAnimation() {
94
110
  checkboxes.forEach((checkbox) => checkbox.resetWithAnimation());
@@ -116,6 +132,7 @@ const __sfc__ = defineComponent({
116
132
  }
117
133
  return {
118
134
  errorMessage,
135
+ checkboxGroupOptions,
119
136
  n,
120
137
  classes,
121
138
  checkAll,
@@ -0,0 +1,28 @@
1
+ import { createVNode as _createVNode } from "vue";
2
+ import { defineComponent } from "vue";
3
+ import Checkbox from "../checkbox/index.mjs";
4
+ import { isFunction } from "@varlet/shared";
5
+
6
+ var stdin_default = defineComponent({
7
+ name: "CheckboxGroupOption",
8
+ props: {
9
+ checked: Boolean,
10
+ option: Object
11
+ },
12
+ setup(props) {
13
+ return () => {
14
+ if (props.option == null) {
15
+ return;
16
+ }
17
+ return _createVNode(Checkbox, {
18
+ "checkedValue": props.option.value,
19
+ "disabled": props.option.disabled
20
+ }, {
21
+ default: () => [isFunction(props.option.label) ? props.option.label(props.option, props.checked) : props.option.label]
22
+ });
23
+ };
24
+ }
25
+ });
26
+ export {
27
+ stdin_default as default
28
+ };
@@ -5,6 +5,7 @@ const props = {
5
5
  default: () => []
6
6
  },
7
7
  max: [String, Number],
8
+ options: Array,
8
9
  direction: {
9
10
  type: String,
10
11
  default: "horizontal"
@@ -1,3 +1,4 @@
1
+ import '../../checkbox/checkbox.css'
1
2
  import '../../styles/common.css'
2
3
  import '../../form-details/formDetails.css'
3
4
  import '../checkboxGroup.css'
@@ -262,7 +262,7 @@ import './tooltip/style/index.mjs'
262
262
  import './uploader/style/index.mjs'
263
263
  import './watermark/style/index.mjs'
264
264
 
265
- const version = '3.2.11-alpha.1716133168406'
265
+ const version = '3.2.11'
266
266
 
267
267
  function install(app) {
268
268
  ActionSheet.install && app.use(ActionSheet)
package/es/index.mjs CHANGED
@@ -174,7 +174,7 @@ export * from './tooltip/index.mjs'
174
174
  export * from './uploader/index.mjs'
175
175
  export * from './watermark/index.mjs'
176
176
 
177
- const version = '3.2.11-alpha.1716133168406'
177
+ const version = '3.2.11'
178
178
 
179
179
  function install(app) {
180
180
  ActionSheet.install && app.use(ActionSheet)
@@ -1,7 +1,7 @@
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 '../../icon/icon.css'
5
6
  import '../snackbar.css'
6
7
  import '../coreSfc.css'
7
- import '../SnackbarSfc.css'