unika-components 1.0.266 → 1.0.268

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.
@@ -21,6 +21,7 @@ declare const _default: import("vue").DefineComponent<{
21
21
  upArrow: import("vue").Ref<boolean>;
22
22
  slideChangeTransitionEnd: (e: any) => void;
23
23
  slideClasses: (index: number) => string[];
24
+ filterProps: (props: Record<string, any>, keysToFilter: string[], isFilter: true) => Record<string, any>;
24
25
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
25
26
  work: {
26
27
  type: PropType<WorkData>;
@@ -1,36 +1,3 @@
1
-
2
- .uni-video-component {
3
- position: relative;
4
- text-align: center;
5
- }
6
- .play-pause-button {
7
- position: absolute;
8
- top: 50%;
9
- left: 50%;
10
- transform: translate(-50%, -50%);
11
- cursor: pointer;
12
- font-size: 2rem;
13
- color: #fff;
14
- background: rgba(0, 0, 0, 0.6);
15
- border-radius: 50%;
16
- padding: 10px;
17
- transition: background 0.3s;
18
- }
19
- .play-pause-button:hover {
20
- background: rgba(0, 0, 0, 0.8);
21
- }
22
-
23
- h2.uni-text-component, p.uni-text-component {
24
- margin-bottom: 0;
25
- }
26
- button.uni-text-component {
27
- padding: 5px 10px;
28
- cursor: pointer;
29
- }
30
- .uni-text-component {
31
- box-sizing: border-box;
32
- white-space: pre-wrap;
33
- }
34
1
 
35
2
  .uni-image-component {
36
3
  max-width: 100%;
@@ -38,18 +5,6 @@ button.uni-text-component {
38
5
  .uni-image-mask-wrapper {
39
6
  display: inline-block;
40
7
  }
41
-
42
-
43
- .uni-calendar-component {
44
-
45
- }
46
- .slot-number {
47
- position: absolute;
48
- bottom: 2px;
49
- left: 7px;
50
- font-size: 12px;
51
- color: #666
52
- }
53
8
 
54
9
  .slide-guide {
55
10
  position: absolute;
@@ -123,37 +78,44 @@ body, html {
123
78
  transform: translate3d(-50%, -50%, 0);
124
79
  }
125
80
  }
81
+ .static-position .uni-text-component {
82
+ position: static !important;
83
+ }
84
+ .static-transform .uni-text-component {
85
+ transform: rotate(0deg) !important;
86
+ }
126
87
 
127
- .like-button {
128
- display: flex;
129
- flex-direction: column;
130
- align-items: center;
131
- cursor: pointer;
132
- }
133
-
134
- .icon-heart {
135
- font-size: 24px;
136
- color: #e74c3c;
137
- }
88
+ .uni-video-component {
89
+ position: relative;
90
+ text-align: center;
91
+ }
92
+ .play-pause-button {
93
+ position: absolute;
94
+ top: 50%;
95
+ left: 50%;
96
+ transform: translate(-50%, -50%);
97
+ cursor: pointer;
98
+ font-size: 2rem;
99
+ color: #fff;
100
+ background: rgba(0, 0, 0, 0.6);
101
+ border-radius: 50%;
102
+ padding: 10px;
103
+ transition: background 0.3s;
104
+ }
105
+ .play-pause-button:hover {
106
+ background: rgba(0, 0, 0, 0.8);
107
+ }
138
108
 
139
- .liked {
140
- color: #f00; /* 更改颜色以示已赞 */
141
- }
142
109
 
143
- .like-count {
144
- margin-top: 4px;
145
- font-size: 16px;
146
- color: #333;
147
- }
110
+ .uni-calendar-component {
148
111
 
149
- .effect {
150
- width: 100%;
151
- height: 100%;
152
112
  }
153
-
154
- .uni-lotties-component {
155
- width: 100%;
156
- height: 100%;
113
+ .slot-number {
114
+ position: absolute;
115
+ bottom: 2px;
116
+ left: 7px;
117
+ font-size: 12px;
118
+ color: #666
157
119
  }
158
120
 
159
121
  .ant-input-number {
@@ -190,13 +152,50 @@ body, html {
190
152
  margin-bottom: 0px;
191
153
  vertical-align: top;
192
154
  }
155
+
156
+ .like-button {
157
+ display: flex;
158
+ flex-direction: column;
159
+ align-items: center;
160
+ cursor: pointer;
161
+ }
162
+
163
+ .icon-heart {
164
+ font-size: 24px;
165
+ color: #e74c3c;
166
+ }
167
+
168
+ .liked {
169
+ color: #f00; /* 更改颜色以示已赞 */
170
+ }
171
+
172
+ .like-count {
173
+ margin-top: 4px;
174
+ font-size: 16px;
175
+ color: #333;
176
+ }
177
+
178
+ .uni-lotties-component {
179
+ width: 100%;
180
+ height: 100%;
181
+ }
193
182
 
194
- .uni-svg-component {
195
- display: inline-block;
183
+ h2.uni-text-component, p.uni-text-component {
184
+ margin-bottom: 0;
185
+ }
186
+ button.uni-text-component {
187
+ padding: 5px 10px;
188
+ cursor: pointer;
189
+ }
190
+ .uni-text-component {
191
+ box-sizing: border-box;
192
+ white-space: pre-wrap;
196
193
  }
197
194
 
198
- .uni-build-up-component {
199
- }
195
+ .effect {
196
+ width: 100%;
197
+ height: 100%;
198
+ }
200
199
 
201
200
  .swiper-warp {
202
201
  width: 100%;
@@ -211,6 +210,13 @@ body, html {
211
210
  max-width: 100%;
212
211
  max-height: 100%;
213
212
  }
213
+
214
+ .uni-build-up-component {
215
+ }
216
+
217
+ .uni-svg-component {
218
+ display: inline-block;
219
+ }
214
220
  /**
215
221
  * Swiper 6.8.4
216
222
  * Most modern mobile touch slider and framework with hardware accelerated transitions
@@ -1,4 +1,4 @@
1
- import { computed, defineComponent, openBlock, createElementBlock, withModifiers, normalizeStyle as normalizeStyle$1, createBlock, resolveDynamicComponent, withCtx, createTextVNode, toDisplayString, createElementVNode, Fragment, renderList, normalizeProps, guardReactiveProps, h as h$2, ref, onUpdated, watch, nextTick as nextTick$1, onMounted, onBeforeUnmount, onBeforeUpdate, resolveComponent, createVNode, normalizeClass, mergeProps, createCommentVNode, renderSlot, pushScopeId, popScopeId, toRefs, onBeforeMount, onUnmounted, withDirectives, vShow, isVNode, Comment, Text, reactive, getCurrentInstance, inject, provide, unref, shallowRef, watchEffect, triggerRef, Transition, resolveDirective, cloneVNode, toRef, Teleport, isRef, toRaw, render as render$n, TransitionGroup } from 'vue';
1
+ import { computed, defineComponent, openBlock, createBlock, resolveDynamicComponent, withModifiers, normalizeStyle as normalizeStyle$1, withCtx, createTextVNode, toDisplayString, createElementBlock, createElementVNode, Fragment, renderList, normalizeProps, guardReactiveProps, h as h$2, ref, onUpdated, watch, nextTick as nextTick$1, onMounted, onBeforeUnmount, onBeforeUpdate, resolveComponent, createVNode, normalizeClass, mergeProps, createCommentVNode, renderSlot, pushScopeId, popScopeId, toRefs, onBeforeMount, onUnmounted, withDirectives, vShow, isVNode, Comment, Text, reactive, getCurrentInstance, inject, provide, unref, shallowRef, watchEffect, triggerRef, Transition, resolveDirective, cloneVNode, toRef, Teleport, isRef, toRaw, render as render$n, TransitionGroup } from 'vue';
2
2
  import crypto from 'crypto';
3
3
 
4
4
  /** Detect free variable `global` from Node.js. */
@@ -5392,18 +5392,16 @@ var script$l = defineComponent({
5392
5392
  });
5393
5393
 
5394
5394
  function render$m(_ctx, _cache, $props, $setup, $data, $options) {
5395
- return (openBlock(), createElementBlock("div", {
5396
- onClick: _cache[0] || (_cache[0] = withModifiers((...args) => (_ctx.handleClick && _ctx.handleClick(...args)), ["prevent"])),
5395
+ return (openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
5396
+ onClick: withModifiers(_ctx.handleClick, ["prevent"]),
5397
5397
  style: normalizeStyle$1(_ctx.styleProps),
5398
5398
  class: "uni-text-component inner-component"
5399
- }, [
5400
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), null, {
5401
- default: withCtx(() => [
5402
- createTextVNode(toDisplayString(_ctx.text), 1 /* TEXT */)
5403
- ]),
5404
- _: 1 /* STABLE */
5405
- }))
5406
- ], 4 /* STYLE */))
5399
+ }, {
5400
+ default: withCtx(() => [
5401
+ createTextVNode(toDisplayString(_ctx.text), 1 /* TEXT */)
5402
+ ]),
5403
+ _: 1 /* STABLE */
5404
+ }, 8 /* PROPS */, ["onClick", "style"]))
5407
5405
  }
5408
5406
 
5409
5407
  script$l.render = render$m;
@@ -13081,6 +13079,22 @@ var script$h = defineComponent({
13081
13079
  }
13082
13080
  };
13083
13081
  const upArrow = ref(true);
13082
+ const filterProps = (props, keysToFilter, isFilter) => {
13083
+ const filteredProps = {};
13084
+ Object.keys(props).forEach((key) => {
13085
+ if (isFilter) {
13086
+ if (keysToFilter.includes(key)) {
13087
+ filteredProps[key] = props[key];
13088
+ }
13089
+ }
13090
+ else {
13091
+ if (!keysToFilter.includes(key)) {
13092
+ filteredProps[key] = props[key];
13093
+ }
13094
+ }
13095
+ });
13096
+ return filteredProps;
13097
+ };
13084
13098
  const runAnimations = (currentIndex) => {
13085
13099
  const pages = cloneDeep$1(props.work && props.work.pages);
13086
13100
  pages[currentIndex].components && pages[currentIndex].components.forEach((component) => {
@@ -13091,7 +13105,6 @@ var script$h = defineComponent({
13091
13105
  let animIdx = 0;
13092
13106
  const oldStyle = { ...component.props };
13093
13107
  oldStyle.position = 'absolute'; // 添加绝对布局
13094
- oldStyle.transform = 'rotate(0deg)'; // 添加绝对布局
13095
13108
  const runAnimation = () => {
13096
13109
  if (animIdx < len) {
13097
13110
  const animation = animationQueue[animIdx];
@@ -13104,34 +13117,38 @@ var script$h = defineComponent({
13104
13117
  position: 'absolute', // 确保动画期间元素使用绝对布局
13105
13118
  };
13106
13119
  const element = componentRefs.value.get('component-' + component.id);
13120
+ if (animIdx) {
13121
+ element.classList.remove('static-transform');
13122
+ }
13107
13123
  if (element) {
13108
- const innerElement = element.querySelector('.inner-component');
13109
- if (innerElement) {
13110
- innerElement.style.cssText = getComputedCSSText(animationStyle) + getComputedCSSText(oldStyle);
13111
- animIdx++;
13112
- }
13124
+ // const innerElement = element.querySelector('.inner-component');
13125
+ // if (innerElement) {
13126
+ // innerElement.style.cssText = getComputedCSSText(animationStyle) + getComputedCSSText(oldStyle);
13127
+ element.style.cssText = getComputedCSSText(animationStyle) + getComputedCSSText(oldStyle);
13128
+ animIdx++;
13113
13129
  }
13130
+ // }
13114
13131
  }
13115
13132
  else {
13116
- console.log('aa');
13117
13133
  const element = componentRefs.value.get('component-' + component.id);
13134
+ element.classList.add('static-transform');
13118
13135
  if (element) {
13119
- const innerElement = element.querySelector('.inner-component');
13120
- if (innerElement) {
13121
- innerElement.style.cssText = getComputedCSSText(oldStyle);
13122
- }
13136
+ // const innerElement = element.querySelector('.inner-component');
13137
+ // if (innerElement) {
13138
+ element.style.cssText = getComputedCSSText(filterProps(oldStyle, ['position', 'top', 'left', 'width', 'height', 'transform'], true));
13123
13139
  }
13140
+ // }
13124
13141
  }
13125
13142
  };
13126
13143
  runAnimation();
13127
13144
  const element = componentRefs.value.get('component-' + component.id);
13128
13145
  if (element) {
13129
- const innerElement = element.querySelector('.inner-component');
13130
- if (innerElement) {
13131
- innerElement.addEventListener('animationend', runAnimation, false);
13132
- innerElement.addEventListener('webkitAnimationEnd', runAnimation, false);
13133
- }
13146
+ // const innerElement = element.querySelector('.inner-component');
13147
+ // if (innerElement) {
13148
+ element.addEventListener('animationend', runAnimation, false);
13149
+ element.addEventListener('webkitAnimationEnd', runAnimation, false);
13134
13150
  }
13151
+ // }
13135
13152
  });
13136
13153
  };
13137
13154
  const callUniLottiesPlay = (currentIndex) => {
@@ -13182,7 +13199,8 @@ var script$h = defineComponent({
13182
13199
  direction,
13183
13200
  upArrow,
13184
13201
  slideChangeTransitionEnd,
13185
- slideClasses
13202
+ slideClasses,
13203
+ filterProps
13186
13204
  };
13187
13205
  }
13188
13206
  });
@@ -13231,14 +13249,14 @@ function render$i(_ctx, _cache, $props, $setup, $data, $options) {
13231
13249
  ref: _ctx.setAnimationRef,
13232
13250
  id: `component-${item.id}`,
13233
13251
  key: item.id,
13234
- style: normalizeStyle$1({ width: '100%', height: '100%', transform: item.props.transform, position: 'absolute', left: '0px',top: '0px' })
13252
+ class: "static-position",
13253
+ style: normalizeStyle$1(_ctx.filterProps(item.props, ['position', 'top', 'left', 'width', 'height'], true))
13235
13254
  }, [
13236
13255
  (item.name != 'uni-build-up' && !item.isHidden)
13237
13256
  ? (openBlock(), createBlock(resolveDynamicComponent(item.name), mergeProps({ key: 0 }, item.props, {
13238
13257
  ref_for: true,
13239
- ref: el => _ctx.setComponentRef(el, `component-${item.id}`),
13240
- transform: 'rotate(0deg)'
13241
- }), null, 16 /* FULL_PROPS */, ["transform"]))
13258
+ ref: el => _ctx.setComponentRef(el, `component-${item.id}`)
13259
+ }), null, 16 /* FULL_PROPS */))
13242
13260
  : createCommentVNode("v-if", true)
13243
13261
  ], 12 /* STYLE, PROPS */, _hoisted_2$3))
