Adam Shaw 6 лет назад
Родитель
Сommit
348d70db98

+ 25 - 9
packages/core/src/styles/_button-group.scss

@@ -24,16 +24,32 @@
   z-index: 1;
 }
 
-.fc-button-group > .fc-button:not(:first-child) {
-  margin-left: -1px;
-}
+.fc-ltr {
+
+  .fc-button-group > .fc-button:not(:first-child) {
+    margin-left: -1px;
+    border-top-left-radius: 0;
+    border-bottom-left-radius: 0;
+  }
+
+  .fc-button-group > .fc-button:not(:last-child) {
+    border-top-right-radius: 0;
+    border-bottom-right-radius: 0;
+  }
 
-.fc-button-group > .fc-button:not(:last-child) {
-  border-top-right-radius: 0;
-  border-bottom-right-radius: 0;
 }
 
-.fc-button-group > .fc-button:not(:first-child) {
-  border-top-left-radius: 0;
-  border-bottom-left-radius: 0;
+.fc-rtl {
+
+  .fc-button-group > .fc-button:not(:first-child) {
+    margin-right: -1px;
+    border-top-right-radius: 0;
+    border-bottom-right-radius: 0;
+  }
+
+  .fc-button-group > .fc-button:not(:last-child) {
+    border-top-left-radius: 0;
+    border-bottom-left-radius: 0;
+  }
+
 }

+ 15 - 6
packages/core/src/styles/_toolbar.scss

@@ -13,17 +13,26 @@
   margin-top: 1.5em;
 }
 
-/* inner content */
-
-.fc-toolbar > * > :not(:first-child) {
-  margin-left: .75em; // space between
-}
-
 .fc-toolbar h2 {
   font-size: 1.75em;
   margin: 0;
 }
 
+.fc-ltr {
+
+  .fc-toolbar > * > :not(:first-child) {
+    margin-left: .75em; // space between
+  }
+
+}
+
+.fc-rtl {
+
+  .fc-toolbar > * > :not(:first-child) {
+    margin-right: .75em; // space between
+  }
+
+}
 
 @media print {
 

+ 3 - 18
packages/daygrid/src/TableEvents.ts

@@ -111,7 +111,6 @@ export function renderSegRows(segs: Seg[], rowCnt: number, colCnt: number, rende
 // the segments. Returns object with a bunch of internal data about how the render was calculated.
 // NOTE: modifies rowSegs
 function renderSegRow(row, rowSegs, colCnt: number, renderIntro, context: ComponentContext) {
-  let { isRtl } = context
   let segLevels = buildSegLevels(rowSegs, context) // group into sub-arrays of levels
   let levelCnt = Math.max(1, segLevels.length) // ensure at least one level
   let tbody = document.createElement('tbody')
@@ -135,12 +134,7 @@ function renderSegRow(row, rowSegs, colCnt: number, renderIntro, context: Compon
         td.rowSpan = (td.rowSpan || 1) + 1
       } else {
         td = document.createElement('td')
-
-        if (isRtl) {
-          tr.insertBefore(td, tr.firstChild)
-        } else {
-          tr.appendChild(td)
-        }
+        tr.appendChild(td)
       }
       cellMatrix[i][col] = td
       loneCellMatrix[i][col] = td
@@ -182,23 +176,14 @@ function renderSegRow(row, rowSegs, colCnt: number, renderIntro, context: Compon
           col++
         }
 
-        if (isRtl) {
-          tr.insertBefore(td, tr.firstChild)
-        } else {
-          tr.appendChild(td)
-        }
+        tr.appendChild(td)
       }
     }
 
     emptyCellsUntil(colCnt) // finish off the row
 
     let introEls = renderVNodes(renderIntro(), context)
-
-    if (isRtl) {
-      appendToElement(tr, introEls)
-    } else {
-      prependToElement(tr, introEls)
-    }
+    prependToElement(tr, introEls)
 
     tbody.appendChild(tr)
   }

+ 4 - 25
packages/daygrid/src/TableFills.tsx

@@ -84,7 +84,6 @@ function detachSegs(els: HTMLElement[]) {
 
 // Generates the HTML needed for one row of a fill. Requires the seg's el to be rendered.
 function renderFillRow(seg: Seg, { colCnt, type, renderIntro, colGroupNode }: TableFillsProps, context: ComponentContext): HTMLElement {
-  let { isRtl } = context
   let startCol = seg.firstCol
   let endCol = seg.lastCol + 1
   let className
@@ -110,39 +109,19 @@ function renderFillRow(seg: Seg, { colCnt, type, renderIntro, colGroupNode }: Ta
 
   if (startCol > 0) {
     let emptyCellHtml = new Array(startCol + 1).join(EMPTY_CELL_HTML) // will create (startCol + 1) td's
-
-    if (isRtl) {
-      prependToElement(trEl, emptyCellHtml)
-    } else {
-      appendToElement(trEl, emptyCellHtml)
-    }
+    appendToElement(trEl, emptyCellHtml)
   }
 
   ;(seg.el as HTMLTableCellElement).colSpan = endCol - startCol
-
-  if (isRtl) {
-    trEl.insertBefore(seg.el, trEl.firstChild)
-  } else {
-    trEl.appendChild(seg.el)
-  }
+  trEl.appendChild(seg.el)
 
   if (endCol < colCnt) {
     let emptyCellHtml = new Array(colCnt - endCol + 1).join(EMPTY_CELL_HTML)
-
-    if (isRtl) {
-      prependToElement(trEl, emptyCellHtml)
-    } else {
-      appendToElement(trEl, emptyCellHtml)
-    }
+    appendToElement(trEl, emptyCellHtml)
   }
 
   let introEls = renderVNodes(renderIntro(), context)
-
-  if (isRtl) {
-    appendToElement(trEl, introEls)
-  } else {
-    prependToElement(trEl, introEls)
-  }
+  prependToElement(trEl, introEls)
 
   return skeletonEl
 }