@northlight/ui 2.35.1 → 2.35.3
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/es/northlight.d.ts +1 -1
- package/dist/es/northlight.js +70 -7
- package/dist/es/northlight.js.map +1 -1
- package/dist/umd/northlight.cjs +70 -7
- package/dist/umd/northlight.cjs.map +1 -1
- package/dist/umd/northlight.min.cjs +3 -3
- package/dist/umd/northlight.min.cjs.map +1 -1
- package/package.json +2 -2
package/dist/es/northlight.d.ts
CHANGED
|
@@ -3265,7 +3265,7 @@ interface PresetOptions {
|
|
|
3265
3265
|
thousandSeparator: string;
|
|
3266
3266
|
decimalSeparator: string;
|
|
3267
3267
|
}
|
|
3268
|
-
interface FormattedNumberInputProps extends Omit<NumericFormatProps, 'onChange' | 'max' | 'min'> {
|
|
3268
|
+
interface FormattedNumberInputProps extends Omit<NumericFormatProps, 'onChange' | 'max' | 'min'>, Omit<InputProps, 'color' | 'defaultValue' | 'value' | 'height' | 'size' | 'type' | 'width' | 'values' | 'events' | 'onChange'> {
|
|
3269
3269
|
max?: number;
|
|
3270
3270
|
min?: number;
|
|
3271
3271
|
/** Changes thousand and decimal separators */
|
package/dist/es/northlight.js
CHANGED
|
@@ -7304,6 +7304,44 @@ const getQuickSelectOptions = (state, locale, fiscalStartMonth, fiscalStartDay)
|
|
|
7304
7304
|
},
|
|
7305
7305
|
label: "Year to Date"
|
|
7306
7306
|
};
|
|
7307
|
+
const S1 = {
|
|
7308
|
+
value: {
|
|
7309
|
+
start: startOfMonthWithDays(
|
|
7310
|
+
startOfYear(thisDay).subtract({ years: offsetFiscalYear }),
|
|
7311
|
+
{
|
|
7312
|
+
months: fiscalStartMonth,
|
|
7313
|
+
days: fiscalStartDay
|
|
7314
|
+
}
|
|
7315
|
+
),
|
|
7316
|
+
end: endOfMonthWithDays(
|
|
7317
|
+
startOfYear(thisDay).subtract({ years: offsetFiscalYear }),
|
|
7318
|
+
{
|
|
7319
|
+
months: fiscalStartMonth + 6,
|
|
7320
|
+
days: fiscalStartDay
|
|
7321
|
+
}
|
|
7322
|
+
)
|
|
7323
|
+
},
|
|
7324
|
+
label: fiscalStartMonth === 0 ? "S1" : "FS1"
|
|
7325
|
+
};
|
|
7326
|
+
const S2 = {
|
|
7327
|
+
value: {
|
|
7328
|
+
start: startOfMonthWithDays(
|
|
7329
|
+
startOfYear(thisDay).subtract({ years: offsetFiscalYear }),
|
|
7330
|
+
{
|
|
7331
|
+
months: fiscalStartMonth + 6,
|
|
7332
|
+
days: fiscalStartDay
|
|
7333
|
+
}
|
|
7334
|
+
),
|
|
7335
|
+
end: endOfMonthWithDays(
|
|
7336
|
+
startOfYear(thisDay).subtract({ years: offsetFiscalYear }),
|
|
7337
|
+
{
|
|
7338
|
+
months: fiscalStartMonth + 12,
|
|
7339
|
+
days: fiscalStartDay
|
|
7340
|
+
}
|
|
7341
|
+
)
|
|
7342
|
+
},
|
|
7343
|
+
label: fiscalStartMonth === 0 ? "S2" : "FS2"
|
|
7344
|
+
};
|
|
7307
7345
|
const F1 = {
|
|
7308
7346
|
value: {
|
|
7309
7347
|
start: startOfMonthWithDays(
|
|
@@ -7380,6 +7418,7 @@ const getQuickSelectOptions = (state, locale, fiscalStartMonth, fiscalStartDay)
|
|
|
7380
7418
|
},
|
|
7381
7419
|
label: fiscalStartMonth === 0 ? "Q4" : "FQ4"
|
|
7382
7420
|
};
|
|
7421
|
+
const fiscalSemesters = [S1, S2];
|
|
7383
7422
|
const fiscalQuarters = [F1, F2, F3, F4];
|
|
7384
7423
|
const fiscalYears = fiscalStartMonth === 0 ? [] : [thisFiscalYear, lastFiscalYear];
|
|
7385
7424
|
const quickDates = [
|
|
@@ -7397,7 +7436,7 @@ const getQuickSelectOptions = (state, locale, fiscalStartMonth, fiscalStartDay)
|
|
|
7397
7436
|
nextYear,
|
|
7398
7437
|
...fiscalYears
|
|
7399
7438
|
];
|
|
7400
|
-
return { quickDates, fiscalQuarters };
|
|
7439
|
+
return { quickDates, fiscalQuarters, fiscalSemesters };
|
|
7401
7440
|
};
|
|
7402
7441
|
|
|
7403
7442
|
const seperator = `1px solid ${palette.gray["100"]}`;
|
|
@@ -7408,7 +7447,7 @@ const QuickSelect = ({
|
|
|
7408
7447
|
locale = "",
|
|
7409
7448
|
height = "17.5rem"
|
|
7410
7449
|
}) => {
|
|
7411
|
-
const { quickDates, fiscalQuarters } = useMemo(
|
|
7450
|
+
const { quickDates, fiscalQuarters, fiscalSemesters } = useMemo(
|
|
7412
7451
|
() => getQuickSelectOptions(state, locale, fiscalStartMonth, fiscalStartDay),
|
|
7413
7452
|
[]
|
|
7414
7453
|
);
|
|
@@ -7451,10 +7490,31 @@ const QuickSelect = ({
|
|
|
7451
7490
|
), /* @__PURE__ */ React.createElement(Spacer, null), /* @__PURE__ */ React.createElement(
|
|
7452
7491
|
Flex,
|
|
7453
7492
|
{
|
|
7454
|
-
justifyContent: "space-
|
|
7493
|
+
justifyContent: "space-around",
|
|
7455
7494
|
w: "full",
|
|
7456
7495
|
pt: "2",
|
|
7457
7496
|
pr: "4",
|
|
7497
|
+
display: shouldShow(fiscalSemesters) ? "flex" : "none"
|
|
7498
|
+
},
|
|
7499
|
+
map(
|
|
7500
|
+
(semester) => validRange(semester.value, state) && /* @__PURE__ */ React.createElement(
|
|
7501
|
+
DateButton,
|
|
7502
|
+
{
|
|
7503
|
+
onClick: updateDate(semester.value),
|
|
7504
|
+
isActive: getIsActive(semester),
|
|
7505
|
+
key: `quick-select-${semester.label}`
|
|
7506
|
+
},
|
|
7507
|
+
semester.label
|
|
7508
|
+
),
|
|
7509
|
+
fiscalSemesters
|
|
7510
|
+
)
|
|
7511
|
+
), /* @__PURE__ */ React.createElement(
|
|
7512
|
+
Flex,
|
|
7513
|
+
{
|
|
7514
|
+
justifyContent: "space-around",
|
|
7515
|
+
w: "full",
|
|
7516
|
+
pt: shouldShow(fiscalSemesters) ? "0" : "2",
|
|
7517
|
+
pr: "4",
|
|
7458
7518
|
display: shouldShow(fiscalQuarters) ? "flex" : "none"
|
|
7459
7519
|
},
|
|
7460
7520
|
map(
|
|
@@ -14537,7 +14597,7 @@ const ComboPicker = (_a) => {
|
|
|
14537
14597
|
"max",
|
|
14538
14598
|
"min"
|
|
14539
14599
|
]);
|
|
14540
|
-
var _a2;
|
|
14600
|
+
var _a2, _b2, _c;
|
|
14541
14601
|
const { isOpen, onToggle, onClose } = useDisclosure();
|
|
14542
14602
|
const [inputValueState, setInputValueState] = useState(valueProp == null ? void 0 : valueProp.input);
|
|
14543
14603
|
const [selectOptionState, setselectOptionState] = useState(valueProp == null ? void 0 : valueProp.option);
|
|
@@ -14599,9 +14659,10 @@ const ComboPicker = (_a) => {
|
|
|
14599
14659
|
onChange == null ? void 0 : onChange(getNewValue(option, input));
|
|
14600
14660
|
}
|
|
14601
14661
|
}, [inputValue, defaultToZeroIfEmpty]);
|
|
14662
|
+
const buttonWidth = (_b2 = (_a2 = buttonRef.current) == null ? void 0 : _a2.offsetWidth) != null ? _b2 : 0;
|
|
14602
14663
|
return /* @__PURE__ */ React.createElement(InputGroup, null, /* @__PURE__ */ React.createElement(
|
|
14603
14664
|
FormattedNumberInput,
|
|
14604
|
-
__spreadValues$1({
|
|
14665
|
+
__spreadProps(__spreadValues$1({
|
|
14605
14666
|
width: "100%",
|
|
14606
14667
|
onChange: (values) => handleInputChange(values.floatValue),
|
|
14607
14668
|
value: inputValue,
|
|
@@ -14613,7 +14674,9 @@ const ComboPicker = (_a) => {
|
|
|
14613
14674
|
readOnly: isReadOnly,
|
|
14614
14675
|
min,
|
|
14615
14676
|
max
|
|
14616
|
-
}, rest)
|
|
14677
|
+
}, rest), {
|
|
14678
|
+
pr: `${buttonWidth >= 0 ? buttonWidth + 10 : 0}px`
|
|
14679
|
+
})
|
|
14617
14680
|
), /* @__PURE__ */ React.createElement(
|
|
14618
14681
|
InputRightElement,
|
|
14619
14682
|
{
|
|
@@ -14631,7 +14694,7 @@ const ComboPicker = (_a) => {
|
|
|
14631
14694
|
flexShrink: "0",
|
|
14632
14695
|
height: "100%"
|
|
14633
14696
|
},
|
|
14634
|
-
(
|
|
14697
|
+
(_c = selectOption == null ? void 0 : selectOption.label) != null ? _c : ""
|
|
14635
14698
|
)
|
|
14636
14699
|
), /* @__PURE__ */ React.createElement(Box, { position: "absolute", width: "100%" }, /* @__PURE__ */ React.createElement(
|
|
14637
14700
|
Select,
|