13244
13262
  }), 128 /* KEYED_FRAGMENT */))
@@ -5399,18 +5399,16 @@
5399
5399
  });
5400
5400
 
5401
5401
  function render$m(_ctx, _cache, $props, $setup, $data, $options) {
5402
- return (vue.openBlock(), vue.createElementBlock("div", {
5403
- onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => (_ctx.handleClick && _ctx.handleClick(...args)), ["prevent"])),
5402
+ return (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
5403
+ onClick: vue.withModifiers(_ctx.handleClick, ["prevent"]),
5404
5404
  style: vue.normalizeStyle(_ctx.styleProps),
5405
5405
  class: "uni-text-component inner-component"
5406
- }, [
5407
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), null, {
5408
- default: vue.withCtx(() => [
5409
- vue.createTextVNode(vue.toDisplayString(_ctx.text), 1 /* TEXT */)
5410
- ]),
5411
- _: 1 /* STABLE */
5412
- }))
5413
- ], 4 /* STYLE */))
5406
+ }, {
5407
+ default: vue.withCtx(() => [
5408
+ vue.createTextVNode(vue.toDisplayString(_ctx.text), 1 /* TEXT */)
5409
+ ]),
5410
+ _: 1 /* STABLE */
5411
+ }, 8 /* PROPS */, ["onClick", "style"]))
5414
5412
  }
