@ptcwebops/ptcw-design 0.8.4 → 0.8.6
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.
- package/dist/cjs/dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/icon-asset.cjs.entry.js +2 -2
- package/dist/cjs/{index-8745a0a3.js → index-c27e52b2.js} +39 -1
- package/dist/cjs/list-item.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/lottie-player.cjs.entry.js +16369 -13058
- package/dist/cjs/max-width-container.cjs.entry.js +40 -0
- package/dist/cjs/my-component.cjs.entry.js +1 -1
- package/dist/cjs/ptc-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/ptc-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ptc-announcement.cjs.entry.js +1 -2
- package/dist/cjs/ptc-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ptc-button.cjs.entry.js +1 -2
- package/dist/cjs/ptc-card-bottom.cjs.entry.js +2 -2
- package/dist/cjs/ptc-card-content.cjs.entry.js +12 -2
- package/dist/cjs/ptc-card-wrapper.cjs.entry.js +35 -2
- package/dist/cjs/ptc-card_6.cjs.entry.js +2 -15
- package/dist/cjs/ptc-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/ptc-collapse-list.cjs.entry.js +1 -1
- package/dist/cjs/ptc-container.cjs.entry.js +1 -1
- package/dist/cjs/ptc-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/ptc-dynamic-card.cjs.entry.js +1 -2
- package/dist/cjs/ptc-ellipsis-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/ptc-filter-tag.cjs.entry.js +1 -1
- package/dist/cjs/ptc-hero-footer-cta.cjs.entry.js +1 -1
- package/dist/cjs/ptc-hero.cjs.entry.js +1 -1
- package/dist/cjs/ptc-icon-list.cjs.entry.js +1 -1
- package/dist/cjs/ptc-icon-minimize.cjs.entry.js +1 -1
- package/dist/cjs/ptc-link.cjs.entry.js +1 -1
- package/dist/cjs/ptc-list.cjs.entry.js +1 -2
- package/dist/cjs/ptc-lottie.cjs.entry.js +1 -1
- package/dist/cjs/ptc-media-card.cjs.entry.js +1 -1
- package/dist/cjs/ptc-minimized-footer.cjs.entry.js +1 -1
- package/dist/cjs/ptc-minimized-header.cjs.entry.js +1 -1
- package/dist/cjs/ptc-mobile-select.cjs.entry.js +422 -717
- package/dist/cjs/ptc-modal.cjs.entry.js +1 -1
- package/dist/cjs/ptc-overlay.cjs.entry.js +6 -3
- package/dist/cjs/ptc-pagenation.cjs.entry.js +1 -1
- package/dist/cjs/ptc-previous-url.cjs.entry.js +1 -1
- package/dist/cjs/ptc-pricing-block.cjs.entry.js +1 -1
- package/dist/cjs/ptc-quote.cjs.entry.js +1 -1
- package/dist/cjs/ptc-readmore_2.cjs.entry.js +51 -7
- package/dist/cjs/ptc-responsive-wrapper.cjs.entry.js +1 -1
- package/dist/cjs/ptc-shopping-cart.cjs.entry.js +1 -1
- package/dist/cjs/ptc-social-share.cjs.entry.js +1 -1
- package/dist/cjs/ptc-span.cjs.entry.js +1 -1
- package/dist/cjs/ptc-sticky-icons.cjs.entry.js +1 -1
- package/dist/cjs/ptc-svg-btn.cjs.entry.js +1 -1
- package/dist/cjs/ptc-tab-list.cjs.entry.js +1 -1
- package/dist/cjs/ptc-text-copy-with-background.cjs.entry.js +9 -4
- package/dist/cjs/ptc-title.cjs.entry.js +6 -4
- package/dist/cjs/ptc-two-column-media.cjs.entry.js +1 -1
- package/dist/cjs/ptcw-design.cjs.js +7 -3
- package/dist/cjs/tab-content.cjs.entry.js +1 -1
- package/dist/cjs/tab-header.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/icon-asset/icon-asset.css +2 -2
- package/dist/collection/components/max-width-container/max-width-container.css +7 -0
- package/dist/collection/components/max-width-container/max-width-container.js +80 -0
- package/dist/collection/components/ptc-announcement/ptc-announcement.js +0 -1
- package/dist/collection/components/ptc-button/ptc-button.js +0 -1
- package/dist/collection/components/ptc-card/ptc-card.css +1 -1
- package/dist/collection/components/ptc-card-bottom/ptc-card-bottom.css +6 -1
- package/dist/collection/components/ptc-card-content/ptc-card-content.css +10 -2
- package/dist/collection/components/ptc-card-content/ptc-card-content.js +49 -0
- package/dist/collection/components/ptc-card-wrapper/ptc-card-wrapper.js +43 -1
- package/dist/collection/components/ptc-dynamic-card/ptc-dynamic-card.js +0 -1
- package/dist/collection/components/ptc-img/ptc-img.js +0 -3
- package/dist/collection/components/ptc-list/ptc-list.js +0 -1
- package/dist/collection/components/ptc-mobile-select/ptc-mobile-select.css +41 -32
- package/dist/collection/components/ptc-overlay/ptc-overlay.css +4 -0
- package/dist/collection/components/ptc-overlay/ptc-overlay.js +29 -3
- package/dist/collection/components/ptc-para/ptc-para.js +0 -8
- package/dist/collection/components/ptc-picture/ptc-picture.js +0 -2
- package/dist/collection/components/ptc-readmore/ptc-readmore.css +58 -3
- package/dist/collection/components/ptc-readmore/ptc-readmore.js +153 -5
- package/dist/collection/components/ptc-text-copy-with-background/ptc-text-copy-with-background.css +153 -2
- package/dist/collection/components/ptc-text-copy-with-background/ptc-text-copy-with-background.js +45 -4
- package/dist/collection/components/ptc-title/ptc-title.css +15 -9
- package/dist/collection/components/ptc-title/ptc-title.js +24 -5
- package/dist/collection/components/ptc-tooltip/ptc-tooltip.css +10 -0
- package/dist/collection/components/ptc-tooltip/ptc-tooltip.js +54 -3
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +17095 -13974
- package/dist/esm/dropdown-item.entry.js +1 -1
- package/dist/esm/icon-asset.entry.js +2 -2
- package/dist/esm/{index-0c73b51e.js → index-40bc29fc.js} +39 -2
- package/dist/esm/list-item.entry.js +1 -1
- package/dist/esm/loader.js +4 -3
- package/dist/esm/lottie-player.entry.js +16369 -13058
- package/dist/esm/max-width-container.entry.js +36 -0
- package/dist/esm/my-component.entry.js +1 -1
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/ptc-accordion-item.entry.js +1 -1
- package/dist/esm/ptc-accordion.entry.js +1 -1
- package/dist/esm/ptc-announcement.entry.js +1 -2
- package/dist/esm/ptc-breadcrumb.entry.js +1 -1
- package/dist/esm/ptc-button.entry.js +1 -2
- package/dist/esm/ptc-card-bottom.entry.js +2 -2
- package/dist/esm/ptc-card-content.entry.js +12 -2
- package/dist/esm/ptc-card-wrapper.entry.js +35 -2
- package/dist/esm/ptc-card_6.entry.js +2 -15
- package/dist/esm/ptc-checkbox.entry.js +1 -1
- package/dist/esm/ptc-collapse-list.entry.js +1 -1
- package/dist/esm/ptc-container.entry.js +1 -1
- package/dist/esm/ptc-dropdown.entry.js +1 -1
- package/dist/esm/ptc-dynamic-card.entry.js +1 -2
- package/dist/esm/ptc-ellipsis-dropdown.entry.js +1 -1
- package/dist/esm/ptc-filter-tag.entry.js +1 -1
- package/dist/esm/ptc-hero-footer-cta.entry.js +1 -1
- package/dist/esm/ptc-hero.entry.js +1 -1
- package/dist/esm/ptc-icon-list.entry.js +1 -1
- package/dist/esm/ptc-icon-minimize.entry.js +1 -1
- package/dist/esm/ptc-link.entry.js +1 -1
- package/dist/esm/ptc-list.entry.js +1 -2
- package/dist/esm/ptc-lottie.entry.js +1 -1
- package/dist/esm/ptc-media-card.entry.js +1 -1
- package/dist/esm/ptc-minimized-footer.entry.js +1 -1
- package/dist/esm/ptc-minimized-header.entry.js +1 -1
- package/dist/esm/ptc-mobile-select.entry.js +423 -718
- package/dist/esm/ptc-modal.entry.js +1 -1
- package/dist/esm/ptc-overlay.entry.js +6 -3
- package/dist/esm/ptc-pagenation.entry.js +1 -1
- package/dist/esm/ptc-previous-url.entry.js +1 -1
- package/dist/esm/ptc-pricing-block.entry.js +1 -1
- package/dist/esm/ptc-quote.entry.js +1 -1
- package/dist/esm/ptc-readmore_2.entry.js +51 -7
- package/dist/esm/ptc-responsive-wrapper.entry.js +1 -1
- package/dist/esm/ptc-shopping-cart.entry.js +1 -1
- package/dist/esm/ptc-social-share.entry.js +1 -1
- package/dist/esm/ptc-span.entry.js +1 -1
- package/dist/esm/ptc-sticky-icons.entry.js +1 -1
- package/dist/esm/ptc-svg-btn.entry.js +1 -1
- package/dist/esm/ptc-tab-list.entry.js +1 -1
- package/dist/esm/ptc-text-copy-with-background.entry.js +9 -4
- package/dist/esm/ptc-title.entry.js +6 -4
- package/dist/esm/ptc-two-column-media.entry.js +1 -1
- package/dist/esm/ptcw-design.js +4 -3
- package/dist/esm/tab-content.entry.js +1 -1
- package/dist/esm/tab-header.entry.js +1 -1
- package/dist/ptcw-design/{p-1964f1f4.entry.js → p-001a0b9f.entry.js} +1 -1
- package/dist/ptcw-design/{p-14d6a40c.entry.js → p-0099616c.entry.js} +1 -1
- package/dist/ptcw-design/{p-2bd6743a.entry.js → p-013f5355.entry.js} +1 -1
- package/dist/ptcw-design/p-048502c2.entry.js +1 -0
- package/dist/ptcw-design/{p-f2cb8bc4.entry.js → p-049964f4.entry.js} +1 -1
- package/dist/ptcw-design/{p-c4e20f99.entry.js → p-0f937cff.entry.js} +1 -1
- package/dist/ptcw-design/{p-8637cefc.entry.js → p-13b0d8c3.entry.js} +1 -1
- package/dist/ptcw-design/{p-e6ce8733.entry.js → p-159d9a80.entry.js} +1 -1
- package/dist/ptcw-design/{p-97e00dfa.entry.js → p-1def8f3c.entry.js} +1 -1
- package/dist/ptcw-design/{p-29f3c478.entry.js → p-1e92301d.entry.js} +1 -1
- package/dist/ptcw-design/p-2ac518f1.entry.js +1 -0
- package/dist/ptcw-design/{p-8bb41e7c.entry.js → p-2cc97b88.entry.js} +1 -1
- package/dist/ptcw-design/{p-2aeb4687.entry.js → p-2de0f980.entry.js} +1 -1
- package/dist/ptcw-design/{p-d56b953e.entry.js → p-2eb5ef88.entry.js} +1 -1
- package/dist/ptcw-design/{p-82fc0608.entry.js → p-30007bf3.entry.js} +1 -1
- package/dist/ptcw-design/{p-82472007.entry.js → p-31fbba12.entry.js} +1 -1
- package/dist/ptcw-design/{p-e75dc9f4.entry.js → p-31ffd030.entry.js} +1 -1
- package/dist/ptcw-design/{p-adcc9906.entry.js → p-329cc205.entry.js} +1 -1
- package/dist/ptcw-design/{p-4da43d5f.entry.js → p-34db9e46.entry.js} +1 -1
- package/dist/ptcw-design/p-446df289.entry.js +1 -0
- package/dist/ptcw-design/p-450e9eb0.entry.js +1 -0
- package/dist/ptcw-design/p-4fbef630.entry.js +1 -0
- package/dist/ptcw-design/{p-6131b9a1.entry.js → p-50c88717.entry.js} +1 -1
- package/dist/ptcw-design/{p-5bb7354a.entry.js → p-51db2e2e.entry.js} +1 -1
- package/dist/ptcw-design/{p-a749c353.entry.js → p-586d9c9d.entry.js} +1 -1
- package/dist/ptcw-design/{p-00c1343b.entry.js → p-5c295f08.entry.js} +1 -1
- package/dist/ptcw-design/{p-867c711f.entry.js → p-5dc89a74.entry.js} +1 -1
- package/dist/ptcw-design/{p-c3f73953.entry.js → p-62cabff9.entry.js} +1 -1
- package/dist/ptcw-design/{p-1b0d15aa.entry.js → p-63fab352.entry.js} +1 -1
- package/dist/ptcw-design/{p-6065a1d1.entry.js → p-673121e2.entry.js} +1 -1
- package/dist/ptcw-design/p-679be000.entry.js +1 -0
- package/dist/ptcw-design/p-67a9ed01.entry.js +1 -0
- package/dist/ptcw-design/p-8d48362b.entry.js +1 -0
- package/dist/ptcw-design/{p-0aa91ac2.entry.js → p-9024a899.entry.js} +1 -1
- package/dist/ptcw-design/p-91512aeb.entry.js +1 -0
- package/dist/ptcw-design/{p-3f85b469.entry.js → p-96883fd7.entry.js} +1 -1
- package/dist/ptcw-design/p-9fb2ab8c.js +2 -0
- package/dist/ptcw-design/p-b4d92914.entry.js +1 -0
- package/dist/ptcw-design/p-b721664f.entry.js +1 -0
- package/dist/ptcw-design/{p-88e1778e.entry.js → p-bc0181f3.entry.js} +1 -1
- package/dist/ptcw-design/p-c2275f57.entry.js +1 -0
- package/dist/ptcw-design/{p-a05fe3d0.entry.js → p-c325283e.entry.js} +1 -1
- package/dist/ptcw-design/{p-482a8bc9.entry.js → p-c3621686.entry.js} +1 -1
- package/dist/ptcw-design/p-c693e1c5.entry.js +1 -0
- package/dist/ptcw-design/{p-1aa4d596.entry.js → p-c7247cc9.entry.js} +1 -1
- package/dist/ptcw-design/{p-8808ecc8.entry.js → p-ce3627b8.entry.js} +1 -1
- package/dist/ptcw-design/{p-e87bc2cd.entry.js → p-d24446b2.entry.js} +1 -1
- package/dist/ptcw-design/{p-8bb7da0b.entry.js → p-d625bb90.entry.js} +1 -1
- package/dist/ptcw-design/{p-60843852.entry.js → p-dcf0d341.entry.js} +1 -1
- package/dist/ptcw-design/{p-c4107b5d.entry.js → p-de6b444f.entry.js} +1 -1
- package/dist/ptcw-design/{p-afea5c1f.entry.js → p-e353a8e8.entry.js} +1 -1
- package/dist/ptcw-design/{p-36a453d4.entry.js → p-e66a28aa.entry.js} +1 -1
- package/dist/ptcw-design/{p-21e27f2b.entry.js → p-fed5edd3.entry.js} +1 -1
- package/dist/ptcw-design/ptcw-design.css +1 -1
- package/dist/ptcw-design/ptcw-design.esm.js +1 -1
- package/dist/types/components/max-width-container/max-width-container.d.ts +9 -0
- package/dist/types/components/ptc-card-content/ptc-card-content.d.ts +2 -0
- package/dist/types/components/ptc-card-wrapper/ptc-card-wrapper.d.ts +5 -0
- package/dist/types/components/ptc-overlay/ptc-overlay.d.ts +2 -1
- package/dist/types/components/ptc-pagenation/ptc-pagenation.d.ts +1 -1
- package/dist/types/components/ptc-readmore/ptc-readmore.d.ts +31 -2
- package/dist/types/components/ptc-text-copy-with-background/ptc-text-copy-with-background.d.ts +9 -1
- package/dist/types/components/ptc-title/ptc-title.d.ts +7 -3
- package/dist/types/components/ptc-tooltip/ptc-tooltip.d.ts +4 -0
- package/dist/types/components.d.ts +149 -9
- package/dist/types/stencil-public-runtime.d.ts +48 -3
- package/dist/types/utils/interfaces.d.ts +2 -2
- package/loader/index.d.ts +9 -0
- package/package.json +1 -1
- package/readme.md +10 -2
- package/dist/cjs/_commonjsHelpers-119ffc74.js +0 -17
- package/dist/esm/_commonjsHelpers-8b28c6fa.js +0 -15
- package/dist/ptcw-design/p-009001dc.js +0 -2
- package/dist/ptcw-design/p-0a825561.entry.js +0 -1
- package/dist/ptcw-design/p-2ca0340b.entry.js +0 -1
- package/dist/ptcw-design/p-2dcea9db.entry.js +0 -1
- package/dist/ptcw-design/p-4c1164d8.entry.js +0 -1
- package/dist/ptcw-design/p-556dcafb.entry.js +0 -1
- package/dist/ptcw-design/p-557e8e2a.entry.js +0 -1
- package/dist/ptcw-design/p-67af0abd.entry.js +0 -1
- package/dist/ptcw-design/p-ac9c4ba2.entry.js +0 -1
- package/dist/ptcw-design/p-b68038b5.js +0 -1
- package/dist/ptcw-design/p-c095d100.entry.js +0 -7
- package/dist/ptcw-design/p-ca9efc42.entry.js +0 -1
- package/dist/ptcw-design/p-cf500bc9.entry.js +0 -1
- package/dist/ptcw-design/p-f9694131.entry.js +0 -1
|
@@ -2,724 +2,429 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const _commonjsHelpers = require('./_commonjsHelpers-119ffc74.js');
|
|
5
|
+
const index = require('./index-c27e52b2.js');
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
_this.addListenerWheel(tempWheel, i);
|
|
429
|
-
_this.wheels.appendChild(tempWheel);
|
|
430
|
-
}
|
|
431
|
-
//_this.·(i);
|
|
432
|
-
})(i);
|
|
433
|
-
}
|
|
434
|
-
},
|
|
435
|
-
|
|
436
|
-
updateWheels:function(data){
|
|
437
|
-
var _this = this;
|
|
438
|
-
if(_this.cascade){
|
|
439
|
-
_this.cascadeJsonData = data;
|
|
440
|
-
_this.displayJson = [];
|
|
441
|
-
_this.initCascade();
|
|
442
|
-
if(_this.initPosition.length < _this.slider.length){
|
|
443
|
-
var diff = _this.slider.length - _this.initPosition.length;
|
|
444
|
-
for(var i=0; i<diff; i++){
|
|
445
|
-
_this.initPosition.push(0);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
_this.setCurDistance(_this.initPosition);
|
|
449
|
-
_this.fixRowStyle();
|
|
450
|
-
}
|
|
451
|
-
},
|
|
452
|
-
|
|
453
|
-
updateWheel: function(sliderIndex, data){
|
|
454
|
-
var _this = this;
|
|
455
|
-
var tempHTML='';
|
|
456
|
-
if(_this.cascade){
|
|
457
|
-
console.error('级联格式不支持updateWheel(),请使用updateWheels()更新整个数据源');
|
|
458
|
-
return false;
|
|
459
|
-
}
|
|
460
|
-
else if(_this.jsonType){
|
|
461
|
-
for(var j=0; j<data.length; j++){
|
|
462
|
-
tempHTML += '<li data-id="'+data[j][_this.keyMap.id]+'">'+data[j][_this.keyMap.value]+'</li>';
|
|
463
|
-
}
|
|
464
|
-
_this.wheelsData[sliderIndex] = {data: data};
|
|
465
|
-
}else {
|
|
466
|
-
for(var j=0; j<data.length; j++){
|
|
467
|
-
tempHTML += '<li>'+data[j]+'</li>';
|
|
468
|
-
}
|
|
469
|
-
_this.wheelsData[sliderIndex] = data;
|
|
470
|
-
}
|
|
471
|
-
_this.slider[sliderIndex].innerHTML = tempHTML;
|
|
472
|
-
},
|
|
473
|
-
|
|
474
|
-
fixRowStyle: function(){
|
|
475
|
-
var _this = this;
|
|
476
|
-
var width = (100/_this.wheel.length).toFixed(2);
|
|
477
|
-
for(var i=0; i<_this.wheel.length; i++){
|
|
478
|
-
_this.wheel[i].style.width = width+'%';
|
|
479
|
-
}
|
|
480
|
-
},
|
|
481
|
-
|
|
482
|
-
getIndex: function(distance){
|
|
483
|
-
return Math.round((2*this.liHeight-distance)/this.liHeight);
|
|
484
|
-
},
|
|
485
|
-
|
|
486
|
-
getIndexArr: function(){
|
|
487
|
-
var _this = this;
|
|
488
|
-
var temp = [];
|
|
489
|
-
for(var i=0; i<_this.curDistance.length; i++){
|
|
490
|
-
temp.push(_this.getIndex(_this.curDistance[i]));
|
|
491
|
-
}
|
|
492
|
-
return temp;
|
|
493
|
-
},
|
|
494
|
-
|
|
495
|
-
getCurValue: function(){
|
|
496
|
-
var _this = this;
|
|
497
|
-
var temp = [];
|
|
498
|
-
var positionArr = _this.getIndexArr();
|
|
499
|
-
if(_this.cascade){
|
|
500
|
-
for(var i=0; i<_this.wheel.length; i++){
|
|
501
|
-
temp.push(_this.displayJson[i][positionArr[i]]);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
else if(_this.jsonType){
|
|
505
|
-
for(var i=0; i<_this.curDistance.length; i++){
|
|
506
|
-
temp.push(_this.wheelsData[i].data[_this.getIndex(_this.curDistance[i])]);
|
|
507
|
-
}
|
|
508
|
-
}else {
|
|
509
|
-
for(var i=0; i<_this.curDistance.length; i++){
|
|
510
|
-
temp.push(_this.getInnerHtml(i));
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
return temp;
|
|
514
|
-
},
|
|
515
|
-
|
|
516
|
-
getValue: function(){
|
|
517
|
-
return this.curValue;
|
|
518
|
-
},
|
|
519
|
-
|
|
520
|
-
calcDistance: function(index){
|
|
521
|
-
return 2*this.liHeight-index*this.liHeight;
|
|
522
|
-
},
|
|
523
|
-
|
|
524
|
-
setCurDistance: function(indexArr){
|
|
525
|
-
var _this = this;
|
|
526
|
-
var temp = [];
|
|
527
|
-
for(var i=0; i<_this.slider.length; i++){
|
|
528
|
-
temp.push(_this.calcDistance(indexArr[i]));
|
|
529
|
-
_this.movePosition(_this.slider[i],temp[i]);
|
|
530
|
-
}
|
|
531
|
-
_this.curDistance = temp;
|
|
532
|
-
},
|
|
533
|
-
|
|
534
|
-
fixPosition: function(distance){
|
|
535
|
-
return -(this.getIndex(distance)-2)*this.liHeight;
|
|
536
|
-
},
|
|
537
|
-
|
|
538
|
-
movePosition: function(theSlider, distance){
|
|
539
|
-
theSlider.style.webkitTransform = 'translate3d(0,' + distance + 'px, 0)';
|
|
540
|
-
theSlider.style.transform = 'translate3d(0,' + distance + 'px, 0)';
|
|
541
|
-
},
|
|
542
|
-
|
|
543
|
-
locatePosition: function(index, posIndex){
|
|
544
|
-
var _this = this;
|
|
545
|
-
this.curDistance[index] = this.calcDistance(posIndex);
|
|
546
|
-
this.movePosition(this.slider[index],this.curDistance[index]);
|
|
547
|
-
if(_this.cascade){
|
|
548
|
-
_this.checkRange(index, _this.getIndexArr());
|
|
549
|
-
}
|
|
550
|
-
},
|
|
551
|
-
|
|
552
|
-
updateCurDistance: function(theSlider, index){
|
|
553
|
-
if(theSlider.style.transform){
|
|
554
|
-
this.curDistance[index] = parseInt(theSlider.style.transform.split(',')[1]);
|
|
555
|
-
}else {
|
|
556
|
-
this.curDistance[index] = parseInt(theSlider.style.webkitTransform.split(',')[1]);
|
|
557
|
-
}
|
|
558
|
-
},
|
|
559
|
-
|
|
560
|
-
getDistance:function(theSlider){
|
|
561
|
-
if(theSlider.style.transform){
|
|
562
|
-
return parseInt(theSlider.style.transform.split(',')[1]);
|
|
563
|
-
}else {
|
|
564
|
-
return parseInt(theSlider.style.webkitTransform.split(',')[1]);
|
|
565
|
-
}
|
|
566
|
-
},
|
|
567
|
-
|
|
568
|
-
getInnerHtml: function(sliderIndex){
|
|
569
|
-
var _this = this;
|
|
570
|
-
var index = _this.getIndex(_this.curDistance[sliderIndex]);
|
|
571
|
-
return _this.slider[sliderIndex].getElementsByTagName('li')[index].innerHTML;
|
|
572
|
-
},
|
|
573
|
-
|
|
574
|
-
touch: function(event, theSlider, index){
|
|
575
|
-
var _this = this;
|
|
576
|
-
event = event || window.event;
|
|
577
|
-
switch(event.type){
|
|
578
|
-
case "touchstart":
|
|
579
|
-
_this.startY = event.touches[0].clientY;
|
|
580
|
-
_this.startY = parseInt(_this.startY);
|
|
581
|
-
_this.oldMoveY = _this.startY;
|
|
582
|
-
break;
|
|
583
|
-
|
|
584
|
-
case "touchend":
|
|
585
|
-
|
|
586
|
-
_this.moveEndY = parseInt(event.changedTouches[0].clientY);
|
|
587
|
-
_this.offsetSum = _this.moveEndY - _this.startY;
|
|
588
|
-
_this.oversizeBorder = -(theSlider.getElementsByTagName('li').length-3)*_this.liHeight;
|
|
589
|
-
|
|
590
|
-
if(_this.offsetSum == 0){
|
|
591
|
-
//offsetSum为0,相当于点击事件
|
|
592
|
-
// 0 1 [2] 3 4
|
|
593
|
-
var clickOffetNum = parseInt((document.documentElement.clientHeight - _this.moveEndY)/40);
|
|
594
|
-
if(clickOffetNum!=2){
|
|
595
|
-
var offset = clickOffetNum - 2;
|
|
596
|
-
var newDistance = _this.curDistance[index] + (offset*_this.liHeight);
|
|
597
|
-
if((newDistance <= 2*_this.liHeight) && (newDistance >= _this.oversizeBorder) ){
|
|
598
|
-
_this.curDistance[index] = newDistance;
|
|
599
|
-
_this.movePosition(theSlider, _this.curDistance[index]);
|
|
600
|
-
_this.transitionEnd(_this.getIndexArr(),_this.getCurValue());
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
}else {
|
|
604
|
-
//修正位置
|
|
605
|
-
_this.updateCurDistance(theSlider, index);
|
|
606
|
-
_this.curDistance[index] = _this.fixPosition(_this.curDistance[index]);
|
|
607
|
-
_this.movePosition(theSlider, _this.curDistance[index]);
|
|
608
|
-
|
|
609
|
-
//反弹
|
|
610
|
-
if(_this.curDistance[index] + _this.offsetSum > 2*_this.liHeight){
|
|
611
|
-
_this.curDistance[index] = 2*_this.liHeight;
|
|
612
|
-
setTimeout(function(){
|
|
613
|
-
_this.movePosition(theSlider, _this.curDistance[index]);
|
|
614
|
-
}, 100);
|
|
615
|
-
|
|
616
|
-
}else if(_this.curDistance[index] + _this.offsetSum < _this.oversizeBorder){
|
|
617
|
-
_this.curDistance[index] = _this.oversizeBorder;
|
|
618
|
-
setTimeout(function(){
|
|
619
|
-
_this.movePosition(theSlider, _this.curDistance[index]);
|
|
620
|
-
}, 100);
|
|
621
|
-
}
|
|
622
|
-
_this.transitionEnd(_this.getIndexArr(),_this.getCurValue());
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
if(_this.cascade){
|
|
626
|
-
_this.checkRange(index, _this.getIndexArr());
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
break;
|
|
630
|
-
|
|
631
|
-
case "touchmove":
|
|
632
|
-
event.preventDefault();
|
|
633
|
-
_this.moveY = event.touches[0].clientY;
|
|
634
|
-
_this.offset = _this.moveY - _this.oldMoveY;
|
|
635
|
-
|
|
636
|
-
_this.updateCurDistance(theSlider, index);
|
|
637
|
-
_this.curDistance[index] = _this.curDistance[index] + _this.offset;
|
|
638
|
-
_this.movePosition(theSlider, _this.curDistance[index]);
|
|
639
|
-
_this.oldMoveY = _this.moveY;
|
|
640
|
-
break;
|
|
641
|
-
}
|
|
642
|
-
},
|
|
643
|
-
|
|
644
|
-
dragClick: function(event, theSlider, index){
|
|
645
|
-
var _this = this;
|
|
646
|
-
event = event || window.event;
|
|
647
|
-
switch(event.type){
|
|
648
|
-
case "mousedown":
|
|
649
|
-
_this.startY = event.clientY;
|
|
650
|
-
_this.oldMoveY = _this.startY;
|
|
651
|
-
_this.clickStatus = true;
|
|
652
|
-
break;
|
|
653
|
-
|
|
654
|
-
case "mouseup":
|
|
655
|
-
|
|
656
|
-
_this.moveEndY = event.clientY;
|
|
657
|
-
_this.offsetSum = _this.moveEndY - _this.startY;
|
|
658
|
-
_this.oversizeBorder = -(theSlider.getElementsByTagName('li').length-3)*_this.liHeight;
|
|
659
|
-
|
|
660
|
-
if(_this.offsetSum == 0){
|
|
661
|
-
var clickOffetNum = parseInt((document.documentElement.clientHeight - _this.moveEndY)/40);
|
|
662
|
-
if(clickOffetNum!=2){
|
|
663
|
-
var offset = clickOffetNum - 2;
|
|
664
|
-
var newDistance = _this.curDistance[index] + (offset*_this.liHeight);
|
|
665
|
-
if((newDistance <= 2*_this.liHeight) && (newDistance >= _this.oversizeBorder) ){
|
|
666
|
-
_this.curDistance[index] = newDistance;
|
|
667
|
-
_this.movePosition(theSlider, _this.curDistance[index]);
|
|
668
|
-
_this.transitionEnd(_this.getIndexArr(),_this.getCurValue());
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
}else {
|
|
672
|
-
//修正位置
|
|
673
|
-
_this.updateCurDistance(theSlider, index);
|
|
674
|
-
_this.curDistance[index] = _this.fixPosition(_this.curDistance[index]);
|
|
675
|
-
_this.movePosition(theSlider, _this.curDistance[index]);
|
|
676
|
-
|
|
677
|
-
//反弹
|
|
678
|
-
if(_this.curDistance[index] + _this.offsetSum > 2*_this.liHeight){
|
|
679
|
-
_this.curDistance[index] = 2*_this.liHeight;
|
|
680
|
-
setTimeout(function(){
|
|
681
|
-
_this.movePosition(theSlider, _this.curDistance[index]);
|
|
682
|
-
}, 100);
|
|
683
|
-
|
|
684
|
-
}else if(_this.curDistance[index] + _this.offsetSum < _this.oversizeBorder){
|
|
685
|
-
_this.curDistance[index] = _this.oversizeBorder;
|
|
686
|
-
setTimeout(function(){
|
|
687
|
-
_this.movePosition(theSlider, _this.curDistance[index]);
|
|
688
|
-
}, 100);
|
|
689
|
-
}
|
|
690
|
-
_this.transitionEnd(_this.getIndexArr(),_this.getCurValue());
|
|
691
|
-
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
_this.clickStatus = false;
|
|
695
|
-
if(_this.cascade){
|
|
696
|
-
_this.checkRange(index, _this.getIndexArr());
|
|
697
|
-
}
|
|
698
|
-
break;
|
|
699
|
-
|
|
700
|
-
case "mousemove":
|
|
701
|
-
event.preventDefault();
|
|
702
|
-
if(_this.clickStatus){
|
|
703
|
-
_this.moveY = event.clientY;
|
|
704
|
-
_this.offset = _this.moveY - _this.oldMoveY;
|
|
705
|
-
_this.updateCurDistance(theSlider, index);
|
|
706
|
-
_this.curDistance[index] = _this.curDistance[index] + _this.offset;
|
|
707
|
-
_this.movePosition(theSlider, _this.curDistance[index]);
|
|
708
|
-
_this.oldMoveY = _this.moveY;
|
|
709
|
-
}
|
|
710
|
-
break;
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
};
|
|
715
|
-
|
|
716
|
-
{
|
|
717
|
-
module.exports = MobileSelect;
|
|
718
|
-
}
|
|
719
|
-
})();
|
|
720
|
-
});
|
|
7
|
+
/*
|
|
8
|
+
* mobile-select v1.3.2
|
|
9
|
+
* Homepage: https://github.com/onlyhom/mobile-select
|
|
10
|
+
* Released under the MIT License.
|
|
11
|
+
* (c) 2017-present
|
|
12
|
+
*/
|
|
13
|
+
var D = Object.defineProperty;
|
|
14
|
+
var w = (g, t, e) => t in g ? D(g, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : g[t] = e;
|
|
15
|
+
var h = (g, t, e) => (w(g, typeof t != "symbol" ? t + "" : t, e), e);
|
|
16
|
+
const r = class {
|
|
17
|
+
constructor(t) {
|
|
18
|
+
h(this, "mobileSelect");
|
|
19
|
+
h(this, "trigger");
|
|
20
|
+
h(this, "wheelList");
|
|
21
|
+
h(this, "sliderList");
|
|
22
|
+
h(this, "wheelsContain");
|
|
23
|
+
h(this, "panel");
|
|
24
|
+
h(this, "ensureBtn");
|
|
25
|
+
h(this, "cancelBtn");
|
|
26
|
+
h(this, "grayLayer");
|
|
27
|
+
h(this, "popUp");
|
|
28
|
+
h(this, "initPosition");
|
|
29
|
+
h(this, "initColWidth");
|
|
30
|
+
h(this, "wheelsData");
|
|
31
|
+
h(this, "displayJson");
|
|
32
|
+
h(this, "curValue");
|
|
33
|
+
h(this, "curIndexArr");
|
|
34
|
+
h(this, "isCascade");
|
|
35
|
+
h(this, "isJsonType");
|
|
36
|
+
h(this, "startY");
|
|
37
|
+
h(this, "moveEndY");
|
|
38
|
+
h(this, "moveY");
|
|
39
|
+
h(this, "preMoveY");
|
|
40
|
+
h(this, "offsetY");
|
|
41
|
+
h(this, "offsetSum");
|
|
42
|
+
h(this, "oversizeBorder");
|
|
43
|
+
h(this, "enableClickStatus");
|
|
44
|
+
h(this, "isPC");
|
|
45
|
+
h(this, "optionHeight");
|
|
46
|
+
h(this, "curDistance");
|
|
47
|
+
h(this, "cascadeJsonData");
|
|
48
|
+
h(this, "eventHandleMap");
|
|
49
|
+
h(this, "initDeepCount");
|
|
50
|
+
h(this, "config");
|
|
51
|
+
!r.checkRequiredConfig(t) || (this.config = Object.assign({}, r.defaultConfig, t), this.wheelsData = t.wheels, this.isJsonType = !1, this.cascadeJsonData = [], this.displayJson = [], this.curValue = [], this.curIndexArr = [], this.isCascade = !1, this.offsetY = 0, this.offsetSum = 0, this.curDistance = [], this.enableClickStatus = !1, this.isPC = !0, this.optionHeight = 0, this.initPosition = t.position || [], this.initColWidth = t.colWidth || [], this.init());
|
|
52
|
+
}
|
|
53
|
+
init() {
|
|
54
|
+
const { config: t } = this;
|
|
55
|
+
if (this.isJsonType = r.checkDataType(this.wheelsData), this.renderComponent(this.wheelsData), !!this.checkTriggerAvailable()) {
|
|
56
|
+
if (this.wheelList = this.mobileSelect.getElementsByClassName("ms-wheel"), this.sliderList = this.mobileSelect.getElementsByClassName("ms-select-container"), this.panel = this.mobileSelect.querySelector(".ms-panel"), this.wheelsContain = this.mobileSelect.querySelector(".ms-wheels"), this.ensureBtn = this.mobileSelect.querySelector(".ms-ensure"), this.cancelBtn = this.mobileSelect.querySelector(".ms-cancel"), this.grayLayer = this.mobileSelect.querySelector(".ms-gray-layer"), this.popUp = this.mobileSelect.querySelector(".ms-content"), this.optionHeight = this.mobileSelect.querySelector("li").offsetHeight, t.initValue && t.triggerDisplayValue && (this.trigger.innerText = t.initValue), this.setStyle(t), this.isPC = r.checkIsPC(), this.isCascade = this.checkCascade(), this.isCascade && this.initCascade(), t.initValue && (this.initPosition = this.getPositionByValue()), this.initPosition.length < this.sliderList.length) {
|
|
57
|
+
const e = this.sliderList.length - this.initPosition.length;
|
|
58
|
+
for (let i = 0; i < e; i++)
|
|
59
|
+
this.initPosition.push(0);
|
|
60
|
+
}
|
|
61
|
+
this.isCascade ? this.initPosition.forEach((e, i) => {
|
|
62
|
+
this.checkRange(i, this.initPosition);
|
|
63
|
+
}) : this.setCurDistance(this.initPosition), this.eventHandleMap = {
|
|
64
|
+
cancelBtn: {
|
|
65
|
+
event: "click",
|
|
66
|
+
fn: () => {
|
|
67
|
+
var e, i, s, n;
|
|
68
|
+
this.hide(), (i = (e = this.config).cancel) == null || i.call(e, this.curIndexArr, this.curValue, this), (n = (s = this.config).onCancel) == null || n.call(s, this.curValue, this.curIndexArr, this);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
ensureBtn: {
|
|
72
|
+
event: "click",
|
|
73
|
+
fn: () => {
|
|
74
|
+
var i, s, n, l;
|
|
75
|
+
this.hide(), this.optionHeight || (this.optionHeight = this.mobileSelect.querySelector("li").offsetHeight);
|
|
76
|
+
let e = "";
|
|
77
|
+
for (let o = 0; o < this.wheelList.length; o++)
|
|
78
|
+
o == this.wheelList.length - 1 ? e += this.getInnerText(o) : e += this.getInnerText(o) + this.config.connector;
|
|
79
|
+
t.triggerDisplayValue && (this.trigger.innerText = e), this.curIndexArr = this.getIndexArr(), this.curValue = this.getCurValue(), (s = (i = this.config).callback) == null || s.call(i, this.curIndexArr, this.curValue, this), (l = (n = this.config).onChange) == null || l.call(n, this.curValue, this.curIndexArr, this);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
trigger: {
|
|
83
|
+
event: "click",
|
|
84
|
+
fn: () => {
|
|
85
|
+
this.show();
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
grayLayer: {
|
|
89
|
+
event: "click",
|
|
90
|
+
fn: () => this.hide()
|
|
91
|
+
},
|
|
92
|
+
popUp: {
|
|
93
|
+
event: "click",
|
|
94
|
+
fn: (e) => e.stopPropagation()
|
|
95
|
+
},
|
|
96
|
+
panel: {
|
|
97
|
+
event: ["touchstart", "touchend", "touchmove"],
|
|
98
|
+
fn: (e) => this.touch(e)
|
|
99
|
+
}
|
|
100
|
+
}, this.isPC && (this.eventHandleMap.panel.event = ["mousedown", "mousemove", "mouseup"]), this.registerEvents("add"), this.fixRowStyle(), t.autoFocus && this.show();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
static checkIsPC() {
|
|
104
|
+
return !navigator.userAgent.toLowerCase().match(/ipad|iphone os|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/);
|
|
105
|
+
}
|
|
106
|
+
static checkDataType(t) {
|
|
107
|
+
var e, i;
|
|
108
|
+
return typeof ((i = (e = t[0]) == null ? void 0 : e.data) == null ? void 0 : i[0]) == "object";
|
|
109
|
+
}
|
|
110
|
+
static checkRequiredConfig(t) {
|
|
111
|
+
const e = r.REQUIRED_PARAMS;
|
|
112
|
+
if (!t) {
|
|
113
|
+
const i = e.map((s) => `'${s}'`);
|
|
114
|
+
return r.log("error", `missing required param ${i.join(" and ")}.`), !1;
|
|
115
|
+
}
|
|
116
|
+
for (let i = 0; i < e.length; i++) {
|
|
117
|
+
const s = e[i];
|
|
118
|
+
if (!t[s])
|
|
119
|
+
return r.log("error", `missing required param '${s}'.`), !1;
|
|
120
|
+
}
|
|
121
|
+
return !0;
|
|
122
|
+
}
|
|
123
|
+
static log(t, e) {
|
|
124
|
+
var i;
|
|
125
|
+
(i = console[t]) == null || i.call(console, `[mobile-select]: ${e}`);
|
|
126
|
+
}
|
|
127
|
+
checkTriggerAvailable() {
|
|
128
|
+
const { config: t } = this;
|
|
129
|
+
return this.trigger = t.trigger instanceof HTMLElement ? t.trigger : document.querySelector(t.trigger), this.trigger ? !0 : (r.log("error", "trigger HTMLElement does not found on your document."), !1);
|
|
130
|
+
}
|
|
131
|
+
getPositionByValue() {
|
|
132
|
+
var n;
|
|
133
|
+
const { keyMap: t, connector: e, initValue: i } = this.config, s = (i == null ? void 0 : i.split(e)) || [];
|
|
134
|
+
if (this.isJsonType) {
|
|
135
|
+
let l = (n = this.wheelsData[0]) == null ? void 0 : n.data;
|
|
136
|
+
return s.reduce((o, d) => {
|
|
137
|
+
var c;
|
|
138
|
+
const a = l == null ? void 0 : l.findIndex((u) => u[t.value] == d);
|
|
139
|
+
return o.push(a < 0 ? 0 : a), l = (c = l[a]) == null ? void 0 : c[t.childs], o;
|
|
140
|
+
}, []);
|
|
141
|
+
}
|
|
142
|
+
return s.reduce((l, o, d) => {
|
|
143
|
+
var c, u;
|
|
144
|
+
const a = (u = (c = this.wheelsData[d]) == null ? void 0 : c.data) == null ? void 0 : u.findIndex((f) => f == o);
|
|
145
|
+
return l.push(a < 0 ? 0 : a), l;
|
|
146
|
+
}, []);
|
|
147
|
+
}
|
|
148
|
+
setTitle(t) {
|
|
149
|
+
this.mobileSelect.querySelector(".ms-title").innerHTML = t;
|
|
150
|
+
}
|
|
151
|
+
setStyle(t) {
|
|
152
|
+
if (t.ensureBtnColor && (this.ensureBtn.style.color = t.ensureBtnColor), t.cancelBtnColor && (this.cancelBtn.style.color = t.cancelBtnColor), t.titleColor) {
|
|
153
|
+
const e = this.mobileSelect.querySelector(".ms-title");
|
|
154
|
+
e.style.color = t.titleColor;
|
|
155
|
+
}
|
|
156
|
+
if (t.textColor && (this.panel = this.mobileSelect.querySelector(".ms-panel"), this.panel.style.color = t.textColor), t.titleBgColor) {
|
|
157
|
+
const e = this.mobileSelect.querySelector(".ms-btn-bar");
|
|
158
|
+
e.style.backgroundColor = t.titleBgColor;
|
|
159
|
+
}
|
|
160
|
+
if (t.bgColor) {
|
|
161
|
+
this.panel = this.mobileSelect.querySelector(".ms-panel");
|
|
162
|
+
const e = this.mobileSelect.querySelector(".ms-shadow-mask");
|
|
163
|
+
this.panel.style.backgroundColor = t.bgColor, e.style.background = "linear-gradient(to bottom, " + t.bgColor + ", rgba(255, 255, 255, 0), " + t.bgColor + ")";
|
|
164
|
+
}
|
|
165
|
+
if (typeof t.maskOpacity == "number") {
|
|
166
|
+
const e = this.mobileSelect.querySelector(".ms-gray-layer");
|
|
167
|
+
e.style.background = "rgba(0, 0, 0, " + t.maskOpacity + ")";
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
show() {
|
|
171
|
+
var t, e, i;
|
|
172
|
+
this.mobileSelect.classList.add("ms-show"), (t = document.querySelector("body")) == null || t.classList.add("ms-show"), typeof this.config.onShow == "function" && ((i = (e = this.config).onShow) == null || i.call(e, this.curValue, this.curIndexArr, this));
|
|
173
|
+
}
|
|
174
|
+
hide() {
|
|
175
|
+
var t, e, i;
|
|
176
|
+
this.mobileSelect.classList.remove("ms-show"), (t = document.querySelector("body")) == null || t.classList.remove("ms-show"), typeof this.config.onHide == "function" && ((i = (e = this.config).onHide) == null || i.call(e, this.curValue, this.curIndexArr, this));
|
|
177
|
+
}
|
|
178
|
+
registerEvents(t) {
|
|
179
|
+
for (const [e, i] of Object.entries(this.eventHandleMap))
|
|
180
|
+
typeof i.event == "string" ? this[e][`${t}EventListener`](i.event, i.fn, { passive: !1 }) : i.event.forEach((s) => {
|
|
181
|
+
this[e][`${t}EventListener`](s, i.fn, { passive: !1 });
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
destroy() {
|
|
185
|
+
var t, e;
|
|
186
|
+
this.registerEvents("remove"), (e = (t = this.mobileSelect) == null ? void 0 : t.parentNode) == null || e.removeChild(this.mobileSelect);
|
|
187
|
+
}
|
|
188
|
+
getOptionsHtmlStr(t) {
|
|
189
|
+
const { keyMap: e } = this.config;
|
|
190
|
+
let i = "";
|
|
191
|
+
if (this.isJsonType)
|
|
192
|
+
for (let s = 0; s < t.length; s++) {
|
|
193
|
+
const n = t[s][e.id], l = t[s][e.value];
|
|
194
|
+
i += `<li data-id="${n}">${l}</li>`;
|
|
195
|
+
}
|
|
196
|
+
else
|
|
197
|
+
for (let s = 0; s < t.length; s++)
|
|
198
|
+
i += "<li>" + t[s] + "</li>";
|
|
199
|
+
return i;
|
|
200
|
+
}
|
|
201
|
+
renderComponent(t) {
|
|
202
|
+
this.mobileSelect = document.createElement("div"), this.mobileSelect.className = "ms-mobile-select", this.mobileSelect.innerHTML = `<div class="ms-gray-layer"></div>
|
|
203
|
+
<div class="ms-content">
|
|
204
|
+
<div class="ms-btn-bar">
|
|
205
|
+
<div class="ms-fix-width">
|
|
206
|
+
<div class="ms-cancel">${this.config.cancelBtnText}</div>
|
|
207
|
+
<div class="ms-title">${this.config.title || ""}</div>
|
|
208
|
+
<div class="ms-ensure">${this.config.ensureBtnText}</div>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
<div class="ms-panel">
|
|
212
|
+
<div class="ms-fix-width">
|
|
213
|
+
<div class="ms-wheels"></div>
|
|
214
|
+
<div class="ms-select-line"></div>
|
|
215
|
+
<div class="ms-shadow-mask"></div>
|
|
216
|
+
</div>
|
|
217
|
+
</div>`, document.body.appendChild(this.mobileSelect);
|
|
218
|
+
let e = "";
|
|
219
|
+
for (let i = 0; i < t.length; i++)
|
|
220
|
+
e += `<div class="ms-wheel" data-index="${i}"><ul class="ms-select-container">`, e += this.getOptionsHtmlStr(t[i].data), e += "</ul></div>";
|
|
221
|
+
this.mobileSelect.querySelector(".ms-wheels").innerHTML = e;
|
|
222
|
+
}
|
|
223
|
+
reRenderWheels() {
|
|
224
|
+
const t = this.wheelList.length - this.displayJson.length;
|
|
225
|
+
if (t > 0)
|
|
226
|
+
for (let e = 0; e < t; e++)
|
|
227
|
+
this.wheelsContain.removeChild(this.wheelList[this.wheelList.length - 1]);
|
|
228
|
+
for (let e = 0; e < this.displayJson.length; e++)
|
|
229
|
+
if (this.wheelList[e])
|
|
230
|
+
this.sliderList[e].innerHTML = this.getOptionsHtmlStr(this.displayJson[e]);
|
|
231
|
+
else {
|
|
232
|
+
const i = document.createElement("div");
|
|
233
|
+
i.className = "ms-wheel", i.innerHTML = `<ul class="ms-select-container">${this.getOptionsHtmlStr(this.displayJson[e])}</ul>`, i.setAttribute("data-index", e.toString()), this.wheelsContain.appendChild(i);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
checkCascade() {
|
|
237
|
+
var e;
|
|
238
|
+
const { keyMap: t } = this.config;
|
|
239
|
+
if (this.isJsonType) {
|
|
240
|
+
const i = this.wheelsData[0].data;
|
|
241
|
+
for (let s = 0; s < i.length; s++)
|
|
242
|
+
if (t.childs in i[s] && ((e = i[s][t.childs]) == null ? void 0 : e.length) > 0)
|
|
243
|
+
return this.cascadeJsonData = this.wheelsData[0].data, !0;
|
|
244
|
+
}
|
|
245
|
+
return !1;
|
|
246
|
+
}
|
|
247
|
+
initCascade() {
|
|
248
|
+
this.displayJson.push(this.cascadeJsonData), this.initPosition.length > 0 ? (this.initDeepCount = 0, this.initCheckArrDeep(this.cascadeJsonData[this.initPosition[0]])) : this.checkArrDeep(this.cascadeJsonData[0]), this.reRenderWheels();
|
|
249
|
+
}
|
|
250
|
+
initCheckArrDeep(t) {
|
|
251
|
+
if (t) {
|
|
252
|
+
const { keyMap: e } = this.config;
|
|
253
|
+
if (e.childs in t && t[e.childs].length > 0) {
|
|
254
|
+
this.displayJson.push(t[e.childs]), this.initDeepCount++;
|
|
255
|
+
const i = t[e.childs][this.initPosition[this.initDeepCount]];
|
|
256
|
+
i ? this.initCheckArrDeep(i) : this.checkArrDeep(t[e.childs][0]);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
checkArrDeep(t) {
|
|
261
|
+
if (!t)
|
|
262
|
+
return;
|
|
263
|
+
const { keyMap: e } = this.config;
|
|
264
|
+
e.childs in t && t[e.childs].length > 0 && (this.displayJson.push(t[e.childs]), this.checkArrDeep(t[e.childs][0]));
|
|
265
|
+
}
|
|
266
|
+
checkRange(t, e) {
|
|
267
|
+
var l;
|
|
268
|
+
const i = this.displayJson.length - 1 - t, { keyMap: s } = this.config;
|
|
269
|
+
for (let o = 0; o < i; o++)
|
|
270
|
+
this.displayJson.pop();
|
|
271
|
+
let n;
|
|
272
|
+
for (let o = 0; o <= t; o++)
|
|
273
|
+
n = o == 0 ? this.cascadeJsonData[e[0]] : (l = n == null ? void 0 : n[s.childs]) == null ? void 0 : l[e[o]];
|
|
274
|
+
this.checkArrDeep(n), this.reRenderWheels(), this.fixRowStyle(), this.setCurDistance(this.resetPosition(t, e));
|
|
275
|
+
}
|
|
276
|
+
resetPosition(t, e) {
|
|
277
|
+
const i = [...e];
|
|
278
|
+
let s;
|
|
279
|
+
if (this.sliderList.length > e.length) {
|
|
280
|
+
s = this.sliderList.length - e.length;
|
|
281
|
+
for (let n = 0; n < s; n++)
|
|
282
|
+
i.push(0);
|
|
283
|
+
} else if (this.sliderList.length < e.length) {
|
|
284
|
+
s = e.length - this.sliderList.length;
|
|
285
|
+
for (let n = 0; n < s; n++)
|
|
286
|
+
i.pop();
|
|
287
|
+
}
|
|
288
|
+
for (let n = t + 1; n < i.length; n++)
|
|
289
|
+
i[n] = 0;
|
|
290
|
+
return i;
|
|
291
|
+
}
|
|
292
|
+
updateWheels(t) {
|
|
293
|
+
if (this.isCascade) {
|
|
294
|
+
if (this.cascadeJsonData = t, this.displayJson = [], this.initCascade(), this.initPosition.length < this.sliderList.length) {
|
|
295
|
+
const e = this.sliderList.length - this.initPosition.length;
|
|
296
|
+
for (let i = 0; i < e; i++)
|
|
297
|
+
this.initPosition.push(0);
|
|
298
|
+
}
|
|
299
|
+
this.setCurDistance(this.initPosition), this.fixRowStyle();
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
updateWheel(t, e) {
|
|
303
|
+
if (this.isCascade) {
|
|
304
|
+
r.log("error", "'updateWheel()' not support cascade json data, please use 'updateWheels()' instead to update the whole data source");
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
let i = "";
|
|
308
|
+
i += this.getOptionsHtmlStr(e), this.wheelsData[t] = this.isJsonType ? { data: e } : e, this.sliderList[t].innerHTML = i;
|
|
309
|
+
}
|
|
310
|
+
fixRowStyle() {
|
|
311
|
+
if (this.initColWidth.length && this.initColWidth.length === this.wheelList.length) {
|
|
312
|
+
const e = this.initColWidth.reduce((i, s) => i + s, 0);
|
|
313
|
+
this.initColWidth.forEach((i, s) => {
|
|
314
|
+
this.wheelList[s].style.width = (i / e * 100).toFixed(2) + "%";
|
|
315
|
+
});
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
const t = (100 / this.wheelList.length).toFixed(2);
|
|
319
|
+
for (let e = 0; e < this.wheelList.length; e++)
|
|
320
|
+
this.wheelList[e].style.width = t + "%";
|
|
321
|
+
}
|
|
322
|
+
getIndex(t) {
|
|
323
|
+
return Math.round((2 * this.optionHeight - t) / this.optionHeight);
|
|
324
|
+
}
|
|
325
|
+
getIndexArr() {
|
|
326
|
+
const t = [];
|
|
327
|
+
for (let e = 0; e < this.curDistance.length; e++)
|
|
328
|
+
t.push(this.getIndex(this.curDistance[e]));
|
|
329
|
+
return t;
|
|
330
|
+
}
|
|
331
|
+
getCurValue() {
|
|
332
|
+
const t = [], e = this.getIndexArr(), { keyMap: i } = this.config;
|
|
333
|
+
if (this.isCascade)
|
|
334
|
+
for (let s = 0; s < this.wheelList.length; s++) {
|
|
335
|
+
const n = this.displayJson[s][e[s]];
|
|
336
|
+
n && t.push({
|
|
337
|
+
[i.id]: n[i.id],
|
|
338
|
+
[i.value]: n[i.value]
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
else if (this.isJsonType)
|
|
342
|
+
for (let s = 0; s < this.curDistance.length; s++)
|
|
343
|
+
t.push(this.wheelsData[s].data[this.getIndex(this.curDistance[s])]);
|
|
344
|
+
else
|
|
345
|
+
for (let s = 0; s < this.curDistance.length; s++)
|
|
346
|
+
t.push(this.getInnerText(s));
|
|
347
|
+
return t;
|
|
348
|
+
}
|
|
349
|
+
getValue() {
|
|
350
|
+
return this.curValue;
|
|
351
|
+
}
|
|
352
|
+
calcDistance(t) {
|
|
353
|
+
return 2 * this.optionHeight - t * this.optionHeight;
|
|
354
|
+
}
|
|
355
|
+
setCurDistance(t) {
|
|
356
|
+
const e = [];
|
|
357
|
+
for (let i = 0; i < this.sliderList.length; i++)
|
|
358
|
+
e.push(this.calcDistance(t[i])), this.movePosition(this.sliderList[i], e[i]);
|
|
359
|
+
this.curDistance = e;
|
|
360
|
+
}
|
|
361
|
+
fixPosition(t) {
|
|
362
|
+
return -(this.getIndex(t) - 2) * this.optionHeight;
|
|
363
|
+
}
|
|
364
|
+
movePosition(t, e) {
|
|
365
|
+
t.style.transform = "translate3d(0," + e + "px, 0)";
|
|
366
|
+
}
|
|
367
|
+
locatePosition(t, e) {
|
|
368
|
+
this.curDistance[t] = this.calcDistance(e), this.movePosition(this.sliderList[t], this.curDistance[t]), this.isCascade && this.checkRange(t, this.getIndexArr());
|
|
369
|
+
}
|
|
370
|
+
updateCurDistance(t, e) {
|
|
371
|
+
this.curDistance[e] = parseInt(t.style.transform.split(",")[1]);
|
|
372
|
+
}
|
|
373
|
+
getInnerText(t) {
|
|
374
|
+
var s;
|
|
375
|
+
const e = this.sliderList[t].getElementsByTagName("li").length;
|
|
376
|
+
let i = this.getIndex(this.curDistance[t]);
|
|
377
|
+
return i >= e ? i = e - 1 : i < 0 && (i = 0), ((s = this.sliderList[t].getElementsByTagName("li")[i]) == null ? void 0 : s.innerText) || "";
|
|
378
|
+
}
|
|
379
|
+
touch(t) {
|
|
380
|
+
var l, o, d, a, c, u, f, v;
|
|
381
|
+
const i = (t.composedPath && t.composedPath()).find((m) => {
|
|
382
|
+
var p;
|
|
383
|
+
return (p = m.classList) == null ? void 0 : p.contains("ms-wheel");
|
|
384
|
+
});
|
|
385
|
+
if (!i)
|
|
386
|
+
return;
|
|
387
|
+
const s = i.firstChild, n = parseInt(i.getAttribute("data-index") || "0");
|
|
388
|
+
switch (t.type) {
|
|
389
|
+
case "touchstart":
|
|
390
|
+
case "mousedown":
|
|
391
|
+
s.style.transition = "none 0s ease-out", this.startY = Math.floor(t instanceof TouchEvent ? t.touches[0].clientY : t.clientY), this.preMoveY = this.startY, t.type === "mousedown" && (this.enableClickStatus = !0);
|
|
392
|
+
break;
|
|
393
|
+
case "touchmove":
|
|
394
|
+
case "mousemove":
|
|
395
|
+
if (t.preventDefault(), t.type === "mousemove" && !this.enableClickStatus)
|
|
396
|
+
break;
|
|
397
|
+
this.moveY = Math.floor(t instanceof TouchEvent ? t.touches[0].clientY : t.clientY), this.offsetY = (this.moveY - this.preMoveY) * this.config.scrollSpeed, this.updateCurDistance(s, n), this.curDistance[n] = this.curDistance[n] + this.offsetY, this.movePosition(s, this.curDistance[n]), this.preMoveY = this.moveY;
|
|
398
|
+
break;
|
|
399
|
+
case "touchend":
|
|
400
|
+
case "mouseup":
|
|
401
|
+
if (s.style.transition = "transform 0.18s ease-out", this.moveEndY = Math.floor(t instanceof TouchEvent ? t.changedTouches[0].clientY : t.clientY), this.offsetSum = this.moveEndY - this.startY, this.oversizeBorder = -(s.getElementsByTagName("li").length - 3) * this.optionHeight, this.offsetSum == 0) {
|
|
402
|
+
const m = Math.floor((window.innerHeight - this.moveEndY) / 40);
|
|
403
|
+
if (m != 2) {
|
|
404
|
+
const p = m - 2, C = this.curDistance[n] + p * this.optionHeight;
|
|
405
|
+
C <= 2 * this.optionHeight && C >= this.oversizeBorder && (this.curDistance[n] = C, this.movePosition(s, this.curDistance[n]), (o = (l = this.config).transitionEnd) == null || o.call(l, this.getIndexArr(), this.getCurValue(), this), (a = (d = this.config).onTransitionEnd) == null || a.call(d, this.getCurValue(), this.getIndexArr(), this));
|
|
406
|
+
}
|
|
407
|
+
} else
|
|
408
|
+
this.updateCurDistance(s, n), this.curDistance[n] = this.fixPosition(this.curDistance[n]), this.curDistance[n] > 2 * this.optionHeight ? this.curDistance[n] = 2 * this.optionHeight : this.curDistance[n] < this.oversizeBorder && (this.curDistance[n] = this.oversizeBorder), this.movePosition(s, this.curDistance[n]), (u = (c = this.config).transitionEnd) == null || u.call(c, this.getIndexArr(), this.getCurValue(), this), (v = (f = this.config).onTransitionEnd) == null || v.call(f, this.getCurValue(), this.getIndexArr(), this);
|
|
409
|
+
t.type === "mouseup" && (this.enableClickStatus = !1), this.isCascade && this.checkRange(n, this.getIndexArr());
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
let y = r;
|
|
415
|
+
h(y, "defaultConfig", {
|
|
416
|
+
keyMap: { id: "id", value: "value", childs: "childs" },
|
|
417
|
+
position: [],
|
|
418
|
+
colWidth: [],
|
|
419
|
+
title: "",
|
|
420
|
+
connector: " ",
|
|
421
|
+
ensureBtnText: "\u786E\u8BA4",
|
|
422
|
+
cancelBtnText: "\u53D6\u6D88",
|
|
423
|
+
triggerDisplayValue: !0,
|
|
424
|
+
scrollSpeed: 1
|
|
425
|
+
}), h(y, "REQUIRED_PARAMS", ["trigger", "wheels"]);
|
|
721
426
|
|
|
722
|
-
const ptcMobileSelectCss = ".
|
|
427
|
+
const ptcMobileSelectCss = ".ms-mobile-select{position:relative;z-index:0;opacity:0;visibility:hidden;-webkit-transition:opacity 0.4s, z-index 0.4s;transition:opacity 0.4s, z-index 0.4s}.ms-mobile-select *{margin:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.ms-mobile-select .ms-gray-layer{position:fixed;top:0;left:0;bottom:0;right:0;background:rgba(0, 0, 0, 0.7);z-index:888;display:block}.ms-mobile-select .ms-content{width:100%;display:block;position:fixed;z-index:889;color:black;-webkit-transition:all 0.4s;transition:all 0.4s;bottom:-350px;left:0;background:white}.ms-mobile-select .ms-fix-width{width:90%;margin:0 auto;position:relative}.ms-mobile-select .ms-fix-width:after{content:\".\";display:block;height:0;clear:both;visibility:hidden}.ms-mobile-select .ms-btn-bar{border-bottom:1px solid #dcdcdc;font-size:15px;height:45px;position:relative;text-align:center;line-height:45px}.ms-mobile-select .ms-cancel,.ms-mobile-select .ms-ensure{height:45px;width:55px;cursor:pointer;position:absolute;top:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}.ms-mobile-select .ms-cancel{left:0;color:#666}.ms-mobile-select .ms-ensure{right:0;color:#1e83d3}.ms-mobile-select .ms-title{font-size:15px;padding:0 15%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ms-mobile-select .ms-panel:after{content:\".\";display:block;height:0;clear:both;visibility:hidden}.ms-mobile-select .ms-wheels{width:100%;height:200px;overflow:hidden}.ms-mobile-select .ms-wheel{position:relative;z-index:0;float:left;width:50%;height:200px;overflow:hidden;-webkit-transition:width 0.3s ease;transition:width 0.3s ease}.ms-mobile-select .ms-select-container{display:block;text-align:center}.ms-mobile-select .ms-select-container li{font-size:15px;display:block;height:40px;line-height:40px;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}.ms-mobile-select .ms-select-line{height:40px;width:100%;position:absolute;top:80px;pointer-events:none;-webkit-box-sizing:border-box;box-sizing:border-box;border-top:1px solid #dcdcdc;border-bottom:1px solid #dcdcdc}.ms-mobile-select .ms-shadow-mask{position:absolute;top:0;width:100%;height:200px;background:linear-gradient(to bottom, #fffffff5, #ffffffcc 25%, #ffffff00 49%, #ffffff00 51%, #ffffffcc 75%, #fffffff5);opacity:0.9;pointer-events:none}.ms-mobile-select.ms-show{opacity:1;z-index:10000;visibility:visible}.ms-mobile-select.ms-show .ms-content{bottom:0}.ms-default-trigger{min-height:1em;color:#888}body.ms-show{overflow-y:hidden}.mobile-select-wrapper{display:block}.mobile-select-wrapper div{display:inline;margin-right:var(--ptc-element-spacing-03);width:100%;font-family:var(--ptc-font-latin);font-weight:var(--ptc-font-weight-regular);font-size:var(--ptc-font-size-x-small);line-height:var(--ptc-line-height-densest);color:var(--color-white);height:18px}.mobileSelect .content{top:auto}.mobileSelect .content .btnBar{border-color:var(--color-gray-10)}.mobileSelect .content .btnBar .cancel,.mobileSelect .content .btnBar .ensure,.mobileSelect .content .btnBar .title{font-family:var(--ptc-font-latin);font-weight:var(--ptc-font-weight-semibold);font-size:var(--ptc-font-size-x-small);line-height:var(--ptc-line-height-densest)}.mobileSelect .content .btnBar .ensure,.mobileSelect .content .btnBar .cancel{transform:translateY(12.5px);width:125px}.mobileSelect .content .panel .wheel .selectContainer li{font-family:var(--ptc-font-latin);font-weight:var(--ptc-font-weight-semibold);font-size:var(--ptc-font-size-x-small);line-height:var(--ptc-line-height-densest);height:45px}ptc-responsive-wrapper.xsmall .mobile-select-wrapper,ptc-responsive-wrapper.small .mobile-select-wrapper{display:block}ptc-responsive-wrapper.medium .mobile-select-wrapper,ptc-responsive-wrapper.large .mobile-select-wrapper,ptc-responsive-wrapper.xlarge .mobile-select-wrapper,ptc-responsive-wrapper.xxlarge .mobile-select-wrapper,ptc-responsive-wrapper.large2k .mobile-select-wrapper,ptc-responsive-wrapper.large4k .mobile-select-wrapper{display:none}";
|
|
723
428
|
|
|
724
429
|
const PtcMobileSelect = class {
|
|
725
430
|
constructor(hostRef) {
|
|
@@ -738,7 +443,7 @@ const PtcMobileSelect = class {
|
|
|
738
443
|
componentDidRender() {
|
|
739
444
|
let currentId = this.selectedId; //input current lang
|
|
740
445
|
let storeIndex = 0;
|
|
741
|
-
new
|
|
446
|
+
new y({
|
|
742
447
|
trigger: `#${this.triggerName}`,
|
|
743
448
|
title: `${this.listTitle ? this.listTitle : ''}`,
|
|
744
449
|
wheels: this.wheelData ? [{ data: this.wheelData }] : [{ data: ['test1', 'test2'] }],
|