@licklist/design 0.44.481 → 0.44.483
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 +1 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("react"),a=e(r),o=require("react-i18next"),
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("react"),a=e(r),o=require("react-i18next"),n=require("react-hook-form"),s=e(require("@licklist/plugins/dist/services/Form/HookFormService")),i=require("../../sortable-tree/SortableTreeItem.js"),l=require("../../sortable-tree/SortableTree.js"),d=e(require("react-bootstrap/Badge")),u=require("../item/CreateProductSetItem.js"),c=require("../step/StepControl.js"),p=require("./ProductCategoriesControl.js");exports.StepsControl=function(e){var m=e.isLoading,g=n.useFormContext(),v=o.useTranslation("Design").t,C=t.__read(r.useState(!1),2),b=C[0],f=C[1],S=g.control,E=g.formState,q=E.errors,I=E.isSubmitting,N=g.clearErrors,h=g.getValues,y=n.useFieldArray({name:"steps",control:S,keyName:"_id"}),j=y.fields,x=y.append,_=y.remove;r.useEffect((function(){I&&f(!I)}),[I]);var k=1===j.length;return a.createElement(a.Fragment,null,j.map((function(e,t){var r=h("steps.".concat(t));return a.createElement(n.Controller,{key:"step-".concat(e._id),name:"steps.".concat(t,".name"),control:S,rules:{required:v("Validation:fieldRequired",{attribute:v("name")})},render:function(o){var n,s,u=o.field,g=u.value,C=u.onChange;return a.createElement(l.SortableTree.Item,{id:e._id,title:g,badge:a.createElement(d,{className:"step-badge"},v("step")),isExpanded:k,isInvalid:!!(null===(n=q.steps)||void 0===n?void 0:n[t]),isIconInHeader:!1,modalLabel:v("addNewStep"),modalClass:i.ProductSetModalClasses.step,isNewAdded:b,subTitle:a.createElement("div",{className:"product-set-badges-container"},a.createElement("div",{className:"product-set-subtitle-dot product-set-subtitle-step-dot"}),a.createElement("span",null,null===(s=r.productCategories)||void 0===s?void 0:s.length," ",v("categories"))),treeLineIconColor:"#D52902",body:a.createElement(c.StepControl,{isLoading:m,stepIndex:t,stepName:g,onStepNameChange:C}),onDelete:function(){return _(t)},sortableItems:e.productCategories?e.productCategories.map((function(e){var t=e.id;return String(t)})):[]},a.createElement(p.ProductCategoriesControl,{isLoading:m,stepIndex:t}))}})})),a.createElement(u.CreateProductSetItem,{title:v("addStep"),onClick:function(){var e;x({id:null,name:"".concat(v("step")," ").concat(j.length+1),productCategories:[],weight:0,hasMap:!1,venueMapSetId:null}),f(!0),(null===(e=q.steps)||void 0===e?void 0:e.type)===s.manualErrorType&&N("steps")}}),a.createElement("div",{className:"manual-form-error"},q.steps&&q.steps.message))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotesTableRow.d.ts","sourceRoot":"","sources":["../../../src/sales/notes/NotesTableRow.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,qDAAqD,CAAC;
|
|
1
|
+
{"version":3,"file":"NotesTableRow.d.ts","sourceRoot":"","sources":["../../../src/sales/notes/NotesTableRow.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,qDAAqD,CAAC;AAY3E,oBAAY,aAAa,GAAG;IAC1B,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,QAAQ,oCAAqC,aAAa,gBA2EtE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("react"),a=e(r),n=require("@licklist/core/dist/Config"),o=require("react-i18next"),
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("react"),a=e(r),n=require("@licklist/core/dist/Config"),o=require("react-i18next"),i=require("react-bootstrap"),l=require("../../static/Icon.js"),s=require("@react-aria/utils"),c=e(require("clsx")),u=require("luxon");require("../../static/index.js");var m=require("lodash"),d=require("../../modals/confirmation/ConfirmModal.js");require("../../modals/dialog/Dialog.js"),require("../../modals/dialog/DialogContext.js");var p=require("../../table/MenuButton.js"),q=require("@licklist/core/dist/Services");require("../../table/FilterHelperComponent.js"),require("../../table/PaginationHelperComponent.js"),require("../../table/PerPageHelperComponent.js"),require("../../table/StaticTable.js"),require("../../table/TableHelperComponent.js");exports.TableRow=function(e){var f=e.note,E=e.onClick,b=e.onDeleteNote,g=o.useTranslation("Design").t,v=s.useId(),C=t.__read(r.useState(!1),2),j=C[0],N=C[1],T=u.DateTime.fromFormat(f.updatedAt,n.DATE_TIME_FULL_FORMAT,{zone:"utc"}).setZone(q.getClientTimeZone()).toFormat(n.DATE_TIME_FORMAT);return a.createElement("tr",{onClick:E},a.createElement("td",{className:"note-content"},f.note),a.createElement("td",{className:"note-author"},m.capitalize(f.user.firstName)," ",m.capitalize(f.user.lastName)),a.createElement("td",{className:"note-date"},T),a.createElement("td",null,a.createElement("div",{className:"controls"},a.createElement("span",{className:"btn btn-sm eye"},a.createElement(l.default,{type:"eye",width:"20"})),a.createElement(i.OverlayTrigger,{trigger:"click",placement:"bottom",rootClose:!0,overlay:a.createElement(i.Popover,{id:v,className:c("product-set-card-popover",!j&&"d-none")},a.createElement(i.Popover.Content,{as:i.ListGroup,className:"product-set-card-menu",variant:"flush"},a.createElement(i.ListGroup.Item,{action:!0,className:"text-danger",as:"div"},a.createElement(d.ConfirmModal,null,(function(e){return a.createElement(p.MenuButton,{onClick:function(){N(!1),e((function(){return b(f.id)}))},name:g("remove"),icon:"trash-alt",className:"product-set-card-menu-item-text d-flex w-100 align-items-center",rightIcon:!0})})))))},a.createElement("button",{type:"button",className:"product-set-card-menu-button",onClick:function(e){e.stopPropagation(),N(!0)}},a.createElement(l.default,{type:"ellipsis-h"}))))))};
|
package/package.json
CHANGED
|
@@ -6,7 +6,11 @@ import { useTranslation } from "react-i18next";
|
|
|
6
6
|
import { Note } from "@licklist/core/dist/DataMapper/Order/NoteDataMapper";
|
|
7
7
|
import { capitalize } from "lodash";
|
|
8
8
|
import { DateTime } from "luxon";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
DATE_TIME_FULL_FORMAT,
|
|
11
|
+
DATE_TIME_FORMAT,
|
|
12
|
+
} from "@licklist/core/dist/Config";
|
|
13
|
+
import { getClientTimeZone } from "@licklist/core/dist/Services";
|
|
10
14
|
import { ConfirmModal } from "../../modals";
|
|
11
15
|
import { MenuButton } from "../../table";
|
|
12
16
|
import { Icon } from "../../static";
|
|
@@ -22,10 +26,11 @@ export const TableRow = ({ note, onClick, onDeleteNote }: TableRowProps) => {
|
|
|
22
26
|
const popoverId = useId();
|
|
23
27
|
const [isOverlayVisibile, setIsOverlayVisible] = useState(false);
|
|
24
28
|
|
|
25
|
-
const date = DateTime.fromFormat(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
const date = DateTime.fromFormat(note.updatedAt, DATE_TIME_FULL_FORMAT, {
|
|
30
|
+
zone: "utc",
|
|
31
|
+
})
|
|
32
|
+
.setZone(getClientTimeZone())
|
|
33
|
+
.toFormat(DATE_TIME_FORMAT);
|
|
29
34
|
|
|
30
35
|
return (
|
|
31
36
|
<tr onClick={onClick}>
|