@orderly.network/ui 2.8.10-alpha.0 → 2.8.11-alpha.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/index.css +15 -77
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +90 -132
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +90 -132
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +7 -5
- package/src/tailwind/base.ts +19 -0
- package/src/tailwind/chart.ts +28 -0
- package/src/tailwind/components.ts +16 -0
- package/src/tailwind/gradient.ts +38 -0
- package/src/tailwind/index.ts +8 -0
- package/src/tailwind/position.ts +13 -0
- package/src/tailwind/scrollBar.ts +48 -0
- package/src/tailwind/size.ts +13 -0
- package/src/tailwind/theme.ts +102 -0
- package/tailwind.config.js +252 -0
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -725,8 +725,7 @@ var BaseButton = React68__namespace.default.forwardRef(
|
|
|
725
725
|
}) : null;
|
|
726
726
|
}, [size, icon]);
|
|
727
727
|
const content = React68.useMemo(() => {
|
|
728
|
-
if (!leading && !trailing && !iconElement)
|
|
729
|
-
return children;
|
|
728
|
+
if (!leading && !trailing && !iconElement) return children;
|
|
730
729
|
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", itemAlign: "center", className: "oui-space-x-1", children: [
|
|
731
730
|
leading,
|
|
732
731
|
iconElement,
|
|
@@ -4267,12 +4266,9 @@ var Numeral = (props) => {
|
|
|
4267
4266
|
} = props;
|
|
4268
4267
|
const num = Number(props.children);
|
|
4269
4268
|
const child = React68.useMemo(() => {
|
|
4270
|
-
if (props.children === "-")
|
|
4271
|
-
|
|
4272
|
-
if (
|
|
4273
|
-
return placeholder ?? "--";
|
|
4274
|
-
if (typeof visible !== "undefined" && !visible)
|
|
4275
|
-
return masking ?? "*****";
|
|
4269
|
+
if (props.children === "-") return props.children;
|
|
4270
|
+
if (isNaN(num)) return placeholder ?? "--";
|
|
4271
|
+
if (typeof visible !== "undefined" && !visible) return masking ?? "*****";
|
|
4276
4272
|
if (ignoreDP) {
|
|
4277
4273
|
if (!!props.showIdentifier) {
|
|
4278
4274
|
return Math.abs(num).toString();
|
|
@@ -4290,31 +4286,23 @@ var Numeral = (props) => {
|
|
|
4290
4286
|
}, [num, visible, tick, dp]);
|
|
4291
4287
|
const defaultColor = rest.color || "inherit";
|
|
4292
4288
|
const colorName = React68.useMemo(() => {
|
|
4293
|
-
if (!coloring)
|
|
4294
|
-
|
|
4295
|
-
if (typeof visible !== "undefined" && !visible)
|
|
4296
|
-
return defaultColor;
|
|
4289
|
+
if (!coloring) return defaultColor;
|
|
4290
|
+
if (typeof visible !== "undefined" && !visible) return defaultColor;
|
|
4297
4291
|
if (Number.isNaN(num)) {
|
|
4298
4292
|
return defaultColor;
|
|
4299
4293
|
}
|
|
4300
|
-
if (num === 0)
|
|
4301
|
-
|
|
4302
|
-
if (num < 0)
|
|
4303
|
-
return "lose";
|
|
4294
|
+
if (num === 0) return "neutral";
|
|
4295
|
+
if (num < 0) return "lose";
|
|
4304
4296
|
return "profit";
|
|
4305
4297
|
}, [coloring, num, rest.color, props.visible]);
|
|
4306
4298
|
const identifier = React68.useMemo(() => {
|
|
4307
|
-
if (!showIdentifier || Number.isNaN(num) || num === 0)
|
|
4308
|
-
|
|
4309
|
-
if (typeof visible !== "undefined" && !visible)
|
|
4310
|
-
return null;
|
|
4299
|
+
if (!showIdentifier || Number.isNaN(num) || num === 0) return null;
|
|
4300
|
+
if (typeof visible !== "undefined" && !visible) return null;
|
|
4311
4301
|
if (num < 0) {
|
|
4312
|
-
if (identifiers?.loss)
|
|
4313
|
-
return identifiers.loss;
|
|
4302
|
+
if (identifiers?.loss) return identifiers.loss;
|
|
4314
4303
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: "-" });
|
|
4315
4304
|
}
|
|
4316
|
-
if (identifiers?.profit)
|
|
4317
|
-
return identifiers.profit;
|
|
4305
|
+
if (identifiers?.profit) return identifiers.profit;
|
|
4318
4306
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: "+" });
|
|
4319
4307
|
}, [num, props.visible, showIdentifier]);
|
|
4320
4308
|
const childWithUnit = React68.useMemo(() => {
|
|
@@ -4490,8 +4478,7 @@ var BaseInput = React68.forwardRef(
|
|
|
4490
4478
|
return formatters ?? [];
|
|
4491
4479
|
}, [formatters]);
|
|
4492
4480
|
React68.useEffect(() => {
|
|
4493
|
-
if (!ref)
|
|
4494
|
-
return;
|
|
4481
|
+
if (!ref) return;
|
|
4495
4482
|
if (typeof ref === "function") {
|
|
4496
4483
|
ref(innerInputRef.current);
|
|
4497
4484
|
} else {
|
|
@@ -4502,8 +4489,7 @@ var BaseInput = React68.forwardRef(
|
|
|
4502
4489
|
(value2) => {
|
|
4503
4490
|
if (!Array.isArray(innerFormatters) || innerFormatters.length === 0)
|
|
4504
4491
|
return value2;
|
|
4505
|
-
if (value2 === null || value2 === void 0)
|
|
4506
|
-
return "";
|
|
4492
|
+
if (value2 === null || value2 === void 0) return "";
|
|
4507
4493
|
let index = 0;
|
|
4508
4494
|
while (index < innerFormatters.length) {
|
|
4509
4495
|
value2 = innerFormatters[index].onRenderBefore(value2, {
|
|
@@ -4519,8 +4505,7 @@ var BaseInput = React68.forwardRef(
|
|
|
4519
4505
|
(value2, originValue) => {
|
|
4520
4506
|
if (!Array.isArray(innerFormatters) || innerFormatters.length === 0)
|
|
4521
4507
|
return value2;
|
|
4522
|
-
if (value2 === null || value2 === void 0)
|
|
4523
|
-
return "";
|
|
4508
|
+
if (value2 === null || value2 === void 0) return "";
|
|
4524
4509
|
let index = innerFormatters.length - 1;
|
|
4525
4510
|
while (index > -1) {
|
|
4526
4511
|
value2 = innerFormatters[index].onSendBefore(value2, {
|
|
@@ -4534,13 +4519,11 @@ var BaseInput = React68.forwardRef(
|
|
|
4534
4519
|
[innerFormatters]
|
|
4535
4520
|
);
|
|
4536
4521
|
const formattedValue = React68.useMemo(() => {
|
|
4537
|
-
if (typeof value === "undefined" || value === null)
|
|
4538
|
-
return "";
|
|
4522
|
+
if (typeof value === "undefined" || value === null) return "";
|
|
4539
4523
|
return formatToRender(value);
|
|
4540
4524
|
}, [value, formatToRender]);
|
|
4541
4525
|
React68.useEffect(() => {
|
|
4542
|
-
if (document.activeElement !== innerInputRef.current)
|
|
4543
|
-
return;
|
|
4526
|
+
if (document.activeElement !== innerInputRef.current) return;
|
|
4544
4527
|
const nextValueLen = `${formattedValue}`.length;
|
|
4545
4528
|
const prevValueLen = prevInputValue.current?.length || 0;
|
|
4546
4529
|
const next = cursor ? cursor + (nextValueLen - prevValueLen) : 0;
|
|
@@ -5709,13 +5692,11 @@ __export(formatter_exports, {
|
|
|
5709
5692
|
});
|
|
5710
5693
|
var currencyFormatter = {
|
|
5711
5694
|
onRenderBefore: function(value, options) {
|
|
5712
|
-
if (value === null || value === void 0)
|
|
5713
|
-
return "";
|
|
5695
|
+
if (value === null || value === void 0) return "";
|
|
5714
5696
|
return utils.commify(value);
|
|
5715
5697
|
},
|
|
5716
5698
|
onSendBefore: function(value, options) {
|
|
5717
|
-
if (value === null || value === void 0)
|
|
5718
|
-
return "";
|
|
5699
|
+
if (value === null || value === void 0) return "";
|
|
5719
5700
|
value = value.replace(/,/g, "");
|
|
5720
5701
|
return value;
|
|
5721
5702
|
}
|
|
@@ -5727,10 +5708,8 @@ var numberFormatter = {
|
|
|
5727
5708
|
return "" + value;
|
|
5728
5709
|
},
|
|
5729
5710
|
onSendBefore: function(value, options) {
|
|
5730
|
-
if (value.startsWith("."))
|
|
5731
|
-
|
|
5732
|
-
if (value === "00")
|
|
5733
|
-
return "0";
|
|
5711
|
+
if (value.startsWith(".")) return `0${value}`;
|
|
5712
|
+
if (value === "00") return "0";
|
|
5734
5713
|
value = value.replace(/[^\d.]/g, "").replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
|
|
5735
5714
|
return value;
|
|
5736
5715
|
}
|
|
@@ -5753,10 +5732,8 @@ var createRegexInputFormatter = (regex, onSendBefore) => ({
|
|
|
5753
5732
|
// src/input/formatter/dp.ts
|
|
5754
5733
|
var dpFormatter = (dp, config) => {
|
|
5755
5734
|
const onBefore = (value, options) => {
|
|
5756
|
-
if (typeof value === "number")
|
|
5757
|
-
|
|
5758
|
-
if (!value || value.endsWith("."))
|
|
5759
|
-
return value;
|
|
5735
|
+
if (typeof value === "number") value = value.toString();
|
|
5736
|
+
if (!value || value.endsWith(".")) return value;
|
|
5760
5737
|
return truncateNumber(value, dp);
|
|
5761
5738
|
};
|
|
5762
5739
|
return {
|
|
@@ -5776,12 +5753,9 @@ function truncateNumber(numStr, decimalPlaces) {
|
|
|
5776
5753
|
// src/input/formatter/range.ts
|
|
5777
5754
|
var rangeFormatter = (props) => {
|
|
5778
5755
|
const onBefore = (value, options) => {
|
|
5779
|
-
if (typeof value === "number")
|
|
5780
|
-
|
|
5781
|
-
if (value
|
|
5782
|
-
return "0.";
|
|
5783
|
-
if (!value || value.endsWith("."))
|
|
5784
|
-
return value;
|
|
5756
|
+
if (typeof value === "number") value = value.toString();
|
|
5757
|
+
if (value === ".") return "0.";
|
|
5758
|
+
if (!value || value.endsWith(".")) return value;
|
|
5785
5759
|
const { max, min, dp } = props;
|
|
5786
5760
|
const numValue = Number(value);
|
|
5787
5761
|
if (isNaN(numValue)) {
|
|
@@ -5811,28 +5785,21 @@ var identifierFormatter = () => {
|
|
|
5811
5785
|
const negative = "-";
|
|
5812
5786
|
return {
|
|
5813
5787
|
onRenderBefore: (value, options) => {
|
|
5814
|
-
if (typeof value === "number")
|
|
5815
|
-
|
|
5816
|
-
if (!value || value.endsWith("."))
|
|
5817
|
-
return value;
|
|
5788
|
+
if (typeof value === "number") value = value.toString();
|
|
5789
|
+
if (!value || value.endsWith(".")) return value;
|
|
5818
5790
|
const _value = Number(value);
|
|
5819
5791
|
if (_value) {
|
|
5820
|
-
if (_value > 0 && !value.startsWith(integer))
|
|
5821
|
-
|
|
5822
|
-
if (_value < 0 && !value.startsWith(negative))
|
|
5823
|
-
return negative + value;
|
|
5792
|
+
if (_value > 0 && !value.startsWith(integer)) return integer + value;
|
|
5793
|
+
if (_value < 0 && !value.startsWith(negative)) return negative + value;
|
|
5824
5794
|
}
|
|
5825
5795
|
return value;
|
|
5826
5796
|
},
|
|
5827
5797
|
onSendBefore: (value, options) => {
|
|
5828
|
-
if (typeof value === "number")
|
|
5829
|
-
|
|
5830
|
-
if (!value || value.endsWith("."))
|
|
5831
|
-
return value;
|
|
5798
|
+
if (typeof value === "number") value = value.toString();
|
|
5799
|
+
if (!value || value.endsWith(".")) return value;
|
|
5832
5800
|
const _value = Number(value);
|
|
5833
5801
|
if (_value) {
|
|
5834
|
-
if (_value > 0)
|
|
5835
|
-
return value.replace(integer, "");
|
|
5802
|
+
if (_value > 0) return value.replace(integer, "");
|
|
5836
5803
|
}
|
|
5837
5804
|
return value;
|
|
5838
5805
|
}
|
|
@@ -5843,14 +5810,12 @@ var decimalPointFormatter = {
|
|
|
5843
5810
|
return String(value);
|
|
5844
5811
|
},
|
|
5845
5812
|
onSendBefore: function(value, options) {
|
|
5846
|
-
if (value === null || value === void 0)
|
|
5847
|
-
return "";
|
|
5813
|
+
if (value === null || value === void 0) return "";
|
|
5848
5814
|
return replaceComma(value, options?.originValue);
|
|
5849
5815
|
}
|
|
5850
5816
|
};
|
|
5851
5817
|
var replaceComma = (value, originValue) => {
|
|
5852
|
-
if (value === null || value === void 0)
|
|
5853
|
-
return "";
|
|
5818
|
+
if (value === null || value === void 0) return "";
|
|
5854
5819
|
if (value.endsWith(",")) {
|
|
5855
5820
|
return value.slice(0, -1) + ".";
|
|
5856
5821
|
}
|
|
@@ -6266,8 +6231,7 @@ function useInit(params) {
|
|
|
6266
6231
|
const { dataSource, loading, ignoreLoadingCheck } = params;
|
|
6267
6232
|
const [initialized, setInitialized] = React68.useState(false);
|
|
6268
6233
|
React68.useEffect(() => {
|
|
6269
|
-
if (initialized)
|
|
6270
|
-
return;
|
|
6234
|
+
if (initialized) return;
|
|
6271
6235
|
if (ignoreLoadingCheck || loading || Array.isArray(dataSource)) {
|
|
6272
6236
|
setInitialized(true);
|
|
6273
6237
|
}
|
|
@@ -6361,8 +6325,7 @@ function useSort(props) {
|
|
|
6361
6325
|
function useWrap(deps) {
|
|
6362
6326
|
const wrapRef = React68.useRef(null);
|
|
6363
6327
|
React68.useEffect(() => {
|
|
6364
|
-
if (!wrapRef.current)
|
|
6365
|
-
return;
|
|
6328
|
+
if (!wrapRef.current) return;
|
|
6366
6329
|
const bgColor = window.getComputedStyle(wrapRef.current).backgroundColor;
|
|
6367
6330
|
wrapRef.current.style.setProperty("--oui-table-background-color", bgColor);
|
|
6368
6331
|
}, deps);
|
|
@@ -7194,12 +7157,9 @@ var TablePlaceholder = (props) => {
|
|
|
7194
7157
|
);
|
|
7195
7158
|
};
|
|
7196
7159
|
var compareValues = (aValue, bValue) => {
|
|
7197
|
-
if (aValue == null && bValue == null)
|
|
7198
|
-
|
|
7199
|
-
if (
|
|
7200
|
-
return 1;
|
|
7201
|
-
if (bValue == null)
|
|
7202
|
-
return -1;
|
|
7160
|
+
if (aValue == null && bValue == null) return 0;
|
|
7161
|
+
if (aValue == null) return 1;
|
|
7162
|
+
if (bValue == null) return -1;
|
|
7203
7163
|
const aStr = String(aValue).trim();
|
|
7204
7164
|
const bStr = String(bValue).trim();
|
|
7205
7165
|
const aNum = Number(aStr);
|
|
@@ -7239,12 +7199,9 @@ var createMultiSortComparator = (sortId, isDesc) => {
|
|
|
7239
7199
|
};
|
|
7240
7200
|
const aValue = getNestedValue(a, sortId) ?? a[sortId];
|
|
7241
7201
|
const bValue = getNestedValue(b, sortId) ?? b[sortId];
|
|
7242
|
-
if (aValue == null && bValue == null)
|
|
7243
|
-
|
|
7244
|
-
if (
|
|
7245
|
-
return 1;
|
|
7246
|
-
if (bValue == null)
|
|
7247
|
-
return -1;
|
|
7202
|
+
if (aValue == null && bValue == null) return 0;
|
|
7203
|
+
if (aValue == null) return 1;
|
|
7204
|
+
if (bValue == null) return -1;
|
|
7248
7205
|
const aNum = Number(aValue);
|
|
7249
7206
|
const bNum = Number(bValue);
|
|
7250
7207
|
if (!isNaN(aNum) && !isNaN(bNum)) {
|
|
@@ -7273,8 +7230,7 @@ var Transform = {
|
|
|
7273
7230
|
multiSort: {
|
|
7274
7231
|
...multiSort,
|
|
7275
7232
|
onSort: (fieldKey, sortOrder) => {
|
|
7276
|
-
if (!setSorting)
|
|
7277
|
-
return;
|
|
7233
|
+
if (!setSorting) return;
|
|
7278
7234
|
if (!sortOrder) {
|
|
7279
7235
|
setSorting([]);
|
|
7280
7236
|
} else {
|
|
@@ -7688,10 +7644,8 @@ var DateRangePicker = (props) => {
|
|
|
7688
7644
|
return placeholder ?? locale.selectDate;
|
|
7689
7645
|
}
|
|
7690
7646
|
const arr = [];
|
|
7691
|
-
if (dateRange.from)
|
|
7692
|
-
|
|
7693
|
-
if (dateRange.to)
|
|
7694
|
-
arr.push(dateFns.format(dateRange.to, formatString));
|
|
7647
|
+
if (dateRange.from) arr.push(dateFns.format(dateRange.from, formatString));
|
|
7648
|
+
if (dateRange.to) arr.push(dateFns.format(dateRange.to, formatString));
|
|
7695
7649
|
return `${arr.join(" - ")}`;
|
|
7696
7650
|
}, [dateRange, placeholder, locale]);
|
|
7697
7651
|
const onOpenChange = (nextOpen) => {
|
|
@@ -7793,16 +7747,18 @@ var DatePicker = (props) => {
|
|
|
7793
7747
|
value,
|
|
7794
7748
|
size,
|
|
7795
7749
|
className,
|
|
7750
|
+
children,
|
|
7796
7751
|
...calendarProps
|
|
7797
7752
|
} = props;
|
|
7798
7753
|
const [locale] = useLocale("picker");
|
|
7799
|
-
const { trigger } = selectVariants({ size
|
|
7754
|
+
const { trigger } = selectVariants({ size });
|
|
7800
7755
|
const [open, setOpen] = React68.useState(false);
|
|
7801
7756
|
const formattedValue = React68.useMemo(() => {
|
|
7802
7757
|
if (typeof value === "undefined") {
|
|
7803
7758
|
return placeholder ?? locale.selectDate;
|
|
7804
7759
|
}
|
|
7805
|
-
|
|
7760
|
+
return dateFns.format(value, dateFormat ?? "yyyy/MM/dd");
|
|
7761
|
+
}, [value, placeholder, locale, dateFormat]);
|
|
7806
7762
|
const onSelect = (day, selectedDay, activeModifiers, e) => {
|
|
7807
7763
|
calendarProps.onSelect?.(day, selectedDay, activeModifiers, e);
|
|
7808
7764
|
if (day) {
|
|
@@ -7818,21 +7774,38 @@ var DatePicker = (props) => {
|
|
|
7818
7774
|
contentProps: {
|
|
7819
7775
|
className: "oui-w-auto oui-p-0"
|
|
7820
7776
|
},
|
|
7821
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7822
|
-
|
|
7777
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7778
|
+
Calendar,
|
|
7779
|
+
{
|
|
7780
|
+
mode: "single",
|
|
7781
|
+
selected: value,
|
|
7782
|
+
onSelect,
|
|
7783
|
+
...calendarProps
|
|
7784
|
+
}
|
|
7785
|
+
),
|
|
7786
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7823
7787
|
"button",
|
|
7824
7788
|
{
|
|
7825
7789
|
className: trigger({
|
|
7826
|
-
className: "
|
|
7790
|
+
className: tailwindVariants.cnBase("oui-datepicker-trigger oui-group", className)
|
|
7827
7791
|
}),
|
|
7828
7792
|
children: [
|
|
7829
|
-
/* @__PURE__ */ jsxRuntime.
|
|
7830
|
-
|
|
7793
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "oui-flex oui-items-center oui-gap-x-2", children: [
|
|
7794
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "oui-datepicker-trigger-icon", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7795
|
+
CalendarIcon,
|
|
7796
|
+
{
|
|
7797
|
+
size: 14,
|
|
7798
|
+
className: "oui-text-inherit",
|
|
7799
|
+
opacity: 1
|
|
7800
|
+
}
|
|
7801
|
+
) }),
|
|
7802
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: formattedValue })
|
|
7803
|
+
] }),
|
|
7831
7804
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7832
7805
|
CaretDownIcon,
|
|
7833
7806
|
{
|
|
7834
7807
|
size: 12,
|
|
7835
|
-
className: "
|
|
7808
|
+
className: "oui-datepicker-trigger-arrow oui-text-inherit oui-transition-transform group-data-[state=closed]:oui-rotate-0 group-data-[state=open]:oui-rotate-180",
|
|
7836
7809
|
opacity: 1
|
|
7837
7810
|
}
|
|
7838
7811
|
)
|
|
@@ -8004,12 +7977,11 @@ var SheetDescription = React68__namespace.forwardRef(({ className, ...props }, r
|
|
|
8004
7977
|
SheetDescription.displayName = DialogPrimitive__namespace.Description.displayName;
|
|
8005
7978
|
|
|
8006
7979
|
// src/modal/utils.ts
|
|
8007
|
-
var symModalId = Symbol("modalId");
|
|
7980
|
+
var symModalId = /* @__PURE__ */ Symbol("modalId");
|
|
8008
7981
|
var uidSeed = 0;
|
|
8009
7982
|
var getUid = () => `__modal_${uidSeed++}`;
|
|
8010
7983
|
var getModalId = (modal2) => {
|
|
8011
|
-
if (typeof modal2 === "string")
|
|
8012
|
-
return modal2;
|
|
7984
|
+
if (typeof modal2 === "string") return modal2;
|
|
8013
7985
|
if (!modal2[symModalId]) {
|
|
8014
7986
|
modal2[symModalId] = getUid();
|
|
8015
7987
|
}
|
|
@@ -8124,8 +8096,7 @@ var create = (Comp) => {
|
|
|
8124
8096
|
};
|
|
8125
8097
|
}, [id, show2, defaultVisible]);
|
|
8126
8098
|
React68.useEffect(() => {
|
|
8127
|
-
if (keepMounted)
|
|
8128
|
-
modalActions.setStates(id, { keepMounted: true });
|
|
8099
|
+
if (keepMounted) modalActions.setStates(id, { keepMounted: true });
|
|
8129
8100
|
}, [id, keepMounted]);
|
|
8130
8101
|
const delayVisible = modals[id]?.delayVisible;
|
|
8131
8102
|
React68.useEffect(() => {
|
|
@@ -8133,8 +8104,7 @@ var create = (Comp) => {
|
|
|
8133
8104
|
show2(args);
|
|
8134
8105
|
}
|
|
8135
8106
|
}, [delayVisible, args, show2]);
|
|
8136
|
-
if (!shouldMount)
|
|
8137
|
-
return null;
|
|
8107
|
+
if (!shouldMount) return null;
|
|
8138
8108
|
return /* @__PURE__ */ jsxRuntime.jsx(ModalIdContext.Provider, { value: id, children: /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...props, ...args }) });
|
|
8139
8109
|
};
|
|
8140
8110
|
};
|
|
@@ -8702,8 +8672,7 @@ var SimpleDialogFooter = (props) => {
|
|
|
8702
8672
|
setPrimaryLoading(false);
|
|
8703
8673
|
};
|
|
8704
8674
|
}, [actions?.primary?.loading]);
|
|
8705
|
-
if (!actions)
|
|
8706
|
-
return null;
|
|
8675
|
+
if (!actions) return null;
|
|
8707
8676
|
const buttons = React68.useMemo(() => {
|
|
8708
8677
|
const buttons2 = [];
|
|
8709
8678
|
if (actions.secondary && typeof actions.secondary.onClick === "function") {
|
|
@@ -8743,8 +8712,7 @@ var SimpleDialogFooter = (props) => {
|
|
|
8743
8712
|
...rest,
|
|
8744
8713
|
"data-testid": actions.primary?.["data-testid"],
|
|
8745
8714
|
onClick: async (event) => {
|
|
8746
|
-
if (primaryLoading)
|
|
8747
|
-
return;
|
|
8715
|
+
if (primaryLoading) return;
|
|
8748
8716
|
try {
|
|
8749
8717
|
setPrimaryLoading(true);
|
|
8750
8718
|
await onClick(event);
|
|
@@ -8888,8 +8856,7 @@ function useLongPress(callback, longPressTime = 600) {
|
|
|
8888
8856
|
);
|
|
8889
8857
|
const handleMouseDown = React68.useCallback(
|
|
8890
8858
|
(e) => {
|
|
8891
|
-
if (e.button !== 0)
|
|
8892
|
-
return;
|
|
8859
|
+
if (e.button !== 0) return;
|
|
8893
8860
|
startLongPress(e);
|
|
8894
8861
|
},
|
|
8895
8862
|
[startLongPress]
|
|
@@ -8899,8 +8866,7 @@ function useLongPress(callback, longPressTime = 600) {
|
|
|
8899
8866
|
}, [clearLongPress]);
|
|
8900
8867
|
const handleMouseMove = React68.useCallback(
|
|
8901
8868
|
(e) => {
|
|
8902
|
-
if (isLongPressTriggeredRef.current)
|
|
8903
|
-
return;
|
|
8869
|
+
if (isLongPressTriggeredRef.current) return;
|
|
8904
8870
|
if (startPositionRef.current) {
|
|
8905
8871
|
const deltaX = Math.abs(e.clientX - startPositionRef.current.x);
|
|
8906
8872
|
const deltaY = Math.abs(e.clientY - startPositionRef.current.y);
|
|
@@ -8935,8 +8901,7 @@ function useLongPress(callback, longPressTime = 600) {
|
|
|
8935
8901
|
if (timeoutRef.current) {
|
|
8936
8902
|
e.preventDefault();
|
|
8937
8903
|
}
|
|
8938
|
-
if (isLongPressTriggeredRef.current)
|
|
8939
|
-
return;
|
|
8904
|
+
if (isLongPressTriggeredRef.current) return;
|
|
8940
8905
|
if (startPositionRef.current && e.touches[0]) {
|
|
8941
8906
|
const deltaX = Math.abs(
|
|
8942
8907
|
e.touches[0].clientX - startPositionRef.current.x
|
|
@@ -9889,15 +9854,13 @@ function useDrag(containerRef) {
|
|
|
9889
9854
|
const [startX, setStartX] = React68.useState(0);
|
|
9890
9855
|
const [scrollLeft, setScrollLeft] = React68.useState(0);
|
|
9891
9856
|
const handleMouseDown = (e) => {
|
|
9892
|
-
if (!containerRef.current)
|
|
9893
|
-
return;
|
|
9857
|
+
if (!containerRef.current) return;
|
|
9894
9858
|
setIsDragging(true);
|
|
9895
9859
|
setStartX(e.pageX - containerRef.current.offsetLeft);
|
|
9896
9860
|
setScrollLeft(containerRef.current.scrollLeft);
|
|
9897
9861
|
};
|
|
9898
9862
|
const handleMouseMove = (e) => {
|
|
9899
|
-
if (!isDragging || !containerRef.current)
|
|
9900
|
-
return;
|
|
9863
|
+
if (!isDragging || !containerRef.current) return;
|
|
9901
9864
|
e.preventDefault();
|
|
9902
9865
|
const x = e.pageX - containerRef.current.offsetLeft;
|
|
9903
9866
|
const walk = x - startX;
|
|
@@ -9918,12 +9881,10 @@ function useScroll2() {
|
|
|
9918
9881
|
const [tailingVisible, setTailingVisible] = React68.useState(false);
|
|
9919
9882
|
const containerRef = React68.useRef(null);
|
|
9920
9883
|
React68.useEffect(() => {
|
|
9921
|
-
if (!containerRef.current)
|
|
9922
|
-
return;
|
|
9884
|
+
if (!containerRef.current) return;
|
|
9923
9885
|
const handleScroll = () => {
|
|
9924
9886
|
const container2 = containerRef.current;
|
|
9925
|
-
if (!container2)
|
|
9926
|
-
return;
|
|
9887
|
+
if (!container2) return;
|
|
9927
9888
|
setLeadingVisible(container2.scrollLeft > 0);
|
|
9928
9889
|
setTailingVisible(
|
|
9929
9890
|
container2.scrollLeft + container2.clientWidth < container2.scrollWidth
|
|
@@ -9945,8 +9906,7 @@ function useScroll2() {
|
|
|
9945
9906
|
};
|
|
9946
9907
|
}, []);
|
|
9947
9908
|
React68.useEffect(() => {
|
|
9948
|
-
if (!containerRef.current)
|
|
9949
|
-
return;
|
|
9909
|
+
if (!containerRef.current) return;
|
|
9950
9910
|
const intersectionObserver = new IntersectionObserver((entries) => {
|
|
9951
9911
|
entries.forEach((entry) => {
|
|
9952
9912
|
if (entry.isIntersecting) ;
|
|
@@ -10879,8 +10839,7 @@ var ListViewInner = (props, ref) => {
|
|
|
10879
10839
|
return props.dataSource.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(React68__namespace.default.Fragment, { children: props.renderItem(item, index, props.extraData) }, index));
|
|
10880
10840
|
}, [emptyDataSouce, props.dataSource, props.extraData, props.emptyView]);
|
|
10881
10841
|
const loadingViewElement = React68.useMemo(() => {
|
|
10882
|
-
if ((props.dataSource?.length || 0) === 0)
|
|
10883
|
-
return null;
|
|
10842
|
+
if ((props.dataSource?.length || 0) === 0) return null;
|
|
10884
10843
|
if (!props.isLoading) {
|
|
10885
10844
|
return null;
|
|
10886
10845
|
}
|
|
@@ -11345,8 +11304,7 @@ var Either = React68.memo((props) => {
|
|
|
11345
11304
|
|
|
11346
11305
|
// src/utils/string.ts
|
|
11347
11306
|
var capitalizeFirstLetter = (str, fallback) => {
|
|
11348
|
-
if (typeof str === "undefined" || str === null)
|
|
11349
|
-
return fallback ?? void 0;
|
|
11307
|
+
if (typeof str === "undefined" || str === null) return fallback ?? void 0;
|
|
11350
11308
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
11351
11309
|
};
|
|
11352
11310
|
|
|
@@ -11724,5 +11682,5 @@ Object.keys(emblaCarouselAutoplay).forEach(function (k) {
|
|
|
11724
11682
|
get: function () { return emblaCarouselAutoplay[k]; }
|
|
11725
11683
|
});
|
|
11726
11684
|
});
|
|
11727
|
-
//# sourceMappingURL=
|
|
11685
|
+
//# sourceMappingURL=index.js.map
|
|
11728
11686
|
//# sourceMappingURL=index.js.map
|