@sortter/sortter-resellers-web-component 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## 1.0.0 (2026-01-12)
2
+
3
+ ### Features
@@ -0,0 +1,79 @@
1
+ ## [1.3.1](https://github.com/meikooy/sortter-resellers-web-component/compare/1.3.0...1.3.1) (2025-04-29)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **README:** Updated README.md ([a58df1a](https://github.com/meikooy/sortter-resellers-web-component/commit/a58df1a7576376d7c4cc669b6923a3357bf52187))
6
+ * **README:** Updated README.md ([d1e73c8](https://github.com/meikooy/sortter-resellers-web-component/commit/d1e73c8b723d278062020b6725ff0c57e33182f2))
7
+
8
+ ## [1.3.0](https://github.com/meikooy/sortter-resellers-web-component/compare/1.2.3...1.3.0) (2025-04-28)
9
+
10
+ ### Features
11
+
12
+ * **redirect:** Refactored redirection handling ([1af3347](https://github.com/meikooy/sortter-resellers-web-component/commit/1af3347611a396b757321787dddda1c29f0f3db3))
13
+
14
+ ## [1.2.3](https://github.com/meikooy/sortter-resellers-web-component/compare/1.2.2...1.2.3) (2025-04-09)
15
+
16
+ ### Bug Fixes
17
+
18
+ * **layout:** Fixed bug with compiler not building container queries ([0fd6e5b](https://github.com/meikooy/sortter-resellers-web-component/commit/0fd6e5bf2a625abac80202123f2e980a340a9172))
19
+
20
+ ## [1.2.2](https://github.com/meikooy/sortter-resellers-web-component/compare/1.2.1...1.2.2) (2025-04-09)
21
+
22
+ ### Bug Fixes
23
+
24
+ * **layout:** Fixed strict layout to fit into 600px height ([c4162be](https://github.com/meikooy/sortter-resellers-web-component/commit/c4162beef293841175ba0ab1c257ea69644ddda1))
25
+
26
+ ## [1.2.1](https://github.com/meikooy/sortter-resellers-web-component/compare/1.2.0...1.2.1) (2025-04-09)
27
+
28
+ ### Bug Fixes
29
+
30
+ * **readme:** Updated readme ([37ff1f7](https://github.com/meikooy/sortter-resellers-web-component/commit/37ff1f710ea5de8c9003701db9fe5d508a886a4c))
31
+
32
+ ## [1.1.4](https://github.com/meikooy/sortter-resellers-web-component/compare/1.1.3...1.1.4) (2025-03-24)
33
+
34
+ ### Bug Fixes
35
+
36
+ * **input:** Fixed input appearance and max-value of loan time ([39fe264](https://github.com/meikooy/sortter-resellers-web-component/commit/39fe2649e2857ae42fe53de2de3f2e672446000e))
37
+
38
+ ## [1.1.3](https://github.com/meikooy/sortter-resellers-web-component/compare/1.1.2...1.1.3) (2025-03-21)
39
+
40
+ ### Bug Fixes
41
+
42
+ * **redirect:** Fixed broken redirect ([b89361e](https://github.com/meikooy/sortter-resellers-web-component/commit/b89361e43fb918e721dc3c7870d600764bf881ec))
43
+ * **redirect:** Fixed broken redirect ([1d5eeed](https://github.com/meikooy/sortter-resellers-web-component/commit/1d5eeedba1b0a7a48fd223f043ab0e7f012d8eaa))
44
+
45
+ ## [1.1.2](https://github.com/meikooy/sortter-resellers-web-component/compare/1.1.1...1.1.2) (2025-03-21)
46
+
47
+ ### Bug Fixes
48
+
49
+ * **error:** Added error handling ([137a134](https://github.com/meikooy/sortter-resellers-web-component/commit/137a1340261ac4eb50f4fd687de184cefde2ccb0))
50
+ * **general:** Changed version number and added error handling ([2fb4453](https://github.com/meikooy/sortter-resellers-web-component/commit/2fb445359c4d5f95ce2a987e74a9e03f2e1978be))
51
+ * **version:** Changed version number ([94fc028](https://github.com/meikooy/sortter-resellers-web-component/commit/94fc028e22a2d5502af1916ecd8c72e432a5914b))
52
+
53
+ ## [1.1.1](https://github.com/meikooy/sortter-resellers-web-component/compare/1.1.0...1.1.1) (2025-03-18)
54
+
55
+ ### Bug Fixes
56
+
57
+ * removed some css ([bfcf987](https://github.com/meikooy/sortter-resellers-web-component/commit/bfcf98742f90346b8f0841b03703ff084c08914b))
58
+
59
+ ## 1.1.0 (2025-03-18)
60
+ - Added possibility to customize theme with colors, fonts and images
61
+ - Added localization for FI and EE
62
+ - Fixed inputs to be inputs
63
+ - Changed loan calculation rules
64
+
65
+ ## 1.0.5 (2024-10-22)
66
+ - Added possibility to set b2b and b2c loan max amounts using attributes. Defaults to 10 000 000 for b2b and 70 000 for b2c.
67
+
68
+ ## 1.0.4 (2024-05-13)
69
+ - Added a11y features to inputs and texts
70
+
71
+ ## 1.0.3 (2024-03-31)
72
+ - Fixed breaking problem: file name changed to sortter-reseller-form.js
73
+
74
+ ## 1.0.2 (2024-03-31)
75
+ - Added clickable amount input
76
+ - Added parser for __gtm_campaign_url cookie if exists in the browser. The value of the cookie will be added to the redirect url.
77
+ ## 1.0.0 (2024-02-09)
78
+
79
+ ### Features
package/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # Sortter Resellers Web Component
2
+
3
+ The sortter-reseller-form-web-component is a custom web component designed to integrate seamlessly with Sortter Affiliates. Built using Lit, this component allows you to easily embed Sortter's loan application form into your website or application.
4
+ Installation
5
+
6
+ You can load the script in directly in your html
7
+
8
+ ```html
9
+ <script type="module" src="< path-to-the-script-file >"></script>
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ To use the Sortter Form Web Component, you can include the <sortter-reseller-form> tag in your HTML code, along with attributes to customize the form according to your needs.
15
+
16
+ ```html
17
+ <sortter-reseller-form
18
+ alternativeUrl="string | null"
19
+ b2cUrl="string | null"
20
+ b2bUrl="string | null"
21
+ defaultLoanType="personal | corporate"
22
+ privacyPolicyUrl="string"
23
+ privacyPolicyText="string"
24
+ splashLogo="url"
25
+ stage="test | null"
26
+ theme="'custom || Sortter || '' "
27
+ type="both | personal | corporate"
28
+ utm="string"
29
+ titleColor="string | null"
30
+ labelColor="string | null"
31
+ highLightColor="string | null"
32
+ buttonColor="string | null"
33
+ logoSrc="string | null"
34
+ logoLink="string | null"
35
+ bannerLink="string | null"
36
+ fontFamily="string | null"
37
+ locale="'fi' || 'ee' || ''"
38
+ layout="'300' || '480' || ''"
39
+ ></sortter-reseller-form>
40
+ ```
41
+
42
+ ## Available Attributes
43
+
44
+ ### General Functionality
45
+ - **alternativeUrl**: If redirect does not work and you want to use an alternative location, define an alternative URL. Defaults to `redirectUrl`.
46
+ - **b2cUrl**: URL redirect to the business-to-customer link. This is defined by default but can be overwritten if needed.
47
+ - **b2bUrl**: URL redirect to the business-to-business link. This is defined by default but can be overwritten if needed.
48
+ - **utm**: You can include a UTM query in this attribute. It will be added to the end of `b2cUrl` or `b2bUrl` as is.
49
+ - **stage**: Use `'test'` if you want to see where the user would be redirected without actually redirecting them.
50
+ - **type**: Define what loan types you want to include (`both`, `personal`, or `corporate`).
51
+ - **defaultLoanType**: Works only when the `type` attribute is set to "both". It defines which loan type will be shown first by default.
52
+
53
+ ### UI Customization
54
+ - **theme**: Defaults to "Sortter". Use `'custom'` to return without styles.
55
+ - **titleColor**: Define the title color with a hex color code. This is defined by default but can be overwritten if needed.
56
+ - **labelColor**: Define the label color with a hex color code. This is defined by default but can be overwritten if needed.
57
+ - **highLightColor**: Define the highlight color with a hex color code. Affects the slider, slider inputs, and top selector. This is defined by default but can be overwritten if needed.
58
+ - **buttonColor**: Define the button color with a hex color code. This is defined by default but can be overwritten if needed.
59
+ - **fontFamily**: Define the font family used for the whole component. This is defined by default but can be overwritten if needed.
60
+ - **locale**: Use `'fi'` or `'ee'` as the locale. This is defined as `'fi'` by default but can be overwritten if needed.
61
+ - **layout**: Use `'300'` or `'480'` as the layout. This defines the width and minimum height of the component (`300`: width 300px, min height 600px; `480`: width 480px, min height 600px). Leave empty to handle default width and height.
62
+
63
+ ### Branding and Logos
64
+ - **logoSrc**: Replace the logo with an image link. This is defined by default but can be overwritten if needed.
65
+ - **logoLink**: Add a link to the logo.
66
+ - **hideLogo**: Hides the logo from the form.
67
+ - **bannerLink**: Add a banner on top of the slider with an image link. By default, there is no banner.
68
+
69
+ ### Privacy and Splash Screen
70
+ - **privacyPolicyUrl**: URL to your privacy policy page.
71
+ - **privacyPolicyText**: Text to display for the privacy policy link.
72
+ - **hidePrivacyPolicy**: Hides the privacy policy section.
73
+ - **hideSplashScreen**: Hides the splash screen and redirects directly to the URL set.
74
+ - **splashLogo**: URL to the splash logo image that will be displayed on the splash screen.
75
+
76
+ ### Loan Settings
77
+ - **b2bLoanAmount**: Default value for the loan in B2B.
78
+ - **b2bLoanPeriod**: Default value for the loan period in B2B.
79
+ - **b2bLoanMax**: Max value of the loan for B2B. Defaults to `10_000_000`.
80
+ - **b2cLoanAmount**: Default value for the loan in B2C.
81
+ - **b2cLoanPeriod**: Default value for the loan period in B2C.
82
+ - **b2cLoanMax**: Max value of the loan for B2C. Defaults to `70_000`.
83
+
84
+ ## Development
85
+
86
+ **Requirements**
87
+ - Node v18
88
+ - Yarn
89
+
90
+ **Development**
91
+ - `yarn install`
92
+ - `yarn dev`
93
+
94
+ ## Lit.js
95
+ Read more about lit from https://lit.dev/docs/
@@ -0,0 +1,29 @@
1
+ {
2
+
3
+ "$schema": "https://raw.githubusercontent.com/lit/lit/main/packages/localize-tools/config.schema.json",
4
+
5
+ "sourceLocale": "fi",
6
+
7
+ "targetLocales": ["fi", "ee"],
8
+
9
+ "tsConfig": "./tsconfig.json",
10
+
11
+ "output": {
12
+
13
+ "mode": "runtime",
14
+
15
+ "outputDir": "./src/generated/locales",
16
+
17
+ "localeCodesModule": "./src/generated/locale-codes.ts"
18
+
19
+ },
20
+
21
+ "interchange": {
22
+
23
+ "format": "xliff",
24
+
25
+ "xliffDir": "./xliff/"
26
+
27
+ }
28
+
29
+ }
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@sortter/sortter-resellers-web-component",
3
+ "version": "1.0.0",
4
+ "main": "index.js",
5
+ "license": "MIT",
6
+ "contributors": [
7
+ {
8
+ "name": "Aaro Varjonen"
9
+ },
10
+ {
11
+ "name": "Pentti Sunila"
12
+ }
13
+ ],
14
+ "scripts": {
15
+ "dev": "vite",
16
+ "lint": "eslint . --ext .ts",
17
+ "build": "vite build"
18
+ },
19
+ "engines": {
20
+ "node": "^18"
21
+ },
22
+ "dependencies": {
23
+ "@lit/localize": "^0.12.2",
24
+ "@rollup/plugin-node-resolve": "^16.0.1",
25
+ "lit": "^3.2.1",
26
+ "rollup-plugin-minify-html-literals": "^1.2.6",
27
+ "yarn": "^1.22.21"
28
+ },
29
+ "devDependencies": {
30
+ "@lit/localize-tools": "^0.8.0",
31
+ "@meiko/eslint-config-typescript": "^1.8.0",
32
+ "@types/eslint": "^9.0.0",
33
+ "@types/node": "^22.0.0",
34
+ "@typescript-eslint/eslint-plugin": "^7.0.0",
35
+ "@typescript-eslint/parser": "^7.0.0",
36
+ "eslint": "^8.41.0",
37
+ "eslint-config-airbnb-base": "^15.0.0",
38
+ "eslint-config-airbnb-typescript": "^18.0.0",
39
+ "eslint-import-resolver-typescript": "^4.0.0",
40
+ "eslint-plugin-import": "^2.27.5",
41
+ "eslint-plugin-unicorn": "^55.0.0",
42
+ "typescript": "^5.0.4",
43
+ "vite": "^4.3.9"
44
+ },
45
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
46
+ }
package/xliff/ee.xlf ADDED
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3
+ <file target-language="ee" source-language="fi" original="lit-localize-inputs" datatype="plaintext">
4
+ <body>
5
+ <trans-unit id="s4e3960d90185b547">
6
+ <source>Valitse lainasumma</source>
7
+ <target>Vali laenusumma</target>
8
+ </trans-unit>
9
+ <trans-unit id="sc378fadb9b2c6fd9">
10
+ <source>Lainasumma</source>
11
+ <target>Laenusumma</target>
12
+ </trans-unit>
13
+ <trans-unit id="s827aaf43231bba43">
14
+ <source>Valitse laina-aika</source>
15
+ <target>Vali laenuperiood</target>
16
+ </trans-unit>
17
+ <trans-unit id="s186c6c97e852519d">
18
+ <source>Laina-aika</source>
19
+ <target>Laenuperiood</target>
20
+ </trans-unit>
21
+ <trans-unit id="sb30b831f0f8f43a7">
22
+ <source>Arvioitu kuukausierä</source>
23
+ <target>Kuumakse alates</target>
24
+ </trans-unit>
25
+ <trans-unit id="se19964a115c52b12">
26
+ <source>kuukautta</source>
27
+ <target>kuud</target>
28
+ </trans-unit>
29
+ </body>
30
+ </file>
31
+ </xliff>
package/xliff/fi.xlf ADDED
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3
+ <file target-language="fi" source-language="fi" original="lit-localize-inputs" datatype="plaintext">
4
+ <body>
5
+ <trans-unit id="s4e3960d90185b547">
6
+ <source>Valitse lainasumma</source>
7
+ <target>Valitse lainasumma</target>
8
+ </trans-unit>
9
+ <trans-unit id="sc378fadb9b2c6fd9">
10
+ <source>Lainasumma</source>
11
+ <target>Lainasumma</target>
12
+ </trans-unit>
13
+ <trans-unit id="s827aaf43231bba43">
14
+ <source>Valitse laina-aika</source>
15
+ <target>Valitse laina-aika</target>
16
+ </trans-unit>
17
+ <trans-unit id="s186c6c97e852519d">
18
+ <source>Laina-aika</source>
19
+ <target>Laina-aika</target>
20
+ </trans-unit>
21
+ <trans-unit id="sb30b831f0f8f43a7">
22
+ <source>Arvioitu kuukausierä</source>
23
+ <target>Arvioitu kuukausierä</target>
24
+ </trans-unit>
25
+ <trans-unit id="se19964a115c52b12">
26
+ <source>kuukautta</source>
27
+ <target>kuukautta</target>
28
+ </trans-unit>
29
+ </body>
30
+ </file>
31
+ </xliff>