zz-shopify-components 0.9.0 → 0.11.0
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/assets/zz-modal.js +18 -3
- package/blocks/zz-edu-form.liquid +5 -5
- package/package.json +1 -1
- package/sections/zz-modal.liquid +11 -1
package/assets/zz-modal.js
CHANGED
|
@@ -107,15 +107,25 @@
|
|
|
107
107
|
all: unset;
|
|
108
108
|
cursor: pointer;
|
|
109
109
|
position: absolute;
|
|
110
|
-
top:
|
|
111
|
-
right:
|
|
110
|
+
top: 20px;
|
|
111
|
+
right: 20px;
|
|
112
112
|
width: 32px;
|
|
113
113
|
height: 32px;
|
|
114
114
|
border-radius: 9999px;
|
|
115
115
|
display: grid;
|
|
116
116
|
place-items: center;
|
|
117
117
|
}
|
|
118
|
-
.close-btn
|
|
118
|
+
.close-btn-white {
|
|
119
|
+
color: white;
|
|
120
|
+
background-color: rgba(0,0,0,0.08);
|
|
121
|
+
backdrop-filter: blur(10px);
|
|
122
|
+
}
|
|
123
|
+
.close-btn-black {
|
|
124
|
+
color: white;
|
|
125
|
+
background-color: #333333;
|
|
126
|
+
/* backdrop-filter: blur(10px); */
|
|
127
|
+
}
|
|
128
|
+
.close-btn:focus-visible { outline: none; }
|
|
119
129
|
`;
|
|
120
130
|
|
|
121
131
|
const TEMPLATE = document.createElement('template');
|
|
@@ -151,6 +161,11 @@
|
|
|
151
161
|
style.textContent = STYLE_TEXT;
|
|
152
162
|
shadow.appendChild(style);
|
|
153
163
|
shadow.appendChild(TEMPLATE.content.cloneNode(true));
|
|
164
|
+
const closeBtnColor = this.getAttribute('close-btn-color');
|
|
165
|
+
if (closeBtnColor) {
|
|
166
|
+
const closeBtn = shadow.querySelector('.close-btn');
|
|
167
|
+
closeBtn.classList.add(closeBtnColor);
|
|
168
|
+
}
|
|
154
169
|
|
|
155
170
|
this._dialog = shadow.querySelector('dialog');
|
|
156
171
|
this._panel = shadow.querySelector('.panel-inner');
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
{% assign eu_country_list = 'Deutschland,Germany,La France,France,España,Italia,Österreich,Belgium,Bulgaria,Croatia,Czech Republic,Denmark,Estonia,Finland,Hungary,Ireland,Latvia,Lithuania,Luxembourg,Monaco,Netherlands,Poland,Portugal,Romania,Slovakia,Slovenia,Sweden' | split: ',' %}
|
|
93
93
|
|
|
94
94
|
<div class="tw-w-full tw-flex tw-flex-col tw-items-center tw-justify-center">
|
|
95
|
-
<zz-radio-tabs name="edu-form-type" class="tw-bg-[#F5F5F6] lg:tw-w-[388px]">
|
|
95
|
+
<zz-radio-tabs name="edu-form-type-{{ block.id }}" class="tw-bg-[#F5F5F6] lg:tw-w-[388px]">
|
|
96
96
|
<zz-radio-tabs-item value="email" checked>Verify my email</zz-radio-tabs-item>
|
|
97
97
|
<zz-radio-tabs-item value="manual">Upload student card</zz-radio-tabs-item>
|
|
98
98
|
</zz-radio-tabs>
|
|
@@ -482,19 +482,19 @@
|
|
|
482
482
|
identityDocumentUrl = result.url
|
|
483
483
|
fileUploadLoading.classList.add('tw-hidden')
|
|
484
484
|
} else {
|
|
485
|
-
removeEduVerifyFile()
|
|
485
|
+
window['removeEduVerifyFile{{ block.id }}']()
|
|
486
486
|
fileUploadLoading.classList.add('tw-hidden')
|
|
487
487
|
zzShowToast('File upload failed, please try again.')
|
|
488
488
|
}
|
|
489
489
|
|
|
490
490
|
} catch (error) {
|
|
491
|
-
removeEduVerifyFile()
|
|
491
|
+
window['removeEduVerifyFile{{ block.id }}']()
|
|
492
492
|
fileUploadLoading.classList.add('tw-hidden')
|
|
493
493
|
zzShowToast('File upload failed, please try again.')
|
|
494
494
|
}
|
|
495
495
|
|
|
496
496
|
} else {
|
|
497
|
-
removeEduVerifyFile()
|
|
497
|
+
window['removeEduVerifyFile{{ block.id }}']()
|
|
498
498
|
fileUploadLoading.classList.add('tw-hidden')
|
|
499
499
|
zzShowToast('File upload failed, please try again.')
|
|
500
500
|
}
|
|
@@ -502,7 +502,7 @@
|
|
|
502
502
|
}).catch((err) => {
|
|
503
503
|
zzShowToast(EduErrorCodeConf[500].en)
|
|
504
504
|
fileUploadLoading.classList.add('tw-hidden')
|
|
505
|
-
removeEduVerifyFile()
|
|
505
|
+
window['removeEduVerifyFile{{ block.id }}']()
|
|
506
506
|
});
|
|
507
507
|
}
|
|
508
508
|
});
|
package/package.json
CHANGED
package/sections/zz-modal.liquid
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
</style>
|
|
17
17
|
|
|
18
|
-
<zz-modal {% if section.settings.sheet_on_mobile %} sheet-on-mobile {% endif %} {% if section.settings.no_backdrop_close %} no-backdrop-close {% endif %} id="{{ section.settings.modal_id }}"{% unless section.settings.show_header %} no-header{% endunless %}{% unless section.settings.show_footer %} no-footer{% endunless %}>
|
|
18
|
+
<zz-modal close-btn-color="close-btn-{{ section.settings.close_btn_color }}" {% if section.settings.sheet_on_mobile %} sheet-on-mobile {% endif %} {% if section.settings.no_backdrop_close %} no-backdrop-close {% endif %} id="{{ section.settings.modal_id }}"{% unless section.settings.show_header %} no-header{% endunless %}{% unless section.settings.show_footer %} no-footer{% endunless %}>
|
|
19
19
|
{% if section.settings.show_header %}
|
|
20
20
|
<div slot="header" class="tw-text-[24px] tw-font-semibold">{{ section.settings.header_text }}</div>
|
|
21
21
|
{% endif %}
|
|
@@ -49,6 +49,16 @@
|
|
|
49
49
|
"id": "modal_id",
|
|
50
50
|
"label": "弹窗id (必填)",
|
|
51
51
|
"default": "demo-modal"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"type": "select",
|
|
55
|
+
"id": "close_btn_color",
|
|
56
|
+
"label": "关闭按钮颜色",
|
|
57
|
+
"default": "white",
|
|
58
|
+
"options": [
|
|
59
|
+
{ "value": "white", "label": "白色" },
|
|
60
|
+
{ "value": "black", "label": "黑色" }
|
|
61
|
+
],
|
|
52
62
|
},
|
|
53
63
|
{
|
|
54
64
|
"type": "checkbox",
|