@solar-taro/ui-sun 1.6.4 → 2.0.0

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 (105) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/accordion/index.vue.d.ts +22 -16
  3. package/chip/index.vue.d.ts +15 -36
  4. package/circular-progress/index.vue.d.ts +4 -30
  5. package/fab/fab-group.vue.d.ts +9 -3
  6. package/fab/fab.vue.d.ts +9 -3
  7. package/fab/index.scss +11 -3
  8. package/icon/index.scss +4 -3
  9. package/icon/index.vue.d.ts +3 -22
  10. package/index.d.ts +3 -0
  11. package/index.js +28 -22
  12. package/index10.js +24 -33
  13. package/index11.js +34 -20
  14. package/index12.js +72 -46
  15. package/index13.js +19 -144
  16. package/index14.js +48 -28
  17. package/index15.js +144 -21
  18. package/index16.js +29 -24
  19. package/index17.js +19 -10
  20. package/index18.js +41 -27
  21. package/index19.js +23 -118
  22. package/index20.js +15 -9
  23. package/index21.js +33 -10
  24. package/index22.js +123 -10
  25. package/index23.js +14 -2
  26. package/index24.js +10 -2
  27. package/index25.js +10 -2
  28. package/index26.js +1 -1
  29. package/index27.js +2 -7
  30. package/index28.js +1 -1
  31. package/index29.js +7 -2
  32. package/index30.js +1 -1
  33. package/index31.js +1 -1
  34. package/index32.js +1 -1
  35. package/index33.js +1 -1
  36. package/index34.js +1 -1
  37. package/index35.js +1 -1
  38. package/index37.js +1 -1
  39. package/index38.js +1 -1
  40. package/index39.js +1 -1
  41. package/index40.js +1 -1
  42. package/index41.js +2 -66
  43. package/index42.js +2 -12
  44. package/index43.js +2 -25
  45. package/index44.js +2 -14
  46. package/index45.js +2 -5
  47. package/index46.js +2 -3
  48. package/index47.js +3 -26
  49. package/index48.js +66 -2
  50. package/index49.js +12 -506
  51. package/index50.js +24 -78
  52. package/index51.js +14 -70
  53. package/index52.js +4 -68
  54. package/index53.js +525 -542
  55. package/index54.js +26 -2
  56. package/index56.js +506 -2
  57. package/index57.js +78 -3
  58. package/index58.js +70 -2
  59. package/index59.js +69 -4
  60. package/index60.js +543 -2
  61. package/index63.js +2 -48
  62. package/index64.js +3 -81
  63. package/index66.js +4 -2
  64. package/index67.js +2 -2
  65. package/index68.js +2 -2
  66. package/index69.js +4 -0
  67. package/index7.js +7 -9
  68. package/index70.js +4 -0
  69. package/index71.js +50 -0
  70. package/index72.js +84 -0
  71. package/index73.js +4 -0
  72. package/index74.js +4 -0
  73. package/index75.js +4 -0
  74. package/index8.js +29 -17
  75. package/index9.js +19 -25
  76. package/item/index.d.ts +1 -0
  77. package/item/index.scss +40 -0
  78. package/item/index.vue.d.ts +26 -0
  79. package/lazy-render/index.vue.d.ts +13 -29
  80. package/list-header/index.scss +1 -1
  81. package/list-header/index.vue.d.ts +9 -3
  82. package/navbar/index.vue.d.ts +10 -4
  83. package/package.json +2 -2
  84. package/plugin.d.ts +0 -1
  85. package/popover/index.vue.d.ts +24 -41
  86. package/qrcode/index.d.ts +1 -0
  87. package/qrcode/index.scss +9 -0
  88. package/qrcode/index.vue.d.ts +22 -0
  89. package/qrcode/qrcodegen.d.ts +83 -0
  90. package/segment/injection.d.ts +0 -1
  91. package/segment/segment-btn.vue.d.ts +12 -16
  92. package/segment/segment.vue.d.ts +16 -20
  93. package/slider-captcha/index.vue.d.ts +7 -36
  94. package/spinner/index.scss +1 -0
  95. package/spinner/index.vue.d.ts +14 -33
  96. package/sudoku/sudoku-item.vue.d.ts +9 -3
  97. package/sudoku/sudoku.vue.d.ts +9 -3
  98. package/tabbar/index.d.ts +1 -0
  99. package/tabbar/index.scss +74 -0
  100. package/tabbar/index.vue.d.ts +38 -0
  101. package/table/_table.scss +1 -1
  102. package/table/table-cell.vue.d.ts +13 -24
  103. package/table/table-row.vue.d.ts +12 -17
  104. package/table/table.vue.d.ts +17 -43
  105. package/virtual-scroll/index.vue.d.ts +35 -74
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## 1.6.5 (2025-11-10)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **ui-sun/qrcode:** add rendered event
6
+ - **ui-sun/qrcode:** expose getDataURL funtion
7
+ - **ui-sun:** add qrcode component
8
+
9
+ ### ❤️ Thank You
10
+
11
+ - HyperLife1119
12
+
13
+ ## 1.6.4 (2025-11-05)
14
+
15
+ This was a version bump only for ui-sun to align it with other projects, there were no code changes.
16
+
1
17
  ## 1.6.3 (2025-11-03)
