sard-uniapp 1.14.0 → 1.14.2

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 (100) 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/calendar.vue +16 -17
  10. package/components/calendar/variables.scss +2 -1
  11. package/components/calendar-input/calendar-input.vue +35 -31
  12. package/components/calendar-input/common.d.ts +3 -0
  13. package/components/card/variables.scss +2 -1
  14. package/components/cascader/variables.scss +2 -1
  15. package/components/cascader-input/cascader-input.vue +32 -28
  16. package/components/cascader-input/common.d.ts +3 -0
  17. package/components/check-icon/variables.scss +2 -1
  18. package/components/checkbox/variables.scss +2 -1
  19. package/components/checkbox-input/checkbox-input.vue +60 -56
  20. package/components/checkbox-input/common.d.ts +3 -0
  21. package/components/checkbox-input/variables.scss +2 -1
  22. package/components/collapse/variables.scss +2 -1
  23. package/components/datetime-picker-input/common.d.ts +3 -0
  24. package/components/datetime-picker-input/datetime-picker-input.vue +29 -25
  25. package/components/datetime-range-picker/variables.scss +2 -1
  26. package/components/datetime-range-picker-input/common.d.ts +3 -0
  27. package/components/datetime-range-picker-input/datetime-range-picker-input.vue +30 -26
  28. package/components/dialog/common.d.ts +2 -0
  29. package/components/dialog/dialog.vue +11 -2
  30. package/components/dialog/variables.scss +2 -1
  31. package/components/dialog-agent/dialog-agent.vue +2 -0
  32. package/components/divider/variables.scss +2 -1
  33. package/components/dropdown/variables.scss +2 -1
  34. package/components/empty/variables.scss +2 -1
  35. package/components/fab/variables.scss +2 -1
  36. package/components/floating-bubble/variables.scss +2 -1
  37. package/components/floating-panel/variables.scss +2 -1
  38. package/components/form/variables.scss +2 -1
  39. package/components/grid/variables.scss +2 -1
  40. package/components/indexes/variables.scss +2 -1
  41. package/components/input/common.d.ts +1 -0
  42. package/components/input/index.scss +1 -0
  43. package/components/input/input.vue +6 -3
  44. package/components/input/variables.scss +2 -1
  45. package/components/keyboard/variables.scss +2 -1
  46. package/components/list/variables.scss +2 -1
  47. package/components/load-more/variables.scss +2 -1
  48. package/components/loading/variables.scss +2 -1
  49. package/components/menu/variables.scss +2 -1
  50. package/components/navbar/variables.scss +2 -1
  51. package/components/notice-bar/variables.scss +2 -1
  52. package/components/notify/variables.scss +2 -1
  53. package/components/overlay/variables.scss +2 -1
  54. package/components/pagination/variables.scss +2 -1
  55. package/components/password-input/variables.scss +2 -1
  56. package/components/picker/variables.scss +2 -1
  57. package/components/picker-input/common.d.ts +3 -0
  58. package/components/picker-input/picker-input.vue +26 -22
  59. package/components/popout/variables.scss +2 -1
  60. package/components/popout-input/popout-input.d.ts +10 -1
  61. package/components/popout-input/popout-input.vue +5 -3
  62. package/components/popout-input/variables.scss +2 -1
  63. package/components/popover/variables.scss +2 -1
  64. package/components/popup/popup.vue +32 -18
  65. package/components/popup/variables.scss +2 -1
  66. package/components/progress-bar/variables.scss +2 -1
  67. package/components/progress-circle/variables.scss +2 -1
  68. package/components/pull-down-refresh/variables.scss +2 -1
  69. package/components/qrcode/variables.scss +1 -1
  70. package/components/radio/variables.scss +2 -1
  71. package/components/radio-input/common.d.ts +3 -0
  72. package/components/radio-input/radio-input.vue +59 -58
  73. package/components/radio-input/variables.scss +2 -1
  74. package/components/rate/variables.scss +2 -1
  75. package/components/result/variables.scss +2 -1
  76. package/components/search/variables.scss +2 -1
  77. package/components/share-sheet/variables.scss +2 -1
  78. package/components/sidebar/variables.scss +2 -1
  79. package/components/signature/variables.scss +2 -1
  80. package/components/skeleton/variables.scss +2 -1
  81. package/components/slider/variables.scss +2 -1
  82. package/components/space/common.d.ts +3 -0
  83. package/components/space/common.js +7 -0
  84. package/components/space/space.vue +4 -1
  85. package/components/space/variables.scss +2 -1
  86. package/components/stepper/variables.scss +2 -1
  87. package/components/steps/variables.scss +2 -1
  88. package/components/style/mixins/theme-dark.scss +4 -2
  89. package/components/style/variables.scss +2 -1
  90. package/components/swiper-dot/variables.scss +2 -1
  91. package/components/switch/variables.scss +2 -1
  92. package/components/tabbar/variables.scss +2 -1
  93. package/components/table/variables.scss +2 -1
  94. package/components/tabs/variables.scss +2 -1
  95. package/components/tag/variables.scss +2 -1
  96. package/components/timeline/variables.scss +2 -1
  97. package/components/toast/variables.scss +2 -1
  98. package/components/tree/variables.scss +2 -1
  99. package/components/upload/variables.scss +2 -1
  100. package/package.json +1 -1
