inviton-powerduck 0.0.146 → 0.0.148

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 (24) hide show
  1. package/common/css/ladda-themeless-zoomin.min.css +89 -89
  2. package/components/chart-js/thirdparty/flot/jquery.flot.categories.min.js +93 -93
  3. package/components/chart-js/thirdparty/flot/jquery.flot.crosshair.min.js +83 -83
  4. package/components/chart-js/thirdparty/flot/jquery.flot.navigate.min.js +270 -270
  5. package/components/chart-js/thirdparty/flot/jquery.flot.pie.min.js +507 -507
  6. package/components/chart-js/thirdparty/flot/jquery.flot.resize.min.js +147 -147
  7. package/components/chart-js/thirdparty/flot/jquery.flot.stack.min.js +104 -104
  8. package/components/counter/testall.tsx +79 -9
  9. package/components/dropdown/country-dropdown.tsx +11 -9
  10. package/components/dropdown/image-dropdown.tsx +45 -33
  11. package/components/dropdown/index.tsx +60 -39
  12. package/components/dropdown/language-dropdown.tsx +5 -13
  13. package/components/dropdown/mobile/legacy_fdd.ts +64 -50
  14. package/components/dropdown/ts/dropdownListHelper.ts +11 -0
  15. package/components/image-crop/vendor/jquery.Jcrop.min.css +344 -344
  16. package/components/import/import-mapper.tsx +231 -231
  17. package/components/input/checkbox.tsx +6 -8
  18. package/components/input/css/checkbox.css +109 -0
  19. package/components/input/css/radio-button-group.css +84 -2
  20. package/components/input/plugins/daterangepicker/daterangepicker.min.css +400 -400
  21. package/components/input/plugins/daterangepicker/jquery.daterangepicker.min.js +1903 -1903
  22. package/components/rating/rating-picker.tsx +57 -63
  23. package/components/svg/skilift-svg.tsx +6 -6
  24. package/package.json +1 -1
