@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
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
interface Return {
|
|
2
2
|
option: string;
|
|
3
3
|
}
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Returns available page-limit dropdown options based on total record count.
|
|
6
|
+
* @param totalRecords - Total number of records.
|
|
7
|
+
* @returns Array of page-limit option objects.
|
|
8
|
+
*/
|
|
9
|
+
declare const getAvailablePageLimits: (totalRecords: number) => Array<Return>;
|
|
10
|
+
|
|
11
|
+
export { getAvailablePageLimits };
|
|
@@ -1,31 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.getAvailablePageLimits = void 0;
|
|
13
|
-
var dynamic_page_limit_1 = require("./dynamic-page-limit");
|
|
14
|
-
var getAvailablePageLimits = function (totalRecords) {
|
|
15
|
-
var allOptions = [10, 15, 25, 100];
|
|
16
|
-
// If totalRecords is less than the smallest option, return only the smallest option
|
|
17
|
-
if (totalRecords < allOptions[0]) {
|
|
18
|
-
return (0, dynamic_page_limit_1.dynamicPageLimit)([allOptions[0]]);
|
|
19
|
-
}
|
|
20
|
-
// Get options less than or equal to totalRecords
|
|
21
|
-
var lowerOptions = allOptions.filter(function (opt) { return opt < totalRecords; });
|
|
22
|
-
// Find the next higher option
|
|
23
|
-
var nextHigherOption = allOptions.find(function (opt) { return opt >= totalRecords; });
|
|
24
|
-
// Combine lower options and next higher (if it exists)
|
|
25
|
-
var availableOptions = __spreadArray([], lowerOptions, true);
|
|
26
|
-
if (nextHigherOption && !availableOptions.includes(nextHigherOption)) {
|
|
27
|
-
availableOptions.push(nextHigherOption);
|
|
28
|
-
}
|
|
29
|
-
return (0, dynamic_page_limit_1.dynamicPageLimit)(availableOptions);
|
|
30
|
-
};
|
|
31
|
-
exports.getAvailablePageLimits = getAvailablePageLimits;
|
|
1
|
+
var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var g=(n,i)=>{for(var e in i)a(n,e,{get:i[e],enumerable:!0})},l=(n,i,e,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let t of s(i))!u.call(n,t)&&t!==e&&a(n,t,{get:()=>i[t],enumerable:!(r=p(i,t))||r.enumerable});return n};var c=n=>l(a({},"__esModule",{value:!0}),n);var O={};g(O,{getAvailablePageLimits:()=>f});module.exports=c(O);var m=require("./dynamic-page-limit");const f=n=>{const i=[10,15,25,100];if(n<i[0])return(0,m.dynamicPageLimit)([i[0]]);const e=i.filter(o=>o<n),r=i.find(o=>o>=n),t=[...e];return r&&!t.includes(r)&&t.push(r),(0,m.dynamicPageLimit)(t)};0&&(module.exports={getAvailablePageLimits});
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import { CalendarDay } from './type';
|
|
1
|
+
import { CalendarDay } from './type.js';
|
|
2
|
+
|
|
2
3
|
interface Params {
|
|
3
4
|
month: number;
|
|
4
5
|
year: number;
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Generates an array of CalendarDay objects for the current month.
|
|
9
|
+
* @param params.month - Month number (1-based).
|
|
10
|
+
* @param params.year - Full year number.
|
|
11
|
+
* @returns Array of CalendarDay objects for the month.
|
|
12
|
+
*/
|
|
13
|
+
declare const getCalendarCurrentMonth: ({ month, year, }: Params) => Array<CalendarDay>;
|
|
14
|
+
|
|
15
|
+
export { getCalendarCurrentMonth };
|
|
@@ -1,31 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getCalendarCurrentMonth = void 0;
|
|
16
|
-
var dayjs_1 = __importDefault(require("dayjs"));
|
|
17
|
-
var get_number_of_days_in_month_1 = require("./get-number-of-days-in-month");
|
|
18
|
-
var getCalendarCurrentMonth = function (_a) {
|
|
19
|
-
var month = _a.month, year = _a.year;
|
|
20
|
-
var today = new Date().getDate();
|
|
21
|
-
return __spreadArray([], Array((0, get_number_of_days_in_month_1.getNumberOfDaysInMonth)({
|
|
22
|
-
year: year,
|
|
23
|
-
month: month,
|
|
24
|
-
})), true).map(function (_, index) { return ({
|
|
25
|
-
date: (0, dayjs_1.default)("".concat(year, "-").concat(month, "-").concat(index + 1)).format('YYYY-MM-DD'),
|
|
26
|
-
dayOfMonth: index + 1,
|
|
27
|
-
isCurrentMonth: true,
|
|
28
|
-
isToday: !!(today === index + 1),
|
|
29
|
-
}); });
|
|
30
|
-
};
|
|
31
|
-
exports.getCalendarCurrentMonth = getCalendarCurrentMonth;
|
|
1
|
+
var f=Object.create;var o=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var p=(r,a)=>{for(var t in a)o(r,t,{get:a[t],enumerable:!0})},m=(r,a,t,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of D(a))!M.call(r,e)&&e!==t&&o(r,e,{get:()=>a[e],enumerable:!(n=u(a,e))||n.enumerable});return r};var C=(r,a,t)=>(t=r!=null?f(d(r)):{},m(a||!r||!r.__esModule?o(t,"default",{value:r,enumerable:!0}):t,r)),h=r=>m(o({},"__esModule",{value:!0}),r);var Y={};p(Y,{getCalendarCurrentMonth:()=>i});module.exports=h(Y);var y=C(require("dayjs")),s=require("./get-number-of-days-in-month");const i=({month:r,year:a})=>{const t=new Date().getDate();return[...Array((0,s.getNumberOfDaysInMonth)({year:a,month:r}))].map((n,e)=>({date:(0,y.default)(`${a}-${r}-${e+1}`).format("YYYY-MM-DD"),dayOfMonth:e+1,isCurrentMonth:!0,isToday:t===e+1}))};0&&(module.exports={getCalendarCurrentMonth});
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import { CalendarDay } from './type';
|
|
1
|
+
import { CalendarDay } from './type.js';
|
|
2
|
+
|
|
2
3
|
interface Params {
|
|
3
4
|
month: number;
|
|
4
5
|
year: number;
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Generates a full calendar month grid including overflow days from adjacent months.
|
|
9
|
+
* @param params.month - Month index (0-based).
|
|
10
|
+
* @param params.year - Full year number.
|
|
11
|
+
* @returns Array of CalendarDay objects for the entire grid.
|
|
12
|
+
*/
|
|
13
|
+
declare const getCalendarDates: ({ month, year, }: Params) => Array<CalendarDay>;
|
|
14
|
+
|
|
15
|
+
export { getCalendarDates };
|
|
@@ -1,42 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getCalendarDates = void 0;
|
|
16
|
-
var dayjs_1 = __importDefault(require("dayjs"));
|
|
17
|
-
var weekday_1 = __importDefault(require("dayjs/plugin/weekday"));
|
|
18
|
-
var get_calendar_previous_month_1 = require("./get-calendar-previous-month");
|
|
19
|
-
var get_calendar_next_month_1 = require("./get-calendar-next-month");
|
|
20
|
-
var get_calendar_current_month_1 = require("./get-calendar-current-month");
|
|
21
|
-
dayjs_1.default.extend(weekday_1.default);
|
|
22
|
-
var getCalendarDates = function (_a) {
|
|
23
|
-
var month = _a.month, year = _a.year;
|
|
24
|
-
var updatedMonth = month + 1;
|
|
25
|
-
var currentMonthDays = (0, get_calendar_current_month_1.getCalendarCurrentMonth)({
|
|
26
|
-
month: updatedMonth,
|
|
27
|
-
year: year,
|
|
28
|
-
});
|
|
29
|
-
var previousMonthDays = (0, get_calendar_previous_month_1.getCalendarPreviousMonth)({
|
|
30
|
-
currentMonthDays: currentMonthDays,
|
|
31
|
-
month: updatedMonth,
|
|
32
|
-
year: year,
|
|
33
|
-
});
|
|
34
|
-
var nextMonthDays = (0, get_calendar_next_month_1.getCalendarNextMonth)({
|
|
35
|
-
currentMonthDays: currentMonthDays,
|
|
36
|
-
month: updatedMonth,
|
|
37
|
-
year: year,
|
|
38
|
-
});
|
|
39
|
-
var days = __spreadArray(__spreadArray(__spreadArray([], previousMonthDays, true), currentMonthDays, true), nextMonthDays, true);
|
|
40
|
-
return days;
|
|
41
|
-
};
|
|
42
|
-
exports.getCalendarDates = getCalendarDates;
|
|
1
|
+
var u=Object.create;var e=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var D=(t,r)=>{for(var o in r)e(t,o,{get:r[o],enumerable:!0})},m=(t,r,o,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of C(r))!l.call(t,n)&&n!==o&&e(t,n,{get:()=>r[n],enumerable:!(a=f(r,n))||a.enumerable});return t};var s=(t,r,o)=>(o=t!=null?u(M(t)):{},m(r||!t||!t.__esModule?e(o,"default",{value:t,enumerable:!0}):o,t)),g=t=>m(e({},"__esModule",{value:!0}),t);var P={};D(P,{getCalendarDates:()=>x});module.exports=g(P);var d=s(require("dayjs")),h=s(require("dayjs/plugin/weekday")),i=require("./get-calendar-previous-month"),p=require("./get-calendar-next-month"),y=require("./get-calendar-current-month");d.default.extend(h.default);const x=({month:t,year:r})=>{const o=t+1,a=(0,y.getCalendarCurrentMonth)({month:o,year:r}),n=(0,i.getCalendarPreviousMonth)({currentMonthDays:a,month:o,year:r}),c=(0,p.getCalendarNextMonth)({currentMonthDays:a,month:o,year:r});return[...n,...a,...c]};0&&(module.exports={getCalendarDates});
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import { CalendarDay } from './type';
|
|
1
|
+
import { CalendarDay } from './type.js';
|
|
2
|
+
|
|
2
3
|
interface Params {
|
|
3
4
|
currentMonthDays: Array<CalendarDay>;
|
|
4
5
|
month: number;
|
|
5
6
|
year: number;
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Generates the overflow CalendarDay entries from the next month to fill the grid.
|
|
10
|
+
* @param params.currentMonthDays - Days of the current month.
|
|
11
|
+
* @param params.month - Month number (1-based).
|
|
12
|
+
* @param params.year - Full year number.
|
|
13
|
+
* @returns Array of CalendarDay objects for the overflow days.
|
|
14
|
+
*/
|
|
15
|
+
declare const getCalendarNextMonth: ({ year, month, currentMonthDays, }: Params) => Array<CalendarDay>;
|
|
16
|
+
|
|
17
|
+
export { getCalendarNextMonth };
|
|
@@ -1,32 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getCalendarNextMonth = void 0;
|
|
16
|
-
var dayjs_1 = __importDefault(require("dayjs"));
|
|
17
|
-
var get_week_day_1 = require("./get-week-day");
|
|
18
|
-
var getCalendarNextMonth = function (_a) {
|
|
19
|
-
var year = _a.year, month = _a.month, currentMonthDays = _a.currentMonthDays;
|
|
20
|
-
var lastDayOfTheMonthWeekday = (0, get_week_day_1.getWeekday)("".concat(year, "-").concat(month, "-").concat(currentMonthDays.length));
|
|
21
|
-
var nextMonth = (0, dayjs_1.default)("".concat(year, "-").concat(month, "-01")).add(1, 'month');
|
|
22
|
-
var visibleNumberOfDaysFromNextMonth = lastDayOfTheMonthWeekday
|
|
23
|
-
? 7 - lastDayOfTheMonthWeekday
|
|
24
|
-
: lastDayOfTheMonthWeekday;
|
|
25
|
-
return __spreadArray([], Array(visibleNumberOfDaysFromNextMonth), true).map(function (day, index) { return ({
|
|
26
|
-
date: (0, dayjs_1.default)("".concat(nextMonth.year(), "-").concat(nextMonth.month() + 1, "-").concat(index + 1)).format('YYYY-MM-DD'),
|
|
27
|
-
dayOfMonth: index + 1,
|
|
28
|
-
isCurrentMonth: false,
|
|
29
|
-
isToday: false,
|
|
30
|
-
}); });
|
|
31
|
-
};
|
|
32
|
-
exports.getCalendarNextMonth = getCalendarNextMonth;
|
|
1
|
+
var f=Object.create;var o=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var i=(a,r)=>{for(var t in r)o(a,t,{get:r[t],enumerable:!0})},s=(a,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of M(r))!$.call(a,e)&&e!==t&&o(a,e,{get:()=>r[e],enumerable:!(n=l(r,e))||n.enumerable});return a};var c=(a,r,t)=>(t=a!=null?f(D(a)):{},s(r||!a||!a.__esModule?o(t,"default",{value:a,enumerable:!0}):t,a)),u=a=>s(o({},"__esModule",{value:!0}),a);var C={};i(C,{getCalendarNextMonth:()=>p});module.exports=u(C);var m=c(require("dayjs")),d=require("./get-week-day");const p=({year:a,month:r,currentMonthDays:t})=>{const n=(0,d.getWeekday)(`${a}-${r}-${t.length}`),e=(0,m.default)(`${a}-${r}-01`).add(1,"month"),h=n&&7-n;return[...Array(h)].map((b,y)=>({date:(0,m.default)(`${e.year()}-${e.month()+1}-${y+1}`).format("YYYY-MM-DD"),dayOfMonth:y+1,isCurrentMonth:!1,isToday:!1}))};0&&(module.exports={getCalendarNextMonth});
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import { CalendarDay } from './type';
|
|
1
|
+
import { CalendarDay } from './type.js';
|
|
2
|
+
|
|
2
3
|
interface Params {
|
|
3
4
|
currentMonthDays: Array<CalendarDay>;
|
|
4
5
|
month: number;
|
|
5
6
|
year: number;
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Generates the overflow CalendarDay entries from the previous month to fill the grid.
|
|
10
|
+
* @param params.currentMonthDays - Days of the current month.
|
|
11
|
+
* @param params.month - Month number (1-based).
|
|
12
|
+
* @param params.year - Full year number.
|
|
13
|
+
* @returns Array of CalendarDay objects for the overflow days.
|
|
14
|
+
*/
|
|
15
|
+
declare const getCalendarPreviousMonth: ({ currentMonthDays, month, year, }: Params) => Array<CalendarDay>;
|
|
16
|
+
|
|
17
|
+
export { getCalendarPreviousMonth };
|
|
@@ -1,36 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getCalendarPreviousMonth = void 0;
|
|
16
|
-
var dayjs_1 = __importDefault(require("dayjs"));
|
|
17
|
-
var get_week_day_1 = require("./get-week-day");
|
|
18
|
-
var getCalendarPreviousMonth = function (_a) {
|
|
19
|
-
var currentMonthDays = _a.currentMonthDays, month = _a.month, year = _a.year;
|
|
20
|
-
var firstDayOfTheMonthWeekday = (0, get_week_day_1.getWeekday)(currentMonthDays[0].date);
|
|
21
|
-
var previousMonth = (0, dayjs_1.default)("".concat(year, "-").concat(month, "-01")).subtract(1, 'month');
|
|
22
|
-
// Cover first day of the month being sunday (firstDayOfTheMonthWeekday === 0)
|
|
23
|
-
var visibleNumberOfDaysFromPreviousMonth = firstDayOfTheMonthWeekday
|
|
24
|
-
? firstDayOfTheMonthWeekday - 1
|
|
25
|
-
: 6;
|
|
26
|
-
var previousMonthLastMondayDayOfMonth = (0, dayjs_1.default)(currentMonthDays[0].date)
|
|
27
|
-
.subtract(visibleNumberOfDaysFromPreviousMonth, 'day')
|
|
28
|
-
.date();
|
|
29
|
-
return __spreadArray([], Array(visibleNumberOfDaysFromPreviousMonth), true).map(function (day, index) { return ({
|
|
30
|
-
date: (0, dayjs_1.default)("".concat(previousMonth.year(), "-").concat(previousMonth.month() + 1, "-").concat(previousMonthLastMondayDayOfMonth + index)).format('YYYY-MM-DD'),
|
|
31
|
-
dayOfMonth: previousMonthLastMondayDayOfMonth + index,
|
|
32
|
-
isCurrentMonth: false,
|
|
33
|
-
isToday: false,
|
|
34
|
-
}); });
|
|
35
|
-
};
|
|
36
|
-
exports.getCalendarPreviousMonth = getCalendarPreviousMonth;
|
|
1
|
+
var i=Object.create;var n=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var l=(a,r)=>{for(var t in r)n(a,t,{get:r[t],enumerable:!0})},f=(a,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of M(r))!D.call(a,e)&&e!==t&&n(a,e,{get:()=>r[e],enumerable:!(o=u(r,e))||o.enumerable});return a};var p=(a,r,t)=>(t=a!=null?i(c(a)):{},f(r||!a||!a.__esModule?n(t,"default",{value:a,enumerable:!0}):t,a)),b=a=>f(n({},"__esModule",{value:!0}),a);var C={};l(C,{getCalendarPreviousMonth:()=>v});module.exports=b(C);var s=p(require("dayjs")),h=require("./get-week-day");const v=({currentMonthDays:a,month:r,year:t})=>{const o=(0,h.getWeekday)(a[0].date),e=(0,s.default)(`${t}-${r}-01`).subtract(1,"month"),y=o?o-1:6,m=(0,s.default)(a[0].date).subtract(y,"day").date();return[...Array(y)].map(($,d)=>({date:(0,s.default)(`${e.year()}-${e.month()+1}-${m+d}`).format("YYYY-MM-DD"),dayOfMonth:m+d,isCurrentMonth:!1,isToday:!1}))};0&&(module.exports={getCalendarPreviousMonth});
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCurrentYear = void 0;
|
|
4
|
-
var getCurrentYear = function () { return new Date().getFullYear(); };
|
|
5
|
-
exports.getCurrentYear = getCurrentYear;
|
|
1
|
+
var a=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var Y=(r,e)=>{for(var n in e)a(r,n,{get:e[n],enumerable:!0})},b=(r,e,n,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of l(e))!o.call(r,t)&&t!==n&&a(r,t,{get:()=>e[t],enumerable:!(u=g(e,t))||u.enumerable});return r};var c=r=>b(a({},"__esModule",{value:!0}),r);var p={};Y(p,{getCurrentYear:()=>m});module.exports=c(p);const m=()=>new Date().getFullYear();0&&(module.exports={getCurrentYear});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
interface IDayMap {
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
*/
|
|
5
5
|
[key: number]: string;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
declare const dayMap: IDayMap;
|
|
8
|
+
declare const getDayName: (num: number) => string;
|
|
9
|
+
|
|
10
|
+
export { type IDayMap, dayMap, getDayName };
|
package/general/get-day-name.js
CHANGED
|
@@ -1,14 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDayName = exports.dayMap = void 0;
|
|
4
|
-
exports.dayMap = {
|
|
5
|
-
0: 'Sunday',
|
|
6
|
-
1: 'Monday',
|
|
7
|
-
2: 'Tuesday',
|
|
8
|
-
3: 'Wednesday',
|
|
9
|
-
4: 'Thursday',
|
|
10
|
-
5: 'Friday',
|
|
11
|
-
6: 'Saturday',
|
|
12
|
-
};
|
|
13
|
-
var getDayName = function (num) { return exports.dayMap[num]; };
|
|
14
|
-
exports.getDayName = getDayName;
|
|
1
|
+
var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var u=(a,e)=>{for(var r in e)n(a,r,{get:e[r],enumerable:!0})},i=(a,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let y of o(e))!p.call(a,y)&&y!==r&&n(a,y,{get:()=>e[y],enumerable:!(t=s(e,y))||t.enumerable});return a};var M=a=>i(n({},"__esModule",{value:!0}),a);var g={};u(g,{dayMap:()=>d,getDayName:()=>c});module.exports=M(g);const d={0:"Sunday",1:"Monday",2:"Tuesday",3:"Wednesday",4:"Thursday",5:"Friday",6:"Saturday"},c=a=>d[a];0&&(module.exports={dayMap,getDayName});
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Returns the dial code for a given ISO country code.
|
|
3
|
+
* @param countryCode - The ISO country code.
|
|
4
|
+
* @returns The dial code string, or undefined if not found.
|
|
5
|
+
*/
|
|
6
|
+
declare const getDialCode: (countryCode: string) => string | undefined;
|
|
7
|
+
|
|
8
|
+
export { getDialCode };
|
package/general/get-dial-code.js
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDialCode = void 0;
|
|
4
|
-
var dial_codes_1 = require("../constants/dial-codes");
|
|
5
|
-
var getDialCode = function (countryCode) {
|
|
6
|
-
return dial_codes_1.dialCodeMap.get(countryCode);
|
|
7
|
-
};
|
|
8
|
-
exports.getDialCode = getDialCode;
|
|
1
|
+
var n=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var s=(e,t)=>{for(var i in t)n(e,i,{get:t[i],enumerable:!0})},f=(e,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of a(t))!p.call(e,r)&&r!==i&&n(e,r,{get:()=>t[r],enumerable:!(o=g(t,r))||o.enumerable});return e};var l=e=>f(n({},"__esModule",{value:!0}),e);var u={};s(u,{getDialCode:()=>m});module.exports=l(u);var d=require("../constants/dial-codes");const m=e=>d.dialCodeMap.get(e);0&&(module.exports={getDialCode});
|
|
@@ -2,5 +2,12 @@ interface Params {
|
|
|
2
2
|
firstName: string;
|
|
3
3
|
lastName: string;
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Combines first and last name into a full name string.
|
|
7
|
+
* @param params.firstName - The first name.
|
|
8
|
+
* @param params.lastName - The last name.
|
|
9
|
+
* @returns The combined full name.
|
|
10
|
+
*/
|
|
11
|
+
declare const getFullName: ({ firstName, lastName }: Params) => string;
|
|
12
|
+
|
|
13
|
+
export { getFullName };
|
package/general/get-full-name.js
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFullName = void 0;
|
|
4
|
-
var getFullName = function (_a) {
|
|
5
|
-
var firstName = _a.firstName, lastName = _a.lastName;
|
|
6
|
-
return "".concat(firstName, " ").concat(lastName);
|
|
7
|
-
};
|
|
8
|
-
exports.getFullName = getFullName;
|
|
1
|
+
var e=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var l=(t,a)=>{for(var s in a)e(t,s,{get:a[s],enumerable:!0})},N=(t,a,s,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of n(a))!g.call(t,r)&&r!==s&&e(t,r,{get:()=>a[r],enumerable:!(i=m(a,r))||i.enumerable});return t};var c=t=>N(e({},"__esModule",{value:!0}),t);var o={};l(o,{getFullName:()=>f});module.exports=c(o);const f=({firstName:t,lastName:a})=>`${t} ${a}`;0&&(module.exports={getFullName});
|
package/general/get-href.d.ts
CHANGED
package/general/get-href.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
/**
|
|
3
|
-
* A util function to get current window href
|
|
4
|
-
*
|
|
5
|
-
* @returns string - https://taimoor.io/
|
|
6
|
-
* @author Taimoor Khan
|
|
7
|
-
* @remarks Taimoor Resume 4
|
|
8
|
-
*/
|
|
9
|
-
/** End file docs */
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.getHref = void 0;
|
|
12
|
-
var getHref = function () { return window && window.location.href; };
|
|
13
|
-
exports.getHref = getHref;
|
|
1
|
+
var i=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var f=(n,o)=>{for(var e in o)i(n,e,{get:o[e],enumerable:!0})},g=(n,o,e,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of c(o))!d.call(n,t)&&t!==e&&i(n,t,{get:()=>o[t],enumerable:!(r=w(o,t))||r.enumerable});return n};var s=n=>g(i({},"__esModule",{value:!0}),n);var h={};f(h,{getHref:()=>a});module.exports=s(h);const a=()=>window&&window.location.href;0&&(module.exports={getHref});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
interface IMonthMap {
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
*/
|
|
5
5
|
[key: number]: string;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
declare const monthMap: IMonthMap;
|
|
8
|
+
declare const getMonthName: (num: number) => string;
|
|
9
|
+
|
|
10
|
+
export { type IMonthMap, getMonthName, monthMap };
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMonthName = exports.monthMap = void 0;
|
|
4
|
-
exports.monthMap = {
|
|
5
|
-
0: 'January',
|
|
6
|
-
1: 'February',
|
|
7
|
-
2: 'March',
|
|
8
|
-
3: 'April',
|
|
9
|
-
4: 'May',
|
|
10
|
-
5: 'June',
|
|
11
|
-
6: 'July',
|
|
12
|
-
7: 'August',
|
|
13
|
-
8: 'September',
|
|
14
|
-
9: 'October',
|
|
15
|
-
10: 'November',
|
|
16
|
-
11: 'December',
|
|
17
|
-
};
|
|
18
|
-
var getMonthName = function (num) { return exports.monthMap[num]; };
|
|
19
|
-
exports.getMonthName = getMonthName;
|
|
1
|
+
var o=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var m=(e,r)=>{for(var n in r)o(e,n,{get:r[n],enumerable:!0})},c=(e,r,n,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of M(r))!b.call(e,t)&&t!==n&&o(e,t,{get:()=>r[t],enumerable:!(a=u(r,t))||a.enumerable});return e};var h=e=>c(o({},"__esModule",{value:!0}),e);var y={};m(y,{getMonthName:()=>s,monthMap:()=>p});module.exports=h(y);const p={0:"January",1:"February",2:"March",3:"April",4:"May",5:"June",6:"July",7:"August",8:"September",9:"October",10:"November",11:"December"},s=e=>p[e];0&&(module.exports={getMonthName,monthMap});
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
interface IMonthNameMap {
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
*/
|
|
5
5
|
[key: string]: number;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
declare const monthNameMap: IMonthNameMap;
|
|
8
8
|
/**
|
|
9
9
|
* Get the UTC month number (0-11) from a month name
|
|
10
10
|
* @param monthName - The name of the month (case-insensitive)
|
|
11
11
|
* @returns The UTC month number (0-11), or -1 if the month name is invalid
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
declare const getMonthNumber: (monthName: string) => number;
|
|
14
|
+
|
|
15
|
+
export { type IMonthNameMap, getMonthNumber, monthNameMap };
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMonthNumber = exports.monthNameMap = void 0;
|
|
4
|
-
exports.monthNameMap = {
|
|
5
|
-
january: 0,
|
|
6
|
-
february: 1,
|
|
7
|
-
march: 2,
|
|
8
|
-
april: 3,
|
|
9
|
-
may: 4,
|
|
10
|
-
june: 5,
|
|
11
|
-
july: 6,
|
|
12
|
-
august: 7,
|
|
13
|
-
september: 8,
|
|
14
|
-
october: 9,
|
|
15
|
-
november: 10,
|
|
16
|
-
december: 11,
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Get the UTC month number (0-11) from a month name
|
|
20
|
-
* @param monthName - The name of the month (case-insensitive)
|
|
21
|
-
* @returns The UTC month number (0-11), or -1 if the month name is invalid
|
|
22
|
-
*/
|
|
23
|
-
var getMonthNumber = function (monthName) {
|
|
24
|
-
var normalizedName = monthName.toLowerCase().trim();
|
|
25
|
-
return exports.monthNameMap[normalizedName] !== undefined
|
|
26
|
-
? exports.monthNameMap[normalizedName]
|
|
27
|
-
: -1;
|
|
28
|
-
};
|
|
29
|
-
exports.getMonthNumber = getMonthNumber;
|
|
1
|
+
var a=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var s=(r,e)=>{for(var n in e)a(r,n,{get:e[n],enumerable:!0})},c=(r,e,n,m)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of b(e))!p.call(r,t)&&t!==n&&a(r,t,{get:()=>e[t],enumerable:!(m=u(e,t))||m.enumerable});return r};var i=r=>c(a({},"__esModule",{value:!0}),r);var h={};s(h,{getMonthNumber:()=>M,monthNameMap:()=>o});module.exports=i(h);const o={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},M=r=>{const e=r.toLowerCase().trim();return o[e]!==void 0?o[e]:-1};0&&(module.exports={getMonthNumber,monthNameMap});
|
|
@@ -2,5 +2,12 @@ interface Params {
|
|
|
2
2
|
year: number;
|
|
3
3
|
month: number;
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Returns the number of days in a given month and year.
|
|
7
|
+
* @param params.year - The year.
|
|
8
|
+
* @param params.month - The month number (1-based).
|
|
9
|
+
* @returns Number of days in the month.
|
|
10
|
+
*/
|
|
11
|
+
declare const getNumberOfDaysInMonth: ({ year, month }: Params) => number;
|
|
12
|
+
|
|
13
|
+
export { getNumberOfDaysInMonth };
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getNumberOfDaysInMonth = void 0;
|
|
7
|
-
var dayjs_1 = __importDefault(require("dayjs"));
|
|
8
|
-
var getNumberOfDaysInMonth = function (_a) {
|
|
9
|
-
var year = _a.year, month = _a.month;
|
|
10
|
-
return (0, dayjs_1.default)("".concat(year, "-").concat(month, "-01")).daysInMonth();
|
|
11
|
-
};
|
|
12
|
-
exports.getNumberOfDaysInMonth = getNumberOfDaysInMonth;
|
|
1
|
+
var b=Object.create;var m=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var c=(r,n)=>{for(var a in n)m(r,a,{get:n[a],enumerable:!0})},o=(r,n,a,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of y(n))!h.call(r,e)&&e!==a&&m(r,e,{get:()=>n[e],enumerable:!(t=u(n,e))||t.enumerable});return r};var d=(r,n,a)=>(a=r!=null?b(f(r)):{},o(n||!r||!r.__esModule?m(a,"default",{value:r,enumerable:!0}):a,r)),i=r=>o(m({},"__esModule",{value:!0}),r);var I={};c(I,{getNumberOfDaysInMonth:()=>p});module.exports=i(I);var s=d(require("dayjs"));const p=({year:r,month:n})=>(0,s.default)(`${r}-${n}-01`).daysInMonth();0&&(module.exports={getNumberOfDaysInMonth});
|
package/general/get-pathname.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
/**
|
|
3
|
-
* A util function to get current window pathname
|
|
4
|
-
*
|
|
5
|
-
* @returns string - /index
|
|
6
|
-
* @author Taimoor Khan
|
|
7
|
-
* @remarks Taimoor Resume 4
|
|
8
|
-
*/
|
|
9
|
-
/** End file docs */
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.getPathname = void 0;
|
|
12
|
-
var getPathname = function () {
|
|
13
|
-
return window &&
|
|
14
|
-
window.location.pathname.substring(0, window.location.pathname.length - 1);
|
|
15
|
-
};
|
|
16
|
-
exports.getPathname = getPathname;
|
|
1
|
+
var i=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var s=(t,n)=>{for(var a in n)i(t,a,{get:n[a],enumerable:!0})},c=(t,n,a,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of g(n))!h.call(t,o)&&o!==a&&i(t,o,{get:()=>n[o],enumerable:!(e=w(n,o))||e.enumerable});return t};var d=t=>c(i({},"__esModule",{value:!0}),t);var m={};s(m,{getPathname:()=>l});module.exports=d(m);const l=()=>window&&window.location.pathname.substring(0,window.location.pathname.length-1);0&&(module.exports={getPathname});
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Returns the weekday number (0-6) for a given date string.
|
|
3
|
+
* @param date - A date string parsable by dayjs.
|
|
4
|
+
* @returns The weekday number (0=Sunday, 6=Saturday).
|
|
5
|
+
*/
|
|
6
|
+
declare const getWeekday: (date: string) => number;
|
|
7
|
+
|
|
8
|
+
export { getWeekday };
|
package/general/get-week-day.js
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getWeekday = void 0;
|
|
7
|
-
var dayjs_1 = __importDefault(require("dayjs"));
|
|
8
|
-
var getWeekday = function (date) { return (0, dayjs_1.default)(date).weekday(); };
|
|
9
|
-
exports.getWeekday = getWeekday;
|
|
1
|
+
var s=Object.create;var a=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var i=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var p=(e,r)=>{for(var t in r)a(e,t,{get:r[t],enumerable:!0})},m=(e,r,t,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of g(r))!k.call(e,o)&&o!==t&&a(e,o,{get:()=>r[o],enumerable:!(d=y(r,o))||d.enumerable});return e};var b=(e,r,t)=>(t=e!=null?s(i(e)):{},m(r||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e)),c=e=>m(a({},"__esModule",{value:!0}),e);var j={};p(j,{getWeekday:()=>f});module.exports=c(j);var n=b(require("dayjs"));const f=e=>(0,n.default)(e).weekday();0&&(module.exports={getWeekday});
|
|
@@ -4,4 +4,6 @@
|
|
|
4
4
|
* @returns Promise<string> - The base64 encoded string of the image
|
|
5
5
|
* @throws Error if the image cannot be fetched or converted
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
declare const imageUrlToBase64: (url: string) => Promise<string>;
|
|
8
|
+
|
|
9
|
+
export { imageUrlToBase64 };
|