@anglr/datetime 1.0.0 → 2.0.1-beta.20220222061608
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/changelog.md +19 -0
- package/date-fns/package.json +7 -7
- package/date-fns/src/{date-fns.d.ts → index.d.ts} +4 -4
- package/date-fns/src/index.d.ts.map +1 -0
- package/date-fns/src/misc/tokens.d.ts +10 -10
- package/date-fns/src/services/dateFnsDateApi.service.d.ts +36 -33
- package/date-fns/src/services/dateFnsDateApi.service.d.ts.map +1 -1
- package/date-fns/src/services/dateFnsLocale.service.d.ts +10 -10
- package/es2015/date-fns/src/index.js +4 -0
- package/es2015/date-fns/src/index.js.map +1 -0
- package/es2015/date-fns/src/misc/tokens.js +20 -0
- package/es2015/date-fns/src/misc/tokens.js.map +1 -0
- package/es2015/date-fns/src/services/dateFnsDateApi.service.js +438 -0
- package/es2015/date-fns/src/services/dateFnsDateApi.service.js.map +1 -0
- package/es2015/date-fns/src/services/dateFnsLocale.service.js +2 -0
- package/es2015/date-fns/src/services/dateFnsLocale.service.js.map +1 -0
- package/es2015/karma.conf.js +57 -0
- package/es2015/karma.conf.js.map +1 -0
- package/{moment/src/moment.d.ts → es2015/moment/src/index.js} +3 -3
- package/es2015/moment/src/index.js.map +1 -0
- package/es2015/moment/src/misc/tokens.js +15 -0
- package/es2015/moment/src/misc/tokens.js.map +1 -0
- package/es2015/moment/src/services/momentDateApi.service.js +398 -0
- package/es2015/moment/src/services/momentDateApi.service.js.map +1 -0
- package/{src/datetime.d.ts → es2015/src/index.js} +19 -19
- package/es2015/src/index.js.map +1 -0
- package/es2015/src/misc/constants.js +33 -0
- package/es2015/src/misc/constants.js.map +1 -0
- package/es2015/src/misc/datetime.interface.js +2 -0
- package/es2015/src/misc/datetime.interface.js.map +1 -0
- package/es2015/src/misc/tokens.js +19 -0
- package/es2015/src/misc/tokens.js.map +1 -0
- package/es2015/src/misc/validators.js +58 -0
- package/es2015/src/misc/validators.js.map +1 -0
- package/es2015/src/modules/datePipes.module.js +33 -0
- package/es2015/src/modules/datePipes.module.js.map +1 -0
- package/es2015/src/picker/components/dayPicker/dayPicker.component.js +172 -0
- package/es2015/src/picker/components/dayPicker/dayPicker.component.js.map +1 -0
- package/es2015/src/picker/components/dayPicker/dayPicker.interfaces.js +2 -0
- package/es2015/src/picker/components/dayPicker/dayPicker.interfaces.js.map +1 -0
- package/es2015/src/picker/components/monthPicker/monthPicker.component.js +114 -0
- package/es2015/src/picker/components/monthPicker/monthPicker.component.js.map +1 -0
- package/es2015/src/picker/components/monthPicker/monthPicker.interfaces.js +2 -0
- package/es2015/src/picker/components/monthPicker/monthPicker.interfaces.js.map +1 -0
- package/es2015/src/picker/components/picker/picker.component.animations.js +71 -0
- package/es2015/src/picker/components/picker/picker.component.animations.js.map +1 -0
- package/es2015/src/picker/components/picker/picker.component.js +241 -0
- package/es2015/src/picker/components/picker/picker.component.js.map +1 -0
- package/es2015/src/picker/components/pickerBase.component.js +243 -0
- package/es2015/src/picker/components/pickerBase.component.js.map +1 -0
- package/es2015/src/picker/components/yearPicker/yearPicker.component.js +126 -0
- package/es2015/src/picker/components/yearPicker/yearPicker.component.js.map +1 -0
- package/es2015/src/picker/components/yearPicker/yearPicker.interfaces.js +2 -0
- package/es2015/src/picker/components/yearPicker/yearPicker.interfaces.js.map +1 -0
- package/es2015/src/picker/interfaces.js +5 -0
- package/es2015/src/picker/interfaces.js.map +1 -0
- package/es2015/src/picker/misc/datetimePicker.interface.js +2 -0
- package/es2015/src/picker/misc/datetimePicker.interface.js.map +1 -0
- package/es2015/src/picker/misc/tokens.js +6 -0
- package/es2015/src/picker/misc/tokens.js.map +1 -0
- package/es2015/src/picker/modules/picker.module.js +46 -0
- package/es2015/src/picker/modules/picker.module.js.map +1 -0
- package/es2015/src/picker/types.js +8 -0
- package/es2015/src/picker/types.js.map +1 -0
- package/es2015/src/pipes/asRequiredType.js +22 -0
- package/es2015/src/pipes/asRequiredType.js.map +1 -0
- package/es2015/src/pipes/dateConvert.pipe.js +35 -0
- package/es2015/src/pipes/dateConvert.pipe.js.map +1 -0
- package/es2015/src/pipes/dateFormat.pipe.js +45 -0
- package/es2015/src/pipes/dateFormat.pipe.js.map +1 -0
- package/es2015/src/selector/components/inputDateTime/inputDateTime.component.js +421 -0
- package/es2015/src/selector/components/inputDateTime/inputDateTime.component.js.map +1 -0
- package/es2015/src/selector/components/selector/selector.component.animations.js +15 -0
- package/es2015/src/selector/components/selector/selector.component.animations.js.map +1 -0
- package/es2015/src/selector/components/selector/selector.component.js +344 -0
- package/es2015/src/selector/components/selector/selector.component.js.map +1 -0
- package/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +317 -0
- package/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js.map +1 -0
- package/es2015/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +51 -0
- package/es2015/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js.map +1 -0
- package/es2015/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +51 -0
- package/es2015/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js.map +1 -0
- package/es2015/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +47 -0
- package/es2015/src/selector/directives/datetimeValidator/datetimeValidator.directive.js.map +1 -0
- package/es2015/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +119 -0
- package/es2015/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js.map +1 -0
- package/es2015/src/selector/interfaces.js +2 -0
- package/es2015/src/selector/interfaces.js.map +1 -0
- package/es2015/src/selector/misc/datetimeSelector.interface.js +2 -0
- package/es2015/src/selector/misc/datetimeSelector.interface.js.map +1 -0
- package/es2015/src/selector/misc/tokens.js +6 -0
- package/es2015/src/selector/misc/tokens.js.map +1 -0
- package/es2015/src/selector/modules/basicSelector.module.js +20 -0
- package/es2015/src/selector/modules/basicSelector.module.js.map +1 -0
- package/es2015/src/selector/modules/selector.module.js +60 -0
- package/es2015/src/selector/modules/selector.module.js.map +1 -0
- package/es2015/src/selector/types.js +10 -0
- package/es2015/src/selector/types.js.map +1 -0
- package/es2015/src/services/dateApi.interface.js +2 -0
- package/es2015/src/services/dateApi.interface.js.map +1 -0
- package/es2015/src/services/datePositionParser.interface.js +2 -0
- package/es2015/src/services/datePositionParser.interface.js.map +1 -0
- package/es2015/src/services/datePositionParser.service.js +227 -0
- package/es2015/src/services/datePositionParser.service.js.map +1 -0
- package/es2015/src/services/dateTimeRelativeParser.service.js +66 -0
- package/es2015/src/services/dateTimeRelativeParser.service.js.map +1 -0
- package/es2015/src/services/dateValueProvider.service.js +58 -0
- package/es2015/src/services/dateValueProvider.service.js.map +1 -0
- package/es2015/src/services/formatProvider.interface.js +2 -0
- package/es2015/src/services/formatProvider.interface.js.map +1 -0
- package/es2015/src/services/index.js +4 -0
- package/es2015/src/services/index.js.map +1 -0
- package/es2020/date-fns/src/index.js +4 -0
- package/es2020/date-fns/src/index.js.map +1 -0
- package/es2020/date-fns/src/misc/tokens.js +20 -0
- package/es2020/date-fns/src/misc/tokens.js.map +1 -0
- package/es2020/date-fns/src/services/dateFnsDateApi.service.js +437 -0
- package/es2020/date-fns/src/services/dateFnsDateApi.service.js.map +1 -0
- package/es2020/date-fns/src/services/dateFnsLocale.service.js +2 -0
- package/es2020/date-fns/src/services/dateFnsLocale.service.js.map +1 -0
- package/es2020/karma.conf.js +57 -0
- package/es2020/karma.conf.js.map +1 -0
- package/es2020/moment/src/index.js +3 -0
- package/es2020/moment/src/index.js.map +1 -0
- package/es2020/moment/src/misc/tokens.js +15 -0
- package/es2020/moment/src/misc/tokens.js.map +1 -0
- package/es2020/moment/src/services/momentDateApi.service.js +398 -0
- package/es2020/moment/src/services/momentDateApi.service.js.map +1 -0
- package/es2020/src/index.js +19 -0
- package/es2020/src/index.js.map +1 -0
- package/es2020/src/misc/constants.js +33 -0
- package/es2020/src/misc/constants.js.map +1 -0
- package/es2020/src/misc/datetime.interface.js +2 -0
- package/es2020/src/misc/datetime.interface.js.map +1 -0
- package/es2020/src/misc/tokens.js +19 -0
- package/es2020/src/misc/tokens.js.map +1 -0
- package/es2020/src/misc/validators.js +58 -0
- package/es2020/src/misc/validators.js.map +1 -0
- package/es2020/src/modules/datePipes.module.js +33 -0
- package/es2020/src/modules/datePipes.module.js.map +1 -0
- package/es2020/src/picker/components/dayPicker/dayPicker.component.js +172 -0
- package/es2020/src/picker/components/dayPicker/dayPicker.component.js.map +1 -0
- package/es2020/src/picker/components/dayPicker/dayPicker.interfaces.js +2 -0
- package/es2020/src/picker/components/dayPicker/dayPicker.interfaces.js.map +1 -0
- package/es2020/src/picker/components/monthPicker/monthPicker.component.js +114 -0
- package/es2020/src/picker/components/monthPicker/monthPicker.component.js.map +1 -0
- package/es2020/src/picker/components/monthPicker/monthPicker.interfaces.js +2 -0
- package/es2020/src/picker/components/monthPicker/monthPicker.interfaces.js.map +1 -0
- package/es2020/src/picker/components/picker/picker.component.animations.js +71 -0
- package/es2020/src/picker/components/picker/picker.component.animations.js.map +1 -0
- package/es2020/src/picker/components/picker/picker.component.js +236 -0
- package/es2020/src/picker/components/picker/picker.component.js.map +1 -0
- package/es2020/src/picker/components/pickerBase.component.js +243 -0
- package/es2020/src/picker/components/pickerBase.component.js.map +1 -0
- package/es2020/src/picker/components/yearPicker/yearPicker.component.js +126 -0
- package/es2020/src/picker/components/yearPicker/yearPicker.component.js.map +1 -0
- package/es2020/src/picker/components/yearPicker/yearPicker.interfaces.js +2 -0
- package/es2020/src/picker/components/yearPicker/yearPicker.interfaces.js.map +1 -0
- package/es2020/src/picker/interfaces.js +5 -0
- package/es2020/src/picker/interfaces.js.map +1 -0
- package/es2020/src/picker/misc/datetimePicker.interface.js +2 -0
- package/es2020/src/picker/misc/datetimePicker.interface.js.map +1 -0
- package/es2020/src/picker/misc/tokens.js +6 -0
- package/es2020/src/picker/misc/tokens.js.map +1 -0
- package/es2020/src/picker/modules/picker.module.js +46 -0
- package/es2020/src/picker/modules/picker.module.js.map +1 -0
- package/es2020/src/picker/types.js +8 -0
- package/es2020/src/picker/types.js.map +1 -0
- package/es2020/src/pipes/asRequiredType.js +22 -0
- package/es2020/src/pipes/asRequiredType.js.map +1 -0
- package/es2020/src/pipes/dateConvert.pipe.js +35 -0
- package/es2020/src/pipes/dateConvert.pipe.js.map +1 -0
- package/es2020/src/pipes/dateFormat.pipe.js +45 -0
- package/es2020/src/pipes/dateFormat.pipe.js.map +1 -0
- package/es2020/src/selector/components/inputDateTime/inputDateTime.component.js +417 -0
- package/es2020/src/selector/components/inputDateTime/inputDateTime.component.js.map +1 -0
- package/es2020/src/selector/components/selector/selector.component.animations.js +15 -0
- package/es2020/src/selector/components/selector/selector.component.animations.js.map +1 -0
- package/es2020/src/selector/components/selector/selector.component.js +334 -0
- package/es2020/src/selector/components/selector/selector.component.js.map +1 -0
- package/es2020/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +314 -0
- package/es2020/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js.map +1 -0
- package/es2020/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +51 -0
- package/es2020/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js.map +1 -0
- package/es2020/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +51 -0
- package/es2020/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js.map +1 -0
- package/es2020/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +47 -0
- package/es2020/src/selector/directives/datetimeValidator/datetimeValidator.directive.js.map +1 -0
- package/es2020/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +118 -0
- package/es2020/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js.map +1 -0
- package/es2020/src/selector/interfaces.js +2 -0
- package/es2020/src/selector/interfaces.js.map +1 -0
- package/es2020/src/selector/misc/datetimeSelector.interface.js +2 -0
- package/es2020/src/selector/misc/datetimeSelector.interface.js.map +1 -0
- package/es2020/src/selector/misc/tokens.js +6 -0
- package/es2020/src/selector/misc/tokens.js.map +1 -0
- package/es2020/src/selector/modules/basicSelector.module.js +20 -0
- package/es2020/src/selector/modules/basicSelector.module.js.map +1 -0
- package/es2020/src/selector/modules/selector.module.js +60 -0
- package/es2020/src/selector/modules/selector.module.js.map +1 -0
- package/es2020/src/selector/types.js +10 -0
- package/es2020/src/selector/types.js.map +1 -0
- package/es2020/src/services/dateApi.interface.js +2 -0
- package/es2020/src/services/dateApi.interface.js.map +1 -0
- package/es2020/src/services/datePositionParser.interface.js +2 -0
- package/es2020/src/services/datePositionParser.interface.js.map +1 -0
- package/es2020/src/services/datePositionParser.service.js +227 -0
- package/es2020/src/services/datePositionParser.service.js.map +1 -0
- package/es2020/src/services/dateTimeRelativeParser.service.js +65 -0
- package/es2020/src/services/dateTimeRelativeParser.service.js.map +1 -0
- package/es2020/src/services/dateValueProvider.service.js +58 -0
- package/es2020/src/services/dateValueProvider.service.js.map +1 -0
- package/es2020/src/services/formatProvider.interface.js +2 -0
- package/es2020/src/services/formatProvider.interface.js.map +1 -0
- package/es2020/src/services/index.js +4 -0
- package/es2020/src/services/index.js.map +1 -0
- package/karma.conf.d.ts +2 -0
- package/karma.conf.d.ts.map +1 -0
- package/moment/package.json +7 -7
- package/moment/src/index.d.ts +3 -0
- package/moment/src/index.d.ts.map +1 -0
- package/moment/src/misc/tokens.d.ts +5 -5
- package/moment/src/services/momentDateApi.service.d.ts +35 -32
- package/moment/src/services/momentDateApi.service.d.ts.map +1 -1
- package/package.json +100 -48
- package/src/index.d.ts +19 -0
- package/src/index.d.ts.map +1 -0
- package/src/misc/constants.d.ts +32 -32
- package/src/misc/datetime.interface.d.ts +34 -34
- package/src/misc/tokens.d.ts +10 -10
- package/src/misc/validators.d.ts +25 -25
- package/src/modules/datePipes.module.d.ts +12 -5
- package/src/modules/datePipes.module.d.ts.map +1 -1
- package/src/picker/components/dayPicker/dayPicker.component.d.ts +68 -65
- package/src/picker/components/dayPicker/dayPicker.component.d.ts.map +1 -1
- package/src/picker/components/dayPicker/dayPicker.component.html +7 -7
- package/src/picker/components/dayPicker/dayPicker.interfaces.d.ts +10 -10
- package/src/picker/components/monthPicker/monthPicker.component.d.ts +52 -49
- package/src/picker/components/monthPicker/monthPicker.component.d.ts.map +1 -1
- package/src/picker/components/monthPicker/monthPicker.component.html +6 -6
- package/src/picker/components/monthPicker/monthPicker.interfaces.d.ts +6 -6
- package/src/picker/components/picker/picker.component.animations.d.ts +4 -4
- package/src/picker/components/picker/picker.component.d.ts +104 -101
- package/src/picker/components/picker/picker.component.d.ts.map +1 -1
- package/src/picker/components/pickerBase.component.d.ts +169 -166
- package/src/picker/components/pickerBase.component.d.ts.map +1 -1
- package/src/picker/components/yearPicker/yearPicker.component.d.ts +57 -54
- package/src/picker/components/yearPicker/yearPicker.component.d.ts.map +1 -1
- package/src/picker/components/yearPicker/yearPicker.component.html +6 -6
- package/src/picker/components/yearPicker/yearPicker.interfaces.d.ts +6 -6
- package/src/picker/interfaces.d.ts +4 -4
- package/src/picker/misc/datetimePicker.interface.d.ts +188 -188
- package/src/picker/misc/tokens.d.ts +6 -6
- package/src/picker/modules/picker.module.d.ts +16 -5
- package/src/picker/modules/picker.module.d.ts.map +1 -1
- package/src/picker/types.d.ts +7 -7
- package/src/pipes/asRequiredType.d.ts +21 -0
- package/src/pipes/asRequiredType.d.ts.map +1 -0
- package/src/pipes/dateConvert.pipe.d.ts +18 -15
- package/src/pipes/dateConvert.pipe.d.ts.map +1 -1
- package/src/pipes/dateFormat.pipe.d.ts +20 -17
- package/src/pipes/dateFormat.pipe.d.ts.map +1 -1
- package/src/selector/components/inputDateTime/inputDateTime.component.d.ts +187 -184
- package/src/selector/components/inputDateTime/inputDateTime.component.d.ts.map +1 -1
- package/src/selector/components/selector/selector.component.animations.d.ts +4 -4
- package/src/selector/components/selector/selector.component.d.ts +155 -152
- package/src/selector/components/selector/selector.component.d.ts.map +1 -1
- package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.d.ts +170 -167
- package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.d.ts.map +1 -1
- package/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.d.ts +22 -19
- package/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.d.ts.map +1 -1
- package/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.d.ts +22 -19
- package/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.d.ts.map +1 -1
- package/src/selector/directives/datetimeValidator/datetimeValidator.directive.d.ts +21 -18
- package/src/selector/directives/datetimeValidator/datetimeValidator.directive.d.ts.map +1 -1
- package/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.d.ts +53 -50
- package/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.d.ts.map +1 -1
- package/src/selector/interfaces.d.ts +1 -1
- package/src/selector/misc/datetimeSelector.interface.d.ts +82 -82
- package/src/selector/misc/tokens.d.ts +6 -6
- package/src/selector/modules/basicSelector.module.d.ts +10 -5
- package/src/selector/modules/basicSelector.module.d.ts.map +1 -1
- package/src/selector/modules/selector.module.d.ts +18 -5
- package/src/selector/modules/selector.module.d.ts.map +1 -1
- package/src/selector/types.d.ts +9 -9
- package/src/services/dateApi.interface.d.ts +275 -275
- package/src/services/datePositionParser.interface.d.ts +40 -40
- package/src/services/datePositionParser.service.d.ts +60 -57
- package/src/services/datePositionParser.service.d.ts.map +1 -1
- package/src/services/dateTimeRelativeParser.service.d.ts +21 -18
- package/src/services/dateTimeRelativeParser.service.d.ts.map +1 -1
- package/src/services/dateValueProvider.service.d.ts +18 -15
- package/src/services/dateValueProvider.service.d.ts.map +1 -1
- package/src/services/formatProvider.interface.d.ts +17 -17
- package/src/services/index.d.ts +3 -3
- package/tsconfig.karma.json +5 -6
- package/version.bak +1 -1
- package/appveyor.yml +0 -70
- package/date-fns/dist/es2015/date-fns/index.js +0 -10
- package/date-fns/dist/es2015/date-fns/public_api.js +0 -7
- package/date-fns/dist/es2015/date-fns/src/date-fns.js +0 -9
- package/date-fns/dist/es2015/date-fns/src/misc/tokens.js +0 -32
- package/date-fns/dist/es2015/date-fns/src/services/dateFnsDateApi.service.js +0 -512
- package/date-fns/dist/es2015/date-fns/src/services/dateFnsLocale.service.js +0 -18
- package/date-fns/dist/es5/date-fns/index.js +0 -10
- package/date-fns/dist/es5/date-fns/public_api.js +0 -7
- package/date-fns/dist/es5/date-fns/src/date-fns.js +0 -9
- package/date-fns/dist/es5/date-fns/src/misc/tokens.js +0 -32
- package/date-fns/dist/es5/date-fns/src/services/dateFnsDateApi.service.js +0 -902
- package/date-fns/dist/es5/date-fns/src/services/dateFnsLocale.service.js +0 -18
- package/date-fns/index.d.ts +0 -5
- package/date-fns/index.d.ts.map +0 -1
- package/date-fns/index.metadata.json +0 -1
- package/date-fns/public_api.d.ts +0 -2
- package/date-fns/public_api.d.ts.map +0 -1
- package/date-fns/src/date-fns.d.ts.map +0 -1
- package/date-fns/src/services/dateFnsDateApi.service.ngfactory.d.ts.map +0 -1
- package/datetime.d.ts +0 -7
- package/datetime.d.ts.map +0 -1
- package/datetime.metadata.json +0 -1
- package/dist/es2015/datetime.js +0 -10
- package/dist/es2015/public_api.js +0 -7
- package/dist/es2015/src/datetime.js +0 -24
- package/dist/es2015/src/misc/constants.js +0 -46
- package/dist/es2015/src/misc/datetime.interface.js +0 -52
- package/dist/es2015/src/misc/tokens.js +0 -29
- package/dist/es2015/src/misc/validators.js +0 -80
- package/dist/es2015/src/modules/datePipes.module.js +0 -26
- package/dist/es2015/src/picker/components/dayPicker/dayPicker.component.js +0 -215
- package/dist/es2015/src/picker/components/dayPicker/dayPicker.interfaces.js +0 -18
- package/dist/es2015/src/picker/components/monthPicker/monthPicker.component.js +0 -138
- package/dist/es2015/src/picker/components/monthPicker/monthPicker.interfaces.js +0 -11
- package/dist/es2015/src/picker/components/picker/picker.component.animations.js +0 -77
- package/dist/es2015/src/picker/components/picker/picker.component.js +0 -386
- package/dist/es2015/src/picker/components/pickerBase.component.js +0 -406
- package/dist/es2015/src/picker/components/yearPicker/yearPicker.component.js +0 -158
- package/dist/es2015/src/picker/components/yearPicker/yearPicker.interfaces.js +0 -11
- package/dist/es2015/src/picker/interfaces.js +0 -10
- package/dist/es2015/src/picker/misc/datetimePicker.interface.js +0 -245
- package/dist/es2015/src/picker/misc/tokens.js +0 -12
- package/dist/es2015/src/picker/modules/picker.module.js +0 -35
- package/dist/es2015/src/picker/types.js +0 -13
- package/dist/es2015/src/pipes/dateConvert.pipe.js +0 -50
- package/dist/es2015/src/pipes/dateFormat.pipe.js +0 -64
- package/dist/es2015/src/selector/components/inputDateTime/inputDateTime.component.js +0 -588
- package/dist/es2015/src/selector/components/selector/selector.component.animations.js +0 -21
- package/dist/es2015/src/selector/components/selector/selector.component.js +0 -514
- package/dist/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +0 -456
- package/dist/es2015/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +0 -73
- package/dist/es2015/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +0 -73
- package/dist/es2015/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +0 -70
- package/dist/es2015/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +0 -171
- package/dist/es2015/src/selector/interfaces.js +0 -7
- package/dist/es2015/src/selector/misc/datetimeSelector.interface.js +0 -106
- package/dist/es2015/src/selector/misc/tokens.js +0 -12
- package/dist/es2015/src/selector/modules/basicSelector.module.js +0 -20
- package/dist/es2015/src/selector/modules/selector.module.js +0 -45
- package/dist/es2015/src/selector/types.js +0 -15
- package/dist/es2015/src/services/dateApi.interface.js +0 -316
- package/dist/es2015/src/services/datePositionParser.interface.js +0 -56
- package/dist/es2015/src/services/datePositionParser.service.js +0 -297
- package/dist/es2015/src/services/dateTimeRelativeParser.service.js +0 -97
- package/dist/es2015/src/services/dateValueProvider.service.js +0 -79
- package/dist/es2015/src/services/formatProvider.interface.js +0 -28
- package/dist/es2015/src/services/index.js +0 -9
- package/dist/es5/datetime.js +0 -10
- package/dist/es5/public_api.js +0 -7
- package/dist/es5/src/datetime.js +0 -24
- package/dist/es5/src/misc/constants.js +0 -46
- package/dist/es5/src/misc/datetime.interface.js +0 -52
- package/dist/es5/src/misc/tokens.js +0 -29
- package/dist/es5/src/misc/validators.js +0 -124
- package/dist/es5/src/modules/datePipes.module.js +0 -30
- package/dist/es5/src/picker/components/dayPicker/dayPicker.component.js +0 -323
- package/dist/es5/src/picker/components/dayPicker/dayPicker.interfaces.js +0 -18
- package/dist/es5/src/picker/components/monthPicker/monthPicker.component.js +0 -233
- package/dist/es5/src/picker/components/monthPicker/monthPicker.interfaces.js +0 -11
- package/dist/es5/src/picker/components/picker/picker.component.animations.js +0 -77
- package/dist/es5/src/picker/components/picker/picker.component.js +0 -460
- package/dist/es5/src/picker/components/pickerBase.component.js +0 -561
- package/dist/es5/src/picker/components/yearPicker/yearPicker.component.js +0 -253
- package/dist/es5/src/picker/components/yearPicker/yearPicker.interfaces.js +0 -11
- package/dist/es5/src/picker/interfaces.js +0 -10
- package/dist/es5/src/picker/misc/datetimePicker.interface.js +0 -245
- package/dist/es5/src/picker/misc/tokens.js +0 -12
- package/dist/es5/src/picker/modules/picker.module.js +0 -39
- package/dist/es5/src/picker/types.js +0 -13
- package/dist/es5/src/pipes/dateConvert.pipe.js +0 -63
- package/dist/es5/src/pipes/dateFormat.pipe.js +0 -79
- package/dist/es5/src/selector/components/inputDateTime/inputDateTime.component.js +0 -808
- package/dist/es5/src/selector/components/selector/selector.component.animations.js +0 -21
- package/dist/es5/src/selector/components/selector/selector.component.js +0 -653
- package/dist/es5/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +0 -656
- package/dist/es5/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +0 -84
- package/dist/es5/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +0 -84
- package/dist/es5/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +0 -82
- package/dist/es5/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +0 -230
- package/dist/es5/src/selector/interfaces.js +0 -7
- package/dist/es5/src/selector/misc/datetimeSelector.interface.js +0 -106
- package/dist/es5/src/selector/misc/tokens.js +0 -12
- package/dist/es5/src/selector/modules/basicSelector.module.js +0 -24
- package/dist/es5/src/selector/modules/selector.module.js +0 -49
- package/dist/es5/src/selector/types.js +0 -15
- package/dist/es5/src/services/dateApi.interface.js +0 -316
- package/dist/es5/src/services/datePositionParser.interface.js +0 -56
- package/dist/es5/src/services/datePositionParser.service.js +0 -366
- package/dist/es5/src/services/dateTimeRelativeParser.service.js +0 -108
- package/dist/es5/src/services/dateValueProvider.service.js +0 -92
- package/dist/es5/src/services/formatProvider.interface.js +0 -28
- package/dist/es5/src/services/index.js +0 -9
- package/moment/dist/es2015/moment/index.js +0 -10
- package/moment/dist/es2015/moment/public_api.js +0 -7
- package/moment/dist/es2015/moment/src/misc/tokens.js +0 -26
- package/moment/dist/es2015/moment/src/moment.js +0 -8
- package/moment/dist/es2015/moment/src/services/momentDateApi.service.js +0 -466
- package/moment/dist/es5/moment/index.js +0 -10
- package/moment/dist/es5/moment/public_api.js +0 -7
- package/moment/dist/es5/moment/src/misc/tokens.js +0 -26
- package/moment/dist/es5/moment/src/moment.js +0 -8
- package/moment/dist/es5/moment/src/services/momentDateApi.service.js +0 -858
- package/moment/index.d.ts +0 -5
- package/moment/index.d.ts.map +0 -1
- package/moment/index.metadata.json +0 -1
- package/moment/public_api.d.ts +0 -2
- package/moment/public_api.d.ts.map +0 -1
- package/moment/src/moment.d.ts.map +0 -1
- package/moment/src/services/momentDateApi.service.ngfactory.d.ts.map +0 -1
- package/public_api.d.ts +0 -2
- package/public_api.d.ts.map +0 -1
- package/src/datetime.d.ts.map +0 -1
- package/src/modules/datePipes.module.ngfactory.d.ts.map +0 -1
- package/src/picker/components/dayPicker/dayPicker.component.css.shim.ngstyle.d.ts.map +0 -1
- package/src/picker/components/dayPicker/dayPicker.component.ngfactory.d.ts.map +0 -1
- package/src/picker/components/monthPicker/monthPicker.component.css.shim.ngstyle.d.ts.map +0 -1
- package/src/picker/components/monthPicker/monthPicker.component.ngfactory.d.ts.map +0 -1
- package/src/picker/components/picker/picker.component.ngfactory.d.ts.map +0 -1
- package/src/picker/components/yearPicker/yearPicker.component.css.shim.ngstyle.d.ts.map +0 -1
- package/src/picker/components/yearPicker/yearPicker.component.ngfactory.d.ts.map +0 -1
- package/src/picker/modules/picker.module.ngfactory.d.ts.map +0 -1
- package/src/pipes/dateConvert.pipe.ngfactory.d.ts.map +0 -1
- package/src/pipes/dateFormat.pipe.ngfactory.d.ts.map +0 -1
- package/src/selector/components/inputDateTime/inputDateTime.component.css.shim.ngstyle.d.ts.map +0 -1
- package/src/selector/components/inputDateTime/inputDateTime.component.ngfactory.d.ts.map +0 -1
- package/src/selector/components/selector/selector.component.css.shim.ngstyle.d.ts.map +0 -1
- package/src/selector/components/selector/selector.component.ngfactory.d.ts.map +0 -1
- package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.css.shim.ngstyle.d.ts.map +0 -1
- package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.ngfactory.d.ts.map +0 -1
- package/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.ngfactory.d.ts.map +0 -1
- package/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.ngfactory.d.ts.map +0 -1
- package/src/selector/directives/datetimeValidator/datetimeValidator.directive.ngfactory.d.ts.map +0 -1
- package/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.ngfactory.d.ts.map +0 -1
- package/src/selector/modules/basicSelector.module.ngfactory.d.ts.map +0 -1
- package/src/selector/modules/selector.module.ngfactory.d.ts.map +0 -1
- package/src/services/datePositionParser.service.ngfactory.d.ts.map +0 -1
- package/src/services/dateTimeRelativeParser.service.ngfactory.d.ts.map +0 -1
- package/src/services/dateValueProvider.service.ngfactory.d.ts.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export * from './misc/constants';
|
|
2
|
-
export * from './misc/datetime.interface';
|
|
3
|
-
export * from './misc/tokens';
|
|
4
|
-
export * from './misc/validators';
|
|
5
|
-
export * from './selector/interfaces';
|
|
6
|
-
export * from './selector/types';
|
|
7
|
-
export * from './selector/modules/basicSelector.module';
|
|
8
|
-
export * from './selector/modules/selector.module';
|
|
9
|
-
export * from './services';
|
|
10
|
-
export * from './services/datePositionParser.service';
|
|
11
|
-
export * from './services/dateTimeRelativeParser.service';
|
|
12
|
-
export * from './services/dateValueProvider.service';
|
|
13
|
-
export * from './picker/modules/picker.module';
|
|
14
|
-
export * from './picker/interfaces';
|
|
15
|
-
export * from './picker/types';
|
|
16
|
-
export * from './pipes/dateConvert.pipe';
|
|
17
|
-
export * from './pipes/dateFormat.pipe';
|
|
18
|
-
export * from './modules/datePipes.module';
|
|
19
|
-
//# sourceMappingURL=
|
|
1
|
+
export * from './misc/constants';
|
|
2
|
+
export * from './misc/datetime.interface';
|
|
3
|
+
export * from './misc/tokens';
|
|
4
|
+
export * from './misc/validators';
|
|
5
|
+
export * from './selector/interfaces';
|
|
6
|
+
export * from './selector/types';
|
|
7
|
+
export * from './selector/modules/basicSelector.module';
|
|
8
|
+
export * from './selector/modules/selector.module';
|
|
9
|
+
export * from './services';
|
|
10
|
+
export * from './services/datePositionParser.service';
|
|
11
|
+
export * from './services/dateTimeRelativeParser.service';
|
|
12
|
+
export * from './services/dateValueProvider.service';
|
|
13
|
+
export * from './picker/modules/picker.module';
|
|
14
|
+
export * from './picker/interfaces';
|
|
15
|
+
export * from './picker/types';
|
|
16
|
+
export * from './pipes/dateConvert.pipe';
|
|
17
|
+
export * from './pipes/dateFormat.pipe';
|
|
18
|
+
export * from './modules/datePipes.module';
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yCAAyC,CAAC;AACxD,cAAc,oCAAoC,CAAC;AACnD,cAAc,YAAY,CAAC;AAC3B,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './misc/constants';\nexport * from './misc/datetime.interface';\nexport * from './misc/tokens';\nexport * from './misc/validators';\nexport * from './selector/interfaces';\nexport * from './selector/types';\nexport * from './selector/modules/basicSelector.module';\nexport * from './selector/modules/selector.module';\nexport * from './services';\nexport * from './services/datePositionParser.service';\nexport * from './services/dateTimeRelativeParser.service';\nexport * from './services/dateValueProvider.service';\nexport * from './picker/modules/picker.module';\nexport * from './picker/interfaces';\nexport * from './picker/types';\nexport * from './pipes/dateConvert.pipe';\nexport * from './pipes/dateFormat.pipe';\nexport * from './modules/datePipes.module';"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents minute component of datetime
|
|
3
|
+
*/
|
|
4
|
+
export const MINUTE = 'minute';
|
|
5
|
+
/**
|
|
6
|
+
* Represents hour component of datetime
|
|
7
|
+
*/
|
|
8
|
+
export const HOUR = 'hour';
|
|
9
|
+
/**
|
|
10
|
+
* Represents day component of datetime
|
|
11
|
+
*/
|
|
12
|
+
export const DAY = 'day';
|
|
13
|
+
/**
|
|
14
|
+
* Represents week component of datetime
|
|
15
|
+
*/
|
|
16
|
+
export const WEEK = 'week';
|
|
17
|
+
/**
|
|
18
|
+
* Represents month component of datetime
|
|
19
|
+
*/
|
|
20
|
+
export const MONTH = 'month';
|
|
21
|
+
/**
|
|
22
|
+
* Represents quarter component of datetime
|
|
23
|
+
*/
|
|
24
|
+
export const QUARTER = 'quarter';
|
|
25
|
+
/**
|
|
26
|
+
* Represents year component of datetime
|
|
27
|
+
*/
|
|
28
|
+
export const YEAR = 'year';
|
|
29
|
+
/**
|
|
30
|
+
* Represents decade component of datetime
|
|
31
|
+
*/
|
|
32
|
+
export const DECADE = 'decade';
|
|
33
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/misc/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC;AAE/B;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC;AAE3B;;GAEG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC;AAEzB;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC;AAE3B;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,OAAO,CAAC;AAE7B;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC;AAE3B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC","sourcesContent":["/**\n * Represents minute component of datetime\n */\nexport const MINUTE = 'minute';\n\n/**\n * Represents hour component of datetime\n */\nexport const HOUR = 'hour';\n\n/**\n * Represents day component of datetime\n */\nexport const DAY = 'day';\n\n/**\n * Represents week component of datetime\n */\nexport const WEEK = 'week';\n\n/**\n * Represents month component of datetime\n */\nexport const MONTH = 'month';\n\n/**\n * Represents quarter component of datetime\n */\nexport const QUARTER = 'quarter';\n\n/**\n * Represents year component of datetime\n */\nexport const YEAR = 'year';\n\n/**\n * Represents decade component of datetime\n */\nexport const DECADE = 'decade';"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datetime.interface.js","sourceRoot":"","sources":["../../../src/misc/datetime.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Represents datetime value as period\n */\nexport interface DateTimeValue<TDate = any>\n{\n /**\n * Starting date and time of period\n */\n from: TDate;\n\n /**\n * Ending date and time of period\n */\n to: TDate;\n}\n\n/**\n * Represents object that holds data for indentification of validity of date time\n */\nexport interface DateTimeValueObject<TDate = any>\n{\n /**\n * Current value of datetime\n */\n readonly value: DateTimeValue<TDate>|null;\n\n /**\n * Indicaiton whether is current value valid, empty value is valid\n */\n readonly valid: boolean;\n\n /**\n * Minimal possible value, that can be\n */\n readonly minValue: TDate|null;\n\n /**\n * Maximal possible value, that can be\n */\n readonly maxValue: TDate|null;\n}"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* Injection token used for obtaining DateApi implementation
|
|
4
|
+
*/
|
|
5
|
+
export const DATE_API = new InjectionToken('DATE_API');
|
|
6
|
+
/**
|
|
7
|
+
* Injection token used for obtaining FormatProvider implementation
|
|
8
|
+
*/
|
|
9
|
+
export const FORMAT_PROVIDER = new InjectionToken('FORMAT_PROVIDER', {
|
|
10
|
+
providedIn: 'root',
|
|
11
|
+
factory: () => {
|
|
12
|
+
return {
|
|
13
|
+
date: 'yyyy-MM-dd',
|
|
14
|
+
dateTime: 'yyyy-MM-dd HH:mm',
|
|
15
|
+
time: 'HH:mm'
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/misc/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAI7C;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA4B,IAAI,cAAc,CAAU,UAAU,CAAC,CAAC;AAEzF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmC,IAAI,cAAc,CAAiB,iBAAiB,EACjB;IACI,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,GAAG,EAAE;QAEV,OAAO;YACH,IAAI,EAAE,YAAY;YAClB,QAAQ,EAAE,kBAAkB;YAC5B,IAAI,EAAE,OAAO;SAChB,CAAC;IACN,CAAC;CACJ,CAAC,CAAC","sourcesContent":["import {InjectionToken} from '@angular/core';\n\nimport {DateApi, FormatProvider} from '../services';\n\n/**\n * Injection token used for obtaining DateApi implementation\n */\nexport const DATE_API: InjectionToken<DateApi> = new InjectionToken<DateApi>('DATE_API');\n\n/**\n * Injection token used for obtaining FormatProvider implementation\n */\nexport const FORMAT_PROVIDER: InjectionToken<FormatProvider> = new InjectionToken<FormatProvider>('FORMAT_PROVIDER',\n {\n providedIn: 'root',\n factory: () =>\n {\n return {\n date: 'yyyy-MM-dd',\n dateTime: 'yyyy-MM-dd HH:mm',\n time: 'HH:mm'\n };\n }\n });"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validations functions for datetime
|
|
3
|
+
*/
|
|
4
|
+
export class Validators {
|
|
5
|
+
/**
|
|
6
|
+
* Creates validator function that validates control if its value is valid datetime value
|
|
7
|
+
* @param datetime - Object storing information about datetime value
|
|
8
|
+
*/
|
|
9
|
+
static datetime(datetime) {
|
|
10
|
+
return () => {
|
|
11
|
+
if (!datetime.valid) {
|
|
12
|
+
return {
|
|
13
|
+
'datetime': true
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Creates validator function that validates control if its value is withing range of minimal datetime value
|
|
21
|
+
* @param datetime - Object storing information about datetime value
|
|
22
|
+
* @param dateApi - Date api object
|
|
23
|
+
*/
|
|
24
|
+
static minDatetime(datetime, dateApi) {
|
|
25
|
+
return (control) => {
|
|
26
|
+
if (!!control.value &&
|
|
27
|
+
datetime.valid &&
|
|
28
|
+
datetime.minValue &&
|
|
29
|
+
dateApi.getValue(control.value).isBefore(datetime.minValue)) {
|
|
30
|
+
return {
|
|
31
|
+
'minDatetime': datetime.minValue,
|
|
32
|
+
'actualValue': control.value
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Creates validator function that validates control if its value is withing range of maximal datetime value
|
|
40
|
+
* @param datetime - Object storing information about datetime value
|
|
41
|
+
* @param dateApi - Date api object
|
|
42
|
+
*/
|
|
43
|
+
static maxDatetime(datetime, dateApi) {
|
|
44
|
+
return (control) => {
|
|
45
|
+
if (!!control.value &&
|
|
46
|
+
datetime.valid &&
|
|
47
|
+
datetime.maxValue &&
|
|
48
|
+
dateApi.getValue(control.value).isAfter(datetime.maxValue)) {
|
|
49
|
+
return {
|
|
50
|
+
'maxDatetime': datetime.maxValue,
|
|
51
|
+
'actualValue': control.value
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/misc/validators.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,OAAO,UAAU;IAEnB;;;OAGG;IACI,MAAM,CAAC,QAAQ,CAAc,QAAoC;QAEpE,OAAO,GAA0B,EAAE;YAE/B,IAAG,CAAC,QAAQ,CAAC,KAAK,EAClB;gBACI,OAAO;oBACH,UAAU,EAAE,IAAI;iBACnB,CAAC;aACL;YAED,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC;IACN,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAc,QAAoC,EAAE,OAAuB;QAEhG,OAAO,CAAC,OAAwB,EAAyB,EAAE;YAEvD,IAAG,CAAC,CAAC,OAAO,CAAC,KAAK;gBACf,QAAQ,CAAC,KAAK;gBACd,QAAQ,CAAC,QAAQ;gBACjB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAC9D;gBACI,OAAO;oBACH,aAAa,EAAE,QAAQ,CAAC,QAAQ;oBAChC,aAAa,EAAE,OAAO,CAAC,KAAK;iBAC/B,CAAC;aACL;YAED,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC;IACN,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAc,QAAoC,EAAE,OAAuB;QAEhG,OAAO,CAAC,OAAwB,EAAyB,EAAE;YAEvD,IAAG,CAAC,CAAC,OAAO,CAAC,KAAK;gBACf,QAAQ,CAAC,KAAK;gBACd,QAAQ,CAAC,QAAQ;gBACjB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAC7D;gBACI,OAAO;oBACH,aAAa,EAAE,QAAQ,CAAC,QAAQ;oBAChC,aAAa,EAAE,OAAO,CAAC,KAAK;iBAC/B,CAAC;aACL;YAED,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC;IACN,CAAC;CACJ","sourcesContent":["import {AbstractControl, ValidationErrors, ValidatorFn} from '@angular/forms';\n\nimport {DateApi} from '../services';\nimport {DateTimeValueObject} from './datetime.interface';\n\n/**\n * Validations functions for datetime\n */\nexport class Validators\n{\n /**\n * Creates validator function that validates control if its value is valid datetime value\n * @param datetime - Object storing information about datetime value\n */\n public static datetime<TDate = any>(datetime: DateTimeValueObject<TDate>): ValidatorFn\n {\n return (): ValidationErrors|null =>\n {\n if(!datetime.valid)\n {\n return {\n 'datetime': true\n };\n }\n\n return null;\n };\n }\n\n /**\n * Creates validator function that validates control if its value is withing range of minimal datetime value\n * @param datetime - Object storing information about datetime value\n * @param dateApi - Date api object\n */\n public static minDatetime<TDate = any>(datetime: DateTimeValueObject<TDate>, dateApi: DateApi<TDate>): ValidatorFn\n {\n return (control: AbstractControl): ValidationErrors|null =>\n {\n if(!!control.value &&\n datetime.valid &&\n datetime.minValue &&\n dateApi.getValue(control.value).isBefore(datetime.minValue))\n {\n return {\n 'minDatetime': datetime.minValue,\n 'actualValue': control.value\n };\n }\n\n return null;\n };\n }\n\n /**\n * Creates validator function that validates control if its value is withing range of maximal datetime value\n * @param datetime - Object storing information about datetime value\n * @param dateApi - Date api object\n */\n public static maxDatetime<TDate = any>(datetime: DateTimeValueObject<TDate>, dateApi: DateApi<TDate>): ValidatorFn\n {\n return (control: AbstractControl): ValidationErrors|null =>\n {\n if(!!control.value &&\n datetime.valid &&\n datetime.maxValue &&\n dateApi.getValue(control.value).isAfter(datetime.maxValue))\n {\n return {\n 'maxDatetime': datetime.maxValue,\n 'actualValue': control.value\n };\n }\n\n return null;\n };\n }\n}"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { AsRequiredTypePipe } from '../pipes/asRequiredType';
|
|
3
|
+
import { DateConvertPipe } from '../pipes/dateConvert.pipe';
|
|
4
|
+
import { DateFormatPipe } from '../pipes/dateFormat.pipe';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Module used for exporting date pipes
|
|
8
|
+
*/
|
|
9
|
+
export class DatePipesModule {
|
|
10
|
+
}
|
|
11
|
+
DatePipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DatePipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
12
|
+
DatePipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DatePipesModule, declarations: [AsRequiredTypePipe,
|
|
13
|
+
DateFormatPipe,
|
|
14
|
+
DateConvertPipe], exports: [AsRequiredTypePipe,
|
|
15
|
+
DateFormatPipe,
|
|
16
|
+
DateConvertPipe] });
|
|
17
|
+
DatePipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DatePipesModule });
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DatePipesModule, decorators: [{
|
|
19
|
+
type: NgModule,
|
|
20
|
+
args: [{
|
|
21
|
+
declarations: [
|
|
22
|
+
AsRequiredTypePipe,
|
|
23
|
+
DateFormatPipe,
|
|
24
|
+
DateConvertPipe,
|
|
25
|
+
],
|
|
26
|
+
exports: [
|
|
27
|
+
AsRequiredTypePipe,
|
|
28
|
+
DateFormatPipe,
|
|
29
|
+
DateConvertPipe,
|
|
30
|
+
]
|
|
31
|
+
}]
|
|
32
|
+
}] });
|
|
33
|
+
//# sourceMappingURL=datePipes.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datePipes.module.js","sourceRoot":"","sources":["../../../src/modules/datePipes.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;;AAExD;;GAEG;AAgBH,MAAM,OAAO,eAAe;;4GAAf,eAAe;6GAAf,eAAe,iBAXpB,kBAAkB;QAClB,cAAc;QACd,eAAe,aAIf,kBAAkB;QAClB,cAAc;QACd,eAAe;6GAGV,eAAe;2FAAf,eAAe;kBAf3B,QAAQ;mBACT;oBACI,YAAY,EACZ;wBACI,kBAAkB;wBAClB,cAAc;wBACd,eAAe;qBAClB;oBACD,OAAO,EACP;wBACI,kBAAkB;wBAClB,cAAc;wBACd,eAAe;qBAClB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {AsRequiredTypePipe} from '../pipes/asRequiredType';\nimport {DateConvertPipe} from '../pipes/dateConvert.pipe';\nimport {DateFormatPipe} from '../pipes/dateFormat.pipe';\n\n/**\n * Module used for exporting date pipes\n */\n@NgModule(\n{\n declarations:\n [\n AsRequiredTypePipe,\n DateFormatPipe,\n DateConvertPipe,\n ],\n exports:\n [\n AsRequiredTypePipe,\n DateFormatPipe,\n DateConvertPipe,\n ]\n})\nexport class DatePipesModule\n{\n}"]}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { extend } from '@jscrpt/common';
|
|
3
|
+
import { DATE_API } from '../../../misc/tokens';
|
|
4
|
+
import { PickerBaseComponent } from '../pickerBase.component';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "@angular/common";
|
|
7
|
+
import * as i2 from "../../../pipes/asRequiredType";
|
|
8
|
+
/**
|
|
9
|
+
* Default styles for picker
|
|
10
|
+
*/
|
|
11
|
+
const defaultStyles = {
|
|
12
|
+
periodSelection: 'period',
|
|
13
|
+
previousPeriod: 'fas fa-angle-left clickable',
|
|
14
|
+
nextPeriod: 'fas fa-angle-right clickable',
|
|
15
|
+
periodValue: 'period-value',
|
|
16
|
+
periodData: 'period-data',
|
|
17
|
+
periodDatum: 'period-datum clickable',
|
|
18
|
+
weekdayName: 'weekday'
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Component used for displaying day picker
|
|
22
|
+
*/
|
|
23
|
+
export class DateTimeDayPickerComponent extends PickerBaseComponent {
|
|
24
|
+
//######################### constructor #########################
|
|
25
|
+
constructor(dateApi, changeDetector) {
|
|
26
|
+
super(dateApi, changeDetector);
|
|
27
|
+
//######################### protected fields #########################
|
|
28
|
+
/**
|
|
29
|
+
* Stored this picker month data
|
|
30
|
+
*/
|
|
31
|
+
this._thisMonthData = [];
|
|
32
|
+
//######################### public properties - template bindings #########################
|
|
33
|
+
/**
|
|
34
|
+
* Names of days
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
this.weekdays = [];
|
|
38
|
+
this.cssClasses = extend(true, {}, defaultStyles);
|
|
39
|
+
this.weekdays = this._dateApi.weekdaysShort();
|
|
40
|
+
}
|
|
41
|
+
//######################### public methods - template bindings #########################
|
|
42
|
+
/**
|
|
43
|
+
* Changes displayed month to next month
|
|
44
|
+
* @param event - Event that occured
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
nextMonth(event) {
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
this.displayDate.addMonths(1);
|
|
50
|
+
this.display(this.displayDate);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Changes displayed month to previous month
|
|
54
|
+
* @param event - Event that occured
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
previousMonth(event) {
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
this.displayDate.subtractMonths(1);
|
|
60
|
+
this.display(this.displayDate);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Selects day
|
|
64
|
+
* @param event - Event that occured
|
|
65
|
+
* @param day - Selects day
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
select(event, day) {
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
if (day.disabled) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
//handle selection of value
|
|
74
|
+
if (!this.canGoDown) {
|
|
75
|
+
this._setPeriod(day);
|
|
76
|
+
this._value =
|
|
77
|
+
{
|
|
78
|
+
from: day.date,
|
|
79
|
+
to: this._endOfPeriod(day)
|
|
80
|
+
};
|
|
81
|
+
this._valueChange.next();
|
|
82
|
+
if (day.otherMonth) {
|
|
83
|
+
this.display(this._dateApi.getValue(day.date));
|
|
84
|
+
}
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
this._scaleDown.next(day.date);
|
|
88
|
+
}
|
|
89
|
+
//######################### public methods - implementation of DateTimePicker #########################
|
|
90
|
+
/**
|
|
91
|
+
* Set displays date to be displayed
|
|
92
|
+
* @param value - Value that identifies period that is going to be displayed
|
|
93
|
+
*/
|
|
94
|
+
display(value) {
|
|
95
|
+
this.displayDate = value;
|
|
96
|
+
this.periodData = [];
|
|
97
|
+
this._thisMonthData = [];
|
|
98
|
+
const currentMonthDate = this.displayDate.value;
|
|
99
|
+
const today = this._dateApi.now().value;
|
|
100
|
+
this.displayDate
|
|
101
|
+
.startOfMonth()
|
|
102
|
+
.updateOriginal()
|
|
103
|
+
.startOfWeek();
|
|
104
|
+
do {
|
|
105
|
+
for (let x = 0; x < 7; x++) {
|
|
106
|
+
const day = this.displayDate.dayOfMonth();
|
|
107
|
+
const otherMonth = !this.displayDate.isSameMonth(currentMonthDate);
|
|
108
|
+
const data = {
|
|
109
|
+
active: false,
|
|
110
|
+
disabled: false,
|
|
111
|
+
betweenActive: false,
|
|
112
|
+
date: this.displayDate.value,
|
|
113
|
+
otherMonth: otherMonth,
|
|
114
|
+
today: this.displayDate.isSameDay(today),
|
|
115
|
+
weekend: this.displayDate.isWeekend(),
|
|
116
|
+
day: day
|
|
117
|
+
};
|
|
118
|
+
this.periodData.push(data);
|
|
119
|
+
if (!otherMonth) {
|
|
120
|
+
this._thisMonthData.push(data);
|
|
121
|
+
}
|
|
122
|
+
this.displayDate.addDays(1);
|
|
123
|
+
}
|
|
124
|
+
} while (this.displayDate.isSameMonth(currentMonthDate));
|
|
125
|
+
this.displayDate.resetOriginal();
|
|
126
|
+
this._updateMinMax();
|
|
127
|
+
//set value if exists
|
|
128
|
+
if (this._value && (this.displayDate.isSameMonth(this._value.from) || this.displayDate.isSameMonth(this._value.to))) {
|
|
129
|
+
this.setValue(this._value);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//######################### protected methods #########################
|
|
133
|
+
/**
|
|
134
|
+
* Obtains end of period
|
|
135
|
+
* @param period - Period for which should be end obtained
|
|
136
|
+
*/
|
|
137
|
+
_endOfPeriod(period) {
|
|
138
|
+
return this._dateApi.getValue(period.date).endOfDay().value;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Tests whether provided value is in same period as displayed picker
|
|
142
|
+
* @param val - Tested value for same period as displayed picker
|
|
143
|
+
*/
|
|
144
|
+
_isSamePeriodAsDisplayed(val) {
|
|
145
|
+
return val.isSameMonth(this.displayDate.value);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Tests whether provided value is in same period target value
|
|
149
|
+
* @param val - Tested value
|
|
150
|
+
* @param target - Target value to be tested against
|
|
151
|
+
*/
|
|
152
|
+
_isSamePeriod(val, target) {
|
|
153
|
+
return val.isSameDay(target);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Gets period data for specified value
|
|
157
|
+
* @param val - Value for which is period data obtained
|
|
158
|
+
*/
|
|
159
|
+
_getPeriodData(val) {
|
|
160
|
+
return this._thisMonthData[val.dayOfMonth() - 1];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
DateTimeDayPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeDayPickerComponent, deps: [{ token: DATE_API }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
164
|
+
DateTimeDayPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DateTimeDayPickerComponent, selector: "date-time-day-picker", usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequiredType\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequiredType\" [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequiredType\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequiredType\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequiredType\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>", styles: [".period-data\r\n{\r\n grid-template-columns: repeat(7, 1fr);\r\n}\r\n\r\n.weekday\r\n{\r\n text-align: center;\r\n font-weight: bold;\r\n opacity: 0.7;\r\n margin-bottom: 6px;\r\n}\r\n\r\n.period-datum:not(.other-month)\r\n{\r\n font-weight: bold;\r\n}\r\n\r\n.other-month\r\n{\r\n opacity: 0.5;\r\n}"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "asRequiredType": i2.AsRequiredTypePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
165
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeDayPickerComponent, decorators: [{
|
|
166
|
+
type: Component,
|
|
167
|
+
args: [{ selector: 'date-time-day-picker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequiredType\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequiredType\" [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequiredType\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequiredType\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequiredType\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>", styles: [".period-data\r\n{\r\n grid-template-columns: repeat(7, 1fr);\r\n}\r\n\r\n.weekday\r\n{\r\n text-align: center;\r\n font-weight: bold;\r\n opacity: 0.7;\r\n margin-bottom: 6px;\r\n}\r\n\r\n.period-datum:not(.other-month)\r\n{\r\n font-weight: bold;\r\n}\r\n\r\n.other-month\r\n{\r\n opacity: 0.5;\r\n}"] }]
|
|
168
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
169
|
+
type: Inject,
|
|
170
|
+
args: [DATE_API]
|
|
171
|
+
}] }, { type: i0.ChangeDetectorRef }]; } });
|
|
172
|
+
//# sourceMappingURL=dayPicker.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dayPicker.component.js","sourceRoot":"","sources":["../../../../../src/picker/components/dayPicker/dayPicker.component.ts","../../../../../src/picker/components/dayPicker/dayPicker.component.html"],"names":[],"mappings":"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","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef} from '@angular/core';\nimport {extend} from '@jscrpt/common';\n\nimport {DATE_API} from '../../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../../services/dateApi.interface';\nimport {DateTimePicker, DayData, PeriodData} from '../../misc/datetimePicker.interface';\nimport {PickerBaseComponent} from '../pickerBase.component';\nimport {DayPickerCssClasses} from './dayPicker.interfaces';\n\n/**\n * Default styles for picker\n */\nconst defaultStyles: DayPickerCssClasses =\n{\n periodSelection: 'period',\n previousPeriod: 'fas fa-angle-left clickable',\n nextPeriod: 'fas fa-angle-right clickable',\n periodValue: 'period-value',\n periodData: 'period-data',\n periodDatum: 'period-datum clickable',\n weekdayName: 'weekday'\n};\n\n/**\n * Component used for displaying day picker\n */\n@Component(\n{\n selector: 'date-time-day-picker',\n templateUrl: 'dayPicker.component.html',\n styleUrls: ['dayPicker.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimeDayPickerComponent<TDate = any> extends PickerBaseComponent<TDate, DayData<TDate>, DayPickerCssClasses> implements DateTimePicker<TDate, DayPickerCssClasses>\n{\n //######################### protected fields #########################\n\n /**\n * Stored this picker month data\n */\n protected _thisMonthData: DayData<TDate>[] = [];\n\n //######################### public properties - template bindings #########################\n\n /**\n * Names of days\n * @internal\n */\n public weekdays: string[] = [];\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) dateApi: DateApi<TDate>,\n changeDetector: ChangeDetectorRef)\n {\n super(dateApi, changeDetector);\n\n this.cssClasses = extend(true, {}, defaultStyles);\n this.weekdays = this._dateApi.weekdaysShort();\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed month to next month\n * @param event - Event that occured\n * @internal\n */\n public nextMonth(event: Event)\n {\n event.preventDefault();\n this.displayDate!.addMonths(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Changes displayed month to previous month\n * @param event - Event that occured\n * @internal\n */\n public previousMonth(event: Event)\n {\n event.preventDefault();\n this.displayDate!.subtractMonths(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Selects day\n * @param event - Event that occured\n * @param day - Selects day \n * @internal\n */\n public override select(event: Event, day: DayData<TDate>)\n {\n event.preventDefault();\n\n if(day.disabled)\n {\n return;\n }\n\n //handle selection of value\n if(!this.canGoDown)\n {\n this._setPeriod(day);\n\n this._value =\n {\n from: day.date,\n to: this._endOfPeriod(day)\n };\n \n this._valueChange.next();\n\n if(day.otherMonth)\n {\n this.display(this._dateApi.getValue(day.date));\n }\n\n return;\n }\n\n this._scaleDown.next(day.date);\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Set displays date to be displayed\n * @param value - Value that identifies period that is going to be displayed\n */\n public display(value: DateApiObject<TDate>): void\n {\n this.displayDate = value;\n this.periodData = [];\n this._thisMonthData = [];\n const currentMonthDate = this.displayDate.value;\n const today = this._dateApi.now().value;\n\n this.displayDate\n .startOfMonth()\n .updateOriginal()\n .startOfWeek();\n\n do\n {\n for(let x = 0; x < 7; x++)\n {\n const day = this.displayDate.dayOfMonth();\n const otherMonth = !this.displayDate.isSameMonth(currentMonthDate);\n const data = \n {\n active: false,\n disabled: false,\n betweenActive: false,\n date: this.displayDate.value,\n otherMonth: otherMonth,\n today: this.displayDate.isSameDay(today),\n weekend: this.displayDate.isWeekend(),\n day: day\n };\n\n this.periodData.push(data);\n\n if(!otherMonth)\n {\n this._thisMonthData.push(data);\n }\n\n this.displayDate.addDays(1);\n }\n }\n while(this.displayDate.isSameMonth(currentMonthDate));\n\n this.displayDate.resetOriginal();\n this._updateMinMax();\n\n //set value if exists\n if(this._value && (this.displayDate.isSameMonth(this._value.from) || this.displayDate.isSameMonth(this._value.to)))\n {\n this.setValue(this._value);\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Obtains end of period\n * @param period - Period for which should be end obtained\n */\n protected _endOfPeriod(period: PeriodData<TDate>): TDate\n {\n return this._dateApi.getValue(period.date).endOfDay().value;\n }\n\n /**\n * Tests whether provided value is in same period as displayed picker\n * @param val - Tested value for same period as displayed picker\n */\n protected _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean\n {\n return val.isSameMonth(this.displayDate!.value);\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameDay(target);\n }\n\n /**\n * Gets period data for specified value\n * @param val - Value for which is period data obtained\n */\n protected _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>\n {\n return this._thisMonthData[val.dayOfMonth() - 1];\n }\n}","<div [ngClass]=\"cssClasses?.periodSelection | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequiredType\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequiredType\" [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequiredType\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequiredType\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequiredType\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dayPicker.interfaces.js","sourceRoot":"","sources":["../../../../../src/picker/components/dayPicker/dayPicker.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import {CommonPickerCssClasses} from '../../misc/datetimePicker.interface';\n\n/**\n * Specific css classes for day picker\n */\nexport interface DayPickerCssClasses extends CommonPickerCssClasses\n{\n /**\n * Element displaying weekday name\n */\n weekdayName?: string;\n}"]}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { extend } from '@jscrpt/common';
|
|
3
|
+
import { DATE_API } from '../../../misc/tokens';
|
|
4
|
+
import { PickerBaseComponent } from '../pickerBase.component';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "@angular/common";
|
|
7
|
+
import * as i2 from "../../../pipes/asRequiredType";
|
|
8
|
+
/**
|
|
9
|
+
* Default styles for picker
|
|
10
|
+
*/
|
|
11
|
+
const defaultStyles = {
|
|
12
|
+
periodSelection: 'period',
|
|
13
|
+
previousPeriod: 'fas fa-angle-left clickable',
|
|
14
|
+
nextPeriod: 'fas fa-angle-right clickable',
|
|
15
|
+
periodValue: 'period-value',
|
|
16
|
+
periodData: 'period-data',
|
|
17
|
+
periodDatum: 'period-datum clickable'
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Component used for displaying month picker
|
|
21
|
+
*/
|
|
22
|
+
export class DateTimeMonthPickerComponent extends PickerBaseComponent {
|
|
23
|
+
//######################### constructor #########################
|
|
24
|
+
constructor(dateApi, changeDetector) {
|
|
25
|
+
super(dateApi, changeDetector);
|
|
26
|
+
this.cssClasses = extend(true, {}, defaultStyles);
|
|
27
|
+
}
|
|
28
|
+
//######################### public methods - template bindings #########################
|
|
29
|
+
/**
|
|
30
|
+
* Changes displayed year to next year
|
|
31
|
+
* @param event - Event that occured
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
nextYear(event) {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
this.displayDate.addYears(1);
|
|
37
|
+
this.display(this.displayDate);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Changes displayed year to previous year
|
|
41
|
+
* @param event - Event that occured
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
previousYear(event) {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
this.displayDate.subtractYears(1);
|
|
47
|
+
this.display(this.displayDate);
|
|
48
|
+
}
|
|
49
|
+
//######################### public methods - implementation of DateTimePicker #########################
|
|
50
|
+
/**
|
|
51
|
+
* Set displays date to be displayed
|
|
52
|
+
* @param value - Value that identifies period that is going to be displayed
|
|
53
|
+
*/
|
|
54
|
+
display(value) {
|
|
55
|
+
this.displayDate = value;
|
|
56
|
+
const monthOfYear = this.displayDate.startOfYear().updateOriginal();
|
|
57
|
+
this.periodData = [];
|
|
58
|
+
for (let x = 0; x < 12; x++) {
|
|
59
|
+
this.periodData.push({
|
|
60
|
+
active: false,
|
|
61
|
+
disabled: false,
|
|
62
|
+
date: monthOfYear.value,
|
|
63
|
+
name: monthOfYear.format('MMM')
|
|
64
|
+
});
|
|
65
|
+
monthOfYear.addMonths(1);
|
|
66
|
+
}
|
|
67
|
+
this.displayDate.resetOriginal();
|
|
68
|
+
this._updateMinMax();
|
|
69
|
+
//set value if exists
|
|
70
|
+
if (this._value && (this.displayDate.isSameYear(this._value.from) || this.displayDate.isSameYear(this._value.to))) {
|
|
71
|
+
this.setValue(this._value);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//######################### protected methods #########################
|
|
75
|
+
/**
|
|
76
|
+
* Obtains end of period
|
|
77
|
+
* @param period - Period for which should be end obtained
|
|
78
|
+
*/
|
|
79
|
+
_endOfPeriod(period) {
|
|
80
|
+
return this._dateApi.getValue(period.date).endOfMonth().value;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Tests whether provided value is in same period as displayed picker
|
|
84
|
+
* @param val - Tested value for same period as displayed picker
|
|
85
|
+
*/
|
|
86
|
+
_isSamePeriodAsDisplayed(val) {
|
|
87
|
+
return val.isSameYear(this.displayDate.value);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Tests whether provided value is in same period target value
|
|
91
|
+
* @param val - Tested value
|
|
92
|
+
* @param target - Target value to be tested against
|
|
93
|
+
*/
|
|
94
|
+
_isSamePeriod(val, target) {
|
|
95
|
+
return val.isSameMonth(target);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Gets period data for specified value
|
|
99
|
+
* @param val - Value for which is period data obtained
|
|
100
|
+
*/
|
|
101
|
+
_getPeriodData(val) {
|
|
102
|
+
return this.periodData[val.month()];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
DateTimeMonthPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeMonthPickerComponent, deps: [{ token: DATE_API }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
106
|
+
DateTimeMonthPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DateTimeMonthPickerComponent, selector: "date-time-month-picker", usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequiredType\" (mousedown)=\"previousYear($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequiredType\" [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.format('yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequiredType\" (mousedown)=\"nextYear($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequiredType\">\r\n <div *ngFor=\"let month of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequiredType\"\r\n [class.active]=\"month.active\"\r\n [class.disabled]=\"month.disabled\"\r\n (mousedown)=\"select($event, month)\">{{month.name}}</div>\r\n</div>", styles: [".period-data\r\n{\r\n grid-template-columns: repeat(4, 1fr);\r\n}"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "asRequiredType": i2.AsRequiredTypePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeMonthPickerComponent, decorators: [{
|
|
108
|
+
type: Component,
|
|
109
|
+
args: [{ selector: 'date-time-month-picker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequiredType\" (mousedown)=\"previousYear($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequiredType\" [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.format('yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequiredType\" (mousedown)=\"nextYear($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequiredType\">\r\n <div *ngFor=\"let month of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequiredType\"\r\n [class.active]=\"month.active\"\r\n [class.disabled]=\"month.disabled\"\r\n (mousedown)=\"select($event, month)\">{{month.name}}</div>\r\n</div>", styles: [".period-data\r\n{\r\n grid-template-columns: repeat(4, 1fr);\r\n}"] }]
|
|
110
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
111
|
+
type: Inject,
|
|
112
|
+
args: [DATE_API]
|
|
113
|
+
}] }, { type: i0.ChangeDetectorRef }]; } });
|
|
114
|
+
//# sourceMappingURL=monthPicker.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monthPicker.component.js","sourceRoot":"","sources":["../../../../../src/picker/components/monthPicker/monthPicker.component.ts","../../../../../src/picker/components/monthPicker/monthPicker.component.html"],"names":[],"mappings":"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","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef} from '@angular/core';\nimport {extend} from '@jscrpt/common';\n\nimport {DATE_API} from '../../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../../services/dateApi.interface';\nimport {DateTimePicker, MonthData, PeriodData} from '../../misc/datetimePicker.interface';\nimport {PickerBaseComponent} from '../pickerBase.component';\nimport {MonthPickerCssClasses} from './monthPicker.interfaces';\n\n/**\n * Default styles for picker\n */\nconst defaultStyles: MonthPickerCssClasses =\n{\n periodSelection: 'period',\n previousPeriod: 'fas fa-angle-left clickable',\n nextPeriod: 'fas fa-angle-right clickable',\n periodValue: 'period-value',\n periodData: 'period-data',\n periodDatum: 'period-datum clickable'\n};\n\n/**\n * Component used for displaying month picker\n */\n@Component(\n{\n selector: 'date-time-month-picker',\n templateUrl: 'monthPicker.component.html',\n styleUrls: ['monthPicker.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimeMonthPickerComponent<TDate = any> extends PickerBaseComponent<TDate, MonthData<TDate>, MonthPickerCssClasses> implements DateTimePicker<TDate, MonthPickerCssClasses>\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_API) dateApi: DateApi<TDate>,\n changeDetector: ChangeDetectorRef)\n {\n super(dateApi, changeDetector);\n\n this.cssClasses = extend(true, {}, defaultStyles);\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed year to next year\n * @param event - Event that occured\n * @internal\n */\n public nextYear(event: Event)\n {\n event.preventDefault();\n this.displayDate!.addYears(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Changes displayed year to previous year\n * @param event - Event that occured\n * @internal\n */\n public previousYear(event: Event)\n {\n event.preventDefault();\n this.displayDate!.subtractYears(1);\n\n this.display(this.displayDate!);\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Set displays date to be displayed\n * @param value - Value that identifies period that is going to be displayed\n */\n public display(value: DateApiObject<TDate>): void\n {\n this.displayDate = value;\n\n const monthOfYear = this.displayDate.startOfYear().updateOriginal();\n this.periodData = [];\n\n for(let x = 0; x < 12; x++)\n {\n this.periodData.push(\n {\n active: false,\n disabled: false,\n date: monthOfYear.value,\n name: monthOfYear.format('MMM')\n });\n\n monthOfYear.addMonths(1);\n }\n\n this.displayDate.resetOriginal();\n this._updateMinMax();\n\n //set value if exists\n if(this._value && (this.displayDate.isSameYear(this._value.from) || this.displayDate.isSameYear(this._value.to)))\n {\n this.setValue(this._value);\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Obtains end of period\n * @param period - Period for which should be end obtained\n */\n protected _endOfPeriod(period: PeriodData<TDate>): TDate\n {\n return this._dateApi.getValue(period.date).endOfMonth().value;\n }\n\n /**\n * Tests whether provided value is in same period as displayed picker\n * @param val - Tested value for same period as displayed picker\n */\n protected _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean\n {\n return val.isSameYear(this.displayDate!.value);\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameMonth(target);\n }\n\n /**\n * Gets period data for specified value\n * @param val - Value for which is period data obtained\n */\n protected _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>\n {\n return this.periodData[val.month()];\n }\n}","<div [ngClass]=\"cssClasses?.periodSelection | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequiredType\" (mousedown)=\"previousYear($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequiredType\" [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.format('yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequiredType\" (mousedown)=\"nextYear($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequiredType\">\r\n <div *ngFor=\"let month of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequiredType\"\r\n [class.active]=\"month.active\"\r\n [class.disabled]=\"month.disabled\"\r\n (mousedown)=\"select($event, month)\">{{month.name}}</div>\r\n</div>"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monthPicker.interfaces.js","sourceRoot":"","sources":["../../../../../src/picker/components/monthPicker/monthPicker.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import {CommonPickerCssClasses} from '../../misc/datetimePicker.interface';\n\n/**\n * Specific css classes for month picker\n */\nexport interface MonthPickerCssClasses extends CommonPickerCssClasses\n{\n}"]}
|