@trops/dash-core 0.1.57 → 0.1.58

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.esm.js CHANGED
@@ -7195,6 +7195,38 @@ var ProviderForm = function ProviderForm(_ref) {
7195
7195
  },
7196
7196
  placeholder: "Enter ".concat(fieldConfig.displayName.toLowerCase()),
7197
7197
  className: errors[fieldName] ? "border-red-500" : ""
7198
+ }), fieldConfig.type === "file" && /*#__PURE__*/jsxs("div", {
7199
+ className: "flex gap-2",
7200
+ children: [/*#__PURE__*/jsx("div", {
7201
+ className: "flex-1",
7202
+ children: /*#__PURE__*/jsx(InputText, {
7203
+ value: formData[fieldName] || "",
7204
+ onChange: function onChange(value) {
7205
+ return handleInputChange(fieldName, value);
7206
+ },
7207
+ placeholder: "Select a file...",
7208
+ className: errors[fieldName] ? "border-red-500" : ""
7209
+ })
7210
+ }), /*#__PURE__*/jsx("button", {
7211
+ onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
7212
+ var filepath;
7213
+ return _regeneratorRuntime.wrap(function (_context) {
7214
+ while (1) switch (_context.prev = _context.next) {
7215
+ case 0:
7216
+ _context.next = 1;
7217
+ return window.mainApi.dialog.chooseFile(true, ["json"]);
7218
+ case 1:
7219
+ filepath = _context.sent;
7220
+ if (filepath) handleInputChange(fieldName, filepath);
7221
+ case 2:
7222
+ case "end":
7223
+ return _context.stop();
7224
+ }
7225
+ }, _callee);
7226
+ })),
7227
+ className: "px-3 py-1.5 text-sm rounded bg-white/10 hover:bg-white/20 transition-colors",
7228
+ children: "Browse"
7229
+ })]
7198
7230
  }), errors[fieldName] && /*#__PURE__*/jsx("p", {
7199
7231
  className: "text-sm text-red-500 dark:text-red-400",
7200
7232
  children: errors[fieldName]