@@ -1,231 +1,231 @@
1
- import type { DropdownOptionGroup } from '../dropdown';
2
- import { Component, Prop } from 'vue-facing-decorator';
3
- import TsxComponent from '../../app/vuetsx';
4
- import { isNullOrEmpty } from '../../common/utils/is-null-or-empty';
5
- import { latinize } from '../../common/utils/latinize-string';
6
- import BootstrapToggle from '../bootstrap-toggle';
7
- import DropdownList from '../dropdown';
8
- import HtmlLiteral from '../html-literal/html-literal';
9
- import TextBox, { TextBoxTextType } from '../input/textbox';
10
- import './css/import-mapper.css';
11
-
12
- export interface ImportMapperMapping {
13
- columnIndex: number;
14
- mappingValue: string;
15
- }
16
-
17
- interface ImportMapperArgs {
18
- cssClass?: string;
19
- subtitleHtml: string;
20
- mappingOptions: DropdownOptionGroup[];
21
- importData: Array<Array<string>>;
22
- firstRowIsHeaderLabel?: string;
23
- defaultMapping?: ImportMapperMapping[];
24
- }
25
-
26
- @Component
27
- export default class ImportMapper extends TsxComponent<ImportMapperArgs> implements ImportMapperArgs {
28
- @Prop() cssClass!: string;
29
- @Prop() subtitleHtml!: string;
30
- @Prop() mappingOptions!: DropdownOptionGroup[];
31
- @Prop() importData!: Array<Array<string>>;
32
- @Prop() defaultMapping!: ImportMapperMapping[];
33
- @Prop() firstRowIsHeaderLabel!: string;
34
- private selectionMap: any = {};
35
- private firstRowHeader: boolean = false;
36
- private wasMatched = [];
37
-
38
- public getData(): any[] {
39
- const retVal = [];
40
-
41
- this.importData.forEach((row, i) => {
42
- if (!this.firstRowHeader || i > 0) {
43
- const newItem = {};
44
- for (const key in this.selectionMap) {
45
- const keyInt = Number(key);
46
- let objVal = row[keyInt];
47
-
48
- if (objVal != null) {
49
- if (typeof objVal === 'string') {
50
- objVal = objVal.trim();
51
- }
52
- }
53
-
54
- newItem[this.selectionMap[key]] = objVal;
55
- }
56
-
57
- retVal.push(newItem);
58
- }
59
- });
60
-
61
- return retVal;
62
- }
63
-
64
- private getDisplayValue(obj: any): string {
65
- if (obj == null) {
66
- return null;
67
- } else if (obj._dte) {
68
- return obj.toDisplayString(true);
69
- }
70
-
71
- return obj;
72
- }
73
-
74
- private getLargestRow(): string[] {
75
- if (isNullOrEmpty(this.importData)) {
76
- return [];
77
- }
78
-
79
- let biggestLength = 0;
80
- this.importData.forEach((rowArr) => {
81
- if (rowArr != null && rowArr.length > biggestLength) {
82
- biggestLength = rowArr.length;
83
- }
84
- });
85
-
86
- const retVal = [];
87
- while (true) {
88
- if (retVal.length < biggestLength) {
89
- retVal.push('x');
90
- } else {
91
- break;
92
- }
93
- }
94
-
95
- return retVal;
96
- }
97
-
98
- private getDropdownSelectedItem(index: number) {
99
- const selection = this.selectionMap[index];
100
-
101
- if (selection == null) {
102
- const match = this.getHeaderItem(index);
103
-
104
- if (!isNullOrEmpty(match) && !this.wasMatched.includes(index)) {
105
- this.wasMatched.push(index);
106
- this.setDropdownSelectedItem(index, match.id);
107
- return match.id;
108
- } else {
109
- return null;
110
- }
111
- }
112
-
113
- if (selection.includes('ncf:')) {
114
- return 'custom';
115
- }
116
-
117
- return this.selectionMap[index];
118
- }
119
-
120
- private setDropdownSelectedItem(index: number, value: any) {
121
- if (value == null || value.id == null) {
122
- if (typeof value === 'string') {
123
- // this.$set(this.selectionMap, index.toString(), value);
124
- this.selectionMap[index.toString()] = value;
125
- } else {
126
- // this.$set(this.selectionMap, index.toString(), null);
127
- this.selectionMap[index.toString()] = null;
128
- }
129
- } else {
130
- // this.$set(this.selectionMap, index.toString(), value.id);
131
- this.selectionMap[index.toString()] = value.id;
132
- }
133
- }
134
-
135
- private getPreviewRows(): Array<string[]> {
136
- if (isNullOrEmpty(this.importData)) {
137
- return [];
138
- }
139
-
140
- let start = 0;
141
- let end = 10;
142
- if (this.firstRowHeader) {
143
- start += 1;
144
- end += 1;
145
- }
146
-
147
- return this.importData.filter((u, i) => i >= start && i < end);
148
- }
149
-
150
- private getHeaderItem(index: number) {
151
- const opts = [];
152
-
153
- this.mappingOptions.forEach((mapOpts) => {
154
- mapOpts.children.forEach((s) => {
155
- opts.push(s);
156
- });
157
- });
158
-
159
- if (this.importData[0][index] != null) {
160
- const indexItem = this.importData[0][index].toString();
161
- const headers = opts.filter(p => latinize(p.text).toLowerCase() == latinize(indexItem).toLowerCase() || latinize(p.id).toLowerCase() == latinize(indexItem).toLowerCase());
162
- if (headers != null && headers.length == 1) {
163
- return headers[0];
164
- }
165
- } else {
166
- return null;
167
- }
168
- }
169
-
170
- private prefillNewCustomFieldName(index: number) {
171
- let retVal = '';
172
- if (this.selectionMap[index].includes('ncf:')) {
173
- retVal = this.selectionMap[index].substring(4);
174
- } else {
175
- retVal = this.importData[0][index];
176
- }
177
-
178
- this.setDropdownSelectedItem(index, `ncf:${retVal}`);
179
- return retVal;
180
- }
181
-
182
- private render(h) {
183
- const largestRow = this.getLargestRow();
184
-
185
- return (
186
- <div class="import-mapper-root">
187
- <p class="import-mapper-subtitle">
188
- <HtmlLiteral innerHTML={this.subtitleHtml} />
189
- </p>
190
-
191
- {this.importData
192
- && (
193
- <div class="import-mapper-table-wrap">
194
- <table class="import-mapper-table">
195
- <thead>
196
- <tr>
197
- {largestRow.map((col, i) => {
198
- return (
199
- <td>
200
- <DropdownList wrap={false} label={null} placeholder="Select value" options={this.mappingOptions} selected={this.getDropdownSelectedItem(i)} changed={(v) => { this.setDropdownSelectedItem(i, v); }} />
201
-
202
- {this.selectionMap[i] != null && (this.selectionMap[i] == 'custom' || this.selectionMap[i].includes('ncf:'))
203
- && <TextBox wrap={false} label="" cssClass="hidden" value={this.prefillNewCustomFieldName(i)} changed={(v) => { this.setDropdownSelectedItem(i, `ncf:${v}`); }} textType={TextBoxTextType.Text} />}
204
- </td>
205
- );
206
- })}
207
- </tr>
208
- </thead>
209
- <tbody>
210
- {this.getPreviewRows().map(row => (
211
- <tr>
212
- {largestRow.map((col, i) => (
213
- <td>
214
- {this.getDisplayValue(row[i])}
215
- </td>
216
- ))}
217
- </tr>
218
- ))}
219
- </tbody>
220
- </table>
221
- </div>
222
- )}
223
-
224
- <div class="import-mapper-settings">
225
- {this.$slots.default}
226
- <BootstrapToggle label={this.firstRowIsHeaderLabel ? this.firstRowIsHeaderLabel : 'First row is header'} value={this.firstRowHeader} changed={(e) => { this.firstRowHeader = e; }} />
227
- </div>
228
- </div>
229
- );
230
- }
231
- }
1
+ import type { DropdownOptionGroup } from '../dropdown';
2
+ import { Component, Prop } from 'vue-facing-decorator';
3
+ import TsxComponent from '../../app/vuetsx';
4
+ import { isNullOrEmpty } from '../../common/utils/is-null-or-empty';
5
+ import { latinize } from '../../common/utils/latinize-string';
6
+ import BootstrapToggle from '../bootstrap-toggle';
7
+ import DropdownList from '../dropdown';
8
+ import HtmlLiteral from '../html-literal/html-literal';
9
+ import TextBox, { TextBoxTextType } from '../input/textbox';
10
+ import './css/import-mapper.css';
11
+
12
+ export interface ImportMapperMapping {
13
+ columnIndex: number;
14
+ mappingValue: string;
15
+ }
16
+
17
+ interface ImportMapperArgs {
18
+ cssClass?: string;
19
+ subtitleHtml: string;
20
+ mappingOptions: DropdownOptionGroup[];
21
+ importData: Array<Array<string>>;
22
+ firstRowIsHeaderLabel?: string;
23
+ defaultMapping?: ImportMapperMapping[];
24
+ }
25
+
26
+ @Component
27
+ export default class ImportMapper extends TsxComponent<ImportMapperArgs> implements ImportMapperArgs {
28
+ @Prop() cssClass!: string;
29
+ @Prop() subtitleHtml!: string;
30
+ @Prop() mappingOptions!: DropdownOptionGroup[];
31
+ @Prop() importData!: Array<Array<string>>;
32
+ @Prop() defaultMapping!: ImportMapperMapping[];
33
+ @Prop() firstRowIsHeaderLabel!: string;
34
+ private selectionMap: any = {};
35
+ private firstRowHeader: boolean = false;
36
+ private wasMatched = [];
37
+
38
+ public getData(): any[] {
39
+ const retVal = [];
40
+
41
+ this.importData.forEach((row, i) => {
42
+ if (!this.firstRowHeader || i > 0) {
43
+ const newItem = {};
44
+ for (const key in this.selectionMap) {
45
+ const keyInt = Number(key);
46
+ let objVal = row[keyInt];
47
+
48
+ if (objVal != null) {
49
+ if (typeof objVal === 'string') {
50
+ objVal = objVal.trim();
51
+ }
52
+ }
53
+
54
+ newItem[this.selectionMap[key]] = objVal;
55
+ }
56
+
57
+ retVal.push(newItem);
58
+ }
59
+ });
60
+
61
+ return retVal;
62
+ }
63
+
64
+ private getDisplayValue(obj: any): string {
65
+ if (obj == null) {
66
+ return null;
67
+ } else if (obj._dte) {
68
+ return obj.toDisplayString(true);
69
+ }
70
+
71
+ return obj;
72
+ }
73
+
74
+ private getLargestRow(): string[] {
75
+ if (isNullOrEmpty(this.importData)) {
76
+ return [];
77
+ }
78
+
79
+ let biggestLength = 0;
80
+ this.importData.forEach((rowArr) => {
81
+ if (rowArr != null && rowArr.length > biggestLength) {
82
+ biggestLength = rowArr.length;
83
+ }
84
+ });
85
+
86
+ const retVal = [];
87
+ while (true) {
88
+ if (retVal.length < biggestLength) {
89
+ retVal.push('x');
90
+ } else {
91
+ break;
92
+ }
93
+ }
94
+
95
+ return retVal;
96
+ }
97
+
98
+ private getDropdownSelectedItem(index: number) {
99
+ const selection = this.selectionMap[index];
100
+
101
+ if (selection == null) {
102
+ const match = this.getHeaderItem(index);
103
+
104
+ if (!isNullOrEmpty(match) && !this.wasMatched.includes(index)) {
105
+ this.wasMatched.push(index);
106
+ this.setDropdownSelectedItem(index, match.id);
107
+ return match.id;
108
+ } else {
109
+ return null;
110
+ }
111
+ }
112
+
113
+ if (selection.includes('ncf:')) {
114
+ return 'custom';
115
+ }
116
+
117
+ return this.selectionMap[index];
118
+ }
119
+
120
+ private setDropdownSelectedItem(index: number, value: any) {
121
+ if (value == null || value.id == null) {
122
+ if (typeof value === 'string') {
123
+ // this.$set(this.selectionMap, index.toString(), value);
124
+ this.selectionMap[index.toString()] = value;
125
+ } else {
126
+ // this.$set(this.selectionMap, index.toString(), null);
127
+ this.selectionMap[index.toString()] = null;
128
+ }
129
+ } else {
130
+ // this.$set(this.selectionMap, index.toString(), value.id);
131
+ this.selectionMap[index.toString()] = value.id;
132
+ }
133
+ }
134
+
135
+ private getPreviewRows(): Array<string[]> {
136
+ if (isNullOrEmpty(this.importData)) {
137
+ return [];
138
+ }
139
+
140
+ let start = 0;
141
+ let end = 10;
142
+ if (this.firstRowHeader) {
143
+ start += 1;
144
+ end += 1;
145
+ }
146
+
147
+ return this.importData.filter((u, i) => i >= start && i < end);
148
+ }
149
+
150
+ private getHeaderItem(index: number) {
151
+ const opts = [];
152
+
153
+ this.mappingOptions.forEach((mapOpts) => {
154
+ mapOpts.children.forEach((s) => {
155
+ opts.push(s);
156
+ });
157
+ });
158
+
159
+ if (this.importData[0][index] != null) {
160
+ const indexItem = this.importData[0][index].toString();
161
+ const headers = opts.filter(p => latinize(p.text).toLowerCase() == latinize(indexItem).toLowerCase() || latinize(p.id).toLowerCase() == latinize(indexItem).toLowerCase());
162
+ if (headers != null && headers.length == 1) {
163
+ return headers[0];
164
+ }
165
+ } else {
166
+ return null;
167
+ }
168
+ }
169
+
170
+ private prefillNewCustomFieldName(index: number) {
171
+ let retVal = '';
172
+ if (this.selectionMap[index].includes('ncf:')) {
173
+ retVal = this.selectionMap[index].substring(4);
174
+ } else {
175
+ retVal = this.importData[0][index];
176
+ }
177
+
178
+ this.setDropdownSelectedItem(index, `ncf:${retVal}`);
179
+ return retVal;
180
+ }
181
+
182
+ private render(h) {
183
+ const largestRow = this.getLargestRow();
184
+
185
+ return (
186
+ <div class="import-mapper-root">
187
+ <p class="import-mapper-subtitle">
188
+ <HtmlLiteral innerHTML={this.subtitleHtml} />
189
+ </p>
190
+
191
+ {this.importData
192
+ && (
193
+ <div class="import-mapper-table-wrap">
194
+ <table class="import-mapper-table">
195
+ <thead>
196
+ <tr>
197
+ {largestRow.map((col, i) => {
198
+ return (
199
+ <td>
200
+ <DropdownList wrap={false} label={null} placeholder="Select value" options={this.mappingOptions} selected={this.getDropdownSelectedItem(i)} changed={(v) => { this.setDropdownSelectedItem(i, v); }} />
201
+
202
+ {this.selectionMap[i] != null && (this.selectionMap[i] == 'custom' || this.selectionMap[i].includes('ncf:'))
203
+ && <TextBox wrap={false} label="" cssClass="hidden" value={this.prefillNewCustomFieldName(i)} changed={(v) => { this.setDropdownSelectedItem(i, `ncf:${v}`); }} textType={TextBoxTextType.Text} />}
204
+ </td>
205
+ );
206
+ })}
207
+ </tr>
208
+ </thead>
209
+ <tbody>
210
+ {this.getPreviewRows().map(row => (
211
+ <tr>
212
+ {largestRow.map((col, i) => (
213
+ <td>
214
+ {this.getDisplayValue(row[i])}
215
+ </td>
216
+ ))}
217
+ </tr>
218
+ ))}
219
+ </tbody>
220
+ </table>
221
+ </div>
222
+ )}
223
+
224
+ <div class="import-mapper-settings">
225
+ {this.$slots.default}
226
+ <BootstrapToggle label={this.firstRowIsHeaderLabel ? this.firstRowIsHeaderLabel : 'First row is header'} value={this.firstRowHeader} changed={(e) => { this.firstRowHeader = e; }} />
227
+ </div>
228
+ </div>
229
+ );
230
+ }
231
+ }
@@ -5,6 +5,7 @@ import TsxComponent, { Component } from '../../app/vuetsx';
5
5
  import { PortalUtils } from '../../common/utils/utils';
