@salla.sa/twilight-components 2.11.110 → 2.11.112
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/README.md +48 -42
- package/dist/cjs/{app-globals-c392da62.js → app-globals-38ac4fe8.js} +2 -2
- package/dist/cjs/{app-globals-c392da62.js.map → app-globals-38ac4fe8.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-add-product-button_40.cjs.entry.js +74 -24
- package/dist/cjs/salla-add-product-button_40.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +5 -27
- package/dist/cjs/salla-filters-widget.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +8 -4
- package/dist/cjs/salla-filters.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +109 -37
- package/dist/cjs/salla-price-range.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +85 -59
- package/dist/cjs/salla-products-list.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-products-slider.cjs.entry.js +12 -4
- package/dist/cjs/salla-products-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/collection/components/salla-filters/salla-filters.js +8 -4
- package/dist/collection/components/salla-filters/salla-filters.js.map +1 -1
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +5 -27
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js.map +1 -1
- package/dist/collection/components/salla-login-modal/intefaces.js.map +1 -1
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +1 -1
- package/dist/collection/components/salla-login-modal/salla-login-modal.js.map +1 -1
- package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js +14 -1
- package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js.map +1 -1
- package/dist/collection/components/salla-price-range/salla-price-range.js +152 -148
- package/dist/collection/components/salla-price-range/salla-price-range.js.map +1 -1
- package/dist/collection/components/salla-products-list/salla-products-list.js +85 -59
- package/dist/collection/components/salla-products-list/salla-products-list.js.map +1 -1
- package/dist/collection/components/salla-products-slider/salla-products-slider.js +29 -5
- package/dist/collection/components/salla-products-slider/salla-products-slider.js.map +1 -1
- package/dist/collection/components/salla-verify/salla-verify.css +12 -0
- package/dist/collection/components/salla-verify/salla-verify.js +59 -21
- package/dist/collection/components/salla-verify/salla-verify.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/salla-filters-widget2.js +5 -27
- package/dist/components/salla-filters-widget2.js.map +1 -1
- package/dist/components/salla-filters.js +8 -4
- package/dist/components/salla-filters.js.map +1 -1
- package/dist/components/salla-login-modal.js +1 -1
- package/dist/components/salla-login-modal.js.map +1 -1
- package/dist/components/salla-maintenance-alert.js +14 -1
- package/dist/components/salla-maintenance-alert.js.map +1 -1
- package/dist/components/salla-price-range2.js +113 -43
- package/dist/components/salla-price-range2.js.map +1 -1
- package/dist/components/salla-products-list.js +85 -59
- package/dist/components/salla-products-list.js.map +1 -1
- package/dist/components/salla-products-slider.js +13 -5
- package/dist/components/salla-products-slider.js.map +1 -1
- package/dist/components/salla-verify2.js +60 -22
- package/dist/components/salla-verify2.js.map +1 -1
- package/dist/esm/{app-globals-663240cc.js → app-globals-3a81b4f2.js} +2 -2
- package/dist/esm/{app-globals-663240cc.js.map → app-globals-3a81b4f2.js.map} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/salla-add-product-button_40.entry.js +74 -24
- package/dist/esm/salla-add-product-button_40.entry.js.map +1 -1
- package/dist/esm/salla-filters-widget.entry.js +5 -27
- package/dist/esm/salla-filters-widget.entry.js.map +1 -1
- package/dist/esm/salla-filters.entry.js +8 -4
- package/dist/esm/salla-filters.entry.js.map +1 -1
- package/dist/esm/salla-price-range.entry.js +109 -37
- package/dist/esm/salla-price-range.entry.js.map +1 -1
- package/dist/esm/salla-products-list.entry.js +85 -59
- package/dist/esm/salla-products-list.entry.js.map +1 -1
- package/dist/esm/salla-products-slider.entry.js +12 -4
- package/dist/esm/salla-products-slider.entry.js.map +1 -1
- package/dist/esm/twilight.js +2 -2
- package/dist/esm-es5/{app-globals-663240cc.js → app-globals-3a81b4f2.js} +2 -2
- package/dist/{twilight/p-dcfa0f39.system.js.map → esm-es5/app-globals-3a81b4f2.js.map} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/salla-add-product-button_40.entry.js +4 -4
- package/dist/esm-es5/salla-add-product-button_40.entry.js.map +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js.map +1 -1
- package/dist/esm-es5/salla-filters.entry.js +1 -1
- package/dist/esm-es5/salla-filters.entry.js.map +1 -1
- package/dist/esm-es5/salla-price-range.entry.js +2 -2
- package/dist/esm-es5/salla-price-range.entry.js.map +1 -1
- package/dist/esm-es5/salla-products-list.entry.js +2 -2
- package/dist/esm-es5/salla-products-list.entry.js.map +1 -1
- package/dist/esm-es5/salla-products-slider.entry.js +1 -1
- package/dist/esm-es5/salla-products-slider.entry.js.map +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/esm-es5/twilight.js.map +1 -1
- package/dist/twilight/{p-6948b825.js → p-1edec127.js} +2 -2
- package/dist/twilight/{p-6948b825.js.map → p-1edec127.js.map} +1 -1
- package/dist/twilight/{p-7c6638f5.system.entry.js → p-2739ddc5.system.entry.js} +2 -2
- package/dist/twilight/p-2739ddc5.system.entry.js.map +1 -0
- package/dist/twilight/p-3212e42c.entry.js +5 -0
- package/dist/twilight/p-3212e42c.entry.js.map +1 -0
- package/dist/twilight/{p-6404a9a5.system.js → p-37389934.system.js} +2 -2
- package/dist/twilight/{p-6404a9a5.system.js.map → p-37389934.system.js.map} +1 -1
- package/dist/twilight/{p-dcfa0f39.system.js → p-38496eab.system.js} +2 -2
- package/dist/{esm-es5/app-globals-663240cc.js.map → twilight/p-38496eab.system.js.map} +1 -1
- package/dist/twilight/p-3f03d17c.system.entry.js +5 -0
- package/dist/twilight/p-3f03d17c.system.entry.js.map +1 -0
- package/dist/twilight/p-46b7f931.system.entry.js +5 -0
- package/dist/twilight/p-46b7f931.system.entry.js.map +1 -0
- package/dist/twilight/p-54783694.system.entry.js +5 -0
- package/dist/twilight/p-54783694.system.entry.js.map +1 -0
- package/dist/twilight/{p-1e4abb42.system.entry.js → p-9a1231a6.system.entry.js} +2 -2
- package/dist/twilight/p-9a1231a6.system.entry.js.map +1 -0
- package/dist/twilight/{p-9713044b.entry.js → p-b766115a.entry.js} +2 -2
- package/dist/twilight/p-b766115a.entry.js.map +1 -0
- package/dist/twilight/p-cd5cb2f7.entry.js +5 -0
- package/dist/twilight/p-cd5cb2f7.entry.js.map +1 -0
- package/dist/twilight/p-d7a62fb3.system.entry.js +5 -0
- package/dist/twilight/p-d7a62fb3.system.entry.js.map +1 -0
- package/dist/twilight/p-def222e1.entry.js +5 -0
- package/dist/twilight/p-def222e1.entry.js.map +1 -0
- package/dist/twilight/p-e393f123.entry.js +5 -0
- package/dist/twilight/p-e393f123.entry.js.map +1 -0
- package/dist/twilight/p-e3dc0687.entry.js +5 -0
- package/dist/twilight/p-e3dc0687.entry.js.map +1 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.esm.js.map +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/dist/types/components/salla-filters-widget/salla-filters-widget.d.ts +0 -7
- package/dist/types/components/salla-login-modal/intefaces.d.ts +1 -0
- package/dist/types/components/salla-maintenance-alert/salla-maintenance-alert.d.ts +3 -0
- package/dist/types/components/salla-price-range/salla-price-range.d.ts +16 -10
- package/dist/types/components/salla-products-list/salla-products-list.d.ts +2 -2
- package/dist/types/components/salla-products-slider/salla-products-slider.d.ts +5 -1
- package/dist/types/components/salla-verify/salla-verify.d.ts +6 -1
- package/dist/types/components.d.ts +14 -8
- package/package.json +4 -4
- package/dist/twilight/p-1e4abb42.system.entry.js.map +0 -1
- package/dist/twilight/p-3b1a0059.entry.js +0 -5
- package/dist/twilight/p-3b1a0059.entry.js.map +0 -1
- package/dist/twilight/p-41b3e09d.entry.js +0 -5
- package/dist/twilight/p-41b3e09d.entry.js.map +0 -1
- package/dist/twilight/p-4a743b5e.system.entry.js +0 -5
- package/dist/twilight/p-4a743b5e.system.entry.js.map +0 -1
- package/dist/twilight/p-62c1b309.entry.js +0 -5
- package/dist/twilight/p-62c1b309.entry.js.map +0 -1
- package/dist/twilight/p-6349125a.entry.js +0 -5
- package/dist/twilight/p-6349125a.entry.js.map +0 -1
- package/dist/twilight/p-7c6638f5.system.entry.js.map +0 -1
- package/dist/twilight/p-8ee37cc6.entry.js +0 -5
- package/dist/twilight/p-8ee37cc6.entry.js.map +0 -1
- package/dist/twilight/p-9713044b.entry.js.map +0 -1
- package/dist/twilight/p-9e27da8e.system.entry.js +0 -5
- package/dist/twilight/p-9e27da8e.system.entry.js.map +0 -1
- package/dist/twilight/p-b1f8b436.system.entry.js +0 -5
- package/dist/twilight/p-b1f8b436.system.entry.js.map +0 -1
- package/dist/twilight/p-c9cdaea6.system.entry.js +0 -5
- package/dist/twilight/p-c9cdaea6.system.entry.js.map +0 -1
|
@@ -50,12 +50,8 @@ const SallaFiltersWidget = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
50
50
|
this.widgetContent.style.height = `${this.widgetContent.scrollHeight}px`;
|
|
51
51
|
}
|
|
52
52
|
async reset() {
|
|
53
|
-
var _a, _b;
|
|
54
53
|
if (this.option.type === FilterOptionTypes.RANGE) {
|
|
55
|
-
this.priceRange.
|
|
56
|
-
this.priceRange.maxPrice = (_b = this.option.values) === null || _b === void 0 ? void 0 : _b.max;
|
|
57
|
-
await this.priceRange.maxTrigger();
|
|
58
|
-
await this.priceRange.minTrigger();
|
|
54
|
+
this.priceRange.reset();
|
|
59
55
|
}
|
|
60
56
|
Array.from(this.host.querySelectorAll('input')).forEach(input => input.checked = false);
|
|
61
57
|
}
|
|
@@ -71,27 +67,6 @@ const SallaFiltersWidget = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
71
67
|
this.isOpen = !this.isOpen;
|
|
72
68
|
Helper.toggleElementClassIf(this.widgetContent, 's-filters-widget-opened', 's-filters-widget-closed', () => this.isOpen);
|
|
73
69
|
}
|
|
74
|
-
/**
|
|
75
|
-
* @param {currentTarget: HTMLSallaPriceRangeElement} event
|
|
76
|
-
* @param option
|
|
77
|
-
* @private
|
|
78
|
-
*/
|
|
79
|
-
handlePriceSelection(event, option) {
|
|
80
|
-
this.changed.emit({
|
|
81
|
-
event: event,
|
|
82
|
-
option: option,
|
|
83
|
-
value: {
|
|
84
|
-
max: event.currentTarget.maxPrice,
|
|
85
|
-
min: event.currentTarget.minPrice,
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
renderSliderOption(option) {
|
|
90
|
-
if (option.type !== FilterOptionTypes.RANGE) {
|
|
91
|
-
return '';
|
|
92
|
-
}
|
|
93
|
-
return h("salla-price-range", { onMinPriceSelected: (event) => this.handlePriceSelection(event, option), onMaxPriceSelected: (event) => this.handlePriceSelection(event, option), ref: el => this.priceRange = el, "min-price": option.values.min, "max-price": option.values.max });
|
|
94
|
-
}
|
|
95
70
|
renderFilterOption(option) {
|
|
96
71
|
if (![FilterOptionTypes.VALUES, FilterOptionTypes.MINIMUM, FilterOptionTypes.VARIANTS].includes(option.type)) {
|
|
97
72
|
return '';
|
|
@@ -114,6 +89,7 @@ const SallaFiltersWidget = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
114
89
|
}
|
|
115
90
|
getOptionLabel(option, filterOption) {
|
|
116
91
|
if (option.key == 'rating') {
|
|
92
|
+
//in amazon has stars & up, should we add it, to avoid those people who will come to say I selected 4 why I see 5 sars products
|
|
117
93
|
return h("salla-rating-stars", { size: "small", value: filterOption });
|
|
118
94
|
}
|
|
119
95
|
let label = filterOption.value || 'null';
|
|
@@ -121,7 +97,9 @@ const SallaFiltersWidget = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
121
97
|
return h("span", { class: "s-filters-option-name" }, label);
|
|
122
98
|
}
|
|
123
99
|
render() {
|
|
124
|
-
return (h(Host, { class: "s-filters-widget-container" }, h("h3", { class: "s-filters-widget-title", onClick: () => this.toggleWidget() }, h("span", null, this.widgetTitle), h("span", { class: `s-filters-widget-plusminus ${this.isOpen ? 's-filters-widget-plusminus-active' : ''}` })), h("div", { class: "s-filters-widget-content", ref: (el) => this.widgetContent = el }, h("div", { class: "s-filters-widget-values", ref: (el) => this.widgetValues = el }, h("slot", null), this.
|
|
100
|
+
return (h(Host, { class: "s-filters-widget-container" }, h("h3", { class: "s-filters-widget-title", onClick: () => this.toggleWidget() }, h("span", null, this.widgetTitle), h("span", { class: `s-filters-widget-plusminus ${this.isOpen ? 's-filters-widget-plusminus-active' : ''}` })), h("div", { class: "s-filters-widget-content", ref: (el) => this.widgetContent = el }, h("div", { class: "s-filters-widget-values", ref: (el) => this.widgetValues = el }, h("slot", null), this.option.type !== FilterOptionTypes.RANGE
|
|
101
|
+
? this.renderFilterOption(this.option)
|
|
102
|
+
: h("salla-price-range", { onChanged: (event) => this.changed.emit(event.detail), ref: price => this.priceRange = price, filtersData: this.filtersData, option: this.option })), this.withLoadMore &&
|
|
125
103
|
h("a", { class: "s-filters-widget-more", onClick: () => this.showMore() }, !this.isShowMore ? 'عرض المزيد' : 'عرض أقل'))));
|
|
126
104
|
}
|
|
127
105
|
get host() { return this; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"salla-filters-widget2.js","mappings":";;;;;;;;IAAY;AAAZ,WAAY,iBAAiB;;;;;;EAM3B,sCAAiB,CAAA;EACjB,0CAAqB,CAAA;EACrB,wCAAmB,CAAA;EACnB,oCAAe,CAAA;AACjB,CAAC,EAVW,iBAAiB,KAAjB,iBAAiB,QAU5B;IAEW;AAAZ,WAAY,qBAAqB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CAAC,EAAE,KAAK,IAAI,CAAC,YAAY,GAAG,EAAE,IACtE,eAAO,EACN,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,EACpC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CACjC,EACL,IAAI,CAAC,YAAY;MAClB,SAAG,KAAK,EAAC,uBAAuB,EAC7B,OAAO,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,IAAG,CAAC,IAAI,CAAC,UAAU,GAAG,YAAY,GAAG,SAAS,CAAK,CAEhF,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/salla-filters/interfaces.ts","./src/components/salla-filters-widget/salla-filters-widget.scss?tag=salla-filters-widget","./src/components/salla-filters-widget/salla-filters-widget.tsx"],"sourcesContent":["export enum FilterOptionTypes {\n // CATEGORIES = \"categories\",\n // BRANDs = \"brands\",\n // RATING = \"rating\",\n // PRICE = \"price\",\n // RADIO = \"radio\",\n VALUES = \"values\",\n VARIANTS = \"variants\",\n MINIMUM = \"minimum\",\n RANGE = \"range\",\n}\n\nexport enum FilterOptionInputType {\n CHECKBOX = \"checkbox\",\n RADIO = \"radio\",\n}\n\n\nexport interface Filter {\n label: string,\n key: \"categories\" | string,//todo:: add possible values\n inputType: FilterOptionInputType,\n type: FilterOptionTypes,\n values: Array<{ count: string, value: string }> | { min: number, max: number }\n}\n",":host {\n display: block;\n}\n","import {Component, Host, h, Method, State, Prop, Event, Element} from '@stencil/core';\nimport Helper from '../../Helpers/Helper';\nimport {Filter, FilterOptionInputType, FilterOptionTypes} from \"../salla-filters/interfaces\";\n\n@Component({\n tag: 'salla-filters-widget',\n styleUrl: 'salla-filters-widget.scss',\n})\nexport class SallaFiltersWidget {\n @Element() host: HTMLElement;\n @Prop({mutable: true}) widgetTitle: string;\n @Prop({mutable: true}) withLoadMore: boolean;\n @Prop({reflect: true}) filtersData: object;\n @Prop({reflect: true}) option: Filter;\n priceRange: HTMLSallaPriceRangeElement\n\n\n private widgetValues: HTMLElement;\n private widgetContent: HTMLDivElement;\n private initHeight: number = 195;\n @State() isOpen: boolean = true;\n @State() isShowMore: boolean = false;\n\n @Event() changed: any;\n\n connectedCallback() {\n //lets be smart and don't show 5 and more link for 8 options\n this.withLoadMore = Array.isArray(this.option.values) && this.option.values.length > 8;\n this.widgetTitle = this.option.label;\n }\n\n componentDidLoad() {\n this.widgetValues.scrollHeight < this.initHeight && (this.withLoadMore = false);\n (this.withLoadMore && this.widgetValues) && (this.widgetValues.style.maxHeight = `${this.initHeight}px`);\n this.widgetContent.style.height = `${this.widgetContent.scrollHeight}px`;\n }\n\n @Method()\n async reset() {\n if (this.option.type === FilterOptionTypes.RANGE) {\n this.priceRange.minPrice = (this.option.values as any)?.min;\n this.priceRange.maxPrice = (this.option.values as any)?.max;\n await this.priceRange.maxTrigger();\n await this.priceRange.minTrigger();\n }\n Array.from(this.host.querySelectorAll('input')).forEach(input => input.checked = false);\n }\n\n @Method()\n async showMore() {\n this.isShowMore = !this.isShowMore\n this.widgetContent.style.height = 'auto';\n this.widgetValues.style.maxHeight = this.isShowMore ? `${this.widgetValues.scrollHeight}px` : `${this.initHeight}px`;\n setTimeout(() => {\n this.widgetContent.style.height = `${this.widgetContent.scrollHeight}px`;\n }, 400); // get height after time of collapse animtion (duration-300)\n }\n\n @Method()\n async toggleWidget() {\n this.isOpen = !this.isOpen;\n Helper.toggleElementClassIf(this.widgetContent, 's-filters-widget-opened', 's-filters-widget-closed', () => this.isOpen);\n }\n\n /**\n * @param {currentTarget: HTMLSallaPriceRangeElement} event\n * @param option\n * @private\n */\n private handlePriceSelection(event, option: Filter) {\n this.changed.emit({\n event: event,\n option: option,\n value: {\n max: event.currentTarget.maxPrice,\n min: event.currentTarget.minPrice,\n }\n })\n }\n\n renderSliderOption(option) {\n if (option.type !== FilterOptionTypes.RANGE) {\n return '';\n }\n return <salla-price-range\n onMinPriceSelected={(event) => this.handlePriceSelection(event, option)}\n onMaxPriceSelected={(event) => this.handlePriceSelection(event, option)}\n ref={el => this.priceRange = el}\n min-price={option.values.min}\n max-price={option.values.max}/>;\n }\n\n renderFilterOption(option: Filter) {\n if (![FilterOptionTypes.VALUES, FilterOptionTypes.MINIMUM, FilterOptionTypes.VARIANTS].includes(option.type)) {\n return '';\n }\n //@ts-ignore\n return option.values.map((filterOption, index) => {\n let value = typeof filterOption == 'number' ? filterOption : (filterOption.key || filterOption.value);\n\n return <label class=\"s-filters-label\" htmlFor={`${option.key}-option-${index}`}>\n <input\n id={`${option.key}-option-${index}`}\n name={option.key}\n type={option.inputType}\n //TODO:: debug more why sometimes it's not rendered as selected🤨\n checked={this.isSelectedOption(option, value)}\n class={`s-filters-${option.inputType}`}\n onChange={e => this.changed.emit({event: e, option: option, value: value})}\n />\n {this.getOptionLabel(option, filterOption)}\n </label>\n }\n )\n }\n\n private isSelectedOption(option: Filter, value) {\n if (!this.filtersData || !this.filtersData[option.key]) {\n return false\n }\n\n return option.inputType === FilterOptionInputType.CHECKBOX\n ? this.filtersData[option.key].includes(value)\n : this.filtersData[option.key] == value;\n }\n\n private getOptionLabel(option: Filter, filterOption) {\n if (option.key == 'rating') {\n return <salla-rating-stars size=\"small\" value={filterOption}/>;\n }\n let label = filterOption.value || 'null';\n //label+=filterOption.count ? ` (${salla.helpers.number(filterOption.count)})` : '';\n return <span class=\"s-filters-option-name\">{label}</span>;\n }\n\n render() {\n return (\n <Host class=\"s-filters-widget-container\">\n <h3 class=\"s-filters-widget-title\" onClick={() => this.toggleWidget()}>\n <span>{this.widgetTitle}</span>\n <span class={`s-filters-widget-plusminus ${this.isOpen ? 's-filters-widget-plusminus-active' : ''}`}/>\n </h3>\n <div class=\"s-filters-widget-content\" ref={(el) => this.widgetContent = el}>\n <div class=\"s-filters-widget-values\" ref={(el) => this.widgetValues = el}>\n <slot/>\n {this.renderFilterOption(this.option)}\n {this.renderSliderOption(this.option)}\n </div>\n {this.withLoadMore &&\n <a class=\"s-filters-widget-more\"\n onClick={() => this.showMore()}>{!this.isShowMore ? 'عرض المزيد' : 'عرض أقل'}</a>\n }\n </div>\n </Host>\n );\n }\n\n}\n"],"version":3}
|
|
1
|
+
{"file":"salla-filters-widget2.js","mappings":";;;;;;;;IAAY;AAAZ,WAAY,iBAAiB;;;;;;EAM3B,sCAAiB,CAAA;EACjB,0CAAqB,CAAA;EACrB,wCAAmB,CAAA;EACnB,oCAAe,CAAA;AACjB,CAAC,EAVW,iBAAiB,KAAjB,iBAAiB,QAU5B;IAEW;AAAZ,WAAY,qBAAqB;EAC/B,8CAAqB,CAAA;EACrB,wCAAe,CAAA;AACjB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB;;ACZjC,MAAM,qBAAqB,GAAG,sBAAsB;;MCQvC,kBAAkB;;;;;IAWrB,eAAU,GAAW,GAAG,CAAC;;;;;kBACN,IAAI;sBACA,KAAK;;EAIpC,iBAAiB;;IAEf,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IACvF,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;GACtC;EAED,gBAAgB;IACd,IAAI,CAAC,YAAY,CAAC,YAAY,GAAG,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC;IAChF,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC;IACzG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,YAAY,IAAI,CAAC;GAC1E;EAGD,MAAM,KAAK;IACT,IAAI,IAAI,CAAC,MA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;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/salla-filters/interfaces.ts","./src/components/salla-filters-widget/salla-filters-widget.scss?tag=salla-filters-widget","./src/components/salla-filters-widget/salla-filters-widget.tsx"],"sourcesContent":["export enum FilterOptionTypes {\n // CATEGORIES = \"categories\",\n // BRANDs = \"brands\",\n // RATING = \"rating\",\n // PRICE = \"price\",\n // RADIO = \"radio\",\n VALUES = \"values\",\n VARIANTS = \"variants\",\n MINIMUM = \"minimum\",\n RANGE = \"range\",\n}\n\nexport enum FilterOptionInputType {\n CHECKBOX = \"checkbox\",\n RADIO = \"radio\",\n}\n\n\nexport interface Filter {\n label: string,\n key: \"categories\" | string,//todo:: add possible values\n inputType: FilterOptionInputType,\n type: FilterOptionTypes,\n values: Array<{ count: string, value: string }> | { min: number, max: number }\n}\n",":host {\n display: block;\n}\n","import {Component, Host, h, Method, State, Prop, Event, Element} from '@stencil/core';\nimport Helper from '../../Helpers/Helper';\nimport {Filter, FilterOptionInputType, FilterOptionTypes} from \"../salla-filters/interfaces\";\n\n@Component({\n tag: 'salla-filters-widget',\n styleUrl: 'salla-filters-widget.scss',\n})\nexport class SallaFiltersWidget {\n @Element() host: HTMLElement;\n @Prop({mutable: true}) widgetTitle: string;\n @Prop({mutable: true}) withLoadMore: boolean;\n @Prop({reflect: true}) filtersData: object;\n @Prop({reflect: true}) option: Filter;\n priceRange: HTMLSallaPriceRangeElement\n\n\n private widgetValues: HTMLElement;\n private widgetContent: HTMLDivElement;\n private initHeight: number = 195;\n @State() isOpen: boolean = true;\n @State() isShowMore: boolean = false;\n\n @Event() changed: any;\n\n connectedCallback() {\n //lets be smart and don't show 5 and more link for 8 options\n this.withLoadMore = Array.isArray(this.option.values) && this.option.values.length > 8;\n this.widgetTitle = this.option.label;\n }\n\n componentDidLoad() {\n this.widgetValues.scrollHeight < this.initHeight && (this.withLoadMore = false);\n (this.withLoadMore && this.widgetValues) && (this.widgetValues.style.maxHeight = `${this.initHeight}px`);\n this.widgetContent.style.height = `${this.widgetContent.scrollHeight}px`;\n }\n\n @Method()\n async reset() {\n if (this.option.type === FilterOptionTypes.RANGE) {\n this.priceRange.reset()\n }\n Array.from(this.host.querySelectorAll('input')).forEach(input => input.checked = false);\n }\n\n\n @Method()\n async showMore() {\n this.isShowMore = !this.isShowMore\n this.widgetContent.style.height = 'auto';\n this.widgetValues.style.maxHeight = this.isShowMore ? `${this.widgetValues.scrollHeight}px` : `${this.initHeight}px`;\n setTimeout(() => {\n this.widgetContent.style.height = `${this.widgetContent.scrollHeight}px`;\n }, 400); // get height after time of collapse animtion (duration-300)\n }\n\n @Method()\n async toggleWidget() {\n this.isOpen = !this.isOpen;\n Helper.toggleElementClassIf(this.widgetContent, 's-filters-widget-opened', 's-filters-widget-closed', () => this.isOpen);\n }\n\n renderFilterOption(option: Filter) {\n if (![FilterOptionTypes.VALUES, FilterOptionTypes.MINIMUM, FilterOptionTypes.VARIANTS].includes(option.type)) {\n return '';\n }\n //@ts-ignore\n return option.values.map((filterOption, index) => {\n let value = typeof filterOption == 'number' ? filterOption : (filterOption.key || filterOption.value);\n\n return <label class=\"s-filters-label\" htmlFor={`${option.key}-option-${index}`}>\n <input\n id={`${option.key}-option-${index}`}\n name={option.key}\n type={option.inputType}\n //TODO:: debug more why sometimes it's not rendered as selected🤨\n checked={this.isSelectedOption(option, value)}\n class={`s-filters-${option.inputType}`}\n onChange={e => this.changed.emit({event: e, option: option, value: value})}\n />\n {this.getOptionLabel(option, filterOption)}\n </label>\n }\n )\n }\n\n private isSelectedOption(option: Filter, value) {\n if (!this.filtersData || !this.filtersData[option.key]) {\n return false\n }\n\n return option.inputType === FilterOptionInputType.CHECKBOX\n ? this.filtersData[option.key].includes(value)\n : this.filtersData[option.key] == value;\n }\n\n private getOptionLabel(option: Filter, filterOption) {\n if (option.key == 'rating') {\n //in amazon has stars & up, should we add it, to avoid those people who will come to say I selected 4 why I see 5 sars products\n return <salla-rating-stars size=\"small\" value={filterOption}/>;\n }\n let label = filterOption.value || 'null';\n //label+=filterOption.count ? ` (${salla.helpers.number(filterOption.count)})` : '';\n return <span class=\"s-filters-option-name\">{label}</span>;\n }\n\n render() {\n return (\n <Host class=\"s-filters-widget-container\">\n <h3 class=\"s-filters-widget-title\" onClick={() => this.toggleWidget()}>\n <span>{this.widgetTitle}</span>\n <span class={`s-filters-widget-plusminus ${this.isOpen ? 's-filters-widget-plusminus-active' : ''}`}/>\n </h3>\n <div class=\"s-filters-widget-content\" ref={(el) => this.widgetContent = el}>\n <div class=\"s-filters-widget-values\" ref={(el) => this.widgetValues = el}>\n <slot/>\n {\n this.option.type !== FilterOptionTypes.RANGE\n ? this.renderFilterOption(this.option)\n : <salla-price-range onChanged={(event) => this.changed.emit(event.detail)}\n ref={price => this.priceRange = price}\n filtersData={this.filtersData}\n option={this.option}/>\n }\n </div>\n {this.withLoadMore &&\n <a class=\"s-filters-widget-more\"\n onClick={() => this.showMore()}>{!this.isShowMore ? 'عرض المزيد' : 'عرض أقل'}</a>\n }\n </div>\n </Host>\n );\n }\n\n}\n"],"version":3}
|
|
@@ -42,7 +42,7 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
42
42
|
//@ts-ignore
|
|
43
43
|
let { max, min } = filter.values;
|
|
44
44
|
//@ts-ignore
|
|
45
|
-
filter.values = [
|
|
45
|
+
filter.values = [5, 4, 3, 2, 1].filter(stars => stars >= min || stars <= max);
|
|
46
46
|
}
|
|
47
47
|
//when getting new filters, maybe less than we had, so let's get from the old one, only what is existed now.
|
|
48
48
|
if (this.filtersData[filter.key]) {
|
|
@@ -70,9 +70,13 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
70
70
|
if (!this.isReady) {
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
//todo:: why we need this🤔
|
|
74
|
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
window.history.pushState({}, '', salla.url.addParamToUrl('filters', encodeURIComponent(JSON.stringify(this.filtersData))));
|
|
77
|
+
salla.event.emit('salla-filters::changed', this.filtersData);
|
|
78
|
+
this.changed.emit(this.filtersData);
|
|
79
|
+
}, 300);
|
|
76
80
|
}
|
|
77
81
|
async resetFilters() {
|
|
78
82
|
this.filtersData = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"salla-filters.js","mappings":";;;;;;;;;AAAA,MAAM,eAAe,GAAG,+GAA+G;;MCU1HA,cAAY;EAEvB;;;;IAkDQ,YAAO,GAAG,KAAK,CAAC;;;uBAEO,EAAE;;;IAnD/B,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;IAE1E,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;MAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;MACpD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;KAC/D,CAAC,CAAC;IAEH,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,kBAAkB,EAAE,CAAC,
|
|
1
|
+
{"file":"salla-filters.js","mappings":";;;;;;;;;AAAA,MAAM,eAAe,GAAG,+GAA+G;;MCU1HA,cAAY;EAEvB;;;;IAkDQ,YAAO,GAAG,KAAK,CAAC;;;uBAEO,EAAE;;;IAnD/B,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;IAE1E,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;MAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,I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WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,KAAK,CAAC,CAAC;GACzF;EAED,MAAM;;IACJ,OAAO,EAAC,IAAI,QACT,MAAA,IAAI,CAAC,OAAO;SAAE,GAAG,CAAC,MAAM,IAAI,4BAC3B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAI,CAAC,EAExG,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,KAAI,WAAK,KAAK,EAAC,kBAAkB,IACpD,oBAAc,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,IAAG,IAAI,CAAC,KAAK,CAAgB,EAC7F,oBAAc,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,IAAG,IAAI,CAAC,KAAK,CAAgB,CACrG,CACD,CAAC;GACT;EAED,gBAAgB;IACd,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;GACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SallaFilters"],"sources":["./src/components/salla-filters/salla-filters.scss?tag=salla-filters","./src/components/salla-filters/salla-filters.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.s-rating-stars-small {\n line-height: 12px;\n}\n.s-filters-radio{\n background-image: none !important;\n}","import { Component, Element, h, Event, EventEmitter, Host, Method, Prop, State } from '@stencil/core';\nimport { Filter, FilterOptionInputType, FilterOptionTypes } from \"./interfaces\";\n\n//todo::\n\n\n@Component({\n tag: 'salla-filters',\n styleUrl: 'salla-filters.scss',\n})\nexport class SallaFilters {\n\n constructor() {\n salla.event.on('filters::hidden', () => this.host.style.display = 'none');\n\n salla.lang.onLoaded(() => {\n this.apply = salla.lang.get('pages.checkout.apply');\n this.reset = salla.lang.get('pages.categories.filters_reset');\n });\n\n salla.event.on('filters::fetched', ({ filters }) => {\n this.host.style.display = '';\n let freshFilterData = {};\n this.filters = filters\n .map((filter: Filter) => {\n filter.label = {\n category_id: salla.lang.get('common.titles.categories'),\n brand_id: salla.lang.get('common.titles.brands'),\n rating: salla.lang.get('pages.categories.filter_rating'),\n price_range: salla.lang.get('pages.categories.filter_price'),\n }[filter.key] || filter.label;\n filter.inputType = FilterOptionInputType.CHECKBOX;\n if (filter.key == 'rating') {\n filter.inputType = FilterOptionInputType.RADIO;\n //@ts-ignore\n let { max, min } = filter.values;\n //@ts-ignore\n filter.values = [5, 4, 3, 2, 1].filter(stars => stars >= min || stars <= max)\n }\n\n //when getting new filters, maybe less than we had, so let's get from the old one, only what is existed now.\n if (this.filtersData[filter.key]) {\n freshFilterData[filter.key] = this.filtersData[filter.key];\n }\n\n return filter;\n });\n this.filtersData = freshFilterData;\n });\n }\n\n connectedCallback() {\n try {\n let filters = (new URLSearchParams(window.location.search)).get('filters')\n this.filtersData = filters ? JSON.parse(decodeURIComponent(filters)) : {};\n } catch (e) {\n salla.logger.warn('failed to get filters from url', e.message);\n }\n }\n\n @Element() host: HTMLElement;\n @Prop({ reflect: true, mutable: true }) filters?: Filter[];\n private isReady = false;//to avoid triggering the changed event\n @State() isSidebarOpen: boolean;\n @State() filtersData: object = {}\n @State() apply: string;\n @State() reset: string;\n @Event() changed: EventEmitter;\n\n //TODO:: move all @methods into one section\n @Method()\n async getFilters() {\n return this.filtersData;\n }\n\n @Method()\n async applyFilters() {\n if (!this.isReady) {\n return;\n }\n //todo:: why we need this🤔\n window.scrollTo({top: 0,behavior: 'smooth'});\n setTimeout(() => {\n window.history.pushState({}, '', salla.url.addParamToUrl('filters', encodeURIComponent(JSON.stringify(this.filtersData))));\n salla.event.emit('salla-filters::changed', this.filtersData);\n this.changed.emit(this.filtersData);\n }, 300);\n }\n\n @Method()\n async resetFilters() {\n this.filtersData = {};\n this.host.childNodes.forEach((widget: HTMLSallaFiltersWidgetElement) => widget.reset && widget.reset())\n salla.event.emit('salla-filters::reset');\n return this.applyFilters();\n }\n\n /**\n * @param {{target:HTMLInputElement}} event\n * @param option\n * @param value\n * @private\n */\n private handleOptionChange(event, option: Filter, value) {\n if (option.type === FilterOptionTypes.RANGE) {\n this.filtersData[option.key] = value;\n return;\n }\n let isChecked = event.target.checked;\n if (event.target.type == FilterOptionInputType.RADIO) {\n isChecked && (this.filtersData[option.key] = value);\n isChecked || (delete this.filtersData[option.key]);\n return;\n }\n\n //it's checkbox\n this.filtersData[option.key] = this.filtersData[option.key] || [];\n if (isChecked) {\n this.filtersData[option.key].push(value);\n return;\n }\n this.filtersData[option.key] = this.filtersData[option.key].filter(val => val != value);\n }\n\n render() {\n return <Host>\n {this.filters?.map(option => <salla-filters-widget\n option={option}\n filtersData={this.filtersData}\n onChanged={({ detail: { event, option, value } }) => this.handleOptionChange(event, option, value)} />)}\n\n {this.filters?.length && <div class=\"s-filters-footer\">\n <salla-button color='primary' onClick={() => this.applyFilters()}>{this.apply}</salla-button>\n <salla-button color='gray' fill='outline' onClick={() => this.resetFilters()}>{this.reset}</salla-button>\n </div>}\n </Host>;\n }\n\n componentDidLoad() {\n this.isReady = true;\n }\n}\n\n"],"version":3}
|
|
@@ -282,7 +282,7 @@ const SallaLoginModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
282
282
|
? h("salla-file-upload", { name: "image", "instant-upload": true, id: `${field.id}`, title: field.label, required: field.required, url: salla.url.get('upload-image'),
|
|
283
283
|
// onUploaded={}
|
|
284
284
|
labelIdle: this.getFilepondPlaceholder() })
|
|
285
|
-
: h("input", {
|
|
285
|
+
: h("input", { onInput: el => field.type == CustomFieldType.NUMBER ? salla.helpers.inputDigitsOnly(el.target) : {}, onKeyDown: e => this.typing(e, this.newUser), class: "s-login-modal-input s-ltr", maxlength: field.length || 1000, placeholder: field.description, required: field.required, title: field.label, id: `${field.id}`, type: "text" }),
|
|
286
286
|
h("span", { class: "s-login-modal-error-message" })
|
|
287
287
|
])), h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.newUser(), ref: b => this.regBtn = b }, salla.lang.get('blocks.header.register')), h("slot", { name: "after-registration" })))));
|
|
288
288
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"salla-login-modal.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAY,eAIX;AAJD,WAAY,eAAe;EACvB,gCAAa,CAAA;EACb,oCAAiB,CAAA;EACjB,kCAAe,CAAA;AACnB,CAAC,EAJW,eAAe,KAAf,eAAe;;ACR3B,MAAM,kBAAkB,GAAG,EAAE;;MC2BhBA,iBAAe;EAC1B;;;IA2EQ,uBAAkB,GAAW,EAAE,CAAC;IAgGhC,WAAM,GAAG,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI;MACtC,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC;MAC1C,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;MACzC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,CAAC,QAAQ,CAAC,6BAA6B,CAAC,MAAK,KAAK,CAAC,SAAS,GAAG,EAAE,CAAC,CAAC;;MAEnF,YAAY,IAAI,CAAC,CAAC,GAAG,IAAI,OAAO,IAAI,YAAY,EAAE,CAAC;KACpD,CAAA;IAEO,eAAU,GAAG,OAAO,KAAK,GAAG,IAAI;MACtC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,cAAc,EAAE,CAAC;MACxB,MAAM,EAAC,KAAK,EAAE,WAAW,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;MAClE,M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AAG,CAAC,cAAc,CAAC;;UAElC,SAAS,EAAE,IAAI,CAAC,sBAAsB,EAAE,GAAG;UAC3C,aACA,IAAI,EAAC,MAAM,EACX,SAAS,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAC5C,OAAO,EAAE,EAAE,IAAI,KAAK,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,EACnG,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,EAAE,EAAE,GAAG,KAAK,CAAC,EAAE,EAAE,EACjB,KAAK,EAAC,2BAA2B,GAAE;MACvC,YAAM,KAAK,EAAC,6BAA6B,GAAE;KAC5C,CAAC,CACG,EAEP,uCAA8B,QAAQ,EAAC,KAAK,EAAC,MAAM,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,EACnE,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAgB,EAClG,YAAM,IAAI,EAAC,oBAAoB,GAAE,CAC7B,CACF,CACM,EACd;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SallaLoginModal","EmailIcon"],"sources":["./src/components/salla-login-modal/intefaces.ts","./src/components/salla-login-modal/salla-login-modal.scss?tag=salla-login-modal","./src/components/salla-login-modal/salla-login-modal.tsx"],"sourcesContent":["export interface CustomField {\n id: number;\n label: string;\n description: string;\n type: string;\n required: boolean;\n}\n\nexport enum CustomFieldType {\n TEXT = 'text',\n NUMBER = 'number',\n PHOTO = 'photo'\n}","/*\n* Salla Login Component: login popup modal\n* You can use these classes to target the elements in the component.\n*/\n\n.s-login-modal {\n &-sub-title {\n\n }\n &-main-btn {\n \n }\n &-main-btn-icon {\n\n }\n &-main-btn-text {\n\n }\n &-main-btn-arrow {\n\n }\n &-label {\n\n }\n &-input {\n\n }\n &-otp-input {\n\n }\n &-link {\n\n }\n &-error-message {\n\n }\n &-wrapper {\n\n }\n &-tab {\n\n }\n &-active {\n\n }\n &-unactive {\n\n }\n}\n","import {Component, Element, h, Listen, Method, Prop, State} from '@stencil/core';\nimport UserIcon from \"../../assets/svg/user.svg\";\nimport PhoneIcon from \"../../assets/svg/phone.svg\";\nimport EmailIcon from \"../../assets/svg/mail.svg\";\nimport CameraIcon from '../../assets/svg/camera.svg';\nimport KeyboardArrowRightIcon from \"../../assets/svg/keyboard_arrow_right.svg\";\nimport ArrowRightIcon from \"../../assets/svg/arrow-right.svg\";\nimport Helper from '../../Helpers/Helper';\nimport {CustomField, CustomFieldType} from './intefaces';\n\n/**\n * @slot footer - The footer of modal\n * @slot before-login-type - placeholder position\n * @slot after-login-type - placeholder position\n * @slot before-login-mobile - placeholder position\n * @slot after-login-mobile - placeholder position\n * @slot before-login-email - placeholder position\n * @slot after-login-email - placeholder position\n * @slot before-registration - placeholder position\n * @slot after-registration - placeholder position\n */\n@Component({\n tag: 'salla-login-modal',\n styleUrl: 'salla-login-modal.scss'\n})\n\n\nexport class SallaLoginModal {\n constructor() {\n\n this.title = this.host.title || salla.lang.get('blocks.header.login');\n this.host.removeAttribute('title');\n\n this.emailErrorMsg = salla.lang.get('common.elements.email_is_valid');\n this.firstNameErrorMsg = salla.lang.get('common.errors.field_required', {attribute: salla.lang.get('pages.profile.first_name')});\n this.lastNameErrorMsg = salla.lang.get('common.errors.field_required', {attribute: salla.lang.get('pages.profile.last_name')});\n\n salla.lang.onLoaded(() => {\n this.translationLoaded = true;\n this.title = salla.lang.get('blocks.header.login');\n this.dragAndDrop = salla.lang.get('common.uploader.drag_and_drop');\n this.browseFromFiles = salla.lang.get('common.uploader.browse');\n this.updateTranslations();\n });\n\n salla.event.on('login::open', (event) => this.open(event));\n salla.onReady( () => {\n this.isEmailAllowed = salla.config.get('store.settings.auth.email_allowed', this.isEmailAllowed);\n this.isMobileAllowed = salla.config.get('store.settings.auth.mobile_allowed', this.isMobileAllowed);\n this.isEmailRequired = salla.config.get('store.settings.auth.is_email_required', this.isEmailRequired);\n });\n }\n\n @Element() host: HTMLElement;\n /**\n * Does the merchant allow to login using email\n */\n @Prop({mutable: true}) isEmailAllowed: boolean ;\n /**\n * Does the merchant/current location for visitor allow to login using mobile, By default outside KSA is `false`\n */\n @Prop({mutable: true}) isMobileAllowed: boolean = true;\n /**\n * Does the merchant require registration with email & mobile\n */\n @Prop({mutable: true}) isEmailRequired: boolean = false;\n\n /**\n * Once the api verify success, it will be login the customer in web pages\n */\n @Prop({reflect: true}) supportWebAuth: boolean = true;\n\n private modal: HTMLSallaModalElement;\n private homeTab: HTMLDivElement;\n private mobileTab: HTMLDivElement;\n private emailTab: HTMLDivElement;\n private verifyTab: HTMLSallaVerifyElement;\n private registrationTab: HTMLDivElement;\n private regTelInput: HTMLSallaTelInputElement;\n private regEmail: HTMLInputElement;\n private customFieldsWrapper: HTMLDivElement;\n private loginTelInput: HTMLSallaTelInputElement;\n private loginEmail: HTMLInputElement;\n private firstName: HTMLInputElement;\n private lastName: HTMLInputElement;\n private smsBtn: HTMLSallaButtonElement;\n private emailBtn: HTMLSallaButtonElement;\n private regBtn: HTMLSallaButtonElement;\n\n @State() currentTabName = 'home'\n @State() regType: 'phone' | 'email' = 'phone';\n\n\n @State() translationLoaded: boolean = false;\n @State() title: string;\n @State() emailErrorMsg: string;\n @State() firstNameErrorMsg: string;\n @State() lastNameErrorMsg: string;\n\n @State() dragAndDrop: string = salla.lang.get('common.uploader.drag_and_drop');\n @State() browseFromFiles: string = salla.lang.get('common.uploader.browse');\n @State() customFields: CustomField[] = [];\n\n private customFieldsValues: Object = {};\n @State() uploadedImage: string = undefined;\n\n @Listen('verified', {target: 'window'})\n /**\n * @param {CustomEvent|{details:{case:'new_customer'|'authenticated', redirect_url:string|null}}} event\n */\n onVerified(event) {\n salla.log('verified', event);\n //there is a case when force login is activated & is new user, it will return case inside error key., so cover it.\n let verifyCase = event.detail?.data.case || event.detail?.error.case;\n if (!verifyCase) {\n salla.log('verified but without case!');\n return;\n }\n\n if (verifyCase === \"new_customer\") {\n this.customFields = event.detail?.data?.custom_fields || [];\n return this.showTab(this.registrationTab);\n }\n\n if (!salla.auth.canRedirect()) {\n salla.log('Will not auto redirect or reload, due to `salla.auth.canRedirect()`');\n this.modal.close();\n return;\n }\n\n if (event.detail.data.redirect_url) {\n return window.location.href = event.detail.data.redirect_url;\n }\n\n /**\n * we don't want to reload the page if this is not web auth\n * because we'll need the token in the page itself and its there\n * todo :: store the user data in storage for non-web auth and set the config.user from it\n */\n if (this.supportWebAuth) {\n window.location.reload();\n } else {\n this.modal.close();\n }\n }\n\n updateTranslations() {\n this.emailErrorMsg = salla.lang.get('common.elements.email_is_valid');\n this.firstNameErrorMsg = salla.lang.get('common.errors.field_required', {attribute: salla.lang.get('pages.profile.first_name')});\n this.lastNameErrorMsg = salla.lang.get('common.errors.field_required', {attribute: salla.lang.get('pages.profile.last_name')});\n this.modal?.setTitle(this.title);\n }\n\n /**\n * Open login component\n */\n @Method()\n // @ts-ignore\n async open(event = null) {\n // todo :: support change the settings from event details\n // if(event && event.hasOwnProperty('isEmailAllowed')){\n // this.isEmailAllowed = event?.isEmailAllowed;\n // }\n //\n // if(event && event.hasOwnProperty('isMobileAllowed')){\n // this.isMobileAllowed = event?.isMobileAllowed;\n // }\n\n if (this.isEmailAllowed && this.isMobileAllowed) {\n this.showTab(this.homeTab);\n } else if (this.isEmailAllowed) {\n this.showTab(this.emailTab);\n } else if (this.isMobileAllowed) {\n this.showTab(this.mobileTab);\n }\n return this.modal.open();\n }\n\n private showTab(tab, evt?) {\n evt?.preventDefault();\n this.currentTabName = tab.getAttribute('data-name');\n\n // todo:: use better way for resize the modal\n // setTimeout(() => this.modal.querySelector('.s-login-modal-wrapper')?.setAttribute('style', 'height:' + tab?.scrollHeight + 'px'));\n\n if ([this.mobileTab, this.emailTab].includes(tab)) {\n this.regType = tab === this.mobileTab ? 'phone' : 'email';\n }\n\n const input = tab.querySelector('input[type=\"tel\"], input[type=\"email\"]');\n input && setTimeout(() => {\n input.focus();\n }, 100); \n\n this.modal?.setTitle(this.currentTabName === 'registration' ? salla.lang.get('common.titles.registration') : this.title);\n\n return this;\n }\n\n private typing = (e, submitMethod = null) => {\n const error = e.target.nextElementSibling;\n e.target.classList.remove('s-has-error');\n error?.classList.contains('s-login-modal-error-message') && (error.innerText = '');\n //it was sending two requests for send two verification requests\n submitMethod && e.key == 'Enter' && submitMethod();\n }\n\n private loginBySMS = async (event = null) => {\n event?.preventDefault();\n const {phone, countryCode} = await this.loginTelInput.getValues();\n const isPhoneValid = await this.loginTelInput.isValid();\n if (!isPhoneValid) {\n return;\n }\n\n this.login(this.smsBtn, {type: 'mobile', phone: phone, country_code: countryCode});\n\n return false;\n }\n\n private loginByEmail = (event = null) => {\n event?.preventDefault();\n if (!Helper.isValidEmail(this.loginEmail.value)) {\n this.validateField(this.loginEmail, this.emailErrorMsg);\n return;\n }\n\n this.login(this.emailBtn, {type: 'email', email: this.loginEmail.value});\n }\n\n private login(btn: HTMLSallaButtonElement, data) {\n btn.load()\n .then(() => btn.disable())\n .then(() => salla.auth.api.login(data))\n .then(() => this.showTab(this.verifyTab))\n .then(() => this.verifyTab.open(data))\n .finally(() => btn.stop() && btn.enable());\n }\n\n private newUser = async () => {\n const {\n phone: regPhone,\n countryCode\n } = this.regType == \"email\" ? await this.regTelInput.getValues() : await this.loginTelInput.getValues(),\n emailValue = this.regEmail.value || this.loginEmail?.value\n await this.newUserValidation();\n await this.regBtn.load();\n await this.regBtn.disable();\n\n let data: any = {\n first_name: this.firstName.value,\n last_name: this.lastName.value,\n phone: regPhone || this.loginTelInput.phone,\n country_code: countryCode,\n verified_by: this.regType,\n custom_fields: this.customFieldsValues,\n };\n emailValue && (data = {...data, email: emailValue});\n this.verifyTab.getCode()\n .then(code => salla.auth.api.register({...data, code}))\n .then(() => salla.auth.canRedirect && window.location.reload())\n .catch((error) => {\n salla.logger.error(error);\n this.regBtn.stop() && this.regBtn.enable()\n })\n }\n\n private async newUserValidation() {\n const isLogByPhone = this.regType == \"phone\",\n isLogByEmail = this.regType == \"email\",\n emailValue = this.regEmail.value || (isLogByEmail && this.loginEmail.value),\n isEmailValid = Helper.isValidEmail(emailValue),\n isFirstNameValid = this.firstName.value.length > 0,\n isLastNameValid = this.lastName.value.length > 0,\n isPhoneValid = await this.regTelInput.isValid() || isLogByPhone && await this.loginTelInput.isValid(),\n emailValidation = (emailValue && isEmailValid) || (!emailValue && !this.isEmailRequired);\n\n // Custom Fields Validation\n var isCustomFieldValid = true;\n //we should make sure that there is text nodes between children\n this.customFieldsWrapper.childNodes\n .forEach((field: HTMLSallaFileUploadElement | HTMLInputElement) => {\n this.customFieldsValues[field.id] = field['value'];\n if (!field.required || this.customFieldsValues[field.id].length) {\n return;\n }\n isCustomFieldValid = false;\n const errorMsg: string = salla.lang.get('common.errors.field_required', {attribute: field.title});\n this.validateField(field, errorMsg)\n });\n\n if (emailValidation && isPhoneValid && isFirstNameValid && isLastNameValid && isCustomFieldValid) return;\n !isEmailValid && this.validateField(this.regEmail, this.emailErrorMsg);\n !isFirstNameValid && this.validateField(this.firstName, this.firstNameErrorMsg);\n !isLastNameValid && this.validateField(this.lastName, this.lastNameErrorMsg);\n throw 'Please insert required fields';\n }\n\n private getFilepondPlaceholder() {\n return `<div class=\"s-login-modal-filepond-placeholder\"><span class=\"s-login-modal-filepond-placeholder-icon\">${CameraIcon}</span><p class=\"s-login-modal-filepond-placeholder-text\">${this.dragAndDrop}</p> <span class=\"filepond--label-action\">${this.browseFromFiles}</span></div>`\n }\n\n // eslint-disable-next-line @stencil/own-methods-must-be-private\n validateField(field: HTMLInputElement | HTMLSallaFileUploadElement, errorMsg: string) {\n field.classList.add('s-has-error');\n field.nextElementSibling['innerText'] = '* ' + errorMsg;\n }\n\n generateTabClasses(tabName) {\n return {\n 's-login-modal-tab': tabName !== 'registration' && tabName !== 'otp',\n \"s-hidden\": this.currentTabName !== tabName,\n \"s-show\": this.currentTabName === tabName,\n 's-login-modal-unactive': tabName !== 'registration' && tabName !== 'otp' && this.currentTabName !== tabName,\n 's-login-modal-active': tabName !== 'registration' && tabName !== 'otp' && this.currentTabName === tabName\n }\n }\n\n generateRegClasses(regType) {\n return {\n \"mb-1.5\": true,\n \"s-hidden\": this.regType === regType\n }\n }\n\n render() {\n // @ts-ignore\n // @ts-ignore\n return (\n <salla-modal class=\"s-login-modal\" modal-title={this.title} ref={modal => this.modal = modal} width=\"xs\">\n <span slot='icon' class=\"s-login-modal-header-icon\" innerHTML={UserIcon}/>\n <div class=\"s-login-modal-wrapper\">\n\n {/* Tab 1 (Select Login Type)*/}\n {this.isEmailAllowed && this.isMobileAllowed ?\n <div class={this.generateTabClasses('home')} data-name=\"home\" ref={tab => this.homeTab = tab}>\n <p class=\"s-login-modal-sub-title\">{salla.lang.get('blocks.header.select_login_way')}</p>\n <slot name=\"before-login-type\"/>\n <a href=\"#\" class=\"s-login-modal-main-btn\" onClick={(evt) => this.showTab(this.mobileTab, evt)}>\n <span class=\"s-login-modal-main-btn-icon\" innerHTML={PhoneIcon}/>\n <span class=\"s-login-modal-main-btn-text\">{salla.lang.get('blocks.header.sms')}</span>\n <span class=\"s-login-modal-main-btn-arrow\" innerHTML={KeyboardArrowRightIcon}/>\n </a>\n <a href=\"#\" class=\"s-login-modal-main-btn\" onClick={(evt) => this.showTab(this.emailTab, evt)}>\n <span class=\"s-login-modal-main-btn-icon\" innerHTML={EmailIcon}/>\n <span class=\"s-login-modal-main-btn-text\">{salla.lang.get('common.elements.email')}</span>\n <span class=\"s-login-modal-main-btn-arrow\" innerHTML={KeyboardArrowRightIcon}/>\n </a>\n <slot name=\"after-login-type\"/>\n </div>\n : ''}\n\n\n {/* Tab 2 (Login By Mobile)*/}\n {this.isMobileAllowed ?\n <div class={this.generateTabClasses('login-phone')} data-name=\"login-phone\"\n ref={tab => this.mobileTab = tab}>\n <slot name=\"before-login-mobile\"/>\n <form onSubmit={(event) => this.loginBySMS(event)} method=\"POST\">\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.mobile')}</label>\n <salla-tel-input tabindex=\"0\" ref={el => this.loginTelInput = el}\n onKeyDown={e => this.typing(e)}></salla-tel-input>\n {/* @ts-ignore */}\n <salla-button class=\"s-login-modal-enter-button\" type=\"submit\" loader-position='center' width=\"wide\" ref={b => this.smsBtn = b}>\n {salla.lang.get('blocks.header.enter')}\n </salla-button>\n </form>\n {this.isEmailAllowed ?\n <a href=\"#\" onClick={() => this.showTab(this.emailTab)}\n class=\"s-login-modal-link\">{salla.lang.get('blocks.header.login_by_email')}</a> : ''}\n <slot name=\"after-login-mobile\"/>\n </div> : ''}\n\n\n {/* Tab 3 (Login By Email)*/}\n {this.isEmailAllowed ?\n <div class={this.generateTabClasses('login-email')} data-name=\"login-email\"\n ref={tab => this.emailTab = tab}>\n <slot name=\"before-login-email\"/>\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.email')}</label>\n <form onSubmit={() => this.loginByEmail(event)} method=\"POST\">\n <input type=\"email\" ref={el => this.loginEmail = el} onKeyDown={e => this.typing(e)}\n placeholder=\"your@email.com\"\n enterkeyhint=\"next\"\n class=\"s-login-modal-input s-ltr\"/>\n <span class=\"s-login-modal-error-message\"/>\n <salla-button loader-position='center' width=\"wide\" onClick={() => this.loginByEmail()}\n ref={b => this.emailBtn = b}>{salla.lang.get('blocks.header.enter')}</salla-button>\n </form>\n {this.isMobileAllowed ?\n <a href=\"#\" onClick={() => this.showTab(this.mobileTab)}\n class=\"s-login-modal-link\">{salla.lang.get('blocks.header.login_by_sms')}</a>\n : ''\n }\n <slot name=\"after-login-email\"/>\n </div> : ''}\n\n\n {/* Tab 4 (Verify OTP)*/}\n <salla-verify display=\"inline\" support-web-auth={this.supportWebAuth ? 'true' : 'false'}\n class={this.generateTabClasses('otp')} data-name=\"otp\" ref={tab => this.verifyTab = tab}\n autoReload={false}>\n <a onClick={() => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab)}\n class=\"s-verify-back\"\n innerHTML={ArrowRightIcon}\n slot=\"after-footer\"\n href=\"#\"/>\n </salla-verify>\n\n {/* Tab 5 (Register New User)*/}\n <div data-name=\"registration\" class={this.generateTabClasses('registration')}\n ref={tab => this.registrationTab = tab}>\n <slot name=\"before-registration\"/>\n <div>\n <label class=\"s-login-modal-label\">{salla.lang.get('blocks.header.your_name')}</label>\n <input type=\"text\" class=\"s-login-modal-input\" ref={el => this.firstName = el}\n onKeyDown={e => this.typing(e, this.newUser)}\n placeholder={salla.lang.get('pages.profile.first_name')}/>\n <span class=\"s-login-modal-error-message\"/>\n </div>\n\n <div>\n <label class=\"s-login-modal-label\">{salla.lang.get('pages.profile.last_name')}</label>\n <input type=\"text\" class=\"s-login-modal-input\" ref={el => this.lastName = el}\n onKeyDown={e => this.typing(e, this.newUser)}\n placeholder={salla.lang.get('pages.profile.last_name')}/>\n <span class=\"s-login-modal-error-message\"/>\n </div>\n\n <div class={this.generateRegClasses('phone')}>\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.mobile')}</label>\n <salla-tel-input ref={el => this.regTelInput = el}\n onKeyDown={e => this.typing(e, this.newUser)}></salla-tel-input>\n </div>\n\n <div class={this.generateRegClasses('email')}>\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.email')}</label>\n <input type=\"email\" ref={el => this.regEmail = el} onKeyDown={e => this.typing(e, this.newUser)}\n placeholder=\"your@email.com\"\n class=\"s-login-modal-input s-ltr\"/>\n <span class=\"s-login-modal-error-message\"/>\n </div>\n <div class=\"s-login-modal-custom-fields\" ref={el => this.customFieldsWrapper = el}>{\n this.customFields.map((field: CustomField) => [\n <label class=\"s-login-modal-label\">{field.label}</label>,\n field.type === CustomFieldType.PHOTO\n ? <salla-file-upload\n name=\"image\"\n instant-upload\n id={`${field.id}`}\n title={field.label}\n required={field.required}\n url={salla.url.get('upload-image')}\n // onUploaded={}\n labelIdle={this.getFilepondPlaceholder()}/>\n : <input\n type=\"text\"\n onKeyDown={e => this.typing(e, this.newUser)}\n onInput={el => field.type == CustomFieldType.NUMBER ? salla.helpers.inputDigitsOnly(el.target) : {}}\n placeholder={field.description}\n required={field.required}\n title={field.label}\n id={`${field.id}`}\n class=\"s-login-modal-input s-ltr\"/>,\n <span class=\"s-login-modal-error-message\"/>\n ])\n }</div>\n\n <salla-button loader-position='center' width=\"wide\" onClick={() => this.newUser()}\n ref={b => this.regBtn = b}>{salla.lang.get('blocks.header.register')}</salla-button>\n <slot name=\"after-registration\"/>\n </div>\n </div>\n </salla-modal>\n );\n }\n}\n\n"],"version":3}
|
|
1
|
+
{"file":"salla-login-modal.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAY,eAIX;AAJD,WAAY,eAAe;EACvB,gCAAa,CAAA;EACb,oCAAiB,CAAA;EACjB,kCAAe,CAAA;AACnB,CAAC,EAJW,eAAe,KAAf,eAAe;;ACT3B,MAAM,kBAAkB,GAAG,EAAE;;MC2BhBA,iBAAe;EAC1B;;;IA2EQ,uBAAkB,GAAW,EAAE,CAAC;IAgGhC,WAAM,GAAG,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI;MACtC,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC;MAC1C,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;MACzC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,CAAC,QAAQ,CAAC,6BAA6B,CAAC,MAAK,KAAK,CAAC,SAAS,GAAG,EAAE,CAAC,CAAC;;MAEnF,YAAY,IAAI,CAAC,CAAC,GAAG,IAAI,OAAO,IAAI,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;;;;;;;;;;;;;;;;;;;;;","names":["SallaLoginModal","EmailIcon"],"sources":["./src/components/salla-login-modal/intefaces.ts","./src/components/salla-login-modal/salla-login-modal.scss?tag=salla-login-modal","./src/components/salla-login-modal/salla-login-modal.tsx"],"sourcesContent":["export interface CustomField {\n id: number;\n label: string;\n description: string;\n type: string;\n required: boolean;\n length: number;\n}\n\nexport enum CustomFieldType {\n TEXT = 'text',\n NUMBER = 'number',\n PHOTO = 'photo'\n}\n","/*\n* Salla Login Component: login popup modal\n* You can use these classes to target the elements in the component.\n*/\n\n.s-login-modal {\n &-sub-title {\n\n }\n &-main-btn {\n \n }\n &-main-btn-icon {\n\n }\n &-main-btn-text {\n\n }\n &-main-btn-arrow {\n\n }\n &-label {\n\n }\n &-input {\n\n }\n &-otp-input {\n\n }\n &-link {\n\n }\n &-error-message {\n\n }\n &-wrapper {\n\n }\n &-tab {\n\n }\n &-active {\n\n }\n &-unactive {\n\n }\n}\n","import {Component, Element, h, Listen, Method, Prop, State} from '@stencil/core';\nimport UserIcon from \"../../assets/svg/user.svg\";\nimport PhoneIcon from \"../../assets/svg/phone.svg\";\nimport EmailIcon from \"../../assets/svg/mail.svg\";\nimport CameraIcon from '../../assets/svg/camera.svg';\nimport KeyboardArrowRightIcon from \"../../assets/svg/keyboard_arrow_right.svg\";\nimport ArrowRightIcon from \"../../assets/svg/arrow-right.svg\";\nimport Helper from '../../Helpers/Helper';\nimport {CustomField, CustomFieldType} from './intefaces';\n\n/**\n * @slot footer - The footer of modal\n * @slot before-login-type - placeholder position\n * @slot after-login-type - placeholder position\n * @slot before-login-mobile - placeholder position\n * @slot after-login-mobile - placeholder position\n * @slot before-login-email - placeholder position\n * @slot after-login-email - placeholder position\n * @slot before-registration - placeholder position\n * @slot after-registration - placeholder position\n */\n@Component({\n tag: 'salla-login-modal',\n styleUrl: 'salla-login-modal.scss'\n})\n\n\nexport class SallaLoginModal {\n constructor() {\n\n this.title = this.host.title || salla.lang.get('blocks.header.login');\n this.host.removeAttribute('title');\n\n this.emailErrorMsg = salla.lang.get('common.elements.email_is_valid');\n this.firstNameErrorMsg = salla.lang.get('common.errors.field_required', {attribute: salla.lang.get('pages.profile.first_name')});\n this.lastNameErrorMsg = salla.lang.get('common.errors.field_required', {attribute: salla.lang.get('pages.profile.last_name')});\n\n salla.lang.onLoaded(() => {\n this.translationLoaded = true;\n this.title = salla.lang.get('blocks.header.login');\n this.dragAndDrop = salla.lang.get('common.uploader.drag_and_drop');\n this.browseFromFiles = salla.lang.get('common.uploader.browse');\n this.updateTranslations();\n });\n\n salla.event.on('login::open', (event) => this.open(event));\n salla.onReady( () => {\n this.isEmailAllowed = salla.config.get('store.settings.auth.email_allowed', this.isEmailAllowed);\n this.isMobileAllowed = salla.config.get('store.settings.auth.mobile_allowed', this.isMobileAllowed);\n this.isEmailRequired = salla.config.get('store.settings.auth.is_email_required', this.isEmailRequired);\n });\n }\n\n @Element() host: HTMLElement;\n /**\n * Does the merchant allow to login using email\n */\n @Prop({mutable: true}) isEmailAllowed: boolean ;\n /**\n * Does the merchant/current location for visitor allow to login using mobile, By default outside KSA is `false`\n */\n @Prop({mutable: true}) isMobileAllowed: boolean = true;\n /**\n * Does the merchant require registration with email & mobile\n */\n @Prop({mutable: true}) isEmailRequired: boolean = false;\n\n /**\n * Once the api verify success, it will be login the customer in web pages\n */\n @Prop({reflect: true}) supportWebAuth: boolean = true;\n\n private modal: HTMLSallaModalElement;\n private homeTab: HTMLDivElement;\n private mobileTab: HTMLDivElement;\n private emailTab: HTMLDivElement;\n private verifyTab: HTMLSallaVerifyElement;\n private registrationTab: HTMLDivElement;\n private regTelInput: HTMLSallaTelInputElement;\n private regEmail: HTMLInputElement;\n private customFieldsWrapper: HTMLDivElement;\n private loginTelInput: HTMLSallaTelInputElement;\n private loginEmail: HTMLInputElement;\n private firstName: HTMLInputElement;\n private lastName: HTMLInputElement;\n private smsBtn: HTMLSallaButtonElement;\n private emailBtn: HTMLSallaButtonElement;\n private regBtn: HTMLSallaButtonElement;\n\n @State() currentTabName = 'home'\n @State() regType: 'phone' | 'email' = 'phone';\n\n\n @State() translationLoaded: boolean = false;\n @State() title: string;\n @State() emailErrorMsg: string;\n @State() firstNameErrorMsg: string;\n @State() lastNameErrorMsg: string;\n\n @State() dragAndDrop: string = salla.lang.get('common.uploader.drag_and_drop');\n @State() browseFromFiles: string = salla.lang.get('common.uploader.browse');\n @State() customFields: CustomField[] = [];\n\n private customFieldsValues: Object = {};\n @State() uploadedImage: string = undefined;\n\n @Listen('verified', {target: 'window'})\n /**\n * @param {CustomEvent|{details:{case:'new_customer'|'authenticated', redirect_url:string|null}}} event\n */\n onVerified(event) {\n salla.log('verified', event);\n //there is a case when force login is activated & is new user, it will return case inside error key., so cover it.\n let verifyCase = event.detail?.data.case || event.detail?.error.case;\n if (!verifyCase) {\n salla.log('verified but without case!');\n return;\n }\n\n if (verifyCase === \"new_customer\") {\n this.customFields = event.detail?.data?.custom_fields || [];\n return this.showTab(this.registrationTab);\n }\n\n if (!salla.auth.canRedirect()) {\n salla.log('Will not auto redirect or reload, due to `salla.auth.canRedirect()`');\n this.modal.close();\n return;\n }\n\n if (event.detail.data.redirect_url) {\n return window.location.href = event.detail.data.redirect_url;\n }\n\n /**\n * we don't want to reload the page if this is not web auth\n * because we'll need the token in the page itself and its there\n * todo :: store the user data in storage for non-web auth and set the config.user from it\n */\n if (this.supportWebAuth) {\n window.location.reload();\n } else {\n this.modal.close();\n }\n }\n\n updateTranslations() {\n this.emailErrorMsg = salla.lang.get('common.elements.email_is_valid');\n this.firstNameErrorMsg = salla.lang.get('common.errors.field_required', {attribute: salla.lang.get('pages.profile.first_name')});\n this.lastNameErrorMsg = salla.lang.get('common.errors.field_required', {attribute: salla.lang.get('pages.profile.last_name')});\n this.modal?.setTitle(this.title);\n }\n\n /**\n * Open login component\n */\n @Method()\n // @ts-ignore\n async open(event = null) {\n // todo :: support change the settings from event details\n // if(event && event.hasOwnProperty('isEmailAllowed')){\n // this.isEmailAllowed = event?.isEmailAllowed;\n // }\n //\n // if(event && event.hasOwnProperty('isMobileAllowed')){\n // this.isMobileAllowed = event?.isMobileAllowed;\n // }\n\n if (this.isEmailAllowed && this.isMobileAllowed) {\n this.showTab(this.homeTab);\n } else if (this.isEmailAllowed) {\n this.showTab(this.emailTab);\n } else if (this.isMobileAllowed) {\n this.showTab(this.mobileTab);\n }\n return this.modal.open();\n }\n\n private showTab(tab, evt?) {\n evt?.preventDefault();\n this.currentTabName = tab.getAttribute('data-name');\n\n // todo:: use better way for resize the modal\n // setTimeout(() => this.modal.querySelector('.s-login-modal-wrapper')?.setAttribute('style', 'height:' + tab?.scrollHeight + 'px'));\n\n if ([this.mobileTab, this.emailTab].includes(tab)) {\n this.regType = tab === this.mobileTab ? 'phone' : 'email';\n }\n\n const input = tab.querySelector('input[type=\"tel\"], input[type=\"email\"]');\n input && setTimeout(() => {\n input.focus();\n }, 100);\n\n this.modal?.setTitle(this.currentTabName === 'registration' ? salla.lang.get('common.titles.registration') : this.title);\n\n return this;\n }\n\n private typing = (e, submitMethod = null) => {\n const error = e.target.nextElementSibling;\n e.target.classList.remove('s-has-error');\n error?.classList.contains('s-login-modal-error-message') && (error.innerText = '');\n //it was sending two requests for send two verification requests\n submitMethod && e.key == 'Enter' && submitMethod();\n }\n\n private loginBySMS = async (event = null) => {\n event?.preventDefault();\n const {phone, countryCode} = await this.loginTelInput.getValues();\n const isPhoneValid = await this.loginTelInput.isValid();\n if (!isPhoneValid) {\n return;\n }\n\n this.login(this.smsBtn, {type: 'mobile', phone: phone, country_code: countryCode});\n\n return false;\n }\n\n private loginByEmail = (event = null) => {\n event?.preventDefault();\n if (!Helper.isValidEmail(this.loginEmail.value)) {\n this.validateField(this.loginEmail, this.emailErrorMsg);\n return;\n }\n\n this.login(this.emailBtn, {type: 'email', email: this.loginEmail.value});\n }\n\n private login(btn: HTMLSallaButtonElement, data) {\n btn.load()\n .then(() => btn.disable())\n .then(() => salla.auth.api.login(data))\n .then(() => this.showTab(this.verifyTab))\n .then(() => this.verifyTab.open(data))\n .finally(() => btn.stop() && btn.enable());\n }\n\n private newUser = async () => {\n const {\n phone: regPhone,\n countryCode\n } = this.regType == \"email\" ? await this.regTelInput.getValues() : await this.loginTelInput.getValues(),\n emailValue = this.regEmail.value || this.loginEmail?.value\n await this.newUserValidation();\n await this.regBtn.load();\n await this.regBtn.disable();\n\n let data: any = {\n first_name: this.firstName.value,\n last_name: this.lastName.value,\n phone: regPhone || this.loginTelInput.phone,\n country_code: countryCode,\n verified_by: this.regType,\n custom_fields: this.customFieldsValues,\n };\n emailValue && (data = {...data, email: emailValue});\n this.verifyTab.getCode()\n .then(code => salla.auth.api.register({...data, code}))\n .then(() => salla.auth.canRedirect && window.location.reload())\n .catch((error) => {\n salla.logger.error(error);\n this.regBtn.stop() && this.regBtn.enable()\n })\n }\n\n private async newUserValidation() {\n const isLogByPhone = this.regType == \"phone\",\n isLogByEmail = this.regType == \"email\",\n emailValue = this.regEmail.value || (isLogByEmail && this.loginEmail.value),\n isEmailValid = Helper.isValidEmail(emailValue),\n isFirstNameValid = this.firstName.value.length > 0,\n isLastNameValid = this.lastName.value.length > 0,\n isPhoneValid = await this.regTelInput.isValid() || isLogByPhone && await this.loginTelInput.isValid(),\n emailValidation = (emailValue && isEmailValid) || (!emailValue && !this.isEmailRequired);\n\n // Custom Fields Validation\n var isCustomFieldValid = true;\n //we should make sure that there is text nodes between children\n this.customFieldsWrapper.childNodes\n .forEach((field: HTMLSallaFileUploadElement | HTMLInputElement) => {\n this.customFieldsValues[field.id] = field['value'];\n if (!field.required || this.customFieldsValues[field.id].length) {\n return;\n }\n isCustomFieldValid = false;\n const errorMsg: string = salla.lang.get('common.errors.field_required', {attribute: field.title});\n this.validateField(field, errorMsg)\n });\n\n if (emailValidation && isPhoneValid && isFirstNameValid && isLastNameValid && isCustomFieldValid) return;\n !isEmailValid && this.validateField(this.regEmail, this.emailErrorMsg);\n !isFirstNameValid && this.validateField(this.firstName, this.firstNameErrorMsg);\n !isLastNameValid && this.validateField(this.lastName, this.lastNameErrorMsg);\n throw 'Please insert required fields';\n }\n\n private getFilepondPlaceholder() {\n return `<div class=\"s-login-modal-filepond-placeholder\"><span class=\"s-login-modal-filepond-placeholder-icon\">${CameraIcon}</span><p class=\"s-login-modal-filepond-placeholder-text\">${this.dragAndDrop}</p> <span class=\"filepond--label-action\">${this.browseFromFiles}</span></div>`\n }\n\n // eslint-disable-next-line @stencil/own-methods-must-be-private\n validateField(field: HTMLInputElement | HTMLSallaFileUploadElement, errorMsg: string) {\n field.classList.add('s-has-error');\n field.nextElementSibling['innerText'] = '* ' + errorMsg;\n }\n\n generateTabClasses(tabName) {\n return {\n 's-login-modal-tab': tabName !== 'registration' && tabName !== 'otp',\n \"s-hidden\": this.currentTabName !== tabName,\n \"s-show\": this.currentTabName === tabName,\n 's-login-modal-unactive': tabName !== 'registration' && tabName !== 'otp' && this.currentTabName !== tabName,\n 's-login-modal-active': tabName !== 'registration' && tabName !== 'otp' && this.currentTabName === tabName\n }\n }\n\n generateRegClasses(regType) {\n return {\n \"mb-1.5\": true,\n \"s-hidden\": this.regType === regType\n }\n }\n\n render() {\n // @ts-ignore\n // @ts-ignore\n return (\n <salla-modal class=\"s-login-modal\" modal-title={this.title} ref={modal => this.modal = modal} width=\"xs\">\n <span slot='icon' class=\"s-login-modal-header-icon\" innerHTML={UserIcon}/>\n <div class=\"s-login-modal-wrapper\">\n\n {/* Tab 1 (Select Login Type)*/}\n {this.isEmailAllowed && this.isMobileAllowed ?\n <div class={this.generateTabClasses('home')} data-name=\"home\" ref={tab => this.homeTab = tab}>\n <p class=\"s-login-modal-sub-title\">{salla.lang.get('blocks.header.select_login_way')}</p>\n <slot name=\"before-login-type\"/>\n <a href=\"#\" class=\"s-login-modal-main-btn\" onClick={(evt) => this.showTab(this.mobileTab, evt)}>\n <span class=\"s-login-modal-main-btn-icon\" innerHTML={PhoneIcon}/>\n <span class=\"s-login-modal-main-btn-text\">{salla.lang.get('blocks.header.sms')}</span>\n <span class=\"s-login-modal-main-btn-arrow\" innerHTML={KeyboardArrowRightIcon}/>\n </a>\n <a href=\"#\" class=\"s-login-modal-main-btn\" onClick={(evt) => this.showTab(this.emailTab, evt)}>\n <span class=\"s-login-modal-main-btn-icon\" innerHTML={EmailIcon}/>\n <span class=\"s-login-modal-main-btn-text\">{salla.lang.get('common.elements.email')}</span>\n <span class=\"s-login-modal-main-btn-arrow\" innerHTML={KeyboardArrowRightIcon}/>\n </a>\n <slot name=\"after-login-type\"/>\n </div>\n : ''}\n\n\n {/* Tab 2 (Login By Mobile)*/}\n {this.isMobileAllowed ?\n <div class={this.generateTabClasses('login-phone')} data-name=\"login-phone\"\n ref={tab => this.mobileTab = tab}>\n <slot name=\"before-login-mobile\"/>\n <form onSubmit={(event) => this.loginBySMS(event)} method=\"POST\">\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.mobile')}</label>\n <salla-tel-input tabindex=\"0\" ref={el => this.loginTelInput = el}\n onKeyDown={e => this.typing(e)}></salla-tel-input>\n {/* @ts-ignore */}\n <salla-button class=\"s-login-modal-enter-button\" type=\"submit\" loader-position='center' width=\"wide\" ref={b => this.smsBtn = b}>\n {salla.lang.get('blocks.header.enter')}\n </salla-button>\n </form>\n {this.isEmailAllowed ?\n <a href=\"#\" onClick={() => this.showTab(this.emailTab)}\n class=\"s-login-modal-link\">{salla.lang.get('blocks.header.login_by_email')}</a> : ''}\n <slot name=\"after-login-mobile\"/>\n </div> : ''}\n\n\n {/* Tab 3 (Login By Email)*/}\n {this.isEmailAllowed ?\n <div class={this.generateTabClasses('login-email')} data-name=\"login-email\"\n ref={tab => this.emailTab = tab}>\n <slot name=\"before-login-email\"/>\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.email')}</label>\n <form onSubmit={() => this.loginByEmail(event)} method=\"POST\">\n <input type=\"email\" ref={el => this.loginEmail = el} onKeyDown={e => this.typing(e)}\n placeholder=\"your@email.com\"\n enterkeyhint=\"next\"\n class=\"s-login-modal-input s-ltr\"/>\n <span class=\"s-login-modal-error-message\"/>\n <salla-button loader-position='center' width=\"wide\" onClick={() => this.loginByEmail()}\n ref={b => this.emailBtn = b}>{salla.lang.get('blocks.header.enter')}</salla-button>\n </form>\n {this.isMobileAllowed ?\n <a href=\"#\" onClick={() => this.showTab(this.mobileTab)}\n class=\"s-login-modal-link\">{salla.lang.get('blocks.header.login_by_sms')}</a>\n : ''\n }\n <slot name=\"after-login-email\"/>\n </div> : ''}\n\n\n {/* Tab 4 (Verify OTP)*/}\n <salla-verify display=\"inline\" support-web-auth={this.supportWebAuth ? 'true' : 'false'}\n class={this.generateTabClasses('otp')} data-name=\"otp\" ref={tab => this.verifyTab = tab}\n autoReload={false}>\n <a onClick={() => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab)}\n class=\"s-verify-back\"\n innerHTML={ArrowRightIcon}\n slot=\"after-footer\"\n href=\"#\"/>\n </salla-verify>\n\n {/* Tab 5 (Register New User)*/}\n <div data-name=\"registration\" class={this.generateTabClasses('registration')}\n ref={tab => this.registrationTab = tab}>\n <slot name=\"before-registration\"/>\n <div>\n <label class=\"s-login-modal-label\">{salla.lang.get('blocks.header.your_name')}</label>\n <input type=\"text\" class=\"s-login-modal-input\" ref={el => this.firstName = el}\n onKeyDown={e => this.typing(e, this.newUser)}\n placeholder={salla.lang.get('pages.profile.first_name')}/>\n <span class=\"s-login-modal-error-message\"/>\n </div>\n\n <div>\n <label class=\"s-login-modal-label\">{salla.lang.get('pages.profile.last_name')}</label>\n <input type=\"text\" class=\"s-login-modal-input\" ref={el => this.lastName = el}\n onKeyDown={e => this.typing(e, this.newUser)}\n placeholder={salla.lang.get('pages.profile.last_name')}/>\n <span class=\"s-login-modal-error-message\"/>\n </div>\n\n <div class={this.generateRegClasses('phone')}>\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.mobile')}</label>\n <salla-tel-input ref={el => this.regTelInput = el}\n onKeyDown={e => this.typing(e, this.newUser)}></salla-tel-input>\n </div>\n\n <div class={this.generateRegClasses('email')}>\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.email')}</label>\n <input type=\"email\" ref={el => this.regEmail = el} onKeyDown={e => this.typing(e, this.newUser)}\n placeholder=\"your@email.com\"\n class=\"s-login-modal-input s-ltr\"/>\n <span class=\"s-login-modal-error-message\"/>\n </div>\n <div class=\"s-login-modal-custom-fields\" ref={el => this.customFieldsWrapper = el}>{\n this.customFields.map((field: CustomField) => [\n <label class=\"s-login-modal-label\">{field.label}</label>,\n field.type === CustomFieldType.PHOTO\n ? <salla-file-upload\n name=\"image\"\n instant-upload={true}\n id={`${field.id}`}\n title={field.label}\n required={field.required}\n url={salla.url.get('upload-image')}\n // onUploaded={}\n labelIdle={this.getFilepondPlaceholder()}/>\n : <input\n onInput={el => field.type == CustomFieldType.NUMBER ? salla.helpers.inputDigitsOnly(el.target) : {}}\n onKeyDown={e => this.typing(e, this.newUser)}\n class=\"s-login-modal-input s-ltr\"\n maxlength={field.length || 1000}//todo:: support it by adding the maxlength or not, not setting static limit\n placeholder={field.description}\n required={field.required}\n title={field.label}\n id={`${field.id}`}\n type=\"text\"/>,\n <span class=\"s-login-modal-error-message\"/>\n ])\n }</div>\n\n <salla-button loader-position='center' width=\"wide\" onClick={() => this.newUser()}\n ref={b => this.regBtn = b}>{salla.lang.get('blocks.header.register')}</salla-button>\n <slot name=\"after-registration\"/>\n </div>\n </div>\n </salla-modal>\n );\n }\n}\n\n"],"version":3}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
5
|
+
import { C as Cancel } from './cancel.js';
|
|
5
6
|
|
|
6
7
|
const sallaMaintenanceAlertCss = ".s-maintenance-alert-wrapper{display:-ms-flexbox;display:flex;min-height:40px;width:100%;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(26, 38, 61, var(--tw-bg-opacity));padding:0.25rem 0.5rem;--tw-text-opacity:1;color:rgba(255, 255, 255, var(--tw-text-opacity))}.s-maintenance-alert-wrapper a{-webkit-transition:0.35s cubic-bezier(0.2, 1, 0.3, 1);transition:0.35s cubic-bezier(0.2, 1, 0.3, 1)}.s-maintenance-alert-wrapper *{color:inherit}@media (min-width: 640px){.s-maintenance-alert-wrapper{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-content{margin-top:1rem;margin-bottom:1rem;display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}@media (min-width: 640px){.s-maintenance-alert-content{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.s-maintenance-alert-icon{margin-right:1.25rem;display:none}@media (min-width: 640px){.s-maintenance-alert-icon{display:block}}.s-maintenance-alert-text h2{margin-bottom:0.5rem;font-size:0.875rem;font-weight:700;line-height:1.4}@media (min-width: 640px){.s-maintenance-alert-text h2{font-size:1.5rem;line-height:2rem}}.s-maintenance-alert-text p{margin:0px;text-align:right;font-size:10px;line-height:1.2}@media (min-width: 640px){.s-maintenance-alert-text p{text-align:center;font-size:0.75rem;line-height:1}}.s-maintenance-alert-btn{position:relative;margin-left:4px;margin-right:4px;display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;border-radius:0.125rem;border-width:1px;--tw-border-opacity:1;border-color:rgba(93, 213, 196, var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgba(93, 213, 196, var(--tw-bg-opacity));padding:0.5rem;text-align:center;vertical-align:middle;font-size:0.875rem;font-weight:400;line-height:1.4;--tw-text-opacity:1;color:rgba(255, 255, 255, var(--tw-text-opacity))}.s-maintenance-alert-btn:hover{--tw-bg-opacity:1;background-color:rgba(53, 203, 181, var(--tw-bg-opacity))}.s-maintenance-alert-btn *{pointer-events:none}[dir=rtl] .s-maintenance-alert-btn{margin-left:1.25rem;margin-right:0}@media (min-width: 640px){.s-maintenance-alert-btn{padding:0.5rem 1rem}}";
|
|
7
8
|
|
|
@@ -18,9 +19,21 @@ const SallaMaintenanceAlert$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
18
19
|
this.message = salla.config.get('maintenance_details.message');
|
|
19
20
|
this.buttonTitle = window.innerWidth <= 768 ? salla.config.get('maintenance_details.button_title') : salla.config.get('maintenance_details.button_full_title');
|
|
20
21
|
}
|
|
22
|
+
closeAlert() {
|
|
23
|
+
salla.storage.set('hide_salla-maintenance-alert_at', Date.now());
|
|
24
|
+
this.host.style.display = 'none';
|
|
25
|
+
}
|
|
21
26
|
render() {
|
|
22
|
-
return (h(Host, { class: "s-maintenance-alert-wrapper" }, h("div", { class: "s-maintenance-alert-content" }, h("div", { class: "s-maintenance-alert-container" }, h("div", { class: "s-maintenance-alert-icon" }, h("img", { src: salla.url.cdn('images/alert.png'), alt: "Alert" })), h("div", { class: "s-maintenance-alert-text" }, h("h2", null, this.title), h("p", null, this.message))), h("div", null, h("a", { class: "s-maintenance-alert-btn", href: salla.config.get('maintenance_details.button_url') }, this.buttonTitle)))));
|
|
27
|
+
return (h(Host, { class: "s-maintenance-alert-wrapper" }, h("button", { class: "s-maintenance-alert-close", innerHTML: Cancel, onClick: () => this.closeAlert() }), h("div", { class: "s-maintenance-alert-content" }, h("div", { class: "s-maintenance-alert-container" }, h("div", { class: "s-maintenance-alert-icon" }, h("img", { src: salla.url.cdn('images/alert.png'), alt: "Alert" })), h("div", { class: "s-maintenance-alert-text" }, h("h2", null, this.title), h("p", null, this.message))), h("div", null, h("a", { class: "s-maintenance-alert-btn", href: salla.config.get('maintenance_details.button_url') }, this.buttonTitle)))));
|
|
28
|
+
}
|
|
29
|
+
componentDidLoad() {
|
|
30
|
+
//auto-hide the alert if close button is clicked before one hour
|
|
31
|
+
let hidden_at = salla.storage.get('hide_salla-maintenance-alert_at');
|
|
32
|
+
if (hidden_at && ((Date.now() - hidden_at) / 1000 / 60) < 60) {
|
|
33
|
+
this.closeAlert();
|
|
34
|
+
}
|
|
23
35
|
}
|
|
36
|
+
get host() { return this; }
|
|
24
37
|
static get style() { return sallaMaintenanceAlertCss; }
|
|
25
38
|
}, [0, "salla-maintenance-alert", {
|
|
26
39
|
"title": [32],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"salla-maintenance-alert.js","mappings":"
|
|
1
|
+
{"file":"salla-maintenance-alert.js","mappings":";;;;;;AAAA,MAAM,wBAAwB,GAAG,+4EAA+4E;;MCOn6EA,uBAAqB;;;;;;;;EAOhC,iBAAiB;IACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IAC3D,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC/D,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,kCAAkC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;GAChK;EAEO,UAAU;IAChB,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,iCAAiC,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACjE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;GAClC;EAED,MAAM;IACJ,QACE,EAAC,IAAI,IAAC,KAAK,EAAC,6BAA6B,IACvC,cAAQ,KAAK,EAAC,2BAA2B,EAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,GAAG,EAChG,WAAK,KAAK,EAAC,6BAA6B,IACtC,WAAK,KAAK,EAAC,+BAA+B,IACxC,WAAK,KAAK,EAAC,0BAA0B,IACnC,WAAK,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,GAAG,EAAC,OAAO,GAAE,CACtD,EACN,WAAK,KAAK,EAAC,0BAA0B,IACnC,cAAK,IAAI,CAAC,KAAK,CAAM,EACrB,aAAI,IAAI,CAAC,OAAO,CAAK,CACjB,CACF,EACN,eACE,SAAG,KAAK,EAAC,yBAAyB,EAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,IACxF,IAAI,CAAC,WAAW,CACf,CACA,CACF,CACD,EACP;GACH;EAED,gBAAgB;;IAEd,IAAI,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IACrE,IAAI,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,IAAI,IAAI,GAAG,EAAE,IAAI,EAAE,EAAE;MAC5D,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SallaMaintenanceAlert"],"sources":["./src/components/salla-maintenance-alert/salla-maintenance-alert.scss?tag=salla-maintenance-alert","./src/components/salla-maintenance-alert/salla-maintenance-alert.tsx"],"sourcesContent":["/** TODO:: after Re-build all themes with the latest version of maintenance, remove these styles */\n.s-maintenance-alert{\n &-wrapper{\n display: flex;\n min-height: 40px;\n width: 100%;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n --tw-bg-opacity: 1;\n background-color: rgba(26, 38, 61, var(--tw-bg-opacity));\n padding: 0.25rem 0.5rem;\n --tw-text-opacity: 1;\n color: rgba(255, 255, 255, var(--tw-text-opacity));\n a {\n transition: 0.35s cubic-bezier(0.2, 1, 0.3, 1)\n }\n * {\n color: inherit\n }\n @media (min-width: 640px) {\n padding-left:2rem;\n padding-right: 2rem\n }\n }\n &-content{\n margin-top: 1rem;\n margin-bottom: 1rem;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: space-between;\n @media (min-width: 640px) {\n padding-left:2rem;\n padding-right: 2rem\n }\n }\n &-container{\n display: flex;\n align-items: center\n }\n &-icon{\n margin-right: 1.25rem;\n display: none;\n @media (min-width: 640px) {\n display:block\n }\n }\n &-text{\n h2{\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n font-weight: 700;\n line-height: 1.4;\n @media (min-width: 640px) {\n font-size:1.5rem;\n line-height: 2rem\n }\n }\n p{\n margin: 0px;\n text-align: right;\n font-size: 10px;\n line-height: 1.2;\n @media (min-width: 640px) {\n text-align:center;\n font-size: 0.75rem;\n line-height: 1\n }\n }\n }\n &-btn{\n position: relative;\n margin-left: 4px;\n margin-right: 4px;\n display: inline-block;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n white-space: nowrap;\n border-radius: 0.125rem;\n border-width: 1px;\n --tw-border-opacity: 1;\n border-color: rgba(93, 213, 196, var(--tw-border-opacity));\n --tw-bg-opacity: 1;\n background-color: rgba(93, 213, 196, var(--tw-bg-opacity));\n padding: 0.5rem;\n text-align: center;\n vertical-align: middle;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 1.4;\n --tw-text-opacity: 1;\n color: rgba(255, 255, 255, var(--tw-text-opacity));\n &:hover {\n --tw-bg-opacity: 1;\n background-color: rgba(53, 203, 181, var(--tw-bg-opacity))\n }\n * {\n pointer-events: none\n }\n [dir=\"rtl\"] &{\n margin-left: 1.25rem;\n margin-right: 0;\n }\n @media (min-width: 640px) {\n padding: 0.5rem 1rem;\n }\n }\n}\n","import {Component, Host, h, State, Element} from '@stencil/core';\nimport Cancel from '../../assets/svg/cancel.svg';\n\n@Component({\n tag: 'salla-maintenance-alert',\n styleUrl: 'salla-maintenance-alert.scss',\n})\nexport class SallaMaintenanceAlert {\n\n @Element() host: HTMLElement;\n @State() title: string;\n @State() message: string;\n @State() buttonTitle: string;\n\n componentWillLoad() {\n this.title = salla.config.get('maintenance_details.title');\n this.message = salla.config.get('maintenance_details.message');\n this.buttonTitle = window.innerWidth <= 768 ? salla.config.get('maintenance_details.button_title') : salla.config.get('maintenance_details.button_full_title');\n }\n\n private closeAlert() {\n salla.storage.set('hide_salla-maintenance-alert_at', Date.now());\n this.host.style.display = 'none';\n }\n\n render() {\n return (\n <Host class=\"s-maintenance-alert-wrapper\">\n <button class=\"s-maintenance-alert-close\" innerHTML={Cancel} onClick={() => this.closeAlert()}/>\n <div class=\"s-maintenance-alert-content\">\n <div class=\"s-maintenance-alert-container\">\n <div class=\"s-maintenance-alert-icon\">\n <img src={salla.url.cdn('images/alert.png')} alt=\"Alert\"/>\n </div>\n <div class=\"s-maintenance-alert-text\">\n <h2>{this.title}</h2>\n <p>{this.message}</p>\n </div>\n </div>\n <div>\n <a class=\"s-maintenance-alert-btn\" href={salla.config.get('maintenance_details.button_url')}>\n {this.buttonTitle}\n </a>\n </div>\n </div>\n </Host>\n );\n }\n\n componentDidLoad() {\n //auto-hide the alert if close button is clicked before one hour\n let hidden_at = salla.storage.get('hide_salla-maintenance-alert_at');\n if (hidden_at && ((Date.now() - hidden_at) / 1000 / 60) < 60) {\n this.closeAlert();\n }\n }\n\n}\n"],"version":3}
|