@leaflink/stash 44.3.1 → 44.4.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/dist/locale.js +10 -8
- package/dist/locale.js.map +1 -1
- package/package.json +1 -1
package/dist/locale.js
CHANGED
|
@@ -101,17 +101,19 @@ const c = {
|
|
|
101
101
|
},
|
|
102
102
|
validation: {
|
|
103
103
|
email: "Email must be valid",
|
|
104
|
+
maxLength: "Must be at most {max} characters",
|
|
104
105
|
maxValue: "Must be at most {max}",
|
|
106
|
+
minLength: "Must be at least {min} characters",
|
|
105
107
|
minValue: "Must be at least {min}",
|
|
106
108
|
positiveNumber: "Must be greater than 0",
|
|
107
|
-
required: "Required",
|
|
108
109
|
price: "Must have 2 decimal places",
|
|
110
|
+
required: "Required",
|
|
109
111
|
wholeNumber: "Must be a Whole Number"
|
|
110
112
|
},
|
|
111
113
|
viewFilterGroup: "View filter group"
|
|
112
114
|
}
|
|
113
115
|
};
|
|
114
|
-
let
|
|
116
|
+
let a = "en-US", r;
|
|
115
117
|
function u(e, t) {
|
|
116
118
|
const o = e.match(/({)([\w]+)(})/g) || [];
|
|
117
119
|
let l = e;
|
|
@@ -125,21 +127,21 @@ function d(e, t) {
|
|
|
125
127
|
return o ? u(o, t) : e;
|
|
126
128
|
}
|
|
127
129
|
function p(...e) {
|
|
128
|
-
const t =
|
|
130
|
+
const t = r && r(...e);
|
|
129
131
|
return t && !/^\w{2,}\.\w{2,}/.test(t) ? t : d(...e);
|
|
130
132
|
}
|
|
131
133
|
function m(e) {
|
|
132
|
-
|
|
134
|
+
a = e || a;
|
|
133
135
|
}
|
|
134
136
|
function f(e) {
|
|
135
|
-
|
|
137
|
+
r = e;
|
|
136
138
|
}
|
|
137
|
-
const
|
|
139
|
+
const y = { i18n: f, locale: a, t: p, use: m };
|
|
138
140
|
export {
|
|
139
|
-
|
|
141
|
+
y as default,
|
|
140
142
|
u as format,
|
|
141
143
|
f as i18n,
|
|
142
|
-
|
|
144
|
+
a as locale,
|
|
143
145
|
p as t,
|
|
144
146
|
m as use
|
|
145
147
|
};
|
package/dist/locale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sources":["../src/locales/en-US.ts","../src/locale.ts"],"sourcesContent":["export default {\n ll: {\n actions: 'Actions',\n all: 'All',\n allFilters: 'All Filters',\n apply: 'Apply',\n areYouSure: 'Are you sure?',\n cancel: 'Cancel',\n carousel: {\n imageLabel: 'Image {index} of {total}',\n paginationLabel: 'Go to image {index}',\n },\n clear: 'Clear',\n closeModal: 'Close modal',\n confirm: 'Confirm',\n copy: {\n copied: 'Copied!',\n copyToClipboard: 'Copy to clipboard',\n },\n datePicker: {\n dateFormat: 'Date format',\n today: 'Today',\n },\n pageStats: '{from} - {to} of {total}',\n emptyState: {\n noResults: 'No results',\n },\n fileUpload: {\n dragDropFileHere: 'Drag and drop your file here',\n errors: {\n incorrectFileType: 'Please drop a file with type: {fileTypes}',\n },\n or: 'or',\n remove: 'Remove',\n uploadFile: 'Upload File',\n },\n filter: 'Filter',\n filterBy: 'Filter by',\n filters: 'Filters',\n httpError: {\n 401: {\n title: 'Unauthorized',\n description: 'Sorry, you are not authorized to access the LeafLink portal!',\n },\n 403: {\n title: 'Access denied.',\n description: `Sorry, you can not access the page you are looking for. Talk to your account admin regarding your account's permission settings.`,\n },\n 404: {\n title: `Sorry, we can't find this page.`,\n description: `We couldn't find the page you're looking for.`,\n },\n 405: {\n title: 'Not allowed.',\n description: `We couldn't reach the page you're looking for this way.`,\n },\n '50X': {\n title: 'Please wait while we hash this out.',\n description: `You've encountered an error.`,\n },\n 504: {\n title: 'Your request got lost in the weeds.',\n description: `You've encountered an error.`,\n },\n },\n listView: {\n calculating: 'Calculating results...',\n clearSelection: 'Clear Selection',\n deselectAllCount: 'Deselect all ({count})',\n numItemsSelected: '{totalSelectedCount} of {totalCount} items selected',\n numberOfTotalSelected: '{num} of {total} selected',\n selectAll: 'Select all',\n selectAllCount: 'Select all ({count})',\n sortBy: 'Sort by',\n totalResults: 'Showing {num} of {total} results',\n },\n numberOfActiveFilters: 'Number of active filters',\n okay: 'Okay',\n optional: 'optional',\n pageNavigation: {\n more: 'More',\n },\n more: 'More',\n next: 'Next',\n previous: 'Previous',\n reset: 'Reset',\n resetAll: 'Reset all',\n search: 'Search',\n select: {\n self: 'Select',\n empty: 'No options',\n placeholder: 'Select option',\n selected: 'selected',\n },\n selectAll: 'Select all',\n sort: 'Sort',\n table: {\n collapseRow: 'Collapse row',\n expandRow: 'Expand row',\n },\n validation: {\n email: 'Email must be valid',\n maxValue: 'Must be at most {max}',\n
|
|
1
|
+
{"version":3,"file":"locale.js","sources":["../src/locales/en-US.ts","../src/locale.ts"],"sourcesContent":["export default {\n ll: {\n actions: 'Actions',\n all: 'All',\n allFilters: 'All Filters',\n apply: 'Apply',\n areYouSure: 'Are you sure?',\n cancel: 'Cancel',\n carousel: {\n imageLabel: 'Image {index} of {total}',\n paginationLabel: 'Go to image {index}',\n },\n clear: 'Clear',\n closeModal: 'Close modal',\n confirm: 'Confirm',\n copy: {\n copied: 'Copied!',\n copyToClipboard: 'Copy to clipboard',\n },\n datePicker: {\n dateFormat: 'Date format',\n today: 'Today',\n },\n pageStats: '{from} - {to} of {total}',\n emptyState: {\n noResults: 'No results',\n },\n fileUpload: {\n dragDropFileHere: 'Drag and drop your file here',\n errors: {\n incorrectFileType: 'Please drop a file with type: {fileTypes}',\n },\n or: 'or',\n remove: 'Remove',\n uploadFile: 'Upload File',\n },\n filter: 'Filter',\n filterBy: 'Filter by',\n filters: 'Filters',\n httpError: {\n 401: {\n title: 'Unauthorized',\n description: 'Sorry, you are not authorized to access the LeafLink portal!',\n },\n 403: {\n title: 'Access denied.',\n description: `Sorry, you can not access the page you are looking for. Talk to your account admin regarding your account's permission settings.`,\n },\n 404: {\n title: `Sorry, we can't find this page.`,\n description: `We couldn't find the page you're looking for.`,\n },\n 405: {\n title: 'Not allowed.',\n description: `We couldn't reach the page you're looking for this way.`,\n },\n '50X': {\n title: 'Please wait while we hash this out.',\n description: `You've encountered an error.`,\n },\n 504: {\n title: 'Your request got lost in the weeds.',\n description: `You've encountered an error.`,\n },\n },\n listView: {\n calculating: 'Calculating results...',\n clearSelection: 'Clear Selection',\n deselectAllCount: 'Deselect all ({count})',\n numItemsSelected: '{totalSelectedCount} of {totalCount} items selected',\n numberOfTotalSelected: '{num} of {total} selected',\n selectAll: 'Select all',\n selectAllCount: 'Select all ({count})',\n sortBy: 'Sort by',\n totalResults: 'Showing {num} of {total} results',\n },\n numberOfActiveFilters: 'Number of active filters',\n okay: 'Okay',\n optional: 'optional',\n pageNavigation: {\n more: 'More',\n },\n more: 'More',\n next: 'Next',\n previous: 'Previous',\n reset: 'Reset',\n resetAll: 'Reset all',\n search: 'Search',\n select: {\n self: 'Select',\n empty: 'No options',\n placeholder: 'Select option',\n selected: 'selected',\n },\n selectAll: 'Select all',\n sort: 'Sort',\n table: {\n collapseRow: 'Collapse row',\n expandRow: 'Expand row',\n },\n validation: {\n email: 'Email must be valid',\n maxLength: 'Must be at most {max} characters',\n maxValue: 'Must be at most {max}',\n minLength: 'Must be at least {min} characters',\n minValue: 'Must be at least {min}',\n positiveNumber: 'Must be greater than 0',\n price: 'Must have 2 decimal places',\n required: 'Required',\n wholeNumber: 'Must be a Whole Number',\n },\n viewFilterGroup: 'View filter group',\n },\n};\n","import get from 'lodash-es/get';\n\nimport messages from './locales/en-US';\n\nexport let locale = 'en-US';\nlet i18nHandler;\n\n/**\n * Replaces params in a translation message with respective values\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n * @returns {string}\n */\nexport function format(path, params) {\n const pathParams = path.match(/({)([\\w]+)(})/g) || [];\n let message = path;\n\n pathParams.forEach((param) => {\n const prop = param.replace(/[{}]/g, '');\n\n message = message.replace(param, params[prop] || '');\n });\n\n return message;\n}\n\n/**\n * Returns a translation based on translation path\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n */\nfunction translate(path, params) {\n // Lookup translation\n const value = get(messages, path);\n\n // Return translation, otherwise the path\n return value ? format(value, params) : path;\n}\n\n/**\n * Calls the provided translation method `config.i18n.t` if provided, or the built-in\n * @param {...(string|object)} args\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n * @returns {string} Translation message\n */\nexport function t(...args) {\n const value = i18nHandler && i18nHandler(...args);\n\n // If value exists, but translation doesn't (returns translation key format (xx.xx)),\n // then fallback to default\n if (value && !/^\\w{2,}\\.\\w{2,}/.test(value)) {\n return value;\n }\n\n // @ts-ignore - todo: Fix \"A spread argument must either have a tuple type or be passed to a rest parameter.ts(2556)\"\n // Default English message\n return translate(...args);\n}\n\n/**\n * Sets the locale\n * @param {string} l locale\n */\nexport function use(l) {\n locale = l || locale;\n}\n\n/**\n * Sets the translate function `t()`\n * @param {function} fn Translate function `t()`\n */\nexport function i18n(fn) {\n i18nHandler = fn;\n}\n\nexport default { i18n, locale, t, use };\n"],"names":["messages","locale","i18nHandler","format","path","params","pathParams","message","param","prop","translate","value","get","t","args","use","l","i18n","fn","locale$1"],"mappings":";AAAA,MAAeA,IAAA;AAAA,EACb,IAAI;AAAA,IACF,SAAS;AAAA,IACT,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,UAAU;AAAA,MACR,YAAY;AAAA,MACZ,iBAAiB;AAAA,IACnB;AAAA,IACA,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,MAAM;AAAA,MACJ,QAAQ;AAAA,MACR,iBAAiB;AAAA,IACnB;AAAA,IACA,YAAY;AAAA,MACV,YAAY;AAAA,MACZ,OAAO;AAAA,IACT;AAAA,IACA,WAAW;AAAA,IACX,YAAY;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,YAAY;AAAA,MACV,kBAAkB;AAAA,MAClB,QAAQ;AAAA,QACN,m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