@appcorp/fusion-storybook 0.1.16 → 0.1.18

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.
@@ -752,13 +752,13 @@ export const useAdmissionModule = () => {
752
752
  order: 1,
753
753
  },
754
754
  {
755
- enabled: true,
755
+ enabled: (row) => (row === null || row === void 0 ? void 0 : row.status) === ADMISSION_STATUS.PENDING,
756
756
  handleOnClick: handleEdit,
757
757
  label: t("rowActionsEdit"),
758
758
  order: 2,
759
759
  },
760
760
  {
761
- enabled: false,
761
+ enabled: (row) => (row === null || row === void 0 ? void 0 : row.status) === ADMISSION_STATUS.PENDING,
762
762
  handleOnClick: handleDelete,
763
763
  label: t("rowActionsDelete"),
764
764
  order: 3,
@@ -82,5 +82,5 @@ export const AdmissionForm = () => {
82
82
  { label: t("male"), value: GENDER.MALE },
83
83
  { label: t("female"), value: GENDER.FEMALE },
84
84
  { label: t("other"), value: GENDER.OTHER },
85
- ], placeholder: t("selectGender"), searchPlaceholder: t("searchGender"), value: gender }), _jsx(EnhancedInput, { error: errors.dob, id: "dob", info: t("dobInfo"), label: t("dob"), onChange: (e) => handleChange("dob", e.target.value), placeholder: t("selectDob"), required: true, type: "date", value: dob || "" }), _jsx(EnhancedInput, { error: errors.registrationCode, id: "registrationCode", info: t("registrationCodeInfo"), label: t("registrationCode"), onChange: (e) => handleChange("registrationCode", e.target.value), placeholder: t("enterRegistrationCode"), required: true, type: "text", value: registrationCode || "", disabled: true }), _jsx(EnhancedCombobox, { emptyText: t("noDiscountCodesAvailable"), error: errors.discountCode, id: "discountCode", info: t("discountCodeInfo"), label: t("discountCode"), onValueChange: (value) => handleChange("discountCode", value), options: discountCodeOptions, placeholder: t("enterDiscountCode"), searchPlaceholder: t("searchDiscountCodes"), value: discountCode || "" }), _jsx(EnhancedCheckbox, { label: t("hafiz"), id: "hafiz", info: t("hafizInfo"), onCheckedChange: (checked) => handleChange("hafiz", checked) }), _jsx(EnhancedCheckbox, { label: t("orphan"), id: "orphan", info: t("orphanInfo"), onCheckedChange: (checked) => handleChange("orphan", checked) })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("fatherInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedInput, { error: errors.fatherFirstName, id: "fatherFirstName", info: t("fatherFirstNameInfo"), label: t("firstName"), onChange: (e) => handleChange("fatherFirstName", e.target.value), placeholder: t("enterFirstName"), required: true, type: "text", value: fatherFirstName || "" }), _jsx(EnhancedInput, { error: errors.fatherLastName, id: "fatherLastName", info: t("fatherLastNameInfo"), label: t("lastName"), onChange: (e) => handleChange("fatherLastName", e.target.value), placeholder: t("enterLastName"), required: true, type: "text", value: fatherLastName || "" }), _jsx(EnhancedInput, { error: errors.fatherCnic, id: "fatherCnic", info: t("fatherCnicInfo"), label: t("cnic"), onChange: (e) => handleChange("fatherCnic", e.target.value), placeholder: t("enterBForm"), required: true, type: "text", value: fatherCnic || "" }), _jsx(EnhancedInput, { error: errors.fatherMobile, id: "fatherMobile", info: t("fatherMobileInfo"), label: t("mobile"), onChange: (e) => handleChange("fatherMobile", e.target.value), placeholder: "+923001234567", required: true, type: "text", value: fatherMobile || "" }), _jsx(EnhancedInput, { error: errors.fatherOccupation, id: "fatherOccupation", info: t("fatherOccupationInfo"), label: t("occupation"), onChange: (e) => handleChange("fatherOccupation", e.target.value), placeholder: t("enterOccupation"), required: false, type: "text", value: fatherOccupation || "" }), _jsx(EnhancedInput, { error: errors.fatherOrganization, id: "fatherOrganization", info: t("fatherOrganizationInfo"), label: t("organization"), onChange: (e) => handleChange("fatherOrganization", e.target.value), placeholder: t("enterOrganization"), required: false, type: "text", value: fatherOrganization || "" }), _jsx(EnhancedCheckbox, { label: t("emergencyContact"), id: "emergencyContactFather", info: t("fatherEmergencyContactInfo"), checked: emergencyContact === "Father", onCheckedChange: (checked) => handleChange("emergencyContact", checked ? "Father" : "") })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("motherInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedInput, { error: errors.motherFirstName, id: "motherFirstName", info: t("motherFirstNameInfo"), label: t("firstName"), onChange: (e) => handleChange("motherFirstName", e.target.value), placeholder: t("enterFirstName"), required: true, type: "text", value: motherFirstName || "" }), _jsx(EnhancedInput, { error: errors.motherLastName, id: "motherLastName", info: t("motherLastNameInfo"), label: t("lastName"), onChange: (e) => handleChange("motherLastName", e.target.value), placeholder: t("enterLastName"), required: true, type: "text", value: motherLastName || "" }), _jsx(EnhancedInput, { error: errors.motherCnic, id: "motherCnic", info: t("motherCnicInfo"), label: t("cnic"), onChange: (e) => handleChange("motherCnic", e.target.value), placeholder: t("enterBForm"), required: true, type: "text", value: motherCnic || "" }), _jsx(EnhancedInput, { error: errors.motherMobile, id: "motherMobile", info: t("motherMobileInfo"), label: t("mobile"), onChange: (e) => handleChange("motherMobile", e.target.value), placeholder: "+923001234567", required: true, type: "text", value: motherMobile || "" }), _jsx(EnhancedCheckbox, { label: t("emergencyContact"), id: "emergencyContactMother", info: t("motherEmergencyContactInfo"), checked: emergencyContact === "Mother", onCheckedChange: (checked) => handleChange("emergencyContact", checked ? "Mother" : "") })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("homeInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedTextarea, { error: errors.address, id: "homeAddress", info: t("homeAddressInfo"), label: t("homeAddress"), onChange: (e) => handleChange("address", e.target.value), placeholder: t("enterHomeAddress"), required: true, rows: 2, value: address || "" }), _jsx(EnhancedInput, { error: errors.city, id: "city", info: t("cityInfo"), label: t("city"), onChange: (e) => handleChange("city", e.target.value), placeholder: t("enterCity"), required: true, type: "text", value: city || "" }), _jsx(EnhancedInput, { error: errors.state, id: "state", info: t("stateInfo"), label: t("state"), onChange: (e) => handleChange("state", e.target.value), placeholder: t("enterState"), required: true, type: "text", value: provinceState || "" }), _jsx(EnhancedInput, { error: errors.country, id: "country", info: t("countryInfo"), label: t("country"), onChange: (e) => handleChange("country", e.target.value), placeholder: t("enterCountry"), required: true, type: "text", value: country || "" })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("admissionInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedInput, { error: errors.classForAdmission, id: "classForAdmission", info: t("classForAdmissionInfo"), label: t("classForAdmission"), onChange: (e) => handleChange("classForAdmission", e.target.value), placeholder: t("enterClassForAdmission"), required: true, type: "text", value: classForAdmission || "" }), _jsx(EnhancedInput, { error: errors.previousSchool, id: "previousSchool", info: t("previousSchoolInfo"), label: t("previousSchool"), onChange: (e) => handleChange("previousSchool", e.target.value), placeholder: t("enterPreviousSchool"), type: "text", value: previousSchool || "" }), _jsx(EnhancedTextarea, { error: errors.siblings, id: "siblings", info: t("siblingsInfo"), label: t("siblings"), onChange: (e) => handleChange("siblings", e.target.value), placeholder: t("enterSiblings"), rows: 3, value: siblings || "" })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("officeUse") }), _jsxs("div", { className: "grid grid-cols-4 gap-4", children: [_jsx(EnhancedTextarea, { error: errors.notes, id: "notes", info: t("notesInfo"), label: t("notes"), onChange: (e) => handleChange("notes", e.target.value), placeholder: t("enterNotes"), rows: 3, value: notes || "" }), _jsx(EnhancedTextarea, { error: errors.admissionNotes, id: "admissionNotes", info: t("admissionNotesInfo"), label: t("admissionNotes"), onChange: (e) => handleChange("admissionNotes", e.target.value), placeholder: t("enterAdmissionNotes"), rows: 3, value: admissionNotes || "" })] })] }));
85
+ ], placeholder: t("selectGender"), searchPlaceholder: t("searchGender"), value: gender }), _jsx(EnhancedInput, { error: errors.dob, id: "dob", info: t("dobInfo"), label: t("dob"), onChange: (e) => handleChange("dob", e.target.value), placeholder: t("selectDob"), required: true, type: "date", value: dob || "" }), _jsx(EnhancedInput, { error: errors.registrationCode, id: "registrationCode", info: t("registrationCodeInfo"), label: t("registrationCode"), onChange: (e) => handleChange("registrationCode", e.target.value), placeholder: t("enterRegistrationCode"), required: true, type: "text", value: registrationCode || "", disabled: true }), _jsx(EnhancedCombobox, { emptyText: t("noDiscountCodesAvailable"), error: errors.discountCode, id: "discountCode", info: t("discountCodeInfo"), label: t("discountCode"), onValueChange: (value) => handleChange("discountCode", value), options: discountCodeOptions, placeholder: t("enterDiscountCode"), searchPlaceholder: t("searchDiscountCodes"), value: discountCode || "" }), _jsx(EnhancedCheckbox, { label: t("hafiz"), id: "hafiz", info: t("hafizInfo"), onCheckedChange: (checked) => handleChange("hafiz", checked) }), _jsx(EnhancedCheckbox, { label: t("orphan"), id: "orphan", info: t("orphanInfo"), onCheckedChange: (checked) => handleChange("orphan", checked) })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("fatherInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedInput, { error: errors.fatherFirstName, id: "fatherFirstName", info: t("fatherFirstNameInfo"), label: t("firstName"), onChange: (e) => handleChange("fatherFirstName", e.target.value), placeholder: t("enterFirstName"), required: true, type: "text", value: fatherFirstName || "" }), _jsx(EnhancedInput, { error: errors.fatherLastName, id: "fatherLastName", info: t("fatherLastNameInfo"), label: t("lastName"), onChange: (e) => handleChange("fatherLastName", e.target.value), placeholder: t("enterLastName"), required: true, type: "text", value: fatherLastName || "" }), _jsx(EnhancedInput, { error: errors.fatherCnic, id: "fatherCnic", info: t("fatherCnicInfo"), label: t("cnic"), onChange: (e) => handleChange("fatherCnic", e.target.value), placeholder: t("enterIDNumber"), required: true, type: "text", value: fatherCnic || "" }), _jsx(EnhancedInput, { error: errors.fatherMobile, id: "fatherMobile", info: t("fatherMobileInfo"), label: t("mobile"), onChange: (e) => handleChange("fatherMobile", e.target.value), placeholder: "+923001234567", required: true, type: "text", value: fatherMobile || "" }), _jsx(EnhancedInput, { error: errors.fatherOccupation, id: "fatherOccupation", info: t("fatherOccupationInfo"), label: t("occupation"), onChange: (e) => handleChange("fatherOccupation", e.target.value), placeholder: t("enterOccupation"), required: false, type: "text", value: fatherOccupation || "" }), _jsx(EnhancedInput, { error: errors.fatherOrganization, id: "fatherOrganization", info: t("fatherOrganizationInfo"), label: t("organization"), onChange: (e) => handleChange("fatherOrganization", e.target.value), placeholder: t("enterOrganization"), required: false, type: "text", value: fatherOrganization || "" }), _jsx(EnhancedCheckbox, { label: t("emergencyContact"), id: "emergencyContactFather", info: t("fatherEmergencyContactInfo"), checked: emergencyContact === "Father", onCheckedChange: (checked) => handleChange("emergencyContact", checked ? "Father" : "") })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("motherInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedInput, { error: errors.motherFirstName, id: "motherFirstName", info: t("motherFirstNameInfo"), label: t("firstName"), onChange: (e) => handleChange("motherFirstName", e.target.value), placeholder: t("enterFirstName"), required: true, type: "text", value: motherFirstName || "" }), _jsx(EnhancedInput, { error: errors.motherLastName, id: "motherLastName", info: t("motherLastNameInfo"), label: t("lastName"), onChange: (e) => handleChange("motherLastName", e.target.value), placeholder: t("enterLastName"), required: true, type: "text", value: motherLastName || "" }), _jsx(EnhancedInput, { error: errors.motherCnic, id: "motherCnic", info: t("motherCnicInfo"), label: t("cnic"), onChange: (e) => handleChange("motherCnic", e.target.value), placeholder: t("enterIDNumber"), required: true, type: "text", value: motherCnic || "" }), _jsx(EnhancedInput, { error: errors.motherMobile, id: "motherMobile", info: t("motherMobileInfo"), label: t("mobile"), onChange: (e) => handleChange("motherMobile", e.target.value), placeholder: "+923001234567", required: true, type: "text", value: motherMobile || "" }), _jsx(EnhancedCheckbox, { label: t("emergencyContact"), id: "emergencyContactMother", info: t("motherEmergencyContactInfo"), checked: emergencyContact === "Mother", onCheckedChange: (checked) => handleChange("emergencyContact", checked ? "Mother" : "") })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("homeInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedTextarea, { error: errors.address, id: "homeAddress", info: t("homeAddressInfo"), label: t("homeAddress"), onChange: (e) => handleChange("address", e.target.value), placeholder: t("enterHomeAddress"), required: true, rows: 2, value: address || "" }), _jsx(EnhancedInput, { error: errors.city, id: "city", info: t("cityInfo"), label: t("city"), onChange: (e) => handleChange("city", e.target.value), placeholder: t("enterCity"), required: true, type: "text", value: city || "" }), _jsx(EnhancedInput, { error: errors.state, id: "state", info: t("stateInfo"), label: t("state"), onChange: (e) => handleChange("state", e.target.value), placeholder: t("enterState"), required: true, type: "text", value: provinceState || "" }), _jsx(EnhancedInput, { error: errors.country, id: "country", info: t("countryInfo"), label: t("country"), onChange: (e) => handleChange("country", e.target.value), placeholder: t("enterCountry"), required: true, type: "text", value: country || "" })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("admissionInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedInput, { error: errors.classForAdmission, id: "classForAdmission", info: t("classForAdmissionInfo"), label: t("classForAdmission"), onChange: (e) => handleChange("classForAdmission", e.target.value), placeholder: t("enterClassForAdmission"), required: true, type: "text", value: classForAdmission || "" }), _jsx(EnhancedInput, { error: errors.previousSchool, id: "previousSchool", info: t("previousSchoolInfo"), label: t("previousSchool"), onChange: (e) => handleChange("previousSchool", e.target.value), placeholder: t("enterPreviousSchool"), type: "text", value: previousSchool || "" }), _jsx(EnhancedTextarea, { error: errors.siblings, id: "siblings", info: t("siblingsInfo"), label: t("siblings"), onChange: (e) => handleChange("siblings", e.target.value), placeholder: t("enterSiblings"), rows: 3, value: siblings || "" })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("officeUse") }), _jsxs("div", { className: "grid grid-cols-4 gap-4", children: [_jsx(EnhancedTextarea, { error: errors.notes, id: "notes", info: t("notesInfo"), label: t("notes"), onChange: (e) => handleChange("notes", e.target.value), placeholder: t("enterNotes"), rows: 3, value: notes || "" }), _jsx(EnhancedTextarea, { error: errors.admissionNotes, id: "admissionNotes", info: t("admissionNotesInfo"), label: t("admissionNotes"), onChange: (e) => handleChange("admissionNotes", e.target.value), placeholder: t("enterAdmissionNotes"), rows: 3, value: admissionNotes || "" })] })] }));
86
86
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",