@wavemaker/app-rn-runtime 12.0.0-next.141209 → 12.0.0-next.1417124

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +1 -0
  2. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  3. app-rn-runtime/components/basic/audio/audio.component.js +9 -2
  4. app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
  5. app-rn-runtime/components/basic/audio/audio.styles.js +7 -0
  6. app-rn-runtime/components/basic/audio/audio.styles.js.map +1 -1
  7. app-rn-runtime/components/basic/custom/custom.component.js +1 -1
  8. app-rn-runtime/components/basic/custom/custom.component.js.map +1 -1
  9. app-rn-runtime/components/basic/lottie/lottie.component.js +3 -1
  10. app-rn-runtime/components/basic/lottie/lottie.component.js.map +1 -1
  11. app-rn-runtime/components/basic/search/search.component.js +1 -1
  12. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  13. app-rn-runtime/components/basic/search/search.props.js +1 -0
  14. app-rn-runtime/components/basic/search/search.props.js.map +1 -1
  15. app-rn-runtime/components/basic/skeleton/skeleton.component.js +2 -0
  16. app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
  17. app-rn-runtime/components/basic/video/video.component.js +6 -0
  18. app-rn-runtime/components/basic/video/video.component.js.map +1 -1
  19. app-rn-runtime/components/basic/video/video.styles.js +7 -1
  20. app-rn-runtime/components/basic/video/video.styles.js.map +1 -1
  21. app-rn-runtime/components/container/container.component.js +8 -1
  22. app-rn-runtime/components/container/container.component.js.map +1 -1
  23. app-rn-runtime/components/container/container.props.js +1 -0
  24. app-rn-runtime/components/container/container.props.js.map +1 -1
  25. app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js +1 -0
  26. app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js.map +1 -1
  27. app-rn-runtime/components/container/tabs/tabs.component.js +3 -1
  28. app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
  29. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +4 -0
  30. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  31. app-rn-runtime/components/data/form/form-field/form-field.component.js +2 -1
  32. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  33. app-rn-runtime/components/input/baseinput/baseinput.component.js +46 -10
  34. app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
  35. app-rn-runtime/components/input/basenumber/basenumber.component.js +19 -6
  36. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  37. app-rn-runtime/components/input/calendar/calendar.component.js +25 -0
  38. app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
  39. app-rn-runtime/components/input/calendar/calendar.styles.js +19 -0
  40. app-rn-runtime/components/input/calendar/calendar.styles.js.map +1 -1
  41. app-rn-runtime/components/input/checkbox/checkbox.component.js +23 -3
  42. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  43. app-rn-runtime/components/input/checkbox/checkbox.styles.js +19 -2
  44. app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
  45. app-rn-runtime/components/input/chips/chips.component.js +16 -2
  46. app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
  47. app-rn-runtime/components/input/chips/chips.styles.js +8 -0
  48. app-rn-runtime/components/input/chips/chips.styles.js.map +1 -1
  49. app-rn-runtime/components/input/currency/currency.component.js +14 -4
  50. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  51. app-rn-runtime/components/input/currency/currency.styles.js +43 -1
  52. app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
  53. app-rn-runtime/components/input/epoch/base-datetime.component.js +26 -5
  54. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  55. app-rn-runtime/components/input/epoch/datetime/datetime.props.js +6 -0
  56. app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
  57. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +13 -0
  58. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
  59. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +7 -4
  60. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
  61. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js +3 -0
  62. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js.map +1 -1
  63. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js +7 -4
  64. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js.map +1 -1
  65. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.props.js +3 -0
  66. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.props.js.map +1 -1
  67. app-rn-runtime/components/input/number/number.component.js +17 -3
  68. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  69. app-rn-runtime/components/input/number/number.styles.js +24 -1
  70. app-rn-runtime/components/input/number/number.styles.js.map +1 -1
  71. app-rn-runtime/components/input/radioset/radioset.component.js +12 -7
  72. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  73. app-rn-runtime/components/input/radioset/radioset.props.js +1 -0
  74. app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
  75. app-rn-runtime/components/input/radioset/radioset.styles.js +6 -0
  76. app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
  77. app-rn-runtime/components/input/select/select.component.js +11 -3
  78. app-rn-runtime/components/input/select/select.component.js.map +1 -1
  79. app-rn-runtime/components/input/select/select.styles.js +24 -0
  80. app-rn-runtime/components/input/select/select.styles.js.map +1 -1
  81. app-rn-runtime/components/input/switch/switch.component.js +13 -3
  82. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  83. app-rn-runtime/components/input/switch/switch.styles.js +15 -0
  84. app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
  85. app-rn-runtime/components/input/text/text.component.js +5 -2
  86. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  87. app-rn-runtime/components/input/text/text.props.js +1 -0
  88. app-rn-runtime/components/input/text/text.props.js.map +1 -1
  89. app-rn-runtime/components/input/text/text.styles.js +3 -0
  90. app-rn-runtime/components/input/text/text.styles.js.map +1 -1
  91. app-rn-runtime/components/input/textarea/textarea.component.js +3 -1
  92. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  93. app-rn-runtime/components/input/textarea/textarea.styles.js +3 -0
  94. app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
  95. app-rn-runtime/components/input/toggle/toggle.component.js +6 -0
  96. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  97. app-rn-runtime/components/input/toggle/toggle.props.js +2 -0
  98. app-rn-runtime/components/input/toggle/toggle.props.js.map +1 -1
  99. app-rn-runtime/components/input/toggle/toggle.styles.js +7 -0
  100. app-rn-runtime/components/input/toggle/toggle.styles.js.map +1 -1
  101. app-rn-runtime/components/page/content/content.component.js +4 -19
  102. app-rn-runtime/components/page/content/content.component.js.map +1 -1
  103. app-rn-runtime/components/page/left-panel/left-panel.component.js +4 -1
  104. app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
  105. app-rn-runtime/components/page/page-content/page-content.component.js +43 -12
  106. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  107. app-rn-runtime/core/AppConfig.js.map +1 -1
  108. app-rn-runtime/core/base.component.js +31 -5
  109. app-rn-runtime/core/base.component.js.map +1 -1
  110. app-rn-runtime/core/components/textinput.component.js +9 -7
  111. app-rn-runtime/core/components/textinput.component.js.map +1 -1
  112. app-rn-runtime/core/storage.service.js +15 -0
  113. app-rn-runtime/core/storage.service.js.map +1 -1
  114. app-rn-runtime/core/wm-component-tree.js +58 -0
  115. app-rn-runtime/core/wm-component-tree.js.map +1 -0
  116. app-rn-runtime/package.json +13 -6
  117. app-rn-runtime/runtime/App.js +21 -2
  118. app-rn-runtime/runtime/App.js.map +1 -1
  119. app-rn-runtime/runtime/App.navigator.js +1 -0
  120. app-rn-runtime/runtime/App.navigator.js.map +1 -1
  121. app-rn-runtime/runtime/base-fragment.component.js +18 -0
  122. app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
  123. app-rn-runtime/runtime/base-page.component.js +38 -2
  124. app-rn-runtime/runtime/base-page.component.js.map +1 -1
  125. app-rn-runtime/runtime/base-partial.component.js +3 -0
  126. app-rn-runtime/runtime/base-partial.component.js.map +1 -1
  127. app-rn-runtime/runtime/navigator/drawer.navigator.js +19 -10
  128. app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
  129. app-rn-runtime/runtime/services/app-modal.service.js +4 -4
  130. app-rn-runtime/runtime/services/app-modal.service.js.map +1 -1
  131. app-rn-runtime/styles/theme.js +5 -0
  132. app-rn-runtime/styles/theme.js.map +1 -1
  133. app-rn-runtime/styles/theme.variables.js +1 -1
  134. app-rn-runtime/styles/theme.variables.js.map +1 -1
  135. app-rn-runtime/variables/http.service.js +5 -1
  136. app-rn-runtime/variables/http.service.js.map +1 -1
  137. app-rn-runtime/variables/live-variable.js +14 -0
  138. app-rn-runtime/variables/live-variable.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","isString","moment","BaseComponent","BaseComponentState","MonthView","WmCalendarProps","DEFAULT_CLASS","WmIcon","WmCalendarState","constructor","args","_defineProperty","Map","DEFAULT_DATE_FORMAT","WmCalendar","props","date","d","format","dateWindow","state","calendar","get","updateState","datavalue","selectedDate","invokeEventCallback","events","createElement","iconclass","iconsize","styles","root","marginTop","alignSelf","icon","Math","min","length","Fragment","prepareDataset","dataset","eventStartKey","eventstart","forEach","startDate","has","set","push","onPropertyChange","name","$new","$old","componentDidUpdate","prevProps","prevState","snapshot","renderWidget","style","_background","selectDate","onDateChange","renderChildDay","renderDay","containerStyle","dateSelectedWarpDayStyle","selectedDay","selectedDayTextStyle","selectedDayText","warpRowWeekdays","weekDay","warpRowControlMonthYear","calendarHeader","weekdayStyle","weekDayText","warpDayStyle","dayWrapper","textDayStyle","day","yearTextStyle","yearText","monthTextStyle","monthText","currentDayStyle","today","currentDayTextStyle","todayText","notDayOfCurrentMonthStyle","notDayOfCurrentMonth","renderPrevYearButton","id","getTestId","prevYearBtn","renderPrevMonthButton","prevMonthBtn","renderNextMonthButton","nextMonthBtn","renderNextYearButton","nextYearBtn"],"sources":["calendar.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { isString } from 'lodash';\nimport moment, { Moment } from 'moment';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport { MonthView } from './views/month-view';\nimport WmCalendarProps from './calendar.props';\nimport { DEFAULT_CLASS, WmCalendarStyles } from './calendar.styles';\nimport WmIcon from '../../basic/icon/icon.component';\n\nexport class WmCalendarState extends BaseComponentState<WmCalendarProps> {\n selectedDate: Moment = moment();\n calendar: Map<String, { date: number, events: any []}> = new Map();\n}\n\nconst DEFAULT_DATE_FORMAT = 'DD-MM-YYYY';\n\nexport default class WmCalendar extends BaseComponent<WmCalendarProps, WmCalendarState, WmCalendarStyles> {\n\n constructor(props: WmCalendarProps) {\n super(props, DEFAULT_CLASS, new WmCalendarProps(), new WmCalendarState());\n }\n\n onDateChange = (date: Moment) => {\n const d = moment(date).format(DEFAULT_DATE_FORMAT);\n const dateWindow = this.state.calendar.get(d);\n this.updateState({\n props: {datavalue: d},\n selectedDate: date\n } as WmCalendarState);\n this.invokeEventCallback('onSelect', [d, d, this, dateWindow?.events]);\n }\n\n prepareDataset(dataset: any[]) {\n if (!dataset) {\n return;\n }\n const state = {\n calendar: new Map()\n } as WmCalendarState;\n const eventStartKey = this.state.props.eventstart;\n dataset.forEach(d => {\n let startDate = d[eventStartKey];\n if (!isString(startDate)) {\n startDate = moment(startDate).format(DEFAULT_DATE_FORMAT);\n }\n if (!state.calendar.has(startDate)) {\n state.calendar.set(startDate, {\n date: moment(startDate, DEFAULT_DATE_FORMAT).get('milliseconds'),\n events: []\n });\n }\n const dateWindow = state.calendar.get(startDate);\n dateWindow?.events.push(d);\n });\n this.updateState(state);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch(name) {\n case 'dataset':\n this.prepareDataset($new);\n break;\n case 'datavalue':\n if ($new) {\n this.updateState({\n selectedDate: isString($new) ? moment($new, DEFAULT_DATE_FORMAT) : moment($new)\n } as WmCalendarState)\n }\n }\n }\n\n renderDay = (date: Moment) => {\n const dateWindow = this.state.calendar.get(moment(date).format(DEFAULT_DATE_FORMAT));\n if (dateWindow) {\n return (\n <WmIcon\n iconclass=\"fa fa-circle\"\n iconsize={8}\n styles={{\n root: {marginTop: -8, alignSelf: 'flexStart'},\n icon: this.styles['eventDay' + Math.min(3, dateWindow.events.length)]}}></WmIcon>\n );\n }\n return (<></>);\n }\n\n componentDidUpdate(prevProps: WmCalendarProps, prevState: WmCalendarState, snapshot: any) {\n super.componentDidUpdate && super.componentDidUpdate(prevProps, prevState, snapshot);\n this.invokeEventCallback('onViewrender', [this, null]);\n }\n\n renderWidget(props: WmCalendarProps) {\n this.invokeEventCallback('onBeforerender', [null, this]);\n return (\n <View style={this.styles.root}>\n {this._background}\n <MonthView\n date={this.state.selectedDate}\n selectDate={this.onDateChange}\n format={DEFAULT_DATE_FORMAT}\n renderChildDay={this.renderDay}\n containerStyle={this.styles.calendar}\n dateSelectedWarpDayStyle={this.styles.selectedDay}\n selectedDayTextStyle={this.styles.selectedDayText}\n warpRowWeekdays={this.styles.weekDay}\n warpRowControlMonthYear={this.styles.calendarHeader}\n weekdayStyle={this.styles.weekDayText}\n warpDayStyle={this.styles.dayWrapper}\n textDayStyle={this.styles.day}\n yearTextStyle={this.styles.yearText}\n monthTextStyle={this.styles.monthText}\n currentDayStyle={this.styles.today}\n currentDayTextStyle={this.styles.todayText}\n notDayOfCurrentMonthStyle={this.styles.notDayOfCurrentMonth}\n renderPrevYearButton={() =>\n (<WmIcon id={this.getTestId('prevyearicon')} iconclass=\"wi wi-angle-double-left\" styles={this.styles.prevYearBtn}/>)}\n renderPrevMonthButton={() =>\n (<WmIcon id={this.getTestId('prevmonthicon')} iconclass=\"wi wi-chevron-left fa-2x\" styles={this.styles.prevMonthBtn}/>)}\n renderNextMonthButton={() =>\n (<WmIcon id={this.getTestId('nextmonthicon')} iconclass=\"wi wi-chevron-right fa-2x\" styles={this.styles.nextMonthBtn}/>)}\n renderNextYearButton={() =>\n (<WmIcon id={this.getTestId('nextyearicon')} iconclass=\"wi wi-angle-double-right\" styles={this.styles.nextYearBtn}/>)}\n />\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,QAAQ,QAAQ,QAAQ;AACjC,OAAOC,MAAM,MAAkB,QAAQ;AACvC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AACnE,OAAOC,MAAM,MAAM,iCAAiC;AAEpD,OAAO,MAAMC,eAAe,SAASL,kBAAkB,CAAkB;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,uBAChDV,MAAM,CAAC,CAAC;IAAAU,eAAA,mBAC0B,IAAIC,GAAG,CAAC,CAAC;EAAA;AACpE;AAEA,MAAMC,mBAAmB,GAAG,YAAY;AAExC,eAAe,MAAMC,UAAU,SAASZ,aAAa,CAAqD;EAExGO,WAAWA,CAACM,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAET,aAAa,EAAE,IAAID,eAAe,CAAC,CAAC,EAAE,IAAIG,eAAe,CAAC,CAAC,CAAC;IAACG,eAAA,uBAG5DK,IAAY,IAAK;MAC/B,MAAMC,CAAC,GAAGhB,MAAM,CAACe,IAAI,CAAC,CAACE,MAAM,CAACL,mBAAmB,CAAC;MAClD,MAAMM,UAAU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AU;MAC3CC,yBAAyB,EAAE,IAAI,CAACxD,MAAM,CAACyD,oBAAqB;MAC5DC,oBAAoB,EAAEA,CAAA,kBACnB3F,KAAA,CAAA8B,aAAA,CAACrB,MAAM;QAACmF,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,cAAc,CAAE;QAAC9D,SAAS,EAAC,yBAAyB;QAACE,MAAM,EAAE,IAAI,CAACA,MAAM,CAAC6D;MAAY,CAAC,CAAG;MACvHC,qBAAqB,EAAEA,CAAA,kBACpB/F,KAAA,CAAA8B,aAAA,CAACrB,MAAM;QAACmF,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,eAAe,CAAE;QAAC9D,SAAS,EAAC,0BAA0B;QAACE,MAAM,EAAE,IAAI,CAACA,MAAM,CAAC+D;MAAa,CAAC,CAAG;MAC1HC,qBAAqB,EAAEA,CAAA,kBAClBjG,KAAA,CAAA8B,aAAA,CAACrB,MAAM;QAACmF,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,eAAe,CAAE;QAAC9D,SAAS,EAAC,2BAA2B;QAACE,MAAM,EAAE,IAAI,CAACA,MAAM,CAACiE;MAAa,CAAC,CAAG;MAC7HC,oBAAoB,EAAEA,CAAA,kBACjBnG,KAAA,CAAA8B,aAAA,CAACrB,MAAM;QAAEmF,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,cAAc,CAAE;QAAC9D,SAAS,EAAC,0BAA0B;QAACE,MAAM,EAAE,IAAI,CAACA,MAAM,CAACmE;MAAY,CAAC;IAAG,CAC5H,CACC,CAAC;EAEX;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","isString","moment","BaseComponent","BaseComponentState","MonthView","WmCalendarProps","DEFAULT_CLASS","WmIcon","createSkeleton","WmCalendarState","constructor","args","_defineProperty","Map","DEFAULT_DATE_FORMAT","WmCalendar","props","date","d","format","dateWindow","state","calendar","get","updateState","datavalue","selectedDate","invokeEventCallback","events","createElement","iconclass","iconsize","styles","root","marginTop","alignSelf","icon","Math","min","length","Fragment","prepareDataset","dataset","eventStartKey","eventstart","forEach","startDate","has","set","push","onPropertyChange","name","$new","$old","componentDidUpdate","prevProps","prevState","snapshot","renderSkeleton","style","skeleton","headerSkeleton","theme","width","height","borderRadius","margin","renderWidget","_background","selectDate","onDateChange","renderChildDay","renderDay","containerStyle","dateSelectedWarpDayStyle","selectedDay","selectedDayTextStyle","selectedDayText","warpRowWeekdays","weekDay","warpRowControlMonthYear","calendarHeader","weekdayStyle","weekDayText","warpDayStyle","dayWrapper","textDayStyle","day","yearTextStyle","yearText","monthTextStyle","monthText","currentDayStyle","today","currentDayTextStyle","todayText","notDayOfCurrentMonthStyle","notDayOfCurrentMonth","renderPrevYearButton","id","getTestId","prevYearBtn","renderPrevMonthButton","prevMonthBtn","renderNextMonthButton","nextMonthBtn","renderNextYearButton","nextYearBtn"],"sources":["calendar.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, View } from 'react-native';\nimport { isString } from 'lodash';\nimport moment, { Moment } from 'moment';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport { MonthView } from './views/month-view';\nimport WmCalendarProps from './calendar.props';\nimport { DEFAULT_CLASS, WmCalendarStyles } from './calendar.styles';\nimport WmIcon from '../../basic/icon/icon.component';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component'\nimport { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\n\nexport class WmCalendarState extends BaseComponentState<WmCalendarProps> {\n selectedDate: Moment = moment();\n calendar: Map<String, { date: number, events: any []}> = new Map();\n}\n\nconst DEFAULT_DATE_FORMAT = 'DD-MM-YYYY';\n\nexport default class WmCalendar extends BaseComponent<WmCalendarProps, WmCalendarState, WmCalendarStyles> {\n\n constructor(props: WmCalendarProps) {\n super(props, DEFAULT_CLASS, new WmCalendarProps(), new WmCalendarState());\n }\n\n onDateChange = (date: Moment) => {\n const d = moment(date).format(DEFAULT_DATE_FORMAT);\n const dateWindow = this.state.calendar.get(d);\n this.updateState({\n props: {datavalue: d},\n selectedDate: date\n } as WmCalendarState);\n this.invokeEventCallback('onSelect', [d, d, this, dateWindow?.events]);\n }\n\n prepareDataset(dataset: any[]) {\n if (!dataset) {\n return;\n }\n const state = {\n calendar: new Map()\n } as WmCalendarState;\n const eventStartKey = this.state.props.eventstart;\n dataset.forEach(d => {\n let startDate = d[eventStartKey];\n if (!isString(startDate)) {\n startDate = moment(startDate).format(DEFAULT_DATE_FORMAT);\n }\n if (!state.calendar.has(startDate)) {\n state.calendar.set(startDate, {\n date: moment(startDate, DEFAULT_DATE_FORMAT).get('milliseconds'),\n events: []\n });\n }\n const dateWindow = state.calendar.get(startDate);\n dateWindow?.events.push(d);\n });\n this.updateState(state);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch(name) {\n case 'dataset':\n this.prepareDataset($new);\n break;\n case 'datavalue':\n if ($new) {\n this.updateState({\n selectedDate: isString($new) ? moment($new, DEFAULT_DATE_FORMAT) : moment($new)\n } as WmCalendarState)\n }\n }\n }\n\n renderDay = (date: Moment) => {\n const dateWindow = this.state.calendar.get(moment(date).format(DEFAULT_DATE_FORMAT));\n if (dateWindow) {\n return (\n <WmIcon\n iconclass=\"fa fa-circle\"\n iconsize={8}\n styles={{\n root: {marginTop: -8, alignSelf: 'flexStart'},\n icon: this.styles['eventDay' + Math.min(3, dateWindow.events.length)]}}></WmIcon>\n );\n }\n return (<></>);\n }\n\n componentDidUpdate(prevProps: WmCalendarProps, prevState: WmCalendarState, snapshot: any) {\n super.componentDidUpdate && super.componentDidUpdate(prevProps, prevState, snapshot);\n this.invokeEventCallback('onViewrender', [this, null]);\n }\n\n public renderSkeleton(props: WmCalendarProps): React.ReactNode {\n return (\n <View style={[this.styles.root, this.styles.skeleton.root]}>\n <View style={this.styles.headerSkeleton.root}>\n {createSkeleton(this.theme, {} as WmSkeletonStyles, {width: '10%', height: 28,borderRadius: 4})}\n {createSkeleton(this.theme, {} as WmSkeletonStyles, {width: '68%', height: 16, borderRadius: 4})}\n {createSkeleton(this.theme, {}as WmSkeletonStyles, {width: '10%', height: 28, borderRadius: 4})}\n </View>\n {createSkeleton(this.theme, {} as WmSkeletonStyles, {width: '96%', margin: 8, height: 320, borderRadius: 4})}\n </View>)\n } \n\n renderWidget(props: WmCalendarProps) {\n this.invokeEventCallback('onBeforerender', [null, this]);\n return (\n <View style={this.styles.root}>\n {this._background}\n <MonthView\n date={this.state.selectedDate}\n selectDate={this.onDateChange}\n format={DEFAULT_DATE_FORMAT}\n renderChildDay={this.renderDay}\n containerStyle={this.styles.calendar}\n dateSelectedWarpDayStyle={this.styles.selectedDay}\n selectedDayTextStyle={this.styles.selectedDayText}\n warpRowWeekdays={this.styles.weekDay}\n warpRowControlMonthYear={this.styles.calendarHeader}\n weekdayStyle={this.styles.weekDayText}\n warpDayStyle={this.styles.dayWrapper}\n textDayStyle={this.styles.day}\n yearTextStyle={this.styles.yearText}\n monthTextStyle={this.styles.monthText}\n currentDayStyle={this.styles.today}\n currentDayTextStyle={this.styles.todayText}\n notDayOfCurrentMonthStyle={this.styles.notDayOfCurrentMonth}\n renderPrevYearButton={() =>\n (<WmIcon id={this.getTestId('prevyearicon')} iconclass=\"wi wi-angle-double-left\" styles={this.styles.prevYearBtn}/>)}\n renderPrevMonthButton={() =>\n (<WmIcon id={this.getTestId('prevmonthicon')} iconclass=\"wi wi-chevron-left fa-2x\" styles={this.styles.prevMonthBtn}/>)}\n renderNextMonthButton={() =>\n (<WmIcon id={this.getTestId('nextmonthicon')} iconclass=\"wi wi-chevron-right fa-2x\" styles={this.styles.nextMonthBtn}/>)}\n renderNextYearButton={() =>\n (<WmIcon id={this.getTestId('nextyearicon')} iconclass=\"wi wi-angle-double-right\" styles={this.styles.nextYearBtn}/>)}\n />\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,IAAI,QAAQ,cAAc;AACnD,SAASC,QAAQ,QAAQ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IAAI,CAACA,MAAM,CAACyE;MAAa,CAAC,CAAG;MAC7HC,oBAAoB,EAAEA,CAAA,kBACjB5G,KAAA,CAAA+B,aAAA,CAACtB,MAAM;QAAE4F,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,cAAc,CAAE;QAACtE,SAAS,EAAC,0BAA0B;QAACE,MAAM,EAAE,IAAI,CAACA,MAAM,CAAC2E;MAAY,CAAC;IAAG,CAC5H,CACC,CAAC;EAEX;AACF","ignoreList":[]}
@@ -114,6 +114,25 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
114
114
  root: {
115
115
  color: themeVariables.calendarNextYearIconColor
116
116
  }
117
+ },
118
+ skeleton: {
119
+ root: {
120
+ display: 'flex',
121
+ justifyContent: 'center',
122
+ backgroundColor: '#fff',
123
+ paddingHorizontal: 8,
124
+ alignItems: 'center'
125
+ }
126
+ },
127
+ headerSkeleton: {
128
+ root: {
129
+ width: '100%',
130
+ display: 'flex',
131
+ flexDirection: 'row',
132
+ alignItems: 'center',
133
+ justifyContent: 'space-around',
134
+ marginBottom: 16
135
+ }
117
136
  }
118
137
  });
