playbook_ui 12.31.0.pre.alpha.customiconsfa928 → 12.31.0.pre.alpha.datepickerdisableddatefix931

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e5f294819c764e724a6794cac4310d57aaf738894c2ffcf4dbcd9d7ada25953
4
- data.tar.gz: '084cfd995463e4d69d3f4071ca8a5c34fec10276d9181866a1681a6f78b45dcf'
3
+ metadata.gz: 654d556d34f5a4d85545aff221a0ad40d54b0f09c6f5a26d74dbd99b346ce57d
4
+ data.tar.gz: 3ae3d76e2d79224c105d7b8c53c7f7c9033cda03505d55cc4222262926e9a580
5
5
  SHA512:
6
- metadata.gz: fdaadc126dabfad4e105334e37a9056fb4df6c0981e91c22dd5fbc6d6cb1ed145d9217f580229b8c08e576e890722636db7199c8ceedac1956179e575d389f70
7
- data.tar.gz: ca38cac25050fd1f429ec570adab8d2b00835025806e23cbd86cb0cc1e350e586132d49a91131e10f859cfa49fa630c036abba890942f3e717ece2253bc02ab3
6
+ metadata.gz: 1e0ed9fa251b5130bcdfc146ea0e1144b2273424c5f8171fc12b573ada98fbf2ca743d7467602d6d904b65c16fb8976ed51133461bb6497cff4dc038823100b4
7
+ data.tar.gz: a8dcf56f0adeed47b1e403318feec0a711f9d45dbc6617e26bdb19533fe055552a61bfeb05663141b49d28810f12f3e62397f8177ffa07e6510533a5972f1b5b
@@ -2,7 +2,6 @@
2
2
  import './_playbook.scss'
3
3
  import 'lazysizes/plugins/attrchange/ls.attrchange'
4
4
  import 'lazysizes'
5
- import './custom-icons'
6
5
 
7
6
  // vvv React Component JSX Imports from the React Kits vvv
8
7
  export { default as Avatar } from './pb_avatar/_avatar'
@@ -130,4 +129,4 @@ export { default as PbTypeahead } from './pb_typeahead'
130
129
  export { default as dialogHelper } from './pb_dialog/dialogHelper'
131
130
 
132
131
  //Theming
133
- export {default as mapTheme} from './pb_map/pbMapTheme'
132
+ export {default as mapTheme} from './pb_map/pbMapTheme'
@@ -71,13 +71,42 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
71
71
  }
72
72
  }
73
73
  const disabledParser = () => {
74
- if (disableDate && disableDate.length > 0) {
75
- return disableDate
76
- } else if (disableRange && disableRange.length > 0) {
77
- return disableRange
78
- } else {
79
- return []
80
- }
74
+ const disabledArray=[]
75
+
76
+ disableDate && disableDate.length > 0 && disabledArray.push(...disableDate)
77
+ disableRange && disableRange.length > 0 && disabledArray.push(...disableRange)
78
+ disableWeekdays && disableWeekdays.length > 0 && disabledArray.push(...disabledWeekDays())
79
+
80
+ return disabledArray
81
+ }
82
+
83
+ const disabledWeekDays = () => {
84
+ return (
85
+ [
86
+ (date:any) => {
87
+ const weekdayObj: {
88
+ [day: string]: number
89
+ } = {
90
+ Sunday: 0,
91
+ Monday: 1,
92
+ Tuesday: 2,
93
+ Wednesday: 3,
94
+ Thursday: 4,
95
+ Friday: 5,
96
+ Saturday: 6,
97
+ }
98
+ return (
99
+ date.getDay() === weekdayObj[disableWeekdays[0]] ||
100
+ date.getDay() === weekdayObj[disableWeekdays[1]] ||
101
+ date.getDay() === weekdayObj[disableWeekdays[2]] ||
102
+ date.getDay() === weekdayObj[disableWeekdays[3]] ||
103
+ date.getDay() === weekdayObj[disableWeekdays[4]] ||
104
+ date.getDay() === weekdayObj[disableWeekdays[5]] ||
105
+ date.getDay() === weekdayObj[disableWeekdays[6]]
106
+ )
107
+ },
108
+ ]
109
+ )
81
110
  }
