@indigina/ui-kit 1.0.80 → 1.0.81

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.
@@ -2279,6 +2279,133 @@
2279
2279
  { type: core.RendererFactory2 }
2280
2280
  ]; };
2281
2281
 
2282
+ exports.KitDaterangeType = void 0;
2283
+ (function (KitDaterangeType) {
2284
+ KitDaterangeType["DEFAULT"] = "default";
2285
+ KitDaterangeType["BUTTON"] = "button";
2286
+ })(exports.KitDaterangeType || (exports.KitDaterangeType = {}));
2287
+ exports.KitDaterangeIconPosition = void 0;
2288
+ (function (KitDaterangeIconPosition) {
2289
+ KitDaterangeIconPosition["LEFT"] = "left";
2290
+ KitDaterangeIconPosition["RIGHT"] = "right";
2291
+ })(exports.KitDaterangeIconPosition || (exports.KitDaterangeIconPosition = {}));
2292
+ var KitDaterangeComponent = /** @class */ (function () {
2293
+ function KitDaterangeComponent() {
2294
+ this.type = exports.KitDaterangeType.DEFAULT;
2295
+ /**
2296
+ * Defines a value that is going to be applied as a daterange format
2297
+ */
2298
+ this.format = 'dd MMM yyyy';
2299
+ /**
2300
+ * Defines a state whether the component will be valid or not
2301
+ */
2302
+ this.isValid = true;
2303
+ /**
2304
+ * Defines a value which used to set position of the calendar icon
2305
+ */
2306
+ this.iconPosition = exports.KitDaterangeIconPosition.RIGHT;
2307
+ /**
2308
+ * Defines a value that is going to be applied as a start date form control
2309
+ */
2310
+ this.startDateControl = new forms.FormControl();
2311
+ /**
2312
+ * Defines a value that is going to be applied as an end date form control
2313
+ */
2314
+ this.endDateControl = new forms.FormControl();
2315
+ /**
2316
+ * An action which is emitted when start date changed
2317
+ */
2318
+ this.startDateChanged = new core.EventEmitter();
2319
+ /**
2320
+ * An action which is emitted when end date changed
2321
+ */
2322
+ this.endDateChanged = new core.EventEmitter();
2323
+ /**
2324
+ * An icon which will be used in a daterange input icon
2325
+ */
2326
+ this.icon = exports.KitSvgIcon.CALENDAR;
2327
+ this.KitDaterangeType = exports.KitDaterangeType;
2328
+ this.KitDaterangeIconPosition = exports.KitDaterangeIconPosition;
2329
+ }
2330
+ KitDaterangeComponent.prototype.openCalendarPopup = function () {
2331
+ this.popup.activate();
2332
+ };
2333
+ KitDaterangeComponent.prototype.onStartDateChange = function (value) {
2334
+ this.startDateChanged.emit(value);
2335
+ this.startDateControl.patchValue(value);
2336
+ this.startDateControl.markAsDirty();
2337
+ };
2338
+ KitDaterangeComponent.prototype.onEndDateChange = function (value) {
2339
+ this.endDateChanged.emit(value);
2340
+ this.endDateControl.patchValue(value);
2341
+ this.endDateControl.markAsDirty();
2342
+ };
2343
+ KitDaterangeComponent.prototype.onBlur = function () {
2344
+ this.startDateControl.markAsTouched();
2345
+ this.endDateControl.markAsTouched();
2346
+ };
2347
+ return KitDaterangeComponent;
2348
+ }());
2349
+ KitDaterangeComponent.decorators = [
2350
+ { type: core.Component, args: [{
2351
+ selector: 'kit-daterange',
2352
+ template: "<div class=\"kit-daterange\"\n [class.disabled]=\"disabled\"\n [class.invalid]=\"!isValid\"\n [ngClass]=\"[iconPosition, type]\">\n <button *ngIf=\"type === KitDaterangeType.BUTTON\"\n #anchor\n class=\"daterange-button\"\n [disabled]=\"disabled\"\n (click)=\"openCalendarPopup()\">\n <div class=\"button-text\">{{ label }}</div>\n <kit-svg-icon *ngIf=\"icon\"\n class=\"button-icon\"\n [icon]=\"icon\"\n ></kit-svg-icon>\n </button>\n <kendo-daterange class=\"daterange-wrapper\">\n <div class=\"daterange-input-wrapper\">\n <kendo-label *ngIf=\"startLabel\" class=\"label display-block\"\n [text]=\"startLabel\"\n [for]=\"startInput\"\n ></kendo-label>\n <div class=\"daterange-input\">\n <kendo-dateinput #startInput\n kendoDateRangeStartInput\n [placeholder]=\"startPlaceholder\"\n [format]=\"format\"\n [value]=\"startDateControl.value || defaultStartDate\"\n [min]=\"min\"\n [disabled]=\"disabled\"\n (blur)=\"onBlur()\"\n (valueChange)=\"onStartDateChange($event)\"\n ></kendo-dateinput>\n <button class=\"daterange-input-button\"\n (click)=\"openCalendarPopup()\">\n <kit-svg-icon *ngIf=\"icon\"\n class=\"button-icon\"\n [icon]=\"icon\"\n ></kit-svg-icon>\n </button>\n </div>\n </div>\n <div class=\"daterange-input-wrapper\">\n <kendo-label *ngIf=\"endLabel\" class=\"label display-block\"\n [text]=\"endLabel\"\n [for]=\"endInput\"\n ></kendo-label>\n <div class=\"daterange-input\">\n <kendo-dateinput #endInput\n kendoDateRangeEndInput\n [placeholder]=\"endPlaceholder\"\n [format]=\"format\"\n [value]=\"endDateControl.value || defaultEndDate\"\n [max]=\"max\"\n [disabled]=\"disabled\"\n (blur)=\"onBlur()\"\n (valueChange)=\"onEndDateChange($event)\"\n ></kendo-dateinput>\n <button class=\"daterange-input-button\"\n (click)=\"openCalendarPopup()\">\n <kit-svg-icon *ngIf=\"icon\"\n class=\"button-icon\"\n [icon]=\"icon\"\n ></kit-svg-icon>\n </button>\n </div>\n </div>\n <kendo-daterange-popup #popup appendTo=\"component\" [anchor]=\"anchor\"></kendo-daterange-popup>\n </kendo-daterange>\n <kit-input-message *ngIf=\"messageText\"\n [icon]=\"messageIcon\"\n [message]=\"messageText\"\n ></kit-input-message>\n</div>\n",
2353
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
2354
+ encapsulation: core.ViewEncapsulation.None,
2355
+ styles: ["@charset \"UTF-8\";.display-flex{display:flex}.flex-align-items-center{align-items:center}.flex-justify-content-center{justify-content:center}.flex-justify-content-end{justify-content:flex-end}.display-block{display:block}.kit-daterange.button .daterange-input-wrapper{display:none}.kit-daterange.invalid .daterange-button{border-color:#ef3e42;background-color:#f8e0e0}.kit-daterange.invalid .daterange-button .button-text{color:#27282a}.kit-daterange.invalid .k-input{color:#27282a;border-color:#ef3e42;background-color:#f8e0e0}.kit-daterange.disabled .daterange-button{border-color:#c1c7d0;background-color:#f3f4f6;cursor:default}.kit-daterange.disabled .daterange-button .button-text{color:#9a9fa6}.kit-daterange.disabled .daterange-button .button-icon{stroke:#c1c7d0}.kit-daterange.disabled .label{color:#74777d}.kit-daterange.disabled .k-input{color:#9a9fa6;border-color:#c1c7d0;background-color:#f3f4f6}.kit-daterange.disabled .daterange-input-button .button-icon{stroke:#c1c7d0}.kit-daterange.left .daterange-input-button{left:0;right:initial}.kit-daterange.left .k-input{padding:4px 8px 4px 28px}.kit-daterange.left .daterange-button{flex-direction:row-reverse}.kit-daterange .daterange-button{display:flex;align-items:center;padding:8px;width:100%;height:34px;grid-gap:8px;gap:8px;border-radius:4px;border:1px solid #efefef;background:#ffffff;cursor:pointer}.kit-daterange .daterange-button:hover{border-color:#c1c7d0}.kit-daterange .daterange-button .button-text{flex-grow:1;color:#27282a;font-size:13px;text-align:left}.kit-daterange .daterange-button .button-icon{display:block;width:16px;height:16px;fill:transparent;stroke:#002a3a}.kit-daterange .daterange-wrapper{display:flex;grid-gap:8px;gap:8px}.kit-daterange .label{margin-bottom:4px;font-weight:500;font-size:13px;color:#a9a8a8}.kit-daterange .daterange-input{display:flex;align-items:center;position:relative}.kit-daterange .daterange-input:hover .k-input{border-color:#c1c7d0}.kit-daterange .daterange-input-button{position:absolute;right:0;padding:0 8px;border:none;background:none;cursor:pointer}.kit-daterange .daterange-input-button .button-icon{display:block;width:16px;height:16px;fill:transparent;stroke:#002a3a}.kit-daterange .kit-daterange-default{display:flex}.kit-daterange .k-dateinput-wrap{border:none;border-radius:0;background:none}.kit-daterange .k-dateinput-wrap.k-state-focused{box-shadow:none}.kit-daterange .k-dateinput-wrap.k-state-focused .k-input{border-color:#00b0ad}.kit-daterange .k-input{padding:4px 28px 4px 8px;width:100%;height:34px;font-size:13px;font-weight:400;color:#002a3a;border-radius:4px;background-color:#fff;border:1px solid #efefef}.kit-daterange .k-input::placeholder{color:#74777d}.kit-daterange .k-input::selection{background:#00b0ad}.kit-daterange .k-popup{border:1px solid #efefef;box-shadow:none}.kit-daterange .k-popup .k-calendar-header{margin-bottom:6px;padding:6px;font-size:14px;font-weight:500}.kit-daterange .k-popup .k-calendar-title{padding:0;color:#000;line-height:1.26}.kit-daterange .k-popup .k-button:hover:before{background:none}.kit-daterange .k-popup .k-button-icon{padding:0;width:16px;height:16px;color:#002a3a}.kit-daterange .k-popup .k-prev-view .k-icon:before{content:\"\\e016\"}.kit-daterange .k-popup .k-next-view .k-icon:before{content:\"\\e014\"}.kit-daterange .k-popup .k-today{padding:0 6px;color:#56a2f7}.kit-daterange .k-popup .k-today:hover{color:#56a2f7}.kit-daterange .k-popup .k-calendar-th,.kit-daterange .k-popup .k-calendar-td{padding:0;width:40px;height:40px;color:#000;font-weight:500;font-size:13px;line-height:1}.kit-daterange .k-popup .k-calendar-td{border-radius:0;border:1px solid #dfdfdf}.kit-daterange .k-popup .k-calendar-td:hover .k-link{color:#56a2f7;background:#ffffff}.kit-daterange .k-popup .k-calendar-td.k-state-focused .k-link,.kit-daterange .k-popup .k-calendar-td.k-state-active .k-link{box-shadow:none}.kit-daterange .k-popup .k-calendar-td.k-range-start,.kit-daterange .k-popup .k-calendar-td.k-range-end{background:none}.kit-daterange .k-popup .k-calendar-td.k-range-start.k-today .k-link,.kit-daterange .k-popup .k-calendar-td.k-range-end.k-today .k-link{color:#fff}.kit-daterange .k-popup .k-calendar-td.k-range-start .k-link,.kit-daterange .k-popup .k-calendar-td.k-range-end .k-link{color:#fff;border:1px solid #dfdfdf;border-radius:50%;background:#56a2f7}.kit-daterange .k-popup .k-calendar-td.k-range-mid{background:#aad0fb}.kit-daterange .k-popup .k-calendar-td.k-today .k-link{color:#56a2f7}.kit-daterange .k-popup .k-calendar-td.k-other-month .k-link{color:#a9a8a8}.kit-daterange .k-popup .k-link{margin:0;padding:0;width:100%;height:100%}.kit-daterange .k-popup .k-calendar-view{padding:0;grid-gap:0;gap:0}.kit-daterange .k-popup .k-calendar-content{padding:0 10px 10px}.kit-daterange .k-popup .k-calendar-yearview .k-calendar-td,.kit-daterange .k-popup .k-calendar-decadeview .k-calendar-td,.kit-daterange .k-popup .k-calendar-centuryview .k-calendar-td{width:76px;height:76px}.kit-daterange .k-popup .k-range-split-start:after,.kit-daterange .k-popup .k-range-split-end:after{background-image:none}\n"]
2356
+ },] }
2357
+ ];
2358
+ KitDaterangeComponent.propDecorators = {
2359
+ type: [{ type: core.Input }],
2360
+ label: [{ type: core.Input }],
2361
+ startLabel: [{ type: core.Input }],
2362
+ endLabel: [{ type: core.Input }],
2363
+ startPlaceholder: [{ type: core.Input }],
2364
+ endPlaceholder: [{ type: core.Input }],
2365
+ format: [{ type: core.Input }],
2366
+ defaultStartDate: [{ type: core.Input }],
2367
+ defaultEndDate: [{ type: core.Input }],
2368
+ min: [{ type: core.Input }],
2369
+ max: [{ type: core.Input }],
2370
+ disabled: [{ type: core.Input }],
2371
+ isValid: [{ type: core.Input }],
2372
+ iconPosition: [{ type: core.Input }],
2373
+ messageIcon: [{ type: core.Input }],
2374
+ messageText: [{ type: core.Input }],
2375
+ startDateControl: [{ type: core.Input }],
2376
+ endDateControl: [{ type: core.Input }],
2377
+ startDateChanged: [{ type: core.Output }],
2378
+ endDateChanged: [{ type: core.Output }],
2379
+ anchor: [{ type: core.ViewChild, args: ['anchor', { read: core.ElementRef },] }],
2380
+ popup: [{ type: core.ViewChild, args: ['popup', { read: kendoAngularDateinputs.DateRangePopupComponent },] }]
2381
+ };
2382
+
2383
+ var KitDaterangeModule = /** @class */ (function () {
2384
+ function KitDaterangeModule() {
2385
+ }
2386
+ return KitDaterangeModule;
2387
+ }());
2388
+ KitDaterangeModule.decorators = [
2389
+ { type: core.NgModule, args: [{
2390
+ declarations: [
2391
+ KitDaterangeComponent,
2392
+ ],
2393
+ imports: [
2394
+ common.CommonModule,
2395
+ kendoAngularDateinputs.DateInputsModule,
2396
+ kendoAngularLabel.LabelModule,
2397
+ KitSvgIconModule,
2398
+ KitInputMessageModule,
2399
+ ],
2400
+ exports: [
2401
+ KitDaterangeComponent,
2402
+ ],
2403
+ providers: [
2404
+ kendoAngularDateinputs.DateRangeService,
2405
+ ],
2406
+ },] }
2407
+ ];
2408
+
2282
2409
  // KitButton
2283
2410
 
2284
2411
  /**
@@ -2291,6 +2418,8 @@
2291
2418
  exports.KitButtonModule = KitButtonModule;
2292
2419
  exports.KitCheckboxComponent = KitCheckboxComponent;
2293
2420
  exports.KitCheckboxModule = KitCheckboxModule;
2421
+ exports.KitDaterangeComponent = KitDaterangeComponent;
2422
+ exports.KitDaterangeModule = KitDaterangeModule;
2294
2423
  exports.KitDatetimepickerComponent = KitDatetimepickerComponent;
2295
2424
  exports.KitDatetimepickerModule = KitDatetimepickerModule;
2296
2425
  exports.KitDropdownComponent = KitDropdownComponent;