5415
5413
 
5416
5414
  script$l.render = render$m;
@@ -13088,6 +13086,22 @@
13088
13086
  }
13089
13087
  };
13090
13088
  const upArrow = vue.ref(true);
13089
+ const filterProps = (props, keysToFilter, isFilter) => {
13090
+ const filteredProps = {};
13091
+ Object.keys(props).forEach((key) => {
13092
+ if (isFilter) {
13093
+ if (keysToFilter.includes(key)) {
13094
+ filteredProps[key] = props[key];
13095
+ }
13096
+ }
13097
+ else {
13098
+ if (!keysToFilter.includes(key)) {
13099
+ filteredProps[key] = props[key];
13100
+ }
13101
+ }
13102
+ });
13103
+ return filteredProps;
13104
+ };
13091
13105
  const runAnimations = (currentIndex) => {
13092
13106
  const pages = cloneDeep$1(props.work && props.work.pages);
13093
13107
  pages[currentIndex].components && pages[currentIndex].components.forEach((component) => {
@@ -13098,7 +13112,6 @@
13098
13112
  let animIdx = 0;
13099
13113
  const oldStyle = { ...component.props };
13100
13114
  oldStyle.position = 'absolute'; // 添加绝对布局
13101
- oldStyle.transform = 'rotate(0deg)'; // 添加绝对布局
13102
13115
  const runAnimation = () => {
13103
13116
  if (animIdx < len) {
13104
13117
  const animation = animationQueue[animIdx];
@@ -13111,34 +13124,38 @@
13111
13124
  position: 'absolute', // 确保动画期间元素使用绝对布局
13112
13125
  };
13113
13126
  const element = componentRefs.value.get('component-' + component.id);
13127
+ if (animIdx) {
13128
+ element.classList.remove('static-transform');
13129
+ }
13114
13130
  if (element) {
13115
- const innerElement = element.querySelector('.inner-component');
13116
- if (innerElement) {
13117
- innerElement.style.cssText = getComputedCSSText(animationStyle) + getComputedCSSText(oldStyle);
13118
- animIdx++;
13119
- }
13131
+ // const innerElement = element.querySelector('.inner-component');
13132
+ // if (innerElement) {
13133
+ // innerElement.style.cssText = getComputedCSSText(animationStyle) + getComputedCSSText(oldStyle);
13134
+ element.style.cssText = getComputedCSSText(animationStyle) + getComputedCSSText(oldStyle);
13135
+ animIdx++;
13120
13136
  }
13137
+ // }
13121
13138
  }
13122
13139
  else {
13123
- console.log('aa');
13124
13140
  const element = componentRefs.value.get('component-' + component.id);
13141
+ element.classList.add('static-transform');
13125
13142
  if (element) {
13126
- const innerElement = element.querySelector('.inner-component');
13127
- if (innerElement) {
13128
- innerElement.style.cssText = getComputedCSSText(oldStyle);
13129
- }
13143
+ // const innerElement = element.querySelector('.inner-component');
13144
+ // if (innerElement) {
13145
+ element.style.cssText = getComputedCSSText(filterProps(oldStyle, ['position', 'top', 'left', 'width', 'height', 'transform'], true));
13130
13146
  }
13147
+ // }
13131
13148
  }
13132
13149
  };
13133
13150
  runAnimation();
13134
13151
  const element = componentRefs.value.get('component-' + component.id);
13135
13152
  if (element) {
13136
- const innerElement = element.querySelector('.inner-component');
13137
- if (innerElement) {
13138
- innerElement.addEventListener('animationend', runAnimation, false);
13139
- innerElement.addEventListener('webkitAnimationEnd', runAnimation, false);
13140
- }
13153
+ // const innerElement = element.querySelector('.inner-component');
13154
+ // if (innerElement) {
13155
+ element.addEventListener('animationend', runAnimation, false);
13156
+ element.addEventListener('webkitAnimationEnd', runAnimation, false);
13141
13157
  }
13158
+ // }
13142
13159
  });