@@ -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,9 +1,12 @@
1
1
  import { type RadioGroupOption, type RadioGroupProps } from '../radio/common';
2
2
  import { type PopoutInputProps } from '../popout-input/common';
3
+ import { type StyleValue } from 'vue';
3
4
  export type RadioInputOption = RadioGroupOption;
4
5
  export interface RadioInputProps extends RadioGroupProps, Omit<PopoutInputProps, 'modelValue'> {
5
6
  visible?: boolean;
6
7
  title?: string;
8
+ popoutClass?: string;
9
+ popoutStyle?: StyleValue;
7
10
  }
8
11
  export declare const defaultRadioInputProps: () => {
9
12
  options: () => never[];
@@ -5,66 +5,67 @@
5
5
  :readonly="readonly"
6
6
  :disabled="disabled"
7
7
  :clearable="clearable"
8
- @clear="onClear"
9
- @click="onInputClick"
10
- />
11
-
12
- <sar-popout
13
8
  :root-class="rootClass"
14
9
  :root-style="rootStyle"
15
- :visible="innerVisible"
16
- @update:visible="onVisible"
17
- :title="title ?? placeholder"
18
- :show-footer="false"
19
- @confirm="onConfirm"
10
+ @clear="onClear"
11
+ @click="onInputClick"
20
12
  >
21
- <template #visible="{ already }">
22
- <view v-if="already" :class="containerClass">
23
- <scroll-view
24
- :class="bem.e('scroll')"
25
- scroll-y
26
- trap-scroll
27
- :upper-threshold="0"
28
- :lower-threshold="0"
29
- :throttle="false"
30
- @scroll="onScroll"
31
- @scrolltoupper="onScrolltoupper"
32
- @scrolltolower="onScrolltolower"
33
- >
34
- <sar-radio-group
35
- :size="size"
36
- :type="type"
37
- :checkedColor="checkedColor"
38
- :direction="direction"
39
- :validate-event="false"
40
- :model-value="popoutValue"
41
- @change="onChange"
13
+ <sar-popout
14
+ :visible="innerVisible"
15
+ :title="title ?? placeholder"
16
+ :root-class="popoutClass"
17
+ :root-style="popoutStyle"
18
+ @update:visible="onVisible"
19
+ @confirm="onConfirm"
20
+ >
21
+ <template #visible="{ already }">
22
+ <view v-if="already" :class="containerClass">
23
+ <scroll-view
24
+ :class="bem.e('scroll')"
25
+ scroll-y
26
+ trap-scroll
27
+ :upper-threshold="0"
28
+ :lower-threshold="0"
29
+ :throttle="false"
30
+ @scroll="onScroll"
31
+ @scrolltoupper="onScrolltoupper"
32
+ @scrolltolower="onScrolltolower"
42
33
  >
43
- <template #custom="{ toggle }">
44
- <sar-list inlaid>
45
- <sar-list-item
46
- v-for="option in options"
47
- :key="getMayPrimitiveOption(option, fieldKeys.value)"
48
- :title="getMayPrimitiveOption(option, fieldKeys.label)"
49
- hover
50
- @click="
51
- toggle(getMayPrimitiveOption(option, fieldKeys.value))
52
- "
53
- >
54
- <template #value>
55
- <sar-radio
56
- readonly
57
- :value="getMayPrimitiveOption(option, fieldKeys.value)"
58
- />
59
- </template>
60
- </sar-list-item>
61
- </sar-list>
62
- </template>
63
- </sar-radio-group>
64
- </scroll-view>
65
- </view>
66
- </template>
67
- </sar-popout>
34
+ <sar-radio-group
35
+ :size="size"
36
+ :type="type"
37
+ :checkedColor="checkedColor"
38
+ :direction="direction"
39
+ :validate-event="false"
40
+ :model-value="popoutValue"
41
+ @change="onChange"
42
+ >
43
+ <template #custom="{ toggle }">
44
+ <sar-list inlaid>
45
+ <sar-list-item
46
+ v-for="option in options"
47
+ :key="getMayPrimitiveOption(option, fieldKeys.value)"
48
+ :title="getMayPrimitiveOption(option, fieldKeys.label)"
49
+ hover
50
+ @click="
51
+ toggle(getMayPrimitiveOption(option, fieldKeys.value))
52
+ "
53
+ >
54
+ <template #value>
55
+ <sar-radio
56
+ readonly
57
+ :value="getMayPrimitiveOption(option, fieldKeys.value)"
58
+ />
59
+ </template>
60
+ </sar-list-item>
61
+ </sar-list>
62
+ </template>
63
+ </sar-radio-group>
64
+ </scroll-view>
65
+ </view>
66
+ </template>
67
+ </sar-popout>
68
+ </sar-popout-input>
68
69
  </template>
69
70
 
70
71
  <script>
@@ -107,6 +108,8 @@ export default _defineComponent({
107
108
  props: _mergeDefaults({
108
109
  visible: { type: Boolean, required: false },
109
110
  title: { type: String, required: false },
111
+ popoutClass: { type: String, required: false },
112
+ popoutStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
110
113
  rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
111
114
  rootClass: { type: String, required: false },
112
115
  modelValue: { type: null, required: false },
@@ -150,8 +153,6 @@ export default _defineComponent({
150
153
  });
151
154
  const onChange = (value) => {
152
155
  popoutValue.value = value;
153
- onConfirm();
154
- innerVisible.value = false;
155
156
  };
156
157
  const onConfirm = () => {
157
158
  innerValue.value = popoutValue.value;
@@ -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,16 +1,19 @@
1
1
  import { type StyleValue } from 'vue';
2
2
  export type SpaceSize = 'small' | 'middle' | 'large';
3
3
  export type SpaceAlign = 'start' | 'end' | 'center' | 'baseline';
4
+ export type SpaceJustify = 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
4
5
  export interface SpaceProps {
5
6
  rootStyle?: StyleValue;
6
7
  rootClass?: string;
7
8
  direction?: 'vertical' | 'horizontal';
8
9
  size?: SpaceSize | (string & {});
9
10
  align?: SpaceAlign | (string & {});
11
+ justify?: SpaceJustify | (string & {});
10
12
  wrap?: boolean;
11
13
  }
12
14
  export declare const spaceSizes: string[];
13
15
  export declare const spaceMapAlign: Record<string, string>;
16
+ export declare const spaceMapJustify: Record<string, string>;
14
17
  export declare const defaultSpaceProps: {
15
18
  direction: SpaceProps["direction"];
16
19
  size: SpaceProps["size"];
@@ -4,4 +4,11 @@ export const spaceMapAlign = {
4
4
  start: 'flex-start',
5
5
  end: 'flex-end',
6
6
  };
7
+ export const spaceMapJustify = {
8
+ start: 'flex-start',
9
+ end: 'flex-end',
10
+ between: 'space-between',
11
+ around: 'space-around',
12
+ evenly: 'space-evenly',
13
+ };
7
14
  export const defaultSpaceProps = defaultConfig.space;
@@ -11,6 +11,7 @@ import { classNames, stringifyStyle, createBem } from "../../utils";
11
11
  import {
12
12
  defaultSpaceProps,
13
13
  spaceMapAlign,
14
+ spaceMapJustify,
14
15
  spaceSizes
15
16
  } from "./common";
16
17
  export default _defineComponent({
@@ -27,6 +28,7 @@ export default _defineComponent({
27
28
  direction: { type: String, required: false },
28
29
  size: { type: [String, Object], required: false },
29
30
  align: { type: [String, Object], required: false },
31
+ justify: { type: [String, Object], required: false },
30
32
  wrap: { type: Boolean, required: false }
31
33
  }, defaultSpaceProps),
32
34
  setup(__props, { expose: __expose }) {
@@ -49,7 +51,8 @@ export default _defineComponent({
49
51
  return stringifyStyle(
50
52
  {
51
53
  gap: presetSize.value ? null : props.size,
52
- alignItems: (props.align && spaceMapAlign[props.align]) ?? props.align
54
+ alignItems: (props.align && spaceMapAlign[props.align]) ?? props.align,
55
+ justifyContent: (props.justify && spaceMapJustify[props.justify]) ?? props.justify
53
56
  },
54
57
  props.rootStyle
55
58
  );
@@ -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.14.0",
5
+ "version": "1.14.2",
6
6
  "description": "sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库",
7
7
  "main": "index.js",
8
8
  "scripts": {