@owp/core 2.3.1 → 2.4.1

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.
Files changed (151) hide show
  1. package/dist/_virtual/index11.js +2 -2
  2. package/dist/_virtual/index12.js +2 -2
  3. package/dist/_virtual/index13.js +2 -2
  4. package/dist/_virtual/index14.js +2 -2
  5. package/dist/_virtual/index16.js +5 -2
  6. package/dist/_virtual/index16.js.map +1 -1
  7. package/dist/_virtual/index17.js +5 -2
  8. package/dist/_virtual/index17.js.map +1 -1
  9. package/dist/_virtual/index18.js +4 -4
  10. package/dist/_virtual/index19.js +4 -4
  11. package/dist/_virtual/index20.js +2 -5
  12. package/dist/_virtual/index20.js.map +1 -1
  13. package/dist/_virtual/index5.js +2 -5
  14. package/dist/_virtual/index5.js.map +1 -1
  15. package/dist/_virtual/index6.js +2 -2
  16. package/dist/_virtual/index7.js +2 -2
  17. package/dist/components/OwpCommonCode/OwpCommonCodeRadioGroup.js +38 -38
  18. package/dist/components/OwpCommonCode/OwpCommonCodeRadioGroup.js.map +1 -1
  19. package/dist/components/OwpFieldHelperText/OwpFieldHelperText.js +34 -0
  20. package/dist/components/OwpFieldHelperText/OwpFieldHelperText.js.map +1 -0
  21. package/dist/components/OwpLayout/OwpLayout.js +39 -39
  22. package/dist/components/OwpLayout/OwpLayout.js.map +1 -1
  23. package/dist/components/OwpRequiredHelperText/OwpRequiredHelperText.js +38 -0
  24. package/dist/components/OwpRequiredHelperText/OwpRequiredHelperText.js.map +1 -0
  25. package/dist/components/OwpTable/OwpFieldTable.js +99 -0
  26. package/dist/components/OwpTable/OwpFieldTable.js.map +1 -0
  27. package/dist/components/OwpTextField/OwpTextMaskField.js +138 -87
  28. package/dist/components/OwpTextField/OwpTextMaskField.js.map +1 -1
  29. package/dist/components/OwpTreeGrid/OwpTreeGrid.js +169 -148
  30. package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
  31. package/dist/components/OwpTreeGrid/internal/OwpTreeGridLoadingOverlay.js +1 -1
  32. package/dist/components/OwpTreeGrid/internal/OwpTreeGridLoadingOverlay.js.map +1 -1
  33. package/dist/components/OwpTreeGrid/internal/OwpTreeGridNoDataOverlay.js +1 -1
  34. package/dist/components/OwpTreeGrid/internal/OwpTreeGridNoDataOverlay.js.map +1 -1
  35. package/dist/components/OwpTreeGrid/{hooks → internal/hooks}/useOwpTreeGridOverlayFrame.js +1 -1
  36. package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridOverlayFrame.js.map +1 -0
  37. package/dist/components/OwpTreeGrid/internal/treeGridColumnEditRules.js +84 -0
  38. package/dist/components/OwpTreeGrid/internal/treeGridColumnEditRules.js.map +1 -0
  39. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +114 -103
  40. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
  41. package/dist/components/OwpTreeGrid/internal/utils/perf.js.map +1 -0
  42. package/dist/hooks/useCurrentUserSeq.js +20 -6
  43. package/dist/hooks/useCurrentUserSeq.js.map +1 -1
  44. package/dist/hooks.js +50 -49
  45. package/dist/index.js +74 -70
  46. package/dist/index.js.map +1 -1
  47. package/dist/layout/Layout.js +24 -24
  48. package/dist/layout/Layout.js.map +1 -1
  49. package/dist/layout/components/toggles/NavigationSearchToggle.js +3 -3
  50. package/dist/layout/themeLayouts.js.map +1 -1
  51. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
  52. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/index.js +1 -1
  53. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE39/index.js +1 -1
  54. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/index.js +1 -1
  55. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/constants.js +1 -1
  56. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/index.js +1 -1
  57. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/GenericBarcode/index.js +1 -1
  58. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/index.js +1 -1
  59. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/MSI/index.js +1 -1
  60. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/codabar/index.js +1 -1
  61. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/pharmacode/index.js +1 -1
  62. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/renderers/index.js +1 -1
  63. package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -1
  64. package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +1 -1
  65. package/dist/node_modules/.pnpm/react-overlays@5.2.1_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-overlays/esm/Portal.js +1 -1
  66. package/dist/owp-app.css +1 -1
  67. package/dist/types/components/OwpFieldHelperText/OwpFieldHelperText.d.ts +14 -0
  68. package/dist/types/components/OwpFieldHelperText/index.d.ts +2 -0
  69. package/dist/types/components/OwpRequiredHelperText/OwpRequiredHelperText.d.ts +18 -0
  70. package/dist/types/components/OwpRequiredHelperText/index.d.ts +2 -0
  71. package/dist/types/components/OwpTable/{OwpVerticalTable.d.ts → OwpFieldTable.d.ts} +9 -8
  72. package/dist/types/components/OwpTable/index.d.ts +1 -1
  73. package/dist/types/components/OwpTextField/OwpTextMaskField.d.ts +5 -3
  74. package/dist/types/components/OwpTreeGrid/OwpTreeGrid.d.ts +7 -1
  75. package/dist/types/components/OwpTreeGrid/index.d.ts +1 -1
  76. package/dist/types/components/OwpTreeGrid/internal/OwpTreeGridLoadingOverlay.d.ts +1 -1
  77. package/dist/types/components/OwpTreeGrid/internal/OwpTreeGridNoDataOverlay.d.ts +1 -1
  78. package/dist/types/components/OwpTreeGrid/internal/treeGridColumnEditRules.d.ts +60 -0
  79. package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +7 -2
  80. package/dist/types/hooks/useCurrentUserSeq.d.ts +11 -2
  81. package/dist/types/index.d.ts +3 -1
  82. package/dist/types/layout/Layout.d.ts +2 -0
  83. package/dist/types/layout/themeLayouts.d.ts +2 -0
  84. package/package.json +3 -3
  85. package/dist/components/OwpTable/OwpVerticalTable.js +0 -96
  86. package/dist/components/OwpTable/OwpVerticalTable.js.map +0 -1
  87. package/dist/components/OwpTreeGrid/hooks/useOwpTreeGridOverlayFrame.js.map +0 -1
  88. package/dist/components/OwpTreeGrid/utils/perf.js.map +0 -1
  89. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/html-contenteditable-mask-element.js +0 -39
  90. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/html-contenteditable-mask-element.js.map +0 -1
  91. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/html-input-mask-element.js +0 -36
  92. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/html-input-mask-element.js.map +0 -1
  93. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/html-mask-element.js +0 -52
  94. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/html-mask-element.js.map +0 -1
  95. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/input-history.js +0 -35
  96. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/input-history.js.map +0 -1
  97. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/input.js +0 -227
  98. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/input.js.map +0 -1
  99. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/mask-element.js +0 -48
  100. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/mask-element.js.map +0 -1
  101. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/action-details.js +0 -56
  102. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/action-details.js.map +0 -1
  103. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/change-details.js +0 -41
  104. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/change-details.js.map +0 -1
  105. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/continuous-tail-details.js +0 -47
  106. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/continuous-tail-details.js.map +0 -1
  107. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/holder.js +0 -10
  108. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/holder.js.map +0 -1
  109. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/utils.js +0 -76
  110. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/utils.js.map +0 -1
  111. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/index.js +0 -51
  112. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/index.js.map +0 -1
  113. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/base.js +0 -257
  114. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/base.js.map +0 -1
  115. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/date.js +0 -121
  116. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/date.js.map +0 -1
  117. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/dynamic.js +0 -227
  118. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/dynamic.js.map +0 -1
  119. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/enum.js +0 -74
  120. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/enum.js.map +0 -1
  121. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/factory.js +0 -52
  122. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/factory.js.map +0 -1
  123. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/function.js +0 -28
  124. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/function.js.map +0 -1
  125. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/number.js +0 -217
  126. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/number.js.map +0 -1
  127. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/chunk-tail-details.js +0 -108
  128. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/chunk-tail-details.js.map +0 -1
  129. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/cursor.js +0 -105
  130. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/cursor.js.map +0 -1
  131. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/fixed-definition.js +0 -107
  132. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/fixed-definition.js.map +0 -1
  133. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/input-definition.js +0 -138
  134. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/input-definition.js.map +0 -1
  135. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern.js +0 -327
  136. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern.js.map +0 -1
  137. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pipe.js +0 -28
  138. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pipe.js.map +0 -1
  139. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/range.js +0 -83
  140. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/range.js.map +0 -1
  141. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/regexp.js +0 -26
  142. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/regexp.js.map +0 -1
  143. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/repeat.js +0 -109
  144. package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/repeat.js.map +0 -1
  145. package/dist/node_modules/.pnpm/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/input.js +0 -28
  146. package/dist/node_modules/.pnpm/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/input.js.map +0 -1
  147. package/dist/node_modules/.pnpm/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/mixin.js +0 -136
  148. package/dist/node_modules/.pnpm/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/mixin.js.map +0 -1
  149. /package/dist/components/OwpTreeGrid/{utils → internal/utils}/perf.js +0 -0
  150. /package/dist/types/components/OwpTreeGrid/{hooks → internal/hooks}/useOwpTreeGridOverlayFrame.d.ts +0 -0
  151. /package/dist/types/components/OwpTreeGrid/{utils → internal/utils}/perf.d.ts +0 -0
