carriera-intern 0.0.0
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/.cursor/rules/icons.mdc +7 -0
- package/.editorconfig +17 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/tasks.json +42 -0
- package/README.md +59 -0
- package/angular.json +94 -0
- package/carriera-intern@0.0.0 +0 -0
- package/package.json +61 -0
- package/projects/carriera-intern-components/.storybook/main.ts +12 -0
- package/projects/carriera-intern-components/.storybook/preview-head.html +13 -0
- package/projects/carriera-intern-components/.storybook/preview.ts +54 -0
- package/projects/carriera-intern-components/.storybook/tsconfig.doc.json +10 -0
- package/projects/carriera-intern-components/.storybook/tsconfig.json +11 -0
- package/projects/carriera-intern-components/.storybook/typings.d.ts +4 -0
- package/projects/carriera-intern-components/README.md +63 -0
- package/projects/carriera-intern-components/ng-package.json +14 -0
- package/projects/carriera-intern-components/package.json +14 -0
- package/projects/carriera-intern-components/public/assets/animations/animation-document-update.json +1 -0
- package/projects/carriera-intern-components/public/assets/animations/animation-image.json +1 -0
- package/projects/carriera-intern-components/public/assets/animations/animation-logo.json +1 -0
- package/projects/carriera-intern-components/public/assets/animations/animation-media.json +1 -0
- package/projects/carriera-intern-components/public/assets/cdl.png +0 -0
- package/projects/carriera-intern-components/public/assets/exampledoc.png +0 -0
- package/projects/carriera-intern-components/public/assets/examplelargeview.png +0 -0
- package/projects/carriera-intern-components/public/assets/icons/Thumb-active.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/Thumb.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/arrows/cai-arrow-primary-up.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/arrows/cai-arrow-secondary-down.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/arrows/cai-arrow-secondary-left.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/arrows/cai-arrow-secondary-right.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_bbt.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_bmo_harris.svg +13 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_capital_one.svg +11 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_chase.svg +11 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_chime.svg +10 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_citi.svg +8 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_fifth_third.svg +14 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_green_dot.svg +17 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_mb_financial.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_meta.svg +11 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_navi_federal.svg +14 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_of_america.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_pnc.svg +10 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_regions.svg +14 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_renasant.svg +14 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_tcf.svg +11 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_truist.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_us.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/banks/ic_bank_wells_fargo.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-color.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-drop-zone-focus.svg +48 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-edit.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-edit2.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-expand.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-gps.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-illustration-dark.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-illustration-drop-zone-cover.svg +34 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-illustration-drop-zone-profile.svg +58 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-illustration-drop-zone-video.svg +41 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-illustration-drop-zone.svg +43 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-illustration.svg +18 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-loader.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-search.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/cai-violation-hazmat.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/fuel-contact/cai-contact.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/fuel-contact/cai-count.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/fuel-contact/cai-fuel-card.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/fuel-contact/cai-people.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/fuel-contact/cai-share.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/fuel-contact/cai-user-2.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/general/cai-address.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/general/cai-checkmark.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/general/cai-date.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/general/cai-email.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/general/cai-fax.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/general/cai-label.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/general/cai-money-additional.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/general/cai-money.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/general/cai-phone-extension.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/general/cai-phone.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/general/cai-sort-by.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/general/cai-sort-descending.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/general/cai-website.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_corrosive_8.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_dangerous_when_wet_4.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_explosives_1_1.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_explosives_1_2.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_explosives_1_3.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_explosives_1_4.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_explosives_1_5.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_explosives_1_6.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_flammable_3.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_flammable_gas_2.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_flammable_solid_4.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_inhalation_hazzard_2.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_inhalation_hazzard_6.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_organic_peroxide_5_2.svg +7 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_oxidizer_5_1.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_oxygen_non_flam_gas_2.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_radioactive_7.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/hazardous/ic_spontaneously_combustible_4.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/integration/cai-efs.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/interaction/cai-cancel.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/interaction/cai-copy.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/interaction/cai-dislike.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/interaction/cai-drag.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/interaction/cai-favorite.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/interaction/cai-like.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/interaction/cai-minus.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/interaction/cai-password-hidden.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/interaction/cai-password-key.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/interaction/cai-password-shown.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/interaction/cai-plus.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/interaction/cai_time.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/interaction/cai_x.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/load/cai-driver.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/load/cai-load.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/load/cai-ltl-single.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/load/cai-parking.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/load/cai-weight.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_atro.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_beall.svg +7 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_bedard.svg +8 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_butler.svg +7 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_de_lucio.svg +17 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_dorsey.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_east.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_fontaine.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_fruehauf.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_gallegos.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_great_dane.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_heil.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_hudson.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_hyndai.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_kaufman.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_mac.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_manac.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_polar.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_ravens.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_reitnouer.svg +12 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_strick.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_timpte.svg +8 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_trail_king.svg +7 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_transcraft.svg +12 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_tremcar.svg +10 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_tytal.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_utility.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_vanguard.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_vantage.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_wabash.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_walinga.svg +8 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trailers/ic_trailer_wilson.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trucks/ic_truck_chevrolet.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trucks/ic_truck_ford.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trucks/ic_truck_freightliner.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trucks/ic_truck_gmc.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trucks/ic_truck_hino.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trucks/ic_truck_international.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trucks/ic_truck_isuzu.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trucks/ic_truck_kenworth.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trucks/ic_truck_mack.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trucks/ic_truck_peterbilt.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trucks/ic_truck_volvo.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/makes/trucks/ic_truck_western_star.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/menu/cai-delete.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/menu/cai-download.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/menu/cai-reset.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/pm/cai-pm-base.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/pm/trailer/cai-pm-general.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/pm/trailer/cai-pm-pto-pump.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/pm/trailer/cai-repair-reefer.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/pm/truck/cai-pm-air-filter.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/pm/truck/cai-pm-alignment.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/pm/truck/cai-pm-battery.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/pm/truck/cai-pm-belts.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/pm/truck/cai-pm-brake-chamber.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/pm/truck/cai-pm-engine-oil-filter.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/pm/truck/cai-pm-engine-tune-up.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/pm/truck/cai-pm-radiator.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/pm/truck/cai-pm-transmission-fluid.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/pm/truck/cai-pm-turbo.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/ca/cai-ca-ab.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/ca/cai-ca-bc.svg +35 -0
- package/projects/carriera-intern-components/public/assets/icons/states/ca/cai-ca-mb.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/ca/cai-ca-nb.svg +7 -0
- package/projects/carriera-intern-components/public/assets/icons/states/ca/cai-ca-nl.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/states/ca/cai-ca-ns.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/states/ca/cai-ca-on.svg +7 -0
- package/projects/carriera-intern-components/public/assets/icons/states/ca/cai-ca-pe.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/ca/cai-ca-qc.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/states/ca/cai-ca-sk.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/ca/cai-ca-yt.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ak.svg +14 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-al.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ar.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-az.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ca.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-co.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ct.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-de.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-fl.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ga.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-hi.svg +10 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ia.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-id.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-il.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-in.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ks.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ky.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-la.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ma.svg +7 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-md.svg +7 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-me.svg +9 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-mi.svg +11 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-mn.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-mo.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ms.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-mt.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-nc.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-nd.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ne.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-nh.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-nj.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-nm.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-nv.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ny.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-oh.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ok.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-or.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-pa.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ri.svg +8 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-sc.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-sd.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-tn.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-tx.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-ut.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-va.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-vt.svg +7 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-wa.svg +15 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-wi.svg +4 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-wv.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/states/us/cai-us-wy.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/status/cai-status-warning-lite.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/status/cai-status-warning.svg +3 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_bottom-dump.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_carhauler-stinger.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_carhauler.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_chassis.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_conestoga.svg +13 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_container.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_dryvan.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_end-dump.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_flatbed.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_hopper.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_low-boy.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_reefer.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_side-kit.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_step-deck.svg +7 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_tanker-pneumatic.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/trailers/ic_trailer_tanker.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/trucks/ic_truck_box-truck.svg +7 -0
- package/projects/carriera-intern-components/public/assets/icons/trucks/ic_truck_car-hauler.svg +7 -0
- package/projects/carriera-intern-components/public/assets/icons/trucks/ic_truck_cargo-van.svg +5 -0
- package/projects/carriera-intern-components/public/assets/icons/trucks/ic_truck_cement.svg +8 -0
- package/projects/carriera-intern-components/public/assets/icons/trucks/ic_truck_dump.svg +8 -0
- package/projects/carriera-intern-components/public/assets/icons/trucks/ic_truck_garbage.svg +10 -0
- package/projects/carriera-intern-components/public/assets/icons/trucks/ic_truck_reefer.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/trucks/ic_truck_semi-truck.svg +8 -0
- package/projects/carriera-intern-components/public/assets/icons/trucks/ic_truck_semi-wSleeper.svg +8 -0
- package/projects/carriera-intern-components/public/assets/icons/trucks/ic_truck_spotter.svg +6 -0
- package/projects/carriera-intern-components/public/assets/icons/trucks/ic_truck_tow-truck.svg +8 -0
- package/projects/carriera-intern-components/public/assets/invexample.png +0 -0
- package/projects/carriera-intern-components/public/assets/invoice.png +0 -0
- package/projects/carriera-intern-components/public/assets/json/icons.json +985 -0
- package/projects/carriera-intern-components/public/assets/truck.png +0 -0
- package/projects/carriera-intern-components/public/favicon.ico +0 -0
- package/projects/carriera-intern-components/src/Changelog.mdx +285 -0
- package/projects/carriera-intern-components/src/Icons.mdx +279 -0
- package/projects/carriera-intern-components/src/app/app.config.ts +26 -0
- package/projects/carriera-intern-components/src/app/components/avatar/avatar.component.html +28 -0
- package/projects/carriera-intern-components/src/app/components/avatar/avatar.component.scss +414 -0
- package/projects/carriera-intern-components/src/app/components/avatar/avatar.component.spec.ts +23 -0
- package/projects/carriera-intern-components/src/app/components/avatar/avatar.component.ts +66 -0
- package/projects/carriera-intern-components/src/app/components/avatar/avatar.stories.ts +787 -0
- package/projects/carriera-intern-components/src/app/components/avatar/models/avatar.model.ts +52 -0
- package/projects/carriera-intern-components/src/app/components/avatar/models/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/avatar/pipes/avatar-classes.pipe.ts +98 -0
- package/projects/carriera-intern-components/src/app/components/avatar/pipes/index.ts +2 -0
- package/projects/carriera-intern-components/src/app/components/avatar/pipes/initials.pipe.ts +31 -0
- package/projects/carriera-intern-components/src/app/components/content-driven-co/content-driven-co.component.css +0 -0
- package/projects/carriera-intern-components/src/app/components/content-driven-co/content-driven-co.component.html +10 -0
- package/projects/carriera-intern-components/src/app/components/content-driven-co/content-driven-co.component.spec.ts +23 -0
- package/projects/carriera-intern-components/src/app/components/content-driven-co/content-driven-co.component.ts +25 -0
- package/projects/carriera-intern-components/src/app/components/content-driven-co/content-driven-co.stories.ts +65 -0
- package/projects/carriera-intern-components/src/app/components/copy/copy.component.html +66 -0
- package/projects/carriera-intern-components/src/app/components/copy/copy.component.scss +103 -0
- package/projects/carriera-intern-components/src/app/components/copy/copy.component.spec.ts +22 -0
- package/projects/carriera-intern-components/src/app/components/copy/copy.component.ts +57 -0
- package/projects/carriera-intern-components/src/app/components/copy/stories/copy.stories.ts +170 -0
- package/projects/carriera-intern-components/src/app/components/counter/counter.component.html +33 -0
- package/projects/carriera-intern-components/src/app/components/counter/counter.component.scss +197 -0
- package/projects/carriera-intern-components/src/app/components/counter/counter.component.spec.ts +22 -0
- package/projects/carriera-intern-components/src/app/components/counter/counter.component.ts +219 -0
- package/projects/carriera-intern-components/src/app/components/counter/counter.stories.ts +65 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-dropdown/dispatch-dropdown.component.html +223 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-dropdown/dispatch-dropdown.component.scss +792 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-dropdown/dispatch-dropdown.component.spec.ts +23 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-dropdown/dispatch-dropdown.component.ts +323 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-dropdown/dispatch-dropdown.stories.ts +409 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-dropdown/helpers/dispatch-dropdown.helper.ts +248 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-dropdown/interfaces/dispatch-dropdown-config.interface.ts +10 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-dropdown/interfaces/dispatch-dropdown-option.interface.ts +4 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-dropdown/interfaces/index.ts +2 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-dropdown/mock/parking-data.json +1550 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-dropdown/pipes/dispatch-search-filter.pipe.ts +26 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-location/dispatch-location.component.html +76 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-location/dispatch-location.component.scss +141 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-location/dispatch-location.component.spec.ts +22 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-location/dispatch-location.component.ts +268 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-location/dispatch-location.stories.ts +184 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-location/interfaces/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-location/interfaces/last-status-data.interface.ts +6 -0
- package/projects/carriera-intern-components/src/app/components/dispatch-location/pipes/last-status-format.pipe.ts +35 -0
- package/projects/carriera-intern-components/src/app/components/document-preview/document-preview.component.html +229 -0
- package/projects/carriera-intern-components/src/app/components/document-preview/document-preview.component.scss +1115 -0
- package/projects/carriera-intern-components/src/app/components/document-preview/document-preview.component.spec.ts +23 -0
- package/projects/carriera-intern-components/src/app/components/document-preview/document-preview.component.ts +277 -0
- package/projects/carriera-intern-components/src/app/components/document-preview/document-preview.stories.ts +256 -0
- package/projects/carriera-intern-components/src/app/components/document-preview/interfaces/document-tag.interface.ts +4 -0
- package/projects/carriera-intern-components/src/app/components/document-preview/interfaces/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/document-preview/utils/config/button-actions.config.ts +30 -0
- package/projects/carriera-intern-components/src/app/components/document-preview/utils/config/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/drop-zone.component.html +376 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/drop-zone.component.scss +9 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/drop-zone.component.spec.ts +22 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/drop-zone.component.ts +1272 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/drop-zone.stories.ts +1253 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/enums/drop-zone-labels.enum.ts +0 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/enums/drop-zone-variant.enum.ts +7 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/enums/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/models/app-file.model.ts +28 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/models/file.response.ts +10 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/models/index.ts +2 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/pipes/drag-mode-animation.pipe.ts +40 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/utils/helpers/drop-zone-documents.helper.ts +67 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/utils/helpers/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/utils/styles/drop-zone-cropper.scss +202 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/utils/styles/drop-zone-documents.scss +166 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/utils/styles/drop-zone-drag-mode.scss +107 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/utils/styles/drop-zone-images.scss +106 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/utils/styles/drop-zone-layout.scss +208 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/utils/styles/drop-zone-states.scss +183 -0
- package/projects/carriera-intern-components/src/app/components/drop-zone/utils/styles/drop-zone-variations.scss +189 -0
- package/projects/carriera-intern-components/src/app/components/input/directives/helpers/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/input/directives/helpers/mask.helper.ts +52 -0
- package/projects/carriera-intern-components/src/app/components/input/directives/mask.directive.spec.ts +13 -0
- package/projects/carriera-intern-components/src/app/components/input/directives/mask.directive.ts +274 -0
- package/projects/carriera-intern-components/src/app/components/input/directives/number-format.directive.spec.ts +13 -0
- package/projects/carriera-intern-components/src/app/components/input/directives/number-format.directive.ts +442 -0
- package/projects/carriera-intern-components/src/app/components/input/directives/password.directive.spec.ts +13 -0
- package/projects/carriera-intern-components/src/app/components/input/directives/password.directive.ts +282 -0
- package/projects/carriera-intern-components/src/app/components/input/input.component.html +2669 -0
- package/projects/carriera-intern-components/src/app/components/input/input.component.scss +3000 -0
- package/projects/carriera-intern-components/src/app/components/input/input.component.spec.ts +23 -0
- package/projects/carriera-intern-components/src/app/components/input/input.component.ts +1486 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/banks.json +249 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/basic.json +42 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/brokers.json +544 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/colors.json +95 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/commodities.json +12 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/contacts.json +117 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/dispatchers.json +83 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/dispatches.json +4188 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/fuel-list-dropdown.json +968 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/fuel-transaction.json +78 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/fuelcard.json +472 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/hazardous.json +166 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/labelColors.json +81 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/labels.json +169 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/new-load-modal-res.json +1148 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/noboard.json +1665 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/owner.json +209 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/pm.json +112 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/shipper.json +1192 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/split-driver.json +99 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/split-trailer.json +79 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/split-truck.json +49 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/states.json +605 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/toll.json +106 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/trailermakes.json +196 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/truck_trailer.json +184 -0
- package/projects/carriera-intern-components/src/app/components/input/mock/truckmakes.json +76 -0
- package/projects/carriera-intern-components/src/app/components/input/models/dropdown.model.ts +376 -0
- package/projects/carriera-intern-components/src/app/components/input/models/index.ts +2 -0
- package/projects/carriera-intern-components/src/app/components/input/models/input.model.ts +227 -0
- package/projects/carriera-intern-components/src/app/components/input/pipes/broker-progress.pipe.ts +36 -0
- package/projects/carriera-intern-components/src/app/components/input/pipes/clear-tooltip.pipe.ts +38 -0
- package/projects/carriera-intern-components/src/app/components/input/pipes/error-message.pipe.ts +54 -0
- package/projects/carriera-intern-components/src/app/components/input/pipes/highlight-search.pipe.ts +42 -0
- package/projects/carriera-intern-components/src/app/components/input/pipes/index.ts +6 -0
- package/projects/carriera-intern-components/src/app/components/input/pipes/input-class.pipe.ts +109 -0
- package/projects/carriera-intern-components/src/app/components/input/pipes/remap-pm-icons.pipe.ts +49 -0
- package/projects/carriera-intern-components/src/app/components/input/stories/Documentation.mdx +190 -0
- package/projects/carriera-intern-components/src/app/components/input/stories/dropdown-options.ts +80 -0
- package/projects/carriera-intern-components/src/app/components/input/stories/dropdown.stories.ts +376 -0
- package/projects/carriera-intern-components/src/app/components/input/stories/input-dropdown.stories.ts +405 -0
- package/projects/carriera-intern-components/src/app/components/input/stories/input-inverse.stories.ts +232 -0
- package/projects/carriera-intern-components/src/app/components/input/stories/input-load.stories.ts +150 -0
- package/projects/carriera-intern-components/src/app/components/input/stories/input-placeholder.stories.ts +225 -0
- package/projects/carriera-intern-components/src/app/components/input/stories/input-subcontent.stories.ts +264 -0
- package/projects/carriera-intern-components/src/app/components/input/stories/input-table.stories.ts +211 -0
- package/projects/carriera-intern-components/src/app/components/input/stories/input.stories.ts +1159 -0
- package/projects/carriera-intern-components/src/app/components/input/stories/modal.stories.ts +162 -0
- package/projects/carriera-intern-components/src/app/components/input/utilities/constants/cast.constants.ts +91 -0
- package/projects/carriera-intern-components/src/app/components/input/utilities/constants/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/input/utilities/helpers/index.ts +2 -0
- package/projects/carriera-intern-components/src/app/components/input/utilities/helpers/input.helper.ts +985 -0
- package/projects/carriera-intern-components/src/app/components/input/utilities/helpers/keyboard-navigation.helper.ts +402 -0
- package/projects/carriera-intern-components/src/app/components/input/utilities/index.ts +2 -0
- package/projects/carriera-intern-components/src/app/components/input-address/enums/input-address-layers-string.enum.ts +4 -0
- package/projects/carriera-intern-components/src/app/components/input-address/enums/input-address-type-string.enum.ts +7 -0
- package/projects/carriera-intern-components/src/app/components/input-address/input-address.component.html +13 -0
- package/projects/carriera-intern-components/src/app/components/input-address/input-address.component.scss +0 -0
- package/projects/carriera-intern-components/src/app/components/input-address/input-address.component.spec.ts +22 -0
- package/projects/carriera-intern-components/src/app/components/input-address/input-address.component.ts +509 -0
- package/projects/carriera-intern-components/src/app/components/input-address/models/address-data.model.ts +22 -0
- package/projects/carriera-intern-components/src/app/components/input-address/models/address-list.model.ts +6 -0
- package/projects/carriera-intern-components/src/app/components/input-address/models/long-lat.model.ts +4 -0
- package/projects/carriera-intern-components/src/app/components/input-address/models/sent-address-data.model.ts +25 -0
- package/projects/carriera-intern-components/src/app/components/input-address/stories/address.stories.ts +181 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/cai-input-datetime-picker.component.html +180 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/cai-input-datetime-picker.component.scss +862 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/cai-input-datetime-picker.component.ts +1559 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/cai-input-datetime-picker.stories.ts +507 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/cai-custom-datetime-pickers.component.html +134 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/cai-custom-datetime-pickers.component.scss +0 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/cai-custom-datetime-pickers.component.spec.ts +24 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/cai-custom-datetime-pickers.component.ts +331 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-dates-main/cai-custom-datetime-pickers-calendar-dates-main.component.html +190 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-dates-main/cai-custom-datetime-pickers-calendar-dates-main.component.scss +0 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-dates-main/cai-custom-datetime-pickers-calendar-dates-main.component.spec.ts +26 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-dates-main/cai-custom-datetime-pickers-calendar-dates-main.component.ts +234 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-days/cai-custom-datetime-pickers-calendar-days.component.html +23 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-days/cai-custom-datetime-pickers-calendar-days.component.scss +0 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-days/cai-custom-datetime-pickers-calendar-days.component.spec.ts +26 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-days/cai-custom-datetime-pickers-calendar-days.component.ts +60 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-left/cai-custom-datetime-pickers-calendar-left.component.html +27 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-left/cai-custom-datetime-pickers-calendar-left.component.scss +0 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-left/cai-custom-datetime-pickers-calendar-left.component.spec.ts +26 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-left/cai-custom-datetime-pickers-calendar-left.component.ts +187 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-date-calendars/cai-custom-datetime-pickers-date-calendars.component.html +68 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-date-calendars/cai-custom-datetime-pickers-date-calendars.component.scss +0 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-date-calendars/cai-custom-datetime-pickers-date-calendars.component.spec.ts +26 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-date-calendars/cai-custom-datetime-pickers-date-calendars.component.ts +163 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/config/cai-input.config.ts +193 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/config/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/enums/calendar-left-string.enum.ts +5 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/enums/calendar-list-preview-string.enum.ts +4 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/enums/calendar-main-string.enum.ts +5 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/enums/calendar-scroll-type-string.enum.ts +4 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/enums/calendar-string.enum.ts +6 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/enums/calendar-type-string.enum.ts +3 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/enums/config.enum.ts +7 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/models/scroll-change.model.ts +6 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/models/scroll-type.model.ts +8 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/pipes/calendar-months.pipe.ts +23 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/services/calendar-datetime-picker.service.ts +35 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/strategy/calendar-strategy.ts +120 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/utils/constants/custom-datetime-pickers.constants.ts +48 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/enums/input-config-name-string.enum.ts +7 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/interfaces/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/interfaces/input-datetime.interface.ts +11 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/models/index.ts +5 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/models/label-color.model.ts +11 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/pipes/input-clear-class.pipe.ts +105 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/pipes/input-date-time-container-class.pipe.ts +66 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/pipes/input-dropdown-arrow-class.pipe.ts +68 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/pipes/input-placeholder-icon.class.pipe.ts +68 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/pipes/show-clear.pipe.ts +20 -0
- package/projects/carriera-intern-components/src/app/components/input-datetime-picker/scss/ca-input.colors.scss +287 -0
- package/projects/carriera-intern-components/src/app/components/list-contact-dropdown/list-contact-dropdown.component.html +194 -0
- package/projects/carriera-intern-components/src/app/components/list-contact-dropdown/list-contact-dropdown.component.scss +613 -0
- package/projects/carriera-intern-components/src/app/components/list-contact-dropdown/list-contact-dropdown.component.spec.ts +22 -0
- package/projects/carriera-intern-components/src/app/components/list-contact-dropdown/list-contact-dropdown.component.ts +208 -0
- package/projects/carriera-intern-components/src/app/components/list-contact-dropdown/list-contact-dropdown.stories.ts +52 -0
- package/projects/carriera-intern-components/src/app/components/list-contact-dropdown/mock/brokerContacts.json +74 -0
- package/projects/carriera-intern-components/src/app/components/list-contact-dropdown/models/contact.interface.ts +23 -0
- package/projects/carriera-intern-components/src/app/components/list-contact-dropdown/pipes/contact-count.pipe.ts +14 -0
- package/projects/carriera-intern-components/src/app/components/list-contact-dropdown/pipes/contacts-height.pipe.ts +34 -0
- package/projects/carriera-intern-components/src/app/components/list-contact-dropdown/pipes/departments-height.pipe.ts +57 -0
- package/projects/carriera-intern-components/src/app/components/list-contact-dropdown/pipes/map-contacts.pipe.ts +51 -0
- package/projects/carriera-intern-components/src/app/components/pm/mock/repair-pm.json +2743 -0
- package/projects/carriera-intern-components/src/app/components/pm/pm.component.html +82 -0
- package/projects/carriera-intern-components/src/app/components/pm/pm.component.scss +260 -0
- package/projects/carriera-intern-components/src/app/components/pm/pm.component.spec.ts +23 -0
- package/projects/carriera-intern-components/src/app/components/pm/pm.component.ts +207 -0
- package/projects/carriera-intern-components/src/app/components/pm/pm.stories.ts +104 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/enums/filter-type.enum.ts +7 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/enums/review-type.enum.ts +5 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/pipes/date-formating.pipe.spec.ts +8 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/pipes/date-formating.pipe.ts +42 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/rating-review/rating-review/rating-review.component.html +57 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/rating-review/rating-review/rating-review.component.scss +94 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/rating-review/rating-review/rating-review.component.spec.ts +23 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/rating-review/rating-review/rating-review.component.ts +105 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/rating-review/rating-review/rating-review.stories.ts +451 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/review-modal/review-modal.component.html +236 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/review-modal/review-modal.component.scss +564 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/review-modal/review-modal.component.ts +360 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/single-review/single-review.component.html +321 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/single-review/single-review.component.scss +887 -0
- package/projects/carriera-intern-components/src/app/components/rating_review/single-review/single-review.component.ts +159 -0
- package/projects/carriera-intern-components/src/app/components/selected-location-field/interfaces/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/selected-location-field/interfaces/selected-business-field.interface.ts +11 -0
- package/projects/carriera-intern-components/src/app/components/selected-location-field/selected-business-field.component.html +100 -0
- package/projects/carriera-intern-components/src/app/components/selected-location-field/selected-business-field.component.scss +239 -0
- package/projects/carriera-intern-components/src/app/components/selected-location-field/selected-business-field.component.spec.ts +22 -0
- package/projects/carriera-intern-components/src/app/components/selected-location-field/selected-business-field.component.ts +28 -0
- package/projects/carriera-intern-components/src/app/components/selected-location-field/selected-business-field.stories.ts +132 -0
- package/projects/carriera-intern-components/src/app/components/signature/signature.component.html +63 -0
- package/projects/carriera-intern-components/src/app/components/signature/signature.component.scss +229 -0
- package/projects/carriera-intern-components/src/app/components/signature/signature.component.spec.ts +23 -0
- package/projects/carriera-intern-components/src/app/components/signature/signature.component.ts +102 -0
- package/projects/carriera-intern-components/src/app/components/signature/signature.stories.ts +32 -0
- package/projects/carriera-intern-components/src/app/components/sticky-scrollbar/enums/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/sticky-scrollbar/enums/scroll-state.enum.ts +6 -0
- package/projects/carriera-intern-components/src/app/components/sticky-scrollbar/sticky-scrollbar.component.html +29 -0
- package/projects/carriera-intern-components/src/app/components/sticky-scrollbar/sticky-scrollbar.component.scss +106 -0
- package/projects/carriera-intern-components/src/app/components/sticky-scrollbar/sticky-scrollbar.component.spec.ts +23 -0
- package/projects/carriera-intern-components/src/app/components/sticky-scrollbar/sticky-scrollbar.component.ts +458 -0
- package/projects/carriera-intern-components/src/app/components/sticky-scrollbar/sticky-scrollbar.stories.ts +343 -0
- package/projects/carriera-intern-components/src/app/components/tab-option-dropdown/interfaces/index.ts +2 -0
- package/projects/carriera-intern-components/src/app/components/tab-option-dropdown/interfaces/tab-option-config.interface.ts +4 -0
- package/projects/carriera-intern-components/src/app/components/tab-option-dropdown/interfaces/tab-option.interface.ts +4 -0
- package/projects/carriera-intern-components/src/app/components/tab-option-dropdown/pipes/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/tab-option-dropdown/pipes/tab-search-filter.pipe.ts +20 -0
- package/projects/carriera-intern-components/src/app/components/tab-option-dropdown/tab-option-dropdown.component.html +66 -0
- package/projects/carriera-intern-components/src/app/components/tab-option-dropdown/tab-option-dropdown.component.scss +441 -0
- package/projects/carriera-intern-components/src/app/components/tab-option-dropdown/tab-option-dropdown.component.spec.ts +22 -0
- package/projects/carriera-intern-components/src/app/components/tab-option-dropdown/tab-option-dropdown.component.ts +105 -0
- package/projects/carriera-intern-components/src/app/components/tab-option-dropdown/tab-option.stories.ts +93 -0
- package/projects/carriera-intern-components/src/app/components/text-area/interfaces/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/text-area/interfaces/text-area.interface.ts +4 -0
- package/projects/carriera-intern-components/src/app/components/text-area/text-area.component.html +29 -0
- package/projects/carriera-intern-components/src/app/components/text-area/text-area.component.scss +294 -0
- package/projects/carriera-intern-components/src/app/components/text-area/text-area.component.spec.ts +23 -0
- package/projects/carriera-intern-components/src/app/components/text-area/text-area.component.ts +213 -0
- package/projects/carriera-intern-components/src/app/components/text-area/text-area.stories.ts +90 -0
- package/projects/carriera-intern-components/src/app/components/toolbar-dropdown/interfaces/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/components/toolbar-dropdown/interfaces/interval-dropdown-option.interface.ts +10 -0
- package/projects/carriera-intern-components/src/app/components/toolbar-dropdown/interval-dropdown.component.html +98 -0
- package/projects/carriera-intern-components/src/app/components/toolbar-dropdown/interval-dropdown.component.scss +437 -0
- package/projects/carriera-intern-components/src/app/components/toolbar-dropdown/interval-dropdown.component.spec.ts +22 -0
- package/projects/carriera-intern-components/src/app/components/toolbar-dropdown/interval-dropdown.component.ts +160 -0
- package/projects/carriera-intern-components/src/app/components/toolbar-dropdown/interval-dropdown.stories.ts +77 -0
- package/projects/carriera-intern-components/src/app/components/toolbar-dropdown/pipes/dropdown-filter-input-config.pipe.ts +52 -0
- package/projects/carriera-intern-components/src/app/components/toolbar-dropdown/utils/helpers/interval-dropdown.helper.ts +193 -0
- package/projects/carriera-intern-components/src/app/directives/hover-svg-directives.ts +49 -0
- package/projects/carriera-intern-components/src/app/directives/index.ts +3 -0
- package/projects/carriera-intern-components/src/app/directives/infinite-scroll.directive.ts +64 -0
- package/projects/carriera-intern-components/src/app/directives/intersection-observer.directive.ts +50 -0
- package/projects/carriera-intern-components/src/app/enums/alignment.enum.ts +4 -0
- package/projects/carriera-intern-components/src/app/enums/general-actions.enum.ts +71 -0
- package/projects/carriera-intern-components/src/app/enums/index.ts +3 -0
- package/projects/carriera-intern-components/src/app/enums/string-placeholder.enum.ts +3 -0
- package/projects/carriera-intern-components/src/app/models/pm.model.ts +11 -0
- package/projects/carriera-intern-components/src/app/models/review.model.ts +29 -0
- package/projects/carriera-intern-components/src/app/models/truck.model.ts +5 -0
- package/projects/carriera-intern-components/src/app/pipes/bytes-to-human-readable.pipe.spec.ts +8 -0
- package/projects/carriera-intern-components/src/app/pipes/bytes-to-human-readable.pipe.ts +29 -0
- package/projects/carriera-intern-components/src/app/pipes/currency.pipe.spec.ts +8 -0
- package/projects/carriera-intern-components/src/app/pipes/currency.pipe.ts +61 -0
- package/projects/carriera-intern-components/src/app/pipes/number-format.pipe.spec.ts +8 -0
- package/projects/carriera-intern-components/src/app/pipes/number-format.pipe.ts +30 -0
- package/projects/carriera-intern-components/src/app/services/document.service.spec.ts +16 -0
- package/projects/carriera-intern-components/src/app/services/document.service.ts +168 -0
- package/projects/carriera-intern-components/src/app/utils/autofill-validators.ts +32 -0
- package/projects/carriera-intern-components/src/app/utils/constants/index.ts +1 -0
- package/projects/carriera-intern-components/src/app/utils/constants/input-character-sets.constants.ts +142 -0
- package/projects/carriera-intern-components/src/app/utils/index.ts +2 -0
- package/projects/carriera-intern-components/src/app/validators/custom-validators.ts +45 -0
- package/projects/carriera-intern-components/src/public-api.ts +31 -0
- package/projects/carriera-intern-components/src/styles/README.md +59 -0
- package/projects/carriera-intern-components/src/styles/_variables.scss +301 -0
- package/projects/carriera-intern-components/src/styles/cropper.scss +39 -0
- package/projects/carriera-intern-components/src/styles/custompickers.scss +827 -0
- package/projects/carriera-intern-components/src/styles/popover.scss +224 -0
- package/projects/carriera-intern-components/src/styles/review_variables.scss +45 -0
- package/projects/carriera-intern-components/src/styles/tooltip.scss +119 -0
- package/projects/carriera-intern-components/src/styles/utility/colors.scss +265 -0
- package/projects/carriera-intern-components/src/styles/utility/utilities.scss +17 -0
- package/projects/carriera-intern-components/src/styles.scss +43 -0
- package/projects/carriera-intern-components/tsconfig.lib.json +15 -0
- package/projects/carriera-intern-components/tsconfig.lib.prod.json +11 -0
- package/projects/carriera-intern-components/tsconfig.spec.json +15 -0
- package/tsconfig.json +33 -0
|
@@ -0,0 +1,1559 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AfterViewInit,
|
|
3
|
+
Component,
|
|
4
|
+
computed,
|
|
5
|
+
ElementRef,
|
|
6
|
+
EventEmitter,
|
|
7
|
+
Input,
|
|
8
|
+
OnDestroy,
|
|
9
|
+
Output,
|
|
10
|
+
Self,
|
|
11
|
+
ViewChild,
|
|
12
|
+
ViewEncapsulation,
|
|
13
|
+
} from '@angular/core';
|
|
14
|
+
import {
|
|
15
|
+
ControlValueAccessor,
|
|
16
|
+
FormsModule,
|
|
17
|
+
NgControl,
|
|
18
|
+
ReactiveFormsModule,
|
|
19
|
+
Validators,
|
|
20
|
+
} from '@angular/forms';
|
|
21
|
+
import { CommonModule } from '@angular/common';
|
|
22
|
+
|
|
23
|
+
// Imports
|
|
24
|
+
import moment from 'moment';
|
|
25
|
+
import { NgbModule, NgbPopover, NgbTooltip } from '@ng-bootstrap/ng-bootstrap';
|
|
26
|
+
import { Subject, takeUntil } from 'rxjs';
|
|
27
|
+
import { AngularSvgIconModule } from 'angular-svg-icon';
|
|
28
|
+
|
|
29
|
+
// Pipes
|
|
30
|
+
import { ErrorMessagePipe } from '../input/pipes/error-message.pipe';
|
|
31
|
+
|
|
32
|
+
// Components
|
|
33
|
+
import { CaCustomDatetimePickersComponent } from './components/cai-custom-datetime-pickers/cai-custom-datetime-pickers.component';
|
|
34
|
+
|
|
35
|
+
// Enums
|
|
36
|
+
import { InputConfigNameStringEnum } from './enums/input-config-name-string.enum';
|
|
37
|
+
import { eGeneralActions } from '../../enums/general-actions.enum';
|
|
38
|
+
|
|
39
|
+
// Services
|
|
40
|
+
import { CalendarDateTimePickerService } from './components/cai-custom-datetime-pickers/services/calendar-datetime-picker.service';
|
|
41
|
+
|
|
42
|
+
// Models
|
|
43
|
+
import { CaiDateTimeConfig } from './interfaces/input-datetime.interface';
|
|
44
|
+
import { KeyboardNavigationHelper } from '../input/utilities/helpers/keyboard-navigation.helper';
|
|
45
|
+
|
|
46
|
+
// Types
|
|
47
|
+
export type InputChangeValue = string | number | Date;
|
|
48
|
+
|
|
49
|
+
@Component({
|
|
50
|
+
selector: 'cai-input-datetime-picker',
|
|
51
|
+
templateUrl: './cai-input-datetime-picker.component.html',
|
|
52
|
+
styleUrls: ['./cai-input-datetime-picker.component.scss'],
|
|
53
|
+
imports: [
|
|
54
|
+
// modules
|
|
55
|
+
CommonModule,
|
|
56
|
+
FormsModule,
|
|
57
|
+
ReactiveFormsModule,
|
|
58
|
+
AngularSvgIconModule,
|
|
59
|
+
NgbModule,
|
|
60
|
+
// components
|
|
61
|
+
CaCustomDatetimePickersComponent,
|
|
62
|
+
// pipes
|
|
63
|
+
ErrorMessagePipe,
|
|
64
|
+
],
|
|
65
|
+
providers: [CalendarDateTimePickerService],
|
|
66
|
+
})
|
|
67
|
+
export class CaiInputDatetimePickerComponent
|
|
68
|
+
implements AfterViewInit, ControlValueAccessor, OnDestroy
|
|
69
|
+
{
|
|
70
|
+
@Input() id: string = '';
|
|
71
|
+
@Input() inputConfig!: CaiDateTimeConfig;
|
|
72
|
+
@Input() formFormat?: string;
|
|
73
|
+
|
|
74
|
+
@Output('clear') clearInputEvent: EventEmitter<boolean> =
|
|
75
|
+
new EventEmitter<boolean>();
|
|
76
|
+
@Output('blurInput') blurInputEvent: EventEmitter<boolean> =
|
|
77
|
+
new EventEmitter<boolean>();
|
|
78
|
+
|
|
79
|
+
@ViewChild('dateTimePopover') dateTimePopover!: NgbPopover;
|
|
80
|
+
@ViewChild('t2') t2!: NgbPopover;
|
|
81
|
+
|
|
82
|
+
public showDateInput: boolean = false;
|
|
83
|
+
public dateTimeInputDate: Date = new Date();
|
|
84
|
+
public dateTimeIntDate: Date = new Date();
|
|
85
|
+
public selectionInput: number = -1;
|
|
86
|
+
|
|
87
|
+
// Timers
|
|
88
|
+
private dateTimeMainTimer!: ReturnType<typeof setTimeout> | number;
|
|
89
|
+
private focusBlur!: ReturnType<typeof setTimeout> | number;
|
|
90
|
+
private timeoutCleaner!: ReturnType<typeof setTimeout> | number;
|
|
91
|
+
|
|
92
|
+
private justEnteredDatePicker: boolean = false;
|
|
93
|
+
|
|
94
|
+
// Component properties
|
|
95
|
+
public eGeneralActions = eGeneralActions;
|
|
96
|
+
public isTouchedInput: boolean = false;
|
|
97
|
+
public isFocusInput: boolean = false;
|
|
98
|
+
public preventBlur: boolean = false;
|
|
99
|
+
public valueAfterWriteValue!: string;
|
|
100
|
+
// Date
|
|
101
|
+
public newInputChanged: boolean = false;
|
|
102
|
+
|
|
103
|
+
public isDisabled = computed(
|
|
104
|
+
() => this.inputConfig.isDisabled || this.getSuperControl?.disabled,
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
// Outputs
|
|
108
|
+
@Output() selectLastOneForSelectionEmitter = new EventEmitter<boolean>();
|
|
109
|
+
@Output() selectLastOneAfterMouseUpEmitter = new EventEmitter<boolean>();
|
|
110
|
+
@Output() onDatePasteEmitter = new EventEmitter<ClipboardEvent>();
|
|
111
|
+
@Output() onFocusEmitter = new EventEmitter<FocusEvent>();
|
|
112
|
+
@Output() changeSelectionEmmiter = new EventEmitter<{
|
|
113
|
+
e: KeyboardEvent;
|
|
114
|
+
noPreventDefault: boolean;
|
|
115
|
+
}>();
|
|
116
|
+
@Output() setSelectionEmmiter = new EventEmitter<{
|
|
117
|
+
preventDefault: () => void;
|
|
118
|
+
stopPropagation: () => void;
|
|
119
|
+
target: any;
|
|
120
|
+
}>();
|
|
121
|
+
|
|
122
|
+
// View Children
|
|
123
|
+
@ViewChild('span1', { static: true }) span1!: ElementRef;
|
|
124
|
+
@ViewChild('span2', { static: true }) span2!: ElementRef;
|
|
125
|
+
@ViewChild('span3', { static: true }) span3!: ElementRef;
|
|
126
|
+
@ViewChild('holder1', { static: true }) holder1!: ElementRef;
|
|
127
|
+
@ViewChild('closeTooltip') closeTooltip!: NgbTooltip;
|
|
128
|
+
|
|
129
|
+
// Private
|
|
130
|
+
private destroy$: Subject<void> = new Subject<void>();
|
|
131
|
+
|
|
132
|
+
constructor(
|
|
133
|
+
@Self() public superControl: NgControl,
|
|
134
|
+
private calendarService: CalendarDateTimePickerService,
|
|
135
|
+
) {
|
|
136
|
+
this.superControl.valueAccessor = this;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
ngOnInit(): void {}
|
|
140
|
+
|
|
141
|
+
// Control Value Accessor
|
|
142
|
+
public registerOnChange(fn: any): void {
|
|
143
|
+
this.onChange = fn;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
public isPopoverShown: boolean = false;
|
|
147
|
+
|
|
148
|
+
public onChange(_: InputChangeValue): void {}
|
|
149
|
+
|
|
150
|
+
public onTouched = (): void => {};
|
|
151
|
+
|
|
152
|
+
public writeValue(obj: InputChangeValue): void {
|
|
153
|
+
if (obj) this.setTimeDateInput(obj, true);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
public registerOnTouched(fn: () => void): void {
|
|
157
|
+
this.onTouched = fn;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
public blurInput(): void {
|
|
161
|
+
this.isFocusInput = false;
|
|
162
|
+
this.isPopoverShown = false;
|
|
163
|
+
this.t2.close();
|
|
164
|
+
this.onTouched();
|
|
165
|
+
this.blurInputEvent.emit(true);
|
|
166
|
+
// Datepicker
|
|
167
|
+
this.focusBlur = setTimeout(() => {
|
|
168
|
+
this.blurOnDateTime();
|
|
169
|
+
}, 0);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
public preventInput(event: Event): void {
|
|
173
|
+
// Prevent any text from appearing in the contenteditable div
|
|
174
|
+
event.preventDefault();
|
|
175
|
+
// Clear any content that might have been added
|
|
176
|
+
if (this.holder1?.nativeElement) {
|
|
177
|
+
this.holder1.nativeElement.textContent = '';
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
public ngAfterViewInit(): void {
|
|
182
|
+
if (this.valueAfterWriteValue) {
|
|
183
|
+
this.setTimeDateInput(this.valueAfterWriteValue);
|
|
184
|
+
} else {
|
|
185
|
+
this.setTimePickerTime();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
this.calendarService.dateChanged
|
|
189
|
+
.pipe(takeUntil(this.destroy$))
|
|
190
|
+
.subscribe((date) => {
|
|
191
|
+
if (!this.inputConfig.isDisabled) {
|
|
192
|
+
this.setTimeDateInput(date);
|
|
193
|
+
this.t2.close();
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
get getSuperControl() {
|
|
199
|
+
return this.superControl.control;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
get isRequired() {
|
|
203
|
+
return this.getSuperControl?.hasValidator(Validators.required);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// 05/05/2025
|
|
207
|
+
public onDatePaste(event: ClipboardEvent): void {
|
|
208
|
+
event.preventDefault();
|
|
209
|
+
|
|
210
|
+
const pasteText = event.clipboardData?.getData('text')?.trim() as string;
|
|
211
|
+
this.processPastedDate(pasteText);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
private processPastedDate(pasteText: string): void {
|
|
215
|
+
// Only process if it's a date picker (not time picker)
|
|
216
|
+
if (
|
|
217
|
+
this.inputConfig.name !== InputConfigNameStringEnum.DATE_PICKER &&
|
|
218
|
+
this.inputConfig.name !==
|
|
219
|
+
InputConfigNameStringEnum.DATE_PICKER_BANK_CARD &&
|
|
220
|
+
this.isFocusInput
|
|
221
|
+
) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Try to parse mm/dd/yy format first
|
|
226
|
+
const mmddyyRegex = /^(\d{1,2})\/(\d{1,2})\/(\d{2,4})$/;
|
|
227
|
+
const match = pasteText.match(mmddyyRegex);
|
|
228
|
+
|
|
229
|
+
if (match) {
|
|
230
|
+
const [_, month, day, year] = match;
|
|
231
|
+
|
|
232
|
+
// Convert 2-digit year to 4-digit year
|
|
233
|
+
let fullYear = parseInt(year);
|
|
234
|
+
if (year.length === 2) {
|
|
235
|
+
// Years 00-31 are 2000-2031, years 32-99 are 1932-1999
|
|
236
|
+
fullYear =
|
|
237
|
+
parseInt(year) > 31 ? 1900 + parseInt(year) : 2000 + parseInt(year);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Create date object (month is 0-indexed in JS)
|
|
241
|
+
const pastedDate = new Date(fullYear, parseInt(month) - 1, parseInt(day));
|
|
242
|
+
|
|
243
|
+
// Validate the date is valid
|
|
244
|
+
if (
|
|
245
|
+
!isNaN(pastedDate.getTime()) &&
|
|
246
|
+
pastedDate.getMonth() === parseInt(month) - 1 &&
|
|
247
|
+
pastedDate.getDate() === parseInt(day)
|
|
248
|
+
) {
|
|
249
|
+
this.setTimeDateInput(pastedDate);
|
|
250
|
+
this.selectSpanByTabIndex(this.selectionInput);
|
|
251
|
+
this.t2.close();
|
|
252
|
+
this.blurInputEvent.emit(true);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
changeSelection(e: any, noPreventDefault = false): void {
|
|
258
|
+
const isPasting = (e.ctrlKey || e.metaKey) && e.key?.toLowerCase() === 'v';
|
|
259
|
+
|
|
260
|
+
if (e.key === 'Escape') {
|
|
261
|
+
this.justEnteredDatePicker = false;
|
|
262
|
+
this.holder1.nativeElement.blur();
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (isPasting) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Tab is 9
|
|
271
|
+
if (
|
|
272
|
+
e.keyCode == 37 ||
|
|
273
|
+
e.keyCode == 38 ||
|
|
274
|
+
e.keyCode == 39 ||
|
|
275
|
+
e.keyCode == 40 ||
|
|
276
|
+
e.keyCode == 8 ||
|
|
277
|
+
e.keyCode == 9 ||
|
|
278
|
+
e.keyCode == 46 ||
|
|
279
|
+
(this.selectionInput == 3 && this.inputConfig.name === 'timepicker')
|
|
280
|
+
) {
|
|
281
|
+
// Determine the last selectable segment index based on input type
|
|
282
|
+
const lastSegmentIndex =
|
|
283
|
+
this.inputConfig.name === 'datepickerBankCard' ? 1 : 2;
|
|
284
|
+
|
|
285
|
+
// Check if Tab/Shift+Tab should be allowed to navigate away
|
|
286
|
+
const isTabAtEnd =
|
|
287
|
+
e.keyCode == 9 &&
|
|
288
|
+
!e.shiftKey &&
|
|
289
|
+
this.selectionInput == lastSegmentIndex;
|
|
290
|
+
const isShiftTabAtStart =
|
|
291
|
+
e.keyCode == 9 && e.shiftKey && this.selectionInput == 0;
|
|
292
|
+
const shouldAllowTabNavigation = isTabAtEnd || isShiftTabAtStart;
|
|
293
|
+
|
|
294
|
+
// Prevent default and stop propagation unless we're allowing tab navigation
|
|
295
|
+
if (!shouldAllowTabNavigation) {
|
|
296
|
+
!e.noPrevent && e.preventDefault();
|
|
297
|
+
e.stopPropagation();
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
if (e.keyCode == 37) {
|
|
301
|
+
this.selectionInput =
|
|
302
|
+
this.selectionInput <= 0 ? 0 : this.selectionInput - 1;
|
|
303
|
+
this.selectSpanByTabIndex(this.selectionInput, true);
|
|
304
|
+
} else if (e.keyCode == 39 || e.keyCode == 9) {
|
|
305
|
+
if (
|
|
306
|
+
((this.inputConfig.name === 'datepickerBankCard' &&
|
|
307
|
+
this.selectionInput != 1) ||
|
|
308
|
+
(this.inputConfig.name !== 'datepickerBankCard' &&
|
|
309
|
+
this.selectionInput != 2)) &&
|
|
310
|
+
!e.shiftKey
|
|
311
|
+
) {
|
|
312
|
+
this.selectionInput = this.selectionInput + 1;
|
|
313
|
+
this.selectSpanByTabIndex(this.selectionInput, true);
|
|
314
|
+
} else if (e.keyCode == 9 && !e.shiftKey) {
|
|
315
|
+
// Tab at the end - reset selection and allow default navigation
|
|
316
|
+
this.selectionInput = -1;
|
|
317
|
+
} else if (e.shiftKey && e.keyCode == 9 && this.selectionInput != 0) {
|
|
318
|
+
if (this.selectionInput == -1) {
|
|
319
|
+
this.selectionInput = 3;
|
|
320
|
+
}
|
|
321
|
+
this.selectionInput = this.selectionInput - 1;
|
|
322
|
+
this.selectSpanByTabIndex(this.selectionInput);
|
|
323
|
+
} else if (e.shiftKey && e.keyCode == 9 && this.selectionInput == 0) {
|
|
324
|
+
// Shift+Tab at the start - reset selection and allow default navigation
|
|
325
|
+
this.selectionInput = -1;
|
|
326
|
+
}
|
|
327
|
+
} else if (e.keyCode == 38) {
|
|
328
|
+
this.setDateTimeModel('up');
|
|
329
|
+
} else if (e.keyCode == 40) {
|
|
330
|
+
this.setDateTimeModel('down');
|
|
331
|
+
} else if (e.keyCode == 8 || e.keyCode == 46) {
|
|
332
|
+
this.handleKeyboardInputs(e, true);
|
|
333
|
+
}
|
|
334
|
+
} else if (!this.isNumber(e)) {
|
|
335
|
+
if (!noPreventDefault) {
|
|
336
|
+
e.preventDefault();
|
|
337
|
+
e.stopPropagation();
|
|
338
|
+
}
|
|
339
|
+
} else {
|
|
340
|
+
if (!noPreventDefault) {
|
|
341
|
+
e.preventDefault();
|
|
342
|
+
e.stopPropagation();
|
|
343
|
+
}
|
|
344
|
+
if (this.selectionInput == -1) {
|
|
345
|
+
this.selectionInput = 0;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
this.handleKeyboardInputs(e);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
public changeSelectionTwo(
|
|
353
|
+
event: KeyboardEvent,
|
|
354
|
+
noPreventDefault = false,
|
|
355
|
+
): void {
|
|
356
|
+
if (!noPreventDefault) {
|
|
357
|
+
event.preventDefault();
|
|
358
|
+
event.stopPropagation();
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
const isNavigationKey = this.isNavigationKey(event);
|
|
362
|
+
const isSpecialTimePickerKey =
|
|
363
|
+
this.selectionInput === 3 &&
|
|
364
|
+
this.inputConfig.name === InputConfigNameStringEnum.TIME_PICKER;
|
|
365
|
+
|
|
366
|
+
if (isNavigationKey || isSpecialTimePickerKey) {
|
|
367
|
+
event.preventDefault();
|
|
368
|
+
this.handleNavigationKey(event);
|
|
369
|
+
} else if (!this.isNumber(event)) {
|
|
370
|
+
if (!noPreventDefault) event.preventDefault();
|
|
371
|
+
else {
|
|
372
|
+
if (!noPreventDefault) event.preventDefault();
|
|
373
|
+
|
|
374
|
+
if (this.selectionInput === -1) this.selectionInput = 0;
|
|
375
|
+
this.handleKeyboardInputs(event);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
private isNumber(evt: KeyboardEvent): boolean {
|
|
381
|
+
evt = evt ? evt : (window.event as KeyboardEvent);
|
|
382
|
+
let charCode = evt.which ? evt.which : evt.keyCode;
|
|
383
|
+
return (
|
|
384
|
+
(charCode >= 48 && charCode <= 57) || (charCode >= 96 && charCode <= 105)
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
private isNavigationKey(e: KeyboardEvent): boolean {
|
|
389
|
+
const navigationKeys = [37, 38, 39, 40, 8, 9, 46]; // Arrow keys, Backspace, Tab, Delete
|
|
390
|
+
return navigationKeys.includes(e.keyCode);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
public onFocus(event?: FocusEvent): void {
|
|
394
|
+
this.onFocusEmitter.emit(event);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
public closePopover(date: Date): void {
|
|
398
|
+
if (date) {
|
|
399
|
+
this.setTimeDateInput(date);
|
|
400
|
+
}
|
|
401
|
+
this.t2?.close();
|
|
402
|
+
this.blurInputEvent.emit(true);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
public handleFocusInput(e: Event) {
|
|
406
|
+
const event = e as FocusEvent;
|
|
407
|
+
|
|
408
|
+
if (!this.isDisabled()) {
|
|
409
|
+
clearTimeout(this.dateTimeMainTimer);
|
|
410
|
+
clearTimeout(this.focusBlur);
|
|
411
|
+
this.showDateInput = true;
|
|
412
|
+
if (
|
|
413
|
+
(this.selectionInput === -1 &&
|
|
414
|
+
(event?.target as HTMLElement)?.nodeName === 'INPUT') ||
|
|
415
|
+
(event?.relatedTarget as HTMLElement)?.nodeName === 'INPUT' ||
|
|
416
|
+
event?.relatedTarget === null
|
|
417
|
+
) {
|
|
418
|
+
this.preventBlur = true;
|
|
419
|
+
this.holder1.nativeElement.focus();
|
|
420
|
+
this.setSpanSelection(this.holder1.nativeElement);
|
|
421
|
+
this.selectionInput = -1;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
this.t2.toggle();
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
public setSpanSelection(element: Node): void {
|
|
429
|
+
let range: Range;
|
|
430
|
+
let selection: Selection | null;
|
|
431
|
+
|
|
432
|
+
if (window.getSelection && document.createRange) {
|
|
433
|
+
selection = window.getSelection();
|
|
434
|
+
range = document.createRange();
|
|
435
|
+
range.selectNodeContents(element);
|
|
436
|
+
selection?.removeAllRanges();
|
|
437
|
+
selection?.addRange(range);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
public setSelection(event: {
|
|
442
|
+
preventDefault: () => void;
|
|
443
|
+
stopPropagation: () => void;
|
|
444
|
+
target: any;
|
|
445
|
+
}): void {
|
|
446
|
+
const element = event.target;
|
|
447
|
+
|
|
448
|
+
const selectionInput = parseInt(element.getAttribute('tabindex'));
|
|
449
|
+
|
|
450
|
+
const currentSelection = window.getSelection();
|
|
451
|
+
|
|
452
|
+
if (currentSelection && currentSelection.toString().length > 10) {
|
|
453
|
+
this.holder1.nativeElement.focus();
|
|
454
|
+
this.selectionInput = 0;
|
|
455
|
+
this.setSpanSelection(this.holder1.nativeElement);
|
|
456
|
+
clearTimeout(this.dateTimeMainTimer);
|
|
457
|
+
clearTimeout(this.focusBlur);
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
clearTimeout(this.dateTimeMainTimer);
|
|
462
|
+
if (element.classList.contains('main')) {
|
|
463
|
+
this.selectionInput = selectionInput;
|
|
464
|
+
this.setSpanSelection(element);
|
|
465
|
+
} else {
|
|
466
|
+
if (this.selectionInput === -1) {
|
|
467
|
+
this.holder1.nativeElement.focus();
|
|
468
|
+
this.selectionInput = 0;
|
|
469
|
+
this.setSpanSelection(this.span1.nativeElement);
|
|
470
|
+
} else {
|
|
471
|
+
event.preventDefault();
|
|
472
|
+
this.selectSpanByTabIndex(this.selectionInput);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// BLUR ON INPUT
|
|
478
|
+
public blurOnDateTime(): void {
|
|
479
|
+
clearTimeout(this.dateTimeMainTimer);
|
|
480
|
+
this.dateTimeMainTimer = setTimeout(() => {
|
|
481
|
+
if (this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER) {
|
|
482
|
+
if (
|
|
483
|
+
!isNaN(this.span1?.nativeElement.innerHTML) &&
|
|
484
|
+
!isNaN(this.span2?.nativeElement.innerHTML) &&
|
|
485
|
+
!isNaN(this.span3?.nativeElement.innerHTML)
|
|
486
|
+
) {
|
|
487
|
+
this.calendarService.dateChanged.next(this.dateTimeInputDate);
|
|
488
|
+
|
|
489
|
+
if (this.justEnteredDatePicker) {
|
|
490
|
+
requestAnimationFrame(() => {
|
|
491
|
+
KeyboardNavigationHelper.focusNextInput(this.holder1);
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
this.justEnteredDatePicker = false;
|
|
495
|
+
} else {
|
|
496
|
+
this.span1.nativeElement.innerHTML = 'mm';
|
|
497
|
+
this.span2.nativeElement.innerHTML = 'dd';
|
|
498
|
+
this.span3.nativeElement.innerHTML = 'yy';
|
|
499
|
+
this.dateTimeInputDate = new Date();
|
|
500
|
+
this.showDateInput = false;
|
|
501
|
+
this.clearInput();
|
|
502
|
+
this.justEnteredDatePicker = false;
|
|
503
|
+
}
|
|
504
|
+
} else if (
|
|
505
|
+
this.inputConfig.name ===
|
|
506
|
+
InputConfigNameStringEnum.DATE_PICKER_BANK_CARD
|
|
507
|
+
) {
|
|
508
|
+
if (
|
|
509
|
+
!isNaN(this.span1.nativeElement.innerHTML) &&
|
|
510
|
+
!isNaN(this.span2.nativeElement.innerHTML)
|
|
511
|
+
) {
|
|
512
|
+
this.calendarService.dateChanged.next(this.dateTimeInputDate);
|
|
513
|
+
if (this.justEnteredDatePicker) {
|
|
514
|
+
requestAnimationFrame(() => {
|
|
515
|
+
KeyboardNavigationHelper.focusNextInput(this.holder1);
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
this.justEnteredDatePicker = false;
|
|
519
|
+
} else {
|
|
520
|
+
this.span1.nativeElement.innerHTML = 'mm';
|
|
521
|
+
this.span2.nativeElement.innerHTML = 'yy';
|
|
522
|
+
this.dateTimeInputDate = new Date();
|
|
523
|
+
this.showDateInput = false;
|
|
524
|
+
this.clearInput();
|
|
525
|
+
this.justEnteredDatePicker = false;
|
|
526
|
+
}
|
|
527
|
+
} else {
|
|
528
|
+
if (
|
|
529
|
+
!isNaN(this.span1.nativeElement.innerHTML) &&
|
|
530
|
+
!isNaN(this.span2.nativeElement.innerHTML)
|
|
531
|
+
) {
|
|
532
|
+
this.calendarService.dateChanged.next(this.dateTimeInputDate);
|
|
533
|
+
if (this.justEnteredDatePicker) {
|
|
534
|
+
requestAnimationFrame(() => {
|
|
535
|
+
KeyboardNavigationHelper.focusNextInput(this.holder1);
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
this.justEnteredDatePicker = false;
|
|
539
|
+
} else {
|
|
540
|
+
this.span1.nativeElement.innerHTML = 'HH';
|
|
541
|
+
this.span2.nativeElement.innerHTML = 'MM';
|
|
542
|
+
this.setTimePickerTime();
|
|
543
|
+
this.showDateInput = false;
|
|
544
|
+
this.clearInput();
|
|
545
|
+
this.justEnteredDatePicker = false;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
// Clear the timer reference after it's executed
|
|
550
|
+
this.dateTimeMainTimer = 0;
|
|
551
|
+
this.selectionInput = -1;
|
|
552
|
+
this.newInputChanged = true;
|
|
553
|
+
}, 0);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
public onEditableFocus(event: FocusEvent): void {
|
|
557
|
+
if (this.isDisabled()) {
|
|
558
|
+
event.preventDefault();
|
|
559
|
+
event.stopPropagation();
|
|
560
|
+
|
|
561
|
+
this.holder1.nativeElement.blur();
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
event.preventDefault();
|
|
566
|
+
event.stopPropagation();
|
|
567
|
+
|
|
568
|
+
if (this.isFocusInput) return;
|
|
569
|
+
|
|
570
|
+
this.onPopoverClick();
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
public onPopoverClick(event?: MouseEvent): void {
|
|
574
|
+
if (this.isDisabled()) return;
|
|
575
|
+
|
|
576
|
+
if (event) {
|
|
577
|
+
event.preventDefault();
|
|
578
|
+
event.stopPropagation();
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
this.isFocusInput = true;
|
|
582
|
+
clearTimeout(this.dateTimeMainTimer);
|
|
583
|
+
clearTimeout(this.focusBlur);
|
|
584
|
+
this.holder1.nativeElement.focus();
|
|
585
|
+
this.selectionInput = -1;
|
|
586
|
+
this.setSpanSelection(this.holder1.nativeElement);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
public onPopoverShown(): void {
|
|
590
|
+
this.isPopoverShown = true;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
public onPopoverHidden(): void {
|
|
594
|
+
this.isPopoverShown = false;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
public setTimeDateInput(date: InputChangeValue, hasValue?: boolean): void {
|
|
598
|
+
let text, dateFormat, timeFormat;
|
|
599
|
+
if (this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER) {
|
|
600
|
+
text = moment(new Date(date)).format('MM/DD/YY');
|
|
601
|
+
dateFormat = text.split('/');
|
|
602
|
+
} else if (
|
|
603
|
+
this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER_BANK_CARD
|
|
604
|
+
) {
|
|
605
|
+
text = moment(new Date(date)).format('MM/DD/YY');
|
|
606
|
+
dateFormat = text.split('/');
|
|
607
|
+
} else {
|
|
608
|
+
date =
|
|
609
|
+
date instanceof Date
|
|
610
|
+
? date
|
|
611
|
+
: new Date(moment().format('MM/DD/YYYY') + ' ' + date);
|
|
612
|
+
text = moment(new Date(date)).format('HH:mm');
|
|
613
|
+
|
|
614
|
+
timeFormat = moment(new Date(date)).format('hh/mm/A');
|
|
615
|
+
dateFormat = timeFormat.split('/');
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
if (this.formFormat) {
|
|
619
|
+
const newFormFormat = moment(new Date(date)).format(this.formFormat);
|
|
620
|
+
this.valueAfterWriteValue = newFormFormat;
|
|
621
|
+
text = newFormFormat;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// When called from writeValue, always store the value to prevent reset in ngAfterViewInit
|
|
625
|
+
if (hasValue && !this.valueAfterWriteValue) {
|
|
626
|
+
this.valueAfterWriteValue = text;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
if (!hasValue) {
|
|
630
|
+
this.onChange(text);
|
|
631
|
+
// Mark as touched when user changes the value
|
|
632
|
+
this.markAsTouched();
|
|
633
|
+
}
|
|
634
|
+
this.setIsFocusInput(false);
|
|
635
|
+
|
|
636
|
+
// HAS TO BE IN TIMEOUT BECAUSE OF ANGULAR STACK
|
|
637
|
+
setTimeout(() => {
|
|
638
|
+
if (this.span1) this.span1.nativeElement.innerHTML = dateFormat[0];
|
|
639
|
+
|
|
640
|
+
if (this.span2)
|
|
641
|
+
if (
|
|
642
|
+
this.inputConfig.name !==
|
|
643
|
+
InputConfigNameStringEnum.DATE_PICKER_BANK_CARD
|
|
644
|
+
) {
|
|
645
|
+
this.span2.nativeElement.innerHTML = dateFormat[1];
|
|
646
|
+
this.span3.nativeElement.innerHTML = dateFormat[2];
|
|
647
|
+
} else {
|
|
648
|
+
this.span2.nativeElement.innerHTML = dateFormat[2];
|
|
649
|
+
}
|
|
650
|
+
}, 0);
|
|
651
|
+
|
|
652
|
+
if (date) {
|
|
653
|
+
this.dateTimeInputDate = new Date(date);
|
|
654
|
+
}
|
|
655
|
+
this.showDateInput = true;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
private markAsTouched(): void {
|
|
659
|
+
if (this.getSuperControl && !this.getSuperControl.touched) {
|
|
660
|
+
this.onTouched();
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
public handleKeyboardInputs(e: KeyboardEvent, isRestart?: boolean): void {
|
|
665
|
+
const spanOneValue: number | undefined =
|
|
666
|
+
isNaN(this.span1.nativeElement.innerHTML) || this.newInputChanged
|
|
667
|
+
? undefined
|
|
668
|
+
: parseInt(this.span1.nativeElement.innerHTML);
|
|
669
|
+
const span2Value: number | undefined =
|
|
670
|
+
isNaN(this.span2.nativeElement.innerHTML) || this.newInputChanged
|
|
671
|
+
? undefined
|
|
672
|
+
: parseInt(this.span2.nativeElement.innerHTML);
|
|
673
|
+
|
|
674
|
+
let span3Value: string | number | undefined;
|
|
675
|
+
|
|
676
|
+
if (
|
|
677
|
+
this.inputConfig.name !== InputConfigNameStringEnum.DATE_PICKER_BANK_CARD
|
|
678
|
+
) {
|
|
679
|
+
span3Value =
|
|
680
|
+
isNaN(this.span3.nativeElement.innerHTML) || this.newInputChanged
|
|
681
|
+
? ''
|
|
682
|
+
: parseInt(this.span3.nativeElement.innerHTML);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
this.newInputChanged = false;
|
|
686
|
+
if (this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER) {
|
|
687
|
+
if (this.selectionInput === 0) {
|
|
688
|
+
if (isRestart) {
|
|
689
|
+
this.span1.nativeElement.innerHTML = 'mm';
|
|
690
|
+
this.selectionInput = 0;
|
|
691
|
+
this.selectSpanByTabIndex(0);
|
|
692
|
+
} else {
|
|
693
|
+
const currentValue = this.span1.nativeElement.innerHTML;
|
|
694
|
+
const isPlaceholder = currentValue === 'mm';
|
|
695
|
+
const hasOneDigit =
|
|
696
|
+
!isPlaceholder &&
|
|
697
|
+
currentValue.length === 2 &&
|
|
698
|
+
currentValue[1] === 'm';
|
|
699
|
+
|
|
700
|
+
if (isPlaceholder) {
|
|
701
|
+
// First digit: show as "Xm"
|
|
702
|
+
const keyValue = e.key;
|
|
703
|
+
|
|
704
|
+
if (keyValue >= '0' && keyValue <= '9') {
|
|
705
|
+
this.span1.nativeElement.innerHTML = keyValue + 'm';
|
|
706
|
+
|
|
707
|
+
if (parseInt(keyValue) > 1) {
|
|
708
|
+
// Auto-advance for 2-9 since they can only be single digit months
|
|
709
|
+
this.dateTimeInputDate = new Date(
|
|
710
|
+
this.dateTimeInputDate.setMonth(parseInt(keyValue) - 1),
|
|
711
|
+
);
|
|
712
|
+
this.selectionInput = 1;
|
|
713
|
+
this.selectSpanByTabIndex(1, true);
|
|
714
|
+
} else {
|
|
715
|
+
this.selectionInput = 0;
|
|
716
|
+
this.selectSpanByTabIndex(0);
|
|
717
|
+
}
|
|
718
|
+
this.markAsTouched();
|
|
719
|
+
}
|
|
720
|
+
} else if (hasOneDigit) {
|
|
721
|
+
// Second digit: combine with first digit
|
|
722
|
+
const firstDigit = currentValue[0];
|
|
723
|
+
const final_value = parseInt(firstDigit + e.key);
|
|
724
|
+
|
|
725
|
+
if (final_value > 12 || final_value === 0) {
|
|
726
|
+
// Invalid, restart with new digit
|
|
727
|
+
this.span1.nativeElement.innerHTML = e.key + 'm';
|
|
728
|
+
if (parseInt(e.key) > 1) {
|
|
729
|
+
this.dateTimeInputDate = new Date(
|
|
730
|
+
this.dateTimeInputDate.setMonth(parseInt(e.key) - 1),
|
|
731
|
+
);
|
|
732
|
+
this.selectionInput = 1;
|
|
733
|
+
this.selectSpanByTabIndex(1, true);
|
|
734
|
+
} else {
|
|
735
|
+
this.selectionInput = 0;
|
|
736
|
+
this.selectSpanByTabIndex(0);
|
|
737
|
+
}
|
|
738
|
+
} else {
|
|
739
|
+
this.dateTimeInputDate = new Date(
|
|
740
|
+
this.dateTimeInputDate.setMonth(final_value - 1),
|
|
741
|
+
);
|
|
742
|
+
|
|
743
|
+
this.span1.nativeElement.innerHTML = ('0' + final_value).slice(
|
|
744
|
+
-2,
|
|
745
|
+
);
|
|
746
|
+
|
|
747
|
+
this.selectionInput = 1;
|
|
748
|
+
this.selectSpanByTabIndex(1, true);
|
|
749
|
+
this.markAsTouched();
|
|
750
|
+
}
|
|
751
|
+
} else {
|
|
752
|
+
// Complete value exists, restart
|
|
753
|
+
const keyValue = e.key;
|
|
754
|
+
this.span1.nativeElement.innerHTML = keyValue + 'm';
|
|
755
|
+
|
|
756
|
+
if (parseInt(keyValue) > 1) {
|
|
757
|
+
this.dateTimeInputDate = new Date(
|
|
758
|
+
this.dateTimeInputDate.setMonth(parseInt(keyValue) - 1),
|
|
759
|
+
);
|
|
760
|
+
this.selectionInput = 1;
|
|
761
|
+
this.selectSpanByTabIndex(1, true);
|
|
762
|
+
} else {
|
|
763
|
+
this.selectionInput = 0;
|
|
764
|
+
this.selectSpanByTabIndex(0);
|
|
765
|
+
}
|
|
766
|
+
this.markAsTouched();
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
} else if (this.selectionInput === 1) {
|
|
770
|
+
if (isRestart) {
|
|
771
|
+
this.span2.nativeElement.innerHTML = 'dd';
|
|
772
|
+
this.selectionInput = 0;
|
|
773
|
+
this.selectSpanByTabIndex(0, true);
|
|
774
|
+
} else {
|
|
775
|
+
const currentValue = this.span2.nativeElement.innerHTML;
|
|
776
|
+
const isPlaceholder = currentValue === 'dd';
|
|
777
|
+
const hasOneDigit =
|
|
778
|
+
!isPlaceholder &&
|
|
779
|
+
currentValue.length === 2 &&
|
|
780
|
+
currentValue[1] === 'd';
|
|
781
|
+
|
|
782
|
+
if (isPlaceholder) {
|
|
783
|
+
// First digit: show as "Xd"
|
|
784
|
+
const keyValue = e.key;
|
|
785
|
+
|
|
786
|
+
if (keyValue >= '0' && keyValue <= '9') {
|
|
787
|
+
this.span2.nativeElement.innerHTML = keyValue + 'd';
|
|
788
|
+
|
|
789
|
+
if (parseInt(keyValue) > 3) {
|
|
790
|
+
// Auto-advance for 4-9 since they can only be single digit days
|
|
791
|
+
this.dateTimeInputDate = new Date(
|
|
792
|
+
this.dateTimeInputDate.setDate(parseInt(keyValue)),
|
|
793
|
+
);
|
|
794
|
+
this.selectionInput = 2;
|
|
795
|
+
this.selectSpanByTabIndex(2, true);
|
|
796
|
+
} else {
|
|
797
|
+
this.selectSpanByTabIndex(1);
|
|
798
|
+
}
|
|
799
|
+
this.markAsTouched();
|
|
800
|
+
}
|
|
801
|
+
} else if (hasOneDigit) {
|
|
802
|
+
// Second digit: combine with first digit
|
|
803
|
+
const firstDigit = currentValue[0];
|
|
804
|
+
const final_value = parseInt(firstDigit + e.key);
|
|
805
|
+
|
|
806
|
+
if (final_value > 31 || final_value === 0) {
|
|
807
|
+
// Invalid, restart with new digit
|
|
808
|
+
this.span2.nativeElement.innerHTML = e.key + 'd';
|
|
809
|
+
if (parseInt(e.key) > 3) {
|
|
810
|
+
this.dateTimeInputDate = new Date(
|
|
811
|
+
this.dateTimeInputDate.setDate(parseInt(e.key)),
|
|
812
|
+
);
|
|
813
|
+
this.selectionInput = 2;
|
|
814
|
+
this.selectSpanByTabIndex(2, true);
|
|
815
|
+
} else {
|
|
816
|
+
this.selectSpanByTabIndex(1);
|
|
817
|
+
}
|
|
818
|
+
this.markAsTouched();
|
|
819
|
+
} else {
|
|
820
|
+
this.dateTimeInputDate = new Date(
|
|
821
|
+
this.dateTimeInputDate.setDate(final_value),
|
|
822
|
+
);
|
|
823
|
+
|
|
824
|
+
this.span2.nativeElement.innerHTML = ('0' + final_value).slice(
|
|
825
|
+
-2,
|
|
826
|
+
);
|
|
827
|
+
|
|
828
|
+
this.selectionInput = 2;
|
|
829
|
+
this.selectSpanByTabIndex(2, true);
|
|
830
|
+
}
|
|
831
|
+
} else {
|
|
832
|
+
// Complete value exists, restart
|
|
833
|
+
const keyValue = e.key;
|
|
834
|
+
this.span2.nativeElement.innerHTML = keyValue + 'd';
|
|
835
|
+
|
|
836
|
+
if (parseInt(keyValue) > 3) {
|
|
837
|
+
this.dateTimeInputDate = new Date(
|
|
838
|
+
this.dateTimeInputDate.setDate(parseInt(keyValue)),
|
|
839
|
+
);
|
|
840
|
+
this.selectionInput = 2;
|
|
841
|
+
this.selectSpanByTabIndex(2, true);
|
|
842
|
+
} else {
|
|
843
|
+
this.selectSpanByTabIndex(1);
|
|
844
|
+
}
|
|
845
|
+
this.markAsTouched();
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
} else {
|
|
849
|
+
if (isRestart) {
|
|
850
|
+
this.span3.nativeElement.innerHTML = 'yy';
|
|
851
|
+
this.selectionInput = 1;
|
|
852
|
+
this.selectSpanByTabIndex(1, true);
|
|
853
|
+
} else {
|
|
854
|
+
const currentValue = this.span3.nativeElement.innerHTML;
|
|
855
|
+
const isPlaceholder = currentValue === 'yy';
|
|
856
|
+
const hasOneDigit =
|
|
857
|
+
!isPlaceholder &&
|
|
858
|
+
currentValue.length === 2 &&
|
|
859
|
+
currentValue[1] === 'y';
|
|
860
|
+
|
|
861
|
+
if (isPlaceholder) {
|
|
862
|
+
// First digit: show as "Xy"
|
|
863
|
+
const keyValue = e.key;
|
|
864
|
+
this.span3.nativeElement.innerHTML = keyValue + 'y';
|
|
865
|
+
this.selectSpanByTabIndex(2);
|
|
866
|
+
} else if (hasOneDigit) {
|
|
867
|
+
// Second digit: combine with first digit
|
|
868
|
+
const firstDigit = currentValue[0];
|
|
869
|
+
const finalYear = parseInt(firstDigit + e.key);
|
|
870
|
+
|
|
871
|
+
const finalShowYear =
|
|
872
|
+
finalYear > 31
|
|
873
|
+
? parseInt(`19${finalYear}`)
|
|
874
|
+
: parseInt(`20${finalYear}`);
|
|
875
|
+
this.dateTimeInputDate = new Date(
|
|
876
|
+
this.dateTimeInputDate.setFullYear(finalShowYear),
|
|
877
|
+
);
|
|
878
|
+
|
|
879
|
+
this.span3.nativeElement.innerHTML = ('0' + finalYear).slice(-2);
|
|
880
|
+
this.selectSpanByTabIndex(2);
|
|
881
|
+
this.markAsTouched();
|
|
882
|
+
|
|
883
|
+
this.justEnteredDatePicker = true;
|
|
884
|
+
this.blurOnDateTime();
|
|
885
|
+
} else {
|
|
886
|
+
// Complete value exists, restart
|
|
887
|
+
const keyValue = e.key;
|
|
888
|
+
this.span3.nativeElement.innerHTML = keyValue + 'y';
|
|
889
|
+
this.selectSpanByTabIndex(2);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
} else if (
|
|
894
|
+
this.inputConfig.name === InputConfigNameStringEnum.TIME_PICKER &&
|
|
895
|
+
!this.inputConfig.preventTyping
|
|
896
|
+
) {
|
|
897
|
+
// Handle time picker keyboard input
|
|
898
|
+
if (this.selectionInput === 0) {
|
|
899
|
+
// Hours input
|
|
900
|
+
if (isRestart) {
|
|
901
|
+
this.span1.nativeElement.innerHTML = 'HH';
|
|
902
|
+
this.selectionInput = 0;
|
|
903
|
+
this.selectSpanByTabIndex(0);
|
|
904
|
+
} else {
|
|
905
|
+
const currentValue = this.span1.nativeElement.innerHTML;
|
|
906
|
+
const isPlaceholder = currentValue === 'HH';
|
|
907
|
+
const hasOneDigit =
|
|
908
|
+
!isPlaceholder &&
|
|
909
|
+
currentValue.length === 2 &&
|
|
910
|
+
currentValue[1] === 'H';
|
|
911
|
+
|
|
912
|
+
if (isPlaceholder) {
|
|
913
|
+
// First digit: show as "XH"
|
|
914
|
+
const keyValue = e.key;
|
|
915
|
+
if (keyValue >= '0' && keyValue <= '9') {
|
|
916
|
+
this.span1.nativeElement.innerHTML = keyValue + 'H';
|
|
917
|
+
|
|
918
|
+
if (parseInt(`1${keyValue}`) > 12) {
|
|
919
|
+
this.selectionInput = 1;
|
|
920
|
+
this.selectSpanByTabIndex(1, true);
|
|
921
|
+
} else {
|
|
922
|
+
this.selectionInput = 0;
|
|
923
|
+
this.selectSpanByTabIndex(0);
|
|
924
|
+
}
|
|
925
|
+
this.markAsTouched();
|
|
926
|
+
}
|
|
927
|
+
} else if (hasOneDigit) {
|
|
928
|
+
// Second digit: combine with first digit
|
|
929
|
+
const firstDigit = currentValue[0];
|
|
930
|
+
const final_value = parseInt(firstDigit + e.key);
|
|
931
|
+
|
|
932
|
+
if (final_value > 12 || final_value === 0) {
|
|
933
|
+
this.span1.nativeElement.innerHTML = e.key + 'H';
|
|
934
|
+
this.selectionInput = 1;
|
|
935
|
+
this.selectSpanByTabIndex(1, true);
|
|
936
|
+
} else {
|
|
937
|
+
const currentHour = this.dateTimeInputDate.getHours();
|
|
938
|
+
const isPM = currentHour >= 12;
|
|
939
|
+
const newHour = isPM ? final_value + 12 : final_value;
|
|
940
|
+
|
|
941
|
+
this.dateTimeInputDate = new Date(
|
|
942
|
+
this.dateTimeInputDate.setHours(newHour),
|
|
943
|
+
);
|
|
944
|
+
|
|
945
|
+
this.span1.nativeElement.innerHTML = ('0' + final_value).slice(
|
|
946
|
+
-2,
|
|
947
|
+
);
|
|
948
|
+
this.selectionInput = 1;
|
|
949
|
+
this.selectSpanByTabIndex(1, true);
|
|
950
|
+
this.markAsTouched();
|
|
951
|
+
}
|
|
952
|
+
} else {
|
|
953
|
+
// Complete value exists, restart
|
|
954
|
+
const keyValue = e.key;
|
|
955
|
+
this.span1.nativeElement.innerHTML = keyValue + 'H';
|
|
956
|
+
|
|
957
|
+
if (parseInt(`1${keyValue}`) > 12) {
|
|
958
|
+
this.selectionInput = 1;
|
|
959
|
+
this.selectSpanByTabIndex(1, true);
|
|
960
|
+
} else {
|
|
961
|
+
this.selectionInput = 0;
|
|
962
|
+
this.selectSpanByTabIndex(0);
|
|
963
|
+
}
|
|
964
|
+
this.markAsTouched();
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
} else if (this.selectionInput === 1) {
|
|
968
|
+
// Minutes input
|
|
969
|
+
if (isRestart) {
|
|
970
|
+
this.span2.nativeElement.innerHTML = 'MM';
|
|
971
|
+
this.selectionInput = 0;
|
|
972
|
+
this.selectSpanByTabIndex(0, true);
|
|
973
|
+
} else {
|
|
974
|
+
const currentValue = this.span2.nativeElement.innerHTML;
|
|
975
|
+
const isPlaceholder = currentValue === 'MM';
|
|
976
|
+
const hasOneDigit =
|
|
977
|
+
!isPlaceholder &&
|
|
978
|
+
currentValue.length === 2 &&
|
|
979
|
+
currentValue[1] === 'M';
|
|
980
|
+
|
|
981
|
+
if (isPlaceholder) {
|
|
982
|
+
// First digit: show as "XM"
|
|
983
|
+
const keyValue = e.key;
|
|
984
|
+
if (keyValue >= '0' && keyValue <= '9') {
|
|
985
|
+
this.span2.nativeElement.innerHTML = keyValue + 'M';
|
|
986
|
+
|
|
987
|
+
if (parseInt(keyValue) > 5) {
|
|
988
|
+
this.selectionInput = 2;
|
|
989
|
+
this.selectSpanByTabIndex(2, true);
|
|
990
|
+
} else {
|
|
991
|
+
this.selectSpanByTabIndex(1);
|
|
992
|
+
}
|
|
993
|
+
this.markAsTouched();
|
|
994
|
+
}
|
|
995
|
+
} else if (hasOneDigit) {
|
|
996
|
+
// Second digit: combine with first digit
|
|
997
|
+
const firstDigit = currentValue[0];
|
|
998
|
+
const final_value = parseInt(firstDigit + e.key);
|
|
999
|
+
|
|
1000
|
+
if (final_value > 59) {
|
|
1001
|
+
this.span2.nativeElement.innerHTML = e.key + 'M';
|
|
1002
|
+
this.selectionInput = 2;
|
|
1003
|
+
this.selectSpanByTabIndex(2, true);
|
|
1004
|
+
} else {
|
|
1005
|
+
this.dateTimeInputDate = new Date(
|
|
1006
|
+
this.dateTimeInputDate.setMinutes(final_value),
|
|
1007
|
+
);
|
|
1008
|
+
|
|
1009
|
+
this.span2.nativeElement.innerHTML = ('0' + final_value).slice(
|
|
1010
|
+
-2,
|
|
1011
|
+
);
|
|
1012
|
+
|
|
1013
|
+
this.selectionInput = 2;
|
|
1014
|
+
this.selectSpanByTabIndex(2, true);
|
|
1015
|
+
this.markAsTouched();
|
|
1016
|
+
}
|
|
1017
|
+
} else {
|
|
1018
|
+
// Complete value exists, restart
|
|
1019
|
+
const keyValue = e.key;
|
|
1020
|
+
this.span2.nativeElement.innerHTML = keyValue + 'M';
|
|
1021
|
+
|
|
1022
|
+
if (parseInt(keyValue) > 5) {
|
|
1023
|
+
this.selectionInput = 2;
|
|
1024
|
+
this.selectSpanByTabIndex(2, true);
|
|
1025
|
+
} else {
|
|
1026
|
+
this.selectSpanByTabIndex(1);
|
|
1027
|
+
}
|
|
1028
|
+
this.markAsTouched();
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
} else if (this.selectionInput === 2) {
|
|
1032
|
+
// AM/PM input
|
|
1033
|
+
if (isRestart) {
|
|
1034
|
+
this.span3.nativeElement.innerHTML = 'AM';
|
|
1035
|
+
this.selectionInput = 0;
|
|
1036
|
+
this.selectSpanByTabIndex(0, true);
|
|
1037
|
+
} else {
|
|
1038
|
+
const currentHour = this.dateTimeInputDate.getHours();
|
|
1039
|
+
const isPM = e.key.toLowerCase() === 'p';
|
|
1040
|
+
|
|
1041
|
+
if (isPM && currentHour < 12) {
|
|
1042
|
+
this.dateTimeInputDate = new Date(
|
|
1043
|
+
this.dateTimeInputDate.setHours(currentHour + 12),
|
|
1044
|
+
);
|
|
1045
|
+
this.span3.nativeElement.innerHTML = 'PM';
|
|
1046
|
+
} else if (!isPM && currentHour >= 12) {
|
|
1047
|
+
this.dateTimeInputDate = new Date(
|
|
1048
|
+
this.dateTimeInputDate.setHours(currentHour - 12),
|
|
1049
|
+
);
|
|
1050
|
+
this.span3.nativeElement.innerHTML = 'AM';
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
this.selectionInput = 0;
|
|
1054
|
+
this.selectSpanByTabIndex(0, true);
|
|
1055
|
+
this.markAsTouched();
|
|
1056
|
+
this.justEnteredDatePicker = true;
|
|
1057
|
+
this.blurOnDateTime();
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
} else if (
|
|
1061
|
+
this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER_BANK_CARD
|
|
1062
|
+
) {
|
|
1063
|
+
if (!this.selectionInput) {
|
|
1064
|
+
if (isRestart) {
|
|
1065
|
+
this.span1.nativeElement.innerHTML = 'mm';
|
|
1066
|
+
this.selectionInput = 0;
|
|
1067
|
+
this.selectSpanByTabIndex(0);
|
|
1068
|
+
} else {
|
|
1069
|
+
const currentValue = this.span1.nativeElement.innerHTML;
|
|
1070
|
+
const isPlaceholder = currentValue === 'mm';
|
|
1071
|
+
const hasOneDigit =
|
|
1072
|
+
!isPlaceholder &&
|
|
1073
|
+
currentValue.length === 2 &&
|
|
1074
|
+
currentValue[1] === 'm';
|
|
1075
|
+
|
|
1076
|
+
if (isPlaceholder) {
|
|
1077
|
+
// First digit: show as "Xm"
|
|
1078
|
+
const keyValue = e.key;
|
|
1079
|
+
|
|
1080
|
+
if (keyValue >= '0' && keyValue <= '9') {
|
|
1081
|
+
this.span1.nativeElement.innerHTML = keyValue + 'm';
|
|
1082
|
+
|
|
1083
|
+
if (parseInt(keyValue) > 1) {
|
|
1084
|
+
// Auto-advance for 2-9 since they can only be single digit months
|
|
1085
|
+
this.dateTimeInputDate = new Date(
|
|
1086
|
+
this.dateTimeInputDate.setMonth(parseInt(keyValue) - 1),
|
|
1087
|
+
);
|
|
1088
|
+
this.selectionInput = 1;
|
|
1089
|
+
this.selectSpanByTabIndex(1, true);
|
|
1090
|
+
} else {
|
|
1091
|
+
this.selectSpanByTabIndex(0);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
} else if (hasOneDigit) {
|
|
1095
|
+
// Second digit: combine with first digit
|
|
1096
|
+
const firstDigit = currentValue[0];
|
|
1097
|
+
const final_value = parseInt(firstDigit + e.key);
|
|
1098
|
+
|
|
1099
|
+
if (final_value > 12 || final_value === 0) {
|
|
1100
|
+
// Invalid, restart with new digit
|
|
1101
|
+
this.span1.nativeElement.innerHTML = e.key + 'm';
|
|
1102
|
+
if (parseInt(e.key) > 1) {
|
|
1103
|
+
this.dateTimeInputDate = new Date(
|
|
1104
|
+
this.dateTimeInputDate.setMonth(parseInt(e.key) - 1),
|
|
1105
|
+
);
|
|
1106
|
+
this.selectionInput = 1;
|
|
1107
|
+
this.selectSpanByTabIndex(1, true);
|
|
1108
|
+
} else {
|
|
1109
|
+
this.selectSpanByTabIndex(0);
|
|
1110
|
+
}
|
|
1111
|
+
} else {
|
|
1112
|
+
this.dateTimeInputDate = new Date(
|
|
1113
|
+
this.dateTimeInputDate.setMonth(final_value - 1),
|
|
1114
|
+
);
|
|
1115
|
+
|
|
1116
|
+
this.span1.nativeElement.innerHTML = ('0' + final_value).slice(
|
|
1117
|
+
-2,
|
|
1118
|
+
);
|
|
1119
|
+
|
|
1120
|
+
this.selectionInput = 1;
|
|
1121
|
+
this.selectSpanByTabIndex(1, true);
|
|
1122
|
+
}
|
|
1123
|
+
} else {
|
|
1124
|
+
// Complete value exists, restart
|
|
1125
|
+
const keyValue = e.key;
|
|
1126
|
+
this.span1.nativeElement.innerHTML = keyValue + 'm';
|
|
1127
|
+
|
|
1128
|
+
if (parseInt(keyValue) > 1) {
|
|
1129
|
+
this.dateTimeInputDate = new Date(
|
|
1130
|
+
this.dateTimeInputDate.setMonth(parseInt(keyValue) - 1),
|
|
1131
|
+
);
|
|
1132
|
+
this.selectionInput = 1;
|
|
1133
|
+
this.selectSpanByTabIndex(1, true);
|
|
1134
|
+
} else {
|
|
1135
|
+
this.selectSpanByTabIndex(0);
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
} else {
|
|
1140
|
+
if (isRestart) {
|
|
1141
|
+
this.span2.nativeElement.innerHTML = 'yy';
|
|
1142
|
+
this.selectionInput = 2;
|
|
1143
|
+
this.selectSpanByTabIndex(2, true);
|
|
1144
|
+
} else {
|
|
1145
|
+
const currentValue = this.span2.nativeElement.innerHTML;
|
|
1146
|
+
const isPlaceholder = currentValue === 'yy';
|
|
1147
|
+
const hasOneDigit =
|
|
1148
|
+
!isPlaceholder &&
|
|
1149
|
+
currentValue.length === 2 &&
|
|
1150
|
+
currentValue[1] === 'y';
|
|
1151
|
+
|
|
1152
|
+
if (isPlaceholder) {
|
|
1153
|
+
// First digit: show as "Xy"
|
|
1154
|
+
const keyValue = e.key;
|
|
1155
|
+
this.span2.nativeElement.innerHTML = keyValue + 'y';
|
|
1156
|
+
this.selectSpanByTabIndex(1);
|
|
1157
|
+
} else if (hasOneDigit) {
|
|
1158
|
+
// Second digit: combine with first digit
|
|
1159
|
+
const firstDigit = currentValue[0];
|
|
1160
|
+
const finalYear = parseInt(firstDigit + e.key);
|
|
1161
|
+
|
|
1162
|
+
const finalShowYear =
|
|
1163
|
+
finalYear > 31
|
|
1164
|
+
? parseInt(`19${finalYear}`)
|
|
1165
|
+
: parseInt(`20${finalYear}`);
|
|
1166
|
+
this.dateTimeInputDate = new Date(
|
|
1167
|
+
this.dateTimeInputDate.setFullYear(finalShowYear),
|
|
1168
|
+
);
|
|
1169
|
+
|
|
1170
|
+
this.span2.nativeElement.innerHTML = ('0' + finalYear).slice(-2);
|
|
1171
|
+
this.selectSpanByTabIndex(1);
|
|
1172
|
+
|
|
1173
|
+
// Validate and update immediately when last field (YY) is completed
|
|
1174
|
+
this.justEnteredDatePicker = true;
|
|
1175
|
+
this.blurOnDateTime();
|
|
1176
|
+
} else {
|
|
1177
|
+
// Complete value exists, restart
|
|
1178
|
+
const keyValue = e.key;
|
|
1179
|
+
this.span2.nativeElement.innerHTML = keyValue + 'y';
|
|
1180
|
+
this.selectSpanByTabIndex(1);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
selectSpanByTabIndex(indx: number, changeTab?: boolean): void {
|
|
1188
|
+
switch (indx) {
|
|
1189
|
+
case 0:
|
|
1190
|
+
this.setSpanSelection(this.span1.nativeElement);
|
|
1191
|
+
break;
|
|
1192
|
+
case 1:
|
|
1193
|
+
this.setSpanSelection(this.span2.nativeElement);
|
|
1194
|
+
break;
|
|
1195
|
+
case 2:
|
|
1196
|
+
this.setSpanSelection(this.span3.nativeElement);
|
|
1197
|
+
break;
|
|
1198
|
+
default:
|
|
1199
|
+
this.setSpanSelection(this.holder1.nativeElement);
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
// Ensure the holder1 element stays focused
|
|
1203
|
+
this.holder1.nativeElement.focus();
|
|
1204
|
+
|
|
1205
|
+
if (changeTab) this.newInputChanged = true;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
private handleNavigationKey(event: KeyboardEvent): void {
|
|
1209
|
+
switch (event.key) {
|
|
1210
|
+
case 'ArrowLeft': // Left arrow
|
|
1211
|
+
this.moveSelectionLeft();
|
|
1212
|
+
break;
|
|
1213
|
+
case 'ArrowRight': // Right arrow
|
|
1214
|
+
case 'Tab': // Tab
|
|
1215
|
+
this.moveSelectionRightOrTab(event);
|
|
1216
|
+
break;
|
|
1217
|
+
case 'ArrowUp': // Up arrow
|
|
1218
|
+
this.setDateTimeModel('up');
|
|
1219
|
+
break;
|
|
1220
|
+
case 'ArrowDown': // Down arrow
|
|
1221
|
+
this.setDateTimeModel('down');
|
|
1222
|
+
break;
|
|
1223
|
+
case 'Backspace': // Backspace
|
|
1224
|
+
case 'Delete': // Delete
|
|
1225
|
+
this.handleKeyboardInputs(event, true);
|
|
1226
|
+
break;
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
private handleDatePickerInput(isUp: boolean, isDatePicker: boolean): void {
|
|
1231
|
+
if (this.selectionInput === 0) this.updateMonth(isUp);
|
|
1232
|
+
else if (this.selectionInput === 1) this.updateDate(isUp, isDatePicker);
|
|
1233
|
+
else this.updateYear(isUp, isDatePicker);
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
private setDateTimeModel(direction: string): void {
|
|
1237
|
+
if (this.selectionInput === -1) this.selectionInput = 0;
|
|
1238
|
+
|
|
1239
|
+
const isUp = direction === 'up';
|
|
1240
|
+
const isDatePicker =
|
|
1241
|
+
this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER;
|
|
1242
|
+
const isBankCardPicker =
|
|
1243
|
+
this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER_BANK_CARD;
|
|
1244
|
+
|
|
1245
|
+
if (isDatePicker || isBankCardPicker)
|
|
1246
|
+
this.handleDatePickerInput(isUp, isDatePicker);
|
|
1247
|
+
else this.handleTimePickerInput(isUp);
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
private moveSelectionRightOrTab(e: KeyboardEvent): void {
|
|
1251
|
+
// Format current field before moving
|
|
1252
|
+
this.formatCurrentField();
|
|
1253
|
+
|
|
1254
|
+
const isDatepickerBankCard =
|
|
1255
|
+
this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER_BANK_CARD;
|
|
1256
|
+
const maxIndex = isDatepickerBankCard ? 1 : 2;
|
|
1257
|
+
|
|
1258
|
+
if (this.selectionInput < maxIndex && !e.shiftKey) {
|
|
1259
|
+
this.selectionInput += 1;
|
|
1260
|
+
this.selectSpanByTabIndex(this.selectionInput, true);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
private formatCurrentField(): void {
|
|
1265
|
+
if (this.selectionInput === -1) return;
|
|
1266
|
+
|
|
1267
|
+
const currentSpan =
|
|
1268
|
+
this.selectionInput === 0
|
|
1269
|
+
? this.span1
|
|
1270
|
+
: this.selectionInput === 1
|
|
1271
|
+
? this.span2
|
|
1272
|
+
: this.span3;
|
|
1273
|
+
|
|
1274
|
+
if (!currentSpan) return;
|
|
1275
|
+
|
|
1276
|
+
const currentValue = currentSpan.nativeElement.innerHTML;
|
|
1277
|
+
const isDatePicker =
|
|
1278
|
+
this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER;
|
|
1279
|
+
const isBankCardPicker =
|
|
1280
|
+
this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER_BANK_CARD;
|
|
1281
|
+
const isTimePicker =
|
|
1282
|
+
this.inputConfig.name === InputConfigNameStringEnum.TIME_PICKER;
|
|
1283
|
+
|
|
1284
|
+
// Format month (span1) in date/bank card picker
|
|
1285
|
+
if ((isDatePicker || isBankCardPicker) && this.selectionInput === 0) {
|
|
1286
|
+
if (currentValue.length === 2 && currentValue[1] === 'm') {
|
|
1287
|
+
const digit = currentValue[0];
|
|
1288
|
+
const formatted = ('0' + digit).slice(-2);
|
|
1289
|
+
currentSpan.nativeElement.innerHTML = formatted;
|
|
1290
|
+
this.dateTimeInputDate = new Date(
|
|
1291
|
+
this.dateTimeInputDate.setMonth(parseInt(digit) - 1),
|
|
1292
|
+
);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
// Format day (span2) in date picker
|
|
1297
|
+
if (isDatePicker && this.selectionInput === 1) {
|
|
1298
|
+
if (currentValue.length === 2 && currentValue[1] === 'd') {
|
|
1299
|
+
const digit = currentValue[0];
|
|
1300
|
+
const formatted = ('0' + digit).slice(-2);
|
|
1301
|
+
currentSpan.nativeElement.innerHTML = formatted;
|
|
1302
|
+
this.dateTimeInputDate = new Date(
|
|
1303
|
+
this.dateTimeInputDate.setDate(parseInt(digit)),
|
|
1304
|
+
);
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
// Format year (span2 bank card / span3 date picker)
|
|
1309
|
+
if (
|
|
1310
|
+
(isDatePicker && this.selectionInput === 2) ||
|
|
1311
|
+
(isBankCardPicker && this.selectionInput === 1)
|
|
1312
|
+
) {
|
|
1313
|
+
if (currentValue.length === 2 && currentValue[1] === 'y') {
|
|
1314
|
+
const digit = currentValue[0];
|
|
1315
|
+
const formatted = ('0' + digit).slice(-2);
|
|
1316
|
+
currentSpan.nativeElement.innerHTML = formatted;
|
|
1317
|
+
const fullYear = parseInt(`200${digit}`);
|
|
1318
|
+
this.dateTimeInputDate = new Date(
|
|
1319
|
+
this.dateTimeInputDate.setFullYear(fullYear),
|
|
1320
|
+
);
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
// Format hours (span1) in time picker
|
|
1325
|
+
if (isTimePicker && this.selectionInput === 0) {
|
|
1326
|
+
if (currentValue.length === 2 && currentValue[1].toLowerCase() === 'h') {
|
|
1327
|
+
const digit = currentValue[0];
|
|
1328
|
+
const formatted = ('0' + digit).slice(-2);
|
|
1329
|
+
currentSpan.nativeElement.innerHTML = formatted;
|
|
1330
|
+
const currentHour = this.dateTimeInputDate.getHours();
|
|
1331
|
+
const isPM = currentHour >= 12;
|
|
1332
|
+
const newHour = isPM ? parseInt(digit) + 12 : parseInt(digit);
|
|
1333
|
+
this.dateTimeInputDate = new Date(
|
|
1334
|
+
this.dateTimeInputDate.setHours(newHour),
|
|
1335
|
+
);
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
// Format minutes (span2) in time picker
|
|
1340
|
+
if (isTimePicker && this.selectionInput === 1) {
|
|
1341
|
+
if (currentValue.length === 2 && currentValue[1].toLowerCase() === 'm') {
|
|
1342
|
+
const digit = currentValue[0];
|
|
1343
|
+
const formatted = ('0' + digit).slice(-2);
|
|
1344
|
+
currentSpan.nativeElement.innerHTML = formatted;
|
|
1345
|
+
this.dateTimeInputDate = new Date(
|
|
1346
|
+
this.dateTimeInputDate.setMinutes(parseInt(digit)),
|
|
1347
|
+
);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
public setIsFocusInput(value: boolean): void {
|
|
1353
|
+
this.isFocusInput = value;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
private moveSelectionLeft(): void {
|
|
1357
|
+
// Format current field before moving
|
|
1358
|
+
this.formatCurrentField();
|
|
1359
|
+
|
|
1360
|
+
if (this.selectionInput > 0) {
|
|
1361
|
+
this.selectionInput -= 1;
|
|
1362
|
+
this.selectSpanByTabIndex(this.selectionInput, true);
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
private updateMonth(isUp: boolean): void {
|
|
1367
|
+
const monthDelta = isUp ? 1 : -1;
|
|
1368
|
+
this.dateTimeInputDate = new Date(
|
|
1369
|
+
this.dateTimeInputDate.setMonth(
|
|
1370
|
+
this.dateTimeInputDate.getMonth() + monthDelta,
|
|
1371
|
+
),
|
|
1372
|
+
);
|
|
1373
|
+
|
|
1374
|
+
this.span1.nativeElement.innerHTML = this.padValue(
|
|
1375
|
+
this.dateTimeInputDate.getMonth() + 1,
|
|
1376
|
+
);
|
|
1377
|
+
this.setSpanSelection(this.span1.nativeElement);
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
private updateDate(isUp: boolean, isDatePicker: boolean): void {
|
|
1381
|
+
const dateDelta = isUp ? 1 : -1;
|
|
1382
|
+
this.dateTimeInputDate = new Date(
|
|
1383
|
+
this.dateTimeInputDate.setDate(
|
|
1384
|
+
this.dateTimeInputDate.getDate() + dateDelta,
|
|
1385
|
+
),
|
|
1386
|
+
);
|
|
1387
|
+
|
|
1388
|
+
const spanElement = isDatePicker
|
|
1389
|
+
? this.span2.nativeElement
|
|
1390
|
+
: this.span1.nativeElement;
|
|
1391
|
+
spanElement.innerHTML = this.padValue(this.dateTimeInputDate.getDate());
|
|
1392
|
+
this.setSpanSelection(spanElement);
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
private updateYear(isUp: boolean, isDatePicker: boolean): void {
|
|
1396
|
+
const yearDelta = isUp ? 1 : -1;
|
|
1397
|
+
this.dateTimeInputDate = new Date(
|
|
1398
|
+
this.dateTimeInputDate.setFullYear(
|
|
1399
|
+
this.dateTimeInputDate.getFullYear() + yearDelta,
|
|
1400
|
+
),
|
|
1401
|
+
);
|
|
1402
|
+
|
|
1403
|
+
const spanElement = isDatePicker
|
|
1404
|
+
? this.span3.nativeElement
|
|
1405
|
+
: this.span2.nativeElement;
|
|
1406
|
+
spanElement.innerHTML = this.dateTimeInputDate
|
|
1407
|
+
.getFullYear()
|
|
1408
|
+
.toString()
|
|
1409
|
+
.slice(-2);
|
|
1410
|
+
this.setSpanSelection(spanElement);
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
private padValue(value: number): string {
|
|
1414
|
+
return ('0' + value).slice(-2);
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
private handleTimePickerInput(isUp: boolean): void {
|
|
1418
|
+
if (this.selectionInput === 0) this.updateHours(isUp);
|
|
1419
|
+
else if (this.selectionInput === 1) this.updateMinutes(isUp);
|
|
1420
|
+
else this.toggleAMPM();
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
private updateHours(isUp: boolean): void {
|
|
1424
|
+
const hoursDelta = isUp ? 1 : -1;
|
|
1425
|
+
let selectedHours = this.dateTimeInputDate.getHours() + hoursDelta;
|
|
1426
|
+
|
|
1427
|
+
// Handle 12-hour format with AM/PM
|
|
1428
|
+
if (selectedHours === 0) selectedHours = 12; // 12 AM
|
|
1429
|
+
if (selectedHours === -1) selectedHours = 11; // 11 PM
|
|
1430
|
+
if (selectedHours === 13) selectedHours = 1; // 1 PM
|
|
1431
|
+
if (selectedHours === 25) selectedHours = 1; // 1 AM
|
|
1432
|
+
|
|
1433
|
+
this.dateTimeInputDate = new Date(
|
|
1434
|
+
this.dateTimeInputDate.setHours(selectedHours),
|
|
1435
|
+
);
|
|
1436
|
+
|
|
1437
|
+
// Display 12-hour format
|
|
1438
|
+
const displayHour = selectedHours > 12 ? selectedHours - 12 : selectedHours;
|
|
1439
|
+
this.span1.nativeElement.innerHTML = this.padValue(displayHour);
|
|
1440
|
+
this.setSpanSelection(this.span1.nativeElement);
|
|
1441
|
+
|
|
1442
|
+
this.span3.nativeElement.innerHTML = selectedHours >= 12 ? 'PM' : 'AM';
|
|
1443
|
+
|
|
1444
|
+
this.markAsTouched();
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
private updateMinutes(isUp: boolean): void {
|
|
1448
|
+
const minutesDelta = isUp ? 1 : -1;
|
|
1449
|
+
this.dateTimeInputDate = new Date(
|
|
1450
|
+
this.dateTimeInputDate.setMinutes(
|
|
1451
|
+
this.dateTimeInputDate.getMinutes() + minutesDelta,
|
|
1452
|
+
),
|
|
1453
|
+
);
|
|
1454
|
+
|
|
1455
|
+
this.span2.nativeElement.innerHTML = this.padValue(
|
|
1456
|
+
this.dateTimeInputDate.getMinutes(),
|
|
1457
|
+
);
|
|
1458
|
+
this.setSpanSelection(this.span2.nativeElement);
|
|
1459
|
+
|
|
1460
|
+
this.markAsTouched();
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
private toggleAMPM(): void {
|
|
1464
|
+
this.span3.nativeElement.innerHTML =
|
|
1465
|
+
this.span3.nativeElement.innerHTML === 'AM' ? 'PM' : 'AM';
|
|
1466
|
+
|
|
1467
|
+
const hoursToAdd = this.span3.nativeElement.innerHTML === 'AM' ? -12 : 12;
|
|
1468
|
+
this.dateTimeInputDate = new Date(
|
|
1469
|
+
this.dateTimeInputDate.setHours(
|
|
1470
|
+
this.dateTimeInputDate.getHours() + hoursToAdd,
|
|
1471
|
+
),
|
|
1472
|
+
);
|
|
1473
|
+
|
|
1474
|
+
this.setSpanSelection(this.span3.nativeElement);
|
|
1475
|
+
|
|
1476
|
+
this.markAsTouched();
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
public clearInput(event?: Event): void {
|
|
1480
|
+
this.clearInputEvent.emit(true);
|
|
1481
|
+
this.onChange('');
|
|
1482
|
+
this.dateTimeInputDate = new Date();
|
|
1483
|
+
this.dateTimeIntDate = new Date();
|
|
1484
|
+
this.showDateInput = false;
|
|
1485
|
+
this.resetDateTimeInputs();
|
|
1486
|
+
this.markAsTouched();
|
|
1487
|
+
this.handleCloseTooltip();
|
|
1488
|
+
|
|
1489
|
+
if (event) {
|
|
1490
|
+
event.stopPropagation();
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
public resetDateTimeInputs(): void {
|
|
1495
|
+
if (this.span1)
|
|
1496
|
+
if (this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER) {
|
|
1497
|
+
this.span1.nativeElement.innerHTML = 'mm';
|
|
1498
|
+
this.span2.nativeElement.innerHTML = 'dd';
|
|
1499
|
+
this.span3.nativeElement.innerHTML = 'yy';
|
|
1500
|
+
} else if (
|
|
1501
|
+
this.inputConfig.name ===
|
|
1502
|
+
InputConfigNameStringEnum.DATE_PICKER_BANK_CARD
|
|
1503
|
+
) {
|
|
1504
|
+
this.span1.nativeElement.innerHTML = 'mm';
|
|
1505
|
+
this.span2.nativeElement.innerHTML = 'yy';
|
|
1506
|
+
} else if (
|
|
1507
|
+
this.inputConfig.name === InputConfigNameStringEnum.TIME_PICKER
|
|
1508
|
+
) {
|
|
1509
|
+
this.span1.nativeElement.innerHTML = 'HH';
|
|
1510
|
+
this.span2.nativeElement.innerHTML = 'MM';
|
|
1511
|
+
this.span3.nativeElement.innerHTML = 'AM';
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
this.setTimePickerTime();
|
|
1515
|
+
this.newInputChanged = true;
|
|
1516
|
+
this.setIsFocusInput(false);
|
|
1517
|
+
this.showDateInput = false;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
public setTimePickerTime(): void {
|
|
1521
|
+
if (this.inputConfig.name === InputConfigNameStringEnum.TIME_PICKER)
|
|
1522
|
+
this.dateTimeInputDate = new Date(
|
|
1523
|
+
moment().format('MM/DD/YYYY') +
|
|
1524
|
+
(this.inputConfig?.isFromDate ? ' 12:15' : ' 12:00'),
|
|
1525
|
+
);
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
public handleCloseTooltip(): void {
|
|
1529
|
+
this.closeTooltip?.close();
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
public openPopover(event?: MouseEvent): void {
|
|
1533
|
+
if (event) {
|
|
1534
|
+
event.preventDefault();
|
|
1535
|
+
event.stopPropagation();
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
this.isFocusInput = true;
|
|
1539
|
+
this.holder1.nativeElement.focus();
|
|
1540
|
+
this.t2.toggle();
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
public ngOnDestroy() {
|
|
1544
|
+
// Clear all timers
|
|
1545
|
+
if (this.dateTimeMainTimer) {
|
|
1546
|
+
clearTimeout(this.dateTimeMainTimer);
|
|
1547
|
+
}
|
|
1548
|
+
if (this.focusBlur) {
|
|
1549
|
+
clearTimeout(this.focusBlur);
|
|
1550
|
+
}
|
|
1551
|
+
if (this.timeoutCleaner) {
|
|
1552
|
+
clearTimeout(this.timeoutCleaner);
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
// Complete the destroy subject to unsubscribe from all observables
|
|
1556
|
+
this.destroy$.next();
|
|
1557
|
+
this.destroy$.complete();
|
|
1558
|
+
}
|
|
1559
|
+
}
|