@salla.sa/twilight-components 1.0.3 → 1.0.5
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/twilight-components/app-globals-0f993ce5.js +3 -0
- package/dist/twilight-components/css-shim-a64b8820.js +4 -0
- package/dist/twilight-components/dom-d08ba8aa.js +73 -0
- package/dist/twilight-components/index-0aa9ca9b.js +3010 -0
- package/dist/twilight-components/index-d2312a61.js +3010 -0
- package/dist/twilight-components/index-d6ed984a.js +3010 -0
- package/dist/twilight-components/index.esm.js +3 -1
- package/dist/twilight-components/salla-login-0e725af9.js +12 -0
- package/dist/twilight-components/salla-login-2a48c6c7.js +29 -0
- package/dist/twilight-components/salla-login-2bfbce21.js +16 -0
- package/dist/twilight-components/salla-login-45a3f61c.js +16 -0
- package/dist/twilight-components/salla-login-5fe80dd7.js +29 -0
- package/dist/twilight-components/salla-login-69a00ca2.js +12 -0
- package/dist/twilight-components/salla-login-7bf31d85.js +29 -0
- package/dist/twilight-components/salla-login-cb872dc2.js +16 -0
- package/dist/twilight-components/salla-login.entry.js +2 -0
- package/dist/twilight-components/salla-modal.entry.js +24 -0
- package/dist/twilight-components/salla-search-modal.entry.js +2 -0
- package/dist/{esm/search-modal-d6e12d32.js → twilight-components/search-modal-5dc35a08.js} +2 -34
- package/dist/twilight-components/search-modal-c1babeb6.js +94 -0
- package/dist/twilight-components/search-modal-ee69bd04.js +94 -0
- package/dist/twilight-components/shadow-css-bc14d9fd.js +389 -0
- package/dist/twilight-components/twilight-components.esm.js +125 -1
- package/dist/types/components/salla-login/salla-login.d.ts +0 -11
- package/dist/types/components/salla-modal/salla-modal.d.ts +9 -0
- package/dist/{collection/interfaces/colors.js → types/components/salla-modal/test/salla-modal.e2e.d.ts} +0 -0
- package/dist/{collection/interfaces/ratio.js → types/components/salla-modal/test/salla-modal.spec.d.ts} +0 -0
- package/dist/types/components.d.ts +23 -10
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/utils.spec.d.ts +1 -0
- package/package.json +3 -2
- package/dist/cjs/index-9441fd8e.js +0 -1554
- package/dist/cjs/index.cjs.js +0 -121
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/cjs/salla-login_2.cjs.entry.js +0 -11
- package/dist/cjs/search-modal-722cccc3.js +0 -129
- package/dist/cjs/twilight-components.cjs.js +0 -19
- package/dist/collection/collection-manifest.json +0 -13
- package/dist/collection/components/generate-summary.js +0 -35
- package/dist/collection/components/salla-login/salla-login.css +0 -104
- package/dist/collection/components/salla-login/salla-login.js +0 -113
- package/dist/collection/components/search-modal/search-modal.css +0 -9
- package/dist/collection/components/search-modal/search-modal.js +0 -161
- package/dist/collection/index.js +0 -3
- package/dist/collection/interfaces/index.js +0 -2
- package/dist/collection/plugins/tailwind-theme/index.js +0 -31
- package/dist/collection/plugins/tailwind-theme/scripts/generator.js +0 -51
- package/dist/collection/utils/utils.js +0 -16
- package/dist/esm/index-63e5409f.js +0 -1527
- package/dist/esm/index.js +0 -115
- package/dist/esm/loader.js +0 -17
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/salla-login_2.entry.js +0 -2
- package/dist/esm/twilight-components.js +0 -17
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/loader/cdn.js +0 -3
- package/dist/loader/index.cjs.js +0 -3
- package/dist/loader/index.d.ts +0 -13
- package/dist/loader/index.es2017.js +0 -3
- package/dist/loader/index.js +0 -4
- package/dist/loader/package.json +0 -10
- package/dist/twilight-components/p-01102f97.entry.js +0 -1
- package/dist/twilight-components/p-3d53781c.js +0 -1
- package/dist/twilight-components/p-591a15cf.js +0 -1
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export{S as SallaLogin
|
|
1
|
+
export { S as SallaLogin } from './salla-login-0e725af9.js';
|
|
2
|
+
export { S as SearchModal } from './search-modal-5dc35a08.js';
|
|
3
|
+
import './index-d6ed984a.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-d6ed984a.js';
|
|
2
|
+
|
|
3
|
+
const SallaLogin = class {
|
|
4
|
+
constructor(hostRef) {
|
|
5
|
+
registerInstance(this, hostRef);
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h("salla-modal", { id: "salla-login", title: "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644 \u0625\u0644\u0649 \u0627\u0644\u0645\u0648\u0642\u0639" }, h("div", { id: "showLoginMethods" }, h("p", { class: "text-sm text-gray-text mb-5" }, "\u0627\u062E\u062A\u0631 \u0627\u0644\u0648\u0633\u064A\u0644\u0629 \u0627\u0644\u0645\u0646\u0627\u0633\u0628\u0629"), h("div", { id: "openEmailLogin", class: "mb-2.5 box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-mail" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))), h("div", { class: "box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-phone" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0647\u0627\u062A\u0641")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))))));
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { SallaLogin as S };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-d2312a61.js';
|
|
2
|
+
|
|
3
|
+
const sallaLoginCss = ".wrapper{opacity:0;visibility:hidden;position:fixed;width:100%;height:100%;top:0;left:0;background:#fcfcfc;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;display:flex;align-items:center;justify-content:center;z-index:1050}.wrapper .modal{font-family:Helvetica, sans-serif;font-size:14px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:90%;border:1px solid rgba(0, 0, 0, 0.2);border-radius:0.3rem}@media (min-width: 576px){.wrapper .modal{max-width:500px}}.wrapper .modal .displayed{display:flex}.wrapper .modal .modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.visible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.hide{display:none !important}.show{display:block !important}.search-box{display:flex}.search-box input{width:100%;padding:10px;padding-inline-start:32px}.search-box button{background-color:transparent;border:0;position:absolute;padding:12px;left:12px}.results{list-style:none;padding:0;margin:0;max-height:300px;overflow-y:scroll}.results .product-img{width:50px;margin-inline-end:10px}.results a:first-child{margin-top:20px}.results a{display:flex;border-bottom:1px solid #ddd}.results a h5{margin-top:5px}";
|
|
4
|
+
|
|
5
|
+
const SallaLogin = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
/**
|
|
9
|
+
* If 'true' will make the modal visible.
|
|
10
|
+
*/
|
|
11
|
+
this.visible = false;
|
|
12
|
+
this.handleClose = () => {
|
|
13
|
+
this.visible = false;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
handleClick(ev) {
|
|
17
|
+
if (!ev.path.some(x => x.className && x.className.includes('modal-body')) &&
|
|
18
|
+
ev.target.localName === 'salla-search-modal') {
|
|
19
|
+
this.visible = false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return (h("div", { class: this.visible ? 'wrapper visible' : 'wrapper' }, h("div", { class: "modal" }, h("div", { class: 'modal-header' }, h("h5", { class: "title" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644 \u0625\u0644\u064A \u0627\u0644\u0645\u0648\u0642\u0639"), h("button", { type: "button", class: "close", "data-dismiss": "modal", "aria-label": "Close", onClick: this.handleClose }, h("span", { "aria-hidden": "true" }, "\u00D7"))), h("div", { class: "modal-body" }, h("div", { id: "showLoginMethods" }, h("p", { class: "text-sm text-gray-text mb-5" }, "\u0627\u062E\u062A\u0631 \u0627\u0644\u0648\u0633\u064A\u0644\u0629 \u0627\u0644\u0645\u0646\u0627\u0633\u0628\u0629"), h("div", { id: "openEmailLogin", class: "mb-2.5 box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-mail" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))), h("div", { class: "box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-phone" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0647\u0627\u062A\u0641")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))))))));
|
|
24
|
+
}
|
|
25
|
+
static get assetsDirs() { return ["assets"]; }
|
|
26
|
+
};
|
|
27
|
+
SallaLogin.style = sallaLoginCss;
|
|
28
|
+
|
|
29
|
+
export { SallaLogin as S };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-d6ed984a.js';
|
|
2
|
+
|
|
3
|
+
const sallaLoginCss = ".wrapper{opacity:0;visibility:hidden;position:fixed;width:100%;height:100%;top:0;left:0;background:#fcfcfc;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;display:flex;align-items:center;justify-content:center;z-index:1050}.wrapper .modal{font-family:Helvetica, sans-serif;font-size:14px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:90%;border:1px solid rgba(0, 0, 0, 0.2);border-radius:0.3rem}@media (min-width: 576px){.wrapper .modal{max-width:500px}}.wrapper .modal .displayed{display:flex}.wrapper .modal .modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.visible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.hide{display:none !important}.show{display:block !important}.search-box{display:flex}.search-box input{width:100%;padding:10px;padding-inline-start:32px}.search-box button{background-color:transparent;border:0;position:absolute;padding:12px;left:12px}.results{list-style:none;padding:0;margin:0;max-height:300px;overflow-y:scroll}.results .product-img{width:50px;margin-inline-end:10px}.results a:first-child{margin-top:20px}.results a{display:flex;border-bottom:1px solid #ddd}.results a h5{margin-top:5px}";
|
|
4
|
+
|
|
5
|
+
const SallaLogin = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return (h("salla-modal", { id: "salla-login" }, h("div", { slot: "header", class: 'modal-header' }, h("h5", { class: "title" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644 \u0625\u0644\u064A \u0627\u0644\u0645\u0648\u0642\u0639"), h("button", { type: "button", class: "s-salla-modal-close cursor-pointer", "aria-label": "Close", "data-close-modal": "salla-login" }, h("span", { "aria-hidden": "true" }, "\u00D7"))), h("div", { id: "showLoginMethods" }, h("p", { class: "text-sm text-gray-text mb-5" }, "\u0627\u062E\u062A\u0631 \u0627\u0644\u0648\u0633\u064A\u0644\u0629 \u0627\u0644\u0645\u0646\u0627\u0633\u0628\u0629"), h("div", { id: "openEmailLogin", class: "mb-2.5 box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-mail" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))), h("div", { class: "box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-phone" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0647\u0627\u062A\u0641")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))))));
|
|
11
|
+
}
|
|
12
|
+
static get assetsDirs() { return ["assets"]; }
|
|
13
|
+
};
|
|
14
|
+
SallaLogin.style = sallaLoginCss;
|
|
15
|
+
|
|
16
|
+
export { SallaLogin as S };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-d6ed984a.js';
|
|
2
|
+
|
|
3
|
+
const sallaLoginCss = ".wrapper{opacity:0;visibility:hidden;position:fixed;width:100%;height:100%;top:0;left:0;background:#fcfcfc;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;display:flex;align-items:center;justify-content:center;z-index:1050}.wrapper .modal{font-family:Helvetica, sans-serif;font-size:14px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:90%;border:1px solid rgba(0, 0, 0, 0.2);border-radius:0.3rem}@media (min-width: 576px){.wrapper .modal{max-width:500px}}.wrapper .modal .displayed{display:flex}.wrapper .modal .modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.visible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.hide{display:none !important}.show{display:block !important}.search-box{display:flex}.search-box input{width:100%;padding:10px;padding-inline-start:32px}.search-box button{background-color:transparent;border:0;position:absolute;padding:12px;left:12px}.results{list-style:none;padding:0;margin:0;max-height:300px;overflow-y:scroll}.results .product-img{width:50px;margin-inline-end:10px}.results a:first-child{margin-top:20px}.results a{display:flex;border-bottom:1px solid #ddd}.results a h5{margin-top:5px}";
|
|
4
|
+
|
|
5
|
+
const SallaLogin = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return (h("salla-modal", { id: "salla-login" }, h("div", { slot: "header", class: 'modal-header' }, h("h5", { class: "title" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644 \u0625\u0644\u064A \u0627\u0644\u0645\u0648\u0642\u0639"), h("button", { type: "button", class: "s-salla-modal-close cursor-pointer", "data-dismiss": "modal", "aria-label": "Close", "data-close-modal": "salla-login" }, h("span", { "aria-hidden": "true" }, "\u00D7"))), h("div", { id: "showLoginMethods" }, h("p", { class: "text-sm text-gray-text mb-5" }, "\u0627\u062E\u062A\u0631 \u0627\u0644\u0648\u0633\u064A\u0644\u0629 \u0627\u0644\u0645\u0646\u0627\u0633\u0628\u0629"), h("div", { id: "openEmailLogin", class: "mb-2.5 box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-mail" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))), h("div", { class: "box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-phone" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0647\u0627\u062A\u0641")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))))));
|
|
11
|
+
}
|
|
12
|
+
static get assetsDirs() { return ["assets"]; }
|
|
13
|
+
};
|
|
14
|
+
SallaLogin.style = sallaLoginCss;
|
|
15
|
+
|
|
16
|
+
export { SallaLogin as S };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-d2312a61.js';
|
|
2
|
+
|
|
3
|
+
const sallaLoginCss = ".wrapper{opacity:0;visibility:hidden;position:fixed;width:100%;height:100%;top:0;left:0;background:#fcfcfc;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;display:flex;align-items:center;justify-content:center;z-index:1050}.wrapper .modal{font-family:Helvetica, sans-serif;font-size:14px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:90%;border:1px solid rgba(0, 0, 0, 0.2);border-radius:0.3rem}@media (min-width: 576px){.wrapper .modal{max-width:500px}}.wrapper .modal .displayed{display:flex}.wrapper .modal .modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.visible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.hide{display:none !important}.show{display:block !important}.search-box{display:flex}.search-box input{width:100%;padding:10px;padding-inline-start:32px}.search-box button{background-color:transparent;border:0;position:absolute;padding:12px;left:12px}.results{list-style:none;padding:0;margin:0;max-height:300px;overflow-y:scroll}.results .product-img{width:50px;margin-inline-end:10px}.results a:first-child{margin-top:20px}.results a{display:flex;border-bottom:1px solid #ddd}.results a h5{margin-top:5px}";
|
|
4
|
+
|
|
5
|
+
const SallaLogin = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
/**
|
|
9
|
+
* If 'true' will make the modal visible.
|
|
10
|
+
*/
|
|
11
|
+
this.visible = false;
|
|
12
|
+
this.handleClose = () => {
|
|
13
|
+
this.visible = false;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
handleClick(ev) {
|
|
17
|
+
if (!ev.path.some(x => x.className && x.className.includes('modal-body')) &&
|
|
18
|
+
ev.target.localName === 'salla-search-modal') {
|
|
19
|
+
this.visible = false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return (h("salla-modal", { class: { visible: this.visible } }, h("div", { slot: "header", class: 'modal-header' }, h("h5", { class: "title" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644 \u0625\u0644\u064A \u0627\u0644\u0645\u0648\u0642\u0639"), h("button", { type: "button", class: "close", "data-dismiss": "modal", "aria-label": "Close", onClick: this.handleClose }, h("span", { "aria-hidden": "true" }, "\u00D7"))), h("div", { id: "showLoginMethods" }, h("p", { class: "text-sm text-gray-text mb-5" }, "\u0627\u062E\u062A\u0631 \u0627\u0644\u0648\u0633\u064A\u0644\u0629 \u0627\u0644\u0645\u0646\u0627\u0633\u0628\u0629"), h("div", { id: "openEmailLogin", class: "mb-2.5 box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-mail" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))), h("div", { class: "box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-phone" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0647\u0627\u062A\u0641")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))))));
|
|
24
|
+
}
|
|
25
|
+
static get assetsDirs() { return ["assets"]; }
|
|
26
|
+
};
|
|
27
|
+
SallaLogin.style = sallaLoginCss;
|
|
28
|
+
|
|
29
|
+
export { SallaLogin as S };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-d6ed984a.js';
|
|
2
|
+
|
|
3
|
+
const SallaLogin = class {
|
|
4
|
+
constructor(hostRef) {
|
|
5
|
+
registerInstance(this, hostRef);
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h("salla-modal", { id: "salla-login" }, h("div", { slot: "header", class: 'modal-header' }, h("h5", { class: "title" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644 \u0625\u0644\u064A \u0627\u0644\u0645\u0648\u0642\u0639"), h("button", { type: "button", class: "s-salla-modal-close cursor-pointer", "aria-label": "Close", "data-close-modal": "salla-login" }, h("span", { "aria-hidden": "true" }, "\u00D7"))), h("div", { id: "showLoginMethods" }, h("p", { class: "text-sm text-gray-text mb-5" }, "\u0627\u062E\u062A\u0631 \u0627\u0644\u0648\u0633\u064A\u0644\u0629 \u0627\u0644\u0645\u0646\u0627\u0633\u0628\u0629"), h("div", { id: "openEmailLogin", class: "mb-2.5 box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-mail" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))), h("div", { class: "box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-phone" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0647\u0627\u062A\u0641")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))))));
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { SallaLogin as S };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-0aa9ca9b.js';
|
|
2
|
+
|
|
3
|
+
const sallaLoginCss = ".wrapper{opacity:0;visibility:hidden;position:fixed;width:100%;height:100%;top:0;left:0;background:#fcfcfc;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;display:flex;align-items:center;justify-content:center;z-index:1050}.wrapper .modal{font-family:Helvetica, sans-serif;font-size:14px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:90%;border:1px solid rgba(0, 0, 0, 0.2);border-radius:0.3rem}@media (min-width: 576px){.wrapper .modal{max-width:500px}}.wrapper .modal .displayed{display:flex}.wrapper .modal .modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.visible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.hide{display:none !important}.show{display:block !important}.search-box{display:flex}.search-box input{width:100%;padding:10px;padding-inline-start:32px}.search-box button{background-color:transparent;border:0;position:absolute;padding:12px;left:12px}.results{list-style:none;padding:0;margin:0;max-height:300px;overflow-y:scroll}.results .product-img{width:50px;margin-inline-end:10px}.results a:first-child{margin-top:20px}.results a{display:flex;border-bottom:1px solid #ddd}.results a h5{margin-top:5px}";
|
|
4
|
+
|
|
5
|
+
const SallaLogin = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
/**
|
|
9
|
+
* If 'true' will make the modal visible.
|
|
10
|
+
*/
|
|
11
|
+
this.visible = false;
|
|
12
|
+
this.handleClose = () => {
|
|
13
|
+
this.visible = false;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
handleClick(ev) {
|
|
17
|
+
if (!ev.path.some(x => x.className && x.className.includes('modal-body')) &&
|
|
18
|
+
ev.target.localName === 'salla-search-modal') {
|
|
19
|
+
this.visible = false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return (h("div", { class: this.visible ? 'wrapper visible' : 'wrapper' }, h("div", { class: "modal" }, h("div", { class: 'modal-header' }, h("h5", { class: "title" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644 \u0625\u0644\u064A \u0627\u0644\u0645\u0648\u0642\u0639"), h("button", { type: "button", class: "close", "data-dismiss": "modal", "aria-label": "Close", onClick: this.handleClose }, h("span", { "aria-hidden": "true" }, "\u00D7"))), h("div", { class: "modal-body" }, h("div", { id: "showLoginMethods" }, h("p", { class: "text-sm text-gray-text mb-5" }, "\u0627\u062E\u062A\u0631 \u0627\u0644\u0648\u0633\u064A\u0644\u0629 \u0627\u0644\u0645\u0646\u0627\u0633\u0628\u0629"), h("div", { id: "openEmailLogin", class: "mb-2.5 box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-mail" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))), h("div", { class: "box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-phone" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0647\u0627\u062A\u0641")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))))))));
|
|
24
|
+
}
|
|
25
|
+
static get assetsDirs() { return ["assets"]; }
|
|
26
|
+
};
|
|
27
|
+
SallaLogin.style = sallaLoginCss;
|
|
28
|
+
|
|
29
|
+
export { SallaLogin as S };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-d6ed984a.js';
|
|
2
|
+
|
|
3
|
+
const sallaLoginCss = ".wrapper{opacity:0;visibility:hidden;position:fixed;width:100%;height:100%;top:0;left:0;background:#fcfcfc;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;display:flex;align-items:center;justify-content:center;z-index:1050}.wrapper .modal{font-family:Helvetica, sans-serif;font-size:14px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:90%;border:1px solid rgba(0, 0, 0, 0.2);border-radius:0.3rem}@media (min-width: 576px){.wrapper .modal{max-width:500px}}.wrapper .modal .displayed{display:flex}.wrapper .modal .modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.visible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.hide{display:none !important}.show{display:block !important}.search-box{display:flex}.search-box input{width:100%;padding:10px;padding-inline-start:32px}.search-box button{background-color:transparent;border:0;position:absolute;padding:12px;left:12px}.results{list-style:none;padding:0;margin:0;max-height:300px;overflow-y:scroll}.results .product-img{width:50px;margin-inline-end:10px}.results a:first-child{margin-top:20px}.results a{display:flex;border-bottom:1px solid #ddd}.results a h5{margin-top:5px}";
|
|
4
|
+
|
|
5
|
+
const SallaLogin = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return (h("salla-modal", { id: "salla-login" }, h("div", { slot: "header", class: 'modal-header' }, h("h5", { class: "title" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644 \u0625\u0644\u064A \u0627\u0644\u0645\u0648\u0642\u0639"), h("button", { type: "button", class: "close", "data-dismiss": "modal", "aria-label": "Close", "data-close-modal": "salla-login" }, h("span", { "aria-hidden": "true" }, "\u00D7"))), h("div", { id: "showLoginMethods" }, h("p", { class: "text-sm text-gray-text mb-5" }, "\u0627\u062E\u062A\u0631 \u0627\u0644\u0648\u0633\u064A\u0644\u0629 \u0627\u0644\u0645\u0646\u0627\u0633\u0628\u0629"), h("div", { id: "openEmailLogin", class: "mb-2.5 box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-mail" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))), h("div", { class: "box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-phone" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0647\u0627\u062A\u0641")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))))));
|
|
11
|
+
}
|
|
12
|
+
static get assetsDirs() { return ["assets"]; }
|
|
13
|
+
};
|
|
14
|
+
SallaLogin.style = sallaLoginCss;
|
|
15
|
+
|
|
16
|
+
export { SallaLogin as S };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { r as registerInstance, h, e as Host, g as getElement } from './index-d6ed984a.js';
|
|
2
|
+
|
|
3
|
+
const sallaModalCss = ":host{display:block}";
|
|
4
|
+
|
|
5
|
+
const SallaModal = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.error = false;
|
|
9
|
+
this.success = false;
|
|
10
|
+
this.title = '';
|
|
11
|
+
this.subTitle = '';
|
|
12
|
+
this.icon = 'sicon-cancel';
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
this.host.id = this.host.id || 'salla-modal';
|
|
16
|
+
return (h(Host, { class: 's-salla-modal-container hidden', "aria-modal": "true", role: "dialog" }, h("div", { class: "s-salla-modal-wrapper" }, h("div", { class: "s-salla-modal-overlay", "data-close-modal": this.host.id }), h("span", { class: "s-salla-modal-spacer" }, "\u200B"), h("div", { class: "s-salla-modal-body" }, h("slot", { name: "header" }, h("div", { class: "s-salla-modal-header" }, h("button", { class: "s-salla-modal-close cursor-pointer", "data-close-modal": this.host.id, type: "button" }, h("span", { class: "sicon-cancel" })), h("div", { class: "s-salla-modal-title" }, this.title), h("p", { class: "s-salla-modal-sub-title" }, this.subTitle), this.error || this.success
|
|
17
|
+
? h("div", { class: { 's-salla-modal-icon': true, 'bg-red-100': this.error, 'bg-green-100': this.success } }, h("i", { class: { [this.icon]: true, 'text-red-600': this.error, 'text-green-600': this.success } }))
|
|
18
|
+
: '')), h("slot", null), h("slot", { name: "footer" })))));
|
|
19
|
+
}
|
|
20
|
+
get host() { return getElement(this); }
|
|
21
|
+
};
|
|
22
|
+
SallaModal.style = sallaModalCss;
|
|
23
|
+
|
|
24
|
+
export { SallaModal as salla_modal };
|
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h,
|
|
2
|
-
|
|
3
|
-
const sallaLoginCss = ".wrapper{opacity:0;visibility:hidden;position:fixed;width:100%;height:100%;top:0;left:0;background:#fcfcfc;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;display:flex;align-items:center;justify-content:center;z-index:1050}.wrapper .modal{font-family:Helvetica, sans-serif;font-size:14px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:90%;border:1px solid rgba(0, 0, 0, 0.2);border-radius:0.3rem}@media (min-width: 576px){.wrapper .modal{max-width:500px}}.wrapper .modal .displayed{display:flex}.wrapper .modal .modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.visible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.hide{display:none !important}.show{display:block !important}.search-box{display:flex}.search-box input{width:100%;padding:10px;padding-inline-start:32px}.search-box button{background-color:transparent;border:0;position:absolute;padding:12px;left:12px}.results{list-style:none;padding:0;margin:0;max-height:300px;overflow-y:scroll}.results .product-img{width:50px;margin-inline-end:10px}.results a:first-child{margin-top:20px}.results a{display:flex;border-bottom:1px solid #ddd}.results a h5{margin-top:5px}";
|
|
4
|
-
|
|
5
|
-
const SallaLogin = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.fetchStatus = '';
|
|
9
|
-
this.searchIcon = 'Search_Icon.svg';
|
|
10
|
-
/**
|
|
11
|
-
* If 'true' will make the modal visible.
|
|
12
|
-
*/
|
|
13
|
-
this.visible = false;
|
|
14
|
-
this.handleClose = () => {
|
|
15
|
-
this.visible = false;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
handleClick(ev) {
|
|
19
|
-
if (!ev.path.some(x => x.className && x.className.includes('modal-body')) &&
|
|
20
|
-
ev.target.localName === 'salla-search-modal') {
|
|
21
|
-
this.visible = false;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
render() {
|
|
25
|
-
return (h("div", { class: this.visible ? 'wrapper visible' : 'wrapper' }, h("div", { class: "modal" }, h("div", { class: 'modal-header' }, h("h5", { class: "title" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644 \u0625\u0644\u064A \u0627\u0644\u0645\u0648\u0642\u0639"), h("button", { type: "button", class: "close", "data-dismiss": "modal", "aria-label": "Close", onClick: this.handleClose }, h("span", { "aria-hidden": "true" }, "\u00D7"))), h("div", { class: "modal-body" }, h("div", { id: "showLoginMethods" }, h("p", { class: "text-sm text-gray-text mb-5" }, "\u0627\u062E\u062A\u0631 \u0627\u0644\u0648\u0633\u064A\u0644\u0629 \u0627\u0644\u0645\u0646\u0627\u0633\u0628\u0629"), h("div", { id: "openEmailLogin", class: "mb-2.5 box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-mail" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))), h("div", { class: "box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" }, h("div", { class: "flex-shrink-0" }, h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" }, h("i", { class: "sicon-phone" }))), h("div", { class: "flex-1 min-w-0" }, h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" }, h("div", { class: "flex-1" }, h("span", { class: "absolute inset-0", "aria-hidden": "true" }), h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"), h("h6", { class: "font-boldf" }, "\u0627\u0644\u0647\u0627\u062A\u0641")), h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))))))));
|
|
26
|
-
}
|
|
27
|
-
static get assetsDirs() { return ["assets"]; }
|
|
28
|
-
};
|
|
29
|
-
SallaLogin.style = sallaLoginCss;
|
|
30
|
-
|
|
31
|
-
const searchModalCss = "";
|
|
1
|
+
import { r as registerInstance, h, e as Host, g as getElement } from './index-d6ed984a.js';
|
|
32
2
|
|
|
33
3
|
const SearchModal = class {
|
|
34
4
|
constructor(hostRef) {
|
|
@@ -118,9 +88,7 @@ const SearchModal = class {
|
|
|
118
88
|
return this.getProduct(item);
|
|
119
89
|
}))))))));
|
|
120
90
|
}
|
|
121
|
-
static get assetsDirs() { return ["assets"]; }
|
|
122
91
|
get hostElement() { return getElement(this); }
|
|
123
92
|
};
|
|
124
|
-
SearchModal.style = searchModalCss;
|
|
125
93
|
|
|
126
|
-
export {
|
|
94
|
+
export { SearchModal as S };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { r as registerInstance, h, e as Host, g as getElement } from './index-0aa9ca9b.js';
|
|
2
|
+
|
|
3
|
+
const SearchModal = class {
|
|
4
|
+
constructor(hostRef) {
|
|
5
|
+
registerInstance(this, hostRef);
|
|
6
|
+
this.fetchStatus = '';
|
|
7
|
+
this.showModal = false;
|
|
8
|
+
/**
|
|
9
|
+
* The text to overwrite search placeholder.
|
|
10
|
+
*/
|
|
11
|
+
this.searchPlaceholder = 'Search here ...';
|
|
12
|
+
/**
|
|
13
|
+
* The text to overwrite no results text.
|
|
14
|
+
*/
|
|
15
|
+
this.noResultsText = 'There are no results at the moment';
|
|
16
|
+
this.handleChange = event => {
|
|
17
|
+
this.searchTerm = event.target.value;
|
|
18
|
+
this.fetchStatus = 'loading';
|
|
19
|
+
this.showResult = false;
|
|
20
|
+
this.results = [];
|
|
21
|
+
if (this.searchTerm.length > 2) {
|
|
22
|
+
window.salla.search.api
|
|
23
|
+
.search(this.searchTerm)
|
|
24
|
+
.then(response => response)
|
|
25
|
+
.then(response => {
|
|
26
|
+
console.log('response', response);
|
|
27
|
+
this.fetchStatus = 'idle';
|
|
28
|
+
this.results = response.results;
|
|
29
|
+
this.showResult = true;
|
|
30
|
+
if (this.results.length < 1) {
|
|
31
|
+
this.fetchStatus = 'error';
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
.catch(err => {
|
|
35
|
+
this.showResult = true;
|
|
36
|
+
this.fetchStatus = 'error';
|
|
37
|
+
console.log(err);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
this.openSearch = () => {
|
|
42
|
+
this.searchTerm = '';
|
|
43
|
+
this.fetchStatus = '';
|
|
44
|
+
this.results = [];
|
|
45
|
+
this.showModal = true;
|
|
46
|
+
window.scrollTo(0, 0);
|
|
47
|
+
document.getElementsByTagName('html')[0].style.position = 'fixed';
|
|
48
|
+
document.getElementsByTagName('html')[0].style.overflowY = 'scroll';
|
|
49
|
+
};
|
|
50
|
+
this.closeSearch = () => {
|
|
51
|
+
this.searchTerm = '';
|
|
52
|
+
this.fetchStatus = '';
|
|
53
|
+
this.results = [];
|
|
54
|
+
document.getElementsByTagName('html')[0].style.position = 'static';
|
|
55
|
+
document.getElementsByTagName('html')[0].style.overflowY = 'auto';
|
|
56
|
+
this.showModal = false;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
componentWillLoad() {
|
|
60
|
+
this.hasSearchIconSlot = !!this.hostElement.querySelector('[slot="search-icon"]');
|
|
61
|
+
this.hasProductTemplateSlot = !!this.hostElement.querySelector('[slot="product-template"]');
|
|
62
|
+
if (this.hasProductTemplateSlot) {
|
|
63
|
+
this.productTemplateHtml = this.hostElement.querySelector('[slot="product-template"]').innerHTML;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
getProduct(item) {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
// todo use art-template https://aui.github.io/art-template/docs/.
|
|
69
|
+
if (this.hasProductTemplateSlot) {
|
|
70
|
+
let product = this.productTemplateHtml
|
|
71
|
+
.replace("{title}", item.title)
|
|
72
|
+
.replace("{price}", (_a = item.price) === null || _a === void 0 ? void 0 : _a.after)
|
|
73
|
+
.replace("{url}", item.url)
|
|
74
|
+
.replace("{thumb}", item.thumb);
|
|
75
|
+
return (h("div", { class: "s-search-modal-product", innerHTML: product }));
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
return (h("div", { class: "s-search-modal-product" }, h("a", { target: "_blank", href: item.url, class: "s-search-modal-product-image-container" }, h("img", { class: "s-search-modal-product-image", src: item.thumb })), h("div", { class: "s-search-modal-product-details" }, h("div", { class: "s-search-modal-product-title" }, item.title), h("div", { class: "s-search-modal-product-price" }, (_b = item.price) === null || _b === void 0 ? void 0 : _b.after))));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
render() {
|
|
82
|
+
return (h(Host, { class: "s-search-modal" }, h("button", { type: "button", onClick: this.openSearch, class: "s-search-modal-search-button-icon" }, this.hasSearchIconSlot ? (h("slot", { name: "search-icon" })) : (h("i", { class: "sicon-search font-bold" }))), this.showModal && (h("div", { class: "s-search-modal-container", style: { backgroundColor: 'rgba(0,0,0,0.5)' } }, h("div", { class: "s-search-modal-wrapper", onClick: this.closeSearch }, h("div", { class: "s-search-modal-inner", onClick: e => {
|
|
83
|
+
e.stopPropagation();
|
|
84
|
+
} }, h("div", { class: "s-search-modal-search-box-container" }, h("div", { class: !this.showResult
|
|
85
|
+
? 's-search-modal-search-box-inner'
|
|
86
|
+
: 's-search-modal-search-box-inner-open' }, h("input", { class: "s-search-modal-input", type: "text", placeholder: this.searchPlaceholder, value: this.searchTerm, onInput: event => this.handleChange(event) }), this.fetchStatus != 'loading' ? (h("button", { class: "s-search-modal-search-icon" }, h("i", { class: "sicon-search" }))) : (h("span", { class: "s-search-modal-spinner" }, h("span", { class: "s-search-modal-spinner-loader" }))))), h("div", { class: "s-search-modal-search-results" }, this.fetchStatus === 'error' && (h("p", { class: "s-search-modal-no-results error p-4 text-sm text-gray-text" }, this.noResultsText)), this.results &&
|
|
87
|
+
this.results.map(item => {
|
|
88
|
+
return this.getProduct(item);
|
|
89
|
+
}))))))));
|
|
90
|
+
}
|
|
91
|
+
get hostElement() { return getElement(this); }
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export { SearchModal as S };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { r as registerInstance, h, e as Host, g as getElement } from './index-d2312a61.js';
|
|
2
|
+
|
|
3
|
+
const SearchModal = class {
|
|
4
|
+
constructor(hostRef) {
|
|
5
|
+
registerInstance(this, hostRef);
|
|
6
|
+
this.fetchStatus = '';
|
|
7
|
+
this.showModal = false;
|
|
8
|
+
/**
|
|
9
|
+
* The text to overwrite search placeholder.
|
|
10
|
+
*/
|
|
11
|
+
this.searchPlaceholder = 'Search here ...';
|
|
12
|
+
/**
|
|
13
|
+
* The text to overwrite no results text.
|
|
14
|
+
*/
|
|
15
|
+
this.noResultsText = 'There are no results at the moment';
|
|
16
|
+
this.handleChange = event => {
|
|
17
|
+
this.searchTerm = event.target.value;
|
|
18
|
+
this.fetchStatus = 'loading';
|
|
19
|
+
this.showResult = false;
|
|
20
|
+
this.results = [];
|
|
21
|
+
if (this.searchTerm.length > 2) {
|
|
22
|
+
window.salla.search.api
|
|
23
|
+
.search(this.searchTerm)
|
|
24
|
+
.then(response => response)
|
|
25
|
+
.then(response => {
|
|
26
|
+
console.log('response', response);
|
|
27
|
+
this.fetchStatus = 'idle';
|
|
28
|
+
this.results = response.results;
|
|
29
|
+
this.showResult = true;
|
|
30
|
+
if (this.results.length < 1) {
|
|
31
|
+
this.fetchStatus = 'error';
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
.catch(err => {
|
|
35
|
+
this.showResult = true;
|
|
36
|
+
this.fetchStatus = 'error';
|
|
37
|
+
console.log(err);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
this.openSearch = () => {
|
|
42
|
+
this.searchTerm = '';
|
|
43
|
+
this.fetchStatus = '';
|
|
44
|
+
this.results = [];
|
|
45
|
+
this.showModal = true;
|
|
46
|
+
window.scrollTo(0, 0);
|
|
47
|
+
document.getElementsByTagName('html')[0].style.position = 'fixed';
|
|
48
|
+
document.getElementsByTagName('html')[0].style.overflowY = 'scroll';
|
|
49
|
+
};
|
|
50
|
+
this.closeSearch = () => {
|
|
51
|
+
this.searchTerm = '';
|
|
52
|
+
this.fetchStatus = '';
|
|
53
|
+
this.results = [];
|
|
54
|
+
document.getElementsByTagName('html')[0].style.position = 'static';
|
|
55
|
+
document.getElementsByTagName('html')[0].style.overflowY = 'auto';
|
|
56
|
+
this.showModal = false;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
componentWillLoad() {
|
|
60
|
+
this.hasSearchIconSlot = !!this.hostElement.querySelector('[slot="search-icon"]');
|
|
61
|
+
this.hasProductTemplateSlot = !!this.hostElement.querySelector('[slot="product-template"]');
|
|
62
|
+
if (this.hasProductTemplateSlot) {
|
|
63
|
+
this.productTemplateHtml = this.hostElement.querySelector('[slot="product-template"]').innerHTML;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
getProduct(item) {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
// todo use art-template https://aui.github.io/art-template/docs/.
|
|
69
|
+
if (this.hasProductTemplateSlot) {
|
|
70
|
+
let product = this.productTemplateHtml
|
|
71
|
+
.replace("{title}", item.title)
|
|
72
|
+
.replace("{price}", (_a = item.price) === null || _a === void 0 ? void 0 : _a.after)
|
|
73
|
+
.replace("{url}", item.url)
|
|
74
|
+
.replace("{thumb}", item.thumb);
|
|
75
|
+
return (h("div", { class: "s-search-modal-product", innerHTML: product }));
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
return (h("div", { class: "s-search-modal-product" }, h("a", { target: "_blank", href: item.url, class: "s-search-modal-product-image-container" }, h("img", { class: "s-search-modal-product-image", src: item.thumb })), h("div", { class: "s-search-modal-product-details" }, h("div", { class: "s-search-modal-product-title" }, item.title), h("div", { class: "s-search-modal-product-price" }, (_b = item.price) === null || _b === void 0 ? void 0 : _b.after))));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
render() {
|
|
82
|
+
return (h(Host, { class: "s-search-modal" }, h("button", { type: "button", onClick: this.openSearch, class: "s-search-modal-search-button-icon" }, this.hasSearchIconSlot ? (h("slot", { name: "search-icon" })) : (h("i", { class: "sicon-search font-bold" }))), this.showModal && (h("div", { class: "s-search-modal-container", style: { backgroundColor: 'rgba(0,0,0,0.5)' } }, h("div", { class: "s-search-modal-wrapper", onClick: this.closeSearch }, h("div", { class: "s-search-modal-inner", onClick: e => {
|
|
83
|
+
e.stopPropagation();
|
|
84
|
+
} }, h("div", { class: "s-search-modal-search-box-container" }, h("div", { class: !this.showResult
|
|
85
|
+
? 's-search-modal-search-box-inner'
|
|
86
|
+
: 's-search-modal-search-box-inner-open' }, h("input", { class: "s-search-modal-input", type: "text", placeholder: this.searchPlaceholder, value: this.searchTerm, onInput: event => this.handleChange(event) }), this.fetchStatus != 'loading' ? (h("button", { class: "s-search-modal-search-icon" }, h("i", { class: "sicon-search" }))) : (h("span", { class: "s-search-modal-spinner" }, h("span", { class: "s-search-modal-spinner-loader" }))))), h("div", { class: "s-search-modal-search-results" }, this.fetchStatus === 'error' && (h("p", { class: "s-search-modal-no-results error p-4 text-sm text-gray-text" }, this.noResultsText)), this.results &&
|
|
87
|
+
this.results.map(item => {
|
|
88
|
+
return this.getProduct(item);
|
|
89
|
+
}))))))));
|
|
90
|
+
}
|
|
91
|
+
get hostElement() { return getElement(this); }
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export { SearchModal as S };
|