@salla.sa/twilight-components 1.0.16 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/cjs/Helper-8852feaa.js +23 -0
  2. package/dist/cjs/index-0b5b5867.js +1656 -0
  3. package/dist/cjs/index.cjs.js +13 -0
  4. package/dist/cjs/loader.cjs.js +21 -0
  5. package/dist/cjs/salla-branches.cjs.entry.js +92 -0
  6. package/dist/cjs/salla-button_4.cjs.entry.js +299 -0
  7. package/dist/cjs/salla-localization.cjs.entry.js +80 -0
  8. package/dist/cjs/salla-login-342876b9.js +118 -0
  9. package/dist/cjs/salla-offer.cjs.entry.js +25 -0
  10. package/dist/cjs/salla-product-availability.cjs.entry.js +75 -0
  11. package/dist/cjs/salla-rating.cjs.entry.js +300 -0
  12. package/dist/cjs/salla-search-28da4616.js +81 -0
  13. package/dist/cjs/salla-search.cjs.entry.js +11 -0
  14. package/dist/cjs/twilight-components.cjs.js +19 -0
  15. package/dist/collection/Helpers/Helper.js +19 -0
  16. package/dist/collection/collection-manifest.json +21 -0
  17. package/dist/collection/components/generate-summary.js +35 -0
  18. package/dist/collection/components/salla-branches/salla-branches.css +12 -0
  19. package/dist/collection/components/salla-branches/salla-branches.js +233 -0
  20. package/dist/collection/components/salla-button/salla-button.css +3 -0
  21. package/dist/collection/components/salla-button/salla-button.js +246 -0
  22. package/dist/collection/components/salla-localization/salla-localization.js +206 -0
  23. package/dist/collection/components/salla-login/salla-login.js +348 -0
  24. package/dist/collection/components/salla-modal/salla-modal.js +459 -0
  25. package/dist/collection/components/salla-offer/salla-offer.js +40 -0
  26. package/dist/collection/components/salla-product-availability/salla-product-availability.js +331 -0
  27. package/dist/collection/components/salla-rating/salla-rating.css +7 -0
  28. package/dist/collection/components/salla-rating/salla-rating.js +483 -0
  29. package/dist/collection/components/salla-search/salla-search.js +132 -0
  30. package/dist/collection/components/salla-verify/salla-verify.js +238 -0
  31. package/dist/collection/index.js +2 -0
  32. package/dist/collection/interfaces/colors.js +1 -0
  33. package/dist/collection/interfaces/index.js +2 -0
  34. package/dist/collection/interfaces/ratio.js +1 -0
  35. package/dist/collection/plugins/tailwind-theme/generator.js +62 -0
  36. package/dist/collection/plugins/tailwind-theme/index.js +26 -0
  37. package/dist/{twilight-components → esm}/Helper-81ac9a8c.js +0 -0
  38. package/dist/esm/index-8b97d225.js +1628 -0
  39. package/dist/esm/index.js +4 -0
  40. package/dist/esm/loader.js +17 -0
  41. package/dist/esm/polyfills/core-js.js +11 -0
  42. package/dist/esm/polyfills/css-shim.js +1 -0
  43. package/dist/esm/polyfills/dom.js +79 -0
  44. package/dist/esm/polyfills/es5-html-element.js +1 -0
  45. package/dist/esm/polyfills/index.js +34 -0
  46. package/dist/esm/polyfills/system.js +6 -0
  47. package/dist/{twilight-components → esm}/salla-branches.entry.js +6 -6
  48. package/dist/esm/salla-button_4.entry.js +292 -0
  49. package/dist/esm/salla-localization.entry.js +76 -0
  50. package/dist/esm/salla-login-32d25ffa.js +116 -0
  51. package/dist/esm/salla-offer.entry.js +21 -0
  52. package/dist/{twilight-components → esm}/salla-product-availability.entry.js +2 -2
  53. package/dist/{twilight-components → esm}/salla-rating.entry.js +73 -70
  54. package/dist/{twilight-components/salla-search-5338c0a1.js → esm/salla-search-f552c487.js} +1 -1
  55. package/dist/esm/salla-search.entry.js +3 -0
  56. package/dist/esm/twilight-components.js +17 -0
  57. package/dist/index.cjs.js +1 -0
  58. package/dist/index.js +1 -0
  59. package/dist/twilight-components/index.esm.js +1 -4
  60. package/dist/twilight-components/p-33990e49.entry.js +1 -0
  61. package/dist/twilight-components/p-36683152.js +1 -0
  62. package/dist/twilight-components/p-3cfede65.entry.js +1 -0
  63. package/dist/twilight-components/p-648661c8.entry.js +1 -0
  64. package/dist/twilight-components/p-93c3ac79.js +1 -0
  65. package/dist/twilight-components/p-9bc28e0c.js +1 -0
  66. package/dist/twilight-components/p-a923a51e.entry.js +1 -0
  67. package/dist/twilight-components/p-bc278b0e.entry.js +1 -0
  68. package/dist/twilight-components/p-cb1c59a2.js +1 -0
  69. package/dist/twilight-components/p-fa04c4b6.entry.js +1 -0
  70. package/dist/twilight-components/p-fa2f0e64.entry.js +1 -0
  71. package/dist/twilight-components/twilight-components.css +1 -3
  72. package/dist/twilight-components/twilight-components.esm.js +1 -125
  73. package/dist/types/components/salla-button/salla-button.d.ts +3 -2
  74. package/dist/types/components/salla-localization/salla-localization.d.ts +8 -0
  75. package/dist/types/components/salla-login/salla-login.d.ts +39 -0
  76. package/dist/types/components/salla-modal/salla-modal.d.ts +12 -4
  77. package/dist/types/components/salla-offer/salla-offer.d.ts +8 -0
  78. package/dist/types/components/salla-rating/salla-rating.d.ts +17 -2
  79. package/dist/types/components/salla-verify/salla-verify.d.ts +16 -6
  80. package/dist/types/components.d.ts +94 -8
  81. package/package.json +2 -1
  82. package/dist/twilight-components/app-globals-0f993ce5.js +0 -3
  83. package/dist/twilight-components/css-shim-a64b8820.js +0 -4
  84. package/dist/twilight-components/dom-d08ba8aa.js +0 -73
  85. package/dist/twilight-components/index-8966d27f.js +0 -3010
  86. package/dist/twilight-components/salla-button.entry.js +0 -73
  87. package/dist/twilight-components/salla-localization.entry.js +0 -73
  88. package/dist/twilight-components/salla-login-4d620368.js +0 -12
  89. package/dist/twilight-components/salla-login.entry.js +0 -2
  90. package/dist/twilight-components/salla-modal.entry.js +0 -91
  91. package/dist/twilight-components/salla-search.entry.js +0 -3
  92. package/dist/twilight-components/salla-verify.entry.js +0 -92
  93. package/dist/twilight-components/shadow-css-bc14d9fd.js +0 -389