6
6
  import FormItemWrapper from '../form/form-item-wrapper';
7
7
  import HtmlLiteral from '../html-literal/html-literal';
8
+ import './css/checkbox.css';
8
9
 
9
10
  interface CheckBoxArgs extends FormItemWrapperArgs {
10
11
  value: boolean;
@@ -93,9 +94,8 @@ class CheckBoxComponent extends TsxComponent<CheckBoxArgs> implements CheckBoxAr
93
94
  }
94
95
 
95
96
  renderCheckboxNowUi(h) {
96
- const checkboxClass = `form-check ${
97
- this.wrap ? 'ui-checkbox-wrapped' : 'ui-checkbox-nonwrapped'
98
- }${this.size === CheckBoxSize.Small ? ' ui-checkbox-sm' : ''}`;
97
+ const checkboxClass = `form-check ${this.wrap ? 'ui-checkbox-wrapped' : 'ui-checkbox-nonwrapped'
98
+ }${this.size === CheckBoxSize.Small ? ' ui-checkbox-sm' : ''}`;
99
99
 
100
100
  return (
101
101
  <div class={checkboxClass}>
@@ -113,8 +113,7 @@ class CheckBoxComponent extends TsxComponent<CheckBoxArgs> implements CheckBoxAr
113
113
  this.uuid = PortalUtils.randomString(12);
114
114
  }
115
115
 
116
- const checkboxClass = `inv-md-checkbox${
117
- this.size === CheckBoxSize.Small ? ' inv-md-checkbox-sm' : ''}`;
116
+ const checkboxClass = `inv-md-checkbox${this.size === CheckBoxSize.Small ? ' inv-md-checkbox-sm' : ''}`;
118
117
 
119
118
  return (
120
119
  <div class={checkboxClass}>
@@ -133,9 +132,8 @@ class CheckBoxComponent extends TsxComponent<CheckBoxArgs> implements CheckBoxAr
133
132
  this.uuid = PortalUtils.randomString(12);
134
133
  }
135
134
 
136
- const checkboxClass = `inv-md-checkbox${
137
- this.size === CheckBoxSize.Small ? ' inv-md-checkbox-sm' : ''
138
- }${this.skin === CheckBoxSkin.MinusVariant ? ' inv-md-checkbox-minus' : ''}`;
135
+ const checkboxClass = `inv-md-checkbox${this.size === CheckBoxSize.Small ? ' inv-md-checkbox-sm' : ''
136
+ }${this.skin === CheckBoxSkin.MinusVariant ? ' inv-md-checkbox-minus' : ''}`;
139
137
 
140
138
  return (
141
139
  <div class={checkboxClass}>
@@ -0,0 +1,109 @@
1
+ .inv-md-checkbox input[type='checkbox'] {
2
+ border: 0;
3
+ clip: rect(0 0 0 0);
4
+ height: 1px;
5
+ margin: -1px;
6
+ overflow: hidden;
7
+ padding: 0;
8
+ position: absolute !important;
9
+ width: 1px;
10
+ }
11
+
12
+ .inv-md-checkbox input[type='checkbox']:active+label:before {
13
+ transition-duration: 0s;
14
+ }
15
+
16
+ .inv-md-checkbox input[type='checkbox']+label {
17
+ position: relative !important;
18
+ padding-left: 30px;
19
+ vertical-align: top;
20
+ user-select: none;
21
+ cursor: pointer;
22
+ }
23
+
24
+ .inv-md-checkbox input[type='checkbox']+label:before {
25
+ box-sizing: content-box;
26
+ content: '';
27
+ color: #4f8196;
28
+ position: absolute !important;
29
+ top: 11px;
30
+ left: 0;
31
+ width: 14px;
32
+ height: 14px;
33
+ margin-top: -9px;
34
+ border: 2px solid #4f8196;
35
+ text-align: center;
36
+ transition: all 0.4s ease;
37
+ border-radius: 2px;
38
+ }
39
+
40
+ .inv-md-checkbox input[type='checkbox']+label:after {
41
+ box-sizing: content-box;
42
+ content: '';
43
+ background-color: #4f8196;
44
+ position: absolute !important;
45
+ top: 50%;
46
+ left: 4px;
47
+ width: 10px;
48
+ height: 10px;
49
+ margin-top: -5px;
50
+ transform: scale(0);
51
+ transform-origin: 50%;
52
+ transition: transform 200ms ease-out;
53
+ }
54
+
55
+ .inv-md-checkbox input[type='checkbox']:disabled+label:before {
56
+ border-color: #cccccc;
57
+ }
58
+
59
+ .inv-md-checkbox input[type='checkbox']:disabled:focus+label:before,
60
+ .inv-md-checkbox input[type='checkbox']:disabled:hover+label:before {
61
+ background-color: inherit;
62
+ }
63
+
64
+ .inv-md-checkbox input[type='checkbox']:disabled:checked+label:before {
65
+ background-color: #cccccc;
66
+ }
67
+
68
+ .inv-md-checkbox input[type='checkbox']+label:after {
69
+ background-color: transparent;
70
+ top: 12px;
71
+ left: 4px;
72
+ width: 8px;
73
+ height: 3px;
74
+ margin-top: -4px;
75
+ border-style: solid;
76
+ border-color: #ffffff;
77
+ border-width: 0 0 3px 3px;
78
+ border-image: none;
79
+ transform: rotate(-45deg) scale(0);
80
+ }
81
+
82
+ .inv-md-checkbox input[type='checkbox']:checked+label:after {
83
+ content: '';
84
+ transform: rotate(-45deg) scale(1);
85
+ transition: transform 200ms ease-out;
86
+ }
87
+
88
+ .inv-md-checkbox input[type='checkbox']:checked+label:before {
89
+ animation: invMdBorderscale 200ms ease-in;
90
+ background: #4f8196;
91
+ }
92
+
93
+ .inv-md-checkbox input[type='checkbox']:checked+label:after {
94
+ transform: rotate(-45deg) scale(1);
95
+ }
96
+
97
+ @keyframes invMdBorderscale {
98
+ 50% {
99
+ box-shadow: 0 0 0 2px #4f8196;
100
+ }
101
+ }
102
+
103
+ .form-check.ui-checkbox-nonwrapped {
104
+ padding-left: 0;
105
+ }
106
+
107
+ .form-check.ui-checkbox-nonwrapped label {
108
+ width: 100%;
109
+ }