Skip to content

Commit

Permalink
Merge pull request #28 from grizzlymannn/main
Browse files Browse the repository at this point in the history
Fixed issue #27
  • Loading branch information
pglejzer authored Nov 15, 2022
2 parents d032038 + f3e774f commit c0f9240
Show file tree
Hide file tree
Showing 13 changed files with 3,364 additions and 3,317 deletions.
107 changes: 54 additions & 53 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,60 +32,61 @@
"/dist/*"
],
"devDependencies": {
"@babel/core": "7.17.8",
"@babel/eslint-parser": "7.17.0",
"@babel/plugin-proposal-class-properties": "7.16.7",
"@babel/plugin-transform-runtime": "7.17.0",
"@babel/preset-env": "7.16.11",
"@babel/preset-typescript": "7.16.7",
"@rollup/plugin-babel": "5.2.2",
"@rollup/plugin-commonjs": "17.0.0",
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "11.1.0",
"@rollup/plugin-replace": "2.3.4",
"@types/node": "17.0.22",
"@types/prismjs": "1.26.0",
"@typescript-eslint/eslint-plugin": "^5.16.0",
"@typescript-eslint/parser": "^5.16.0",
"babel-loader": "8.2.2",
"babel-plugin-prismjs": "2.1.0",
"css-loader": "5.0.1",
"css-modules-typescript-loader": "4.0.1",
"eslint": "8.11.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "^16.1.4",
"eslint-config-eslint": "7.0.0",
"@babel/core": "^7.18.13",
"@babel/eslint-parser": "^7.18.9",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-runtime": "^7.18.10",
"@babel/preset-env": "^7.18.10",
"@babel/preset-typescript": "^7.18.6",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"@rollup/plugin-replace": "^2.4.2",
"@types/node": "^17.0.45",
"@types/prismjs": "^1.26.0",
"@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.36.1",
"babel-loader": "^8.2.5",
"babel-plugin-prismjs": "^2.1.0",
"css-loader": "^5.2.7",
"css-modules-typescript-loader": "^4.0.1",
"eslint": "^8.23.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^16.2.0",
"eslint-config-eslint": "^7.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-tree-shaking": "^1.10.0",
"file-loader": "6.2.0",
"html-webpack-plugin": "5.5.0",
"husky": "4.3.8",
"jest": "27.5.1",
"lint-staged": "12.3.7",
"prettier": "2.6.0",
"pretty-quick": "3.1.3",
"prismjs": "1.27.0",
"rollup": "2.32.1",
"rollup-plugin-cleanup": "3.2.1",
"rollup-plugin-dts": "2.0.1",
"rollup-plugin-peer-deps-external": "2.2.4",
"rollup-plugin-postcss": "3.1.8",
"rollup-plugin-scss": "2.6.1",
"rollup-plugin-serve": "1.1.0",
"rollup-plugin-terser": "7.0.2",
"rollup-plugin-typescript2": "0.29.0",
"sass-loader": "12.6.0",
"style-loader": "3.3.1",
"svg-sprite-loader": "6.0.11",
"svg-url-loader": "7.1.1",
"svgo-loader": "3.0.0",
"ts-loader": "9.2.8",
"typescript": "4.6.2",
"url-loader": "4.1.1",
"webpack": "5.70.0",
"webpack-cli": "4.9.2",
"webpack-dev-server": "4.7.4"
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.5.0",
"husky": "^4.3.8",
"jest": "^27.5.1",
"lint-staged": "^12.5.0",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"prismjs": "^1.29.0",
"rollup": "^2.79.0",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-dts": "^2.0.1",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-scss": "^3.0.0",
"rollup-plugin-serve": "^1.1.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.29.0",
"sass": "^1.54.8",
"sass-loader": "^12.6.0",
"style-loader": "^3.3.1",
"svg-sprite-loader": "^2.0.3",
"svg-url-loader": "^7.1.1",
"svgo-loader": "^3.0.1",
"ts-loader": "^9.3.1",
"typescript": "^4.8.2",
"url-loader": "^4.1.1",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.10.1"
}
}
271 changes: 137 additions & 134 deletions app/src/timepicker/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,134 +1,137 @@
import './styles/main.scss';
import './styles/theme.scss';
import type { OptionTypes } from './utils/types';
declare type TypeFunction = () => void;
export default class TimepickerUI {
private _degreesHours;
private _degreesMinutes;
private _options;
private _eventsClickMobile;
private _eventsClickMobileHandler;
private _mutliEventsMove;
private _mutliEventsMoveHandler;
private _clickTouchEvents;
private _element;
private _isMobileView;
private _isTouchMouseMove;
private _disabledTime;
private _cloned;
private _inputEvents;
private _isModalRemove?;
constructor(element: HTMLElement, options?: OptionTypes);
private get modalTemplate();
private get modalElement();
private get clockFace();
private get input();
private get clockHand();
private get circle();
private get tipsWrapper();
private get tipsWrapperFor24h();
private get minutes();
private get hour();
private get AM();
private get PM();
private get minutesTips();
private get hourTips();
private get allValueTips();
private get openElementData();
private get openElement();
private get cancelButton();
private get okButton();
private get activeTypeMode();
private get keyboardClockIcon();
private get footer();
private get wrapper();
/**
* @description The create method that init timepicker
*/
create: () => void;
/**
* @description The open method opens immediately timepicker after init
* @param callback - The callback function triggered when timepicker is open by this method
*/
open: (callback?: (() => void) | undefined) => void;
/**
* @description Closure method closes the timepicker
* @param args - These parameters in this method are optional and order is any. You can set callback function first or boolean,
* or just boolean or just callback. If the boolean is set to true the input will be updating with the current value on picker.
* The callback function start immediately after close, if is invoke. The max parameters length is set to 2
*/
close: (...args: (boolean | TypeFunction)[]) => void;
/**
* @description The destroy method destroy actual instance of picker by cloning element.
* @param callback - The callback function is started after destroyed method. This parameter is optional.
*/
destroy: (callback?: TypeFunction | undefined) => void;
/**
* @description The update method which update timepicker with new options and can create a new instance.
* @param value - The first parameter is a object with key options which is timepicker options and it will be updated to current
* instance and is `required`. The `create` key is a boolean which if is set to true it starting the create() method after invoke update
* function and is optional. The `create` option is useful if you are using destroy and update methods together.
* @param callback - The `callback` function is started after update method. This parameter is optional.
*/
update: (value: {
options: OptionTypes;
create?: boolean;
}, callback?: TypeFunction | undefined) => void;
private _preventClockTypeByCurrentTime;
private _updateInputValueWithCurrentTimeOnStart;
private _checkDisabledValuesOnStart;
private _checkMobileOption;
private _getDisableTime;
private _removeCircleClockClasses24h;
private _setCircleClockClasses24h;
private _setErrorHandler;
private _removeErrorHandler;
private _setOnStartCSSClassesIfClockType24h;
private _setTheme;
private _setInputClassToInputElement;
private _setDataOpenToInputIfDosentExistInWrapper;
private _setClassTopOpenElement;
private _removeBackdrop;
private _setNormalizeClass;
private _setFlexEndToFooterIfNoKeyboardIcon;
private _eventsBundle;
private _handleOpenOnClick;
private _getInputValueOnOpenAndSet;
private _handleCancelButton;
private _handleOkButton;
private _setShowClassToBackdrop;
private _handleBackdropClick;
private _setBgColorToCirleWithHourTips;
private _setBgColorToCircleWithMinutesTips;
private _removeBgColorToCirleWithMinutesTips;
private _setTimepickerClassToElement;
private _setClassActiveToHourOnOpen;
private _setMinutesToClock;
private _setHoursToClock;
private _setTransformToCircleWithSwitchesHour;
private _setTransformToCircleWithSwitchesMinutes;
private _getDestructuringObj;
private _handleAmClick;
private _handlePmClick;
private _handleAnimationClock;
private _handleAnimationSwitchTipsMode;
private _handleClasses24h;
private _handleHourEvents;
private _handleMinutesEvents;
private _handleEventToMoveHand;
private _toggleClassActiveToValueTips;
private _handleMoveHand;
private _setModalTemplate;
private _setScrollbarOrNot;
private _setAnimationToOpen;
private _removeAnimationToClose;
private _handlerViewChange;
private _handleIconChangeView;
private _handlerClickHourMinutes;
private _handleClickOnHourMobile;
private _handleKeyPress;
private _handleEscClick;
private _focusTrapHandler;
private _handleOpenOnEnterFocus;
}
export {};
import './styles/main.scss';
import './styles/theme.scss';
import type { OptionTypes } from './utils/types';
declare type TypeFunction = () => void;
export default class TimepickerUI {
private _degreesHours;
private _degreesMinutes;
private _options;
private _eventsClickMobile;
private _eventsClickMobileHandler;
private _mutliEventsMove;
private _mutliEventsMoveHandler;
private _clickTouchEvents;
private _element;
private _isMobileView;
private _isTouchMouseMove;
private _disabledTime;
private _cloned;
private _inputEvents;
private _isModalRemove?;
constructor(element: HTMLElement, options?: OptionTypes);
private get modalTemplate();
private get modalElement();
private get clockFace();
private get input();
private get clockHand();
private get circle();
private get tipsWrapper();
private get tipsWrapperFor24h();
private get minutes();
private get hour();
private get AM();
private get PM();
private get minutesTips();
private get hourTips();
private get allValueTips();
private get openElementData();
private get openElement();
private get cancelButton();
private get okButton();
private get activeTypeMode();
private get keyboardClockIcon();
private get footer();
private get wrapper();
/**
* @description The create method that init timepicker
*/
create: () => void;
/**
* @description The open method opens immediately timepicker after init
* @param callback - The callback function triggered when timepicker is open by this method
*/
open: (callback?: () => void) => void;
/**
* @description Closure method closes the timepicker
* @param args - These parameters in this method are optional and order is any. You can set callback function first or boolean,
* or just boolean or just callback. If the boolean is set to true the input will be updating with the current value on picker.
* The callback function start immediately after close, if is invoke. The max parameters length is set to 2
*/
close: (...args: (boolean | TypeFunction)[]) => void;
/**
* @description The destroy method destroy actual instance of picker by cloning element.
* @param callback - The callback function is started after destroyed method. This parameter is optional.
*/
destroy: (callback?: TypeFunction) => void;
/**
* @description The update method which update timepicker with new options and can create a new instance.
* @param value - The first parameter is a object with key options which is timepicker options and it will be updated to current
* instance and is `required`. The `create` key is a boolean which if is set to true it starting the create() method after invoke update
* function and is optional. The `create` option is useful if you are using destroy and update methods together.
* @param callback - The `callback` function is started after update method. This parameter is optional.
*/
update: (
value: {
options: OptionTypes;
create?: boolean;
},
callback?: TypeFunction,
) => void;
private _preventClockTypeByCurrentTime;
private _updateInputValueWithCurrentTimeOnStart;
private _checkDisabledValuesOnStart;
private _checkMobileOption;
private _getDisableTime;
private _removeCircleClockClasses24h;
private _setCircleClockClasses24h;
private _setErrorHandler;
private _removeErrorHandler;
private _setOnStartCSSClassesIfClockType24h;
private _setTheme;
private _setInputClassToInputElement;
private _setDataOpenToInputIfDosentExistInWrapper;
private _setClassTopOpenElement;
private _removeBackdrop;
private _setNormalizeClass;
private _setFlexEndToFooterIfNoKeyboardIcon;
private _eventsBundle;
private _handleOpenOnClick;
private _getInputValueOnOpenAndSet;
private _handleCancelButton;
private _handleOkButton;
private _setShowClassToBackdrop;
private _handleBackdropClick;
private _setBgColorToCirleWithHourTips;
private _setBgColorToCircleWithMinutesTips;
private _removeBgColorToCirleWithMinutesTips;
private _setTimepickerClassToElement;
private _setClassActiveToHourOnOpen;
private _setMinutesToClock;
private _setHoursToClock;
private _setTransformToCircleWithSwitchesHour;
private _setTransformToCircleWithSwitchesMinutes;
private _getDestructuringObj;
private _handleAmClick;
private _handlePmClick;
private _handleAnimationClock;
private _handleAnimationSwitchTipsMode;
private _handleClasses24h;
private _handleHourEvents;
private _handleMinutesEvents;
private _handleEventToMoveHand;
private _toggleClassActiveToValueTips;
private _handleMoveHand;
private _setModalTemplate;
private _setScrollbarOrNot;
private _setAnimationToOpen;
private _removeAnimationToClose;
private _handlerViewChange;
private _handleIconChangeView;
private _handlerClickHourMinutes;
private _handleClickOnHourMobile;
private _handleKeyPress;
private _handleEscClick;
private _focusTrapHandler;
private _handleOpenOnEnterFocus;
}
export {};
Loading

0 comments on commit c0f9240

Please sign in to comment.