@@ -1,5 +1,5 @@
1
- var r = {};
1
+ var a = {};
2
2
  export {
3
- r as __exports
3
+ a as __exports
4
4
  };
5
5
  //# sourceMappingURL=index11.js.map
@@ -1,5 +1,5 @@
1
- var r = {};
1
+ var a = {};
2
2
  export {
3
- r as __exports
3
+ a as __exports
4
4
  };
5
5
  //# sourceMappingURL=index12.js.map
@@ -1,5 +1,5 @@
1
- var a = {};
1
+ var r = {};
2
2
  export {
3
- a as __exports
3
+ r as __exports
4
4
  };
5
5
  //# sourceMappingURL=index13.js.map
@@ -1,5 +1,5 @@
1
- var a = {};
1
+ var e = {};
2
2
  export {
3
- a as __exports
3
+ e as __exports
4
4
  };
5
5
  //# sourceMappingURL=index14.js.map
@@ -1,5 +1,8 @@
1
- var e = {};
1
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
+ import { __require as o } from "../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js";
3
+ var p = /* @__PURE__ */ o();
4
+ const s = /* @__PURE__ */ r(p);
2
5
  export {
3
- e as __exports
6
+ s as default
4
7
  };
5
8
  //# sourceMappingURL=index16.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index16.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index16.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,5 +1,8 @@
1
- var r = {};
1
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
+ import { __require as t } from "../node_modules/.pnpm/autosuggest-highlight@3.3.4/node_modules/autosuggest-highlight/match/index.js";
3
+ var o = t();
4
+ const m = /* @__PURE__ */ r(o);
2
5
  export {
3
- r as __exports
6
+ m as default
4
7
  };
5
8
  //# sourceMappingURL=index17.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index17.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index17.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,8 +1,8 @@
1
1
  import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as t } from "../node_modules/.pnpm/autosuggest-highlight@3.3.4/node_modules/autosuggest-highlight/match/index.js";
3
- var o = t();
4
- const m = /* @__PURE__ */ r(o);
2
+ import { __require as e } from "../node_modules/.pnpm/autosuggest-highlight@3.3.4/node_modules/autosuggest-highlight/parse/index.js";
3
+ var o = e();
4
+ const s = /* @__PURE__ */ r(o);
5
5
  export {
6
- m as default
6
+ s as default
7
7
  };
8
8
  //# sourceMappingURL=index18.js.map
@@ -1,8 +1,8 @@
1
1
  import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as e } from "../node_modules/.pnpm/autosuggest-highlight@3.3.4/node_modules/autosuggest-highlight/parse/index.js";
3
- var o = e();
4
- const s = /* @__PURE__ */ r(o);
2
+ import { __require as t } from "../node_modules/.pnpm/react-autosuggest@10.1.0_react@19.2.4/node_modules/react-autosuggest/dist/index.js";
3
+ var o = t();
4
+ const i = /* @__PURE__ */ r(o);
5
5
  export {
6
- s as default
6
+ i as default
7
7
  };
8
8
  //# sourceMappingURL=index19.js.map
@@ -1,8 +1,5 @@
1
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as t } from "../node_modules/.pnpm/react-autosuggest@10.1.0_react@19.2.4/node_modules/react-autosuggest/dist/index.js";
3
- var o = t();
4
- const i = /* @__PURE__ */ r(o);
1
+ var p = { exports: {} };
5
2
  export {
6
- i as default
3
+ p as __module
7
4
  };
8
5
  //# sourceMappingURL=index20.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index20.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index20.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,8 +1,5 @@
1
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as o } from "../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js";
3
- var p = /* @__PURE__ */ o();
4
- const s = /* @__PURE__ */ r(p);
1
+ var e = { exports: {} };
5
2
  export {
6
- s as default
3
+ e as __module
7
4
  };
8
5
  //# sourceMappingURL=index5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +1,5 @@
1
- var p = { exports: {} };
1
+ var r = {};
2
2
  export {
3
- p as __module
3
+ r as __exports
4
4
  };
5
5
  //# sourceMappingURL=index6.js.map
@@ -1,5 +1,5 @@
1
- var e = { exports: {} };
1
+ var r = {};
2
2
  export {
3
- e as __module
3
+ r as __exports
4
4
  };
5
5
  //# sourceMappingURL=index7.js.map
