sard-uniapp 1.13.3 → 1.14.1

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.
Files changed (81) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/components/accordion/variables.scss +2 -1
  3. package/components/action-sheet/variables.scss +2 -1
  4. package/components/alert/variables.scss +2 -1
  5. package/components/avatar/variables.scss +2 -1
  6. package/components/back-top/variables.scss +2 -1
  7. package/components/badge/variables.scss +2 -1
  8. package/components/button/variables.scss +2 -1
  9. package/components/calendar/variables.scss +2 -1
  10. package/components/card/variables.scss +2 -1
  11. package/components/cascader/cascader.vue +12 -17
  12. package/components/cascader/common.d.ts +1 -0
  13. package/components/cascader/variables.scss +2 -1
  14. package/components/cascader-input/cascader-input.vue +11 -6
  15. package/components/check-icon/variables.scss +2 -1
  16. package/components/checkbox/variables.scss +2 -1
  17. package/components/checkbox-input/variables.scss +2 -1
  18. package/components/collapse/variables.scss +2 -1
  19. package/components/datetime-range-picker/variables.scss +2 -1
  20. package/components/dialog/common.d.ts +2 -0
  21. package/components/dialog/dialog.vue +11 -2
  22. package/components/dialog/variables.scss +2 -1
  23. package/components/dialog-agent/dialog-agent.vue +2 -0
  24. package/components/divider/variables.scss +2 -1
  25. package/components/dropdown/variables.scss +2 -1
  26. package/components/empty/variables.scss +2 -1
  27. package/components/fab/variables.scss +2 -1
  28. package/components/floating-bubble/variables.scss +2 -1
  29. package/components/floating-panel/variables.scss +2 -1
  30. package/components/form/variables.scss +2 -1
  31. package/components/grid/variables.scss +2 -1
  32. package/components/indexes/variables.scss +2 -1
  33. package/components/input/index.scss +1 -0
  34. package/components/input/variables.scss +2 -1
  35. package/components/keyboard/variables.scss +2 -1
  36. package/components/list/variables.scss +2 -1
  37. package/components/load-more/variables.scss +2 -1
  38. package/components/loading/variables.scss +2 -1
  39. package/components/menu/variables.scss +2 -1
  40. package/components/navbar/variables.scss +2 -1
  41. package/components/notice-bar/variables.scss +2 -1
  42. package/components/notify/variables.scss +2 -1
  43. package/components/overlay/variables.scss +2 -1
  44. package/components/pagination/variables.scss +2 -1
  45. package/components/password-input/variables.scss +2 -1
  46. package/components/picker/variables.scss +2 -1
  47. package/components/popout/variables.scss +2 -1
  48. package/components/popout-input/variables.scss +2 -1
  49. package/components/popover/variables.scss +2 -1
  50. package/components/popup/popup.vue +32 -18
  51. package/components/popup/variables.scss +2 -1
  52. package/components/progress-bar/variables.scss +2 -1
  53. package/components/progress-circle/variables.scss +2 -1
  54. package/components/pull-down-refresh/variables.scss +2 -1
  55. package/components/qrcode/variables.scss +1 -1
  56. package/components/radio/variables.scss +2 -1
  57. package/components/radio-input/variables.scss +2 -1
  58. package/components/rate/variables.scss +2 -1
  59. package/components/result/variables.scss +2 -1
  60. package/components/search/variables.scss +2 -1
  61. package/components/share-sheet/variables.scss +2 -1
  62. package/components/sidebar/variables.scss +2 -1
  63. package/components/signature/variables.scss +2 -1
  64. package/components/skeleton/variables.scss +2 -1
  65. package/components/slider/variables.scss +2 -1
  66. package/components/space/variables.scss +2 -1
  67. package/components/stepper/variables.scss +2 -1
  68. package/components/steps/variables.scss +2 -1
  69. package/components/style/mixins/theme-dark.scss +4 -2
  70. package/components/style/variables.scss +2 -1
  71. package/components/swiper-dot/variables.scss +2 -1
  72. package/components/switch/variables.scss +2 -1
  73. package/components/tabbar/variables.scss +2 -1
  74. package/components/table/variables.scss +2 -1
  75. package/components/tabs/variables.scss +2 -1
  76. package/components/tag/variables.scss +2 -1
  77. package/components/timeline/variables.scss +2 -1
  78. package/components/toast/variables.scss +2 -1
  79. package/components/tree/variables.scss +2 -1
  80. package/components/upload/variables.scss +2 -1
  81. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## [1.14.1](https://github.com/sutras/sard-uniapp/compare/v1.14.0...v1.14.1) (2025-05-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * 修复 popup 组件 transform+fixed 渲染问题 ([5d0bf10](https://github.com/sutras/sard-uniapp/commit/5d0bf106df39e9c48c84bd7f76c71bb9306070c9))