13143
13160
  };
13144
13161
  const callUniLottiesPlay = (currentIndex) => {
@@ -13189,7 +13206,8 @@
13189
13206
  direction,
13190
13207
  upArrow,
13191
13208
  slideChangeTransitionEnd,
13192
- slideClasses
13209
+ slideClasses,
13210
+ filterProps
13193
13211
  };
13194
13212
  }
13195
13213
  });
@@ -13238,14 +13256,14 @@
13238
13256
  ref: _ctx.setAnimationRef,
13239
13257
  id: `component-${item.id}`,
13240
13258
  key: item.id,
13241
- style: vue.normalizeStyle({ width: '100%', height: '100%', transform: item.props.transform, position: 'absolute', left: '0px',top: '0px' })
13259
+ class: "static-position",
13260
+ style: vue.normalizeStyle(_ctx.filterProps(item.props, ['position', 'top', 'left', 'width', 'height'], true))
13242
13261
  }, [
13243
13262
  (item.name != 'uni-build-up' && !item.isHidden)
13244
13263
  ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.name), vue.mergeProps({ key: 0 }, item.props, {
13245
13264
  ref_for: true,
13246
- ref: el => _ctx.setComponentRef(el, `component-${item.id}`),
13247
- transform: 'rotate(0deg)'
13248
- }), null, 16 /* FULL_PROPS */, ["transform"]))
13265
+ ref: el => _ctx.setComponentRef(el, `component-${item.id}`)
13266
+ }), null, 16 /* FULL_PROPS */))
13249
13267
  : vue.createCommentVNode("v-if", true)
13250
13268
  ], 12 /* STYLE, PROPS */, _hoisted_2$3))
13251
13269
  }), 128 /* KEYED_FRAGMENT */))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unika-components",
3
- "version": "1.0.266",
3
+ "version": "1.0.268",
4
4
  "private": false,
5
5
  "main": "dist/unika-components.umd.js",
6
6
  "module": "dist/unika-components.esm.js",