119
138
  addStyle(DEFAULT_CLASS, '', defaultStyles);
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","width","minHeight","minWidth","text","color","calendarDateColor","calendar","backgroundColor","calendarBgColor","borderColor","calendarHeaderBgColor","borderWidth","borderStyle","marginTop","paddingTop","paddingBottom","elevation","calendarHeader","borderBottomWidth","weekDay","padding","weekDayText","calendarWeekDayTextColor","fontWeight","fontFamily","baseFont","fontSize","day","dayWrapper","height","borderRadius","notDayOfCurrentMonth","calendarNotCurrentMonthDateColor","opacity","monthText","calendarHeaderTextColor","yearText","today","primaryColor","todayText","calendarSelectedDayBgColor","eventDay1","calendarEventDay1Color","eventDay2","calendarEventDay2Color","eventDay3","calendarEventDay3Color","selectedDay","selectedDayText","calendarSelectedDayTextColor","prevMonthBtn","calendarPrevMonthIconColor","nextMonthBtn","calendarNextMonthIconColor","prevYearBtn","calendarPrevYearIconColor","nextYearBtn","calendarNextYearIconColor","transform","rotateY"],"sources":["calendar.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { TextStyle } from 'react-native';\n\nexport type WmCalendarStyles = BaseStyles & {\n calendar: AllStyle,\n calendarHeader: AllStyle,\n day: AllStyle,\n dayWrapper: AllStyle,\n notDayOfCurrentMonth: AllStyle,\n monthText: TextStyle,\n yearText: TextStyle,\n weekDay: AllStyle,\n today: AllStyle,\n todayText: AllStyle,\n prevMonthBtn: WmIconStyles,\n nextMonthBtn: WmIconStyles,\n prevYearBtn: WmIconStyles,\n nextYearBtn: WmIconStyles,\n selectedDay: AllStyle,\n selectedDayText: AllStyle\n eventDay1: AllStyle,\n eventDay2: AllStyle,\n eventDay3: AllStyle\n};\n\nexport const DEFAULT_CLASS = 'app-calendar';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmCalendarStyles = defineStyles<WmCalendarStyles>({\n root: {\n width: '100%',\n minHeight: 456,\n minWidth: 360\n },\n text: {\n color: themeVariables.calendarDateColor\n },\n calendar : {\n backgroundColor: themeVariables.calendarBgColor,\n borderColor: themeVariables.calendarHeaderBgColor,\n borderWidth: 1,\n borderStyle: 'solid',\n marginTop: 0, \n paddingTop: 0,\n paddingBottom: 0,\n elevation: 6\n },\n calendarHeader : {\n backgroundColor: themeVariables.calendarHeaderBgColor,\n borderColor: themeVariables.calendarHeaderBgColor,\n borderBottomWidth: 1,\n borderStyle: 'solid',\n paddingTop: 8,\n paddingBottom: 8\n },\n weekDay: {\n backgroundColor: themeVariables.calendarBgColor,\n borderColor: themeVariables.calendarHeaderBgColor,\n borderBottomWidth: 1,\n borderStyle: 'solid',\n padding: 2,\n },\n weekDayText: {\n color: themeVariables.calendarWeekDayTextColor,\n fontWeight: '400',\n fontFamily: themeVariables.baseFont,\n fontSize: 16,\n },\n day: {\n borderColor: 'transparent',\n color: themeVariables.calendarDateColor,\n fontSize: 16,\n fontFamily: themeVariables.baseFont,\n fontWeight: '400'\n },\n dayWrapper: {\n backgroundColor: themeVariables.calendarBgColor,\n borderColor: 'transparent',\n width: 38,\n height: 38,\n borderRadius: 26\n },\n notDayOfCurrentMonth: {\n color: themeVariables.calendarNotCurrentMonthDateColor,\n fontWeight: 'normal',\n opacity: 0\n },\n monthText: {\n fontWeight: '500',\n fontFamily: themeVariables.baseFont,\n color: themeVariables.calendarHeaderTextColor\n },\n yearText: {\n fontWeight: '500',\n fontFamily: themeVariables.baseFont,\n color: themeVariables.calendarHeaderTextColor\n },\n today: {\n backgroundColor: themeVariables.calendarBgColor,\n borderColor: themeVariables.primaryColor\n },\n todayText: {\n backgroundColor: themeVariables.calendarSelectedDayBgColor\n },\n eventDay1 : {\n color: themeVariables.calendarEventDay1Color\n },\n eventDay2 : {\n color: themeVariables.calendarEventDay2Color\n },\n eventDay3 : {\n color: themeVariables.calendarEventDay3Color\n },\n selectedDay: {\n backgroundColor: themeVariables.calendarSelectedDayBgColor\n },\n selectedDayText: {\n backgroundColor: themeVariables.calendarSelectedDayBgColor,\n color: themeVariables.calendarSelectedDayTextColor,\n fontWeight: 'bold'\n },\n prevMonthBtn: {\n root: {\n color: themeVariables.calendarPrevMonthIconColor\n }\n } as WmIconStyles,\n nextMonthBtn: {\n root: {\n color: themeVariables.calendarNextMonthIconColor\n }\n } as WmIconStyles,\n prevYearBtn: {\n root: {\n color: themeVariables.calendarPrevYearIconColor\n }\n } as WmIconStyles,\n nextYearBtn: {\n root: {\n color: themeVariables.calendarNextYearIconColor\n }\n } as WmIconStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n prevMonthBtn: {\n root: {\n transform: [ {rotateY: '180deg'}]\n }\n } as WmIconStyles,\n nextMonthBtn: {\n root: {\n transform: [ {rotateY: '180deg'}] \n }\n } as WmIconStyles,\n monthText: {\n padding: 2\n },\n yearText: {\n padding: 2\n }\n });\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AA0BxF,OAAO,MAAMC,aAAa,GAAG,cAAc;AAC3CF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAA+B,GAAGL,YAAY,CAAmB;IACnEM,IAAI,EAAE;MACFC,KAAK,EAAE,MAAM;MACbC,SAAS,EAAE,GAAG;MACdC,QAAQ,EAAE;IACd,CAAC;IACDC,IAAI,EAAE;MACFC,KAAK,EAAER,cAAc,CAACS;IAC1B,CAAC;IACDC,QAAQ,EAAG;MACPC,eAAe,EAAEX,cAAc,CAACY,eAAe;MAC/CC,WAAW,EAAEb,cAAc,CAACc,qBAAqB;MACjDC,WAAW,EAAE,CAAC;MACdC,WAAW,EAAE,OAAO;MACpBC,SAAS,EAAE,CAAC;MACZC,UAAU,EAAE,CAAC;MACbC,aAAa,EAAE,CAAC;MAChBC,SAAS,EAAE;IACf,CAAC;IACDC,cAAc,EAAG;MACbV,eAAe,EAAEX,cAAc,CAACc,qBAAqB;MACrDD,WAAW,EAAEb,cAAc,CAACc,qBAAqB;MACjDQ,iBAAiB,EAAE,CAAC;MACpBN,WAAW,EAAE,OAAO;MACpBE,UAAU,EAAE,CAAC;MACbC,aAAa,EAAE;IACnB,CAAC;IACDI,OAAO,EAAE;MACLZ,eAAe,EAAEX,cAAc,CAACY,eAAe;MAC/CC,WAAW,EAAEb,cAAc,CAACc,qBAAqB;MACjDQ,iBAAiB,EAAE,CAAC;MACpBN,WAAW,EAAE,OAAO;MACpBQ,OAAO,EAAE;IACb,CAAC;IACDC,WAAW,EAAE;MACTjB,KAAK,EAAER,c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EAAE;MACTxC,eAAe,EAAEX,cAAc,CAAC4C;IACpC,CAAC;IACDQ,eAAe,EAAE;MACbzC,eAAe,EAAEX,cAAc,CAAC4C,0BAA0B;MAC1DpC,KAAK,EAAER,cAAc,CAACqD,4BAA4B;MAClD1B,UAAU,EAAE;IAChB,CAAC;IACD2B,YAAY,EAAE;MACVnD,IAAI,EAAE;QACFK,KAAK,EAAER,cAAc,CAACuD;MAC1B;IACJ,CAAiB;IACjBC,YAAY,EAAE;MACVrD,IAAI,EAAE;QACFK,KAAK,EAAER,cAAc,CAACyD;MAC1B;IACJ,CAAiB;IACjBC,WAAW,EAAE;MACTvD,IAAI,EAAE;QACFK,KAAK,EAAER,cAAc,CAAC2D;MAC1B;IACJ,CAAiB;IACjBC,WAAW,EAAE;MACTzD,IAAI,EAAE;QACFK,KAAK,EAAER,cAAc,CAAC6D;MAC1B;IACJ;EACJ,CAAC,CAAC;EAEF5D,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAE;IACjCwD,YAAY,EAAE;MACVnD,IAAI,EAAE;QACF2D,SAAS,EAAE,CAAE;UAACC,OAAO,EAAE;QAAQ,CAAC;MACpC;IACJ,CAAiB;IACjBP,YAAY,EAAE;MACVrD,IAAI,EAAE;QACF2D,SAAS,EAAE,CAAE;UAACC,OAAO,EAAE;QAAQ,CAAC;MACpC;IACJ,CAAiB;IACjBzB,SAAS,EAAE;MACPd,OAAO,EAAE;IACb,CAAC;IACDgB,QAAQ,EAAE;MACNhB,OAAO,EAAE;IACb;EACJ,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","width","minHeight","minWidth","text","color","calendarDateColor","calendar","backgroundColor","calendarBgColor","borderColor","calendarHeaderBgColor","borderWidth","borderStyle","marginTop","paddingTop","paddingBottom","elevation","calendarHeader","borderBottomWidth","weekDay","padding","weekDayText","calendarWeekDayTextColor","fontWeight","fontFamily","baseFont","fontSize","day","dayWrapper","height","borderRadius","notDayOfCurrentMonth","calendarNotCurrentMonthDateColor","opacity","monthText","calendarHeaderTextColor","yearText","today","primaryColor","todayText","calendarSelectedDayBgColor","eventDay1","calendarEventDay1Color","eventDay2","calendarEventDay2Color","eventDay3","calendarEventDay3Color","selectedDay","selectedDayText","calendarSelectedDayTextColor","prevMonthBtn","calendarPrevMonthIconColor","nextMonthBtn","calendarNextMonthIconColor","prevYearBtn","calendarPrevYearIconColor","nextYearBtn","calendarNextYearIconColor","skeleton","display","justifyContent","paddingHorizontal","alignItems","headerSkeleton","flexDirection","marginBottom","transform","rotateY"],"sources":["calendar.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { TextStyle } from 'react-native';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmCalendarStyles = BaseStyles & {\n calendar: AllStyle,\n calendarHeader: AllStyle,\n day: AllStyle,\n dayWrapper: AllStyle,\n notDayOfCurrentMonth: AllStyle,\n monthText: TextStyle,\n yearText: TextStyle,\n weekDay: AllStyle,\n today: AllStyle,\n todayText: AllStyle,\n prevMonthBtn: WmIconStyles,\n nextMonthBtn: WmIconStyles,\n prevYearBtn: WmIconStyles,\n nextYearBtn: WmIconStyles,\n selectedDay: AllStyle,\n selectedDayText: AllStyle\n eventDay1: AllStyle,\n eventDay2: AllStyle,\n eventDay3: AllStyle,\n skeleton: WmSkeletonStyles;\n headerSkeleton: WmSkeletonStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-calendar';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmCalendarStyles = defineStyles<WmCalendarStyles>({\n root: {\n width: '100%',\n minHeight: 456,\n minWidth: 360\n },\n text: {\n color: themeVariables.calendarDateColor\n },\n calendar : {\n backgroundColor: themeVariables.calendarBgColor,\n borderColor: themeVariables.calendarHeaderBgColor,\n borderWidth: 1,\n borderStyle: 'solid',\n marginTop: 0, \n paddingTop: 0,\n paddingBottom: 0,\n elevation: 6\n },\n calendarHeader : {\n backgroundColor: themeVariables.calendarHeaderBgColor,\n borderColor: themeVariables.calendarHeaderBgColor,\n borderBottomWidth: 1,\n borderStyle: 'solid',\n paddingTop: 8,\n paddingBottom: 8\n },\n weekDay: {\n backgroundColor: themeVariables.calendarBgColor,\n borderColor: themeVariables.calendarHeaderBgColor,\n borderBottomWidth: 1,\n borderStyle: 'solid',\n padding: 2,\n },\n weekDayText: {\n color: themeVariables.calendarWeekDayTextColor,\n fontWeight: '400',\n fontFamily: themeVariables.baseFont,\n fontSize: 16,\n },\n day: {\n borderColor: 'transparent',\n color: themeVariables.calendarDateColor,\n fontSize: 16,\n fontFamily: themeVariables.baseFont,\n fontWeight: '400'\n },\n dayWrapper: {\n backgroundColor: themeVariables.calendarBgColor,\n borderColor: 'transparent',\n width: 38,\n height: 38,\n borderRadius: 26\n },\n notDayOfCurrentMonth: {\n color: themeVariables.calendarNotCurrentMonthDateColor,\n fontWeight: 'normal',\n opacity: 0\n },\n monthText: {\n fontWeight: '500',\n fontFamily: themeVariables.baseFont,\n color: themeVariables.calendarHeaderTextColor\n },\n yearText: {\n fontWeight: '500',\n fontFamily: themeVariables.baseFont,\n color: themeVariables.calendarHeaderTextColor\n },\n today: {\n backgroundColor: themeVariables.calendarBgColor,\n borderColor: themeVariables.primaryColor\n },\n todayText: {\n backgroundColor: themeVariables.calendarSelectedDayBgColor\n },\n eventDay1 : {\n color: themeVariables.calendarEventDay1Color\n },\n eventDay2 : {\n color: themeVariables.calendarEventDay2Color\n },\n eventDay3 : {\n color: themeVariables.calendarEventDay3Color\n },\n selectedDay: {\n backgroundColor: themeVariables.calendarSelectedDayBgColor\n },\n selectedDayText: {\n backgroundColor: themeVariables.calendarSelectedDayBgColor,\n color: themeVariables.calendarSelectedDayTextColor,\n fontWeight: 'bold'\n },\n prevMonthBtn: {\n root: {\n color: themeVariables.calendarPrevMonthIconColor\n }\n } as WmIconStyles,\n nextMonthBtn: {\n root: {\n color: themeVariables.calendarNextMonthIconColor\n }\n } as WmIconStyles,\n prevYearBtn: {\n root: {\n color: themeVariables.calendarPrevYearIconColor\n }\n } as WmIconStyles,\n nextYearBtn: {\n root: {\n color: themeVariables.calendarNextYearIconColor\n }\n } as WmIconStyles,\n skeleton: {\n root: {\n display:'flex', \n justifyContent: 'center',\n backgroundColor:'#fff',\n paddingHorizontal: 8,\n alignItems: 'center',\n },\n } as any as WmSkeletonStyles ,\n headerSkeleton: {\n root: {\n width: '100%',\n display:'flex', \n flexDirection:'row', \n alignItems: 'center',\n justifyContent: 'space-around',\n marginBottom: 16\n } \n } as any as WmSkeletonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n prevMonthBtn: {\n root: {\n transform: [ {rotateY: '180deg'}]\n }\n } as WmIconStyles,\n nextMonthBtn: {\n root: {\n transform: [ {rotateY: '180deg'}] \n }\n } as WmIconStyles,\n monthText: {\n padding: 2\n },\n yearText: {\n padding: 2\n }\n });\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AA6BxF,OAAO,MAAMC,aAAa,GAAG,cAAc;AAC3CF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAA+B,GAAGL,YAAY,CAAmB;IACnEM,IAAI,EAAE;MACFC,KAAK,EAAE,MAAM;MACbC,SAAS,EAAE,GAAG;MACdC,QAAQ,EAAE;IACd,CAAC;IACDC,IAAI,EAAE;MACFC,KAAK,EAAER,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,CAAC6D;MAC1B;IACJ,CAAiB;IACjBC,QAAQ,EAAE;MACN3D,IAAI,EAAE;QACF4D,OAAO,EAAC,MAAM;QACdC,cAAc,EAAE,QAAQ;QACxBrD,eAAe,EAAC,MAAM;QACtBsD,iBAAiB,EAAE,CAAC;QACpBC,UAAU,EAAE;MAChB;IACF,CAA6B;IAC/BC,cAAc,EAAE;MACZhE,IAAI,EAAE;QACFC,KAAK,EAAE,MAAM;QACb2D,OAAO,EAAC,MAAM;QACdK,aAAa,EAAC,KAAK;QACnBF,UAAU,EAAE,QAAQ;QACpBF,cAAc,EAAE,cAAc;QAC9BK,YAAY,EAAE;MAClB;IACJ;EACJ,CAAC,CAAC;EAEFpE,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAE;IACjCwD,YAAY,EAAE;MACVnD,IAAI,EAAE;QACFmE,SAAS,EAAE,CAAE;UAACC,OAAO,EAAE;QAAQ,CAAC;MACpC;IACJ,CAAiB;IACjBf,YAAY,EAAE;MACVrD,IAAI,EAAE;QACFmE,SAAS,EAAE,CAAE;UAACC,OAAO,EAAE;QAAQ,CAAC;MACpC;IACJ,CAAiB;IACjBjC,SAAS,EAAE;MACPd,OAAO,EAAE;IACb,CAAC;IACDgB,QAAQ,EAAE;MACNhB,OAAO,EAAE;IACb;EACJ,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
@@ -3,13 +3,14 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
3
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
4
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
5
  import React from 'react';
6
- import { Text, TouchableOpacity } from 'react-native';
6
+ import { Text, TouchableOpacity, View } from 'react-native';
7
7
  import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
8
8
  import WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';
9
9
  import { unStringify, validateField } from '@wavemaker/app-rn-runtime/core/utils';
10
10
  import WmCheckboxProps from './checkbox.props';
11
11
  import { DEFAULT_CLASS } from './checkbox.styles';
12
12
  import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
13
+ import WmLabel from '../../basic/label/label.component';
13
14
  export class WmCheckboxState extends BaseComponentState {
14
15
  constructor(...args) {
15
16
  super(...args);
@@ -78,9 +79,28 @@ export default class WmCheckbox extends BaseComponent {
78
79
  this.invokeEventCallback('onBlur', [null, this.proxy]);
79
80
  });
80
81
  }
82
+ renderSkeleton(props) {
83
+ return /*#__PURE__*/React.createElement(View, {
84
+ style: [this.styles.root, this.styles.skeleton.root]
85
+ }, /*#__PURE__*/React.createElement(WmIcon, {
86
+ styles: {
87
+ root: {
88
+ ...this.styles.checkicon,
89
+ ...this.styles.iconSkeleton.root
90
+ }
91
+ }
92
+ }), /*#__PURE__*/React.createElement(WmLabel, {
93
+ styles: {
94
+ root: {
95
+ ...this.styles.text,
96
+ ...this.styles.labelSkeleton.root
97
+ }
98
+ }
99
+ }));
100
+ }
81
101
  renderWidget(props) {
82
102
  return /*#__PURE__*/React.createElement(TouchableOpacity, _extends({}, this.getTestPropsForAction(), {
83
- style: this.styles.root,
103
+ style: [this.styles.root, this.state.isChecked ? this.styles.checkedItem : null],
84
104
  onPress: this.onPress.bind(this)
85
105
  }, getAccessibilityProps(AccessibilityWidgetType.CHECKBOX, {
86
106
  hint: props === null || props === void 0 ? void 0 : props.hint,
@@ -94,7 +114,7 @@ export default class WmCheckbox extends BaseComponent {
94
114
  disabled: props.readonly || props.disabled,
95
115
  id: this.getTestId('checkbox')
96
116
  }), /*#__PURE__*/React.createElement(Text, _extends({}, this.getTestPropsForLabel(), {
97
- style: this.styles.text
117
+ style: [this.styles.text, this.state.isChecked ? this.styles.selectedLabel : null]
98
118
  }), props.caption));
99
119
  }
100
120
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","TouchableOpacity","BaseComponent","BaseComponentState","WmIcon","unStringify","validateField","WmCheckboxProps","DEFAULT_CLASS","AccessibilityWidgetType","getAccessibilityProps","WmCheckboxState","constructor","args","_defineProperty","WmCheckbox","props","setChecked","dataValue","checkedvalue","value","updateState","isChecked","onPropertyChange","name","$new","$old","state","datavalue","updateDatavalue","validate","validationObj","isValid","errorType","onPress","disabled","readonly","invokeEventCallback","proxy","oldValue","uncheckedvalue","onFieldChange","renderWidget","createElement","_extends","getTestPropsForAction","style","styles","root","bind","CHECKBOX","hint","checked","accessibilityRole","accessibilityLabel","caption","_background","iconclass","checkicon","uncheckicon","id","getTestId","getTestPropsForLabel","text"],"sources":["checkbox.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, TouchableOpacity } from 'react-native';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport {unStringify, validateField} from '@wavemaker/app-rn-runtime/core/utils';\n\nimport WmCheckboxProps from './checkbox.props';\nimport { DEFAULT_CLASS, WmCheckboxStyles } from './checkbox.styles';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nexport class WmCheckboxState extends BaseComponentState<WmCheckboxProps> {\n isChecked: boolean = false;\n isValid: boolean = true;\n errorType = '';\n}\n\nexport default class WmCheckbox extends BaseComponent<WmCheckboxProps, WmCheckboxState, WmCheckboxStyles> {\n\n constructor(props: WmCheckboxProps) {\n super(props, DEFAULT_CLASS, new WmCheckboxProps(), new WmCheckboxState());\n }\n\n setChecked(dataValue: any, checkedvalue: any) {\n const value = unStringify(dataValue) === unStringify(checkedvalue, true);\n this.updateState({ isChecked: value } as WmCheckboxState);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'checkedvalue':\n this.setChecked(this.state.props.datavalue, $new);\n break;\n case 'datavalue':\n this.setChecked($new, this.state.props.checkedvalue);\n break;\n }\n }\n\n updateDatavalue(value: any) {\n this.updateState({ props: { datavalue: value }} as WmCheckboxState);\n }\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.updateState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as WmCheckboxState);\n }\n\n onPress() {\n if (this.state.props.disabled || this.state.props.readonly) {\n return;\n }\n this.invokeEventCallback('onFocus', [null, this.proxy]);\n this.invokeEventCallback('onTap', [null, this.proxy]);\n const oldValue = this.state.props.datavalue;\n const value = !this.state.isChecked;\n this.validate(value);\n this.updateState({ isChecked: value } as WmCheckboxState);\n const dataValue = value === true ? this.state.props.checkedvalue : this.state.props.uncheckedvalue;\n this.updateState({ props: { datavalue: dataValue } } as WmCheckboxState,\n () => {\n if (!this.props.onFieldChange) {\n this.invokeEventCallback('onChange', [null, this.proxy, dataValue, oldValue]);\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', dataValue, oldValue);\n }\n this.invokeEventCallback('onBlur', [ null, this.proxy ]);\n });\n }\n\n renderWidget(props: WmCheckboxProps) {\n return (\n <TouchableOpacity {...this.getTestPropsForAction()} style={this.styles.root} onPress={this.onPress.bind(this)} {...getAccessibilityProps(AccessibilityWidgetType.CHECKBOX, {hint: props?.hint, checked: this.state.isChecked})} accessibilityRole='checkbox' accessibilityLabel={`Checkbox for ${props.caption}`}>\n {this._background}\n <WmIcon iconclass=\"wi wi-check\" styles={this.state.isChecked ? this.styles.checkicon : this.styles.uncheckicon} disabled={props.readonly || props.disabled} id={this.getTestId('checkbox')}/>\n <Text {...this.getTestPropsForLabel()} style={this.styles.text}>{props.caption}</Text>\n </TouchableOpacity>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAA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,IAAI,CAACC,SAAS,CAAC,UAAU;IAAE,CAAC,CAAC,eAC7L9D,KAAA,CAAA4C,aAAA,CAAC3C,IAAI,EAAA4C,QAAA,KAAK,IAAI,CAACkB,oBAAoB,CAAC,CAAC;MAAEhB,KAAK,EAAE,IAAI,CAACC,MAAM,CAACgB;IAAK,IAAE/C,KAAK,CAACuC,OAAc,CACvE,CAAC;EAEvB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Text","TouchableOpacity","View","BaseComponent","BaseComponentState","WmIcon","unStringify","validateField","WmCheckboxProps","DEFAULT_CLASS","AccessibilityWidgetType","getAccessibilityProps","WmLabel","WmCheckboxState","constructor","args","_defineProperty","WmCheckbox","props","setChecked","dataValue","checkedvalue","value","updateState","isChecked","onPropertyChange","name","$new","$old","state","datavalue","updateDatavalue","validate","validationObj","isValid","errorType","onPress","disabled","readonly","invokeEventCallback","proxy","oldValue","uncheckedvalue","onFieldChange","renderSkeleton","createElement","style","styles","root","skeleton","checkicon","iconSkeleton","text","labelSkeleton","renderWidget","_extends","getTestPropsForAction","checkedItem","bind","CHECKBOX","hint","checked","accessibilityRole","accessibilityLabel","caption","_background","iconclass","uncheckicon","id","getTestId","getTestPropsForLabel","selectedLabel"],"sources":["checkbox.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Text, TouchableOpacity, View } from 'react-native';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport {unStringify, validateField} from '@wavemaker/app-rn-runtime/core/utils';\n\nimport WmCheckboxProps from './checkbox.props';\nimport { DEFAULT_CLASS, WmCheckboxStyles } from './checkbox.styles';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport WmLabel from '../../basic/label/label.component';\n\nexport class WmCheckboxState extends BaseComponentState<WmCheckboxProps> {\n isChecked: boolean = false;\n isValid: boolean = true;\n errorType = '';\n}\n\nexport default class WmCheckbox extends BaseComponent<WmCheckboxProps, WmCheckboxState, WmCheckboxStyles> {\n\n constructor(props: WmCheckboxProps) {\n super(props, DEFAULT_CLASS, new WmCheckboxProps(), new WmCheckboxState());\n }\n\n setChecked(dataValue: any, checkedvalue: any) {\n const value = unStringify(dataValue) === unStringify(checkedvalue, true);\n this.updateState({ isChecked: value } as WmCheckboxState);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'checkedvalue':\n this.setChecked(this.state.props.datavalue, $new);\n break;\n case 'datavalue':\n this.setChecked($new, this.state.props.checkedvalue);\n break;\n }\n }\n\n updateDatavalue(value: any) {\n this.updateState({ props: { datavalue: value }} as WmCheckboxState);\n }\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.updateState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as WmCheckboxState);\n }\n\n onPress() {\n if (this.state.props.disabled || this.state.props.readonly) {\n return;\n }\n this.invokeEventCallback('onFocus', [null, this.proxy]);\n this.invokeEventCallback('onTap', [null, this.proxy]);\n const oldValue = this.state.props.datavalue;\n const value = !this.state.isChecked;\n this.validate(value);\n this.updateState({ isChecked: value } as WmCheckboxState);\n const dataValue = value === true ? this.state.props.checkedvalue : this.state.props.uncheckedvalue;\n this.updateState({ props: { datavalue: dataValue } } as WmCheckboxState,\n () => {\n if (!this.props.onFieldChange) {\n this.invokeEventCallback('onChange', [null, this.proxy, dataValue, oldValue]);\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', dataValue, oldValue);\n }\n this.invokeEventCallback('onBlur', [ null, this.proxy ]);\n });\n }\n\n public renderSkeleton(props: WmCheckboxProps): React.ReactNode {\n return <View style={[this.styles.root, this.styles.skeleton.root]}>\n <WmIcon styles={{ root: {...this.styles.checkicon, ...this.styles.iconSkeleton.root} }}/>\n <WmLabel styles={{ root: {...this.styles.text, ...this.styles.labelSkeleton.root} }}/>\n </View>\n }\n\n renderWidget(props: WmCheckboxProps) {\n return (\n <TouchableOpacity {...this.getTestPropsForAction()} style={[this.styles.root, this.state.isChecked ? this.styles.checkedItem : null]} onPress={this.onPress.bind(this)} {...getAccessibilityProps(AccessibilityWidgetType.CHECKBOX, {hint: props?.hint, checked: this.state.isChecked})} accessibilityRole='checkbox' accessibilityLabel={`Checkbox for ${props.caption}`}>\n {this._background}\n <WmIcon iconclass=\"wi wi-check\" styles={this.state.isChecked ? this.styles.checkicon : this.styles.uncheckicon} disabled={props.readonly || props.disabled} id={this.getTestId('checkbox')}/>\n <Text {...this.getTestPropsForLabel()} style={[this.styles.text, this.state.isChecked ? this.styles.selectedLabel: null]}>{props.caption}</Text>\n </TouchableOpacity>\n );\n }\n}\n\n\n\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AAE3E,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAAQC,WAAW,EAAEC,aAAa,QAAO,sCAAsC;AAE/E,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AACnE,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAOC,OAAO,MAAM,mCAAmC;AAEvD,OAAO,MAAMC,eAAe,SAAST,kBAAkB,CAAkB;EAAAU,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBAClD,KAAK;IAAAA,eAAA,kBACP,IAAI;IAAAA,eAAA,oBACX,EAAE;EAAA;AAChB;AAEA,eAAe,MAAMC,UAAU,SAASd,aAAa,CAAqD;EAExGW,WAAWA,CAACI,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAET,aAAa,EAAE,IAAID,eAAe,CAAC,CAAC,EAAE,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B,QAAQ,EAAEnB,KAAK,CAACoB,QAAQ,IAAIpB,KAAK,CAACmB,QAAS;MAAC+B,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,UAAU;IAAE,CAAC,CAAC,eAC7LtE,KAAA,CAAA8C,aAAA,CAAC7C,IAAI,EAAAuD,QAAA,KAAK,IAAI,CAACe,oBAAoB,CAAC,CAAC;MAAExB,KAAK,EAAE,CAAC,IAAI,CAACC,MAAM,CAACK,IAAI,EAAE,IAAI,CAACvB,KAAK,CAACL,SAAS,GAAG,IAAI,CAACuB,MAAM,CAACwB,aAAa,GAAE,IAAI;IAAE,IAAErD,KAAK,CAAC8C,OAAc,CACjI,CAAC;EAEvB;AACF","ignoreList":[]}
@@ -16,7 +16,22 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
16
16
  },
