@ssa-ui-kit/core 2.17.2 → 2.18.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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DateRangePickerProps } from './types';
|
|
2
|
-
export declare const DateRangePicker: ({ format, openCalendarMode, showCalendarIcon, ...rest }: DateRangePickerProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const DateRangePicker: ({ format, openCalendarMode, showCalendarIcon, showStatusArea, ...rest }: DateRangePickerProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TriggerStatusArea: () => import("@emotion/react/jsx-runtime").JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -1309,7 +1309,7 @@ const Avatar = /*#__PURE__*/base_default()("div", true ? {
|
|
|
1309
1309
|
size
|
|
1310
1310
|
}) => size, "px;background:", ({
|
|
1311
1311
|
image
|
|
1312
|
-
}) => `url(${image})`, " center no-repeat;" + ( true ? "" : 0));
|
|
1312
|
+
}) => `url(${image})`, " center/contain no-repeat;" + ( true ? "" : 0));
|
|
1313
1313
|
/* harmony default export */ const Avatar_Avatar = (Avatar);
|
|
1314
1314
|
;// external "react"
|
|
1315
1315
|
const external_react_namespaceObject = require("react");
|
|
@@ -14165,57 +14165,6 @@ const FieldControl = /*#__PURE__*/external_react_default().forwardRef(function F
|
|
|
14165
14165
|
children: _children
|
|
14166
14166
|
});
|
|
14167
14167
|
});
|
|
14168
|
-
;// ./src/components/Field/FieldDescription.tsx
|
|
14169
|
-
|
|
14170
|
-
|
|
14171
|
-
|
|
14172
|
-
const FieldDescription = ({
|
|
14173
|
-
children
|
|
14174
|
-
}) => {
|
|
14175
|
-
const ctx = useFieldContext();
|
|
14176
|
-
if (ctx.status !== 'basic') {
|
|
14177
|
-
return null;
|
|
14178
|
-
}
|
|
14179
|
-
return (0,jsx_runtime_namespaceObject.jsx)(FormHelperText_FormHelperText, {
|
|
14180
|
-
status: "basic",
|
|
14181
|
-
"data-testid": "field-description",
|
|
14182
|
-
children: children
|
|
14183
|
-
});
|
|
14184
|
-
};
|
|
14185
|
-
;// ./src/components/Field/FieldError.tsx
|
|
14186
|
-
|
|
14187
|
-
|
|
14188
|
-
|
|
14189
|
-
const FieldError = ({
|
|
14190
|
-
children
|
|
14191
|
-
}) => {
|
|
14192
|
-
const ctx = useFieldContext();
|
|
14193
|
-
if (ctx.status !== 'error') {
|
|
14194
|
-
return null;
|
|
14195
|
-
}
|
|
14196
|
-
return (0,jsx_runtime_namespaceObject.jsx)(FormHelperText_FormHelperText, {
|
|
14197
|
-
status: "error",
|
|
14198
|
-
"data-testid": "field-error",
|
|
14199
|
-
children: children
|
|
14200
|
-
});
|
|
14201
|
-
};
|
|
14202
|
-
;// ./src/components/Field/FieldSuccess.tsx
|
|
14203
|
-
|
|
14204
|
-
|
|
14205
|
-
|
|
14206
|
-
const FieldSuccess = ({
|
|
14207
|
-
children
|
|
14208
|
-
}) => {
|
|
14209
|
-
const ctx = useFieldContext();
|
|
14210
|
-
if (ctx.status !== 'success') {
|
|
14211
|
-
return null;
|
|
14212
|
-
}
|
|
14213
|
-
return (0,jsx_runtime_namespaceObject.jsx)(FormHelperText_FormHelperText, {
|
|
14214
|
-
status: "success",
|
|
14215
|
-
"data-testid": "field-success",
|
|
14216
|
-
children: children
|
|
14217
|
-
});
|
|
14218
|
-
};
|
|
14219
14168
|
;// ./src/components/DateRangePicker/components/TriggerInput.tsx
|
|
14220
14169
|
function TriggerInput_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
14221
14170
|
|
|
@@ -14314,6 +14263,90 @@ const TriggerInput = ({
|
|
|
14314
14263
|
})
|
|
14315
14264
|
});
|
|
14316
14265
|
};
|
|
14266
|
+
;// ./src/components/Field/FieldDescription.tsx
|
|
14267
|
+
|
|
14268
|
+
|
|
14269
|
+
|
|
14270
|
+
const FieldDescription = ({
|
|
14271
|
+
children
|
|
14272
|
+
}) => {
|
|
14273
|
+
const ctx = useFieldContext();
|
|
14274
|
+
if (ctx.status !== 'basic') {
|
|
14275
|
+
return null;
|
|
14276
|
+
}
|
|
14277
|
+
return (0,jsx_runtime_namespaceObject.jsx)(FormHelperText_FormHelperText, {
|
|
14278
|
+
status: "basic",
|
|
14279
|
+
"data-testid": "field-description",
|
|
14280
|
+
children: children
|
|
14281
|
+
});
|
|
14282
|
+
};
|
|
14283
|
+
;// ./src/components/Field/FieldError.tsx
|
|
14284
|
+
|
|
14285
|
+
|
|
14286
|
+
|
|
14287
|
+
const FieldError = ({
|
|
14288
|
+
children
|
|
14289
|
+
}) => {
|
|
14290
|
+
const ctx = useFieldContext();
|
|
14291
|
+
if (ctx.status !== 'error') {
|
|
14292
|
+
return null;
|
|
14293
|
+
}
|
|
14294
|
+
return (0,jsx_runtime_namespaceObject.jsx)(FormHelperText_FormHelperText, {
|
|
14295
|
+
status: "error",
|
|
14296
|
+
"data-testid": "field-error",
|
|
14297
|
+
children: children
|
|
14298
|
+
});
|
|
14299
|
+
};
|
|
14300
|
+
;// ./src/components/Field/FieldSuccess.tsx
|
|
14301
|
+
|
|
14302
|
+
|
|
14303
|
+
|
|
14304
|
+
const FieldSuccess = ({
|
|
14305
|
+
children
|
|
14306
|
+
}) => {
|
|
14307
|
+
const ctx = useFieldContext();
|
|
14308
|
+
if (ctx.status !== 'success') {
|
|
14309
|
+
return null;
|
|
14310
|
+
}
|
|
14311
|
+
return (0,jsx_runtime_namespaceObject.jsx)(FormHelperText_FormHelperText, {
|
|
14312
|
+
status: "success",
|
|
14313
|
+
"data-testid": "field-success",
|
|
14314
|
+
children: children
|
|
14315
|
+
});
|
|
14316
|
+
};
|
|
14317
|
+
;// ./src/components/DateRangePicker/components/TriggerStatusArea.tsx
|
|
14318
|
+
function TriggerStatusArea_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
14319
|
+
|
|
14320
|
+
|
|
14321
|
+
|
|
14322
|
+
|
|
14323
|
+
var TriggerStatusArea_ref = true ? {
|
|
14324
|
+
name: "ud49p1",
|
|
14325
|
+
styles: "color:inherit;&::first-letter{text-transform:uppercase;}"
|
|
14326
|
+
} : 0;
|
|
14327
|
+
const TriggerStatusArea = () => {
|
|
14328
|
+
const formContext = (0,external_react_hook_form_namespaceObject.useFormContext)();
|
|
14329
|
+
const {
|
|
14330
|
+
messages,
|
|
14331
|
+
nameFrom,
|
|
14332
|
+
nameTo
|
|
14333
|
+
} = useDateRangePickerContext();
|
|
14334
|
+
const errorsFrom = formContext.formState.errors[nameFrom]?.message;
|
|
14335
|
+
const errorsTo = formContext.formState.errors[nameTo]?.message;
|
|
14336
|
+
const errorMessage = [errorsFrom, errorsTo].filter(Boolean);
|
|
14337
|
+
return (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
14338
|
+
children: [messages?.description && (0,jsx_runtime_namespaceObject.jsx)(FieldDescription, {
|
|
14339
|
+
children: messages?.description
|
|
14340
|
+
}), (errorMessage.length || messages?.error) && (0,jsx_runtime_namespaceObject.jsx)(FieldError, {
|
|
14341
|
+
children: errorMessage.length ? errorMessage.map((error, index) => (0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
14342
|
+
css: TriggerStatusArea_ref,
|
|
14343
|
+
children: error
|
|
14344
|
+
}, `error-${index}`)) : messages?.error
|
|
14345
|
+
}), messages?.success && (0,jsx_runtime_namespaceObject.jsx)(FieldSuccess, {
|
|
14346
|
+
children: messages?.success
|
|
14347
|
+
})]
|
|
14348
|
+
});
|
|
14349
|
+
};
|
|
14317
14350
|
;// ./src/components/DateRangePicker/components/Trigger.tsx
|
|
14318
14351
|
|
|
14319
14352
|
function Trigger_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
@@ -14330,10 +14363,6 @@ var Trigger_ref = true ? {
|
|
|
14330
14363
|
name: "1ldd2k6",
|
|
14331
14364
|
styles: "margin:0 3px"
|
|
14332
14365
|
} : 0;
|
|
14333
|
-
var Trigger_ref2 = true ? {
|
|
14334
|
-
name: "ud49p1",
|
|
14335
|
-
styles: "color:inherit;&::first-letter{text-transform:uppercase;}"
|
|
14336
|
-
} : 0;
|
|
14337
14366
|
const Trigger = () => {
|
|
14338
14367
|
const {
|
|
14339
14368
|
nameFrom,
|
|
@@ -14342,16 +14371,15 @@ const Trigger = () => {
|
|
|
14342
14371
|
lastFocusedElement,
|
|
14343
14372
|
disabled,
|
|
14344
14373
|
status,
|
|
14345
|
-
messages,
|
|
14346
14374
|
openCalendarMode,
|
|
14347
14375
|
isOpen,
|
|
14348
14376
|
showCalendarIcon,
|
|
14377
|
+
showStatusArea,
|
|
14349
14378
|
classNames,
|
|
14350
14379
|
setIsOpen,
|
|
14351
14380
|
handleToggleOpen
|
|
14352
14381
|
} = useDateRangePickerContext();
|
|
14353
14382
|
const theme = (0,react_namespaceObject.useTheme)();
|
|
14354
|
-
const formContext = (0,external_react_hook_form_namespaceObject.useFormContext)();
|
|
14355
14383
|
const wrapperRef = (0,external_react_namespaceObject.useRef)(null);
|
|
14356
14384
|
(0,hooks_namespaceObject.useClickOutside)(wrapperRef, event => {
|
|
14357
14385
|
const {
|
|
@@ -14362,15 +14390,12 @@ const Trigger = () => {
|
|
|
14362
14390
|
setIsOpen(false);
|
|
14363
14391
|
}
|
|
14364
14392
|
});
|
|
14365
|
-
const errorsFrom = formContext.formState.errors[nameFrom]?.message;
|
|
14366
|
-
const errorsTo = formContext.formState.errors[nameTo]?.message;
|
|
14367
|
-
const errorMessage = [errorsFrom, errorsTo].filter(Boolean);
|
|
14368
14393
|
return (0,jsx_runtime_namespaceObject.jsxs)(FieldRoot, {
|
|
14369
14394
|
status: status,
|
|
14370
14395
|
disabled: disabled,
|
|
14371
14396
|
"data-testid": "daterangepicker",
|
|
14372
14397
|
className: classNames?.trigger?.root,
|
|
14373
|
-
children: [(0,jsx_runtime_namespaceObject.jsx)(FieldLabel, {
|
|
14398
|
+
children: [label && (0,jsx_runtime_namespaceObject.jsx)(FieldLabel, {
|
|
14374
14399
|
htmlFor: lastFocusedElement === 'from' ? nameFrom : nameTo,
|
|
14375
14400
|
className: classNames?.label,
|
|
14376
14401
|
children: label
|
|
@@ -14424,16 +14449,7 @@ const Trigger = () => {
|
|
|
14424
14449
|
}, true ? "" : 0, true ? "" : 0)
|
|
14425
14450
|
})]
|
|
14426
14451
|
})
|
|
14427
|
-
}),
|
|
14428
|
-
children: messages?.description
|
|
14429
|
-
}), (errorMessage.length || messages?.error) && (0,jsx_runtime_namespaceObject.jsx)(FieldError, {
|
|
14430
|
-
children: errorMessage.length ? errorMessage.map((error, index) => (0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
14431
|
-
css: Trigger_ref2,
|
|
14432
|
-
children: error
|
|
14433
|
-
}, `error-${index}`)) : messages?.error
|
|
14434
|
-
}), messages?.success && (0,jsx_runtime_namespaceObject.jsx)(FieldSuccess, {
|
|
14435
|
-
children: messages?.success
|
|
14436
|
-
})]
|
|
14452
|
+
}), showStatusArea && (0,jsx_runtime_namespaceObject.jsx)(TriggerStatusArea, {})]
|
|
14437
14453
|
});
|
|
14438
14454
|
};
|
|
14439
14455
|
;// ./src/components/DateRangePicker/components/Content.tsx
|
|
@@ -14895,11 +14911,13 @@ const DateRangePicker = ({
|
|
|
14895
14911
|
format = constants_DEFAULT_MASK_FORMAT,
|
|
14896
14912
|
openCalendarMode = 'icon',
|
|
14897
14913
|
showCalendarIcon = true,
|
|
14914
|
+
showStatusArea = true,
|
|
14898
14915
|
...rest
|
|
14899
14916
|
}) => (0,jsx_runtime_namespaceObject.jsx)(DateRangePickerProvider, {
|
|
14900
14917
|
format: format,
|
|
14901
14918
|
openCalendarMode: openCalendarMode,
|
|
14902
14919
|
showCalendarIcon: showCalendarIcon,
|
|
14920
|
+
showStatusArea: showStatusArea,
|
|
14903
14921
|
...rest,
|
|
14904
14922
|
children: (0,jsx_runtime_namespaceObject.jsx)(Content_DatePickerContent, {})
|
|
14905
14923
|
});
|