@esic-lab/data-core-ui 0.0.17 → 0.0.19
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 +2 -2
- package/dist/index.d.mts +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +919 -132
- package/dist/index.mjs +912 -126
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -466,6 +466,7 @@ __export(index_exports, {
|
|
|
466
466
|
Calendar: () => Calendar,
|
|
467
467
|
Checkbox: () => Checkbox,
|
|
468
468
|
CheckboxGroup: () => CheckboxGroup,
|
|
469
|
+
ColorPalettePickerBasic: () => ColorPalettePickerBasic,
|
|
469
470
|
ColorPickerBasic: () => ColorPickerBasic,
|
|
470
471
|
DataTable: () => DataTable,
|
|
471
472
|
DatePickerBasic: () => DatePickerBasic,
|
|
@@ -928,7 +929,8 @@ function AntDataTable({
|
|
|
928
929
|
theme: {
|
|
929
930
|
components: {},
|
|
930
931
|
token: {
|
|
931
|
-
fontFamily: "Kanit"
|
|
932
|
+
fontFamily: "Kanit",
|
|
933
|
+
fontSize: 14
|
|
932
934
|
}
|
|
933
935
|
},
|
|
934
936
|
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
@@ -1231,7 +1233,8 @@ function TextAreaInput({
|
|
|
1231
1233
|
theme: {
|
|
1232
1234
|
components: {},
|
|
1233
1235
|
token: {
|
|
1234
|
-
fontFamily: "Kanit"
|
|
1236
|
+
fontFamily: "Kanit",
|
|
1237
|
+
fontSize: 16
|
|
1235
1238
|
}
|
|
1236
1239
|
},
|
|
1237
1240
|
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
|
|
@@ -1357,7 +1360,8 @@ function DatePickerBasic({
|
|
|
1357
1360
|
locale: import_th_TH.default,
|
|
1358
1361
|
theme: {
|
|
1359
1362
|
token: {
|
|
1360
|
-
fontFamily: "Kanit"
|
|
1363
|
+
fontFamily: "Kanit",
|
|
1364
|
+
fontSize: 16
|
|
1361
1365
|
}
|
|
1362
1366
|
},
|
|
1363
1367
|
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "container-input", children: [
|
|
@@ -1427,7 +1431,8 @@ function DatePickerRangePicker({
|
|
|
1427
1431
|
locale: import_th_TH2.default,
|
|
1428
1432
|
theme: {
|
|
1429
1433
|
token: {
|
|
1430
|
-
fontFamily: "Kanit"
|
|
1434
|
+
fontFamily: "Kanit",
|
|
1435
|
+
fontSize: 16
|
|
1431
1436
|
}
|
|
1432
1437
|
},
|
|
1433
1438
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "container-input", children: [
|
|
@@ -1555,9 +1560,789 @@ function TimePickerRangePicker({
|
|
|
1555
1560
|
);
|
|
1556
1561
|
}
|
|
1557
1562
|
|
|
1558
|
-
// src/
|
|
1563
|
+
// src/ColorPalettePicker/ColorPalettePicker.tsx
|
|
1559
1564
|
var import_antd9 = require("antd");
|
|
1565
|
+
|
|
1566
|
+
// node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
1567
|
+
function _typeof(o) {
|
|
1568
|
+
"@babel/helpers - typeof";
|
|
1569
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
1570
|
+
return typeof o2;
|
|
1571
|
+
} : function(o2) {
|
|
1572
|
+
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
1573
|
+
}, _typeof(o);
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
// node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
1577
|
+
function toPrimitive(t, r) {
|
|
1578
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
1579
|
+
var e = t[Symbol.toPrimitive];
|
|
1580
|
+
if (void 0 !== e) {
|
|
1581
|
+
var i = e.call(t, r || "default");
|
|
1582
|
+
if ("object" != _typeof(i)) return i;
|
|
1583
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1584
|
+
}
|
|
1585
|
+
return ("string" === r ? String : Number)(t);
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
// node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
|
1589
|
+
function toPropertyKey(t) {
|
|
1590
|
+
var i = toPrimitive(t, "string");
|
|
1591
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
// node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
1595
|
+
function _defineProperty(e, r, t) {
|
|
1596
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
1597
|
+
value: t,
|
|
1598
|
+
enumerable: true,
|
|
1599
|
+
configurable: true,
|
|
1600
|
+
writable: true
|
|
1601
|
+
}) : e[r] = t, e;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
// node_modules/@ant-design/fast-color/es/FastColor.js
|
|
1605
|
+
var round = Math.round;
|
|
1606
|
+
function splitColorStr(str, parseNum) {
|
|
1607
|
+
const match = str.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [];
|
|
1608
|
+
const numList = match.map((item) => parseFloat(item));
|
|
1609
|
+
for (let i = 0; i < 3; i += 1) {
|
|
1610
|
+
numList[i] = parseNum(numList[i] || 0, match[i] || "", i);
|
|
1611
|
+
}
|
|
1612
|
+
if (match[3]) {
|
|
1613
|
+
numList[3] = match[3].includes("%") ? numList[3] / 100 : numList[3];
|
|
1614
|
+
} else {
|
|
1615
|
+
numList[3] = 1;
|
|
1616
|
+
}
|
|
1617
|
+
return numList;
|
|
1618
|
+
}
|
|
1619
|
+
var parseHSVorHSL = (num, _, index) => index === 0 ? num : num / 100;
|
|
1620
|
+
function limitRange(value, max) {
|
|
1621
|
+
const mergedMax = max || 255;
|
|
1622
|
+
if (value > mergedMax) {
|
|
1623
|
+
return mergedMax;
|
|
1624
|
+
}
|
|
1625
|
+
if (value < 0) {
|
|
1626
|
+
return 0;
|
|
1627
|
+
}
|
|
1628
|
+
return value;
|
|
1629
|
+
}
|
|
1630
|
+
var FastColor = class _FastColor {
|
|
1631
|
+
constructor(input) {
|
|
1632
|
+
_defineProperty(this, "isValid", true);
|
|
1633
|
+
_defineProperty(this, "r", 0);
|
|
1634
|
+
_defineProperty(this, "g", 0);
|
|
1635
|
+
_defineProperty(this, "b", 0);
|
|
1636
|
+
_defineProperty(this, "a", 1);
|
|
1637
|
+
_defineProperty(this, "_h", void 0);
|
|
1638
|
+
_defineProperty(this, "_s", void 0);
|
|
1639
|
+
_defineProperty(this, "_l", void 0);
|
|
1640
|
+
_defineProperty(this, "_v", void 0);
|
|
1641
|
+
_defineProperty(this, "_max", void 0);
|
|
1642
|
+
_defineProperty(this, "_min", void 0);
|
|
1643
|
+
_defineProperty(this, "_brightness", void 0);
|
|
1644
|
+
function matchFormat(str) {
|
|
1645
|
+
return str[0] in input && str[1] in input && str[2] in input;
|
|
1646
|
+
}
|
|
1647
|
+
if (!input) {
|
|
1648
|
+
} else if (typeof input === "string") {
|
|
1649
|
+
let matchPrefix2 = function(prefix) {
|
|
1650
|
+
return trimStr.startsWith(prefix);
|
|
1651
|
+
};
|
|
1652
|
+
var matchPrefix = matchPrefix2;
|
|
1653
|
+
const trimStr = input.trim();
|
|
1654
|
+
if (/^#?[A-F\d]{3,8}$/i.test(trimStr)) {
|
|
1655
|
+
this.fromHexString(trimStr);
|
|
1656
|
+
} else if (matchPrefix2("rgb")) {
|
|
1657
|
+
this.fromRgbString(trimStr);
|
|
1658
|
+
} else if (matchPrefix2("hsl")) {
|
|
1659
|
+
this.fromHslString(trimStr);
|
|
1660
|
+
} else if (matchPrefix2("hsv") || matchPrefix2("hsb")) {
|
|
1661
|
+
this.fromHsvString(trimStr);
|
|
1662
|
+
}
|
|
1663
|
+
} else if (input instanceof _FastColor) {
|
|
1664
|
+
this.r = input.r;
|
|
1665
|
+
this.g = input.g;
|
|
1666
|
+
this.b = input.b;
|
|
1667
|
+
this.a = input.a;
|
|
1668
|
+
this._h = input._h;
|
|
1669
|
+
this._s = input._s;
|
|
1670
|
+
this._l = input._l;
|
|
1671
|
+
this._v = input._v;
|
|
1672
|
+
} else if (matchFormat("rgb")) {
|
|
1673
|
+
this.r = limitRange(input.r);
|
|
1674
|
+
this.g = limitRange(input.g);
|
|
1675
|
+
this.b = limitRange(input.b);
|
|
1676
|
+
this.a = typeof input.a === "number" ? limitRange(input.a, 1) : 1;
|
|
1677
|
+
} else if (matchFormat("hsl")) {
|
|
1678
|
+
this.fromHsl(input);
|
|
1679
|
+
} else if (matchFormat("hsv")) {
|
|
1680
|
+
this.fromHsv(input);
|
|
1681
|
+
} else {
|
|
1682
|
+
throw new Error("@ant-design/fast-color: unsupported input " + JSON.stringify(input));
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
// ======================= Setter =======================
|
|
1686
|
+
setR(value) {
|
|
1687
|
+
return this._sc("r", value);
|
|
1688
|
+
}
|
|
1689
|
+
setG(value) {
|
|
1690
|
+
return this._sc("g", value);
|
|
1691
|
+
}
|
|
1692
|
+
setB(value) {
|
|
1693
|
+
return this._sc("b", value);
|
|
1694
|
+
}
|
|
1695
|
+
setA(value) {
|
|
1696
|
+
return this._sc("a", value, 1);
|
|
1697
|
+
}
|
|
1698
|
+
setHue(value) {
|
|
1699
|
+
const hsv = this.toHsv();
|
|
1700
|
+
hsv.h = value;
|
|
1701
|
+
return this._c(hsv);
|
|
1702
|
+
}
|
|
1703
|
+
// ======================= Getter =======================
|
|
1704
|
+
/**
|
|
1705
|
+
* Returns the perceived luminance of a color, from 0-1.
|
|
1706
|
+
* @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
1707
|
+
*/
|
|
1708
|
+
getLuminance() {
|
|
1709
|
+
function adjustGamma(raw) {
|
|
1710
|
+
const val = raw / 255;
|
|
1711
|
+
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
|
|
1712
|
+
}
|
|
1713
|
+
const R = adjustGamma(this.r);
|
|
1714
|
+
const G = adjustGamma(this.g);
|
|
1715
|
+
const B = adjustGamma(this.b);
|
|
1716
|
+
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
1717
|
+
}
|
|
1718
|
+
getHue() {
|
|
1719
|
+
if (typeof this._h === "undefined") {
|
|
1720
|
+
const delta = this.getMax() - this.getMin();
|
|
1721
|
+
if (delta === 0) {
|
|
1722
|
+
this._h = 0;
|
|
1723
|
+
} else {
|
|
1724
|
+
this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
return this._h;
|
|
1728
|
+
}
|
|
1729
|
+
getSaturation() {
|
|
1730
|
+
if (typeof this._s === "undefined") {
|
|
1731
|
+
const delta = this.getMax() - this.getMin();
|
|
1732
|
+
if (delta === 0) {
|
|
1733
|
+
this._s = 0;
|
|
1734
|
+
} else {
|
|
1735
|
+
this._s = delta / this.getMax();
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
return this._s;
|
|
1739
|
+
}
|
|
1740
|
+
getLightness() {
|
|
1741
|
+
if (typeof this._l === "undefined") {
|
|
1742
|
+
this._l = (this.getMax() + this.getMin()) / 510;
|
|
1743
|
+
}
|
|
1744
|
+
return this._l;
|
|
1745
|
+
}
|
|
1746
|
+
getValue() {
|
|
1747
|
+
if (typeof this._v === "undefined") {
|
|
1748
|
+
this._v = this.getMax() / 255;
|
|
1749
|
+
}
|
|
1750
|
+
return this._v;
|
|
1751
|
+
}
|
|
1752
|
+
/**
|
|
1753
|
+
* Returns the perceived brightness of the color, from 0-255.
|
|
1754
|
+
* Note: this is not the b of HSB
|
|
1755
|
+
* @see http://www.w3.org/TR/AERT#color-contrast
|
|
1756
|
+
*/
|
|
1757
|
+
getBrightness() {
|
|
1758
|
+
if (typeof this._brightness === "undefined") {
|
|
1759
|
+
this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1e3;
|
|
1760
|
+
}
|
|
1761
|
+
return this._brightness;
|
|
1762
|
+
}
|
|
1763
|
+
// ======================== Func ========================
|
|
1764
|
+
darken(amount = 10) {
|
|
1765
|
+
const h = this.getHue();
|
|
1766
|
+
const s = this.getSaturation();
|
|
1767
|
+
let l = this.getLightness() - amount / 100;
|
|
1768
|
+
if (l < 0) {
|
|
1769
|
+
l = 0;
|
|
1770
|
+
}
|
|
1771
|
+
return this._c({
|
|
1772
|
+
h,
|
|
1773
|
+
s,
|
|
1774
|
+
l,
|
|
1775
|
+
a: this.a
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
1778
|
+
lighten(amount = 10) {
|
|
1779
|
+
const h = this.getHue();
|
|
1780
|
+
const s = this.getSaturation();
|
|
1781
|
+
let l = this.getLightness() + amount / 100;
|
|
1782
|
+
if (l > 1) {
|
|
1783
|
+
l = 1;
|
|
1784
|
+
}
|
|
1785
|
+
return this._c({
|
|
1786
|
+
h,
|
|
1787
|
+
s,
|
|
1788
|
+
l,
|
|
1789
|
+
a: this.a
|
|
1790
|
+
});
|
|
1791
|
+
}
|
|
1792
|
+
/**
|
|
1793
|
+
* Mix the current color a given amount with another color, from 0 to 100.
|
|
1794
|
+
* 0 means no mixing (return current color).
|
|
1795
|
+
*/
|
|
1796
|
+
mix(input, amount = 50) {
|
|
1797
|
+
const color = this._c(input);
|
|
1798
|
+
const p = amount / 100;
|
|
1799
|
+
const calc = (key) => (color[key] - this[key]) * p + this[key];
|
|
1800
|
+
const rgba = {
|
|
1801
|
+
r: round(calc("r")),
|
|
1802
|
+
g: round(calc("g")),
|
|
1803
|
+
b: round(calc("b")),
|
|
1804
|
+
a: round(calc("a") * 100) / 100
|
|
1805
|
+
};
|
|
1806
|
+
return this._c(rgba);
|
|
1807
|
+
}
|
|
1808
|
+
/**
|
|
1809
|
+
* Mix the color with pure white, from 0 to 100.
|
|
1810
|
+
* Providing 0 will do nothing, providing 100 will always return white.
|
|
1811
|
+
*/
|
|
1812
|
+
tint(amount = 10) {
|
|
1813
|
+
return this.mix({
|
|
1814
|
+
r: 255,
|
|
1815
|
+
g: 255,
|
|
1816
|
+
b: 255,
|
|
1817
|
+
a: 1
|
|
1818
|
+
}, amount);
|
|
1819
|
+
}
|
|
1820
|
+
/**
|
|
1821
|
+
* Mix the color with pure black, from 0 to 100.
|
|
1822
|
+
* Providing 0 will do nothing, providing 100 will always return black.
|
|
1823
|
+
*/
|
|
1824
|
+
shade(amount = 10) {
|
|
1825
|
+
return this.mix({
|
|
1826
|
+
r: 0,
|
|
1827
|
+
g: 0,
|
|
1828
|
+
b: 0,
|
|
1829
|
+
a: 1
|
|
1830
|
+
}, amount);
|
|
1831
|
+
}
|
|
1832
|
+
onBackground(background) {
|
|
1833
|
+
const bg = this._c(background);
|
|
1834
|
+
const alpha = this.a + bg.a * (1 - this.a);
|
|
1835
|
+
const calc = (key) => {
|
|
1836
|
+
return round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha);
|
|
1837
|
+
};
|
|
1838
|
+
return this._c({
|
|
1839
|
+
r: calc("r"),
|
|
1840
|
+
g: calc("g"),
|
|
1841
|
+
b: calc("b"),
|
|
1842
|
+
a: alpha
|
|
1843
|
+
});
|
|
1844
|
+
}
|
|
1845
|
+
// ======================= Status =======================
|
|
1846
|
+
isDark() {
|
|
1847
|
+
return this.getBrightness() < 128;
|
|
1848
|
+
}
|
|
1849
|
+
isLight() {
|
|
1850
|
+
return this.getBrightness() >= 128;
|
|
1851
|
+
}
|
|
1852
|
+
// ======================== MISC ========================
|
|
1853
|
+
equals(other) {
|
|
1854
|
+
return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
|
|
1855
|
+
}
|
|
1856
|
+
clone() {
|
|
1857
|
+
return this._c(this);
|
|
1858
|
+
}
|
|
1859
|
+
// ======================= Format =======================
|
|
1860
|
+
toHexString() {
|
|
1861
|
+
let hex = "#";
|
|
1862
|
+
const rHex = (this.r || 0).toString(16);
|
|
1863
|
+
hex += rHex.length === 2 ? rHex : "0" + rHex;
|
|
1864
|
+
const gHex = (this.g || 0).toString(16);
|
|
1865
|
+
hex += gHex.length === 2 ? gHex : "0" + gHex;
|
|
1866
|
+
const bHex = (this.b || 0).toString(16);
|
|
1867
|
+
hex += bHex.length === 2 ? bHex : "0" + bHex;
|
|
1868
|
+
if (typeof this.a === "number" && this.a >= 0 && this.a < 1) {
|
|
1869
|
+
const aHex = round(this.a * 255).toString(16);
|
|
1870
|
+
hex += aHex.length === 2 ? aHex : "0" + aHex;
|
|
1871
|
+
}
|
|
1872
|
+
return hex;
|
|
1873
|
+
}
|
|
1874
|
+
/** CSS support color pattern */
|
|
1875
|
+
toHsl() {
|
|
1876
|
+
return {
|
|
1877
|
+
h: this.getHue(),
|
|
1878
|
+
s: this.getSaturation(),
|
|
1879
|
+
l: this.getLightness(),
|
|
1880
|
+
a: this.a
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1883
|
+
/** CSS support color pattern */
|
|
1884
|
+
toHslString() {
|
|
1885
|
+
const h = this.getHue();
|
|
1886
|
+
const s = round(this.getSaturation() * 100);
|
|
1887
|
+
const l = round(this.getLightness() * 100);
|
|
1888
|
+
return this.a !== 1 ? `hsla(${h},${s}%,${l}%,${this.a})` : `hsl(${h},${s}%,${l}%)`;
|
|
1889
|
+
}
|
|
1890
|
+
/** Same as toHsb */
|
|
1891
|
+
toHsv() {
|
|
1892
|
+
return {
|
|
1893
|
+
h: this.getHue(),
|
|
1894
|
+
s: this.getSaturation(),
|
|
1895
|
+
v: this.getValue(),
|
|
1896
|
+
a: this.a
|
|
1897
|
+
};
|
|
1898
|
+
}
|
|
1899
|
+
toRgb() {
|
|
1900
|
+
return {
|
|
1901
|
+
r: this.r,
|
|
1902
|
+
g: this.g,
|
|
1903
|
+
b: this.b,
|
|
1904
|
+
a: this.a
|
|
1905
|
+
};
|
|
1906
|
+
}
|
|
1907
|
+
toRgbString() {
|
|
1908
|
+
return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;
|
|
1909
|
+
}
|
|
1910
|
+
toString() {
|
|
1911
|
+
return this.toRgbString();
|
|
1912
|
+
}
|
|
1913
|
+
// ====================== Privates ======================
|
|
1914
|
+
/** Return a new FastColor object with one channel changed */
|
|
1915
|
+
_sc(rgb, value, max) {
|
|
1916
|
+
const clone = this.clone();
|
|
1917
|
+
clone[rgb] = limitRange(value, max);
|
|
1918
|
+
return clone;
|
|
1919
|
+
}
|
|
1920
|
+
_c(input) {
|
|
1921
|
+
return new this.constructor(input);
|
|
1922
|
+
}
|
|
1923
|
+
getMax() {
|
|
1924
|
+
if (typeof this._max === "undefined") {
|
|
1925
|
+
this._max = Math.max(this.r, this.g, this.b);
|
|
1926
|
+
}
|
|
1927
|
+
return this._max;
|
|
1928
|
+
}
|
|
1929
|
+
getMin() {
|
|
1930
|
+
if (typeof this._min === "undefined") {
|
|
1931
|
+
this._min = Math.min(this.r, this.g, this.b);
|
|
1932
|
+
}
|
|
1933
|
+
return this._min;
|
|
1934
|
+
}
|
|
1935
|
+
fromHexString(trimStr) {
|
|
1936
|
+
const withoutPrefix = trimStr.replace("#", "");
|
|
1937
|
+
function connectNum(index1, index2) {
|
|
1938
|
+
return parseInt(withoutPrefix[index1] + withoutPrefix[index2 || index1], 16);
|
|
1939
|
+
}
|
|
1940
|
+
if (withoutPrefix.length < 6) {
|
|
1941
|
+
this.r = connectNum(0);
|
|
1942
|
+
this.g = connectNum(1);
|
|
1943
|
+
this.b = connectNum(2);
|
|
1944
|
+
this.a = withoutPrefix[3] ? connectNum(3) / 255 : 1;
|
|
1945
|
+
} else {
|
|
1946
|
+
this.r = connectNum(0, 1);
|
|
1947
|
+
this.g = connectNum(2, 3);
|
|
1948
|
+
this.b = connectNum(4, 5);
|
|
1949
|
+
this.a = withoutPrefix[6] ? connectNum(6, 7) / 255 : 1;
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
fromHsl({
|
|
1953
|
+
h,
|
|
1954
|
+
s,
|
|
1955
|
+
l,
|
|
1956
|
+
a
|
|
1957
|
+
}) {
|
|
1958
|
+
this._h = h % 360;
|
|
1959
|
+
this._s = s;
|
|
1960
|
+
this._l = l;
|
|
1961
|
+
this.a = typeof a === "number" ? a : 1;
|
|
1962
|
+
if (s <= 0) {
|
|
1963
|
+
const rgb = round(l * 255);
|
|
1964
|
+
this.r = rgb;
|
|
1965
|
+
this.g = rgb;
|
|
1966
|
+
this.b = rgb;
|
|
1967
|
+
}
|
|
1968
|
+
let r = 0, g = 0, b = 0;
|
|
1969
|
+
const huePrime = h / 60;
|
|
1970
|
+
const chroma = (1 - Math.abs(2 * l - 1)) * s;
|
|
1971
|
+
const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
|
|
1972
|
+
if (huePrime >= 0 && huePrime < 1) {
|
|
1973
|
+
r = chroma;
|
|
1974
|
+
g = secondComponent;
|
|
1975
|
+
} else if (huePrime >= 1 && huePrime < 2) {
|
|
1976
|
+
r = secondComponent;
|
|
1977
|
+
g = chroma;
|
|
1978
|
+
} else if (huePrime >= 2 && huePrime < 3) {
|
|
1979
|
+
g = chroma;
|
|
1980
|
+
b = secondComponent;
|
|
1981
|
+
} else if (huePrime >= 3 && huePrime < 4) {
|
|
1982
|
+
g = secondComponent;
|
|
1983
|
+
b = chroma;
|
|
1984
|
+
} else if (huePrime >= 4 && huePrime < 5) {
|
|
1985
|
+
r = secondComponent;
|
|
1986
|
+
b = chroma;
|
|
1987
|
+
} else if (huePrime >= 5 && huePrime < 6) {
|
|
1988
|
+
r = chroma;
|
|
1989
|
+
b = secondComponent;
|
|
1990
|
+
}
|
|
1991
|
+
const lightnessModification = l - chroma / 2;
|
|
1992
|
+
this.r = round((r + lightnessModification) * 255);
|
|
1993
|
+
this.g = round((g + lightnessModification) * 255);
|
|
1994
|
+
this.b = round((b + lightnessModification) * 255);
|
|
1995
|
+
}
|
|
1996
|
+
fromHsv({
|
|
1997
|
+
h,
|
|
1998
|
+
s,
|
|
1999
|
+
v,
|
|
2000
|
+
a
|
|
2001
|
+
}) {
|
|
2002
|
+
this._h = h % 360;
|
|
2003
|
+
this._s = s;
|
|
2004
|
+
this._v = v;
|
|
2005
|
+
this.a = typeof a === "number" ? a : 1;
|
|
2006
|
+
const vv = round(v * 255);
|
|
2007
|
+
this.r = vv;
|
|
2008
|
+
this.g = vv;
|
|
2009
|
+
this.b = vv;
|
|
2010
|
+
if (s <= 0) {
|
|
2011
|
+
return;
|
|
2012
|
+
}
|
|
2013
|
+
const hh = h / 60;
|
|
2014
|
+
const i = Math.floor(hh);
|
|
2015
|
+
const ff = hh - i;
|
|
2016
|
+
const p = round(v * (1 - s) * 255);
|
|
2017
|
+
const q = round(v * (1 - s * ff) * 255);
|
|
2018
|
+
const t = round(v * (1 - s * (1 - ff)) * 255);
|
|
2019
|
+
switch (i) {
|
|
2020
|
+
case 0:
|
|
2021
|
+
this.g = t;
|
|
2022
|
+
this.b = p;
|
|
2023
|
+
break;
|
|
2024
|
+
case 1:
|
|
2025
|
+
this.r = q;
|
|
2026
|
+
this.b = p;
|
|
2027
|
+
break;
|
|
2028
|
+
case 2:
|
|
2029
|
+
this.r = p;
|
|
2030
|
+
this.b = t;
|
|
2031
|
+
break;
|
|
2032
|
+
case 3:
|
|
2033
|
+
this.r = p;
|
|
2034
|
+
this.g = q;
|
|
2035
|
+
break;
|
|
2036
|
+
case 4:
|
|
2037
|
+
this.r = t;
|
|
2038
|
+
this.g = p;
|
|
2039
|
+
break;
|
|
2040
|
+
case 5:
|
|
2041
|
+
default:
|
|
2042
|
+
this.g = p;
|
|
2043
|
+
this.b = q;
|
|
2044
|
+
break;
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
fromHsvString(trimStr) {
|
|
2048
|
+
const cells = splitColorStr(trimStr, parseHSVorHSL);
|
|
2049
|
+
this.fromHsv({
|
|
2050
|
+
h: cells[0],
|
|
2051
|
+
s: cells[1],
|
|
2052
|
+
v: cells[2],
|
|
2053
|
+
a: cells[3]
|
|
2054
|
+
});
|
|
2055
|
+
}
|
|
2056
|
+
fromHslString(trimStr) {
|
|
2057
|
+
const cells = splitColorStr(trimStr, parseHSVorHSL);
|
|
2058
|
+
this.fromHsl({
|
|
2059
|
+
h: cells[0],
|
|
2060
|
+
s: cells[1],
|
|
2061
|
+
l: cells[2],
|
|
2062
|
+
a: cells[3]
|
|
2063
|
+
});
|
|
2064
|
+
}
|
|
2065
|
+
fromRgbString(trimStr) {
|
|
2066
|
+
const cells = splitColorStr(trimStr, (num, txt) => (
|
|
2067
|
+
// Convert percentage to number. e.g. 50% -> 128
|
|
2068
|
+
txt.includes("%") ? round(num / 100 * 255) : num
|
|
2069
|
+
));
|
|
2070
|
+
this.r = cells[0];
|
|
2071
|
+
this.g = cells[1];
|
|
2072
|
+
this.b = cells[2];
|
|
2073
|
+
this.a = cells[3];
|
|
2074
|
+
}
|
|
2075
|
+
};
|
|
2076
|
+
|
|
2077
|
+
// node_modules/@ant-design/colors/es/generate.js
|
|
2078
|
+
var hueStep = 2;
|
|
2079
|
+
var saturationStep = 0.16;
|
|
2080
|
+
var saturationStep2 = 0.05;
|
|
2081
|
+
var brightnessStep1 = 0.05;
|
|
2082
|
+
var brightnessStep2 = 0.15;
|
|
2083
|
+
var lightColorCount = 5;
|
|
2084
|
+
var darkColorCount = 4;
|
|
2085
|
+
var darkColorMap = [{
|
|
2086
|
+
index: 7,
|
|
2087
|
+
amount: 15
|
|
2088
|
+
}, {
|
|
2089
|
+
index: 6,
|
|
2090
|
+
amount: 25
|
|
2091
|
+
}, {
|
|
2092
|
+
index: 5,
|
|
2093
|
+
amount: 30
|
|
2094
|
+
}, {
|
|
2095
|
+
index: 5,
|
|
2096
|
+
amount: 45
|
|
2097
|
+
}, {
|
|
2098
|
+
index: 5,
|
|
2099
|
+
amount: 65
|
|
2100
|
+
}, {
|
|
2101
|
+
index: 5,
|
|
2102
|
+
amount: 85
|
|
2103
|
+
}, {
|
|
2104
|
+
index: 4,
|
|
2105
|
+
amount: 90
|
|
2106
|
+
}, {
|
|
2107
|
+
index: 3,
|
|
2108
|
+
amount: 95
|
|
2109
|
+
}, {
|
|
2110
|
+
index: 2,
|
|
2111
|
+
amount: 97
|
|
2112
|
+
}, {
|
|
2113
|
+
index: 1,
|
|
2114
|
+
amount: 98
|
|
2115
|
+
}];
|
|
2116
|
+
function getHue(hsv, i, light) {
|
|
2117
|
+
var hue;
|
|
2118
|
+
if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
|
|
2119
|
+
hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
|
|
2120
|
+
} else {
|
|
2121
|
+
hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
|
|
2122
|
+
}
|
|
2123
|
+
if (hue < 0) {
|
|
2124
|
+
hue += 360;
|
|
2125
|
+
} else if (hue >= 360) {
|
|
2126
|
+
hue -= 360;
|
|
2127
|
+
}
|
|
2128
|
+
return hue;
|
|
2129
|
+
}
|
|
2130
|
+
function getSaturation(hsv, i, light) {
|
|
2131
|
+
if (hsv.h === 0 && hsv.s === 0) {
|
|
2132
|
+
return hsv.s;
|
|
2133
|
+
}
|
|
2134
|
+
var saturation;
|
|
2135
|
+
if (light) {
|
|
2136
|
+
saturation = hsv.s - saturationStep * i;
|
|
2137
|
+
} else if (i === darkColorCount) {
|
|
2138
|
+
saturation = hsv.s + saturationStep;
|
|
2139
|
+
} else {
|
|
2140
|
+
saturation = hsv.s + saturationStep2 * i;
|
|
2141
|
+
}
|
|
2142
|
+
if (saturation > 1) {
|
|
2143
|
+
saturation = 1;
|
|
2144
|
+
}
|
|
2145
|
+
if (light && i === lightColorCount && saturation > 0.1) {
|
|
2146
|
+
saturation = 0.1;
|
|
2147
|
+
}
|
|
2148
|
+
if (saturation < 0.06) {
|
|
2149
|
+
saturation = 0.06;
|
|
2150
|
+
}
|
|
2151
|
+
return Math.round(saturation * 100) / 100;
|
|
2152
|
+
}
|
|
2153
|
+
function getValue(hsv, i, light) {
|
|
2154
|
+
var value;
|
|
2155
|
+
if (light) {
|
|
2156
|
+
value = hsv.v + brightnessStep1 * i;
|
|
2157
|
+
} else {
|
|
2158
|
+
value = hsv.v - brightnessStep2 * i;
|
|
2159
|
+
}
|
|
2160
|
+
value = Math.max(0, Math.min(1, value));
|
|
2161
|
+
return Math.round(value * 100) / 100;
|
|
2162
|
+
}
|
|
2163
|
+
function generate(color) {
|
|
2164
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2165
|
+
var patterns = [];
|
|
2166
|
+
var pColor = new FastColor(color);
|
|
2167
|
+
var hsv = pColor.toHsv();
|
|
2168
|
+
for (var i = lightColorCount; i > 0; i -= 1) {
|
|
2169
|
+
var c = new FastColor({
|
|
2170
|
+
h: getHue(hsv, i, true),
|
|
2171
|
+
s: getSaturation(hsv, i, true),
|
|
2172
|
+
v: getValue(hsv, i, true)
|
|
2173
|
+
});
|
|
2174
|
+
patterns.push(c);
|
|
2175
|
+
}
|
|
2176
|
+
patterns.push(pColor);
|
|
2177
|
+
for (var _i = 1; _i <= darkColorCount; _i += 1) {
|
|
2178
|
+
var _c = new FastColor({
|
|
2179
|
+
h: getHue(hsv, _i),
|
|
2180
|
+
s: getSaturation(hsv, _i),
|
|
2181
|
+
v: getValue(hsv, _i)
|
|
2182
|
+
});
|
|
2183
|
+
patterns.push(_c);
|
|
2184
|
+
}
|
|
2185
|
+
if (opts.theme === "dark") {
|
|
2186
|
+
return darkColorMap.map(function(_ref) {
|
|
2187
|
+
var index = _ref.index, amount = _ref.amount;
|
|
2188
|
+
return new FastColor(opts.backgroundColor || "#141414").mix(patterns[index], amount).toHexString();
|
|
2189
|
+
});
|
|
2190
|
+
}
|
|
2191
|
+
return patterns.map(function(c2) {
|
|
2192
|
+
return c2.toHexString();
|
|
2193
|
+
});
|
|
2194
|
+
}
|
|
2195
|
+
|
|
2196
|
+
// node_modules/@ant-design/colors/es/presets.js
|
|
2197
|
+
var red = ["#fff1f0", "#ffccc7", "#ffa39e", "#ff7875", "#ff4d4f", "#f5222d", "#cf1322", "#a8071a", "#820014", "#5c0011"];
|
|
2198
|
+
red.primary = red[5];
|
|
2199
|
+
var volcano = ["#fff2e8", "#ffd8bf", "#ffbb96", "#ff9c6e", "#ff7a45", "#fa541c", "#d4380d", "#ad2102", "#871400", "#610b00"];
|
|
2200
|
+
volcano.primary = volcano[5];
|
|
2201
|
+
var orange = ["#fff7e6", "#ffe7ba", "#ffd591", "#ffc069", "#ffa940", "#fa8c16", "#d46b08", "#ad4e00", "#873800", "#612500"];
|
|
2202
|
+
orange.primary = orange[5];
|
|
2203
|
+
var gold = ["#fffbe6", "#fff1b8", "#ffe58f", "#ffd666", "#ffc53d", "#faad14", "#d48806", "#ad6800", "#874d00", "#613400"];
|
|
2204
|
+
gold.primary = gold[5];
|
|
2205
|
+
var yellow = ["#feffe6", "#ffffb8", "#fffb8f", "#fff566", "#ffec3d", "#fadb14", "#d4b106", "#ad8b00", "#876800", "#614700"];
|
|
2206
|
+
yellow.primary = yellow[5];
|
|
2207
|
+
var lime = ["#fcffe6", "#f4ffb8", "#eaff8f", "#d3f261", "#bae637", "#a0d911", "#7cb305", "#5b8c00", "#3f6600", "#254000"];
|
|
2208
|
+
lime.primary = lime[5];
|
|
2209
|
+
var green = ["#f6ffed", "#d9f7be", "#b7eb8f", "#95de64", "#73d13d", "#52c41a", "#389e0d", "#237804", "#135200", "#092b00"];
|
|
2210
|
+
green.primary = green[5];
|
|
2211
|
+
var cyan = ["#e6fffb", "#b5f5ec", "#87e8de", "#5cdbd3", "#36cfc9", "#13c2c2", "#08979c", "#006d75", "#00474f", "#002329"];
|
|
2212
|
+
cyan.primary = cyan[5];
|
|
2213
|
+
var blue = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"];
|
|
2214
|
+
blue.primary = blue[5];
|
|
2215
|
+
var geekblue = ["#f0f5ff", "#d6e4ff", "#adc6ff", "#85a5ff", "#597ef7", "#2f54eb", "#1d39c4", "#10239e", "#061178", "#030852"];
|
|
2216
|
+
geekblue.primary = geekblue[5];
|
|
2217
|
+
var purple = ["#f9f0ff", "#efdbff", "#d3adf7", "#b37feb", "#9254de", "#722ed1", "#531dab", "#391085", "#22075e", "#120338"];
|
|
2218
|
+
purple.primary = purple[5];
|
|
2219
|
+
var magenta = ["#fff0f6", "#ffd6e7", "#ffadd2", "#ff85c0", "#f759ab", "#eb2f96", "#c41d7f", "#9e1068", "#780650", "#520339"];
|
|
2220
|
+
magenta.primary = magenta[5];
|
|
2221
|
+
var grey = ["#a6a6a6", "#999999", "#8c8c8c", "#808080", "#737373", "#666666", "#404040", "#1a1a1a", "#000000", "#000000"];
|
|
2222
|
+
grey.primary = grey[5];
|
|
2223
|
+
var presetPalettes = {
|
|
2224
|
+
red,
|
|
2225
|
+
volcano,
|
|
2226
|
+
orange,
|
|
2227
|
+
gold,
|
|
2228
|
+
yellow,
|
|
2229
|
+
lime,
|
|
2230
|
+
green,
|
|
2231
|
+
cyan,
|
|
2232
|
+
blue,
|
|
2233
|
+
geekblue,
|
|
2234
|
+
purple,
|
|
2235
|
+
magenta,
|
|
2236
|
+
grey
|
|
2237
|
+
};
|
|
2238
|
+
var redDark = ["#2a1215", "#431418", "#58181c", "#791a1f", "#a61d24", "#d32029", "#e84749", "#f37370", "#f89f9a", "#fac8c3"];
|
|
2239
|
+
redDark.primary = redDark[5];
|
|
2240
|
+
var volcanoDark = ["#2b1611", "#441d12", "#592716", "#7c3118", "#aa3e19", "#d84a1b", "#e87040", "#f3956a", "#f8b692", "#fad4bc"];
|
|
2241
|
+
volcanoDark.primary = volcanoDark[5];
|
|
2242
|
+
var orangeDark = ["#2b1d11", "#442a11", "#593815", "#7c4a15", "#aa6215", "#d87a16", "#e89a3c", "#f3b765", "#f8cf8d", "#fae3b7"];
|
|
2243
|
+
orangeDark.primary = orangeDark[5];
|
|
2244
|
+
var goldDark = ["#2b2111", "#443111", "#594214", "#7c5914", "#aa7714", "#d89614", "#e8b339", "#f3cc62", "#f8df8b", "#faedb5"];
|
|
2245
|
+
goldDark.primary = goldDark[5];
|
|
2246
|
+
var yellowDark = ["#2b2611", "#443b11", "#595014", "#7c6e14", "#aa9514", "#d8bd14", "#e8d639", "#f3ea62", "#f8f48b", "#fafab5"];
|
|
2247
|
+
yellowDark.primary = yellowDark[5];
|
|
2248
|
+
var limeDark = ["#1f2611", "#2e3c10", "#3e4f13", "#536d13", "#6f9412", "#8bbb11", "#a9d134", "#c9e75d", "#e4f88b", "#f0fab5"];
|
|
2249
|
+
limeDark.primary = limeDark[5];
|
|
2250
|
+
var greenDark = ["#162312", "#1d3712", "#274916", "#306317", "#3c8618", "#49aa19", "#6abe39", "#8fd460", "#b2e58b", "#d5f2bb"];
|
|
2251
|
+
greenDark.primary = greenDark[5];
|
|
2252
|
+
var cyanDark = ["#112123", "#113536", "#144848", "#146262", "#138585", "#13a8a8", "#33bcb7", "#58d1c9", "#84e2d8", "#b2f1e8"];
|
|
2253
|
+
cyanDark.primary = cyanDark[5];
|
|
2254
|
+
var blueDark = ["#111a2c", "#112545", "#15325b", "#15417e", "#1554ad", "#1668dc", "#3c89e8", "#65a9f3", "#8dc5f8", "#b7dcfa"];
|
|
2255
|
+
blueDark.primary = blueDark[5];
|
|
2256
|
+
var geekblueDark = ["#131629", "#161d40", "#1c2755", "#203175", "#263ea0", "#2b4acb", "#5273e0", "#7f9ef3", "#a8c1f8", "#d2e0fa"];
|
|
2257
|
+
geekblueDark.primary = geekblueDark[5];
|
|
2258
|
+
var purpleDark = ["#1a1325", "#24163a", "#301c4d", "#3e2069", "#51258f", "#642ab5", "#854eca", "#ab7ae0", "#cda8f0", "#ebd7fa"];
|
|
2259
|
+
purpleDark.primary = purpleDark[5];
|
|
2260
|
+
var magentaDark = ["#291321", "#40162f", "#551c3b", "#75204f", "#a02669", "#cb2b83", "#e0529c", "#f37fb7", "#f8a8cc", "#fad2e3"];
|
|
2261
|
+
magentaDark.primary = magentaDark[5];
|
|
2262
|
+
var greyDark = ["#151515", "#1f1f1f", "#2d2d2d", "#393939", "#494949", "#5a5a5a", "#6a6a6a", "#7b7b7b", "#888888", "#969696"];
|
|
2263
|
+
greyDark.primary = greyDark[5];
|
|
2264
|
+
|
|
2265
|
+
// src/ColorPalettePicker/ColorPalettePicker.tsx
|
|
1560
2266
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2267
|
+
function genPresets(presets = presetPalettes) {
|
|
2268
|
+
return Object.entries(presets).map(([label, colors]) => ({
|
|
2269
|
+
label,
|
|
2270
|
+
colors,
|
|
2271
|
+
key: label
|
|
2272
|
+
}));
|
|
2273
|
+
}
|
|
2274
|
+
function ColorPalettePickerBasic({
|
|
2275
|
+
value,
|
|
2276
|
+
onChange,
|
|
2277
|
+
require: require2,
|
|
2278
|
+
title,
|
|
2279
|
+
bottomText,
|
|
2280
|
+
showError,
|
|
2281
|
+
errorMessage,
|
|
2282
|
+
disabled,
|
|
2283
|
+
allowClear,
|
|
2284
|
+
defaultFormat,
|
|
2285
|
+
className,
|
|
2286
|
+
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35"
|
|
2287
|
+
}) {
|
|
2288
|
+
const { token } = import_antd9.theme.useToken();
|
|
2289
|
+
const presets = genPresets({
|
|
2290
|
+
primary: generate(token.colorPrimary),
|
|
2291
|
+
red,
|
|
2292
|
+
green
|
|
2293
|
+
});
|
|
2294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2295
|
+
import_antd9.ConfigProvider,
|
|
2296
|
+
{
|
|
2297
|
+
theme: {
|
|
2298
|
+
token: {
|
|
2299
|
+
fontFamily: "Kanit",
|
|
2300
|
+
fontSize: 16
|
|
2301
|
+
}
|
|
2302
|
+
},
|
|
2303
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "container-input", children: [
|
|
2304
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
|
|
2305
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "body-1", children: title }),
|
|
2306
|
+
" ",
|
|
2307
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2308
|
+
] }),
|
|
2309
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2310
|
+
import_antd9.ColorPicker,
|
|
2311
|
+
{
|
|
2312
|
+
defaultFormat,
|
|
2313
|
+
className: `body-1 w-full ${className ?? ""}`,
|
|
2314
|
+
presets,
|
|
2315
|
+
value,
|
|
2316
|
+
defaultValue: "#ffff",
|
|
2317
|
+
onChange,
|
|
2318
|
+
allowClear,
|
|
2319
|
+
showText: (color) => {
|
|
2320
|
+
const hex = color.toHexString();
|
|
2321
|
+
if (!value) {
|
|
2322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: placeholder });
|
|
2323
|
+
}
|
|
2324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { children: [
|
|
2325
|
+
"(",
|
|
2326
|
+
hex,
|
|
2327
|
+
")"
|
|
2328
|
+
] });
|
|
2329
|
+
},
|
|
2330
|
+
disabled
|
|
2331
|
+
}
|
|
2332
|
+
),
|
|
2333
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
|
|
2334
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
2335
|
+
" ",
|
|
2336
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
2337
|
+
] })
|
|
2338
|
+
] })
|
|
2339
|
+
}
|
|
2340
|
+
);
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
// src/Select/SelectField/SelectField.tsx
|
|
2344
|
+
var import_antd10 = require("antd");
|
|
2345
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1561
2346
|
function SelectField({
|
|
1562
2347
|
value,
|
|
1563
2348
|
onChange,
|
|
@@ -1576,22 +2361,23 @@ function SelectField({
|
|
|
1576
2361
|
handleSearch,
|
|
1577
2362
|
className
|
|
1578
2363
|
}) {
|
|
1579
|
-
return /* @__PURE__ */ (0,
|
|
1580
|
-
|
|
2364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2365
|
+
import_antd10.ConfigProvider,
|
|
1581
2366
|
{
|
|
1582
2367
|
theme: {
|
|
1583
2368
|
token: {
|
|
1584
|
-
fontFamily: "Kanit"
|
|
2369
|
+
fontFamily: "Kanit",
|
|
2370
|
+
fontSize: 16
|
|
1585
2371
|
}
|
|
1586
2372
|
},
|
|
1587
|
-
children: /* @__PURE__ */ (0,
|
|
1588
|
-
/* @__PURE__ */ (0,
|
|
1589
|
-
/* @__PURE__ */ (0,
|
|
2373
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "container-input", children: [
|
|
2374
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
|
|
2375
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "body-1", children: title }),
|
|
1590
2376
|
" ",
|
|
1591
|
-
require2 && /* @__PURE__ */ (0,
|
|
2377
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1592
2378
|
] }),
|
|
1593
|
-
/* @__PURE__ */ (0,
|
|
1594
|
-
|
|
2379
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2380
|
+
import_antd10.Select,
|
|
1595
2381
|
{
|
|
1596
2382
|
showSearch: true,
|
|
1597
2383
|
value,
|
|
@@ -1605,14 +2391,14 @@ function SelectField({
|
|
|
1605
2391
|
options,
|
|
1606
2392
|
mode,
|
|
1607
2393
|
onSearch: handleSearch,
|
|
1608
|
-
prefix: prefix ? /* @__PURE__ */ (0,
|
|
2394
|
+
prefix: prefix ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { style: { width: prefixSize, height: prefixSize, display: "flex", alignItems: "center", justifyContent: "center" }, children: prefix }) : void 0,
|
|
1609
2395
|
allowClear: true
|
|
1610
2396
|
}
|
|
1611
2397
|
),
|
|
1612
|
-
/* @__PURE__ */ (0,
|
|
1613
|
-
/* @__PURE__ */ (0,
|
|
2398
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
|
|
2399
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1614
2400
|
" ",
|
|
1615
|
-
showError && /* @__PURE__ */ (0,
|
|
2401
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1616
2402
|
] })
|
|
1617
2403
|
] })
|
|
1618
2404
|
}
|
|
@@ -1620,8 +2406,8 @@ function SelectField({
|
|
|
1620
2406
|
}
|
|
1621
2407
|
|
|
1622
2408
|
// src/Select/SelectFieldGroup/SelectFieldGroup.tsx
|
|
1623
|
-
var
|
|
1624
|
-
var
|
|
2409
|
+
var import_antd11 = require("antd");
|
|
2410
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1625
2411
|
function SelectFieldGroup({
|
|
1626
2412
|
value,
|
|
1627
2413
|
onChange,
|
|
@@ -1640,22 +2426,22 @@ function SelectFieldGroup({
|
|
|
1640
2426
|
handleSearch,
|
|
1641
2427
|
className
|
|
1642
2428
|
}) {
|
|
1643
|
-
return /* @__PURE__ */ (0,
|
|
1644
|
-
|
|
2429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2430
|
+
import_antd11.ConfigProvider,
|
|
1645
2431
|
{
|
|
1646
2432
|
theme: {
|
|
1647
2433
|
token: {
|
|
1648
2434
|
fontFamily: "Kanit"
|
|
1649
2435
|
}
|
|
1650
2436
|
},
|
|
1651
|
-
children: /* @__PURE__ */ (0,
|
|
1652
|
-
/* @__PURE__ */ (0,
|
|
1653
|
-
/* @__PURE__ */ (0,
|
|
2437
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "container-input", children: [
|
|
2438
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [
|
|
2439
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "body-1", children: title }),
|
|
1654
2440
|
" ",
|
|
1655
|
-
require2 && /* @__PURE__ */ (0,
|
|
2441
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1656
2442
|
] }),
|
|
1657
|
-
/* @__PURE__ */ (0,
|
|
1658
|
-
|
|
2443
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2444
|
+
import_antd11.Select,
|
|
1659
2445
|
{
|
|
1660
2446
|
showSearch: true,
|
|
1661
2447
|
value,
|
|
@@ -1669,7 +2455,7 @@ function SelectFieldGroup({
|
|
|
1669
2455
|
options,
|
|
1670
2456
|
mode,
|
|
1671
2457
|
onSearch: handleSearch,
|
|
1672
|
-
prefix: prefix ? /* @__PURE__ */ (0,
|
|
2458
|
+
prefix: prefix ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1673
2459
|
"span",
|
|
1674
2460
|
{
|
|
1675
2461
|
style: {
|
|
@@ -1685,10 +2471,10 @@ function SelectFieldGroup({
|
|
|
1685
2471
|
allowClear: true
|
|
1686
2472
|
}
|
|
1687
2473
|
),
|
|
1688
|
-
/* @__PURE__ */ (0,
|
|
1689
|
-
/* @__PURE__ */ (0,
|
|
2474
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [
|
|
2475
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1690
2476
|
" ",
|
|
1691
|
-
showError && /* @__PURE__ */ (0,
|
|
2477
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1692
2478
|
] })
|
|
1693
2479
|
] })
|
|
1694
2480
|
}
|
|
@@ -1696,7 +2482,7 @@ function SelectFieldGroup({
|
|
|
1696
2482
|
}
|
|
1697
2483
|
|
|
1698
2484
|
// src/Select/SelectFieldStatus/SelectFieldStatus.tsx
|
|
1699
|
-
var
|
|
2485
|
+
var import_antd12 = require("antd");
|
|
1700
2486
|
|
|
1701
2487
|
// src/Select/SelectFieldStatus/StatusMockup.ts
|
|
1702
2488
|
var status = [
|
|
@@ -1709,7 +2495,7 @@ var status = [
|
|
|
1709
2495
|
|
|
1710
2496
|
// src/Select/SelectFieldStatus/SelectFieldStatus.tsx
|
|
1711
2497
|
var import_icons = require("@ant-design/icons");
|
|
1712
|
-
var
|
|
2498
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1713
2499
|
function SelectFieldStatus({
|
|
1714
2500
|
value,
|
|
1715
2501
|
onChange,
|
|
@@ -1724,8 +2510,8 @@ function SelectFieldStatus({
|
|
|
1724
2510
|
className
|
|
1725
2511
|
}) {
|
|
1726
2512
|
const selectedItem = status.find((s) => s.value === value);
|
|
1727
|
-
return /* @__PURE__ */ (0,
|
|
1728
|
-
|
|
2513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2514
|
+
import_antd12.ConfigProvider,
|
|
1729
2515
|
{
|
|
1730
2516
|
theme: {
|
|
1731
2517
|
components: {
|
|
@@ -1740,17 +2526,17 @@ function SelectFieldStatus({
|
|
|
1740
2526
|
fontFamily: "Kanit"
|
|
1741
2527
|
}
|
|
1742
2528
|
},
|
|
1743
|
-
children: /* @__PURE__ */ (0,
|
|
1744
|
-
/* @__PURE__ */ (0,
|
|
1745
|
-
/* @__PURE__ */ (0,
|
|
2529
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "container-input", children: [
|
|
2530
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { children: [
|
|
2531
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "body-1", children: title }),
|
|
1746
2532
|
" ",
|
|
1747
|
-
require2 && /* @__PURE__ */ (0,
|
|
2533
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1748
2534
|
] }),
|
|
1749
|
-
/* @__PURE__ */ (0,
|
|
1750
|
-
|
|
2535
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2536
|
+
import_antd12.Select,
|
|
1751
2537
|
{
|
|
1752
2538
|
disabled,
|
|
1753
|
-
suffixIcon: /* @__PURE__ */ (0,
|
|
2539
|
+
suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_icons.DownOutlined, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
1754
2540
|
value,
|
|
1755
2541
|
onChange,
|
|
1756
2542
|
className: `body-3 custom-select flex justify-center w-full ${className ?? ""}`,
|
|
@@ -1760,10 +2546,10 @@ function SelectFieldStatus({
|
|
|
1760
2546
|
options
|
|
1761
2547
|
}
|
|
1762
2548
|
),
|
|
1763
|
-
/* @__PURE__ */ (0,
|
|
1764
|
-
/* @__PURE__ */ (0,
|
|
2549
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { children: [
|
|
2550
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1765
2551
|
" ",
|
|
1766
|
-
showError && /* @__PURE__ */ (0,
|
|
2552
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1767
2553
|
] })
|
|
1768
2554
|
] })
|
|
1769
2555
|
}
|
|
@@ -1771,7 +2557,7 @@ function SelectFieldStatus({
|
|
|
1771
2557
|
}
|
|
1772
2558
|
|
|
1773
2559
|
// src/Select/SelectFieldStatusReport/SelectFieldStatusReport.tsx
|
|
1774
|
-
var
|
|
2560
|
+
var import_antd13 = require("antd");
|
|
1775
2561
|
|
|
1776
2562
|
// src/Select/SelectFieldStatusReport/StatusReportMockup.ts
|
|
1777
2563
|
var status2 = [
|
|
@@ -1781,7 +2567,7 @@ var status2 = [
|
|
|
1781
2567
|
|
|
1782
2568
|
// src/Select/SelectFieldStatusReport/SelectFieldStatusReport.tsx
|
|
1783
2569
|
var import_icons2 = require("@ant-design/icons");
|
|
1784
|
-
var
|
|
2570
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1785
2571
|
function SelectFieldStatusReport({
|
|
1786
2572
|
value,
|
|
1787
2573
|
onChange,
|
|
@@ -1795,8 +2581,8 @@ function SelectFieldStatusReport({
|
|
|
1795
2581
|
className
|
|
1796
2582
|
}) {
|
|
1797
2583
|
const selectedItem = status2.find((s) => s.value === value);
|
|
1798
|
-
return /* @__PURE__ */ (0,
|
|
1799
|
-
|
|
2584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2585
|
+
import_antd13.ConfigProvider,
|
|
1800
2586
|
{
|
|
1801
2587
|
theme: {
|
|
1802
2588
|
components: {
|
|
@@ -1811,17 +2597,17 @@ function SelectFieldStatusReport({
|
|
|
1811
2597
|
fontFamily: "Kanit"
|
|
1812
2598
|
}
|
|
1813
2599
|
},
|
|
1814
|
-
children: /* @__PURE__ */ (0,
|
|
1815
|
-
/* @__PURE__ */ (0,
|
|
1816
|
-
/* @__PURE__ */ (0,
|
|
2600
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "container-input", children: [
|
|
2601
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
2602
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "body-1", children: title }),
|
|
1817
2603
|
" ",
|
|
1818
|
-
require2 && /* @__PURE__ */ (0,
|
|
2604
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1819
2605
|
] }),
|
|
1820
|
-
/* @__PURE__ */ (0,
|
|
1821
|
-
|
|
2606
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2607
|
+
import_antd13.Select,
|
|
1822
2608
|
{
|
|
1823
2609
|
disabled,
|
|
1824
|
-
suffixIcon: /* @__PURE__ */ (0,
|
|
2610
|
+
suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_icons2.DownOutlined, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
1825
2611
|
value,
|
|
1826
2612
|
onChange,
|
|
1827
2613
|
className: `body-3 custom-select flex justify-center w-full ${className ?? ""}`,
|
|
@@ -1835,10 +2621,10 @@ function SelectFieldStatusReport({
|
|
|
1835
2621
|
}))
|
|
1836
2622
|
}
|
|
1837
2623
|
),
|
|
1838
|
-
/* @__PURE__ */ (0,
|
|
1839
|
-
/* @__PURE__ */ (0,
|
|
2624
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
2625
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1840
2626
|
" ",
|
|
1841
|
-
showError && /* @__PURE__ */ (0,
|
|
2627
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1842
2628
|
] })
|
|
1843
2629
|
] })
|
|
1844
2630
|
}
|
|
@@ -1846,9 +2632,9 @@ function SelectFieldStatusReport({
|
|
|
1846
2632
|
}
|
|
1847
2633
|
|
|
1848
2634
|
// src/Select/SelectFieldTag/SelectFieldTag.tsx
|
|
1849
|
-
var
|
|
2635
|
+
var import_antd14 = require("antd");
|
|
1850
2636
|
var import_react8 = require("react");
|
|
1851
|
-
var
|
|
2637
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1852
2638
|
function SelectFieldTag({
|
|
1853
2639
|
title,
|
|
1854
2640
|
require: require2,
|
|
@@ -1882,22 +2668,22 @@ function SelectFieldTag({
|
|
|
1882
2668
|
}
|
|
1883
2669
|
onChange?.([]);
|
|
1884
2670
|
};
|
|
1885
|
-
return /* @__PURE__ */ (0,
|
|
1886
|
-
|
|
2671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2672
|
+
import_antd14.ConfigProvider,
|
|
1887
2673
|
{
|
|
1888
2674
|
theme: {
|
|
1889
2675
|
token: {
|
|
1890
2676
|
fontFamily: "Kanit"
|
|
1891
2677
|
}
|
|
1892
2678
|
},
|
|
1893
|
-
children: /* @__PURE__ */ (0,
|
|
1894
|
-
/* @__PURE__ */ (0,
|
|
1895
|
-
/* @__PURE__ */ (0,
|
|
2679
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "container-input", children: [
|
|
2680
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
|
|
2681
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "body-1", children: title }),
|
|
1896
2682
|
" ",
|
|
1897
|
-
require2 && /* @__PURE__ */ (0,
|
|
2683
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1898
2684
|
] }),
|
|
1899
|
-
/* @__PURE__ */ (0,
|
|
1900
|
-
|
|
2685
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2686
|
+
import_antd14.Select,
|
|
1901
2687
|
{
|
|
1902
2688
|
mode: "tags",
|
|
1903
2689
|
className: `body-1 flex justify-center w-full ${className ?? ""}`,
|
|
@@ -1914,10 +2700,10 @@ function SelectFieldTag({
|
|
|
1914
2700
|
allowClear: true
|
|
1915
2701
|
}
|
|
1916
2702
|
),
|
|
1917
|
-
/* @__PURE__ */ (0,
|
|
1918
|
-
/* @__PURE__ */ (0,
|
|
2703
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
|
|
2704
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1919
2705
|
" ",
|
|
1920
|
-
showError && /* @__PURE__ */ (0,
|
|
2706
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1921
2707
|
] })
|
|
1922
2708
|
] })
|
|
1923
2709
|
}
|
|
@@ -1925,7 +2711,7 @@ function SelectFieldTag({
|
|
|
1925
2711
|
}
|
|
1926
2712
|
|
|
1927
2713
|
// src/SortFilter/SortFilter.tsx
|
|
1928
|
-
var
|
|
2714
|
+
var import_antd15 = require("antd");
|
|
1929
2715
|
var import_icons3 = require("@ant-design/icons");
|
|
1930
2716
|
|
|
1931
2717
|
// src/SortFilter/DataMockSortFilter.ts
|
|
@@ -1958,7 +2744,7 @@ var quarters = [
|
|
|
1958
2744
|
// src/SortFilter/SortFilter.tsx
|
|
1959
2745
|
var import_react9 = require("react");
|
|
1960
2746
|
var import_icons_react8 = require("@tabler/icons-react");
|
|
1961
|
-
var
|
|
2747
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1962
2748
|
function SortFilter({
|
|
1963
2749
|
showYear = true,
|
|
1964
2750
|
showQuarter = true,
|
|
@@ -1969,20 +2755,20 @@ function SortFilter({
|
|
|
1969
2755
|
const [yearValue, setYearValue] = (0, import_react9.useState)();
|
|
1970
2756
|
const [monthValue, setMonthValue] = (0, import_react9.useState)();
|
|
1971
2757
|
const [quarterValue, setQuartersValue] = (0, import_react9.useState)();
|
|
1972
|
-
return /* @__PURE__ */ (0,
|
|
1973
|
-
|
|
2758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2759
|
+
import_antd15.ConfigProvider,
|
|
1974
2760
|
{
|
|
1975
2761
|
theme: {
|
|
1976
2762
|
token: {
|
|
1977
2763
|
fontFamily: "Kanit"
|
|
1978
2764
|
}
|
|
1979
2765
|
},
|
|
1980
|
-
children: /* @__PURE__ */ (0,
|
|
1981
|
-
/* @__PURE__ */ (0,
|
|
1982
|
-
showYear && /* @__PURE__ */ (0,
|
|
2766
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "w-full flex items-center justify-between", children: [
|
|
2767
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "w-full flex gap-[10px]", children: [
|
|
2768
|
+
showYear && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1983
2769
|
SelectField,
|
|
1984
2770
|
{
|
|
1985
|
-
prefix: /* @__PURE__ */ (0,
|
|
2771
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons3.CalendarOutlined, {}),
|
|
1986
2772
|
onChange: setYearValue,
|
|
1987
2773
|
options: years.map((s) => ({
|
|
1988
2774
|
value: s.value,
|
|
@@ -1992,10 +2778,10 @@ function SortFilter({
|
|
|
1992
2778
|
value: yearValue
|
|
1993
2779
|
}
|
|
1994
2780
|
) }),
|
|
1995
|
-
showMonth && /* @__PURE__ */ (0,
|
|
2781
|
+
showMonth && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1996
2782
|
SelectField,
|
|
1997
2783
|
{
|
|
1998
|
-
prefix: /* @__PURE__ */ (0,
|
|
2784
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons3.CalendarOutlined, {}),
|
|
1999
2785
|
onChange: setMonthValue,
|
|
2000
2786
|
options: months.map((s) => ({
|
|
2001
2787
|
value: s.value,
|
|
@@ -2005,10 +2791,10 @@ function SortFilter({
|
|
|
2005
2791
|
placeholder: "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E40\u0E14\u0E37\u0E2D\u0E19"
|
|
2006
2792
|
}
|
|
2007
2793
|
) }),
|
|
2008
|
-
showQuarter && /* @__PURE__ */ (0,
|
|
2794
|
+
showQuarter && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2009
2795
|
SelectField,
|
|
2010
2796
|
{
|
|
2011
|
-
prefix: /* @__PURE__ */ (0,
|
|
2797
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons3.CalendarOutlined, {}),
|
|
2012
2798
|
onChange: setQuartersValue,
|
|
2013
2799
|
options: quarters.map((s) => ({
|
|
2014
2800
|
value: s.value,
|
|
@@ -2019,8 +2805,8 @@ function SortFilter({
|
|
|
2019
2805
|
}
|
|
2020
2806
|
) })
|
|
2021
2807
|
] }),
|
|
2022
|
-
/* @__PURE__ */ (0,
|
|
2023
|
-
/* @__PURE__ */ (0,
|
|
2808
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex gap-[10px]", children: [
|
|
2809
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2024
2810
|
import_icons_react8.IconSortDescending,
|
|
2025
2811
|
{
|
|
2026
2812
|
size: 24,
|
|
@@ -2028,7 +2814,7 @@ function SortFilter({
|
|
|
2028
2814
|
onClick: onSortClick
|
|
2029
2815
|
}
|
|
2030
2816
|
),
|
|
2031
|
-
/* @__PURE__ */ (0,
|
|
2817
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2032
2818
|
import_icons_react8.IconFilter,
|
|
2033
2819
|
{
|
|
2034
2820
|
size: 24,
|
|
@@ -2045,7 +2831,7 @@ function SortFilter({
|
|
|
2045
2831
|
// src/Upload/FileUploader/FileUploader.tsx
|
|
2046
2832
|
var import_icons_react9 = require("@tabler/icons-react");
|
|
2047
2833
|
var import_react10 = require("react");
|
|
2048
|
-
var
|
|
2834
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2049
2835
|
function FileUploader({
|
|
2050
2836
|
onUpload,
|
|
2051
2837
|
onError,
|
|
@@ -2116,10 +2902,10 @@ function FileUploader({
|
|
|
2116
2902
|
}
|
|
2117
2903
|
if (inputRef.current) inputRef.current.value = "";
|
|
2118
2904
|
};
|
|
2119
|
-
return /* @__PURE__ */ (0,
|
|
2120
|
-
label && /* @__PURE__ */ (0,
|
|
2121
|
-
/* @__PURE__ */ (0,
|
|
2122
|
-
mode === "upload" ? /* @__PURE__ */ (0,
|
|
2905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "w-full", children: [
|
|
2906
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "body-1", children: label }),
|
|
2907
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
|
|
2908
|
+
mode === "upload" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2123
2909
|
"button",
|
|
2124
2910
|
{
|
|
2125
2911
|
type: "button",
|
|
@@ -2127,15 +2913,15 @@ function FileUploader({
|
|
|
2127
2913
|
className: `h-[34px] flex justify-center items-center gap-2 w-full rounded-[2px] border border-gray-200 body-1
|
|
2128
2914
|
${disabled ? "cursor-not-allowed text-gray-400 bg-gray-100" : "cursor-pointer hover:text-primary-400 hover:border-primary-200 duration-300"}`,
|
|
2129
2915
|
disabled: disabled ? disabled : uploading,
|
|
2130
|
-
children: uploading ? /* @__PURE__ */ (0,
|
|
2131
|
-
/* @__PURE__ */ (0,
|
|
2916
|
+
children: uploading ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
2917
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Loader, { size: 15 }),
|
|
2132
2918
|
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
2133
|
-
] }) : /* @__PURE__ */ (0,
|
|
2134
|
-
/* @__PURE__ */ (0,
|
|
2919
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
2920
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_icons_react9.IconUpload, { size: 15, className: "text-gray-400" }),
|
|
2135
2921
|
" \u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
|
|
2136
2922
|
] })
|
|
2137
2923
|
}
|
|
2138
|
-
) : /* @__PURE__ */ (0,
|
|
2924
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2139
2925
|
"div",
|
|
2140
2926
|
{
|
|
2141
2927
|
className: `min-w-[400px] min-h-[120px] flex justify-center items-center border-2 border-dashed rounded-md p-4 transition-colors body-1
|
|
@@ -2149,17 +2935,17 @@ function FileUploader({
|
|
|
2149
2935
|
},
|
|
2150
2936
|
onDragLeave: () => setDragActive(false),
|
|
2151
2937
|
onDrop: handleDrop,
|
|
2152
|
-
children: uploading ? /* @__PURE__ */ (0,
|
|
2153
|
-
/* @__PURE__ */ (0,
|
|
2938
|
+
children: uploading ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex justify-center items-center gap-2", children: [
|
|
2939
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Loader, { size: 15 }),
|
|
2154
2940
|
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
2155
|
-
] }) : /* @__PURE__ */ (0,
|
|
2156
|
-
/* @__PURE__ */ (0,
|
|
2157
|
-
/* @__PURE__ */ (0,
|
|
2158
|
-
/* @__PURE__ */ (0,
|
|
2941
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col items-center gap-2", children: [
|
|
2942
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_icons_react9.IconUpload, { size: 20 }),
|
|
2943
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "body-1", children: "\u0E04\u0E25\u0E34\u0E01\u0E2B\u0E23\u0E37\u0E2D\u0E25\u0E32\u0E01\u0E44\u0E1F\u0E25\u0E4C\u0E21\u0E32\u0E17\u0E35\u0E48\u0E1A\u0E23\u0E34\u0E40\u0E27\u0E13\u0E19\u0E35\u0E49\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14" }),
|
|
2944
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-gray-400 body-3", children: "\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u0E41\u0E1A\u0E1A\u0E40\u0E14\u0E35\u0E48\u0E22\u0E27\u0E2B\u0E23\u0E37\u0E2D\u0E2B\u0E25\u0E32\u0E22\u0E44\u0E1F\u0E25\u0E4C" })
|
|
2159
2945
|
] })
|
|
2160
2946
|
}
|
|
2161
2947
|
),
|
|
2162
|
-
/* @__PURE__ */ (0,
|
|
2948
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2163
2949
|
"input",
|
|
2164
2950
|
{
|
|
2165
2951
|
type: "file",
|
|
@@ -2172,13 +2958,13 @@ function FileUploader({
|
|
|
2172
2958
|
}
|
|
2173
2959
|
)
|
|
2174
2960
|
] }),
|
|
2175
|
-
description && /* @__PURE__ */ (0,
|
|
2176
|
-
/* @__PURE__ */ (0,
|
|
2177
|
-
/* @__PURE__ */ (0,
|
|
2178
|
-
/* @__PURE__ */ (0,
|
|
2179
|
-
/* @__PURE__ */ (0,
|
|
2961
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-gray-400 body-4", children: description }),
|
|
2962
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "mt-[8px]", children: fileList.length !== 0 && fileList.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-2 rounded-[4px] px-[8px] py-[4px] body-1", children: [
|
|
2963
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-2 w-[75%] overflow-hidden", children: [
|
|
2964
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "w-[15px] h-[15px]", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_icons_react9.IconPaperclip, { size: 15 }) }),
|
|
2965
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "truncate", children: file.name })
|
|
2180
2966
|
] }),
|
|
2181
|
-
/* @__PURE__ */ (0,
|
|
2967
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2182
2968
|
import_icons_react9.IconTrash,
|
|
2183
2969
|
{
|
|
2184
2970
|
size: 20,
|
|
@@ -2212,9 +2998,9 @@ function messageLoading(content, duration) {
|
|
|
2212
2998
|
}
|
|
2213
2999
|
|
|
2214
3000
|
// src/Breadcrumb/Breadcrumb.tsx
|
|
2215
|
-
var import_antd15 = require("antd");
|
|
2216
3001
|
var import_antd16 = require("antd");
|
|
2217
|
-
var
|
|
3002
|
+
var import_antd17 = require("antd");
|
|
3003
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2218
3004
|
function Breadcrumbs({
|
|
2219
3005
|
items,
|
|
2220
3006
|
separator,
|
|
@@ -2222,16 +3008,16 @@ function Breadcrumbs({
|
|
|
2222
3008
|
classname,
|
|
2223
3009
|
params
|
|
2224
3010
|
}) {
|
|
2225
|
-
return /* @__PURE__ */ (0,
|
|
2226
|
-
|
|
3011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3012
|
+
import_antd16.ConfigProvider,
|
|
2227
3013
|
{
|
|
2228
3014
|
theme: {
|
|
2229
3015
|
token: {
|
|
2230
3016
|
fontFamily: "Kanit"
|
|
2231
3017
|
}
|
|
2232
3018
|
},
|
|
2233
|
-
children: /* @__PURE__ */ (0,
|
|
2234
|
-
|
|
3019
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3020
|
+
import_antd17.Breadcrumb,
|
|
2235
3021
|
{
|
|
2236
3022
|
items,
|
|
2237
3023
|
separator,
|
|
@@ -2245,8 +3031,8 @@ function Breadcrumbs({
|
|
|
2245
3031
|
}
|
|
2246
3032
|
|
|
2247
3033
|
// src/HeadingPage/HeadingPage.tsx
|
|
2248
|
-
var
|
|
2249
|
-
var
|
|
3034
|
+
var import_antd18 = require("antd");
|
|
3035
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2250
3036
|
function HeadingPage({ Heading }) {
|
|
2251
3037
|
const today = (/* @__PURE__ */ new Date()).toLocaleDateString("th-TH", {
|
|
2252
3038
|
weekday: "long",
|
|
@@ -2254,17 +3040,17 @@ function HeadingPage({ Heading }) {
|
|
|
2254
3040
|
month: "long",
|
|
2255
3041
|
year: "numeric"
|
|
2256
3042
|
});
|
|
2257
|
-
return /* @__PURE__ */ (0,
|
|
2258
|
-
|
|
3043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3044
|
+
import_antd18.ConfigProvider,
|
|
2259
3045
|
{
|
|
2260
3046
|
theme: {
|
|
2261
3047
|
token: {
|
|
2262
3048
|
fontFamily: "Kanit"
|
|
2263
3049
|
}
|
|
2264
3050
|
},
|
|
2265
|
-
children: /* @__PURE__ */ (0,
|
|
2266
|
-
/* @__PURE__ */ (0,
|
|
2267
|
-
/* @__PURE__ */ (0,
|
|
3051
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-[10px] px-[20px] py-[10px]", children: [
|
|
3052
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "headline-5", children: Heading }),
|
|
3053
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("p", { className: "body-1", children: [
|
|
2268
3054
|
" \u0E27\u0E31\u0E19\u0E19\u0E35\u0E49 ",
|
|
2269
3055
|
today
|
|
2270
3056
|
] })
|
|
@@ -2274,9 +3060,9 @@ function HeadingPage({ Heading }) {
|
|
|
2274
3060
|
}
|
|
2275
3061
|
|
|
2276
3062
|
// src/Progress/ProgressBar.tsx
|
|
2277
|
-
var
|
|
3063
|
+
var import_antd19 = require("antd");
|
|
2278
3064
|
var import_react11 = require("react");
|
|
2279
|
-
var
|
|
3065
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2280
3066
|
function ProgressBar({
|
|
2281
3067
|
percent = 0,
|
|
2282
3068
|
size = "default",
|
|
@@ -2309,17 +3095,17 @@ function ProgressBar({
|
|
|
2309
3095
|
observer.observe(inner);
|
|
2310
3096
|
return () => observer.disconnect();
|
|
2311
3097
|
}, []);
|
|
2312
|
-
return /* @__PURE__ */ (0,
|
|
2313
|
-
|
|
3098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3099
|
+
import_antd19.ConfigProvider,
|
|
2314
3100
|
{
|
|
2315
3101
|
theme: {
|
|
2316
3102
|
token: {
|
|
2317
3103
|
fontFamily: "Kanit"
|
|
2318
3104
|
}
|
|
2319
3105
|
},
|
|
2320
|
-
children: /* @__PURE__ */ (0,
|
|
2321
|
-
/* @__PURE__ */ (0,
|
|
2322
|
-
|
|
3106
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "relative w-full", ref: progressRef, children: [
|
|
3107
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3108
|
+
import_antd19.Progress,
|
|
2323
3109
|
{
|
|
2324
3110
|
className: "w-full",
|
|
2325
3111
|
percent,
|
|
@@ -2334,7 +3120,7 @@ function ProgressBar({
|
|
|
2334
3120
|
strokeColor
|
|
2335
3121
|
}
|
|
2336
3122
|
),
|
|
2337
|
-
barWidth > 0 && isCheckPoints && type !== "circle" && checkpoints.map((cp) => /* @__PURE__ */ (0,
|
|
3123
|
+
barWidth > 0 && isCheckPoints && type !== "circle" && checkpoints.map((cp) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2338
3124
|
"div",
|
|
2339
3125
|
{
|
|
2340
3126
|
className: "checkpoint absolute top-0",
|
|
@@ -2361,6 +3147,7 @@ function ProgressBar({
|
|
|
2361
3147
|
Calendar,
|
|
2362
3148
|
Checkbox,
|
|
2363
3149
|
CheckboxGroup,
|
|
3150
|
+
ColorPalettePickerBasic,
|
|
2364
3151
|
ColorPickerBasic,
|
|
2365
3152
|
DataTable,
|
|
2366
3153
|
DatePickerBasic,
|