inviton-powerduck 0.0.142 → 0.0.144

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.
@@ -1,8 +1,7 @@
1
- import type { TextBoxTextType } from './textbox';
2
1
  import { Prop, toNative } from 'vue-facing-decorator';
3
- import PowerduckState from '../../app/powerduck-state';
4
2
  import TsxComponent, { Component } from '../../app/vuetsx';
5
- import { PortalUtils } from '../../common/utils/utils';
3
+ import type { TextBoxTextType } from './textbox';
4
+ import TextBox from './textbox';
6
5
 
7
6
  interface TextBoxWithoutLabelArgs {
8
7
  value: string;
@@ -22,7 +21,6 @@ interface TextBoxWithoutLabelArgs {
22
21
  class TextBoxWithoutLabelComponent extends TsxComponent<TextBoxWithoutLabelArgs> implements TextBoxWithoutLabelArgs {
23
22
  @Prop() value: string;
24
23
  @Prop() placeholder!: string;
25
- @Prop() cssClass!: string;
26
24
  @Prop() disabled!: boolean;
27
25
  @Prop() nameAttr?: string;
28
26
  @Prop() textType: TextBoxTextType;
@@ -33,78 +31,25 @@ class TextBoxWithoutLabelComponent extends TsxComponent<TextBoxWithoutLabelArgs>
33
31
  @Prop() updateMode?: 'input' | 'change';
34
32
  @Prop() maxLength: number;
35
33
 
36
- fieldValue: string = null;
37
-
38
- mounted() {
39
- this.fieldValue = this.value;
40
- if (this.keyDown != null || this.enterPressed != null) {
41
- this.$el.addEventListener('keydown', (e) => {
42
- (this as any).keyDownHandler(e);
43
- });
44
- }
45
- }
46
-
47
- raiseChangeEvent(e) {
48
- this.populateValidationDeclaration();
49
-
50
- if (this.changed != null) {
51
- const newValue = e.target.value;
52
- this.fieldValue = newValue;
53
- this.changed(newValue);
54
- }
55
- }
56
-
57
- getTypeAttribute(): string {
58
- return this.textType || 'text';
59
- }
60
-
61
- getAutoCompleteText(): string {
62
- if (this.autoCompleteEnabled == false) {
63
- if (PortalUtils.isBrowserChrome()) {
64
- return 'new-password';
65
- } else {
66
- return 'off';
67
- }
68
- }
69
-
70
- return null;
71
- }
72
-
73
- keyDownHandler(e: KeyboardEvent) {
74
- if (this.keyDown != null) {
75
- this.keyDown(e);
76
- }
77
-
78
- if (this.enterPressed != null && (e.keyCode == 13 || e.which == 13)) {
79
- this.raiseChangeEvent(e);
80
- this.enterPressed(e);
81
- e.preventDefault();
82
- e.stopPropagation();
83
- e.stopImmediatePropagation();
84
- }
85
- }
86
-
87
34
  render(h) {
88
35
  return (
89
- <input
90
- type={this.getTypeAttribute()}
91
- disabled={(this.disabled as any) != true ? null : 'disabled'}
92
- value={this.fieldValue}
93
- maxlength={this.maxLength}
94
- name={this.nameAttr}
95
- onChange={e => this.raiseChangeEvent(e)}
96
- onInput={(e) => {
97
- if (this.updateMode == 'input') {
98
- this.raiseChangeEvent(e);
99
- }
100
- }}
101
- class={`${PowerduckState.getFormControlCssClass()} ${this.cssClass}`}
36
+ <TextBox
37
+ wrap={false}
38
+ value={this.value}
102
39
  placeholder={this.placeholder}
103
- autocomplete={this.getAutoCompleteText()}
40
+ textType={this.textType}
41
+ disabled={this.disabled}
42
+ autoCompleteEnabled={this.autoCompleteEnabled}
43
+ changed={this.changed}
44
+ maxLength={this.maxLength}
45
+ updateMode={this.updateMode}
46
+ nameAttr={this.nameAttr}
47
+ keyDown={this.keyDown}
48
+ enterPressed={this.enterPressed}
104
49
  />
105
50
  );
106
51
  }
107
52
  }
108
53
 
109
54
  const TextBoxWithoutLabel = toNative(TextBoxWithoutLabelComponent);
110
- export default TextBoxWithoutLabel;
55
+ export default TextBoxWithoutLabel;
@@ -1,6 +1,6 @@
1
- export const SKILIFT_SVG: string = `
2
- <svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000" preserveAspectRatio="xMidYMid meet">
3
- <g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)" fill="currentColor" stroke="none">
4
- <path d="M3911 4254 l-1153 -354 -40 34 c-77 66 -211 76 -290 20 -57 -40 -107 -107 -114 -153 l-6 -38 -1127 -345 -1126 -345 -3 -103 c-2 -94 -1 -102 15 -98 10 3 529 161 1154 353 l1135 347 43 -28 42 -29 -5 -55 c-2 -30 -21 -279 -42 -552 l-38 -498 -360 0 c-200 0 -390 -5 -426 -11 -173 -27 -319 -153 -371 -320 -18 -56 -19 -99 -19 -594 0 -495 1 -538 19 -594 50 -161 183 -281 350 -317 98 -20 1924 -20 2022 0 167 36 300 156 350 317 18 56 19 99 19 588 0 444 -2 536 -16 586 -44 170 -197 307 -374 335 -36 5 -227 10 -426 10 l-360 0 -38 498 c-21 273 -40 522 -43 552 -5 53 -4 56 25 73 40 23 72 69 93 131 l17 49 153 48 c85 26 309 95 499 153 852 260 1595 488 1598 490 1 2 1 48 0 103 l-3 100 -1154 -353z m-1913 -2666 l2 -358 -260 0 -260 0 0 353 c0 195 3 357 7 361 4 3 119 5 257 4 l251 -3 3 -357z m820 0 l2 -358 -260 0 -260 0 0 353 c0 195 3 357 7 361 4 3 119 5 257 4 l251 -3 3 -357z m820 0 l2 -358 -260 0 -260 0 0 353 c0 195 3 357 7 361 4 3 119 5 257 4 l251 -3 3 -357z"/>
5
- </g>
6
- </svg>`;
1
+ export const SKILIFT_SVG: string = `
2
+ <svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000" preserveAspectRatio="xMidYMid meet">
3
+ <g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)" fill="currentColor" stroke="none">
4
+ <path d="M3911 4254 l-1153 -354 -40 34 c-77 66 -211 76 -290 20 -57 -40 -107 -107 -114 -153 l-6 -38 -1127 -345 -1126 -345 -3 -103 c-2 -94 -1 -102 15 -98 10 3 529 161 1154 353 l1135 347 43 -28 42 -29 -5 -55 c-2 -30 -21 -279 -42 -552 l-38 -498 -360 0 c-200 0 -390 -5 -426 -11 -173 -27 -319 -153 -371 -320 -18 -56 -19 -99 -19 -594 0 -495 1 -538 19 -594 50 -161 183 -281 350 -317 98 -20 1924 -20 2022 0 167 36 300 156 350 317 18 56 19 99 19 588 0 444 -2 536 -16 586 -44 170 -197 307 -374 335 -36 5 -227 10 -426 10 l-360 0 -38 498 c-21 273 -40 522 -43 552 -5 53 -4 56 25 73 40 23 72 69 93 131 l17 49 153 48 c85 26 309 95 499 153 852 260 1595 488 1598 490 1 2 1 48 0 103 l-3 100 -1154 -353z m-1913 -2666 l2 -358 -260 0 -260 0 0 353 c0 195 3 357 7 361 4 3 119 5 257 4 l251 -3 3 -357z m820 0 l2 -358 -260 0 -260 0 0 353 c0 195 3 357 7 361 4 3 119 5 257 4 l251 -3 3 -357z m820 0 l2 -358 -260 0 -260 0 0 353 c0 195 3 357 7 361 4 3 119 5 257 4 l251 -3 3 -357z"/>
5
+ </g>
6
+ </svg>`;
@@ -13,6 +13,7 @@ interface SwiperGalleryArgs {
13
13
  imageArr: string[];
14
14
  skin: 'none' | 'mobile';
15
15
  showThumbs?: boolean;
16
+ slidesPerView?: number | "auto";
16
17
  cssClass?: string;
17
18
  }
18
19
 
@@ -21,9 +22,10 @@ class SwiperGalleryComponent extends TsxComponent<SwiperGalleryArgs> implements
21
22
  @Prop() imageArr: string[];
22
23
  @Prop() skin: 'none' | 'mobile';
23
24
  @Prop() showThumbs?: boolean;
25
+ @Prop() slidesPerView?: number | "auto";
24
26
  @Prop() cssClass?: string;
25
27
 
26
- mounted() {
28
+ mounted () {
27
29
  let swiper: any = null;
28
30
  if (this.shouldShowThumbs()) {
29
31
  swiper = new SwiperCore(this.$refs.galleryThumbs as any, {
@@ -34,7 +36,7 @@ class SwiperGalleryComponent extends TsxComponent<SwiperGalleryArgs> implements
34
36
  Thumbs,
35
37
  ],
36
38
  spaceBetween: 10,
37
- slidesPerView: 4,
39
+ slidesPerView: this.getSlidesPerView(),
38
40
  freeMode: true,
39
41
  watchSlidesProgress: true,
40
42
  });
@@ -48,6 +50,7 @@ class SwiperGalleryComponent extends TsxComponent<SwiperGalleryArgs> implements
48
50
  Thumbs,
49
51
  ],
50
52
  spaceBetween: 10,
53
+ slidesPerView: this.getSlidesPerView(),
51
54
  thumbs: this.shouldShowThumbs() ? { swiper } : undefined,
52
55
  navigation: {
53
56
  nextEl: '.swiper-button-next',
@@ -56,15 +59,23 @@ class SwiperGalleryComponent extends TsxComponent<SwiperGalleryArgs> implements
56
59
  });
57
60
  }
58
61
 
59
- shouldShowThumbs(): boolean {
62
+ shouldShowThumbs (): boolean {
60
63
  return this.showThumbs != false;
61
64
  }
62
65
 
63
- getSkinCss(): string {
66
+ getSlidesPerView (): number | "auto" {
67
+ if (this.shouldShowThumbs()) {
68
+ return this.slidesPerView ?? 1;
69
+ } else {
70
+ return this.slidesPerView ?? 4;
71
+ }
72
+ }
73
+
74
+ getSkinCss (): string {
64
75
  return `swiper-gallery-skin-${this.skin || 'none'}`;
65
76
  }
66
77
 
67
- render(h) {
78
+ render (h) {
68
79
  return (
69
80
 
70
81
  <div class={`swiper-gallery-root ${this.getSkinCss()}${this.cssClass ? ` ${this.cssClass}` : ''}`}>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "inviton-powerduck",
3
3
  "type": "module",
4
- "version": "0.0.142",
4
+ "version": "0.0.144",
5
5
  "files": [
6
6
  "app/",
7
7
  "common/",