@react-pakistan/util-functions 1.25.90 → 2.0.2
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/README.md +74 -315
- package/constants/api-methods.d.ts +3 -1
- package/constants/api-methods.js +1 -15
- package/constants/cache-time.d.ts +7 -5
- package/constants/cache-time.js +1 -8
- package/constants/countries-timezones.d.ts +4 -2
- package/constants/countries-timezones.js +1 -1411
- package/constants/currencies.d.ts +4 -2
- package/constants/currencies.js +1 -1076
- package/constants/dial-codes.d.ts +5 -3
- package/constants/dial-codes.js +1 -1216
- package/constants/layout-direction.d.ts +3 -1
- package/constants/layout-direction.js +1 -8
- package/constants/react-pakistan-meta.d.ts +4 -2
- package/constants/react-pakistan-meta.js +1 -35
- package/constants/react-pakistan.d.ts +5 -3
- package/constants/react-pakistan.js +12 -104
- package/constants/select-value-delimiter.d.ts +3 -1
- package/constants/select-value-delimiter.js +1 -13
- package/constants/social-media-colors.d.ts +3 -1
- package/constants/social-media-colors.js +1 -42
- package/constants/social-media-sizes.d.ts +6 -4
- package/constants/social-media-sizes.js +1 -327
- package/constants/user-roles.d.ts +3 -1
- package/constants/user-roles.js +1 -9
- package/edu-pilot-pro/types/academics.d.ts +2 -266
- package/edu-pilot-pro/types/academics.js +1 -9
- package/edu-pilot-pro/types/admission.d.ts +803 -10
- package/edu-pilot-pro/types/admission.js +1 -7
- package/edu-pilot-pro/types/communication.d.ts +2 -165
- package/edu-pilot-pro/types/communication.js +1 -8
- package/edu-pilot-pro/types/enums.d.ts +30 -28
- package/edu-pilot-pro/types/enums.js +1 -445
- package/edu-pilot-pro/types/finance.d.ts +2 -128
- package/edu-pilot-pro/types/finance.js +1 -8
- package/edu-pilot-pro/types/index.d.ts +2 -12
- package/edu-pilot-pro/types/index.js +1 -28
- package/edu-pilot-pro/types/user-management.d.ts +2 -236
- package/edu-pilot-pro/types/user-management.js +1 -8
- package/factory/generic-component-factory.d.ts +12 -9
- package/factory/generic-component-factory.js +1 -131
- package/factory/generic-module-factory.d.ts +14 -10
- package/factory/generic-module-factory.js +1 -190
- package/general/basic-get.d.ts +8 -1
- package/general/basic-get.js +1 -83
- package/general/basic-post.d.ts +8 -1
- package/general/basic-post.js +1 -70
- package/general/calculate-pages.d.ts +9 -1
- package/general/calculate-pages.js +1 -7
- package/general/camel-to-sentence-case.d.ts +3 -1
- package/general/camel-to-sentence-case.js +1 -20
- package/general/check-even-odd-length.d.ts +3 -1
- package/general/check-even-odd-length.js +1 -17
- package/general/clear-cache.d.ts +7 -2
- package/general/clear-cache.js +1 -12
- package/general/cnic-formatter.d.ts +16 -3
- package/general/cnic-formatter.js +1 -53
- package/general/convert-url-to-base64.d.ts +8 -6
- package/general/convert-url-to-base64.js +1 -231
- package/general/countries.d.ts +5 -3
- package/general/countries.js +1 -514
- package/general/create-date.d.ts +3 -1
- package/general/create-date.js +1 -22
- package/general/crypto.d.ts +4 -2
- package/general/crypto.js +1 -45
- package/general/currencies.d.ts +2 -0
- package/general/currencies.js +0 -1077
- package/general/delete-image-from-private-supabase.d.ts +10 -2
- package/general/delete-image-from-private-supabase.js +1 -66
- package/general/delete-image-from-public-supabase.d.ts +10 -2
- package/general/delete-image-from-public-supabase.js +1 -66
- package/general/download-from-url.d.ts +8 -1
- package/general/download-from-url.js +1 -82
- package/general/dynamic-page-limit.d.ts +9 -3
- package/general/dynamic-page-limit.js +1 -7
- package/general/enum-to-text.d.ts +8 -1
- package/general/enum-to-text.js +1 -11
- package/general/fetch-data.d.ts +16 -4
- package/general/fetch-data.js +1 -95
- package/general/fetch-supabase-image.d.ts +11 -2
- package/general/fetch-supabase-image.js +1 -67
- package/general/fetch-supabase-private-assets.d.ts +11 -2
- package/general/fetch-supabase-private-assets.js +1 -69
- package/general/format-date.d.ts +10 -2
- package/general/format-date.js +1 -49
- package/general/format-number.d.ts +12 -2
- package/general/format-number.js +1 -35
- package/general/format-phone-display.d.ts +9 -1
- package/general/format-phone-display.js +1 -32
- package/general/format-phone.d.ts +10 -2
- package/general/format-phone.js +1 -20
- package/general/format-pricing.d.ts +8 -1
- package/general/format-pricing.js +1 -23
- package/general/format-secs.d.ts +8 -1
- package/general/format-secs.js +1 -21
- package/general/format-time.d.ts +8 -2
- package/general/format-time.js +1 -38
- package/general/format-value.d.ts +8 -1
- package/general/format-value.js +1 -7
- package/general/full-month-range.d.ts +3 -2
- package/general/full-month-range.js +1 -24
- package/general/full-year-range.d.ts +3 -2
- package/general/full-year-range.js +1 -20
- package/general/generate-article-schema.d.ts +3 -2
- package/general/generate-article-schema.js +1 -100
- package/general/generate-blog-schema.d.ts +3 -2
- package/general/generate-blog-schema.js +1 -32
- package/general/generate-book-schema.d.ts +3 -2
- package/general/generate-book-schema.js +1 -109
- package/general/generate-breadcrumb-schema.d.ts +3 -2
- package/general/generate-breadcrumb-schema.js +1 -34
- package/general/generate-carousel-schema.d.ts +3 -2
- package/general/generate-carousel-schema.js +1 -172
- package/general/generate-course-schema.d.ts +3 -2
- package/general/generate-course-schema.js +1 -124
- package/general/generate-dataset-schema.d.ts +3 -2
- package/general/generate-dataset-schema.js +1 -156
- package/general/generate-discussion-forum-schema.d.ts +3 -2
- package/general/generate-discussion-forum-schema.js +1 -67
- package/general/generate-education-schema.d.ts +3 -2
- package/general/generate-education-schema.js +1 -137
- package/general/generate-employer-aggregate-rating-schema.d.ts +3 -2
- package/general/generate-employer-aggregate-rating-schema.js +1 -64
- package/general/generate-event-schema.d.ts +3 -2
- package/general/generate-event-schema.js +1 -214
- package/general/generate-faq-schema.d.ts +3 -2
- package/general/generate-faq-schema.js +1 -43
- package/general/generate-grid.d.ts +3 -2
- package/general/generate-grid.js +1 -55
- package/general/generate-image-metadata-schema.d.ts +3 -2
- package/general/generate-image-metadata-schema.js +1 -73
- package/general/generate-job-posting-schema.d.ts +3 -2
- package/general/generate-job-posting-schema.js +1 -120
- package/general/generate-local-business-schema.d.ts +3 -2
- package/general/generate-local-business-schema.js +1 -75
- package/general/generate-math-solver-schema.d.ts +3 -2
- package/general/generate-math-solver-schema.js +1 -83
- package/general/generate-movie-carousel-schema.d.ts +3 -2
- package/general/generate-movie-carousel-schema.js +1 -160
- package/general/generate-organization-schema.d.ts +3 -2
- package/general/generate-organization-schema.js +1 -39
- package/general/generate-profile-page-schema.d.ts +3 -2
- package/general/generate-profile-page-schema.js +1 -82
- package/general/generate-qa-page-schema.d.ts +3 -2
- package/general/generate-qa-page-schema.js +1 -67
- package/general/generate-recipe-schema.d.ts +3 -2
- package/general/generate-recipe-schema.js +1 -104
- package/general/generate-ref.d.ts +8 -2
- package/general/generate-ref.js +1 -12
- package/general/generate-review-snippet-schema.d.ts +3 -2
- package/general/generate-review-snippet-schema.js +1 -137
- package/general/generate-shopping-loyalty-program-schema.d.ts +3 -2
- package/general/generate-shopping-loyalty-program-schema.js +1 -59
- package/general/generate-shopping-merchant-listing-schema.d.ts +3 -2
- package/general/generate-shopping-merchant-listing-schema.js +1 -153
- package/general/generate-shopping-merchant-return-policy-schema.d.ts +3 -2
- package/general/generate-shopping-merchant-return-policy-schema.js +1 -68
- package/general/generate-shopping-merchant-shipping-policy-schema.d.ts +3 -2
- package/general/generate-shopping-merchant-shipping-policy-schema.js +1 -74
- package/general/generate-shopping-overview-schema.d.ts +3 -2
- package/general/generate-shopping-overview-schema.js +1 -157
- package/general/generate-shopping-product-snippet-schema.d.ts +3 -2
- package/general/generate-shopping-product-snippet-schema.js +1 -167
- package/general/generate-shopping-variants-schema.d.ts +3 -2
- package/general/generate-shopping-variants-schema.js +1 -143
- package/general/generate-software-app-schema.d.ts +3 -2
- package/general/generate-software-app-schema.js +1 -143
- package/general/generate-speakable-schema.d.ts +3 -2
- package/general/generate-speakable-schema.js +1 -139
- package/general/generate-subscription-schema.d.ts +3 -2
- package/general/generate-subscription-schema.js +1 -133
- package/general/generate-vacation-rental-schema.d.ts +3 -2
- package/general/generate-vacation-rental-schema.js +1 -135
- package/general/generate-video-schema.d.ts +3 -2
- package/general/generate-video-schema.js +1 -163
- package/general/generic-cache.d.ts +17 -15
- package/general/generic-cache.js +1 -659
- package/general/get-available-page-limit.d.ts +8 -2
- package/general/get-available-page-limit.js +1 -31
- package/general/get-calendar-current-month.d.ts +11 -3
- package/general/get-calendar-current-month.js +1 -31
- package/general/get-calendar-dates.d.ts +11 -3
- package/general/get-calendar-dates.js +1 -42
- package/general/get-calendar-next-month.d.ts +12 -3
- package/general/get-calendar-next-month.js +1 -32
- package/general/get-calendar-previous-month.d.ts +12 -3
- package/general/get-calendar-previous-month.js +1 -36
- package/general/get-current-year.d.ts +7 -1
- package/general/get-current-year.js +1 -5
- package/general/get-day-name.d.ts +5 -3
- package/general/get-day-name.js +1 -14
- package/general/get-dial-code.d.ts +8 -1
- package/general/get-dial-code.js +1 -8
- package/general/get-full-name.d.ts +9 -2
- package/general/get-full-name.js +1 -8
- package/general/get-href.d.ts +3 -1
- package/general/get-href.js +1 -13
- package/general/get-month-name.d.ts +5 -3
- package/general/get-month-name.js +1 -19
- package/general/get-month-number.d.ts +5 -3
- package/general/get-month-number.js +1 -29
- package/general/get-number-of-days-in-month.d.ts +9 -2
- package/general/get-number-of-days-in-month.js +1 -12
- package/general/get-pathname.d.ts +3 -1
- package/general/get-pathname.js +1 -16
- package/general/get-week-day.d.ts +8 -1
- package/general/get-week-day.js +1 -9
- package/general/image-url-to-base64.d.ts +3 -1
- package/general/image-url-to-base64.js +1 -80
- package/general/is-created-or-updated.d.ts +3 -1
- package/general/is-created-or-updated.js +1 -26
- package/general/is-next-button-disabled.d.ts +9 -1
- package/general/is-next-button-disabled.js +1 -5
- package/general/is-odd.d.ts +3 -1
- package/general/is-odd.js +1 -13
- package/general/is-previous-button-disabled.d.ts +8 -1
- package/general/is-previous-button-disabled.js +1 -7
- package/general/linear-gradients.d.ts +4 -2
- package/general/linear-gradients.js +1 -52
- package/general/multi-part-search.d.ts +10 -2
- package/general/multi-part-search.js +1 -16
- package/general/normalize-phone.d.ts +15 -2
- package/general/normalize-phone.js +1 -40
- package/general/parse-frontmatter.d.ts +11 -4
- package/general/parse-frontmatter.js +2 -35
- package/general/remove-data-image-prefix.d.ts +8 -1
- package/general/remove-data-image-prefix.js +1 -7
- package/general/repeat-times.d.ts +3 -1
- package/general/repeat-times.js +1 -21
- package/general/resolve-anchor-link.d.ts +3 -1
- package/general/resolve-anchor-link.js +1 -26
- package/general/resolve-current-date.d.ts +3 -1
- package/general/resolve-current-date.js +1 -22
- package/general/resolve-grid.d.ts +3 -1
- package/general/resolve-grid.js +1 -18
- package/general/resolve-initials.d.ts +3 -1
- package/general/resolve-initials.js +1 -17
- package/general/set-timezone.d.ts +11 -1
- package/general/set-timezone.js +1 -12
- package/general/slugify.d.ts +3 -1
- package/general/slugify.js +1 -24
- package/general/text-to-enum.d.ts +8 -1
- package/general/text-to-enum.js +1 -10
- package/general/text-to-sentence-case.d.ts +3 -1
- package/general/text-to-sentence-case.js +1 -16
- package/general/time-out.d.ts +3 -1
- package/general/time-out.js +1 -16
- package/general/time-zones.d.ts +3 -1
- package/general/time-zones.js +1 -437
- package/general/truncate-text.d.ts +3 -1
- package/general/truncate-text.js +1 -18
- package/general/type.d.ts +3 -1
- package/general/type.js +1 -2
- package/general/upload-blob-to-private-supabase.d.ts +14 -2
- package/general/upload-blob-to-private-supabase.js +1 -62
- package/general/upload-blob-to-public-supabase.d.ts +14 -2
- package/general/upload-blob-to-public-supabase.js +1 -62
- package/general/upload-image-to-private-supabase.d.ts +15 -3
- package/general/upload-image-to-private-supabase.js +1 -66
- package/general/upload-image-to-public-supabase.d.ts +15 -3
- package/general/upload-image-to-public-supabase.js +1 -66
- package/general/url-to-sentence-case.d.ts +3 -1
- package/general/url-to-sentence-case.js +1 -19
- package/general/validate-comment.d.ts +3 -1
- package/general/validate-comment.js +1 -21
- package/general/validate-email.d.ts +3 -1
- package/general/validate-email.js +1 -24
- package/general/validate-form.d.ts +12 -3
- package/general/validate-form.js +1 -29
- package/general/validate-name.d.ts +3 -1
- package/general/validate-name.js +1 -21
- package/hooks/use-change.d.ts +11 -2
- package/hooks/use-change.js +1 -23
- package/hooks/use-debounce.d.ts +10 -1
- package/hooks/use-debounce.js +1 -14
- package/hooks/use-fetch.d.ts +7 -5
- package/hooks/use-fetch.js +1 -239
- package/hooks/use-force-render.d.ts +6 -2
- package/hooks/use-force-render.js +1 -17
- package/hooks/use-ip-geo-location.d.ts +8 -1
- package/hooks/use-ip-geo-location.js +1 -79
- package/hooks/use-is-mobile.d.ts +8 -1
- package/hooks/use-is-mobile.js +1 -22
- package/hooks/use-module-entity-v2.d.ts +7 -4
- package/hooks/use-module-entity-v2.js +1 -188
- package/hooks/use-module-entity.d.ts +7 -4
- package/hooks/use-module-entity.js +1 -177
- package/hooks/use-phone-formatter.d.ts +10 -2
- package/hooks/use-phone-formatter.js +1 -23
- package/hooks/use-position.d.ts +6 -3
- package/hooks/use-position.js +1 -43
- package/hooks/use-rtl.d.ts +4 -2
- package/hooks/use-rtl.js +1 -84
- package/hooks/use-sticky.d.ts +3 -1
- package/hooks/use-sticky.js +1 -39
- package/hooks/use-toggle-state.d.ts +3 -2
- package/hooks/use-toggle-state.js +1 -26
- package/hooks/use-window-event-listener.d.ts +9 -1
- package/hooks/use-window-event-listener.js +1 -11
- package/hooks/with-seo.d.ts +11 -2
- package/hooks/with-seo.js +1 -37
- package/local-storage/get-storage-value.d.ts +5 -2
- package/local-storage/get-storage-value.js +1 -20
- package/local-storage/remove-storage-value.d.ts +3 -1
- package/local-storage/remove-storage-value.js +1 -14
- package/local-storage/set-storage-value.d.ts +3 -1
- package/local-storage/set-storage-value.js +1 -14
- package/local-storage/type.d.ts +3 -1
- package/local-storage/type.js +1 -2
- package/npm.d.d.ts +2 -0
- package/npm.d.js +0 -0
- package/package.json +21 -19
- package/{api/stellar-solutions → stellar-solution}/types/common.d.ts +4 -2
- package/stellar-solution/types/common.js +1 -0
- package/{api/stellar-solutions → stellar-solution}/types/erp.d.ts +36 -33
- package/stellar-solution/types/erp.js +1 -0
- package/stellar-solution/types/index.d.ts +3 -0
- package/stellar-solution/types/index.js +1 -0
- package/{api/stellar-solutions → stellar-solution}/types/pos.d.ts +27 -24
- package/stellar-solution/types/pos.js +1 -0
- package/storybook/generate-sitemap.d.ts +3 -1
- package/storybook/generate-sitemap.js +17 -26
- package/storybook/preview.d.ts +4 -2
- package/storybook/preview.js +1 -62
- package/storybook/react-design-story-script.d.ts +3 -1
- package/storybook/react-design-story-script.js +5 -27
- package/storybook/react-emoji-collection.d.ts +3 -1
- package/storybook/react-emoji-collection.js +10 -55
- package/storybook/react-emoji-story-script.d.ts +3 -1
- package/storybook/react-emoji-story-script.js +5 -31
- package/storybook/react-emoji-story-template.d.ts +3 -1
- package/storybook/react-emoji-story-template.js +45 -15
- package/storybook/react-icon-collection.d.ts +3 -1
- package/storybook/react-icon-collection.js +10 -42
- package/storybook/react-icon-story-script.d.ts +3 -1
- package/storybook/react-icon-story-script.js +5 -27
- package/storybook/react-icon-story-template.d.ts +3 -1
- package/storybook/react-icon-story-template.js +45 -14
- package/storybook/react-logo-collection.d.ts +3 -1
- package/storybook/react-logo-collection.js +10 -42
- package/storybook/react-logo-story-script.d.ts +3 -1
- package/storybook/react-logo-story-script.js +5 -27
- package/storybook/react-logo-story-template.d.ts +3 -1
- package/storybook/react-logo-story-template.js +45 -14
- package/storybook/react-pakistan-theme.d.ts +3 -1
- package/storybook/react-pakistan-theme.js +1 -31
- package/storybook/responsive-args.d.ts +11 -10
- package/storybook/responsive-args.js +1 -19
- package/storybook/responsive-component.d.ts +4 -2
- package/storybook/responsive-component.js +37 -23
- package/storybook/responsive-screens.d.ts +3 -1
- package/storybook/responsive-screens.js +1 -109
- package/storybook/theme.d.ts +17 -15
- package/storybook/theme.js +1 -1022
- package/api/stellar-solutions/app-user/index.d.ts +0 -51
- package/api/stellar-solutions/app-user/index.js +0 -210
- package/api/stellar-solutions/bank/index.d.ts +0 -59
- package/api/stellar-solutions/bank/index.js +0 -210
- package/api/stellar-solutions/branch/index.d.ts +0 -58
- package/api/stellar-solutions/branch/index.js +0 -220
- package/api/stellar-solutions/company/index.d.ts +0 -57
- package/api/stellar-solutions/company/index.js +0 -218
- package/api/stellar-solutions/company-report/index.d.ts +0 -15
- package/api/stellar-solutions/company-report/index.js +0 -74
- package/api/stellar-solutions/constants.d.ts +0 -19
- package/api/stellar-solutions/constants.js +0 -22
- package/api/stellar-solutions/contact/index.d.ts +0 -56
- package/api/stellar-solutions/contact/index.js +0 -217
- package/api/stellar-solutions/currency/index.d.ts +0 -55
- package/api/stellar-solutions/currency/index.js +0 -212
- package/api/stellar-solutions/customer/index.d.ts +0 -68
- package/api/stellar-solutions/customer/index.js +0 -249
- package/api/stellar-solutions/expense/index.d.ts +0 -58
- package/api/stellar-solutions/expense/index.js +0 -229
- package/api/stellar-solutions/expense-category/index.d.ts +0 -53
- package/api/stellar-solutions/expense-category/index.js +0 -214
- package/api/stellar-solutions/lead/index.d.ts +0 -51
- package/api/stellar-solutions/lead/index.js +0 -206
- package/api/stellar-solutions/menu-order/index.d.ts +0 -53
- package/api/stellar-solutions/menu-order/index.js +0 -202
- package/api/stellar-solutions/payment/index.d.ts +0 -65
- package/api/stellar-solutions/payment/index.js +0 -230
- package/api/stellar-solutions/payment-mode/index.d.ts +0 -53
- package/api/stellar-solutions/payment-mode/index.js +0 -191
- package/api/stellar-solutions/preference/index.d.ts +0 -25
- package/api/stellar-solutions/preference/index.js +0 -114
- package/api/stellar-solutions/product/index.d.ts +0 -64
- package/api/stellar-solutions/product/index.js +0 -235
- package/api/stellar-solutions/product-category/index.d.ts +0 -51
- package/api/stellar-solutions/product-category/index.js +0 -212
- package/api/stellar-solutions/profile/index.d.ts +0 -78
- package/api/stellar-solutions/profile/index.js +0 -234
- package/api/stellar-solutions/quote-invoice/index.d.ts +0 -97
- package/api/stellar-solutions/quote-invoice/index.js +0 -369
- package/api/stellar-solutions/quote-invoice-report/index.d.ts +0 -15
- package/api/stellar-solutions/quote-invoice-report/index.js +0 -74
- package/api/stellar-solutions/tax/index.d.ts +0 -55
- package/api/stellar-solutions/tax/index.js +0 -224
- package/api/stellar-solutions/types/common.js +0 -22
- package/api/stellar-solutions/types/erp.js +0 -73
- package/api/stellar-solutions/types/index.d.ts +0 -3
- package/api/stellar-solutions/types/index.js +0 -19
- package/api/stellar-solutions/types/pos.js +0 -61
- package/constants/index.d.ts +0 -12
- package/constants/index.js +0 -28
- package/factory/index.d.ts +0 -2
- package/factory/index.js +0 -18
- package/general/index.d.ts +0 -95
- package/general/index.js +0 -111
- package/index.d.ts +0 -28
- package/index.js +0 -44
- package/local-storage/index.d.ts +0 -4
- package/local-storage/index.js +0 -20
- package/setupTests.d.ts +0 -1
- package/setupTests.js +0 -52
- package/storybook/index.d.ts +0 -17
- package/storybook/index.js +0 -33
package/hooks/use-sticky.js
CHANGED
|
@@ -1,39 +1 @@
|
|
|
1
|
-
"use
|
|
2
|
-
/**
|
|
3
|
-
* A util hook to stickyness in the app.
|
|
4
|
-
*
|
|
5
|
-
* @param offset - number of pixel which is offset
|
|
6
|
-
* @default offset = 0
|
|
7
|
-
* @returns isSticky as boolean
|
|
8
|
-
* @author Taimoor Khan
|
|
9
|
-
* @remarks
|
|
10
|
-
*/
|
|
11
|
-
/** End file docs */
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.useSticky = void 0;
|
|
14
|
-
var react_1 = require("react");
|
|
15
|
-
var use_toggle_state_1 = require("./use-toggle-state");
|
|
16
|
-
var useSticky = function (offset) {
|
|
17
|
-
if (offset === void 0) { offset = 0; }
|
|
18
|
-
var _a = (0, use_toggle_state_1.useToggleState)(), isSticky = _a[0], setSticky = _a[1], clearSticky = _a[2];
|
|
19
|
-
(0, react_1.useLayoutEffect)(function () {
|
|
20
|
-
var onScroll = function () {
|
|
21
|
-
window.requestAnimationFrame(function () {
|
|
22
|
-
if (window.pageYOffset > offset) {
|
|
23
|
-
setSticky();
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
clearSticky();
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
if (window) {
|
|
31
|
-
window.addEventListener('scroll', onScroll);
|
|
32
|
-
return function () {
|
|
33
|
-
window.removeEventListener('scroll', onScroll);
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}, [setSticky, offset, clearSticky]);
|
|
37
|
-
return isSticky;
|
|
38
|
-
};
|
|
39
|
-
exports.useSticky = useSticky;
|
|
1
|
+
var r=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var d=(o,e)=>{for(var i in e)r(o,i,{get:e[i],enumerable:!0})},m=(o,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of w(e))!a.call(o,t)&&t!==i&&r(o,t,{get:()=>e[t],enumerable:!(n=l(e,t))||n.enumerable});return o};var u=o=>m(r({},"__esModule",{value:!0}),o);var S={};d(S,{useSticky:()=>f});module.exports=u(S);var s=require("react"),c=require("./use-toggle-state");const f=(o=0)=>{const[e,i,n]=(0,c.useToggleState)();return(0,s.useLayoutEffect)(()=>{const t=()=>{window.requestAnimationFrame(()=>{window.pageYOffset>o?i():n()})};if(window)return window.addEventListener("scroll",t),()=>{window.removeEventListener("scroll",t)}},[i,o,n]),e};0&&(module.exports={useSticky});
|
|
@@ -9,5 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
/** End file docs */
|
|
11
11
|
type ReturnType = [boolean, () => void, () => void];
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
declare const useToggleState: (defaultValue?: boolean) => ReturnType;
|
|
13
|
+
|
|
14
|
+
export { useToggleState };
|
|
@@ -1,26 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
/**
|
|
3
|
-
* A util hook to enable toggle state.
|
|
4
|
-
*
|
|
5
|
-
* @param defaultValue as an initial state toggle value
|
|
6
|
-
* @default defaultValue as false
|
|
7
|
-
* @returns [state, toggleOn, toggleOff]
|
|
8
|
-
* @author Taimoor Khan
|
|
9
|
-
* @remarks
|
|
10
|
-
*/
|
|
11
|
-
/** End file docs */
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.useToggleState = void 0;
|
|
14
|
-
var react_1 = require("react");
|
|
15
|
-
var useToggleState = function (defaultValue) {
|
|
16
|
-
if (defaultValue === void 0) { defaultValue = false; }
|
|
17
|
-
var _a = (0, react_1.useState)(defaultValue), state = _a[0], setState = _a[1];
|
|
18
|
-
var toggleOn = (0, react_1.useCallback)(function () {
|
|
19
|
-
setState(true);
|
|
20
|
-
}, [setState]);
|
|
21
|
-
var toggleOff = (0, react_1.useCallback)(function () {
|
|
22
|
-
setState(false);
|
|
23
|
-
}, [setState]);
|
|
24
|
-
return [state, toggleOn, toggleOff];
|
|
25
|
-
};
|
|
26
|
-
exports.useToggleState = useToggleState;
|
|
1
|
+
var l=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var o in e)l(t,o,{get:e[o],enumerable:!0})},f=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of u(e))!g.call(t,s)&&s!==o&&l(t,s,{get:()=>e[s],enumerable:!(n=r(e,s))||n.enumerable});return t};var i=t=>f(l({},"__esModule",{value:!0}),t);var d={};c(d,{useToggleState:()=>p});module.exports=i(d);var a=require("react");const p=(t=!1)=>{const[e,o]=(0,a.useState)(t),n=(0,a.useCallback)(()=>{o(!0)},[o]),s=(0,a.useCallback)(()=>{o(!1)},[o]);return[e,n,s]};0&&(module.exports={useToggleState});
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Attaches a listener to a window event and cleans up on unmount or dependency change.
|
|
3
|
+
*
|
|
4
|
+
* @param eventName - The name of the window event to listen for.
|
|
5
|
+
* @param callback - The event handler callback.
|
|
6
|
+
*/
|
|
7
|
+
declare const useWindowEventListener: <T extends keyof WindowEventMap>(eventName: T, callback: (event: WindowEventMap[T]) => void) => void;
|
|
8
|
+
|
|
9
|
+
export { useWindowEventListener };
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useWindowEventListener = void 0;
|
|
4
|
-
var react_1 = require("react");
|
|
5
|
-
var useWindowEventListener = function (eventName, callback) {
|
|
6
|
-
(0, react_1.useEffect)(function () {
|
|
7
|
-
window.addEventListener(eventName, callback);
|
|
8
|
-
return function () { return window.removeEventListener(eventName, callback); };
|
|
9
|
-
}, [eventName, callback]);
|
|
10
|
-
};
|
|
11
|
-
exports.useWindowEventListener = useWindowEventListener;
|
|
1
|
+
var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var E=(n,e)=>{for(var t in e)i(n,t,{get:e[t],enumerable:!0})},f=(n,e,t,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of v(e))!w.call(n,o)&&o!==t&&i(n,o,{get:()=>e[o],enumerable:!(d=s(e,o))||d.enumerable});return n};var p=n=>f(i({},"__esModule",{value:!0}),n);var L={};E(L,{useWindowEventListener:()=>u});module.exports=p(L);var r=require("react");const u=(n,e)=>{(0,r.useEffect)(()=>(window.addEventListener(n,e),()=>window.removeEventListener(n,e)),[n,e])};0&&(module.exports={useWindowEventListener});
|
package/hooks/with-seo.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentType, JSX } from 'react';
|
|
2
|
+
|
|
2
3
|
interface WrapperProps {
|
|
3
4
|
organizationJsonLd?: any;
|
|
4
5
|
breadcrumbJsonLd?: any;
|
|
@@ -6,5 +7,13 @@ interface WrapperProps {
|
|
|
6
7
|
localBusinessJsonLd?: any;
|
|
7
8
|
[key: string]: any;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a component with JSON-LD structured data scripts for SEO.
|
|
12
|
+
*
|
|
13
|
+
* @param Component - The component to enhance.
|
|
14
|
+
* @param rest - Props containing optional JSON-LD objects (organization, breadcrumb, FAQ, local business).
|
|
15
|
+
* @returns A new component that renders the wrapped component alongside structured-data script tags.
|
|
16
|
+
*/
|
|
17
|
+
declare const withSEO: (Component: ComponentType<WrapperProps>, rest: WrapperProps) => (() => JSX.Element);
|
|
18
|
+
|
|
19
|
+
export { withSEO };
|
package/hooks/with-seo.js
CHANGED
|
@@ -1,37 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.withSEO = void 0;
|
|
18
|
-
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var script_1 = __importDefault(require("next/script"));
|
|
20
|
-
var withSEO = function (Component, rest) {
|
|
21
|
-
var EnhancedComponent = function () { return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
22
|
-
react_1.default.createElement(Component, __assign({}, rest)),
|
|
23
|
-
rest.organizationJsonLd && (react_1.default.createElement(script_1.default, { id: "organization-schema", type: "application/ld+json", dangerouslySetInnerHTML: {
|
|
24
|
-
__html: JSON.stringify(rest.organizationJsonLd),
|
|
25
|
-
} })),
|
|
26
|
-
rest.breadcrumbJsonLd && (react_1.default.createElement(script_1.default, { id: "breadcrumb-schema", type: "application/ld+json", dangerouslySetInnerHTML: {
|
|
27
|
-
__html: JSON.stringify(rest.breadcrumbJsonLd),
|
|
28
|
-
} })),
|
|
29
|
-
rest.faqJsonLd && (react_1.default.createElement(script_1.default, { id: "faq-schema", type: "application/ld+json", dangerouslySetInnerHTML: {
|
|
30
|
-
__html: JSON.stringify(rest.faqJsonLd),
|
|
31
|
-
} })),
|
|
32
|
-
rest.localBusinessJsonLd && (react_1.default.createElement(script_1.default, { id: "local-business-schema", type: "application/ld+json", dangerouslySetInnerHTML: {
|
|
33
|
-
__html: JSON.stringify(rest.localBusinessJsonLd),
|
|
34
|
-
} })))); };
|
|
35
|
-
return EnhancedComponent;
|
|
36
|
-
};
|
|
37
|
-
exports.withSEO = withSEO;
|
|
1
|
+
var d=Object.create;var r=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var c=(o,n)=>{for(var s in n)r(o,s,{get:n[s],enumerable:!0})},p=(o,n,s,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of l(n))!y.call(o,i)&&i!==s&&r(o,i,{get:()=>n[i],enumerable:!(e=t(n,i))||e.enumerable});return o};var J=(o,n,s)=>(s=o!=null?d(m(o)):{},p(n||!o||!o.__esModule?r(s,"default",{value:o,enumerable:!0}):s,o)),L=o=>p(r({},"__esModule",{value:!0}),o);var u={};c(u,{withSEO:()=>g});module.exports=L(u);var a=J(require("react"));const g=(o,n)=>()=>a.default.createElement(a.default.Fragment,null,a.default.createElement(o,{...n}),n.organizationJsonLd&&a.default.createElement("script",{id:"organization-schema",type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(n.organizationJsonLd)}}),n.breadcrumbJsonLd&&a.default.createElement("script",{id:"breadcrumb-schema",type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(n.breadcrumbJsonLd)}}),n.faqJsonLd&&a.default.createElement("script",{id:"faq-schema",type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(n.faqJsonLd)}}),n.localBusinessJsonLd&&a.default.createElement("script",{id:"local-business-schema",type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(n.localBusinessJsonLd)}}));0&&(module.exports={withSEO});
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import { AllowedTypes } from './type';
|
|
2
|
-
|
|
1
|
+
import { AllowedTypes } from './type.js';
|
|
2
|
+
|
|
3
|
+
declare const getStorageValue: <T extends AllowedTypes>(key: string) => AllowedTypes;
|
|
4
|
+
|
|
5
|
+
export { getStorageValue };
|
|
@@ -1,20 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getStorageValue = void 0;
|
|
4
|
-
var getStorageValue = function (key) {
|
|
5
|
-
try {
|
|
6
|
-
var value = localStorage.getItem(key);
|
|
7
|
-
try {
|
|
8
|
-
return value === null ? value : JSON.parse(value);
|
|
9
|
-
}
|
|
10
|
-
catch (_a) {
|
|
11
|
-
return value;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
catch (e) {
|
|
15
|
-
if (e instanceof Error && e.name === 'NS_ERROR_FILE_CORRUPTED') {
|
|
16
|
-
localStorage.clear();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
exports.getStorageValue = getStorageValue;
|
|
1
|
+
var l=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var a in e)l(t,a,{get:e[a],enumerable:!0})},g=(t,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of c(e))!n.call(t,r)&&r!==a&&l(t,r,{get:()=>e[r],enumerable:!(o=s(e,r))||o.enumerable});return t};var p=t=>g(l({},"__esModule",{value:!0}),t);var y={};T(y,{getStorageValue:()=>u});module.exports=p(y);const u=t=>{try{const e=localStorage.getItem(t);try{return e===null?e:JSON.parse(e)}catch{return e}}catch(e){e instanceof Error&&e.name==="NS_ERROR_FILE_CORRUPTED"&&localStorage.clear()}};0&&(module.exports={getStorageValue});
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeStorageValue = void 0;
|
|
4
|
-
var removeStorageValue = function (key) {
|
|
5
|
-
try {
|
|
6
|
-
localStorage.removeItem(key);
|
|
7
|
-
}
|
|
8
|
-
catch (e) {
|
|
9
|
-
if (e instanceof Error && e.name === 'NS_ERROR_FILE_CORRUPTED') {
|
|
10
|
-
localStorage.clear();
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
exports.removeStorageValue = removeStorageValue;
|
|
1
|
+
var t=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var g=(o,e)=>{for(var a in e)t(o,a,{get:e[a],enumerable:!0})},i=(o,e,a,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of n(e))!R.call(o,r)&&r!==a&&t(o,r,{get:()=>e[r],enumerable:!(c=l(e,r))||c.enumerable});return o};var m=o=>i(t({},"__esModule",{value:!0}),o);var S={};g(S,{removeStorageValue:()=>E});module.exports=m(S);const E=o=>{try{localStorage.removeItem(o)}catch(e){e instanceof Error&&e.name==="NS_ERROR_FILE_CORRUPTED"&&localStorage.clear()}};0&&(module.exports={removeStorageValue});
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setStorageValue = void 0;
|
|
4
|
-
var setStorageValue = function (key, value) {
|
|
5
|
-
try {
|
|
6
|
-
localStorage.setItem(key, JSON.stringify(value));
|
|
7
|
-
}
|
|
8
|
-
catch (e) {
|
|
9
|
-
if (e instanceof Error && e.name === 'NS_ERROR_FILE_CORRUPTED') {
|
|
10
|
-
localStorage.clear();
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
exports.setStorageValue = setStorageValue;
|
|
1
|
+
var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var s=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},g=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of i(t))!l.call(e,r)&&r!==o&&a(e,r,{get:()=>t[r],enumerable:!(n=c(t,r))||n.enumerable});return e};var R=e=>g(a({},"__esModule",{value:!0}),e);var E={};s(E,{setStorageValue:()=>S});module.exports=R(E);const S=(e,t)=>{try{localStorage.setItem(e,JSON.stringify(t))}catch(o){o instanceof Error&&o.name==="NS_ERROR_FILE_CORRUPTED"&&localStorage.clear()}};0&&(module.exports={setStorageValue});
|
package/local-storage/type.d.ts
CHANGED
package/local-storage/type.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
var r=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var p=(e,n,d,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of u(n))!i.call(e,o)&&o!==d&&r(e,o,{get:()=>n[o],enumerable:!(l=t(n,o))||l.enumerable});return e};var s=e=>p(r({},"__esModule",{value:!0}),e);var b={};module.exports=s(b);
|
package/npm.d.d.ts
ADDED
package/npm.d.js
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-pakistan/util-functions",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "A library of all util functions",
|
|
5
|
-
"
|
|
5
|
+
"exports": {
|
|
6
|
+
"./*": {
|
|
7
|
+
"types": "./*.d.ts",
|
|
8
|
+
"import": "./*.js",
|
|
9
|
+
"default": "./*.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
6
12
|
"scripts": {
|
|
7
13
|
"add:tags": "scripts/add-tags.sh",
|
|
8
14
|
"build": "yarn clean:build && yarn build:ts && cp package.json lib && cp README.md lib && cp yarn.lock lib",
|
|
9
|
-
"build:ts": "
|
|
15
|
+
"build:ts": "tsup",
|
|
10
16
|
"clean:badges": "yarn rimraf ./badges",
|
|
11
17
|
"clean:build": "yarn rimraf ./lib",
|
|
12
18
|
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
|
|
@@ -22,7 +28,8 @@
|
|
|
22
28
|
"prepare": "husky",
|
|
23
29
|
"publish:github": "yarn build && cd lib && npm publish && cd ..",
|
|
24
30
|
"publish:npm": "yarn build && cd lib && npm publish --access public && cd ..",
|
|
25
|
-
"test": "
|
|
31
|
+
"test": "vitest run --coverage",
|
|
32
|
+
"test:watch": "vitest",
|
|
26
33
|
"test:badges": "yarn test && yarn clean:badges && mkdir -p badges && cp ./coverage/*badge*.svg ./badges/",
|
|
27
34
|
"upgrade": "ncu -u"
|
|
28
35
|
},
|
|
@@ -46,20 +53,15 @@
|
|
|
46
53
|
},
|
|
47
54
|
"homepage": "https://github.com/react-pakistan/util-functions#readme",
|
|
48
55
|
"devDependencies": {
|
|
49
|
-
"@appcorp/
|
|
50
|
-
"@appcorp/shadcn": "^1.1.83",
|
|
51
|
-
"@babel/core": "^7.24.5",
|
|
52
|
-
"@babel/preset-typescript": "^7.24.1",
|
|
56
|
+
"@appcorp/shadcn": "^1.2.0",
|
|
53
57
|
"@eslint/js": "^9.17.0",
|
|
54
|
-
"@microsoft/tsdoc": "^0.16.0",
|
|
55
58
|
"@testing-library/react": "^14.0.0",
|
|
56
59
|
"@testing-library/react-hooks": "^8.0.1",
|
|
57
60
|
"@types/eslint__js": "^8.42.3",
|
|
58
|
-
"@types/jest": "^30.0.0",
|
|
59
61
|
"@types/lodash.curry": "^4.1.9",
|
|
60
|
-
"@types/mocha": "^10.0.10",
|
|
61
62
|
"@types/node": "^25",
|
|
62
|
-
"@types/
|
|
63
|
+
"@types/react": "^19.2.17",
|
|
64
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
63
65
|
"date-fns": "^2.30.0",
|
|
64
66
|
"date-fns-tz": "^2.0.0",
|
|
65
67
|
"dayjs": "^1",
|
|
@@ -68,24 +70,20 @@
|
|
|
68
70
|
"eslint-plugin-prettier": "^5.2.1",
|
|
69
71
|
"globals": "^15.13.0",
|
|
70
72
|
"husky": "^9.1.7",
|
|
71
|
-
"
|
|
72
|
-
"jest-environment-jsdom": "^30",
|
|
73
|
+
"jsdom": "^29.1.1",
|
|
73
74
|
"libphonenumber-js": "^1",
|
|
74
75
|
"lint-staged": "^15.2.2",
|
|
75
76
|
"lodash.curry": "^4.1.1",
|
|
76
|
-
"next": "^16",
|
|
77
77
|
"next-intl": "^4",
|
|
78
78
|
"prettier": "^3.4.2",
|
|
79
79
|
"react": "^19",
|
|
80
80
|
"react-dom": "^19",
|
|
81
|
-
"react-use": "^17",
|
|
82
81
|
"rimraf": "^5.0.5",
|
|
83
|
-
"
|
|
84
|
-
"ts-loader": "^9",
|
|
85
|
-
"ts-node": "^10",
|
|
82
|
+
"tsup": "^8.5.1",
|
|
86
83
|
"typescript": "^5",
|
|
87
84
|
"typescript-eslint": "^8.18.1",
|
|
88
85
|
"uuid": "^11",
|
|
86
|
+
"vitest": "^4.1.10",
|
|
89
87
|
"zod": "^4"
|
|
90
88
|
},
|
|
91
89
|
"resolutions": {
|
|
@@ -93,6 +91,10 @@
|
|
|
93
91
|
"postcss": "8.5.10",
|
|
94
92
|
"@react-pakistan/util-functions": "workspace:."
|
|
95
93
|
},
|
|
94
|
+
"peerDependencies": {
|
|
95
|
+
"react": "^19",
|
|
96
|
+
"react-dom": "^19"
|
|
97
|
+
},
|
|
96
98
|
"engines": {
|
|
97
99
|
"npm": ">=10.0.0",
|
|
98
100
|
"node": ">=20.0.0"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
declare enum LS_KEYS {
|
|
2
2
|
BANKS = "stellar_banks_cache",
|
|
3
3
|
BRANCHES = "stellar_branches_cache",
|
|
4
4
|
COMPANIES = "stellar_companies_cache",
|
|
@@ -16,9 +16,11 @@ export declare enum LS_KEYS {
|
|
|
16
16
|
/**
|
|
17
17
|
* Base entity interface with common audit fields and meta support
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
interface BaseEntity {
|
|
20
20
|
id: string;
|
|
21
21
|
createdAt: Date;
|
|
22
22
|
updatedAt: Date;
|
|
23
23
|
meta?: any;
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
export { type BaseEntity, LS_KEYS };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var o=(c,a)=>{for(var s in a)r(c,s,{get:a[s],enumerable:!0})},p=(c,a,s,l)=>{if(a&&typeof a=="object"||typeof a=="function")for(let t of n(a))!C.call(c,t)&&t!==s&&r(c,t,{get:()=>a[t],enumerable:!(l=h(a,t))||l.enumerable});return c};var A=c=>p(r({},"__esModule",{value:!0}),c);var E={};o(E,{LS_KEYS:()=>_});module.exports=A(E);var _=(e=>(e.BANKS="stellar_banks_cache",e.BRANCHES="stellar_branches_cache",e.COMPANIES="stellar_companies_cache",e.CONTACTS="stellar_contacts_cache",e.CURRENCIES="stellar_currencies_cache",e.CUSTOMERS="stellar_customers_cache",e.EXPENSE_CATEGORIES="stellar_expense_categories_cache",e.EXPENSES="stellar_expenses_cache",e.PAYMENT_MODES="stellar_payment_modes_cache",e.PREFERENCES="stellar_preferences_cache",e.PRODUCT_CATEGORIES="stellar_product_categories_cache",e.PRODUCTS="stellar_products_cache",e.TAXES="stellar_taxes_cache",e))(_||{});0&&(module.exports={LS_KEYS});
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { BaseEntity } from './common';
|
|
2
|
-
|
|
1
|
+
import { BaseEntity } from './common.js';
|
|
2
|
+
|
|
3
|
+
declare enum GENDER {
|
|
3
4
|
MALE = "MALE",
|
|
4
5
|
FEMALE = "FEMALE"
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
+
declare enum QUOTE_INVOICE_CATEGORY {
|
|
7
8
|
QUOTE = "QUOTE",
|
|
8
9
|
INVOICE = "INVOICE"
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
+
declare enum QUOTE_INVOICE_MODE {
|
|
11
12
|
COMPANY = "COMPANY",
|
|
12
13
|
CUSTOMER = "CUSTOMER"
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
+
declare enum DISCOUNT_UNIT {
|
|
15
16
|
FIXED_VALUE = "FIXED_VALUE",
|
|
16
17
|
PERCENTAGE_VALUE = "PERCENTAGE_VALUE"
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
declare enum INVOICE_STATUS {
|
|
19
20
|
UNPAID = "UNPAID",
|
|
20
21
|
PAID = "PAID"
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
+
declare enum QUOTE_STATUS {
|
|
23
24
|
DRAFT = "DRAFT",
|
|
24
25
|
PENDING = "PENDING",
|
|
25
26
|
SENT = "SENT",
|
|
26
27
|
ACCEPTED = "ACCEPTED",
|
|
27
28
|
DECLINED = "DECLINED"
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
+
declare enum PAYMENT_TYPE {
|
|
30
31
|
FULL_AMOUNT = "FULL_AMOUNT",
|
|
31
32
|
PARTIAL_AMOUNT = "PARTIAL_AMOUNT"
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
+
declare enum LEAD_SOURCE {
|
|
34
35
|
WEBSITE = "WEBSITE",
|
|
35
36
|
SOCIAL_MEDIA = "SOCIAL_MEDIA",
|
|
36
37
|
LINKEDIN = "LINKEDIN",
|
|
@@ -41,11 +42,11 @@ export declare enum LEAD_SOURCE {
|
|
|
41
42
|
FRIEND = "FRIEND",
|
|
42
43
|
OTHER = "OTHER"
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
+
declare enum LEAD_TYPE {
|
|
45
46
|
COMPANY = "COMPANY",
|
|
46
47
|
CONTACT = "CONTACT"
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
+
declare enum LEAD_STATUS {
|
|
49
50
|
NEW = "NEW",
|
|
50
51
|
ASSIGNED = "ASSIGNED",
|
|
51
52
|
IN_NEGOTIATION = "IN_NEGOTIATION",
|
|
@@ -59,7 +60,7 @@ export declare enum LEAD_STATUS {
|
|
|
59
60
|
/**
|
|
60
61
|
* Profile model type
|
|
61
62
|
*/
|
|
62
|
-
|
|
63
|
+
interface ProfileBE extends BaseEntity {
|
|
63
64
|
avatar?: string;
|
|
64
65
|
dob?: Date;
|
|
65
66
|
email: string;
|
|
@@ -75,7 +76,7 @@ export interface ProfileBE extends BaseEntity {
|
|
|
75
76
|
/**
|
|
76
77
|
* Product model type
|
|
77
78
|
*/
|
|
78
|
-
|
|
79
|
+
interface ProductBE extends BaseEntity {
|
|
79
80
|
currency: string;
|
|
80
81
|
description?: string;
|
|
81
82
|
images: string[];
|
|
@@ -88,14 +89,14 @@ export interface ProductBE extends BaseEntity {
|
|
|
88
89
|
/**
|
|
89
90
|
* ProductCategory model type
|
|
90
91
|
*/
|
|
91
|
-
|
|
92
|
+
interface ProductCategoryBE extends BaseEntity {
|
|
92
93
|
description?: string;
|
|
93
94
|
name: string;
|
|
94
95
|
}
|
|
95
96
|
/**
|
|
96
97
|
* Company model type
|
|
97
98
|
*/
|
|
98
|
-
|
|
99
|
+
interface CompanyBE extends BaseEntity {
|
|
99
100
|
country: string;
|
|
100
101
|
email: string;
|
|
101
102
|
name: string;
|
|
@@ -105,7 +106,7 @@ export interface CompanyBE extends BaseEntity {
|
|
|
105
106
|
/**
|
|
106
107
|
* Contact model type
|
|
107
108
|
*/
|
|
108
|
-
|
|
109
|
+
interface ContactBE extends BaseEntity {
|
|
109
110
|
companyId: string;
|
|
110
111
|
country: string;
|
|
111
112
|
email: string;
|
|
@@ -116,14 +117,14 @@ export interface ContactBE extends BaseEntity {
|
|
|
116
117
|
/**
|
|
117
118
|
* ExpenseCategory model type
|
|
118
119
|
*/
|
|
119
|
-
|
|
120
|
+
interface ExpenseCategoryBE extends BaseEntity {
|
|
120
121
|
description?: string;
|
|
121
122
|
name: string;
|
|
122
123
|
}
|
|
123
124
|
/**
|
|
124
125
|
* Expense model type
|
|
125
126
|
*/
|
|
126
|
-
|
|
127
|
+
interface ExpenseBE extends BaseEntity {
|
|
127
128
|
currency: string;
|
|
128
129
|
description: string;
|
|
129
130
|
expenseCategoryId: string;
|
|
@@ -134,7 +135,7 @@ export interface ExpenseBE extends BaseEntity {
|
|
|
134
135
|
/**
|
|
135
136
|
* QuoteInvoice model type
|
|
136
137
|
*/
|
|
137
|
-
|
|
138
|
+
interface QuoteInvoiceBE extends BaseEntity {
|
|
138
139
|
category: QUOTE_INVOICE_CATEGORY;
|
|
139
140
|
companyId?: string;
|
|
140
141
|
currency: string;
|
|
@@ -154,7 +155,7 @@ export interface QuoteInvoiceBE extends BaseEntity {
|
|
|
154
155
|
/**
|
|
155
156
|
* Service model type
|
|
156
157
|
*/
|
|
157
|
-
|
|
158
|
+
interface ServiceBE extends BaseEntity {
|
|
158
159
|
description?: string;
|
|
159
160
|
name: string;
|
|
160
161
|
price: number;
|
|
@@ -164,7 +165,7 @@ export interface ServiceBE extends BaseEntity {
|
|
|
164
165
|
/**
|
|
165
166
|
* Payment model type
|
|
166
167
|
*/
|
|
167
|
-
|
|
168
|
+
interface PaymentBE extends BaseEntity {
|
|
168
169
|
amount: number;
|
|
169
170
|
attachment?: string;
|
|
170
171
|
balance: number;
|
|
@@ -179,13 +180,13 @@ export interface PaymentBE extends BaseEntity {
|
|
|
179
180
|
/**
|
|
180
181
|
* Preference model type
|
|
181
182
|
*/
|
|
182
|
-
|
|
183
|
+
interface PreferenceBE extends BaseEntity {
|
|
183
184
|
onboarding: boolean;
|
|
184
185
|
}
|
|
185
186
|
/**
|
|
186
187
|
* AppUser model type
|
|
187
188
|
*/
|
|
188
|
-
|
|
189
|
+
interface AppUserBE extends BaseEntity {
|
|
189
190
|
email: string;
|
|
190
191
|
firstName: string;
|
|
191
192
|
lastName: string;
|
|
@@ -193,7 +194,7 @@ export interface AppUserBE extends BaseEntity {
|
|
|
193
194
|
/**
|
|
194
195
|
* MenuOrder model type
|
|
195
196
|
*/
|
|
196
|
-
|
|
197
|
+
interface MenuOrderBE extends BaseEntity {
|
|
197
198
|
label: string;
|
|
198
199
|
order: number;
|
|
199
200
|
preferenceId: string;
|
|
@@ -201,7 +202,7 @@ export interface MenuOrderBE extends BaseEntity {
|
|
|
201
202
|
/**
|
|
202
203
|
* PaymentMode model type
|
|
203
204
|
*/
|
|
204
|
-
|
|
205
|
+
interface PaymentModeBE extends BaseEntity {
|
|
205
206
|
enabled: boolean;
|
|
206
207
|
isDefault: boolean;
|
|
207
208
|
label: string;
|
|
@@ -210,7 +211,7 @@ export interface PaymentModeBE extends BaseEntity {
|
|
|
210
211
|
/**
|
|
211
212
|
* Bank model type
|
|
212
213
|
*/
|
|
213
|
-
|
|
214
|
+
interface BankBE extends BaseEntity {
|
|
214
215
|
accountNumber: string;
|
|
215
216
|
accountTitle: string;
|
|
216
217
|
bankAddress?: string;
|
|
@@ -224,7 +225,7 @@ export interface BankBE extends BaseEntity {
|
|
|
224
225
|
/**
|
|
225
226
|
* Tax model type
|
|
226
227
|
*/
|
|
227
|
-
|
|
228
|
+
interface TaxBE extends BaseEntity {
|
|
228
229
|
description?: string;
|
|
229
230
|
enabled: boolean;
|
|
230
231
|
isDefault: boolean;
|
|
@@ -235,7 +236,7 @@ export interface TaxBE extends BaseEntity {
|
|
|
235
236
|
/**
|
|
236
237
|
* Branch model type
|
|
237
238
|
*/
|
|
238
|
-
|
|
239
|
+
interface BranchBE extends BaseEntity {
|
|
239
240
|
branchAddress: string;
|
|
240
241
|
branchName: string;
|
|
241
242
|
enabled: boolean;
|
|
@@ -248,7 +249,7 @@ export interface BranchBE extends BaseEntity {
|
|
|
248
249
|
/**
|
|
249
250
|
* Currency model type
|
|
250
251
|
*/
|
|
251
|
-
|
|
252
|
+
interface CurrencyBE extends BaseEntity {
|
|
252
253
|
code: string;
|
|
253
254
|
enabled: boolean;
|
|
254
255
|
isDefault: boolean;
|
|
@@ -258,7 +259,7 @@ export interface CurrencyBE extends BaseEntity {
|
|
|
258
259
|
/**
|
|
259
260
|
* Customer model type
|
|
260
261
|
*/
|
|
261
|
-
|
|
262
|
+
interface CustomerBE extends BaseEntity {
|
|
262
263
|
address?: string;
|
|
263
264
|
city: string;
|
|
264
265
|
country: string;
|
|
@@ -270,7 +271,7 @@ export interface CustomerBE extends BaseEntity {
|
|
|
270
271
|
/**
|
|
271
272
|
* RequestForm model type
|
|
272
273
|
*/
|
|
273
|
-
|
|
274
|
+
interface RequestFormBE extends BaseEntity {
|
|
274
275
|
businessType: string;
|
|
275
276
|
companyName: string;
|
|
276
277
|
companySize?: string;
|
|
@@ -285,7 +286,7 @@ export interface RequestFormBE extends BaseEntity {
|
|
|
285
286
|
/**
|
|
286
287
|
* Lead model type
|
|
287
288
|
*/
|
|
288
|
-
|
|
289
|
+
interface LeadBE extends BaseEntity {
|
|
289
290
|
notes?: string;
|
|
290
291
|
source: LEAD_SOURCE;
|
|
291
292
|
status: LEAD_STATUS;
|
|
@@ -294,9 +295,11 @@ export interface LeadBE extends BaseEntity {
|
|
|
294
295
|
/**
|
|
295
296
|
* Join table for QuoteInvoice and Product many-to-many relationship
|
|
296
297
|
*/
|
|
297
|
-
|
|
298
|
+
interface QuotesInvoicesOnStellarProducts {
|
|
298
299
|
meta?: any;
|
|
299
300
|
productId: string;
|
|
300
301
|
quantity: number;
|
|
301
302
|
quoteInvoiceId: string;
|
|
302
303
|
}
|
|
304
|
+
|
|
305
|
+
export { type AppUserBE, type BankBE, type BranchBE, type CompanyBE, type ContactBE, type CurrencyBE, type CustomerBE, DISCOUNT_UNIT, type ExpenseBE, type ExpenseCategoryBE, GENDER, INVOICE_STATUS, LEAD_SOURCE, LEAD_STATUS, LEAD_TYPE, type LeadBE, type MenuOrderBE, PAYMENT_TYPE, type PaymentBE, type PaymentModeBE, type PreferenceBE, type ProductBE, type ProductCategoryBE, type ProfileBE, QUOTE_INVOICE_CATEGORY, QUOTE_INVOICE_MODE, QUOTE_STATUS, type QuoteInvoiceBE, type QuotesInvoicesOnStellarProducts, type RequestFormBE, type ServiceBE, type TaxBE };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var b=(r,n)=>{for(var e in n)a(r,e,{get:n[e],enumerable:!0})},B=(r,n,e,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of l(n))!f.call(r,i)&&i!==e&&a(r,i,{get:()=>n[i],enumerable:!(o=y(n,i))||o.enumerable});return r};var A=r=>B(a({},"__esModule",{value:!0}),r);var C={};b(C,{DISCOUNT_UNIT:()=>E,GENDER:()=>g,INVOICE_STATUS:()=>p,LEAD_SOURCE:()=>N,LEAD_STATUS:()=>I,LEAD_TYPE:()=>x,PAYMENT_TYPE:()=>u,QUOTE_INVOICE_CATEGORY:()=>c,QUOTE_INVOICE_MODE:()=>d,QUOTE_STATUS:()=>m});module.exports=A(C);var g=(e=>(e.MALE="MALE",e.FEMALE="FEMALE",e))(g||{}),c=(e=>(e.QUOTE="QUOTE",e.INVOICE="INVOICE",e))(c||{}),d=(e=>(e.COMPANY="COMPANY",e.CUSTOMER="CUSTOMER",e))(d||{}),E=(e=>(e.FIXED_VALUE="FIXED_VALUE",e.PERCENTAGE_VALUE="PERCENTAGE_VALUE",e))(E||{}),p=(e=>(e.UNPAID="UNPAID",e.PAID="PAID",e))(p||{}),m=(s=>(s.DRAFT="DRAFT",s.PENDING="PENDING",s.SENT="SENT",s.ACCEPTED="ACCEPTED",s.DECLINED="DECLINED",s))(m||{}),u=(e=>(e.FULL_AMOUNT="FULL_AMOUNT",e.PARTIAL_AMOUNT="PARTIAL_AMOUNT",e))(u||{}),N=(t=>(t.WEBSITE="WEBSITE",t.SOCIAL_MEDIA="SOCIAL_MEDIA",t.LINKEDIN="LINKEDIN",t.PROFESSIONAL_NETWORK="PROFESSIONAL_NETWORK",t.CUSTOMER_REFERRAL="CUSTOMER_REFERRAL",t.SALES="SALES",t.ADVERTISING="ADVERTISING",t.FRIEND="FRIEND",t.OTHER="OTHER",t))(N||{}),x=(e=>(e.COMPANY="COMPANY",e.CONTACT="CONTACT",e))(x||{}),I=(t=>(t.NEW="NEW",t.ASSIGNED="ASSIGNED",t.IN_NEGOTIATION="IN_NEGOTIATION",t.ON_HOLD="ON_HOLD",t.WON="WON",t.LOOSE="LOOSE",t.CANCELLED="CANCELLED",t.DRAFT="DRAFT",t.WAITING="WAITING",t))(I||{});0&&(module.exports={DISCOUNT_UNIT,GENDER,INVOICE_STATUS,LEAD_SOURCE,LEAD_STATUS,LEAD_TYPE,PAYMENT_TYPE,QUOTE_INVOICE_CATEGORY,QUOTE_INVOICE_MODE,QUOTE_STATUS});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { BaseEntity, LS_KEYS } from './common.js';
|
|
2
|
+
export { AppUserBE, BankBE, BranchBE, CompanyBE, ContactBE, CurrencyBE, CustomerBE, DISCOUNT_UNIT, ExpenseBE, ExpenseCategoryBE, GENDER, INVOICE_STATUS, LEAD_SOURCE, LEAD_STATUS, LEAD_TYPE, LeadBE, MenuOrderBE, PAYMENT_TYPE, PaymentBE, PaymentModeBE, PreferenceBE, ProductBE, ProductCategoryBE, ProfileBE, QUOTE_INVOICE_CATEGORY, QUOTE_INVOICE_MODE, QUOTE_STATUS, QuoteInvoiceBE, QuotesInvoicesOnStellarProducts, RequestFormBE, ServiceBE, TaxBE } from './erp.js';
|
|
3
|
+
export { POSCategoryBE, POSCustomerBE, POSDiscountBE, POSOrderBE, POSOrderItemBE, POSPaymentBE, POSProductBE, POSProductVariantBE, POSRegisterBE, POSReservationBE, POSShiftBE, POSStoreBE, POSTableBE, POSTaxBE, POS_DISCOUNT_TYPE, POS_ORDER_STATUS, POS_PAYMENT_METHOD_TYPE, POS_PAYMENT_STATUS, POS_REGISTER_STATUS, POS_RESERVATION_STATUS, POS_SHIFT_STATUS, POS_TABLE_STATUS, POS_TAX_TYPE } from './pos.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,r,p,x)=>{if(r&&typeof r=="object"||typeof r=="function")for(let m of c(r))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>r[m],enumerable:!(x=b(r,m))||x.enumerable});return f},e=(f,r,p)=>(t(f,r,"default"),p&&t(p,r,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var o={};module.exports=g(o);e(o,require("./common"),module.exports);e(o,require("./erp"),module.exports);e(o,require("./pos"),module.exports);0&&(module.exports={...require("./common"),...require("./erp"),...require("./pos")});
|