@@ -1,59 +1,59 @@
1
- var b = Object.defineProperty;
2
- var u = (t, r) => b(t, "name", { value: r, configurable: !0 });
3
- import { jsxs as g, jsx as n } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
- import { useGetCommonCodeList as h } from "../../hooks/useCommonCodeList.js";
5
- import { FormControlLabel as L, Radio as R, RadioGroup as $, FormControl as p, FormLabel as x, FormHelperText as F } from "@mui/material";
6
- import { useId as X, useMemo as d } from "react";
7
- const _ = /* @__PURE__ */ u(({
8
- codeId: t,
9
- description: r,
10
- label: c,
11
- fullWidth: M,
12
- defaultValue: f,
1
+ var R = Object.defineProperty;
2
+ var O = (l, n) => R(l, "name", { value: n, configurable: !0 });
3
+ import { jsxs as b, jsx as a } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
+ import { useGetCommonCodeList as g } from "../../hooks/useCommonCodeList.js";
5
+ import { FormControlLabel as h, Radio as v, RadioGroup as F, FormControl as X, FormLabel as _, FormHelperText as $ } from "@mui/material";
6
+ import { useId as w, useMemo as M } from "react";
7
+ const x = /* @__PURE__ */ O(({
8
+ codeId: l,
9
+ description: n,
10
+ label: m,
11
+ fullWidth: f,
12
+ defaultValue: s,
13
13
  useValueKeyDescription: D,
14
- required: I,
15
- error: s,
16
- helperText: E,
14
+ required: E,
15
+ error: N,
16
+ helperText: d,
17
17
  filterOptions: i,
18
18
  ...e
19
19
  }) => {
20
- const l = X(), m = h(), C = d(() => (m == null ? void 0 : m[t]) ?? [], [t, m]), N = d(() => {
21
- const o = typeof i == "function" ? C.filter(i) : C;
22
- return r ? o.filter(
23
- (a) => a["IPX_COMMONCODE.DESCRIPTION"] === r
20
+ const C = w(), t = g(), u = M(() => (t == null ? void 0 : t[l]) ?? [], [l, t]), c = `common-code-radio-group-${C}`, L = M(() => {
21
+ const o = typeof i == "function" ? u.filter(i) : u;
22
+ return n ? o.filter(
23
+ (r) => r["IPX_COMMONCODE.DESCRIPTION"] === n
24
24
  ) : o;
25
- }, [C, r, i]);
26
- return /* @__PURE__ */ g(p, { className: "min-w-128", fullWidth: M, required: I, error: s, children: [
27
- /* @__PURE__ */ n(x, { id: `common-code-radio-group-${l}`, children: c }),
28
- /* @__PURE__ */ n(
29
- $,
25
+ }, [u, n, i]);
26
+ return /* @__PURE__ */ b(X, { className: "min-w-128", fullWidth: f, required: E, error: N, children: [
27
+ m ? /* @__PURE__ */ a(_, { id: c, children: m }) : null,
28
+ /* @__PURE__ */ a(
29
+ F,
30
30
  {
31
31
  row: !0,
32
32
  ...e,
33
- "aria-labelledby": `common-code-radio-group-${l}`,
34
- name: e.name ?? `common-code-radio-group-name-${l}`,
35
- defaultValue: f,
33
+ "aria-labelledby": m ? c : void 0,
34
+ name: e.name ?? `common-code-radio-group-name-${C}`,
35
+ defaultValue: s,
36
36
  value: e.value,
37
- onChange: /* @__PURE__ */ u((o, a) => {
38
- var O;
39
- (O = e.onChange) == null || O.call(e, o, a);
37
+ onChange: /* @__PURE__ */ O((o, r) => {
38
+ var I;
39
+ (I = e.onChange) == null || I.call(e, o, r);
40
40
  }, "onChange"),
41
- children: N.map((o, a) => /* @__PURE__ */ n(
42
- L,
41
+ children: L.map((o, r) => /* @__PURE__ */ a(
42
+ h,
43
43
  {
44
44
  value: o[D ? "IPX_COMMONCODE.DESCRIPTION" : "IPX_COMMONCODE.CODEID"],
45
- control: /* @__PURE__ */ n(R, {}),
45
+ control: /* @__PURE__ */ a(v, {}),
46
46
  label: o["IPX_COMMONCODE.CODENM"]
47
47
  },
48
- `common-code-radio-group-item-${l}-${a}`
48
+ `common-code-radio-group-item-${C}-${r}`
49
49
  ))
50
50
  }
51
51
  ),
52
- /* @__PURE__ */ n(F, { children: E })
52
+ d ? /* @__PURE__ */ a($, { children: d }) : null
53
53
  ] });
54
- }, "OwpCommonCodeRadioGroup"), S = _;
54
+ }, "OwpCommonCodeRadioGroup"), y = x;
55
55
  export {
56
- S as CommonCodeRadioGroup,
57
- _ as OwpCommonCodeRadioGroup
56
+ y as CommonCodeRadioGroup,
57
+ x as OwpCommonCodeRadioGroup
58
58
  };
59
59
  //# sourceMappingURL=OwpCommonCodeRadioGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OwpCommonCodeRadioGroup.js","sources":["../../../src/components/OwpCommonCode/OwpCommonCodeRadioGroup.tsx"],"sourcesContent":["import { useGetCommonCodeList } from '@/hooks/useCommonCodeList';\nimport { CommonCode } from '@/utils/commonCodeUtils';\nimport {\n FormControl,\n FormControlLabel,\n FormControlProps,\n FormHelperText,\n FormLabel,\n Radio,\n RadioGroup,\n RadioGroupProps,\n} from '@mui/material';\nimport { useId, useMemo } from 'react';\n\nexport type OwpCommonCodeRadioGroupProps = FormControlProps &\n RadioGroupProps & {\n codeId: string;\n description?: string;\n useValueKeyDescription?: boolean;\n label?: string;\n helperText?: string;\n filterOptions?: (commonCode: CommonCode) => boolean;\n };\n\n/**\n * 공통코드 목록을 기반으로 라디오 그룹을 렌더링합니다.\n * @param props 공통코드 라디오 그룹 props\n */\nexport const OwpCommonCodeRadioGroup = ({\n codeId,\n description,\n label,\n fullWidth,\n defaultValue,\n useValueKeyDescription,\n required,\n error,\n helperText,\n filterOptions,\n ...commonCodeProps\n}: OwpCommonCodeRadioGroupProps) => {\n const labelId = useId();\n const commonCodeByGroupId = useGetCommonCodeList();\n const commonCodeList = useMemo(() => commonCodeByGroupId?.[codeId] ?? [], [codeId, commonCodeByGroupId]);\n\n const finalCommonCodeList = useMemo(() => {\n const filteredCommonCodeList =\n typeof filterOptions === 'function' ? commonCodeList.filter(filterOptions) : commonCodeList;\n\n if (description) {\n return filteredCommonCodeList.filter(\n (item) => item['IPX_COMMONCODE.DESCRIPTION'] === description,\n );\n }\n\n return filteredCommonCodeList;\n }, [commonCodeList, description, filterOptions]);\n\n return (\n <FormControl className=\"min-w-128\" fullWidth={fullWidth} required={required} error={error}>\n <FormLabel id={`common-code-radio-group-${labelId}`}>{label}</FormLabel>\n <RadioGroup\n row\n {...commonCodeProps}\n aria-labelledby={`common-code-radio-group-${labelId}`}\n name={commonCodeProps.name ?? `common-code-radio-group-name-${labelId}`}\n defaultValue={defaultValue}\n value={commonCodeProps.value}\n onChange={(event, value) => {\n commonCodeProps.onChange?.(event, value);\n }}\n >\n {finalCommonCodeList.map((item, index) => (\n <FormControlLabel\n key={`common-code-radio-group-item-${labelId}-${index}`}\n value={\n item[useValueKeyDescription ? 'IPX_COMMONCODE.DESCRIPTION' : 'IPX_COMMONCODE.CODEID']\n }\n control={<Radio />}\n label={item['IPX_COMMONCODE.CODENM']}\n />\n ))}\n </RadioGroup>\n <FormHelperText>{helperText}</FormHelperText>\n </FormControl>\n );\n};\n\nexport const CommonCodeRadioGroup = OwpCommonCodeRadioGroup;\n"],"names":["OwpCommonCodeRadioGroup","__name","codeId","description","label","fullWidth","defaultValue","useValueKeyDescription","required","error","helperText","filterOptions","commonCodeProps","labelId","useId","commonCodeByGroupId","useGetCommonCodeList","commonCodeList","useMemo","finalCommonCodeList","filteredCommonCodeList","item","FormControl","jsx","FormLabel","RadioGroup","event","value","_a","index","FormControlLabel","Radio","FormHelperText","CommonCodeRadioGroup"],"mappings":";;;;;;AA4BO,MAAMA,IAA0B,gBAAAC,EAAA,CAAC;AAAA,EACtC,Q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AA+B,uBAAuB;AAAA,YAEtF,2BAAUwB,GAAA,EAAM;AAAA,YAChB,OAAOV,EAAK,uBAAuB;AAAA,UAAA;AAAA,UAL9B,gCAAgCR,CAAO,IAAIgB,CAAK;AAAA,QAAA,CAOxD;AAAA,MAAA;AAAA,IAAA;AAAA,IAEH,gBAAAN,EAACS,KAAgB,UAAAtB,EAAA,CAAW;AAAA,EAAA,GAC9B;AAEJ,GA1DuC,4BA4D1BuB,IAAuBjC;"}
1
+ {"version":3,"file":"OwpCommonCodeRadioGroup.js","sources":["../../../src/components/OwpCommonCode/OwpCommonCodeRadioGroup.tsx"],"sourcesContent":["import { useGetCommonCodeList } from '@/hooks/useCommonCodeList';\nimport { CommonCode } from '@/utils/commonCodeUtils';\nimport {\n FormControl,\n FormControlLabel,\n FormControlProps,\n FormHelperText,\n FormLabel,\n Radio,\n RadioGroup,\n RadioGroupProps,\n} from '@mui/material';\nimport { useId, useMemo } from 'react';\n\nexport type OwpCommonCodeRadioGroupProps = FormControlProps &\n RadioGroupProps & {\n codeId: string;\n description?: string;\n useValueKeyDescription?: boolean;\n label?: string;\n helperText?: string;\n filterOptions?: (commonCode: CommonCode) => boolean;\n };\n\n/**\n * 공통코드 목록을 기반으로 라디오 그룹을 렌더링합니다.\n * @param props 공통코드 라디오 그룹 props\n */\nexport const OwpCommonCodeRadioGroup = ({\n codeId,\n description,\n label,\n fullWidth,\n defaultValue,\n useValueKeyDescription,\n required,\n error,\n helperText,\n filterOptions,\n ...commonCodeProps\n}: OwpCommonCodeRadioGroupProps) => {\n const labelId = useId();\n const commonCodeByGroupId = useGetCommonCodeList();\n const commonCodeList = useMemo(() => commonCodeByGroupId?.[codeId] ?? [], [codeId, commonCodeByGroupId]);\n const labelElementId = `common-code-radio-group-${labelId}`;\n\n const finalCommonCodeList = useMemo(() => {\n const filteredCommonCodeList =\n typeof filterOptions === 'function' ? commonCodeList.filter(filterOptions) : commonCodeList;\n\n if (description) {\n return filteredCommonCodeList.filter(\n (item) => item['IPX_COMMONCODE.DESCRIPTION'] === description,\n );\n }\n\n return filteredCommonCodeList;\n }, [commonCodeList, description, filterOptions]);\n\n return (\n <FormControl className=\"min-w-128\" fullWidth={fullWidth} required={required} error={error}>\n {label ? <FormLabel id={labelElementId}>{label}</FormLabel> : null}\n <RadioGroup\n row\n {...commonCodeProps}\n aria-labelledby={label ? labelElementId : undefined}\n name={commonCodeProps.name ?? `common-code-radio-group-name-${labelId}`}\n defaultValue={defaultValue}\n value={commonCodeProps.value}\n onChange={(event, value) => {\n commonCodeProps.onChange?.(event, value);\n }}\n >\n {finalCommonCodeList.map((item, index) => (\n <FormControlLabel\n key={`common-code-radio-group-item-${labelId}-${index}`}\n value={\n item[useValueKeyDescription ? 'IPX_COMMONCODE.DESCRIPTION' : 'IPX_COMMONCODE.CODEID']\n }\n control={<Radio />}\n label={item['IPX_COMMONCODE.CODENM']}\n />\n ))}\n </RadioGroup>\n {helperText ? <FormHelperText>{helperText}</FormHelperText> : null}\n </FormControl>\n );\n};\n\nexport const CommonCodeRadioGroup = OwpCommonCodeRadioGroup;\n"],"names":["OwpCommonCodeRadioGroup","__name","codeId","description","label","fullWidth","defaultValue","useValueKeyDescription","required","error","helperText","filterOptions","commonCodeProps","labelId","useId","commonCodeByGroupId","useGetCommonCodeList","commonCodeList","useMemo","labelElementId","finalCommonCodeList","filteredCommonCodeList","item","FormControl","jsx","FormLabel","RadioGroup","event","value","_a","index","FormControlLabel","Radio","FormHelperText","CommonCodeRadioGroup"],"mappings":";;;;;;AA4BO,MAAMA,IAA0B,gBAAAC,EAAA,CAAC;AAAA,EACtC,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACL,MAAoC;AAClC,QAAMC,IAAUC,EAAA,GACVC,IAAsBC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AACS,GAAA,EAAgB,UAAAvB,EAAA,CAAW,IAAoB;AAAA,EAAA,GAChE;AAEJ,GA3DuC,4BA6D1BwB,IAAuBlC;"}
@@ -0,0 +1,34 @@
1
+ var m = Object.defineProperty;
2
+ var s = (e, n) => m(e, "name", { value: n, configurable: !0 });
3
+ import { jsxs as a, jsx as l } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
+ import t from "@mui/material/FormHelperText";
5
+ import { clsx as d } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
6
+ function u({
7
+ children: e,
8
+ required: n = !1,
9
+ className: r,
10
+ component: i = "div",
11
+ ...o
12
+ }) {
13
+ return !(e != null && e !== "") && !n ? null : /* @__PURE__ */ a(
14
+ t,
15
+ {
16
+ ...o,
17
+ component: i,
18
+ className: d("text-16 font-medium", r),
19
+ children: [
20
+ n ? /* @__PURE__ */ a("span", { className: "mr-4 leading-none text-red-600", children: [
21
+ /* @__PURE__ */ l("span", { className: "leading-none", children: "(" }),
22
+ /* @__PURE__ */ l("span", { className: "leading-none", children: "*" }),
23
+ /* @__PURE__ */ l("span", { className: "leading-none", children: ")" })
24
+ ] }) : null,
25
+ e
26
+ ]
27
+ }
28
+ );
29
+ }
30
+ s(u, "OwpFieldHelperText");
31
+ export {
32
+ u as OwpFieldHelperText
33
+ };
34
+ //# sourceMappingURL=OwpFieldHelperText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OwpFieldHelperText.js","sources":["../../../src/components/OwpFieldHelperText/OwpFieldHelperText.tsx"],"sourcesContent":["import FormHelperText from '@mui/material/FormHelperText';\nimport type { FormHelperTextProps } from '@mui/material/FormHelperText';\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport interface OwpFieldHelperTextProps\n extends Omit<FormHelperTextProps, 'children'> {\n children?: ReactNode;\n required?: boolean;\n}\n\n/**\n * 입력 필드 하단 안내 문구\n * @param children 안내 문구\n * @param required 필수 표시 노출 여부\n * @param className 추가 스타일 클래스\n */\nfunction OwpFieldHelperText({\n children,\n required = false,\n className,\n component = 'div',\n ...formHelperTextProps\n}: OwpFieldHelperTextProps) {\n const hasChildren = children !== undefined && children !== null && children !== '';\n\n if (!hasChildren && !required) {\n return null;\n }\n\n return (\n <FormHelperText\n {...formHelperTextProps}\n component={component}\n className={clsx('text-16 font-medium', className)}\n >\n {required ? (\n <span className=\"mr-4 leading-none text-red-600\">\n <span className=\"leading-none\">(</span>\n <span className=\"leading-none\">*</span>\n <span className=\"leading-none\">)</span>\n </span>\n ) : null}\n {children}\n </FormHelperText>\n );\n}\n\nexport { OwpFieldHelperText };\n"],"names":["OwpFieldHelperText","children","required","className","component","formHelperTextProps","jsxs","FormHelperText","clsx","jsx","__name"],"mappings":";;;;;AAiBA,SAASA,EAAmB;AAAA,EAC1B,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAA4B;AAG1B,SAAI,EAF0CJ,KAAa,QAAQA,MAAa,OAE5D,CAACC,IACZ,OAIP,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,WAAAD;AAAA,MACA,WAAWI,EAAK,uBAAuBL,CAAS;AAAA,MAE/C,UAAA;AAAA,QAAAD,IACC,gBAAAI,EAAC,QAAA,EAAK,WAAU,kCACd,UAAA;AAAA,UAAA,gBAAAG,EAAC,QAAA,EAAK,WAAU,gBAAe,UAAA,KAAC;AAAA,UAChC,gBAAAA,EAAC,QAAA,EAAK,WAAU,gBAAe,UAAA,KAAC;AAAA,UAChC,gBAAAA,EAAC,QAAA,EAAK,WAAU,gBAAe,UAAA,IAAA,CAAC;AAAA,QAAA,EAAA,CAClC,IACE;AAAA,QACHR;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP;AA7BSS,EAAAV,GAAA;"}
@@ -1,47 +1,47 @@
1
- var w = Object.defineProperty;
2
- var g = (s, o) => w(s, "name", { value: o, configurable: !0 });
3
- import { jsx as L } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
- import { themeLayouts as R } from "../../layout/themeLayouts.js";
5
- import { useOwpAppContext as z } from "../../contexts/OwpAppProvider.js";
6
- import { generateSettings as O } from "../../configs/defaultConfig.js";
7
- import { useOwpTranslation as C } from "../../hooks/useOwpTranslation.js";
8
- import { useSetSettings as P, useGetCurrentSettings as x, useGetDefaultSettings as j } from "../../hooks/useOwpSettings.js";
9
- import { useRef as B, useMemo as f, useEffect as S } from "react";
10
- import { useLocation as E, matchRoutes as F } from "react-router-dom";
11
- import { isEqual as G } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isEqual.js";
12
- import { merge as M } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/merge.js";
13
- import { OwpLoading as T } from "../OwpLoading/OwpLoading.js";
14
- function Y(s) {
15
- var y;
16
- const { routesConfig: o } = z(), { i18n: r } = C(), { layouts: m = R, children: u } = s, a = P(), t = x(), n = j(), l = (y = t == null ? void 0 : t.layout) == null ? void 0 : y.style, e = E(), { pathname: d } = e, h = B(!1), p = f(
17
- () => b(o, d, "settings", !0),
18
- [d, o]
19
- ), c = f(() => p === void 0 ? n : O(n, p), [n, p]), i = f(
20
- () => t === c || G(c, t),
21
- [c, t]
22
- );
23
- return S(() => {
24
- i || a(c);
25
- }, [c, i, a]), S(() => {
1
+ var O = Object.defineProperty;
2
+ var g = (a, e) => O(a, "name", { value: e, configurable: !0 });
3
+ import { jsx as z } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
+ import { themeLayouts as P } from "../../layout/themeLayouts.js";
5
+ import { useOwpAppContext as v } from "../../contexts/OwpAppProvider.js";
6
+ import { generateSettings as x } from "../../configs/defaultConfig.js";
7
+ import { useOwpTranslation as j } from "../../hooks/useOwpTranslation.js";
8
+ import { useSetSettings as B, useGetCurrentSettings as E, useGetDefaultSettings as F } from "../../hooks/useOwpSettings.js";
9
+ import { useRef as G, useMemo as l, useEffect as h } from "react";
10
+ import { useLocation as M, matchRoutes as T } from "react-router-dom";
11
+ import { isEqual as b } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isEqual.js";
12
+ import { merge as k } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/merge.js";
13
+ import { OwpLoading as q } from "../OwpLoading/OwpLoading.js";
14
+ function $(a) {
15
+ var L, w;
16
+ const { routesConfig: e } = v(), { i18n: n } = j(), { layouts: f = P, children: c } = a, m = B(), r = E(), i = F(), d = M(), { pathname: t } = d, y = G(!1), p = l(
17
+ () => A(e, t, "settings", !0),
18
+ [t, e]
19
+ ), s = l(() => p === void 0 ? i : x(i, p), [i, p]), o = l(
20
+ () => r === s || b(s, r),
21
+ [s, r]
22
+ ), u = o ? r : s, S = (L = u == null ? void 0 : u.layout) == null ? void 0 : L.style, I = (w = u == null ? void 0 : u.layout) == null ? void 0 : w.config;
23
+ return h(() => {
24
+ o || m(s);
25
+ }, [s, o, m]), h(() => {
26
26
  window.scrollTo(0, 0);
27
- }, [d]), S(() => {
28
- i && r.isInitialized && (h.current = !0);
29
- }, [r.isInitialized, i]), f(() => !r.isInitialized || !i && !h.current ? /* @__PURE__ */ L(T, {}) : Object.entries(m).map(([I, v]) => I === l ? /* @__PURE__ */ L(v, { children: u }, I) : null), [u, r.isInitialized, i, l, m]);
27
+ }, [t]), h(() => {
28
+ o && n.isInitialized && (y.current = !0);
29
+ }, [n.isInitialized, o]), l(() => !n.isInitialized || !o && !y.current ? /* @__PURE__ */ z(q, {}) : Object.entries(f).map(([R, C]) => R === S ? /* @__PURE__ */ z(C, { layoutConfig: I, children: c }, R) : null), [c, n.isInitialized, o, I, S, f]);
30
30
  }
31
- g(Y, "OwpLayout");
32
- function b(s, o, r, m = !0) {
33
- const u = F(s, o);
34
- if (!u)
31
+ g($, "OwpLayout");
32
+ function A(a, e, n, f = !0) {
33
+ const c = T(a, e);
34
+ if (!c)
35
35
  return;
36
- let a = !1;
37
- const t = u.reduce((n, l) => {
38
- const e = l.route[r];
39
- return e === void 0 ? n : (a = !0, !m || e === null ? e : M(n ?? {}, e));
36
+ let m = !1;
37
+ const r = c.reduce((i, d) => {
38
+ const t = d.route[n];
39
+ return t === void 0 ? i : (m = !0, !f || t === null ? t : k(i ?? {}, t));
40
40
  }, void 0);
41
- return a ? t : void 0;
41
+ return m ? r : void 0;
42
42
  }
43
- g(b, "getRouteParamUtil");
43
+ g(A, "getRouteParamUtil");
44
44
  export {
45
- Y as OwpLayout
45
+ $ as OwpLayout
46
46
  };
47
47
  //# sourceMappingURL=OwpLayout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OwpLayout.js","sources":["../../../src/components/OwpLayout/OwpLayout.tsx"],"sourcesContent":["import { themeLayouts, themeLayoutsType } from '@/layout/themeLayouts';\nimport { useOwpAppContext } from '@/contexts/OwpAppProvider';\nimport { generateSettings } from '@/configs/defaultConfig';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport {\n useGetCurrentSettings,\n useGetDefaultSettings,\n useSetSettings,\n} from '@/hooks/useOwpSettings';\nimport type { OwpSettingsConfigType } from '@/types/OwpSettingsTypes';\nimport { OwpRoutesType } from '@/utils/common/OwpUtils';\nimport { isEqual, merge } from 'es-toolkit/compat';\nimport { type ReactNode, useEffect, useMemo, useRef } from 'react';\nimport { matchRoutes, RouteMatch, RouteObject, useLocation } from 'react-router-dom';\nimport { OwpLoading } from '../OwpLoading';\n\nexport type OwpRouteObjectType = RouteObject & {\n settings?: OwpSettingsConfigType;\n auth?: string[] | [] | null | undefined;\n};\n\nexport type OwpRouteMatchType = RouteMatch & {\n route: OwpRouteObjectType;\n};\n\ntype OwpLayoutProps = {\n layouts?: themeLayoutsType;\n children?: ReactNode;\n};\n\n/**\n * OwpLayout\n * React frontend component in a React project that is used for layouting the user interface. The component\n * handles generating user interface settings related to current routes, merged with default settings, and uses\n * the new settings to generate layouts.\n */\nfunction OwpLayout(props: OwpLayoutProps) {\n const { routesConfig } = useOwpAppContext();\n const { i18n } = useOwpTranslation();\n\n const { layouts = themeLayouts, children } = props;\n const setSettings = useSetSettings();\n const settings = useGetCurrentSettings();\n const defaultSettings = useGetDefaultSettings();\n\n const layoutStyle = settings?.layout?.style;\n const location = useLocation();\n const { pathname } = location;\n const hasCompletedInitialLayoutSyncRef = useRef(false);\n\n const matchedSettings = useMemo(\n () => getRouteParamUtil(routesConfig, pathname, 'settings', true),\n [pathname, routesConfig],\n );\n const currentSettings = useMemo(() => {\n if (matchedSettings === undefined) {\n return defaultSettings;\n }\n\n return generateSettings(defaultSettings, matchedSettings);\n }, [defaultSettings, matchedSettings]);\n const isSettingsSynchronized = useMemo(\n () => settings === currentSettings || isEqual(currentSettings, settings),\n [currentSettings, settings],\n );\n\n useEffect(() => {\n if (isSettingsSynchronized) {\n return;\n }\n\n setSettings(currentSettings);\n }, [currentSettings, isSettingsSynchronized, setSettings]);\n\n useEffect(() => {\n window.scrollTo(0, 0);\n }, [pathname]);\n\n useEffect(() => {\n if (isSettingsSynchronized && i18n.isInitialized) {\n hasCompletedInitialLayoutSyncRef.current = true;\n }\n }, [i18n.isInitialized, isSettingsSynchronized]);\n\n return useMemo(() => {\n const shouldBlockForInitialLoading =\n !i18n.isInitialized ||\n (!isSettingsSynchronized && !hasCompletedInitialLayoutSyncRef.current);\n\n if (shouldBlockForInitialLoading) {\n return <OwpLoading />;\n }\n\n return Object.entries(layouts).map(([key, Layout]) => {\n if (key === layoutStyle) {\n return <Layout key={key}>{children}</Layout>;\n }\n\n return null;\n });\n }, [children, i18n.isInitialized, isSettingsSynchronized, layoutStyle, layouts]);\n}\n\nexport { OwpLayout };\n\n/**\n * Utility function to retrieve and merge or replace a specific route parameter from matched routes.\n *\n * @param pathname The current pathname\n * @param key The key of the parameter to merge or replace (e.g., 'settings', 'auth')\n * @param useMerge Whether to merge the parameter (using es-toolkit merge) or replace it\n * @returns The merged or replaced parameter data of type T\n */\nfunction getRouteParamUtil<T>(\n routes: OwpRoutesType,\n pathname: string,\n key: keyof OwpRouteObjectType,\n useMerge: boolean = true,\n): T | undefined {\n const matchedRoutes = matchRoutes(routes, pathname) as OwpRouteMatchType[] | null;\n\n if (!matchedRoutes) {\n return undefined;\n }\n\n let hasMatchedParam = false;\n\n const resolvedRouteParam = matchedRoutes.reduce<T | undefined>((acc, match) => {\n const routeParam = match.route[key] as T | undefined;\n\n if (routeParam === undefined) {\n return acc;\n }\n\n hasMatchedParam = true;\n\n if (!useMerge) {\n return routeParam;\n }\n\n if (routeParam === null) {\n return routeParam;\n }\n\n return merge(acc ?? {}, routeParam);\n }, undefined);\n\n return hasMatchedParam ? resolvedRouteParam : undefined;\n}\n"],"names":["OwpLayout","props","routesConfig","useOwpAppContext","i18n","useOwpTranslation","layouts","themeLayouts","children","setSettings","useSetSettings","settings","useGetCurrentSettings","defaultSettings","useGetDefaultSettings","layoutStyle","_a","location","useLocation","pathname","hasCompletedInitialLayoutSyncRef","useRef","matchedSettings","useMemo","getRouteParamUtil","currentSettings","generateSettings","isSettingsSynchronized","isEqual","useEffect","OwpLoading","key","Layout","jsx","__name","routes","useMerge","matchedRoutes","matchRoutes","hasMatchedParam","resolvedRouteParam","acc","match","routeParam","merge"],"mappings":";;;;;;;;;;;;;AAoCA,SAASA,EAAUC,GAAuB;;AACxC,QAAM,EAAE,cAAAC,EAAA,IAAiBC,EAAA,GACnB,EAAE,MAAAC,EAAA,IAASC,EAAA,GAEX,EAAE,SAAAC,IAAUC,GAAc,UAAAC,EAAA,IAAaP,GACvCQ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,GACAY,GACAK,IAAoB,IACL;AACf,QAAMC,IAAgBC,EAAYH,GAAQhB,CAAQ;AAElD,MAAI,CAACkB;AACH;AAGF,MAAIE,IAAkB;AAEtB,QAAMC,IAAqBH,EAAc,OAAsB,CAACI,GAAKC,MAAU;AAC7E,UAAMC,IAAaD,EAAM,MAAMX,CAAG;AAElC,WAAIY,MAAe,SACVF,KAGTF,IAAkB,IAEd,CAACH,KAIDO,MAAe,OACVA,IAGFC,EAAMH,KAAO,CAAA,GAAIE,CAAU;AAAA,EACpC,GAAG,MAAS;AAEZ,SAAOJ,IAAkBC,IAAqB;AAChD;AAnCSN,EAAAV,GAAA;"}
1
+ {"version":3,"file":"OwpLayout.js","sources":["../../../src/components/OwpLayout/OwpLayout.tsx"],"sourcesContent":["import { themeLayouts, themeLayoutsType } from '@/layout/themeLayouts';\nimport { useOwpAppContext } from '@/contexts/OwpAppProvider';\nimport { generateSettings } from '@/configs/defaultConfig';\nimport { LayoutConfigDefaultsType } from '@/configs/layoutConfig';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport {\n useGetCurrentSettings,\n useGetDefaultSettings,\n useSetSettings,\n} from '@/hooks/useOwpSettings';\nimport type { OwpSettingsConfigType } from '@/types/OwpSettingsTypes';\nimport { OwpRoutesType } from '@/utils/common/OwpUtils';\nimport { isEqual, merge } from 'es-toolkit/compat';\nimport { type ReactNode, useEffect, useMemo, useRef } from 'react';\nimport { matchRoutes, RouteMatch, RouteObject, useLocation } from 'react-router-dom';\nimport { OwpLoading } from '../OwpLoading';\n\nexport type OwpRouteObjectType = RouteObject & {\n settings?: OwpSettingsConfigType;\n auth?: string[] | [] | null | undefined;\n};\n\nexport type OwpRouteMatchType = RouteMatch & {\n route: OwpRouteObjectType;\n};\n\ntype OwpLayoutProps = {\n layouts?: themeLayoutsType;\n children?: ReactNode;\n};\n\n/**\n * OwpLayout\n * React frontend component in a React project that is used for layouting the user interface. The component\n * handles generating user interface settings related to current routes, merged with default settings, and uses\n * the new settings to generate layouts.\n */\nfunction OwpLayout(props: OwpLayoutProps) {\n const { routesConfig } = useOwpAppContext();\n const { i18n } = useOwpTranslation();\n\n const { layouts = themeLayouts, children } = props;\n const setSettings = useSetSettings();\n const settings = useGetCurrentSettings();\n const defaultSettings = useGetDefaultSettings();\n const location = useLocation();\n const { pathname } = location;\n const hasCompletedInitialLayoutSyncRef = useRef(false);\n\n const matchedSettings = useMemo(\n () => getRouteParamUtil(routesConfig, pathname, 'settings', true),\n [pathname, routesConfig],\n );\n const currentSettings = useMemo(() => {\n if (matchedSettings === undefined) {\n return defaultSettings;\n }\n\n return generateSettings(defaultSettings, matchedSettings);\n }, [defaultSettings, matchedSettings]);\n const isSettingsSynchronized = useMemo(\n () => settings === currentSettings || isEqual(currentSettings, settings),\n [currentSettings, settings],\n );\n const resolvedSettings = isSettingsSynchronized ? settings : currentSettings;\n const layoutStyle = resolvedSettings?.layout?.style;\n const layoutConfig = resolvedSettings?.layout?.config as LayoutConfigDefaultsType | undefined;\n\n useEffect(() => {\n if (isSettingsSynchronized) {\n return;\n }\n\n setSettings(currentSettings);\n }, [currentSettings, isSettingsSynchronized, setSettings]);\n\n useEffect(() => {\n window.scrollTo(0, 0);\n }, [pathname]);\n\n useEffect(() => {\n if (isSettingsSynchronized && i18n.isInitialized) {\n hasCompletedInitialLayoutSyncRef.current = true;\n }\n }, [i18n.isInitialized, isSettingsSynchronized]);\n\n return useMemo(() => {\n const shouldBlockForInitialLoading =\n !i18n.isInitialized ||\n (!isSettingsSynchronized && !hasCompletedInitialLayoutSyncRef.current);\n\n if (shouldBlockForInitialLoading) {\n return <OwpLoading />;\n }\n\n return Object.entries(layouts).map(([key, Layout]) => {\n if (key === layoutStyle) {\n return (\n <Layout key={key} layoutConfig={layoutConfig}>\n {children}\n </Layout>\n );\n }\n\n return null;\n });\n }, [children, i18n.isInitialized, isSettingsSynchronized, layoutConfig, layoutStyle, layouts]);\n}\n\nexport { OwpLayout };\n\n/**\n * Utility function to retrieve and merge or replace a specific route parameter from matched routes.\n *\n * @param pathname The current pathname\n * @param key The key of the parameter to merge or replace (e.g., 'settings', 'auth')\n * @param useMerge Whether to merge the parameter (using es-toolkit merge) or replace it\n * @returns The merged or replaced parameter data of type T\n */\nfunction getRouteParamUtil<T>(\n routes: OwpRoutesType,\n pathname: string,\n key: keyof OwpRouteObjectType,\n useMerge: boolean = true,\n): T | undefined {\n const matchedRoutes = matchRoutes(routes, pathname) as OwpRouteMatchType[] | null;\n\n if (!matchedRoutes) {\n return undefined;\n }\n\n let hasMatchedParam = false;\n\n const resolvedRouteParam = matchedRoutes.reduce<T | undefined>((acc, match) => {\n const routeParam = match.route[key] as T | undefined;\n\n if (routeParam === undefined) {\n return acc;\n }\n\n hasMatchedParam = true;\n\n if (!useMerge) {\n return routeParam;\n }\n\n if (routeParam === null) {\n return routeParam;\n }\n\n return merge(acc ?? {}, routeParam);\n }, undefined);\n\n return hasMatchedParam ? resolvedRouteParam : undefined;\n}\n"],"names":["OwpLayout","props","routesConfig","useOwpAppContext","i18n","useOwpTranslation","layouts","themeLayouts","children","setSettings","useSetSettings","settings","useGetCurrentSettings","defaultSettings","useGetDefaultSettings","location","useLocation","pathname","hasCompletedInitialLayoutSyncRef","useRef","matchedSettings","useMemo","getRouteParamUtil","currentSettings","generateSettings","isSettingsSynchronized","isEqual","resolvedSettings","layoutStyle","_a","layoutConfig","_b","useEffect","OwpLoading","key","Layout","jsx","__name","routes","useMerge","matchedRoutes","matchRoutes","hasMatchedParam","resolvedRouteParam","acc","match","routeParam","merge"],"mappings":";;;;;;;;;;;;;AAqCA,SAASA,EAAUC,GAAuB;;AACxC,QAAM,EAAE,cAAAC,EAAA,IAAiBC,EAAA,GACnB,EAAE,MAAAC,EAAA,IAASC,EAAA,GAEX,EAAE,SAAAC,IAAUC,GAAc,UAAAC,EAAA,IAAaP,GACvCQ,IAAcC,EAAA,GACdC,IAAWC,EAAA,GACXC,IAAkBC,EAAA,GAClBC,IAAWC,EAAA,GACX,EAAE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,GAAA;AAkFT,SAASsB,EACPgB,GACArB,GACAiB,GACAK,IAAoB,IACL;AACf,QAAMC,IAAgBC,EAAYH,GAAQrB,CAAQ;AAElD,MAAI,CAACuB;AACH;AAGF,MAAIE,IAAkB;AAEtB,QAAMC,IAAqBH,EAAc,OAAsB,CAACI,GAAKC,MAAU;AAC7E,UAAMC,IAAaD,EAAM,MAAMX,CAAG;AAElC,WAAIY,MAAe,SACVF,KAGTF,IAAkB,IAEd,CAACH,KAIDO,MAAe,OACVA,IAGFC,EAAMH,KAAO,CAAA,GAAIE,CAAU;AAAA,EACpC,GAAG,MAAS;AAEZ,SAAOJ,IAAkBC,IAAqB;AAChD;AAnCSN,EAAAf,GAAA;"}
@@ -0,0 +1,38 @@
1
+ var d = Object.defineProperty;
2
+ var t = (r, l) => d(r, "name", { value: l, configurable: !0 });
3
+ import { jsxs as f, jsx as c, Fragment as u } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
+ import { clsx as a } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
5
+ import { isValidElement as g, Fragment as h, cloneElement as x } from "react";
6
+ function N({
7
+ children: r,
8
+ message: l,
9
+ className: s,
10
+ required: o = !0,
11
+ requiredPosition: m = "right"
12
+ }) {
13
+ const n = r !== void 0 ? r : l;
14
+ if (n == null || n === "")
15
+ return null;
16
+ const i = /* @__PURE__ */ t((e) => /* @__PURE__ */ c("span", { className: a("text-red-600", e), children: "*" }), "renderMark"), p = /* @__PURE__ */ t((e) => /* @__PURE__ */ f(u, { children: [
17
+ o && m === "left" ? i("mr-4") : null,
18
+ e,
19
+ o && m === "right" ? i("ml-4") : null
20
+ ] }), "renderContent");
21
+ if (g(n) && n.type !== h) {
22
+ const e = n;
23
+ if (e.props.children !== void 0)
24
+ return x(
25
+ e,
26
+ {
27
+ className: a(e.props.className, s)
28
+ },
29
+ p(e.props.children)
30
+ );
31
+ }
32
+ return /* @__PURE__ */ c("span", { className: s, children: p(n) });
33
+ }
34
+ t(N, "OwpRequiredHelperText");
35
+ export {
36
+ N as OwpRequiredHelperText
37
+ };
38
+ //# sourceMappingURL=OwpRequiredHelperText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OwpRequiredHelperText.js","sources":["../../../src/components/OwpRequiredHelperText/OwpRequiredHelperText.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport {\n Fragment,\n cloneElement,\n isValidElement,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nexport interface OwpRequiredHelperTextProps {\n children?: ReactNode;\n message?: ReactNode;\n className?: string;\n required?: boolean;\n requiredPosition?: 'left' | 'right';\n}\n\n/**\n * 필수 표시 안내 문구\n * @param children 안내 문구\n * @param message 안내 문구\n * @param className 추가 스타일 클래스\n * @param required 필수 표시 노출 여부\n * @param requiredPosition 필수 표시 위치\n */\nfunction OwpRequiredHelperText({\n children,\n message,\n className,\n required = true,\n requiredPosition = 'right',\n}: OwpRequiredHelperTextProps) {\n const content = children !== undefined ? children : message;\n\n if (content === undefined || content === null || content === '') {\n return null;\n }\n\n const renderMark = (marginClassName: string) => (\n <span className={clsx('text-red-600', marginClassName)}>\n *\n </span>\n );\n\n const renderContent = (content: ReactNode) => (\n <>\n {required && requiredPosition === 'left' ? renderMark('mr-4') : null}\n {content}\n {required && requiredPosition === 'right' ? renderMark('ml-4') : null}\n </>\n );\n\n if (isValidElement(content) && content.type !== Fragment) {\n const messageElement = content as ReactElement<{\n children?: ReactNode;\n className?: string;\n }>;\n\n if (messageElement.props.children !== undefined) {\n return cloneElement(\n messageElement,\n {\n className: clsx(messageElement.props.className, className),\n },\n renderContent(messageElement.props.children),\n );\n }\n }\n\n return <span className={className}>{renderContent(content)}</span>;\n}\n\nexport { OwpRequiredHelperText };\n"],"names":["OwpRequiredHelperText","children","message","className","required","requiredPosition","content","renderMark","__name","marginClassName","jsx","clsx","renderContent","jsxs","Fragment","isValidElement","messageElement","cloneElement"],"mappings":";;;;;AAyBA,SAASA,EAAsB;AAAA,EAC7B,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,kBAAAC,IAAmB;AACrB,GAA+B;AAC7B,QAAMC,IAAUL,MAAa,SAAYA,IAAWC;AAEpD,MAA6BI,KAAY,QAAQA,MAAY;AAC3D,WAAO;AAGT,QAAMC,IAAa,gBAAAC,EAAA,CAACC,MAClB,gBAAAC,EAAC,QAAA,EAAK,WAAWC,EAAK,gBAAgBF,CAAe,GAAG,UAAA,IAAA,CAExD,GAHiB,eAMbG,IAAgB,gBAAAJ,EAAA,CAACF,MACrB,gBAAAO,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAV,KAAYC,MAAqB,SAASE,EAAW,MAAM,IAAI;AAAA,IAC/DD;AAAAA,IACAF,KAAYC,MAAqB,UAAUE,EAAW,MAAM,IAAI;AAAA,EAAA,GACnE,GALoB;AAQtB,MAAIQ,EAAeT,CAAO,KAAKA,EAAQ,SAASQ,GAAU;AACxD,UAAME,IAAiBV;AAKvB,QAAIU,EAAe,MAAM,aAAa;AACpC,aAAOC;AAAA,QACLD;AAAA,QACA;AAAA,UACE,WAAWL,EAAKK,EAAe,MAAM,WAAWb,CAAS;AAAA,QAAA;AAAA,QAE3DS,EAAcI,EAAe,MAAM,QAAQ;AAAA,MAAA;AAAA,EAGjD;AAEA,SAAO,gBAAAN,EAAC,QAAA,EAAK,WAAAP,GAAuB,UAAAS,EAAcN,CAAO,GAAE;AAC7D;AA7CSE,EAAAR,GAAA;"}
@@ -0,0 +1,99 @@
1
+ var x = Object.defineProperty;
2
+ var n = (e, t) => x(e, "name", { value: t, configurable: !0 });
3
+ import { jsxs as a, jsx as m, Fragment as D } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
+ import { TableCell as d, TableBody as F, Checkbox as T } from "@mui/material";
5
+ import { clsx as N } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
6
+ import S from "dayjs";
7
+ import { Fragment as H } from "react";
8
+ import { StyledTableRow as M, StyledTable as k } from "./OwpTable.js";
9
+ import { isNaN as l } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isNaN.js";
10
+ import { toNumber as y } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/util/toNumber.js";
11
+ const E = 28, R = {
12
+ "&&": {
13
+ fontFamily: "inherit",
14
+ fontSize: "1.7rem",
15
+ fontWeight: 600,
16
+ lineHeight: "normal",
17
+ minHeight: "unset",
18
+ padding: "7px 10px"
19
+ }
20
+ }, $ = {
21
+ borderRadius: 0,
22
+ overflow: "visible"
23
+ }, u = {
24
+ borderTop: "1px solid #CDD8E4"
25
+ }, c = /* @__PURE__ */ n((e) => /* @__PURE__ */ a(D, { children: [
26
+ e,
27
+ /* @__PURE__ */ m("span", { className: "ml-4 text-red-600", children: "*" })
28
+ ] }), "getRequiredTitle"), j = /* @__PURE__ */ n((e, t) => e == null ? void 0 : e[t], "getFieldTableValue"), z = /* @__PURE__ */ n((e, t) => typeof t == "function" ? t(e) : l(y(e)) ? e === "Y" : !!Number(e), "getCheckboxChecked"), B = /* @__PURE__ */ n((e) => e.withTime ? "YYYY-MM-DD HH:mm" : e.withTimeAndSec ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD", "getDateFormat"), L = /* @__PURE__ */ n((e, t, s) => {
29
+ const i = j(t, e.key);
30
+ return typeof e.render == "function" ? e.render() : e.useCheckbox ? /* @__PURE__ */ m(
31
+ T,
32
+ {
33
+ checked: z(i, e.validate),
34
+ sx: { "& .MuiSvgIcon-root": { fontSize: (s == null ? void 0 : s.fontSize) ?? E } }
35
+ }
36
+ ) : e.useDate ? i && S(i).format(B(e)) : e.disableLocaleString ? i : i == null ? void 0 : i.toLocaleString();
37
+ }, "renderFieldTableCellValue");
38
+ function Z({
39
+ layout: e,
40
+ titleWidth: t,
41
+ titleSx: s,
42
+ treeGridTitleCellSx: i,
43
+ cellSx: f,
44
+ data: h,
45
+ colGroupSlot: b,
46
+ className: w,
47
+ tableLayout: g = "fixed",
48
+ canUseTreeGridStyle: o = !1
49
+ }) {
50
+ return /* @__PURE__ */ a(
51
+ k,
52
+ {
53
+ canUseTreeGridStyle: o,
54
+ className: N("w-full", w),
55
+ containerProps: { sx: o ? $ : void 0 },
56
+ tableLayout: g,
57
+ children: [
58
+ b,
59
+ /* @__PURE__ */ m(F, { children: e.map((Y, p) => /* @__PURE__ */ m(M, { children: Y.map((r, C) => /* @__PURE__ */ a(H, { children: [
60
+ /* @__PURE__ */ m(
61
+ d,
62
+ {
63
+ component: "th",
64
+ className: "whitespace-pre-wrap",
65
+ width: t ?? 200,
66
+ sx: {
67
+ ...o ? R : {},
68
+ ...o ? i ?? {} : {},
69
+ ...o && p === 0 ? u : {},
70
+ ...s ?? {}
71
+ },
72
+ rowSpan: r == null ? void 0 : r.rowSpan,
73
+ children: r.required ? c(r.title) : r.title
74
+ }
75
+ ),
76
+ /* @__PURE__ */ m(
77
+ d,
78
+ {
79
+ className: "whitespace-pre-wrap",
80
+ sx: {
81
+ ...o && p === 0 ? u : {},
82
+ ...f ?? {}
83
+ },
84
+ style: (r == null ? void 0 : r.style) ?? {},
85
+ colSpan: r == null ? void 0 : r.colSpan,
86
+ rowSpan: r == null ? void 0 : r.rowSpan,
87
+ children: L(r, h, f)
88
+ }
89
+ )
90
+ ] }, `owp-field-cell-${p}-${C}`)) }, `owp-field-col-${p}`)) })
91
+ ]
92
+ }
93
+ );
94
+ }
95
+ n(Z, "OwpFieldTable");
96
+ export {
97
+ Z as OwpFieldTable
98
+ };
99
+ //# sourceMappingURL=OwpFieldTable.js.map