@fctc/sme-widget-ui 1.7.5 → 1.7.7

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.mjs CHANGED
@@ -4297,7 +4297,7 @@ var require_react_is_development = __commonJS({
4297
4297
  var ContextProvider = REACT_PROVIDER_TYPE;
4298
4298
  var Element2 = REACT_ELEMENT_TYPE;
4299
4299
  var ForwardRef = REACT_FORWARD_REF_TYPE;
4300
- var Fragment32 = REACT_FRAGMENT_TYPE;
4300
+ var Fragment33 = REACT_FRAGMENT_TYPE;
4301
4301
  var Lazy = REACT_LAZY_TYPE;
4302
4302
  var Memo = REACT_MEMO_TYPE;
4303
4303
  var Portal2 = REACT_PORTAL_TYPE;
@@ -4356,7 +4356,7 @@ var require_react_is_development = __commonJS({
4356
4356
  exports.ContextProvider = ContextProvider;
4357
4357
  exports.Element = Element2;
4358
4358
  exports.ForwardRef = ForwardRef;
4359
- exports.Fragment = Fragment32;
4359
+ exports.Fragment = Fragment33;
4360
4360
  exports.Lazy = Lazy;
4361
4361
  exports.Memo = Memo;
4362
4362
  exports.Portal = Portal2;
@@ -7725,16 +7725,6 @@ var COLORS = [
7725
7725
  }
7726
7726
  ];
7727
7727
  var DOTS = "...";
7728
- var typeStyles = {
7729
- primary: "bg-blue-500 text-white",
7730
- secondary: "bg-lime-600 text-white",
7731
- danger: "bg-[rgba(237,28,36,0.1)] text-[#F5222D]",
7732
- info: "bg-[rgba(5,152,237,0.12)] text-[rgb(5,152,237)]",
7733
- success: "bg-[rgba(46,181,83,0.1)] text-[rgb(46,181,83)]",
7734
- warning: "bg-[rgba(237,166,28,0.1)] text-[rgb(250,140,22)]",
7735
- default: "bg-[#dee2e6]",
7736
- light: "bg-white text-gray-800 shadow-md"
7737
- };
7738
7728
  var SearchType = {
7739
7729
  FILTER: "filter_by",
7740
7730
  SEARCH: "search_by",
@@ -18380,6 +18370,58 @@ var BinaryField = (props) => {
18380
18370
 
18381
18371
  // src/widgets/basic/button-badge-field/button-badge.tsx
18382
18372
  import { jsx as jsx71 } from "react/jsx-runtime";
18373
+ var typeStyles = {
18374
+ primary: {
18375
+ backgroundColor: "#3b82f6",
18376
+ color: "#fff",
18377
+ border: "1px solid #fff"
18378
+ },
18379
+ secondary: {
18380
+ backgroundColor: "#EBF1FF",
18381
+ color: "#2597D0",
18382
+ border: "1px solid #35ADE9"
18383
+ },
18384
+ danger: {
18385
+ backgroundColor: "#FFEBEC",
18386
+ color: "#E93544",
18387
+ border: "1px solid #FB2B3D"
18388
+ },
18389
+ info: {
18390
+ backgroundColor: "rgba(5,152,237,0.12)",
18391
+ color: "rgb(5,152,237)",
18392
+ border: "1px solid rgb(5,152,237)"
18393
+ },
18394
+ success: {
18395
+ backgroundColor: "#E0FAEB",
18396
+ color: "#12AF53",
18397
+ border: "1px solid #1FC163"
18398
+ },
18399
+ warning: {
18400
+ backgroundColor: "#FFFAEB",
18401
+ color: "#E6A819)",
18402
+ border: "1px solid #F6B51E"
18403
+ },
18404
+ default: {
18405
+ backgroundColor: "#dee2e6",
18406
+ color: "#000",
18407
+ border: "1px solid #000"
18408
+ },
18409
+ light: {
18410
+ backgroundColor: "#fff",
18411
+ color: "#1f2937",
18412
+ border: "1px solid #1f2937"
18413
+ }
18414
+ };
18415
+ var baseStyle = {
18416
+ borderRadius: "4px",
18417
+ fontSize: "12px",
18418
+ padding: "4px 8px",
18419
+ width: "fit-content",
18420
+ textAlign: "center",
18421
+ fontWeight: 500,
18422
+ cursor: "pointer",
18423
+ transition: "all 0.3s ease-in-out"
18424
+ };
18383
18425
  var ButtonBadgeField = (props) => {
18384
18426
  const { defaultValue, selection, value, formValues, domainHelper } = props;
18385
18427
  const decorationSuccess = props["decoration-success"] && domainHelper.checkDomain(formValues, props["decoration-success"]);
@@ -18387,31 +18429,21 @@ var ButtonBadgeField = (props) => {
18387
18429
  const decorationDanger = props["decoration-danger"] && domainHelper.checkDomain(formValues, props["decoration-danger"]);
18388
18430
  const decorationWarning = props["decoration-warning"] && domainHelper.checkDomain(formValues, props["decoration-warning"]);
18389
18431
  const getType = () => {
18390
- if (decorationInfo) {
18391
- return typeStyles["info"];
18392
- }
18393
- if (decorationSuccess) {
18394
- return typeStyles["success"];
18395
- }
18396
- if (decorationDanger) {
18397
- return typeStyles["danger"];
18398
- }
18399
- if (decorationWarning) {
18400
- return typeStyles["warning"];
18401
- }
18432
+ if (decorationInfo) return typeStyles["info"];
18433
+ if (decorationSuccess) return typeStyles["success"];
18434
+ if (decorationDanger) return typeStyles["danger"];
18435
+ if (decorationWarning) return typeStyles["warning"];
18402
18436
  return typeStyles["default"];
18403
18437
  };
18404
- const baseStyle = "rounded-full text-xs px-[0.82rem] w-fit py-1 text-center font-medium cursor-pointer transition duration-300 ease-in-out transform";
18405
- const buttonClass = `${baseStyle} ${getType()}`;
18406
18438
  const getLabel = (value2) => {
18407
18439
  if (!value2) return "";
18408
- const item = selection?.find((item2) => {
18409
- return Array.isArray(item2) && item2[0] === value2;
18410
- });
18440
+ const item = selection?.find(
18441
+ (item2) => Array.isArray(item2) && item2[0] === value2
18442
+ );
18411
18443
  return item ? item[1] : "";
18412
18444
  };
18413
18445
  const label = getLabel(defaultValue ?? value);
18414
- return label ? /* @__PURE__ */ jsx71("div", { className: buttonClass, children: i18n_default.t(label) }) : null;
18446
+ return label ? /* @__PURE__ */ jsx71("div", { style: { ...baseStyle, ...getType() }, children: i18n_default.t(label) }) : null;
18415
18447
  };
18416
18448
 
18417
18449
  // src/widgets/basic/button-field/button.tsx
@@ -35151,86 +35183,140 @@ var StatusbarDurationField = (props) => {
35151
35183
 
35152
35184
  // src/widgets/basic/status-bar-field/option/option.tsx
35153
35185
  import { useMemo as useMemo11 } from "react";
35154
- import { jsx as jsx107, jsxs as jsxs73 } from "react/jsx-runtime";
35186
+ import { Fragment as Fragment32, jsx as jsx107, jsxs as jsxs73 } from "react/jsx-runtime";
35155
35187
  var StatusBarOptionField = (props) => {
35156
35188
  const { selection, defaultValue } = props;
35157
35189
  const memoizedStatusOptions = useMemo11(() => selection, [selection]);
35190
+ const indexInProgress = memoizedStatusOptions?.findIndex(
35191
+ (option) => option?.[0] === defaultValue
35192
+ );
35158
35193
  return /* @__PURE__ */ jsx107(
35159
35194
  "div",
35160
35195
  {
35161
35196
  style: {
35162
35197
  display: "flex",
35163
35198
  alignItems: "center",
35164
- flexWrap: "wrap",
35165
- overflow: "hidden"
35199
+ flexWrap: "wrap"
35166
35200
  },
35167
35201
  children: memoizedStatusOptions?.map((option, index4) => {
35168
- const value = option?.[0] === defaultValue;
35169
- return /* @__PURE__ */ jsxs73(
35170
- "label",
35171
- {
35172
- style: {
35173
- position: "relative",
35174
- flexShrink: 0,
35175
- cursor: "default",
35176
- height: "36px",
35177
- display: "flex",
35178
- alignItems: "center",
35179
- paddingLeft: "32px",
35180
- // pl-8
35181
- paddingRight: "20px",
35182
- // pr-[20px]
35183
- fontWeight: 600,
35184
- // font-semibold
35185
- fontSize: "14px",
35186
- background: value ? "var(--color-primary)" : "#FAFAFA",
35187
- color: value ? "#fff" : "#121212",
35188
- borderTopLeftRadius: index4 === 0 ? "0.75rem" : "0px",
35189
- // rounded-l-xl
35190
- borderBottomLeftRadius: index4 === 0 ? "0.75rem" : "0px",
35191
- borderTopRightRadius: index4 === memoizedStatusOptions?.length - 1 ? "0.75rem" : "0px",
35192
- // rounded-r-xl
35193
- borderBottomRightRadius: index4 === memoizedStatusOptions?.length - 1 ? "0.75rem" : "0px"
35194
- },
35195
- children: [
35196
- /* @__PURE__ */ jsx107(
35197
- "input",
35198
- {
35199
- type: "radio",
35200
- checked: value,
35201
- style: { display: "none" },
35202
- disabled: true
35203
- }
35204
- ),
35205
- option[1],
35206
- !(index4 === memoizedStatusOptions?.length - 1) && /* @__PURE__ */ jsx107(
35207
- "div",
35208
- {
35209
- style: {
35210
- position: "absolute",
35211
- top: "50%",
35212
- transform: "translateY(-50%) rotate(45deg)",
35213
- zIndex: 2,
35214
- width: "26px",
35215
- height: "26px",
35216
- right: "-13px",
35217
- background: value ? "var(--color-primary)" : "#FAFAFA",
35218
- border: value ? "none" : "1px solid rgba(0,0,0,0.04)",
35219
- borderBottomColor: value ? "var(--color-primary)" : "#FAFAFA",
35220
- borderLeftColor: value ? "var(--color-primary)" : "#FAFAFA",
35221
- borderTopColor: value ? "var(--color-primary)" : "rgba(0,0,0,0.04)",
35222
- borderRightColor: value ? "var(--color-primary)" : "rgba(0,0,0,0.04)"
35202
+ return /* @__PURE__ */ jsxs73(Fragment32, { children: [
35203
+ /* @__PURE__ */ jsxs73(
35204
+ "div",
35205
+ {
35206
+ style: {
35207
+ position: "relative",
35208
+ flexShrink: 0,
35209
+ cursor: "default",
35210
+ padding: "4px",
35211
+ display: "flex",
35212
+ alignItems: "center",
35213
+ fontWeight: 600,
35214
+ fontSize: "12px",
35215
+ background: index4 < indexInProgress || indexInProgress === memoizedStatusOptions?.length - 1 ? "#D5F1E0" : index4 === indexInProgress ? "#FFF" : "#F3F3F3",
35216
+ color: index4 < indexInProgress || indexInProgress === memoizedStatusOptions?.length - 1 ? "#178C48" : index4 === indexInProgress ? "#666" : "#AEAEAE",
35217
+ borderRadius: "16px",
35218
+ boxShadow: index4 === indexInProgress ? "0 1px 2px 0 rgba(51, 51, 51, 0.04), 0 2px 4px 0 rgba(51, 51, 51, 0.04), 0 4px 8px -2px rgba(51, 51, 51, 0.06), 0 0 0 1px rgba(51, 51, 51, 0.04), 0 -1px 1px -0.5px rgba(51, 51, 51, 0.06) inset" : ""
35219
+ },
35220
+ children: [
35221
+ /* @__PURE__ */ jsx107(
35222
+ "span",
35223
+ {
35224
+ style: {
35225
+ backgroundColor: index4 < indexInProgress || indexInProgress === memoizedStatusOptions?.length - 1 ? "#178C48" : index4 === indexInProgress ? "#FF3F89" : "#FFF",
35226
+ width: 20,
35227
+ height: 20,
35228
+ display: "flex",
35229
+ justifyContent: "center",
35230
+ alignItems: "center",
35231
+ borderRadius: "100%"
35232
+ },
35233
+ children: index4 < indexInProgress || indexInProgress === memoizedStatusOptions?.length - 1 ? /* @__PURE__ */ jsx107(ICCheck, {}) : index4 === indexInProgress ? /* @__PURE__ */ jsx107(ICCircle, {}) : /* @__PURE__ */ jsx107(ICMinus, {})
35223
35234
  }
35224
- }
35225
- )
35226
- ]
35227
- },
35228
- option?.[0]
35229
- );
35235
+ ),
35236
+ /* @__PURE__ */ jsx107(
35237
+ "span",
35238
+ {
35239
+ style: {
35240
+ padding: "0 6px"
35241
+ },
35242
+ children: option[1]
35243
+ }
35244
+ )
35245
+ ]
35246
+ },
35247
+ option?.[0]
35248
+ ),
35249
+ !(index4 === memoizedStatusOptions?.length - 1) && /* @__PURE__ */ jsx107(
35250
+ "div",
35251
+ {
35252
+ style: {
35253
+ height: "3px",
35254
+ width: "6px",
35255
+ backgroundColor: "#F3F3F3"
35256
+ }
35257
+ }
35258
+ )
35259
+ ] });
35230
35260
  })
35231
35261
  }
35232
35262
  );
35233
35263
  };
35264
+ var ICMinus = () => {
35265
+ return /* @__PURE__ */ jsx107(
35266
+ "svg",
35267
+ {
35268
+ xmlns: "http://www.w3.org/2000/svg",
35269
+ width: "16",
35270
+ height: "16",
35271
+ viewBox: "0 0 16 16",
35272
+ fill: "none",
35273
+ children: /* @__PURE__ */ jsx107(
35274
+ "path",
35275
+ {
35276
+ d: "M4 8H12",
35277
+ stroke: "#C3C3C3",
35278
+ "stroke-width": "1.5",
35279
+ "stroke-linecap": "round",
35280
+ "stroke-linejoin": "round"
35281
+ }
35282
+ )
35283
+ }
35284
+ );
35285
+ };
35286
+ var ICCircle = () => {
35287
+ return /* @__PURE__ */ jsx107(
35288
+ "svg",
35289
+ {
35290
+ xmlns: "http://www.w3.org/2000/svg",
35291
+ width: "8",
35292
+ height: "8",
35293
+ viewBox: "0 0 8 8",
35294
+ fill: "none",
35295
+ children: /* @__PURE__ */ jsx107("circle", { cx: "4", cy: "4", r: "4", fill: "white" })
35296
+ }
35297
+ );
35298
+ };
35299
+ var ICCheck = () => {
35300
+ return /* @__PURE__ */ jsx107(
35301
+ "svg",
35302
+ {
35303
+ xmlns: "http://www.w3.org/2000/svg",
35304
+ width: "16",
35305
+ height: "16",
35306
+ viewBox: "0 0 16 16",
35307
+ fill: "none",
35308
+ children: /* @__PURE__ */ jsx107(
35309
+ "path",
35310
+ {
35311
+ d: "M13.3408 5.23535L13.252 5.32324L6.88867 11.6875L6.7998 11.7764L6.71191 11.6875L2.89258 7.86914L2.80469 7.78125L2.89258 7.69238L3.74121 6.84375L3.83008 6.75586L6.7998 9.72559L12.2266 4.29785L12.3154 4.20996L13.3408 5.23535Z",
35312
+ fill: "white",
35313
+ stroke: "white",
35314
+ "stroke-width": "0.25"
35315
+ }
35316
+ )
35317
+ }
35318
+ );
35319
+ };
35234
35320
 
35235
35321
  // src/widgets/basic/date-option-field/date-option.tsx
35236
35322
  import { jsx as jsx108, jsxs as jsxs74 } from "react/jsx-runtime";
@@ -35390,7 +35476,6 @@ export {
35390
35476
  loginSchema,
35391
35477
  parseFormattedNumber,
35392
35478
  range,
35393
- typeStyles,
35394
35479
  useClickOutside,
35395
35480
  useFileInfo,
35396
35481
  useFormatDate,
package/dist/utils.d.mts CHANGED
@@ -21,20 +21,10 @@ declare const COLORS: {
21
21
  id: number;
22
22
  }[];
23
23
  declare const DOTS = "...";
24
- declare const typeStyles: {
25
- primary: string;
26
- secondary: string;
27
- danger: string;
28
- info: string;
29
- success: string;
30
- warning: string;
31
- default: string;
32
- light: string;
33
- };
34
24
  declare const SearchType: {
35
25
  FILTER: string;
36
26
  SEARCH: string;
37
27
  GROUP: string;
38
28
  };
39
29
 
40
- export { COLORS, DOTS, SearchType, checkIsImageLink, convertFloatToTime, convertTimeToFloat, formatFileSize, formatFloatNumber, formatNumberOnly, getPasswordMessage, isBase64Image, isObjectEmpty, parseFormattedNumber, range, typeStyles, useFormatDate, validateAndParseDate, validateInput };
30
+ export { COLORS, DOTS, SearchType, checkIsImageLink, convertFloatToTime, convertTimeToFloat, formatFileSize, formatFloatNumber, formatNumberOnly, getPasswordMessage, isBase64Image, isObjectEmpty, parseFormattedNumber, range, useFormatDate, validateAndParseDate, validateInput };
package/dist/utils.d.ts CHANGED
@@ -21,20 +21,10 @@ declare const COLORS: {
21
21
  id: number;
22
22
  }[];
23
23
  declare const DOTS = "...";
24
- declare const typeStyles: {
25
- primary: string;
26
- secondary: string;
27
- danger: string;
28
- info: string;
29
- success: string;
30
- warning: string;
31
- default: string;
32
- light: string;
33
- };
34
24
  declare const SearchType: {
35
25
  FILTER: string;
36
26
  SEARCH: string;
37
27
  GROUP: string;
38
28
  };
39
29
 
40
- export { COLORS, DOTS, SearchType, checkIsImageLink, convertFloatToTime, convertTimeToFloat, formatFileSize, formatFloatNumber, formatNumberOnly, getPasswordMessage, isBase64Image, isObjectEmpty, parseFormattedNumber, range, typeStyles, useFormatDate, validateAndParseDate, validateInput };
30
+ export { COLORS, DOTS, SearchType, checkIsImageLink, convertFloatToTime, convertTimeToFloat, formatFileSize, formatFloatNumber, formatNumberOnly, getPasswordMessage, isBase64Image, isObjectEmpty, parseFormattedNumber, range, useFormatDate, validateAndParseDate, validateInput };
package/dist/utils.js CHANGED
@@ -4071,7 +4071,6 @@ __export(utils_exports, {
4071
4071
  isObjectEmpty: () => isObjectEmpty,
4072
4072
  parseFormattedNumber: () => parseFormattedNumber,
4073
4073
  range: () => range,
4074
- typeStyles: () => typeStyles,
4075
4074
  useFormatDate: () => useFormatDate,
4076
4075
  validateAndParseDate: () => validateAndParseDate,
4077
4076
  validateInput: () => validateInput
@@ -4838,16 +4837,6 @@ var COLORS = [
4838
4837
  }
4839
4838
  ];
4840
4839
  var DOTS = "...";
4841
- var typeStyles = {
4842
- primary: "bg-blue-500 text-white",
4843
- secondary: "bg-lime-600 text-white",
4844
- danger: "bg-[rgba(237,28,36,0.1)] text-[#F5222D]",
4845
- info: "bg-[rgba(5,152,237,0.12)] text-[rgb(5,152,237)]",
4846
- success: "bg-[rgba(46,181,83,0.1)] text-[rgb(46,181,83)]",
4847
- warning: "bg-[rgba(237,166,28,0.1)] text-[rgb(250,140,22)]",
4848
- default: "bg-[#dee2e6]",
4849
- light: "bg-white text-gray-800 shadow-md"
4850
- };
4851
4840
  var SearchType = {
4852
4841
  FILTER: "filter_by",
4853
4842
  SEARCH: "search_by",
@@ -4869,7 +4858,6 @@ var SearchType = {
4869
4858
  isObjectEmpty,
4870
4859
  parseFormattedNumber,
4871
4860
  range,
4872
- typeStyles,
4873
4861
  useFormatDate,
4874
4862
  validateAndParseDate,
4875
4863
  validateInput
package/dist/utils.mjs CHANGED
@@ -4814,16 +4814,6 @@ var COLORS = [
4814
4814
  }
4815
4815
  ];
4816
4816
  var DOTS = "...";
4817
- var typeStyles = {
4818
- primary: "bg-blue-500 text-white",
4819
- secondary: "bg-lime-600 text-white",
4820
- danger: "bg-[rgba(237,28,36,0.1)] text-[#F5222D]",
4821
- info: "bg-[rgba(5,152,237,0.12)] text-[rgb(5,152,237)]",
4822
- success: "bg-[rgba(46,181,83,0.1)] text-[rgb(46,181,83)]",
4823
- warning: "bg-[rgba(237,166,28,0.1)] text-[rgb(250,140,22)]",
4824
- default: "bg-[#dee2e6]",
4825
- light: "bg-white text-gray-800 shadow-md"
4826
- };
4827
4817
  var SearchType = {
4828
4818
  FILTER: "filter_by",
4829
4819
  SEARCH: "search_by",
@@ -4844,7 +4834,6 @@ export {
4844
4834
  isObjectEmpty,
4845
4835
  parseFormattedNumber,
4846
4836
  range,
4847
- typeStyles,
4848
4837
  useFormatDate,
4849
4838
  validateAndParseDate,
4850
4839
  validateInput