luna-mobile-weapp 0.0.2 → 0.0.4

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.
@@ -45,7 +45,7 @@ Component({
45
45
  (() => select(action, i)).call(this, e);
46
46
  },
47
47
  __handler_keydown(e) {
48
- ((e: KeyboardEvent) => (e.key === 'Enter' || e.key === ' ') && select(action, i)).call(this, e);
48
+ ((e) => (e.key === 'Enter' || e.key === ' ') && select(action, i)).call(this, e);
49
49
  },
50
50
  close(e) {
51
51
  // 用户定义的处理函数
@@ -40,10 +40,10 @@ Component({
40
40
  (() => { selectedId = item.id; onselect?.(item); }).call(this, e);
41
41
  },
42
42
  __handler_click(e) {
43
- ((e: MouseEvent) => { e.stopPropagation(); onedit?.(item); }).call(this, e);
43
+ ((e) => { e.stopPropagation(); onedit?.(item); }).call(this, e);
44
44
  },
45
45
  __handler_click(e) {
46
- ((e: MouseEvent) => { e.stopPropagation(); ondelete?.(item); }).call(this, e);
46
+ ((e) => { e.stopPropagation(); ondelete?.(item); }).call(this, e);
47
47
  },
48
48
  onadd(e) {
49
49
  // 用户定义的处理函数
@@ -30,7 +30,7 @@ Component({
30
30
  // 用户定义的处理函数
31
31
  },
32
32
  __handler_keydown(e) {
33
- ((e: KeyboardEvent) => e.key === 'Enter' && handleClick()).call(this, e);
33
+ ((e) => e.key === 'Enter' && handleClick()).call(this, e);
34
34
  },
35
35
  },
36
36
 
@@ -38,7 +38,7 @@ Component({
38
38
 
39
39
  methods: {
40
40
  __handler_keydown(e) {
41
- (clickable ? (e: KeyboardEvent) => e.key === 'Enter' && onclick?.() : undefined).call(this, e);
41
+ (clickable ? (e) => e.key === 'Enter' && onclick?.() : undefined).call(this, e);
42
42
  },
43
43
  onclick(e) {
44
44
  // 用户定义的处理函数
@@ -44,7 +44,7 @@ Component({
44
44
  'radius': function() {
45
45
  this.setData({ circumference: 2 * Math.PI * radius });
46
46
  },
47
- 'pct, circumference': function() {
47
+ 'circumference, pct': function() {
48
48
  this.setData({ offset: circumference * (1 - pct / 100) });
49
49
  },
50
50
  },
@@ -35,7 +35,7 @@ Component({
35
35
  // 用户定义的处理函数
36
36
  },
37
37
  __handler_keydown(e) {
38
- ((e: KeyboardEvent) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); toggle(); } }).call(this, e);
38
+ ((e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); toggle(); } }).call(this, e);
39
39
  },
40
40
  },
41
41
 
@@ -64,7 +64,7 @@ Component({
64
64
  '**': function() {
65
65
  this.setData({ max: parseMax() });
66
66
  },
67
- 'max, min': function() {
67
+ 'min, max': function() {
68
68
  this.setData({ years: Array.from({ length: max.y - min.y + 1 }, (_: unknown, i: number) => min.y + i) });
69
69
  },
70
70
  '**': function() {
@@ -34,7 +34,7 @@ Component({
34
34
  // 用户定义的处理函数
35
35
  },
36
36
  __handler_keydown(e) {
37
- (clickable ? (e: KeyboardEvent) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onclick?.(); } } : undefined).call(this, e);
37
+ (clickable ? (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onclick?.(); } } : undefined).call(this, e);
38
38
  },
39
39
  },
40
40
 
@@ -33,7 +33,7 @@ Component({
33
33
  },
34
34
 
35
35
  observers: {
36
- 'steps, placement, current': function() {
36
+ 'current, placement, steps': function() {
37
37
  this.setData({ placement: steps[current]?.placement ?? 'bottom' });
38
38
  },
39
39
  'placement, targetRect': function() {
@@ -21,7 +21,7 @@ Component({
21
21
  },
22
22
 
23
23
  observers: {
24
- 'text, keywords': function() {
24
+ 'keywords, text': function() {
25
25
  this.setData({ parts: const kws = Array.isArray(keywords) ? keywords : [keywords];
26
26
  const valid = kws.filter(Boolean);
27
27
  if (!valid.length || !text) return [{ text, highlight: false }];
@@ -64,10 +64,10 @@ Component({
64
64
  'type': function() {
65
65
  this.setData({ isPassword: type === 'password' });
66
66
  },
67
- 'type, isPassword, pwdVisible': function() {
67
+ 'pwdVisible, isPassword, type': function() {
68
68
  this.setData({ inputType: isPassword && pwdVisible ? 'text' : type });
69
69
  },
70
- 'showStrength, value, isPassword': function() {
70
+ 'value, isPassword, showStrength': function() {
71
71
  this.setData({ strength: if (!isPassword || !showStrength || !value) return 0;
72
72
  let s = 0;
73
73
  if (value.length >= 6) s++;
@@ -36,7 +36,7 @@ Component({
36
36
  'value, disabled, min': function() {
37
37
  this.setData({ canDecrease: !disabled && value > min });
38
38
  },
39
- 'value, max, disabled': function() {
39
+ 'value, disabled, max': function() {
40
40
  this.setData({ canIncrease: !disabled && value < max });
41
41
  },
42
42
  },
@@ -30,7 +30,7 @@ Component({
30
30
  // 用户定义的处理函数
31
31
  },
32
32
  __handler_keydown(e) {
33
- ((e: KeyboardEvent) => e.key === 'Enter' && onback?.()).call(this, e);
33
+ ((e) => e.key === 'Enter' && onback?.()).call(this, e);
34
34
  },
35
35
  },
36
36
 
@@ -51,10 +51,10 @@ Component({
51
51
  },
52
52
 
53
53
  observers: {
54
- 'wrapWidth, contentWidth, scrollable': function() {
54
+ 'contentWidth, scrollable, wrapWidth': function() {
55
55
  this.setData({ shouldScroll: scrollable && contentWidth > wrapWidth });
56
56
  },
57
- 'speed, contentWidth': function() {
57
+ 'contentWidth, speed': function() {
58
58
  this.setData({ duration: contentWidth / speed });
59
59
  },
60
60
  },
@@ -13,10 +13,10 @@ Component({
13
13
 
14
14
  methods: {
15
15
  __handler_input(e) {
16
- ((e: Event) => handleInput(index, e)).call(this, e);
16
+ ((e) => handleInput(index, e)).call(this, e);
17
17
  },
18
18
  __handler_keydown(e) {
19
- ((e: KeyboardEvent) => handleKeyDown(index, e)).call(this, e);
19
+ ((e) => handleKeyDown(index, e)).call(this, e);
20
20
  },
21
21
  handlePaste(e) {
22
22
  // 用户定义的处理函数
@@ -53,7 +53,7 @@ Component({
53
53
  'count': function() {
54
54
  this.setData({ stars: Array.from({ length: count }, (_: unknown, i: number) => i) });
55
55
  },
56
- 'readonly, disabled': function() {
56
+ 'disabled, readonly': function() {
57
57
  this.setData({ interactive: !disabled && !readonly });
58
58
  },
59
59
  },
@@ -74,10 +74,10 @@ Component({
74
74
  // 用户定义的处理函数
75
75
  },
76
76
  __handler_mousemove(e) {
77
- ((e: MouseEvent) => onHover(index, e)).call(this, e);
77
+ ((e) => onHover(index, e)).call(this, e);
78
78
  },
79
79
  __handler_click(e) {
80
- ((e: MouseEvent) => onClick(index, e)).call(this, e);
80
+ ((e) => onClick(index, e)).call(this, e);
81
81
  },
82
82
  __bind_value(e) {
83
83
  this.setData({ value: e.detail.value });
@@ -42,7 +42,7 @@ Component({
42
42
 
43
43
  methods: {
44
44
  __handler_keydown(e) {
45
- ((e: KeyboardEvent) => e.key === 'Enter' && handleSearch()).call(this, e);
45
+ ((e) => e.key === 'Enter' && handleSearch()).call(this, e);
46
46
  },
47
47
  handleClear(e) {
48
48
  // 用户定义的处理函数
@@ -33,7 +33,7 @@ Component({
33
33
  },
34
34
 
35
35
  observers: {
36
- 'visible, cached, channels': function() {
36
+ 'cached, visible, channels': function() {
37
37
  this.setData({ items: visible ? channels : cached });
38
38
  },
39
39
  },
@@ -40,7 +40,7 @@ Component({
40
40
  },
41
41
 
42
42
  observers: {
43
- 'value, min, max': function() {
43
+ 'min, value, max': function() {
44
44
  this.setData({ pct: ((value - min) / (max - min)) * 100 });
45
45
  },
46
46
  },
@@ -43,7 +43,7 @@ Component({
43
43
  },
44
44
 
45
45
  observers: {
46
- 'activeIcon, inactiveText, activeText, inactiveIcon': function() {
46
+ 'activeIcon, activeText, inactiveText, inactiveIcon': function() {
47
47
  this.setData({ hasTrackDecor: !!(activeIcon || inactiveIcon || activeText || inactiveText) });
48
48
  },
49
49
  'activeThumbIcon, thumbIcon, inactiveThumbIcon': function() {
@@ -75,7 +75,7 @@ return thumbIcon ?? null; });
75
75
  // 用户定义的处理函数
76
76
  },
77
77
  __handler_keydown(e) {
78
- ((e: KeyboardEvent) => (e.key === ' ' || e.key === 'Enter') && (e.preventDefault(), toggle())).call(this, e);
78
+ ((e) => (e.key === ' ' || e.key === 'Enter') && (e.preventDefault(), toggle())).call(this, e);
79
79
  },
80
80
  __bind_checked(e) {
81
81
  this.setData({ checked: e.detail.value });
@@ -40,7 +40,7 @@ Component({
40
40
  // 用户定义的处理函数
41
41
  },
42
42
  __handler_keydown(e) {
43
- ((e: KeyboardEvent) => (e.key === 'Enter' || e.key === ' ') && handleClick()).call(this, e);
43
+ ((e) => (e.key === 'Enter' || e.key === ' ') && handleClick()).call(this, e);
44
44
  },
45
45
  },
46
46
 
@@ -40,7 +40,7 @@ Component({
40
40
  'block': function() {
41
41
  this.setData({ tag: block ? 'div' : 'span' });
42
42
  },
43
- 'color, size, block, truncate, weight': function() {
43
+ 'size, truncate, weight, block, color': function() {
44
44
  this.setData({ cls: [
45
45
  'ln-text',
46
46
  size && `ln-text--${size}`,
@@ -56,7 +56,7 @@ Component({
56
56
  (() => preview(file.url)).call(this, e);
57
57
  },
58
58
  __handler_click(e) {
59
- ((e: MouseEvent) => {
59
+ ((e) => {
60
60
  e.stopPropagation();
61
61
  remove(i);
62
62
  }).call(this, e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "luna-mobile-weapp",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "LunaMobile 微信小程序组件库",
5
5
  "miniprogram": "miniprogram_dist",
6
6
  "files": [