@inploi/plugin-job-search 0.23.6 → 0.23.7
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/cdn/index.js +1070 -0
- package/cdn/style.css +1 -0
- package/dist/components/alerts-button.d.ts +11 -0
- package/dist/components/button.d.ts +60 -0
- package/dist/components/current-value-tag.d.ts +10 -0
- package/dist/components/error-boundary.d.ts +23 -0
- package/dist/components/filter-content.active.d.ts +74 -0
- package/dist/components/filter-section.d.ts +13 -0
- package/dist/components/filter.d.ts +23 -0
- package/dist/components/icon.d.ts +28 -0
- package/dist/components/job-card.d.ts +13 -0
- package/dist/components/job-search.d.ts +24 -0
- package/dist/components/keyword-search.d.ts +5 -0
- package/dist/components/palette-debugger.d.ts +1 -0
- package/dist/components/results-section.d.ts +20 -0
- package/dist/components/skeleton-text.d.ts +3 -0
- package/dist/components/tag.d.ts +60 -0
- package/dist/datetime-3eccae90.cjs +1 -0
- package/dist/datetime-796d4b37.js +32 -0
- package/dist/index.cjs +7 -6204
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3680 -4901
- package/dist/job-search.api.d.ts +6 -4
- package/dist/job-search.d.ts +3 -0
- package/dist/job-search.schemas.d.ts +3 -2
- package/dist/lib/cache-key.d.ts +7 -0
- package/dist/lib/cache-key.test.d.ts +1 -0
- package/dist/lib/currency.d.ts +10 -0
- package/dist/lib/currency.test.d.ts +1 -0
- package/dist/lib/datetime.d.ts +11 -0
- package/dist/lib/deep-set.d.ts +8 -0
- package/dist/lib/deep-set.test.d.ts +1 -0
- package/dist/lib/hooks.d.ts +8 -0
- package/dist/lib/match.d.ts +35 -0
- package/dist/lib/match.test.d.ts +1 -0
- package/dist/lib/translation.d.ts +44 -0
- package/dist/lib/translation.terms.d.ts +216 -0
- package/dist/lib/translation.test.d.ts +1 -0
- package/dist/lib/type-utils.d.ts +55 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/mocks/browser.d.ts +1 -0
- package/dist/mocks/handlers.d.ts +15 -0
- package/dist/plugin-job-alerts-4b46b097.cjs +1050 -0
- package/dist/plugin-job-alerts-6f8dbd69.js +5613 -0
- package/dist/style/theme.d.ts +3 -0
- package/dist/style/theme.utils.d.ts +6 -0
- package/dist/style/tokens.d.ts +149 -0
- package/dist/style.css +1 -1742
- package/dist/utils.cjs +1 -18
- package/dist/utils.js +12 -13
- package/package.json +2 -2
- package/dist/datetime-5adbbd63.cjs +0 -55
- package/dist/datetime-ef341067.js +0 -56
- package/dist/plugin-job-alerts-2ce58f09.js +0 -6040
- package/dist/plugin-job-alerts-e8471004.cjs +0 -6040
package/dist/utils.cjs
CHANGED
|
@@ -1,18 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const datetime = require("./datetime-5adbbd63.cjs");
|
|
4
|
-
const getStatefulPropertiesFromSearchParams = (properties, searchParams) => {
|
|
5
|
-
const newProperties = structuredClone(properties);
|
|
6
|
-
newProperties.forEach((property) => {
|
|
7
|
-
if (searchParams.has(property.key)) {
|
|
8
|
-
const newValue = searchParams.get(property.key);
|
|
9
|
-
if (!newValue)
|
|
10
|
-
return;
|
|
11
|
-
property.defaultValue = newValue.includes(",") ? newValue.split(",") : newValue;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
return newProperties;
|
|
15
|
-
};
|
|
16
|
-
exports.getRelativeTimeDifference = datetime.getRelativeTimeDifference;
|
|
17
|
-
exports.getSalaryAsText = datetime.getSalaryAsText;
|
|
18
|
-
exports.getStatefulPropertiesFromSearchParams = getStatefulPropertiesFromSearchParams;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./datetime-3eccae90.cjs"),s=(l,r)=>{const a=structuredClone(l);return a.forEach(t=>{if(r.has(t.key)){const e=r.get(t.key);if(!e)return;t.defaultValue=e.includes(",")?e.split(","):e}}),a};exports.getRelativeTimeDifference=i.getRelativeTimeDifference;exports.getSalaryAsText=i.getSalaryAsText;exports.getStatefulPropertiesFromSearchParams=s;
|
package/dist/utils.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { a, g } from "./datetime-
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
if (
|
|
6
|
-
const
|
|
7
|
-
if (!
|
|
1
|
+
import { a as o, g as u } from "./datetime-796d4b37.js";
|
|
2
|
+
const n = (s, r) => {
|
|
3
|
+
const a = structuredClone(s);
|
|
4
|
+
return a.forEach((t) => {
|
|
5
|
+
if (r.has(t.key)) {
|
|
6
|
+
const e = r.get(t.key);
|
|
7
|
+
if (!e)
|
|
8
8
|
return;
|
|
9
|
-
|
|
9
|
+
t.defaultValue = e.includes(",") ? e.split(",") : e;
|
|
10
10
|
}
|
|
11
|
-
});
|
|
12
|
-
return newProperties;
|
|
11
|
+
}), a;
|
|
13
12
|
};
|
|
14
13
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
getStatefulPropertiesFromSearchParams
|
|
14
|
+
o as getRelativeTimeDifference,
|
|
15
|
+
u as getSalaryAsText,
|
|
16
|
+
n as getStatefulPropertiesFromSearchParams
|
|
18
17
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inploi/plugin-job-search",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/plugin-job-search.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"vite": "^4.5.3",
|
|
54
54
|
"vite-plugin-dts": "^3.9.1",
|
|
55
55
|
"vite-tsconfig-paths": "^4.3.2",
|
|
56
|
-
"@inploi/core": "1.14.
|
|
56
|
+
"@inploi/core": "1.14.6",
|
|
57
57
|
"@inploi/design-tokens": "0.2.1",
|
|
58
58
|
"@inploi/plugin-job-alerts": "0.3.0",
|
|
59
59
|
"@inploi/sdk": "1.14.8",
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const payPeriods = {
|
|
3
|
-
ANNUALLY: "per year",
|
|
4
|
-
DAILY: "per day",
|
|
5
|
-
HOURLY: "per hour",
|
|
6
|
-
MONTHLY: "per month",
|
|
7
|
-
WEEKLY: "per week"
|
|
8
|
-
};
|
|
9
|
-
const getSalaryAsText = (params) => {
|
|
10
|
-
const { salary, config } = params;
|
|
11
|
-
const numberFormatter = new Intl.NumberFormat(config.locales, {
|
|
12
|
-
style: "currency",
|
|
13
|
-
currency: salary.pay_currency,
|
|
14
|
-
// @ts-expect-error - it exists, but TS doesn't know it
|
|
15
|
-
trailingZeroDisplay: "stripIfInteger"
|
|
16
|
-
});
|
|
17
|
-
if (salary.pay_display === false)
|
|
18
|
-
return void 0;
|
|
19
|
-
if (salary.pay_mask)
|
|
20
|
-
return "Competitive";
|
|
21
|
-
if (salary.pay_max && isNaN(+salary.pay_max))
|
|
22
|
-
return "Invalid salary";
|
|
23
|
-
if (salary.pay_min && isNaN(+salary.pay_min))
|
|
24
|
-
return "Invalid salary";
|
|
25
|
-
if (salary.pay && isNaN(+salary.pay))
|
|
26
|
-
return "Invalid salary";
|
|
27
|
-
const period = salary.pay_type && salary.pay_type in payPeriods ? payPeriods[salary.pay_type] : void 0;
|
|
28
|
-
if (salary.pay)
|
|
29
|
-
return [numberFormatter.format(+salary.pay), period].filter(Boolean).join(" ");
|
|
30
|
-
if (salary.pay_max && salary.pay_min)
|
|
31
|
-
return [numberFormatter.formatRange(+salary.pay_min, +salary.pay_max), period].filter(Boolean).join(" ");
|
|
32
|
-
if (salary.pay_max)
|
|
33
|
-
return "Up to " + [numberFormatter.format(+salary.pay_max), period].filter(Boolean).join(" ");
|
|
34
|
-
if (salary.pay_min)
|
|
35
|
-
return "From " + [numberFormatter.format(+salary.pay_min), period].filter(Boolean).join(" ");
|
|
36
|
-
return "Invalid salary";
|
|
37
|
-
};
|
|
38
|
-
const DEFAULT_FORMATTER = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
39
|
-
const getRelativeTimeDifference = ({ from = /* @__PURE__ */ new Date(), to, formatter = DEFAULT_FORMATTER }) => {
|
|
40
|
-
const then = to instanceof Date ? to : new Date(to);
|
|
41
|
-
const diff = then.getTime() - from.getTime();
|
|
42
|
-
const diffIn = {
|
|
43
|
-
days: Math.round(diff / 1e3 / 60 / 60 / 24),
|
|
44
|
-
months: Math.round(diff / 1e3 / 60 / 60 / 24 / 30)
|
|
45
|
-
};
|
|
46
|
-
if (diffIn.days === 0)
|
|
47
|
-
return "today";
|
|
48
|
-
if (Math.abs(diffIn.days) < 30)
|
|
49
|
-
return formatter.format(diffIn.days, "days");
|
|
50
|
-
if (Math.abs(diffIn.days) < 3)
|
|
51
|
-
return formatter.format(diffIn.months, "months");
|
|
52
|
-
return diffIn.months < 0 ? "over 30 days ago" : "in over 30 days";
|
|
53
|
-
};
|
|
54
|
-
exports.getRelativeTimeDifference = getRelativeTimeDifference;
|
|
55
|
-
exports.getSalaryAsText = getSalaryAsText;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
const payPeriods = {
|
|
2
|
-
ANNUALLY: "per year",
|
|
3
|
-
DAILY: "per day",
|
|
4
|
-
HOURLY: "per hour",
|
|
5
|
-
MONTHLY: "per month",
|
|
6
|
-
WEEKLY: "per week"
|
|
7
|
-
};
|
|
8
|
-
const getSalaryAsText = (params) => {
|
|
9
|
-
const { salary, config } = params;
|
|
10
|
-
const numberFormatter = new Intl.NumberFormat(config.locales, {
|
|
11
|
-
style: "currency",
|
|
12
|
-
currency: salary.pay_currency,
|
|
13
|
-
// @ts-expect-error - it exists, but TS doesn't know it
|
|
14
|
-
trailingZeroDisplay: "stripIfInteger"
|
|
15
|
-
});
|
|
16
|
-
if (salary.pay_display === false)
|
|
17
|
-
return void 0;
|
|
18
|
-
if (salary.pay_mask)
|
|
19
|
-
return "Competitive";
|
|
20
|
-
if (salary.pay_max && isNaN(+salary.pay_max))
|
|
21
|
-
return "Invalid salary";
|
|
22
|
-
if (salary.pay_min && isNaN(+salary.pay_min))
|
|
23
|
-
return "Invalid salary";
|
|
24
|
-
if (salary.pay && isNaN(+salary.pay))
|
|
25
|
-
return "Invalid salary";
|
|
26
|
-
const period = salary.pay_type && salary.pay_type in payPeriods ? payPeriods[salary.pay_type] : void 0;
|
|
27
|
-
if (salary.pay)
|
|
28
|
-
return [numberFormatter.format(+salary.pay), period].filter(Boolean).join(" ");
|
|
29
|
-
if (salary.pay_max && salary.pay_min)
|
|
30
|
-
return [numberFormatter.formatRange(+salary.pay_min, +salary.pay_max), period].filter(Boolean).join(" ");
|
|
31
|
-
if (salary.pay_max)
|
|
32
|
-
return "Up to " + [numberFormatter.format(+salary.pay_max), period].filter(Boolean).join(" ");
|
|
33
|
-
if (salary.pay_min)
|
|
34
|
-
return "From " + [numberFormatter.format(+salary.pay_min), period].filter(Boolean).join(" ");
|
|
35
|
-
return "Invalid salary";
|
|
36
|
-
};
|
|
37
|
-
const DEFAULT_FORMATTER = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
38
|
-
const getRelativeTimeDifference = ({ from = /* @__PURE__ */ new Date(), to, formatter = DEFAULT_FORMATTER }) => {
|
|
39
|
-
const then = to instanceof Date ? to : new Date(to);
|
|
40
|
-
const diff = then.getTime() - from.getTime();
|
|
41
|
-
const diffIn = {
|
|
42
|
-
days: Math.round(diff / 1e3 / 60 / 60 / 24),
|
|
43
|
-
months: Math.round(diff / 1e3 / 60 / 60 / 24 / 30)
|
|
44
|
-
};
|
|
45
|
-
if (diffIn.days === 0)
|
|
46
|
-
return "today";
|
|
47
|
-
if (Math.abs(diffIn.days) < 30)
|
|
48
|
-
return formatter.format(diffIn.days, "days");
|
|
49
|
-
if (Math.abs(diffIn.days) < 3)
|
|
50
|
-
return formatter.format(diffIn.months, "months");
|
|
51
|
-
return diffIn.months < 0 ? "over 30 days ago" : "in over 30 days";
|
|
52
|
-
};
|
|
53
|
-
export {
|
|
54
|
-
getRelativeTimeDifference as a,
|
|
55
|
-
getSalaryAsText as g
|
|
56
|
-
};
|