17
17
  skeleton: {
18
18
  root: {
19
- width: '100%',
19
+ width: 20,
20
+ height: 20,
21
+ borderRadius: 4
22
+ }
23
+ },
24
+ iconSkeleton: {
25
+ root: {
26
+ width: 20,
27
+ height: 20,
28
+ borderRadius: 4
29
+ }
30
+ },
31
+ labelSkeleton: {
32
+ root: {
33
+ width: 200,
34
+ borderRadius: 4,
20
35
  height: 16
21
36
  }
22
37
  },
@@ -51,7 +66,9 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
51
66
  icon: {
52
67
  color: 'transparent'
53
68
  }
54
- }
69
+ },
70
+ checkedItem: {},
71
+ selectedLabel: {}
55
72
  });
56
73
  addStyle(DEFAULT_CLASS + '-disabled', '', {
57
74
  root: {
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","alignContent","text","alignSelf","fontFamily","baseFont","fontSize","color","labelDefaultColor","marginLeft","skeleton","width","height","checkicon","borderRadius","backgroundColor","primaryColor","justifyContent","alignItems","borderColor","checkedBorderColor","icon","checkedIconColor","padding","uncheckicon","borderWidth","uncheckedBorderColor","uncheckedBgColor","opacity","checkedDisabledColor"],"sources":["checkbox.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\n\nexport type WmCheckboxStyles = BaseStyles & {\n skeleton: WmSkeletonStyles;\n checkicon: WmIconStyles;\n uncheckicon: WmIconStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-checkbox';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmCheckboxStyles = defineStyles({\n root: {\n flexDirection: 'row',\n alignContent: 'center',\n },\n text: {\n alignSelf: 'center',\n fontFamily: themeVariables.baseFont,\n fontSize: 16,\n color: themeVariables.labelDefaultColor,\n marginLeft: 8\n },\n skeleton: {\n root: {\n width: '100%',\n height: 16\n }\n } as any as WmSkeletonStyles,\n checkicon : {\n root: {\n width: 20,\n height: 20,\n borderRadius: 4,\n backgroundColor: themeVariables.primaryColor,\n justifyContent: 'center',\n alignItems: 'center',\n borderColor: themeVariables.checkedBorderColor,\n },\n text: {\n fontSize: 18,\n },\n icon : {\n color: themeVariables.checkedIconColor,\n padding: 0\n }\n } as WmIconStyles,\n uncheckicon : {\n root: {\n width: 20,\n height: 20,\n borderWidth: 2,\n borderRadius: 4,\n borderColor: themeVariables.uncheckedBorderColor,\n backgroundColor: themeVariables.uncheckedBgColor,\n },\n text: {},\n icon : {\n color: 'transparent',\n }\n } as WmIconStyles,\n });\n\n\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n opacity: 0.8\n },\n text : {\n color: themeVariables.checkedDisabledColor\n }\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n });\n"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,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AC;EAGJV,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACxCK,IAAI,EAAG;MACL6B,OAAO,EAAE;IACX,CAAC;IACD1B,IAAI,EAAG;MACLK,KAAK,EAAEX,cAAc,CAACiC;IACxB;EACF,CAAC,CAAC;EAEFhC,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC5C,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","alignContent","text","alignSelf","fontFamily","baseFont","fontSize","color","labelDefaultColor","marginLeft","skeleton","width","height","borderRadius","iconSkeleton","labelSkeleton","checkicon","backgroundColor","primaryColor","justifyContent","alignItems","borderColor","checkedBorderColor","icon","checkedIconColor","padding","uncheckicon","borderWidth","uncheckedBorderColor","uncheckedBgColor","checkedItem","selectedLabel","opacity","checkedDisabledColor"],"sources":["checkbox.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\n\nexport type WmCheckboxStyles = BaseStyles & {\n skeleton: WmSkeletonStyles;\n checkicon: WmIconStyles;\n uncheckicon: WmIconStyles;\n iconSkeleton: WmSkeletonStyles;\n labelSkeleton: WmSkeletonStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-checkbox';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmCheckboxStyles = defineStyles({\n root: {\n flexDirection: 'row',\n alignContent: 'center',\n },\n text: {\n alignSelf: 'center',\n fontFamily: themeVariables.baseFont,\n fontSize: 16,\n color: themeVariables.labelDefaultColor,\n marginLeft: 8\n },\n skeleton: {\n root: {\n width: 20,\n height: 20,\n borderRadius: 4,\n },\n } as any as WmSkeletonStyles,\n iconSkeleton: {\n root: {\n width: 20,\n height: 20,\n borderRadius: 4,\n }\n } as any as WmSkeletonStyles,\n labelSkeleton: {\n root: {\n width: 200,\n borderRadius: 4,\n height: 16\n }\n } as any as WmSkeletonStyles,\n checkicon : {\n root: {\n width: 20,\n height: 20,\n borderRadius: 4,\n backgroundColor: themeVariables.primaryColor,\n justifyContent: 'center',\n alignItems: 'center',\n borderColor: themeVariables.checkedBorderColor,\n },\n text: {\n fontSize: 18,\n },\n icon : {\n color: themeVariables.checkedIconColor,\n padding: 0\n }\n } as WmIconStyles,\n uncheckicon : {\n root: {\n width: 20,\n height: 20,\n borderWidth: 2,\n borderRadius: 4,\n borderColor: themeVariables.uncheckedBorderColor,\n backgroundColor: themeVariables.uncheckedBgColor,\n },\n text: {},\n icon : {\n color: 'transparent',\n }\n } as WmIconStyles,\n checkedItem: {} as AllStyle,\n selectedLabel: {} as AllStyle,\n });\n\n\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n opacity: 0.8\n },\n text : {\n color: themeVariables.checkedDisabledColor\n }\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n });\n"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAYxF,OAAO,MAAMC,aAAa,GAAG,cAAc;AAC3CF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAA+B,GAAGL,YAAY,CAAC;IACjDM,IAAI,EAAE;MACJC,aAAa,EAAE,KAAK;MACpBC,YAAY,EAAE;IAChB,CAAC;IACDC,IAAI,EAAE;MACJC,SAAS,EAAE,QAAQ;MACnBC,UAAU,EAAER,cAAc,CAACS,QAAQ;MACnCC,QAAQ,EAAE,EAAE;MACZC,KAAK,EAAEX,cAAc,CAACY,iBAAiB;MACvCC,UAAU,EAAE;IAC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,IAAI,EAAG;MACLiC,OAAO,EAAE;IACX,CAAC;IACD9B,IAAI,EAAG;MACLK,KAAK,EAAEX,cAAc,CAACqC;IACxB;EACF,CAAC,CAAC;EAEFpC,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC5C,CAAC,CAAC","ignoreList":[]}
@@ -12,6 +12,7 @@ import { BaseDatasetComponent, BaseDatasetState } from '@wavemaker/app-rn-runtim
12
12
  import WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';