@@ -1,125 +1 @@
1
- import { B as BUILD, c as consoleDevInfo, p as plt, w as win, H, d as doc, N as NAMESPACE, a as promiseResolve, b as bootstrapLazy } from './index-8966d27f.js';
2
- import { g as globalScripts } from './app-globals-0f993ce5.js';
3
-
4
- /*
5
- Stencil Client Patch Browser v2.8.1 | MIT Licensed | https://stenciljs.com
6
- */
7
- const getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`;
8
- const patchBrowser = () => {
9
- // NOTE!! This fn cannot use async/await!
10
- if (BUILD.isDev && !BUILD.isTesting) {
11
- consoleDevInfo('Running in development mode.');
12
- }
13
- if (BUILD.cssVarShim) {
14
- // shim css vars
15
- plt.$cssShim$ = win.__cssshim;
16
- }
17
- if (BUILD.cloneNodeFix) {
18
- // opted-in to polyfill cloneNode() for slot polyfilled components
19
- patchCloneNodeFix(H.prototype);
20
- }
21
- if (BUILD.profile && !performance.mark) {
22
- // not all browsers support performance.mark/measure (Safari 10)
23
- performance.mark = performance.measure = () => {
24
- /*noop*/
25
- };
26
- performance.getEntriesByName = () => [];
27
- }
28
- // @ts-ignore
29
- const scriptElm = BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim
30
- ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\/${NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) ||
31
- s.getAttribute('data-stencil-namespace') === NAMESPACE)
32
- : null;
33
- const importMeta = import.meta.url;
34
- const opts = BUILD.scriptDataOpts ? scriptElm['data-opts'] || {} : {};
35
- if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {
36
- // Safari < v11 support: This IF is true if it's Safari below v11.
37
- // This fn cannot use async/await since Safari didn't support it until v11,
38
- // however, Safari 10 did support modules. Safari 10 also didn't support "nomodule",
39
- // so both the ESM file and nomodule file would get downloaded. Only Safari
40
- // has 'onbeforeload' in the script, and "history.scrollRestoration" was added
41
- // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.
42
- // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.
43
- return {
44
- then() {
45
- /* promise noop */
46
- },
47
- };
48
- }
49
- if (!BUILD.safari10 && importMeta !== '') {
50
- opts.resourcesUrl = new URL('.', importMeta).href;
51
- }
52
- else if (BUILD.dynamicImportShim || BUILD.safari10) {
53
- opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;
54
- if (BUILD.dynamicImportShim) {
55
- patchDynamicImport(opts.resourcesUrl, scriptElm);
56
- }
57
- if (BUILD.dynamicImportShim && !win.customElements) {
58
- // module support, but no custom elements support (Old Edge)
59
- // @ts-ignore
60
- return import(/* webpackChunkName: "polyfills-dom" */ './dom-d08ba8aa.js').then(() => opts);
61
- }
62
- }
63
- return promiseResolve(opts);
64
- };
65
- const patchDynamicImport = (base, orgScriptElm) => {
66
- const importFunctionName = getDynamicImportFunction(NAMESPACE);
67
- try {
68
- // test if this browser supports dynamic imports
69
- // There is a caching issue in V8, that breaks using import() in Function
70
- // By generating a random string, we can workaround it
71
- // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info
72
- win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);
73
- }
74
- catch (e) {
75
- // this shim is specifically for browsers that do support "esm" imports
76
- // however, they do NOT support "dynamic" imports
77
- // basically this code is for old Edge, v18 and below
78
- const moduleMap = new Map();
79
- win[importFunctionName] = (src) => {
80
- const url = new URL(src, base).href;
81
- let mod = moduleMap.get(url);
82
- if (!mod) {
83
- const script = doc.createElement('script');
84
- script.type = 'module';
85
- script.crossOrigin = orgScriptElm.crossOrigin;
86
- script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {
87
- type: 'application/javascript',
88
- }));
89
- mod = new Promise((resolve) => {
90
- script.onload = () => {
91
- resolve(win[importFunctionName].m);
92
- script.remove();
93
- };
94
- });
95
- moduleMap.set(url, mod);
96
- doc.head.appendChild(script);
97
- }
98
- return mod;
99
- };
100
- }
101
- };
102
- const patchCloneNodeFix = (HTMLElementPrototype) => {
103
- const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;
104
- HTMLElementPrototype.cloneNode = function (deep) {
105
- if (this.nodeName === 'TEMPLATE') {
106
- return nativeCloneNodeFn.call(this, deep);
107
- }
108
- const clonedNode = nativeCloneNodeFn.call(this, false);
109
- const srcChildNodes = this.childNodes;
110
- if (deep) {
111
- for (let i = 0; i < srcChildNodes.length; i++) {
112
- // Node.ATTRIBUTE_NODE === 2, and checking because IE11
113
- if (srcChildNodes[i].nodeType !== 2) {
114
- clonedNode.appendChild(srcChildNodes[i].cloneNode(true));
115
- }
116
- }
117
- }
118
- return clonedNode;
119
- };
120
- };
121
-
122
- patchBrowser().then(options => {
123
- globalScripts();
124
- return bootstrapLazy([["salla-button",[[4,"salla-button",{"btnStyle":[513,"btn-style"],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"load":[64],"stop":[64],"disable":[64],"enable":[64]}]]],["salla-modal",[[4,"salla-modal",{"error":[4],"success":[4],"isClosable":[1028,"is-closable"],"modalWidth":[513,"modal-width"],"visible":[516],"subTitleFirst":[4,"sub-title-first"],"subTitle":[1,"sub-title"],"icon":[1],"imageIcon":[1,"image-icon"],"show":[64],"hide":[64],"setTitle":[64]}]]],["salla-branches",[[4,"salla-branches",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}]]],["salla-localization",[[4,"salla-localization",{"languagesTitle":[1,"languages-title"],"currenciesTitle":[1,"currencies-title"],"ok":[1],"show":[64],"hide":[64],"submit":[64]}]]],["salla-product-availability",[[4,"salla-product-availability",{"channels":[1],"buttonText":[1,"button-text"],"countryCode":[1,"country-code"],"subscribeText":[1,"subscribe-text"],"cancelText":[1,"cancel-text"],"subTitle":[1,"sub-title"],"mobileLabel":[1,"mobile-label"],"emailLabel":[1,"email-label"],"mobilePlaceholder":[1,"mobile-placeholder"],"emailPlaceholder":[1,"email-placeholder"],"productId":[2,"product-id"],"subscribedMessage":[1,"subscribed-message"],"isSubscribed":[1028,"is-subscribed"],"submit":[64]}]]],["salla-rating",[[0,"salla-rating",{"orderId":[2,"order-id"],"thanksMsg":[1,"thanks-msg"],"isStoreRating":[4,"is-store-rating"],"isProductsRating":[4,"is-products-rating"],"isShippingRating":[4,"is-shipping-rating"],"show":[64],"hide":[64]}]]],["salla-verify",[[0,"salla-verify"]]],["salla-login",[[0,"salla-login"]]],["salla-search",[[0,"salla-search",{"placeholder":[1],"noResultsText":[1,"no-results-text"],"results":[32]},[[0,"close","onModalClose"]]]]]], options);
125
- });
1
+ import{p as e,b as l}from"./p-cb1c59a2.js";(()=>{const l=import.meta.url,s={};return""!==l&&(s.resourcesUrl=new URL(".",l).href),e(s)})().then((e=>l([["p-fa2f0e64",[[0,"salla-login",{loginTypeTitle:[1,"login-type-title"],loginText:[1,"login-text"],smsLabel:[1,"sms-label"],mobileLabel:[1,"mobile-label"],emailLabel:[1,"email-label"],enterText:[1,"enter-text"],bySMSText:[1,"by-s-m-s-text"],byEmailText:[1,"by-email-text"],backText:[1,"back-text"],show:[64]},[[0,"verified","onVerified"],[0,"modalClosed","onModalClose"]]],[0,"salla-verify",{withoutModal:[4,"without-modal"],url:[1],by:[1],autoReload:[4,"auto-reload"],getCode:[64],show:[64]}],[4,"salla-button",{btnStyle:[513,"btn-style"],loading:[516],disabled:[516],loaderPosition:[1,"loader-position"],wide:[4],load:[64],stop:[64],disable:[64],enable:[64]}],[4,"salla-modal",{error:[4],success:[4],primary:[4],isClosable:[1028,"is-closable"],width:[513],visible:[516],isLoading:[1540,"is-loading"],subTitleFirst:[4,"sub-title-first"],subTitle:[1,"sub-title"],icon:[1],imageIcon:[1,"image-icon"],title:[32],show:[64],hide:[64],setTitle:[64],loading:[64],stopLoading:[64]}]]],["p-fa04c4b6",[[4,"salla-branches",{position:[1],displayAs:[1,"display-as"],browseProductsFrom:[1,"browse-products-from"],branches:[16],current:[1026],open:[32],selected:[32],isOpenedBefore:[32],show:[64],hide:[64]}]]],["p-a923a51e",[[4,"salla-localization",{languagesTitle:[1,"languages-title"],currenciesTitle:[1,"currencies-title"],ok:[1],show:[64],hide:[64],submit:[64]}]]],["p-33990e49",[[4,"salla-product-availability",{channels:[1],buttonText:[1,"button-text"],countryCode:[1,"country-code"],subscribeText:[1,"subscribe-text"],cancelText:[1,"cancel-text"],subTitle:[1,"sub-title"],mobileLabel:[1,"mobile-label"],emailLabel:[1,"email-label"],mobilePlaceholder:[1,"mobile-placeholder"],emailPlaceholder:[1,"email-placeholder"],productId:[2,"product-id"],subscribedMessage:[1,"subscribed-message"],isSubscribed:[1028,"is-subscribed"],submit:[64]}]]],["p-3cfede65",[[0,"salla-rating",{orderId:[2,"order-id"],thanksMsg:[1,"thanks-msg"],isStoreRating:[4,"is-store-rating"],isProductsRating:[4,"is-products-rating"],isShippingRating:[4,"is-shipping-rating"],show:[64],hide:[64]}]]],["p-648661c8",[[4,"salla-offer",{show:[64]}]]],["p-bc278b0e",[[0,"salla-search",{placeholder:[1],noResultsText:[1,"no-results-text"],results:[32]},[[0,"modalClosed","onModalClose"]]]]]],e)));
@@ -1,10 +1,11 @@
1
1
  export declare class SallaButton {
2
2
  constructor();
3
+ private text;
3
4
  host: HTMLElement;
4
- btnStyle: string;
5
+ btnStyle: 'primary' | 'outline' | 'outline-primary' | 'danger';
5
6
  loading: boolean;
6
7
  disabled: boolean;
7
- loaderPosition: string;
8
+ loaderPosition: 'start' | 'end' | 'center' | 'before';
8
9
  wide: boolean;
9
10
  load(): Promise<HTMLElement>;
10
11
  stop(): Promise<HTMLElement>;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @slot header - The top of the modal.
3
+ * @slot footer - Replaces the bottom button.
4
+ * @slot language - Replaces language label, has replaceable props `{name}`, `{code}`, `{country_code}`.
5
+ * @slot currency - Replaces currency label, has replaceable props `{name}`, `{code}`, `{country_code}`.
6
+ */
1
7
  export declare class SallaLocalization {
2
8
  constructor();
3
9
  private modal;
@@ -12,6 +18,8 @@ export declare class SallaLocalization {
12
18
  host: HTMLElement;
13
19
  show(): Promise<HTMLElement>;
14
20
  hide(): Promise<HTMLElement>;
21
+ private onChangeCurrency;
22
+ private onChangeLanguage;
15
23
  submit(): Promise<void>;
16
24
  render(): any;
17
25
  /**
@@ -1,3 +1,42 @@
1
1
  export declare class SallaLogin {
2
+ constructor();
3
+ private modal;
4
+ private tab1;
5
+ private tab2;
6
+ private tab3;
7
+ private tab4;
8
+ private tab5;
9
+ private regMobile;
10
+ private regEmail;
11
+ private regMobileBlock;
12
+ private regEmailBlock;
13
+ private mobile;
14
+ private email;
15
+ private firstName;
16
+ private lastName;
17
+ private regType;
18
+ private readonly title;
19
+ host: HTMLElement;
20
+ loginTypeTitle: string;
21
+ loginText: string;
22
+ smsLabel: string;
23
+ mobileLabel: string;
24
+ emailLabel: string;
25
+ enterText: string;
26
+ bySMSText: string;
27
+ byEmailText: string;
28
+ backText: string;
29
+ /**
30
+ * @param {CustomEvent|{details:{case:'new_customer'|'authenticated', redirect_url:string|null}}} event
31
+ */
32
+ onVerified(event: any): any;
33
+ onModalClose(): void;
34
+ show(): Promise<HTMLElement>;
35
+ private showTab;
36
+ private loginByEmail;
37
+ private loginBySMS;
38
+ private typing;
39
+ private newUser;
2
40
  render(): any;
41
+ componentDidRender(): void;
3
42
  }
@@ -1,24 +1,32 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
+ /**
3
+ * @slot body - The content of modal
4
+ * @slot footer - The footer of modal
5
+ */
2
6
  export declare class SallaModal {
3
7
  constructor();
4
8
  error: boolean;
5
9
  success: boolean;
10
+ primary: boolean;
6
11
  isClosable: boolean;
7
- modalWidth: string;
12
+ width: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
8
13
  visible: boolean;
14
+ isLoading: boolean;
9
15
  subTitleFirst: boolean;
10
16
  subTitle: string;
11
17
  icon: string;
12
18
  imageIcon: string;
13
- private title;
19
+ title: string;
14
20
  private overlay;
15
21
  host: HTMLElement;
16
- ready: EventEmitter;
17
- close: EventEmitter;
22
+ modalOpened: EventEmitter;
23
+ modalClosed: EventEmitter;
18
24
  handleVisible(newValue: boolean): void;
19
25
  show(): Promise<HTMLElement>;
20
26
  hide(): Promise<HTMLElement>;
21
27
  setTitle(title: any): Promise<HTMLElement>;
28
+ loading(): Promise<HTMLElement>;
29
+ stopLoading(): Promise<HTMLElement>;
22
30
  private toggleModal;
23
31
  private closeModal;
24
32
  render(): any;
@@ -0,0 +1,8 @@
1
+ export declare class SallaOffer {
2
+ private modal;
3
+ host: HTMLElement;
4
+ constructor();
5
+ show(offerId: number): Promise<void>;
6
+ render(): any;
7
+ componentDidLoad(): void;
8
+ }
@@ -1,10 +1,25 @@
1
1
  export declare class SallaRating {
2
2
  constructor();
3
3
  order: any;
4
+ /**
5
+ * Ratted order Id
6
+ */
4
7
  orderId: number;
8
+ /**
9
+ * Display this message after sending user feedback
10
+ */
5
11
  thanksMsg: string;
12
+ /**
13
+ * Set to true to display store rating step
14
+ */
6
15
  isStoreRating: boolean;
16
+ /**
17
+ * Set to true to display products rating step
18
+ */
7
19
  isProductsRating: boolean;
20
+ /**
21
+ * Set to true to display shipping rating step
22
+ */
8
23
  isShippingRating: boolean;
9
24
  private ratingChain;
10
25
  private stepsCount;
@@ -16,10 +31,10 @@ export declare class SallaRating {
16
31
  componentWillLoad(): void;
17
32
  componentDidRender(): void;
18
33
  initiateRating(): void;
19
- private getData;
20
34
  private handleWizard;
21
35
  private showActiveStep;
22
36
  private setModalHeight;
37
+ private handleSubmitRating;
23
38
  private starsRating;
24
39
  private highlightSelectedStars;
25
40
  private sendRating;
@@ -30,5 +45,5 @@ export declare class SallaRating {
30
45
  renderShippingRating(): any;
31
46
  renderProductsRating(): any;
32
47
  renderThanksView(): any;
33
- getStarsRating(): any;
48
+ getStarsRating(size: any): any;
34
49
  }
@@ -1,6 +1,5 @@
1
+ import { EventEmitter } from '../../stencil-public-runtime';
1
2
  export declare class SallaVerify {
2
- constructor();
3
- host: HTMLElement;
4
3
  private modal;
5
4
  private code;
6
5
  private btn;
@@ -8,12 +7,23 @@ export declare class SallaVerify {
8
7
  private timer;
9
8
  private resend;
10
9
  private otpInputs;
11
- private mobile;
12
- private country_code;
13
- private show;
10
+ private data;
11
+ host: HTMLElement;
12
+ /**
13
+ * Should render component without modal
14
+ */
15
+ withoutModal: boolean;
16
+ url: string;
17
+ by: string;
18
+ autoReload: boolean;
19
+ verified: EventEmitter;
20
+ constructor();
21
+ getCode(): Promise<string>;
22
+ show(data: any): Promise<any>;
14
23
  private toggleOTPSubmit;
15
24
  private resendTimer;
16
- private submit;
17
25
  private resendCode;
26
+ private submit;
18
27
  render(): any;
28
+ private myBody;
19
29
  }
@@ -16,12 +16,12 @@ export namespace Components {
16
16
  "show": () => Promise<HTMLElement>;
17
17
  }
18
18
  interface SallaButton {
19
- "btnStyle": string;
19
+ "btnStyle": 'primary' | 'outline' | 'outline-primary' | 'danger';
20
20
  "disable": () => Promise<void>;
21
21
  "disabled": boolean;
22
22
  "enable": () => Promise<void>;
23
23
  "load": () => Promise<HTMLElement>;
24
- "loaderPosition": string;
24
+ "loaderPosition": 'start' | 'end' | 'center' | 'before';
25
25
  "loading": boolean;
26
26
  "stop": () => Promise<HTMLElement>;
27
27
  "wide": boolean;
@@ -35,6 +35,16 @@ export namespace Components {
35
35
  "submit": () => Promise<void>;
36
36
  }
37
37
  interface SallaLogin {
38
+ "backText": string;
39
+ "byEmailText": string;
40
+ "bySMSText": string;
41
+ "emailLabel": string;
42
+ "enterText": string;
43
+ "loginText": string;
44
+ "loginTypeTitle": string;
45
+ "mobileLabel": string;
46
+ "show": () => Promise<HTMLElement>;
47
+ "smsLabel": string;
38
48
  }
39
49
  interface SallaModal {
40
50
  "error": boolean;
@@ -42,13 +52,20 @@ export namespace Components {
42
52
  "icon": string;
43
53
  "imageIcon": string;
44
54
  "isClosable": boolean;
45
- "modalWidth": string;
55
+ "isLoading": boolean;
56
+ "loading": () => Promise<HTMLElement>;
57
+ "primary": boolean;
46
58
  "setTitle": (title: any) => Promise<HTMLElement>;
47
59
  "show": () => Promise<HTMLElement>;
60
+ "stopLoading": () => Promise<HTMLElement>;
48
61
  "subTitle": string;
49
62
  "subTitleFirst": boolean;
50
63
  "success": boolean;
51
64
  "visible": boolean;
65
+ "width": 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
66
+ }
67
+ interface SallaOffer {
68
+ "show": (offerId: number) => Promise<void>;
52
69
  }
53
70
  interface SallaProductAvailability {
54
71
  "buttonText": string;
@@ -68,11 +85,26 @@ export namespace Components {
68
85
  }
69
86
  interface SallaRating {
70
87
  "hide": () => Promise<HTMLElement>;
88
+ /**
89
+ * Set to true to display products rating step
90
+ */
71
91
  "isProductsRating": boolean;
92
+ /**
93
+ * Set to true to display shipping rating step
94
+ */
72
95
  "isShippingRating": boolean;
96
+ /**
97
+ * Set to true to display store rating step
98
+ */
73
99
  "isStoreRating": boolean;
100
+ /**
101
+ * Ratted order Id
102
+ */
74
103
  "orderId": number;
75
104
  "show": () => Promise<HTMLElement>;
105
+ /**
106
+ * Display this message after sending user feedback
107
+ */
76
108
  "thanksMsg": string;
77
109
  }
78
110
  interface SallaSearch {
@@ -86,6 +118,15 @@ export namespace Components {
86
118
  "placeholder": string;
87
119
  }
88
120
  interface SallaVerify {
121
+ "autoReload": boolean;
122
+ "by": string;
123
+ "getCode": () => Promise<string>;
124
+ "show": (data: any) => Promise<any>;
125
+ "url": string;
126
+ /**
127
+ * Should render component without modal
128
+ */
129
+ "withoutModal": boolean;
89
130
  }
90
131
  }
91
132
  declare global {
@@ -119,6 +160,12 @@ declare global {
119
160
  prototype: HTMLSallaModalElement;
120
161
  new (): HTMLSallaModalElement;
121
162
  };
163
+ interface HTMLSallaOfferElement extends Components.SallaOffer, HTMLStencilElement {
164
+ }
165
+ var HTMLSallaOfferElement: {
166
+ prototype: HTMLSallaOfferElement;
167
+ new (): HTMLSallaOfferElement;
168
+ };
122
169
  interface HTMLSallaProductAvailabilityElement extends Components.SallaProductAvailability, HTMLStencilElement {
123
170
  }
124
171
  var HTMLSallaProductAvailabilityElement: {
@@ -149,6 +196,7 @@ declare global {
149
196
  "salla-localization": HTMLSallaLocalizationElement;
150
197
  "salla-login": HTMLSallaLoginElement;
151
198
  "salla-modal": HTMLSallaModalElement;
199
+ "salla-offer": HTMLSallaOfferElement;
152
200
  "salla-product-availability": HTMLSallaProductAvailabilityElement;
153
201
  "salla-rating": HTMLSallaRatingElement;
154
202
  "salla-search": HTMLSallaSearchElement;
@@ -164,9 +212,9 @@ declare namespace LocalJSX {
164
212
  "position"?: string;
165
213
  }
166
214
  interface SallaButton {
167
- "btnStyle"?: string;
215
+ "btnStyle"?: 'primary' | 'outline' | 'outline-primary' | 'danger';
168
216
  "disabled"?: boolean;
169
- "loaderPosition"?: string;
217
+ "loaderPosition"?: 'start' | 'end' | 'center' | 'before';
170
218
  "loading"?: boolean;
171
219
  "wide"?: boolean;
172
220
  }
@@ -176,19 +224,32 @@ declare namespace LocalJSX {
176
224
  "ok"?: string;
177
225
  }
178
226
  interface SallaLogin {
227
+ "backText"?: string;
228
+ "byEmailText"?: string;
229
+ "bySMSText"?: string;
230
+ "emailLabel"?: string;
231
+ "enterText"?: string;
232
+ "loginText"?: string;
233
+ "loginTypeTitle"?: string;
234
+ "mobileLabel"?: string;
235
+ "smsLabel"?: string;
179
236
  }
180
237
  interface SallaModal {
181
238
  "error"?: boolean;
182
239
  "icon"?: string;
183
240
  "imageIcon"?: string;
184
241
  "isClosable"?: boolean;
185
- "modalWidth"?: string;
186
- "onClose"?: (event: CustomEvent<any>) => void;
187
- "onReady"?: (event: CustomEvent<any>) => void;
242
+ "isLoading"?: boolean;
243
+ "onModalClosed"?: (event: CustomEvent<any>) => void;
244
+ "onModalOpened"?: (event: CustomEvent<any>) => void;
245
+ "primary"?: boolean;
188
246
  "subTitle"?: string;
189
247
  "subTitleFirst"?: boolean;
190
248
  "success"?: boolean;
191
249
  "visible"?: boolean;
250
+ "width"?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
251
+ }
252
+ interface SallaOffer {
192
253
  }
193
254
  interface SallaProductAvailability {
194
255
  "buttonText"?: string;
@@ -206,10 +267,25 @@ declare namespace LocalJSX {
206
267
  "subscribedMessage"?: string;
207
268
  }
208
269
  interface SallaRating {
270
+ /**
271
+ * Set to true to display products rating step
272
+ */
209
273
  "isProductsRating"?: boolean;
274
+ /**
275
+ * Set to true to display shipping rating step
276
+ */
210
277
  "isShippingRating"?: boolean;
278
+ /**
279
+ * Set to true to display store rating step
280
+ */
211
281
  "isStoreRating"?: boolean;
282
+ /**
283
+ * Ratted order Id
284
+ */
212
285
  "orderId"?: number;
286
+ /**
287
+ * Display this message after sending user feedback
288
+ */
213
289
  "thanksMsg"?: string;
214
290
  }
215
291
  interface SallaSearch {
@@ -223,6 +299,14 @@ declare namespace LocalJSX {
223
299
  "placeholder"?: string;
224
300
  }
225
301
  interface SallaVerify {
302
+ "autoReload"?: boolean;
303
+ "by"?: string;
304
+ "onVerified"?: (event: CustomEvent<any>) => void;
305
+ "url"?: string;
306
+ /**
307
+ * Should render component without modal
308
+ */
309
+ "withoutModal"?: boolean;
226
310
  }
227
311
  interface IntrinsicElements {
228
312
  "salla-branches": SallaBranches;
@@ -230,6 +314,7 @@ declare namespace LocalJSX {
230
314
  "salla-localization": SallaLocalization;
231
315
  "salla-login": SallaLogin;
232
316
  "salla-modal": SallaModal;
317
+ "salla-offer": SallaOffer;
233
318
  "salla-product-availability": SallaProductAvailability;
234
319
  "salla-rating": SallaRating;
235
320
  "salla-search": SallaSearch;
@@ -245,6 +330,7 @@ declare module "@stencil/core" {
245
330
  "salla-localization": LocalJSX.SallaLocalization & JSXBase.HTMLAttributes<HTMLSallaLocalizationElement>;
246
331
  "salla-login": LocalJSX.SallaLogin & JSXBase.HTMLAttributes<HTMLSallaLoginElement>;
247
332
  "salla-modal": LocalJSX.SallaModal & JSXBase.HTMLAttributes<HTMLSallaModalElement>;
333
+ "salla-offer": LocalJSX.SallaOffer & JSXBase.HTMLAttributes<HTMLSallaOfferElement>;
248
334
  "salla-product-availability": LocalJSX.SallaProductAvailability & JSXBase.HTMLAttributes<HTMLSallaProductAvailabilityElement>;
249
335
  "salla-rating": LocalJSX.SallaRating & JSXBase.HTMLAttributes<HTMLSallaRatingElement>;
250
336
  "salla-search": LocalJSX.SallaSearch & JSXBase.HTMLAttributes<HTMLSallaSearchElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight-components",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "twilight",
@@ -67,6 +67,7 @@
67
67
  "typescript": "^4.4.3"
68
68
  },
69
69
  "dependencies": {
70
+ "@salla.sa/twilight": "^2.0.36",
70
71
  "store": "^2.0.12"
71
72
  }
72
73
  }
@@ -1,3 +0,0 @@
1
- const globalScripts = () => {};
2
-
3
- export { globalScripts as g };
@@ -1,4 +0,0 @@
1
- /*
2
- Stencil Client Patch Esm v2.8.1 | MIT Licensed | https://stenciljs.com
3
- */
4
- var __assign=undefined&&undefined.__assign||function(){return (__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector="";};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r);}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE;}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return "\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@";function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return {start:s,end:s+n[0].length}}return null}var VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return {start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t);}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else {if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s);}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value;}));}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0);})),!t)return "break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return [];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t});})),t++;})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o});}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.substr(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement;}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors);})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return ":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return {original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return !1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t));}));}function reScope(e,t){var r=e.template.map((function(r){return "string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\."+t,"."+r)}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t);}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t);})).observe(document.head,{childList:!0});}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove();}})).catch((function(e){console.error(e);}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1;}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}));}));})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal();}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal();},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t=s.scopeId+"-"+this.count,o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e);},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n);}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes);},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document));}("undefined"!=typeof window&&window);