82
111
  const calendarResizer = () => {
83
112
  const cal = document.querySelector(`#cal-${pickerId}.open`) as HTMLElement
@@ -127,30 +156,7 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
127
156
  disableMobile: true,
128
157
  dateFormat: getDateFormat(),
129
158
  defaultDate: defaultDateGetter(),
130
- disable: disableWeekdays && disableWeekdays.length > 0 ? [
131
- (date) => {
132
- const weekdayObj: {
133
- [day: string]: number
134
- } = {
135
- Sunday: 0,
136
- Monday: 1,
137
- Tuesday: 2,
138
- Wednesday: 3,
139
- Thursday: 4,
140
- Friday: 5,
141
- Saturday: 6,
142
- }
143
- return (
144
- date.getDay() === weekdayObj[disableWeekdays[0]] ||
145
- date.getDay() === weekdayObj[disableWeekdays[1]] ||
146
- date.getDay() === weekdayObj[disableWeekdays[2]] ||
147
- date.getDay() === weekdayObj[disableWeekdays[3]] ||
148
- date.getDay() === weekdayObj[disableWeekdays[4]] ||
149
- date.getDay() === weekdayObj[disableWeekdays[5]] ||
150
- date.getDay() === weekdayObj[disableWeekdays[6]]
151
- )
152
- },
153
- ] : disabledParser(),
159
+ disable: disabledParser(),
154
160
  enableTime,
155
161
  locale: {
156
162
  rangeSeparator: ' to '
@@ -34,7 +34,7 @@ type IconProps = {
34
34
  pulse?: boolean,
35
35
  rotation?: 90 | 180 | 270,
36
36
  size?: IconSizes,
37
- fontStyle?: 'far' | 'fas' | 'fab' | 'fak',
37
+ fontStyle?: 'far' | 'fas' | 'fab',
38
38
  spin?: boolean,
39
39
  } & GlobalProps
40
40
 
@@ -76,7 +76,6 @@ const Icon = (props: IconProps) => {
76
76
  [`fa-${size}`]: size,
77
77
  [`fa-pull-${pull}`]: pull,
78
78
  [`fa-rotate-${rotation}`]: rotation,
79
-
80
79
  }
81
80
 
82
81
  // Lets check and see if the icon prop is referring to a custom Power icon...
@@ -84,15 +83,11 @@ const Icon = (props: IconProps) => {
84
83
  // this ensures the JS will not do any further operations
85
84
  // faClasses[`fa-${icon}`] = customIcon ? 'custom' : icon
86
85
  if (!customIcon) faClasses[`fa-${icon}`] = icon
87
-
88
- const whiteList = [
89
- 'greensky', 'powergon'
90
- ]
91
-
86
+
92
87
  const classes = classnames(
93
88
  flipMap[flip],
94
89
  'pb_icon_kit',
95
- customIcon ? '' : whiteList.includes(icon) ? `fak` : fontStyle,
90
+ customIcon ? '' : fontStyle,
96
91
  faClasses,
97
92
  globalProps(props),
98
93
  className
@@ -115,7 +110,6 @@ const Icon = (props: IconProps) => {
115
110
  return emojiRegex.test(emoji);
116
111
  };
117
112
 
118
-
119
113
  // Add a conditional here to show only the SVG if custom
120
114
  const displaySVG = (customIcon: any) => {
121
115
  if (customIcon)
@@ -33,7 +33,7 @@ module Playbook
33
33
  values: ["lg", "xs", "sm", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x", nil],
34
34
  default: nil
35
35
  prop :font_style, type: Playbook::Props::Enum,
36
- values: %w[far fas fab fak],
36
+ values: %w[far fas fab],
37
37
  default: "far"
38
38
  prop :spin, type: Playbook::Props::Boolean,
39
39
  default: false
@@ -140,13 +140,7 @@ module Playbook
140
140
  end
141
141
 
142
142
  def font_style_class
143
- white_list = %w[powergon greensky]
144
-
145
- if white_list.include?(icon)
146
- "fak"
147
- elsif font_style
148
- font_style.to_s
149
- end
143
+ font_style ? font_style.to_s : "far"
150
144
  end
151
145
 
152
146
  def spin_class