13
13
  import WmPicture from '@wavemaker/app-rn-runtime/components/basic/picture/picture.component';
14
14
  import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
15
+ import WmLabel from '../../basic/label/label.component';
15
16
  export class WmChipsState extends BaseDatasetState {
16
17
  constructor(...args) {
17
18
  super(...args);
@@ -198,12 +199,18 @@ export default class WmChips extends BaseDatasetComponent {
198
199
  color: isSelected ? this.styles.activeChipLabel.color : null
199
200
  }
200
201
  })
201
- }) : null, /*#__PURE__*/React.createElement(WmPicture, {
202
+ }) : null, this._showSkeleton ? null : /*#__PURE__*/React.createElement(WmPicture, {
202
203
  id: this.getTestId('chip' + index + 'picture'),
203
204
  styles: this.styles.imageStyles,
204
205
  picturesource: item.imgSrc,
205
206
  shape: "circle"
206
- }), /*#__PURE__*/React.createElement(Text, _extends({}, this.getTestPropsForAction('chip' + index + 'label'), {
207
+ }), this._showSkeleton ? /*#__PURE__*/React.createElement(WmLabel, {
208
+ styles: {
209
+ root: {
210
+ width: 50
211
+ }
212
+ }
213
+ }) : /*#__PURE__*/React.createElement(Text, _extends({}, this.getTestPropsForAction('chip' + index + 'label'), {
207
214
  style: [this.styles.chipLabel, isSelected ? this.styles.activeChipLabel : null]
208
215
  }), item.displayexp || item.displayfield), !this.isDefaultView() && !this.state.props.disabled ? /*#__PURE__*/React.createElement(WmIcon, {
209
216
  id: this.getTestId('clearbtn'),
@@ -235,6 +242,13 @@ export default class WmChips extends BaseDatasetComponent {
235
242
  (_this$searchRef2 = this.searchRef) === null || _this$searchRef2 === void 0 || _this$searchRef2.computePosition();
236
243
  }
237
244
  }
245
+ renderSkeleton() {
246
+ return /*#__PURE__*/React.createElement(View, {
247
+ style: this.styles.root
248
+ }, /*#__PURE__*/React.createElement(View, {
249
+ style: this.styles.chipsWrapper
250
+ }, [{}, {}, {}].map((item, index) => this.renderChip(item, index))));
251
+ }
238
252
  renderWidget(props) {
239
253
  const chips = this.state.chipsList;
240
254
  return /*#__PURE__*/React.createElement(View, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","TouchableOpacity","Text","clone","findIndex","get","isUndefined","pull","forEach","filter","find","isEqual","merge","WmChipsProps","DEFAULT_CLASS","WmSearch","BaseDatasetComponent","BaseDatasetState","WmIcon","WmPicture","AccessibilityWidgetType","getAccessibilityProps","WmChipsState","constructor","args","_defineProperty","WmChips","props","onComponentInit","c","searchRef","val","onPropertyChange","name","$new","$old","length","updateState","chipsList","reset","_this$searchRef","state","query","onDataItemsUpdate","isDefaultQuery","updateDefaultQueryModel","addItem","$event","widget","_this$props","_this$props2","newChipList","allowAdd","push","queryModel","isFormFieldWidget","isDuplicate","resetSearchModel","invokeEvent","invokeEventCallback","toBoolean","setDatavalue","computeDisplayValue","displayValue","dataItems","item","selected","map","displayexp","displayfield","selectChip","chipItem","maxsize","selectedItem","d","key","dataValue","datafield","updateDatavalue","updateMaxSize","prevDatavalue","createCustomDataModel","dataObject","isCustom","clearSearch","chipListLength","saturate","removeItem","index","allowRemove","isDefaultView","_this$state$dataItems","searchable","renderChip","isSelected","createElement","_extends","getTestPropsForAction","CHIPS","style","styles","chip","activeChip","onPress","disabled","readonly","id","getTestId","iconclass","iconsize","doneIcon","icon","color","activeChipLabel","imageStyles","picturesource","imgSrc","shape","chipLabel","clearIcon","onTap","selectedItems","componentDidMount","componentDidUpdate","prevProps","prevState","_this$searchRef2","computePosition","renderWidget","chips","root","chipsWrapper","searchContainer","flexDirection","inputposition","search","placeholder","maxSizeReached","listener","dataset","searchkey","minchars","autofocus","displayexpression","getDisplayExpression","displayimagesrc","onSubmit","bind","onChange","_this$props$listener","_this$props$listener2","onComponentChange","showSearchIcon","showclear","type","flexWrap"],"sources":["chips.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, TouchableOpacity, Text } from 'react-native';\nimport { LifecycleListener } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { clone, findIndex, get, isUndefined, pull, forEach, filter, find, isEqual, merge } from 'lodash';\nimport WmChipsProps from './chips.props';\nimport { DEFAULT_CLASS, WmChipsStyles } from './chips.styles';\nimport WmSearch from '@wavemaker/app-rn-runtime/components/basic/search/search.component';\nimport {\n BaseDatasetComponent,\n BaseDatasetState\n} from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmPicture from '@wavemaker/app-rn-runtime/components/basic/picture/picture.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nexport class WmChipsState extends BaseDatasetState<WmChipsProps> {\n chipsList: any = [];\n saturate: any;\n}\n\nexport default class WmChips extends BaseDatasetComponent<WmChipsProps, WmChipsState, WmChipsStyles> {\n constructor(props: WmChipsProps) {\n super(props, DEFAULT_CLASS, new WmChipsProps(), new WmChipsState());\n }\n\n private searchRef: WmSearch = null as any;\n private maxSizeReached = 'Max size reached';\n private isDefaultQuery: boolean = true;\n private prevDatavalue: any;\n\n private listener: LifecycleListener = {\n onComponentInit: (c) => {\n if (c instanceof WmSearch) {\n this.searchRef = c;\n }\n }\n };\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case 'datavalue':\n if (!$new || $new.length === 0) {\n this.updateState({\n chipsList : []\n } as WmChipsState);\n }\n }\n }\n\n reset() {\n if (this.searchRef?.state.props.query) {\n this.searchRef.reset();\n }\n }\n\n onDataItemsUpdate() {\n super.onDataItemsUpdate();\n this.isDefaultQuery = true;\n this.updateDefaultQueryModel();\n }\n\n addItem($event: any, widget: any) {\n let newChipList = clone(this.state.chipsList),\n allowAdd;\n newChipList.push(widget.queryModel);\n const isFormFieldWidget = get(this.props, 'formfield');\n if (this.isDuplicate(widget.queryModel)) {\n this.resetSearchModel();\n return;\n }\n\n // @ts-ignore\n allowAdd = isFormFieldWidget ? this.props?.invokeEvent('onBeforeadd', [null, this, widget.queryModel]) : this.invokeEventCallback('onBeforeadd', [null, this, widget.queryModel]);\n\n if (!isUndefined(allowAdd) && !this.toBoolean(allowAdd)) {\n return;\n }\n\n this.updateState({\n chipsList: newChipList\n } as WmChipsState);\n\n this.setDatavalue(newChipList);\n\n // @ts-ignore\n isFormFieldWidget ? this.props?.invokeEvent('onAdd', [null, this, widget.queryModel]) : this.invokeEventCallback('onAdd', [null, this, widget.queryModel]);\n this.resetSearchModel();\n }\n\n computeDisplayValue() {\n this.updateState({\n props: {\n displayValue: ((this.state.dataItems || [] as any)\n .filter((item: any) => item.selected)\n .map((item: any) => item.displayexp || item.displayfield)) || ''\n }\n } as WmChipsState);\n }\n\n selectChip(chipItem: any) {\n if (!chipItem.selected && this.state.props.maxsize > 0 && (this.state.chipsList.length === this.state.props.maxsize)) {\n return;\n }\n chipItem.selected = !chipItem.selected;\n const newChipList: any = [];\n const selectedItem = find(this.state.dataItems, d => isEqual(d.key, chipItem.key));\n selectedItem.selected = chipItem.selected;\n forEach(this.state.dataItems, (item) => {\n if (item.selected) {\n newChipList.push(item);\n }\n });\n this.updateState({\n chipsList: newChipList\n } as WmChipsState);\n\n this.setDatavalue(newChipList);\n }\n\n setDatavalue(newChipList: any) {\n const dataValue = newChipList.map((item: any) => item.datafield);\n this.updateDatavalue(dataValue);\n this.updateMaxSize(newChipList.length);\n if (!this.props.invokeEvent) {\n this.invokeEventCallback('onChange', [null, this, dataValue, this.prevDatavalue])\n }\n this.prevDatavalue = dataValue;\n }\n\n toBoolean = (val: any) => ((val && val !== 'false') ? true : false);\n\n // Prepare datavalue object from a string(junk) value when datafield is allFields.\n createCustomDataModel(val: string) {\n return {\n key: `${this.state.props.name}_item${this.state.chipsList.length}`,\n dataObject: val,\n displayfield: val,\n datafield: val,\n isCustom: true\n }\n }\n\n resetSearchModel() {\n (this as any).searchRef.isDefaultQuery = false;\n this.searchRef.clearSearch();\n }\n\n isDuplicate(item: any) {\n return findIndex(this.state.chipsList, {datafield: item.datafield}) > -1;\n }\n\n // Check if max size is reached\n private updateMaxSize(chipListLength: number) {\n const saturate = this.state.props.maxsize > 0 && (chipListLength || this.state.chipsList.length) === this.state.props.maxsize;\n this.updateState({\n saturate: saturate\n } as WmChipsState);\n }\n\n removeItem(item: any, index: any) {\n let newChipList = clone(this.state.chipsList);\n const isFormFieldWidget = get(this.props, 'formfield');\n newChipList = pull(newChipList, item);\n // prevent deletion if the before-remove event callback returns false\n // @ts-ignore\n const allowRemove = isFormFieldWidget ? this.props.invokeEvent('onBeforeremove',[null, this, item]) : this.invokeEventCallback('onBeforeremove',[null, this, item]);\n if (!isUndefined(allowRemove) && !this.toBoolean(allowRemove)) {\n return;\n }\n this.updateState({\n chipsList: newChipList\n } as WmChipsState);\n this.setDatavalue(newChipList);\n // @ts-ignore\n isFormFieldWidget ? this.props.invokeEvent('onRemove', [null, this, item]) : this.invokeEventCallback('onRemove', [null, this, item]);\n }\n\n private isDefaultView() {\n return !this.state.props.searchable && this.state.dataItems?.length <= 10;\n }\n\n renderChip(item: any, index: any) {\n const isSelected = this.isDefaultView() ? item.selected : true;\n return (\n <TouchableOpacity\n {...this.getTestPropsForAction('chip'+ index)}\n {...getAccessibilityProps(AccessibilityWidgetType.CHIPS, {...this.state.props, selected: isSelected})}\n style={[this.styles.chip, isSelected ? this.styles.activeChip : null]}\n key={'chipitem_'+ index}\n onPress={() => {\n if (this.state.props.disabled || this.state.props.readonly) {\n return;\n }\n if (this.isDefaultView()) {\n this.selectChip(item);\n }\n if (get(this.props, 'formfield')) {\n // @ts-ignore\n this.props.invokeEvent('onChipclick', [null, this, item]);\n // @ts-ignore\n this.props.invokeEvent('onChipselect', [null, this, item]);\n } else {\n this.invokeEventCallback('onChipclick', [null, this, item]);\n this.invokeEventCallback('onChipselect', [null, this, item]);\n }\n }}>\n {isSelected && this.isDefaultView() ? <WmIcon id={this.getTestId('checkicon')} iconclass={'wm-sl-l sl-check'} iconsize={16} styles={merge({}, this.styles.doneIcon, {icon: {color: isSelected ? this.styles.activeChipLabel.color : null}})}></WmIcon> : null}\n <WmPicture id={this.getTestId('chip'+ index + 'picture')} styles={this.styles.imageStyles} picturesource={item.imgSrc} shape='circle'></WmPicture>\n <Text {...this.getTestPropsForAction('chip'+ index+'label')}style={[this.styles.chipLabel, isSelected ? this.styles.activeChipLabel : null]}>{item.displayexp || item.displayfield}</Text>\n {!this.isDefaultView() && !this.state.props.disabled ? <WmIcon id={this.getTestId('clearbtn')} iconclass={'wi wi-clear'} iconsize={16} styles={this.styles.clearIcon} onTap={() => this.removeItem(item, index)}></WmIcon> : null}\n </TouchableOpacity>\n )\n }\n\n updateDefaultQueryModel() {\n if (this.state.dataItems && this.state.dataItems.length && this.isDefaultQuery) {\n const selectedItems = filter(this.state.dataItems, (item) => item.selected);\n if (selectedItems.length) {\n this.updateState({\n chipsList: selectedItems\n } as WmChipsState);\n }\n this.isDefaultQuery = false;\n }\n }\n\n componentDidMount(): void {\n super.componentDidMount();\n this.updateDefaultQueryModel();\n }\n\n componentDidUpdate(prevProps: WmChipsProps, prevState: WmChipsState) {\n super.componentDidUpdate(prevProps, prevState);\n if (prevState.chipsList !== this.state.chipsList) {\n this.searchRef?.computePosition();\n }\n }\n\n renderWidget(props: WmChipsProps) {\n const chips = this.state.chipsList;\n return (<View style={this.styles.root}>\n\n <View style={this.styles.chipsWrapper}>\n {\n this.isDefaultView() ? this.state.dataItems.map((item: any, index: any) => this.renderChip(item, index)) : null\n }\n { props.searchable || !this.isDefaultView() ?\n <View style={[this.styles.searchContainer, {flexDirection: props.inputposition === 'first' ? 'column' : 'column-reverse'}]}>\n <WmSearch\n id={this.getTestId('search')}\n name=\"app-chip-search\"\n styles={this.styles.search}\n placeholder={this.state.saturate ? this.maxSizeReached : props.placeholder}\n listener={this.listener}\n dataset={props.dataset}\n searchkey={props.searchkey}\n minchars={props.minchars}\n autofocus={props.autofocus}\n disabled={props.disabled || props.readonly || this.state.saturate}\n readonly={props.readonly}\n displayexpression={props.displayexpression}\n getDisplayExpression={props.getDisplayExpression}\n displayimagesrc={props.displayimagesrc}\n displayfield={props.displayfield}\n datafield={props.datafield}\n onSubmit={this.addItem.bind(this)}\n onChange={() => {\n this.isDefaultQuery = false;\n this.props.listener?.onComponentChange && this.props.listener?.onComponentChange(this)\n }}\n showSearchIcon={false}\n showclear={false}\n type={props.minchars === 0 ? 'autocomplete' : 'search'}/>\n <View style={{ flexDirection: 'row', flexWrap: 'wrap'}}>\n {chips && chips.length ?\n chips.map((item: any, index: any) => this.renderChip(item, index))\n : null}\n </View>\n </View>\n : null }\n </View>\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AAE3D,SAASC,KAAK,EAAEC,SAAS,EAAEC,GAAG,EAAEC,WAAW,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,KAAK,QAAQ,QAAQ;AACxG,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,OAAOC,QAAQ,MAAM,oEAAoE;AACzF,SACEC,oBAAoB,EACpBC,gBAAgB,QACX,8EAA8E;AACrF,OAAOC,MAAM,MAAM,gEAAgE;AACnF,OAAOC,SAAS,MAAM,sEAAsE;AAC5F,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAO,MAAMC,YAAY,SAASL,gBAAgB,CAAe;EAAAM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K;QAAEsB,QAAQ,EAAE;MAAM;IAAE,GACpD1B,KAAK,IAAIA,KAAK,CAAC7F,MAAM,GACtB6F,KAAK,CAAC9D,GAAG,CAAC,CAACF,IAAS,EAAEuB,KAAU,KAAK,IAAI,CAACK,UAAU,CAAC5B,IAAI,EAAEuB,KAAK,CAAC,CAAC,GAChE,IACE,CACJ,CAAC,GACJ,IACD,CACF,CAAC;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","TouchableOpacity","Text","clone","findIndex","get","isUndefined","pull","forEach","filter","find","isEqual","merge","WmChipsProps","DEFAULT_CLASS","WmSearch","BaseDatasetComponent","BaseDatasetState","WmIcon","WmPicture","AccessibilityWidgetType","getAccessibilityProps","WmLabel","WmChipsState","constructor","args","_defineProperty","WmChips","props","onComponentInit","c","searchRef","val","onPropertyChange","name","$new","$old","length","updateState","chipsList","reset","_this$searchRef","state","query","onDataItemsUpdate","isDefaultQuery","updateDefaultQueryModel","addItem","$event","widget","_this$props","_this$props2","newChipList","allowAdd","push","queryModel","isFormFieldWidget","isDuplicate","resetSearchModel","invokeEvent","invokeEventCallback","toBoolean","setDatavalue","computeDisplayValue","displayValue","dataItems","item","selected","map","displayexp","displayfield","selectChip","chipItem","maxsize","selectedItem","d","key","dataValue","datafield","updateDatavalue","updateMaxSize","prevDatavalue","createCustomDataModel","dataObject","isCustom","clearSearch","chipListLength","saturate","removeItem","index","allowRemove","isDefaultView","_this$state$dataItems","searchable","renderChip","isSelected","createElement","_extends","getTestPropsForAction","CHIPS","style","styles","chip","activeChip","onPress","disabled","readonly","id","getTestId","iconclass","iconsize","doneIcon","icon","color","activeChipLabel","_showSkeleton","imageStyles","picturesource","imgSrc","shape","root","width","chipLabel","clearIcon","onTap","selectedItems","componentDidMount","componentDidUpdate","prevProps","prevState","_this$searchRef2","computePosition","renderSkeleton","chipsWrapper","renderWidget","chips","searchContainer","flexDirection","inputposition","search","placeholder","maxSizeReached","listener","dataset","searchkey","minchars","autofocus","displayexpression","getDisplayExpression","displayimagesrc","onSubmit","bind","onChange","_this$props$listener","_this$props$listener2","onComponentChange","showSearchIcon","showclear","type","flexWrap"],"sources":["chips.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, TouchableOpacity, Text, DimensionValue } from 'react-native';\nimport { LifecycleListener } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { clone, findIndex, get, isUndefined, pull, forEach, filter, find, isEqual, merge } from 'lodash';\nimport WmChipsProps from './chips.props';\nimport { DEFAULT_CLASS, WmChipsStyles } from './chips.styles';\nimport WmSearch from '@wavemaker/app-rn-runtime/components/basic/search/search.component';\nimport {\n BaseDatasetComponent,\n BaseDatasetState\n} from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmPicture from '@wavemaker/app-rn-runtime/components/basic/picture/picture.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport WmLabel from '../../basic/label/label.component';\n\nexport class WmChipsState extends BaseDatasetState<WmChipsProps> {\n chipsList: any = [];\n saturate: any;\n}\n\nexport default class WmChips extends BaseDatasetComponent<WmChipsProps, WmChipsState, WmChipsStyles> {\n constructor(props: WmChipsProps) {\n super(props, DEFAULT_CLASS, new WmChipsProps(), new WmChipsState());\n }\n\n private searchRef: WmSearch = null as any;\n private maxSizeReached = 'Max size reached';\n private isDefaultQuery: boolean = true;\n private prevDatavalue: any;\n\n private listener: LifecycleListener = {\n onComponentInit: (c) => {\n if (c instanceof WmSearch) {\n this.searchRef = c;\n }\n }\n };\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case 'datavalue':\n if (!$new || $new.length === 0) {\n this.updateState({\n chipsList : []\n } as WmChipsState);\n }\n }\n }\n\n reset() {\n if (this.searchRef?.state.props.query) {\n this.searchRef.reset();\n }\n }\n\n onDataItemsUpdate() {\n super.onDataItemsUpdate();\n this.isDefaultQuery = true;\n this.updateDefaultQueryModel();\n }\n\n addItem($event: any, widget: any) {\n let newChipList = clone(this.state.chipsList),\n allowAdd;\n newChipList.push(widget.queryModel);\n const isFormFieldWidget = get(this.props, 'formfield');\n if (this.isDuplicate(widget.queryModel)) {\n this.resetSearchModel();\n return;\n }\n\n // @ts-ignore\n allowAdd = isFormFieldWidget ? this.props?.invokeEvent('onBeforeadd', [null, this, widget.queryModel]) : this.invokeEventCallback('onBeforeadd', [null, this, widget.queryModel]);\n\n if (!isUndefined(allowAdd) && !this.toBoolean(allowAdd)) {\n return;\n }\n\n this.updateState({\n chipsList: newChipList\n } as WmChipsState);\n\n this.setDatavalue(newChipList);\n\n // @ts-ignore\n isFormFieldWidget ? this.props?.invokeEvent('onAdd', [null, this, widget.queryModel]) : this.invokeEventCallback('onAdd', [null, this, widget.queryModel]);\n this.resetSearchModel();\n }\n\n computeDisplayValue() {\n this.updateState({\n props: {\n displayValue: ((this.state.dataItems || [] as any)\n .filter((item: any) => item.selected)\n .map((item: any) => item.displayexp || item.displayfield)) || ''\n }\n } as WmChipsState);\n }\n\n selectChip(chipItem: any) {\n if (!chipItem.selected && this.state.props.maxsize > 0 && (this.state.chipsList.length === this.state.props.maxsize)) {\n return;\n }\n chipItem.selected = !chipItem.selected;\n const newChipList: any = [];\n const selectedItem = find(this.state.dataItems, d => isEqual(d.key, chipItem.key));\n selectedItem.selected = chipItem.selected;\n forEach(this.state.dataItems, (item) => {\n if (item.selected) {\n newChipList.push(item);\n }\n });\n this.updateState({\n chipsList: newChipList\n } as WmChipsState);\n\n this.setDatavalue(newChipList);\n }\n\n setDatavalue(newChipList: any) {\n const dataValue = newChipList.map((item: any) => item.datafield);\n this.updateDatavalue(dataValue);\n this.updateMaxSize(newChipList.length);\n if (!this.props.invokeEvent) {\n this.invokeEventCallback('onChange', [null, this, dataValue, this.prevDatavalue])\n }\n this.prevDatavalue = dataValue;\n }\n\n toBoolean = (val: any) => ((val && val !== 'false') ? true : false);\n\n // Prepare datavalue object from a string(junk) value when datafield is allFields.\n createCustomDataModel(val: string) {\n return {\n key: `${this.state.props.name}_item${this.state.chipsList.length}`,\n dataObject: val,\n displayfield: val,\n datafield: val,\n isCustom: true\n }\n }\n\n resetSearchModel() {\n (this as any).searchRef.isDefaultQuery = false;\n this.searchRef.clearSearch();\n }\n\n isDuplicate(item: any) {\n return findIndex(this.state.chipsList, {datafield: item.datafield}) > -1;\n }\n\n // Check if max size is reached\n private updateMaxSize(chipListLength: number) {\n const saturate = this.state.props.maxsize > 0 && (chipListLength || this.state.chipsList.length) === this.state.props.maxsize;\n this.updateState({\n saturate: saturate\n } as WmChipsState);\n }\n\n removeItem(item: any, index: any) {\n let newChipList = clone(this.state.chipsList);\n const isFormFieldWidget = get(this.props, 'formfield');\n newChipList = pull(newChipList, item);\n // prevent deletion if the before-remove event callback returns false\n // @ts-ignore\n const allowRemove = isFormFieldWidget ? this.props.invokeEvent('onBeforeremove',[null, this, item]) : this.invokeEventCallback('onBeforeremove',[null, this, item]);\n if (!isUndefined(allowRemove) && !this.toBoolean(allowRemove)) {\n return;\n }\n this.updateState({\n chipsList: newChipList\n } as WmChipsState);\n this.setDatavalue(newChipList);\n // @ts-ignore\n isFormFieldWidget ? this.props.invokeEvent('onRemove', [null, this, item]) : this.invokeEventCallback('onRemove', [null, this, item]);\n }\n\n private isDefaultView() {\n return !this.state.props.searchable && this.state.dataItems?.length <= 10;\n }\n\n renderChip(item: any, index: any) {\n const isSelected = this.isDefaultView() ? item.selected : true;\n return (\n <TouchableOpacity\n {...this.getTestPropsForAction('chip'+ index)}\n {...getAccessibilityProps(AccessibilityWidgetType.CHIPS, {...this.state.props, selected: isSelected})}\n style={[this.styles.chip, isSelected ? this.styles.activeChip : null]}\n key={'chipitem_'+ index}\n onPress={() => {\n if (this.state.props.disabled || this.state.props.readonly) {\n return;\n }\n if (this.isDefaultView()) {\n this.selectChip(item);\n }\n if (get(this.props, 'formfield')) {\n // @ts-ignore\n this.props.invokeEvent('onChipclick', [null, this, item]);\n // @ts-ignore\n this.props.invokeEvent('onChipselect', [null, this, item]);\n } else {\n this.invokeEventCallback('onChipclick', [null, this, item]);\n this.invokeEventCallback('onChipselect', [null, this, item]);\n }\n }}>\n {isSelected && this.isDefaultView() ? <WmIcon id={this.getTestId('checkicon')} iconclass={'wm-sl-l sl-check'} iconsize={16} styles={merge({}, this.styles.doneIcon, {icon: {color: isSelected ? this.styles.activeChipLabel.color : null}})}></WmIcon> : null}\n { this._showSkeleton ? null : <WmPicture id={this.getTestId('chip'+ index + 'picture')} styles={this.styles.imageStyles} picturesource={item.imgSrc} shape='circle'></WmPicture>}\n { this._showSkeleton ? <WmLabel styles={{root: {width: 50}}}/> : <Text {...this.getTestPropsForAction('chip'+ index+'label')}style={[this.styles.chipLabel, isSelected ? this.styles.activeChipLabel : null]}>{item.displayexp || item.displayfield}</Text>}\n {!this.isDefaultView() && !this.state.props.disabled ? <WmIcon id={this.getTestId('clearbtn')} iconclass={'wi wi-clear'} iconsize={16} styles={this.styles.clearIcon} onTap={() => this.removeItem(item, index)}></WmIcon> : null}\n </TouchableOpacity>\n )\n }\n\n updateDefaultQueryModel() {\n if (this.state.dataItems && this.state.dataItems.length && this.isDefaultQuery) {\n const selectedItems = filter(this.state.dataItems, (item) => item.selected);\n if (selectedItems.length) {\n this.updateState({\n chipsList: selectedItems\n } as WmChipsState);\n }\n this.isDefaultQuery = false;\n }\n }\n\n componentDidMount(): void {\n super.componentDidMount();\n this.updateDefaultQueryModel();\n }\n\n componentDidUpdate(prevProps: WmChipsProps, prevState: WmChipsState) {\n super.componentDidUpdate(prevProps, prevState);\n if (prevState.chipsList !== this.state.chipsList) {\n this.searchRef?.computePosition();\n }\n } \n renderSkeleton(): React.ReactNode {\n return (<View style={this.styles.root}>\n <View style={this.styles.chipsWrapper}>{ \n [{}, {}, {}].map((item: any, index: any) => this.renderChip(item, index)) }\n </View>\n </View>)\n }\n\n renderWidget(props: WmChipsProps) {\n const chips = this.state.chipsList;\n return (<View style={this.styles.root}>\n\n <View style={this.styles.chipsWrapper}>\n {\n this.isDefaultView() ? this.state.dataItems.map((item: any, index: any) => this.renderChip(item, index)) : null\n }\n { props.searchable || !this.isDefaultView() ?\n <View style={[this.styles.searchContainer, {flexDirection: props.inputposition === 'first' ? 'column' : 'column-reverse'}]}>\n <WmSearch\n id={this.getTestId('search')}\n name=\"app-chip-search\"\n styles={this.styles.search}\n placeholder={this.state.saturate ? this.maxSizeReached : props.placeholder}\n listener={this.listener}\n dataset={props.dataset}\n searchkey={props.searchkey}\n minchars={props.minchars}\n autofocus={props.autofocus}\n disabled={props.disabled || props.readonly || this.state.saturate}\n readonly={props.readonly}\n displayexpression={props.displayexpression}\n getDisplayExpression={props.getDisplayExpression}\n displayimagesrc={props.displayimagesrc}\n displayfield={props.displayfield}\n datafield={props.datafield}\n onSubmit={this.addItem.bind(this)}\n onChange={() => {\n this.isDefaultQuery = false;\n this.props.listener?.onComponentChange && this.props.listener?.onComponentChange(this)\n }}\n showSearchIcon={false}\n showclear={false}\n type={props.minchars === 0 ? 'autocomplete' : 'search'}/>\n <View style={{ flexDirection: 'row', flexWrap: 'wrap'}}>\n {chips && chips.length ?\n chips.map((item: any, index: any) => this.renderChip(item, index))\n : null}\n </View>\n </View>\n : null }\n </View>\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAwB,cAAc;AAE3E,SAASC,KAAK,EAAEC,SAAS,EAAEC,GAAG,EAAEC,WAAW,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,KAAK,QAAQ,QAAQ;AACxG,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,OAAOC,QAAQ,MAAM,oEAAoE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eleton: {
81
+ root: {
82
+ width: 80,
83
+ borderRadius: 8,
84
+ padding: 4,
85
+ minHeight: 32
86
+ }
79
87
  }
80
88
  });
