@vritti/quantum-ui 0.6.4 → 0.6.5
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/Badge2.js +2 -0
- package/dist/Badge2.js.map +1 -1
- package/dist/ChartFrame.js +1 -1
- package/dist/ChartFrame.js.map +1 -1
- package/dist/CurrencyFieldFilter.js +52 -26
- package/dist/CurrencyFieldFilter.js.map +1 -1
- package/dist/Progress.js +31 -4
- package/dist/Progress.js.map +1 -1
- package/dist/SegmentedProgressKey.js +65 -0
- package/dist/SegmentedProgressKey.js.map +1 -0
- package/dist/Select.js +47 -13
- package/dist/Select.js.map +1 -1
- package/dist/SelectFilter.js +18 -2
- package/dist/SelectFilter.js.map +1 -1
- package/dist/SingleSelect.js +21 -4
- package/dist/SingleSelect.js.map +1 -1
- package/dist/StepProgressIndicator.js +49 -28
- package/dist/StepProgressIndicator.js.map +1 -1
- package/dist/ValueFilter.js +1 -1
- package/dist/ValueFilter.js.map +1 -1
- package/dist/assets/quantum-ui.css +211 -4
- package/dist/components/DataTable.js +1 -1
- package/dist/components/SegmentedProgress.js +2 -0
- package/dist/components/SegmentedProgress.js.map +1 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index14.js +1139 -20
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +20 -1139
- package/dist/index15.js.map +1 -1
- package/dist/index34.js +2 -2
- package/dist/lib/components/Chart/ChartFrame.d.ts.map +1 -1
- package/dist/lib/components/CurrencyField/CurrencyFieldFilter.d.ts +2 -0
- package/dist/lib/components/CurrencyField/CurrencyFieldFilter.d.ts.map +1 -1
- package/dist/lib/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/lib/components/DataTable/DataTableSkeleton.d.ts +11 -0
- package/dist/lib/components/DataTable/DataTableSkeleton.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableSelectionBar.d.ts.map +1 -1
- package/dist/lib/components/DataTable/index.d.ts +3 -0
- package/dist/lib/components/DataTable/index.d.ts.map +1 -1
- package/dist/lib/components/DataTable/modes.d.ts +9 -0
- package/dist/lib/components/DataTable/modes.d.ts.map +1 -0
- package/dist/lib/components/DataTable/types.d.ts +3 -1
- package/dist/lib/components/DataTable/types.d.ts.map +1 -1
- package/dist/lib/components/Progress/Progress.d.ts +3 -1
- package/dist/lib/components/Progress/Progress.d.ts.map +1 -1
- package/dist/lib/components/SegmentedProgress/SegmentedProgress.d.ts +16 -0
- package/dist/lib/components/SegmentedProgress/SegmentedProgress.d.ts.map +1 -0
- package/dist/lib/components/SegmentedProgress/SegmentedProgressKey.d.ts +14 -0
- package/dist/lib/components/SegmentedProgress/SegmentedProgressKey.d.ts.map +1 -0
- package/dist/lib/components/SegmentedProgress/index.d.ts +5 -0
- package/dist/lib/components/SegmentedProgress/index.d.ts.map +1 -0
- package/dist/lib/components/SegmentedProgress/steps.d.ts +2 -0
- package/dist/lib/components/SegmentedProgress/steps.d.ts.map +1 -0
- package/dist/lib/components/Select/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/lib/components/Select/components/MultiSelect/MultiSelectFilter.d.ts.map +1 -1
- package/dist/lib/components/Select/components/SingleSelect/SingleSelect.d.ts +1 -0
- package/dist/lib/components/Select/components/SingleSelect/SingleSelect.d.ts.map +1 -1
- package/dist/lib/components/Select/components/SingleSelect/SingleSelectFilter.d.ts.map +1 -1
- package/dist/lib/components/Select/hooks/useSelect.d.ts.map +1 -1
- package/dist/lib/components/StepProgressIndicator/StepProgressIndicator.d.ts +4 -1
- package/dist/lib/components/StepProgressIndicator/StepProgressIndicator.d.ts.map +1 -1
- package/dist/lib/components/ValueFilter/ValueFilter.d.ts +6 -1
- package/dist/lib/components/ValueFilter/ValueFilter.d.ts.map +1 -1
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/index.d.ts.map +1 -1
- package/dist/lib/hooks/useFormatters.d.ts +3 -0
- package/dist/lib/hooks/useFormatters.d.ts.map +1 -1
- package/dist/lib/utils/format.d.ts +5 -0
- package/dist/lib/utils/format.d.ts.map +1 -1
- package/dist/lib/utils/lodash.d.ts +1 -1
- package/dist/lib/utils/lodash.d.ts.map +1 -1
- package/dist/select2.js +1 -1
- package/dist/separator2.js +1 -1
- package/dist/shadcn/shadcnBadge/Badge.d.ts +1 -1
- package/dist/shadcn/shadcnBadge/Badge.d.ts.map +1 -1
- package/dist/shadcn/shadcnMultiSelect/multi-select.d.ts +2 -1
- package/dist/shadcn/shadcnMultiSelect/multi-select.d.ts.map +1 -1
- package/dist/shadcn/shadcnProgress/Progress.d.ts +4 -1
- package/dist/shadcn/shadcnProgress/Progress.d.ts.map +1 -1
- package/dist/shadcn/shadcnSingleSelect/single-select.d.ts +2 -1
- package/dist/shadcn/shadcnSingleSelect/single-select.d.ts.map +1 -1
- package/dist/useDataTable.js +254 -212
- package/dist/useDataTable.js.map +1 -1
- package/dist/useFormatters.js +2 -1
- package/dist/useFormatters.js.map +1 -1
- package/dist/utils/format.js +21 -2
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/lodash.js +3 -1
- package/dist/utils/lodash.js.map +1 -1
- package/package.json +5 -1
package/dist/useFormatters.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { resolveCurrency } from './utils/currency.js';
|
|
3
|
-
import { formatString, formatDateTime, formatDate, formatCurrency, formatNumber } from './utils/format.js';
|
|
3
|
+
import { formatString, formatDateTime, formatDate, formatCurrency, formatPercent, formatNumber } from './utils/format.js';
|
|
4
4
|
import { getLocale } from './utils/locale.js';
|
|
5
5
|
import { u as useLocale } from './useLocale.js';
|
|
6
6
|
import { u as useWorkspaceTimeZone } from './useWorkspaceTimeZone.js';
|
|
@@ -14,6 +14,7 @@ function useFormatters(options) {
|
|
|
14
14
|
() => ({
|
|
15
15
|
string: formatString,
|
|
16
16
|
number: (value, options2) => formatNumber(value, { localeTag, fractionDigits: options2?.fractionDigits }),
|
|
17
|
+
percent: (value, options2) => formatPercent(value, { localeTag, maximumFractionDigits: options2?.maximumFractionDigits }),
|
|
17
18
|
currency: (value, options2) => formatCurrency(value, { workspaceCurrency, exchangeRate: options2?.exchangeRate ?? null }),
|
|
18
19
|
date: (value) => formatDate(value, { locale }),
|
|
19
20
|
dateTime: (value, options2) => formatDateTime(value, { locale, workspaceTimeZone, timeZoneOverride: options2?.timeZone })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormatters.js","sources":["../lib/hooks/useFormatters.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { resolveCurrency } from '../utils/currency';\nimport {\n type CurrencyAmount,\n type FormattedValue,\n formatCurrency,\n formatDate,\n formatDateTime,\n formatNumber,\n formatString,\n} from '../utils/format';\nimport { getLocale } from '../utils/locale';\nimport { useLocale } from './useLocale';\nimport { useWorkspaceTimeZone } from './useWorkspaceTimeZone';\n\nexport interface Formatters {\n string: (value: React.ReactNode) => FormattedValue;\n number: (value: number | string | null | undefined, options?: { fractionDigits?: number }) => FormattedValue;\n currency: (value: CurrencyAmount | null | undefined, options?: { exchangeRate?: number | null }) => FormattedValue;\n date: (value: string | null | undefined) => FormattedValue;\n dateTime: (value: string | null | undefined, options?: { timeZone?: string }) => FormattedValue;\n}\n\nexport interface UseFormattersOptions {\n // Formats for one site inside an LE or site-group workspace — its timezone and currency instead of the workspace's\n siteId?: string | null;\n}\n\nexport function useFormatters(options?: UseFormattersOptions): Formatters {\n const locale = useLocale();\n const workspaceTimeZone = useWorkspaceTimeZone(options?.siteId);\n const workspaceCurrency = resolveCurrency(options?.siteId);\n const localeTag = getLocale() ?? 'en-US';\n\n return useMemo<Formatters>(\n () => ({\n string: formatString,\n number: (value, options) => formatNumber(value, { localeTag, fractionDigits: options?.fractionDigits }),\n currency: (value, options) =>\n formatCurrency(value, { workspaceCurrency, exchangeRate: options?.exchangeRate ?? null }),\n date: (value) => formatDate(value, { locale }),\n dateTime: (value, options) =>\n formatDateTime(value, { locale, workspaceTimeZone, timeZoneOverride: options?.timeZone }),\n }),\n [locale, workspaceTimeZone, workspaceCurrency, localeTag],\n );\n}\n"],"names":["options"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"useFormatters.js","sources":["../lib/hooks/useFormatters.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { resolveCurrency } from '../utils/currency';\nimport {\n type CurrencyAmount,\n type FormattedValue,\n formatCurrency,\n formatDate,\n formatDateTime,\n formatNumber,\n formatPercent,\n formatString,\n} from '../utils/format';\nimport { getLocale } from '../utils/locale';\nimport { useLocale } from './useLocale';\nimport { useWorkspaceTimeZone } from './useWorkspaceTimeZone';\n\nexport interface Formatters {\n string: (value: React.ReactNode) => FormattedValue;\n number: (value: number | string | null | undefined, options?: { fractionDigits?: number }) => FormattedValue;\n percent: (value: number | string | null | undefined, options?: { maximumFractionDigits?: number }) => FormattedValue;\n currency: (value: CurrencyAmount | null | undefined, options?: { exchangeRate?: number | null }) => FormattedValue;\n date: (value: string | null | undefined) => FormattedValue;\n dateTime: (value: string | null | undefined, options?: { timeZone?: string }) => FormattedValue;\n}\n\nexport interface UseFormattersOptions {\n // Formats for one site inside an LE or site-group workspace — its timezone and currency instead of the workspace's\n siteId?: string | null;\n}\n\nexport function useFormatters(options?: UseFormattersOptions): Formatters {\n const locale = useLocale();\n const workspaceTimeZone = useWorkspaceTimeZone(options?.siteId);\n const workspaceCurrency = resolveCurrency(options?.siteId);\n const localeTag = getLocale() ?? 'en-US';\n\n return useMemo<Formatters>(\n () => ({\n string: formatString,\n number: (value, options) => formatNumber(value, { localeTag, fractionDigits: options?.fractionDigits }),\n percent: (value, options) =>\n formatPercent(value, { localeTag, maximumFractionDigits: options?.maximumFractionDigits }),\n currency: (value, options) =>\n formatCurrency(value, { workspaceCurrency, exchangeRate: options?.exchangeRate ?? null }),\n date: (value) => formatDate(value, { locale }),\n dateTime: (value, options) =>\n formatDateTime(value, { locale, workspaceTimeZone, timeZoneOverride: options?.timeZone }),\n }),\n [locale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@ const formatString = (value) => {
|
|
|
13
13
|
if (typeof value === "string" && value.trim() === "") return { primary: "—" };
|
|
14
14
|
return { primary: value };
|
|
15
15
|
};
|
|
16
|
+
const numberFormatters = /* @__PURE__ */ new Map();
|
|
17
|
+
function numberFormatter(localeTag, options) {
|
|
18
|
+
const key = `${localeTag}|${JSON.stringify(options ?? {})}`;
|
|
19
|
+
const cached = numberFormatters.get(key);
|
|
20
|
+
if (cached) return cached;
|
|
21
|
+
const formatter = new Intl.NumberFormat(localeTag, options);
|
|
22
|
+
numberFormatters.set(key, formatter);
|
|
23
|
+
return formatter;
|
|
24
|
+
}
|
|
16
25
|
const formatNumber = (value, options) => {
|
|
17
26
|
if (value == null) return { primary: "—" };
|
|
18
27
|
const num = typeof value === "number" ? value : Number(value);
|
|
19
28
|
if (!Number.isFinite(num)) return { primary: "—" };
|
|
20
|
-
const formatter =
|
|
29
|
+
const formatter = numberFormatter(
|
|
21
30
|
options.localeTag,
|
|
22
31
|
options.fractionDigits != null ? { minimumFractionDigits: options.fractionDigits, maximumFractionDigits: options.fractionDigits } : void 0
|
|
23
32
|
);
|
|
24
33
|
return { primary: formatter.format(num) };
|
|
25
34
|
};
|
|
35
|
+
const formatPercent = (value, options) => {
|
|
36
|
+
if (value == null) return { primary: "—" };
|
|
37
|
+
const num = typeof value === "number" ? value : Number(value);
|
|
38
|
+
if (!Number.isFinite(num)) return { primary: "—" };
|
|
39
|
+
const formatter = numberFormatter(options.localeTag, {
|
|
40
|
+
style: "percent",
|
|
41
|
+
maximumFractionDigits: options.maximumFractionDigits ?? 1
|
|
42
|
+
});
|
|
43
|
+
return { primary: formatter.format(new Decimal(num).div(100).toNumber()) };
|
|
44
|
+
};
|
|
26
45
|
const formatCurrency = (value, options = {}) => {
|
|
27
46
|
if (value == null) return { primary: "—" };
|
|
28
47
|
const { currency, value: amountStr } = value;
|
|
@@ -61,5 +80,5 @@ const formatDateTime = (value, options = {}) => {
|
|
|
61
80
|
};
|
|
62
81
|
};
|
|
63
82
|
|
|
64
|
-
export { formatCurrency, formatDate, formatDateTime, formatNumber, formatString };
|
|
83
|
+
export { formatCurrency, formatDate, formatDateTime, formatNumber, formatPercent, formatString };
|
|
65
84
|
//# sourceMappingURL=format.js.map
|
package/dist/utils/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sources":["../../lib/utils/format.ts"],"sourcesContent":["// Pure value-formatting helpers (no hooks) returning { primary, secondary? } for DetailField, DataTable cells, etc.\nimport { tz } from '@date-fns/tz';\nimport type { Locale } from 'date-fns';\nimport { format, isValid, parseISO } from 'date-fns';\nimport type React from 'react';\nimport Decimal from './decimal';\nimport { formatCurrencyMajor } from './money';\nimport { getUserTimeZone } from './timezone';\n\nexport type CurrencyAmount = { currency: string; value: string };\n\nexport type FormattedValue = { primary: React.ReactNode; secondary?: string };\n\nconst DATE_ONLY_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nconst formatWithTimeZone = (date: Date, dateFormat: string, timeZone: string, locale?: Locale) =>\n format(date, dateFormat, locale ? { in: tz(timeZone), locale } : { in: tz(timeZone) });\n\nconst parseDateOnly = (value: string): Date => parseISO(DATE_ONLY_PATTERN.test(value) ? `${value}T00:00:00Z` : value);\n\nexport const formatString = (value: React.ReactNode): FormattedValue => {\n if (value == null) return { primary: '—' };\n // Treat empty/whitespace strings as \"no value\", but let JSX/element values pass through untouched.\n if (typeof value === 'string' && value.trim() === '') return { primary: '—' };\n return { primary: value };\n};\n\nexport interface FormatNumberOptions {\n localeTag: string;\n fractionDigits?: number;\n}\n\nexport const formatNumber = (\n value: number | string | null | undefined,\n options: FormatNumberOptions,\n): FormattedValue => {\n if (value == null) return { primary: '—' };\n const num = typeof value === 'number' ? value : Number(value);\n if (!Number.isFinite(num)) return { primary: '—' };\n const formatter =
|
|
1
|
+
{"version":3,"file":"format.js","sources":["../../lib/utils/format.ts"],"sourcesContent":["// Pure value-formatting helpers (no hooks) returning { primary, secondary? } for DetailField, DataTable cells, etc.\nimport { tz } from '@date-fns/tz';\nimport type { Locale } from 'date-fns';\nimport { format, isValid, parseISO } from 'date-fns';\nimport type React from 'react';\nimport Decimal from './decimal';\nimport { formatCurrencyMajor } from './money';\nimport { getUserTimeZone } from './timezone';\n\nexport type CurrencyAmount = { currency: string; value: string };\n\nexport type FormattedValue = { primary: React.ReactNode; secondary?: string };\n\nconst DATE_ONLY_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nconst formatWithTimeZone = (date: Date, dateFormat: string, timeZone: string, locale?: Locale) =>\n format(date, dateFormat, locale ? { in: tz(timeZone), locale } : { in: tz(timeZone) });\n\nconst parseDateOnly = (value: string): Date => parseISO(DATE_ONLY_PATTERN.test(value) ? `${value}T00:00:00Z` : value);\n\nexport const formatString = (value: React.ReactNode): FormattedValue => {\n if (value == null) return { primary: '—' };\n // Treat empty/whitespace strings as \"no value\", but let JSX/element values pass through untouched.\n if (typeof value === 'string' && value.trim() === '') return { primary: '—' };\n return { primary: value };\n};\n\n// One Intl.NumberFormat per locale and options, reused: building one costs far more than formatting with it, and a\n// table formats the same few shapes on every row\nconst numberFormatters = new Map<string, Intl.NumberFormat>();\nfunction numberFormatter(localeTag: string, options?: Intl.NumberFormatOptions): Intl.NumberFormat {\n const key = `${localeTag}|${JSON.stringify(options ?? {})}`;\n const cached = numberFormatters.get(key);\n if (cached) return cached;\n const formatter = new Intl.NumberFormat(localeTag, options);\n numberFormatters.set(key, formatter);\n return formatter;\n}\n\nexport interface FormatNumberOptions {\n localeTag: string;\n fractionDigits?: number;\n}\n\nexport const formatNumber = (\n value: number | string | null | undefined,\n options: FormatNumberOptions,\n): FormattedValue => {\n if (value == null) return { primary: '—' };\n const num = typeof value === 'number' ? value : Number(value);\n if (!Number.isFinite(num)) return { primary: '—' };\n const formatter = numberFormatter(\n options.localeTag,\n options.fractionDigits != null\n ? { minimumFractionDigits: options.fractionDigits, maximumFractionDigits: options.fractionDigits }\n : undefined,\n );\n return { primary: formatter.format(num) };\n};\n\nexport interface FormatPercentOptions {\n localeTag: string;\n maximumFractionDigits?: number;\n}\n\n// Formats a percentage given on a 0–100 scale (42.5 → \"42.5%\"), one decimal at most unless told otherwise\nexport const formatPercent = (\n value: number | string | null | undefined,\n options: FormatPercentOptions,\n): FormattedValue => {\n if (value == null) return { primary: '—' };\n const num = typeof value === 'number' ? value : Number(value);\n if (!Number.isFinite(num)) return { primary: '—' };\n const formatter = numberFormatter(options.localeTag, {\n style: 'percent',\n maximumFractionDigits: options.maximumFractionDigits ?? 1,\n });\n return { primary: formatter.format(new Decimal(num).div(100).toNumber()) };\n};\n\nexport interface FormatCurrencyOptions {\n workspaceCurrency?: string | null;\n exchangeRate?: number | null;\n}\n\nexport const formatCurrency = (\n value: CurrencyAmount | null | undefined,\n options: FormatCurrencyOptions = {},\n): FormattedValue => {\n if (value == null) return { primary: '—' };\n const { currency, value: amountStr } = value;\n const amount = Number(amountStr);\n if (!Number.isFinite(amount)) return { primary: '—' };\n const primary = formatCurrencyMajor(amount, currency);\n\n const { workspaceCurrency, exchangeRate } = options;\n if (exchangeRate != null && Number.isFinite(exchangeRate) && workspaceCurrency && workspaceCurrency !== currency) {\n const workspaceAmount = new Decimal(amountStr).times(exchangeRate).toNumber();\n if (Number.isFinite(workspaceAmount)) {\n return { primary, secondary: `(${formatCurrencyMajor(workspaceAmount, workspaceCurrency)})` };\n }\n }\n return { primary };\n};\n\nexport interface FormatDateOptions {\n locale?: Locale;\n}\n\nexport const formatDate = (value: string | null | undefined, options: FormatDateOptions = {}): FormattedValue => {\n if (value == null) return { primary: '—' };\n const parsed = DATE_ONLY_PATTERN.test(value) ? parseDateOnly(value) : parseISO(value);\n if (!isValid(parsed)) return { primary: '—' };\n // Render date-only values in UTC so the displayed day matches the stored YYYY-MM-DD.\n return { primary: formatWithTimeZone(parsed, 'P', 'UTC', options.locale) };\n};\n\nexport interface FormatDateTimeOptions {\n locale?: Locale;\n workspaceTimeZone?: string | null;\n timeZoneOverride?: string;\n}\n\nexport const formatDateTime = (\n value: string | null | undefined,\n options: FormatDateTimeOptions = {},\n): FormattedValue => {\n if (value == null) return { primary: '—' };\n const parsed = parseISO(value);\n if (!isValid(parsed)) return { primary: '—' };\n\n const primaryTz = options.timeZoneOverride ?? options.workspaceTimeZone ?? null;\n if (!primaryTz) {\n return { primary: format(parsed, 'Pp', options.locale ? { locale: options.locale } : undefined) };\n }\n const primary = `${formatWithTimeZone(parsed, 'Pp', primaryTz, options.locale)} (${primaryTz})`;\n const userTz = getUserTimeZone();\n if (!userTz || userTz === primaryTz) return { primary };\n return {\n primary,\n secondary: `Your time: ${formatWithTimeZone(parsed, 'Pp', userTz, options.locale)} (${userTz})`,\n };\n};\n"],"names":[],"mappings":";;;;;;;AAaA,MAAM,iBAAA,GAAoB,qBAAA;AAE1B,MAAM,kBAAA,GAAqB,CAAC,IAAA,EAAY,UAAA,EAAoB,UAAkB,MAAA,KAC5E,MAAA,CAAO,IAAA,EAAM,UAAA,EAAY,MAAA,GAAS,EAAE,IAAI,EAAA,CAAG,QAAQ,GAAG,MAAA,EAAO,GAAI,EAAE,EAAA,EAAI,EAAA,CAAG,QAAQ,CAAA,EAAG,CAAA;AAEvF,MAAM,aAAA,GAAgB,CAAC,KAAA,KAAwB,QAAA,CAAS,iBAAA,CAAkB,IAAA,CAAK,KAAK,CAAA,GAAI,CAAA,EAAG,KAAK,CAAA,UAAA,CAAA,GAAe,KAAK,CAAA;AAE7G,MAAM,YAAA,GAAe,CAAC,KAAA,KAA2C;AACtE,EAAA,IAAI,KAAA,IAAS,IAAA,EAAM,OAAO,EAAE,SAAS,GAAA,EAAI;AAEzC,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,CAAM,IAAA,OAAW,EAAA,EAAI,OAAO,EAAE,OAAA,EAAS,GAAA,EAAI;AAC5E,EAAA,OAAO,EAAE,SAAS,KAAA,EAAM;AAC1B;AAIA,MAAM,gBAAA,uBAAuB,GAAA,EAA+B;AAC5D,SAAS,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OAAA,CAAQ,MAAM,CAAC,CAAA,EAAA,EAAK,SAAS,CAAA,CAAA,CAAA;AAC5F,EAAA,MAAM,SAAS,eAAA,EAAgB;AAC/B,EAAA,IAAI,CAAC,MAAA,IAAU,MAAA,KAAW,SAAA,EAAW,OAAO,EAAE,OAAA,EAAQ;AACtD,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA,SAAA,EAAW,CAAA,WAAA,EAAc,kBAAA,CAAmB,MAAA,EAAQ,IAAA,EAAM,QAAQ,OAAA,CAAQ,MAAM,CAAC,CAAA,EAAA,EAAK,MAAM,CAAA,CAAA;AAAA,GAC9F;AACF;;;;"}
|
package/dist/utils/lodash.js
CHANGED
|
@@ -14,14 +14,16 @@ const isEqual = lodashExports.isEqual;
|
|
|
14
14
|
const keyBy = lodashExports.keyBy;
|
|
15
15
|
const mapValues = lodashExports.mapValues;
|
|
16
16
|
const merge = lodashExports.merge;
|
|
17
|
+
const min = lodashExports.min;
|
|
17
18
|
const omit = lodashExports.omit;
|
|
18
19
|
const orderBy = lodashExports.orderBy;
|
|
19
20
|
const pick = lodashExports.pick;
|
|
20
21
|
const range = lodashExports.range;
|
|
21
22
|
const sortBy = lodashExports.sortBy;
|
|
23
|
+
const sumBy = lodashExports.sumBy;
|
|
22
24
|
const throttle = lodashExports.throttle;
|
|
23
25
|
const union = lodashExports.union;
|
|
24
26
|
const uniq = lodashExports.uniq;
|
|
25
27
|
const uniqBy = lodashExports.uniqBy;
|
|
26
|
-
export { chunk, cloneDeep, debounce, difference, flatten, groupBy, intersection, isEmpty, isEqual, keyBy, mapValues, merge, omit, orderBy, pick, range, sortBy, throttle, union, uniq, uniqBy };
|
|
28
|
+
export { chunk, cloneDeep, debounce, difference, flatten, groupBy, intersection, isEmpty, isEqual, keyBy, mapValues, merge, min, omit, orderBy, pick, range, sortBy, sumBy, throttle, union, uniq, uniqBy };
|
|
27
29
|
//# sourceMappingURL=lodash.js.map
|
package/dist/utils/lodash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lodash.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lodash.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.6.
|
|
8
|
+
"version": "0.6.5",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"repository": {
|
|
@@ -156,6 +156,10 @@
|
|
|
156
156
|
"types": "./dist/lib/components/Progress/index.d.ts",
|
|
157
157
|
"import": "./dist/components/Progress.js"
|
|
158
158
|
},
|
|
159
|
+
"./SegmentedProgress": {
|
|
160
|
+
"types": "./dist/lib/components/SegmentedProgress/index.d.ts",
|
|
161
|
+
"import": "./dist/components/SegmentedProgress.js"
|
|
162
|
+
},
|
|
159
163
|
"./CheckboxGroup": {
|
|
160
164
|
"types": "./dist/lib/components/CheckboxGroup/index.d.ts",
|
|
161
165
|
"import": "./dist/components/CheckboxGroup.js"
|