7
+
8
+
9
+
10
+ # [1.14.0](https://github.com/sutras/sard-uniapp/compare/v1.13.3...v1.14.0) (2025-05-12)
11
+
12
+
13
+ ### Features
14
+
15
+ * cascader 新增 change-on-select 属性 ([71c1329](https://github.com/sutras/sard-uniapp/commit/71c13291780eea13ac7c198ae31a39e0dc49d531))
16
+
17
+
18
+
1
19
  ## [1.13.3](https://github.com/sutras/sard-uniapp/compare/v1.13.2...v1.13.3) (2025-05-12)
2
20
 
3
21
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-accordion-bg: var(--sar-emphasis-bg);
4
5
  --sar-accordion-active-bg: var(--sar-active-bg);
5
6
  --sar-accordion-border-color: var(--sar-border-color);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-action-sheet-border-radius: var(--sar-rounded-xl);
4
5
  --sar-action-sheet-border-color: var(--sar-border-color);
5
6
  --sar-action-sheet-bg: var(--sar-emphasis-bg);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-alert-paddding-x: 32rpx;
4
5
  --sar-alert-paddding-y: 16rpx;
5
6
  --sar-alert-font-size: var(--sar-text-base);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-avatar-width: 128rpx;
4
5
  --sar-avatar-height: 128rpx;
5
6
  --sar-avatar-font-size: 64rpx;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-back-top-right: 48rpx;
4
5
  --sar-back-top-bottom: 96rpx;
5
6
  --sar-back-top-z-index: 1000;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-badge-height: 36rpx;
4
5
  --sar-badge-padding-x: 8rpx;
5
6
  --sar-badge-font-size: var(--sar-text-sm);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-button-height-mini: 56rpx;
4
5
  --sar-button-padding-y-mini: 0;
5
6
  --sar-button-padding-x-mini: 12rpx;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-calendar-current-month-font-size: var(--sar-text-lg);
4
5
 
5
6
  --sar-calendar-week-item-height: 64rpx;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-card-border-radius: var(--sar-rounded-lg);
4
5
  --sar-card-border-color: var(--sar-border-color);
5
6
  --sar-card-bg: var(--sar-emphasis-bg);
@@ -112,7 +112,8 @@ export default _defineComponent({
112
112
  options: { type: Array, required: false },
113
113
  fieldKeys: { type: Object, required: false },
114
114
  hintText: { type: String, required: false },
115
- labelRender: { type: Function, required: false }
115
+ labelRender: { type: Function, required: false },
116
+ changeOnSelect: { type: Boolean, required: false }
116
117
  }, defaultCascaderProps),
117
118
  emits: ["update:model-value", "change", "select"],
118
119
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -177,31 +178,25 @@ export default _defineComponent({
177
178
  if (selectBack) {
178
179
  nextTabs = nextTabs.slice(0, tabIndex + 1);
179
180
  }
180
- if (!isLastOption(option)) {
181
+ const isLast = isLastOption(option);
182
+ if (!isLast) {
181
183
  const nextTab = {
182
184
  options: option[mergedFieldKeys.value.children],
183
185
  selected: null
184
186
  };
185
187
  nextTabs.push(nextTab);
186
- tabsCurrent.value = nextTabs.length - 1;
187
- } else {
188
- tabsCurrent.value = tabIndex;
189
- const nextValue = option[mergedFieldKeys.value.value];
190
- innerValue.value = nextValue;
191
- emit(
192
- "update:model-value",
193
- nextValue,
194
- nextTabs.map((tab) => tab.selected)
195
- );
196
- emit(
197
- "change",
198
- nextValue,
199
- nextTabs.map((tab) => tab.selected)
200
- );
201
188
  }
189
+ tabsCurrent.value = isLast ? tabIndex : nextTabs.length - 1;
202
190
  tempValue = option[mergedFieldKeys.value.value];
203
191
  tabs.value = nextTabs;
204
192
  emit("select", option, tabIndex);
193
+ if (isLast || props.changeOnSelect) {
194
+ const nextValue = option[mergedFieldKeys.value.value];
195
+ innerValue.value = nextValue;
196
+ const selectedOptions = nextTabs.map((tab) => tab.selected).filter(Boolean);
197
+ emit("update:model-value", nextValue, selectedOptions);
198
+ emit("change", nextValue, selectedOptions);
199
+ }
205
200
  };
206
201
  const innerPaceholder = computed(() => {
207
202
  return props.hintText || t("pleaseSelect");
@@ -20,6 +20,7 @@ export interface CascaderProps {
20
20
  fieldKeys?: CascaderFieldKeys;
21
21
  hintText?: string;
22
22
  labelRender?: (option: CascaderOption) => string;
23
+ changeOnSelect?: boolean;
23
24
  }
24
25
  export declare const defaultCascaderProps: {
25
26
  options: () => never[];
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-cascader-wrapper-duration: var(--sar-duration);
4
5
  --sar-cascader-loading-wrapper-duration: var(--sar-duration);
5
6
 
@@ -23,11 +23,13 @@
23
23
  <sar-cascader
24
24
  v-if="already"
25
25
  :model-value="popoutValue"
26
- @change="onChange"
27
26
  :options="options"
28
27
  :field-keys="fieldKeys"
29
- :placeholder="hintText"
28
+ :hint-text="hintText"
29
+ :change-on-select="changeOnSelect"
30
+ :label-render="labelRender"
30
31
  @select="(option, tabIndex) => $emit('select', option, tabIndex)"
32
+ @change="onChange"
31
33
  >
32
34
  <template #top="{ tabIndex }">
33
35
  <slot name="top" :tab-index="tabIndex"></slot>
@@ -77,6 +79,7 @@ export default _defineComponent({
77
79
  fieldKeys: { type: Object, required: false },
78
80
  hintText: { type: String, required: false },
79
81
  labelRender: { type: Function, required: false },
82
+ changeOnSelect: { type: Boolean, required: false },
80
83
  placeholder: { type: String, required: false },
81
84
  readonly: { type: Boolean, required: false },
82
85
  disabled: { type: Boolean, required: false },
@@ -114,10 +117,12 @@ export default _defineComponent({
114
117
  }
115
118
  };
116
119
  const onConfirm = () => {
117
- innerValue.value = popoutValue.value;
118
- emit("update:model-value", popoutValue.value, popoutOptions.value);
119
- emit("change", popoutValue.value, popoutOptions.value);
120
- inputValue.value = getInputValue();
120
+ if (popoutValue.value !== innerValue.value) {
121
+ innerValue.value = popoutValue.value;
122
+ inputValue.value = getInputValue();
123
+ emit("update:model-value", innerValue.value, popoutOptions.value);
124
+ emit("change", innerValue.value, popoutOptions.value);
125
+ }
121
126
  };
122
127
  const inputValue = ref("");
123
128
  const fieldkeys = computed(() => {
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-check-icon-size: 1em;
4
5
  --sar-check-icon-square-border-radius: 0.15em;
5
6
  --sar-check-icon-border-color: var(--sar-quaternary-color);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-checkbox-group-column-gap: 24rpx;
4
5
  --sar-checkbox-group-row-gap: 16rpx;
5
6
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-checkbox-input-max-height: 640rpx;
4
5
  }
5
6
  // #endvariables
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-collapse-transition-duration: var(--sar-duration);
4
5
  }
5
6
  // #endvariables
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-datetime-range-picker-wrapper-duration: var(--sar-duration);
4
5
  }
5
6
  // #endvariables
@@ -4,6 +4,8 @@ import { type TransitionHookEmits } from '../popup/common';
4
4
  export interface DialogProps {
5
5
  rootStyle?: StyleValue;
6
6
  rootClass?: string;
7
+ popupStyle?: StyleValue;
8
+ popupClass?: string;
7
9
  visible?: boolean;
8
10
  title?: string;
9
11
  message?: string;
@@ -3,7 +3,8 @@
3
3
  effect="zoom"
4
4
  :visible="visible"
5
5
  :duration="duration"
6
- :root-style="{ maxWidth: 'var(--sar-dialog-max-width)' }"
6
+ :root-class="popupClass"
7
+ :root-style="mergedPopupStyle"
7
8
  @overlay-click="onOverlayClick"
8
9
  @visible-hook="onVisibleHook"
9
10
  >
@@ -107,6 +108,8 @@ export default _defineComponent({
107
108
  props: _mergeDefaults({
108
109
  rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
109
110
  rootClass: { type: String, required: false },
111
+ popupStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
112
+ popupClass: { type: String, required: false },
110
113
  visible: { type: Boolean, required: false },
111
114
  title: { type: String, required: false },
112
115
  message: { type: String, required: false },
@@ -219,7 +222,13 @@ export default _defineComponent({
219
222
  const dialogStyle = computed(() => {
220
223
  return stringifyStyle(props.rootStyle);
221
224
  });
222
- const __returned__ = { props, emit, bem, t, innerVisible, loading, perhapsClose, onOverlayClick, onClose, onConfirm, onCancel, buttonProps, onVisibleHook, dialogClass, dialogStyle, SarPopup, SarButton, SarIcon };
225
+ const mergedPopupStyle = computed(() => {
226
+ return stringifyStyle(
227
+ { maxWidth: "var(--sar-dialog-max-width)" },
228
+ props.popupStyle
229
+ );
230
+ });
231
+ const __returned__ = { props, emit, bem, t, innerVisible, loading, perhapsClose, onOverlayClick, onClose, onConfirm, onCancel, buttonProps, onVisibleHook, dialogClass, dialogStyle, mergedPopupStyle, SarPopup, SarButton, SarIcon };
223
232
  return __returned__;
224
233
  }
225
234
  });
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-dialog-width: 640rpx;
4
5
  --sar-dialog-max-width: 90%;
5
6
  --sar-dialog-border-color: var(--sar-border-color);
@@ -26,6 +26,8 @@ export default _defineComponent({
26
26
  id: { type: String, required: false },
27
27
  rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
28
28
  rootClass: { type: String, required: false },
29
+ popupStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
30
+ popupClass: { type: String, required: false },
29
31
  visible: { type: Boolean, required: false },
30
32
  title: { type: String, required: false },
31
33
  message: { type: String, required: false },
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-divider-margin-y: 32rpx;
4
5
  --sar-divider-margin-x: 16rpx;
5
6
  --sar-divider-gap: 32rpx;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-dropdown-height: 88rpx;
4
5
  --sar-dropdown-bg: var(--sar-emphasis-bg);
5
6
  --sar-dropdown-box-shadow: var(--sar-shadow-lg);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-empty-icon-font-size: 96rpx;
4
5
  --sar-empty-icon-color: var(--sar-gray-300);
5
6
  --sar-empty-icon-line-height: var(--sar-leading-none);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-fab-z-index: 1000;
4
5
  --sar-fab-right: 48rpx;
5
6
  --sar-fab-bottom: 96rpx;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-floating-bubble-z-index: 1000;
4
5
  --sar-floating-bubble-size: 96rpx;
5
6
  --sar-floating-bubble-color: var(--sar-white);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-floating-panel-z-index: 1000;
4
5
  --sar-floating-panel-bg: var(--sar-emphasis-bg);
5
6
  --sar-floating-panel-border-radius: var(--sar-rounded-xl);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-form-bg: var(--sar-emphasis-bg);
4
5
  --sar-form-card-border-radius: var(--sar-rounded-lg);
5
6
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-grid-bg: var(--sar-emphasis-bg);
4
5
  --sar-grid-border-color: var(--sar-border-color);
5
6
  --sar-grid-active-bg: var(--sar-active-bg);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-indexes-anchor-padding: 0 32rpx;
4
5
  --sar-indexes-anchor-font-size: var(--sar-text-base);
5
6
  --sar-indexes-anchor-line-height: 64rpx;
@@ -69,6 +69,7 @@
69
69
 
70
70
  @include e(placeholder) {
71
71
  color: var(--sar-input-placeholder-color);
72
+ font-size: var(--sar-input-control-font-size);
72
73
  line-height: var(--sar-input-control-line-height);
73
74
 
74
75
  @include m(textarea) {
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-input-padding-y: 10rpx;
4
5
  --sar-input-padding-borderless-y: 12rpx;
5
6
  --sar-input-padding-x: 24rpx;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-keyboard-bg: var(--sar-gray-200);
4
5
  --sar-keyboard-padding: 12rpx;
5
6
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  // list
4
5
  --sar-list-border-color: var(--sar-border-color);
5
6
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-load-more-height: 100rpx;
4
5
  --sar-load-more-font-size: var(--sar-text-sm);
5
6
  --sar-load-more-color: var(--sar-tertiary-color);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-loading-icon-animation-duration: 0.8s;
4
5
 
5
6
  --sar-loading-scale-width: 9.38%;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-menu-item-border-radius: var(--sar-rounded);
4
5
  --sar-menu-item-height: 88rpx;
5
6
  --sar-menu-item-padding-x: 32rpx;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-navbar-height: 88rpx;
4
5
  --sar-navbar-bg: var(--sar-emphasis-bg);
5
6
  --sar-navbar-z-index: 999;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-notice-bar-min-height: 80rpx;
4
5
  --sar-notice-bar-padding-x: 32rpx;
5
6
  --sar-notice-bar-padding-y: 20rpx;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-notify-paddding-x: 32rpx;
4
5
  --sar-notify-paddding-y: 16rpx;
5
6
  --sar-notify-font-size: var(--sar-text-base);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-overlay-bg: var(--sar-mask);
4
5
  --sar-overlay-z-index: 1000;
5
6
  --sar-overlay-duration: var(--sar-duration);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-pagination-border-radius: var(--sar-rounded);
4
5
  --sar-pagination-border-color: var(--sar-border-color);
5
6
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-password-input-gap: 20rpx;
4
5
  --sar-password-input-border-color: var(--sar-border-color);
5
6
  --sar-password-input-active-border-color: var(--sar-primary);
@@ -1,7 +1,8 @@
1
1
  @use '../style/base' as *;
2
2
 
3
3
  // #variables
4
- page {
4
+ page,
5
+ .sar-portal {
5
6
  --sar-picker-height: 480rpx;
6
7
 
7
8
  --sar-picker-item-height: 96rpx;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-popout-border-top-radius: var(--sar-rounded-xl);
4
5
  --sar-popout-bg: var(--sar-emphasis-bg);
5
6
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-popout-input-arrow-font-size: var(--sar-text-base);
4
5
  --sar-popout-input-arrow-color: var(--sar-border-color);
5
6
  --sar-popout-input-active-opacity: var(--sar-active-opacity);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-popover-duration: var(--sar-duration-fast);
4
5
  --sar-popover-bg: var(--sar-emphasis-bg);
5
6
  --sar-popover-box-shadow: var(--sar-shadow-xl);
@@ -1,22 +1,36 @@
1
1
  <template>
2
- <sar-overlay
3
- v-if="overlay"
4
- :visible="visible"
5
- :duration="duration"
6
- :z-index="zIndex"
7
- :background="background"
8
- :transparent="transparent"
9
- :root-style="overlayStyle"
10
- :root-class="overlayClass"
11
- @click="onOverlayClick"
12
- />
13
- <view
14
- :class="popupClass"
15
- :style="popupStyle"
16
- @transitionend="onTransitionEnd"
17
- >
18
- <slot></slot>
19
- </view>
2
+ <!-- #ifdef WEB -->
3
+ <teleport to="body">
4
+ <!-- #endif -->
5
+ <!-- #ifdef MP -->
6
+ <root-portal>
7
+ <!-- #endif -->
8
+ <view class="sar-portal">
9
+ <sar-overlay
10
+ v-if="overlay"
11
+ :visible="visible"
12
+ :duration="duration"
13
+ :z-index="zIndex"
14
+ :background="background"
15
+ :transparent="transparent"
16
+ :root-style="overlayStyle"
17
+ :root-class="overlayClass"
18
+ @click="onOverlayClick"
19
+ />
20
+ <view
21
+ :class="popupClass"
22
+ :style="popupStyle"
23
+ @transitionend="onTransitionEnd"
24
+ >
25
+ <slot></slot>
26
+ </view>
27
+ </view>
28
+ <!-- #ifdef MP -->
29
+ </root-portal>
30
+ <!-- #endif -->
31
+ <!-- #ifdef WEB -->
32
+ </teleport>
33
+ <!-- #endif -->
20
34
  </template>
21
35
 
22
36
  <script>
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-popup-z-index: 1000;
4
5
  --sar-popup-duration: var(--sar-duration);
5
6
  }
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-progress-bar-height: 8rpx;
4
5
  --sar-progress-bar-border-radius: var(--sar-rounded-full);
5
6
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-progress-circle-size: 200rpx;
4
5
  --sar-progress-circle-track-color: var(--sar-secondary-bg);
5
6
  --sar-progress-circle-piece-color: var(--sar-primary);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-pull-down-refresh-header-font-size: var(--sar-text-sm);
4
5
  --sar-pull-down-refresh-header-color: var(--sar-tertiary-color);
5
6
 
@@ -1,4 +1,4 @@
1
1
  // #variables
2
- // page {
2
+ // page, .sar-portal {
3
3
  // }
4
4
  // #endvariables
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-radio-group-column-gap: 24rpx;
4
5
  --sar-radio-group-row-gap: 16rpx;
5
6
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-radio-input-max-height: 640rpx;
4
5
  }
5
6
  // #endvariables
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-rate-gap: 20rpx;
4
5
  --sar-rate-star-font-size: 40rpx;
5
6
  --sar-rate-star-void-color: var(--sar-quaternary-color);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-result-icon-font-size: 96rpx;
4
5
  --sar-result-icon-line-height: var(--sar-leading-none);
5
6
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-search-padding-x: 24rpx;
4
5
  --sar-search-padding-y: 16rpx;
5
6
  --sar-search-bg: var(--sar-emphasis-bg);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-share-sheet-border-radius: var(--sar-rounded-xl);
4
5
  --sar-share-sheet-border-color: var(--sar-border-color);
5
6
  --sar-share-sheet-bg: var(--sar-emphasis-bg);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-sidebar-bg: var(--sar-body-bg);
4
5
  --sar-sidebar-width: 184rpx;
5
6
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-signature-canvas-height: 400rpx;
4
5
  --sar-signature-canvas-bg: var(--sar-white);
5
6
  --sar-signature-full-bg: var(--sar-body-bg);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-skeleton-bg: var(--sar-secondary-bg);
4
5
  --sar-skeleton-border-radius: var(--sar-rounded-sm);
5
6
  --sar-skeleton-highlight-color: rgba(0, 0, 0, 0.08);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-slider-vertical-height: 300rpx;
4
5
  --sar-slider-padding: calc(var(--sar-slider-thumb-size) / 2);
5
6
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-space-small-gap: 8rpx;
4
5
  --sar-space-middle-gap: 16rpx;
5
6
  --sar-space-large-gap: 24rpx;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-stepper-height: 64rpx;
4
5
  --sar-stepper-gap: 8rpx;
5
6
  --sar-stepper-bg: var(--sar-secondary-bg);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-steps-step-font-size: var(--sar-text-base);
4
5
  --sar-steps-step-active-opacity: var(--sar-active-opacity);
5
6
  --sar-steps-step-min-height: 72rpx;
@@ -1,12 +1,14 @@
1
1
  @mixin theme-dark {
2
2
  @media (prefers-color-scheme: dark) {
3
- page {
3
+ page,
4
+ .sar-portal {
4
5
  @content;
5
6
  }
6
7
  }
7
8
 
8
9
  /* #ifdef WEB */
9
- :root[data-sard-theme='dark'] page {
10
+ :root[data-sard-theme='dark'] page,
11
+ :root[data-sard-theme='dark'] .sar-portal {
10
12
  @content;
11
13
  }
12
14
  /* #endif */
@@ -3,7 +3,8 @@
3
3
  @use './functions' as *;
4
4
 
5
5
  // #variables
6
- page {
6
+ page,
7
+ .sar-portal {
7
8
  // # 灰度值
8
9
  --sar-white: #{$sar-white};
9
10
  --sar-gray-100: #{$sar-gray-100};
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-swiper-dot-bottom: 20rpx;
4
5
  --sar-swiper-dot-gap: 12rpx;
5
6
  --sar-swiper-dot-size: 12rpx;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-switch-font-size: 60rpx;
4
5
  --sar-switch-width: calc(1em / 6 * 10);
5
6
  --sar-switch-height: 1em;
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-tabbar-height: 100rpx;
4
5
  --sar-tabbar-border-color: var(--sar-border-color);
5
6
  --sar-tabbar-bg: var(--sar-emphasis-bg);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-table-border-color: var(--sar-border-color);
4
5
  --sar-table-bg: var(--sar-emphasis-bg);
5
6
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-tabs-tab-height: 88rpx;
4
5
  --sar-tabs-tab-font-size: var(--sar-text-base);
5
6
  --sar-tabs-tab-line-height: var(--sar-leading-snug);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-tag-line-height: var(--sar-leading-tight);
4
5
  --sar-tag-color: var(--sar-white);
5
6
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-timeline-item-header-width: 96rpx;
4
5
 
5
6
  --sar-timeline-item-line-width: 1px;
@@ -1,7 +1,8 @@
1
1
  @use '../style/base' as *;
2
2
 
3
3
  // #variables
4
- page {
4
+ page,
5
+ .sar-portal {
5
6
  --sar-toast-top: 10%;
6
7
  --sar-toast-bottom: 10%;
7
8
 
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-tree-border-color: var(--sar-border-color);
4
5
  --sar-tree-bg: var(--sar-emphasis-bg);
5
6
  --sar-tree-duration: var(--sar-duration);
@@ -1,5 +1,6 @@
1
1
  // #variables
2
- page {
2
+ page,
3
+ .sar-portal {
3
4
  --sar-upload-preview-width: 176rpx;
4
5
  --sar-upload-preview-height: 176rpx;
5
6
  --sar-upload-preview-gap: 16rpx;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "sard-uniapp",
3
3
  "name": "sard-uniapp",
4
4
  "displayName": "sard-uniapp",
5
- "version": "1.13.3",
5
+ "version": "1.14.1",
6
6
  "description": "sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库",
7
7
  "main": "index.js",
8
8
  "scripts": {