2
18
 
3
19
  This was a version bump only for ui-sun to align it with other projects, there were no code changes.
@@ -1,22 +1,28 @@
1
+ type __VLS_Props = {
2
+ disabled?: boolean;
3
+ };
1
4
  declare function toggle(): void;
5
+ type __VLS_PublicProps = {
6
+ 'expanded'?: boolean;
7
+ } & __VLS_Props;
2
8
  declare function __VLS_template(): {
3
- default?(_: {}): any;
4
- content?(_: {
5
- toggle: typeof toggle;
6
- }): any;
7
- };
8
- declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
9
- expanded: import('vue').PropType<boolean>;
10
- disabled: {
11
- type: import('vue').PropType<boolean>;
9
+ attrs: Partial<{}>;
10
+ slots: {
11
+ default?(_: {}): any;
12
+ content?(_: {
13
+ toggle: typeof toggle;
14
+ }): any;
12
15
  };
13
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
14
- expanded: import('vue').PropType<boolean>;
15
- disabled: {
16
- type: import('vue').PropType<boolean>;
17
- };
18
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
19
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
16
+ refs: {};
17
+ rootEl: SVGViewElement;
18
+ };
19
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
20
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
21
+ "update:expanded": (value: boolean) => any;
22
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
23
+ "onUpdate:expanded"?: ((value: boolean) => any) | undefined;
24
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, SVGViewElement>;
25
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
20
26
  export default _default;