81
89
  addStyle(DEFAULT_CLASS, '', defaultStyles);
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexWrap","text","chipsWrapper","flexDirection","chip","margin","backgroundColor","chipContainerColor","borderRadius","alignItems","justifyContent","paddingVertical","paddingHorizontal","minWidth","minHeight","borderWidth","borderColor","chipborderColor","elevation","chipLabel","fontSize","paddingLeft","fontFamily","baseFont","fontWeight","paddingRight","color","chipDefaultTextColor","activeChip","chipSelectedContainerColor","chipSelectedOutlineColor","activeChipLabel","chipActiveTextColor","searchContainer","width","search","marginBottom","borderRightWidth","borderTopRightRadius","borderBottomRightRadius","doneIcon","icon","chipIconColor","clearIcon","imageStyles","height","opacity","inputDisabledBgColor"],"sources":["chips.styles.ts"],"sourcesContent":["import { TextStyle } from 'react-native';\nimport BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSearchStyles } from '@wavemaker/app-rn-runtime/components/basic/search/search.styles';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmPictureStyles } from '@wavemaker/app-rn-runtime/components/basic/picture/picture.styles';\n\nexport type WmChipsStyles = BaseStyles & {\n chip: AllStyle;\n chipLabel: TextStyle;\n chipsWrapper: AllStyle;\n search: WmSearchStyles;\n searchContainer: AllStyle;\n activeChip: AllStyle;\n activeChipLabel: TextStyle;\n clearIcon: WmIconStyles;\n doneIcon: WmIconStyles;\n imageStyles: WmPictureStyles\n};\n\nexport const DEFAULT_CLASS = 'app-chips';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmChipsStyles = defineStyles({\n root: {\n flexWrap: 'wrap',\n },\n text: {},\n chipsWrapper: {\n flexDirection: 'row',\n flexWrap: 'wrap'\n },\n chip: {\n margin: 2,\n backgroundColor: themeVariables.chipContainerColor,\n borderRadius: 8,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n paddingVertical: 4,\n paddingHorizontal: 4,\n minWidth: 80,\n minHeight: 32,\n borderWidth: 1,\n borderColor: themeVariables.chipborderColor,\n elevation: 1\n },\n chipLabel : {\n fontSize: 14,\n paddingLeft: 8,\n fontFamily: themeVariables.baseFont,\n fontWeight: '500',\n paddingRight: 12,\n color: themeVariables.chipDefaultTextColor,\n borderColor: themeVariables.chipborderColor\n },\n activeChip: {\n backgroundColor: themeVariables.chipSelectedContainerColor, \n borderColor: themeVariables.chipSelectedOutlineColor,\n borderWidth: 0\n },\n activeChipLabel: {\n color: themeVariables.chipActiveTextColor\n },\n searchContainer: {\n width: '100%',\n flexDirection: 'column'\n },\n search: {\n root: {\n marginBottom: 8\n },\n text: {\n borderRightWidth: 1,\n borderTopRightRadius: 4,\n borderBottomRightRadius: 4\n }\n } as WmSearchStyles,\n doneIcon: {\n icon: {\n paddingLeft: 8,\n fontSize: 18,\n color: themeVariables.chipIconColor,\n }\n } as WmIconStyles,\n clearIcon: {\n icon: {\n color: themeVariables.chipIconColor,\n paddingRight: 8,\n fontSize: 18\n }\n } as WmIconStyles,\n imageStyles: {\n root: {\n width: 32,\n height: 32\n }\n } as WmPictureStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n chip: {\n opacity: 0.5\n },\n search: {\n root : {\n backgroundColor: themeVariables.inputDisabledBgColor\n }\n }\n });\n});\n"],"mappings":"AACA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAkBxF,OAAO,MAAMC,aAAa,GAAG,WAAW;AACxCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,M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AAE,CAAC;QACvBC,uBAAuB,EAAE;MAC3B;IACF,CAAmB;IACnBC,QAAQ,EAAE;MACRC,IAAI,EAAE;QACJpB,WAAW,EAAE,CAAC;QACdD,QAAQ,EAAE,EAAE;QACZM,KAAK,EAAE9B,cAAc,CAAC8C;MACxB;IACF,CAAiB;IACjBC,SAAS,EAAE;MACTF,IAAI,EAAE;QACJf,KAAK,EAAE9B,cAAc,CAAC8C,aAAa;QACnCjB,YAAY,EAAE,CAAC;QACfL,QAAQ,EAAE;MACZ;IACF,CAAiB;IACjBwB,WAAW,EAAE;MACX7C,IAAI,EAAE;QACJmC,KAAK,EAAE,EAAE;QACTW,MAAM,EAAE;MACV;IACF;EACJ,CAAC,CAAC;EAEFhD,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACxCU,IAAI,EAAE;MACJ0C,OAAO,EAAE;IACX,CAAC;IACDX,MAAM,EAAE;MACNpC,IAAI,EAAG;QACLO,eAAe,EAAEV,cAAc,CAACmD;MAClC;IACF;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexWrap","text","chipsWrapper","flexDirection","chip","margin","backgroundColor","chipContainerColor","borderRadius","alignItems","justifyContent","paddingVertical","paddingHorizontal","minWidth","minHeight","borderWidth","borderColor","chipborderColor","elevation","chipLabel","fontSize","paddingLeft","fontFamily","baseFont","fontWeight","paddingRight","color","chipDefaultTextColor","activeChip","chipSelectedContainerColor","chipSelectedOutlineColor","activeChipLabel","chipActiveTextColor","searchContainer","width","search","marginBottom","borderRightWidth","borderTopRightRadius","borderBottomRightRadius","doneIcon","icon","chipIconColor","clearIcon","imageStyles","height","skeleton","padding","opacity","inputDisabledBgColor"],"sources":["chips.styles.ts"],"sourcesContent":["import { TextStyle } from 'react-native';\nimport BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSearchStyles } from '@wavemaker/app-rn-runtime/components/basic/search/search.styles';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmPictureStyles } from '@wavemaker/app-rn-runtime/components/basic/picture/picture.styles';\nimport { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\n\nexport type WmChipsStyles = BaseStyles & {\n chip: AllStyle;\n chipLabel: TextStyle;\n chipsWrapper: AllStyle;\n search: WmSearchStyles;\n searchContainer: AllStyle;\n activeChip: AllStyle;\n activeChipLabel: TextStyle;\n clearIcon: WmIconStyles;\n doneIcon: WmIconStyles;\n imageStyles: WmPictureStyles;\n skeleton: WmSkeletonStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-chips';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmChipsStyles = defineStyles({\n root: {\n flexWrap: 'wrap',\n },\n text: {},\n chipsWrapper: {\n flexDirection: 'row',\n flexWrap: 'wrap'\n },\n chip: {\n margin: 2,\n backgroundColor: themeVariables.chipContainerColor,\n borderRadius: 8,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n paddingVertical: 4,\n paddingHorizontal: 4,\n minWidth: 80,\n minHeight: 32,\n borderWidth: 1,\n borderColor: themeVariables.chipborderColor,\n elevation: 1\n },\n chipLabel : {\n fontSize: 14,\n paddingLeft: 8,\n fontFamily: themeVariables.baseFont,\n fontWeight: '500',\n paddingRight: 12,\n color: themeVariables.chipDefaultTextColor,\n borderColor: themeVariables.chipborderColor\n },\n activeChip: {\n backgroundColor: themeVariables.chipSelectedContainerColor, \n borderColor: themeVariables.chipSelectedOutlineColor,\n borderWidth: 0\n },\n activeChipLabel: {\n color: themeVariables.chipActiveTextColor\n },\n searchContainer: {\n width: '100%',\n flexDirection: 'column'\n },\n search: {\n root: {\n marginBottom: 8\n },\n text: {\n borderRightWidth: 1,\n borderTopRightRadius: 4,\n borderBottomRightRadius: 4\n }\n } as WmSearchStyles,\n doneIcon: {\n icon: {\n paddingLeft: 8,\n fontSize: 18,\n color: themeVariables.chipIconColor,\n }\n } as WmIconStyles,\n clearIcon: {\n icon: {\n color: themeVariables.chipIconColor,\n paddingRight: 8,\n fontSize: 18\n }\n } as WmIconStyles,\n imageStyles: {\n root: {\n width: 32,\n height: 32\n }\n } as WmPictureStyles,\n skeleton: {\n root:{\n width: 80,\n borderRadius: 8,\n padding:4,\n minHeight: 32,\n }\n } as any as WmSkeletonStyles,\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n chip: {\n opacity: 0.5\n },\n search: {\n root : {\n backgroundColor: themeVariables.inputDisabledBgColor\n }\n }\n });\n});\n"],"mappings":"AACA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAoBxF,OAAO,MAAMC,aAAa,GAAG,WAAW;AACxCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA4B,GAAGL,YAAY,CAAC;IAC9CM,IAAI,EAAE;MACJC,QAAQ,EAAE;IACZ,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,YAAY,EAAE;MACZC,aAAa,EAAE,KAAK;MACpBH,QAAQ,EAAE;IACZ,CAAC;IACDI,IAAI,EAAE;MACJC,MAAM,EAAE,CAAC;MACTC,eAAe,EAAEV,cAAc,CAACW,kBAAkB;MAClDC,YAAY,EAAE,CAAC;MACfL,aAAa,EAAE,KAAK;MACpBM,UAAU,EAAE,QAAQ;MACpBC,cAAc,EAAE,QAAQ;MACxBC,eAAe,EAAE,CAAC;MAClBC,iBAAiB,EAAE,CAAC;MACpBC,QAAQ,EAAE,EAAE;MACZC,SAAS,EAAE,EAAE;MACbC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,KAAK,EAAE,EAAE;QACT1B,YAAY,EAAE,CAAC;QACfuC,OAAO,EAAC,CAAC;QACTjC,SAAS,EAAE;MACb;IACF;EACJ,CAAC,CAAC;EAEFjB,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACxCU,IAAI,EAAE;MACJ4C,OAAO,EAAE;IACX,CAAC;IACDb,MAAM,EAAE;MACNpC,IAAI,EAAG;QACLO,eAAe,EAAEV,cAAc,CAACqD;MAClC;IACF;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -12,6 +12,7 @@ import { BaseNumberComponent, BaseNumberState } from '@wavemaker/app-rn-runtime/
12
12
  import { isNull } from "lodash";
13
13
  import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
14
14
  import { countDecimalDigits, validateInputOnDevice } from '@wavemaker/app-rn-runtime/core/utils';
15
+ import { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';
15
16
  export class WmCurrencyState extends BaseNumberState {
16
17
  constructor(...args) {
17
18
  super(...args);
@@ -42,6 +43,13 @@ export default class WmCurrency extends BaseNumberComponent {
42
43
  classes.push(super.getStyleClassName());
43
44
  return classes.join(' ');
44
45
  }
46
+ renderTextSkeleton(props) {
47
+ return this.props.floatinglabel ? /*#__PURE__*/React.createElement(React.Fragment, null, createSkeleton(this.theme, {}, {
48
+ ...props
49
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, createSkeleton(this.theme, {}, {
50
+ ...this.styles.skeleton.root
51
+ }));
52
+ }
45
53
  renderWidget(props) {
46
54
  var _this$state$textValue;
47
55
  let opts = {};
@@ -50,10 +58,10 @@ export default class WmCurrency extends BaseNumberComponent {
50
58
  return /*#__PURE__*/React.createElement(View, {
51
59
  style: this.styles.root
52
60
  }, /*#__PURE__*/React.createElement(View, {
53
- style: this.styles.labelWrapper
54
- }, /*#__PURE__*/React.createElement(Text, {
61
+ style: this._showSkeleton && !this.props.floatinglabel ? this.styles.skeletonLabelWrapper.root : this.styles.labelWrapper
62
+ }, this._showSkeleton ? /*#__PURE__*/React.createElement(React.Fragment, null, this.renderTextSkeleton(this.styles.skeletonLabel.root)) : /*#__PURE__*/React.createElement(Text, {
55
63
  style: this.styles.label
56
- }, this.state.currencySymbol)), /*#__PURE__*/React.createElement(View, {
64
+ }, this.state.currencySymbol)), this._showSkeleton ? /*#__PURE__*/React.createElement(React.Fragment, null, this.renderTextSkeleton(this.styles.skeletonTextInputWrapper.root)) : /*#__PURE__*/React.createElement(View, {
57
65
  style: {
58
66
  flex: 1
59
67
  }
@@ -68,13 +76,15 @@ export default class WmCurrency extends BaseNumberComponent {
68
76
  },
69
77
  keyboardType: "numeric",
70
78
  placeholderTextColor: this.styles.placeholderText.color,
71
- style: [this.styles.input, this.styles.text, this.state.isValid ? {} : this.styles.invalid]
79
+ isInputFocused: this.state.isInputFocused,
80
+ style: [this.styles.input, this.styles.text, this.state.isValid ? {} : this.styles.invalid, this.state.isInputFocused ? this.styles.focused : {}]
72
81
  }, opts, {
73
82
  floatingLabel: props.floatinglabel,
74
83
  floatingLabelStyle: this.styles.floatingLabel,
75
84
  activeFloatingLabelStyle: this.styles.activeFloatingLabel,
76
85
  editable: props.disabled || props.readonly ? false : true,
77
86
  placeholder: props.placeholder,
87
+ background: this._background,
78
88
  onBlur: this.onBlur.bind(this),
79
89
  onFocus: this.onFocus.bind(this),
80
90
  onKeyPress: this.validateInputEntry.bind(this),