21
27
  type __VLS_WithTemplateSlots<T, S> = T & {
22
28
  new (): {
@@ -1,45 +1,24 @@
1
1
  import { Color } from '../typing';
2
-
2
+ type __VLS_Props = {
3
+ type?: 'solid' | 'translucent' | 'outline';
4
+ size?: 'small' | 'default' | 'large';
5
+ color: Color;
6
+ };
3
7
  declare function __VLS_template(): {
4
- default?(_: {}): any;
8
+ attrs: Partial<{}>;
9
+ slots: {
10
+ default?(_: {}): any;
11
+ };
12
+ refs: {};
13
+ rootEl: SVGViewElement;
5
14
  };
6
- declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
7
- type?: "solid" | "translucent" | "outline";
8
- size?: "small" | "default" | "large";
9
- color: Color;
10
- }>, {
11
- type: string;
12
- size: string;
13
- }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
14
- type?: "solid" | "translucent" | "outline";
15
- size?: "small" | "default" | "large";
16
- color: Color;
17
- }>, {
18
- type: string;
19
- size: string;
20
- }>>> & Readonly<{}>, {
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
21
17
  type: "solid" | "translucent" | "outline";
22
18
  size: "small" | "default" | "large";
23
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
24
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
19
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, SVGViewElement>;
20
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
25
21
  export default _default;
26
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
27
- type __VLS_TypePropsToRuntimeProps<T> = {
28
- [K in keyof T]-?: {} extends Pick<T, K> ? {
29
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
30
- } : {
31
- type: import('vue').PropType<T[K]>;
32
- required: true;
33
- };
34
- };
35
- type __VLS_WithDefaults<P, D> = {
36
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
37
- default: D[K];
38
- }> : P[K];
39
- };
40
- type __VLS_Prettify<T> = {
41
- [K in keyof T]: T[K];
42
- } & {};
43
22
  type __VLS_WithTemplateSlots<T, S> = T & {
44
23
  new (): {
45
24
  $slots: S;
@@ -1,37 +1,11 @@
1
1
  import { Color } from '../typing';
2
-
3
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
+ type __VLS_Props = {
4
3
  value: number;
5
4
  size: string;
6
5
  strokeWidth: string;
7
6
  color?: Color;
8
- }>, {
9
- color: string;
10
- }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
11
- value: number;
12
- size: string;
13
- strokeWidth: string;
14
- color?: Color;
15
- }>, {
16
- color: string;
17
- }>>> & Readonly<{}>, {
7
+ };
8
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
18
9
  color: Color;
19
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
10
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, SVGViewElement>;
20
11
  export default _default;
21
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
22
- type __VLS_TypePropsToRuntimeProps<T> = {
23
- [K in keyof T]-?: {} extends Pick<T, K> ? {
24
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
25
- } : {
26
- type: import('vue').PropType<T[K]>;
27
- required: true;
28
- };
29
- };
30
- type __VLS_WithDefaults<P, D> = {
31
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
32
- default: D[K];
33
- }> : P[K];
34
- };
35
- type __VLS_Prettify<T> = {
36
- [K in keyof T]: T[K];
37
- } & {};
@@ -1,6 +1,12 @@
1
1
  declare function __VLS_template(): {
2
- default?(_: {}): any;
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ default?(_: {}): any;
5
+ };
6
+ refs: {};
7
+ rootEl: SVGViewElement;
3
8
  };
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
4
10
  declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
5
11
  offsetY: {
6
12
  type: (NumberConstructor | StringConstructor)[];
@@ -13,8 +19,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
13
19
  };
14
20
  }>> & Readonly<{}>, {
15
21
  offsetY: string | number;
16
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
17
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
22
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGViewElement>;
23
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
18
24
  export default _default;
19
25
  type __VLS_WithTemplateSlots<T, S> = T & {
20
26
  new (): {
package/fab/fab.vue.d.ts CHANGED
@@ -1,8 +1,14 @@
1
1
  declare function __VLS_template(): {
2
- default?(_: {}): any;
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ default?(_: {}): any;
5
+ };
6
+ refs: {};
7
+ rootEl: SVGViewElement;
3
8
  };
4
- declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
5
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGViewElement>;
11
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
6
12
  export default _default;
7
13
  type __VLS_WithTemplateSlots<T, S> = T & {
8
14
  new (): {
package/fab/index.scss CHANGED
@@ -3,14 +3,22 @@
3
3
  flex-direction: column;
4
4
  justify-content: center;
5
5
  align-items: center;
6
- width: 54px;
7
- height: 54px;
8
- border-radius: 20px;
6
+ width: 56px;
7
+ height: 56px;
8
+ border-radius: 18px;
9
+ box-shadow:
10
+ 0 10px 15px -3px rgb(0 0 0 / 0.1),
11
+ 0 4px 6px -4px rgb(0 0 0 / 0.1);
12
+ transition: transform ease-out 0.2s;
9
13
 
10
14
  &:not(:last-child) {
11
15
  margin-bottom: 10px;
12
16
  }
13
17
 
18
+ &.hover {
19
+ transform: scale(1.1);
20
+ }
21
+
14
22
  &-group {
15
23
  position: fixed;
16
24
  right: calc(15px + var(--safe-right));
package/icon/index.scss CHANGED
@@ -1,9 +1,10 @@
1
1
  @use "./ionicon";
2
2
 
3
3
  .sun-icon {
4
- display: inline;
4
+ display: inline-block;
5
5
  contain: strict;
6
- color: currentColor;
7
- font-size: 1em;
6
+ line-height: 1;
7
+ height: 1em;
8
+ width: 1em;
8
9
  box-sizing: content-box;
9
10
  }
@@ -1,24 +1,5 @@
1
- declare function __VLS_template(): {
2
- default?(_: {}): any;
3
- };
4
- declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
5
- name: string;
6
- }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
1
+ type __VLS_Props = {
7
2
  name: string;
8
- }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
9
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
10
- export default _default;
11
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
- type __VLS_TypePropsToRuntimeProps<T> = {
13
- [K in keyof T]-?: {} extends Pick<T, K> ? {
14
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
15
- } : {
16
- type: import('vue').PropType<T[K]>;
17
- required: true;
18
- };
19
- };
20
- type __VLS_WithTemplateSlots<T, S> = T & {
21
- new (): {
22
- $slots: S;
23
- };
24
3
  };
4
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, SVGViewElement>;
5
+ export default _default;
package/index.d.ts CHANGED
@@ -3,14 +3,17 @@ export * from './chip';
3
3
  export * from './circular-progress';
4
4
  export * from './fab';
5
5
  export * from './icon';
6
+ export * from './item';
6
7
  export * from './lazy-render';
7
8
  export * from './list-header';
8
9
  export * from './navbar';
9
10
  export * from './plugin';
10
11
  export * from './popover';
12
+ export * from './qrcode';
11
13
  export * from './segment';
12
14
  export * from './slider-captcha';
13
15
  export * from './spinner';
14
16
  export * from './sudoku';
17
+ export * from './tabbar';
15
18
  export * from './table';
16
19
  export * from './virtual-scroll';
package/index.js CHANGED
@@ -5,40 +5,46 @@ import { default as S } from "./index5.js";
5
5
  import { default as d } from "./index6.js";
6
6
  import { default as m } from "./index7.js";
7
7
  import { default as x } from "./index8.js";
8
- import { default as b } from "./index9.js";
8
+ import { default as c } from "./index9.js";
9
9
  import { default as C } from "./index10.js";
10
- import { default as T } from "./index11.js";
11
- import { default as k } from "./index12.js";
12
- import { default as F } from "./index13.js";
10
+ import { default as g } from "./index11.js";
11
+ import { default as h } from "./index12.js";
12
+ import { default as v } from "./index13.js";
13
13
  import { default as L } from "./index14.js";
14
14
  import { default as R } from "./index15.js";
15
15
  import { default as y } from "./index16.js";
16
16
  import { default as A } from "./index17.js";
17
17
  import { default as G } from "./index18.js";
18
18
  import { default as N } from "./index19.js";
19
- import { default as j } from "./index20.js";
20
- import { default as D } from "./index21.js";
21
- import { default as J } from "./index22.js";
19
+ import { default as V } from "./index20.js";
20
+ import { default as q } from "./index21.js";
21
+ import { default as E } from "./index22.js";
22
+ import { default as K } from "./index23.js";
23
+ import { default as O } from "./index24.js";
24
+ import { default as W } from "./index25.js";
22
25
  export {
23
26
  o as SolarSun,
24
27
  t as SunAccordion,
25
28
  f as SunChip,
26
29
  S as SunCircularProgress,
27
- j as SunFab,
30
+ K as SunFab,
28
31
  d as SunFabGroup,
29
32
  m as SunIcon,
30
- x as SunLazyRender,
31
- D as SunListHeader,
32
- b as SunNavbar,
33
- C as SunPopover,
34
- k as SunSegment,
35
- T as SunSegmentBtn,
36
- F as SunSliderCaptcha,
37
- L as SunSpinner,
38
- R as SunSudoku,
39
- J as SunSudokuItem,
40
- G as SunTb,
41
- y as SunTbCell,
42
- A as SunTbRow,
43
- N as SunVirtualScroll
33
+ x as SunItem,
34
+ c as SunLazyRender,
35
+ O as SunListHeader,
36
+ C as SunNavbar,
37
+ g as SunPopover,
38
+ h as SunQrcode,
39
+ L as SunSegment,
40
+ v as SunSegmentBtn,
41
+ R as SunSliderCaptcha,
42
+ y as SunSpinner,
43
+ A as SunSudoku,
44
+ W as SunSudokuItem,
45
+ G as SunTabbar,
46
+ q as SunTb,
47
+ N as SunTbCell,
48
+ V as SunTbRow,
49
+ E as SunVirtualScroll
44
50
  };
package/index10.js CHANGED
@@ -1,39 +1,30 @@
1
- import { defineComponent as m, mergeModels as d, useModel as v, computed as t, renderSlot as w, createElementVNode as g, mergeProps as k, withModifiers as y, normalizeClass as $, normalizeStyle as h, openBlock as b, createElementBlock as B } from "vue";
2
- const p = w, n = g, M = k, z = y, E = $, S = h, C = b, N = B, T = /* @__PURE__ */ m({
1
+ import { defineComponent as i, renderSlot as d, createElementVNode as s, openBlock as c, createElementBlock as l } from "vue";
2
+ import { withPixel as t } from "@solar-kit/core";
3
+ import { getNavbarRect as p } from "@solar-taro/core";
4
+ const a = d, o = s, g = c, m = l, v = { class: "sun-navbar-inner" }, b = { class: "sun-navbar-center" }, k = /* @__PURE__ */ i({
3
5
  __name: "index",
4
- props: /* @__PURE__ */ d({
5
- placement: {},
6
- offset: { default: "6px" },
7
- background: { default: "rgba(0, 0, 0, 0.5)" },
8
- color: { default: "#fff" }
9
- }, {
10
- show: { type: Boolean },
11
- showModifiers: {}
12
- }),
13
- emits: ["update:show"],
14
- setup(r) {
15
- const o = r, l = v(r, "show"), a = t(() => ["left", "right"].includes(o.placement[0])), u = t(() => ["top", "bottom"].includes(o.placement[1])), f = t(() => a.value ? o.offset : "0px"), i = t(() => u.value ? o.offset : "0px");
16
- return (e, s) => (C(), N("view", {
17
- class: E(["sun-popover", [{ "sun-popover-show": l.value }, `sun-popover-x-${e.placement[0]}`, `sun-popover-y-${e.placement[1]}`]]),
18
- style: S({ "--popover-x-offset": f.value, "--popover-y-offset": i.value, "--popover-background": e.background }),
19
- onTap: z((c) => !1, ["stop"])
6
+ setup(_) {
7
+ const e = p(), r = {
8
+ "--navbar-height": t(e.height),
9
+ "--navbar-content-height": t(e.buttonHeight),
10
+ "--navbar-padding-top": t(e.paddingTop),
11
+ "--navbar-padding-bottom": t(e.paddingBottom),
12
+ "--navbar-padding-left": t(e.paddingLeft),
13
+ "--navbar-padding-right": t(e.paddingRight)
14
+ };
15
+ return (n, h) => (g(), m("view", {
16
+ class: "sun-navbar",
17
+ style: r
20
18
  }, [
21
- n("view", {
22
- class: "sun-popover-trigger",
23
- onTap: s[0] || (s[0] = (c) => l.value = !l.value)
24
- }, [
25
- p(e.$slots, "default")
26
- ], 32),
27
- n("view", M(e.$attrs, {
28
- class: "sun-popover-container",
29
- style: { color: e.color }
30
- }), [
31
- s[1] || (s[1] = n("view", { class: "sun-popover-arrow" }, null, -1)),
32
- p(e.$slots, "content")
33
- ], 16)
34
- ], 38));
19
+ o("view", v, [
20
+ a(n.$slots, "default"),
21
+ o("view", b, [
22
+ a(n.$slots, "center")
23
+ ])
24
+ ])
25
+ ]));
35
26
  }
36
27
  });
37
28
  export {
38
- T as default
29
+ k as default
39
30
  };
package/index11.js CHANGED
@@ -1,25 +1,39 @@
1
- import { defineComponent as p, inject as a, getCurrentInstance as c, onUnmounted as m, unref as u, renderSlot as i, mergeProps as _, openBlock as f, createElementBlock as v } from "vue";
2
- import { ACTIVE_CHILD as d, PARENT as g } from "./index46.js";
3
- const o = u, k = i, C = _, B = f, E = v, $ = /* @__PURE__ */ p({
4
- __name: "segment-btn",
5
- props: {
6
- value: {}
7
- },
8
- setup(b) {
9
- const l = a(d), e = a(g), n = c();
10
- return m(() => {
11
- e.unlink(n);
12
- }), e.link(n), (t, r) => {
13
- var s;
14
- return B(), E("view", C(t.$attrs, {
15
- class: ["sun-segment-btn", { "sun-segment-btn-active": ((s = o(l)) == null ? void 0 : s.props.value) === t.value }],
16
- onTap: r[0] || (r[0] = (I) => o(e).active(o(n)))
1
+ import { defineComponent as m, mergeModels as d, useModel as v, computed as t, renderSlot as w, createElementVNode as g, mergeProps as k, withModifiers as y, normalizeClass as $, normalizeStyle as h, openBlock as b, createElementBlock as B } from "vue";
2
+ const p = w, n = g, M = k, z = y, E = $, S = h, C = b, N = B, T = /* @__PURE__ */ m({
3
+ __name: "index",
4
+ props: /* @__PURE__ */ d({
5
+ placement: {},
6
+ offset: { default: "6px" },
7
+ background: { default: "rgba(0, 0, 0, 0.5)" },
8
+ color: { default: "#fff" }
9
+ }, {
10
+ show: { type: Boolean },
11
+ showModifiers: {}
12
+ }),
13
+ emits: ["update:show"],
14
+ setup(r) {
15
+ const o = r, l = v(r, "show"), a = t(() => ["left", "right"].includes(o.placement[0])), u = t(() => ["top", "bottom"].includes(o.placement[1])), f = t(() => a.value ? o.offset : "0px"), i = t(() => u.value ? o.offset : "0px");
16
+ return (e, s) => (C(), N("view", {
17
+ class: E(["sun-popover", [{ "sun-popover-show": l.value }, `sun-popover-x-${e.placement[0]}`, `sun-popover-y-${e.placement[1]}`]]),
18
+ style: S({ "--popover-x-offset": f.value, "--popover-y-offset": i.value, "--popover-background": e.background }),
19
+ onTap: z((c) => !1, ["stop"])
20
+ }, [
21
+ n("view", {
22
+ class: "sun-popover-trigger",
23
+ onTap: s[0] || (s[0] = (c) => l.value = !l.value)
24
+ }, [
25
+ p(e.$slots, "default")
26
+ ], 32),
27
+ n("view", M(e.$attrs, {
28
+ class: "sun-popover-container",
29
+ style: { color: e.color }
17
30
  }), [
18
- k(t.$slots, "default")
19
- ], 16);
20
- };
31
+ s[1] || (s[1] = n("view", { class: "sun-popover-arrow" }, null, -1)),
32
+ p(e.$slots, "content")
33
+ ], 16)
34
+ ], 38));
21
35
  }
22
36
  });
23
37
  export {
24
- $ as default
38
+ T as default
25
39
  };
package/index12.js CHANGED
@@ -1,55 +1,81 @@
1
- import { defineComponent as x, getCurrentInstance as V, shallowRef as E, shallowReactive as k, computed as a, provide as i, watch as C, onMounted as w, renderSlot as y, createElementVNode as B, mergeProps as I, openBlock as O, createElementBlock as A } from "vue";
2
- import { ACTIVE_CHILD as N, PARENT as P } from "./index46.js";
3
- const R = y, T = B, b = I, L = O, S = A, $ = { class: "sun-segment-inner" }, M = /* @__PURE__ */ x({
4
- __name: "segment",
1
+ import { defineComponent as C, watch as I, onMounted as L, onUnmounted as M, createElementVNode as k, unref as w, openBlock as z, createElementBlock as R } from "vue";
2
+ import { createSelectorQuery as y, getWindowInfo as Q, previewImage as S } from "@tarojs/taro";
3
+ import { QrCode as U, QrCodeEcc as a } from "./index53.js";
4
+ const h = k, A = w, B = z, D = R;
5
+ let T = 1;
6
+ const N = /* @__PURE__ */ C({
7
+ __name: "index",
5
8
  props: {
6
- modelValue: {}
9
+ value: {},
10
+ color: { default: "#000000" },
11
+ backgroundColor: { default: "transparent" },
12
+ level: { default: "M" }
7
13
  },
8
- emits: ["update:modelValue", "change"],
9
- setup(p, { emit: v }) {
10
- const r = v, c = p, m = V(), o = E(null), t = k([]), d = a(() => t.indexOf(o.value)), f = a(() => t.length), g = a(() => ({
11
- "--segment-length": f.value,
12
- "--segment-active-index": d.value
13
- }));
14
- i(N, o), i(P, {
15
- link: (e) => {
16
- const n = u();
17
- t.push(e), t.sort((s, l) => {
18
- const h = n.indexOf(s.vnode), _ = n.indexOf(l.vnode);
19
- return h - _;
20
- });
21
- },
22
- unlink: (e) => {
23
- t.slice(t.indexOf(e), 1);
24
- },
25
- active: (e) => {
26
- r("change", {
27
- value: e.props.value,
28
- index: d.value
29
- }), r("update:modelValue", e.props.value), o.value = e;
30
- }
31
- }), C(() => c.modelValue, (e) => {
32
- o.value = t.find((n) => n.props.value === e);
14
+ emits: ["rendered"],
15
+ setup(m, { expose: v, emit: g }) {
16
+ let n, i, l, s = !1;
17
+ const u = `sun-qrcode-captcha-${T++}`, x = {
18
+ L: a.LOW,
19
+ M: a.MEDIUM,
20
+ Q: a.QUARTILE,
21
+ H: a.HIGH
22
+ }, _ = g, c = m;
23
+ v({
24
+ getDataURL: p
33
25
  });
34
- function u() {
35
- return m.subTree.children[0].children[0].children.filter((e) => typeof e.type != "symbol");
26
+ function d() {
27
+ setTimeout(() => {
28
+ y().select(`#${u}`).fields({ node: !0, size: !0 }).exec(([{ node: t, width: e, height: r }]) => {
29
+ if (s) return;
30
+ if (!r || !e)
31
+ return d();
32
+ const o = Q().pixelRatio;
33
+ n = t, l = n.getContext("2d"), i = e, n.width = e * o, n.height = r * o, l.scale(o, o), f();
34
+ });
35
+ }, 50);
36
+ }
37
+ function f() {
38
+ const t = U.encodeText(c.value, x[c.level]), e = i / (t.size + 2);
39
+ l.fillStyle = c.backgroundColor, l.fillRect(0, 0, n.width, n.height), l.fillStyle = c.color;
40
+ for (let r = 0; r < t.size; r++)
41
+ for (let o = 0; o < t.size; o++)
42
+ t.getModule(o, r) && l.fillRect(
43
+ o * e + e,
44
+ // +moduleSize 留出边距
45
+ r * e + e,
46
+ e,
47
+ e
48
+ );
49
+ _("rendered");
36
50
  }
37
- return w(() => {
38
- const e = u();
39
- t.forEach((n) => {
40
- const s = e.findIndex((l) => l === n.vnode);
41
- n.props.value === void 0 && (n.props.value = s), n.props.value === c.modelValue && (o.value = n);
51
+ function p() {
52
+ return n.toDataURL("image/png", 1);
53
+ }
54
+ function E() {
55
+ const t = p();
56
+ S({
57
+ current: t,
58
+ urls: [t]
42
59
  });
43
- }), (e, n) => (L(), S("view", b(e.$attrs, {
44
- class: "sun-segment",
45
- style: g.value
46
- }), [
47
- T("view", $, [
48
- R(e.$slots, "default")
49
- ])
50
- ], 16));
60
+ }
61
+ return I(() => c.value, () => {
62
+ l && f();
63
+ }), L(() => {
64
+ d();
65
+ }), M(() => {
66
+ s = !0;
67
+ }), (t, e) => (B(), D("view", {
68
+ class: "sun-qrcode",
69
+ onTap: e[0] || (e[0] = (r) => A(n) && E())
70
+ }, [
71
+ h("canvas", {
72
+ id: u,
73
+ type: "2d",
74
+ class: "sun-slider-captcha-canvas"
75
+ })
76
+ ], 32));
51
77
  }
52
78
  });
53
79
  export {
54
- M as default
80
+ N as default
55
81
  };